[
  {
    "path": ".editorconfig",
    "content": "# http://editorconfig.org\n\nroot = true\n\n[*]\nindent_style = space\nindent_size = 4\ntrim_trailing_whitespace = true\ninsert_final_newline = true\ncharset = utf-8\nend_of_line = lf\n\n[*.bat]\nindent_style = tab\nend_of_line = crlf\n\n[LICENSE]\ninsert_final_newline = false\n\n[Makefile]\nindent_style = tab\n"
  },
  {
    "path": ".flake8",
    "content": "[flake8]\nmax-line-length = 88\nselect = C,E,F,W,B,B950\nignore = E203, E501, W503, B950\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "content": "* fhir.resources version:\n* Python version:\n* Operating System:\n\n### Description\n\nDescribe what you were trying to get done.\nTell us what happened, what went wrong, and what you expected to happen.\n\n### What I Did\n\n```\nPaste the command(s) you ran and the output.\nIf there was a crash, please include the traceback here.\n```\n"
  },
  {
    "path": ".github/workflows/ci.yaml",
    "content": "name: CI\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n  workflow_dispatch:\n  merge_group:\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}\n  cancel-in-progress: true\n\npermissions:\n  contents: read\n\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: true\n      max-parallel: 4\n      matrix:\n        python-version: [\"3.8\", \"3.9\", \"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n    steps:\n      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1\n        with:\n          persist-credentials: false\n      - name: Install uv\n        uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0\n        id: setup-uv\n        with:\n          python-version: ${{ matrix.python-version }}\n          activate-environment: true\n      - name: Install dependencies\n        run: |\n          uv run python --version\n          uv pip install -e .[test]\n      - run: uv run flake8 ./fhir/resources/\n      - run: uv run black --check fhir/resources/\n      # monthly cache updates\n      - run: echo \"cache_id=$(date --utc '+%m')\" >> \"$GITHUB_ENV\"\n      - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1\n        with:\n          key: fhir-resources-${{ env.cache_id }}\n          path: .cache\n          restore-keys: |\n            fhir-resources-\n      - name: Run main tests with Python ${{ matrix.python-version }}\n        run: |\n          which pytest\n          uv run pytest tests\n      - name: Run STU3 tests with Python ${{ matrix.python-version }}\n        run: |\n          uv run pytest fhir/resources/STU3/tests\n      - name: Run R4B tests with Python ${{ matrix.python-version }}\n        run: |\n          uv run pytest -s --cov=fhir/resources/R4B/tests -s --tb=native -v --cov-report term-missing --cov-append fhir/resources/R4B/tests\n      - name: Run R5 tests with Python ${{ matrix.python-version }}\n        run: |\n          uv run pytest -s --cov=fhir/resources/tests -s --tb=native -v --cov-report term-missing --cov-append fhir/resources/tests\n"
  },
  {
    "path": ".gitignore",
    "content": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packaging\n.Python\nenv/\nbuild/\ndevelop-eggs/\ndist/\ndownloads/\neggs/\n.eggs/\nlib/\nlib64/\nparts/\nsdist/\nvar/\nwheels/\n*.egg-info/\n.installed.cfg\n*.egg\n\n# PyInstaller\n#  Usually these files are written by a python script from a template\n#  before PyInstaller builds the exe, so as to inject date/other infos into it.\n*.manifest\n*.spec\n\n# Installer logs\npip-log.txt\npip-delete-this-directory.txt\n\n# Unit test / coverage reports\nhtmlcov/\n.tox/\n.coverage\n.coverage.*\n.cache\nnosetests.xml\ncoverage.xml\n*.cover\n.hypothesis/\n.pytest_cache/\n\n# Translations\n*.mo\n*.pot\n\n# Django stuff:\n*.log\nlocal_settings.py\n\n# Flask stuff:\ninstance/\n.webassets-cache\n\n# Scrapy stuff:\n.scrapy\n\n# Sphinx documentation\ndocs/_build/\n\n# PyBuilder\ntarget/\n\n# Jupyter Notebook\n.ipynb_checkpoints\n\n# pyenv\n.python-version\n\n# celery beat schedule file\ncelerybeat-schedule\n\n# SageMath parsed files\n*.sage.py\n\n# dotenv\n.env\n\n# virtualenv\n.venv\nvenv/\nENV/\n\n# Spyder project settings\n.spyderproject\n.spyproject\n\n# Rope project settings\n.ropeproject\n\n# mkdocs documentation\n/site\n\n# mypy\n.mypy_cache/\n# editor\n.idea\n.vscode\n# Others\n/pip-wheel-metadata\n/fhir-parser\n.DS_Store\n"
  },
  {
    "path": ".isort.cfg",
    "content": "[settings]\nmulti_line_output=3\ninclude_trailing_comma=True\nforce_grid_wrap=0\nuse_parentheses=True\nline_length=88\n"
  },
  {
    "path": ".travis.yml",
    "content": "# Config file for automatic testing at travis-ci.org\nlanguage: python\njobs:\n  include:\n    - name: \"Python 3.8 on Linux (dist:jammy)\"\n      os: linux\n      dist: jammy\n      language: python\n      python: 3.8\n      env: python_version=3.8\n\n    - name: \"Python 3.9 on Linux (dist:jammy)\"\n      os: linux\n      dist: jammy\n      language: python\n      python: 3.9\n      env: python_version=3.9\n\n    - name: \"Python 3.10 on Linux (dist:jammy)\"\n      os: linux\n      dist: jammy\n      language: python\n      python: 3.10\n      env: python_version=3.10\n\n    - name: \"Python 3.11 on Linux (dist:jammy)\"\n      os: linux\n      dist: jammy\n      language: python\n      python: 3.11\n      env: python_version=3.11\n\n    - name: \"Python 3.12 on Linux (dist:jammy)\"\n      os: linux\n      dist: jammy\n      language: python\n      python: 3.12\n      env: python_version=3.12\n\n    -   name: \"Python 3.13 on Linux (dist:jammy)\"\n        os: linux\n        dist: jammy\n        language: python\n        python: 3.13\n        env: python_version=3.13\n\n  allow_failures:\n    - python: 3.12\n    - python: 3.13\n\ncache:\n  directories:\n    - eggs\n    - $HOME/.cache/pip\ninstall:\n  - pip install -U pip\n  - pip install -e .[test]\n  - pip install codecov\n  - sleep 1\nscript:\n  - make clean\n  - make lint\n  - black --check --verbose fhir/resources/\n  - pytest tests\n  - pytest fhir/resources/STU3/tests\n  - pytest -s --cov=fhir/resources/R4B/tests -s --tb=native -v --cov-report term-missing --cov-append fhir/resources/R4B/tests\n  - pytest -s --cov=fhir/resources/tests -s --tb=native -v --cov-report term-missing --cov-append fhir/resources/tests\nafter_success:\n  - codecov\n"
  },
  {
    "path": "AUTHORS.rst",
    "content": "=======\nCredits\n=======\n\nDevelopment Lead\n----------------\n\n* Md Nazrul Islam <email2nazrul@gmail.com>\n\nContributors\n------------\n\n* Mike Mabey[mmabey]\n* Simon Vadée [simonvadee] <simon@arkhn.com>\n* [iatechicken]\n* Itay Goren\n* Melvin Hazeleger [melvio]\n* Bidimpata-Kerim Aramyan-Tshimanga [Tshimanga]\n* Alexander Essenwanger [cybernop]\n* Matthias Schoettle [mschoettle]\n"
  },
  {
    "path": "CONTRIBUTING.rst",
    "content": ".. highlight:: shell\n\n============\nContributing\n============\n\nContributions are welcome, and they are greatly appreciated! Every little bit\nhelps, and credit will always be given.\n\nYou can contribute in many ways:\n\nTypes of Contributions\n----------------------\n\nReport Bugs\n~~~~~~~~~~~\n\nReport bugs at https://github.com/nazrulworld/fhir.resources/issues.\n\nIf you are reporting a bug, please include:\n\n* Your operating system name and version.\n* Any details about your local setup that might be helpful in troubleshooting.\n* Detailed steps to reproduce the bug.\n\nFix Bugs\n~~~~~~~~\n\nLook through the GitHub issues for bugs. Anything tagged with \"bug\" and \"help\nwanted\" is open to whoever wants to implement it.\n\nImplement Features\n~~~~~~~~~~~~~~~~~~\n\nLook through the GitHub issues for features. Anything tagged with \"enhancement\"\nand \"help wanted\" is open to whoever wants to implement it.\n\nWrite Documentation\n~~~~~~~~~~~~~~~~~~~\n\nfhir.resources could always use more documentation, whether as part of the\nofficial fhir.resources docs, in docstrings, or even on the web in blog posts,\narticles, and such.\n\nSubmit Feedback\n~~~~~~~~~~~~~~~\n\nThe best way to send feedback is to file an issue at https://github.com/nazrulworld/fhir.resources/issues.\n\nIf you are proposing a feature:\n\n* Explain in detail how it would work.\n* Keep the scope as narrow as possible, to make it easier to implement.\n* Remember that this is a volunteer-driven project, and that contributions\n  are welcome :)\n\nGet Started!\n------------\n\nReady to contribute? Here's how to set up `fhir.resources` for local development.\n\n1. Fork the `fhir.resources` repo on GitHub.\n2. Clone your fork locally::\n\n    $ git clone git@github.com:your_name_here/fhir.resources.git\n\n3. Install your local copy into a virtualenv. Assuming you have pipenv installed\n   (but don't worry you could use simply virtualenv and install from ``requirements_dev.txt ),\n   this is how you set up your fork for local development::\n\n    $ cd fhir.resources/\n    $ pipenv install --dev\n\n4. Create a branch for local development::\n\n    $ git checkout -b name-of-your-bugfix-or-feature\n\n   Now you can make your changes locally.\n\n5. When you're done making changes, check that your changes pass flake8 and the\n   tests, including testing other Python versions with tox::\n\n    $ flake8 fhir.resources tests\n    $ python setup.py test or py.test\n    $ tox\n\n   To get flake8 and tox, just pip install them into your virtualenv.\n\n6. Commit your changes and push your branch to GitHub::\n\n    $ git add .\n    $ git commit -m \"Your detailed description of your changes.\"\n    $ git push origin name-of-your-bugfix-or-feature\n\n7. Submit a pull request through the GitHub website.\n\nPull Request Guidelines\n-----------------------\n\nBefore you submit a pull request, check that it meets these guidelines:\n\n1. The pull request should include tests.\n2. If the pull request adds functionality, the docs should be updated. Put\n   your new functionality into a function with a docstring, and add the\n   feature to the list in README.rst.\n3. The pull request should work for Python 2.7, 3.4, 3.5 and 3.6, and for PyPy. Check\n   https://travis-ci.org/nazrulworld/fhir.resources/pull_requests\n   and make sure that the tests pass for all supported Python versions.\n\nTips\n----\n\nTo run a subset of tests::\n\n$ py.test tests.test_fhir.resources\n\n\nDeploying\n---------\n\nA reminder for the maintainers on how to deploy.\nMake sure all your changes are committed (including an entry in HISTORY.rst).\nThen run::\n\n$ bumpversion patch # possible: major / minor / patch\n$ git push\n$ git push --tags\n\nTravis will then deploy to PyPI if tests pass.\n\n\nAdding a new resource\n---------------------\n\nAdding a new resource should be done under the relevant directory.\nFor R4, the directory is `fhir/resources/` and for DSTU2 and STU3 the\ndirectories are `fhir/resources/DSTU2/` and `fhir/resources/STU3/`.\n\nAfter adding you resource, you need to add it to couple of additional places:\n1. `fhirtypes.py` in the FHIR version your resource belongs to. This includes\n   both the resource and the inner elements you created for it.\n2. Add relevant entries inside the list `MODEL_CLASSES` at\n   `fhirtypesvalidators.py`. Probably you will need to add\n   `(None, .your_resource_module_name)`.\n3. Add validator functions in `fhirtypesvalidators.py` for both your resource\n   and the inner resources you created.\n4. Add the validator methods you created to the list at the bottom of the file.\n\nLastly, add your tests into the `tests` directory inside the relevant directory\nwhere you created your resource.\n"
  },
  {
    "path": "HISTORY.rst",
    "content": "=======\nHistory\n=======\n\n8.2.1 (unreleased)\n------------------\n\n- Nothing changed yet.\n\n\n8.2.0 (2026-02-02)\n------------------\n\n- Type aliases are added for all types during type checking. [mschoettle]\n- Minimum requirement for ``fhir-core`` version is now ``1.1.5`` which naturally comes with some bug fixes. See here https://github.com/nazrulworld/fhir-core/blob/main/HISTORY.rst#115-2026-01-29\n\n\n8.1.0 (2025-07-10)\n------------------\n\nNew features\n\n- Issue #181 ``summary`` (https://www.hl7.org/fhir/search.html#_summary) mode feature added.\n\nFixes\n\n- Issue #184 pyright struggles with default position args.\n- Issue #186 missing py.typed marker, causing mypy import errors.\n- Issue #183 Pydantic 2.11+ Deprecation Warnings: model_fields Should Be Accessed on Class, Not Instance.\n\n8.0.0 (2024-12-25)\n------------------\n\n- The minimum required version for ``fhir-core`` is ``1.0.0``, which obviously comes with new features and bug fixes. For example xml serialization/deserialization. `See changes log here <https://github.com/nazrulworld/fhir-core/blob/1.0.0/HISTORY.rst#100-2024-12-25>`_\n\n- Issue #168 https://github.com/nazrulworld/fhir.resources/issues/166\n\n8.0.0b4 (2024-10-24)\n--------------------\n\n-  `PR#160 <https://github.com/nazrulworld/fhir.resources/pull/160>`_ switch the type of Element.id from id to string for R4B [cybernop]\n\n\n8.0.0b3 (2024-10-10)\n--------------------\n\n- Minimum version of ``fhir-core`` package have been updated.\n- All of fhir resources are regenerated for to comply with the optionality of fhir model's field. Issue https://github.com/nazrulworld/fhir.resources/issues/164\n\n\n8.0.0b2 (2024-10-02)\n--------------------\n\n- `Issue #164 <https://github.com/nazrulworld/fhir.resources/issues/164>`_ ``get_fhir_model_class`` is now available and can be imported from base package. For example ``from fhir.resources import get_fhir_model_class`` or ``from fhir.resources.STU3 import get_fhir_model_class``\n\n\n8.0.0b1 (2024-08-05)\n--------------------\n\nBreaking\n\n- Drop support for python 3.7\n\n- FHIR DTU2 packages are no longer available.\n\n\n7.1.0 (2023-12-14)\n------------------\n\nNew features\n\nSee migration guide.\n\nBreaking\n\n- Drop support for python 3.6.\n- Drop support for pydantic v1.\n- The function ``FHIRAbstractModel::add_root_validator`` is no longer available.\n\nDeprecations\n\nSome of functions from ``FHIRAbstractModel`` are deprecated to comply with Pydantic V2. Some are\n\n- ``FHIRAbstractModel::dict``\n\n- ``FHIRAbstractModel::json``\n\n- ``FHIRAbstractModel::parse_obj``\n\n- ``FHIRAbstractModel::parse_raw``: no longer supports xml and yaml data.\n\n- ``FHIRAbstractModel::parse_file``: no longer supports xml and yaml file.\n\n\n\nImprovements\n\n- `Issue 133 <https://github.com/nazrulworld/fhir.resources/issues/133>`_ Pydantic 2.0 migration plan. It's not fully migration though, instead of using of Pydantic V1 API.\n- `Issue 144 <https://github.com/nazrulworld/fhir.resources/issues/144>`_ Parsing XML byte string MESH acknowledgment response.\n\n\n7.0.2 (2023-07-03)\n------------------\n\n-  `Issue 124 <https://github.com/nazrulworld/fhir.resources/issues/134>`_ on the wake of 2.x pydantic release, pydantic's max version restriction added.\n\n\n7.0.1 (2023-05-29)\n------------------\n\nFixes\n\n- Issue #128 `pkg_resources.declare_namespace deprecation <https://github.com/nazrulworld/fhir.resources/issues/128>`_\n\n- Issue #129 `urn not supported in Url <https://github.com/nazrulworld/fhir.resources/issues/129>`_\n\n7.0.0 (2023-04-08)\n------------------\n\nNew Feature\n\n- Support for `FHIR version R5 <https://www.hl7.org/fhir/R5/resourcelist.html>`_ has been added under root package.\n\n\nBreaking\n\n- All root resources (FHIR version R4B) are moved under sub-package ``R4B``. Have a look at the migration guide.\n\n\n6.5.0 (2023-01-01)\n------------------\n\nBreaking\n\n- FHIR R4B release has been overlapped on current R4 as default release. See changes (Release R4B: May 28, 2022) http://hl7.org/fhir/R4B/history.html. More detail at http://hl7.org/fhir/R4B/diff.html\n\nImprovements\n\n- Issue #90 logging level downgraded from warning to debug.\n- Primitive `URL` type is now accepting the relative path without prefix \"/\".\n\n\n6.4.0 (2022-05-11)\n------------------\n\nBugfixes\n\n- Fix, primitive extension was not included if primitive field value is null. [nazrulworld]\n- Issue `#101 ElementDefinition.id typing is incorrect <https://github.com/nazrulworld/fhir.resources/issues/101>`_\n\nImprovements\n\n- Issue `#97 <https://github.com/nazrulworld/fhir.resources/issues/97>`_ Now null value accepted as a member of String List.\n- Primitive DataType `Ùrl`` is now accepting relative path.\n\nBreaking\n\n- ``Element.id`` & ``Resource.id`` don't have any extension. See https://chat.fhir.org/#narrow/stream/179166-implementers/topic/Resource.2Eid.20and.20primitive.20extension.\n\n6.2.2 (2022-04-02)\n------------------\n\n- Issue `#96 <https://github.com/nazrulworld/fhir.resources/issues/96>`_, fixes datetime's ISO format representation for YAML. [nazrulworld]\n\n\n6.2.1 (2022-01-14)\n------------------\n\n- Issues `#89 <https://github.com/nazrulworld/fhir.resources/issues/89>`_ & `#90 <https://github.com/nazrulworld/fhir.resources/issues/90>`_ possible breaking for ``FHIRAbstractModel.dict`` (if pydnatic specific extra argument has been provided) is neutralized.[nazrulworld]\n\n\n6.2.0 (2022-01-01)\n------------------\n\nBugfixes\n\n- Issue #88 fixes typo mistake. Resource name const  was wrong. [nazrulworld]\n\n\n6.2.0b3 (2021-06-26)\n--------------------\n\nNew Feature\n\n- String type class is now configurable, it is possible to allow empty str value.\n\nBugfixes\n\n- Issue #75 Remove \"tests\" from installed package.\n- Issue `#74 When are Falsy values evaluated as None? <https://github.com/nazrulworld/fhir.resources/issues/74>`_\n\n- Fixes some issues for DSTU2 https://github.com/nazrulworld/fhir.resources/pull/71 & https://github.com/nazrulworld/fhir.resources/pull/70 [ItayGoren]\n\n\n6.2.0b2 (2021-04-05)\n--------------------\n\nNew Feature\n\n- Parsing YAML file or string/bytes contents, now accept extra parameter ``loader`` class.\n- Parsing from XML file or string/bytes contents are now supported. With possible to provide xmlparser for schema validation purpose.\n\nBugfixes\n\n- Added correct fhir version name into Primitive Type Base class for ``STU3`` and ``DSTU2``.\n\n\n6.2.0b1 (2021-03-31)\n--------------------\n\nNew Feature\n\n- `Issue #47 <https://github.com/nazrulworld/fhir.resources/issues/47>`_ add YAML support.\n- `Issue #51 <https://github.com/nazrulworld/fhir.resources/issues/51>`_ Help on converting XML to FHIR format.\n- `Issue #63 <https://github.com/nazrulworld/fhir.resources/issues/63>`_ Now JSON output key's sequence is matching with original FHIR specification.\n\nBreaking\n\n- ``FHIRAbstractModel.json()`` and ``FHIRAbstractModel.dict()`` parameters signatures are more FHIR specific and additional parameters are removed (pydantic specific).\n\n\nBugfixes\n\n- Added missing ``element_property`` field attribute for class ``FHIRPrimitiveExtension``.\n\n6.1.0 (2021-02-13)\n------------------\n\n- Breaking/Fixes: `PR#48 <https://github.com/nazrulworld/fhir.resources/pull/48>`_ ``Resource.id`` type has been replaced with ``fhirtypes.Id`` from ``fhirtypes.String`` (only for R4) [ItayGoren]\n\n- Fixes: constraints regex for fhirtypes ``Id``, ``Code``, ``Integer``, ``Decimal``, ``UnsignedInt``, ``PositiveInt`` and so on. [nazrulworld]\n\n\n6.0.0 (2020-12-17)\n------------------\n\n- Issue #21 Remaining resources are added. [iatechicken]\n\n\n6.0.0b11 (2020-11-25)\n---------------------\n\n- Fixes: wrong ``ClaimResponseAddItemAdjudicationType`` resource type name into ``DTSU2``.\n\n\n6.0.0b10 (2020-11-15)\n---------------------\n\nImprovements\n\n- ``FHIRAbstractModel::add_root_validator`` is more improved and practical with proper validation, more now possible provide class method as root validator.\n\n\nBugfixes\n\n- `Issue #41 <https://github.com/nazrulworld/fhir.resources/issues/41>`_ pydantic.errors.ConfigError: duplicate validator function.\n\n6.0.0b9 (2020-11-05)\n--------------------\n\nImprovements\n\n- Now supports of ``simplejson`` is available automatically (depends on importable) along side with ``orjson`` and default ``json`` library.\n  Order of json serializer available (orjson -> simplejson(as fallback) -> json(as default)).\n\nBreaking\n\n- ``orjson`` is not available by default, have to use extra_require ``orjson`` to available that.\n\n\n6.0.0b8 (2020-11-02)\n--------------------\n\n- ``pydantic`` minimum version has been set to ``1.7.2``.\n\n\n6.0.0b7 (2020-10-31)\n--------------------\n\n*If you face import error ``from pydantic.utils import ROOT_KEY``, please upgrade your pydnatic version to <1.7*\n\nFixes\n\n- `Issue #39 <https://github.com/nazrulworld/fhir.resources/issues/39>`_ added compatibility with ``pydantic`` version between ``1.6.x`` and ``1.7.x`` [nazrulworld]\n\nImprovements\n\n- Issue #40 `Make fhir primitive element field optional if extension value is provided. <https://github.com/nazrulworld/fhir.resources/issues/40>`_\n\n6.0.0b6 (2020-10-24)\n--------------------\n\nImprovements\n\n- ``FHIRAbstractModel::json`` now takes additional parameter ``return_bytes``, indicates json string would be bytes. [nazrulworld]\n\n- Issue#38 Add support for FHIR comments. As per suggestion of comments in json from `Grahame Grieve <http://www.healthintersections.com.au/?p=2569>`_, now ``fhir_comments`` is accepted. [nazrulworld]\n\n- FHIR comments filter option is added in ``FHIRAbstractModel::json``, means it is possible to exclude any comments while generating json string by providing parameter ``exclude_comments`` value. [nazrulworld]\n\n- More FHIR DSTU2 resources have been added. [Itay Goren]\n\n6.0.0b5 (2020-10-04)\n--------------------\n\nImprovements\n\n- ``visionprescription`` and ``supplyrequest`` resources added for DSTU2 [iatechicken]\n\nFixes\n\n- Issue #28 `'construct_fhir_element' change the given dict <https://github.com/nazrulworld/fhir.resources/issues/28>`_\n\n\n6.0.0b4 (2020-09-24)\n--------------------\n\nImprovements\n\n- orjson_ supports have been available as default json ``dumps`` and ``loads`` for Model.\n\n- ``FHIRAbstractModel::get_json_encoder`` class method now available, which return pydantic compatible json encoder callable, can be used with any json serializer.\n\n- More DSTU2 FHIR Resources have added, https://github.com/nazrulworld/fhir.resources/issues/21. Thanks to [mmabey].\n\nFixes\n\n- Fixes URL validation in the case where a primitive type is used as URL (which is allowed in StructureDefinition). [simonvadee]\n\n- Fixes `Issue#19 <https://github.com/nazrulworld/fhir.resources/issues/19>`_ Getting validation errors that don't make sense.\n\n\n6.0.0b3 (2020-08-07)\n--------------------\n\n- ``FHIRAbstractModel::get_resource_type`` class method now available, which returning name of the resource.\n\n\n6.0.0b2 (2020-07-09)\n--------------------\n\n- ``FHIRAbstractModel::element_properties`` class method now available, which returning generator of ``ModelField``,\n  those are elements of the resource.\n\n- Minor fixes on ``enum_values``.\n\n6.0.0b1 (2020-07-05)\n--------------------\n\nRevolutionary evolution has been made, now fully rewritten with modern python, underlying APIs (almost all) have been changed.\nPlease have look at readme section, for howto.\n\nImprovements\n\n- Full support of FHIR `Extensibility <https://www.hl7.org/fhir/extensibility.html>`_ for `Primitive Data Types <https://www.hl7.org/fhir/datatypes.html#primitive>`_\n\nBreaking\n\n- Drop support for python 2.7.\n\n\n\n5.1.0 (2020-04-11)\n------------------\n\nImprovements\n\n- FHIR ``STU3`` release version upgraded from ``3.0.1`` to ``3.0.2``, Please find changes history here https://www.hl7.org/fhir/history.html.\n\n- FHIR ``R4`` release version upgraded from ``4.0.0`` to ``4.0.1``, find changes history here https://www.hl7.org/fhir/history.html.\n\n\n5.0.1 (2019-07-18)\n------------------\n\nBugfixes:\n\n- `Issue#5 <https://github.com/nazrulworld/fhir.resources/issues/5>`_ confusing error message \"name 'self' is not defined\" [nazrulworld]\n\n\n5.0.0 (2019-06-08)\n------------------\n\n- Nothing but release stable version.\n\n\n5.0.0b3 (2019-05-14)\n--------------------\n\nNew features\n\n- Isuue#1 `Add DSTU2 Support <https://github.com/nazrulworld/fhir.resources/issues/1>`_\n\n\n5.0.0b2 (2019-05-13)\n--------------------\n\nBreaking or Improvments\n\n- ``elementProperties``: element now has extra property ``type_name``. Now format like ``(name, json_name, type, type_name, is_list, \"of_many\", not_optional)``\n  The ``type_name`` refers original type name (code) from FHIR Structure Definition and it would be very helpful while\n  making fhir search, fhirpath navigator.\n\n\n\n5.0.0b1 (2019-01-19)\n--------------------\n\nNew features\n\n- Implemented own build policy, now previous version of FHIR® resources are available as python sub-package.\n\nBuild info\n\n- Default version is ``R4`` (see version info at `4.0.0b1 (2019-01-13)` section)\n\n- ``STU3`` (see version info at `3.0.1 (2019-01-13)` section)\n\n\n4.0.0 (2019-01-14)\n------------------\n\n- see version info at ``4.0.0b1`` section.\n\n\n4.0.0b1 (2019-01-13)\n--------------------\n\n`Version Info (R4)`_ ::\n\n    [FHIR]\n    FhirVersion=4.0.0-a53ec6ee1b\n    version=4.0.0\n    buildId=a53ec6ee1b\n    date=20181227223754\n\n\n\n3.0.1 (2019-01-13)\n------------------\n\n`Version Info (STU3)`_ ::\n\n    [FHIR]\n    FhirVersion=3.0.1.11917\n    version=3.0.1\n    revision=11917\n    date=20170419074443\n\n\n.. _`Version Info (STU3)`: http://hl7.org/fhir/stu3/\n.. _`Version Info (R4)`: http://hl7.org/fhir/R4/\n"
  },
  {
    "path": "LICENSE",
    "content": "\n\nBSD License\n\nCopyright (c) 2019, Md Nazrul Islam\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice, this\n  list of conditions and the following disclaimer in the documentation and/or\n  other materials provided with the distribution.\n\n* Neither the name of the copyright holder nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\nIN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\nOF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\nOF THE POSSIBILITY OF SUCH DAMAGE.\n\n"
  },
  {
    "path": "MANIFEST.in",
    "content": "graft fhir\nprune fhir/resources/tests\nprune fhir/resources/STU3/tests\nprune fhir/resources/R4B/tests\nprune script\nprune tests\nprune .github\nprune fhir-parser\ninclude AUTHORS.rst\ninclude CONTRIBUTING.rst\ninclude HISTORY.rst\ninclude LICENSE\ninclude README.rst\n\nexclude tox.ini\nexclude Makefile\nexclude .editorconfig\nexclude .gitmodules\nexclude pyproject.toml .flake8 .isort.cfg appveyor.yml .python-version\n\nrecursive-exclude * __pycache__\nrecursive-exclude * *.py[co]\n"
  },
  {
    "path": "Makefile",
    "content": ".PHONY: clean clean-test clean-pyc clean-build docs help\n.DEFAULT_GOAL := help\n\ndefine BROWSER_PYSCRIPT\nimport os, webbrowser, sys\n\ntry:\n\tfrom urllib import pathname2url\nexcept:\n\tfrom urllib.request import pathname2url\n\nwebbrowser.open(\"file://\" + pathname2url(os.path.abspath(sys.argv[1])))\nendef\nexport BROWSER_PYSCRIPT\n\ndefine PRINT_HELP_PYSCRIPT\nimport re, sys\n\nfor line in sys.stdin:\n\tmatch = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)\n\tif match:\n\t\ttarget, help = match.groups()\n\t\tprint(\"%-20s %s\" % (target, help))\nendef\nexport PRINT_HELP_PYSCRIPT\n\nBROWSER := python -c \"$$BROWSER_PYSCRIPT\"\n\nhelp:\n\t@python -c \"$$PRINT_HELP_PYSCRIPT\" < $(MAKEFILE_LIST)\n\nclean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts\n\nclean-build: ## remove build artifacts\n\trm -fr build/\n\trm -fr dist/\n\trm -fr .eggs/\n\tfind . -name '*.egg-info' -exec rm -fr {} +\n\tfind . -name '*.egg' -exec rm -f {} +\n\nclean-pyc: ## remove Python file artifacts\n\tfind . -name '*.pyc' -exec rm -f {} +\n\tfind . -name '*.pyo' -exec rm -f {} +\n\tfind . -name '*~' -exec rm -f {} +\n\tfind . -name '__pycache__' -exec rm -fr {} +\n\nclean-test: ## remove test and coverage artifacts\n\trm -fr .tox/\n\trm -f .coverage\n\trm -fr htmlcov/\n\trm -fr .pytest_cache\n\nlint: ## check style with flake8\n\tflake8 --exclude=*/DSTU2/tests/*  fhir/resources\n\ntest: ## run tests quickly with the default Python\n\tpytest fhir/resources/tests\n\ntest-all: ## run tests on every Python version with tox\n\ttox\n\ncoverage: ## check code coverage quickly with the default Python\n\tcoverage run --source fhir.resources -m pytest\n\tcoverage report -m\n\tcoverage html\n\t$(BROWSER) htmlcov/index.html\n\nrelease: dist ## package and upload a release\n\ttwine upload dist/*\n\ndist: clean ## builds source and wheel package\n\tpython setup.py sdist\n\tpython setup.py bdist_wheel\n\tls -l dist\n\ninstall: clean ## install the package to the active Python's site-packages\n\tpython setup.py install\n\ngenerate-resources:\n\tcd script && python generate.py\n\nstyle-all:\n\tisort --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses --line-width=88  -rc fhir/resources\n\tblack --exclude 'fhir/resources/DSTU2/tests/' fhir/resources\n"
  },
  {
    "path": "README.rst",
    "content": "===============================\nFHIR® Resources (R5, R4B, STU3)\n===============================\n\n.. image:: https://img.shields.io/pypi/v/fhir.resources.svg\n        :target: https://pypi.python.org/pypi/fhir.resources\n\n.. image:: https://img.shields.io/pypi/pyversions/fhir.resources.svg\n        :target: https://pypi.python.org/pypi/fhir.resources\n        :alt: Supported Python Versions\n\n.. image:: https://img.shields.io/travis/com/nazrulworld/fhir.resources.svg\n        :target: https://app.travis-ci.com/github/nazrulworld/fhir.resources\n\n.. image:: https://ci.appveyor.com/api/projects/status/0qu5vyue1jwxb4km?svg=true\n        :target: https://ci.appveyor.com/project/nazrulworld/fhir-resources\n        :alt: Windows Build\n\n.. image:: https://codecov.io/gh/nazrulworld/fhir.resources/branch/master/graph/badge.svg\n        :target: https://codecov.io/gh/nazrulworld/fhir.resources\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n\n.. image:: https://static.pepy.tech/personalized-badge/fhir-resources?period=total&units=international_system&left_color=black&right_color=green&left_text=Downloads\n    :target: https://pepy.tech/project/fhir-resources\n    :alt: Downloads\n\n.. image:: https://www.hl7.org/fhir/assets/images/fhir-logo-www.png\n        :target: https://www.hl7.org/implement/standards/product_brief.cfm?product_id=449\n        :alt: HL7® FHIR®\n\n\nFHIR_ (Fast Healthcare Interoperability Resources) is a specification for exchanging healthcare information electronically.\nIt is designed to facilitate the exchange of data between different healthcare systems and applications, and is commonly used to build APIs (Application Programming Interfaces) for healthcare data.\nIt is based on modern web technologies, and is designed to be easy to use and implement.\nIt uses a modular approach, with a set of \"resources\" that represent different types of healthcare data (such as patients, observations, and diagnoses).\nThese resources can be combined and extended as needed to support a wide range of healthcare use cases.\n\n\nThis \"fhir.resources\" package is powered by pydantic_ V2, so it become faster in performance.\nObviously it is written in modern python and has data validation built-in.\nIt provides tools and classes for all of the `FHIR Resources <https://www.hl7.org/fhir/resourcelist.html>`_ defined in the FHIR specification,\nand allows you to create and manipulate FHIR resources in Python. You can then use these resources to build FHIR-based APIs or to work with FHIR data in other ways.\n\n\n* Easy to construct, easy to extended validation, easy to export.\n* By inheriting behaviour from pydantic_, compatible with `ORM <https://en.wikipedia.org/wiki/Object-relational_mapping>`_.\n* Full support of FHIR® Extensibility for Primitive Data Types are available.\n* Previous release of FHIR® Resources are available.\n* Free software: BSD license\n\n**Experimental XML and YAML serialization and deserialization supports. See [Advanced Usages] section!**\n\nFHIR® Version Info\n------------------\n\nFHIR® (Release R5, version 5.0.0) is available as default. Also previous versions are available as Python sub-package\n(each release name string becomes sub-package name, i.e ``R4B`` ).\nFrom ``fhir.resources`` version 7.0.0; there is no FHIR ``R4`` instead of ``R4B`` is available as sub-package.\n\n**Available Previous Versions**:\n\n* ``R4B`` (4.3.0)\n* ``STU3`` (3.0.2)\n\nInstallation\n------------\n\nJust a simple ``pip install fhir.resources`` is enough. But if you want development\nversion, just clone from https://github.com/nazrulworld/fhir.resources and ``pip install -e .[dev]``.\n\n\nUsages\n------\n\n**Example: 1**: This example creates a new Organization resource with some of its attributes (id, active, name, address)::\n\n    >>> from fhir.resources.organization import Organization\n    >>> from fhir.resources.address import Address\n    >>> data = {\n    ...     \"id\": \"f001\",\n    ...     \"active\": True,\n    ...     \"name\": \"Acme Corporation\",\n    ...     \"address\": [{\"country\": \"Switzerland\"}]\n    ... }\n    >>> org = Organization(**data)\n    >>> org.get_resource_type() == \"Organization\"\n    True\n    >>> isinstance(org.address[0], Address)\n    True\n    >>> org.address[0].country == \"Switzerland\"\n    True\n    >>> org.model_dump()['active'] is True\n    True\n\n**Example: 2**: This example creates a new Organization resource from json string::\n\n    >>> from fhir.resources.organization import Organization\n    >>> from fhir.resources.address import Address\n    >>> json_str = '''{\"resourceType\": \"Organization\",\n    ...     \"id\": \"f001\",\n    ...     \"active\": True,\n    ...     \"name\": \"Acme Corporation\",\n    ...     \"address\": [{\"country\": \"Switzerland\"}]\n    ... }'''\n    >>> org = Organization.model_validate_json(json_str)\n    >>> isinstance(org.address[0], Address)\n    True\n    >>> org.address[0].country == \"Switzerland\"\n    True\n    >>> org.dict()['active'] is True\n    True\n\n\n**Example: 3**: This example creates a new Patient resource from json object(py dict)::\n\n    >>> from fhir.resources.patient import Patient\n    >>> from fhir.resources.humanname import HumanName\n    >>> from datetime import date\n    >>> json_obj = {\"resourceType\": \"Patient\",\n    ...     \"id\": \"p001\",\n    ...     \"active\": True,\n    ...     \"name\": [\n    ...         {\"text\": \"Adam Smith\"}\n    ...      ],\n    ...     \"birthDate\": \"1985-06-12\"\n    ... }\n    >>> pat = Patient.model_validate(json_obj)\n    >>> isinstance(pat.name[0], HumanName)\n    True\n    >>> pat.birthDate == date(year=1985, month=6, day=12)\n    True\n    >>> pat.active is True\n    True\n\n\n**Example: 4**: This example creates a new Patient resource from json file::\n\n    >>> from fhir.resources.patient import Patient\n    >>> import os\n    >>> import pathlib\n    >>> filename = pathlib.Path(\"foo/bar.json\")\n    >>> pat = Patient.model_validate_json(filename.read_bytes())\n    >>> pat.get_resource_type() == \"Patient\"\n    True\n\n\n**Example: 5**: This example creates a new Organization resource in python way::\n\n    >>> from fhir.resources.organization import Organization\n    >>> from fhir.resources.address import Address\n    >>> json_obj = {\"resourceType\": \"Organization\",\n    ...     \"id\": \"f001\",\n    ...     \"active\": True,\n    ...     \"name\": \"Acme Corporation\",\n    ...     \"address\": [{\"country\": \"Switzerland\"}]\n    ... }\n\n    >>> org = Organization.model_construct()\n    >>> org.id = \"f001\"\n    >>> org.active = True\n    >>> org.name = \"Acme Corporation\"\n    >>> org.address = list()\n    >>> address = Address.model_construct()\n    >>> address.country = \"Switzerland\"\n    >>> org.address.append(address)\n    >>> org.model_dump() == json_obj\n    True\n\n.. note::\n    Please note that due to the way the validation works, you will run into issues if you are using ``model_construct()`` to create\n    resources that have more than one mandatory field. See `this comment in issue#56 <https://github.com/nazrulworld/fhir.resources/issues/56#issuecomment-784520234>`_ for details.\n\n\n**Example: 5**: Auto validation while providing wrong datatype::\n\n    >>> try:\n    ...     org = Organization({\"id\": \"fmk\", \"address\": [\"i am wrong type\"]})\n    ...     raise AssertionError(\"Code should not come here\")\n    ... except ValueError:\n    ...     pass\n\n\n\nAdvanced Usages\n---------------\n\nFHIR Comments (JSON)\n~~~~~~~~~~~~~~~~~~~~\n\nIt is possible to add comments inside json like xml, but need to follow some convention, what is suggested by `Grahame Grieve <http://www.healthintersections.com.au/?p=2569>`_;\nis implemented here.\n\nAlso it is possible to generate json string output without comments.\n\nExamples::\n\n    >>> observation_str = b\"\"\"{\n    ...  \"resourceType\": \"Observation\",\n    ...  \"id\": \"f001\",\n    ...    \"fhir_comments\": [\n    ...      \"   a specimen identifier - e.g. assigned when the specimen was taken by the orderer/placer  use the accession number for the filling lab   \",\n    ...      \"  Placer ID  \"\n    ...    ],\n    ...  \"text\": {\n    ...      \"fhir_comments\": [\n    ...      \"   a specimen identifier - e.g. assigned when the specimen was taken by the orderer/placer  use the accession number for the filling lab   \",\n    ...      \"  Placer ID  \"\n    ...    ],\n    ...    \"status\": \"generated\",\n    ...    \"div\": \"<div xmlns=\\\"http://www.w3.org/1999/xhtml\\\">.........</div>\"\n    ...  },\n    ...  \"identifier\": [\n    ...    {\n    ...      \"use\": \"official\",\n    ...      \"system\": \"http://www.bmc.nl/zorgportal/identifiers/observations\",\n    ...      \"value\": \"6323\"\n    ...    }\n    ...  ],\n    ...  \"status\": \"final\",\n    ...  \"_status\": {\n    ...      \"fhir_comments\": [\n    ...            \"  EH: Note to balloters  - lots of choices for whole blood I chose this.  \"\n    ...          ]\n    ...  },\n    ...  \"code\": {\n    ...    \"coding\": [\n    ...      {\n    ...        \"system\": \"http://loinc.org\",\n    ...        \"code\": \"15074-8\",\n    ...        \"display\": \"Glucose [Moles/volume] in Blood\"\n    ...      }\n    ...    ]\n    ...  },\n    ...  \"subject\": {\n    ...    \"reference\": \"Patient/f001\",\n    ...    \"display\": \"P. van de Heuvel\"\n    ...  },\n    ...  \"effectivePeriod\": {\n    ...    \"start\": \"2013-04-02T09:30:10+01:00\"\n    ...  },\n    ...  \"issued\": \"2013-04-03T15:30:10+01:00\",\n    ...  \"performer\": [\n    ...    {\n    ...      \"reference\": \"Practitioner/f005\",\n    ...      \"display\": \"A. Langeveld\"\n    ...    }\n    ...  ],\n    ...  \"valueQuantity\": {\n    ...    \"value\": 6.3,\n    ...    \"unit\": \"mmol/l\",\n    ...    \"system\": \"http://unitsofmeasure.org\",\n    ...    \"code\": \"mmol/L\"\n    ...  },\n    ...  \"interpretation\": [\n    ...    {\n    ...      \"coding\": [\n    ...        {\n    ...          \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation\",\n    ...          \"code\": \"H\",\n    ...          \"display\": \"High\"\n    ...        }\n    ...      ]\n    ...    }\n    ...  ],\n    ...  \"referenceRange\": [\n    ...    {\n    ...      \"low\": {\n    ...        \"value\": 3.1,\n    ...        \"unit\": \"mmol/l\",\n    ...        \"system\": \"http://unitsofmeasure.org\",\n    ...        \"code\": \"mmol/L\"\n    ...      },\n    ...      \"high\": {\n    ...        \"value\": 6.2,\n    ...        \"unit\": \"mmol/l\",\n    ...        \"system\": \"http://unitsofmeasure.org\",\n    ...        \"code\": \"mmol/L\"\n    ...      }\n    ...    }\n    ...  ]\n    ... }\"\"\"\n    >>> from fhir.resources.observation import Observation\n    >>> obj = Observation.model_validate_json(observation_str)\n    >>> \"fhir_comments\" in obj.model_dump_json()\n    >>> # Test comments filtering\n    >>> \"fhir_comments\" not in obj.model_dump_json(exclude_comments=True)\n\n\nSpecial Case: Missing data\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n`In some cases <https://www.hl7.org/fhir/extensibility.html#Special-Case>`_, implementers might\nfind that they do not have appropriate data for an element with minimum cardinality = 1.\nIn this case, the element must be present, but unless the resource or a profile on it has made the\nactual value of the primitive data type mandatory, it is possible to provide an extension that\nexplains why the primitive value is not present.\nExample (required ``intent`` element is missing but still valid because of extension)::\n\n    >>> json_str = b\"\"\"{\n    ...    \"resourceType\": \"MedicationRequest\",\n    ...    \"id\": \"1620518\",\n    ...    \"meta\": {\n    ...        \"versionId\": \"1\",\n    ...        \"lastUpdated\": \"2020-10-27T11:04:42.215+00:00\",\n    ...        \"source\": \"#z072VeAlQWM94jpc\",\n    ...        \"tag\": [\n    ...            {\n    ...                \"system\": \"http://www.alpha.alp/use-case\",\n    ...                \"code\": \"EX20\"\n    ...            }\n    ...        ]\n    ...    },\n    ...    \"status\": \"completed\",\n    ...    \"_intent\": {\n    ...        \"extension\": [\n    ...            {\n    ...                \"url\": \"http://hl7.org/fhir/StructureDefinition/data-absent-reason\",\n    ...                \"valueCode\": \"unknown\"\n    ...            }\n    ...        ]\n    ...    },\n    ...    \"medicationReference\": {\n    ...        \"reference\": \"Medication/1620516\",\n    ...        \"display\": \"Erythromycin 250 MG Oral Tablet\"\n    ...    },\n    ...    \"subject\": {\n    ...        \"reference\": \"Patient/1620472\"\n    ...    },\n    ...    \"encounter\": {\n    ...        \"reference\": \"Encounter/1620506\",\n    ...        \"display\": \"Follow up encounter\"\n    ...    },\n    ...    \"authoredOn\": \"2018-06-16\",\n    ...    \"requester\": {\n    ...        \"reference\": \"Practitioner/1620502\",\n    ...        \"display\": \"Dr. Harold Hippocrates\"\n    ...    },\n    ...    \"reasonReference\": [\n    ...        {\n    ...            \"reference\": \"Condition/1620514\",\n    ...            \"display\": \"Otitis Media\"\n    ...        }\n    ...    ],\n    ...    \"dosageInstruction\": [\n    ...        {\n    ...            \"text\": \"250 mg 4 times per day for 10 days\",\n    ...            \"timing\": {\n    ...                \"repeat\": {\n    ...                    \"boundsDuration\": {\n    ...                        \"value\": 10,\n    ...                        \"unit\": \"day\",\n    ...                        \"system\": \"http://unitsofmeasure.org\",\n    ...                        \"code\": \"d\"\n    ...                    },\n    ...                    \"frequency\": 4,\n    ...                    \"period\": 1,\n    ...                    \"periodUnit\": \"d\"\n    ...                }\n    ...            },\n    ...            \"doseAndRate\": [\n    ...                {\n    ...                    \"doseQuantity\": {\n    ...                        \"value\": 250,\n    ...                        \"unit\": \"mg\",\n    ...                        \"system\": \"http://unitsofmeasure.org\",\n    ...                        \"code\": \"mg\"\n    ...                    }\n    ...                }\n    ...            ]\n    ...        }\n    ...    ],\n    ...    \"priorPrescription\": {\n    ...        \"reference\": \"MedicationRequest/1620517\",\n    ...        \"display\": \"Amoxicillin prescription\"\n    ...    }\n    ... }\"\"\"\n    >>> from fhir.resources.medicationrequest import MedicationRequest\n    >>> obj = MedicationRequest.model_validate_json(json_str)\n    >>> \"intent\" not in obj.model_dump()\n\n\nCustom Validators\n~~~~~~~~~~~~~~~~~\n**This feature is not available**\n\n``fhir.resources`` is providing the extensive API to create and attach custom validator into any model. See more `about root validator <https://pydantic-docs.helpmanual.io/usage/validators/#root-validators>`_\nSome convention you have to follow though, while creating a root validator.\n\n1. Number of arguments are fixed, as well as names are also. i.e ``(cls, values)``.\n2. Should return ``values``, unless any exception need to be raised.\n3. Validator should be attached only one time for individual Model. Update [from now, it's not possible to attach multiple time same name validator on same class]\n\nExample 1: Validator for Patient::\n\n    from typing import Dict\n    from fhir.resources.patient import Patient\n\n    import datetime\n\n    def validate_birthdate(cls, values: Dict):\n        if not values:\n            return values\n        if \"birthDate\" not in values:\n            raise ValueError(\"Patient's ``birthDate`` is required.\")\n\n        minimum_date = datetime.date(2002, 1, 1)\n        if values[\"birthDate\"] > minimum_date:\n            raise ValueError(\"Minimum 18 years patient is allowed to use this system.\")\n        return values\n    # we want this validator to execute after data evaluating by individual field validators.\n    Patient.add_root_validator(validate_gender, pre=False)\n\n\nExample 2: Validator for Patient from Validator Class::\n\n    from typing import Dict\n    from fhir.resources.patient import Patient\n\n    import datetime\n\n    class MyValidator:\n        @classmethod\n        def validate_birthdate(cls, values: Dict):\n            if not values:\n                return values\n            if \"birthDate\" not in values:\n                raise ValueError(\"Patient's ``birthDate`` is required.\")\n\n            minimum_date = datetime.date(2002, 1, 1)\n            if values[\"birthDate\"] > minimum_date:\n                raise ValueError(\"Minimum 18 years patient is allowed to use this system.\")\n            return values\n    # we want this validator to execute after data evaluating by individual field validators.\n    Patient.add_root_validator(MyValidator.validate_gender, pre=False)\n\n\n**important notes** It is possible add root validator into any base class like ``DomainResource``.\nIn this case you have to make sure root validator is attached before any import of derived class, other\nthan validator will not trigger for successor class (if imported before) by nature.\n\nENUM Validator\n~~~~~~~~~~~~~~\n\n``fhir.resources`` is providing API for enum constraint for each field (where applicable), but it-self doesn't\nenforce enum based validation! see `discussion here <https://github.com/nazrulworld/fhir.resources/issues/23>`_.\nIf you want to enforce enum constraint, you have to create a validator for that.\n\nExample: Gender Enum::\n\n    from typing import Dict\n    from fhir.resources.patient import Patient\n\n    def validate_gender(cls, values: Dict):\n        if not values:\n            return values\n        enums = cls.model_fields[\"gender\"].json_schema_extra[\"enum_values\"]\n        if \"gender\" in values and values[\"gender\"] not in enums:\n            raise ValueError(\"write your message\")\n        return values\n\n    Patient.add_root_validator(validate_gender, pre=True)\n\n\nReference Validator\n~~~~~~~~~~~~~~~~~~~\n\n``fhir.resources`` is also providing enum like list of permitted resource types through json_schema_extra ``enum_reference_types``.\nYou can get that list by following above (Enum) approaches  ``resource_types = cls.model_fields[\"managingOrganization\"].json_schema_extra[\"enum_reference_types\"]``\n\n\n\npydantic_ Field Type Support\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAll available fhir resources (types) can be use as pydantic_'s Field's value types. See issue#46 `Support for FastAPI pydantic response models <https://github.com/nazrulworld/fhir.resources/issues/46>`_.\nThe module ``fhirtypes.py`` contains all fhir resources related types and should trigger validator automatically.\n\n\n``Resource.id aka fhirtypes.Id`` constraint extensibility\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nThere are a lots of discussion here here i.) https://bit.ly/360HksL ii.) https://bit.ly/3o1fZgl about the length of ``Resource.Id``'s value.\nBased on those discussions, we recommend that keep your ``Resource.Id`` size within 64 letters (for the seek of intercompatibility with third party system), but we are also providing freedom\nabout the length of Id, in respect with others opinion that 64 chr length is not sufficient, so default length is now 255.\nBut it is offering to customize as your own requirement by doing a monkey patch.\n\nExamples::\n    # ``patch.py``\n    >>> import importlib\n    >>> from fhir_core import constraints\n    >>> from fhir_core import types as ftypes\n    >>> constraints.TYPES_ID_MAX_LENGTH = 64\n    >>> importlib.reload(ftypes)\n\nNote: when you will change that behaviour, that would impact into your whole project.\n\n\nXML Supports\n~~~~~~~~~~~~\nAlong side with JSON string export, it is possible to export as XML string!\nBefore using this feature, make sure associated dependent library is installed. Use ``fhir.resources[xml]`` or ``fhir.resources[all]`` as\nyour project requirements.\n\n**XML schema validator!**\nIt is possible to provide custom xmlparser, during load from file or string, meaning that you can validate\ndata against FHIR xml schema(and/or your custom schema).\n\nExample-1 Export::\n    >>> from fhir.resources.patient import Patient\n    >>> data = {\"active\": True, \"gender\": \"male\", \"birthDate\": \"2000-09-18\", \"name\": [{\"text\": \"Primal Kons\"}]}\n    >>> patient_obj = Patient(**data)\n    >>> xml_str = patient_obj.model_dump_xml(pretty_print=True)\n    >>> print(xml_str)\n    <?xml version='1.0' encoding='utf-8'?>\n    <Patient xmlns=\"http://hl7.org/fhir\">\n      <active value=\"true\"/>\n      <name>\n        <text value=\"Primal Kons\"/>\n      </name>\n      <gender value=\"male\"/>\n      <birthDate value=\"2000-09-18\"/>\n    </Patient>\n\n\nExample-2 Import from string::\n    >>> from fhir.resources.patient import Patient\n    >>> data = {\"active\": True, \"gender\": \"male\", \"birthDate\": \"2000-09-18\", \"name\": [{\"text\": \"Primal Kons\"}]}\n    >>> patient_obj = Patient(**data)\n    >>> xml_str = patient_obj.model_dump_xml(pretty_print=True)\n    >>> print(xml_str)\n    >>> data = b\"\"\"<?xml version='1.0' encoding='utf-8'?>\n    ... <Patient xmlns=\"http://hl7.org/fhir\">\n    ...   <active value=\"true\"/>\n    ...   <name>\n    ...     <text value=\"Primal Kons\"/>\n    ...   </name>\n    ...   <gender value=\"male\"/>\n    ...   <birthDate value=\"2000-09-18\"/>\n    ... </Patient>\"\"\"\n    >>> patient = Patient.model_validate_xml(data)\n    >>> print(patient.model_dump_json(indent=2))\n    {\n      \"resourceType\": \"Patient\",\n      \"active\": true,\n      \"name\": [\n        {\n          \"text\": \"Primal Kons\",\n          \"family\": \"Kons\",\n          \"given\": [\n            \"Primal\"\n          ]\n        }\n      ],\n      \"gender\": \"male\",\n      \"birthDate\": \"2000-09-18\"\n    }\n\n    >>> with xml parser\n    >>> import lxml\n    >>> from fhir_core.xml_utils import xml_loads\n    >>> schema = lxml.etree.XMLSchema(file=str(FHIR_XSD_DIR / \"patient.xsd\"))\n    >>> xmlparser = lxml.etree.XMLParser(schema=schema)\n    >>> patient2 = xml_loads(Patient, data, xmlparser=xmlparser)\n    >>> patient2 == patient\n    True\n\nExample-3 Import from file::\n    >>> import pathlib\n    >>> patient3 = Patient.model_validate_xml(pathlib.Path(\"Patient.xml\").read_bytes())\n    >>> patient3 == patient and patient3 == patient2\n    True\n\n\n**XML FAQ**\n\n    - Although generated XML is validated against ``FHIR/patient.xsd`` and ``FHIR/observation.xsd`` in tests, but we suggest you check output of your production data.\n    - Comment feature is included, but we recommend you check in your complex usages.\n\n\nYAML Supports\n~~~~~~~~~~~~~\n\nAlthough there is no official support for YAML documented in FHIR specification, but as an experimental feature, we add this support.\nNow it is possible export/import YAML strings.\nBefore using this feature, make sure associated dependent library is installed. Use ``fhir.resources[yaml]`` or ``fhir.resources[all]`` as\nyour project requirements.\n\nExample-1 Export::\n    >>> from fhir.resources.patient import Patient\n    >>> data = {\"active\": True, \"gender\": \"male\", \"birthDate\": \"2000-09-18\", \"name\": [{\"text\": \"Primal Kons\", \"family\": \"Kons\", \"given\": [\"Primal\"]}]}\n    >>> patient_obj = Patient(**data)\n    >>> yml_str = patient_obj.model_dump_yaml(indent=2)\n    >>> print(yml_str)\n    resourceType: Patient\n    active: true\n    name:\n    - text: Primal Kons\n      family: Kons\n      given:\n      - Primal\n    gender: male\n    birthDate: 2000-09-18\n\n\nExample-2 Import from YAML string::\n    >>> from fhir.resources.patient import Patient\n    >>> data = b\"\"\"\n    ... resourceType: Patient\n    ... active: true\n    ... name:\n    ... - text: Primal Kons\n    ...   family: Kons\n    ...   given:\n    ...   - Primal\n    ...  gender: male\n    ...  birthDate: 2000-09-18\n    ... \"\"\"\n    >>> patient_obj = Patient.model_validate_yaml(data)\n    >>> json_str = patient_obj.model_dump_json(indent=2)\n    >>> print(json_str)\n    {\n      \"resourceType\": \"Patient\",\n      \"active\": true,\n      \"name\": [\n        {\n          \"text\": \"Primal Kons\",\n          \"family\": \"Kons\",\n          \"given\": [\n            \"Primal\"\n          ]\n        }\n      ],\n      \"gender\": \"male\",\n      \"birthDate\": \"2000-09-18\"\n    }\n\nExample-3 Import from YAML file::\n    >>> import pathlib\n    >>> from fhir.resources.patient import Patient\n    >>> patient_obj = Patient.model_validate_yaml(pathlib.Path(\"Patient.yml\").read_bytes())\n    >>> json_str = patient_obj.model_dump_json(indent=2)\n    >>> print(json_str)\n    {\n      \"resourceType\": \"Patient\",\n      \"active\": true,\n      \"name\": [\n        {\n          \"text\": \"Primal Kons\",\n          \"family\": \"Kons\",\n          \"given\": [\n            \"Primal\"\n          ]\n        }\n      ],\n      \"gender\": \"male\",\n      \"birthDate\": \"2000-09-18\"\n    }\n\n\n**YAML FAQ**\n\n- We are using https://pyyaml.org/ PyYAML library, for serialization/deserialization but if we find more faster library, we could use that. you are welcome to provide us your suggestion.\n- YAML based comments is not supported yet, instead json comments syntax is used! Of course this comment feature is in our todo list.\n\n\nAllow Empty String\n~~~~~~~~~~~~~~~~~~\n\nAlthough this is not good practice to allow empty string value against FHIR primitive data type ``String``. But\nwe in real life scenario, is it unavoidable sometimes.\n\nExamples::\n    Place this code inside your __init__.py module or any place, just to make sure that this fragment of codes is runtime executed.\n\n    >>> # ``__init__.py``\n    >>> import importlib\n    >>> from fhir_core import constraints\n    >>> from fhir_core import types as ftypes\n    >>> constraints.TYPES_STRING_ALLOW_EMPTY_STR = True\n    >>> importlib.reload(ftypes)\n\n\nFHIR ``summary`` search support\n-------------------------------\nThis package is providing supporting ´´summary mode´´ activated serialization, meaning that you will not need to do extra, if you are planning to support `summary search <https://www.hl7.org/fhir/search.html#_summary>`_\n\nExample::\n\n    >>> from fhir.resources.organization import Organization\n    >>> json_str = '''{\"resourceType\": \"Organization\",\n    ...     \"text\": {\"status\": \"generated\", \"div\": \"<p>summary example</p>\"}\n    ...     \"id\": \"f001\",\n    ...     \"active\": True,\n    ...     \"name\": \"Acme Corporation\"\n    ... }'''\n    >>> org = Organization.model_validate_json(json_str)\n    >>> summary_dict = org.model_dump(summary_only=True)\n    >>> \"text\" not in summary_dict\n    True\n    >>> \"active\" in summary_dict\n    True\n    >>> \"name\" in summary_dict\n\nFHIR release R4B over R4\n------------------------\n\nFHIR release R4B is coming with not that much changes over the release of R4. So we decided not to create separate sub-package for R4 like STU3, instead there just overlaps on existing R4. This also means that in future, when we will work on R5; there will be sub-package for R4B and no R4.\nWe suggest you to try make a plan to be upgraded to R4B. Here you could find related information dealing-strategy-R4-R4B_.\n\nYou could find full discussion here https://github.com/nazrulworld/fhir.resources/discussions/116\n\nMigration (from ``7.X.X`` to ``8.X.X``)\n---------------------------------------\n\nThere is no breaking changes in terms of api/functions. But it is recommended that you should use new functions from Pydantic V2\ninstead of using deprecated functions.\n\nReplacements and/or new functions.\n\n- From ``FHIRAbstractModel::dict`` to ``FHIRAbstractModel::model_dump``\n- From ``FHIRAbstractModel::json`` to ``FHIRAbstractModel::model_dump_json``\n- From ``FHIRAbstractModel::yaml`` to ``FHIRAbstractModel::model_dump_yaml``\n- From ``FHIRAbstractModel::xml`` to ``FHIRAbstractModel::model_dump_xml``\n- From ``FHIRAbstractModel::parse_obj`` to ``FHIRAbstractModel::model_validate``\n- From ``FHIRAbstractModel::parse_raw`` to ``FHIRAbstractModel::model_validate_json``\n- From ``FHIRAbstractModel::parse_file`` to no replacement, we suggest you use pathlib (see examples)\n- ``FHIRAbstractModel::model_validate_yaml`` parse YAML string to FHIRAbstractModel.\n- ``FHIRAbstractModel::model_validate_xml`` parse XML string to FHIRAbstractModel.\n\n\nBreaking: removed attributes and/or functions/methods.\n\n- The attribute ``resource_type`` has been removed from base FHIR class. For example no more ``Resource.resource_type`` attribute. Now you have to use Resource.get_resource_type() instead. Although \"resource_type\" key is available when you will serialize as json or python dict.\n\nMigration (from ``6.X.X`` to ``7.0.X``)\n---------------------------------------\n\nFirst of all, you have to correct all imports path, if you wish to keep continue using FHIR release R4B or R4, as those resources\nare moved under sub-package named ``R4B``. Then if you wish to use current ``R5`` release,\nread carefully the following documents.\n\n1. See the full changes history -> https://build.fhir.org/history.html\n2. See complete lists of differences between R5 and R4B -> https://hl7.org/fhir/R5/diff.html\n3. If you are planning to migrate direct from the release ``R4``,\n   then it is important to look at the differences between R4B and R4 here -> https://hl7.org/fhir/R4B/diff.html\n\n\nMigration (from later than ``6.X.X``)\n-------------------------------------\n\nThis migration guide states some underlying changes of ``API`` and replacement, those are commonly used from later than ``6.X.X`` version.\n\n\n``fhir.resources.fhirelementfactory.FHIRElementFactory::instantiate``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n**Replacement:** ``fhir.resources.construct_fhir_element``\n\n- First parameter value is same as previous, the Resource name.\n\n- Second parameter is more flexible than previous! it is possible to provide not only json ``dict`` but also\n  json string or json file path.\n\n- No third parameter, what was in previous version.\n\n\n``fhir.resources.fhirabstractbase.FHIRAbstractBase::__init__``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n**Replacement:** ``fhir.resources.fhirabstractmodel.FHIRAbstractModel::parse_obj<classmethod>``\n\n- First parameter value is same as previous, json dict.\n\n- No second parameter, what was in previous version.\n\n\n``fhir.resources.fhirabstractbase.FHIRAbstractBase::as_json``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n**Replacement:** ``fhir.resources.fhirabstractmodel.FHIRAbstractModel::dict``\n\n- Output are almost same previous, but there has some difference in case of some date type, for example py date,\n  datetime, Decimal are in object representation.\n\n- It is possible to use ``fhir.resources.fhirabstractmodel.FHIRAbstractModel::json`` as replacement, when\n  json string is required (so not need further, json dumps from dict)\n\n\nNote:\n\nAll resources/classes are derived from ``fhir.resources.fhirabstractmodel.FHIRAbstractModel`` what was previously\nfrom ``fhir.resources.fhirabstractbase.FHIRAbstractBase``.\n\n\nRelease and Version Policy\n--------------------------\n\nStarting from  version ``5.0.0`` we are following our own release policy and we although follow Semantic Versioning scheme like FHIR® version.\nUnlike previous statement (below), releasing now is not dependent on FHIR®.\n\n\n**removed statement**\n\n    This package is following `FHIR® release and versioning policy <https://www.hl7.org/fhir/versions.html>`_, for example say, FHIR releases next version 4.0.1,\n    we also release same version here.\n\n\nCredits\n-------\n\nAll FHIR® Resources (python classes) are generated using fhir-parser_ which is forked from https://github.com/smart-on-fhir/fhir-parser.git.\n\n\nThis package skeleton was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n.. _`fhir-parser`: https://github.com/nazrulworld/fhir-parser\n.. _`pydantic`: https://pydantic-docs.helpmanual.io/\n.. _`orjson`: https://pypi.org/project/orjson/\n.. _`dealing-strategy-R4-R4B`: https://confluence.hl7.org/display/FHIR/Strategies+for+dealing+with+R4+and+R4B\n.. _`FHIR`: https://www.hl7.org/implement/standards/product_brief.cfm\n\n© Copyright HL7® logo, FHIR® logo and the flaming fire are registered trademarks\nowned by `Health Level Seven International <https://www.hl7.org/legal/trademarks.cfm?ref=https://pypi.org/project/fhir-resources/>`_\n\n.. role:: strike\n    :class: strike\n.. role:: raw-html(raw)\n    :format: html\n"
  },
  {
    "path": "appveyor.yml",
    "content": "image:\n    - Visual Studio 2022\n\nmatrix:\n  allow_failures:\n    - PYTHON: \"C:\\\\Python312-x64\"\n\nenvironment:\n  matrix:\n    - PYTHON: \"C:\\\\Python38-x64\"\n      PYTHON_VERSION: \"3.8.x\" # currently 3.8.6\n      PYTHON_ARCH: \"64\"\n\n    - PYTHON: \"C:\\\\Python39-x64\"\n      PYTHON_VERSION: \"3.9.x\" # currently 3.9.0\n      PYTHON_ARCH: \"64\"\n\n    - PYTHON: \"C:\\\\Python310-x64\"\n      PYTHON_VERSION: \"3.10.x\" # currently 3.10.13\n      PYTHON_ARCH: \"64\"\n\n    - PYTHON: \"C:\\\\Python311-x64\"\n      PYTHON_VERSION: \"3.11.x\" # currently 3.11.9\n      PYTHON_ARCH: \"64\"\n\n    - PYTHON: \"C:\\\\Python312-x64\"\n      PYTHON_VERSION: \"3.12.x\" # currently 3.12.3\n      PYTHON_ARCH: \"64\"\n\ninstall:\n  # If there is a newer build queued for the same PR, cancel this one.\n  # The AppVeyor 'rollout builds' option is supposed to serve the same\n  # purpose but it is problematic because it tends to cancel builds pushed\n  # directly to master instead of just PR builds (or the converse).\n  # credits: JuliaLang developers.\n  - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `\n        https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `\n        Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `\n          throw \"There are newer queued builds for this pull request, failing early.\" }\n  - ECHO \"Filesystem root:\"\n  - ps: \"ls \\\"C:/\\\"\"\n\n  - ECHO \"Installed SDKs:\"\n  - ps: \"ls \\\"C:/Program Files/Microsoft SDKs/Azure\\\"\"\n\n  # Prepend newly installed Python to the PATH of this build (this cannot be\n  # done from inside the powershell script as it would require to restart\n  # the parent CMD process).\n  - \"SET PATH=%PYTHON%;%PYTHON%\\\\Scripts;%PATH%\"\n\n  # Check that we have the expected version and architecture for Python\n  - \"python --version\"\n  - \"python -c \\\"import struct; print(struct.calcsize('P') * 8)\\\"\"\n\n  # Upgrade to the latest version of pip to avoid it displaying warnings\n  # about it being out of date.\n  - \"python -m pip install --upgrade pip wheel\"\n\n  # Install the build dependencies of the project. If some dependencies contain\n  # compiled extensions and are not provided as pre-built wheel packages,\n  # pip will build them from source using the MSVC compiler matching the\n  # target Python version and architecture\n  - \"pip install -e .[test]\"\n  - \"pip install codecov\"\n\nbuild_script:\n  # Build the compiled extension\n  - \"python setup.py build\"\n\ntest_script:\n  # Run the project tests and store results in .xml log\n  - \"pytest fhir/resources/STU3/tests\"\n  - \"pytest fhir/resources/R4B/tests\"\n  - \"pytest fhir/resources/tests\"\n\nafter_test:\n  # If tests are successful, create binary packages for the project.\n  - \"python setup.py bdist_wheel\"\n  - ps: \"ls dist\"\n\nartifacts:\n  # Archive the generated packages in the ci.appveyor.com build report.\n  - path: dist\\*\n\n#on_success:\n#  - TODO: upload the content of dist/*.whl to a public wheelhouse\n#\n\n# on_finish:\n  # Upload test results to AppVeyor\n"
  },
  {
    "path": "fhir/__init__.py",
    "content": ""
  },
  {
    "path": "fhir/resources/R4B/__init__.py",
    "content": "from __future__ import annotations as _annotations\n\nfrom functools import lru_cache\nfrom typing import TYPE_CHECKING, cast\n\nfrom fhir_core.fhirabstractmodel import FHIRAbstractModel\n\n__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n__fhir_version__ = \"4.3.0\"\n\n\n@lru_cache(maxsize=None, typed=True)\ndef get_fhir_model_class(model_name: str) -> type[FHIRAbstractModel]:\n    \"\"\" \"\"\"\n    from . import fhirtypes as ft\n\n    try:\n        model_type = getattr(ft, model_name + \"Type\")\n        if TYPE_CHECKING:\n            from fhir_core.types import FhirBase\n\n            model_type = cast(type[FhirBase], model_type)\n\n        return model_type.get_model_klass()\n\n    except AttributeError:\n        raise ValueError(f\"{model_name} is not a valid FHIR Model\")\n"
  },
  {
    "path": "fhir/resources/R4B/account.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Account\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Account(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Tracks balance, charges, for patient or cost center.\n    A financial tool for tracking value accrued for a particular purpose.  In\n    the healthcare field, used to track charges for a patient, cost centers,\n    etc.\n    \"\"\"\n\n    __resource_type__ = \"Account\"\n\n    coverage: typing.List[fhirtypes.AccountCoverageType] | None = Field(\n        default=None,\n        alias=\"coverage\",\n        title=(\n            \"The party(s) that are responsible for covering the payment of this \"\n            \"account, and what order should they be applied to the account\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Explanation of purpose/use\",\n        description=(\n            \"Provides additional information about what the account tracks and how \"\n            \"it is used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    guarantor: typing.List[fhirtypes.AccountGuarantorType] | None = Field(\n        default=None,\n        alias=\"guarantor\",\n        title=\"The parties ultimately responsible for balancing the Account\",\n        description=(\n            \"The parties responsible for balancing the account if other payment \"\n            \"options fall short.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Account number\",\n        description=(\n            \"Unique identifier used to reference the account.  Might or might not \"\n            \"be intended for human use (e.g. credit card number).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human-readable label\",\n        description=(\n            \"Name used for the account when displaying it to humans in reports, \" \"etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    owner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"owner\",\n        title=\"Entity managing the Account\",\n        description=(\n            \"Indicates the service area, hospital, department, etc. with \"\n            \"responsibility for managing the Account.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    partOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Reference to a parent Account\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    servicePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicePeriod\",\n        title=\"Transaction window\",\n        description=\"The date range of services associated with this account.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error | on-hold | unknown\",\n        description=\"Indicates whether the account is presently used/usable or not.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"active\",\n                \"inactive\",\n                \"entered-in-error\",\n                \"on-hold\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The entity that caused the expenses\",\n        description=(\n            \"Identifies the entity which incurs the expenses. While the immediate \"\n            \"recipients of services or goods might be entities related to the \"\n            \"subject, the expenses were ultimately incurred by the subject of the \"\n            \"Account.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Device\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Location\",\n                \"HealthcareService\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"E.g. patient, expense, depreciation\",\n        description=\"Categorizes the account for reporting and searching purposes.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Account`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"name\",\n            \"subject\",\n            \"servicePeriod\",\n            \"coverage\",\n            \"owner\",\n            \"description\",\n            \"guarantor\",\n            \"partOf\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Account`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"name\",\n            \"subject\",\n            \"servicePeriod\",\n            \"coverage\",\n            \"owner\",\n            \"description\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass AccountCoverage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The party(s) that are responsible for covering the payment of this account,\n    and what order should they be applied to the account.\n    \"\"\"\n\n    __resource_type__ = \"AccountCoverage\"\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=(\n            \"The party(s), such as insurances, that may contribute to the payment \"\n            \"of this account\"\n        ),\n        description=(\n            \"The party(s) that contribute to payment (or part of) of the charges \"\n            \"applied to this account (including self-pay).  A coverage may only be \"\n            \"responsible for specific types of charges, and the sequence of the \"\n            \"coverages in the account could be important when processing billing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    priority: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"The priority of the coverage in the context of this account\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AccountCoverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"coverage\", \"priority\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AccountCoverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"coverage\", \"priority\"]\n\n\nclass AccountGuarantor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The parties ultimately responsible for balancing the Account.\n    The parties responsible for balancing the account if other payment options\n    fall short.\n    \"\"\"\n\n    __resource_type__ = \"AccountGuarantor\"\n\n    onHold: bool | None = Field(\n        default=None,\n        alias=\"onHold\",\n        title=\"Credit or other hold applied\",\n        description=(\n            \"A guarantor may be placed on credit hold or otherwise have their role \"\n            \"temporarily suspended.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    onHold__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onHold\", title=\"Extension field for ``onHold``.\"\n    )\n\n    party: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"party\",\n        title=\"Responsible entity\",\n        description=\"The entity who is responsible.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\", \"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Guarantee account during\",\n        description=(\n            \"The timeframe during which the guarantor accepts responsibility for \"\n            \"the account.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AccountGuarantor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"party\", \"onHold\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AccountGuarantor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/activitydefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ActivityDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ActivityDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The definition of a specific activity to be taken, independent of any\n    particular patient or context.\n    This resource allows for the definition of some activity to be performed,\n    independent of a particular patient, practitioner, or other performance\n    context.\n    \"\"\"\n\n    __resource_type__ = \"ActivityDefinition\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the activity definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"What part of body to perform on\",\n        description=(\n            \"Indicates the sites on the subject's body where the procedure should \"\n            \"be performed (I.e. the target sites).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Detail type of activity\",\n        description=(\n            \"Detailed description of the type of activity; e.g. What lab test, what\"\n            \" procedure, what kind of encounter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the activity definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the activity definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the activity definition was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the activity definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the activity definition\",\n        description=(\n            \"A free text natural language description of the activity definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"True if the activity should not be performed\",\n        description=(\n            \"Set this to true if the definition is to indicate that a particular \"\n            \"activity should NOT be performed. If true, this element should be \"\n            \"interpreted to reinforce a negative coding. For example NPO as a code \"\n            \"with a doNotPerform of true would still indicate to NOT perform the \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    dosage: typing.List[fhirtypes.DosageType] | None = Field(\n        default=None,\n        alias=\"dosage\",\n        title=\"Detailed dosage instructions\",\n        description=(\n            \"Provides detailed dosage instructions in the same way that they are \"\n            \"described for MedicationRequest resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dynamicValue: typing.List[\n        fhirtypes.ActivityDefinitionDynamicValueType\n    ] | None = Field(\n        default=None,\n        alias=\"dynamicValue\",\n        title=\"Dynamic aspects of the definition\",\n        description=(\n            \"Dynamic values that will be evaluated to produce values for elements \"\n            \"of the resulting resource. For example, if the dosage of a medication \"\n            \"must be computed based on the patient's weight, a dynamic value would \"\n            \"be used to specify an expression that calculated the weight, and the \"\n            \"path on the request resource that would contain the result.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the activity definition is expected to be used\",\n        description=(\n            \"The period during which the activity definition content was or is \"\n            \"planned to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization responsible for officially endorsing the\"\n            \" content for use in some setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this activity definition is authored \"\n            \"for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the activity definition\",\n        description=(\n            \"A formal identifier that is used to identify this activity definition \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"proposal | plan | directive | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            \"Indicates the level of authority/intentionality associated with the \"\n            \"activity and where the request should fit into the workflow chain.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposal\",\n                \"plan\",\n                \"directive\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for activity definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the activity definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"Kind of resource\",\n        description=(\n            \"A description of the kind of resource the activity definition is \"\n            \"representing. For example, a MedicationRequest, a ServiceRequest, or a\"\n            \" CommunicationRequest. Typically, but not always, this is a Request \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the activity definition was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    library: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the activity definition\",\n        description=(\n            \"A reference to a Library resource containing any formal logic used by \"\n            \"the activity definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n    library__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_library\", title=\"Extension field for ``library``.\"\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where it should happen\",\n        description=(\n            \"Identifies the facility where the activity will occur; e.g. home, \"\n            \"hospital, specific clinic, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this activity definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the activity definition. This name\"\n            \" should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    observationRequirement: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"observationRequirement\",\n        title=\"What observations are required to perform this action\",\n        description=(\n            \"Defines observation requirements for the action to be performed, such \"\n            \"as body weight or surface area.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    observationResultRequirement: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"observationResultRequirement\",\n        title=\"What observations must be produced by this action\",\n        description=(\n            \"Defines the observations that are expected to be produced by the \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    participant: typing.List[\n        fhirtypes.ActivityDefinitionParticipantType\n    ] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Who should participate in the action\",\n        description=\"Indicates who should participate in performing the action described.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the activity  should be addressed with respect \"\n            \"to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    productCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productCodeableConcept\",\n        title=\"What's administered/supplied\",\n        description=(\n            \"Identifies the food, drug or other product being consumed or supplied \"\n            \"in the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e product[x]\n            \"one_of_many\": \"product\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    productReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"productReference\",\n        title=\"What's administered/supplied\",\n        description=(\n            \"Identifies the food, drug or other product being consumed or supplied \"\n            \"in the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e product[x]\n            \"one_of_many\": \"product\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\", \"Substance\", \"Ingredient\"],\n        },\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"What profile the resource needs to conform to\",\n        description=(\n            \"A profile to which the target of the activity definition is expected \"\n            \"to conform.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the activity\"\n            \" definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this activity definition is defined\",\n        description=(\n            \"Explanation of why this activity definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"How much is administered/consumed/supplied\",\n        description=(\n            \"Identifies the quantity expected to be consumed at once (per dose, per\"\n            \" meal, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc.\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization primarily responsible for review of some\"\n            \" aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specimenRequirement: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"specimenRequirement\",\n        title=\"What specimens are required to perform this action\",\n        description=(\n            \"Defines specimen requirements for the action to be performed, such as \"\n            \"required specimens for a lab test.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SpecimenDefinition\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this activity definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"subjectCanonical\",\n        title=\"Type of individual the activity definition is intended for\",\n        description=(\n            \"A code, group definition, or canonical reference that describes  or \"\n            \"identifies the intended subject of the activity being defined.  \"\n            \"Canonical references are allowed to support the definition of \"\n            \"protocols for drug and substance quality specifications, and is \"\n            \"allowed to reference a MedicinalProductDefinition, \"\n            \"SubstanceDefinition, AdministrableProductDefinition, \"\n            \"ManufacturedItemDefinition, or PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n    subjectCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subjectCanonical\",\n        title=\"Extension field for ``subjectCanonical``.\",\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=\"Type of individual the activity definition is intended for\",\n        description=(\n            \"A code, group definition, or canonical reference that describes  or \"\n            \"identifies the intended subject of the activity being defined.  \"\n            \"Canonical references are allowed to support the definition of \"\n            \"protocols for drug and substance quality specifications, and is \"\n            \"allowed to reference a MedicinalProductDefinition, \"\n            \"SubstanceDefinition, AdministrableProductDefinition, \"\n            \"ManufacturedItemDefinition, or PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=\"Type of individual the activity definition is intended for\",\n        description=(\n            \"A code, group definition, or canonical reference that describes  or \"\n            \"identifies the intended subject of the activity being defined.  \"\n            \"Canonical references are allowed to support the definition of \"\n            \"protocols for drug and substance quality specifications, and is \"\n            \"allowed to reference a MedicinalProductDefinition, \"\n            \"SubstanceDefinition, AdministrableProductDefinition, \"\n            \"ManufacturedItemDefinition, or PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the activity definition\",\n        description=(\n            \"An explanatory or alternate title for the activity definition giving \"\n            \"additional information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    timingAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"timingAge\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timingDateTime\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timingDateTime\",\n        title=\"Extension field for ``timingDateTime``.\",\n    )\n\n    timingDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"timingDuration\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"timingRange\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this activity definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the activity definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc.\",\n        description=(\n            \"Descriptive topics related to the content of the activity. Topics \"\n            \"provide a high-level categorization of the activity that can be useful\"\n            \" for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    transform: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"transform\",\n        title=\"Transform to apply the template\",\n        description=(\n            \"A reference to a StructureMap resource that defines a transform that \"\n            \"can be executed to produce the intent resource using the \"\n            \"ActivityDefinition instance as the input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureMap\"],\n        },\n    )\n    transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_transform\", title=\"Extension field for ``transform``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this activity definition, represented as a \"\n            \"URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this activity definition when\"\n            \" it is referenced in a specification, model, design or an instance; \"\n            \"also called its canonical identifier. This SHOULD be globally unique \"\n            \"and SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this activity definition is (or will be) published. This \"\n            \"URL can be the target of a canonical reference. It SHALL remain the \"\n            \"same when the activity definition is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the activity definition\",\n        description=(\n            \"A detailed description of how the activity definition is used from a \"\n            \"clinical perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate activity definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the activity definition\",\n        description=(\n            \"The identifier that is used to identify this version of the activity \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the activity \"\n            \"definition author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence. To provide a version consistent \"\n            \"with the Decision Support Service specification, use the format \"\n            \"Major.Minor.Revision (e.g. 1.0.0). For more information on versioning \"\n            \"knowledge assets, refer to the Decision Support Service specification.\"\n            \" Note that a version is required for non-experimental active assets.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ActivityDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"status\",\n            \"experimental\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"subjectCanonical\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"usage\",\n            \"copyright\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"library\",\n            \"kind\",\n            \"profile\",\n            \"code\",\n            \"intent\",\n            \"priority\",\n            \"doNotPerform\",\n            \"timingTiming\",\n            \"timingDateTime\",\n            \"timingAge\",\n            \"timingPeriod\",\n            \"timingRange\",\n            \"timingDuration\",\n            \"location\",\n            \"participant\",\n            \"productReference\",\n            \"productCodeableConcept\",\n            \"quantity\",\n            \"dosage\",\n            \"bodySite\",\n            \"specimenRequirement\",\n            \"observationRequirement\",\n            \"observationResultRequirement\",\n            \"transform\",\n            \"dynamicValue\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ActivityDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"kind\",\n            \"code\",\n            \"doNotPerform\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"product\": [\"productCodeableConcept\", \"productReference\"],\n            \"subject\": [\n                \"subjectCanonical\",\n                \"subjectCodeableConcept\",\n                \"subjectReference\",\n            ],\n            \"timing\": [\n                \"timingAge\",\n                \"timingDateTime\",\n                \"timingDuration\",\n                \"timingPeriod\",\n                \"timingRange\",\n                \"timingTiming\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ActivityDefinitionDynamicValue(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dynamic aspects of the definition.\n    Dynamic values that will be evaluated to produce values for elements of the\n    resulting resource. For example, if the dosage of a medication must be\n    computed based on the patient's weight, a dynamic value would be used to\n    specify an expression that calculated the weight, and the path on the\n    request resource that would contain the result.\n    \"\"\"\n\n    __resource_type__ = \"ActivityDefinitionDynamicValue\"\n\n    expression: fhirtypes.ExpressionType = Field(\n        default=...,\n        alias=\"expression\",\n        title=\"An expression that provides the dynamic value for the customization\",\n        description=\"An expression specifying the value of the customized element.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"The path to the element to be set dynamically\",\n        description=(\n            \"The path to the element to be customized. This is the path on the \"\n            \"resource that will hold the result of the calculation defined by the \"\n            \"expression. The specified path SHALL be a FHIRPath resolveable on the \"\n            \"specified target type of the ActivityDefinition, and SHALL consist \"\n            \"only of identifiers, constant indexers, and a restricted subset of \"\n            \"functions. The path is allowed to contain qualifiers (.) to traverse \"\n            \"sub-elements, as well as indexers ([x]) to traverse multiple-\"\n            \"cardinality sub-elements (see the [Simple FHIRPath \"\n            \"Profile](fhirpath.html#simple) for full details).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ActivityDefinitionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"path\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ActivityDefinitionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"path\", \"path__ext\")]\n        return required_fields\n\n\nclass ActivityDefinitionParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who should participate in the action.\n    Indicates who should participate in performing the action described.\n    \"\"\"\n\n    __resource_type__ = \"ActivityDefinitionParticipant\"\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"E.g. Nurse, Surgeon, Parent, etc.\",\n        description=(\n            \"The role the participant should play in performing the described \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"patient | practitioner | related-person | device\",\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"patient\", \"practitioner\", \"related-person\", \"device\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ActivityDefinitionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"role\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ActivityDefinitionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/address.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Address\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Address(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An address expressed using postal conventions (as opposed to GPS or other\n    location definition formats).\n    An address expressed using postal conventions (as opposed to GPS or other\n    location definition formats).  This data type may be used to convey\n    addresses for use in delivering mail as well as for visiting locations\n    which might not be valid for mail delivery.  There are a variety of postal\n    address formats defined around the world.\n    \"\"\"\n\n    __resource_type__ = \"Address\"\n\n    city: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"city\",\n        title=\"Name of city, town etc.\",\n        description=(\n            \"The name of the city, town, suburb, village or other community or \"\n            \"delivery center.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    city__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_city\", title=\"Extension field for ``city``.\"\n    )\n\n    country: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"country\",\n        title=\"Country (e.g. can be ISO 3166 2 or 3 letter code)\",\n        description=\"Country - a nation as commonly understood or generally accepted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    country__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_country\", title=\"Extension field for ``country``.\"\n    )\n\n    district: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"district\",\n        title=\"District name (aka county)\",\n        description=\"The name of the administrative area (county).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    district__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_district\", title=\"Extension field for ``district``.\"\n    )\n\n    line: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"line\",\n        title=\"Street name, number, direction & P.O. Box etc.\",\n        description=(\n            \"This component contains the house number, apartment number, street \"\n            \"name, street direction,  P.O. Box number, delivery hints, and similar \"\n            \"address information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    line__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_line\", title=\"Extension field for ``line``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when address was/is in use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    postalCode: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"postalCode\",\n        title=\"Postal code for area\",\n        description=\"A postal code designating a region defined by the postal service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    postalCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_postalCode\", title=\"Extension field for ``postalCode``.\"\n    )\n\n    state: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"state\",\n        title=\"Sub-unit of country (abbreviations ok)\",\n        description=(\n            \"Sub-unit of a country with limited sovereignty in a federally \"\n            \"organized country. A code may be used if codes are in common use (e.g.\"\n            \" US 2 letter state codes).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    state__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_state\", title=\"Extension field for ``state``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text representation of the address\",\n        description=(\n            \"Specifies the entire address as it should be displayed e.g. on a \"\n            \"postal label. This may be provided instead of or as well as the \"\n            \"specific parts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"postal | physical | both\",\n        description=(\n            \"Distinguishes between physical addresses (those you can visit) and \"\n            \"mailing addresses (e.g. PO Boxes and care-of addresses). Most \"\n            \"addresses are both.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"postal\", \"physical\", \"both\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"home | work | temp | old | billing - purpose of this address\",\n        description=\"The purpose of this address.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"home\", \"work\", \"temp\", \"old\", \"billing\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Address`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"use\",\n            \"type\",\n            \"text\",\n            \"line\",\n            \"city\",\n            \"district\",\n            \"state\",\n            \"postalCode\",\n            \"country\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Address`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"use\",\n            \"type\",\n            \"text\",\n            \"line\",\n            \"city\",\n            \"district\",\n            \"state\",\n            \"postalCode\",\n            \"country\",\n            \"period\",\n        ]\n"
  },
  {
    "path": "fhir/resources/R4B/administrableproductdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AdministrableProductDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass AdministrableProductDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A medicinal product in the final form, suitable for administration - after\n    any mixing of multiple components.\n    A medicinal product in the final form which is suitable for administering\n    to a patient (after any mixing of multiple components, dissolution etc. has\n    been performed).\n    \"\"\"\n\n    __resource_type__ = \"AdministrableProductDefinition\"\n\n    administrableDoseForm: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"administrableDoseForm\",\n        title=(\n            \"The dose form of the final product after necessary reconstitution or \"\n            \"processing\"\n        ),\n        description=(\n            \"The dose form of the final product after necessary reconstitution or \"\n            \"processing. Contrasts to the manufactured dose form (see \"\n            \"ManufacturedItemDefinition). If the manufactured form was 'powder for \"\n            \"solution for injection', the administrable dose form could be \"\n            \"'solution for injection' (once mixed with another item having \"\n            \"manufactured form 'solvent for solution for injection').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=(\n            \"A device that is integral to the medicinal product, in effect being \"\n            'considered as an \"ingredient\" of the medicinal product'\n        ),\n        description=(\n            \"A device that is integral to the medicinal product, in effect being \"\n            'considered as an \"ingredient\" of the medicinal product. This is not '\n            \"intended for devices that are just co-packaged.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceDefinition\"],\n        },\n    )\n\n    formOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"formOf\",\n        title=(\n            \"References a product from which one or more of the constituent parts \"\n            \"of that product can be prepared and used as described by this \"\n            \"administrable product\"\n        ),\n        description=(\n            \"References a product from which one or more of the constituent parts \"\n            \"of that product can be prepared and used as described by this \"\n            \"administrable product.  If this administrable product describes the \"\n            \"administration of a crushed tablet, the 'formOf' would be the product \"\n            \"representing a distribution containing tablets and possibly also a \"\n            \"cream.  This is distinct from the 'producedFrom' which refers to the \"\n            \"specific components of the product that are used in this preparation, \"\n            \"rather than the product as a whole.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicinalProductDefinition\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier for the administrable product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=(\n            \"The ingredients of this administrable medicinal product. This is only \"\n            \"needed if the ingredients are not specified either using \"\n            \"ManufacturedItemDefiniton, or using by incoming references from the \"\n            \"Ingredient resource\"\n        ),\n        description=(\n            \"The ingredients of this administrable medicinal product. This is only \"\n            \"needed if the ingredients are not specified either using \"\n            \"ManufacturedItemDefiniton (via \"\n            \"AdministrableProductDefinition.producedFrom) to state which component \"\n            \"items are used to make this, or using by incoming references from the \"\n            \"Ingredient resource, to state in detail which substances exist within \"\n            \"this. This element allows a basic coded ingredient to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    producedFrom: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"producedFrom\",\n        title=(\n            \"Indicates the specific manufactured items that are part of the \"\n            \"'formOf' product that are used in the preparation of this specific \"\n            \"administrable form\"\n        ),\n        description=(\n            \"Indicates the specific manufactured items that are part of the \"\n            \"'formOf' product that are used in the preparation of this specific \"\n            \"administrable form.  In some cases, an administrable form might use \"\n            \"all of the items from the overall product (or there might only be one \"\n            \"item), while in other cases, an administrable form might use only a \"\n            \"subset of the items available in the overall product.  For example, an\"\n            \" administrable form might involve combining a liquid and a powder \"\n            \"available as part of an overall product, but not involve applying the \"\n            \"also supplied cream.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ManufacturedItemDefinition\"],\n        },\n    )\n\n    property: typing.List[\n        fhirtypes.AdministrableProductDefinitionPropertyType\n    ] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Characteristics e.g. a product's onset of action\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    routeOfAdministration: typing.List[\n        fhirtypes.AdministrableProductDefinitionRouteOfAdministrationType\n    ] = Field(\n        default=...,\n        alias=\"routeOfAdministration\",\n        title=(\n            \"The path by which the product is taken into or makes contact with the \"\n            \"body\"\n        ),\n        description=(\n            \"The path by which the product is taken into or makes contact with the \"\n            \"body. In some regions this is referred to as the licenced or approved \"\n            \"route. RouteOfAdministration cannot be used when the 'formOf' product \"\n            \"already uses MedicinalProductDefinition.route (and vice versa).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this administrable product. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    unitOfPresentation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unitOfPresentation\",\n        title=(\n            \"The presentation type in which this item is given to a patient. e.g. \"\n            \"for a spray - 'puff'\"\n        ),\n        description=(\n            \"The presentation type in which this item is given to a patient. e.g. \"\n            \"for a spray - 'puff' (as in 'contains 100 mcg per puff'), or for a \"\n            \"liquid - 'vial' (as in 'contains 5 ml per vial').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdministrableProductDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"formOf\",\n            \"administrableDoseForm\",\n            \"unitOfPresentation\",\n            \"producedFrom\",\n            \"ingredient\",\n            \"device\",\n            \"property\",\n            \"routeOfAdministration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"formOf\",\n            \"administrableDoseForm\",\n            \"unitOfPresentation\",\n            \"producedFrom\",\n            \"ingredient\",\n            \"device\",\n            \"property\",\n            \"routeOfAdministration\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass AdministrableProductDefinitionProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Characteristics e.g. a product's onset of action.\n    \"\"\"\n\n    __resource_type__ = \"AdministrableProductDefinitionProperty\"\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"The status of characteristic e.g. assigned or pending\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"A code expressing the type of characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdministrableProductDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n            \"status\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n            \"status\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDate\",\n                \"valueQuantity\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass AdministrableProductDefinitionRouteOfAdministration(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The path by which the product is taken into or makes contact with the body.\n    The path by which the product is taken into or makes contact with the body.\n    In some regions this is referred to as the licenced or approved route.\n    RouteOfAdministration cannot be used when the 'formOf' product already uses\n    MedicinalProductDefinition.route (and vice versa).\n    \"\"\"\n\n    __resource_type__ = \"AdministrableProductDefinitionRouteOfAdministration\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Coded expression for the route\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    firstDose: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"firstDose\",\n        title=(\n            \"The first dose (dose quantity) administered can be specified for the \"\n            \"product\"\n        ),\n        description=(\n            \"The first dose (dose quantity) administered can be specified for the \"\n            \"product, using a numerical value and its unit of measurement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxDosePerDay: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxDosePerDay\",\n        title=\"The maximum dose quantity to be administered in any one 24-h period\",\n        description=(\n            \"The maximum dose per day (maximum dose quantity to be administered in \"\n            \"any one 24-h period) that can be administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxDosePerTreatmentPeriod: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"maxDosePerTreatmentPeriod\",\n        title=\"The maximum dose per treatment period that can be administered\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxSingleDose: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxSingleDose\",\n        title=\"The maximum single dose that can be administered\",\n        description=(\n            \"The maximum single dose that can be administered, specified using a \"\n            \"numerical value and its unit of measurement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxTreatmentPeriod: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"maxTreatmentPeriod\",\n        title=(\n            \"The maximum treatment period during which the product can be \"\n            \"administered\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    targetSpecies: typing.List[\n        fhirtypes.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType\n    ] | None = Field(\n        default=None,\n        alias=\"targetSpecies\",\n        title=\"A species for which this route applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdministrableProductDefinitionRouteOfAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"firstDose\",\n            \"maxSingleDose\",\n            \"maxDosePerDay\",\n            \"maxDosePerTreatmentPeriod\",\n            \"maxTreatmentPeriod\",\n            \"targetSpecies\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionRouteOfAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"code\",\n            \"firstDose\",\n            \"maxSingleDose\",\n            \"maxDosePerDay\",\n            \"maxDosePerTreatmentPeriod\",\n            \"maxTreatmentPeriod\",\n            \"targetSpecies\",\n        ]\n\n\nclass AdministrableProductDefinitionRouteOfAdministrationTargetSpecies(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A species for which this route applies.\n    \"\"\"\n\n    __resource_type__ = (\n        \"AdministrableProductDefinitionRouteOfAdministrationTargetSpecies\"\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Coded expression for the species\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    withdrawalPeriod: typing.List[\n        fhirtypes.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType\n    ] | None = Field(\n        default=None,\n        alias=\"withdrawalPeriod\",\n        title=(\n            \"A species specific time during which consumption of animal product is \"\n            \"not appropriate\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdministrableProductDefinitionRouteOfAdministrationTargetSpecies`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"withdrawalPeriod\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionRouteOfAdministrationTargetSpecies`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"withdrawalPeriod\"]\n\n\nclass AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A species specific time during which consumption of animal product is not\n    appropriate.\n    \"\"\"\n\n    __resource_type__ = \"AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod\"\n\n    supportingInformation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Extra information about the withdrawal period\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    supportingInformation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_supportingInformation\",\n        title=\"Extension field for ``supportingInformation``.\",\n    )\n\n    tissue: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"tissue\",\n        title=(\n            \"The type of tissue for which the withdrawal period applies, e.g. meat,\"\n            \" milk\"\n        ),\n        description=(\n            \"Coded expression for the type of tissue for which the withdrawal \"\n            \"period applies, e.g. meat, milk.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    value: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"value\",\n        title=\"A value for the time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"tissue\",\n            \"value\",\n            \"supportingInformation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"tissue\", \"value\", \"supportingInformation\"]\n"
  },
  {
    "path": "fhir/resources/R4B/adverseevent.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AdverseEvent\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass AdverseEvent(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Medical care, research study or other healthcare event causing physical\n    injury.\n    Actual or  potential/avoided event causing unintended physical injury\n    resulting from or contributed to by medical care, a research study or other\n    healthcare setting factors that requires additional monitoring, treatment,\n    or hospitalization, or that results in death.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEvent\"\n\n    actuality: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"actuality\",\n        title=\"actual | potential\",\n        description=(\n            \"Whether the event actually happened, or just had the potential to. \"\n            \"Note that this is independent of whether anyone was affected or harmed\"\n            \" or how severely.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"actual\", \"potential\"],\n        },\n    )\n    actuality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actuality\", title=\"Extension field for ``actuality``.\"\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=(\n            \"product-problem | product-quality | product-use-error | wrong-dose | \"\n            \"incorrect-prescribing-information | wrong-technique | wrong-route-of-\"\n            \"administration | wrong-rate | wrong-duration | wrong-time | expired-\"\n            \"drug | medical-device-use-error | problem-different-manufacturer | \"\n            \"unsafe-physical-environment\"\n        ),\n        description=\"The overall type of event, intended for search and filtering purposes.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contributor: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"contributor\",\n        title=\"Who  was involved in the adverse event or the potential adverse event\",\n        description=(\n            \"Parties that may or should contribute or have contributed information \"\n            \"to the adverse event, which can consist of one or more activities.  \"\n            \"Such information includes information leading to the decision to \"\n            \"perform the activity and how to perform the activity (e.g. \"\n            \"consultant), information that the activity itself seeks to reveal \"\n            \"(e.g. informant of clinical history), or information about what \"\n            \"activity was performed (e.g. informant witness).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\", \"Device\"],\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the event occurred\",\n        description=\"The date (and perhaps time) when the adverse event occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    detected: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"detected\",\n        title=\"When the event was detected\",\n        description=(\n            \"Estimated or actual date the AdverseEvent began, in the opinion of the\"\n            \" reporter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    detected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_detected\", title=\"Extension field for ``detected``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter created as part of\",\n        description=(\n            \"The Encounter during which AdverseEvent was created or to which the \"\n            \"creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    event: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"Type of the event itself in relation to the subject\",\n        description=(\n            \"This element defines the specific type of event that occurred or that \"\n            \"was prevented from occurring.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for the event\",\n        description=(\n            \"Business identifiers assigned to this adverse event by the performer \"\n            \"or other systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Location where adverse event occurred\",\n        description=\"The information about where the adverse event occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=(\n            \"resolved | recovering | ongoing | resolvedWithSequelae | fatal | \"\n            \"unknown\"\n        ),\n        description=\"Describes the type of outcome from the adverse event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    recordedDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recordedDate\",\n        title=\"When the event was recorded\",\n        description=(\n            \"The date on which the existence of the AdverseEvent was first \" \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    recordedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_recordedDate\",\n        title=\"Extension field for ``recordedDate``.\",\n    )\n\n    recorder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recorder\",\n        title=\"Who recorded the adverse event\",\n        description=(\n            \"Information on who recorded the adverse event.  May be the patient or \"\n            \"a practitioner.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    referenceDocument: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"referenceDocument\",\n        title=\"AdverseEvent.referenceDocument\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    resultingCondition: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"resultingCondition\",\n        title=\"Effect on the subject due to this event\",\n        description=(\n            \"Includes information about the reaction that occurred as a result of \"\n            \"exposure to a substance (for example, a drug or a chemical).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    seriousness: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"seriousness\",\n        title=\"Seriousness of the event\",\n        description=\"Assessment whether this event was of real importance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    severity: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"mild | moderate | severe\",\n        description=(\n            \"Describes the severity of the adverse event, in relation to the \"\n            \"subject. Contrast to AdverseEvent.seriousness - a severe rash might \"\n            \"not be serious, but a mild heart problem is.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    study: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"study\",\n        title=\"AdverseEvent.study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchStudy\"],\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Subject impacted by event\",\n        description=\"This subject or group impacted by the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    subjectMedicalHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subjectMedicalHistory\",\n        title=\"AdverseEvent.subjectMedicalHistory\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"AllergyIntolerance\",\n                \"FamilyMemberHistory\",\n                \"Immunization\",\n                \"Procedure\",\n                \"Media\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    suspectEntity: typing.List[fhirtypes.AdverseEventSuspectEntityType] | None = Field(\n        default=None,\n        alias=\"suspectEntity\",\n        title=\"The suspected agent causing the adverse event\",\n        description=(\n            \"Describes the entity that is suspected to have caused the adverse \"\n            \"event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"actuality\",\n            \"category\",\n            \"event\",\n            \"subject\",\n            \"encounter\",\n            \"date\",\n            \"detected\",\n            \"recordedDate\",\n            \"resultingCondition\",\n            \"location\",\n            \"seriousness\",\n            \"severity\",\n            \"outcome\",\n            \"recorder\",\n            \"contributor\",\n            \"suspectEntity\",\n            \"subjectMedicalHistory\",\n            \"referenceDocument\",\n            \"study\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"actuality\",\n            \"category\",\n            \"event\",\n            \"subject\",\n            \"encounter\",\n            \"date\",\n            \"detected\",\n            \"recordedDate\",\n            \"resultingCondition\",\n            \"location\",\n            \"seriousness\",\n            \"severity\",\n            \"outcome\",\n            \"recorder\",\n            \"contributor\",\n            \"suspectEntity\",\n            \"subjectMedicalHistory\",\n            \"referenceDocument\",\n            \"study\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"actuality\", \"actuality__ext\")]\n        return required_fields\n\n\nclass AdverseEventSuspectEntity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The suspected agent causing the adverse event.\n    Describes the entity that is suspected to have caused the adverse event.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEventSuspectEntity\"\n\n    causality: typing.List[\n        fhirtypes.AdverseEventSuspectEntityCausalityType\n    ] | None = Field(\n        default=None,\n        alias=\"causality\",\n        title=\"Information on the possible cause of the event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instance: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"instance\",\n        title=\"Refers to the specific entity that caused the adverse event\",\n        description=(\n            \"Identifies the actual instance of what caused the adverse event.  May \"\n            \"be a substance, medication, medication administration, medication \"\n            \"statement or a device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Immunization\",\n                \"Procedure\",\n                \"Substance\",\n                \"Medication\",\n                \"MedicationAdministration\",\n                \"MedicationStatement\",\n                \"Device\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEventSuspectEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"instance\", \"causality\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEventSuspectEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"instance\", \"causality\"]\n\n\nclass AdverseEventSuspectEntityCausality(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information on the possible cause of the event.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEventSuspectEntityCausality\"\n\n    assessment: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"assessment\",\n        title=\"Assessment of if the entity caused the event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"AdverseEvent.suspectEntity.causalityAuthor\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"ProbabilityScale | Bayesian | Checklist\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    productRelatedness: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"productRelatedness\",\n        title=\"AdverseEvent.suspectEntity.causalityProductRelatedness\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    productRelatedness__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_productRelatedness\",\n        title=\"Extension field for ``productRelatedness``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEventSuspectEntityCausality`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"assessment\",\n            \"productRelatedness\",\n            \"author\",\n            \"method\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEventSuspectEntityCausality`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"assessment\",\n            \"productRelatedness\",\n            \"author\",\n            \"method\",\n        ]\n"
  },
  {
    "path": "fhir/resources/R4B/age.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Age\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Age(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A duration of time during which an organism (or a process) has existed.\n    \"\"\"\n\n    __resource_type__ = \"Age\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Age`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Age`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/R4B/allergyintolerance.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AllergyIntolerance\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass AllergyIntolerance(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Allergy or Intolerance (generally: Risk of adverse reaction to a substance).\n    Risk of harmful or undesirable, physiological response which is unique to\n    an individual and associated with exposure to a substance.\n    \"\"\"\n\n    __resource_type__ = \"AllergyIntolerance\"\n\n    asserter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"asserter\",\n        title=\"Source of the information about the allergy\",\n        description=\"The source of the information about the allergy that is recorded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"food | medication | environment | biologic\",\n        description=\"Category of the identified substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"food\", \"medication\", \"environment\", \"biologic\"],\n        },\n    )\n    category__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_category\", title=\"Extension field for ``category``.\"\n    )\n\n    clinicalStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"clinicalStatus\",\n        title=\"active | inactive | resolved\",\n        description=\"The clinical status of the allergy or intolerance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies the allergy or intolerance\",\n        description=(\n            \"Code for an allergy or intolerance statement (either a positive or a \"\n            \"negated/excluded statement).  This may be a code for a substance or \"\n            \"pharmaceutical product that is considered to be responsible for the \"\n            'adverse reaction risk (e.g., \"Latex\"), an allergy or intolerance '\n            'condition (e.g., \"Latex allergy\"), or a negated/excluded code for a '\n            'specific substance or class (e.g., \"No latex allergy\") or a general or'\n            ' categorical negated statement (e.g.,  \"No known allergy\", \"No known '\n            'drug allergies\").  Note: the substance for a specific reaction may be '\n            \"different from the substance identified as the cause of the risk, but \"\n            \"it must be consistent with it. For instance, it may be a more specific\"\n            \" substance (e.g. a brand medication) or a composite product that \"\n            \"includes the identified substance. It must be clinically safe to only \"\n            \"process the 'code' and ignore the 'reaction.substance'.  If a \"\n            \"receiving system is unable to confirm that \"\n            \"AllergyIntolerance.reaction.substance falls within the semantic scope \"\n            \"of AllergyIntolerance.code, then the receiving system should ignore \"\n            \"AllergyIntolerance.reaction.substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    criticality: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"criticality\",\n        title=\"low | high | unable-to-assess\",\n        description=(\n            \"Estimate of the potential clinical harm, or seriousness, of the \"\n            \"reaction to the identified substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"low\", \"high\", \"unable-to-assess\"],\n        },\n    )\n    criticality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_criticality\", title=\"Extension field for ``criticality``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter when the allergy or intolerance was asserted\",\n        description=\"The encounter when the allergy or intolerance was asserted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External ids for this item\",\n        description=(\n            \"Business identifiers assigned to this AllergyIntolerance by the \"\n            \"performer or other systems which remain constant as the resource is \"\n            \"updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastOccurrence: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"lastOccurrence\",\n        title=\"Date(/time) of last known occurrence of a reaction\",\n        description=(\n            \"Represents the date and/or time of the last known occurrence of a \"\n            \"reaction event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastOccurrence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastOccurrence\",\n        title=\"Extension field for ``lastOccurrence``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional text not captured in other fields\",\n        description=(\n            \"Additional narrative about the propensity for the Adverse Reaction, \"\n            \"not captured in other fields.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onsetAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"onsetAge\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"onsetDateTime\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_onsetDateTime\",\n        title=\"Extension field for ``onsetDateTime``.\",\n    )\n\n    onsetPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"onsetPeriod\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"onsetRange\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"onsetString\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onsetString\", title=\"Extension field for ``onsetString``.\"\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who the sensitivity is for\",\n        description=\"The patient who has the allergy or intolerance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    reaction: typing.List[fhirtypes.AllergyIntoleranceReactionType] | None = Field(\n        default=None,\n        alias=\"reaction\",\n        title=\"Adverse Reaction Events linked to exposure to substance\",\n        description=(\n            \"Details about each adverse reaction event linked to exposure to the \"\n            \"identified substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recordedDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recordedDate\",\n        title=\"Date first version of the resource instance was recorded\",\n        description=(\n            \"The recordedDate represents when this particular AllergyIntolerance \"\n            \"record was created in the system, which is often a system-generated \"\n            \"date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    recordedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_recordedDate\",\n        title=\"Extension field for ``recordedDate``.\",\n    )\n\n    recorder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recorder\",\n        title=\"Who recorded the sensitivity\",\n        description=(\n            \"Individual who recorded the record and takes responsibility for its \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"allergy | intolerance - Underlying mechanism (if known)\",\n        description=(\n            \"Identification of the underlying physiological mechanism for the \"\n            \"reaction risk.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"allergy\", \"intolerance\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    verificationStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"verificationStatus\",\n        title=\"unconfirmed | confirmed | refuted | entered-in-error\",\n        description=(\n            \"Assertion about certainty associated with the propensity, or potential\"\n            \" risk, of a reaction to the identified substance (including \"\n            \"pharmaceutical product).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AllergyIntolerance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"clinicalStatus\",\n            \"verificationStatus\",\n            \"type\",\n            \"category\",\n            \"criticality\",\n            \"code\",\n            \"patient\",\n            \"encounter\",\n            \"onsetDateTime\",\n            \"onsetAge\",\n            \"onsetPeriod\",\n            \"onsetRange\",\n            \"onsetString\",\n            \"recordedDate\",\n            \"recorder\",\n            \"asserter\",\n            \"lastOccurrence\",\n            \"note\",\n            \"reaction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AllergyIntolerance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"clinicalStatus\",\n            \"verificationStatus\",\n            \"type\",\n            \"category\",\n            \"criticality\",\n            \"code\",\n            \"patient\",\n            \"asserter\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"onset\": [\n                \"onsetAge\",\n                \"onsetDateTime\",\n                \"onsetPeriod\",\n                \"onsetRange\",\n                \"onsetString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass AllergyIntoleranceReaction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adverse Reaction Events linked to exposure to substance.\n    Details about each adverse reaction event linked to exposure to the\n    identified substance.\n    \"\"\"\n\n    __resource_type__ = \"AllergyIntoleranceReaction\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the event as a whole\",\n        description=(\n            \"Text description about the reaction as a whole, including details of \"\n            \"the manifestation if required.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    exposureRoute: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"exposureRoute\",\n        title=\"How the subject was exposed to the substance\",\n        description=(\n            \"Identification of the route by which the subject was exposed to the \"\n            \"substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    manifestation: typing.List[fhirtypes.CodeableConceptType] = Field(\n        default=...,\n        alias=\"manifestation\",\n        title=\"Clinical symptoms/signs associated with the Event\",\n        description=(\n            \"Clinical symptoms and/or signs that are observed or associated with \"\n            \"the adverse reaction event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Text about event not captured in other fields\",\n        description=(\n            \"Additional text about the adverse reaction event not captured in other\"\n            \" fields.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onset: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"onset\",\n        title=\"Date(/time) when manifestations showed\",\n        description=\"Record of the date and/or time of the onset of the Reaction.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    onset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onset\", title=\"Extension field for ``onset``.\"\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"mild | moderate | severe (of event as a whole)\",\n        description=(\n            \"Clinical assessment of the severity of the reaction event as a whole, \"\n            \"potentially considering multiple different manifestations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"mild\", \"moderate\", \"severe\"],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    substance: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"substance\",\n        title=(\n            \"Specific substance or pharmaceutical product considered to be \"\n            \"responsible for event\"\n        ),\n        description=(\n            \"Identification of the specific substance (or pharmaceutical product) \"\n            \"considered to be responsible for the Adverse Reaction event. Note: the\"\n            \" substance for a specific reaction may be different from the substance\"\n            \" identified as the cause of the risk, but it must be consistent with \"\n            \"it. For instance, it may be a more specific substance (e.g. a brand \"\n            \"medication) or a composite product that includes the identified \"\n            \"substance. It must be clinically safe to only process the 'code' and \"\n            \"ignore the 'reaction.substance'.  If a receiving system is unable to \"\n            \"confirm that AllergyIntolerance.reaction.substance falls within the \"\n            \"semantic scope of AllergyIntolerance.code, then the receiving system \"\n            \"should ignore AllergyIntolerance.reaction.substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AllergyIntoleranceReaction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"substance\",\n            \"manifestation\",\n            \"description\",\n            \"onset\",\n            \"severity\",\n            \"exposureRoute\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AllergyIntoleranceReaction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/annotation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Annotation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Annotation(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Text node with attribution.\n    A  text note which also  contains information about who made the statement\n    and when.\n    \"\"\"\n\n    __resource_type__ = \"Annotation\"\n\n    authorReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authorReference\",\n        title=\"Individual responsible for the annotation\",\n        description=\"The individual responsible for making the annotation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e author[x]\n            \"one_of_many\": \"author\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    authorString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"authorString\",\n        title=\"Individual responsible for the annotation\",\n        description=\"The individual responsible for making the annotation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e author[x]\n            \"one_of_many\": \"author\",\n            \"one_of_many_required\": False,\n        },\n    )\n    authorString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_authorString\",\n        title=\"Extension field for ``authorString``.\",\n    )\n\n    text: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"The annotation  - text content (as markdown)\",\n        description=\"The text of the annotation in markdown format.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    time: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"time\",\n        title=\"When the annotation was made\",\n        description=\"Indicates when this particular annotation was made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_time\", title=\"Extension field for ``time``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Annotation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"authorReference\", \"authorString\", \"time\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Annotation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"authorReference\", \"authorString\", \"time\", \"text\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"text\", \"text__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"author\": [\"authorReference\", \"authorString\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/appointment.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Appointment\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Appointment(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A booking of a healthcare event among patient(s), practitioner(s), related\n    person(s) and/or device(s) for a specific date/time. This may result in one\n    or more Encounter(s).\n    \"\"\"\n\n    __resource_type__ = \"Appointment\"\n\n    appointmentType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"appointmentType\",\n        title=(\n            \"The style of appointment or patient that has been booked in the slot \"\n            \"(not service type)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"The service request this appointment is allocated to assess\",\n        description=(\n            \"The service request this appointment is allocated to assess (e.g. \"\n            \"incoming referral or procedure request).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    cancelationReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"cancelationReason\",\n        title=\"The coded reason for the appointment being cancelled\",\n        description=(\n            \"The coded reason for the appointment being cancelled. This is often \"\n            \"used in reporting/billing/futher processing to determine if further \"\n            \"actions are required, or specific fees apply.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Additional comments\",\n        description=\"Additional comments about the appointment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"The date that this appointment was initially created\",\n        description=(\n            \"The date that this appointment was initially created. This could be \"\n            \"different to the meta.lastModified value on the initial entry, as this\"\n            \" could have been before the resource was created on the FHIR server, \"\n            \"and should remain unchanged over the lifespan of the appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Shown on a subject line in a meeting request, or appointment list\",\n        description=(\n            \"The brief description of the appointment as would be shown on a \"\n            \"subject line in a meeting request, or appointment list. Detailed or \"\n            \"expanded information should be put in the comment field.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    end: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"When appointment is to conclude\",\n        description=\"Date/Time that the appointment is to conclude.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this item\",\n        description=(\n            \"This records identifiers associated with this appointment concern that\"\n            \" are defined by business processes and/or used to refer to it when a \"\n            \"direct URL reference to the resource itself is not appropriate (e.g. \"\n            \"in CDA documents, or in written / printed documentation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    minutesDuration: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"minutesDuration\",\n        title=\"Can be less than start/end (e.g. estimate)\",\n        description=(\n            \"Number of minutes that the appointment is to take. This can be less \"\n            \"than the duration between the start and end times.  For example, where\"\n            \" the actual time of appointment is only an estimate or if a 30 minute \"\n            \"appointment is being requested, but any time would work.  Also, if \"\n            \"there is, for example, a planned 15 minute break in the middle of a \"\n            \"long appointment, the duration may be 15 minutes less than the \"\n            \"difference between the start and end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    minutesDuration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minutesDuration\",\n        title=\"Extension field for ``minutesDuration``.\",\n    )\n\n    participant: typing.List[fhirtypes.AppointmentParticipantType] = Field(\n        default=...,\n        alias=\"participant\",\n        title=\"Participants involved in appointment\",\n        description=\"List of participants involved in the appointment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patientInstruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"patientInstruction\",\n        title=\"Detailed information and instructions for the patient\",\n        description=(\n            \"While Appointment.comment contains information for internal use, \"\n            \"Appointment.patientInstructions is used to capture patient facing \"\n            \"information about the Appointment (e.g. please bring your referral or \"\n            \"fast from 8pm night before).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    patientInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patientInstruction\",\n        title=\"Extension field for ``patientInstruction``.\",\n    )\n\n    priority: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Used to make informed decisions if needing to re-prioritize\",\n        description=(\n            \"The priority of the appointment. Can be used to make informed \"\n            \"decisions if needing to re-prioritize appointments. (The iCal Standard\"\n            \" specifies 0 as undefined, 1 as highest, 9 as lowest priority).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Coded reason this appointment is scheduled\",\n        description=(\n            \"The coded reason that this appointment is being scheduled. This is \"\n            \"more clinical than administrative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Reason the appointment is to take place (resource)\",\n        description=(\n            \"Reason the appointment has been scheduled to take place, as specified \"\n            \"using information from another resource. When the patient arrives and \"\n            \"the encounter begins it may be used as the admission diagnosis. The \"\n            \"indication will typically be a Condition (with other resources \"\n            \"referenced in the evidence.detail), or a Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Procedure\",\n                \"Observation\",\n                \"ImmunizationRecommendation\",\n            ],\n        },\n    )\n\n    requestedPeriod: typing.List[fhirtypes.PeriodType] | None = Field(\n        default=None,\n        alias=\"requestedPeriod\",\n        title=(\n            \"Potential date/time interval(s) requested to allocate the appointment \"\n            \"within\"\n        ),\n        description=(\n            \"A set of date ranges (potentially including times) that the \"\n            \"appointment is preferred to be scheduled within.  The duration \"\n            \"(usually in minutes) could also be provided to indicate the length of \"\n            \"the appointment to fill and populate the start/end times for the \"\n            \"actual allocated time. However, in other situations the duration may \"\n            \"be calculated by the scheduling system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    serviceCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceCategory\",\n        title=(\n            \"A broad categorization of the service that is to be performed during \"\n            \"this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceType\",\n        title=\"The specific service that is to be performed during this appointment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    slot: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"slot\",\n        title=\"The slots that this appointment is filling\",\n        description=(\n            \"The slots from the participants' schedules that will be filled by the \"\n            \"appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Slot\"],\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=(\n            \"The specialty of a practitioner that would be required to perform the \"\n            \"service requested in this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    start: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"When appointment is to take place\",\n        description=\"Date/Time that the appointment is to take place.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"proposed | pending | booked | arrived | fulfilled | cancelled | noshow\"\n            \" | entered-in-error | checked-in | waitlist\"\n        ),\n        description=(\n            \"The overall status of the Appointment. Each of the participants has \"\n            \"their own participation status which indicates their involvement in \"\n            \"the process, however this status indicates the shared status.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposed\",\n                \"pending\",\n                \"booked\",\n                \"arrived\",\n                \"fulfilled\",\n                \"cancelled\",\n                \"noshow\",\n                \"entered-in-error\",\n                \"checked-in\",\n                \"waitlist\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Additional information to support the appointment\",\n        description=(\n            \"Additional information to support the appointment provided when making\"\n            \" the appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Appointment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"cancelationReason\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"appointmentType\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"priority\",\n            \"description\",\n            \"supportingInformation\",\n            \"start\",\n            \"end\",\n            \"minutesDuration\",\n            \"slot\",\n            \"created\",\n            \"comment\",\n            \"patientInstruction\",\n            \"basedOn\",\n            \"participant\",\n            \"requestedPeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Appointment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"cancelationReason\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"appointmentType\",\n            \"reasonCode\",\n            \"start\",\n            \"end\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass AppointmentParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Participants involved in appointment.\n    List of participants involved in the appointment.\n    \"\"\"\n\n    __resource_type__ = \"AppointmentParticipant\"\n\n    actor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Person, Location/HealthcareService or Device\",\n        description=(\n            \"A Person, Location/HealthcareService or Device that is participating \"\n            \"in the appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"HealthcareService\",\n                \"Location\",\n            ],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Participation period of the actor\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    required: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"required\",\n        title=\"required | optional | information-only\",\n        description=(\n            \"Whether this participant is required to be present at the meeting. \"\n            \"This covers a use-case where two doctors need to meet to discuss the \"\n            \"results for a specific patient, and the patient is not required to be \"\n            \"present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"required\", \"optional\", \"information-only\"],\n        },\n    )\n    required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_required\", title=\"Extension field for ``required``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"accepted | declined | tentative | needs-action\",\n        description=\"Participation status of the actor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"accepted\", \"declined\", \"tentative\", \"needs-action\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Role of participant in the appointment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AppointmentParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"actor\",\n            \"required\",\n            \"status\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AppointmentParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"actor\", \"required\", \"status\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/appointmentresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AppointmentResponse\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass AppointmentResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reply to an appointment request for a patient and/or practitioner(s),\n    such as a confirmation or rejection.\n    \"\"\"\n\n    __resource_type__ = \"AppointmentResponse\"\n\n    actor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Person, Location, HealthcareService, or Device\",\n        description=(\n            \"A Person, Location, HealthcareService, or Device that is participating\"\n            \" in the appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"HealthcareService\",\n                \"Location\",\n            ],\n        },\n    )\n\n    appointment: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"appointment\",\n        title=\"Appointment this response relates to\",\n        description=\"Appointment that this response is replying to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Appointment\"],\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Additional comments\",\n        description=\"Additional comments about the appointment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    end: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"Time from appointment, or requested new end time\",\n        description=(\n            \"This may be either the same as the appointment request to confirm the \"\n            \"details of the appointment, or alternately a new time to request a re-\"\n            \"negotiation of the end time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this item\",\n        description=(\n            \"This records identifiers associated with this appointment response \"\n            \"concern that are defined by business processes and/ or used to refer \"\n            \"to it when a direct URL reference to the resource itself is not \"\n            \"appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    participantStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"participantStatus\",\n        title=\"accepted | declined | tentative | needs-action\",\n        description=(\n            \"Participation status of the participant. When the status is declined \"\n            \"or tentative if the start/end times are different to the appointment, \"\n            \"then these times should be interpreted as a requested time change. \"\n            \"When the status is accepted, the times can either be the time of the \"\n            \"appointment (as a confirmation of the time) or can be empty.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"accepted\", \"declined\", \"tentative\", \"needs-action\"],\n        },\n    )\n    participantStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_participantStatus\",\n        title=\"Extension field for ``participantStatus``.\",\n    )\n\n    participantType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"participantType\",\n        title=\"Role of participant in the appointment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    start: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Time from appointment, or requested new start time\",\n        description=(\n            \"Date/Time that the appointment is to take place, or requested new \"\n            \"start time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AppointmentResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"appointment\",\n            \"start\",\n            \"end\",\n            \"participantType\",\n            \"actor\",\n            \"participantStatus\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AppointmentResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"appointment\",\n            \"participantType\",\n            \"actor\",\n            \"participantStatus\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"participantStatus\", \"participantStatus__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/attachment.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Attachment\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Attachment(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Content in a format defined elsewhere.\n    For referring to data content defined in other formats.\n    \"\"\"\n\n    __resource_type__ = \"Attachment\"\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"Mime type of the content, with charset etc.\",\n        description=(\n            \"Identifies the type of the data in the attachment and allows a method \"\n            \"to be chosen to interpret or render the data. Includes mime type \"\n            \"parameters such as charset where appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    creation: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"creation\",\n        title=\"Date attachment was first created\",\n        description=\"The date that the attachment was first created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    creation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_creation\", title=\"Extension field for ``creation``.\"\n    )\n\n    data: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"Data inline, base64ed\",\n        description=(\n            \"The actual data of the attachment - a sequence of bytes, base64 \"\n            \"encoded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_data\", title=\"Extension field for ``data``.\"\n    )\n\n    hash: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"hash\",\n        title=\"Hash of the data (sha-1, base64ed)\",\n        description=\"The calculated hash of the data using SHA-1. Represented using base64.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    hash__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_hash\", title=\"Extension field for ``hash``.\"\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language of the content (BCP-47)\",\n        description=(\n            \"The human language of the content. The value can be any valid value \"\n            \"according to BCP 47.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    size: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"size\",\n        title=\"Number of bytes of content (if url provided)\",\n        description=(\n            \"The number of bytes of data that make up this attachment (before \"\n            \"base64 encoding, if that is done).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    size__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_size\", title=\"Extension field for ``size``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label to display in place of the data\",\n        description=\"A label or set of text to display in place of the data.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Uri where the data can be found\",\n        description=\"A location where the data can be accessed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Attachment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"contentType\",\n            \"language\",\n            \"data\",\n            \"url\",\n            \"size\",\n            \"hash\",\n            \"title\",\n            \"creation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Attachment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"contentType\", \"language\", \"url\", \"size\", \"hash\", \"title\", \"creation\"]\n"
  },
  {
    "path": "fhir/resources/R4B/auditevent.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AuditEvent\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass AuditEvent(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Event record kept for security purposes.\n    A record of an event made for purposes of maintaining a security log.\n    Typical uses include detection of intrusion attempts and monitoring for\n    inappropriate usage.\n    \"\"\"\n\n    __resource_type__ = \"AuditEvent\"\n\n    action: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Type of action performed during the event\",\n        description=(\n            \"Indicator for type of action performed during the event that generated\"\n            \" the audit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    action__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_action\", title=\"Extension field for ``action``.\"\n    )\n\n    agent: typing.List[fhirtypes.AuditEventAgentType] = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Actor involved in the event\",\n        description=(\n            \"An actor taking an active role in the event or activity that is \" \"logged.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entity: typing.List[fhirtypes.AuditEventEntityType] | None = Field(\n        default=None,\n        alias=\"entity\",\n        title=\"Data or objects used\",\n        description=\"Specific instances of data or objects that have been accessed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcome: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"Whether the event succeeded or failed\",\n        description=\"Indicates whether the event succeeded or failed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcome\", title=\"Extension field for ``outcome``.\"\n    )\n\n    outcomeDesc: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"outcomeDesc\",\n        title=\"Description of the event outcome\",\n        description=\"A free text description of the outcome of the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    outcomeDesc__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcomeDesc\", title=\"Extension field for ``outcomeDesc``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When the activity occurred\",\n        description=\"The period during which the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    purposeOfEvent: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"purposeOfEvent\",\n        title=\"The purposeOfUse of the event\",\n        description=(\n            \"The purposeOfUse (reason) that was used during the event being \"\n            \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    recorded: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"recorded\",\n        title=\"Time when the event was recorded\",\n        description=\"The time when the event was recorded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recorded\", title=\"Extension field for ``recorded``.\"\n    )\n\n    source: fhirtypes.AuditEventSourceType = Field(\n        default=...,\n        alias=\"source\",\n        title=\"Audit Event Reporter\",\n        description=\"The system that is reporting the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subtype: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"subtype\",\n        title=\"More specific type/id for the event\",\n        description=\"Identifier for the category of event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type/identifier of event\",\n        description=(\n            \"Identifier for a family of the event.  For example, a menu item, \"\n            \"program, rule, policy, function code, application name or URL. It \"\n            \"identifies the performed function.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"subtype\",\n            \"action\",\n            \"period\",\n            \"recorded\",\n            \"outcome\",\n            \"outcomeDesc\",\n            \"purposeOfEvent\",\n            \"agent\",\n            \"source\",\n            \"entity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"type\",\n            \"subtype\",\n            \"action\",\n            \"recorded\",\n            \"outcome\",\n            \"outcomeDesc\",\n            \"purposeOfEvent\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"recorded\", \"recorded__ext\")]\n        return required_fields\n\n\nclass AuditEventAgent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Actor involved in the event.\n    An actor taking an active role in the event or activity that is logged.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventAgent\"\n\n    altId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"altId\",\n        title=\"Alternative User identity\",\n        description=(\n            \"Alternative agent Identifier. For a human, this should be a user \"\n            \"identifier text string from authentication system. This identifier \"\n            \"would be one known to a common authentication system (e.g. single \"\n            \"sign-on), if available.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    altId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_altId\", title=\"Extension field for ``altId``.\"\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where\",\n        description=\"Where the event occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    media: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"media\",\n        title=\"Type of media\",\n        description=(\n            \"Type of media involved. Used when the event is about \"\n            \"exporting/importing onto media.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human friendly name for the agent\",\n        description=\"Human-meaningful name for the agent.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    network: fhirtypes.AuditEventAgentNetworkType | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"Logical network location for application activity\",\n        description=(\n            \"Logical network location for application activity, if the activity has\"\n            \" a network location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    policy: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"policy\",\n        title=\"Policy that authorized event\",\n        description=(\n            \"The policy or plan that authorized the activity being recorded. \"\n            \"Typically, a single activity may have multiple applicable policies, \"\n            \"such as patient consent, guarantor funding, etc. The policy would also\"\n            \" indicate the security token used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    policy__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_policy\", title=\"Extension field for ``policy``.\"\n    )\n\n    purposeOfUse: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"purposeOfUse\",\n        title=\"Reason given for this user\",\n        description=(\n            \"The reason (purpose of use), specific to this agent, that was used \"\n            \"during the event being recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requestor: bool | None = Field(\n        default=None,\n        alias=\"requestor\",\n        title=\"Whether user is initiator\",\n        description=(\n            \"Indicator that the user is or is not the requestor, or initiator, for \"\n            \"the event being audited.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    requestor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requestor\", title=\"Extension field for ``requestor``.\"\n    )\n\n    role: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Agent role in the event\",\n        description=(\n            \"The security role that the user was acting under, that come from local\"\n            \" codes defined by the access control security system (e.g. RBAC, ABAC)\"\n            \" used in the local context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"How agent participated\",\n        description=(\n            \"Specification of the participation type the user plays when performing\"\n            \" the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    who: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"who\",\n        title=\"Identifier of who\",\n        description=\"Reference to who this agent is that was involved in the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PractitionerRole\",\n                \"Practitioner\",\n                \"Organization\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"role\",\n            \"who\",\n            \"altId\",\n            \"name\",\n            \"requestor\",\n            \"location\",\n            \"policy\",\n            \"media\",\n            \"network\",\n            \"purposeOfUse\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"who\", \"requestor\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"requestor\", \"requestor__ext\")]\n        return required_fields\n\n\nclass AuditEventAgentNetwork(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Logical network location for application activity.\n    Logical network location for application activity, if the activity has a\n    network location.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventAgentNetwork\"\n\n    address: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Identifier for the network access point of the user device\",\n        description=(\n            \"An identifier for the network access point of the user device for the \"\n            \"audit event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_address\", title=\"Extension field for ``address``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of network access point\",\n        description=(\n            \"An identifier for the type of network access point that originated the\"\n            \" audit event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventAgentNetwork`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"address\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventAgentNetwork`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass AuditEventEntity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Data or objects used.\n    Specific instances of data or objects that have been accessed.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventEntity\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Descriptive text\",\n        description=\"Text that describes the entity in more detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    detail: typing.List[fhirtypes.AuditEventEntityDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Additional Information about the entity\",\n        description=(\n            \"Tagged value pairs for conveying additional information about the \"\n            \"entity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lifecycle: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"lifecycle\",\n        title=\"Life-cycle stage for the entity\",\n        description=\"Identifier for the data life-cycle stage for the entity.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Descriptor for entity\",\n        description=\"A name of the entity in the audit event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    query: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"query\",\n        title=\"Query parameters\",\n        description=\"The query parameters for a query-type entities.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    query__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_query\", title=\"Extension field for ``query``.\"\n    )\n\n    role: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"What role the entity played\",\n        description=(\n            \"Code representing the role the entity played in the event being \"\n            \"audited.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Security labels on the entity\",\n        description=\"Security labels for the identified entity.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of entity involved\",\n        description=\"The type of the object that was involved in this audit event.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    what: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"what\",\n        title=\"Specific instance of resource\",\n        description=(\n            \"Identifies a specific instance of the entity. The reference should be \"\n            \"version specific.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"what\",\n            \"type\",\n            \"role\",\n            \"lifecycle\",\n            \"securityLabel\",\n            \"name\",\n            \"description\",\n            \"query\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"what\", \"name\", \"query\"]\n\n\nclass AuditEventEntityDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional Information about the entity.\n    Tagged value pairs for conveying additional information about the entity.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventEntityDetail\"\n\n    type: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Name of the property\",\n        description=\"The type of extra detail provided in the value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventEntityDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueString\",\n            \"valueBase64Binary\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventEntityDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"value\": [\"valueBase64Binary\", \"valueString\"]}\n        return one_of_many_fields\n\n\nclass AuditEventSource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Audit Event Reporter.\n    The system that is reporting the event.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventSource\"\n\n    observer: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"observer\",\n        title=\"The identity of source detecting the event\",\n        description=\"Identifier of the source where the event was detected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PractitionerRole\",\n                \"Practitioner\",\n                \"Organization\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    site: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Logical source location within the enterprise\",\n        description=(\n            \"Logical source location within the healthcare enterprise network.  For\"\n            \" example, a hospital or other provider location within a multi-entity \"\n            \"provider group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    site__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_site\", title=\"Extension field for ``site``.\"\n    )\n\n    type: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of source where event originated\",\n        description=\"Code specifying the type of source where event originated.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"site\", \"observer\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"observer\"]\n"
  },
  {
    "path": "fhir/resources/R4B/backboneelement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BackboneElement\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass BackboneElement(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base for elements defined inside a resource.\n    Base definition for all elements that are defined inside a resource - but\n    not those in a data type.\n    \"\"\"\n\n    __resource_type__ = \"BackboneElement\"\n\n    modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"modifierExtension\",\n        title=\"Extensions that cannot be ignored even if unrecognized\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the element and that modifies the \"\n            \"understanding of the element in which it is contained and/or the \"\n            \"understanding of the containing element's descendants. Usually \"\n            \"modifier elements provide negation or qualification. To make the use \"\n            \"of extensions safe and manageable, there is a strict set of governance\"\n            \" applied to the definition and use of extensions. Though any \"\n            \"implementer can define an extension, there is a set of requirements \"\n            \"that SHALL be met as part of the definition of the extension. \"\n            \"Applications processing a resource are required to check for modifier \"\n            \"extensions.  Modifier extensions SHALL NOT change the meaning of any \"\n            \"elements on Resource or DomainResource (including cannot change the \"\n            \"meaning of modifierExtension itself).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BackboneElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BackboneElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/basic.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Basic\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Basic(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource for non-supported content.\n    Basic is used for handling concepts not yet defined in FHIR, narrative-only\n    resources that don't map to an existing resource, and custom resources not\n    appropriate for inclusion in the FHIR specification.\n    \"\"\"\n\n    __resource_type__ = \"Basic\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who created\",\n        description=\"Indicates who was responsible for creating the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Kind of Resource\",\n        description=(\n            \"Identifies the 'type' of resource - equivalent to the resource name \"\n            \"for other resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    created: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"When created\",\n        description=\"Identifies when the resource was first created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Identifier assigned to the resource for business purposes, outside the\"\n            \" context of FHIR.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Identifies the focus of this resource\",\n        description=(\n            \"Identifies the patient, practitioner, device or any other resource \"\n            'that is the \"focus\" of this resource.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Basic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"subject\",\n            \"created\",\n            \"author\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Basic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"code\",\n            \"subject\",\n            \"created\",\n            \"author\",\n        ]\n"
  },
  {
    "path": "fhir/resources/R4B/binary.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Binary\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import fhirtypes, resource\n\n\nclass Binary(resource.Resource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Pure binary content defined by a format other than FHIR.\n    A resource that represents the data of a single raw artifact as digital\n    content accessible in its native format.  A Binary resource can contain any\n    content, whether text, image, pdf, zip archive, etc.\n    \"\"\"\n\n    __resource_type__ = \"Binary\"\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"MimeType of the binary content\",\n        description=(\n            \"MimeType of the binary content represented as a standard MimeType (BCP\"\n            \" 13).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    data: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"The actual content\",\n        description=\"The actual content, base64 encoded.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_data\", title=\"Extension field for ``data``.\"\n    )\n\n    securityContext: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"securityContext\",\n        title=(\n            \"Identifies another resource to use as proxy when enforcing access \"\n            \"control\"\n        ),\n        description=(\n            \"This element identifies another resource that can be used as a proxy \"\n            \"of the security sensitivity to use when deciding and enforcing access \"\n            \"control rules for the Binary resource. Given that the Binary resource \"\n            \"contains very few elements that can be used to determine the \"\n            \"sensitivity of the data and relationships to individuals, the \"\n            \"referenced resource stands in as a proxy equivalent for this purpose. \"\n            \"This referenced resource may be related to the Binary (e.g. Media, \"\n            \"DocumentReference), or may be some non-related Resource purely as a \"\n            \"security proxy. E.g. to identify that the binary resource relates to a\"\n            \" patient, and access should only be granted to applications that have \"\n            \"access to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Binary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"contentType\",\n            \"securityContext\",\n            \"data\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Binary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"contentType\", \"securityContext\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"contentType\", \"contentType__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/biologicallyderivedproduct.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass BiologicallyDerivedProduct(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A material substance originating from a biological entity.\n    A material substance originating from a biological entity intended to be\n    transplanted or infused\n    into another (possibly the same) biological entity.\n    \"\"\"\n\n    __resource_type__ = \"BiologicallyDerivedProduct\"\n\n    collection: fhirtypes.BiologicallyDerivedProductCollectionType | None = Field(\n        default=None,\n        alias=\"collection\",\n        title=\"How this product was collected\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External ids for this item\",\n        description=(\n            \"This records identifiers associated with this biologically derived \"\n            \"product instance that are defined by business processes and/or used to\"\n            \" refer to it when a direct URL reference to the resource itself is not\"\n            \" appropriate (e.g. in CDA documents, or in written / printed \"\n            \"documentation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    manipulation: fhirtypes.BiologicallyDerivedProductManipulationType | None = Field(\n        default=None,\n        alias=\"manipulation\",\n        title=\"Any manipulation of product post-collection\",\n        description=(\n            \"Any manipulation of product post-collection that is intended to alter \"\n            \"the product.  For example a buffy-coat enrichment or CD8 reduction of \"\n            \"Peripheral Blood Stem Cells to make it more suitable for infusion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    parent: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"BiologicallyDerivedProduct parent\",\n        description=\"Parent product (if any).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BiologicallyDerivedProduct\"],\n        },\n    )\n\n    processing: typing.List[\n        fhirtypes.BiologicallyDerivedProductProcessingType\n    ] | None = Field(\n        default=None,\n        alias=\"processing\",\n        title=\"Any processing of the product during collection\",\n        description=(\n            \"Any processing of the product during collection that does not change \"\n            \"the fundamental nature of the product. For example adding anti-\"\n            \"coagulants during the collection of Peripheral Blood Stem Cells.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productCategory: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"productCategory\",\n        title=\"organ | tissue | fluid | cells | biologicalAgent\",\n        description=\"Broad category of this product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"organ\", \"tissue\", \"fluid\", \"cells\", \"biologicalAgent\"],\n        },\n    )\n    productCategory__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_productCategory\",\n        title=\"Extension field for ``productCategory``.\",\n    )\n\n    productCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productCode\",\n        title=\"What this biologically derived product is\",\n        description=(\n            \"A code that identifies the kind of this biologically derived product \"\n            \"(SNOMED Ctcode).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"The amount of this biologically derived product\",\n        description=\"Number of discrete units within this product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_quantity\", title=\"Extension field for ``quantity``.\"\n    )\n\n    request: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Procedure request\",\n        description=\"Procedure request to obtain this biologically derived product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"available | unavailable\",\n        description=\"Whether the product is currently available.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"available\", \"unavailable\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    storage: typing.List[\n        fhirtypes.BiologicallyDerivedProductStorageType\n    ] | None = Field(\n        default=None,\n        alias=\"storage\",\n        title=\"Product storage\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BiologicallyDerivedProduct`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"productCategory\",\n            \"productCode\",\n            \"status\",\n            \"request\",\n            \"quantity\",\n            \"parent\",\n            \"collection\",\n            \"processing\",\n            \"manipulation\",\n            \"storage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProduct`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"identifier\"]\n\n\nclass BiologicallyDerivedProductCollection(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    How this product was collected.\n    \"\"\"\n\n    __resource_type__ = \"BiologicallyDerivedProductCollection\"\n\n    collectedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"collectedDateTime\",\n        title=\"Time of product collection\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e collected[x]\n            \"one_of_many\": \"collected\",\n            \"one_of_many_required\": False,\n        },\n    )\n    collectedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_collectedDateTime\",\n        title=\"Extension field for ``collectedDateTime``.\",\n    )\n\n    collectedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"collectedPeriod\",\n        title=\"Time of product collection\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e collected[x]\n            \"one_of_many\": \"collected\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    collector: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"collector\",\n        title=\"Individual performing collection\",\n        description=\"Healthcare professional who is performing the collection.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Who is product from\",\n        description=(\n            \"The patient or entity, such as a hospital or vendor in the case of a \"\n            \"processed/manipulated/manufactured product, providing the product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BiologicallyDerivedProductCollection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"collector\",\n            \"source\",\n            \"collectedDateTime\",\n            \"collectedPeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductCollection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"collected\": [\"collectedDateTime\", \"collectedPeriod\"]}\n        return one_of_many_fields\n\n\nclass BiologicallyDerivedProductManipulation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Any manipulation of product post-collection.\n    Any manipulation of product post-collection that is intended to alter the\n    product.  For example a buffy-coat enrichment or CD8 reduction of\n    Peripheral Blood Stem Cells to make it more suitable for infusion.\n    \"\"\"\n\n    __resource_type__ = \"BiologicallyDerivedProductManipulation\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of manipulation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    timeDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timeDateTime\",\n        title=\"Time of manipulation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e time[x]\n            \"one_of_many\": \"time\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timeDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timeDateTime\",\n        title=\"Extension field for ``timeDateTime``.\",\n    )\n\n    timePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timePeriod\",\n        title=\"Time of manipulation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e time[x]\n            \"one_of_many\": \"time\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BiologicallyDerivedProductManipulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"timeDateTime\",\n            \"timePeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductManipulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"time\": [\"timeDateTime\", \"timePeriod\"]}\n        return one_of_many_fields\n\n\nclass BiologicallyDerivedProductProcessing(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Any processing of the product during collection.\n    Any processing of the product during collection that does not change the\n    fundamental nature of the product. For example adding anti-coagulants\n    during the collection of Peripheral Blood Stem Cells.\n    \"\"\"\n\n    __resource_type__ = \"BiologicallyDerivedProductProcessing\"\n\n    additive: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"additive\",\n        title=\"Substance added during processing\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of of processing\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    procedure: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"Procesing code\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timeDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timeDateTime\",\n        title=\"Time of processing\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e time[x]\n            \"one_of_many\": \"time\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timeDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timeDateTime\",\n        title=\"Extension field for ``timeDateTime``.\",\n    )\n\n    timePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timePeriod\",\n        title=\"Time of processing\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e time[x]\n            \"one_of_many\": \"time\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BiologicallyDerivedProductProcessing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"procedure\",\n            \"additive\",\n            \"timeDateTime\",\n            \"timePeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductProcessing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"time\": [\"timeDateTime\", \"timePeriod\"]}\n        return one_of_many_fields\n\n\nclass BiologicallyDerivedProductStorage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Product storage.\n    \"\"\"\n\n    __resource_type__ = \"BiologicallyDerivedProductStorage\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of storage\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    duration: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"Storage timeperiod\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    scale: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"scale\",\n        title=\"farenheit | celsius | kelvin\",\n        description=\"Temperature scale used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"farenheit\", \"celsius\", \"kelvin\"],\n        },\n    )\n    scale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_scale\", title=\"Extension field for ``scale``.\"\n    )\n\n    temperature: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"temperature\",\n        title=\"Storage temperature\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    temperature__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_temperature\", title=\"Extension field for ``temperature``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BiologicallyDerivedProductStorage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"temperature\",\n            \"scale\",\n            \"duration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductStorage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/bodystructure.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BodyStructure\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass BodyStructure(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specific and identified anatomical structure.\n    Record details about an anatomical structure.  This resource may be used\n    when a coded concept does not provide the necessary detail needed for the\n    use case.\n    \"\"\"\n\n    __resource_type__ = \"BodyStructure\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this record is in active use\",\n        description=\"Whether this body site is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Text description\",\n        description=\"A summary, characterization or explanation of the body structure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Bodystructure identifier\",\n        description=\"Identifier for this instance of the anatomical structure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    image: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"image\",\n        title=\"Attached images\",\n        description=\"Image or images used to identify a location.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Body site\",\n        description=(\n            \"The anatomical location or region of the specimen, lesion, or body \"\n            \"structure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    locationQualifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"locationQualifier\",\n        title=\"Body site modifier\",\n        description=(\n            \"Qualifier to refine the anatomical location.  These include qualifiers\"\n            \" for laterality, relative location, directionality, number, and plane.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    morphology: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"morphology\",\n        title=\"Kind of Structure\",\n        description=(\n            \"The kind of structure being represented by the body structure at \"\n            \"`BodyStructure.location`.  This can define both normal and abnormal \"\n            \"morphologies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who this is about\",\n        description=\"The person to which the body site belongs.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BodyStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"morphology\",\n            \"location\",\n            \"locationQualifier\",\n            \"description\",\n            \"image\",\n            \"patient\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BodyStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"morphology\",\n            \"location\",\n            \"description\",\n            \"patient\",\n        ]\n"
  },
  {
    "path": "fhir/resources/R4B/bundle.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Bundle\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, fhirtypes, resource\n\n\nclass Bundle(resource.Resource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contains a collection of resources.\n    A container for a collection of resources.\n    \"\"\"\n\n    __resource_type__ = \"Bundle\"\n\n    entry: typing.List[fhirtypes.BundleEntryType] | None = Field(\n        default=None,\n        alias=\"entry\",\n        title=\"Entry in the bundle - will have a resource or information\",\n        description=(\n            \"An entry in a bundle resource - will either contain a resource or \"\n            \"information about a resource (transactions and history only).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Persistent identifier for the bundle\",\n        description=(\n            \"A persistent identifier for the bundle that won't change as a bundle \"\n            \"is copied from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.BundleLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links related to this Bundle\",\n        description=\"A series of links that provide context to this bundle.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    signature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"signature\",\n        title=\"Digital Signature\",\n        description=\"Digital Signature - base64 encoded. XML-DSig or a JWT.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    timestamp: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"timestamp\",\n        title=\"When the bundle was assembled\",\n        description=(\n            \"The date/time that the bundle was assembled - i.e. when the resources \"\n            \"were placed in the bundle.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timestamp\", title=\"Extension field for ``timestamp``.\"\n    )\n\n    total: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"If search, the total number of matches\",\n        description=(\n            \"If a set of search matches, this is the total number of entries of \"\n            \"type 'match' across all pages in the search.  It does not include \"\n            \"search.mode = 'include' or 'outcome' entries and it does not provide a\"\n            \" count of the number of entries in the Bundle.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    total__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_total\", title=\"Extension field for ``total``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"document | message | transaction | transaction-response | batch | \"\n            \"batch-response | history | searchset | collection\"\n        ),\n        description=\"Indicates the purpose of this bundle - how it is intended to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"document\",\n                \"message\",\n                \"transaction\",\n                \"transaction-response\",\n                \"batch\",\n                \"batch-response\",\n                \"history\",\n                \"searchset\",\n                \"collection\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Bundle`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"identifier\",\n            \"type\",\n            \"timestamp\",\n            \"total\",\n            \"link\",\n            \"entry\",\n            \"signature\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Bundle`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"type\",\n            \"timestamp\",\n            \"total\",\n            \"link\",\n            \"entry\",\n            \"signature\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass BundleEntry(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Entry in the bundle - will have a resource or information.\n    An entry in a bundle resource - will either contain a resource or\n    information about a resource (transactions and history only).\n    \"\"\"\n\n    __resource_type__ = \"BundleEntry\"\n\n    fullUrl: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"fullUrl\",\n        title=\"URI for resource (Absolute URL server address or URI for UUID/OID)\",\n        description=(\n            \"The Absolute URL for the resource.  The fullUrl SHALL NOT disagree \"\n            \"with the id in the resource - i.e. if the fullUrl is not a urn:uuid, \"\n            \"the URL shall be version-independent URL consistent with the \"\n            \"Resource.id. The fullUrl is a version independent reference to the \"\n            \"resource. The fullUrl element SHALL have a value except that:  * \"\n            \"fullUrl can be empty on a POST (although it does not need to when \"\n            \"specifying a temporary id for reference in the bundle) * Results from \"\n            \"operations might involve resources that are not identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fullUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fullUrl\", title=\"Extension field for ``fullUrl``.\"\n    )\n\n    link: typing.List[fhirtypes.BundleLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links related to this entry\",\n        description=\"A series of links that provide context to this entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    request: fhirtypes.BundleEntryRequestType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Additional execution information (transaction/batch/history)\",\n        description=(\n            \"Additional information about how this entry should be processed as \"\n            \"part of a transaction or batch.  For history, it shows how the entry \"\n            \"was processed to create the version contained in the entry.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.ResourceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"A resource in the bundle\",\n        description=(\n            \"The Resource for the entry. The purpose/meaning of the resource is \"\n            \"determined by the Bundle.type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    response: fhirtypes.BundleEntryResponseType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"Results of execution (transaction/batch/history)\",\n        description=(\n            \"Indicates the results of processing the corresponding 'request' entry \"\n            \"in the batch or transaction being responded to or what the results of \"\n            \"an operation where when returning history.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    search: fhirtypes.BundleEntrySearchType | None = Field(\n        default=None,\n        alias=\"search\",\n        title=\"Search related information\",\n        description=(\n            \"Information about the search process that lead to the creation of this\"\n            \" entry.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"link\",\n            \"fullUrl\",\n            \"resource\",\n            \"search\",\n            \"request\",\n            \"response\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"link\",\n            \"fullUrl\",\n            \"resource\",\n            \"search\",\n            \"request\",\n            \"response\",\n        ]\n\n\nclass BundleEntryRequest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional execution information (transaction/batch/history).\n    Additional information about how this entry should be processed as part of\n    a transaction or batch.  For history, it shows how the entry was processed\n    to create the version contained in the entry.\n    \"\"\"\n\n    __resource_type__ = \"BundleEntryRequest\"\n\n    ifMatch: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"ifMatch\",\n        title=\"For managing update contention\",\n        description=(\n            \"Only perform the operation if the Etag value matches. For more \"\n            'information, see the API section [\"Managing Resource '\n            'Contention\"](http.html#concurrency).'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ifMatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ifMatch\", title=\"Extension field for ``ifMatch``.\"\n    )\n\n    ifModifiedSince: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"ifModifiedSince\",\n        title=\"For managing cache currency\",\n        description=(\n            \"Only perform the operation if the last updated date matches. See the \"\n            'API documentation for [\"Conditional Read\"](http.html#cread).'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ifModifiedSince__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_ifModifiedSince\",\n        title=\"Extension field for ``ifModifiedSince``.\",\n    )\n\n    ifNoneExist: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"ifNoneExist\",\n        title=\"For conditional creates\",\n        description=(\n            \"Instruct the server not to perform the create if a specified resource \"\n            \"already exists. For further information, see the API documentation for\"\n            ' [\"Conditional Create\"](http.html#ccreate). This is just the query '\n            'portion of the URL - what follows the \"?\" (not including the \"?\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ifNoneExist__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ifNoneExist\", title=\"Extension field for ``ifNoneExist``.\"\n    )\n\n    ifNoneMatch: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"ifNoneMatch\",\n        title=\"For managing cache currency\",\n        description=(\n            \"If the ETag values match, return a 304 Not Modified status. See the \"\n            'API documentation for [\"Conditional Read\"](http.html#cread).'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ifNoneMatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ifNoneMatch\", title=\"Extension field for ``ifNoneMatch``.\"\n    )\n\n    method: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"GET | HEAD | POST | PUT | DELETE | PATCH\",\n        description=(\n            \"In a transaction or batch, this is the HTTP action to be executed for \"\n            \"this entry. In a history bundle, this indicates the HTTP action that \"\n            \"occurred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"GET\", \"HEAD\", \"POST\", \"PUT\", \"DELETE\", \"PATCH\"],\n        },\n    )\n    method__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_method\", title=\"Extension field for ``method``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"URL for HTTP equivalent of this entry\",\n        description=(\n            \"The URL for this entry, relative to the root (the address to which the\"\n            \" request is posted).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleEntryRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"method\",\n            \"url\",\n            \"ifNoneMatch\",\n            \"ifModifiedSince\",\n            \"ifMatch\",\n            \"ifNoneExist\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleEntryRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"method\",\n            \"url\",\n            \"ifNoneMatch\",\n            \"ifModifiedSince\",\n            \"ifMatch\",\n            \"ifNoneExist\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"method\", \"method__ext\"), (\"url\", \"url__ext\")]\n        return required_fields\n\n\nclass BundleEntryResponse(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Results of execution (transaction/batch/history).\n    Indicates the results of processing the corresponding 'request' entry in\n    the batch or transaction being responded to or what the results of an\n    operation where when returning history.\n    \"\"\"\n\n    __resource_type__ = \"BundleEntryResponse\"\n\n    etag: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"etag\",\n        title=\"The Etag for the resource (if relevant)\",\n        description=(\n            \"The Etag for the resource, if the operation for the entry produced a \"\n            \"versioned resource (see [Resource Metadata and \"\n            \"Versioning](http.html#versioning) and [Managing Resource \"\n            \"Contention](http.html#concurrency)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    etag__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_etag\", title=\"Extension field for ``etag``.\"\n    )\n\n    lastModified: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"lastModified\",\n        title=\"Server's date time modified\",\n        description=\"The date/time that the resource was modified on the server.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastModified\",\n        title=\"Extension field for ``lastModified``.\",\n    )\n\n    location: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"The location (if the operation returns a location)\",\n        description=(\n            \"The location header created by processing this operation, populated if\"\n            \" the operation returns a location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    location__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_location\", title=\"Extension field for ``location``.\"\n    )\n\n    outcome: fhirtypes.ResourceType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"OperationOutcome with hints and warnings (for batch/transaction)\",\n        description=(\n            \"An OperationOutcome containing hints and warnings produced as part of \"\n            \"processing this entry in a batch or transaction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"Status response code (text optional)\",\n        description=(\n            \"The status code returned by processing this entry. The status SHALL \"\n            \"start with a 3 digit HTTP code (e.g. 404) and may contain the standard\"\n            \" HTTP description associated with the status code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleEntryResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"status\",\n            \"location\",\n            \"etag\",\n            \"lastModified\",\n            \"outcome\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleEntryResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"status\",\n            \"location\",\n            \"etag\",\n            \"lastModified\",\n            \"outcome\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass BundleEntrySearch(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Search related information.\n    Information about the search process that lead to the creation of this\n    entry.\n    \"\"\"\n\n    __resource_type__ = \"BundleEntrySearch\"\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"match | include | outcome - why this is in the result set\",\n        description=(\n            \"Why this entry is in the result set - whether it's included as a match\"\n            \" or because of an _include requirement, or to convey information or \"\n            \"warning information about the search process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"match\", \"include\", \"outcome\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    score: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"score\",\n        title=\"Search ranking (between 0 and 1)\",\n        description=\"When searching, the server's search ranking score for the entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    score__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_score\", title=\"Extension field for ``score``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleEntrySearch`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"mode\", \"score\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleEntrySearch`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\", \"score\"]\n\n\nclass BundleLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links related to this Bundle.\n    A series of links that provide context to this bundle.\n    \"\"\"\n\n    __resource_type__ = \"BundleLink\"\n\n    relation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"relation\",\n        title=(\n            \"See http://www.iana.org/assignments/link-relations/link-\"\n            \"relations.xhtml#link-relations-1\"\n        ),\n        description=(\n            \"A name which details the functional use for this link - see \"\n            \"[http://www.iana.org/assignments/link-relations/link-\"\n            \"relations.xhtml#link-\"\n            \"relations-1](http://www.iana.org/assignments/link-relations/link-\"\n            \"relations.xhtml#link-relations-1).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    relation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_relation\", title=\"Extension field for ``relation``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Reference details for the link\",\n        description=\"The reference details for the link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"relation\", \"url\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"relation\", \"url\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"relation\", \"relation__ext\"), (\"url\", \"url__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/capabilitystatement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CapabilityStatement(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A statement of system capabilities.\n    A Capability Statement documents a set of capabilities (behaviors) of a\n    FHIR Server for a particular version of FHIR that may be used as a\n    statement of actual server functionality or a statement of required or\n    desired server implementation.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatement\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the capability statement and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the capability statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the capability statement was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the capability statement \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the capability statement\",\n        description=(\n            \"A free text natural language description of the capability statement \"\n            \"from a consumer's perspective. Typically, this is used when the \"\n            \"capability statement describes a desired rather than an actual \"\n            \"solution, for example as a formal expression of requirements as part \"\n            \"of an RFP.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    document: typing.List[fhirtypes.CapabilityStatementDocumentType] | None = Field(\n        default=None,\n        alias=\"document\",\n        title=\"Document definition\",\n        description=\"A document definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this capability statement is authored\"\n            \" for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fhirVersion: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"fhirVersion\",\n        title=\"FHIR Version the system supports\",\n        description=(\n            \"The version of the FHIR specification that this CapabilityStatement \"\n            \"describes (which SHALL be the same as the FHIR version of the \"\n            \"CapabilityStatement itself). There is no default value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fhirVersion\", title=\"Extension field for ``fhirVersion``.\"\n    )\n\n    format: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"format\",\n        title=\"formats supported (xml | json | ttl | mime type)\",\n        description=(\n            \"A list of the formats supported by this implementation using their \"\n            \"content types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"formats\", \"json\", \"ttl\", \"mime\"],\n        },\n    )\n    format__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_format\", title=\"Extension field for ``format``.\"\n    )\n\n    implementation: fhirtypes.CapabilityStatementImplementationType | None = Field(\n        default=None,\n        alias=\"implementation\",\n        title=\"If this describes a specific instance\",\n        description=(\n            \"Identifies a specific implementation instance that is described by the\"\n            \" capability statement - i.e. a particular installation, rather than \"\n            \"the capabilities of a software program.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    implementationGuide: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"implementationGuide\",\n        title=\"Implementation guides supported\",\n        description=(\n            \"A list of implementation guides that the server does (or should) \"\n            \"support in their entirety.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ImplementationGuide\"],\n        },\n    )\n    implementationGuide__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_implementationGuide\",\n        title=\"Extension field for ``implementationGuide``.\",\n    )\n\n    imports: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"imports\",\n        title=\"Canonical URL of another capability statement this adds to\",\n        description=(\n            \"Reference to a canonical URL of another CapabilityStatement that this \"\n            \"software adds to. The capability statement automatically includes \"\n            \"everything in the other statement, and it is not duplicated, though \"\n            \"the server may repeat the same resources, interactions and operations \"\n            \"to add additional details to them.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n    imports__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_imports\", title=\"Extension field for ``imports``.\"\n    )\n\n    instantiates: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiates\",\n        title=\"Canonical URL of another capability statement this implements\",\n        description=(\n            \"Reference to a canonical URL of another CapabilityStatement that this \"\n            \"software implements. This capability statement is a published API \"\n            \"description that corresponds to a business service. The server may \"\n            \"actually implement a subset of the capability statement it claims to \"\n            \"implement, so the capability statement must specify the full \"\n            \"capability details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n    instantiates__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiates\",\n        title=\"Extension field for ``instantiates``.\",\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for capability statement (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the capability statement is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"instance | capability | requirements\",\n        description=(\n            \"The way that this statement is intended to be used, to describe an \"\n            \"actual running instance of software, a particular product (kind, not \"\n            \"instance of software) or a class of implementation (e.g. a desired \"\n            \"purchase).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"capability\", \"requirements\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    messaging: typing.List[fhirtypes.CapabilityStatementMessagingType] | None = Field(\n        default=None,\n        alias=\"messaging\",\n        title=\"If messaging is supported\",\n        description=\"A description of the messaging capabilities of the solution.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this capability statement (computer friendly)\",\n        description=(\n            \"A natural language name identifying the capability statement. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    patchFormat: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"patchFormat\",\n        title=\"Patch formats supported\",\n        description=(\n            \"A list of the patch formats supported by this implementation using \"\n            \"their content types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    patchFormat__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_patchFormat\", title=\"Extension field for ``patchFormat``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the \"\n            \"capability statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this capability statement is defined\",\n        description=(\n            \"Explanation of why this capability statement is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    rest: typing.List[fhirtypes.CapabilityStatementRestType] | None = Field(\n        default=None,\n        alias=\"rest\",\n        title=\"If the endpoint is a RESTful one\",\n        description=\"A definition of the restful capabilities of the solution, if any.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    software: fhirtypes.CapabilityStatementSoftwareType | None = Field(\n        default=None,\n        alias=\"software\",\n        title=\"Software that is covered by this capability statement\",\n        description=(\n            \"Software that is covered by this capability statement.  It is used \"\n            \"when the capability statement describes the capabilities of a \"\n            \"particular software version, independent of an installation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this capability statement. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this capability statement (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the capability \" \"statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this capability statement, represented as a \"\n            \"URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this capability statement \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which at which an \"\n            \"authoritative instance of this capability statement is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the capability statement is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate capability statement instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the capability statement\",\n        description=(\n            \"The identifier that is used to identify this version of the capability\"\n            \" statement when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the capability \"\n            \"statement author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"kind\",\n            \"instantiates\",\n            \"imports\",\n            \"software\",\n            \"implementation\",\n            \"fhirVersion\",\n            \"format\",\n            \"patchFormat\",\n            \"implementationGuide\",\n            \"rest\",\n            \"messaging\",\n            \"document\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"kind\",\n            \"instantiates\",\n            \"imports\",\n            \"software\",\n            \"implementation\",\n            \"fhirVersion\",\n            \"format\",\n            \"patchFormat\",\n            \"implementationGuide\",\n            \"rest\",\n            \"messaging\",\n            \"document\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"date\", \"date__ext\"),\n            (\"fhirVersion\", \"fhirVersion__ext\"),\n            (\"format\", \"format__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass CapabilityStatementDocument(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Document definition.\n    A document definition.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementDocument\"\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Description of document support\",\n        description=(\n            \"A description of how the application supports or uses the specified \"\n            \"document profile.  For example, when documents are created, what \"\n            \"action is taken with consumed documents, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"producer | consumer\",\n        description=(\n            \"Mode of this document declaration - whether an application is a \"\n            \"producer or consumer.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"producer\", \"consumer\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Constraint on the resources used in the document\",\n        description=(\n            \"A profile on the document Bundle that constrains which resources are \"\n            \"present, and their contents.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementDocument`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"mode\",\n            \"documentation\",\n            \"profile\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementDocument`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\", \"profile\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\"), (\"profile\", \"profile__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementImplementation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If this describes a specific instance.\n    Identifies a specific implementation instance that is described by the\n    capability statement - i.e. a particular installation, rather than the\n    capabilities of a software program.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementImplementation\"\n\n    custodian: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"custodian\",\n        title=\"Organization that manages the data\",\n        description=(\n            \"The organization responsible for the management of the instance and \"\n            \"oversight of the data on the server at the specified URL.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Describes this specific instance\",\n        description=(\n            \"Information about the specific installation that this capability \"\n            \"statement relates to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    url: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Base URL for the installation\",\n        description=(\n            \"An absolute base URL for the implementation.  This forms the base for \"\n            \"REST interfaces as well as the mailbox and document interfaces.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementImplementation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"url\",\n            \"custodian\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementImplementation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"description\", \"url\", \"custodian\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"description\", \"description__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementMessaging(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If messaging is supported.\n    A description of the messaging capabilities of the solution.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementMessaging\"\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Messaging interface behavior details\",\n        description=(\n            \"Documentation about the system's messaging capabilities for this \"\n            \"endpoint not otherwise documented by the capability statement.  For \"\n            \"example, the process for becoming an authorized messaging exchange \"\n            \"partner.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    endpoint: typing.List[\n        fhirtypes.CapabilityStatementMessagingEndpointType\n    ] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Where messages should be sent\",\n        description=(\n            \"An endpoint (network accessible address) to which messages and/or \"\n            \"replies are to be sent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reliableCache: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"reliableCache\",\n        title=\"Reliable Message Cache Length (min)\",\n        description=(\n            \"Length if the receiver's reliable messaging cache in minutes (if a \"\n            \"receiver) or how long the cache length on the receiver should be (if a\"\n            \" sender).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reliableCache__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_reliableCache\",\n        title=\"Extension field for ``reliableCache``.\",\n    )\n\n    supportedMessage: typing.List[\n        fhirtypes.CapabilityStatementMessagingSupportedMessageType\n    ] | None = Field(\n        default=None,\n        alias=\"supportedMessage\",\n        title=\"Messages supported by this system\",\n        description=(\n            \"References to message definitions for messages this system can send or\"\n            \" receive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementMessaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"endpoint\",\n            \"reliableCache\",\n            \"documentation\",\n            \"supportedMessage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"supportedMessage\"]\n\n\nclass CapabilityStatementMessagingEndpoint(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Where messages should be sent.\n    An endpoint (network accessible address) to which messages and/or replies\n    are to be sent.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementMessagingEndpoint\"\n\n    address: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Network address or identifier of the end-point\",\n        description=(\n            \"The network address of the endpoint. For solutions that do not use \"\n            \"network addresses for routing, it can be just an identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_address\", title=\"Extension field for ``address``.\"\n    )\n\n    protocol: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"protocol\",\n        title=\"http | ftp | mllp +\",\n        description=(\n            \"A list of the messaging transport protocol(s) identifiers, supported \"\n            \"by this endpoint.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementMessagingEndpoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"protocol\", \"address\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingEndpoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"address\", \"address__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementMessagingSupportedMessage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Messages supported by this system.\n    References to message definitions for messages this system can send or\n    receive.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementMessagingSupportedMessage\"\n\n    definition: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Message supported by this system\",\n        description=(\n            \"Points to a message definition that identifies the messaging event, \"\n            \"message structure, allowed responses, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"sender | receiver\",\n        description=(\n            \"The mode of this event declaration - whether application is sender or \"\n            \"receiver.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"sender\", \"receiver\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementMessagingSupportedMessage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"mode\", \"definition\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingSupportedMessage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\", \"definition\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"definition\", \"definition__ext\"), (\"mode\", \"mode__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If the endpoint is a RESTful one.\n    A definition of the restful capabilities of the solution, if any.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRest\"\n\n    compartment: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"compartment\",\n        title=\"Compartments served/used by system\",\n        description=(\n            \"An absolute URI which is a reference to the definition of a \"\n            \"compartment that the system supports. The reference is to a \"\n            \"CompartmentDefinition resource by its canonical URL .\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CompartmentDefinition\"],\n        },\n    )\n    compartment__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_compartment\", title=\"Extension field for ``compartment``.\"\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"General description of implementation\",\n        description=(\n            \"Information about the system's restful capabilities that apply across \"\n            \"all applications, such as security.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    interaction: typing.List[\n        fhirtypes.CapabilityStatementRestInteractionType\n    ] | None = Field(\n        default=None,\n        alias=\"interaction\",\n        title=\"What operations are supported?\",\n        description=\"A specification of restful operations supported by the system.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"client | server\",\n        description=(\n            \"Identifies whether this portion of the statement is describing the \"\n            \"ability to initiate or receive restful operations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"client\", \"server\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    operation: typing.List[\n        fhirtypes.CapabilityStatementRestResourceOperationType\n    ] | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"Definition of a system level operation\",\n        description=(\n            \"Definition of an operation or a named query together with its \"\n            \"parameters and their meaning and type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: typing.List[fhirtypes.CapabilityStatementRestResourceType] | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Resource served on the REST interface\",\n        description=(\n            \"A specification of the restful capabilities of the solution for a \"\n            \"specific resource type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    searchParam: typing.List[\n        fhirtypes.CapabilityStatementRestResourceSearchParamType\n    ] | None = Field(\n        default=None,\n        alias=\"searchParam\",\n        title=\"Search parameters for searching all resources\",\n        description=(\n            \"Search parameters that are supported for searching all resources for \"\n            \"implementations to support and/or make use of - either references to \"\n            \"ones defined in the specification, or additional ones defined for/by \"\n            \"the implementation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    security: fhirtypes.CapabilityStatementRestSecurityType | None = Field(\n        default=None,\n        alias=\"security\",\n        title=\"Information about security of implementation\",\n        description=(\n            \"Information about security implementation from an interface \"\n            \"perspective - what a client needs to know.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"mode\",\n            \"documentation\",\n            \"security\",\n            \"resource\",\n            \"interaction\",\n            \"searchParam\",\n            \"operation\",\n            \"compartment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\", \"security\", \"resource\", \"operation\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestInteraction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What operations are supported?.\n    A specification of restful operations supported by the system.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestInteraction\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"transaction | batch | search-system | history-system\",\n        description=\"A coded identifier of the operation, supported by the system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"transaction\", \"batch\", \"search-system\", \"history-system\"],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Anything special about operation behavior\",\n        description=(\n            \"Guidance specific to the implementation of this operation, such as \"\n            \"limitations on the kind of transactions allowed, or information about \"\n            \"system wide search is implemented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"documentation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestResource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource served on the REST interface.\n    A specification of the restful capabilities of the solution for a specific\n    resource type.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestResource\"\n\n    conditionalCreate: bool | None = Field(\n        default=None,\n        alias=\"conditionalCreate\",\n        title=\"If allows/uses conditional create\",\n        description=\"A flag that indicates that the server supports conditional create.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    conditionalCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalCreate\",\n        title=\"Extension field for ``conditionalCreate``.\",\n    )\n\n    conditionalDelete: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"conditionalDelete\",\n        title=(\n            \"not-supported | single | multiple - how conditional delete is \" \"supported\"\n        ),\n        description=\"A code that indicates how the server supports conditional delete.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"not-supported\", \"single\", \"multiple\"],\n        },\n    )\n    conditionalDelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalDelete\",\n        title=\"Extension field for ``conditionalDelete``.\",\n    )\n\n    conditionalRead: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"conditionalRead\",\n        title=\"not-supported | modified-since | not-match | full-support\",\n        description=\"A code that indicates how the server supports conditional read.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"not-supported\",\n                \"modified-since\",\n                \"not-match\",\n                \"full-support\",\n            ],\n        },\n    )\n    conditionalRead__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalRead\",\n        title=\"Extension field for ``conditionalRead``.\",\n    )\n\n    conditionalUpdate: bool | None = Field(\n        default=None,\n        alias=\"conditionalUpdate\",\n        title=\"If allows/uses conditional update\",\n        description=\"A flag that indicates that the server supports conditional update.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    conditionalUpdate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalUpdate\",\n        title=\"Extension field for ``conditionalUpdate``.\",\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Additional information about the use of the resource type\",\n        description=\"Additional information about the resource type used by the system.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    interaction: typing.List[\n        fhirtypes.CapabilityStatementRestResourceInteractionType\n    ] | None = Field(\n        default=None,\n        alias=\"interaction\",\n        title=\"What operations are supported?\",\n        description=\"Identifies a restful operation supported by the solution.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: typing.List[\n        fhirtypes.CapabilityStatementRestResourceOperationType\n    ] | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"Definition of a resource operation\",\n        description=(\n            \"Definition of an operation or a named query together with its \"\n            \"parameters and their meaning and type. Consult the definition of the \"\n            \"operation for details about how to invoke the operation, and the \"\n            \"parameters.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Base System profile for all uses of resource\",\n        description=(\n            \"A specification of the profile that describes the solution's overall \"\n            \"support for the resource, including any constraints on cardinality, \"\n            \"bindings, lengths or other limitations. See further discussion in \"\n            \"[Using Profiles](profiling.html#profile-uses).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    readHistory: bool | None = Field(\n        default=None,\n        alias=\"readHistory\",\n        title=\"Whether vRead can return past versions\",\n        description=(\n            \"A flag for whether the server is able to return past versions as part \"\n            \"of the vRead operation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    readHistory__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_readHistory\", title=\"Extension field for ``readHistory``.\"\n    )\n\n    referencePolicy: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"referencePolicy\",\n        title=\"literal | logical | resolves | enforced | local\",\n        description=\"A set of flags that defines how references are supported.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"literal\", \"logical\", \"resolves\", \"enforced\", \"local\"],\n        },\n    )\n    referencePolicy__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_referencePolicy\",\n        title=\"Extension field for ``referencePolicy``.\",\n    )\n\n    searchInclude: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"searchInclude\",\n        title=\"_include values supported by the server\",\n        description=\"A list of _include values supported by the server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    searchInclude__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_searchInclude\",\n        title=\"Extension field for ``searchInclude``.\",\n    )\n\n    searchParam: typing.List[\n        fhirtypes.CapabilityStatementRestResourceSearchParamType\n    ] | None = Field(\n        default=None,\n        alias=\"searchParam\",\n        title=\"Search parameters supported by implementation\",\n        description=(\n            \"Search parameters for implementations to support and/or make use of - \"\n            \"either references to ones defined in the specification, or additional \"\n            \"ones defined for/by the implementation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    searchRevInclude: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"searchRevInclude\",\n        title=\"_revinclude values supported by the server\",\n        description=(\n            \"A list of _revinclude (reverse include) values supported by the \" \"server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    searchRevInclude__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_searchRevInclude\",\n        title=\"Extension field for ``searchRevInclude``.\",\n    )\n\n    supportedProfile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"supportedProfile\",\n        title=\"Profiles for use cases supported\",\n        description=(\n            \"A list of profiles that represent different use cases supported by the\"\n            ' system. For a server, \"supported by the system\" means the system '\n            \"hosts/produces a set of resources that are conformant to a particular \"\n            \"profile, and allows clients that use its services to search using this\"\n            \" profile and to find appropriate data. For a client, it means the \"\n            \"system will search by this profile and process data according to the \"\n            \"guidance implicit in the profile. See further discussion in [Using \"\n            \"Profiles](profiling.html#profile-uses).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    supportedProfile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_supportedProfile\",\n        title=\"Extension field for ``supportedProfile``.\",\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"A resource type that is supported\",\n        description=\"A type of resource exposed via the restful interface.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    updateCreate: bool | None = Field(\n        default=None,\n        alias=\"updateCreate\",\n        title=\"If update can commit to a new identity\",\n        description=(\n            \"A flag to indicate that the server allows or needs to allow the client\"\n            \" to create new identities on the server (that is, the client PUTs to a\"\n            \" location where there is no existing resource). Allowing this \"\n            \"operation means that the server allows the client to create new \"\n            \"identities on the server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    updateCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_updateCreate\",\n        title=\"Extension field for ``updateCreate``.\",\n    )\n\n    versioning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"versioning\",\n        title=\"no-version | versioned | versioned-update\",\n        description=(\n            \"This field is set to no-version to specify that the system does not \"\n            \"support (server) or use (client) versioning for this resource type. If\"\n            \" this has some other value, the server must at least correctly track \"\n            \"and populate the versionId meta-property on resources. If the value is\"\n            \" 'versioned-update', then the server supports all the versioning \"\n            \"features, including using e-tags for version integrity in the API.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"no-version\", \"versioned\", \"versioned-update\"],\n        },\n    )\n    versioning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_versioning\", title=\"Extension field for ``versioning``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"profile\",\n            \"supportedProfile\",\n            \"documentation\",\n            \"interaction\",\n            \"versioning\",\n            \"readHistory\",\n            \"updateCreate\",\n            \"conditionalCreate\",\n            \"conditionalRead\",\n            \"conditionalUpdate\",\n            \"conditionalDelete\",\n            \"referencePolicy\",\n            \"searchInclude\",\n            \"searchRevInclude\",\n            \"searchParam\",\n            \"operation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"profile\", \"supportedProfile\", \"operation\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestResourceInteraction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What operations are supported?.\n    Identifies a restful operation supported by the solution.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestResourceInteraction\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"read | vread | update | patch | delete | history-instance | history-\"\n            \"type | create | search-type\"\n        ),\n        description=\"Coded identifier of the operation, supported by the system resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"read\",\n                \"vread\",\n                \"update\",\n                \"patch\",\n                \"delete\",\n                \"history-instance\",\n                \"history-type\",\n                \"create\",\n                \"search-type\",\n            ],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Anything special about operation behavior\",\n        description=(\n            \"Guidance specific to the implementation of this operation, such as \"\n            \"'delete is a logical delete' or 'updates are only allowed with version\"\n            \" id' or 'creates permitted from pre-authorized certificates only'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestResourceInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"documentation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestResourceOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a resource operation.\n    Definition of an operation or a named query together with its parameters\n    and their meaning and type. Consult the definition of the operation for\n    details about how to invoke the operation, and the parameters.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestResourceOperation\"\n\n    definition: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"The defined operation/query\",\n        description=(\n            \"Where the formal definition can be found. If a server references the \"\n            \"base definition of an Operation (i.e. from the specification itself \"\n            \"such as ```http://hl7.org/fhir/OperationDefinition/ValueSet-\"\n            \"expand```), that means it supports the full capabilities of the \"\n            \"operation - e.g. both GET and POST invocation.  If it only supports a \"\n            \"subset, it must define its own custom \"\n            \"[OperationDefinition](operationdefinition.html#) with a 'base' of the \"\n            \"original OperationDefinition.  The custom definition would describe \"\n            \"the specific subset of functionality supported.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationDefinition\"],\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Specific details about operation behavior\",\n        description=(\n            \"Documentation that describes anything special about the operation \"\n            \"behavior, possibly detailing different behavior for system, type and \"\n            \"instance-level invocation of the operation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name by which the operation/query is invoked\",\n        description=(\n            \"The name of the operation or query. For an operation, this is the name\"\n            \"  prefixed with $ and used in the URL. For a query, this is the name \"\n            \"used in the _query parameter when the query is called.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestResourceOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"definition\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"definition\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"definition\", \"definition__ext\"), (\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestResourceSearchParam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Search parameters supported by implementation.\n    Search parameters for implementations to support and/or make use of -\n    either references to ones defined in the specification, or additional ones\n    defined for/by the implementation.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestResourceSearchParam\"\n\n    definition: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Source of definition for parameter\",\n        description=(\n            \"An absolute URI that is a formal reference to where this parameter was\"\n            \" first defined, so that a client can be confident of the meaning of \"\n            \"the search parameter (a reference to \"\n            \"[SearchParameter.url](searchparameter-\"\n            \"definitions.html#SearchParameter.url)). This element SHALL be \"\n            \"populated if the search parameter refers to a SearchParameter defined \"\n            \"by the FHIR core specification or externally defined IGs.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SearchParameter\"],\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Server-specific usage\",\n        description=(\n            \"This allows documentation of any distinct behaviors about how the \"\n            \"search parameter is used.  For example, text matching algorithms.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of search parameter\",\n        description=\"The name of the search parameter used in the interface.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"number | date | string | token | reference | composite | quantity | \"\n            \"uri | special\"\n        ),\n        description=(\n            \"The type of value a search parameter refers to, and how the content is\"\n            \" interpreted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"number\",\n                \"date\",\n                \"string\",\n                \"token\",\n                \"reference\",\n                \"composite\",\n                \"quantity\",\n                \"uri\",\n                \"special\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestResourceSearchParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"definition\",\n            \"type\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceSearchParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestSecurity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about security of implementation.\n    Information about security implementation from an interface perspective -\n    what a client needs to know.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestSecurity\"\n\n    cors: bool | None = Field(\n        default=None,\n        alias=\"cors\",\n        title=\"Adds CORS Headers (http://enable-cors.org/)\",\n        description=(\n            \"Server adds CORS headers when responding to requests - this enables \"\n            \"Javascript applications to use the server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    cors__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_cors\", title=\"Extension field for ``cors``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"General description of how security works\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    service: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates\",\n        description=\"Types of security services that are supported/required by the system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestSecurity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"cors\",\n            \"service\",\n            \"description\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestSecurity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"cors\", \"service\"]\n\n\nclass CapabilityStatementSoftware(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Software that is covered by this capability statement.\n    Software that is covered by this capability statement.  It is used when the\n    capability statement describes the capabilities of a particular software\n    version, independent of an installation.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementSoftware\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name the software is known by\",\n        description=\"Name the software is known by.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    releaseDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"releaseDate\",\n        title=\"Date this version was released\",\n        description=\"Date this version of the software was released.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    releaseDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_releaseDate\", title=\"Extension field for ``releaseDate``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version covered by this statement\",\n        description=\"The version identifier for the software covered by this statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementSoftware`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"version\",\n            \"releaseDate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementSoftware`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"version\", \"releaseDate\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/careplan.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CarePlan\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CarePlan(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Healthcare plan for patient or group.\n    Describes the intention of how one or more practitioners intend to deliver\n    care for a particular patient, group or community for a period of time,\n    possibly limited to care for a specific condition or set of conditions.\n    \"\"\"\n\n    __resource_type__ = \"CarePlan\"\n\n    activity: typing.List[fhirtypes.CarePlanActivityType] | None = Field(\n        default=None,\n        alias=\"activity\",\n        title=\"Action to occur as part of plan\",\n        description=(\n            \"Identifies a planned action to occur as part of the plan.  For \"\n            \"example, a medication to be used, lab tests to perform, self-\"\n            \"monitoring, education, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    addresses: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"addresses\",\n        title=\"Health issues this plan addresses\",\n        description=(\n            \"Identifies the conditions/problems/concerns/diagnoses/etc. whose \"\n            \"management and/or mitigation are handled by this plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who is the designated responsible party\",\n        description=(\n            \"When populated, the author is responsible for the care plan.  The care\"\n            \" plan is attributed to the author.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"RelatedPerson\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills CarePlan\",\n        description=\"A care plan that is fulfilled in whole or in part by this care plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\"],\n        },\n    )\n\n    careTeam: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"careTeam\",\n        title=\"Who's involved in plan?\",\n        description=(\n            \"Identifies all people and organizations who are expected to be \"\n            \"involved in the care envisioned by this plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CareTeam\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of plan\",\n        description=(\n            'Identifies what \"kind\" of plan this is to support differentiation '\n            'between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\",'\n            ' \"asthma\", \"disease management\", \"wellness plan\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contributor: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"contributor\",\n        title=\"Who provided the content of the care plan\",\n        description=(\n            \"Identifies the individual(s) or organization who provided the contents\"\n            \" of the care plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"RelatedPerson\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Date record was first recorded\",\n        description=(\n            \"Represents when this particular CarePlan record was created in the \"\n            \"system, which is often a system-generated date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Summary of nature of plan\",\n        description=\"A description of the scope and nature of the plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter created as part of\",\n        description=(\n            \"The Encounter during which this CarePlan was created or to which the \"\n            \"creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    goal: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"goal\",\n        title=\"Desired outcome of plan\",\n        description=\"Describes the intended objective(s) of carrying out the care plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Goal\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this plan\",\n        description=(\n            \"Business identifiers assigned to this care plan by the performer or \"\n            \"other systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, questionnaire \"\n            \"or other definition that is adhered to in whole or in part by this \"\n            \"CarePlan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"Questionnaire\",\n                \"Measure\",\n                \"ActivityDefinition\",\n                \"OperationDefinition\",\n            ],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"questionnaire or other definition that is adhered to in whole or in \"\n            \"part by this CarePlan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=\"proposal | plan | order | option\",\n        description=(\n            \"Indicates the level of authority/intentionality associated with the \"\n            \"care plan and where the care plan fits into the workflow chain.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"proposal\", \"plan\", \"order\", \"option\"],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the plan\",\n        description=\"General notes about the care plan not covered elsewhere.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced CarePlan\",\n        description=(\n            \"A larger care plan of which this particular care plan is a component \"\n            \"or step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period plan covers\",\n        description=(\n            \"Indicates when the plan did (or is intended to) come into effect and \"\n            \"end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"CarePlan replaced by this CarePlan\",\n        description=(\n            \"Completed or terminated care plan whose function is taken by this new \"\n            \"care plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | on-hold | revoked | completed | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=(\n            \"Indicates whether the plan is currently being acted upon, represents \"\n            \"future intentions or is now a historical record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"on-hold\",\n                \"revoked\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who the care plan is for\",\n        description=(\n            \"Identifies the patient or group whose intended care is described by \"\n            \"the plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Information considered as part of plan\",\n        description=(\n            \"Identifies portions of the patient's record that specifically \"\n            \"influenced the formation of the plan.  These might include \"\n            \"comorbidities, recent procedures, limitations, recent assessments, \"\n            \"etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Human-friendly name for the care plan\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CarePlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"replaces\",\n            \"partOf\",\n            \"status\",\n            \"intent\",\n            \"category\",\n            \"title\",\n            \"description\",\n            \"subject\",\n            \"encounter\",\n            \"period\",\n            \"created\",\n            \"author\",\n            \"contributor\",\n            \"careTeam\",\n            \"addresses\",\n            \"supportingInfo\",\n            \"goal\",\n            \"activity\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CarePlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"replaces\",\n            \"partOf\",\n            \"status\",\n            \"intent\",\n            \"category\",\n            \"title\",\n            \"description\",\n            \"subject\",\n            \"encounter\",\n            \"period\",\n            \"created\",\n            \"author\",\n            \"addresses\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass CarePlanActivity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Action to occur as part of plan.\n    Identifies a planned action to occur as part of the plan.  For example, a\n    medication to be used, lab tests to perform, self-monitoring, education,\n    etc.\n    \"\"\"\n\n    __resource_type__ = \"CarePlanActivity\"\n\n    detail: fhirtypes.CarePlanActivityDetailType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"In-line definition of activity\",\n        description=(\n            \"A simple summary of a planned activity suitable for a general care \"\n            \"plan system (e.g. form driven) that doesn't know about specific \"\n            \"resources such as procedure etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcomeCodeableConcept: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"outcomeCodeableConcept\",\n        title=\"Results of the activity\",\n        description=(\n            \"Identifies the outcome at the point when the status of the activity is\"\n            \" assessed.  For example, the outcome of an education activity could be\"\n            \" patient understands (or not).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcomeReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"outcomeReference\",\n        title=\"Appointment, Encounter, Procedure, etc.\",\n        description=(\n            \"Details of the outcome or action resulting from the activity.  The \"\n            'reference to an \"event\" resource, such as Procedure or Encounter or '\n            \"Observation, is the result/outcome of the activity itself.  The \"\n            \"activity can be conveyed using CarePlan.activity.detail OR using the \"\n            \"CarePlan.activity.reference (a reference to a \\u201crequest\\u201d resource).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    progress: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"progress\",\n        title=\"Comments about the activity status/progress\",\n        description=\"Notes about the adherence/status/progress of the activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Activity details defined in specific resource\",\n        description=(\n            \"The details of the proposed activity represented in a specific \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Appointment\",\n                \"CommunicationRequest\",\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"Task\",\n                \"ServiceRequest\",\n                \"VisionPrescription\",\n                \"RequestGroup\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CarePlanActivity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"outcomeCodeableConcept\",\n            \"outcomeReference\",\n            \"progress\",\n            \"reference\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CarePlanActivity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CarePlanActivityDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    In-line definition of activity.\n    A simple summary of a planned activity suitable for a general care plan\n    system (e.g. form driven) that doesn't know about specific resources such\n    as procedure etc.\n    \"\"\"\n\n    __resource_type__ = \"CarePlanActivityDetail\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Detail type of activity\",\n        description=(\n            \"Detailed description of the type of planned activity; e.g. what lab \"\n            \"test, what procedure, what kind of encounter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dailyAmount: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"dailyAmount\",\n        title=\"How to consume/day?\",\n        description=\"Identifies the quantity expected to be consumed in a given day.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Extra info describing activity to perform\",\n        description=(\n            \"This provides a textual description of constraints on the intended \"\n            \"activity occurrence, including relation to other activities.  It may \"\n            \"also include objectives, pre-conditions and end-conditions.  Finally, \"\n            \"it may convey specifics about the activity such as body site, method, \"\n            \"route, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"If true, activity is prohibiting action\",\n        description=(\n            \"If true, indicates that the described activity is one that must NOT be\"\n            \" engaged in when following the plan.  If false, or missing, indicates \"\n            \"that the described activity is one that should be engaged in when \"\n            \"following the plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    goal: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"goal\",\n        title=\"Goals this activity relates to\",\n        description=(\n            \"Internal reference that identifies the goals that this activity is \"\n            \"intended to contribute towards meeting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Goal\"],\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, questionnaire \"\n            \"or other definition that is adhered to in whole or in part by this \"\n            \"CarePlan activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"ActivityDefinition\",\n                \"Questionnaire\",\n                \"Measure\",\n                \"OperationDefinition\",\n            ],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"questionnaire or other definition that is adhered to in whole or in \"\n            \"part by this CarePlan activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=(\n            \"Appointment | CommunicationRequest | DeviceRequest | MedicationRequest\"\n            \" | NutritionOrder | Task | ServiceRequest | VisionPrescription\"\n        ),\n        description=(\n            \"A description of the kind of resource the in-line definition of a care\"\n            \" plan activity is representing.  The CarePlan.activity.detail is an \"\n            \"in-line definition when a resource is not referenced using \"\n            \"CarePlan.activity.reference.  For example, a MedicationRequest, a \"\n            \"ServiceRequest, or a CommunicationRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"Appointment\",\n                \"CommunicationRequest\",\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"Task\",\n                \"ServiceRequest\",\n                \"VisionPrescription\",\n            ],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where it should happen\",\n        description=(\n            \"Identifies the facility where the activity will occur; e.g. home, \"\n            \"hospital, specific clinic, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who will be responsible?\",\n        description=\"Identifies who's expected to be involved in the activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"CareTeam\",\n                \"HealthcareService\",\n                \"Device\",\n            ],\n        },\n    )\n\n    productCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productCodeableConcept\",\n        title=\"What is to be administered/supplied\",\n        description=(\n            \"Identifies the food, drug or other product to be consumed or supplied \"\n            \"in the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e product[x]\n            \"one_of_many\": \"product\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    productReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"productReference\",\n        title=\"What is to be administered/supplied\",\n        description=(\n            \"Identifies the food, drug or other product to be consumed or supplied \"\n            \"in the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e product[x]\n            \"one_of_many\": \"product\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\", \"Substance\"],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"How much to administer/supply/consume\",\n        description=(\n            \"Identifies the quantity expected to be supplied, administered or \"\n            \"consumed by the subject.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why activity should be done or why activity was prohibited\",\n        description=(\n            \"Provides the rationale that drove the inclusion of this particular \"\n            \"activity as part of the plan or the reason why the activity was \"\n            \"prohibited.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why activity is needed\",\n        description=(\n            \"Indicates another resource, such as the health condition(s), whose \"\n            \"existence justifies this request and drove the inclusion of this \"\n            \"particular activity as part of the plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    scheduledPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"scheduledPeriod\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e scheduled[x]\n            \"one_of_many\": \"scheduled\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    scheduledString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"scheduledString\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e scheduled[x]\n            \"one_of_many\": \"scheduled\",\n            \"one_of_many_required\": False,\n        },\n    )\n    scheduledString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_scheduledString\",\n        title=\"Extension field for ``scheduledString``.\",\n    )\n\n    scheduledTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"scheduledTiming\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e scheduled[x]\n            \"one_of_many\": \"scheduled\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"not-started | scheduled | in-progress | on-hold | completed | \"\n            \"cancelled | stopped | unknown | entered-in-error\"\n        ),\n        description=\"Identifies what progress is being made for the specific activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"not-started\",\n                \"scheduled\",\n                \"in-progress\",\n                \"on-hold\",\n                \"completed\",\n                \"cancelled\",\n                \"stopped\",\n                \"unknown\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=(\n            \"Provides reason why the activity isn't yet started, is on hold, was \"\n            \"cancelled, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CarePlanActivityDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"kind\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"code\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"goal\",\n            \"status\",\n            \"statusReason\",\n            \"doNotPerform\",\n            \"scheduledTiming\",\n            \"scheduledPeriod\",\n            \"scheduledString\",\n            \"location\",\n            \"performer\",\n            \"productCodeableConcept\",\n            \"productReference\",\n            \"dailyAmount\",\n            \"quantity\",\n            \"description\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CarePlanActivityDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"product\": [\"productCodeableConcept\", \"productReference\"],\n            \"scheduled\": [\"scheduledPeriod\", \"scheduledString\", \"scheduledTiming\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/careteam.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CareTeam\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CareTeam(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Planned participants in the coordination and delivery of care for a patient\n    or group.\n    The Care Team includes all the people and organizations who plan to\n    participate in the coordination and delivery of care for a patient.\n    \"\"\"\n\n    __resource_type__ = \"CareTeam\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of team\",\n        description=(\n            \"Identifies what kind of team.  This is to support differentiation \"\n            \"between multiple co-existing teams, such as care plan team, episode of\"\n            \" care team, longitudinal care team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter created as part of\",\n        description=(\n            \"The Encounter during which this CareTeam was created or to which the \"\n            \"creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this team\",\n        description=(\n            \"Business identifiers assigned to this care team by the performer or \"\n            \"other systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingOrganization: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"Organization responsible for the care team\",\n        description=\"The organization responsible for the care team.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the team, such as crisis assessment team\",\n        description=(\n            \"A label for human use intended to distinguish like teams.  E.g. the \"\n            '\"red\" vs. \"green\" trauma teams.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the CareTeam\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    participant: typing.List[fhirtypes.CareTeamParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Members of the team\",\n        description=(\n            \"Identifies all people and organizations who are expected to be \"\n            \"involved in the care team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period team covers\",\n        description=(\n            \"Indicates when the team did (or is intended to) come into effect and \"\n            \"end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why the care team exists\",\n        description=\"Describes why the care team exists.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why the care team exists\",\n        description=\"Condition(s) that this care team addresses.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"proposed | active | suspended | inactive | entered-in-error\",\n        description=\"Indicates the current state of the care team.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposed\",\n                \"active\",\n                \"suspended\",\n                \"inactive\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who care team is for\",\n        description=(\n            \"Identifies the patient or group whose intended care is handled by the \"\n            \"team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the care team (that applies to all members)\",\n        description=(\n            \"A central contact detail for the care team (that applies to all \"\n            \"members).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"name\",\n            \"subject\",\n            \"encounter\",\n            \"period\",\n            \"participant\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"managingOrganization\",\n            \"telecom\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"name\",\n            \"subject\",\n            \"encounter\",\n            \"period\",\n            \"managingOrganization\",\n        ]\n\n\nclass CareTeamParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Members of the team.\n    Identifies all people and organizations who are expected to be involved in\n    the care team.\n    \"\"\"\n\n    __resource_type__ = \"CareTeamParticipant\"\n\n    member: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"member\",\n        title=\"Who is involved\",\n        description=(\n            \"The specific person or organization who is participating/expected to \"\n            \"participate in the care team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization of the practitioner\",\n        description=\"The organization of the practitioner.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period of participant\",\n        description=(\n            \"Indicates when the specific member or organization did (or is intended\"\n            \" to) come into effect and end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    role: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Type of involvement\",\n        description=(\n            \"Indicates specific responsibility of an individual within the care \"\n            'team, such as \"Primary care physician\", \"Trained social worker '\n            'counselor\", \"Caregiver\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CareTeamParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"role\",\n            \"member\",\n            \"onBehalfOf\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CareTeamParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"role\", \"member\", \"onBehalfOf\"]\n"
  },
  {
    "path": "fhir/resources/R4B/catalogentry.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CatalogEntry\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CatalogEntry(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An entry in a catalog.\n    Catalog entries are wrappers that contextualize items included in a\n    catalog.\n    \"\"\"\n\n    __resource_type__ = \"CatalogEntry\"\n\n    additionalCharacteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"additionalCharacteristic\",\n        title=\"Additional characteristics of the catalog entry\",\n        description=\"Used for examplefor Out of Formulary, or any specifics.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    additionalClassification: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"additionalClassification\",\n        title=\"Additional classification of the catalog entry\",\n        description=\"User for example for ATC classification, or.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    additionalIdentifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"additionalIdentifier\",\n        title=(\n            \"Any additional identifier(s) for the catalog item, in the same \"\n            \"granularity or concept\"\n        ),\n        description=\"Used in supporting related concepts, e.g. NDC to RxNorm.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    classification: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=\"Classification (category or class) of the item entry\",\n        description=\"Classes of devices, or ATC for medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier of the catalog item\",\n        description=(\n            \"Used in supporting different identifiers for the same product, e.g. \"\n            \"manufacturer code and retailer code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastUpdated: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"lastUpdated\",\n        title=\"When was this catalog last updated\",\n        description=(\n            \"Typically date of issue is different from the beginning of the \"\n            \"validity. This can be used to see when an item was last updated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastUpdated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lastUpdated\", title=\"Extension field for ``lastUpdated``.\"\n    )\n\n    orderable: bool | None = Field(\n        default=None,\n        alias=\"orderable\",\n        title=\"Whether the entry represents an orderable item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    orderable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_orderable\", title=\"Extension field for ``orderable``.\"\n    )\n\n    referencedItem: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"referencedItem\",\n        title=\"The item that is being defined\",\n        description=\"The item in a catalog or definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Medication\",\n                \"Device\",\n                \"Organization\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"HealthcareService\",\n                \"ActivityDefinition\",\n                \"PlanDefinition\",\n                \"SpecimenDefinition\",\n                \"ObservationDefinition\",\n                \"Binary\",\n            ],\n        },\n    )\n\n    relatedEntry: typing.List[fhirtypes.CatalogEntryRelatedEntryType] | None = Field(\n        default=None,\n        alias=\"relatedEntry\",\n        title=\"An item that this catalog entry is related to\",\n        description=(\n            \"Used for example, to point to a substance, or to a device used to \"\n            \"administer a medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"Used to support catalog exchange even for unsupported products, e.g. \"\n            \"getting list of medications even if not prescribable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of item - medication, device, service, protocol or other\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    validTo: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"validTo\",\n        title=\"The date until which this catalog entry is expected to be active\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    validTo__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_validTo\", title=\"Extension field for ``validTo``.\"\n    )\n\n    validityPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"validityPeriod\",\n        title=\"The time period in which this catalog entry is expected to be active\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CatalogEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"orderable\",\n            \"referencedItem\",\n            \"additionalIdentifier\",\n            \"classification\",\n            \"status\",\n            \"validityPeriod\",\n            \"validTo\",\n            \"lastUpdated\",\n            \"additionalCharacteristic\",\n            \"additionalClassification\",\n            \"relatedEntry\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CatalogEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"orderable\",\n            \"referencedItem\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"orderable\", \"orderable__ext\")]\n        return required_fields\n\n\nclass CatalogEntryRelatedEntry(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An item that this catalog entry is related to.\n    Used for example, to point to a substance, or to a device used to\n    administer a medication.\n    \"\"\"\n\n    __resource_type__ = \"CatalogEntryRelatedEntry\"\n\n    item: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"item\",\n        title=\"The reference to the related item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CatalogEntry\"],\n        },\n    )\n\n    relationtype: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"relationtype\",\n        title=\"triggers | is-replaced-by\",\n        description=(\n            \"The type of relation to the related item: child, parent, \"\n            \"packageContent, containerPackage, usedIn, uses, requires, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"triggers\", \"is-replaced-by\"],\n        },\n    )\n    relationtype__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relationtype\",\n        title=\"Extension field for ``relationtype``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CatalogEntryRelatedEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"relationtype\", \"item\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CatalogEntryRelatedEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"relationtype\", \"relationtype__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/chargeitem.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ChargeItem\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ChargeItem(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Item containing charge code(s) associated with the provision of healthcare\n    provider products.\n    The resource ChargeItem describes the provision of healthcare provider\n    products for a certain patient, therefore referring not only to the\n    product, but containing in addition details of the provision, like date,\n    time, amounts and participating organizations and persons. Main Usage of\n    the ChargeItem is to enable the billing process and internal cost\n    allocation.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItem\"\n\n    account: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"account\",\n        title=\"Account to place this charge\",\n        description=\"Account into which this ChargeItems belongs.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    bodysite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodysite\",\n        title=\"Anatomical location, if relevant\",\n        description=\"The anatomical location where the related service has been applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"A code that identifies the charge, like a billing code\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter / Episode associated with event\",\n        description=(\n            \"The encounter or episode of care that establishes the context for this\"\n            \" event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    costCenter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"costCenter\",\n        title=\"Organization that has ownership of the (potential, future) revenue\",\n        description=\"The financial cost center permits the tracking of charge attribution.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    definitionCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"definitionCanonical\",\n        title=\"Resource defining the code of this ChargeItem\",\n        description=(\n            \"References the source of pricing information, rules of application for\"\n            \" the code this ChargeItem uses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ChargeItemDefinition\"],\n        },\n    )\n    definitionCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_definitionCanonical\",\n        title=\"Extension field for ``definitionCanonical``.\",\n    )\n\n    definitionUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"definitionUri\",\n        title=\"Defining information about the code of this charge item\",\n        description=(\n            \"References the (external) source of pricing information, rules of \"\n            \"application for the code this ChargeItem uses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definitionUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_definitionUri\",\n        title=\"Extension field for ``definitionUri``.\",\n    )\n\n    enteredDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"enteredDate\",\n        title=\"Date the charge item was entered\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    enteredDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_enteredDate\", title=\"Extension field for ``enteredDate``.\"\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Individual who was entering\",\n        description=\"The device, practitioner, etc. who entered the charge item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    factorOverride: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factorOverride\",\n        title=\"Factor overriding the associated rules\",\n        description=(\n            \"Factor overriding the factor determined by the rules associated with \"\n            \"the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factorOverride__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_factorOverride\",\n        title=\"Extension field for ``factorOverride``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for item\",\n        description=\"Identifiers assigned to this event performer or other systems.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the ChargeItem\",\n        description=(\n            \"Comments made about the event by the performer, subject or other \"\n            \"participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When the charged service was applied\",\n        description=\"Date/time(s) or duration when the charged service was applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When the charged service was applied\",\n        description=\"Date/time(s) or duration when the charged service was applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When the charged service was applied\",\n        description=\"Date/time(s) or duration when the charged service was applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    overrideReason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"overrideReason\",\n        title=\"Reason for overriding the list price/factor\",\n        description=(\n            \"If the list price or the rule-based factor associated with the code is\"\n            \" overridden, this attribute can capture a text to indicate the  reason\"\n            \" for this action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    overrideReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_overrideReason\",\n        title=\"Extension field for ``overrideReason``.\",\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced ChargeItem\",\n        description=(\n            \"ChargeItems can be grouped to larger ChargeItems covering the whole \"\n            \"set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ChargeItem\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.ChargeItemPerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed charged service\",\n        description=(\n            \"Indicates who or what performed or participated in the charged \" \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performingOrganization\",\n        title=\"Organization providing the charged service\",\n        description=\"The organization requesting the service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    priceOverride: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"priceOverride\",\n        title=\"Price overriding the associated rules\",\n        description=(\n            \"Total price of the charge overriding the list price associated with \"\n            \"the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productCodeableConcept\",\n        title=\"Product charged\",\n        description=(\n            \"Identifies the device, food, drug or other product being charged \"\n            \"either by type code or reference to an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e product[x]\n            \"one_of_many\": \"product\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    productReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"productReference\",\n        title=\"Product charged\",\n        description=(\n            \"Identifies the device, food, drug or other product being charged \"\n            \"either by type code or reference to an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e product[x]\n            \"one_of_many\": \"product\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"Medication\", \"Substance\"],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Quantity of which the charge item has been serviced\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why was the charged  service rendered?\",\n        description=\"Describes why the event occurred in coded or textual form.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requestingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestingOrganization\",\n        title=\"Organization requesting the charged service\",\n        description=\"The organization performing the service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    service: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Which rendered service is being charged?\",\n        description=\"Indicated the rendered service that caused this charge.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DiagnosticReport\",\n                \"ImagingStudy\",\n                \"Immunization\",\n                \"MedicationAdministration\",\n                \"MedicationDispense\",\n                \"Observation\",\n                \"Procedure\",\n                \"SupplyDelivery\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | billable | not-billable | aborted | billed | entered-in-\"\n            \"error | unknown\"\n        ),\n        description=\"The current state of the ChargeItem.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"billable\",\n                \"not-billable\",\n                \"aborted\",\n                \"billed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Individual service was done for/to\",\n        description=(\n            \"The individual or set of individuals the action is being or was \"\n            \"performed on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Further information supporting this charge\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definitionUri\",\n            \"definitionCanonical\",\n            \"status\",\n            \"partOf\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"performer\",\n            \"performingOrganization\",\n            \"requestingOrganization\",\n            \"costCenter\",\n            \"quantity\",\n            \"bodysite\",\n            \"factorOverride\",\n            \"priceOverride\",\n            \"overrideReason\",\n            \"enterer\",\n            \"enteredDate\",\n            \"reason\",\n            \"service\",\n            \"productReference\",\n            \"productCodeableConcept\",\n            \"account\",\n            \"note\",\n            \"supportingInformation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"quantity\",\n            \"bodysite\",\n            \"enterer\",\n            \"enteredDate\",\n            \"account\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\n                \"occurrenceDateTime\",\n                \"occurrencePeriod\",\n                \"occurrenceTiming\",\n            ],\n            \"product\": [\"productCodeableConcept\", \"productReference\"],\n        }\n        return one_of_many_fields\n\n\nclass ChargeItemPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed charged service.\n    Indicates who or what performed or participated in the charged service.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItemPerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual who was performing\",\n        description=(\n            \"The device, practitioner, etc. who performed or participated in the \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"What type of performance was done\",\n        description=(\n            \"Describes the type of performance or participation(e.g. primary \"\n            \"surgeon, anesthesiologiest, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItemPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItemPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/chargeitemdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ChargeItemDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of properties and rules about how the price and the\n    applicability of a ChargeItem can be determined.\n    The ChargeItemDefinition resource provides the properties that apply to the\n    (billing) codes necessary to calculate costs and prices. The properties may\n    differ largely depending on type and realm, therefore this resource gives\n    only a rough structure and requires profiling for each type of billing code\n    system.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItemDefinition\"\n\n    applicability: typing.List[\n        fhirtypes.ChargeItemDefinitionApplicabilityType\n    ] | None = Field(\n        default=None,\n        alias=\"applicability\",\n        title=\"Whether or not the billing code is applicable\",\n        description=\"Expressions that describe applicability criteria for the billing code.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the charge item definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Billing codes or product types this definition applies to\",\n        description=(\n            \"The defined billing details in this resource pertain to the given \"\n            \"billing code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the charge item definition and/or \"\n            \"its contents. Copyright statements are generally legal restrictions on\"\n            \" the use and publishing of the charge item definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the charge item definition was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the charge item definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFromUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"derivedFromUri\",\n        title=\"Underlying externally-defined charge item definition\",\n        description=(\n            \"The URL pointing to an externally-defined charge item definition that \"\n            \"is adhered to in whole or in part by this definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    derivedFromUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_derivedFromUri\",\n        title=\"Extension field for ``derivedFromUri``.\",\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the charge item definition\",\n        description=(\n            \"A free text natural language description of the charge item definition\"\n            \" from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the charge item definition is expected to be used\",\n        description=(\n            \"The period during which the charge item definition content was or is \"\n            \"planned to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this charge item definition is \"\n            \"authored for testing purposes (or education/evaluation/marketing) and \"\n            \"is not intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the charge item definition\",\n        description=(\n            \"A formal identifier that is used to identify this charge item \"\n            \"definition when it is represented in other formats, or referenced in a\"\n            \" specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"Instances this definition applies to\",\n        description=(\n            \"The defined billing details in this resource pertain to the given \"\n            \"product instance(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\", \"Substance\", \"Device\"],\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for charge item definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the charge item definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the charge item definition was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    partOf: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=(\n            \"A larger definition of which this particular definition is a component\"\n            \" or step\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ChargeItemDefinition\"],\n        },\n    )\n    partOf__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_partOf\", title=\"Extension field for ``partOf``.\"\n    )\n\n    propertyGroup: typing.List[\n        fhirtypes.ChargeItemDefinitionPropertyGroupType\n    ] | None = Field(\n        default=None,\n        alias=\"propertyGroup\",\n        title=\"Group of properties which are applicable under the same conditions\",\n        description=(\n            \"Group of properties which are applicable under the same conditions. If\"\n            \" no applicability rules are established for the group, then all \"\n            \"properties always apply.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the charge \"\n            \"item definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    replaces: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=(\n            \"Completed or terminated request(s) whose function is taken by this new\"\n            \" request\"\n        ),\n        description=(\n            \"As new versions of a protocol or guideline are defined, allows \"\n            \"identification of what versions are replaced by a new instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ChargeItemDefinition\"],\n        },\n    )\n    replaces__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_replaces\", title=\"Extension field for ``replaces``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The current state of the ChargeItemDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this charge item definition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the charge item \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this charge item definition, represented as a\"\n            \" URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this charge item definition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which at which an \"\n            \"authoritative instance of this charge item definition is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the charge item definition is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate charge item definition \"\n            \"instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the charge item definition\",\n        description=(\n            \"The identifier that is used to identify this version of the charge \"\n            \"item definition when it is referenced in a specification, model, \"\n            \"design or instance. This is an arbitrary value managed by the charge \"\n            \"item definition author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence. To provide a version consistent \"\n            \"with the Decision Support Service specification, use the format \"\n            \"Major.Minor.Revision (e.g. 1.0.0). For more information on versioning \"\n            \"knowledge assets, refer to the Decision Support Service specification.\"\n            \" Note that a version is required for non-experimental active assets.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItemDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"title\",\n            \"derivedFromUri\",\n            \"partOf\",\n            \"replaces\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"copyright\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"code\",\n            \"instance\",\n            \"applicability\",\n            \"propertyGroup\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItemDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"title\",\n            \"derivedFromUri\",\n            \"partOf\",\n            \"replaces\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"code\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\"), (\"url\", \"url__ext\")]\n        return required_fields\n\n\nclass ChargeItemDefinitionApplicability(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Whether or not the billing code is applicable.\n    Expressions that describe applicability criteria for the billing code.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItemDefinitionApplicability\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the condition\",\n        description=(\n            \"A brief, natural language description of the condition that \"\n            \"effectively communicates the intended semantics.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Boolean-valued expression\",\n        description=(\n            \"An expression that returns true or false, indicating whether the \"\n            \"condition is satisfied. When using FHIRPath expressions, the %context \"\n            \"environment variable must be replaced at runtime with the ChargeItem \"\n            \"resource to which this definition is applied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    language: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language of the expression\",\n        description=(\n            'The media type of the language for the expression, e.g. \"text/cql\" for'\n            ' Clinical Query Language expressions or \"text/fhirpath\" for FHIRPath '\n            \"expressions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItemDefinitionApplicability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"language\",\n            \"expression\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItemDefinitionApplicability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ChargeItemDefinitionPropertyGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Group of properties which are applicable under the same conditions.\n    Group of properties which are applicable under the same conditions. If no\n    applicability rules are established for the group, then all properties\n    always apply.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItemDefinitionPropertyGroup\"\n\n    applicability: typing.List[\n        fhirtypes.ChargeItemDefinitionApplicabilityType\n    ] | None = Field(\n        default=None,\n        alias=\"applicability\",\n        title=\"Conditions under which the priceComponent is applicable\",\n        description=(\n            \"Expressions that describe applicability criteria for the \"\n            \"priceComponent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priceComponent: typing.List[\n        fhirtypes.ChargeItemDefinitionPropertyGroupPriceComponentType\n    ] | None = Field(\n        default=None,\n        alias=\"priceComponent\",\n        title=\"Components of total line item price\",\n        description=(\n            \"The price for a ChargeItem may be calculated as a base price with \"\n            \"surcharges/deductions that apply in certain conditions. A \"\n            \"ChargeItemDefinition resource that defines the prices, factors and \"\n            \"conditions that apply to a billing code is currently under \"\n            \"development. The priceComponent element can be used to offer \"\n            \"transparency to the recipient of the Invoice of how the prices have \"\n            \"been calculated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItemDefinitionPropertyGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"applicability\",\n            \"priceComponent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItemDefinitionPropertyGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ChargeItemDefinitionPropertyGroupPriceComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Components of total line item price.\n    The price for a ChargeItem may be calculated as a base price with\n    surcharges/deductions that apply in certain conditions. A\n    ChargeItemDefinition resource that defines the prices, factors and\n    conditions that apply to a billing code is currently under development. The\n    priceComponent element can be used to offer transparency to the recipient\n    of the Invoice of how the prices have been calculated.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItemDefinitionPropertyGroupPriceComponent\"\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Monetary amount associated with this component\",\n        description=\"The amount calculated for this component.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code identifying the specific component\",\n        description=(\n            \"A code that identifies the component. Codes may be used to \"\n            \"differentiate between kinds of taxes, surcharges, discounts etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Factor used for calculating this component\",\n        description=(\n            \"The factor that has been applied on the base price for calculating \"\n            \"this component.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"base | surcharge | deduction | discount | tax | informational\",\n        description=\"This code identifies the type of the component.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"base\",\n                \"surcharge\",\n                \"deduction\",\n                \"discount\",\n                \"tax\",\n                \"informational\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItemDefinitionPropertyGroupPriceComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"code\",\n            \"factor\",\n            \"amount\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItemDefinitionPropertyGroupPriceComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/citation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Citation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Citation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A description of identification, location, or contributorship of a\n    publication (article or artifact).\n    The Citation Resource enables reference to any knowledge artifact for\n    purposes of identification and attribution. The Citation Resource supports\n    existing reference structures and developing publication practices such as\n    versioning, expressing complex contributorship roles, and referencing\n    computable resources.\n    \"\"\"\n\n    __resource_type__ = \"Citation\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the citation was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the Citation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    citedArtifact: fhirtypes.CitationCitedArtifactType | None = Field(\n        default=None,\n        alias=\"citedArtifact\",\n        title=\"The article or artifact being described\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    classification: typing.List[fhirtypes.CitationClassificationType] | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=\"The assignment to an organizing scheme\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher of the Citation Resource\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=(\n            \"Use and/or publishing restrictions for the Citation, not for the cited\"\n            \" artifact\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    currentState: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"currentState\",\n        title=\"The status of the citation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the citation was published. The \"\n            \"date must change when the business version changes and it must change \"\n            \"if the status code changes. In addition, it should change when the \"\n            \"substantive content of the citation changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the citation\",\n        description=(\n            \"A free text natural language description of the citation from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the Citation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the citation is expected to be used\",\n        description=(\n            \"The period during which the citation content was or is planned to be \"\n            \"in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the Citation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this citation is authored for testing\"\n            \" purposes (or education/evaluation/marketing) and is not intended to \"\n            \"be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier for the Citation resource itself\",\n        description=(\n            \"A formal identifier that is used to identify this citation when it is \"\n            \"represented in other formats, or referenced in a specification, model,\"\n            \" design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for citation (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the citation is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the citation was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this citation (computer friendly)\",\n        description=(\n            \"A natural language name identifying the citation. This name should be \"\n            \"usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Used for general notes and annotations not coded elsewhere\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=(\n            \"The publisher of the Citation, not the publisher of the article or \"\n            \"artifact being cited\"\n        ),\n        description=(\n            \"The name of the organization or individual that published the \" \"citation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this citation is defined\",\n        description=(\n            \"Explanation of why this citation is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatesTo: typing.List[fhirtypes.CitationRelatesToType] | None = Field(\n        default=None,\n        alias=\"relatesTo\",\n        title=\"Artifact related to the Citation Resource\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the Citation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this summary. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusDate: typing.List[fhirtypes.CitationStatusDateType] | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"An effective date or period for a status of the citation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    summary: typing.List[fhirtypes.CitationSummaryType] | None = Field(\n        default=None,\n        alias=\"summary\",\n        title=\"A human-readable display of the citation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this citation (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the citation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this citation, represented as a globally \"\n            \"unique URI\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this citation when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this summary is (or will be) published. This URL can be \"\n            \"the target of a canonical reference. It SHALL remain the same when the\"\n            \" summary is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the Citation Resource content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate citation instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the citation\",\n        description=(\n            \"The identifier that is used to identify this version of the citation \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the citation author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Citation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"summary\",\n            \"classification\",\n            \"note\",\n            \"currentState\",\n            \"statusDate\",\n            \"relatesTo\",\n            \"citedArtifact\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Citation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass CitationCitedArtifact(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The article or artifact being described.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifact\"\n\n    abstract: typing.List[fhirtypes.CitationCitedArtifactAbstractType] | None = Field(\n        default=None,\n        alias=\"abstract\",\n        title=\"Summary of the article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    classification: typing.List[\n        fhirtypes.CitationCitedArtifactClassificationType\n    ] | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=\"The assignment to an organizing scheme\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contributorship: fhirtypes.CitationCitedArtifactContributorshipType | None = Field(\n        default=None,\n        alias=\"contributorship\",\n        title=\"Attribution of authors and other contributors\",\n        description=(\n            \"This element is used to list authors and other contributors, their \"\n            \"contact information, specific contributions, and summary statements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    currentState: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"currentState\",\n        title=\"The status of the cited artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dateAccessed: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateAccessed\",\n        title=\"When the cited artifact was accessed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    dateAccessed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_dateAccessed\",\n        title=\"Extension field for ``dateAccessed``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"May include DOI, PMID, PMCID, etc.\",\n        description=(\n            \"A formal identifier that is used to identify this citation when it is \"\n            \"represented in other formats, or referenced in a specification, model,\"\n            \" design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Any additional information or content for the article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    part: fhirtypes.CitationCitedArtifactPartType | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"The component of the article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publicationForm: typing.List[\n        fhirtypes.CitationCitedArtifactPublicationFormType\n    ] | None = Field(\n        default=None,\n        alias=\"publicationForm\",\n        title=(\n            \"If multiple, used to represent alternative forms of the article that \"\n            \"are not separate citations\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedIdentifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"relatedIdentifier\",\n        title=\"May include trial registry identifiers\",\n        description=(\n            \"A formal identifier that is used to identify things closely related to\"\n            \" this citation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatesTo: typing.List[fhirtypes.CitationCitedArtifactRelatesToType] | None = Field(\n        default=None,\n        alias=\"relatesTo\",\n        title=\"The artifact related to the cited artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    statusDate: typing.List[\n        fhirtypes.CitationCitedArtifactStatusDateType\n    ] | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"An effective date or period for a status of the cited artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: typing.List[fhirtypes.CitationCitedArtifactTitleType] | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"The title details of the article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: fhirtypes.CitationCitedArtifactVersionType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"The defined version of the cited artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    webLocation: typing.List[\n        fhirtypes.CitationCitedArtifactWebLocationType\n    ] | None = Field(\n        default=None,\n        alias=\"webLocation\",\n        title=\"Used for any URL for the article or artifact cited\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"relatedIdentifier\",\n            \"dateAccessed\",\n            \"version\",\n            \"currentState\",\n            \"statusDate\",\n            \"title\",\n            \"abstract\",\n            \"part\",\n            \"relatesTo\",\n            \"publicationForm\",\n            \"webLocation\",\n            \"classification\",\n            \"contributorship\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"relatedIdentifier\", \"dateAccessed\"]\n\n\nclass CitationCitedArtifactAbstract(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Summary of the article or artifact.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactAbstract\"\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Copyright notice for the abstract\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    language: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Used to express the specific language\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Abstract content\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of abstract\",\n        description=\"Used to express the reason or specific aspect for the abstract.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactAbstract`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"language\",\n            \"text\",\n            \"copyright\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactAbstract`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"text\", \"text__ext\")]\n        return required_fields\n\n\nclass CitationCitedArtifactClassification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The assignment to an organizing scheme.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactClassification\"\n\n    classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classifier\",\n        title=\"The specific classification value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of classifier (e.g. publication type, keyword)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    whoClassified: fhirtypes.CitationCitedArtifactClassificationWhoClassifiedType | None = Field(\n        default=None,\n        alias=\"whoClassified\",\n        title=\"Provenance and copyright of classification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"classifier\",\n            \"whoClassified\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactClassificationWhoClassified(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Provenance and copyright of classification.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactClassificationWhoClassified\"\n\n    classifierCopyright: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"classifierCopyright\",\n        title=\"Rights management statement for the classification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    classifierCopyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_classifierCopyright\",\n        title=\"Extension field for ``classifierCopyright``.\",\n    )\n\n    freeToShare: bool | None = Field(\n        default=None,\n        alias=\"freeToShare\",\n        title=\"Acceptable to re-use the classification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    freeToShare__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_freeToShare\", title=\"Extension field for ``freeToShare``.\"\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Organization who created the classification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    person: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"person\",\n        title=\"Person who created the classification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Person\", \"Practitioner\"],\n        },\n    )\n\n    publisher: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=(\n            \"The publisher of the classification, not the publisher of the article \"\n            \"or artifact being cited\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactClassificationWhoClassified`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"person\",\n            \"organization\",\n            \"publisher\",\n            \"classifierCopyright\",\n            \"freeToShare\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactClassificationWhoClassified`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactContributorship(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Attribution of authors and other contributors.\n    This element is used to list authors and other contributors, their contact\n    information, specific contributions, and summary statements.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactContributorship\"\n\n    complete: bool | None = Field(\n        default=None,\n        alias=\"complete\",\n        title=\"Indicates if the list includes all authors and/or contributors\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    complete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_complete\", title=\"Extension field for ``complete``.\"\n    )\n\n    entry: typing.List[\n        fhirtypes.CitationCitedArtifactContributorshipEntryType\n    ] | None = Field(\n        default=None,\n        alias=\"entry\",\n        title=\"An individual entity named in the list\",\n        description=\"An individual entity named in the author list or contributor list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    summary: typing.List[\n        fhirtypes.CitationCitedArtifactContributorshipSummaryType\n    ] | None = Field(\n        default=None,\n        alias=\"summary\",\n        title=(\n            \"Used to record a display of the author/contributor list without \"\n            \"separate coding for each list member\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactContributorship`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"complete\", \"entry\", \"summary\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorship`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactContributorshipEntry(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An individual entity named in the list.\n    An individual entity named in the author list or contributor list.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactContributorshipEntry\"\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Physical mailing address\",\n        description=\"Physical mailing address for the author or contributor.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    affiliationInfo: typing.List[\n        fhirtypes.CitationCitedArtifactContributorshipEntryAffiliationInfoType\n    ] | None = Field(\n        default=None,\n        alias=\"affiliationInfo\",\n        title=\"Organizational affiliation\",\n        description=\"Organization affiliated with the entity.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    collectiveName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"collectiveName\",\n        title=\"Used for collective or corporate name as an author\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    collectiveName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_collectiveName\",\n        title=\"Extension field for ``collectiveName``.\",\n    )\n\n    contributionInstance: typing.List[\n        fhirtypes.CitationCitedArtifactContributorshipEntryContributionInstanceType\n    ] | None = Field(\n        default=None,\n        alias=\"contributionInstance\",\n        title=\"Contributions with accounting for time or number\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contributionType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"contributionType\",\n        title=\"The specific contribution\",\n        description=(\n            \"This element identifies the specific nature of an individual\\u2019s \"\n            \"contribution with respect to the cited work.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    correspondingContact: bool | None = Field(\n        default=None,\n        alias=\"correspondingContact\",\n        title=(\n            \"Indication of which contributor is the corresponding contributor for \"\n            \"the role\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    correspondingContact__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_correspondingContact\",\n        title=\"Extension field for ``correspondingContact``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Author identifier, eg ORCID\",\n        description=\"Unique person identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    initials: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"initials\",\n        title=\"Initials for forename\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    initials__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_initials\", title=\"Extension field for ``initials``.\"\n    )\n\n    listOrder: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"listOrder\",\n        title=\"Used to code order of authors\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    listOrder__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_listOrder\", title=\"Extension field for ``listOrder``.\"\n    )\n\n    name: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the person\",\n        description=\"A name associated with the individual.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"The role of the contributor (e.g. author, editor, reviewer)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Email or telephone contact methods for the author or contributor\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactContributorshipEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"initials\",\n            \"collectiveName\",\n            \"identifier\",\n            \"affiliationInfo\",\n            \"address\",\n            \"telecom\",\n            \"contributionType\",\n            \"role\",\n            \"contributionInstance\",\n            \"correspondingContact\",\n            \"listOrder\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactContributorshipEntryAffiliationInfo(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Organizational affiliation.\n    Organization affiliated with the entity.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactContributorshipEntryAffiliationInfo\"\n\n    affiliation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"affiliation\",\n        title=\"Display for the organization\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    affiliation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_affiliation\", title=\"Extension field for ``affiliation``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier for the organization\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    role: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Role within the organization, such as professional title\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    role__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_role\", title=\"Extension field for ``role``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactContributorshipEntryAffiliationInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"affiliation\",\n            \"role\",\n            \"identifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipEntryAffiliationInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactContributorshipEntryContributionInstance(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contributions with accounting for time or number.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactContributorshipEntryContributionInstance\"\n\n    time: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"time\",\n        title=\"The time that the contribution was made\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_time\", title=\"Extension field for ``time``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"The specific contribution\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactContributorshipEntryContributionInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"time\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipEntryContributionInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactContributorshipSummary(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Used to record a display of the author/contributor list without separate\n    coding for each list member.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactContributorshipSummary\"\n\n    source: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Used to code the producer or rule for creating the display string\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    style: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"style\",\n        title=\"The format for the display string\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Either authorList or contributorshipStatement\",\n        description=(\n            \"Used most commonly to express an author list or a contributorship \"\n            \"statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=(\n            \"The display string for the author list, contributor list, or \"\n            \"contributorship statement\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactContributorshipSummary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"style\",\n            \"source\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipSummary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass CitationCitedArtifactPart(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The component of the article or artifact.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactPart\"\n\n    baseCitation: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"baseCitation\",\n        title=\"The citation for the full article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Citation\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of component\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The specification of the component\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactPart`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"value\", \"baseCitation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPart`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactPublicationForm(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If multiple, used to represent alternative forms of the article that are\n    not separate citations.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactPublicationForm\"\n\n    accessionNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"accessionNumber\",\n        title=\"Entry number or identifier for inclusion in a database\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    accessionNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_accessionNumber\",\n        title=\"Extension field for ``accessionNumber``.\",\n    )\n\n    articleDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"articleDate\",\n        title=(\n            \"The date the article was added to the database, or the date the \"\n            \"article was released\"\n        ),\n        description=(\n            \"The date the article was added to the database, or the date the \"\n            \"article was released (which may differ from the journal issue \"\n            \"publication date).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    articleDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_articleDate\", title=\"Extension field for ``articleDate``.\"\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Copyright notice for the full article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    firstPage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"firstPage\",\n        title=\"Used for isolated representation of first page\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    firstPage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_firstPage\", title=\"Extension field for ``firstPage``.\"\n    )\n\n    language: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language in which this form of the article is published\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lastPage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lastPage\",\n        title=\"Used for isolated representation of last page\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastPage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lastPage\", title=\"Extension field for ``lastPage``.\"\n    )\n\n    lastRevisionDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"lastRevisionDate\",\n        title=\"The date the article was last revised or updated in the database\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastRevisionDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastRevisionDate\",\n        title=\"Extension field for ``lastRevisionDate``.\",\n    )\n\n    pageCount: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"pageCount\",\n        title=\"Number of pages or screens\",\n        description=\"Actual or approximate number of pages or screens.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    pageCount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_pageCount\", title=\"Extension field for ``pageCount``.\"\n    )\n\n    pageString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"pageString\",\n        title=\"Used for full display of pagination\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    pageString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_pageString\", title=\"Extension field for ``pageString``.\"\n    )\n\n    periodicRelease: fhirtypes.CitationCitedArtifactPublicationFormPeriodicReleaseType | None = Field(\n        default=None,\n        alias=\"periodicRelease\",\n        title=\"The specific issue in which the cited article resides\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publishedIn: fhirtypes.CitationCitedArtifactPublicationFormPublishedInType | None = Field(\n        default=None,\n        alias=\"publishedIn\",\n        title=\"The collection the cited article or artifact is published in\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactPublicationForm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"publishedIn\",\n            \"periodicRelease\",\n            \"articleDate\",\n            \"lastRevisionDate\",\n            \"language\",\n            \"accessionNumber\",\n            \"pageString\",\n            \"firstPage\",\n            \"lastPage\",\n            \"pageCount\",\n            \"copyright\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPublicationForm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactPublicationFormPeriodicRelease(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The specific issue in which the cited article resides.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactPublicationFormPeriodicRelease\"\n\n    citedMedium: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"citedMedium\",\n        title=\"Internet or Print\",\n        description=(\n            'Describes the form of the medium cited. Common codes are \"Internet\" or'\n            ' \"Print\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dateOfPublication: fhirtypes.CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationType | None = Field(\n        default=None,\n        alias=\"dateOfPublication\",\n        title=\"Defining the date on which the issue of the journal was published\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    issue: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"issue\",\n        title=\"Issue, part or supplement of journal in which the article is published\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    issue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issue\", title=\"Extension field for ``issue``.\"\n    )\n\n    volume: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"volume\",\n        title=\"Volume number of journal in which the article is published\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    volume__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_volume\", title=\"Extension field for ``volume``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactPublicationFormPeriodicRelease`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"citedMedium\",\n            \"volume\",\n            \"issue\",\n            \"dateOfPublication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPublicationFormPeriodicRelease`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublication(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defining the date on which the issue of the journal was published.\n    \"\"\"\n\n    __resource_type__ = (\n        \"CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublication\"\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date on which the issue of the journal was published\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    day: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"day\",\n        title=\"Day on which the issue of the journal was published\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    day__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_day\", title=\"Extension field for ``day``.\"\n    )\n\n    month: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"month\",\n        title=\"Month on which the issue of the journal was published\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    month__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_month\", title=\"Extension field for ``month``.\"\n    )\n\n    season: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"season\",\n        title=\"Season on which the issue of the journal was published\",\n        description=\"Spring, Summer, Fall/Autumn, Winter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    season__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_season\", title=\"Extension field for ``season``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=(\n            \"Text representation of the date of which the issue of the journal was \"\n            \"published\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    year: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"year\",\n        title=\"Year on which the issue of the journal was published\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    year__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_year\", title=\"Extension field for ``year``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"date\",\n            \"year\",\n            \"month\",\n            \"day\",\n            \"season\",\n            \"text\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactPublicationFormPublishedIn(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The collection the cited article or artifact is published in.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactPublicationFormPublishedIn\"\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; \"\n            \"Book identifiers include ISBN\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    publisherLocation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisherLocation\",\n        title=\"Geographic location of the publisher\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    publisherLocation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_publisherLocation\",\n        title=\"Extension field for ``publisherLocation``.\",\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name of the database or title of the book or journal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of container (e.g. Periodical, database, or book)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactPublicationFormPublishedIn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"identifier\",\n            \"title\",\n            \"publisher\",\n            \"publisherLocation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPublicationFormPublishedIn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactRelatesTo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The artifact related to the cited artifact.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactRelatesTo\"\n\n    relationshipType: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"relationshipType\",\n        title=\"How the cited artifact relates to the target artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    targetAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"targetAttachment\",\n        title=\"The article or artifact that the cited artifact is related to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    targetClassifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"targetClassifier\",\n        title=\"The clasification of the related artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    targetIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"targetIdentifier\",\n        title=\"The article or artifact that the cited artifact is related to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    targetReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"targetReference\",\n        title=\"The article or artifact that the cited artifact is related to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    targetUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"targetUri\",\n        title=\"The article or artifact that the cited artifact is related to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n        },\n    )\n    targetUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_targetUri\", title=\"Extension field for ``targetUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"relationshipType\",\n            \"targetClassifier\",\n            \"targetUri\",\n            \"targetIdentifier\",\n            \"targetReference\",\n            \"targetAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"target\": [\n                \"targetAttachment\",\n                \"targetIdentifier\",\n                \"targetReference\",\n                \"targetUri\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass CitationCitedArtifactStatusDate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An effective date or period for a status of the cited artifact.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactStatusDate\"\n\n    activity: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"activity\",\n        title=\"Classification of the status\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    actual: bool | None = Field(\n        default=None,\n        alias=\"actual\",\n        title=\"Either occurred or expected\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actual\", title=\"Extension field for ``actual``.\"\n    )\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"When the status started and/or ended\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactStatusDate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"activity\", \"actual\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactStatusDate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactTitle(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The title details of the article or artifact.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactTitle\"\n\n    language: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Used to express the specific language\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"The title of the article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of title\",\n        description=\"Used to express the reason or specific aspect for the title.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactTitle`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"language\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactTitle`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"text\", \"text__ext\")]\n        return required_fields\n\n\nclass CitationCitedArtifactVersion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The defined version of the cited artifact.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactVersion\"\n\n    baseCitation: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"baseCitation\",\n        title=\"Citation for the main version of the cited artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Citation\"],\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The version number or other version identifier\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"value\", \"baseCitation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass CitationCitedArtifactWebLocation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Used for any URL for the article or artifact cited.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactWebLocation\"\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Code the reason for different URLs, e.g. abstract and full-text\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"The specific URL\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactWebLocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"url\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactWebLocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationClassification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The assignment to an organizing scheme.\n    \"\"\"\n\n    __resource_type__ = \"CitationClassification\"\n\n    classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classifier\",\n        title=\"The specific classification value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of classifier (e.g. publication type, keyword)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"classifier\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationRelatesTo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Artifact related to the Citation Resource.\n    \"\"\"\n\n    __resource_type__ = \"CitationRelatesTo\"\n\n    relationshipType: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"relationshipType\",\n        title=\"How the Citation resource relates to the target artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    targetAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"targetAttachment\",\n        title=\"The article or artifact that the Citation Resource is related to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    targetClassifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"targetClassifier\",\n        title=\"The clasification of the related artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    targetIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"targetIdentifier\",\n        title=\"The article or artifact that the Citation Resource is related to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    targetReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"targetReference\",\n        title=\"The article or artifact that the Citation Resource is related to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    targetUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"targetUri\",\n        title=\"The article or artifact that the Citation Resource is related to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n        },\n    )\n    targetUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_targetUri\", title=\"Extension field for ``targetUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"relationshipType\",\n            \"targetClassifier\",\n            \"targetUri\",\n            \"targetIdentifier\",\n            \"targetReference\",\n            \"targetAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"target\": [\n                \"targetAttachment\",\n                \"targetIdentifier\",\n                \"targetReference\",\n                \"targetUri\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass CitationStatusDate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An effective date or period for a status of the citation.\n    \"\"\"\n\n    __resource_type__ = \"CitationStatusDate\"\n\n    activity: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"activity\",\n        title=\"Classification of the status\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    actual: bool | None = Field(\n        default=None,\n        alias=\"actual\",\n        title=\"Either occurred or expected\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actual\", title=\"Extension field for ``actual``.\"\n    )\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"When the status started and/or ended\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationStatusDate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"activity\", \"actual\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationStatusDate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationSummary(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A human-readable display of the citation.\n    \"\"\"\n\n    __resource_type__ = \"CitationSummary\"\n\n    style: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"style\",\n        title=\"Format for display of the citation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"The human-readable display of the citation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationSummary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"style\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationSummary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"text\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"text\", \"text__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/claim.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Claim\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Claim(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Claim, Pre-determination or Pre-authorization.\n    A provider issued list of professional services and products which have\n    been provided, or are to be provided, to a patient which is sent to an\n    insurer for reimbursement.\n    \"\"\"\n\n    __resource_type__ = \"Claim\"\n\n    accident: fhirtypes.ClaimAccidentType | None = Field(\n        default=None,\n        alias=\"accident\",\n        title=\"Details of the event\",\n        description=(\n            \"Details of an accident which resulted in injuries which required the \"\n            \"products and services listed in the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    billablePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"billablePeriod\",\n        title=\"Relevant time frame for the claim\",\n        description=\"The period for which charges are being submitted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    careTeam: typing.List[fhirtypes.ClaimCareTeamType] | None = Field(\n        default=None,\n        alias=\"careTeam\",\n        title=\"Members of the care team\",\n        description=\"The members of the team who provided the products and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Resource creation date\",\n        description=\"The date this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    diagnosis: typing.List[fhirtypes.ClaimDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"Pertinent diagnosis information\",\n        description=\"Information about diagnoses relevant to the claim items.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Author of the claim\",\n        description=(\n            \"Individual who created the claim, predetermination or \" \"preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    facility: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"facility\",\n        title=\"Servicing facility\",\n        description=\"Facility where the services were provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    fundsReserve: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fundsReserve\",\n        title=\"For whom to reserve funds\",\n        description=(\n            \"A code to indicate whether and for whom funds are to be reserved for \"\n            \"future claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for claim\",\n        description=\"A unique identifier assigned to this claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: typing.List[fhirtypes.ClaimInsuranceType] = Field(\n        default=...,\n        alias=\"insurance\",\n        title=\"Patient insurance information\",\n        description=(\n            \"Financial instruments for reimbursement for the health care products \"\n            \"and services specified on the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Target\",\n        description=\"The Insurer who is target of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    item: typing.List[fhirtypes.ClaimItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Product or service provided\",\n        description=(\n            \"A claim line. Either a simple  product or service or a 'group' of \"\n            \"details which can each be a simple items or groups of sub-details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    originalPrescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"originalPrescription\",\n        title=\"Original prescription if superseded by fulfiller\",\n        description=(\n            \"Original prescription which has been superseded by this prescription \"\n            \"to support the dispensing of pharmacy services, medications or \"\n            \"products.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"VisionPrescription\",\n            ],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The recipient of the products and services\",\n        description=(\n            \"The party to whom the professional services and/or products have been \"\n            \"supplied or are being considered and for whom actual or forecast \"\n            \"reimbursement is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    payee: fhirtypes.ClaimPayeeType | None = Field(\n        default=None,\n        alias=\"payee\",\n        title=\"Recipient of benefits payable\",\n        description=(\n            \"The party to be reimbursed for cost of the products and services \"\n            \"according to the terms of the policy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    prescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"prescription\",\n        title=\"Prescription authorizing services and products\",\n        description=(\n            \"Prescription to support the dispensing of pharmacy, device or vision \"\n            \"products.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"VisionPrescription\",\n            ],\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"priority\",\n        title=\"Desired processing ugency\",\n        description=(\n            \"The provider-required urgency of processing the request. Typical \"\n            \"values include: stat, routine deferred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    procedure: typing.List[fhirtypes.ClaimProcedureType] | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"Clinical procedures performed\",\n        description=(\n            \"Procedures performed on the patient relevant to the billing items with\"\n            \" the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"provider\",\n        title=\"Party responsible for the claim\",\n        description=(\n            \"The provider which is responsible for the claim, predetermination or \"\n            \"preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    referral: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referral\",\n        title=\"Treatment referral\",\n        description=\"A reference to a referral resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    related: typing.List[fhirtypes.ClaimRelatedType] | None = Field(\n        default=None,\n        alias=\"related\",\n        title=\"Prior or corollary claims\",\n        description=(\n            \"Other claims which are related to this claim such as prior submissions\"\n            \" or claims for related services or for the same event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"More granular claim type\",\n        description=(\n            \"A finer grained suite of claim type codes which may convey additional \"\n            \"information such as Inpatient vs Outpatient and/or a specialty \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.ClaimSupportingInfoType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Supporting information\",\n        description=(\n            \"Additional information codes regarding exceptions, special \"\n            \"considerations, the condition, situation, prior or concurrent issues.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    total: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"Total claim cost\",\n        description=\"The total value of the all the items in the claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Category or discipline\",\n        description=(\n            \"The category of claim, e.g. oral, pharmacy, vision, institutional, \"\n            \"professional.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"claim | preauthorization | predetermination\",\n        description=(\n            \"A code to indicate whether the nature of the request is: to request \"\n            \"adjudication of products and services previously rendered; or \"\n            \"requesting authorization and adjudication for provision in the future;\"\n            \" or requesting the non-binding adjudication of the listed products and\"\n            \" services which could be provided in the future.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"claim\", \"preauthorization\", \"predetermination\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Claim`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subType\",\n            \"use\",\n            \"patient\",\n            \"billablePeriod\",\n            \"created\",\n            \"enterer\",\n            \"insurer\",\n            \"provider\",\n            \"priority\",\n            \"fundsReserve\",\n            \"related\",\n            \"prescription\",\n            \"originalPrescription\",\n            \"payee\",\n            \"referral\",\n            \"facility\",\n            \"careTeam\",\n            \"supportingInfo\",\n            \"diagnosis\",\n            \"procedure\",\n            \"insurance\",\n            \"accident\",\n            \"item\",\n            \"total\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Claim`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"type\",\n            \"use\",\n            \"patient\",\n            \"billablePeriod\",\n            \"created\",\n            \"insurer\",\n            \"provider\",\n            \"priority\",\n            \"insurance\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"use\", \"use__ext\"),\n        ]\n        return required_fields\n\n\nclass ClaimAccident(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of the event.\n    Details of an accident which resulted in injuries which required the\n    products and services listed in the claim.\n    \"\"\"\n\n    __resource_type__ = \"ClaimAccident\"\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the incident occurred\",\n        description=(\n            \"Date of an accident event  related to the products and services \"\n            \"contained in the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Where the event occurred\",\n        description=\"The physical location of the accident event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Where the event occurred\",\n        description=\"The physical location of the accident event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The nature of the accident\",\n        description=(\n            \"The type or context of the accident event for the purposes of \"\n            \"selection of potential insurance coverages and determination of \"\n            \"coordination between insurers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimAccident`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"date\",\n            \"type\",\n            \"locationAddress\",\n            \"locationReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimAccident`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"date\", \"date__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"location\": [\"locationAddress\", \"locationReference\"]}\n        return one_of_many_fields\n\n\nclass ClaimCareTeam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Members of the care team.\n    The members of the team who provided the products and services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimCareTeam\"\n\n    provider: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"provider\",\n        title=\"Practitioner or organization\",\n        description=\"Member of the team who provided the product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    qualification: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"qualification\",\n        title=\"Practitioner credential or specialization\",\n        description=(\n            \"The qualification of the practitioner which is applicable for this \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    responsible: bool | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Indicator of the lead practitioner\",\n        description=(\n            \"The party who is billing and/or responsible for the claimed products \"\n            \"or services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_responsible\", title=\"Extension field for ``responsible``.\"\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Function within the team\",\n        description=(\n            \"The lead, assisting or supervising practitioner and their discipline \"\n            \"if a multidisciplinary team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Order of care team\",\n        description=\"A number to uniquely identify care team entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimCareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"provider\",\n            \"responsible\",\n            \"role\",\n            \"qualification\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimCareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Pertinent diagnosis information.\n    Information about diagnoses relevant to the claim items.\n    \"\"\"\n\n    __resource_type__ = \"ClaimDiagnosis\"\n\n    diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"diagnosisCodeableConcept\",\n        title=\"Nature of illness or problem\",\n        description=(\n            \"The nature of illness or problem in a coded form or as a reference to \"\n            \"an external defined Condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    diagnosisReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"diagnosisReference\",\n        title=\"Nature of illness or problem\",\n        description=(\n            \"The nature of illness or problem in a coded form or as a reference to \"\n            \"an external defined Condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    onAdmission: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"onAdmission\",\n        title=\"Present on admission\",\n        description=(\n            \"Indication of whether the diagnosis was present on admission to a \"\n            \"facility.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    packageCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"packageCode\",\n        title=\"Package billing code\",\n        description=(\n            \"A package billing code or bundle code used to group products and \"\n            \"services to a particular health condition (such as heart attack) which\"\n            \" is based on a predetermined grouping code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Diagnosis instance identifier\",\n        description=\"A number to uniquely identify diagnosis entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Timing or nature of the diagnosis\",\n        description=\"When the condition was observed or the relative ranking.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"diagnosisCodeableConcept\",\n            \"diagnosisReference\",\n            \"type\",\n            \"onAdmission\",\n            \"packageCode\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"diagnosis\": [\"diagnosisCodeableConcept\", \"diagnosisReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ClaimInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient insurance information.\n    Financial instruments for reimbursement for the health care products and\n    services specified on the claim.\n    \"\"\"\n\n    __resource_type__ = \"ClaimInsurance\"\n\n    businessArrangement: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"businessArrangement\",\n        title=\"Additional provider contract number\",\n        description=(\n            \"A business agreement number established between the provider and the \"\n            \"insurer for special business processing purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_businessArrangement\",\n        title=\"Extension field for ``businessArrangement``.\",\n    )\n\n    claimResponse: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claimResponse\",\n        title=\"Adjudication results\",\n        description=(\n            \"The result of the adjudication of the line items for the Coverage \"\n            \"specified in this insurance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClaimResponse\"],\n        },\n    )\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=(\n            \"Reference to the insurance card level information contained in the \"\n            \"Coverage resource. The coverage issuing insurer will use these details\"\n            \" to locate the patient's actual coverage within the insurer's \"\n            \"information system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    focal: bool | None = Field(\n        default=None,\n        alias=\"focal\",\n        title=\"Coverage to be used for adjudication\",\n        description=(\n            \"A flag to indicate that this Coverage is to be used for adjudication \"\n            \"of this claim when set to true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_focal\", title=\"Extension field for ``focal``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Pre-assigned Claim number\",\n        description=(\n            \"The business identifier to be used when the claim is sent for \"\n            \"adjudication against this insurance policy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Prior authorization reference number\",\n        description=(\n            \"Reference numbers previously provided by the insurer to the provider \"\n            \"to be quoted on subsequent claims containing services or products \"\n            \"related to the prior authorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Insurance instance identifier\",\n        description=(\n            \"A number to uniquely identify insurance entries and provide a sequence\"\n            \" of coverages to convey coordination of benefit order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"focal\",\n            \"identifier\",\n            \"coverage\",\n            \"businessArrangement\",\n            \"preAuthRef\",\n            \"claimResponse\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"sequence\", \"focal\", \"coverage\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"focal\", \"focal__ext\"), (\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Product or service provided.\n    A claim line. Either a simple  product or service or a 'group' of details\n    which can each be a simple items or groups of sub-details.\n    \"\"\"\n\n    __resource_type__ = \"ClaimItem\"\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical location\",\n        description=\"Physical service site on the patient (limb, tooth, etc.).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    careTeamSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"careTeamSequence\",\n        title=\"Applicable careTeam members\",\n        description=\"CareTeam members related to this service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    careTeamSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_careTeamSequence\",\n        title=\"Extension field for ``careTeamSequence``.\",\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ClaimItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Product or service provided\",\n        description=(\n            \"A claim detail line. Either a simple (a product or service) or a \"\n            \"'group' of sub-details which are simple items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    diagnosisSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"diagnosisSequence\",\n        title=\"Applicable diagnoses\",\n        description=\"Diagnosis applicable for this service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    diagnosisSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_diagnosisSequence\",\n        title=\"Extension field for ``diagnosisSequence``.\",\n    )\n\n    encounter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounters related to this billed item\",\n        description=(\n            \"The Encounters during which this Claim was created or to which the \"\n            \"creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    informationSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"informationSequence\",\n        title=\"Applicable exception and supporting information\",\n        description=(\n            \"Exceptions, special conditions and supporting information applicable \"\n            \"for this service or product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    informationSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_informationSequence\",\n        title=\"Extension field for ``informationSequence``.\",\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"locationCodeableConcept\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Product or service billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an additional service or product\"\n            \" or charge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    procedureSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"procedureSequence\",\n        title=\"Applicable procedures\",\n        description=\"Procedures applicable for this service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    procedureSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_procedureSequence\",\n        title=\"Extension field for ``procedureSequence``.\",\n    )\n\n    productOrService: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related claim details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Item instance identifier\",\n        description=\"A number to uniquely identify item entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subSite\",\n        title=\"Anatomical sub-location\",\n        description=(\n            \"A region or surface of the bodySite, e.g. limb region or tooth \"\n            \"surface(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"careTeamSequence\",\n            \"diagnosisSequence\",\n            \"procedureSequence\",\n            \"informationSequence\",\n            \"revenue\",\n            \"category\",\n            \"productOrService\",\n            \"modifier\",\n            \"programCode\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"locationCodeableConcept\",\n            \"locationAddress\",\n            \"locationReference\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"udi\",\n            \"bodySite\",\n            \"subSite\",\n            \"encounter\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"location\": [\n                \"locationAddress\",\n                \"locationCodeableConcept\",\n                \"locationReference\",\n            ],\n            \"serviced\": [\"servicedDate\", \"servicedPeriod\"],\n        }\n        return one_of_many_fields\n\n\nclass ClaimItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Product or service provided.\n    A claim detail line. Either a simple (a product or service) or a 'group' of\n    sub-details which are simple items.\n    \"\"\"\n\n    __resource_type__ = \"ClaimItemDetail\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an additional service or product\"\n            \" or charge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related claim details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Item instance identifier\",\n        description=\"A number to uniquely identify item entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    subDetail: typing.List[fhirtypes.ClaimItemDetailSubDetailType] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Product or service provided\",\n        description=(\n            \"A claim detail line. Either a simple (a product or service) or a \"\n            \"'group' of sub-details which are simple items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"revenue\",\n            \"category\",\n            \"productOrService\",\n            \"modifier\",\n            \"programCode\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"udi\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Product or service provided.\n    A claim detail line. Either a simple (a product or service) or a 'group' of\n    sub-details which are simple items.\n    \"\"\"\n\n    __resource_type__ = \"ClaimItemDetailSubDetail\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an additional service or product\"\n            \" or charge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related claim details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Item instance identifier\",\n        description=\"A number to uniquely identify item entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"revenue\",\n            \"category\",\n            \"productOrService\",\n            \"modifier\",\n            \"programCode\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"udi\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimPayee(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Recipient of benefits payable.\n    The party to be reimbursed for cost of the products and services according\n    to the terms of the policy.\n    \"\"\"\n\n    __resource_type__ = \"ClaimPayee\"\n\n    party: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"party\",\n        title=\"Recipient reference\",\n        description=(\n            \"Reference to the individual or organization to whom any payment will \"\n            \"be made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Category of recipient\",\n        description=\"Type of Party to be reimbursed: subscriber, provider, other.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimPayee`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"party\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimPayee`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimProcedure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Clinical procedures performed.\n    Procedures performed on the patient relevant to the billing items with the\n    claim.\n    \"\"\"\n\n    __resource_type__ = \"ClaimProcedure\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the procedure was performed\",\n        description=\"Date and optionally time the procedure was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    procedureCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"procedureCodeableConcept\",\n        title=\"Specific clinical procedure\",\n        description=(\n            \"The code or reference to a Procedure resource which identifies the \"\n            \"clinical intervention performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e procedure[x]\n            \"one_of_many\": \"procedure\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    procedureReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"procedureReference\",\n        title=\"Specific clinical procedure\",\n        description=(\n            \"The code or reference to a Procedure resource which identifies the \"\n            \"clinical intervention performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e procedure[x]\n            \"one_of_many\": \"procedure\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Procedure instance identifier\",\n        description=\"A number to uniquely identify procedure entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Category of Procedure\",\n        description=\"When the condition was observed or the relative ranking.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"type\",\n            \"date\",\n            \"procedureCodeableConcept\",\n            \"procedureReference\",\n            \"udi\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"procedure\": [\"procedureCodeableConcept\", \"procedureReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ClaimRelated(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Prior or corollary claims.\n    Other claims which are related to this claim such as prior submissions or\n    claims for related services or for the same event.\n    \"\"\"\n\n    __resource_type__ = \"ClaimRelated\"\n\n    claim: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claim\",\n        title=\"Reference to the related claim\",\n        description=\"Reference to a related claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Claim\"],\n        },\n    )\n\n    reference: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"File or case reference\",\n        description=(\n            \"An alternate organizational reference to the case or file to which \"\n            \"this particular claim pertains.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"How the reference claim is related\",\n        description=\"A code to convey how the claims are related.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"claim\",\n            \"relationship\",\n            \"reference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimSupportingInfo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supporting information.\n    Additional information codes regarding exceptions, special considerations,\n    the condition, situation, prior or concurrent issues.\n    \"\"\"\n\n    __resource_type__ = \"ClaimSupportingInfo\"\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Classification of the supplied information\",\n        description=(\n            \"The general class of the information supplied: information; exception;\"\n            \" accident, employment; onset, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of information\",\n        description=(\n            \"System and code pertaining to the specific information regarding \"\n            \"special conditions relating to the setting, treatment or patient  for \"\n            \"which care is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Explanation for the information\",\n        description=(\n            \"Provides the reason in the situation where a reason code is required \"\n            \"in addition to the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Information instance identifier\",\n        description=\"A number to uniquely identify supporting information entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    timingDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"timingDate\",\n        title=\"When it occurred\",\n        description=\"The date when or period to which this information refers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timingDate\", title=\"Extension field for ``timingDate``.\"\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When it occurred\",\n        description=\"The date when or period to which this information refers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"category\",\n            \"code\",\n            \"timingDate\",\n            \"timingPeriod\",\n            \"valueBoolean\",\n            \"valueString\",\n            \"valueQuantity\",\n            \"valueAttachment\",\n            \"valueReference\",\n            \"reason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\"timingDate\", \"timingPeriod\"],\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n            ],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/claimresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClaimResponse\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ClaimResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Response to a claim predetermination or preauthorization.\n    This resource provides the adjudication details from the processing of a\n    Claim resource.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponse\"\n\n    addItem: typing.List[fhirtypes.ClaimResponseAddItemType] | None = Field(\n        default=None,\n        alias=\"addItem\",\n        title=\"Insurer added line items\",\n        description=(\n            \"The first-tier service adjudications for payor added product or \"\n            \"service lines.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Header-level adjudication\",\n        description=(\n            \"The adjudication results which are presented at the header level \"\n            \"rather than at the line-item or add-item levels.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    communicationRequest: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"communicationRequest\",\n        title=\"Request for additional information\",\n        description=\"Request for additional supporting or authorizing information.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CommunicationRequest\"],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Response creation date\",\n        description=\"The date this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A human readable description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    error: typing.List[fhirtypes.ClaimResponseErrorType] | None = Field(\n        default=None,\n        alias=\"error\",\n        title=\"Processing errors\",\n        description=\"Errors encountered during the processing of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    form: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"Printed reference or actual form\",\n        description=(\n            \"The actual form, by reference or inclusion, for printing the content \"\n            \"or an EOB.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    formCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"formCode\",\n        title=\"Printed form identifier\",\n        description=\"A code for the form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    fundsReserve: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fundsReserve\",\n        title=\"Funds reserved status\",\n        description=(\n            \"A code, used only on a response to a preauthorization, to indicate \"\n            \"whether the benefits payable have been reserved and for whom.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for a claim response\",\n        description=\"A unique identifier assigned to this claim response.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: typing.List[fhirtypes.ClaimResponseInsuranceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Patient insurance information\",\n        description=(\n            \"Financial instruments for reimbursement for the health care products \"\n            \"and services specified on the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"insurer\",\n        title=\"Party responsible for reimbursement\",\n        description=(\n            \"The party responsible for authorization, adjudication and \"\n            \"reimbursement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    item: typing.List[fhirtypes.ClaimResponseItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Adjudication for claim line items\",\n        description=(\n            \"A claim line. Either a simple (a product or service) or a 'group' of \"\n            \"details which can also be a simple items or groups of sub-details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcome: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"queued | complete | error | partial\",\n        description=(\n            \"The outcome of the claim, predetermination, or preauthorization \"\n            \"processing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"queued\", \"complete\", \"error\", \"partial\"],\n        },\n    )\n    outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcome\", title=\"Extension field for ``outcome``.\"\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The recipient of the products and services\",\n        description=(\n            \"The party to whom the professional services and/or products have been \"\n            \"supplied or are being considered and for whom actual for facast \"\n            \"reimbursement is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    payeeType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"payeeType\",\n        title=\"Party to be paid any benefits payable\",\n        description=\"Type of Party to be reimbursed: subscriber, provider, other.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payment: fhirtypes.ClaimResponsePaymentType | None = Field(\n        default=None,\n        alias=\"payment\",\n        title=\"Payment Details\",\n        description=\"Payment details for the adjudication of the claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preAuthPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"preAuthPeriod\",\n        title=\"Preauthorization reference effective period\",\n        description=\"The time frame during which this authorization is effective.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preAuthRef: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Preauthorization reference\",\n        description=(\n            \"Reference from the Insurer which is used in later communications which\"\n            \" refers to this adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    processNote: typing.List[fhirtypes.ClaimResponseProcessNoteType] | None = Field(\n        default=None,\n        alias=\"processNote\",\n        title=\"Note concerning adjudication\",\n        description=(\n            \"A note that describes or explains adjudication results in a human \"\n            \"readable form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Id of resource triggering adjudication\",\n        description=\"Original request resource reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Claim\"],\n        },\n    )\n\n    requestor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestor\",\n        title=\"Party responsible for the claim\",\n        description=(\n            \"The provider which is responsible for the claim, predetermination or \"\n            \"preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"More granular claim type\",\n        description=(\n            \"A finer grained suite of claim type codes which may convey additional \"\n            \"information such as Inpatient vs Outpatient and/or a specialty \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    total: typing.List[fhirtypes.ClaimResponseTotalType] | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"Adjudication totals\",\n        description=\"Categorized monetary totals for the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"More granular claim type\",\n        description=(\n            \"A finer grained suite of claim type codes which may convey additional \"\n            \"information such as Inpatient vs Outpatient and/or a specialty \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"claim | preauthorization | predetermination\",\n        description=(\n            \"A code to indicate whether the nature of the request is: to request \"\n            \"adjudication of products and services previously rendered; or \"\n            \"requesting authorization and adjudication for provision in the future;\"\n            \" or requesting the non-binding adjudication of the listed products and\"\n            \" services which could be provided in the future.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"claim\", \"preauthorization\", \"predetermination\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subType\",\n            \"use\",\n            \"patient\",\n            \"created\",\n            \"insurer\",\n            \"requestor\",\n            \"request\",\n            \"outcome\",\n            \"disposition\",\n            \"preAuthRef\",\n            \"preAuthPeriod\",\n            \"payeeType\",\n            \"item\",\n            \"addItem\",\n            \"adjudication\",\n            \"total\",\n            \"payment\",\n            \"fundsReserve\",\n            \"formCode\",\n            \"form\",\n            \"processNote\",\n            \"communicationRequest\",\n            \"insurance\",\n            \"error\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"type\",\n            \"use\",\n            \"patient\",\n            \"created\",\n            \"insurer\",\n            \"request\",\n            \"outcome\",\n            \"total\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"outcome\", \"outcome__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"use\", \"use__ext\"),\n        ]\n        return required_fields\n\n\nclass ClaimResponseAddItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line items.\n    The first-tier service adjudications for payor added product or service\n    lines.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseAddItem\"\n\n    adjudication: typing.List[fhirtypes.ClaimResponseItemAdjudicationType] = Field(\n        default=...,\n        alias=\"adjudication\",\n        title=\"Added items adjudication\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical location\",\n        description=\"Physical service site on the patient (limb, tooth, etc.).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ClaimResponseAddItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Insurer added line details\",\n        description=\"The second-tier service adjudications for payor added services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"detailSequence\",\n        title=\"Detail sequence number\",\n        description=(\n            \"The sequence number of the details within the claim item which this \"\n            \"line is intended to replace.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detailSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_detailSequence\",\n        title=\"Extension field for ``detailSequence``.\",\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    itemSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"itemSequence\",\n        title=\"Item sequence number\",\n        description=\"Claim items which this service line is intended to replace.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    itemSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_itemSequence\",\n        title=\"Extension field for ``itemSequence``.\",\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"locationCodeableConcept\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an additional service or product\"\n            \" or charge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    productOrService: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related claim details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Authorized providers\",\n        description=(\n            \"The providers who are authorized for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subSite\",\n        title=\"Anatomical sub-location\",\n        description=(\n            \"A region or surface of the bodySite, e.g. limb region or tooth \"\n            \"surface(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subdetailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"subdetailSequence\",\n        title=\"Subdetail sequence number\",\n        description=(\n            \"The sequence number of the sub-details within the details within the \"\n            \"claim item which this line is intended to replace.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subdetailSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_subdetailSequence\",\n        title=\"Extension field for ``subdetailSequence``.\",\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseAddItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemSequence\",\n            \"detailSequence\",\n            \"subdetailSequence\",\n            \"provider\",\n            \"productOrService\",\n            \"modifier\",\n            \"programCode\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"locationCodeableConcept\",\n            \"locationAddress\",\n            \"locationReference\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"bodySite\",\n            \"subSite\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"location\": [\n                \"locationAddress\",\n                \"locationCodeableConcept\",\n                \"locationReference\",\n            ],\n            \"serviced\": [\"servicedDate\", \"servicedPeriod\"],\n        }\n        return one_of_many_fields\n\n\nclass ClaimResponseAddItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line details.\n    The second-tier service adjudications for payor added services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseAddItemDetail\"\n\n    adjudication: typing.List[fhirtypes.ClaimResponseItemAdjudicationType] = Field(\n        default=...,\n        alias=\"adjudication\",\n        title=\"Added items detail adjudication\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an additional service or product\"\n            \" or charge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    productOrService: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related claim details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subDetail: typing.List[\n        fhirtypes.ClaimResponseAddItemDetailSubDetailType\n    ] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Insurer added line items\",\n        description=\"The third-tier service adjudications for payor added services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseAddItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"productOrService\",\n            \"modifier\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseAddItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line items.\n    The third-tier service adjudications for payor added services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseAddItemDetailSubDetail\"\n\n    adjudication: typing.List[fhirtypes.ClaimResponseItemAdjudicationType] = Field(\n        default=...,\n        alias=\"adjudication\",\n        title=\"Added items detail adjudication\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an additional service or product\"\n            \" or charge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    productOrService: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related claim details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseAddItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"productOrService\",\n            \"modifier\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"noteNumber\",\n            \"adjudication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseError(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing errors.\n    Errors encountered during the processing of the adjudication.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseError\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Error code detailing processing issues\",\n        description=(\n            \"An error code, from a specified code system, which details why the \"\n            \"claim could not be adjudicated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detailSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"detailSequence\",\n        title=\"Detail sequence number\",\n        description=(\n            \"The sequence number of the detail within the line item submitted which\"\n            \" contains the error. This value is omitted when the error occurs \"\n            \"outside of the item structure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailSequence\",\n        title=\"Extension field for ``detailSequence``.\",\n    )\n\n    itemSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"itemSequence\",\n        title=\"Item sequence number\",\n        description=(\n            \"The sequence number of the line item submitted which contains the \"\n            \"error. This value is omitted when the error occurs outside of the item\"\n            \" structure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    itemSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_itemSequence\",\n        title=\"Extension field for ``itemSequence``.\",\n    )\n\n    subDetailSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"subDetailSequence\",\n        title=\"Subdetail sequence number\",\n        description=(\n            \"The sequence number of the sub-detail within the detail within the \"\n            \"line item submitted which contains the error. This value is omitted \"\n            \"when the error occurs outside of the item structure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subDetailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subDetailSequence\",\n        title=\"Extension field for ``subDetailSequence``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseError`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemSequence\",\n            \"detailSequence\",\n            \"subDetailSequence\",\n            \"code\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseError`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient insurance information.\n    Financial instruments for reimbursement for the health care products and\n    services specified on the claim.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseInsurance\"\n\n    businessArrangement: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"businessArrangement\",\n        title=\"Additional provider contract number\",\n        description=(\n            \"A business agreement number established between the provider and the \"\n            \"insurer for special business processing purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_businessArrangement\",\n        title=\"Extension field for ``businessArrangement``.\",\n    )\n\n    claimResponse: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claimResponse\",\n        title=\"Adjudication results\",\n        description=(\n            \"The result of the adjudication of the line items for the Coverage \"\n            \"specified in this insurance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClaimResponse\"],\n        },\n    )\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=(\n            \"Reference to the insurance card level information contained in the \"\n            \"Coverage resource. The coverage issuing insurer will use these details\"\n            \" to locate the patient's actual coverage within the insurer's \"\n            \"information system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    focal: bool | None = Field(\n        default=None,\n        alias=\"focal\",\n        title=\"Coverage to be used for adjudication\",\n        description=(\n            \"A flag to indicate that this Coverage is to be used for adjudication \"\n            \"of this claim when set to true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_focal\", title=\"Extension field for ``focal``.\"\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Insurance instance identifier\",\n        description=(\n            \"A number to uniquely identify insurance entries and provide a sequence\"\n            \" of coverages to convey coordination of benefit order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"focal\",\n            \"coverage\",\n            \"businessArrangement\",\n            \"claimResponse\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"focal\", \"focal__ext\"), (\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimResponseItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication for claim line items.\n    A claim line. Either a simple (a product or service) or a 'group' of\n    details which can also be a simple items or groups of sub-details.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItem\"\n\n    adjudication: typing.List[fhirtypes.ClaimResponseItemAdjudicationType] = Field(\n        default=...,\n        alias=\"adjudication\",\n        title=\"Adjudication details\",\n        description=(\n            \"If this item is a group then the values here are a summary of the \"\n            \"adjudication of the detail items. If this item is a simple product or \"\n            \"service then this is the result of the adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ClaimResponseItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Adjudication for claim details\",\n        description=(\n            \"A claim detail. Either a simple (a product or service) or a 'group' of\"\n            \" sub-details which are simple items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    itemSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"itemSequence\",\n        title=\"Claim item instance identifier\",\n        description=\"A number to uniquely reference the claim item entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    itemSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_itemSequence\",\n        title=\"Extension field for ``itemSequence``.\",\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemSequence\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"itemSequence\", \"itemSequence__ext\")]\n        return required_fields\n\n\nclass ClaimResponseItemAdjudication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication details.\n    If this item is a group then the values here are a summary of the\n    adjudication of the detail items. If this item is a simple product or\n    service then this is the result of the adjudication of this item.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItemAdjudication\"\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Monetary amount\",\n        description=\"Monetary amount associated with the category.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Type of adjudication information\",\n        description=(\n            \"A code to indicate the information type of this adjudication record. \"\n            \"Information types may include the value submitted, maximum values or \"\n            \"percentages allowed or payable under the plan, amounts that: the \"\n            \"patient is responsible for in aggregate or pertaining to this item; \"\n            \"amounts paid by other coverages; and, the benefit payable for this \"\n            \"item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Explanation of adjudication outcome\",\n        description=(\n            \"A code supporting the understanding of the adjudication result and \"\n            \"explaining variance from expected amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Non-monetary value\",\n        description=(\n            \"A non-monetary value associated with the category. Mutually exclusive \"\n            \"to the amount element above.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItemAdjudication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"reason\",\n            \"amount\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItemAdjudication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication for claim details.\n    A claim detail. Either a simple (a product or service) or a 'group' of sub-\n    details which are simple items.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItemDetail\"\n\n    adjudication: typing.List[fhirtypes.ClaimResponseItemAdjudicationType] = Field(\n        default=...,\n        alias=\"adjudication\",\n        title=\"Detail level adjudication details\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detailSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"detailSequence\",\n        title=\"Claim detail instance identifier\",\n        description=\"A number to uniquely reference the claim detail entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    detailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailSequence\",\n        title=\"Extension field for ``detailSequence``.\",\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    subDetail: typing.List[\n        fhirtypes.ClaimResponseItemDetailSubDetailType\n    ] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Adjudication for claim sub-details\",\n        description=\"A sub-detail adjudication of a simple product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"detailSequence\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"detailSequence\", \"detailSequence__ext\")]\n        return required_fields\n\n\nclass ClaimResponseItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication for claim sub-details.\n    A sub-detail adjudication of a simple product or service.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItemDetailSubDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Subdetail level adjudication details\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    subDetailSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"subDetailSequence\",\n        title=\"Claim sub-detail instance identifier\",\n        description=\"A number to uniquely reference the claim sub-detail entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    subDetailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subDetailSequence\",\n        title=\"Extension field for ``subDetailSequence``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"subDetailSequence\",\n            \"noteNumber\",\n            \"adjudication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"subDetailSequence\", \"subDetailSequence__ext\")]\n        return required_fields\n\n\nclass ClaimResponsePayment(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Payment Details.\n    Payment details for the adjudication of the claim.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponsePayment\"\n\n    adjustment: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"adjustment\",\n        title=\"Payment adjustment for non-claim issues\",\n        description=(\n            \"Total amount of all adjustments to this payment included in this \"\n            \"transaction which are not related to this claim's adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    adjustmentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"adjustmentReason\",\n        title=\"Explanation for the adjustment\",\n        description=\"Reason for the payment adjustment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    amount: fhirtypes.MoneyType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Payable amount after adjustment\",\n        description=\"Benefits payable less any payment adjustment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Expected date of payment\",\n        description=(\n            \"Estimated date the payment will be issued or the actual issue date of \"\n            \"payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for the payment\",\n        description=\"Issuer's unique identifier for the payment instrument.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Partial or complete payment\",\n        description=(\n            \"Whether this represents partial or complete payment of the benefits \"\n            \"payable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponsePayment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"adjustment\",\n            \"adjustmentReason\",\n            \"date\",\n            \"amount\",\n            \"identifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponsePayment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseProcessNote(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Note concerning adjudication.\n    A note that describes or explains adjudication results in a human readable\n    form.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseProcessNote\"\n\n    language: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language of the text\",\n        description=\"A code to define the language used in the text of the note.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    number: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"Note instance identifier\",\n        description=\"A number to uniquely identify a note entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Note explanatory text\",\n        description=\"The explanation or description associated with the processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"display | print | printoper\",\n        description=\"The business purpose of the note text.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"display\", \"print\", \"printoper\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"number\",\n            \"type\",\n            \"text\",\n            \"language\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"text\", \"text__ext\")]\n        return required_fields\n\n\nclass ClaimResponseTotal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication totals.\n    Categorized monetary totals for the adjudication.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseTotal\"\n\n    amount: fhirtypes.MoneyType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Financial total for the category\",\n        description=\"Monetary total amount associated with the category.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Type of adjudication information\",\n        description=(\n            \"A code to indicate the information type of this adjudication record. \"\n            \"Information types may include: the value submitted, maximum values or \"\n            \"percentages allowed or payable under the plan, amounts that the \"\n            \"patient is responsible for in aggregate or pertaining to this item, \"\n            \"amounts paid by other coverages, and the benefit payable for this \"\n            \"item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseTotal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"category\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseTotal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"category\", \"amount\"]\n"
  },
  {
    "path": "fhir/resources/R4B/clinicalimpression.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClinicalImpression\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ClinicalImpression(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A clinical assessment performed when planning treatments and management\n    strategies for a patient.\n    A record of a clinical assessment performed to determine what problem(s)\n    may affect the patient and before planning the treatments or management\n    strategies that are best to manage a patient's condition. Assessments are\n    often 1:1 with a clinical consultation / encounter,  but this varies\n    greatly depending on the clinical workflow. This resource is called\n    \"ClinicalImpression\" rather than \"ClinicalAssessment\" to avoid confusion\n    with the recording of assessment tools such as Apgar score.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalImpression\"\n\n    assessor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"assessor\",\n        title=\"The clinician performing the assessment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Kind of assessment performed\",\n        description=\"Categorizes the type of clinical assessment performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the assessment was documented\",\n        description=\"Indicates when the documentation of the assessment was complete.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Why/how the assessment was performed\",\n        description=(\n            \"A summary of the context and/or cause of the assessment - why / where \"\n            \"it was performed, and what patient events/status prompted it.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"Time of assessment\",\n        description=\"The point in time or period over which the subject was assessed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"Time of assessment\",\n        description=\"The point in time or period over which the subject was assessed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter created as part of\",\n        description=(\n            \"The Encounter during which this ClinicalImpression was created or to \"\n            \"which the creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    finding: typing.List[fhirtypes.ClinicalImpressionFindingType] | None = Field(\n        default=None,\n        alias=\"finding\",\n        title=\"Possible or likely findings and diagnoses\",\n        description=(\n            \"Specific findings or diagnoses that were considered likely or relevant\"\n            \" to ongoing treatment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Business identifiers assigned to this clinical impression by the \"\n            \"performer or other systems which remain constant as the resource is \"\n            \"updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    investigation: typing.List[\n        fhirtypes.ClinicalImpressionInvestigationType\n    ] | None = Field(\n        default=None,\n        alias=\"investigation\",\n        title=\"One or more sets of investigations (signs, symptoms, etc.)\",\n        description=(\n            \"One or more sets of investigations (signs, symptoms, etc.). The actual\"\n            \" grouping of investigations varies greatly depending on the type and \"\n            \"context of the assessment. These investigations may include data \"\n            \"generated during the assessment process, or data previously generated \"\n            \"and recorded that is pertinent to the outcomes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the ClinicalImpression\",\n        description=(\n            \"Commentary about the impression, typically recorded after the \"\n            \"impression itself was made, though supplemental notes by the original \"\n            \"author could also appear.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    previous: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"previous\",\n        title=\"Reference to last assessment\",\n        description=(\n            \"A reference to the last assessment that was conducted on this patient.\"\n            \" Assessments are often/usually ongoing in nature; a care provider \"\n            \"(practitioner or team) will make new assessments on an ongoing basis \"\n            \"as new data arises or the patient's conditions changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClinicalImpression\"],\n        },\n    )\n\n    problem: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"problem\",\n        title=\"Relevant impressions of patient state\",\n        description=\"A list of the relevant problems/conditions for a patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"AllergyIntolerance\"],\n        },\n    )\n\n    prognosisCodeableConcept: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"prognosisCodeableConcept\",\n        title=\"Estimate of likely outcome\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    prognosisReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"prognosisReference\",\n        title=\"RiskAssessment expressing likely outcome\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"RiskAssessment\"],\n        },\n    )\n\n    protocol: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"protocol\",\n        title=\"Clinical Protocol followed\",\n        description=(\n            \"Reference to a specific published clinical protocol that was followed \"\n            \"during this assessment, and/or that provides evidence in support of \"\n            \"the diagnosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    protocol__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_protocol\", title=\"Extension field for ``protocol``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"in-progress | completed | entered-in-error\",\n        description=\"Identifies the workflow status of the assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"in-progress\", \"completed\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current state of the ClinicalImpression.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Patient or group assessed\",\n        description=\"The patient or group of individuals assessed as part of this record.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    summary: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"summary\",\n        title=\"Summary of the assessment\",\n        description=\"A text summary of the investigations and the diagnosis.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    summary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_summary\", title=\"Extension field for ``summary``.\"\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Information supporting the clinical impression\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalImpression`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"statusReason\",\n            \"code\",\n            \"description\",\n            \"subject\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"date\",\n            \"assessor\",\n            \"previous\",\n            \"problem\",\n            \"investigation\",\n            \"protocol\",\n            \"summary\",\n            \"finding\",\n            \"prognosisCodeableConcept\",\n            \"prognosisReference\",\n            \"supportingInfo\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalImpression`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"code\",\n            \"description\",\n            \"subject\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"date\",\n            \"assessor\",\n            \"problem\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"effective\": [\"effectiveDateTime\", \"effectivePeriod\"]}\n        return one_of_many_fields\n\n\nclass ClinicalImpressionFinding(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Possible or likely findings and diagnoses.\n    Specific findings or diagnoses that were considered likely or relevant to\n    ongoing treatment.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalImpressionFinding\"\n\n    basis: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"basis\",\n        title=\"Which investigations support finding\",\n        description=\"Which investigations support finding or diagnosis.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    basis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_basis\", title=\"Extension field for ``basis``.\"\n    )\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"What was found\",\n        description=(\n            \"Specific text or code for finding or diagnosis, which may include \"\n            \"ruled-out or resolved conditions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"What was found\",\n        description=(\n            \"Specific reference for finding or diagnosis, which may include ruled-\"\n            \"out or resolved conditions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\", \"Media\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalImpressionFinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n            \"basis\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalImpressionFinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClinicalImpressionInvestigation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    One or more sets of investigations (signs, symptoms, etc.).\n    One or more sets of investigations (signs, symptoms, etc.). The actual\n    grouping of investigations varies greatly depending on the type and context\n    of the assessment. These investigations may include data generated during\n    the assessment process, or data previously generated and recorded that is\n    pertinent to the outcomes.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalImpressionInvestigation\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"A name/code for the set\",\n        description=(\n            'A name/code for the group (\"set\") of investigations. Typically, this '\n            'will be something like \"signs\", \"symptoms\", \"clinical\", \"diagnostic\", '\n            \"but the list is not constrained, and others such groups such as \"\n            \"(exposure|family|travel|nutritional) history may be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    item: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Record of a specific investigation\",\n        description=\"A record of a specific investigation that was undertaken.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Observation\",\n                \"QuestionnaireResponse\",\n                \"FamilyMemberHistory\",\n                \"DiagnosticReport\",\n                \"RiskAssessment\",\n                \"ImagingStudy\",\n                \"Media\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalImpressionInvestigation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"item\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalImpressionInvestigation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/clinicalusedefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClinicalUseDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ClinicalUseDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A single issue - either an indication, contraindication, interaction or an\n    undesirable effect for a medicinal product, medication, device or procedure.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinition\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=(\n            \"A categorisation of the issue, primarily for dividing warnings into \"\n            'subject heading areas such as \"Pregnancy\", \"Overdose\"'\n        ),\n        description=(\n            \"A categorisation of the issue, primarily for dividing warnings into \"\n            'subject heading areas such as \"Pregnancy and Lactation\", \"Overdose\", '\n            '\"Effects on Ability to Drive and Use Machines\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contraindication: fhirtypes.ClinicalUseDefinitionContraindicationType | None = (\n        Field(\n            default=None,\n            alias=\"contraindication\",\n            title=\"Specifics for when this is a contraindication\",\n            description=None,\n            json_schema_extra={\n                \"element_property\": True,\n                \"summary_element_property\": True,\n            },\n        )\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for this issue\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    indication: fhirtypes.ClinicalUseDefinitionIndicationType | None = Field(\n        default=None,\n        alias=\"indication\",\n        title=\"Specifics for when this is an indication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    interaction: fhirtypes.ClinicalUseDefinitionInteractionType | None = Field(\n        default=None,\n        alias=\"interaction\",\n        title=\"Specifics for when this is an interaction\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    population: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"population\",\n        title=\"The population group to which this applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"Whether this is a current issue or one that has been retired etc\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The medication or procedure for which this is an indication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicinalProductDefinition\",\n                \"Medication\",\n                \"ActivityDefinition\",\n                \"PlanDefinition\",\n                \"Device\",\n                \"DeviceDefinition\",\n                \"Substance\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"indication | contraindication | interaction | undesirable-effect | \"\n            \"warning\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"indication\",\n                \"contraindication\",\n                \"interaction\",\n                \"undesirable-effect\",\n                \"warning\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    undesirableEffect: fhirtypes.ClinicalUseDefinitionUndesirableEffectType | None = (\n        Field(\n            default=None,\n            alias=\"undesirableEffect\",\n            title=\"A possible negative outcome from the use of this treatment\",\n            description=(\n                \"Describe the possible undesirable effects (negative outcomes) from the\"\n                \" use of the medicinal product as treatment.\"\n            ),\n            json_schema_extra={\n                \"element_property\": True,\n                \"summary_element_property\": True,\n            },\n        )\n    )\n\n    warning: fhirtypes.ClinicalUseDefinitionWarningType | None = Field(\n        default=None,\n        alias=\"warning\",\n        title=(\n            \"Critical environmental, health or physical risks or hazards. For \"\n            \"example 'Do not operate heavy machinery', 'May cause drowsiness'\"\n        ),\n        description=(\n            \"A critical piece of information about environmental, health or \"\n            \"physical risks or hazards that serve as caution to the user. For \"\n            \"example 'Do not operate heavy machinery', 'May cause drowsiness', or \"\n            \"'Get medical advice/attention if you feel unwell'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"category\",\n            \"subject\",\n            \"status\",\n            \"contraindication\",\n            \"indication\",\n            \"interaction\",\n            \"population\",\n            \"undesirableEffect\",\n            \"warning\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"type\",\n            \"category\",\n            \"subject\",\n            \"status\",\n            \"contraindication\",\n            \"indication\",\n            \"interaction\",\n            \"population\",\n            \"undesirableEffect\",\n            \"warning\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass ClinicalUseDefinitionContraindication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifics for when this is a contraindication.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionContraindication\"\n\n    comorbidity: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"comorbidity\",\n        title=\"A comorbidity (concurrent condition) or coinfection\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    diseaseStatus: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"diseaseStatus\",\n        title=\"The status of the disease or symptom for the contraindication\",\n        description=(\n            \"The status of the disease or symptom for the contraindication, for \"\n            'example \"chronic\" or \"metastatic\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    diseaseSymptomProcedure: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"diseaseSymptomProcedure\",\n        title=(\n            \"The situation that is being documented as contraindicating against \"\n            \"this item\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    indication: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"indication\",\n        title=\"The indication which this is a contraidication for\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClinicalUseDefinition\"],\n        },\n    )\n\n    otherTherapy: typing.List[\n        fhirtypes.ClinicalUseDefinitionContraindicationOtherTherapyType\n    ] | None = Field(\n        default=None,\n        alias=\"otherTherapy\",\n        title=(\n            \"Information about use of the product in relation to other therapies \"\n            \"described as part of the contraindication\"\n        ),\n        description=(\n            \"Information about the use of the medicinal product in relation to \"\n            \"other therapies described as part of the contraindication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionContraindication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"diseaseSymptomProcedure\",\n            \"diseaseStatus\",\n            \"comorbidity\",\n            \"indication\",\n            \"otherTherapy\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionContraindication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"diseaseSymptomProcedure\",\n            \"diseaseStatus\",\n            \"comorbidity\",\n            \"indication\",\n            \"otherTherapy\",\n        ]\n\n\nclass ClinicalUseDefinitionContraindicationOtherTherapy(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about use of the product in relation to other therapies\n    described as part of the contraindication.\n    Information about the use of the medicinal product in relation to other\n    therapies described as part of the contraindication.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionContraindicationOtherTherapy\"\n\n    relationshipType: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"relationshipType\",\n        title=(\n            \"The type of relationship between the product \"\n            \"indication/contraindication and another therapy\"\n        ),\n        description=(\n            \"The type of relationship between the medicinal product indication or \"\n            \"contraindication and another therapy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    therapy: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"therapy\",\n        title=(\n            \"Reference to a specific medication as part of an indication or \"\n            \"contraindication\"\n        ),\n        description=(\n            \"Reference to a specific medication (active substance, medicinal \"\n            \"product or class of products) as part of an indication or \"\n            \"contraindication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicinalProductDefinition\",\n                \"Medication\",\n                \"Substance\",\n                \"SubstanceDefinition\",\n                \"ActivityDefinition\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionContraindicationOtherTherapy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"relationshipType\", \"therapy\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionContraindicationOtherTherapy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"relationshipType\", \"therapy\"]\n\n\nclass ClinicalUseDefinitionIndication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifics for when this is an indication.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionIndication\"\n\n    comorbidity: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"comorbidity\",\n        title=\"A comorbidity or coinfection as part of the indication\",\n        description=(\n            \"A comorbidity (concurrent condition) or coinfection as part of the \"\n            \"indication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    diseaseStatus: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"diseaseStatus\",\n        title=\"The status of the disease or symptom for the indication\",\n        description=(\n            \"The status of the disease or symptom for the indication, for example \"\n            '\"chronic\" or \"metastatic\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    diseaseSymptomProcedure: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"diseaseSymptomProcedure\",\n        title=\"The situation that is being documented as an indicaton for this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    durationRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"durationRange\",\n        title=\"Timing or duration information\",\n        description=(\n            \"Timing or duration information, that may be associated with use with \"\n            \"the indicated condition e.g. Adult patients suffering from myocardial \"\n            \"infarction (from a few days until less than 35 days), ischaemic stroke\"\n            \" (from 7 days until less than 6 months).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e duration[x]\n            \"one_of_many\": \"duration\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    durationString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"durationString\",\n        title=\"Timing or duration information\",\n        description=(\n            \"Timing or duration information, that may be associated with use with \"\n            \"the indicated condition e.g. Adult patients suffering from myocardial \"\n            \"infarction (from a few days until less than 35 days), ischaemic stroke\"\n            \" (from 7 days until less than 6 months).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e duration[x]\n            \"one_of_many\": \"duration\",\n            \"one_of_many_required\": False,\n        },\n    )\n    durationString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_durationString\",\n        title=\"Extension field for ``durationString``.\",\n    )\n\n    intendedEffect: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"intendedEffect\",\n        title=\"The intended effect, aim or strategy to be achieved\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    otherTherapy: typing.List[\n        fhirtypes.ClinicalUseDefinitionContraindicationOtherTherapyType\n    ] | None = Field(\n        default=None,\n        alias=\"otherTherapy\",\n        title=(\n            \"The use of the medicinal product in relation to other therapies \"\n            \"described as part of the indication\"\n        ),\n        description=(\n            \"Information about the use of the medicinal product in relation to \"\n            \"other therapies described as part of the indication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    undesirableEffect: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"undesirableEffect\",\n        title=(\n            \"An unwanted side effect or negative outcome of the subject of this \"\n            \"resource when being used for this indication\"\n        ),\n        description=(\n            \"An unwanted side effect or negative outcome that may happen if you use\"\n            \" the drug (or other subject of this resource) for this indication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClinicalUseDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionIndication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"diseaseSymptomProcedure\",\n            \"diseaseStatus\",\n            \"comorbidity\",\n            \"intendedEffect\",\n            \"durationRange\",\n            \"durationString\",\n            \"undesirableEffect\",\n            \"otherTherapy\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionIndication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"diseaseSymptomProcedure\",\n            \"diseaseStatus\",\n            \"comorbidity\",\n            \"intendedEffect\",\n            \"durationRange\",\n            \"durationString\",\n            \"undesirableEffect\",\n            \"otherTherapy\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"duration\": [\"durationRange\", \"durationString\"]}\n        return one_of_many_fields\n\n\nclass ClinicalUseDefinitionInteraction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifics for when this is an interaction.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionInteraction\"\n\n    effect: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"effect\",\n        title=(\n            'The effect of the interaction, for example \"reduced gastric absorption'\n            ' of primary medication\"'\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    incidence: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"incidence\",\n        title=\"The incidence of the interaction, e.g. theoretical, observed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    interactant: typing.List[\n        fhirtypes.ClinicalUseDefinitionInteractionInteractantType\n    ] | None = Field(\n        default=None,\n        alias=\"interactant\",\n        title=(\n            \"The specific medication, food, substance or laboratory test that \"\n            \"interacts\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    management: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"management\",\n        title=\"Actions for managing the interaction\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"The type of the interaction e.g. drug-drug interaction, drug-lab test \"\n            \"interaction\"\n        ),\n        description=(\n            \"The type of the interaction e.g. drug-drug interaction, drug-food \"\n            \"interaction, drug-lab test interaction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"interactant\",\n            \"type\",\n            \"effect\",\n            \"incidence\",\n            \"management\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"interactant\",\n            \"type\",\n            \"effect\",\n            \"incidence\",\n            \"management\",\n        ]\n\n\nclass ClinicalUseDefinitionInteractionInteractant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The specific medication, food, substance or laboratory test that interacts.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionInteractionInteractant\"\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"The specific medication, food or laboratory test that interacts\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"The specific medication, food or laboratory test that interacts\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicinalProductDefinition\",\n                \"Medication\",\n                \"Substance\",\n                \"ObservationDefinition\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionInteractionInteractant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemReference\",\n            \"itemCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionInteractionInteractant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"itemReference\", \"itemCodeableConcept\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n\n\nclass ClinicalUseDefinitionUndesirableEffect(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A possible negative outcome from the use of this treatment.\n    Describe the possible undesirable effects (negative outcomes) from the use\n    of the medicinal product as treatment.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionUndesirableEffect\"\n\n    classification: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=\"High level classification of the effect\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    frequencyOfOccurrence: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"frequencyOfOccurrence\",\n        title=\"How often the effect is seen\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    symptomConditionEffect: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"symptomConditionEffect\",\n        title=\"The situation in which the undesirable effect may manifest\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionUndesirableEffect`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"symptomConditionEffect\",\n            \"classification\",\n            \"frequencyOfOccurrence\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionUndesirableEffect`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"symptomConditionEffect\",\n            \"classification\",\n            \"frequencyOfOccurrence\",\n        ]\n\n\nclass ClinicalUseDefinitionWarning(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Critical environmental, health or physical risks or hazards. For example\n    'Do not operate heavy machinery', 'May cause drowsiness'.\n    A critical piece of information about environmental, health or physical\n    risks or hazards that serve as caution to the user. For example 'Do not\n    operate heavy machinery', 'May cause drowsiness', or 'Get medical\n    advice/attention if you feel unwell'.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionWarning\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"A coded or unformatted textual definition of this warning\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"A textual definition of this warning, with formatting\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionWarning`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"description\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionWarning`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"description\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/R4B/codeableconcept.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CodeableConcept\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass CodeableConcept(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Concept - reference to a terminology or just  text.\n    A concept that may be defined by a formal reference to a terminology or\n    ontology or may be provided by text.\n    \"\"\"\n\n    __resource_type__ = \"CodeableConcept\"\n\n    coding: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"coding\",\n        title=\"Code defined by a terminology system\",\n        description=\"A reference to a code defined by a terminology system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Plain text representation of the concept\",\n        description=(\n            \"A human language representation of the concept as \"\n            \"seen/selected/uttered by the user who entered the data and/or which \"\n            \"represents the intended meaning of the user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeableConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"coding\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeableConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"coding\", \"text\"]\n"
  },
  {
    "path": "fhir/resources/R4B/codeablereference.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CodeableReference\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass CodeableReference(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Reference to a resource or a concept.\n    A reference to a resource (by instance), or instead, a reference to a\n    concept defined in a terminology or ontology (by class).\n    \"\"\"\n\n    __resource_type__ = \"CodeableReference\"\n\n    concept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"concept\",\n        title=\"Reference to a concept (by class)\",\n        description=(\n            \"A reference to a concept - e.g. the information is identified by its \"\n            \"general class to the degree of precision found in the terminology.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Reference to a resource (by instance)\",\n        description=(\n            \"A reference to a resource the provides exact details about the \"\n            \"information being referenced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeableReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"concept\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeableReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"concept\", \"reference\"]\n"
  },
  {
    "path": "fhir/resources/R4B/codesystem.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CodeSystem\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CodeSystem(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Declares the existence of and describes a code system or code system\n    supplement.\n    The CodeSystem resource is used to declare the existence of and describe a\n    code system or code system supplement and its key properties, and\n    optionally define a part or all of its content.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystem\"\n\n    caseSensitive: bool | None = Field(\n        default=None,\n        alias=\"caseSensitive\",\n        title=\"If code comparison is case sensitive\",\n        description=(\n            \"If code comparison is case sensitive when codes within this system are\"\n            \" compared to each other.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    caseSensitive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_caseSensitive\",\n        title=\"Extension field for ``caseSensitive``.\",\n    )\n\n    compositional: bool | None = Field(\n        default=None,\n        alias=\"compositional\",\n        title=\"If code system defines a compositional grammar\",\n        description=\"The code system defines a compositional (post-coordination) grammar.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    compositional__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compositional\",\n        title=\"Extension field for ``compositional``.\",\n    )\n\n    concept: typing.List[fhirtypes.CodeSystemConceptType] | None = Field(\n        default=None,\n        alias=\"concept\",\n        title=\"Concepts in the code system\",\n        description=(\n            \"Concepts that are in the code system. The concept definitions are \"\n            \"inherently hierarchical, but the definitions must be consulted to \"\n            \"determine what the meanings of the hierarchical relationships are.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    content: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"not-present | example | fragment | complete | supplement\",\n        description=(\n            \"The extent of the content of the code system (the concepts and codes \"\n            \"it defines) are represented in this resource instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"not-present\",\n                \"example\",\n                \"fragment\",\n                \"complete\",\n                \"supplement\",\n            ],\n        },\n    )\n    content__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_content\", title=\"Extension field for ``content``.\"\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the code system and/or its contents.\"\n            \" Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    count: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Total concepts in the code system\",\n        description=(\n            \"The total number of concepts defined by the code system. Where the \"\n            \"code system has a compositional grammar, the basis of this count is \"\n            \"defined by the system steward.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the code system was published. \"\n            \"The date must change when the business version changes and it must \"\n            \"change if the status code changes. In addition, it should change when \"\n            \"the substantive content of the code system changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the code system\",\n        description=(\n            \"A free text natural language description of the code system from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this code system is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    filter: typing.List[fhirtypes.CodeSystemFilterType] | None = Field(\n        default=None,\n        alias=\"filter\",\n        title=\"Filter that can be used in a value set\",\n        description=(\n            \"A filter that can be used in a value set compose statement when \"\n            \"selecting concepts using a filter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    hierarchyMeaning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"hierarchyMeaning\",\n        title=\"grouped-by | is-a | part-of | classified-with\",\n        description=(\n            \"The meaning of the hierarchy of concepts as represented in this \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"grouped-by\", \"is-a\", \"part-of\", \"classified-with\"],\n        },\n    )\n    hierarchyMeaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_hierarchyMeaning\",\n        title=\"Extension field for ``hierarchyMeaning``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the code system (business identifier)\",\n        description=(\n            \"A formal identifier that is used to identify this code system when it \"\n            \"is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for code system (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the code system is intended to \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this code system (computer friendly)\",\n        description=(\n            \"A natural language name identifying the code system. This name should \"\n            \"be usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    property: typing.List[fhirtypes.CodeSystemPropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Additional information supplied about each concept\",\n        description=(\n            \"A property defines an additional slot through which additional \"\n            \"information can be provided about a concept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the code \"\n            \"system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this code system is defined\",\n        description=(\n            \"Explanation of why this code system is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The date (and optionally time) when the code system resource was \"\n            \"created or revised.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    supplements: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"supplements\",\n        title=\"Canonical URL of Code System this adds designations and properties to\",\n        description=(\n            \"The canonical URL of the code system that this code system supplement \"\n            \"is adding designations and properties to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CodeSystem\"],\n        },\n    )\n    supplements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_supplements\", title=\"Extension field for ``supplements``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this code system (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the code system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this code system, represented as a URI \"\n            \"(globally unique) (Coding.system)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this code system when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this code system is (or will be) published. This URL can \"\n            \"be the target of a canonical reference. It SHALL remain the same when \"\n            \"the code system is stored on different servers. This is used in \"\n            \"[Coding](datatypes.html#Coding).system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate code system instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Canonical reference to the value set with entire code system\",\n        description=(\n            \"Canonical reference to the value set that contains the entire code \"\n            \"system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the code system (Coding.version)\",\n        description=(\n            \"The identifier that is used to identify this version of the code \"\n            \"system when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the code system author\"\n            \" and is not expected to be globally unique. For example, it might be a\"\n            \" timestamp (e.g. yyyymmdd) if a managed version is not available. \"\n            \"There is also no expectation that versions can be placed in a \"\n            \"lexicographical sequence. This is used in \"\n            \"[Coding](datatypes.html#Coding).version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionNeeded: bool | None = Field(\n        default=None,\n        alias=\"versionNeeded\",\n        title=\"If definitions are not stable\",\n        description=(\n            \"This flag is used to signify that the code system does not commit to \"\n            \"concept permanence across versions. If true, a version must be \"\n            \"specified when referencing this code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    versionNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionNeeded\",\n        title=\"Extension field for ``versionNeeded``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"caseSensitive\",\n            \"valueSet\",\n            \"hierarchyMeaning\",\n            \"compositional\",\n            \"versionNeeded\",\n            \"content\",\n            \"supplements\",\n            \"count\",\n            \"filter\",\n            \"property\",\n            \"concept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"caseSensitive\",\n            \"valueSet\",\n            \"hierarchyMeaning\",\n            \"compositional\",\n            \"versionNeeded\",\n            \"content\",\n            \"supplements\",\n            \"count\",\n            \"filter\",\n            \"property\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"content\", \"content__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass CodeSystemConcept(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Concepts in the code system.\n    Concepts that are in the code system. The concept definitions are\n    inherently hierarchical, but the definitions must be consulted to determine\n    what the meanings of the hierarchical relationships are.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemConcept\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies concept\",\n        description=(\n            \"A code - a text symbol - that uniquely identifies the concept within \"\n            \"the code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    concept: typing.List[fhirtypes.CodeSystemConceptType] | None = Field(\n        default=None,\n        alias=\"concept\",\n        title=\"Child Concepts (is-a/contains/categorizes)\",\n        description=(\n            \"Defines children of a concept to produce a hierarchy of concepts. The \"\n            \"nature of the relationships is variable (is-a/contains/categorizes) - \"\n            \"see hierarchyMeaning.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Formal definition\",\n        description=(\n            \"The formal definition of the concept. The code system resource does \"\n            \"not make formal definitions required, because of the prevalence of \"\n            \"legacy systems. However, they are highly recommended, as without them \"\n            \"there is no formal meaning associated with the concept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    designation: typing.List[fhirtypes.CodeSystemConceptDesignationType] | None = Field(\n        default=None,\n        alias=\"designation\",\n        title=\"Additional representations for the concept\",\n        description=(\n            \"Additional representations for the concept - other languages, aliases,\"\n            \" specialized purposes, used for particular purposes, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Text to display to the user\",\n        description=(\n            \"A human readable string that is the recommended default way to present\"\n            \" this concept to a user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    property: typing.List[fhirtypes.CodeSystemConceptPropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Property value for the concept\",\n        description=\"A property value for this concept.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"display\",\n            \"definition\",\n            \"designation\",\n            \"property\",\n            \"concept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass CodeSystemConceptDesignation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional representations for the concept.\n    Additional representations for the concept - other languages, aliases,\n    specialized purposes, used for particular purposes, etc.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemConceptDesignation\"\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language of the designation\",\n        description=\"The language this designation is defined for.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    use: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"Details how this designation would be used\",\n        description=\"A code that details how this designation would be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The text value for this designation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemConceptDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"use\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemConceptDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass CodeSystemConceptProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Property value for the concept.\n    A property value for this concept.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemConceptProperty\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Reference to CodeSystem.property.code\",\n        description=\"A code that is a reference to CodeSystem.property.code.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemConceptProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCode\",\n            \"valueCoding\",\n            \"valueString\",\n            \"valueInteger\",\n            \"valueBoolean\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemConceptProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueCoding\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass CodeSystemFilter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Filter that can be used in a value set.\n    A filter that can be used in a value set compose statement when selecting\n    concepts using a filter.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemFilter\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies the filter\",\n        description=(\n            \"The code that identifies this filter when it is used as a filter in \"\n            \"[ValueSet](valueset.html#).compose.include.filter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"How or why the filter is used\",\n        description=\"A description of how or why the filter is used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    operator: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"operator\",\n        title=(\n            \"= | is-a | descendent-of | is-not-a | regex | in | not-in | \"\n            \"generalizes | exists\"\n        ),\n        description=\"A list of operators that can be used with the filter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"=\",\n                \"is-a\",\n                \"descendent-of\",\n                \"is-not-a\",\n                \"regex\",\n                \"in\",\n                \"not-in\",\n                \"generalizes\",\n                \"exists\",\n            ],\n        },\n    )\n    operator__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_operator\", title=\"Extension field for ``operator``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"What to use for the value\",\n        description=\"A description of what the value for the filter should be.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"description\",\n            \"operator\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"description\", \"operator\", \"value\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"code\", \"code__ext\"),\n            (\"operator\", \"operator__ext\"),\n            (\"value\", \"value__ext\"),\n        ]\n        return required_fields\n\n\nclass CodeSystemProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional information supplied about each concept.\n    A property defines an additional slot through which additional information\n    can be provided about a concept.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemProperty\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"Identifies the property on the concepts, and when referred to in \"\n            \"operations\"\n        ),\n        description=(\n            \"A code that is used to identify the property. The code is used \"\n            \"internally (in CodeSystem.concept.property.code) and also externally, \"\n            \"such as in property filters.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Why the property is defined, and/or what it conveys\",\n        description=(\n            \"A description of the property- why it is defined, and how its value \"\n            \"might be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"code | Coding | string | integer | boolean | dateTime | decimal\",\n        description=(\n            'The type of the property value. Properties of type \"code\" contain a '\n            \"code defined by the code system (e.g. a reference to another defined \"\n            \"concept).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"code\",\n                \"Coding\",\n                \"string\",\n                \"integer\",\n                \"boolean\",\n                \"dateTime\",\n                \"decimal\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Formal identifier for the property\",\n        description=(\n            \"Reference to the formal meaning of the property. One possible source \"\n            \"of meaning is the [Concept Properties](codesystem-concept-\"\n            \"properties.html) code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"uri\",\n            \"description\",\n            \"type\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"uri\", \"description\", \"type\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/coding.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Coding\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Coding(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reference to a code defined by a terminology system.\n    \"\"\"\n\n    __resource_type__ = \"Coding\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Symbol in syntax defined by the system\",\n        description=(\n            \"A symbol in syntax defined by the system. The symbol may be a \"\n            \"predefined code or an expression in a syntax defined by the coding \"\n            \"system (e.g. post-coordination).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Representation defined by the system\",\n        description=(\n            \"A representation of the meaning of the code in the system, following \"\n            \"the rules of the system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"Identity of the terminology system\",\n        description=(\n            \"The identification of the code system that defines the meaning of the \"\n            \"symbol in the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    userSelected: bool | None = Field(\n        default=None,\n        alias=\"userSelected\",\n        title=\"If this coding was chosen directly by the user\",\n        description=(\n            \"Indicates that this coding was chosen by a user directly - e.g. off a \"\n            \"pick list of available items (codes or displays).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    userSelected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_userSelected\",\n        title=\"Extension field for ``userSelected``.\",\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version of the system - if relevant\",\n        description=(\n            \"The version of the code system which was used when choosing this code.\"\n            \" Note that a well-maintained code system does not need the version \"\n            \"reported, because the meaning of codes is consistent across versions. \"\n            \"However this cannot consistently be assured, and when the meaning is \"\n            \"not guaranteed to be consistent, the version SHOULD be exchanged.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Coding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"system\",\n            \"version\",\n            \"code\",\n            \"display\",\n            \"userSelected\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Coding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"system\", \"version\", \"code\", \"display\", \"userSelected\"]\n"
  },
  {
    "path": "fhir/resources/R4B/communication.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Communication\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Communication(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A record of information transmitted from a sender to a receiver.\n    An occurrence of information being transmitted; e.g. an alert that was sent\n    to a responsible provider, a public health agency that was notified about a\n    reportable condition.\n    \"\"\"\n\n    __resource_type__ = \"Communication\"\n\n    about: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"about\",\n        title=\"Resources that pertain to this communication\",\n        description=(\n            \"Other resources that pertain to this communication and to which this \"\n            \"communication should be associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this communication\",\n        description=(\n            \"An order, proposal or plan fulfilled in whole or in part by this \"\n            \"Communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Message category\",\n        description=(\n            \"The type of message conveyed such as alert, notification, reminder, \"\n            \"instruction, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter created as part of\",\n        description=(\n            \"The Encounter during which this Communication was created or to which \"\n            \"the creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=(\n            \"Business identifiers assigned to this communication by the performer \"\n            \"or other systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    inResponseTo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"inResponseTo\",\n        title=\"Reply to\",\n        description=\"Prior communication that this communication is in response to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Communication\"],\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"Communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"ActivityDefinition\",\n                \"Measure\",\n                \"OperationDefinition\",\n                \"Questionnaire\",\n            ],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this Communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    medium: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"medium\",\n        title=\"A channel of communication\",\n        description=\"A channel that was used for this communication (e.g. email, fax).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the communication\",\n        description=(\n            \"Additional notes or commentary about the communication by the sender, \"\n            \"receiver or other interested parties.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of this action\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    payload: typing.List[fhirtypes.CommunicationPayloadType] | None = Field(\n        default=None,\n        alias=\"payload\",\n        title=\"Message payload\",\n        description=(\n            \"Text, attachment(s), or resource(s) that was communicated to the \"\n            \"recipient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Characterizes how quickly the planned or in progress communication \"\n            \"must be addressed. Includes concepts such as stat, urgent, routine.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Indication for message\",\n        description=\"The reason or justification for the communication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why was communication done?\",\n        description=(\n            \"Indicates another resource whose existence justifies this \"\n            \"communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    received: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"received\",\n        title=\"When received\",\n        description=\"The time when this communication arrived at the destination.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    received__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_received\", title=\"Extension field for ``received``.\"\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Message recipient\",\n        description=(\n            \"The entity (e.g. person, organization, clinical information system, \"\n            \"care team or device) which was the target of the communication. If \"\n            \"receipts need to be tracked by an individual, a separate resource \"\n            \"instance will need to be created for each recipient.  Multiple \"\n            \"recipient communications are intended where either receipts are not \"\n            \"tracked (e.g. a mass mail-out) or a receipt is captured in aggregate \"\n            \"(all emails confirmed received by a particular time).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Group\",\n                \"CareTeam\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    sender: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sender\",\n        title=\"Message sender\",\n        description=(\n            \"The entity (e.g. person, organization, clinical information system, or\"\n            \" device) which was the source of the communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    sent: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"sent\",\n        title=\"When sent\",\n        description=\"The time when this communication was sent.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sent\", title=\"Extension field for ``sent``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | not-done | on-hold | stopped | completed |\"\n            \" entered-in-error | unknown\"\n        ),\n        description=\"The status of the transmission.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"not-done\",\n                \"on-hold\",\n                \"stopped\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current state of the Communication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Focus of message\",\n        description=\"The patient or group that was the focus of this communication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    topic: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"Description of the purpose/content\",\n        description=(\n            \"Description of the purpose/content, similar to a subject line in an \"\n            \"email.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Communication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"partOf\",\n            \"inResponseTo\",\n            \"status\",\n            \"statusReason\",\n            \"category\",\n            \"priority\",\n            \"medium\",\n            \"subject\",\n            \"topic\",\n            \"about\",\n            \"encounter\",\n            \"sent\",\n            \"received\",\n            \"recipient\",\n            \"sender\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"payload\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Communication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"priority\",\n            \"subject\",\n            \"encounter\",\n            \"reasonCode\",\n            \"reasonReference\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass CommunicationPayload(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Message payload.\n    Text, attachment(s), or resource(s) that was communicated to the recipient.\n    \"\"\"\n\n    __resource_type__ = \"CommunicationPayload\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Message part content\",\n        description=(\n            \"A communicated content (or for multi-part communications, one portion \"\n            \"of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Message part content\",\n        description=(\n            \"A communicated content (or for multi-part communications, one portion \"\n            \"of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    contentString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"contentString\",\n        title=\"Message part content\",\n        description=(\n            \"A communicated content (or for multi-part communications, one portion \"\n            \"of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n    contentString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_contentString\",\n        title=\"Extension field for ``contentString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CommunicationPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentString\",\n            \"contentAttachment\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CommunicationPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"content\": [\"contentAttachment\", \"contentReference\", \"contentString\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/communicationrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CommunicationRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CommunicationRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A request for information to be sent to a receiver.\n    A request to convey information; e.g. the CDS system proposes that an alert\n    be sent to a responsible provider, the CDS system proposes that the public\n    health agency be notified about a reportable condition.\n    \"\"\"\n\n    __resource_type__ = \"CommunicationRequest\"\n\n    about: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"about\",\n        title=\"Resources that pertain to this communication request\",\n        description=(\n            \"Other resources that pertain to this communication request and to \"\n            \"which this communication request should be associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When request transitioned to being actionable\",\n        description=(\n            \"For draft requests, indicates the date of initial creation.  For \"\n            \"requests with other statuses, indicates the date of activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan or proposal\",\n        description=(\n            \"A plan or proposal that is fulfilled in whole or in part by this \"\n            \"request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Message category\",\n        description=(\n            \"The type of message to be sent such as alert, notification, reminder, \"\n            \"instruction, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"True if request is prohibiting action\",\n        description=(\n            \"If true indicates that the CommunicationRequest is asking for the \"\n            \"specified action to *not* occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter created as part of\",\n        description=(\n            \"The Encounter during which this CommunicationRequest was created or to\"\n            \" which the creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Composite request this is part of\",\n        description=(\n            \"A shared identifier common to all requests that were authorized more \"\n            \"or less simultaneously by a single author, representing the identifier\"\n            \" of the requisition, prescription or similar form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=(\n            \"Business identifiers assigned to this communication request by the \"\n            \"performer or other systems which remain constant as the resource is \"\n            \"updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    medium: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"medium\",\n        title=\"A channel of communication\",\n        description=\"A channel that was used for this communication (e.g. email, fax).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about communication request\",\n        description=(\n            \"Comments made about the request by the requester, sender, recipient, \"\n            \"subject or other participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When scheduled\",\n        description=\"The time when this communication is to occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When scheduled\",\n        description=\"The time when this communication is to occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    payload: typing.List[fhirtypes.CommunicationRequestPayloadType] | None = Field(\n        default=None,\n        alias=\"payload\",\n        title=\"Message payload\",\n        description=(\n            \"Text, attachment(s), or resource(s) to be communicated to the \"\n            \"recipient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Characterizes how quickly the proposed act must be initiated. Includes\"\n            \" concepts such as stat, urgent, routine.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why is communication needed?\",\n        description=\"Describes why the request is being made in coded or textual form.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why is communication needed?\",\n        description=\"Indicates another resource whose existence justifies this request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Message recipient\",\n        description=(\n            \"The entity (e.g. person, organization, clinical information system, \"\n            \"device, group, or care team) which is the intended target of the \"\n            \"communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Group\",\n                \"CareTeam\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"Request(s) replaced by this request\",\n        description=(\n            \"Completed or terminated request(s) whose function is taken by this new\"\n            \" request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CommunicationRequest\"],\n        },\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/what is requesting service\",\n        description=(\n            \"The device, individual, or organization who initiated the request and \"\n            \"has responsibility for its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    sender: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sender\",\n        title=\"Message sender\",\n        description=(\n            \"The entity (e.g. person, organization, clinical information system, or\"\n            \" device) which is to be the source of the communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | on-hold | revoked | completed | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=\"The status of the proposal or order.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"on-hold\",\n                \"revoked\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current state of the CommunicationRequest.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Focus of message\",\n        description=\"The patient or group that is the focus of this communication request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CommunicationRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"statusReason\",\n            \"category\",\n            \"priority\",\n            \"doNotPerform\",\n            \"medium\",\n            \"subject\",\n            \"about\",\n            \"encounter\",\n            \"payload\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"authoredOn\",\n            \"requester\",\n            \"recipient\",\n            \"sender\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CommunicationRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"priority\",\n            \"doNotPerform\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"authoredOn\",\n            \"requester\",\n            \"sender\",\n            \"reasonCode\",\n            \"reasonReference\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\"]}\n        return one_of_many_fields\n\n\nclass CommunicationRequestPayload(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Message payload.\n    Text, attachment(s), or resource(s) to be communicated to the recipient.\n    \"\"\"\n\n    __resource_type__ = \"CommunicationRequestPayload\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Message part content\",\n        description=(\n            \"The communicated content (or for multi-part communications, one \"\n            \"portion of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Message part content\",\n        description=(\n            \"The communicated content (or for multi-part communications, one \"\n            \"portion of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    contentString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"contentString\",\n        title=\"Message part content\",\n        description=(\n            \"The communicated content (or for multi-part communications, one \"\n            \"portion of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n    contentString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_contentString\",\n        title=\"Extension field for ``contentString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CommunicationRequestPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentString\",\n            \"contentAttachment\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CommunicationRequestPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"content\": [\"contentAttachment\", \"contentReference\", \"contentString\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/compartmentdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CompartmentDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CompartmentDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Compartment Definition for a resource.\n    A compartment definition that defines how resources are accessed on a\n    server.\n    \"\"\"\n\n    __resource_type__ = \"CompartmentDefinition\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Patient | Encounter | RelatedPerson | Practitioner | Device\",\n        description=\"Which compartment this definition describes.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"Patient\",\n                \"Encounter\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"Device\",\n            ],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the compartment definition was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the compartment definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the compartment definition\",\n        description=(\n            \"A free text natural language description of the compartment definition\"\n            \" from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this compartment definition is \"\n            \"authored for testing purposes (or education/evaluation/marketing) and \"\n            \"is not intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this compartment definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the compartment definition. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the \"\n            \"compartment definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this compartment definition is defined\",\n        description=(\n            \"Explanation of why this compartment definition is needed and why it \"\n            \"has been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    resource: typing.List[fhirtypes.CompartmentDefinitionResourceType] | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"How a resource is related to the compartment\",\n        description=\"Information about how a resource is related to the compartment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    search: bool | None = Field(\n        default=None,\n        alias=\"search\",\n        title=\"Whether the search syntax is supported\",\n        description=\"Whether the search syntax is supported,.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    search__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_search\", title=\"Extension field for ``search``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this compartment definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this compartment definition, represented as a\"\n            \" URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this compartment definition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which at which an \"\n            \"authoritative instance of this compartment definition is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the compartment definition is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate compartment definition \"\n            \"instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the compartment definition\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"compartment definition when it is referenced in a specification, \"\n            \"model, design or instance. This is an arbitrary value managed by the \"\n            \"compartment definition author and is not expected to be globally \"\n            \"unique. For example, it might be a timestamp (e.g. yyyymmdd) if a \"\n            \"managed version is not available. There is also no expectation that \"\n            \"versions can be placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompartmentDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"purpose\",\n            \"code\",\n            \"search\",\n            \"resource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompartmentDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"code\",\n            \"search\",\n            \"resource\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"code\", \"code__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"search\", \"search__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n\nclass CompartmentDefinitionResource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    How a resource is related to the compartment.\n    Information about how a resource is related to the compartment.\n    \"\"\"\n\n    __resource_type__ = \"CompartmentDefinitionResource\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Name of resource type\",\n        description=\"The name of a resource supported by the server.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Additional documentation about the resource and compartment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    param: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"param\",\n        title=\"Search Parameter Name, or chained parameters\",\n        description=(\n            \"The name of a search parameter that represents the link to the \"\n            \"compartment. More than one may be listed because a resource may be \"\n            \"linked to a compartment in more than one way,.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    param__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_param\", title=\"Extension field for ``param``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompartmentDefinitionResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"param\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompartmentDefinitionResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"param\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/composition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Composition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Composition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of resources composed into a single coherent clinical statement with\n    clinical attestation.\n    A set of healthcare-related information that is assembled together into a\n    single logical package that provides a single coherent statement of\n    meaning, establishes its own context and that has clinical attestation with\n    regard to who is making the statement. A Composition defines the structure\n    and narrative content necessary for a document. However, a Composition\n    alone does not constitute a document. Rather, the Composition must be the\n    first entry in a Bundle where Bundle.type=document, and any other resources\n    referenced from Composition must be included as subsequent entries in the\n    Bundle (for example Patient, Practitioner, Encounter, etc.).\n    \"\"\"\n\n    __resource_type__ = \"Composition\"\n\n    attester: typing.List[fhirtypes.CompositionAttesterType] | None = Field(\n        default=None,\n        alias=\"attester\",\n        title=\"Attests to accuracy of composition\",\n        description=(\n            \"A participant who has attested to the accuracy of the \"\n            \"composition/document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    author: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"author\",\n        title=\"Who and/or what authored the composition\",\n        description=(\n            \"Identifies who is responsible for the information in the composition, \"\n            \"not necessarily who typed it in.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Categorization of Composition\",\n        description=(\n            \"A categorization for the type of the composition - helps for indexing \"\n            \"and searching. This may be implied by or derived from the code \"\n            \"specified in the Composition Type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    confidentiality: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"confidentiality\",\n        title=\"As defined by affinity domain\",\n        description=\"The code specifying the level of confidentiality of the Composition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    confidentiality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_confidentiality\",\n        title=\"Extension field for ``confidentiality``.\",\n    )\n\n    custodian: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"custodian\",\n        title=\"Organization which maintains the composition\",\n        description=(\n            \"Identifies the organization or group who is responsible for ongoing \"\n            \"maintenance of and access to the composition/document information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Composition editing time\",\n        description=(\n            \"The composition editing time, when the composition was last logically \"\n            \"changed by the author.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Context of the Composition\",\n        description=(\n            \"Describes the clinical encounter or type of care this documentation is\"\n            \" associated with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    event: typing.List[fhirtypes.CompositionEventType] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"The clinical service(s) being documented\",\n        description=(\n            \"The clinical service, such as a colonoscopy or an appendectomy, being \"\n            \"documented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Version-independent identifier for the Composition\",\n        description=(\n            \"A version-independent identifier for the Composition. This identifier \"\n            \"stays constant as the composition is changed over time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatesTo: typing.List[fhirtypes.CompositionRelatesToType] | None = Field(\n        default=None,\n        alias=\"relatesTo\",\n        title=\"Relationships to other compositions/documents\",\n        description=(\n            \"Relationships that this composition has with other compositions or \"\n            \"documents that already exist.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    section: typing.List[fhirtypes.CompositionSectionType] | None = Field(\n        default=None,\n        alias=\"section\",\n        title=\"Composition is broken into sections\",\n        description=\"The root of the sections that make up the composition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"preliminary | final | amended | entered-in-error\",\n        description=(\n            \"The workflow/clinical status of this composition. The status is a \"\n            \"marker for the clinical standing of the document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"preliminary\", \"final\", \"amended\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who and/or what the composition is about\",\n        description=(\n            \"Who or what the composition is about. The composition can be about a \"\n            \"person, (patient or healthcare practitioner), a device (e.g. a \"\n            \"machine) or even a group of subjects (such as a document about a herd \"\n            \"of livestock, or a set of patients that share a common exposure).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Human Readable name/title\",\n        description=\"Official human-readable label for the composition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Kind of composition (LOINC if possible)\",\n        description=(\n            \"Specifies the particular kind of composition (e.g. History and \"\n            \"Physical, Discharge Summary, Progress Note). This usually equates to \"\n            \"the purpose of making the composition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Composition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"category\",\n            \"subject\",\n            \"encounter\",\n            \"date\",\n            \"author\",\n            \"title\",\n            \"confidentiality\",\n            \"attester\",\n            \"custodian\",\n            \"relatesTo\",\n            \"event\",\n            \"section\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Composition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"category\",\n            \"subject\",\n            \"encounter\",\n            \"date\",\n            \"author\",\n            \"title\",\n            \"confidentiality\",\n            \"custodian\",\n            \"event\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"date\", \"date__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"title\", \"title__ext\"),\n        ]\n        return required_fields\n\n\nclass CompositionAttester(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Attests to accuracy of composition.\n    A participant who has attested to the accuracy of the composition/document.\n    \"\"\"\n\n    __resource_type__ = \"CompositionAttester\"\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"personal | professional | legal | official\",\n        description=\"The type of attestation the authenticator offers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"personal\", \"professional\", \"legal\", \"official\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    party: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"party\",\n        title=\"Who attested the composition\",\n        description=\"Who attested the composition in the specified way.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    time: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"time\",\n        title=\"When the composition was attested\",\n        description=\"When the composition was attested by the party.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_time\", title=\"Extension field for ``time``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompositionAttester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"mode\", \"time\", \"party\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompositionAttester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\")]\n        return required_fields\n\n\nclass CompositionEvent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The clinical service(s) being documented.\n    The clinical service, such as a colonoscopy or an appendectomy, being\n    documented.\n    \"\"\"\n\n    __resource_type__ = \"CompositionEvent\"\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code(s) that apply to the event being documented\",\n        description=(\n            \"This list of codes represents the main clinical acts, such as a \"\n            \"colonoscopy or an appendectomy, being documented. In some cases, the \"\n            'event is inherent in the typeCode, such as a \"History and Physical '\n            'Report\" in which the procedure being documented is necessarily a '\n            '\"History and Physical\" act.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"The event(s) being documented\",\n        description=(\n            \"The description and/or reference of the event(s) being documented. For\"\n            \" example, this could be used to document such a colonoscopy or an \"\n            \"appendectomy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"The period covered by the documentation\",\n        description=(\n            \"The period of time covered by the documentation. There is no assertion\"\n            \" that the documentation is a complete representation for this period, \"\n            \"only that it documents events during this time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompositionEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"period\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompositionEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"period\", \"detail\"]\n\n\nclass CompositionRelatesTo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationships to other compositions/documents.\n    Relationships that this composition has with other compositions or\n    documents that already exist.\n    \"\"\"\n\n    __resource_type__ = \"CompositionRelatesTo\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"replaces | transforms | signs | appends\",\n        description=(\n            \"The type of relationship that this composition has with anther \"\n            \"composition or document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"replaces\", \"transforms\", \"signs\", \"appends\"],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    targetIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"targetIdentifier\",\n        title=\"Target of the relationship\",\n        description=\"The target composition/document of this relationship.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    targetReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"targetReference\",\n        title=\"Target of the relationship\",\n        description=\"The target composition/document of this relationship.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Composition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompositionRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"targetIdentifier\",\n            \"targetReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompositionRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"target\": [\"targetIdentifier\", \"targetReference\"]}\n        return one_of_many_fields\n\n\nclass CompositionSection(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Composition is broken into sections.\n    The root of the sections that make up the composition.\n    \"\"\"\n\n    __resource_type__ = \"CompositionSection\"\n\n    author: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who and/or what authored the section\",\n        description=(\n            \"Identifies who is responsible for the information in this section, not\"\n            \" necessarily who typed it in.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Classification of section (recommended)\",\n        description=(\n            \"A code identifying the kind of content contained within the section. \"\n            \"This must be consistent with the section title.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    emptyReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"emptyReason\",\n        title=\"Why the section is empty\",\n        description=(\n            \"If the section is empty, why the list is empty. An empty section \"\n            \"typically has some text explaining the empty reason.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entry: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"entry\",\n        title=\"A reference to data that supports this section\",\n        description=(\n            \"A reference to the actual resource from which the narrative in the \"\n            \"section is derived.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    focus: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=(\n            \"Who/what the section is about, when it is not about the subject of \"\n            \"composition\"\n        ),\n        description=(\n            \"The actual focus of the section when it is not the subject of the \"\n            \"composition, but instead represents something or someone associated \"\n            \"with the subject such as (for a patient subject) a spouse, parent, \"\n            \"fetus, or donor. If not focus is specified, the focus is assumed to be\"\n            \" focus of the parent section, or, for a section in the Composition \"\n            \"itself, the subject of the composition. Sections with a focus SHALL \"\n            \"only include resources where the logical subject (patient, subject, \"\n            \"focus, etc.) matches the section focus, or the resources have no \"\n            \"logical subject (few resources).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"working | snapshot | changes\",\n        description=(\n            \"How the entry list was prepared - whether it is a working list that is\"\n            \" suitable for being maintained on an ongoing basis, or if it \"\n            \"represents a snapshot of a list of items from another source, or \"\n            \"whether it is a prepared list where items may be marked as added, \"\n            \"modified or deleted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"working\", \"snapshot\", \"changes\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    orderedBy: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"orderedBy\",\n        title=\"Order of section entries\",\n        description=\"Specifies the order applied to the items in the section entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    section: typing.List[fhirtypes.CompositionSectionType] | None = Field(\n        default=None,\n        alias=\"section\",\n        title=\"Nested Section\",\n        description=\"A nested sub-section within this section.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.NarrativeType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text summary of the section, for human interpretation\",\n        description=(\n            \"A human-readable narrative that contains the attested content of the \"\n            \"section, used to represent the content of the resource to a human. The\"\n            \" narrative need not encode all the structured data, but is required to\"\n            ' contain sufficient detail to make it \"clinically safe\" for a human to'\n            \" just read the narrative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label for section (e.g. for ToC)\",\n        description=(\n            \"The label for this particular section.  This will be part of the \"\n            \"rendered content for the document, and is often used to build a table \"\n            \"of contents.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompositionSection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"title\",\n            \"code\",\n            \"author\",\n            \"focus\",\n            \"text\",\n            \"mode\",\n            \"orderedBy\",\n            \"entry\",\n            \"emptyReason\",\n            \"section\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompositionSection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/conceptmap.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ConceptMap\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ConceptMap(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A map from one set of concepts to one or more other concepts.\n    A statement of relationships from one set of concepts to one or more other\n    concepts - either concepts in code systems, or data element/data element\n    concepts, or classes in class models.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMap\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the concept map and/or its contents.\"\n            \" Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the concept map was published. \"\n            \"The date must change when the business version changes and it must \"\n            \"change if the status code changes. In addition, it should change when \"\n            \"the substantive content of the concept map changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the concept map\",\n        description=(\n            \"A free text natural language description of the concept map from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this concept map is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    group: typing.List[fhirtypes.ConceptMapGroupType] | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"Same source and target systems\",\n        description=\"A group of mappings that all have the same source and target system.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the concept map\",\n        description=(\n            \"A formal identifier that is used to identify this concept map when it \"\n            \"is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for concept map (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the concept map is intended to \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this concept map (computer friendly)\",\n        description=(\n            \"A natural language name identifying the concept map. This name should \"\n            \"be usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the concept \"\n            \"map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this concept map is defined\",\n        description=(\n            \"Explanation of why this concept map is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    sourceCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"sourceCanonical\",\n        title=\"The source value set that contains the concepts that are being mapped\",\n        description=(\n            \"Identifier for the source value set that contains the concepts that \"\n            \"are being mapped and provides context for the mappings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    sourceCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sourceCanonical\",\n        title=\"Extension field for ``sourceCanonical``.\",\n    )\n\n    sourceUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"sourceUri\",\n        title=\"The source value set that contains the concepts that are being mapped\",\n        description=(\n            \"Identifier for the source value set that contains the concepts that \"\n            \"are being mapped and provides context for the mappings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n    sourceUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceUri\", title=\"Extension field for ``sourceUri``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this concept map. Enables tracking the life-cycle of the\"\n            \" content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    targetCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"targetCanonical\",\n        title=\"The target value set which provides context for the mappings\",\n        description=(\n            \"The target value set provides context for the mappings. Note that the \"\n            \"mapping is made between concepts, not between value sets, but the \"\n            \"value set provides important context about how the concept mapping \"\n            \"choices are made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    targetCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_targetCanonical\",\n        title=\"Extension field for ``targetCanonical``.\",\n    )\n\n    targetUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"targetUri\",\n        title=\"The target value set which provides context for the mappings\",\n        description=(\n            \"The target value set provides context for the mappings. Note that the \"\n            \"mapping is made between concepts, not between value sets, but the \"\n            \"value set provides important context about how the concept mapping \"\n            \"choices are made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": False,\n        },\n    )\n    targetUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_targetUri\", title=\"Extension field for ``targetUri``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this concept map (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the concept map.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this concept map, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this concept map when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this concept map is (or will be) published. This URL can \"\n            \"be the target of a canonical reference. It SHALL remain the same when \"\n            \"the concept map is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate concept map instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the concept map\",\n        description=(\n            \"The identifier that is used to identify this version of the concept \"\n            \"map when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the concept map author\"\n            \" and is not expected to be globally unique. For example, it might be a\"\n            \" timestamp (e.g. yyyymmdd) if a managed version is not available. \"\n            \"There is also no expectation that versions can be placed in a \"\n            \"lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMap`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"sourceUri\",\n            \"sourceCanonical\",\n            \"targetUri\",\n            \"targetCanonical\",\n            \"group\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMap`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"sourceUri\",\n            \"sourceCanonical\",\n            \"targetUri\",\n            \"targetCanonical\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"source\": [\"sourceCanonical\", \"sourceUri\"],\n            \"target\": [\"targetCanonical\", \"targetUri\"],\n        }\n        return one_of_many_fields\n\n\nclass ConceptMapGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Same source and target systems.\n    A group of mappings that all have the same source and target system.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroup\"\n\n    element: typing.List[fhirtypes.ConceptMapGroupElementType] = Field(\n        default=...,\n        alias=\"element\",\n        title=\"Mappings for a concept from the source set\",\n        description=(\n            \"Mappings for an individual concept in the source to one or more \"\n            \"concepts in the target.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    source: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Source system where concepts to be mapped are defined\",\n        description=(\n            \"An absolute URI that identifies the source system where the concepts \"\n            \"to be mapped are defined.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    sourceVersion: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sourceVersion\",\n        title=\"Specific version of the  code system\",\n        description=(\n            \"The specific version of the code system, as determined by the code \"\n            \"system authority.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sourceVersion\",\n        title=\"Extension field for ``sourceVersion``.\",\n    )\n\n    target: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Target system that the concepts are to be mapped to\",\n        description=(\n            \"An absolute URI that identifies the target system that the concepts \"\n            \"will be mapped to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    target__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_target\", title=\"Extension field for ``target``.\"\n    )\n\n    targetVersion: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"targetVersion\",\n        title=\"Specific version of the  code system\",\n        description=(\n            \"The specific version of the code system, as determined by the code \"\n            \"system authority.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    targetVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_targetVersion\",\n        title=\"Extension field for ``targetVersion``.\",\n    )\n\n    unmapped: fhirtypes.ConceptMapGroupUnmappedType | None = Field(\n        default=None,\n        alias=\"unmapped\",\n        title=\"What to do when there is no mapping for the source concept\",\n        description=(\n            'What to do when there is no mapping for the source concept. \"Unmapped\"'\n            \" does not include codes that are unmatched, and the unmapped element \"\n            \"is ignored in a code is specified to have equivalence = unmatched.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"source\",\n            \"sourceVersion\",\n            \"target\",\n            \"targetVersion\",\n            \"element\",\n            \"unmapped\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConceptMapGroupElement(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Mappings for a concept from the source set.\n    Mappings for an individual concept in the source to one or more concepts in\n    the target.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupElement\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Identifies element being mapped\",\n        description=\"Identity (code or path) or the element/item being mapped.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Display for the code\",\n        description=(\n            \"The display for the code. The display is only provided to help editors\"\n            \" when editing the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    target: typing.List[fhirtypes.ConceptMapGroupElementTargetType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Concept in target system for element\",\n        description=\"A concept from the target value set that this concept maps to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"display\", \"target\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConceptMapGroupElementTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Concept in target system for element.\n    A concept from the target value set that this concept maps to.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupElementTarget\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies the target element\",\n        description=\"Identity (code or path) or the element/item that the map refers to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Description of status/issues in mapping\",\n        description=(\n            \"A description of status/issues in mapping that conveys additional \"\n            \"information not represented in  the structured data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    dependsOn: typing.List[\n        fhirtypes.ConceptMapGroupElementTargetDependsOnType\n    ] | None = Field(\n        default=None,\n        alias=\"dependsOn\",\n        title=\"Other elements required for this mapping (from context)\",\n        description=(\n            \"A set of additional dependencies for this mapping to hold. This \"\n            \"mapping is only applicable if the specified element can be resolved, \"\n            \"and it has the specified value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Display for the code\",\n        description=(\n            \"The display for the code. The display is only provided to help editors\"\n            \" when editing the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    equivalence: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"equivalence\",\n        title=(\n            \"relatedto | equivalent | equal | wider | subsumes | narrower | \"\n            \"specializes | inexact | unmatched | disjoint\"\n        ),\n        description=(\n            \"The equivalence between the source and target concepts (counting for \"\n            \"the dependencies and products). The equivalence is read from target to\"\n            \" source (e.g. the target is 'wider' than the source).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"relatedto\",\n                \"equivalent\",\n                \"equal\",\n                \"wider\",\n                \"subsumes\",\n                \"narrower\",\n                \"specializes\",\n                \"inexact\",\n                \"unmatched\",\n                \"disjoint\",\n            ],\n        },\n    )\n    equivalence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_equivalence\", title=\"Extension field for ``equivalence``.\"\n    )\n\n    product: typing.List[\n        fhirtypes.ConceptMapGroupElementTargetDependsOnType\n    ] | None = Field(\n        default=None,\n        alias=\"product\",\n        title=\"Other concepts that this mapping also produces\",\n        description=(\n            \"A set of additional outcomes from this mapping to other elements. To \"\n            \"properly execute this mapping, the specified element must be mapped to\"\n            \" some data element or source that is in context. The mapping may still\"\n            \" be useful without a place for the additional data elements, but the \"\n            \"equivalence cannot be relied on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupElementTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"display\",\n            \"equivalence\",\n            \"comment\",\n            \"dependsOn\",\n            \"product\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"equivalence\", \"equivalence__ext\")]\n        return required_fields\n\n\nclass ConceptMapGroupElementTargetDependsOn(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Other elements required for this mapping (from context).\n    A set of additional dependencies for this mapping to hold. This mapping is\n    only applicable if the specified element can be resolved, and it has the\n    specified value.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupElementTargetDependsOn\"\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Display for the code (if value is a code)\",\n        description=(\n            \"The display for the code. The display is only provided to help editors\"\n            \" when editing the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    property: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Reference to property mapping depends on\",\n        description=(\n            \"A reference to an element that holds a coded value that corresponds to\"\n            \" a code system property. The idea is that the information model \"\n            \"carries an element somewhere that is labeled to correspond with a code\"\n            \" system property.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    property__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_property\", title=\"Extension field for ``property``.\"\n    )\n\n    system: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"Code System (if necessary)\",\n        description=(\n            \"An absolute URI that identifies the code system of the dependency code\"\n            \" (if the source/dependency is a value set that crosses code systems).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CodeSystem\"],\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Value of the referenced element\",\n        description=(\n            \"Identity (code or path) or the element/item/ValueSet/text that the map\"\n            \" depends on / refers to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupElementTargetDependsOn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"property\",\n            \"system\",\n            \"value\",\n            \"display\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTargetDependsOn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"property\", \"property__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass ConceptMapGroupUnmapped(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What to do when there is no mapping for the source concept.\n    What to do when there is no mapping for the source concept. \"Unmapped\" does\n    not include codes that are unmatched, and the unmapped element is ignored\n    in a code is specified to have equivalence = unmatched.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupUnmapped\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Fixed code when mode = fixed\",\n        description=(\n            \"The fixed code to use when the mode = 'fixed'  - all unmapped codes \"\n            \"are mapped to a single fixed code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Display for the code\",\n        description=(\n            \"The display for the code. The display is only provided to help editors\"\n            \" when editing the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"provided | fixed | other-map\",\n        description=(\n            \"Defines which action to take if there is no match for the source \"\n            \"concept in the target system designated for the group. One of 3 \"\n            \"actions are possible: use the unmapped code (this is useful when doing\"\n            \" a mapping between versions, and only a few codes have changed), use a\"\n            \" fixed code (a default code), or alternatively, a reference to a \"\n            \"different concept map can be provided (by canonical URL).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"provided\", \"fixed\", \"other-map\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    url: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"canonical reference to an additional ConceptMap to use for mapping if \"\n            \"the source concept is unmapped\"\n        ),\n        description=(\n            \"The canonical reference to an additional ConceptMap resource instance \"\n            \"to use for mapping if this ConceptMap resource contains no matching \"\n            \"mapping for the source concept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ConceptMap\"],\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupUnmapped`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"mode\",\n            \"code\",\n            \"display\",\n            \"url\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupUnmapped`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/condition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Condition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Condition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Detailed information about conditions, problems or diagnoses.\n    A clinical condition, problem, diagnosis, or other event, situation, issue,\n    or clinical concept that has risen to a level of concern.\n    \"\"\"\n\n    __resource_type__ = \"Condition\"\n\n    abatementAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"abatementAge\",\n        title=\"When in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Conditions '\n            \"are never really resolved, but they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    abatementDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"abatementDateTime\",\n        title=\"When in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Conditions '\n            \"are never really resolved, but they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n    abatementDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_abatementDateTime\",\n        title=\"Extension field for ``abatementDateTime``.\",\n    )\n\n    abatementPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"abatementPeriod\",\n        title=\"When in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Conditions '\n            \"are never really resolved, but they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    abatementRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"abatementRange\",\n        title=\"When in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Conditions '\n            \"are never really resolved, but they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    abatementString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"abatementString\",\n        title=\"When in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Conditions '\n            \"are never really resolved, but they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n    abatementString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_abatementString\",\n        title=\"Extension field for ``abatementString``.\",\n    )\n\n    asserter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"asserter\",\n        title=\"Person who asserts this condition\",\n        description=\"Individual who is making the condition statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical location, if relevant\",\n        description=\"The anatomical location where this condition manifests itself.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"problem-list-item | encounter-diagnosis\",\n        description=\"A category assigned to the condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    clinicalStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"clinicalStatus\",\n        title=\"active | recurrence | relapse | inactive | remission | resolved\",\n        description=\"The clinical status of the condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Identification of the condition, problem or diagnosis\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter created as part of\",\n        description=(\n            \"The Encounter during which this Condition was created or to which the \"\n            \"creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    evidence: typing.List[fhirtypes.ConditionEvidenceType] | None = Field(\n        default=None,\n        alias=\"evidence\",\n        title=\"Supporting evidence\",\n        description=(\n            \"Supporting evidence / manifestations that are the basis of the \"\n            \"Condition's verification status, such as evidence that confirmed or \"\n            \"refuted the condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this condition\",\n        description=(\n            \"Business identifiers assigned to this condition by the performer or \"\n            \"other systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional information about the Condition\",\n        description=(\n            \"Additional information about the Condition. This is a general \"\n            \"notes/comments entry  for description of the Condition, its diagnosis \"\n            \"and prognosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onsetAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"onsetAge\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"onsetDateTime\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_onsetDateTime\",\n        title=\"Extension field for ``onsetDateTime``.\",\n    )\n\n    onsetPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"onsetPeriod\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"onsetRange\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"onsetString\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onsetString\", title=\"Extension field for ``onsetString``.\"\n    )\n\n    recordedDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recordedDate\",\n        title=\"Date record was first recorded\",\n        description=(\n            \"The recordedDate represents when this particular Condition record was \"\n            \"created in the system, which is often a system-generated date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    recordedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_recordedDate\",\n        title=\"Extension field for ``recordedDate``.\",\n    )\n\n    recorder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recorder\",\n        title=\"Who recorded the condition\",\n        description=(\n            \"Individual who recorded the record and takes responsibility for its \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    severity: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"Subjective severity of condition\",\n        description=(\n            \"A subjective assessment of the severity of the condition as evaluated \"\n            \"by the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    stage: typing.List[fhirtypes.ConditionStageType] | None = Field(\n        default=None,\n        alias=\"stage\",\n        title=\"Stage/grade, usually assessed formally\",\n        description=(\n            \"Clinical stage or grade of a condition. May include formal severity \"\n            \"assessments.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who has the condition?\",\n        description=(\n            \"Indicates the patient or group who the condition record is associated \"\n            \"with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    verificationStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"verificationStatus\",\n        title=(\n            \"unconfirmed | provisional | differential | confirmed | refuted | \"\n            \"entered-in-error\"\n        ),\n        description=(\n            \"The verification status to support the clinical status of the \"\n            \"condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Condition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"clinicalStatus\",\n            \"verificationStatus\",\n            \"category\",\n            \"severity\",\n            \"code\",\n            \"bodySite\",\n            \"subject\",\n            \"encounter\",\n            \"onsetDateTime\",\n            \"onsetAge\",\n            \"onsetPeriod\",\n            \"onsetRange\",\n            \"onsetString\",\n            \"abatementDateTime\",\n            \"abatementAge\",\n            \"abatementPeriod\",\n            \"abatementRange\",\n            \"abatementString\",\n            \"recordedDate\",\n            \"recorder\",\n            \"asserter\",\n            \"stage\",\n            \"evidence\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Condition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"clinicalStatus\",\n            \"verificationStatus\",\n            \"code\",\n            \"bodySite\",\n            \"subject\",\n            \"encounter\",\n            \"onsetDateTime\",\n            \"onsetAge\",\n            \"onsetPeriod\",\n            \"onsetRange\",\n            \"onsetString\",\n            \"recordedDate\",\n            \"recorder\",\n            \"asserter\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"abatement\": [\n                \"abatementAge\",\n                \"abatementDateTime\",\n                \"abatementPeriod\",\n                \"abatementRange\",\n                \"abatementString\",\n            ],\n            \"onset\": [\n                \"onsetAge\",\n                \"onsetDateTime\",\n                \"onsetPeriod\",\n                \"onsetRange\",\n                \"onsetString\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ConditionEvidence(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supporting evidence.\n    Supporting evidence / manifestations that are the basis of the Condition's\n    verification status, such as evidence that confirmed or refuted the\n    condition.\n    \"\"\"\n\n    __resource_type__ = \"ConditionEvidence\"\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Manifestation/symptom\",\n        description=(\n            \"A manifestation or symptom that led to the recording of this \" \"condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Supporting information found elsewhere\",\n        description=\"Links to other relevant information, including pathology reports.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConditionEvidence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConditionEvidence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"detail\"]\n\n\nclass ConditionStage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stage/grade, usually assessed formally.\n    Clinical stage or grade of a condition. May include formal severity\n    assessments.\n    \"\"\"\n\n    __resource_type__ = \"ConditionStage\"\n\n    assessment: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"assessment\",\n        title=\"Formal record of assessment\",\n        description=(\n            \"Reference to a formal record of the evidence on which the staging \"\n            \"assessment is based.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"ClinicalImpression\",\n                \"DiagnosticReport\",\n                \"Observation\",\n            ],\n        },\n    )\n\n    summary: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"summary\",\n        title=\"Simple summary (disease specific)\",\n        description=(\n            'A simple summary of the stage such as \"Stage 3\". The determination of '\n            \"the stage is disease-specific.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of staging\",\n        description=\"The kind of staging, such as pathological or clinical staging.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConditionStage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"summary\", \"assessment\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConditionStage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/consent.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Consent\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Consent(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A healthcare consumer's  choices to permit or deny recipients or roles to\n    perform actions for specific purposes and periods of time.\n    A record of a healthcare consumer’s  choices, which permits or denies\n    identified recipient(s) or recipient role(s) to perform one or more actions\n    within a given policy context, for specific purposes and periods of time.\n    \"\"\"\n\n    __resource_type__ = \"Consent\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Classification of the consent statement - for indexing/retrieval\",\n        description=(\n            \"A classification of the type of consents found in the statement. This \"\n            \"element supports indexing and retrieval of consent statements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateTime\",\n        title=\"When this Consent was created or indexed\",\n        description=\"When this  Consent was issued / created / indexed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    dateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dateTime\", title=\"Extension field for ``dateTime``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier for this record (external references)\",\n        description=\"Unique identifier for this copy of the Consent Statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    organization: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Custodian of the consent\",\n        description=(\n            \"The organization that manages the consent, and the framework within \"\n            \"which it is executed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"Who the consent applies to\",\n        description=\"The patient/healthcare consumer to whom this consent applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who is agreeing to the policy and rules\",\n        description=(\n            \"Either the Grantor, which is the entity responsible for granting the \"\n            \"rights listed in a Consent Directive or the Grantee, which is the \"\n            \"entity responsible for complying with the Consent Directive, including\"\n            \" any obligations or limitations on authorizations and enforcement of \"\n            \"prohibitions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    policy: typing.List[fhirtypes.ConsentPolicyType] | None = Field(\n        default=None,\n        alias=\"policy\",\n        title=\"Policies covered by this consent\",\n        description=(\n            \"The references to the policies that are included in this consent \"\n            \"scope. Policies may be organizational, but are often defined \"\n            \"jurisdictionally, or in law.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    policyRule: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"policyRule\",\n        title=\"Regulation that this consents to\",\n        description=\"A reference to the specific base computable regulation or policy.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    provision: fhirtypes.ConsentProvisionType | None = Field(\n        default=None,\n        alias=\"provision\",\n        title=\"Constraints to the base Consent.policyRule\",\n        description=(\n            \"An exception to the base policy of this consent. An exception can be \"\n            \"an addition or removal of access permissions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    scope: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"scope\",\n        title=\"Which of the four areas this resource covers (extensible)\",\n        description=(\n            \"A selector of the type of consent being presented: ADR, Privacy, \"\n            \"Treatment, Research.  This list is now extensible.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sourceAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"sourceAttachment\",\n        title=\"Source from which this consent is taken\",\n        description=(\n            \"The source on which this consent statement is based. The source might \"\n            \"be a scanned original paper form, or a reference to a consent that \"\n            \"links back to such a source, a reference to a document repository \"\n            \"(e.g. XDS) that stores the original consent document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    sourceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sourceReference\",\n        title=\"Source from which this consent is taken\",\n        description=(\n            \"The source on which this consent statement is based. The source might \"\n            \"be a scanned original paper form, or a reference to a consent that \"\n            \"links back to such a source, a reference to a document repository \"\n            \"(e.g. XDS) that stores the original consent document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Consent\",\n                \"DocumentReference\",\n                \"Contract\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | proposed | active | rejected | inactive | entered-in-error\",\n        description=\"Indicates the current state of this consent.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"proposed\",\n                \"active\",\n                \"rejected\",\n                \"inactive\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    verification: typing.List[fhirtypes.ConsentVerificationType] | None = Field(\n        default=None,\n        alias=\"verification\",\n        title=\"Consent Verified by patient or family\",\n        description=(\n            \"Whether a treatment instruction (e.g. artificial respiration yes or \"\n            \"no) was verified with the patient, his/her family or another \"\n            \"authorized person.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Consent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"scope\",\n            \"category\",\n            \"patient\",\n            \"dateTime\",\n            \"performer\",\n            \"organization\",\n            \"sourceAttachment\",\n            \"sourceReference\",\n            \"policy\",\n            \"policyRule\",\n            \"verification\",\n            \"provision\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Consent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"scope\",\n            \"category\",\n            \"patient\",\n            \"dateTime\",\n            \"performer\",\n            \"organization\",\n            \"sourceAttachment\",\n            \"sourceReference\",\n            \"policyRule\",\n            \"verification\",\n            \"provision\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"source\": [\"sourceAttachment\", \"sourceReference\"]}\n        return one_of_many_fields\n\n\nclass ConsentPolicy(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Policies covered by this consent.\n    The references to the policies that are included in this consent scope.\n    Policies may be organizational, but are often defined jurisdictionally, or\n    in law.\n    \"\"\"\n\n    __resource_type__ = \"ConsentPolicy\"\n\n    authority: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Enforcement source for policy\",\n        description=(\n            \"Entity or Organization having regulatory jurisdiction or \"\n            \"accountability for  enforcing policies pertaining to Consent \"\n            \"Directives.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authority\", title=\"Extension field for ``authority``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Specific policy covered by this consent\",\n        description=(\n            \"The references to the policies that are included in this consent \"\n            \"scope. Policies may be organizational, but are often defined \"\n            \"jurisdictionally, or in law.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentPolicy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"authority\", \"uri\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentPolicy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConsentProvision(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Constraints to the base Consent.policyRule.\n    An exception to the base policy of this consent. An exception can be an\n    addition or removal of access permissions.\n    \"\"\"\n\n    __resource_type__ = \"ConsentProvision\"\n\n    action: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Actions controlled by this rule\",\n        description=\"Actions controlled by this Rule.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    actor: typing.List[fhirtypes.ConsentProvisionActorType] | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Who|what controlled by this rule (or group, by role)\",\n        description=(\n            \"Who or what is controlled by this rule. Use group to identify a set of\"\n            \" actors by some property they share (e.g. 'admitting officers').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    class_fhir: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"class\",\n        title=\"e.g. Resource Type, Profile, CDA, etc.\",\n        description=(\n            \"The class of information covered by this rule. The type can be a FHIR \"\n            \"resource type, a profile on a type, or a CDA document, or some other \"\n            \"type that indicates what sort of information the consent relates to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"e.g. LOINC or SNOMED CT code, etc. in the content\",\n        description=\"If this code is found in an instance, then the rule applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    data: typing.List[fhirtypes.ConsentProvisionDataType] | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"Data controlled by this rule\",\n        description=(\n            \"The resources controlled by this rule if specific resources are \"\n            \"referenced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dataPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"dataPeriod\",\n        title=\"Timeframe for data controlled by this rule\",\n        description=(\n            \"Clinical or Operational Relevant period of time that bounds the data \"\n            \"controlled by this rule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Timeframe for this rule\",\n        description=\"The timeframe in this rule is valid.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    provision: typing.List[fhirtypes.ConsentProvisionType] | None = Field(\n        default=None,\n        alias=\"provision\",\n        title=\"Nested Exception Rules\",\n        description=\"Rules which provide exceptions to the base rule or subrules.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    purpose: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Context of activities covered by this rule\",\n        description=(\n            \"The context of the activities a user is taking - why the user is \"\n            \"accessing the data - that are controlled by this rule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Security Labels that define affected resources\",\n        description=(\n            \"A security label, comprised of 0..* security label fields (Privacy \"\n            \"tags), which define which resources are controlled by this exception.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"deny | permit\",\n        description=(\n            \"Action  to take - permit or deny - when the rule conditions are met.  \"\n            \"Not permitted in root rule, required in all nested rules.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"deny\", \"permit\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentProvision`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"period\",\n            \"actor\",\n            \"action\",\n            \"securityLabel\",\n            \"purpose\",\n            \"class\",\n            \"code\",\n            \"dataPeriod\",\n            \"data\",\n            \"provision\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentProvision`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"period\",\n            \"action\",\n            \"securityLabel\",\n            \"purpose\",\n            \"class\",\n            \"code\",\n            \"dataPeriod\",\n            \"data\",\n        ]\n\n\nclass ConsentProvisionActor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who|what controlled by this rule (or group, by role).\n    Who or what is controlled by this rule. Use group to identify a set of\n    actors by some property they share (e.g. 'admitting officers').\n    \"\"\"\n\n    __resource_type__ = \"ConsentProvisionActor\"\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Resource for the actor (or group, by role)\",\n        description=(\n            \"The resource that identifies the actor. To identify actors by type, \"\n            \"use group to identify a set of actors by some property they share \"\n            \"(e.g. 'admitting officers').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Group\",\n                \"CareTeam\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"role\",\n        title=\"How the actor is involved\",\n        description=(\n            \"How the individual is involved in the resources content that is \"\n            \"described in the exception.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentProvisionActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentProvisionActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConsentProvisionData(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Data controlled by this rule.\n    The resources controlled by this rule if specific resources are referenced.\n    \"\"\"\n\n    __resource_type__ = \"ConsentProvisionData\"\n\n    meaning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"meaning\",\n        title=\"instance | related | dependents | authoredby\",\n        description=(\n            \"How the resource reference is interpreted when testing consent \"\n            \"restrictions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"related\", \"dependents\", \"authoredby\"],\n        },\n    )\n    meaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_meaning\", title=\"Extension field for ``meaning``.\"\n    )\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"The actual data reference\",\n        description=(\n            \"A reference to a specific resource that defines which resources are \"\n            \"covered by this consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentProvisionData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"meaning\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentProvisionData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"meaning\", \"reference\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"meaning\", \"meaning__ext\")]\n        return required_fields\n\n\nclass ConsentVerification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Consent Verified by patient or family.\n    Whether a treatment instruction (e.g. artificial respiration yes or no) was\n    verified with the patient, his/her family or another authorized person.\n    \"\"\"\n\n    __resource_type__ = \"ConsentVerification\"\n\n    verificationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"verificationDate\",\n        title=\"When consent verified\",\n        description=\"Date verification was collected.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    verificationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_verificationDate\",\n        title=\"Extension field for ``verificationDate``.\",\n    )\n\n    verified: bool | None = Field(\n        default=None,\n        alias=\"verified\",\n        title=\"Has been verified\",\n        description=\"Has the instruction been verified.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    verified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_verified\", title=\"Extension field for ``verified``.\"\n    )\n\n    verifiedWith: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"verifiedWith\",\n        title=\"Person who verified\",\n        description=(\n            \"Who verified the instruction (Patient, Relative or other Authorized \"\n            \"Person).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentVerification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"verified\",\n            \"verifiedWith\",\n            \"verificationDate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentVerification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"verified\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"verified\", \"verified__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/contactdetail.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ContactDetail\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass ContactDetail(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contact information.\n    Specifies contact information for a person or organization.\n    \"\"\"\n\n    __resource_type__ = \"ContactDetail\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of an individual to contact\",\n        description=\"The name of an individual to contact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contact details for individual or organization\",\n        description=(\n            \"The contact details for the individual (if a name was provided) or the\"\n            \" organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContactDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"name\", \"telecom\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContactDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"name\", \"telecom\"]\n"
  },
  {
    "path": "fhir/resources/R4B/contactpoint.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ContactPoint\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass ContactPoint(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of a Technology mediated contact point (phone, fax, email, etc.).\n    Details for all kinds of technology mediated contact points for a person or\n    organization, including telephone, email, etc.\n    \"\"\"\n\n    __resource_type__ = \"ContactPoint\"\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when the contact point was/is in use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    rank: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"rank\",\n        title=\"Specify preferred order of use (1 = highest)\",\n        description=(\n            \"Specifies a preferred order in which to use a set of contacts. \"\n            \"ContactPoints with lower rank values are more preferred than those \"\n            \"with higher rank values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rank\", title=\"Extension field for ``rank``.\"\n    )\n\n    system: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"phone | fax | email | pager | url | sms | other\",\n        description=(\n            \"Telecommunications form for contact point - what communications system\"\n            \" is required to make use of the contact.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"phone\", \"fax\", \"email\", \"pager\", \"url\", \"sms\", \"other\"],\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"home | work | temp | old | mobile - purpose of this contact point\",\n        description=\"Identifies the purpose for the contact point.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"home\", \"work\", \"temp\", \"old\", \"mobile\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The actual contact point details\",\n        description=(\n            \"The actual contact point details, in a form that is meaningful to the \"\n            \"designated communication system (i.e. phone number or email address).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContactPoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"system\", \"value\", \"use\", \"rank\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContactPoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"system\", \"value\", \"use\", \"rank\", \"period\"]\n"
  },
  {
    "path": "fhir/resources/R4B/contract.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Contract\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Contract(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Legal Agreement.\n    Legally enforceable, formally recorded unilateral or bilateral directive\n    i.e., a policy or agreement.\n    \"\"\"\n\n    __resource_type__ = \"Contract\"\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=\"Acronym or short name\",\n        description=(\n            \"Alternative representation of the title for this Contract definition, \"\n            \"derivative, or instance in any legal state., e.g., a domain specific \"\n            \"contract number related to legislation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    applies: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"applies\",\n        title=\"Effective time\",\n        description=\"Relevant time or time-period when this Contract is applicable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Source of Contract\",\n        description=(\n            \"The individual or organization that authored the Contract definition, \"\n            \"derivative, or instance in any legal state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    authority: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Authority under which this Contract has standing\",\n        description=(\n            \"A formally or informally recognized grouping of people, principals, \"\n            \"organizations, or jurisdictions formed for the purpose of achieving \"\n            \"some form of collective action such as the promulgation, \"\n            \"administration and enforcement of contracts and policies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    contentDefinition: fhirtypes.ContractContentDefinitionType | None = Field(\n        default=None,\n        alias=\"contentDefinition\",\n        title=\"Contract precursor content\",\n        description=(\n            \"Precusory content developed with a focus and intent of supporting the \"\n            \"formation a Contract instance, which may be associated with and \"\n            \"transformable into a Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contentDerivative: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"contentDerivative\",\n        title=\"Content derived from the basal information\",\n        description=(\n            \"The minimal content derived from the basal information source at a \"\n            \"specific stage in its lifecycle.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    domain: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"domain\",\n        title=(\n            \"A sphere of control governed by an authoritative jurisdiction, \"\n            \"organization, or person\"\n        ),\n        description=(\n            \"Recognized governance framework or system operating with a \"\n            \"circumscribed scope in accordance with specified principles, policies,\"\n            \" processes or procedures for managing rights, actions, or behaviors of\"\n            \" parties or principals relative to resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    expirationType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"expirationType\",\n        title=\"Contract cessation cause\",\n        description=(\n            \"Event resulting in discontinuation or termination of this Contract \"\n            \"instance by one or more parties to the contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    friendly: typing.List[fhirtypes.ContractFriendlyType] | None = Field(\n        default=None,\n        alias=\"friendly\",\n        title=\"Contract Friendly Language\",\n        description=(\n            'The \"patient friendly language\" versionof the Contract in whole or in '\n            'parts. \"Patient friendly language\" means the representation of the '\n            \"Contract and Contract Provisions in a manner that is readily \"\n            \"accessible and understandable by a layperson in accordance with best \"\n            \"practices for communication styles that ensure that those agreeing to \"\n            \"or signing the Contract understand the roles, actions, obligations, \"\n            \"responsibilities, and implication of the agreement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Contract number\",\n        description=(\n            \"Unique identifier for this Contract or a derivative that references a \"\n            \"Source Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Source Contract Definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined Contract Definition that is adhered\"\n            \" to in whole or part by this Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Contract\"],\n        },\n    )\n\n    instantiatesUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"External Contract Definition\",\n        description=(\n            \"The URL pointing to an externally maintained definition that is \"\n            \"adhered to in whole or in part by this Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    issued: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"When this Contract was issued\",\n        description=\"When this  Contract was issued.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    legal: typing.List[fhirtypes.ContractLegalType] | None = Field(\n        default=None,\n        alias=\"legal\",\n        title=\"Contract Legal Language\",\n        description=\"List of Legal expressions or representations of this Contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    legalState: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"legalState\",\n        title=\"Negotiation status\",\n        description=(\n            \"Legal states of the formation of a legal instrument, which is a \"\n            \"formally executed written document that can be formally attributed to \"\n            \"its author, records and formally expresses a legally enforceable act, \"\n            \"process, or contractual duty, obligation, or right, and therefore \"\n            \"evidences that act, process, or agreement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    legallyBindingAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"legallyBindingAttachment\",\n        title=\"Binding Contract\",\n        description=(\n            \"Legally binding Contract: This is the signed and legally recognized \"\n            'representation of the Contract, which is considered the \"source of '\n            'truth\" and which would be the basis for legal action related to '\n            \"enforcement of this Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e legallyBinding[x]\n            \"one_of_many\": \"legallyBinding\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    legallyBindingReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"legallyBindingReference\",\n        title=\"Binding Contract\",\n        description=(\n            \"Legally binding Contract: This is the signed and legally recognized \"\n            'representation of the Contract, which is considered the \"source of '\n            'truth\" and which would be the basis for legal action related to '\n            \"enforcement of this Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e legallyBinding[x]\n            \"one_of_many\": \"legallyBinding\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Composition\",\n                \"DocumentReference\",\n                \"QuestionnaireResponse\",\n                \"Contract\",\n            ],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Computer friendly designation\",\n        description=(\n            \"A natural language name identifying this Contract definition, \"\n            \"derivative, or instance in any legal state. Provides additional \"\n            \"information about its content. This name should be usable as an \"\n            \"identifier for the module by machine processing applications such as \"\n            \"code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Key event in Contract History\",\n        description=(\n            \"Links to Provenance records for past versions of this Contract \"\n            \"definition, derivative, or instance, which identify key state \"\n            \"transitions or updates that are likely to be relevant to a user \"\n            \"looking at the current version of the Contract.  The Provence.entity \"\n            \"indicates the target that was changed in the update. \"\n            \"http://build.fhir.org/provenance-definitions.html#Provenance.entity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    rule: typing.List[fhirtypes.ContractRuleType] | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"Computable Contract Language\",\n        description=(\n            \"List of Computable Policy Rule Language Representations of this \"\n            \"Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    scope: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"scope\",\n        title=\"Range of Legal Concerns\",\n        description=(\n            \"A selector of legal concerns for this Contract definition, derivative,\"\n            \" or instance in any legal state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    signer: typing.List[fhirtypes.ContractSignerType] | None = Field(\n        default=None,\n        alias=\"signer\",\n        title=\"Contract Signatory\",\n        description=(\n            \"Parties with legal standing in the Contract, including the principal \"\n            \"parties, the grantor(s) and grantee(s), which are any person or \"\n            \"organization bound by the contract, and any ancillary parties, which \"\n            \"facilitate the execution of the contract such as a notary or witness.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    site: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Specific Location\",\n        description=\"Sites in which the contract is complied with,  exercised, or in force.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"amended | appended | cancelled | disputed | entered-in-error | \"\n            \"executable | executed | negotiable | offered | policy | rejected | \"\n            \"renewed | revoked | resolved | terminated\"\n        ),\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"amended\",\n                \"appended\",\n                \"cancelled\",\n                \"disputed\",\n                \"entered-in-error\",\n                \"executable\",\n                \"executed\",\n                \"negotiable\",\n                \"offered\",\n                \"policy\",\n                \"rejected\",\n                \"renewed\",\n                \"revoked\",\n                \"resolved\",\n                \"terminated\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"Subtype within the context of type\",\n        description=(\n            \"Sub-category for the Contract that distinguishes the kinds of systems \"\n            \"that would be interested in the Contract within the context of the \"\n            \"Contract's scope.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Contract Target Entity\",\n        description=(\n            \"The target entity impacted by or of interest to parties to the \"\n            \"agreement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate Friendly name\",\n        description=(\n            \"An explanatory or alternate user-friendly title for this Contract \"\n            \"definition, derivative, or instance in any legal state.t giving \"\n            \"additional information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Extra Information\",\n        description=(\n            \"Information that may be needed by/relevant to the performer in their \"\n            \"execution of this term action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    term: typing.List[fhirtypes.ContractTermType] | None = Field(\n        default=None,\n        alias=\"term\",\n        title=\"Contract Term List\",\n        description=(\n            \"One or more Contract Provisions, which may be related and conveyed as \"\n            \"a group, and may contain nested groups.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Human Friendly name\",\n        description=(\n            \"A short, descriptive, user-friendly title for this Contract \"\n            \"definition, derivative, or instance in any legal state.t giving \"\n            \"additional information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topicCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"topicCodeableConcept\",\n        title=\"Focus of contract interest\",\n        description=(\n            \"Narrows the range of legal concerns to focus on the achievement of \"\n            \"specific contractual objectives.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e topic[x]\n            \"one_of_many\": \"topic\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    topicReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"topicReference\",\n        title=\"Focus of contract interest\",\n        description=(\n            \"Narrows the range of legal concerns to focus on the achievement of \"\n            \"specific contractual objectives.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e topic[x]\n            \"one_of_many\": \"topic\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Legal instrument category\",\n        description=(\n            \"A high-level category for the legal instrument, whether constructed as\"\n            \" a Contract definition, derivative, or instance in any legal state.  \"\n            \"Provides additional information about its content within the context \"\n            \"of the Contract's scope to distinguish the kinds of systems that would\"\n            \" be interested in the contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Basal definition\",\n        description=(\n            \"Canonical identifier for this contract, represented as a URI (globally\"\n            \" unique).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business edition\",\n        description=(\n            \"An edition identifier used for business purposes to label business \"\n            \"significant variants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Contract`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"url\",\n            \"version\",\n            \"status\",\n            \"legalState\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"contentDerivative\",\n            \"issued\",\n            \"applies\",\n            \"expirationType\",\n            \"subject\",\n            \"authority\",\n            \"domain\",\n            \"site\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"alias\",\n            \"author\",\n            \"scope\",\n            \"topicCodeableConcept\",\n            \"topicReference\",\n            \"type\",\n            \"subType\",\n            \"contentDefinition\",\n            \"term\",\n            \"supportingInfo\",\n            \"relevantHistory\",\n            \"signer\",\n            \"friendly\",\n            \"legal\",\n            \"rule\",\n            \"legallyBindingAttachment\",\n            \"legallyBindingReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Contract`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"version\",\n            \"status\",\n            \"issued\",\n            \"applies\",\n            \"subject\",\n            \"name\",\n            \"title\",\n            \"type\",\n            \"subType\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"legallyBinding\": [\"legallyBindingAttachment\", \"legallyBindingReference\"],\n            \"topic\": [\"topicCodeableConcept\", \"topicReference\"],\n        }\n        return one_of_many_fields\n\n\nclass ContractContentDefinition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract precursor content.\n    Precusory content developed with a focus and intent of supporting the\n    formation a Contract instance, which may be associated with and\n    transformable into a Contract.\n    \"\"\"\n\n    __resource_type__ = \"ContractContentDefinition\"\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Publication Ownership\",\n        description=(\n            \"A copyright statement relating to Contract precursor content. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the Contract precursor content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    publicationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"publicationDate\",\n        title=\"When published\",\n        description=(\n            \"The date (and optionally time) when the contract was published. The \"\n            \"date must change when the business version changes and it must change \"\n            \"if the status code changes. In addition, it should change when the \"\n            \"substantive content of the contract changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    publicationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_publicationDate\",\n        title=\"Extension field for ``publicationDate``.\",\n    )\n\n    publicationStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"publicationStatus\",\n        title=(\n            \"amended | appended | cancelled | disputed | entered-in-error | \"\n            \"executable | executed | negotiable | offered | policy | rejected | \"\n            \"renewed | revoked | resolved | terminated\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"amended\",\n                \"appended\",\n                \"cancelled\",\n                \"disputed\",\n                \"entered-in-error\",\n                \"executable\",\n                \"executed\",\n                \"negotiable\",\n                \"offered\",\n                \"policy\",\n                \"rejected\",\n                \"renewed\",\n                \"revoked\",\n                \"resolved\",\n                \"terminated\",\n            ],\n        },\n    )\n    publicationStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_publicationStatus\",\n        title=\"Extension field for ``publicationStatus``.\",\n    )\n\n    publisher: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Publisher Entity\",\n        description=(\n            \"The  individual or organization that published the Contract precursor \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    subType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"Detailed Content Type Definition\",\n        description=\"Detailed Precusory content type.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Content structure and use\",\n        description=(\n            \"Precusory content structure and use, i.e., a boilerplate, template, \"\n            \"application for a contract such as an insurance policy or benefits \"\n            \"under a program, e.g., workers compensation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractContentDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"subType\",\n            \"publisher\",\n            \"publicationDate\",\n            \"publicationStatus\",\n            \"copyright\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractContentDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"publicationStatus\", \"publicationStatus__ext\")]\n        return required_fields\n\n\nclass ContractFriendly(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Friendly Language.\n    The \"patient friendly language\" versionof the Contract in whole or in\n    parts. \"Patient friendly language\" means the representation of the Contract\n    and Contract Provisions in a manner that is readily accessible and\n    understandable by a layperson in accordance with best practices for\n    communication styles that ensure that those agreeing to or signing the\n    Contract understand the roles, actions, obligations, responsibilities, and\n    implication of the agreement.\n    \"\"\"\n\n    __resource_type__ = \"ContractFriendly\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Easily comprehended representation of this Contract\",\n        description=(\n            \"Human readable rendering of this Contract in a format and \"\n            \"representation intended to enhance comprehension and ensure \"\n            \"understandability.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Easily comprehended representation of this Contract\",\n        description=(\n            \"Human readable rendering of this Contract in a format and \"\n            \"representation intended to enhance comprehension and ensure \"\n            \"understandability.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Composition\",\n                \"DocumentReference\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractFriendly`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentAttachment\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractFriendly`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"content\": [\"contentAttachment\", \"contentReference\"]}\n        return one_of_many_fields\n\n\nclass ContractLegal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Legal Language.\n    List of Legal expressions or representations of this Contract.\n    \"\"\"\n\n    __resource_type__ = \"ContractLegal\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Contract Legal Text\",\n        description=\"Contract legal text in human renderable form.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Contract Legal Text\",\n        description=\"Contract legal text in human renderable form.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Composition\",\n                \"DocumentReference\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractLegal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentAttachment\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractLegal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"content\": [\"contentAttachment\", \"contentReference\"]}\n        return one_of_many_fields\n\n\nclass ContractRule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Computable Contract Language.\n    List of Computable Policy Rule Language Representations of this Contract.\n    \"\"\"\n\n    __resource_type__ = \"ContractRule\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Computable Contract Rules\",\n        description=(\n            \"Computable Contract conveyed using a policy rule language (e.g. XACML,\"\n            \" DKAL, SecPal).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Computable Contract Rules\",\n        description=(\n            \"Computable Contract conveyed using a policy rule language (e.g. XACML,\"\n            \" DKAL, SecPal).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentAttachment\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"content\": [\"contentAttachment\", \"contentReference\"]}\n        return one_of_many_fields\n\n\nclass ContractSigner(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Signatory.\n    Parties with legal standing in the Contract, including the principal\n    parties, the grantor(s) and grantee(s), which are any person or\n    organization bound by the contract, and any ancillary parties, which\n    facilitate the execution of the contract such as a notary or witness.\n    \"\"\"\n\n    __resource_type__ = \"ContractSigner\"\n\n    party: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"party\",\n        title=\"Contract Signatory Party\",\n        description=\"Party which is a signator to this Contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    signature: typing.List[fhirtypes.SignatureType] = Field(\n        default=...,\n        alias=\"signature\",\n        title=\"Contract Documentation Signature\",\n        description=\"Legally binding Contract DSIG signature contents in Base64.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Contract Signatory Role\",\n        description=\"Role of this Contract signer, e.g. notary, grantee.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractSigner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"party\", \"signature\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractSigner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractTerm(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Term List.\n    One or more Contract Provisions, which may be related and conveyed as a\n    group, and may contain nested groups.\n    \"\"\"\n\n    __resource_type__ = \"ContractTerm\"\n\n    action: typing.List[fhirtypes.ContractTermActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Entity being ascribed responsibility\",\n        description=(\n            \"An actor taking a role in an activity for which it can be assigned \"\n            \"some degree of responsibility for the activity taking place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    applies: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"applies\",\n        title=\"Contract Term Effective Time\",\n        description=(\n            \"Relevant time or time-period when this Contract Provision is \"\n            \"applicable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    asset: typing.List[fhirtypes.ContractTermAssetType] | None = Field(\n        default=None,\n        alias=\"asset\",\n        title=\"Contract Term Asset List\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    group: typing.List[fhirtypes.ContractTermType] | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"Nested Contract Term Group\",\n        description=\"Nested group of Contract Provisions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Contract Term Number\",\n        description=\"Unique identifier for this particular Contract Provision.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"Contract Term Issue Date Time\",\n        description=\"When this Contract Provision was issued.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    offer: fhirtypes.ContractTermOfferType = Field(\n        default=...,\n        alias=\"offer\",\n        title=\"Context of the Contract term\",\n        description=(\n            \"The matter of concern in the context of this provision of the \" \"agrement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.ContractTermSecurityLabelType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Protection for the Term\",\n        description=(\n            \"Security labels that protect the handling of information about the \"\n            \"term and its elements, which may be specifically identified..\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"Contract Term Type specific classification\",\n        description=(\n            \"A specialized legal clause or condition based on overarching contract \"\n            \"type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Term Statement\",\n        description=\"Statement of a provision in a policy or a contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    topicCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"topicCodeableConcept\",\n        title=\"Term Concern\",\n        description=\"The entity that the term applies to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e topic[x]\n            \"one_of_many\": \"topic\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    topicReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"topicReference\",\n        title=\"Term Concern\",\n        description=\"The entity that the term applies to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e topic[x]\n            \"one_of_many\": \"topic\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Contract Term Type or Form\",\n        description=(\n            \"A legal clause or condition contained within a contract that requires \"\n            \"one or both parties to perform a particular requirement by some \"\n            \"specified time or prevents one or both parties from performing a \"\n            \"particular requirement by some specified time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTerm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"issued\",\n            \"applies\",\n            \"topicCodeableConcept\",\n            \"topicReference\",\n            \"type\",\n            \"subType\",\n            \"text\",\n            \"securityLabel\",\n            \"offer\",\n            \"asset\",\n            \"action\",\n            \"group\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTerm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"issued\", \"applies\", \"text\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"topic\": [\"topicCodeableConcept\", \"topicReference\"]}\n        return one_of_many_fields\n\n\nclass ContractTermAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Entity being ascribed responsibility.\n    An actor taking a role in an activity for which it can be assigned some\n    degree of responsibility for the activity taking place.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermAction\"\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Episode associated with action\",\n        description=(\n            \"Encounter or Episode with primary association to specified term \"\n            \"activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    contextLinkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"contextLinkId\",\n        title=\"Pointer to specific item\",\n        description=(\n            \"Id [identifier??] of the clause or question text related to the \"\n            \"requester of this action in the referenced form or \"\n            \"QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    contextLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_contextLinkId\",\n        title=\"Extension field for ``contextLinkId``.\",\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"True if the term prohibits the  action\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    intent: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"intent\",\n        title=\"Purpose for the Contract Term Action\",\n        description=(\n            \"Reason or purpose for the action stipulated by this Contract \" \"Provision.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific item\",\n        description=(\n            \"Id [identifier??] of the clause or question text related to this \"\n            \"action in the referenced form or QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the action\",\n        description=(\n            \"Comments made about the term action made by the requester, performer, \"\n            \"subject or other participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When action happens\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When action happens\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When action happens\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Actor that wil execute (or not) the action\",\n        description=(\n            \"Indicates who or what is being asked to perform (or not perform) the \"\n            \"ction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"CareTeam\",\n                \"Device\",\n                \"Substance\",\n                \"Organization\",\n                \"Location\",\n            ],\n        },\n    )\n\n    performerLinkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"performerLinkId\",\n        title=\"Pointer to specific item\",\n        description=(\n            \"Id [identifier??] of the clause or question text related to the reason\"\n            \" type or reference of this  action in the referenced form or \"\n            \"QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    performerLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_performerLinkId\",\n        title=\"Extension field for ``performerLinkId``.\",\n    )\n\n    performerRole: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"performerRole\",\n        title=\"Competency of the performer\",\n        description=(\n            \"The type of role or competency of an individual desired or required to\"\n            \" perform or not perform the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performerType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=\"Kind of service performer\",\n        description=(\n            \"The type of individual that is desired or required to perform or not \"\n            \"perform the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why action is to be performed\",\n        description=(\n            \"Describes why the action is to be performed or not performed in \"\n            \"textual form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reason__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_reason\", title=\"Extension field for ``reason``.\"\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why is action (not) needed?\",\n        description=(\n            \"Rationale for the action to be performed or not performed. Describes \"\n            \"why the action is permitted or prohibited.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonLinkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"reasonLinkId\",\n        title=\"Pointer to specific item\",\n        description=(\n            \"Id [identifier??] of the clause or question text related to the reason\"\n            \" type or reference of this  action in the referenced form or \"\n            \"QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reasonLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_reasonLinkId\",\n        title=\"Extension field for ``reasonLinkId``.\",\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why is action (not) needed?\",\n        description=(\n            \"Indicates another resource whose existence justifies permitting or not\"\n            \" permitting this action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n                \"Questionnaire\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    requester: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who asked for action\",\n        description=(\n            \"Who or what initiated the action and has responsibility for its \"\n            \"activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Group\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    requesterLinkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"requesterLinkId\",\n        title=\"Pointer to specific item\",\n        description=(\n            \"Id [identifier??] of the clause or question text related to the \"\n            \"requester of this action in the referenced form or \"\n            \"QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    requesterLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_requesterLinkId\",\n        title=\"Extension field for ``requesterLinkId``.\",\n    )\n\n    securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field(\n        default=None,\n        alias=\"securityLabelNumber\",\n        title=\"Action restriction numbers\",\n        description=\"Security labels that protects the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    securityLabelNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_securityLabelNumber\",\n        title=\"Extension field for ``securityLabelNumber``.\",\n    )\n\n    status: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"status\",\n        title=\"State of the action\",\n        description=\"Current state of the term action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: typing.List[fhirtypes.ContractTermActionSubjectType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Entity of the action\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type or form of the action\",\n        description=(\n            \"Activity or service obligation to be done or not done, performed or \"\n            \"not performed, effectuated or not by this Contract term.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"doNotPerform\",\n            \"type\",\n            \"subject\",\n            \"intent\",\n            \"linkId\",\n            \"status\",\n            \"context\",\n            \"contextLinkId\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"requester\",\n            \"requesterLinkId\",\n            \"performerType\",\n            \"performerRole\",\n            \"performer\",\n            \"performerLinkId\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"reason\",\n            \"reasonLinkId\",\n            \"note\",\n            \"securityLabelNumber\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\", \"occurrenceTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass ContractTermActionSubject(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Entity of the action.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermActionSubject\"\n\n    reference: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Entity of the action\",\n        description=\"The entity the action is performed or not performed on or for.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Group\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Role type of the agent\",\n        description=\"Role type of agent assigned roles in this Contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermActionSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"reference\", \"role\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermActionSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractTermAsset(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Term Asset List.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermAsset\"\n\n    answer: typing.List[fhirtypes.ContractTermOfferAnswerType] | None = Field(\n        default=None,\n        alias=\"answer\",\n        title=\"Response to assets\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    condition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Quality desctiption of asset\",\n        description=(\n            \"Description of the quality and completeness of the asset that imay be \"\n            \"a factor in its valuation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_condition\", title=\"Extension field for ``condition``.\"\n    )\n\n    context: typing.List[fhirtypes.ContractTermAssetContextType] | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Circumstance of the asset\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to asset text\",\n        description=(\n            \"Id [identifier??] of the clause or question text about the asset in \"\n            \"the referenced form or QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    period: typing.List[fhirtypes.PeriodType] | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period of the asset\",\n        description=\"Asset relevant contractual time period.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    periodType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"periodType\",\n        title=\"Asset availability types\",\n        description=\"Type of Asset availability for use or ownership.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"Kinship of the asset\",\n        description=(\n            \"Specifies the applicability of the term to an asset resource instance,\"\n            \" and instances it refers to orinstances that refer to it, and/or are \"\n            \"owned by the offeree.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    scope: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"scope\",\n        title=\"Range of asset\",\n        description=\"Differentiates the kind of the asset .\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field(\n        default=None,\n        alias=\"securityLabelNumber\",\n        title=\"Asset restriction numbers\",\n        description=\"Security labels that protects the asset.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    securityLabelNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_securityLabelNumber\",\n        title=\"Extension field for ``securityLabelNumber``.\",\n    )\n\n    subtype: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subtype\",\n        title=\"Asset sub-category\",\n        description=\"May be a subtype or part of an offered asset.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Asset clause or question text\",\n        description=(\n            \"Clause or question text (Prose Object) concerning the asset in a \"\n            \"linked form, such as a QuestionnaireResponse used in the formation of \"\n            \"the contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Asset category\",\n        description=\"Target entity type about which the term may be concerned.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    typeReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"typeReference\",\n        title=\"Associated entities\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    usePeriod: typing.List[fhirtypes.PeriodType] | None = Field(\n        default=None,\n        alias=\"usePeriod\",\n        title=\"Time period\",\n        description=\"Time period of asset use.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valuedItem: typing.List[fhirtypes.ContractTermAssetValuedItemType] | None = Field(\n        default=None,\n        alias=\"valuedItem\",\n        title=\"Contract Valued Item List\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermAsset`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"scope\",\n            \"type\",\n            \"typeReference\",\n            \"subtype\",\n            \"relationship\",\n            \"context\",\n            \"condition\",\n            \"periodType\",\n            \"period\",\n            \"usePeriod\",\n            \"text\",\n            \"linkId\",\n            \"answer\",\n            \"securityLabelNumber\",\n            \"valuedItem\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermAsset`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractTermAssetContext(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Circumstance of the asset.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermAssetContext\"\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Codeable asset context\",\n        description=(\n            \"Coded representation of the context generally or of the Referenced \"\n            \"entity, such as the asset holder type or location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Creator,custodian or owner\",\n        description=(\n            \"Asset context reference may include the creator, custodian, or owning \"\n            \"Person or Organization (e.g., bank, repository),  location held, e.g.,\"\n            \" building,  jurisdiction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Context description\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermAssetContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"reference\", \"code\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermAssetContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractTermAssetValuedItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Valued Item List.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermAssetValuedItem\"\n\n    effectiveTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveTime\",\n        title=\"Contract Valued Item Effective Tiem\",\n        description=(\n            \"Indicates the time during which this Contract ValuedItem information \"\n            \"is effective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    effectiveTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveTime\",\n        title=\"Extension field for ``effectiveTime``.\",\n    )\n\n    entityCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"entityCodeableConcept\",\n        title=\"Contract Valued Item Type\",\n        description=\"Specific type of Contract Valued Item that may be priced.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e entity[x]\n            \"one_of_many\": \"entity\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    entityReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"entityReference\",\n        title=\"Contract Valued Item Type\",\n        description=\"Specific type of Contract Valued Item that may be priced.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e entity[x]\n            \"one_of_many\": \"entity\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Contract Valued Item Price Scaling Factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of the Contract Valued Item delivered. The concept of a \"\n            \"Factor allows for a discount or surcharge multiplier to be applied to \"\n            \"a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Contract Valued Item Number\",\n        description=\"Identifies a Contract Valued Item instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific item\",\n        description=(\n            \"Id  of the clause or question text related to the context of this \"\n            \"valuedItem in the referenced form or QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total Contract Valued Item Value\",\n        description=(\n            \"Expresses the product of the Contract Valued Item unitQuantity and the\"\n            \" unitPriceAmt. For example, the formula: unit Quantity * unit Price \"\n            \"(Cost per Point) * factor Number  * points = net Amount. Quantity, \"\n            \"factor and points are assumed to be 1 if not supplied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"payment\",\n        title=\"Terms of valuation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    payment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_payment\", title=\"Extension field for ``payment``.\"\n    )\n\n    paymentDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"paymentDate\",\n        title=\"When payment is due\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    paymentDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_paymentDate\", title=\"Extension field for ``paymentDate``.\"\n    )\n\n    points: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"points\",\n        title=\"Contract Valued Item Difficulty Scaling Factor\",\n        description=(\n            \"An amount that expresses the weighting (based on difficulty, cost \"\n            \"and/or resource intensiveness) associated with the Contract Valued \"\n            \"Item delivered. The concept of Points allows for assignment of point \"\n            \"values for a Contract Valued Item, such that a monetary amount can be \"\n            \"assigned to each point.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    points__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_points\", title=\"Extension field for ``points``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of Contract Valued Items\",\n        description=(\n            \"Specifies the units by which the Contract Valued Item is measured or \"\n            \"counted, and quantifies the countable or measurable Contract Valued \"\n            \"Item instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recipient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Who will receive payment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    responsible: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Who will make payment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field(\n        default=None,\n        alias=\"securityLabelNumber\",\n        title=\"Security Labels that define affected terms\",\n        description=(\n            \"A set of security labels that define which terms are controlled by \"\n            \"this condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    securityLabelNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_securityLabelNumber\",\n        title=\"Extension field for ``securityLabelNumber``.\",\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Contract Valued Item fee, charge, or cost\",\n        description=\"A Contract Valued Item unit valuation measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermAssetValuedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"entityCodeableConcept\",\n            \"entityReference\",\n            \"identifier\",\n            \"effectiveTime\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"points\",\n            \"net\",\n            \"payment\",\n            \"paymentDate\",\n            \"responsible\",\n            \"recipient\",\n            \"linkId\",\n            \"securityLabelNumber\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermAssetValuedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"entity\": [\"entityCodeableConcept\", \"entityReference\"]}\n        return one_of_many_fields\n\n\nclass ContractTermOffer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Context of the Contract term.\n    The matter of concern in the context of this provision of the agrement.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermOffer\"\n\n    answer: typing.List[fhirtypes.ContractTermOfferAnswerType] | None = Field(\n        default=None,\n        alias=\"answer\",\n        title=\"Response to offer text\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    decision: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"decision\",\n        title=\"Accepting party choice\",\n        description=(\n            \"Type of choice made by accepting party with respect to an offer made \"\n            \"by an offeror/ grantee.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    decisionMode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"decisionMode\",\n        title=\"How decision is conveyed\",\n        description=\"How the decision about a Contract was conveyed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Offer business ID\",\n        description=\"Unique identifier for this particular Contract Provision.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to text\",\n        description=(\n            \"The id of the clause or question text of the offer in the referenced \"\n            \"questionnaire/response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    party: typing.List[fhirtypes.ContractTermOfferPartyType] | None = Field(\n        default=None,\n        alias=\"party\",\n        title=\"Offer Recipient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field(\n        default=None,\n        alias=\"securityLabelNumber\",\n        title=\"Offer restriction numbers\",\n        description=\"Security labels that protects the offer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    securityLabelNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_securityLabelNumber\",\n        title=\"Extension field for ``securityLabelNumber``.\",\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Human readable offer text\",\n        description=\"Human readable form of this Contract Offer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    topic: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"Negotiable offer asset\",\n        description=(\n            \"The owner of an asset has the residual control rights over the asset: \"\n            \"the right to decide all usages of the asset in any way not \"\n            \"inconsistent with a prior contract, custom, or law (Hart, 1995, p. \"\n            \"30).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Contract Offer Type or Form\",\n        description=(\n            \"Type of Contract Provision such as specific requirements, purposes for\"\n            \" actions, obligations, prohibitions, e.g. life time maximum benefit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermOffer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"party\",\n            \"topic\",\n            \"type\",\n            \"decision\",\n            \"decisionMode\",\n            \"answer\",\n            \"text\",\n            \"linkId\",\n            \"securityLabelNumber\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermOffer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"topic\"]\n\n\nclass ContractTermOfferAnswer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Response to offer text.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermOfferAnswer\"\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warrently duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warrently duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warrently duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warrently duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warrently duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warrently duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warrently duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warrently duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warrently duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warrently duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warrently duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warrently duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermOfferAnswer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueBoolean\",\n            \"valueDecimal\",\n            \"valueInteger\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueTime\",\n            \"valueString\",\n            \"valueUri\",\n            \"valueAttachment\",\n            \"valueCoding\",\n            \"valueQuantity\",\n            \"valueReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermOfferAnswer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCoding\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ContractTermOfferParty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Offer Recipient.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermOfferParty\"\n\n    reference: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Referenced entity\",\n        description=\"Participant in the offer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Group\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"role\",\n        title=\"Participant engagement type\",\n        description=\"How the party participates in the offer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermOfferParty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"reference\", \"role\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermOfferParty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractTermSecurityLabel(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Protection for the Term.\n    Security labels that protect the handling of information about the term and\n    its elements, which may be specifically identified..\n    \"\"\"\n\n    __resource_type__ = \"ContractTermSecurityLabel\"\n\n    category: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Applicable Policy\",\n        description=(\n            \"Security label privacy tag that species the applicable privacy and \"\n            \"security policies governing this term and/or term elements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    classification: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"classification\",\n        title=\"Confidentiality Protection\",\n        description=(\n            \"Security label privacy tag that species the level of confidentiality \"\n            \"protection required for this term and/or term elements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    control: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"control\",\n        title=\"Handling Instructions\",\n        description=(\n            \"Security label privacy tag that species the manner in which term \"\n            \"and/or term elements are to be protected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    number: typing.List[fhirtypes.UnsignedIntType | None] | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"Link to Security Labels\",\n        description=(\n            \"Number used to link this term or term element to the applicable \"\n            \"Security Label.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    number__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermSecurityLabel`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"number\",\n            \"classification\",\n            \"category\",\n            \"control\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermSecurityLabel`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/contributor.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Contributor\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Contributor(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contributor information.\n    A contributor to the content of a knowledge asset, including authors,\n    editors, reviewers, and endorsers.\n    \"\"\"\n\n    __resource_type__ = \"Contributor\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details of the contributor\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" contributor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Who contributed the content\",\n        description=(\n            \"The name of the individual or organization responsible for the \"\n            \"contribution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"author | editor | reviewer | endorser\",\n        description=\"The type of contributor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"author\", \"editor\", \"reviewer\", \"endorser\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Contributor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"type\", \"name\", \"contact\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Contributor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"type\", \"name\", \"contact\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/count.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Count\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Count(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A measured or measurable amount.\n    A measured amount (or an amount that can potentially be measured). Note\n    that measured amounts include amounts that are not precisely quantified,\n    including amounts involving arbitrary units and floating currencies.\n    \"\"\"\n\n    __resource_type__ = \"Count\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Count`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Count`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/R4B/coverage.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Coverage\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Coverage(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurance or medical plan or a payment agreement.\n    Financial instrument which may be used to reimburse or pay for health care\n    products and services. Includes both insurance and self-payment.\n    \"\"\"\n\n    __resource_type__ = \"Coverage\"\n\n    beneficiary: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"beneficiary\",\n        title=\"Plan beneficiary\",\n        description=(\n            \"The party who benefits from the insurance coverage; the patient when \"\n            \"products and/or services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    class_fhir: typing.List[fhirtypes.CoverageClassType] | None = Field(\n        default=None,\n        alias=\"class\",\n        title=\"Additional coverage classifications\",\n        description=\"A suite of underwriter specific classifiers.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contract: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"contract\",\n        title=\"Contract details\",\n        description=\"The policy(s) which constitute this insurance coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Contract\"],\n        },\n    )\n\n    costToBeneficiary: typing.List[\n        fhirtypes.CoverageCostToBeneficiaryType\n    ] | None = Field(\n        default=None,\n        alias=\"costToBeneficiary\",\n        title=\"Patient payments for services/products\",\n        description=(\n            \"A suite of codes indicating the cost category and associated amount \"\n            \"which have been detailed in the policy and may have been  included on \"\n            \"the health card.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dependent: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"dependent\",\n        title=\"Dependent number\",\n        description=\"A unique identifier for a dependent under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    dependent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dependent\", title=\"Extension field for ``dependent``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for the coverage\",\n        description=\"A unique identifier assigned to this coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    network: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"Insurer network\",\n        description=(\n            \"The insurer-specific identifier for the insurer-defined network of \"\n            \"providers to which the beneficiary may seek treatment which will be \"\n            \"covered at the 'in-network' rate, otherwise 'out of network' terms and\"\n            \" conditions apply.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    network__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_network\", title=\"Extension field for ``network``.\"\n    )\n\n    order: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"order\",\n        title=\"Relative order of the coverage\",\n        description=(\n            \"The order of applicability of this coverage relative to other \"\n            \"coverages which are currently in force. Note, there may be gaps in the\"\n            \" numbering and this does not imply primary, secondary etc. as the \"\n            \"specific positioning of coverages depends upon the episode of care.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    order__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_order\", title=\"Extension field for ``order``.\"\n    )\n\n    payor: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"payor\",\n        title=\"Issuer of the policy\",\n        description=(\n            \"The program or plan underwriter or payor including both insurance and \"\n            \"non-insurance agreements, such as patient-pay agreements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Coverage start and end dates\",\n        description=(\n            \"Time period during which the coverage is in force. A missing start \"\n            \"date indicates the start date isn't known, a missing end date means \"\n            \"the coverage is continuing to be in force.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    policyHolder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"policyHolder\",\n        title=\"Owner of the policy\",\n        description=\"The party who 'owns' the insurance policy.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\", \"Organization\"],\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"Beneficiary relationship to the subscriber\",\n        description=\"The relationship of beneficiary (patient) to the subscriber.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subrogation: bool | None = Field(\n        default=None,\n        alias=\"subrogation\",\n        title=\"Reimbursement to insurer\",\n        description=(\n            \"When 'subrogation=true' this insurance instance has been included not \"\n            \"for adjudication but to provide insurers with the details to recover \"\n            \"costs.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subrogation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subrogation\", title=\"Extension field for ``subrogation``.\"\n    )\n\n    subscriber: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subscriber\",\n        title=\"Subscriber to the policy\",\n        description=(\n            \"The party who has signed-up for or 'owns' the contractual relationship\"\n            \" to the policy or to whom the benefit of the policy for services \"\n            \"rendered to them or their family is due.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    subscriberId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subscriberId\",\n        title=\"ID assigned to the subscriber\",\n        description=\"The insurer assigned ID for the Subscriber.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subscriberId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subscriberId\",\n        title=\"Extension field for ``subscriberId``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Coverage category such as medical or accident\",\n        description=(\n            \"The type of coverage: social program, medical plan, accident coverage \"\n            \"(workers compensation, auto), group health or payment by an individual\"\n            \" or organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Coverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"policyHolder\",\n            \"subscriber\",\n            \"subscriberId\",\n            \"beneficiary\",\n            \"dependent\",\n            \"relationship\",\n            \"period\",\n            \"payor\",\n            \"class\",\n            \"order\",\n            \"network\",\n            \"costToBeneficiary\",\n            \"subrogation\",\n            \"contract\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Coverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"policyHolder\",\n            \"subscriber\",\n            \"subscriberId\",\n            \"beneficiary\",\n            \"dependent\",\n            \"period\",\n            \"payor\",\n            \"order\",\n            \"network\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass CoverageClass(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional coverage classifications.\n    A suite of underwriter specific classifiers.\n    \"\"\"\n\n    __resource_type__ = \"CoverageClass\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human readable description of the type and value\",\n        description=\"A short description for the class.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of class such as 'group' or 'plan'\",\n        description=(\n            \"The type of classification for which an insurer-specific class label \"\n            \"or number and optional name is provided, for example may be used to \"\n            \"identify a class of coverage or employer group, Policy, Plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Value associated with the type\",\n        description=(\n            \"The alphanumeric string value associated with the insurer issued \" \"label.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageClass`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"value\", \"name\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageClass`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"value\", \"name\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass CoverageCostToBeneficiary(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient payments for services/products.\n    A suite of codes indicating the cost category and associated amount which\n    have been detailed in the policy and may have been  included on the health\n    card.\n    \"\"\"\n\n    __resource_type__ = \"CoverageCostToBeneficiary\"\n\n    exception: typing.List[\n        fhirtypes.CoverageCostToBeneficiaryExceptionType\n    ] | None = Field(\n        default=None,\n        alias=\"exception\",\n        title=\"Exceptions for patient payments\",\n        description=(\n            \"A suite of codes indicating exceptions or reductions to patient costs \"\n            \"and their effective periods.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Cost category\",\n        description=\"The category of patient centric costs associated with treatment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"The amount or percentage due from the beneficiary\",\n        description=\"The amount due from the patient for the cost category.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"The amount or percentage due from the beneficiary\",\n        description=\"The amount due from the patient for the cost category.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageCostToBeneficiary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueQuantity\",\n            \"valueMoney\",\n            \"exception\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageCostToBeneficiary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"valueQuantity\", \"valueMoney\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"value\": [\"valueMoney\", \"valueQuantity\"]}\n        return one_of_many_fields\n\n\nclass CoverageCostToBeneficiaryException(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Exceptions for patient payments.\n    A suite of codes indicating exceptions or reductions to patient costs and\n    their effective periods.\n    \"\"\"\n\n    __resource_type__ = \"CoverageCostToBeneficiaryException\"\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"The effective period of the exception\",\n        description=\"The timeframe during when the exception is in force.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Exception category\",\n        description=\"The code for the specific exception.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageCostToBeneficiaryException`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageCostToBeneficiaryException`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"period\"]\n"
  },
  {
    "path": "fhir/resources/R4B/coverageeligibilityrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CoverageEligibilityRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    CoverageEligibilityRequest resource.\n    The CoverageEligibilityRequest provides patient and insurance coverage\n    information to an insurer for them to respond, in the form of an\n    CoverageEligibilityResponse, with information regarding whether the stated\n    coverage is valid and in-force and optionally to provide the insurance\n    details of the policy.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityRequest\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Author\",\n        description=\"Person who created the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    facility: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"facility\",\n        title=\"Servicing facility\",\n        description=\"Facility where the services are intended to be provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for coverage eligiblity request\",\n        description=\"A unique identifier assigned to this coverage eligiblity request.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: typing.List[\n        fhirtypes.CoverageEligibilityRequestInsuranceType\n    ] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Patient insurance information\",\n        description=(\n            \"Financial instruments for reimbursement for the health care products \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"insurer\",\n        title=\"Coverage issuer\",\n        description=(\n            \"The Insurer who issued the coverage in question and is the recipient \"\n            \"of the request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    item: typing.List[fhirtypes.CoverageEligibilityRequestItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Item to be evaluated for eligibiity\",\n        description=(\n            \"Service categories or billable services for which benefit details \"\n            \"and/or an authorization prior to service delivery may be required by \"\n            \"the payor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Intended recipient of products and services\",\n        description=(\n            \"The party who is the beneficiary of the supplied coverage and for whom\"\n            \" eligibility is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Desired processing priority\",\n        description=\"When the requestor expects the processor to complete processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Party responsible for the request\",\n        description=\"The provider which is responsible for the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    purpose: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"auth-requirements | benefits | discovery | validation\",\n        description=(\n            \"Code to specify whether requesting: prior authorization requirements \"\n            \"for some service categories or billing codes; benefits for coverages \"\n            \"specified or discovered; discovery and return of coverages for the \"\n            \"patient; and/or validation that the specified coverage is in-force at \"\n            \"the date/period specified or 'now' if not specified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"auth-requirements\", \"benefits\", \"discovery\", \"validation\"],\n        },\n    )\n    purpose__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Estimated date or dates of service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Estimated date or dates of service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    supportingInfo: typing.List[\n        fhirtypes.CoverageEligibilityRequestSupportingInfoType\n    ] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Supporting information\",\n        description=(\n            \"Additional information codes regarding exceptions, special \"\n            \"considerations, the condition, situation, prior or concurrent issues.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"priority\",\n            \"purpose\",\n            \"patient\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"created\",\n            \"enterer\",\n            \"provider\",\n            \"insurer\",\n            \"facility\",\n            \"supportingInfo\",\n            \"insurance\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"purpose\",\n            \"patient\",\n            \"created\",\n            \"insurer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"purpose\", \"purpose__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"serviced\": [\"servicedDate\", \"servicedPeriod\"]}\n        return one_of_many_fields\n\n\nclass CoverageEligibilityRequestInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient insurance information.\n    Financial instruments for reimbursement for the health care products and\n    services.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityRequestInsurance\"\n\n    businessArrangement: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"businessArrangement\",\n        title=\"Additional provider contract number\",\n        description=(\n            \"A business agreement number established between the provider and the \"\n            \"insurer for special business processing purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_businessArrangement\",\n        title=\"Extension field for ``businessArrangement``.\",\n    )\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=(\n            \"Reference to the insurance card level information contained in the \"\n            \"Coverage resource. The coverage issuing insurer will use these details\"\n            \" to locate the patient's actual coverage within the insurer's \"\n            \"information system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    focal: bool | None = Field(\n        default=None,\n        alias=\"focal\",\n        title=\"Applicable coverage\",\n        description=(\n            \"A flag to indicate that this Coverage is to be used for evaluation of \"\n            \"this request when set to true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_focal\", title=\"Extension field for ``focal``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityRequestInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"focal\",\n            \"coverage\",\n            \"businessArrangement\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CoverageEligibilityRequestItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Item to be evaluated for eligibiity.\n    Service categories or billable services for which benefit details and/or an\n    authorization prior to service delivery may be required by the payor.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityRequestItem\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Product or service details\",\n        description=\"The plan/proposal/order describing the proposed service in detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    diagnosis: typing.List[\n        fhirtypes.CoverageEligibilityRequestItemDiagnosisType\n    ] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"Applicable diagnosis\",\n        description=\"Patient diagnosis for which care is sought.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    facility: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"facility\",\n        title=\"Servicing facility\",\n        description=\"Facility where the services will be provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\", \"Organization\"],\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Product or service billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"This contains the product, service, drug or other billing code for the\"\n            \" item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Perfoming practitioner\",\n        description=(\n            \"The practitioner who is responsible for the product or service to be \"\n            \"rendered to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInfoSequence: typing.List[\n        fhirtypes.PositiveIntType | None\n    ] | None = Field(\n        default=None,\n        alias=\"supportingInfoSequence\",\n        title=\"Applicable exception or supporting information\",\n        description=(\n            \"Exceptions, special conditions and supporting information applicable \"\n            \"for this service or product line.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    supportingInfoSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_supportingInfoSequence\",\n        title=\"Extension field for ``supportingInfoSequence``.\",\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=\"The amount charged to the patient by the provider for a single unit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityRequestItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"supportingInfoSequence\",\n            \"category\",\n            \"productOrService\",\n            \"modifier\",\n            \"provider\",\n            \"quantity\",\n            \"unitPrice\",\n            \"facility\",\n            \"diagnosis\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CoverageEligibilityRequestItemDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Applicable diagnosis.\n    Patient diagnosis for which care is sought.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityRequestItemDiagnosis\"\n\n    diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"diagnosisCodeableConcept\",\n        title=\"Nature of illness or problem\",\n        description=(\n            \"The nature of illness or problem in a coded form or as a reference to \"\n            \"an external defined Condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    diagnosisReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"diagnosisReference\",\n        title=\"Nature of illness or problem\",\n        description=(\n            \"The nature of illness or problem in a coded form or as a reference to \"\n            \"an external defined Condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityRequestItemDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"diagnosisCodeableConcept\",\n            \"diagnosisReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestItemDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"diagnosis\": [\"diagnosisCodeableConcept\", \"diagnosisReference\"]\n        }\n        return one_of_many_fields\n\n\nclass CoverageEligibilityRequestSupportingInfo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supporting information.\n    Additional information codes regarding exceptions, special considerations,\n    the condition, situation, prior or concurrent issues.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityRequestSupportingInfo\"\n\n    appliesToAll: bool | None = Field(\n        default=None,\n        alias=\"appliesToAll\",\n        title=\"Applies to all items\",\n        description=(\n            \"The supporting materials are applicable for all detail items, \"\n            \"product/servce categories and specific billing codes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    appliesToAll__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_appliesToAll\",\n        title=\"Extension field for ``appliesToAll``.\",\n    )\n\n    information: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"information\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Information instance identifier\",\n        description=\"A number to uniquely identify supporting information entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityRequestSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"information\",\n            \"appliesToAll\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/coverageeligibilityresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CoverageEligibilityResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    CoverageEligibilityResponse resource.\n    This resource provides eligibility and plan details from the processing of\n    an CoverageEligibilityRequest resource.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityResponse\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Response creation date\",\n        description=\"The date this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A human readable description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    error: typing.List[fhirtypes.CoverageEligibilityResponseErrorType] | None = Field(\n        default=None,\n        alias=\"error\",\n        title=\"Processing errors\",\n        description=\"Errors encountered during the processing of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"Printed form identifier\",\n        description=\"A code for the form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for coverage eligiblity request\",\n        description=\"A unique identifier assigned to this coverage eligiblity request.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: typing.List[\n        fhirtypes.CoverageEligibilityResponseInsuranceType\n    ] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Patient insurance information\",\n        description=(\n            \"Financial instruments for reimbursement for the health care products \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"insurer\",\n        title=\"Coverage issuer\",\n        description=(\n            \"The Insurer who issued the coverage in question and is the author of \"\n            \"the response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"queued | complete | error | partial\",\n        description=\"The outcome of the request processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"queued\", \"complete\", \"error\", \"partial\"],\n        },\n    )\n    outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcome\", title=\"Extension field for ``outcome``.\"\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Intended recipient of products and services\",\n        description=(\n            \"The party who is the beneficiary of the supplied coverage and for whom\"\n            \" eligibility is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    preAuthRef: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Preauthorization reference\",\n        description=(\n            \"A reference from the Insurer to which these services pertain to be \"\n            \"used on further communication and as proof that the request occurred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    purpose: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"auth-requirements | benefits | discovery | validation\",\n        description=(\n            \"Code to specify whether requesting: prior authorization requirements \"\n            \"for some service categories or billing codes; benefits for coverages \"\n            \"specified or discovered; discovery and return of coverages for the \"\n            \"patient; and/or validation that the specified coverage is in-force at \"\n            \"the date/period specified or 'now' if not specified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"auth-requirements\", \"benefits\", \"discovery\", \"validation\"],\n        },\n    )\n    purpose__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    request: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"request\",\n        title=\"Eligibility request reference\",\n        description=\"Reference to the original request resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CoverageEligibilityRequest\"],\n        },\n    )\n\n    requestor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestor\",\n        title=\"Party responsible for the request\",\n        description=\"The provider which is responsible for the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Estimated date or dates of service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Estimated date or dates of service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"purpose\",\n            \"patient\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"created\",\n            \"requestor\",\n            \"request\",\n            \"outcome\",\n            \"disposition\",\n            \"insurer\",\n            \"insurance\",\n            \"preAuthRef\",\n            \"form\",\n            \"error\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"purpose\",\n            \"patient\",\n            \"created\",\n            \"request\",\n            \"outcome\",\n            \"insurer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"outcome\", \"outcome__ext\"),\n            (\"purpose\", \"purpose__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"serviced\": [\"servicedDate\", \"servicedPeriod\"]}\n        return one_of_many_fields\n\n\nclass CoverageEligibilityResponseError(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing errors.\n    Errors encountered during the processing of the request.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityResponseError\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Error code detailing processing issues\",\n        description=(\n            \"An error code,from a specified code system, which details why the \"\n            \"eligibility check could not be performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityResponseError`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseError`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CoverageEligibilityResponseInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient insurance information.\n    Financial instruments for reimbursement for the health care products and\n    services.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityResponseInsurance\"\n\n    benefitPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"benefitPeriod\",\n        title=\"When the benefits are applicable\",\n        description=\"The term of the benefits documented in this response.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=(\n            \"Reference to the insurance card level information contained in the \"\n            \"Coverage resource. The coverage issuing insurer will use these details\"\n            \" to locate the patient's actual coverage within the insurer's \"\n            \"information system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    inforce: bool | None = Field(\n        default=None,\n        alias=\"inforce\",\n        title=\"Coverage inforce indicator\",\n        description=(\n            \"Flag indicating if the coverage provided is inforce currently if no \"\n            \"service date(s) specified or for the whole duration of the service \"\n            \"dates.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    inforce__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_inforce\", title=\"Extension field for ``inforce``.\"\n    )\n\n    item: typing.List[\n        fhirtypes.CoverageEligibilityResponseInsuranceItemType\n    ] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Benefits and authorization details\",\n        description=(\n            \"Benefits and optionally current balances, and authorization details by\"\n            \" category or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityResponseInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"coverage\",\n            \"inforce\",\n            \"benefitPeriod\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"coverage\"]\n\n\nclass CoverageEligibilityResponseInsuranceItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefits and authorization details.\n    Benefits and optionally current balances, and authorization details by\n    category or service.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityResponseInsuranceItem\"\n\n    authorizationRequired: bool | None = Field(\n        default=None,\n        alias=\"authorizationRequired\",\n        title=\"Authorization required flag\",\n        description=(\n            \"A boolean flag indicating whether a preauthorization is required prior\"\n            \" to actual service delivery.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authorizationRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_authorizationRequired\",\n        title=\"Extension field for ``authorizationRequired``.\",\n    )\n\n    authorizationSupporting: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"authorizationSupporting\",\n        title=\"Type of required supporting materials\",\n        description=(\n            \"Codes or comments regarding information or actions associated with the\"\n            \" preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    authorizationUrl: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"authorizationUrl\",\n        title=\"Preauthorization requirements endpoint\",\n        description=(\n            \"A web location for obtaining requirements or descriptive information \"\n            \"regarding the preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authorizationUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_authorizationUrl\",\n        title=\"Extension field for ``authorizationUrl``.\",\n    )\n\n    benefit: typing.List[\n        fhirtypes.CoverageEligibilityResponseInsuranceItemBenefitType\n    ] | None = Field(\n        default=None,\n        alias=\"benefit\",\n        title=\"Benefit Summary\",\n        description=\"Benefits used to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the benefit or services covered\",\n        description=\"A richer description of the benefit or services covered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    excluded: bool | None = Field(\n        default=None,\n        alias=\"excluded\",\n        title=\"Excluded from the plan\",\n        description=(\n            \"True if the indicated class of service is excluded from the plan, \"\n            \"missing or False indicates the product or service is included in the \"\n            \"coverage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    excluded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_excluded\", title=\"Extension field for ``excluded``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Product or service billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Short name for the benefit\",\n        description=\"A short name or tag for the benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    network: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"In or out of network\",\n        description=(\n            \"Is a flag to indicate whether the benefits refer to in-network \"\n            \"providers or out-of-network providers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"This contains the product, service, drug or other billing code for the\"\n            \" item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Performing practitioner\",\n        description=(\n            \"The practitioner who is eligible for the provision of the product or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    term: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"term\",\n        title=\"Annual or lifetime\",\n        description=(\n            \"The term or period of the values such as 'maximum lifetime benefit' or\"\n            \" 'maximum annual visits'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Individual or family\",\n        description=\"Indicates if the benefits apply to an individual or to the family.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityResponseInsuranceItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"productOrService\",\n            \"modifier\",\n            \"provider\",\n            \"excluded\",\n            \"name\",\n            \"description\",\n            \"network\",\n            \"unit\",\n            \"term\",\n            \"benefit\",\n            \"authorizationRequired\",\n            \"authorizationSupporting\",\n            \"authorizationUrl\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseInsuranceItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CoverageEligibilityResponseInsuranceItemBenefit(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefit Summary.\n    Benefits used to date.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityResponseInsuranceItemBenefit\"\n\n    allowedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"allowedMoney\",\n        title=\"Benefits allowed\",\n        description=\"The quantity of the benefit which is permitted under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    allowedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"allowedString\",\n        title=\"Benefits allowed\",\n        description=\"The quantity of the benefit which is permitted under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    allowedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedString\",\n        title=\"Extension field for ``allowedString``.\",\n    )\n\n    allowedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"allowedUnsignedInt\",\n        title=\"Benefits allowed\",\n        description=\"The quantity of the benefit which is permitted under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    allowedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedUnsignedInt\",\n        title=\"Extension field for ``allowedUnsignedInt``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Benefit classification\",\n        description=\"Classification of benefit being provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"usedMoney\",\n        title=\"Benefits used\",\n        description=\"The quantity of the benefit which have been consumed to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    usedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usedString\",\n        title=\"Benefits used\",\n        description=\"The quantity of the benefit which have been consumed to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n    usedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usedString\", title=\"Extension field for ``usedString``.\"\n    )\n\n    usedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"usedUnsignedInt\",\n        title=\"Benefits used\",\n        description=\"The quantity of the benefit which have been consumed to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n    usedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_usedUnsignedInt\",\n        title=\"Extension field for ``usedUnsignedInt``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityResponseInsuranceItemBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"allowedUnsignedInt\",\n            \"allowedString\",\n            \"allowedMoney\",\n            \"usedUnsignedInt\",\n            \"usedString\",\n            \"usedMoney\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseInsuranceItemBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"allowed\": [\"allowedMoney\", \"allowedString\", \"allowedUnsignedInt\"],\n            \"used\": [\"usedMoney\", \"usedString\", \"usedUnsignedInt\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/datarequirement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DataRequirement\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass DataRequirement(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes a required data item.\n    Describes a required data item for evaluation in terms of the type of data,\n    and optional code or date-based filters of the data.\n    \"\"\"\n\n    __resource_type__ = \"DataRequirement\"\n\n    codeFilter: typing.List[fhirtypes.DataRequirementCodeFilterType] | None = Field(\n        default=None,\n        alias=\"codeFilter\",\n        title=\"What codes are expected\",\n        description=(\n            \"Code filters specify additional constraints on the data, specifying \"\n            \"the value set of interest for a particular element of the data. Each \"\n            \"code filter defines an additional constraint on the data, i.e. code \"\n            \"filters are AND'ed, not OR'ed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dateFilter: typing.List[fhirtypes.DataRequirementDateFilterType] | None = Field(\n        default=None,\n        alias=\"dateFilter\",\n        title=\"What dates/date ranges are expected\",\n        description=(\n            \"Date filters specify additional constraints on the data in terms of \"\n            \"the applicable date range for specific elements. Each date filter \"\n            \"specifies an additional constraint on the data, i.e. date filters are \"\n            \"AND'ed, not OR'ed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    limit: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"limit\",\n        title=\"Number of results\",\n        description=(\n            \"Specifies a maximum number of results that are required (uses the \"\n            \"_count search parameter).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    limit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_limit\", title=\"Extension field for ``limit``.\"\n    )\n\n    mustSupport: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"mustSupport\",\n        title=(\n            \"Indicates specific structure elements that are referenced by the \"\n            \"knowledge module\"\n        ),\n        description=(\n            \"Indicates that specific elements of the type are referenced by the \"\n            \"knowledge module and must be supported by the consumer in order to \"\n            \"obtain an effective evaluation. This does not mean that a value is \"\n            \"required for this element, only that the consuming system must \"\n            \"understand the element and be able to provide values for it if they \"\n            \"are available.   The value of mustSupport SHALL be a FHIRPath \"\n            \"resolveable on the type of the DataRequirement. The path SHALL consist\"\n            \" only of identifiers, constant indexers, and .resolve() (see the \"\n            \"[Simple FHIRPath Profile](fhirpath.html#simple) for full details).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    mustSupport__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_mustSupport\", title=\"Extension field for ``mustSupport``.\"\n    )\n\n    profile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"The profile of the required data\",\n        description=(\n            \"The profile of the required data, specified as the uri of the profile \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    sort: typing.List[fhirtypes.DataRequirementSortType] | None = Field(\n        default=None,\n        alias=\"sort\",\n        title=\"Order of the results\",\n        description=\"Specifies the order of the results to be returned.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects of the data requirement. If this element is not \"\n            \"provided, a Patient subject is assumed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects of the data requirement. If this element is not \"\n            \"provided, a Patient subject is assumed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of the required data\",\n        description=(\n            \"The type of the required data, specified as the type name of a \"\n            \"resource. For profiles, this value is set to the type of the base \"\n            \"resource of the profile.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataRequirement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"profile\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"mustSupport\",\n            \"codeFilter\",\n            \"dateFilter\",\n            \"limit\",\n            \"sort\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataRequirement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"type\",\n            \"profile\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"mustSupport\",\n            \"codeFilter\",\n            \"dateFilter\",\n            \"limit\",\n            \"sort\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"subject\": [\"subjectCodeableConcept\", \"subjectReference\"]}\n        return one_of_many_fields\n\n\nclass DataRequirementCodeFilter(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What codes are expected.\n    Code filters specify additional constraints on the data, specifying the\n    value set of interest for a particular element of the data. Each code\n    filter defines an additional constraint on the data, i.e. code filters are\n    AND'ed, not OR'ed.\n    \"\"\"\n\n    __resource_type__ = \"DataRequirementCodeFilter\"\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"What code is expected\",\n        description=(\n            \"The codes for the code filter. If values are given, the filter will \"\n            \"return only those data items for which the code-valued attribute \"\n            \"specified by the path has a value that is one of the specified codes. \"\n            \"If codes are specified in addition to a value set, the filter returns \"\n            \"items matching a code in the value set or one of the specified codes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"A code-valued attribute to filter on\",\n        description=(\n            \"The code-valued attribute of the filter. The specified path SHALL be a\"\n            \" FHIRPath resolveable on the specified type of the DataRequirement, \"\n            \"and SHALL consist only of identifiers, constant indexers, and \"\n            \".resolve(). The path is allowed to contain qualifiers (.) to traverse \"\n            \"sub-elements, as well as indexers ([x]) to traverse multiple-\"\n            \"cardinality sub-elements (see the [Simple FHIRPath \"\n            \"Profile](fhirpath.html#simple) for full details). Note that the index \"\n            \"must be an integer constant. The path must resolve to an element of \"\n            \"type code, Coding, or CodeableConcept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    searchParam: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"searchParam\",\n        title=\"A coded (token) parameter to search on\",\n        description=(\n            \"A token parameter that refers to a search parameter defined on the \"\n            \"specified type of the DataRequirement, and which searches on elements \"\n            \"of type code, Coding, or CodeableConcept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    searchParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_searchParam\", title=\"Extension field for ``searchParam``.\"\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Valueset for the filter\",\n        description=(\n            \"The valueset for the code filter. The valueSet and code elements are \"\n            \"additive. If valueSet is specified, the filter will return only those \"\n            \"data items for which the value of the code-valued element specified in\"\n            \" the path is a member of the specified valueset.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataRequirementCodeFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"path\", \"searchParam\", \"valueSet\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataRequirementCodeFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"path\", \"searchParam\", \"valueSet\", \"code\"]\n\n\nclass DataRequirementDateFilter(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What dates/date ranges are expected.\n    Date filters specify additional constraints on the data in terms of the\n    applicable date range for specific elements. Each date filter specifies an\n    additional constraint on the data, i.e. date filters are AND'ed, not OR'ed.\n    \"\"\"\n\n    __resource_type__ = \"DataRequirementDateFilter\"\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"A date-valued attribute to filter on\",\n        description=(\n            \"The date-valued attribute of the filter. The specified path SHALL be a\"\n            \" FHIRPath resolveable on the specified type of the DataRequirement, \"\n            \"and SHALL consist only of identifiers, constant indexers, and \"\n            \".resolve(). The path is allowed to contain qualifiers (.) to traverse \"\n            \"sub-elements, as well as indexers ([x]) to traverse multiple-\"\n            \"cardinality sub-elements (see the [Simple FHIRPath \"\n            \"Profile](fhirpath.html#simple) for full details). Note that the index \"\n            \"must be an integer constant. The path must resolve to an element of \"\n            \"type date, dateTime, Period, Schedule, or Timing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    searchParam: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"searchParam\",\n        title=\"A date valued parameter to search on\",\n        description=(\n            \"A date parameter that refers to a search parameter defined on the \"\n            \"specified type of the DataRequirement, and which searches on elements \"\n            \"of type date, dateTime, Period, Schedule, or Timing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    searchParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_searchParam\", title=\"Extension field for ``searchParam``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"The value of the filter, as a Period, DateTime, or Duration value\",\n        description=(\n            \"The value of the filter. If period is specified, the filter will \"\n            \"return only those data items that fall within the bounds determined by\"\n            \" the Period, inclusive of the period boundaries. If dateTime is \"\n            \"specified, the filter will return only those data items that are equal\"\n            \" to the specified dateTime. If a Duration is specified, the filter \"\n            \"will return only those data items that fall within Duration before \"\n            \"now.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"The value of the filter, as a Period, DateTime, or Duration value\",\n        description=(\n            \"The value of the filter. If period is specified, the filter will \"\n            \"return only those data items that fall within the bounds determined by\"\n            \" the Period, inclusive of the period boundaries. If dateTime is \"\n            \"specified, the filter will return only those data items that are equal\"\n            \" to the specified dateTime. If a Duration is specified, the filter \"\n            \"will return only those data items that fall within Duration before \"\n            \"now.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"The value of the filter, as a Period, DateTime, or Duration value\",\n        description=(\n            \"The value of the filter. If period is specified, the filter will \"\n            \"return only those data items that fall within the bounds determined by\"\n            \" the Period, inclusive of the period boundaries. If dateTime is \"\n            \"specified, the filter will return only those data items that are equal\"\n            \" to the specified dateTime. If a Duration is specified, the filter \"\n            \"will return only those data items that fall within Duration before \"\n            \"now.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataRequirementDateFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"path\",\n            \"searchParam\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"valueDuration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataRequirementDateFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"path\", \"searchParam\", \"valueDateTime\", \"valuePeriod\", \"valueDuration\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\"valueDateTime\", \"valueDuration\", \"valuePeriod\"]\n        }\n        return one_of_many_fields\n\n\nclass DataRequirementSort(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Order of the results.\n    Specifies the order of the results to be returned.\n    \"\"\"\n\n    __resource_type__ = \"DataRequirementSort\"\n\n    direction: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"direction\",\n        title=\"ascending | descending\",\n        description=\"The direction of the sort, ascending or descending.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"ascending\", \"descending\"],\n        },\n    )\n    direction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_direction\", title=\"Extension field for ``direction``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"The name of the attribute to perform the sort\",\n        description=(\n            \"The attribute of the sort. The specified path must be resolvable from \"\n            \"the type of the required data. The path is allowed to contain \"\n            \"qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to \"\n            \"traverse multiple-cardinality sub-elements. Note that the index must \"\n            \"be an integer constant.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataRequirementSort`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"path\", \"direction\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataRequirementSort`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"path\", \"direction\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"direction\", \"direction__ext\"), (\"path\", \"path__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/detectedissue.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DetectedIssue\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DetectedIssue(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Clinical issue with action.\n    Indicates an actual or potential clinical issue with or between one or more\n    active or proposed clinical actions for a patient; e.g. Drug-drug\n    interaction, Ineffective treatment frequency, Procedure-condition conflict,\n    etc.\n    \"\"\"\n\n    __resource_type__ = \"DetectedIssue\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"The provider or device that identified the issue\",\n        description=(\n            \"Individual or device responsible for the issue being raised.  For \"\n            \"example, a decision support application or a pharmacist conducting a \"\n            \"medication review.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\", \"Device\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Issue Category, e.g. drug-drug, duplicate therapy, etc.\",\n        description=\"Identifies the general type of issue identified.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    detail: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Description and context\",\n        description=\"A textual explanation of the detected issue.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_detail\", title=\"Extension field for ``detail``.\"\n    )\n\n    evidence: typing.List[fhirtypes.DetectedIssueEvidenceType] | None = Field(\n        default=None,\n        alias=\"evidence\",\n        title=\"Supporting evidence\",\n        description=(\n            \"Supporting evidence or manifestations that provide the basis for \"\n            \"identifying the detected issue such as a GuidanceResponse or \"\n            \"MeasureReport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifiedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"identifiedDateTime\",\n        title=\"When identified\",\n        description=\"The date or period when the detected issue was initially identified.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e identified[x]\n            \"one_of_many\": \"identified\",\n            \"one_of_many_required\": False,\n        },\n    )\n    identifiedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_identifiedDateTime\",\n        title=\"Extension field for ``identifiedDateTime``.\",\n    )\n\n    identifiedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"identifiedPeriod\",\n        title=\"When identified\",\n        description=\"The date or period when the detected issue was initially identified.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e identified[x]\n            \"one_of_many\": \"identified\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique id for the detected issue\",\n        description=\"Business identifier associated with the detected issue record.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    implicated: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"implicated\",\n        title=\"Problem resource\",\n        description=(\n            \"Indicates the resource representing the current activity or proposed \"\n            \"activity that is potentially problematic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    mitigation: typing.List[fhirtypes.DetectedIssueMitigationType] | None = Field(\n        default=None,\n        alias=\"mitigation\",\n        title=\"Step taken to address\",\n        description=(\n            \"Indicates an action that has been taken or is committed to reduce or \"\n            \"eliminate the likelihood of the risk identified by the detected issue \"\n            \"from manifesting.  Can also reflect an observation of known mitigating\"\n            \" factors that may reduce/eliminate the need for any action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"Associated patient\",\n        description=(\n            \"Indicates the patient whose record the detected issue is associated \"\n            \"with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    reference: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Authority for issue\",\n        description=(\n            \"The literature, knowledge-base or similar reference that describes the\"\n            \" propensity for the detected issue identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"high | moderate | low\",\n        description=(\n            \"Indicates the degree of importance associated with the identified \"\n            \"issue based on the potential impact on the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"high\", \"moderate\", \"low\"],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | preliminary | final | amended +\",\n        description=\"Indicates the status of the detected issue.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"registered\", \"preliminary\", \"final\", \"amended\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DetectedIssue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"code\",\n            \"severity\",\n            \"patient\",\n            \"identifiedDateTime\",\n            \"identifiedPeriod\",\n            \"author\",\n            \"implicated\",\n            \"evidence\",\n            \"detail\",\n            \"reference\",\n            \"mitigation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DetectedIssue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"code\",\n            \"severity\",\n            \"patient\",\n            \"identifiedDateTime\",\n            \"identifiedPeriod\",\n            \"author\",\n            \"implicated\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"identified\": [\"identifiedDateTime\", \"identifiedPeriod\"]}\n        return one_of_many_fields\n\n\nclass DetectedIssueEvidence(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supporting evidence.\n    Supporting evidence or manifestations that provide the basis for\n    identifying the detected issue such as a GuidanceResponse or MeasureReport.\n    \"\"\"\n\n    __resource_type__ = \"DetectedIssueEvidence\"\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Manifestation\",\n        description=\"A manifestation that led to the recording of this detected issue.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Supporting information\",\n        description=(\n            \"Links to resources that constitute evidence for the detected issue \"\n            \"such as a GuidanceResponse or MeasureReport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DetectedIssueEvidence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DetectedIssueEvidence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DetectedIssueMitigation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Step taken to address.\n    Indicates an action that has been taken or is committed to reduce or\n    eliminate the likelihood of the risk identified by the detected issue from\n    manifesting.  Can also reflect an observation of known mitigating factors\n    that may reduce/eliminate the need for any action.\n    \"\"\"\n\n    __resource_type__ = \"DetectedIssueMitigation\"\n\n    action: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"action\",\n        title=\"What mitigation?\",\n        description=(\n            \"Describes the action that was taken or the observation that was made \"\n            \"that reduces/eliminates the risk associated with the identified issue.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who is committing?\",\n        description=(\n            \"Identifies the practitioner who determined the mitigation and takes \"\n            \"responsibility for the mitigation step occurring.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date committed\",\n        description=\"Indicates when the mitigating action was documented.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DetectedIssueMitigation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\", \"date\", \"author\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DetectedIssueMitigation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/device.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Device\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Device(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Item used in healthcare.\n    A type of a manufactured item that is used in the provision of healthcare\n    without being substantially changed through that activity. The device may\n    be a medical or non-medical device.\n    \"\"\"\n\n    __resource_type__ = \"Device\"\n\n    contact: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Details for human/organization for support\",\n        description=(\n            \"Contact details for an organization or a particular human that is \"\n            \"responsible for the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"The reference to the definition for the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceDefinition\"],\n        },\n    )\n\n    deviceName: typing.List[fhirtypes.DeviceDeviceNameType] | None = Field(\n        default=None,\n        alias=\"deviceName\",\n        title=\"The name of the device as given by the manufacturer\",\n        description=(\n            \"This represents the manufacturer's name of the device as provided by \"\n            \"the device, from a UDI label, or by a person describing the Device.  \"\n            \"This typically would be used when a person provides the name(s) or \"\n            \"when the device represents one of the names available from \"\n            \"DeviceDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    distinctIdentifier: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"distinctIdentifier\",\n        title=\"The distinct identification string\",\n        description=(\n            \"The distinct identification string as required by regulation for a \"\n            \"human cell, tissue, or cellular and tissue-based product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    distinctIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_distinctIdentifier\",\n        title=\"Extension field for ``distinctIdentifier``.\",\n    )\n\n    expirationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expirationDate\",\n        title=\"Date and time of expiry of this device (if applicable)\",\n        description=(\n            \"The date and time beyond which this device is no longer valid or \"\n            \"should not be used (if applicable).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_expirationDate\",\n        title=\"Extension field for ``expirationDate``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Instance identifier\",\n        description=(\n            \"Unique instance identifiers assigned to a device by manufacturers \"\n            \"other organizations or owners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the device is found\",\n        description=\"The place where the device can be found.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    lotNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lotNumber\",\n        title=\"Lot number of manufacture\",\n        description=\"Lot number assigned by the manufacturer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lotNumber\", title=\"Extension field for ``lotNumber``.\"\n    )\n\n    manufactureDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"manufactureDate\",\n        title=\"Date when the device was made\",\n        description=\"The date and time when the device was manufactured.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    manufactureDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_manufactureDate\",\n        title=\"Extension field for ``manufactureDate``.\",\n    )\n\n    manufacturer: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Name of device manufacturer\",\n        description=\"A name of the manufacturer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    manufacturer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_manufacturer\",\n        title=\"Extension field for ``manufacturer``.\",\n    )\n\n    modelNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"modelNumber\",\n        title=\"The manufacturer's model number for the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    modelNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_modelNumber\", title=\"Extension field for ``modelNumber``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Device notes and comments\",\n        description=(\n            \"Descriptive information, usage information or implantation information\"\n            \" that is not captured in an existing element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    owner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"owner\",\n        title=\"Organization responsible for device\",\n        description=(\n            \"An organization that is responsible for the provision and ongoing \"\n            \"maintenance of the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    parent: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"The device that this device is attached to or is part of\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    partNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"partNumber\",\n        title=\"The part number or catalog number of the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    partNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_partNumber\", title=\"Extension field for ``partNumber``.\"\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"Patient to whom Device is affixed\",\n        description=\"Patient information, If the device is affixed to a person.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    property: typing.List[fhirtypes.DevicePropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=(\n            \"The actual configuration settings of a device as it actually operates,\"\n            \" e.g., regulation status, time properties\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    safety: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"safety\",\n        title=\"Safety Characteristics of Device\",\n        description=(\n            \"Provides additional safety characteristics about a medical device.  \"\n            \"For example devices containing latex.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serialNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"serialNumber\",\n        title=\"Serial number assigned by the manufacturer\",\n        description=(\n            \"The serial number assigned by the organization when the device was \"\n            \"manufactured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    serialNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_serialNumber\",\n        title=\"Extension field for ``serialNumber``.\",\n    )\n\n    specialization: typing.List[fhirtypes.DeviceSpecializationType] | None = Field(\n        default=None,\n        alias=\"specialization\",\n        title=(\n            \"The capabilities supported on a  device, the standards to which the \"\n            \"device conforms for a particular purpose, and used for the \"\n            \"communication\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error | unknown\",\n        description=\"Status of the Device availability.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=(\n            \"online | paused | standby | offline | not-ready | transduc-discon | \"\n            \"hw-discon | off\"\n        ),\n        description=\"Reason for the dtatus of the Device availability.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind or type of device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udiCarrier: typing.List[fhirtypes.DeviceUdiCarrierType] | None = Field(\n        default=None,\n        alias=\"udiCarrier\",\n        title=\"Unique Device Identifier (UDI) Barcode string\",\n        description=(\n            \"Unique device identifier (UDI) assigned to device label or package.  \"\n            \"Note that the Device may include multiple udiCarriers as it either may\"\n            \" include just the udiCarrier for the jurisdiction it is sold, or for \"\n            \"multiple jurisdictions it could have been sold.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Network address to contact device\",\n        description=\"A network address on which the device may be contacted directly.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    version: typing.List[fhirtypes.DeviceVersionType] | None = Field(\n        default=None,\n        alias=\"version\",\n        title=(\n            \"The actual design of the device or software version running on the \"\n            \"device\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Device`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definition\",\n            \"udiCarrier\",\n            \"status\",\n            \"statusReason\",\n            \"distinctIdentifier\",\n            \"manufacturer\",\n            \"manufactureDate\",\n            \"expirationDate\",\n            \"lotNumber\",\n            \"serialNumber\",\n            \"deviceName\",\n            \"modelNumber\",\n            \"partNumber\",\n            \"type\",\n            \"specialization\",\n            \"version\",\n            \"property\",\n            \"patient\",\n            \"owner\",\n            \"contact\",\n            \"location\",\n            \"url\",\n            \"note\",\n            \"safety\",\n            \"parent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Device`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"udiCarrier\", \"status\", \"safety\"]\n\n\nclass DeviceDeviceName(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The name of the device as given by the manufacturer.\n    This represents the manufacturer's name of the device as provided by the\n    device, from a UDI label, or by a person describing the Device.  This\n    typically would be used when a person provides the name(s) or when the\n    device represents one of the names available from DeviceDefinition.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDeviceName\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The name that identifies the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"udi-label-name | user-friendly-name | patient-reported-name | \"\n            \"manufacturer-name | model-name | other\"\n        ),\n        description=(\n            \"The type of deviceName. UDILabelName | UserFriendlyName | \"\n            \"PatientReportedName | ManufactureDeviceName | ModelName.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"udi-label-name\",\n                \"user-friendly-name\",\n                \"patient-reported-name\",\n                \"manufacturer-name\",\n                \"model-name\",\n                \"other\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDeviceName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDeviceName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass DeviceProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The actual configuration settings of a device as it actually operates,\n    e.g., regulation status, time properties.\n    \"\"\"\n\n    __resource_type__ = \"DeviceProperty\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=(\n            \"Code that specifies the property DeviceDefinitionPropetyCode \"\n            \"(Extensible)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Property value as a code, e.g., NTP4 (synced to NTP)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueQuantity: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Property value as a quantity\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueQuantity\",\n            \"valueCode\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DeviceSpecialization(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The capabilities supported on a  device, the standards to which the device\n    conforms for a particular purpose, and used for the communication.\n    \"\"\"\n\n    __resource_type__ = \"DeviceSpecialization\"\n\n    systemType: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"systemType\",\n        title=\"The standard that is used to operate and communicate\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"The version of the standard that is used to operate and communicate\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceSpecialization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"systemType\", \"version\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceSpecialization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DeviceUdiCarrier(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Unique Device Identifier (UDI) Barcode string.\n    Unique device identifier (UDI) assigned to device label or package.  Note\n    that the Device may include multiple udiCarriers as it either may include\n    just the udiCarrier for the jurisdiction it is sold, or for multiple\n    jurisdictions it could have been sold.\n    \"\"\"\n\n    __resource_type__ = \"DeviceUdiCarrier\"\n\n    carrierAIDC: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"carrierAIDC\",\n        title=\"UDI Machine Readable Barcode String\",\n        description=(\n            \"The full UDI carrier of the Automatic Identification and Data Capture \"\n            \"(AIDC) technology representation of the barcode string as printed on \"\n            \"the packaging of the device - e.g., a barcode or RFID.   Because of \"\n            \"limitations on character sets in XML and the need to round-trip JSON \"\n            \"data through XML, AIDC Formats *SHALL* be base64 encoded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    carrierAIDC__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_carrierAIDC\", title=\"Extension field for ``carrierAIDC``.\"\n    )\n\n    carrierHRF: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"carrierHRF\",\n        title=\"UDI Human Readable Barcode String\",\n        description=(\n            \"The full UDI carrier as the human readable form (HRF) representation \"\n            \"of the barcode string as printed on the packaging of the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    carrierHRF__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_carrierHRF\", title=\"Extension field for ``carrierHRF``.\"\n    )\n\n    deviceIdentifier: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"deviceIdentifier\",\n        title=\"Mandatory fixed portion of UDI\",\n        description=(\n            \"The device identifier (DI) is a mandatory, fixed portion of a UDI that\"\n            \" identifies the labeler and the specific version or model of a device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    deviceIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deviceIdentifier\",\n        title=\"Extension field for ``deviceIdentifier``.\",\n    )\n\n    entryType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"entryType\",\n        title=\"barcode | rfid | manual +\",\n        description=\"A coded entry to indicate how the data was entered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"barcode\", \"rfid\", \"manual\", \"+\"],\n        },\n    )\n    entryType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_entryType\", title=\"Extension field for ``entryType``.\"\n    )\n\n    issuer: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"issuer\",\n        title=\"UDI Issuing Organization\",\n        description=(\n            \"Organization that is charged with issuing UDIs for devices.  For \"\n            \"example, the US FDA issuers include : 1) GS1:  \"\n            \"http://hl7.org/fhir/NamingSystem/gs1-di,  2) HIBCC: \"\n            \"http://hl7.org/fhir/NamingSystem/hibcc-dI,  3) ICCBBA for blood \"\n            \"containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di,  4) \"\n            \"ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-\"\n            \"other-di.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    issuer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issuer\", title=\"Extension field for ``issuer``.\"\n    )\n\n    jurisdiction: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Regional UDI authority\",\n        description=(\n            \"The identity of the authoritative source for UDI generation within a  \"\n            \"jurisdiction.  All UDIs are globally unique within a single namespace \"\n            \"with the appropriate repository uri as the system.  For example,  UDIs\"\n            \" of devices managed in the U.S. by the FDA, the value is  \"\n            \"http://hl7.org/fhir/NamingSystem/fda-udi.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    jurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_jurisdiction\",\n        title=\"Extension field for ``jurisdiction``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceUdiCarrier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"deviceIdentifier\",\n            \"issuer\",\n            \"jurisdiction\",\n            \"carrierAIDC\",\n            \"carrierHRF\",\n            \"entryType\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceUdiCarrier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"deviceIdentifier\", \"carrierAIDC\", \"carrierHRF\"]\n\n\nclass DeviceVersion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The actual design of the device or software version running on the device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceVersion\"\n\n    component: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"A single component of the device version\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of the device version, e.g. manufacturer, approved, internal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The version text\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"component\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/devicedefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DeviceDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An instance of a medical-related component of a medical device.\n    The characteristics, operational status and capabilities of a medical-\n    related component of a medical device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinition\"\n\n    capability: typing.List[fhirtypes.DeviceDefinitionCapabilityType] | None = Field(\n        default=None,\n        alias=\"capability\",\n        title=\"Device capabilities\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Details for human/organization for support\",\n        description=(\n            \"Contact details for an organization or a particular human that is \"\n            \"responsible for the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    deviceName: typing.List[fhirtypes.DeviceDefinitionDeviceNameType] | None = Field(\n        default=None,\n        alias=\"deviceName\",\n        title=\"A name given to the device to identify it\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Instance identifier\",\n        description=(\n            \"Unique instance identifiers assigned to a device by the software, \"\n            \"manufacturers, other organizations or owners. For example: handle ID.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    languageCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"languageCode\",\n        title=(\n            \"Language code for the human-readable text strings produced by the \"\n            \"device (all supported)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    manufacturerReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"manufacturerReference\",\n        title=\"Name of device manufacturer\",\n        description=\"A name of the manufacturer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e manufacturer[x]\n            \"one_of_many\": \"manufacturer\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    manufacturerString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"manufacturerString\",\n        title=\"Name of device manufacturer\",\n        description=\"A name of the manufacturer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e manufacturer[x]\n            \"one_of_many\": \"manufacturer\",\n            \"one_of_many_required\": False,\n        },\n    )\n    manufacturerString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_manufacturerString\",\n        title=\"Extension field for ``manufacturerString``.\",\n    )\n\n    material: typing.List[fhirtypes.DeviceDefinitionMaterialType] | None = Field(\n        default=None,\n        alias=\"material\",\n        title=\"A substance used to create the material(s) of which the device is made\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modelNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"modelNumber\",\n        title=\"The model number for the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    modelNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_modelNumber\", title=\"Extension field for ``modelNumber``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Device notes and comments\",\n        description=(\n            \"Descriptive information, usage information or implantation information\"\n            \" that is not captured in an existing element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onlineInformation: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"onlineInformation\",\n        title=\"Access to on-line information\",\n        description=\"Access to on-line information about the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    onlineInformation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_onlineInformation\",\n        title=\"Extension field for ``onlineInformation``.\",\n    )\n\n    owner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"owner\",\n        title=\"Organization responsible for device\",\n        description=(\n            \"An organization that is responsible for the provision and ongoing \"\n            \"maintenance of the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    parentDevice: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"parentDevice\",\n        title=\"The parent device it can be part of\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceDefinition\"],\n        },\n    )\n\n    physicalCharacteristics: fhirtypes.ProdCharacteristicType | None = Field(\n        default=None,\n        alias=\"physicalCharacteristics\",\n        title=\"Dimensions, color etc.\",\n        description=\"Dimensions, color etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    property: typing.List[fhirtypes.DeviceDefinitionPropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=(\n            \"The actual configuration settings of a device as it actually operates,\"\n            \" e.g., regulation status, time properties\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=(\n            \"The quantity of the device present in the packaging (e.g. the number \"\n            \"of devices present in a pack, or the number of devices in the same \"\n            \"package of the medicinal product)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    safety: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"safety\",\n        title=\"Safety characteristics of the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    shelfLifeStorage: typing.List[fhirtypes.ProductShelfLifeType] | None = Field(\n        default=None,\n        alias=\"shelfLifeStorage\",\n        title=\"Shelf Life and storage information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specialization: typing.List[\n        fhirtypes.DeviceDefinitionSpecializationType\n    ] | None = Field(\n        default=None,\n        alias=\"specialization\",\n        title=(\n            \"The capabilities supported on a  device, the standards to which the \"\n            \"device conforms for a particular purpose, and used for the \"\n            \"communication\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"What kind of device or device system this is\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udiDeviceIdentifier: typing.List[\n        fhirtypes.DeviceDefinitionUdiDeviceIdentifierType\n    ] | None = Field(\n        default=None,\n        alias=\"udiDeviceIdentifier\",\n        title=\"Unique Device Identifier (UDI) Barcode string\",\n        description=(\n            \"Unique device identifier (UDI) assigned to device label or package.  \"\n            \"Note that the Device may include multiple udiCarriers as it either may\"\n            \" include just the udiCarrier for the jurisdiction it is sold, or for \"\n            \"multiple jurisdictions it could have been sold.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Network address to contact device\",\n        description=\"A network address on which the device may be contacted directly.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    version: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Available versions\",\n        description=\"The available versions of the device, e.g., software versions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    version__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"udiDeviceIdentifier\",\n            \"manufacturerString\",\n            \"manufacturerReference\",\n            \"deviceName\",\n            \"modelNumber\",\n            \"type\",\n            \"specialization\",\n            \"version\",\n            \"safety\",\n            \"shelfLifeStorage\",\n            \"physicalCharacteristics\",\n            \"languageCode\",\n            \"capability\",\n            \"property\",\n            \"owner\",\n            \"contact\",\n            \"url\",\n            \"onlineInformation\",\n            \"note\",\n            \"quantity\",\n            \"parentDevice\",\n            \"material\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"safety\", \"parentDevice\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"manufacturer\": [\"manufacturerReference\", \"manufacturerString\"]\n        }\n        return one_of_many_fields\n\n\nclass DeviceDefinitionCapability(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Device capabilities.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionCapability\"\n\n    description: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of capability\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of capability\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionCapability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"description\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionCapability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DeviceDefinitionDeviceName(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A name given to the device to identify it.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionDeviceName\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The name of the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"udi-label-name | user-friendly-name | patient-reported-name | \"\n            \"manufacturer-name | model-name | other\"\n        ),\n        description=(\n            \"The type of deviceName. UDILabelName | UserFriendlyName | \"\n            \"PatientReportedName | ManufactureDeviceName | ModelName.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"udi-label-name\",\n                \"user-friendly-name\",\n                \"patient-reported-name\",\n                \"manufacturer-name\",\n                \"model-name\",\n                \"other\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionDeviceName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionDeviceName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass DeviceDefinitionMaterial(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A substance used to create the material(s) of which the device is made.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionMaterial\"\n\n    allergenicIndicator: bool | None = Field(\n        default=None,\n        alias=\"allergenicIndicator\",\n        title=\"Whether the substance is a known or suspected allergen\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    allergenicIndicator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allergenicIndicator\",\n        title=\"Extension field for ``allergenicIndicator``.\",\n    )\n\n    alternate: bool | None = Field(\n        default=None,\n        alias=\"alternate\",\n        title=\"Indicates an alternative material of the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    alternate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_alternate\", title=\"Extension field for ``alternate``.\"\n    )\n\n    substance: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"substance\",\n        title=\"The substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionMaterial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"substance\",\n            \"alternate\",\n            \"allergenicIndicator\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionMaterial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DeviceDefinitionProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The actual configuration settings of a device as it actually operates,\n    e.g., regulation status, time properties.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionProperty\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=(\n            \"Code that specifies the property DeviceDefinitionPropetyCode \"\n            \"(Extensible)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Property value as a code, e.g., NTP4 (synced to NTP)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueQuantity: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Property value as a quantity\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueQuantity\",\n            \"valueCode\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DeviceDefinitionSpecialization(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The capabilities supported on a  device, the standards to which the device\n    conforms for a particular purpose, and used for the communication.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionSpecialization\"\n\n    systemType: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"systemType\",\n        title=\"The standard that is used to operate and communicate\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    systemType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_systemType\", title=\"Extension field for ``systemType``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"The version of the standard that is used to operate and communicate\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionSpecialization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"systemType\", \"version\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionSpecialization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"systemType\", \"systemType__ext\")]\n        return required_fields\n\n\nclass DeviceDefinitionUdiDeviceIdentifier(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Unique Device Identifier (UDI) Barcode string.\n    Unique device identifier (UDI) assigned to device label or package.  Note\n    that the Device may include multiple udiCarriers as it either may include\n    just the udiCarrier for the jurisdiction it is sold, or for multiple\n    jurisdictions it could have been sold.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionUdiDeviceIdentifier\"\n\n    deviceIdentifier: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"deviceIdentifier\",\n        title=(\n            \"The identifier that is to be associated with every Device that \"\n            \"references this DeviceDefintiion for the issuer and jurisdication \"\n            \"porvided in the DeviceDefinition.udiDeviceIdentifier\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    deviceIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deviceIdentifier\",\n        title=\"Extension field for ``deviceIdentifier``.\",\n    )\n\n    issuer: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"issuer\",\n        title=\"The organization that assigns the identifier algorithm\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    issuer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issuer\", title=\"Extension field for ``issuer``.\"\n    )\n\n    jurisdiction: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"The jurisdiction to which the deviceIdentifier applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    jurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_jurisdiction\",\n        title=\"Extension field for ``jurisdiction``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionUdiDeviceIdentifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"deviceIdentifier\",\n            \"issuer\",\n            \"jurisdiction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionUdiDeviceIdentifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"deviceIdentifier\", \"deviceIdentifier__ext\"),\n            (\"issuer\", \"issuer__ext\"),\n            (\"jurisdiction\", \"jurisdiction__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/devicemetric.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceMetric\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DeviceMetric(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Measurement, calculation or setting capability of a medical device.\n    Describes a measurement, calculation or setting capability of a medical\n    device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceMetric\"\n\n    calibration: typing.List[fhirtypes.DeviceMetricCalibrationType] | None = Field(\n        default=None,\n        alias=\"calibration\",\n        title=(\n            \"Describes the calibrations that have been performed or that are \"\n            \"required to be performed\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"measurement | setting | calculation | unspecified\",\n        description=(\n            \"Indicates the category of the observation generation process. A \"\n            \"DeviceMetric can be for example a setting, measurement, or \"\n            \"calculation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"measurement\", \"setting\", \"calculation\", \"unspecified\"],\n        },\n    )\n    category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_category\", title=\"Extension field for ``category``.\"\n    )\n\n    color: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"color\",\n        title=\"black | red | green | yellow | blue | magenta | cyan | white\",\n        description=(\n            \"Describes the color representation for the metric. This is often used \"\n            \"to aid clinicians to track and identify parameter types by color. In \"\n            \"practice, consider a Patient Monitor that has ECG/HR and Pleth for \"\n            \"example; the parameters are displayed in different characteristic \"\n            \"colors, such as HR-blue, BP-green, and PR and SpO2- magenta.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"black\",\n                \"red\",\n                \"green\",\n                \"yellow\",\n                \"blue\",\n                \"magenta\",\n                \"cyan\",\n                \"white\",\n            ],\n        },\n    )\n    color__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_color\", title=\"Extension field for ``color``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Instance identifier\",\n        description=(\n            \"Unique instance identifiers assigned to a device by the device or \"\n            \"gateway software, manufacturers, other organizations or owners. For \"\n            \"example: handle ID.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    measurementPeriod: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"measurementPeriod\",\n        title=\"Describes the measurement repetition time\",\n        description=(\n            \"Describes the measurement repetition time. This is not necessarily the\"\n            \" same as the update period. The measurement repetition time can range \"\n            \"from milliseconds up to hours. An example for a measurement repetition\"\n            \" time in the range of milliseconds is the sampling rate of an ECG. An \"\n            \"example for a measurement repetition time in the range of hours is a \"\n            \"NIBP that is triggered automatically every hour. The update period may\"\n            \" be different than the measurement repetition time, if the device does\"\n            \" not update the published observed value with the same frequency as it\"\n            \" was measured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    operationalStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"operationalStatus\",\n        title=\"on | off | standby | entered-in-error\",\n        description=(\n            \"Indicates current operational state of the device. For example: On, \"\n            \"Off, Standby, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"on\", \"off\", \"standby\", \"entered-in-error\"],\n        },\n    )\n    operationalStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_operationalStatus\",\n        title=\"Extension field for ``operationalStatus``.\",\n    )\n\n    parent: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Describes the link to the parent Device\",\n        description=(\n            \"Describes the link to the  Device that this DeviceMetric belongs to \"\n            \"and that provide information about the location of this DeviceMetric \"\n            \"in the containment structure of the parent Device. An example would be\"\n            \" a Device that represents a Channel. This reference can be used by a \"\n            \"client application to distinguish DeviceMetrics that have the same \"\n            \"type, but should be interpreted based on their containment location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Describes the link to the source Device\",\n        description=(\n            \"Describes the link to the  Device that this DeviceMetric belongs to \"\n            \"and that contains administrative device information such as \"\n            \"manufacturer, serial number, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Identity of metric, for example Heart Rate or PEEP Setting\",\n        description=(\n            \"Describes the type of the metric. For example: Heart Rate, PEEP \"\n            \"Setting, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    unit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Unit of Measure for the Metric\",\n        description=(\n            \"Describes the unit that an observed value determined for this metric \"\n            \"will have. For example: Percent, Seconds, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceMetric`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"unit\",\n            \"source\",\n            \"parent\",\n            \"operationalStatus\",\n            \"color\",\n            \"category\",\n            \"measurementPeriod\",\n            \"calibration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceMetric`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"type\",\n            \"unit\",\n            \"source\",\n            \"parent\",\n            \"operationalStatus\",\n            \"color\",\n            \"category\",\n            \"measurementPeriod\",\n            \"calibration\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"category\", \"category__ext\")]\n        return required_fields\n\n\nclass DeviceMetricCalibration(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes the calibrations that have been performed or that are required to\n    be performed.\n    \"\"\"\n\n    __resource_type__ = \"DeviceMetricCalibration\"\n\n    state: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"state\",\n        title=\"not-calibrated | calibration-required | calibrated | unspecified\",\n        description=\"Describes the state of the calibration.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"not-calibrated\",\n                \"calibration-required\",\n                \"calibrated\",\n                \"unspecified\",\n            ],\n        },\n    )\n    state__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_state\", title=\"Extension field for ``state``.\"\n    )\n\n    time: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"time\",\n        title=\"Describes the time last calibration has been performed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_time\", title=\"Extension field for ``time``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"unspecified | offset | gain | two-point\",\n        description=\"Describes the type of the calibration method.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"unspecified\", \"offset\", \"gain\", \"two-point\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceMetricCalibration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"state\", \"time\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceMetricCalibration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"state\", \"time\"]\n"
  },
  {
    "path": "fhir/resources/R4B/devicerequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DeviceRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Medical device request.\n    Represents a request for a patient to employ a medical device. The device\n    may be an implantable device, or an external assistive device, such as a\n    walker.\n    \"\"\"\n\n    __resource_type__ = \"DeviceRequest\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When recorded\",\n        description=\"When the request transitioned to being actionable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What request fulfills\",\n        description=\"Plan/proposal/order fulfilled by this request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    codeCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"codeCodeableConcept\",\n        title=\"Device requested\",\n        description=\"The details of the device to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e code[x]\n            \"one_of_many\": \"code\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    codeReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"codeReference\",\n        title=\"Device requested\",\n        description=\"The details of the device to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e code[x]\n            \"one_of_many\": \"code\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter motivating request\",\n        description=(\n            \"An encounter that provides additional context in which this request is\"\n            \" made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Identifier of composite request\",\n        description=\"Composite request this is part of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Request identifier\",\n        description=\"Identifiers assigned to this order by the orderer or by the receiver.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"DeviceRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this DeviceRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    insurance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Associated insurance coverage\",\n        description=(\n            \"Insurance plans, coverage extensions, pre-authorizations and/or pre-\"\n            \"determinations that may be required for delivering the requested \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\", \"ClaimResponse\"],\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"proposal | plan | directive | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            \"Whether the request is a proposal, plan, an original order or a reflex\"\n            \" order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposal\",\n                \"plan\",\n                \"directive\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Notes or comments\",\n        description=(\n            \"Details about this request that were not represented at all or \"\n            \"sufficiently in one of the attributes provided in a class. These may \"\n            \"include for example a comment, an instruction, or a note associated \"\n            \"with the statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"Desired time or schedule for use\",\n        description=(\n            \"The timing schedule for the use of the device. The Schedule data type \"\n            'allows many different expressions, for example. \"Every 8 hours\"; '\n            '\"Three times a day\"; \"1/2 an hour before breakfast for 10 days from '\n            '23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"Desired time or schedule for use\",\n        description=(\n            \"The timing schedule for the use of the device. The Schedule data type \"\n            'allows many different expressions, for example. \"Every 8 hours\"; '\n            '\"Three times a day\"; \"1/2 an hour before breakfast for 10 days from '\n            '23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"Desired time or schedule for use\",\n        description=(\n            \"The timing schedule for the use of the device. The Schedule data type \"\n            'allows many different expressions, for example. \"Every 8 hours\"; '\n            '\"Three times a day\"; \"1/2 an hour before breakfast for 10 days from '\n            '23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    parameter: typing.List[fhirtypes.DeviceRequestParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Device details\",\n        description=(\n            \"Specific parameters for the ordered item.  For example, the prism \"\n            \"value for lenses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Requested Filler\",\n        description=\"The desired performer for doing the diagnostic testing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"HealthcareService\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    performerType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=\"Filler role\",\n        description=\"Desired type of performer for doing the diagnostic testing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    priorRequest: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"priorRequest\",\n        title=\"What request replaces\",\n        description=(\n            \"The request takes the place of the referenced completed or terminated \"\n            \"request(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the {{title}} should be addressed with respect \"\n            \"to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Coded Reason for request\",\n        description=\"Reason or justification for the use of this device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Linked Reason for request\",\n        description=\"Reason or justification for the use of this device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Request provenance\",\n        description=\"Key events in the history of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/what is requesting diagnostics\",\n        description=(\n            \"The individual who initiated the request and has responsibility for \"\n            \"its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | on-hold | revoked | completed | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=\"The status of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"on-hold\",\n                \"revoked\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Focus of request\",\n        description=\"The patient who will use the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Location\", \"Device\"],\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Additional clinical information\",\n        description=(\n            \"Additional clinical information about the patient that may influence \"\n            \"the request fulfilment.  For example, this may include where on the \"\n            \"subject's body the device will be used (i.e. the target site).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"priorRequest\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"codeReference\",\n            \"codeCodeableConcept\",\n            \"parameter\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"authoredOn\",\n            \"requester\",\n            \"performerType\",\n            \"performer\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"insurance\",\n            \"supportingInfo\",\n            \"note\",\n            \"relevantHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"priorRequest\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"codeReference\",\n            \"codeCodeableConcept\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"authoredOn\",\n            \"requester\",\n            \"performerType\",\n            \"performer\",\n            \"reasonCode\",\n            \"reasonReference\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"code\": [\"codeCodeableConcept\", \"codeReference\"],\n            \"occurrence\": [\n                \"occurrenceDateTime\",\n                \"occurrencePeriod\",\n                \"occurrenceTiming\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass DeviceRequestParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Device details.\n    Specific parameters for the ordered item.  For example, the prism value for\n    lenses.\n    \"\"\"\n\n    __resource_type__ = \"DeviceRequestParameter\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Device detail\",\n        description=\"A code or string that identifies the device detail being asserted.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceRequestParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueBoolean\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceRequestParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/deviceusestatement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceUseStatement\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass DeviceUseStatement(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Record of use of a device.\n    A record of a device being used by a patient where the record is the result\n    of a report from the patient or another clinician.\n    \"\"\"\n\n    __resource_type__ = \"DeviceUseStatement\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan, proposal or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this DeviceUseStatement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Target body site\",\n        description=(\n            \"Indicates the anotomic location on the subject's body where the device\"\n            \" was used ( i.e. the target).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Supporting information\",\n        description=(\n            \"Allows linking the DeviceUseStatement to the underlying Request, or to\"\n            \" other information that supports or is used to derive the \"\n            \"DeviceUseStatement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"ServiceRequest\",\n                \"Procedure\",\n                \"Claim\",\n                \"Observation\",\n                \"QuestionnaireResponse\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    device: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"device\",\n        title=\"Reference to device used\",\n        description=\"The details of the device used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier for this record\",\n        description=\"An external identifier for this statement such as an IRI.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Addition details (comments, instructions)\",\n        description=(\n            \"Details about the device statement that were not represented at all or\"\n            \" sufficiently in one of the attributes provided in a class. These may \"\n            \"include for example a comment, an instruction, or a note associated \"\n            \"with the statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why device was used\",\n        description=\"Reason or justification for the use of the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why was DeviceUseStatement performed?\",\n        description=(\n            \"Indicates another resource whose existence justifies this \"\n            \"DeviceUseStatement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n                \"Media\",\n            ],\n        },\n    )\n\n    recordedOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recordedOn\",\n        title=\"When statement was recorded\",\n        description=\"The time at which the statement was made/recorded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    recordedOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recordedOn\", title=\"Extension field for ``recordedOn``.\"\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Who made the statement\",\n        description=\"Who reported the device was being used by the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | completed | entered-in-error +\",\n        description=(\n            \"A code representing the patient or other source's judgment about the \"\n            \"state of the device used that this statement is about.  Generally this\"\n            \" will be active or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"completed\", \"entered-in-error\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Patient using device\",\n        description=\"The patient who used the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    timingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timingDateTime\",\n        title=\"How often  the device was used\",\n        description=\"How often the device was used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timingDateTime\",\n        title=\"Extension field for ``timingDateTime``.\",\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"How often  the device was used\",\n        description=\"How often the device was used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"How often  the device was used\",\n        description=\"How often the device was used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceUseStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"status\",\n            \"subject\",\n            \"derivedFrom\",\n            \"timingTiming\",\n            \"timingPeriod\",\n            \"timingDateTime\",\n            \"recordedOn\",\n            \"source\",\n            \"device\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"bodySite\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceUseStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"basedOn\",\n            \"status\",\n            \"subject\",\n            \"derivedFrom\",\n            \"timingTiming\",\n            \"timingPeriod\",\n            \"timingDateTime\",\n            \"recordedOn\",\n            \"source\",\n            \"device\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"bodySite\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\"timingDateTime\", \"timingPeriod\", \"timingTiming\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/diagnosticreport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DiagnosticReport\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DiagnosticReport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A Diagnostic report - a combination of request information, atomic results,\n    images, interpretation, as well as formatted reports.\n    The findings and interpretation of diagnostic  tests performed on patients,\n    groups of patients, devices, and locations, and/or specimens derived from\n    these. The report includes clinical context such as requesting and provider\n    information, and some mix of atomic results, images, textual and coded\n    interpretations, and formatted representation of diagnostic reports.\n    \"\"\"\n\n    __resource_type__ = \"DiagnosticReport\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What was requested\",\n        description=\"Details concerning a service requested.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"ImmunizationRecommendation\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ServiceRequest\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Service category\",\n        description=(\n            \"A code that classifies the clinical discipline, department or \"\n            \"diagnostic service that created the report (e.g. cardiology, \"\n            \"biochemistry, hematology, MRI). This is used for searching, sorting \"\n            \"and display purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Name/Code for this diagnostic report\",\n        description=\"A code or name that describes this diagnostic report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    conclusion: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"conclusion\",\n        title=\"Clinical conclusion (interpretation) of test results\",\n        description=(\n            \"Concise and clinically contextualized summary conclusion \"\n            \"(interpretation/impression) of the diagnostic report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    conclusion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_conclusion\", title=\"Extension field for ``conclusion``.\"\n    )\n\n    conclusionCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"conclusionCode\",\n        title=\"Codes for the clinical conclusion of test results\",\n        description=(\n            \"One or more codes that represent the summary conclusion \"\n            \"(interpretation/impression) of the diagnostic report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"Clinically relevant time/time-period for report\",\n        description=(\n            \"The time or time-period the observed values are related to. When the \"\n            \"subject of the report is a patient, this is usually either the time of\"\n            \" the procedure or of specimen collection(s), but very often the source\"\n            \" of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"Clinically relevant time/time-period for report\",\n        description=(\n            \"The time or time-period the observed values are related to. When the \"\n            \"subject of the report is a patient, this is usually either the time of\"\n            \" the procedure or of specimen collection(s), but very often the source\"\n            \" of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Health care event when test ordered\",\n        description=(\n            \"The healthcare event  (e.g. a patient and healthcare provider \"\n            \"interaction) which this DiagnosticReport is about.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for report\",\n        description=\"Identifiers assigned to this report by the performer or other systems.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    imagingStudy: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"imagingStudy\",\n        title=(\n            \"Reference to full details of imaging associated with the diagnostic \"\n            \"report\"\n        ),\n        description=(\n            \"One or more links to full details of any imaging performed during the \"\n            \"diagnostic investigation. Typically, this is imaging performed by \"\n            \"DICOM enabled modalities, but this is not required. A fully enabled \"\n            \"PACS viewer can use this information to provide views of the source \"\n            \"images.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ImagingStudy\"],\n        },\n    )\n\n    issued: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"DateTime this version was made\",\n        description=(\n            \"The date and time that this version of the report was made available \"\n            \"to providers, typically after the report was reviewed and verified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    media: typing.List[fhirtypes.DiagnosticReportMediaType] | None = Field(\n        default=None,\n        alias=\"media\",\n        title=\"Key images associated with this report\",\n        description=(\n            \"A list of key images associated with this report. The images are \"\n            \"generally created during the diagnostic process, and may be directly \"\n            \"of the patient, or of treated specimens (i.e. slides of interest).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    performer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Responsible Diagnostic Service\",\n        description=\"The diagnostic service that is responsible for issuing the report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    presentedForm: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"presentedForm\",\n        title=\"Entire report as issued\",\n        description=(\n            \"Rich text representation of the entire result as issued by the \"\n            \"diagnostic service. Multiple formats are allowed but they SHALL be \"\n            \"semantically equivalent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    result: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"Observations\",\n        description=(\n            \"[Observations](observation.html)  that are part of this diagnostic \"\n            \"report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    resultsInterpreter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"resultsInterpreter\",\n        title=\"Primary result interpreter\",\n        description=(\n            \"The practitioner or organization that is responsible for the report's \"\n            \"conclusions and interpretations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    specimen: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Specimens this report is based on\",\n        description=\"Details about the specimens on which this diagnostic report is based.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | partial | preliminary | final +\",\n        description=\"The status of the diagnostic report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"registered\", \"partial\", \"preliminary\", \"final\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The subject of the report - usually, but not always, the patient\",\n        description=(\n            \"The subject of the report. Usually, but not always, this is a patient.\"\n            \" However, diagnostic services also perform analyses on specimens \"\n            \"collected from a variety of other sources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Device\",\n                \"Location\",\n                \"Organization\",\n                \"Procedure\",\n                \"Practitioner\",\n                \"Medication\",\n                \"Substance\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DiagnosticReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"issued\",\n            \"performer\",\n            \"resultsInterpreter\",\n            \"specimen\",\n            \"result\",\n            \"imagingStudy\",\n            \"media\",\n            \"conclusion\",\n            \"conclusionCode\",\n            \"presentedForm\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DiagnosticReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"issued\",\n            \"performer\",\n            \"resultsInterpreter\",\n            \"media\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"effective\": [\"effectiveDateTime\", \"effectivePeriod\"]}\n        return one_of_many_fields\n\n\nclass DiagnosticReportMedia(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Key images associated with this report.\n    A list of key images associated with this report. The images are generally\n    created during the diagnostic process, and may be directly of the patient,\n    or of treated specimens (i.e. slides of interest).\n    \"\"\"\n\n    __resource_type__ = \"DiagnosticReportMedia\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comment about the image (e.g. explanation)\",\n        description=(\n            \"A comment about the image. Typically, this is used to provide an \"\n            \"explanation for why the image is included, or to draw the viewer's \"\n            \"attention to important features.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    link: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"link\",\n        title=\"Reference to the image source\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Media\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DiagnosticReportMedia`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"comment\", \"link\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DiagnosticReportMedia`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"link\"]\n"
  },
  {
    "path": "fhir/resources/R4B/distance.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Distance\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Distance(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A length - a value with a unit that is a physical distance.\n    \"\"\"\n\n    __resource_type__ = \"Distance\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Distance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Distance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/R4B/documentmanifest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DocumentManifest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DocumentManifest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A list that defines a set of documents.\n    A collection of documents compiled for a purpose together with metadata\n    that applies to the collection.\n    \"\"\"\n\n    __resource_type__ = \"DocumentManifest\"\n\n    author: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who and/or what authored the DocumentManifest\",\n        description=(\n            \"Identifies who is the author of the manifest. Manifest author is not \"\n            \"necessarly the author of the references included.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    content: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"content\",\n        title=\"Items in manifest\",\n        description=\"The list of Resources that consist of the parts of this manifest.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"When this document manifest created\",\n        description=(\n            \"When the document manifest was created for submission to the server \"\n            \"(not necessarily the same thing as the actual resource last modified \"\n            \"time, since it may be modified, replicated, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-readable description (title)\",\n        description=(\n            \"Human-readable description of the source document. This is sometimes \"\n            'known as the \"title\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Other identifiers for the manifest\",\n        description=(\n            \"Other identifiers associated with the document manifest, including \"\n            \"version independent  identifiers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    masterIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"masterIdentifier\",\n        title=\"Unique Identifier for the set of documents\",\n        description=(\n            \"A single identifier that uniquely identifies this manifest. \"\n            \"Principally used to refer to the manifest in non-FHIR contexts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Intended to get notified about this set of documents\",\n        description=(\n            \"A patient, practitioner, or organization for which this set of \"\n            \"documents is intended.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    related: typing.List[fhirtypes.DocumentManifestRelatedType] | None = Field(\n        default=None,\n        alias=\"related\",\n        title=\"Related things\",\n        description=\"Related identifiers or resources associated with the DocumentManifest.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    source: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"The source system/application/software\",\n        description=(\n            \"Identifies the source system, application, or software that produced \"\n            \"the document manifest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"current | superseded | entered-in-error\",\n        description=\"The status of this document manifest.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"current\", \"superseded\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The subject of the set of documents\",\n        description=(\n            \"Who or what the set of documents is about. The documents can be about \"\n            \"a person, (patient or healthcare practitioner), a device (i.e. \"\n            \"machine) or even a group of subjects (such as a document about a herd \"\n            \"of farm animals, or a set of patients that share a common exposure). \"\n            \"If the documents cross more than one subject, then more than one \"\n            \"subject is allowed here (unusual use case).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\", \"Group\", \"Device\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of document set\",\n        description=(\n            \"The code specifying the type of clinical activity that resulted in \"\n            \"placing the associated content into the DocumentManifest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentManifest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"masterIdentifier\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"created\",\n            \"author\",\n            \"recipient\",\n            \"source\",\n            \"description\",\n            \"content\",\n            \"related\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentManifest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"masterIdentifier\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"author\",\n            \"description\",\n            \"content\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass DocumentManifestRelated(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Related things.\n    Related identifiers or resources associated with the DocumentManifest.\n    \"\"\"\n\n    __resource_type__ = \"DocumentManifestRelated\"\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers of things that are related\",\n        description=(\n            \"Related identifier to this DocumentManifest.  For example, Order \"\n            \"numbers, accession numbers, XDW workflow numbers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    ref: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"ref\",\n        title=\"Related Resource\",\n        description=(\n            \"Related Resource to this DocumentManifest. For example, Order, \"\n            \"ServiceRequest,  Procedure, EligibilityRequest, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentManifestRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"identifier\", \"ref\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentManifestRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/documentreference.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DocumentReference\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DocumentReference(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reference to a document.\n    A reference to a document of any kind for any purpose. Provides metadata\n    about the document so that the document can be discovered and managed. The\n    scope of a document is any seralized object with a mime-type, so includes\n    formal patient centric documents (CDA), cliical notes, scanned paper, and\n    non-patient specific documents like policy text.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReference\"\n\n    authenticator: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authenticator\",\n        title=\"Who/what authenticated the document\",\n        description=(\n            \"Which person or organization authenticates that this document is \" \"valid.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    author: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who and/or what authored the document\",\n        description=(\n            \"Identifies who is responsible for adding the information to the \"\n            \"document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Categorization of document\",\n        description=(\n            \"A categorization for the type of document referenced - helps for \"\n            \"indexing and searching. This may be implied by or derived from the \"\n            \"code specified in the DocumentReference.type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    content: typing.List[fhirtypes.DocumentReferenceContentType] = Field(\n        default=...,\n        alias=\"content\",\n        title=\"Document referenced\",\n        description=(\n            \"The document and format referenced. There may be multiple content \"\n            \"element repetitions, each with a different format.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.DocumentReferenceContextType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Clinical context of document\",\n        description=\"The clinical context in which the document was prepared.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    custodian: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"custodian\",\n        title=\"Organization which maintains the document\",\n        description=(\n            \"Identifies the organization or group who is responsible for ongoing \"\n            \"maintenance of and access to the document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    date: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When this document reference was created\",\n        description=\"When the document reference was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-readable description\",\n        description=\"Human-readable description of the source document.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    docStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"docStatus\",\n        title=\"preliminary | final | amended | entered-in-error\",\n        description=\"The status of the underlying document.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"preliminary\", \"final\", \"amended\", \"entered-in-error\"],\n        },\n    )\n    docStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_docStatus\", title=\"Extension field for ``docStatus``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Other identifiers for the document\",\n        description=(\n            \"Other identifiers associated with the document, including version \"\n            \"independent identifiers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    masterIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"masterIdentifier\",\n        title=\"Master Version Specific Identifier\",\n        description=(\n            \"Document identifier as assigned by the source of the document. This \"\n            \"identifier is specific to this version of the document. This unique \"\n            \"identifier may be used elsewhere to identify this version of the \"\n            \"document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatesTo: typing.List[fhirtypes.DocumentReferenceRelatesToType] | None = Field(\n        default=None,\n        alias=\"relatesTo\",\n        title=\"Relationships to other documents\",\n        description=(\n            \"Relationships that this document has with other document references \"\n            \"that already exist.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Document security-tags\",\n        description=(\n            \"A set of Security-Tag codes specifying the level of privacy/security \"\n            \"of the Document. Note that DocumentReference.meta.security contains \"\n            'the security labels of the \"reference\" to the document, while '\n            \"DocumentReference.securityLabel contains a snapshot of the security \"\n            \"labels on the document the reference refers to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"current | superseded | entered-in-error\",\n        description=\"The status of this document reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"current\", \"superseded\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who/what is the subject of the document\",\n        description=(\n            \"Who or what the document is about. The document can be about a person,\"\n            \" (patient or healthcare practitioner), a device (e.g. a machine) or \"\n            \"even a group of subjects (such as a document about a herd of farm \"\n            \"animals, or a set of patients that share a common exposure).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\", \"Group\", \"Device\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of document (LOINC if possible)\",\n        description=(\n            \"Specifies the particular kind of document referenced  (e.g. History \"\n            \"and Physical, Discharge Summary, Progress Note). This usually equates \"\n            \"to the purpose of making the document referenced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"masterIdentifier\",\n            \"identifier\",\n            \"status\",\n            \"docStatus\",\n            \"type\",\n            \"category\",\n            \"subject\",\n            \"date\",\n            \"author\",\n            \"authenticator\",\n            \"custodian\",\n            \"relatesTo\",\n            \"description\",\n            \"securityLabel\",\n            \"content\",\n            \"context\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"masterIdentifier\",\n            \"identifier\",\n            \"status\",\n            \"docStatus\",\n            \"type\",\n            \"category\",\n            \"subject\",\n            \"date\",\n            \"author\",\n            \"relatesTo\",\n            \"description\",\n            \"securityLabel\",\n            \"content\",\n            \"context\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass DocumentReferenceContent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Document referenced.\n    The document and format referenced. There may be multiple content element\n    repetitions, each with a different format.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReferenceContent\"\n\n    attachment: fhirtypes.AttachmentType = Field(\n        default=...,\n        alias=\"attachment\",\n        title=\"Where to access the document\",\n        description=(\n            \"The document or URL of the document along with critical metadata to \"\n            \"prove content has integrity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    format: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"format\",\n        title=\"Format/content rules for the document\",\n        description=(\n            \"An identifier of the document encoding, structure, and template that \"\n            \"the document conforms to beyond the base format indicated in the \"\n            \"mimeType.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReferenceContent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"attachment\", \"format\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReferenceContent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"attachment\", \"format\"]\n\n\nclass DocumentReferenceContext(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Clinical context of document.\n    The clinical context in which the document was prepared.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReferenceContext\"\n\n    encounter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Context of the document  content\",\n        description=(\n            \"Describes the clinical encounter or type of care that the document \"\n            \"content is associated with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    event: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"Main clinical acts documented\",\n        description=(\n            \"This list of codes represents the main clinical acts, such as a \"\n            \"colonoscopy or an appendectomy, being documented. In some cases, the \"\n            'event is inherent in the type Code, such as a \"History and Physical '\n            'Report\" in which the procedure being documented is necessarily a '\n            '\"History and Physical\" act.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    facilityType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"facilityType\",\n        title=\"Kind of facility where patient was seen\",\n        description=\"The kind of facility where the patient was seen.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time of service that is being documented\",\n        description=(\n            \"The time period over which the service that is described by the \"\n            \"document was provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    practiceSetting: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"practiceSetting\",\n        title=(\n            \"Additional details about where the content was created (e.g. clinical \"\n            \"specialty)\"\n        ),\n        description=(\n            \"This property may convey specifics about the practice setting where \"\n            \"the content was created, often reflecting the clinical specialty.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    related: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"related\",\n        title=\"Related identifiers or resources\",\n        description=(\n            \"Related identifiers or resources associated with the \" \"DocumentReference.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    sourcePatientInfo: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sourcePatientInfo\",\n        title=\"Patient demographics from source\",\n        description=(\n            \"The Patient Information as known when the document was published. May \"\n            \"be a reference to a version specific, or contained.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReferenceContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"encounter\",\n            \"event\",\n            \"period\",\n            \"facilityType\",\n            \"practiceSetting\",\n            \"sourcePatientInfo\",\n            \"related\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReferenceContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"period\"]\n\n\nclass DocumentReferenceRelatesTo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationships to other documents.\n    Relationships that this document has with other document references that\n    already exist.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReferenceRelatesTo\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"replaces | transforms | signs | appends\",\n        description=\"The type of relationship that this document has with anther document.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"replaces\", \"transforms\", \"signs\", \"appends\"],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    target: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"target\",\n        title=\"Target of the relationship\",\n        description=\"The target document of this relationship.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReferenceRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"target\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReferenceRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"target\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/domainresource.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DomainResource\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import fhirtypes, resource\n\n\nclass DomainResource(resource.Resource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A resource with narrative, extensions, and contained resources.\n    A resource that includes narrative, extensions, and contained resources.\n    \"\"\"\n\n    __resource_type__ = \"DomainResource\"\n\n    contained: typing.List[fhirtypes.ResourceType] | None = Field(\n        default=None,\n        alias=\"contained\",\n        title=\"Contained, inline Resources\",\n        description=(\n            \"These resources do not have an independent existence apart from the \"\n            \"resource that contains them - they cannot be identified independently,\"\n            \" and nor can they have their own independent transaction scope.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    extension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"extension\",\n        title=\"Additional content defined by implementations\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the resource. To make the use of extensions \"\n            \"safe and manageable, there is a strict set of governance  applied to \"\n            \"the definition and use of extensions. Though any implementer can \"\n            \"define an extension, there is a set of requirements that SHALL be met \"\n            \"as part of the definition of the extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"modifierExtension\",\n        title=\"Extensions that cannot be ignored\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the resource and that modifies the \"\n            \"understanding of the element that contains it and/or the understanding\"\n            \" of the containing element's descendants. Usually modifier elements \"\n            \"provide negation or qualification. To make the use of extensions safe \"\n            \"and manageable, there is a strict set of governance applied to the \"\n            \"definition and use of extensions. Though any implementer is allowed to\"\n            \" define an extension, there is a set of requirements that SHALL be met\"\n            \" as part of the definition of the extension. Applications processing a\"\n            \" resource are required to check for modifier extensions.  Modifier \"\n            \"extensions SHALL NOT change the meaning of any elements on Resource or\"\n            \" DomainResource (including cannot change the meaning of \"\n            \"modifierExtension itself).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.NarrativeType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text summary of the resource, for human interpretation\",\n        description=(\n            \"A human-readable narrative that contains a summary of the resource and\"\n            \" can be used to represent the content of the resource to a human. The \"\n            \"narrative need not encode all the structured data, but is required to \"\n            'contain sufficient detail to make it \"clinically safe\" for a human to '\n            \"just read the narrative. Resource definitions may define what content \"\n            \"should be represented in the narrative to ensure clinical safety.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DomainResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DomainResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\"]\n"
  },
  {
    "path": "fhir/resources/R4B/dosage.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Dosage\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, element, fhirtypes\n\n\nclass Dosage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    How the medication is/was taken or should be taken.\n    Indicates how the medication is/was taken or should be taken by the\n    patient.\n    \"\"\"\n\n    __resource_type__ = \"Dosage\"\n\n    additionalInstruction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"additionalInstruction\",\n        title=(\n            'Supplemental instruction or warnings to the patient - e.g. \"with '\n            'meals\", \"may cause drowsiness\"'\n        ),\n        description=(\n            \"Supplemental instructions to the patient on how to take the medication\"\n            '  (e.g. \"with meals\" or\"take half to one hour before food\") or '\n            'warnings for the patient about the medication (e.g. \"may cause '\n            'drowsiness\" or \"avoid exposure of skin to direct sunlight or '\n            'sunlamps\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    asNeededBoolean: bool | None = Field(\n        default=None,\n        alias=\"asNeededBoolean\",\n        title='Take \"as needed\" (for x)',\n        description=(\n            \"Indicates whether the Medication is only taken when needed within a \"\n            \"specific dosing schedule (Boolean option), or it indicates the \"\n            \"precondition for taking the Medication (CodeableConcept).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n    asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_asNeededBoolean\",\n        title=\"Extension field for ``asNeededBoolean``.\",\n    )\n\n    asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"asNeededCodeableConcept\",\n        title='Take \"as needed\" (for x)',\n        description=(\n            \"Indicates whether the Medication is only taken when needed within a \"\n            \"specific dosing schedule (Boolean option), or it indicates the \"\n            \"precondition for taking the Medication (CodeableConcept).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    doseAndRate: typing.List[fhirtypes.DosageDoseAndRateType] | None = Field(\n        default=None,\n        alias=\"doseAndRate\",\n        title=\"Amount of medication administered\",\n        description=\"The amount of medication administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxDosePerAdministration: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxDosePerAdministration\",\n        title=\"Upper limit on medication per administration\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxDosePerLifetime: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxDosePerLifetime\",\n        title=\"Upper limit on medication per lifetime of the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxDosePerPeriod: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"maxDosePerPeriod\",\n        title=\"Upper limit on medication per unit of time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Technique for administering medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patientInstruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"patientInstruction\",\n        title=\"Patient or consumer oriented instructions\",\n        description=\"Instructions in terms that are understood by the patient or consumer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    patientInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patientInstruction\",\n        title=\"Extension field for ``patientInstruction``.\",\n    )\n\n    route: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"route\",\n        title=\"How drug should enter body\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"The order of the dosage instructions\",\n        description=(\n            \"Indicates the order in which the dosage instructions should be applied\"\n            \" or interpreted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    site: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Body site to administer to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Free text dosage instructions e.g. SIG\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    timing: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timing\",\n        title=\"When medication should be administered\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Dosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"text\",\n            \"additionalInstruction\",\n            \"patientInstruction\",\n            \"timing\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n            \"site\",\n            \"route\",\n            \"method\",\n            \"doseAndRate\",\n            \"maxDosePerPeriod\",\n            \"maxDosePerAdministration\",\n            \"maxDosePerLifetime\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Dosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"sequence\",\n            \"text\",\n            \"additionalInstruction\",\n            \"patientInstruction\",\n            \"timing\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n            \"site\",\n            \"route\",\n            \"method\",\n            \"doseAndRate\",\n            \"maxDosePerPeriod\",\n            \"maxDosePerAdministration\",\n            \"maxDosePerLifetime\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"asNeeded\": [\"asNeededBoolean\", \"asNeededCodeableConcept\"]\n        }\n        return one_of_many_fields\n\n\nclass DosageDoseAndRate(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Amount of medication administered.\n    The amount of medication administered.\n    \"\"\"\n\n    __resource_type__ = \"DosageDoseAndRate\"\n\n    doseQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"doseQuantity\",\n        title=\"Amount of medication per dose\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e dose[x]\n            \"one_of_many\": \"dose\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    doseRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"doseRange\",\n        title=\"Amount of medication per dose\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e dose[x]\n            \"one_of_many\": \"dose\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"rateQuantity\",\n        title=\"Amount of medication per unit of time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"rateRange\",\n        title=\"Amount of medication per unit of time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"rateRatio\",\n        title=\"Amount of medication per unit of time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of dose or rate specified\",\n        description=(\n            \"The kind of dose or rate specified, for example, ordered or \" \"calculated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DosageDoseAndRate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"doseRange\",\n            \"doseQuantity\",\n            \"rateRatio\",\n            \"rateRange\",\n            \"rateQuantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DosageDoseAndRate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"type\",\n            \"doseRange\",\n            \"doseQuantity\",\n            \"rateRatio\",\n            \"rateRange\",\n            \"rateQuantity\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"dose\": [\"doseQuantity\", \"doseRange\"],\n            \"rate\": [\"rateQuantity\", \"rateRange\", \"rateRatio\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/duration.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Duration\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Duration(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A length of time.\n    \"\"\"\n\n    __resource_type__ = \"Duration\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Duration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Duration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/R4B/element.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Element\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom fhir_core import fhirabstractmodel\nfrom pydantic import Field\n\nfrom . import fhirtypes\n\n\nclass Element(fhirabstractmodel.FHIRAbstractModel):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base for all elements.\n    Base definition for all elements in a resource.\n    \"\"\"\n\n    __resource_type__ = \"Element\"\n\n    extension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"extension\",\n        title=\"Additional content defined by implementations\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the element. To make the use of extensions \"\n            \"safe and manageable, there is a strict set of governance  applied to \"\n            \"the definition and use of extensions. Though any implementer can \"\n            \"define an extension, there is a set of requirements that SHALL be met \"\n            \"as part of the definition of the extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    id: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"id\",\n        title=\"Unique id for inter-element referencing\",\n        description=(\n            \"Unique id for the element within a resource (for internal references).\"\n            \" This may be any string value that does not contain spaces.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Element`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Element`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n"
  },
  {
    "path": "fhir/resources/R4B/elementdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ElementDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, element, fhirtypes\n\n\nclass ElementDefinition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of an element in a resource or extension.\n    Captures constraints on each element within the resource, profile, or\n    extension.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinition\"\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=\"Other names\",\n        description=\"Identifies additional names by which this element might also be known.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    base: fhirtypes.ElementDefinitionBaseType | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"Base definition information for tools\",\n        description=(\n            \"Information about the base definition of the element, provided to make\"\n            \" it unnecessary for tools to trace the deviation of the element \"\n            \"through the derived and related profiles. When the element definition \"\n            \"is not the original definition of an element - i.g. either in a \"\n            \"constraint on another type, or for elements from a super type in a \"\n            \"snap shot - then the information in provided in the element definition\"\n            \" may be different to the base definition. On the original definition \"\n            \"of the element, it will be same.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    binding: fhirtypes.ElementDefinitionBindingType | None = Field(\n        default=None,\n        alias=\"binding\",\n        title=\"ValueSet details if this is coded\",\n        description=(\n            \"Binds to a value set if this element is coded (code, Coding, \"\n            \"CodeableConcept, Quantity), or the data types (string, uri).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Corresponding codes in terminologies\",\n        description=(\n            \"A code that has the same meaning as the element in a particular \"\n            \"terminology.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments about the use of this element\",\n        description=(\n            \"Explanatory notes and implementation guidance about the data element, \"\n            \"including notes about how to use the data properly, exceptions to \"\n            \"proper use, etc. (Note: The text you are reading is specified in \"\n            \"ElementDefinition.comment).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    condition: typing.List[fhirtypes.IdType | None] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Reference to invariant about presence\",\n        description=(\n            \"A reference to an invariant that may make additional statements about \"\n            \"the cardinality or value in the instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    condition__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_condition\", title=\"Extension field for ``condition``.\"\n    )\n\n    constraint: typing.List[fhirtypes.ElementDefinitionConstraintType] | None = Field(\n        default=None,\n        alias=\"constraint\",\n        title=\"Condition that must evaluate to true\",\n        description=(\n            \"Formal constraints such as co-occurrence and other constraints that \"\n            \"can be computationally evaluated within the context of the instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contentReference: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Reference to definition of content for the element\",\n        description=(\n            \"Identifies an element defined elsewhere in the definition whose \"\n            \"content rules should be applied to the current element. \"\n            \"ContentReferences bring across all the rules that are in the \"\n            \"ElementDefinition for the element, including definitions, cardinality \"\n            \"constraints, bindings, invariants etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    contentReference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_contentReference\",\n        title=\"Extension field for ``contentReference``.\",\n    )\n\n    defaultValueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"defaultValueAddress\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"defaultValueAge\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"defaultValueAnnotation\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"defaultValueAttachment\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"defaultValueBase64Binary\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueBase64Binary\",\n        title=\"Extension field for ``defaultValueBase64Binary``.\",\n    )\n\n    defaultValueBoolean: bool | None = Field(\n        default=None,\n        alias=\"defaultValueBoolean\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueBoolean\",\n        title=\"Extension field for ``defaultValueBoolean``.\",\n    )\n\n    defaultValueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"defaultValueCanonical\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueCanonical\",\n        title=\"Extension field for ``defaultValueCanonical``.\",\n    )\n\n    defaultValueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"defaultValueCode\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueCode\",\n        title=\"Extension field for ``defaultValueCode``.\",\n    )\n\n    defaultValueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"defaultValueCodeableConcept\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"defaultValueCodeableReference\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"defaultValueCoding\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"defaultValueContactDetail\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"defaultValueContactPoint\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueContributor: fhirtypes.ContributorType | None = Field(\n        default=None,\n        alias=\"defaultValueContributor\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"defaultValueCount\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"defaultValueDataRequirement\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"defaultValueDate\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDate\",\n        title=\"Extension field for ``defaultValueDate``.\",\n    )\n\n    defaultValueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"defaultValueDateTime\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDateTime\",\n        title=\"Extension field for ``defaultValueDateTime``.\",\n    )\n\n    defaultValueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"defaultValueDecimal\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDecimal\",\n        title=\"Extension field for ``defaultValueDecimal``.\",\n    )\n\n    defaultValueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"defaultValueDistance\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"defaultValueDosage\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"defaultValueDuration\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"defaultValueExpression\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"defaultValueHumanName\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"defaultValueId\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueId\",\n        title=\"Extension field for ``defaultValueId``.\",\n    )\n\n    defaultValueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"defaultValueIdentifier\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"defaultValueInstant\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueInstant\",\n        title=\"Extension field for ``defaultValueInstant``.\",\n    )\n\n    defaultValueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"defaultValueInteger\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueInteger\",\n        title=\"Extension field for ``defaultValueInteger``.\",\n    )\n\n    defaultValueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"defaultValueMarkdown\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueMarkdown\",\n        title=\"Extension field for ``defaultValueMarkdown``.\",\n    )\n\n    defaultValueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"defaultValueMoney\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"defaultValueOid\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueOid\",\n        title=\"Extension field for ``defaultValueOid``.\",\n    )\n\n    defaultValueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"defaultValueParameterDefinition\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"defaultValuePeriod\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"defaultValuePositiveInt\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValuePositiveInt\",\n        title=\"Extension field for ``defaultValuePositiveInt``.\",\n    )\n\n    defaultValueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"defaultValueQuantity\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"defaultValueRange\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"defaultValueRatio\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"defaultValueRatioRange\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"defaultValueReference\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"defaultValueRelatedArtifact\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"defaultValueSampledData\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"defaultValueSignature\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"defaultValueString\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueString\",\n        title=\"Extension field for ``defaultValueString``.\",\n    )\n\n    defaultValueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"defaultValueTime\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueTime\",\n        title=\"Extension field for ``defaultValueTime``.\",\n    )\n\n    defaultValueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"defaultValueTiming\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"defaultValueTriggerDefinition\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"defaultValueUnsignedInt\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUnsignedInt\",\n        title=\"Extension field for ``defaultValueUnsignedInt``.\",\n    )\n\n    defaultValueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"defaultValueUri\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUri\",\n        title=\"Extension field for ``defaultValueUri``.\",\n    )\n\n    defaultValueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"defaultValueUrl\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUrl\",\n        title=\"Extension field for ``defaultValueUrl``.\",\n    )\n\n    defaultValueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"defaultValueUsageContext\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"defaultValueUuid\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUuid\",\n        title=\"Extension field for ``defaultValueUuid``.\",\n    )\n\n    definition: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Full formal definition as narrative text\",\n        description=(\n            \"Provides a complete explanation of the meaning of the data element for\"\n            \" human readability.  For the case of elements derived from existing \"\n            \"elements (e.g. constraints), the definition SHALL be consistent with \"\n            \"the base definition, but convey the meaning of the element in the \"\n            \"particular context of use of the resource. (Note: The text you are \"\n            \"reading is specified in ElementDefinition.definition).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    example: typing.List[fhirtypes.ElementDefinitionExampleType] | None = Field(\n        default=None,\n        alias=\"example\",\n        title=\"Example value (as defined for type)\",\n        description=(\n            \"A sample value for this element demonstrating the type of information \"\n            \"that would typically be found in the element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    fixedAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"fixedAddress\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"fixedAge\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"fixedAnnotation\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"fixedAttachment\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"fixedBase64Binary\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedBase64Binary\",\n        title=\"Extension field for ``fixedBase64Binary``.\",\n    )\n\n    fixedBoolean: bool | None = Field(\n        default=None,\n        alias=\"fixedBoolean\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedBoolean\",\n        title=\"Extension field for ``fixedBoolean``.\",\n    )\n\n    fixedCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"fixedCanonical\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedCanonical\",\n        title=\"Extension field for ``fixedCanonical``.\",\n    )\n\n    fixedCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"fixedCode\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedCode\", title=\"Extension field for ``fixedCode``.\"\n    )\n\n    fixedCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fixedCodeableConcept\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"fixedCodeableReference\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"fixedCoding\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"fixedContactDetail\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"fixedContactPoint\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedContributor: fhirtypes.ContributorType | None = Field(\n        default=None,\n        alias=\"fixedContributor\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"fixedCount\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"fixedDataRequirement\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"fixedDate\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedDate\", title=\"Extension field for ``fixedDate``.\"\n    )\n\n    fixedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"fixedDateTime\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedDateTime\",\n        title=\"Extension field for ``fixedDateTime``.\",\n    )\n\n    fixedDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"fixedDecimal\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedDecimal\",\n        title=\"Extension field for ``fixedDecimal``.\",\n    )\n\n    fixedDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"fixedDistance\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"fixedDosage\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"fixedDuration\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"fixedExpression\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"fixedHumanName\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"fixedId\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedId\", title=\"Extension field for ``fixedId``.\"\n    )\n\n    fixedIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"fixedIdentifier\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"fixedInstant\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedInstant\",\n        title=\"Extension field for ``fixedInstant``.\",\n    )\n\n    fixedInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"fixedInteger\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedInteger\",\n        title=\"Extension field for ``fixedInteger``.\",\n    )\n\n    fixedMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"fixedMarkdown\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedMarkdown\",\n        title=\"Extension field for ``fixedMarkdown``.\",\n    )\n\n    fixedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"fixedMoney\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"fixedOid\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedOid\", title=\"Extension field for ``fixedOid``.\"\n    )\n\n    fixedParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"fixedParameterDefinition\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"fixedPeriod\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"fixedPositiveInt\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedPositiveInt\",\n        title=\"Extension field for ``fixedPositiveInt``.\",\n    )\n\n    fixedQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"fixedQuantity\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"fixedRange\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"fixedRatio\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"fixedRatioRange\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"fixedReference\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"fixedRelatedArtifact\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"fixedSampledData\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"fixedSignature\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"fixedString\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedString\", title=\"Extension field for ``fixedString``.\"\n    )\n\n    fixedTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"fixedTime\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedTime\", title=\"Extension field for ``fixedTime``.\"\n    )\n\n    fixedTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"fixedTiming\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"fixedTriggerDefinition\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"fixedUnsignedInt\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedUnsignedInt\",\n        title=\"Extension field for ``fixedUnsignedInt``.\",\n    )\n\n    fixedUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"fixedUri\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedUri\", title=\"Extension field for ``fixedUri``.\"\n    )\n\n    fixedUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"fixedUrl\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedUrl\", title=\"Extension field for ``fixedUrl``.\"\n    )\n\n    fixedUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"fixedUsageContext\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"fixedUuid\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedUuid\", title=\"Extension field for ``fixedUuid``.\"\n    )\n\n    isModifier: bool | None = Field(\n        default=None,\n        alias=\"isModifier\",\n        title=\"If this modifies the meaning of other elements\",\n        description=(\n            \"If true, the value of this element affects the interpretation of the \"\n            \"element or resource that contains it, and the value of the element \"\n            \"cannot be ignored. Typically, this is used for status, negation and \"\n            \"qualification codes. The effect of this is that the element cannot be \"\n            \"ignored by systems: they SHALL either recognize the element and \"\n            \"process it, and/or a pre-determination has been made that it is not \"\n            \"relevant to their particular system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isModifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isModifier\", title=\"Extension field for ``isModifier``.\"\n    )\n\n    isModifierReason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"isModifierReason\",\n        title=\"Reason that this element is marked as a modifier\",\n        description=(\n            \"Explains how that element affects the interpretation of the resource \"\n            \"or element that contains it.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isModifierReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_isModifierReason\",\n        title=\"Extension field for ``isModifierReason``.\",\n    )\n\n    isSummary: bool | None = Field(\n        default=None,\n        alias=\"isSummary\",\n        title=\"Include when _summary = true?\",\n        description=(\n            \"Whether the element should be included if a client requests a search \"\n            \"with the parameter _summary=true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isSummary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isSummary\", title=\"Extension field for ``isSummary``.\"\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Name for element to display with or prompt for element\",\n        description=(\n            \"A single preferred label which is the text to display beside the \"\n            \"element indicating its meaning or to use to prompt for the element in \"\n            \"a user display or form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    mapping: typing.List[fhirtypes.ElementDefinitionMappingType] | None = Field(\n        default=None,\n        alias=\"mapping\",\n        title=\"Map element to another set of definitions\",\n        description=(\n            \"Identifies a concept from an external specification that roughly \"\n            \"corresponds to this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum Cardinality (a number or *)\",\n        description=(\n            \"The maximum number of times this element is permitted to appear in the\"\n            \" instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    maxLength: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"maxLength\",\n        title=\"Max length for strings\",\n        description=(\n            \"Indicates the maximum length in characters that is permitted to be \"\n            \"present in conformant instances and which is expected to be supported \"\n            \"by conformant consumers that support the element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    maxLength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_maxLength\", title=\"Extension field for ``maxLength``.\"\n    )\n\n    maxValueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"maxValueDate\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueDate\",\n        title=\"Extension field for ``maxValueDate``.\",\n    )\n\n    maxValueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"maxValueDateTime\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueDateTime\",\n        title=\"Extension field for ``maxValueDateTime``.\",\n    )\n\n    maxValueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"maxValueDecimal\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueDecimal\",\n        title=\"Extension field for ``maxValueDecimal``.\",\n    )\n\n    maxValueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"maxValueInstant\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueInstant\",\n        title=\"Extension field for ``maxValueInstant``.\",\n    )\n\n    maxValueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"maxValueInteger\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueInteger\",\n        title=\"Extension field for ``maxValueInteger``.\",\n    )\n\n    maxValuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"maxValuePositiveInt\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValuePositiveInt\",\n        title=\"Extension field for ``maxValuePositiveInt``.\",\n    )\n\n    maxValueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxValueQuantity\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    maxValueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"maxValueTime\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueTime\",\n        title=\"Extension field for ``maxValueTime``.\",\n    )\n\n    maxValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"maxValueUnsignedInt\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueUnsignedInt\",\n        title=\"Extension field for ``maxValueUnsignedInt``.\",\n    )\n\n    meaningWhenMissing: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"meaningWhenMissing\",\n        title=\"Implicit meaning when this element is missing\",\n        description=(\n            \"The Implicit meaning that is to be understood when this element is \"\n            \"missing (e.g. 'when this element is missing, the period is ongoing').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    meaningWhenMissing__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_meaningWhenMissing\",\n        title=\"Extension field for ``meaningWhenMissing``.\",\n    )\n\n    min: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum Cardinality\",\n        description=\"The minimum number of times this element SHALL appear in the instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    minValueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"minValueDate\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueDate\",\n        title=\"Extension field for ``minValueDate``.\",\n    )\n\n    minValueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"minValueDateTime\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueDateTime\",\n        title=\"Extension field for ``minValueDateTime``.\",\n    )\n\n    minValueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"minValueDecimal\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueDecimal\",\n        title=\"Extension field for ``minValueDecimal``.\",\n    )\n\n    minValueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"minValueInstant\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueInstant\",\n        title=\"Extension field for ``minValueInstant``.\",\n    )\n\n    minValueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"minValueInteger\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueInteger\",\n        title=\"Extension field for ``minValueInteger``.\",\n    )\n\n    minValuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"minValuePositiveInt\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValuePositiveInt\",\n        title=\"Extension field for ``minValuePositiveInt``.\",\n    )\n\n    minValueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"minValueQuantity\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    minValueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"minValueTime\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueTime\",\n        title=\"Extension field for ``minValueTime``.\",\n    )\n\n    minValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"minValueUnsignedInt\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueUnsignedInt\",\n        title=\"Extension field for ``minValueUnsignedInt``.\",\n    )\n\n    mustSupport: bool | None = Field(\n        default=None,\n        alias=\"mustSupport\",\n        title=\"If the element must be supported\",\n        description=(\n            \"If true, implementations that produce or consume resources SHALL \"\n            'provide \"support\" for the element in some meaningful way.  If false, '\n            \"the element may be ignored and not supported. If false, whether to \"\n            \"populate or use the data element in any way is at the discretion of \"\n            \"the implementation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    mustSupport__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mustSupport\", title=\"Extension field for ``mustSupport``.\"\n    )\n\n    orderMeaning: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"orderMeaning\",\n        title=\"What the order of the elements means\",\n        description=(\n            \"If present, indicates that the order of the repeating element has \"\n            \"meaning and describes what that meaning is.  If absent, it means that \"\n            \"the order of the element has no meaning.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    orderMeaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_orderMeaning\",\n        title=\"Extension field for ``orderMeaning``.\",\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path of the element in the hierarchy of elements\",\n        description=(\n            'The path identifies the element and is expressed as a \".\"-separated '\n            \"list of ancestor elements, beginning with the name of the resource or \"\n            \"extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    patternAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"patternAddress\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"patternAge\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"patternAnnotation\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"patternAttachment\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"patternBase64Binary\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternBase64Binary\",\n        title=\"Extension field for ``patternBase64Binary``.\",\n    )\n\n    patternBoolean: bool | None = Field(\n        default=None,\n        alias=\"patternBoolean\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternBoolean\",\n        title=\"Extension field for ``patternBoolean``.\",\n    )\n\n    patternCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"patternCanonical\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternCanonical\",\n        title=\"Extension field for ``patternCanonical``.\",\n    )\n\n    patternCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"patternCode\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternCode\", title=\"Extension field for ``patternCode``.\"\n    )\n\n    patternCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"patternCodeableConcept\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"patternCodeableReference\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"patternCoding\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"patternContactDetail\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"patternContactPoint\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternContributor: fhirtypes.ContributorType | None = Field(\n        default=None,\n        alias=\"patternContributor\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"patternCount\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"patternDataRequirement\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"patternDate\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternDate\", title=\"Extension field for ``patternDate``.\"\n    )\n\n    patternDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"patternDateTime\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternDateTime\",\n        title=\"Extension field for ``patternDateTime``.\",\n    )\n\n    patternDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"patternDecimal\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternDecimal\",\n        title=\"Extension field for ``patternDecimal``.\",\n    )\n\n    patternDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"patternDistance\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"patternDosage\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"patternDuration\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"patternExpression\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"patternHumanName\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"patternId\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternId\", title=\"Extension field for ``patternId``.\"\n    )\n\n    patternIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"patternIdentifier\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"patternInstant\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternInstant\",\n        title=\"Extension field for ``patternInstant``.\",\n    )\n\n    patternInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"patternInteger\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternInteger\",\n        title=\"Extension field for ``patternInteger``.\",\n    )\n\n    patternMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"patternMarkdown\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternMarkdown\",\n        title=\"Extension field for ``patternMarkdown``.\",\n    )\n\n    patternMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patternMoney\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"patternOid\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternOid\", title=\"Extension field for ``patternOid``.\"\n    )\n\n    patternParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"patternParameterDefinition\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"patternPeriod\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"patternPositiveInt\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternPositiveInt\",\n        title=\"Extension field for ``patternPositiveInt``.\",\n    )\n\n    patternQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"patternQuantity\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"patternRange\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"patternRatio\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"patternRatioRange\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patternReference\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"patternRelatedArtifact\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"patternSampledData\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"patternSignature\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"patternString\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternString\",\n        title=\"Extension field for ``patternString``.\",\n    )\n\n    patternTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"patternTime\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternTime\", title=\"Extension field for ``patternTime``.\"\n    )\n\n    patternTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"patternTiming\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"patternTriggerDefinition\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"patternUnsignedInt\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternUnsignedInt\",\n        title=\"Extension field for ``patternUnsignedInt``.\",\n    )\n\n    patternUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"patternUri\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternUri\", title=\"Extension field for ``patternUri``.\"\n    )\n\n    patternUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"patternUrl\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternUrl\", title=\"Extension field for ``patternUrl``.\"\n    )\n\n    patternUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"patternUsageContext\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"patternUuid\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.    When pattern[x] is used to constrain a primitive, it means\"\n            \" that the value provided in the pattern[x] must match the instance \"\n            \"value exactly.  When pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] array must \"\n            \"(recursively) match at least one element from the instance array.  \"\n            \"When pattern[x] is used to constrain a complex object, it means that \"\n            \"each property in the pattern must be present in the complex object, \"\n            \"and its value must recursively match -- i.e.,  1. If primitive: it \"\n            \"must match exactly the pattern value 2. If a complex object: it must \"\n            \"match (recursively) the pattern value 3. If an array: it must match \"\n            \"(recursively) the pattern value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternUuid\", title=\"Extension field for ``patternUuid``.\"\n    )\n\n    representation: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"representation\",\n        title=\"xmlAttr | xmlText | typeAttr | cdaText | xhtml\",\n        description=(\n            \"Codes that define how this element is represented in instances, when \"\n            \"the deviation varies from the normal case.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"xmlAttr\", \"xmlText\", \"typeAttr\", \"cdaText\", \"xhtml\"],\n        },\n    )\n    representation__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_representation\",\n        title=\"Extension field for ``representation``.\",\n    )\n\n    requirements: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"requirements\",\n        title=\"Why this resource has been created\",\n        description=(\n            \"This element is for traceability of why the element was created and \"\n            \"why the constraints exist as they do. This may be used to point to \"\n            \"source materials or specifications that drove the structure of this \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    requirements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requirements\",\n        title=\"Extension field for ``requirements``.\",\n    )\n\n    short: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"short\",\n        title=\"Concise definition for space-constrained presentation\",\n        description=(\n            \"A concise description of what this element means (e.g. for use in \"\n            \"autogenerated summaries).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    short__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_short\", title=\"Extension field for ``short``.\"\n    )\n\n    sliceIsConstraining: bool | None = Field(\n        default=None,\n        alias=\"sliceIsConstraining\",\n        title=(\n            \"If this slice definition constrains an inherited slice definition (or \"\n            \"not)\"\n        ),\n        description=(\n            \"If true, indicates that this slice definition is constraining a slice \"\n            \"definition with the same name in an inherited profile. If false, the \"\n            \"slice is not overriding any slice in an inherited profile. If missing,\"\n            \" the slice might or might not be overriding a slice in an inherited \"\n            \"profile, depending on the sliceName.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sliceIsConstraining__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sliceIsConstraining\",\n        title=\"Extension field for ``sliceIsConstraining``.\",\n    )\n\n    sliceName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sliceName\",\n        title=\"Name for this particular element (in a set of slices)\",\n        description=(\n            \"The name of this element definition slice, when slicing is working. \"\n            \"The name must be a token with no dots or spaces. This is a unique name\"\n            \" referring to a specific set of constraints applied to this element, \"\n            \"used to provide a name to different slices of the same element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sliceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sliceName\", title=\"Extension field for ``sliceName``.\"\n    )\n\n    slicing: fhirtypes.ElementDefinitionSlicingType | None = Field(\n        default=None,\n        alias=\"slicing\",\n        title=\"This element is sliced - slices follow\",\n        description=(\n            \"Indicates that the element is sliced into a set of alternative \"\n            \"definitions (i.e. in a structure definition, there are multiple \"\n            \"different constraints on a single element in the base resource). \"\n            \"Slicing can be used in any resource that has cardinality ..* on the \"\n            \"base resource, or any resource with a choice of types. The set of \"\n            \"slices is any elements that come after this in the element sequence \"\n            \"that have the same path, until a shorter path occurs (the shorter path\"\n            \" terminates the set).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.ElementDefinitionTypeType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Data type and Profile for this element\",\n        description=(\n            \"The data type or resource that the value of this element is permitted \"\n            \"to be.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"path\",\n            \"representation\",\n            \"sliceName\",\n            \"sliceIsConstraining\",\n            \"label\",\n            \"code\",\n            \"slicing\",\n            \"short\",\n            \"definition\",\n            \"comment\",\n            \"requirements\",\n            \"alias\",\n            \"min\",\n            \"max\",\n            \"base\",\n            \"contentReference\",\n            \"type\",\n            \"defaultValueBase64Binary\",\n            \"defaultValueBoolean\",\n            \"defaultValueCanonical\",\n            \"defaultValueCode\",\n            \"defaultValueDate\",\n            \"defaultValueDateTime\",\n            \"defaultValueDecimal\",\n            \"defaultValueId\",\n            \"defaultValueInstant\",\n            \"defaultValueInteger\",\n            \"defaultValueMarkdown\",\n            \"defaultValueOid\",\n            \"defaultValuePositiveInt\",\n            \"defaultValueString\",\n            \"defaultValueTime\",\n            \"defaultValueUnsignedInt\",\n            \"defaultValueUri\",\n            \"defaultValueUrl\",\n            \"defaultValueUuid\",\n            \"defaultValueAddress\",\n            \"defaultValueAge\",\n            \"defaultValueAnnotation\",\n            \"defaultValueAttachment\",\n            \"defaultValueCodeableConcept\",\n            \"defaultValueCodeableReference\",\n            \"defaultValueCoding\",\n            \"defaultValueContactPoint\",\n            \"defaultValueCount\",\n            \"defaultValueDistance\",\n            \"defaultValueDuration\",\n            \"defaultValueHumanName\",\n            \"defaultValueIdentifier\",\n            \"defaultValueMoney\",\n            \"defaultValuePeriod\",\n            \"defaultValueQuantity\",\n            \"defaultValueRange\",\n            \"defaultValueRatio\",\n            \"defaultValueRatioRange\",\n            \"defaultValueReference\",\n            \"defaultValueSampledData\",\n            \"defaultValueSignature\",\n            \"defaultValueTiming\",\n            \"defaultValueContactDetail\",\n            \"defaultValueContributor\",\n            \"defaultValueDataRequirement\",\n            \"defaultValueExpression\",\n            \"defaultValueParameterDefinition\",\n            \"defaultValueRelatedArtifact\",\n            \"defaultValueTriggerDefinition\",\n            \"defaultValueUsageContext\",\n            \"defaultValueDosage\",\n            \"meaningWhenMissing\",\n            \"orderMeaning\",\n            \"fixedBase64Binary\",\n            \"fixedBoolean\",\n            \"fixedCanonical\",\n            \"fixedCode\",\n            \"fixedDate\",\n            \"fixedDateTime\",\n            \"fixedDecimal\",\n            \"fixedId\",\n            \"fixedInstant\",\n            \"fixedInteger\",\n            \"fixedMarkdown\",\n            \"fixedOid\",\n            \"fixedPositiveInt\",\n            \"fixedString\",\n            \"fixedTime\",\n            \"fixedUnsignedInt\",\n            \"fixedUri\",\n            \"fixedUrl\",\n            \"fixedUuid\",\n            \"fixedAddress\",\n            \"fixedAge\",\n            \"fixedAnnotation\",\n            \"fixedAttachment\",\n            \"fixedCodeableConcept\",\n            \"fixedCodeableReference\",\n            \"fixedCoding\",\n            \"fixedContactPoint\",\n            \"fixedCount\",\n            \"fixedDistance\",\n            \"fixedDuration\",\n            \"fixedHumanName\",\n            \"fixedIdentifier\",\n            \"fixedMoney\",\n            \"fixedPeriod\",\n            \"fixedQuantity\",\n            \"fixedRange\",\n            \"fixedRatio\",\n            \"fixedRatioRange\",\n            \"fixedReference\",\n            \"fixedSampledData\",\n            \"fixedSignature\",\n            \"fixedTiming\",\n            \"fixedContactDetail\",\n            \"fixedContributor\",\n            \"fixedDataRequirement\",\n            \"fixedExpression\",\n            \"fixedParameterDefinition\",\n            \"fixedRelatedArtifact\",\n            \"fixedTriggerDefinition\",\n            \"fixedUsageContext\",\n            \"fixedDosage\",\n            \"patternBase64Binary\",\n            \"patternBoolean\",\n            \"patternCanonical\",\n            \"patternCode\",\n            \"patternDate\",\n            \"patternDateTime\",\n            \"patternDecimal\",\n            \"patternId\",\n            \"patternInstant\",\n            \"patternInteger\",\n            \"patternMarkdown\",\n            \"patternOid\",\n            \"patternPositiveInt\",\n            \"patternString\",\n            \"patternTime\",\n            \"patternUnsignedInt\",\n            \"patternUri\",\n            \"patternUrl\",\n            \"patternUuid\",\n            \"patternAddress\",\n            \"patternAge\",\n            \"patternAnnotation\",\n            \"patternAttachment\",\n            \"patternCodeableConcept\",\n            \"patternCodeableReference\",\n            \"patternCoding\",\n            \"patternContactPoint\",\n            \"patternCount\",\n            \"patternDistance\",\n            \"patternDuration\",\n            \"patternHumanName\",\n            \"patternIdentifier\",\n            \"patternMoney\",\n            \"patternPeriod\",\n            \"patternQuantity\",\n            \"patternRange\",\n            \"patternRatio\",\n            \"patternRatioRange\",\n            \"patternReference\",\n            \"patternSampledData\",\n            \"patternSignature\",\n            \"patternTiming\",\n            \"patternContactDetail\",\n            \"patternContributor\",\n            \"patternDataRequirement\",\n            \"patternExpression\",\n            \"patternParameterDefinition\",\n            \"patternRelatedArtifact\",\n            \"patternTriggerDefinition\",\n            \"patternUsageContext\",\n            \"patternDosage\",\n            \"example\",\n            \"minValueDate\",\n            \"minValueDateTime\",\n            \"minValueInstant\",\n            \"minValueTime\",\n            \"minValueDecimal\",\n            \"minValueInteger\",\n            \"minValuePositiveInt\",\n            \"minValueUnsignedInt\",\n            \"minValueQuantity\",\n            \"maxValueDate\",\n            \"maxValueDateTime\",\n            \"maxValueInstant\",\n            \"maxValueTime\",\n            \"maxValueDecimal\",\n            \"maxValueInteger\",\n            \"maxValuePositiveInt\",\n            \"maxValueUnsignedInt\",\n            \"maxValueQuantity\",\n            \"maxLength\",\n            \"condition\",\n            \"constraint\",\n            \"mustSupport\",\n            \"isModifier\",\n            \"isModifierReason\",\n            \"isSummary\",\n            \"binding\",\n            \"mapping\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"path\",\n            \"representation\",\n            \"sliceName\",\n            \"sliceIsConstraining\",\n            \"label\",\n            \"code\",\n            \"slicing\",\n            \"short\",\n            \"definition\",\n            \"comment\",\n            \"requirements\",\n            \"alias\",\n            \"min\",\n            \"max\",\n            \"base\",\n            \"contentReference\",\n            \"type\",\n            \"defaultValueBase64Binary\",\n            \"defaultValueBoolean\",\n            \"defaultValueCanonical\",\n            \"defaultValueCode\",\n            \"defaultValueDate\",\n            \"defaultValueDateTime\",\n            \"defaultValueDecimal\",\n            \"defaultValueId\",\n            \"defaultValueInstant\",\n            \"defaultValueInteger\",\n            \"defaultValueMarkdown\",\n            \"defaultValueOid\",\n            \"defaultValuePositiveInt\",\n            \"defaultValueString\",\n            \"defaultValueTime\",\n            \"defaultValueUnsignedInt\",\n            \"defaultValueUri\",\n            \"defaultValueUrl\",\n            \"defaultValueUuid\",\n            \"defaultValueAddress\",\n            \"defaultValueAge\",\n            \"defaultValueAnnotation\",\n            \"defaultValueAttachment\",\n            \"defaultValueCodeableConcept\",\n            \"defaultValueCodeableReference\",\n            \"defaultValueCoding\",\n            \"defaultValueContactPoint\",\n            \"defaultValueCount\",\n            \"defaultValueDistance\",\n            \"defaultValueDuration\",\n            \"defaultValueHumanName\",\n            \"defaultValueIdentifier\",\n            \"defaultValueMoney\",\n            \"defaultValuePeriod\",\n            \"defaultValueQuantity\",\n            \"defaultValueRange\",\n            \"defaultValueRatio\",\n            \"defaultValueRatioRange\",\n            \"defaultValueReference\",\n            \"defaultValueSampledData\",\n            \"defaultValueSignature\",\n            \"defaultValueTiming\",\n            \"defaultValueContactDetail\",\n            \"defaultValueContributor\",\n            \"defaultValueDataRequirement\",\n            \"defaultValueExpression\",\n            \"defaultValueParameterDefinition\",\n            \"defaultValueRelatedArtifact\",\n            \"defaultValueTriggerDefinition\",\n            \"defaultValueUsageContext\",\n            \"defaultValueDosage\",\n            \"meaningWhenMissing\",\n            \"orderMeaning\",\n            \"fixedBase64Binary\",\n            \"fixedBoolean\",\n            \"fixedCanonical\",\n            \"fixedCode\",\n            \"fixedDate\",\n            \"fixedDateTime\",\n            \"fixedDecimal\",\n            \"fixedId\",\n            \"fixedInstant\",\n            \"fixedInteger\",\n            \"fixedMarkdown\",\n            \"fixedOid\",\n            \"fixedPositiveInt\",\n            \"fixedString\",\n            \"fixedTime\",\n            \"fixedUnsignedInt\",\n            \"fixedUri\",\n            \"fixedUrl\",\n            \"fixedUuid\",\n            \"fixedAddress\",\n            \"fixedAge\",\n            \"fixedAnnotation\",\n            \"fixedAttachment\",\n            \"fixedCodeableConcept\",\n            \"fixedCodeableReference\",\n            \"fixedCoding\",\n            \"fixedContactPoint\",\n            \"fixedCount\",\n            \"fixedDistance\",\n            \"fixedDuration\",\n            \"fixedHumanName\",\n            \"fixedIdentifier\",\n            \"fixedMoney\",\n            \"fixedPeriod\",\n            \"fixedQuantity\",\n            \"fixedRange\",\n            \"fixedRatio\",\n            \"fixedRatioRange\",\n            \"fixedReference\",\n            \"fixedSampledData\",\n            \"fixedSignature\",\n            \"fixedTiming\",\n            \"fixedContactDetail\",\n            \"fixedContributor\",\n            \"fixedDataRequirement\",\n            \"fixedExpression\",\n            \"fixedParameterDefinition\",\n            \"fixedRelatedArtifact\",\n            \"fixedTriggerDefinition\",\n            \"fixedUsageContext\",\n            \"fixedDosage\",\n            \"patternBase64Binary\",\n            \"patternBoolean\",\n            \"patternCanonical\",\n            \"patternCode\",\n            \"patternDate\",\n            \"patternDateTime\",\n            \"patternDecimal\",\n            \"patternId\",\n            \"patternInstant\",\n            \"patternInteger\",\n            \"patternMarkdown\",\n            \"patternOid\",\n            \"patternPositiveInt\",\n            \"patternString\",\n            \"patternTime\",\n            \"patternUnsignedInt\",\n            \"patternUri\",\n            \"patternUrl\",\n            \"patternUuid\",\n            \"patternAddress\",\n            \"patternAge\",\n            \"patternAnnotation\",\n            \"patternAttachment\",\n            \"patternCodeableConcept\",\n            \"patternCodeableReference\",\n            \"patternCoding\",\n            \"patternContactPoint\",\n            \"patternCount\",\n            \"patternDistance\",\n            \"patternDuration\",\n            \"patternHumanName\",\n            \"patternIdentifier\",\n            \"patternMoney\",\n            \"patternPeriod\",\n            \"patternQuantity\",\n            \"patternRange\",\n            \"patternRatio\",\n            \"patternRatioRange\",\n            \"patternReference\",\n            \"patternSampledData\",\n            \"patternSignature\",\n            \"patternTiming\",\n            \"patternContactDetail\",\n            \"patternContributor\",\n            \"patternDataRequirement\",\n            \"patternExpression\",\n            \"patternParameterDefinition\",\n            \"patternRelatedArtifact\",\n            \"patternTriggerDefinition\",\n            \"patternUsageContext\",\n            \"patternDosage\",\n            \"example\",\n            \"minValueDate\",\n            \"minValueDateTime\",\n            \"minValueInstant\",\n            \"minValueTime\",\n            \"minValueDecimal\",\n            \"minValueInteger\",\n            \"minValuePositiveInt\",\n            \"minValueUnsignedInt\",\n            \"minValueQuantity\",\n            \"maxValueDate\",\n            \"maxValueDateTime\",\n            \"maxValueInstant\",\n            \"maxValueTime\",\n            \"maxValueDecimal\",\n            \"maxValueInteger\",\n            \"maxValuePositiveInt\",\n            \"maxValueUnsignedInt\",\n            \"maxValueQuantity\",\n            \"maxLength\",\n            \"condition\",\n            \"constraint\",\n            \"mustSupport\",\n            \"isModifier\",\n            \"isModifierReason\",\n            \"isSummary\",\n            \"binding\",\n            \"mapping\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"path\", \"path__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"defaultValue\": [\n                \"defaultValueAddress\",\n                \"defaultValueAge\",\n                \"defaultValueAnnotation\",\n                \"defaultValueAttachment\",\n                \"defaultValueBase64Binary\",\n                \"defaultValueBoolean\",\n                \"defaultValueCanonical\",\n                \"defaultValueCode\",\n                \"defaultValueCodeableConcept\",\n                \"defaultValueCodeableReference\",\n                \"defaultValueCoding\",\n                \"defaultValueContactDetail\",\n                \"defaultValueContactPoint\",\n                \"defaultValueContributor\",\n                \"defaultValueCount\",\n                \"defaultValueDataRequirement\",\n                \"defaultValueDate\",\n                \"defaultValueDateTime\",\n                \"defaultValueDecimal\",\n                \"defaultValueDistance\",\n                \"defaultValueDosage\",\n                \"defaultValueDuration\",\n                \"defaultValueExpression\",\n                \"defaultValueHumanName\",\n                \"defaultValueId\",\n                \"defaultValueIdentifier\",\n                \"defaultValueInstant\",\n                \"defaultValueInteger\",\n                \"defaultValueMarkdown\",\n                \"defaultValueMoney\",\n                \"defaultValueOid\",\n                \"defaultValueParameterDefinition\",\n                \"defaultValuePeriod\",\n                \"defaultValuePositiveInt\",\n                \"defaultValueQuantity\",\n                \"defaultValueRange\",\n                \"defaultValueRatio\",\n                \"defaultValueRatioRange\",\n                \"defaultValueReference\",\n                \"defaultValueRelatedArtifact\",\n                \"defaultValueSampledData\",\n                \"defaultValueSignature\",\n                \"defaultValueString\",\n                \"defaultValueTime\",\n                \"defaultValueTiming\",\n                \"defaultValueTriggerDefinition\",\n                \"defaultValueUnsignedInt\",\n                \"defaultValueUri\",\n                \"defaultValueUrl\",\n                \"defaultValueUsageContext\",\n                \"defaultValueUuid\",\n            ],\n            \"fixed\": [\n                \"fixedAddress\",\n                \"fixedAge\",\n                \"fixedAnnotation\",\n                \"fixedAttachment\",\n                \"fixedBase64Binary\",\n                \"fixedBoolean\",\n                \"fixedCanonical\",\n                \"fixedCode\",\n                \"fixedCodeableConcept\",\n                \"fixedCodeableReference\",\n                \"fixedCoding\",\n                \"fixedContactDetail\",\n                \"fixedContactPoint\",\n                \"fixedContributor\",\n                \"fixedCount\",\n                \"fixedDataRequirement\",\n                \"fixedDate\",\n                \"fixedDateTime\",\n                \"fixedDecimal\",\n                \"fixedDistance\",\n                \"fixedDosage\",\n                \"fixedDuration\",\n                \"fixedExpression\",\n                \"fixedHumanName\",\n                \"fixedId\",\n                \"fixedIdentifier\",\n                \"fixedInstant\",\n                \"fixedInteger\",\n                \"fixedMarkdown\",\n                \"fixedMoney\",\n                \"fixedOid\",\n                \"fixedParameterDefinition\",\n                \"fixedPeriod\",\n                \"fixedPositiveInt\",\n                \"fixedQuantity\",\n                \"fixedRange\",\n                \"fixedRatio\",\n                \"fixedRatioRange\",\n                \"fixedReference\",\n                \"fixedRelatedArtifact\",\n                \"fixedSampledData\",\n                \"fixedSignature\",\n                \"fixedString\",\n                \"fixedTime\",\n                \"fixedTiming\",\n                \"fixedTriggerDefinition\",\n                \"fixedUnsignedInt\",\n                \"fixedUri\",\n                \"fixedUrl\",\n                \"fixedUsageContext\",\n                \"fixedUuid\",\n            ],\n            \"maxValue\": [\n                \"maxValueDate\",\n                \"maxValueDateTime\",\n                \"maxValueDecimal\",\n                \"maxValueInstant\",\n                \"maxValueInteger\",\n                \"maxValuePositiveInt\",\n                \"maxValueQuantity\",\n                \"maxValueTime\",\n                \"maxValueUnsignedInt\",\n            ],\n            \"minValue\": [\n                \"minValueDate\",\n                \"minValueDateTime\",\n                \"minValueDecimal\",\n                \"minValueInstant\",\n                \"minValueInteger\",\n                \"minValuePositiveInt\",\n                \"minValueQuantity\",\n                \"minValueTime\",\n                \"minValueUnsignedInt\",\n            ],\n            \"pattern\": [\n                \"patternAddress\",\n                \"patternAge\",\n                \"patternAnnotation\",\n                \"patternAttachment\",\n                \"patternBase64Binary\",\n                \"patternBoolean\",\n                \"patternCanonical\",\n                \"patternCode\",\n                \"patternCodeableConcept\",\n                \"patternCodeableReference\",\n                \"patternCoding\",\n                \"patternContactDetail\",\n                \"patternContactPoint\",\n                \"patternContributor\",\n                \"patternCount\",\n                \"patternDataRequirement\",\n                \"patternDate\",\n                \"patternDateTime\",\n                \"patternDecimal\",\n                \"patternDistance\",\n                \"patternDosage\",\n                \"patternDuration\",\n                \"patternExpression\",\n                \"patternHumanName\",\n                \"patternId\",\n                \"patternIdentifier\",\n                \"patternInstant\",\n                \"patternInteger\",\n                \"patternMarkdown\",\n                \"patternMoney\",\n                \"patternOid\",\n                \"patternParameterDefinition\",\n                \"patternPeriod\",\n                \"patternPositiveInt\",\n                \"patternQuantity\",\n                \"patternRange\",\n                \"patternRatio\",\n                \"patternRatioRange\",\n                \"patternReference\",\n                \"patternRelatedArtifact\",\n                \"patternSampledData\",\n                \"patternSignature\",\n                \"patternString\",\n                \"patternTime\",\n                \"patternTiming\",\n                \"patternTriggerDefinition\",\n                \"patternUnsignedInt\",\n                \"patternUri\",\n                \"patternUrl\",\n                \"patternUsageContext\",\n                \"patternUuid\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ElementDefinitionBase(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base definition information for tools.\n    Information about the base definition of the element, provided to make it\n    unnecessary for tools to trace the deviation of the element through the\n    derived and related profiles. When the element definition is not the\n    original definition of an element - i.g. either in a constraint on another\n    type, or for elements from a super type in a snap shot - then the\n    information in provided in the element definition may be different to the\n    base definition. On the original definition of the element, it will be\n    same.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionBase\"\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Max cardinality of the base element\",\n        description=\"Maximum cardinality of the base element identified by the path.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Min cardinality of the base element\",\n        description=\"Minimum cardinality of the base element identified by the path.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path that identifies the base element\",\n        description=(\n            \"The Path that identifies the base element - this matches the \"\n            \"ElementDefinition.path for that element. Across FHIR, there is only \"\n            \"one base definition of any element - that is, an element definition on\"\n            \" a [StructureDefinition](structuredefinition.html#) without a \"\n            \"StructureDefinition.base.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionBase`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"path\", \"min\", \"max\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionBase`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"path\", \"min\", \"max\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"max\", \"max__ext\"),\n            (\"min\", \"min__ext\"),\n            (\"path\", \"path__ext\"),\n        ]\n        return required_fields\n\n\nclass ElementDefinitionBinding(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    ValueSet details if this is coded.\n    Binds to a value set if this element is coded (code, Coding,\n    CodeableConcept, Quantity), or the data types (string, uri).\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionBinding\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human explanation of the value set\",\n        description=\"Describes the intended use of this particular set of codes.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    strength: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"strength\",\n        title=\"required | extensible | preferred | example\",\n        description=(\n            \"Indicates the degree of conformance expectations associated with this \"\n            \"binding - that is, the degree to which the provided value set must be \"\n            \"adhered to in the instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"required\", \"extensible\", \"preferred\", \"example\"],\n        },\n    )\n    strength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_strength\", title=\"Extension field for ``strength``.\"\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Source of value set\",\n        description=(\n            \"Refers to the value set that identifies the set of codes the binding \"\n            \"refers to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionBinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"strength\", \"description\", \"valueSet\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionBinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"strength\", \"description\", \"valueSet\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"strength\", \"strength__ext\")]\n        return required_fields\n\n\nclass ElementDefinitionConstraint(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Condition that must evaluate to true.\n    Formal constraints such as co-occurrence and other constraints that can be\n    computationally evaluated within the context of the instance.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionConstraint\"\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"FHIRPath expression of constraint\",\n        description=(\n            \"A [FHIRPath](fhirpath.html) expression of constraint that can be \"\n            \"executed to see if this constraint is met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    human: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"human\",\n        title=\"Human description of constraint\",\n        description=(\n            \"Text that can be used to describe the constraint in messages \"\n            \"identifying that the constraint has been violated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    human__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_human\", title=\"Extension field for ``human``.\"\n    )\n\n    key: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"key\",\n        title=\"Target of 'condition' reference above\",\n        description=(\n            \"Allows identification of which elements have their cardinalities \"\n            \"impacted by the constraint.  Will not be referenced for constraints \"\n            \"that do not affect cardinality.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_key\", title=\"Extension field for ``key``.\"\n    )\n\n    requirements: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"requirements\",\n        title=\"Why this constraint is necessary or appropriate\",\n        description=\"Description of why this constraint is necessary or appropriate.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    requirements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requirements\",\n        title=\"Extension field for ``requirements``.\",\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"error | warning\",\n        description=(\n            \"Identifies the impact constraint violation has on the conformance of \"\n            \"the instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"error\", \"warning\"],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    source: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Reference to original source of constraint\",\n        description=(\n            \"A reference to the original source of the constraint, for traceability\"\n            \" purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    xpath: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"xpath\",\n        title=\"XPath expression of constraint\",\n        description=(\n            \"An XPath expression of constraint that can be executed to see if this \"\n            \"constraint is met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    xpath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_xpath\", title=\"Extension field for ``xpath``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionConstraint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"key\",\n            \"requirements\",\n            \"severity\",\n            \"human\",\n            \"expression\",\n            \"xpath\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionConstraint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"key\",\n            \"requirements\",\n            \"severity\",\n            \"human\",\n            \"expression\",\n            \"xpath\",\n            \"source\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"human\", \"human__ext\"),\n            (\"key\", \"key__ext\"),\n            (\"severity\", \"severity__ext\"),\n        ]\n        return required_fields\n\n\nclass ElementDefinitionExample(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Example value (as defined for type).\n    A sample value for this element demonstrating the type of information that\n    would typically be found in the element.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionExample\"\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Describes the purpose of this example\",\n        description=\"Describes the purpose of this example amoung the set of examples.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueCanonical\",\n        title=\"Extension field for ``valueCanonical``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"valueCodeableReference\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"valueContactDetail\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContributor: fhirtypes.ContributorType | None = Field(\n        default=None,\n        alias=\"valueContributor\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"valueDataRequirement\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"valueDosage\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"valueExpression\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"valueParameterDefinition\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"valueRatioRange\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"valueRelatedArtifact\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"valueTriggerDefinition\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUrl\", title=\"Extension field for ``valueUrl``.\"\n    )\n\n    valueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"valueUsageContext\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"valueUuid\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUuid\", title=\"Extension field for ``valueUuid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionExample`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"label\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCodeableReference\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueRatioRange\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueContributor\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueDosage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionExample`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"label\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCodeableReference\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueRatioRange\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueContributor\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueDosage\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"label\", \"label__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCanonical\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCodeableReference\",\n                \"valueCoding\",\n                \"valueContactDetail\",\n                \"valueContactPoint\",\n                \"valueContributor\",\n                \"valueCount\",\n                \"valueDataRequirement\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDosage\",\n                \"valueDuration\",\n                \"valueExpression\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueMarkdown\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valueParameterDefinition\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueRatioRange\",\n                \"valueReference\",\n                \"valueRelatedArtifact\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueTriggerDefinition\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n                \"valueUrl\",\n                \"valueUsageContext\",\n                \"valueUuid\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ElementDefinitionMapping(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Map element to another set of definitions.\n    Identifies a concept from an external specification that roughly\n    corresponds to this element.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionMapping\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments about the mapping or its use\",\n        description=\"Comments that provide information about the mapping or its use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    identity: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"identity\",\n        title=\"Reference to mapping declaration\",\n        description=\"An internal reference to the definition of a mapping.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_identity\", title=\"Extension field for ``identity``.\"\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Computable language of mapping\",\n        description=\"Identifies the computable language in which mapping.map is expressed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    map: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"map\",\n        title=\"Details of the mapping\",\n        description=(\n            \"Expresses what part of the target specification corresponds to this \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    map__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_map\", title=\"Extension field for ``map``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"identity\", \"language\", \"map\", \"comment\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"identity\", \"language\", \"map\", \"comment\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"identity\", \"identity__ext\"), (\"map\", \"map__ext\")]\n        return required_fields\n\n\nclass ElementDefinitionSlicing(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    This element is sliced - slices follow.\n    Indicates that the element is sliced into a set of alternative definitions\n    (i.e. in a structure definition, there are multiple different constraints\n    on a single element in the base resource). Slicing can be used in any\n    resource that has cardinality ..* on the base resource, or any resource\n    with a choice of types. The set of slices is any elements that come after\n    this in the element sequence that have the same path, until a shorter path\n    occurs (the shorter path terminates the set).\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionSlicing\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Text description of how slicing works (or not)\",\n        description=(\n            \"A human-readable text description of how the slicing works. If there \"\n            \"is no discriminator, this is required to be present to provide \"\n            \"whatever information is possible about how the slices can be \"\n            \"differentiated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    discriminator: typing.List[\n        fhirtypes.ElementDefinitionSlicingDiscriminatorType\n    ] | None = Field(\n        default=None,\n        alias=\"discriminator\",\n        title=\"Element values that are used to distinguish the slices\",\n        description=(\n            \"Designates which child elements are used to discriminate between the \"\n            \"slices when processing an instance. If one or more discriminators are \"\n            \"provided, the value of the child elements in the instance data SHALL \"\n            \"completely distinguish which slice the element in the resource matches\"\n            \" based on the allowed values for those elements in each of the slices.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ordered: bool | None = Field(\n        default=None,\n        alias=\"ordered\",\n        title=\"If elements must be in same order as slices\",\n        description=(\n            \"If the matching elements have to occur in the same order as defined in\"\n            \" the profile.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ordered__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ordered\", title=\"Extension field for ``ordered``.\"\n    )\n\n    rules: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"rules\",\n        title=\"closed | open | openAtEnd\",\n        description=(\n            \"Whether additional slices are allowed or not. When the slices are \"\n            \"ordered, profile authors can also say that additional slices are only \"\n            \"allowed at the end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"closed\", \"open\", \"openAtEnd\"],\n        },\n    )\n    rules__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rules\", title=\"Extension field for ``rules``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionSlicing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"discriminator\", \"description\", \"ordered\", \"rules\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionSlicing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"discriminator\", \"description\", \"ordered\", \"rules\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"rules\", \"rules__ext\")]\n        return required_fields\n\n\nclass ElementDefinitionSlicingDiscriminator(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Element values that are used to distinguish the slices.\n    Designates which child elements are used to discriminate between the slices\n    when processing an instance. If one or more discriminators are provided,\n    the value of the child elements in the instance data SHALL completely\n    distinguish which slice the element in the resource matches based on the\n    allowed values for those elements in each of the slices.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionSlicingDiscriminator\"\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path to element value\",\n        description=(\n            \"A FHIRPath expression, using [the simple subset of \"\n            \"FHIRPath](fhirpath.html#simple), that is used to identify the element \"\n            \"on which discrimination is based.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"value | exists | pattern | type | profile\",\n        description=\"How the element value is interpreted when discrimination is evaluated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"value\", \"exists\", \"pattern\", \"type\", \"profile\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionSlicingDiscriminator`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"type\", \"path\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionSlicingDiscriminator`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"type\", \"path\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"path\", \"path__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass ElementDefinitionType(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Data type and Profile for this element.\n    The data type or resource that the value of this element is permitted to\n    be.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionType\"\n\n    aggregation: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"aggregation\",\n        title=\"contained | referenced | bundled - how aggregated\",\n        description=(\n            \"If the type is a reference to another resource, how the resource is or\"\n            \" can be aggregated - is it a contained resource, or a reference, and \"\n            \"if the context is a bundle, is it included in the bundle.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"contained\", \"referenced\", \"bundled\"],\n        },\n    )\n    aggregation__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_aggregation\", title=\"Extension field for ``aggregation``.\"\n    )\n\n    code: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Data type or Resource (reference to definition)\",\n        description=(\n            \"URL of Data type or Resource that is a(or the) type used for this \"\n            \"element. References are URLs that are relative to \"\n            'http://hl7.org/fhir/StructureDefinition e.g. \"string\" is a reference '\n            \"to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are \"\n            \"only allowed in logical models.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    profile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profiles (StructureDefinition or IG) - one must apply\",\n        description=(\n            \"Identifies a profile structure or implementation Guide that applies to\"\n            \" the datatype this element refers to. If any profiles are specified, \"\n            \"then the content must conform to at least one of them. The URL can be \"\n            \"a local reference - to a contained StructureDefinition, or a reference\"\n            \" to another StructureDefinition or Implementation Guide by a canonical\"\n            \" URL. When an implementation guide is specified, the type SHALL \"\n            \"conform to at least one profile defined in the implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\", \"ImplementationGuide\"],\n        },\n    )\n    profile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    targetProfile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"targetProfile\",\n        title=(\n            \"Profile (StructureDefinition or IG) on the Reference/canonical target \"\n            \"- one must apply\"\n        ),\n        description=(\n            'Used when the type is \"Reference\" or \"canonical\", and identifies a '\n            \"profile structure or implementation Guide that applies to the target \"\n            \"of the reference this element refers to. If any profiles are \"\n            \"specified, then the content must conform to at least one of them. The \"\n            \"URL can be a local reference - to a contained StructureDefinition, or \"\n            \"a reference to another StructureDefinition or Implementation Guide by \"\n            \"a canonical URL. When an implementation guide is specified, the target\"\n            \" resource SHALL conform to at least one profile defined in the \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\", \"ImplementationGuide\"],\n        },\n    )\n    targetProfile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_targetProfile\",\n        title=\"Extension field for ``targetProfile``.\",\n    )\n\n    versioning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"versioning\",\n        title=\"either | independent | specific\",\n        description=(\n            \"Whether this reference needs to be version specific or version \"\n            \"independent, or whether either can be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"either\", \"independent\", \"specific\"],\n        },\n    )\n    versioning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_versioning\", title=\"Extension field for ``versioning``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionType`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"code\",\n            \"profile\",\n            \"targetProfile\",\n            \"aggregation\",\n            \"versioning\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionType`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"code\", \"profile\", \"targetProfile\", \"aggregation\", \"versioning\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/encounter.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Encounter\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Encounter(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An interaction during which services are provided to the patient.\n    An interaction between a patient and healthcare provider(s) for the purpose\n    of providing healthcare service(s) or assessing the health status of a\n    patient.\n    \"\"\"\n\n    __resource_type__ = \"Encounter\"\n\n    account: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"account\",\n        title=\"The set of accounts that may be used for billing for this Encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    appointment: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"appointment\",\n        title=\"The appointment that scheduled this encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Appointment\"],\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"The ServiceRequest that initiated this encounter\",\n        description=(\n            \"The request this encounter satisfies (e.g. incoming referral or \"\n            \"procedure request).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    classHistory: typing.List[fhirtypes.EncounterClassHistoryType] | None = Field(\n        default=None,\n        alias=\"classHistory\",\n        title=\"List of past encounter classes\",\n        description=(\n            \"The class history permits the tracking of the encounters transitions \"\n            \"without needing to go  through the resource history.  This would be \"\n            \"used for a case where an admission starts of as an emergency \"\n            \"encounter, then transitions into an inpatient scenario. Doing this and\"\n            \" not restarting a new encounter ensures that any lab/diagnostic \"\n            \"results can more easily follow the patient and not require re-\"\n            \"processing and not get lost or cancelled during a kind of discharge \"\n            \"from emergency to inpatient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    class_fhir: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"class\",\n        title=\"Classification of patient encounter\",\n        description=(\n            \"Concepts representing classification of patient encounter such as \"\n            \"ambulatory (outpatient), inpatient, emergency, home health or others \"\n            \"due to local variations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    diagnosis: typing.List[fhirtypes.EncounterDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"The list of diagnosis relevant to this encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    episodeOfCare: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"episodeOfCare\",\n        title=\"Episode(s) of care that this encounter should be recorded against\",\n        description=(\n            \"Where a specific encounter should be classified as a part of a \"\n            \"specific episode(s) of care this field should be used. This \"\n            \"association can facilitate grouping of related encounters together for\"\n            \" a specific purpose, such as government reporting, issue tracking, \"\n            \"association via a common problem.  The association is recorded on the \"\n            \"encounter as these are typically created after the episode of care and\"\n            \" grouped on entry rather than editing the episode of care to append \"\n            \"another encounter to it (the episode of care could span years).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EpisodeOfCare\"],\n        },\n    )\n\n    hospitalization: fhirtypes.EncounterHospitalizationType | None = Field(\n        default=None,\n        alias=\"hospitalization\",\n        title=\"Details about the admission to a healthcare service\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier(s) by which this encounter is known\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    length: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"length\",\n        title=\"Quantity of time the encounter lasted (less time absent)\",\n        description=(\n            \"Quantity of time the encounter lasted. This excludes the time during \"\n            \"leaves of absence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.EncounterLocationType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"List of locations where the patient has been\",\n        description=\"List of locations where  the patient has been during this encounter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Another Encounter this encounter is part of\",\n        description=(\n            \"Another Encounter of which this encounter is a part of \"\n            \"(administratively or in time).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    participant: typing.List[fhirtypes.EncounterParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"List of participants involved in the encounter\",\n        description=\"The list of people responsible for providing the service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"The start and end time of the encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Indicates the urgency of the encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Coded reason the encounter takes place\",\n        description=(\n            \"Reason the encounter takes place, expressed as a code. For admissions,\"\n            \" this can be used for a coded admission diagnosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Reason the encounter takes place (reference)\",\n        description=(\n            \"Reason the encounter takes place, expressed as a code. For admissions,\"\n            \" this can be used for a coded admission diagnosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Procedure\",\n                \"Observation\",\n                \"ImmunizationRecommendation\",\n            ],\n        },\n    )\n\n    serviceProvider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"serviceProvider\",\n        title=\"The organization (facility) responsible for this encounter\",\n        description=(\n            \"The organization that is primarily responsible for this Encounter's \"\n            \"services. This MAY be the same as the organization on the Patient \"\n            \"record, however it could be different, such as if the actor performing\"\n            \" the services was from an external organization (which may be billed \"\n            \"seperately) for an external consultation.  Refer to the example bundle\"\n            \" showing an abbreviated set of Encounters for a colonoscopy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    serviceType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"serviceType\",\n        title=\"Specific type of service\",\n        description=(\n            \"Broad categorization of the service that is to be provided (e.g. \"\n            \"cardiology).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | arrived | triaged | in-progress | onleave | finished | \"\n            \"cancelled +\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"arrived\",\n                \"triaged\",\n                \"in-progress\",\n                \"onleave\",\n                \"finished\",\n                \"cancelled\",\n                \"+\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusHistory: typing.List[fhirtypes.EncounterStatusHistoryType] | None = Field(\n        default=None,\n        alias=\"statusHistory\",\n        title=\"List of past encounter statuses\",\n        description=(\n            \"The status history permits the encounter resource to contain the \"\n            \"status history without needing to read through the historical versions\"\n            \" of the resource, or even have the server store them.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The patient or group present at the encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Specific type of encounter\",\n        description=(\n            \"Specific type of encounter (e.g. e-mail consultation, surgical day-\"\n            \"care, skilled nursing, rehabilitation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Encounter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"statusHistory\",\n            \"class\",\n            \"classHistory\",\n            \"type\",\n            \"serviceType\",\n            \"priority\",\n            \"subject\",\n            \"episodeOfCare\",\n            \"basedOn\",\n            \"participant\",\n            \"appointment\",\n            \"period\",\n            \"length\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"diagnosis\",\n            \"account\",\n            \"hospitalization\",\n            \"location\",\n            \"serviceProvider\",\n            \"partOf\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Encounter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"class\",\n            \"type\",\n            \"serviceType\",\n            \"subject\",\n            \"episodeOfCare\",\n            \"participant\",\n            \"appointment\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"diagnosis\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass EncounterClassHistory(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of past encounter classes.\n    The class history permits the tracking of the encounters transitions\n    without needing to go  through the resource history.  This would be used\n    for a case where an admission starts of as an emergency encounter, then\n    transitions into an inpatient scenario. Doing this and not restarting a new\n    encounter ensures that any lab/diagnostic results can more easily follow\n    the patient and not require re-processing and not get lost or cancelled\n    during a kind of discharge from emergency to inpatient.\n    \"\"\"\n\n    __resource_type__ = \"EncounterClassHistory\"\n\n    class_fhir: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"class\",\n        title=\"inpatient | outpatient | ambulatory | emergency +\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"The time that the episode was in the specified class\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterClassHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"class\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterClassHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EncounterDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The list of diagnosis relevant to this encounter.\n    \"\"\"\n\n    __resource_type__ = \"EncounterDiagnosis\"\n\n    condition: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"condition\",\n        title=\"The diagnosis or procedure relevant to the encounter\",\n        description=(\n            \"Reason the encounter takes place, as specified using information from \"\n            \"another resource. For admissions, this is the admission diagnosis. The\"\n            \" indication will typically be a Condition (with other resources \"\n            \"referenced in the evidence.detail), or a Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Procedure\"],\n        },\n    )\n\n    rank: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"rank\",\n        title=\"Ranking of the diagnosis (for each role type)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rank\", title=\"Extension field for ``rank``.\"\n    )\n\n    use: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=(\n            \"Role that this diagnosis has within the encounter (e.g. admission, \"\n            \"billing, discharge \\u2026)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"condition\", \"use\", \"rank\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"condition\"]\n\n\nclass EncounterHospitalization(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details about the admission to a healthcare service.\n    \"\"\"\n\n    __resource_type__ = \"EncounterHospitalization\"\n\n    admitSource: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"admitSource\",\n        title=\"From where patient was admitted (physician referral, transfer)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    destination: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Location/organization to which the patient is discharged\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\", \"Organization\"],\n        },\n    )\n\n    dietPreference: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"dietPreference\",\n        title=\"Diet preferences reported by the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dischargeDisposition: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"dischargeDisposition\",\n        title=\"Category or kind of location after discharge\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    origin: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"origin\",\n        title=\"The location/organization from which the patient came before admission\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\", \"Organization\"],\n        },\n    )\n\n    preAdmissionIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"preAdmissionIdentifier\",\n        title=\"Pre-admission identifier\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reAdmission: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reAdmission\",\n        title=(\n            \"The type of hospital re-admission that has occurred (if any). If the \"\n            \"value is absent, then this is not identified as a readmission\"\n        ),\n        description=\"Whether this hospitalization is a readmission and why if known.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specialArrangement: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialArrangement\",\n        title=\"Wheelchair, translator, stretcher, etc.\",\n        description=(\n            \"Any special requests that have been made for this hospitalization \"\n            \"encounter, such as the provision of specific equipment or other \"\n            \"things.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specialCourtesy: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialCourtesy\",\n        title=\"Special courtesies (VIP, board member)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterHospitalization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"preAdmissionIdentifier\",\n            \"origin\",\n            \"admitSource\",\n            \"reAdmission\",\n            \"dietPreference\",\n            \"specialCourtesy\",\n            \"specialArrangement\",\n            \"destination\",\n            \"dischargeDisposition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterHospitalization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EncounterLocation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of locations where the patient has been.\n    List of locations where  the patient has been during this encounter.\n    \"\"\"\n\n    __resource_type__ = \"EncounterLocation\"\n\n    location: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"location\",\n        title=\"Location the encounter takes place\",\n        description=\"The location where the encounter takes place.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period during which the patient was present at the location\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    physicalType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"physicalType\",\n        title=(\n            \"The physical type of the location (usually the level in the location \"\n            \"hierachy - bed room ward etc.)\"\n        ),\n        description=(\n            \"This will be used to specify the required levels (bed/ward/room/etc.) \"\n            \"desired to be recorded to simplify either messaging or query.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"planned | active | reserved | completed\",\n        description=(\n            \"The status of the participants' presence at the specified location \"\n            \"during the period specified. If the participant is no longer at the \"\n            \"location, then the period will have an end date/time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"planned\", \"active\", \"reserved\", \"completed\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterLocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"location\",\n            \"status\",\n            \"physicalType\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterLocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EncounterParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of participants involved in the encounter.\n    The list of people responsible for providing the service.\n    \"\"\"\n\n    __resource_type__ = \"EncounterParticipant\"\n\n    individual: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"individual\",\n        title=\"Persons involved in the encounter other than the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period of time during the encounter that the participant participated\",\n        description=(\n            \"The period of time that the specified participant participated in the \"\n            \"encounter. These can overlap or be sub-sets of the overall encounter's\"\n            \" period.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Role of participant in encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"period\", \"individual\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"individual\"]\n\n\nclass EncounterStatusHistory(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of past encounter statuses.\n    The status history permits the encounter resource to contain the status\n    history without needing to read through the historical versions of the\n    resource, or even have the server store them.\n    \"\"\"\n\n    __resource_type__ = \"EncounterStatusHistory\"\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"The time that the episode was in the specified status\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | arrived | triaged | in-progress | onleave | finished | \"\n            \"cancelled +\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"arrived\",\n                \"triaged\",\n                \"in-progress\",\n                \"onleave\",\n                \"finished\",\n                \"cancelled\",\n                \"+\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterStatusHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"status\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterStatusHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/endpoint.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Endpoint\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Endpoint(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The technical details of an endpoint that can be used for electronic\n    services.\n    The technical details of an endpoint that can be used for electronic\n    services, such as for web services providing XDS.b or a REST endpoint for\n    another FHIR server. This may include any security context information.\n    \"\"\"\n\n    __resource_type__ = \"Endpoint\"\n\n    address: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"The technical base address for connecting to this endpoint\",\n        description=\"The uri that describes the actual end-point to connect to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_address\", title=\"Extension field for ``address``.\"\n    )\n\n    connectionType: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"connectionType\",\n        title=\"Protocol/Profile/Standard to be used with this endpoint connection\",\n        description=(\n            \"A coded value that represents the technical details of the usage of \"\n            \"this endpoint, such as what WSDLs should be used in what way. (e.g. \"\n            \"XDS.b/DICOM/cds-hook).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for source (e.g. troubleshooting)\",\n        description=(\n            \"Contact details for a human to contact about the subscription. The \"\n            \"primary use of this for system administrator troubleshooting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    header: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"header\",\n        title=\"Usage depends on the channel type\",\n        description=\"Additional headers / information to send as part of the notification.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    header__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_header\", title=\"Extension field for ``header``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifies this endpoint across multiple systems\",\n        description=(\n            \"Identifier for the organization that is used to identify the endpoint \"\n            \"across multiple disparate systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=(\n            \"Organization that manages this endpoint (might not be the organization\"\n            \" that exposes the endpoint)\"\n        ),\n        description=(\n            \"The organization that manages this endpoint (even if technically \"\n            \"another organization is hosting this in the cloud, it is the \"\n            \"organization associated with the data).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name that this endpoint can be identified by\",\n        description=\"A friendly name that this endpoint can be referred to with.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    payloadMimeType: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"payloadMimeType\",\n        title=(\n            \"Mimetype to send. If not specified, the content could be anything \"\n            \"(including no payload, if the connectionType defined this)\"\n        ),\n        description=(\n            \"The mime type to send the payload in - e.g. application/fhir+xml, \"\n            \"application/fhir+json. If the mime type is not specified, then the \"\n            \"sender could send any content (including no content depending on the \"\n            \"connectionType).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    payloadMimeType__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_payloadMimeType\",\n        title=\"Extension field for ``payloadMimeType``.\",\n    )\n\n    payloadType: typing.List[fhirtypes.CodeableConceptType] = Field(\n        default=...,\n        alias=\"payloadType\",\n        title=(\n            \"The type of content that may be used at this endpoint (e.g. XDS \"\n            \"Discharge summaries)\"\n        ),\n        description=(\n            \"The payload type describes the acceptable content that can be \"\n            \"communicated on the endpoint.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Interval the endpoint is expected to be operational\",\n        description=\"The interval during which the endpoint is expected to be operational.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | suspended | error | off | entered-in-error | test\",\n        description=\"active | suspended | error | off | test.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"active\",\n                \"suspended\",\n                \"error\",\n                \"off\",\n                \"entered-in-error\",\n                \"test\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Endpoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"connectionType\",\n            \"name\",\n            \"managingOrganization\",\n            \"contact\",\n            \"period\",\n            \"payloadType\",\n            \"payloadMimeType\",\n            \"address\",\n            \"header\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Endpoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"connectionType\",\n            \"name\",\n            \"managingOrganization\",\n            \"period\",\n            \"payloadType\",\n            \"payloadMimeType\",\n            \"address\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"address\", \"address__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/enrollmentrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EnrollmentRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass EnrollmentRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Enroll in coverage.\n    This resource provides the insurance enrollment details to the insurer\n    regarding a specified coverage.\n    \"\"\"\n\n    __resource_type__ = \"EnrollmentRequest\"\n\n    candidate: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"candidate\",\n        title=\"The subject to be enrolled\",\n        description=\"Patient Resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    coverage: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=\"Reference to the program or plan identification, underwriter or payor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The Response business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Target\",\n        description=\"The Insurer who is target  of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EnrollmentRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"created\",\n            \"insurer\",\n            \"provider\",\n            \"candidate\",\n            \"coverage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EnrollmentRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n"
  },
  {
    "path": "fhir/resources/R4B/enrollmentresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EnrollmentResponse\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass EnrollmentResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    EnrollmentResponse resource.\n    This resource provides enrollment and plan details from the processing of\n    an EnrollmentRequest resource.\n    \"\"\"\n\n    __resource_type__ = \"EnrollmentResponse\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=(\n            \"The date when the enclosed suite of services were performed or \"\n            \"completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The Response business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Insurer\",\n        description=\"The Insurer who produced this adjudicated response.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"queued | complete | error | partial\",\n        description=\"Processing status: error, complete.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"queued\", \"complete\", \"error\", \"partial\"],\n        },\n    )\n    outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcome\", title=\"Extension field for ``outcome``.\"\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Claim reference\",\n        description=\"Original request resource reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EnrollmentRequest\"],\n        },\n    )\n\n    requestProvider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestProvider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EnrollmentResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"request\",\n            \"outcome\",\n            \"disposition\",\n            \"created\",\n            \"organization\",\n            \"requestProvider\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EnrollmentResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n"
  },
  {
    "path": "fhir/resources/R4B/episodeofcare.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EpisodeOfCare\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass EpisodeOfCare(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An association of a Patient with an Organization and  Healthcare\n    Provider(s) for a period of time that the Organization assumes some level\n    of responsibility.\n    An association between a patient and an organization / healthcare\n    provider(s) during which time encounters may occur. The managing\n    organization assumes a level of responsibility for the patient during this\n    time.\n    \"\"\"\n\n    __resource_type__ = \"EpisodeOfCare\"\n\n    account: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"account\",\n        title=(\n            \"The set of accounts that may be used for billing for this \" \"EpisodeOfCare\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    careManager: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"careManager\",\n        title=\"Care manager/care coordinator for the patient\",\n        description=(\n            \"The practitioner that is the care manager/care coordinator for this \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    diagnosis: typing.List[fhirtypes.EpisodeOfCareDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"The list of diagnosis relevant to this episode of care\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier(s) relevant for this EpisodeOfCare\",\n        description=(\n            \"The EpisodeOfCare may be known by different identifiers for different \"\n            \"contexts of use, such as when an external agency is tracking the \"\n            \"Episode for funding purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"Organization that assumes care\",\n        description=(\n            \"The organization that has assumed the specific responsibilities for \"\n            \"the specified duration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The patient who is the focus of this episode of care\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Interval during responsibility is assumed\",\n        description=(\n            \"The interval during which the managing organization assumes the \"\n            \"defined responsibility.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    referralRequest: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"referralRequest\",\n        title=\"Originating Referral Request(s)\",\n        description=(\n            \"Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming\"\n            \" referrals.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | waitlist | active | onhold | finished | cancelled | entered-\"\n            \"in-error\"\n        ),\n        description=\"planned | waitlist | active | onhold | finished | cancelled.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"waitlist\",\n                \"active\",\n                \"onhold\",\n                \"finished\",\n                \"cancelled\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusHistory: typing.List[fhirtypes.EpisodeOfCareStatusHistoryType] | None = Field(\n        default=None,\n        alias=\"statusHistory\",\n        title=(\n            \"Past list of status codes (the current status may be included to cover\"\n            \" the start date of the status)\"\n        ),\n        description=(\n            \"The history of statuses that the EpisodeOfCare has been through \"\n            \"(without requiring processing the history of the resource).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    team: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"team\",\n        title=\"Other practitioners facilitating this episode of care\",\n        description=(\n            \"The list of practitioners that may be facilitating this episode of \"\n            \"care for specific purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CareTeam\"],\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type/class  - e.g. specialist referral, disease management\",\n        description=(\n            \"A classification of the type of episode of care; e.g. specialist \"\n            \"referral, disease management, type of funded care.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EpisodeOfCare`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"statusHistory\",\n            \"type\",\n            \"diagnosis\",\n            \"patient\",\n            \"managingOrganization\",\n            \"period\",\n            \"referralRequest\",\n            \"careManager\",\n            \"team\",\n            \"account\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EpisodeOfCare`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"type\",\n            \"diagnosis\",\n            \"patient\",\n            \"managingOrganization\",\n            \"period\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass EpisodeOfCareDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The list of diagnosis relevant to this episode of care.\n    \"\"\"\n\n    __resource_type__ = \"EpisodeOfCareDiagnosis\"\n\n    condition: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"condition\",\n        title=\"Conditions/problems/diagnoses this episode of care is for\",\n        description=(\n            \"A list of conditions/problems/diagnoses that this episode of care is \"\n            \"intended to be providing care for.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    rank: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"rank\",\n        title=\"Ranking of the diagnosis (for each role type)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rank\", title=\"Extension field for ``rank``.\"\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=(\n            \"Role that this diagnosis has within the episode of care (e.g. \"\n            \"admission, billing, discharge \\u2026)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EpisodeOfCareDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"condition\", \"role\", \"rank\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EpisodeOfCareDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"condition\", \"role\", \"rank\"]\n\n\nclass EpisodeOfCareStatusHistory(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Past list of status codes (the current status may be included to cover the\n    start date of the status).\n    The history of statuses that the EpisodeOfCare has been through (without\n    requiring processing the history of the resource).\n    \"\"\"\n\n    __resource_type__ = \"EpisodeOfCareStatusHistory\"\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"Duration the EpisodeOfCare was in the specified status\",\n        description=\"The period during this EpisodeOfCare that the specific status applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | waitlist | active | onhold | finished | cancelled | entered-\"\n            \"in-error\"\n        ),\n        description=\"planned | waitlist | active | onhold | finished | cancelled.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"waitlist\",\n                \"active\",\n                \"onhold\",\n                \"finished\",\n                \"cancelled\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EpisodeOfCareStatusHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"status\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EpisodeOfCareStatusHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/eventdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EventDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass EventDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A description of when an event can occur.\n    The EventDefinition resource provides a reusable description of when a\n    particular event can occur.\n    \"\"\"\n\n    __resource_type__ = \"EventDefinition\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the event definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the event definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the event definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the event definition was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the event definition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the event definition\",\n        description=(\n            \"A free text natural language description of the event definition from \"\n            \"a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the event definition is expected to be used\",\n        description=(\n            \"The period during which the event definition content was or is planned\"\n            \" to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization responsible for officially endorsing the\"\n            \" content for use in some setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this event definition is authored for\"\n            \" testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the event definition\",\n        description=(\n            \"A formal identifier that is used to identify this event definition \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for event definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the event definition is intended\"\n            \" to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the event definition was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this event definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the event definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the event \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this event definition is defined\",\n        description=(\n            \"Explanation of why this event definition is needed and why it has been\"\n            \" designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc.\",\n        description=(\n            \"Related resources such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization primarily responsible for review of some\"\n            \" aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this event definition. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=\"Type of individual the event definition is focused on\",\n        description=(\n            \"A code or group definition that describes the intended subject of the \"\n            \"event definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=\"Type of individual the event definition is focused on\",\n        description=(\n            \"A code or group definition that describes the intended subject of the \"\n            \"event definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the event definition\",\n        description=(\n            \"An explanatory or alternate title for the event definition giving \"\n            \"additional information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this event definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the event definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc.\",\n        description=(\n            \"Descriptive topics related to the module. Topics provide a high-level \"\n            \"categorization of the module that can be useful for filtering and \"\n            \"searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    trigger: typing.List[fhirtypes.TriggerDefinitionType] = Field(\n        default=...,\n        alias=\"trigger\",\n        title=\"\\\"when\\\" the event occurs (multiple = 'or')\",\n        description=(\n            \"The trigger element defines when the event occurs. If more than one \"\n            \"trigger condition is specified, the event fires whenever any one of \"\n            \"the trigger conditions is met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this event definition, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this event definition when it\"\n            \" is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this event definition is (or will be) published. This URL \"\n            \"can be the target of a canonical reference. It SHALL remain the same \"\n            \"when the event definition is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the event definition\",\n        description=(\n            \"A detailed description of how the event definition is used from a \"\n            \"clinical perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate event definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the event definition\",\n        description=(\n            \"The identifier that is used to identify this version of the event \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the event definition \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EventDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"status\",\n            \"experimental\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"usage\",\n            \"copyright\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"trigger\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EventDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"trigger\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"subject\": [\"subjectCodeableConcept\", \"subjectReference\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/evidence.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Evidence\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Evidence(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Single evidence bit.\n    The Evidence Resource provides a machine-interpretable expression of an\n    evidence concept including the evidence variables (eg population,\n    exposures/interventions, comparators, outcomes, measured variables,\n    confounding variables), the statistics, and the certainty of this evidence.\n    \"\"\"\n\n    __resource_type__ = \"Evidence\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the summary was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    assertion: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"assertion\",\n        title=\"Declarative description of the Evidence\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    assertion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_assertion\", title=\"Extension field for ``assertion``.\"\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual, organization, or device primarily involved in the \"\n            \"creation and maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    certainty: typing.List[fhirtypes.EvidenceCertaintyType] | None = Field(\n        default=None,\n        alias=\"certainty\",\n        title=\"Certainty or quality of the evidence\",\n        description=(\n            \"Assessment of certainty, confidence in the estimates, or quality of \"\n            \"the evidence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    citeAsMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"citeAsMarkdown\",\n        title=\"Citation for this evidence\",\n        description=\"Citation Resource or display of suggested citation for this evidence.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e citeAs[x]\n            \"one_of_many\": \"citeAs\",\n            \"one_of_many_required\": False,\n        },\n    )\n    citeAsMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_citeAsMarkdown\",\n        title=\"Extension field for ``citeAsMarkdown``.\",\n    )\n\n    citeAsReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"citeAsReference\",\n        title=\"Citation for this evidence\",\n        description=\"Citation Resource or display of suggested citation for this evidence.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e citeAs[x]\n            \"one_of_many\": \"citeAs\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Citation\"],\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the summary was published. The \"\n            \"date must change when the business version changes and it must change \"\n            \"if the status code changes. In addition, it should change when the \"\n            \"substantive content of the summary changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the particular summary\",\n        description=(\n            \"A free text natural language description of the evidence from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individiual, organization, or device primarily responsible for \"\n            \"internal coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individiual, organization, or device responsible for officially \"\n            \"endorsing the content for use in some setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the summary\",\n        description=(\n            \"A formal identifier that is used to identify this summary when it is \"\n            \"represented in other formats, or referenced in a specification, model,\"\n            \" design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the summary was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnotes and/or explanatory notes\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the \" \"evidence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Link or citation to artifact associated with the summary\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individiual, organization, or device primarily responsible for \"\n            \"review of some aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    statistic: typing.List[fhirtypes.EvidenceStatisticType] | None = Field(\n        default=None,\n        alias=\"statistic\",\n        title=\"Values and parameters for a single statistic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this summary. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    studyType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"studyType\",\n        title=\"The type of study that produced this evidence\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    synthesisType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"synthesisType\",\n        title=\"The method to combine studies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this summary (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the summary.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this evidence, represented as a globally \"\n            \"unique URI\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this evidence when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this summary is (or will be) published. This URL can be \"\n            \"the target of a canonical reference. It SHALL remain the same when the\"\n            \" summary is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate evidence instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    variableDefinition: typing.List[fhirtypes.EvidenceVariableDefinitionType] = Field(\n        default=...,\n        alias=\"variableDefinition\",\n        title=\"Evidence variable such as population, exposure, or outcome\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of this summary\",\n        description=(\n            \"The identifier that is used to identify this version of the summary \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the summary author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Evidence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"title\",\n            \"citeAsReference\",\n            \"citeAsMarkdown\",\n            \"status\",\n            \"date\",\n            \"useContext\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"publisher\",\n            \"contact\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"description\",\n            \"assertion\",\n            \"note\",\n            \"variableDefinition\",\n            \"synthesisType\",\n            \"studyType\",\n            \"statistic\",\n            \"certainty\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Evidence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"title\",\n            \"status\",\n            \"date\",\n            \"useContext\",\n            \"publisher\",\n            \"contact\",\n            \"author\",\n            \"endorser\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"citeAs\": [\"citeAsMarkdown\", \"citeAsReference\"]}\n        return one_of_many_fields\n\n\nclass EvidenceCertainty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Certainty or quality of the evidence.\n    Assessment of certainty, confidence in the estimates, or quality of the\n    evidence.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceCertainty\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of certainty\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnotes and/or explanatory notes\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rater: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"rater\",\n        title=\"Individual or group who did the rating\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    rater__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rater\", title=\"Extension field for ``rater``.\"\n    )\n\n    rating: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"rating\",\n        title=\"Assessment or judgement of the aspect\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subcomponent: typing.List[fhirtypes.EvidenceCertaintyType] | None = Field(\n        default=None,\n        alias=\"subcomponent\",\n        title=\"A domain or subdomain of certainty\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Aspect of certainty being rated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceCertainty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"note\",\n            \"type\",\n            \"rating\",\n            \"rater\",\n            \"subcomponent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceCertainty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceStatistic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Values and parameters for a single statistic.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceStatistic\"\n\n    attributeEstimate: typing.List[\n        fhirtypes.EvidenceStatisticAttributeEstimateType\n    ] | None = Field(\n        default=None,\n        alias=\"attributeEstimate\",\n        title=\"An attribute of the Statistic\",\n        description=(\n            \"A statistical attribute of the statistic such as a measure of \"\n            \"heterogeneity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Associated category for categorical variable\",\n        description=(\n            \"When the measured variable is handled categorically, the category \"\n            \"element is used to define which category the statistic is reporting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of content\",\n        description=\"A description of the content value of the statistic.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    modelCharacteristic: typing.List[\n        fhirtypes.EvidenceStatisticModelCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"modelCharacteristic\",\n        title=\"An aspect of the statistical model\",\n        description=\"A component of the method to generate the statistic.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnotes and/or explanatory notes\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    numberAffected: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberAffected\",\n        title=\"The number of participants affected\",\n        description=(\n            \"The number of participants affected where the unit of analysis is the \"\n            \"same as sampleSize.knownDataCount and sampleSize.numberOfParticipants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    numberAffected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberAffected\",\n        title=\"Extension field for ``numberAffected``.\",\n    )\n\n    numberOfEvents: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfEvents\",\n        title=\"The number of events associated with the statistic\",\n        description=(\n            \"The number of events associated with the statistic, where the unit of \"\n            \"analysis is different from numberAffected, sampleSize.knownDataCount \"\n            \"and sampleSize.numberOfParticipants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    numberOfEvents__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfEvents\",\n        title=\"Extension field for ``numberOfEvents``.\",\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Statistic value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sampleSize: fhirtypes.EvidenceStatisticSampleSizeType | None = Field(\n        default=None,\n        alias=\"sampleSize\",\n        title=\"Number of samples in the statistic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    statisticType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statisticType\",\n        title=\"Type of statistic, eg relative risk\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceStatistic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"note\",\n            \"statisticType\",\n            \"category\",\n            \"quantity\",\n            \"numberOfEvents\",\n            \"numberAffected\",\n            \"sampleSize\",\n            \"attributeEstimate\",\n            \"modelCharacteristic\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceStatistic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceStatisticAttributeEstimate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An attribute of the Statistic.\n    A statistical attribute of the statistic such as a measure of\n    heterogeneity.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceStatisticAttributeEstimate\"\n\n    attributeEstimate: typing.List[\n        fhirtypes.EvidenceStatisticAttributeEstimateType\n    ] | None = Field(\n        default=None,\n        alias=\"attributeEstimate\",\n        title=(\n            \"A nested attribute estimate; which is the attribute estimate of an \"\n            \"attribute estimate\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of the attribute estimate\",\n        description=\"Human-readable summary of the estimate.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    level: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"level\",\n        title=\"Level of confidence interval, eg 0.95 for 95% confidence interval\",\n        description=\"Use 95 for a 95% confidence interval.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    level__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_level\", title=\"Extension field for ``level``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnote or explanatory note about the estimate\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=(\n            \"The singular quantity of the attribute estimate, for attribute \"\n            \"estimates represented as single values; also used to report unit of \"\n            \"measure\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    range: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"range\",\n        title=\"Lower and upper bound values of the attribute estimate\",\n        description=\"Lower bound of confidence interval.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of attribute estimate, eg confidence interval or p value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceStatisticAttributeEstimate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"note\",\n            \"type\",\n            \"quantity\",\n            \"level\",\n            \"range\",\n            \"attributeEstimate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceStatisticAttributeEstimate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceStatisticModelCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An aspect of the statistical model.\n    A component of the method to generate the statistic.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceStatisticModelCharacteristic\"\n\n    attributeEstimate: typing.List[\n        fhirtypes.EvidenceStatisticAttributeEstimateType\n    ] | None = Field(\n        default=None,\n        alias=\"attributeEstimate\",\n        title=\"An attribute of the statistic used as a model characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Model specification\",\n        description=\"Description of a component of the method to generate the statistic.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Numerical value to complete model specification\",\n        description=(\n            \"Further specification of the quantified value of the component of the \"\n            \"method to generate the statistic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    variable: typing.List[\n        fhirtypes.EvidenceStatisticModelCharacteristicVariableType\n    ] | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"A variable adjusted for in the adjusted analysis\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceStatisticModelCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"value\",\n            \"variable\",\n            \"attributeEstimate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceStatisticModelCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceStatisticModelCharacteristicVariable(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A variable adjusted for in the adjusted analysis.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceStatisticModelCharacteristicVariable\"\n\n    handling: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"handling\",\n        title=\"continuous | dichotomous | ordinal | polychotomous\",\n        description=\"How the variable is classified for use in adjusted analysis.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"continuous\", \"dichotomous\", \"ordinal\", \"polychotomous\"],\n        },\n    )\n    handling__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_handling\", title=\"Extension field for ``handling``.\"\n    )\n\n    valueCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"valueCategory\",\n        title=\"Description for grouping of ordinal or polychotomous variables\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueQuantity: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Discrete value for grouping of ordinal or polychotomous variables\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueRange: typing.List[fhirtypes.RangeType] | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Range of values for grouping of ordinal or polychotomous variables\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    variableDefinition: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"variableDefinition\",\n        title=\"Description of the variable\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\", \"EvidenceVariable\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceStatisticModelCharacteristicVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"variableDefinition\",\n            \"handling\",\n            \"valueCategory\",\n            \"valueQuantity\",\n            \"valueRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceStatisticModelCharacteristicVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceStatisticSampleSize(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Number of samples in the statistic.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceStatisticSampleSize\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of sample size for statistic\",\n        description=\"Human-readable summary of population sample size.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    knownDataCount: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"knownDataCount\",\n        title=\"Number of participants with known results for measured variables\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    knownDataCount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_knownDataCount\",\n        title=\"Extension field for ``knownDataCount``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnote or explanatory note about the sample size\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    numberOfParticipants: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfParticipants\",\n        title=\"Cumulative number of participants\",\n        description=(\n            \"A human-readable string to clarify or explain concepts about the \"\n            \"sample size.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    numberOfParticipants__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfParticipants\",\n        title=\"Extension field for ``numberOfParticipants``.\",\n    )\n\n    numberOfStudies: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfStudies\",\n        title=\"Number of contributing studies\",\n        description=\"Number of participants in the population.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    numberOfStudies__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfStudies\",\n        title=\"Extension field for ``numberOfStudies``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceStatisticSampleSize`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"note\",\n            \"numberOfStudies\",\n            \"numberOfParticipants\",\n            \"knownDataCount\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceStatisticSampleSize`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceVariableDefinition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Evidence variable such as population, exposure, or outcome.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceVariableDefinition\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"A text description or summary of the variable\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    directnessMatch: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"directnessMatch\",\n        title=\"low | moderate | high | exact\",\n        description=(\n            \"Indication of quality of match between intended variable to actual \"\n            \"variable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    intended: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"intended\",\n        title=\"Definition of the intended variable related to the Evidence\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\", \"EvidenceVariable\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnotes and/or explanatory notes\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    observed: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"observed\",\n        title=\"Definition of the actual variable related to the statistic(s)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\", \"EvidenceVariable\"],\n        },\n    )\n\n    variableRole: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"variableRole\",\n        title=(\n            \"population | subpopulation | exposure | referenceExposure | \"\n            \"measuredVariable | confounder\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceVariableDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"note\",\n            \"variableRole\",\n            \"observed\",\n            \"intended\",\n            \"directnessMatch\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceVariableDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"variableRole\", \"observed\"]\n"
  },
  {
    "path": "fhir/resources/R4B/evidencereport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EvidenceReport\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass EvidenceReport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A EvidenceReport.\n    The EvidenceReport Resource is a specialized container for a collection of\n    resources and codable concepts, adapted to support compositions of\n    Evidence, EvidenceVariable, and Citation resources and related concepts.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceReport\"\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual, organization, or device primarily involved in the \"\n            \"creation and maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    citeAsMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"citeAsMarkdown\",\n        title=\"Citation for this report\",\n        description=\"Citation Resource or display of suggested citation for this report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e citeAs[x]\n            \"one_of_many\": \"citeAs\",\n            \"one_of_many_required\": False,\n        },\n    )\n    citeAsMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_citeAsMarkdown\",\n        title=\"Extension field for ``citeAsMarkdown``.\",\n    )\n\n    citeAsReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"citeAsReference\",\n        title=\"Citation for this report\",\n        description=\"Citation Resource or display of suggested citation for this report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e citeAs[x]\n            \"one_of_many\": \"citeAs\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Citation\"],\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individiual, organization, or device primarily responsible for \"\n            \"internal coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individiual, organization, or device responsible for officially \"\n            \"endorsing the content for use in some setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier for the evidence report\",\n        description=(\n            \"A formal identifier that is used to identify this EvidenceReport when \"\n            \"it is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Used for footnotes and annotations\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the evidence\"\n            \" report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Link, description or reference to artifact associated with the report\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedIdentifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"relatedIdentifier\",\n        title=(\n            \"Identifiers for articles that may relate to more than one evidence \"\n            \"report\"\n        ),\n        description=(\n            \"A formal identifier that is used to identify things closely related to\"\n            \" this EvidenceReport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatesTo: typing.List[fhirtypes.EvidenceReportRelatesToType] | None = Field(\n        default=None,\n        alias=\"relatesTo\",\n        title=\"Relationships to other compositions/documents\",\n        description=(\n            \"Relationships that this composition has with other compositions or \"\n            \"documents that already exist.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individiual, organization, or device primarily responsible for \"\n            \"review of some aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    section: typing.List[fhirtypes.EvidenceReportSectionType] | None = Field(\n        default=None,\n        alias=\"section\",\n        title=\"Composition is broken into sections\",\n        description=\"The root of the sections that make up the composition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this summary. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.EvidenceReportSubjectType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Focus of the report\",\n        description=(\n            'Specifies the subject or focus of the report. Answers \"What is this '\n            'report about?\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of report\",\n        description=(\n            \"Specifies the kind of report, such as grouping of classifiers, search \"\n            \"results, or human-compiled expression.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this EvidenceReport, represented as a \"\n            \"globally unique URI\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this EvidenceReport when it \"\n            \"is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this summary is (or will be) published. This URL can be \"\n            \"the target of a canonical reference. It SHALL remain the same when the\"\n            \" summary is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate evidence report instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"status\",\n            \"useContext\",\n            \"identifier\",\n            \"relatedIdentifier\",\n            \"citeAsReference\",\n            \"citeAsMarkdown\",\n            \"type\",\n            \"note\",\n            \"relatedArtifact\",\n            \"subject\",\n            \"publisher\",\n            \"contact\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatesTo\",\n            \"section\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"status\",\n            \"useContext\",\n            \"identifier\",\n            \"relatedIdentifier\",\n            \"subject\",\n            \"publisher\",\n            \"contact\",\n            \"author\",\n            \"endorser\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"citeAs\": [\"citeAsMarkdown\", \"citeAsReference\"]}\n        return one_of_many_fields\n\n\nclass EvidenceReportRelatesTo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationships to other compositions/documents.\n    Relationships that this composition has with other compositions or\n    documents that already exist.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceReportRelatesTo\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"replaces | amends | appends | transforms | replacedWith | amendedWith \"\n            \"| appendedWith | transformedWith\"\n        ),\n        description=(\n            \"The type of relationship that this composition has with anther \"\n            \"composition or document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"replaces\",\n                \"amends\",\n                \"appends\",\n                \"transforms\",\n                \"replacedWith\",\n                \"amendedWith\",\n                \"appendedWith\",\n                \"transformedWith\",\n            ],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    targetIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"targetIdentifier\",\n        title=\"Target of the relationship\",\n        description=\"The target composition/document of this relationship.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    targetReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"targetReference\",\n        title=\"Target of the relationship\",\n        description=\"The target composition/document of this relationship.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EvidenceReport\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceReportRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"targetIdentifier\",\n            \"targetReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceReportRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"target\": [\"targetIdentifier\", \"targetReference\"]}\n        return one_of_many_fields\n\n\nclass EvidenceReportSection(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Composition is broken into sections.\n    The root of the sections that make up the composition.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceReportSection\"\n\n    author: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who and/or what authored the section\",\n        description=(\n            \"Identifies who is responsible for the information in this section, not\"\n            \" necessarily who typed it in.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Person\", \"Device\", \"Group\", \"Organization\"],\n        },\n    )\n\n    emptyReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"emptyReason\",\n        title=\"Why the section is empty\",\n        description=(\n            \"If the section is empty, why the list is empty. An empty section \"\n            \"typically has some text explaining the empty reason.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entryClassifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"entryClassifier\",\n        title=\"Extensible classifiers as content\",\n        description=\"Specifies any type of classification of the evidence report.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entryQuantity: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"entryQuantity\",\n        title=\"Quantity as content\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entryReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"entryReference\",\n        title=\"Reference to resources as content\",\n        description=(\n            \"A reference to the actual resource from which the narrative in the \"\n            \"section is derived.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    focus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"Classification of section (recommended)\",\n        description=(\n            \"A code identifying the kind of content contained within the section. \"\n            \"This should be consistent with the section title.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    focusReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"focusReference\",\n        title=\"Classification of section by Resource\",\n        description=(\n            \"A definitional Resource identifying the kind of content contained \"\n            \"within the section. This should be consistent with the section title.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"working | snapshot | changes\",\n        description=(\n            \"How the entry list was prepared - whether it is a working list that is\"\n            \" suitable for being maintained on an ongoing basis, or if it \"\n            \"represents a snapshot of a list of items from another source, or \"\n            \"whether it is a prepared list where items may be marked as added, \"\n            \"modified or deleted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"working\", \"snapshot\", \"changes\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    orderedBy: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"orderedBy\",\n        title=\"Order of section entries\",\n        description=\"Specifies the order applied to the items in the section entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    section: typing.List[fhirtypes.EvidenceReportSectionType] | None = Field(\n        default=None,\n        alias=\"section\",\n        title=\"Nested Section\",\n        description=\"A nested sub-section within this section.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.NarrativeType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text summary of the section, for human interpretation\",\n        description=(\n            \"A human-readable narrative that contains the attested content of the \"\n            \"section, used to represent the content of the resource to a human. The\"\n            \" narrative need not encode all the structured data, but is peferred to\"\n            \" contain sufficient detail to make it acceptable for a human to just \"\n            \"read the narrative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label for section (e.g. for ToC)\",\n        description=(\n            \"The label for this particular section.  This will be part of the \"\n            \"rendered content for the document, and is often used to build a table \"\n            \"of contents.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceReportSection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"title\",\n            \"focus\",\n            \"focusReference\",\n            \"author\",\n            \"text\",\n            \"mode\",\n            \"orderedBy\",\n            \"entryClassifier\",\n            \"entryReference\",\n            \"entryQuantity\",\n            \"emptyReason\",\n            \"section\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceReportSection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceReportSubject(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Focus of the report.\n    Specifies the subject or focus of the report. Answers \"What is this report\n    about?\".\n    \"\"\"\n\n    __resource_type__ = \"EvidenceReportSubject\"\n\n    characteristic: typing.List[\n        fhirtypes.EvidenceReportSubjectCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"Characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnotes and/or explanatory notes\",\n        description=\"Used for general notes and annotations not coded elsewhere.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceReportSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"characteristic\", \"note\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceReportSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceReportSubjectCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Characteristic.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceReportSubjectCharacteristic\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Characteristic code\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    exclude: bool | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=\"Is used to express not the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_exclude\", title=\"Extension field for ``exclude``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Timeframe for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Characteristic value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Characteristic value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Characteristic value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Characteristic value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Characteristic value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceReportSubjectCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueReference\",\n            \"valueCodeableConcept\",\n            \"valueBoolean\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"exclude\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceReportSubjectCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueReference\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/evidencevariable.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EvidenceVariable\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass EvidenceVariable(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A definition of an exposure, outcome, or other variable.\n    The EvidenceVariable resource describes an element that knowledge\n    (Evidence) is about.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceVariable\"\n\n    actual: bool | None = Field(\n        default=None,\n        alias=\"actual\",\n        title=\"Actual or conceptual\",\n        description=(\n            \"True if the actual variable measured, false if a conceptual \"\n            \"representation of the intended variable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actual\", title=\"Extension field for ``actual``.\"\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.EvidenceVariableCategoryType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"A grouping for ordinal or polychotomous variables\",\n        description=(\n            \"A grouping (or set of values) described along with other groupings to \"\n            \"specify the set of groupings allowed for the variable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    characteristic: typing.List[\n        fhirtypes.EvidenceVariableCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"What defines the members of the evidence element\",\n        description=(\n            \"A characteristic that defines the members of the evidence element. \"\n            'Multiple characteristics are applied with \"and\" semantics.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    characteristicCombination: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"characteristicCombination\",\n        title=\"intersection | union\",\n        description=(\n            \"Used to specify if two or more characteristics are combined with OR or\"\n            \" AND.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"intersection\", \"union\"],\n        },\n    )\n    characteristicCombination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_characteristicCombination\",\n        title=\"Extension field for ``characteristicCombination``.\",\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the evidence variable was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the evidence variable changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the evidence variable\",\n        description=(\n            \"A free text natural language description of the evidence variable from\"\n            \" a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization responsible for officially endorsing the\"\n            \" content for use in some setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    handling: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"handling\",\n        title=\"continuous | dichotomous | ordinal | polychotomous\",\n        description=\"Used for an outcome to classify.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"continuous\", \"dichotomous\", \"ordinal\", \"polychotomous\"],\n        },\n    )\n    handling__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_handling\", title=\"Extension field for ``handling``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the evidence variable\",\n        description=(\n            \"A formal identifier that is used to identify this evidence variable \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this evidence variable (computer friendly)\",\n        description=(\n            \"A natural language name identifying the evidence variable. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Used for footnotes or explanatory notes\",\n        description=(\n            \"A human-readable string to clarify or explain concepts about the \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the evidence\"\n            \" variable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc.\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization primarily responsible for review of some\"\n            \" aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    shortTitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"shortTitle\",\n        title=\"Title for use in informal contexts\",\n        description=(\n            \"The short title provides an alternate title for use in informal \"\n            \"descriptive contexts where the full, formal title is not necessary.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    shortTitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_shortTitle\", title=\"Extension field for ``shortTitle``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this evidence variable. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the EvidenceVariable\",\n        description=(\n            \"An explanatory or alternate title for the EvidenceVariable giving \"\n            \"additional information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this evidence variable (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the evidence variable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this evidence variable, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this evidence variable when \"\n            \"it is referenced in a specification, model, design or an instance; \"\n            \"also called its canonical identifier. This SHOULD be globally unique \"\n            \"and SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this evidence variable is (or will be) published. This URL\"\n            \" can be the target of a canonical reference. It SHALL remain the same \"\n            \"when the evidence variable is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate evidence variable instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the evidence variable\",\n        description=(\n            \"The identifier that is used to identify this version of the evidence \"\n            \"variable when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the evidence variable \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence. To provide a version consistent with the \"\n            \"Decision Support Service specification, use the format \"\n            \"Major.Minor.Revision (e.g. 1.0.0). For more information on versioning \"\n            \"knowledge assets, refer to the Decision Support Service specification.\"\n            \" Note that a version is required for non-experimental active \"\n            \"artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"shortTitle\",\n            \"subtitle\",\n            \"status\",\n            \"date\",\n            \"description\",\n            \"note\",\n            \"useContext\",\n            \"publisher\",\n            \"contact\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"actual\",\n            \"characteristicCombination\",\n            \"characteristic\",\n            \"handling\",\n            \"category\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"shortTitle\",\n            \"status\",\n            \"date\",\n            \"description\",\n            \"useContext\",\n            \"publisher\",\n            \"contact\",\n            \"characteristic\",\n            \"handling\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass EvidenceVariableCategory(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A grouping for ordinal or polychotomous variables.\n    A grouping (or set of values) described along with other groupings to\n    specify the set of groupings allowed for the variable.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceVariableCategory\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Description of the grouping\",\n        description=\"A human-readable title or representation of the grouping.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Definition of the grouping\",\n        description=\"Value or set of values that define the grouping.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Definition of the grouping\",\n        description=\"Value or set of values that define the grouping.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Definition of the grouping\",\n        description=\"Value or set of values that define the grouping.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceVariableCategory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceVariableCategory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\"valueCodeableConcept\", \"valueQuantity\", \"valueRange\"]\n        }\n        return one_of_many_fields\n\n\nclass EvidenceVariableCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What defines the members of the evidence element.\n    A characteristic that defines the members of the evidence element. Multiple\n    characteristics are applied with \"and\" semantics.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceVariableCharacteristic\"\n\n    definitionCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definitionCanonical\",\n        title=\"What code or expression defines members?\",\n        description=(\n            \"Define members of the evidence element using Codes (such as condition,\"\n            \" medication, or observation), Expressions ( using an expression \"\n            \"language such as FHIRPath or CQL) or DataRequirements (such as \"\n            \"Diabetes diagnosis onset in the last year).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n    definitionCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_definitionCanonical\",\n        title=\"Extension field for ``definitionCanonical``.\",\n    )\n\n    definitionCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"definitionCodeableConcept\",\n        title=\"What code or expression defines members?\",\n        description=(\n            \"Define members of the evidence element using Codes (such as condition,\"\n            \" medication, or observation), Expressions ( using an expression \"\n            \"language such as FHIRPath or CQL) or DataRequirements (such as \"\n            \"Diabetes diagnosis onset in the last year).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    definitionExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"definitionExpression\",\n        title=\"What code or expression defines members?\",\n        description=(\n            \"Define members of the evidence element using Codes (such as condition,\"\n            \" medication, or observation), Expressions ( using an expression \"\n            \"language such as FHIRPath or CQL) or DataRequirements (such as \"\n            \"Diabetes diagnosis onset in the last year).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    definitionReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"definitionReference\",\n        title=\"What code or expression defines members?\",\n        description=(\n            \"Define members of the evidence element using Codes (such as condition,\"\n            \" medication, or observation), Expressions ( using an expression \"\n            \"language such as FHIRPath or CQL) or DataRequirements (such as \"\n            \"Diabetes diagnosis onset in the last year).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\", \"EvidenceVariable\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the characteristic\",\n        description=(\n            \"A short, natural language description of the characteristic that could\"\n            \" be used to communicate the criteria to an end-user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Device used for determining characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"DeviceMetric\"],\n        },\n    )\n\n    exclude: bool | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=\"Whether the characteristic includes or excludes members\",\n        description=(\n            \"When true, members with this characteristic are excluded from the \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_exclude\", title=\"Extension field for ``exclude``.\"\n    )\n\n    groupMeasure: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"groupMeasure\",\n        title=(\n            \"mean | median | mean-of-mean | mean-of-median | median-of-mean | \"\n            \"median-of-median\"\n        ),\n        description=(\n            \"Indicates how elements are aggregated within the study effective \"\n            \"period.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"mean\",\n                \"median\",\n                \"mean-of-mean\",\n                \"mean-of-median\",\n                \"median-of-mean\",\n                \"median-of-median\",\n            ],\n        },\n    )\n    groupMeasure__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_groupMeasure\",\n        title=\"Extension field for ``groupMeasure``.\",\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Method used for describing characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timeFromStart: fhirtypes.EvidenceVariableCharacteristicTimeFromStartType | None = (\n        Field(\n            default=None,\n            alias=\"timeFromStart\",\n            title=\"Observation time from study start\",\n            description=(\n                \"Indicates duration, period, or point of observation from the \"\n                \"participant's study entry.\"\n            ),\n            json_schema_extra={\n                \"element_property\": True,\n            },\n        )\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceVariableCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"definitionReference\",\n            \"definitionCanonical\",\n            \"definitionCodeableConcept\",\n            \"definitionExpression\",\n            \"method\",\n            \"device\",\n            \"exclude\",\n            \"timeFromStart\",\n            \"groupMeasure\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceVariableCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"definitionReference\",\n            \"definitionCanonical\",\n            \"definitionCodeableConcept\",\n            \"definitionExpression\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"definition\": [\n                \"definitionCanonical\",\n                \"definitionCodeableConcept\",\n                \"definitionExpression\",\n                \"definitionReference\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass EvidenceVariableCharacteristicTimeFromStart(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Observation time from study start.\n    Indicates duration, period, or point of observation from the participant's\n    study entry.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceVariableCharacteristicTimeFromStart\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human readable description\",\n        description=\"A short, natural language description.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Used for footnotes or explanatory notes\",\n        description=(\n            \"A human-readable string to clarify or explain concepts about the \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=(\n            \"Used to express the observation at a defined amount of time after the \"\n            \"study start\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    range: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"range\",\n        title=\"Used to express the observation within a period after the study start\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceVariableCharacteristicTimeFromStart`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"quantity\",\n            \"range\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceVariableCharacteristicTimeFromStart`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/examplescenario.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ExampleScenario\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ExampleScenario(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Example of workflow instance.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenario\"\n\n    actor: typing.List[fhirtypes.ExampleScenarioActorType] | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Actor participating in the resource\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the example scenario and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the example scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the example scenario was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the example scenario changes. \"\n            \"(e.g. the 'content logical definition').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this example scenario is authored for\"\n            \" testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the example scenario\",\n        description=(\n            \"A formal identifier that is used to identify this example scenario \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instance: typing.List[fhirtypes.ExampleScenarioInstanceType] | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"Each resource and each version that is present in the workflow\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for example scenario (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the example scenario is intended\"\n            \" to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this example scenario (computer friendly)\",\n        description=(\n            \"A natural language name identifying the example scenario. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    process: typing.List[fhirtypes.ExampleScenarioProcessType] | None = Field(\n        default=None,\n        alias=\"process\",\n        title=\"Each major process - a group of operations\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the example \"\n            \"scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"The purpose of the example, e.g. to illustrate a scenario\",\n        description=(\n            \"What the example scenario resource is created for. This should not be \"\n            \"used to show the business purpose of the scenario itself, but the \"\n            \"purpose of documenting a scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this example scenario. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this example scenario, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this example scenario when it\"\n            \" is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this example scenario is (or will be) published. This URL \"\n            \"can be the target of a canonical reference. It SHALL remain the same \"\n            \"when the example scenario is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate example scenario instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the example scenario\",\n        description=(\n            \"The identifier that is used to identify this version of the example \"\n            \"scenario when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the example scenario \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    workflow: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"workflow\",\n        title=\"Another nested workflow\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ExampleScenario\"],\n        },\n    )\n    workflow__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_workflow\", title=\"Extension field for ``workflow``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenario`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"copyright\",\n            \"purpose\",\n            \"actor\",\n            \"instance\",\n            \"process\",\n            \"workflow\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenario`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ExampleScenarioActor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Actor participating in the resource.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioActor\"\n\n    actorId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"actorId\",\n        title=\"ID or acronym of the actor\",\n        description=\"ID or acronym of actor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    actorId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actorId\", title=\"Extension field for ``actorId``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The description of the actor\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The name of the actor as shown in the page\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"person | entity\",\n        description=\"The type of actor - person or system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"person\", \"entity\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"actorId\",\n            \"type\",\n            \"name\",\n            \"description\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"actorId\", \"actorId__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass ExampleScenarioInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Each resource and each version that is present in the workflow.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioInstance\"\n\n    containedInstance: typing.List[\n        fhirtypes.ExampleScenarioInstanceContainedInstanceType\n    ] | None = Field(\n        default=None,\n        alias=\"containedInstance\",\n        title=\"Resources contained in the instance\",\n        description=(\n            \"Resources contained in the instance (e.g. the observations contained \"\n            \"in a bundle).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-friendly description of the resource instance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A short name for the resource instance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    resourceId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"resourceId\",\n        title=\"The id of the resource for referencing\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    resourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resourceId\", title=\"Extension field for ``resourceId``.\"\n    )\n\n    resourceType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"resourceType\",\n        title=\"The type of the resource\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    resourceType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_resourceType\",\n        title=\"Extension field for ``resourceType``.\",\n    )\n\n    version: typing.List[fhirtypes.ExampleScenarioInstanceVersionType] | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"A specific version of the resource\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"resourceId\",\n            \"resourceType\",\n            \"name\",\n            \"description\",\n            \"version\",\n            \"containedInstance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"resourceId\", \"resourceId__ext\"),\n            (\"resourceType\", \"resourceType__ext\"),\n        ]\n        return required_fields\n\n\nclass ExampleScenarioInstanceContainedInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resources contained in the instance.\n    Resources contained in the instance (e.g. the observations contained in a\n    bundle).\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioInstanceContainedInstance\"\n\n    resourceId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"resourceId\",\n        title=\"Each resource contained in the instance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    resourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resourceId\", title=\"Extension field for ``resourceId``.\"\n    )\n\n    versionId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionId\",\n        title=\"A specific version of a resource contained in the instance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    versionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_versionId\", title=\"Extension field for ``versionId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioInstanceContainedInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"resourceId\", \"versionId\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioInstanceContainedInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"resourceId\", \"resourceId__ext\")]\n        return required_fields\n\n\nclass ExampleScenarioInstanceVersion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A specific version of the resource.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioInstanceVersion\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The description of the resource version\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    versionId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionId\",\n        title=\"The identifier of a specific version of a resource\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    versionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_versionId\", title=\"Extension field for ``versionId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioInstanceVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"versionId\", \"description\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioInstanceVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"description\", \"description__ext\"),\n            (\"versionId\", \"versionId__ext\"),\n        ]\n        return required_fields\n\n\nclass ExampleScenarioProcess(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Each major process - a group of operations.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioProcess\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"A longer description of the group of operations\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    postConditions: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"postConditions\",\n        title=\"Description of final status after the process ends\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    postConditions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_postConditions\",\n        title=\"Extension field for ``postConditions``.\",\n    )\n\n    preConditions: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"preConditions\",\n        title=\"Description of initial status before the process starts\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preConditions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_preConditions\",\n        title=\"Extension field for ``preConditions``.\",\n    )\n\n    step: typing.List[fhirtypes.ExampleScenarioProcessStepType] | None = Field(\n        default=None,\n        alias=\"step\",\n        title=\"Each step of the process\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"The diagram title of the group of operations\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioProcess`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"title\",\n            \"description\",\n            \"preConditions\",\n            \"postConditions\",\n            \"step\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcess`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"title\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"title\", \"title__ext\")]\n        return required_fields\n\n\nclass ExampleScenarioProcessStep(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Each step of the process.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioProcessStep\"\n\n    alternative: typing.List[\n        fhirtypes.ExampleScenarioProcessStepAlternativeType\n    ] | None = Field(\n        default=None,\n        alias=\"alternative\",\n        title=\"Alternate non-typical step action\",\n        description=(\n            \"Indicates an alternative step that can be taken instead of the \"\n            \"operations on the base step in exceptional/atypical circumstances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.ExampleScenarioProcessStepOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"Each interaction or action\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    pause: bool | None = Field(\n        default=None,\n        alias=\"pause\",\n        title=\"If there is a pause in the flow\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    pause__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_pause\", title=\"Extension field for ``pause``.\"\n    )\n\n    process: typing.List[fhirtypes.ExampleScenarioProcessType] | None = Field(\n        default=None,\n        alias=\"process\",\n        title=\"Nested process\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioProcessStep`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"process\",\n            \"pause\",\n            \"operation\",\n            \"alternative\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcessStep`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExampleScenarioProcessStepAlternative(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Alternate non-typical step action.\n    Indicates an alternative step that can be taken instead of the operations\n    on the base step in exceptional/atypical circumstances.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioProcessStepAlternative\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"A human-readable description of each option\",\n        description=(\n            \"A human-readable description of the alternative explaining when the \"\n            \"alternative should occur rather than the base step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    step: typing.List[fhirtypes.ExampleScenarioProcessStepType] | None = Field(\n        default=None,\n        alias=\"step\",\n        title=\"What happens in each alternative option\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label for alternative\",\n        description=(\n            \"The label to display for the alternative that gives a sense of the \"\n            \"circumstance in which the alternative should be invoked.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioProcessStepAlternative`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"title\", \"description\", \"step\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcessStepAlternative`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"title\", \"title__ext\")]\n        return required_fields\n\n\nclass ExampleScenarioProcessStepOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Each interaction or action.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioProcessStepOperation\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"A comment to be inserted in the diagram\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    initiator: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"initiator\",\n        title=\"Who starts the transaction\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    initiator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_initiator\", title=\"Extension field for ``initiator``.\"\n    )\n\n    initiatorActive: bool | None = Field(\n        default=None,\n        alias=\"initiatorActive\",\n        title=\"Whether the initiator is deactivated right after the transaction\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    initiatorActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_initiatorActive\",\n        title=\"Extension field for ``initiatorActive``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The human-friendly name of the interaction\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    number: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"The sequential number of the interaction\",\n        description=\"The sequential number of the interaction, e.g. 1.2.5.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    receiver: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"receiver\",\n        title=\"Who receives the transaction\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    receiver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_receiver\", title=\"Extension field for ``receiver``.\"\n    )\n\n    receiverActive: bool | None = Field(\n        default=None,\n        alias=\"receiverActive\",\n        title=\"Whether the receiver is deactivated right after the transaction\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    receiverActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_receiverActive\",\n        title=\"Extension field for ``receiverActive``.\",\n    )\n\n    request: fhirtypes.ExampleScenarioInstanceContainedInstanceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Each resource instance used by the initiator\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    response: fhirtypes.ExampleScenarioInstanceContainedInstanceType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"Each resource instance used by the responder\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of operation - CRUD\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioProcessStepOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"number\",\n            \"type\",\n            \"name\",\n            \"initiator\",\n            \"receiver\",\n            \"description\",\n            \"initiatorActive\",\n            \"receiverActive\",\n            \"request\",\n            \"response\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcessStepOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"number\", \"number__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/explanationofbenefit.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ExplanationOfBenefit(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Explanation of Benefit resource.\n    This resource provides: the claim details; adjudication details from the\n    processing of a Claim; and optionally account balance information, for\n    informing the subscriber of the benefits provided.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefit\"\n\n    accident: fhirtypes.ExplanationOfBenefitAccidentType | None = Field(\n        default=None,\n        alias=\"accident\",\n        title=\"Details of the event\",\n        description=(\n            \"Details of a accident which resulted in injuries which required the \"\n            \"products and services listed in the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    addItem: typing.List[fhirtypes.ExplanationOfBenefitAddItemType] | None = Field(\n        default=None,\n        alias=\"addItem\",\n        title=\"Insurer added line items\",\n        description=(\n            \"The first-tier service adjudications for payor added product or \"\n            \"service lines.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Header-level adjudication\",\n        description=(\n            \"The adjudication results which are presented at the header level \"\n            \"rather than at the line-item or add-item levels.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    benefitBalance: typing.List[\n        fhirtypes.ExplanationOfBenefitBenefitBalanceType\n    ] | None = Field(\n        default=None,\n        alias=\"benefitBalance\",\n        title=\"Balance by Benefit Category\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    benefitPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"benefitPeriod\",\n        title=\"When the benefits are applicable\",\n        description=\"The term of the benefits documented in this response.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    billablePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"billablePeriod\",\n        title=\"Relevant time frame for the claim\",\n        description=\"The period for which charges are being submitted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    careTeam: typing.List[fhirtypes.ExplanationOfBenefitCareTeamType] | None = Field(\n        default=None,\n        alias=\"careTeam\",\n        title=\"Care Team members\",\n        description=\"The members of the team who provided the products and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    claim: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claim\",\n        title=\"Claim reference\",\n        description=(\n            \"The business identifier for the instance of the adjudication request: \"\n            \"claim predetermination or preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Claim\"],\n        },\n    )\n\n    claimResponse: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claimResponse\",\n        title=\"Claim response reference\",\n        description=(\n            \"The business identifier for the instance of the adjudication response:\"\n            \" claim, predetermination or preauthorization response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClaimResponse\"],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Response creation date\",\n        description=\"The date this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    diagnosis: typing.List[fhirtypes.ExplanationOfBenefitDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"Pertinent diagnosis information\",\n        description=\"Information about diagnoses relevant to the claim items.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A human readable description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Author of the claim\",\n        description=(\n            \"Individual who created the claim, predetermination or \" \"preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    facility: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"facility\",\n        title=\"Servicing Facility\",\n        description=\"Facility where the services were provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    form: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"Printed reference or actual form\",\n        description=(\n            \"The actual form, by reference or inclusion, for printing the content \"\n            \"or an EOB.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    formCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"formCode\",\n        title=\"Printed form identifier\",\n        description=\"A code for the form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    fundsReserve: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fundsReserve\",\n        title=\"Funds reserved status\",\n        description=(\n            \"A code, used only on a response to a preauthorization, to indicate \"\n            \"whether the benefits payable have been reserved and for whom.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    fundsReserveRequested: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fundsReserveRequested\",\n        title=\"For whom to reserve funds\",\n        description=(\n            \"A code to indicate whether and for whom funds are to be reserved for \"\n            \"future claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for the resource\",\n        description=\"A unique identifier assigned to this explanation of benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: typing.List[fhirtypes.ExplanationOfBenefitInsuranceType] = Field(\n        default=...,\n        alias=\"insurance\",\n        title=\"Patient insurance information\",\n        description=(\n            \"Financial instruments for reimbursement for the health care products \"\n            \"and services specified on the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"insurer\",\n        title=\"Party responsible for reimbursement\",\n        description=(\n            \"The party responsible for authorization, adjudication and \"\n            \"reimbursement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    item: typing.List[fhirtypes.ExplanationOfBenefitItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Product or service provided\",\n        description=(\n            \"A claim line. Either a simple (a product or service) or a 'group' of \"\n            \"details which can also be a simple items or groups of sub-details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    originalPrescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"originalPrescription\",\n        title=\"Original prescription if superceded by fulfiller\",\n        description=(\n            \"Original prescription which has been superseded by this prescription \"\n            \"to support the dispensing of pharmacy services, medications or \"\n            \"products.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"queued | complete | error | partial\",\n        description=(\n            \"The outcome of the claim, predetermination, or preauthorization \"\n            \"processing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"queued\", \"complete\", \"error\", \"partial\"],\n        },\n    )\n    outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcome\", title=\"Extension field for ``outcome``.\"\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The recipient of the products and services\",\n        description=(\n            \"The party to whom the professional services and/or products have been \"\n            \"supplied or are being considered and for whom actual for forecast \"\n            \"reimbursement is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    payee: fhirtypes.ExplanationOfBenefitPayeeType | None = Field(\n        default=None,\n        alias=\"payee\",\n        title=\"Recipient of benefits payable\",\n        description=(\n            \"The party to be reimbursed for cost of the products and services \"\n            \"according to the terms of the policy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payment: fhirtypes.ExplanationOfBenefitPaymentType | None = Field(\n        default=None,\n        alias=\"payment\",\n        title=\"Payment Details\",\n        description=\"Payment details for the adjudication of the claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Preauthorization reference\",\n        description=(\n            \"Reference from the Insurer which is used in later communications which\"\n            \" refers to this adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    preAuthRefPeriod: typing.List[fhirtypes.PeriodType] | None = Field(\n        default=None,\n        alias=\"preAuthRefPeriod\",\n        title=\"Preauthorization in-effect period\",\n        description=(\n            \"The timeframe during which the supplied preauthorization reference may\"\n            \" be quoted on claims to obtain the adjudication as provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    precedence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"precedence\",\n        title=\"Precedence (primary, secondary, etc.)\",\n        description=(\n            \"This indicates the relative order of a series of EOBs related to \"\n            \"different coverages for the same suite of services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    precedence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_precedence\", title=\"Extension field for ``precedence``.\"\n    )\n\n    prescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"prescription\",\n        title=\"Prescription authorizing services or products\",\n        description=(\n            \"Prescription to support the dispensing of pharmacy, device or vision \"\n            \"products.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\", \"VisionPrescription\"],\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Desired processing urgency\",\n        description=(\n            \"The provider-required urgency of processing the request. Typical \"\n            \"values include: stat, routine deferred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    procedure: typing.List[fhirtypes.ExplanationOfBenefitProcedureType] | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"Clinical procedures performed\",\n        description=(\n            \"Procedures performed on the patient relevant to the billing items with\"\n            \" the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    processNote: typing.List[\n        fhirtypes.ExplanationOfBenefitProcessNoteType\n    ] | None = Field(\n        default=None,\n        alias=\"processNote\",\n        title=\"Note concerning adjudication\",\n        description=(\n            \"A note that describes or explains adjudication results in a human \"\n            \"readable form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"provider\",\n        title=\"Party responsible for the claim\",\n        description=(\n            \"The provider which is responsible for the claim, predetermination or \"\n            \"preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    referral: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referral\",\n        title=\"Treatment Referral\",\n        description=\"A reference to a referral resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    related: typing.List[fhirtypes.ExplanationOfBenefitRelatedType] | None = Field(\n        default=None,\n        alias=\"related\",\n        title=\"Prior or corollary claims\",\n        description=(\n            \"Other claims which are related to this claim such as prior submissions\"\n            \" or claims for related services or for the same event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"More granular claim type\",\n        description=(\n            \"A finer grained suite of claim type codes which may convey additional \"\n            \"information such as Inpatient vs Outpatient and/or a specialty \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInfo: typing.List[\n        fhirtypes.ExplanationOfBenefitSupportingInfoType\n    ] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Supporting information\",\n        description=(\n            \"Additional information codes regarding exceptions, special \"\n            \"considerations, the condition, situation, prior or concurrent issues.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    total: typing.List[fhirtypes.ExplanationOfBenefitTotalType] | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"Adjudication totals\",\n        description=\"Categorized monetary totals for the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Category or discipline\",\n        description=(\n            \"The category of claim, e.g. oral, pharmacy, vision, institutional, \"\n            \"professional.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"claim | preauthorization | predetermination\",\n        description=(\n            \"A code to indicate whether the nature of the request is: to request \"\n            \"adjudication of products and services previously rendered; or \"\n            \"requesting authorization and adjudication for provision in the future;\"\n            \" or requesting the non-binding adjudication of the listed products and\"\n            \" services which could be provided in the future.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"claim\", \"preauthorization\", \"predetermination\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subType\",\n            \"use\",\n            \"patient\",\n            \"billablePeriod\",\n            \"created\",\n            \"enterer\",\n            \"insurer\",\n            \"provider\",\n            \"priority\",\n            \"fundsReserveRequested\",\n            \"fundsReserve\",\n            \"related\",\n            \"prescription\",\n            \"originalPrescription\",\n            \"payee\",\n            \"referral\",\n            \"facility\",\n            \"claim\",\n            \"claimResponse\",\n            \"outcome\",\n            \"disposition\",\n            \"preAuthRef\",\n            \"preAuthRefPeriod\",\n            \"careTeam\",\n            \"supportingInfo\",\n            \"diagnosis\",\n            \"procedure\",\n            \"precedence\",\n            \"insurance\",\n            \"accident\",\n            \"item\",\n            \"addItem\",\n            \"adjudication\",\n            \"total\",\n            \"payment\",\n            \"formCode\",\n            \"form\",\n            \"processNote\",\n            \"benefitPeriod\",\n            \"benefitBalance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"type\",\n            \"use\",\n            \"patient\",\n            \"billablePeriod\",\n            \"created\",\n            \"insurer\",\n            \"provider\",\n            \"outcome\",\n            \"insurance\",\n            \"total\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"outcome\", \"outcome__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"use\", \"use__ext\"),\n        ]\n        return required_fields\n\n\nclass ExplanationOfBenefitAccident(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of the event.\n    Details of a accident which resulted in injuries which required the\n    products and services listed in the claim.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitAccident\"\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the incident occurred\",\n        description=(\n            \"Date of an accident event  related to the products and services \"\n            \"contained in the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Where the event occurred\",\n        description=\"The physical location of the accident event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Where the event occurred\",\n        description=\"The physical location of the accident event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The nature of the accident\",\n        description=(\n            \"The type or context of the accident event for the purposes of \"\n            \"selection of potential insurance coverages and determination of \"\n            \"coordination between insurers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitAccident`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"date\",\n            \"type\",\n            \"locationAddress\",\n            \"locationReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAccident`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"location\": [\"locationAddress\", \"locationReference\"]}\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitAddItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line items.\n    The first-tier service adjudications for payor added product or service\n    lines.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitAddItem\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items adjudication\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical location\",\n        description=\"Physical service site on the patient (limb, tooth, etc.).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ExplanationOfBenefitAddItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Insurer added line items\",\n        description=\"The second-tier service adjudications for payor added services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"detailSequence\",\n        title=\"Detail sequence number\",\n        description=(\n            \"The sequence number of the details within the claim item which this \"\n            \"line is intended to replace.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detailSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_detailSequence\",\n        title=\"Extension field for ``detailSequence``.\",\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    itemSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"itemSequence\",\n        title=\"Item sequence number\",\n        description=\"Claim items which this service line is intended to replace.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    itemSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_itemSequence\",\n        title=\"Extension field for ``itemSequence``.\",\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"locationCodeableConcept\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an additional service or product\"\n            \" or charge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    productOrService: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related claim details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Authorized providers\",\n        description=(\n            \"The providers who are authorized for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subDetailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"subDetailSequence\",\n        title=\"Subdetail sequence number\",\n        description=(\n            \"The sequence number of the sub-details woithin the details within the \"\n            \"claim item which this line is intended to replace.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subDetailSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_subDetailSequence\",\n        title=\"Extension field for ``subDetailSequence``.\",\n    )\n\n    subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subSite\",\n        title=\"Anatomical sub-location\",\n        description=(\n            \"A region or surface of the bodySite, e.g. limb region or tooth \"\n            \"surface(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitAddItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemSequence\",\n            \"detailSequence\",\n            \"subDetailSequence\",\n            \"provider\",\n            \"productOrService\",\n            \"modifier\",\n            \"programCode\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"locationCodeableConcept\",\n            \"locationAddress\",\n            \"locationReference\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"bodySite\",\n            \"subSite\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"location\": [\n                \"locationAddress\",\n                \"locationCodeableConcept\",\n                \"locationReference\",\n            ],\n            \"serviced\": [\"servicedDate\", \"servicedPeriod\"],\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitAddItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line items.\n    The second-tier service adjudications for payor added services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitAddItemDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items adjudication\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an additional service or product\"\n            \" or charge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    productOrService: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related claim details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subDetail: typing.List[\n        fhirtypes.ExplanationOfBenefitAddItemDetailSubDetailType\n    ] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Insurer added line items\",\n        description=\"The third-tier service adjudications for payor added services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitAddItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"productOrService\",\n            \"modifier\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitAddItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line items.\n    The third-tier service adjudications for payor added services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitAddItemDetailSubDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items adjudication\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an additional service or product\"\n            \" or charge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    productOrService: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related claim details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitAddItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"productOrService\",\n            \"modifier\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"noteNumber\",\n            \"adjudication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitBenefitBalance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Balance by Benefit Category.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitBenefitBalance\"\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the benefit or services covered\",\n        description=\"A richer description of the benefit or services covered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    excluded: bool | None = Field(\n        default=None,\n        alias=\"excluded\",\n        title=\"Excluded from the plan\",\n        description=(\n            \"True if the indicated class of service is excluded from the plan, \"\n            \"missing or False indicates the product or service is included in the \"\n            \"coverage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    excluded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_excluded\", title=\"Extension field for ``excluded``.\"\n    )\n\n    financial: typing.List[\n        fhirtypes.ExplanationOfBenefitBenefitBalanceFinancialType\n    ] | None = Field(\n        default=None,\n        alias=\"financial\",\n        title=\"Benefit Summary\",\n        description=\"Benefits Used to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Short name for the benefit\",\n        description=\"A short name or tag for the benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    network: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"In or out of network\",\n        description=(\n            \"Is a flag to indicate whether the benefits refer to in-network \"\n            \"providers or out-of-network providers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    term: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"term\",\n        title=\"Annual or lifetime\",\n        description=(\n            \"The term or period of the values such as 'maximum lifetime benefit' or\"\n            \" 'maximum annual visits'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Individual or family\",\n        description=\"Indicates if the benefits apply to an individual or to the family.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitBenefitBalance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"excluded\",\n            \"name\",\n            \"description\",\n            \"network\",\n            \"unit\",\n            \"term\",\n            \"financial\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitBenefitBalance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitBenefitBalanceFinancial(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefit Summary.\n    Benefits Used to date.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitBenefitBalanceFinancial\"\n\n    allowedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"allowedMoney\",\n        title=\"Benefits allowed\",\n        description=\"The quantity of the benefit which is permitted under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    allowedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"allowedString\",\n        title=\"Benefits allowed\",\n        description=\"The quantity of the benefit which is permitted under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    allowedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedString\",\n        title=\"Extension field for ``allowedString``.\",\n    )\n\n    allowedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"allowedUnsignedInt\",\n        title=\"Benefits allowed\",\n        description=\"The quantity of the benefit which is permitted under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    allowedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedUnsignedInt\",\n        title=\"Extension field for ``allowedUnsignedInt``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Benefit classification\",\n        description=\"Classification of benefit being provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"usedMoney\",\n        title=\"Benefits used\",\n        description=\"The quantity of the benefit which have been consumed to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    usedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"usedUnsignedInt\",\n        title=\"Benefits used\",\n        description=\"The quantity of the benefit which have been consumed to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n    usedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_usedUnsignedInt\",\n        title=\"Extension field for ``usedUnsignedInt``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitBenefitBalanceFinancial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"allowedUnsignedInt\",\n            \"allowedString\",\n            \"allowedMoney\",\n            \"usedUnsignedInt\",\n            \"usedMoney\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitBenefitBalanceFinancial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"allowed\": [\"allowedMoney\", \"allowedString\", \"allowedUnsignedInt\"],\n            \"used\": [\"usedMoney\", \"usedUnsignedInt\"],\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitCareTeam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Care Team members.\n    The members of the team who provided the products and services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitCareTeam\"\n\n    provider: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"provider\",\n        title=\"Practitioner or organization\",\n        description=\"Member of the team who provided the product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    qualification: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"qualification\",\n        title=\"Practitioner credential or specialization\",\n        description=(\n            \"The qualification of the practitioner which is applicable for this \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    responsible: bool | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Indicator of the lead practitioner\",\n        description=(\n            \"The party who is billing and/or responsible for the claimed products \"\n            \"or services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_responsible\", title=\"Extension field for ``responsible``.\"\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Function within the team\",\n        description=(\n            \"The lead, assisting or supervising practitioner and their discipline \"\n            \"if a multidisciplinary team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Order of care team\",\n        description=\"A number to uniquely identify care team entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitCareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"provider\",\n            \"responsible\",\n            \"role\",\n            \"qualification\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitCareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ExplanationOfBenefitDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Pertinent diagnosis information.\n    Information about diagnoses relevant to the claim items.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitDiagnosis\"\n\n    diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"diagnosisCodeableConcept\",\n        title=\"Nature of illness or problem\",\n        description=(\n            \"The nature of illness or problem in a coded form or as a reference to \"\n            \"an external defined Condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    diagnosisReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"diagnosisReference\",\n        title=\"Nature of illness or problem\",\n        description=(\n            \"The nature of illness or problem in a coded form or as a reference to \"\n            \"an external defined Condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    onAdmission: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"onAdmission\",\n        title=\"Present on admission\",\n        description=(\n            \"Indication of whether the diagnosis was present on admission to a \"\n            \"facility.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    packageCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"packageCode\",\n        title=\"Package billing code\",\n        description=(\n            \"A package billing code or bundle code used to group products and \"\n            \"services to a particular health condition (such as heart attack) which\"\n            \" is based on a predetermined grouping code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Diagnosis instance identifier\",\n        description=\"A number to uniquely identify diagnosis entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Timing or nature of the diagnosis\",\n        description=\"When the condition was observed or the relative ranking.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"diagnosisCodeableConcept\",\n            \"diagnosisReference\",\n            \"type\",\n            \"onAdmission\",\n            \"packageCode\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"diagnosis\": [\"diagnosisCodeableConcept\", \"diagnosisReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient insurance information.\n    Financial instruments for reimbursement for the health care products and\n    services specified on the claim.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitInsurance\"\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=(\n            \"Reference to the insurance card level information contained in the \"\n            \"Coverage resource. The coverage issuing insurer will use these details\"\n            \" to locate the patient's actual coverage within the insurer's \"\n            \"information system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    focal: bool | None = Field(\n        default=None,\n        alias=\"focal\",\n        title=\"Coverage to be used for adjudication\",\n        description=(\n            \"A flag to indicate that this Coverage is to be used for adjudication \"\n            \"of this claim when set to true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_focal\", title=\"Extension field for ``focal``.\"\n    )\n\n    preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Prior authorization reference number\",\n        description=(\n            \"Reference numbers previously provided by the insurer to the provider \"\n            \"to be quoted on subsequent claims containing services or products \"\n            \"related to the prior authorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"focal\",\n            \"coverage\",\n            \"preAuthRef\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"focal\", \"coverage\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"focal\", \"focal__ext\")]\n        return required_fields\n\n\nclass ExplanationOfBenefitItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Product or service provided.\n    A claim line. Either a simple (a product or service) or a 'group' of\n    details which can also be a simple items or groups of sub-details.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItem\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Adjudication details\",\n        description=(\n            \"If this item is a group then the values here are a summary of the \"\n            \"adjudication of the detail items. If this item is a simple product or \"\n            \"service then this is the result of the adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical location\",\n        description=\"Physical service site on the patient (limb, tooth, etc.).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    careTeamSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"careTeamSequence\",\n        title=\"Applicable care team members\",\n        description=\"Care team members related to this service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    careTeamSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_careTeamSequence\",\n        title=\"Extension field for ``careTeamSequence``.\",\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ExplanationOfBenefitItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Additional items\",\n        description=\"Second-tier of goods and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    diagnosisSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"diagnosisSequence\",\n        title=\"Applicable diagnoses\",\n        description=\"Diagnoses applicable for this service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    diagnosisSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_diagnosisSequence\",\n        title=\"Extension field for ``diagnosisSequence``.\",\n    )\n\n    encounter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounters related to this billed item\",\n        description=(\n            \"A billed item may include goods or services provided in multiple \"\n            \"encounters.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    informationSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"informationSequence\",\n        title=\"Applicable exception and supporting information\",\n        description=(\n            \"Exceptions, special conditions and supporting information applicable \"\n            \"for this service or product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    informationSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_informationSequence\",\n        title=\"Extension field for ``informationSequence``.\",\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"locationCodeableConcept\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Product or service billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an additional service or product\"\n            \" or charge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    procedureSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"procedureSequence\",\n        title=\"Applicable procedures\",\n        description=\"Procedures applicable for this service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    procedureSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_procedureSequence\",\n        title=\"Extension field for ``procedureSequence``.\",\n    )\n\n    productOrService: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related claim details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Item instance identifier\",\n        description=\"A number to uniquely identify item entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subSite\",\n        title=\"Anatomical sub-location\",\n        description=(\n            \"A region or surface of the bodySite, e.g. limb region or tooth \"\n            \"surface(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"careTeamSequence\",\n            \"diagnosisSequence\",\n            \"procedureSequence\",\n            \"informationSequence\",\n            \"revenue\",\n            \"category\",\n            \"productOrService\",\n            \"modifier\",\n            \"programCode\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"locationCodeableConcept\",\n            \"locationAddress\",\n            \"locationReference\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"udi\",\n            \"bodySite\",\n            \"subSite\",\n            \"encounter\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"location\": [\n                \"locationAddress\",\n                \"locationCodeableConcept\",\n                \"locationReference\",\n            ],\n            \"serviced\": [\"servicedDate\", \"servicedPeriod\"],\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitItemAdjudication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication details.\n    If this item is a group then the values here are a summary of the\n    adjudication of the detail items. If this item is a simple product or\n    service then this is the result of the adjudication of this item.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItemAdjudication\"\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Monetary amount\",\n        description=\"Monetary amount associated with the category.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Type of adjudication information\",\n        description=(\n            \"A code to indicate the information type of this adjudication record. \"\n            \"Information types may include: the value submitted, maximum values or \"\n            \"percentages allowed or payable under the plan, amounts that the \"\n            \"patient is responsible for in-aggregate or pertaining to this item, \"\n            \"amounts paid by other coverages, and the benefit payable for this \"\n            \"item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Explanation of adjudication outcome\",\n        description=(\n            \"A code supporting the understanding of the adjudication result and \"\n            \"explaining variance from expected amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Non-monitary value\",\n        description=(\n            \"A non-monetary value associated with the category. Mutually exclusive \"\n            \"to the amount element above.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItemAdjudication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"reason\",\n            \"amount\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemAdjudication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional items.\n    Second-tier of goods and services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItemDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Detail level adjudication details\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an additional service or product\"\n            \" or charge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    productOrService: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related claim details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Product or service provided\",\n        description=(\n            \"A claim detail line. Either a simple (a product or service) or a \"\n            \"'group' of sub-details which are simple items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    subDetail: typing.List[\n        fhirtypes.ExplanationOfBenefitItemDetailSubDetailType\n    ] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Additional items\",\n        description=\"Third-tier of goods and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"revenue\",\n            \"category\",\n            \"productOrService\",\n            \"modifier\",\n            \"programCode\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"udi\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ExplanationOfBenefitItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional items.\n    Third-tier of goods and services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItemDetailSubDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Subdetail level adjudication details\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an additional service or product\"\n            \" or charge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    productOrService: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related claim details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Product or service provided\",\n        description=(\n            \"A claim detail line. Either a simple (a product or service) or a \"\n            \"'group' of sub-details which are simple items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"revenue\",\n            \"category\",\n            \"productOrService\",\n            \"modifier\",\n            \"programCode\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"udi\",\n            \"noteNumber\",\n            \"adjudication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ExplanationOfBenefitPayee(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Recipient of benefits payable.\n    The party to be reimbursed for cost of the products and services according\n    to the terms of the policy.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitPayee\"\n\n    party: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"party\",\n        title=\"Recipient reference\",\n        description=(\n            \"Reference to the individual or organization to whom any payment will \"\n            \"be made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Category of recipient\",\n        description=\"Type of Party to be reimbursed: Subscriber, provider, other.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitPayee`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"party\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitPayee`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitPayment(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Payment Details.\n    Payment details for the adjudication of the claim.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitPayment\"\n\n    adjustment: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"adjustment\",\n        title=\"Payment adjustment for non-claim issues\",\n        description=(\n            \"Total amount of all adjustments to this payment included in this \"\n            \"transaction which are not related to this claim's adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    adjustmentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"adjustmentReason\",\n        title=\"Explanation for the variance\",\n        description=\"Reason for the payment adjustment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Payable amount after adjustment\",\n        description=\"Benefits payable less any payment adjustment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Expected date of payment\",\n        description=(\n            \"Estimated date the payment will be issued or the actual issue date of \"\n            \"payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for the payment\",\n        description=\"Issuer's unique identifier for the payment instrument.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Partial or complete payment\",\n        description=(\n            \"Whether this represents partial or complete payment of the benefits \"\n            \"payable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitPayment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"adjustment\",\n            \"adjustmentReason\",\n            \"date\",\n            \"amount\",\n            \"identifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitPayment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitProcedure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Clinical procedures performed.\n    Procedures performed on the patient relevant to the billing items with the\n    claim.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitProcedure\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the procedure was performed\",\n        description=\"Date and optionally time the procedure was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    procedureCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"procedureCodeableConcept\",\n        title=\"Specific clinical procedure\",\n        description=(\n            \"The code or reference to a Procedure resource which identifies the \"\n            \"clinical intervention performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e procedure[x]\n            \"one_of_many\": \"procedure\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    procedureReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"procedureReference\",\n        title=\"Specific clinical procedure\",\n        description=(\n            \"The code or reference to a Procedure resource which identifies the \"\n            \"clinical intervention performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e procedure[x]\n            \"one_of_many\": \"procedure\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Procedure instance identifier\",\n        description=\"A number to uniquely identify procedure entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Category of Procedure\",\n        description=\"When the condition was observed or the relative ranking.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"type\",\n            \"date\",\n            \"procedureCodeableConcept\",\n            \"procedureReference\",\n            \"udi\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"procedure\": [\"procedureCodeableConcept\", \"procedureReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitProcessNote(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Note concerning adjudication.\n    A note that describes or explains adjudication results in a human readable\n    form.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitProcessNote\"\n\n    language: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language of the text\",\n        description=\"A code to define the language used in the text of the note.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    number: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"Note instance identifier\",\n        description=\"A number to uniquely identify a note entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Note explanatory text\",\n        description=\"The explanation or description associated with the processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"display | print | printoper\",\n        description=\"The business purpose of the note text.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"display\", \"print\", \"printoper\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"number\",\n            \"type\",\n            \"text\",\n            \"language\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitRelated(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Prior or corollary claims.\n    Other claims which are related to this claim such as prior submissions or\n    claims for related services or for the same event.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitRelated\"\n\n    claim: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claim\",\n        title=\"Reference to the related claim\",\n        description=\"Reference to a related claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Claim\"],\n        },\n    )\n\n    reference: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"File or case reference\",\n        description=(\n            \"An alternate organizational reference to the case or file to which \"\n            \"this particular claim pertains.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"How the reference claim is related\",\n        description=\"A code to convey how the claims are related.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"claim\",\n            \"relationship\",\n            \"reference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitSupportingInfo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supporting information.\n    Additional information codes regarding exceptions, special considerations,\n    the condition, situation, prior or concurrent issues.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitSupportingInfo\"\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Classification of the supplied information\",\n        description=(\n            \"The general class of the information supplied: information; exception;\"\n            \" accident, employment; onset, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of information\",\n        description=(\n            \"System and code pertaining to the specific information regarding \"\n            \"special conditions relating to the setting, treatment or patient  for \"\n            \"which care is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Explanation for the information\",\n        description=(\n            \"Provides the reason in the situation where a reason code is required \"\n            \"in addition to the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Information instance identifier\",\n        description=\"A number to uniquely identify supporting information entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    timingDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"timingDate\",\n        title=\"When it occurred\",\n        description=\"The date when or period to which this information refers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timingDate\", title=\"Extension field for ``timingDate``.\"\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When it occurred\",\n        description=\"The date when or period to which this information refers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"category\",\n            \"code\",\n            \"timingDate\",\n            \"timingPeriod\",\n            \"valueBoolean\",\n            \"valueString\",\n            \"valueQuantity\",\n            \"valueAttachment\",\n            \"valueReference\",\n            \"reason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\"timingDate\", \"timingPeriod\"],\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitTotal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication totals.\n    Categorized monetary totals for the adjudication.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitTotal\"\n\n    amount: fhirtypes.MoneyType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Financial total for the category\",\n        description=\"Monetary total amount associated with the category.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Type of adjudication information\",\n        description=(\n            \"A code to indicate the information type of this adjudication record. \"\n            \"Information types may include: the value submitted, maximum values or \"\n            \"percentages allowed or payable under the plan, amounts that the \"\n            \"patient is responsible for in aggregate or pertaining to this item, \"\n            \"amounts paid by other coverages, and the benefit payable for this \"\n            \"item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitTotal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"category\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitTotal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"category\", \"amount\"]\n"
  },
  {
    "path": "fhir/resources/R4B/expression.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Expression\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Expression(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An expression that can be used to generate a value.\n    A expression that is evaluated in a specified context and returns a value.\n    The context of use of the expression must specify the context in which the\n    expression is evaluated, and how the result of the expression is used.\n    \"\"\"\n\n    __resource_type__ = \"Expression\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the condition\",\n        description=(\n            \"A brief, natural language description of the condition that \"\n            \"effectively communicates the intended semantics.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Expression in specified language\",\n        description=\"An expression in the specified language that returns a value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=(\n            \"text/cql | text/fhirpath | application/x-fhir-query | text/cql-\"\n            \"identifier | text/cql-expression | etc.\"\n        ),\n        description=\"The media type of the language for the expression.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"text/cql\",\n                \"text/fhirpath\",\n                \"application/x-fhir-query\",\n                \"text/cql-identifier\",\n                \"text/cql-expression\",\n                \"etc.\",\n            ],\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Short name assigned to expression for reuse\",\n        description=(\n            \"A short name assigned to the expression to allow for multiple reuse of\"\n            \" the expression in the context where it is defined.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    reference: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Where the expression is found\",\n        description=\"A URI that defines where the expression is found.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Expression`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"description\",\n            \"name\",\n            \"language\",\n            \"expression\",\n            \"reference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Expression`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"description\", \"name\", \"language\", \"expression\", \"reference\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"language\", \"language__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/extension.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Extension\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Extension(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Optional Extensions Element.\n    Optional Extension Element - found in all resources.\n    \"\"\"\n\n    __resource_type__ = \"Extension\"\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"identifies the meaning of the extension\",\n        description=(\n            \"Source of the definition for the extension code - a logical name or a \"\n            \"URL.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"valueCodeableReference\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"valueContactDetail\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueContributor: fhirtypes.ContributorType | None = Field(\n        default=None,\n        alias=\"valueContributor\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"valueDataRequirement\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"valueDosage\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"valueExpression\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"valueParameterDefinition\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"valueRatioRange\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"valueRelatedArtifact\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"valueTriggerDefinition\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"valueUsageContext\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"valueUuid\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Extension`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"url\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCodeableReference\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueRatioRange\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueContributor\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueDosage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Extension`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCanonical\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCodeableReference\",\n                \"valueCoding\",\n                \"valueContactDetail\",\n                \"valueContactPoint\",\n                \"valueContributor\",\n                \"valueCount\",\n                \"valueDataRequirement\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDosage\",\n                \"valueDuration\",\n                \"valueExpression\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueMarkdown\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valueParameterDefinition\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueRatioRange\",\n                \"valueReference\",\n                \"valueRelatedArtifact\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueTriggerDefinition\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n                \"valueUrl\",\n                \"valueUsageContext\",\n                \"valueUuid\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/familymemberhistory.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass FamilyMemberHistory(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about patient's relatives, relevant for patient.\n    Significant health conditions for a person related to the patient relevant\n    in the context of care for the patient.\n    \"\"\"\n\n    __resource_type__ = \"FamilyMemberHistory\"\n\n    ageAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"ageAge\",\n        title=\"(approximate) age\",\n        description=(\n            \"The age of the relative at the time the family member history is \"\n            \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e age[x]\n            \"one_of_many\": \"age\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    ageRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"ageRange\",\n        title=\"(approximate) age\",\n        description=(\n            \"The age of the relative at the time the family member history is \"\n            \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e age[x]\n            \"one_of_many\": \"age\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    ageString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"ageString\",\n        title=\"(approximate) age\",\n        description=(\n            \"The age of the relative at the time the family member history is \"\n            \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e age[x]\n            \"one_of_many\": \"age\",\n            \"one_of_many_required\": False,\n        },\n    )\n    ageString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ageString\", title=\"Extension field for ``ageString``.\"\n    )\n\n    bornDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"bornDate\",\n        title=\"(approximate) date of birth\",\n        description=\"The actual or approximate date of birth of the relative.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e born[x]\n            \"one_of_many\": \"born\",\n            \"one_of_many_required\": False,\n        },\n    )\n    bornDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_bornDate\", title=\"Extension field for ``bornDate``.\"\n    )\n\n    bornPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"bornPeriod\",\n        title=\"(approximate) date of birth\",\n        description=\"The actual or approximate date of birth of the relative.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e born[x]\n            \"one_of_many\": \"born\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    bornString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"bornString\",\n        title=\"(approximate) date of birth\",\n        description=\"The actual or approximate date of birth of the relative.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e born[x]\n            \"one_of_many\": \"born\",\n            \"one_of_many_required\": False,\n        },\n    )\n    bornString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_bornString\", title=\"Extension field for ``bornString``.\"\n    )\n\n    condition: typing.List[fhirtypes.FamilyMemberHistoryConditionType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Condition that the related person had\",\n        description=(\n            \"The significant Conditions (or condition) that the family member had. \"\n            \"This is a repeating section to allow a system to represent more than \"\n            \"one condition per resource, though there is nothing stopping multiple \"\n            \"resources - one per condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dataAbsentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"dataAbsentReason\",\n        title=\"subject-unknown | withheld | unable-to-obtain | deferred\",\n        description=\"Describes why the family member's history is not available.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When history was recorded or last updated\",\n        description=(\n            \"The date (and possibly time) when the family member history was \"\n            \"recorded or last updated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    deceasedAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"deceasedAge\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    deceasedBoolean: bool | None = Field(\n        default=None,\n        alias=\"deceasedBoolean\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedBoolean\",\n        title=\"Extension field for ``deceasedBoolean``.\",\n    )\n\n    deceasedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"deceasedDate\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedDate\",\n        title=\"Extension field for ``deceasedDate``.\",\n    )\n\n    deceasedRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"deceasedRange\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    deceasedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"deceasedString\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedString\",\n        title=\"Extension field for ``deceasedString``.\",\n    )\n\n    estimatedAge: bool | None = Field(\n        default=None,\n        alias=\"estimatedAge\",\n        title=\"Age is estimated?\",\n        description=\"If true, indicates that the age value specified is an estimated value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    estimatedAge__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_estimatedAge\",\n        title=\"Extension field for ``estimatedAge``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Id(s) for this record\",\n        description=(\n            \"Business identifiers assigned to this family member history by the \"\n            \"performer or other systems which remain constant as the resource is \"\n            \"updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"FamilyMemberHistory.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"Questionnaire\",\n                \"ActivityDefinition\",\n                \"Measure\",\n                \"OperationDefinition\",\n            ],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this FamilyMemberHistory.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The family member described\",\n        description=(\n            'This will either be a name or a description; e.g. \"Aunt Susan\", \"my '\n            'cousin with the red hair\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"General note about related person\",\n        description=(\n            \"This property allows a non condition-specific note to the made about \"\n            \"the related person. Ideally, the note would be in the condition \"\n            \"property, but this is not always possible.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Patient history is about\",\n        description=\"The person who this history concerns.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why was family member history performed?\",\n        description=(\n            \"Describes why the family member history occurred in coded or textual \"\n            \"form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why was family member history performed?\",\n        description=(\n            \"Indicates a Condition, Observation, AllergyIntolerance, or \"\n            \"QuestionnaireResponse that justifies this family member history event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"AllergyIntolerance\",\n                \"QuestionnaireResponse\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"relationship\",\n        title=\"Relationship to the subject\",\n        description=(\n            \"The type of relationship this person has to the patient (father, \"\n            \"mother, brother etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sex: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"sex\",\n        title=\"male | female | other | unknown\",\n        description=\"The birth sex of the family member.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"partial | completed | entered-in-error | health-unknown\",\n        description=(\n            \"A code specifying the status of the record of the family history of a \"\n            \"specific family member.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"partial\",\n                \"completed\",\n                \"entered-in-error\",\n                \"health-unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``FamilyMemberHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"status\",\n            \"dataAbsentReason\",\n            \"patient\",\n            \"date\",\n            \"name\",\n            \"relationship\",\n            \"sex\",\n            \"bornPeriod\",\n            \"bornDate\",\n            \"bornString\",\n            \"ageAge\",\n            \"ageRange\",\n            \"ageString\",\n            \"estimatedAge\",\n            \"deceasedBoolean\",\n            \"deceasedAge\",\n            \"deceasedRange\",\n            \"deceasedDate\",\n            \"deceasedString\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"note\",\n            \"condition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``FamilyMemberHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"status\",\n            \"dataAbsentReason\",\n            \"patient\",\n            \"date\",\n            \"name\",\n            \"relationship\",\n            \"sex\",\n            \"ageAge\",\n            \"ageRange\",\n            \"ageString\",\n            \"estimatedAge\",\n            \"deceasedBoolean\",\n            \"deceasedAge\",\n            \"deceasedRange\",\n            \"deceasedDate\",\n            \"deceasedString\",\n            \"reasonCode\",\n            \"reasonReference\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"age\": [\"ageAge\", \"ageRange\", \"ageString\"],\n            \"born\": [\"bornDate\", \"bornPeriod\", \"bornString\"],\n            \"deceased\": [\n                \"deceasedAge\",\n                \"deceasedBoolean\",\n                \"deceasedDate\",\n                \"deceasedRange\",\n                \"deceasedString\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass FamilyMemberHistoryCondition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Condition that the related person had.\n    The significant Conditions (or condition) that the family member had. This\n    is a repeating section to allow a system to represent more than one\n    condition per resource, though there is nothing stopping multiple resources\n    - one per condition.\n    \"\"\"\n\n    __resource_type__ = \"FamilyMemberHistoryCondition\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Condition suffered by relation\",\n        description=(\n            \"The actual condition specified. Could be a coded condition (like MI or\"\n            \" Diabetes) or a less specific string like 'cancer' depending on how \"\n            \"much is known about the condition and the capabilities of the creating\"\n            \" system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contributedToDeath: bool | None = Field(\n        default=None,\n        alias=\"contributedToDeath\",\n        title=\"Whether the condition contributed to the cause of death\",\n        description=(\n            \"This condition contributed to the cause of death of the related \"\n            \"person. If contributedToDeath is not populated, then it is unknown.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    contributedToDeath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_contributedToDeath\",\n        title=\"Extension field for ``contributedToDeath``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Extra information about condition\",\n        description=(\n            \"An area where general notes can be placed about this specific \"\n            \"condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onsetAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"onsetAge\",\n        title=\"When condition first manifested\",\n        description=(\n            \"Either the age of onset, range of approximate age or descriptive \"\n            \"string can be recorded.  For conditions with multiple occurrences, \"\n            \"this describes the first known occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"onsetPeriod\",\n        title=\"When condition first manifested\",\n        description=(\n            \"Either the age of onset, range of approximate age or descriptive \"\n            \"string can be recorded.  For conditions with multiple occurrences, \"\n            \"this describes the first known occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"onsetRange\",\n        title=\"When condition first manifested\",\n        description=(\n            \"Either the age of onset, range of approximate age or descriptive \"\n            \"string can be recorded.  For conditions with multiple occurrences, \"\n            \"this describes the first known occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"onsetString\",\n        title=\"When condition first manifested\",\n        description=(\n            \"Either the age of onset, range of approximate age or descriptive \"\n            \"string can be recorded.  For conditions with multiple occurrences, \"\n            \"this describes the first known occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onsetString\", title=\"Extension field for ``onsetString``.\"\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"deceased | permanent disability | etc.\",\n        description=(\n            \"Indicates what happened following the condition.  If the condition \"\n            \"resulted in death, deceased date is captured on the relation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``FamilyMemberHistoryCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"outcome\",\n            \"contributedToDeath\",\n            \"onsetAge\",\n            \"onsetRange\",\n            \"onsetPeriod\",\n            \"onsetString\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``FamilyMemberHistoryCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"onset\": [\"onsetAge\", \"onsetPeriod\", \"onsetRange\", \"onsetString\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/fhirprimitiveextension.py",
    "content": "from __future__ import annotations as _annotations\n\nimport typing\n\nfrom fhir_core import fhirabstractmodel\nfrom pydantic import Field, model_validator\nfrom pydantic_core import PydanticCustomError\n\nfrom . import fhirtypes\n\n__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n\n\nclass FHIRPrimitiveExtension(fhirabstractmodel.FHIRAbstractModel):\n    \"\"\"@see: https://www.hl7.org/fhir/extensibility.html\n    Extensibility feature for FHIR Primitive Data Types.\"\"\"\n\n    __resource_type__ = \"FHIRPrimitiveExtension\"\n\n    id: typing.Optional[fhirtypes.StringType] = Field(\n        default=None,\n        alias=\"id\",\n        title=\"Type `String`\",\n        description=\"Unique id for inter-element referencing\",\n        # if property is an element of this resource.\n        json_schema_extra={\"element_property\": False},\n    )\n\n    extension: typing.Optional[typing.List[fhirtypes.ExtensionType]] = Field(\n        None,\n        alias=\"extension\",\n        title=\"List of `Extension` items (represented as `dict` in JSON)\",\n        description=\"Additional content defined by implementations\",\n        # if property is an element of this resource.\n        json_schema_extra={\"element_property\": False},\n    )\n\n    @model_validator(mode=\"before\")\n    def validate_extension_or_fhir_comment_required(\n        cls, values: typing.Dict[str, typing.Any]\n    ) -> typing.Dict[str, typing.Any]:\n        \"\"\"Conditional Required Validation\"\"\"\n        extension = values.get(\"extension\", None)\n        fhir_comments = values.get(\"fhir_comments\", None)\n\n        if (\n            values.get(\"id\", None) is None\n            and extension is None\n            and fhir_comments is None\n        ):\n            raise PydanticCustomError(\n                \"model_validation_format\",\n                \"One of field value is required.\",\n                {},\n            )\n        return values\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from ``FHIRPrimitiveExtension`` according to specification,\n        with preserving original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/fhirresourcemodel.py",
    "content": "from typing import Optional, Union\n\nfrom fhir_core.fhirabstractmodel import FHIRAbstractModel\n\nfrom .fhirtypes import IdType, StringType\n\n\nclass FHIRResourceModel(FHIRAbstractModel):\n    \"\"\"Abstract base model class for all FHIR elements.\"\"\"\n\n    __resource_type__ = \"FHIRAbstractResource\"\n\n    id: Optional[Union[IdType, StringType]] = None\n\n    def relative_base(self) -> str:\n        \"\"\" \"\"\"\n        return self.__resource_type__\n\n    def relative_path(self) -> str:\n        if self.id is None:\n            return self.relative_base()\n        return \"{0}/{1}\".format(self.relative_base(), self.id)\n"
  },
  {
    "path": "fhir/resources/R4B/fhirtypes.py",
    "content": "from __future__ import annotations as _annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom fhir_core.types import (\n    Base64BinaryType,\n    BooleanType,\n    CanonicalType,\n    CodeType,\n    DateTimeType,\n    DateType,\n    DecimalType,\n    IdType,\n    InstantType,\n    Integer64Type,\n    IntegerType,\n    MarkdownType,\n    OidType,\n    PositiveIntType,\n    StringType,\n    TimeType,\n    UnsignedIntType,\n    UriType,\n    UrlType,\n    UuidType,\n    XhtmlType,\n    create_fhir_element_or_resource_type,\n    create_fhir_type,\n)\n\n__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n\n# The dependency hierarchy is circular due to Extension being referenced in FHIRPrimitiveExtension\n# which itself is referenced in every resource. Extension is also referenced in several resources and refers to several resources.\n# Pydantic fields can not use forward references as this causes the \"class not fully defined\" error at runtime: https://docs.pydantic.dev/2.12/errors/usage_errors/#class-not-fully-defined\n# To properly allow type checkers to type check, use type aliases during type checking and the create_fhir_type workaround at runtime.\nif TYPE_CHECKING:\n    from . import (\n        account,\n        activitydefinition,\n        address,\n        administrableproductdefinition,\n        adverseevent,\n        age,\n        allergyintolerance,\n        annotation,\n        appointment,\n        appointmentresponse,\n        attachment,\n        auditevent,\n        backboneelement,\n        basic,\n        binary,\n        biologicallyderivedproduct,\n        bodystructure,\n        bundle,\n        capabilitystatement,\n        careplan,\n        careteam,\n        catalogentry,\n        chargeitem,\n        chargeitemdefinition,\n        citation,\n        claim,\n        claimresponse,\n        clinicalimpression,\n        clinicalusedefinition,\n        codeableconcept,\n        codeablereference,\n        codesystem,\n        coding,\n        communication,\n        communicationrequest,\n        compartmentdefinition,\n        composition,\n        conceptmap,\n        condition,\n        consent,\n        contactdetail,\n        contactpoint,\n        contract,\n        contributor,\n        count,\n        coverage,\n        coverageeligibilityrequest,\n        coverageeligibilityresponse,\n        datarequirement,\n        detectedissue,\n        device,\n        devicedefinition,\n        devicemetric,\n        devicerequest,\n        deviceusestatement,\n        diagnosticreport,\n        distance,\n        documentmanifest,\n        documentreference,\n        domainresource,\n        dosage,\n        duration,\n        element,\n        elementdefinition,\n        encounter,\n        endpoint,\n        enrollmentrequest,\n        enrollmentresponse,\n        episodeofcare,\n        eventdefinition,\n        evidence,\n        evidencereport,\n        evidencevariable,\n        examplescenario,\n        explanationofbenefit,\n        expression,\n        extension,\n        familymemberhistory,\n        flag,\n        goal,\n        graphdefinition,\n        group,\n        guidanceresponse,\n        healthcareservice,\n        humanname,\n        identifier,\n        imagingstudy,\n        immunization,\n        immunizationevaluation,\n        immunizationrecommendation,\n        implementationguide,\n        ingredient,\n        insuranceplan,\n        invoice,\n        library,\n        linkage,\n        list,\n        location,\n        manufactureditemdefinition,\n        marketingstatus,\n        measure,\n        measurereport,\n        media,\n        medication,\n        medicationadministration,\n        medicationdispense,\n        medicationknowledge,\n        medicationrequest,\n        medicationstatement,\n        medicinalproductdefinition,\n        messagedefinition,\n        messageheader,\n        meta,\n        molecularsequence,\n        money,\n        namingsystem,\n        narrative,\n        nutritionorder,\n        nutritionproduct,\n        observation,\n        observationdefinition,\n        operationdefinition,\n        operationoutcome,\n        organization,\n        organizationaffiliation,\n        packagedproductdefinition,\n        parameterdefinition,\n        parameters,\n        patient,\n        paymentnotice,\n        paymentreconciliation,\n        period,\n        person,\n        plandefinition,\n        population,\n        practitioner,\n        practitionerrole,\n        procedure,\n        prodcharacteristic,\n        productshelflife,\n        provenance,\n        quantity,\n        questionnaire,\n        questionnaireresponse,\n        range,\n        ratio,\n        ratiorange,\n        reference,\n        regulatedauthorization,\n        relatedartifact,\n        relatedperson,\n        requestgroup,\n        researchdefinition,\n        researchelementdefinition,\n        researchstudy,\n        researchsubject,\n        resource,\n        riskassessment,\n        sampleddata,\n        schedule,\n        searchparameter,\n        servicerequest,\n        signature,\n        slot,\n        specimen,\n        specimendefinition,\n        structuredefinition,\n        structuremap,\n        subscription,\n        subscriptionstatus,\n        subscriptiontopic,\n        substance,\n        substancedefinition,\n        supplydelivery,\n        supplyrequest,\n        task,\n        terminologycapabilities,\n        testreport,\n        testscript,\n        timing,\n        triggerdefinition,\n        usagecontext,\n        valueset,\n        verificationresult,\n        visionprescription,\n    )\n    from .fhirprimitiveextension import FHIRPrimitiveExtension\n\n    FHIRPrimitiveExtensionType = FHIRPrimitiveExtension\n    AccountType = account.Account\n\n    AccountCoverageType = account.AccountCoverage\n\n    AccountGuarantorType = account.AccountGuarantor\n\n    ActivityDefinitionType = activitydefinition.ActivityDefinition\n\n    ActivityDefinitionDynamicValueType = (\n        activitydefinition.ActivityDefinitionDynamicValue\n    )\n\n    ActivityDefinitionParticipantType = activitydefinition.ActivityDefinitionParticipant\n\n    AddressType = address.Address\n\n    AdministrableProductDefinitionType = (\n        administrableproductdefinition.AdministrableProductDefinition\n    )\n\n    AdministrableProductDefinitionPropertyType = (\n        administrableproductdefinition.AdministrableProductDefinitionProperty\n    )\n\n    AdministrableProductDefinitionRouteOfAdministrationType = (\n        administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministration\n    )\n\n    AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType = (\n        administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpecies\n    )\n\n    AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType = (\n        administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod\n    )\n\n    AdverseEventType = adverseevent.AdverseEvent\n\n    AdverseEventSuspectEntityType = adverseevent.AdverseEventSuspectEntity\n\n    AdverseEventSuspectEntityCausalityType = (\n        adverseevent.AdverseEventSuspectEntityCausality\n    )\n\n    AgeType = age.Age\n\n    AllergyIntoleranceType = allergyintolerance.AllergyIntolerance\n\n    AllergyIntoleranceReactionType = allergyintolerance.AllergyIntoleranceReaction\n\n    AnnotationType = annotation.Annotation\n\n    AppointmentType = appointment.Appointment\n\n    AppointmentParticipantType = appointment.AppointmentParticipant\n\n    AppointmentResponseType = appointmentresponse.AppointmentResponse\n\n    AttachmentType = attachment.Attachment\n\n    AuditEventType = auditevent.AuditEvent\n\n    AuditEventAgentType = auditevent.AuditEventAgent\n\n    AuditEventAgentNetworkType = auditevent.AuditEventAgentNetwork\n\n    AuditEventEntityType = auditevent.AuditEventEntity\n\n    AuditEventEntityDetailType = auditevent.AuditEventEntityDetail\n\n    AuditEventSourceType = auditevent.AuditEventSource\n\n    BackboneElementType = backboneelement.BackboneElement\n\n    BasicType = basic.Basic\n\n    BinaryType = binary.Binary\n\n    BiologicallyDerivedProductType = (\n        biologicallyderivedproduct.BiologicallyDerivedProduct\n    )\n\n    BiologicallyDerivedProductCollectionType = (\n        biologicallyderivedproduct.BiologicallyDerivedProductCollection\n    )\n\n    BiologicallyDerivedProductManipulationType = (\n        biologicallyderivedproduct.BiologicallyDerivedProductManipulation\n    )\n\n    BiologicallyDerivedProductProcessingType = (\n        biologicallyderivedproduct.BiologicallyDerivedProductProcessing\n    )\n\n    BiologicallyDerivedProductStorageType = (\n        biologicallyderivedproduct.BiologicallyDerivedProductStorage\n    )\n\n    BodyStructureType = bodystructure.BodyStructure\n\n    BundleType = bundle.Bundle\n\n    BundleEntryType = bundle.BundleEntry\n\n    BundleEntryRequestType = bundle.BundleEntryRequest\n\n    BundleEntryResponseType = bundle.BundleEntryResponse\n\n    BundleEntrySearchType = bundle.BundleEntrySearch\n\n    BundleLinkType = bundle.BundleLink\n\n    CapabilityStatementType = capabilitystatement.CapabilityStatement\n\n    CapabilityStatementDocumentType = capabilitystatement.CapabilityStatementDocument\n\n    CapabilityStatementImplementationType = (\n        capabilitystatement.CapabilityStatementImplementation\n    )\n\n    CapabilityStatementMessagingType = capabilitystatement.CapabilityStatementMessaging\n\n    CapabilityStatementMessagingEndpointType = (\n        capabilitystatement.CapabilityStatementMessagingEndpoint\n    )\n\n    CapabilityStatementMessagingSupportedMessageType = (\n        capabilitystatement.CapabilityStatementMessagingSupportedMessage\n    )\n\n    CapabilityStatementRestType = capabilitystatement.CapabilityStatementRest\n\n    CapabilityStatementRestInteractionType = (\n        capabilitystatement.CapabilityStatementRestInteraction\n    )\n\n    CapabilityStatementRestResourceType = (\n        capabilitystatement.CapabilityStatementRestResource\n    )\n\n    CapabilityStatementRestResourceInteractionType = (\n        capabilitystatement.CapabilityStatementRestResourceInteraction\n    )\n\n    CapabilityStatementRestResourceOperationType = (\n        capabilitystatement.CapabilityStatementRestResourceOperation\n    )\n\n    CapabilityStatementRestResourceSearchParamType = (\n        capabilitystatement.CapabilityStatementRestResourceSearchParam\n    )\n\n    CapabilityStatementRestSecurityType = (\n        capabilitystatement.CapabilityStatementRestSecurity\n    )\n\n    CapabilityStatementSoftwareType = capabilitystatement.CapabilityStatementSoftware\n\n    CarePlanType = careplan.CarePlan\n\n    CarePlanActivityType = careplan.CarePlanActivity\n\n    CarePlanActivityDetailType = careplan.CarePlanActivityDetail\n\n    CareTeamType = careteam.CareTeam\n\n    CareTeamParticipantType = careteam.CareTeamParticipant\n\n    CatalogEntryType = catalogentry.CatalogEntry\n\n    CatalogEntryRelatedEntryType = catalogentry.CatalogEntryRelatedEntry\n\n    ChargeItemType = chargeitem.ChargeItem\n\n    ChargeItemDefinitionType = chargeitemdefinition.ChargeItemDefinition\n\n    ChargeItemDefinitionApplicabilityType = (\n        chargeitemdefinition.ChargeItemDefinitionApplicability\n    )\n\n    ChargeItemDefinitionPropertyGroupType = (\n        chargeitemdefinition.ChargeItemDefinitionPropertyGroup\n    )\n\n    ChargeItemDefinitionPropertyGroupPriceComponentType = (\n        chargeitemdefinition.ChargeItemDefinitionPropertyGroupPriceComponent\n    )\n\n    ChargeItemPerformerType = chargeitem.ChargeItemPerformer\n\n    CitationType = citation.Citation\n\n    CitationCitedArtifactType = citation.CitationCitedArtifact\n\n    CitationCitedArtifactAbstractType = citation.CitationCitedArtifactAbstract\n\n    CitationCitedArtifactClassificationType = (\n        citation.CitationCitedArtifactClassification\n    )\n\n    CitationCitedArtifactClassificationWhoClassifiedType = (\n        citation.CitationCitedArtifactClassificationWhoClassified\n    )\n\n    CitationCitedArtifactContributorshipType = (\n        citation.CitationCitedArtifactContributorship\n    )\n\n    CitationCitedArtifactContributorshipEntryType = (\n        citation.CitationCitedArtifactContributorshipEntry\n    )\n\n    CitationCitedArtifactContributorshipEntryAffiliationInfoType = (\n        citation.CitationCitedArtifactContributorshipEntryAffiliationInfo\n    )\n\n    CitationCitedArtifactContributorshipEntryContributionInstanceType = (\n        citation.CitationCitedArtifactContributorshipEntryContributionInstance\n    )\n\n    CitationCitedArtifactContributorshipSummaryType = (\n        citation.CitationCitedArtifactContributorshipSummary\n    )\n\n    CitationCitedArtifactPartType = citation.CitationCitedArtifactPart\n\n    CitationCitedArtifactPublicationFormType = (\n        citation.CitationCitedArtifactPublicationForm\n    )\n\n    CitationCitedArtifactPublicationFormPeriodicReleaseType = (\n        citation.CitationCitedArtifactPublicationFormPeriodicRelease\n    )\n\n    CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationType = (\n        citation.CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublication\n    )\n\n    CitationCitedArtifactPublicationFormPublishedInType = (\n        citation.CitationCitedArtifactPublicationFormPublishedIn\n    )\n\n    CitationCitedArtifactRelatesToType = citation.CitationCitedArtifactRelatesTo\n\n    CitationCitedArtifactStatusDateType = citation.CitationCitedArtifactStatusDate\n\n    CitationCitedArtifactTitleType = citation.CitationCitedArtifactTitle\n\n    CitationCitedArtifactVersionType = citation.CitationCitedArtifactVersion\n\n    CitationCitedArtifactWebLocationType = citation.CitationCitedArtifactWebLocation\n\n    CitationClassificationType = citation.CitationClassification\n\n    CitationRelatesToType = citation.CitationRelatesTo\n\n    CitationStatusDateType = citation.CitationStatusDate\n\n    CitationSummaryType = citation.CitationSummary\n\n    ClaimType = claim.Claim\n\n    ClaimAccidentType = claim.ClaimAccident\n\n    ClaimCareTeamType = claim.ClaimCareTeam\n\n    ClaimDiagnosisType = claim.ClaimDiagnosis\n\n    ClaimInsuranceType = claim.ClaimInsurance\n\n    ClaimItemType = claim.ClaimItem\n\n    ClaimItemDetailType = claim.ClaimItemDetail\n\n    ClaimItemDetailSubDetailType = claim.ClaimItemDetailSubDetail\n\n    ClaimPayeeType = claim.ClaimPayee\n\n    ClaimProcedureType = claim.ClaimProcedure\n\n    ClaimRelatedType = claim.ClaimRelated\n\n    ClaimResponseType = claimresponse.ClaimResponse\n\n    ClaimResponseAddItemType = claimresponse.ClaimResponseAddItem\n\n    ClaimResponseAddItemDetailType = claimresponse.ClaimResponseAddItemDetail\n\n    ClaimResponseAddItemDetailSubDetailType = (\n        claimresponse.ClaimResponseAddItemDetailSubDetail\n    )\n\n    ClaimResponseErrorType = claimresponse.ClaimResponseError\n\n    ClaimResponseInsuranceType = claimresponse.ClaimResponseInsurance\n\n    ClaimResponseItemType = claimresponse.ClaimResponseItem\n\n    ClaimResponseItemAdjudicationType = claimresponse.ClaimResponseItemAdjudication\n\n    ClaimResponseItemDetailType = claimresponse.ClaimResponseItemDetail\n\n    ClaimResponseItemDetailSubDetailType = (\n        claimresponse.ClaimResponseItemDetailSubDetail\n    )\n\n    ClaimResponsePaymentType = claimresponse.ClaimResponsePayment\n\n    ClaimResponseProcessNoteType = claimresponse.ClaimResponseProcessNote\n\n    ClaimResponseTotalType = claimresponse.ClaimResponseTotal\n\n    ClaimSupportingInfoType = claim.ClaimSupportingInfo\n\n    ClinicalImpressionType = clinicalimpression.ClinicalImpression\n\n    ClinicalImpressionFindingType = clinicalimpression.ClinicalImpressionFinding\n\n    ClinicalImpressionInvestigationType = (\n        clinicalimpression.ClinicalImpressionInvestigation\n    )\n\n    ClinicalUseDefinitionType = clinicalusedefinition.ClinicalUseDefinition\n\n    ClinicalUseDefinitionContraindicationType = (\n        clinicalusedefinition.ClinicalUseDefinitionContraindication\n    )\n\n    ClinicalUseDefinitionContraindicationOtherTherapyType = (\n        clinicalusedefinition.ClinicalUseDefinitionContraindicationOtherTherapy\n    )\n\n    ClinicalUseDefinitionIndicationType = (\n        clinicalusedefinition.ClinicalUseDefinitionIndication\n    )\n\n    ClinicalUseDefinitionInteractionType = (\n        clinicalusedefinition.ClinicalUseDefinitionInteraction\n    )\n\n    ClinicalUseDefinitionInteractionInteractantType = (\n        clinicalusedefinition.ClinicalUseDefinitionInteractionInteractant\n    )\n\n    ClinicalUseDefinitionUndesirableEffectType = (\n        clinicalusedefinition.ClinicalUseDefinitionUndesirableEffect\n    )\n\n    ClinicalUseDefinitionWarningType = (\n        clinicalusedefinition.ClinicalUseDefinitionWarning\n    )\n\n    CodeSystemType = codesystem.CodeSystem\n\n    CodeSystemConceptType = codesystem.CodeSystemConcept\n\n    CodeSystemConceptDesignationType = codesystem.CodeSystemConceptDesignation\n\n    CodeSystemConceptPropertyType = codesystem.CodeSystemConceptProperty\n\n    CodeSystemFilterType = codesystem.CodeSystemFilter\n\n    CodeSystemPropertyType = codesystem.CodeSystemProperty\n\n    CodeableConceptType = codeableconcept.CodeableConcept\n\n    CodeableReferenceType = codeablereference.CodeableReference\n\n    CodingType = coding.Coding\n\n    CommunicationType = communication.Communication\n\n    CommunicationPayloadType = communication.CommunicationPayload\n\n    CommunicationRequestType = communicationrequest.CommunicationRequest\n\n    CommunicationRequestPayloadType = communicationrequest.CommunicationRequestPayload\n\n    CompartmentDefinitionType = compartmentdefinition.CompartmentDefinition\n\n    CompartmentDefinitionResourceType = (\n        compartmentdefinition.CompartmentDefinitionResource\n    )\n\n    CompositionType = composition.Composition\n\n    CompositionAttesterType = composition.CompositionAttester\n\n    CompositionEventType = composition.CompositionEvent\n\n    CompositionRelatesToType = composition.CompositionRelatesTo\n\n    CompositionSectionType = composition.CompositionSection\n\n    ConceptMapType = conceptmap.ConceptMap\n\n    ConceptMapGroupType = conceptmap.ConceptMapGroup\n\n    ConceptMapGroupElementType = conceptmap.ConceptMapGroupElement\n\n    ConceptMapGroupElementTargetType = conceptmap.ConceptMapGroupElementTarget\n\n    ConceptMapGroupElementTargetDependsOnType = (\n        conceptmap.ConceptMapGroupElementTargetDependsOn\n    )\n\n    ConceptMapGroupUnmappedType = conceptmap.ConceptMapGroupUnmapped\n\n    ConditionType = condition.Condition\n\n    ConditionEvidenceType = condition.ConditionEvidence\n\n    ConditionStageType = condition.ConditionStage\n\n    ConsentType = consent.Consent\n\n    ConsentPolicyType = consent.ConsentPolicy\n\n    ConsentProvisionType = consent.ConsentProvision\n\n    ConsentProvisionActorType = consent.ConsentProvisionActor\n\n    ConsentProvisionDataType = consent.ConsentProvisionData\n\n    ConsentVerificationType = consent.ConsentVerification\n\n    ContactDetailType = contactdetail.ContactDetail\n\n    ContactPointType = contactpoint.ContactPoint\n\n    ContractType = contract.Contract\n\n    ContractContentDefinitionType = contract.ContractContentDefinition\n\n    ContractFriendlyType = contract.ContractFriendly\n\n    ContractLegalType = contract.ContractLegal\n\n    ContractRuleType = contract.ContractRule\n\n    ContractSignerType = contract.ContractSigner\n\n    ContractTermType = contract.ContractTerm\n\n    ContractTermActionType = contract.ContractTermAction\n\n    ContractTermActionSubjectType = contract.ContractTermActionSubject\n\n    ContractTermAssetType = contract.ContractTermAsset\n\n    ContractTermAssetContextType = contract.ContractTermAssetContext\n\n    ContractTermAssetValuedItemType = contract.ContractTermAssetValuedItem\n\n    ContractTermOfferType = contract.ContractTermOffer\n\n    ContractTermOfferAnswerType = contract.ContractTermOfferAnswer\n\n    ContractTermOfferPartyType = contract.ContractTermOfferParty\n\n    ContractTermSecurityLabelType = contract.ContractTermSecurityLabel\n\n    ContributorType = contributor.Contributor\n\n    CountType = count.Count\n\n    CoverageType = coverage.Coverage\n\n    CoverageClassType = coverage.CoverageClass\n\n    CoverageCostToBeneficiaryType = coverage.CoverageCostToBeneficiary\n\n    CoverageCostToBeneficiaryExceptionType = coverage.CoverageCostToBeneficiaryException\n\n    CoverageEligibilityRequestType = (\n        coverageeligibilityrequest.CoverageEligibilityRequest\n    )\n\n    CoverageEligibilityRequestInsuranceType = (\n        coverageeligibilityrequest.CoverageEligibilityRequestInsurance\n    )\n\n    CoverageEligibilityRequestItemType = (\n        coverageeligibilityrequest.CoverageEligibilityRequestItem\n    )\n\n    CoverageEligibilityRequestItemDiagnosisType = (\n        coverageeligibilityrequest.CoverageEligibilityRequestItemDiagnosis\n    )\n\n    CoverageEligibilityRequestSupportingInfoType = (\n        coverageeligibilityrequest.CoverageEligibilityRequestSupportingInfo\n    )\n\n    CoverageEligibilityResponseType = (\n        coverageeligibilityresponse.CoverageEligibilityResponse\n    )\n\n    CoverageEligibilityResponseErrorType = (\n        coverageeligibilityresponse.CoverageEligibilityResponseError\n    )\n\n    CoverageEligibilityResponseInsuranceType = (\n        coverageeligibilityresponse.CoverageEligibilityResponseInsurance\n    )\n\n    CoverageEligibilityResponseInsuranceItemType = (\n        coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItem\n    )\n\n    CoverageEligibilityResponseInsuranceItemBenefitType = (\n        coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItemBenefit\n    )\n\n    DataRequirementType = datarequirement.DataRequirement\n\n    DataRequirementCodeFilterType = datarequirement.DataRequirementCodeFilter\n\n    DataRequirementDateFilterType = datarequirement.DataRequirementDateFilter\n\n    DataRequirementSortType = datarequirement.DataRequirementSort\n\n    DetectedIssueType = detectedissue.DetectedIssue\n\n    DetectedIssueEvidenceType = detectedissue.DetectedIssueEvidence\n\n    DetectedIssueMitigationType = detectedissue.DetectedIssueMitigation\n\n    DeviceType = device.Device\n\n    DeviceDefinitionType = devicedefinition.DeviceDefinition\n\n    DeviceDefinitionCapabilityType = devicedefinition.DeviceDefinitionCapability\n\n    DeviceDefinitionDeviceNameType = devicedefinition.DeviceDefinitionDeviceName\n\n    DeviceDefinitionMaterialType = devicedefinition.DeviceDefinitionMaterial\n\n    DeviceDefinitionPropertyType = devicedefinition.DeviceDefinitionProperty\n\n    DeviceDefinitionSpecializationType = devicedefinition.DeviceDefinitionSpecialization\n\n    DeviceDefinitionUdiDeviceIdentifierType = (\n        devicedefinition.DeviceDefinitionUdiDeviceIdentifier\n    )\n\n    DeviceDeviceNameType = device.DeviceDeviceName\n\n    DeviceMetricType = devicemetric.DeviceMetric\n\n    DeviceMetricCalibrationType = devicemetric.DeviceMetricCalibration\n\n    DevicePropertyType = device.DeviceProperty\n\n    DeviceRequestType = devicerequest.DeviceRequest\n\n    DeviceRequestParameterType = devicerequest.DeviceRequestParameter\n\n    DeviceSpecializationType = device.DeviceSpecialization\n\n    DeviceUdiCarrierType = device.DeviceUdiCarrier\n\n    DeviceUseStatementType = deviceusestatement.DeviceUseStatement\n\n    DeviceVersionType = device.DeviceVersion\n\n    DiagnosticReportType = diagnosticreport.DiagnosticReport\n\n    DiagnosticReportMediaType = diagnosticreport.DiagnosticReportMedia\n\n    DistanceType = distance.Distance\n\n    DocumentManifestType = documentmanifest.DocumentManifest\n\n    DocumentManifestRelatedType = documentmanifest.DocumentManifestRelated\n\n    DocumentReferenceType = documentreference.DocumentReference\n\n    DocumentReferenceContentType = documentreference.DocumentReferenceContent\n\n    DocumentReferenceContextType = documentreference.DocumentReferenceContext\n\n    DocumentReferenceRelatesToType = documentreference.DocumentReferenceRelatesTo\n\n    DomainResourceType = domainresource.DomainResource\n\n    DosageType = dosage.Dosage\n\n    DosageDoseAndRateType = dosage.DosageDoseAndRate\n\n    DurationType = duration.Duration\n\n    ElementType = element.Element\n\n    ElementDefinitionType = elementdefinition.ElementDefinition\n\n    ElementDefinitionBaseType = elementdefinition.ElementDefinitionBase\n\n    ElementDefinitionBindingType = elementdefinition.ElementDefinitionBinding\n\n    ElementDefinitionConstraintType = elementdefinition.ElementDefinitionConstraint\n\n    ElementDefinitionExampleType = elementdefinition.ElementDefinitionExample\n\n    ElementDefinitionMappingType = elementdefinition.ElementDefinitionMapping\n\n    ElementDefinitionSlicingType = elementdefinition.ElementDefinitionSlicing\n\n    ElementDefinitionSlicingDiscriminatorType = (\n        elementdefinition.ElementDefinitionSlicingDiscriminator\n    )\n\n    ElementDefinitionTypeType = elementdefinition.ElementDefinitionType\n\n    EncounterType = encounter.Encounter\n\n    EncounterClassHistoryType = encounter.EncounterClassHistory\n\n    EncounterDiagnosisType = encounter.EncounterDiagnosis\n\n    EncounterHospitalizationType = encounter.EncounterHospitalization\n\n    EncounterLocationType = encounter.EncounterLocation\n\n    EncounterParticipantType = encounter.EncounterParticipant\n\n    EncounterStatusHistoryType = encounter.EncounterStatusHistory\n\n    EndpointType = endpoint.Endpoint\n\n    EnrollmentRequestType = enrollmentrequest.EnrollmentRequest\n\n    EnrollmentResponseType = enrollmentresponse.EnrollmentResponse\n\n    EpisodeOfCareType = episodeofcare.EpisodeOfCare\n\n    EpisodeOfCareDiagnosisType = episodeofcare.EpisodeOfCareDiagnosis\n\n    EpisodeOfCareStatusHistoryType = episodeofcare.EpisodeOfCareStatusHistory\n\n    EventDefinitionType = eventdefinition.EventDefinition\n\n    EvidenceType = evidence.Evidence\n\n    EvidenceCertaintyType = evidence.EvidenceCertainty\n\n    EvidenceReportType = evidencereport.EvidenceReport\n\n    EvidenceReportRelatesToType = evidencereport.EvidenceReportRelatesTo\n\n    EvidenceReportSectionType = evidencereport.EvidenceReportSection\n\n    EvidenceReportSubjectType = evidencereport.EvidenceReportSubject\n\n    EvidenceReportSubjectCharacteristicType = (\n        evidencereport.EvidenceReportSubjectCharacteristic\n    )\n\n    EvidenceStatisticType = evidence.EvidenceStatistic\n\n    EvidenceStatisticAttributeEstimateType = evidence.EvidenceStatisticAttributeEstimate\n\n    EvidenceStatisticModelCharacteristicType = (\n        evidence.EvidenceStatisticModelCharacteristic\n    )\n\n    EvidenceStatisticModelCharacteristicVariableType = (\n        evidence.EvidenceStatisticModelCharacteristicVariable\n    )\n\n    EvidenceStatisticSampleSizeType = evidence.EvidenceStatisticSampleSize\n\n    EvidenceVariableType = evidencevariable.EvidenceVariable\n\n    EvidenceVariableCategoryType = evidencevariable.EvidenceVariableCategory\n\n    EvidenceVariableCharacteristicType = evidencevariable.EvidenceVariableCharacteristic\n\n    EvidenceVariableCharacteristicTimeFromStartType = (\n        evidencevariable.EvidenceVariableCharacteristicTimeFromStart\n    )\n\n    EvidenceVariableDefinitionType = evidence.EvidenceVariableDefinition\n\n    ExampleScenarioType = examplescenario.ExampleScenario\n\n    ExampleScenarioActorType = examplescenario.ExampleScenarioActor\n\n    ExampleScenarioInstanceType = examplescenario.ExampleScenarioInstance\n\n    ExampleScenarioInstanceContainedInstanceType = (\n        examplescenario.ExampleScenarioInstanceContainedInstance\n    )\n\n    ExampleScenarioInstanceVersionType = examplescenario.ExampleScenarioInstanceVersion\n\n    ExampleScenarioProcessType = examplescenario.ExampleScenarioProcess\n\n    ExampleScenarioProcessStepType = examplescenario.ExampleScenarioProcessStep\n\n    ExampleScenarioProcessStepAlternativeType = (\n        examplescenario.ExampleScenarioProcessStepAlternative\n    )\n\n    ExampleScenarioProcessStepOperationType = (\n        examplescenario.ExampleScenarioProcessStepOperation\n    )\n\n    ExplanationOfBenefitType = explanationofbenefit.ExplanationOfBenefit\n\n    ExplanationOfBenefitAccidentType = explanationofbenefit.ExplanationOfBenefitAccident\n\n    ExplanationOfBenefitAddItemType = explanationofbenefit.ExplanationOfBenefitAddItem\n\n    ExplanationOfBenefitAddItemDetailType = (\n        explanationofbenefit.ExplanationOfBenefitAddItemDetail\n    )\n\n    ExplanationOfBenefitAddItemDetailSubDetailType = (\n        explanationofbenefit.ExplanationOfBenefitAddItemDetailSubDetail\n    )\n\n    ExplanationOfBenefitBenefitBalanceType = (\n        explanationofbenefit.ExplanationOfBenefitBenefitBalance\n    )\n\n    ExplanationOfBenefitBenefitBalanceFinancialType = (\n        explanationofbenefit.ExplanationOfBenefitBenefitBalanceFinancial\n    )\n\n    ExplanationOfBenefitCareTeamType = explanationofbenefit.ExplanationOfBenefitCareTeam\n\n    ExplanationOfBenefitDiagnosisType = (\n        explanationofbenefit.ExplanationOfBenefitDiagnosis\n    )\n\n    ExplanationOfBenefitInsuranceType = (\n        explanationofbenefit.ExplanationOfBenefitInsurance\n    )\n\n    ExplanationOfBenefitItemType = explanationofbenefit.ExplanationOfBenefitItem\n\n    ExplanationOfBenefitItemAdjudicationType = (\n        explanationofbenefit.ExplanationOfBenefitItemAdjudication\n    )\n\n    ExplanationOfBenefitItemDetailType = (\n        explanationofbenefit.ExplanationOfBenefitItemDetail\n    )\n\n    ExplanationOfBenefitItemDetailSubDetailType = (\n        explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail\n    )\n\n    ExplanationOfBenefitPayeeType = explanationofbenefit.ExplanationOfBenefitPayee\n\n    ExplanationOfBenefitPaymentType = explanationofbenefit.ExplanationOfBenefitPayment\n\n    ExplanationOfBenefitProcedureType = (\n        explanationofbenefit.ExplanationOfBenefitProcedure\n    )\n\n    ExplanationOfBenefitProcessNoteType = (\n        explanationofbenefit.ExplanationOfBenefitProcessNote\n    )\n\n    ExplanationOfBenefitRelatedType = explanationofbenefit.ExplanationOfBenefitRelated\n\n    ExplanationOfBenefitSupportingInfoType = (\n        explanationofbenefit.ExplanationOfBenefitSupportingInfo\n    )\n\n    ExplanationOfBenefitTotalType = explanationofbenefit.ExplanationOfBenefitTotal\n\n    ExpressionType = expression.Expression\n\n    ExtensionType = extension.Extension\n\n    FamilyMemberHistoryType = familymemberhistory.FamilyMemberHistory\n\n    FamilyMemberHistoryConditionType = familymemberhistory.FamilyMemberHistoryCondition\n\n    FlagType = flag.Flag\n\n    GoalType = goal.Goal\n\n    GoalTargetType = goal.GoalTarget\n\n    GraphDefinitionType = graphdefinition.GraphDefinition\n\n    GraphDefinitionLinkType = graphdefinition.GraphDefinitionLink\n\n    GraphDefinitionLinkTargetType = graphdefinition.GraphDefinitionLinkTarget\n\n    GraphDefinitionLinkTargetCompartmentType = (\n        graphdefinition.GraphDefinitionLinkTargetCompartment\n    )\n\n    GroupType = group.Group\n\n    GroupCharacteristicType = group.GroupCharacteristic\n\n    GroupMemberType = group.GroupMember\n\n    GuidanceResponseType = guidanceresponse.GuidanceResponse\n\n    HealthcareServiceType = healthcareservice.HealthcareService\n\n    HealthcareServiceAvailableTimeType = (\n        healthcareservice.HealthcareServiceAvailableTime\n    )\n\n    HealthcareServiceEligibilityType = healthcareservice.HealthcareServiceEligibility\n\n    HealthcareServiceNotAvailableType = healthcareservice.HealthcareServiceNotAvailable\n\n    HumanNameType = humanname.HumanName\n\n    IdentifierType = identifier.Identifier\n\n    ImagingStudyType = imagingstudy.ImagingStudy\n\n    ImagingStudySeriesType = imagingstudy.ImagingStudySeries\n\n    ImagingStudySeriesInstanceType = imagingstudy.ImagingStudySeriesInstance\n\n    ImagingStudySeriesPerformerType = imagingstudy.ImagingStudySeriesPerformer\n\n    ImmunizationType = immunization.Immunization\n\n    ImmunizationEducationType = immunization.ImmunizationEducation\n\n    ImmunizationEvaluationType = immunizationevaluation.ImmunizationEvaluation\n\n    ImmunizationPerformerType = immunization.ImmunizationPerformer\n\n    ImmunizationProtocolAppliedType = immunization.ImmunizationProtocolApplied\n\n    ImmunizationReactionType = immunization.ImmunizationReaction\n\n    ImmunizationRecommendationType = (\n        immunizationrecommendation.ImmunizationRecommendation\n    )\n\n    ImmunizationRecommendationRecommendationType = (\n        immunizationrecommendation.ImmunizationRecommendationRecommendation\n    )\n\n    ImmunizationRecommendationRecommendationDateCriterionType = (\n        immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion\n    )\n\n    ImplementationGuideType = implementationguide.ImplementationGuide\n\n    ImplementationGuideDefinitionType = (\n        implementationguide.ImplementationGuideDefinition\n    )\n\n    ImplementationGuideDefinitionGroupingType = (\n        implementationguide.ImplementationGuideDefinitionGrouping\n    )\n\n    ImplementationGuideDefinitionPageType = (\n        implementationguide.ImplementationGuideDefinitionPage\n    )\n\n    ImplementationGuideDefinitionParameterType = (\n        implementationguide.ImplementationGuideDefinitionParameter\n    )\n\n    ImplementationGuideDefinitionResourceType = (\n        implementationguide.ImplementationGuideDefinitionResource\n    )\n\n    ImplementationGuideDefinitionTemplateType = (\n        implementationguide.ImplementationGuideDefinitionTemplate\n    )\n\n    ImplementationGuideDependsOnType = implementationguide.ImplementationGuideDependsOn\n\n    ImplementationGuideGlobalType = implementationguide.ImplementationGuideGlobal\n\n    ImplementationGuideManifestType = implementationguide.ImplementationGuideManifest\n\n    ImplementationGuideManifestPageType = (\n        implementationguide.ImplementationGuideManifestPage\n    )\n\n    ImplementationGuideManifestResourceType = (\n        implementationguide.ImplementationGuideManifestResource\n    )\n\n    IngredientType = ingredient.Ingredient\n\n    IngredientManufacturerType = ingredient.IngredientManufacturer\n\n    IngredientSubstanceType = ingredient.IngredientSubstance\n\n    IngredientSubstanceStrengthType = ingredient.IngredientSubstanceStrength\n\n    IngredientSubstanceStrengthReferenceStrengthType = (\n        ingredient.IngredientSubstanceStrengthReferenceStrength\n    )\n\n    InsurancePlanType = insuranceplan.InsurancePlan\n\n    InsurancePlanContactType = insuranceplan.InsurancePlanContact\n\n    InsurancePlanCoverageType = insuranceplan.InsurancePlanCoverage\n\n    InsurancePlanCoverageBenefitType = insuranceplan.InsurancePlanCoverageBenefit\n\n    InsurancePlanCoverageBenefitLimitType = (\n        insuranceplan.InsurancePlanCoverageBenefitLimit\n    )\n\n    InsurancePlanPlanType = insuranceplan.InsurancePlanPlan\n\n    InsurancePlanPlanGeneralCostType = insuranceplan.InsurancePlanPlanGeneralCost\n\n    InsurancePlanPlanSpecificCostType = insuranceplan.InsurancePlanPlanSpecificCost\n\n    InsurancePlanPlanSpecificCostBenefitType = (\n        insuranceplan.InsurancePlanPlanSpecificCostBenefit\n    )\n\n    InsurancePlanPlanSpecificCostBenefitCostType = (\n        insuranceplan.InsurancePlanPlanSpecificCostBenefitCost\n    )\n\n    InvoiceType = invoice.Invoice\n\n    InvoiceLineItemType = invoice.InvoiceLineItem\n\n    InvoiceLineItemPriceComponentType = invoice.InvoiceLineItemPriceComponent\n\n    InvoiceParticipantType = invoice.InvoiceParticipant\n\n    LibraryType = library.Library\n\n    LinkageType = linkage.Linkage\n\n    LinkageItemType = linkage.LinkageItem\n\n    ListType = list.List\n\n    ListEntryType = list.ListEntry\n\n    LocationType = location.Location\n\n    LocationHoursOfOperationType = location.LocationHoursOfOperation\n\n    LocationPositionType = location.LocationPosition\n\n    ManufacturedItemDefinitionType = (\n        manufactureditemdefinition.ManufacturedItemDefinition\n    )\n\n    ManufacturedItemDefinitionPropertyType = (\n        manufactureditemdefinition.ManufacturedItemDefinitionProperty\n    )\n\n    MarketingStatusType = marketingstatus.MarketingStatus\n\n    MeasureType = measure.Measure\n\n    MeasureGroupType = measure.MeasureGroup\n\n    MeasureGroupPopulationType = measure.MeasureGroupPopulation\n\n    MeasureGroupStratifierType = measure.MeasureGroupStratifier\n\n    MeasureGroupStratifierComponentType = measure.MeasureGroupStratifierComponent\n\n    MeasureReportType = measurereport.MeasureReport\n\n    MeasureReportGroupType = measurereport.MeasureReportGroup\n\n    MeasureReportGroupPopulationType = measurereport.MeasureReportGroupPopulation\n\n    MeasureReportGroupStratifierType = measurereport.MeasureReportGroupStratifier\n\n    MeasureReportGroupStratifierStratumType = (\n        measurereport.MeasureReportGroupStratifierStratum\n    )\n\n    MeasureReportGroupStratifierStratumComponentType = (\n        measurereport.MeasureReportGroupStratifierStratumComponent\n    )\n\n    MeasureReportGroupStratifierStratumPopulationType = (\n        measurereport.MeasureReportGroupStratifierStratumPopulation\n    )\n\n    MeasureSupplementalDataType = measure.MeasureSupplementalData\n\n    MediaType = media.Media\n\n    MedicationType = medication.Medication\n\n    MedicationAdministrationType = medicationadministration.MedicationAdministration\n\n    MedicationAdministrationDosageType = (\n        medicationadministration.MedicationAdministrationDosage\n    )\n\n    MedicationAdministrationPerformerType = (\n        medicationadministration.MedicationAdministrationPerformer\n    )\n\n    MedicationBatchType = medication.MedicationBatch\n\n    MedicationDispenseType = medicationdispense.MedicationDispense\n\n    MedicationDispensePerformerType = medicationdispense.MedicationDispensePerformer\n\n    MedicationDispenseSubstitutionType = (\n        medicationdispense.MedicationDispenseSubstitution\n    )\n\n    MedicationIngredientType = medication.MedicationIngredient\n\n    MedicationKnowledgeType = medicationknowledge.MedicationKnowledge\n\n    MedicationKnowledgeAdministrationGuidelinesType = (\n        medicationknowledge.MedicationKnowledgeAdministrationGuidelines\n    )\n\n    MedicationKnowledgeAdministrationGuidelinesDosageType = (\n        medicationknowledge.MedicationKnowledgeAdministrationGuidelinesDosage\n    )\n\n    MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsType = (\n        medicationknowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics\n    )\n\n    MedicationKnowledgeCostType = medicationknowledge.MedicationKnowledgeCost\n\n    MedicationKnowledgeDrugCharacteristicType = (\n        medicationknowledge.MedicationKnowledgeDrugCharacteristic\n    )\n\n    MedicationKnowledgeIngredientType = (\n        medicationknowledge.MedicationKnowledgeIngredient\n    )\n\n    MedicationKnowledgeKineticsType = medicationknowledge.MedicationKnowledgeKinetics\n\n    MedicationKnowledgeMedicineClassificationType = (\n        medicationknowledge.MedicationKnowledgeMedicineClassification\n    )\n\n    MedicationKnowledgeMonitoringProgramType = (\n        medicationknowledge.MedicationKnowledgeMonitoringProgram\n    )\n\n    MedicationKnowledgeMonographType = medicationknowledge.MedicationKnowledgeMonograph\n\n    MedicationKnowledgePackagingType = medicationknowledge.MedicationKnowledgePackaging\n\n    MedicationKnowledgeRegulatoryType = (\n        medicationknowledge.MedicationKnowledgeRegulatory\n    )\n\n    MedicationKnowledgeRegulatoryMaxDispenseType = (\n        medicationknowledge.MedicationKnowledgeRegulatoryMaxDispense\n    )\n\n    MedicationKnowledgeRegulatoryScheduleType = (\n        medicationknowledge.MedicationKnowledgeRegulatorySchedule\n    )\n\n    MedicationKnowledgeRegulatorySubstitutionType = (\n        medicationknowledge.MedicationKnowledgeRegulatorySubstitution\n    )\n\n    MedicationKnowledgeRelatedMedicationKnowledgeType = (\n        medicationknowledge.MedicationKnowledgeRelatedMedicationKnowledge\n    )\n\n    MedicationRequestType = medicationrequest.MedicationRequest\n\n    MedicationRequestDispenseRequestType = (\n        medicationrequest.MedicationRequestDispenseRequest\n    )\n\n    MedicationRequestDispenseRequestInitialFillType = (\n        medicationrequest.MedicationRequestDispenseRequestInitialFill\n    )\n\n    MedicationRequestSubstitutionType = medicationrequest.MedicationRequestSubstitution\n\n    MedicationStatementType = medicationstatement.MedicationStatement\n\n    MedicinalProductDefinitionType = (\n        medicinalproductdefinition.MedicinalProductDefinition\n    )\n\n    MedicinalProductDefinitionCharacteristicType = (\n        medicinalproductdefinition.MedicinalProductDefinitionCharacteristic\n    )\n\n    MedicinalProductDefinitionContactType = (\n        medicinalproductdefinition.MedicinalProductDefinitionContact\n    )\n\n    MedicinalProductDefinitionCrossReferenceType = (\n        medicinalproductdefinition.MedicinalProductDefinitionCrossReference\n    )\n\n    MedicinalProductDefinitionNameType = (\n        medicinalproductdefinition.MedicinalProductDefinitionName\n    )\n\n    MedicinalProductDefinitionNameCountryLanguageType = (\n        medicinalproductdefinition.MedicinalProductDefinitionNameCountryLanguage\n    )\n\n    MedicinalProductDefinitionNameNamePartType = (\n        medicinalproductdefinition.MedicinalProductDefinitionNameNamePart\n    )\n\n    MedicinalProductDefinitionOperationType = (\n        medicinalproductdefinition.MedicinalProductDefinitionOperation\n    )\n\n    MessageDefinitionType = messagedefinition.MessageDefinition\n\n    MessageDefinitionAllowedResponseType = (\n        messagedefinition.MessageDefinitionAllowedResponse\n    )\n\n    MessageDefinitionFocusType = messagedefinition.MessageDefinitionFocus\n\n    MessageHeaderType = messageheader.MessageHeader\n\n    MessageHeaderDestinationType = messageheader.MessageHeaderDestination\n\n    MessageHeaderResponseType = messageheader.MessageHeaderResponse\n\n    MessageHeaderSourceType = messageheader.MessageHeaderSource\n\n    MetaType = meta.Meta\n\n    MolecularSequenceType = molecularsequence.MolecularSequence\n\n    MolecularSequenceQualityType = molecularsequence.MolecularSequenceQuality\n\n    MolecularSequenceQualityRocType = molecularsequence.MolecularSequenceQualityRoc\n\n    MolecularSequenceReferenceSeqType = molecularsequence.MolecularSequenceReferenceSeq\n\n    MolecularSequenceRepositoryType = molecularsequence.MolecularSequenceRepository\n\n    MolecularSequenceStructureVariantType = (\n        molecularsequence.MolecularSequenceStructureVariant\n    )\n\n    MolecularSequenceStructureVariantInnerType = (\n        molecularsequence.MolecularSequenceStructureVariantInner\n    )\n\n    MolecularSequenceStructureVariantOuterType = (\n        molecularsequence.MolecularSequenceStructureVariantOuter\n    )\n\n    MolecularSequenceVariantType = molecularsequence.MolecularSequenceVariant\n\n    MoneyType = money.Money\n\n    NamingSystemType = namingsystem.NamingSystem\n\n    NamingSystemUniqueIdType = namingsystem.NamingSystemUniqueId\n\n    NarrativeType = narrative.Narrative\n\n    NutritionOrderType = nutritionorder.NutritionOrder\n\n    NutritionOrderEnteralFormulaType = nutritionorder.NutritionOrderEnteralFormula\n\n    NutritionOrderEnteralFormulaAdministrationType = (\n        nutritionorder.NutritionOrderEnteralFormulaAdministration\n    )\n\n    NutritionOrderOralDietType = nutritionorder.NutritionOrderOralDiet\n\n    NutritionOrderOralDietNutrientType = nutritionorder.NutritionOrderOralDietNutrient\n\n    NutritionOrderOralDietTextureType = nutritionorder.NutritionOrderOralDietTexture\n\n    NutritionOrderSupplementType = nutritionorder.NutritionOrderSupplement\n\n    NutritionProductType = nutritionproduct.NutritionProduct\n\n    NutritionProductIngredientType = nutritionproduct.NutritionProductIngredient\n\n    NutritionProductInstanceType = nutritionproduct.NutritionProductInstance\n\n    NutritionProductNutrientType = nutritionproduct.NutritionProductNutrient\n\n    NutritionProductProductCharacteristicType = (\n        nutritionproduct.NutritionProductProductCharacteristic\n    )\n\n    ObservationType = observation.Observation\n\n    ObservationComponentType = observation.ObservationComponent\n\n    ObservationDefinitionType = observationdefinition.ObservationDefinition\n\n    ObservationDefinitionQualifiedIntervalType = (\n        observationdefinition.ObservationDefinitionQualifiedInterval\n    )\n\n    ObservationDefinitionQuantitativeDetailsType = (\n        observationdefinition.ObservationDefinitionQuantitativeDetails\n    )\n\n    ObservationReferenceRangeType = observation.ObservationReferenceRange\n\n    OperationDefinitionType = operationdefinition.OperationDefinition\n\n    OperationDefinitionOverloadType = operationdefinition.OperationDefinitionOverload\n\n    OperationDefinitionParameterType = operationdefinition.OperationDefinitionParameter\n\n    OperationDefinitionParameterBindingType = (\n        operationdefinition.OperationDefinitionParameterBinding\n    )\n\n    OperationDefinitionParameterReferencedFromType = (\n        operationdefinition.OperationDefinitionParameterReferencedFrom\n    )\n\n    OperationOutcomeType = operationoutcome.OperationOutcome\n\n    OperationOutcomeIssueType = operationoutcome.OperationOutcomeIssue\n\n    OrganizationType = organization.Organization\n\n    OrganizationAffiliationType = organizationaffiliation.OrganizationAffiliation\n\n    OrganizationContactType = organization.OrganizationContact\n\n    PackagedProductDefinitionType = packagedproductdefinition.PackagedProductDefinition\n\n    PackagedProductDefinitionLegalStatusOfSupplyType = (\n        packagedproductdefinition.PackagedProductDefinitionLegalStatusOfSupply\n    )\n\n    PackagedProductDefinitionPackageType = (\n        packagedproductdefinition.PackagedProductDefinitionPackage\n    )\n\n    PackagedProductDefinitionPackageContainedItemType = (\n        packagedproductdefinition.PackagedProductDefinitionPackageContainedItem\n    )\n\n    PackagedProductDefinitionPackagePropertyType = (\n        packagedproductdefinition.PackagedProductDefinitionPackageProperty\n    )\n\n    PackagedProductDefinitionPackageShelfLifeStorageType = (\n        packagedproductdefinition.PackagedProductDefinitionPackageShelfLifeStorage\n    )\n\n    ParameterDefinitionType = parameterdefinition.ParameterDefinition\n\n    ParametersType = parameters.Parameters\n\n    ParametersParameterType = parameters.ParametersParameter\n\n    PatientType = patient.Patient\n\n    PatientCommunicationType = patient.PatientCommunication\n\n    PatientContactType = patient.PatientContact\n\n    PatientLinkType = patient.PatientLink\n\n    PaymentNoticeType = paymentnotice.PaymentNotice\n\n    PaymentReconciliationType = paymentreconciliation.PaymentReconciliation\n\n    PaymentReconciliationDetailType = paymentreconciliation.PaymentReconciliationDetail\n\n    PaymentReconciliationProcessNoteType = (\n        paymentreconciliation.PaymentReconciliationProcessNote\n    )\n\n    PeriodType = period.Period\n\n    PersonType = person.Person\n\n    PersonLinkType = person.PersonLink\n\n    PlanDefinitionType = plandefinition.PlanDefinition\n\n    PlanDefinitionActionType = plandefinition.PlanDefinitionAction\n\n    PlanDefinitionActionConditionType = plandefinition.PlanDefinitionActionCondition\n\n    PlanDefinitionActionDynamicValueType = (\n        plandefinition.PlanDefinitionActionDynamicValue\n    )\n\n    PlanDefinitionActionParticipantType = plandefinition.PlanDefinitionActionParticipant\n\n    PlanDefinitionActionRelatedActionType = (\n        plandefinition.PlanDefinitionActionRelatedAction\n    )\n\n    PlanDefinitionGoalType = plandefinition.PlanDefinitionGoal\n\n    PlanDefinitionGoalTargetType = plandefinition.PlanDefinitionGoalTarget\n\n    PopulationType = population.Population\n\n    PractitionerType = practitioner.Practitioner\n\n    PractitionerQualificationType = practitioner.PractitionerQualification\n\n    PractitionerRoleType = practitionerrole.PractitionerRole\n\n    PractitionerRoleAvailableTimeType = practitionerrole.PractitionerRoleAvailableTime\n\n    PractitionerRoleNotAvailableType = practitionerrole.PractitionerRoleNotAvailable\n\n    ProcedureType = procedure.Procedure\n\n    ProcedureFocalDeviceType = procedure.ProcedureFocalDevice\n\n    ProcedurePerformerType = procedure.ProcedurePerformer\n\n    ProdCharacteristicType = prodcharacteristic.ProdCharacteristic\n\n    ProductShelfLifeType = productshelflife.ProductShelfLife\n\n    ProvenanceType = provenance.Provenance\n\n    ProvenanceAgentType = provenance.ProvenanceAgent\n\n    ProvenanceEntityType = provenance.ProvenanceEntity\n\n    QuantityType = quantity.Quantity\n\n    QuestionnaireType = questionnaire.Questionnaire\n\n    QuestionnaireItemType = questionnaire.QuestionnaireItem\n\n    QuestionnaireItemAnswerOptionType = questionnaire.QuestionnaireItemAnswerOption\n\n    QuestionnaireItemEnableWhenType = questionnaire.QuestionnaireItemEnableWhen\n\n    QuestionnaireItemInitialType = questionnaire.QuestionnaireItemInitial\n\n    QuestionnaireResponseType = questionnaireresponse.QuestionnaireResponse\n\n    QuestionnaireResponseItemType = questionnaireresponse.QuestionnaireResponseItem\n\n    QuestionnaireResponseItemAnswerType = (\n        questionnaireresponse.QuestionnaireResponseItemAnswer\n    )\n\n    RangeType = range.Range\n\n    RatioType = ratio.Ratio\n\n    RatioRangeType = ratiorange.RatioRange\n\n    ReferenceType = reference.Reference\n\n    RegulatedAuthorizationType = regulatedauthorization.RegulatedAuthorization\n\n    RegulatedAuthorizationCaseType = regulatedauthorization.RegulatedAuthorizationCase\n\n    RelatedArtifactType = relatedartifact.RelatedArtifact\n\n    RelatedPersonType = relatedperson.RelatedPerson\n\n    RelatedPersonCommunicationType = relatedperson.RelatedPersonCommunication\n\n    RequestGroupType = requestgroup.RequestGroup\n\n    RequestGroupActionType = requestgroup.RequestGroupAction\n\n    RequestGroupActionConditionType = requestgroup.RequestGroupActionCondition\n\n    RequestGroupActionRelatedActionType = requestgroup.RequestGroupActionRelatedAction\n\n    ResearchDefinitionType = researchdefinition.ResearchDefinition\n\n    ResearchElementDefinitionType = researchelementdefinition.ResearchElementDefinition\n\n    ResearchElementDefinitionCharacteristicType = (\n        researchelementdefinition.ResearchElementDefinitionCharacteristic\n    )\n\n    ResearchStudyType = researchstudy.ResearchStudy\n\n    ResearchStudyArmType = researchstudy.ResearchStudyArm\n\n    ResearchStudyObjectiveType = researchstudy.ResearchStudyObjective\n\n    ResearchSubjectType = researchsubject.ResearchSubject\n\n    ResourceType = resource.Resource\n\n    RiskAssessmentType = riskassessment.RiskAssessment\n\n    RiskAssessmentPredictionType = riskassessment.RiskAssessmentPrediction\n\n    SampledDataType = sampleddata.SampledData\n\n    ScheduleType = schedule.Schedule\n\n    SearchParameterType = searchparameter.SearchParameter\n\n    SearchParameterComponentType = searchparameter.SearchParameterComponent\n\n    ServiceRequestType = servicerequest.ServiceRequest\n\n    SignatureType = signature.Signature\n\n    SlotType = slot.Slot\n\n    SpecimenType = specimen.Specimen\n\n    SpecimenCollectionType = specimen.SpecimenCollection\n\n    SpecimenContainerType = specimen.SpecimenContainer\n\n    SpecimenDefinitionType = specimendefinition.SpecimenDefinition\n\n    SpecimenDefinitionTypeTestedType = specimendefinition.SpecimenDefinitionTypeTested\n\n    SpecimenDefinitionTypeTestedContainerType = (\n        specimendefinition.SpecimenDefinitionTypeTestedContainer\n    )\n\n    SpecimenDefinitionTypeTestedContainerAdditiveType = (\n        specimendefinition.SpecimenDefinitionTypeTestedContainerAdditive\n    )\n\n    SpecimenDefinitionTypeTestedHandlingType = (\n        specimendefinition.SpecimenDefinitionTypeTestedHandling\n    )\n\n    SpecimenProcessingType = specimen.SpecimenProcessing\n\n    StructureDefinitionType = structuredefinition.StructureDefinition\n\n    StructureDefinitionContextType = structuredefinition.StructureDefinitionContext\n\n    StructureDefinitionDifferentialType = (\n        structuredefinition.StructureDefinitionDifferential\n    )\n\n    StructureDefinitionMappingType = structuredefinition.StructureDefinitionMapping\n\n    StructureDefinitionSnapshotType = structuredefinition.StructureDefinitionSnapshot\n\n    StructureMapType = structuremap.StructureMap\n\n    StructureMapGroupType = structuremap.StructureMapGroup\n\n    StructureMapGroupInputType = structuremap.StructureMapGroupInput\n\n    StructureMapGroupRuleType = structuremap.StructureMapGroupRule\n\n    StructureMapGroupRuleDependentType = structuremap.StructureMapGroupRuleDependent\n\n    StructureMapGroupRuleSourceType = structuremap.StructureMapGroupRuleSource\n\n    StructureMapGroupRuleTargetType = structuremap.StructureMapGroupRuleTarget\n\n    StructureMapGroupRuleTargetParameterType = (\n        structuremap.StructureMapGroupRuleTargetParameter\n    )\n\n    StructureMapStructureType = structuremap.StructureMapStructure\n\n    SubscriptionType = subscription.Subscription\n\n    SubscriptionChannelType = subscription.SubscriptionChannel\n\n    SubscriptionStatusType = subscriptionstatus.SubscriptionStatus\n\n    SubscriptionStatusNotificationEventType = (\n        subscriptionstatus.SubscriptionStatusNotificationEvent\n    )\n\n    SubscriptionTopicType = subscriptiontopic.SubscriptionTopic\n\n    SubscriptionTopicCanFilterByType = subscriptiontopic.SubscriptionTopicCanFilterBy\n\n    SubscriptionTopicEventTriggerType = subscriptiontopic.SubscriptionTopicEventTrigger\n\n    SubscriptionTopicNotificationShapeType = (\n        subscriptiontopic.SubscriptionTopicNotificationShape\n    )\n\n    SubscriptionTopicResourceTriggerType = (\n        subscriptiontopic.SubscriptionTopicResourceTrigger\n    )\n\n    SubscriptionTopicResourceTriggerQueryCriteriaType = (\n        subscriptiontopic.SubscriptionTopicResourceTriggerQueryCriteria\n    )\n\n    SubstanceType = substance.Substance\n\n    SubstanceDefinitionType = substancedefinition.SubstanceDefinition\n\n    SubstanceDefinitionCodeType = substancedefinition.SubstanceDefinitionCode\n\n    SubstanceDefinitionMoietyType = substancedefinition.SubstanceDefinitionMoiety\n\n    SubstanceDefinitionMolecularWeightType = (\n        substancedefinition.SubstanceDefinitionMolecularWeight\n    )\n\n    SubstanceDefinitionNameType = substancedefinition.SubstanceDefinitionName\n\n    SubstanceDefinitionNameOfficialType = (\n        substancedefinition.SubstanceDefinitionNameOfficial\n    )\n\n    SubstanceDefinitionPropertyType = substancedefinition.SubstanceDefinitionProperty\n\n    SubstanceDefinitionRelationshipType = (\n        substancedefinition.SubstanceDefinitionRelationship\n    )\n\n    SubstanceDefinitionSourceMaterialType = (\n        substancedefinition.SubstanceDefinitionSourceMaterial\n    )\n\n    SubstanceDefinitionStructureType = substancedefinition.SubstanceDefinitionStructure\n\n    SubstanceDefinitionStructureRepresentationType = (\n        substancedefinition.SubstanceDefinitionStructureRepresentation\n    )\n\n    SubstanceIngredientType = substance.SubstanceIngredient\n\n    SubstanceInstanceType = substance.SubstanceInstance\n\n    SupplyDeliveryType = supplydelivery.SupplyDelivery\n\n    SupplyDeliverySuppliedItemType = supplydelivery.SupplyDeliverySuppliedItem\n\n    SupplyRequestType = supplyrequest.SupplyRequest\n\n    SupplyRequestParameterType = supplyrequest.SupplyRequestParameter\n\n    TaskType = task.Task\n\n    TaskInputType = task.TaskInput\n\n    TaskOutputType = task.TaskOutput\n\n    TaskRestrictionType = task.TaskRestriction\n\n    TerminologyCapabilitiesType = terminologycapabilities.TerminologyCapabilities\n\n    TerminologyCapabilitiesClosureType = (\n        terminologycapabilities.TerminologyCapabilitiesClosure\n    )\n\n    TerminologyCapabilitiesCodeSystemType = (\n        terminologycapabilities.TerminologyCapabilitiesCodeSystem\n    )\n\n    TerminologyCapabilitiesCodeSystemVersionType = (\n        terminologycapabilities.TerminologyCapabilitiesCodeSystemVersion\n    )\n\n    TerminologyCapabilitiesCodeSystemVersionFilterType = (\n        terminologycapabilities.TerminologyCapabilitiesCodeSystemVersionFilter\n    )\n\n    TerminologyCapabilitiesExpansionType = (\n        terminologycapabilities.TerminologyCapabilitiesExpansion\n    )\n\n    TerminologyCapabilitiesExpansionParameterType = (\n        terminologycapabilities.TerminologyCapabilitiesExpansionParameter\n    )\n\n    TerminologyCapabilitiesImplementationType = (\n        terminologycapabilities.TerminologyCapabilitiesImplementation\n    )\n\n    TerminologyCapabilitiesSoftwareType = (\n        terminologycapabilities.TerminologyCapabilitiesSoftware\n    )\n\n    TerminologyCapabilitiesTranslationType = (\n        terminologycapabilities.TerminologyCapabilitiesTranslation\n    )\n\n    TerminologyCapabilitiesValidateCodeType = (\n        terminologycapabilities.TerminologyCapabilitiesValidateCode\n    )\n\n    TestReportType = testreport.TestReport\n\n    TestReportParticipantType = testreport.TestReportParticipant\n\n    TestReportSetupType = testreport.TestReportSetup\n\n    TestReportSetupActionType = testreport.TestReportSetupAction\n\n    TestReportSetupActionAssertType = testreport.TestReportSetupActionAssert\n\n    TestReportSetupActionOperationType = testreport.TestReportSetupActionOperation\n\n    TestReportTeardownType = testreport.TestReportTeardown\n\n    TestReportTeardownActionType = testreport.TestReportTeardownAction\n\n    TestReportTestType = testreport.TestReportTest\n\n    TestReportTestActionType = testreport.TestReportTestAction\n\n    TestScriptType = testscript.TestScript\n\n    TestScriptDestinationType = testscript.TestScriptDestination\n\n    TestScriptFixtureType = testscript.TestScriptFixture\n\n    TestScriptMetadataType = testscript.TestScriptMetadata\n\n    TestScriptMetadataCapabilityType = testscript.TestScriptMetadataCapability\n\n    TestScriptMetadataLinkType = testscript.TestScriptMetadataLink\n\n    TestScriptOriginType = testscript.TestScriptOrigin\n\n    TestScriptSetupType = testscript.TestScriptSetup\n\n    TestScriptSetupActionType = testscript.TestScriptSetupAction\n\n    TestScriptSetupActionAssertType = testscript.TestScriptSetupActionAssert\n\n    TestScriptSetupActionOperationType = testscript.TestScriptSetupActionOperation\n\n    TestScriptSetupActionOperationRequestHeaderType = (\n        testscript.TestScriptSetupActionOperationRequestHeader\n    )\n\n    TestScriptTeardownType = testscript.TestScriptTeardown\n\n    TestScriptTeardownActionType = testscript.TestScriptTeardownAction\n\n    TestScriptTestType = testscript.TestScriptTest\n\n    TestScriptTestActionType = testscript.TestScriptTestAction\n\n    TestScriptVariableType = testscript.TestScriptVariable\n\n    TimingType = timing.Timing\n\n    TimingRepeatType = timing.TimingRepeat\n\n    TriggerDefinitionType = triggerdefinition.TriggerDefinition\n\n    UsageContextType = usagecontext.UsageContext\n\n    ValueSetType = valueset.ValueSet\n\n    ValueSetComposeType = valueset.ValueSetCompose\n\n    ValueSetComposeIncludeType = valueset.ValueSetComposeInclude\n\n    ValueSetComposeIncludeConceptType = valueset.ValueSetComposeIncludeConcept\n\n    ValueSetComposeIncludeConceptDesignationType = (\n        valueset.ValueSetComposeIncludeConceptDesignation\n    )\n\n    ValueSetComposeIncludeFilterType = valueset.ValueSetComposeIncludeFilter\n\n    ValueSetExpansionType = valueset.ValueSetExpansion\n\n    ValueSetExpansionContainsType = valueset.ValueSetExpansionContains\n\n    ValueSetExpansionParameterType = valueset.ValueSetExpansionParameter\n\n    VerificationResultType = verificationresult.VerificationResult\n\n    VerificationResultAttestationType = verificationresult.VerificationResultAttestation\n\n    VerificationResultPrimarySourceType = (\n        verificationresult.VerificationResultPrimarySource\n    )\n\n    VerificationResultValidatorType = verificationresult.VerificationResultValidator\n\n    VisionPrescriptionType = visionprescription.VisionPrescription\n\n    VisionPrescriptionLensSpecificationType = (\n        visionprescription.VisionPrescriptionLensSpecification\n    )\n\n    VisionPrescriptionLensSpecificationPrismType = (\n        visionprescription.VisionPrescriptionLensSpecificationPrism\n    )\n\nelse:\n    FHIRPrimitiveExtensionType = create_fhir_type(\n        \"FHIRPrimitiveExtensionType\",\n        \"fhir.resources.R4B.fhirprimitiveextension.FHIRPrimitiveExtension\",\n    )\n\n    ElementType = create_fhir_element_or_resource_type(\n        \"ElementType\", \"fhir.resources.R4B.element.Element\"\n    )\n\n    ResourceType = create_fhir_element_or_resource_type(\n        \"ResourceType\", \"fhir.resources.R4B.resource.Resource\"\n    )\n    AccountType = create_fhir_type(\"AccountType\", \"fhir.resources.R4B.account.Account\")\n\n    AccountCoverageType = create_fhir_type(\n        \"AccountCoverageType\", \"fhir.resources.R4B.account.AccountCoverage\"\n    )\n\n    AccountGuarantorType = create_fhir_type(\n        \"AccountGuarantorType\", \"fhir.resources.R4B.account.AccountGuarantor\"\n    )\n\n    ActivityDefinitionType = create_fhir_type(\n        \"ActivityDefinitionType\",\n        \"fhir.resources.R4B.activitydefinition.ActivityDefinition\",\n    )\n\n    ActivityDefinitionDynamicValueType = create_fhir_type(\n        \"ActivityDefinitionDynamicValueType\",\n        \"fhir.resources.R4B.activitydefinition.ActivityDefinitionDynamicValue\",\n    )\n\n    ActivityDefinitionParticipantType = create_fhir_type(\n        \"ActivityDefinitionParticipantType\",\n        \"fhir.resources.R4B.activitydefinition.ActivityDefinitionParticipant\",\n    )\n\n    AddressType = create_fhir_type(\"AddressType\", \"fhir.resources.R4B.address.Address\")\n\n    AdministrableProductDefinitionType = create_fhir_type(\n        \"AdministrableProductDefinitionType\",\n        \"fhir.resources.R4B.administrableproductdefinition.AdministrableProductDefinition\",\n    )\n\n    AdministrableProductDefinitionPropertyType = create_fhir_type(\n        \"AdministrableProductDefinitionPropertyType\",\n        \"fhir.resources.R4B.administrableproductdefinition.AdministrableProductDefinitionProperty\",\n    )\n\n    AdministrableProductDefinitionRouteOfAdministrationType = create_fhir_type(\n        \"AdministrableProductDefinitionRouteOfAdministrationType\",\n        \"fhir.resources.R4B.administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministration\",\n    )\n\n    AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType = create_fhir_type(\n        \"AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType\",\n        \"fhir.resources.R4B.administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpecies\",\n    )\n\n    AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType = create_fhir_type(\n        \"AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType\",\n        \"fhir.resources.R4B.administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod\",\n    )\n\n    AdverseEventType = create_fhir_type(\n        \"AdverseEventType\", \"fhir.resources.R4B.adverseevent.AdverseEvent\"\n    )\n\n    AdverseEventSuspectEntityType = create_fhir_type(\n        \"AdverseEventSuspectEntityType\",\n        \"fhir.resources.R4B.adverseevent.AdverseEventSuspectEntity\",\n    )\n\n    AdverseEventSuspectEntityCausalityType = create_fhir_type(\n        \"AdverseEventSuspectEntityCausalityType\",\n        \"fhir.resources.R4B.adverseevent.AdverseEventSuspectEntityCausality\",\n    )\n\n    AgeType = create_fhir_type(\"AgeType\", \"fhir.resources.R4B.age.Age\")\n\n    AllergyIntoleranceType = create_fhir_type(\n        \"AllergyIntoleranceType\",\n        \"fhir.resources.R4B.allergyintolerance.AllergyIntolerance\",\n    )\n\n    AllergyIntoleranceReactionType = create_fhir_type(\n        \"AllergyIntoleranceReactionType\",\n        \"fhir.resources.R4B.allergyintolerance.AllergyIntoleranceReaction\",\n    )\n\n    AnnotationType = create_fhir_type(\n        \"AnnotationType\", \"fhir.resources.R4B.annotation.Annotation\"\n    )\n\n    AppointmentType = create_fhir_type(\n        \"AppointmentType\", \"fhir.resources.R4B.appointment.Appointment\"\n    )\n\n    AppointmentParticipantType = create_fhir_type(\n        \"AppointmentParticipantType\",\n        \"fhir.resources.R4B.appointment.AppointmentParticipant\",\n    )\n\n    AppointmentResponseType = create_fhir_type(\n        \"AppointmentResponseType\",\n        \"fhir.resources.R4B.appointmentresponse.AppointmentResponse\",\n    )\n\n    AttachmentType = create_fhir_type(\n        \"AttachmentType\", \"fhir.resources.R4B.attachment.Attachment\"\n    )\n\n    AuditEventType = create_fhir_type(\n        \"AuditEventType\", \"fhir.resources.R4B.auditevent.AuditEvent\"\n    )\n\n    AuditEventAgentType = create_fhir_type(\n        \"AuditEventAgentType\", \"fhir.resources.R4B.auditevent.AuditEventAgent\"\n    )\n\n    AuditEventAgentNetworkType = create_fhir_type(\n        \"AuditEventAgentNetworkType\",\n        \"fhir.resources.R4B.auditevent.AuditEventAgentNetwork\",\n    )\n\n    AuditEventEntityType = create_fhir_type(\n        \"AuditEventEntityType\", \"fhir.resources.R4B.auditevent.AuditEventEntity\"\n    )\n\n    AuditEventEntityDetailType = create_fhir_type(\n        \"AuditEventEntityDetailType\",\n        \"fhir.resources.R4B.auditevent.AuditEventEntityDetail\",\n    )\n\n    AuditEventSourceType = create_fhir_type(\n        \"AuditEventSourceType\", \"fhir.resources.R4B.auditevent.AuditEventSource\"\n    )\n\n    BackboneElementType = create_fhir_type(\n        \"BackboneElementType\", \"fhir.resources.R4B.backboneelement.BackboneElement\"\n    )\n\n    BasicType = create_fhir_type(\"BasicType\", \"fhir.resources.R4B.basic.Basic\")\n\n    BinaryType = create_fhir_type(\"BinaryType\", \"fhir.resources.R4B.binary.Binary\")\n\n    BiologicallyDerivedProductType = create_fhir_type(\n        \"BiologicallyDerivedProductType\",\n        \"fhir.resources.R4B.biologicallyderivedproduct.BiologicallyDerivedProduct\",\n    )\n\n    BiologicallyDerivedProductCollectionType = create_fhir_type(\n        \"BiologicallyDerivedProductCollectionType\",\n        \"fhir.resources.R4B.biologicallyderivedproduct.BiologicallyDerivedProductCollection\",\n    )\n\n    BiologicallyDerivedProductManipulationType = create_fhir_type(\n        \"BiologicallyDerivedProductManipulationType\",\n        \"fhir.resources.R4B.biologicallyderivedproduct.BiologicallyDerivedProductManipulation\",\n    )\n\n    BiologicallyDerivedProductProcessingType = create_fhir_type(\n        \"BiologicallyDerivedProductProcessingType\",\n        \"fhir.resources.R4B.biologicallyderivedproduct.BiologicallyDerivedProductProcessing\",\n    )\n\n    BiologicallyDerivedProductStorageType = create_fhir_type(\n        \"BiologicallyDerivedProductStorageType\",\n        \"fhir.resources.R4B.biologicallyderivedproduct.BiologicallyDerivedProductStorage\",\n    )\n\n    BodyStructureType = create_fhir_type(\n        \"BodyStructureType\", \"fhir.resources.R4B.bodystructure.BodyStructure\"\n    )\n\n    BundleType = create_fhir_type(\"BundleType\", \"fhir.resources.R4B.bundle.Bundle\")\n\n    BundleEntryType = create_fhir_type(\n        \"BundleEntryType\", \"fhir.resources.R4B.bundle.BundleEntry\"\n    )\n\n    BundleEntryRequestType = create_fhir_type(\n        \"BundleEntryRequestType\", \"fhir.resources.R4B.bundle.BundleEntryRequest\"\n    )\n\n    BundleEntryResponseType = create_fhir_type(\n        \"BundleEntryResponseType\", \"fhir.resources.R4B.bundle.BundleEntryResponse\"\n    )\n\n    BundleEntrySearchType = create_fhir_type(\n        \"BundleEntrySearchType\", \"fhir.resources.R4B.bundle.BundleEntrySearch\"\n    )\n\n    BundleLinkType = create_fhir_type(\n        \"BundleLinkType\", \"fhir.resources.R4B.bundle.BundleLink\"\n    )\n\n    CapabilityStatementType = create_fhir_type(\n        \"CapabilityStatementType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatement\",\n    )\n\n    CapabilityStatementDocumentType = create_fhir_type(\n        \"CapabilityStatementDocumentType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementDocument\",\n    )\n\n    CapabilityStatementImplementationType = create_fhir_type(\n        \"CapabilityStatementImplementationType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementImplementation\",\n    )\n\n    CapabilityStatementMessagingType = create_fhir_type(\n        \"CapabilityStatementMessagingType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementMessaging\",\n    )\n\n    CapabilityStatementMessagingEndpointType = create_fhir_type(\n        \"CapabilityStatementMessagingEndpointType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementMessagingEndpoint\",\n    )\n\n    CapabilityStatementMessagingSupportedMessageType = create_fhir_type(\n        \"CapabilityStatementMessagingSupportedMessageType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementMessagingSupportedMessage\",\n    )\n\n    CapabilityStatementRestType = create_fhir_type(\n        \"CapabilityStatementRestType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementRest\",\n    )\n\n    CapabilityStatementRestInteractionType = create_fhir_type(\n        \"CapabilityStatementRestInteractionType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementRestInteraction\",\n    )\n\n    CapabilityStatementRestResourceType = create_fhir_type(\n        \"CapabilityStatementRestResourceType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementRestResource\",\n    )\n\n    CapabilityStatementRestResourceInteractionType = create_fhir_type(\n        \"CapabilityStatementRestResourceInteractionType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementRestResourceInteraction\",\n    )\n\n    CapabilityStatementRestResourceOperationType = create_fhir_type(\n        \"CapabilityStatementRestResourceOperationType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementRestResourceOperation\",\n    )\n\n    CapabilityStatementRestResourceSearchParamType = create_fhir_type(\n        \"CapabilityStatementRestResourceSearchParamType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementRestResourceSearchParam\",\n    )\n\n    CapabilityStatementRestSecurityType = create_fhir_type(\n        \"CapabilityStatementRestSecurityType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementRestSecurity\",\n    )\n\n    CapabilityStatementSoftwareType = create_fhir_type(\n        \"CapabilityStatementSoftwareType\",\n        \"fhir.resources.R4B.capabilitystatement.CapabilityStatementSoftware\",\n    )\n\n    CarePlanType = create_fhir_type(\n        \"CarePlanType\", \"fhir.resources.R4B.careplan.CarePlan\"\n    )\n\n    CarePlanActivityType = create_fhir_type(\n        \"CarePlanActivityType\", \"fhir.resources.R4B.careplan.CarePlanActivity\"\n    )\n\n    CarePlanActivityDetailType = create_fhir_type(\n        \"CarePlanActivityDetailType\",\n        \"fhir.resources.R4B.careplan.CarePlanActivityDetail\",\n    )\n\n    CareTeamType = create_fhir_type(\n        \"CareTeamType\", \"fhir.resources.R4B.careteam.CareTeam\"\n    )\n\n    CareTeamParticipantType = create_fhir_type(\n        \"CareTeamParticipantType\", \"fhir.resources.R4B.careteam.CareTeamParticipant\"\n    )\n\n    CatalogEntryType = create_fhir_type(\n        \"CatalogEntryType\", \"fhir.resources.R4B.catalogentry.CatalogEntry\"\n    )\n\n    CatalogEntryRelatedEntryType = create_fhir_type(\n        \"CatalogEntryRelatedEntryType\",\n        \"fhir.resources.R4B.catalogentry.CatalogEntryRelatedEntry\",\n    )\n\n    ChargeItemType = create_fhir_type(\n        \"ChargeItemType\", \"fhir.resources.R4B.chargeitem.ChargeItem\"\n    )\n\n    ChargeItemDefinitionType = create_fhir_type(\n        \"ChargeItemDefinitionType\",\n        \"fhir.resources.R4B.chargeitemdefinition.ChargeItemDefinition\",\n    )\n\n    ChargeItemDefinitionApplicabilityType = create_fhir_type(\n        \"ChargeItemDefinitionApplicabilityType\",\n        \"fhir.resources.R4B.chargeitemdefinition.ChargeItemDefinitionApplicability\",\n    )\n\n    ChargeItemDefinitionPropertyGroupType = create_fhir_type(\n        \"ChargeItemDefinitionPropertyGroupType\",\n        \"fhir.resources.R4B.chargeitemdefinition.ChargeItemDefinitionPropertyGroup\",\n    )\n\n    ChargeItemDefinitionPropertyGroupPriceComponentType = create_fhir_type(\n        \"ChargeItemDefinitionPropertyGroupPriceComponentType\",\n        \"fhir.resources.R4B.chargeitemdefinition.ChargeItemDefinitionPropertyGroupPriceComponent\",\n    )\n\n    ChargeItemPerformerType = create_fhir_type(\n        \"ChargeItemPerformerType\", \"fhir.resources.R4B.chargeitem.ChargeItemPerformer\"\n    )\n\n    CitationType = create_fhir_type(\n        \"CitationType\", \"fhir.resources.R4B.citation.Citation\"\n    )\n\n    CitationCitedArtifactType = create_fhir_type(\n        \"CitationCitedArtifactType\", \"fhir.resources.R4B.citation.CitationCitedArtifact\"\n    )\n\n    CitationCitedArtifactAbstractType = create_fhir_type(\n        \"CitationCitedArtifactAbstractType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactAbstract\",\n    )\n\n    CitationCitedArtifactClassificationType = create_fhir_type(\n        \"CitationCitedArtifactClassificationType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactClassification\",\n    )\n\n    CitationCitedArtifactClassificationWhoClassifiedType = create_fhir_type(\n        \"CitationCitedArtifactClassificationWhoClassifiedType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactClassificationWhoClassified\",\n    )\n\n    CitationCitedArtifactContributorshipType = create_fhir_type(\n        \"CitationCitedArtifactContributorshipType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactContributorship\",\n    )\n\n    CitationCitedArtifactContributorshipEntryType = create_fhir_type(\n        \"CitationCitedArtifactContributorshipEntryType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactContributorshipEntry\",\n    )\n\n    CitationCitedArtifactContributorshipEntryAffiliationInfoType = create_fhir_type(\n        \"CitationCitedArtifactContributorshipEntryAffiliationInfoType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactContributorshipEntryAffiliationInfo\",\n    )\n\n    CitationCitedArtifactContributorshipEntryContributionInstanceType = create_fhir_type(\n        \"CitationCitedArtifactContributorshipEntryContributionInstanceType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactContributorshipEntryContributionInstance\",\n    )\n\n    CitationCitedArtifactContributorshipSummaryType = create_fhir_type(\n        \"CitationCitedArtifactContributorshipSummaryType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactContributorshipSummary\",\n    )\n\n    CitationCitedArtifactPartType = create_fhir_type(\n        \"CitationCitedArtifactPartType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactPart\",\n    )\n\n    CitationCitedArtifactPublicationFormType = create_fhir_type(\n        \"CitationCitedArtifactPublicationFormType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactPublicationForm\",\n    )\n\n    CitationCitedArtifactPublicationFormPeriodicReleaseType = create_fhir_type(\n        \"CitationCitedArtifactPublicationFormPeriodicReleaseType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactPublicationFormPeriodicRelease\",\n    )\n\n    CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationType = create_fhir_type(\n        \"CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublication\",\n    )\n\n    CitationCitedArtifactPublicationFormPublishedInType = create_fhir_type(\n        \"CitationCitedArtifactPublicationFormPublishedInType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactPublicationFormPublishedIn\",\n    )\n\n    CitationCitedArtifactRelatesToType = create_fhir_type(\n        \"CitationCitedArtifactRelatesToType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactRelatesTo\",\n    )\n\n    CitationCitedArtifactStatusDateType = create_fhir_type(\n        \"CitationCitedArtifactStatusDateType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactStatusDate\",\n    )\n\n    CitationCitedArtifactTitleType = create_fhir_type(\n        \"CitationCitedArtifactTitleType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactTitle\",\n    )\n\n    CitationCitedArtifactVersionType = create_fhir_type(\n        \"CitationCitedArtifactVersionType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactVersion\",\n    )\n\n    CitationCitedArtifactWebLocationType = create_fhir_type(\n        \"CitationCitedArtifactWebLocationType\",\n        \"fhir.resources.R4B.citation.CitationCitedArtifactWebLocation\",\n    )\n\n    CitationClassificationType = create_fhir_type(\n        \"CitationClassificationType\",\n        \"fhir.resources.R4B.citation.CitationClassification\",\n    )\n\n    CitationRelatesToType = create_fhir_type(\n        \"CitationRelatesToType\", \"fhir.resources.R4B.citation.CitationRelatesTo\"\n    )\n\n    CitationStatusDateType = create_fhir_type(\n        \"CitationStatusDateType\", \"fhir.resources.R4B.citation.CitationStatusDate\"\n    )\n\n    CitationSummaryType = create_fhir_type(\n        \"CitationSummaryType\", \"fhir.resources.R4B.citation.CitationSummary\"\n    )\n\n    ClaimType = create_fhir_type(\"ClaimType\", \"fhir.resources.R4B.claim.Claim\")\n\n    ClaimAccidentType = create_fhir_type(\n        \"ClaimAccidentType\", \"fhir.resources.R4B.claim.ClaimAccident\"\n    )\n\n    ClaimCareTeamType = create_fhir_type(\n        \"ClaimCareTeamType\", \"fhir.resources.R4B.claim.ClaimCareTeam\"\n    )\n\n    ClaimDiagnosisType = create_fhir_type(\n        \"ClaimDiagnosisType\", \"fhir.resources.R4B.claim.ClaimDiagnosis\"\n    )\n\n    ClaimInsuranceType = create_fhir_type(\n        \"ClaimInsuranceType\", \"fhir.resources.R4B.claim.ClaimInsurance\"\n    )\n\n    ClaimItemType = create_fhir_type(\n        \"ClaimItemType\", \"fhir.resources.R4B.claim.ClaimItem\"\n    )\n\n    ClaimItemDetailType = create_fhir_type(\n        \"ClaimItemDetailType\", \"fhir.resources.R4B.claim.ClaimItemDetail\"\n    )\n\n    ClaimItemDetailSubDetailType = create_fhir_type(\n        \"ClaimItemDetailSubDetailType\",\n        \"fhir.resources.R4B.claim.ClaimItemDetailSubDetail\",\n    )\n\n    ClaimPayeeType = create_fhir_type(\n        \"ClaimPayeeType\", \"fhir.resources.R4B.claim.ClaimPayee\"\n    )\n\n    ClaimProcedureType = create_fhir_type(\n        \"ClaimProcedureType\", \"fhir.resources.R4B.claim.ClaimProcedure\"\n    )\n\n    ClaimRelatedType = create_fhir_type(\n        \"ClaimRelatedType\", \"fhir.resources.R4B.claim.ClaimRelated\"\n    )\n\n    ClaimResponseType = create_fhir_type(\n        \"ClaimResponseType\", \"fhir.resources.R4B.claimresponse.ClaimResponse\"\n    )\n\n    ClaimResponseAddItemType = create_fhir_type(\n        \"ClaimResponseAddItemType\",\n        \"fhir.resources.R4B.claimresponse.ClaimResponseAddItem\",\n    )\n\n    ClaimResponseAddItemDetailType = create_fhir_type(\n        \"ClaimResponseAddItemDetailType\",\n        \"fhir.resources.R4B.claimresponse.ClaimResponseAddItemDetail\",\n    )\n\n    ClaimResponseAddItemDetailSubDetailType = create_fhir_type(\n        \"ClaimResponseAddItemDetailSubDetailType\",\n        \"fhir.resources.R4B.claimresponse.ClaimResponseAddItemDetailSubDetail\",\n    )\n\n    ClaimResponseErrorType = create_fhir_type(\n        \"ClaimResponseErrorType\", \"fhir.resources.R4B.claimresponse.ClaimResponseError\"\n    )\n\n    ClaimResponseInsuranceType = create_fhir_type(\n        \"ClaimResponseInsuranceType\",\n        \"fhir.resources.R4B.claimresponse.ClaimResponseInsurance\",\n    )\n\n    ClaimResponseItemType = create_fhir_type(\n        \"ClaimResponseItemType\", \"fhir.resources.R4B.claimresponse.ClaimResponseItem\"\n    )\n\n    ClaimResponseItemAdjudicationType = create_fhir_type(\n        \"ClaimResponseItemAdjudicationType\",\n        \"fhir.resources.R4B.claimresponse.ClaimResponseItemAdjudication\",\n    )\n\n    ClaimResponseItemDetailType = create_fhir_type(\n        \"ClaimResponseItemDetailType\",\n        \"fhir.resources.R4B.claimresponse.ClaimResponseItemDetail\",\n    )\n\n    ClaimResponseItemDetailSubDetailType = create_fhir_type(\n        \"ClaimResponseItemDetailSubDetailType\",\n        \"fhir.resources.R4B.claimresponse.ClaimResponseItemDetailSubDetail\",\n    )\n\n    ClaimResponsePaymentType = create_fhir_type(\n        \"ClaimResponsePaymentType\",\n        \"fhir.resources.R4B.claimresponse.ClaimResponsePayment\",\n    )\n\n    ClaimResponseProcessNoteType = create_fhir_type(\n        \"ClaimResponseProcessNoteType\",\n        \"fhir.resources.R4B.claimresponse.ClaimResponseProcessNote\",\n    )\n\n    ClaimResponseTotalType = create_fhir_type(\n        \"ClaimResponseTotalType\", \"fhir.resources.R4B.claimresponse.ClaimResponseTotal\"\n    )\n\n    ClaimSupportingInfoType = create_fhir_type(\n        \"ClaimSupportingInfoType\", \"fhir.resources.R4B.claim.ClaimSupportingInfo\"\n    )\n\n    ClinicalImpressionType = create_fhir_type(\n        \"ClinicalImpressionType\",\n        \"fhir.resources.R4B.clinicalimpression.ClinicalImpression\",\n    )\n\n    ClinicalImpressionFindingType = create_fhir_type(\n        \"ClinicalImpressionFindingType\",\n        \"fhir.resources.R4B.clinicalimpression.ClinicalImpressionFinding\",\n    )\n\n    ClinicalImpressionInvestigationType = create_fhir_type(\n        \"ClinicalImpressionInvestigationType\",\n        \"fhir.resources.R4B.clinicalimpression.ClinicalImpressionInvestigation\",\n    )\n\n    ClinicalUseDefinitionType = create_fhir_type(\n        \"ClinicalUseDefinitionType\",\n        \"fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinition\",\n    )\n\n    ClinicalUseDefinitionContraindicationType = create_fhir_type(\n        \"ClinicalUseDefinitionContraindicationType\",\n        \"fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionContraindication\",\n    )\n\n    ClinicalUseDefinitionContraindicationOtherTherapyType = create_fhir_type(\n        \"ClinicalUseDefinitionContraindicationOtherTherapyType\",\n        \"fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionContraindicationOtherTherapy\",\n    )\n\n    ClinicalUseDefinitionIndicationType = create_fhir_type(\n        \"ClinicalUseDefinitionIndicationType\",\n        \"fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionIndication\",\n    )\n\n    ClinicalUseDefinitionInteractionType = create_fhir_type(\n        \"ClinicalUseDefinitionInteractionType\",\n        \"fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionInteraction\",\n    )\n\n    ClinicalUseDefinitionInteractionInteractantType = create_fhir_type(\n        \"ClinicalUseDefinitionInteractionInteractantType\",\n        \"fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionInteractionInteractant\",\n    )\n\n    ClinicalUseDefinitionUndesirableEffectType = create_fhir_type(\n        \"ClinicalUseDefinitionUndesirableEffectType\",\n        \"fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionUndesirableEffect\",\n    )\n\n    ClinicalUseDefinitionWarningType = create_fhir_type(\n        \"ClinicalUseDefinitionWarningType\",\n        \"fhir.resources.R4B.clinicalusedefinition.ClinicalUseDefinitionWarning\",\n    )\n\n    CodeSystemType = create_fhir_type(\n        \"CodeSystemType\", \"fhir.resources.R4B.codesystem.CodeSystem\"\n    )\n\n    CodeSystemConceptType = create_fhir_type(\n        \"CodeSystemConceptType\", \"fhir.resources.R4B.codesystem.CodeSystemConcept\"\n    )\n\n    CodeSystemConceptDesignationType = create_fhir_type(\n        \"CodeSystemConceptDesignationType\",\n        \"fhir.resources.R4B.codesystem.CodeSystemConceptDesignation\",\n    )\n\n    CodeSystemConceptPropertyType = create_fhir_type(\n        \"CodeSystemConceptPropertyType\",\n        \"fhir.resources.R4B.codesystem.CodeSystemConceptProperty\",\n    )\n\n    CodeSystemFilterType = create_fhir_type(\n        \"CodeSystemFilterType\", \"fhir.resources.R4B.codesystem.CodeSystemFilter\"\n    )\n\n    CodeSystemPropertyType = create_fhir_type(\n        \"CodeSystemPropertyType\", \"fhir.resources.R4B.codesystem.CodeSystemProperty\"\n    )\n\n    CodeableConceptType = create_fhir_type(\n        \"CodeableConceptType\", \"fhir.resources.R4B.codeableconcept.CodeableConcept\"\n    )\n\n    CodeableReferenceType = create_fhir_type(\n        \"CodeableReferenceType\",\n        \"fhir.resources.R4B.codeablereference.CodeableReference\",\n    )\n\n    CodingType = create_fhir_type(\"CodingType\", \"fhir.resources.R4B.coding.Coding\")\n\n    CommunicationType = create_fhir_type(\n        \"CommunicationType\", \"fhir.resources.R4B.communication.Communication\"\n    )\n\n    CommunicationPayloadType = create_fhir_type(\n        \"CommunicationPayloadType\",\n        \"fhir.resources.R4B.communication.CommunicationPayload\",\n    )\n\n    CommunicationRequestType = create_fhir_type(\n        \"CommunicationRequestType\",\n        \"fhir.resources.R4B.communicationrequest.CommunicationRequest\",\n    )\n\n    CommunicationRequestPayloadType = create_fhir_type(\n        \"CommunicationRequestPayloadType\",\n        \"fhir.resources.R4B.communicationrequest.CommunicationRequestPayload\",\n    )\n\n    CompartmentDefinitionType = create_fhir_type(\n        \"CompartmentDefinitionType\",\n        \"fhir.resources.R4B.compartmentdefinition.CompartmentDefinition\",\n    )\n\n    CompartmentDefinitionResourceType = create_fhir_type(\n        \"CompartmentDefinitionResourceType\",\n        \"fhir.resources.R4B.compartmentdefinition.CompartmentDefinitionResource\",\n    )\n\n    CompositionType = create_fhir_type(\n        \"CompositionType\", \"fhir.resources.R4B.composition.Composition\"\n    )\n\n    CompositionAttesterType = create_fhir_type(\n        \"CompositionAttesterType\", \"fhir.resources.R4B.composition.CompositionAttester\"\n    )\n\n    CompositionEventType = create_fhir_type(\n        \"CompositionEventType\", \"fhir.resources.R4B.composition.CompositionEvent\"\n    )\n\n    CompositionRelatesToType = create_fhir_type(\n        \"CompositionRelatesToType\",\n        \"fhir.resources.R4B.composition.CompositionRelatesTo\",\n    )\n\n    CompositionSectionType = create_fhir_type(\n        \"CompositionSectionType\", \"fhir.resources.R4B.composition.CompositionSection\"\n    )\n\n    ConceptMapType = create_fhir_type(\n        \"ConceptMapType\", \"fhir.resources.R4B.conceptmap.ConceptMap\"\n    )\n\n    ConceptMapGroupType = create_fhir_type(\n        \"ConceptMapGroupType\", \"fhir.resources.R4B.conceptmap.ConceptMapGroup\"\n    )\n\n    ConceptMapGroupElementType = create_fhir_type(\n        \"ConceptMapGroupElementType\",\n        \"fhir.resources.R4B.conceptmap.ConceptMapGroupElement\",\n    )\n\n    ConceptMapGroupElementTargetType = create_fhir_type(\n        \"ConceptMapGroupElementTargetType\",\n        \"fhir.resources.R4B.conceptmap.ConceptMapGroupElementTarget\",\n    )\n\n    ConceptMapGroupElementTargetDependsOnType = create_fhir_type(\n        \"ConceptMapGroupElementTargetDependsOnType\",\n        \"fhir.resources.R4B.conceptmap.ConceptMapGroupElementTargetDependsOn\",\n    )\n\n    ConceptMapGroupUnmappedType = create_fhir_type(\n        \"ConceptMapGroupUnmappedType\",\n        \"fhir.resources.R4B.conceptmap.ConceptMapGroupUnmapped\",\n    )\n\n    ConditionType = create_fhir_type(\n        \"ConditionType\", \"fhir.resources.R4B.condition.Condition\"\n    )\n\n    ConditionEvidenceType = create_fhir_type(\n        \"ConditionEvidenceType\", \"fhir.resources.R4B.condition.ConditionEvidence\"\n    )\n\n    ConditionStageType = create_fhir_type(\n        \"ConditionStageType\", \"fhir.resources.R4B.condition.ConditionStage\"\n    )\n\n    ConsentType = create_fhir_type(\"ConsentType\", \"fhir.resources.R4B.consent.Consent\")\n\n    ConsentPolicyType = create_fhir_type(\n        \"ConsentPolicyType\", \"fhir.resources.R4B.consent.ConsentPolicy\"\n    )\n\n    ConsentProvisionType = create_fhir_type(\n        \"ConsentProvisionType\", \"fhir.resources.R4B.consent.ConsentProvision\"\n    )\n\n    ConsentProvisionActorType = create_fhir_type(\n        \"ConsentProvisionActorType\", \"fhir.resources.R4B.consent.ConsentProvisionActor\"\n    )\n\n    ConsentProvisionDataType = create_fhir_type(\n        \"ConsentProvisionDataType\", \"fhir.resources.R4B.consent.ConsentProvisionData\"\n    )\n\n    ConsentVerificationType = create_fhir_type(\n        \"ConsentVerificationType\", \"fhir.resources.R4B.consent.ConsentVerification\"\n    )\n\n    ContactDetailType = create_fhir_type(\n        \"ContactDetailType\", \"fhir.resources.R4B.contactdetail.ContactDetail\"\n    )\n\n    ContactPointType = create_fhir_type(\n        \"ContactPointType\", \"fhir.resources.R4B.contactpoint.ContactPoint\"\n    )\n\n    ContractType = create_fhir_type(\n        \"ContractType\", \"fhir.resources.R4B.contract.Contract\"\n    )\n\n    ContractContentDefinitionType = create_fhir_type(\n        \"ContractContentDefinitionType\",\n        \"fhir.resources.R4B.contract.ContractContentDefinition\",\n    )\n\n    ContractFriendlyType = create_fhir_type(\n        \"ContractFriendlyType\", \"fhir.resources.R4B.contract.ContractFriendly\"\n    )\n\n    ContractLegalType = create_fhir_type(\n        \"ContractLegalType\", \"fhir.resources.R4B.contract.ContractLegal\"\n    )\n\n    ContractRuleType = create_fhir_type(\n        \"ContractRuleType\", \"fhir.resources.R4B.contract.ContractRule\"\n    )\n\n    ContractSignerType = create_fhir_type(\n        \"ContractSignerType\", \"fhir.resources.R4B.contract.ContractSigner\"\n    )\n\n    ContractTermType = create_fhir_type(\n        \"ContractTermType\", \"fhir.resources.R4B.contract.ContractTerm\"\n    )\n\n    ContractTermActionType = create_fhir_type(\n        \"ContractTermActionType\", \"fhir.resources.R4B.contract.ContractTermAction\"\n    )\n\n    ContractTermActionSubjectType = create_fhir_type(\n        \"ContractTermActionSubjectType\",\n        \"fhir.resources.R4B.contract.ContractTermActionSubject\",\n    )\n\n    ContractTermAssetType = create_fhir_type(\n        \"ContractTermAssetType\", \"fhir.resources.R4B.contract.ContractTermAsset\"\n    )\n\n    ContractTermAssetContextType = create_fhir_type(\n        \"ContractTermAssetContextType\",\n        \"fhir.resources.R4B.contract.ContractTermAssetContext\",\n    )\n\n    ContractTermAssetValuedItemType = create_fhir_type(\n        \"ContractTermAssetValuedItemType\",\n        \"fhir.resources.R4B.contract.ContractTermAssetValuedItem\",\n    )\n\n    ContractTermOfferType = create_fhir_type(\n        \"ContractTermOfferType\", \"fhir.resources.R4B.contract.ContractTermOffer\"\n    )\n\n    ContractTermOfferAnswerType = create_fhir_type(\n        \"ContractTermOfferAnswerType\",\n        \"fhir.resources.R4B.contract.ContractTermOfferAnswer\",\n    )\n\n    ContractTermOfferPartyType = create_fhir_type(\n        \"ContractTermOfferPartyType\",\n        \"fhir.resources.R4B.contract.ContractTermOfferParty\",\n    )\n\n    ContractTermSecurityLabelType = create_fhir_type(\n        \"ContractTermSecurityLabelType\",\n        \"fhir.resources.R4B.contract.ContractTermSecurityLabel\",\n    )\n\n    ContributorType = create_fhir_type(\n        \"ContributorType\", \"fhir.resources.R4B.contributor.Contributor\"\n    )\n\n    CountType = create_fhir_type(\"CountType\", \"fhir.resources.R4B.count.Count\")\n\n    CoverageType = create_fhir_type(\n        \"CoverageType\", \"fhir.resources.R4B.coverage.Coverage\"\n    )\n\n    CoverageClassType = create_fhir_type(\n        \"CoverageClassType\", \"fhir.resources.R4B.coverage.CoverageClass\"\n    )\n\n    CoverageCostToBeneficiaryType = create_fhir_type(\n        \"CoverageCostToBeneficiaryType\",\n        \"fhir.resources.R4B.coverage.CoverageCostToBeneficiary\",\n    )\n\n    CoverageCostToBeneficiaryExceptionType = create_fhir_type(\n        \"CoverageCostToBeneficiaryExceptionType\",\n        \"fhir.resources.R4B.coverage.CoverageCostToBeneficiaryException\",\n    )\n\n    CoverageEligibilityRequestType = create_fhir_type(\n        \"CoverageEligibilityRequestType\",\n        \"fhir.resources.R4B.coverageeligibilityrequest.CoverageEligibilityRequest\",\n    )\n\n    CoverageEligibilityRequestInsuranceType = create_fhir_type(\n        \"CoverageEligibilityRequestInsuranceType\",\n        \"fhir.resources.R4B.coverageeligibilityrequest.CoverageEligibilityRequestInsurance\",\n    )\n\n    CoverageEligibilityRequestItemType = create_fhir_type(\n        \"CoverageEligibilityRequestItemType\",\n        \"fhir.resources.R4B.coverageeligibilityrequest.CoverageEligibilityRequestItem\",\n    )\n\n    CoverageEligibilityRequestItemDiagnosisType = create_fhir_type(\n        \"CoverageEligibilityRequestItemDiagnosisType\",\n        \"fhir.resources.R4B.coverageeligibilityrequest.CoverageEligibilityRequestItemDiagnosis\",\n    )\n\n    CoverageEligibilityRequestSupportingInfoType = create_fhir_type(\n        \"CoverageEligibilityRequestSupportingInfoType\",\n        \"fhir.resources.R4B.coverageeligibilityrequest.CoverageEligibilityRequestSupportingInfo\",\n    )\n\n    CoverageEligibilityResponseType = create_fhir_type(\n        \"CoverageEligibilityResponseType\",\n        \"fhir.resources.R4B.coverageeligibilityresponse.CoverageEligibilityResponse\",\n    )\n\n    CoverageEligibilityResponseErrorType = create_fhir_type(\n        \"CoverageEligibilityResponseErrorType\",\n        \"fhir.resources.R4B.coverageeligibilityresponse.CoverageEligibilityResponseError\",\n    )\n\n    CoverageEligibilityResponseInsuranceType = create_fhir_type(\n        \"CoverageEligibilityResponseInsuranceType\",\n        \"fhir.resources.R4B.coverageeligibilityresponse.CoverageEligibilityResponseInsurance\",\n    )\n\n    CoverageEligibilityResponseInsuranceItemType = create_fhir_type(\n        \"CoverageEligibilityResponseInsuranceItemType\",\n        \"fhir.resources.R4B.coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItem\",\n    )\n\n    CoverageEligibilityResponseInsuranceItemBenefitType = create_fhir_type(\n        \"CoverageEligibilityResponseInsuranceItemBenefitType\",\n        \"fhir.resources.R4B.coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItemBenefit\",\n    )\n\n    DataRequirementType = create_fhir_type(\n        \"DataRequirementType\", \"fhir.resources.R4B.datarequirement.DataRequirement\"\n    )\n\n    DataRequirementCodeFilterType = create_fhir_type(\n        \"DataRequirementCodeFilterType\",\n        \"fhir.resources.R4B.datarequirement.DataRequirementCodeFilter\",\n    )\n\n    DataRequirementDateFilterType = create_fhir_type(\n        \"DataRequirementDateFilterType\",\n        \"fhir.resources.R4B.datarequirement.DataRequirementDateFilter\",\n    )\n\n    DataRequirementSortType = create_fhir_type(\n        \"DataRequirementSortType\",\n        \"fhir.resources.R4B.datarequirement.DataRequirementSort\",\n    )\n\n    DetectedIssueType = create_fhir_type(\n        \"DetectedIssueType\", \"fhir.resources.R4B.detectedissue.DetectedIssue\"\n    )\n\n    DetectedIssueEvidenceType = create_fhir_type(\n        \"DetectedIssueEvidenceType\",\n        \"fhir.resources.R4B.detectedissue.DetectedIssueEvidence\",\n    )\n\n    DetectedIssueMitigationType = create_fhir_type(\n        \"DetectedIssueMitigationType\",\n        \"fhir.resources.R4B.detectedissue.DetectedIssueMitigation\",\n    )\n\n    DeviceType = create_fhir_type(\"DeviceType\", \"fhir.resources.R4B.device.Device\")\n\n    DeviceDefinitionType = create_fhir_type(\n        \"DeviceDefinitionType\", \"fhir.resources.R4B.devicedefinition.DeviceDefinition\"\n    )\n\n    DeviceDefinitionCapabilityType = create_fhir_type(\n        \"DeviceDefinitionCapabilityType\",\n        \"fhir.resources.R4B.devicedefinition.DeviceDefinitionCapability\",\n    )\n\n    DeviceDefinitionDeviceNameType = create_fhir_type(\n        \"DeviceDefinitionDeviceNameType\",\n        \"fhir.resources.R4B.devicedefinition.DeviceDefinitionDeviceName\",\n    )\n\n    DeviceDefinitionMaterialType = create_fhir_type(\n        \"DeviceDefinitionMaterialType\",\n        \"fhir.resources.R4B.devicedefinition.DeviceDefinitionMaterial\",\n    )\n\n    DeviceDefinitionPropertyType = create_fhir_type(\n        \"DeviceDefinitionPropertyType\",\n        \"fhir.resources.R4B.devicedefinition.DeviceDefinitionProperty\",\n    )\n\n    DeviceDefinitionSpecializationType = create_fhir_type(\n        \"DeviceDefinitionSpecializationType\",\n        \"fhir.resources.R4B.devicedefinition.DeviceDefinitionSpecialization\",\n    )\n\n    DeviceDefinitionUdiDeviceIdentifierType = create_fhir_type(\n        \"DeviceDefinitionUdiDeviceIdentifierType\",\n        \"fhir.resources.R4B.devicedefinition.DeviceDefinitionUdiDeviceIdentifier\",\n    )\n\n    DeviceDeviceNameType = create_fhir_type(\n        \"DeviceDeviceNameType\", \"fhir.resources.R4B.device.DeviceDeviceName\"\n    )\n\n    DeviceMetricType = create_fhir_type(\n        \"DeviceMetricType\", \"fhir.resources.R4B.devicemetric.DeviceMetric\"\n    )\n\n    DeviceMetricCalibrationType = create_fhir_type(\n        \"DeviceMetricCalibrationType\",\n        \"fhir.resources.R4B.devicemetric.DeviceMetricCalibration\",\n    )\n\n    DevicePropertyType = create_fhir_type(\n        \"DevicePropertyType\", \"fhir.resources.R4B.device.DeviceProperty\"\n    )\n\n    DeviceRequestType = create_fhir_type(\n        \"DeviceRequestType\", \"fhir.resources.R4B.devicerequest.DeviceRequest\"\n    )\n\n    DeviceRequestParameterType = create_fhir_type(\n        \"DeviceRequestParameterType\",\n        \"fhir.resources.R4B.devicerequest.DeviceRequestParameter\",\n    )\n\n    DeviceSpecializationType = create_fhir_type(\n        \"DeviceSpecializationType\", \"fhir.resources.R4B.device.DeviceSpecialization\"\n    )\n\n    DeviceUdiCarrierType = create_fhir_type(\n        \"DeviceUdiCarrierType\", \"fhir.resources.R4B.device.DeviceUdiCarrier\"\n    )\n\n    DeviceUseStatementType = create_fhir_type(\n        \"DeviceUseStatementType\",\n        \"fhir.resources.R4B.deviceusestatement.DeviceUseStatement\",\n    )\n\n    DeviceVersionType = create_fhir_type(\n        \"DeviceVersionType\", \"fhir.resources.R4B.device.DeviceVersion\"\n    )\n\n    DiagnosticReportType = create_fhir_type(\n        \"DiagnosticReportType\", \"fhir.resources.R4B.diagnosticreport.DiagnosticReport\"\n    )\n\n    DiagnosticReportMediaType = create_fhir_type(\n        \"DiagnosticReportMediaType\",\n        \"fhir.resources.R4B.diagnosticreport.DiagnosticReportMedia\",\n    )\n\n    DistanceType = create_fhir_type(\n        \"DistanceType\", \"fhir.resources.R4B.distance.Distance\"\n    )\n\n    DocumentManifestType = create_fhir_type(\n        \"DocumentManifestType\", \"fhir.resources.R4B.documentmanifest.DocumentManifest\"\n    )\n\n    DocumentManifestRelatedType = create_fhir_type(\n        \"DocumentManifestRelatedType\",\n        \"fhir.resources.R4B.documentmanifest.DocumentManifestRelated\",\n    )\n\n    DocumentReferenceType = create_fhir_type(\n        \"DocumentReferenceType\",\n        \"fhir.resources.R4B.documentreference.DocumentReference\",\n    )\n\n    DocumentReferenceContentType = create_fhir_type(\n        \"DocumentReferenceContentType\",\n        \"fhir.resources.R4B.documentreference.DocumentReferenceContent\",\n    )\n\n    DocumentReferenceContextType = create_fhir_type(\n        \"DocumentReferenceContextType\",\n        \"fhir.resources.R4B.documentreference.DocumentReferenceContext\",\n    )\n\n    DocumentReferenceRelatesToType = create_fhir_type(\n        \"DocumentReferenceRelatesToType\",\n        \"fhir.resources.R4B.documentreference.DocumentReferenceRelatesTo\",\n    )\n\n    DomainResourceType = create_fhir_type(\n        \"DomainResourceType\", \"fhir.resources.R4B.domainresource.DomainResource\"\n    )\n\n    DosageType = create_fhir_type(\"DosageType\", \"fhir.resources.R4B.dosage.Dosage\")\n\n    DosageDoseAndRateType = create_fhir_type(\n        \"DosageDoseAndRateType\", \"fhir.resources.R4B.dosage.DosageDoseAndRate\"\n    )\n\n    DurationType = create_fhir_type(\n        \"DurationType\", \"fhir.resources.R4B.duration.Duration\"\n    )\n\n    ElementDefinitionType = create_fhir_type(\n        \"ElementDefinitionType\",\n        \"fhir.resources.R4B.elementdefinition.ElementDefinition\",\n    )\n\n    ElementDefinitionBaseType = create_fhir_type(\n        \"ElementDefinitionBaseType\",\n        \"fhir.resources.R4B.elementdefinition.ElementDefinitionBase\",\n    )\n\n    ElementDefinitionBindingType = create_fhir_type(\n        \"ElementDefinitionBindingType\",\n        \"fhir.resources.R4B.elementdefinition.ElementDefinitionBinding\",\n    )\n\n    ElementDefinitionConstraintType = create_fhir_type(\n        \"ElementDefinitionConstraintType\",\n        \"fhir.resources.R4B.elementdefinition.ElementDefinitionConstraint\",\n    )\n\n    ElementDefinitionExampleType = create_fhir_type(\n        \"ElementDefinitionExampleType\",\n        \"fhir.resources.R4B.elementdefinition.ElementDefinitionExample\",\n    )\n\n    ElementDefinitionMappingType = create_fhir_type(\n        \"ElementDefinitionMappingType\",\n        \"fhir.resources.R4B.elementdefinition.ElementDefinitionMapping\",\n    )\n\n    ElementDefinitionSlicingType = create_fhir_type(\n        \"ElementDefinitionSlicingType\",\n        \"fhir.resources.R4B.elementdefinition.ElementDefinitionSlicing\",\n    )\n\n    ElementDefinitionSlicingDiscriminatorType = create_fhir_type(\n        \"ElementDefinitionSlicingDiscriminatorType\",\n        \"fhir.resources.R4B.elementdefinition.ElementDefinitionSlicingDiscriminator\",\n    )\n\n    ElementDefinitionTypeType = create_fhir_type(\n        \"ElementDefinitionTypeType\",\n        \"fhir.resources.R4B.elementdefinition.ElementDefinitionType\",\n    )\n\n    EncounterType = create_fhir_type(\n        \"EncounterType\", \"fhir.resources.R4B.encounter.Encounter\"\n    )\n\n    EncounterClassHistoryType = create_fhir_type(\n        \"EncounterClassHistoryType\",\n        \"fhir.resources.R4B.encounter.EncounterClassHistory\",\n    )\n\n    EncounterDiagnosisType = create_fhir_type(\n        \"EncounterDiagnosisType\", \"fhir.resources.R4B.encounter.EncounterDiagnosis\"\n    )\n\n    EncounterHospitalizationType = create_fhir_type(\n        \"EncounterHospitalizationType\",\n        \"fhir.resources.R4B.encounter.EncounterHospitalization\",\n    )\n\n    EncounterLocationType = create_fhir_type(\n        \"EncounterLocationType\", \"fhir.resources.R4B.encounter.EncounterLocation\"\n    )\n\n    EncounterParticipantType = create_fhir_type(\n        \"EncounterParticipantType\", \"fhir.resources.R4B.encounter.EncounterParticipant\"\n    )\n\n    EncounterStatusHistoryType = create_fhir_type(\n        \"EncounterStatusHistoryType\",\n        \"fhir.resources.R4B.encounter.EncounterStatusHistory\",\n    )\n\n    EndpointType = create_fhir_type(\n        \"EndpointType\", \"fhir.resources.R4B.endpoint.Endpoint\"\n    )\n\n    EnrollmentRequestType = create_fhir_type(\n        \"EnrollmentRequestType\",\n        \"fhir.resources.R4B.enrollmentrequest.EnrollmentRequest\",\n    )\n\n    EnrollmentResponseType = create_fhir_type(\n        \"EnrollmentResponseType\",\n        \"fhir.resources.R4B.enrollmentresponse.EnrollmentResponse\",\n    )\n\n    EpisodeOfCareType = create_fhir_type(\n        \"EpisodeOfCareType\", \"fhir.resources.R4B.episodeofcare.EpisodeOfCare\"\n    )\n\n    EpisodeOfCareDiagnosisType = create_fhir_type(\n        \"EpisodeOfCareDiagnosisType\",\n        \"fhir.resources.R4B.episodeofcare.EpisodeOfCareDiagnosis\",\n    )\n\n    EpisodeOfCareStatusHistoryType = create_fhir_type(\n        \"EpisodeOfCareStatusHistoryType\",\n        \"fhir.resources.R4B.episodeofcare.EpisodeOfCareStatusHistory\",\n    )\n\n    EventDefinitionType = create_fhir_type(\n        \"EventDefinitionType\", \"fhir.resources.R4B.eventdefinition.EventDefinition\"\n    )\n\n    EvidenceType = create_fhir_type(\n        \"EvidenceType\", \"fhir.resources.R4B.evidence.Evidence\"\n    )\n\n    EvidenceCertaintyType = create_fhir_type(\n        \"EvidenceCertaintyType\", \"fhir.resources.R4B.evidence.EvidenceCertainty\"\n    )\n\n    EvidenceReportType = create_fhir_type(\n        \"EvidenceReportType\", \"fhir.resources.R4B.evidencereport.EvidenceReport\"\n    )\n\n    EvidenceReportRelatesToType = create_fhir_type(\n        \"EvidenceReportRelatesToType\",\n        \"fhir.resources.R4B.evidencereport.EvidenceReportRelatesTo\",\n    )\n\n    EvidenceReportSectionType = create_fhir_type(\n        \"EvidenceReportSectionType\",\n        \"fhir.resources.R4B.evidencereport.EvidenceReportSection\",\n    )\n\n    EvidenceReportSubjectType = create_fhir_type(\n        \"EvidenceReportSubjectType\",\n        \"fhir.resources.R4B.evidencereport.EvidenceReportSubject\",\n    )\n\n    EvidenceReportSubjectCharacteristicType = create_fhir_type(\n        \"EvidenceReportSubjectCharacteristicType\",\n        \"fhir.resources.R4B.evidencereport.EvidenceReportSubjectCharacteristic\",\n    )\n\n    EvidenceStatisticType = create_fhir_type(\n        \"EvidenceStatisticType\", \"fhir.resources.R4B.evidence.EvidenceStatistic\"\n    )\n\n    EvidenceStatisticAttributeEstimateType = create_fhir_type(\n        \"EvidenceStatisticAttributeEstimateType\",\n        \"fhir.resources.R4B.evidence.EvidenceStatisticAttributeEstimate\",\n    )\n\n    EvidenceStatisticModelCharacteristicType = create_fhir_type(\n        \"EvidenceStatisticModelCharacteristicType\",\n        \"fhir.resources.R4B.evidence.EvidenceStatisticModelCharacteristic\",\n    )\n\n    EvidenceStatisticModelCharacteristicVariableType = create_fhir_type(\n        \"EvidenceStatisticModelCharacteristicVariableType\",\n        \"fhir.resources.R4B.evidence.EvidenceStatisticModelCharacteristicVariable\",\n    )\n\n    EvidenceStatisticSampleSizeType = create_fhir_type(\n        \"EvidenceStatisticSampleSizeType\",\n        \"fhir.resources.R4B.evidence.EvidenceStatisticSampleSize\",\n    )\n\n    EvidenceVariableType = create_fhir_type(\n        \"EvidenceVariableType\", \"fhir.resources.R4B.evidencevariable.EvidenceVariable\"\n    )\n\n    EvidenceVariableCategoryType = create_fhir_type(\n        \"EvidenceVariableCategoryType\",\n        \"fhir.resources.R4B.evidencevariable.EvidenceVariableCategory\",\n    )\n\n    EvidenceVariableCharacteristicType = create_fhir_type(\n        \"EvidenceVariableCharacteristicType\",\n        \"fhir.resources.R4B.evidencevariable.EvidenceVariableCharacteristic\",\n    )\n\n    EvidenceVariableCharacteristicTimeFromStartType = create_fhir_type(\n        \"EvidenceVariableCharacteristicTimeFromStartType\",\n        \"fhir.resources.R4B.evidencevariable.EvidenceVariableCharacteristicTimeFromStart\",\n    )\n\n    EvidenceVariableDefinitionType = create_fhir_type(\n        \"EvidenceVariableDefinitionType\",\n        \"fhir.resources.R4B.evidence.EvidenceVariableDefinition\",\n    )\n\n    ExampleScenarioType = create_fhir_type(\n        \"ExampleScenarioType\", \"fhir.resources.R4B.examplescenario.ExampleScenario\"\n    )\n\n    ExampleScenarioActorType = create_fhir_type(\n        \"ExampleScenarioActorType\",\n        \"fhir.resources.R4B.examplescenario.ExampleScenarioActor\",\n    )\n\n    ExampleScenarioInstanceType = create_fhir_type(\n        \"ExampleScenarioInstanceType\",\n        \"fhir.resources.R4B.examplescenario.ExampleScenarioInstance\",\n    )\n\n    ExampleScenarioInstanceContainedInstanceType = create_fhir_type(\n        \"ExampleScenarioInstanceContainedInstanceType\",\n        \"fhir.resources.R4B.examplescenario.ExampleScenarioInstanceContainedInstance\",\n    )\n\n    ExampleScenarioInstanceVersionType = create_fhir_type(\n        \"ExampleScenarioInstanceVersionType\",\n        \"fhir.resources.R4B.examplescenario.ExampleScenarioInstanceVersion\",\n    )\n\n    ExampleScenarioProcessType = create_fhir_type(\n        \"ExampleScenarioProcessType\",\n        \"fhir.resources.R4B.examplescenario.ExampleScenarioProcess\",\n    )\n\n    ExampleScenarioProcessStepType = create_fhir_type(\n        \"ExampleScenarioProcessStepType\",\n        \"fhir.resources.R4B.examplescenario.ExampleScenarioProcessStep\",\n    )\n\n    ExampleScenarioProcessStepAlternativeType = create_fhir_type(\n        \"ExampleScenarioProcessStepAlternativeType\",\n        \"fhir.resources.R4B.examplescenario.ExampleScenarioProcessStepAlternative\",\n    )\n\n    ExampleScenarioProcessStepOperationType = create_fhir_type(\n        \"ExampleScenarioProcessStepOperationType\",\n        \"fhir.resources.R4B.examplescenario.ExampleScenarioProcessStepOperation\",\n    )\n\n    ExplanationOfBenefitType = create_fhir_type(\n        \"ExplanationOfBenefitType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefit\",\n    )\n\n    ExplanationOfBenefitAccidentType = create_fhir_type(\n        \"ExplanationOfBenefitAccidentType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitAccident\",\n    )\n\n    ExplanationOfBenefitAddItemType = create_fhir_type(\n        \"ExplanationOfBenefitAddItemType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitAddItem\",\n    )\n\n    ExplanationOfBenefitAddItemDetailType = create_fhir_type(\n        \"ExplanationOfBenefitAddItemDetailType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitAddItemDetail\",\n    )\n\n    ExplanationOfBenefitAddItemDetailSubDetailType = create_fhir_type(\n        \"ExplanationOfBenefitAddItemDetailSubDetailType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitAddItemDetailSubDetail\",\n    )\n\n    ExplanationOfBenefitBenefitBalanceType = create_fhir_type(\n        \"ExplanationOfBenefitBenefitBalanceType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitBenefitBalance\",\n    )\n\n    ExplanationOfBenefitBenefitBalanceFinancialType = create_fhir_type(\n        \"ExplanationOfBenefitBenefitBalanceFinancialType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitBenefitBalanceFinancial\",\n    )\n\n    ExplanationOfBenefitCareTeamType = create_fhir_type(\n        \"ExplanationOfBenefitCareTeamType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitCareTeam\",\n    )\n\n    ExplanationOfBenefitDiagnosisType = create_fhir_type(\n        \"ExplanationOfBenefitDiagnosisType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitDiagnosis\",\n    )\n\n    ExplanationOfBenefitInsuranceType = create_fhir_type(\n        \"ExplanationOfBenefitInsuranceType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitInsurance\",\n    )\n\n    ExplanationOfBenefitItemType = create_fhir_type(\n        \"ExplanationOfBenefitItemType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitItem\",\n    )\n\n    ExplanationOfBenefitItemAdjudicationType = create_fhir_type(\n        \"ExplanationOfBenefitItemAdjudicationType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitItemAdjudication\",\n    )\n\n    ExplanationOfBenefitItemDetailType = create_fhir_type(\n        \"ExplanationOfBenefitItemDetailType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitItemDetail\",\n    )\n\n    ExplanationOfBenefitItemDetailSubDetailType = create_fhir_type(\n        \"ExplanationOfBenefitItemDetailSubDetailType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail\",\n    )\n\n    ExplanationOfBenefitPayeeType = create_fhir_type(\n        \"ExplanationOfBenefitPayeeType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitPayee\",\n    )\n\n    ExplanationOfBenefitPaymentType = create_fhir_type(\n        \"ExplanationOfBenefitPaymentType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitPayment\",\n    )\n\n    ExplanationOfBenefitProcedureType = create_fhir_type(\n        \"ExplanationOfBenefitProcedureType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitProcedure\",\n    )\n\n    ExplanationOfBenefitProcessNoteType = create_fhir_type(\n        \"ExplanationOfBenefitProcessNoteType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitProcessNote\",\n    )\n\n    ExplanationOfBenefitRelatedType = create_fhir_type(\n        \"ExplanationOfBenefitRelatedType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitRelated\",\n    )\n\n    ExplanationOfBenefitSupportingInfoType = create_fhir_type(\n        \"ExplanationOfBenefitSupportingInfoType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitSupportingInfo\",\n    )\n\n    ExplanationOfBenefitTotalType = create_fhir_type(\n        \"ExplanationOfBenefitTotalType\",\n        \"fhir.resources.R4B.explanationofbenefit.ExplanationOfBenefitTotal\",\n    )\n\n    ExpressionType = create_fhir_type(\n        \"ExpressionType\", \"fhir.resources.R4B.expression.Expression\"\n    )\n\n    ExtensionType = create_fhir_type(\n        \"ExtensionType\", \"fhir.resources.R4B.extension.Extension\"\n    )\n\n    FamilyMemberHistoryType = create_fhir_type(\n        \"FamilyMemberHistoryType\",\n        \"fhir.resources.R4B.familymemberhistory.FamilyMemberHistory\",\n    )\n\n    FamilyMemberHistoryConditionType = create_fhir_type(\n        \"FamilyMemberHistoryConditionType\",\n        \"fhir.resources.R4B.familymemberhistory.FamilyMemberHistoryCondition\",\n    )\n\n    FlagType = create_fhir_type(\"FlagType\", \"fhir.resources.R4B.flag.Flag\")\n\n    GoalType = create_fhir_type(\"GoalType\", \"fhir.resources.R4B.goal.Goal\")\n\n    GoalTargetType = create_fhir_type(\n        \"GoalTargetType\", \"fhir.resources.R4B.goal.GoalTarget\"\n    )\n\n    GraphDefinitionType = create_fhir_type(\n        \"GraphDefinitionType\", \"fhir.resources.R4B.graphdefinition.GraphDefinition\"\n    )\n\n    GraphDefinitionLinkType = create_fhir_type(\n        \"GraphDefinitionLinkType\",\n        \"fhir.resources.R4B.graphdefinition.GraphDefinitionLink\",\n    )\n\n    GraphDefinitionLinkTargetType = create_fhir_type(\n        \"GraphDefinitionLinkTargetType\",\n        \"fhir.resources.R4B.graphdefinition.GraphDefinitionLinkTarget\",\n    )\n\n    GraphDefinitionLinkTargetCompartmentType = create_fhir_type(\n        \"GraphDefinitionLinkTargetCompartmentType\",\n        \"fhir.resources.R4B.graphdefinition.GraphDefinitionLinkTargetCompartment\",\n    )\n\n    GroupType = create_fhir_type(\"GroupType\", \"fhir.resources.R4B.group.Group\")\n\n    GroupCharacteristicType = create_fhir_type(\n        \"GroupCharacteristicType\", \"fhir.resources.R4B.group.GroupCharacteristic\"\n    )\n\n    GroupMemberType = create_fhir_type(\n        \"GroupMemberType\", \"fhir.resources.R4B.group.GroupMember\"\n    )\n\n    GuidanceResponseType = create_fhir_type(\n        \"GuidanceResponseType\", \"fhir.resources.R4B.guidanceresponse.GuidanceResponse\"\n    )\n\n    HealthcareServiceType = create_fhir_type(\n        \"HealthcareServiceType\",\n        \"fhir.resources.R4B.healthcareservice.HealthcareService\",\n    )\n\n    HealthcareServiceAvailableTimeType = create_fhir_type(\n        \"HealthcareServiceAvailableTimeType\",\n        \"fhir.resources.R4B.healthcareservice.HealthcareServiceAvailableTime\",\n    )\n\n    HealthcareServiceEligibilityType = create_fhir_type(\n        \"HealthcareServiceEligibilityType\",\n        \"fhir.resources.R4B.healthcareservice.HealthcareServiceEligibility\",\n    )\n\n    HealthcareServiceNotAvailableType = create_fhir_type(\n        \"HealthcareServiceNotAvailableType\",\n        \"fhir.resources.R4B.healthcareservice.HealthcareServiceNotAvailable\",\n    )\n\n    HumanNameType = create_fhir_type(\n        \"HumanNameType\", \"fhir.resources.R4B.humanname.HumanName\"\n    )\n\n    IdentifierType = create_fhir_type(\n        \"IdentifierType\", \"fhir.resources.R4B.identifier.Identifier\"\n    )\n\n    ImagingStudyType = create_fhir_type(\n        \"ImagingStudyType\", \"fhir.resources.R4B.imagingstudy.ImagingStudy\"\n    )\n\n    ImagingStudySeriesType = create_fhir_type(\n        \"ImagingStudySeriesType\", \"fhir.resources.R4B.imagingstudy.ImagingStudySeries\"\n    )\n\n    ImagingStudySeriesInstanceType = create_fhir_type(\n        \"ImagingStudySeriesInstanceType\",\n        \"fhir.resources.R4B.imagingstudy.ImagingStudySeriesInstance\",\n    )\n\n    ImagingStudySeriesPerformerType = create_fhir_type(\n        \"ImagingStudySeriesPerformerType\",\n        \"fhir.resources.R4B.imagingstudy.ImagingStudySeriesPerformer\",\n    )\n\n    ImmunizationType = create_fhir_type(\n        \"ImmunizationType\", \"fhir.resources.R4B.immunization.Immunization\"\n    )\n\n    ImmunizationEducationType = create_fhir_type(\n        \"ImmunizationEducationType\",\n        \"fhir.resources.R4B.immunization.ImmunizationEducation\",\n    )\n\n    ImmunizationEvaluationType = create_fhir_type(\n        \"ImmunizationEvaluationType\",\n        \"fhir.resources.R4B.immunizationevaluation.ImmunizationEvaluation\",\n    )\n\n    ImmunizationPerformerType = create_fhir_type(\n        \"ImmunizationPerformerType\",\n        \"fhir.resources.R4B.immunization.ImmunizationPerformer\",\n    )\n\n    ImmunizationProtocolAppliedType = create_fhir_type(\n        \"ImmunizationProtocolAppliedType\",\n        \"fhir.resources.R4B.immunization.ImmunizationProtocolApplied\",\n    )\n\n    ImmunizationReactionType = create_fhir_type(\n        \"ImmunizationReactionType\",\n        \"fhir.resources.R4B.immunization.ImmunizationReaction\",\n    )\n\n    ImmunizationRecommendationType = create_fhir_type(\n        \"ImmunizationRecommendationType\",\n        \"fhir.resources.R4B.immunizationrecommendation.ImmunizationRecommendation\",\n    )\n\n    ImmunizationRecommendationRecommendationType = create_fhir_type(\n        \"ImmunizationRecommendationRecommendationType\",\n        \"fhir.resources.R4B.immunizationrecommendation.ImmunizationRecommendationRecommendation\",\n    )\n\n    ImmunizationRecommendationRecommendationDateCriterionType = create_fhir_type(\n        \"ImmunizationRecommendationRecommendationDateCriterionType\",\n        \"fhir.resources.R4B.immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion\",\n    )\n\n    ImplementationGuideType = create_fhir_type(\n        \"ImplementationGuideType\",\n        \"fhir.resources.R4B.implementationguide.ImplementationGuide\",\n    )\n\n    ImplementationGuideDefinitionType = create_fhir_type(\n        \"ImplementationGuideDefinitionType\",\n        \"fhir.resources.R4B.implementationguide.ImplementationGuideDefinition\",\n    )\n\n    ImplementationGuideDefinitionGroupingType = create_fhir_type(\n        \"ImplementationGuideDefinitionGroupingType\",\n        \"fhir.resources.R4B.implementationguide.ImplementationGuideDefinitionGrouping\",\n    )\n\n    ImplementationGuideDefinitionPageType = create_fhir_type(\n        \"ImplementationGuideDefinitionPageType\",\n        \"fhir.resources.R4B.implementationguide.ImplementationGuideDefinitionPage\",\n    )\n\n    ImplementationGuideDefinitionParameterType = create_fhir_type(\n        \"ImplementationGuideDefinitionParameterType\",\n        \"fhir.resources.R4B.implementationguide.ImplementationGuideDefinitionParameter\",\n    )\n\n    ImplementationGuideDefinitionResourceType = create_fhir_type(\n        \"ImplementationGuideDefinitionResourceType\",\n        \"fhir.resources.R4B.implementationguide.ImplementationGuideDefinitionResource\",\n    )\n\n    ImplementationGuideDefinitionTemplateType = create_fhir_type(\n        \"ImplementationGuideDefinitionTemplateType\",\n        \"fhir.resources.R4B.implementationguide.ImplementationGuideDefinitionTemplate\",\n    )\n\n    ImplementationGuideDependsOnType = create_fhir_type(\n        \"ImplementationGuideDependsOnType\",\n        \"fhir.resources.R4B.implementationguide.ImplementationGuideDependsOn\",\n    )\n\n    ImplementationGuideGlobalType = create_fhir_type(\n        \"ImplementationGuideGlobalType\",\n        \"fhir.resources.R4B.implementationguide.ImplementationGuideGlobal\",\n    )\n\n    ImplementationGuideManifestType = create_fhir_type(\n        \"ImplementationGuideManifestType\",\n        \"fhir.resources.R4B.implementationguide.ImplementationGuideManifest\",\n    )\n\n    ImplementationGuideManifestPageType = create_fhir_type(\n        \"ImplementationGuideManifestPageType\",\n        \"fhir.resources.R4B.implementationguide.ImplementationGuideManifestPage\",\n    )\n\n    ImplementationGuideManifestResourceType = create_fhir_type(\n        \"ImplementationGuideManifestResourceType\",\n        \"fhir.resources.R4B.implementationguide.ImplementationGuideManifestResource\",\n    )\n\n    IngredientType = create_fhir_type(\n        \"IngredientType\", \"fhir.resources.R4B.ingredient.Ingredient\"\n    )\n\n    IngredientManufacturerType = create_fhir_type(\n        \"IngredientManufacturerType\",\n        \"fhir.resources.R4B.ingredient.IngredientManufacturer\",\n    )\n\n    IngredientSubstanceType = create_fhir_type(\n        \"IngredientSubstanceType\", \"fhir.resources.R4B.ingredient.IngredientSubstance\"\n    )\n\n    IngredientSubstanceStrengthType = create_fhir_type(\n        \"IngredientSubstanceStrengthType\",\n        \"fhir.resources.R4B.ingredient.IngredientSubstanceStrength\",\n    )\n\n    IngredientSubstanceStrengthReferenceStrengthType = create_fhir_type(\n        \"IngredientSubstanceStrengthReferenceStrengthType\",\n        \"fhir.resources.R4B.ingredient.IngredientSubstanceStrengthReferenceStrength\",\n    )\n\n    InsurancePlanType = create_fhir_type(\n        \"InsurancePlanType\", \"fhir.resources.R4B.insuranceplan.InsurancePlan\"\n    )\n\n    InsurancePlanContactType = create_fhir_type(\n        \"InsurancePlanContactType\",\n        \"fhir.resources.R4B.insuranceplan.InsurancePlanContact\",\n    )\n\n    InsurancePlanCoverageType = create_fhir_type(\n        \"InsurancePlanCoverageType\",\n        \"fhir.resources.R4B.insuranceplan.InsurancePlanCoverage\",\n    )\n\n    InsurancePlanCoverageBenefitType = create_fhir_type(\n        \"InsurancePlanCoverageBenefitType\",\n        \"fhir.resources.R4B.insuranceplan.InsurancePlanCoverageBenefit\",\n    )\n\n    InsurancePlanCoverageBenefitLimitType = create_fhir_type(\n        \"InsurancePlanCoverageBenefitLimitType\",\n        \"fhir.resources.R4B.insuranceplan.InsurancePlanCoverageBenefitLimit\",\n    )\n\n    InsurancePlanPlanType = create_fhir_type(\n        \"InsurancePlanPlanType\", \"fhir.resources.R4B.insuranceplan.InsurancePlanPlan\"\n    )\n\n    InsurancePlanPlanGeneralCostType = create_fhir_type(\n        \"InsurancePlanPlanGeneralCostType\",\n        \"fhir.resources.R4B.insuranceplan.InsurancePlanPlanGeneralCost\",\n    )\n\n    InsurancePlanPlanSpecificCostType = create_fhir_type(\n        \"InsurancePlanPlanSpecificCostType\",\n        \"fhir.resources.R4B.insuranceplan.InsurancePlanPlanSpecificCost\",\n    )\n\n    InsurancePlanPlanSpecificCostBenefitType = create_fhir_type(\n        \"InsurancePlanPlanSpecificCostBenefitType\",\n        \"fhir.resources.R4B.insuranceplan.InsurancePlanPlanSpecificCostBenefit\",\n    )\n\n    InsurancePlanPlanSpecificCostBenefitCostType = create_fhir_type(\n        \"InsurancePlanPlanSpecificCostBenefitCostType\",\n        \"fhir.resources.R4B.insuranceplan.InsurancePlanPlanSpecificCostBenefitCost\",\n    )\n\n    InvoiceType = create_fhir_type(\"InvoiceType\", \"fhir.resources.R4B.invoice.Invoice\")\n\n    InvoiceLineItemType = create_fhir_type(\n        \"InvoiceLineItemType\", \"fhir.resources.R4B.invoice.InvoiceLineItem\"\n    )\n\n    InvoiceLineItemPriceComponentType = create_fhir_type(\n        \"InvoiceLineItemPriceComponentType\",\n        \"fhir.resources.R4B.invoice.InvoiceLineItemPriceComponent\",\n    )\n\n    InvoiceParticipantType = create_fhir_type(\n        \"InvoiceParticipantType\", \"fhir.resources.R4B.invoice.InvoiceParticipant\"\n    )\n\n    LibraryType = create_fhir_type(\"LibraryType\", \"fhir.resources.R4B.library.Library\")\n\n    LinkageType = create_fhir_type(\"LinkageType\", \"fhir.resources.R4B.linkage.Linkage\")\n\n    LinkageItemType = create_fhir_type(\n        \"LinkageItemType\", \"fhir.resources.R4B.linkage.LinkageItem\"\n    )\n\n    ListType = create_fhir_type(\"ListType\", \"fhir.resources.R4B.list.List\")\n\n    ListEntryType = create_fhir_type(\n        \"ListEntryType\", \"fhir.resources.R4B.list.ListEntry\"\n    )\n\n    LocationType = create_fhir_type(\n        \"LocationType\", \"fhir.resources.R4B.location.Location\"\n    )\n\n    LocationHoursOfOperationType = create_fhir_type(\n        \"LocationHoursOfOperationType\",\n        \"fhir.resources.R4B.location.LocationHoursOfOperation\",\n    )\n\n    LocationPositionType = create_fhir_type(\n        \"LocationPositionType\", \"fhir.resources.R4B.location.LocationPosition\"\n    )\n\n    ManufacturedItemDefinitionType = create_fhir_type(\n        \"ManufacturedItemDefinitionType\",\n        \"fhir.resources.R4B.manufactureditemdefinition.ManufacturedItemDefinition\",\n    )\n\n    ManufacturedItemDefinitionPropertyType = create_fhir_type(\n        \"ManufacturedItemDefinitionPropertyType\",\n        \"fhir.resources.R4B.manufactureditemdefinition.ManufacturedItemDefinitionProperty\",\n    )\n\n    MarketingStatusType = create_fhir_type(\n        \"MarketingStatusType\", \"fhir.resources.R4B.marketingstatus.MarketingStatus\"\n    )\n\n    MeasureType = create_fhir_type(\"MeasureType\", \"fhir.resources.R4B.measure.Measure\")\n\n    MeasureGroupType = create_fhir_type(\n        \"MeasureGroupType\", \"fhir.resources.R4B.measure.MeasureGroup\"\n    )\n\n    MeasureGroupPopulationType = create_fhir_type(\n        \"MeasureGroupPopulationType\",\n        \"fhir.resources.R4B.measure.MeasureGroupPopulation\",\n    )\n\n    MeasureGroupStratifierType = create_fhir_type(\n        \"MeasureGroupStratifierType\",\n        \"fhir.resources.R4B.measure.MeasureGroupStratifier\",\n    )\n\n    MeasureGroupStratifierComponentType = create_fhir_type(\n        \"MeasureGroupStratifierComponentType\",\n        \"fhir.resources.R4B.measure.MeasureGroupStratifierComponent\",\n    )\n\n    MeasureReportType = create_fhir_type(\n        \"MeasureReportType\", \"fhir.resources.R4B.measurereport.MeasureReport\"\n    )\n\n    MeasureReportGroupType = create_fhir_type(\n        \"MeasureReportGroupType\", \"fhir.resources.R4B.measurereport.MeasureReportGroup\"\n    )\n\n    MeasureReportGroupPopulationType = create_fhir_type(\n        \"MeasureReportGroupPopulationType\",\n        \"fhir.resources.R4B.measurereport.MeasureReportGroupPopulation\",\n    )\n\n    MeasureReportGroupStratifierType = create_fhir_type(\n        \"MeasureReportGroupStratifierType\",\n        \"fhir.resources.R4B.measurereport.MeasureReportGroupStratifier\",\n    )\n\n    MeasureReportGroupStratifierStratumType = create_fhir_type(\n        \"MeasureReportGroupStratifierStratumType\",\n        \"fhir.resources.R4B.measurereport.MeasureReportGroupStratifierStratum\",\n    )\n\n    MeasureReportGroupStratifierStratumComponentType = create_fhir_type(\n        \"MeasureReportGroupStratifierStratumComponentType\",\n        \"fhir.resources.R4B.measurereport.MeasureReportGroupStratifierStratumComponent\",\n    )\n\n    MeasureReportGroupStratifierStratumPopulationType = create_fhir_type(\n        \"MeasureReportGroupStratifierStratumPopulationType\",\n        \"fhir.resources.R4B.measurereport.MeasureReportGroupStratifierStratumPopulation\",\n    )\n\n    MeasureSupplementalDataType = create_fhir_type(\n        \"MeasureSupplementalDataType\",\n        \"fhir.resources.R4B.measure.MeasureSupplementalData\",\n    )\n\n    MediaType = create_fhir_type(\"MediaType\", \"fhir.resources.R4B.media.Media\")\n\n    MedicationType = create_fhir_type(\n        \"MedicationType\", \"fhir.resources.R4B.medication.Medication\"\n    )\n\n    MedicationAdministrationType = create_fhir_type(\n        \"MedicationAdministrationType\",\n        \"fhir.resources.R4B.medicationadministration.MedicationAdministration\",\n    )\n\n    MedicationAdministrationDosageType = create_fhir_type(\n        \"MedicationAdministrationDosageType\",\n        \"fhir.resources.R4B.medicationadministration.MedicationAdministrationDosage\",\n    )\n\n    MedicationAdministrationPerformerType = create_fhir_type(\n        \"MedicationAdministrationPerformerType\",\n        \"fhir.resources.R4B.medicationadministration.MedicationAdministrationPerformer\",\n    )\n\n    MedicationBatchType = create_fhir_type(\n        \"MedicationBatchType\", \"fhir.resources.R4B.medication.MedicationBatch\"\n    )\n\n    MedicationDispenseType = create_fhir_type(\n        \"MedicationDispenseType\",\n        \"fhir.resources.R4B.medicationdispense.MedicationDispense\",\n    )\n\n    MedicationDispensePerformerType = create_fhir_type(\n        \"MedicationDispensePerformerType\",\n        \"fhir.resources.R4B.medicationdispense.MedicationDispensePerformer\",\n    )\n\n    MedicationDispenseSubstitutionType = create_fhir_type(\n        \"MedicationDispenseSubstitutionType\",\n        \"fhir.resources.R4B.medicationdispense.MedicationDispenseSubstitution\",\n    )\n\n    MedicationIngredientType = create_fhir_type(\n        \"MedicationIngredientType\", \"fhir.resources.R4B.medication.MedicationIngredient\"\n    )\n\n    MedicationKnowledgeType = create_fhir_type(\n        \"MedicationKnowledgeType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledge\",\n    )\n\n    MedicationKnowledgeAdministrationGuidelinesType = create_fhir_type(\n        \"MedicationKnowledgeAdministrationGuidelinesType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeAdministrationGuidelines\",\n    )\n\n    MedicationKnowledgeAdministrationGuidelinesDosageType = create_fhir_type(\n        \"MedicationKnowledgeAdministrationGuidelinesDosageType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeAdministrationGuidelinesDosage\",\n    )\n\n    MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsType = create_fhir_type(\n        \"MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics\",\n    )\n\n    MedicationKnowledgeCostType = create_fhir_type(\n        \"MedicationKnowledgeCostType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeCost\",\n    )\n\n    MedicationKnowledgeDrugCharacteristicType = create_fhir_type(\n        \"MedicationKnowledgeDrugCharacteristicType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeDrugCharacteristic\",\n    )\n\n    MedicationKnowledgeIngredientType = create_fhir_type(\n        \"MedicationKnowledgeIngredientType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeIngredient\",\n    )\n\n    MedicationKnowledgeKineticsType = create_fhir_type(\n        \"MedicationKnowledgeKineticsType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeKinetics\",\n    )\n\n    MedicationKnowledgeMedicineClassificationType = create_fhir_type(\n        \"MedicationKnowledgeMedicineClassificationType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeMedicineClassification\",\n    )\n\n    MedicationKnowledgeMonitoringProgramType = create_fhir_type(\n        \"MedicationKnowledgeMonitoringProgramType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeMonitoringProgram\",\n    )\n\n    MedicationKnowledgeMonographType = create_fhir_type(\n        \"MedicationKnowledgeMonographType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeMonograph\",\n    )\n\n    MedicationKnowledgePackagingType = create_fhir_type(\n        \"MedicationKnowledgePackagingType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgePackaging\",\n    )\n\n    MedicationKnowledgeRegulatoryType = create_fhir_type(\n        \"MedicationKnowledgeRegulatoryType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeRegulatory\",\n    )\n\n    MedicationKnowledgeRegulatoryMaxDispenseType = create_fhir_type(\n        \"MedicationKnowledgeRegulatoryMaxDispenseType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeRegulatoryMaxDispense\",\n    )\n\n    MedicationKnowledgeRegulatoryScheduleType = create_fhir_type(\n        \"MedicationKnowledgeRegulatoryScheduleType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeRegulatorySchedule\",\n    )\n\n    MedicationKnowledgeRegulatorySubstitutionType = create_fhir_type(\n        \"MedicationKnowledgeRegulatorySubstitutionType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeRegulatorySubstitution\",\n    )\n\n    MedicationKnowledgeRelatedMedicationKnowledgeType = create_fhir_type(\n        \"MedicationKnowledgeRelatedMedicationKnowledgeType\",\n        \"fhir.resources.R4B.medicationknowledge.MedicationKnowledgeRelatedMedicationKnowledge\",\n    )\n\n    MedicationRequestType = create_fhir_type(\n        \"MedicationRequestType\",\n        \"fhir.resources.R4B.medicationrequest.MedicationRequest\",\n    )\n\n    MedicationRequestDispenseRequestType = create_fhir_type(\n        \"MedicationRequestDispenseRequestType\",\n        \"fhir.resources.R4B.medicationrequest.MedicationRequestDispenseRequest\",\n    )\n\n    MedicationRequestDispenseRequestInitialFillType = create_fhir_type(\n        \"MedicationRequestDispenseRequestInitialFillType\",\n        \"fhir.resources.R4B.medicationrequest.MedicationRequestDispenseRequestInitialFill\",\n    )\n\n    MedicationRequestSubstitutionType = create_fhir_type(\n        \"MedicationRequestSubstitutionType\",\n        \"fhir.resources.R4B.medicationrequest.MedicationRequestSubstitution\",\n    )\n\n    MedicationStatementType = create_fhir_type(\n        \"MedicationStatementType\",\n        \"fhir.resources.R4B.medicationstatement.MedicationStatement\",\n    )\n\n    MedicinalProductDefinitionType = create_fhir_type(\n        \"MedicinalProductDefinitionType\",\n        \"fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinition\",\n    )\n\n    MedicinalProductDefinitionCharacteristicType = create_fhir_type(\n        \"MedicinalProductDefinitionCharacteristicType\",\n        \"fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionCharacteristic\",\n    )\n\n    MedicinalProductDefinitionContactType = create_fhir_type(\n        \"MedicinalProductDefinitionContactType\",\n        \"fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionContact\",\n    )\n\n    MedicinalProductDefinitionCrossReferenceType = create_fhir_type(\n        \"MedicinalProductDefinitionCrossReferenceType\",\n        \"fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionCrossReference\",\n    )\n\n    MedicinalProductDefinitionNameType = create_fhir_type(\n        \"MedicinalProductDefinitionNameType\",\n        \"fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionName\",\n    )\n\n    MedicinalProductDefinitionNameCountryLanguageType = create_fhir_type(\n        \"MedicinalProductDefinitionNameCountryLanguageType\",\n        \"fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionNameCountryLanguage\",\n    )\n\n    MedicinalProductDefinitionNameNamePartType = create_fhir_type(\n        \"MedicinalProductDefinitionNameNamePartType\",\n        \"fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionNameNamePart\",\n    )\n\n    MedicinalProductDefinitionOperationType = create_fhir_type(\n        \"MedicinalProductDefinitionOperationType\",\n        \"fhir.resources.R4B.medicinalproductdefinition.MedicinalProductDefinitionOperation\",\n    )\n\n    MessageDefinitionType = create_fhir_type(\n        \"MessageDefinitionType\",\n        \"fhir.resources.R4B.messagedefinition.MessageDefinition\",\n    )\n\n    MessageDefinitionAllowedResponseType = create_fhir_type(\n        \"MessageDefinitionAllowedResponseType\",\n        \"fhir.resources.R4B.messagedefinition.MessageDefinitionAllowedResponse\",\n    )\n\n    MessageDefinitionFocusType = create_fhir_type(\n        \"MessageDefinitionFocusType\",\n        \"fhir.resources.R4B.messagedefinition.MessageDefinitionFocus\",\n    )\n\n    MessageHeaderType = create_fhir_type(\n        \"MessageHeaderType\", \"fhir.resources.R4B.messageheader.MessageHeader\"\n    )\n\n    MessageHeaderDestinationType = create_fhir_type(\n        \"MessageHeaderDestinationType\",\n        \"fhir.resources.R4B.messageheader.MessageHeaderDestination\",\n    )\n\n    MessageHeaderResponseType = create_fhir_type(\n        \"MessageHeaderResponseType\",\n        \"fhir.resources.R4B.messageheader.MessageHeaderResponse\",\n    )\n\n    MessageHeaderSourceType = create_fhir_type(\n        \"MessageHeaderSourceType\",\n        \"fhir.resources.R4B.messageheader.MessageHeaderSource\",\n    )\n\n    MetaType = create_fhir_type(\"MetaType\", \"fhir.resources.R4B.meta.Meta\")\n\n    MolecularSequenceType = create_fhir_type(\n        \"MolecularSequenceType\",\n        \"fhir.resources.R4B.molecularsequence.MolecularSequence\",\n    )\n\n    MolecularSequenceQualityType = create_fhir_type(\n        \"MolecularSequenceQualityType\",\n        \"fhir.resources.R4B.molecularsequence.MolecularSequenceQuality\",\n    )\n\n    MolecularSequenceQualityRocType = create_fhir_type(\n        \"MolecularSequenceQualityRocType\",\n        \"fhir.resources.R4B.molecularsequence.MolecularSequenceQualityRoc\",\n    )\n\n    MolecularSequenceReferenceSeqType = create_fhir_type(\n        \"MolecularSequenceReferenceSeqType\",\n        \"fhir.resources.R4B.molecularsequence.MolecularSequenceReferenceSeq\",\n    )\n\n    MolecularSequenceRepositoryType = create_fhir_type(\n        \"MolecularSequenceRepositoryType\",\n        \"fhir.resources.R4B.molecularsequence.MolecularSequenceRepository\",\n    )\n\n    MolecularSequenceStructureVariantType = create_fhir_type(\n        \"MolecularSequenceStructureVariantType\",\n        \"fhir.resources.R4B.molecularsequence.MolecularSequenceStructureVariant\",\n    )\n\n    MolecularSequenceStructureVariantInnerType = create_fhir_type(\n        \"MolecularSequenceStructureVariantInnerType\",\n        \"fhir.resources.R4B.molecularsequence.MolecularSequenceStructureVariantInner\",\n    )\n\n    MolecularSequenceStructureVariantOuterType = create_fhir_type(\n        \"MolecularSequenceStructureVariantOuterType\",\n        \"fhir.resources.R4B.molecularsequence.MolecularSequenceStructureVariantOuter\",\n    )\n\n    MolecularSequenceVariantType = create_fhir_type(\n        \"MolecularSequenceVariantType\",\n        \"fhir.resources.R4B.molecularsequence.MolecularSequenceVariant\",\n    )\n\n    MoneyType = create_fhir_type(\"MoneyType\", \"fhir.resources.R4B.money.Money\")\n\n    NamingSystemType = create_fhir_type(\n        \"NamingSystemType\", \"fhir.resources.R4B.namingsystem.NamingSystem\"\n    )\n\n    NamingSystemUniqueIdType = create_fhir_type(\n        \"NamingSystemUniqueIdType\",\n        \"fhir.resources.R4B.namingsystem.NamingSystemUniqueId\",\n    )\n\n    NarrativeType = create_fhir_type(\n        \"NarrativeType\", \"fhir.resources.R4B.narrative.Narrative\"\n    )\n\n    NutritionOrderType = create_fhir_type(\n        \"NutritionOrderType\", \"fhir.resources.R4B.nutritionorder.NutritionOrder\"\n    )\n\n    NutritionOrderEnteralFormulaType = create_fhir_type(\n        \"NutritionOrderEnteralFormulaType\",\n        \"fhir.resources.R4B.nutritionorder.NutritionOrderEnteralFormula\",\n    )\n\n    NutritionOrderEnteralFormulaAdministrationType = create_fhir_type(\n        \"NutritionOrderEnteralFormulaAdministrationType\",\n        \"fhir.resources.R4B.nutritionorder.NutritionOrderEnteralFormulaAdministration\",\n    )\n\n    NutritionOrderOralDietType = create_fhir_type(\n        \"NutritionOrderOralDietType\",\n        \"fhir.resources.R4B.nutritionorder.NutritionOrderOralDiet\",\n    )\n\n    NutritionOrderOralDietNutrientType = create_fhir_type(\n        \"NutritionOrderOralDietNutrientType\",\n        \"fhir.resources.R4B.nutritionorder.NutritionOrderOralDietNutrient\",\n    )\n\n    NutritionOrderOralDietTextureType = create_fhir_type(\n        \"NutritionOrderOralDietTextureType\",\n        \"fhir.resources.R4B.nutritionorder.NutritionOrderOralDietTexture\",\n    )\n\n    NutritionOrderSupplementType = create_fhir_type(\n        \"NutritionOrderSupplementType\",\n        \"fhir.resources.R4B.nutritionorder.NutritionOrderSupplement\",\n    )\n\n    NutritionProductType = create_fhir_type(\n        \"NutritionProductType\", \"fhir.resources.R4B.nutritionproduct.NutritionProduct\"\n    )\n\n    NutritionProductIngredientType = create_fhir_type(\n        \"NutritionProductIngredientType\",\n        \"fhir.resources.R4B.nutritionproduct.NutritionProductIngredient\",\n    )\n\n    NutritionProductInstanceType = create_fhir_type(\n        \"NutritionProductInstanceType\",\n        \"fhir.resources.R4B.nutritionproduct.NutritionProductInstance\",\n    )\n\n    NutritionProductNutrientType = create_fhir_type(\n        \"NutritionProductNutrientType\",\n        \"fhir.resources.R4B.nutritionproduct.NutritionProductNutrient\",\n    )\n\n    NutritionProductProductCharacteristicType = create_fhir_type(\n        \"NutritionProductProductCharacteristicType\",\n        \"fhir.resources.R4B.nutritionproduct.NutritionProductProductCharacteristic\",\n    )\n\n    ObservationType = create_fhir_type(\n        \"ObservationType\", \"fhir.resources.R4B.observation.Observation\"\n    )\n\n    ObservationComponentType = create_fhir_type(\n        \"ObservationComponentType\",\n        \"fhir.resources.R4B.observation.ObservationComponent\",\n    )\n\n    ObservationDefinitionType = create_fhir_type(\n        \"ObservationDefinitionType\",\n        \"fhir.resources.R4B.observationdefinition.ObservationDefinition\",\n    )\n\n    ObservationDefinitionQualifiedIntervalType = create_fhir_type(\n        \"ObservationDefinitionQualifiedIntervalType\",\n        \"fhir.resources.R4B.observationdefinition.ObservationDefinitionQualifiedInterval\",\n    )\n\n    ObservationDefinitionQuantitativeDetailsType = create_fhir_type(\n        \"ObservationDefinitionQuantitativeDetailsType\",\n        \"fhir.resources.R4B.observationdefinition.ObservationDefinitionQuantitativeDetails\",\n    )\n\n    ObservationReferenceRangeType = create_fhir_type(\n        \"ObservationReferenceRangeType\",\n        \"fhir.resources.R4B.observation.ObservationReferenceRange\",\n    )\n\n    OperationDefinitionType = create_fhir_type(\n        \"OperationDefinitionType\",\n        \"fhir.resources.R4B.operationdefinition.OperationDefinition\",\n    )\n\n    OperationDefinitionOverloadType = create_fhir_type(\n        \"OperationDefinitionOverloadType\",\n        \"fhir.resources.R4B.operationdefinition.OperationDefinitionOverload\",\n    )\n\n    OperationDefinitionParameterType = create_fhir_type(\n        \"OperationDefinitionParameterType\",\n        \"fhir.resources.R4B.operationdefinition.OperationDefinitionParameter\",\n    )\n\n    OperationDefinitionParameterBindingType = create_fhir_type(\n        \"OperationDefinitionParameterBindingType\",\n        \"fhir.resources.R4B.operationdefinition.OperationDefinitionParameterBinding\",\n    )\n\n    OperationDefinitionParameterReferencedFromType = create_fhir_type(\n        \"OperationDefinitionParameterReferencedFromType\",\n        \"fhir.resources.R4B.operationdefinition.OperationDefinitionParameterReferencedFrom\",\n    )\n\n    OperationOutcomeType = create_fhir_type(\n        \"OperationOutcomeType\", \"fhir.resources.R4B.operationoutcome.OperationOutcome\"\n    )\n\n    OperationOutcomeIssueType = create_fhir_type(\n        \"OperationOutcomeIssueType\",\n        \"fhir.resources.R4B.operationoutcome.OperationOutcomeIssue\",\n    )\n\n    OrganizationType = create_fhir_type(\n        \"OrganizationType\", \"fhir.resources.R4B.organization.Organization\"\n    )\n\n    OrganizationAffiliationType = create_fhir_type(\n        \"OrganizationAffiliationType\",\n        \"fhir.resources.R4B.organizationaffiliation.OrganizationAffiliation\",\n    )\n\n    OrganizationContactType = create_fhir_type(\n        \"OrganizationContactType\", \"fhir.resources.R4B.organization.OrganizationContact\"\n    )\n\n    PackagedProductDefinitionType = create_fhir_type(\n        \"PackagedProductDefinitionType\",\n        \"fhir.resources.R4B.packagedproductdefinition.PackagedProductDefinition\",\n    )\n\n    PackagedProductDefinitionLegalStatusOfSupplyType = create_fhir_type(\n        \"PackagedProductDefinitionLegalStatusOfSupplyType\",\n        \"fhir.resources.R4B.packagedproductdefinition.PackagedProductDefinitionLegalStatusOfSupply\",\n    )\n\n    PackagedProductDefinitionPackageType = create_fhir_type(\n        \"PackagedProductDefinitionPackageType\",\n        \"fhir.resources.R4B.packagedproductdefinition.PackagedProductDefinitionPackage\",\n    )\n\n    PackagedProductDefinitionPackageContainedItemType = create_fhir_type(\n        \"PackagedProductDefinitionPackageContainedItemType\",\n        \"fhir.resources.R4B.packagedproductdefinition.PackagedProductDefinitionPackageContainedItem\",\n    )\n\n    PackagedProductDefinitionPackagePropertyType = create_fhir_type(\n        \"PackagedProductDefinitionPackagePropertyType\",\n        \"fhir.resources.R4B.packagedproductdefinition.PackagedProductDefinitionPackageProperty\",\n    )\n\n    PackagedProductDefinitionPackageShelfLifeStorageType = create_fhir_type(\n        \"PackagedProductDefinitionPackageShelfLifeStorageType\",\n        \"fhir.resources.R4B.packagedproductdefinition.PackagedProductDefinitionPackageShelfLifeStorage\",\n    )\n\n    ParameterDefinitionType = create_fhir_type(\n        \"ParameterDefinitionType\",\n        \"fhir.resources.R4B.parameterdefinition.ParameterDefinition\",\n    )\n\n    ParametersType = create_fhir_type(\n        \"ParametersType\", \"fhir.resources.R4B.parameters.Parameters\"\n    )\n\n    ParametersParameterType = create_fhir_type(\n        \"ParametersParameterType\", \"fhir.resources.R4B.parameters.ParametersParameter\"\n    )\n\n    PatientType = create_fhir_type(\"PatientType\", \"fhir.resources.R4B.patient.Patient\")\n\n    PatientCommunicationType = create_fhir_type(\n        \"PatientCommunicationType\", \"fhir.resources.R4B.patient.PatientCommunication\"\n    )\n\n    PatientContactType = create_fhir_type(\n        \"PatientContactType\", \"fhir.resources.R4B.patient.PatientContact\"\n    )\n\n    PatientLinkType = create_fhir_type(\n        \"PatientLinkType\", \"fhir.resources.R4B.patient.PatientLink\"\n    )\n\n    PaymentNoticeType = create_fhir_type(\n        \"PaymentNoticeType\", \"fhir.resources.R4B.paymentnotice.PaymentNotice\"\n    )\n\n    PaymentReconciliationType = create_fhir_type(\n        \"PaymentReconciliationType\",\n        \"fhir.resources.R4B.paymentreconciliation.PaymentReconciliation\",\n    )\n\n    PaymentReconciliationDetailType = create_fhir_type(\n        \"PaymentReconciliationDetailType\",\n        \"fhir.resources.R4B.paymentreconciliation.PaymentReconciliationDetail\",\n    )\n\n    PaymentReconciliationProcessNoteType = create_fhir_type(\n        \"PaymentReconciliationProcessNoteType\",\n        \"fhir.resources.R4B.paymentreconciliation.PaymentReconciliationProcessNote\",\n    )\n\n    PeriodType = create_fhir_type(\"PeriodType\", \"fhir.resources.R4B.period.Period\")\n\n    PersonType = create_fhir_type(\"PersonType\", \"fhir.resources.R4B.person.Person\")\n\n    PersonLinkType = create_fhir_type(\n        \"PersonLinkType\", \"fhir.resources.R4B.person.PersonLink\"\n    )\n\n    PlanDefinitionType = create_fhir_type(\n        \"PlanDefinitionType\", \"fhir.resources.R4B.plandefinition.PlanDefinition\"\n    )\n\n    PlanDefinitionActionType = create_fhir_type(\n        \"PlanDefinitionActionType\",\n        \"fhir.resources.R4B.plandefinition.PlanDefinitionAction\",\n    )\n\n    PlanDefinitionActionConditionType = create_fhir_type(\n        \"PlanDefinitionActionConditionType\",\n        \"fhir.resources.R4B.plandefinition.PlanDefinitionActionCondition\",\n    )\n\n    PlanDefinitionActionDynamicValueType = create_fhir_type(\n        \"PlanDefinitionActionDynamicValueType\",\n        \"fhir.resources.R4B.plandefinition.PlanDefinitionActionDynamicValue\",\n    )\n\n    PlanDefinitionActionParticipantType = create_fhir_type(\n        \"PlanDefinitionActionParticipantType\",\n        \"fhir.resources.R4B.plandefinition.PlanDefinitionActionParticipant\",\n    )\n\n    PlanDefinitionActionRelatedActionType = create_fhir_type(\n        \"PlanDefinitionActionRelatedActionType\",\n        \"fhir.resources.R4B.plandefinition.PlanDefinitionActionRelatedAction\",\n    )\n\n    PlanDefinitionGoalType = create_fhir_type(\n        \"PlanDefinitionGoalType\", \"fhir.resources.R4B.plandefinition.PlanDefinitionGoal\"\n    )\n\n    PlanDefinitionGoalTargetType = create_fhir_type(\n        \"PlanDefinitionGoalTargetType\",\n        \"fhir.resources.R4B.plandefinition.PlanDefinitionGoalTarget\",\n    )\n\n    PopulationType = create_fhir_type(\n        \"PopulationType\", \"fhir.resources.R4B.population.Population\"\n    )\n\n    PractitionerType = create_fhir_type(\n        \"PractitionerType\", \"fhir.resources.R4B.practitioner.Practitioner\"\n    )\n\n    PractitionerQualificationType = create_fhir_type(\n        \"PractitionerQualificationType\",\n        \"fhir.resources.R4B.practitioner.PractitionerQualification\",\n    )\n\n    PractitionerRoleType = create_fhir_type(\n        \"PractitionerRoleType\", \"fhir.resources.R4B.practitionerrole.PractitionerRole\"\n    )\n\n    PractitionerRoleAvailableTimeType = create_fhir_type(\n        \"PractitionerRoleAvailableTimeType\",\n        \"fhir.resources.R4B.practitionerrole.PractitionerRoleAvailableTime\",\n    )\n\n    PractitionerRoleNotAvailableType = create_fhir_type(\n        \"PractitionerRoleNotAvailableType\",\n        \"fhir.resources.R4B.practitionerrole.PractitionerRoleNotAvailable\",\n    )\n\n    ProcedureType = create_fhir_type(\n        \"ProcedureType\", \"fhir.resources.R4B.procedure.Procedure\"\n    )\n\n    ProcedureFocalDeviceType = create_fhir_type(\n        \"ProcedureFocalDeviceType\", \"fhir.resources.R4B.procedure.ProcedureFocalDevice\"\n    )\n\n    ProcedurePerformerType = create_fhir_type(\n        \"ProcedurePerformerType\", \"fhir.resources.R4B.procedure.ProcedurePerformer\"\n    )\n\n    ProdCharacteristicType = create_fhir_type(\n        \"ProdCharacteristicType\",\n        \"fhir.resources.R4B.prodcharacteristic.ProdCharacteristic\",\n    )\n\n    ProductShelfLifeType = create_fhir_type(\n        \"ProductShelfLifeType\", \"fhir.resources.R4B.productshelflife.ProductShelfLife\"\n    )\n\n    ProvenanceType = create_fhir_type(\n        \"ProvenanceType\", \"fhir.resources.R4B.provenance.Provenance\"\n    )\n\n    ProvenanceAgentType = create_fhir_type(\n        \"ProvenanceAgentType\", \"fhir.resources.R4B.provenance.ProvenanceAgent\"\n    )\n\n    ProvenanceEntityType = create_fhir_type(\n        \"ProvenanceEntityType\", \"fhir.resources.R4B.provenance.ProvenanceEntity\"\n    )\n\n    QuantityType = create_fhir_type(\n        \"QuantityType\", \"fhir.resources.R4B.quantity.Quantity\"\n    )\n\n    QuestionnaireType = create_fhir_type(\n        \"QuestionnaireType\", \"fhir.resources.R4B.questionnaire.Questionnaire\"\n    )\n\n    QuestionnaireItemType = create_fhir_type(\n        \"QuestionnaireItemType\", \"fhir.resources.R4B.questionnaire.QuestionnaireItem\"\n    )\n\n    QuestionnaireItemAnswerOptionType = create_fhir_type(\n        \"QuestionnaireItemAnswerOptionType\",\n        \"fhir.resources.R4B.questionnaire.QuestionnaireItemAnswerOption\",\n    )\n\n    QuestionnaireItemEnableWhenType = create_fhir_type(\n        \"QuestionnaireItemEnableWhenType\",\n        \"fhir.resources.R4B.questionnaire.QuestionnaireItemEnableWhen\",\n    )\n\n    QuestionnaireItemInitialType = create_fhir_type(\n        \"QuestionnaireItemInitialType\",\n        \"fhir.resources.R4B.questionnaire.QuestionnaireItemInitial\",\n    )\n\n    QuestionnaireResponseType = create_fhir_type(\n        \"QuestionnaireResponseType\",\n        \"fhir.resources.R4B.questionnaireresponse.QuestionnaireResponse\",\n    )\n\n    QuestionnaireResponseItemType = create_fhir_type(\n        \"QuestionnaireResponseItemType\",\n        \"fhir.resources.R4B.questionnaireresponse.QuestionnaireResponseItem\",\n    )\n\n    QuestionnaireResponseItemAnswerType = create_fhir_type(\n        \"QuestionnaireResponseItemAnswerType\",\n        \"fhir.resources.R4B.questionnaireresponse.QuestionnaireResponseItemAnswer\",\n    )\n\n    RangeType = create_fhir_type(\"RangeType\", \"fhir.resources.R4B.range.Range\")\n\n    RatioType = create_fhir_type(\"RatioType\", \"fhir.resources.R4B.ratio.Ratio\")\n\n    RatioRangeType = create_fhir_type(\n        \"RatioRangeType\", \"fhir.resources.R4B.ratiorange.RatioRange\"\n    )\n\n    ReferenceType = create_fhir_type(\n        \"ReferenceType\", \"fhir.resources.R4B.reference.Reference\"\n    )\n\n    RegulatedAuthorizationType = create_fhir_type(\n        \"RegulatedAuthorizationType\",\n        \"fhir.resources.R4B.regulatedauthorization.RegulatedAuthorization\",\n    )\n\n    RegulatedAuthorizationCaseType = create_fhir_type(\n        \"RegulatedAuthorizationCaseType\",\n        \"fhir.resources.R4B.regulatedauthorization.RegulatedAuthorizationCase\",\n    )\n\n    RelatedArtifactType = create_fhir_type(\n        \"RelatedArtifactType\", \"fhir.resources.R4B.relatedartifact.RelatedArtifact\"\n    )\n\n    RelatedPersonType = create_fhir_type(\n        \"RelatedPersonType\", \"fhir.resources.R4B.relatedperson.RelatedPerson\"\n    )\n\n    RelatedPersonCommunicationType = create_fhir_type(\n        \"RelatedPersonCommunicationType\",\n        \"fhir.resources.R4B.relatedperson.RelatedPersonCommunication\",\n    )\n\n    RequestGroupType = create_fhir_type(\n        \"RequestGroupType\", \"fhir.resources.R4B.requestgroup.RequestGroup\"\n    )\n\n    RequestGroupActionType = create_fhir_type(\n        \"RequestGroupActionType\", \"fhir.resources.R4B.requestgroup.RequestGroupAction\"\n    )\n\n    RequestGroupActionConditionType = create_fhir_type(\n        \"RequestGroupActionConditionType\",\n        \"fhir.resources.R4B.requestgroup.RequestGroupActionCondition\",\n    )\n\n    RequestGroupActionRelatedActionType = create_fhir_type(\n        \"RequestGroupActionRelatedActionType\",\n        \"fhir.resources.R4B.requestgroup.RequestGroupActionRelatedAction\",\n    )\n\n    ResearchDefinitionType = create_fhir_type(\n        \"ResearchDefinitionType\",\n        \"fhir.resources.R4B.researchdefinition.ResearchDefinition\",\n    )\n\n    ResearchElementDefinitionType = create_fhir_type(\n        \"ResearchElementDefinitionType\",\n        \"fhir.resources.R4B.researchelementdefinition.ResearchElementDefinition\",\n    )\n\n    ResearchElementDefinitionCharacteristicType = create_fhir_type(\n        \"ResearchElementDefinitionCharacteristicType\",\n        \"fhir.resources.R4B.researchelementdefinition.ResearchElementDefinitionCharacteristic\",\n    )\n\n    ResearchStudyType = create_fhir_type(\n        \"ResearchStudyType\", \"fhir.resources.R4B.researchstudy.ResearchStudy\"\n    )\n\n    ResearchStudyArmType = create_fhir_type(\n        \"ResearchStudyArmType\", \"fhir.resources.R4B.researchstudy.ResearchStudyArm\"\n    )\n\n    ResearchStudyObjectiveType = create_fhir_type(\n        \"ResearchStudyObjectiveType\",\n        \"fhir.resources.R4B.researchstudy.ResearchStudyObjective\",\n    )\n\n    ResearchSubjectType = create_fhir_type(\n        \"ResearchSubjectType\", \"fhir.resources.R4B.researchsubject.ResearchSubject\"\n    )\n\n    RiskAssessmentType = create_fhir_type(\n        \"RiskAssessmentType\", \"fhir.resources.R4B.riskassessment.RiskAssessment\"\n    )\n\n    RiskAssessmentPredictionType = create_fhir_type(\n        \"RiskAssessmentPredictionType\",\n        \"fhir.resources.R4B.riskassessment.RiskAssessmentPrediction\",\n    )\n\n    SampledDataType = create_fhir_type(\n        \"SampledDataType\", \"fhir.resources.R4B.sampleddata.SampledData\"\n    )\n\n    ScheduleType = create_fhir_type(\n        \"ScheduleType\", \"fhir.resources.R4B.schedule.Schedule\"\n    )\n\n    SearchParameterType = create_fhir_type(\n        \"SearchParameterType\", \"fhir.resources.R4B.searchparameter.SearchParameter\"\n    )\n\n    SearchParameterComponentType = create_fhir_type(\n        \"SearchParameterComponentType\",\n        \"fhir.resources.R4B.searchparameter.SearchParameterComponent\",\n    )\n\n    ServiceRequestType = create_fhir_type(\n        \"ServiceRequestType\", \"fhir.resources.R4B.servicerequest.ServiceRequest\"\n    )\n\n    SignatureType = create_fhir_type(\n        \"SignatureType\", \"fhir.resources.R4B.signature.Signature\"\n    )\n\n    SlotType = create_fhir_type(\"SlotType\", \"fhir.resources.R4B.slot.Slot\")\n\n    SpecimenType = create_fhir_type(\n        \"SpecimenType\", \"fhir.resources.R4B.specimen.Specimen\"\n    )\n\n    SpecimenCollectionType = create_fhir_type(\n        \"SpecimenCollectionType\", \"fhir.resources.R4B.specimen.SpecimenCollection\"\n    )\n\n    SpecimenContainerType = create_fhir_type(\n        \"SpecimenContainerType\", \"fhir.resources.R4B.specimen.SpecimenContainer\"\n    )\n\n    SpecimenDefinitionType = create_fhir_type(\n        \"SpecimenDefinitionType\",\n        \"fhir.resources.R4B.specimendefinition.SpecimenDefinition\",\n    )\n\n    SpecimenDefinitionTypeTestedType = create_fhir_type(\n        \"SpecimenDefinitionTypeTestedType\",\n        \"fhir.resources.R4B.specimendefinition.SpecimenDefinitionTypeTested\",\n    )\n\n    SpecimenDefinitionTypeTestedContainerType = create_fhir_type(\n        \"SpecimenDefinitionTypeTestedContainerType\",\n        \"fhir.resources.R4B.specimendefinition.SpecimenDefinitionTypeTestedContainer\",\n    )\n\n    SpecimenDefinitionTypeTestedContainerAdditiveType = create_fhir_type(\n        \"SpecimenDefinitionTypeTestedContainerAdditiveType\",\n        \"fhir.resources.R4B.specimendefinition.SpecimenDefinitionTypeTestedContainerAdditive\",\n    )\n\n    SpecimenDefinitionTypeTestedHandlingType = create_fhir_type(\n        \"SpecimenDefinitionTypeTestedHandlingType\",\n        \"fhir.resources.R4B.specimendefinition.SpecimenDefinitionTypeTestedHandling\",\n    )\n\n    SpecimenProcessingType = create_fhir_type(\n        \"SpecimenProcessingType\", \"fhir.resources.R4B.specimen.SpecimenProcessing\"\n    )\n\n    StructureDefinitionType = create_fhir_type(\n        \"StructureDefinitionType\",\n        \"fhir.resources.R4B.structuredefinition.StructureDefinition\",\n    )\n\n    StructureDefinitionContextType = create_fhir_type(\n        \"StructureDefinitionContextType\",\n        \"fhir.resources.R4B.structuredefinition.StructureDefinitionContext\",\n    )\n\n    StructureDefinitionDifferentialType = create_fhir_type(\n        \"StructureDefinitionDifferentialType\",\n        \"fhir.resources.R4B.structuredefinition.StructureDefinitionDifferential\",\n    )\n\n    StructureDefinitionMappingType = create_fhir_type(\n        \"StructureDefinitionMappingType\",\n        \"fhir.resources.R4B.structuredefinition.StructureDefinitionMapping\",\n    )\n\n    StructureDefinitionSnapshotType = create_fhir_type(\n        \"StructureDefinitionSnapshotType\",\n        \"fhir.resources.R4B.structuredefinition.StructureDefinitionSnapshot\",\n    )\n\n    StructureMapType = create_fhir_type(\n        \"StructureMapType\", \"fhir.resources.R4B.structuremap.StructureMap\"\n    )\n\n    StructureMapGroupType = create_fhir_type(\n        \"StructureMapGroupType\", \"fhir.resources.R4B.structuremap.StructureMapGroup\"\n    )\n\n    StructureMapGroupInputType = create_fhir_type(\n        \"StructureMapGroupInputType\",\n        \"fhir.resources.R4B.structuremap.StructureMapGroupInput\",\n    )\n\n    StructureMapGroupRuleType = create_fhir_type(\n        \"StructureMapGroupRuleType\",\n        \"fhir.resources.R4B.structuremap.StructureMapGroupRule\",\n    )\n\n    StructureMapGroupRuleDependentType = create_fhir_type(\n        \"StructureMapGroupRuleDependentType\",\n        \"fhir.resources.R4B.structuremap.StructureMapGroupRuleDependent\",\n    )\n\n    StructureMapGroupRuleSourceType = create_fhir_type(\n        \"StructureMapGroupRuleSourceType\",\n        \"fhir.resources.R4B.structuremap.StructureMapGroupRuleSource\",\n    )\n\n    StructureMapGroupRuleTargetType = create_fhir_type(\n        \"StructureMapGroupRuleTargetType\",\n        \"fhir.resources.R4B.structuremap.StructureMapGroupRuleTarget\",\n    )\n\n    StructureMapGroupRuleTargetParameterType = create_fhir_type(\n        \"StructureMapGroupRuleTargetParameterType\",\n        \"fhir.resources.R4B.structuremap.StructureMapGroupRuleTargetParameter\",\n    )\n\n    StructureMapStructureType = create_fhir_type(\n        \"StructureMapStructureType\",\n        \"fhir.resources.R4B.structuremap.StructureMapStructure\",\n    )\n\n    SubscriptionType = create_fhir_type(\n        \"SubscriptionType\", \"fhir.resources.R4B.subscription.Subscription\"\n    )\n\n    SubscriptionChannelType = create_fhir_type(\n        \"SubscriptionChannelType\", \"fhir.resources.R4B.subscription.SubscriptionChannel\"\n    )\n\n    SubscriptionStatusType = create_fhir_type(\n        \"SubscriptionStatusType\",\n        \"fhir.resources.R4B.subscriptionstatus.SubscriptionStatus\",\n    )\n\n    SubscriptionStatusNotificationEventType = create_fhir_type(\n        \"SubscriptionStatusNotificationEventType\",\n        \"fhir.resources.R4B.subscriptionstatus.SubscriptionStatusNotificationEvent\",\n    )\n\n    SubscriptionTopicType = create_fhir_type(\n        \"SubscriptionTopicType\",\n        \"fhir.resources.R4B.subscriptiontopic.SubscriptionTopic\",\n    )\n\n    SubscriptionTopicCanFilterByType = create_fhir_type(\n        \"SubscriptionTopicCanFilterByType\",\n        \"fhir.resources.R4B.subscriptiontopic.SubscriptionTopicCanFilterBy\",\n    )\n\n    SubscriptionTopicEventTriggerType = create_fhir_type(\n        \"SubscriptionTopicEventTriggerType\",\n        \"fhir.resources.R4B.subscriptiontopic.SubscriptionTopicEventTrigger\",\n    )\n\n    SubscriptionTopicNotificationShapeType = create_fhir_type(\n        \"SubscriptionTopicNotificationShapeType\",\n        \"fhir.resources.R4B.subscriptiontopic.SubscriptionTopicNotificationShape\",\n    )\n\n    SubscriptionTopicResourceTriggerType = create_fhir_type(\n        \"SubscriptionTopicResourceTriggerType\",\n        \"fhir.resources.R4B.subscriptiontopic.SubscriptionTopicResourceTrigger\",\n    )\n\n    SubscriptionTopicResourceTriggerQueryCriteriaType = create_fhir_type(\n        \"SubscriptionTopicResourceTriggerQueryCriteriaType\",\n        \"fhir.resources.R4B.subscriptiontopic.SubscriptionTopicResourceTriggerQueryCriteria\",\n    )\n\n    SubstanceType = create_fhir_type(\n        \"SubstanceType\", \"fhir.resources.R4B.substance.Substance\"\n    )\n\n    SubstanceDefinitionType = create_fhir_type(\n        \"SubstanceDefinitionType\",\n        \"fhir.resources.R4B.substancedefinition.SubstanceDefinition\",\n    )\n\n    SubstanceDefinitionCodeType = create_fhir_type(\n        \"SubstanceDefinitionCodeType\",\n        \"fhir.resources.R4B.substancedefinition.SubstanceDefinitionCode\",\n    )\n\n    SubstanceDefinitionMoietyType = create_fhir_type(\n        \"SubstanceDefinitionMoietyType\",\n        \"fhir.resources.R4B.substancedefinition.SubstanceDefinitionMoiety\",\n    )\n\n    SubstanceDefinitionMolecularWeightType = create_fhir_type(\n        \"SubstanceDefinitionMolecularWeightType\",\n        \"fhir.resources.R4B.substancedefinition.SubstanceDefinitionMolecularWeight\",\n    )\n\n    SubstanceDefinitionNameType = create_fhir_type(\n        \"SubstanceDefinitionNameType\",\n        \"fhir.resources.R4B.substancedefinition.SubstanceDefinitionName\",\n    )\n\n    SubstanceDefinitionNameOfficialType = create_fhir_type(\n        \"SubstanceDefinitionNameOfficialType\",\n        \"fhir.resources.R4B.substancedefinition.SubstanceDefinitionNameOfficial\",\n    )\n\n    SubstanceDefinitionPropertyType = create_fhir_type(\n        \"SubstanceDefinitionPropertyType\",\n        \"fhir.resources.R4B.substancedefinition.SubstanceDefinitionProperty\",\n    )\n\n    SubstanceDefinitionRelationshipType = create_fhir_type(\n        \"SubstanceDefinitionRelationshipType\",\n        \"fhir.resources.R4B.substancedefinition.SubstanceDefinitionRelationship\",\n    )\n\n    SubstanceDefinitionSourceMaterialType = create_fhir_type(\n        \"SubstanceDefinitionSourceMaterialType\",\n        \"fhir.resources.R4B.substancedefinition.SubstanceDefinitionSourceMaterial\",\n    )\n\n    SubstanceDefinitionStructureType = create_fhir_type(\n        \"SubstanceDefinitionStructureType\",\n        \"fhir.resources.R4B.substancedefinition.SubstanceDefinitionStructure\",\n    )\n\n    SubstanceDefinitionStructureRepresentationType = create_fhir_type(\n        \"SubstanceDefinitionStructureRepresentationType\",\n        \"fhir.resources.R4B.substancedefinition.SubstanceDefinitionStructureRepresentation\",\n    )\n\n    SubstanceIngredientType = create_fhir_type(\n        \"SubstanceIngredientType\", \"fhir.resources.R4B.substance.SubstanceIngredient\"\n    )\n\n    SubstanceInstanceType = create_fhir_type(\n        \"SubstanceInstanceType\", \"fhir.resources.R4B.substance.SubstanceInstance\"\n    )\n\n    SupplyDeliveryType = create_fhir_type(\n        \"SupplyDeliveryType\", \"fhir.resources.R4B.supplydelivery.SupplyDelivery\"\n    )\n\n    SupplyDeliverySuppliedItemType = create_fhir_type(\n        \"SupplyDeliverySuppliedItemType\",\n        \"fhir.resources.R4B.supplydelivery.SupplyDeliverySuppliedItem\",\n    )\n\n    SupplyRequestType = create_fhir_type(\n        \"SupplyRequestType\", \"fhir.resources.R4B.supplyrequest.SupplyRequest\"\n    )\n\n    SupplyRequestParameterType = create_fhir_type(\n        \"SupplyRequestParameterType\",\n        \"fhir.resources.R4B.supplyrequest.SupplyRequestParameter\",\n    )\n\n    TaskType = create_fhir_type(\"TaskType\", \"fhir.resources.R4B.task.Task\")\n\n    TaskInputType = create_fhir_type(\n        \"TaskInputType\", \"fhir.resources.R4B.task.TaskInput\"\n    )\n\n    TaskOutputType = create_fhir_type(\n        \"TaskOutputType\", \"fhir.resources.R4B.task.TaskOutput\"\n    )\n\n    TaskRestrictionType = create_fhir_type(\n        \"TaskRestrictionType\", \"fhir.resources.R4B.task.TaskRestriction\"\n    )\n\n    TerminologyCapabilitiesType = create_fhir_type(\n        \"TerminologyCapabilitiesType\",\n        \"fhir.resources.R4B.terminologycapabilities.TerminologyCapabilities\",\n    )\n\n    TerminologyCapabilitiesClosureType = create_fhir_type(\n        \"TerminologyCapabilitiesClosureType\",\n        \"fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesClosure\",\n    )\n\n    TerminologyCapabilitiesCodeSystemType = create_fhir_type(\n        \"TerminologyCapabilitiesCodeSystemType\",\n        \"fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesCodeSystem\",\n    )\n\n    TerminologyCapabilitiesCodeSystemVersionType = create_fhir_type(\n        \"TerminologyCapabilitiesCodeSystemVersionType\",\n        \"fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesCodeSystemVersion\",\n    )\n\n    TerminologyCapabilitiesCodeSystemVersionFilterType = create_fhir_type(\n        \"TerminologyCapabilitiesCodeSystemVersionFilterType\",\n        \"fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesCodeSystemVersionFilter\",\n    )\n\n    TerminologyCapabilitiesExpansionType = create_fhir_type(\n        \"TerminologyCapabilitiesExpansionType\",\n        \"fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesExpansion\",\n    )\n\n    TerminologyCapabilitiesExpansionParameterType = create_fhir_type(\n        \"TerminologyCapabilitiesExpansionParameterType\",\n        \"fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesExpansionParameter\",\n    )\n\n    TerminologyCapabilitiesImplementationType = create_fhir_type(\n        \"TerminologyCapabilitiesImplementationType\",\n        \"fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesImplementation\",\n    )\n\n    TerminologyCapabilitiesSoftwareType = create_fhir_type(\n        \"TerminologyCapabilitiesSoftwareType\",\n        \"fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesSoftware\",\n    )\n\n    TerminologyCapabilitiesTranslationType = create_fhir_type(\n        \"TerminologyCapabilitiesTranslationType\",\n        \"fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesTranslation\",\n    )\n\n    TerminologyCapabilitiesValidateCodeType = create_fhir_type(\n        \"TerminologyCapabilitiesValidateCodeType\",\n        \"fhir.resources.R4B.terminologycapabilities.TerminologyCapabilitiesValidateCode\",\n    )\n\n    TestReportType = create_fhir_type(\n        \"TestReportType\", \"fhir.resources.R4B.testreport.TestReport\"\n    )\n\n    TestReportParticipantType = create_fhir_type(\n        \"TestReportParticipantType\",\n        \"fhir.resources.R4B.testreport.TestReportParticipant\",\n    )\n\n    TestReportSetupType = create_fhir_type(\n        \"TestReportSetupType\", \"fhir.resources.R4B.testreport.TestReportSetup\"\n    )\n\n    TestReportSetupActionType = create_fhir_type(\n        \"TestReportSetupActionType\",\n        \"fhir.resources.R4B.testreport.TestReportSetupAction\",\n    )\n\n    TestReportSetupActionAssertType = create_fhir_type(\n        \"TestReportSetupActionAssertType\",\n        \"fhir.resources.R4B.testreport.TestReportSetupActionAssert\",\n    )\n\n    TestReportSetupActionOperationType = create_fhir_type(\n        \"TestReportSetupActionOperationType\",\n        \"fhir.resources.R4B.testreport.TestReportSetupActionOperation\",\n    )\n\n    TestReportTeardownType = create_fhir_type(\n        \"TestReportTeardownType\", \"fhir.resources.R4B.testreport.TestReportTeardown\"\n    )\n\n    TestReportTeardownActionType = create_fhir_type(\n        \"TestReportTeardownActionType\",\n        \"fhir.resources.R4B.testreport.TestReportTeardownAction\",\n    )\n\n    TestReportTestType = create_fhir_type(\n        \"TestReportTestType\", \"fhir.resources.R4B.testreport.TestReportTest\"\n    )\n\n    TestReportTestActionType = create_fhir_type(\n        \"TestReportTestActionType\", \"fhir.resources.R4B.testreport.TestReportTestAction\"\n    )\n\n    TestScriptType = create_fhir_type(\n        \"TestScriptType\", \"fhir.resources.R4B.testscript.TestScript\"\n    )\n\n    TestScriptDestinationType = create_fhir_type(\n        \"TestScriptDestinationType\",\n        \"fhir.resources.R4B.testscript.TestScriptDestination\",\n    )\n\n    TestScriptFixtureType = create_fhir_type(\n        \"TestScriptFixtureType\", \"fhir.resources.R4B.testscript.TestScriptFixture\"\n    )\n\n    TestScriptMetadataType = create_fhir_type(\n        \"TestScriptMetadataType\", \"fhir.resources.R4B.testscript.TestScriptMetadata\"\n    )\n\n    TestScriptMetadataCapabilityType = create_fhir_type(\n        \"TestScriptMetadataCapabilityType\",\n        \"fhir.resources.R4B.testscript.TestScriptMetadataCapability\",\n    )\n\n    TestScriptMetadataLinkType = create_fhir_type(\n        \"TestScriptMetadataLinkType\",\n        \"fhir.resources.R4B.testscript.TestScriptMetadataLink\",\n    )\n\n    TestScriptOriginType = create_fhir_type(\n        \"TestScriptOriginType\", \"fhir.resources.R4B.testscript.TestScriptOrigin\"\n    )\n\n    TestScriptSetupType = create_fhir_type(\n        \"TestScriptSetupType\", \"fhir.resources.R4B.testscript.TestScriptSetup\"\n    )\n\n    TestScriptSetupActionType = create_fhir_type(\n        \"TestScriptSetupActionType\",\n        \"fhir.resources.R4B.testscript.TestScriptSetupAction\",\n    )\n\n    TestScriptSetupActionAssertType = create_fhir_type(\n        \"TestScriptSetupActionAssertType\",\n        \"fhir.resources.R4B.testscript.TestScriptSetupActionAssert\",\n    )\n\n    TestScriptSetupActionOperationType = create_fhir_type(\n        \"TestScriptSetupActionOperationType\",\n        \"fhir.resources.R4B.testscript.TestScriptSetupActionOperation\",\n    )\n\n    TestScriptSetupActionOperationRequestHeaderType = create_fhir_type(\n        \"TestScriptSetupActionOperationRequestHeaderType\",\n        \"fhir.resources.R4B.testscript.TestScriptSetupActionOperationRequestHeader\",\n    )\n\n    TestScriptTeardownType = create_fhir_type(\n        \"TestScriptTeardownType\", \"fhir.resources.R4B.testscript.TestScriptTeardown\"\n    )\n\n    TestScriptTeardownActionType = create_fhir_type(\n        \"TestScriptTeardownActionType\",\n        \"fhir.resources.R4B.testscript.TestScriptTeardownAction\",\n    )\n\n    TestScriptTestType = create_fhir_type(\n        \"TestScriptTestType\", \"fhir.resources.R4B.testscript.TestScriptTest\"\n    )\n\n    TestScriptTestActionType = create_fhir_type(\n        \"TestScriptTestActionType\", \"fhir.resources.R4B.testscript.TestScriptTestAction\"\n    )\n\n    TestScriptVariableType = create_fhir_type(\n        \"TestScriptVariableType\", \"fhir.resources.R4B.testscript.TestScriptVariable\"\n    )\n\n    TimingType = create_fhir_type(\"TimingType\", \"fhir.resources.R4B.timing.Timing\")\n\n    TimingRepeatType = create_fhir_type(\n        \"TimingRepeatType\", \"fhir.resources.R4B.timing.TimingRepeat\"\n    )\n\n    TriggerDefinitionType = create_fhir_type(\n        \"TriggerDefinitionType\",\n        \"fhir.resources.R4B.triggerdefinition.TriggerDefinition\",\n    )\n\n    UsageContextType = create_fhir_type(\n        \"UsageContextType\", \"fhir.resources.R4B.usagecontext.UsageContext\"\n    )\n\n    ValueSetType = create_fhir_type(\n        \"ValueSetType\", \"fhir.resources.R4B.valueset.ValueSet\"\n    )\n\n    ValueSetComposeType = create_fhir_type(\n        \"ValueSetComposeType\", \"fhir.resources.R4B.valueset.ValueSetCompose\"\n    )\n\n    ValueSetComposeIncludeType = create_fhir_type(\n        \"ValueSetComposeIncludeType\",\n        \"fhir.resources.R4B.valueset.ValueSetComposeInclude\",\n    )\n\n    ValueSetComposeIncludeConceptType = create_fhir_type(\n        \"ValueSetComposeIncludeConceptType\",\n        \"fhir.resources.R4B.valueset.ValueSetComposeIncludeConcept\",\n    )\n\n    ValueSetComposeIncludeConceptDesignationType = create_fhir_type(\n        \"ValueSetComposeIncludeConceptDesignationType\",\n        \"fhir.resources.R4B.valueset.ValueSetComposeIncludeConceptDesignation\",\n    )\n\n    ValueSetComposeIncludeFilterType = create_fhir_type(\n        \"ValueSetComposeIncludeFilterType\",\n        \"fhir.resources.R4B.valueset.ValueSetComposeIncludeFilter\",\n    )\n\n    ValueSetExpansionType = create_fhir_type(\n        \"ValueSetExpansionType\", \"fhir.resources.R4B.valueset.ValueSetExpansion\"\n    )\n\n    ValueSetExpansionContainsType = create_fhir_type(\n        \"ValueSetExpansionContainsType\",\n        \"fhir.resources.R4B.valueset.ValueSetExpansionContains\",\n    )\n\n    ValueSetExpansionParameterType = create_fhir_type(\n        \"ValueSetExpansionParameterType\",\n        \"fhir.resources.R4B.valueset.ValueSetExpansionParameter\",\n    )\n\n    VerificationResultType = create_fhir_type(\n        \"VerificationResultType\",\n        \"fhir.resources.R4B.verificationresult.VerificationResult\",\n    )\n\n    VerificationResultAttestationType = create_fhir_type(\n        \"VerificationResultAttestationType\",\n        \"fhir.resources.R4B.verificationresult.VerificationResultAttestation\",\n    )\n\n    VerificationResultPrimarySourceType = create_fhir_type(\n        \"VerificationResultPrimarySourceType\",\n        \"fhir.resources.R4B.verificationresult.VerificationResultPrimarySource\",\n    )\n\n    VerificationResultValidatorType = create_fhir_type(\n        \"VerificationResultValidatorType\",\n        \"fhir.resources.R4B.verificationresult.VerificationResultValidator\",\n    )\n\n    VisionPrescriptionType = create_fhir_type(\n        \"VisionPrescriptionType\",\n        \"fhir.resources.R4B.visionprescription.VisionPrescription\",\n    )\n\n    VisionPrescriptionLensSpecificationType = create_fhir_type(\n        \"VisionPrescriptionLensSpecificationType\",\n        \"fhir.resources.R4B.visionprescription.VisionPrescriptionLensSpecification\",\n    )\n\n    VisionPrescriptionLensSpecificationPrismType = create_fhir_type(\n        \"VisionPrescriptionLensSpecificationPrismType\",\n        \"fhir.resources.R4B.visionprescription.VisionPrescriptionLensSpecificationPrism\",\n    )\n\n__all__ = [\n    \"BooleanType\",\n    \"StringType\",\n    \"Base64BinaryType\",\n    \"CodeType\",\n    \"IdType\",\n    \"IntegerType\",\n    \"Integer64Type\",\n    \"DecimalType\",\n    \"UnsignedIntType\",\n    \"PositiveIntType\",\n    \"CanonicalType\",\n    \"UriType\",\n    \"OidType\",\n    \"UuidType\",\n    \"UrlType\",\n    \"MarkdownType\",\n    \"XhtmlType\",\n    \"DateType\",\n    \"DateTimeType\",\n    \"InstantType\",\n    \"TimeType\",\n    \"FHIRPrimitiveExtensionType\",\n    \"AccountType\",\n    \"AccountCoverageType\",\n    \"AccountGuarantorType\",\n    \"ActivityDefinitionType\",\n    \"ActivityDefinitionDynamicValueType\",\n    \"ActivityDefinitionParticipantType\",\n    \"AddressType\",\n    \"AdministrableProductDefinitionType\",\n    \"AdministrableProductDefinitionPropertyType\",\n    \"AdministrableProductDefinitionRouteOfAdministrationType\",\n    \"AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType\",\n    \"AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType\",\n    \"AdverseEventType\",\n    \"AdverseEventSuspectEntityType\",\n    \"AdverseEventSuspectEntityCausalityType\",\n    \"AgeType\",\n    \"AllergyIntoleranceType\",\n    \"AllergyIntoleranceReactionType\",\n    \"AnnotationType\",\n    \"AppointmentType\",\n    \"AppointmentParticipantType\",\n    \"AppointmentResponseType\",\n    \"AttachmentType\",\n    \"AuditEventType\",\n    \"AuditEventAgentType\",\n    \"AuditEventAgentNetworkType\",\n    \"AuditEventEntityType\",\n    \"AuditEventEntityDetailType\",\n    \"AuditEventSourceType\",\n    \"BackboneElementType\",\n    \"BasicType\",\n    \"BinaryType\",\n    \"BiologicallyDerivedProductType\",\n    \"BiologicallyDerivedProductCollectionType\",\n    \"BiologicallyDerivedProductManipulationType\",\n    \"BiologicallyDerivedProductProcessingType\",\n    \"BiologicallyDerivedProductStorageType\",\n    \"BodyStructureType\",\n    \"BundleType\",\n    \"BundleEntryType\",\n    \"BundleEntryRequestType\",\n    \"BundleEntryResponseType\",\n    \"BundleEntrySearchType\",\n    \"BundleLinkType\",\n    \"CapabilityStatementType\",\n    \"CapabilityStatementDocumentType\",\n    \"CapabilityStatementImplementationType\",\n    \"CapabilityStatementMessagingType\",\n    \"CapabilityStatementMessagingEndpointType\",\n    \"CapabilityStatementMessagingSupportedMessageType\",\n    \"CapabilityStatementRestType\",\n    \"CapabilityStatementRestInteractionType\",\n    \"CapabilityStatementRestResourceType\",\n    \"CapabilityStatementRestResourceInteractionType\",\n    \"CapabilityStatementRestResourceOperationType\",\n    \"CapabilityStatementRestResourceSearchParamType\",\n    \"CapabilityStatementRestSecurityType\",\n    \"CapabilityStatementSoftwareType\",\n    \"CarePlanType\",\n    \"CarePlanActivityType\",\n    \"CarePlanActivityDetailType\",\n    \"CareTeamType\",\n    \"CareTeamParticipantType\",\n    \"CatalogEntryType\",\n    \"CatalogEntryRelatedEntryType\",\n    \"ChargeItemType\",\n    \"ChargeItemDefinitionType\",\n    \"ChargeItemDefinitionApplicabilityType\",\n    \"ChargeItemDefinitionPropertyGroupType\",\n    \"ChargeItemDefinitionPropertyGroupPriceComponentType\",\n    \"ChargeItemPerformerType\",\n    \"CitationType\",\n    \"CitationCitedArtifactType\",\n    \"CitationCitedArtifactAbstractType\",\n    \"CitationCitedArtifactClassificationType\",\n    \"CitationCitedArtifactClassificationWhoClassifiedType\",\n    \"CitationCitedArtifactContributorshipType\",\n    \"CitationCitedArtifactContributorshipEntryType\",\n    \"CitationCitedArtifactContributorshipEntryAffiliationInfoType\",\n    \"CitationCitedArtifactContributorshipEntryContributionInstanceType\",\n    \"CitationCitedArtifactContributorshipSummaryType\",\n    \"CitationCitedArtifactPartType\",\n    \"CitationCitedArtifactPublicationFormType\",\n    \"CitationCitedArtifactPublicationFormPeriodicReleaseType\",\n    \"CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationType\",\n    \"CitationCitedArtifactPublicationFormPublishedInType\",\n    \"CitationCitedArtifactRelatesToType\",\n    \"CitationCitedArtifactStatusDateType\",\n    \"CitationCitedArtifactTitleType\",\n    \"CitationCitedArtifactVersionType\",\n    \"CitationCitedArtifactWebLocationType\",\n    \"CitationClassificationType\",\n    \"CitationRelatesToType\",\n    \"CitationStatusDateType\",\n    \"CitationSummaryType\",\n    \"ClaimType\",\n    \"ClaimAccidentType\",\n    \"ClaimCareTeamType\",\n    \"ClaimDiagnosisType\",\n    \"ClaimInsuranceType\",\n    \"ClaimItemType\",\n    \"ClaimItemDetailType\",\n    \"ClaimItemDetailSubDetailType\",\n    \"ClaimPayeeType\",\n    \"ClaimProcedureType\",\n    \"ClaimRelatedType\",\n    \"ClaimResponseType\",\n    \"ClaimResponseAddItemType\",\n    \"ClaimResponseAddItemDetailType\",\n    \"ClaimResponseAddItemDetailSubDetailType\",\n    \"ClaimResponseErrorType\",\n    \"ClaimResponseInsuranceType\",\n    \"ClaimResponseItemType\",\n    \"ClaimResponseItemAdjudicationType\",\n    \"ClaimResponseItemDetailType\",\n    \"ClaimResponseItemDetailSubDetailType\",\n    \"ClaimResponsePaymentType\",\n    \"ClaimResponseProcessNoteType\",\n    \"ClaimResponseTotalType\",\n    \"ClaimSupportingInfoType\",\n    \"ClinicalImpressionType\",\n    \"ClinicalImpressionFindingType\",\n    \"ClinicalImpressionInvestigationType\",\n    \"ClinicalUseDefinitionType\",\n    \"ClinicalUseDefinitionContraindicationType\",\n    \"ClinicalUseDefinitionContraindicationOtherTherapyType\",\n    \"ClinicalUseDefinitionIndicationType\",\n    \"ClinicalUseDefinitionInteractionType\",\n    \"ClinicalUseDefinitionInteractionInteractantType\",\n    \"ClinicalUseDefinitionUndesirableEffectType\",\n    \"ClinicalUseDefinitionWarningType\",\n    \"CodeSystemType\",\n    \"CodeSystemConceptType\",\n    \"CodeSystemConceptDesignationType\",\n    \"CodeSystemConceptPropertyType\",\n    \"CodeSystemFilterType\",\n    \"CodeSystemPropertyType\",\n    \"CodeableConceptType\",\n    \"CodeableReferenceType\",\n    \"CodingType\",\n    \"CommunicationType\",\n    \"CommunicationPayloadType\",\n    \"CommunicationRequestType\",\n    \"CommunicationRequestPayloadType\",\n    \"CompartmentDefinitionType\",\n    \"CompartmentDefinitionResourceType\",\n    \"CompositionType\",\n    \"CompositionAttesterType\",\n    \"CompositionEventType\",\n    \"CompositionRelatesToType\",\n    \"CompositionSectionType\",\n    \"ConceptMapType\",\n    \"ConceptMapGroupType\",\n    \"ConceptMapGroupElementType\",\n    \"ConceptMapGroupElementTargetType\",\n    \"ConceptMapGroupElementTargetDependsOnType\",\n    \"ConceptMapGroupUnmappedType\",\n    \"ConditionType\",\n    \"ConditionEvidenceType\",\n    \"ConditionStageType\",\n    \"ConsentType\",\n    \"ConsentPolicyType\",\n    \"ConsentProvisionType\",\n    \"ConsentProvisionActorType\",\n    \"ConsentProvisionDataType\",\n    \"ConsentVerificationType\",\n    \"ContactDetailType\",\n    \"ContactPointType\",\n    \"ContractType\",\n    \"ContractContentDefinitionType\",\n    \"ContractFriendlyType\",\n    \"ContractLegalType\",\n    \"ContractRuleType\",\n    \"ContractSignerType\",\n    \"ContractTermType\",\n    \"ContractTermActionType\",\n    \"ContractTermActionSubjectType\",\n    \"ContractTermAssetType\",\n    \"ContractTermAssetContextType\",\n    \"ContractTermAssetValuedItemType\",\n    \"ContractTermOfferType\",\n    \"ContractTermOfferAnswerType\",\n    \"ContractTermOfferPartyType\",\n    \"ContractTermSecurityLabelType\",\n    \"ContributorType\",\n    \"CountType\",\n    \"CoverageType\",\n    \"CoverageClassType\",\n    \"CoverageCostToBeneficiaryType\",\n    \"CoverageCostToBeneficiaryExceptionType\",\n    \"CoverageEligibilityRequestType\",\n    \"CoverageEligibilityRequestInsuranceType\",\n    \"CoverageEligibilityRequestItemType\",\n    \"CoverageEligibilityRequestItemDiagnosisType\",\n    \"CoverageEligibilityRequestSupportingInfoType\",\n    \"CoverageEligibilityResponseType\",\n    \"CoverageEligibilityResponseErrorType\",\n    \"CoverageEligibilityResponseInsuranceType\",\n    \"CoverageEligibilityResponseInsuranceItemType\",\n    \"CoverageEligibilityResponseInsuranceItemBenefitType\",\n    \"DataRequirementType\",\n    \"DataRequirementCodeFilterType\",\n    \"DataRequirementDateFilterType\",\n    \"DataRequirementSortType\",\n    \"DetectedIssueType\",\n    \"DetectedIssueEvidenceType\",\n    \"DetectedIssueMitigationType\",\n    \"DeviceType\",\n    \"DeviceDefinitionType\",\n    \"DeviceDefinitionCapabilityType\",\n    \"DeviceDefinitionDeviceNameType\",\n    \"DeviceDefinitionMaterialType\",\n    \"DeviceDefinitionPropertyType\",\n    \"DeviceDefinitionSpecializationType\",\n    \"DeviceDefinitionUdiDeviceIdentifierType\",\n    \"DeviceDeviceNameType\",\n    \"DeviceMetricType\",\n    \"DeviceMetricCalibrationType\",\n    \"DevicePropertyType\",\n    \"DeviceRequestType\",\n    \"DeviceRequestParameterType\",\n    \"DeviceSpecializationType\",\n    \"DeviceUdiCarrierType\",\n    \"DeviceUseStatementType\",\n    \"DeviceVersionType\",\n    \"DiagnosticReportType\",\n    \"DiagnosticReportMediaType\",\n    \"DistanceType\",\n    \"DocumentManifestType\",\n    \"DocumentManifestRelatedType\",\n    \"DocumentReferenceType\",\n    \"DocumentReferenceContentType\",\n    \"DocumentReferenceContextType\",\n    \"DocumentReferenceRelatesToType\",\n    \"DomainResourceType\",\n    \"DosageType\",\n    \"DosageDoseAndRateType\",\n    \"DurationType\",\n    \"ElementType\",\n    \"ElementDefinitionType\",\n    \"ElementDefinitionBaseType\",\n    \"ElementDefinitionBindingType\",\n    \"ElementDefinitionConstraintType\",\n    \"ElementDefinitionExampleType\",\n    \"ElementDefinitionMappingType\",\n    \"ElementDefinitionSlicingType\",\n    \"ElementDefinitionSlicingDiscriminatorType\",\n    \"ElementDefinitionTypeType\",\n    \"EncounterType\",\n    \"EncounterClassHistoryType\",\n    \"EncounterDiagnosisType\",\n    \"EncounterHospitalizationType\",\n    \"EncounterLocationType\",\n    \"EncounterParticipantType\",\n    \"EncounterStatusHistoryType\",\n    \"EndpointType\",\n    \"EnrollmentRequestType\",\n    \"EnrollmentResponseType\",\n    \"EpisodeOfCareType\",\n    \"EpisodeOfCareDiagnosisType\",\n    \"EpisodeOfCareStatusHistoryType\",\n    \"EventDefinitionType\",\n    \"EvidenceType\",\n    \"EvidenceCertaintyType\",\n    \"EvidenceReportType\",\n    \"EvidenceReportRelatesToType\",\n    \"EvidenceReportSectionType\",\n    \"EvidenceReportSubjectType\",\n    \"EvidenceReportSubjectCharacteristicType\",\n    \"EvidenceStatisticType\",\n    \"EvidenceStatisticAttributeEstimateType\",\n    \"EvidenceStatisticModelCharacteristicType\",\n    \"EvidenceStatisticModelCharacteristicVariableType\",\n    \"EvidenceStatisticSampleSizeType\",\n    \"EvidenceVariableType\",\n    \"EvidenceVariableCategoryType\",\n    \"EvidenceVariableCharacteristicType\",\n    \"EvidenceVariableCharacteristicTimeFromStartType\",\n    \"EvidenceVariableDefinitionType\",\n    \"ExampleScenarioType\",\n    \"ExampleScenarioActorType\",\n    \"ExampleScenarioInstanceType\",\n    \"ExampleScenarioInstanceContainedInstanceType\",\n    \"ExampleScenarioInstanceVersionType\",\n    \"ExampleScenarioProcessType\",\n    \"ExampleScenarioProcessStepType\",\n    \"ExampleScenarioProcessStepAlternativeType\",\n    \"ExampleScenarioProcessStepOperationType\",\n    \"ExplanationOfBenefitType\",\n    \"ExplanationOfBenefitAccidentType\",\n    \"ExplanationOfBenefitAddItemType\",\n    \"ExplanationOfBenefitAddItemDetailType\",\n    \"ExplanationOfBenefitAddItemDetailSubDetailType\",\n    \"ExplanationOfBenefitBenefitBalanceType\",\n    \"ExplanationOfBenefitBenefitBalanceFinancialType\",\n    \"ExplanationOfBenefitCareTeamType\",\n    \"ExplanationOfBenefitDiagnosisType\",\n    \"ExplanationOfBenefitInsuranceType\",\n    \"ExplanationOfBenefitItemType\",\n    \"ExplanationOfBenefitItemAdjudicationType\",\n    \"ExplanationOfBenefitItemDetailType\",\n    \"ExplanationOfBenefitItemDetailSubDetailType\",\n    \"ExplanationOfBenefitPayeeType\",\n    \"ExplanationOfBenefitPaymentType\",\n    \"ExplanationOfBenefitProcedureType\",\n    \"ExplanationOfBenefitProcessNoteType\",\n    \"ExplanationOfBenefitRelatedType\",\n    \"ExplanationOfBenefitSupportingInfoType\",\n    \"ExplanationOfBenefitTotalType\",\n    \"ExpressionType\",\n    \"ExtensionType\",\n    \"FamilyMemberHistoryType\",\n    \"FamilyMemberHistoryConditionType\",\n    \"FlagType\",\n    \"GoalType\",\n    \"GoalTargetType\",\n    \"GraphDefinitionType\",\n    \"GraphDefinitionLinkType\",\n    \"GraphDefinitionLinkTargetType\",\n    \"GraphDefinitionLinkTargetCompartmentType\",\n    \"GroupType\",\n    \"GroupCharacteristicType\",\n    \"GroupMemberType\",\n    \"GuidanceResponseType\",\n    \"HealthcareServiceType\",\n    \"HealthcareServiceAvailableTimeType\",\n    \"HealthcareServiceEligibilityType\",\n    \"HealthcareServiceNotAvailableType\",\n    \"HumanNameType\",\n    \"IdentifierType\",\n    \"ImagingStudyType\",\n    \"ImagingStudySeriesType\",\n    \"ImagingStudySeriesInstanceType\",\n    \"ImagingStudySeriesPerformerType\",\n    \"ImmunizationType\",\n    \"ImmunizationEducationType\",\n    \"ImmunizationEvaluationType\",\n    \"ImmunizationPerformerType\",\n    \"ImmunizationProtocolAppliedType\",\n    \"ImmunizationReactionType\",\n    \"ImmunizationRecommendationType\",\n    \"ImmunizationRecommendationRecommendationType\",\n    \"ImmunizationRecommendationRecommendationDateCriterionType\",\n    \"ImplementationGuideType\",\n    \"ImplementationGuideDefinitionType\",\n    \"ImplementationGuideDefinitionGroupingType\",\n    \"ImplementationGuideDefinitionPageType\",\n    \"ImplementationGuideDefinitionParameterType\",\n    \"ImplementationGuideDefinitionResourceType\",\n    \"ImplementationGuideDefinitionTemplateType\",\n    \"ImplementationGuideDependsOnType\",\n    \"ImplementationGuideGlobalType\",\n    \"ImplementationGuideManifestType\",\n    \"ImplementationGuideManifestPageType\",\n    \"ImplementationGuideManifestResourceType\",\n    \"IngredientType\",\n    \"IngredientManufacturerType\",\n    \"IngredientSubstanceType\",\n    \"IngredientSubstanceStrengthType\",\n    \"IngredientSubstanceStrengthReferenceStrengthType\",\n    \"InsurancePlanType\",\n    \"InsurancePlanContactType\",\n    \"InsurancePlanCoverageType\",\n    \"InsurancePlanCoverageBenefitType\",\n    \"InsurancePlanCoverageBenefitLimitType\",\n    \"InsurancePlanPlanType\",\n    \"InsurancePlanPlanGeneralCostType\",\n    \"InsurancePlanPlanSpecificCostType\",\n    \"InsurancePlanPlanSpecificCostBenefitType\",\n    \"InsurancePlanPlanSpecificCostBenefitCostType\",\n    \"InvoiceType\",\n    \"InvoiceLineItemType\",\n    \"InvoiceLineItemPriceComponentType\",\n    \"InvoiceParticipantType\",\n    \"LibraryType\",\n    \"LinkageType\",\n    \"LinkageItemType\",\n    \"ListType\",\n    \"ListEntryType\",\n    \"LocationType\",\n    \"LocationHoursOfOperationType\",\n    \"LocationPositionType\",\n    \"ManufacturedItemDefinitionType\",\n    \"ManufacturedItemDefinitionPropertyType\",\n    \"MarketingStatusType\",\n    \"MeasureType\",\n    \"MeasureGroupType\",\n    \"MeasureGroupPopulationType\",\n    \"MeasureGroupStratifierType\",\n    \"MeasureGroupStratifierComponentType\",\n    \"MeasureReportType\",\n    \"MeasureReportGroupType\",\n    \"MeasureReportGroupPopulationType\",\n    \"MeasureReportGroupStratifierType\",\n    \"MeasureReportGroupStratifierStratumType\",\n    \"MeasureReportGroupStratifierStratumComponentType\",\n    \"MeasureReportGroupStratifierStratumPopulationType\",\n    \"MeasureSupplementalDataType\",\n    \"MediaType\",\n    \"MedicationType\",\n    \"MedicationAdministrationType\",\n    \"MedicationAdministrationDosageType\",\n    \"MedicationAdministrationPerformerType\",\n    \"MedicationBatchType\",\n    \"MedicationDispenseType\",\n    \"MedicationDispensePerformerType\",\n    \"MedicationDispenseSubstitutionType\",\n    \"MedicationIngredientType\",\n    \"MedicationKnowledgeType\",\n    \"MedicationKnowledgeAdministrationGuidelinesType\",\n    \"MedicationKnowledgeAdministrationGuidelinesDosageType\",\n    \"MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsType\",\n    \"MedicationKnowledgeCostType\",\n    \"MedicationKnowledgeDrugCharacteristicType\",\n    \"MedicationKnowledgeIngredientType\",\n    \"MedicationKnowledgeKineticsType\",\n    \"MedicationKnowledgeMedicineClassificationType\",\n    \"MedicationKnowledgeMonitoringProgramType\",\n    \"MedicationKnowledgeMonographType\",\n    \"MedicationKnowledgePackagingType\",\n    \"MedicationKnowledgeRegulatoryType\",\n    \"MedicationKnowledgeRegulatoryMaxDispenseType\",\n    \"MedicationKnowledgeRegulatoryScheduleType\",\n    \"MedicationKnowledgeRegulatorySubstitutionType\",\n    \"MedicationKnowledgeRelatedMedicationKnowledgeType\",\n    \"MedicationRequestType\",\n    \"MedicationRequestDispenseRequestType\",\n    \"MedicationRequestDispenseRequestInitialFillType\",\n    \"MedicationRequestSubstitutionType\",\n    \"MedicationStatementType\",\n    \"MedicinalProductDefinitionType\",\n    \"MedicinalProductDefinitionCharacteristicType\",\n    \"MedicinalProductDefinitionContactType\",\n    \"MedicinalProductDefinitionCrossReferenceType\",\n    \"MedicinalProductDefinitionNameType\",\n    \"MedicinalProductDefinitionNameCountryLanguageType\",\n    \"MedicinalProductDefinitionNameNamePartType\",\n    \"MedicinalProductDefinitionOperationType\",\n    \"MessageDefinitionType\",\n    \"MessageDefinitionAllowedResponseType\",\n    \"MessageDefinitionFocusType\",\n    \"MessageHeaderType\",\n    \"MessageHeaderDestinationType\",\n    \"MessageHeaderResponseType\",\n    \"MessageHeaderSourceType\",\n    \"MetaType\",\n    \"MolecularSequenceType\",\n    \"MolecularSequenceQualityType\",\n    \"MolecularSequenceQualityRocType\",\n    \"MolecularSequenceReferenceSeqType\",\n    \"MolecularSequenceRepositoryType\",\n    \"MolecularSequenceStructureVariantType\",\n    \"MolecularSequenceStructureVariantInnerType\",\n    \"MolecularSequenceStructureVariantOuterType\",\n    \"MolecularSequenceVariantType\",\n    \"MoneyType\",\n    \"NamingSystemType\",\n    \"NamingSystemUniqueIdType\",\n    \"NarrativeType\",\n    \"NutritionOrderType\",\n    \"NutritionOrderEnteralFormulaType\",\n    \"NutritionOrderEnteralFormulaAdministrationType\",\n    \"NutritionOrderOralDietType\",\n    \"NutritionOrderOralDietNutrientType\",\n    \"NutritionOrderOralDietTextureType\",\n    \"NutritionOrderSupplementType\",\n    \"NutritionProductType\",\n    \"NutritionProductIngredientType\",\n    \"NutritionProductInstanceType\",\n    \"NutritionProductNutrientType\",\n    \"NutritionProductProductCharacteristicType\",\n    \"ObservationType\",\n    \"ObservationComponentType\",\n    \"ObservationDefinitionType\",\n    \"ObservationDefinitionQualifiedIntervalType\",\n    \"ObservationDefinitionQuantitativeDetailsType\",\n    \"ObservationReferenceRangeType\",\n    \"OperationDefinitionType\",\n    \"OperationDefinitionOverloadType\",\n    \"OperationDefinitionParameterType\",\n    \"OperationDefinitionParameterBindingType\",\n    \"OperationDefinitionParameterReferencedFromType\",\n    \"OperationOutcomeType\",\n    \"OperationOutcomeIssueType\",\n    \"OrganizationType\",\n    \"OrganizationAffiliationType\",\n    \"OrganizationContactType\",\n    \"PackagedProductDefinitionType\",\n    \"PackagedProductDefinitionLegalStatusOfSupplyType\",\n    \"PackagedProductDefinitionPackageType\",\n    \"PackagedProductDefinitionPackageContainedItemType\",\n    \"PackagedProductDefinitionPackagePropertyType\",\n    \"PackagedProductDefinitionPackageShelfLifeStorageType\",\n    \"ParameterDefinitionType\",\n    \"ParametersType\",\n    \"ParametersParameterType\",\n    \"PatientType\",\n    \"PatientCommunicationType\",\n    \"PatientContactType\",\n    \"PatientLinkType\",\n    \"PaymentNoticeType\",\n    \"PaymentReconciliationType\",\n    \"PaymentReconciliationDetailType\",\n    \"PaymentReconciliationProcessNoteType\",\n    \"PeriodType\",\n    \"PersonType\",\n    \"PersonLinkType\",\n    \"PlanDefinitionType\",\n    \"PlanDefinitionActionType\",\n    \"PlanDefinitionActionConditionType\",\n    \"PlanDefinitionActionDynamicValueType\",\n    \"PlanDefinitionActionParticipantType\",\n    \"PlanDefinitionActionRelatedActionType\",\n    \"PlanDefinitionGoalType\",\n    \"PlanDefinitionGoalTargetType\",\n    \"PopulationType\",\n    \"PractitionerType\",\n    \"PractitionerQualificationType\",\n    \"PractitionerRoleType\",\n    \"PractitionerRoleAvailableTimeType\",\n    \"PractitionerRoleNotAvailableType\",\n    \"ProcedureType\",\n    \"ProcedureFocalDeviceType\",\n    \"ProcedurePerformerType\",\n    \"ProdCharacteristicType\",\n    \"ProductShelfLifeType\",\n    \"ProvenanceType\",\n    \"ProvenanceAgentType\",\n    \"ProvenanceEntityType\",\n    \"QuantityType\",\n    \"QuestionnaireType\",\n    \"QuestionnaireItemType\",\n    \"QuestionnaireItemAnswerOptionType\",\n    \"QuestionnaireItemEnableWhenType\",\n    \"QuestionnaireItemInitialType\",\n    \"QuestionnaireResponseType\",\n    \"QuestionnaireResponseItemType\",\n    \"QuestionnaireResponseItemAnswerType\",\n    \"RangeType\",\n    \"RatioType\",\n    \"RatioRangeType\",\n    \"ReferenceType\",\n    \"RegulatedAuthorizationType\",\n    \"RegulatedAuthorizationCaseType\",\n    \"RelatedArtifactType\",\n    \"RelatedPersonType\",\n    \"RelatedPersonCommunicationType\",\n    \"RequestGroupType\",\n    \"RequestGroupActionType\",\n    \"RequestGroupActionConditionType\",\n    \"RequestGroupActionRelatedActionType\",\n    \"ResearchDefinitionType\",\n    \"ResearchElementDefinitionType\",\n    \"ResearchElementDefinitionCharacteristicType\",\n    \"ResearchStudyType\",\n    \"ResearchStudyArmType\",\n    \"ResearchStudyObjectiveType\",\n    \"ResearchSubjectType\",\n    \"ResourceType\",\n    \"RiskAssessmentType\",\n    \"RiskAssessmentPredictionType\",\n    \"SampledDataType\",\n    \"ScheduleType\",\n    \"SearchParameterType\",\n    \"SearchParameterComponentType\",\n    \"ServiceRequestType\",\n    \"SignatureType\",\n    \"SlotType\",\n    \"SpecimenType\",\n    \"SpecimenCollectionType\",\n    \"SpecimenContainerType\",\n    \"SpecimenDefinitionType\",\n    \"SpecimenDefinitionTypeTestedType\",\n    \"SpecimenDefinitionTypeTestedContainerType\",\n    \"SpecimenDefinitionTypeTestedContainerAdditiveType\",\n    \"SpecimenDefinitionTypeTestedHandlingType\",\n    \"SpecimenProcessingType\",\n    \"StructureDefinitionType\",\n    \"StructureDefinitionContextType\",\n    \"StructureDefinitionDifferentialType\",\n    \"StructureDefinitionMappingType\",\n    \"StructureDefinitionSnapshotType\",\n    \"StructureMapType\",\n    \"StructureMapGroupType\",\n    \"StructureMapGroupInputType\",\n    \"StructureMapGroupRuleType\",\n    \"StructureMapGroupRuleDependentType\",\n    \"StructureMapGroupRuleSourceType\",\n    \"StructureMapGroupRuleTargetType\",\n    \"StructureMapGroupRuleTargetParameterType\",\n    \"StructureMapStructureType\",\n    \"SubscriptionType\",\n    \"SubscriptionChannelType\",\n    \"SubscriptionStatusType\",\n    \"SubscriptionStatusNotificationEventType\",\n    \"SubscriptionTopicType\",\n    \"SubscriptionTopicCanFilterByType\",\n    \"SubscriptionTopicEventTriggerType\",\n    \"SubscriptionTopicNotificationShapeType\",\n    \"SubscriptionTopicResourceTriggerType\",\n    \"SubscriptionTopicResourceTriggerQueryCriteriaType\",\n    \"SubstanceType\",\n    \"SubstanceDefinitionType\",\n    \"SubstanceDefinitionCodeType\",\n    \"SubstanceDefinitionMoietyType\",\n    \"SubstanceDefinitionMolecularWeightType\",\n    \"SubstanceDefinitionNameType\",\n    \"SubstanceDefinitionNameOfficialType\",\n    \"SubstanceDefinitionPropertyType\",\n    \"SubstanceDefinitionRelationshipType\",\n    \"SubstanceDefinitionSourceMaterialType\",\n    \"SubstanceDefinitionStructureType\",\n    \"SubstanceDefinitionStructureRepresentationType\",\n    \"SubstanceIngredientType\",\n    \"SubstanceInstanceType\",\n    \"SupplyDeliveryType\",\n    \"SupplyDeliverySuppliedItemType\",\n    \"SupplyRequestType\",\n    \"SupplyRequestParameterType\",\n    \"TaskType\",\n    \"TaskInputType\",\n    \"TaskOutputType\",\n    \"TaskRestrictionType\",\n    \"TerminologyCapabilitiesType\",\n    \"TerminologyCapabilitiesClosureType\",\n    \"TerminologyCapabilitiesCodeSystemType\",\n    \"TerminologyCapabilitiesCodeSystemVersionType\",\n    \"TerminologyCapabilitiesCodeSystemVersionFilterType\",\n    \"TerminologyCapabilitiesExpansionType\",\n    \"TerminologyCapabilitiesExpansionParameterType\",\n    \"TerminologyCapabilitiesImplementationType\",\n    \"TerminologyCapabilitiesSoftwareType\",\n    \"TerminologyCapabilitiesTranslationType\",\n    \"TerminologyCapabilitiesValidateCodeType\",\n    \"TestReportType\",\n    \"TestReportParticipantType\",\n    \"TestReportSetupType\",\n    \"TestReportSetupActionType\",\n    \"TestReportSetupActionAssertType\",\n    \"TestReportSetupActionOperationType\",\n    \"TestReportTeardownType\",\n    \"TestReportTeardownActionType\",\n    \"TestReportTestType\",\n    \"TestReportTestActionType\",\n    \"TestScriptType\",\n    \"TestScriptDestinationType\",\n    \"TestScriptFixtureType\",\n    \"TestScriptMetadataType\",\n    \"TestScriptMetadataCapabilityType\",\n    \"TestScriptMetadataLinkType\",\n    \"TestScriptOriginType\",\n    \"TestScriptSetupType\",\n    \"TestScriptSetupActionType\",\n    \"TestScriptSetupActionAssertType\",\n    \"TestScriptSetupActionOperationType\",\n    \"TestScriptSetupActionOperationRequestHeaderType\",\n    \"TestScriptTeardownType\",\n    \"TestScriptTeardownActionType\",\n    \"TestScriptTestType\",\n    \"TestScriptTestActionType\",\n    \"TestScriptVariableType\",\n    \"TimingType\",\n    \"TimingRepeatType\",\n    \"TriggerDefinitionType\",\n    \"UsageContextType\",\n    \"ValueSetType\",\n    \"ValueSetComposeType\",\n    \"ValueSetComposeIncludeType\",\n    \"ValueSetComposeIncludeConceptType\",\n    \"ValueSetComposeIncludeConceptDesignationType\",\n    \"ValueSetComposeIncludeFilterType\",\n    \"ValueSetExpansionType\",\n    \"ValueSetExpansionContainsType\",\n    \"ValueSetExpansionParameterType\",\n    \"VerificationResultType\",\n    \"VerificationResultAttestationType\",\n    \"VerificationResultPrimarySourceType\",\n    \"VerificationResultValidatorType\",\n    \"VisionPrescriptionType\",\n    \"VisionPrescriptionLensSpecificationType\",\n    \"VisionPrescriptionLensSpecificationPrismType\",\n]\n"
  },
  {
    "path": "fhir/resources/R4B/flag.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Flag\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Flag(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Key information to flag to healthcare providers.\n    Prospective warnings of potential issues when providing care to the\n    patient.\n    \"\"\"\n\n    __resource_type__ = \"Flag\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Flag creator\",\n        description=\"The person, organization or device that created the flag.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Clinical, administrative, etc.\",\n        description=(\n            \"Allows a flag to be divided into different categories like clinical, \"\n            \"administrative etc. Intended to be used as a means of filtering which \"\n            \"flags are displayed to particular user or in a given context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Coded or textual message to display to user\",\n        description=(\n            \"The coded value or textual component of the flag to display to the \"\n            \"user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Alert relevant during encounter\",\n        description=\"This alert is only relevant during the encounter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Business identifiers assigned to this flag by the performer or other \"\n            \"systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when flag is active\",\n        description=(\n            \"The period of time from the activation of the flag to inactivation of \"\n            \"the flag. If the flag is active, the end of the period should be \"\n            \"unspecified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=\"Supports basic workflow.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who/What is flag about?\",\n        description=(\n            \"The patient, location, group, organization, or practitioner etc. this \"\n            \"is about record this flag is associated with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Location\",\n                \"Group\",\n                \"Organization\",\n                \"Practitioner\",\n                \"PlanDefinition\",\n                \"Medication\",\n                \"Procedure\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Flag`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"period\",\n            \"encounter\",\n            \"author\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Flag`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"period\",\n            \"encounter\",\n            \"author\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/goal.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Goal\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Goal(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes the intended objective(s) for a patient, group or organization.\n    Describes the intended objective(s) for a patient, group or organization\n    care, for example, weight loss, restoring an activity of daily living,\n    obtaining herd immunity via immunization, meeting a process improvement\n    objective, etc.\n    \"\"\"\n\n    __resource_type__ = \"Goal\"\n\n    achievementStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"achievementStatus\",\n        title=(\n            \"in-progress | improving | worsening | no-change | achieved | \"\n            \"sustaining | not-achieved | no-progress | not-attainable\"\n        ),\n        description=(\n            \"Describes the progression, or lack thereof, towards the goal against \"\n            \"the target.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    addresses: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"addresses\",\n        title=\"Issues addressed by this goal\",\n        description=(\n            \"The identified conditions and other health record elements that are \"\n            \"intended to be addressed by the goal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"MedicationStatement\",\n                \"NutritionOrder\",\n                \"ServiceRequest\",\n                \"RiskAssessment\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"E.g. Treatment, dietary, behavioral, etc.\",\n        description=\"Indicates a category the goal falls within.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"description\",\n        title=\"Code or text describing goal\",\n        description=(\n            \"Human-readable and/or coded description of a specific desired \"\n            'objective of care, such as \"control blood pressure\" or \"negotiate an '\n            'obstacle course\" or \"dance with child at wedding\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    expressedBy: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"expressedBy\",\n        title=\"Who's responsible for creating Goal?\",\n        description=\"Indicates whose goal this is - patient goal, practitioner goal, etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this goal\",\n        description=(\n            \"Business identifiers assigned to this goal by the performer or other \"\n            \"systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lifecycleStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"lifecycleStatus\",\n        title=(\n            \"proposed | planned | accepted | active | on-hold | completed | \"\n            \"cancelled | entered-in-error | rejected\"\n        ),\n        description=\"The state of the goal throughout its lifecycle.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposed\",\n                \"planned\",\n                \"accepted\",\n                \"active\",\n                \"on-hold\",\n                \"completed\",\n                \"cancelled\",\n                \"entered-in-error\",\n                \"rejected\",\n            ],\n        },\n    )\n    lifecycleStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lifecycleStatus\",\n        title=\"Extension field for ``lifecycleStatus``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the goal\",\n        description=\"Any comments related to the goal.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcomeCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"outcomeCode\",\n        title=\"What result was achieved regarding the goal?\",\n        description=(\n            \"Identifies the change (or lack of change) at the point when the status\"\n            \" of the goal is assessed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcomeReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"outcomeReference\",\n        title=\"Observation that resulted from goal\",\n        description=\"Details of what's changed (or not changed).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"high-priority | medium-priority | low-priority\",\n        description=(\n            \"Identifies the mutually agreed level of importance associated with \"\n            \"reaching/sustaining the goal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    startCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"startCodeableConcept\",\n        title=\"When goal pursuit begins\",\n        description=\"The date or event after which the goal should begin being pursued.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e start[x]\n            \"one_of_many\": \"start\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    startDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"startDate\",\n        title=\"When goal pursuit begins\",\n        description=\"The date or event after which the goal should begin being pursued.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e start[x]\n            \"one_of_many\": \"start\",\n            \"one_of_many_required\": False,\n        },\n    )\n    startDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_startDate\", title=\"Extension field for ``startDate``.\"\n    )\n\n    statusDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"When goal status took effect\",\n        description=(\n            \"Identifies when the current status.  I.e. When initially created, when\"\n            \" achieved, when cancelled, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    statusReason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current status.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    statusReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_statusReason\",\n        title=\"Extension field for ``statusReason``.\",\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who this goal is intended for\",\n        description=(\n            \"Identifies the patient, group or organization for whom the goal is \"\n            \"being established.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Organization\"],\n        },\n    )\n\n    target: typing.List[fhirtypes.GoalTargetType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Target outcome for the goal\",\n        description=\"Indicates what should be done by when.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Goal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"lifecycleStatus\",\n            \"achievementStatus\",\n            \"category\",\n            \"priority\",\n            \"description\",\n            \"subject\",\n            \"startDate\",\n            \"startCodeableConcept\",\n            \"target\",\n            \"statusDate\",\n            \"statusReason\",\n            \"expressedBy\",\n            \"addresses\",\n            \"note\",\n            \"outcomeCode\",\n            \"outcomeReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Goal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"lifecycleStatus\",\n            \"achievementStatus\",\n            \"category\",\n            \"priority\",\n            \"description\",\n            \"subject\",\n            \"startDate\",\n            \"startCodeableConcept\",\n            \"statusDate\",\n            \"expressedBy\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"lifecycleStatus\", \"lifecycleStatus__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"start\": [\"startCodeableConcept\", \"startDate\"]}\n        return one_of_many_fields\n\n\nclass GoalTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Target outcome for the goal.\n    Indicates what should be done by when.\n    \"\"\"\n\n    __resource_type__ = \"GoalTarget\"\n\n    detailBoolean: bool | None = Field(\n        default=None,\n        alias=\"detailBoolean\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n    detailBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailBoolean\",\n        title=\"Extension field for ``detailBoolean``.\",\n    )\n\n    detailCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"detailCodeableConcept\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"detailInteger\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n    detailInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailInteger\",\n        title=\"Extension field for ``detailInteger``.\",\n    )\n\n    detailQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"detailQuantity\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"detailRange\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"detailRatio\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"detailString\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n    detailString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailString\",\n        title=\"Extension field for ``detailString``.\",\n    )\n\n    dueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"dueDate\",\n        title=\"Reach goal on or before\",\n        description=(\n            \"Indicates either the date or the duration after start by which the \"\n            \"goal should be met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e due[x]\n            \"one_of_many\": \"due\",\n            \"one_of_many_required\": False,\n        },\n    )\n    dueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dueDate\", title=\"Extension field for ``dueDate``.\"\n    )\n\n    dueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"dueDuration\",\n        title=\"Reach goal on or before\",\n        description=(\n            \"Indicates either the date or the duration after start by which the \"\n            \"goal should be met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e due[x]\n            \"one_of_many\": \"due\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    measure: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"measure\",\n        title=\"The parameter whose value is being tracked\",\n        description=(\n            \"The parameter whose value is being tracked, e.g. body weight, blood \"\n            \"pressure, or hemoglobin A1c level.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GoalTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"measure\",\n            \"detailQuantity\",\n            \"detailRange\",\n            \"detailCodeableConcept\",\n            \"detailString\",\n            \"detailBoolean\",\n            \"detailInteger\",\n            \"detailRatio\",\n            \"dueDate\",\n            \"dueDuration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GoalTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"measure\",\n            \"detailQuantity\",\n            \"detailRange\",\n            \"detailCodeableConcept\",\n            \"detailString\",\n            \"detailBoolean\",\n            \"detailInteger\",\n            \"detailRatio\",\n            \"dueDate\",\n            \"dueDuration\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"detail\": [\n                \"detailBoolean\",\n                \"detailCodeableConcept\",\n                \"detailInteger\",\n                \"detailQuantity\",\n                \"detailRange\",\n                \"detailRatio\",\n                \"detailString\",\n            ],\n            \"due\": [\"dueDate\", \"dueDuration\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/graphdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/GraphDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass GraphDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a graph of resources.\n    A formal computable definition of a graph of resources - that is, a\n    coherent set of resources that form a graph by following references. The\n    Graph Definition resource defines a set and makes rules about the set.\n    \"\"\"\n\n    __resource_type__ = \"GraphDefinition\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the graph definition was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the graph definition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the graph definition\",\n        description=(\n            \"A free text natural language description of the graph definition from \"\n            \"a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this graph definition is authored for\"\n            \" testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for graph definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the graph definition is intended\"\n            \" to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.GraphDefinitionLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links this graph makes rules about\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this graph definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the graph definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile on base resource\",\n        description=\"The profile that describes the use of the base resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the graph \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this graph definition is defined\",\n        description=(\n            \"Explanation of why this graph definition is needed and why it has been\"\n            \" designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    start: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Type of resource at which the graph starts\",\n        description=\"The type of FHIR resource at which instances of this graph start.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this graph definition. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this graph definition, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this graph definition when it\"\n            \" is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this graph definition is (or will be) published. This URL \"\n            \"can be the target of a canonical reference. It SHALL remain the same \"\n            \"when the graph definition is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate graph definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the graph definition\",\n        description=(\n            \"The identifier that is used to identify this version of the graph \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the graph definition \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GraphDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"start\",\n            \"profile\",\n            \"link\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GraphDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"start\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"name\", \"name__ext\"),\n            (\"start\", \"start__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass GraphDefinitionLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links this graph makes rules about.\n    \"\"\"\n\n    __resource_type__ = \"GraphDefinitionLink\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Why this link is specified\",\n        description=(\n            \"Information about why this link is of interest in this graph \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum occurrences for this link\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum occurrences for this link\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path in the resource that contains the link\",\n        description=(\n            \"A FHIR expression that identifies one of FHIR References to other \"\n            \"resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    sliceName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sliceName\",\n        title=\"Which slice (if profiled)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sliceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sliceName\", title=\"Extension field for ``sliceName``.\"\n    )\n\n    target: typing.List[fhirtypes.GraphDefinitionLinkTargetType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Potential target for the link\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GraphDefinitionLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"path\",\n            \"sliceName\",\n            \"min\",\n            \"max\",\n            \"description\",\n            \"target\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GraphDefinitionLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass GraphDefinitionLinkTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Potential target for the link.\n    \"\"\"\n\n    __resource_type__ = \"GraphDefinitionLinkTarget\"\n\n    compartment: typing.List[\n        fhirtypes.GraphDefinitionLinkTargetCompartmentType\n    ] | None = Field(\n        default=None,\n        alias=\"compartment\",\n        title=\"Compartment Consistency Rules\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.GraphDefinitionLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Additional links from target resource\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    params: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"params\",\n        title=\"Criteria for reverse lookup\",\n        description=\"A set of parameters to look up.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    params__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_params\", title=\"Extension field for ``params``.\"\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile for the target resource\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of resource this link refers to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GraphDefinitionLinkTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"params\",\n            \"profile\",\n            \"compartment\",\n            \"link\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GraphDefinitionLinkTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass GraphDefinitionLinkTargetCompartment(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Compartment Consistency Rules.\n    \"\"\"\n\n    __resource_type__ = \"GraphDefinitionLinkTargetCompartment\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Patient | Encounter | RelatedPerson | Practitioner | Device\",\n        description=\"Identifies the compartment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"Patient\",\n                \"Encounter\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"Device\",\n            ],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Documentation for FHIRPath expression\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Custom rule, as a FHIRPath expression\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    rule: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"identical | matching | different | custom\",\n        description=\"identical | matching | different | no-rule | custom.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"identical\", \"matching\", \"different\", \"custom\"],\n        },\n    )\n    rule__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rule\", title=\"Extension field for ``rule``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"condition | requirement\",\n        description=(\n            \"Defines how the compartment rule is used - whether it it is used to \"\n            \"test whether resources are subject to the rule, or whether it is a \"\n            \"rule that must be followed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"condition\", \"requirement\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GraphDefinitionLinkTargetCompartment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"use\",\n            \"code\",\n            \"rule\",\n            \"expression\",\n            \"description\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GraphDefinitionLinkTargetCompartment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"code\", \"code__ext\"),\n            (\"rule\", \"rule__ext\"),\n            (\"use\", \"use__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/group.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Group\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Group(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Group of multiple entities.\n    Represents a defined collection of entities that may be discussed or acted\n    upon collectively but which are not expected to act collectively, and are\n    not formally or legally recognized; i.e. a collection of entities that\n    isn't an Organization.\n    \"\"\"\n\n    __resource_type__ = \"Group\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this group's record is in active use\",\n        description=(\n            \"Indicates whether the record for the group is available for use or is \"\n            \"merely being retained for historical purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    actual: bool | None = Field(\n        default=None,\n        alias=\"actual\",\n        title=\"Descriptive or actual\",\n        description=(\n            \"If true, indicates that the resource refers to a specific group of \"\n            \"real individuals.  If false, the group defines a set of intended \"\n            \"individuals.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actual\", title=\"Extension field for ``actual``.\"\n    )\n\n    characteristic: typing.List[fhirtypes.GroupCharacteristicType] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"Include / Exclude group members by Trait\",\n        description=(\n            \"Identifies traits whose presence r absence is shared by members of the\"\n            \" group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Kind of Group members\",\n        description=(\n            'Provides a specific type of resource the group includes; e.g. \"cow\", '\n            '\"syringe\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique id\",\n        description=\"A unique business identifier for this group.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingEntity: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingEntity\",\n        title=\"Entity that is the custodian of the Group's definition\",\n        description=(\n            \"Entity responsible for defining and maintaining Group characteristics \"\n            \"and/or registered members.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    member: typing.List[fhirtypes.GroupMemberType] | None = Field(\n        default=None,\n        alias=\"member\",\n        title=\"Who or what is in group\",\n        description=\"Identifies the resource instances that are members of the group.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Label for Group\",\n        description=(\n            \"A label assigned to the group for human identification and \"\n            \"communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    quantity: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Number of members\",\n        description=(\n            \"A count of the number of resource instances that are part of the \" \"group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_quantity\", title=\"Extension field for ``quantity``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"person | animal | practitioner | device | medication | substance\",\n        description=(\n            \"Identifies the broad classification of the kind of resources the group\"\n            \" includes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"person\",\n                \"animal\",\n                \"practitioner\",\n                \"device\",\n                \"medication\",\n                \"substance\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Group`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"type\",\n            \"actual\",\n            \"code\",\n            \"name\",\n            \"quantity\",\n            \"managingEntity\",\n            \"characteristic\",\n            \"member\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Group`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"type\",\n            \"actual\",\n            \"code\",\n            \"name\",\n            \"quantity\",\n            \"managingEntity\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"actual\", \"actual__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass GroupCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Include / Exclude group members by Trait.\n    Identifies traits whose presence r absence is shared by members of the\n    group.\n    \"\"\"\n\n    __resource_type__ = \"GroupCharacteristic\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Kind of characteristic\",\n        description=\"A code that identifies the kind of trait being asserted.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    exclude: bool | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=\"Group includes or excludes\",\n        description=(\n            \"If true, indicates the characteristic is one that is NOT held by \"\n            \"members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_exclude\", title=\"Extension field for ``exclude``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period over which characteristic is tested\",\n        description=(\n            \"The period over which the characteristic is tested; e.g. the patient \"\n            \"had an operation during the month of June.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GroupCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueBoolean\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueReference\",\n            \"exclude\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GroupCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"exclude\", \"exclude__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueReference\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass GroupMember(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who or what is in group.\n    Identifies the resource instances that are members of the group.\n    \"\"\"\n\n    __resource_type__ = \"GroupMember\"\n\n    entity: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"entity\",\n        title=\"Reference to the group member\",\n        description=(\n            \"A reference to the entity that is a member of the group. Must be \"\n            \"consistent with Group.type. If the entity is another group, then the \"\n            \"type must be the same.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Medication\",\n                \"Substance\",\n                \"Group\",\n            ],\n        },\n    )\n\n    inactive: bool | None = Field(\n        default=None,\n        alias=\"inactive\",\n        title=\"If member is no longer in group\",\n        description=(\n            \"A flag to indicate that the member is no longer in the group, but \"\n            \"previously may have been a member.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_inactive\", title=\"Extension field for ``inactive``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period member belonged to the group\",\n        description=\"The period that the member was in the group, if known.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GroupMember`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"entity\", \"period\", \"inactive\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GroupMember`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/guidanceresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/GuidanceResponse\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass GuidanceResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The formal response to a guidance request.\n    A guidance response is the formal response to a guidance request, including\n    any output parameters returned by the evaluation, as well as the\n    description of any proposed actions to be taken.\n    \"\"\"\n\n    __resource_type__ = \"GuidanceResponse\"\n\n    dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"dataRequirement\",\n        title=\"Additional required data\",\n        description=(\n            \"If the evaluation could not be completed due to lack of information, \"\n            \"or additional information would potentially result in a more accurate \"\n            \"response, this element will a description of the data required in \"\n            \"order to proceed with the evaluation. A subsequent request to the \"\n            \"service should include this data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter during which the response was returned\",\n        description=(\n            \"The encounter during which this response was created or to which the \"\n            \"creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    evaluationMessage: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"evaluationMessage\",\n        title=\"Messages resulting from the evaluation of the artifact or artifacts\",\n        description=(\n            \"Messages resulting from the evaluation of the artifact or artifacts. \"\n            \"As part of evaluating the request, the engine may produce \"\n            \"informational or warning messages. These messages will be provided by \"\n            \"this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationOutcome\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Allows a service to provide  unique, business identifiers for the \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    moduleCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"moduleCanonical\",\n        title=\"What guidance was requested\",\n        description=(\n            \"An identifier, CodeableConcept or canonical reference to the guidance \"\n            \"that was requested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e module[x]\n            \"one_of_many\": \"module\",\n            \"one_of_many_required\": True,\n        },\n    )\n    moduleCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_moduleCanonical\",\n        title=\"Extension field for ``moduleCanonical``.\",\n    )\n\n    moduleCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"moduleCodeableConcept\",\n        title=\"What guidance was requested\",\n        description=(\n            \"An identifier, CodeableConcept or canonical reference to the guidance \"\n            \"that was requested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e module[x]\n            \"one_of_many\": \"module\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    moduleUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"moduleUri\",\n        title=\"What guidance was requested\",\n        description=(\n            \"An identifier, CodeableConcept or canonical reference to the guidance \"\n            \"that was requested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e module[x]\n            \"one_of_many\": \"module\",\n            \"one_of_many_required\": True,\n        },\n    )\n    moduleUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_moduleUri\", title=\"Extension field for ``moduleUri``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional notes about the response\",\n        description=(\n            \"Provides a mechanism to communicate additional information about the \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When the guidance response was processed\",\n        description=\"Indicates when the guidance response was processed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    outputParameters: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"outputParameters\",\n        title=\"The output parameters of the evaluation, if any\",\n        description=(\n            \"The output parameters of the evaluation, if any. Many modules will \"\n            \"result in the return of specific resources such as procedure or \"\n            \"communication requests that are returned as part of the operation \"\n            \"result. However, modules may define specific outputs that would be \"\n            \"returned as the result of the evaluation, and these would be returned \"\n            \"in this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Parameters\"],\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Device returning the guidance\",\n        description=\"Provides a reference to the device that performed the guidance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why guidance is needed\",\n        description=(\n            \"Describes the reason for the guidance response in coded or textual \"\n            \"form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why guidance is needed\",\n        description=(\n            \"Indicates the reason the request was initiated. This is typically \"\n            \"provided as a parameter to the evaluation and echoed by the service, \"\n            \"although for some use cases, such as subscription- or event-based \"\n            \"scenarios, it may provide an indication of the cause for the response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    requestIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"requestIdentifier\",\n        title=\"The identifier of the request associated with this response, if any\",\n        description=(\n            \"The identifier of the request associated with this response. If an \"\n            \"identifier was given as part of the request, it will be reproduced \"\n            \"here to enable the requester to more easily identify the response in a\"\n            \" multi-request scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    result: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"Proposed actions, if any\",\n        description=\"The actions, if any, produced by the evaluation of the artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\", \"RequestGroup\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"success | data-requested | data-required | in-progress | failure | \"\n            \"entered-in-error\"\n        ),\n        description=(\n            \"The status of the response. If the evaluation is completed \"\n            \"successfully, the status will indicate success. However, in order to \"\n            \"complete the evaluation, the engine may require more information. In \"\n            \"this case, the status will be data-required, and the response will \"\n            \"contain a description of the additional required information. If the \"\n            \"evaluation completed successfully, but the engine determines that a \"\n            \"potentially more accurate response could be provided if more data was \"\n            \"available, the status will be data-requested, and the response will \"\n            \"contain a description of the additional requested information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"success\",\n                \"data-requested\",\n                \"data-required\",\n                \"in-progress\",\n                \"failure\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Patient the request was performed for\",\n        description=\"The patient for which the request was processed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GuidanceResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"requestIdentifier\",\n            \"identifier\",\n            \"moduleUri\",\n            \"moduleCanonical\",\n            \"moduleCodeableConcept\",\n            \"status\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"performer\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"note\",\n            \"evaluationMessage\",\n            \"outputParameters\",\n            \"result\",\n            \"dataRequirement\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GuidanceResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"requestIdentifier\",\n            \"identifier\",\n            \"moduleUri\",\n            \"moduleCanonical\",\n            \"moduleCodeableConcept\",\n            \"status\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"module\": [\"moduleCanonical\", \"moduleCodeableConcept\", \"moduleUri\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/healthcareservice.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/HealthcareService\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass HealthcareService(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The details of a healthcare service available at a location.\n    \"\"\"\n\n    __resource_type__ = \"HealthcareService\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this HealthcareService record is in active use\",\n        description=(\n            \"This flag is used to mark the record to not be used. This is not used \"\n            \"when a center is closed for maintenance, or for holidays, the \"\n            \"notAvailable period is to be used for this.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    appointmentRequired: bool | None = Field(\n        default=None,\n        alias=\"appointmentRequired\",\n        title=\"If an appointment is required for access to this service\",\n        description=(\n            \"Indicates whether or not a prospective consumer will require an \"\n            \"appointment for a particular service at a site to be provided by the \"\n            \"Organization. Indicates if an appointment is required for access to \"\n            \"this service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    appointmentRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_appointmentRequired\",\n        title=\"Extension field for ``appointmentRequired``.\",\n    )\n\n    availabilityExceptions: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"availabilityExceptions\",\n        title=\"Description of availability exceptions\",\n        description=(\n            \"A description of site availability exceptions, e.g. public holiday \"\n            \"availability. Succinctly describing all possible exceptions to normal \"\n            \"site availability as details in the available Times and not available \"\n            \"Times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availabilityExceptions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availabilityExceptions\",\n        title=\"Extension field for ``availabilityExceptions``.\",\n    )\n\n    availableTime: typing.List[\n        fhirtypes.HealthcareServiceAvailableTimeType\n    ] | None = Field(\n        default=None,\n        alias=\"availableTime\",\n        title=\"Times the Service Site is available\",\n        description=\"A collection of times that the Service Site is available.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Broad category of service being performed or delivered\",\n        description=\"Identifies the broad category of service being performed or delivered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    characteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"Collection of characteristics (attributes)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=(\n            \"Additional description and/or any specific issues not covered \" \"elsewhere\"\n        ),\n        description=(\n            \"Any additional description of the service and/or any specific issues \"\n            \"not covered by the other attributes, which can be displayed as further\"\n            \" detail under the serviceName.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    communication: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"communication\",\n        title=\"The language that this service is offered in\",\n        description=(\n            \"Some services are specifically made available in multiple languages, \"\n            \"this property permits a directory to declare the languages this is \"\n            \"offered in. Typically this is only provided where a service operates \"\n            \"in communities with mixed languages used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"coverageArea\",\n        title=\"Location(s) service is intended for/available to\",\n        description=(\n            \"The location(s) that this service is available to (not where the \"\n            \"service is provided).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    eligibility: typing.List[fhirtypes.HealthcareServiceEligibilityType] | None = Field(\n        default=None,\n        alias=\"eligibility\",\n        title=\"Specific eligibility requirements required to use the service\",\n        description=(\n            \"Does this service have specific eligibility requirements that need to \"\n            \"be met in order to use the service?\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to electronic services operated \"\n            \"for the healthcare service\"\n        ),\n        description=(\n            \"Technical endpoints providing access to services operated for the \"\n            \"specific healthcare services defined at this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    extraDetails: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"extraDetails\",\n        title=(\n            \"Extra details about the service that can't be placed in the other \"\n            \"fields\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    extraDetails__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_extraDetails\",\n        title=\"Extension field for ``extraDetails``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifiers for this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Location(s) where service may be provided\",\n        description=\"The location(s) where this healthcare service may be provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Description of service as presented to a consumer while searching\",\n        description=(\n            \"Further description of the service as it would be presented to a \"\n            \"consumer while searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    notAvailable: typing.List[\n        fhirtypes.HealthcareServiceNotAvailableType\n    ] | None = Field(\n        default=None,\n        alias=\"notAvailable\",\n        title=\"Not available during this time due to provided reason\",\n        description=(\n            \"The HealthcareService is not available during this period of time due \"\n            \"to the provided reason.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    photo: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Facilitates quick identification of the service\",\n        description=(\n            \"If there is a photo/symbol associated with this HealthcareService, it \"\n            \"may be included here to facilitate quick identification of the service\"\n            \" in a list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    program: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"program\",\n        title=\"Programs that this service is applicable to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    providedBy: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"providedBy\",\n        title=\"Organization that provides this service\",\n        description=\"The organization that provides this healthcare service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    referralMethod: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"referralMethod\",\n        title=\"Ways that the service accepts referrals\",\n        description=(\n            \"Ways that the service accepts referrals, if this is not provided then \"\n            \"it is implied that no referral is required.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    serviceProvisionCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceProvisionCode\",\n        title=\"Conditions under which service is available/offered\",\n        description=(\n            \"The code(s) that detail the conditions under which the healthcare \"\n            \"service is available/offered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=\"Specialties handled by the HealthcareService\",\n        description=(\n            \"Collection of specialties handled by the service site. This is more of\"\n            \" a medical term.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contacts related to the healthcare service\",\n        description=\"List of contacts related to this specific healthcare service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of service that may be delivered or performed\",\n        description=\"The specific type of service that may be delivered or performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``HealthcareService`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"providedBy\",\n            \"category\",\n            \"type\",\n            \"specialty\",\n            \"location\",\n            \"name\",\n            \"comment\",\n            \"extraDetails\",\n            \"photo\",\n            \"telecom\",\n            \"coverageArea\",\n            \"serviceProvisionCode\",\n            \"eligibility\",\n            \"program\",\n            \"characteristic\",\n            \"communication\",\n            \"referralMethod\",\n            \"appointmentRequired\",\n            \"availableTime\",\n            \"notAvailable\",\n            \"availabilityExceptions\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``HealthcareService`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"providedBy\",\n            \"category\",\n            \"type\",\n            \"specialty\",\n            \"location\",\n            \"name\",\n            \"comment\",\n            \"photo\",\n        ]\n\n\nclass HealthcareServiceAvailableTime(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Times the Service Site is available.\n    A collection of times that the Service Site is available.\n    \"\"\"\n\n    __resource_type__ = \"HealthcareServiceAvailableTime\"\n\n    allDay: bool | None = Field(\n        default=None,\n        alias=\"allDay\",\n        title=\"Always available? e.g. 24 hour service\",\n        description=(\n            \"Is this always available? (hence times are irrelevant) e.g. 24 hour \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    allDay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_allDay\", title=\"Extension field for ``allDay``.\"\n    )\n\n    availableEndTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"availableEndTime\",\n        title=\"Closing time of day (ignored if allDay = true)\",\n        description=(\n            \"The closing time of day. Note: If the AllDay flag is set, then this \"\n            \"time is ignored.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availableEndTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availableEndTime\",\n        title=\"Extension field for ``availableEndTime``.\",\n    )\n\n    availableStartTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"availableStartTime\",\n        title=\"Opening time of day (ignored if allDay = true)\",\n        description=(\n            \"The opening time of day. Note: If the AllDay flag is set, then this \"\n            \"time is ignored.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availableStartTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availableStartTime\",\n        title=\"Extension field for ``availableStartTime``.\",\n    )\n\n    daysOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"daysOfWeek\",\n        title=\"mon | tue | wed | thu | fri | sat | sun\",\n        description=(\n            \"Indicates which days of the week are available between the start and \"\n            \"end Times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"],\n        },\n    )\n    daysOfWeek__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_daysOfWeek\", title=\"Extension field for ``daysOfWeek``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``HealthcareServiceAvailableTime`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"daysOfWeek\",\n            \"allDay\",\n            \"availableStartTime\",\n            \"availableEndTime\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``HealthcareServiceAvailableTime`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass HealthcareServiceEligibility(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specific eligibility requirements required to use the service.\n    Does this service have specific eligibility requirements that need to be\n    met in order to use the service?\n    \"\"\"\n\n    __resource_type__ = \"HealthcareServiceEligibility\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Coded value for the eligibility\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Describes the eligibility conditions for the service\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``HealthcareServiceEligibility`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"comment\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``HealthcareServiceEligibility`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass HealthcareServiceNotAvailable(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Not available during this time due to provided reason.\n    The HealthcareService is not available during this period of time due to\n    the provided reason.\n    \"\"\"\n\n    __resource_type__ = \"HealthcareServiceNotAvailable\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Reason presented to the user explaining why time not available\",\n        description=(\n            \"The reason that can be presented to the user as to why this time is \"\n            \"not available.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    during: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"during\",\n        title=\"Service not available from this date\",\n        description=(\n            \"Service is not available (seasonally or for a public holiday) from \"\n            \"this date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``HealthcareServiceNotAvailable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"description\", \"during\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``HealthcareServiceNotAvailable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"description\", \"description__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/humanname.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/HumanName\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass HumanName(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Name of a human - parts and usage.\n    A human's name with the ability to identify parts and usage.\n    \"\"\"\n\n    __resource_type__ = \"HumanName\"\n\n    family: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"family\",\n        title=\"Family name (often called 'Surname')\",\n        description=(\n            \"The part of a name that links to the genealogy. In some cultures (e.g.\"\n            \" Eritrea) the family name of a son is the first name of his father.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    family__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_family\", title=\"Extension field for ``family``.\"\n    )\n\n    given: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"given\",\n        title=\"Given names (not always 'first'). Includes middle names\",\n        description=\"Given name.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    given__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_given\", title=\"Extension field for ``given``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when name was/is in use\",\n        description=(\n            \"Indicates the period of time when this name was valid for the named \"\n            \"person.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    prefix: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"prefix\",\n        title=\"Parts that come before the name\",\n        description=(\n            \"Part of the name that is acquired as a title due to academic, legal, \"\n            \"employment or nobility status, etc. and that appears at the start of \"\n            \"the name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    prefix__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_prefix\", title=\"Extension field for ``prefix``.\"\n    )\n\n    suffix: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"suffix\",\n        title=\"Parts that come after the name\",\n        description=(\n            \"Part of the name that is acquired as a title due to academic, legal, \"\n            \"employment or nobility status, etc. and that appears at the end of the\"\n            \" name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    suffix__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_suffix\", title=\"Extension field for ``suffix``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text representation of the full name\",\n        description=(\n            \"Specifies the entire name as it should be displayed e.g. on an \"\n            \"application UI. This may be provided instead of or as well as the \"\n            \"specific parts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"usual | official | temp | nickname | anonymous | old | maiden\",\n        description=\"Identifies the purpose for this name.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"usual\",\n                \"official\",\n                \"temp\",\n                \"nickname\",\n                \"anonymous\",\n                \"old\",\n                \"maiden\",\n            ],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``HumanName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"use\",\n            \"text\",\n            \"family\",\n            \"given\",\n            \"prefix\",\n            \"suffix\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``HumanName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"use\", \"text\", \"family\", \"given\", \"prefix\", \"suffix\", \"period\"]\n"
  },
  {
    "path": "fhir/resources/R4B/identifier.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Identifier\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Identifier(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An identifier intended for computation.\n    An identifier - identifies some entity uniquely and unambiguously.\n    Typically this is used for business identifiers.\n    \"\"\"\n\n    __resource_type__ = \"Identifier\"\n\n    assigner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"assigner\",\n        title=\"Organization that issued id (may be just text)\",\n        description=\"Organization that issued/manages the identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when id is/was valid for use\",\n        description=\"Time period during which identifier is/was valid for use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"The namespace for the identifier value\",\n        description=(\n            \"Establishes the namespace for the value - that is, a URL that \"\n            \"describes a set values that are unique.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Description of identifier\",\n        description=(\n            \"A coded type for the identifier that can be used to determine which \"\n            \"identifier to use for a specific purpose.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"usual | official | temp | secondary | old (If known)\",\n        description=\"The purpose of this identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"usual\", \"official\", \"temp\", \"secondary\", \"old\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The value that is unique\",\n        description=(\n            \"The portion of the identifier typically relevant to the user and which\"\n            \" is unique within the context of the system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Identifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"use\",\n            \"type\",\n            \"system\",\n            \"value\",\n            \"period\",\n            \"assigner\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Identifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"use\", \"type\", \"system\", \"value\", \"period\", \"assigner\"]\n"
  },
  {
    "path": "fhir/resources/R4B/imagingstudy.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImagingStudy\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ImagingStudy(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of images produced in single study (one or more series of references\n    images).\n    Representation of the content produced in a DICOM imaging study. A study\n    comprises a set of series, each of which includes a set of Service-Object\n    Pair Instances (SOP Instances - images or other data) acquired or produced\n    in a common context.  A series is of only one modality (e.g. X-ray, CT, MR,\n    ultrasound), but a study may have multiple series of different modalities.\n    \"\"\"\n\n    __resource_type__ = \"ImagingStudy\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled\",\n        description=(\n            \"A list of the diagnostic requests that resulted in this imaging study \"\n            \"being performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"ServiceRequest\",\n                \"Appointment\",\n                \"AppointmentResponse\",\n                \"Task\",\n            ],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Institution-generated description\",\n        description=(\n            \"The Imaging Manager description of the study. Institution-generated \"\n            \"description or classification of the Study (component) performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter with which this imaging study is associated\",\n        description=(\n            \"The healthcare event (e.g. a patient and healthcare provider \"\n            \"interaction) during which this ImagingStudy is made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Study access endpoint\",\n        description=(\n            \"The network service providing access (e.g., query, view, or retrieval)\"\n            \" for the study. See implementation notes for information about using \"\n            \"DICOM endpoints. A study-level endpoint applies to each series in the \"\n            \"study, unless overridden by a series-level endpoint with the same \"\n            \"Endpoint.connectionType.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers for the whole study\",\n        description=(\n            \"Identifiers for the ImagingStudy such as DICOM Study Instance UID, and\"\n            \" Accession Number.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    interpreter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"interpreter\",\n        title=\"Who interpreted images\",\n        description=\"Who read the study and interpreted the images or other content.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where ImagingStudy occurred\",\n        description=\"The principal physical location where the ImagingStudy was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    modality: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"modality\",\n        title=\"All series modality if actual acquisition modalities\",\n        description=(\n            \"A list of all the series.modality values that are actual acquisition \"\n            \"modalities, i.e. those in the DICOM Context Group 29 (value set OID \"\n            \"1.2.840.10008.6.1.19).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"User-defined comments\",\n        description=(\n            \"Per the recommended DICOM mapping, this element is derived from the \"\n            \"Study Description attribute (0008,1030). Observations or findings \"\n            \"about the imaging study should be recorded in another resource, e.g. \"\n            \"Observation, and not in this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    numberOfInstances: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfInstances\",\n        title=\"Number of Study Related Instances\",\n        description=(\n            \"Number of SOP Instances in Study. This value given may be larger than \"\n            \"the number of instance elements this resource contains due to resource\"\n            \" availability, security, or other factors. This element should be \"\n            \"present if any instance elements are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numberOfInstances__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfInstances\",\n        title=\"Extension field for ``numberOfInstances``.\",\n    )\n\n    numberOfSeries: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfSeries\",\n        title=\"Number of Study Related Series\",\n        description=(\n            \"Number of Series in the Study. This value given may be larger than the\"\n            \" number of series elements this Resource contains due to resource \"\n            \"availability, security, or other factors. This element should be \"\n            \"present if any series elements are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numberOfSeries__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfSeries\",\n        title=\"Extension field for ``numberOfSeries``.\",\n    )\n\n    procedureCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"procedureCode\",\n        title=\"The performed procedure code\",\n        description=\"The code for the performed procedure type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    procedureReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"procedureReference\",\n        title=\"The performed Procedure reference\",\n        description=\"The procedure which this ImagingStudy was part of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why the study was requested\",\n        description=(\n            \"Description of clinical condition indicating why the ImagingStudy was \"\n            \"requested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why was study performed\",\n        description=\"Indicates another resource whose existence justifies this Study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"Media\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    referrer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referrer\",\n        title=\"Referring physician\",\n        description=\"The requesting/referring physician.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    series: typing.List[fhirtypes.ImagingStudySeriesType] | None = Field(\n        default=None,\n        alias=\"series\",\n        title=\"Each study has one or more series of instances\",\n        description=\"Each study has one or more series of images or other content.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    started: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"started\",\n        title=\"When the study was started\",\n        description=\"Date and time the study started.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    started__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_started\", title=\"Extension field for ``started``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | available | cancelled | entered-in-error | unknown\",\n        description=\"The current state of the ImagingStudy.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"registered\",\n                \"available\",\n                \"cancelled\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who or what is the subject of the study\",\n        description=\"The subject, typically a patient, of the imaging study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Device\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"modality\",\n            \"subject\",\n            \"encounter\",\n            \"started\",\n            \"basedOn\",\n            \"referrer\",\n            \"interpreter\",\n            \"endpoint\",\n            \"numberOfSeries\",\n            \"numberOfInstances\",\n            \"procedureReference\",\n            \"procedureCode\",\n            \"location\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"note\",\n            \"description\",\n            \"series\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"modality\",\n            \"subject\",\n            \"encounter\",\n            \"started\",\n            \"basedOn\",\n            \"referrer\",\n            \"interpreter\",\n            \"endpoint\",\n            \"numberOfSeries\",\n            \"numberOfInstances\",\n            \"procedureReference\",\n            \"procedureCode\",\n            \"location\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"note\",\n            \"description\",\n            \"series\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ImagingStudySeries(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Each study has one or more series of instances.\n    Each study has one or more series of images or other content.\n    \"\"\"\n\n    __resource_type__ = \"ImagingStudySeries\"\n\n    bodySite: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Body part examined\",\n        description=(\n            \"The anatomic structures examined. See DICOM Part 16 Annex L (http://di\"\n            \"com.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html)\"\n            \" for DICOM to SNOMED-CT mappings. The bodySite may indicate the \"\n            \"laterality of body part imaged; if so, it shall be consistent with any\"\n            \" content of ImagingStudy.series.laterality.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"A short human readable summary of the series\",\n        description=\"A description of the series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Series access endpoint\",\n        description=(\n            \"The network service providing access (e.g., query, view, or retrieval)\"\n            \" for this series. See implementation notes for information about using\"\n            \" DICOM endpoints. A series-level endpoint, if present, has precedence \"\n            \"over a study-level endpoint with the same Endpoint.connectionType.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    instance: typing.List[fhirtypes.ImagingStudySeriesInstanceType] | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"A single SOP instance from the series\",\n        description=(\n            \"A single SOP instance within the series, e.g. an image, or \"\n            \"presentation state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    laterality: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"laterality\",\n        title=\"Body part laterality\",\n        description=(\n            \"The laterality of the (possibly paired) anatomic structures examined. \"\n            \"E.g., the left knee, both lungs, or unpaired abdomen. If present, \"\n            \"shall be consistent with any laterality information indicated in \"\n            \"ImagingStudy.series.bodySite.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    modality: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"modality\",\n        title=\"The modality of the instances in the series\",\n        description=\"The modality of this series sequence.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    number: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"Numeric identifier of this series\",\n        description=\"The numeric identifier of this series in the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    numberOfInstances: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfInstances\",\n        title=\"Number of Series Related Instances\",\n        description=(\n            \"Number of SOP Instances in the Study. The value given may be larger \"\n            \"than the number of instance elements this resource contains due to \"\n            \"resource availability, security, or other factors. This element should\"\n            \" be present if any instance elements are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numberOfInstances__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfInstances\",\n        title=\"Extension field for ``numberOfInstances``.\",\n    )\n\n    performer: typing.List[fhirtypes.ImagingStudySeriesPerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed the series\",\n        description=\"Indicates who or what performed the series and how they were involved.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specimen: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Specimen imaged\",\n        description=\"The specimen imaged, e.g., for whole slide imaging of a biopsy.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    started: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"started\",\n        title=\"When the series started\",\n        description=\"The date and time the series was started.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    started__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_started\", title=\"Extension field for ``started``.\"\n    )\n\n    uid: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"uid\",\n        title=\"DICOM Series Instance UID for the series\",\n        description=\"The DICOM Series Instance UID for the series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uid\", title=\"Extension field for ``uid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingStudySeries`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"uid\",\n            \"number\",\n            \"modality\",\n            \"description\",\n            \"numberOfInstances\",\n            \"endpoint\",\n            \"bodySite\",\n            \"laterality\",\n            \"specimen\",\n            \"started\",\n            \"performer\",\n            \"instance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingStudySeries`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"uid\",\n            \"number\",\n            \"modality\",\n            \"description\",\n            \"numberOfInstances\",\n            \"endpoint\",\n            \"bodySite\",\n            \"laterality\",\n            \"specimen\",\n            \"started\",\n            \"performer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"uid\", \"uid__ext\")]\n        return required_fields\n\n\nclass ImagingStudySeriesInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A single SOP instance from the series.\n    A single SOP instance within the series, e.g. an image, or presentation\n    state.\n    \"\"\"\n\n    __resource_type__ = \"ImagingStudySeriesInstance\"\n\n    number: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"The number of this instance in the series\",\n        description=\"The number of instance in the series.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    sopClass: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"sopClass\",\n        title=\"DICOM class type\",\n        description=\"DICOM instance  type.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Description of instance\",\n        description=\"The description of the instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    uid: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"uid\",\n        title=\"DICOM SOP Instance UID\",\n        description=\"The DICOM SOP Instance UID for this image or other DICOM content.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uid\", title=\"Extension field for ``uid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingStudySeriesInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"uid\",\n            \"sopClass\",\n            \"number\",\n            \"title\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingStudySeriesInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"uid\", \"uid__ext\")]\n        return required_fields\n\n\nclass ImagingStudySeriesPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed the series.\n    Indicates who or what performed the series and how they were involved.\n    \"\"\"\n\n    __resource_type__ = \"ImagingStudySeriesPerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Who performed the series\",\n        description=\"Indicates who or what performed the series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of performance\",\n        description=\"Distinguishes the type of involvement of the performer in the series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingStudySeriesPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingStudySeriesPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n"
  },
  {
    "path": "fhir/resources/R4B/immunization.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Immunization\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Immunization(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Immunization event information.\n    Describes the event of a patient being administered a vaccine or a record\n    of an immunization as reported by a patient, a clinician or another party.\n    \"\"\"\n\n    __resource_type__ = \"Immunization\"\n\n    doseQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"doseQuantity\",\n        title=\"Amount of vaccine administered\",\n        description=\"The quantity of vaccine product that was administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    education: typing.List[fhirtypes.ImmunizationEducationType] | None = Field(\n        default=None,\n        alias=\"education\",\n        title=\"Educational material presented to patient\",\n        description=(\n            \"Educational material presented to the patient (or guardian) at the \"\n            \"time of vaccine administration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter immunization was part of\",\n        description=(\n            \"The visit or admission or other contact between patient and health \"\n            \"care provider the immunization was performed as part of.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    expirationDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"expirationDate\",\n        title=\"Vaccine expiration date\",\n        description=\"Date vaccine batch expires.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_expirationDate\",\n        title=\"Extension field for ``expirationDate``.\",\n    )\n\n    fundingSource: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fundingSource\",\n        title=\"Funding source for the vaccine\",\n        description=(\n            \"Indicates the source of the vaccine actually administered. This may be\"\n            \" different than the patient eligibility (e.g. the patient may be \"\n            \"eligible for a publically purchased vaccine but due to inventory \"\n            \"issues, vaccine purchased with private funds was actually \"\n            \"administered).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=\"A unique identifier assigned to this immunization record.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    isSubpotent: bool | None = Field(\n        default=None,\n        alias=\"isSubpotent\",\n        title=\"Dose potency\",\n        description=(\n            \"Indication if a dose is considered to be subpotent. By default, a dose\"\n            \" should be considered to be potent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isSubpotent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isSubpotent\", title=\"Extension field for ``isSubpotent``.\"\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where immunization occurred\",\n        description=(\n            \"The service delivery location where the vaccine administration \"\n            \"occurred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    lotNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lotNumber\",\n        title=\"Vaccine lot number\",\n        description=\"Lot number of the  vaccine product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lotNumber\", title=\"Extension field for ``lotNumber``.\"\n    )\n\n    manufacturer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Vaccine manufacturer\",\n        description=\"Name of vaccine manufacturer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional immunization notes\",\n        description=(\n            \"Extra information about the immunization that is not conveyed by the \"\n            \"other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"Vaccine administration date\",\n        description=\"Date vaccine administered or was to be administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": True,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrenceString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"occurrenceString\",\n        title=\"Vaccine administration date\",\n        description=\"Date vaccine administered or was to be administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": True,\n        },\n    )\n    occurrenceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceString\",\n        title=\"Extension field for ``occurrenceString``.\",\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who was immunized\",\n        description=\"The patient who either received or did not receive the immunization.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.ImmunizationPerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed event\",\n        description=\"Indicates who performed the immunization event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    primarySource: bool | None = Field(\n        default=None,\n        alias=\"primarySource\",\n        title=\"Indicates context the data was recorded in\",\n        description=(\n            \"An indication that the content of the record is based on information \"\n            \"from the person who administered the vaccine. This reflects the \"\n            \"context under which the data was originally recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    primarySource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_primarySource\",\n        title=\"Extension field for ``primarySource``.\",\n    )\n\n    programEligibility: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programEligibility\",\n        title=\"Patient eligibility for a vaccination program\",\n        description=\"Indicates a patient's eligibility for a funding program.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    protocolApplied: typing.List[\n        fhirtypes.ImmunizationProtocolAppliedType\n    ] | None = Field(\n        default=None,\n        alias=\"protocolApplied\",\n        title=\"Protocol followed by the provider\",\n        description=(\n            \"The protocol (set of recommendations) being followed by the provider \"\n            \"who administered the dose.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reaction: typing.List[fhirtypes.ImmunizationReactionType] | None = Field(\n        default=None,\n        alias=\"reaction\",\n        title=\"Details of a reaction that follows immunization\",\n        description=(\n            \"Categorical data indicating that an adverse event is associated in \"\n            \"time to an immunization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why immunization occurred\",\n        description=\"Reasons why the vaccine was administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why immunization occurred\",\n        description=(\n            \"Condition, Observation or DiagnosticReport that supports why the \"\n            \"immunization was administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\", \"DiagnosticReport\"],\n        },\n    )\n\n    recorded: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recorded\",\n        title=\"When the immunization was first captured in the subject's record\",\n        description=(\n            \"The date the occurrence of the immunization was first captured in the \"\n            \"record - potentially significantly after the occurrence of the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recorded\", title=\"Extension field for ``recorded``.\"\n    )\n\n    reportOrigin: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reportOrigin\",\n        title=\"Indicates the source of a secondarily reported record\",\n        description=(\n            \"The source of the data when the report of the immunization event is \"\n            \"not based on information from the person who administered the vaccine.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    route: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"route\",\n        title=\"How vaccine entered body\",\n        description=\"The path by which the vaccine product is taken into the body.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    site: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Body site vaccine  was administered\",\n        description=\"Body site where vaccine was administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"completed | entered-in-error | not-done\",\n        description=\"Indicates the current status of the immunization event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"completed\", \"entered-in-error\", \"not-done\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason not done\",\n        description=\"Indicates the reason the immunization event was not performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subpotentReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subpotentReason\",\n        title=\"Reason for being subpotent\",\n        description=\"Reason why a dose is considered to be subpotent.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    vaccineCode: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"vaccineCode\",\n        title=\"Vaccine product administered\",\n        description=\"Vaccine that was administered or was to be administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Immunization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"statusReason\",\n            \"vaccineCode\",\n            \"patient\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrenceString\",\n            \"recorded\",\n            \"primarySource\",\n            \"reportOrigin\",\n            \"location\",\n            \"manufacturer\",\n            \"lotNumber\",\n            \"expirationDate\",\n            \"site\",\n            \"route\",\n            \"doseQuantity\",\n            \"performer\",\n            \"note\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"isSubpotent\",\n            \"subpotentReason\",\n            \"education\",\n            \"programEligibility\",\n            \"fundingSource\",\n            \"reaction\",\n            \"protocolApplied\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Immunization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"vaccineCode\",\n            \"patient\",\n            \"occurrenceDateTime\",\n            \"occurrenceString\",\n            \"primarySource\",\n            \"performer\",\n            \"note\",\n            \"isSubpotent\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"occurrence\": [\"occurrenceDateTime\", \"occurrenceString\"]}\n        return one_of_many_fields\n\n\nclass ImmunizationEducation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Educational material presented to patient.\n    Educational material presented to the patient (or guardian) at the time of\n    vaccine administration.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationEducation\"\n\n    documentType: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentType\",\n        title=\"Educational material document identifier\",\n        description=\"Identifier of the material presented to the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentType\",\n        title=\"Extension field for ``documentType``.\",\n    )\n\n    presentationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"presentationDate\",\n        title=\"Educational material presentation date\",\n        description=\"Date the educational material was given to the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    presentationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_presentationDate\",\n        title=\"Extension field for ``presentationDate``.\",\n    )\n\n    publicationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"publicationDate\",\n        title=\"Educational material publication date\",\n        description=\"Date the educational material was published.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    publicationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_publicationDate\",\n        title=\"Extension field for ``publicationDate``.\",\n    )\n\n    reference: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Educational material reference pointer\",\n        description=(\n            \"Reference pointer to the educational material given to the patient if \"\n            \"the information was on line.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationEducation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"documentType\",\n            \"reference\",\n            \"publicationDate\",\n            \"presentationDate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationEducation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ImmunizationPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed event.\n    Indicates who performed the immunization event.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationPerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual or organization who was performing\",\n        description=\"The practitioner or organization who performed the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"What type of performance was done\",\n        description=(\n            \"Describes the type of performance (e.g. ordering provider, \"\n            \"administering provider, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n\n\nclass ImmunizationProtocolApplied(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Protocol followed by the provider.\n    The protocol (set of recommendations) being followed by the provider who\n    administered the dose.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationProtocolApplied\"\n\n    authority: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Who is responsible for publishing the recommendations\",\n        description=(\n            \"Indicates the authority who published the protocol (e.g. ACIP) that is\"\n            \" being followed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    doseNumberPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"doseNumberPositiveInt\",\n        title=\"Dose number within series\",\n        description=\"Nominal position in a series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e doseNumber[x]\n            \"one_of_many\": \"doseNumber\",\n            \"one_of_many_required\": True,\n        },\n    )\n    doseNumberPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doseNumberPositiveInt\",\n        title=\"Extension field for ``doseNumberPositiveInt``.\",\n    )\n\n    doseNumberString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"doseNumberString\",\n        title=\"Dose number within series\",\n        description=\"Nominal position in a series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e doseNumber[x]\n            \"one_of_many\": \"doseNumber\",\n            \"one_of_many_required\": True,\n        },\n    )\n    doseNumberString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doseNumberString\",\n        title=\"Extension field for ``doseNumberString``.\",\n    )\n\n    series: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"series\",\n        title=\"Name of vaccine series\",\n        description=(\n            \"One possible path to achieve presumed immunity against a disease - \"\n            \"within the context of an authority.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_series\", title=\"Extension field for ``series``.\"\n    )\n\n    seriesDosesPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"seriesDosesPositiveInt\",\n        title=\"Recommended number of doses for immunity\",\n        description=\"The recommended number of doses to achieve immunity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e seriesDoses[x]\n            \"one_of_many\": \"seriesDoses\",\n            \"one_of_many_required\": False,\n        },\n    )\n    seriesDosesPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_seriesDosesPositiveInt\",\n        title=\"Extension field for ``seriesDosesPositiveInt``.\",\n    )\n\n    seriesDosesString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"seriesDosesString\",\n        title=\"Recommended number of doses for immunity\",\n        description=\"The recommended number of doses to achieve immunity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e seriesDoses[x]\n            \"one_of_many\": \"seriesDoses\",\n            \"one_of_many_required\": False,\n        },\n    )\n    seriesDosesString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_seriesDosesString\",\n        title=\"Extension field for ``seriesDosesString``.\",\n    )\n\n    targetDisease: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"targetDisease\",\n        title=\"Vaccine preventatable disease being targetted\",\n        description=(\n            \"The vaccine preventable disease the dose is being administered \" \"against.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationProtocolApplied`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"series\",\n            \"authority\",\n            \"targetDisease\",\n            \"doseNumberPositiveInt\",\n            \"doseNumberString\",\n            \"seriesDosesPositiveInt\",\n            \"seriesDosesString\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationProtocolApplied`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"doseNumber\": [\"doseNumberPositiveInt\", \"doseNumberString\"],\n            \"seriesDoses\": [\"seriesDosesPositiveInt\", \"seriesDosesString\"],\n        }\n        return one_of_many_fields\n\n\nclass ImmunizationReaction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of a reaction that follows immunization.\n    Categorical data indicating that an adverse event is associated in time to\n    an immunization.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationReaction\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When reaction started\",\n        description=\"Date of reaction to the immunization.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    detail: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Additional information on reaction\",\n        description=\"Details of the reaction.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    reported: bool | None = Field(\n        default=None,\n        alias=\"reported\",\n        title=\"Indicates self-reported reaction\",\n        description=\"Self-reported indicator.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reported__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reported\", title=\"Extension field for ``reported``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationReaction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"date\", \"detail\", \"reported\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationReaction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/immunizationevaluation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass ImmunizationEvaluation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Immunization evaluation information.\n    Describes a comparison of an immunization event against published\n    recommendations to determine if the administration is \"valid\" in relation\n    to those  recommendations.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationEvaluation\"\n\n    authority: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Who is responsible for publishing the recommendations\",\n        description=\"Indicates the authority who published the protocol (e.g. ACIP).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date evaluation was performed\",\n        description=(\n            \"The date the evaluation of the vaccine administration event was \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Evaluation notes\",\n        description=\"Additional information about the evaluation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    doseNumberPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"doseNumberPositiveInt\",\n        title=\"Dose number within series\",\n        description=\"Nominal position in a series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e doseNumber[x]\n            \"one_of_many\": \"doseNumber\",\n            \"one_of_many_required\": False,\n        },\n    )\n    doseNumberPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doseNumberPositiveInt\",\n        title=\"Extension field for ``doseNumberPositiveInt``.\",\n    )\n\n    doseNumberString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"doseNumberString\",\n        title=\"Dose number within series\",\n        description=\"Nominal position in a series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e doseNumber[x]\n            \"one_of_many\": \"doseNumber\",\n            \"one_of_many_required\": False,\n        },\n    )\n    doseNumberString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doseNumberString\",\n        title=\"Extension field for ``doseNumberString``.\",\n    )\n\n    doseStatus: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"doseStatus\",\n        title=\"Status of the dose relative to published recommendations\",\n        description=(\n            \"Indicates if the dose is valid or not valid with respect to the \"\n            \"published recommendations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    doseStatusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"doseStatusReason\",\n        title=\"Reason for the dose status\",\n        description=(\n            \"Provides an explanation as to why the vaccine administration event is \"\n            \"valid or not relative to the published recommendations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=\"A unique identifier assigned to this immunization evaluation record.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    immunizationEvent: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"immunizationEvent\",\n        title=\"Immunization being evaluated\",\n        description=\"The vaccine administration event being evaluated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Immunization\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who this evaluation is for\",\n        description=\"The individual for whom the evaluation is being done.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    series: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"series\",\n        title=\"Name of vaccine series\",\n        description=(\n            \"One possible path to achieve presumed immunity against a disease - \"\n            \"within the context of an authority.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_series\", title=\"Extension field for ``series``.\"\n    )\n\n    seriesDosesPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"seriesDosesPositiveInt\",\n        title=\"Recommended number of doses for immunity\",\n        description=\"The recommended number of doses to achieve immunity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e seriesDoses[x]\n            \"one_of_many\": \"seriesDoses\",\n            \"one_of_many_required\": False,\n        },\n    )\n    seriesDosesPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_seriesDosesPositiveInt\",\n        title=\"Extension field for ``seriesDosesPositiveInt``.\",\n    )\n\n    seriesDosesString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"seriesDosesString\",\n        title=\"Recommended number of doses for immunity\",\n        description=\"The recommended number of doses to achieve immunity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e seriesDoses[x]\n            \"one_of_many\": \"seriesDoses\",\n            \"one_of_many_required\": False,\n        },\n    )\n    seriesDosesString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_seriesDosesString\",\n        title=\"Extension field for ``seriesDosesString``.\",\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"completed | entered-in-error\",\n        description=(\n            \"Indicates the current status of the evaluation of the vaccination \"\n            \"administration event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"completed\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    targetDisease: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"targetDisease\",\n        title=\"Evaluation target disease\",\n        description=\"The vaccine preventable disease the dose is being evaluated against.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationEvaluation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"patient\",\n            \"date\",\n            \"authority\",\n            \"targetDisease\",\n            \"immunizationEvent\",\n            \"doseStatus\",\n            \"doseStatusReason\",\n            \"description\",\n            \"series\",\n            \"doseNumberPositiveInt\",\n            \"doseNumberString\",\n            \"seriesDosesPositiveInt\",\n            \"seriesDosesString\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationEvaluation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"patient\",\n            \"targetDisease\",\n            \"immunizationEvent\",\n            \"doseStatus\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"doseNumber\": [\"doseNumberPositiveInt\", \"doseNumberString\"],\n            \"seriesDoses\": [\"seriesDosesPositiveInt\", \"seriesDosesString\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/immunizationrecommendation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ImmunizationRecommendation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Guidance or advice relating to an immunization.\n    A patient's point-in-time set of recommendations (i.e. forecasting)\n    according to a published schedule with optional supporting justification.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationRecommendation\"\n\n    authority: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Who is responsible for protocol\",\n        description=\"Indicates the authority who published the protocol (e.g. ACIP).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date recommendation(s) created\",\n        description=\"The date the immunization recommendation(s) were created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=\"A unique identifier assigned to this particular recommendation record.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who this profile is for\",\n        description=\"The patient the recommendation(s) are for.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    recommendation: typing.List[\n        fhirtypes.ImmunizationRecommendationRecommendationType\n    ] = Field(\n        default=...,\n        alias=\"recommendation\",\n        title=\"Vaccine administration recommendations\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationRecommendation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"patient\",\n            \"date\",\n            \"authority\",\n            \"recommendation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"patient\",\n            \"date\",\n            \"recommendation\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"date\", \"date__ext\")]\n        return required_fields\n\n\nclass ImmunizationRecommendationRecommendation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Vaccine administration recommendations.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationRecommendationRecommendation\"\n\n    contraindicatedVaccineCode: typing.List[\n        fhirtypes.CodeableConceptType\n    ] | None = Field(\n        default=None,\n        alias=\"contraindicatedVaccineCode\",\n        title=\"Vaccine which is contraindicated to fulfill the recommendation\",\n        description=\"Vaccine(s) which should not be used to fulfill the recommendation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dateCriterion: typing.List[\n        fhirtypes.ImmunizationRecommendationRecommendationDateCriterionType\n    ] | None = Field(\n        default=None,\n        alias=\"dateCriterion\",\n        title=\"Dates governing proposed immunization\",\n        description=(\n            \"Vaccine date recommendations.  For example, earliest date to \"\n            \"administer, latest date to administer, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Protocol details\",\n        description=(\n            \"Contains the description about the protocol under which the vaccine \"\n            \"was administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    doseNumberPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"doseNumberPositiveInt\",\n        title=\"Recommended dose number within series\",\n        description=(\n            \"Nominal position of the recommended dose in a series (e.g. dose 2 is \"\n            \"the next recommended dose).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e doseNumber[x]\n            \"one_of_many\": \"doseNumber\",\n            \"one_of_many_required\": False,\n        },\n    )\n    doseNumberPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doseNumberPositiveInt\",\n        title=\"Extension field for ``doseNumberPositiveInt``.\",\n    )\n\n    doseNumberString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"doseNumberString\",\n        title=\"Recommended dose number within series\",\n        description=(\n            \"Nominal position of the recommended dose in a series (e.g. dose 2 is \"\n            \"the next recommended dose).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e doseNumber[x]\n            \"one_of_many\": \"doseNumber\",\n            \"one_of_many_required\": False,\n        },\n    )\n    doseNumberString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doseNumberString\",\n        title=\"Extension field for ``doseNumberString``.\",\n    )\n\n    forecastReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"forecastReason\",\n        title=\"Vaccine administration status reason\",\n        description=\"The reason for the assigned forecast status.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    forecastStatus: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"forecastStatus\",\n        title=\"Vaccine recommendation status\",\n        description=(\n            \"Indicates the patient status with respect to the path to immunity for \"\n            \"the target disease.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    series: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"series\",\n        title=\"Name of vaccination series\",\n        description=(\n            \"One possible path to achieve presumed immunity against a disease - \"\n            \"within the context of an authority.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_series\", title=\"Extension field for ``series``.\"\n    )\n\n    seriesDosesPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"seriesDosesPositiveInt\",\n        title=\"Recommended number of doses for immunity\",\n        description=\"The recommended number of doses to achieve immunity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e seriesDoses[x]\n            \"one_of_many\": \"seriesDoses\",\n            \"one_of_many_required\": False,\n        },\n    )\n    seriesDosesPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_seriesDosesPositiveInt\",\n        title=\"Extension field for ``seriesDosesPositiveInt``.\",\n    )\n\n    seriesDosesString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"seriesDosesString\",\n        title=\"Recommended number of doses for immunity\",\n        description=\"The recommended number of doses to achieve immunity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e seriesDoses[x]\n            \"one_of_many\": \"seriesDoses\",\n            \"one_of_many_required\": False,\n        },\n    )\n    seriesDosesString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_seriesDosesString\",\n        title=\"Extension field for ``seriesDosesString``.\",\n    )\n\n    supportingImmunization: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingImmunization\",\n        title=\"Past immunizations supporting recommendation\",\n        description=(\n            \"Immunization event history and/or evaluation that supports the status \"\n            \"and recommendation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Immunization\", \"ImmunizationEvaluation\"],\n        },\n    )\n\n    supportingPatientInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingPatientInformation\",\n        title=\"Patient observations supporting recommendation\",\n        description=(\n            \"Patient Information that supports the status and recommendation.  This\"\n            \" includes patient observations, adverse reactions and \"\n            \"allergy/intolerance information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    targetDisease: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"targetDisease\",\n        title=\"Disease to be immunized against\",\n        description=\"The targeted disease for the recommendation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    vaccineCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"vaccineCode\",\n        title=\"Vaccine  or vaccine group recommendation applies to\",\n        description=\"Vaccine(s) or vaccine group that pertain to the recommendation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationRecommendationRecommendation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"vaccineCode\",\n            \"targetDisease\",\n            \"contraindicatedVaccineCode\",\n            \"forecastStatus\",\n            \"forecastReason\",\n            \"dateCriterion\",\n            \"description\",\n            \"series\",\n            \"doseNumberPositiveInt\",\n            \"doseNumberString\",\n            \"seriesDosesPositiveInt\",\n            \"seriesDosesString\",\n            \"supportingImmunization\",\n            \"supportingPatientInformation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"vaccineCode\",\n            \"targetDisease\",\n            \"contraindicatedVaccineCode\",\n            \"forecastStatus\",\n            \"forecastReason\",\n            \"doseNumberPositiveInt\",\n            \"doseNumberString\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"doseNumber\": [\"doseNumberPositiveInt\", \"doseNumberString\"],\n            \"seriesDoses\": [\"seriesDosesPositiveInt\", \"seriesDosesString\"],\n        }\n        return one_of_many_fields\n\n\nclass ImmunizationRecommendationRecommendationDateCriterion(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dates governing proposed immunization.\n    Vaccine date recommendations.  For example, earliest date to administer,\n    latest date to administer, etc.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationRecommendationRecommendationDateCriterion\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of date\",\n        description=(\n            \"Date classification of recommendation.  For example, earliest date to \"\n            \"give, latest date to give, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Recommended date\",\n        description=\"The date whose meaning is specified by dateCriterion.code.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationRecommendationRecommendationDateCriterion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendationDateCriterion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/implementationguide.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImplementationGuide\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ImplementationGuide(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of rules about how FHIR is used.\n    A set of rules of how a particular interoperability or standards problem is\n    solved - typically through the use of FHIR resources. This resource is used\n    to gather all the parts of an implementation guide into a logical whole and\n    to publish a computable definition of all the parts.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuide\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the implementation guide and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the implementation guide was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the implementation guide \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    definition: fhirtypes.ImplementationGuideDefinitionType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Information needed to build the IG\",\n        description=(\n            \"The information needed by an IG publisher tool to publish the whole \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dependsOn: typing.List[fhirtypes.ImplementationGuideDependsOnType] | None = Field(\n        default=None,\n        alias=\"dependsOn\",\n        title=\"Another Implementation guide this depends on\",\n        description=(\n            \"Another implementation guide that this implementation depends on. \"\n            \"Typically, an implementation guide uses value sets, profiles \"\n            \"etc.defined in other implementation guides.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the implementation guide\",\n        description=(\n            \"A free text natural language description of the implementation guide \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this implementation guide is authored\"\n            \" for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fhirVersion: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"fhirVersion\",\n        title=\"FHIR Version(s) this Implementation Guide targets\",\n        description=(\n            \"The version(s) of the FHIR specification that this ImplementationGuide\"\n            \" targets - e.g. describes how to use. The value of this element is the\"\n            \" formal version of the specification, without the revision number, \"\n            \"e.g. [publication].[major].[minor], which is 4.3.0 for this version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    fhirVersion__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_fhirVersion\", title=\"Extension field for ``fhirVersion``.\"\n    )\n\n    global_fhir: typing.List[fhirtypes.ImplementationGuideGlobalType] | None = Field(\n        default=None,\n        alias=\"global\",\n        title=\"Profiles that apply globally\",\n        description=(\n            \"A set of profiles that all resources covered by this implementation \"\n            \"guide must conform to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for implementation guide (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the implementation guide is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    license: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"license\",\n        title=\"SPDX license code for this IG (or not-open-source)\",\n        description=(\n            \"The license that applies to this Implementation Guide, using an SPDX \"\n            \"license code, or 'not-open-source'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    license__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_license\", title=\"Extension field for ``license``.\"\n    )\n\n    manifest: fhirtypes.ImplementationGuideManifestType | None = Field(\n        default=None,\n        alias=\"manifest\",\n        title=\"Information about an assembled IG\",\n        description=(\n            \"Information about an assembled implementation guide, created by the \"\n            \"publication tooling.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this implementation guide (computer friendly)\",\n        description=(\n            \"A natural language name identifying the implementation guide. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    packageId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"packageId\",\n        title=\"NPM Package name for IG\",\n        description=(\n            \"The NPM package name for this Implementation Guide, used in the NPM \"\n            \"package distribution, which is the primary mechanism by which FHIR \"\n            \"based tooling manages IG dependencies. This value must be globally \"\n            \"unique, and should be assigned with care.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    packageId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_packageId\", title=\"Extension field for ``packageId``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this implementation guide. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this implementation guide (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the implementation \" \"guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this implementation guide, represented as a \"\n            \"URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this implementation guide \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which at which an \"\n            \"authoritative instance of this implementation guide is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the implementation guide is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate implementation guide instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the implementation guide\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"implementation guide when it is referenced in a specification, model, \"\n            \"design or instance. This is an arbitrary value managed by the \"\n            \"implementation guide author and is not expected to be globally unique.\"\n            \" For example, it might be a timestamp (e.g. yyyymmdd) if a managed \"\n            \"version is not available. There is also no expectation that versions \"\n            \"can be placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuide`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"copyright\",\n            \"packageId\",\n            \"license\",\n            \"fhirVersion\",\n            \"dependsOn\",\n            \"global\",\n            \"definition\",\n            \"manifest\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuide`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"packageId\",\n            \"license\",\n            \"fhirVersion\",\n            \"dependsOn\",\n            \"global\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"fhirVersion\", \"fhirVersion__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"packageId\", \"packageId__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n\nclass ImplementationGuideDefinition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information needed to build the IG.\n    The information needed by an IG publisher tool to publish the whole\n    implementation guide.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDefinition\"\n\n    grouping: typing.List[\n        fhirtypes.ImplementationGuideDefinitionGroupingType\n    ] | None = Field(\n        default=None,\n        alias=\"grouping\",\n        title=\"Grouping used to present related resources in the IG\",\n        description=(\n            \"A logical group of resources. Logical groups can be used when building\"\n            \" pages.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    page: fhirtypes.ImplementationGuideDefinitionPageType | None = Field(\n        default=None,\n        alias=\"page\",\n        title=\"Page/Section in the Guide\",\n        description=(\n            \"A page / section in the implementation guide. The root page is the \"\n            \"implementation guide home page.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    parameter: typing.List[\n        fhirtypes.ImplementationGuideDefinitionParameterType\n    ] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Defines how IG is built by tools\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    resource: typing.List[fhirtypes.ImplementationGuideDefinitionResourceType] = Field(\n        default=...,\n        alias=\"resource\",\n        title=\"Resource in the implementation guide\",\n        description=(\n            \"A resource that is part of the implementation guide. Conformance \"\n            \"resources (value set, structure definition, capability statements \"\n            \"etc.) are obvious candidates for inclusion, but any kind of resource \"\n            \"can be included as an example resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    template: typing.List[\n        fhirtypes.ImplementationGuideDefinitionTemplateType\n    ] | None = Field(\n        default=None,\n        alias=\"template\",\n        title=\"A template for building resources\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"grouping\",\n            \"resource\",\n            \"page\",\n            \"parameter\",\n            \"template\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ImplementationGuideDefinitionGrouping(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Grouping used to present related resources in the IG.\n    A logical group of resources. Logical groups can be used when building\n    pages.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDefinitionGrouping\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human readable text describing the package\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Descriptive name for the package\",\n        description=(\n            \"The human-readable title to display for the package of resources when \"\n            \"rendering the implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDefinitionGrouping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"description\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionGrouping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideDefinitionPage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Page/Section in the Guide.\n    A page / section in the implementation guide. The root page is the\n    implementation guide home page.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDefinitionPage\"\n\n    generation: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"generation\",\n        title=\"html | markdown | xml | generated\",\n        description=\"A code that indicates how the page is generated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"html\", \"markdown\", \"xml\", \"generated\"],\n        },\n    )\n    generation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_generation\", title=\"Extension field for ``generation``.\"\n    )\n\n    nameReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"nameReference\",\n        title=\"Where to find that page\",\n        description=\"The source address for the page.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e name[x]\n            \"one_of_many\": \"name\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Binary\"],\n        },\n    )\n\n    nameUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"nameUrl\",\n        title=\"Where to find that page\",\n        description=\"The source address for the page.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e name[x]\n            \"one_of_many\": \"name\",\n            \"one_of_many_required\": True,\n        },\n    )\n    nameUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_nameUrl\", title=\"Extension field for ``nameUrl``.\"\n    )\n\n    page: typing.List[fhirtypes.ImplementationGuideDefinitionPageType] | None = Field(\n        default=None,\n        alias=\"page\",\n        title=\"Nested Pages / Sections\",\n        description=\"Nested Pages/Sections under this page.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Short title shown for navigational assistance\",\n        description=(\n            \"A short title used to represent this page in navigational structures \"\n            \"such as table of contents, bread crumbs, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDefinitionPage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"nameUrl\",\n            \"nameReference\",\n            \"title\",\n            \"generation\",\n            \"page\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionPage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"generation\", \"generation__ext\"), (\"title\", \"title__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"name\": [\"nameReference\", \"nameUrl\"]}\n        return one_of_many_fields\n\n\nclass ImplementationGuideDefinitionParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defines how IG is built by tools.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDefinitionParameter\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"apply | path-resource | path-pages | path-tx-cache | expansion-\"\n            \"parameter | rule-broken-links | generate-xml | generate-json | \"\n            \"generate-turtle | html-template\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"apply\",\n                \"path-resource\",\n                \"path-pages\",\n                \"path-tx-cache\",\n                \"expansion-parameter\",\n                \"rule-broken-links\",\n                \"generate-xml\",\n                \"generate-json\",\n                \"generate-turtle\",\n                \"html-template\",\n            ],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Value for named type\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDefinitionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideDefinitionResource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource in the implementation guide.\n    A resource that is part of the implementation guide. Conformance resources\n    (value set, structure definition, capability statements etc.) are obvious\n    candidates for inclusion, but any kind of resource can be included as an\n    example resource.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDefinitionResource\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Reason why included in guide\",\n        description=(\n            \"A description of the reason that a resource has been included in the \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    exampleBoolean: bool | None = Field(\n        default=None,\n        alias=\"exampleBoolean\",\n        title=\"Is an example/What is this an example of?\",\n        description=(\n            \"If true or a reference, indicates the resource is an example instance.\"\n            \"  If a reference is present, indicates that the example is an example \"\n            \"of the specified profile.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e example[x]\n            \"one_of_many\": \"example\",\n            \"one_of_many_required\": False,\n        },\n    )\n    exampleBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_exampleBoolean\",\n        title=\"Extension field for ``exampleBoolean``.\",\n    )\n\n    exampleCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"exampleCanonical\",\n        title=\"Is an example/What is this an example of?\",\n        description=(\n            \"If true or a reference, indicates the resource is an example instance.\"\n            \"  If a reference is present, indicates that the example is an example \"\n            \"of the specified profile.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e example[x]\n            \"one_of_many\": \"example\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    exampleCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_exampleCanonical\",\n        title=\"Extension field for ``exampleCanonical``.\",\n    )\n\n    fhirVersion: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"fhirVersion\",\n        title=\"Versions this applies to (if different to IG)\",\n        description=(\n            \"Indicates the FHIR Version(s) this artifact is intended to apply to. \"\n            \"If no versions are specified, the resource is assumed to apply to all \"\n            \"the versions stated in ImplementationGuide.fhirVersion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    fhirVersion__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_fhirVersion\", title=\"Extension field for ``fhirVersion``.\"\n    )\n\n    groupingId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"groupingId\",\n        title=\"Grouping this is part of\",\n        description=\"Reference to the id of the grouping this resource appears in.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    groupingId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_groupingId\", title=\"Extension field for ``groupingId``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human Name for the resource\",\n        description=(\n            \"A human assigned name for the resource. All resources SHOULD have a \"\n            \"name, but the name may be extracted from the resource (e.g. \"\n            \"ValueSet.name).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Location of the resource\",\n        description=\"Where this resource is found.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDefinitionResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"reference\",\n            \"fhirVersion\",\n            \"name\",\n            \"description\",\n            \"exampleBoolean\",\n            \"exampleCanonical\",\n            \"groupingId\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"example\": [\"exampleBoolean\", \"exampleCanonical\"]}\n        return one_of_many_fields\n\n\nclass ImplementationGuideDefinitionTemplate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A template for building resources.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDefinitionTemplate\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of template specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    scope: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"scope\",\n        title=\"The scope in which the template applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    scope__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_scope\", title=\"Extension field for ``scope``.\"\n    )\n\n    source: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"The source location for the template\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDefinitionTemplate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"source\", \"scope\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionTemplate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"source\", \"source__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideDependsOn(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Another Implementation guide this depends on.\n    Another implementation guide that this implementation depends on.\n    Typically, an implementation guide uses value sets, profiles etc.defined in\n    other implementation guides.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDependsOn\"\n\n    packageId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"packageId\",\n        title=\"NPM Package name for IG this depends on\",\n        description=(\n            \"The NPM package name for the Implementation Guide that this IG depends\"\n            \" on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    packageId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_packageId\", title=\"Extension field for ``packageId``.\"\n    )\n\n    uri: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Identity of the IG that this depends on\",\n        description=\"A canonical reference to the Implementation guide for the dependency.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ImplementationGuide\"],\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version of the IG\",\n        description=(\n            \"The version of the IG that is depended on, when the correct version is\"\n            \" required to understand the IG correctly.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDependsOn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"uri\", \"packageId\", \"version\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDependsOn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"uri\", \"packageId\", \"version\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"uri\", \"uri__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideGlobal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Profiles that apply globally.\n    A set of profiles that all resources covered by this implementation guide\n    must conform to.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideGlobal\"\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile that all resources must conform to\",\n        description=\"A reference to the profile that all instances must conform to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type this profile applies to\",\n        description=\"The type of resource that all instances must conform to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideGlobal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"profile\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideGlobal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"profile\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"profile\", \"profile__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideManifest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about an assembled IG.\n    Information about an assembled implementation guide, created by the\n    publication tooling.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideManifest\"\n\n    image: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"image\",\n        title=\"Image within the IG\",\n        description=\"Indicates a relative path to an image that exists within the IG.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    image__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_image\", title=\"Extension field for ``image``.\"\n    )\n\n    other: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"other\",\n        title=\"Additional linkable file in IG\",\n        description=(\n            \"Indicates the relative path of an additional non-page, non-image file \"\n            \"that is part of the IG - e.g. zip, jar and similar files that could be\"\n            \" the target of a hyperlink in a derived IG.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    other__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_other\", title=\"Extension field for ``other``.\"\n    )\n\n    page: typing.List[fhirtypes.ImplementationGuideManifestPageType] | None = Field(\n        default=None,\n        alias=\"page\",\n        title=\"HTML page within the parent IG\",\n        description=\"Information about a page within the IG.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rendering: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"rendering\",\n        title=\"Location of rendered implementation guide\",\n        description=(\n            \"A pointer to official web page, PDF or other rendering of the \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rendering__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rendering\", title=\"Extension field for ``rendering``.\"\n    )\n\n    resource: typing.List[fhirtypes.ImplementationGuideManifestResourceType] = Field(\n        default=...,\n        alias=\"resource\",\n        title=\"Resource in the implementation guide\",\n        description=(\n            \"A resource that is part of the implementation guide. Conformance \"\n            \"resources (value set, structure definition, capability statements \"\n            \"etc.) are obvious candidates for inclusion, but any kind of resource \"\n            \"can be included as an example resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideManifest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"rendering\",\n            \"resource\",\n            \"page\",\n            \"image\",\n            \"other\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideManifest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"rendering\", \"resource\"]\n\n\nclass ImplementationGuideManifestPage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    HTML page within the parent IG.\n    Information about a page within the IG.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideManifestPage\"\n\n    anchor: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"anchor\",\n        title=\"Anchor available on the page\",\n        description=\"The name of an anchor available on the page.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    anchor__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_anchor\", title=\"Extension field for ``anchor``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"HTML page name\",\n        description=\"Relative path to the page.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Title of the page, for references\",\n        description=\"Label for the page intended for human display.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideManifestPage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"title\", \"anchor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideManifestPage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideManifestResource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource in the implementation guide.\n    A resource that is part of the implementation guide. Conformance resources\n    (value set, structure definition, capability statements etc.) are obvious\n    candidates for inclusion, but any kind of resource can be included as an\n    example resource.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideManifestResource\"\n\n    exampleBoolean: bool | None = Field(\n        default=None,\n        alias=\"exampleBoolean\",\n        title=\"Is an example/What is this an example of?\",\n        description=(\n            \"If true or a reference, indicates the resource is an example instance.\"\n            \"  If a reference is present, indicates that the example is an example \"\n            \"of the specified profile.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e example[x]\n            \"one_of_many\": \"example\",\n            \"one_of_many_required\": False,\n        },\n    )\n    exampleBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_exampleBoolean\",\n        title=\"Extension field for ``exampleBoolean``.\",\n    )\n\n    exampleCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"exampleCanonical\",\n        title=\"Is an example/What is this an example of?\",\n        description=(\n            \"If true or a reference, indicates the resource is an example instance.\"\n            \"  If a reference is present, indicates that the example is an example \"\n            \"of the specified profile.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e example[x]\n            \"one_of_many\": \"example\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    exampleCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_exampleCanonical\",\n        title=\"Extension field for ``exampleCanonical``.\",\n    )\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Location of the resource\",\n        description=\"Where this resource is found.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    relativePath: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"relativePath\",\n        title=\"Relative path for page in IG\",\n        description=\"The relative path for primary page for this resource within the IG.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    relativePath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relativePath\",\n        title=\"Extension field for ``relativePath``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideManifestResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"reference\",\n            \"exampleBoolean\",\n            \"exampleCanonical\",\n            \"relativePath\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideManifestResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"reference\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"example\": [\"exampleBoolean\", \"exampleCanonical\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/ingredient.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Ingredient\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Ingredient(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An ingredient of a manufactured item or pharmaceutical product.\n    \"\"\"\n\n    __resource_type__ = \"Ingredient\"\n\n    allergenicIndicator: bool | None = Field(\n        default=None,\n        alias=\"allergenicIndicator\",\n        title=\"If the ingredient is a known or suspected allergen\",\n        description=(\n            \"If the ingredient is a known or suspected allergen. Note that this is \"\n            \"a property of the substance, so if a reference to a \"\n            \"SubstanceDefinition is used to decribe that (rather than just a code),\"\n            \" the allergen information should go there, not here.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    allergenicIndicator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allergenicIndicator\",\n        title=\"Extension field for ``allergenicIndicator``.\",\n    )\n\n    for_fhir: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"for\",\n        title=\"The product which this ingredient is a constituent part of\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicinalProductDefinition\",\n                \"AdministrableProductDefinition\",\n                \"ManufacturedItemDefinition\",\n            ],\n        },\n    )\n\n    function: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"function\",\n        title=(\n            \"Precise action within the drug product, e.g. antioxidant, alkalizing \"\n            \"agent\"\n        ),\n        description=(\n            \"A classification of the ingredient identifying its precise purpose(s) \"\n            \"in the drug product. This extends the Ingredient.role to add more \"\n            \"detail. Example: antioxidant, alkalizing agent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier or code by which the ingredient can be referenced\",\n        description=(\n            \"The identifier(s) of this Ingredient that are assigned by business \"\n            \"processes and/or used to refer to it when a direct URL reference to \"\n            \"the resource itself is not appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    manufacturer: typing.List[fhirtypes.IngredientManufacturerType] | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"An organization that manufactures this ingredient\",\n        description=(\n            \"The organization(s) that manufacture this ingredient. Can be used to \"\n            \"indicate:         1) Organizations we are aware of that manufacture \"\n            \"this ingredient         2) Specific Manufacturer(s) currently being \"\n            \"used         3) Set of organisations allowed to manufacture this \"\n            \"ingredient for this product         Users must be clear on the \"\n            \"application of context relevant to their use case.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"role\",\n        title=\"Purpose of the ingredient within the product, e.g. active, inactive\",\n        description=(\n            \"A classification of the ingredient identifying its purpose within the \"\n            \"product, e.g. active, inactive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this ingredient. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    substance: fhirtypes.IngredientSubstanceType = Field(\n        default=...,\n        alias=\"substance\",\n        title=\"The substance that comprises this ingredient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Ingredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"for\",\n            \"role\",\n            \"function\",\n            \"allergenicIndicator\",\n            \"manufacturer\",\n            \"substance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Ingredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"for\",\n            \"role\",\n            \"function\",\n            \"allergenicIndicator\",\n            \"manufacturer\",\n            \"substance\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass IngredientManufacturer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An organization that manufactures this ingredient.\n    The organization(s) that manufacture this ingredient. Can be used to\n    indicate:         1) Organizations we are aware of that manufacture this\n    ingredient         2) Specific Manufacturer(s) currently being used\n    3) Set of organisations allowed to manufacture this ingredient for this\n    product         Users must be clear on the application of context relevant\n    to their use case.\n    \"\"\"\n\n    __resource_type__ = \"IngredientManufacturer\"\n\n    manufacturer: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"manufacturer\",\n        title=\"An organization that manufactures this ingredient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    role: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"allowed | possible | actual\",\n        description=(\n            \"The way in which this manufacturer is associated with the ingredient. \"\n            \"For example whether it is a possible one (others allowed), or an \"\n            \"exclusive authorized one for this ingredient. Note that this is not \"\n            \"the manufacturing process role.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"allowed\", \"possible\", \"actual\"],\n        },\n    )\n    role__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_role\", title=\"Extension field for ``role``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``IngredientManufacturer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"manufacturer\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``IngredientManufacturer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"role\", \"manufacturer\"]\n\n\nclass IngredientSubstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The substance that comprises this ingredient.\n    \"\"\"\n\n    __resource_type__ = \"IngredientSubstance\"\n\n    code: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"A code or full resource that represents the ingredient substance\",\n        description=\"A code or full resource that represents the ingredient's substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceDefinition\"],\n        },\n    )\n\n    strength: typing.List[fhirtypes.IngredientSubstanceStrengthType] | None = Field(\n        default=None,\n        alias=\"strength\",\n        title=(\n            \"The quantity of substance, per presentation, or per volume or mass, \"\n            \"and type of quantity\"\n        ),\n        description=(\n            \"The quantity of substance in the unit of presentation, or in the \"\n            \"volume (or mass) of the single pharmaceutical product or manufactured \"\n            \"item. The allowed repetitions do not represent different strengths, \"\n            \"but are different representations - mathematically equivalent - of a \"\n            \"single strength.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``IngredientSubstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"strength\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``IngredientSubstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"strength\"]\n\n\nclass IngredientSubstanceStrength(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The quantity of substance, per presentation, or per volume or mass, and\n    type of quantity.\n    The quantity of substance in the unit of presentation, or in the volume (or\n    mass) of the single pharmaceutical product or manufactured item. The\n    allowed repetitions do not represent different strengths, but are different\n    representations - mathematically equivalent - of a single strength.\n    \"\"\"\n\n    __resource_type__ = \"IngredientSubstanceStrength\"\n\n    concentrationRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"concentrationRatio\",\n        title=\"The strength per unitary volume (or mass)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e concentration[x]\n            \"one_of_many\": \"concentration\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    concentrationRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"concentrationRatioRange\",\n        title=\"The strength per unitary volume (or mass)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e concentration[x]\n            \"one_of_many\": \"concentration\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    country: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"country\",\n        title=\"Where the strength range applies\",\n        description=\"The country or countries for which the strength range applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    measurementPoint: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"measurementPoint\",\n        title=\"When strength is measured at a particular point or distance\",\n        description=(\n            \"For when strength is measured at a particular point or distance. There\"\n            \" are products where strength is measured at a particular point. For \"\n            \"example, the strength of the ingredient in some inhalers is measured \"\n            \"at a particular position relative to the point of aerosolization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    measurementPoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_measurementPoint\",\n        title=\"Extension field for ``measurementPoint``.\",\n    )\n\n    presentationRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"presentationRatio\",\n        title=\"The quantity of substance in the unit of presentation\",\n        description=(\n            \"The quantity of substance in the unit of presentation, or in the \"\n            \"volume (or mass) of the single pharmaceutical product or manufactured \"\n            \"item. Unit of presentation refers to the quantity that the item occurs\"\n            \" in e.g. a strength per tablet size, perhaps 'per 20mg' (the size of \"\n            \"the tablet). It is not generally normalized as a unitary unit, which \"\n            \"would be 'per mg').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e presentation[x]\n            \"one_of_many\": \"presentation\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    presentationRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"presentationRatioRange\",\n        title=\"The quantity of substance in the unit of presentation\",\n        description=(\n            \"The quantity of substance in the unit of presentation, or in the \"\n            \"volume (or mass) of the single pharmaceutical product or manufactured \"\n            \"item. Unit of presentation refers to the quantity that the item occurs\"\n            \" in e.g. a strength per tablet size, perhaps 'per 20mg' (the size of \"\n            \"the tablet). It is not generally normalized as a unitary unit, which \"\n            \"would be 'per mg').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e presentation[x]\n            \"one_of_many\": \"presentation\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    referenceStrength: typing.List[\n        fhirtypes.IngredientSubstanceStrengthReferenceStrengthType\n    ] | None = Field(\n        default=None,\n        alias=\"referenceStrength\",\n        title=\"Strength expressed in terms of a reference substance\",\n        description=(\n            \"Strength expressed in terms of a reference substance. For when the \"\n            \"ingredient strength is additionally expressed as equivalent to the \"\n            \"strength of some other closely related substance (e.g. salt vs. base).\"\n            \" Reference strength represents the strength (quantitative composition)\"\n            \" of the active moiety of the active substance. There are situations \"\n            \"when the active substance and active moiety are different, therefore \"\n            \"both a strength and a reference strength are needed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    textConcentration: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"textConcentration\",\n        title=(\n            \"Text of either the whole concentration strength or a part of it (rest \"\n            \"being in Strength.concentration as a ratio)\"\n        ),\n        description=(\n            \"A textual represention of either the whole of the concentration \"\n            \"strength or a part of it - with the rest being in \"\n            \"Strength.concentration as a ratio.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    textConcentration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_textConcentration\",\n        title=\"Extension field for ``textConcentration``.\",\n    )\n\n    textPresentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"textPresentation\",\n        title=(\n            \"Text of either the whole presentation strength or a part of it (rest \"\n            \"being in Strength.presentation as a ratio)\"\n        ),\n        description=(\n            \"A textual represention of either the whole of the presentation \"\n            \"strength or a part of it - with the rest being in \"\n            \"Strength.presentation as a ratio.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    textPresentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_textPresentation\",\n        title=\"Extension field for ``textPresentation``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``IngredientSubstanceStrength`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"presentationRatio\",\n            \"presentationRatioRange\",\n            \"textPresentation\",\n            \"concentrationRatio\",\n            \"concentrationRatioRange\",\n            \"textConcentration\",\n            \"measurementPoint\",\n            \"country\",\n            \"referenceStrength\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``IngredientSubstanceStrength`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"presentationRatio\",\n            \"presentationRatioRange\",\n            \"textPresentation\",\n            \"concentrationRatio\",\n            \"concentrationRatioRange\",\n            \"textConcentration\",\n            \"measurementPoint\",\n            \"country\",\n            \"referenceStrength\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"concentration\": [\"concentrationRatio\", \"concentrationRatioRange\"],\n            \"presentation\": [\"presentationRatio\", \"presentationRatioRange\"],\n        }\n        return one_of_many_fields\n\n\nclass IngredientSubstanceStrengthReferenceStrength(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Strength expressed in terms of a reference substance.\n    Strength expressed in terms of a reference substance. For when the\n    ingredient strength is additionally expressed as equivalent to the strength\n    of some other closely related substance (e.g. salt vs. base). Reference\n    strength represents the strength (quantitative composition) of the active\n    moiety of the active substance. There are situations when the active\n    substance and active moiety are different, therefore both a strength and a\n    reference strength are needed.\n    \"\"\"\n\n    __resource_type__ = \"IngredientSubstanceStrengthReferenceStrength\"\n\n    country: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"country\",\n        title=\"Where the strength range applies\",\n        description=\"The country or countries for which the strength range applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    measurementPoint: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"measurementPoint\",\n        title=\"When strength is measured at a particular point or distance\",\n        description=\"For when strength is measured at a particular point or distance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    measurementPoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_measurementPoint\",\n        title=\"Extension field for ``measurementPoint``.\",\n    )\n\n    strengthRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"strengthRatio\",\n        title=\"Strength expressed in terms of a reference substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e strength[x]\n            \"one_of_many\": \"strength\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    strengthRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"strengthRatioRange\",\n        title=\"Strength expressed in terms of a reference substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e strength[x]\n            \"one_of_many\": \"strength\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    substance: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"substance\",\n        title=\"Relevant reference substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``IngredientSubstanceStrengthReferenceStrength`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"substance\",\n            \"strengthRatio\",\n            \"strengthRatioRange\",\n            \"measurementPoint\",\n            \"country\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``IngredientSubstanceStrengthReferenceStrength`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"substance\",\n            \"strengthRatio\",\n            \"strengthRatioRange\",\n            \"measurementPoint\",\n            \"country\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"strength\": [\"strengthRatio\", \"strengthRatioRange\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/insuranceplan.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/InsurancePlan\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass InsurancePlan(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of a Health Insurance product/plan provided by an organization.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlan\"\n\n    administeredBy: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"administeredBy\",\n        title=\"Product administrator\",\n        description=(\n            \"An organization which administer other services such as underwriting, \"\n            \"customer service and/or claims processing on behalf of the health \"\n            \"insurance product owner.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=\"Alternate names\",\n        description=(\n            \"A list of alternate names that the product is known as, or was known \"\n            \"as in the past.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    contact: typing.List[fhirtypes.InsurancePlanContactType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact for the product\",\n        description=\"The contact for the health insurance product for a certain purpose.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    coverage: typing.List[fhirtypes.InsurancePlanCoverageType] | None = Field(\n        default=None,\n        alias=\"coverage\",\n        title=\"Coverage details\",\n        description=\"Details about the coverage offered by the insurance product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"coverageArea\",\n        title=\"Where product applies\",\n        description=(\n            \"The geographic region in which a health insurance product's benefits \"\n            \"apply.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Technical endpoint\",\n        description=(\n            \"The technical endpoints providing access to services operated for the \"\n            \"health insurance product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for Product\",\n        description=(\n            \"Business identifiers assigned to this health insurance product which \"\n            \"remain constant as the resource is updated and propagates from server \"\n            \"to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Official name\",\n        description=(\n            \"Official name of the health insurance product as designated by the \"\n            \"owner.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    network: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"What networks are Included\",\n        description=\"Reference to the network included in the health insurance product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    ownedBy: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"ownedBy\",\n        title=\"Plan issuer\",\n        description=(\n            \"The entity that is providing  the health insurance product and \"\n            \"underwriting the risk.  This is typically an insurance carriers, other\"\n            \" third-party payers, or health plan sponsors comonly referred to as \"\n            \"'payers'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When the product is available\",\n        description=\"The period of time that the health insurance product is available.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    plan: typing.List[fhirtypes.InsurancePlanPlanType] | None = Field(\n        default=None,\n        alias=\"plan\",\n        title=\"Plan details\",\n        description=\"Details about an insurance plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The current state of the health insurance product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of product\",\n        description=\"The kind of health insurance product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"name\",\n            \"alias\",\n            \"period\",\n            \"ownedBy\",\n            \"administeredBy\",\n            \"coverageArea\",\n            \"contact\",\n            \"endpoint\",\n            \"network\",\n            \"coverage\",\n            \"plan\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"name\",\n            \"ownedBy\",\n            \"administeredBy\",\n            \"coverageArea\",\n        ]\n\n\nclass InsurancePlanContact(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contact for the product.\n    The contact for the health insurance product for a certain purpose.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanContact\"\n\n    address: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Visiting or postal addresses for the contact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the contact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    purpose: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"The type of contact\",\n        description=\"Indicates a purpose for which the contact can be reached.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contact details (telephone, email, etc.)  for a contact\",\n        description=(\n            \"A contact detail (e.g. a telephone number or an email address) by \"\n            \"which the party may be contacted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"purpose\",\n            \"name\",\n            \"telecom\",\n            \"address\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanCoverage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Coverage details.\n    Details about the coverage offered by the insurance product.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanCoverage\"\n\n    benefit: typing.List[fhirtypes.InsurancePlanCoverageBenefitType] = Field(\n        default=...,\n        alias=\"benefit\",\n        title=\"List of benefits\",\n        description=\"Specific benefits under this type of coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    network: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"What networks provide coverage\",\n        description=\"Reference to the network that providing the type of coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of coverage\",\n        description=(\n            \"Type of coverage  (Medical; Dental; Mental Health; Substance Abuse; \"\n            \"Vision; Drug; Short Term; Long Term Care; Hospice; Home Health).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanCoverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"network\", \"benefit\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanCoverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanCoverageBenefit(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of benefits.\n    Specific benefits under this type of coverage.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanCoverageBenefit\"\n\n    limit: typing.List[fhirtypes.InsurancePlanCoverageBenefitLimitType] | None = Field(\n        default=None,\n        alias=\"limit\",\n        title=\"Benefit limits\",\n        description=\"The specific limits on the benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requirement: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"requirement\",\n        title=\"Referral requirements\",\n        description=\"The referral requirements to have access/coverage for this benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    requirement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requirement\", title=\"Extension field for ``requirement``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of benefit\",\n        description=(\n            \"Type of benefit (primary care; speciality care; inpatient; \" \"outpatient).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanCoverageBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"requirement\", \"limit\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanCoverageBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanCoverageBenefitLimit(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefit limits.\n    The specific limits on the benefit.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanCoverageBenefitLimit\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Benefit limit details\",\n        description=\"The specific limit on the benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Maximum value allowed\",\n        description=(\n            \"The maximum amount of a service item a plan will pay for a covered \"\n            \"benefit.  For examples. wellness visits, or eyeglasses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanCoverageBenefitLimit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"value\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanCoverageBenefitLimit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanPlan(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Plan details.\n    Details about an insurance plan.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanPlan\"\n\n    coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"coverageArea\",\n        title=\"Where product applies\",\n        description=(\n            \"The geographic region in which a health insurance plan's benefits \"\n            \"apply.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    generalCost: typing.List[fhirtypes.InsurancePlanPlanGeneralCostType] | None = Field(\n        default=None,\n        alias=\"generalCost\",\n        title=\"Overall costs\",\n        description=\"Overall costs associated with the plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for Product\",\n        description=(\n            \"Business identifiers assigned to this health insurance plan which \"\n            \"remain constant as the resource is updated and propagates from server \"\n            \"to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    network: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"What networks provide coverage\",\n        description=\"Reference to the network that providing the type of coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    specificCost: typing.List[\n        fhirtypes.InsurancePlanPlanSpecificCostType\n    ] | None = Field(\n        default=None,\n        alias=\"specificCost\",\n        title=\"Specific costs\",\n        description=\"Costs associated with the coverage provided by the product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of plan\",\n        description='Type of plan. For example, \"Platinum\" or \"High Deductable\".',\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanPlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"coverageArea\",\n            \"network\",\n            \"generalCost\",\n            \"specificCost\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanPlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"coverageArea\"]\n\n\nclass InsurancePlanPlanGeneralCost(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Overall costs.\n    Overall costs associated with the plan.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanPlanGeneralCost\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Additional cost information\",\n        description=(\n            \"Additional information about the general costs associated with this \"\n            \"plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    cost: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"cost\",\n        title=\"Cost value\",\n        description=\"Value of the cost.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    groupSize: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"groupSize\",\n        title=\"Number of enrollees\",\n        description=\"Number of participants enrolled in the plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    groupSize__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_groupSize\", title=\"Extension field for ``groupSize``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of cost\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanPlanGeneralCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"groupSize\",\n            \"cost\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanGeneralCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanPlanSpecificCost(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specific costs.\n    Costs associated with the coverage provided by the product.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanPlanSpecificCost\"\n\n    benefit: typing.List[\n        fhirtypes.InsurancePlanPlanSpecificCostBenefitType\n    ] | None = Field(\n        default=None,\n        alias=\"benefit\",\n        title=\"Benefits list\",\n        description=\"List of the specific benefits under this category of benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"General category of benefit\",\n        description=(\n            \"General category of benefit (Medical; Dental; Vision; Drug; Mental \"\n            \"Health; Substance Abuse; Hospice, Home Health).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanPlanSpecificCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"category\", \"benefit\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanSpecificCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanPlanSpecificCostBenefit(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefits list.\n    List of the specific benefits under this category of benefit.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanPlanSpecificCostBenefit\"\n\n    cost: typing.List[\n        fhirtypes.InsurancePlanPlanSpecificCostBenefitCostType\n    ] | None = Field(\n        default=None,\n        alias=\"cost\",\n        title=\"List of the costs\",\n        description=\"List of the costs associated with a specific benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of specific benefit\",\n        description=(\n            \"Type of specific benefit (preventative; primary care office visit; \"\n            \"speciality office visit; hospitalization; emergency room; urgent \"\n            \"care).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanPlanSpecificCostBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"cost\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanSpecificCostBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanPlanSpecificCostBenefitCost(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of the costs.\n    List of the costs associated with a specific benefit.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanPlanSpecificCostBenefitCost\"\n\n    applicability: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"applicability\",\n        title=\"in-network | out-of-network | other\",\n        description=(\n            \"Whether the cost applies to in-network or out-of-network providers \"\n            \"(in-network; out-of-network; other).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    qualifiers: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"qualifiers\",\n        title=\"Additional information about the cost\",\n        description=(\n            \"Additional information about the cost, such as information about \"\n            \"funding sources (e.g. HSA, HRA, FSA, RRA).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of cost\",\n        description=(\n            \"Type of cost (copay; individual cap; family cap; coinsurance; \"\n            \"deductible).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The actual cost value\",\n        description=(\n            \"The actual cost value. (some of the costs may be represented as \"\n            \"percentages rather than currency, e.g. 10% coinsurance).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanPlanSpecificCostBenefitCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"applicability\",\n            \"qualifiers\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanSpecificCostBenefitCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/invoice.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Invoice\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Invoice(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Invoice containing ChargeItems from an Account.\n    Invoice containing collected ChargeItems from an Account with calculated\n    individual and total price for Billing purpose.\n    \"\"\"\n\n    __resource_type__ = \"Invoice\"\n\n    account: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"account\",\n        title=\"Account that is being balanced\",\n        description=\"Account which is supposed to be balanced with this Invoice.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    cancelledReason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"cancelledReason\",\n        title=\"Reason for cancellation of this Invoice\",\n        description=(\n            \"In case of Invoice cancellation a reason must be given (entered in \"\n            \"error, superseded by corrected invoice etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    cancelledReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_cancelledReason\",\n        title=\"Extension field for ``cancelledReason``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Invoice date / posting date\",\n        description=\"Date/time(s) of when this Invoice was posted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for item\",\n        description=(\n            \"Identifier of this Invoice, often used for reference in correspondence\"\n            \" about this invoice or for tracking of payments.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issuer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"issuer\",\n        title=\"Issuing Organization of Invoice\",\n        description=\"The organizationissuing the Invoice.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    lineItem: typing.List[fhirtypes.InvoiceLineItemType] | None = Field(\n        default=None,\n        alias=\"lineItem\",\n        title=\"Line items of this Invoice\",\n        description=(\n            \"Each line item represents one charge for goods and services rendered. \"\n            \"Details such as date, code and amount are found in the referenced \"\n            \"ChargeItem resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the invoice\",\n        description=(\n            \"Comments made about the invoice by the issuer, subject, or other \"\n            \"participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    participant: typing.List[fhirtypes.InvoiceParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Participant in creation of this Invoice\",\n        description=(\n            \"Indicates who or what performed or participated in the charged \" \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    paymentTerms: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"paymentTerms\",\n        title=\"Payment details\",\n        description=(\n            \"Payment details such as banking details, period of payment, \"\n            \"deductibles, methods of payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    paymentTerms__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_paymentTerms\",\n        title=\"Extension field for ``paymentTerms``.\",\n    )\n\n    recipient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Recipient of this invoice\",\n        description=(\n            \"The individual or Organization responsible for balancing of this \"\n            \"invoice.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | issued | balanced | cancelled | entered-in-error\",\n        description=\"The current state of the Invoice.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"issued\",\n                \"balanced\",\n                \"cancelled\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Recipient(s) of goods and services\",\n        description=(\n            \"The individual or set of individuals receiving the goods and services \"\n            \"billed in this invoice.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    totalGross: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"totalGross\",\n        title=\"Gross total of this Invoice\",\n        description=\"Invoice total, tax included.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    totalNet: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"totalNet\",\n        title=\"Net total of this Invoice\",\n        description=\"Invoice total , taxes excluded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    totalPriceComponent: typing.List[\n        fhirtypes.InvoiceLineItemPriceComponentType\n    ] | None = Field(\n        default=None,\n        alias=\"totalPriceComponent\",\n        title=\"Components of Invoice total\",\n        description=(\n            \"The total amount for the Invoice may be calculated as the sum of the \"\n            \"line items with surcharges/deductions that apply in certain \"\n            \"conditions.  The priceComponent element can be used to offer \"\n            \"transparency to the recipient of the Invoice of how the total price \"\n            \"was calculated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of Invoice\",\n        description=(\n            \"Type of Invoice depending on domain, realm an usage (e.g. \"\n            \"internal/external, dental, preliminary).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Invoice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"cancelledReason\",\n            \"type\",\n            \"subject\",\n            \"recipient\",\n            \"date\",\n            \"participant\",\n            \"issuer\",\n            \"account\",\n            \"lineItem\",\n            \"totalPriceComponent\",\n            \"totalNet\",\n            \"totalGross\",\n            \"paymentTerms\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Invoice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"recipient\",\n            \"date\",\n            \"totalNet\",\n            \"totalGross\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass InvoiceLineItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Line items of this Invoice.\n    Each line item represents one charge for goods and services rendered.\n    Details such as date, code and amount are found in the referenced\n    ChargeItem resource.\n    \"\"\"\n\n    __resource_type__ = \"InvoiceLineItem\"\n\n    chargeItemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"chargeItemCodeableConcept\",\n        title=(\n            \"Reference to ChargeItem containing details of this line item or an \"\n            \"inline billing code\"\n        ),\n        description=(\n            \"The ChargeItem contains information such as the billing code, date, \"\n            \"amount etc. If no further details are required for the lineItem, \"\n            \"inline billing codes can be added using the CodeableConcept data type \"\n            \"instead of the Reference.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e chargeItem[x]\n            \"one_of_many\": \"chargeItem\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    chargeItemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"chargeItemReference\",\n        title=(\n            \"Reference to ChargeItem containing details of this line item or an \"\n            \"inline billing code\"\n        ),\n        description=(\n            \"The ChargeItem contains information such as the billing code, date, \"\n            \"amount etc. If no further details are required for the lineItem, \"\n            \"inline billing codes can be added using the CodeableConcept data type \"\n            \"instead of the Reference.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e chargeItem[x]\n            \"one_of_many\": \"chargeItem\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ChargeItem\"],\n        },\n    )\n\n    priceComponent: typing.List[\n        fhirtypes.InvoiceLineItemPriceComponentType\n    ] | None = Field(\n        default=None,\n        alias=\"priceComponent\",\n        title=\"Components of total line item price\",\n        description=(\n            \"The price for a ChargeItem may be calculated as a base price with \"\n            \"surcharges/deductions that apply in certain conditions. A \"\n            \"ChargeItemDefinition resource that defines the prices, factors and \"\n            \"conditions that apply to a billing code is currently under \"\n            \"development. The priceComponent element can be used to offer \"\n            \"transparency to the recipient of the Invoice as to how the prices have\"\n            \" been calculated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Sequence number of line item\",\n        description=\"Sequence in which the items appear on the invoice.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InvoiceLineItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"chargeItemReference\",\n            \"chargeItemCodeableConcept\",\n            \"priceComponent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InvoiceLineItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"chargeItem\": [\"chargeItemCodeableConcept\", \"chargeItemReference\"]\n        }\n        return one_of_many_fields\n\n\nclass InvoiceLineItemPriceComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Components of total line item price.\n    The price for a ChargeItem may be calculated as a base price with\n    surcharges/deductions that apply in certain conditions. A\n    ChargeItemDefinition resource that defines the prices, factors and\n    conditions that apply to a billing code is currently under development. The\n    priceComponent element can be used to offer transparency to the recipient\n    of the Invoice as to how the prices have been calculated.\n    \"\"\"\n\n    __resource_type__ = \"InvoiceLineItemPriceComponent\"\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Monetary amount associated with this component\",\n        description=\"The amount calculated for this component.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code identifying the specific component\",\n        description=(\n            \"A code that identifies the component. Codes may be used to \"\n            \"differentiate between kinds of taxes, surcharges, discounts etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Factor used for calculating this component\",\n        description=(\n            \"The factor that has been applied on the base price for calculating \"\n            \"this component.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"base | surcharge | deduction | discount | tax | informational\",\n        description=\"This code identifies the type of the component.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"base\",\n                \"surcharge\",\n                \"deduction\",\n                \"discount\",\n                \"tax\",\n                \"informational\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InvoiceLineItemPriceComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"code\",\n            \"factor\",\n            \"amount\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InvoiceLineItemPriceComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass InvoiceParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Participant in creation of this Invoice.\n    Indicates who or what performed or participated in the charged service.\n    \"\"\"\n\n    __resource_type__ = \"InvoiceParticipant\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual who was involved\",\n        description=(\n            \"The device, practitioner, etc. who performed or participated in the \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Type of involvement in creation of this Invoice\",\n        description=(\n            \"Describes the type of involvement (e.g. transcriptionist, creator \"\n            \"etc.). If the invoice has been created automatically, the Participant \"\n            \"may be a billing engine or another kind of device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InvoiceParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InvoiceParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/library.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Library\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Library(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Represents a library of quality improvement components.\n    The Library resource is a general-purpose container for knowledge asset\n    definitions. It can be used to describe and expose existing knowledge\n    assets such as logic libraries and information model descriptions, as well\n    as to describe a collection of knowledge assets.\n    \"\"\"\n\n    __resource_type__ = \"Library\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the library was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    content: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"Contents of the library, either embedded or referenced\",\n        description=(\n            \"The content of the library as an Attachment. The content may be a \"\n            \"reference to a url, or may be directly embedded as a base-64 string. \"\n            \"Either way, the contentType of the attachment determines how to \"\n            \"interpret the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the library and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"dataRequirement\",\n        title=\"What data is referenced by this library\",\n        description=(\n            \"Describes a set of data that must be provided in order to be able to \"\n            \"successfully perform the computations defined by the library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the library was published. The \"\n            \"date must change when the business version changes and it must change \"\n            \"if the status code changes. In addition, it should change when the \"\n            \"substantive content of the library changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the library\",\n        description=(\n            \"A free text natural language description of the library from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the library is expected to be used\",\n        description=(\n            \"The period during which the library content was or is planned to be in\"\n            \" active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization responsible for officially endorsing the\"\n            \" content for use in some setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this library is authored for testing \"\n            \"purposes (or education/evaluation/marketing) and is not intended to be\"\n            \" used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the library\",\n        description=(\n            \"A formal identifier that is used to identify this library when it is \"\n            \"represented in other formats, or referenced in a specification, model,\"\n            \" design or an instance. e.g. CMS or NQF identifiers for a measure \"\n            \"artifact. Note that at least one identifier is required for non-\"\n            \"experimental active artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for library (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the library is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the library was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this library (computer friendly)\",\n        description=(\n            \"A natural language name identifying the library. This name should be \"\n            \"usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    parameter: typing.List[fhirtypes.ParameterDefinitionType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Parameters defined by the library\",\n        description=\"The parameter element defines parameters used by the library.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=\"The name of the organization or individual that published the library.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this library is defined\",\n        description=(\n            \"Explanation of why this library is needed and why it has been designed\"\n            \" as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc.\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization primarily responsible for review of some\"\n            \" aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this library. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=\"Type of individual the library content is focused on\",\n        description=(\n            \"A code or group definition that describes the intended subject of the \"\n            \"contents of the library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=\"Type of individual the library content is focused on\",\n        description=(\n            \"A code or group definition that describes the intended subject of the \"\n            \"contents of the library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the library\",\n        description=(\n            \"An explanatory or alternate title for the library giving additional \"\n            \"information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this library (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the library.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc.\",\n        description=(\n            \"Descriptive topics related to the content of the library. Topics \"\n            \"provide a high-level categorization of the library that can be useful \"\n            \"for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=(\n            \"logic-library | model-definition | asset-collection | module-\" \"definition\"\n        ),\n        description=(\n            \"Identifies the type of library such as a Logic Library, Model \"\n            \"Definition, Asset Collection, or Module Definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this library, represented as a URI (globally \"\n            \"unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this library when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this library is (or will be) published. This URL can be \"\n            \"the target of a canonical reference. It SHALL remain the same when the\"\n            \" library is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the library\",\n        description=(\n            \"A detailed description of how the library is used from a clinical \"\n            \"perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate library instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the library\",\n        description=(\n            \"The identifier that is used to identify this version of the library \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the library author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence. To provide a version consistent with the Decision Support \"\n            \"Service specification, use the format Major.Minor.Revision (e.g. \"\n            \"1.0.0). For more information on versioning knowledge assets, refer to \"\n            \"the Decision Support Service specification. Note that a version is \"\n            \"required for non-experimental active artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Library`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"status\",\n            \"experimental\",\n            \"type\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"usage\",\n            \"copyright\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"parameter\",\n            \"dataRequirement\",\n            \"content\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Library`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"type\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"content\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"subject\": [\"subjectCodeableConcept\", \"subjectReference\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/linkage.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Linkage\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Linkage(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links records for 'same' item.\n    Identifies two or more records (resource instances) that refer to the same\n    real-world \"occurrence\".\n    \"\"\"\n\n    __resource_type__ = \"Linkage\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this linkage assertion is active or not\",\n        description=(\n            \"Indicates whether the asserted set of linkages are considered to be \"\n            '\"in effect\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who is responsible for linkages\",\n        description=(\n            \"Identifies the user or organization responsible for asserting the \"\n            \"linkages as well as the user or organization who establishes the \"\n            \"context in which the nature of each linkage is evaluated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    item: typing.List[fhirtypes.LinkageItemType] = Field(\n        default=...,\n        alias=\"item\",\n        title=\"Item to be linked\",\n        description=(\n            \"Identifies which record considered as the reference to the same real-\"\n            \"world occurrence as well as how the items should be evaluated within \"\n            \"the collection of linked items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Linkage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"active\",\n            \"author\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Linkage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"active\", \"author\", \"item\"]\n\n\nclass LinkageItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Item to be linked.\n    Identifies which record considered as the reference to the same real-world\n    occurrence as well as how the items should be evaluated within the\n    collection of linked items.\n    \"\"\"\n\n    __resource_type__ = \"LinkageItem\"\n\n    resource: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"resource\",\n        title=\"Resource being linked\",\n        description=\"The resource instance being linked as part of the group.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"source | alternate | historical\",\n        description=(\n            'Distinguishes which item is \"source of truth\" (if any) and which items'\n            \" are no longer considered to be current representations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"source\", \"alternate\", \"historical\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``LinkageItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"resource\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``LinkageItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"resource\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/list.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/List\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass List(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A list is a curated collection of resources.\n    \"\"\"\n\n    __resource_type__ = \"List\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"What the purpose of this list is\",\n        description=\"This code defines the purpose of the list - why it was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the list was prepared\",\n        description=\"The date that the list was prepared.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    emptyReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"emptyReason\",\n        title=\"Why list is empty\",\n        description=\"If the list is empty, why the list is empty.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Context in which list created\",\n        description=\"The encounter that is the context in which this list was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    entry: typing.List[fhirtypes.ListEntryType] | None = Field(\n        default=None,\n        alias=\"entry\",\n        title=\"Entries in the list\",\n        description=\"Entries in this list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Identifier for the List assigned for business purposes outside the \"\n            \"context of FHIR.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"working | snapshot | changes\",\n        description=(\n            \"How this list was prepared - whether it is a working list that is \"\n            \"suitable for being maintained on an ongoing basis, or if it represents\"\n            \" a snapshot of a list of items from another source, or whether it is a\"\n            \" prepared list where items may be marked as added, modified or \"\n            \"deleted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"working\", \"snapshot\", \"changes\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the list\",\n        description=\"Comments that apply to the overall list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    orderedBy: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"orderedBy\",\n        title=\"What order the list has\",\n        description=\"What order applies to the items in the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Who and/or what defined the list contents (aka Author)\",\n        description=(\n            \"The entity responsible for deciding what the contents of the list \"\n            \"were. Where the list was created by a human, this is the same as the \"\n            \"author of the list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"Device\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"current | retired | entered-in-error\",\n        description=\"Indicates the current state of this list.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"current\", \"retired\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"If all resources have the same subject\",\n        description=(\n            \"The common subject (or patient) of the resources that are in the list \"\n            \"if there is one.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Device\", \"Location\"],\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Descriptive name for the list\",\n        description=\"A label for the list assigned by the author.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``List`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"mode\",\n            \"title\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"date\",\n            \"source\",\n            \"orderedBy\",\n            \"note\",\n            \"entry\",\n            \"emptyReason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``List`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"mode\",\n            \"title\",\n            \"code\",\n            \"subject\",\n            \"date\",\n            \"source\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ListEntry(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Entries in the list.\n    Entries in this list.\n    \"\"\"\n\n    __resource_type__ = \"ListEntry\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When item added to list\",\n        description=\"When this item was added to the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    deleted: bool | None = Field(\n        default=None,\n        alias=\"deleted\",\n        title=\"If this item is actually marked as deleted\",\n        description=\"True if this item is marked as deleted in the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    deleted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_deleted\", title=\"Extension field for ``deleted``.\"\n    )\n\n    flag: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"flag\",\n        title=\"Status/Workflow information about this item\",\n        description=(\n            \"The flag allows the system constructing the list to indicate the role \"\n            \"and significance of the item in the list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    item: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"item\",\n        title=\"Actual entry\",\n        description=\"A reference to the actual resource from which data was derived.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ListEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"flag\",\n            \"deleted\",\n            \"date\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ListEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/location.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Location\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Location(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details and position information for a physical place.\n    Details and position information for a physical place where services are\n    provided and resources and participants may be stored, found, contained, or\n    accommodated.\n    \"\"\"\n\n    __resource_type__ = \"Location\"\n\n    address: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Physical location\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=(\n            \"A list of alternate names that the location is known as, or was known \"\n            \"as, in the past\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    availabilityExceptions: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"availabilityExceptions\",\n        title=\"Description of availability exceptions\",\n        description=(\n            \"A description of when the locations opening ours are different to \"\n            \"normal, e.g. public holiday availability. Succinctly describing all \"\n            \"possible exceptions to normal site availability as detailed in the \"\n            \"opening hours Times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availabilityExceptions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availabilityExceptions\",\n        title=\"Extension field for ``availabilityExceptions``.\",\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=(\n            \"Additional details about the location that could be displayed as \"\n            \"further information to identify the location beyond its name\"\n        ),\n        description=(\n            \"Description of the Location, which helps in finding or referencing the\"\n            \" place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to services operated for the \"\n            \"location\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    hoursOfOperation: typing.List[\n        fhirtypes.LocationHoursOfOperationType\n    ] | None = Field(\n        default=None,\n        alias=\"hoursOfOperation\",\n        title=\"What days/times during a week is this location usually open\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique code or number identifying the location to its users\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"Organization responsible for provisioning and upkeep\",\n        description=(\n            \"The organization responsible for the provisioning and upkeep of the \"\n            \"location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"instance | kind\",\n        description=(\n            \"Indicates whether a resource instance represents a specific location \"\n            \"or a class of locations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"kind\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the location as used by humans\",\n        description=\"Name of the location as used by humans. Does not need to be unique.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    operationalStatus: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"operationalStatus\",\n        title=\"The operational status of the location (typically only for a bed/room)\",\n        description=(\n            \"The operational status covers operation values most relevant to beds \"\n            \"(but can also apply to rooms/units/chairs/etc. such as an isolation \"\n            \"unit/dialysis chair). This typically covers concepts such as \"\n            \"contamination, housekeeping, and other activities like maintenance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    partOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Another Location this one is physically a part of\",\n        description=\"Another Location of which this Location is physically a part of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    physicalType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"physicalType\",\n        title=\"Physical form of the location\",\n        description=\"Physical form of the location, e.g. building, room, vehicle, road.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    position: fhirtypes.LocationPositionType | None = Field(\n        default=None,\n        alias=\"position\",\n        title=\"The absolute geographic location\",\n        description=(\n            \"The absolute geographic location of the Location, expressed using the \"\n            \"WGS84 datum (This is the same co-ordinate system used in KML).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | suspended | inactive\",\n        description=(\n            \"The status property covers the general availability of the resource, \"\n            \"not the current value which may be covered by the operationStatus, or \"\n            \"by a schedule/slots if they are configured for the location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"suspended\", \"inactive\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contact details of the location\",\n        description=(\n            \"The contact details of communication devices available at the \"\n            \"location. This can include phone numbers, fax numbers, mobile numbers,\"\n            \" email addresses and web sites.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of function performed\",\n        description=\"Indicates the type of function performed at the location.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Location`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"operationalStatus\",\n            \"name\",\n            \"alias\",\n            \"description\",\n            \"mode\",\n            \"type\",\n            \"telecom\",\n            \"address\",\n            \"physicalType\",\n            \"position\",\n            \"managingOrganization\",\n            \"partOf\",\n            \"hoursOfOperation\",\n            \"availabilityExceptions\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Location`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"operationalStatus\",\n            \"name\",\n            \"description\",\n            \"mode\",\n            \"type\",\n            \"physicalType\",\n            \"managingOrganization\",\n        ]\n\n\nclass LocationHoursOfOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What days/times during a week is this location usually open.\n    \"\"\"\n\n    __resource_type__ = \"LocationHoursOfOperation\"\n\n    allDay: bool | None = Field(\n        default=None,\n        alias=\"allDay\",\n        title=\"The Location is open all day\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    allDay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_allDay\", title=\"Extension field for ``allDay``.\"\n    )\n\n    closingTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"closingTime\",\n        title=\"Time that the Location closes\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    closingTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_closingTime\", title=\"Extension field for ``closingTime``.\"\n    )\n\n    daysOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"daysOfWeek\",\n        title=\"mon | tue | wed | thu | fri | sat | sun\",\n        description=(\n            \"Indicates which days of the week are available between the start and \"\n            \"end Times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"],\n        },\n    )\n    daysOfWeek__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_daysOfWeek\", title=\"Extension field for ``daysOfWeek``.\"\n    )\n\n    openingTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"openingTime\",\n        title=\"Time that the Location opens\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    openingTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_openingTime\", title=\"Extension field for ``openingTime``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``LocationHoursOfOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"daysOfWeek\",\n            \"allDay\",\n            \"openingTime\",\n            \"closingTime\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``LocationHoursOfOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass LocationPosition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The absolute geographic location.\n    The absolute geographic location of the Location, expressed using the WGS84\n    datum (This is the same co-ordinate system used in KML).\n    \"\"\"\n\n    __resource_type__ = \"LocationPosition\"\n\n    altitude: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"altitude\",\n        title=\"Altitude with WGS84 datum\",\n        description=(\n            \"Altitude. The value domain and the interpretation are the same as for \"\n            \"the text of the altitude element in KML (see notes below).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    altitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_altitude\", title=\"Extension field for ``altitude``.\"\n    )\n\n    latitude: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"latitude\",\n        title=\"Latitude with WGS84 datum\",\n        description=(\n            \"Latitude. The value domain and the interpretation are the same as for \"\n            \"the text of the latitude element in KML (see notes below).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    latitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_latitude\", title=\"Extension field for ``latitude``.\"\n    )\n\n    longitude: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"longitude\",\n        title=\"Longitude with WGS84 datum\",\n        description=(\n            \"Longitude. The value domain and the interpretation are the same as for\"\n            \" the text of the longitude element in KML (see notes below).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    longitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_longitude\", title=\"Extension field for ``longitude``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``LocationPosition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"longitude\",\n            \"latitude\",\n            \"altitude\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``LocationPosition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"latitude\", \"latitude__ext\"),\n            (\"longitude\", \"longitude__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/manufactureditemdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ManufacturedItemDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ManufacturedItemDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The definition and characteristics of a medicinal manufactured item, such\n    as a tablet or capsule, as contained in a packaged medicinal product.\n    \"\"\"\n\n    __resource_type__ = \"ManufacturedItemDefinition\"\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=(\n            \"The ingredients of this manufactured item. Only needed if these are \"\n            \"not specified by incoming references from the Ingredient resource\"\n        ),\n        description=(\n            \"The ingredients of this manufactured item. This is only needed if the \"\n            \"ingredients are not specified by incoming references from the \"\n            \"Ingredient resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    manufacturedDoseForm: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"manufacturedDoseForm\",\n        title=\"Dose form as manufactured (before any necessary transformation)\",\n        description=(\n            \"Dose form as manufactured and before any transformation into the \"\n            \"pharmaceutical product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=(\n            \"Manufacturer of the item (Note that this should be named \"\n            '\"manufacturer\" but it currently causes technical issues)'\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    property: typing.List[\n        fhirtypes.ManufacturedItemDefinitionPropertyType\n    ] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"General characteristics of this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this item. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    unitOfPresentation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unitOfPresentation\",\n        title=\"The \\u201creal world\\u201d units in which the quantity of the item is described\",\n        description=(\n            \"The \\u201creal world\\u201d units in which the quantity of the manufactured item \"\n            \"is described.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ManufacturedItemDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"manufacturedDoseForm\",\n            \"unitOfPresentation\",\n            \"manufacturer\",\n            \"ingredient\",\n            \"property\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ManufacturedItemDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"manufacturedDoseForm\",\n            \"unitOfPresentation\",\n            \"manufacturer\",\n            \"ingredient\",\n            \"property\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ManufacturedItemDefinitionProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    General characteristics of this item.\n    \"\"\"\n\n    __resource_type__ = \"ManufacturedItemDefinitionProperty\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"A code expressing the type of characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ManufacturedItemDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ManufacturedItemDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDate\",\n                \"valueQuantity\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/marketingstatus.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MarketingStatus\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, fhirtypes\n\n\nclass MarketingStatus(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The marketing status describes the date when a medicinal product is\n    actually put on the market or the date as of which it is no longer\n    available.\n    \"\"\"\n\n    __resource_type__ = \"MarketingStatus\"\n\n    country: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"country\",\n        title=(\n            \"The country in which the marketing authorisation has been granted \"\n            \"shall be specified It should be specified using the ISO 3166 \\u2011 1 \"\n            \"alpha-2 code elements\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dateRange: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"dateRange\",\n        title=(\n            \"The date when the Medicinal Product is placed on the market by the \"\n            \"Marketing Authorisation Holder (or where applicable, the \"\n            \"manufacturer/distributor) in a country and/or jurisdiction shall be \"\n            \"provided A complete date consisting of day, month and year shall be \"\n            \"specified using the ISO 8601 date format NOTE \\u201cPlaced on the market\\u201d \"\n            \"refers to the release of the Medicinal Product into the distribution \"\n            \"chain\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=(\n            \"Where a Medicines Regulatory Agency has granted a marketing \"\n            \"authorisation for which specific provisions within a jurisdiction \"\n            \"apply, the jurisdiction can be specified using an appropriate \"\n            \"controlled terminology The controlled term and the controlled term \"\n            \"identifier shall be specified\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    restoreDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"restoreDate\",\n        title=(\n            \"The date when the Medicinal Product is placed on the market by the \"\n            \"Marketing Authorisation Holder (or where applicable, the \"\n            \"manufacturer/distributor) in a country and/or jurisdiction shall be \"\n            \"provided A complete date consisting of day, month and year shall be \"\n            \"specified using the ISO 8601 date format NOTE \\u201cPlaced on the market\\u201d \"\n            \"refers to the release of the Medicinal Product into the distribution \"\n            \"chain\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    restoreDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_restoreDate\", title=\"Extension field for ``restoreDate``.\"\n    )\n\n    status: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"status\",\n        title=(\n            \"This attribute provides information on the status of the marketing of \"\n            \"the medicinal product See ISO/TS 20443 for more information and \"\n            \"examples\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MarketingStatus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"country\",\n            \"jurisdiction\",\n            \"status\",\n            \"dateRange\",\n            \"restoreDate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MarketingStatus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"country\",\n            \"jurisdiction\",\n            \"status\",\n            \"dateRange\",\n            \"restoreDate\",\n        ]\n"
  },
  {
    "path": "fhir/resources/R4B/measure.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Measure\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Measure(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A quality measure definition.\n    The Measure resource provides the definition of a quality measure.\n    \"\"\"\n\n    __resource_type__ = \"Measure\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the measure was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    clinicalRecommendationStatement: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"clinicalRecommendationStatement\",\n        title=\"Summary of clinical guidelines\",\n        description=(\n            \"Provides a summary of relevant clinical guidelines or other clinical \"\n            \"recommendations supporting the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    clinicalRecommendationStatement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_clinicalRecommendationStatement\",\n        title=\"Extension field for ``clinicalRecommendationStatement``.\",\n    )\n\n    compositeScoring: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"compositeScoring\",\n        title=\"opportunity | all-or-nothing | linear | weighted\",\n        description=(\n            \"If this is a composite measure, the scoring method used to combine the\"\n            \" component measures to determine the composite score.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the measure and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the measure was published. The \"\n            \"date must change when the business version changes and it must change \"\n            \"if the status code changes. In addition, it should change when the \"\n            \"substantive content of the measure changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    definition: typing.List[fhirtypes.MarkdownType | None] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Defined terms used in the measure documentation\",\n        description=\"Provides a description of an individual term used within the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    definition__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the measure\",\n        description=(\n            \"A free text natural language description of the measure from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    disclaimer: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"disclaimer\",\n        title=\"Disclaimer for use of the measure or its referenced content\",\n        description=(\n            \"Notices and disclaimers regarding the use of the measure or related to\"\n            \" intellectual property (such as code systems) referenced by the \"\n            \"measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    disclaimer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disclaimer\", title=\"Extension field for ``disclaimer``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the measure is expected to be used\",\n        description=(\n            \"The period during which the measure content was or is planned to be in\"\n            \" active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization responsible for officially endorsing the\"\n            \" content for use in some setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this measure is authored for testing \"\n            \"purposes (or education/evaluation/marketing) and is not intended to be\"\n            \" used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    group: typing.List[fhirtypes.MeasureGroupType] | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"Population criteria group\",\n        description=\"A group of population criteria for the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    guidance: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"guidance\",\n        title=\"Additional guidance for implementers\",\n        description=(\n            \"Additional guidance for the measure including how it can be used in a \"\n            \"clinical context, and the intent of the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    guidance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_guidance\", title=\"Extension field for ``guidance``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the measure\",\n        description=(\n            \"A formal identifier that is used to identify this measure when it is \"\n            \"represented in other formats, or referenced in a specification, model,\"\n            \" design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    improvementNotation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"improvementNotation\",\n        title=\"increase | decrease\",\n        description=(\n            \"Information on whether an increase or decrease in score is the \"\n            \"preferred result (e.g., a higher score indicates better quality OR a \"\n            \"lower score indicates better quality OR quality is within a range).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for measure (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the measure is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the measure was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    library: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the measure\",\n        description=(\n            \"A reference to a Library resource containing the formal logic used by \"\n            \"the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n    library__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_library\", title=\"Extension field for ``library``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this measure (computer friendly)\",\n        description=(\n            \"A natural language name identifying the measure. This name should be \"\n            \"usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=\"The name of the organization or individual that published the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this measure is defined\",\n        description=(\n            \"Explanation of why this measure is needed and why it has been designed\"\n            \" as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    rateAggregation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"rateAggregation\",\n        title=\"How is rate aggregation performed for this measure\",\n        description=(\n            \"Describes how to combine the information calculated, based on logic in\"\n            \" each of several populations, into one summarized result.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rateAggregation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_rateAggregation\",\n        title=\"Extension field for ``rateAggregation``.\",\n    )\n\n    rationale: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"rationale\",\n        title=\"Detailed description of why the measure exists\",\n        description=(\n            \"Provides a succinct statement of the need for the measure. Usually \"\n            \"includes statements pertaining to importance criterion: impact, gap in\"\n            \" care, and evidence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rationale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rationale\", title=\"Extension field for ``rationale``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc.\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization primarily responsible for review of some\"\n            \" aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    riskAdjustment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"riskAdjustment\",\n        title=\"How risk adjustment is applied for this measure\",\n        description=(\n            \"A description of the risk adjustment factors that may impact the \"\n            \"resulting score for the measure and how they may be accounted for when\"\n            \" computing and reporting measure results.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    riskAdjustment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_riskAdjustment\",\n        title=\"Extension field for ``riskAdjustment``.\",\n    )\n\n    scoring: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"scoring\",\n        title=\"proportion | ratio | continuous-variable | cohort\",\n        description=(\n            \"Indicates how the calculation is performed for the measure, including \"\n            \"proportion, ratio, continuous-variable, and cohort. The value set is \"\n            \"extensible, allowing additional measure scoring types to be \"\n            \"represented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this measure. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects for the measure. If this element is not \"\n            \"provided, a Patient subject is assumed, but the subject of the measure\"\n            \" can be anything.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects for the measure. If this element is not \"\n            \"provided, a Patient subject is assumed, but the subject of the measure\"\n            \" can be anything.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the measure\",\n        description=(\n            \"An explanatory or alternate title for the measure giving additional \"\n            \"information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    supplementalData: typing.List[fhirtypes.MeasureSupplementalDataType] | None = Field(\n        default=None,\n        alias=\"supplementalData\",\n        title=\"What other data should be reported with the measure\",\n        description=(\n            \"The supplemental data criteria for the measure report, specified as \"\n            \"either the name of a valid CQL expression within a referenced library,\"\n            \" or a valid FHIR Resource Path.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this measure (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=(\n            \"The category of the measure, such as Education, Treatment, Assessment,\"\n            \" etc.\"\n        ),\n        description=(\n            \"Descriptive topics related to the content of the measure. Topics \"\n            \"provide a high-level categorization grouping types of measures that \"\n            \"can be useful for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"process | outcome | structure | patient-reported-outcome | composite\",\n        description=(\n            \"Indicates whether the measure is used to examine a process, an outcome\"\n            \" over time, a patient-reported outcome, or a structure measure such as\"\n            \" utilization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this measure, represented as a URI (globally \"\n            \"unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this measure when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this measure is (or will be) published. This URL can be \"\n            \"the target of a canonical reference. It SHALL remain the same when the\"\n            \" measure is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the measure\",\n        description=(\n            \"A detailed description, from a clinical perspective, of how the \"\n            \"measure is used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate measure instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the measure\",\n        description=(\n            \"The identifier that is used to identify this version of the measure \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the measure author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence. To provide a version consistent with the Decision Support \"\n            \"Service specification, use the format Major.Minor.Revision (e.g. \"\n            \"1.0.0). For more information on versioning knowledge assets, refer to \"\n            \"the Decision Support Service specification. Note that a version is \"\n            \"required for non-experimental active artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Measure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"status\",\n            \"experimental\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"usage\",\n            \"copyright\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"library\",\n            \"disclaimer\",\n            \"scoring\",\n            \"compositeScoring\",\n            \"type\",\n            \"riskAdjustment\",\n            \"rateAggregation\",\n            \"rationale\",\n            \"clinicalRecommendationStatement\",\n            \"improvementNotation\",\n            \"definition\",\n            \"guidance\",\n            \"group\",\n            \"supplementalData\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Measure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"disclaimer\",\n            \"scoring\",\n            \"compositeScoring\",\n            \"type\",\n            \"riskAdjustment\",\n            \"rateAggregation\",\n            \"rationale\",\n            \"clinicalRecommendationStatement\",\n            \"improvementNotation\",\n            \"definition\",\n            \"guidance\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"subject\": [\"subjectCodeableConcept\", \"subjectReference\"]}\n        return one_of_many_fields\n\n\nclass MeasureGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Population criteria group.\n    A group of population criteria for the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureGroup\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Meaning of the group\",\n        description=(\n            \"Indicates a meaning for the group. This can be as simple as a unique \"\n            \"identifier, or it can establish meaning in a broader context by \"\n            \"drawing from a terminology, allowing groups to be correlated across \"\n            \"measures.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Summary description\",\n        description=\"The human readable description of this population group.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    population: typing.List[fhirtypes.MeasureGroupPopulationType] | None = Field(\n        default=None,\n        alias=\"population\",\n        title=\"Population criteria\",\n        description=\"A population criteria for the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    stratifier: typing.List[fhirtypes.MeasureGroupStratifierType] | None = Field(\n        default=None,\n        alias=\"stratifier\",\n        title=\"Stratifier criteria for the measure\",\n        description=(\n            \"The stratifier criteria for the measure report, specified as either \"\n            \"the name of a valid CQL expression defined within a referenced library\"\n            \" or a valid FHIR Resource Path.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"description\",\n            \"population\",\n            \"stratifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureGroupPopulation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Population criteria.\n    A population criteria for the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureGroupPopulation\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"initial-population | numerator | numerator-exclusion | denominator | \"\n            \"denominator-exclusion | denominator-exception | measure-population | \"\n            \"measure-population-exclusion | measure-observation\"\n        ),\n        description=\"The type of population criteria.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    criteria: fhirtypes.ExpressionType = Field(\n        default=...,\n        alias=\"criteria\",\n        title=\"The criteria that defines this population\",\n        description=(\n            \"An expression that specifies the criteria for the population, \"\n            \"typically the name of an expression in a library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The human readable description of this population criteria\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureGroupPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"description\",\n            \"criteria\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureGroupPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureGroupStratifier(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratifier criteria for the measure.\n    The stratifier criteria for the measure report, specified as either the\n    name of a valid CQL expression defined within a referenced library or a\n    valid FHIR Resource Path.\n    \"\"\"\n\n    __resource_type__ = \"MeasureGroupStratifier\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Meaning of the stratifier\",\n        description=(\n            \"Indicates a meaning for the stratifier. This can be as simple as a \"\n            \"unique identifier, or it can establish meaning in a broader context by\"\n            \" drawing from a terminology, allowing stratifiers to be correlated \"\n            \"across measures.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    component: typing.List[\n        fhirtypes.MeasureGroupStratifierComponentType\n    ] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"Stratifier criteria component for the measure\",\n        description=(\n            \"A component of the stratifier criteria for the measure report, \"\n            \"specified as either the name of a valid CQL expression defined within \"\n            \"a referenced library or a valid FHIR Resource Path.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    criteria: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"criteria\",\n        title=\"How the measure should be stratified\",\n        description=(\n            \"An expression that specifies the criteria for the stratifier. This is \"\n            \"typically the name of an expression defined within a referenced \"\n            \"library, but it may also be a path to a stratifier element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The human readable description of this stratifier\",\n        description=\"The human readable description of this stratifier criteria.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureGroupStratifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"description\",\n            \"criteria\",\n            \"component\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureGroupStratifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureGroupStratifierComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratifier criteria component for the measure.\n    A component of the stratifier criteria for the measure report, specified as\n    either the name of a valid CQL expression defined within a referenced\n    library or a valid FHIR Resource Path.\n    \"\"\"\n\n    __resource_type__ = \"MeasureGroupStratifierComponent\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Meaning of the stratifier component\",\n        description=(\n            \"Indicates a meaning for the stratifier component. This can be as \"\n            \"simple as a unique identifier, or it can establish meaning in a \"\n            \"broader context by drawing from a terminology, allowing stratifiers to\"\n            \" be correlated across measures.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    criteria: fhirtypes.ExpressionType = Field(\n        default=...,\n        alias=\"criteria\",\n        title=\"Component of how the measure should be stratified\",\n        description=(\n            \"An expression that specifies the criteria for this component of the \"\n            \"stratifier. This is typically the name of an expression defined within\"\n            \" a referenced library, but it may also be a path to a stratifier \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The human readable description of this stratifier component\",\n        description=\"The human readable description of this stratifier criteria component.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureGroupStratifierComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"description\",\n            \"criteria\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureGroupStratifierComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureSupplementalData(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What other data should be reported with the measure.\n    The supplemental data criteria for the measure report, specified as either\n    the name of a valid CQL expression within a referenced library, or a valid\n    FHIR Resource Path.\n    \"\"\"\n\n    __resource_type__ = \"MeasureSupplementalData\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Meaning of the supplemental data\",\n        description=(\n            \"Indicates a meaning for the supplemental data. This can be as simple \"\n            \"as a unique identifier, or it can establish meaning in a broader \"\n            \"context by drawing from a terminology, allowing supplemental data to \"\n            \"be correlated across measures.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    criteria: fhirtypes.ExpressionType = Field(\n        default=...,\n        alias=\"criteria\",\n        title=\"Expression describing additional data to be reported\",\n        description=(\n            \"The criteria for the supplemental data. This is typically the name of \"\n            \"a valid expression defined within a referenced library, but it may \"\n            \"also be a path to a specific data element. The criteria defines the \"\n            \"data to be returned for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The human readable description of this supplemental data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    usage: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"supplemental-data | risk-adjustment-factor\",\n        description=(\n            \"An indicator of the intended usage for the supplemental data element. \"\n            \"Supplemental data indicates the data is additional information \"\n            \"requested to augment the measure information. Risk adjustment factor \"\n            \"indicates the data is additional information used to calculate risk \"\n            \"adjustment factors when applying a risk model to the measure \"\n            \"calculation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureSupplementalData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"usage\",\n            \"description\",\n            \"criteria\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureSupplementalData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/measurereport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MeasureReport\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MeasureReport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Results of a measure evaluation.\n    The MeasureReport resource contains the results of the calculation of a\n    measure; and optionally a reference to the resources involved in that\n    calculation.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReport\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the report was generated\",\n        description=\"The date this measure report was generated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    evaluatedResource: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"evaluatedResource\",\n        title=\"What data was used to calculate the measure score\",\n        description=(\n            \"A reference to a Bundle containing the Resources that were used in the\"\n            \" calculation of this measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    group: typing.List[fhirtypes.MeasureReportGroupType] | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"Measure results for each group\",\n        description=(\n            \"The results of the calculation, one for each population group in the \"\n            \"measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the MeasureReport\",\n        description=(\n            \"A formal identifier that is used to identify this MeasureReport when \"\n            \"it is represented in other formats or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    improvementNotation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"improvementNotation\",\n        title=\"increase | decrease\",\n        description=(\n            \"Whether improvement in the measure is noted by an increase or decrease\"\n            \" in the measure score.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    measure: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"measure\",\n        title=\"What measure was calculated\",\n        description=\"A reference to the Measure that was calculated to produce this report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Measure\"],\n        },\n    )\n    measure__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_measure\", title=\"Extension field for ``measure``.\"\n    )\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"What period the report covers\",\n        description=\"The reporting period for which the report was calculated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reporter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reporter\",\n        title=\"Who is reporting the data\",\n        description=\"The individual, location, or organization that is reporting the data.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Location\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"complete | pending | error\",\n        description=(\n            \"The MeasureReport status. No data will be available until the \"\n            \"MeasureReport status is complete.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"complete\", \"pending\", \"error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"What individual(s) the report is for\",\n        description=(\n            \"Optional subject identifying the individual or individuals the report \"\n            \"is for.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Location\",\n                \"Device\",\n                \"RelatedPerson\",\n                \"Group\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"individual | subject-list | summary | data-collection\",\n        description=(\n            \"The type of measure report. This may be an individual report, which \"\n            \"provides the score for the measure for an individual member of the \"\n            \"population; a subject-listing, which returns the list of members that \"\n            \"meet the various criteria in the measure; a summary report, which \"\n            \"returns a population count for each of the criteria in the measure; or\"\n            \" a data-collection, which enables the MeasureReport to be used to \"\n            \"exchange the data-of-interest for a quality measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"individual\", \"subject-list\", \"summary\", \"data-collection\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"measure\",\n            \"subject\",\n            \"date\",\n            \"reporter\",\n            \"period\",\n            \"improvementNotation\",\n            \"group\",\n            \"evaluatedResource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"measure\",\n            \"subject\",\n            \"date\",\n            \"reporter\",\n            \"period\",\n            \"improvementNotation\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"measure\", \"measure__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"type\", \"type__ext\"),\n        ]\n        return required_fields\n\n\nclass MeasureReportGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Measure results for each group.\n    The results of the calculation, one for each population group in the\n    measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroup\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Meaning of the group\",\n        description=(\n            \"The meaning of the population group as defined in the measure \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    measureScore: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"measureScore\",\n        title=\"What score this group achieved\",\n        description=(\n            \"The measure score for this population group, calculated as appropriate\"\n            \" for the measure type and scoring method, and based on the contents of\"\n            \" the populations defined in the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    population: typing.List[fhirtypes.MeasureReportGroupPopulationType] | None = Field(\n        default=None,\n        alias=\"population\",\n        title=\"The populations in the group\",\n        description=(\n            \"The populations that make up the population group, one for each type \"\n            \"of population appropriate for the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    stratifier: typing.List[fhirtypes.MeasureReportGroupStratifierType] | None = Field(\n        default=None,\n        alias=\"stratifier\",\n        title=\"Stratification results\",\n        description=(\n            \"When a measure includes multiple stratifiers, there will be a \"\n            \"stratifier group for each stratifier defined by the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"population\",\n            \"measureScore\",\n            \"stratifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"measureScore\"]\n\n\nclass MeasureReportGroupPopulation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The populations in the group.\n    The populations that make up the population group, one for each type of\n    population appropriate for the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupPopulation\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"initial-population | numerator | numerator-exclusion | denominator | \"\n            \"denominator-exclusion | denominator-exception | measure-population | \"\n            \"measure-population-exclusion | measure-observation\"\n        ),\n        description=\"The type of the population.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    count: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Size of the population\",\n        description=\"The number of members of the population.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    subjectResults: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectResults\",\n        title=\"For subject-list reports, the subject results in this population\",\n        description=(\n            \"This element refers to a List of subject level MeasureReport \"\n            \"resources, one for each subject in this population.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"List\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"count\",\n            \"subjectResults\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\"]\n\n\nclass MeasureReportGroupStratifier(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratification results.\n    When a measure includes multiple stratifiers, there will be a stratifier\n    group for each stratifier defined by the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupStratifier\"\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"What stratifier of the group\",\n        description=\"The meaning of this stratifier, as defined in the measure definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    stratum: typing.List[\n        fhirtypes.MeasureReportGroupStratifierStratumType\n    ] | None = Field(\n        default=None,\n        alias=\"stratum\",\n        title=(\n            \"Stratum results, one for each unique value, or set of values, in the \"\n            \"stratifier, or stratifier components\"\n        ),\n        description=(\n            \"This element contains the results for a single stratum within the \"\n            \"stratifier. For example, when stratifying on administrative gender, \"\n            \"there will be four strata, one for each possible gender value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupStratifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"stratum\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureReportGroupStratifierStratum(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratum results, one for each unique value, or set of values, in the\n    stratifier, or stratifier components.\n    This element contains the results for a single stratum within the\n    stratifier. For example, when stratifying on administrative gender, there\n    will be four strata, one for each possible gender value.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupStratifierStratum\"\n\n    component: typing.List[\n        fhirtypes.MeasureReportGroupStratifierStratumComponentType\n    ] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"Stratifier component values\",\n        description=\"A stratifier component value.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    measureScore: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"measureScore\",\n        title=\"What score this stratum achieved\",\n        description=(\n            \"The measure score for this stratum, calculated as appropriate for the \"\n            \"measure type and scoring method, and based on only the members of this\"\n            \" stratum.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    population: typing.List[\n        fhirtypes.MeasureReportGroupStratifierStratumPopulationType\n    ] | None = Field(\n        default=None,\n        alias=\"population\",\n        title=\"Population results in this stratum\",\n        description=(\n            \"The populations that make up the stratum, one for each type of \"\n            \"population appropriate to the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The stratum value, e.g. male\",\n        description=(\n            \"The value for this stratum, expressed as a CodeableConcept. When \"\n            \"defining stratifiers on complex values, the value must be rendered \"\n            \"such that the value for each stratum within the stratifier is unique.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupStratifierStratum`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"value\",\n            \"component\",\n            \"population\",\n            \"measureScore\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratum`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureReportGroupStratifierStratumComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratifier component values.\n    A stratifier component value.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupStratifierStratumComponent\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"What stratifier component of the group\",\n        description=\"The code for the stratum component value.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"value\",\n        title=\"The stratum component value, e.g. male\",\n        description=\"The stratum component value.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupStratifierStratumComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratumComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureReportGroupStratifierStratumPopulation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Population results in this stratum.\n    The populations that make up the stratum, one for each type of population\n    appropriate to the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupStratifierStratumPopulation\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"initial-population | numerator | numerator-exclusion | denominator | \"\n            \"denominator-exclusion | denominator-exception | measure-population | \"\n            \"measure-population-exclusion | measure-observation\"\n        ),\n        description=\"The type of the population.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    count: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Size of the population\",\n        description=\"The number of members of the population in this stratum.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    subjectResults: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectResults\",\n        title=\"For subject-list reports, the subject results in this population\",\n        description=(\n            \"This element refers to a List of subject level MeasureReport \"\n            \"resources, one for each subject in this population in this stratum.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"List\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupStratifierStratumPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"count\",\n            \"subjectResults\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratumPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/media.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Media\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Media(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A photo, video, or audio recording acquired or used in healthcare. The\n    actual content may be inline or provided by direct reference.\n    \"\"\"\n\n    __resource_type__ = \"Media\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Procedure that caused this media to be created\",\n        description=(\n            \"A procedure that is fulfilled in whole or in part by the creation of \"\n            \"this media.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\", \"CarePlan\"],\n        },\n    )\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Observed body part\",\n        description=(\n            \"Indicates the site on the subject's body where the observation was \"\n            \"made (i.e. the target site).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    content: fhirtypes.AttachmentType = Field(\n        default=...,\n        alias=\"content\",\n        title=\"Actual Media - reference or data\",\n        description=(\n            \"The actual content of the media - inline or by direct reference to the\"\n            \" media source file.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    createdDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"createdDateTime\",\n        title=\"When Media was collected\",\n        description=\"The date and time(s) at which the media was collected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e created[x]\n            \"one_of_many\": \"created\",\n            \"one_of_many_required\": False,\n        },\n    )\n    createdDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_createdDateTime\",\n        title=\"Extension field for ``createdDateTime``.\",\n    )\n\n    createdPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"createdPeriod\",\n        title=\"When Media was collected\",\n        description=\"The date and time(s) at which the media was collected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e created[x]\n            \"one_of_many\": \"created\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Observing Device\",\n        description=\"The device used to collect the media.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"DeviceMetric\", \"Device\"],\n        },\n    )\n\n    deviceName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"deviceName\",\n        title=\"Name of the device/manufacturer\",\n        description=(\n            \"The name of the device / manufacturer of the device  that was used to \"\n            \"make the recording.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    deviceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_deviceName\", title=\"Extension field for ``deviceName``.\"\n    )\n\n    duration: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"Length in seconds (audio / video)\",\n        description=\"The duration of the recording in seconds - for audio and video.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    duration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_duration\", title=\"Extension field for ``duration``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter associated with media\",\n        description=\"The encounter that establishes the context for this media.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    frames: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"frames\",\n        title=\"Number of frames if > 1 (photo)\",\n        description=(\n            \"The number of frames in a photo. This is used with a multi-page fax, \"\n            \"or an imaging acquisition context that takes multiple slices in a \"\n            \"single image, or an animated gif. If there is more than one frame, \"\n            \"this SHALL have a value in order to alert interface software that a \"\n            \"multi-frame capable rendering widget is required.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    frames__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_frames\", title=\"Extension field for ``frames``.\"\n    )\n\n    height: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"height\",\n        title=\"Height of the image in pixels (photo/video)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    height__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_height\", title=\"Extension field for ``height``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier(s) for the image\",\n        description=(\n            \"Identifiers associated with the image - these may include identifiers \"\n            \"for the image itself, identifiers for the context of its collection \"\n            \"(e.g. series ids) and context ids such as accession numbers or other \"\n            \"workflow identifiers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"Date/Time this version was made available\",\n        description=(\n            \"The date and time this version of the media was made available to \"\n            \"providers, typically after having been reviewed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    modality: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"modality\",\n        title=\"The type of acquisition equipment/process\",\n        description=(\n            \"Details of the type of the media - usually, how it was acquired (what \"\n            \"type of device). If images sourced from a DICOM system, are wrapped in\"\n            \" a Media resource, then this is the modality.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the media\",\n        description=(\n            \"Comments made about the media by the performer, subject or other \"\n            \"participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operator: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"operator\",\n        title=\"The person who generated the image\",\n        description=\"The person who administered the collection of the image.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=\"A larger event of which this particular event is a component or step.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why was event performed?\",\n        description=\"Describes why the event occurred in coded or textual form.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | not-done | on-hold | stopped | completed |\"\n            \" entered-in-error | unknown\"\n        ),\n        description=\"The current state of the {{title}}.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"not-done\",\n                \"on-hold\",\n                \"stopped\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who/What this Media is a record of\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Group\",\n                \"Device\",\n                \"Specimen\",\n                \"Location\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Classification of media as image, video, or audio\",\n        description=(\n            \"A code that classifies whether the media is an image, video or audio \"\n            \"recording or some other media category.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    view: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"view\",\n        title=\"Imaging view, e.g. Lateral or Antero-posterior\",\n        description=\"The name of the imaging view e.g. Lateral or Antero-posterior (AP).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    width: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"width\",\n        title=\"Width of the image in pixels (photo/video)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    width__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_width\", title=\"Extension field for ``width``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Media`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"type\",\n            \"modality\",\n            \"view\",\n            \"subject\",\n            \"encounter\",\n            \"createdDateTime\",\n            \"createdPeriod\",\n            \"issued\",\n            \"operator\",\n            \"reasonCode\",\n            \"bodySite\",\n            \"deviceName\",\n            \"device\",\n            \"height\",\n            \"width\",\n            \"frames\",\n            \"duration\",\n            \"content\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Media`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"type\",\n            \"modality\",\n            \"view\",\n            \"subject\",\n            \"encounter\",\n            \"createdDateTime\",\n            \"createdPeriod\",\n            \"issued\",\n            \"operator\",\n            \"reasonCode\",\n            \"bodySite\",\n            \"deviceName\",\n            \"device\",\n            \"height\",\n            \"width\",\n            \"frames\",\n            \"duration\",\n            \"content\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"created\": [\"createdDateTime\", \"createdPeriod\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/medication.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Medication\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Medication(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a Medication.\n    This resource is primarily used for the identification and definition of a\n    medication for the purposes of prescribing, dispensing, and administering a\n    medication as well as for making statements about medication use.\n    \"\"\"\n\n    __resource_type__ = \"Medication\"\n\n    amount: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Amount of drug in package\",\n        description=(\n            \"Specific amount of the drug in the packaged product.  For example, \"\n            \"when specifying a product that has the same strength (For example, \"\n            \"Insulin glargine 100 unit per mL solution for injection), this \"\n            \"attribute provides additional clarification of the package amount (For\"\n            \" example, 3 mL, 10mL, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    batch: fhirtypes.MedicationBatchType | None = Field(\n        default=None,\n        alias=\"batch\",\n        title=\"Details about packaged medications\",\n        description=\"Information that only applies to packages (not products).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Codes that identify this medication\",\n        description=(\n            \"A code (or set of codes) that specify this medication, or a textual \"\n            \"description if no code is available. Usage note: This could be a \"\n            \"standard medication code such as a code from RxNorm, SNOMED CT, IDMP \"\n            \"etc. It could also be a national or local formulary code, optionally \"\n            \"with translations to other code systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"powder | tablets | capsule +\",\n        description=\"Describes the form of the item.  Powder; tablets; capsule.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for this medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.MedicationIngredientType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=\"Active or inactive ingredient\",\n        description=\"Identifies a particular constituent of interest in the product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    manufacturer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Manufacturer of the item\",\n        description=(\n            \"Describes the details of the manufacturer of the medication product.  \"\n            \"This is not intended to represent the distributor of a medication \"\n            \"product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=\"A code to indicate if the medication is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Medication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"status\",\n            \"manufacturer\",\n            \"form\",\n            \"amount\",\n            \"ingredient\",\n            \"batch\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Medication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"code\",\n            \"status\",\n            \"manufacturer\",\n            \"amount\",\n        ]\n\n\nclass MedicationBatch(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details about packaged medications.\n    Information that only applies to packages (not products).\n    \"\"\"\n\n    __resource_type__ = \"MedicationBatch\"\n\n    expirationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expirationDate\",\n        title=\"When batch will expire\",\n        description=\"When this specific batch of product will expire.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_expirationDate\",\n        title=\"Extension field for ``expirationDate``.\",\n    )\n\n    lotNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lotNumber\",\n        title=\"Identifier assigned to batch\",\n        description=\"The assigned lot number of a batch of the specified product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lotNumber\", title=\"Extension field for ``lotNumber``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationBatch`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"lotNumber\", \"expirationDate\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationBatch`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationIngredient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Active or inactive ingredient.\n    Identifies a particular constituent of interest in the product.\n    \"\"\"\n\n    __resource_type__ = \"MedicationIngredient\"\n\n    isActive: bool | None = Field(\n        default=None,\n        alias=\"isActive\",\n        title=\"Active ingredient indicator\",\n        description=(\n            \"Indication of whether this ingredient affects the therapeutic action \"\n            \"of the drug.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    isActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isActive\", title=\"Extension field for ``isActive``.\"\n    )\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"The actual ingredient or content\",\n        description=(\n            \"The actual ingredient - either a substance (simple ingredient) or \"\n            \"another medication of a medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"The actual ingredient or content\",\n        description=(\n            \"The actual ingredient - either a substance (simple ingredient) or \"\n            \"another medication of a medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\", \"Medication\"],\n        },\n    )\n\n    strength: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"strength\",\n        title=\"Quantity of ingredient present\",\n        description=(\n            \"Specifies how many (or how much) of the items there are in this \"\n            \"Medication.  For example, 250 mg per tablet.  This is expressed as a \"\n            \"ratio where the numerator is 250mg and the denominator is 1 tablet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n            \"isActive\",\n            \"strength\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/medicationadministration.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationAdministration\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicationAdministration(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Administration of medication to a patient.\n    Describes the event of a patient consuming or otherwise being administered\n    a medication.  This may be as simple as swallowing a tablet or it may be a\n    long running infusion.  Related resources tie this event to the authorizing\n    prescription, and the specific encounter between patient and health care\n    practitioner.\n    \"\"\"\n\n    __resource_type__ = \"MedicationAdministration\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of medication usage\",\n        description=(\n            \"Indicates where the medication is expected to be consumed or \"\n            \"administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or Episode of Care administered as part of\",\n        description=(\n            \"The visit, admission, or other contact between patient and health care\"\n            \" provider during which the medication administration was performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    device: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Device used to administer\",\n        description=(\n            \"The device used in administering the medication to the patient.  For \"\n            \"example, a particular infusion pump.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    dosage: fhirtypes.MedicationAdministrationDosageType | None = Field(\n        default=None,\n        alias=\"dosage\",\n        title=\"Details of how medication was taken\",\n        description=(\n            \"Describes the medication dosage information details e.g. dose, rate, \"\n            \"site, route, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"Start and end time of administration\",\n        description=(\n            \"A specific date/time or interval of time during which the \"\n            \"administration took place (or did not take place, when the 'notGiven' \"\n            \"attribute is true). For many administrations, such as swallowing a \"\n            \"tablet the use of dateTime is more appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": True,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"Start and end time of administration\",\n        description=(\n            \"A specific date/time or interval of time during which the \"\n            \"administration took place (or did not take place, when the 'notGiven' \"\n            \"attribute is true). For many administrations, such as swallowing a \"\n            \"tablet the use of dateTime is more appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"eventHistory\",\n        title=\"A list of events of interest in the lifecycle\",\n        description=(\n            \"A summary of the events of interest that have occurred, such as when \"\n            \"the administration was verified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifiers associated with this Medication Administration that are \"\n            \"defined by business processes and/or used to refer to it when a direct\"\n            \" URL reference to the resource itself is not appropriate. They are \"\n            \"business identifiers assigned to this resource by the performer or \"\n            \"other systems and remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instantiates: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiates\",\n        title=\"Instantiates protocol or definition\",\n        description=(\n            \"A protocol, guideline, orderset, or other definition that was adhered \"\n            \"to in whole or in part by this event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiates__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiates\",\n        title=\"Extension field for ``instantiates``.\",\n    )\n\n    medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"medicationCodeableConcept\",\n        title=\"What was administered\",\n        description=(\n            \"Identifies the medication that was administered. This is either a link\"\n            \" to a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    medicationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"medicationReference\",\n        title=\"What was administered\",\n        description=(\n            \"Identifies the medication that was administered. This is either a link\"\n            \" to a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Information about the administration\",\n        description=(\n            \"Extra information about the medication administration that is not \"\n            \"conveyed by the other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=\"A larger event of which this particular event is a component or step.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationAdministration\", \"Procedure\"],\n        },\n    )\n\n    performer: typing.List[\n        fhirtypes.MedicationAdministrationPerformerType\n    ] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed the medication administration and what they did\",\n        description=(\n            \"Indicates who or what performed the medication administration and how \"\n            \"they were involved.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Reason administration performed\",\n        description=\"A code indicating why the medication was given.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=(\n            \"Condition or observation that supports why the medication was \"\n            \"administered\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\", \"DiagnosticReport\"],\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Request administration performed against\",\n        description=(\n            \"The original request, instruction or authority to perform the \"\n            \"administration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"in-progress | not-done | on-hold | completed | entered-in-error | \"\n            \"stopped | unknown\"\n        ),\n        description=(\n            \"Will generally be set to show that the administration has been \"\n            \"completed.  For some long running administrations such as infusions, \"\n            \"it is possible for an administration to be started but not completed \"\n            \"or it may be paused while some other process is under way.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"in-progress\",\n                \"not-done\",\n                \"on-hold\",\n                \"completed\",\n                \"entered-in-error\",\n                \"stopped\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason administration not performed\",\n        description=\"A code indicating why the administration was not performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who received medication\",\n        description=\"The person or animal or group receiving the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Additional information to support administration\",\n        description=(\n            \"Additional information (for example, patient height and weight) that \"\n            \"supports the administration of the medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiates\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"category\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"context\",\n            \"supportingInformation\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"performer\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"request\",\n            \"device\",\n            \"note\",\n            \"dosage\",\n            \"eventHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"instantiates\",\n            \"partOf\",\n            \"status\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"performer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"effective\": [\"effectiveDateTime\", \"effectivePeriod\"],\n            \"medication\": [\"medicationCodeableConcept\", \"medicationReference\"],\n        }\n        return one_of_many_fields\n\n\nclass MedicationAdministrationDosage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of how medication was taken.\n    Describes the medication dosage information details e.g. dose, rate, site,\n    route, etc.\n    \"\"\"\n\n    __resource_type__ = \"MedicationAdministrationDosage\"\n\n    dose: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"dose\",\n        title=\"Amount of medication per dose\",\n        description=(\n            \"The amount of the medication given at one administration event.   Use \"\n            \"this value when the administration is essentially an instantaneous \"\n            \"event such as a swallowing a tablet or giving an injection.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"How drug was administered\",\n        description=(\n            \"A coded value indicating the method by which the medication is \"\n            \"intended to be or was introduced into or on the body.  This attribute \"\n            \"will most often NOT be populated.  It is most commonly used for \"\n            \"injections.  For example, Slow Push, Deep IV.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rateQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"rateQuantity\",\n        title=\"Dose quantity per unit of time\",\n        description=(\n            \"Identifies the speed with which the medication was or will be \"\n            \"introduced into the patient.  Typically, the rate for an infusion e.g.\"\n            \" 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per \"\n            \"unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min \"\n            \"or 200 mcg/1 minute; 1 liter/8 hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"rateRatio\",\n        title=\"Dose quantity per unit of time\",\n        description=(\n            \"Identifies the speed with which the medication was or will be \"\n            \"introduced into the patient.  Typically, the rate for an infusion e.g.\"\n            \" 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per \"\n            \"unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min \"\n            \"or 200 mcg/1 minute; 1 liter/8 hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    route: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"route\",\n        title=\"Path of substance into body\",\n        description=(\n            \"A code specifying the route or physiological path of administration of\"\n            \" a therapeutic agent into or onto the patient.  For example, topical, \"\n            \"intravenous, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    site: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Body site administered to\",\n        description=(\n            \"A coded specification of the anatomic site where the medication first \"\n            'entered the body.  For example, \"left arm\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Free text dosage instructions e.g. SIG\",\n        description=(\n            \"Free text dosage can be used for cases where the dosage administered \"\n            \"is too complex to code. When coded dosage is present, the free text \"\n            \"dosage may still be present for display to humans.  The dosage \"\n            \"instructions should reflect the dosage of the medication that was \"\n            \"administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationAdministrationDosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"text\",\n            \"site\",\n            \"route\",\n            \"method\",\n            \"dose\",\n            \"rateRatio\",\n            \"rateQuantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationAdministrationDosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"rate\": [\"rateQuantity\", \"rateRatio\"]}\n        return one_of_many_fields\n\n\nclass MedicationAdministrationPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed the medication administration and what they did.\n    Indicates who or what performed the medication administration and how they\n    were involved.\n    \"\"\"\n\n    __resource_type__ = \"MedicationAdministrationPerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Who performed the medication administration\",\n        description=\"Indicates who or what performed the medication administration.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of performance\",\n        description=(\n            \"Distinguishes the type of involvement of the performer in the \"\n            \"medication administration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationAdministrationPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationAdministrationPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"actor\"]\n"
  },
  {
    "path": "fhir/resources/R4B/medicationdispense.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationDispense\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicationDispense(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dispensing a medication to a named patient.\n    Indicates that a medication product is to be or has been dispensed for a\n    named person/patient.  This includes a description of the medication\n    product (supply) provided and the instructions for administering the\n    medication.  The medication dispense is the result of a pharmacy system\n    responding to a medication order.\n    \"\"\"\n\n    __resource_type__ = \"MedicationDispense\"\n\n    authorizingPrescription: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"authorizingPrescription\",\n        title=\"Medication order that authorizes the dispense\",\n        description=\"Indicates the medication order that is being dispensed against.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of medication dispense\",\n        description=(\n            \"Indicates the type of medication dispense (for example, where the \"\n            \"medication is expected to be consumed or administered (i.e. inpatient \"\n            \"or outpatient)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter / Episode associated with event\",\n        description=(\n            \"The encounter or episode of care that establishes the context for this\"\n            \" event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    daysSupply: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"daysSupply\",\n        title=\"Amount of medication expressed as a timing amount\",\n        description=\"The amount of medication expressed as a timing amount.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    destination: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Where the medication was sent\",\n        description=(\n            \"Identification of the facility/location where the medication was \"\n            \"shipped to, as part of the dispense event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    detectedIssue: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"detectedIssue\",\n        title=\"Clinical issue with action\",\n        description=(\n            \"Indicates an actual or potential clinical issue with or between one or\"\n            \" more active or proposed clinical actions for a patient; e.g. drug-\"\n            \"drug interaction, duplicate therapy, dosage alert etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DetectedIssue\"],\n        },\n    )\n\n    dosageInstruction: typing.List[fhirtypes.DosageType] | None = Field(\n        default=None,\n        alias=\"dosageInstruction\",\n        title=(\n            \"How the medication is to be used by the patient or administered by the\"\n            \" caregiver\"\n        ),\n        description=\"Indicates how the medication is to be used by the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"eventHistory\",\n        title=\"A list of relevant lifecycle events\",\n        description=(\n            \"A summary of the events of interest that have occurred, such as when \"\n            \"the dispense was verified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifiers associated with this Medication Dispense that are defined \"\n            \"by business processes and/or used to refer to it when a direct URL \"\n            \"reference to the resource itself is not appropriate. They are business\"\n            \" identifiers assigned to this resource by the performer or other \"\n            \"systems and remain constant as the resource is updated and propagates \"\n            \"from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the dispense occurred\",\n        description=\"The principal physical location where the dispense was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"medicationCodeableConcept\",\n        title=\"What medication was supplied\",\n        description=(\n            \"Identifies the medication being administered. This is either a link to\"\n            \" a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    medicationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"medicationReference\",\n        title=\"What medication was supplied\",\n        description=(\n            \"Identifies the medication being administered. This is either a link to\"\n            \" a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Information about the dispense\",\n        description=(\n            \"Extra information about the dispense that could not be conveyed in the\"\n            \" other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Event that dispense is part of\",\n        description=\"The procedure that trigger the dispense.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.MedicationDispensePerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed event\",\n        description=\"Indicates who or what performed the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount dispensed\",\n        description=(\n            \"The amount of medication that has been dispensed. Includes unit of \"\n            \"measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    receiver: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"receiver\",\n        title=\"Who collected the medication\",\n        description=(\n            \"Identifies the person who picked up the medication.  This will usually\"\n            \" be a patient or their caregiver, but some cases exist where it can be\"\n            \" a healthcare professional.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | cancelled | on-hold | completed | entered-\"\n            \"in-error | stopped | declined | unknown\"\n        ),\n        description=\"A code specifying the state of the set of dispense events.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"cancelled\",\n                \"on-hold\",\n                \"completed\",\n                \"entered-in-error\",\n                \"stopped\",\n                \"declined\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReasonCodeableConcept\",\n        title=\"Why a dispense was not performed\",\n        description=\"Indicates the reason why a dispense was not performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e statusReason[x]\n            \"one_of_many\": \"statusReason\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    statusReasonReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"statusReasonReference\",\n        title=\"Why a dispense was not performed\",\n        description=\"Indicates the reason why a dispense was not performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e statusReason[x]\n            \"one_of_many\": \"statusReason\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DetectedIssue\"],\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who the dispense is for\",\n        description=(\n            \"A link to a resource representing the person or the group to whom the \"\n            \"medication will be given.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    substitution: fhirtypes.MedicationDispenseSubstitutionType | None = Field(\n        default=None,\n        alias=\"substitution\",\n        title=\"Whether a substitution was performed on the dispense\",\n        description=(\n            \"Indicates whether or not substitution was made as part of the \"\n            \"dispense.  In some cases, substitution will be expected but does not \"\n            \"happen, in other cases substitution is not expected but does happen.  \"\n            \"This block explains what substitution did or did not happen and why.  \"\n            \"If nothing is specified, substitution was not done.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Information that supports the dispensing of the medication\",\n        description=\"Additional information that supports the medication being dispensed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Trial fill, partial fill, emergency fill, etc.\",\n        description=(\n            \"Indicates the type of dispensing event that is performed. For example,\"\n            \" Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, \"\n            \"Samples, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    whenHandedOver: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenHandedOver\",\n        title=\"When product was given out\",\n        description=(\n            \"The time the dispensed product was provided to the patient or their \"\n            \"representative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    whenHandedOver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenHandedOver\",\n        title=\"Extension field for ``whenHandedOver``.\",\n    )\n\n    whenPrepared: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenPrepared\",\n        title=\"When product was packaged and reviewed\",\n        description=\"The time when the dispensed product was packaged and reviewed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    whenPrepared__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenPrepared\",\n        title=\"Extension field for ``whenPrepared``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"partOf\",\n            \"status\",\n            \"statusReasonCodeableConcept\",\n            \"statusReasonReference\",\n            \"category\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"context\",\n            \"supportingInformation\",\n            \"performer\",\n            \"location\",\n            \"authorizingPrescription\",\n            \"type\",\n            \"quantity\",\n            \"daysSupply\",\n            \"whenPrepared\",\n            \"whenHandedOver\",\n            \"destination\",\n            \"receiver\",\n            \"note\",\n            \"dosageInstruction\",\n            \"substitution\",\n            \"detectedIssue\",\n            \"eventHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"whenPrepared\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"medication\": [\"medicationCodeableConcept\", \"medicationReference\"],\n            \"statusReason\": [\"statusReasonCodeableConcept\", \"statusReasonReference\"],\n        }\n        return one_of_many_fields\n\n\nclass MedicationDispensePerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed event.\n    Indicates who or what performed the event.\n    \"\"\"\n\n    __resource_type__ = \"MedicationDispensePerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual who was performing\",\n        description=(\n            \"The device, practitioner, etc. who performed the action.  It should be\"\n            \" assumed that the actor is the dispenser of the medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Who performed the dispense and what they did\",\n        description=(\n            \"Distinguishes the type of performer in the dispense.  For example, \"\n            \"date enterer, packager, final checker.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationDispensePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationDispensePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationDispenseSubstitution(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Whether a substitution was performed on the dispense.\n    Indicates whether or not substitution was made as part of the dispense.  In\n    some cases, substitution will be expected but does not happen, in other\n    cases substitution is not expected but does happen.  This block explains\n    what substitution did or did not happen and why.  If nothing is specified,\n    substitution was not done.\n    \"\"\"\n\n    __resource_type__ = \"MedicationDispenseSubstitution\"\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why was substitution made\",\n        description=(\n            \"Indicates the reason for the substitution (or lack of substitution) \"\n            \"from what was prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    responsibleParty: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"responsibleParty\",\n        title=\"Who is responsible for the substitution\",\n        description=(\n            \"The person or organization that has primary responsibility for the \"\n            \"substitution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Code signifying whether a different drug was dispensed from what was \"\n            \"prescribed\"\n        ),\n        description=(\n            \"A code signifying whether a different drug was dispensed from what was\"\n            \" prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    wasSubstituted: bool | None = Field(\n        default=None,\n        alias=\"wasSubstituted\",\n        title=\"Whether a substitution was or was not performed on the dispense\",\n        description=(\n            \"True if the dispenser dispensed a different drug or product from what \"\n            \"was prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    wasSubstituted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_wasSubstituted\",\n        title=\"Extension field for ``wasSubstituted``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationDispenseSubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"wasSubstituted\",\n            \"type\",\n            \"reason\",\n            \"responsibleParty\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationDispenseSubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"wasSubstituted\", \"wasSubstituted__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/medicationknowledge.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationKnowledge\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicationKnowledge(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of Medication Knowledge.\n    Information about a medication that is used to support knowledge.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledge\"\n\n    administrationGuidelines: typing.List[\n        fhirtypes.MedicationKnowledgeAdministrationGuidelinesType\n    ] | None = Field(\n        default=None,\n        alias=\"administrationGuidelines\",\n        title=\"Guidelines for administration of the medication\",\n        description=\"Guidelines for the administration of the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    amount: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Amount of drug in package\",\n        description=(\n            \"Specific amount of the drug in the packaged product.  For example, \"\n            \"when specifying a product that has the same strength (For example, \"\n            \"Insulin glargine 100 unit per mL solution for injection), this \"\n            \"attribute provides additional clarification of the package amount (For\"\n            \" example, 3 mL, 10mL, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    associatedMedication: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"associatedMedication\",\n        title=\"A medication resource that is associated with this medication\",\n        description=(\n            \"Associated or related medications.  For example, if the medication is \"\n            \"a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g.\"\n            \" Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin),\"\n            \" this would link to a branded product (e.g. Crestor).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies this medication\",\n        description=(\n            \"A code that specifies this medication, or a textual description if no \"\n            \"code is available. Usage note: This could be a standard medication \"\n            \"code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be\"\n            \" a national or local formulary code, optionally with translations to \"\n            \"other code systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contraindication: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"contraindication\",\n        title=\"Potential clinical issue with or between medication(s)\",\n        description=(\n            \"Potential clinical issue with or between medication(s) (for example, \"\n            \"drug-drug interaction, drug-disease contraindication, drug-allergy \"\n            \"interaction, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DetectedIssue\"],\n        },\n    )\n\n    cost: typing.List[fhirtypes.MedicationKnowledgeCostType] | None = Field(\n        default=None,\n        alias=\"cost\",\n        title=\"The pricing of the medication\",\n        description=\"The price of the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    doseForm: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"doseForm\",\n        title=\"powder | tablets | capsule +\",\n        description=\"Describes the form of the item.  Powder; tablets; capsule.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    drugCharacteristic: typing.List[\n        fhirtypes.MedicationKnowledgeDrugCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"drugCharacteristic\",\n        title=\"Specifies descriptive properties of the medicine\",\n        description=(\n            \"Specifies descriptive properties of the medicine, such as color, \"\n            \"shape, imprints, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.MedicationKnowledgeIngredientType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=\"Active or inactive ingredient\",\n        description=\"Identifies a particular constituent of interest in the product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    intendedRoute: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"intendedRoute\",\n        title=\"The intended or approved route of administration\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    kinetics: typing.List[fhirtypes.MedicationKnowledgeKineticsType] | None = Field(\n        default=None,\n        alias=\"kinetics\",\n        title=(\n            \"The time course of drug absorption, distribution, metabolism and \"\n            \"excretion of a medication from the body\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    manufacturer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Manufacturer of the item\",\n        description=(\n            \"Describes the details of the manufacturer of the medication product.  \"\n            \"This is not intended to represent the distributor of a medication \"\n            \"product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    medicineClassification: typing.List[\n        fhirtypes.MedicationKnowledgeMedicineClassificationType\n    ] | None = Field(\n        default=None,\n        alias=\"medicineClassification\",\n        title=(\n            \"Categorization of the medication within a formulary or classification \"\n            \"system\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    monitoringProgram: typing.List[\n        fhirtypes.MedicationKnowledgeMonitoringProgramType\n    ] | None = Field(\n        default=None,\n        alias=\"monitoringProgram\",\n        title=\"Program under which a medication is reviewed\",\n        description=\"The program under which the medication is reviewed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    monograph: typing.List[fhirtypes.MedicationKnowledgeMonographType] | None = Field(\n        default=None,\n        alias=\"monograph\",\n        title=\"Associated documentation about the medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    packaging: fhirtypes.MedicationKnowledgePackagingType | None = Field(\n        default=None,\n        alias=\"packaging\",\n        title=\"Details about packaged medications\",\n        description=\"Information that only applies to packages (not products).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preparationInstruction: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"preparationInstruction\",\n        title=\"The instructions for preparing the medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preparationInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_preparationInstruction\",\n        title=\"Extension field for ``preparationInstruction``.\",\n    )\n\n    productType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"productType\",\n        title=\"Category of the medication or product\",\n        description=(\n            \"Category of the medication or product (e.g. branded product, \"\n            \"therapeutic moeity, generic product, innovator product, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    regulatory: typing.List[fhirtypes.MedicationKnowledgeRegulatoryType] | None = Field(\n        default=None,\n        alias=\"regulatory\",\n        title=\"Regulatory information about a medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedMedicationKnowledge: typing.List[\n        fhirtypes.MedicationKnowledgeRelatedMedicationKnowledgeType\n    ] | None = Field(\n        default=None,\n        alias=\"relatedMedicationKnowledge\",\n        title=\"Associated or related medication information\",\n        description=\"Associated or related knowledge about a medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=(\n            \"A code to indicate if the medication is in active use.  The status \"\n            \"refers to the validity about the information of the medication and not\"\n            \" to its medicinal properties.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    synonym: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"synonym\",\n        title=\"Additional names for a medication\",\n        description=(\n            \"Additional names for a medication, for example, the name(s) given to a\"\n            \" medication in different countries.  For example, acetaminophen and \"\n            \"paracetamol or salbutamol and albuterol.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    synonym__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_synonym\", title=\"Extension field for ``synonym``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledge`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"status\",\n            \"manufacturer\",\n            \"doseForm\",\n            \"amount\",\n            \"synonym\",\n            \"relatedMedicationKnowledge\",\n            \"associatedMedication\",\n            \"productType\",\n            \"monograph\",\n            \"ingredient\",\n            \"preparationInstruction\",\n            \"intendedRoute\",\n            \"cost\",\n            \"monitoringProgram\",\n            \"administrationGuidelines\",\n            \"medicineClassification\",\n            \"packaging\",\n            \"drugCharacteristic\",\n            \"contraindication\",\n            \"regulatory\",\n            \"kinetics\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledge`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"code\",\n            \"status\",\n            \"manufacturer\",\n            \"amount\",\n            \"synonym\",\n        ]\n\n\nclass MedicationKnowledgeAdministrationGuidelines(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Guidelines for administration of the medication.\n    Guidelines for the administration of the medication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeAdministrationGuidelines\"\n\n    dosage: typing.List[\n        fhirtypes.MedicationKnowledgeAdministrationGuidelinesDosageType\n    ] | None = Field(\n        default=None,\n        alias=\"dosage\",\n        title=\"Dosage for the medication for the specific guidelines\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    indicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"indicationCodeableConcept\",\n        title=(\n            \"Indication for use that apply to the specific administration \" \"guidelines\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e indication[x]\n            \"one_of_many\": \"indication\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    indicationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"indicationReference\",\n        title=(\n            \"Indication for use that apply to the specific administration \" \"guidelines\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e indication[x]\n            \"one_of_many\": \"indication\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    patientCharacteristics: typing.List[\n        fhirtypes.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsType\n    ] | None = Field(\n        default=None,\n        alias=\"patientCharacteristics\",\n        title=(\n            \"Characteristics of the patient that are relevant to the administration\"\n            \" guidelines\"\n        ),\n        description=(\n            \"Characteristics of the patient that are relevant to the administration\"\n            \" guidelines (for example, height, weight, gender, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeAdministrationGuidelines`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"dosage\",\n            \"indicationCodeableConcept\",\n            \"indicationReference\",\n            \"patientCharacteristics\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeAdministrationGuidelines`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"indication\": [\"indicationCodeableConcept\", \"indicationReference\"]\n        }\n        return one_of_many_fields\n\n\nclass MedicationKnowledgeAdministrationGuidelinesDosage(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dosage for the medication for the specific guidelines.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeAdministrationGuidelinesDosage\"\n\n    dosage: typing.List[fhirtypes.DosageType] = Field(\n        default=...,\n        alias=\"dosage\",\n        title=\"Dosage for the medication for the specific guidelines\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of dosage\",\n        description=(\n            \"The type of dosage (for example, prophylaxis, maintenance, \"\n            \"therapeutic, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeAdministrationGuidelinesDosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"dosage\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeAdministrationGuidelinesDosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Characteristics of the patient that are relevant to the administration\n    guidelines.\n    Characteristics of the patient that are relevant to the administration\n    guidelines (for example, height, weight, gender, etc.).\n    \"\"\"\n\n    __resource_type__ = (\n        \"MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics\"\n    )\n\n    characteristicCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"characteristicCodeableConcept\",\n        title=(\n            \"Specific characteristic that is relevant to the administration \"\n            \"guideline\"\n        ),\n        description=(\n            \"Specific characteristic that is relevant to the administration \"\n            \"guideline (e.g. height, weight, gender).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e characteristic[x]\n            \"one_of_many\": \"characteristic\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    characteristicQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"characteristicQuantity\",\n        title=(\n            \"Specific characteristic that is relevant to the administration \"\n            \"guideline\"\n        ),\n        description=(\n            \"Specific characteristic that is relevant to the administration \"\n            \"guideline (e.g. height, weight, gender).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e characteristic[x]\n            \"one_of_many\": \"characteristic\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    value: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The specific characteristic\",\n        description=\"The specific characteristic (e.g. height, weight, gender, etc.).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"characteristicCodeableConcept\",\n            \"characteristicQuantity\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"characteristic\": [\n                \"characteristicCodeableConcept\",\n                \"characteristicQuantity\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass MedicationKnowledgeCost(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The pricing of the medication.\n    The price of the medication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeCost\"\n\n    cost: fhirtypes.MoneyType = Field(\n        default=...,\n        alias=\"cost\",\n        title=\"The price of the medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    source: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"The source or owner for the price information\",\n        description=\"The source or owner that assigns the price to the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"The category of the cost information\",\n        description=(\n            \"The category of the cost information.  For example, manufacturers' \"\n            \"cost, patient cost, claim reimbursement cost, actual acquisition cost.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"source\", \"cost\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeDrugCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifies descriptive properties of the medicine.\n    Specifies descriptive properties of the medicine, such as color, shape,\n    imprints, etc.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeDrugCharacteristic\"\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Code specifying the type of characteristic of medication\",\n        description=(\n            \"A code specifying which characteristic of the medicine is being \"\n            \"described (for example, colour, shape, imprint).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Description of the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Description of the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Description of the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Description of the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeDrugCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueQuantity\",\n            \"valueBase64Binary\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeDrugCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBase64Binary\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass MedicationKnowledgeIngredient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Active or inactive ingredient.\n    Identifies a particular constituent of interest in the product.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeIngredient\"\n\n    isActive: bool | None = Field(\n        default=None,\n        alias=\"isActive\",\n        title=\"Active ingredient indicator\",\n        description=(\n            \"Indication of whether this ingredient affects the therapeutic action \"\n            \"of the drug.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    isActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isActive\", title=\"Extension field for ``isActive``.\"\n    )\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"Medication(s) or substance(s) contained in the medication\",\n        description=(\n            \"The actual ingredient - either a substance (simple ingredient) or \"\n            \"another medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"Medication(s) or substance(s) contained in the medication\",\n        description=(\n            \"The actual ingredient - either a substance (simple ingredient) or \"\n            \"another medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    strength: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"strength\",\n        title=\"Quantity of ingredient present\",\n        description=(\n            \"Specifies how many (or how much) of the items there are in this \"\n            \"Medication.  For example, 250 mg per tablet.  This is expressed as a \"\n            \"ratio where the numerator is 250mg and the denominator is 1 tablet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n            \"isActive\",\n            \"strength\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n\n\nclass MedicationKnowledgeKinetics(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The time course of drug absorption, distribution, metabolism and excretion\n    of a medication from the body.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeKinetics\"\n\n    areaUnderCurve: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"areaUnderCurve\",\n        title=\"The drug concentration measured at certain discrete points in time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    halfLifePeriod: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"halfLifePeriod\",\n        title=\"Time required for concentration in the body to decrease by half\",\n        description=(\n            \"The time required for any specified property (e.g., the concentration \"\n            \"of a substance in the body) to decrease by half.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lethalDose50: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"lethalDose50\",\n        title=\"The median lethal dose of a drug\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeKinetics`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"areaUnderCurve\",\n            \"lethalDose50\",\n            \"halfLifePeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeKinetics`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeMedicineClassification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Categorization of the medication within a formulary or classification\n    system.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeMedicineClassification\"\n\n    classification: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=\"Specific category assigned to the medication\",\n        description=(\n            \"Specific category assigned to the medication (e.g. anti-infective, \"\n            \"anti-hypertensive, antibiotic, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=(\n            \"The type of category for the medication (for example, therapeutic \"\n            \"classification, therapeutic sub-classification)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeMedicineClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"classification\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeMedicineClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeMonitoringProgram(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Program under which a medication is reviewed.\n    The program under which the medication is reviewed.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeMonitoringProgram\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the reviewing program\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of program under which the medication is monitored\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeMonitoringProgram`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"name\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeMonitoringProgram`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeMonograph(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Associated documentation about the medication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeMonograph\"\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Associated documentation about the medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\", \"Media\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The category of medication document\",\n        description=(\n            \"The category of documentation about the medication. (e.g. professional\"\n            \" monograph, patient education monograph).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeMonograph`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"source\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeMonograph`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgePackaging(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details about packaged medications.\n    Information that only applies to packages (not products).\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgePackaging\"\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"The number of product units the package would contain if fully loaded\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"A code that defines the specific type of packaging that the medication\"\n            \" can be found in\"\n        ),\n        description=(\n            \"A code that defines the specific type of packaging that the medication\"\n            \" can be found in (e.g. blister sleeve, tube, bottle).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgePackaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"quantity\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgePackaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeRegulatory(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Regulatory information about a medication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeRegulatory\"\n\n    maxDispense: fhirtypes.MedicationKnowledgeRegulatoryMaxDispenseType | None = Field(\n        default=None,\n        alias=\"maxDispense\",\n        title=(\n            \"The maximum number of units of the medication that can be dispensed in\"\n            \" a period\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    regulatoryAuthority: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"regulatoryAuthority\",\n        title=\"Specifies the authority of the regulation\",\n        description=\"The authority that is specifying the regulations.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    schedule: typing.List[\n        fhirtypes.MedicationKnowledgeRegulatoryScheduleType\n    ] | None = Field(\n        default=None,\n        alias=\"schedule\",\n        title=\"Specifies the schedule of a medication in jurisdiction\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    substitution: typing.List[\n        fhirtypes.MedicationKnowledgeRegulatorySubstitutionType\n    ] | None = Field(\n        default=None,\n        alias=\"substitution\",\n        title=(\n            \"Specifies if changes are allowed when dispensing a medication from a \"\n            \"regulatory perspective\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeRegulatory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"regulatoryAuthority\",\n            \"substitution\",\n            \"schedule\",\n            \"maxDispense\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeRegulatoryMaxDispense(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The maximum number of units of the medication that can be dispensed in a\n    period.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeRegulatoryMaxDispense\"\n\n    period: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"The period that applies to the maximum number of units\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"quantity\",\n        title=\"The maximum number of units of the medication that can be dispensed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeRegulatoryMaxDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"quantity\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatoryMaxDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeRegulatorySchedule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifies the schedule of a medication in jurisdiction.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeRegulatorySchedule\"\n\n    schedule: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"schedule\",\n        title=\"Specifies the specific drug schedule\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeRegulatorySchedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"schedule\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatorySchedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeRegulatorySubstitution(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifies if changes are allowed when dispensing a medication from a\n    regulatory perspective.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeRegulatorySubstitution\"\n\n    allowed: bool | None = Field(\n        default=None,\n        alias=\"allowed\",\n        title=(\n            \"Specifies if regulation allows for changes in the medication when \"\n            \"dispensing\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    allowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_allowed\", title=\"Extension field for ``allowed``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Specifies the type of substitution allowed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeRegulatorySubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"allowed\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatorySubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"allowed\", \"allowed__ext\")]\n        return required_fields\n\n\nclass MedicationKnowledgeRelatedMedicationKnowledge(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Associated or related medication information.\n    Associated or related knowledge about a medication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeRelatedMedicationKnowledge\"\n\n    reference: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Associated documentation about the associated medication knowledge\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationKnowledge\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Category of medicationKnowledge\",\n        description=\"The category of the associated medication knowledge reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeRelatedMedicationKnowledge`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRelatedMedicationKnowledge`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/medicationrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicationRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Ordering of medication for patient or group.\n    An order or request for both supply of the medication and the instructions\n    for administration of the medication to a patient. The resource is called\n    \"MedicationRequest\" rather than \"MedicationPrescription\" or\n    \"MedicationOrder\" to generalize the use across inpatient and outpatient\n    settings, including care plans, etc., and to harmonize with workflow\n    patterns.\n    \"\"\"\n\n    __resource_type__ = \"MedicationRequest\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When request was initially authored\",\n        description=(\n            \"The date (and perhaps time) when the prescription was initially \"\n            \"written or authored on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What request fulfills\",\n        description=(\n            \"A plan or request that is fulfilled in whole or in part by this \"\n            \"medication request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"MedicationRequest\",\n                \"ServiceRequest\",\n                \"ImmunizationRecommendation\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of medication usage\",\n        description=(\n            \"Indicates the type of medication request (for example, where the \"\n            \"medication is expected to be consumed or administered (i.e. inpatient \"\n            \"or outpatient)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    courseOfTherapyType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"courseOfTherapyType\",\n        title=\"Overall pattern of medication administration\",\n        description=(\n            \"The description of the overall patte3rn of the administration of the \"\n            \"medication to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detectedIssue: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"detectedIssue\",\n        title=\"Clinical Issue with action\",\n        description=(\n            \"Indicates an actual or potential clinical issue with or between one or\"\n            \" more active or proposed clinical actions for a patient; e.g. Drug-\"\n            \"drug interaction, duplicate therapy, dosage alert etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DetectedIssue\"],\n        },\n    )\n\n    dispenseRequest: fhirtypes.MedicationRequestDispenseRequestType | None = Field(\n        default=None,\n        alias=\"dispenseRequest\",\n        title=\"Medication supply authorization\",\n        description=(\n            \"Indicates the specific details for the dispense or medication supply \"\n            \"part of a medication request (also known as a Medication Prescription \"\n            \"or Medication Order).  Note that this information is not always sent \"\n            \"with the order.  There may be in some settings (e.g. hospitals) \"\n            \"institutional or system support for completing the dispense details in\"\n            \" the pharmacy department.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"True if request is prohibiting action\",\n        description=(\n            \"If true indicates that the provider is asking for the medication \"\n            \"request not to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    dosageInstruction: typing.List[fhirtypes.DosageType] | None = Field(\n        default=None,\n        alias=\"dosageInstruction\",\n        title=\"How the medication should be taken\",\n        description=\"Indicates how the medication is to be used by the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter created as part of encounter/admission/stay\",\n        description=(\n            \"The Encounter during which this [x] was created or to which the \"\n            \"creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"eventHistory\",\n        title=\"A list of events of interest in the lifecycle\",\n        description=(\n            \"Links to Provenance records for past versions of this resource or \"\n            \"fulfilling request or event resources that identify key state \"\n            \"transitions or updates that are likely to be relevant to a user \"\n            \"looking at the current version of the resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Composite request this is part of\",\n        description=(\n            \"A shared identifier common to all requests that were authorized more \"\n            \"or less simultaneously by a single author, representing the identifier\"\n            \" of the requisition or prescription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External ids for this request\",\n        description=(\n            \"Identifiers associated with this medication request that are defined \"\n            \"by business processes and/or used to refer to it when a direct URL \"\n            \"reference to the resource itself is not appropriate. They are business\"\n            \" identifiers assigned to this resource by the performer or other \"\n            \"systems and remain constant as the resource is updated and propagates \"\n            \"from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a protocol, guideline, orderset, or other \"\n            \"definition that is adhered to in whole or in part by this \"\n            \"MedicationRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this MedicationRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    insurance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Associated insurance coverage\",\n        description=(\n            \"Insurance plans, coverage extensions, pre-authorizations and/or pre-\"\n            \"determinations that may be required for delivering the requested \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\", \"ClaimResponse\"],\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"proposal | plan | order | original-order | reflex-order | filler-order\"\n            \" | instance-order | option\"\n        ),\n        description=\"Whether the request is a proposal, plan, or an original order.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposal\",\n                \"plan\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"medicationCodeableConcept\",\n        title=\"Medication to be taken\",\n        description=(\n            \"Identifies the medication being requested. This is a link to a \"\n            \"resource that represents the medication which may be the details of \"\n            \"the medication or simply an attribute carrying a code that identifies \"\n            \"the medication from a known list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    medicationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"medicationReference\",\n        title=\"Medication to be taken\",\n        description=(\n            \"Identifies the medication being requested. This is a link to a \"\n            \"resource that represents the medication which may be the details of \"\n            \"the medication or simply an attribute carrying a code that identifies \"\n            \"the medication from a known list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Information about the prescription\",\n        description=(\n            \"Extra information about the prescription that could not be conveyed by\"\n            \" the other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Intended performer of administration\",\n        description=(\n            \"The specified desired performer of the medication treatment (e.g. the \"\n            \"performer of the medication administration).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    performerType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=\"Desired kind of performer of the medication administration\",\n        description=(\n            \"Indicates the type of performer of the administration of the \"\n            \"medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    priorPrescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"priorPrescription\",\n        title=\"An order/prescription that is being replaced\",\n        description=(\n            \"A link to a resource representing an earlier order related order or \"\n            \"prescription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the Medication Request should be addressed with \"\n            \"respect to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Reason or indication for ordering or not ordering the medication\",\n        description=(\n            \"The reason or the indication for ordering or not ordering the \"\n            \"medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=(\n            \"Condition or observation that supports why the prescription is being \"\n            \"written\"\n        ),\n        description=\"Condition or observation that supports why the medication was ordered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    recorder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recorder\",\n        title=\"Person who entered the request\",\n        description=(\n            \"The person who entered the order on behalf of another individual for \"\n            \"example in the case of a verbal or a telephone order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    reportedBoolean: bool | None = Field(\n        default=None,\n        alias=\"reportedBoolean\",\n        title=\"Reported rather than primary record\",\n        description=(\n            \"Indicates if this record was captured as a secondary 'reported' record\"\n            \" rather than as an original primary source-of-truth record.  It may \"\n            \"also indicate the source of the report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e reported[x]\n            \"one_of_many\": \"reported\",\n            \"one_of_many_required\": False,\n        },\n    )\n    reportedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_reportedBoolean\",\n        title=\"Extension field for ``reportedBoolean``.\",\n    )\n\n    reportedReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reportedReference\",\n        title=\"Reported rather than primary record\",\n        description=(\n            \"Indicates if this record was captured as a secondary 'reported' record\"\n            \" rather than as an original primary source-of-truth record.  It may \"\n            \"also indicate the source of the report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e reported[x]\n            \"one_of_many\": \"reported\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/What requested the Request\",\n        description=(\n            \"The individual, organization, or device that initiated the request and\"\n            \" has responsibility for its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"active | on-hold | cancelled | completed | entered-in-error | stopped \"\n            \"| draft | unknown\"\n        ),\n        description=(\n            \"A code specifying the current state of the order.  Generally, this \"\n            \"will be active or completed state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"active\",\n                \"on-hold\",\n                \"cancelled\",\n                \"completed\",\n                \"entered-in-error\",\n                \"stopped\",\n                \"draft\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current state of the MedicationRequest.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who or group medication request is for\",\n        description=(\n            \"A link to a resource representing the person or set of individuals to \"\n            \"whom the medication will be given.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    substitution: fhirtypes.MedicationRequestSubstitutionType | None = Field(\n        default=None,\n        alias=\"substitution\",\n        title=\"Any restrictions on medication substitution\",\n        description=(\n            \"Indicates whether or not substitution can or should be part of the \"\n            \"dispense. In some cases, substitution must happen, in other cases \"\n            \"substitution must not happen. This block explains the prescriber's \"\n            \"intent. If nothing is specified substitution may be done.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Information to support ordering of the medication\",\n        description=(\n            \"Include additional information (for example, patient height and \"\n            \"weight) that supports the ordering of the medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"statusReason\",\n            \"intent\",\n            \"category\",\n            \"priority\",\n            \"doNotPerform\",\n            \"reportedBoolean\",\n            \"reportedReference\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"encounter\",\n            \"supportingInformation\",\n            \"authoredOn\",\n            \"requester\",\n            \"performer\",\n            \"performerType\",\n            \"recorder\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"courseOfTherapyType\",\n            \"insurance\",\n            \"note\",\n            \"dosageInstruction\",\n            \"dispenseRequest\",\n            \"substitution\",\n            \"priorPrescription\",\n            \"detectedIssue\",\n            \"eventHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"doNotPerform\",\n            \"reportedBoolean\",\n            \"reportedReference\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"authoredOn\",\n            \"requester\",\n            \"performerType\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"groupIdentifier\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"medication\": [\"medicationCodeableConcept\", \"medicationReference\"],\n            \"reported\": [\"reportedBoolean\", \"reportedReference\"],\n        }\n        return one_of_many_fields\n\n\nclass MedicationRequestDispenseRequest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Medication supply authorization.\n    Indicates the specific details for the dispense or medication supply part\n    of a medication request (also known as a Medication Prescription or\n    Medication Order).  Note that this information is not always sent with the\n    order.  There may be in some settings (e.g. hospitals) institutional or\n    system support for completing the dispense details in the pharmacy\n    department.\n    \"\"\"\n\n    __resource_type__ = \"MedicationRequestDispenseRequest\"\n\n    dispenseInterval: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"dispenseInterval\",\n        title=\"Minimum period of time between dispenses\",\n        description=(\n            \"The minimum period of time that must occur between dispenses of the \"\n            \"medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    expectedSupplyDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"expectedSupplyDuration\",\n        title=\"Number of days supply per dispense\",\n        description=(\n            \"Identifies the period time over which the supplied product is expected\"\n            \" to be used, or the length of time the dispense is expected to last.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    initialFill: fhirtypes.MedicationRequestDispenseRequestInitialFillType | None = (\n        Field(\n            default=None,\n            alias=\"initialFill\",\n            title=\"First fill details\",\n            description=(\n                \"Indicates the quantity or duration for the first dispense of the \"\n                \"medication.\"\n            ),\n            json_schema_extra={\n                \"element_property\": True,\n            },\n        )\n    )\n\n    numberOfRepeatsAllowed: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfRepeatsAllowed\",\n        title=\"Number of refills authorized\",\n        description=(\n            \"An integer indicating the number of times, in addition to the original\"\n            \" dispense, (aka refills or repeats) that the patient can receive the \"\n            \"prescribed medication. Usage Notes: This integer does not include the \"\n            \"original order dispense. This means that if an order indicates \"\n            'dispense 30 tablets plus \"3 repeats\", then the order can be dispensed '\n            \"a total of 4 times and the patient can receive a total of 120 tablets.\"\n            \"  A prescriber may explicitly say that zero refills are permitted \"\n            \"after the initial dispense.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    numberOfRepeatsAllowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfRepeatsAllowed\",\n        title=\"Extension field for ``numberOfRepeatsAllowed``.\",\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Intended dispenser\",\n        description=(\n            \"Indicates the intended dispensing Organization specified by the \"\n            \"prescriber.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount of medication to supply per dispense\",\n        description=\"The amount that is to be dispensed for one fill.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    validityPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"validityPeriod\",\n        title=\"Time period supply is authorized for\",\n        description=(\n            \"This indicates the validity period of a prescription (stale dating the\"\n            \" Prescription).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationRequestDispenseRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"initialFill\",\n            \"dispenseInterval\",\n            \"validityPeriod\",\n            \"numberOfRepeatsAllowed\",\n            \"quantity\",\n            \"expectedSupplyDuration\",\n            \"performer\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationRequestDispenseRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationRequestDispenseRequestInitialFill(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    First fill details.\n    Indicates the quantity or duration for the first dispense of the\n    medication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationRequestDispenseRequestInitialFill\"\n\n    duration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"First fill duration\",\n        description=\"The length of time that the first dispense is expected to last.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"First fill quantity\",\n        description=\"The amount or quantity to provide as part of the first dispense.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationRequestDispenseRequestInitialFill`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"quantity\", \"duration\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationRequestDispenseRequestInitialFill`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationRequestSubstitution(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Any restrictions on medication substitution.\n    Indicates whether or not substitution can or should be part of the\n    dispense. In some cases, substitution must happen, in other cases\n    substitution must not happen. This block explains the prescriber's intent.\n    If nothing is specified substitution may be done.\n    \"\"\"\n\n    __resource_type__ = \"MedicationRequestSubstitution\"\n\n    allowedBoolean: bool | None = Field(\n        default=None,\n        alias=\"allowedBoolean\",\n        title=\"Whether substitution is allowed or not\",\n        description=(\n            \"True if the prescriber allows a different drug to be dispensed from \"\n            \"what was prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": True,\n        },\n    )\n    allowedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedBoolean\",\n        title=\"Extension field for ``allowedBoolean``.\",\n    )\n\n    allowedCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"allowedCodeableConcept\",\n        title=\"Whether substitution is allowed or not\",\n        description=(\n            \"True if the prescriber allows a different drug to be dispensed from \"\n            \"what was prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why should (not) substitution be made\",\n        description=(\n            \"Indicates the reason for the substitution, or why substitution must or\"\n            \" must not be performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationRequestSubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"allowedBoolean\",\n            \"allowedCodeableConcept\",\n            \"reason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationRequestSubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"allowed\": [\"allowedBoolean\", \"allowedCodeableConcept\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/medicationstatement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationStatement\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass MedicationStatement(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Record of medication being taken by a patient.\n    A record of a medication that is being consumed by a patient.   A\n    MedicationStatement may indicate that the patient may be taking the\n    medication now or has taken the medication in the past or will be taking\n    the medication in the future.  The source of this information can be the\n    patient, significant other (such as a family member or spouse), or a\n    clinician.  A common scenario where this information is captured is during\n    the history taking process during a patient visit or stay.   The medication\n    information may come from sources such as the patient's memory, from a\n    prescription bottle,  or from a list of medications the patient, clinician\n    or other party maintains.\n\n    The primary difference between a medication statement and a medication\n    administration is that the medication administration has complete\n    administration information and is based on actual administration\n    information from the person who administered the medication.  A medication\n    statement is often, if not always, less specific.  There is no required\n    date/time when the medication was administered, in fact we only know that a\n    source has reported the patient is taking this medication, where details\n    such as time, quantity, or rate or even medication product may be\n    incomplete or missing or less precise.  As stated earlier, the medication\n    statement information may come from the patient's memory, from a\n    prescription bottle or from a list of medications the patient, clinician or\n    other party maintains.  Medication administration is more formal and is not\n    missing detailed information.\n    \"\"\"\n\n    __resource_type__ = \"MedicationStatement\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfils plan, proposal or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\", \"CarePlan\", \"ServiceRequest\"],\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of medication usage\",\n        description=(\n            \"Indicates where the medication is expected to be consumed or \"\n            \"administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter / Episode associated with MedicationStatement\",\n        description=(\n            \"The encounter or episode of care that establishes the context for this\"\n            \" MedicationStatement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    dateAsserted: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateAsserted\",\n        title=\"When the statement was asserted?\",\n        description=(\n            \"The date when the medication statement was asserted by the information\"\n            \" source.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    dateAsserted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_dateAsserted\",\n        title=\"Extension field for ``dateAsserted``.\",\n    )\n\n    derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Additional supporting information\",\n        description=(\n            \"Allows linking the MedicationStatement to the underlying \"\n            \"MedicationRequest, or to other information that supports or is used to\"\n            \" derive the MedicationStatement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    dosage: typing.List[fhirtypes.DosageType] | None = Field(\n        default=None,\n        alias=\"dosage\",\n        title=\"Details of how medication is/was taken or should be taken\",\n        description=\"Indicates how the medication is/was or should be taken by the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"The date/time or interval when the medication is/was/will be taken\",\n        description=(\n            \"The interval of time during which it is being asserted that the \"\n            \"patient is/was/will be taking the medication (or was not taking, when \"\n            \"the MedicationStatement.taken element is No).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"The date/time or interval when the medication is/was/will be taken\",\n        description=(\n            \"The interval of time during which it is being asserted that the \"\n            \"patient is/was/will be taking the medication (or was not taking, when \"\n            \"the MedicationStatement.taken element is No).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifiers associated with this Medication Statement that are defined\"\n            \" by business processes and/or used to refer to it when a direct URL \"\n            \"reference to the resource itself is not appropriate. They are business\"\n            \" identifiers assigned to this resource by the performer or other \"\n            \"systems and remain constant as the resource is updated and propagates \"\n            \"from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    informationSource: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"informationSource\",\n        title=(\n            \"Person or organization that provided the information about the taking \"\n            \"of this medication\"\n        ),\n        description=(\n            \"The person or organization that provided the information about the \"\n            \"taking of this medication. Note: Use derivedFrom when a \"\n            \"MedicationStatement is derived from other resources, e.g. Claim or \"\n            \"MedicationRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"medicationCodeableConcept\",\n        title=\"What medication was taken\",\n        description=(\n            \"Identifies the medication being administered. This is either a link to\"\n            \" a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    medicationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"medicationReference\",\n        title=\"What medication was taken\",\n        description=(\n            \"Identifies the medication being administered. This is either a link to\"\n            \" a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Further information about the statement\",\n        description=(\n            \"Provides extra information about the medication statement that is not \"\n            \"conveyed by the other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=\"A larger event of which this particular event is a component or step.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicationAdministration\",\n                \"MedicationDispense\",\n                \"MedicationStatement\",\n                \"Procedure\",\n                \"Observation\",\n            ],\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Reason for why the medication is being/was taken\",\n        description=\"A reason for why the medication is being/was taken.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=(\n            \"Condition or observation that supports why the medication is being/was\"\n            \" taken\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\", \"DiagnosticReport\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"active | completed | entered-in-error | intended | stopped | on-hold |\"\n            \" unknown | not-taken\"\n        ),\n        description=(\n            \"A code representing the patient or other source's judgment about the \"\n            \"state of the medication used that this statement is about.  Generally,\"\n            \" this will be active or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"active\",\n                \"completed\",\n                \"entered-in-error\",\n                \"intended\",\n                \"stopped\",\n                \"on-hold\",\n                \"unknown\",\n                \"not-taken\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current state of the MedicationStatement.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who is/was taking  the medication\",\n        description=\"The person, animal or group who is/was taking the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"category\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"context\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"dateAsserted\",\n            \"informationSource\",\n            \"derivedFrom\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"note\",\n            \"dosage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"category\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"context\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"dateAsserted\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"effective\": [\"effectiveDateTime\", \"effectivePeriod\"],\n            \"medication\": [\"medicationCodeableConcept\", \"medicationReference\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/medicinalproductdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicinalProductDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicinalProductDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Detailed definition of a medicinal product.\n    A medicinal product, being a substance or combination of substances that is\n    intended to treat, prevent or diagnose a disease, or to restore, correct or\n    modify physiological functions by exerting a pharmacological, immunological\n    or metabolic action. This resource is intended to define and detail such\n    products and their properties, for uses other than direct patient care\n    (e.g. regulatory use, or drug catalogs).\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinition\"\n\n    additionalMonitoringIndicator: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"additionalMonitoringIndicator\",\n        title=(\n            \"Whether the Medicinal Product is subject to additional monitoring for \"\n            \"regulatory reasons\"\n        ),\n        description=(\n            \"Whether the Medicinal Product is subject to additional monitoring for \"\n            \"regulatory reasons, such as heightened reporting requirements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    attachedDocument: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"attachedDocument\",\n        title=\"Additional documentation about the medicinal product\",\n        description=(\n            \"Additional information or supporting documentation about the medicinal\"\n            \" product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    characteristic: typing.List[\n        fhirtypes.MedicinalProductDefinitionCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title='Key product features such as \"sugar free\", \"modified release\"',\n        description=(\n            'Allows the key product features to be recorded, such as \"sugar free\", '\n            '\"modified release\", \"parallel import\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    classification: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=\"Allows the product to be classified by various systems\",\n        description=(\n            \"Allows the product to be classified by various systems, commonly WHO \"\n            \"ATC.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    clinicalTrial: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"clinicalTrial\",\n        title=\"Clinical trials or studies that this product is involved in\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchStudy\"],\n        },\n    )\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"A code that this product is known by, within some formal terminology\",\n        description=(\n            \"A code that this product is known by, usually within some formal \"\n            \"terminology, perhaps assigned by a third party (i.e. not the \"\n            \"manufacturer or regulator). Products (types of medications) tend to be\"\n            \" known by identifiers during development and within regulatory \"\n            \"process. However when they are prescribed they tend to be identified \"\n            \"by codes. The same product may be have multiple codes, applied to it \"\n            \"by multiple organizations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    combinedPharmaceuticalDoseForm: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"combinedPharmaceuticalDoseForm\",\n        title=(\n            \"The dose form for a single part product, or combined form of a \"\n            \"multiple part product\"\n        ),\n        description=(\n            \"The dose form for a single part product, or combined form of a \"\n            \"multiple part product. This is one concept that describes all the \"\n            \"components. It does not represent the form with components physically \"\n            \"mixed, if that might be necessary, for which see \"\n            \"(AdministrableProductDefinition.administrableDoseForm).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[\n        fhirtypes.MedicinalProductDefinitionContactType\n    ] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"A product specific contact, person (in a role), or an organization\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    crossReference: typing.List[\n        fhirtypes.MedicinalProductDefinitionCrossReferenceType\n    ] | None = Field(\n        default=None,\n        alias=\"crossReference\",\n        title=(\n            \"Reference to another product, e.g. for linking authorised to \"\n            \"investigational product\"\n        ),\n        description=(\n            \"Reference to another product, e.g. for linking authorised to \"\n            \"investigational product, or a virtual product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"General description of this product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    domain: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"domain\",\n        title=\"If this medicine applies to human or veterinary uses\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for this product. Could be an MPID\",\n        description=(\n            \"Business identifier for this product. Could be an MPID. When in \"\n            \"development or being regulated, products are typically referenced by \"\n            \"official identifiers, assigned by a manufacturer or regulator, and \"\n            \"unique to a product (which, when compared to a product instance being \"\n            \"prescribed, is actually a product type). See also \"\n            \"MedicinalProductDefinition.code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    impurity: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"impurity\",\n        title=(\n            \"Any component of the drug product which is not the chemical entity \"\n            \"defined as the drug substance, or an excipient in the drug product\"\n        ),\n        description=(\n            \"Any component of the drug product which is not the chemical entity \"\n            \"defined as the drug substance, or an excipient in the drug product. \"\n            \"This includes process-related impurities and contaminants, product-\"\n            \"related impurities including degradation products.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceDefinition\"],\n        },\n    )\n\n    indication: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"indication\",\n        title=(\n            \"Description of indication(s) for this product, used when structured \"\n            \"indications are not required\"\n        ),\n        description=(\n            \"Description of indication(s) for this product, used when structured \"\n            \"indications are not required. In cases where structured indications \"\n            \"are required, they are captured using the ClinicalUseDefinition \"\n            \"resource. An indication is a medical situation for which using the \"\n            \"product is appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    indication__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_indication\", title=\"Extension field for ``indication``.\"\n    )\n\n    ingredient: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=(\n            \"The ingredients of this medicinal product - when not detailed in other\"\n            \" resources\"\n        ),\n        description=(\n            \"The ingredients of this medicinal product - when not detailed in other\"\n            \" resources. This is only needed if the ingredients are not specified \"\n            \"by incoming references from the Ingredient resource, or indirectly via\"\n            \" incoming AdministrableProductDefinition, PackagedProductDefinition or\"\n            \" ManufacturedItemDefinition references. In cases where those levels of\"\n            \" detail are not used, the ingredients may be specified directly here \"\n            \"as codes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    legalStatusOfSupply: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"legalStatusOfSupply\",\n        title=(\n            \"The legal status of supply of the medicinal product as classified by \"\n            \"the regulator\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    marketingStatus: typing.List[fhirtypes.MarketingStatusType] | None = Field(\n        default=None,\n        alias=\"marketingStatus\",\n        title=(\n            \"Marketing status of the medicinal product, in contrast to marketing \"\n            \"authorization\"\n        ),\n        description=(\n            \"Marketing status of the medicinal product, in contrast to marketing \"\n            \"authorization. This refers to the product being actually 'on the \"\n            \"market' as opposed to being allowed to be on the market (which is an \"\n            \"authorization).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    masterFile: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"masterFile\",\n        title=(\n            \"A master file for the medicinal product (e.g. Pharmacovigilance System\"\n            \" Master File)\"\n        ),\n        description=(\n            \"A master file for the medicinal product (e.g. Pharmacovigilance System\"\n            \" Master File). Drug master files (DMFs) are documents submitted to \"\n            \"regulatory agencies to provide confidential detailed information about\"\n            \" facilities, processes or articles used in the manufacturing, \"\n            \"processing, packaging and storing of drug products.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    name: typing.List[fhirtypes.MedicinalProductDefinitionNameType] = Field(\n        default=...,\n        alias=\"name\",\n        title=\"The product's name, including full name and possibly coded parts\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    operation: typing.List[\n        fhirtypes.MedicinalProductDefinitionOperationType\n    ] | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"A manufacturing or administrative process for the medicinal product\",\n        description=(\n            \"A manufacturing or administrative process or step associated with (or \"\n            \"performed on) the medicinal product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    packagedMedicinalProduct: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"packagedMedicinalProduct\",\n        title=\"Package type for the product\",\n        description=(\n            \"Package type for the product. See also the PackagedProductDefinition \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    pediatricUseIndicator: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"pediatricUseIndicator\",\n        title=\"If authorised for use in children\",\n        description=\"If authorised for use in children, or infants, neonates etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    route: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"route\",\n        title=(\n            \"The path by which the product is taken into or makes contact with the \"\n            \"body\"\n        ),\n        description=(\n            \"The path by which the product is taken into or makes contact with the \"\n            \"body. In some regions this is referred to as the licenced or approved \"\n            \"route. See also AdministrableProductDefinition resource. \"\n            \"MedicinalProductDefinition.route is the same concept as \"\n            \"AdministrableProductDefinition.routeOfAdministration.code, and they \"\n            \"cannot be used together.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specialMeasures: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialMeasures\",\n        title=(\n            \"Whether the Medicinal Product is subject to special measures for \"\n            \"regulatory reasons\"\n        ),\n        description=(\n            \"Whether the Medicinal Product is subject to special measures for \"\n            \"regulatory reasons, such as a requirement to conduct post-\"\n            \"authorisation studies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"The status within the lifecycle of this product record\",\n        description=(\n            \"The status within the lifecycle of this product record. A high-level \"\n            \"status, this is not intended to duplicate details carried elsewhere \"\n            \"such as legal status, or authorization status.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    statusDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"The date at which the given status became applicable\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Regulatory type, e.g. Investigational or Authorized\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"A business identifier relating to a specific version of the product\",\n        description=(\n            \"A business identifier relating to a specific version of the product, \"\n            \"this is commonly used to support revisions to an existing product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"domain\",\n            \"version\",\n            \"status\",\n            \"statusDate\",\n            \"description\",\n            \"combinedPharmaceuticalDoseForm\",\n            \"route\",\n            \"indication\",\n            \"legalStatusOfSupply\",\n            \"additionalMonitoringIndicator\",\n            \"specialMeasures\",\n            \"pediatricUseIndicator\",\n            \"classification\",\n            \"marketingStatus\",\n            \"packagedMedicinalProduct\",\n            \"ingredient\",\n            \"impurity\",\n            \"attachedDocument\",\n            \"masterFile\",\n            \"contact\",\n            \"clinicalTrial\",\n            \"code\",\n            \"name\",\n            \"crossReference\",\n            \"operation\",\n            \"characteristic\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"type\",\n            \"domain\",\n            \"version\",\n            \"status\",\n            \"statusDate\",\n            \"description\",\n            \"combinedPharmaceuticalDoseForm\",\n            \"route\",\n            \"indication\",\n            \"legalStatusOfSupply\",\n            \"additionalMonitoringIndicator\",\n            \"specialMeasures\",\n            \"pediatricUseIndicator\",\n            \"classification\",\n            \"marketingStatus\",\n            \"packagedMedicinalProduct\",\n            \"ingredient\",\n            \"impurity\",\n            \"attachedDocument\",\n            \"masterFile\",\n            \"contact\",\n            \"clinicalTrial\",\n            \"code\",\n            \"name\",\n            \"crossReference\",\n            \"operation\",\n            \"characteristic\",\n        ]\n\n\nclass MedicinalProductDefinitionCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Key product features such as \"sugar free\", \"modified release\".\n    Allows the key product features to be recorded, such as \"sugar free\",\n    \"modified release\", \"parallel import\".\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionCharacteristic\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"A code expressing the type of characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDate\",\n                \"valueQuantity\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass MedicinalProductDefinitionContact(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A product specific contact, person (in a role), or an organization.\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionContact\"\n\n    contact: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"contact\",\n        title=\"A product specific contact, person (in a role), or an organization\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"PractitionerRole\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Allows the contact to be classified, for example QPPV, \"\n            \"Pharmacovigilance Enquiry Information\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"contact\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"contact\"]\n\n\nclass MedicinalProductDefinitionCrossReference(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Reference to another product, e.g. for linking authorised to\n    investigational product.\n    Reference to another product, e.g. for linking authorised to\n    investigational product, or a virtual product.\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionCrossReference\"\n\n    product: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"product\",\n        title=(\n            \"Reference to another product, e.g. for linking authorised to \"\n            \"investigational product\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicinalProductDefinition\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"The type of relationship, for instance branded to generic or virtual \"\n            \"to actual product\"\n        ),\n        description=(\n            \"The type of relationship, for instance branded to generic, virtual to \"\n            \"actual product, product to development product (investigational), \"\n            \"parallel import version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionCrossReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"product\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionCrossReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"product\", \"type\"]\n\n\nclass MedicinalProductDefinitionName(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The product's name, including full name and possibly coded parts.\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionName\"\n\n    countryLanguage: typing.List[\n        fhirtypes.MedicinalProductDefinitionNameCountryLanguageType\n    ] | None = Field(\n        default=None,\n        alias=\"countryLanguage\",\n        title=\"Country and jurisdiction where the name applies\",\n        description=(\n            \"Country and jurisdiction where the name applies, and associated \"\n            \"language.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    namePart: typing.List[\n        fhirtypes.MedicinalProductDefinitionNameNamePartType\n    ] | None = Field(\n        default=None,\n        alias=\"namePart\",\n        title=\"Coding words or phrases of the name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    productName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"productName\",\n        title=\"The full product name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    productName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_productName\", title=\"Extension field for ``productName``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of product name, such as rINN, BAN, Proprietary, Non-Proprietary\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"productName\",\n            \"type\",\n            \"namePart\",\n            \"countryLanguage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"productName\",\n            \"type\",\n            \"namePart\",\n            \"countryLanguage\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"productName\", \"productName__ext\")]\n        return required_fields\n\n\nclass MedicinalProductDefinitionNameCountryLanguage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Country and jurisdiction where the name applies.\n    Country and jurisdiction where the name applies, and associated language.\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionNameCountryLanguage\"\n\n    country: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"country\",\n        title=\"Country code for where this name applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Jurisdiction code for where this name applies\",\n        description=(\n            \"Jurisdiction code for where this name applies. A jurisdiction may be a\"\n            \" sub- or supra-national entity (e.g. a state or a geographic region).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    language: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"language\",\n        title=\"Language code for this name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionNameCountryLanguage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"country\",\n            \"jurisdiction\",\n            \"language\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionNameCountryLanguage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"country\", \"jurisdiction\", \"language\"]\n\n\nclass MedicinalProductDefinitionNameNamePart(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Coding words or phrases of the name.\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionNameNamePart\"\n\n    part: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"A fragment of a product name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    part__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_part\", title=\"Extension field for ``part``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Identifying type for this part of the name (e.g. strength part)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionNameNamePart`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"part\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionNameNamePart`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"part\", \"type\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"part\", \"part__ext\")]\n        return required_fields\n\n\nclass MedicinalProductDefinitionOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A manufacturing or administrative process for the medicinal product.\n    A manufacturing or administrative process or step associated with (or\n    performed on) the medicinal product.\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionOperation\"\n\n    confidentialityIndicator: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"confidentialityIndicator\",\n        title=(\n            \"Specifies whether this process is considered proprietary or \"\n            \"confidential\"\n        ),\n        description=(\n            \"Specifies whether this particular business or manufacturing process is\"\n            \" considered proprietary or confidential.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    effectiveDate: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectiveDate\",\n        title=\"Date range of applicability\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    organization: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=(\n            \"The organization responsible for the particular process, e.g. the \"\n            \"manufacturer or importer\"\n        ),\n        description=(\n            \"The organization or establishment responsible for (or associated with)\"\n            \" the particular process or step, examples include the manufacturer, \"\n            \"importer, agent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    type: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"The type of manufacturing operation e.g. manufacturing itself, re-\"\n            \"packaging\"\n        ),\n        description=(\n            \"The type of manufacturing operation e.g. manufacturing itself, re-\"\n            \"packaging. For the authorization of this, a RegulatedAuthorization \"\n            \"would point to the same plan or activity referenced here.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"effectiveDate\",\n            \"organization\",\n            \"confidentialityIndicator\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"effectiveDate\",\n            \"organization\",\n            \"confidentialityIndicator\",\n        ]\n"
  },
  {
    "path": "fhir/resources/R4B/messagedefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MessageDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MessageDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A resource that defines a type of message that can be exchanged between\n    systems.\n    Defines the characteristics of a message that can be shared between\n    systems, including the type of event that initiates the message, the\n    content to be transmitted and what response(s), if any, are permitted.\n    \"\"\"\n\n    __resource_type__ = \"MessageDefinition\"\n\n    allowedResponse: typing.List[\n        fhirtypes.MessageDefinitionAllowedResponseType\n    ] | None = Field(\n        default=None,\n        alias=\"allowedResponse\",\n        title=\"Responses to this message\",\n        description=(\n            \"Indicates what types of messages may be sent as an application-level \"\n            \"response to this message.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    base: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"Definition this one is based on\",\n        description=(\n            \"The MessageDefinition that is the basis for the contents of this \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n    base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_base\", title=\"Extension field for ``base``.\"\n    )\n\n    category: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"consequence | currency | notification\",\n        description=\"The impact of the content of the message.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"consequence\", \"currency\", \"notification\"],\n        },\n    )\n    category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_category\", title=\"Extension field for ``category``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the message definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the message definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the message definition was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the message definition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the message definition\",\n        description=(\n            \"A free text natural language description of the message definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    eventCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"eventCoding\",\n        title=\"Event code  or link to the EventDefinition\",\n        description=\"Event code or link to the EventDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e event[x]\n            \"one_of_many\": \"event\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    eventUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"eventUri\",\n        title=\"Event code  or link to the EventDefinition\",\n        description=\"Event code or link to the EventDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e event[x]\n            \"one_of_many\": \"event\",\n            \"one_of_many_required\": True,\n        },\n    )\n    eventUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_eventUri\", title=\"Extension field for ``eventUri``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this message definition is authored \"\n            \"for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    focus: typing.List[fhirtypes.MessageDefinitionFocusType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"Resource(s) that are the subject of the event\",\n        description=(\n            \"Identifies the resource (or resources) that are being addressed by the\"\n            \" event.  For example, the Encounter for an admit message or two \"\n            \"Account records for a merge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    graph: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"graph\",\n        title=\"Canonical reference to a GraphDefinition\",\n        description=(\n            \"Canonical reference to a GraphDefinition. If a URL is provided, it is \"\n            \"the canonical reference to a [GraphDefinition](graphdefinition.html) \"\n            \"that it controls what resources are to be added to the bundle when \"\n            \"building the document. The GraphDefinition can also specify profiles \"\n            \"that apply to the various resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"GraphDefinition\"],\n        },\n    )\n    graph__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_graph\", title=\"Extension field for ``graph``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Primary key for the message definition on a given server\",\n        description=(\n            \"A formal identifier that is used to identify this message definition \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for message definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the message definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this message definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the message definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    parent: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Protocol/workflow this is part of\",\n        description=(\n            \"Identifies a protocol or workflow that this MessageDefinition \"\n            \"represents a step in.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n    parent__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_parent\", title=\"Extension field for ``parent``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the message \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this message definition is defined\",\n        description=(\n            \"Explanation of why this message definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    replaces: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"Takes the place of\",\n        description=\"A MessageDefinition that is superseded by this definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n    replaces__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_replaces\", title=\"Extension field for ``replaces``.\"\n    )\n\n    responseRequired: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"responseRequired\",\n        title=\"always | on-error | never | on-success\",\n        description=(\n            \"Declare at a message definition level whether a response is required \"\n            \"or only upon error or success, or never.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"always\", \"on-error\", \"never\", \"on-success\"],\n        },\n    )\n    responseRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_responseRequired\",\n        title=\"Extension field for ``responseRequired``.\",\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this message definition. Enables tracking the life-cycle\"\n            \" of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this message definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the message definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Business Identifier for a given MessageDefinition\",\n        description=(\n            \"The business identifier that is used to reference the \"\n            \"MessageDefinition and *is* expected to be consistent from server to \"\n            \"server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate message definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the message definition\",\n        description=(\n            \"The identifier that is used to identify this version of the message \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the message definition\"\n            \" author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"replaces\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"base\",\n            \"parent\",\n            \"eventCoding\",\n            \"eventUri\",\n            \"category\",\n            \"focus\",\n            \"responseRequired\",\n            \"allowedResponse\",\n            \"graph\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"replaces\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"base\",\n            \"parent\",\n            \"eventCoding\",\n            \"eventUri\",\n            \"category\",\n            \"focus\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"date\", \"date__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"event\": [\"eventCoding\", \"eventUri\"]}\n        return one_of_many_fields\n\n\nclass MessageDefinitionAllowedResponse(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Responses to this message.\n    Indicates what types of messages may be sent as an application-level\n    response to this message.\n    \"\"\"\n\n    __resource_type__ = \"MessageDefinitionAllowedResponse\"\n\n    message: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"message\",\n        title=\"Reference to allowed message definition response\",\n        description=(\n            \"A reference to the message definition that must be adhered to by this \"\n            \"supported response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n    message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_message\", title=\"Extension field for ``message``.\"\n    )\n\n    situation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"situation\",\n        title=\"When should this response be used\",\n        description=(\n            \"Provides a description of the circumstances in which this response \"\n            \"should be used (as opposed to one of the alternative responses).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    situation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_situation\", title=\"Extension field for ``situation``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageDefinitionAllowedResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"message\", \"situation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageDefinitionAllowedResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"message\", \"message__ext\")]\n        return required_fields\n\n\nclass MessageDefinitionFocus(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource(s) that are the subject of the event.\n    Identifies the resource (or resources) that are being addressed by the\n    event.  For example, the Encounter for an admit message or two Account\n    records for a merge.\n    \"\"\"\n\n    __resource_type__ = \"MessageDefinitionFocus\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of resource\",\n        description=\"The kind of resource that must be the focus for this message.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum number of focuses of this type\",\n        description=(\n            \"Identifies the maximum number of resources of this type that must be \"\n            \"pointed to by a message in order for it to be valid against this \"\n            \"MessageDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum number of focuses of this type\",\n        description=(\n            \"Identifies the minimum number of resources of this type that must be \"\n            \"pointed to by a message in order for it to be valid against this \"\n            \"MessageDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile that must be adhered to by focus\",\n        description=(\n            \"A profile that reflects constraints for the focal resource (and \"\n            \"potentially for related resources).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageDefinitionFocus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"profile\", \"min\", \"max\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageDefinitionFocus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"min\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"min\", \"min__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/messageheader.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MessageHeader\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MessageHeader(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A resource that describes a message that is exchanged between systems.\n    The header for a message exchange that is either requesting or responding\n    to an action.  The reference(s) that are the subject of the action as well\n    as other information related to the action are typically transmitted in a\n    bundle in which the MessageHeader resource instance is the first resource\n    in the bundle.\n    \"\"\"\n\n    __resource_type__ = \"MessageHeader\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"The source of the decision\",\n        description=(\n            \"The logical author of the message - the person or device that decided \"\n            \"the described event should happen. When there is more than one \"\n            \"candidate, pick the most proximal to the MessageHeader. Can provide \"\n            \"other authors in extensions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    definition: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Link to the definition for this message\",\n        description=\"Permanent link to the MessageDefinition for this message.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    destination: typing.List[fhirtypes.MessageHeaderDestinationType] | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Message destination application(s)\",\n        description=\"The destination application which the message is intended for.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"The source of the data entry\",\n        description=(\n            \"The person or device that performed the data entry leading to this \"\n            \"message. When there is more than one candidate, pick the most proximal\"\n            \" to the message. Can provide other enterers in extensions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    eventCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"eventCoding\",\n        title=\"Code for the event this message represents or link to event definition\",\n        description=(\n            \"Code that identifies the event this message represents and connects it\"\n            \" with its definition. Events defined as part of the FHIR specification\"\n            ' have the system value \"http://terminology.hl7.org/CodeSystem/message-'\n            'events\".  Alternatively uri to the EventDefinition.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e event[x]\n            \"one_of_many\": \"event\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    eventUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"eventUri\",\n        title=\"Code for the event this message represents or link to event definition\",\n        description=(\n            \"Code that identifies the event this message represents and connects it\"\n            \" with its definition. Events defined as part of the FHIR specification\"\n            ' have the system value \"http://terminology.hl7.org/CodeSystem/message-'\n            'events\".  Alternatively uri to the EventDefinition.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e event[x]\n            \"one_of_many\": \"event\",\n            \"one_of_many_required\": True,\n        },\n    )\n    eventUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_eventUri\", title=\"Extension field for ``eventUri``.\"\n    )\n\n    focus: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"The actual content of the message\",\n        description=(\n            \"The actual data of the message - a reference to the root/focus class \"\n            \"of the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Cause of event\",\n        description=(\n            \"Coded indication of the cause for the event - indicates  a reason for \"\n            \"the occurrence of the event that is a focus of this message.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    response: fhirtypes.MessageHeaderResponseType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"If this is a reply to prior message\",\n        description=(\n            \"Information about the message that this message is a response to.  \"\n            \"Only present if this message is a response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    responsible: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Final responsibility for event\",\n        description=(\n            \"The person or organization that accepts overall responsibility for the\"\n            \" contents of the message. The implication is that the message event \"\n            \"happened under the policies of the responsible party.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    sender: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sender\",\n        title=\"Real world sender of the message\",\n        description=(\n            \"Identifies the sending system to allow the use of a trust \" \"relationship.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    source: fhirtypes.MessageHeaderSourceType = Field(\n        default=...,\n        alias=\"source\",\n        title=\"Message source application\",\n        description=\"The source application from which this message originated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageHeader`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"eventCoding\",\n            \"eventUri\",\n            \"destination\",\n            \"sender\",\n            \"enterer\",\n            \"author\",\n            \"source\",\n            \"responsible\",\n            \"reason\",\n            \"response\",\n            \"focus\",\n            \"definition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageHeader`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"eventCoding\",\n            \"eventUri\",\n            \"destination\",\n            \"sender\",\n            \"enterer\",\n            \"author\",\n            \"source\",\n            \"responsible\",\n            \"reason\",\n            \"response\",\n            \"focus\",\n            \"definition\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"event\": [\"eventCoding\", \"eventUri\"]}\n        return one_of_many_fields\n\n\nclass MessageHeaderDestination(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Message destination application(s).\n    The destination application which the message is intended for.\n    \"\"\"\n\n    __resource_type__ = \"MessageHeaderDestination\"\n\n    endpoint: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Actual destination address or id\",\n        description=\"Indicates where the message should be routed to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_endpoint\", title=\"Extension field for ``endpoint``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of system\",\n        description=\"Human-readable name for the target system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    receiver: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"receiver\",\n        title='Intended \"real-world\" recipient for the data',\n        description=(\n            \"Allows data conveyed by a message to be addressed to a particular \"\n            \"person or department when routing to a specific application isn't \"\n            \"sufficient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    target: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Particular delivery destination within the destination\",\n        description=(\n            \"Identifies the target end system in situations where the initial \"\n            \"message transmission is to an intermediary system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageHeaderDestination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"target\",\n            \"endpoint\",\n            \"receiver\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageHeaderDestination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"target\", \"endpoint\", \"receiver\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"endpoint\", \"endpoint__ext\")]\n        return required_fields\n\n\nclass MessageHeaderResponse(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If this is a reply to prior message.\n    Information about the message that this message is a response to.  Only\n    present if this message is a response.\n    \"\"\"\n\n    __resource_type__ = \"MessageHeaderResponse\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"ok | transient-error | fatal-error\",\n        description=(\n            \"Code that identifies the type of response to the message - whether it \"\n            \"was successful or not, and whether it should be resent or not.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"ok\", \"transient-error\", \"fatal-error\"],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    details: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"details\",\n        title=\"Specific list of hints/warnings/errors\",\n        description=\"Full details of any issues found in the message.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationOutcome\"],\n        },\n    )\n\n    identifier: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Id of original message\",\n        description=(\n            \"The MessageHeader.id of the message to which this message is a \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    identifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_identifier\", title=\"Extension field for ``identifier``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageHeaderResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"identifier\", \"code\", \"details\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageHeaderResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"code\", \"details\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"identifier\", \"identifier__ext\")]\n        return required_fields\n\n\nclass MessageHeaderSource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Message source application.\n    The source application from which this message originated.\n    \"\"\"\n\n    __resource_type__ = \"MessageHeaderSource\"\n\n    contact: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Human contact for problems\",\n        description=(\n            \"An e-mail, phone, website or other contact point to use to resolve \"\n            \"issues with message communications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endpoint: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Actual message source address or id\",\n        description=\"Identifies the routing target to send acknowledgements to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_endpoint\", title=\"Extension field for ``endpoint``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of system\",\n        description=\"Human-readable name for the source system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    software: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"software\",\n        title=\"Name of software running the system\",\n        description=\"May include configuration or other information useful in debugging.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    software__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_software\", title=\"Extension field for ``software``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version of software running\",\n        description=(\n            \"Can convey versions of multiple systems in situations where a message \"\n            \"passes through multiple hands.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageHeaderSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"software\",\n            \"version\",\n            \"contact\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageHeaderSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"name\",\n            \"software\",\n            \"version\",\n            \"contact\",\n            \"endpoint\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"endpoint\", \"endpoint__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/meta.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Meta\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Meta(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Metadata about a resource.\n    The metadata about a resource. This is content in the resource that is\n    maintained by the infrastructure. Changes to the content might not always\n    be associated with version changes to the resource.\n    \"\"\"\n\n    __resource_type__ = \"Meta\"\n\n    lastUpdated: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"lastUpdated\",\n        title=\"When the resource version last changed\",\n        description=\"When the resource last changed - e.g. when the version changed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastUpdated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lastUpdated\", title=\"Extension field for ``lastUpdated``.\"\n    )\n\n    profile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profiles this resource claims to conform to\",\n        description=(\n            \"A list of profiles (references to \"\n            \"[StructureDefinition](structuredefinition.html#) resources) that this \"\n            \"resource claims to conform to. The URL is a reference to \"\n            \"[StructureDefinition.url](structuredefinition-\"\n            \"definitions.html#StructureDefinition.url).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    security: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"security\",\n        title=\"Security Labels applied to this resource\",\n        description=(\n            \"Security labels applied to this resource. These tags connect specific \"\n            \"resources to the overall security policy and infrastructure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Identifies where the resource comes from\",\n        description=(\n            \"A uri that identifies the source system of the resource. This provides\"\n            \" a minimal amount of [Provenance](provenance.html#) information that \"\n            \"can be used to track or differentiate the source of information in the\"\n            \" resource. The source may identify another FHIR server, document, \"\n            \"message, database, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    tag: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"tag\",\n        title=\"Tags applied to this resource\",\n        description=(\n            \"Tags applied to this resource. Tags are intended to be used to \"\n            \"identify and relate resources to process and workflow, and \"\n            \"applications are not required to consider the tags when interpreting \"\n            \"the meaning of a resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    versionId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"versionId\",\n        title=\"Version specific identifier\",\n        description=(\n            \"The version specific identifier, as it appears in the version portion \"\n            \"of the URL. This value changes when the resource is created, updated, \"\n            \"or deleted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    versionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_versionId\", title=\"Extension field for ``versionId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Meta`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"versionId\",\n            \"lastUpdated\",\n            \"source\",\n            \"profile\",\n            \"security\",\n            \"tag\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Meta`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"versionId\", \"lastUpdated\", \"source\", \"profile\", \"security\", \"tag\"]\n"
  },
  {
    "path": "fhir/resources/R4B/molecularsequence.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MolecularSequence\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MolecularSequence(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about a biological sequence.\n    Raw data describing a biological sequence.\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequence\"\n\n    coordinateSystem: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"coordinateSystem\",\n        title=(\n            \"Base number of coordinate system (0 for 0-based numbering or \"\n            \"coordinates, inclusive start, exclusive end, 1 for 1-based numbering, \"\n            \"inclusive start, inclusive end)\"\n        ),\n        description=(\n            \"Whether the sequence is numbered starting at 0 (0-based numbering or \"\n            \"coordinates, inclusive start, exclusive end) or starting at 1 (1-based\"\n            \" numbering, inclusive start and inclusive end).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    coordinateSystem__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_coordinateSystem\",\n        title=\"Extension field for ``coordinateSystem``.\",\n    )\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"The method for sequencing\",\n        description=\"The method for sequencing, for example, chip information.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique ID for this particular sequence. This is a FHIR-defined id\",\n        description=(\n            \"A unique identifier for this particular sequence instance. This is a \"\n            \"FHIR-defined id.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    observedSeq: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"observedSeq\",\n        title=\"Sequence that was observed\",\n        description=(\n            \"Sequence that was observed. It is the result marked by referenceSeq \"\n            \"along with variant records on referenceSeq. This shall start from \"\n            \"referenceSeq.windowStart and end by referenceSeq.windowEnd.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    observedSeq__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_observedSeq\", title=\"Extension field for ``observedSeq``.\"\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"Who and/or what this is about\",\n        description=\"The patient whose sequencing results are described by this resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who should be responsible for test result\",\n        description=\"The organization or lab that should be responsible for this result.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    pointer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"pointer\",\n        title=\"Pointer to next atomic sequence\",\n        description=\"Pointer to next atomic sequence which at most contains one variant.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MolecularSequence\"],\n        },\n    )\n\n    quality: typing.List[fhirtypes.MolecularSequenceQualityType] | None = Field(\n        default=None,\n        alias=\"quality\",\n        title=\"An set of value as quality of sequence\",\n        description=(\n            \"An experimental feature attribute that defines the quality of the \"\n            \"feature in a quantitative way, such as a phred quality score ([SO:0001\"\n            \"686](http://www.sequenceontology.org/browser/current_svn/term/SO:00016\"\n            \"86)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"The number of copies of the sequence of interest.  (RNASeq)\",\n        description=\"The number of copies of the sequence of interest. (RNASeq).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    readCoverage: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"readCoverage\",\n        title=(\n            \"Average number of reads representing a given nucleotide in the \"\n            \"reconstructed sequence\"\n        ),\n        description=(\n            \"Coverage (read depth or depth) is the average number of reads \"\n            \"representing a given nucleotide in the reconstructed sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    readCoverage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_readCoverage\",\n        title=\"Extension field for ``readCoverage``.\",\n    )\n\n    referenceSeq: fhirtypes.MolecularSequenceReferenceSeqType | None = Field(\n        default=None,\n        alias=\"referenceSeq\",\n        title=\"A sequence used as reference\",\n        description=(\n            \"A sequence that is used as a reference to describe variants that are \"\n            \"present in a sequence analyzed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    repository: typing.List[fhirtypes.MolecularSequenceRepositoryType] | None = Field(\n        default=None,\n        alias=\"repository\",\n        title=(\n            \"External repository which contains detailed report related with \"\n            \"observedSeq in this resource\"\n        ),\n        description=(\n            \"Configurations of the external repository. The repository shall store \"\n            \"target's observedSeq or records related with target's observedSeq.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specimen: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Specimen used for sequencing\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    structureVariant: typing.List[\n        fhirtypes.MolecularSequenceStructureVariantType\n    ] | None = Field(\n        default=None,\n        alias=\"structureVariant\",\n        title=\"Structural variant\",\n        description=\"Information about chromosome structure variation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"aa | dna | rna\",\n        description=\"Amino Acid Sequence/ DNA Sequence / RNA Sequence.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"aa\", \"dna\", \"rna\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    variant: typing.List[fhirtypes.MolecularSequenceVariantType] | None = Field(\n        default=None,\n        alias=\"variant\",\n        title=\"Variant in sequence\",\n        description=(\n            \"The definition of variant here originates from Sequence ontology ([var\"\n            \"iant_of](http://www.sequenceontology.org/browser/current_svn/term/vari\"\n            \"ant_of)). This element can represent amino acid or nucleic sequence \"\n            \"change(including insertion,deletion,SNP,etc.)  It can represent some \"\n            \"complex mutation or segment variation with the assist of CIGAR string.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"coordinateSystem\",\n            \"patient\",\n            \"specimen\",\n            \"device\",\n            \"performer\",\n            \"quantity\",\n            \"referenceSeq\",\n            \"variant\",\n            \"observedSeq\",\n            \"quality\",\n            \"readCoverage\",\n            \"repository\",\n            \"pointer\",\n            \"structureVariant\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"type\",\n            \"coordinateSystem\",\n            \"patient\",\n            \"specimen\",\n            \"device\",\n            \"performer\",\n            \"quantity\",\n            \"referenceSeq\",\n            \"variant\",\n            \"observedSeq\",\n            \"quality\",\n            \"readCoverage\",\n            \"repository\",\n            \"pointer\",\n            \"structureVariant\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"coordinateSystem\", \"coordinateSystem__ext\")]\n        return required_fields\n\n\nclass MolecularSequenceQuality(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An set of value as quality of sequence.\n    An experimental feature attribute that defines the quality of the feature\n    in a quantitative way, such as a phred quality score ([SO:0001686](http://w\n    ww.sequenceontology.org/browser/current_svn/term/SO:0001686)).\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequenceQuality\"\n\n    end: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"End position of the sequence\",\n        description=(\n            \"End position of the sequence. If the coordinate system is 0-based then\"\n            \" end is exclusive and does not include the last position. If the \"\n            \"coordinate system is 1-base, then end is inclusive and includes the \"\n            \"last position.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    fScore: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"fScore\",\n        title=\"F-score\",\n        description=(\n            \"Harmonic mean of Recall and Precision, computed as: 2 * precision * \"\n            \"recall / (precision + recall).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fScore__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fScore\", title=\"Extension field for ``fScore``.\"\n    )\n\n    gtFP: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"gtFP\",\n        title=(\n            \"False positives where the non-REF alleles in the Truth and Query Call \"\n            \"Sets match\"\n        ),\n        description=(\n            \"The number of false positives where the non-REF alleles in the Truth \"\n            \"and Query Call Sets match (i.e. cases where the truth is 1/1 and the \"\n            \"query is 0/1 or similar).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    gtFP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gtFP\", title=\"Extension field for ``gtFP``.\"\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Method to get quality\",\n        description=\"Which method is used to get sequence quality.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    precision: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"precision\",\n        title=\"Precision of comparison\",\n        description=\"QUERY.TP / (QUERY.TP + QUERY.FP).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    precision__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_precision\", title=\"Extension field for ``precision``.\"\n    )\n\n    queryFP: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"queryFP\",\n        title=\"False positives\",\n        description=(\n            \"False positives, i.e. the number of sites in the Query Call Set for \"\n            \"which there is no path through the Truth Call Set that is consistent \"\n            \"with this site. Sites with correct variant but incorrect genotype are \"\n            \"counted here.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    queryFP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_queryFP\", title=\"Extension field for ``queryFP``.\"\n    )\n\n    queryTP: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"queryTP\",\n        title=\"True positives from the perspective of the query data\",\n        description=(\n            \"True positives, from the perspective of the query data, i.e. the \"\n            \"number of sites in the Query Call Set for which there are paths \"\n            \"through the Truth Call Set that are consistent with all of the alleles\"\n            \" at this site, and for which there is an accurate genotype call for \"\n            \"the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    queryTP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_queryTP\", title=\"Extension field for ``queryTP``.\"\n    )\n\n    recall: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"recall\",\n        title=\"Recall of comparison\",\n        description=\"TRUTH.TP / (TRUTH.TP + TRUTH.FN).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    recall__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recall\", title=\"Extension field for ``recall``.\"\n    )\n\n    roc: fhirtypes.MolecularSequenceQualityRocType | None = Field(\n        default=None,\n        alias=\"roc\",\n        title=\"Receiver Operator Characteristic (ROC) Curve\",\n        description=(\n            \"Receiver Operator Characteristic (ROC) Curve  to give \"\n            \"sensitivity/specificity tradeoff.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    score: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"score\",\n        title=\"Quality score for the comparison\",\n        description=(\n            \"The score of an experimentally derived feature such as a p-value ([SO:\"\n            \"0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0\"\n            \"001685)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    standardSequence: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"standardSequence\",\n        title=\"Standard sequence for comparison\",\n        description=\"Gold standard sequence used for comparing against.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    start: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Start position of the sequence\",\n        description=(\n            \"Start position of the sequence. If the coordinate system is either \"\n            \"0-based or 1-based, then start position is inclusive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    truthFN: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"truthFN\",\n        title=\"False negatives\",\n        description=(\n            \"False negatives, i.e. the number of sites in the Truth Call Set for \"\n            \"which there is no path through the Query Call Set that is consistent \"\n            \"with all of the alleles at this site, or sites for which there is an \"\n            \"inaccurate genotype call for the event. Sites with correct variant but\"\n            \" incorrect genotype are counted here.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    truthFN__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_truthFN\", title=\"Extension field for ``truthFN``.\"\n    )\n\n    truthTP: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"truthTP\",\n        title=\"True positives from the perspective of the truth data\",\n        description=(\n            \"True positives, from the perspective of the truth data, i.e. the \"\n            \"number of sites in the Truth Call Set for which there are paths \"\n            \"through the Query Call Set that are consistent with all of the alleles\"\n            \" at this site, and for which there is an accurate genotype call for \"\n            \"the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    truthTP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_truthTP\", title=\"Extension field for ``truthTP``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"indel | snp | unknown\",\n        description=\"INDEL / SNP / Undefined variant.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"indel\", \"snp\", \"unknown\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequenceQuality`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"standardSequence\",\n            \"start\",\n            \"end\",\n            \"score\",\n            \"method\",\n            \"truthTP\",\n            \"queryTP\",\n            \"truthFN\",\n            \"queryFP\",\n            \"gtFP\",\n            \"precision\",\n            \"recall\",\n            \"fScore\",\n            \"roc\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequenceQuality`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"standardSequence\",\n            \"start\",\n            \"end\",\n            \"score\",\n            \"method\",\n            \"truthTP\",\n            \"queryTP\",\n            \"truthFN\",\n            \"queryFP\",\n            \"gtFP\",\n            \"precision\",\n            \"recall\",\n            \"fScore\",\n            \"roc\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass MolecularSequenceQualityRoc(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Receiver Operator Characteristic (ROC) Curve.\n    Receiver Operator Characteristic (ROC) Curve  to give\n    sensitivity/specificity tradeoff.\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequenceQualityRoc\"\n\n    fMeasure: typing.List[fhirtypes.DecimalType | None] | None = Field(\n        default=None,\n        alias=\"fMeasure\",\n        title=\"FScore of the GQ score\",\n        description=(\n            'Calculated fScore if the GQ score threshold was set to \"score\" field '\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fMeasure__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_fMeasure\", title=\"Extension field for ``fMeasure``.\"\n    )\n\n    numFN: typing.List[fhirtypes.IntegerType | None] | None = Field(\n        default=None,\n        alias=\"numFN\",\n        title=\"Roc score false negative numbers\",\n        description=(\n            \"The number of false negatives if the GQ score threshold was set to \"\n            '\"score\" field value.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numFN__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_numFN\", title=\"Extension field for ``numFN``.\"\n    )\n\n    numFP: typing.List[fhirtypes.IntegerType | None] | None = Field(\n        default=None,\n        alias=\"numFP\",\n        title=\"Roc score false positive numbers\",\n        description=(\n            \"The number of false positives if the GQ score threshold was set to \"\n            '\"score\" field value.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numFP__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_numFP\", title=\"Extension field for ``numFP``.\"\n    )\n\n    numTP: typing.List[fhirtypes.IntegerType | None] | None = Field(\n        default=None,\n        alias=\"numTP\",\n        title=\"Roc score true positive numbers\",\n        description=(\n            \"The number of true positives if the GQ score threshold was set to \"\n            '\"score\" field value.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numTP__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_numTP\", title=\"Extension field for ``numTP``.\"\n    )\n\n    precision: typing.List[fhirtypes.DecimalType | None] | None = Field(\n        default=None,\n        alias=\"precision\",\n        title=\"Precision of the GQ score\",\n        description=(\n            'Calculated precision if the GQ score threshold was set to \"score\" '\n            \"field value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    precision__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_precision\", title=\"Extension field for ``precision``.\"\n    )\n\n    score: typing.List[fhirtypes.IntegerType | None] | None = Field(\n        default=None,\n        alias=\"score\",\n        title=\"Genotype quality score\",\n        description=(\n            \"Invidual data point representing the GQ (genotype quality) score \"\n            \"threshold.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    score__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_score\", title=\"Extension field for ``score``.\"\n    )\n\n    sensitivity: typing.List[fhirtypes.DecimalType | None] | None = Field(\n        default=None,\n        alias=\"sensitivity\",\n        title=\"Sensitivity of the GQ score\",\n        description=(\n            'Calculated sensitivity if the GQ score threshold was set to \"score\" '\n            \"field value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sensitivity__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_sensitivity\", title=\"Extension field for ``sensitivity``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequenceQualityRoc`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"score\",\n            \"numTP\",\n            \"numFP\",\n            \"numFN\",\n            \"precision\",\n            \"sensitivity\",\n            \"fMeasure\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequenceQualityRoc`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"score\",\n            \"numTP\",\n            \"numFP\",\n            \"numFN\",\n            \"precision\",\n            \"sensitivity\",\n            \"fMeasure\",\n        ]\n\n\nclass MolecularSequenceReferenceSeq(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A sequence used as reference.\n    A sequence that is used as a reference to describe variants that are\n    present in a sequence analyzed.\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequenceReferenceSeq\"\n\n    chromosome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"chromosome\",\n        title=\"Chromosome containing genetic finding\",\n        description=(\n            \"Structural unit composed of a nucleic acid molecule which controls its\"\n            \" own replication through the interaction of specific proteins at one \"\n            \"or more origins of replication ([SO:0000340](http://www.sequenceontolo\"\n            \"gy.org/browser/current_svn/term/SO:0000340)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    genomeBuild: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"genomeBuild\",\n        title=(\n            \"The Genome Build used for reference, following GRCh build versions \"\n            \"e.g. 'GRCh 37'\"\n        ),\n        description=(\n            \"The Genome Build used for reference, following GRCh build versions \"\n            \"e.g. 'GRCh 37'.  Version number must be included if a versioned \"\n            \"release of a primary build was used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    genomeBuild__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_genomeBuild\", title=\"Extension field for ``genomeBuild``.\"\n    )\n\n    orientation: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"orientation\",\n        title=\"sense | antisense\",\n        description=(\n            \"A relative reference to a DNA strand based on gene orientation. The \"\n            'strand that contains the open reading frame of the gene is the \"sense\"'\n            ' strand, and the opposite complementary strand is the \"antisense\" '\n            \"strand.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"sense\", \"antisense\"],\n        },\n    )\n    orientation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_orientation\", title=\"Extension field for ``orientation``.\"\n    )\n\n    referenceSeqId: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"referenceSeqId\",\n        title=\"Reference identifier\",\n        description=(\n            \"Reference identifier of reference sequence submitted to NCBI. It must \"\n            \"match the type in the MolecularSequence.type field. For example, the \"\n            \"prefix, \\u201cNG_\\u201d identifies reference sequence for genes, \\u201cNM_\\u201d for \"\n            \"messenger RNA transcripts, and \\u201cNP_\\u201d for amino acid sequences.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    referenceSeqPointer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referenceSeqPointer\",\n        title=\"A pointer to another MolecularSequence entity as reference sequence\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MolecularSequence\"],\n        },\n    )\n\n    referenceSeqString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"referenceSeqString\",\n        title=\"A string to represent reference sequence\",\n        description='A string like \"ACGT\".',\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    referenceSeqString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_referenceSeqString\",\n        title=\"Extension field for ``referenceSeqString``.\",\n    )\n\n    strand: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"strand\",\n        title=\"watson | crick\",\n        description=(\n            \"An absolute reference to a strand. The Watson strand is the strand \"\n            \"whose 5'-end is on the short arm of the chromosome, and the Crick \"\n            \"strand as the one whose 5'-end is on the long arm.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"watson\", \"crick\"],\n        },\n    )\n    strand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_strand\", title=\"Extension field for ``strand``.\"\n    )\n\n    windowEnd: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"windowEnd\",\n        title=\"End position of the window on the reference sequence\",\n        description=(\n            \"End position of the window on the reference sequence. If the \"\n            \"coordinate system is 0-based then end is exclusive and does not \"\n            \"include the last position. If the coordinate system is 1-base, then \"\n            \"end is inclusive and includes the last position.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    windowEnd__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_windowEnd\", title=\"Extension field for ``windowEnd``.\"\n    )\n\n    windowStart: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"windowStart\",\n        title=\"Start position of the window on the  reference sequence\",\n        description=(\n            \"Start position of the window on the reference sequence. If the \"\n            \"coordinate system is either 0-based or 1-based, then start position is\"\n            \" inclusive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    windowStart__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_windowStart\", title=\"Extension field for ``windowStart``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequenceReferenceSeq`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"chromosome\",\n            \"genomeBuild\",\n            \"orientation\",\n            \"referenceSeqId\",\n            \"referenceSeqPointer\",\n            \"referenceSeqString\",\n            \"strand\",\n            \"windowStart\",\n            \"windowEnd\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequenceReferenceSeq`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"chromosome\",\n            \"genomeBuild\",\n            \"orientation\",\n            \"referenceSeqId\",\n            \"referenceSeqPointer\",\n            \"referenceSeqString\",\n            \"strand\",\n            \"windowStart\",\n            \"windowEnd\",\n        ]\n\n\nclass MolecularSequenceRepository(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    External repository which contains detailed report related with observedSeq\n    in this resource.\n    Configurations of the external repository. The repository shall store\n    target's observedSeq or records related with target's observedSeq.\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequenceRepository\"\n\n    datasetId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"datasetId\",\n        title=\"Id of the dataset that used to call for dataset in repository\",\n        description=(\n            \"Id of the variant in this external repository. The server will \"\n            \"understand how to use this id to call for more info about datasets in \"\n            \"external repository.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    datasetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_datasetId\", title=\"Extension field for ``datasetId``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Repository's name\",\n        description=(\n            \"URI of an external repository which contains further details about the\"\n            \" genetics data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    readsetId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"readsetId\",\n        title=\"Id of the read\",\n        description=\"Id of the read in this external repository.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    readsetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_readsetId\", title=\"Extension field for ``readsetId``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"directlink | openapi | login | oauth | other\",\n        description=(\n            \"Click and see / RESTful API / Need login to see / RESTful API with \"\n            \"authentication / Other ways to see resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"directlink\", \"openapi\", \"login\", \"oauth\", \"other\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"URI of the repository\",\n        description=(\n            \"URI of an external repository which contains further details about the\"\n            \" genetics data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    variantsetId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"variantsetId\",\n        title=\"Id of the variantset that used to call for variantset in repository\",\n        description=(\n            \"Id of the variantset in this external repository. The server will \"\n            \"understand how to use this id to call for more info about variantsets \"\n            \"in external repository.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    variantsetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_variantsetId\",\n        title=\"Extension field for ``variantsetId``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequenceRepository`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"url\",\n            \"name\",\n            \"datasetId\",\n            \"variantsetId\",\n            \"readsetId\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequenceRepository`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"url\",\n            \"name\",\n            \"datasetId\",\n            \"variantsetId\",\n            \"readsetId\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass MolecularSequenceStructureVariant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Structural variant.\n    Information about chromosome structure variation.\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequenceStructureVariant\"\n\n    exact: bool | None = Field(\n        default=None,\n        alias=\"exact\",\n        title=\"Does the structural variant have base pair resolution breakpoints?\",\n        description=(\n            \"Used to indicate if the outer and inner start-end values have the same\"\n            \" meaning.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    exact__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_exact\", title=\"Extension field for ``exact``.\"\n    )\n\n    inner: fhirtypes.MolecularSequenceStructureVariantInnerType | None = Field(\n        default=None,\n        alias=\"inner\",\n        title=\"Structural variant inner\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    length: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"length\",\n        title=\"Structural variant length\",\n        description=\"Length of the variant chromosome.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    length__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_length\", title=\"Extension field for ``length``.\"\n    )\n\n    outer: fhirtypes.MolecularSequenceStructureVariantOuterType | None = Field(\n        default=None,\n        alias=\"outer\",\n        title=\"Structural variant outer\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    variantType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"variantType\",\n        title=\"Structural variant change type\",\n        description=\"Information about chromosome structure variation DNA change type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequenceStructureVariant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"variantType\",\n            \"exact\",\n            \"length\",\n            \"outer\",\n            \"inner\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequenceStructureVariant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"variantType\", \"exact\", \"length\", \"outer\", \"inner\"]\n\n\nclass MolecularSequenceStructureVariantInner(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Structural variant inner.\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequenceStructureVariantInner\"\n\n    end: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"Structural variant inner end\",\n        description=(\n            \"Structural variant inner end. If the coordinate system is 0-based then\"\n            \" end is exclusive and does not include the last position. If the \"\n            \"coordinate system is 1-base, then end is inclusive and includes the \"\n            \"last position.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    start: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Structural variant inner start\",\n        description=(\n            \"Structural variant inner start. If the coordinate system is either \"\n            \"0-based or 1-based, then start position is inclusive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequenceStructureVariantInner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"start\", \"end\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequenceStructureVariantInner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"start\", \"end\"]\n\n\nclass MolecularSequenceStructureVariantOuter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Structural variant outer.\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequenceStructureVariantOuter\"\n\n    end: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"Structural variant outer end\",\n        description=(\n            \"Structural variant outer end. If the coordinate system is 0-based then\"\n            \" end is exclusive and does not include the last position. If the \"\n            \"coordinate system is 1-base, then end is inclusive and includes the \"\n            \"last position.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    start: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Structural variant outer start\",\n        description=(\n            \"Structural variant outer start. If the coordinate system is either \"\n            \"0-based or 1-based, then start position is inclusive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequenceStructureVariantOuter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"start\", \"end\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequenceStructureVariantOuter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"start\", \"end\"]\n\n\nclass MolecularSequenceVariant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Variant in sequence.\n    The definition of variant here originates from Sequence ontology ([variant_\n    of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)).\n    This element can represent amino acid or nucleic sequence change(including\n    insertion,deletion,SNP,etc.)  It can represent some complex mutation or\n    segment variation with the assist of CIGAR string.\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequenceVariant\"\n\n    cigar: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"cigar\",\n        title=\"Extended CIGAR string for aligning the sequence with reference bases\",\n        description=(\n            \"Extended CIGAR string for aligning the sequence with reference bases. \"\n            \"See detailed documentation [here](http://support.illumina.com/help/Seq\"\n            \"uencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/\"\n            \"CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    cigar__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_cigar\", title=\"Extension field for ``cigar``.\"\n    )\n\n    end: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"End position of the variant on the reference sequence\",\n        description=(\n            \"End position of the variant on the reference sequence. If the \"\n            \"coordinate system is 0-based then end is exclusive and does not \"\n            \"include the last position. If the coordinate system is 1-base, then \"\n            \"end is inclusive and includes the last position.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    observedAllele: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"observedAllele\",\n        title=\"Allele that was observed\",\n        description=(\n            \"An allele is one of a set of coexisting sequence variants of a gene ([\"\n            \"SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/S\"\n            \"O:0001023)).  Nucleotide(s)/amino acids from start position of \"\n            \"sequence to stop position of sequence on the positive (+) strand of \"\n            \"the observed  sequence. When the sequence  type is DNA, it should be \"\n            \"the sequence on the positive (+) strand. This will lay in the range \"\n            \"between variant.start and variant.end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    observedAllele__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_observedAllele\",\n        title=\"Extension field for ``observedAllele``.\",\n    )\n\n    referenceAllele: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"referenceAllele\",\n        title=\"Allele in the reference sequence\",\n        description=(\n            \"An allele is one of a set of coexisting sequence variants of a gene ([\"\n            \"SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/S\"\n            \"O:0001023)). Nucleotide(s)/amino acids from start position of sequence\"\n            \" to stop position of sequence on the positive (+) strand of the \"\n            \"reference sequence. When the sequence  type is DNA, it should be the \"\n            \"sequence on the positive (+) strand. This will lay in the range \"\n            \"between variant.start and variant.end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    referenceAllele__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_referenceAllele\",\n        title=\"Extension field for ``referenceAllele``.\",\n    )\n\n    start: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Start position of the variant on the  reference sequence\",\n        description=(\n            \"Start position of the variant on the  reference sequence. If the \"\n            \"coordinate system is either 0-based or 1-based, then start position is\"\n            \" inclusive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    variantPointer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"variantPointer\",\n        title=\"Pointer to observed variant information\",\n        description=\"A pointer to an Observation containing variant information.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequenceVariant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"start\",\n            \"end\",\n            \"observedAllele\",\n            \"referenceAllele\",\n            \"cigar\",\n            \"variantPointer\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequenceVariant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"start\",\n            \"end\",\n            \"observedAllele\",\n            \"referenceAllele\",\n            \"cigar\",\n            \"variantPointer\",\n        ]\n"
  },
  {
    "path": "fhir/resources/R4B/money.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Money\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Money(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An amount of economic utility in some recognized currency.\n    \"\"\"\n\n    __resource_type__ = \"Money\"\n\n    currency: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"currency\",\n        title=\"ISO 4217 Currency Code\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    currency__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_currency\", title=\"Extension field for ``currency``.\"\n    )\n\n    value: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Numerical value (with implicit precision)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Money`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"currency\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Money`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"currency\"]\n"
  },
  {
    "path": "fhir/resources/R4B/namingsystem.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NamingSystem\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass NamingSystem(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    System of unique identification.\n    A curated namespace that issues unique symbols within that namespace for\n    the identification of concepts, people, devices, etc.  Represents a\n    \"System\" used within the Identifier and Coding data types.\n    \"\"\"\n\n    __resource_type__ = \"NamingSystem\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the naming system was published. \"\n            \"The date must change when the business version changes and it must \"\n            \"change if the status code changes. In addition, it should change when \"\n            \"the substantive content of the naming system changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the naming system\",\n        description=(\n            \"A free text natural language description of the naming system from a \"\n            \"consumer's perspective. Details about what the namespace identifies \"\n            \"including scope, granularity, version labeling, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for naming system (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the naming system is intended to\"\n            \" be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"codesystem | identifier | root\",\n        description=(\n            \"Indicates the purpose for the naming system - what kinds of things \"\n            \"does it make unique?\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"codesystem\", \"identifier\", \"root\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this naming system (computer friendly)\",\n        description=(\n            \"A natural language name identifying the naming system. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the naming \"\n            \"system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    responsible: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Who maintains system namespace?\",\n        description=(\n            \"The name of the organization that is responsible for issuing \"\n            \"identifiers or codes for this namespace and ensuring their non-\"\n            \"collision.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_responsible\", title=\"Extension field for ``responsible``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this naming system. Enables tracking the life-cycle of \"\n            \"the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"e.g. driver,  provider,  patient, bank etc.\",\n        description=(\n            \"Categorizes a naming system for easier search by grouping related \"\n            \"naming systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    uniqueId: typing.List[fhirtypes.NamingSystemUniqueIdType] = Field(\n        default=...,\n        alias=\"uniqueId\",\n        title=\"Unique identifiers used for system\",\n        description=(\n            \"Indicates how the system may be identified when referenced in \"\n            \"electronic exchange.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"How/where is it used\",\n        description=(\n            \"Provides guidance on the use of the namespace, including the handling \"\n            \"of formatting characters, use of upper vs. lower case, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate naming system instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NamingSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"status\",\n            \"kind\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"responsible\",\n            \"type\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"usage\",\n            \"uniqueId\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NamingSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"name\",\n            \"status\",\n            \"kind\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"uniqueId\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"date\", \"date__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass NamingSystemUniqueId(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Unique identifiers used for system.\n    Indicates how the system may be identified when referenced in electronic\n    exchange.\n    \"\"\"\n\n    __resource_type__ = \"NamingSystemUniqueId\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Notes about identifier usage\",\n        description=\"Notes about the past or intended usage of this identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When is identifier valid?\",\n        description=(\n            \"Identifies the period of time over which this identifier is considered\"\n            \" appropriate to refer to the naming system.  Outside of this window, \"\n            \"the identifier might be non-deterministic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preferred: bool | None = Field(\n        default=None,\n        alias=\"preferred\",\n        title=\"Is this the id that should be used for this type\",\n        description=(\n            'Indicates whether this identifier is the \"preferred\" identifier of '\n            \"this type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preferred\", title=\"Extension field for ``preferred``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"oid | uuid | uri | other\",\n        description=(\n            \"Identifies the unique identifier scheme used for this particular \"\n            \"identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"oid\", \"uuid\", \"uri\", \"other\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The unique identifier\",\n        description=(\n            \"The string that should be sent over the wire to identify the code \"\n            \"system or identifier system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NamingSystemUniqueId`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"value\",\n            \"preferred\",\n            \"comment\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NamingSystemUniqueId`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"value\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/narrative.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Narrative\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Narrative(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Human-readable summary of the resource (essential clinical and business\n    information).\n    A human-readable summary of the resource conveying the essential clinical\n    and business information for the resource.\n    \"\"\"\n\n    __resource_type__ = \"Narrative\"\n\n    div: fhirtypes.XhtmlType | None = Field(\n        default=None,\n        alias=\"div\",\n        title=\"Limited xhtml content\",\n        description=\"The actual narrative content, a stripped down version of XHTML.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    div__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_div\", title=\"Extension field for ``div``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"generated | extensions | additional | empty\",\n        description=(\n            \"The status of the narrative - whether it's entirely generated (from \"\n            \"just the defined data or the extensions too), or whether a human \"\n            \"authored it and it may contain additional data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"generated\", \"extensions\", \"additional\", \"empty\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Narrative`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"status\", \"div\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Narrative`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"div\", \"div__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/nutritionorder.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NutritionOrder\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass NutritionOrder(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Diet, formula or nutritional supplement request.\n    A request to supply a diet, formula feeding (enteral) or oral nutritional\n    supplement to a patient/resident.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrder\"\n\n    allergyIntolerance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"allergyIntolerance\",\n        title=(\n            \"List of the patient's food and nutrition-related allergies and \"\n            \"intolerances\"\n        ),\n        description=(\n            \"A link to a record of allergies or intolerances  which should be \"\n            \"included in the nutrition order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"AllergyIntolerance\"],\n        },\n    )\n\n    dateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateTime\",\n        title=\"Date and time the nutrition order was requested\",\n        description=\"The date and time that this nutrition order was requested.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    dateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dateTime\", title=\"Extension field for ``dateTime``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"The encounter associated with this nutrition order\",\n        description=(\n            \"An encounter that provides additional information about the healthcare\"\n            \" context in which this request is made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    enteralFormula: fhirtypes.NutritionOrderEnteralFormulaType | None = Field(\n        default=None,\n        alias=\"enteralFormula\",\n        title=\"Enteral formula components\",\n        description=(\n            \"Feeding provided through the gastrointestinal tract via a tube, \"\n            \"catheter, or stoma that delivers nutrition distal to the oral cavity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    excludeFoodModifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"excludeFoodModifier\",\n        title=(\n            \"Order-specific modifier about the type of food that should not be \" \"given\"\n        ),\n        description=(\n            \"This modifier is used to convey Order-specific modifier about the type\"\n            \" of oral food or oral fluids that should not be given. These can be \"\n            \"derived from patient allergies, intolerances, or preferences such as \"\n            \"No Red Meat, No Soy or No Wheat or  Gluten-Free.  While it should not \"\n            \"be necessary to repeat allergy or intolerance information captured in \"\n            \"the referenced AllergyIntolerance resource in the excludeFoodModifier,\"\n            \" this element may be used to convey additional specificity related to \"\n            \"foods that should be eliminated from the patient\\u2019s diet for any \"\n            \"reason.  This modifier applies to the entire nutrition order inclusive\"\n            \" of the oral diet, nutritional supplements and enteral formula \"\n            \"feedings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    foodPreferenceModifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"foodPreferenceModifier\",\n        title=\"Order-specific modifier about the type of food that should be given\",\n        description=(\n            \"This modifier is used to convey order-specific modifiers about the \"\n            \"type of food that should be given. These can be derived from patient \"\n            \"allergies, intolerances, or preferences such as Halal, Vegan or \"\n            \"Kosher. This modifier applies to the entire nutrition order inclusive \"\n            \"of the oral diet, nutritional supplements and enteral formula \"\n            \"feedings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers assigned to this order\",\n        description=(\n            \"Identifiers assigned to this order by the order sender or by the order\"\n            \" receiver.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instantiates: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiates\",\n        title=\"Instantiates protocol or definition\",\n        description=(\n            \"The URL pointing to a protocol, guideline, orderset or other \"\n            \"definition that is adhered to in whole or in part by this \"\n            \"NutritionOrder.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    instantiates__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiates\",\n        title=\"Extension field for ``instantiates``.\",\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"NutritionOrder.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this NutritionOrder.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"proposal | plan | directive | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            \"Indicates the level of authority/intentionality associated with the \"\n            \"NutrionOrder and where the request fits into the workflow chain.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposal\",\n                \"plan\",\n                \"directive\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments\",\n        description=(\n            \"Comments made about the {{title}} by the requester, performer, subject\"\n            \" or other participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    oralDiet: fhirtypes.NutritionOrderOralDietType | None = Field(\n        default=None,\n        alias=\"oralDiet\",\n        title=\"Oral diet components\",\n        description=\"Diet given orally in contrast to enteral (tube) feeding.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    orderer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"orderer\",\n        title=\"Who ordered the diet, formula or nutritional supplement\",\n        description=(\n            \"The practitioner that holds legal responsibility for ordering the \"\n            \"diet, nutritional supplement, or formula feedings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The person who requires the diet, formula or nutritional supplement\",\n        description=(\n            \"The person (patient) who needs the nutrition order for an oral diet, \"\n            \"nutritional supplement and/or enteral or formula feeding.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | on-hold | revoked | completed | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=\"The workflow status of the nutrition order/request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"on-hold\",\n                \"revoked\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    supplement: typing.List[fhirtypes.NutritionOrderSupplementType] | None = Field(\n        default=None,\n        alias=\"supplement\",\n        title=\"Supplement components\",\n        description=(\n            \"Oral nutritional products given in order to add further nutritional \"\n            \"value to the patient's diet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrder`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"instantiates\",\n            \"status\",\n            \"intent\",\n            \"patient\",\n            \"encounter\",\n            \"dateTime\",\n            \"orderer\",\n            \"allergyIntolerance\",\n            \"foodPreferenceModifier\",\n            \"excludeFoodModifier\",\n            \"oralDiet\",\n            \"supplement\",\n            \"enteralFormula\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrder`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"status\",\n            \"intent\",\n            \"patient\",\n            \"dateTime\",\n            \"orderer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"dateTime\", \"dateTime__ext\"),\n            (\"intent\", \"intent__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass NutritionOrderEnteralFormula(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Enteral formula components.\n    Feeding provided through the gastrointestinal tract via a tube, catheter,\n    or stoma that delivers nutrition distal to the oral cavity.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderEnteralFormula\"\n\n    additiveProductName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"additiveProductName\",\n        title=\"Product or brand name of the modular additive\",\n        description=(\n            \"The product or brand name of the type of modular component to be added\"\n            \" to the formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    additiveProductName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_additiveProductName\",\n        title=\"Extension field for ``additiveProductName``.\",\n    )\n\n    additiveType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"additiveType\",\n        title=\"Type of modular component to add to the feeding\",\n        description=(\n            \"Indicates the type of modular component such as protein, carbohydrate,\"\n            \" fat or fiber to be provided in addition to or mixed with the base \"\n            \"formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    administration: typing.List[\n        fhirtypes.NutritionOrderEnteralFormulaAdministrationType\n    ] | None = Field(\n        default=None,\n        alias=\"administration\",\n        title=\"Formula feeding instruction as structured data\",\n        description=(\n            \"Formula administration instructions as structured data.  This \"\n            \"repeating structure allows for changing the administration rate or \"\n            \"volume over time for both bolus and continuous feeding.  An example of\"\n            \" this would be an instruction to increase the rate of continuous \"\n            \"feeding every 2 hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    administrationInstruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"administrationInstruction\",\n        title=\"Formula feeding instructions expressed as text\",\n        description=(\n            \"Free text formula administration, feeding instructions or additional \"\n            \"instructions or information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    administrationInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_administrationInstruction\",\n        title=\"Extension field for ``administrationInstruction``.\",\n    )\n\n    baseFormulaProductName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"baseFormulaProductName\",\n        title=\"Product or brand name of the enteral or infant formula\",\n        description=(\n            \"The product or brand name of the enteral or infant formula product \"\n            'such as \"ACME Adult Standard Formula\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    baseFormulaProductName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_baseFormulaProductName\",\n        title=\"Extension field for ``baseFormulaProductName``.\",\n    )\n\n    baseFormulaType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"baseFormulaType\",\n        title=\"Type of enteral or infant formula\",\n        description=(\n            \"The type of enteral or infant formula such as an adult standard \"\n            \"formula with fiber or a soy-based infant formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    caloricDensity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"caloricDensity\",\n        title=\"Amount of energy per specified volume that is required\",\n        description=(\n            \"The amount of energy (calories) that the formula should provide per \"\n            \"specified volume, typically per mL or fluid oz.  For example, an \"\n            \"infant may require a formula that provides 24 calories per fluid ounce\"\n            \" or an adult may require an enteral formula that provides 1.5 \"\n            \"calorie/mL.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    maxVolumeToDeliver: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxVolumeToDeliver\",\n        title=\"Upper limit on formula volume per unit of time\",\n        description=(\n            \"The maximum total quantity of formula that may be administered to a \"\n            \"subject over the period of time, e.g. 1440 mL over 24 hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    routeofAdministration: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"routeofAdministration\",\n        title=\"How the formula should enter the patient's gastrointestinal tract\",\n        description=(\n            \"The route or physiological path of administration into the patient's \"\n            \"gastrointestinal  tract for purposes of providing the formula feeding,\"\n            \" e.g. nasogastric tube.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderEnteralFormula`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"baseFormulaType\",\n            \"baseFormulaProductName\",\n            \"additiveType\",\n            \"additiveProductName\",\n            \"caloricDensity\",\n            \"routeofAdministration\",\n            \"administration\",\n            \"maxVolumeToDeliver\",\n            \"administrationInstruction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormula`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"baseFormulaType\", \"administrationInstruction\"]\n\n\nclass NutritionOrderEnteralFormulaAdministration(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Formula feeding instruction as structured data.\n    Formula administration instructions as structured data.  This repeating\n    structure allows for changing the administration rate or volume over time\n    for both bolus and continuous feeding.  An example of this would be an\n    instruction to increase the rate of continuous feeding every 2 hours.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderEnteralFormulaAdministration\"\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"The volume of formula to provide\",\n        description=(\n            \"The volume of formula to provide to the patient per the specified \"\n            \"administration schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rateQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"rateQuantity\",\n        title=\"Speed with which the formula is provided per period of time\",\n        description=(\n            \"The rate of administration of formula via a feeding pump, e.g. 60 mL \"\n            \"per hour, according to the specified schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"rateRatio\",\n        title=\"Speed with which the formula is provided per period of time\",\n        description=(\n            \"The rate of administration of formula via a feeding pump, e.g. 60 mL \"\n            \"per hour, according to the specified schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    schedule: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"schedule\",\n        title=\"Scheduled frequency of enteral feeding\",\n        description=(\n            \"The time period and frequency at which the enteral formula should be \"\n            \"delivered to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderEnteralFormulaAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"schedule\",\n            \"quantity\",\n            \"rateQuantity\",\n            \"rateRatio\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormulaAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"rate\": [\"rateQuantity\", \"rateRatio\"]}\n        return one_of_many_fields\n\n\nclass NutritionOrderOralDiet(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Oral diet components.\n    Diet given orally in contrast to enteral (tube) feeding.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderOralDiet\"\n\n    fluidConsistencyType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"fluidConsistencyType\",\n        title=\"The required consistency of fluids and liquids provided to the patient\",\n        description=(\n            \"The required consistency (e.g. honey-thick, nectar-thick, thin, \"\n            \"thickened.) of liquids or fluids served to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"instruction\",\n        title=\"Instructions or additional information about the oral diet\",\n        description=(\n            \"Free text or additional instructions or information pertaining to the \"\n            \"oral diet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_instruction\", title=\"Extension field for ``instruction``.\"\n    )\n\n    nutrient: typing.List[fhirtypes.NutritionOrderOralDietNutrientType] | None = Field(\n        default=None,\n        alias=\"nutrient\",\n        title=\"Required  nutrient modifications\",\n        description=(\n            \"Class that defines the quantity and type of nutrient modifications \"\n            \"(for example carbohydrate, fiber or sodium) required for the oral \"\n            \"diet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    schedule: typing.List[fhirtypes.TimingType] | None = Field(\n        default=None,\n        alias=\"schedule\",\n        title=\"Scheduled frequency of diet\",\n        description=(\n            \"The time period and frequency at which the diet should be given.  The \"\n            \"diet should be given for the combination of all schedules if more than\"\n            \" one schedule is present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    texture: typing.List[fhirtypes.NutritionOrderOralDietTextureType] | None = Field(\n        default=None,\n        alias=\"texture\",\n        title=\"Required  texture modifications\",\n        description=(\n            \"Class that describes any texture modifications required for the \"\n            \"patient to safely consume various types of solid foods.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Type of oral diet or diet restrictions that describe what can be \"\n            \"consumed orally\"\n        ),\n        description=(\n            \"The kind of diet or dietary restriction such as fiber restricted diet \"\n            \"or diabetic diet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderOralDiet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"schedule\",\n            \"nutrient\",\n            \"texture\",\n            \"fluidConsistencyType\",\n            \"instruction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDiet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"instruction\"]\n\n\nclass NutritionOrderOralDietNutrient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Required  nutrient modifications.\n    Class that defines the quantity and type of nutrient modifications (for\n    example carbohydrate, fiber or sodium) required for the oral diet.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderOralDietNutrient\"\n\n    amount: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Quantity of the specified nutrient\",\n        description=\"The quantity of the specified nutrient to include in diet.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifier: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Type of nutrient that is being modified\",\n        description=\"The nutrient that is being modified such as carbohydrate or sodium.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderOralDietNutrient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"modifier\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietNutrient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionOrderOralDietTexture(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Required  texture modifications.\n    Class that describes any texture modifications required for the patient to\n    safely consume various types of solid foods.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderOralDietTexture\"\n\n    foodType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"foodType\",\n        title=(\n            \"Concepts that are used to identify an entity that is ingested for \"\n            \"nutritional purposes\"\n        ),\n        description=(\n            \"The food type(s) (e.g. meats, all foods)  that the texture \"\n            \"modification applies to.  This could be all foods types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifier: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Code to indicate how to alter the texture of the foods, e.g. pureed\",\n        description=(\n            \"Any texture modifications (for solid foods) that should be made, e.g. \"\n            \"easy to chew, chopped, ground, and pureed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderOralDietTexture`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"modifier\", \"foodType\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietTexture`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionOrderSupplement(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supplement components.\n    Oral nutritional products given in order to add further nutritional value\n    to the patient's diet.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderSupplement\"\n\n    instruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"instruction\",\n        title=\"Instructions or additional information about the oral supplement\",\n        description=(\n            \"Free text or additional instructions or information pertaining to the \"\n            \"oral supplement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_instruction\", title=\"Extension field for ``instruction``.\"\n    )\n\n    productName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"productName\",\n        title=\"Product or brand name of the nutritional supplement\",\n        description=(\n            'The product or brand name of the nutritional supplement such as \"Acme '\n            'Protein Shake\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    productName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_productName\", title=\"Extension field for ``productName``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount of the nutritional supplement\",\n        description=\"The amount of the nutritional supplement to be given.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    schedule: typing.List[fhirtypes.TimingType] | None = Field(\n        default=None,\n        alias=\"schedule\",\n        title=\"Scheduled frequency of supplement\",\n        description=(\n            \"The time period and frequency at which the supplement(s) should be \"\n            \"given.  The supplement should be given for the combination of all \"\n            \"schedules if more than one schedule is present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of supplement product requested\",\n        description=(\n            \"The kind of nutritional supplement product required such as a high \"\n            \"protein or pediatric clear liquid supplement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderSupplement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"productName\",\n            \"schedule\",\n            \"quantity\",\n            \"instruction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderSupplement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"instruction\"]\n"
  },
  {
    "path": "fhir/resources/R4B/nutritionproduct.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NutritionProduct\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass NutritionProduct(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A product used for nutritional purposes.\n    A food or fluid product that is consumed by patients.\n    \"\"\"\n\n    __resource_type__ = \"NutritionProduct\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=(\n            \"A category or class of the nutrition product (halal, kosher, gluten \"\n            \"free, vegan, etc)\"\n        ),\n        description=(\n            \"Nutrition products can have different classifications - according to \"\n            \"its nutritional properties, preparation methods, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"A code designating a specific type of nutritional product\",\n        description=(\n            \"The code assigned to the product, for example a manufacturer number or\"\n            \" other terminology.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.NutritionProductIngredientType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=\"Ingredients contained in this product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instance: fhirtypes.NutritionProductInstanceType | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=(\n            \"One or several physical instances or occurrences of the nutrition \"\n            \"product\"\n        ),\n        description=(\n            \"Conveys instance-level information about this product item. One or \"\n            \"several physical, countable instances or occurrences of the product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    knownAllergen: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"knownAllergen\",\n        title=\"Known or suspected allergens that are a part of this product\",\n        description=(\n            \"Allergens that are known or suspected to be a part of this nutrition \"\n            \"product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Manufacturer, representative or officially responsible for the product\",\n        description=(\n            \"The organisation (manufacturer, representative or legal authorisation \"\n            \"holder) that is responsible for the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    nutrient: typing.List[fhirtypes.NutritionProductNutrientType] | None = Field(\n        default=None,\n        alias=\"nutrient\",\n        title=\"The product's nutritional information expressed by the nutrients\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    productCharacteristic: typing.List[\n        fhirtypes.NutritionProductProductCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"productCharacteristic\",\n        title=\"Specifies descriptive properties of the nutrition product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=\"The current state of the product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionProduct`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"manufacturer\",\n            \"nutrient\",\n            \"ingredient\",\n            \"knownAllergen\",\n            \"productCharacteristic\",\n            \"instance\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionProduct`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"manufacturer\",\n            \"nutrient\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass NutritionProductIngredient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Ingredients contained in this product.\n    \"\"\"\n\n    __resource_type__ = \"NutritionProductIngredient\"\n\n    amount: typing.List[fhirtypes.RatioType] | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"The amount of ingredient that is in the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    item: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"item\",\n        title=\"The ingredient contained in the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"NutritionProduct\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionProductIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"item\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionProductIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"item\", \"amount\"]\n\n\nclass NutritionProductInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    One or several physical instances or occurrences of the nutrition product.\n    Conveys instance-level information about this product item. One or several\n    physical, countable instances or occurrences of the product.\n    \"\"\"\n\n    __resource_type__ = \"NutritionProductInstance\"\n\n    expiry: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expiry\",\n        title=\"The expiry date or date and time for the product\",\n        description=(\n            \"The time after which the product is no longer expected to be in proper\"\n            \" condition, or its use is not advised or not allowed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expiry__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expiry\", title=\"Extension field for ``expiry``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"The identifier for the physical instance, typically a serial number\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lotNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lotNumber\",\n        title=\"The identification of the batch or lot of the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lotNumber\", title=\"Extension field for ``lotNumber``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"The amount of items or instances\",\n        description=(\n            \"The amount of items or instances that the resource considers, for \"\n            \"instance when referring to 2 identical units together.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    useBy: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"useBy\",\n        title=(\n            \"The date until which the product is expected to be good for \" \"consumption\"\n        ),\n        description=(\n            \"The time after which the product is no longer expected to be in proper\"\n            \" condition, or its use is not advised or not allowed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    useBy__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_useBy\", title=\"Extension field for ``useBy``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionProductInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"quantity\",\n            \"identifier\",\n            \"lotNumber\",\n            \"expiry\",\n            \"useBy\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionProductInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionProductNutrient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The product's nutritional information expressed by the nutrients.\n    \"\"\"\n\n    __resource_type__ = \"NutritionProductNutrient\"\n\n    amount: typing.List[fhirtypes.RatioType] | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=(\n            \"The amount of nutrient expressed in one or more units: X per pack / \"\n            \"per serving / per dose\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    item: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"The (relevant) nutrients in the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionProductNutrient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"item\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionProductNutrient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionProductProductCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifies descriptive properties of the nutrition product.\n    \"\"\"\n\n    __resource_type__ = \"NutritionProductProductCharacteristic\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Code specifying the type of characteristic\",\n        description=(\n            \"A code specifying which characteristic of the product is being \"\n            \"described (for example, colour, shape).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"The value of the characteristic\",\n        description=\"The actual characteristic value corresponding to the type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"The value of the characteristic\",\n        description=\"The actual characteristic value corresponding to the type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"The value of the characteristic\",\n        description=\"The actual characteristic value corresponding to the type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"The value of the characteristic\",\n        description=\"The actual characteristic value corresponding to the type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"The value of the characteristic\",\n        description=\"The actual characteristic value corresponding to the type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"The value of the characteristic\",\n        description=\"The actual characteristic value corresponding to the type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionProductProductCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueQuantity\",\n            \"valueBase64Binary\",\n            \"valueAttachment\",\n            \"valueBoolean\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionProductProductCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/observation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Observation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Observation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Measurements and simple assertions.\n    Measurements and simple assertions made about a patient, device or other\n    subject.\n    \"\"\"\n\n    __resource_type__ = \"Observation\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan, proposal or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this event.  For example, a MedicationRequest may require a patient to\"\n            \" have laboratory test performed before  it is dispensed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"DeviceRequest\",\n                \"ImmunizationRecommendation\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ServiceRequest\",\n            ],\n        },\n    )\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Observed body part\",\n        description=(\n            \"Indicates the site on the subject's body where the observation was \"\n            \"made (i.e. the target site).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classification of  type of observation\",\n        description=\"A code that classifies the general type of observation being made.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of observation (code / type)\",\n        description=(\n            \"Describes what was observed. Sometimes this is called the observation \"\n            '\"name\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    component: typing.List[fhirtypes.ObservationComponentType] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"Component results\",\n        description=(\n            \"Some observations have multiple component observations.  These \"\n            \"component observations are expressed as separate code value pairs that\"\n            \" share the same attributes.  Examples include systolic and diastolic \"\n            \"component observations for blood pressure measurement and multiple \"\n            \"component observations for genetics observations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dataAbsentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"dataAbsentReason\",\n        title=\"Why the result is missing\",\n        description=(\n            \"Provides a reason why the expected value in the element \"\n            \"Observation.value[x] is missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Related measurements the observation is made from\",\n        description=(\n            \"The target resource that represents a measurement from which this \"\n            \"observation value is derived. For example, a calculated anion gap or a\"\n            \" fetal measurement based on an ultrasound image.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DocumentReference\",\n                \"ImagingStudy\",\n                \"Media\",\n                \"QuestionnaireResponse\",\n                \"Observation\",\n                \"MolecularSequence\",\n            ],\n        },\n    )\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"(Measurement) Device\",\n        description=\"The device used to generate the observation data.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"DeviceMetric\"],\n        },\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"Clinically relevant time/time-period for observation\",\n        description=(\n            \"The time or time-period the observed value is asserted as being true. \"\n            \"For biological subjects - e.g. human patients - this is usually called\"\n            ' the \"physiologically relevant time\". This is usually either the time '\n            \"of the procedure or of specimen collection, but very often the source \"\n            \"of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectiveInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"effectiveInstant\",\n        title=\"Clinically relevant time/time-period for observation\",\n        description=(\n            \"The time or time-period the observed value is asserted as being true. \"\n            \"For biological subjects - e.g. human patients - this is usually called\"\n            ' the \"physiologically relevant time\". This is usually either the time '\n            \"of the procedure or of specimen collection, but very often the source \"\n            \"of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveInstant\",\n        title=\"Extension field for ``effectiveInstant``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"Clinically relevant time/time-period for observation\",\n        description=(\n            \"The time or time-period the observed value is asserted as being true. \"\n            \"For biological subjects - e.g. human patients - this is usually called\"\n            ' the \"physiologically relevant time\". This is usually either the time '\n            \"of the procedure or of specimen collection, but very often the source \"\n            \"of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    effectiveTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"effectiveTiming\",\n        title=\"Clinically relevant time/time-period for observation\",\n        description=(\n            \"The time or time-period the observed value is asserted as being true. \"\n            \"For biological subjects - e.g. human patients - this is usually called\"\n            ' the \"physiologically relevant time\". This is usually either the time '\n            \"of the procedure or of specimen collection, but very often the source \"\n            \"of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Healthcare event during which this observation is made\",\n        description=(\n            \"The healthcare event  (e.g. a patient and healthcare provider \"\n            \"interaction) during which this observation is made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    focus: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=(\n            \"What the observation is about, when it is not about the subject of \"\n            \"record\"\n        ),\n        description=(\n            \"The actual focus of an observation when it is not the patient of \"\n            \"record representing something or someone associated with the patient \"\n            \"such as a spouse, parent, fetus, or donor. For example, fetus \"\n            \"observations in a mother's record.  The focus of an observation could \"\n            \"also be an existing condition,  an intervention, the subject's diet,  \"\n            \"another observation of the subject,  or a body structure such as tumor\"\n            \" or implanted device.   An example use case would be using the \"\n            \"Observation resource to capture whether the mother is trained to \"\n            \"change her child's tracheostomy tube. In this example, the child is \"\n            \"the patient of record and the mother is the focus.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    hasMember: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"hasMember\",\n        title=\"Related resource that belongs to the Observation group\",\n        description=(\n            \"This observation is a group observation (e.g. a battery, a panel of \"\n            \"tests, a set of vital sign measurements) that includes the target as a\"\n            \" member of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Observation\",\n                \"QuestionnaireResponse\",\n                \"MolecularSequence\",\n            ],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for observation\",\n        description=\"A unique identifier assigned to this observation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    interpretation: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"interpretation\",\n        title=\"High, low, normal, etc.\",\n        description=(\n            \"A categorical assessment of an observation value.  For example, high, \"\n            \"low, normal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"Date/Time this version was made available\",\n        description=(\n            \"The date and time this version of the observation was made available \"\n            \"to providers, typically after the results have been reviewed and \"\n            \"verified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"How it was done\",\n        description=\"Indicates the mechanism used to perform the observation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the observation\",\n        description=\"Comments about the observation or the results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=(\n            \"A larger event of which this particular Observation is a component or \"\n            \"step.  For example,  an observation as part of a procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicationAdministration\",\n                \"MedicationDispense\",\n                \"MedicationStatement\",\n                \"Procedure\",\n                \"Immunization\",\n                \"ImagingStudy\",\n            ],\n        },\n    )\n\n    performer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who is responsible for the observation\",\n        description='Who was responsible for asserting the observed value as \"true\".',\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    referenceRange: typing.List[fhirtypes.ObservationReferenceRangeType] | None = Field(\n        default=None,\n        alias=\"referenceRange\",\n        title=\"Provides guide for interpretation\",\n        description=(\n            \"Guidance on how to interpret the value by comparison to a normal or \"\n            \"recommended range.  Multiple reference ranges are interpreted as an \"\n            '\"OR\".   In other words, to represent two distinct target populations, '\n            \"two `referenceRange` elements would be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specimen: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Specimen used for this observation\",\n        description=\"The specimen that was used when this observation was made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | preliminary | final | amended +\",\n        description=\"The status of the result value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"registered\", \"preliminary\", \"final\", \"amended\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who and/or what the observation is about\",\n        description=(\n            \"The patient, or group of patients, location, or device this \"\n            \"observation is about and into whose record the observation is placed. \"\n            \"If the actual focus of the observation is different from the subject \"\n            \"(or a sample of, part, or region of the subject), the `focus` element \"\n            \"or the `code` itself specifies the actual focus of the observation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Device\",\n                \"Location\",\n                \"Organization\",\n                \"Procedure\",\n                \"Practitioner\",\n                \"Medication\",\n                \"Substance\",\n            ],\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Observation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"focus\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"effectiveTiming\",\n            \"effectiveInstant\",\n            \"issued\",\n            \"performer\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueSampledData\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"dataAbsentReason\",\n            \"interpretation\",\n            \"note\",\n            \"bodySite\",\n            \"method\",\n            \"specimen\",\n            \"device\",\n            \"referenceRange\",\n            \"hasMember\",\n            \"derivedFrom\",\n            \"component\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Observation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"code\",\n            \"subject\",\n            \"focus\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"effectiveTiming\",\n            \"effectiveInstant\",\n            \"issued\",\n            \"performer\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueSampledData\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"hasMember\",\n            \"derivedFrom\",\n            \"component\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"effective\": [\n                \"effectiveDateTime\",\n                \"effectiveInstant\",\n                \"effectivePeriod\",\n                \"effectiveTiming\",\n            ],\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDateTime\",\n                \"valueInteger\",\n                \"valuePeriod\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueSampledData\",\n                \"valueString\",\n                \"valueTime\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ObservationComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Component results.\n    Some observations have multiple component observations.  These component\n    observations are expressed as separate code value pairs that share the same\n    attributes.  Examples include systolic and diastolic component observations\n    for blood pressure measurement and multiple component observations for\n    genetics observations.\n    \"\"\"\n\n    __resource_type__ = \"ObservationComponent\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of component observation (code / type)\",\n        description=(\n            \"Describes what was observed. Sometimes this is called the observation \"\n            '\"code\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dataAbsentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"dataAbsentReason\",\n        title=\"Why the component result is missing\",\n        description=(\n            \"Provides a reason why the expected value in the element \"\n            \"Observation.component.value[x] is missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    interpretation: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"interpretation\",\n        title=\"High, low, normal, etc.\",\n        description=(\n            \"A categorical assessment of an observation value.  For example, high, \"\n            \"low, normal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    referenceRange: typing.List[fhirtypes.ObservationReferenceRangeType] | None = Field(\n        default=None,\n        alias=\"referenceRange\",\n        title=\"Provides guide for interpretation of component result\",\n        description=(\n            \"Guidance on how to interpret the value by comparison to a normal or \"\n            \"recommended range.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueSampledData\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"dataAbsentReason\",\n            \"interpretation\",\n            \"referenceRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"code\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueSampledData\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDateTime\",\n                \"valueInteger\",\n                \"valuePeriod\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueSampledData\",\n                \"valueString\",\n                \"valueTime\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ObservationReferenceRange(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Provides guide for interpretation.\n    Guidance on how to interpret the value by comparison to a normal or\n    recommended range.  Multiple reference ranges are interpreted as an \"OR\".\n    In other words, to represent two distinct target populations, two\n    `referenceRange` elements would be used.\n    \"\"\"\n\n    __resource_type__ = \"ObservationReferenceRange\"\n\n    age: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"age\",\n        title=\"Applicable age range, if relevant\",\n        description=(\n            \"The age at which this reference range is applicable. This is a \"\n            \"neonatal age (e.g. number of weeks at term) if the meaning says so.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    appliesTo: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"appliesTo\",\n        title=\"Reference range population\",\n        description=(\n            \"Codes to indicate the target population this reference range applies \"\n            \"to.  For example, a reference range may be based on the normal \"\n            \"population or a particular sex or race.  Multiple `appliesTo`  are \"\n            'interpreted as an \"AND\" of the target populations.  For example, to '\n            \"represent a target population of African American females, both a code\"\n            \" of female and a code for African American would be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    high: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"high\",\n        title=\"High Range, if relevant\",\n        description=(\n            \"The value of the high bound of the reference range.  The high bound of\"\n            \" the reference range endpoint is inclusive of the value (e.g.  \"\n            \"reference range is >=5 - <=9). If the high bound is omitted,  it is \"\n            \"assumed to be meaningless (e.g. reference range is >= 2.3).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    low: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"low\",\n        title=\"Low Range, if relevant\",\n        description=(\n            \"The value of the low bound of the reference range.  The low bound of \"\n            \"the reference range endpoint is inclusive of the value (e.g.  \"\n            \"reference range is >=5 - <=9). If the low bound is omitted,  it is \"\n            \"assumed to be meaningless (e.g. reference range is <=2.3).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text based reference range in an observation\",\n        description=(\n            \"Text based reference range in an observation which may be used when a \"\n            \"quantitative range is not appropriate for an observation.  An example \"\n            'would be a reference value of \"Negative\" or a list or table of '\n            '\"normals\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Reference range qualifier\",\n        description=(\n            \"Codes to indicate the what part of the targeted reference population \"\n            \"it applies to. For example, the normal or therapeutic range.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationReferenceRange`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"low\",\n            \"high\",\n            \"type\",\n            \"appliesTo\",\n            \"age\",\n            \"text\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationReferenceRange`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/observationdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ObservationDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ObservationDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of an observation.\n    Set of definitional characteristics for a kind of observation or\n    measurement produced or consumed by an orderable health care service.\n    \"\"\"\n\n    __resource_type__ = \"ObservationDefinition\"\n\n    abnormalCodedValueSet: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"abnormalCodedValueSet\",\n        title=(\n            \"Value set of abnormal coded values for the observations conforming to \"\n            \"this ObservationDefinition\"\n        ),\n        description=(\n            \"The set of abnormal coded results for the observation conforming to \"\n            \"this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Category of observation\",\n        description=\"A code that classifies the general type of observation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of observation (code / type)\",\n        description=(\n            \"Describes what will be observed. Sometimes this is called the \"\n            'observation \"name\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    criticalCodedValueSet: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"criticalCodedValueSet\",\n        title=(\n            \"Value set of critical coded values for the observations conforming to \"\n            \"this ObservationDefinition\"\n        ),\n        description=(\n            \"The set of critical coded results for the observation conforming to \"\n            \"this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for this ObservationDefinition instance\",\n        description=\"A unique identifier assigned to this ObservationDefinition artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Method used to produce the observation\",\n        description=\"The method or technique used to perform the observation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    multipleResultsAllowed: bool | None = Field(\n        default=None,\n        alias=\"multipleResultsAllowed\",\n        title=\"Multiple results allowed\",\n        description=(\n            \"Multiple results allowed for observations conforming to this \"\n            \"ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    multipleResultsAllowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_multipleResultsAllowed\",\n        title=\"Extension field for ``multipleResultsAllowed``.\",\n    )\n\n    normalCodedValueSet: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"normalCodedValueSet\",\n        title=(\n            \"Value set of normal coded values for the observations conforming to \"\n            \"this ObservationDefinition\"\n        ),\n        description=(\n            \"The set of normal coded results for the observations conforming to \"\n            \"this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n\n    permittedDataType: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"permittedDataType\",\n        title=(\n            \"Quantity | CodeableConcept | string | boolean | integer | Range | \"\n            \"Ratio | SampledData | time | dateTime | Period\"\n        ),\n        description=(\n            \"The data types allowed for the value element of the instance \"\n            \"observations conforming to this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"Quantity\",\n                \"CodeableConcept\",\n                \"string\",\n                \"boolean\",\n                \"integer\",\n                \"Range\",\n                \"Ratio\",\n                \"SampledData\",\n                \"time\",\n                \"dateTime\",\n                \"Period\",\n            ],\n        },\n    )\n    permittedDataType__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_permittedDataType\",\n        title=\"Extension field for ``permittedDataType``.\",\n    )\n\n    preferredReportName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"preferredReportName\",\n        title=\"Preferred report name\",\n        description=(\n            \"The preferred name to be used when reporting the results of \"\n            \"observations conforming to this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preferredReportName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_preferredReportName\",\n        title=\"Extension field for ``preferredReportName``.\",\n    )\n\n    qualifiedInterval: typing.List[\n        fhirtypes.ObservationDefinitionQualifiedIntervalType\n    ] | None = Field(\n        default=None,\n        alias=\"qualifiedInterval\",\n        title=\"Qualified range for continuous and ordinal observation results\",\n        description=(\n            \"Multiple  ranges of results qualified by different contexts for \"\n            \"ordinal or continuous observations conforming to this \"\n            \"ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantitativeDetails: fhirtypes.ObservationDefinitionQuantitativeDetailsType | None = Field(\n        default=None,\n        alias=\"quantitativeDetails\",\n        title=\"Characteristics of quantitative results\",\n        description=\"Characteristics for quantitative results of this observation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    validCodedValueSet: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"validCodedValueSet\",\n        title=(\n            \"Value set of valid coded values for the observations conforming to \"\n            \"this ObservationDefinition\"\n        ),\n        description=(\n            \"The set of valid coded results for the observations  conforming to \"\n            \"this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"code\",\n            \"identifier\",\n            \"permittedDataType\",\n            \"multipleResultsAllowed\",\n            \"method\",\n            \"preferredReportName\",\n            \"quantitativeDetails\",\n            \"qualifiedInterval\",\n            \"validCodedValueSet\",\n            \"normalCodedValueSet\",\n            \"abnormalCodedValueSet\",\n            \"criticalCodedValueSet\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"category\", \"code\", \"identifier\"]\n\n\nclass ObservationDefinitionQualifiedInterval(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Qualified range for continuous and ordinal observation results.\n    Multiple  ranges of results qualified by different contexts for ordinal or\n    continuous observations conforming to this ObservationDefinition.\n    \"\"\"\n\n    __resource_type__ = \"ObservationDefinitionQualifiedInterval\"\n\n    age: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"age\",\n        title=\"Applicable age range, if relevant\",\n        description=(\n            \"The age at which this reference range is applicable. This is a \"\n            \"neonatal age (e.g. number of weeks at term) if the meaning says so.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    appliesTo: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"appliesTo\",\n        title=\"Targetted population of the range\",\n        description=(\n            \"Codes to indicate the target population this reference range applies \"\n            \"to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"reference | critical | absolute\",\n        description=(\n            \"The category of interval of values for continuous or ordinal \"\n            \"observations conforming to this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"reference\", \"critical\", \"absolute\"],\n        },\n    )\n    category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_category\", title=\"Extension field for ``category``.\"\n    )\n\n    condition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Condition associated with the reference range\",\n        description=\"Text based condition for which the reference range is valid.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_condition\", title=\"Extension field for ``condition``.\"\n    )\n\n    context: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Range context qualifier\",\n        description=(\n            \"Codes to indicate the health context the range applies to. For \"\n            \"example, the normal or therapeutic range.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=\"Sex of the population the range applies to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    gestationalAge: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"gestationalAge\",\n        title=\"Applicable gestational age range, if relevant\",\n        description=(\n            \"The gestational age to which this reference range is applicable, in \"\n            \"the context of pregnancy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    range: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"range\",\n        title=\"The interval itself, for continuous or ordinal observations\",\n        description=(\n            \"The low and high values determining the interval. There may be only \"\n            \"one of the two.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationDefinitionQualifiedInterval`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"range\",\n            \"context\",\n            \"appliesTo\",\n            \"gender\",\n            \"age\",\n            \"gestationalAge\",\n            \"condition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationDefinitionQualifiedInterval`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ObservationDefinitionQuantitativeDetails(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Characteristics of quantitative results.\n    Characteristics for quantitative results of this observation.\n    \"\"\"\n\n    __resource_type__ = \"ObservationDefinitionQuantitativeDetails\"\n\n    conversionFactor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"conversionFactor\",\n        title=\"SI to Customary unit conversion factor\",\n        description=(\n            \"Factor for converting value expressed with SI unit to value expressed \"\n            \"with customary unit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    conversionFactor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conversionFactor\",\n        title=\"Extension field for ``conversionFactor``.\",\n    )\n\n    customaryUnit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"customaryUnit\",\n        title=\"Customary unit for quantitative results\",\n        description=(\n            \"Customary unit used to report quantitative results of observations \"\n            \"conforming to this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    decimalPrecision: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"decimalPrecision\",\n        title=\"Decimal precision of observation quantitative results\",\n        description=(\n            \"Number of digits after decimal separator when the results of such \"\n            \"observations are of type Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    decimalPrecision__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_decimalPrecision\",\n        title=\"Extension field for ``decimalPrecision``.\",\n    )\n\n    unit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"SI unit for quantitative results\",\n        description=(\n            \"SI unit used to report quantitative results of observations conforming\"\n            \" to this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationDefinitionQuantitativeDetails`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"customaryUnit\",\n            \"unit\",\n            \"conversionFactor\",\n            \"decimalPrecision\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationDefinitionQuantitativeDetails`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/operationdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OperationDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass OperationDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of an operation or a named query.\n    A formal computable definition of an operation (on the RESTful interface)\n    or a named query (using the search interaction).\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinition\"\n\n    affectsState: bool | None = Field(\n        default=None,\n        alias=\"affectsState\",\n        title=\"Whether content is changed by the operation\",\n        description=(\n            \"Whether the operation affects state. Side effects such as producing \"\n            \"audit trail entries do not count as 'affecting  state'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    affectsState__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_affectsState\",\n        title=\"Extension field for ``affectsState``.\",\n    )\n\n    base: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"Marks this as a profile of the base\",\n        description=(\n            \"Indicates that this operation definition is a constraining profile on \"\n            \"the base.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationDefinition\"],\n        },\n    )\n    base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_base\", title=\"Extension field for ``base``.\"\n    )\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Name used to invoke the operation\",\n        description=\"The name used to invoke the operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    comment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Additional information about use\",\n        description=\"Additional information about how to use this operation or named query.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the operation definition was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the operation definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the operation definition\",\n        description=(\n            \"A free text natural language description of the operation definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this operation definition is authored\"\n            \" for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    inputProfile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"inputProfile\",\n        title=\"Validation information for in parameters\",\n        description=(\n            \"Additional validation information for the in parameters - a single \"\n            \"profile that covers all the parameters. The profile is a constraint on\"\n            \" the parameters resource as a whole.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    inputProfile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_inputProfile\",\n        title=\"Extension field for ``inputProfile``.\",\n    )\n\n    instance: bool | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"Invoke on an instance?\",\n        description=(\n            \"Indicates whether this operation can be invoked on a particular \"\n            \"instance of one of the given types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    instance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_instance\", title=\"Extension field for ``instance``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for operation definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the operation definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"operation | query\",\n        description=\"Whether this is an operation or a named query.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"operation\", \"query\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this operation definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the operation definition. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    outputProfile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"outputProfile\",\n        title=\"Validation information for out parameters\",\n        description=(\n            \"Additional validation information for the out parameters - a single \"\n            \"profile that covers all the parameters. The profile is a constraint on\"\n            \" the parameters resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    outputProfile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_outputProfile\",\n        title=\"Extension field for ``outputProfile``.\",\n    )\n\n    overload: typing.List[fhirtypes.OperationDefinitionOverloadType] | None = Field(\n        default=None,\n        alias=\"overload\",\n        title=\"Define overloaded variants for when  generating code\",\n        description=(\n            \"Defines an appropriate combination of parameters to use when invoking \"\n            \"this operation, to help code generators when generating overloaded \"\n            \"parameter sets for this operation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    parameter: typing.List[fhirtypes.OperationDefinitionParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Parameters for the operation/query\",\n        description=\"The parameters for the operation/query.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the \"\n            \"operation definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this operation definition is defined\",\n        description=(\n            \"Explanation of why this operation definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    resource: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Types this operation applies to\",\n        description=\"The types on which this operation can be executed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    resource__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this operation definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    system: bool | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"Invoke at the system level?\",\n        description=(\n            \"Indicates whether this operation or named query can be invoked at the \"\n            \"system level (e.g. without needing to choose a resource type for the \"\n            \"context).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this operation definition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the operation \" \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: bool | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Invoke at the type level?\",\n        description=(\n            \"Indicates whether this operation or named query can be invoked at the \"\n            \"resource type level for any given resource type level (e.g. without \"\n            \"needing to choose a specific resource id for the context).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this operation definition, represented as a \"\n            \"URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this operation definition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which at which an \"\n            \"authoritative instance of this operation definition is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the operation definition is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate operation definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the operation definition\",\n        description=(\n            \"The identifier that is used to identify this version of the operation \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the operation \"\n            \"definition author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"kind\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"affectsState\",\n            \"code\",\n            \"comment\",\n            \"base\",\n            \"resource\",\n            \"system\",\n            \"type\",\n            \"instance\",\n            \"inputProfile\",\n            \"outputProfile\",\n            \"parameter\",\n            \"overload\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"kind\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"affectsState\",\n            \"code\",\n            \"base\",\n            \"resource\",\n            \"system\",\n            \"type\",\n            \"instance\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"code\", \"code__ext\"),\n            (\"instance\", \"instance__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"system\", \"system__ext\"),\n            (\"type\", \"type__ext\"),\n        ]\n        return required_fields\n\n\nclass OperationDefinitionOverload(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Define overloaded variants for when  generating code.\n    Defines an appropriate combination of parameters to use when invoking this\n    operation, to help code generators when generating overloaded parameter\n    sets for this operation.\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinitionOverload\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments to go on overload\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    parameterName: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"parameterName\",\n        title=\"Name of parameter to include in overload\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    parameterName__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_parameterName\",\n        title=\"Extension field for ``parameterName``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinitionOverload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"parameterName\", \"comment\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinitionOverload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass OperationDefinitionParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Parameters for the operation/query.\n    The parameters for the operation/query.\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinitionParameter\"\n\n    binding: fhirtypes.OperationDefinitionParameterBindingType | None = Field(\n        default=None,\n        alias=\"binding\",\n        title=\"ValueSet details if this is coded\",\n        description=(\n            \"Binds to a value set if this parameter is coded (code, Coding, \"\n            \"CodeableConcept).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Description of meaning/use\",\n        description=\"Describes the meaning or use of this parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum Cardinality (a number or *)\",\n        description=(\n            \"The maximum number of times this element is permitted to appear in the\"\n            \" request or response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum Cardinality\",\n        description=(\n            \"The minimum number of times this parameter SHALL appear in the request\"\n            \" or response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    name: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name in Parameters.parameter.name or in URL\",\n        description=\"The name of used to identify the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    part: typing.List[fhirtypes.OperationDefinitionParameterType] | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"Parts of a nested Parameter\",\n        description=\"The parts of a nested Parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    referencedFrom: typing.List[\n        fhirtypes.OperationDefinitionParameterReferencedFromType\n    ] | None = Field(\n        default=None,\n        alias=\"referencedFrom\",\n        title=\"References to this parameter\",\n        description=(\n            \"Identifies other resource parameters within the operation invocation \"\n            \"that are expected to resolve to this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    searchType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"searchType\",\n        title=(\n            \"number | date | string | token | reference | composite | quantity | \"\n            \"uri | special\"\n        ),\n        description=(\n            \"How the parameter is understood as a search parameter. This is only \"\n            \"used if the parameter type is 'string'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"number\",\n                \"date\",\n                \"string\",\n                \"token\",\n                \"reference\",\n                \"composite\",\n                \"quantity\",\n                \"uri\",\n                \"special\",\n            ],\n        },\n    )\n    searchType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_searchType\", title=\"Extension field for ``searchType``.\"\n    )\n\n    targetProfile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"targetProfile\",\n        title=\"If type is Reference | canonical, allowed targets\",\n        description=(\n            'Used when the type is \"Reference\" or \"canonical\", and identifies a '\n            \"profile structure or implementation Guide that applies to the target \"\n            \"of the reference this parameter refers to. If any profiles are \"\n            \"specified, then the content must conform to at least one of them. The \"\n            \"URL can be a local reference - to a contained StructureDefinition, or \"\n            \"a reference to another StructureDefinition or Implementation Guide by \"\n            \"a canonical URL. When an implementation guide is specified, the target\"\n            \" resource SHALL conform to at least one profile defined in the \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    targetProfile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_targetProfile\",\n        title=\"Extension field for ``targetProfile``.\",\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"What type this parameter has\",\n        description=\"The type for this parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"in | out\",\n        description=\"Whether this is an input or an output parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"in\", \"out\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinitionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"use\",\n            \"min\",\n            \"max\",\n            \"documentation\",\n            \"type\",\n            \"targetProfile\",\n            \"searchType\",\n            \"binding\",\n            \"referencedFrom\",\n            \"part\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"max\", \"max__ext\"),\n            (\"min\", \"min__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"use\", \"use__ext\"),\n        ]\n        return required_fields\n\n\nclass OperationDefinitionParameterBinding(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    ValueSet details if this is coded.\n    Binds to a value set if this parameter is coded (code, Coding,\n    CodeableConcept).\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinitionParameterBinding\"\n\n    strength: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"strength\",\n        title=\"required | extensible | preferred | example\",\n        description=(\n            \"Indicates the degree of conformance expectations associated with this \"\n            \"binding - that is, the degree to which the provided value set must be \"\n            \"adhered to in the instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"required\", \"extensible\", \"preferred\", \"example\"],\n        },\n    )\n    strength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_strength\", title=\"Extension field for ``strength``.\"\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Source of value set\",\n        description=(\n            \"Points to the value set or external definition (e.g. implicit value \"\n            \"set) that identifies the set of codes to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinitionParameterBinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"strength\", \"valueSet\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameterBinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"strength\", \"strength__ext\"), (\"valueSet\", \"valueSet__ext\")]\n        return required_fields\n\n\nclass OperationDefinitionParameterReferencedFrom(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    References to this parameter.\n    Identifies other resource parameters within the operation invocation that\n    are expected to resolve to this resource.\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinitionParameterReferencedFrom\"\n\n    source: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Referencing parameter\",\n        description=(\n            \"The name of the parameter or dot-separated path of parameter names \"\n            \"pointing to the resource parameter that is expected to contain a \"\n            \"reference to this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    sourceId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sourceId\",\n        title=\"Element id of reference\",\n        description=(\n            \"The id of the element in the referencing resource that is expected to \"\n            \"resolve to this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceId\", title=\"Extension field for ``sourceId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinitionParameterReferencedFrom`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"source\", \"sourceId\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameterReferencedFrom`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"source\", \"source__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/operationoutcome.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OperationOutcome\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass OperationOutcome(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the success/failure of an action.\n    A collection of error, warning, or information messages that result from a\n    system action.\n    \"\"\"\n\n    __resource_type__ = \"OperationOutcome\"\n\n    issue: typing.List[fhirtypes.OperationOutcomeIssueType] = Field(\n        default=...,\n        alias=\"issue\",\n        title=\"A single issue associated with the action\",\n        description=(\n            \"An error, warning, or information message that results from a system \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationOutcome`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"issue\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationOutcome`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"issue\"]\n\n\nclass OperationOutcomeIssue(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A single issue associated with the action.\n    An error, warning, or information message that results from a system\n    action.\n    \"\"\"\n\n    __resource_type__ = \"OperationOutcomeIssue\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Error or warning code\",\n        description=(\n            \"Describes the type of the issue. The system that creates an \"\n            \"OperationOutcome SHALL choose the most applicable code from the \"\n            \"IssueType value set, and may additional provide its own code for the \"\n            \"error in the details element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    details: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"details\",\n        title=\"Additional details about the error\",\n        description=(\n            \"Additional details about the error. This may be a text description of \"\n            \"the error or a system code that identifies the error.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    diagnostics: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"diagnostics\",\n        title=\"Additional diagnostic information about the issue\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    diagnostics__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_diagnostics\", title=\"Extension field for ``diagnostics``.\"\n    )\n\n    expression: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"FHIRPath of element(s) related to issue\",\n        description=(\n            \"A [simple subset of FHIRPath](fhirpath.html#simple) limited to element\"\n            \" names, repetition indicators and the default child accessor that \"\n            \"identifies one of the elements in the resource that caused this issue \"\n            \"to be raised.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    expression__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    location: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Deprecated: Path of element(s) related to issue\",\n        description=(\n            \"This element is deprecated because it is XML specific. It is replaced \"\n            \"by issue.expression, which is format independent, and simpler to \"\n            \"parse.   For resource issues, this will be a simple XPath limited to \"\n            \"element names, repetition indicators and the default child accessor \"\n            \"that identifies one of the elements in the resource that caused this \"\n            'issue to be raised.  For HTTP errors, will be \"http.\" + the parameter '\n            \"name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    location__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_location\", title=\"Extension field for ``location``.\"\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"fatal | error | warning | information\",\n        description=(\n            \"Indicates whether the issue indicates a variation from successful \"\n            \"processing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"fatal\", \"error\", \"warning\", \"information\"],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationOutcomeIssue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"severity\",\n            \"code\",\n            \"details\",\n            \"diagnostics\",\n            \"location\",\n            \"expression\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationOutcomeIssue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"severity\",\n            \"code\",\n            \"details\",\n            \"diagnostics\",\n            \"location\",\n            \"expression\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"severity\", \"severity__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/organization.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Organization\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Organization(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A grouping of people or organizations with a common purpose.\n    A formally or informally recognized grouping of people or organizations\n    formed for the purpose of achieving some form of collective action.\n    Includes companies, institutions, corporations, departments, community\n    groups, healthcare practice groups, payer/insurer, etc.\n    \"\"\"\n\n    __resource_type__ = \"Organization\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether the organization's record is still in active use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"An address for the organization\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=(\n            \"A list of alternate names that the organization is known as, or was \"\n            \"known as in the past\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    contact: typing.List[fhirtypes.OrganizationContactType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact for the organization for a certain purpose\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to services operated for the \"\n            \"organization\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifies this organization  across multiple systems\",\n        description=(\n            \"Identifier for the organization that is used to identify the \"\n            \"organization across multiple disparate systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name used for the organization\",\n        description=\"A name associated with the organization.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    partOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"The organization of which this organization forms a part\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the organization\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of organization\",\n        description=\"The kind(s) of organization that this is.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Organization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"type\",\n            \"name\",\n            \"alias\",\n            \"telecom\",\n            \"address\",\n            \"partOf\",\n            \"contact\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Organization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"type\",\n            \"name\",\n            \"partOf\",\n        ]\n\n\nclass OrganizationContact(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contact for the organization for a certain purpose.\n    \"\"\"\n\n    __resource_type__ = \"OrganizationContact\"\n\n    address: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Visiting or postal addresses for the contact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the contact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    purpose: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"The type of contact\",\n        description=\"Indicates a purpose for which the contact can be reached.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contact details (telephone, email, etc.)  for a contact\",\n        description=(\n            \"A contact detail (e.g. a telephone number or an email address) by \"\n            \"which the party may be contacted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OrganizationContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"purpose\",\n            \"name\",\n            \"telecom\",\n            \"address\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OrganizationContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/organizationaffiliation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass OrganizationAffiliation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defines an affiliation/assotiation/relationship between 2 distinct\n    oganizations, that is not a part-of relationship/sub-division relationship.\n    \"\"\"\n\n    __resource_type__ = \"OrganizationAffiliation\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this organization affiliation record is in active use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Definition of the role the participatingOrganization plays\",\n        description=(\n            \"Definition of the role the participatingOrganization plays in the \"\n            \"association.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to services operated for this \" \"role\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    healthcareService: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"healthcareService\",\n        title=\"Healthcare services provided through the role\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"HealthcareService\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifiers that are specific to this role\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"The location(s) at which the role occurs\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    network: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"network\",\n        title=(\n            \"Health insurance provider network in which the \"\n            \"participatingOrganization provides the role's services (if defined) at\"\n            \" the indicated locations (if defined)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Organization where the role is available\",\n        description=(\n            \"Organization where the role is available (primary organization/has \"\n            \"members).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    participatingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"participatingOrganization\",\n        title=(\n            \"Organization that provides/performs the role (e.g. providing services \"\n            \"or is a member of)\"\n        ),\n        description=(\n            \"The Participating Organization provides/performs the role(s) defined \"\n            \"by the code to the Primary Organization (e.g. providing services or is\"\n            \" a member of).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=(\n            \"The period during which the participatingOrganization is affiliated \"\n            \"with the primary organization\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=(\n            \"Specific specialty of the participatingOrganization in the context of \"\n            \"the role\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=(\n            \"Contact details at the participatingOrganization relevant to this \"\n            \"Affiliation\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OrganizationAffiliation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"period\",\n            \"organization\",\n            \"participatingOrganization\",\n            \"network\",\n            \"code\",\n            \"specialty\",\n            \"location\",\n            \"healthcareService\",\n            \"telecom\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OrganizationAffiliation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"period\",\n            \"organization\",\n            \"participatingOrganization\",\n            \"network\",\n            \"code\",\n            \"specialty\",\n            \"location\",\n            \"telecom\",\n        ]\n"
  },
  {
    "path": "fhir/resources/R4B/packagedproductdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PackagedProductDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass PackagedProductDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A medically related item or items, in a container or package.\n    \"\"\"\n\n    __resource_type__ = \"PackagedProductDefinition\"\n\n    characteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=(\n            'Allows the key features to be recorded, such as \"hospital pack\", '\n            '\"nurse prescribable\"'\n        ),\n        description=(\n            'Allows the key features to be recorded, such as \"hospital pack\", '\n            '\"nurse prescribable\", \"calendar pack\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    containedItemQuantity: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"containedItemQuantity\",\n        title=(\n            \"A total of the complete count of contained items of a particular \"\n            \"type/form, independent of sub-packaging or organization. This can be \"\n            \"considered as the pack size\"\n        ),\n        description=(\n            \"A total of the complete count of contained items of a particular \"\n            \"type/form, independent of sub-packaging or organization. This can be \"\n            \"considered as the pack size. This attribute differs from \"\n            \"containedItem.amount in that it can give a single aggregated count of \"\n            \"all tablet types in a pack, even when these are different manufactured\"\n            \" items. For example a pill pack of 21 tablets plus 7 sugar tablets, \"\n            \"can be denoted here as '28 tablets'. This attribute is repeatable so \"\n            \"that the different item types in one pack type can be counted (e.g. a \"\n            \"count of vials and count of syringes). Each repeat must have different\"\n            \" units, so that it is clear what the different sets of counted items \"\n            \"are, and it is not intended to allow different counts of similar items\"\n            \" (e.g. not '2 tubes and 3 tubes'). Repeats are not to be used to \"\n            \"represent different pack sizes (e.g. 20 pack vs. 50 pack) - which \"\n            \"would be different instances of this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copackagedIndicator: bool | None = Field(\n        default=None,\n        alias=\"copackagedIndicator\",\n        title=(\n            \"If the drug product is supplied with another item such as a diluent or\"\n            \" adjuvant\"\n        ),\n        description=(\n            \"States whether a drug product is supplied with another item such as a \"\n            \"diluent or adjuvant.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    copackagedIndicator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copackagedIndicator\",\n        title=\"Extension field for ``copackagedIndicator``.\",\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=(\n            \"Textual description. Note that this is not the name of the package or \"\n            \"product\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"A unique identifier for this package as whole\",\n        description=(\n            \"A unique identifier for this package as whole. Unique instance \"\n            \"identifiers assigned to a package by manufacturers, regulators, drug \"\n            \"catalogue custodians or other organizations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    legalStatusOfSupply: typing.List[\n        fhirtypes.PackagedProductDefinitionLegalStatusOfSupplyType\n    ] | None = Field(\n        default=None,\n        alias=\"legalStatusOfSupply\",\n        title=(\n            \"The legal status of supply of the packaged item as classified by the \"\n            \"regulator\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=(\n            \"Manufacturer of this package type (multiple means these are all \"\n            \"possible manufacturers)\"\n        ),\n        description=(\n            \"Manufacturer of this package type. When there are multiple it means \"\n            \"these are all possible manufacturers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    marketingStatus: typing.List[fhirtypes.MarketingStatusType] | None = Field(\n        default=None,\n        alias=\"marketingStatus\",\n        title=(\n            \"Allows specifying that an item is on the market for sale, or that it \"\n            \"is not available, and the dates and locations associated\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=(\n            \"A name for this package. Typically as listed in a drug formulary, \"\n            \"catalogue, inventory etc\"\n        ),\n        description=(\n            \"A name for this package. Typically what it would be listed as in a \"\n            \"drug formulary or catalogue, inventory etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    package: fhirtypes.PackagedProductDefinitionPackageType | None = Field(\n        default=None,\n        alias=\"package\",\n        title=(\n            \"A packaging item, as a container for medically related items, possibly\"\n            \" with other packaging items within, or a packaging component, such as \"\n            \"bottle cap\"\n        ),\n        description=(\n            \"A packaging item, as a container for medically related items, possibly\"\n            \" with other packaging items within, or a packaging component, such as \"\n            \"bottle cap (which is not a device or a medication manufactured item).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    packageFor: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"packageFor\",\n        title=\"The product that this is a pack for\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicinalProductDefinition\"],\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"The status within the lifecycle of this item. High level - not \"\n            \"intended to duplicate details elsewhere e.g. legal status, or \"\n            \"authorization/marketing status\"\n        ),\n        description=(\n            \"The status within the lifecycle of this item. A high level status, \"\n            \"this is not intended to duplicate details carried elsewhere such as \"\n            \"legal status, or authorization or marketing status.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    statusDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"The date at which the given status became applicable\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"A high level category e.g. medicinal product, raw material, shipping \"\n            \"container etc\"\n        ),\n        description=(\n            \"A high level category e.g. medicinal product, raw material, \"\n            \"shipping/transport container, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PackagedProductDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"type\",\n            \"packageFor\",\n            \"status\",\n            \"statusDate\",\n            \"containedItemQuantity\",\n            \"description\",\n            \"legalStatusOfSupply\",\n            \"marketingStatus\",\n            \"characteristic\",\n            \"copackagedIndicator\",\n            \"manufacturer\",\n            \"package\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PackagedProductDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"name\",\n            \"type\",\n            \"packageFor\",\n            \"status\",\n            \"statusDate\",\n            \"containedItemQuantity\",\n            \"description\",\n            \"legalStatusOfSupply\",\n            \"marketingStatus\",\n            \"characteristic\",\n            \"copackagedIndicator\",\n            \"manufacturer\",\n            \"package\",\n        ]\n\n\nclass PackagedProductDefinitionLegalStatusOfSupply(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The legal status of supply of the packaged item as classified by the\n    regulator.\n    \"\"\"\n\n    __resource_type__ = \"PackagedProductDefinitionLegalStatusOfSupply\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"The actual status of supply. In what situation this package type may \"\n            \"be supplied for use\"\n        ),\n        description=(\n            \"The actual status of supply. Conveys in what situation this package \"\n            \"type may be supplied for use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"The place where the legal status of supply applies\",\n        description=(\n            \"The place where the legal status of supply applies. When not \"\n            \"specified, this indicates it is unknown in this context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PackagedProductDefinitionLegalStatusOfSupply`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"jurisdiction\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionLegalStatusOfSupply`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"jurisdiction\"]\n\n\nclass PackagedProductDefinitionPackage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A packaging item, as a container for medically related items, possibly with\n    other packaging items within, or a packaging component, such as bottle cap.\n    A packaging item, as a container for medically related items, possibly with\n    other packaging items within, or a packaging component, such as bottle cap\n    (which is not a device or a medication manufactured item).\n    \"\"\"\n\n    __resource_type__ = \"PackagedProductDefinitionPackage\"\n\n    alternateMaterial: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"alternateMaterial\",\n        title=(\n            \"A possible alternate material for this part of the packaging, that is \"\n            \"allowed to be used instead of the usual material\"\n        ),\n        description=(\n            \"A possible alternate material for this part of the packaging, that is \"\n            \"allowed to be used instead of the usual material (e.g. different types\"\n            \" of plastic for a blister sleeve).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    containedItem: typing.List[\n        fhirtypes.PackagedProductDefinitionPackageContainedItemType\n    ] | None = Field(\n        default=None,\n        alias=\"containedItem\",\n        title=\"The item(s) within the packaging\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"An identifier that is specific to this particular part of the \"\n            \"packaging. Including possibly a Data Carrier Identifier\"\n        ),\n        description=(\n            \"An identifier that is specific to this particular part of the \"\n            \"packaging. Including possibly Data Carrier Identifier (a GS1 barcode).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=(\n            \"Manufacturer of this package Item (multiple means these are all \"\n            \"possible manufacturers)\"\n        ),\n        description=(\n            \"Manufacturer of this package Item. When there are multiple it means \"\n            \"these are all possible manufacturers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    material: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"material\",\n        title=\"Material type of the package item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    package: typing.List[fhirtypes.PackagedProductDefinitionPackageType] | None = Field(\n        default=None,\n        alias=\"package\",\n        title=(\n            \"Allows containers (and parts of containers) within containers, still a\"\n            \" single packaged product\"\n        ),\n        description=(\n            \"Allows containers (and parts of containers) parwithin containers, \"\n            \"still a single packaged product.  See also PackagedProductDefinition.p\"\n            \"ackage.containedItem.item(PackagedProductDefinition).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    property: typing.List[\n        fhirtypes.PackagedProductDefinitionPackagePropertyType\n    ] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"General characteristics of this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=(\n            \"The quantity of this level of packaging in the package that contains \"\n            \"it (with the outermost level being 1)\"\n        ),\n        description=(\n            \"The quantity of this level of packaging in the package that contains \"\n            \"it. If specified, the outermost level is always 1.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_quantity\", title=\"Extension field for ``quantity``.\"\n    )\n\n    shelfLifeStorage: typing.List[\n        fhirtypes.PackagedProductDefinitionPackageShelfLifeStorageType\n    ] | None = Field(\n        default=None,\n        alias=\"shelfLifeStorage\",\n        title=\"Shelf Life and storage information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The physical type of the container of the items\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PackagedProductDefinitionPackage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"quantity\",\n            \"material\",\n            \"alternateMaterial\",\n            \"shelfLifeStorage\",\n            \"manufacturer\",\n            \"property\",\n            \"containedItem\",\n            \"package\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"quantity\",\n            \"material\",\n            \"alternateMaterial\",\n            \"shelfLifeStorage\",\n            \"manufacturer\",\n            \"property\",\n            \"containedItem\",\n            \"package\",\n        ]\n\n\nclass PackagedProductDefinitionPackageContainedItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The item(s) within the packaging.\n    \"\"\"\n\n    __resource_type__ = \"PackagedProductDefinitionPackageContainedItem\"\n\n    amount: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"The number of this type of item within this packaging\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    item: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"item\",\n        title=(\n            \"The actual item(s) of medication, as manufactured, or a device, or \"\n            \"other medically related item (food, biologicals, raw materials, \"\n            \"medical fluids, gases etc.), as contained in the package\"\n        ),\n        description=(\n            \"The actual item(s) of medication, as manufactured, or a device \"\n            \"(typically, but not necessarily, a co-packaged one), or other \"\n            \"medically related item (such as food, biologicals, raw materials, \"\n            \"medical fluids, gases etc.), as contained in the package. This also \"\n            \"allows another whole packaged product to be included, which is solely \"\n            \"for the case where a package of other entire packages is wanted - such\"\n            \" as a wholesale or distribution pack (for layers within one package, \"\n            \"use PackagedProductDefinition.package.package).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"ManufacturedItemDefinition\",\n                \"DeviceDefinition\",\n                \"PackagedProductDefinition\",\n                \"BiologicallyDerivedProduct\",\n                \"NutritionProduct\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PackagedProductDefinitionPackageContainedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"item\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackageContainedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"item\", \"amount\"]\n\n\nclass PackagedProductDefinitionPackageProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    General characteristics of this item.\n    \"\"\"\n\n    __resource_type__ = \"PackagedProductDefinitionPackageProperty\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"A code expressing the type of characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PackagedProductDefinitionPackageProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackageProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDate\",\n                \"valueQuantity\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass PackagedProductDefinitionPackageShelfLifeStorage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Shelf Life and storage information.\n    \"\"\"\n\n    __resource_type__ = \"PackagedProductDefinitionPackageShelfLifeStorage\"\n\n    periodDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"periodDuration\",\n        title=(\n            \"The shelf life time period can be specified using a numerical value \"\n            \"for the period of time and its unit of time measurement The unit of \"\n            \"measurement shall be specified in accordance with ISO 11240 and the \"\n            \"resulting terminology The symbol and the symbol identifier shall be \"\n            \"used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e period[x]\n            \"one_of_many\": \"period\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    periodString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"periodString\",\n        title=(\n            \"The shelf life time period can be specified using a numerical value \"\n            \"for the period of time and its unit of time measurement The unit of \"\n            \"measurement shall be specified in accordance with ISO 11240 and the \"\n            \"resulting terminology The symbol and the symbol identifier shall be \"\n            \"used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e period[x]\n            \"one_of_many\": \"period\",\n            \"one_of_many_required\": False,\n        },\n    )\n    periodString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_periodString\",\n        title=\"Extension field for ``periodString``.\",\n    )\n\n    specialPrecautionsForStorage: typing.List[\n        fhirtypes.CodeableConceptType\n    ] | None = Field(\n        default=None,\n        alias=\"specialPrecautionsForStorage\",\n        title=(\n            \"Special precautions for storage, if any, can be specified using an \"\n            \"appropriate controlled vocabulary. The controlled term and the \"\n            \"controlled term identifier shall be specified\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"This describes the shelf life, taking into account various scenarios \"\n            \"such as shelf life of the packaged Medicinal Product itself, shelf \"\n            \"life after transformation where necessary and shelf life after the \"\n            \"first opening of a bottle, etc. The shelf life type shall be specified\"\n            \" using an appropriate controlled vocabulary The controlled term and \"\n            \"the controlled term identifier shall be specified\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PackagedProductDefinitionPackageShelfLifeStorage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"periodDuration\",\n            \"periodString\",\n            \"specialPrecautionsForStorage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackageShelfLifeStorage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"periodDuration\",\n            \"periodString\",\n            \"specialPrecautionsForStorage\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"period\": [\"periodDuration\", \"periodString\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/parameterdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ParameterDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass ParameterDefinition(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a parameter to a module.\n    The parameters to the module. This collection specifies both the input and\n    output parameters. Input parameters are provided by the caller as part of\n    the $evaluate operation. Output parameters are included in the\n    GuidanceResponse.\n    \"\"\"\n\n    __resource_type__ = \"ParameterDefinition\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"A brief description of the parameter\",\n        description=(\n            \"A brief discussion of what the parameter is for and how it is used by \"\n            \"the module.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum cardinality (a number of *)\",\n        description=(\n            \"The maximum number of times this element is permitted to appear in the\"\n            \" request or response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum cardinality\",\n        description=(\n            \"The minimum number of times this parameter SHALL appear in the request\"\n            \" or response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    name: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name used to access the parameter value\",\n        description=(\n            \"The name of the parameter used to allow access to the value of the \"\n            \"parameter in evaluation contexts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"What profile the value is expected to be\",\n        description=(\n            \"If specified, this indicates a profile that the input data must \"\n            \"conform to, or that the output data will conform to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"What type of value\",\n        description=\"The type of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"in | out\",\n        description=\"Whether the parameter is input or output for the module.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"in\", \"out\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ParameterDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"name\",\n            \"use\",\n            \"min\",\n            \"max\",\n            \"documentation\",\n            \"type\",\n            \"profile\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ParameterDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"name\", \"use\", \"min\", \"max\", \"documentation\", \"type\", \"profile\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\"), (\"use\", \"use__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/parameters.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Parameters\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, fhirtypes, resource\n\n\nclass Parameters(resource.Resource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Operation Request or Response.\n    This resource is a non-persisted resource used to pass information into and\n    back from an [operation](operations.html). It has no other use, and there\n    is no RESTful endpoint associated with it.\n    \"\"\"\n\n    __resource_type__ = \"Parameters\"\n\n    parameter: typing.List[fhirtypes.ParametersParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Operation Parameter\",\n        description=\"A parameter passed to or received from the operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Parameters`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"language\", \"parameter\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Parameters`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"parameter\"]\n\n\nclass ParametersParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Operation Parameter.\n    A parameter passed to or received from the operation.\n    \"\"\"\n\n    __resource_type__ = \"ParametersParameter\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name from the definition\",\n        description=\"The name of the parameter (reference to the operation definition).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    part: typing.List[fhirtypes.ParametersParameterType] | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"Named part of a multi-part parameter\",\n        description=\"A named part of a multi-part parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.ResourceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"If parameter is a whole resource\",\n        description=\"If the parameter is a whole resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueCanonical\",\n        title=\"Extension field for ``valueCanonical``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"valueContactDetail\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueContributor: fhirtypes.ContributorType | None = Field(\n        default=None,\n        alias=\"valueContributor\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"valueDataRequirement\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"valueDosage\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"valueExpression\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"valueParameterDefinition\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"valueRelatedArtifact\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"valueTriggerDefinition\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUrl\", title=\"Extension field for ``valueUrl``.\"\n    )\n\n    valueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"valueUsageContext\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"valueUuid\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUuid\", title=\"Extension field for ``valueUuid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ParametersParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueContributor\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueDosage\",\n            \"valueMeta\",\n            \"resource\",\n            \"part\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ParametersParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"name\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueContributor\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueDosage\",\n            \"valueMeta\",\n            \"resource\",\n            \"part\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCanonical\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCoding\",\n                \"valueContactDetail\",\n                \"valueContactPoint\",\n                \"valueContributor\",\n                \"valueCount\",\n                \"valueDataRequirement\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDosage\",\n                \"valueDuration\",\n                \"valueExpression\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valueParameterDefinition\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueReference\",\n                \"valueRelatedArtifact\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueTriggerDefinition\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n                \"valueUrl\",\n                \"valueUsageContext\",\n                \"valueUuid\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/patient.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Patient\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Patient(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about an individual or animal receiving health care services.\n    Demographics and other administrative information about an individual or\n    animal receiving care or other health-related services.\n    \"\"\"\n\n    __resource_type__ = \"Patient\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this patient's record is in active use\",\n        description=(\n            \"Whether this patient record is in active use.  Many systems use this \"\n            \"property to mark as non-current patients, such as those that have not \"\n            \"been seen for a period of time based on an organization's business \"\n            \"rules.  It is often used to filter patient lists to exclude inactive \"\n            \"patients  Deceased patients may also be marked as inactive for the \"\n            \"same reasons, but may be active for some time after death.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"An address for the individual\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    birthDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"birthDate\",\n        title=\"The date of birth for the individual\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_birthDate\", title=\"Extension field for ``birthDate``.\"\n    )\n\n    communication: typing.List[fhirtypes.PatientCommunicationType] | None = Field(\n        default=None,\n        alias=\"communication\",\n        title=(\n            \"A language which may be used to communicate with the patient about his\"\n            \" or her health\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.PatientContactType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"A contact party (e.g. guardian, partner, friend) for the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    deceasedBoolean: bool | None = Field(\n        default=None,\n        alias=\"deceasedBoolean\",\n        title=\"Indicates if the individual is deceased or not\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedBoolean\",\n        title=\"Extension field for ``deceasedBoolean``.\",\n    )\n\n    deceasedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"deceasedDateTime\",\n        title=\"Indicates if the individual is deceased or not\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedDateTime\",\n        title=\"Extension field for ``deceasedDateTime``.\",\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the patient is considered to \"\n            \"have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    generalPractitioner: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"generalPractitioner\",\n        title=\"Patient's nominated primary care provider\",\n        description=\"Patient's nominated care provider.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier for this patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.PatientLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Link to another patient resource that concerns the same actual person\",\n        description=(\n            \"Link to another patient resource that concerns the same actual \" \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"Organization that is the custodian of the patient record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    maritalStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"maritalStatus\",\n        title=\"Marital (civil) status of a patient\",\n        description=\"This field contains a patient's most recent marital (civil) status.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    multipleBirthBoolean: bool | None = Field(\n        default=None,\n        alias=\"multipleBirthBoolean\",\n        title=\"Whether patient is part of a multiple birth\",\n        description=(\n            \"Indicates whether the patient is part of a multiple (boolean) or \"\n            \"indicates the actual birth order (integer).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e multipleBirth[x]\n            \"one_of_many\": \"multipleBirth\",\n            \"one_of_many_required\": False,\n        },\n    )\n    multipleBirthBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_multipleBirthBoolean\",\n        title=\"Extension field for ``multipleBirthBoolean``.\",\n    )\n\n    multipleBirthInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"multipleBirthInteger\",\n        title=\"Whether patient is part of a multiple birth\",\n        description=(\n            \"Indicates whether the patient is part of a multiple (boolean) or \"\n            \"indicates the actual birth order (integer).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e multipleBirth[x]\n            \"one_of_many\": \"multipleBirth\",\n            \"one_of_many_required\": False,\n        },\n    )\n    multipleBirthInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_multipleBirthInteger\",\n        title=\"Extension field for ``multipleBirthInteger``.\",\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the patient\",\n        description=\"A name associated with the individual.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    photo: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Image of the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the individual\",\n        description=(\n            \"A contact detail (e.g. a telephone number or an email address) by \"\n            \"which the individual may be contacted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Patient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"deceasedBoolean\",\n            \"deceasedDateTime\",\n            \"address\",\n            \"maritalStatus\",\n            \"multipleBirthBoolean\",\n            \"multipleBirthInteger\",\n            \"photo\",\n            \"contact\",\n            \"communication\",\n            \"generalPractitioner\",\n            \"managingOrganization\",\n            \"link\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Patient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"deceasedBoolean\",\n            \"deceasedDateTime\",\n            \"address\",\n            \"managingOrganization\",\n            \"link\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"deceased\": [\"deceasedBoolean\", \"deceasedDateTime\"],\n            \"multipleBirth\": [\"multipleBirthBoolean\", \"multipleBirthInteger\"],\n        }\n        return one_of_many_fields\n\n\nclass PatientCommunication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A language which may be used to communicate with the patient about his or\n    her health.\n    \"\"\"\n\n    __resource_type__ = \"PatientCommunication\"\n\n    language: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"language\",\n        title=(\n            \"The language which can be used to communicate with the patient about \"\n            \"his or her health\"\n        ),\n        description=(\n            \"The ISO-639-1 alpha 2 code in lower case for the language, optionally \"\n            \"followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in\"\n            ' upper case; e.g. \"en\" for English, or \"en-US\" for American English '\n            'versus \"en-EN\" for England English.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preferred: bool | None = Field(\n        default=None,\n        alias=\"preferred\",\n        title=\"Language preference indicator\",\n        description=(\n            \"Indicates whether or not the patient prefers this language (over other\"\n            \" languages he masters up a certain level).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preferred\", title=\"Extension field for ``preferred``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PatientCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"preferred\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PatientCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PatientContact(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A contact party (e.g. guardian, partner, friend) for the patient.\n    \"\"\"\n\n    __resource_type__ = \"PatientContact\"\n\n    address: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Address for the contact person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the contact person is \"\n            \"considered to have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    name: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the contact person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Organization that is associated with the contact\",\n        description=(\n            \"Organization on behalf of which the contact is acting or for which the\"\n            \" contact is working.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=(\n            \"The period during which this contact person or organization is valid \"\n            \"to be contacted relating to this patient\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"The kind of relationship\",\n        description=(\n            \"The nature of the relationship between the patient and the contact \"\n            \"person.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the person\",\n        description=(\n            \"A contact detail for the person, e.g. a telephone number or an email \"\n            \"address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PatientContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"relationship\",\n            \"name\",\n            \"telecom\",\n            \"address\",\n            \"gender\",\n            \"organization\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PatientContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PatientLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Link to another patient resource that concerns the same actual person.\n    Link to another patient resource that concerns the same actual patient.\n    \"\"\"\n\n    __resource_type__ = \"PatientLink\"\n\n    other: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"other\",\n        title=\"The other patient or related person resource that the link refers to\",\n        description=\"The other patient resource that the link refers to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"replaced-by | replaces | refer | seealso\",\n        description=(\n            \"The type of link between this patient resource and another patient \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"replaced-by\", \"replaces\", \"refer\", \"seealso\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PatientLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"other\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PatientLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"other\", \"type\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/paymentnotice.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PaymentNotice\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass PaymentNotice(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    PaymentNotice request.\n    This resource provides the status of the payment for goods and services\n    rendered, and the request and response resource references.\n    \"\"\"\n\n    __resource_type__ = \"PaymentNotice\"\n\n    amount: fhirtypes.MoneyType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Monetary amount of the payment\",\n        description=\"The amount sent to the payee.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for the payment noctice\",\n        description=\"A unique identifier assigned to this payment notice.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payee: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"payee\",\n        title=\"Party being paid\",\n        description=(\n            \"The party who will receive or has received payment that is the subject\"\n            \" of this notification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    payment: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"payment\",\n        title=\"Payment reference\",\n        description=\"A reference to the payment which is the subject of this notice.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PaymentReconciliation\"],\n        },\n    )\n\n    paymentDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"paymentDate\",\n        title=\"Payment or clearing date\",\n        description=\"The date when the above payment action occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    paymentDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_paymentDate\", title=\"Extension field for ``paymentDate``.\"\n    )\n\n    paymentStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"paymentStatus\",\n        title=\"Issued or cleared Status of the payment\",\n        description=\"A code indicating whether payment has been sent or cleared.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    recipient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"recipient\",\n        title=\"Party being notified\",\n        description=\"The party who is notified of the payment status.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Request reference\",\n        description=\"Reference of resource for which payment is being made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    response: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"Response reference\",\n        description=\"Reference of response to resource for which payment is being made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PaymentNotice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"request\",\n            \"response\",\n            \"created\",\n            \"provider\",\n            \"payment\",\n            \"paymentDate\",\n            \"payee\",\n            \"recipient\",\n            \"amount\",\n            \"paymentStatus\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PaymentNotice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"created\",\n            \"payment\",\n            \"recipient\",\n            \"amount\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"created\", \"created__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/paymentreconciliation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PaymentReconciliation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass PaymentReconciliation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    PaymentReconciliation resource.\n    This resource provides the details including amount of a payment and\n    allocates the payment items being paid.\n    \"\"\"\n\n    __resource_type__ = \"PaymentReconciliation\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when the resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    detail: typing.List[fhirtypes.PaymentReconciliationDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Settlement particulars\",\n        description=(\n            \"Distribution of the payment amount for a previously acknowledged \"\n            \"payable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition message\",\n        description=(\n            \"A human readable description of the status of the request for the \"\n            \"reconciliation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    formCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"formCode\",\n        title=\"Printed form identifier\",\n        description=\"A code for the form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for a payment reconciliation\",\n        description=\"A unique identifier assigned to this payment reconciliation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcome: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"queued | complete | error | partial\",\n        description=\"The outcome of a request for a reconciliation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"queued\", \"complete\", \"error\", \"partial\"],\n        },\n    )\n    outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcome\", title=\"Extension field for ``outcome``.\"\n    )\n\n    paymentAmount: fhirtypes.MoneyType = Field(\n        default=...,\n        alias=\"paymentAmount\",\n        title=\"Total amount of Payment\",\n        description=\"Total payment amount as indicated on the financial instrument.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    paymentDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"paymentDate\",\n        title=\"When payment issued\",\n        description=\"The date of payment as indicated on the financial instrument.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    paymentDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_paymentDate\", title=\"Extension field for ``paymentDate``.\"\n    )\n\n    paymentIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"paymentIdentifier\",\n        title=\"Business identifier for the payment\",\n        description=\"Issuer's unique identifier for the payment instrument.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    paymentIssuer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"paymentIssuer\",\n        title=\"Party generating payment\",\n        description=\"The party who generated the payment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period covered\",\n        description=(\n            \"The period of time for which payments have been gathered into this \"\n            \"bulk payment for settlement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    processNote: typing.List[\n        fhirtypes.PaymentReconciliationProcessNoteType\n    ] | None = Field(\n        default=None,\n        alias=\"processNote\",\n        title=\"Note concerning processing\",\n        description=(\n            \"A note that describes or explains the processing in a human readable \"\n            \"form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Reference to requesting resource\",\n        description=\"Original request resource reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Task\"],\n        },\n    )\n\n    requestor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestor\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PaymentReconciliation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"period\",\n            \"created\",\n            \"paymentIssuer\",\n            \"request\",\n            \"requestor\",\n            \"outcome\",\n            \"disposition\",\n            \"paymentDate\",\n            \"paymentAmount\",\n            \"paymentIdentifier\",\n            \"detail\",\n            \"formCode\",\n            \"processNote\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PaymentReconciliation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"period\",\n            \"created\",\n            \"paymentIssuer\",\n            \"paymentDate\",\n            \"paymentAmount\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"paymentDate\", \"paymentDate__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass PaymentReconciliationDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Settlement particulars.\n    Distribution of the payment amount for a previously acknowledged payable.\n    \"\"\"\n\n    __resource_type__ = \"PaymentReconciliationDetail\"\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Amount allocated to this payable\",\n        description=\"The monetary amount allocated from the total payment to the payable.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date of commitment to pay\",\n        description=\"The date from the response resource containing a commitment to pay.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier of the payment detail\",\n        description=(\n            \"Unique identifier for the current payment item for the referenced \"\n            \"payable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payee: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"payee\",\n        title=\"Recipient of the payment\",\n        description=\"The party which is receiving the payment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    predecessor: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"predecessor\",\n        title=\"Business identifier of the prior payment detail\",\n        description=(\n            \"Unique identifier for the prior payment item for the referenced \"\n            \"payable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Request giving rise to the payment\",\n        description=(\n            \"A resource, such as a Claim, the evaluation of which could lead to \"\n            \"payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    response: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"Response committing to a payment\",\n        description=(\n            \"A resource, such as a ClaimResponse, which contains a commitment to \"\n            \"payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    responsible: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Contact for the response\",\n        description=(\n            \"A reference to the individual who is responsible for inquiries \"\n            \"regarding the response and its payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PractitionerRole\"],\n        },\n    )\n\n    submitter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"submitter\",\n        title=\"Submitter of the request\",\n        description=\"The party which submitted the claim or financial transaction.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Category of payment\",\n        description=\"Code to indicate the nature of the payment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PaymentReconciliationDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"predecessor\",\n            \"type\",\n            \"request\",\n            \"submitter\",\n            \"response\",\n            \"date\",\n            \"responsible\",\n            \"payee\",\n            \"amount\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PaymentReconciliationDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PaymentReconciliationProcessNote(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Note concerning processing.\n    A note that describes or explains the processing in a human readable form.\n    \"\"\"\n\n    __resource_type__ = \"PaymentReconciliationProcessNote\"\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Note explanatory text\",\n        description=\"The explanation or description associated with the processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"display | print | printoper\",\n        description=\"The business purpose of the note text.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"display\", \"print\", \"printoper\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PaymentReconciliationProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PaymentReconciliationProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/period.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Period\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Period(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Time range defined by start and end date/time.\n    A time period defined by a start and end date and optionally time.\n    \"\"\"\n\n    __resource_type__ = \"Period\"\n\n    end: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"End time with inclusive boundary, if not ongoing\",\n        description=(\n            \"The end of the period. If the end of the period is missing, it means \"\n            \"no end was known or planned at the time the instance was created. The \"\n            \"start may be in the past, and the end date in the future, which means \"\n            \"that period is expected/planned to end at that time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    start: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Starting time with inclusive boundary\",\n        description=\"The start of the period. The boundary is inclusive.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Period`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"start\", \"end\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Period`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"start\", \"end\"]\n"
  },
  {
    "path": "fhir/resources/R4B/person.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Person\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Person(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A generic person record.\n    Demographics and administrative information about a person independent of a\n    specific health-related context.\n    \"\"\"\n\n    __resource_type__ = \"Person\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"This person's record is in active use\",\n        description=\"Whether this person's record is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"One or more addresses for the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    birthDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"birthDate\",\n        title=\"The date on which the person was born\",\n        description=\"The birth date for the person.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_birthDate\", title=\"Extension field for ``birthDate``.\"\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=\"Administrative Gender.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"A human identifier for this person\",\n        description=\"Identifier for a person within a particular scope.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.PersonLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Link to a resource that concerns the same actual person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"The organization that is the custodian of the person record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    photo: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Image of the person\",\n        description=(\n            \"An image that can be displayed as a thumbnail of the person to enhance\"\n            \" the identification of the individual.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the person\",\n        description=(\n            \"A contact detail for the person, e.g. a telephone number or an email \"\n            \"address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Person`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"address\",\n            \"photo\",\n            \"managingOrganization\",\n            \"active\",\n            \"link\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Person`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"managingOrganization\",\n            \"active\",\n        ]\n\n\nclass PersonLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Link to a resource that concerns the same actual person.\n    \"\"\"\n\n    __resource_type__ = \"PersonLink\"\n\n    assurance: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"assurance\",\n        title=\"level1 | level2 | level3 | level4\",\n        description=(\n            \"Level of assurance that this link is associated with the target \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"level1\", \"level2\", \"level3\", \"level4\"],\n        },\n    )\n    assurance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_assurance\", title=\"Extension field for ``assurance``.\"\n    )\n\n    target: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"target\",\n        title=\"The resource to which this actual person is associated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Person\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PersonLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"target\", \"assurance\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PersonLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/plandefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PlanDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass PlanDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The definition of a plan for a series of actions, independent of any\n    specific patient or context.\n    This resource allows for the definition of various types of plans as a\n    sharable, consumable, and executable artifact. The resource is general\n    enough to support the description of a broad range of clinical and non-\n    clinical artifacts such as clinical decision support rules, order sets,\n    protocols, and drug quality specifications.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinition\"\n\n    action: typing.List[fhirtypes.PlanDefinitionActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Action defined by the plan\",\n        description=(\n            \"An action or group of actions to be taken as part of the plan. For \"\n            \"example, in clinical care, an action would be to prescribe a \"\n            \"particular indicated medication, or perform a particular test as \"\n            \"appropriate. In pharmaceutical quality, an action would be the test \"\n            \"that needs to be performed on a drug product as defined in the quality\"\n            \" specification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the plan definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the plan definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the plan definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the plan definition was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the plan definition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the plan definition\",\n        description=(\n            \"A free text natural language description of the plan definition from a\"\n            \" consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the plan definition is expected to be used\",\n        description=(\n            \"The period during which the plan definition content was or is planned \"\n            \"to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization responsible for officially endorsing the\"\n            \" content for use in some setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this plan definition is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    goal: typing.List[fhirtypes.PlanDefinitionGoalType] | None = Field(\n        default=None,\n        alias=\"goal\",\n        title=\"What the plan is trying to accomplish\",\n        description=(\n            \"A goal describes an expected outcome that activities within the plan \"\n            \"are intended to achieve. For example, weight loss, restoring an \"\n            \"activity of daily living, obtaining herd immunity via immunization, \"\n            \"meeting a process improvement objective, meeting the acceptance \"\n            \"criteria for a test as specified by a quality specification, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the plan definition\",\n        description=(\n            \"A formal identifier that is used to identify this plan definition when\"\n            \" it is represented in other formats, or referenced in a specification,\"\n            \" model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for plan definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the plan definition is intended \"\n            \"to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the plan definition was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    library: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the plan definition\",\n        description=(\n            \"A reference to a Library resource containing any formal logic used by \"\n            \"the plan definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n    library__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_library\", title=\"Extension field for ``library``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this plan definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the plan definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the plan \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this plan definition is defined\",\n        description=(\n            \"Explanation of why this plan definition is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization primarily responsible for review of some\"\n            \" aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this plan definition. Enables tracking the life-cycle of\"\n            \" the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"subjectCanonical\",\n        title=\"Type of individual the plan definition is focused on\",\n        description=(\n            \"A code, group definition, or canonical reference that describes  or \"\n            \"identifies the intended subject of the plan definition. Canonical \"\n            \"references are allowed to support the definition of protocols for drug\"\n            \" and substance quality specifications, and is allowed to reference a \"\n            \"MedicinalProductDefinition, SubstanceDefinition, \"\n            \"AdministrableProductDefinition, ManufacturedItemDefinition, or \"\n            \"PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicinalProductDefinition\",\n                \"SubstanceDefinition\",\n                \"AdministrableProductDefinition\",\n                \"ManufacturedItemDefinition\",\n                \"PackagedProductDefinition\",\n            ],\n        },\n    )\n    subjectCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subjectCanonical\",\n        title=\"Extension field for ``subjectCanonical``.\",\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=\"Type of individual the plan definition is focused on\",\n        description=(\n            \"A code, group definition, or canonical reference that describes  or \"\n            \"identifies the intended subject of the plan definition. Canonical \"\n            \"references are allowed to support the definition of protocols for drug\"\n            \" and substance quality specifications, and is allowed to reference a \"\n            \"MedicinalProductDefinition, SubstanceDefinition, \"\n            \"AdministrableProductDefinition, ManufacturedItemDefinition, or \"\n            \"PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=\"Type of individual the plan definition is focused on\",\n        description=(\n            \"A code, group definition, or canonical reference that describes  or \"\n            \"identifies the intended subject of the plan definition. Canonical \"\n            \"references are allowed to support the definition of protocols for drug\"\n            \" and substance quality specifications, and is allowed to reference a \"\n            \"MedicinalProductDefinition, SubstanceDefinition, \"\n            \"AdministrableProductDefinition, ManufacturedItemDefinition, or \"\n            \"PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the plan definition\",\n        description=(\n            \"An explanatory or alternate title for the plan definition giving \"\n            \"additional information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this plan definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the plan definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment\",\n        description=(\n            \"Descriptive topics related to the content of the plan definition. \"\n            \"Topics provide a high-level categorization of the definition that can \"\n            \"be useful for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"order-set | clinical-protocol | eca-rule | workflow-definition\",\n        description=(\n            \"A high-level category for the plan definition that distinguishes the \"\n            \"kinds of systems that would be interested in the plan definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this plan definition, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this plan definition when it \"\n            \"is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this plan definition is (or will be) published. This URL \"\n            \"can be the target of a canonical reference. It SHALL remain the same \"\n            \"when the plan definition is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the plan\",\n        description=(\n            \"A detailed description of how the plan definition is used from a \"\n            \"clinical perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate plan definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the plan definition\",\n        description=(\n            \"The identifier that is used to identify this version of the plan \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the plan definition \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence. To provide a version consistent with the \"\n            \"Decision Support Service specification, use the format \"\n            \"Major.Minor.Revision (e.g. 1.0.0). For more information on versioning \"\n            \"knowledge assets, refer to the Decision Support Service specification.\"\n            \" Note that a version is required for non-experimental active \"\n            \"artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"type\",\n            \"status\",\n            \"experimental\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"subjectCanonical\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"usage\",\n            \"copyright\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"library\",\n            \"goal\",\n            \"action\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"type\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"subject\": [\n                \"subjectCanonical\",\n                \"subjectCodeableConcept\",\n                \"subjectReference\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass PlanDefinitionAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Action defined by the plan.\n    An action or group of actions to be taken as part of the plan. For example,\n    in clinical care, an action would be to prescribe a particular indicated\n    medication, or perform a particular test as appropriate. In pharmaceutical\n    quality, an action would be the test that needs to be performed on a drug\n    product as defined in the quality specification.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionAction\"\n\n    action: typing.List[fhirtypes.PlanDefinitionActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"A sub-action\",\n        description=(\n            \"Sub actions that are contained within the action. The behavior of this\"\n            \" action determines the functionality of the sub-actions. For example, \"\n            \"a selection behavior of at-most-one indicates that of the sub-actions,\"\n            \" at most one may be chosen as part of realizing the action definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    cardinalityBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"cardinalityBehavior\",\n        title=\"single | multiple\",\n        description=\"Defines whether the action can be selected multiple times.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"single\", \"multiple\"],\n        },\n    )\n    cardinalityBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_cardinalityBehavior\",\n        title=\"Extension field for ``cardinalityBehavior``.\",\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code representing the meaning of the action or sub-actions\",\n        description=(\n            \"A code that provides a meaning, grouping, or classification for the \"\n            \"action or action group. For example, a section may have a LOINC code \"\n            \"for the section of a documentation template. In pharmaceutical \"\n            \"quality, an action (Test) such as pH could be classified as a physical\"\n            \" property.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    condition: typing.List[fhirtypes.PlanDefinitionActionConditionType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Whether or not the action is applicable\",\n        description=(\n            \"An expression that describes applicability criteria or start/stop \"\n            \"conditions for the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definitionCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definitionCanonical\",\n        title=\"Description of the activity to be performed\",\n        description=(\n            \"A reference to an ActivityDefinition that describes the action to be \"\n            \"taken in detail, or a PlanDefinition that describes a series of \"\n            \"actions to be taken.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"ActivityDefinition\",\n                \"PlanDefinition\",\n                \"Questionnaire\",\n            ],\n        },\n    )\n    definitionCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_definitionCanonical\",\n        title=\"Extension field for ``definitionCanonical``.\",\n    )\n\n    definitionUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"definitionUri\",\n        title=\"Description of the activity to be performed\",\n        description=(\n            \"A reference to an ActivityDefinition that describes the action to be \"\n            \"taken in detail, or a PlanDefinition that describes a series of \"\n            \"actions to be taken.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": False,\n        },\n    )\n    definitionUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_definitionUri\",\n        title=\"Extension field for ``definitionUri``.\",\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Brief description of the action\",\n        description=(\n            \"A brief description of the action used to provide a summary to display\"\n            \" to the user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Supporting documentation for the intended performer of the action\",\n        description=(\n            \"Didactic or other informational resources associated with the action \"\n            \"that can be provided to the CDS recipient. Information resources can \"\n            \"include inline text commentary and links to web resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dynamicValue: typing.List[\n        fhirtypes.PlanDefinitionActionDynamicValueType\n    ] | None = Field(\n        default=None,\n        alias=\"dynamicValue\",\n        title=\"Dynamic aspects of the definition\",\n        description=(\n            \"Customizations that should be applied to the statically defined \"\n            \"resource. For example, if the dosage of a medication must be computed \"\n            \"based on the patient's weight, a customization would be used to \"\n            \"specify an expression that calculated the weight, and the path on the \"\n            \"resource that would contain the result.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    goalId: typing.List[fhirtypes.IdType | None] | None = Field(\n        default=None,\n        alias=\"goalId\",\n        title=\"What goals this action supports\",\n        description=(\n            \"Identifies goals that this action supports. The reference must be to a\"\n            \" goal element defined within this plan definition. In pharmaceutical \"\n            \"quality, a goal represents acceptance criteria (Goal) for a given \"\n            \"action (Test), so the goalId would be the unique id of a defined goal \"\n            \"element establishing the acceptance criteria for the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    goalId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_goalId\", title=\"Extension field for ``goalId``.\"\n    )\n\n    groupingBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"groupingBehavior\",\n        title=\"visual-group | logical-group | sentence-group\",\n        description=\"Defines the grouping behavior for the action and its children.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"visual-group\", \"logical-group\", \"sentence-group\"],\n        },\n    )\n    groupingBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_groupingBehavior\",\n        title=\"Extension field for ``groupingBehavior``.\",\n    )\n\n    input: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"input\",\n        title=\"Input data requirements\",\n        description=\"Defines input data requirements for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    output: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"output\",\n        title=\"Output data definition\",\n        description=\"Defines the outputs of the action, if any.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    participant: typing.List[\n        fhirtypes.PlanDefinitionActionParticipantType\n    ] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Who should participate in the action\",\n        description=\"Indicates who should participate in performing the action described.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    precheckBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"precheckBehavior\",\n        title=\"yes | no\",\n        description=\"Defines whether the action should usually be preselected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"yes\", \"no\"],\n        },\n    )\n    precheckBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_precheckBehavior\",\n        title=\"Extension field for ``precheckBehavior``.\",\n    )\n\n    prefix: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"prefix\",\n        title=\"User-visible prefix for the action (e.g. 1. or A.)\",\n        description=\"A user-visible prefix for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_prefix\", title=\"Extension field for ``prefix``.\"\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the action should be addressed with respect to \"\n            \"other actions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why the action should be performed\",\n        description=\"A description of why this action is necessary or appropriate.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedAction: typing.List[\n        fhirtypes.PlanDefinitionActionRelatedActionType\n    ] | None = Field(\n        default=None,\n        alias=\"relatedAction\",\n        title=\"Relationship to another action\",\n        description=(\n            'A relationship to another action such as \"before\" or \"30-60 minutes '\n            'after start of\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requiredBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"requiredBehavior\",\n        title=\"must | could | must-unless-documented\",\n        description=\"Defines the required behavior for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"must\", \"could\", \"must-unless-documented\"],\n        },\n    )\n    requiredBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requiredBehavior\",\n        title=\"Extension field for ``requiredBehavior``.\",\n    )\n\n    selectionBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"selectionBehavior\",\n        title=\"any | all | all-or-none | exactly-one | at-most-one | one-or-more\",\n        description=\"Defines the selection behavior for the action and its children.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"any\",\n                \"all\",\n                \"all-or-none\",\n                \"exactly-one\",\n                \"at-most-one\",\n                \"one-or-more\",\n            ],\n        },\n    )\n    selectionBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_selectionBehavior\",\n        title=\"Extension field for ``selectionBehavior``.\",\n    )\n\n    subjectCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"subjectCanonical\",\n        title=\"Type of individual the action is focused on\",\n        description=(\n            \"A code, group definition, or canonical reference that describes the \"\n            \"intended subject of the action and its children, if any. Canonical \"\n            \"references are allowed to support the definition of protocols for drug\"\n            \" and substance quality specifications, and is allowed to reference a \"\n            \"MedicinalProductDefinition, SubstanceDefinition, \"\n            \"AdministrableProductDefinition, ManufacturedItemDefinition, or \"\n            \"PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n    subjectCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subjectCanonical\",\n        title=\"Extension field for ``subjectCanonical``.\",\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=\"Type of individual the action is focused on\",\n        description=(\n            \"A code, group definition, or canonical reference that describes the \"\n            \"intended subject of the action and its children, if any. Canonical \"\n            \"references are allowed to support the definition of protocols for drug\"\n            \" and substance quality specifications, and is allowed to reference a \"\n            \"MedicinalProductDefinition, SubstanceDefinition, \"\n            \"AdministrableProductDefinition, ManufacturedItemDefinition, or \"\n            \"PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=\"Type of individual the action is focused on\",\n        description=(\n            \"A code, group definition, or canonical reference that describes the \"\n            \"intended subject of the action and its children, if any. Canonical \"\n            \"references are allowed to support the definition of protocols for drug\"\n            \" and substance quality specifications, and is allowed to reference a \"\n            \"MedicinalProductDefinition, SubstanceDefinition, \"\n            \"AdministrableProductDefinition, ManufacturedItemDefinition, or \"\n            \"PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    textEquivalent: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"textEquivalent\",\n        title=(\n            \"Static text equivalent of the action, used if the dynamic aspects \"\n            \"cannot be interpreted by the receiving system\"\n        ),\n        description=(\n            \"A text equivalent of the action to be performed. This provides a \"\n            \"human-interpretable description of the action when the definition is \"\n            \"consumed by a system that might not be capable of interpreting it \"\n            \"dynamically.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    textEquivalent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_textEquivalent\",\n        title=\"Extension field for ``textEquivalent``.\",\n    )\n\n    timingAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"timingAge\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timingDateTime\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timingDateTime\",\n        title=\"Extension field for ``timingDateTime``.\",\n    )\n\n    timingDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"timingDuration\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"timingRange\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"User-visible title\",\n        description=(\n            \"The textual description of the action displayed to a user. For \"\n            \"example, when the action is a test to be performed, the title would be\"\n            \" the title of the test such as Assay by HPLC.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    transform: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"transform\",\n        title=\"Transform to apply the template\",\n        description=(\n            \"A reference to a StructureMap resource that defines a transform that \"\n            \"can be executed to produce the intent resource using the \"\n            \"ActivityDefinition instance as the input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureMap\"],\n        },\n    )\n    transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_transform\", title=\"Extension field for ``transform``.\"\n    )\n\n    trigger: typing.List[fhirtypes.TriggerDefinitionType] | None = Field(\n        default=None,\n        alias=\"trigger\",\n        title=\"When the action should be triggered\",\n        description=\"A description of when the action should be triggered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"create | update | remove | fire-event\",\n        description=\"The type of action to perform (create, update, remove).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"prefix\",\n            \"title\",\n            \"description\",\n            \"textEquivalent\",\n            \"priority\",\n            \"code\",\n            \"reason\",\n            \"documentation\",\n            \"goalId\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"subjectCanonical\",\n            \"trigger\",\n            \"condition\",\n            \"input\",\n            \"output\",\n            \"relatedAction\",\n            \"timingDateTime\",\n            \"timingAge\",\n            \"timingPeriod\",\n            \"timingDuration\",\n            \"timingRange\",\n            \"timingTiming\",\n            \"participant\",\n            \"type\",\n            \"groupingBehavior\",\n            \"selectionBehavior\",\n            \"requiredBehavior\",\n            \"precheckBehavior\",\n            \"cardinalityBehavior\",\n            \"definitionCanonical\",\n            \"definitionUri\",\n            \"transform\",\n            \"dynamicValue\",\n            \"action\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"definition\": [\"definitionCanonical\", \"definitionUri\"],\n            \"subject\": [\n                \"subjectCanonical\",\n                \"subjectCodeableConcept\",\n                \"subjectReference\",\n            ],\n            \"timing\": [\n                \"timingAge\",\n                \"timingDateTime\",\n                \"timingDuration\",\n                \"timingPeriod\",\n                \"timingRange\",\n                \"timingTiming\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass PlanDefinitionActionCondition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Whether or not the action is applicable.\n    An expression that describes applicability criteria or start/stop\n    conditions for the action.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionCondition\"\n\n    expression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Boolean-valued expression\",\n        description=(\n            \"An expression that returns true or false, indicating whether the \"\n            \"condition is satisfied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"applicability | start | stop\",\n        description=\"The kind of condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"applicability\", \"start\", \"stop\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"kind\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"kind\", \"kind__ext\")]\n        return required_fields\n\n\nclass PlanDefinitionActionDynamicValue(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dynamic aspects of the definition.\n    Customizations that should be applied to the statically defined resource.\n    For example, if the dosage of a medication must be computed based on the\n    patient's weight, a customization would be used to specify an expression\n    that calculated the weight, and the path on the resource that would contain\n    the result.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionDynamicValue\"\n\n    expression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"An expression that provides the dynamic value for the customization\",\n        description=\"An expression specifying the value of the customized element.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"The path to the element to be set dynamically\",\n        description=(\n            \"The path to the element to be customized. This is the path on the \"\n            \"resource that will hold the result of the calculation defined by the \"\n            \"expression. The specified path SHALL be a FHIRPath resolveable on the \"\n            \"specified target type of the ActivityDefinition, and SHALL consist \"\n            \"only of identifiers, constant indexers, and a restricted subset of \"\n            \"functions. The path is allowed to contain qualifiers (.) to traverse \"\n            \"sub-elements, as well as indexers ([x]) to traverse multiple-\"\n            \"cardinality sub-elements (see the [Simple FHIRPath \"\n            \"Profile](fhirpath.html#simple) for full details).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"path\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PlanDefinitionActionParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who should participate in the action.\n    Indicates who should participate in performing the action described.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionParticipant\"\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"E.g. Nurse, Surgeon, Parent\",\n        description=(\n            \"The role the participant should play in performing the described \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"patient | practitioner | related-person | device\",\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"patient\", \"practitioner\", \"related-person\", \"device\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"role\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass PlanDefinitionActionRelatedAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationship to another action.\n    A relationship to another action such as \"before\" or \"30-60 minutes after\n    start of\".\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionRelatedAction\"\n\n    actionId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"actionId\",\n        title=\"What action is this related to\",\n        description=\"The element id of the related action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    actionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actionId\", title=\"Extension field for ``actionId``.\"\n    )\n\n    offsetDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"offsetDuration\",\n        title=\"Time offset for the relationship\",\n        description=(\n            \"A duration or range of durations to apply to the relationship. For \"\n            \"example, 30-60 minutes before.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e offset[x]\n            \"one_of_many\": \"offset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    offsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"offsetRange\",\n        title=\"Time offset for the relationship\",\n        description=(\n            \"A duration or range of durations to apply to the relationship. For \"\n            \"example, 30-60 minutes before.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e offset[x]\n            \"one_of_many\": \"offset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    relationship: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=(\n            \"before-start | before | before-end | concurrent-with-start | \"\n            \"concurrent | concurrent-with-end | after-start | after | after-end\"\n        ),\n        description=\"The relationship of this action to the related action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"before-start\",\n                \"before\",\n                \"before-end\",\n                \"concurrent-with-start\",\n                \"concurrent\",\n                \"concurrent-with-end\",\n                \"after-start\",\n                \"after\",\n                \"after-end\",\n            ],\n        },\n    )\n    relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relationship\",\n        title=\"Extension field for ``relationship``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionRelatedAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"actionId\",\n            \"relationship\",\n            \"offsetDuration\",\n            \"offsetRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionRelatedAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"actionId\", \"actionId__ext\"),\n            (\"relationship\", \"relationship__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"offset\": [\"offsetDuration\", \"offsetRange\"]}\n        return one_of_many_fields\n\n\nclass PlanDefinitionGoal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What the plan is trying to accomplish.\n    A goal describes an expected outcome that activities within the plan are\n    intended to achieve. For example, weight loss, restoring an activity of\n    daily living, obtaining herd immunity via immunization, meeting a process\n    improvement objective, meeting the acceptance criteria for a test as\n    specified by a quality specification, etc.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionGoal\"\n\n    addresses: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"addresses\",\n        title=\"What does the goal address\",\n        description=(\n            \"Identifies problems, conditions, issues, or concerns the goal is \"\n            \"intended to address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"E.g. Treatment, dietary, behavioral\",\n        description=\"Indicates a category the goal falls within.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"description\",\n        title=\"Code or text describing the goal\",\n        description=(\n            \"Human-readable and/or coded description of a specific desired \"\n            'objective of care, such as \"control blood pressure\" or \"negotiate an '\n            'obstacle course\" or \"dance with child at wedding\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Supporting documentation for the goal\",\n        description=(\n            \"Didactic or other informational resources associated with the goal \"\n            \"that provide further supporting information about the goal. \"\n            \"Information resources can include inline text commentary and links to \"\n            \"web resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"high-priority | medium-priority | low-priority\",\n        description=(\n            \"Identifies the expected level of importance associated with \"\n            \"reaching/sustaining the defined goal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    start: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"When goal pursuit begins\",\n        description=\"The event after which the goal should begin being pursued.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    target: typing.List[fhirtypes.PlanDefinitionGoalTargetType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Target outcome for the goal\",\n        description=\"Indicates what should be done and within what timeframe.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionGoal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"description\",\n            \"priority\",\n            \"start\",\n            \"addresses\",\n            \"documentation\",\n            \"target\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionGoal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PlanDefinitionGoalTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Target outcome for the goal.\n    Indicates what should be done and within what timeframe.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionGoalTarget\"\n\n    detailCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"detailCodeableConcept\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical\"\n            \" quality - NMT 0.6%, Clear solution, etc. Either the high or low or \"\n            \"both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any value at or \"\n            \"below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any value at or above the low \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"detailQuantity\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical\"\n            \" quality - NMT 0.6%, Clear solution, etc. Either the high or low or \"\n            \"both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any value at or \"\n            \"below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any value at or above the low \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"detailRange\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical\"\n            \" quality - NMT 0.6%, Clear solution, etc. Either the high or low or \"\n            \"both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any value at or \"\n            \"below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any value at or above the low \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    due: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"due\",\n        title=\"Reach goal within\",\n        description=(\n            \"Indicates the timeframe after the start of the goal in which the goal \"\n            \"should be met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    measure: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"measure\",\n        title=\"The parameter whose value is to be tracked\",\n        description=(\n            \"The parameter whose value is to be tracked, e.g. body weight, blood \"\n            \"pressure, or hemoglobin A1c level.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionGoalTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"measure\",\n            \"detailQuantity\",\n            \"detailRange\",\n            \"detailCodeableConcept\",\n            \"due\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionGoalTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"detail\": [\"detailCodeableConcept\", \"detailQuantity\", \"detailRange\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/population.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Population\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, fhirtypes\n\n\nclass Population(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A definition of a set of people that apply to some clinically related\n    context, for example people contraindicated for a certain medication.\n    A populatioof people with some set of grouping criteria.\n    \"\"\"\n\n    __resource_type__ = \"Population\"\n\n    ageCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"ageCodeableConcept\",\n        title=\"The age of the specific population\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e age[x]\n            \"one_of_many\": \"age\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    ageRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"ageRange\",\n        title=\"The age of the specific population\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e age[x]\n            \"one_of_many\": \"age\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    gender: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"The gender of the specific population\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    physiologicalCondition: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"physiologicalCondition\",\n        title=(\n            \"The existing physiological conditions of the specific population to \"\n            \"which this applies\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    race: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"race\",\n        title=\"Race of the specific population\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Population`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"ageRange\",\n            \"ageCodeableConcept\",\n            \"gender\",\n            \"race\",\n            \"physiologicalCondition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Population`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"ageRange\",\n            \"ageCodeableConcept\",\n            \"gender\",\n            \"race\",\n            \"physiologicalCondition\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"age\": [\"ageCodeableConcept\", \"ageRange\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/practitioner.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Practitioner\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Practitioner(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A person with a  formal responsibility in the provisioning of healthcare or\n    related services.\n    A person who is directly or indirectly involved in the provisioning of\n    healthcare.\n    \"\"\"\n\n    __resource_type__ = \"Practitioner\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this practitioner's record is in active use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=(\n            \"Address(es) of the practitioner that are not role specific (typically \"\n            \"home address)\"\n        ),\n        description=(\n            \"Address(es) of the practitioner that are not role specific (typically \"\n            \"home address).  Work addresses are not typically entered in this \"\n            \"property as they are usually role dependent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    birthDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"birthDate\",\n        title=\"The date  on which the practitioner was born\",\n        description=\"The date of birth for the practitioner.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_birthDate\", title=\"Extension field for ``birthDate``.\"\n    )\n\n    communication: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"communication\",\n        title=\"A language the practitioner can use in patient communication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the person is considered to \"\n            \"have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier for the person as this agent\",\n        description=\"An identifier that applies to this person in this role.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The name(s) associated with the practitioner\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    photo: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Image of the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    qualification: typing.List[fhirtypes.PractitionerQualificationType] | None = Field(\n        default=None,\n        alias=\"qualification\",\n        title=(\n            \"Certification, licenses, or training pertaining to the provision of \"\n            \"care\"\n        ),\n        description=(\n            \"The official certifications, training, and licenses that authorize or \"\n            \"otherwise pertain to the provision of care by the practitioner.  For \"\n            \"example, a medical license issued by a medical board authorizing the \"\n            \"practitioner to practice medicine within a certian locality.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the practitioner (that apply to all roles)\",\n        description=(\n            \"A contact detail for the practitioner, e.g. a telephone number or an \"\n            \"email address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Practitioner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"address\",\n            \"gender\",\n            \"birthDate\",\n            \"photo\",\n            \"qualification\",\n            \"communication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Practitioner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"address\",\n            \"gender\",\n            \"birthDate\",\n        ]\n\n\nclass PractitionerQualification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Certification, licenses, or training pertaining to the provision of care.\n    The official certifications, training, and licenses that authorize or\n    otherwise pertain to the provision of care by the practitioner.  For\n    example, a medical license issued by a medical board authorizing the\n    practitioner to practice medicine within a certian locality.\n    \"\"\"\n\n    __resource_type__ = \"PractitionerQualification\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Coded representation of the qualification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier for this qualification for the practitioner\",\n        description=(\n            \"An identifier that applies to this person's qualification in this \" \"role.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    issuer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"issuer\",\n        title=\"Organization that regulates and issues the qualification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period during which the qualification is valid\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PractitionerQualification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"period\",\n            \"issuer\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PractitionerQualification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/practitionerrole.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PractitionerRole\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass PractitionerRole(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Roles/organizations the practitioner is associated with.\n    A specific set of Roles/Locations/specialties/services that a practitioner\n    may perform at an organization for a period of time.\n    \"\"\"\n\n    __resource_type__ = \"PractitionerRole\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this practitioner role record is in active use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    availabilityExceptions: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"availabilityExceptions\",\n        title=\"Description of availability exceptions\",\n        description=(\n            \"A description of site availability exceptions, e.g. public holiday \"\n            \"availability. Succinctly describing all possible exceptions to normal \"\n            \"site availability as details in the available Times and not available \"\n            \"Times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availabilityExceptions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availabilityExceptions\",\n        title=\"Extension field for ``availabilityExceptions``.\",\n    )\n\n    availableTime: typing.List[\n        fhirtypes.PractitionerRoleAvailableTimeType\n    ] | None = Field(\n        default=None,\n        alias=\"availableTime\",\n        title=\"Times the Service Site is available\",\n        description=(\n            \"A collection of times the practitioner is available or performing this\"\n            \" role at the location and/or healthcareservice.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Roles which this practitioner may perform\",\n        description=(\n            \"Roles which this practitioner is authorized to perform for the \"\n            \"organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to services operated for the \"\n            \"practitioner with this role\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    healthcareService: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"healthcareService\",\n        title=(\n            \"The list of healthcare services that this worker provides for this \"\n            \"role's Organization/Location(s)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"HealthcareService\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifiers that are specific to a role/location\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"The location(s) at which this practitioner provides care\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    notAvailable: typing.List[\n        fhirtypes.PractitionerRoleNotAvailableType\n    ] | None = Field(\n        default=None,\n        alias=\"notAvailable\",\n        title=\"Not available during this time due to provided reason\",\n        description=(\n            \"The practitioner is not available or performing this role during this \"\n            \"period of time due to the provided reason.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Organization where the roles are available\",\n        description=\"The organization where the Practitioner performs the roles associated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=(\n            \"The period during which the practitioner is authorized to perform in \"\n            \"these role(s)\"\n        ),\n        description=(\n            \"The period during which the person is authorized to act as a \"\n            \"practitioner in these role(s) for the organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    practitioner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"practitioner\",\n        title=(\n            \"Practitioner that is able to provide the defined services for the \"\n            \"organization\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=\"Specific specialty of the practitioner\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contact details that are specific to the role/location/service\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PractitionerRole`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"period\",\n            \"practitioner\",\n            \"organization\",\n            \"code\",\n            \"specialty\",\n            \"location\",\n            \"healthcareService\",\n            \"telecom\",\n            \"availableTime\",\n            \"notAvailable\",\n            \"availabilityExceptions\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PractitionerRole`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"period\",\n            \"practitioner\",\n            \"organization\",\n            \"code\",\n            \"specialty\",\n            \"location\",\n            \"telecom\",\n        ]\n\n\nclass PractitionerRoleAvailableTime(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Times the Service Site is available.\n    A collection of times the practitioner is available or performing this role\n    at the location and/or healthcareservice.\n    \"\"\"\n\n    __resource_type__ = \"PractitionerRoleAvailableTime\"\n\n    allDay: bool | None = Field(\n        default=None,\n        alias=\"allDay\",\n        title=\"Always available? e.g. 24 hour service\",\n        description=(\n            \"Is this always available? (hence times are irrelevant) e.g. 24 hour \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    allDay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_allDay\", title=\"Extension field for ``allDay``.\"\n    )\n\n    availableEndTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"availableEndTime\",\n        title=\"Closing time of day (ignored if allDay = true)\",\n        description=(\n            \"The closing time of day. Note: If the AllDay flag is set, then this \"\n            \"time is ignored.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availableEndTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availableEndTime\",\n        title=\"Extension field for ``availableEndTime``.\",\n    )\n\n    availableStartTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"availableStartTime\",\n        title=\"Opening time of day (ignored if allDay = true)\",\n        description=(\n            \"The opening time of day. Note: If the AllDay flag is set, then this \"\n            \"time is ignored.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availableStartTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availableStartTime\",\n        title=\"Extension field for ``availableStartTime``.\",\n    )\n\n    daysOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"daysOfWeek\",\n        title=\"mon | tue | wed | thu | fri | sat | sun\",\n        description=(\n            \"Indicates which days of the week are available between the start and \"\n            \"end Times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"],\n        },\n    )\n    daysOfWeek__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_daysOfWeek\", title=\"Extension field for ``daysOfWeek``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PractitionerRoleAvailableTime`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"daysOfWeek\",\n            \"allDay\",\n            \"availableStartTime\",\n            \"availableEndTime\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PractitionerRoleAvailableTime`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PractitionerRoleNotAvailable(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Not available during this time due to provided reason.\n    The practitioner is not available or performing this role during this\n    period of time due to the provided reason.\n    \"\"\"\n\n    __resource_type__ = \"PractitionerRoleNotAvailable\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Reason presented to the user explaining why time not available\",\n        description=(\n            \"The reason that can be presented to the user as to why this time is \"\n            \"not available.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    during: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"during\",\n        title=\"Service not available from this date\",\n        description=(\n            \"Service is not available (seasonally or for a public holiday) from \"\n            \"this date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PractitionerRoleNotAvailable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"description\", \"during\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PractitionerRoleNotAvailable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"description\", \"description__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/procedure.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Procedure\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Procedure(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An action that is being or was performed on a patient.\n    An action that is or was performed on or for a patient. This can be a\n    physical intervention like an operation, or less invasive like long term\n    services, counseling, or hypnotherapy.\n    \"\"\"\n\n    __resource_type__ = \"Procedure\"\n\n    asserter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"asserter\",\n        title=\"Person who asserts this procedure\",\n        description=\"Individual who is making the procedure statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"A request for this procedure\",\n        description=(\n            \"A reference to a resource that contains details of the request for \"\n            \"this procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\", \"ServiceRequest\"],\n        },\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Target body sites\",\n        description=(\n            \"Detailed and structured anatomical location information. Multiple \"\n            \"locations are allowed - e.g. multiple punch biopsies of a lesion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classification of the procedure\",\n        description=(\n            \"A code that classifies the procedure for searching, sorting and \"\n            'display purposes (e.g. \"Surgical Procedure\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Identification of the procedure\",\n        description=(\n            \"The specific procedure that is performed. Use text if the exact nature\"\n            ' of the procedure cannot be coded (e.g. \"Laparoscopic Appendectomy\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    complication: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"complication\",\n        title=\"Complication following the procedure\",\n        description=(\n            \"Any complications that occurred during the procedure, or in the \"\n            \"immediate post-performance period. These are generally tracked \"\n            \"separately from the notes, which will typically describe the procedure\"\n            \" itself rather than any 'post procedure' issues.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    complicationDetail: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"complicationDetail\",\n        title=\"A condition that is a result of the procedure\",\n        description=(\n            \"Any complications that occurred during the procedure, or in the \"\n            \"immediate post-performance period.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter created as part of\",\n        description=(\n            \"The Encounter during which this Procedure was created or performed or \"\n            \"to which the creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    focalDevice: typing.List[fhirtypes.ProcedureFocalDeviceType] | None = Field(\n        default=None,\n        alias=\"focalDevice\",\n        title=\"Manipulated, implanted, or removed device\",\n        description=(\n            \"A device that is implanted, removed or otherwise manipulated \"\n            \"(calibration, battery replacement, fitting a prosthesis, attaching a \"\n            \"wound-vac, etc.) as a focal portion of the Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    followUp: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"followUp\",\n        title=\"Instructions for follow up\",\n        description=(\n            \"If the procedure required specific follow up - e.g. removal of \"\n            \"sutures. The follow up may be represented as a simple note or could \"\n            \"potentially be more complex, in which case the CarePlan resource can \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Identifiers for this procedure\",\n        description=(\n            \"Business identifiers assigned to this procedure by the performer or \"\n            \"other systems which remain constant as the resource is updated and is \"\n            \"propagated from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, order set or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"ActivityDefinition\",\n                \"Measure\",\n                \"OperationDefinition\",\n                \"Questionnaire\",\n            ],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"order set or other definition that is adhered to in whole or in part \"\n            \"by this Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the procedure happened\",\n        description=(\n            \"The location where the procedure actually happened.  E.g. a newborn at\"\n            \" home, a tracheostomy at a restaurant.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional information about the procedure\",\n        description=\"Any other notes and comments about the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"The result of procedure\",\n        description=(\n            \"The outcome of the procedure - did it resolve the reasons for the \"\n            \"procedure being performed?\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=(\n            \"A larger event of which this particular procedure is a component or \"\n            \"step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Procedure\",\n                \"Observation\",\n                \"MedicationAdministration\",\n            ],\n        },\n    )\n\n    performedAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"performedAge\",\n        title=\"When the procedure was performed\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" was performed.  Allows a period to support complex procedures that \"\n            \"span more than one date, and also allows for the length of the \"\n            \"procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e performed[x]\n            \"one_of_many\": \"performed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    performedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"performedDateTime\",\n        title=\"When the procedure was performed\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" was performed.  Allows a period to support complex procedures that \"\n            \"span more than one date, and also allows for the length of the \"\n            \"procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e performed[x]\n            \"one_of_many\": \"performed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    performedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_performedDateTime\",\n        title=\"Extension field for ``performedDateTime``.\",\n    )\n\n    performedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"performedPeriod\",\n        title=\"When the procedure was performed\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" was performed.  Allows a period to support complex procedures that \"\n            \"span more than one date, and also allows for the length of the \"\n            \"procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e performed[x]\n            \"one_of_many\": \"performed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    performedRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"performedRange\",\n        title=\"When the procedure was performed\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" was performed.  Allows a period to support complex procedures that \"\n            \"span more than one date, and also allows for the length of the \"\n            \"procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e performed[x]\n            \"one_of_many\": \"performed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    performedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"performedString\",\n        title=\"When the procedure was performed\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" was performed.  Allows a period to support complex procedures that \"\n            \"span more than one date, and also allows for the length of the \"\n            \"procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e performed[x]\n            \"one_of_many\": \"performed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    performedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_performedString\",\n        title=\"Extension field for ``performedString``.\",\n    )\n\n    performer: typing.List[fhirtypes.ProcedurePerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"The people who performed the procedure\",\n        description='Limited to \"real\" people rather than equipment.',\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Coded reason procedure performed\",\n        description=(\n            \"The coded reason why the procedure was performed. This may be a coded \"\n            \"entity of some type, or may simply be present as text.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"The justification that the procedure was performed\",\n        description=\"The justification of why the procedure was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"Procedure\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    recorder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recorder\",\n        title=\"Who recorded the procedure\",\n        description=(\n            \"Individual who recorded the record and takes responsibility for its \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    report: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"report\",\n        title=\"Any report resulting from the procedure\",\n        description=(\n            \"This could be a histology result, pathology report, surgical report, \"\n            \"etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n                \"Composition\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | not-done | on-hold | stopped | completed |\"\n            \" entered-in-error | unknown\"\n        ),\n        description=(\n            \"A code specifying the state of the procedure. Generally, this will be \"\n            \"the in-progress or completed state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"not-done\",\n                \"on-hold\",\n                \"stopped\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current state of the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who the procedure was performed on\",\n        description=\"The person, animal or group on which the procedure was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    usedCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"usedCode\",\n        title=\"Coded items used during the procedure\",\n        description=\"Identifies coded items that were used as part of the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usedReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"usedReference\",\n        title=\"Items used during procedure\",\n        description=(\n            \"Identifies medications, devices and any other substance used as part \"\n            \"of the procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"Medication\", \"Substance\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Procedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"performedDateTime\",\n            \"performedPeriod\",\n            \"performedString\",\n            \"performedAge\",\n            \"performedRange\",\n            \"recorder\",\n            \"asserter\",\n            \"performer\",\n            \"location\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"bodySite\",\n            \"outcome\",\n            \"report\",\n            \"complication\",\n            \"complicationDetail\",\n            \"followUp\",\n            \"note\",\n            \"focalDevice\",\n            \"usedReference\",\n            \"usedCode\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Procedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"performedDateTime\",\n            \"performedPeriod\",\n            \"performedString\",\n            \"performedAge\",\n            \"performedRange\",\n            \"recorder\",\n            \"asserter\",\n            \"performer\",\n            \"location\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"bodySite\",\n            \"outcome\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"performed\": [\n                \"performedAge\",\n                \"performedDateTime\",\n                \"performedPeriod\",\n                \"performedRange\",\n                \"performedString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ProcedureFocalDevice(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Manipulated, implanted, or removed device.\n    A device that is implanted, removed or otherwise manipulated (calibration,\n    battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as\n    a focal portion of the Procedure.\n    \"\"\"\n\n    __resource_type__ = \"ProcedureFocalDevice\"\n\n    action: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Kind of change to device\",\n        description=\"The kind of change that happened to the device during the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    manipulated: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"manipulated\",\n        title=\"Device that was changed\",\n        description=\"The device that was manipulated (changed) during the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProcedureFocalDevice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\", \"manipulated\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProcedureFocalDevice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ProcedurePerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The people who performed the procedure.\n    Limited to \"real\" people rather than equipment.\n    \"\"\"\n\n    __resource_type__ = \"ProcedurePerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"The reference to the practitioner\",\n        description=\"The practitioner who was involved in the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of performance\",\n        description=(\n            \"Distinguishes the type of involvement of the performer in the \"\n            \"procedure. For example, surgeon, anaesthetist, endoscopist.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization the device or practitioner was acting for\",\n        description=\"The organization the device or practitioner was acting on behalf of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProcedurePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"function\",\n            \"actor\",\n            \"onBehalfOf\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProcedurePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n"
  },
  {
    "path": "fhir/resources/R4B/prodcharacteristic.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ProdCharacteristic\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, fhirtypes\n\n\nclass ProdCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The marketing status describes the date when a medicinal product is\n    actually put on the market or the date as of which it is no longer\n    available.\n    \"\"\"\n\n    __resource_type__ = \"ProdCharacteristic\"\n\n    color: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"color\",\n        title=(\n            \"Where applicable, the color can be specified An appropriate controlled\"\n            \" vocabulary shall be used The term and the term identifier shall be \"\n            \"used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    color__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_color\", title=\"Extension field for ``color``.\"\n    )\n\n    depth: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"depth\",\n        title=(\n            \"Where applicable, the depth can be specified using a numerical value \"\n            \"and its unit of measurement The unit of measurement shall be specified\"\n            \" in accordance with ISO 11240 and the resulting terminology The symbol\"\n            \" and the symbol identifier shall be used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    externalDiameter: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"externalDiameter\",\n        title=(\n            \"Where applicable, the external diameter can be specified using a \"\n            \"numerical value and its unit of measurement The unit of measurement \"\n            \"shall be specified in accordance with ISO 11240 and the resulting \"\n            \"terminology The symbol and the symbol identifier shall be used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    height: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"height\",\n        title=(\n            \"Where applicable, the height can be specified using a numerical value \"\n            \"and its unit of measurement The unit of measurement shall be specified\"\n            \" in accordance with ISO 11240 and the resulting terminology The symbol\"\n            \" and the symbol identifier shall be used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    image: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"image\",\n        title=(\n            \"Where applicable, the image can be provided The format of the image \"\n            \"attachment shall be specified by regional implementations\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    imprint: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"imprint\",\n        title=\"Where applicable, the imprint can be specified as text\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    imprint__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_imprint\", title=\"Extension field for ``imprint``.\"\n    )\n\n    nominalVolume: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"nominalVolume\",\n        title=(\n            \"Where applicable, the nominal volume can be specified using a \"\n            \"numerical value and its unit of measurement The unit of measurement \"\n            \"shall be specified in accordance with ISO 11240 and the resulting \"\n            \"terminology The symbol and the symbol identifier shall be used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    scoring: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"scoring\",\n        title=(\n            \"Where applicable, the scoring can be specified An appropriate \"\n            \"controlled vocabulary shall be used The term and the term identifier \"\n            \"shall be used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    shape: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"shape\",\n        title=(\n            \"Where applicable, the shape can be specified An appropriate controlled\"\n            \" vocabulary shall be used The term and the term identifier shall be \"\n            \"used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    shape__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_shape\", title=\"Extension field for ``shape``.\"\n    )\n\n    weight: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"weight\",\n        title=(\n            \"Where applicable, the weight can be specified using a numerical value \"\n            \"and its unit of measurement The unit of measurement shall be specified\"\n            \" in accordance with ISO 11240 and the resulting terminology The symbol\"\n            \" and the symbol identifier shall be used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    width: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"width\",\n        title=(\n            \"Where applicable, the width can be specified using a numerical value \"\n            \"and its unit of measurement The unit of measurement shall be specified\"\n            \" in accordance with ISO 11240 and the resulting terminology The symbol\"\n            \" and the symbol identifier shall be used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProdCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"height\",\n            \"width\",\n            \"depth\",\n            \"weight\",\n            \"nominalVolume\",\n            \"externalDiameter\",\n            \"shape\",\n            \"color\",\n            \"imprint\",\n            \"image\",\n            \"scoring\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProdCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"height\",\n            \"width\",\n            \"depth\",\n            \"weight\",\n            \"nominalVolume\",\n            \"externalDiameter\",\n            \"shape\",\n            \"color\",\n            \"imprint\",\n            \"image\",\n            \"scoring\",\n        ]\n"
  },
  {
    "path": "fhir/resources/R4B/productshelflife.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ProductShelfLife\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, fhirtypes\n\n\nclass ProductShelfLife(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The shelf-life and storage information for a medicinal product item or\n    container can be described using this class.\n    \"\"\"\n\n    __resource_type__ = \"ProductShelfLife\"\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier for the packaged Medicinal Product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"period\",\n        title=(\n            \"The shelf life time period can be specified using a numerical value \"\n            \"for the period of time and its unit of time measurement The unit of \"\n            \"measurement shall be specified in accordance with ISO 11240 and the \"\n            \"resulting terminology The symbol and the symbol identifier shall be \"\n            \"used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specialPrecautionsForStorage: typing.List[\n        fhirtypes.CodeableConceptType\n    ] | None = Field(\n        default=None,\n        alias=\"specialPrecautionsForStorage\",\n        title=(\n            \"Special precautions for storage, if any, can be specified using an \"\n            \"appropriate controlled vocabulary The controlled term and the \"\n            \"controlled term identifier shall be specified\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=(\n            \"This describes the shelf life, taking into account various scenarios \"\n            \"such as shelf life of the packaged Medicinal Product itself, shelf \"\n            \"life after transformation where necessary and shelf life after the \"\n            \"first opening of a bottle, etc. The shelf life type shall be specified\"\n            \" using an appropriate controlled vocabulary The controlled term and \"\n            \"the controlled term identifier shall be specified\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProductShelfLife`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"period\",\n            \"specialPrecautionsForStorage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProductShelfLife`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"period\",\n            \"specialPrecautionsForStorage\",\n        ]\n"
  },
  {
    "path": "fhir/resources/R4B/provenance.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Provenance\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Provenance(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who, What, When for a set of resources.\n    Provenance of a resource is a record that describes entities and processes\n    involved in producing and delivering or otherwise influencing that\n    resource. Provenance provides a critical foundation for assessing\n    authenticity, enabling trust, and allowing reproducibility. Provenance\n    assertions are a form of contextual metadata and can themselves become\n    important records with their own provenance. Provenance statement indicates\n    clinical significance in terms of confidence in authenticity, reliability,\n    and trustworthiness, integrity, and stage in lifecycle (e.g. Document\n    Completion - has the artifact been legally authenticated), all of which may\n    impact security, privacy, and trust policies.\n    \"\"\"\n\n    __resource_type__ = \"Provenance\"\n\n    activity: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"activity\",\n        title=\"Activity that occurred\",\n        description=(\n            \"An activity is something that occurs over a period of time and acts \"\n            \"upon or with entities; it may include consuming, processing, \"\n            \"transforming, modifying, relocating, using, or generating entities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    agent: typing.List[fhirtypes.ProvenanceAgentType] = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Actor involved\",\n        description=(\n            \"An actor taking a role in an activity  for which it can be assigned \"\n            \"some degree of responsibility for the activity taking place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entity: typing.List[fhirtypes.ProvenanceEntityType] | None = Field(\n        default=None,\n        alias=\"entity\",\n        title=\"An entity used in this activity\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the activity occurred, if relevant\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    occurredDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurredDateTime\",\n        title=\"When the activity occurred\",\n        description=\"The period during which the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e occurred[x]\n            \"one_of_many\": \"occurred\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurredDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurredDateTime\",\n        title=\"Extension field for ``occurredDateTime``.\",\n    )\n\n    occurredPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurredPeriod\",\n        title=\"When the activity occurred\",\n        description=\"The period during which the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e occurred[x]\n            \"one_of_many\": \"occurred\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    policy: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"policy\",\n        title=\"Policy or plan the activity was defined by\",\n        description=(\n            \"Policy or plan the activity was defined by. Typically, a single \"\n            \"activity may have multiple applicable policy documents, such as \"\n            \"patient consent, guarantor funding, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    policy__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_policy\", title=\"Extension field for ``policy``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason the activity is occurring\",\n        description=\"The reason that the activity was taking place.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recorded: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"recorded\",\n        title=\"When the activity was recorded / updated\",\n        description=\"The instant of time at which the activity was recorded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recorded\", title=\"Extension field for ``recorded``.\"\n    )\n\n    signature: typing.List[fhirtypes.SignatureType] | None = Field(\n        default=None,\n        alias=\"signature\",\n        title=\"Signature on target\",\n        description=(\n            \"A digital signature on the target Reference(s). The signer should \"\n            \"match a Provenance.agent. The purpose of the signature is indicated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    target: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"target\",\n        title=\"Target Reference(s) (usually version specific)\",\n        description=(\n            \"The Reference(s) that were generated or updated by  the activity \"\n            \"described in this resource. A provenance can point to more than one \"\n            \"target if multiple resources were created/updated by the same \"\n            \"activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Provenance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"target\",\n            \"occurredPeriod\",\n            \"occurredDateTime\",\n            \"recorded\",\n            \"policy\",\n            \"location\",\n            \"reason\",\n            \"activity\",\n            \"agent\",\n            \"entity\",\n            \"signature\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Provenance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"target\", \"recorded\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"recorded\", \"recorded__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"occurred\": [\"occurredDateTime\", \"occurredPeriod\"]}\n        return one_of_many_fields\n\n\nclass ProvenanceAgent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Actor involved.\n    An actor taking a role in an activity  for which it can be assigned some\n    degree of responsibility for the activity taking place.\n    \"\"\"\n\n    __resource_type__ = \"ProvenanceAgent\"\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Who the agent is representing\",\n        description=\"The individual, device, or organization for whom the change was made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Device\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    role: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"What the agents role was\",\n        description=(\n            \"The function of the agent with respect to the activity. The security \"\n            \"role enabling the agent with respect to the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"How the agent participated\",\n        description=\"The participation the agent had with respect to the activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    who: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"who\",\n        title=\"Who participated\",\n        description=\"The individual, device or organization that participated in the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Device\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProvenanceAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"role\",\n            \"who\",\n            \"onBehalfOf\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProvenanceAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"who\"]\n\n\nclass ProvenanceEntity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An entity used in this activity.\n    \"\"\"\n\n    __resource_type__ = \"ProvenanceEntity\"\n\n    agent: typing.List[fhirtypes.ProvenanceAgentType] | None = Field(\n        default=None,\n        alias=\"agent\",\n        title=\"Entity is attributed to this agent\",\n        description=(\n            \"The entity is attributed to an agent to express the agent's \"\n            \"responsibility for that entity, possibly along with other agents. This\"\n            \" description can be understood as shorthand for saying that the agent \"\n            \"was responsible for the activity which generated the entity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"derivation | revision | quotation | source | removal\",\n        description=\"How the entity was used during the activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"derivation\", \"revision\", \"quotation\", \"source\", \"removal\"],\n        },\n    )\n    role__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_role\", title=\"Extension field for ``role``.\"\n    )\n\n    what: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"what\",\n        title=\"Identity of entity\",\n        description=(\n            \"Identity of the  Entity used. May be a logical or physical uri and \"\n            \"maybe absolute or relative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProvenanceEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"what\", \"agent\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProvenanceEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"role\", \"what\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"role\", \"role__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/quantity.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SimpleQuantity\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Quantity(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A measured or measurable amount.\n    A measured amount (or an amount that can potentially be measured). Note\n    that measured amounts include amounts that are not precisely quantified,\n    including amounts involving arbitrary units and floating currencies.\n    \"\"\"\n\n    __resource_type__ = \"Quantity\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Coded form of the unit\",\n        description=(\n            \"A computer processable form of the unit in some unit representation \"\n            \"system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    comparator: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"comparator\",\n        title=\"< | <= | >= | > - how to understand the value\",\n        description=(\n            \"How the value should be understood and represented - whether the \"\n            \"actual value is greater or less than the stated value due to \"\n            'measurement issues; e.g. if the comparator is \"<\" , then the real '\n            \"value is < stated value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comparator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comparator\", title=\"Extension field for ``comparator``.\"\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"System that defines coded unit form\",\n        description=(\n            \"The identification of the system that provides the coded form of the \"\n            \"unit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    unit: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Unit representation\",\n        description=\"A human-readable form of the unit.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    unit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_unit\", title=\"Extension field for ``unit``.\"\n    )\n\n    value: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Numerical value (with implicit precision)\",\n        description=(\n            \"The value of the measured amount. The value includes an implicit \"\n            \"precision in the presentation of the value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Quantity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Quantity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/R4B/questionnaire.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Questionnaire\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Questionnaire(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A structured set of questions.\n    A structured set of questions intended to guide the collection of answers\n    from end-users. Questionnaires provide detailed control over order,\n    presentation, phraseology and grouping to allow coherent, consistent data\n    collection.\n    \"\"\"\n\n    __resource_type__ = \"Questionnaire\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the questionnaire was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Concept that represents the overall questionnaire\",\n        description=(\n            \"An identifier for this question or group of questions in a particular \"\n            \"terminology such as LOINC.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the questionnaire and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the questionnaire was published. \"\n            \"The date must change when the business version changes and it must \"\n            \"change if the status code changes. In addition, it should change when \"\n            \"the substantive content of the questionnaire changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFrom: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Instantiates protocol or definition\",\n        description=\"The URL of a Questionnaire that this Questionnaire is based on.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Questionnaire\"],\n        },\n    )\n    derivedFrom__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_derivedFrom\", title=\"Extension field for ``derivedFrom``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the questionnaire\",\n        description=(\n            \"A free text natural language description of the questionnaire from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the questionnaire is expected to be used\",\n        description=(\n            \"The period during which the questionnaire content was or is planned to\"\n            \" be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this questionnaire is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the questionnaire\",\n        description=(\n            \"A formal identifier that is used to identify this questionnaire when \"\n            \"it is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    item: typing.List[fhirtypes.QuestionnaireItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Questions and sections within the Questionnaire\",\n        description=(\n            \"A particular question, question grouping or display text that is part \"\n            \"of the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for questionnaire (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the questionnaire is intended to\"\n            \" be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the questionnaire was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this questionnaire (computer friendly)\",\n        description=(\n            \"A natural language name identifying the questionnaire. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the \"\n            \"questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this questionnaire is defined\",\n        description=(\n            \"Explanation of why this questionnaire is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this questionnaire. Enables tracking the life-cycle of \"\n            \"the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectType: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"subjectType\",\n        title=\"Resource that can be subject of QuestionnaireResponse\",\n        description=(\n            \"The types of subjects that can be the subject of responses created for\"\n            \" the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subjectType__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_subjectType\", title=\"Extension field for ``subjectType``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this questionnaire (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the questionnaire.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this questionnaire, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this questionnaire when it is\"\n            \" referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this questionnaire is (or will be) published. This URL can\"\n            \" be the target of a canonical reference. It SHALL remain the same when\"\n            \" the questionnaire is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate questionnaire instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the questionnaire\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"questionnaire when it is referenced in a specification, model, design \"\n            \"or instance. This is an arbitrary value managed by the questionnaire \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Questionnaire`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"derivedFrom\",\n            \"status\",\n            \"experimental\",\n            \"subjectType\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"code\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Questionnaire`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"subjectType\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"code\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass QuestionnaireItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Questions and sections within the Questionnaire.\n    A particular question, question grouping or display text that is part of\n    the questionnaire.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireItem\"\n\n    answerOption: typing.List[\n        fhirtypes.QuestionnaireItemAnswerOptionType\n    ] | None = Field(\n        default=None,\n        alias=\"answerOption\",\n        title=\"Permitted answer\",\n        description='One of the permitted answers for a \"choice\" or \"open-choice\" question.',\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    answerValueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"answerValueSet\",\n        title=\"Valueset containing permitted answers\",\n        description=(\n            \"A reference to a value set containing a list of codes representing \"\n            'permitted answers for a \"choice\" or \"open-choice\" question.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    answerValueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerValueSet\",\n        title=\"Extension field for ``answerValueSet``.\",\n    )\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Corresponding concept for this item in a terminology\",\n        description=(\n            \"A terminology code that corresponds to this group or question (e.g. a \"\n            \"code from LOINC, which defines many questions and answers).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"ElementDefinition - details for the item\",\n        description=(\n            \"This element is a URI that refers to an \"\n            \"[ElementDefinition](elementdefinition.html) that provides information \"\n            \"about this item, including information that might otherwise be \"\n            \"included in the instance of the Questionnaire resource. A detailed \"\n            \"description of the construction of the URI is shown in Comments, \"\n            \"below. If this element is present then the following element values \"\n            \"MAY be derived from the Element Definition if the corresponding \"\n            \"elements of this Questionnaire resource instance have no value:  * \"\n            \"code (ElementDefinition.code)  * type (ElementDefinition.type)  * \"\n            \"required (ElementDefinition.min)  * repeats (ElementDefinition.max)  *\"\n            \" maxLength (ElementDefinition.maxLength)  * answerValueSet \"\n            \"(ElementDefinition.binding) * options (ElementDefinition.binding).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    enableBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"enableBehavior\",\n        title=\"all | any\",\n        description=(\n            \"Controls how multiple enableWhen values are interpreted -  whether all\"\n            \" or any must be true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"all\", \"any\"],\n        },\n    )\n    enableBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_enableBehavior\",\n        title=\"Extension field for ``enableBehavior``.\",\n    )\n\n    enableWhen: typing.List[fhirtypes.QuestionnaireItemEnableWhenType] | None = Field(\n        default=None,\n        alias=\"enableWhen\",\n        title=\"Only allow data when\",\n        description=(\n            \"A constraint indicating that this item should only be enabled \"\n            \"(displayed/allow answers to be captured) when the specified condition \"\n            \"is true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    initial: typing.List[fhirtypes.QuestionnaireItemInitialType] | None = Field(\n        default=None,\n        alias=\"initial\",\n        title=\"Initial value(s) when item is first rendered\",\n        description=(\n            \"One or more values that should be pre-populated in the answer when \"\n            \"initially rendering the questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    item: typing.List[fhirtypes.QuestionnaireItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Nested questionnaire items\",\n        description=(\n            \"Text, questions and other groups to be nested beneath a question or \"\n            \"group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Unique id for item in questionnaire\",\n        description=(\n            \"An identifier that is unique within the Questionnaire allowing linkage\"\n            \" to the equivalent item in a QuestionnaireResponse resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    maxLength: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"maxLength\",\n        title=\"No more than this many characters\",\n        description=(\n            \"The maximum number of characters that are permitted in the answer to \"\n            'be considered a \"valid\" QuestionnaireResponse.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    maxLength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_maxLength\", title=\"Extension field for ``maxLength``.\"\n    )\n\n    prefix: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"prefix\",\n        title='E.g. \"1(a)\", \"2.5.3\"',\n        description=(\n            \"A short label for a particular group, question or set of display text \"\n            \"within the questionnaire used for reference by the individual \"\n            \"completing the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_prefix\", title=\"Extension field for ``prefix``.\"\n    )\n\n    readOnly: bool | None = Field(\n        default=None,\n        alias=\"readOnly\",\n        title=\"Don't allow human editing\",\n        description=(\n            \"An indication, when true, that the value cannot be changed by a human \"\n            \"respondent to the Questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    readOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_readOnly\", title=\"Extension field for ``readOnly``.\"\n    )\n\n    repeats: bool | None = Field(\n        default=None,\n        alias=\"repeats\",\n        title=\"Whether the item may repeat\",\n        description=(\n            \"An indication, if true, that the item may occur multiple times in the \"\n            \"response, collecting multiple answers for questions or multiple sets \"\n            \"of answers for groups.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    repeats__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_repeats\", title=\"Extension field for ``repeats``.\"\n    )\n\n    required: bool | None = Field(\n        default=None,\n        alias=\"required\",\n        title=\"Whether the item must be included in data results\",\n        description=(\n            'An indication, if true, that the item must be present in a \"completed\"'\n            \" QuestionnaireResponse.  If false, the item may be skipped when \"\n            \"answering the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_required\", title=\"Extension field for ``required``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Primary text for the item\",\n        description=(\n            \"The name of a section, the text of a question or text content for a \"\n            \"display item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"group | display | boolean | decimal | integer | date | dateTime +\",\n        description=(\n            \"The type of questionnaire item this is - whether text for display, a \"\n            \"grouping of other items or a particular type of data to be captured \"\n            \"(string, integer, coded choice, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"group\",\n                \"display\",\n                \"boolean\",\n                \"decimal\",\n                \"integer\",\n                \"date\",\n                \"dateTime\",\n                \"+\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"definition\",\n            \"code\",\n            \"prefix\",\n            \"text\",\n            \"type\",\n            \"enableWhen\",\n            \"enableBehavior\",\n            \"required\",\n            \"repeats\",\n            \"readOnly\",\n            \"maxLength\",\n            \"answerValueSet\",\n            \"answerOption\",\n            \"initial\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"linkId\", \"linkId__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass QuestionnaireItemAnswerOption(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Permitted answer.\n    One of the permitted answers for a \"choice\" or \"open-choice\" question.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireItemAnswerOption\"\n\n    initialSelected: bool | None = Field(\n        default=None,\n        alias=\"initialSelected\",\n        title=\"Whether option is selected by default\",\n        description=(\n            \"Indicates whether the answer value is selected when the list of \"\n            \"possible answers is initially shown.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    initialSelected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_initialSelected\",\n        title=\"Extension field for ``initialSelected``.\",\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireItemAnswerOption`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueInteger\",\n            \"valueDate\",\n            \"valueTime\",\n            \"valueString\",\n            \"valueCoding\",\n            \"valueReference\",\n            \"initialSelected\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireItemAnswerOption`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueCoding\",\n                \"valueDate\",\n                \"valueInteger\",\n                \"valueReference\",\n                \"valueString\",\n                \"valueTime\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass QuestionnaireItemEnableWhen(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Only allow data when.\n    A constraint indicating that this item should only be enabled\n    (displayed/allow answers to be captured) when the specified condition is\n    true.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireItemEnableWhen\"\n\n    answerBoolean: bool | None = Field(\n        default=None,\n        alias=\"answerBoolean\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerBoolean\",\n        title=\"Extension field for ``answerBoolean``.\",\n    )\n\n    answerCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"answerCoding\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    answerDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"answerDate\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_answerDate\", title=\"Extension field for ``answerDate``.\"\n    )\n\n    answerDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"answerDateTime\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerDateTime\",\n        title=\"Extension field for ``answerDateTime``.\",\n    )\n\n    answerDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"answerDecimal\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerDecimal\",\n        title=\"Extension field for ``answerDecimal``.\",\n    )\n\n    answerInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"answerInteger\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerInteger\",\n        title=\"Extension field for ``answerInteger``.\",\n    )\n\n    answerQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"answerQuantity\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    answerReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"answerReference\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    answerString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"answerString\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerString\",\n        title=\"Extension field for ``answerString``.\",\n    )\n\n    answerTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"answerTime\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_answerTime\", title=\"Extension field for ``answerTime``.\"\n    )\n\n    operator: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"operator\",\n        title=\"exists | = | != | > | < | >= | <=\",\n        description=\"Specifies the criteria by which the question is enabled.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"exists\",\n                \"=\",\n                \"!=\",\n                \"\\u003e\",\n                \"\\u003c\",\n                \"\\u003e=\",\n                \"\\u003c=\",\n            ],\n        },\n    )\n    operator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_operator\", title=\"Extension field for ``operator``.\"\n    )\n\n    question: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"question\",\n        title=\"Question that determines whether item is enabled\",\n        description=(\n            \"The linkId for the question whose answer (or lack of answer) governs \"\n            \"whether this item is enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    question__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_question\", title=\"Extension field for ``question``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireItemEnableWhen`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"question\",\n            \"operator\",\n            \"answerBoolean\",\n            \"answerDecimal\",\n            \"answerInteger\",\n            \"answerDate\",\n            \"answerDateTime\",\n            \"answerTime\",\n            \"answerString\",\n            \"answerCoding\",\n            \"answerQuantity\",\n            \"answerReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireItemEnableWhen`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"operator\", \"operator__ext\"), (\"question\", \"question__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"answer\": [\n                \"answerBoolean\",\n                \"answerCoding\",\n                \"answerDate\",\n                \"answerDateTime\",\n                \"answerDecimal\",\n                \"answerInteger\",\n                \"answerQuantity\",\n                \"answerReference\",\n                \"answerString\",\n                \"answerTime\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass QuestionnaireItemInitial(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Initial value(s) when item is first rendered.\n    One or more values that should be pre-populated in the answer when\n    initially rendering the questionnaire for user input.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireItemInitial\"\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireItemInitial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueBoolean\",\n            \"valueDecimal\",\n            \"valueInteger\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueTime\",\n            \"valueString\",\n            \"valueUri\",\n            \"valueAttachment\",\n            \"valueCoding\",\n            \"valueQuantity\",\n            \"valueReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireItemInitial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCoding\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/questionnaireresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass QuestionnaireResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A structured set of questions and their answers.\n    A structured set of questions and their answers. The questions are ordered\n    and grouped into coherent subsets, corresponding to the structure of the\n    grouping of the questionnaire being responded to.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireResponse\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Person who received and recorded the answers\",\n        description=(\n            \"Person who received the answers to the questions in the \"\n            \"QuestionnaireResponse and recorded them in the system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    authored: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authored\",\n        title=\"Date the answers were gathered\",\n        description=\"The date and/or time that this set of answers were last changed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authored__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authored\", title=\"Extension field for ``authored``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this QuestionnaireResponse\",\n        description=(\n            \"The order, proposal or plan that is fulfilled in whole or in part by \"\n            \"this QuestionnaireResponse.  For example, a ServiceRequest seeking an \"\n            \"intake assessment or a decision support recommendation to assess for \"\n            \"post-partum depression.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\", \"ServiceRequest\"],\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter created as part of\",\n        description=(\n            \"The Encounter during which this questionnaire response was created or \"\n            \"to which the creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique id for this set of answers\",\n        description=(\n            \"A business identifier assigned to a particular completed (or partially\"\n            \" completed) questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Groups and questions\",\n        description=(\n            \"A group or question item from the original questionnaire for which \"\n            \"answers are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of this action\",\n        description=(\n            \"A procedure or observation that this questionnaire was performed as \"\n            \"part of the execution of.  For example, the surgery a checklist was \"\n            \"executed as part of.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\", \"Procedure\"],\n        },\n    )\n\n    questionnaire: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"questionnaire\",\n        title=\"Form being answered\",\n        description=(\n            \"The Questionnaire that defines and organizes the questions for which \"\n            \"answers are being provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Questionnaire\"],\n        },\n    )\n    questionnaire__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_questionnaire\",\n        title=\"Extension field for ``questionnaire``.\",\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"The person who answered the questions\",\n        description=\"The person who answered the questions about the subject.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"in-progress | completed | amended | entered-in-error | stopped\",\n        description=(\n            \"The position of the questionnaire response within its overall \"\n            \"lifecycle.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"in-progress\",\n                \"completed\",\n                \"amended\",\n                \"entered-in-error\",\n                \"stopped\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The subject of the questions\",\n        description=(\n            \"The subject of the questionnaire response.  This could be a patient, \"\n            \"organization, practitioner, device, etc.  This is who/what the answers\"\n            \" apply to, but is not necessarily the source of information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"questionnaire\",\n            \"status\",\n            \"subject\",\n            \"encounter\",\n            \"authored\",\n            \"author\",\n            \"source\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"questionnaire\",\n            \"status\",\n            \"subject\",\n            \"encounter\",\n            \"authored\",\n            \"author\",\n            \"source\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass QuestionnaireResponseItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Groups and questions.\n    A group or question item from the original questionnaire for which answers\n    are provided.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireResponseItem\"\n\n    answer: typing.List[fhirtypes.QuestionnaireResponseItemAnswerType] | None = Field(\n        default=None,\n        alias=\"answer\",\n        title=\"The response(s) to the question\",\n        description=\"The respondent's answer(s) to the question.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"ElementDefinition - details for the item\",\n        description=(\n            \"A reference to an [ElementDefinition](elementdefinition.html) that \"\n            \"provides the details for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Nested questionnaire response items\",\n        description=\"Questions or sub-groups nested beneath a question or group.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific item from Questionnaire\",\n        description=(\n            \"The item from the Questionnaire that corresponds to this item in the \"\n            \"QuestionnaireResponse resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Name for group or question text\",\n        description=(\n            \"Text that is displayed above the contents of the group or as the text \"\n            \"of the question being answered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireResponseItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"definition\",\n            \"text\",\n            \"answer\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireResponseItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"linkId\", \"linkId__ext\")]\n        return required_fields\n\n\nclass QuestionnaireResponseItemAnswer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The response(s) to the question.\n    The respondent's answer(s) to the question.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireResponseItemAnswer\"\n\n    item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Nested groups and questions\",\n        description=\"Nested groups and/or questions found within this particular answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireResponseItemAnswer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueBoolean\",\n            \"valueDecimal\",\n            \"valueInteger\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueTime\",\n            \"valueString\",\n            \"valueUri\",\n            \"valueAttachment\",\n            \"valueCoding\",\n            \"valueQuantity\",\n            \"valueReference\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireResponseItemAnswer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCoding\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/range.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Range\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Range(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Set of values bounded by low and high.\n    A set of ordered Quantities defined by a low and high limit.\n    \"\"\"\n\n    __resource_type__ = \"Range\"\n\n    high: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"high\",\n        title=\"High limit\",\n        description=\"The high limit. The boundary is inclusive.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    low: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"low\",\n        title=\"Low limit\",\n        description=\"The low limit. The boundary is inclusive.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Range`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"low\", \"high\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Range`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"low\", \"high\"]\n"
  },
  {
    "path": "fhir/resources/R4B/ratio.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Ratio\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Ratio(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A ratio of two Quantity values - a numerator and a denominator.\n    A relationship of two Quantity values - expressed as a numerator and a\n    denominator.\n    \"\"\"\n\n    __resource_type__ = \"Ratio\"\n\n    denominator: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"denominator\",\n        title=\"Denominator value\",\n        description=\"The value of the denominator.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    numerator: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"numerator\",\n        title=\"Numerator value\",\n        description=\"The value of the numerator.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Ratio`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"numerator\", \"denominator\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Ratio`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"numerator\", \"denominator\"]\n"
  },
  {
    "path": "fhir/resources/R4B/ratiorange.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RatioRange\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass RatioRange(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Range of ratio values.\n    A range of ratios expressed as a low and high numerator and a denominator.\n    \"\"\"\n\n    __resource_type__ = \"RatioRange\"\n\n    denominator: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"denominator\",\n        title=\"Denominator value\",\n        description=\"The value of the denominator.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    highNumerator: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"highNumerator\",\n        title=\"High Numerator limit\",\n        description=\"The value of the high limit numerator.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lowNumerator: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"lowNumerator\",\n        title=\"Low Numerator limit\",\n        description=\"The value of the low limit numerator.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RatioRange`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"lowNumerator\", \"highNumerator\", \"denominator\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RatioRange`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"lowNumerator\", \"highNumerator\", \"denominator\"]\n"
  },
  {
    "path": "fhir/resources/R4B/reference.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Reference\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Reference(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reference from one resource to another.\n    \"\"\"\n\n    __resource_type__ = \"Reference\"\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Text alternative for the resource\",\n        description=(\n            \"Plain text narrative that identifies the resource in addition to the \"\n            \"resource reference.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Logical reference, when literal reference is not known\",\n        description=(\n            \"An identifier for the target resource. This is used when there is no \"\n            \"way to reference the other resource directly, either because the \"\n            \"entity it represents is not available through a FHIR server, or \"\n            \"because there is no way for the author of the resource to convert a \"\n            \"known identifier to an actual location. There is no requirement that a\"\n            \" Reference.identifier point to something that is actually exposed as a\"\n            \" FHIR instance, but it SHALL point to a business concept that would be\"\n            \" expected to be exposed as a FHIR instance, and that instance would \"\n            \"need to be of a FHIR resource type allowed by the reference.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reference: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Literal reference, Relative, internal or absolute URL\",\n        description=(\n            \"A reference to a location at which the other resource is found. The \"\n            \"reference may be a relative reference, in which case it is relative to\"\n            \" the service base URL, or an absolute URL that resolves to the \"\n            \"location where the resource is found. The reference may be version \"\n            \"specific or not. If the reference is not to a FHIR RESTful server, \"\n            \"then it should be assumed to be version specific. Internal fragment \"\n            \"references (start with '#') refer to contained resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    type: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"type\",\n        title='Type the reference refers to (e.g. \"Patient\")',\n        description=(\n            \"The expected type of the target of the reference. If both \"\n            \"Reference.type and Reference.reference are populated and \"\n            \"Reference.reference is a FHIR URL, both SHALL be consistent.  The type\"\n            \" is the Canonical URL of Resource Definition that is the type this \"\n            \"reference refers to. References are URLs that are relative to \"\n            'http://hl7.org/fhir/StructureDefinition/ e.g. \"Patient\" is a reference'\n            \" to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are\"\n            \" only allowed for logical models (and can only be used in references \"\n            \"in logical models, not resources).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Reference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"reference\", \"type\", \"identifier\", \"display\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Reference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"reference\", \"type\", \"identifier\", \"display\"]\n"
  },
  {
    "path": "fhir/resources/R4B/regulatedauthorization.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RegulatedAuthorization\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass RegulatedAuthorization(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Regulatory approval, clearance or licencing related to a regulated product,\n    treatment, facility or activity e.g. Market Authorization for a Medicinal\n    Product.\n    Regulatory approval, clearance or licencing related to a regulated product,\n    treatment, facility or activity that is cited in a guidance, regulation,\n    rule or legislative act. An example is Market Authorization relating to a\n    Medicinal Product.\n    \"\"\"\n\n    __resource_type__ = \"RegulatedAuthorization\"\n\n    basis: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"basis\",\n        title=(\n            \"The legal/regulatory framework or reasons under which this \"\n            \"authorization is granted\"\n        ),\n        description=(\n            \"The legal or regulatory framework against which this authorization is \"\n            \"granted, or other reasons for it.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    case: fhirtypes.RegulatedAuthorizationCaseType | None = Field(\n        default=None,\n        alias=\"case\",\n        title=(\n            \"The case or regulatory procedure for granting or amending a regulated \"\n            \"authorization. Note: This area is subject to ongoing review and the \"\n            \"workgroup is seeking implementer feedback on its use (see link at \"\n            \"bottom of page)\"\n        ),\n        description=(\n            \"The case or regulatory procedure for granting or amending a regulated \"\n            \"authorization. An authorization is granted in response to \"\n            \"submissions/applications by those seeking authorization. A case is the\"\n            \" administrative process that deals with the application(s) that relate\"\n            \" to this and assesses them. Note: This area is subject to ongoing \"\n            \"review and the workgroup is seeking implementer feedback on its use \"\n            \"(see link at bottom of page).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"General textual supporting information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    holder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"holder\",\n        title=(\n            \"The organization that has been granted this authorization, by the \"\n            \"regulator\"\n        ),\n        description=(\n            \"The organization that has been granted this authorization, by some \"\n            \"authoritative body (the 'regulator').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"Business identifier for the authorization, typically assigned by the \"\n            \"authorizing body\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    indication: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"indication\",\n        title=\"Condition for which the use of the regulated product applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClinicalUseDefinition\"],\n        },\n    )\n\n    intendedUse: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"intendedUse\",\n        title=\"The intended use of the product, e.g. prevention, treatment\",\n        description=(\n            \"The intended use of the product, e.g. prevention, treatment, \" \"diagnosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    region: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"region\",\n        title=\"The territory in which the authorization has been granted\",\n        description=(\n            \"The territory (e.g., country, jurisdiction etc.) in which the \"\n            \"authorization has been granted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    regulator: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"regulator\",\n        title=(\n            \"The regulatory authority or authorizing body granting the \" \"authorization\"\n        ),\n        description=(\n            \"The regulatory authority or authorizing body granting the \"\n            \"authorization. For example, European Medicines Agency (EMA), Food and \"\n            \"Drug Administration (FDA), Health Canada (HC), etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"The status that is authorised e.g. approved. Intermediate states can \"\n            \"be tracked with cases and applications\"\n        ),\n        description=(\n            \"The status that is authorised e.g. approved. Intermediate states and \"\n            \"actions can be tracked with cases and applications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    statusDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"The date at which the current status was assigned\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    subject: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=(\n            \"The product type, treatment, facility or activity that is being \"\n            \"authorized\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicinalProductDefinition\",\n                \"BiologicallyDerivedProduct\",\n                \"NutritionProduct\",\n                \"PackagedProductDefinition\",\n                \"SubstanceDefinition\",\n                \"DeviceDefinition\",\n                \"ResearchStudy\",\n                \"ActivityDefinition\",\n                \"PlanDefinition\",\n                \"ObservationDefinition\",\n                \"Practitioner\",\n                \"Organization\",\n                \"Location\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Overall type of this authorization, for example drug marketing \"\n            \"approval, orphan drug designation\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    validityPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"validityPeriod\",\n        title=(\n            \"The time period in which the regulatory approval etc. is in effect, \"\n            \"e.g. a Marketing Authorization includes the date of authorization \"\n            \"and/or expiration date\"\n        ),\n        description=(\n            \"The time period in which the regulatory approval, clearance or \"\n            \"licencing is in effect. As an example, a Marketing Authorization \"\n            \"includes the date of authorization and/or an expiration date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RegulatedAuthorization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"subject\",\n            \"type\",\n            \"description\",\n            \"region\",\n            \"status\",\n            \"statusDate\",\n            \"validityPeriod\",\n            \"indication\",\n            \"intendedUse\",\n            \"basis\",\n            \"holder\",\n            \"regulator\",\n            \"case\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RegulatedAuthorization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"subject\",\n            \"type\",\n            \"description\",\n            \"region\",\n            \"status\",\n            \"statusDate\",\n            \"validityPeriod\",\n            \"indication\",\n            \"intendedUse\",\n            \"basis\",\n            \"holder\",\n            \"regulator\",\n            \"case\",\n        ]\n\n\nclass RegulatedAuthorizationCase(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The case or regulatory procedure for granting or amending a regulated\n    authorization. Note: This area is subject to ongoing review and the\n    workgroup is seeking implementer feedback on its use (see link at bottom of\n    page).\n    The case or regulatory procedure for granting or amending a regulated\n    authorization. An authorization is granted in response to\n    submissions/applications by those seeking authorization. A case is the\n    administrative process that deals with the application(s) that relate to\n    this and assesses them. Note: This area is subject to ongoing review and\n    the workgroup is seeking implementer feedback on its use (see link at\n    bottom of page).\n    \"\"\"\n\n    __resource_type__ = \"RegulatedAuthorizationCase\"\n\n    application: typing.List[fhirtypes.RegulatedAuthorizationCaseType] | None = Field(\n        default=None,\n        alias=\"application\",\n        title=(\n            \"Applications submitted to obtain a regulated authorization. Steps \"\n            \"within the longer running case or procedure\"\n        ),\n        description=(\n            \"A regulatory submission from an organization to a regulator, as part \"\n            \"of an assessing case. Multiple applications may occur over time, with \"\n            \"more or different information to support or modify the submission or \"\n            \"the authorization. The applications can be considered as steps within \"\n            \"the longer running case or procedure for this authorization process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dateDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateDateTime\",\n        title=\"Relevant date for this case\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e date[x]\n            \"one_of_many\": \"date\",\n            \"one_of_many_required\": False,\n        },\n    )\n    dateDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_dateDateTime\",\n        title=\"Extension field for ``dateDateTime``.\",\n    )\n\n    datePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"datePeriod\",\n        title=\"Relevant date for this case\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e date[x]\n            \"one_of_many\": \"date\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier by which this case can be referenced\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"The status associated with the case\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The defining type of case\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RegulatedAuthorizationCase`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"status\",\n            \"datePeriod\",\n            \"dateDateTime\",\n            \"application\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RegulatedAuthorizationCase`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"status\",\n            \"datePeriod\",\n            \"dateDateTime\",\n            \"application\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"date\": [\"dateDateTime\", \"datePeriod\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/relatedartifact.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RelatedArtifact\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass RelatedArtifact(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Related artifacts for a knowledge resource.\n    Related artifacts such as additional documentation, justification, or\n    bibliographic references.\n    \"\"\"\n\n    __resource_type__ = \"RelatedArtifact\"\n\n    citation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"citation\",\n        title=\"Bibliographic citation for the artifact\",\n        description=(\n            \"A bibliographic citation for the related artifact. This text SHOULD be\"\n            \" formatted according to an accepted citation format.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    citation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_citation\", title=\"Extension field for ``citation``.\"\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Brief description of the related artifact\",\n        description=(\n            \"A brief description of the document or knowledge resource being \"\n            \"referenced, suitable for display to a consumer.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    document: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"document\",\n        title=\"What document is being referenced\",\n        description=(\n            \"The document being referenced, represented as an attachment. This is \"\n            \"exclusive with the resource element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Short label\",\n        description=(\n            \"A short label that can be used to reference the citation from \"\n            \"elsewhere in the containing artifact, such as a footnote index.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    resource: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"What resource is being referenced\",\n        description=(\n            \"The related resource, such as a library, value set, profile, or other \"\n            \"knowledge resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"documentation | justification | citation | predecessor | successor | \"\n            \"derived-from | depends-on | composed-of\"\n        ),\n        description=\"The type of relationship to the related artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"documentation\",\n                \"justification\",\n                \"citation\",\n                \"predecessor\",\n                \"successor\",\n                \"derived-from\",\n                \"depends-on\",\n                \"composed-of\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Where the artifact can be accessed\",\n        description=(\n            \"A url for the artifact that can be followed to access the actual \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RelatedArtifact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"label\",\n            \"display\",\n            \"citation\",\n            \"url\",\n            \"document\",\n            \"resource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RelatedArtifact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"type\", \"label\", \"display\", \"citation\", \"url\", \"document\", \"resource\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/relatedperson.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RelatedPerson\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass RelatedPerson(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A person that is related to a patient, but who is not a direct target of\n    care.\n    Information about a person that is involved in the care for a patient, but\n    who is not the target of healthcare, nor has a formal responsibility in the\n    care process.\n    \"\"\"\n\n    __resource_type__ = \"RelatedPerson\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this related person's record is in active use\",\n        description=\"Whether this related person record is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Address where the related person can be contacted or visited\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    birthDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"birthDate\",\n        title=\"The date on which the related person was born\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_birthDate\", title=\"Extension field for ``birthDate``.\"\n    )\n\n    communication: typing.List[fhirtypes.RelatedPersonCommunicationType] | None = Field(\n        default=None,\n        alias=\"communication\",\n        title=(\n            \"A language which may be used to communicate with about the patient's \"\n            \"health\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the person is considered to \"\n            \"have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"A human identifier for this person\",\n        description=\"Identifier for a person within a particular scope.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The patient this person is related to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period of time that this relationship is considered valid\",\n        description=(\n            \"The period of time during which this relationship is or was active. If\"\n            \" there are no dates defined, then the interval is unknown.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    photo: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Image of the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"The nature of the relationship\",\n        description=(\n            \"The nature of the relationship between a patient and the related \"\n            \"person.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the person\",\n        description=(\n            \"A contact detail for the person, e.g. a telephone number or an email \"\n            \"address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RelatedPerson`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"patient\",\n            \"relationship\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"address\",\n            \"photo\",\n            \"period\",\n            \"communication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RelatedPerson`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"patient\",\n            \"relationship\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"address\",\n        ]\n\n\nclass RelatedPersonCommunication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A language which may be used to communicate with about the patient's health.\n    \"\"\"\n\n    __resource_type__ = \"RelatedPersonCommunication\"\n\n    language: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"language\",\n        title=(\n            \"The language which can be used to communicate with the patient about \"\n            \"his or her health\"\n        ),\n        description=(\n            \"The ISO-639-1 alpha 2 code in lower case for the language, optionally \"\n            \"followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in\"\n            ' upper case; e.g. \"en\" for English, or \"en-US\" for American English '\n            'versus \"en-EN\" for England English.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preferred: bool | None = Field(\n        default=None,\n        alias=\"preferred\",\n        title=\"Language preference indicator\",\n        description=(\n            \"Indicates whether or not the patient prefers this language (over other\"\n            \" languages he masters up a certain level).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preferred\", title=\"Extension field for ``preferred``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RelatedPersonCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"preferred\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RelatedPersonCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/requestgroup.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RequestGroup\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass RequestGroup(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A group of related requests.\n    A group of related requests that can be used to capture intended activities\n    that have inter-dependencies such as \"give this medication after that one\".\n    \"\"\"\n\n    __resource_type__ = \"RequestGroup\"\n\n    action: typing.List[fhirtypes.RequestGroupActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Proposed actions, if any\",\n        description=\"The actions, if any, produced by the evaluation of the artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Device or practitioner that authored the request group\",\n        description=\"Provides a reference to the author of the request group.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When the request group was authored\",\n        description=\"Indicates when the request group was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan, proposal, or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"What's being requested/ordered\",\n        description=\"A code that identifies what the overall request group is.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Created as part of\",\n        description=\"Describes the context of the request group, if any.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Composite request this is part of\",\n        description=(\n            \"A shared identifier common to all requests that were authorized more \"\n            \"or less simultaneously by a single author, representing the identifier\"\n            \" of the requisition, prescription or similar form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Allows a service to provide a unique, business identifier for the \"\n            \"request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"A canonical URL referencing a FHIR-defined protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"A URL referencing an externally defined protocol, guideline, orderset \"\n            \"or other definition that is adhered to in whole or in part by this \"\n            \"request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"proposal | plan | directive | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            \"Indicates the level of authority/intentionality associated with the \"\n            \"request and where the request fits into the workflow chain.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposal\",\n                \"plan\",\n                \"directive\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional notes about the response\",\n        description=(\n            \"Provides a mechanism to communicate additional information about the \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the request should be addressed with respect to \"\n            \"other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why the request group is needed\",\n        description=\"Describes the reason for the request group in coded or textual form.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why the request group is needed\",\n        description=(\n            \"Indicates another resource whose existence justifies this request \"\n            \"group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"Request(s) replaced by this request\",\n        description=(\n            \"Completed or terminated request(s) whose function is taken by this new\"\n            \" request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | on-hold | revoked | completed | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=(\n            \"The current state of the request. For request groups, the status \"\n            \"reflects the status of all the requests in the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"on-hold\",\n                \"revoked\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who the request group is about\",\n        description=\"The subject for which the request group was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"authoredOn\",\n            \"author\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"note\",\n            \"action\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"code\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass RequestGroupAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Proposed actions, if any.\n    The actions, if any, produced by the evaluation of the artifact.\n    \"\"\"\n\n    __resource_type__ = \"RequestGroupAction\"\n\n    action: typing.List[fhirtypes.RequestGroupActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Sub action\",\n        description=\"Sub actions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    cardinalityBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"cardinalityBehavior\",\n        title=\"single | multiple\",\n        description=\"Defines whether the action can be selected multiple times.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"single\", \"multiple\"],\n        },\n    )\n    cardinalityBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_cardinalityBehavior\",\n        title=\"Extension field for ``cardinalityBehavior``.\",\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code representing the meaning of the action or sub-actions\",\n        description=(\n            \"A code that provides meaning for the action or action group. For \"\n            \"example, a section may have a LOINC code for a section of a \"\n            \"documentation template.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    condition: typing.List[fhirtypes.RequestGroupActionConditionType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Whether or not the action is applicable\",\n        description=(\n            \"An expression that describes applicability criteria, or start/stop \"\n            \"conditions for the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Short description of the action\",\n        description=(\n            \"A short description of the action used to provide a summary to display\"\n            \" to the user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Supporting documentation for the intended performer of the action\",\n        description=(\n            \"Didactic or other informational resources associated with the action \"\n            \"that can be provided to the CDS recipient. Information resources can \"\n            \"include inline text commentary and links to web resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    groupingBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"groupingBehavior\",\n        title=\"visual-group | logical-group | sentence-group\",\n        description=\"Defines the grouping behavior for the action and its children.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"visual-group\", \"logical-group\", \"sentence-group\"],\n        },\n    )\n    groupingBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_groupingBehavior\",\n        title=\"Extension field for ``groupingBehavior``.\",\n    )\n\n    participant: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Who should perform the action\",\n        description=\"The participant that should perform or be responsible for this action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    precheckBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"precheckBehavior\",\n        title=\"yes | no\",\n        description=\"Defines whether the action should usually be preselected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"yes\", \"no\"],\n        },\n    )\n    precheckBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_precheckBehavior\",\n        title=\"Extension field for ``precheckBehavior``.\",\n    )\n\n    prefix: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"prefix\",\n        title=\"User-visible prefix for the action (e.g. 1. or A.)\",\n        description=\"A user-visible prefix for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_prefix\", title=\"Extension field for ``prefix``.\"\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the action should be addressed with respect to \"\n            \"other actions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    relatedAction: typing.List[\n        fhirtypes.RequestGroupActionRelatedActionType\n    ] | None = Field(\n        default=None,\n        alias=\"relatedAction\",\n        title=\"Relationship to another action\",\n        description=(\n            'A relationship to another action such as \"before\" or \"30-60 minutes '\n            'after start of\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requiredBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"requiredBehavior\",\n        title=\"must | could | must-unless-documented\",\n        description=\"Defines expectations around whether an action is required.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"must\", \"could\", \"must-unless-documented\"],\n        },\n    )\n    requiredBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requiredBehavior\",\n        title=\"Extension field for ``requiredBehavior``.\",\n    )\n\n    resource: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"The target of the action\",\n        description=(\n            \"The resource that is the target of the action (e.g. \"\n            \"CommunicationRequest).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    selectionBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"selectionBehavior\",\n        title=\"any | all | all-or-none | exactly-one | at-most-one | one-or-more\",\n        description=\"Defines the selection behavior for the action and its children.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"any\",\n                \"all\",\n                \"all-or-none\",\n                \"exactly-one\",\n                \"at-most-one\",\n                \"one-or-more\",\n            ],\n        },\n    )\n    selectionBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_selectionBehavior\",\n        title=\"Extension field for ``selectionBehavior``.\",\n    )\n\n    textEquivalent: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"textEquivalent\",\n        title=(\n            \"Static text equivalent of the action, used if the dynamic aspects \"\n            \"cannot be interpreted by the receiving system\"\n        ),\n        description=(\n            \"A text equivalent of the action to be performed. This provides a \"\n            \"human-interpretable description of the action when the definition is \"\n            \"consumed by a system that might not be capable of interpreting it \"\n            \"dynamically.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    textEquivalent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_textEquivalent\",\n        title=\"Extension field for ``textEquivalent``.\",\n    )\n\n    timingAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"timingAge\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timingDateTime\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timingDateTime\",\n        title=\"Extension field for ``timingDateTime``.\",\n    )\n\n    timingDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"timingDuration\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"timingRange\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"User-visible title\",\n        description=\"The title of the action displayed to a user.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"create | update | remove | fire-event\",\n        description=\"The type of action to perform (create, update, remove).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestGroupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"prefix\",\n            \"title\",\n            \"description\",\n            \"textEquivalent\",\n            \"priority\",\n            \"code\",\n            \"documentation\",\n            \"condition\",\n            \"relatedAction\",\n            \"timingDateTime\",\n            \"timingAge\",\n            \"timingPeriod\",\n            \"timingDuration\",\n            \"timingRange\",\n            \"timingTiming\",\n            \"participant\",\n            \"type\",\n            \"groupingBehavior\",\n            \"selectionBehavior\",\n            \"requiredBehavior\",\n            \"precheckBehavior\",\n            \"cardinalityBehavior\",\n            \"resource\",\n            \"action\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestGroupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"description\", \"textEquivalent\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\n                \"timingAge\",\n                \"timingDateTime\",\n                \"timingDuration\",\n                \"timingPeriod\",\n                \"timingRange\",\n                \"timingTiming\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass RequestGroupActionCondition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Whether or not the action is applicable.\n    An expression that describes applicability criteria, or start/stop\n    conditions for the action.\n    \"\"\"\n\n    __resource_type__ = \"RequestGroupActionCondition\"\n\n    expression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Boolean-valued expression\",\n        description=(\n            \"An expression that returns true or false, indicating whether or not \"\n            \"the condition is satisfied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"applicability | start | stop\",\n        description=\"The kind of condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"applicability\", \"start\", \"stop\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestGroupActionCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"kind\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestGroupActionCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"kind\", \"kind__ext\")]\n        return required_fields\n\n\nclass RequestGroupActionRelatedAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationship to another action.\n    A relationship to another action such as \"before\" or \"30-60 minutes after\n    start of\".\n    \"\"\"\n\n    __resource_type__ = \"RequestGroupActionRelatedAction\"\n\n    actionId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"actionId\",\n        title=\"What action this is related to\",\n        description=\"The element id of the action this is related to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    actionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actionId\", title=\"Extension field for ``actionId``.\"\n    )\n\n    offsetDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"offsetDuration\",\n        title=\"Time offset for the relationship\",\n        description=(\n            \"A duration or range of durations to apply to the relationship. For \"\n            \"example, 30-60 minutes before.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e offset[x]\n            \"one_of_many\": \"offset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    offsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"offsetRange\",\n        title=\"Time offset for the relationship\",\n        description=(\n            \"A duration or range of durations to apply to the relationship. For \"\n            \"example, 30-60 minutes before.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e offset[x]\n            \"one_of_many\": \"offset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    relationship: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=(\n            \"before-start | before | before-end | concurrent-with-start | \"\n            \"concurrent | concurrent-with-end | after-start | after | after-end\"\n        ),\n        description=\"The relationship of this action to the related action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"before-start\",\n                \"before\",\n                \"before-end\",\n                \"concurrent-with-start\",\n                \"concurrent\",\n                \"concurrent-with-end\",\n                \"after-start\",\n                \"after\",\n                \"after-end\",\n            ],\n        },\n    )\n    relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relationship\",\n        title=\"Extension field for ``relationship``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestGroupActionRelatedAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"actionId\",\n            \"relationship\",\n            \"offsetDuration\",\n            \"offsetRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestGroupActionRelatedAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"actionId\", \"actionId__ext\"),\n            (\"relationship\", \"relationship__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"offset\": [\"offsetDuration\", \"offsetRange\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/researchdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass ResearchDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A research context or question.\n    The ResearchDefinition resource describes the conditional state (population\n    and any exposures being compared within the population) and outcome (if\n    specified) that the knowledge (evidence, assertion, recommendation) is\n    about.\n    \"\"\"\n\n    __resource_type__ = \"ResearchDefinition\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the research definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    comment: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Used for footnotes or explanatory notes\",\n        description=(\n            \"A human-readable string to clarify or explain concepts about the \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the research definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the research definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the research definition was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the research definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the research definition\",\n        description=(\n            \"A free text natural language description of the research definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the research definition is expected to be used\",\n        description=(\n            \"The period during which the research definition content was or is \"\n            \"planned to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization responsible for officially endorsing the\"\n            \" content for use in some setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this research definition is authored \"\n            \"for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    exposure: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"exposure\",\n        title=\"What exposure?\",\n        description=(\n            \"A reference to a ResearchElementDefinition resource that defines the \"\n            \"exposure for the research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchElementDefinition\"],\n        },\n    )\n\n    exposureAlternative: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"exposureAlternative\",\n        title=\"What alternative exposure state?\",\n        description=(\n            \"A reference to a ResearchElementDefinition resource that defines the \"\n            \"exposureAlternative for the research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchElementDefinition\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the research definition\",\n        description=(\n            \"A formal identifier that is used to identify this research definition \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for research definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the research definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the research definition was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    library: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the ResearchDefinition\",\n        description=(\n            \"A reference to a Library resource containing the formal logic used by \"\n            \"the ResearchDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n    library__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_library\", title=\"Extension field for ``library``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this research definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the research definition. This name\"\n            \" should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    outcome: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"What outcome?\",\n        description=(\n            \"A reference to a ResearchElementDefinition resomece that defines the \"\n            \"outcome for the research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchElementDefinition\"],\n        },\n    )\n\n    population: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"population\",\n        title=\"What population?\",\n        description=(\n            \"A reference to a ResearchElementDefinition resource that defines the \"\n            \"population for the research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchElementDefinition\"],\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the research\"\n            \" definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this research definition is defined\",\n        description=(\n            \"Explanation of why this research definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc.\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization primarily responsible for review of some\"\n            \" aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    shortTitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"shortTitle\",\n        title=\"Title for use in informal contexts\",\n        description=(\n            \"The short title provides an alternate title for use in informal \"\n            \"descriptive contexts where the full, formal title is not necessary.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    shortTitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_shortTitle\", title=\"Extension field for ``shortTitle``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this research definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects for the ResearchDefinition. If this element is \"\n            \"not provided, a Patient subject is assumed, but the subject of the \"\n            \"ResearchDefinition can be anything.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects for the ResearchDefinition. If this element is \"\n            \"not provided, a Patient subject is assumed, but the subject of the \"\n            \"ResearchDefinition can be anything.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the ResearchDefinition\",\n        description=(\n            \"An explanatory or alternate title for the ResearchDefinition giving \"\n            \"additional information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this research definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the research definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=(\n            \"The category of the ResearchDefinition, such as Education, Treatment, \"\n            \"Assessment, etc.\"\n        ),\n        description=(\n            \"Descriptive topics related to the content of the ResearchDefinition. \"\n            \"Topics provide a high-level categorization grouping types of \"\n            \"ResearchDefinitions that can be useful for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this research definition, represented as a \"\n            \"URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this research definition when\"\n            \" it is referenced in a specification, model, design or an instance; \"\n            \"also called its canonical identifier. This SHOULD be globally unique \"\n            \"and SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this research definition is (or will be) published. This \"\n            \"URL can be the target of a canonical reference. It SHALL remain the \"\n            \"same when the research definition is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the ResearchDefinition\",\n        description=(\n            \"A detailed description, from a clinical perspective, of how the \"\n            \"ResearchDefinition is used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate research definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the research definition\",\n        description=(\n            \"The identifier that is used to identify this version of the research \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the research \"\n            \"definition author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence. To provide a version consistent \"\n            \"with the Decision Support Service specification, use the format \"\n            \"Major.Minor.Revision (e.g. 1.0.0). For more information on versioning \"\n            \"knowledge assets, refer to the Decision Support Service specification.\"\n            \" Note that a version is required for non-experimental active \"\n            \"artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"shortTitle\",\n            \"subtitle\",\n            \"status\",\n            \"experimental\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"comment\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"usage\",\n            \"copyright\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"library\",\n            \"population\",\n            \"exposure\",\n            \"exposureAlternative\",\n            \"outcome\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"population\",\n            \"exposure\",\n            \"exposureAlternative\",\n            \"outcome\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"subject\": [\"subjectCodeableConcept\", \"subjectReference\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/researchelementdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ResearchElementDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A population, intervention, or exposure definition.\n    The ResearchElementDefinition resource describes a \"PICO\" element that\n    knowledge (evidence, assertion, recommendation) is about.\n    \"\"\"\n\n    __resource_type__ = \"ResearchElementDefinition\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the research element definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    characteristic: typing.List[\n        fhirtypes.ResearchElementDefinitionCharacteristicType\n    ] = Field(\n        default=...,\n        alias=\"characteristic\",\n        title=\"What defines the members of the research element\",\n        description=(\n            \"A characteristic that defines the members of the research element. \"\n            'Multiple characteristics are applied with \"and\" semantics.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    comment: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Used for footnotes or explanatory notes\",\n        description=(\n            \"A human-readable string to clarify or explain concepts about the \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the research element definition \"\n            \"and/or its contents. Copyright statements are generally legal \"\n            \"restrictions on the use and publishing of the research element \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the research element definition \"\n            \"was published. The date must change when the business version changes \"\n            \"and it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the research element definition\"\n            \" changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the research element definition\",\n        description=(\n            \"A free text natural language description of the research element \"\n            \"definition from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the research element definition is expected to be used\",\n        description=(\n            \"The period during which the research element definition content was or\"\n            \" is planned to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization responsible for officially endorsing the\"\n            \" content for use in some setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this research element definition is \"\n            \"authored for testing purposes (or education/evaluation/marketing) and \"\n            \"is not intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the research element definition\",\n        description=(\n            \"A formal identifier that is used to identify this research element \"\n            \"definition when it is represented in other formats, or referenced in a\"\n            \" specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for research element definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the research element definition \"\n            \"is intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the research element definition was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    library: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the ResearchElementDefinition\",\n        description=(\n            \"A reference to a Library resource containing the formal logic used by \"\n            \"the ResearchElementDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n    library__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_library\", title=\"Extension field for ``library``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this research element definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the research element definition. \"\n            \"This name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the research\"\n            \" element definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this research element definition is defined\",\n        description=(\n            \"Explanation of why this research element definition is needed and why \"\n            \"it has been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc.\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization primarily responsible for review of some\"\n            \" aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    shortTitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"shortTitle\",\n        title=\"Title for use in informal contexts\",\n        description=(\n            \"The short title provides an alternate title for use in informal \"\n            \"descriptive contexts where the full, formal title is not necessary.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    shortTitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_shortTitle\", title=\"Extension field for ``shortTitle``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this research element definition. Enables tracking the \"\n            \"life-cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects for the ResearchElementDefinition. If this \"\n            \"element is not provided, a Patient subject is assumed, but the subject\"\n            \" of the ResearchElementDefinition can be anything.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects for the ResearchElementDefinition. If this \"\n            \"element is not provided, a Patient subject is assumed, but the subject\"\n            \" of the ResearchElementDefinition can be anything.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the ResearchElementDefinition\",\n        description=(\n            \"An explanatory or alternate title for the ResearchElementDefinition \"\n            \"giving additional information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this research element definition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the research element \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=(\n            \"The category of the ResearchElementDefinition, such as Education, \"\n            \"Treatment, Assessment, etc.\"\n        ),\n        description=(\n            \"Descriptive topics related to the content of the \"\n            \"ResearchElementDefinition. Topics provide a high-level categorization \"\n            \"grouping types of ResearchElementDefinitions that can be useful for \"\n            \"filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"population | exposure | outcome\",\n        description=(\n            \"The type of research element, a population, an exposure, or an \" \"outcome.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"population\", \"exposure\", \"outcome\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this research element definition, represented\"\n            \" as a URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this research element \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"an instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which at which an \"\n            \"authoritative instance of this research element definition is (or will\"\n            \" be) published. This URL can be the target of a canonical reference. \"\n            \"It SHALL remain the same when the research element definition is \"\n            \"stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the ResearchElementDefinition\",\n        description=(\n            \"A detailed description, from a clinical perspective, of how the \"\n            \"ResearchElementDefinition is used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate research element definition \"\n            \"instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    variableType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"variableType\",\n        title=\"dichotomous | continuous | descriptive\",\n        description=(\n            \"The type of the outcome (e.g. Dichotomous, Continuous, or \" \"Descriptive).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"dichotomous\", \"continuous\", \"descriptive\"],\n        },\n    )\n    variableType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_variableType\",\n        title=\"Extension field for ``variableType``.\",\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the research element definition\",\n        description=(\n            \"The identifier that is used to identify this version of the research \"\n            \"element definition when it is referenced in a specification, model, \"\n            \"design or instance. This is an arbitrary value managed by the research\"\n            \" element definition author and is not expected to be globally unique. \"\n            \"For example, it might be a timestamp (e.g. yyyymmdd) if a managed \"\n            \"version is not available. There is also no expectation that versions \"\n            \"can be placed in a lexicographical sequence. To provide a version \"\n            \"consistent with the Decision Support Service specification, use the \"\n            \"format Major.Minor.Revision (e.g. 1.0.0). For more information on \"\n            \"versioning knowledge assets, refer to the Decision Support Service \"\n            \"specification. Note that a version is required for non-experimental \"\n            \"active artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchElementDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"shortTitle\",\n            \"subtitle\",\n            \"status\",\n            \"experimental\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"comment\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"usage\",\n            \"copyright\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"library\",\n            \"type\",\n            \"variableType\",\n            \"characteristic\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchElementDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"shortTitle\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"type\",\n            \"characteristic\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"subject\": [\"subjectCodeableConcept\", \"subjectReference\"]}\n        return one_of_many_fields\n\n\nclass ResearchElementDefinitionCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What defines the members of the research element.\n    A characteristic that defines the members of the research element. Multiple\n    characteristics are applied with \"and\" semantics.\n    \"\"\"\n\n    __resource_type__ = \"ResearchElementDefinitionCharacteristic\"\n\n    definitionCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definitionCanonical\",\n        title=\"What code or expression defines members?\",\n        description=(\n            \"Define members of the research element using Codes (such as condition,\"\n            \" medication, or observation), Expressions ( using an expression \"\n            \"language such as FHIRPath or CQL) or DataRequirements (such as \"\n            \"Diabetes diagnosis onset in the last year).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    definitionCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_definitionCanonical\",\n        title=\"Extension field for ``definitionCanonical``.\",\n    )\n\n    definitionCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"definitionCodeableConcept\",\n        title=\"What code or expression defines members?\",\n        description=(\n            \"Define members of the research element using Codes (such as condition,\"\n            \" medication, or observation), Expressions ( using an expression \"\n            \"language such as FHIRPath or CQL) or DataRequirements (such as \"\n            \"Diabetes diagnosis onset in the last year).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    definitionDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"definitionDataRequirement\",\n        title=\"What code or expression defines members?\",\n        description=(\n            \"Define members of the research element using Codes (such as condition,\"\n            \" medication, or observation), Expressions ( using an expression \"\n            \"language such as FHIRPath or CQL) or DataRequirements (such as \"\n            \"Diabetes diagnosis onset in the last year).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    definitionExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"definitionExpression\",\n        title=\"What code or expression defines members?\",\n        description=(\n            \"Define members of the research element using Codes (such as condition,\"\n            \" medication, or observation), Expressions ( using an expression \"\n            \"language such as FHIRPath or CQL) or DataRequirements (such as \"\n            \"Diabetes diagnosis onset in the last year).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    exclude: bool | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=\"Whether the characteristic includes or excludes members\",\n        description=(\n            \"When true, members with this characteristic are excluded from the \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_exclude\", title=\"Extension field for ``exclude``.\"\n    )\n\n    participantEffectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"participantEffectiveDateTime\",\n        title=\"What time period do participants cover\",\n        description=\"Indicates what effective period the study covers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e participantEffective[x]\n            \"one_of_many\": \"participantEffective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    participantEffectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = (\n        Field(\n            default=None,\n            alias=\"_participantEffectiveDateTime\",\n            title=\"Extension field for ``participantEffectiveDateTime``.\",\n        )\n    )\n\n    participantEffectiveDescription: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"participantEffectiveDescription\",\n        title=\"What time period do participants cover\",\n        description=\"A narrative description of the time period the study covers.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    participantEffectiveDescription__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_participantEffectiveDescription\",\n        title=\"Extension field for ``participantEffectiveDescription``.\",\n    )\n\n    participantEffectiveDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"participantEffectiveDuration\",\n        title=\"What time period do participants cover\",\n        description=\"Indicates what effective period the study covers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e participantEffective[x]\n            \"one_of_many\": \"participantEffective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    participantEffectiveGroupMeasure: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"participantEffectiveGroupMeasure\",\n        title=(\n            \"mean | median | mean-of-mean | mean-of-median | median-of-mean | \"\n            \"median-of-median\"\n        ),\n        description=(\n            \"Indicates how elements are aggregated within the study effective \"\n            \"period.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"mean\",\n                \"median\",\n                \"mean-of-mean\",\n                \"mean-of-median\",\n                \"median-of-mean\",\n                \"median-of-median\",\n            ],\n        },\n    )\n    participantEffectiveGroupMeasure__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_participantEffectiveGroupMeasure\",\n        title=\"Extension field for ``participantEffectiveGroupMeasure``.\",\n    )\n\n    participantEffectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"participantEffectivePeriod\",\n        title=\"What time period do participants cover\",\n        description=\"Indicates what effective period the study covers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e participantEffective[x]\n            \"one_of_many\": \"participantEffective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    participantEffectiveTimeFromStart: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"participantEffectiveTimeFromStart\",\n        title=\"Observation time from study start\",\n        description=\"Indicates duration from the participant's study entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    participantEffectiveTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"participantEffectiveTiming\",\n        title=\"What time period do participants cover\",\n        description=\"Indicates what effective period the study covers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e participantEffective[x]\n            \"one_of_many\": \"participantEffective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    studyEffectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"studyEffectiveDateTime\",\n        title=\"What time period does the study cover\",\n        description=\"Indicates what effective period the study covers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e studyEffective[x]\n            \"one_of_many\": \"studyEffective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    studyEffectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_studyEffectiveDateTime\",\n        title=\"Extension field for ``studyEffectiveDateTime``.\",\n    )\n\n    studyEffectiveDescription: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"studyEffectiveDescription\",\n        title=\"What time period does the study cover\",\n        description=\"A narrative description of the time period the study covers.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    studyEffectiveDescription__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_studyEffectiveDescription\",\n        title=\"Extension field for ``studyEffectiveDescription``.\",\n    )\n\n    studyEffectiveDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"studyEffectiveDuration\",\n        title=\"What time period does the study cover\",\n        description=\"Indicates what effective period the study covers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e studyEffective[x]\n            \"one_of_many\": \"studyEffective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    studyEffectiveGroupMeasure: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"studyEffectiveGroupMeasure\",\n        title=(\n            \"mean | median | mean-of-mean | mean-of-median | median-of-mean | \"\n            \"median-of-median\"\n        ),\n        description=(\n            \"Indicates how elements are aggregated within the study effective \"\n            \"period.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"mean\",\n                \"median\",\n                \"mean-of-mean\",\n                \"mean-of-median\",\n                \"median-of-mean\",\n                \"median-of-median\",\n            ],\n        },\n    )\n    studyEffectiveGroupMeasure__ext: fhirtypes.FHIRPrimitiveExtensionType | None = (\n        Field(\n            default=None,\n            alias=\"_studyEffectiveGroupMeasure\",\n            title=\"Extension field for ``studyEffectiveGroupMeasure``.\",\n        )\n    )\n\n    studyEffectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"studyEffectivePeriod\",\n        title=\"What time period does the study cover\",\n        description=\"Indicates what effective period the study covers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e studyEffective[x]\n            \"one_of_many\": \"studyEffective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    studyEffectiveTimeFromStart: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"studyEffectiveTimeFromStart\",\n        title=\"Observation time from study start\",\n        description=\"Indicates duration from the study initiation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    studyEffectiveTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"studyEffectiveTiming\",\n        title=\"What time period does the study cover\",\n        description=\"Indicates what effective period the study covers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e studyEffective[x]\n            \"one_of_many\": \"studyEffective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    unitOfMeasure: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unitOfMeasure\",\n        title=\"What unit is the outcome described in?\",\n        description=\"Specifies the UCUM unit for the outcome.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usageContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"usageContext\",\n        title=\"What code/value pairs define members?\",\n        description=(\n            \"Use UsageContext to define the members of the population, such as Age \"\n            \"Ranges, Genders, Settings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchElementDefinitionCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"definitionCodeableConcept\",\n            \"definitionCanonical\",\n            \"definitionExpression\",\n            \"definitionDataRequirement\",\n            \"usageContext\",\n            \"exclude\",\n            \"unitOfMeasure\",\n            \"studyEffectiveDescription\",\n            \"studyEffectiveDateTime\",\n            \"studyEffectivePeriod\",\n            \"studyEffectiveDuration\",\n            \"studyEffectiveTiming\",\n            \"studyEffectiveTimeFromStart\",\n            \"studyEffectiveGroupMeasure\",\n            \"participantEffectiveDescription\",\n            \"participantEffectiveDateTime\",\n            \"participantEffectivePeriod\",\n            \"participantEffectiveDuration\",\n            \"participantEffectiveTiming\",\n            \"participantEffectiveTimeFromStart\",\n            \"participantEffectiveGroupMeasure\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchElementDefinitionCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"definitionCodeableConcept\",\n            \"definitionCanonical\",\n            \"definitionExpression\",\n            \"definitionDataRequirement\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"definition\": [\n                \"definitionCanonical\",\n                \"definitionCodeableConcept\",\n                \"definitionDataRequirement\",\n                \"definitionExpression\",\n            ],\n            \"participantEffective\": [\n                \"participantEffectiveDateTime\",\n                \"participantEffectiveDuration\",\n                \"participantEffectivePeriod\",\n                \"participantEffectiveTiming\",\n            ],\n            \"studyEffective\": [\n                \"studyEffectiveDateTime\",\n                \"studyEffectiveDuration\",\n                \"studyEffectivePeriod\",\n                \"studyEffectiveTiming\",\n            ],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/researchstudy.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchStudy\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ResearchStudy(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Investigation to increase healthcare-related patient-independent knowledge.\n    A process where a researcher or organization plans and then executes a\n    series of steps intended to increase the field of healthcare-related\n    knowledge.  This includes studies of safety, efficacy, comparative\n    effectiveness and other information about medications, devices, therapies\n    and other interventional and investigative techniques.  A ResearchStudy\n    involves the gathering of information about human or animal subjects.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudy\"\n\n    arm: typing.List[fhirtypes.ResearchStudyArmType] | None = Field(\n        default=None,\n        alias=\"arm\",\n        title=\"Defined path through the study for a subject\",\n        description=(\n            \"Describes an expected sequence of events for one of the participants \"\n            \"of a study.  E.g. Exposure to drug A, wash-out, exposure to drug B, \"\n            \"wash-out, follow-up.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classifications for the study\",\n        description=(\n            \"Codes categorizing the type of study such as investigational vs. \"\n            \"observational, type of blinding, type of randomization, safety vs. \"\n            \"efficacy, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    condition: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Condition being studied\",\n        description=(\n            \"The condition that is the focus of the study.  For example, In a study\"\n            \" to examine risk factors for Lupus, might have as an inclusion \"\n            'criterion \"healthy volunteer\", but the target condition code would be '\n            \"a Lupus SNOMED code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the study\",\n        description=(\n            \"Contact details to assist a user in learning more about or engaging \"\n            \"with the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"What this is study doing\",\n        description=\"A full description of how the study is being conducted.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    enrollment: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"enrollment\",\n        title=\"Inclusion & exclusion criteria\",\n        description=(\n            \"Reference to a Group that defines the criteria for and quantity of \"\n            'subjects participating in the study.  E.g. \" 200 female Europeans '\n            'between the ages of 20 and 45 with early onset diabetes\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    focus: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"Drugs, devices, etc. under study\",\n        description=(\n            \"The medication(s), food(s), therapy(ies), device(s) or other concerns \"\n            \"or interventions that the study is seeking to gain more information \"\n            \"about.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for study\",\n        description=(\n            \"Identifiers assigned to this research study by the sponsor or other \"\n            \"systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    keyword: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"keyword\",\n        title=\"Used to search for the study\",\n        description=\"Key terms to aid in searching for or filtering the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Geographic region(s) for study\",\n        description=(\n            \"Indicates a country, state or other region where the study is taking \"\n            \"place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the study\",\n        description=(\n            \"Comments made about the study by the performer, subject or other \"\n            \"participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    objective: typing.List[fhirtypes.ResearchStudyObjectiveType] | None = Field(\n        default=None,\n        alias=\"objective\",\n        title=\"A goal for the study\",\n        description=(\n            \"A goal that the study is aiming to achieve in terms of a scientific \"\n            \"question to be answered by the analysis of data collected during the \"\n            \"study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of larger study\",\n        description=(\n            \"A larger research study of which this particular study is a component \"\n            \"or step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchStudy\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When the study began and ended\",\n        description=(\n            \"Identifies the start date and the expected (or actual, depending on \"\n            \"status) end date for the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    phase: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"phase\",\n        title=(\n            \"n-a | early-phase-1 | phase-1 | phase-1-phase-2 | phase-2 | \"\n            \"phase-2-phase-3 | phase-3 | phase-4\"\n        ),\n        description=(\n            \"The stage in the progression of a therapy from initial experimental \"\n            \"use in humans in clinical trials to post-market evaluation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    primaryPurposeType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"primaryPurposeType\",\n        title=(\n            \"treatment | prevention | diagnostic | supportive-care | screening | \"\n            \"health-services-research | basic-science | device-feasibility\"\n        ),\n        description=(\n            \"The type of study based upon the intent of the study's activities. A \"\n            \"classification of the intent of the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    principalInvestigator: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"principalInvestigator\",\n        title=\"Researcher who oversees multiple aspects of the study\",\n        description=(\n            \"A researcher in a study who oversees multiple aspects of the study, \"\n            \"such as concept development, protocol writing, protocol submission for\"\n            \" IRB approval, participant recruitment, informed consent, data \"\n            \"collection, analysis, interpretation and presentation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    protocol: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"protocol\",\n        title=\"Steps followed in executing study\",\n        description=(\n            \"The set of steps expected to be performed as part of the execution of \"\n            \"the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PlanDefinition\"],\n        },\n    )\n\n    reasonStopped: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reasonStopped\",\n        title=(\n            \"accrual-goal-met | closed-due-to-toxicity | closed-due-to-lack-of-\"\n            \"study-progress | temporarily-closed-per-study-design\"\n        ),\n        description=(\n            \"A description and/or code explaining the premature termination of the \"\n            \"study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"References and dependencies\",\n        description=\"Citations, references and other related documents.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    site: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Facility where study activities are conducted\",\n        description=\"A facility in which study activities are conducted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    sponsor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sponsor\",\n        title=\"Organization that initiates and is legally responsible for the study\",\n        description=(\n            \"An organization that initiates the investigation and is legally \"\n            \"responsible for the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"active | administratively-completed | approved | closed-to-accrual | \"\n            \"closed-to-accrual-and-intervention | completed | disapproved | in-\"\n            \"review | temporarily-closed-to-accrual | temporarily-closed-to-\"\n            \"accrual-and-intervention | withdrawn\"\n        ),\n        description=\"The current state of the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"active\",\n                \"administratively-completed\",\n                \"approved\",\n                \"closed-to-accrual\",\n                \"closed-to-accrual-and-intervention\",\n                \"completed\",\n                \"disapproved\",\n                \"in-review\",\n                \"temporarily-closed-to-accrual\",\n                \"temporarily-closed-to-accrual-and-intervention\",\n                \"withdrawn\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this study\",\n        description=\"A short, descriptive user-friendly label for the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"title\",\n            \"protocol\",\n            \"partOf\",\n            \"status\",\n            \"primaryPurposeType\",\n            \"phase\",\n            \"category\",\n            \"focus\",\n            \"condition\",\n            \"contact\",\n            \"relatedArtifact\",\n            \"keyword\",\n            \"location\",\n            \"description\",\n            \"enrollment\",\n            \"period\",\n            \"sponsor\",\n            \"principalInvestigator\",\n            \"site\",\n            \"reasonStopped\",\n            \"note\",\n            \"arm\",\n            \"objective\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"title\",\n            \"protocol\",\n            \"partOf\",\n            \"status\",\n            \"primaryPurposeType\",\n            \"phase\",\n            \"category\",\n            \"focus\",\n            \"condition\",\n            \"contact\",\n            \"keyword\",\n            \"location\",\n            \"enrollment\",\n            \"period\",\n            \"sponsor\",\n            \"principalInvestigator\",\n            \"site\",\n            \"reasonStopped\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ResearchStudyArm(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defined path through the study for a subject.\n    Describes an expected sequence of events for one of the participants of a\n    study.  E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out,\n    follow-up.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudyArm\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Short explanation of study path\",\n        description=(\n            \"A succinct description of the path through the study that would be \"\n            \"followed by a subject adhering to this arm.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Label for study arm\",\n        description=\"Unique, human-readable label for this arm of the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Categorization of study arm\",\n        description=(\n            \"Categorization of study arm, e.g. experimental, active comparator, \"\n            \"placebo comparater.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudyArm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"type\", \"description\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudyArm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass ResearchStudyObjective(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A goal for the study.\n    A goal that the study is aiming to achieve in terms of a scientific\n    question to be answered by the analysis of data collected during the study.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudyObjective\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Label for the objective\",\n        description=\"Unique, human-readable label for this objective of the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"primary | secondary | exploratory\",\n        description=\"The kind of study objective.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudyObjective`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudyObjective`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/researchsubject.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchSubject\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass ResearchSubject(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Physical entity which is the primary unit of interest in the study.\n    A physical entity which is the primary unit of operational and/or\n    administrative interest in a study.\n    \"\"\"\n\n    __resource_type__ = \"ResearchSubject\"\n\n    actualArm: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"actualArm\",\n        title=\"What path was followed\",\n        description=(\n            \"The name of the arm in the study the subject actually followed as part\"\n            \" of this study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    actualArm__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actualArm\", title=\"Extension field for ``actualArm``.\"\n    )\n\n    assignedArm: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"assignedArm\",\n        title=\"What path should be followed\",\n        description=(\n            \"The name of the arm in the study the subject is expected to follow as \"\n            \"part of this study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    assignedArm__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_assignedArm\", title=\"Extension field for ``assignedArm``.\"\n    )\n\n    consent: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"consent\",\n        title=\"Agreement to participate in study\",\n        description=(\n            \"A record of the patient's informed agreement to participate in the \"\n            \"study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Consent\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for research subject in a study\",\n        description=\"Identifiers assigned to this research subject for a study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    individual: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"individual\",\n        title=\"Who is part of study\",\n        description=\"The record of the person or animal who is involved in the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Start and end of participation\",\n        description=(\n            \"The dates the subject began and ended their participation in the \" \"study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"candidate | eligible | follow-up | ineligible | not-registered | off-\"\n            \"study | on-study | on-study-intervention | on-study-observation | \"\n            \"pending-on-study | potential-candidate | screening | withdrawn\"\n        ),\n        description=\"The current state of the subject.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"candidate\",\n                \"eligible\",\n                \"follow-up\",\n                \"ineligible\",\n                \"not-registered\",\n                \"off-study\",\n                \"on-study\",\n                \"on-study-intervention\",\n                \"on-study-observation\",\n                \"pending-on-study\",\n                \"potential-candidate\",\n                \"screening\",\n                \"withdrawn\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    study: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"study\",\n        title=\"Study subject is part of\",\n        description=\"Reference to the study the subject is participating in.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchStudy\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"period\",\n            \"study\",\n            \"individual\",\n            \"assignedArm\",\n            \"actualArm\",\n            \"consent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"period\",\n            \"study\",\n            \"individual\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/resource.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Resource\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import fhirresourcemodel, fhirtypes\n\n\nclass Resource(fhirresourcemodel.FHIRResourceModel):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base Resource.\n    This is the base resource type for everything.\n    \"\"\"\n\n    __resource_type__ = \"Resource\"\n\n    id: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"id\",\n        title=\"Logical id of this artifact\",\n        description=(\n            \"The logical id of the resource, as used in the URL for the resource. \"\n            \"Once assigned, this value never changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    implicitRules: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"implicitRules\",\n        title=\"A set of rules under which this content was created\",\n        description=(\n            \"A reference to a set of rules that were followed when the resource was\"\n            \" constructed, and which must be understood when processing the \"\n            \"content. Often, this is a reference to an implementation guide that \"\n            \"defines the special rules along with other profiles etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    implicitRules__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_implicitRules\",\n        title=\"Extension field for ``implicitRules``.\",\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language of the resource content\",\n        description=\"The base language in which the resource is written.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    meta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"meta\",\n        title=\"Metadata about the resource\",\n        description=(\n            \"The metadata about the resource. This is content that is maintained by\"\n            \" the infrastructure. Changes to the content might not always be \"\n            \"associated with version changes to the resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Resource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"language\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Resource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\"]\n"
  },
  {
    "path": "fhir/resources/R4B/riskassessment.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RiskAssessment\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass RiskAssessment(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Potential outcomes for a subject with likelihood.\n    An assessment of the likely outcome(s) for a patient or other subject as\n    well as the likelihood of each outcome.\n    \"\"\"\n\n    __resource_type__ = \"RiskAssessment\"\n\n    basedOn: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this assessment\",\n        description=\"A reference to the request that is fulfilled by this risk assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    basis: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basis\",\n        title=\"Information used in assessment\",\n        description=(\n            \"Indicates the source data considered as part of the assessment (for \"\n            \"example, FamilyHistory, Observations, Procedures, Conditions, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of assessment\",\n        description=\"The type of the risk assessment performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    condition: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Condition assessed\",\n        description=(\n            \"For assessments or prognosis specific to a particular condition, \"\n            \"indicates the condition being assessed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Where was assessment performed?\",\n        description=\"The encounter where the assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier for the assessment\",\n        description=\"Business identifier assigned to the risk assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Evaluation mechanism\",\n        description=\"The algorithm, process or mechanism used to evaluate the risk.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    mitigation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"mitigation\",\n        title=\"How to reduce risk\",\n        description=(\n            \"A description of the steps that might be taken to reduce the \"\n            \"identified risk(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    mitigation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mitigation\", title=\"Extension field for ``mitigation``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments on the risk assessment\",\n        description=\"Additional comments about the risk assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When was assessment made?\",\n        description=\"The date (and possibly time) the risk assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When was assessment made?\",\n        description=\"The date (and possibly time) the risk assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    parent: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Part of this occurrence\",\n        description=(\n            \"A reference to a resource that this risk assessment is part of, such \"\n            \"as a Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who did assessment?\",\n        description=\"The provider or software application that performed the assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\", \"Device\"],\n        },\n    )\n\n    prediction: typing.List[fhirtypes.RiskAssessmentPredictionType] | None = Field(\n        default=None,\n        alias=\"prediction\",\n        title=\"Outcome predicted\",\n        description=\"Describes the expected outcome for the subject.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why the assessment was necessary?\",\n        description=\"The reason the risk assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why the assessment was necessary?\",\n        description=\"Resources supporting the reason the risk assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | preliminary | final | amended +\",\n        description=(\n            \"The status of the RiskAssessment, using the same statuses as an \"\n            \"Observation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"registered\", \"preliminary\", \"final\", \"amended\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who/what does assessment apply to?\",\n        description=\"The patient or group the risk assessment applies to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RiskAssessment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"parent\",\n            \"status\",\n            \"method\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"condition\",\n            \"performer\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"basis\",\n            \"prediction\",\n            \"mitigation\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RiskAssessment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"method\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"condition\",\n            \"performer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\"]}\n        return one_of_many_fields\n\n\nclass RiskAssessmentPrediction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Outcome predicted.\n    Describes the expected outcome for the subject.\n    \"\"\"\n\n    __resource_type__ = \"RiskAssessmentPrediction\"\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"Possible outcome for the subject\",\n        description=(\n            \"One of the potential outcomes for the patient (e.g. remission, death,\"\n            \"  a particular condition).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    probabilityDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"probabilityDecimal\",\n        title=\"Likelihood of specified outcome\",\n        description=\"Indicates how likely the outcome is (in the specified timeframe).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e probability[x]\n            \"one_of_many\": \"probability\",\n            \"one_of_many_required\": False,\n        },\n    )\n    probabilityDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_probabilityDecimal\",\n        title=\"Extension field for ``probabilityDecimal``.\",\n    )\n\n    probabilityRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"probabilityRange\",\n        title=\"Likelihood of specified outcome\",\n        description=\"Indicates how likely the outcome is (in the specified timeframe).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e probability[x]\n            \"one_of_many\": \"probability\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    qualitativeRisk: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"qualitativeRisk\",\n        title=\"Likelihood of specified outcome as a qualitative value\",\n        description=(\n            \"Indicates how likely the outcome is (in the specified timeframe), \"\n            \"expressed as a qualitative value (e.g. low, medium, or high).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rationale: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"rationale\",\n        title=\"Explanation of prediction\",\n        description=\"Additional information explaining the basis for the prediction.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    rationale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rationale\", title=\"Extension field for ``rationale``.\"\n    )\n\n    relativeRisk: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"relativeRisk\",\n        title=\"Relative likelihood\",\n        description=(\n            \"Indicates the risk for this particular subject (with their specific \"\n            \"characteristics) divided by the risk of the population in general.  \"\n            \"(Numbers greater than 1 = higher risk than the population, numbers \"\n            \"less than 1 = lower risk.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    relativeRisk__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relativeRisk\",\n        title=\"Extension field for ``relativeRisk``.\",\n    )\n\n    whenPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"whenPeriod\",\n        title=\"Timeframe or age range\",\n        description=(\n            \"Indicates the period of time or age range of the subject to which the \"\n            \"specified probability applies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    whenRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"whenRange\",\n        title=\"Timeframe or age range\",\n        description=(\n            \"Indicates the period of time or age range of the subject to which the \"\n            \"specified probability applies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RiskAssessmentPrediction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"outcome\",\n            \"probabilityDecimal\",\n            \"probabilityRange\",\n            \"qualitativeRisk\",\n            \"relativeRisk\",\n            \"whenPeriod\",\n            \"whenRange\",\n            \"rationale\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RiskAssessmentPrediction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"probability\": [\"probabilityDecimal\", \"probabilityRange\"],\n            \"when\": [\"whenPeriod\", \"whenRange\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/sampleddata.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SampledData\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass SampledData(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A series of measurements taken by a device.\n    A series of measurements taken by a device, with upper and lower limits.\n    There may be more than one dimension in the data.\n    \"\"\"\n\n    __resource_type__ = \"SampledData\"\n\n    data: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"data\",\n        title='Decimal values with spaces, or \"E\" | \"U\" | \"L\"',\n        description=(\n            \"A series of data points which are decimal values separated by a single\"\n            ' space (character u20). The special values \"E\" (error), \"L\" (below '\n            'detection limit) and \"U\" (above detection limit) can also be used in '\n            \"place of a decimal value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_data\", title=\"Extension field for ``data``.\"\n    )\n\n    dimensions: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"dimensions\",\n        title=\"Number of sample points at each time point\",\n        description=(\n            \"The number of sample points at each time point. If this value is \"\n            \"greater than one, then the dimensions will be interlaced - all the \"\n            \"sample points for a point in time will be recorded at once.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    dimensions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dimensions\", title=\"Extension field for ``dimensions``.\"\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Multiply data by this before adding to origin\",\n        description=(\n            \"A correction factor that is applied to the sampled data points before \"\n            \"they are added to the origin.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    lowerLimit: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"lowerLimit\",\n        title=\"Lower limit of detection\",\n        description=(\n            \"The lower limit of detection of the measured points. This is needed if\"\n            ' any of the data points have the value \"L\" (lower than detection '\n            \"limit).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lowerLimit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lowerLimit\", title=\"Extension field for ``lowerLimit``.\"\n    )\n\n    origin: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"origin\",\n        title=\"Zero value and units\",\n        description=(\n            \"The base quantity that a measured value of zero represents. In \"\n            \"addition, this provides the units of the entire measurement series.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Number of milliseconds between samples\",\n        description=\"The length of time between sampling times, measured in milliseconds.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    period__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_period\", title=\"Extension field for ``period``.\"\n    )\n\n    upperLimit: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"upperLimit\",\n        title=\"Upper limit of detection\",\n        description=(\n            \"The upper limit of detection of the measured points. This is needed if\"\n            ' any of the data points have the value \"U\" (higher than detection '\n            \"limit).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    upperLimit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_upperLimit\", title=\"Extension field for ``upperLimit``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SampledData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"origin\",\n            \"period\",\n            \"factor\",\n            \"lowerLimit\",\n            \"upperLimit\",\n            \"dimensions\",\n            \"data\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SampledData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"origin\", \"period\", \"factor\", \"lowerLimit\", \"upperLimit\", \"dimensions\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"dimensions\", \"dimensions__ext\"), (\"period\", \"period__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/schedule.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Schedule\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Schedule(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A container for slots of time that may be available for booking\n    appointments.\n    \"\"\"\n\n    __resource_type__ = \"Schedule\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this schedule is in active use\",\n        description=(\n            \"Whether this schedule record is in active use or should not be used \"\n            \"(such as was entered in error).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    actor: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Resource(s) that availability information is being provided for\",\n        description=(\n            \"Slots that reference this schedule resource provide the availability \"\n            \"details to these referenced resource(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"HealthcareService\",\n                \"Location\",\n            ],\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments on availability\",\n        description=(\n            \"Comments on the availability to describe any extended information. \"\n            \"Such as custom constraints on the slots that may be associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    planningHorizon: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"planningHorizon\",\n        title=\"Period of time covered by schedule\",\n        description=(\n            \"The period of time that the slots that reference this Schedule \"\n            \"resource cover (even if none exist). These  cover the amount of time \"\n            \"that an organization's planning horizon; the interval for which they \"\n            \"are currently accepting appointments. This does not define a \"\n            '\"template\" for planning outside these dates.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceCategory\",\n        title=\"High-level category\",\n        description=(\n            \"A broad categorization of the service that is to be performed during \"\n            \"this appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceType\",\n        title=\"Specific service\",\n        description=\"The specific service that is to be performed during this appointment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=\"Type of specialty needed\",\n        description=(\n            \"The specialty of a practitioner that would be required to perform the \"\n            \"service requested in this appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Schedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"actor\",\n            \"planningHorizon\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Schedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"actor\",\n            \"planningHorizon\",\n        ]\n"
  },
  {
    "path": "fhir/resources/R4B/searchparameter.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SearchParameter\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SearchParameter(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Search parameter for a resource.\n    A search parameter that defines a named search item that can be used to\n    search/filter on a resource.\n    \"\"\"\n\n    __resource_type__ = \"SearchParameter\"\n\n    base: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"The resource type(s) this search parameter applies to\",\n        description=(\n            \"The base resource type(s) that this search parameter can be used \"\n            \"against.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    base__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_base\", title=\"Extension field for ``base``.\"\n    )\n\n    chain: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"chain\",\n        title=\"Chained names supported\",\n        description=(\n            \"Contains the names of any search parameters which may be chained to \"\n            \"the containing search parameter. Chained parameters may be added to \"\n            \"search parameters of type reference and specify that resources will \"\n            \"only be returned if they contain a reference to a resource which \"\n            \"matches the chained parameter value. Values for this field should be \"\n            \"drawn from SearchParameter.code for a parameter on the target resource\"\n            \" type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    chain__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_chain\", title=\"Extension field for ``chain``.\"\n    )\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code used in URL\",\n        description=(\n            \"The code used in the URL or the parameter name in a parameters \"\n            \"resource for this search parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    comparator: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"comparator\",\n        title=\"eq | ne | gt | lt | ge | le | sa | eb | ap\",\n        description=\"Comparators supported for the search parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"eq\", \"ne\", \"gt\", \"lt\", \"ge\", \"le\", \"sa\", \"eb\", \"ap\"],\n        },\n    )\n    comparator__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_comparator\", title=\"Extension field for ``comparator``.\"\n    )\n\n    component: typing.List[fhirtypes.SearchParameterComponentType] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"For Composite resources to define the parts\",\n        description=\"Used to define the parts of a composite search parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the search parameter was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the search parameter changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFrom: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Original definition for the search parameter\",\n        description=(\n            \"Where this search parameter is originally defined. If a derivedFrom is\"\n            \" provided, then the details in the search parameter must be consistent\"\n            \" with the definition from which it is defined. i.e. the parameter \"\n            \"should have the same meaning, and (usually) the functionality should \"\n            \"be a proper subset of the underlying search parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SearchParameter\"],\n        },\n    )\n    derivedFrom__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_derivedFrom\", title=\"Extension field for ``derivedFrom``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the search parameter\",\n        description=\"And how it used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this search parameter is authored for\"\n            \" testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"FHIRPath expression that extracts the values\",\n        description=(\n            \"A FHIRPath expression that returns a set of elements for the search \"\n            \"parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for search parameter (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the search parameter is intended\"\n            \" to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=(\n            \"missing | exact | contains | not | text | in | not-in | below | above \"\n            \"| type | identifier | ofType\"\n        ),\n        description=\"A modifier supported for the search parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"missing\",\n                \"exact\",\n                \"contains\",\n                \"not\",\n                \"text\",\n                \"in\",\n                \"not-in\",\n                \"below\",\n                \"above\",\n                \"type\",\n                \"identifier\",\n                \"ofType\",\n            ],\n        },\n    )\n    modifier__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_modifier\", title=\"Extension field for ``modifier``.\"\n    )\n\n    multipleAnd: bool | None = Field(\n        default=None,\n        alias=\"multipleAnd\",\n        title=\"Allow multiple parameters (and)\",\n        description=(\n            \"Whether multiple parameters are allowed - e.g. more than one parameter\"\n            \" with the same name. The search matches if all the parameters match.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    multipleAnd__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_multipleAnd\", title=\"Extension field for ``multipleAnd``.\"\n    )\n\n    multipleOr: bool | None = Field(\n        default=None,\n        alias=\"multipleOr\",\n        title=\"Allow multiple values per parameter (or)\",\n        description=(\n            \"Whether multiple values are allowed for each time the parameter \"\n            \"exists. Values are separated by commas, and the parameter matches if \"\n            \"any of the values match.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    multipleOr__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_multipleOr\", title=\"Extension field for ``multipleOr``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this search parameter (computer friendly)\",\n        description=(\n            \"A natural language name identifying the search parameter. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the search \"\n            \"parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this search parameter is defined\",\n        description=(\n            \"Explanation of why this search parameter is needed and why it has been\"\n            \" designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this search parameter. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    target: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Types of resource (if a resource reference)\",\n        description=\"Types of resource (if a resource is referenced).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    target__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_target\", title=\"Extension field for ``target``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"number | date | string | token | reference | composite | quantity | \"\n            \"uri | special\"\n        ),\n        description=(\n            \"The type of value that a search parameter may contain, and how the \"\n            \"content is interpreted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"number\",\n                \"date\",\n                \"string\",\n                \"token\",\n                \"reference\",\n                \"composite\",\n                \"quantity\",\n                \"uri\",\n                \"special\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this search parameter, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this search parameter when it\"\n            \" is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this search parameter is (or will be) published. This URL \"\n            \"can be the target of a canonical reference. It SHALL remain the same \"\n            \"when the search parameter is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate search parameter instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the search parameter\",\n        description=(\n            \"The identifier that is used to identify this version of the search \"\n            \"parameter when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the search parameter \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    xpath: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"xpath\",\n        title=\"XPath that extracts the values\",\n        description=(\n            \"An XPath expression that returns a set of elements for the search \"\n            \"parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    xpath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_xpath\", title=\"Extension field for ``xpath``.\"\n    )\n\n    xpathUsage: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"xpathUsage\",\n        title=\"normal | phonetic | nearby | distance | other\",\n        description=(\n            \"How the search parameter relates to the set of elements returned by \"\n            \"evaluating the xpath query.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"normal\", \"phonetic\", \"nearby\", \"distance\", \"other\"],\n        },\n    )\n    xpathUsage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_xpathUsage\", title=\"Extension field for ``xpathUsage``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SearchParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"derivedFrom\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"code\",\n            \"base\",\n            \"type\",\n            \"expression\",\n            \"xpath\",\n            \"xpathUsage\",\n            \"target\",\n            \"multipleOr\",\n            \"multipleAnd\",\n            \"comparator\",\n            \"modifier\",\n            \"chain\",\n            \"component\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SearchParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"code\",\n            \"base\",\n            \"type\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"base\", \"base__ext\"),\n            (\"code\", \"code__ext\"),\n            (\"description\", \"description__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"type\", \"type__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n\nclass SearchParameterComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    For Composite resources to define the parts.\n    Used to define the parts of a composite search parameter.\n    \"\"\"\n\n    __resource_type__ = \"SearchParameterComponent\"\n\n    definition: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Defines how the part works\",\n        description=\"The definition of the search parameter that describes this part.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SearchParameter\"],\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Subexpression relative to main expression\",\n        description=(\n            \"A sub-expression that defines how to extract values for this component\"\n            \" from the output of the main SearchParameter.expression.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SearchParameterComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"definition\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SearchParameterComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"definition\", \"definition__ext\"),\n            (\"expression\", \"expression__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/servicerequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ServiceRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass ServiceRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A request for a service to be performed.\n    A record of a request for service such as diagnostic investigations,\n    treatments, or operations to be performed.\n    \"\"\"\n\n    __resource_type__ = \"ServiceRequest\"\n\n    asNeededBoolean: bool | None = Field(\n        default=None,\n        alias=\"asNeededBoolean\",\n        title=\"Preconditions for service\",\n        description=(\n            \"If a CodeableConcept is present, it indicates the pre-condition for \"\n            'performing the service.  For example \"pain\", \"on flare-up\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n    asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_asNeededBoolean\",\n        title=\"Extension field for ``asNeededBoolean``.\",\n    )\n\n    asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"asNeededCodeableConcept\",\n        title=\"Preconditions for service\",\n        description=(\n            \"If a CodeableConcept is present, it indicates the pre-condition for \"\n            'performing the service.  For example \"pain\", \"on flare-up\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"Date request signed\",\n        description=\"When the request transitioned to being actionable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What request fulfills\",\n        description=\"Plan/proposal/order fulfilled by this request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\", \"ServiceRequest\", \"MedicationRequest\"],\n        },\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Location on Body\",\n        description=(\n            \"Anatomic location where the procedure should be performed. This is the\"\n            \" target site.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classification of service\",\n        description=(\n            \"A code that classifies the service for searching, sorting and display \"\n            'purposes (e.g. \"Surgical Procedure\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"What is being requested/ordered\",\n        description=(\n            \"A code that identifies a particular service (i.e., procedure, \"\n            \"diagnostic investigation, or panel of investigations) that have been \"\n            \"requested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"True if service/procedure should not be performed\",\n        description=(\n            \"Set this to true if the record is saying that the service/procedure \"\n            \"should NOT be performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter in which the request was created\",\n        description=(\n            \"An encounter that provides additional information about the healthcare\"\n            \" context in which this request is made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers assigned to this order\",\n        description=(\n            \"Identifiers assigned to this order instance by the orderer and/or the \"\n            \"receiver and/or order fulfiller.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"ServiceRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this ServiceRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    insurance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Associated insurance coverage\",\n        description=(\n            \"Insurance plans, coverage extensions, pre-authorizations and/or pre-\"\n            \"determinations that may be needed for delivering the requested \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\", \"ClaimResponse\"],\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"proposal | plan | directive | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            \"Whether the request is a proposal, plan, an original order or a reflex\"\n            \" order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposal\",\n                \"plan\",\n                \"directive\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    locationCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"locationCode\",\n        title=\"Requested location\",\n        description=(\n            \"The preferred location(s) where the procedure should actually happen \"\n            \"in coded or free text form. E.g. at home or nursing day care center.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    locationReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Requested location\",\n        description=(\n            \"A reference to the the preferred location(s) where the procedure \"\n            \"should actually happen. E.g. at home or nursing day care center.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments\",\n        description=(\n            \"Any other notes and comments made about the service request. For \"\n            \"example, internal billing notes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When service should occur\",\n        description=\"The date/time at which the requested service should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When service should occur\",\n        description=\"The date/time at which the requested service should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When service should occur\",\n        description=\"The date/time at which the requested service should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    orderDetail: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"orderDetail\",\n        title=\"Additional order information\",\n        description=(\n            \"Additional details and instructions about the how the services are to \"\n            \"be delivered.   For example, and order for a urinary catheter may have\"\n            \" an order detail for an external or indwelling catheter, or an order \"\n            \"for a bandage may require additional instructions specifying how the \"\n            \"bandage should be applied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patientInstruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"patientInstruction\",\n        title=\"Patient or consumer-oriented instructions\",\n        description=\"Instructions in terms that are understood by the patient or consumer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    patientInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patientInstruction\",\n        title=\"Extension field for ``patientInstruction``.\",\n    )\n\n    performer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Requested performer\",\n        description=(\n            \"The desired performer for doing the requested service.  For example, \"\n            \"the surgeon, dermatopathologist, endoscopist, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"HealthcareService\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    performerType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=\"Performer role\",\n        description=\"Desired type of performer for doing the requested service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the ServiceRequest should be addressed with \"\n            \"respect to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    quantityQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantityQuantity\",\n        title=\"Service amount\",\n        description=(\n            \"An amount of service being requested which can be a quantity ( for \"\n            \"example $1,500 home modification), a ratio ( for example, 20 half day \"\n            \"visits per month), or a range (2.0 to 1.8 Gy per fraction).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e quantity[x]\n            \"one_of_many\": \"quantity\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    quantityRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"quantityRange\",\n        title=\"Service amount\",\n        description=(\n            \"An amount of service being requested which can be a quantity ( for \"\n            \"example $1,500 home modification), a ratio ( for example, 20 half day \"\n            \"visits per month), or a range (2.0 to 1.8 Gy per fraction).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e quantity[x]\n            \"one_of_many\": \"quantity\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    quantityRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"quantityRatio\",\n        title=\"Service amount\",\n        description=(\n            \"An amount of service being requested which can be a quantity ( for \"\n            \"example $1,500 home modification), a ratio ( for example, 20 half day \"\n            \"visits per month), or a range (2.0 to 1.8 Gy per fraction).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e quantity[x]\n            \"one_of_many\": \"quantity\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Explanation/Justification for procedure or service\",\n        description=(\n            \"An explanation or justification for why this service is being \"\n            \"requested in coded or textual form.   This is often for billing \"\n            \"purposes.  May relate to the resources referred to in \"\n            \"`supportingInfo`.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Explanation/Justification for service or service\",\n        description=(\n            \"Indicates another resource that provides a justification for why this \"\n            \"service is being requested.   May relate to the resources referred to \"\n            \"in `supportingInfo`.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Request provenance\",\n        description=\"Key events in the history of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"What request replaces\",\n        description=(\n            \"The request takes the place of the referenced completed or terminated \"\n            \"request(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/what is requesting service\",\n        description=(\n            \"The individual who initiated the request and has responsibility for \"\n            \"its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    requisition: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"requisition\",\n        title=\"Composite Request ID\",\n        description=(\n            \"A shared identifier common to all service requests that were \"\n            \"authorized more or less simultaneously by a single author, \"\n            \"representing the composite or group identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specimen: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Procedure Samples\",\n        description=\"One or more specimens that the laboratory procedure will use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | on-hold | revoked | completed | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=\"The status of the order.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"on-hold\",\n                \"revoked\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Individual or Entity the service is ordered for\",\n        description=(\n            \"On whom or what the service is to be performed. This is usually a \"\n            \"human patient, but can also be requested on animals, groups of humans \"\n            \"or animals, devices such as dialysis machines, or even locations \"\n            \"(typically for environmental scans).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Location\", \"Device\"],\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Additional clinical information\",\n        description=(\n            \"Additional clinical information about the patient or specimen that may\"\n            \" influence the services or their interpretations.     This information\"\n            \" includes diagnosis, clinical findings and other observations.  In \"\n            'laboratory ordering these are typically referred to as \"ask at order '\n            'entry questions (AOEs)\".  This includes observations explicitly '\n            \"requested by the producer (filler) to provide context or supporting \"\n            \"information needed to complete the order. For example,  reporting the \"\n            \"amount of inspired oxygen for blood gas measurements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ServiceRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"replaces\",\n            \"requisition\",\n            \"status\",\n            \"intent\",\n            \"category\",\n            \"priority\",\n            \"doNotPerform\",\n            \"code\",\n            \"orderDetail\",\n            \"quantityQuantity\",\n            \"quantityRatio\",\n            \"quantityRange\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n            \"authoredOn\",\n            \"requester\",\n            \"performerType\",\n            \"performer\",\n            \"locationCode\",\n            \"locationReference\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"insurance\",\n            \"supportingInfo\",\n            \"specimen\",\n            \"bodySite\",\n            \"note\",\n            \"patientInstruction\",\n            \"relevantHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ServiceRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"replaces\",\n            \"requisition\",\n            \"status\",\n            \"intent\",\n            \"category\",\n            \"priority\",\n            \"doNotPerform\",\n            \"code\",\n            \"orderDetail\",\n            \"quantityQuantity\",\n            \"quantityRatio\",\n            \"quantityRange\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n            \"authoredOn\",\n            \"requester\",\n            \"performerType\",\n            \"performer\",\n            \"locationCode\",\n            \"locationReference\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"specimen\",\n            \"bodySite\",\n            \"patientInstruction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"asNeeded\": [\"asNeededBoolean\", \"asNeededCodeableConcept\"],\n            \"occurrence\": [\n                \"occurrenceDateTime\",\n                \"occurrencePeriod\",\n                \"occurrenceTiming\",\n            ],\n            \"quantity\": [\"quantityQuantity\", \"quantityRange\", \"quantityRatio\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/signature.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Signature\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Signature(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A Signature - XML DigSig, JWS, Graphical image of signature, etc..\n    A signature along with supporting context. The signature may be a digital\n    signature that is cryptographic in nature, or some other signature\n    acceptable to the domain. This other signature may be as simple as a\n    graphical image representing a hand-written signature, or a signature\n    ceremony Different signature approaches have different utilities.\n    \"\"\"\n\n    __resource_type__ = \"Signature\"\n\n    data: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"The actual signature content (XML DigSig. JWS, picture, etc.)\",\n        description=(\n            \"The base64 encoding of the Signature content. When signature is not \"\n            \"recorded electronically this element would be empty.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_data\", title=\"Extension field for ``data``.\"\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"The party represented\",\n        description=(\n            \"A reference to an application-usable description of the identity that \"\n            \"is represented by the signature.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Device\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    sigFormat: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"sigFormat\",\n        title=\"The technical format of the signature\",\n        description=(\n            \"A mime type that indicates the technical format of the signature. \"\n            \"Important mime types are application/signature+xml for X ML DigSig, \"\n            \"application/jose for JWS, and image/* for a graphical image of a \"\n            \"signature, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sigFormat__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sigFormat\", title=\"Extension field for ``sigFormat``.\"\n    )\n\n    targetFormat: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"targetFormat\",\n        title=\"The technical format of the signed resources\",\n        description=(\n            \"A mime type that indicates the technical format of the target \"\n            \"resources signed by the signature.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    targetFormat__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_targetFormat\",\n        title=\"Extension field for ``targetFormat``.\",\n    )\n\n    type: typing.List[fhirtypes.CodingType] = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Indication of the reason the entity signed the object(s)\",\n        description=(\n            \"An indication of the reason that the entity signed this document. This\"\n            \" may be explicitly included as part of the signature information and \"\n            \"can be used when determining accountability for various actions \"\n            \"concerning the document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    when: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"when\",\n        title=\"When the signature was created\",\n        description=\"When the digital signature was signed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    when__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_when\", title=\"Extension field for ``when``.\"\n    )\n\n    who: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"who\",\n        title=\"Who signed\",\n        description=(\n            \"A reference to an application-usable description of the identity that \"\n            \"signed  (e.g. the signature used their private key).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Device\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Signature`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"when\",\n            \"who\",\n            \"onBehalfOf\",\n            \"targetFormat\",\n            \"sigFormat\",\n            \"data\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Signature`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"type\", \"when\", \"who\", \"onBehalfOf\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"when\", \"when__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/slot.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Slot\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Slot(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A slot of time on a schedule that may be available for booking appointments.\n    \"\"\"\n\n    __resource_type__ = \"Slot\"\n\n    appointmentType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"appointmentType\",\n        title=(\n            \"The style of appointment or patient that may be booked in the slot \"\n            \"(not service type)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=(\n            \"Comments on the slot to describe any extended information. Such as \"\n            \"custom constraints on the slot\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    end: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"Date/Time that the slot is to conclude\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    overbooked: bool | None = Field(\n        default=None,\n        alias=\"overbooked\",\n        title=(\n            \"This slot has already been overbooked, appointments are unlikely to be\"\n            \" accepted for this time\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    overbooked__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_overbooked\", title=\"Extension field for ``overbooked``.\"\n    )\n\n    schedule: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"schedule\",\n        title=(\n            \"The schedule resource that this slot defines an interval of status \"\n            \"information\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Schedule\"],\n        },\n    )\n\n    serviceCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceCategory\",\n        title=(\n            \"A broad categorization of the service that is to be performed during \"\n            \"this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceType\",\n        title=(\n            \"The type of appointments that can be booked into this slot (ideally \"\n            \"this would be an identifiable service - which is at a location, rather\"\n            \" than the location itself). If provided then this overrides the value \"\n            \"provided on the availability resource\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=(\n            \"The specialty of a practitioner that would be required to perform the \"\n            \"service requested in this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    start: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Date/Time that the slot is to begin\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"busy | free | busy-unavailable | busy-tentative | entered-in-error\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"busy\",\n                \"free\",\n                \"busy-unavailable\",\n                \"busy-tentative\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Slot`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"appointmentType\",\n            \"schedule\",\n            \"status\",\n            \"start\",\n            \"end\",\n            \"overbooked\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Slot`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"appointmentType\",\n            \"schedule\",\n            \"status\",\n            \"start\",\n            \"end\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"end\", \"end__ext\"),\n            (\"start\", \"start__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/specimen.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Specimen\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Specimen(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Sample for analysis.\n    A sample to be used for analysis.\n    \"\"\"\n\n    __resource_type__ = \"Specimen\"\n\n    accessionIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"accessionIdentifier\",\n        title=\"Identifier assigned by the lab\",\n        description=(\n            \"The identifier assigned by the lab when accessioning specimen(s). This\"\n            \" is not necessarily the same as the specimen identifier, depending on \"\n            \"local lab procedures.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    collection: fhirtypes.SpecimenCollectionType | None = Field(\n        default=None,\n        alias=\"collection\",\n        title=\"Collection details\",\n        description=\"Details concerning the specimen collection.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    condition: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"State of the specimen\",\n        description=\"A mode or state of being that describes the nature of the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    container: typing.List[fhirtypes.SpecimenContainerType] | None = Field(\n        default=None,\n        alias=\"container\",\n        title=\"Direct container of specimen (tube/slide, etc.)\",\n        description=(\n            \"The container holding the specimen.  The recursive nature of \"\n            \"containers; i.e. blood in tube in tray in rack is not addressed here.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Identifier\",\n        description=\"Id for specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments\",\n        description=(\n            \"To communicate any details or issues about the specimen or during the \"\n            \"specimen collection. (for example: broken vial, sent with patient, \"\n            \"frozen).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    parent: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Specimen from which this specimen originated\",\n        description=(\n            \"Reference to the parent (source) specimen which is used when the \"\n            \"specimen was either derived from or a component of another specimen.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    processing: typing.List[fhirtypes.SpecimenProcessingType] | None = Field(\n        default=None,\n        alias=\"processing\",\n        title=\"Processing and processing step details\",\n        description=\"Details concerning processing and processing steps for the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    receivedTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"receivedTime\",\n        title=\"The time when specimen was received for processing\",\n        description=\"Time when specimen was received for processing or testing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    receivedTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_receivedTime\",\n        title=\"Extension field for ``receivedTime``.\",\n    )\n\n    request: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Why the specimen was collected\",\n        description=(\n            \"Details concerning a service request that required a specimen to be \"\n            \"collected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"available | unavailable | unsatisfactory | entered-in-error\",\n        description=\"The availability of the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"available\",\n                \"unavailable\",\n                \"unsatisfactory\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=(\n            \"Where the specimen came from. This may be from patient(s), from a \"\n            \"location (e.g., the source of an environmental sample), or a sampling \"\n            \"of a substance or a device\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Device\",\n                \"Substance\",\n                \"Location\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of material that forms the specimen\",\n        description=\"The kind of material that forms the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Specimen`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"accessionIdentifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"receivedTime\",\n            \"parent\",\n            \"request\",\n            \"collection\",\n            \"processing\",\n            \"container\",\n            \"condition\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Specimen`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"accessionIdentifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"receivedTime\",\n            \"condition\",\n        ]\n\n\nclass SpecimenCollection(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Collection details.\n    Details concerning the specimen collection.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenCollection\"\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical collection site\",\n        description=(\n            \"Anatomical location from which the specimen was collected (if subject \"\n            \"is a patient). This is the target site.  This element is not used for \"\n            \"environmental specimens.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    collectedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"collectedDateTime\",\n        title=\"Collection time\",\n        description=(\n            \"Time when specimen was collected from subject - the physiologically \"\n            \"relevant time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e collected[x]\n            \"one_of_many\": \"collected\",\n            \"one_of_many_required\": False,\n        },\n    )\n    collectedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_collectedDateTime\",\n        title=\"Extension field for ``collectedDateTime``.\",\n    )\n\n    collectedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"collectedPeriod\",\n        title=\"Collection time\",\n        description=(\n            \"Time when specimen was collected from subject - the physiologically \"\n            \"relevant time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e collected[x]\n            \"one_of_many\": \"collected\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    collector: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"collector\",\n        title=\"Who collected the specimen\",\n        description=\"Person who collected the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    duration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"How long it took to collect specimen\",\n        description=\"The span of time over which the collection of a specimen occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    fastingStatusCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fastingStatusCodeableConcept\",\n        title=\"Whether or how long patient abstained from food and/or drink\",\n        description=(\n            \"Abstinence or reduction from some or all food, drink, or both, for a \"\n            \"period of time prior to sample collection.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fastingStatus[x]\n            \"one_of_many\": \"fastingStatus\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fastingStatusDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"fastingStatusDuration\",\n        title=\"Whether or how long patient abstained from food and/or drink\",\n        description=(\n            \"Abstinence or reduction from some or all food, drink, or both, for a \"\n            \"period of time prior to sample collection.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fastingStatus[x]\n            \"one_of_many\": \"fastingStatus\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Technique used to perform collection\",\n        description=(\n            \"A coded value specifying the technique that is used to perform the \"\n            \"procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"The quantity of specimen collected\",\n        description=(\n            \"The quantity of specimen collected; for instance the volume of a blood\"\n            \" sample, or the physical measurement of an anatomic pathology sample.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenCollection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"collector\",\n            \"collectedDateTime\",\n            \"collectedPeriod\",\n            \"duration\",\n            \"quantity\",\n            \"method\",\n            \"bodySite\",\n            \"fastingStatusCodeableConcept\",\n            \"fastingStatusDuration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenCollection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"collector\",\n            \"collectedDateTime\",\n            \"collectedPeriod\",\n            \"duration\",\n            \"fastingStatusCodeableConcept\",\n            \"fastingStatusDuration\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"collected\": [\"collectedDateTime\", \"collectedPeriod\"],\n            \"fastingStatus\": [\"fastingStatusCodeableConcept\", \"fastingStatusDuration\"],\n        }\n        return one_of_many_fields\n\n\nclass SpecimenContainer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Direct container of specimen (tube/slide, etc.).\n    The container holding the specimen.  The recursive nature of containers;\n    i.e. blood in tube in tray in rack is not addressed here.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenContainer\"\n\n    additiveCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"additiveCodeableConcept\",\n        title=\"Additive associated with container\",\n        description=(\n            \"Introduced substance to preserve, maintain or enhance the specimen. \"\n            \"Examples: Formalin, Citrate, EDTA.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e additive[x]\n            \"one_of_many\": \"additive\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    additiveReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"additiveReference\",\n        title=\"Additive associated with container\",\n        description=(\n            \"Introduced substance to preserve, maintain or enhance the specimen. \"\n            \"Examples: Formalin, Citrate, EDTA.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e additive[x]\n            \"one_of_many\": \"additive\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    capacity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"capacity\",\n        title=\"Container volume or size\",\n        description=\"The capacity (volume or other measure) the container may contain.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of the container\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Id for the container\",\n        description=(\n            \"Id for container. There may be multiple; a manufacturer's bar code, \"\n            \"lab assigned identifier, etc. The container ID may differ from the \"\n            \"specimen id in some circumstances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specimenQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"specimenQuantity\",\n        title=\"Quantity of specimen within container\",\n        description=(\n            \"The quantity of specimen in the container; may be volume, dimensions, \"\n            \"or other appropriate measurements, depending on the specimen type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of container directly associated with specimen\",\n        description=(\n            \"The type of container associated with the specimen (e.g. slide, \"\n            \"aliquot, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenContainer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"description\",\n            \"type\",\n            \"capacity\",\n            \"specimenQuantity\",\n            \"additiveCodeableConcept\",\n            \"additiveReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenContainer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"additive\": [\"additiveCodeableConcept\", \"additiveReference\"]\n        }\n        return one_of_many_fields\n\n\nclass SpecimenProcessing(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing and processing step details.\n    Details concerning processing and processing steps for the specimen.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenProcessing\"\n\n    additive: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"additive\",\n        title=\"Material used in the processing step\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of procedure\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    procedure: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"Indicates the treatment step  applied to the specimen\",\n        description=\"A coded value specifying the procedure used to process the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timeDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timeDateTime\",\n        title=\"Date and time of specimen processing\",\n        description=(\n            \"A record of the time or period when the specimen processing occurred.\"\n            \"  For example the time of sample fixation or the period of time the \"\n            \"sample was in formalin.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e time[x]\n            \"one_of_many\": \"time\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timeDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timeDateTime\",\n        title=\"Extension field for ``timeDateTime``.\",\n    )\n\n    timePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timePeriod\",\n        title=\"Date and time of specimen processing\",\n        description=(\n            \"A record of the time or period when the specimen processing occurred.\"\n            \"  For example the time of sample fixation or the period of time the \"\n            \"sample was in formalin.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e time[x]\n            \"one_of_many\": \"time\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenProcessing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"procedure\",\n            \"additive\",\n            \"timeDateTime\",\n            \"timePeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenProcessing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"time\": [\"timeDateTime\", \"timePeriod\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/specimendefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SpecimenDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SpecimenDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Kind of specimen.\n    A kind of specimen with associated set of requirements.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenDefinition\"\n\n    collection: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"collection\",\n        title=\"Specimen collection procedure\",\n        description=\"The action to be performed for collecting the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier of a kind of specimen\",\n        description=\"A business identifier associated with the kind of specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patientPreparation: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"patientPreparation\",\n        title=\"Patient preparation for collection\",\n        description=\"Preparation of the patient for specimen collection.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    timeAspect: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"timeAspect\",\n        title=\"Time aspect for collection\",\n        description=\"Time aspect of specimen collection (duration or offset).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    timeAspect__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timeAspect\", title=\"Extension field for ``timeAspect``.\"\n    )\n\n    typeCollected: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"typeCollected\",\n        title=\"Kind of material to collect\",\n        description=\"The kind of material to be collected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    typeTested: typing.List[fhirtypes.SpecimenDefinitionTypeTestedType] | None = Field(\n        default=None,\n        alias=\"typeTested\",\n        title=\"Specimen in container intended for testing by lab\",\n        description=(\n            \"Specimen conditioned in a container as expected by the testing \"\n            \"laboratory.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"typeCollected\",\n            \"patientPreparation\",\n            \"timeAspect\",\n            \"collection\",\n            \"typeTested\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"typeCollected\",\n            \"patientPreparation\",\n            \"timeAspect\",\n            \"collection\",\n        ]\n\n\nclass SpecimenDefinitionTypeTested(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specimen in container intended for testing by lab.\n    Specimen conditioned in a container as expected by the testing laboratory.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenDefinitionTypeTested\"\n\n    container: fhirtypes.SpecimenDefinitionTypeTestedContainerType | None = Field(\n        default=None,\n        alias=\"container\",\n        title=\"The specimen's container\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    handling: typing.List[\n        fhirtypes.SpecimenDefinitionTypeTestedHandlingType\n    ] | None = Field(\n        default=None,\n        alias=\"handling\",\n        title=\"Specimen handling before testing\",\n        description=(\n            \"Set of instructions for preservation/transport of the specimen at a \"\n            \"defined temperature interval, prior the testing process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    isDerived: bool | None = Field(\n        default=None,\n        alias=\"isDerived\",\n        title=\"Primary or secondary specimen\",\n        description=\"Primary of secondary specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    isDerived__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isDerived\", title=\"Extension field for ``isDerived``.\"\n    )\n\n    preference: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"preference\",\n        title=\"preferred | alternate\",\n        description=\"The preference for this type of conditioned specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"preferred\", \"alternate\"],\n        },\n    )\n    preference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preference\", title=\"Extension field for ``preference``.\"\n    )\n\n    rejectionCriterion: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"rejectionCriterion\",\n        title=\"Rejection criterion\",\n        description=(\n            \"Criterion for rejection of the specimen in its container by the \"\n            \"laboratory.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requirement: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"requirement\",\n        title=\"Specimen requirements\",\n        description=(\n            \"Requirements for delivery and special handling of this kind of \"\n            \"conditioned specimen.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    requirement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requirement\", title=\"Extension field for ``requirement``.\"\n    )\n\n    retentionTime: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"retentionTime\",\n        title=\"Specimen retention time\",\n        description=(\n            \"The usual time that a specimen of this kind is retained after the \"\n            \"ordered tests are completed, for the purpose of additional testing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of intended specimen\",\n        description=\"The kind of specimen conditioned for testing expected by lab.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenDefinitionTypeTested`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"isDerived\",\n            \"type\",\n            \"preference\",\n            \"container\",\n            \"requirement\",\n            \"retentionTime\",\n            \"rejectionCriterion\",\n            \"handling\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTested`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"preference\", \"preference__ext\")]\n        return required_fields\n\n\nclass SpecimenDefinitionTypeTestedContainer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The specimen's container.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenDefinitionTypeTestedContainer\"\n\n    additive: typing.List[\n        fhirtypes.SpecimenDefinitionTypeTestedContainerAdditiveType\n    ] | None = Field(\n        default=None,\n        alias=\"additive\",\n        title=\"Additive associated with container\",\n        description=(\n            \"Substance introduced in the kind of container to preserve, maintain or\"\n            \" enhance the specimen. Examples: Formalin, Citrate, EDTA.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    cap: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"cap\",\n        title=\"Color of container cap\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    capacity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"capacity\",\n        title=\"Container capacity\",\n        description=\"The capacity (volume or other measure) of this kind of container.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Container description\",\n        description=\"The textual description of the kind of container.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    material: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"material\",\n        title=\"Container material\",\n        description=\"The type of material of the container.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    minimumVolumeQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"minimumVolumeQuantity\",\n        title=\"Minimum volume\",\n        description=\"The minimum volume to be conditioned in the container.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e minimumVolume[x]\n            \"one_of_many\": \"minimumVolume\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    minimumVolumeString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"minimumVolumeString\",\n        title=\"Minimum volume\",\n        description=\"The minimum volume to be conditioned in the container.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e minimumVolume[x]\n            \"one_of_many\": \"minimumVolume\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minimumVolumeString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minimumVolumeString\",\n        title=\"Extension field for ``minimumVolumeString``.\",\n    )\n\n    preparation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"preparation\",\n        title=\"Specimen container preparation\",\n        description=(\n            \"Special processing that should be applied to the container for this \"\n            \"kind of specimen.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preparation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preparation\", title=\"Extension field for ``preparation``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of container associated with the kind of specimen\",\n        description=\"The type of container used to contain this kind of specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenDefinitionTypeTestedContainer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"material\",\n            \"type\",\n            \"cap\",\n            \"description\",\n            \"capacity\",\n            \"minimumVolumeQuantity\",\n            \"minimumVolumeString\",\n            \"additive\",\n            \"preparation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTestedContainer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"minimumVolume\": [\"minimumVolumeQuantity\", \"minimumVolumeString\"]\n        }\n        return one_of_many_fields\n\n\nclass SpecimenDefinitionTypeTestedContainerAdditive(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additive associated with container.\n    Substance introduced in the kind of container to preserve, maintain or\n    enhance the specimen. Examples: Formalin, Citrate, EDTA.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenDefinitionTypeTestedContainerAdditive\"\n\n    additiveCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"additiveCodeableConcept\",\n        title=\"Additive associated with container\",\n        description=(\n            \"Substance introduced in the kind of container to preserve, maintain or\"\n            \" enhance the specimen. Examples: Formalin, Citrate, EDTA.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e additive[x]\n            \"one_of_many\": \"additive\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    additiveReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"additiveReference\",\n        title=\"Additive associated with container\",\n        description=(\n            \"Substance introduced in the kind of container to preserve, maintain or\"\n            \" enhance the specimen. Examples: Formalin, Citrate, EDTA.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e additive[x]\n            \"one_of_many\": \"additive\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenDefinitionTypeTestedContainerAdditive`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"additiveCodeableConcept\",\n            \"additiveReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTestedContainerAdditive`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"additive\": [\"additiveCodeableConcept\", \"additiveReference\"]\n        }\n        return one_of_many_fields\n\n\nclass SpecimenDefinitionTypeTestedHandling(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specimen handling before testing.\n    Set of instructions for preservation/transport of the specimen at a defined\n    temperature interval, prior the testing process.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenDefinitionTypeTestedHandling\"\n\n    instruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"instruction\",\n        title=\"Preservation instruction\",\n        description=(\n            \"Additional textual instructions for the preservation or transport of \"\n            \"the specimen. For instance, 'Protect from light exposure'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_instruction\", title=\"Extension field for ``instruction``.\"\n    )\n\n    maxDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"maxDuration\",\n        title=\"Maximum preservation time\",\n        description=(\n            \"The maximum time interval of preservation of the specimen with these \"\n            \"conditions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    temperatureQualifier: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"temperatureQualifier\",\n        title=\"Temperature qualifier\",\n        description=(\n            \"It qualifies the interval of temperature, which characterizes an \"\n            \"occurrence of handling. Conditions that are not related to temperature\"\n            \" may be handled in the instruction element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    temperatureRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"temperatureRange\",\n        title=\"Temperature range\",\n        description=\"The temperature interval for this set of handling instructions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenDefinitionTypeTestedHandling`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"temperatureQualifier\",\n            \"temperatureRange\",\n            \"maxDuration\",\n            \"instruction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTestedHandling`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/structuredefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/StructureDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass StructureDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Structural Definition.\n    A definition of a FHIR structure. This resource is used to describe the\n    underlying resources, data types defined in FHIR, and also for describing\n    extensions and constraints on resources and data types.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinition\"\n\n    abstract: bool | None = Field(\n        default=None,\n        alias=\"abstract\",\n        title=\"Whether the structure is abstract\",\n        description=(\n            \"Whether structure this definition describes is abstract or not  - that\"\n            \" is, whether the structure is not intended to be instantiated. For \"\n            \"Resources and Data types, abstract types will never be exchanged  \"\n            \"between systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    abstract__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_abstract\", title=\"Extension field for ``abstract``.\"\n    )\n\n    baseDefinition: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"baseDefinition\",\n        title=\"Definition that this type is constrained/specialized from\",\n        description=(\n            \"An absolute URI that is the base structure from which this type is \"\n            \"derived, either by specialization or constraint.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    baseDefinition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_baseDefinition\",\n        title=\"Extension field for ``baseDefinition``.\",\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: typing.List[fhirtypes.StructureDefinitionContextType] | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"If an extension, where it can be used in instances\",\n        description=(\n            \"Identifies the types of resource or data type elements to which the \"\n            \"extension can be applied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contextInvariant: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"contextInvariant\",\n        title=\"FHIRPath invariants - when the extension can be used\",\n        description=(\n            \"A set of rules as FHIRPath Invariants about when the extension can be \"\n            \"used (e.g. co-occurrence variants for the extension). All the rules \"\n            \"must be true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    contextInvariant__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_contextInvariant\",\n        title=\"Extension field for ``contextInvariant``.\",\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the structure definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the structure definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the structure definition was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the structure definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivation: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"derivation\",\n        title=\"specialization | constraint - How relates to base definition\",\n        description=\"How the type relates to the baseDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"specialization\", \"constraint\"],\n        },\n    )\n    derivation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_derivation\", title=\"Extension field for ``derivation``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the structure definition\",\n        description=(\n            \"A free text natural language description of the structure definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    differential: fhirtypes.StructureDefinitionDifferentialType | None = Field(\n        default=None,\n        alias=\"differential\",\n        title=\"Differential view of the structure\",\n        description=(\n            \"A differential view is expressed relative to the base \"\n            \"StructureDefinition - a statement of differences that it applies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this structure definition is authored\"\n            \" for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fhirVersion: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"fhirVersion\",\n        title=\"FHIR Version this StructureDefinition targets\",\n        description=(\n            \"The version of the FHIR specification on which this \"\n            \"StructureDefinition is based - this is the formal version of the \"\n            \"specification, without the revision number, e.g. \"\n            \"[publication].[major].[minor], which is 4.3.0 for this version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fhirVersion\", title=\"Extension field for ``fhirVersion``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the structure definition\",\n        description=(\n            \"A formal identifier that is used to identify this structure definition\"\n            \" when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for structure definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the structure definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    keyword: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"keyword\",\n        title=\"Assist with indexing and finding\",\n        description=(\n            \"A set of key words or terms from external terminologies that may be \"\n            \"used to assist with indexing and searching of templates nby describing\"\n            \" the use of this structure definition, or the content it describes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"primitive-type | complex-type | resource | logical\",\n        description=\"Defines the kind of structure that this definition is describing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"primitive-type\", \"complex-type\", \"resource\", \"logical\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    mapping: typing.List[fhirtypes.StructureDefinitionMappingType] | None = Field(\n        default=None,\n        alias=\"mapping\",\n        title=\"External specification that the content is mapped to\",\n        description=\"An external specification that the content is mapped to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this structure definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the structure definition. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the \"\n            \"structure definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this structure definition is defined\",\n        description=(\n            \"Explanation of why this structure definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    snapshot: fhirtypes.StructureDefinitionSnapshotType | None = Field(\n        default=None,\n        alias=\"snapshot\",\n        title=\"Snapshot view of the structure\",\n        description=(\n            \"A snapshot view is expressed in a standalone form that can be used and\"\n            \" interpreted without considering the base StructureDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this structure definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this structure definition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the structure \" \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type defined or constrained by this structure\",\n        description=(\n            \"The type this structure describes. If the derivation kind is \"\n            \"'specialization' then this is the master definition for a type, and \"\n            \"there is always one of these (a data type, an extension, a resource, \"\n            \"including abstract ones). Otherwise the structure definition is a \"\n            \"constraint on the stated type (and in this case, the type cannot be an\"\n            \" abstract type).  References are URLs that are relative to \"\n            'http://hl7.org/fhir/StructureDefinition e.g. \"string\" is a reference '\n            \"to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are \"\n            \"only allowed in logical models.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this structure definition, represented as a \"\n            \"URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this structure definition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which at which an \"\n            \"authoritative instance of this structure definition is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the structure definition is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate structure definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the structure definition\",\n        description=(\n            \"The identifier that is used to identify this version of the structure \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the structure \"\n            \"definition author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"keyword\",\n            \"fhirVersion\",\n            \"mapping\",\n            \"kind\",\n            \"abstract\",\n            \"context\",\n            \"contextInvariant\",\n            \"type\",\n            \"baseDefinition\",\n            \"derivation\",\n            \"snapshot\",\n            \"differential\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"keyword\",\n            \"fhirVersion\",\n            \"kind\",\n            \"abstract\",\n            \"context\",\n            \"contextInvariant\",\n            \"type\",\n            \"baseDefinition\",\n            \"derivation\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"abstract\", \"abstract__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"type\", \"type__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n\nclass StructureDefinitionContext(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If an extension, where it can be used in instances.\n    Identifies the types of resource or data type elements to which the\n    extension can be applied.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinitionContext\"\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Where the extension can be used in instances\",\n        description=(\n            \"An expression that defines where an extension can be used in \" \"resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"fhirpath | element | extension\",\n        description=(\n            \"Defines how to interpret the expression that defines what the context \"\n            \"of the extension is.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"fhirpath\", \"element\", \"extension\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinitionContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinitionContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"expression\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"expression\", \"expression__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass StructureDefinitionDifferential(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Differential view of the structure.\n    A differential view is expressed relative to the base StructureDefinition -\n    a statement of differences that it applies.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinitionDifferential\"\n\n    element: typing.List[fhirtypes.ElementDefinitionType] = Field(\n        default=...,\n        alias=\"element\",\n        title=\"Definition of elements in the resource (if no StructureDefinition)\",\n        description=\"Captures constraints on each element within the resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinitionDifferential`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"element\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinitionDifferential`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass StructureDefinitionMapping(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    External specification that the content is mapped to.\n    An external specification that the content is mapped to.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinitionMapping\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Versions, Issues, Scope limitations etc.\",\n        description=(\n            \"Comments about this mapping, including version notes, issues, scope \"\n            \"limitations, and other important notes for usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    identity: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"identity\",\n        title=\"Internal id when this mapping is used\",\n        description=(\n            \"An Internal id that is used to identify this mapping set when specific\"\n            \" mappings are made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_identity\", title=\"Extension field for ``identity``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Names what this mapping refers to\",\n        description=\"A name for the specification that is being mapped to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Identifies what this mapping refers to\",\n        description=(\n            \"An absolute URI that identifies the specification that this mapping is\"\n            \" expressed to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinitionMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identity\",\n            \"uri\",\n            \"name\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinitionMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"identity\", \"identity__ext\")]\n        return required_fields\n\n\nclass StructureDefinitionSnapshot(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Snapshot view of the structure.\n    A snapshot view is expressed in a standalone form that can be used and\n    interpreted without considering the base StructureDefinition.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinitionSnapshot\"\n\n    element: typing.List[fhirtypes.ElementDefinitionType] = Field(\n        default=...,\n        alias=\"element\",\n        title=\"Definition of elements in the resource (if no StructureDefinition)\",\n        description=\"Captures constraints on each element within the resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinitionSnapshot`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"element\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinitionSnapshot`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/structuremap.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/StructureMap\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass StructureMap(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A Map of relationships between 2 structures that can be used to transform\n    data.\n    \"\"\"\n\n    __resource_type__ = \"StructureMap\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the structure map and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the structure map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the structure map was published. \"\n            \"The date must change when the business version changes and it must \"\n            \"change if the status code changes. In addition, it should change when \"\n            \"the substantive content of the structure map changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the structure map\",\n        description=(\n            \"A free text natural language description of the structure map from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this structure map is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    group: typing.List[fhirtypes.StructureMapGroupType] = Field(\n        default=...,\n        alias=\"group\",\n        title=\"Named sections for reader convenience\",\n        description=(\n            \"Organizes the mapping into manageable chunks for human review/ease of \"\n            \"maintenance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the structure map\",\n        description=(\n            \"A formal identifier that is used to identify this structure map when \"\n            \"it is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    import_fhir: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"import\",\n        title=\"Other maps used by this map (canonical URLs)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureMap\"],\n        },\n    )\n    import__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_import\", title=\"Extension field for ``import_fhir``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for structure map (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the structure map is intended to\"\n            \" be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this structure map (computer friendly)\",\n        description=(\n            \"A natural language name identifying the structure map. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the \"\n            \"structure map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this structure map is defined\",\n        description=(\n            \"Explanation of why this structure map is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this structure map. Enables tracking the life-cycle of \"\n            \"the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    structure: typing.List[fhirtypes.StructureMapStructureType] | None = Field(\n        default=None,\n        alias=\"structure\",\n        title=\"Structure Definition used by this map\",\n        description=(\n            \"A structure definition used by this map. The structure definition may \"\n            \"describe instances that are converted, or the instances that are \"\n            \"produced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this structure map (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the structure map.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this structure map, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this structure map when it is\"\n            \" referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this structure map is (or will be) published. This URL can\"\n            \" be the target of a canonical reference. It SHALL remain the same when\"\n            \" the structure map is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate structure map instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the structure map\",\n        description=(\n            \"The identifier that is used to identify this version of the structure \"\n            \"map when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the structure map \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMap`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"structure\",\n            \"import\",\n            \"group\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMap`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"structure\",\n            \"import\",\n            \"group\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n\nclass StructureMapGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Named sections for reader convenience.\n    Organizes the mapping into manageable chunks for human review/ease of\n    maintenance.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroup\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Additional description/explanation for group\",\n        description=(\n            \"Additional supporting documentation that explains the purpose of the \"\n            \"group and the types of mappings within it.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    extends: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"extends\",\n        title=\"Another group that this group adds rules to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    extends__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_extends\", title=\"Extension field for ``extends``.\"\n    )\n\n    input: typing.List[fhirtypes.StructureMapGroupInputType] = Field(\n        default=...,\n        alias=\"input\",\n        title=\"Named instance provided when invoking the map\",\n        description=(\n            \"A name assigned to an instance of data. The instance must be provided \"\n            \"when the mapping is invoked.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human-readable label\",\n        description=\"A unique name for the group for the convenience of human readers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    rule: typing.List[fhirtypes.StructureMapGroupRuleType] = Field(\n        default=...,\n        alias=\"rule\",\n        title=\"Transform Rule from source to target\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    typeMode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"typeMode\",\n        title=\"none | types | type-and-types\",\n        description=(\n            \"If this is the default rule set to apply for the source type or this \"\n            \"combination of types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"none\", \"types\", \"type-and-types\"],\n        },\n    )\n    typeMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_typeMode\", title=\"Extension field for ``typeMode``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"extends\",\n            \"typeMode\",\n            \"documentation\",\n            \"input\",\n            \"rule\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"name\",\n            \"extends\",\n            \"typeMode\",\n            \"documentation\",\n            \"input\",\n            \"rule\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"typeMode\", \"typeMode__ext\")]\n        return required_fields\n\n\nclass StructureMapGroupInput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Named instance provided when invoking the map.\n    A name assigned to an instance of data. The instance must be provided when\n    the mapping is invoked.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupInput\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Documentation for this instance of data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"source | target\",\n        description=\"Mode for this instance of data.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"source\", \"target\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this instance of data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type for this instance of data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"type\",\n            \"mode\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"type\", \"mode\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\"), (\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass StructureMapGroupRule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Transform Rule from source to target.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRule\"\n\n    dependent: typing.List[fhirtypes.StructureMapGroupRuleDependentType] | None = Field(\n        default=None,\n        alias=\"dependent\",\n        title=\"Which other rules to apply in the context of this rule\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Documentation for this instance of data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the rule for internal references\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    rule: typing.List[fhirtypes.StructureMapGroupRuleType] | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"Rules contained in this rule\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: typing.List[fhirtypes.StructureMapGroupRuleSourceType] = Field(\n        default=...,\n        alias=\"source\",\n        title=\"Source inputs to the mapping\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    target: typing.List[fhirtypes.StructureMapGroupRuleTargetType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Content to create because of this mapping rule\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"source\",\n            \"target\",\n            \"rule\",\n            \"dependent\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"source\", \"target\", \"rule\", \"dependent\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass StructureMapGroupRuleDependent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Which other rules to apply in the context of this rule.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRuleDependent\"\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of a rule or group to apply\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    variable: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"Variable to pass to the rule or group\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    variable__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_variable\", title=\"Extension field for ``variable``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRuleDependent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"variable\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleDependent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"variable\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"variable\", \"variable__ext\")]\n        return required_fields\n\n\nclass StructureMapGroupRuleSource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Source inputs to the mapping.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRuleSource\"\n\n    check: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"check\",\n        title=(\n            \"FHIRPath expression  - must be true or the mapping engine throws an \"\n            \"error instead of completing\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    check__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_check\", title=\"Extension field for ``check``.\"\n    )\n\n    condition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"FHIRPath expression  - must be true or the rule does not apply\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_condition\", title=\"Extension field for ``condition``.\"\n    )\n\n    context: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Type or variable this rule applies to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    context__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_context\", title=\"Extension field for ``context``.\"\n    )\n\n    defaultValueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"defaultValueAddress\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"defaultValueAge\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"defaultValueAnnotation\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"defaultValueAttachment\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"defaultValueBase64Binary\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueBase64Binary\",\n        title=\"Extension field for ``defaultValueBase64Binary``.\",\n    )\n\n    defaultValueBoolean: bool | None = Field(\n        default=None,\n        alias=\"defaultValueBoolean\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueBoolean\",\n        title=\"Extension field for ``defaultValueBoolean``.\",\n    )\n\n    defaultValueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"defaultValueCanonical\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueCanonical\",\n        title=\"Extension field for ``defaultValueCanonical``.\",\n    )\n\n    defaultValueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"defaultValueCode\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueCode\",\n        title=\"Extension field for ``defaultValueCode``.\",\n    )\n\n    defaultValueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"defaultValueCodeableConcept\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"defaultValueCoding\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"defaultValueContactDetail\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"defaultValueContactPoint\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueContributor: fhirtypes.ContributorType | None = Field(\n        default=None,\n        alias=\"defaultValueContributor\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"defaultValueCount\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"defaultValueDataRequirement\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"defaultValueDate\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDate\",\n        title=\"Extension field for ``defaultValueDate``.\",\n    )\n\n    defaultValueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"defaultValueDateTime\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDateTime\",\n        title=\"Extension field for ``defaultValueDateTime``.\",\n    )\n\n    defaultValueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"defaultValueDecimal\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDecimal\",\n        title=\"Extension field for ``defaultValueDecimal``.\",\n    )\n\n    defaultValueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"defaultValueDistance\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"defaultValueDosage\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"defaultValueDuration\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"defaultValueExpression\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"defaultValueHumanName\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"defaultValueId\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueId\",\n        title=\"Extension field for ``defaultValueId``.\",\n    )\n\n    defaultValueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"defaultValueIdentifier\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"defaultValueInstant\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueInstant\",\n        title=\"Extension field for ``defaultValueInstant``.\",\n    )\n\n    defaultValueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"defaultValueInteger\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueInteger\",\n        title=\"Extension field for ``defaultValueInteger``.\",\n    )\n\n    defaultValueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"defaultValueMarkdown\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueMarkdown\",\n        title=\"Extension field for ``defaultValueMarkdown``.\",\n    )\n\n    defaultValueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"defaultValueMeta\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"defaultValueMoney\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"defaultValueOid\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueOid\",\n        title=\"Extension field for ``defaultValueOid``.\",\n    )\n\n    defaultValueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"defaultValueParameterDefinition\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"defaultValuePeriod\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"defaultValuePositiveInt\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValuePositiveInt\",\n        title=\"Extension field for ``defaultValuePositiveInt``.\",\n    )\n\n    defaultValueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"defaultValueQuantity\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"defaultValueRange\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"defaultValueRatio\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"defaultValueReference\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"defaultValueRelatedArtifact\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"defaultValueSampledData\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"defaultValueSignature\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"defaultValueString\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueString\",\n        title=\"Extension field for ``defaultValueString``.\",\n    )\n\n    defaultValueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"defaultValueTime\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueTime\",\n        title=\"Extension field for ``defaultValueTime``.\",\n    )\n\n    defaultValueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"defaultValueTiming\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"defaultValueTriggerDefinition\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"defaultValueUnsignedInt\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUnsignedInt\",\n        title=\"Extension field for ``defaultValueUnsignedInt``.\",\n    )\n\n    defaultValueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"defaultValueUri\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUri\",\n        title=\"Extension field for ``defaultValueUri``.\",\n    )\n\n    defaultValueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"defaultValueUrl\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUrl\",\n        title=\"Extension field for ``defaultValueUrl``.\",\n    )\n\n    defaultValueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"defaultValueUsageContext\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"defaultValueUuid\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUuid\",\n        title=\"Extension field for ``defaultValueUuid``.\",\n    )\n\n    element: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"element\",\n        title=\"Optional field for this source\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    element__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_element\", title=\"Extension field for ``element``.\"\n    )\n\n    listMode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"listMode\",\n        title=\"first | not_first | last | not_last | only_one\",\n        description=\"How to handle the list mode for this element.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"first\", \"not_first\", \"last\", \"not_last\", \"only_one\"],\n        },\n    )\n    listMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_listMode\", title=\"Extension field for ``listMode``.\"\n    )\n\n    logMessage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"logMessage\",\n        title=\"Message to put in log if source exists (FHIRPath)\",\n        description=(\n            \"A FHIRPath expression which specifies a message to put in the \"\n            \"transform log when content matching the source rule is found.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    logMessage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_logMessage\", title=\"Extension field for ``logMessage``.\"\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Specified maximum cardinality (number or *)\",\n        description=(\n            'Specified maximum cardinality for the element - a number or a \"*\". '\n            \"This is optional; if present, it acts an implicit check on the input \"\n            \"content (* just serves as documentation; it's the default value).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Specified minimum cardinality\",\n        description=(\n            \"Specified minimum cardinality for the element. This is optional; if \"\n            \"present, it acts an implicit check on the input content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    type: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Rule only applies if source has this type\",\n        description=(\n            \"Specified type for the element. This works as a condition on the \"\n            \"mapping - use for polymorphic elements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    variable: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"Named context for field, if a field is specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    variable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_variable\", title=\"Extension field for ``variable``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRuleSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"context\",\n            \"min\",\n            \"max\",\n            \"type\",\n            \"defaultValueBase64Binary\",\n            \"defaultValueBoolean\",\n            \"defaultValueCanonical\",\n            \"defaultValueCode\",\n            \"defaultValueDate\",\n            \"defaultValueDateTime\",\n            \"defaultValueDecimal\",\n            \"defaultValueId\",\n            \"defaultValueInstant\",\n            \"defaultValueInteger\",\n            \"defaultValueMarkdown\",\n            \"defaultValueOid\",\n            \"defaultValuePositiveInt\",\n            \"defaultValueString\",\n            \"defaultValueTime\",\n            \"defaultValueUnsignedInt\",\n            \"defaultValueUri\",\n            \"defaultValueUrl\",\n            \"defaultValueUuid\",\n            \"defaultValueAddress\",\n            \"defaultValueAge\",\n            \"defaultValueAnnotation\",\n            \"defaultValueAttachment\",\n            \"defaultValueCodeableConcept\",\n            \"defaultValueCoding\",\n            \"defaultValueContactPoint\",\n            \"defaultValueCount\",\n            \"defaultValueDistance\",\n            \"defaultValueDuration\",\n            \"defaultValueHumanName\",\n            \"defaultValueIdentifier\",\n            \"defaultValueMoney\",\n            \"defaultValuePeriod\",\n            \"defaultValueQuantity\",\n            \"defaultValueRange\",\n            \"defaultValueRatio\",\n            \"defaultValueReference\",\n            \"defaultValueSampledData\",\n            \"defaultValueSignature\",\n            \"defaultValueTiming\",\n            \"defaultValueContactDetail\",\n            \"defaultValueContributor\",\n            \"defaultValueDataRequirement\",\n            \"defaultValueExpression\",\n            \"defaultValueParameterDefinition\",\n            \"defaultValueRelatedArtifact\",\n            \"defaultValueTriggerDefinition\",\n            \"defaultValueUsageContext\",\n            \"defaultValueDosage\",\n            \"defaultValueMeta\",\n            \"element\",\n            \"listMode\",\n            \"variable\",\n            \"condition\",\n            \"check\",\n            \"logMessage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"context\",\n            \"min\",\n            \"max\",\n            \"type\",\n            \"defaultValueBase64Binary\",\n            \"defaultValueBoolean\",\n            \"defaultValueCanonical\",\n            \"defaultValueCode\",\n            \"defaultValueDate\",\n            \"defaultValueDateTime\",\n            \"defaultValueDecimal\",\n            \"defaultValueId\",\n            \"defaultValueInstant\",\n            \"defaultValueInteger\",\n            \"defaultValueMarkdown\",\n            \"defaultValueOid\",\n            \"defaultValuePositiveInt\",\n            \"defaultValueString\",\n            \"defaultValueTime\",\n            \"defaultValueUnsignedInt\",\n            \"defaultValueUri\",\n            \"defaultValueUrl\",\n            \"defaultValueUuid\",\n            \"defaultValueAddress\",\n            \"defaultValueAge\",\n            \"defaultValueAnnotation\",\n            \"defaultValueAttachment\",\n            \"defaultValueCodeableConcept\",\n            \"defaultValueCoding\",\n            \"defaultValueContactPoint\",\n            \"defaultValueCount\",\n            \"defaultValueDistance\",\n            \"defaultValueDuration\",\n            \"defaultValueHumanName\",\n            \"defaultValueIdentifier\",\n            \"defaultValueMoney\",\n            \"defaultValuePeriod\",\n            \"defaultValueQuantity\",\n            \"defaultValueRange\",\n            \"defaultValueRatio\",\n            \"defaultValueReference\",\n            \"defaultValueSampledData\",\n            \"defaultValueSignature\",\n            \"defaultValueTiming\",\n            \"defaultValueContactDetail\",\n            \"defaultValueContributor\",\n            \"defaultValueDataRequirement\",\n            \"defaultValueExpression\",\n            \"defaultValueParameterDefinition\",\n            \"defaultValueRelatedArtifact\",\n            \"defaultValueTriggerDefinition\",\n            \"defaultValueUsageContext\",\n            \"defaultValueDosage\",\n            \"defaultValueMeta\",\n            \"element\",\n            \"listMode\",\n            \"variable\",\n            \"condition\",\n            \"check\",\n            \"logMessage\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"context\", \"context__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"defaultValue\": [\n                \"defaultValueAddress\",\n                \"defaultValueAge\",\n                \"defaultValueAnnotation\",\n                \"defaultValueAttachment\",\n                \"defaultValueBase64Binary\",\n                \"defaultValueBoolean\",\n                \"defaultValueCanonical\",\n                \"defaultValueCode\",\n                \"defaultValueCodeableConcept\",\n                \"defaultValueCoding\",\n                \"defaultValueContactDetail\",\n                \"defaultValueContactPoint\",\n                \"defaultValueContributor\",\n                \"defaultValueCount\",\n                \"defaultValueDataRequirement\",\n                \"defaultValueDate\",\n                \"defaultValueDateTime\",\n                \"defaultValueDecimal\",\n                \"defaultValueDistance\",\n                \"defaultValueDosage\",\n                \"defaultValueDuration\",\n                \"defaultValueExpression\",\n                \"defaultValueHumanName\",\n                \"defaultValueId\",\n                \"defaultValueIdentifier\",\n                \"defaultValueInstant\",\n                \"defaultValueInteger\",\n                \"defaultValueMarkdown\",\n                \"defaultValueMeta\",\n                \"defaultValueMoney\",\n                \"defaultValueOid\",\n                \"defaultValueParameterDefinition\",\n                \"defaultValuePeriod\",\n                \"defaultValuePositiveInt\",\n                \"defaultValueQuantity\",\n                \"defaultValueRange\",\n                \"defaultValueRatio\",\n                \"defaultValueReference\",\n                \"defaultValueRelatedArtifact\",\n                \"defaultValueSampledData\",\n                \"defaultValueSignature\",\n                \"defaultValueString\",\n                \"defaultValueTime\",\n                \"defaultValueTiming\",\n                \"defaultValueTriggerDefinition\",\n                \"defaultValueUnsignedInt\",\n                \"defaultValueUri\",\n                \"defaultValueUrl\",\n                \"defaultValueUsageContext\",\n                \"defaultValueUuid\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass StructureMapGroupRuleTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Content to create because of this mapping rule.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRuleTarget\"\n\n    context: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Type or variable this rule applies to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    context__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_context\", title=\"Extension field for ``context``.\"\n    )\n\n    contextType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contextType\",\n        title=\"type | variable\",\n        description=\"How to interpret the context.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"type\", \"variable\"],\n        },\n    )\n    contextType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contextType\", title=\"Extension field for ``contextType``.\"\n    )\n\n    element: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"element\",\n        title=\"Field to create in the context\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    element__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_element\", title=\"Extension field for ``element``.\"\n    )\n\n    listMode: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"listMode\",\n        title=\"first | share | last | collate\",\n        description=\"If field is a list, how to manage the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"first\", \"share\", \"last\", \"collate\"],\n        },\n    )\n    listMode__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_listMode\", title=\"Extension field for ``listMode``.\"\n    )\n\n    listRuleId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"listRuleId\",\n        title=\"Internal rule reference for shared list items\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    listRuleId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_listRuleId\", title=\"Extension field for ``listRuleId``.\"\n    )\n\n    parameter: typing.List[\n        fhirtypes.StructureMapGroupRuleTargetParameterType\n    ] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Parameters to the transform\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    transform: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"transform\",\n        title=\"create | copy +\",\n        description=\"How the data is copied / created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"create\", \"copy\", \"+\"],\n        },\n    )\n    transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_transform\", title=\"Extension field for ``transform``.\"\n    )\n\n    variable: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"Named context for field, if desired, and a field is specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    variable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_variable\", title=\"Extension field for ``variable``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRuleTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"context\",\n            \"contextType\",\n            \"element\",\n            \"variable\",\n            \"listMode\",\n            \"listRuleId\",\n            \"transform\",\n            \"parameter\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"context\",\n            \"contextType\",\n            \"element\",\n            \"variable\",\n            \"listMode\",\n            \"listRuleId\",\n            \"transform\",\n            \"parameter\",\n        ]\n\n\nclass StructureMapGroupRuleTargetParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Parameters to the transform.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRuleTargetParameter\"\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRuleTargetParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueId\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueDecimal\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleTargetParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"valueId\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueDecimal\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueDecimal\",\n                \"valueId\",\n                \"valueInteger\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass StructureMapStructure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Structure Definition used by this map.\n    A structure definition used by this map. The structure definition may\n    describe instances that are converted, or the instances that are produced.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapStructure\"\n\n    alias: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=\"Name for type in this map\",\n        description=\"The name used for this type in the map.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    alias__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Documentation on use of structure\",\n        description=\"Documentation that describes how the structure is used in the mapping.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"source | queried | target | produced\",\n        description=\"How the referenced structure is used in this mapping.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"source\", \"queried\", \"target\", \"produced\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    url: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Canonical reference to structure definition\",\n        description=\"The canonical reference to the structure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"mode\",\n            \"alias\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"url\", \"mode\", \"alias\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\"), (\"url\", \"url__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/subscription.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Subscription\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Subscription(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Server push subscription criteria.\n    The subscription resource is used to define a push-based subscription from\n    a server to another system. Once a subscription is registered with the\n    server, the server checks every resource that is created or updated, and if\n    the resource matches the given criteria, it sends a message on the defined\n    \"channel\" so that another system can take an appropriate action.\n    \"\"\"\n\n    __resource_type__ = \"Subscription\"\n\n    channel: fhirtypes.SubscriptionChannelType = Field(\n        default=...,\n        alias=\"channel\",\n        title=\"The channel on which to report matches to the criteria\",\n        description=(\n            \"Details where to send notifications when resources are received that \"\n            \"meet the criteria.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for source (e.g. troubleshooting)\",\n        description=(\n            \"Contact details for a human to contact about the subscription. The \"\n            \"primary use of this for system administrator troubleshooting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    criteria: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"criteria\",\n        title=\"Rule for server push\",\n        description=(\n            \"The rules that the server should use to determine when to generate \"\n            \"notifications for this subscription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    criteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_criteria\", title=\"Extension field for ``criteria``.\"\n    )\n\n    end: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"When to automatically delete the subscription\",\n        description=\"The time for the server to turn the subscription off.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    error: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"error\",\n        title=\"Latest error note\",\n        description=(\n            \"A record of the last error that occurred when the server processed a \"\n            \"notification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    error__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_error\", title=\"Extension field for ``error``.\"\n    )\n\n    reason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Description of why this subscription was created\",\n        description=\"A description of why this subscription is defined.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    reason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reason\", title=\"Extension field for ``reason``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"requested | active | error | off\",\n        description=(\n            \"The status of the subscription, which marks the server state for \"\n            \"managing the subscription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"requested\", \"active\", \"error\", \"off\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Subscription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"status\",\n            \"contact\",\n            \"end\",\n            \"reason\",\n            \"criteria\",\n            \"error\",\n            \"channel\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Subscription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"contact\",\n            \"end\",\n            \"reason\",\n            \"criteria\",\n            \"error\",\n            \"channel\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"criteria\", \"criteria__ext\"),\n            (\"reason\", \"reason__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass SubscriptionChannel(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The channel on which to report matches to the criteria.\n    Details where to send notifications when resources are received that meet\n    the criteria.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionChannel\"\n\n    endpoint: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Where the channel points to\",\n        description=\"The url that describes the actual end-point to send messages to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_endpoint\", title=\"Extension field for ``endpoint``.\"\n    )\n\n    header: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"header\",\n        title=\"Usage depends on the channel type\",\n        description=\"Additional headers / information to send as part of the notification.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    header__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_header\", title=\"Extension field for ``header``.\"\n    )\n\n    payload: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"payload\",\n        title=\"MIME type to send, or omit for no payload\",\n        description=(\n            \"The mime type to send the payload in - either application/fhir+xml, or\"\n            \" application/fhir+json. If the payload is not present, then there is \"\n            \"no payload in the notification, just a notification. The mime type \"\n            '\"text/plain\" may also be used for Email and SMS subscriptions.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    payload__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_payload\", title=\"Extension field for ``payload``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"rest-hook | websocket | email | sms | message\",\n        description=\"The type of channel to send notifications on.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"rest-hook\", \"websocket\", \"email\", \"sms\", \"message\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionChannel`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"endpoint\",\n            \"payload\",\n            \"header\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionChannel`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"endpoint\", \"payload\", \"header\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/subscriptionstatus.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubscriptionStatus\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SubscriptionStatus(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Status information about a Subscription provided during event notification.\n    The SubscriptionStatus resource describes the state of a Subscription\n    during notifications.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionStatus\"\n\n    error: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"error\",\n        title=\"List of errors on the subscription\",\n        description=(\n            \"A record of errors that occurred when the server processed a \"\n            \"notification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    eventsSinceSubscriptionStart: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"eventsSinceSubscriptionStart\",\n        title=\"Events since the Subscription was created\",\n        description=(\n            \"The total number of actual events which have been generated since the \"\n            \"Subscription was created (inclusive of this notification) - regardless\"\n            \" of how many have been successfully communicated.  This number is NOT \"\n            \"incremented for handshake and heartbeat notifications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    eventsSinceSubscriptionStart__ext: fhirtypes.FHIRPrimitiveExtensionType | None = (\n        Field(\n            default=None,\n            alias=\"_eventsSinceSubscriptionStart\",\n            title=\"Extension field for ``eventsSinceSubscriptionStart``.\",\n        )\n    )\n\n    notificationEvent: typing.List[\n        fhirtypes.SubscriptionStatusNotificationEventType\n    ] | None = Field(\n        default=None,\n        alias=\"notificationEvent\",\n        title=\"Detailed information about any events relevant to this notification\",\n        description=(\n            \"Detailed information about events relevant to this subscription \"\n            \"notification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"requested | active | error | off | entered-in-error\",\n        description=(\n            \"The status of the subscription, which marks the server state for \"\n            \"managing the subscription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"requested\", \"active\", \"error\", \"off\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subscription: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subscription\",\n        title=\"Reference to the Subscription responsible for this notification\",\n        description=\"The reference to the Subscription which generated this notification.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Subscription\"],\n        },\n    )\n\n    topic: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"Reference to the SubscriptionTopic this notification relates to\",\n        description=(\n            \"The reference to the SubscriptionTopic for the Subscription which \"\n            \"generated this notification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubscriptionTopic\"],\n        },\n    )\n    topic__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_topic\", title=\"Extension field for ``topic``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"handshake | heartbeat | event-notification | query-status | query-\" \"event\"\n        ),\n        description=\"The type of event being conveyed with this notificaiton.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"handshake\",\n                \"heartbeat\",\n                \"event-notification\",\n                \"query-status\",\n                \"query-event\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionStatus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"status\",\n            \"type\",\n            \"eventsSinceSubscriptionStart\",\n            \"notificationEvent\",\n            \"subscription\",\n            \"topic\",\n            \"error\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionStatus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"type\",\n            \"eventsSinceSubscriptionStart\",\n            \"subscription\",\n            \"topic\",\n            \"error\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass SubscriptionStatusNotificationEvent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Detailed information about any events relevant to this notification.\n    Detailed information about events relevant to this subscription\n    notification.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionStatusNotificationEvent\"\n\n    additionalContext: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"additionalContext\",\n        title=\"Additional context for this event\",\n        description=(\n            \"Additional context information for this event. Generally, this will \"\n            \"contain references to additional resources included with the event \"\n            \"(e.g., the Patient relevant to an Encounter), however it MAY refer to \"\n            \"non-FHIR objects.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    eventNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"eventNumber\",\n        title=\"Event number\",\n        description=(\n            \"The sequential number of this event in this subscription context. Note\"\n            \" that this value is a 64-bit integer value, encoded as a string.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    eventNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_eventNumber\", title=\"Extension field for ``eventNumber``.\"\n    )\n\n    focus: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"The focus of this event\",\n        description=(\n            \"The focus of this event. While this will usually be a reference to the\"\n            \" focus resource of the event, it MAY contain a reference to a non-FHIR\"\n            \" object.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    timestamp: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"timestamp\",\n        title=\"The instant this event occurred\",\n        description=\"The actual time this event occured on the server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timestamp\", title=\"Extension field for ``timestamp``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionStatusNotificationEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"eventNumber\",\n            \"timestamp\",\n            \"focus\",\n            \"additionalContext\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionStatusNotificationEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"eventNumber\", \"eventNumber__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/subscriptiontopic.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubscriptionTopic\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SubscriptionTopic(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The definition of a specific topic for triggering events within the\n    Subscriptions framework.\n    Describes a stream of resource state changes or events and annotated with\n    labels useful to filter projections from this topic.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionTopic\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When SubscriptionTopic is/was approved by publisher\",\n        description=(\n            \"The date on which the asset content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    canFilterBy: typing.List[fhirtypes.SubscriptionTopicCanFilterByType] | None = Field(\n        default=None,\n        alias=\"canFilterBy\",\n        title=(\n            \"Properties by which a Subscription can filter notifications from the \"\n            \"SubscriptionTopic\"\n        ),\n        description=(\n            \"List of properties by which Subscriptions on the SubscriptionTopic can\"\n            \" be filtered. May be defined Search Parameters (e.g., \"\n            \"Encounter.patient) or parameters defined within this SubscriptionTopic\"\n            \" context (e.g., hub.event).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the SubscriptionTopic and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the SubscriptionTopic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date status first applied\",\n        description=(\n            \"For draft definitions, indicates the date of initial creation.  For \"\n            \"active definitions, represents the date of activation.  For withdrawn \"\n            \"definitions, indicates the date of withdrawal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFrom: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Based on FHIR protocol or definition\",\n        description=(\n            \"The canonical URL pointing to another FHIR-defined SubscriptionTopic \"\n            \"that is adhered to in whole or in part by this SubscriptionTopic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubscriptionTopic\"],\n        },\n    )\n    derivedFrom__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_derivedFrom\", title=\"Extension field for ``derivedFrom``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the SubscriptionTopic\",\n        description=(\n            \"A free text natural language description of the Topic from the \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"The effective date range for the SubscriptionTopic\",\n        description=(\n            \"The period during which the SubscriptionTopic content was or is \"\n            \"planned to be effective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    eventTrigger: typing.List[\n        fhirtypes.SubscriptionTopicEventTriggerType\n    ] | None = Field(\n        default=None,\n        alias=\"eventTrigger\",\n        title=\"Event definitions the SubscriptionTopic\",\n        description=\"Event definition which can be used to trigger the SubscriptionTopic.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"If for testing purposes, not real usage\",\n        description=(\n            \"A flag to indicate that this TopSubscriptionTopicic is authored for \"\n            \"testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for this subscription topic\",\n        description=(\n            \"Business identifiers assigned to this subscription topic by the \"\n            \"performer and/or other systems.  These identifiers remain constant as \"\n            \"the resource is updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction of the SubscriptionTopic (if applicable)\",\n        description=\"A jurisdiction in which the Topic is intended to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"Date the Subscription Topic was last reviewed by the publisher\",\n        description=(\n            \"The date on which the asset content was last reviewed. Review happens \"\n            \"periodically after that, but doesn't change the original approval \"\n            \"date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    notificationShape: typing.List[\n        fhirtypes.SubscriptionTopicNotificationShapeType\n    ] | None = Field(\n        default=None,\n        alias=\"notificationShape\",\n        title=(\n            \"Properties for describing the shape of notifications generated by this\"\n            \" topic\"\n        ),\n        description=(\n            \"List of properties to describe the shape (e.g., resources) included in\"\n            \" notifications from this Subscription Topic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=(\n            \"The name of the individual or organization that published the \"\n            \"SubscriptionTopic\"\n        ),\n        description=(\n            'Helps establish the \"authority/credibility\" of the SubscriptionTopic.'\n            \"  May also allow for contact.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this SubscriptionTopic is defined\",\n        description=(\n            \"Explains why this Topic is needed and why it has been designed as it \"\n            \"has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    resourceTrigger: typing.List[\n        fhirtypes.SubscriptionTopicResourceTriggerType\n    ] | None = Field(\n        default=None,\n        alias=\"resourceTrigger\",\n        title=\"Definition of a resource-based trigger for the subscription topic\",\n        description=(\n            \"A definition of a resource-based event that triggers a notification \"\n            \"based on the SubscriptionTopic. The criteria may be just a human \"\n            \"readable description and/or a full FHIR search string or FHIRPath \"\n            \"expression. Multiple triggers are considered OR joined (e.g., a \"\n            \"resource update matching ANY of the definitions will trigger a \"\n            \"notification).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The current state of the SubscriptionTopic.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this subscription topic (Human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the SubscriptionTopic, \"\n            'for example, \"admission\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this subscription topic definition, \"\n            \"represented as a URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this subscription topic when \"\n            \"it is referenced in a specification, model, design or an instance; \"\n            \"also called its canonical identifier. This SHOULD be globally unique \"\n            \"and SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this subscription topic is (or will be) published. This \"\n            \"URL can be the target of a canonical reference. It SHALL remain the \"\n            \"same when the subscription topic is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Content intends to support these contexts\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching of code system definitions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the subscription topic\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"subscription topic when it is referenced in a specification, model, \"\n            \"design or instance. This is an arbitrary value managed by the Topic \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions are orderable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionTopic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"title\",\n            \"derivedFrom\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"resourceTrigger\",\n            \"eventTrigger\",\n            \"canFilterBy\",\n            \"notificationShape\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionTopic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"title\",\n            \"derivedFrom\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"resourceTrigger\",\n            \"eventTrigger\",\n            \"canFilterBy\",\n            \"notificationShape\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\"), (\"url\", \"url__ext\")]\n        return required_fields\n\n\nclass SubscriptionTopicCanFilterBy(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Properties by which a Subscription can filter notifications from the\n    SubscriptionTopic.\n    List of properties by which Subscriptions on the SubscriptionTopic can be\n    filtered. May be defined Search Parameters (e.g., Encounter.patient) or\n    parameters defined within this SubscriptionTopic context (e.g., hub.event).\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionTopicCanFilterBy\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of this filter parameter\",\n        description=\"Description of how this filtering parameter is intended to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    filterDefinition: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"filterDefinition\",\n        title=\"Canonical URL for a filterParameter definition\",\n        description=(\n            \"Either the canonical URL to a search parameter (like \"\n            '\"http://hl7.org/fhir/SearchParameter/encounter-patient\") or the '\n            \"officially-defined URI for a shared filter concept (like \"\n            '\"http://example.org/concepts/shared-common-event\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    filterDefinition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_filterDefinition\",\n        title=\"Extension field for ``filterDefinition``.\",\n    )\n\n    filterParameter: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"filterParameter\",\n        title=(\n            \"Human-readable and computation-friendly name for a filter parameter \"\n            \"usable by subscriptions on this topic, via \"\n            \"Subscription.filterBy.filterParameter\"\n        ),\n        description=(\n            \"Either the canonical URL to a search parameter (like \"\n            '\"http://hl7.org/fhir/SearchParameter/encounter-patient\") or topic-'\n            'defined parameter (like \"hub.event\") which is a label for the filter.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    filterParameter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_filterParameter\",\n        title=\"Extension field for ``filterParameter``.\",\n    )\n\n    modifier: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=(\n            \"= | eq | ne | gt | lt | ge | le | sa | eb | ap | above | below | in | \"\n            \"not-in | of-type\"\n        ),\n        description=(\n            \"Allowable operators to apply when determining matches (Search \"\n            \"Modifiers).  If the filterParameter is a SearchParameter, this list of\"\n            \" modifiers SHALL be a strict subset of the modifiers defined on that \"\n            \"SearchParameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"=\",\n                \"eq\",\n                \"ne\",\n                \"gt\",\n                \"lt\",\n                \"ge\",\n                \"le\",\n                \"sa\",\n                \"eb\",\n                \"ap\",\n                \"above\",\n                \"below\",\n                \"in\",\n                \"not-in\",\n                \"of-type\",\n            ],\n        },\n    )\n    modifier__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_modifier\", title=\"Extension field for ``modifier``.\"\n    )\n\n    resource: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"URL of the triggering Resource that this filter applies to\",\n        description=(\n            \"URL of the Resource that is the type used in this filter. This is the \"\n            '\"focus\" of the topic (or one of them if there are more than one). It '\n            \"will be the same, a generality, or a specificity of \"\n            \"SubscriptionTopic.resourceTrigger.resource or \"\n            \"SubscriptionTopic.eventTrigger.resource when they are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionTopicCanFilterBy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"resource\",\n            \"filterParameter\",\n            \"filterDefinition\",\n            \"modifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionTopicCanFilterBy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"description\",\n            \"resource\",\n            \"filterParameter\",\n            \"filterDefinition\",\n            \"modifier\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"filterParameter\", \"filterParameter__ext\")]\n        return required_fields\n\n\nclass SubscriptionTopicEventTrigger(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Event definitions the SubscriptionTopic.\n    Event definition which can be used to trigger the SubscriptionTopic.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionTopicEventTrigger\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Text representation of the event trigger\",\n        description=(\n            \"The human readable description of an event to trigger a notification \"\n            'for the SubscriptionTopic - for example, \"Patient Admission, as '\n            'defined in HL7v2 via message ADT^A01\". Multiple values are considered '\n            \"OR joined (e.g., matching any single event listed).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    event: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"event\",\n        title=\"Event which can trigger a notification from the SubscriptionTopic\",\n        description=(\n            \"A well-defined event which can be used to trigger notifications from \"\n            \"the SubscriptionTopic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=(\n            \"Data Type or Resource (reference to definition) for this trigger \"\n            \"definition\"\n        ),\n        description=(\n            \"URL of the Resource that is the focus type used in this event trigger.\"\n            \"  Relative URLs are relative to the StructureDefinition root of the \"\n            \"implemented FHIR version (e.g., \"\n            'http://hl7.org/fhir/StructureDefinition). For example, \"Patient\" maps '\n            \"to http://hl7.org/fhir/StructureDefinition/Patient.  For more \"\n            'information, see <a href=\"elementdefinition-definitions.html#ElementDe'\n            'finition.type.code\">ElementDefinition.type.code</a>.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionTopicEventTrigger`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"event\",\n            \"resource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionTopicEventTrigger`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"description\", \"event\", \"resource\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"resource\", \"resource__ext\")]\n        return required_fields\n\n\nclass SubscriptionTopicNotificationShape(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Properties for describing the shape of notifications generated by this\n    topic.\n    List of properties to describe the shape (e.g., resources) included in\n    notifications from this Subscription Topic.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionTopicNotificationShape\"\n\n    include: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"include\",\n        title=\"Include directives, rooted in the resource for this shape\",\n        description=(\n            \"Search-style _include directives, rooted in the resource for this \"\n            \"shape. Servers SHOULD include resources listed here, if they exist and\"\n            \" the user is authorized to receive them.  Clients SHOULD be prepared \"\n            \"to receive these additional resources, but SHALL function properly \"\n            \"without them.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    include__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_include\", title=\"Extension field for ``include``.\"\n    )\n\n    resource: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=(\n            \"URL of the Resource that is the focus (main) resource in a \"\n            \"notification shape\"\n        ),\n        description=(\n            \"URL of the Resource that is the type used in this shape. This is the \"\n            '\"focus\" of the topic (or one of them if there are more than one) and '\n            \"the root resource for this shape definition. It will be the same, a \"\n            \"generality, or a specificity of \"\n            \"SubscriptionTopic.resourceTrigger.resource or \"\n            \"SubscriptionTopic.eventTrigger.resource when they are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    revInclude: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"revInclude\",\n        title=\"Reverse include directives, rooted in the resource for this shape\",\n        description=(\n            \"Search-style _revinclude directives, rooted in the resource for this \"\n            \"shape. Servers SHOULD include resources listed here, if they exist and\"\n            \" the user is authorized to receive them.  Clients SHOULD be prepared \"\n            \"to receive these additional resources, but SHALL function properly \"\n            \"without them.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    revInclude__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_revInclude\", title=\"Extension field for ``revInclude``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionTopicNotificationShape`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"resource\",\n            \"include\",\n            \"revInclude\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionTopicNotificationShape`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"resource\", \"include\", \"revInclude\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"resource\", \"resource__ext\")]\n        return required_fields\n\n\nclass SubscriptionTopicResourceTrigger(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a resource-based trigger for the subscription topic.\n    A definition of a resource-based event that triggers a notification based\n    on the SubscriptionTopic. The criteria may be just a human readable\n    description and/or a full FHIR search string or FHIRPath expression.\n    Multiple triggers are considered OR joined (e.g., a resource update\n    matching ANY of the definitions will trigger a notification).\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionTopicResourceTrigger\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Text representation of the resource trigger\",\n        description=(\n            \"The human readable description of this resource trigger for the \"\n            \"SubscriptionTopic -  for example, \\\"An Encounter enters the 'in-\"\n            \"progress' state\\\".\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    fhirPathCriteria: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"fhirPathCriteria\",\n        title=\"FHIRPath based trigger rule\",\n        description=(\n            \"The FHIRPath based rules that the server should use to determine when \"\n            \"to trigger a notification for this topic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fhirPathCriteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fhirPathCriteria\",\n        title=\"Extension field for ``fhirPathCriteria``.\",\n    )\n\n    queryCriteria: fhirtypes.SubscriptionTopicResourceTriggerQueryCriteriaType | None = Field(\n        default=None,\n        alias=\"queryCriteria\",\n        title=\"Query based trigger rule\",\n        description=(\n            \"The FHIR query based rules that the server should use to determine \"\n            \"when to trigger a notification for this subscription topic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=(\n            \"Data Type or Resource (reference to definition) for this trigger \"\n            \"definition\"\n        ),\n        description=(\n            \"URL of the Resource that is the type used in this resource trigger.  \"\n            \"Relative URLs are relative to the StructureDefinition root of the \"\n            \"implemented FHIR version (e.g., \"\n            'http://hl7.org/fhir/StructureDefinition). For example, \"Patient\" maps '\n            \"to http://hl7.org/fhir/StructureDefinition/Patient.  For more \"\n            'information, see <a href=\"elementdefinition-definitions.html#ElementDe'\n            'finition.type.code\">ElementDefinition.type.code</a>.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    supportedInteraction: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"supportedInteraction\",\n        title=\"create | update | delete\",\n        description=(\n            \"The FHIR RESTful interaction which can be used to trigger a \"\n            \"notification for the SubscriptionTopic. Multiple values are considered\"\n            \" OR joined (e.g., CREATE or UPDATE).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"create\", \"update\", \"delete\"],\n        },\n    )\n    supportedInteraction__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_supportedInteraction\",\n        title=\"Extension field for ``supportedInteraction``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionTopicResourceTrigger`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"resource\",\n            \"supportedInteraction\",\n            \"queryCriteria\",\n            \"fhirPathCriteria\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionTopicResourceTrigger`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"description\",\n            \"resource\",\n            \"supportedInteraction\",\n            \"queryCriteria\",\n            \"fhirPathCriteria\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"resource\", \"resource__ext\")]\n        return required_fields\n\n\nclass SubscriptionTopicResourceTriggerQueryCriteria(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Query based trigger rule.\n    The FHIR query based rules that the server should use to determine when to\n    trigger a notification for this subscription topic.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionTopicResourceTriggerQueryCriteria\"\n\n    current: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"current\",\n        title=\"Rule applied to current resource state\",\n        description=(\n            \"The FHIR query based rules are applied to the current resource state \"\n            \"(e.g., state after an update).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    current__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_current\", title=\"Extension field for ``current``.\"\n    )\n\n    previous: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"previous\",\n        title=\"Rule applied to previous resource state\",\n        description=(\n            \"The FHIR query based rules are applied to the previous resource state \"\n            \"(e.g., state before an update).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    previous__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_previous\", title=\"Extension field for ``previous``.\"\n    )\n\n    requireBoth: bool | None = Field(\n        default=None,\n        alias=\"requireBoth\",\n        title=\"Both must be true flag\",\n        description=(\n            \"If set to true, both current and previous criteria must evaluate true \"\n            \"to  trigger a notification for this topic.  Otherwise a notification \"\n            \"for this topic will be triggered if either one evaluates to true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    requireBoth__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requireBoth\", title=\"Extension field for ``requireBoth``.\"\n    )\n\n    resultForCreate: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"resultForCreate\",\n        title=\"test-passes | test-fails\",\n        description=(\n            'For \"create\" interactions, should the \"previous\" criteria count as an '\n            \"automatic pass or an automatic fail.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"test-passes\", \"test-fails\"],\n        },\n    )\n    resultForCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_resultForCreate\",\n        title=\"Extension field for ``resultForCreate``.\",\n    )\n\n    resultForDelete: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"resultForDelete\",\n        title=\"test-passes | test-fails\",\n        description=(\n            'For \"delete\" interactions, should the \"current\" criteria count as an '\n            \"automatic pass or an automatic fail.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"test-passes\", \"test-fails\"],\n        },\n    )\n    resultForDelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_resultForDelete\",\n        title=\"Extension field for ``resultForDelete``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionTopicResourceTriggerQueryCriteria`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"previous\",\n            \"resultForCreate\",\n            \"current\",\n            \"resultForDelete\",\n            \"requireBoth\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionTopicResourceTriggerQueryCriteria`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"previous\",\n            \"resultForCreate\",\n            \"current\",\n            \"resultForDelete\",\n            \"requireBoth\",\n        ]\n"
  },
  {
    "path": "fhir/resources/R4B/substance.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Substance\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Substance(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A homogeneous material with a definite composition.\n    \"\"\"\n\n    __resource_type__ = \"Substance\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"What class/type of substance this is\",\n        description=(\n            \"A code that classifies the general type of substance.  This is used  \"\n            \"for searching, sorting and display purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"What substance this is\",\n        description=\"A code (or set of codes) that identify this substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of the substance, comments\",\n        description=(\n            \"A description of the substance - its appearance, handling \"\n            \"requirements, and other usage notes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=\"Unique identifier for the substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.SubstanceIngredientType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=\"Composition information about the substance\",\n        description=\"A substance can be composed of other substances.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instance: typing.List[fhirtypes.SubstanceInstanceType] | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"If this describes a specific package/container of the substance\",\n        description=(\n            \"Substance may be used to describe a kind of substance, or a specific \"\n            \"package/container of the substance: an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=\"A code to indicate if the substance is actively used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Substance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"description\",\n            \"instance\",\n            \"ingredient\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Substance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"description\",\n            \"instance\",\n            \"ingredient\",\n        ]\n\n\nclass SubstanceIngredient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Composition information about the substance.\n    A substance can be composed of other substances.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceIngredient\"\n\n    quantity: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Optional amount (concentration)\",\n        description=\"The amount of the ingredient in the substance - a concentration ratio.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    substanceCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"substanceCodeableConcept\",\n        title=\"A component of the substance\",\n        description=\"Another substance that is a component of this substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e substance[x]\n            \"one_of_many\": \"substance\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    substanceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"substanceReference\",\n        title=\"A component of the substance\",\n        description=\"Another substance that is a component of this substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e substance[x]\n            \"one_of_many\": \"substance\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"quantity\",\n            \"substanceCodeableConcept\",\n            \"substanceReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"quantity\",\n            \"substanceCodeableConcept\",\n            \"substanceReference\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"substance\": [\"substanceCodeableConcept\", \"substanceReference\"]\n        }\n        return one_of_many_fields\n\n\nclass SubstanceInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If this describes a specific package/container of the substance.\n    Substance may be used to describe a kind of substance, or a specific\n    package/container of the substance: an instance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceInstance\"\n\n    expiry: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expiry\",\n        title=\"When no longer valid to use\",\n        description=(\n            \"When the substance is no longer valid to use. For some substances, a \"\n            \"single arbitrary date is used for expiry.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    expiry__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expiry\", title=\"Extension field for ``expiry``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier of the package/container\",\n        description=(\n            \"Identifier associated with the package/container (usually a label \"\n            \"affixed directly).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount of substance in the package\",\n        description=\"The amount of the substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"expiry\",\n            \"quantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"expiry\", \"quantity\"]\n"
  },
  {
    "path": "fhir/resources/R4B/substancedefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstanceDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SubstanceDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The detailed description of a substance, typically at a level beyond what\n    is used for prescribing.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinition\"\n\n    classification: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=(\n            \"A categorization, high level e.g. polymer or nucleic acid, or food, \"\n            \"chemical, biological, or lower e.g. polymer linear or branch chain, or\"\n            \" type of impurity\"\n        ),\n        description=(\n            \"A high level categorization, e.g. polymer or nucleic acid, or food, \"\n            \"chemical, biological, or a lower level such as the general types of \"\n            \"polymer (linear or branch chain) or type of impurity (process related \"\n            \"or contaminant).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: typing.List[fhirtypes.SubstanceDefinitionCodeType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Codes associated with the substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of the substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    domain: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"domain\",\n        title=\"If the substance applies to human or veterinary use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    grade: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"grade\",\n        title=(\n            \"The quality standard, established benchmark, to which substance \"\n            \"complies (e.g. USP/NF, BP)\"\n        ),\n        description=(\n            \"The quality standard, established benchmark, to which substance \"\n            \"complies (e.g. USP/NF, Ph. Eur, JP, BP, Company Standard).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier by which this substance is known\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    informationSource: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"informationSource\",\n        title=\"Supporting literature\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Citation\"],\n        },\n    )\n\n    manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"The entity that creates, makes, produces or fabricates the substance\",\n        description=(\n            \"The entity that creates, makes, produces or fabricates the substance. \"\n            \"This is a set of potential manufacturers but is not necessarily \"\n            \"comprehensive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    moiety: typing.List[fhirtypes.SubstanceDefinitionMoietyType] | None = Field(\n        default=None,\n        alias=\"moiety\",\n        title=\"Moiety, for structural modifications\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    molecularWeight: typing.List[\n        fhirtypes.SubstanceDefinitionMolecularWeightType\n    ] | None = Field(\n        default=None,\n        alias=\"molecularWeight\",\n        title=\"The molecular weight or weight range\",\n        description=(\n            \"The molecular weight or weight range (for proteins, polymers or \"\n            \"nucleic acids).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: typing.List[fhirtypes.SubstanceDefinitionNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Names applicable to this substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Textual comment about the substance's catalogue or registry record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    property: typing.List[fhirtypes.SubstanceDefinitionPropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"General specifications for this substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relationship: typing.List[\n        fhirtypes.SubstanceDefinitionRelationshipType\n    ] | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"A link between this substance and another\",\n        description=(\n            \"A link between this substance and another, with details of the \"\n            \"relationship.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sourceMaterial: fhirtypes.SubstanceDefinitionSourceMaterialType | None = Field(\n        default=None,\n        alias=\"sourceMaterial\",\n        title=\"Material or taxonomic/anatomical source\",\n        description=\"Material or taxonomic/anatomical source for the substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"Status of substance within the catalogue e.g. active, retired\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    structure: fhirtypes.SubstanceDefinitionStructureType | None = Field(\n        default=None,\n        alias=\"structure\",\n        title=\"Structural information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    supplier: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supplier\",\n        title=(\n            \"An entity that is the source for the substance. It may be different \"\n            \"from the manufacturer\"\n        ),\n        description=(\n            \"An entity that is the source for the substance. It may be different \"\n            \"from the manufacturer. Supplier is synonymous to a distributor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"A business level version identifier of the substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"version\",\n            \"status\",\n            \"classification\",\n            \"domain\",\n            \"grade\",\n            \"description\",\n            \"informationSource\",\n            \"note\",\n            \"manufacturer\",\n            \"supplier\",\n            \"moiety\",\n            \"property\",\n            \"molecularWeight\",\n            \"structure\",\n            \"code\",\n            \"name\",\n            \"relationship\",\n            \"sourceMaterial\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"version\",\n            \"status\",\n            \"classification\",\n            \"domain\",\n            \"grade\",\n            \"description\",\n            \"informationSource\",\n            \"note\",\n            \"manufacturer\",\n            \"supplier\",\n            \"moiety\",\n            \"property\",\n            \"molecularWeight\",\n            \"structure\",\n            \"code\",\n            \"name\",\n            \"relationship\",\n            \"sourceMaterial\",\n        ]\n\n\nclass SubstanceDefinitionCode(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Codes associated with the substance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionCode\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"The specific code\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Any comment can be provided in this field\",\n        description=\"Any comment can be provided in this field, if necessary.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Supporting literature\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"Status of the code assignment, for example 'provisional', 'approved'\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    statusDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"The date at which the code status was changed\",\n        description=(\n            \"The date at which the code status was changed as part of the \"\n            \"terminology maintenance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionCode`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"status\",\n            \"statusDate\",\n            \"note\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionCode`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"status\", \"statusDate\", \"note\", \"source\"]\n\n\nclass SubstanceDefinitionMoiety(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Moiety, for structural modifications.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionMoiety\"\n\n    amountQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amountQuantity\",\n        title=\"Quantitative value for this moiety\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    amountString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"amountString\",\n        title=\"Quantitative value for this moiety\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n    amountString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_amountString\",\n        title=\"Extension field for ``amountString``.\",\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier by which this moiety substance is known\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    measurementType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"measurementType\",\n        title=\"The measurement type of the quantitative value\",\n        description=(\n            \"The measurement type of the quantitative value. In capturing the \"\n            \"actual relative amounts of substances or molecular fragments it may be\"\n            \" necessary to indicate whether the amount refers to, for example, a \"\n            \"mole ratio or weight ratio.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    molecularFormula: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"molecularFormula\",\n        title=\"Molecular formula for this moiety (e.g. with the Hill system)\",\n        description=(\n            \"Molecular formula for this moiety of this substance, typically using \"\n            \"the Hill system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    molecularFormula__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_molecularFormula\",\n        title=\"Extension field for ``molecularFormula``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Textual name for this moiety substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    opticalActivity: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"opticalActivity\",\n        title=\"Optical activity type\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Role that the moiety is playing\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    stereochemistry: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"stereochemistry\",\n        title=\"Stereochemistry type\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionMoiety`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"role\",\n            \"identifier\",\n            \"name\",\n            \"stereochemistry\",\n            \"opticalActivity\",\n            \"molecularFormula\",\n            \"amountQuantity\",\n            \"amountString\",\n            \"measurementType\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionMoiety`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"role\",\n            \"identifier\",\n            \"name\",\n            \"stereochemistry\",\n            \"opticalActivity\",\n            \"molecularFormula\",\n            \"amountQuantity\",\n            \"amountString\",\n            \"measurementType\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"amount\": [\"amountQuantity\", \"amountString\"]}\n        return one_of_many_fields\n\n\nclass SubstanceDefinitionMolecularWeight(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The molecular weight or weight range.\n    The molecular weight or weight range (for proteins, polymers or nucleic\n    acids).\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionMolecularWeight\"\n\n    amount: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Used to capture quantitative values for a variety of elements\",\n        description=(\n            \"Used to capture quantitative values for a variety of elements. If only\"\n            \" limits are given, the arithmetic mean would be the average. If only a\"\n            \" single definite value for a given element is given, it would be \"\n            \"captured in this field.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"The method by which the weight was determined\",\n        description=\"The method by which the molecular weight was determined.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of molecular weight e.g. exact, average, weight average\",\n        description=(\n            \"Type of molecular weight such as exact, average (also known as. number\"\n            \" average), weight average.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionMolecularWeight`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"method\", \"type\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionMolecularWeight`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"method\", \"type\", \"amount\"]\n\n\nclass SubstanceDefinitionName(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Names applicable to this substance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionName\"\n\n    domain: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"domain\",\n        title=(\n            \"The use context of this name e.g. as an active ingredient or as a food\"\n            \" colour additive\"\n        ),\n        description=(\n            \"The use context of this name for example if there is a different name \"\n            \"a drug active ingredient as opposed to a food colour additive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"The jurisdiction where this name applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    language: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language that the name is written in\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The actual name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    official: typing.List[fhirtypes.SubstanceDefinitionNameOfficialType] | None = Field(\n        default=None,\n        alias=\"official\",\n        title=\"Details of the official nature of this name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    preferred: bool | None = Field(\n        default=None,\n        alias=\"preferred\",\n        title=\"If this is the preferred name for this substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preferred\", title=\"Extension field for ``preferred``.\"\n    )\n\n    source: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Supporting literature\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"The status of the name e.g. 'current', 'proposed'\",\n        description=\"The status of the name, for example 'current', 'proposed'.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    synonym: typing.List[fhirtypes.SubstanceDefinitionNameType] | None = Field(\n        default=None,\n        alias=\"synonym\",\n        title=(\n            \"A synonym of this particular name, by which the substance is also \" \"known\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    translation: typing.List[fhirtypes.SubstanceDefinitionNameType] | None = Field(\n        default=None,\n        alias=\"translation\",\n        title=\"A translation for this name into another human language\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Name type e.g. 'systematic',  'scientific, 'brand'\",\n        description=\"Name type, for example 'systematic',  'scientific, 'brand'.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"type\",\n            \"status\",\n            \"preferred\",\n            \"language\",\n            \"domain\",\n            \"jurisdiction\",\n            \"synonym\",\n            \"translation\",\n            \"official\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"name\",\n            \"type\",\n            \"status\",\n            \"preferred\",\n            \"language\",\n            \"domain\",\n            \"jurisdiction\",\n            \"synonym\",\n            \"translation\",\n            \"official\",\n            \"source\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass SubstanceDefinitionNameOfficial(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of the official nature of this name.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionNameOfficial\"\n\n    authority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Which authority uses this official name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date of official name change\",\n        description=\"Date of the official name change.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"The status of the official name, for example 'draft', 'active'\",\n        description=(\n            \"The status of the official name, for example 'draft', 'active', \"\n            \"'retired'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionNameOfficial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"authority\", \"status\", \"date\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionNameOfficial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"authority\", \"status\", \"date\"]\n\n\nclass SubstanceDefinitionProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    General specifications for this substance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionProperty\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"A code expressing the type of property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"A value for the property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"A value for the property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"A value for the property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"A value for the property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"A value for the property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDate\",\n                \"valueQuantity\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass SubstanceDefinitionRelationship(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A link between this substance and another.\n    A link between this substance and another, with details of the\n    relationship.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionRelationship\"\n\n    amountQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amountQuantity\",\n        title=(\n            \"A numeric factor for the relationship, e.g. that a substance salt has \"\n            \"some percentage of active substance in relation to some other\"\n        ),\n        description=(\n            \"A numeric factor for the relationship, for instance to express that \"\n            \"the salt of a substance has some percentage of the active substance in\"\n            \" relation to some other.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    amountRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"amountRatio\",\n        title=(\n            \"A numeric factor for the relationship, e.g. that a substance salt has \"\n            \"some percentage of active substance in relation to some other\"\n        ),\n        description=(\n            \"A numeric factor for the relationship, for instance to express that \"\n            \"the salt of a substance has some percentage of the active substance in\"\n            \" relation to some other.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    amountString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"amountString\",\n        title=(\n            \"A numeric factor for the relationship, e.g. that a substance salt has \"\n            \"some percentage of active substance in relation to some other\"\n        ),\n        description=(\n            \"A numeric factor for the relationship, for instance to express that \"\n            \"the salt of a substance has some percentage of the active substance in\"\n            \" relation to some other.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n    amountString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_amountString\",\n        title=\"Extension field for ``amountString``.\",\n    )\n\n    comparator: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"comparator\",\n        title=(\n            'An operator for the amount, for example \"average\", \"approximately\", '\n            '\"less than\"'\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    isDefining: bool | None = Field(\n        default=None,\n        alias=\"isDefining\",\n        title=(\n            \"For example where an enzyme strongly bonds with a particular \"\n            \"substance, this is a defining relationship for that enzyme, out of \"\n            \"several possible relationships\"\n        ),\n        description=(\n            \"For example where an enzyme strongly bonds with a particular \"\n            \"substance, this is a defining relationship for that enzyme, out of \"\n            \"several possible substance relationships.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isDefining__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isDefining\", title=\"Extension field for ``isDefining``.\"\n    )\n\n    ratioHighLimitAmount: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"ratioHighLimitAmount\",\n        title=\"For use when the numeric has an uncertain range\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Supporting literature\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    substanceDefinitionCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"substanceDefinitionCodeableConcept\",\n        title=(\n            \"A pointer to another substance, as a resource or a representational \"\n            \"code\"\n        ),\n        description=(\n            \"A pointer to another substance, as a resource or just a \"\n            \"representational code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e substanceDefinition[x]\n            \"one_of_many\": \"substanceDefinition\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    substanceDefinitionReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"substanceDefinitionReference\",\n        title=(\n            \"A pointer to another substance, as a resource or a representational \"\n            \"code\"\n        ),\n        description=(\n            \"A pointer to another substance, as a resource or just a \"\n            \"representational code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e substanceDefinition[x]\n            \"one_of_many\": \"substanceDefinition\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceDefinition\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title='For example \"salt to parent\", \"active moiety\"',\n        description=(\n            'For example \"salt to parent\", \"active moiety\", \"starting material\", '\n            '\"polymorph\", \"impurity of\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionRelationship`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"substanceDefinitionReference\",\n            \"substanceDefinitionCodeableConcept\",\n            \"type\",\n            \"isDefining\",\n            \"amountQuantity\",\n            \"amountRatio\",\n            \"amountString\",\n            \"ratioHighLimitAmount\",\n            \"comparator\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionRelationship`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"substanceDefinitionReference\",\n            \"substanceDefinitionCodeableConcept\",\n            \"type\",\n            \"isDefining\",\n            \"amountQuantity\",\n            \"amountRatio\",\n            \"amountString\",\n            \"ratioHighLimitAmount\",\n            \"comparator\",\n            \"source\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"amount\": [\"amountQuantity\", \"amountRatio\", \"amountString\"],\n            \"substanceDefinition\": [\n                \"substanceDefinitionCodeableConcept\",\n                \"substanceDefinitionReference\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass SubstanceDefinitionSourceMaterial(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Material or taxonomic/anatomical source.\n    Material or taxonomic/anatomical source for the substance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionSourceMaterial\"\n\n    countryOfOrigin: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"countryOfOrigin\",\n        title=\"The country or countries where the material is harvested\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    genus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"genus\",\n        title=(\n            \"The genus of an organism e.g. the Latin epithet of the plant/animal \"\n            \"scientific name\"\n        ),\n        description=(\n            \"The genus of an organism, typically referring to the Latin epithet of \"\n            \"the genus element of the plant/animal scientific name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    part: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"An anatomical origin of the source material within an organism\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    species: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"species\",\n        title=(\n            \"The species of an organism e.g. the Latin epithet of the species of \"\n            \"the plant/animal\"\n        ),\n        description=(\n            \"The species of an organism, typically referring to the Latin epithet \"\n            \"of the species of the plant/animal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Classification of the origin of the raw material. e.g. cat hair is an \"\n            \"Animal source type\"\n        ),\n        description=(\n            \"A classification that provides the origin of the raw material. \"\n            \"Example: cat hair would be an Animal source type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionSourceMaterial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"genus\",\n            \"species\",\n            \"part\",\n            \"countryOfOrigin\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionSourceMaterial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"genus\",\n            \"species\",\n            \"part\",\n            \"countryOfOrigin\",\n        ]\n\n\nclass SubstanceDefinitionStructure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Structural information.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionStructure\"\n\n    molecularFormula: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"molecularFormula\",\n        title=\"Molecular formula (e.g. using the Hill system)\",\n        description=\"Molecular formula of this substance, typically using the Hill system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    molecularFormula__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_molecularFormula\",\n        title=\"Extension field for ``molecularFormula``.\",\n    )\n\n    molecularFormulaByMoiety: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"molecularFormulaByMoiety\",\n        title=\"Specified per moiety according to the Hill system\",\n        description=(\n            \"Specified per moiety according to the Hill system, i.e. first C, then \"\n            \"H, then alphabetical, each moiety separated by a dot.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    molecularFormulaByMoiety__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_molecularFormulaByMoiety\",\n        title=\"Extension field for ``molecularFormulaByMoiety``.\",\n    )\n\n    molecularWeight: fhirtypes.SubstanceDefinitionMolecularWeightType | None = Field(\n        default=None,\n        alias=\"molecularWeight\",\n        title=\"The molecular weight or weight range\",\n        description=(\n            \"The molecular weight or weight range (for proteins, polymers or \"\n            \"nucleic acids).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    opticalActivity: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"opticalActivity\",\n        title=\"Optical activity type\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    representation: typing.List[\n        fhirtypes.SubstanceDefinitionStructureRepresentationType\n    ] | None = Field(\n        default=None,\n        alias=\"representation\",\n        title=\"A depiction of the structure or characterization of the substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sourceDocument: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"sourceDocument\",\n        title=\"Source of information for the structure\",\n        description=\"The source of information about the structure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    stereochemistry: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"stereochemistry\",\n        title=\"Stereochemistry type\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    technique: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"technique\",\n        title=\"The method used to find the structure e.g. X-ray, NMR\",\n        description=(\n            \"The method used to elucidate the structure or characterization of the \"\n            \"drug substance. Examples: X-ray, HPLC, NMR, Peptide mapping, Ligand \"\n            \"binding assay.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"stereochemistry\",\n            \"opticalActivity\",\n            \"molecularFormula\",\n            \"molecularFormulaByMoiety\",\n            \"molecularWeight\",\n            \"technique\",\n            \"sourceDocument\",\n            \"representation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"stereochemistry\",\n            \"opticalActivity\",\n            \"molecularFormula\",\n            \"molecularFormulaByMoiety\",\n            \"molecularWeight\",\n            \"technique\",\n            \"sourceDocument\",\n            \"representation\",\n        ]\n\n\nclass SubstanceDefinitionStructureRepresentation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A depiction of the structure or characterization of the substance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionStructureRepresentation\"\n\n    document: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"document\",\n        title=(\n            \"An attachment with the structural representation e.g. a structure \"\n            \"graphic or AnIML file\"\n        ),\n        description=(\n            \"An attached file with the structural representation or \"\n            \"characterization e.g. a molecular structure graphic of the substance, \"\n            \"a JCAMP or AnIML file.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    format: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"format\",\n        title=(\n            \"The format of the representation e.g. InChI, SMILES, MOLFILE (note: \"\n            \"not the physical file format)\"\n        ),\n        description=(\n            \"The format of the representation e.g. InChI, SMILES, MOLFILE, CDX, \"\n            \"SDF, PDB, mmCIF. The logical content type rather than the physical \"\n            \"file format of a document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    representation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"representation\",\n        title=(\n            \"The structural representation or characterization as a text string in \"\n            \"a standard format\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    representation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_representation\",\n        title=\"Extension field for ``representation``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of structural representation (e.g. full, partial)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionStructureRepresentation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"representation\",\n            \"format\",\n            \"document\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionStructureRepresentation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"representation\", \"format\", \"document\"]\n"
  },
  {
    "path": "fhir/resources/R4B/supplydelivery.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SupplyDelivery\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SupplyDelivery(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Delivery of bulk Supplies.\n    Record of delivery of what is supplied.\n    \"\"\"\n\n    __resource_type__ = \"SupplyDelivery\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan, proposal or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SupplyRequest\"],\n        },\n    )\n\n    destination: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Where the Supply was sent\",\n        description=(\n            \"Identification of the facility/location where the Supply was shipped \"\n            \"to, as part of the dispense event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifier for the supply delivery event that is used to identify it \"\n            \"across multiple disparate systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When event occurred\",\n        description=\"The date or time(s) the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When event occurred\",\n        description=\"The date or time(s) the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When event occurred\",\n        description=\"The date or time(s) the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=\"A larger event of which this particular event is a component or step.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SupplyDelivery\", \"Contract\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"Patient for whom the item is supplied\",\n        description=(\n            \"A link to a resource representing the person whom the delivered item \"\n            \"is for.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    receiver: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"receiver\",\n        title=\"Who collected the Supply\",\n        description=\"Identifies the person who picked up the Supply.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"in-progress | completed | abandoned | entered-in-error\",\n        description=\"A code specifying the state of the dispense event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"in-progress\",\n                \"completed\",\n                \"abandoned\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    suppliedItem: fhirtypes.SupplyDeliverySuppliedItemType | None = Field(\n        default=None,\n        alias=\"suppliedItem\",\n        title=\"The item that is delivered or supplied\",\n        description=\"The item that is being delivered or has been supplied.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supplier: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"supplier\",\n        title=\"Dispenser\",\n        description=(\n            \"The individual responsible for dispensing the medication, supplier or \"\n            \"device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Category of dispense event\",\n        description=(\n            \"Indicates the type of dispensing event that is performed. Examples \"\n            \"include: Trial Fill, Completion of Trial, Partial Fill, Emergency \"\n            \"Fill, Samples, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyDelivery`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"patient\",\n            \"type\",\n            \"suppliedItem\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"supplier\",\n            \"destination\",\n            \"receiver\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyDelivery`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\", \"occurrenceTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass SupplyDeliverySuppliedItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The item that is delivered or supplied.\n    The item that is being delivered or has been supplied.\n    \"\"\"\n\n    __resource_type__ = \"SupplyDeliverySuppliedItem\"\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"Medication, Substance, or Device supplied\",\n        description=(\n            \"Identifies the medication, substance or device being dispensed. This \"\n            \"is either a link to a resource representing the details of the item or\"\n            \" a code that identifies the item from a known list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"Medication, Substance, or Device supplied\",\n        description=(\n            \"Identifies the medication, substance or device being dispensed. This \"\n            \"is either a link to a resource representing the details of the item or\"\n            \" a code that identifies the item from a known list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\", \"Substance\", \"Device\"],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount dispensed\",\n        description=(\n            \"The amount of supply that has been dispensed. Includes unit of \" \"measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyDeliverySuppliedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"quantity\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyDeliverySuppliedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/supplyrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SupplyRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SupplyRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Request for a medication, substance or device.\n    A record of a request for a medication, substance or device used in the\n    healthcare setting.\n    \"\"\"\n\n    __resource_type__ = \"SupplyRequest\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When the request was made\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"The kind of supply (central, non-stock, etc.)\",\n        description=(\n            \"Category of supply, e.g.  central, non-stock, etc. This is used to \"\n            \"support work flows associated with the supply process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    deliverFrom: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"deliverFrom\",\n        title=\"The origin of the supply\",\n        description=\"Where the supply is expected to come from.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"Location\"],\n        },\n    )\n\n    deliverTo: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"deliverTo\",\n        title=\"The destination of the supply\",\n        description=\"Where the supply is destined to go.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"Location\", \"Patient\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for SupplyRequest\",\n        description=(\n            \"Business identifiers assigned to this SupplyRequest by the author \"\n            \"and/or other systems. These identifiers remain constant as the \"\n            \"resource is updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"Medication, Substance, or Device requested to be supplied\",\n        description=(\n            \"The item that is requested to be supplied. This is either a link to a \"\n            \"resource representing the details of the item or a code that \"\n            \"identifies the item from a known list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"Medication, Substance, or Device requested to be supplied\",\n        description=(\n            \"The item that is requested to be supplied. This is either a link to a \"\n            \"resource representing the details of the item or a code that \"\n            \"identifies the item from a known list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\", \"Substance\", \"Device\"],\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When the request should be fulfilled\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When the request should be fulfilled\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When the request should be fulfilled\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    parameter: typing.List[fhirtypes.SupplyRequestParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Ordered item details\",\n        description=(\n            \"Specific parameters for the ordered item.  For example, the size of \"\n            \"the indicated item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly this SupplyRequest should be addressed with \"\n            \"respect to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    quantity: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"quantity\",\n        title=\"The requested amount of the item indicated\",\n        description=\"The amount that is being ordered of the indicated item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"The reason why the supply item was requested\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"The reason why the supply item was requested\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Individual making the request\",\n        description=\"The device, practitioner, etc. who initiated the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | suspended +\",\n        description=\"Status of the supply request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"suspended\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    supplier: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supplier\",\n        title=\"Who is intended to fulfill the request\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"HealthcareService\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"priority\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n            \"quantity\",\n            \"parameter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"authoredOn\",\n            \"requester\",\n            \"supplier\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"deliverFrom\",\n            \"deliverTo\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"priority\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n            \"quantity\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"authoredOn\",\n            \"requester\",\n            \"supplier\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"item\": [\"itemCodeableConcept\", \"itemReference\"],\n            \"occurrence\": [\n                \"occurrenceDateTime\",\n                \"occurrencePeriod\",\n                \"occurrenceTiming\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass SupplyRequestParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Ordered item details.\n    Specific parameters for the ordered item.  For example, the size of the\n    indicated item.\n    \"\"\"\n\n    __resource_type__ = \"SupplyRequestParameter\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Item detail\",\n        description=\"A code or string that identifies the device detail being asserted.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyRequestParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueBoolean\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyRequestParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/task.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Task\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Task(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A task to be performed.\n    \"\"\"\n\n    __resource_type__ = \"Task\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"Task Creation Date\",\n        description=\"The date and time this task was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this task\",\n        description=(\n            \"BasedOn refers to a higher-level authorization that triggered the \"\n            'creation of the task.  It references a \"request\" resource such as a '\n            \"ServiceRequest, MedicationRequest, ServiceRequest, CarePlan, etc. \"\n            'which is distinct from the \"request\" resource the task is seeking to '\n            \"fulfill.  This latter resource is referenced by FocusOn.  For example,\"\n            \" based on a ServiceRequest (= BasedOn), a task is created to fulfill a\"\n            \" procedureRequest ( = FocusOn ) to collect a specimen from a patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    businessStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"businessStatus\",\n        title='E.g. \"Specimen collected\", \"IV prepped\"',\n        description=\"Contains business-specific nuances of the business state.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Task Type\",\n        description=\"A name or code (or both) briefly describing what the task involves.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-readable explanation of task\",\n        description=\"A free-text description of what is to be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Healthcare event during which this task originated\",\n        description=(\n            \"The healthcare event  (e.g. a patient and healthcare provider \"\n            \"interaction) during which this task was created.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    executionPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"executionPeriod\",\n        title=\"Start and end time of execution\",\n        description=(\n            \"Identifies the time action was first taken against the task (start) \"\n            \"and/or the time final action was taken against the task prior to \"\n            \"marking it as completed (end).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    focus: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"What task is acting on\",\n        description=(\n            \"The request being actioned or the resource being manipulated by this \"\n            \"task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    for_fhir: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"for\",\n        title=\"Beneficiary of the Task\",\n        description=(\n            \"The entity who benefits from the performance of the service specified \"\n            \"in the task (e.g., the patient).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Requisition or grouper id\",\n        description=(\n            \"An identifier that links together multiple tasks and other requests \"\n            \"that were created in the same context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Task Instance Identifier\",\n        description=\"The business identifier for this task.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    input: typing.List[fhirtypes.TaskInputType] | None = Field(\n        default=None,\n        alias=\"input\",\n        title=\"Information used to perform task\",\n        description=(\n            \"Additional information that may be needed in the execution of the \" \"task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Formal definition of task\",\n        description=(\n            \"The URL pointing to a *FHIR*-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this Task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\"],\n        },\n    )\n    instantiatesCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Formal definition of task\",\n        description=(\n            \"The URL pointing to an *externally* maintained  protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this Task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    insurance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Associated insurance coverage\",\n        description=(\n            \"Insurance plans, coverage extensions, pre-authorizations and/or pre-\"\n            \"determinations that may be relevant to the Task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\", \"ClaimResponse\"],\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"unknown | proposal | plan | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            'Indicates the \"level\" of actionability associated with the Task, i.e. '\n            \"i+R[9]Cs this a proposed task, a planned task, an actionable task, \"\n            \"etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"unknown\",\n                \"proposal\",\n                \"plan\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    lastModified: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"lastModified\",\n        title=\"Task Last Modified Date\",\n        description=\"The date and time of last modification to this task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastModified\",\n        title=\"Extension field for ``lastModified``.\",\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where task occurs\",\n        description=\"Principal physical location where the this task is performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the task\",\n        description=\"Free-text information captured about the task as it progresses.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    output: typing.List[fhirtypes.TaskOutputType] | None = Field(\n        default=None,\n        alias=\"output\",\n        title=\"Information produced as part of task\",\n        description=\"Outputs produced by the Task.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    owner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"owner\",\n        title=\"Responsible individual\",\n        description=(\n            \"Individual organization or Device currently responsible for task \"\n            \"execution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"HealthcareService\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Composite task\",\n        description=\"Task that this particular task is part of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Task\"],\n        },\n    )\n\n    performerType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=\"Requested performer\",\n        description=\"The kind of participant that should perform the task.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the Task should be addressed with respect to \"\n            \"other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why task is needed\",\n        description=\"A description or code indicating why this task needs to be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why task is needed\",\n        description=\"A resource reference indicating why this task needs to be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Key events in history of the Task\",\n        description=(\n            \"Links to Provenance records for past versions of this Task that \"\n            \"identify key state transitions or updates that are likely to be \"\n            \"relevant to a user looking at the current version of the task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who is asking for task to be done\",\n        description=\"The creator of the task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    restriction: fhirtypes.TaskRestrictionType | None = Field(\n        default=None,\n        alias=\"restriction\",\n        title=\"Constraints on fulfillment tasks\",\n        description=(\n            \"If the Task.focus is a request resource and the task is seeking \"\n            \"fulfillment (i.e. is asking for the request to be actioned), this \"\n            \"element identifies any limitations on what parts of the referenced \"\n            \"request should be actioned.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | requested | received | accepted | +\",\n        description=\"The current status of the task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"requested\", \"received\", \"accepted\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"An explanation as to why this task is held, failed, was refused, etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Task`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"businessStatus\",\n            \"intent\",\n            \"priority\",\n            \"code\",\n            \"description\",\n            \"focus\",\n            \"for\",\n            \"encounter\",\n            \"executionPeriod\",\n            \"authoredOn\",\n            \"lastModified\",\n            \"requester\",\n            \"performerType\",\n            \"owner\",\n            \"location\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"insurance\",\n            \"note\",\n            \"relevantHistory\",\n            \"restriction\",\n            \"input\",\n            \"output\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Task`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"businessStatus\",\n            \"intent\",\n            \"code\",\n            \"description\",\n            \"focus\",\n            \"for\",\n            \"encounter\",\n            \"executionPeriod\",\n            \"lastModified\",\n            \"requester\",\n            \"owner\",\n            \"location\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass TaskInput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information used to perform task.\n    Additional information that may be needed in the execution of the task.\n    \"\"\"\n\n    __resource_type__ = \"TaskInput\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Label for the input\",\n        description=(\n            \"A code or description indicating how the input is intended to be used \"\n            \"as part of the task execution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueCanonical\",\n        title=\"Extension field for ``valueCanonical``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"valueContactDetail\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContributor: fhirtypes.ContributorType | None = Field(\n        default=None,\n        alias=\"valueContributor\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"valueDataRequirement\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"valueDosage\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"valueExpression\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"valueParameterDefinition\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"valueRelatedArtifact\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"valueTriggerDefinition\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUrl\", title=\"Extension field for ``valueUrl``.\"\n    )\n\n    valueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"valueUsageContext\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"valueUuid\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUuid\", title=\"Extension field for ``valueUuid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TaskInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueContributor\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueDosage\",\n            \"valueMeta\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TaskInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCanonical\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCoding\",\n                \"valueContactDetail\",\n                \"valueContactPoint\",\n                \"valueContributor\",\n                \"valueCount\",\n                \"valueDataRequirement\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDosage\",\n                \"valueDuration\",\n                \"valueExpression\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valueParameterDefinition\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueReference\",\n                \"valueRelatedArtifact\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueTriggerDefinition\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n                \"valueUrl\",\n                \"valueUsageContext\",\n                \"valueUuid\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass TaskOutput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information produced as part of task.\n    Outputs produced by the Task.\n    \"\"\"\n\n    __resource_type__ = \"TaskOutput\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Label for output\",\n        description=\"The name of the Output parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueCanonical\",\n        title=\"Extension field for ``valueCanonical``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"valueContactDetail\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContributor: fhirtypes.ContributorType | None = Field(\n        default=None,\n        alias=\"valueContributor\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"valueDataRequirement\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"valueDosage\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"valueExpression\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"valueParameterDefinition\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"valueRelatedArtifact\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"valueTriggerDefinition\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUrl\", title=\"Extension field for ``valueUrl``.\"\n    )\n\n    valueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"valueUsageContext\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"valueUuid\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUuid\", title=\"Extension field for ``valueUuid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TaskOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueContributor\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueDosage\",\n            \"valueMeta\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TaskOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCanonical\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCoding\",\n                \"valueContactDetail\",\n                \"valueContactPoint\",\n                \"valueContributor\",\n                \"valueCount\",\n                \"valueDataRequirement\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDosage\",\n                \"valueDuration\",\n                \"valueExpression\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valueParameterDefinition\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueReference\",\n                \"valueRelatedArtifact\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueTriggerDefinition\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n                \"valueUrl\",\n                \"valueUsageContext\",\n                \"valueUuid\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass TaskRestriction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Constraints on fulfillment tasks.\n    If the Task.focus is a request resource and the task is seeking fulfillment\n    (i.e. is asking for the request to be actioned), this element identifies\n    any limitations on what parts of the referenced request should be actioned.\n    \"\"\"\n\n    __resource_type__ = \"TaskRestriction\"\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When fulfillment sought\",\n        description=\"Over what time-period is fulfillment sought.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"For whom is fulfillment sought?\",\n        description=(\n            \"For requests that are targeted to more than on potential \"\n            \"recipient/target, for whom is fulfillment sought?\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Group\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    repetitions: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"repetitions\",\n        title=\"How many times to repeat\",\n        description=\"Indicates the number of times the requested action should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    repetitions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_repetitions\", title=\"Extension field for ``repetitions``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TaskRestriction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"repetitions\",\n            \"period\",\n            \"recipient\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TaskRestriction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/terminologycapabilities.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass TerminologyCapabilities(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A statement of system capabilities.\n    A TerminologyCapabilities resource documents a set of capabilities\n    (behaviors) of a FHIR Terminology Server that may be used as a statement of\n    actual server functionality or a statement of required or desired server\n    implementation.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilities\"\n\n    closure: fhirtypes.TerminologyCapabilitiesClosureType | None = Field(\n        default=None,\n        alias=\"closure\",\n        title=(\n            \"Information about the [ConceptMap/$closure](conceptmap-operation-\"\n            \"closure.html) operation\"\n        ),\n        description=\"Whether the $closure operation is supported.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    codeSearch: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"codeSearch\",\n        title=\"explicit | all\",\n        description=(\n            \"The degree to which the server supports the code search parameter on \"\n            \"ValueSet, if it is supported.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"explicit\", \"all\"],\n        },\n    )\n    codeSearch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_codeSearch\", title=\"Extension field for ``codeSearch``.\"\n    )\n\n    codeSystem: typing.List[\n        fhirtypes.TerminologyCapabilitiesCodeSystemType\n    ] | None = Field(\n        default=None,\n        alias=\"codeSystem\",\n        title=\"A code system supported by the server\",\n        description=(\n            \"Identifies a code system that is supported by the server. If there is \"\n            \"a no code system URL, then this declares the general assumptions a \"\n            \"client can make about support for any CodeSystem resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the terminology capabilities and/or \"\n            \"its contents. Copyright statements are generally legal restrictions on\"\n            \" the use and publishing of the terminology capabilities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the terminology capabilities was \"\n            \"published. The date must change when the business version changes and \"\n            \"it must change if the status code changes. In addition, it should \"\n            \"change when the substantive content of the terminology capabilities \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the terminology capabilities\",\n        description=(\n            \"A free text natural language description of the terminology \"\n            \"capabilities from a consumer's perspective. Typically, this is used \"\n            \"when the capability statement describes a desired rather than an \"\n            \"actual solution, for example as a formal expression of requirements as\"\n            \" part of an RFP.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expansion: fhirtypes.TerminologyCapabilitiesExpansionType | None = Field(\n        default=None,\n        alias=\"expansion\",\n        title=(\n            \"Information about the [ValueSet/$expand](valueset-operation-\"\n            \"expand.html) operation\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this terminology capabilities is \"\n            \"authored for testing purposes (or education/evaluation/marketing) and \"\n            \"is not intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    implementation: fhirtypes.TerminologyCapabilitiesImplementationType | None = Field(\n        default=None,\n        alias=\"implementation\",\n        title=\"If this describes a specific instance\",\n        description=(\n            \"Identifies a specific implementation instance that is described by the\"\n            \" terminology capability statement - i.e. a particular installation, \"\n            \"rather than the capabilities of a software program.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for terminology capabilities (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the terminology capabilities is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"instance | capability | requirements\",\n        description=(\n            \"The way that this statement is intended to be used, to describe an \"\n            \"actual running instance of software, a particular product (kind, not \"\n            \"instance of software) or a class of implementation (e.g. a desired \"\n            \"purchase).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"capability\", \"requirements\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    lockedDate: bool | None = Field(\n        default=None,\n        alias=\"lockedDate\",\n        title=\"Whether lockedDate is supported\",\n        description=\"Whether the server supports lockedDate.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lockedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lockedDate\", title=\"Extension field for ``lockedDate``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this terminology capabilities (computer friendly)\",\n        description=(\n            \"A natural language name identifying the terminology capabilities. This\"\n            \" name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the \"\n            \"terminology capabilities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this terminology capabilities is defined\",\n        description=(\n            \"Explanation of why this terminology capabilities is needed and why it \"\n            \"has been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    software: fhirtypes.TerminologyCapabilitiesSoftwareType | None = Field(\n        default=None,\n        alias=\"software\",\n        title=\"Software that is covered by this terminology capability statement\",\n        description=(\n            \"Software that is covered by this terminology capability statement.  It\"\n            \" is used when the statement describes the capabilities of a particular\"\n            \" software version, independent of an installation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this terminology capabilities. Enables tracking the \"\n            \"life-cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this terminology capabilities (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the terminology \"\n            \"capabilities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    translation: fhirtypes.TerminologyCapabilitiesTranslationType | None = Field(\n        default=None,\n        alias=\"translation\",\n        title=(\n            \"Information about the [ConceptMap/$translate](conceptmap-operation-\"\n            \"translate.html) operation\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this terminology capabilities, represented as\"\n            \" a URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this terminology capabilities\"\n            \" when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which at which an \"\n            \"authoritative instance of this terminology capabilities is (or will \"\n            \"be) published. This URL can be the target of a canonical reference. It\"\n            \" SHALL remain the same when the terminology capabilities is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate terminology capabilities \"\n            \"instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    validateCode: fhirtypes.TerminologyCapabilitiesValidateCodeType | None = Field(\n        default=None,\n        alias=\"validateCode\",\n        title=(\n            \"Information about the [ValueSet/$validate-code](valueset-operation-\"\n            \"validate-code.html) operation\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the terminology capabilities\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"terminology capabilities when it is referenced in a specification, \"\n            \"model, design or instance. This is an arbitrary value managed by the \"\n            \"terminology capabilities author and is not expected to be globally \"\n            \"unique. For example, it might be a timestamp (e.g. yyyymmdd) if a \"\n            \"managed version is not available. There is also no expectation that \"\n            \"versions can be placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilities`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"kind\",\n            \"software\",\n            \"implementation\",\n            \"lockedDate\",\n            \"codeSystem\",\n            \"expansion\",\n            \"codeSearch\",\n            \"validateCode\",\n            \"translation\",\n            \"closure\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilities`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"copyright\",\n            \"kind\",\n            \"software\",\n            \"implementation\",\n            \"lockedDate\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"date\", \"date__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass TerminologyCapabilitiesClosure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the [ConceptMap/$closure](conceptmap-operation-\n    closure.html) operation.\n    Whether the $closure operation is supported.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesClosure\"\n\n    translation: bool | None = Field(\n        default=None,\n        alias=\"translation\",\n        title=\"If cross-system closure is supported\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    translation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_translation\", title=\"Extension field for ``translation``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesClosure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"translation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesClosure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TerminologyCapabilitiesCodeSystem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A code system supported by the server.\n    Identifies a code system that is supported by the server. If there is a no\n    code system URL, then this declares the general assumptions a client can\n    make about support for any CodeSystem resource.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesCodeSystem\"\n\n    subsumption: bool | None = Field(\n        default=None,\n        alias=\"subsumption\",\n        title=\"Whether subsumption is supported\",\n        description=\"True if subsumption is supported for this version of the code system.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subsumption__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subsumption\", title=\"Extension field for ``subsumption``.\"\n    )\n\n    uri: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"URI for the Code System\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CodeSystem\"],\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    version: typing.List[\n        fhirtypes.TerminologyCapabilitiesCodeSystemVersionType\n    ] | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version of Code System supported\",\n        description=(\n            \"For the code system, a list of versions that are supported by the \"\n            \"server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesCodeSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"uri\", \"version\", \"subsumption\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesCodeSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TerminologyCapabilitiesCodeSystemVersion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Version of Code System supported.\n    For the code system, a list of versions that are supported by the server.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesCodeSystemVersion\"\n\n    code: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Version identifier for this version\",\n        description=(\n            \"For version-less code systems, there should be a single version with \"\n            \"no identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    compositional: bool | None = Field(\n        default=None,\n        alias=\"compositional\",\n        title=\"If compositional grammar is supported\",\n        description=\"If the compositional grammar defined by the code system is supported.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    compositional__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compositional\",\n        title=\"Extension field for ``compositional``.\",\n    )\n\n    filter: typing.List[\n        fhirtypes.TerminologyCapabilitiesCodeSystemVersionFilterType\n    ] | None = Field(\n        default=None,\n        alias=\"filter\",\n        title=\"Filter Properties supported\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    isDefault: bool | None = Field(\n        default=None,\n        alias=\"isDefault\",\n        title=\"If this is the default version for this code system\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isDefault__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isDefault\", title=\"Extension field for ``isDefault``.\"\n    )\n\n    language: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language Displays supported\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    property: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Properties supported for $lookup\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    property__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_property\", title=\"Extension field for ``property``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesCodeSystemVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"isDefault\",\n            \"compositional\",\n            \"language\",\n            \"filter\",\n            \"property\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesCodeSystemVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"isDefault\"]\n\n\nclass TerminologyCapabilitiesCodeSystemVersionFilter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Filter Properties supported.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesCodeSystemVersionFilter\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code of the property supported\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    op: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"op\",\n        title=\"Operations supported for the property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    op__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_op\", title=\"Extension field for ``op``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesCodeSystemVersionFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"op\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesCodeSystemVersionFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"op\", \"op__ext\")]\n        return required_fields\n\n\nclass TerminologyCapabilitiesExpansion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the [ValueSet/$expand](valueset-operation-expand.html)\n    operation.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesExpansion\"\n\n    hierarchical: bool | None = Field(\n        default=None,\n        alias=\"hierarchical\",\n        title=\"Whether the server can return nested value sets\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    hierarchical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_hierarchical\",\n        title=\"Extension field for ``hierarchical``.\",\n    )\n\n    incomplete: bool | None = Field(\n        default=None,\n        alias=\"incomplete\",\n        title=\"Allow request for incomplete expansions?\",\n        description=\"Allow request for incomplete expansions?\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    incomplete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_incomplete\", title=\"Extension field for ``incomplete``.\"\n    )\n\n    paging: bool | None = Field(\n        default=None,\n        alias=\"paging\",\n        title=\"Whether the server supports paging on expansion\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    paging__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_paging\", title=\"Extension field for ``paging``.\"\n    )\n\n    parameter: typing.List[\n        fhirtypes.TerminologyCapabilitiesExpansionParameterType\n    ] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Supported expansion parameter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    textFilter: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"textFilter\",\n        title=\"Documentation about text searching works\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    textFilter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_textFilter\", title=\"Extension field for ``textFilter``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesExpansion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"hierarchical\",\n            \"paging\",\n            \"incomplete\",\n            \"parameter\",\n            \"textFilter\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesExpansion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TerminologyCapabilitiesExpansionParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supported expansion parameter.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesExpansionParameter\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Description of support for parameter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    name: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Expansion Parameter name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesExpansionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"documentation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesExpansionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass TerminologyCapabilitiesImplementation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If this describes a specific instance.\n    Identifies a specific implementation instance that is described by the\n    terminology capability statement - i.e. a particular installation, rather\n    than the capabilities of a software program.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesImplementation\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Describes this specific instance\",\n        description=(\n            \"Information about the specific installation that this terminology \"\n            \"capability statement relates to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    url: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Base URL for the implementation\",\n        description=\"An absolute base URL for the implementation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesImplementation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"description\", \"url\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesImplementation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"description\", \"url\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"description\", \"description__ext\")]\n        return required_fields\n\n\nclass TerminologyCapabilitiesSoftware(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Software that is covered by this terminology capability statement.\n    Software that is covered by this terminology capability statement.  It is\n    used when the statement describes the capabilities of a particular software\n    version, independent of an installation.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesSoftware\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name the software is known by\",\n        description=\"Name the software is known by.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version covered by this statement\",\n        description=\"The version identifier for the software covered by this statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesSoftware`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"version\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesSoftware`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"version\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass TerminologyCapabilitiesTranslation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the [ConceptMap/$translate](conceptmap-operation-\n    translate.html) operation.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesTranslation\"\n\n    needsMap: bool | None = Field(\n        default=None,\n        alias=\"needsMap\",\n        title=\"Whether the client must identify the map\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    needsMap__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_needsMap\", title=\"Extension field for ``needsMap``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesTranslation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"needsMap\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesTranslation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"needsMap\", \"needsMap__ext\")]\n        return required_fields\n\n\nclass TerminologyCapabilitiesValidateCode(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the [ValueSet/$validate-code](valueset-operation-\n    validate-code.html) operation.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesValidateCode\"\n\n    translations: bool | None = Field(\n        default=None,\n        alias=\"translations\",\n        title=\"Whether translations are validated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    translations__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_translations\",\n        title=\"Extension field for ``translations``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesValidateCode`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"translations\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesValidateCode`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"translations\", \"translations__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/testreport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TestReport\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass TestReport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes the results of a TestScript execution.\n    A summary of information based on the results of executing a TestScript.\n    \"\"\"\n\n    __resource_type__ = \"TestReport\"\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifier for the TestScript assigned for external purposes outside \"\n            \"the context of FHIR.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"When the TestScript was executed and this TestReport was generated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Informal name of the executed TestScript\",\n        description=\"A free text natural language name identifying the executed TestScript.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    participant: typing.List[fhirtypes.TestReportParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=(\n            \"A participant in the test execution, either the execution engine, a \"\n            \"client, or a server\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    result: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"pass | fail | pending\",\n        description=\"The overall result from the execution of the TestScript.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"pass\", \"fail\", \"pending\"],\n        },\n    )\n    result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_result\", title=\"Extension field for ``result``.\"\n    )\n\n    score: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"score\",\n        title=(\n            \"The final score (percentage of tests passed) resulting from the \"\n            \"execution of the TestScript\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    score__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_score\", title=\"Extension field for ``score``.\"\n    )\n\n    setup: fhirtypes.TestReportSetupType | None = Field(\n        default=None,\n        alias=\"setup\",\n        title=(\n            \"The results of the series of required setup operations before the \"\n            \"tests were executed\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"completed | in-progress | waiting | stopped | entered-in-error\",\n        description=\"The current state of this test report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"completed\",\n                \"in-progress\",\n                \"waiting\",\n                \"stopped\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    teardown: fhirtypes.TestReportTeardownType | None = Field(\n        default=None,\n        alias=\"teardown\",\n        title=\"The results of running the series of required clean up steps\",\n        description=(\n            \"The results of the series of operations required to clean up after all\"\n            \" the tests were executed (successfully or otherwise).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    test: typing.List[fhirtypes.TestReportTestType] | None = Field(\n        default=None,\n        alias=\"test\",\n        title=\"A test executed from the test script\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    testScript: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"testScript\",\n        title=(\n            \"Reference to the  version-specific TestScript that was executed to \"\n            \"produce this TestReport\"\n        ),\n        description=(\n            \"Ideally this is an absolute URL that is used to identify the version-\"\n            \"specific TestScript that was executed, matching the `TestScript.url`.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"TestScript\"],\n        },\n    )\n\n    tester: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"tester\",\n        title=\"Name of the tester producing this report (Organization or individual)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    tester__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_tester\", title=\"Extension field for ``tester``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"status\",\n            \"testScript\",\n            \"result\",\n            \"score\",\n            \"tester\",\n            \"issued\",\n            \"participant\",\n            \"setup\",\n            \"test\",\n            \"teardown\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"name\",\n            \"status\",\n            \"testScript\",\n            \"result\",\n            \"score\",\n            \"tester\",\n            \"issued\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"result\", \"result__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass TestReportParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A participant in the test execution, either the execution engine, a client,\n    or a server.\n    \"\"\"\n\n    __resource_type__ = \"TestReportParticipant\"\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"The display name of the participant\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"test-engine | client | server\",\n        description=\"The type of participant.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"test-engine\", \"client\", \"server\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"The uri of the participant. An absolute URL is preferred\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"uri\", \"display\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\"), (\"uri\", \"uri__ext\")]\n        return required_fields\n\n\nclass TestReportSetup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The results of the series of required setup operations before the tests\n    were executed.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetup\"\n\n    action: typing.List[fhirtypes.TestReportSetupActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"A setup operation or assert that was executed\",\n        description=\"Action would contain either an operation or an assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportSetupAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A setup operation or assert that was executed.\n    Action would contain either an operation or an assertion.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetupAction\"\n\n    assert_fhir: fhirtypes.TestReportSetupActionAssertType | None = Field(\n        default=None,\n        alias=\"assert\",\n        title=\"The assertion to perform\",\n        description=\"The results of the assertion performed on the previous operations.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.TestReportSetupActionOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"The operation to perform\",\n        description=\"The operation performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\", \"assert\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportSetupActionAssert(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The assertion to perform.\n    The results of the assertion performed on the previous operations.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetupActionAssert\"\n\n    detail: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"A link to further details on the result\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_detail\", title=\"Extension field for ``detail``.\"\n    )\n\n    message: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"message\",\n        title=\"A message associated with the result\",\n        description=\"An explanatory message associated with the result.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_message\", title=\"Extension field for ``message``.\"\n    )\n\n    result: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"pass | skip | fail | warning | error\",\n        description=\"The result of this assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"pass\", \"skip\", \"fail\", \"warning\", \"error\"],\n        },\n    )\n    result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_result\", title=\"Extension field for ``result``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetupActionAssert`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"result\", \"message\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetupActionAssert`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"result\", \"result__ext\")]\n        return required_fields\n\n\nclass TestReportSetupActionOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The operation to perform.\n    The operation performed.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetupActionOperation\"\n\n    detail: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"A link to further details on the result\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_detail\", title=\"Extension field for ``detail``.\"\n    )\n\n    message: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"message\",\n        title=\"A message associated with the result\",\n        description=\"An explanatory message associated with the result.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_message\", title=\"Extension field for ``message``.\"\n    )\n\n    result: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"pass | skip | fail | warning | error\",\n        description=\"The result of this operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"pass\", \"skip\", \"fail\", \"warning\", \"error\"],\n        },\n    )\n    result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_result\", title=\"Extension field for ``result``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetupActionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"result\", \"message\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetupActionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"result\", \"result__ext\")]\n        return required_fields\n\n\nclass TestReportTeardown(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The results of running the series of required clean up steps.\n    The results of the series of operations required to clean up after all the\n    tests were executed (successfully or otherwise).\n    \"\"\"\n\n    __resource_type__ = \"TestReportTeardown\"\n\n    action: typing.List[fhirtypes.TestReportTeardownActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"One or more teardown operations performed\",\n        description=\"The teardown action will only contain an operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportTeardown`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportTeardown`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportTeardownAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    One or more teardown operations performed.\n    The teardown action will only contain an operation.\n    \"\"\"\n\n    __resource_type__ = \"TestReportTeardownAction\"\n\n    operation: fhirtypes.TestReportSetupActionOperationType = Field(\n        default=...,\n        alias=\"operation\",\n        title=\"The teardown operation performed\",\n        description=\"An operation would involve a REST request to a server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportTeardownAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportTeardownAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportTest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A test executed from the test script.\n    \"\"\"\n\n    __resource_type__ = \"TestReportTest\"\n\n    action: typing.List[fhirtypes.TestReportTestActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"A test operation or assert that was performed\",\n        description=\"Action would contain either an operation or an assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Tracking/reporting short description of the test\",\n        description=(\n            \"A short description of the test used by test engines for tracking and \"\n            \"reporting purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Tracking/logging name of this test\",\n        description=(\n            \"The name of this test used for tracking/logging purposes by test \"\n            \"engines.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportTest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"description\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportTest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportTestAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A test operation or assert that was performed.\n    Action would contain either an operation or an assertion.\n    \"\"\"\n\n    __resource_type__ = \"TestReportTestAction\"\n\n    assert_fhir: fhirtypes.TestReportSetupActionAssertType | None = Field(\n        default=None,\n        alias=\"assert\",\n        title=\"The assertion performed\",\n        description=\"The results of the assertion performed on the previous operations.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.TestReportSetupActionOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"The operation performed\",\n        description=\"An operation would involve a REST request to a server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportTestAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\", \"assert\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportTestAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/tests/__init__.py",
    "content": "__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n__fhir_version__ = \"4.3.0\"\n"
  },
  {
    "path": "fhir/resources/R4B/tests/conftest.py",
    "content": "import hashlib\nimport io\nimport os\nimport pathlib\nimport shutil\nimport sys\nimport tempfile\nimport zipfile\nfrom os.path import dirname\n\nimport pytest\nfrom fhir_core.types import (\n    Base64BinaryType,\n    DateTimeType,\n    DateType,\n    InstantType,\n    TimeType,\n    UriType,\n    UrlType,\n)\nfrom pydantic import BaseModel, Field\n\nfrom tests import patch_r4b_test\n\npatch_r4b_test.apply()\n\nEXAMPLE_RESOURCES_URL = (\n    \"https://github.com/nazrulworld/hl7-archives/raw/\"\n    \"0.4.0/FHIR/R4B/\"\n    \"4.3.0-examples-json.zip\"\n)\nROOT_PATH = dirname(dirname(dirname(dirname(dirname(os.path.abspath(__file__))))))\nCACHE_PATH = os.path.join(ROOT_PATH, \".cache\", \"R4B\")\n\n\ndef download_and_store(url, path):\n    \"\"\" \"\"\"\n    import requests\n\n    try:\n        sys.stdout.write(\"Attempting to download from {0}\\n\".format(url))\n        ret = requests.get(url)\n    except requests.HTTPError as exc:  # pragma: no cover\n        raise LookupError(\"Failed to download. Full error: {0!s}\".format(exc))\n    else:\n        if not ret.ok:  # pragma: no cover\n            raise Exception(\"Failed to download {0}\".format(url))\n        with io.open(path, \"wb\") as handle:\n            for chunk in ret.iter_content():\n                handle.write(chunk)\n            sys.stdout.write(\n                \"Download has been completed, now saved to {0}\\n\".format(path)\n            )\n\n\ndef expand(self, local):  # pragma: no cover\n    \"\"\"Expand the ZIP file at the given path to the cache directory.\"\"\"\n    path = os.path.join(self.cache, local)\n    assert os.path.exists(path)\n    import zipfile  # import here as we can bypass its use with a manual unzip\n\n    with zipfile.ZipFile(path) as z:\n        z.extractall(self.cache)\n\n\n@pytest.fixture(scope=\"session\")\ndef base_settings():\n    if not os.path.exists(CACHE_PATH):  # pragma: no cover\n        os.makedirs(CACHE_PATH)\n\n    settings = {}\n\n    example_data_file_uri = EXAMPLE_RESOURCES_URL\n\n    example_data_file_id = hashlib.md5(example_data_file_uri.encode()).hexdigest()\n\n    example_data_file_location = os.path.join(\n        CACHE_PATH, (example_data_file_id + \".zip\")\n    )\n\n    if not os.path.exists(example_data_file_location):\n        download_and_store(example_data_file_uri, example_data_file_location)\n\n    temp_data_dir = tempfile.mkdtemp()\n    # extract all files from archive and put into temp dir\n    with zipfile.ZipFile(example_data_file_location) as z:\n        z.extractall(temp_data_dir)\n\n    zip_dir_name = pathlib.Path(EXAMPLE_RESOURCES_URL).name[:-4]\n    if \"FHIR_UNITTEST_DATADIR\" not in os.environ:\n        os.environ.setdefault(\n            \"FHIR_UNITTEST_DATADIR\", os.path.join(temp_data_dir, zip_dir_name)\n        )\n\n    settings[\"unittest_data_dir\"] = pathlib.Path(os.environ[\"FHIR_UNITTEST_DATADIR\"])\n\n    yield settings\n\n    os.environ.pop(\"FHIR_UNITTEST_DATADIR\")\n    shutil.rmtree(temp_data_dir)\n\n\nclass ExternalValidatorModel(BaseModel):\n    \"\"\"This model is used to validate datetime objects against in the tests\"\"\"\n\n    valueDate: DateType = Field(None, title=\"Date\")\n    valueTime: TimeType = Field(None, title=\"Time\")\n    valueDateTime: DateTimeType = Field(None, title=\"DateTime\")\n    valueInstant: InstantType = Field(None, title=\"Instant\")\n    valueUri: UriType = Field(None, title=\"Uri\")\n    valueUrl: UrlType = Field(None, title=\"Url\")\n    valueBase64Binary: Base64BinaryType = Field(None, title=\"Base64Binary\")\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_account.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Account\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import account\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_account_1(inst):\n    assert inst.coverage[0].coverage.reference == \"Coverage/7546D\"\n    assert inst.coverage[0].priority == 1\n    assert inst.description == \"Hospital charges\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:0.1.2.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"654321\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"HACC Funded Billing for Peter James Chalmers\"\n    assert inst.owner.reference == \"Organization/hl7\"\n    assert (\n        inst.servicePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-30\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.servicePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"active\"\n    assert inst.subject[0].display == \"Peter James Chalmers\"\n    assert inst.subject[0].reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">HACC Funded '\n        \"Billing for Peter James Chalmers</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"PBILLACCT\"\n    assert inst.type.coding[0].display == \"patient billing account\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"patient\"\n\n\ndef test_account_1(base_settings):\n    \"\"\"No. 1 tests collection for Account.\n    Test File: account-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"account-example.json\"\n    inst = account.Account.model_validate_json(filename.read_bytes())\n    assert \"Account\" == inst.get_resource_type()\n\n    impl_account_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Account\" == data[\"resourceType\"]\n\n    inst2 = account.Account(**data)\n    impl_account_1(inst2)\n\n\ndef impl_account_2(inst):\n    assert inst.coverage[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.coverage[0].priority == 1\n    assert inst.coverage[1].coverage.reference == \"Coverage/7546D\"\n    assert inst.coverage[1].priority == 2\n    assert inst.description == \"Hospital charges\"\n    assert inst.guarantor[0].onHold is False\n    assert inst.guarantor[0].party.display == \"Bénédicte du Marché\"\n    assert inst.guarantor[0].party.reference == \"RelatedPerson/benedicte\"\n    assert (\n        inst.guarantor[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"ewg\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:0.1.2.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"654321\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Inpatient: Peter James Chalmers\"\n    assert inst.owner.display == \"Burgers University Medical Center\"\n    assert inst.owner.reference == \"Organization/f001\"\n    assert (\n        inst.servicePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-30\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.servicePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"active\"\n    assert inst.subject[0].display == \"Peter James Chalmers\"\n    assert inst.subject[0].reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Inpatient '\n        \"Admission for Peter James Chalmers Account</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"PBILLACCT\"\n    assert inst.type.coding[0].display == \"patient billing account\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"patient\"\n\n\ndef test_account_2(base_settings):\n    \"\"\"No. 2 tests collection for Account.\n    Test File: account-example-with-guarantor.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"account-example-with-guarantor.json\"\n    )\n    inst = account.Account.model_validate_json(filename.read_bytes())\n    assert \"Account\" == inst.get_resource_type()\n\n    impl_account_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Account\" == data[\"resourceType\"]\n\n    inst2 = account.Account(**data)\n    impl_account_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_activitydefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ActivityDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import activitydefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_activitydefinition_1(inst):\n    assert inst.code.coding[0].code == \"zika-virus-exposure-assessment\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/questionnaires\"}\n        ).valueUri\n    )\n    assert inst.description == \"Administer Zika Virus Exposure Assessment\"\n    assert inst.experimental is True\n    assert inst.id == \"administer-zika-virus-exposure-assessment\"\n    assert inst.kind == \"ServiceRequest\"\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/zika-virus-intervention-\" \"logic\"\n    )\n    assert inst.participant[0].type == \"practitioner\"\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://www.cdc.gov/zika/hc-providers/pregnant-woman.html\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://www.cdc.gov/zika/hc-providers/pregnant-woman.html\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].resource == (\n        \"http://hl7.org/fhir/Questionnaire/zika-virus-exposure-\" \"assessment\"\n    )\n    assert inst.relatedArtifact[1].type == \"depends-on\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/ActivityDefinition/administer-zika-virus-exposure-assessment\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"age\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueRange.low.unit == \"a\"\n    assert float(inst.useContext[0].valueRange.low.value) == float(12)\n\n\ndef test_activitydefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ActivityDefinition.\n    Test File: activitydefinition-administer-zika-virus-exposure-assessment.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-administer-zika-virus-exposure-assessment.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_1(inst2)\n\n\ndef impl_activitydefinition_2(inst):\n    assert inst.code.text == \"Provide Mosquito Prevention Advice\"\n    assert inst.description == \"Provide mosquito prevention advice\"\n    assert inst.experimental is True\n    assert inst.id == \"provide-mosquito-prevention-advice\"\n    assert inst.kind == \"CommunicationRequest\"\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/zika-virus-intervention-\" \"logic\"\n    )\n    assert inst.participant[0].type == \"practitioner\"\n    assert (\n        inst.relatedArtifact[0].display\n        == \"Advice for patients about how to avoid Mosquito bites.\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.cdc.gov/zika/prevention/index.html\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.cdc.gov/zika/prevention/index.html\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].display == (\n        \"Advice for patients about which mosquito repellents are \"\n        \"effective and safe to use in pregnancy. [DEET, IF3535 and \"\n        \"Picardin are safe during]\"\n    )\n    assert (\n        inst.relatedArtifact[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.epa.gov/insect-repellents/find-insect-repellent-right-you\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.epa.gov/insect-repellents/find-insect-repellent-right-you\"\n            }\n        ).valueUrl\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/ActivityDefinition/provide-mosquito-prevention-advice\"\n            }\n        ).valueUri\n    )\n\n\ndef test_activitydefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for ActivityDefinition.\n    Test File: activitydefinition-provide-mosquito-prevention-advice.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-provide-mosquito-prevention-advice.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_2(inst2)\n\n\ndef impl_activitydefinition_3(inst):\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-03-12\"}).valueDate\n    )\n    assert inst.author[0].name == \"Motive Medical Intelligence\"\n    assert inst.author[0].telecom[0].system == \"phone\"\n    assert inst.author[0].telecom[0].use == \"work\"\n    assert inst.author[0].telecom[0].value == \"415-362-4007\"\n    assert inst.author[0].telecom[1].system == \"email\"\n    assert inst.author[0].telecom[1].use == \"work\"\n    assert inst.author[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.code.coding[0].code == \"306206005\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Referral to service (procedure)\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"415-362-4007\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.copyright == (\n        \"© Copyright 2016 Motive Medical Intelligence. All rights \" \"reserved.\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-03T14:06:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"refer to primary care mental-health integrated care program \"\n        \"for evaluation and treatment of mental health conditions now\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"referralPrimaryCareMentalHealth-initial\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://motivemi.com/artifacts\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"referralPrimaryCareMentalHealth\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.kind == \"ServiceRequest\"\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-08-15\"}).valueDate\n    )\n    assert inst.name == \"ReferralPrimaryCareMentalHealth\"\n    assert inst.participant[0].type == \"practitioner\"\n    assert inst.publisher == \"Motive Medical Intelligence\"\n    assert inst.relatedArtifact[0].display == (\n        \"Practice Guideline for the Treatment of Patients with Major \"\n        \"Depressive Disorder\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].resource == (\n        \"http://example.org/fhir/ActivityDefinition/referralPrimaryCa\" \"reMentalHealth\"\n    )\n    assert inst.relatedArtifact[1].type == \"successor\"\n    assert inst.status == \"retired\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Referral to Primary Care Mental Health\"\n    assert inst.topic[0].text == \"Mental Health Referral\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://motivemi.com/artifacts/ActivityDefinition/referralPrimaryCareMentalHealth\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"age\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"D000328\"\n    assert inst.useContext[0].valueCodeableConcept.coding[0].display == \"Adult\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://meshb.nlm.nih.gov\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"87512008\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Mild major depression\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].code.code == \"focus\"\n    assert (\n        inst.useContext[2].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].valueCodeableConcept.coding[0].code == \"40379007\"\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].display\n        == \"Major depression, recurrent, mild\"\n    )\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].code.code == \"focus\"\n    assert (\n        inst.useContext[3].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].valueCodeableConcept.coding[0].code == \"225444004\"\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].display\n        == \"At risk for suicide (finding)\"\n    )\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].code.code == \"focus\"\n    assert (\n        inst.useContext[4].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].valueCodeableConcept.coding[0].code == \"306206005\"\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].display\n        == \"Referral to service (procedure)\"\n    )\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].code.code == \"user\"\n    assert (\n        inst.useContext[5].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].valueCodeableConcept.coding[0].code == \"309343006\"\n    assert inst.useContext[5].valueCodeableConcept.coding[0].display == \"Physician\"\n    assert (\n        inst.useContext[5].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].code.code == \"venue\"\n    assert (\n        inst.useContext[6].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].valueCodeableConcept.coding[0].code == \"440655000\"\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].display\n        == \"Outpatient environment\"\n    )\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"1.0.0\"\n\n\ndef test_activitydefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for ActivityDefinition.\n    Test File: activitydefinition-predecessor-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-predecessor-example.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_3(inst2)\n\n\ndef impl_activitydefinition_4(inst):\n    assert inst.code.text == \"Serum Zika and Dengue Virus IgM\"\n    assert inst.description == \"Order Serum Zika and Dengue Virus IgM\"\n    assert inst.experimental is True\n    assert inst.id == \"serum-zika-dengue-virus-igm\"\n    assert inst.kind == \"ServiceRequest\"\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/zika-virus-intervention-\" \"logic\"\n    )\n    assert inst.participant[0].type == \"practitioner\"\n    assert inst.relatedArtifact[0].display == (\n        \"Explanation of diagnostic tests for Zika virus and which to \"\n        \"use based on the patient’s clinical and exposure history.\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.cdc.gov/zika/hc-providers/diagnostic.html\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.cdc.gov/zika/hc-providers/diagnostic.html\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].resource == (\n        \"http://example.org/fhir/ActivityDefinition/serum-dengue-\" \"virus-igm\"\n    )\n    assert inst.relatedArtifact[1].type == \"derived-from\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/ActivityDefinition/serum-zika-dengue-virus-igm\"\n            }\n        ).valueUri\n    )\n\n\ndef test_activitydefinition_4(base_settings):\n    \"\"\"No. 4 tests collection for ActivityDefinition.\n    Test File: activitydefinition-order-serum-zika-dengue-virus-igm.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-order-serum-zika-dengue-virus-igm.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_4(inst2)\n\n\ndef impl_activitydefinition_5(inst):\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-03-12\"}).valueDate\n    )\n    assert inst.author[0].name == \"Motive Medical Intelligence\"\n    assert inst.author[0].telecom[0].system == \"phone\"\n    assert inst.author[0].telecom[0].use == \"work\"\n    assert inst.author[0].telecom[0].value == \"415-362-4007\"\n    assert inst.author[0].telecom[1].system == \"email\"\n    assert inst.author[0].telecom[1].use == \"work\"\n    assert inst.author[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"415-362-4007\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.contained[0].id == \"citalopramMedication\"\n    assert inst.contained[1].id == \"citalopramSubstance\"\n    assert inst.copyright == (\n        \"© Copyright 2016 Motive Medical Intelligence. All rights \" \"reserved.\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-15\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Citalopram 20 mg tablet 1 tablet oral 1 time daily now (30 \" \"table; 3 refills\"\n    )\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == \"{tbl}\"\n    assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(1)\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosage[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].route.coding[0].code == \"26643006\"\n    assert inst.dosage[0].route.coding[0].display == \"Oral route (qualifier value)\"\n    assert inst.dosage[0].route.text == \"Oral route (qualifier value)\"\n    assert inst.dosage[0].text == \"1 tablet oral 1 time daily\"\n    assert inst.dosage[0].timing.repeat.frequency == 1\n    assert float(inst.dosage[0].timing.repeat.period) == float(1)\n    assert inst.dosage[0].timing.repeat.periodUnit == \"d\"\n    assert (\n        inst.dynamicValue[0].expression.description\n        == \"dispenseRequest.numberOfRepeatsAllowed is three (3)\"\n    )\n    assert inst.dynamicValue[0].expression.expression == \"3\"\n    assert inst.dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.dynamicValue[0].path == \"dispenseRequest.numberOfRepeatsAllowed\"\n    assert (\n        inst.dynamicValue[1].expression.description\n        == \"dispenseRequest.quantity is thirty (30) tablets\"\n    )\n    assert inst.dynamicValue[1].expression.expression == \"30 '{tbl}'\"\n    assert inst.dynamicValue[1].expression.language == \"text/cql\"\n    assert inst.dynamicValue[1].path == \"dispenseRequest.quantity\"\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"citalopramPrescription\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://motivemi.com\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"citalopramPrescription\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.kind == \"MedicationRequest\"\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-08-15\"}).valueDate\n    )\n    assert inst.name == \"CitalopramPrescription\"\n    assert inst.productReference.reference == \"#citalopramMedication\"\n    assert inst.publisher == \"Motive Medical Intelligence\"\n    assert inst.purpose == (\n        \"Defines a guideline supported prescription for the treatment\"\n        \" of depressive disorders\"\n    )\n    assert inst.relatedArtifact[0].display == (\n        \"Practice Guideline for the Treatment of Patients with Major \"\n        \"Depressive Disorder\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].resource == \"#citalopramMedication\"\n    assert inst.relatedArtifact[1].type == \"composed-of\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Citalopram Prescription\"\n    assert inst.topic[0].text == \"Mental Health Treatment\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://motivemi.com/artifacts/ActivityDefinition/citalopramPrescription\"\n            }\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This activity definition is used as part of various suicide \" \"risk order sets\"\n    )\n    assert inst.useContext[0].code.code == \"age\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"D000328\"\n    assert inst.useContext[0].valueCodeableConcept.coding[0].display == \"Adult\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://meshb.nlm.nih.gov\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"87512008\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Mild major depression\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].code.code == \"focus\"\n    assert (\n        inst.useContext[2].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].valueCodeableConcept.coding[0].code == \"40379007\"\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].display\n        == \"Major depression, recurrent, mild\"\n    )\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].code.code == \"focus\"\n    assert (\n        inst.useContext[3].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].valueCodeableConcept.coding[0].code == \"225444004\"\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].display\n        == \"At risk for suicide (finding)\"\n    )\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].code.code == \"focus\"\n    assert (\n        inst.useContext[4].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].valueCodeableConcept.coding[0].code == \"306206005\"\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].display\n        == \"Referral to service (procedure)\"\n    )\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].code.code == \"user\"\n    assert (\n        inst.useContext[5].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].valueCodeableConcept.coding[0].code == \"309343006\"\n    assert inst.useContext[5].valueCodeableConcept.coding[0].display == \"Physician\"\n    assert (\n        inst.useContext[5].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].code.code == \"venue\"\n    assert (\n        inst.useContext[6].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].valueCodeableConcept.coding[0].code == \"440655000\"\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].display\n        == \"Outpatient environment\"\n    )\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"1.0.0\"\n\n\ndef test_activitydefinition_5(base_settings):\n    \"\"\"No. 5 tests collection for ActivityDefinition.\n    Test File: activitydefinition-medicationorder-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-medicationorder-example.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_5(inst2)\n\n\ndef impl_activitydefinition_6(inst):\n    assert inst.code.coding[0].code == \"1155608\"\n    assert inst.code.coding[0].display == \"alteplase injectable product\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.code == \"mg/kg\"\n    assert (\n        inst.dosage[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(0.9)\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].code == \"calculated\"\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].display == \"Calculated\"\n    assert (\n        inst.dosage[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].maxDosePerAdministration.code == \"mg\"\n    assert (\n        inst.dosage[0].maxDosePerAdministration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[0].maxDosePerAdministration.value) == float(90)\n    assert inst.dosage[0].route.coding[0].code == \"47625008\"\n    assert inst.dosage[0].route.coding[0].display == \"Intravenous use\"\n    assert (\n        inst.dosage[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].sequence == 1\n    assert inst.dosage[0].text == \"give 10% of dose over 1 minute\"\n    assert inst.dosage[1].doseAndRate[0].doseQuantity.code == \"mg/kg\"\n    assert (\n        inst.dosage[1].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[1].doseAndRate[0].doseQuantity.value) == float(0.9)\n    assert inst.dosage[1].doseAndRate[0].type.coding[0].code == \"calculated\"\n    assert inst.dosage[1].doseAndRate[0].type.coding[0].display == \"Calculated\"\n    assert (\n        inst.dosage[1].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosage[1].maxDosePerAdministration.code == \"mg\"\n    assert (\n        inst.dosage[1].maxDosePerAdministration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[1].maxDosePerAdministration.value) == float(90)\n    assert inst.dosage[1].route.coding[0].code == \"47625008\"\n    assert inst.dosage[1].route.coding[0].display == \"Intravenous use\"\n    assert (\n        inst.dosage[1].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[1].sequence == 2\n    assert inst.dosage[1].text == \"give remaining 90% of dose over 1 hour\"\n    assert inst.experimental is True\n    assert inst.id == \"example-alteplase-dosing\"\n    assert inst.intent == \"order\"\n    assert inst.kind == \"MedicationRequest\"\n    assert inst.name == \"Alteplase Dosing for Stroke\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/ActivityDefinition/example-alteplase-dosing\"\n            }\n        ).valueUri\n    )\n\n\ndef test_activitydefinition_6(base_settings):\n    \"\"\"No. 6 tests collection for ActivityDefinition.\n    Test File: activitydefinition-example-alteplase-dosing.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-example-alteplase-dosing.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_6(inst2)\n\n\ndef impl_activitydefinition_7(inst):\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2017-03-01\"}).valueDate\n    )\n    assert inst.author[0].name == \"Motive Medical Intelligence\"\n    assert inst.author[0].telecom[0].system == \"phone\"\n    assert inst.author[0].telecom[0].use == \"work\"\n    assert inst.author[0].telecom[0].value == \"415-362-4007\"\n    assert inst.author[0].telecom[1].system == \"email\"\n    assert inst.author[0].telecom[1].use == \"work\"\n    assert inst.author[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.code.coding[0].code == \"306206005\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Referral to service (procedure)\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"415-362-4007\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.copyright == (\n        \"© Copyright 2016 Motive Medical Intelligence. All rights \" \"reserved.\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-03T14:06:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"refer to primary care mental-health integrated care program \"\n        \"for evaluation and treatment of mental health conditions now\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-01\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"referralPrimaryCareMentalHealth\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://motivemi.com/artifacts\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"referralPrimaryCareMentalHealth\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.kind == \"ServiceRequest\"\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2017-03-01\"}).valueDate\n    )\n    assert inst.name == \"ReferralPrimaryCareMentalHealth\"\n    assert inst.participant[0].type == \"practitioner\"\n    assert inst.publisher == \"Motive Medical Intelligence\"\n    assert inst.relatedArtifact[0].display == (\n        \"Practice Guideline for the Treatment of Patients with Major \"\n        \"Depressive Disorder\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].resource == (\n        \"http://example.org/fhir/ActivityDefinition/referralPrimaryCa\"\n        \"reMentalHealth-initial\"\n    )\n    assert inst.relatedArtifact[1].type == \"predecessor\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Referral to Primary Care Mental Health\"\n    assert inst.topic[0].text == \"Mental Health Referral\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://motivemi.com/artifacts/ActivityDefinition/referralPrimaryCareMentalHealth\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"age\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"D000328\"\n    assert inst.useContext[0].valueCodeableConcept.coding[0].display == \"Adult\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://meshb.nlm.nih.gov\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"87512008\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Mild major depression\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].code.code == \"focus\"\n    assert (\n        inst.useContext[2].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].valueCodeableConcept.coding[0].code == \"40379007\"\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].display\n        == \"Major depression, recurrent, mild\"\n    )\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].code.code == \"focus\"\n    assert (\n        inst.useContext[3].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].valueCodeableConcept.coding[0].code == \"225444004\"\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].display\n        == \"At risk for suicide (finding)\"\n    )\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].code.code == \"focus\"\n    assert (\n        inst.useContext[4].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].valueCodeableConcept.coding[0].code == \"306206005\"\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].display\n        == \"Referral to service (procedure)\"\n    )\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].code.code == \"user\"\n    assert (\n        inst.useContext[5].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].valueCodeableConcept.coding[0].code == \"309343006\"\n    assert inst.useContext[5].valueCodeableConcept.coding[0].display == \"Physician\"\n    assert (\n        inst.useContext[5].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].code.code == \"venue\"\n    assert (\n        inst.useContext[6].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].valueCodeableConcept.coding[0].code == \"440655000\"\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].display\n        == \"Outpatient environment\"\n    )\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"1.1.0\"\n\n\ndef test_activitydefinition_7(base_settings):\n    \"\"\"No. 7 tests collection for ActivityDefinition.\n    Test File: activitydefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"activitydefinition-example.json\"\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_7(inst2)\n\n\ndef impl_activitydefinition_8(inst):\n    assert inst.code.text == \"Serum Dengue Virus IgM\"\n    assert inst.description == \"Order Serum Dengue Virus IgM\"\n    assert inst.experimental is True\n    assert inst.id == \"serum-dengue-virus-igm\"\n    assert inst.kind == \"ServiceRequest\"\n    assert inst.participant[0].type == \"practitioner\"\n    assert inst.relatedArtifact[0].display == (\n        \"Explanation of diagnostic tests for Dengue virus and which \"\n        \"to use based on the patient’s clinical and exposure history.\"\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/ActivityDefinition/serum-dengue-virus-igm\"}\n        ).valueUri\n    )\n\n\ndef test_activitydefinition_8(base_settings):\n    \"\"\"No. 8 tests collection for ActivityDefinition.\n    Test File: activitydefinition-order-serum-dengue-virus-igm.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-order-serum-dengue-virus-igm.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_8(inst2)\n\n\ndef impl_activitydefinition_9(inst):\n    assert inst.bodySite[0].coding[0].code == \"17401000\"\n    assert inst.bodySite[0].coding[0].display == \"Heart valve structure\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"34068001\"\n    assert inst.code.coding[0].display == \"Heart valve replacement\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.description == \"Heart valve replacement\"\n    assert inst.experimental is True\n    assert inst.id == \"heart-valve-replacement\"\n    assert inst.kind == \"ServiceRequest\"\n    assert inst.location.reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].role.coding[0].code == \"207RI0011X\"\n    assert inst.participant[0].role.coding[0].display == \"Interventional Cardiology\"\n    assert (\n        inst.participant[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nucc.org/provider-taxonomy\"}\n        ).valueUri\n    )\n    assert inst.participant[0].role.text == \"Interventional Cardiology\"\n    assert inst.participant[0].type == \"practitioner\"\n    assert (\n        inst.purpose == \"Describes the proposal to perform a Heart Valve replacement.\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.topic[0].coding[0].code == \"34068001\"\n    assert inst.topic[0].coding[0].display == \"Heart valve replacement\"\n    assert (\n        inst.topic[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"age\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"D000328\"\n    assert inst.useContext[0].valueCodeableConcept.coding[0].display == \"Adult\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://meshb.nlm.nih.gov\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"user\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"309343006\"\n    assert inst.useContext[1].valueCodeableConcept.coding[0].display == \"Physician\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_activitydefinition_9(base_settings):\n    \"\"\"No. 9 tests collection for ActivityDefinition.\n    Test File: activitydefinition-servicerequest-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-servicerequest-example.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_9(inst2)\n\n\ndef impl_activitydefinition_10(inst):\n    assert inst.code.coding[0].code == \"BlueTubes\"\n    assert inst.code.coding[0].display == \"Blood collect tubes blue cap\"\n    assert inst.description == \"10 Blood collect tubes blue cap\"\n    assert inst.experimental is True\n    assert inst.id == \"blood-tubes-supply\"\n    assert inst.kind == \"SupplyRequest\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.purpose == (\n        \"Describes a request for 10 Blood collection tubes with blue \" \"caps.\"\n    )\n    assert float(inst.quantity.value) == float(10)\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.transform == \"http://example.org/fhir/StructureMap/supplyrequest-transform\"\n    )\n\n\ndef test_activitydefinition_10(base_settings):\n    \"\"\"No. 10 tests collection for ActivityDefinition.\n    Test File: activitydefinition-supplyrequest-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-supplyrequest-example.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_administrableproductdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AdministrableProductDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import administrableproductdefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_administrableproductdefinition_1(inst):\n    assert inst.administrableDoseForm.coding[0].code == \"Film-coatedtablet\"\n    assert (\n        inst.administrableDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/administrabledoseform\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/phpididentifiersets\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"{PhPID}\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.routeOfAdministration[0].code.coding[0].code == \"OralUse\"\n    assert (\n        inst.routeOfAdministration[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/routeofadministration\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.unitOfPresentation.coding[0].code == \"Tablet\"\n    assert (\n        inst.unitOfPresentation.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/unitofpresentation\"}\n        ).valueUri\n    )\n\n\ndef test_administrableproductdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for AdministrableProductDefinition.\n    Test File: administrableproductdefinition-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"administrableproductdefinition-example.json\"\n    )\n    inst = administrableproductdefinition.AdministrableProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AdministrableProductDefinition\" == inst.get_resource_type()\n\n    impl_administrableproductdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AdministrableProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = administrableproductdefinition.AdministrableProductDefinition(**data)\n    impl_administrableproductdefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_adverseevent.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AdverseEvent\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import adverseevent\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_adverseevent_1(inst):\n    assert inst.actuality == \"actual\"\n    assert inst.category[0].coding[0].code == \"product-use-error\"\n    assert inst.category[0].coding[0].display == \"Product Use Error\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/adverse-event-category\"}\n        ).valueUri\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-29T12:34:56+00:00\"}\n        ).valueDateTime\n    )\n    assert inst.event.coding[0].code == \"304386008\"\n    assert inst.event.coding[0].display == \"O/E - itchy rash\"\n    assert (\n        inst.event.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.event.text == \"This was a mild rash on the left forearm\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ids/patients/risks\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"49476534\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.recorder.reference == \"Practitioner/example\"\n    assert inst.seriousness.coding[0].code == \"Non-serious\"\n    assert inst.seriousness.coding[0].display == \"Non-serious\"\n    assert (\n        inst.seriousness.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/adverse-event-seriousness\"\n            }\n        ).valueUri\n    )\n    assert inst.severity.coding[0].code == \"mild\"\n    assert inst.severity.coding[0].display == \"Mild\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/adverse-event-severity\"}\n        ).valueUri\n    )\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.suspectEntity[0].instance.reference == \"Medication/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_adverseevent_1(base_settings):\n    \"\"\"No. 1 tests collection for AdverseEvent.\n    Test File: adverseevent-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"adverseevent-example.json\"\n    inst = adverseevent.AdverseEvent.model_validate_json(filename.read_bytes())\n    assert \"AdverseEvent\" == inst.get_resource_type()\n\n    impl_adverseevent_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AdverseEvent\" == data[\"resourceType\"]\n\n    inst2 = adverseevent.AdverseEvent(**data)\n    impl_adverseevent_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_allergyintolerance.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AllergyIntolerance\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import allergyintolerance\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_allergyintolerance_1(inst):\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert inst.clinicalStatus.coding[0].display == \"Active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\"\n            }\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"716184000\"\n    assert inst.code.coding[0].display == \"No Known Latex Allergy (situation)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"No Known Latex Allergy\"\n    assert inst.id == \"nkla\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-06T15:37:31-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.recorder.reference == \"Practitioner/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert inst.verificationStatus.coding[0].display == \"Confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-verification\"\n            }\n        ).valueUri\n    )\n\n\ndef test_allergyintolerance_1(base_settings):\n    \"\"\"No. 1 tests collection for AllergyIntolerance.\n    Test File: allergyintolerance-nkla.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"allergyintolerance-nkla.json\"\n    inst = allergyintolerance.AllergyIntolerance.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AllergyIntolerance\" == inst.get_resource_type()\n\n    impl_allergyintolerance_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AllergyIntolerance\" == data[\"resourceType\"]\n\n    inst2 = allergyintolerance.AllergyIntolerance(**data)\n    impl_allergyintolerance_1(inst2)\n\n\ndef impl_allergyintolerance_2(inst):\n    assert inst.asserter.reference == \"Patient/example\"\n    assert inst.category[0] == \"food\"\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert inst.clinicalStatus.coding[0].display == \"Active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\"\n            }\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"227493005\"\n    assert inst.code.coding[0].display == \"Cashew nuts\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.criticality == \"high\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ids/patients/risks\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"49476534\"\n    assert (\n        inst.lastOccurrence\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-06\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"The criticality is high becasue of the observed anaphylactic\"\n        \" reaction when challenged with cashew extract.\"\n    )\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2004\"}\n        ).valueDateTime\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.reaction[0].description == (\n        \"Challenge Protocol. Severe reaction to subcutaneous cashew \"\n        \"extract. Epinephrine administered\"\n    )\n    assert inst.reaction[0].exposureRoute.coding[0].code == \"34206005\"\n    assert inst.reaction[0].exposureRoute.coding[0].display == \"Subcutaneous route\"\n    assert (\n        inst.reaction[0].exposureRoute.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reaction[0].manifestation[0].coding[0].code == \"39579001\"\n    assert (\n        inst.reaction[0].manifestation[0].coding[0].display == \"Anaphylactic reaction\"\n    )\n    assert (\n        inst.reaction[0].manifestation[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.reaction[0].onset\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-06-12\"}\n        ).valueDateTime\n    )\n    assert inst.reaction[0].severity == \"severe\"\n    assert inst.reaction[0].substance.coding[0].code == \"1160593\"\n    assert (\n        inst.reaction[0].substance.coding[0].display\n        == \"cashew nut allergenic extract Injectable Product\"\n    )\n    assert (\n        inst.reaction[0].substance.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.reaction[1].manifestation[0].coding[0].code == \"64305001\"\n    assert inst.reaction[1].manifestation[0].coding[0].display == \"Urticaria\"\n    assert (\n        inst.reaction[1].manifestation[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reaction[1].note[0].text == (\n        \"The patient reports that the onset of urticaria was within \"\n        \"15 minutes of eating cashews.\"\n    )\n    assert (\n        inst.reaction[1].onset\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2004\"}\n        ).valueDateTime\n    )\n    assert inst.reaction[1].severity == \"moderate\"\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-10-09T14:58:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.recorder.reference == \"Practitioner/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"allergy\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert inst.verificationStatus.coding[0].display == \"Confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-verification\"\n            }\n        ).valueUri\n    )\n\n\ndef test_allergyintolerance_2(base_settings):\n    \"\"\"No. 2 tests collection for AllergyIntolerance.\n    Test File: allergyintolerance-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"allergyintolerance-example.json\"\n    inst = allergyintolerance.AllergyIntolerance.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AllergyIntolerance\" == inst.get_resource_type()\n\n    impl_allergyintolerance_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AllergyIntolerance\" == data[\"resourceType\"]\n\n    inst2 = allergyintolerance.AllergyIntolerance(**data)\n    impl_allergyintolerance_2(inst2)\n\n\ndef impl_allergyintolerance_3(inst):\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert inst.clinicalStatus.coding[0].display == \"Active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\"\n            }\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"716186003\"\n    assert inst.code.coding[0].display == \"No Known Allergy (situation)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"NKA\"\n    assert inst.id == \"nka\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/mom\"\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-06T15:37:31-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.recorder.reference == \"Practitioner/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert inst.verificationStatus.coding[0].display == \"Confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-verification\"\n            }\n        ).valueUri\n    )\n\n\ndef test_allergyintolerance_3(base_settings):\n    \"\"\"No. 3 tests collection for AllergyIntolerance.\n    Test File: allergyintolerance-nka.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"allergyintolerance-nka.json\"\n    inst = allergyintolerance.AllergyIntolerance.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AllergyIntolerance\" == inst.get_resource_type()\n\n    impl_allergyintolerance_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AllergyIntolerance\" == data[\"resourceType\"]\n\n    inst2 = allergyintolerance.AllergyIntolerance(**data)\n    impl_allergyintolerance_3(inst2)\n\n\ndef impl_allergyintolerance_4(inst):\n    assert inst.category[0] == \"medication\"\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert inst.clinicalStatus.coding[0].display == \"Active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\"\n            }\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"7980\"\n    assert inst.code.coding[0].display == \"Penicillin G\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.criticality == \"high\"\n    assert inst.id == \"medication\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.reaction[0].manifestation[0].coding[0].code == \"247472004\"\n    assert inst.reaction[0].manifestation[0].coding[0].display == \"Hives\"\n    assert (\n        inst.reaction[0].manifestation[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-03-01\"}\n        ).valueDateTime\n    )\n    assert inst.recorder.reference == \"Practitioner/13\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"unconfirmed\"\n    assert inst.verificationStatus.coding[0].display == \"Unconfirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-verification\"\n            }\n        ).valueUri\n    )\n\n\ndef test_allergyintolerance_4(base_settings):\n    \"\"\"No. 4 tests collection for AllergyIntolerance.\n    Test File: allergyintolerance-medication.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"allergyintolerance-medication.json\"\n    inst = allergyintolerance.AllergyIntolerance.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AllergyIntolerance\" == inst.get_resource_type()\n\n    impl_allergyintolerance_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AllergyIntolerance\" == data[\"resourceType\"]\n\n    inst2 = allergyintolerance.AllergyIntolerance(**data)\n    impl_allergyintolerance_4(inst2)\n\n\ndef impl_allergyintolerance_5(inst):\n    assert inst.category[0] == \"food\"\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert inst.clinicalStatus.coding[0].display == \"Active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\"\n            }\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"227037002\"\n    assert inst.code.coding[0].display == \"Fish - dietary (substance)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Allergic to fresh fish. Tolerates canned fish\"\n    assert inst.id == \"fishallergy\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ids/patients/risks\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"49476535\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-06T15:37:31-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.recorder.reference == \"Practitioner/example\"\n    assert inst.text.status == \"additional\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert inst.verificationStatus.coding[0].display == \"Confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-verification\"\n            }\n        ).valueUri\n    )\n\n\ndef test_allergyintolerance_5(base_settings):\n    \"\"\"No. 5 tests collection for AllergyIntolerance.\n    Test File: allergyintolerance-fishallergy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"allergyintolerance-fishallergy.json\"\n    )\n    inst = allergyintolerance.AllergyIntolerance.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AllergyIntolerance\" == inst.get_resource_type()\n\n    impl_allergyintolerance_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AllergyIntolerance\" == data[\"resourceType\"]\n\n    inst2 = allergyintolerance.AllergyIntolerance(**data)\n    impl_allergyintolerance_5(inst2)\n\n\ndef impl_allergyintolerance_6(inst):\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert inst.clinicalStatus.coding[0].display == \"Active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\"\n            }\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"409137002\"\n    assert inst.code.coding[0].display == \"No Known Drug Allergy (situation)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"NKDA\"\n    assert inst.id == \"nkda\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/mom\"\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-06T15:37:31-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.recorder.reference == \"Practitioner/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert inst.verificationStatus.coding[0].display == \"Confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-verification\"\n            }\n        ).valueUri\n    )\n\n\ndef test_allergyintolerance_6(base_settings):\n    \"\"\"No. 6 tests collection for AllergyIntolerance.\n    Test File: allergyintolerance-nkda.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"allergyintolerance-nkda.json\"\n    inst = allergyintolerance.AllergyIntolerance.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AllergyIntolerance\" == inst.get_resource_type()\n\n    impl_allergyintolerance_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AllergyIntolerance\" == data[\"resourceType\"]\n\n    inst2 = allergyintolerance.AllergyIntolerance(**data)\n    impl_allergyintolerance_6(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_appointment.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Appointment\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import appointment\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_appointment_1(inst):\n    assert inst.appointmentType.coding[0].code == \"FOLLOWUP\"\n    assert (\n        inst.appointmentType.coding[0].display\n        == \"A follow up visit from a previous appointment\"\n    )\n    assert (\n        inst.appointmentType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0276\"}\n        ).valueUri\n    )\n    assert inst.basedOn[0].reference == \"ServiceRequest/myringotomy\"\n    assert inst.comment == (\n        \"Further expand on the results of the MRI and determine the \"\n        \"next actions that may be appropriate.\"\n    )\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-10-10\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Discussion on the results of your recent MRI\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-10T11:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.display == \"Peter James Chalmers\"\n    assert inst.participant[0].actor.reference == \"Patient/example\"\n    assert inst.participant[0].required == \"required\"\n    assert inst.participant[0].status == \"accepted\"\n    assert inst.participant[1].actor.display == \"Dr Adam Careful\"\n    assert inst.participant[1].actor.reference == \"Practitioner/example\"\n    assert inst.participant[1].required == \"required\"\n    assert inst.participant[1].status == \"accepted\"\n    assert inst.participant[1].type[0].coding[0].code == \"ATND\"\n    assert (\n        inst.participant[1].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.participant[2].actor.display == \"South Wing, second floor\"\n    assert inst.participant[2].actor.reference == \"Location/1\"\n    assert inst.participant[2].required == \"required\"\n    assert inst.participant[2].status == \"accepted\"\n    assert inst.priority == 5\n    assert inst.reasonReference[0].display == \"Severe burn of left ear\"\n    assert inst.reasonReference[0].reference == \"Condition/example\"\n    assert inst.serviceCategory[0].coding[0].code == \"gp\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.serviceCategory[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/service-category\"}\n        ).valueUri\n    )\n    assert inst.serviceType[0].coding[0].code == \"52\"\n    assert inst.serviceType[0].coding[0].display == \"General Discussion\"\n    assert inst.specialty[0].coding[0].code == \"394814009\"\n    assert inst.specialty[0].coding[0].display == \"General practice\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-10T09:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"booked\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Brian MRI '\n        \"results discussion</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_appointment_1(base_settings):\n    \"\"\"No. 1 tests collection for Appointment.\n    Test File: appointment-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"appointment-example.json\"\n    inst = appointment.Appointment.model_validate_json(filename.read_bytes())\n    assert \"Appointment\" == inst.get_resource_type()\n\n    impl_appointment_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Appointment\" == data[\"resourceType\"]\n\n    inst2 = appointment.Appointment(**data)\n    impl_appointment_1(inst2)\n\n\ndef impl_appointment_2(inst):\n    assert inst.appointmentType.coding[0].code == \"WALKIN\"\n    assert (\n        inst.appointmentType.coding[0].display\n        == \"A previously unscheduled walk-in visit\"\n    )\n    assert (\n        inst.appointmentType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0276\"}\n        ).valueUri\n    )\n    assert inst.comment == (\n        \"Further expand on the results of the MRI and determine the \"\n        \"next actions that may be appropriate.\"\n    )\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-02\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Discussion on the results of your recent MRI\"\n    assert inst.id == \"examplereq\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/sampleappointment-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.minutesDuration == 15\n    assert inst.participant[0].actor.display == \"Peter James Chalmers\"\n    assert inst.participant[0].actor.reference == \"Patient/example\"\n    assert inst.participant[0].required == \"required\"\n    assert inst.participant[0].status == \"needs-action\"\n    assert inst.participant[1].required == \"required\"\n    assert inst.participant[1].status == \"needs-action\"\n    assert inst.participant[1].type[0].coding[0].code == \"ATND\"\n    assert (\n        inst.participant[1].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.participant[2].actor.display == \"South Wing, second floor\"\n    assert inst.participant[2].actor.reference == \"Location/1\"\n    assert inst.participant[2].required == \"required\"\n    assert inst.participant[2].status == \"accepted\"\n    assert inst.priority == 5\n    assert inst.reasonCode[0].coding[0].code == \"413095006\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reasonCode[0].text == \"Clinical Review\"\n    assert (\n        inst.requestedPeriod[0].end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-09\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.requestedPeriod[0].start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-02\"}\n        ).valueDateTime\n    )\n    assert inst.serviceCategory[0].coding[0].code == \"gp\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.serviceCategory[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/service-category\"}\n        ).valueUri\n    )\n    assert inst.slot[0].reference == \"Slot/example\"\n    assert inst.specialty[0].coding[0].code == \"394814009\"\n    assert inst.specialty[0].coding[0].display == \"General practice\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.status == \"proposed\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Brian MRI '\n        \"results discussion</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_appointment_2(base_settings):\n    \"\"\"No. 2 tests collection for Appointment.\n    Test File: appointment-example-request.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"appointment-example-request.json\"\n    inst = appointment.Appointment.model_validate_json(filename.read_bytes())\n    assert \"Appointment\" == inst.get_resource_type()\n\n    impl_appointment_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Appointment\" == data[\"resourceType\"]\n\n    inst2 = appointment.Appointment(**data)\n    impl_appointment_2(inst2)\n\n\ndef impl_appointment_3(inst):\n    assert inst.appointmentType.coding[0].code == \"WALKIN\"\n    assert (\n        inst.appointmentType.coding[0].display\n        == \"A previously unscheduled walk-in visit\"\n    )\n    assert (\n        inst.appointmentType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0276\"}\n        ).valueUri\n    )\n    assert inst.comment == (\n        \"Clarify the results of the MRI to ensure context of test was\" \" correct\"\n    )\n    assert inst.description == \"Discussion about Peter Chalmers MRI results\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-09T11:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"2docs\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.display == \"Peter James Chalmers\"\n    assert inst.participant[0].actor.reference == \"Patient/example\"\n    assert inst.participant[0].required == \"information-only\"\n    assert inst.participant[0].status == \"accepted\"\n    assert inst.participant[1].actor.display == \"Dr Adam Careful\"\n    assert inst.participant[1].actor.reference == \"Practitioner/example\"\n    assert inst.participant[1].required == \"required\"\n    assert inst.participant[1].status == \"accepted\"\n    assert inst.participant[2].actor.display == \"Luigi Maas\"\n    assert inst.participant[2].actor.reference == \"Practitioner/f202\"\n    assert inst.participant[2].required == \"required\"\n    assert inst.participant[2].status == \"accepted\"\n    assert inst.participant[3].actor.display == \"Phone Call\"\n    assert inst.participant[3].required == \"information-only\"\n    assert inst.participant[3].status == \"accepted\"\n    assert inst.priority == 5\n    assert inst.serviceCategory[0].coding[0].code == \"gp\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.serviceCategory[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/service-category\"}\n        ).valueUri\n    )\n    assert inst.serviceType[0].coding[0].code == \"52\"\n    assert inst.serviceType[0].coding[0].display == \"General Discussion\"\n    assert inst.specialty[0].coding[0].code == \"394814009\"\n    assert inst.specialty[0].coding[0].display == \"General practice\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-09T09:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"booked\"\n    assert inst.supportingInformation[0].reference == \"DiagnosticReport/ultrasound\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Brian MRI '\n        \"results discussion</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_appointment_3(base_settings):\n    \"\"\"No. 3 tests collection for Appointment.\n    Test File: appointment-example2doctors.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"appointment-example2doctors.json\"\n    inst = appointment.Appointment.model_validate_json(filename.read_bytes())\n    assert \"Appointment\" == inst.get_resource_type()\n\n    impl_appointment_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Appointment\" == data[\"resourceType\"]\n\n    inst2 = appointment.Appointment(**data)\n    impl_appointment_3(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_appointmentresponse.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AppointmentResponse\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import appointmentresponse\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_appointmentresponse_1(inst):\n    assert inst.actor.display == \"Dr Adam Careful\"\n    assert inst.actor.reference == \"Practitioner/example\"\n    assert inst.appointment.display == \"Brian MRI results discussion\"\n    assert inst.appointment.reference == \"Appointment/examplereq\"\n    assert inst.comment == \"can't we try for this time, can't do mornings\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T13:30:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"exampleresp\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/sampleappointmentresponse-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"response123\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participantStatus == \"tentative\"\n    assert inst.participantType[0].coding[0].code == \"ATND\"\n    assert (\n        inst.participantType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T13:15:00Z\"}\n        ).valueInstant\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Accept Brian MRI'\n        \" results discussion</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_appointmentresponse_1(base_settings):\n    \"\"\"No. 1 tests collection for AppointmentResponse.\n    Test File: appointmentresponse-example-req.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"appointmentresponse-example-req.json\"\n    )\n    inst = appointmentresponse.AppointmentResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AppointmentResponse\" == inst.get_resource_type()\n\n    impl_appointmentresponse_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AppointmentResponse\" == data[\"resourceType\"]\n\n    inst2 = appointmentresponse.AppointmentResponse(**data)\n    impl_appointmentresponse_1(inst2)\n\n\ndef impl_appointmentresponse_2(inst):\n    assert inst.actor.display == \"Peter James Chalmers\"\n    assert inst.actor.reference == \"Patient/example\"\n    assert inst.appointment.display == \"Brian MRI results discussion\"\n    assert inst.appointment.reference == \"Appointment/example\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participantStatus == \"accepted\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Accept Brian MRI'\n        \" results discussion</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_appointmentresponse_2(base_settings):\n    \"\"\"No. 2 tests collection for AppointmentResponse.\n    Test File: appointmentresponse-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"appointmentresponse-example.json\"\n    inst = appointmentresponse.AppointmentResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AppointmentResponse\" == inst.get_resource_type()\n\n    impl_appointmentresponse_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AppointmentResponse\" == data[\"resourceType\"]\n\n    inst2 = appointmentresponse.AppointmentResponse(**data)\n    impl_appointmentresponse_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_auditevent.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AuditEvent\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import auditevent\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_auditevent_1(inst):\n    assert inst.action == \"E\"\n    assert inst.agent[0].altId == \"601847123\"\n    assert inst.agent[0].name == \"Grahame Grieve\"\n    assert inst.agent[0].requestor is True\n    assert inst.agent[0].type.coding[0].code == \"humanuser\"\n    assert inst.agent[0].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"95\"\n    assert inst.agent[1].altId == \"6580\"\n    assert inst.agent[1].network.address == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[1].network.type == \"1\"\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110153\"\n    assert inst.agent[1].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[1].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert (\n        inst.entity[0].query\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueBase64Binary\": (\n                    \"aHR0cDovL2ZoaXItZGV2LmhlYWx0aGludGVyc2VjdGlvbnMuY29tLmF1L29w\"\n                    \"ZW4vRW5jb3VudGVyP3BhcnRpY2lwYW50PTEz\"\n                )\n            }\n        ).valueBase64Binary\n    )\n    assert inst.entity[0].role.code == \"24\"\n    assert inst.entity[0].role.display == \"Query\"\n    assert (\n        inst.entity[0].role.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[0].type.code == \"2\"\n    assert inst.entity[0].type.display == \"System Object\"\n    assert (\n        inst.entity[0].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-entity-type\"}\n        ).valueUri\n    )\n    assert inst.id == \"example-search\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"0\"\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-08-22T23:42:24Z\"}\n        ).valueInstant\n    )\n    assert inst.source.observer.display == \"hl7connect.healthintersections.com.au\"\n    assert inst.source.site == \"Cloud\"\n    assert inst.source.type[0].code == \"3\"\n    assert inst.source.type[0].display == \"Web Server\"\n    assert (\n        inst.source.type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.subtype[0].code == \"search\"\n    assert inst.subtype[0].display == \"search\"\n    assert (\n        inst.subtype[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.code == \"rest\"\n    assert inst.type.display == \"Restful Operation\"\n    assert (\n        inst.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-type\"}\n        ).valueUri\n    )\n\n\ndef test_auditevent_1(base_settings):\n    \"\"\"No. 1 tests collection for AuditEvent.\n    Test File: audit-event-example-search.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"audit-event-example-search.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_1(inst2)\n\n\ndef impl_auditevent_2(inst):\n    assert inst.action == \"E\"\n    assert inst.agent[0].altId == \"601847123\"\n    assert inst.agent[0].name == \"Grahame Grieve\"\n    assert inst.agent[0].network.address == \"127.0.0.1\"\n    assert inst.agent[0].network.type == \"2\"\n    assert inst.agent[0].requestor is True\n    assert inst.agent[0].type.coding[0].code == \"humanuser\"\n    assert inst.agent[0].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"95\"\n    assert inst.agent[1].altId == \"6580\"\n    assert inst.agent[1].network.address == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[1].network.type == \"1\"\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110153\"\n    assert inst.agent[1].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[1].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.id == \"example-logout\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"0\"\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-06-20T23:46:41Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.source.observer.identifier.value == \"hl7connect.healthintersections.com.au\"\n    )\n    assert inst.source.site == \"Cloud\"\n    assert inst.source.type[0].code == \"3\"\n    assert inst.source.type[0].display == \"Web Server\"\n    assert (\n        inst.source.type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.subtype[0].code == \"110123\"\n    assert inst.subtype[0].display == \"Logout\"\n    assert (\n        inst.subtype[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.code == \"110114\"\n    assert inst.type.display == \"User Authentication\"\n    assert (\n        inst.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n\n\ndef test_auditevent_2(base_settings):\n    \"\"\"No. 2 tests collection for AuditEvent.\n    Test File: audit-event-example-logout.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"audit-event-example-logout.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_2(inst2)\n\n\ndef impl_auditevent_3(inst):\n    assert inst.action == \"R\"\n    assert inst.agent[0].altId == \"601847123\"\n    assert inst.agent[0].name == \"Grahame Grieve\"\n    assert inst.agent[0].requestor is True\n    assert inst.agent[0].type.coding[0].code == \"humanuser\"\n    assert inst.agent[0].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"95\"\n    assert inst.agent[1].altId == \"6580\"\n    assert inst.agent[1].network.address == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[1].network.type == \"1\"\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110153\"\n    assert inst.agent[1].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[1].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.entity[0].lifecycle.code == \"6\"\n    assert inst.entity[0].lifecycle.display == \"Access / Use\"\n    assert (\n        inst.entity[0].lifecycle.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dicom-audit-lifecycle\"}\n        ).valueUri\n    )\n    assert inst.entity[0].type.code == \"2\"\n    assert inst.entity[0].type.display == \"System Object\"\n    assert (\n        inst.entity[0].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-entity-type\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.reference == \"Patient/example/_history/1\"\n    assert inst.id == \"example-rest\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"0\"\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-06-20T23:42:24Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.source.observer.identifier.value == \"hl7connect.healthintersections.com.au\"\n    )\n    assert inst.source.site == \"Cloud\"\n    assert inst.source.type[0].code == \"3\"\n    assert inst.source.type[0].display == \"Web Server\"\n    assert (\n        inst.source.type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.subtype[0].code == \"vread\"\n    assert inst.subtype[0].display == \"vread\"\n    assert (\n        inst.subtype[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.code == \"rest\"\n    assert inst.type.display == \"Restful Operation\"\n    assert (\n        inst.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-type\"}\n        ).valueUri\n    )\n\n\ndef test_auditevent_3(base_settings):\n    \"\"\"No. 3 tests collection for AuditEvent.\n    Test File: audit-event-example-vread.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"audit-event-example-vread.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_3(inst2)\n\n\ndef impl_auditevent_4(inst):\n    assert inst.action == \"R\"\n    assert inst.agent[0].requestor is False\n    assert inst.agent[0].type.coding[0].code == \"110153\"\n    assert inst.agent[0].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.display == \"ExportToMedia.app\"\n    assert inst.agent[1].altId == \"601847123\"\n    assert inst.agent[1].name == \"Grahame Grieve\"\n    assert inst.agent[1].requestor is True\n    assert inst.agent[1].type.coding[0].code == \"humanuser\"\n    assert inst.agent[1].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"95\"\n    assert inst.agent[2].media.code == \"110033\"\n    assert inst.agent[2].media.display == \"DVD\"\n    assert (\n        inst.agent[2].media.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.agent[2].name == \"Media title: Hello World\"\n    assert inst.agent[2].requestor is False\n    assert inst.agent[2].type.coding[0].code == \"110154\"\n    assert inst.agent[2].type.coding[0].display == \"Destination Media\"\n    assert (\n        inst.agent[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.entity[0].role.code == \"1\"\n    assert inst.entity[0].role.display == \"Patient\"\n    assert (\n        inst.entity[0].role.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[0].type.code == \"1\"\n    assert inst.entity[0].type.display == \"Person\"\n    assert (\n        inst.entity[0].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-entity-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.entity[0].what.identifier.value\n        == \"e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO\"\n    )\n    assert inst.entity[1].role.code == \"20\"\n    assert inst.entity[1].role.display == \"Job\"\n    assert (\n        inst.entity[1].role.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[1].type.code == \"2\"\n    assert inst.entity[1].type.display == \"System Object\"\n    assert (\n        inst.entity[1].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-entity-type\"}\n        ).valueUri\n    )\n    assert inst.entity[1].what.identifier.type.coding[0].code == \"IHE XDS Metadata\"\n    assert (\n        inst.entity[1].what.identifier.type.coding[0].display\n        == \"submission set classificationNode\"\n    )\n    assert (\n        inst.entity[1].what.identifier.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd\"}\n        ).valueUri\n    )\n    assert (\n        inst.entity[1].what.identifier.value\n        == \"e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO\"\n    )\n    assert inst.entity[2].type.code == \"2\"\n    assert inst.entity[2].type.display == \"System Object\"\n    assert (\n        inst.entity[2].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-entity-type\"}\n        ).valueUri\n    )\n    assert inst.entity[2].what.reference == \"DocumentManifest/example\"\n    assert inst.id == \"example-media\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"0\"\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-08-27T23:42:24Z\"}\n        ).valueInstant\n    )\n    assert inst.source.observer.display == \"hl7connect.healthintersections.com.au\"\n    assert inst.subtype[0].code == \"ITI-32\"\n    assert inst.subtype[0].display == \"Distribute Document Set on Media\"\n    assert (\n        inst.subtype[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.3.6.1.4.1.19376.1.2\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.code == \"110106\"\n    assert inst.type.display == \"Export\"\n    assert (\n        inst.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n\n\ndef test_auditevent_4(base_settings):\n    \"\"\"No. 4 tests collection for AuditEvent.\n    Test File: audit-event-example-media.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"audit-event-example-media.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_4(inst2)\n\n\ndef impl_auditevent_5(inst):\n    assert inst.action == \"E\"\n    assert inst.agent[0].altId == \"601847123\"\n    assert inst.agent[0].name == \"Grahame Grieve\"\n    assert inst.agent[0].network.address == \"127.0.0.1\"\n    assert inst.agent[0].network.type == \"2\"\n    assert inst.agent[0].requestor is True\n    assert inst.agent[0].type.coding[0].code == \"humanuser\"\n    assert inst.agent[0].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"95\"\n    assert inst.agent[1].altId == \"6580\"\n    assert inst.agent[1].network.address == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[1].network.type == \"1\"\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110153\"\n    assert inst.agent[1].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[1].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.id == \"example-login\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"0\"\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-06-20T23:41:23Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.source.observer.identifier.value == \"hl7connect.healthintersections.com.au\"\n    )\n    assert inst.source.site == \"Cloud\"\n    assert inst.source.type[0].code == \"3\"\n    assert inst.source.type[0].display == \"Web Server\"\n    assert (\n        inst.source.type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.subtype[0].code == \"110122\"\n    assert inst.subtype[0].display == \"Login\"\n    assert (\n        inst.subtype[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.code == \"110114\"\n    assert inst.type.display == \"User Authentication\"\n    assert (\n        inst.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n\n\ndef test_auditevent_5(base_settings):\n    \"\"\"No. 5 tests collection for AuditEvent.\n    Test File: audit-event-example-login.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"audit-event-example-login.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_5(inst2)\n\n\ndef impl_auditevent_6(inst):\n    assert inst.action == \"E\"\n    assert inst.agent[0].altId == \"6580\"\n    assert inst.agent[0].network.address == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[0].network.type == \"1\"\n    assert inst.agent[0].requestor is False\n    assert inst.agent[0].type.coding[0].code == \"110153\"\n    assert inst.agent[0].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[0].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.agent[1].altId == \"601847123\"\n    assert inst.agent[1].name == \"Grahame Grieve\"\n    assert inst.agent[1].requestor is True\n    assert inst.agent[1].type.coding[0].code == \"humanuser\"\n    assert inst.agent[1].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"95\"\n    assert inst.entity[0].role.code == \"1\"\n    assert inst.entity[0].role.display == \"Patient\"\n    assert (\n        inst.entity[0].role.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[0].type.code == \"1\"\n    assert inst.entity[0].type.display == \"Person\"\n    assert (\n        inst.entity[0].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-entity-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.entity[0].what.identifier.value\n        == \"e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO\"\n    )\n    assert inst.entity[1].detail[0].type == \"MSH-10\"\n    assert (\n        inst.entity[1].detail[0].valueBase64Binary\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"MS4yLjg0MC4xMTQzNTAuMS4xMy4wLjEuNy4xLjE=\"}\n        ).valueBase64Binary\n    )\n    assert inst.entity[1].role.code == \"24\"\n    assert inst.entity[1].role.display == \"Query\"\n    assert (\n        inst.entity[1].role.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[1].type.code == \"2\"\n    assert inst.entity[1].type.display == \"System Object\"\n    assert (\n        inst.entity[1].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-entity-type\"}\n        ).valueUri\n    )\n    assert inst.id == \"example-pixQuery\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"0\"\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-08-26T23:42:24Z\"}\n        ).valueInstant\n    )\n    assert inst.source.observer.display == \"hl7connect.healthintersections.com.au\"\n    assert inst.subtype[0].code == \"ITI-9\"\n    assert inst.subtype[0].display == \"PIX Query\"\n    assert (\n        inst.subtype[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.3.6.1.4.1.19376.1.2\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.code == \"110112\"\n    assert inst.type.display == \"Query\"\n    assert (\n        inst.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n\n\ndef test_auditevent_6(base_settings):\n    \"\"\"No. 6 tests collection for AuditEvent.\n    Test File: audit-event-example-pixQuery.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"audit-event-example-pixQuery.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_6(inst2)\n\n\ndef impl_auditevent_7(inst):\n    assert inst.action == \"E\"\n    assert inst.agent[0].network.address == \"127.0.0.1\"\n    assert inst.agent[0].network.type == \"2\"\n    assert inst.agent[0].requestor is False\n    assert inst.agent[0].role[0].text == \"Service User (Logon)\"\n    assert inst.agent[0].type.coding[0].code == \"humanuser\"\n    assert inst.agent[0].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"Grahame\"\n    assert inst.agent[1].altId == \"6580\"\n    assert inst.agent[1].network.address == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[1].network.type == \"1\"\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110153\"\n    assert inst.agent[1].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[1].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.entity[0].lifecycle.code == \"6\"\n    assert inst.entity[0].lifecycle.display == \"Access / Use\"\n    assert (\n        inst.entity[0].lifecycle.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dicom-audit-lifecycle\"}\n        ).valueUri\n    )\n    assert inst.entity[0].name == \"Grahame's Laptop\"\n    assert inst.entity[0].role.code == \"4\"\n    assert inst.entity[0].role.display == \"Domain Resource\"\n    assert (\n        inst.entity[0].role.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[0].type.code == \"4\"\n    assert inst.entity[0].type.display == \"Other\"\n    assert (\n        inst.entity[0].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-entity-type\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.identifier.type.coding[0].code == \"SNO\"\n    assert (\n        inst.entity[0].what.identifier.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.identifier.type.text == \"Dell Serial Number\"\n    assert inst.entity[0].what.identifier.value == \"ABCDEF\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"0\"\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2012-10-25T22:04:27+11:00\"}\n        ).valueInstant\n    )\n    assert inst.source.observer.display == \"Grahame's Laptop\"\n    assert inst.source.site == \"Development\"\n    assert inst.source.type[0].code == \"110122\"\n    assert inst.source.type[0].display == \"Login\"\n    assert (\n        inst.source.type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.subtype[0].code == \"110120\"\n    assert inst.subtype[0].display == \"Application Start\"\n    assert (\n        inst.subtype[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Application '\n        \"Start for under service login &quot;Grahame&quot; (id: \"\n        \"Grahame's Test HL7Connect)</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.code == \"110100\"\n    assert inst.type.display == \"Application Activity\"\n    assert (\n        inst.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n\n\ndef test_auditevent_7(base_settings):\n    \"\"\"No. 7 tests collection for AuditEvent.\n    Test File: auditevent-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"auditevent-example.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_7(inst2)\n\n\ndef impl_auditevent_8(inst):\n    assert inst.action == \"R\"\n    assert inst.agent[0].altId == \"notMe\"\n    assert inst.agent[0].location.reference == \"Location/1\"\n    assert inst.agent[0].name == \"That guy everyone wishes would be caught\"\n    assert inst.agent[0].network.address == \"custodian.net\"\n    assert inst.agent[0].network.type == \"1\"\n    assert (\n        inst.agent[0].policy[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://consent.com/yes\"}\n        ).valueUri\n    )\n    assert inst.agent[0].requestor is True\n    assert inst.agent[0].type.coding[0].code == \"110153\"\n    assert inst.agent[0].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"SomeIdiot@nowhere\"\n    assert inst.agent[1].network.address == \"marketing.land\"\n    assert inst.agent[1].network.type == \"1\"\n    assert inst.agent[1].purposeOfUse[0].coding[0].code == \"HMARKT\"\n    assert inst.agent[1].purposeOfUse[0].coding[0].display == \"healthcare marketing\"\n    assert (\n        inst.agent[1].purposeOfUse[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110152\"\n    assert inst.agent[1].type.coding[0].display == \"Destination Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.display == \"Where\"\n    assert inst.agent[1].who.reference == \"Practitioner/example\"\n    assert inst.entity[0].role.code == \"1\"\n    assert inst.entity[0].role.display == \"Patient\"\n    assert (\n        inst.entity[0].role.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[0].type.code == \"1\"\n    assert inst.entity[0].type.display == \"Person\"\n    assert (\n        inst.entity[0].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-entity-type\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.reference == \"Patient/example\"\n    assert inst.entity[1].description == \"data about Everthing important\"\n    assert inst.entity[1].lifecycle.code == \"11\"\n    assert inst.entity[1].lifecycle.display == \"Disclosure\"\n    assert (\n        inst.entity[1].lifecycle.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dicom-audit-lifecycle\"}\n        ).valueUri\n    )\n    assert inst.entity[1].name == \"Namne of What\"\n    assert inst.entity[1].role.code == \"4\"\n    assert inst.entity[1].role.display == \"Domain Resource\"\n    assert (\n        inst.entity[1].role.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[1].securityLabel[0].code == \"V\"\n    assert inst.entity[1].securityLabel[0].display == \"very restricted\"\n    assert (\n        inst.entity[1].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.entity[1].securityLabel[1].code == \"STD\"\n    assert (\n        inst.entity[1].securityLabel[1].display\n        == \"sexually transmitted disease information sensitivity\"\n    )\n    assert (\n        inst.entity[1].securityLabel[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.entity[1].securityLabel[2].code == \"DELAU\"\n    assert inst.entity[1].securityLabel[2].display == \"delete after use\"\n    assert (\n        inst.entity[1].securityLabel[2].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.entity[1].type.code == \"2\"\n    assert inst.entity[1].type.display == \"System Object\"\n    assert (\n        inst.entity[1].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-entity-type\"}\n        ).valueUri\n    )\n    assert inst.entity[1].what.identifier.value == \"What.id\"\n    assert inst.entity[1].what.reference == \"Patient/example/_history/1\"\n    assert inst.id == \"example-disclosure\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"0\"\n    assert inst.outcomeDesc == \"Successful  Disclosure\"\n    assert inst.purposeOfEvent[0].coding[0].code == \"HMARKT\"\n    assert inst.purposeOfEvent[0].coding[0].display == \"healthcare marketing\"\n    assert (\n        inst.purposeOfEvent[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-09-22T00:08:00Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.source.observer.display == \"Watchers Accounting of Disclosures Application\"\n    )\n    assert inst.source.site == \"Watcher\"\n    assert inst.source.type[0].code == \"4\"\n    assert inst.source.type[0].display == \"Application Server\"\n    assert (\n        inst.source.type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.subtype[0].code == \"Disclosure\"\n    assert inst.subtype[0].display == \"HIPAA disclosure\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Disclosure by '\n        \"some idiot, for marketing reasons, to places unknown, of a \"\n        \"Poor Sap, data about Everthing important.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.code == \"110106\"\n    assert inst.type.display == \"Export\"\n    assert (\n        inst.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n\n\ndef test_auditevent_8(base_settings):\n    \"\"\"No. 8 tests collection for AuditEvent.\n    Test File: auditevent-example-disclosure.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"auditevent-example-disclosure.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_8(inst2)\n\n\ndef impl_auditevent_9(inst):\n    assert inst.action == \"C\"\n    assert inst.agent[0].altId == \"601847123\"\n    assert inst.agent[0].name == \"Grahame Grieve\"\n    assert inst.agent[0].requestor is True\n    assert inst.agent[0].type.coding[0].code == \"humanuser\"\n    assert inst.agent[0].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"95\"\n    assert inst.agent[1].altId == \"6580\"\n    assert inst.agent[1].network.address == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[1].network.type == \"1\"\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110153\"\n    assert inst.agent[1].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[1].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.contained[0].id == \"o1\"\n    assert inst.entity[0].detail[0].type == \"requested transaction\"\n    assert inst.entity[0].detail[0].valueString == \"http POST .....\"\n    assert inst.entity[0].type.code == \"2\"\n    assert inst.entity[0].type.display == \"System Object\"\n    assert (\n        inst.entity[0].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-entity-type\"}\n        ).valueUri\n    )\n    assert inst.entity[1].description == \"transaction failed\"\n    assert inst.entity[1].type.code == \"OperationOutcome\"\n    assert inst.entity[1].type.display == \"OperationOutcome\"\n    assert (\n        inst.entity[1].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert inst.entity[1].what.reference == \"#o1\"\n    assert inst.id == \"example-error\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"8\"\n    assert inst.outcomeDesc == (\n        \"Invalid request to create an Operation resource on the \" \"Patient endpoint.\"\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2017-09-07T23:42:24Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.source.observer.identifier.value == \"hl7connect.healthintersections.com.au\"\n    )\n    assert inst.source.site == \"Cloud\"\n    assert inst.source.type[0].code == \"3\"\n    assert inst.source.type[0].display == \"Web Server\"\n    assert (\n        inst.source.type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.subtype[0].code == \"create\"\n    assert inst.subtype[0].display == \"create\"\n    assert (\n        inst.subtype[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.code == \"rest\"\n    assert inst.type.display == \"Restful Operation\"\n    assert (\n        inst.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-type\"}\n        ).valueUri\n    )\n\n\ndef test_auditevent_9(base_settings):\n    \"\"\"No. 9 tests collection for AuditEvent.\n    Test File: auditevent-example-error.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"auditevent-example-error.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_9(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_basic.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Basic\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import basic\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_basic_1(inst):\n    assert inst.code.coding[0].code == \"UMLCLASSMODEL\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/do-not-use/fhir-codes#resourceTypes\"}\n        ).valueUri\n    )\n    assert (\n        inst.extension[0].extension[0].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"name\"}).valueUri\n    )\n    assert inst.extension[0].extension[0].valueString == \"Class1\"\n    assert (\n        inst.extension[0].extension[1].extension[0].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"name\"}).valueUri\n    )\n    assert inst.extension[0].extension[1].extension[0].valueString == \"attribute1\"\n    assert (\n        inst.extension[0].extension[1].extension[1].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"minOccurs\"}).valueUri\n    )\n    assert inst.extension[0].extension[1].extension[1].valueInteger == 1\n    assert (\n        inst.extension[0].extension[1].extension[2].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"maxOccurs\"}).valueUri\n    )\n    assert inst.extension[0].extension[1].extension[2].valueCode == \"*\"\n    assert (\n        inst.extension[0].extension[1].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"attribute\"}).valueUri\n    )\n    assert (\n        inst.extension[0].extension[2].extension[0].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"name\"}).valueUri\n    )\n    assert inst.extension[0].extension[2].extension[0].valueString == \"attribute2\"\n    assert (\n        inst.extension[0].extension[2].extension[1].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"minOccurs\"}).valueUri\n    )\n    assert inst.extension[0].extension[2].extension[1].valueInteger == 0\n    assert (\n        inst.extension[0].extension[2].extension[2].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"maxOccurs\"}).valueUri\n    )\n    assert inst.extension[0].extension[2].extension[2].valueInteger == 1\n    assert (\n        inst.extension[0].extension[2].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"attribute\"}).valueUri\n    )\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/do-not-use/fhir-extensions/UMLclass\"}\n        ).valueUri\n    )\n    assert inst.id == \"classModel\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_basic_1(base_settings):\n    \"\"\"No. 1 tests collection for Basic.\n    Test File: basic-example2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"basic-example2.json\"\n    inst = basic.Basic.model_validate_json(filename.read_bytes())\n    assert \"Basic\" == inst.get_resource_type()\n\n    impl_basic_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Basic\" == data[\"resourceType\"]\n\n    inst2 = basic.Basic(**data)\n    impl_basic_1(inst2)\n\n\ndef impl_basic_2(inst):\n    assert inst.code.text == \"Example Narrative Tester\"\n    assert inst.id == \"basic-example-narrative\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"additional\"\n\n\ndef test_basic_2(base_settings):\n    \"\"\"No. 2 tests collection for Basic.\n    Test File: basic-example-narrative.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"basic-example-narrative.json\"\n    inst = basic.Basic.model_validate_json(filename.read_bytes())\n    assert \"Basic\" == inst.get_resource_type()\n\n    impl_basic_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Basic\" == data[\"resourceType\"]\n\n    inst2 = basic.Basic(**data)\n    impl_basic_2(inst2)\n\n\ndef impl_basic_3(inst):\n    assert inst.author.reference == \"Practitioner/example\"\n    assert inst.code.coding[0].code == \"referral\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/basic-resource-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2013-05-14\"}).valueDate\n    )\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/do-not-use/fhir-extensions/referral#requestingPractitioner\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueReference.display == \"Dokter Bronsig\"\n    assert inst.extension[0].valueReference.reference == \"Practitioner/f201\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/do-not-use/fhir-extensions/referral#notes\"}\n        ).valueUri\n    )\n    assert inst.extension[1].valueString == (\n        \"The patient had fever peaks over the last couple of days. He\"\n        \" is worried about these peaks.\"\n    )\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/do-not-use/fhir-extensions/referral#fulfillingEncounter\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueReference.reference == \"Encounter/f201\"\n    assert inst.id == \"referral\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealth.org/basic/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"19283746\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.modifierExtension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/do-not-use/fhir-extensions/referral#referredForService\"\n            }\n        ).valueUri\n    )\n    assert inst.modifierExtension[0].valueCodeableConcept.coding[0].code == \"11429006\"\n    assert (\n        inst.modifierExtension[0].valueCodeableConcept.coding[0].display\n        == \"Consultation\"\n    )\n    assert (\n        inst.modifierExtension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.modifierExtension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/do-not-use/fhir-extensions/referral#targetDate\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.modifierExtension[1].valuePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.modifierExtension[1].valuePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.modifierExtension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/do-not-use/fhir-extensions/referral#status\"\n            }\n        ).valueUri\n    )\n    assert inst.modifierExtension[2].valueCode == \"complete\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_basic_3(base_settings):\n    \"\"\"No. 3 tests collection for Basic.\n    Test File: basic-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"basic-example.json\"\n    inst = basic.Basic.model_validate_json(filename.read_bytes())\n    assert \"Basic\" == inst.get_resource_type()\n\n    impl_basic_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Basic\" == data[\"resourceType\"]\n\n    inst2 = basic.Basic(**data)\n    impl_basic_3(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_binary.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Binary\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import binary\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_binary_1(inst):\n    assert inst.contentType == \"application/pdf\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.securityContext.reference == \"DocumentReference/example\"\n\n\ndef test_binary_1(base_settings):\n    \"\"\"No. 1 tests collection for Binary.\n    Test File: binary-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"binary-example.json\"\n    inst = binary.Binary.model_validate_json(filename.read_bytes())\n    assert \"Binary\" == inst.get_resource_type()\n\n    impl_binary_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Binary\" == data[\"resourceType\"]\n\n    inst2 = binary.Binary(**data)\n    impl_binary_1(inst2)\n\n\ndef impl_binary_2(inst):\n    assert inst.contentType == \"image/jpeg\"\n    assert inst.id == \"f006\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n\n\ndef test_binary_2(base_settings):\n    \"\"\"No. 2 tests collection for Binary.\n    Test File: binary-f006.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"binary-f006.json\"\n    inst = binary.Binary.model_validate_json(filename.read_bytes())\n    assert \"Binary\" == inst.get_resource_type()\n\n    impl_binary_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Binary\" == data[\"resourceType\"]\n\n    inst2 = binary.Binary(**data)\n    impl_binary_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_biologicallyderivedproduct.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import biologicallyderivedproduct\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_biologicallyderivedproduct_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_biologicallyderivedproduct_1(base_settings):\n    \"\"\"No. 1 tests collection for BiologicallyDerivedProduct.\n    Test File: biologicallyderivedproduct-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"biologicallyderivedproduct-example.json\"\n    )\n    inst = biologicallyderivedproduct.BiologicallyDerivedProduct.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"BiologicallyDerivedProduct\" == inst.get_resource_type()\n\n    impl_biologicallyderivedproduct_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"BiologicallyDerivedProduct\" == data[\"resourceType\"]\n\n    inst2 = biologicallyderivedproduct.BiologicallyDerivedProduct(**data)\n    impl_biologicallyderivedproduct_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_bodystructure.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BodyStructure\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import bodystructure\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_bodystructure_1(inst):\n    assert inst.description == \"EDD 1/1/2017 confirmation by LMP\"\n    assert inst.id == \"fetus\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealth.org/bodystructure/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.location.coding[0].code == \"83418008\"\n    assert inst.location.coding[0].display == \"Entire fetus (body structure)\"\n    assert (\n        inst.location.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.location.text == \"Fetus\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_bodystructure_1(base_settings):\n    \"\"\"No. 1 tests collection for BodyStructure.\n    Test File: bodystructure-example-fetus.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"bodystructure-example-fetus.json\"\n    inst = bodystructure.BodyStructure.model_validate_json(filename.read_bytes())\n    assert \"BodyStructure\" == inst.get_resource_type()\n\n    impl_bodystructure_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"BodyStructure\" == data[\"resourceType\"]\n\n    inst2 = bodystructure.BodyStructure(**data)\n    impl_bodystructure_1(inst2)\n\n\ndef impl_bodystructure_2(inst):\n    assert inst.description == \"7 cm maximum diameter\"\n    assert inst.id == \"tumor\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealth.org/bodystructure/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.image[0].contentType == \"application/dicom\"\n    assert (\n        inst.image[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://imaging.acme.com/wado/server?requestType=WADO&amp;wado_details\"\n            }\n        ).valueUrl\n    )\n    assert inst.location.coding[0].code == \"78961009\"\n    assert inst.location.coding[0].display == \"Splenic structure (body structure)\"\n    assert (\n        inst.location.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.location.text == \"Spleen\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.morphology.coding[0].code == \"4147007\"\n    assert inst.morphology.coding[0].display == \"Mass (morphologic abnormality)\"\n    assert (\n        inst.morphology.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.morphology.text == \"Splenic mass\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_bodystructure_2(base_settings):\n    \"\"\"No. 2 tests collection for BodyStructure.\n    Test File: bodystructure-example-tumor.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"bodystructure-example-tumor.json\"\n    inst = bodystructure.BodyStructure.model_validate_json(filename.read_bytes())\n    assert \"BodyStructure\" == inst.get_resource_type()\n\n    impl_bodystructure_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"BodyStructure\" == data[\"resourceType\"]\n\n    inst2 = bodystructure.BodyStructure(**data)\n    impl_bodystructure_2(inst2)\n\n\ndef impl_bodystructure_3(inst):\n    assert inst.active is False\n    assert inst.description == \"inner surface (volar) of the left forearm\"\n    assert inst.id == \"skin-patch\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealth.org/bodystructure/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.location.coding[0].code == \"14975008\"\n    assert inst.location.coding[0].display == \"Forearm\"\n    assert (\n        inst.location.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.location.text == \"Forearm\"\n    assert inst.locationQualifier[0].coding[0].code == \"419161000\"\n    assert inst.locationQualifier[0].coding[0].display == \"Unilateral left\"\n    assert (\n        inst.locationQualifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.locationQualifier[0].text == \"Left\"\n    assert inst.locationQualifier[1].coding[0].code == \"263929005\"\n    assert inst.locationQualifier[1].coding[0].display == \"Volar\"\n    assert (\n        inst.locationQualifier[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.locationQualifier[1].text == \"Volar\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.morphology.text == \"Skin patch\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_bodystructure_3(base_settings):\n    \"\"\"No. 3 tests collection for BodyStructure.\n    Test File: bodystructure-example-skin-patch.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"bodystructure-example-skin-patch.json\"\n    )\n    inst = bodystructure.BodyStructure.model_validate_json(filename.read_bytes())\n    assert \"BodyStructure\" == inst.get_resource_type()\n\n    impl_bodystructure_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"BodyStructure\" == data[\"resourceType\"]\n\n    inst2 = bodystructure.BodyStructure(**data)\n    impl_bodystructure_3(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_bundle.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Bundle\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import bundle\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_bundle_1(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:d195d9b8-6f78-4d71-9d22-3c1a923bfea5\"}\n        ).valueUri\n    )\n    assert inst.entry[0].request.method == \"GET\"\n    assert (\n        inst.entry[0].request.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"Subscription/123/$status\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"d195d9b8-6f78-4d71-9d22-3c1a923bfea5\"\n    assert inst.entry[0].response.status == \"200\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://example.org/FHIR/R4/Encounter/2\"}\n        ).valueUri\n    )\n    assert inst.entry[1].request.method == \"PUT\"\n    assert (\n        inst.entry[1].request.url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter/2\"}).valueUri\n    )\n    assert inst.entry[1].resource.id == \"2\"\n    assert (\n        inst.entry[1].resource.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-08-07T10:49:22Z\"}\n        ).valueInstant\n    )\n    assert inst.entry[1].resource.meta.versionId == \"1\"\n    assert inst.entry[1].response.status == \"201\"\n    assert inst.id == \"00b99077-2bda-436e-98cc-a4f65d6c2fe0\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.timestamp\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2020-04-17T10:24:13.1882432-05:00\"}\n        ).valueInstant\n    )\n    assert inst.type == \"history\"\n\n\ndef test_bundle_1(base_settings):\n    \"\"\"No. 1 tests collection for Bundle.\n    Test File: notification-full-resource.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"notification-full-resource.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_1(inst2)\n\n\ndef impl_bundle_2(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:2866af9c-137d-4458-a8a9-eeeec0ce5583\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"warning\"\n    assert inst.entry[0].search.mode == \"outcome\"\n    assert inst.id == \"bundle-search-warning\"\n    assert inst.link[0].relation == \"self\"\n    assert (\n        inst.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"https://example.org/fhir/Observation?patient.identifier=http://example.com/fhir/identifier/mrn|123456\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2017-03-14T08:23:30+11:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.total == 0\n    assert inst.type == \"searchset\"\n\n\ndef test_bundle_2(base_settings):\n    \"\"\"No. 2 tests collection for Bundle.\n    Test File: bundle-search-warning.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"bundle-search-warning.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_2(inst2)\n\n\ndef impl_bundle_3(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:dd431176-7bcf-455e-8a0c-50cb15d6263f\"}\n        ).valueUri\n    )\n    assert inst.entry[0].request.method == \"GET\"\n    assert (\n        inst.entry[0].request.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"Subscription/123/$events\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"dd431176-7bcf-455e-8a0c-50cb15d6263f\"\n    assert inst.entry[0].response.status == \"200\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/FHIR/R4B/Encounter/1\"}\n        ).valueUri\n    )\n    assert inst.entry[1].request.method == \"PUT\"\n    assert (\n        inst.entry[1].request.url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter/1\"}).valueUri\n    )\n    assert inst.entry[1].response.status == \"201\"\n    assert (\n        inst.entry[2].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/FHIR/R4B/Encounter/2\"}\n        ).valueUri\n    )\n    assert inst.entry[2].request.method == \"PUT\"\n    assert (\n        inst.entry[2].request.url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter/2\"}).valueUri\n    )\n    assert inst.entry[2].response.status == \"201\"\n    assert inst.id == \"155141d4-7601-46f7-a82b-b8443bcf9883\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.timestamp\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2020-04-17T10:24:13.1882432-05:00\"}\n        ).valueInstant\n    )\n    assert inst.type == \"history\"\n\n\ndef test_bundle_3(base_settings):\n    \"\"\"No. 3 tests collection for Bundle.\n    Test File: notification-id-only-query.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"notification-id-only-query.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_3(inst2)\n\n\ndef impl_bundle_4(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://example.com/base/DiagnosticReport/f202\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"f202\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://example.com/base/ServiceRequest/req\"}\n        ).valueUri\n    )\n    assert inst.entry[1].resource.id == \"req\"\n    assert inst.id == \"f202\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.type == \"collection\"\n\n\ndef test_bundle_4(base_settings):\n    \"\"\"No. 4 tests collection for Bundle.\n    Test File: diagnosticreport-example-f202-bloodculture.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"diagnosticreport-example-f202-bloodculture.json\"\n    )\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_4(inst2)\n\n\ndef impl_bundle_5(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:a5b053d4-2603-446f-ae86-f5853ac09334\"}\n        ).valueUri\n    )\n    assert inst.entry[0].request.method == \"GET\"\n    assert (\n        inst.entry[0].request.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"Subscription/123/$status\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"a5b053d4-2603-446f-ae86-f5853ac09334\"\n    assert inst.entry[0].response.status == \"200\"\n    assert inst.id == \"3d20ea4b-90dc-4d0d-b15a-c7a893389401\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.timestamp\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2020-04-17T10:24:13.1882432-05:00\"}\n        ).valueInstant\n    )\n    assert inst.type == \"history\"\n\n\ndef test_bundle_5(base_settings):\n    \"\"\"No. 5 tests collection for Bundle.\n    Test File: notification-heartbeat.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"notification-heartbeat.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_5(inst2)\n\n\ndef impl_bundle_6(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:d9d296d8-5afd-42e1-a0ce-3344e0e003ed\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"caf609cf-c3a7-4be3-a3aa-356b9bb69d4f\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:03f9aa7d-b395-47b9-84e0-053678b6e4e3\"}\n        ).valueUri\n    )\n    assert inst.entry[1].resource.id == \"03f9aa7d-b395-47b9-84e0-053678b6e4e3\"\n    assert (\n        inst.entry[2].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ehr/fhir/Patient/pat1\"}\n        ).valueUri\n    )\n    assert inst.entry[2].resource.id == \"pat1\"\n    assert (\n        inst.entry[3].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ehr/fhir/Patient/pat12\"}\n        ).valueUri\n    )\n    assert inst.entry[3].resource.id == \"pat2\"\n    assert inst.id == \"3a0707d3-549e-4467-b8b8-5a2ab3800efe\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.timestamp\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-07-14T11:15:33+10:00\"}\n        ).valueInstant\n    )\n    assert inst.type == \"message\"\n\n\ndef test_bundle_6(base_settings):\n    \"\"\"No. 6 tests collection for Bundle.\n    Test File: message-response-link.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"message-response-link.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_6(inst2)\n\n\ndef impl_bundle_7(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:3fdc72f4-a11d-4a9d-9260-a9f745779e1d\"}\n        ).valueUri\n    )\n    assert inst.entry[0].request.method == \"POST\"\n    assert (\n        inst.entry[0].request.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"DocumentReference\"}\n        ).valueUri\n    )\n    assert (\n        inst.entry[0].resource.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-07-01T13:11:33Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://localhost:9556/svc/fhir/Patient/a2\"}\n        ).valueUri\n    )\n    assert (\n        inst.entry[1].request.ifNoneExist\n        == \"Patient?identifier=http://acme.org/xds/patients!89765a87b\"\n    )\n    assert inst.entry[1].request.method == \"POST\"\n    assert (\n        inst.entry[1].request.url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.entry[1].resource.id == \"a2\"\n    assert (\n        inst.entry[1].resource.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-07-01T13:11:33Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.entry[2].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://localhost:9556/svc/fhir/Practitioner/a3\"}\n        ).valueUri\n    )\n    assert inst.entry[2].request.method == \"POST\"\n    assert (\n        inst.entry[2].request.url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Practitioner\"}).valueUri\n    )\n    assert inst.entry[2].resource.id == \"a3\"\n    assert (\n        inst.entry[2].resource.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-07-01T13:11:33Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.entry[3].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://localhost:9556/svc/fhir/Practitioner/a4\"}\n        ).valueUri\n    )\n    assert inst.entry[3].request.method == \"POST\"\n    assert (\n        inst.entry[3].request.url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Practitioner\"}).valueUri\n    )\n    assert inst.entry[3].resource.id == \"a4\"\n    assert (\n        inst.entry[3].resource.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-07-01T13:11:33Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.entry[4].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://localhost:9556/svc/fhir/Binary/1e404af3-077f-4bee-b7a6-a9be97e1ce32\"\n            }\n        ).valueUri\n    )\n    assert inst.entry[4].request.method == \"POST\"\n    assert (\n        inst.entry[4].request.url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Binary\"}).valueUri\n    )\n    assert inst.entry[4].resource.id == \"1e404af3-077f-4bee-b7a6-a9be97e1ce32\"\n    assert (\n        inst.entry[4].resource.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-07-01T13:11:33Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"xds\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-07-01T13:11:33Z\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.type == \"transaction\"\n\n\ndef test_bundle_7(base_settings):\n    \"\"\"No. 7 tests collection for Bundle.\n    Test File: xds-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"xds-example.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_7(inst2)\n\n\ndef impl_bundle_8(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/DomainResource-text\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"DomainResource-text\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-content\"}\n        ).valueUri\n    )\n    assert inst.entry[1].resource.id == \"Resource-content\"\n    assert (\n        inst.entry[2].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-filter\"}\n        ).valueUri\n    )\n    assert inst.entry[2].resource.id == \"Resource-filter\"\n    assert (\n        inst.entry[3].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-has\"}\n        ).valueUri\n    )\n    assert inst.entry[3].resource.id == \"Resource-has\"\n    assert (\n        inst.entry[4].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-id\"}\n        ).valueUri\n    )\n    assert inst.entry[4].resource.id == \"Resource-id\"\n    assert (\n        inst.entry[5].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-lastUpdated\"}\n        ).valueUri\n    )\n    assert inst.entry[5].resource.id == \"Resource-lastUpdated\"\n    assert (\n        inst.entry[6].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-list\"}\n        ).valueUri\n    )\n    assert inst.entry[6].resource.id == \"Resource-list\"\n    assert (\n        inst.entry[7].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-profile\"}\n        ).valueUri\n    )\n    assert inst.entry[7].resource.id == \"Resource-profile\"\n    assert (\n        inst.entry[8].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-query\"}\n        ).valueUri\n    )\n    assert inst.entry[8].resource.id == \"Resource-query\"\n    assert (\n        inst.entry[9].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-security\"}\n        ).valueUri\n    )\n    assert inst.entry[9].resource.id == \"Resource-security\"\n    assert inst.id == \"searchParams\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T12:47:40.239+10:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.type == \"collection\"\n\n\ndef test_bundle_8(base_settings):\n    \"\"\"No. 8 tests collection for Bundle.\n    Test File: search-parameters.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"search-parameters.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_8(inst2)\n\n\ndef impl_bundle_9(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:267b18ce-3d37-4581-9baa-6fada338038b\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"267b18ce-3d37-4581-9baa-6fada338038b\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ehr/fhir/Patient/pat1\"}\n        ).valueUri\n    )\n    assert inst.entry[1].resource.id == \"pat1\"\n    assert (\n        inst.entry[2].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ehr/fhir/Patient/pat12\"}\n        ).valueUri\n    )\n    assert inst.entry[2].resource.id == \"pat2\"\n    assert inst.id == \"10bb101f-a121-4264-a920-67be9cb82c74\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.timestamp\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-07-14T11:15:33+10:00\"}\n        ).valueInstant\n    )\n    assert inst.type == \"message\"\n\n\ndef test_bundle_9(base_settings):\n    \"\"\"No. 9 tests collection for Bundle.\n    Test File: message-request-link.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"message-request-link.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_9(inst2)\n\n\ndef impl_bundle_10(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-sct\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"tx-sct\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-rxnorm\"}\n        ).valueUri\n    )\n    assert inst.entry[1].resource.id == \"tx-rxnorm\"\n    assert (\n        inst.entry[2].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-loinc\"}\n        ).valueUri\n    )\n    assert inst.entry[2].resource.id == \"tx-loinc\"\n    assert (\n        inst.entry[3].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-ucum\"}\n        ).valueUri\n    )\n    assert inst.entry[3].resource.id == \"tx-ucum\"\n    assert (\n        inst.entry[4].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-nci\"}\n        ).valueUri\n    )\n    assert inst.entry[4].resource.id == \"tx-nci\"\n    assert (\n        inst.entry[5].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-cpt\"}\n        ).valueUri\n    )\n    assert inst.entry[5].resource.id == \"tx-cpt\"\n    assert (\n        inst.entry[6].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-ndf-rt\"}\n        ).valueUri\n    )\n    assert inst.entry[6].resource.id == \"tx-ndf-rt\"\n    assert (\n        inst.entry[7].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-unii\"}\n        ).valueUri\n    )\n    assert inst.entry[7].resource.id == \"tx-unii\"\n    assert (\n        inst.entry[8].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-ndc\"}\n        ).valueUri\n    )\n    assert inst.entry[8].resource.id == \"tx-ndc\"\n    assert (\n        inst.entry[9].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-cvx\"}\n        ).valueUri\n    )\n    assert inst.entry[9].resource.id == \"tx-cvx\"\n    assert inst.id == \"terminologies\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.type == \"collection\"\n\n\ndef test_bundle_10(base_settings):\n    \"\"\"No. 10 tests collection for Bundle.\n    Test File: namingsystem-terminologies.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"namingsystem-terminologies.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_capabilitystatement.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import capabilitystatement\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_capabilitystatement_1(inst):\n    assert inst.contact[0].name == \"System Administrator\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].value == \"wile@acme.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Sample capability statement showing new MessageDefinition \" \"structure\"\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"4.3.0\"\n    assert inst.format[0] == \"xml\"\n    assert inst.format[1] == \"json\"\n    assert inst.id == \"messagedefinition\"\n    assert inst.implementation.description == \"Acme Message endpoint\"\n    assert (\n        inst.implementation.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://acem.com/fhir/message-drop\"}\n        ).valueUrl\n    )\n    assert inst.kind == \"instance\"\n    assert (\n        inst.messaging[0].documentation\n        == \"ADT A08 equivalent for external system notifications\"\n    )\n    assert (\n        inst.messaging[0].endpoint[0].address\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"mllp:10.1.1.10:9234\"}\n        ).valueUrl\n    )\n    assert inst.messaging[0].endpoint[0].protocol.code == \"mllp\"\n    assert (\n        inst.messaging[0].endpoint[0].protocol.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/message-transport\"}\n        ).valueUri\n    )\n    assert inst.messaging[0].reliableCache == 30\n    assert (\n        inst.messaging[0].supportedMessage[0].definition\n        == \"http://hl7.org/fhir/MessageDefinition/example\"\n    )\n    assert inst.messaging[0].supportedMessage[0].mode == \"receiver\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"ACME Corporation\"\n    assert inst.software.name == \"EHR\"\n    assert inst.status == \"draft\"\n\n\ndef test_capabilitystatement_1(base_settings):\n    \"\"\"No. 1 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-messagedefinition.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"capabilitystatement-messagedefinition.json\"\n    )\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_1(inst2)\n\n\ndef impl_capabilitystatement_2(inst):\n    assert inst.contact[0].name == \"System Administrator\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].value == \"wile@acme.org\"\n    assert inst.copyright == \"Copyright © Acme Healthcare and GoodCorp EHR Systems\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This is the FHIR capability statement for the main EHR at \"\n        \"ACME for the private interface - it does not describe the \"\n        \"public interface\"\n    )\n    assert (\n        inst.document[0].documentation\n        == \"Basic rules for all documents in the EHR system\"\n    )\n    assert inst.document[0].mode == \"consumer\"\n    assert inst.document[0].profile == (\n        \"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-\"\n        \"838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\"\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"4.3.0\"\n    assert inst.format[0] == \"xml\"\n    assert inst.format[1] == \"json\"\n    assert inst.id == \"example\"\n    assert inst.implementation.description == \"main EHR at ACME\"\n    assert (\n        inst.implementation.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://10.2.3.4/fhir\"}\n        ).valueUrl\n    )\n    assert inst.implementationGuide[0] == \"http://hl7.org/fhir/us/lab\"\n    assert inst.instantiates[0] == \"http://ihe.org/fhir/CapabilityStatement/pixm-client\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.kind == \"instance\"\n    assert (\n        inst.messaging[0].documentation\n        == \"ADT A08 equivalent for external system notifications\"\n    )\n    assert (\n        inst.messaging[0].endpoint[0].address\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"mllp:10.1.1.10:9234\"}\n        ).valueUrl\n    )\n    assert inst.messaging[0].endpoint[0].protocol.code == \"mllp\"\n    assert (\n        inst.messaging[0].endpoint[0].protocol.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/message-transport\"}\n        ).valueUri\n    )\n    assert inst.messaging[0].reliableCache == 30\n    assert (\n        inst.messaging[0].supportedMessage[0].definition\n        == \"http://hl7.org/fhir/MessageDefinition/example\"\n    )\n    assert inst.messaging[0].supportedMessage[0].mode == \"receiver\"\n    assert inst.name == \"ACME-EHR\"\n    assert inst.patchFormat[0] == \"application/xml-patch+xml\"\n    assert inst.patchFormat[1] == \"application/json-patch+json\"\n    assert inst.publisher == \"ACME Corporation\"\n    assert inst.purpose == (\n        \"Main EHR capability statement, published for contracting and\"\n        \" operational support\"\n    )\n    assert (\n        inst.rest[0].compartment[0]\n        == \"http://hl7.org/fhir/CompartmentDefinition/patient\"\n    )\n    assert inst.rest[0].documentation == \"Main FHIR endpoint for acem health\"\n    assert inst.rest[0].interaction[0].code == \"transaction\"\n    assert inst.rest[0].interaction[1].code == \"history-system\"\n    assert inst.rest[0].mode == \"server\"\n    assert inst.rest[0].resource[0].conditionalCreate is True\n    assert inst.rest[0].resource[0].conditionalDelete == \"not-supported\"\n    assert inst.rest[0].resource[0].conditionalRead == \"full-support\"\n    assert inst.rest[0].resource[0].conditionalUpdate is False\n    assert (\n        inst.rest[0].resource[0].documentation\n        == \"This server does not let the clients create identities.\"\n    )\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[0].interaction[1].code == \"vread\"\n    assert (\n        inst.rest[0].resource[0].interaction[1].documentation\n        == \"Only supported for patient records since 12-Dec 2012\"\n    )\n    assert inst.rest[0].resource[0].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[0].interaction[3].code == \"history-instance\"\n    assert inst.rest[0].resource[0].interaction[4].code == \"create\"\n    assert inst.rest[0].resource[0].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[0].profile == (\n        \"http://registry.fhir.org/r4/StructureDefinition/7896271d-\"\n        \"57f6-4231-89dc-dcc91eab2416\"\n    )\n    assert inst.rest[0].resource[0].readHistory is True\n    assert inst.rest[0].resource[0].searchInclude[0] == \"Organization\"\n    assert (\n        inst.rest[0].resource[0].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Patient-identifier\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[0].documentation\n        == \"Only supports search by institution MRN\"\n    )\n    assert inst.rest[0].resource[0].searchParam[0].name == \"identifier\"\n    assert inst.rest[0].resource[0].searchParam[0].type == \"token\"\n    assert inst.rest[0].resource[0].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/Patient-general-\" \"practitioner\"\n    )\n    assert inst.rest[0].resource[0].searchParam[1].name == \"general-practitioner\"\n    assert inst.rest[0].resource[0].searchParam[1].type == \"reference\"\n    assert inst.rest[0].resource[0].searchRevInclude[0] == \"Person\"\n    assert inst.rest[0].resource[0].supportedProfile[0] == (\n        \"http://registry.fhir.org/r4/StructureDefinition/00ab9e7a-\"\n        \"06c7-4f77-9234-4154ca1e3347\"\n    )\n    assert inst.rest[0].resource[0].type == \"Patient\"\n    assert inst.rest[0].resource[0].updateCreate is False\n    assert inst.rest[0].resource[0].versioning == \"versioned-update\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.description == \"See Smart on FHIR documentation\"\n    assert inst.rest[0].security.service[0].coding[0].code == \"SMART-on-FHIR\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/restful-security-service\"\n            }\n        ).valueUri\n    )\n    assert inst.software.name == \"EHR\"\n    assert (\n        inst.software.releaseDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04\"}\n        ).valueDateTime\n    )\n    assert inst.software.version == \"0.00.020.2134\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"ACME EHR capability statement\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"positive\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variant-state\"}\n        ).valueUri\n    )\n    assert inst.version == \"20130510\"\n\n\ndef test_capabilitystatement_2(base_settings):\n    \"\"\"No. 2 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"capabilitystatement-example.json\"\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_2(inst2)\n\n\ndef impl_capabilitystatement_3(inst):\n    assert inst.contact[0].name == \"FHIR Project\"\n    assert inst.contact[0].telecom[0].system == \"other\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-09-16\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Basic conformance statement for a Measure Processor Service.\"\n        \" A server can support more functionality    than defined \"\n        \"here, but this is the minimum amount\"\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"4.3.0\"\n    assert inst.format[0] == \"json\"\n    assert inst.format[1] == \"xml\"\n    assert inst.id == \"measure-processor\"\n    assert inst.kind == \"capability\"\n    assert inst.name == \"Measure Processor Service Conformance Statement\"\n    assert inst.publisher == \"HL7, Inc\"\n    assert inst.rest[0].documentation == \"RESTful Measure Processor Service\"\n    assert inst.rest[0].mode == \"server\"\n    assert inst.rest[0].operation[0].definition == (\n        \"http://hl7.org/fhir/OperationDefinition/Measure-evaluate-\" \"measure\"\n    )\n    assert inst.rest[0].operation[0].name == \"evaluate-measure\"\n    assert inst.rest[0].operation[1].definition == (\n        \"http://hl7.org/fhir/OperationDefinition/Measure-data-\" \"requirements\"\n    )\n    assert inst.rest[0].operation[1].name == \"data-requirements\"\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[0].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \" \"measures\"\n    )\n    assert inst.rest[0].resource[0].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[0].interaction[1].documentation == (\n        \"Search allows clients to filter measures based on a provided\"\n        \" search parameter\"\n    )\n    assert (\n        inst.rest[0].resource[0].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Measure\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-identifier\"\n    )\n    assert inst.rest[0].resource[0].searchParam[0].name == \"identifier\"\n    assert inst.rest[0].resource[0].searchParam[0].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-status\"\n    )\n    assert inst.rest[0].resource[0].searchParam[1].name == \"status\"\n    assert inst.rest[0].resource[0].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-version\"\n    )\n    assert inst.rest[0].resource[0].searchParam[2].name == \"version\"\n    assert inst.rest[0].resource[0].searchParam[2].type == \"token\"\n    assert inst.rest[0].resource[0].type == \"Measure\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.service[0].coding[0].code == \"Certificates\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/restful-security-service\"\n            }\n        ).valueUri\n    )\n    assert inst.software.name == \"ACME Measure Processor Service\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/measure-processor\"}\n        ).valueUri\n    )\n\n\ndef test_capabilitystatement_3(base_settings):\n    \"\"\"No. 3 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-measure-processor.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"capabilitystatement-measure-processor.json\"\n    )\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_3(inst2)\n\n\ndef impl_capabilitystatement_4(inst):\n    assert inst.contact[0].name == \"FHIR Project\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-07-05\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Basic capability statement for a Terminology Server. A \"\n        \"server can support more fucntionality than defined here, but\"\n        \" this is the minimum amount\"\n    )\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-supported-system\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.extension[0].valueUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.fhirVersion == \"4.3.0\"\n    assert inst.format[0] == \"json\"\n    assert inst.format[1] == \"xml\"\n    assert inst.id == \"terminology-server\"\n    assert inst.kind == \"capability\"\n    assert inst.name == \"Terminology Service Capability Statement\"\n    assert inst.publisher == \"HL7, Inc\"\n    assert inst.rest[0].documentation == \"RESTful Terminology Server\"\n    assert inst.rest[0].mode == \"server\"\n    assert (\n        inst.rest[0].operation[0].definition\n        == \"http://hl7.org/fhir/OperationDefinition/ValueSet-expand\"\n    )\n    assert (\n        inst.rest[0].operation[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].operation[0].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].operation[0].name == \"expand\"\n    assert (\n        inst.rest[0].operation[1].definition\n        == \"http://hl7.org/fhir/OperationDefinition/CodeSystem-lookup\"\n    )\n    assert (\n        inst.rest[0].operation[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].operation[1].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].operation[1].name == \"lookup\"\n    assert inst.rest[0].operation[2].definition == (\n        \"http://hl7.org/fhir/OperationDefinition/ValueSet-validate-\" \"code\"\n    )\n    assert (\n        inst.rest[0].operation[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].operation[2].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].operation[2].name == \"validate-code\"\n    assert (\n        inst.rest[0].operation[3].definition\n        == \"http://hl7.org/fhir/OperationDefinition/ConceptMap-translate\"\n    )\n    assert (\n        inst.rest[0].operation[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].operation[3].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].operation[3].name == \"translate\"\n    assert (\n        inst.rest[0].operation[4].definition\n        == \"http://hl7.org/fhir/OperationDefinition/ConceptMap-closure\"\n    )\n    assert (\n        inst.rest[0].operation[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].operation[4].extension[0].valueCode == \"SHOULD\"\n    assert inst.rest[0].operation[4].name == \"closure\"\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[0].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \" \"value sets\"\n    )\n    assert (\n        inst.rest[0].resource[0].interaction[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[0].interaction[0].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].resource[0].interaction[1].code == \"search-type\"\n    assert (\n        inst.rest[0].resource[0].interaction[1].documentation\n        == \"Search allows clients to find value sets on the server\"\n    )\n    assert (\n        inst.rest[0].resource[0].interaction[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[0].interaction[1].extension[0].valueCode == \"SHALL\"\n    assert (\n        inst.rest[0].resource[0].profile\n        == \"http://hl7.org/fhir/StructureDefinition/ValueSet\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/ValueSet-date\"\n    )\n    assert inst.rest[0].resource[0].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[0].searchParam[0].type == \"date\"\n    assert (\n        inst.rest[0].resource[0].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/ValueSet-name\"\n    )\n    assert inst.rest[0].resource[0].searchParam[1].name == \"name\"\n    assert inst.rest[0].resource[0].searchParam[1].type == \"string\"\n    assert (\n        inst.rest[0].resource[0].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/ValueSet-reference\"\n    )\n    assert inst.rest[0].resource[0].searchParam[2].name == \"reference\"\n    assert inst.rest[0].resource[0].searchParam[2].type == \"uri\"\n    assert (\n        inst.rest[0].resource[0].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/ValueSet-status\"\n    )\n    assert inst.rest[0].resource[0].searchParam[3].name == \"status\"\n    assert inst.rest[0].resource[0].searchParam[3].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/ValueSet-url\"\n    )\n    assert inst.rest[0].resource[0].searchParam[4].name == \"url\"\n    assert inst.rest[0].resource[0].searchParam[4].type == \"uri\"\n    assert (\n        inst.rest[0].resource[0].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/ValueSet-version\"\n    )\n    assert inst.rest[0].resource[0].searchParam[5].name == \"version\"\n    assert inst.rest[0].resource[0].searchParam[5].type == \"token\"\n    assert inst.rest[0].resource[0].type == \"ValueSet\"\n    assert inst.rest[0].resource[1].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[1].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \" \"concept maps\"\n    )\n    assert (\n        inst.rest[0].resource[1].interaction[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[1].interaction[0].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].resource[1].interaction[1].code == \"search-type\"\n    assert (\n        inst.rest[0].resource[1].interaction[1].documentation\n        == \"Search allows clients to find concept maps on the server\"\n    )\n    assert (\n        inst.rest[0].resource[1].interaction[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[1].interaction[1].extension[0].valueCode == \"SHALL\"\n    assert (\n        inst.rest[0].resource[1].profile\n        == \"http://hl7.org/fhir/StructureDefinition/ConceptMap\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/ConceptMap-date\"\n    )\n    assert inst.rest[0].resource[1].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[1].searchParam[0].type == \"date\"\n    assert (\n        inst.rest[0].resource[1].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/ConceptMap-name\"\n    )\n    assert inst.rest[0].resource[1].searchParam[1].name == \"name\"\n    assert inst.rest[0].resource[1].searchParam[1].type == \"string\"\n    assert (\n        inst.rest[0].resource[1].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/ConceptMap-status\"\n    )\n    assert inst.rest[0].resource[1].searchParam[2].name == \"status\"\n    assert inst.rest[0].resource[1].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[1].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/ConceptMap-source\"\n    )\n    assert inst.rest[0].resource[1].searchParam[3].name == \"source\"\n    assert inst.rest[0].resource[1].searchParam[3].type == \"reference\"\n    assert (\n        inst.rest[0].resource[1].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/ConceptMap-target\"\n    )\n    assert inst.rest[0].resource[1].searchParam[4].name == \"target\"\n    assert inst.rest[0].resource[1].searchParam[4].type == \"reference\"\n    assert (\n        inst.rest[0].resource[1].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/ConceptMap-url\"\n    )\n    assert inst.rest[0].resource[1].searchParam[5].name == \"url\"\n    assert inst.rest[0].resource[1].searchParam[5].type == \"uri\"\n    assert (\n        inst.rest[0].resource[1].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/ConceptMap-version\"\n    )\n    assert inst.rest[0].resource[1].searchParam[6].name == \"version\"\n    assert inst.rest[0].resource[1].searchParam[6].type == \"token\"\n    assert inst.rest[0].resource[1].type == \"ConceptMap\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.service[0].coding[0].code == \"Certificates\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/restful-security-service\"\n            }\n        ).valueUri\n    )\n    assert inst.software.name == \"ACME Terminology Server\"\n    assert inst.status == \"draft\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/terminology-server\"}\n        ).valueUri\n    )\n\n\ndef test_capabilitystatement_4(base_settings):\n    \"\"\"No. 4 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-terminology-server.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"capabilitystatement-terminology-server.json\"\n    )\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_4(inst2)\n\n\ndef impl_capabilitystatement_5(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"4.3.0\"\n    assert inst.format[0] == \"xml\"\n    assert inst.format[1] == \"json\"\n    assert inst.id == \"base2\"\n    assert inst.kind == \"capability\"\n    assert inst.name == \"Base FHIR Capability Statement (Empty)\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.rest[0].documentation == \"An empty Capability Statement\"\n    assert inst.rest[0].mode == \"server\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.description == (\n        \"This is the Capability Statement to declare that the server \"\n        \"supports SMART-on-FHIR. See the SMART-on-FHIR docs for the \"\n        \"extension that would go with such a server\"\n    )\n    assert inst.rest[0].security.service[0].coding[0].code == \"SMART-on-FHIR\"\n    assert inst.rest[0].security.service[0].coding[0].display == \"SMART-on-FHIR\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/restful-security-service\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].security.service[0].text == \"See http://docs.smarthealthit.org/\"\n    assert inst.software.name == \"Insert your software name here...\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CapabilityStatement/base2\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_capabilitystatement_5(base_settings):\n    \"\"\"No. 5 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-base2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"capabilitystatement-base2.json\"\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_5(inst2)\n\n\ndef impl_capabilitystatement_6(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-06-18\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Prototype Capability Statement for September 2013 \" \"Connectathon\"\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"4.3.0\"\n    assert inst.format[0] == \"json\"\n    assert inst.format[1] == \"xml\"\n    assert inst.id == \"phr\"\n    assert inst.kind == \"capability\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"PHR Template\"\n    assert inst.publisher == \"FHIR Project\"\n    assert inst.rest[0].documentation == (\n        \"Protoype server Capability Statement for September 2013 \" \"Connectathon\"\n    )\n    assert inst.rest[0].mode == \"server\"\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[0].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[0].interaction[1].documentation == (\n        \"When a client searches patients with no search criteria, \"\n        \"they get a list of all patients they have access too. \"\n        \"Servers may elect to offer additional search parameters, but\"\n        \" this is not required\"\n    )\n    assert inst.rest[0].resource[0].type == \"Patient\"\n    assert inst.rest[0].resource[1].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[1].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[1].searchParam[0].documentation == (\n        \"_id parameter always supported. For the connectathon, \"\n        \"servers may elect which search parameters are supported\"\n    )\n    assert inst.rest[0].resource[1].searchParam[0].name == \"_id\"\n    assert inst.rest[0].resource[1].searchParam[0].type == \"token\"\n    assert inst.rest[0].resource[1].type == \"DocumentReference\"\n    assert inst.rest[0].resource[2].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[2].interaction[1].code == \"search-type\"\n    assert (\n        inst.rest[0].resource[2].searchParam[0].documentation\n        == \"Standard _id parameter\"\n    )\n    assert inst.rest[0].resource[2].searchParam[0].name == \"_id\"\n    assert inst.rest[0].resource[2].searchParam[0].type == \"token\"\n    assert inst.rest[0].resource[2].type == \"Condition\"\n    assert inst.rest[0].resource[3].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[3].interaction[1].code == \"search-type\"\n    assert (\n        inst.rest[0].resource[3].searchParam[0].documentation\n        == \"Standard _id parameter\"\n    )\n    assert inst.rest[0].resource[3].searchParam[0].name == \"_id\"\n    assert inst.rest[0].resource[3].searchParam[0].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[1].documentation\n        == \"which diagnostic discipline/department created the report\"\n    )\n    assert inst.rest[0].resource[3].searchParam[1].name == \"service\"\n    assert inst.rest[0].resource[3].searchParam[1].type == \"token\"\n    assert inst.rest[0].resource[3].type == \"DiagnosticReport\"\n    assert inst.rest[0].security.service[0].text == \"OAuth\"\n    assert inst.software.name == \"ACME PHR Server\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_capabilitystatement_6(base_settings):\n    \"\"\"No. 6 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-phr-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"capabilitystatement-phr-example.json\"\n    )\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_6(inst2)\n\n\ndef impl_capabilitystatement_7(inst):\n    assert inst.contact[0].name == \"FHIR Project\"\n    assert inst.contact[0].telecom[0].system == \"other\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-25\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Basic conformance statement for a Knowledge Repository \"\n        \"Service. A server can support more functionality    than \"\n        \"defined here, but this is the minimum amount\"\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"4.3.0\"\n    assert inst.format[0] == \"json\"\n    assert inst.format[1] == \"xml\"\n    assert inst.id == \"knowledge-repository\"\n    assert inst.kind == \"capability\"\n    assert inst.name == \"Knowledge Repository Service Conformance Statement\"\n    assert inst.publisher == \"HL7, Inc\"\n    assert inst.rest[0].documentation == \"RESTful Knowledge Repository Service\"\n    assert inst.rest[0].mode == \"server\"\n    assert inst.rest[0].operation[0].definition == (\n        \"http://hl7.org/fhir/OperationDefinition/Library-data-\" \"requirements\"\n    )\n    assert inst.rest[0].operation[0].name == \"data-requirements\"\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[0].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \" \"libraries\"\n    )\n    assert inst.rest[0].resource[0].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[0].interaction[1].documentation == (\n        \"Search allows clients to filter libraries based on a \"\n        \"provided search parameter\"\n    )\n    assert (\n        inst.rest[0].resource[0].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Library\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-description\"\n    )\n    assert inst.rest[0].resource[0].searchParam[0].name == \"description\"\n    assert inst.rest[0].resource[0].searchParam[0].type == \"string\"\n    assert (\n        inst.rest[0].resource[0].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-identifier\"\n    )\n    assert inst.rest[0].resource[0].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[0].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-status\"\n    )\n    assert inst.rest[0].resource[0].searchParam[2].name == \"status\"\n    assert inst.rest[0].resource[0].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-title\"\n    )\n    assert inst.rest[0].resource[0].searchParam[3].name == \"title\"\n    assert inst.rest[0].resource[0].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[0].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-topic\"\n    )\n    assert inst.rest[0].resource[0].searchParam[4].name == \"topic\"\n    assert inst.rest[0].resource[0].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-version\"\n    )\n    assert inst.rest[0].resource[0].searchParam[5].name == \"version\"\n    assert inst.rest[0].resource[0].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-composed-of\"\n    )\n    assert inst.rest[0].resource[0].searchParam[6].name == \"composed-of\"\n    assert inst.rest[0].resource[0].searchParam[6].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-depends-on\"\n    )\n    assert inst.rest[0].resource[0].searchParam[7].name == \"depends-on\"\n    assert inst.rest[0].resource[0].searchParam[7].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-derived-from\"\n    )\n    assert inst.rest[0].resource[0].searchParam[8].name == \"derived-from\"\n    assert inst.rest[0].resource[0].searchParam[8].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-predecessor\"\n    )\n    assert inst.rest[0].resource[0].searchParam[9].name == \"predecessor\"\n    assert inst.rest[0].resource[0].searchParam[9].type == \"reference\"\n    assert inst.rest[0].resource[0].type == \"Library\"\n    assert inst.rest[0].resource[1].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[1].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \" \"plan definitions\"\n    )\n    assert inst.rest[0].resource[1].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[1].interaction[1].documentation == (\n        \"Search allows clients to filter plan definitions based on a \"\n        \"provided search parameter\"\n    )\n    assert (\n        inst.rest[0].resource[1].profile\n        == \"http://hl7.org/fhir/StructureDefinition/PlanDefinition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[0].definition == (\n        \"http://hl7.org/fhir/SearchParameter/PlanDefinition-\" \"description\"\n    )\n    assert inst.rest[0].resource[1].searchParam[0].name == \"description\"\n    assert inst.rest[0].resource[1].searchParam[0].type == \"string\"\n    assert inst.rest[0].resource[1].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/PlanDefinition-\" \"identifier\"\n    )\n    assert inst.rest[0].resource[1].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[1].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[1].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/PlanDefinition-status\"\n    )\n    assert inst.rest[0].resource[1].searchParam[2].name == \"status\"\n    assert inst.rest[0].resource[1].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[1].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/PlanDefinition-title\"\n    )\n    assert inst.rest[0].resource[1].searchParam[3].name == \"title\"\n    assert inst.rest[0].resource[1].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[1].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/PlanDefinition-topic\"\n    )\n    assert inst.rest[0].resource[1].searchParam[4].name == \"topic\"\n    assert inst.rest[0].resource[1].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].resource[1].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/PlanDefinition-version\"\n    )\n    assert inst.rest[0].resource[1].searchParam[5].name == \"version\"\n    assert inst.rest[0].resource[1].searchParam[5].type == \"token\"\n    assert inst.rest[0].resource[1].searchParam[6].definition == (\n        \"http://hl7.org/fhir/SearchParameter/PlanDefinition-composed-\" \"of\"\n    )\n    assert inst.rest[0].resource[1].searchParam[6].name == \"composed-of\"\n    assert inst.rest[0].resource[1].searchParam[6].type == \"reference\"\n    assert inst.rest[0].resource[1].searchParam[7].definition == (\n        \"http://hl7.org/fhir/SearchParameter/PlanDefinition-depends-\" \"on\"\n    )\n    assert inst.rest[0].resource[1].searchParam[7].name == \"depends-on\"\n    assert inst.rest[0].resource[1].searchParam[7].type == \"reference\"\n    assert inst.rest[0].resource[1].searchParam[8].definition == (\n        \"http://hl7.org/fhir/SearchParameter/PlanDefinition-derived-\" \"from\"\n    )\n    assert inst.rest[0].resource[1].searchParam[8].name == \"derived-from\"\n    assert inst.rest[0].resource[1].searchParam[8].type == \"reference\"\n    assert inst.rest[0].resource[1].searchParam[9].definition == (\n        \"http://hl7.org/fhir/SearchParameter/PlanDefinition-\" \"predecessor\"\n    )\n    assert inst.rest[0].resource[1].searchParam[9].name == \"predecessor\"\n    assert inst.rest[0].resource[1].searchParam[9].type == \"reference\"\n    assert inst.rest[0].resource[1].type == \"PlanDefinition\"\n    assert inst.rest[0].resource[2].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[2].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \"\n        \"activity definitions\"\n    )\n    assert inst.rest[0].resource[2].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[2].interaction[1].documentation == (\n        \"Search allows clients to filter activity definitions based \"\n        \"on a provided search parameter\"\n    )\n    assert (\n        inst.rest[0].resource[2].profile\n        == \"http://hl7.org/fhir/StructureDefinition/ActivityDefinition\"\n    )\n    assert inst.rest[0].resource[2].searchParam[0].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"description\"\n    )\n    assert inst.rest[0].resource[2].searchParam[0].name == \"description\"\n    assert inst.rest[0].resource[2].searchParam[0].type == \"string\"\n    assert inst.rest[0].resource[2].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"identifier\"\n    )\n    assert inst.rest[0].resource[2].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[2].searchParam[1].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[2].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"status\"\n    )\n    assert inst.rest[0].resource[2].searchParam[2].name == \"status\"\n    assert inst.rest[0].resource[2].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[2].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-title\"\n    )\n    assert inst.rest[0].resource[2].searchParam[3].name == \"title\"\n    assert inst.rest[0].resource[2].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[2].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-topic\"\n    )\n    assert inst.rest[0].resource[2].searchParam[4].name == \"topic\"\n    assert inst.rest[0].resource[2].searchParam[4].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[5].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"version\"\n    )\n    assert inst.rest[0].resource[2].searchParam[5].name == \"version\"\n    assert inst.rest[0].resource[2].searchParam[5].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[6].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"composed-of\"\n    )\n    assert inst.rest[0].resource[2].searchParam[6].name == \"composed-of\"\n    assert inst.rest[0].resource[2].searchParam[6].type == \"reference\"\n    assert inst.rest[0].resource[2].searchParam[7].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"depends-on\"\n    )\n    assert inst.rest[0].resource[2].searchParam[7].name == \"depends-on\"\n    assert inst.rest[0].resource[2].searchParam[7].type == \"reference\"\n    assert inst.rest[0].resource[2].searchParam[8].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"derived-from\"\n    )\n    assert inst.rest[0].resource[2].searchParam[8].name == \"derived-from\"\n    assert inst.rest[0].resource[2].searchParam[8].type == \"reference\"\n    assert inst.rest[0].resource[2].searchParam[9].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"predecessor\"\n    )\n    assert inst.rest[0].resource[2].searchParam[9].name == \"predecessor\"\n    assert inst.rest[0].resource[2].searchParam[9].type == \"reference\"\n    assert inst.rest[0].resource[2].type == \"ActivityDefinition\"\n    assert inst.rest[0].resource[3].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[3].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \" \"measures\"\n    )\n    assert inst.rest[0].resource[3].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[3].interaction[1].documentation == (\n        \"Search allows clients to filter measures based on a provided\"\n        \" search parameter\"\n    )\n    assert (\n        inst.rest[0].resource[3].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Measure\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-description\"\n    )\n    assert inst.rest[0].resource[3].searchParam[0].name == \"description\"\n    assert inst.rest[0].resource[3].searchParam[0].type == \"string\"\n    assert (\n        inst.rest[0].resource[3].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-identifier\"\n    )\n    assert inst.rest[0].resource[3].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[3].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-status\"\n    )\n    assert inst.rest[0].resource[3].searchParam[2].name == \"status\"\n    assert inst.rest[0].resource[3].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-title\"\n    )\n    assert inst.rest[0].resource[3].searchParam[3].name == \"title\"\n    assert inst.rest[0].resource[3].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[3].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-topic\"\n    )\n    assert inst.rest[0].resource[3].searchParam[4].name == \"topic\"\n    assert inst.rest[0].resource[3].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-version\"\n    )\n    assert inst.rest[0].resource[3].searchParam[5].name == \"version\"\n    assert inst.rest[0].resource[3].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-composed-of\"\n    )\n    assert inst.rest[0].resource[3].searchParam[6].name == \"composed-of\"\n    assert inst.rest[0].resource[3].searchParam[6].type == \"reference\"\n    assert (\n        inst.rest[0].resource[3].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-depends-on\"\n    )\n    assert inst.rest[0].resource[3].searchParam[7].name == \"depends-on\"\n    assert inst.rest[0].resource[3].searchParam[7].type == \"reference\"\n    assert (\n        inst.rest[0].resource[3].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-derived-from\"\n    )\n    assert inst.rest[0].resource[3].searchParam[8].name == \"derived-from\"\n    assert inst.rest[0].resource[3].searchParam[8].type == \"reference\"\n    assert (\n        inst.rest[0].resource[3].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-predecessor\"\n    )\n    assert inst.rest[0].resource[3].searchParam[9].name == \"predecessor\"\n    assert inst.rest[0].resource[3].searchParam[9].type == \"reference\"\n    assert inst.rest[0].resource[3].type == \"Measure\"\n    assert inst.rest[0].resource[4].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[4].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \" \"measures\"\n    )\n    assert inst.rest[0].resource[4].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[4].interaction[1].documentation == (\n        \"Search allows clients to filter measures based on a provided\"\n        \" search parameter\"\n    )\n    assert (\n        inst.rest[0].resource[4].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Questionnaire\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-code\"\n    )\n    assert inst.rest[0].resource[4].searchParam[0].name == \"code\"\n    assert inst.rest[0].resource[4].searchParam[0].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-context\"\n    )\n    assert inst.rest[0].resource[4].searchParam[1].name == \"context\"\n    assert inst.rest[0].resource[4].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-date\"\n    )\n    assert inst.rest[0].resource[4].searchParam[2].name == \"date\"\n    assert inst.rest[0].resource[4].searchParam[2].type == \"date\"\n    assert (\n        inst.rest[0].resource[4].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-identifier\"\n    )\n    assert inst.rest[0].resource[4].searchParam[3].name == \"identifier\"\n    assert inst.rest[0].resource[4].searchParam[3].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-publisher\"\n    )\n    assert inst.rest[0].resource[4].searchParam[4].name == \"publisher\"\n    assert inst.rest[0].resource[4].searchParam[4].type == \"string\"\n    assert (\n        inst.rest[0].resource[4].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-status\"\n    )\n    assert inst.rest[0].resource[4].searchParam[5].name == \"status\"\n    assert inst.rest[0].resource[4].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-title\"\n    )\n    assert inst.rest[0].resource[4].searchParam[6].name == \"title\"\n    assert inst.rest[0].resource[4].searchParam[6].type == \"string\"\n    assert (\n        inst.rest[0].resource[4].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-version\"\n    )\n    assert inst.rest[0].resource[4].searchParam[7].name == \"version\"\n    assert inst.rest[0].resource[4].searchParam[7].type == \"token\"\n    assert inst.rest[0].resource[4].type == \"Questionnaire\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.service[0].coding[0].code == \"Certificates\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/restful-security-service\"\n            }\n        ).valueUri\n    )\n    assert inst.software.name == \"ACME Knowledge Repository Service\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/knowledge-repository\"}\n        ).valueUri\n    )\n\n\ndef test_capabilitystatement_7(base_settings):\n    \"\"\"No. 7 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-knowledge-repository.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"capabilitystatement-knowledge-repository.json\"\n    )\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_7(inst2)\n\n\ndef impl_capabilitystatement_8(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"4.3.0\"\n    assert inst.format[0] == \"xml\"\n    assert inst.format[1] == \"json\"\n    assert inst.id == \"base\"\n    assert inst.kind == \"capability\"\n    assert inst.name == \"Base FHIR Capability Statement (Full)\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.rest[0].documentation == \"All the functionality defined in FHIR\"\n    assert inst.rest[0].interaction[0].code == \"transaction\"\n    assert inst.rest[0].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].interaction[1].code == \"batch\"\n    assert inst.rest[0].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].interaction[2].code == \"history-system\"\n    assert inst.rest[0].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].interaction[3].code == \"search-system\"\n    assert inst.rest[0].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].mode == \"server\"\n    assert (\n        inst.rest[0].operation[0].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-validate\"\n    )\n    assert inst.rest[0].operation[0].name == \"validate\"\n    assert (\n        inst.rest[0].operation[1].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-meta\"\n    )\n    assert inst.rest[0].operation[1].name == \"meta\"\n    assert (\n        inst.rest[0].operation[2].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-meta-add\"\n    )\n    assert inst.rest[0].operation[2].name == \"meta-add\"\n    assert (\n        inst.rest[0].operation[3].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-meta-delete\"\n    )\n    assert inst.rest[0].operation[3].name == \"meta-delete\"\n    assert (\n        inst.rest[0].operation[4].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-convert\"\n    )\n    assert inst.rest[0].operation[4].name == \"convert\"\n    assert (\n        inst.rest[0].operation[5].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-graphql\"\n    )\n    assert inst.rest[0].operation[5].name == \"graphql\"\n    assert (\n        inst.rest[0].operation[6].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-graph\"\n    )\n    assert inst.rest[0].operation[6].name == \"graph\"\n    assert inst.rest[0].operation[7].definition == (\n        \"http://hl7.org/fhir/OperationDefinition/activitydefinition-\" \"apply\"\n    )\n    assert inst.rest[0].operation[7].name == \"apply\"\n    assert inst.rest[0].operation[8].definition == (\n        \"http://hl7.org/fhir/OperationDefinition/activitydefinition-\"\n        \"data-requirements\"\n    )\n    assert inst.rest[0].operation[8].name == \"data-requirements\"\n    assert inst.rest[0].operation[9].definition == (\n        \"http://hl7.org/fhir/OperationDefinition/capabilitystatement-\" \"subset\"\n    )\n    assert inst.rest[0].operation[9].name == \"subset\"\n    assert inst.rest[0].resource[0].conditionalCreate is True\n    assert inst.rest[0].resource[0].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[0].conditionalUpdate is True\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[0].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[0].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[0].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[0].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[0].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[0].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[0].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[0].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[0].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Account\"\n    )\n    assert inst.rest[0].resource[0].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[0].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[0].searchInclude[0] == \"Account.owner\"\n    assert inst.rest[0].resource[0].searchInclude[1] == \"Account.patient\"\n    assert inst.rest[0].resource[0].searchInclude[2] == \"Account.subject\"\n    assert (\n        inst.rest[0].resource[0].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-owner\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[0].documentation\n        == \"Entity managing the Account\"\n    )\n    assert inst.rest[0].resource[0].searchParam[0].name == \"owner\"\n    assert inst.rest[0].resource[0].searchParam[0].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-identifier\"\n    )\n    assert inst.rest[0].resource[0].searchParam[1].documentation == \"Account number\"\n    assert inst.rest[0].resource[0].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[0].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-period\"\n    )\n    assert inst.rest[0].resource[0].searchParam[2].documentation == \"Transaction window\"\n    assert inst.rest[0].resource[0].searchParam[2].name == \"period\"\n    assert inst.rest[0].resource[0].searchParam[2].type == \"date\"\n    assert (\n        inst.rest[0].resource[0].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-patient\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[3].documentation\n        == \"The entity that caused the expenses\"\n    )\n    assert inst.rest[0].resource[0].searchParam[3].name == \"patient\"\n    assert inst.rest[0].resource[0].searchParam[3].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-subject\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[4].documentation\n        == \"The entity that caused the expenses\"\n    )\n    assert inst.rest[0].resource[0].searchParam[4].name == \"subject\"\n    assert inst.rest[0].resource[0].searchParam[4].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-name\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[5].documentation == \"Human-readable label\"\n    )\n    assert inst.rest[0].resource[0].searchParam[5].name == \"name\"\n    assert inst.rest[0].resource[0].searchParam[5].type == \"string\"\n    assert (\n        inst.rest[0].resource[0].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-type\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[6].documentation\n        == \"E.g. patient, expense, depreciation\"\n    )\n    assert inst.rest[0].resource[0].searchParam[6].name == \"type\"\n    assert inst.rest[0].resource[0].searchParam[6].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-status\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[7].documentation\n        == \"active | inactive | entered-in-error | on-hold | unknown\"\n    )\n    assert inst.rest[0].resource[0].searchParam[7].name == \"status\"\n    assert inst.rest[0].resource[0].searchParam[7].type == \"token\"\n    assert inst.rest[0].resource[0].searchRevInclude[0] == \"ChargeItem.account\"\n    assert inst.rest[0].resource[0].searchRevInclude[1] == \"Encounter.account\"\n    assert inst.rest[0].resource[0].searchRevInclude[2] == \"Invoice.account\"\n    assert inst.rest[0].resource[0].type == \"Account\"\n    assert inst.rest[0].resource[1].conditionalCreate is True\n    assert inst.rest[0].resource[1].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[1].conditionalUpdate is True\n    assert inst.rest[0].resource[1].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[1].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[1].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[1].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[1].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[1].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[1].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[1].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[1].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[1].profile\n        == \"http://hl7.org/fhir/StructureDefinition/ActivityDefinition\"\n    )\n    assert inst.rest[0].resource[1].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[1].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[1].searchInclude[0] == \"ActivityDefinition.successor\"\n    assert (\n        inst.rest[0].resource[1].searchInclude[1] == \"ActivityDefinition.derived-from\"\n    )\n    assert inst.rest[0].resource[1].searchInclude[2] == \"ActivityDefinition.predecessor\"\n    assert inst.rest[0].resource[1].searchInclude[3] == \"ActivityDefinition.composed-of\"\n    assert inst.rest[0].resource[1].searchInclude[4] == \"ActivityDefinition.depends-on\"\n    assert (\n        inst.rest[0].resource[1].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-date\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[0].documentation\n        == \"The activity definition publication date\"\n    )\n    assert inst.rest[0].resource[1].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[1].searchParam[0].type == \"date\"\n    assert inst.rest[0].resource[1].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"identifier\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[1].documentation\n        == \"External identifier for the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[1].searchParam[1].type == \"token\"\n    assert inst.rest[0].resource[1].searchParam[2].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"successor\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[2].documentation\n        == \"What resource is being referenced\"\n    )\n    assert inst.rest[0].resource[1].searchParam[2].name == \"successor\"\n    assert inst.rest[0].resource[1].searchParam[2].type == \"reference\"\n    assert inst.rest[0].resource[1].searchParam[3].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"context-type-value\"\n    )\n    assert inst.rest[0].resource[1].searchParam[3].documentation == (\n        \"A use context type and value assigned to the activity \" \"definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[3].name == \"context-type-value\"\n    assert inst.rest[0].resource[1].searchParam[3].type == \"composite\"\n    assert inst.rest[0].resource[1].searchParam[4].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"jurisdiction\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[4].documentation\n        == \"Intended jurisdiction for the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[4].name == \"jurisdiction\"\n    assert inst.rest[0].resource[1].searchParam[4].type == \"token\"\n    assert inst.rest[0].resource[1].searchParam[5].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"derived-from\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[5].documentation\n        == \"What resource is being referenced\"\n    )\n    assert inst.rest[0].resource[1].searchParam[5].name == \"derived-from\"\n    assert inst.rest[0].resource[1].searchParam[5].type == \"reference\"\n    assert inst.rest[0].resource[1].searchParam[6].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"description\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[6].documentation\n        == \"The description of the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[6].name == \"description\"\n    assert inst.rest[0].resource[1].searchParam[6].type == \"string\"\n    assert inst.rest[0].resource[1].searchParam[7].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"context-type\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[7].documentation\n        == \"A type of use context assigned to the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[7].name == \"context-type\"\n    assert inst.rest[0].resource[1].searchParam[7].type == \"token\"\n    assert inst.rest[0].resource[1].searchParam[8].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"predecessor\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[8].documentation\n        == \"What resource is being referenced\"\n    )\n    assert inst.rest[0].resource[1].searchParam[8].name == \"predecessor\"\n    assert inst.rest[0].resource[1].searchParam[8].type == \"reference\"\n    assert inst.rest[0].resource[1].searchParam[9].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"composed-of\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[9].documentation\n        == \"What resource is being referenced\"\n    )\n    assert inst.rest[0].resource[1].searchParam[9].name == \"composed-of\"\n    assert inst.rest[0].resource[1].searchParam[9].type == \"reference\"\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[0]\n        == \"CarePlan.instantiates-canonical\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[1] == \"ClinicalUseDefinition.product\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[2] == \"ClinicalUseDefinition.subject\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[3]\n        == \"Communication.instantiates-canonical\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[4]\n        == \"DeviceRequest.instantiates-canonical\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[5]\n        == \"FamilyMemberHistory.instantiates-canonical\"\n    )\n    assert inst.rest[0].resource[1].searchRevInclude[6] == \"MessageDefinition.parent\"\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[7]\n        == \"NutritionOrder.instantiates-canonical\"\n    )\n    assert inst.rest[0].resource[1].searchRevInclude[8] == \"PlanDefinition.definition\"\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[9]\n        == \"Procedure.instantiates-canonical\"\n    )\n    assert inst.rest[0].resource[1].type == \"ActivityDefinition\"\n    assert inst.rest[0].resource[2].conditionalCreate is True\n    assert inst.rest[0].resource[2].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[2].conditionalUpdate is True\n    assert inst.rest[0].resource[2].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[2].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[2].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[2].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[2].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[2].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[2].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[2].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[2].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].profile == (\n        \"http://hl7.org/fhir/StructureDefinition/AdministrableProduct\" \"Definition\"\n    )\n    assert inst.rest[0].resource[2].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[2].referencePolicy[1] == \"logical\"\n    assert (\n        inst.rest[0].resource[2].searchInclude[0]\n        == \"AdministrableProductDefinition.manufactured-item\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchInclude[1]\n        == \"AdministrableProductDefinition.device\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchInclude[2]\n        == \"AdministrableProductDefinition.form-of\"\n    )\n    assert inst.rest[0].resource[2].searchParam[0].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\"\n        \"nition-identifier\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[0].documentation\n        == \"An identifier for the administrable product\"\n    )\n    assert inst.rest[0].resource[2].searchParam[0].name == \"identifier\"\n    assert inst.rest[0].resource[2].searchParam[0].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\"\n        \"nition-manufactured-item\"\n    )\n    assert inst.rest[0].resource[2].searchParam[1].name == \"manufactured-item\"\n    assert inst.rest[0].resource[2].searchParam[1].type == \"reference\"\n    assert inst.rest[0].resource[2].searchParam[2].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\"\n        \"nition-ingredient\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[2].documentation\n        == \"The ingredients of this administrable medicinal product\"\n    )\n    assert inst.rest[0].resource[2].searchParam[2].name == \"ingredient\"\n    assert inst.rest[0].resource[2].searchParam[2].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[3].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\" \"nition-route\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[3].documentation\n        == \"Coded expression for the route\"\n    )\n    assert inst.rest[0].resource[2].searchParam[3].name == \"route\"\n    assert inst.rest[0].resource[2].searchParam[3].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[4].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\"\n        \"nition-dose-form\"\n    )\n    assert inst.rest[0].resource[2].searchParam[4].documentation == (\n        \"The administrable dose form, i.e. the dose form of the final\"\n        \" product after necessary reconstitution or processing\"\n    )\n    assert inst.rest[0].resource[2].searchParam[4].name == \"dose-form\"\n    assert inst.rest[0].resource[2].searchParam[4].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[5].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\" \"nition-device\"\n    )\n    assert inst.rest[0].resource[2].searchParam[5].documentation == (\n        \"A device that is integral to the medicinal product, in \"\n        'effect being considered as an \"ingredient\" of the '\n        \"medicinal product. This is not intended for devices that are\"\n        \" just co-packaged\"\n    )\n    assert inst.rest[0].resource[2].searchParam[5].name == \"device\"\n    assert inst.rest[0].resource[2].searchParam[5].type == \"reference\"\n    assert inst.rest[0].resource[2].searchParam[6].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\" \"nition-form-of\"\n    )\n    assert inst.rest[0].resource[2].searchParam[6].documentation == (\n        \"The medicinal product that this is an administrable form of.\"\n        \" This is not a reference to the item(s) that make up this \"\n        \"administrable form - it is the whole product\"\n    )\n    assert inst.rest[0].resource[2].searchParam[6].name == \"form-of\"\n    assert inst.rest[0].resource[2].searchParam[6].type == \"reference\"\n    assert inst.rest[0].resource[2].searchParam[7].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\"\n        \"nition-target-species\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[7].documentation\n        == \"Coded expression for the species\"\n    )\n    assert inst.rest[0].resource[2].searchParam[7].name == \"target-species\"\n    assert inst.rest[0].resource[2].searchParam[7].type == \"token\"\n    assert inst.rest[0].resource[2].searchRevInclude[0] == \"Ingredient.for\"\n    assert inst.rest[0].resource[2].type == \"AdministrableProductDefinition\"\n    assert inst.rest[0].resource[3].conditionalCreate is True\n    assert inst.rest[0].resource[3].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[3].conditionalUpdate is True\n    assert inst.rest[0].resource[3].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[3].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[3].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[3].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[3].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[3].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[3].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[3].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[3].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[3].profile\n        == \"http://hl7.org/fhir/StructureDefinition/AdverseEvent\"\n    )\n    assert inst.rest[0].resource[3].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[3].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[3].searchInclude[0] == \"AdverseEvent.recorder\"\n    assert inst.rest[0].resource[3].searchInclude[1] == \"AdverseEvent.study\"\n    assert inst.rest[0].resource[3].searchInclude[2] == \"AdverseEvent.subject\"\n    assert (\n        inst.rest[0].resource[3].searchInclude[3] == \"AdverseEvent.resultingcondition\"\n    )\n    assert inst.rest[0].resource[3].searchInclude[4] == \"AdverseEvent.substance\"\n    assert inst.rest[0].resource[3].searchInclude[5] == \"AdverseEvent.location\"\n    assert (\n        inst.rest[0].resource[3].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-date\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[0].documentation\n        == \"When the event occurred\"\n    )\n    assert inst.rest[0].resource[3].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[3].searchParam[0].type == \"date\"\n    assert (\n        inst.rest[0].resource[3].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-severity\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[1].documentation\n        == \"mild | moderate | severe\"\n    )\n    assert inst.rest[0].resource[3].searchParam[1].name == \"severity\"\n    assert inst.rest[0].resource[3].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-recorder\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[2].documentation\n        == \"Who recorded the adverse event\"\n    )\n    assert inst.rest[0].resource[3].searchParam[2].name == \"recorder\"\n    assert inst.rest[0].resource[3].searchParam[2].type == \"reference\"\n    assert (\n        inst.rest[0].resource[3].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-study\"\n    )\n    assert inst.rest[0].resource[3].searchParam[3].documentation == \"AdverseEvent.study\"\n    assert inst.rest[0].resource[3].searchParam[3].name == \"study\"\n    assert inst.rest[0].resource[3].searchParam[3].type == \"reference\"\n    assert (\n        inst.rest[0].resource[3].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-actuality\"\n    )\n    assert inst.rest[0].resource[3].searchParam[4].documentation == \"actual | potential\"\n    assert inst.rest[0].resource[3].searchParam[4].name == \"actuality\"\n    assert inst.rest[0].resource[3].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-seriousness\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[5].documentation\n        == \"Seriousness of the event\"\n    )\n    assert inst.rest[0].resource[3].searchParam[5].name == \"seriousness\"\n    assert inst.rest[0].resource[3].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-subject\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[6].documentation\n        == \"Subject impacted by event\"\n    )\n    assert inst.rest[0].resource[3].searchParam[6].name == \"subject\"\n    assert inst.rest[0].resource[3].searchParam[6].type == \"reference\"\n    assert inst.rest[0].resource[3].searchParam[7].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdverseEvent-\" \"resultingcondition\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[7].documentation\n        == \"Effect on the subject due to this event\"\n    )\n    assert inst.rest[0].resource[3].searchParam[7].name == \"resultingcondition\"\n    assert inst.rest[0].resource[3].searchParam[7].type == \"reference\"\n    assert (\n        inst.rest[0].resource[3].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-substance\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[8].documentation\n        == \"Refers to the specific entity that caused the adverse event\"\n    )\n    assert inst.rest[0].resource[3].searchParam[8].name == \"substance\"\n    assert inst.rest[0].resource[3].searchParam[8].type == \"reference\"\n    assert (\n        inst.rest[0].resource[3].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-location\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[9].documentation\n        == \"Location where adverse event occurred\"\n    )\n    assert inst.rest[0].resource[3].searchParam[9].name == \"location\"\n    assert inst.rest[0].resource[3].searchParam[9].type == \"reference\"\n    assert inst.rest[0].resource[3].type == \"AdverseEvent\"\n    assert inst.rest[0].resource[4].conditionalCreate is True\n    assert inst.rest[0].resource[4].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[4].conditionalUpdate is True\n    assert inst.rest[0].resource[4].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[4].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[4].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[4].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[4].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[4].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[4].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[4].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[4].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[4].profile\n        == \"http://hl7.org/fhir/StructureDefinition/AllergyIntolerance\"\n    )\n    assert inst.rest[0].resource[4].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[4].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[4].searchInclude[0] == \"AllergyIntolerance.recorder\"\n    assert inst.rest[0].resource[4].searchInclude[1] == \"AllergyIntolerance.asserter\"\n    assert inst.rest[0].resource[4].searchInclude[2] == \"AllergyIntolerance.patient\"\n    assert (\n        inst.rest[0].resource[4].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-date\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[0].documentation\n        == \"Date first version of the resource instance was recorded\"\n    )\n    assert inst.rest[0].resource[4].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[4].searchParam[0].type == \"date\"\n    assert inst.rest[0].resource[4].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-\" \"severity\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[1].documentation\n        == \"mild | moderate | severe (of event as a whole)\"\n    )\n    assert inst.rest[0].resource[4].searchParam[1].name == \"severity\"\n    assert inst.rest[0].resource[4].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-identifier\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[2].documentation\n        == \"External ids for this item\"\n    )\n    assert inst.rest[0].resource[4].searchParam[2].name == \"identifier\"\n    assert inst.rest[0].resource[4].searchParam[2].type == \"token\"\n    assert inst.rest[0].resource[4].searchParam[3].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-\" \"manifestation\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[3].documentation\n        == \"Clinical symptoms/signs associated with the Event\"\n    )\n    assert inst.rest[0].resource[4].searchParam[3].name == \"manifestation\"\n    assert inst.rest[0].resource[4].searchParam[3].type == \"token\"\n    assert inst.rest[0].resource[4].searchParam[4].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-\" \"recorder\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[4].documentation\n        == \"Who recorded the sensitivity\"\n    )\n    assert inst.rest[0].resource[4].searchParam[4].name == \"recorder\"\n    assert inst.rest[0].resource[4].searchParam[4].type == \"reference\"\n    assert (\n        inst.rest[0].resource[4].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-code\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[5].documentation\n        == \"Code that identifies the allergy or intolerance\"\n    )\n    assert inst.rest[0].resource[4].searchParam[5].name == \"code\"\n    assert inst.rest[0].resource[4].searchParam[5].type == \"token\"\n    assert inst.rest[0].resource[4].searchParam[6].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-\" \"verification-status\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[6].documentation\n        == \"unconfirmed | confirmed | refuted | entered-in-error\"\n    )\n    assert inst.rest[0].resource[4].searchParam[6].name == \"verification-status\"\n    assert inst.rest[0].resource[4].searchParam[6].type == \"token\"\n    assert inst.rest[0].resource[4].searchParam[7].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-\" \"criticality\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[7].documentation\n        == \"low | high | unable-to-assess\"\n    )\n    assert inst.rest[0].resource[4].searchParam[7].name == \"criticality\"\n    assert inst.rest[0].resource[4].searchParam[7].type == \"token\"\n    assert inst.rest[0].resource[4].searchParam[8].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-\" \"clinical-status\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[8].documentation\n        == \"active | inactive | resolved\"\n    )\n    assert inst.rest[0].resource[4].searchParam[8].name == \"clinical-status\"\n    assert inst.rest[0].resource[4].searchParam[8].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-onset\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[9].documentation\n        == \"Date(/time) when manifestations showed\"\n    )\n    assert inst.rest[0].resource[4].searchParam[9].name == \"onset\"\n    assert inst.rest[0].resource[4].searchParam[9].type == \"date\"\n    assert inst.rest[0].resource[4].searchRevInclude[0] == \"ClinicalImpression.problem\"\n    assert inst.rest[0].resource[4].type == \"AllergyIntolerance\"\n    assert inst.rest[0].resource[5].conditionalCreate is True\n    assert inst.rest[0].resource[5].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[5].conditionalUpdate is True\n    assert inst.rest[0].resource[5].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[5].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[5].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[5].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[5].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[5].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[5].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[5].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[5].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[5].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Appointment\"\n    )\n    assert inst.rest[0].resource[5].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[5].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[5].searchInclude[0] == \"Appointment.practitioner\"\n    assert inst.rest[0].resource[5].searchInclude[1] == \"Appointment.slot\"\n    assert inst.rest[0].resource[5].searchInclude[2] == \"Appointment.actor\"\n    assert inst.rest[0].resource[5].searchInclude[3] == \"Appointment.based-on\"\n    assert inst.rest[0].resource[5].searchInclude[4] == \"Appointment.patient\"\n    assert inst.rest[0].resource[5].searchInclude[5] == \"Appointment.reason-reference\"\n    assert inst.rest[0].resource[5].searchInclude[6] == \"Appointment.supporting-info\"\n    assert inst.rest[0].resource[5].searchInclude[7] == \"Appointment.location\"\n    assert (\n        inst.rest[0].resource[5].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-date\"\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[0].documentation\n        == \"Appointment date/time.\"\n    )\n    assert inst.rest[0].resource[5].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[5].searchParam[0].type == \"date\"\n    assert (\n        inst.rest[0].resource[5].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-identifier\"\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[1].documentation\n        == \"An Identifier of the Appointment\"\n    )\n    assert inst.rest[0].resource[5].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[5].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[5].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-specialty\"\n    )\n    assert inst.rest[0].resource[5].searchParam[2].documentation == (\n        \"The specialty of a practitioner that would be required to \"\n        \"perform the service requested in this appointment\"\n    )\n    assert inst.rest[0].resource[5].searchParam[2].name == \"specialty\"\n    assert inst.rest[0].resource[5].searchParam[2].type == \"token\"\n    assert inst.rest[0].resource[5].searchParam[3].definition == (\n        \"http://hl7.org/fhir/SearchParameter/Appointment-service-\" \"category\"\n    )\n    assert inst.rest[0].resource[5].searchParam[3].documentation == (\n        \"A broad categorization of the service that is to be \"\n        \"performed during this appointment\"\n    )\n    assert inst.rest[0].resource[5].searchParam[3].name == \"service-category\"\n    assert inst.rest[0].resource[5].searchParam[3].type == \"token\"\n    assert (\n        inst.rest[0].resource[5].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-practitioner\"\n    )\n    assert inst.rest[0].resource[5].searchParam[4].documentation == (\n        \"One of the individuals of the appointment is this \" \"practitioner\"\n    )\n    assert inst.rest[0].resource[5].searchParam[4].name == \"practitioner\"\n    assert inst.rest[0].resource[5].searchParam[4].type == \"reference\"\n    assert inst.rest[0].resource[5].searchParam[5].definition == (\n        \"http://hl7.org/fhir/SearchParameter/Appointment-appointment-\" \"type\"\n    )\n    assert inst.rest[0].resource[5].searchParam[5].documentation == (\n        \"The style of appointment or patient that has been booked in \"\n        \"the slot (not service type)\"\n    )\n    assert inst.rest[0].resource[5].searchParam[5].name == \"appointment-type\"\n    assert inst.rest[0].resource[5].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[5].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-part-status\"\n    )\n    assert inst.rest[0].resource[5].searchParam[6].documentation == (\n        \"The Participation status of the subject, or other \"\n        \"participant on the appointment. Can be used to locate \"\n        \"participants that have not responded to meeting requests.\"\n    )\n    assert inst.rest[0].resource[5].searchParam[6].name == \"part-status\"\n    assert inst.rest[0].resource[5].searchParam[6].type == \"token\"\n    assert (\n        inst.rest[0].resource[5].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-service-type\"\n    )\n    assert inst.rest[0].resource[5].searchParam[7].documentation == (\n        \"The specific service that is to be performed during this \" \"appointment\"\n    )\n    assert inst.rest[0].resource[5].searchParam[7].name == \"service-type\"\n    assert inst.rest[0].resource[5].searchParam[7].type == \"token\"\n    assert (\n        inst.rest[0].resource[5].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-slot\"\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[8].documentation\n        == \"The slots that this appointment is filling\"\n    )\n    assert inst.rest[0].resource[5].searchParam[8].name == \"slot\"\n    assert inst.rest[0].resource[5].searchParam[8].type == \"reference\"\n    assert (\n        inst.rest[0].resource[5].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-reason-code\"\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[9].documentation\n        == \"Coded reason this appointment is scheduled\"\n    )\n    assert inst.rest[0].resource[5].searchParam[9].name == \"reason-code\"\n    assert inst.rest[0].resource[5].searchParam[9].type == \"token\"\n    assert (\n        inst.rest[0].resource[5].searchRevInclude[0]\n        == \"AppointmentResponse.appointment\"\n    )\n    assert inst.rest[0].resource[5].searchRevInclude[1] == \"CarePlan.activity-reference\"\n    assert inst.rest[0].resource[5].searchRevInclude[2] == \"Encounter.appointment\"\n    assert inst.rest[0].resource[5].searchRevInclude[3] == \"ImagingStudy.basedon\"\n    assert inst.rest[0].resource[5].type == \"Appointment\"\n    assert inst.rest[0].resource[6].conditionalCreate is True\n    assert inst.rest[0].resource[6].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[6].conditionalUpdate is True\n    assert inst.rest[0].resource[6].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[6].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[6].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[6].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[6].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[6].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[6].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[6].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[6].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[6].profile\n        == \"http://hl7.org/fhir/StructureDefinition/AppointmentResponse\"\n    )\n    assert inst.rest[0].resource[6].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[6].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[6].searchInclude[0] == \"AppointmentResponse.actor\"\n    assert (\n        inst.rest[0].resource[6].searchInclude[1] == \"AppointmentResponse.practitioner\"\n    )\n    assert inst.rest[0].resource[6].searchInclude[2] == \"AppointmentResponse.patient\"\n    assert (\n        inst.rest[0].resource[6].searchInclude[3] == \"AppointmentResponse.appointment\"\n    )\n    assert inst.rest[0].resource[6].searchInclude[4] == \"AppointmentResponse.location\"\n    assert inst.rest[0].resource[6].searchParam[0].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"actor\"\n    )\n    assert inst.rest[0].resource[6].searchParam[0].documentation == (\n        \"The Person, Location/HealthcareService or Device that this \"\n        \"appointment response replies for\"\n    )\n    assert inst.rest[0].resource[6].searchParam[0].name == \"actor\"\n    assert inst.rest[0].resource[6].searchParam[0].type == \"reference\"\n    assert inst.rest[0].resource[6].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"identifier\"\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[1].documentation\n        == \"An Identifier in this appointment response\"\n    )\n    assert inst.rest[0].resource[6].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[6].searchParam[1].type == \"token\"\n    assert inst.rest[0].resource[6].searchParam[2].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"practitioner\"\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[2].documentation\n        == \"This Response is for this Practitioner\"\n    )\n    assert inst.rest[0].resource[6].searchParam[2].name == \"practitioner\"\n    assert inst.rest[0].resource[6].searchParam[2].type == \"reference\"\n    assert inst.rest[0].resource[6].searchParam[3].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"part-status\"\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[3].documentation\n        == \"The participants acceptance status for this appointment\"\n    )\n    assert inst.rest[0].resource[6].searchParam[3].name == \"part-status\"\n    assert inst.rest[0].resource[6].searchParam[3].type == \"token\"\n    assert inst.rest[0].resource[6].searchParam[4].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"patient\"\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[4].documentation\n        == \"This Response is for this Patient\"\n    )\n    assert inst.rest[0].resource[6].searchParam[4].name == \"patient\"\n    assert inst.rest[0].resource[6].searchParam[4].type == \"reference\"\n    assert inst.rest[0].resource[6].searchParam[5].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"appointment\"\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[5].documentation\n        == \"The appointment that the response is attached to\"\n    )\n    assert inst.rest[0].resource[6].searchParam[5].name == \"appointment\"\n    assert inst.rest[0].resource[6].searchParam[5].type == \"reference\"\n    assert inst.rest[0].resource[6].searchParam[6].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"location\"\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[6].documentation\n        == \"This Response is for this Location\"\n    )\n    assert inst.rest[0].resource[6].searchParam[6].name == \"location\"\n    assert inst.rest[0].resource[6].searchParam[6].type == \"reference\"\n    assert inst.rest[0].resource[6].searchRevInclude[0] == \"ImagingStudy.basedon\"\n    assert inst.rest[0].resource[6].type == \"AppointmentResponse\"\n    assert inst.rest[0].resource[7].conditionalCreate is True\n    assert inst.rest[0].resource[7].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[7].conditionalUpdate is True\n    assert inst.rest[0].resource[7].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[7].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[7].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[7].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[7].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[7].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[7].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[7].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[7].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[7].profile\n        == \"http://hl7.org/fhir/StructureDefinition/AuditEvent\"\n    )\n    assert inst.rest[0].resource[7].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[7].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[7].searchInclude[0] == \"AuditEvent.agent\"\n    assert inst.rest[0].resource[7].searchInclude[1] == \"AuditEvent.source\"\n    assert inst.rest[0].resource[7].searchInclude[2] == \"AuditEvent.patient\"\n    assert inst.rest[0].resource[7].searchInclude[3] == \"AuditEvent.entity\"\n    assert (\n        inst.rest[0].resource[7].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-date\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[0].documentation\n        == \"Time when the event was recorded\"\n    )\n    assert inst.rest[0].resource[7].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[7].searchParam[0].type == \"date\"\n    assert (\n        inst.rest[0].resource[7].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-entity-type\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[1].documentation\n        == \"Type of entity involved\"\n    )\n    assert inst.rest[0].resource[7].searchParam[1].name == \"entity-type\"\n    assert inst.rest[0].resource[7].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[7].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-agent\"\n    )\n    assert inst.rest[0].resource[7].searchParam[2].documentation == \"Identifier of who\"\n    assert inst.rest[0].resource[7].searchParam[2].name == \"agent\"\n    assert inst.rest[0].resource[7].searchParam[2].type == \"reference\"\n    assert (\n        inst.rest[0].resource[7].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-address\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[3].documentation\n        == \"Identifier for the network access point of the user device\"\n    )\n    assert inst.rest[0].resource[7].searchParam[3].name == \"address\"\n    assert inst.rest[0].resource[7].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[7].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-entity-role\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[4].documentation\n        == \"What role the entity played\"\n    )\n    assert inst.rest[0].resource[7].searchParam[4].name == \"entity-role\"\n    assert inst.rest[0].resource[7].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].resource[7].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-source\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[5].documentation\n        == \"The identity of source detecting the event\"\n    )\n    assert inst.rest[0].resource[7].searchParam[5].name == \"source\"\n    assert inst.rest[0].resource[7].searchParam[5].type == \"reference\"\n    assert (\n        inst.rest[0].resource[7].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-type\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[6].documentation\n        == \"Type/identifier of event\"\n    )\n    assert inst.rest[0].resource[7].searchParam[6].name == \"type\"\n    assert inst.rest[0].resource[7].searchParam[6].type == \"token\"\n    assert (\n        inst.rest[0].resource[7].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-altid\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[7].documentation\n        == \"Alternative User identity\"\n    )\n    assert inst.rest[0].resource[7].searchParam[7].name == \"altid\"\n    assert inst.rest[0].resource[7].searchParam[7].type == \"token\"\n    assert (\n        inst.rest[0].resource[7].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-site\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[8].documentation\n        == \"Logical source location within the enterprise\"\n    )\n    assert inst.rest[0].resource[7].searchParam[8].name == \"site\"\n    assert inst.rest[0].resource[7].searchParam[8].type == \"token\"\n    assert (\n        inst.rest[0].resource[7].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-agent-name\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[9].documentation\n        == \"Human friendly name for the agent\"\n    )\n    assert inst.rest[0].resource[7].searchParam[9].name == \"agent-name\"\n    assert inst.rest[0].resource[7].searchParam[9].type == \"string\"\n    assert inst.rest[0].resource[7].type == \"AuditEvent\"\n    assert inst.rest[0].resource[8].conditionalCreate is True\n    assert inst.rest[0].resource[8].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[8].conditionalUpdate is True\n    assert inst.rest[0].resource[8].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[8].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[8].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[8].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[8].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[8].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[8].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[8].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[8].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[8].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Basic\"\n    )\n    assert inst.rest[0].resource[8].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[8].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[8].searchInclude[0] == \"Basic.author\"\n    assert inst.rest[0].resource[8].searchInclude[1] == \"Basic.patient\"\n    assert inst.rest[0].resource[8].searchInclude[2] == \"Basic.subject\"\n    assert (\n        inst.rest[0].resource[8].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Basic-identifier\"\n    )\n    assert (\n        inst.rest[0].resource[8].searchParam[0].documentation == \"Business identifier\"\n    )\n    assert inst.rest[0].resource[8].searchParam[0].name == \"identifier\"\n    assert inst.rest[0].resource[8].searchParam[0].type == \"token\"\n    assert (\n        inst.rest[0].resource[8].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/Basic-code\"\n    )\n    assert inst.rest[0].resource[8].searchParam[1].documentation == \"Kind of Resource\"\n    assert inst.rest[0].resource[8].searchParam[1].name == \"code\"\n    assert inst.rest[0].resource[8].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[8].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Basic-author\"\n    )\n    assert inst.rest[0].resource[8].searchParam[2].documentation == \"Who created\"\n    assert inst.rest[0].resource[8].searchParam[2].name == \"author\"\n    assert inst.rest[0].resource[8].searchParam[2].type == \"reference\"\n    assert (\n        inst.rest[0].resource[8].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/Basic-created\"\n    )\n    assert inst.rest[0].resource[8].searchParam[3].documentation == \"When created\"\n    assert inst.rest[0].resource[8].searchParam[3].name == \"created\"\n    assert inst.rest[0].resource[8].searchParam[3].type == \"date\"\n    assert (\n        inst.rest[0].resource[8].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Basic-patient\"\n    )\n    assert (\n        inst.rest[0].resource[8].searchParam[4].documentation\n        == \"Identifies the focus of this resource\"\n    )\n    assert inst.rest[0].resource[8].searchParam[4].name == \"patient\"\n    assert inst.rest[0].resource[8].searchParam[4].type == \"reference\"\n    assert (\n        inst.rest[0].resource[8].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/Basic-subject\"\n    )\n    assert (\n        inst.rest[0].resource[8].searchParam[5].documentation\n        == \"Identifies the focus of this resource\"\n    )\n    assert inst.rest[0].resource[8].searchParam[5].name == \"subject\"\n    assert inst.rest[0].resource[8].searchParam[5].type == \"reference\"\n    assert inst.rest[0].resource[8].type == \"Basic\"\n    assert inst.rest[0].resource[9].conditionalCreate is True\n    assert inst.rest[0].resource[9].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[9].conditionalUpdate is True\n    assert inst.rest[0].resource[9].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[9].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[9].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[9].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[9].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[9].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[9].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[9].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[9].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[9].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Binary\"\n    )\n    assert inst.rest[0].resource[9].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[9].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[9].type == \"Binary\"\n    assert (\n        inst.rest[0].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/DomainResource-text\"\n    )\n    assert (\n        inst.rest[0].searchParam[0].documentation\n        == \"Search on the narrative of the resource\"\n    )\n    assert inst.rest[0].searchParam[0].name == \"_text\"\n    assert inst.rest[0].searchParam[0].type == \"string\"\n    assert (\n        inst.rest[0].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/id\"\n    )\n    assert inst.rest[0].searchParam[1].documentation == \"some doco\"\n    assert inst.rest[0].searchParam[1].name == \"something\"\n    assert inst.rest[0].searchParam[1].type == \"string\"\n    assert (\n        inst.rest[0].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-list\"\n    )\n    assert inst.rest[0].searchParam[2].documentation == (\n        \"Retrieval of resources that are referenced by a List \" \"resource\"\n    )\n    assert inst.rest[0].searchParam[2].name == \"_list\"\n    assert inst.rest[0].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-has\"\n    )\n    assert (\n        inst.rest[0].searchParam[3].documentation\n        == \"Provides support for reverse chaining\"\n    )\n    assert inst.rest[0].searchParam[3].name == \"_has\"\n    assert inst.rest[0].searchParam[3].type == \"composite\"\n    assert (\n        inst.rest[0].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-type\"\n    )\n    assert (\n        inst.rest[0].searchParam[4].documentation\n        == \"Type of resource (when doing cross-resource search\"\n    )\n    assert inst.rest[0].searchParam[4].name == \"_type\"\n    assert inst.rest[0].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-source\"\n    )\n    assert (\n        inst.rest[0].searchParam[5].documentation\n        == \"How to sort the resources when returning\"\n    )\n    assert inst.rest[0].searchParam[5].name == \"_sort\"\n    assert inst.rest[0].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-count\"\n    )\n    assert inst.rest[0].searchParam[6].documentation == \"How many resources to return\"\n    assert inst.rest[0].searchParam[6].name == \"_count\"\n    assert inst.rest[0].searchParam[6].type == \"number\"\n    assert (\n        inst.rest[0].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-include\"\n    )\n    assert (\n        inst.rest[0].searchParam[7].documentation\n        == \"Control over returning additional resources (see spec)\"\n    )\n    assert inst.rest[0].searchParam[7].name == \"_include\"\n    assert inst.rest[0].searchParam[7].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-revinclude\"\n    )\n    assert (\n        inst.rest[0].searchParam[8].documentation\n        == \"Control over returning additional resources (see spec)\"\n    )\n    assert inst.rest[0].searchParam[8].name == \"_revinclude\"\n    assert inst.rest[0].searchParam[8].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-summary\"\n    )\n    assert (\n        inst.rest[0].searchParam[9].documentation\n        == \"What kind of information to return\"\n    )\n    assert inst.rest[0].searchParam[9].name == \"_summary\"\n    assert inst.rest[0].searchParam[9].type == \"token\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.description == (\n        \"This is the Capability Statement to declare that the server \"\n        \"supports SMART-on-FHIR. See the SMART-on-FHIR docs for the \"\n        \"extension that would go with such a server\"\n    )\n    assert inst.rest[0].security.service[0].coding[0].code == \"SMART-on-FHIR\"\n    assert inst.rest[0].security.service[0].coding[0].display == \"SMART-on-FHIR\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/restful-security-service\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].security.service[0].text == \"See http://docs.smarthealthit.org/\"\n    assert inst.software.name == \"Insert your software name here...\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CapabilityStatement/base\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_capabilitystatement_8(base_settings):\n    \"\"\"No. 8 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-base.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"capabilitystatement-base.json\"\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_8(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_careplan.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CarePlan\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import careplan\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_careplan_1(inst):\n    assert inst.activity[0].detail.code.coding[0].code == \"359615001\"\n    assert inst.activity[0].detail.code.coding[0].display == \"Partial lobectomy of lung\"\n    assert (\n        inst.activity[0].detail.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.activity[0].detail.doNotPerform is True\n    assert inst.activity[0].detail.kind == \"ServiceRequest\"\n    assert inst.activity[0].detail.performer[0].display == \"M.I.M. Versteegh\"\n    assert inst.activity[0].detail.performer[0].reference == \"Practitioner/f003\"\n    assert inst.activity[0].detail.scheduledString == \"2011-07-07T09:30:10+01:00\"\n    assert inst.activity[0].detail.status == \"completed\"\n    assert inst.addresses[0].display == \"?????\"\n    assert inst.addresses[0].reference == \"Condition/f201\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"careteam\"\n    assert inst.contained[1].id == \"goal\"\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"f002\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/careplans\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"CP2934\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-07-07\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-07-06\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_careplan_1(base_settings):\n    \"\"\"No. 1 tests collection for CarePlan.\n    Test File: careplan-example-f002-lung.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-f002-lung.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_1(inst2)\n\n\ndef impl_careplan_2(inst):\n    assert inst.activity[0].detail.code.coding[0].code == \"367336001\"\n    assert inst.activity[0].detail.code.coding[0].display == \"Chemotherapy\"\n    assert (\n        inst.activity[0].detail.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.activity[0].detail.doNotPerform is False\n    assert inst.activity[0].detail.kind == \"ServiceRequest\"\n    assert inst.activity[0].detail.productReference.reference == \"#tpf\"\n    assert inst.activity[0].detail.status == \"in-progress\"\n    assert inst.activity[0].outcomeReference[0].display == \"Roel's Chemotherapy\"\n    assert inst.activity[0].outcomeReference[0].reference == \"Procedure/f201\"\n    assert inst.addresses[0].display == \"Roel's head-neck tumor\"\n    assert inst.addresses[0].reference == \"Condition/f202\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"doce\"\n    assert inst.contained[1].id == \"cisp\"\n    assert inst.contained[2].id == \"fluo\"\n    assert inst.contained[3].id == \"tpf\"\n    assert inst.contained[4].id == \"careteam\"\n    assert inst.contained[5].id == \"goal\"\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"f202\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_careplan_2(base_settings):\n    \"\"\"No. 2 tests collection for CarePlan.\n    Test File: careplan-example-f202-malignancy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"careplan-example-f202-malignancy.json\"\n    )\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_2(inst2)\n\n\ndef impl_careplan_3(inst):\n    assert inst.id == \"obesity-narrative\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_careplan_3(base_settings):\n    \"\"\"No. 3 tests collection for CarePlan.\n    Test File: careplan-example-obesity-narrative.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"careplan-example-obesity-narrative.json\"\n    )\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_3(inst2)\n\n\ndef impl_careplan_4(inst):\n    assert inst.activity[0].detail.code.coding[0].code == \"3141-9\"\n    assert inst.activity[0].detail.code.coding[0].display == \"Weight Measured\"\n    assert (\n        inst.activity[0].detail.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.activity[0].detail.code.coding[1].code == \"27113001\"\n    assert inst.activity[0].detail.code.coding[1].display == \"Body weight\"\n    assert (\n        inst.activity[0].detail.code.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.activity[0].detail.doNotPerform is False\n    assert inst.activity[0].detail.location.display == \"Patient's home\"\n    assert inst.activity[0].detail.performer[0].display == \"Peter James Chalmers\"\n    assert inst.activity[0].detail.performer[0].reference == \"Patient/example\"\n    assert inst.activity[0].detail.scheduledTiming.repeat.frequency == 1\n    assert float(inst.activity[0].detail.scheduledTiming.repeat.period) == float(1)\n    assert inst.activity[0].detail.scheduledTiming.repeat.periodUnit == \"d\"\n    assert inst.activity[0].detail.status == \"completed\"\n    assert (\n        inst.activity[0].detail.statusReason.text\n        == \"Achieved weight loss to mitigate diabetes risk.\"\n    )\n    assert inst.activity[0].outcomeCodeableConcept[0].coding[0].code == \"161832001\"\n    assert (\n        inst.activity[0].outcomeCodeableConcept[0].coding[0].display\n        == \"Progressive weight loss\"\n    )\n    assert (\n        inst.activity[0].outcomeCodeableConcept[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.activity[0].outcomeReference[0].display == \"Weight Measured\"\n    assert inst.activity[0].outcomeReference[0].reference == \"Observation/example\"\n    assert inst.addresses[0].display == \"obesity\"\n    assert inst.addresses[0].reference == \"#p1\"\n    assert inst.author.display == \"Dr Adam Careful\"\n    assert inst.author.reference == \"Practitioner/example\"\n    assert inst.basedOn[0].display == \"Management of Type 2 Diabetes\"\n    assert inst.careTeam[0].reference == \"CareTeam/example\"\n    assert inst.category[0].text == \"Weight management plan\"\n    assert inst.contained[0].id == \"p1\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Manage obesity and weight loss\"\n    assert inst.encounter.reference == \"Encounter/home\"\n    assert inst.goal[0].reference == \"Goal/example\"\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"12345\"\n    assert (\n        inst.instantiatesUri[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/protocol-for-obesity\"}\n        ).valueUri\n    )\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.partOf[0].display == \"Overall wellness plan\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-06-01\"}\n        ).valueDateTime\n    )\n    assert inst.replaces[0].display == \"Plan from urgent care clinic\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_careplan_4(base_settings):\n    \"\"\"No. 4 tests collection for CarePlan.\n    Test File: careplan-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_4(inst2)\n\n\ndef impl_careplan_5(inst):\n    assert inst.activity[0].detail.code.coding[0].code == \"284093001\"\n    assert inst.activity[0].detail.code.coding[0].display == \"Potassium supplementation\"\n    assert (\n        inst.activity[0].detail.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.activity[0].detail.dailyAmount.code == \"258718000\"\n    assert (\n        inst.activity[0].detail.dailyAmount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.activity[0].detail.dailyAmount.unit == \"mmol\"\n    assert float(inst.activity[0].detail.dailyAmount.value) == float(80)\n    assert inst.activity[0].detail.doNotPerform is False\n    assert inst.activity[0].detail.kind == \"NutritionOrder\"\n    assert inst.activity[0].detail.productReference.display == \"Potassium\"\n    assert inst.activity[0].detail.productReference.reference == \"Substance/f203\"\n    assert inst.activity[0].detail.scheduledString == \"daily\"\n    assert inst.activity[0].detail.status == \"completed\"\n    assert inst.activity[1].detail.code.coding[0].code == \"306005\"\n    assert inst.activity[1].detail.code.coding[0].display == \"Echography of kidney\"\n    assert (\n        inst.activity[1].detail.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.activity[1].detail.doNotPerform is False\n    assert inst.activity[1].detail.kind == \"ServiceRequest\"\n    assert inst.activity[1].detail.status == \"completed\"\n    assert inst.addresses[0].display == \"Roel's renal insufficiency\"\n    assert inst.addresses[0].reference == \"Condition/f204\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"careteam\"\n    assert inst.contained[1].id == \"goal\"\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"f201\"\n    assert inst.intent == \"proposal\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-13\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-11\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"draft\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_careplan_5(base_settings):\n    \"\"\"No. 5 tests collection for CarePlan.\n    Test File: careplan-example-f201-renal.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-f201-renal.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_5(inst2)\n\n\ndef impl_careplan_6(inst):\n    assert inst.activity[0].detail.code.coding[0].code == \"nursecon\"\n    assert (\n        inst.activity[0].detail.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/local\"}\n        ).valueUri\n    )\n    assert inst.activity[0].detail.code.text == \"Nurse Consultation\"\n    assert inst.activity[0].detail.doNotPerform is False\n    assert inst.activity[0].detail.kind == \"Appointment\"\n    assert inst.activity[0].detail.performer[0].display == \"Nurse Nancy\"\n    assert inst.activity[0].detail.performer[0].reference == \"Practitioner/13\"\n    assert (\n        inst.activity[0].detail.scheduledPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-01T10:50:00+00:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[0].detail.scheduledPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-01T10:38:00+00:00\"}\n        ).valueDateTime\n    )\n    assert inst.activity[0].detail.status == \"completed\"\n    assert inst.activity[0].outcomeReference[0].reference == \"Encounter/example\"\n    assert inst.activity[1].detail.code.coding[0].code == \"doccon\"\n    assert (\n        inst.activity[1].detail.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/local\"}\n        ).valueUri\n    )\n    assert inst.activity[1].detail.code.text == \"Doctor Consultation\"\n    assert inst.activity[1].detail.doNotPerform is False\n    assert inst.activity[1].detail.kind == \"Appointment\"\n    assert inst.activity[1].detail.performer[0].display == \"Doctor Dave\"\n    assert inst.activity[1].detail.performer[0].reference == \"Practitioner/14\"\n    assert inst.activity[1].detail.status == \"scheduled\"\n    assert inst.addresses[0].display == \"obesity\"\n    assert inst.addresses[0].reference == \"#p1\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"p1\"\n    assert inst.contained[1].id == \"careteam\"\n    assert inst.contained[2].id == \"goal\"\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"gpvisit\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-01T10:30:00+00:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/100\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_careplan_6(base_settings):\n    \"\"\"No. 6 tests collection for CarePlan.\n    Test File: careplan-example-GPVisit.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-GPVisit.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_6(inst2)\n\n\ndef impl_careplan_7(inst):\n    assert inst.activity[0].detail.description == (\n        \"Eve will review photos of high and low density foods and \"\n        \"share with her parents\"\n    )\n    assert inst.activity[0].detail.doNotPerform is False\n    assert (\n        inst.activity[0].detail.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/RevisionDate\"}\n        ).valueUri\n    )\n    assert (\n        inst.activity[0].detail.extension[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2012-09-10\"}).valueDate\n    )\n    assert inst.activity[0].detail.goal[0].reference == \"#g1\"\n    assert (\n        inst.activity[0].detail.scheduledPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-09-10\"}\n        ).valueDateTime\n    )\n    assert inst.activity[0].detail.status == \"not-started\"\n    assert (\n        inst.activity[0].progress[0].text == \"Eve eats one meal a day with her parents\"\n    )\n    assert (\n        inst.activity[0].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-09-10\"}\n        ).valueDateTime\n    )\n    assert inst.activity[1].detail.description == (\n        \"Eve will ask her dad to asist her to put the head of her bed\" \" on blocks\"\n    )\n    assert inst.activity[1].detail.doNotPerform is False\n    assert (\n        inst.activity[1].detail.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/RevisionDate\"}\n        ).valueUri\n    )\n    assert (\n        inst.activity[1].detail.extension[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2012-09-10\"}).valueDate\n    )\n    assert inst.activity[1].detail.goal[0].reference == \"#g1\"\n    assert inst.activity[1].detail.kind == \"CommunicationRequest\"\n    assert (\n        inst.activity[1].detail.scheduledPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-09-10\"}\n        ).valueDateTime\n    )\n    assert inst.activity[1].detail.status == \"not-started\"\n    assert (\n        inst.activity[1].progress[0].text\n        == \"Eve will sleep in her bed more often than the couch\"\n    )\n    assert (\n        inst.activity[1].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-09-10\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[2].detail.description\n        == \"Eve will reduce her intake of coffee and chocolate\"\n    )\n    assert inst.activity[2].detail.doNotPerform is False\n    assert (\n        inst.activity[2].detail.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/RevisionDate\"}\n        ).valueUri\n    )\n    assert (\n        inst.activity[2].detail.extension[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2012-09-10\"}).valueDate\n    )\n    assert inst.activity[2].detail.goal[0].reference == \"#g2\"\n    assert (\n        inst.activity[2].detail.scheduledPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-09-10\"}\n        ).valueDateTime\n    )\n    assert inst.activity[2].detail.status == \"in-progress\"\n    assert inst.activity[3].detail.description == (\n        \"Eve will walk her friend's dog up and down a big hill 15-30 \"\n        \"minutes 3 days a week\"\n    )\n    assert inst.activity[3].detail.doNotPerform is False\n    assert (\n        inst.activity[3].detail.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/RevisionDate\"}\n        ).valueUri\n    )\n    assert (\n        inst.activity[3].detail.extension[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2012-09-10\"}).valueDate\n    )\n    assert inst.activity[3].detail.goal[0].reference == \"#g3\"\n    assert (\n        inst.activity[3].detail.scheduledPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-08-27\"}\n        ).valueDateTime\n    )\n    assert inst.activity[3].detail.status == \"in-progress\"\n    assert (\n        inst.activity[3].progress[0].text == \"Eve would like to try for 5 days a week.\"\n    )\n    assert (\n        inst.activity[3].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-08-27\"}\n        ).valueDateTime\n    )\n    assert inst.activity[3].progress[1].text == \"Eve is still walking the dogs.\"\n    assert (\n        inst.activity[3].progress[1].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-09-10\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[4].detail.description\n        == \"Eve will walk 3 blocks to her parents house twice a week\"\n    )\n    assert inst.activity[4].detail.doNotPerform is False\n    assert (\n        inst.activity[4].detail.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/RevisionDate\"}\n        ).valueUri\n    )\n    assert (\n        inst.activity[4].detail.extension[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2012-09-10\"}).valueDate\n    )\n    assert inst.activity[4].detail.goal[0].reference == \"#g3\"\n    assert (\n        inst.activity[4].detail.scheduledPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-07-23\"}\n        ).valueDateTime\n    )\n    assert inst.activity[4].detail.status == \"in-progress\"\n    assert inst.activity[4].progress[0].text == \"Eve walked 4 times the last week.\"\n    assert (\n        inst.activity[4].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-08-13\"}\n        ).valueDateTime\n    )\n    assert inst.activity[4].progress[1].text == (\n        \"Eve did not walk to her parents the last week, but has plans\" \" to start again\"\n    )\n    assert (\n        inst.activity[4].progress[1].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-09-10\"}\n        ).valueDateTime\n    )\n    assert inst.activity[5].detail.description == (\n        \"Eve will use a calendar to check off after medications are \" \"taken\"\n    )\n    assert inst.activity[5].detail.doNotPerform is False\n    assert (\n        inst.activity[5].detail.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/RevisionDate\"}\n        ).valueUri\n    )\n    assert (\n        inst.activity[5].detail.extension[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2012-08-13\"}).valueDate\n    )\n    assert inst.activity[5].detail.goal[0].reference == \"#g4\"\n    assert (\n        inst.activity[5].detail.scheduledPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-07-23\"}\n        ).valueDateTime\n    )\n    assert inst.activity[5].detail.status == \"in-progress\"\n    assert (\n        inst.activity[6].detail.description\n        == \"Eve will use her lights MWF after her shower for 3 minutes\"\n    )\n    assert inst.activity[6].detail.doNotPerform is False\n    assert (\n        inst.activity[6].detail.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/RevisionDate\"}\n        ).valueUri\n    )\n    assert (\n        inst.activity[6].detail.extension[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2012-08-27\"}).valueDate\n    )\n    assert inst.activity[6].detail.goal[0].reference == \"#g5\"\n    assert (\n        inst.activity[6].detail.scheduledPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-07-23\"}\n        ).valueDateTime\n    )\n    assert inst.activity[6].detail.status == \"in-progress\"\n    assert inst.activity[6].progress[0].text == (\n        \"After restarting the vinegar soaks the psoriasis is improved\"\n        \" and Eve plans to treat the remainder with light treatments.\"\n        \"  She plans to start this week.\"\n    )\n    assert (\n        inst.activity[6].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-08-13\"}\n        ).valueDateTime\n    )\n    assert inst.activity[6].progress[1].text == (\n        \"Since her skin is improved Eve has not been using the light \"\n        \"treatment as often, maybe once a week.  She would like to \"\n        \"increase to 3 times a week again\"\n    )\n    assert (\n        inst.activity[6].progress[1].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-08-27\"}\n        ).valueDateTime\n    )\n    assert inst.activity[7].detail.description == (\n        \"Eve will use a calendar of a chart to help her remember when\"\n        \" to take her medications\"\n    )\n    assert inst.activity[7].detail.doNotPerform is False\n    assert (\n        inst.activity[7].detail.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/RevisionDate\"}\n        ).valueUri\n    )\n    assert (\n        inst.activity[7].detail.extension[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2012-09-10\"}).valueDate\n    )\n    assert inst.activity[7].detail.goal[0].reference == \"#g4\"\n    assert (\n        inst.activity[7].detail.scheduledPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-07-10\"}\n        ).valueDateTime\n    )\n    assert inst.activity[7].detail.status == \"in-progress\"\n    assert inst.activity[7].progress[0].text == (\n        \"Eve created a chart as a reminer to take the medications \"\n        \"that do not fit in her pill box\"\n    )\n    assert (\n        inst.activity[7].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-07-23\"}\n        ).valueDateTime\n    )\n    assert inst.activity[8].detail.description == (\n        \"Eve will start using stretch bands and one step 2 days a \"\n        \"week Mon/Wed 6-7am and maybe Friday afternoon\"\n    )\n    assert inst.activity[8].detail.doNotPerform is False\n    assert (\n        inst.activity[8].detail.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/RevisionDate\"}\n        ).valueUri\n    )\n    assert (\n        inst.activity[8].detail.extension[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2012-08-23\"}).valueDate\n    )\n    assert inst.activity[8].detail.goal[0].reference == \"#g3\"\n    assert (\n        inst.activity[8].detail.scheduledPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-07-23\"}\n        ).valueDateTime\n    )\n    assert inst.activity[8].detail.status == \"on-hold\"\n    assert inst.activity[8].progress[0].text == \"Will be able to esume exercise.\"\n    assert (\n        inst.activity[8].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-07-30\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[8].progress[1].text\n        == \"Eve prefers to focus on walking at this time\"\n    )\n    assert (\n        inst.activity[8].progress[1].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-08-13\"}\n        ).valueDateTime\n    )\n    assert inst.activity[9].detail.description == (\n        \"Eve will match a printed medication worksheet with the \"\n        \"medication bottles at home\"\n    )\n    assert inst.activity[9].detail.doNotPerform is False\n    assert (\n        inst.activity[9].detail.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/RevisionDate\"}\n        ).valueUri\n    )\n    assert (\n        inst.activity[9].detail.extension[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2012-07-23\"}).valueDate\n    )\n    assert inst.activity[9].detail.goal[0].reference == \"#g4\"\n    assert (\n        inst.activity[9].detail.scheduledPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-07-10\"}\n        ).valueDateTime\n    )\n    assert inst.activity[9].detail.status == \"completed\"\n    assert inst.addresses[0].display == \"GERDS\"\n    assert inst.addresses[0].reference == \"#p1\"\n    assert inst.addresses[1].display == \"Obesity\"\n    assert inst.addresses[1].reference == \"#p2\"\n    assert inst.addresses[2].display == \"Psoriasis\"\n    assert inst.addresses[2].reference == \"#p3\"\n    assert inst.contained[0].id == \"p1\"\n    assert inst.contained[1].id == \"p2\"\n    assert inst.contained[2].id == \"p3\"\n    assert inst.contained[3].id == \"g1\"\n    assert inst.contained[4].id == \"g2\"\n    assert inst.contained[5].id == \"g3\"\n    assert inst.contained[6].id == \"g4\"\n    assert inst.contained[7].id == \"g5\"\n    assert inst.goal[0].reference == \"#g1\"\n    assert inst.goal[1].reference == \"#g2\"\n    assert inst.goal[2].reference == \"#g3\"\n    assert inst.goal[3].reference == \"#g4\"\n    assert inst.goal[4].reference == \"#g5\"\n    assert inst.id == \"integrate\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Patient family is not ready to commit to goal setting at \"\n        \"this time.  Goal setting will be addressed in the future\"\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Eve Everywoman\"\n    assert inst.subject.reference == \"Patient/1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_careplan_7(base_settings):\n    \"\"\"No. 7 tests collection for CarePlan.\n    Test File: careplan-example-integrated.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-integrated.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_7(inst2)\n\n\ndef impl_careplan_8(inst):\n    assert inst.activity[0].detail.code.coding[0].code == \"172960003\"\n    assert (\n        inst.activity[0].detail.code.coding[0].display\n        == \"Incision of retropharyngeal abscess\"\n    )\n    assert (\n        inst.activity[0].detail.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.activity[0].detail.doNotPerform is True\n    assert inst.activity[0].detail.kind == \"ServiceRequest\"\n    assert inst.activity[0].detail.performer[0].display == \"E.M. van den broek\"\n    assert inst.activity[0].detail.performer[0].reference == \"Practitioner/f001\"\n    assert inst.activity[0].detail.scheduledString == \"2011-06-27T09:30:10+01:00\"\n    assert inst.activity[0].detail.status == \"completed\"\n    assert inst.addresses[0].display == \"?????\"\n    assert inst.addresses[0].reference == \"Condition/f201\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"careteam\"\n    assert inst.contained[1].id == \"goal\"\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"f003\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/careplans\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"CP3953\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-08T09:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-08T09:00:10+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_careplan_8(base_settings):\n    \"\"\"No. 8 tests collection for CarePlan.\n    Test File: careplan-example-f003-pharynx.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-f003-pharynx.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_8(inst2)\n\n\ndef impl_careplan_9(inst):\n    assert inst.activity[0].detail.code.coding[0].code == \"64915003\"\n    assert inst.activity[0].detail.code.coding[0].display == \"Operation on heart\"\n    assert (\n        inst.activity[0].detail.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.activity[0].detail.doNotPerform is True\n    assert inst.activity[0].detail.kind == \"ServiceRequest\"\n    assert inst.activity[0].detail.performer[0].display == \"P. Voigt\"\n    assert inst.activity[0].detail.performer[0].reference == \"Practitioner/f002\"\n    assert inst.activity[0].detail.scheduledString == \"2011-06-27T09:30:10+01:00\"\n    assert inst.activity[0].detail.status == \"completed\"\n    assert inst.addresses[0].display == \"?????\"\n    assert inst.addresses[0].reference == \"Condition/f201\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"careteam\"\n    assert inst.contained[1].id == \"goal\"\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"f001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/careplans\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"CP2903\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-06-27\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-06-26\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_careplan_9(base_settings):\n    \"\"\"No. 9 tests collection for CarePlan.\n    Test File: careplan-example-f001-heart.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-f001-heart.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_9(inst2)\n\n\ndef impl_careplan_10(inst):\n    assert inst.activity[0].reference.display == \"Prenatal vitamin MedicationRequest\"\n    assert inst.activity[1].detail.code.coding[0].code == \"1an\"\n    assert (\n        inst.activity[1].detail.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/mySystem\"}\n        ).valueUri\n    )\n    assert inst.activity[1].detail.code.text == \"First Antenatal encounter\"\n    assert inst.activity[1].detail.description == (\n        \"The first antenatal encounter. This is where a detailed \"\n        \"physical examination is performed.             and the \"\n        \"pregnanacy discussed with the mother-to-be.\"\n    )\n    assert inst.activity[1].detail.doNotPerform is False\n    assert inst.activity[1].detail.kind == \"Appointment\"\n    assert inst.activity[1].detail.performer[0].display == \"Mavis Midwife\"\n    assert inst.activity[1].detail.performer[0].reference == \"#pr1\"\n    assert (\n        inst.activity[1].detail.scheduledTiming.repeat.boundsPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-02-28\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[1].detail.scheduledTiming.repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-02-14\"}\n        ).valueDateTime\n    )\n    assert inst.activity[1].detail.status == \"scheduled\"\n    assert (\n        inst.activity[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/StructureDefinition/careplan#andetails\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.activity[1].extension[0].valueUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://orionhealth.com/fhir/careplan/1andetails\"}\n        ).valueUri\n    )\n    assert inst.activity[2].detail.code.coding[0].code == \"an\"\n    assert (\n        inst.activity[2].detail.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/mySystem\"}\n        ).valueUri\n    )\n    assert inst.activity[2].detail.code.text == \"Follow-up Antenatal encounter\"\n    assert inst.activity[2].detail.description == (\n        \"The second antenatal encounter. Discuss any issues that \"\n        \"arose from the first antenatal encounter\"\n    )\n    assert inst.activity[2].detail.doNotPerform is False\n    assert inst.activity[2].detail.kind == \"Appointment\"\n    assert inst.activity[2].detail.performer[0].display == \"Mavis Midwife\"\n    assert inst.activity[2].detail.performer[0].reference == \"#pr1\"\n    assert (\n        inst.activity[2].detail.scheduledTiming.repeat.boundsPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-14\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[2].detail.scheduledTiming.repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-01\"}\n        ).valueDateTime\n    )\n    assert inst.activity[2].detail.status == \"not-started\"\n    assert inst.activity[3].detail.code.coding[0].code == \"del\"\n    assert (\n        inst.activity[3].detail.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/mySystem\"}\n        ).valueUri\n    )\n    assert inst.activity[3].detail.code.text == \"Delivery\"\n    assert inst.activity[3].detail.description == \"The delivery.\"\n    assert inst.activity[3].detail.doNotPerform is False\n    assert inst.activity[3].detail.kind == \"Appointment\"\n    assert inst.activity[3].detail.performer[0].display == \"Mavis Midwife\"\n    assert inst.activity[3].detail.performer[0].reference == \"#pr1\"\n    assert (\n        inst.activity[3].detail.scheduledTiming.repeat.boundsPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-09-14\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[3].detail.scheduledTiming.repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-09-01\"}\n        ).valueDateTime\n    )\n    assert inst.activity[3].detail.status == \"not-started\"\n    assert inst.addresses[0].display == \"pregnancy\"\n    assert inst.addresses[0].reference == \"#p1\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"p1\"\n    assert inst.contained[1].id == \"pr1\"\n    assert inst.contained[2].id == \"pr2\"\n    assert inst.contained[3].id == \"careteam\"\n    assert inst.contained[4].id == \"goal\"\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/careplan#lmp\"}\n        ).valueUri\n    )\n    assert (\n        inst.extension[0].valueDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"preg\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-10-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Eve Everywoman\"\n    assert inst.subject.reference == \"Patient/1\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_careplan_10(base_settings):\n    \"\"\"No. 10 tests collection for CarePlan.\n    Test File: careplan-example-pregnancy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-pregnancy.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_careteam.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CareTeam\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import careteam\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_careteam_1(inst):\n    assert inst.category[0].coding[0].code == \"LA27976-2\"\n    assert inst.category[0].coding[0].display == \"Encounter-focused care team\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"pr1\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.managingOrganization[0].reference == \"Organization/f001\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Peter James Charlmers Care Plan for Inpatient Encounter\"\n    assert inst.participant[0].member.display == \"Peter James Chalmers\"\n    assert inst.participant[0].member.reference == \"Patient/example\"\n    assert inst.participant[0].role[0].text == \"responsiblePerson\"\n    assert inst.participant[1].member.display == \"Dorothy Dietition\"\n    assert inst.participant[1].member.reference == \"#pr1\"\n    assert inst.participant[1].onBehalfOf.reference == \"Organization/f001\"\n    assert (\n        inst.participant[1].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.participant[1].role[0].text == \"adviser\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == '<div xmlns=\"http://www.w3.org/1999/xhtml\">Care Team</div>'\n    assert inst.text.status == \"generated\"\n\n\ndef test_careteam_1(base_settings):\n    \"\"\"No. 1 tests collection for CareTeam.\n    Test File: careteam-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careteam-example.json\"\n    inst = careteam.CareTeam.model_validate_json(filename.read_bytes())\n    assert \"CareTeam\" == inst.get_resource_type()\n\n    impl_careteam_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CareTeam\" == data[\"resourceType\"]\n\n    inst2 = careteam.CareTeam(**data)\n    impl_careteam_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_catalogentry.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CatalogEntry\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import catalogentry\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_catalogentry_1(inst):\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.com/identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.orderable is True\n    assert inst.referencedItem.reference == \"Medication/123\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.text == \"Medication\"\n\n\ndef test_catalogentry_1(base_settings):\n    \"\"\"No. 1 tests collection for CatalogEntry.\n    Test File: catalogentry-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"catalogentry-example.json\"\n    inst = catalogentry.CatalogEntry.model_validate_json(filename.read_bytes())\n    assert \"CatalogEntry\" == inst.get_resource_type()\n\n    impl_catalogentry_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CatalogEntry\" == data[\"resourceType\"]\n\n    inst2 = catalogentry.CatalogEntry(**data)\n    impl_catalogentry_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_chargeitem.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ChargeItem\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import chargeitem\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_chargeitem_1(inst):\n    assert inst.account[0].reference == \"Account/example\"\n    assert inst.code.coding[0].code == \"01510\"\n    assert inst.code.coding[0].display == (\n        \"Zusatzpauschale für Beobachtung nach diagnostischer \" \"Koronarangiografie\"\n    )\n    assert inst.context.reference == \"Encounter/example\"\n    assert (\n        inst.definitionUri[0]\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://www.kbv.de/tools/ebm/html/01520_2904360860826220813632.html\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.enteredDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-25T23:55:04+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.enterer.reference == \"Practitioner/example\"\n    assert float(inst.factorOverride) == float(0.8)\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://myHospital.org/ChargeItems\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"654321\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].authorReference.reference == \"Practitioner/example\"\n    assert inst.note[0].text == \"The code is only applicable for periods longer than 4h\"\n    assert (\n        inst.note[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-25T23:55:04+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurrencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-25T12:35:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurrencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-25T08:00:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.overrideReason == (\n        \"Patient is Cardiologist's golf buddy, so he gets a 20% \" \"discount!\"\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.performer[0].function.coding[0].code == \"17561000\"\n    assert inst.performer[0].function.coding[0].display == \"Cardiologist\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.performer[1].actor.reference == \"Practitioner/example\"\n    assert inst.performer[1].function.coding[0].code == \"224542009\"\n    assert inst.performer[1].function.coding[0].display == \"Coronary Care Nurse\"\n    assert (\n        inst.performer[1].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.performingOrganization.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://myhospital/NamingSystem/departments\"}\n        ).valueUri\n    )\n    assert inst.performingOrganization.identifier.value == \"CARD_INTERMEDIATE_CARE\"\n    assert inst.priceOverride.currency == \"EUR\"\n    assert float(inst.priceOverride.value) == float(40)\n    assert float(inst.quantity.value) == float(1)\n    assert inst.reason[0].coding[0].code == \"I51.6\"\n    assert inst.reason[0].coding[0].display == \"Cardiovascular disease, unspecified\"\n    assert (\n        inst.reason[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-10\"}\n        ).valueUri\n    )\n    assert (\n        inst.requestingOrganization.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://myhospital/NamingSystem/departments\"}\n        ).valueUri\n    )\n    assert inst.requestingOrganization.identifier.value == \"CARD_U1\"\n    assert inst.service[0].reference == \"Procedure/example\"\n    assert inst.status == \"billable\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Example of '\n        \"ChargeItem Usage in Context of the German EBM Billing code \"\n        \"system</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_chargeitem_1(base_settings):\n    \"\"\"No. 1 tests collection for ChargeItem.\n    Test File: chargeitem-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"chargeitem-example.json\"\n    inst = chargeitem.ChargeItem.model_validate_json(filename.read_bytes())\n    assert \"ChargeItem\" == inst.get_resource_type()\n\n    impl_chargeitem_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ChargeItem\" == data[\"resourceType\"]\n\n    inst2 = chargeitem.ChargeItem(**data)\n    impl_chargeitem_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_chargeitemdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import chargeitemdefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_chargeitemdefinition_1(inst):\n    assert (\n        inst.applicability[0].description\n        == \"Verify ChargeItem pertains to Device 12345\"\n    )\n    assert (\n        inst.applicability[0].expression\n        == \"%context.service.suppliedItem='Device/12345'\"\n    )\n    assert inst.applicability[0].language == \"text/fhirpath\"\n    assert inst.description == \"Financial details for  custom made device\"\n    assert inst.experimental is True\n    assert inst.id == \"device\"\n    assert inst.instance[0].reference == \"Device/12345\"\n    assert inst.propertyGroup[0].priceComponent[0].amount.currency == \"EUR\"\n    assert float(inst.propertyGroup[0].priceComponent[0].amount.value) == float(67.44)\n    assert inst.propertyGroup[0].priceComponent[0].code.coding[0].code == \"VK\"\n    assert (\n        inst.propertyGroup[0].priceComponent[0].code.coding[0].display\n        == \"Verkaufspreis (netto)\"\n    )\n    assert (\n        inst.propertyGroup[0].priceComponent[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/CodeSystem/billing-attributes\"}\n        ).valueUri\n    )\n    assert inst.propertyGroup[0].priceComponent[0].type == \"base\"\n    assert inst.propertyGroup[1].applicability[0].description == \"Gültigkeit Steuersatz\"\n    assert (\n        inst.propertyGroup[1].applicability[0].expression\n        == \"%context.occurenceDateTime > '2018-04-01'\"\n    )\n    assert inst.propertyGroup[1].applicability[0].language == \"text/fhirpath\"\n    assert inst.propertyGroup[1].priceComponent[0].code.coding[0].code == \"MWST\"\n    assert (\n        inst.propertyGroup[1].priceComponent[0].code.coding[0].display\n        == \"Mehrwersteuersatz\"\n    )\n    assert (\n        inst.propertyGroup[1].priceComponent[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/CodeSystem/billing-attributes\"}\n        ).valueUri\n    )\n    assert float(inst.propertyGroup[1].priceComponent[0].factor) == float(1.19)\n    assert inst.propertyGroup[1].priceComponent[0].type == \"tax\"\n    assert inst.propertyGroup[2].applicability[0].description == \"Gültigkeit Steuersatz\"\n    assert (\n        inst.propertyGroup[2].applicability[0].expression\n        == \"%context.occurenceDateTime <= '2018-04-01'\"\n    )\n    assert inst.propertyGroup[2].applicability[0].language == \"text/fhirpath\"\n    assert inst.propertyGroup[2].priceComponent[0].code.coding[0].code == \"MWST\"\n    assert (\n        inst.propertyGroup[2].priceComponent[0].code.coding[0].display\n        == \"Mehrwersteuersatz\"\n    )\n    assert (\n        inst.propertyGroup[2].priceComponent[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/CodeSystem/billing-attributes\"}\n        ).valueUri\n    )\n    assert float(inst.propertyGroup[2].priceComponent[0].factor) == float(1.07)\n    assert inst.propertyGroup[2].priceComponent[0].type == \"tax\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://sap.org/ChargeItemDefinition/device-123\"}\n        ).valueUri\n    )\n\n\ndef test_chargeitemdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ChargeItemDefinition.\n    Test File: chargeitemdefinition-device-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"chargeitemdefinition-device-example.json\"\n    )\n    inst = chargeitemdefinition.ChargeItemDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ChargeItemDefinition\" == inst.get_resource_type()\n\n    impl_chargeitemdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ChargeItemDefinition\" == data[\"resourceType\"]\n\n    inst2 = chargeitemdefinition.ChargeItemDefinition(**data)\n    impl_chargeitemdefinition_1(inst2)\n\n\ndef impl_chargeitemdefinition_2(inst):\n    assert (\n        inst.applicability[0].description\n        == \"Excludes billing code 13250 for same Encounter\"\n    )\n    assert inst.applicability[0].expression == \"[some CQL expression]\"\n    assert inst.applicability[0].language == \"text/cql\"\n    assert inst.applicability[1].description == \"Applies only once per Encounter\"\n    assert inst.applicability[1].expression == \"[some CQL expression]\"\n    assert inst.applicability[1].language == \"text/CQL\"\n    assert inst.code.coding[0].code == \"30110\"\n    assert inst.code.coding[0].display == \"Allergologiediagnostik I\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/CodingSystem/kbv/ebm\"}\n        ).valueUri\n    )\n    assert inst.description == (\n        \"Allergologisch-diagnostischer Komplex zur Diagnostik \"\n        \"und/oder zum Ausschluss einer (Kontakt-)Allergie vom Spättyp\"\n        \" (Typ IV), einschl. Kosten\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-06-30\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-04-01\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"ebm\"\n    assert inst.propertyGroup[0].priceComponent[0].amount.currency == \"EUR\"\n    assert float(inst.propertyGroup[0].priceComponent[0].amount.value) == float(67.44)\n    assert inst.propertyGroup[0].priceComponent[0].code.coding[0].code == \"gesamt-euro\"\n    assert (\n        inst.propertyGroup[0].priceComponent[0].code.coding[0].display\n        == \"Gesamt (Euro)\"\n    )\n    assert (\n        inst.propertyGroup[0].priceComponent[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/CodeSystem/kbv/ebm-attribute\"}\n        ).valueUri\n    )\n    assert inst.propertyGroup[0].priceComponent[0].type == \"base\"\n    assert (\n        inst.propertyGroup[0].priceComponent[1].code.coding[0].code == \"gesamt-punkte\"\n    )\n    assert (\n        inst.propertyGroup[0].priceComponent[1].code.coding[0].display\n        == \"Gesamt (Punkte)\"\n    )\n    assert (\n        inst.propertyGroup[0].priceComponent[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/CodeSystem/kbv/ebm-attribute\"}\n        ).valueUri\n    )\n    assert float(inst.propertyGroup[0].priceComponent[1].factor) == float(633)\n    assert inst.propertyGroup[0].priceComponent[1].type == \"informational\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/ChargeItemDefinition/kbv/ebm-30110\"}\n        ).valueUri\n    )\n    assert inst.version == \"2-2018\"\n\n\ndef test_chargeitemdefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for ChargeItemDefinition.\n    Test File: chargeitemdefinition-ebm-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"chargeitemdefinition-ebm-example.json\"\n    )\n    inst = chargeitemdefinition.ChargeItemDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ChargeItemDefinition\" == inst.get_resource_type()\n\n    impl_chargeitemdefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ChargeItemDefinition\" == data[\"resourceType\"]\n\n    inst2 = chargeitemdefinition.ChargeItemDefinition(**data)\n    impl_chargeitemdefinition_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_citation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Citation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import citation\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_citation_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_citation_1(base_settings):\n    \"\"\"No. 1 tests collection for Citation.\n    Test File: citation-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"citation-example.json\"\n    inst = citation.Citation.model_validate_json(filename.read_bytes())\n    assert \"Citation\" == inst.get_resource_type()\n\n    impl_citation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Citation\" == data[\"resourceType\"]\n\n    inst2 = citation.Citation(**data)\n    impl_citation_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_claim.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Claim\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import claim\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_claim_1(inst):\n    assert (\n        inst.accident.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-07-09\"}).valueDate\n    )\n    assert inst.accident.locationAddress.text == \"Grouse Mountain Ski Hill\"\n    assert inst.accident.type.coding[0].code == \"SPT\"\n    assert inst.accident.type.coding[0].display == \"Sporting Accident\"\n    assert (\n        inst.accident.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActIncidentCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.billablePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.billablePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-15\"}\n        ).valueDateTime\n    )\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].qualification.coding[0].code == \"physician\"\n    assert (\n        inst.careTeam[0].qualification.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/provider-qualification\"}\n        ).valueUri\n    )\n    assert inst.careTeam[0].responsible is True\n    assert inst.careTeam[0].role.coding[0].code == \"primary\"\n    assert (\n        inst.careTeam[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/claim-careteamrole\"}\n        ).valueUri\n    )\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"654456\"\n    assert inst.diagnosis[0].packageCode.coding[0].code == \"400\"\n    assert inst.diagnosis[0].packageCode.coding[0].display == \"Head trauma - concussion\"\n    assert (\n        inst.diagnosis[0].packageCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-diagnosisrelatedgroup\"\n            }\n        ).valueUri\n    )\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.diagnosis[0].type[0].coding[0].code == \"admitting\"\n    assert (\n        inst.diagnosis[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-diagnosistype\"}\n        ).valueUri\n    )\n    assert (\n        inst.enterer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://jurisdiction.org/facilities/HOSP1234/users\"}\n        ).valueUri\n    )\n    assert inst.enterer.identifier.value == \"UC1234\"\n    assert (\n        inst.facility.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://jurisdiction.org/facilities\"}\n        ).valueUri\n    )\n    assert inst.facility.identifier.value == \"HOSP1234\"\n    assert inst.id == \"960151\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyhospital.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"96123451\"\n    assert inst.insurance[0].businessArrangement == \"BA987123\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].preAuthRef[0] == \"PA2014G56473\"\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(125.0)\n    assert inst.item[0].productOrService.coding[0].code == \"exam\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-serviceproduct\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(125.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert (\n        inst.provider.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://npid.org/providerid\"}\n        ).valueUri\n    )\n    assert inst.provider.identifier.value == \"NJ12345\"\n    assert inst.status == \"active\"\n    assert inst.supportingInfo[0].category.coding[0].code == \"employmentimpacted\"\n    assert (\n        inst.supportingInfo[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/claiminformationcategory\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[0].sequence == 1\n    assert (\n        inst.supportingInfo[0].timingPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.supportingInfo[0].timingPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.supportingInfo[1].category.coding[0].code == \"hospitalized\"\n    assert (\n        inst.supportingInfo[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/claiminformationcategory\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[1].sequence == 2\n    assert (\n        inst.supportingInfo[1].timingPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.supportingInfo[1].timingPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-15\"}\n        ).valueDateTime\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total.currency == \"USD\"\n    assert float(inst.total.value) == float(125.0)\n    assert inst.type.coding[0].code == \"institutional\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_1(base_settings):\n    \"\"\"No. 1 tests collection for Claim.\n    Test File: claim-example-institutional-rich.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"claim-example-institutional-rich.json\"\n    )\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_1(inst2)\n\n\ndef impl_claim_2(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"654456\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.id == \"860150\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happypdocs.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"8612345\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(75.0)\n    assert inst.item[0].productOrService.coding[0].code == \"exam\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-serviceproduct\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(75.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"professional\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_2(base_settings):\n    \"\"\"No. 2 tests collection for Claim.\n    Test File: claim-example-professional.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example-professional.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_2(inst2)\n\n\ndef impl_claim_3(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"123456\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.id == \"100150\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert (\n        inst.insurance[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].identifier.value == \"12345\"\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(135.57)\n    assert inst.item[0].productOrService.coding[0].code == \"1200\"\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(135.57)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Oral Health Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_3(base_settings):\n    \"\"\"No. 3 tests collection for Claim.\n    Test File: claim-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_3(inst2)\n\n\ndef impl_claim_4(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"654321\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.id == \"660150\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happysight.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"6612345\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(80.0)\n    assert inst.item[0].productOrService.coding[0].code == \"exam\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(80.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Vision Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"vision\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_4(base_settings):\n    \"\"\"No. 4 tests collection for Claim.\n    Test File: claim-example-vision.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example-vision.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_4(inst2)\n\n\ndef impl_claim_5(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert inst.contained[0].id == \"device-frame\"\n    assert inst.contained[1].id == \"device-lens\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"654321\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.id == \"660152\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happysight.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"6612347\"\n    assert inst.insurance[0].claimResponse.reference == \"ClaimResponse/R3500\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is False\n    assert inst.insurance[0].preAuthRef[0] == \"PR7652387237\"\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurance[1].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[1].focal is True\n    assert inst.insurance[1].preAuthRef[0] == \"AB543GTD7567\"\n    assert inst.insurance[1].sequence == 2\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].category.coding[0].code == \"F6\"\n    assert inst.item[0].category.coding[0].display == \"Vision Coverage\"\n    assert (\n        inst.item[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[0].category.coding[0].code == \"F6\"\n    assert inst.item[0].detail[0].category.coding[0].display == \"Vision Coverage\"\n    assert (\n        inst.item[0].detail[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[0].factor) == float(1.1)\n    assert inst.item[0].detail[0].modifier[0].coding[0].code == \"rooh\"\n    assert (\n        inst.item[0].detail[0].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/modifiers\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[0].net.currency == \"USD\"\n    assert float(inst.item[0].detail[0].net.value) == float(110.0)\n    assert inst.item[0].detail[0].productOrService.coding[0].code == \"frame\"\n    assert (\n        inst.item[0].detail[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[0].revenue.coding[0].code == \"0010\"\n    assert inst.item[0].detail[0].revenue.coding[0].display == \"Vision Clinic\"\n    assert (\n        inst.item[0].detail[0].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[0].sequence == 1\n    assert inst.item[0].detail[0].udi[0].reference == \"#device-frame\"\n    assert inst.item[0].detail[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[0].unitPrice.value) == float(100.0)\n    assert inst.item[0].detail[1].category.coding[0].code == \"F6\"\n    assert inst.item[0].detail[1].category.coding[0].display == \"Vision Coverage\"\n    assert (\n        inst.item[0].detail[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].net.currency == \"USD\"\n    assert float(inst.item[0].detail[1].net.value) == float(110.0)\n    assert inst.item[0].detail[1].productOrService.coding[0].code == \"lens\"\n    assert (\n        inst.item[0].detail[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].programCode[0].coding[0].code == \"none\"\n    assert (\n        inst.item[0].detail[1].programCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-programcode\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].quantity.value) == float(2)\n    assert inst.item[0].detail[1].revenue.coding[0].code == \"0010\"\n    assert inst.item[0].detail[1].revenue.coding[0].display == \"Vision Clinic\"\n    assert (\n        inst.item[0].detail[1].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].sequence == 2\n    assert inst.item[0].detail[1].subDetail[0].category.coding[0].code == \"F6\"\n    assert (\n        inst.item[0].detail[1].subDetail[0].category.coding[0].display\n        == \"Vision Coverage\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].subDetail[0].factor) == float(1.1)\n    assert inst.item[0].detail[1].subDetail[0].modifier[0].coding[0].code == \"rooh\"\n    assert (\n        inst.item[0].detail[1].subDetail[0].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/modifiers\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[0].net.currency == \"USD\"\n    assert float(inst.item[0].detail[1].subDetail[0].net.value) == float(66.0)\n    assert inst.item[0].detail[1].subDetail[0].productOrService.coding[0].code == \"lens\"\n    assert (\n        inst.item[0].detail[1].subDetail[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[0].programCode[0].coding[0].code == \"none\"\n    assert (\n        inst.item[0].detail[1].subDetail[0].programCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-programcode\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].subDetail[0].quantity.value) == float(2)\n    assert inst.item[0].detail[1].subDetail[0].revenue.coding[0].code == \"0010\"\n    assert (\n        inst.item[0].detail[1].subDetail[0].revenue.coding[0].display == \"Vision Clinic\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[0].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[0].sequence == 1\n    assert inst.item[0].detail[1].subDetail[0].udi[0].reference == \"#device-lens\"\n    assert inst.item[0].detail[1].subDetail[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[1].subDetail[0].unitPrice.value) == float(30.0)\n    assert inst.item[0].detail[1].subDetail[1].category.coding[0].code == \"F6\"\n    assert (\n        inst.item[0].detail[1].subDetail[1].category.coding[0].display\n        == \"Vision Coverage\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].subDetail[1].factor) == float(1.1)\n    assert inst.item[0].detail[1].subDetail[1].modifier[0].coding[0].code == \"rooh\"\n    assert (\n        inst.item[0].detail[1].subDetail[1].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/modifiers\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[1].net.currency == \"USD\"\n    assert float(inst.item[0].detail[1].subDetail[1].net.value) == float(33.0)\n    assert (\n        inst.item[0].detail[1].subDetail[1].productOrService.coding[0].code\n        == \"hardening\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].subDetail[1].quantity.value) == float(2)\n    assert inst.item[0].detail[1].subDetail[1].revenue.coding[0].code == \"0010\"\n    assert (\n        inst.item[0].detail[1].subDetail[1].revenue.coding[0].display == \"Vision Clinic\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[1].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[1].sequence == 2\n    assert inst.item[0].detail[1].subDetail[1].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[1].subDetail[1].unitPrice.value) == float(15.0)\n    assert inst.item[0].detail[1].subDetail[2].category.coding[0].code == \"F6\"\n    assert (\n        inst.item[0].detail[1].subDetail[2].category.coding[0].display\n        == \"Vision Coverage\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[2].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].subDetail[2].factor) == float(1.1)\n    assert inst.item[0].detail[1].subDetail[2].modifier[0].coding[0].code == \"rooh\"\n    assert (\n        inst.item[0].detail[1].subDetail[2].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/modifiers\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[2].net.currency == \"USD\"\n    assert float(inst.item[0].detail[1].subDetail[2].net.value) == float(11.0)\n    assert (\n        inst.item[0].detail[1].subDetail[2].productOrService.coding[0].code\n        == \"UV coating\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[2].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].subDetail[2].quantity.value) == float(2)\n    assert inst.item[0].detail[1].subDetail[2].revenue.coding[0].code == \"0010\"\n    assert (\n        inst.item[0].detail[1].subDetail[2].revenue.coding[0].display == \"Vision Clinic\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[2].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[2].sequence == 3\n    assert inst.item[0].detail[1].subDetail[2].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[1].subDetail[2].unitPrice.value) == float(5.0)\n    assert inst.item[0].detail[1].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[1].unitPrice.value) == float(55.0)\n    assert inst.item[0].detail[2].category.coding[0].code == \"F6\"\n    assert inst.item[0].detail[2].category.coding[0].display == \"Vision Coverage\"\n    assert (\n        inst.item[0].detail[2].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[2].factor) == float(0.07)\n    assert inst.item[0].detail[2].net.currency == \"USD\"\n    assert float(inst.item[0].detail[2].net.value) == float(15.4)\n    assert inst.item[0].detail[2].productOrService.coding[0].code == \"fst\"\n    assert (\n        inst.item[0].detail[2].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[2].revenue.coding[0].code == \"0010\"\n    assert inst.item[0].detail[2].revenue.coding[0].display == \"Vision Clinic\"\n    assert (\n        inst.item[0].detail[2].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[2].sequence == 3\n    assert inst.item[0].detail[2].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[2].unitPrice.value) == float(220.0)\n    assert inst.item[0].modifier[0].coding[0].code == \"rooh\"\n    assert (\n        inst.item[0].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/modifiers\"}\n        ).valueUri\n    )\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(235.4)\n    assert inst.item[0].productOrService.coding[0].code == \"glasses\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].programCode[0].coding[0].code == \"none\"\n    assert (\n        inst.item[0].programCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-programcode\"}\n        ).valueUri\n    )\n    assert inst.item[0].revenue.coding[0].code == \"0010\"\n    assert inst.item[0].revenue.coding[0].display == \"Vision Clinic\"\n    assert (\n        inst.item[0].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(235.4)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.prescription.reference == \"http://www.optdocs.com/prescription/12345\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Vision Claim for Glasses</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"vision\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_5(base_settings):\n    \"\"\"No. 5 tests collection for Claim.\n    Test File: claim-example-vision-glasses-3tier.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"claim-example-vision-glasses-3tier.json\"\n    )\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_5(inst2)\n\n\ndef impl_claim_6(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"654456\"\n    assert inst.diagnosis[0].sequence == 1\n    assert (\n        inst.enterer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://jurisdiction.org/facilities/HOSP1234/users\"}\n        ).valueUri\n    )\n    assert inst.enterer.identifier.value == \"UC1234\"\n    assert (\n        inst.facility.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://jurisdiction.org/facilities\"}\n        ).valueUri\n    )\n    assert inst.facility.identifier.value == \"HOSP1234\"\n    assert inst.id == \"960150\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyhospital.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"9612345\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].encounter[0].reference == \"Encounter/example\"\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(125.0)\n    assert inst.item[0].productOrService.coding[0].code == \"exam\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-serviceproduct\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(125.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert (\n        inst.procedure[0].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.procedure[0].procedureCodeableConcept.coding[0].code == \"SDI9901\"\n    assert (\n        inst.procedure[0].procedureCodeableConcept.text\n        == \"Subcutaneous diagnostic implant\"\n    )\n    assert inst.procedure[0].sequence == 1\n    assert inst.procedure[0].type[0].coding[0].code == \"primary\"\n    assert inst.procedure[0].udi[0].reference == \"Device/example\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.subType.coding[0].code == \"emergency\"\n    assert (\n        inst.subType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-claimsubtype\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total.currency == \"USD\"\n    assert float(inst.total.value) == float(125.0)\n    assert inst.type.coding[0].code == \"institutional\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_6(base_settings):\n    \"\"\"No. 6 tests collection for Claim.\n    Test File: claim-example-institutional.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example-institutional.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_6(inst2)\n\n\ndef impl_claim_7(inst):\n    assert inst.careTeam[0].provider.reference == \"#provider-1\"\n    assert inst.careTeam[0].sequence == 1\n    assert inst.contained[0].id == \"org-insurer\"\n    assert inst.contained[1].id == \"org-org\"\n    assert inst.contained[2].id == \"provider-1\"\n    assert inst.contained[3].id == \"patient-1\"\n    assert inst.contained[4].id == \"coverage-1\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"123456\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.id == \"100152\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12347\"\n    assert inst.insurance[0].coverage.reference == \"#coverage-1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"#org-insurer\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(135.57)\n    assert inst.item[0].productOrService.coding[0].code == \"1200\"\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(135.57)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"#patient-1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"#org-org\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Oral Health Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_7(base_settings):\n    \"\"\"No. 7 tests collection for Claim.\n    Test File: claim-example-oral-contained.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example-oral-contained.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_7(inst2)\n\n\ndef impl_claim_8(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"654456\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.id == \"760151\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happypharma.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"7612345\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].detail[0].net.currency == \"USD\"\n    assert float(inst.item[0].detail[0].net.value) == float(45.0)\n    assert inst.item[0].detail[0].productOrService.coding[0].code == \"drugcost\"\n    assert (\n        inst.item[0].detail[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-pharmaservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[0].sequence == 1\n    assert inst.item[0].detail[1].net.currency == \"USD\"\n    assert float(inst.item[0].detail[1].net.value) == float(9.0)\n    assert inst.item[0].detail[1].productOrService.coding[0].code == \"markup\"\n    assert (\n        inst.item[0].detail[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-pharmaservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].sequence == 2\n    assert inst.item[0].detail[2].net.currency == \"USD\"\n    assert float(inst.item[0].detail[2].net.value) == float(36.0)\n    assert inst.item[0].detail[2].productOrService.coding[0].code == \"dispensefee\"\n    assert (\n        inst.item[0].detail[2].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-pharmaservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[2].sequence == 3\n    assert inst.item[0].informationSequence[0] == 1\n    assert inst.item[0].informationSequence[1] == 2\n    assert inst.item[0].informationSequence[2] == 3\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(90.0)\n    assert inst.item[0].productOrService.coding[0].code == \"562721\"\n    assert (\n        inst.item[0].productOrService.coding[0].display == \"Alprazolam 0.25mg (Xanax)\"\n    )\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.item[0].quantity.code == \"TAB\"\n    assert (\n        inst.item[0].quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.item[0].quantity.unit == \"TAB\"\n    assert float(inst.item[0].quantity.value) == float(90)\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.originalPrescription.reference\n        == \"http://pharmacy.org/MedicationRequest/AB1202B\"\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert (\n        inst.prescription.reference == \"http://pharmacy.org/MedicationRequest/AB1234G\"\n    )\n    assert inst.priority.coding[0].code == \"stat\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.supportingInfo[0].category.coding[0].code == \"pharmacyrefill\"\n    assert inst.supportingInfo[0].code.coding[0].code == \"new\"\n    assert (\n        inst.supportingInfo[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/pharmacy-refill\"}\n        ).valueUri\n    )\n    assert inst.supportingInfo[0].sequence == 1\n    assert inst.supportingInfo[1].category.coding[0].code == \"pharmacyinformation\"\n    assert inst.supportingInfo[1].code.coding[0].code == \"refillsremaining\"\n    assert (\n        inst.supportingInfo[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/pharmacy-information\"}\n        ).valueUri\n    )\n    assert inst.supportingInfo[1].sequence == 2\n    assert float(inst.supportingInfo[1].valueQuantity.value) == float(2)\n    assert inst.supportingInfo[2].category.coding[0].code == \"pharmacyinformation\"\n    assert inst.supportingInfo[2].code.coding[0].code == \"dayssupply\"\n    assert (\n        inst.supportingInfo[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/pharmacy-information\"}\n        ).valueUri\n    )\n    assert inst.supportingInfo[2].sequence == 3\n    assert float(inst.supportingInfo[2].valueQuantity.value) == float(90)\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Pharmacy Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total.currency == \"USD\"\n    assert float(inst.total.value) == float(90.0)\n    assert inst.type.coding[0].code == \"pharmacy\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_8(base_settings):\n    \"\"\"No. 8 tests collection for Claim.\n    Test File: claim-example-pharmacy-medication.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"claim-example-pharmacy-medication.json\"\n    )\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_8(inst2)\n\n\ndef impl_claim_9(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"K07.3\"\n    assert (\n        inst.diagnosis[0].diagnosisCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-10\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.fundsReserve.coding[0].code == \"provider\"\n    assert inst.id == \"100153\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12355\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].detail[0].net.currency == \"USD\"\n    assert float(inst.item[0].detail[0].net.value) == float(1000.0)\n    assert inst.item[0].detail[0].productOrService.coding[0].code == \"ORTHOEXAM\"\n    assert (\n        inst.item[0].detail[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[0].sequence == 1\n    assert inst.item[0].detail[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[0].unitPrice.value) == float(1000.0)\n    assert inst.item[0].detail[1].net.currency == \"USD\"\n    assert float(inst.item[0].detail[1].net.value) == float(1500.0)\n    assert inst.item[0].detail[1].productOrService.coding[0].code == \"ORTHODIAG\"\n    assert (\n        inst.item[0].detail[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].sequence == 2\n    assert inst.item[0].detail[1].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[1].unitPrice.value) == float(1500.0)\n    assert inst.item[0].detail[2].net.currency == \"USD\"\n    assert float(inst.item[0].detail[2].net.value) == float(500.0)\n    assert inst.item[0].detail[2].productOrService.coding[0].code == \"ORTHOINITIAL\"\n    assert (\n        inst.item[0].detail[2].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[2].sequence == 3\n    assert inst.item[0].detail[2].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[2].unitPrice.value) == float(500.0)\n    assert inst.item[0].detail[3].productOrService.coding[0].code == \"ORTHOMONTHS\"\n    assert (\n        inst.item[0].detail[3].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[3].quantity.value) == float(24)\n    assert inst.item[0].detail[3].sequence == 4\n    assert inst.item[0].detail[4].net.currency == \"USD\"\n    assert float(inst.item[0].detail[4].net.value) == float(250.0)\n    assert inst.item[0].detail[4].productOrService.coding[0].code == \"ORTHOPERIODIC\"\n    assert (\n        inst.item[0].detail[4].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[4].quantity.value) == float(24)\n    assert inst.item[0].detail[4].sequence == 5\n    assert inst.item[0].detail[4].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[4].unitPrice.value) == float(250.0)\n    assert inst.item[0].diagnosisSequence[0] == 1\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(9000.0)\n    assert inst.item[0].productOrService.coding[0].code == \"ORTHPLAN\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-05-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(9000.0)\n    assert inst.item[1].bodySite.coding[0].code == \"21\"\n    assert (\n        inst.item[1].bodySite.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fdi.org/fhir/oraltoothcodes\"}\n        ).valueUri\n    )\n    assert inst.item[1].careTeamSequence[0] == 1\n    assert inst.item[1].net.currency == \"USD\"\n    assert float(inst.item[1].net.value) == float(105.0)\n    assert inst.item[1].productOrService.coding[0].code == \"21211\"\n    assert (\n        inst.item[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[1].sequence == 2\n    assert (\n        inst.item[1].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[1].subSite[0].coding[0].code == \"L\"\n    assert (\n        inst.item[1].subSite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fdi.org/fhir/oralsurfacecodes\"}\n        ).valueUri\n    )\n    assert inst.item[1].unitPrice.currency == \"USD\"\n    assert float(inst.item[1].unitPrice.value) == float(105.0)\n    assert inst.item[2].bodySite.coding[0].code == \"36\"\n    assert (\n        inst.item[2].bodySite.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fdi.org/fhir/oraltoothcodes\"}\n        ).valueUri\n    )\n    assert inst.item[2].careTeamSequence[0] == 1\n    assert inst.item[2].detail[0].net.currency == \"USD\"\n    assert float(inst.item[2].detail[0].net.value) == float(750.0)\n    assert inst.item[2].detail[0].productOrService.coding[0].code == \"27211\"\n    assert (\n        inst.item[2].detail[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[2].detail[0].sequence == 1\n    assert inst.item[2].detail[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[2].detail[0].unitPrice.value) == float(750.0)\n    assert inst.item[2].detail[1].net.currency == \"USD\"\n    assert float(inst.item[2].detail[1].net.value) == float(350.0)\n    assert inst.item[2].detail[1].productOrService.coding[0].code == \"lab\"\n    assert (\n        inst.item[2].detail[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[2].detail[1].sequence == 2\n    assert inst.item[2].detail[1].unitPrice.currency == \"USD\"\n    assert float(inst.item[2].detail[1].unitPrice.value) == float(350.0)\n    assert inst.item[2].net.currency == \"USD\"\n    assert float(inst.item[2].net.value) == float(1100.0)\n    assert inst.item[2].productOrService.coding[0].code == \"27211\"\n    assert (\n        inst.item[2].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[2].sequence == 3\n    assert (\n        inst.item[2].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[2].unitPrice.currency == \"USD\"\n    assert float(inst.item[2].unitPrice.value) == float(1100.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Oral Health Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"preauthorization\"\n\n\ndef test_claim_9(base_settings):\n    \"\"\"No. 9 tests collection for Claim.\n    Test File: claim-example-oral-orthoplan.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example-oral-orthoplan.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_9(inst2)\n\n\ndef impl_claim_10(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert inst.contained[0].id == \"patient-1\"\n    assert inst.contained[1].id == \"coverage-1\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-10-16T00:00:00-07:00\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"M96.1\"\n    assert (\n        inst.diagnosis[0].diagnosisCodeableConcept.coding[0].display\n        == \"Postlaminectomy syndrome, not elsewhere classified\"\n    )\n    assert (\n        inst.diagnosis[0].diagnosisCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-10-cm\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.diagnosis[1].diagnosisCodeableConcept.coding[0].code == \"G89.4\"\n    assert (\n        inst.diagnosis[1].diagnosisCodeableConcept.coding[0].display\n        == \"Chronic pain syndrome\"\n    )\n    assert (\n        inst.diagnosis[1].diagnosisCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-10-cm\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[1].sequence == 2\n    assert inst.diagnosis[2].diagnosisCodeableConcept.coding[0].code == \"M53.88\"\n    assert inst.diagnosis[2].diagnosisCodeableConcept.coding[0].display == (\n        \"Other specified dorsopathies, sacral and sacrococcygeal \" \"region\"\n    )\n    assert (\n        inst.diagnosis[2].diagnosisCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-10-cm\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[2].sequence == 3\n    assert inst.diagnosis[3].diagnosisCodeableConcept.coding[0].code == \"M47.816\"\n    assert inst.diagnosis[3].diagnosisCodeableConcept.coding[0].display == (\n        \"Spondylosis without myelopathy or radiculopathy, lumbar \" \"region\"\n    )\n    assert (\n        inst.diagnosis[3].diagnosisCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-10-cm\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[3].sequence == 4\n    assert inst.id == \"MED-00050\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://CedarArmsMedicalCenter.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"MED-00050\"\n    assert inst.insurance[0].coverage.reference == \"#coverage-1\"\n    assert inst.insurance[0].focal is True\n    assert (\n        inst.insurance[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://CedarArmsMedicalCenter.com/claim\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].identifier.value == \"MED-00050\"\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.display == \"Humana Inc.\"\n    assert (\n        inst.insurer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bindb.com/bin\"}\n        ).valueUri\n    )\n    assert inst.insurer.identifier.value == \"123456\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].diagnosisSequence[0] == 2\n    assert inst.item[0].diagnosisSequence[1] == 4\n    assert inst.item[0].informationSequence[0] == 1\n    assert inst.item[0].locationCodeableConcept.coding[0].code == \"24\"\n    assert (\n        inst.item[0].locationCodeableConcept.coding[0].display\n        == \"Ambulatory Surgical Center\"\n    )\n    assert (\n        inst.item[0].locationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"https://www.cms.gov/medicare/coding/place-of-service-codes/place_of_service_code_set.html\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(12500.0)\n    assert inst.item[0].productOrService.coding[0].code == \"62264\"\n    assert (\n        inst.item[0].productOrService.coding[0].display\n        == \"Surgical Procedures on the Spine and Spinal Cord\"\n    )\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ama-assn.org/go/cpt\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-10-13\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(12500.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"#patient-1\"\n    assert inst.payee.party.reference == \"Organization/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert (\n        inst.payee.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payeetype\"}\n        ).valueUri\n    )\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.subType.coding[0].code == \"831\"\n    assert (\n        inst.subType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.cms.gov/codes/billtype\"}\n        ).valueUri\n    )\n    assert inst.supportingInfo[0].category.coding[0].code == \"hospitalized\"\n    assert (\n        inst.supportingInfo[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/claiminformationcategory\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[0].sequence == 1\n    assert (\n        inst.supportingInfo[0].timingPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-10-05T00:00:00-07:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.supportingInfo[0].timingPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-10-01T00:00:00-07:00\"}\n        ).valueDateTime\n    )\n    assert inst.supportingInfo[1].category.coding[0].code == \"discharge\"\n    assert (\n        inst.supportingInfo[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/claiminformationcategory\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[1].code.coding[0].code == \"01\"\n    assert (\n        inst.supportingInfo[1].code.coding[0].display\n        == \"Discharge to Home or Self Care\"\n    )\n    assert (\n        inst.supportingInfo[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"https://www.cms.gov/Outreach-and-Education/Medicare-Learning-Network-MLN/MLNMattersArticles/downloads/SE0801.pdf\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[1].sequence == 2\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of a CMS 1500 Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total.currency == \"USD\"\n    assert float(inst.total.value) == float(12500.0)\n    assert inst.type.coding[0].code == \"institutional\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_10(base_settings):\n    \"\"\"No. 10 tests collection for Claim.\n    Test File: claim-example-cms1500-medical.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example-cms1500-medical.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_claimresponse.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClaimResponse\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import claimresponse\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_claimresponse_1(inst):\n    assert inst.addItem[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.addItem[0].adjudication[0].amount.value) == float(250.0)\n    assert inst.addItem[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.addItem[0].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.addItem[0].adjudication[1].amount.value) == float(10.0)\n    assert inst.addItem[0].adjudication[1].category.coding[0].code == \"copay\"\n    assert inst.addItem[0].adjudication[2].category.coding[0].code == \"eligpercent\"\n    assert float(inst.addItem[0].adjudication[2].value) == float(100.0)\n    assert inst.addItem[0].adjudication[3].amount.currency == \"USD\"\n    assert float(inst.addItem[0].adjudication[3].amount.value) == float(240.0)\n    assert inst.addItem[0].adjudication[3].category.coding[0].code == \"benefit\"\n    assert inst.addItem[0].itemSequence[0] == 1\n    assert inst.addItem[0].modifier[0].coding[0].code == \"x\"\n    assert inst.addItem[0].modifier[0].coding[0].display == \"None\"\n    assert (\n        inst.addItem[0].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/modifiers\"}\n        ).valueUri\n    )\n    assert inst.addItem[0].net.currency == \"USD\"\n    assert float(inst.addItem[0].net.value) == float(250.0)\n    assert inst.addItem[0].noteNumber[0] == 101\n    assert inst.addItem[0].productOrService.coding[0].code == \"1101\"\n    assert (\n        inst.addItem[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.addItem[1].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.addItem[1].adjudication[0].amount.value) == float(800.0)\n    assert inst.addItem[1].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.addItem[1].adjudication[1].category.coding[0].code == \"eligpercent\"\n    assert float(inst.addItem[1].adjudication[1].value) == float(100.0)\n    assert inst.addItem[1].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.addItem[1].adjudication[2].amount.value) == float(800.0)\n    assert inst.addItem[1].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.addItem[1].itemSequence[0] == 1\n    assert inst.addItem[1].net.currency == \"USD\"\n    assert float(inst.addItem[1].net.value) == float(800.0)\n    assert inst.addItem[1].productOrService.coding[0].code == \"2101\"\n    assert (\n        inst.addItem[1].productOrService.coding[0].display == \"Radiograph, series (12)\"\n    )\n    assert (\n        inst.addItem[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == (\n        \"The enclosed services are authorized for your provision \"\n        \"within 30 days of this notice.\"\n    )\n    assert inst.id == \"UR3503\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.SocialBenefitsInc.com/fhir/ClaimResponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"UR3503\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert (\n        inst.insurer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.org/insurers\"}\n        ).valueUri\n    )\n    assert inst.insurer.identifier.value == \"444123\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payeeType.coding[0].code == \"provider\"\n    assert (\n        inst.payeeType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payeetype\"}\n        ).valueUri\n    )\n    assert inst.preAuthRef == \"18SS12345\"\n    assert inst.processNote[0].language.coding[0].code == \"en-CA\"\n    assert (\n        inst.processNote[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].number == 101\n    assert inst.processNote[0].text == (\n        \"Please submit a Pre-Authorization request if a more \"\n        \"extensive examination or urgent services are required.\"\n    )\n    assert inst.processNote[0].type == \"print\"\n    assert inst.requestor.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A sample '\n        \"unsolicited pre-authorization response which authorizes \"\n        \"basic dental services to be performed for a patient.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total[0].amount.currency == \"USD\"\n    assert float(inst.total[0].amount.value) == float(1050.0)\n    assert inst.total[0].category.coding[0].code == \"submitted\"\n    assert inst.total[1].amount.currency == \"USD\"\n    assert float(inst.total[1].amount.value) == float(1040.0)\n    assert inst.total[1].category.coding[0].code == \"benefit\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"preauthorization\"\n\n\ndef test_claimresponse_1(base_settings):\n    \"\"\"No. 1 tests collection for ClaimResponse.\n    Test File: claimresponse-example-unsolicited-preauth.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"claimresponse-example-unsolicited-preauth.json\"\n    )\n    inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes())\n    assert \"ClaimResponse\" == inst.get_resource_type()\n\n    impl_claimresponse_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClaimResponse\" == data[\"resourceType\"]\n\n    inst2 = claimresponse.ClaimResponse(**data)\n    impl_claimresponse_1(inst2)\n\n\ndef impl_claimresponse_2(inst):\n    assert inst.addItem[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.addItem[0].adjudication[0].amount.value) == float(100.0)\n    assert inst.addItem[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.addItem[0].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.addItem[0].adjudication[1].amount.value) == float(10.0)\n    assert inst.addItem[0].adjudication[1].category.coding[0].code == \"copay\"\n    assert inst.addItem[0].adjudication[2].category.coding[0].code == \"eligpercent\"\n    assert float(inst.addItem[0].adjudication[2].value) == float(80.0)\n    assert inst.addItem[0].adjudication[3].amount.currency == \"USD\"\n    assert float(inst.addItem[0].adjudication[3].amount.value) == float(72.0)\n    assert inst.addItem[0].adjudication[3].category.coding[0].code == \"benefit\"\n    assert inst.addItem[0].adjudication[3].reason.coding[0].code == \"ar002\"\n    assert (\n        inst.addItem[0].adjudication[3].reason.coding[0].display == \"Plan Limit Reached\"\n    )\n    assert (\n        inst.addItem[0].adjudication[3].reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/adjudication-reason\"}\n        ).valueUri\n    )\n    assert inst.addItem[0].itemSequence[0] == 1\n    assert inst.addItem[0].modifier[0].coding[0].code == \"x\"\n    assert inst.addItem[0].modifier[0].coding[0].display == \"None\"\n    assert (\n        inst.addItem[0].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/modifiers\"}\n        ).valueUri\n    )\n    assert inst.addItem[0].net.currency == \"USD\"\n    assert float(inst.addItem[0].net.value) == float(135.57)\n    assert inst.addItem[0].noteNumber[0] == 101\n    assert inst.addItem[0].productOrService.coding[0].code == \"1101\"\n    assert (\n        inst.addItem[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.addItem[1].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.addItem[1].adjudication[0].amount.value) == float(35.57)\n    assert inst.addItem[1].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.addItem[1].adjudication[1].category.coding[0].code == \"eligpercent\"\n    assert float(inst.addItem[1].adjudication[1].value) == float(80.0)\n    assert inst.addItem[1].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.addItem[1].adjudication[2].amount.value) == float(28.47)\n    assert inst.addItem[1].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.addItem[1].itemSequence[0] == 1\n    assert inst.addItem[1].net.currency == \"USD\"\n    assert float(inst.addItem[1].net.value) == float(35.57)\n    assert inst.addItem[1].productOrService.coding[0].code == \"2141\"\n    assert inst.addItem[1].productOrService.coding[0].display == \"Radiograph, bytewing\"\n    assert (\n        inst.addItem[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.addItem[2].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.addItem[2].adjudication[0].amount.value) == float(350.0)\n    assert inst.addItem[2].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.addItem[2].adjudication[1].category.coding[0].code == \"eligpercent\"\n    assert float(inst.addItem[2].adjudication[1].value) == float(80.0)\n    assert inst.addItem[2].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.addItem[2].adjudication[2].amount.value) == float(270.0)\n    assert inst.addItem[2].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.addItem[2].detailSequence[0] == 2\n    assert inst.addItem[2].itemSequence[0] == 3\n    assert inst.addItem[2].modifier[0].coding[0].code == \"x\"\n    assert inst.addItem[2].modifier[0].coding[0].display == \"None\"\n    assert (\n        inst.addItem[2].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/modifiers\"}\n        ).valueUri\n    )\n    assert inst.addItem[2].net.currency == \"USD\"\n    assert float(inst.addItem[2].net.value) == float(350.0)\n    assert inst.addItem[2].noteNumber[0] == 101\n    assert inst.addItem[2].productOrService.coding[0].code == \"expense\"\n    assert (\n        inst.addItem[2].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Claim settled as per contract.\"\n    assert inst.id == \"R3503\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/remittance\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"R3503\"\n    assert (\n        inst.insurer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.org/insurers\"}\n        ).valueUri\n    )\n    assert inst.insurer.identifier.value == \"555123\"\n    assert inst.item[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[0].amount.value) == float(0.0)\n    assert inst.item[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[0].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[1].amount.value) == float(0.0)\n    assert inst.item[0].adjudication[1].category.coding[0].code == \"benefit\"\n    assert inst.item[0].itemSequence == 1\n    assert inst.item[1].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[1].adjudication[0].amount.value) == float(105.0)\n    assert inst.item[1].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[1].adjudication[1].category.coding[0].code == \"eligpercent\"\n    assert float(inst.item[1].adjudication[1].value) == float(80.0)\n    assert inst.item[1].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.item[1].adjudication[2].amount.value) == float(84.0)\n    assert inst.item[1].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.item[1].itemSequence == 2\n    assert inst.item[2].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[2].adjudication[0].amount.value) == float(750.0)\n    assert inst.item[2].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[2].adjudication[1].category.coding[0].code == \"eligpercent\"\n    assert float(inst.item[2].adjudication[1].value) == float(80.0)\n    assert inst.item[2].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.item[2].adjudication[2].amount.value) == float(600.0)\n    assert inst.item[2].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.item[2].detail[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[2].detail[0].adjudication[0].amount.value) == float(750.0)\n    assert inst.item[2].detail[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert (\n        inst.item[2].detail[0].adjudication[1].category.coding[0].code == \"eligpercent\"\n    )\n    assert float(inst.item[2].detail[0].adjudication[1].value) == float(80.0)\n    assert inst.item[2].detail[0].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.item[2].detail[0].adjudication[2].amount.value) == float(600.0)\n    assert inst.item[2].detail[0].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.item[2].detail[0].detailSequence == 1\n    assert inst.item[2].detail[1].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[2].detail[1].adjudication[0].amount.value) == float(0.0)\n    assert inst.item[2].detail[1].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[2].detail[1].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.item[2].detail[1].adjudication[1].amount.value) == float(0.0)\n    assert inst.item[2].detail[1].adjudication[1].category.coding[0].code == \"benefit\"\n    assert inst.item[2].detail[1].detailSequence == 2\n    assert inst.item[2].itemSequence == 3\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payeeType.coding[0].code == \"provider\"\n    assert (\n        inst.payeeType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payeetype\"}\n        ).valueUri\n    )\n    assert inst.payment.amount.currency == \"USD\"\n    assert float(inst.payment.amount.value) == float(100.47)\n    assert (\n        inst.payment.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-31\"}).valueDate\n    )\n    assert (\n        inst.payment.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/paymentidentifier\"}\n        ).valueUri\n    )\n    assert inst.payment.identifier.value == \"201408-2-15507\"\n    assert inst.payment.type.coding[0].code == \"complete\"\n    assert (\n        inst.payment.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-paymenttype\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].language.coding[0].code == \"en-CA\"\n    assert (\n        inst.processNote[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].number == 101\n    assert (\n        inst.processNote[0].text\n        == \"Package codes are not permitted. Codes replaced by Insurer.\"\n    )\n    assert inst.processNote[0].type == \"print\"\n    assert (\n        inst.request.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.request.identifier.value == \"12346\"\n    assert inst.requestor.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the ClaimResponse to Claim Oral Average with \"\n        \"additional items</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total[0].amount.currency == \"USD\"\n    assert float(inst.total[0].amount.value) == float(1340.57)\n    assert inst.total[0].category.coding[0].code == \"submitted\"\n    assert inst.total[1].amount.currency == \"USD\"\n    assert float(inst.total[1].amount.value) == float(1054.47)\n    assert inst.total[1].category.coding[0].code == \"benefit\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claimresponse_2(base_settings):\n    \"\"\"No. 2 tests collection for ClaimResponse.\n    Test File: claimresponse-example-additem.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claimresponse-example-additem.json\"\n    inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes())\n    assert \"ClaimResponse\" == inst.get_resource_type()\n\n    impl_claimresponse_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClaimResponse\" == data[\"resourceType\"]\n\n    inst2 = claimresponse.ClaimResponse(**data)\n    impl_claimresponse_2(inst2)\n\n\ndef impl_claimresponse_3(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Claim settled as per contract.\"\n    assert inst.id == \"R3500\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/remittance\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"R3500\"\n    assert (\n        inst.insurer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.org/insurers\"}\n        ).valueUri\n    )\n    assert inst.insurer.identifier.value == \"555123\"\n    assert inst.item[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[0].amount.value) == float(135.57)\n    assert inst.item[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[0].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[1].amount.value) == float(10.0)\n    assert inst.item[0].adjudication[1].category.coding[0].code == \"copay\"\n    assert inst.item[0].adjudication[2].category.coding[0].code == \"eligpercent\"\n    assert float(inst.item[0].adjudication[2].value) == float(80.0)\n    assert inst.item[0].adjudication[3].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[3].amount.value) == float(90.47)\n    assert inst.item[0].adjudication[3].category.coding[0].code == \"benefit\"\n    assert inst.item[0].adjudication[3].reason.coding[0].code == \"ar002\"\n    assert inst.item[0].adjudication[3].reason.coding[0].display == \"Plan Limit Reached\"\n    assert (\n        inst.item[0].adjudication[3].reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/adjudication-reason\"}\n        ).valueUri\n    )\n    assert inst.item[0].itemSequence == 1\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payeeType.coding[0].code == \"provider\"\n    assert (\n        inst.payeeType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payeetype\"}\n        ).valueUri\n    )\n    assert inst.payment.amount.currency == \"USD\"\n    assert float(inst.payment.amount.value) == float(100.47)\n    assert (\n        inst.payment.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-31\"}).valueDate\n    )\n    assert (\n        inst.payment.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/paymentidentifier\"}\n        ).valueUri\n    )\n    assert inst.payment.identifier.value == \"201408-2-1569478\"\n    assert inst.payment.type.coding[0].code == \"complete\"\n    assert (\n        inst.payment.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-paymenttype\"}\n        ).valueUri\n    )\n    assert (\n        inst.request.reference\n        == \"http://www.BenefitsInc.com/fhir/oralhealthclaim/15476332402\"\n    )\n    assert inst.requestor.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.subType.coding[0].code == \"emergency\"\n    assert (\n        inst.subType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-claimsubtype\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the ClaimResponse</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total[0].amount.currency == \"USD\"\n    assert float(inst.total[0].amount.value) == float(135.57)\n    assert inst.total[0].category.coding[0].code == \"submitted\"\n    assert inst.total[1].amount.currency == \"USD\"\n    assert float(inst.total[1].amount.value) == float(90.47)\n    assert inst.total[1].category.coding[0].code == \"benefit\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claimresponse_3(base_settings):\n    \"\"\"No. 3 tests collection for ClaimResponse.\n    Test File: claimresponse-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claimresponse-example.json\"\n    inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes())\n    assert \"ClaimResponse\" == inst.get_resource_type()\n\n    impl_claimresponse_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClaimResponse\" == data[\"resourceType\"]\n\n    inst2 = claimresponse.ClaimResponse(**data)\n    impl_claimresponse_3(inst2)\n\n\ndef impl_claimresponse_4(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Claim settled as per contract.\"\n    assert inst.id == \"R3502\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://thebenefitcompany.com/claimresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"CR6532875367\"\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[0].amount.value) == float(235.4)\n    assert inst.item[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[0].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[1].amount.value) == float(20.0)\n    assert inst.item[0].adjudication[1].category.coding[0].code == \"copay\"\n    assert inst.item[0].adjudication[2].category.coding[0].code == \"eligpercent\"\n    assert float(inst.item[0].adjudication[2].value) == float(80.0)\n    assert inst.item[0].adjudication[3].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[3].amount.value) == float(172.32)\n    assert inst.item[0].adjudication[3].category.coding[0].code == \"benefit\"\n    assert inst.item[0].detail[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[0].adjudication[0].amount.value) == float(100.0)\n    assert inst.item[0].detail[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[0].detail[0].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[0].adjudication[1].amount.value) == float(20.0)\n    assert inst.item[0].detail[0].adjudication[1].category.coding[0].code == \"copay\"\n    assert (\n        inst.item[0].detail[0].adjudication[2].category.coding[0].code == \"eligpercent\"\n    )\n    assert float(inst.item[0].detail[0].adjudication[2].value) == float(80.0)\n    assert inst.item[0].detail[0].adjudication[3].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[0].adjudication[3].amount.value) == float(80.0)\n    assert inst.item[0].detail[0].adjudication[3].category.coding[0].code == \"benefit\"\n    assert inst.item[0].detail[0].detailSequence == 1\n    assert inst.item[0].detail[0].noteNumber[0] == 1\n    assert inst.item[0].detail[1].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[1].adjudication[0].amount.value) == float(110.0)\n    assert inst.item[0].detail[1].adjudication[0].category.coding[0].code == \"eligible\"\n    assert (\n        inst.item[0].detail[1].adjudication[1].category.coding[0].code == \"eligpercent\"\n    )\n    assert float(inst.item[0].detail[1].adjudication[1].value) == float(80.0)\n    assert inst.item[0].detail[1].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[1].adjudication[2].amount.value) == float(88.0)\n    assert inst.item[0].detail[1].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.item[0].detail[1].detailSequence == 2\n    assert inst.item[0].detail[1].noteNumber[0] == 1\n    assert inst.item[0].detail[1].subDetail[0].adjudication[0].amount.currency == \"USD\"\n    assert float(\n        inst.item[0].detail[1].subDetail[0].adjudication[0].amount.value\n    ) == float(60.0)\n    assert (\n        inst.item[0].detail[1].subDetail[0].adjudication[0].category.coding[0].code\n        == \"eligible\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[0].adjudication[1].category.coding[0].code\n        == \"eligpercent\"\n    )\n    assert float(inst.item[0].detail[1].subDetail[0].adjudication[1].value) == float(\n        80.0\n    )\n    assert inst.item[0].detail[1].subDetail[0].adjudication[2].amount.currency == \"USD\"\n    assert float(\n        inst.item[0].detail[1].subDetail[0].adjudication[2].amount.value\n    ) == float(48.0)\n    assert (\n        inst.item[0].detail[1].subDetail[0].adjudication[2].category.coding[0].code\n        == \"benefit\"\n    )\n    assert inst.item[0].detail[1].subDetail[0].noteNumber[0] == 1\n    assert inst.item[0].detail[1].subDetail[0].subDetailSequence == 1\n    assert inst.item[0].detail[1].subDetail[1].adjudication[0].amount.currency == \"USD\"\n    assert float(\n        inst.item[0].detail[1].subDetail[1].adjudication[0].amount.value\n    ) == float(30.0)\n    assert (\n        inst.item[0].detail[1].subDetail[1].adjudication[0].category.coding[0].code\n        == \"eligible\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[1].adjudication[1].category.coding[0].code\n        == \"eligpercent\"\n    )\n    assert float(inst.item[0].detail[1].subDetail[1].adjudication[1].value) == float(\n        80.0\n    )\n    assert inst.item[0].detail[1].subDetail[1].adjudication[2].amount.currency == \"USD\"\n    assert float(\n        inst.item[0].detail[1].subDetail[1].adjudication[2].amount.value\n    ) == float(24.0)\n    assert (\n        inst.item[0].detail[1].subDetail[1].adjudication[2].category.coding[0].code\n        == \"benefit\"\n    )\n    assert inst.item[0].detail[1].subDetail[1].subDetailSequence == 2\n    assert inst.item[0].detail[1].subDetail[2].adjudication[0].amount.currency == \"USD\"\n    assert float(\n        inst.item[0].detail[1].subDetail[2].adjudication[0].amount.value\n    ) == float(10.0)\n    assert (\n        inst.item[0].detail[1].subDetail[2].adjudication[0].category.coding[0].code\n        == \"eligible\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[2].adjudication[1].category.coding[0].code\n        == \"eligpercent\"\n    )\n    assert float(inst.item[0].detail[1].subDetail[2].adjudication[1].value) == float(\n        80.0\n    )\n    assert inst.item[0].detail[1].subDetail[2].adjudication[2].amount.currency == \"USD\"\n    assert float(\n        inst.item[0].detail[1].subDetail[2].adjudication[2].amount.value\n    ) == float(8.0)\n    assert (\n        inst.item[0].detail[1].subDetail[2].adjudication[2].category.coding[0].code\n        == \"benefit\"\n    )\n    assert inst.item[0].detail[1].subDetail[2].noteNumber[0] == 1\n    assert inst.item[0].detail[1].subDetail[2].subDetailSequence == 3\n    assert inst.item[0].detail[2].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[2].adjudication[0].amount.value) == float(200.0)\n    assert inst.item[0].detail[2].adjudication[0].category.coding[0].code == \"eligible\"\n    assert (\n        inst.item[0].detail[2].adjudication[1].category.coding[0].code == \"eligpercent\"\n    )\n    assert float(inst.item[0].detail[2].adjudication[1].value) == float(80.0)\n    assert inst.item[0].detail[2].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[2].adjudication[2].amount.value) == float(14.0)\n    assert inst.item[0].detail[2].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.item[0].detail[2].detailSequence == 3\n    assert inst.item[0].detail[2].noteNumber[0] == 1\n    assert inst.item[0].itemSequence == 1\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payeeType.coding[0].code == \"provider\"\n    assert (\n        inst.payeeType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payeetype\"}\n        ).valueUri\n    )\n    assert inst.payment.adjustment.currency == \"USD\"\n    assert float(inst.payment.adjustment.value) == float(75.0)\n    assert inst.payment.adjustmentReason.coding[0].code == \"a002\"\n    assert inst.payment.adjustmentReason.coding[0].display == \"Prior Overpayment\"\n    assert (\n        inst.payment.adjustmentReason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/payment-adjustment-reason\"\n            }\n        ).valueUri\n    )\n    assert inst.payment.amount.currency == \"USD\"\n    assert float(inst.payment.amount.value) == float(107.0)\n    assert (\n        inst.payment.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert (\n        inst.payment.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://thebenefitcompany.com/paymentidentifier\"}\n        ).valueUri\n    )\n    assert inst.payment.identifier.value == \"201416-123456\"\n    assert inst.payment.type.coding[0].code == \"complete\"\n    assert (\n        inst.payment.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-paymenttype\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].language.coding[0].code == \"en-CA\"\n    assert (\n        inst.processNote[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].number == 1\n    assert inst.processNote[0].text == \"After hours surcharge declined\"\n    assert inst.processNote[0].type == \"display\"\n    assert (\n        inst.request.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happysight.com/claim\"}\n        ).valueUri\n    )\n    assert inst.request.identifier.value == \"6612346\"\n    assert inst.requestor.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the ClaimResponse</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total[0].amount.currency == \"USD\"\n    assert float(inst.total[0].amount.value) == float(235.4)\n    assert inst.total[0].category.coding[0].code == \"submitted\"\n    assert inst.total[1].amount.currency == \"USD\"\n    assert float(inst.total[1].amount.value) == float(182.0)\n    assert inst.total[1].category.coding[0].code == \"benefit\"\n    assert inst.type.coding[0].code == \"vision\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claimresponse_4(base_settings):\n    \"\"\"No. 4 tests collection for ClaimResponse.\n    Test File: claimresponse-example-vision-3tier.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"claimresponse-example-vision-3tier.json\"\n    )\n    inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes())\n    assert \"ClaimResponse\" == inst.get_resource_type()\n\n    impl_claimresponse_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClaimResponse\" == data[\"resourceType\"]\n\n    inst2 = claimresponse.ClaimResponse(**data)\n    impl_claimresponse_4(inst2)\n\n\ndef impl_claimresponse_5(inst):\n    assert inst.communicationRequest[0].reference == \"CommunicationRequest/fm-solicit\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Claim could not be processed\"\n    assert inst.error[0].code.coding[0].code == \"a002\"\n    assert (\n        inst.error[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/adjudication-error\"}\n        ).valueUri\n    )\n    assert inst.error[0].detailSequence == 2\n    assert inst.error[0].itemSequence == 3\n    assert inst.formCode.coding[0].code == \"2\"\n    assert (\n        inst.formCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/forms-codes\"}\n        ).valueUri\n    )\n    assert inst.id == \"R3501\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/remittance\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"R3501\"\n    assert (\n        inst.insurer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.org/insurers\"}\n        ).valueUri\n    )\n    assert inst.insurer.identifier.value == \"555123\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"error\"\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.processNote[0].language.coding[0].code == \"en-CA\"\n    assert (\n        inst.processNote[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].number == 1\n    assert inst.processNote[0].text == \"Invalid claim\"\n    assert inst.processNote[0].type == \"display\"\n    assert inst.request.reference == \"Claim/100156\"\n    assert inst.requestor.reference == \"Practitioner/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the ClaimResponse that demonstrates returning \"\n        \"errors</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claimresponse_5(base_settings):\n    \"\"\"No. 5 tests collection for ClaimResponse.\n    Test File: claimresponse-example-2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claimresponse-example-2.json\"\n    inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes())\n    assert \"ClaimResponse\" == inst.get_resource_type()\n\n    impl_claimresponse_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClaimResponse\" == data[\"resourceType\"]\n\n    inst2 = claimresponse.ClaimResponse(**data)\n    impl_claimresponse_5(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_clinicalimpression.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClinicalImpression\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import clinicalimpression\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_clinicalimpression_1(inst):\n    assert inst.assessor.reference == \"Practitioner/example\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-06T22:33:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This 26 yo male patient is brought into ER by ambulance \"\n        \"after being involved in a motor vehicle accident\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-06T22:33:00+11:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-06T20:00:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.finding[0].itemCodeableConcept.coding[0].code == \"850.0\"\n    assert (\n        inst.finding[0].itemCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-9\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.investigation[0].code.text == \"Initial Examination\"\n    assert (\n        inst.investigation[0].item[0].display\n        == \"deep laceration of the scalp (left temporo-occipital)\"\n    )\n    assert inst.investigation[0].item[1].display == \"decreased level of consciousness\"\n    assert inst.investigation[0].item[2].display == \"disoriented to time and place\"\n    assert inst.investigation[0].item[3].display == \"restless\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.problem[0].display == \"MVA\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.summary == (\n        \"provisional diagnoses of laceration of head and traumatic \"\n        \"brain injury (TBI)\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_clinicalimpression_1(base_settings):\n    \"\"\"No. 1 tests collection for ClinicalImpression.\n    Test File: clinicalimpression-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"clinicalimpression-example.json\"\n    inst = clinicalimpression.ClinicalImpression.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ClinicalImpression\" == inst.get_resource_type()\n\n    impl_clinicalimpression_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClinicalImpression\" == data[\"resourceType\"]\n\n    inst2 = clinicalimpression.ClinicalImpression(**data)\n    impl_clinicalimpression_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_clinicalusedefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClinicalUseDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import clinicalusedefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_clinicalusedefinition_1(inst):\n    assert (\n        inst.contraindication.comorbidity[0].concept.coding[0].code == \"Hepaticdisease\"\n    )\n    assert (\n        inst.contraindication.comorbidity[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/comorbidity\"}\n        ).valueUri\n    )\n    assert (\n        inst.contraindication.diseaseSymptomProcedure.concept.coding[0].code\n        == \"Coagulopathiesandbleedingdiatheses(exclthrombocytopenic)\"\n    )\n    assert (\n        inst.contraindication.diseaseSymptomProcedure.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://ema.europa.eu/example/contraindicationsasdisease-symptom-procedure\"\n            }\n        ).valueUri\n    )\n    assert inst.contraindication.diseaseSymptomProcedure.concept.text == (\n        \"Hepatic disease associated with coagulopathy and clinically \"\n        \"relevant bleeding risk\"\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"contraindication\"\n\n\ndef test_clinicalusedefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ClinicalUseDefinition.\n    Test File: clinicalusedefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"clinicalusedefinition-example.json\"\n    inst = clinicalusedefinition.ClinicalUseDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ClinicalUseDefinition\" == inst.get_resource_type()\n\n    impl_clinicalusedefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClinicalUseDefinition\" == data[\"resourceType\"]\n\n    inst2 = clinicalusedefinition.ClinicalUseDefinition(**data)\n    impl_clinicalusedefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_codesystem.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CodeSystem\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import codesystem\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_codesystem_1(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"source\"\n    assert inst.concept[0].definition == (\n        \"This structure describes an instance passed to the mapping \"\n        \"engine that is used a source of data.\"\n    )\n    assert inst.concept[0].display == \"Source Structure Definition\"\n    assert inst.concept[1].code == \"queried\"\n    assert inst.concept[1].definition == (\n        \"This structure describes an instance that the mapping engine\"\n        \" may ask for that is used a source of data.\"\n    )\n    assert inst.concept[1].display == \"Queried Structure Definition\"\n    assert inst.concept[2].code == \"target\"\n    assert inst.concept[2].definition == (\n        \"This structure describes an instance passed to the mapping \"\n        \"engine that is used a target of data.\"\n    )\n    assert inst.concept[2].display == \"Target Structure Definition\"\n    assert inst.concept[3].code == \"produced\"\n    assert inst.concept[3].definition == (\n        \"This structure describes an instance that the mapping engine\"\n        \" may ask to create that is used a target of data.\"\n    )\n    assert inst.concept[3].display == \"Produced Structure Definition\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"How the referenced structure is used in this mapping.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fhir\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 2\n    assert inst.id == \"map-model-mode\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.676\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T13:47:40.239+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"StructureMapModelMode\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"StructureMapModelMode\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/map-model-mode\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/map-model-mode\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_codesystem_1(base_settings):\n    \"\"\"No. 1 tests collection for CodeSystem.\n    Test File: codesystem-map-model-mode.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"codesystem-map-model-mode.json\"\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_1(inst2)\n\n\ndef impl_codesystem_2(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"true\"\n    assert inst.concept[0].definition == \"Boolean true.\"\n    assert inst.concept[0].display == \"true\"\n    assert inst.concept[1].code == \"false\"\n    assert inst.concept[1].definition == \"Boolean false.\"\n    assert inst.concept[1].display == \"false\"\n    assert inst.concept[2].code == \"trace\"\n    assert inst.concept[2].definition == (\n        \"The content is greater than zero, but too small to be \" \"quantified.\"\n    )\n    assert inst.concept[2].display == \"Trace Amount Detected\"\n    assert inst.concept[3].code == \"sufficient\"\n    assert inst.concept[3].definition == (\n        \"The specific quantity is not known, but is known to be non-\"\n        \"zero and is not specified because it makes up the bulk of \"\n        \"the material.\"\n    )\n    assert inst.concept[3].display == \"Sufficient Quantity\"\n    assert (\n        inst.concept[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/codesystem-concept-comments\"\n            }\n        ).valueUri\n    )\n    assert inst.concept[3].extension[0].valueString == (\n        \"used in formulations (e.g. 'Add 10mg of ingredient X, 50mg \"\n        \"of ingredient Y, and sufficient quantity of water to 100mL.'\"\n        \" This code would be used to express the quantity of water. )\"\n    )\n    assert inst.concept[4].code == \"withdrawn\"\n    assert inst.concept[4].definition == \"The value is no longer available.\"\n    assert inst.concept[4].display == \"Value Withdrawn\"\n    assert inst.concept[5].code == \"nil-known\"\n    assert (\n        inst.concept[5].definition\n        == \"The are no known applicable values in this context.\"\n    )\n    assert inst.concept[5].display == \"Nil Known\"\n    assert (\n        inst.concept[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/codesystem-concept-comments\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.concept[5].extension[0].valueString\n        == \"The existence of this subject to review\"\n    )\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"A set of generally useful codes defined so they can be \"\n        \"included in value sets.\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fhir\"\n    assert inst.id == \"special-values\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.1.1049\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T12:47:40.239+10:00\"}\n        ).valueInstant\n    )\n    assert inst.name == \"SpecialValues\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"SpecialValues\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/special-values\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/special-values\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_codesystem_2(base_settings):\n    \"\"\"No. 2 tests collection for CodeSystem.\n    Test File: codesystem-special-values.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"codesystem-special-values.json\"\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_2(inst2)\n\n\ndef impl_codesystem_3(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"unknown\"\n    assert (\n        inst.concept[0].definition\n        == \"The communication was not done due to an unknown reason.\"\n    )\n    assert inst.concept[0].display == \"Unknown\"\n    assert inst.concept[1].code == \"system-error\"\n    assert (\n        inst.concept[1].definition\n        == \"The communication was not done due to a system error.\"\n    )\n    assert inst.concept[1].display == \"System Error\"\n    assert inst.concept[2].code == \"invalid-phone-number\"\n    assert inst.concept[2].definition == (\n        \"The communication was not done due to an invalid phone \" \"number.\"\n    )\n    assert inst.concept[2].display == \"Invalid Phone Number\"\n    assert inst.concept[3].code == \"recipient-unavailable\"\n    assert inst.concept[3].definition == (\n        \"The communication was not done due to the recipient being \" \"unavailable.\"\n    )\n    assert inst.concept[3].display == \"Recipient Unavailable\"\n    assert inst.concept[4].code == \"family-objection\"\n    assert (\n        inst.concept[4].definition\n        == \"The communication was not done due to a family objection.\"\n    )\n    assert inst.concept[4].display == \"Family Objection\"\n    assert inst.concept[5].code == \"patient-objection\"\n    assert (\n        inst.concept[5].definition\n        == \"The communication was not done due to a patient objection.\"\n    )\n    assert inst.concept[5].display == \"Patient Objection\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.description == \"Codes for the reason why a communication did not happen.\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"pc\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"draft\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"communication-not-done-reason\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.1077\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T13:47:40.239+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"CommunicationNotDoneReason\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"CommunicationNotDoneReason\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/communication-not-done-reason\"\n            }\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/communication-not-done-reason\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_codesystem_3(base_settings):\n    \"\"\"No. 3 tests collection for CodeSystem.\n    Test File: codesystem-communication-not-done-reason.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-communication-not-done-reason.json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_3(inst2)\n\n\ndef impl_codesystem_4(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"grouped-by\"\n    assert inst.concept[0].display == \"Grouped By\"\n    assert inst.concept[1].code == \"is-a\"\n    assert inst.concept[1].display == \"Is-A\"\n    assert inst.concept[2].code == \"part-of\"\n    assert inst.concept[2].definition == (\n        \"Child elements list the individual parts of a composite \"\n        \"whole (e.g. body site).\"\n    )\n    assert inst.concept[2].display == \"Part Of\"\n    assert inst.concept[3].code == \"classified-with\"\n    assert inst.concept[3].display == \"Classified With\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.description == \"The meaning of the hierarchy of concepts in a code system.\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"vocab\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"normative\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"4.0.0\"\n    assert (\n        inst.extension[3].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[3].valueInteger == 5\n    assert inst.id == \"codesystem-hierarchy-meaning\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.785\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T13:47:40.239+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"CodeSystemHierarchyMeaning\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"CodeSystemHierarchyMeaning\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/codesystem-hierarchy-meaning\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_codesystem_4(base_settings):\n    \"\"\"No. 4 tests collection for CodeSystem.\n    Test File: codesystem-codesystem-hierarchy-meaning.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-codesystem-hierarchy-meaning.json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_4(inst2)\n\n\ndef impl_codesystem_5(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"continuous\"\n    assert inst.concept[0].definition == (\n        \"A medication which is expected to be continued beyond the \"\n        \"present order and which the patient should be assumed to be \"\n        \"taking unless explicitly stopped.\"\n    )\n    assert inst.concept[0].display == \"Continuous long term therapy\"\n    assert inst.concept[1].code == \"acute\"\n    assert inst.concept[1].definition == (\n        \"A medication which the patient is only expected to consume \"\n        \"for the duration of the current order and which is not \"\n        \"expected to be renewed.\"\n    )\n    assert inst.concept[1].display == \"Short course (acute) therapy\"\n    assert inst.concept[2].code == \"seasonal\"\n    assert inst.concept[2].definition == (\n        \"A medication which is expected to be used on a part time \"\n        \"basis at certain times of the year\"\n    )\n    assert inst.concept[2].display == \"Seasonal\"\n    assert inst.content == \"complete\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"phx\"\n    assert inst.id == \"medicationrequest-course-of-therapy\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.1.1327\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T12:47:40.239+10:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"MedicationRequest Course of Therapy Codes\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy\"\n            }\n        ).valueUri\n    )\n    assert inst.valueSet == (\n        \"http://hl7.org/fhir/ValueSet/medicationrequest-course-of-\" \"therapy\"\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_codesystem_5(base_settings):\n    \"\"\"No. 5 tests collection for CodeSystem.\n    Test File: codesystem-medicationrequest-course-of-therapy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-medicationrequest-course-of-therapy.json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_5(inst2)\n\n\ndef impl_codesystem_6(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"0\"\n    assert inst.concept[0].definition == (\n        \"The operation completed successfully (whether with warnings \" \"or not).\"\n    )\n    assert inst.concept[0].display == \"Success\"\n    assert inst.concept[1].code == \"4\"\n    assert inst.concept[1].definition == (\n        \"The action was not successful due to some kind of minor \"\n        \"failure (often equivalent to an HTTP 400 response).\"\n    )\n    assert inst.concept[1].display == \"Minor failure\"\n    assert inst.concept[2].code == \"8\"\n    assert inst.concept[2].definition == (\n        \"The action was not successful due to some kind of unexpected\"\n        \" error (often equivalent to an HTTP 500 response).\"\n    )\n    assert inst.concept[2].display == \"Serious failure\"\n    assert inst.concept[3].code == \"12\"\n    assert inst.concept[3].definition == (\n        \"An error of such magnitude occurred that the system is no \"\n        \"longer available for use (i.e. the system died).\"\n    )\n    assert inst.concept[3].display == \"Major failure\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Indicates whether the event succeeded or failed.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"sec\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 3\n    assert inst.id == \"audit-event-outcome\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.455\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T13:47:40.239+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"AuditEventOutcome\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"AuditEventOutcome\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/audit-event-outcome\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/audit-event-outcome\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_codesystem_6(base_settings):\n    \"\"\"No. 6 tests collection for CodeSystem.\n    Test File: codesystem-audit-event-outcome.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"codesystem-audit-event-outcome.json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_6(inst2)\n\n\ndef impl_codesystem_7(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"disclosure-ca\"\n    assert (\n        inst.concept[0].definition == \"Canadian health information disclosure policy.\"\n    )\n    assert inst.concept[0].display == \"Disclosure-CA\"\n    assert inst.concept[1].code == \"disclosure-us\"\n    assert (\n        inst.concept[1].definition\n        == \"United States health information disclosure policy.\"\n    )\n    assert inst.concept[1].display == \"Disclosure-US\"\n    assert inst.content == \"complete\"\n    assert inst.copyright == \"This is an example set.\"\n    assert inst.description == \"This value set includes sample Contract Subtype codes.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fm\"\n    assert inst.id == \"contract-subtype\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.1.0\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T12:47:40.239+10:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"ContractSubtypeCodes\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Contract Subtype Codes\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/contract-subtype\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_codesystem_7(base_settings):\n    \"\"\"No. 7 tests collection for CodeSystem.\n    Test File: codesystem-contract-subtype.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"codesystem-contract-subtype.json\"\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_7(inst2)\n\n\ndef impl_codesystem_8(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"create\"\n    assert inst.concept[0].definition == (\n        \"create(type : string) - type is passed through to the \"\n        \"application on the standard API, and must be known by it.\"\n    )\n    assert inst.concept[0].display == \"create\"\n    assert inst.concept[1].code == \"copy\"\n    assert inst.concept[1].definition == \"copy(source).\"\n    assert inst.concept[1].display == \"copy\"\n    assert inst.concept[2].code == \"truncate\"\n    assert (\n        inst.concept[2].definition\n        == \"truncate(source, length) - source must be stringy type.\"\n    )\n    assert inst.concept[2].display == \"truncate\"\n    assert inst.concept[3].code == \"escape\"\n    assert inst.concept[3].definition == (\n        \"escape(source, fmt1, fmt2) - change source from one kind of \"\n        \"escaping to another (plain, java, xml, json). note that this\"\n        \" is for when the string itself is escaped.\"\n    )\n    assert inst.concept[3].display == \"escape\"\n    assert inst.concept[4].code == \"cast\"\n    assert inst.concept[4].definition == (\n        \"cast(source, type?) - case source from one type to another. \"\n        \"target type can be left as implicit if there is one and only\"\n        \" one target type known.\"\n    )\n    assert inst.concept[4].display == \"cast\"\n    assert inst.concept[5].code == \"append\"\n    assert (\n        inst.concept[5].definition == \"append(source...) - source is element or string.\"\n    )\n    assert inst.concept[5].display == \"append\"\n    assert inst.concept[6].code == \"translate\"\n    assert (\n        inst.concept[6].definition\n        == \"translate(source, uri_of_map) - use the translate operation.\"\n    )\n    assert inst.concept[6].display == \"translate\"\n    assert inst.concept[7].code == \"reference\"\n    assert inst.concept[7].definition == (\n        \"reference(source : object) - return a string that references\"\n        \" the provided tree properly.\"\n    )\n    assert inst.concept[7].display == \"reference\"\n    assert inst.concept[8].code == \"dateOp\"\n    assert (\n        inst.concept[8].definition\n        == \"Perform a date operation. *Parameters to be documented*.\"\n    )\n    assert inst.concept[8].display == \"dateOp\"\n    assert inst.concept[9].code == \"uuid\"\n    assert (\n        inst.concept[9].definition\n        == \"Generate a random UUID (in lowercase). No Parameters.\"\n    )\n    assert inst.concept[9].display == \"uuid\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"How data is copied/created.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fhir\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 2\n    assert inst.id == \"map-transform\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.682\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T13:47:40.239+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"StructureMapTransform\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"StructureMapTransform\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/map-transform\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/map-transform\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_codesystem_8(base_settings):\n    \"\"\"No. 8 tests collection for CodeSystem.\n    Test File: codesystem-map-transform.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"codesystem-map-transform.json\"\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_8(inst2)\n\n\ndef impl_codesystem_9(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"contraindicated-only-with\"\n    assert (\n        inst.concept[0].definition\n        == \"Only contraindicated if the other therapy is given\"\n    )\n    assert (\n        inst.concept[0].display == \"Only contraindicated if the other therapy is given\"\n    )\n    assert inst.concept[1].code == \"contraindicated-except-with\"\n    assert (\n        inst.concept[1].definition\n        == \"Contraindicated unless the other therapy is given\"\n    )\n    assert (\n        inst.concept[1].display == \"Contraindicated unless the other therapy is given\"\n    )\n    assert inst.concept[2].code == \"indicated-only-with\"\n    assert inst.concept[2].definition == (\n        \"Indicated only when the other therapy is given (co-\" \"occurrent)\"\n    )\n    assert inst.concept[2].display == (\n        \"Indicated only when the other therapy is given (co-\" \"occurrent)\"\n    )\n    assert inst.concept[3].code == \"indicated-except-with\"\n    assert (\n        inst.concept[3].definition == \"Indicated except when the other therapy is given\"\n    )\n    assert inst.concept[3].display == \"Indicated except when the other therapy is given\"\n    assert inst.concept[4].code == \"indicated-only-before\"\n    assert inst.concept[4].definition == (\n        \"Indicated only if the other therapy is planned to be given \"\n        \"afterwards (prep)\"\n    )\n    assert inst.concept[4].display == (\n        \"Indicated only if the other therapy is planned to be given \"\n        \"afterwards (prep)\"\n    )\n    assert inst.concept[5].code == \"indicated-only-before\"\n    assert inst.concept[5].definition == (\n        \"Indicated only if the other therapy was given before \" \"(follow-up)\"\n    )\n    assert inst.concept[5].display == (\n        \"Indicated only if the other therapy was given before \" \"(follow-up)\"\n    )\n    assert inst.concept[6].code == \"replace-other-therapy\"\n    assert inst.concept[6].definition == \"Indicated to replace the other therapy\"\n    assert inst.concept[6].display == \"Indicated to replace the other therapy\"\n    assert inst.concept[7].code == \"replace-other-therapy-contraindicated\"\n    assert (\n        inst.concept[7].definition\n        == \"Indicated to replace the other contraindicated therapy.\"\n    )\n    assert (\n        inst.concept[7].display\n        == \"Indicated to replace the other contraindicated therapy\"\n    )\n    assert inst.concept[8].code == \"replace-other-therapy-not-tolerated\"\n    assert inst.concept[8].definition == (\n        \"Indicated to replace the other therapy not well tolerated by\" \" patient\"\n    )\n    assert inst.concept[8].display == (\n        \"Indicated to replace the other therapy not well tolerated by\" \" patient\"\n    )\n    assert inst.concept[9].code == \"replace-other-therapy-not-effective\"\n    assert inst.concept[9].definition == (\n        \"Indicated to replace the other therapy not effective on \" \"patient\"\n    )\n    assert inst.concept[9].display == (\n        \"Indicated to replace the other therapy not effective on \" \"patient\"\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-08-15T16:55:11+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Classification of relationship between a therapy and a \"\n        \"contraindication or an indication.\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"brr\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"therapy-relationship-type\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.1.1560\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T13:47:40.239+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"TherapyRelationshipType\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"TherapyRelationshipType\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/therapy-relationship-type\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/therapy-relationship-type\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_codesystem_9(base_settings):\n    \"\"\"No. 9 tests collection for CodeSystem.\n    Test File: codesystem-therapy-relationship-type.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"codesystem-therapy-relationship-type.json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_9(inst2)\n\n\ndef impl_codesystem_10(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"registered\"\n    assert inst.concept[0].definition == (\n        \"The existence of the imaging study is registered, but there \"\n        \"is nothing yet available.\"\n    )\n    assert inst.concept[0].display == \"Registered\"\n    assert inst.concept[1].code == \"available\"\n    assert inst.concept[1].definition == (\n        \"At least one instance has been associated with this imaging \" \"study.\"\n    )\n    assert inst.concept[1].display == \"Available\"\n    assert inst.concept[2].code == \"cancelled\"\n    assert inst.concept[2].definition == (\n        \"The imaging study is unavailable because the imaging study \"\n        \"was not started or not completed (also sometimes called \"\n        '\"aborted\").'\n    )\n    assert inst.concept[2].display == \"Cancelled\"\n    assert inst.concept[3].code == \"entered-in-error\"\n    assert inst.concept[3].display == \"Entered in Error\"\n    assert inst.concept[4].code == \"unknown\"\n    assert inst.concept[4].display == \"Unknown\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"The status of the ImagingStudy.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"ii\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 3\n    assert inst.id == \"imagingstudy-status\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.991\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T13:47:40.239+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"ImagingStudyStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"ImagingStudyStatus\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/imagingstudy-status\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/imagingstudy-status\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_codesystem_10(base_settings):\n    \"\"\"No. 10 tests collection for CodeSystem.\n    Test File: codesystem-imagingstudy-status.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"codesystem-imagingstudy-status.json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_communication.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Communication\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import communication\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_communication_1(inst):\n    assert (\n        inst.about[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.about[0].identifier.value == \"12345\"\n    assert (\n        inst.about[1].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/claimresponse\"}\n        ).valueUri\n    )\n    assert inst.about[1].identifier.value == \"R3500\"\n    assert inst.category[0].coding[0].code == \"SolicitedAttachment\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/messagetypes\"}\n        ).valueUri\n    )\n    assert inst.id == \"fm-attachment\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.providerco.com/communication\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.payload[0].contentAttachment.contentType == \"application/pdf\"\n    assert (\n        inst.payload[0].contentAttachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-02-01T11:50:23-05:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.payload[0].contentAttachment.data\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"SGVsbG8=\"}\n        ).valueBase64Binary\n    )\n    assert inst.payload[0].contentAttachment.title == \"accident notes 20100201.pdf\"\n    assert inst.payload[1].contentAttachment.contentType == \"application/pdf\"\n    assert (\n        inst.payload[1].contentAttachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-02-01T10:57:34+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.payload[1].contentAttachment.hash\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"SGVsbG8gdGhlcmU=\"}\n        ).valueBase64Binary\n    )\n    assert inst.payload[1].contentAttachment.size == 104274\n    assert (\n        inst.payload[1].contentAttachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://example.org/docs/AB12345\"}\n        ).valueUrl\n    )\n    assert (\n        inst.recipient[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.com/insurer\"}\n        ).valueUri\n    )\n    assert inst.recipient[0].identifier.value == \"123456\"\n    assert (\n        inst.sender.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.com/provideroffices\"}\n        ).valueUri\n    )\n    assert inst.sender.identifier.value == \"3456\"\n    assert (\n        inst.sent\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-12T18:01:10-08:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/1\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Attachment which'\n        \" is unsolicited</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_communication_1(base_settings):\n    \"\"\"No. 1 tests collection for Communication.\n    Test File: communication-example-fm-attachment.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"communication-example-fm-attachment.json\"\n    )\n    inst = communication.Communication.model_validate_json(filename.read_bytes())\n    assert \"Communication\" == inst.get_resource_type()\n\n    impl_communication_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Communication\" == data[\"resourceType\"]\n\n    inst2 = communication.Communication(**data)\n    impl_communication_1(inst2)\n\n\ndef impl_communication_2(inst):\n    assert inst.basedOn[0].reference == \"#request\"\n    assert inst.category[0].coding[0].code == \"SolicitedAttachment\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/messagetypes\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"provider\"\n    assert inst.contained[1].id == \"payor\"\n    assert inst.contained[2].id == \"request\"\n    assert inst.id == \"fm-solicited\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.providerco.com/communication\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.payload[0].contentAttachment.contentType == \"application/pdf\"\n    assert (\n        inst.payload[0].contentAttachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-02-01T11:50:23-05:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.payload[0].contentAttachment.data\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"SGVsbG8=\"}\n        ).valueBase64Binary\n    )\n    assert inst.payload[0].contentAttachment.title == \"accident notes 20100201.pdf\"\n    assert inst.payload[1].contentAttachment.contentType == \"application/pdf\"\n    assert (\n        inst.payload[1].contentAttachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-02-01T10:57:34+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.payload[1].contentAttachment.hash\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"SGVsbG8gdGhlcmU=\"}\n        ).valueBase64Binary\n    )\n    assert inst.payload[1].contentAttachment.size == 104274\n    assert (\n        inst.payload[1].contentAttachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://happyvalley.com/docs/AB12345\"}\n        ).valueUrl\n    )\n    assert inst.recipient[0].reference == \"#payor\"\n    assert inst.sender.reference == \"#provider\"\n    assert (\n        inst.sent\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-12T18:01:10-08:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/1\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Attachment in '\n        \"response to a Request</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_communication_2(base_settings):\n    \"\"\"No. 2 tests collection for Communication.\n    Test File: communication-example-fm-solicited-attachment.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"communication-example-fm-solicited-attachment.json\"\n    )\n    inst = communication.Communication.model_validate_json(filename.read_bytes())\n    assert \"Communication\" == inst.get_resource_type()\n\n    impl_communication_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Communication\" == data[\"resourceType\"]\n\n    inst2 = communication.Communication(**data)\n    impl_communication_2(inst2)\n\n\ndef impl_communication_3(inst):\n    assert inst.category[0].coding[0].code == \"Alert\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/messagetypes\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Alert\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"Paging System\"\n    assert inst.identifier[0].value == \"2345678901\"\n    assert (\n        inst.instantiatesUri[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/hyperkalemia\"}\n        ).valueUri\n    )\n    assert inst.medium[0].coding[0].code == \"WRITTEN\"\n    assert inst.medium[0].coding[0].display == \"written\"\n    assert (\n        inst.medium[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationMode\"}\n        ).valueUri\n    )\n    assert inst.medium[0].text == \"written\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.partOf[0].display == \"Serum Potassium Observation\"\n    assert inst.payload[0].contentString == (\n        \"Patient 1 has a very high serum potassium value (7.2 mmol/L \"\n        \"on 2014-Dec-12 at 5:55 pm)\"\n    )\n    assert inst.payload[1].contentReference.display == \"Serum Potassium Observation\"\n    assert (\n        inst.received\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-12T18:01:11-08:00\"}\n        ).valueDateTime\n    )\n    assert inst.recipient[0].reference == \"Practitioner/example\"\n    assert inst.sender.reference == \"Device/f001\"\n    assert (\n        inst.sent\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-12T18:01:10-08:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Patient has very'\n        \" high serum potassium</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_communication_3(base_settings):\n    \"\"\"No. 3 tests collection for Communication.\n    Test File: communication-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"communication-example.json\"\n    inst = communication.Communication.model_validate_json(filename.read_bytes())\n    assert \"Communication\" == inst.get_resource_type()\n\n    impl_communication_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Communication\" == data[\"resourceType\"]\n\n    inst2 = communication.Communication(**data)\n    impl_communication_3(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_communicationrequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CommunicationRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import communicationrequest\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_communicationrequest_1(inst):\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">To be filled out'\n        \" at a later time</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_communicationrequest_1(base_settings):\n    \"\"\"No. 1 tests collection for CommunicationRequest.\n    Test File: communicationrequest-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"communicationrequest-example.json\"\n    inst = communicationrequest.CommunicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CommunicationRequest\" == inst.get_resource_type()\n\n    impl_communicationrequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CommunicationRequest\" == data[\"resourceType\"]\n\n    inst2 = communicationrequest.CommunicationRequest(**data)\n    impl_communicationrequest_1(inst2)\n\n\ndef impl_communicationrequest_2(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-10T11:01:10-08:00\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].display == \"EligibilityRequest\"\n    assert inst.category[0].coding[0].code == \"SolicitedAttachmentRequest\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/messagetypes\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"provider\"\n    assert inst.contained[1].id == \"payor\"\n    assert inst.contained[2].id == \"requester\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.groupIdentifier.value == \"12345\"\n    assert inst.id == \"fm-solicit\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.com/insurer/123456\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"ABC123\"\n    assert inst.medium[0].coding[0].code == \"WRITTEN\"\n    assert inst.medium[0].coding[0].display == \"written\"\n    assert (\n        inst.medium[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationMode\"}\n        ).valueUri\n    )\n    assert inst.medium[0].text == \"written\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-10T11:01:10-08:00\"}\n        ).valueDateTime\n    )\n    assert inst.payload[0].contentString == (\n        \"Please provide the accident report and any associated \"\n        \"pictures to support your Claim# DEF5647.\"\n    )\n    assert inst.priority == \"routine\"\n    assert inst.recipient[0].reference == \"#provider\"\n    assert inst.replaces[0].display == \"prior CommunicationRequest\"\n    assert inst.requester.reference == \"#requester\"\n    assert inst.sender.reference == \"#payor\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Request for ' \"Accident Report</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_communicationrequest_2(base_settings):\n    \"\"\"No. 2 tests collection for CommunicationRequest.\n    Test File: communicationrequest-example-fm-solicit-attachment.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"communicationrequest-example-fm-solicit-attachment.json\"\n    )\n    inst = communicationrequest.CommunicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CommunicationRequest\" == inst.get_resource_type()\n\n    impl_communicationrequest_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CommunicationRequest\" == data[\"resourceType\"]\n\n    inst2 = communicationrequest.CommunicationRequest(**data)\n    impl_communicationrequest_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_compartmentdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CompartmentDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import compartmentdefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_compartmentdefinition_1(inst):\n    assert inst.code == \"Device\"\n    assert inst.contact[0].name == \"[string]\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-24\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"The set of resources associated with a particular Device \"\n        \"(example with Communication and CommunicationRequest \"\n        \"resourses only).\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"example\"\n    assert inst.name == \"EXAMPLE\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.purpose == (\n        \"Provides an example of a FHIR compartment definition based \"\n        \"on the Device resource type.\"\n    )\n    assert inst.resource[0].code == \"Communication\"\n    assert (\n        inst.resource[0].documentation\n        == \"The device used as the message sender and recipient\"\n    )\n    assert inst.resource[0].param[0] == \"sender\"\n    assert inst.resource[0].param[1] == \"recipient\"\n    assert inst.resource[1].code == \"CommunicationRequest\"\n    assert (\n        inst.resource[1].documentation\n        == \"The device used as the message sender and recipient\"\n    )\n    assert inst.resource[1].param[0] == \"sender\"\n    assert inst.resource[1].param[1] == \"recipient\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/example\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"Device\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n\n\ndef test_compartmentdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"compartmentdefinition-example.json\"\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_1(inst2)\n\n\ndef impl_compartmentdefinition_2(inst):\n    assert inst.code == \"RelatedPerson\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"relatedPerson\"\n    assert inst.name == \"Base FHIR compartment definition for RelatedPerson\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"AdministrableProductDefinition\"\n    assert inst.resource[3].code == \"AdverseEvent\"\n    assert inst.resource[3].param[0] == \"recorder\"\n    assert inst.resource[4].code == \"AllergyIntolerance\"\n    assert inst.resource[4].param[0] == \"asserter\"\n    assert inst.resource[5].code == \"Appointment\"\n    assert inst.resource[5].param[0] == \"actor\"\n    assert inst.resource[6].code == \"AppointmentResponse\"\n    assert inst.resource[6].param[0] == \"actor\"\n    assert inst.resource[7].code == \"AuditEvent\"\n    assert inst.resource[8].code == \"Basic\"\n    assert inst.resource[8].param[0] == \"author\"\n    assert inst.resource[9].code == \"Binary\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/relatedPerson\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_compartmentdefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-relatedperson.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"compartmentdefinition-relatedperson.json\"\n    )\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_2(inst2)\n\n\ndef impl_compartmentdefinition_3(inst):\n    assert inst.code == \"Patient\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"patient\"\n    assert inst.name == \"Base FHIR compartment definition for Patient\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[0].param[0] == \"subject\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"AdministrableProductDefinition\"\n    assert inst.resource[3].code == \"AdverseEvent\"\n    assert inst.resource[3].param[0] == \"subject\"\n    assert inst.resource[4].code == \"AllergyIntolerance\"\n    assert inst.resource[4].param[0] == \"patient\"\n    assert inst.resource[4].param[1] == \"recorder\"\n    assert inst.resource[4].param[2] == \"asserter\"\n    assert inst.resource[5].code == \"Appointment\"\n    assert inst.resource[5].param[0] == \"actor\"\n    assert inst.resource[6].code == \"AppointmentResponse\"\n    assert inst.resource[6].param[0] == \"actor\"\n    assert inst.resource[7].code == \"AuditEvent\"\n    assert inst.resource[7].param[0] == \"patient\"\n    assert inst.resource[8].code == \"Basic\"\n    assert inst.resource[8].param[0] == \"patient\"\n    assert inst.resource[8].param[1] == \"author\"\n    assert inst.resource[9].code == \"Binary\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/patient\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_compartmentdefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-patient.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"compartmentdefinition-patient.json\"\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_3(inst2)\n\n\ndef impl_compartmentdefinition_4(inst):\n    assert inst.code == \"Practitioner\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"practitioner\"\n    assert inst.name == \"Base FHIR compartment definition for Practitioner\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[0].param[0] == \"subject\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"AdministrableProductDefinition\"\n    assert inst.resource[3].code == \"AdverseEvent\"\n    assert inst.resource[3].param[0] == \"recorder\"\n    assert inst.resource[4].code == \"AllergyIntolerance\"\n    assert inst.resource[4].param[0] == \"recorder\"\n    assert inst.resource[4].param[1] == \"asserter\"\n    assert inst.resource[5].code == \"Appointment\"\n    assert inst.resource[5].param[0] == \"actor\"\n    assert inst.resource[6].code == \"AppointmentResponse\"\n    assert inst.resource[6].param[0] == \"actor\"\n    assert inst.resource[7].code == \"AuditEvent\"\n    assert inst.resource[7].param[0] == \"agent\"\n    assert inst.resource[8].code == \"Basic\"\n    assert inst.resource[8].param[0] == \"author\"\n    assert inst.resource[9].code == \"Binary\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/practitioner\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_compartmentdefinition_4(base_settings):\n    \"\"\"No. 4 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-practitioner.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"compartmentdefinition-practitioner.json\"\n    )\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_4(inst2)\n\n\ndef impl_compartmentdefinition_5(inst):\n    assert inst.code == \"Encounter\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"encounter\"\n    assert inst.name == \"Base FHIR compartment definition for Encounter\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"AdministrableProductDefinition\"\n    assert inst.resource[3].code == \"AdverseEvent\"\n    assert inst.resource[4].code == \"AllergyIntolerance\"\n    assert inst.resource[5].code == \"Appointment\"\n    assert inst.resource[6].code == \"AppointmentResponse\"\n    assert inst.resource[7].code == \"AuditEvent\"\n    assert inst.resource[8].code == \"Basic\"\n    assert inst.resource[9].code == \"Binary\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/encounter\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_compartmentdefinition_5(base_settings):\n    \"\"\"No. 5 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-encounter.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"compartmentdefinition-encounter.json\"\n    )\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_5(inst2)\n\n\ndef impl_compartmentdefinition_6(inst):\n    assert inst.code == \"Device\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"There is an instance of the device compartment for each \"\n        \"Device resource, and the identity of the compartment is the \"\n        \"same as the Device. The set of resources associated with a \"\n        \"particular device\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"device\"\n    assert inst.name == \"Base FHIR compartment definition for Device\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[0].param[0] == \"subject\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"AdministrableProductDefinition\"\n    assert inst.resource[3].code == \"AdverseEvent\"\n    assert inst.resource[4].code == \"AllergyIntolerance\"\n    assert inst.resource[5].code == \"Appointment\"\n    assert inst.resource[5].param[0] == \"actor\"\n    assert inst.resource[6].code == \"AppointmentResponse\"\n    assert inst.resource[6].param[0] == \"actor\"\n    assert inst.resource[7].code == \"AuditEvent\"\n    assert inst.resource[7].param[0] == \"agent\"\n    assert inst.resource[8].code == \"Basic\"\n    assert inst.resource[9].code == \"Binary\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/device\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_compartmentdefinition_6(base_settings):\n    \"\"\"No. 6 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-device.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"compartmentdefinition-device.json\"\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_6(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_composition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Composition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import composition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_composition_1(inst):\n    assert inst.attester[0].mode == \"legal\"\n    assert inst.attester[0].party.display == \"Harold Hippocrates, MD\"\n    assert inst.attester[0].party.reference == \"Practitioner/xcda-author\"\n    assert (\n        inst.attester[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04T09:10:14Z\"}\n        ).valueDateTime\n    )\n    assert inst.author[0].display == \"Harold Hippocrates, MD\"\n    assert inst.author[0].reference == \"Practitioner/xcda-author\"\n    assert inst.category[0].coding[0].code == \"LP173421-1\"\n    assert inst.category[0].coding[0].display == \"Report\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.confidentiality == \"N\"\n    assert inst.custodian.display == \"Good Health Clinic\"\n    assert inst.custodian.reference == \"Organization/2.16.840.1.113883.19.5\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-30T16:56:04+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-mixed\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.section[0].code.coding[0].code == \"newborn\"\n    assert inst.section[0].code.coding[0].display == \"New Born Details\"\n    assert (\n        inst.section[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/codes/SectionType\"}\n        ).valueUri\n    )\n    assert inst.section[0].text.status == \"generated\"\n    assert inst.section[0].title == \"Child's Details\"\n    assert inst.section[1].code.coding[0].code == \"mother\"\n    assert inst.section[1].code.coding[0].display == \"Mother's Details\"\n    assert (\n        inst.section[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/codes/SectionType\"}\n        ).valueUri\n    )\n    assert inst.section[1].text.status == \"generated\"\n    assert inst.section[1].title == \"Mpther's Details\"\n    assert inst.status == \"final\"\n    assert inst.subject.display == \"Tahlia Smith\"\n    assert inst.subject.reference == \"Patient/newborn\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Discharge Summary (Neonatal Service)\"\n    assert inst.type.coding[0].code == \"78418-1\"\n    assert (\n        inst.type.coding[0].display == \"Neonatal perinatal medicine Discharge summary\"\n    )\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_composition_1(base_settings):\n    \"\"\"No. 1 tests collection for Composition.\n    Test File: composition-example-mixed.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"composition-example-mixed.json\"\n    inst = composition.Composition.model_validate_json(filename.read_bytes())\n    assert \"Composition\" == inst.get_resource_type()\n\n    impl_composition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Composition\" == data[\"resourceType\"]\n\n    inst2 = composition.Composition(**data)\n    impl_composition_1(inst2)\n\n\ndef impl_composition_2(inst):\n    assert inst.attester[0].mode == \"legal\"\n    assert inst.attester[0].party.display == \"Harold Hippocrates, MD\"\n    assert inst.attester[0].party.reference == \"Practitioner/xcda-author\"\n    assert (\n        inst.attester[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04T09:10:14Z\"}\n        ).valueDateTime\n    )\n    assert inst.author[0].display == \"Harold Hippocrates, MD\"\n    assert inst.author[0].reference == \"Practitioner/xcda-author\"\n    assert inst.category[0].coding[0].code == \"LP173421-1\"\n    assert inst.category[0].coding[0].display == \"Report\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.confidentiality == \"N\"\n    assert inst.custodian.display == \"Good Health Clinic\"\n    assert inst.custodian.reference == \"Organization/2.16.840.1.113883.19.5\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04T09:10:14Z\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/xcda\"\n    assert inst.event[0].code[0].coding[0].code == \"HEALTHREC\"\n    assert inst.event[0].code[0].coding[0].display == \"health record\"\n    assert (\n        inst.event[0].code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.event[0].detail[0].reference == \"Observation/example\"\n    assert (\n        inst.event[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-11-12\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.event[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-07-18\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://healthintersections.com.au/test\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relatesTo[0].code == \"replaces\"\n    assert inst.relatesTo[0].targetReference.reference == \"Composition/old-example\"\n    assert inst.relatesTo[1].code == \"appends\"\n    assert (\n        inst.relatesTo[1].targetIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/NamingSystem/document-ids\"}\n        ).valueUri\n    )\n    assert inst.relatesTo[1].targetIdentifier.value == \"ABC123\"\n    assert inst.section[0].code.coding[0].code == \"11348-0\"\n    assert inst.section[0].code.coding[0].display == \"History of past illness Narrative\"\n    assert (\n        inst.section[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.section[0].entry[0].reference == \"Condition/stroke\"\n    assert inst.section[0].entry[1].reference == \"Condition/example\"\n    assert inst.section[0].entry[2].reference == \"Condition/example2\"\n    assert inst.section[0].mode == \"snapshot\"\n    assert inst.section[0].orderedBy.coding[0].code == \"event-date\"\n    assert inst.section[0].orderedBy.coding[0].display == \"Sorted by Event Date\"\n    assert (\n        inst.section[0].orderedBy.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/list-order\"}\n        ).valueUri\n    )\n    assert inst.section[0].text.status == \"generated\"\n    assert inst.section[0].title == \"History of present illness\"\n    assert inst.section[1].code.coding[0].code == \"10157-6\"\n    assert (\n        inst.section[1].code.coding[0].display\n        == \"History of family member diseases Narrative\"\n    )\n    assert (\n        inst.section[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.section[1].emptyReason.coding[0].code == \"withheld\"\n    assert inst.section[1].emptyReason.coding[0].display == \"Information Withheld\"\n    assert (\n        inst.section[1].emptyReason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/list-empty-reason\"}\n        ).valueUri\n    )\n    assert inst.section[1].mode == \"snapshot\"\n    assert inst.section[1].text.status == \"generated\"\n    assert inst.section[1].title == \"History of family member diseases\"\n    assert inst.status == \"final\"\n    assert inst.subject.display == \"Henry Levin the 7th\"\n    assert inst.subject.reference == \"Patient/xcda\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Consultation Note\"\n    assert inst.type.coding[0].code == \"11488-4\"\n    assert inst.type.coding[0].display == \"Consult note\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_composition_2(base_settings):\n    \"\"\"No. 2 tests collection for Composition.\n    Test File: composition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"composition-example.json\"\n    inst = composition.Composition.model_validate_json(filename.read_bytes())\n    assert \"Composition\" == inst.get_resource_type()\n\n    impl_composition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Composition\" == data[\"resourceType\"]\n\n    inst2 = composition.Composition(**data)\n    impl_composition_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_conceptmap.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ConceptMap\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import conceptmap\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_conceptmap_1(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        'Canonical Mapping for \"The lifecycle status of an ' 'artifact.\"'\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"draft\"\n    assert inst.group[0].element[0].target[0].code == \"draft\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[1].code == \"active\"\n    assert inst.group[0].element[1].target[0].code == \"active\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[2].code == \"retired\"\n    assert inst.group[0].element[2].target[0].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[3].code == \"unknown\"\n    assert inst.group[0].element[3].target[0].code == \"unknown\"\n    assert inst.group[0].element[3].target[0].equivalence == \"equivalent\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/publication-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-status\"}\n        ).valueUri\n    )\n    assert inst.id == \"sc-publication-status\"\n    assert inst.name == \"PublicationStatusCanonicalMap\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.sourceCanonical == \"http://hl7.org/fhir/ValueSet/publication-status\"\n    assert inst.status == \"draft\"\n    assert inst.targetCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"PublicationStatus\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-publication-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_conceptmap_1(base_settings):\n    \"\"\"No. 1 tests collection for ConceptMap.\n    Test File: sc-valueset-publication-status.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"sc-valueset-publication-status.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_1(inst2)\n\n\ndef impl_conceptmap_2(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"home\"\n    assert inst.group[0].element[0].target[0].code == \"H\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[1].code == \"work\"\n    assert inst.group[0].element[1].target[0].code == \"WP\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[2].code == \"temp\"\n    assert inst.group[0].element[2].target[0].code == \"TMP\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[3].code == \"old\"\n    assert inst.group[0].element[3].target[0].code == \"OLD\"\n    assert inst.group[0].element[3].target[0].comment == \"Bad or Old\"\n    assert inst.group[0].element[3].target[0].equivalence == \"narrower\"\n    assert inst.group[0].element[3].target[1].code == \"BAD\"\n    assert inst.group[0].element[3].target[1].comment == \"Bad or Old\"\n    assert inst.group[0].element[3].target[1].equivalence == \"narrower\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/address-use\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-AddressUse\"}\n        ).valueUri\n    )\n    assert inst.id == \"cm-address-use-v3\"\n    assert inst.name == \"v3.AddressUse\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.sourceCanonical == \"http://hl7.org/fhir/ValueSet/address-use\"\n    assert inst.status == \"draft\"\n    assert inst.targetCanonical == \"http://terminology.hl7.org/ValueSet/v3-AddressUse\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"v3 map for AddressUse\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-address-use-v3\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_conceptmap_2(base_settings):\n    \"\"\"No. 2 tests collection for ConceptMap.\n    Test File: cm-address-use-v3.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"cm-address-use-v3.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_2(inst2)\n\n\ndef impl_conceptmap_3(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == (\n        'Canonical Mapping for \"This value set includes Status ' 'codes.\"'\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"entered-in-error\"\n    assert inst.group[0].element[0].target[0].code == \"error\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[1].code == \"draft\"\n    assert inst.group[0].element[1].target[0].code == \"draft\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[2].code == \"active\"\n    assert inst.group[0].element[2].target[0].code == \"active\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[3].code == \"cancelled\"\n    assert inst.group[0].element[3].target[0].code == \"abandoned\"\n    assert inst.group[0].element[3].target[0].equivalence == \"equivalent\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fm-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-status\"}\n        ).valueUri\n    )\n    assert inst.id == \"sc-fm-status\"\n    assert inst.name == \"FinancialResourceStatusCodesCanonicalMap\"\n    assert inst.publisher == \"Financial Management\"\n    assert inst.sourceCanonical == \"http://hl7.org/fhir/ValueSet/fm-status\"\n    assert inst.status == \"draft\"\n    assert inst.targetCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"Financial Resource Status Codes\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-fm-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_conceptmap_3(base_settings):\n    \"\"\"No. 3 tests collection for ConceptMap.\n    Test File: sc-valueset-fm-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sc-valueset-fm-status.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_3(inst2)\n\n\ndef impl_conceptmap_4(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        'Canonical Mapping for \"Indicates whether this flag is '\n        \"active and needs to be displayed to a user, or whether it is\"\n        ' no longer needed or was entered in error.\"'\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"entered-in-error\"\n    assert inst.group[0].element[0].target[0].code == \"error\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[1].code == \"active\"\n    assert inst.group[0].element[1].target[0].code == \"active\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[2].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equivalent\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/flag-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-status\"}\n        ).valueUri\n    )\n    assert inst.id == \"sc-flag-status\"\n    assert inst.name == \"FlagStatusCanonicalMap\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.sourceCanonical == \"http://hl7.org/fhir/ValueSet/flag-status\"\n    assert inst.status == \"draft\"\n    assert inst.targetCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"FlagStatus\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-flag-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_conceptmap_4(base_settings):\n    \"\"\"No. 4 tests collection for ConceptMap.\n    Test File: sc-valueset-flag-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sc-valueset-flag-status.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_4(inst2)\n\n\ndef impl_conceptmap_5(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        'Canonical Mapping for \"The availability status of the ' 'device.\"'\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"entered-in-error\"\n    assert inst.group[0].element[0].target[0].code == \"error\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[1].code == \"active\"\n    assert inst.group[0].element[1].target[0].code == \"active\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[2].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[3].code == \"unknown\"\n    assert inst.group[0].element[3].target[0].code == \"unknown\"\n    assert inst.group[0].element[3].target[0].equivalence == \"equivalent\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/device-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-status\"}\n        ).valueUri\n    )\n    assert inst.id == \"sc-device-status\"\n    assert inst.name == \"FHIRDeviceStatusCanonicalMap\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.sourceCanonical == \"http://hl7.org/fhir/ValueSet/device-status\"\n    assert inst.status == \"draft\"\n    assert inst.targetCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"FHIRDeviceStatus\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-device-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_conceptmap_5(base_settings):\n    \"\"\"No. 5 tests collection for ConceptMap.\n    Test File: sc-valueset-device-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sc-valueset-device-status.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_5(inst2)\n\n\ndef impl_conceptmap_6(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"home\"\n    assert inst.group[0].element[0].target[0].code == \"PRN\"\n    assert inst.group[0].element[0].target[0].equivalence == \"narrower\"\n    assert inst.group[0].element[0].target[1].code == \"ORN\"\n    assert inst.group[0].element[0].target[1].equivalence == \"narrower\"\n    assert inst.group[0].element[0].target[2].code == \"VHN\"\n    assert inst.group[0].element[0].target[2].equivalence == \"narrower\"\n    assert inst.group[0].element[1].code == \"work\"\n    assert inst.group[0].element[1].target[0].code == \"WPN\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[2].code == \"mobile\"\n    assert inst.group[0].element[2].target[0].code == \"PRS\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equivalent\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/contact-point-use\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0201\"}\n        ).valueUri\n    )\n    assert inst.id == \"cm-contact-point-use-v2\"\n    assert inst.name == \"v2.ContactPointUse\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.sourceCanonical == \"http://hl7.org/fhir/ValueSet/contact-point-use\"\n    assert inst.status == \"draft\"\n    assert inst.targetCanonical == \"http://terminology.hl7.org/ValueSet/v2-0201\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"v2 map for ContactPointUse\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-contact-point-use-v2\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_conceptmap_6(base_settings):\n    \"\"\"No. 6 tests collection for ConceptMap.\n    Test File: cm-contact-point-use-v2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"cm-contact-point-use-v2.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_6(inst2)\n\n\ndef impl_conceptmap_7(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == (\n        'Canonical Mapping for \"Preferred value set for '\n        'AllergyIntolerance Clinical Status.\"'\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[1].code == \"inactive\"\n    assert inst.group[0].element[1].target[0].code == \"inactive\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[2].code == \"resolved\"\n    assert inst.group[0].element[2].target[0].code == \"resolved\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equivalent\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-status\"}\n        ).valueUri\n    )\n    assert inst.id == \"sc-allergyintolerance-clinical\"\n    assert inst.name == \"AllergyIntoleranceClinicalStatusCodesCanonicalMap\"\n    assert inst.publisher == \"FHIR Project team\"\n    assert (\n        inst.sourceCanonical\n        == \"http://hl7.org/fhir/ValueSet/allergyintolerance-clinical\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.targetCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == (\n        'Canonical Mapping for \"AllergyIntolerance Clinical Status ' 'Codes\"'\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-allergyintolerance-clinical\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_conceptmap_7(base_settings):\n    \"\"\"No. 7 tests collection for ConceptMap.\n    Test File: sc-valueset-allergyintolerance-clinical.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"sc-valueset-allergyintolerance-clinical.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_7(inst2)\n\n\ndef impl_conceptmap_8(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == 'Canonical Mapping for \"Medication Status Codes\"'\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"entered-in-error\"\n    assert inst.group[0].element[0].target[0].code == \"error\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[1].code == \"active\"\n    assert inst.group[0].element[1].target[0].code == \"active\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[2].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equivalent\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CodeSystem/medication-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-status\"}\n        ).valueUri\n    )\n    assert inst.id == \"sc-medication-status\"\n    assert inst.name == \"Medication Status CodesCanonicalMap\"\n    assert inst.publisher == \"FHIR Project team\"\n    assert inst.sourceCanonical == \"http://hl7.org/fhir/ValueSet/medication-status\"\n    assert inst.status == \"draft\"\n    assert inst.targetCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"Medication Status Codes\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-medication-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_conceptmap_8(base_settings):\n    \"\"\"No. 8 tests collection for ConceptMap.\n    Test File: sc-valueset-medication-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sc-valueset-medication-status.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_8(inst2)\n\n\ndef impl_conceptmap_9(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        'Canonical Mapping for \"Indicates whether the location is ' 'still in use.\"'\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[1].code == \"suspended\"\n    assert inst.group[0].element[1].target[0].code == \"suspended\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[2].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equivalent\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/location-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-status\"}\n        ).valueUri\n    )\n    assert inst.id == \"sc-location-status\"\n    assert inst.name == \"LocationStatusCanonicalMap\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.sourceCanonical == \"http://hl7.org/fhir/ValueSet/location-status\"\n    assert inst.status == \"draft\"\n    assert inst.targetCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"LocationStatus\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-location-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_conceptmap_9(base_settings):\n    \"\"\"No. 9 tests collection for ConceptMap.\n    Test File: sc-valueset-location-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sc-valueset-location-status.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_9(inst2)\n\n\ndef impl_conceptmap_10(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        'Canonical Mapping for \"The verification status to support '\n        \"or decline the clinical status of the condition or \"\n        'diagnosis.\"'\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"entered-in-error\"\n    assert inst.group[0].element[0].target[0].code == \"error\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[1].code == \"unknown\"\n    assert inst.group[0].element[1].target[0].code == \"unknown\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[2].code == \"unconfirmed, provisional\"\n    assert inst.group[0].element[2].target[0].code == \"unconfirmed\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[3].code == \"confirmed\"\n    assert inst.group[0].element[3].target[0].code == \"confirmed\"\n    assert inst.group[0].element[3].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[4].code == \"refuted\"\n    assert inst.group[0].element[4].target[0].code == \"refuted\"\n    assert inst.group[0].element[4].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[5].code == \"differential\"\n    assert inst.group[0].element[5].target[0].code == \"differential\"\n    assert inst.group[0].element[5].target[0].equivalence == \"equivalent\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-status\"}\n        ).valueUri\n    )\n    assert inst.id == \"sc-condition-ver-status\"\n    assert inst.name == \"ConditionVerificationStatusCanonicalMap\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.sourceCanonical == \"http://hl7.org/fhir/ValueSet/condition-ver-status\"\n    assert inst.status == \"draft\"\n    assert inst.targetCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"ConditionVerificationStatus\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-condition-ver-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_conceptmap_10(base_settings):\n    \"\"\"No. 10 tests collection for ConceptMap.\n    Test File: sc-valueset-condition-ver-status.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"sc-valueset-condition-ver-status.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_condition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Condition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import condition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_condition_1(inst):\n    assert inst.asserter.display == \"P. van de Heuvel\"\n    assert inst.asserter.reference == \"Patient/f001\"\n    assert inst.bodySite[0].coding[0].code == \"280193007\"\n    assert inst.bodySite[0].coding[0].display == \"Entire retropharyngeal area\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[0].code == \"439401001\"\n    assert inst.category[0].coding[0].display == \"diagnosis\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"18099001\"\n    assert inst.code.coding[0].display == \"Retropharyngeal abscess\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/f003\"\n    assert inst.evidence[0].code[0].coding[0].code == \"169068008\"\n    assert inst.evidence[0].code[0].coding[0].display == \"CT of neck\"\n    assert (\n        inst.evidence[0].code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"f003\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-02-27\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-02-20\"}\n        ).valueDateTime\n    )\n    assert inst.severity.coding[0].code == \"371923003\"\n    assert inst.severity.coding[0].display == \"Mild to moderate\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_1(base_settings):\n    \"\"\"No. 1 tests collection for Condition.\n    Test File: condition-example-f003-abscess.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"condition-example-f003-abscess.json\"\n    )\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_1(inst2)\n\n\ndef impl_condition_2(inst):\n    assert inst.asserter.reference == \"Practitioner/f201\"\n    assert inst.bodySite[0].coding[0].code == \"281158006\"\n    assert inst.bodySite[0].coding[0].display == \"Pulmonary vascular structure\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[0].code == \"55607006\"\n    assert inst.category[0].coding[0].display == \"Problem\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[1].code == \"problem-list-item\"\n    assert (\n        inst.category[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"10001005\"\n    assert inst.code.coding[0].display == \"Bacterial sepsis\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.display == \"Roel's encounter on March elevanth\"\n    assert inst.encounter.reference == \"Encounter/f203\"\n    assert inst.evidence[0].detail[0].display == \"Diagnostic report for Roel's sepsis\"\n    assert inst.evidence[0].detail[0].reference == \"DiagnosticReport/f202\"\n    assert inst.id == \"f203\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-08\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-11\"}\n        ).valueDateTime\n    )\n    assert inst.severity.coding[0].code == \"371924009\"\n    assert inst.severity.coding[0].display == \"Moderate to severe\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_2(base_settings):\n    \"\"\"No. 2 tests collection for Condition.\n    Test File: condition-example-f203-sepsis.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"condition-example-f203-sepsis.json\"\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_2(inst2)\n\n\ndef impl_condition_3(inst):\n    assert inst.category[0].coding[0].code == \"encounter-diagnosis\"\n    assert inst.category[0].coding[0].display == \"Encounter Diagnosis\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"422504002\"\n    assert inst.code.coding[0].display == \"Ischemic stroke (disorder)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Stroke\"\n    assert inst.id == \"stroke\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-07-18\"}\n        ).valueDateTime\n    )\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Ischemic stroke,'\n        \" July 18, 2010</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_3(base_settings):\n    \"\"\"No. 3 tests collection for Condition.\n    Test File: condition-example-stroke.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"condition-example-stroke.json\"\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_3(inst2)\n\n\ndef impl_condition_4(inst):\n    assert inst.category[0].coding[0].code == \"problem-list-item\"\n    assert inst.category[0].coding[0].display == \"Problem List Item\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"312824007\"\n    assert inst.code.coding[0].display == \"Family history of cancer of colon\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"family-history\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Family history '\n        \"of cancer of colon</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_condition_4(base_settings):\n    \"\"\"No. 4 tests collection for Condition.\n    Test File: condition-example-family-history.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"condition-example-family-history.json\"\n    )\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_4(inst2)\n\n\ndef impl_condition_5(inst):\n    assert inst.asserter.display == \"P. van de Heuvel\"\n    assert inst.asserter.reference == \"Patient/f001\"\n    assert inst.bodySite[0].coding[0].code == \"51185008\"\n    assert inst.bodySite[0].coding[0].display == \"Thorax\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[0].code == \"439401001\"\n    assert inst.category[0].coding[0].display == \"diagnosis\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"254637007\"\n    assert inst.code.coding[0].display == \"NSCLC - Non-small cell lung cancer\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/f002\"\n    assert inst.evidence[0].code[0].coding[0].code == \"169069000\"\n    assert inst.evidence[0].code[0].coding[0].display == \"CT of thorax\"\n    assert (\n        inst.evidence[0].code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"f002\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-05-05\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-06-03\"}\n        ).valueDateTime\n    )\n    assert inst.severity.coding[0].code == \"24484000\"\n    assert inst.severity.coding[0].display == \"Severe\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.stage[0].summary.coding[0].code == \"258219007\"\n    assert inst.stage[0].summary.coding[0].display == \"stage II\"\n    assert (\n        inst.stage[0].summary.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.stage[0].type.coding[0].code == \"260998006\"\n    assert inst.stage[0].type.coding[0].display == \"Clinical staging (qualifier value)\"\n    assert (\n        inst.stage[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_5(base_settings):\n    \"\"\"No. 5 tests collection for Condition.\n    Test File: condition-example-f002-lung.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"condition-example-f002-lung.json\"\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_5(inst2)\n\n\ndef impl_condition_6(inst):\n    assert inst.asserter.reference == \"Practitioner/f201\"\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"87628006\"\n    assert inst.code.coding[0].display == \"Bacterial infectious disease\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"f205\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-04\"}\n        ).valueDateTime\n    )\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"differential\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_6(base_settings):\n    \"\"\"No. 6 tests collection for Condition.\n    Test File: condition-example-f205-infection.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"condition-example-f205-infection.json\"\n    )\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_6(inst2)\n\n\ndef impl_condition_7(inst):\n    assert (\n        inst.abatementDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-20\"}\n        ).valueDateTime\n    )\n    assert inst.asserter.reference == \"Practitioner/f201\"\n    assert inst.bodySite[0].coding[0].code == \"181414000\"\n    assert inst.bodySite[0].coding[0].display == \"Kidney\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[0].code == \"55607006\"\n    assert inst.category[0].coding[0].display == \"Problem\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[1].code == \"problem-list-item\"\n    assert (\n        inst.category[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"inactive\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"36225005\"\n    assert (\n        inst.code.coding[0].display\n        == \"Acute renal insufficiency specified as due to procedure\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.display == \"Roel's encounter on March elevanth\"\n    assert inst.encounter.reference == \"Encounter/f203\"\n    assert inst.id == \"f204\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"The patient is anuric.\"\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-11\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-11\"}\n        ).valueDateTime\n    )\n    assert inst.severity.coding[0].code == \"24484000\"\n    assert inst.severity.coding[0].display == \"Severe\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.stage[0].assessment[0].display == \"Genetic analysis master panel\"\n    assert inst.stage[0].summary.coding[0].code == \"14803004\"\n    assert inst.stage[0].summary.coding[0].display == \"Temporary\"\n    assert (\n        inst.stage[0].summary.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"differential\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_7(base_settings):\n    \"\"\"No. 7 tests collection for Condition.\n    Test File: condition-example-f204-renal.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"condition-example-f204-renal.json\"\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_7(inst2)\n\n\ndef impl_condition_8(inst):\n    assert inst.category[0].coding[0].code == \"problem-list-item\"\n    assert inst.category[0].coding[0].display == \"Problem List Item\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Asthma\"\n    assert inst.id == \"example2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.onsetString == \"approximately November 2012\"\n    assert inst.severity.coding[0].code == \"255604002\"\n    assert inst.severity.coding[0].display == \"Mild\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Mild Asthma '\n        \"(Date: 12-Nov 2012)</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_8(base_settings):\n    \"\"\"No. 8 tests collection for Condition.\n    Test File: condition-example2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"condition-example2.json\"\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_8(inst2)\n\n\ndef impl_condition_9(inst):\n    assert inst.abatementAge.code == \"a\"\n    assert (\n        inst.abatementAge.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.abatementAge.unit == \"years\"\n    assert float(inst.abatementAge.value) == float(54)\n    assert inst.bodySite[0].coding[0].code == \"361355005\"\n    assert inst.bodySite[0].coding[0].display == \"Entire head and neck\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[0].code == \"encounter-diagnosis\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"resolved\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"363346000\"\n    assert inst.code.coding[0].display == \"Malignant neoplastic disease\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.evidence[0].detail[0].display\n        == \"Erasmus' diagnostic report of Roel's tumor\"\n    )\n    assert inst.evidence[0].detail[0].reference == \"DiagnosticReport/f201\"\n    assert inst.id == \"f202\"\n    assert inst.meta.security[0].code == \"TBOO\"\n    assert inst.meta.security[0].display == \"taboo\"\n    assert (\n        inst.meta.security[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.onsetAge.code == \"a\"\n    assert (\n        inst.onsetAge.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.onsetAge.unit == \"years\"\n    assert float(inst.onsetAge.value) == float(52)\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-12-01\"}\n        ).valueDateTime\n    )\n    assert inst.severity.coding[0].code == \"24484000\"\n    assert inst.severity.coding[0].display == \"Severe\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_9(base_settings):\n    \"\"\"No. 9 tests collection for Condition.\n    Test File: condition-example-f202-malignancy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"condition-example-f202-malignancy.json\"\n    )\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_9(inst2)\n\n\ndef impl_condition_10(inst):\n    assert inst.abatementString == \"around April 9, 2013\"\n    assert inst.asserter.reference == \"Practitioner/f201\"\n    assert inst.bodySite[0].coding[0].code == \"38266002\"\n    assert inst.bodySite[0].coding[0].display == \"Entire body as a whole\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[0].code == \"55607006\"\n    assert inst.category[0].coding[0].display == \"Problem\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[1].code == \"problem-list-item\"\n    assert (\n        inst.category[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"resolved\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"386661006\"\n    assert inst.code.coding[0].display == \"Fever\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/f201\"\n    assert inst.evidence[0].code[0].coding[0].code == \"258710007\"\n    assert inst.evidence[0].code[0].coding[0].display == \"degrees C\"\n    assert (\n        inst.evidence[0].code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.evidence[0].detail[0].display == \"Temperature\"\n    assert inst.evidence[0].detail[0].reference == \"Observation/f202\"\n    assert inst.id == \"f201\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-02\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-04\"}\n        ).valueDateTime\n    )\n    assert inst.recorder.reference == \"Practitioner/f201\"\n    assert inst.severity.coding[0].code == \"255604002\"\n    assert inst.severity.coding[0].display == \"Mild\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_10(base_settings):\n    \"\"\"No. 10 tests collection for Condition.\n    Test File: condition-example-f201-fever.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"condition-example-f201-fever.json\"\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_consent.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Consent\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import consent\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_consent_1(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"consent-example-notThis\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization[0].reference == \"Organization/f001\"\n    assert inst.patient.display == \"P. van de Heuvel\"\n    assert inst.patient.reference == \"Patient/f001\"\n    assert inst.policyRule.coding[0].code == \"OPTIN\"\n    assert (\n        inst.policyRule.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.data[0].meaning == \"related\"\n    assert inst.provision.data[0].reference.reference == \"Task/example3\"\n    assert inst.scope.coding[0].code == \"patient-privacy\"\n    assert (\n        inst.scope.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentscope\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment.title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_1(base_settings):\n    \"\"\"No. 1 tests collection for Consent.\n    Test File: consent-example-notThis.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-notThis.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_1(inst2)\n\n\ndef impl_consent_2(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-23T17:02:33+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"consent-example-smartonfhir\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization[0].reference == \"Organization/f001\"\n    assert inst.patient.reference == \"Patient/xcda\"\n    assert inst.performer[0].reference == \"RelatedPerson/peter\"\n    assert inst.policyRule.coding[0].code == \"OPTIN\"\n    assert (\n        inst.policyRule.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-23T17:32:33+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.provision.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-23T17:02:33+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.provision.provision[0].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.provision[0].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[0].class_fhir[0].code == \"MedicationRequest\"\n    assert (\n        inst.provision.provision[0].class_fhir[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[0].type == \"permit\"\n    assert inst.scope.coding[0].code == \"patient-privacy\"\n    assert (\n        inst.scope.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentscope\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_2(base_settings):\n    \"\"\"No. 2 tests collection for Consent.\n    Test File: consent-example-smartonfhir.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-smartonfhir.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_2(inst2)\n\n\ndef impl_consent_3(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"consent-example-notAuthor\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization[0].reference == \"Organization/f001\"\n    assert inst.patient.display == \"P. van de Heuvel\"\n    assert inst.patient.reference == \"Patient/f001\"\n    assert inst.policyRule.coding[0].code == \"OPTIN\"\n    assert (\n        inst.policyRule.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.actor[0].reference.reference == \"Organization/f001\"\n    assert inst.provision.actor[0].role.coding[0].code == \"CST\"\n    assert (\n        inst.provision.actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.scope.coding[0].code == \"patient-privacy\"\n    assert (\n        inst.scope.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentscope\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment.title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_3(base_settings):\n    \"\"\"No. 3 tests collection for Consent.\n    Test File: consent-example-notAuthor.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-notAuthor.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_3(inst2)\n\n\ndef impl_consent_4(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"consent-example-notTime\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization[0].reference == \"Organization/f001\"\n    assert inst.patient.display == \"P. van de Heuvel\"\n    assert inst.patient.reference == \"Patient/f001\"\n    assert inst.policyRule.coding[0].code == \"OPTIN\"\n    assert (\n        inst.policyRule.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.provision.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.scope.coding[0].code == \"patient-privacy\"\n    assert (\n        inst.scope.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentscope\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment.title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_4(base_settings):\n    \"\"\"No. 4 tests collection for Consent.\n    Test File: consent-example-notTime.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-notTime.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_4(inst2)\n\n\ndef impl_consent_5(inst):\n    assert inst.category[0].coding[0].code == \"npp\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentcategorycodes\"}\n        ).valueUri\n    )\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-05-26T00:41:10-04:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"consent-example-signature\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.3.72.5.9.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"494e0c7a-a69e-4fb4-9d02-6aae747790d7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization[0].reference == \"Organization/f001\"\n    assert inst.patient.reference == \"Patient/72\"\n    assert inst.performer[0].reference == \"Patient/72\"\n    assert inst.policyRule.coding[0].code == \"OPTIN\"\n    assert (\n        inst.policyRule.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.actor[0].reference.reference == \"Practitioner/13\"\n    assert inst.provision.actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-10\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.provision.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-10-10\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.provision.provision[0].actor[0].reference.reference\n        == \"Practitioner/xcda-author\"\n    )\n    assert inst.provision.provision[0].actor[0].role.coding[0].code == \"AUT\"\n    assert (\n        inst.provision.provision[0].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[0].class_fhir[0].code == \"application/hl7-cda+xml\"\n    assert (\n        inst.provision.provision[0].class_fhir[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:13\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[0].code[0].coding[0].code == \"34133-9\"\n    assert (\n        inst.provision.provision[0].code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[0].code[1].coding[0].code == \"18842-5\"\n    assert (\n        inst.provision.provision[0].code[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[0].type == \"permit\"\n    assert inst.scope.coding[0].code == \"patient-privacy\"\n    assert (\n        inst.scope.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentscope\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_5(base_settings):\n    \"\"\"No. 5 tests collection for Consent.\n    Test File: consent-example-signature.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-signature.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_5(inst2)\n\n\ndef impl_consent_6(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"consent-example-notThem\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization[0].reference == \"Organization/f001\"\n    assert inst.patient.display == \"P. van de Heuvel\"\n    assert inst.patient.reference == \"Patient/f001\"\n    assert inst.policyRule.coding[0].code == \"OPTIN\"\n    assert (\n        inst.policyRule.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision.action[1].coding[0].code == \"correct\"\n    assert (\n        inst.provision.action[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision.actor[0].reference.display == \"Fictive Nurse\"\n    assert inst.provision.actor[0].reference.reference == \"Practitioner/f204\"\n    assert inst.provision.actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.scope.coding[0].code == \"patient-privacy\"\n    assert (\n        inst.scope.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentscope\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment.title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_6(base_settings):\n    \"\"\"No. 6 tests collection for Consent.\n    Test File: consent-example-notThem.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-notThem.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_6(inst2)\n\n\ndef impl_consent_7(inst):\n    assert inst.category[0].coding[0].code == \"INFAO\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"consent-example-grantor\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization[0].reference == \"Organization/f001\"\n    assert inst.patient.display == \"P. van de Heuvel\"\n    assert inst.patient.reference == \"Patient/f001\"\n    assert inst.policyRule.coding[0].code == \"OPTOUT\"\n    assert (\n        inst.policyRule.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision.actor[0].reference.reference == \"Organization/f001\"\n    assert inst.provision.actor[0].role.coding[0].code == \"CST\"\n    assert (\n        inst.provision.actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.actor[1].reference.display == \"Good Health Clinic\"\n    assert inst.provision.actor[1].reference.reference == \"Patient/example\"\n    assert inst.provision.actor[1].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.actor[1].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.scope.coding[0].code == \"patient-privacy\"\n    assert (\n        inst.scope.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentscope\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment.title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_7(base_settings):\n    \"\"\"No. 7 tests collection for Consent.\n    Test File: consent-example-grantor.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-grantor.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_7(inst2)\n\n\ndef impl_consent_8(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"consent-example-notOrg\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization[0].reference == \"Organization/f001\"\n    assert inst.patient.display == \"P. van de Heuvel\"\n    assert inst.patient.reference == \"Patient/f001\"\n    assert inst.policyRule.coding[0].code == \"OPTIN\"\n    assert (\n        inst.policyRule.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision.action[1].coding[0].code == \"correct\"\n    assert (\n        inst.provision.action[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision.actor[0].reference.reference == \"Organization/f001\"\n    assert inst.provision.actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.type == \"deny\"\n    assert inst.scope.coding[0].code == \"patient-privacy\"\n    assert (\n        inst.scope.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentscope\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment.title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_8(base_settings):\n    \"\"\"No. 8 tests collection for Consent.\n    Test File: consent-example-notOrg.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-notOrg.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_8(inst2)\n\n\ndef impl_consent_9(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-16\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"consent-example-pkb\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization[0].reference == \"Organization/f001\"\n    assert inst.patient.display == \"...example patient...\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.policyRule.coding[0].code == \"OPTOUT\"\n    assert (\n        inst.policyRule.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision.actor[0].reference.reference == \"Organization/f001\"\n    assert inst.provision.actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[0].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.provision[0].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.provision[0].actor[0].reference.reference == \"Organization/f001\"\n    )\n    assert inst.provision.provision[0].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.provision[0].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[0].securityLabel[0].code == \"PSY\"\n    assert (\n        inst.provision.provision[0].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[1].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.provision[1].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.provision[1].actor[0].reference.reference == \"Organization/f001\"\n    )\n    assert inst.provision.provision[1].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.provision[1].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[1].securityLabel[0].code == \"SPI\"\n    assert (\n        inst.provision.provision[1].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[2].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.provision[2].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.provision[2].actor[0].reference.reference == \"Organization/f001\"\n    )\n    assert inst.provision.provision[2].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.provision[2].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[2].securityLabel[0].code == \"N\"\n    assert (\n        inst.provision.provision[2].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[3].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.provision[3].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.provision[3].actor[0].reference.reference == \"Organization/f001\"\n    )\n    assert inst.provision.provision[3].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.provision[3].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[3].securityLabel[0].code == \"PSY\"\n    assert (\n        inst.provision.provision[3].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[4].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.provision[4].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.provision[4].actor[0].reference.reference == \"Organization/f001\"\n    )\n    assert inst.provision.provision[4].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.provision[4].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[4].securityLabel[0].code == \"SPI\"\n    assert (\n        inst.provision.provision[4].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[5].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.provision[5].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.provision[5].actor[0].reference.reference == \"Organization/f001\"\n    )\n    assert inst.provision.provision[5].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.provision[5].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[5].securityLabel[0].code == \"SEX\"\n    assert (\n        inst.provision.provision[5].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[6].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.provision[6].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.provision[6].actor[0].reference.reference == \"Organization/f001\"\n    )\n    assert inst.provision.provision[6].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.provision[6].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[6].securityLabel[0].code == \"N\"\n    assert (\n        inst.provision.provision[6].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[7].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.provision[7].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.provision[7].actor[0].reference.reference == \"Organization/f001\"\n    )\n    assert inst.provision.provision[7].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.provision[7].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[7].securityLabel[0].code == \"PSY\"\n    assert (\n        inst.provision.provision[7].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[8].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.provision[8].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.provision[8].actor[0].reference.reference == \"Organization/f001\"\n    )\n    assert inst.provision.provision[8].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.provision[8].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[8].securityLabel[0].code == \"SPI\"\n    assert (\n        inst.provision.provision[8].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[9].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision.provision[9].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.provision[9].actor[0].reference.reference == \"Organization/f001\"\n    )\n    assert inst.provision.provision[9].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision.provision[9].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision.provision[9].securityLabel[0].code == \"SEX\"\n    assert (\n        inst.provision.provision[9].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision.securityLabel[0].code == \"N\"\n    assert (\n        inst.provision.securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.scope.coding[0].code == \"patient-privacy\"\n    assert (\n        inst.scope.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentscope\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_9(base_settings):\n    \"\"\"No. 9 tests collection for Consent.\n    Test File: consent-example-pkb.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-pkb.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_9(inst2)\n\n\ndef impl_consent_10(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-05-11\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"consent-example-basic\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization[0].reference == \"Organization/f001\"\n    assert inst.patient.display == \"P. van de Heuvel\"\n    assert inst.patient.reference == \"Patient/f001\"\n    assert inst.policyRule.coding[0].code == \"OPTIN\"\n    assert (\n        inst.policyRule.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.provision.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1964-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.scope.coding[0].code == \"patient-privacy\"\n    assert (\n        inst.scope.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentscope\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment.title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_10(base_settings):\n    \"\"\"No. 10 tests collection for Consent.\n    Test File: consent-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_contract.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Contract\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import contract\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_contract_1(inst):\n    assert inst.authority[0].display == \"Michigan Health\"\n    assert inst.authority[0].reference == \"Organization/3\"\n    assert inst.domain[0].display == \"UK Pharmacies\"\n    assert inst.domain[0].reference == \"Location/ukp\"\n    assert (\n        inst.friendly[0].contentAttachment.title\n        == \"The terms of the consent in friendly consumer speak.\"\n    )\n    assert inst.id == \"pcd-example-notOrg\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.legal[0].contentAttachment.title\n        == \"The terms of the consent in lawyer speak.\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subType[0].coding[0].code == \"Opt-In\"\n    assert inst.subType[0].coding[0].display == \"Default Authorization with exceptions.\"\n    assert (\n        inst.subType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.infoway-inforoute.ca.org/Consent-subtype-codes\"}\n        ).valueUri\n    )\n    assert inst.subject[0].display == \"P. van de Heuvel\"\n    assert inst.subject[0].reference == \"Patient/f001\"\n    assert inst.term[0].offer.text == (\n        \"Withhold this order and any results or related objects from \" \"any provider.\"\n    )\n    assert inst.term[0].offer.topic.display == \"Good Health Clinic\"\n    assert inst.term[0].offer.topic.reference == \"Organization/2.16.840.1.113883.19.5\"\n    assert inst.term[0].type.coding[0].code == \"withhold-from\"\n    assert (\n        inst.term[0].type.coding[0].display\n        == \"Withhold all data from specified actor entity.\"\n    )\n    assert (\n        inst.term[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/consent-term-type-codes\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"57016-8\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_contract_1(base_settings):\n    \"\"\"No. 1 tests collection for Contract.\n    Test File: pcd-example-notOrg.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"pcd-example-notOrg.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_1(inst2)\n\n\ndef impl_contract_2(inst):\n    assert (\n        inst.applies.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"INS-101\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://xyz-insurance.com/forms\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"YCSCWLN(01-2017)\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subject[0].reference == \"Patient/1\"\n    assert (\n        inst.term[0].asset[0].period[0].start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-06-01\"}\n        ).valueDateTime\n    )\n    assert inst.term[0].asset[0].subtype[0].text == \"sample\"\n    assert inst.term[0].asset[0].type[0].coding[0].code == \"RicardianContract\"\n    assert (\n        inst.term[0].asset[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://something/something\"}\n        ).valueUri\n    )\n    assert (\n        inst.term[0].asset[0].valuedItem[0].effectiveTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1995\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.term[0].asset[0].valuedItem[0].entityCodeableConcept.text == \"Ford Bobcat\"\n    )\n    assert float(inst.term[0].asset[0].valuedItem[0].factor) == float(1.0)\n    assert (\n        inst.term[0].asset[0].valuedItem[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://somewhere.motor-vehicle.com/vin\"}\n        ).valueUri\n    )\n    assert inst.term[0].asset[0].valuedItem[0].identifier.value == \"XXSVT34-7665t952236\"\n    assert inst.term[0].asset[0].valuedItem[0].net.currency == \"CAD\"\n    assert float(inst.term[0].asset[0].valuedItem[0].net.value) == float(200.0)\n    assert float(inst.term[0].asset[0].valuedItem[0].points) == float(1.0)\n    assert float(inst.term[0].asset[0].valuedItem[0].quantity.value) == float(1)\n    assert inst.term[0].asset[0].valuedItem[0].unitPrice.currency == \"CAD\"\n    assert float(inst.term[0].asset[0].valuedItem[0].unitPrice.value) == float(200.0)\n    assert inst.term[0].group[0].offer.text == \"Eligible Providers\"\n    assert inst.term[0].group[1].offer.text == \"Responsibility for Payment\"\n    assert inst.term[0].group[2].group[0].group[0].offer.text == \"Emergency Room Copay\"\n    assert (\n        inst.term[0].group[2].group[0].group[1].offer.text == \"Professional Visit Copay\"\n    )\n    assert inst.term[0].group[2].group[0].offer.text == \"Copays\"\n    assert inst.term[0].group[2].group[1].offer.text == \"Calendar Year Deductible\"\n    assert inst.term[0].group[2].group[2].offer.text == \"Out-Of-Pocket Maximum\"\n    assert inst.term[0].group[2].group[3].group[0].offer.text == \"Ambulance Services\"\n    assert inst.term[0].group[2].group[3].group[1].offer.text == \"Dental Services\"\n    assert inst.term[0].group[2].group[3].group[2].offer.text == \"Diagnostic Services\"\n    assert (\n        inst.term[0].group[2].group[3].group[3].offer.text == \"Emergency Room Services\"\n    )\n    assert (\n        inst.term[0].group[2].group[3].group[4].offer.text == \"Hospital Inpatient Care\"\n    )\n    assert inst.term[0].group[2].group[3].offer.text == \"Medical Services\"\n    assert inst.term[0].group[2].offer.text == \"List of Benefits\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"healthinsurance\"\n    assert inst.type.coding[0].display == \"Health Insurance\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/contract-type\"}\n        ).valueUri\n    )\n\n\ndef test_contract_2(base_settings):\n    \"\"\"No. 2 tests collection for Contract.\n    Test File: contract-example-ins-policy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"contract-example-ins-policy.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_2(inst2)\n\n\ndef impl_contract_3(inst):\n    assert (\n        inst.applies.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-11-01T21:18:27-04:00\"}\n        ).valueDateTime\n    )\n    assert inst.contentDerivative.coding[0].code == \"registration\"\n    assert (\n        inst.contentDerivative.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/contract-content-derivative\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"C-2121\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-11-01T21:18:27-04:00\"}\n        ).valueDateTime\n    )\n    assert inst.legal[0].contentAttachment.contentType == \"application/pdf\"\n    assert inst.legal[0].contentAttachment.language == \"en-US\"\n    assert (\n        inst.legal[0].contentAttachment.title\n        == \"MDHHS-5515 Consent To Share Your Health Information\"\n    )\n    assert (\n        inst.legal[0].contentAttachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://org.mihin.ecms/ConsentDirective-2121\"}\n        ).valueUrl\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-07-19T18:18:42.108-04:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.meta.versionId == \"1\"\n    assert inst.signer[0].party.display == \"Alice Recruit\"\n    assert inst.signer[0].party.reference == \"Patient/f201\"\n    assert inst.signer[0].signature[0].type[0].code == \"1.2.840.10065.1.12.1.1\"\n    assert (\n        inst.signer[0].signature[0].type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso-astm:E1762-95:2013\"}\n        ).valueUri\n    )\n    assert (\n        inst.signer[0].signature[0].when\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2017-02-08T10:57:34+01:00\"}\n        ).valueInstant\n    )\n    assert inst.signer[0].signature[0].who.reference == \"Patient/f201\"\n    assert inst.signer[0].type.code == \"SELF\"\n    assert (\n        inst.signer[0].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://mdhhs.org/fhir/consent-signer-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"executed\"\n    assert inst.subType[0].coding[0].code == \"hcd\"\n    assert (\n        inst.subType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentcategorycodes\"}\n        ).valueUri\n    )\n    assert inst.subject[0].reference == \"Patient/f201\"\n    assert inst.term[0].action[0].intent.coding[0].code == \"HPRGRP\"\n    assert (\n        inst.term[0].action[0].intent.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.term[0].action[0].status.text == \"Sample\"\n    assert (\n        inst.term[0].action[0].subject[0].reference[0].display\n        == \"VA Ann Arbor Healthcare System\"\n    )\n    assert (\n        inst.term[0].action[0].subject[0].reference[0].reference == \"Organization/f001\"\n    )\n    assert inst.term[0].action[0].subject[0].role.coding[0].code == \"IR\"\n    assert inst.term[0].action[0].subject[0].role.coding[0].display == \"Recipient\"\n    assert (\n        inst.term[0].action[0].subject[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://mdhhs.org/fhir/consent-actor-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.term[0].action[0].subject[0].role.text\n        == \"Recipient of restricted health information\"\n    )\n    assert (\n        inst.term[0].action[0].subject[1].reference[0].display\n        == \"Community Mental Health Clinic\"\n    )\n    assert inst.term[0].action[0].subject[1].reference[0].reference == \"Organization/2\"\n    assert inst.term[0].action[0].subject[1].role.coding[0].code == \"IS\"\n    assert inst.term[0].action[0].subject[1].role.coding[0].display == \"Sender\"\n    assert (\n        inst.term[0].action[0].subject[1].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://mdhhs.org/fhir/consent-actor-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.term[0].action[0].subject[1].role.text\n        == \"Sender of restricted health information\"\n    )\n    assert inst.term[0].action[0].type.coding[0].code == \"action-a\"\n    assert (\n        inst.term[0].action[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/contractaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.term[0].asset[0].period[0].end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-11-01T21:18:27-04:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.term[0].asset[0].period[0].start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-11-01T21:18:27-04:00\"}\n        ).valueDateTime\n    )\n    assert inst.term[0].offer.decision.coding[0].code == \"OPTIN\"\n    assert (\n        inst.term[0].offer.decision.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.term[0].offer.text == \"Can't refuse\"\n    assert inst.term[0].offer.type.coding[0].code == \"statutory\"\n    assert (\n        inst.term[0].offer.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/contracttermtypecodes\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"OPTIN\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://mdhhs.org/fhir/consentdirective-type\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"Opt-in consent directive\"\n\n\ndef test_contract_3(base_settings):\n    \"\"\"No. 3 tests collection for Contract.\n    Test File: contract-example-42cfr-part2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"contract-example-42cfr-part2.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_3(inst2)\n\n\ndef impl_contract_4(inst):\n    assert inst.authority[0].display == \"Michigan Health\"\n    assert inst.authority[0].reference == \"Organization/3\"\n    assert inst.domain[0].display == \"UK Pharmacies\"\n    assert inst.domain[0].reference == \"Location/ukp\"\n    assert (\n        inst.friendly[0].contentAttachment.title\n        == \"The terms of the consent in friendly consumer speak.\"\n    )\n    assert inst.id == \"pcd-example-notLabs\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-17\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.legal[0].contentAttachment.title\n        == \"The terms of the consent in lawyer speak.\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subType[0].coding[0].code == \"Opt-In\"\n    assert inst.subType[0].coding[0].display == \"Default Authorization with exceptions.\"\n    assert (\n        inst.subType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.infoway-inforoute.ca.org/Consent-subtype-codes\"}\n        ).valueUri\n    )\n    assert inst.subject[0].display == \"P. van de Heuvel\"\n    assert inst.subject[0].reference == \"Patient/f001\"\n    assert inst.term[0].group[0].offer.text == \"Withhold orders from any provider.\"\n    assert inst.term[0].group[0].subType.coding[0].code == \"ServiceRequest\"\n    assert (\n        inst.term[0].group[0].subType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert inst.term[0].group[0].type.coding[0].code == \"withhold-object-type\"\n    assert (\n        inst.term[0].group[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/consent-term-type-codes\"}\n        ).valueUri\n    )\n    assert (\n        inst.term[0].group[1].offer.text == \"Withhold order results from any provider.\"\n    )\n    assert inst.term[0].group[1].subType.coding[0].code == \"DiagnosticReport\"\n    assert (\n        inst.term[0].group[1].subType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert inst.term[0].group[1].type.coding[0].code == \"withhold-object-type\"\n    assert (\n        inst.term[0].group[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/consent-term-type-codes\"}\n        ).valueUri\n    )\n    assert inst.term[0].offer.text == \"sample\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"57016-8\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_contract_4(base_settings):\n    \"\"\"No. 4 tests collection for Contract.\n    Test File: pcd-example-notLabs.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"pcd-example-notLabs.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_4(inst2)\n\n\ndef impl_contract_5(inst):\n    assert inst.authority[0].display == \"Michigan Health\"\n    assert inst.authority[0].reference == \"Organization/3\"\n    assert inst.domain[0].display == \"UK Pharmacies\"\n    assert inst.domain[0].reference == \"Location/ukp\"\n    assert (\n        inst.friendly[0].contentAttachment.title\n        == \"The terms of the consent in friendly consumer speak.\"\n    )\n    assert inst.id == \"pcd-example-notThem\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.legal[0].contentAttachment.title\n        == \"The terms of the consent in lawyer speak.\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.signer[0].party.reference == \"Patient/f001\"\n    assert inst.signer[0].signature[0].type[0].code == \"1.2.840.10065.1.12.1.1\"\n    assert (\n        inst.signer[0].signature[0].type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso-astm:E1762-95:2013\"}\n        ).valueUri\n    )\n    assert (\n        inst.signer[0].signature[0].when\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-06-08T10:57:34-07:00\"}\n        ).valueInstant\n    )\n    assert inst.signer[0].signature[0].who.reference == \"Patient/f001\"\n    assert inst.signer[0].type.code == \"COVPTY\"\n    assert (\n        inst.signer[0].type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/contractsignertypecodes\"\n            }\n        ).valueUri\n    )\n    assert inst.subType[0].coding[0].code == \"Opt-In\"\n    assert inst.subType[0].coding[0].display == \"Default Authorization with exceptions.\"\n    assert (\n        inst.subType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.infoway-inforoute.ca.org/Consent-subtype-codes\"}\n        ).valueUri\n    )\n    assert inst.subject[0].display == \"P. van de Heuvel\"\n    assert inst.subject[0].reference == \"Patient/f001\"\n    assert inst.term[0].offer.text == (\n        \"Withhold this order and any results or related objects from \"\n        \"specified nurse provider.\"\n    )\n    assert inst.term[0].offer.topic.display == \"Fictive Nurse\"\n    assert inst.term[0].offer.topic.reference == \"Practitioner/f204\"\n    assert inst.term[0].type.coding[0].code == \"withhold-from\"\n    assert (\n        inst.term[0].type.coding[0].display\n        == \"Withhold all data from specified actor entity.\"\n    )\n    assert (\n        inst.term[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/consent-term-type-codes\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"57016-8\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_contract_5(base_settings):\n    \"\"\"No. 5 tests collection for Contract.\n    Test File: pcd-example-notThem.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"pcd-example-notThem.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_5(inst2)\n\n\ndef impl_contract_6(inst):\n    assert inst.authority[0].display == \"Michigan Health\"\n    assert inst.authority[0].reference == \"Organization/3\"\n    assert inst.domain[0].display == \"UK Pharmacies\"\n    assert inst.domain[0].reference == \"Location/ukp\"\n    assert (\n        inst.friendly[0].contentAttachment.title\n        == \"The terms of the consent in friendly consumer speak.\"\n    )\n    assert inst.id == \"pcd-example-notAuthor\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.legal[0].contentAttachment.title\n        == \"The terms of the consent in lawyer speak.\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subType[0].coding[0].code == \"Opt-In\"\n    assert inst.subType[0].coding[0].display == \"Default Authorization with exceptions.\"\n    assert (\n        inst.subType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.infoway-inforoute.ca.org/Consent-subtype-codes\"}\n        ).valueUri\n    )\n    assert inst.subject[0].display == \"P. van de Heuvel\"\n    assert inst.subject[0].reference == \"Patient/f001\"\n    assert (\n        inst.term[0].offer.text == \"Withhold all data authored by Good Health provider.\"\n    )\n    assert inst.term[0].offer.topic.display == \"Good Health Clinic\"\n    assert inst.term[0].offer.topic.reference == \"Organization/2.16.840.1.113883.19.5\"\n    assert inst.term[0].type.coding[0].code == \"withhold-authored-by\"\n    assert (\n        inst.term[0].type.coding[0].display\n        == \"Withhold all data authored by specified actor entity.\"\n    )\n    assert (\n        inst.term[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/consent-term-type-codes\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"57016-8\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_contract_6(base_settings):\n    \"\"\"No. 6 tests collection for Contract.\n    Test File: pcd-example-notAuthor.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"pcd-example-notAuthor.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_6(inst2)\n\n\ndef impl_contract_7(inst):\n    assert inst.id == \"C-123\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/contract\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12347\"\n    assert inst.legallyBindingAttachment.contentType == \"application/pdf\"\n    assert (\n        inst.legallyBindingAttachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.aws3.com/storage/doc.pdf\"}\n        ).valueUrl\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.rule[0].contentAttachment.contentType == \"application/txt\"\n    assert (\n        inst.rule[0].contentAttachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.rfc-editor.org/bcp/bcp13.txt\"}\n        ).valueUrl\n    )\n    assert (\n        inst.term[0].asset[0].period[0].start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-06-01\"}\n        ).valueDateTime\n    )\n    assert inst.term[0].asset[0].subtype[0].text == \"sample\"\n    assert inst.term[0].asset[0].type[0].coding[0].code == \"RicardianContract\"\n    assert (\n        inst.term[0].asset[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://something/something\"}\n        ).valueUri\n    )\n    assert (\n        inst.term[0].asset[0].valuedItem[0].effectiveTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1995\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.term[0].asset[0].valuedItem[0].entityCodeableConcept.text == \"Ford Bobcat\"\n    )\n    assert float(inst.term[0].asset[0].valuedItem[0].factor) == float(1.0)\n    assert (\n        inst.term[0].asset[0].valuedItem[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://somewhere.motor-vehicle.com/vin\"}\n        ).valueUri\n    )\n    assert inst.term[0].asset[0].valuedItem[0].identifier.value == \"XXSVT34-7665t952236\"\n    assert inst.term[0].asset[0].valuedItem[0].net.currency == \"CAD\"\n    assert float(inst.term[0].asset[0].valuedItem[0].net.value) == float(200.0)\n    assert float(inst.term[0].asset[0].valuedItem[0].points) == float(1.0)\n    assert float(inst.term[0].asset[0].valuedItem[0].quantity.value) == float(1)\n    assert inst.term[0].asset[0].valuedItem[0].unitPrice.currency == \"CAD\"\n    assert float(inst.term[0].asset[0].valuedItem[0].unitPrice.value) == float(200.0)\n    assert inst.term[0].offer.text == \"Can't refuse\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the contract</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_contract_7(base_settings):\n    \"\"\"No. 7 tests collection for Contract.\n    Test File: contract-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"contract-example.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_7(inst2)\n\n\ndef impl_contract_8(inst):\n    assert inst.authority[0].display == \"Michigan Health\"\n    assert inst.authority[0].reference == \"Organization/3\"\n    assert inst.domain[0].display == \"UK Pharmacies\"\n    assert inst.domain[0].reference == \"Location/ukp\"\n    assert (\n        inst.friendly[0].contentAttachment.title\n        == \"The terms of the consent in friendly consumer speak.\"\n    )\n    assert inst.id == \"pcd-example-notThis\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.legal[0].contentAttachment.title\n        == \"The terms of the consent in lawyer speak.\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subType[0].coding[0].code == \"Opt-In\"\n    assert inst.subType[0].coding[0].display == \"Default Authorization with exceptions.\"\n    assert (\n        inst.subType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.infoway-inforoute.ca.org/Consent-subtype-codes\"}\n        ).valueUri\n    )\n    assert inst.subject[0].display == \"P. van de Heuvel\"\n    assert inst.subject[0].reference == \"Patient/f001\"\n    assert (\n        inst.term[0].applies.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.term[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/term-items\"}\n        ).valueUri\n    )\n    assert inst.term[0].identifier.value == \"3347689\"\n    assert (\n        inst.term[0].issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-01\"}\n        ).valueDateTime\n    )\n    assert inst.term[0].offer.text == (\n        \"Withhold this order and any results or related objects from \" \"any provider.\"\n    )\n    assert inst.term[0].offer.topic.reference == \"ServiceRequest/lipid\"\n    assert inst.term[0].type.coding[0].code == \"withhold-identified-object-and-related\"\n    assert inst.term[0].type.coding[0].display == (\n        \"Withhold the identified object and any other resources that \"\n        \"are related to this object.\"\n    )\n    assert (\n        inst.term[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/consent-term-type-codes\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"57016-8\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_contract_8(base_settings):\n    \"\"\"No. 8 tests collection for Contract.\n    Test File: pcd-example-notThis.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"pcd-example-notThis.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_8(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_coverage.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Coverage\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import coverage\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_coverage_1(inst):\n    assert inst.beneficiary.reference == \"Patient/5\"\n    assert inst.class_fhir[0].name == \"Western Airlines\"\n    assert inst.class_fhir[0].type.coding[0].code == \"group\"\n    assert (\n        inst.class_fhir[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[0].value == \"WESTAIR\"\n    assert (\n        inst.class_fhir[1].name\n        == \"Full Coverage: Medical, Dental, Pharmacy, Vision, EHC\"\n    )\n    assert inst.class_fhir[1].type.coding[0].code == \"plan\"\n    assert (\n        inst.class_fhir[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[1].value == \"BG4352\"\n    assert inst.class_fhir[2].name == \"Platinum\"\n    assert inst.class_fhir[2].type.coding[0].code == \"subplan\"\n    assert (\n        inst.class_fhir[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[2].value == \"D15C9\"\n    assert inst.contract[0].reference == \"Contract/INS-101\"\n    assert (\n        inst.costToBeneficiary[0].exception[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.costToBeneficiary[0].exception[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.costToBeneficiary[0].exception[0].type.coding[0].code == \"retired\"\n    assert (\n        inst.costToBeneficiary[0].exception[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-coverage-financial-exception\"\n            }\n        ).valueUri\n    )\n    assert inst.costToBeneficiary[0].type.coding[0].code == \"gpvisit\"\n    assert (\n        inst.costToBeneficiary[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-copay-type\"}\n        ).valueUri\n    )\n    assert inst.costToBeneficiary[0].valueMoney.currency == \"USD\"\n    assert float(inst.costToBeneficiary[0].valueMoney.value) == float(20.0)\n    assert inst.dependent == \"1\"\n    assert inst.id == \"7546D\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://xyz.com/codes/identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"AB98761\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.network == \"5\"\n    assert inst.order == 2\n    assert inst.payor[0].reference == \"Organization/2\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-03-17\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-03-17\"}\n        ).valueDateTime\n    )\n    assert inst.relationship.coding[0].code == \"self\"\n    assert inst.status == \"active\"\n    assert inst.subscriber.reference == \"Patient/5\"\n    assert inst.subscriberId == \"AB9876\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the coverage</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"EHCPOL\"\n    assert inst.type.coding[0].display == \"extended healthcare\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n\n\ndef test_coverage_1(base_settings):\n    \"\"\"No. 1 tests collection for Coverage.\n    Test File: coverage-example-2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"coverage-example-2.json\"\n    inst = coverage.Coverage.model_validate_json(filename.read_bytes())\n    assert \"Coverage\" == inst.get_resource_type()\n\n    impl_coverage_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Coverage\" == data[\"resourceType\"]\n\n    inst2 = coverage.Coverage(**data)\n    impl_coverage_1(inst2)\n\n\ndef impl_coverage_2(inst):\n    assert inst.beneficiary.reference == \"Patient/5\"\n    assert inst.id == \"SP1234\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hospitalx.com/selfpayagreement\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"SP12345678\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.payor[0].reference == \"Patient/5\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-03-17\"}\n        ).valueDateTime\n    )\n    assert inst.relationship.coding[0].code == \"self\"\n    assert inst.status == \"active\"\n    assert inst.subscriber.reference == \"Patient/5\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of a Self Pay Agreement.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"pay\"\n    assert inst.type.coding[0].display == \"PAY\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-selfpay\"}\n        ).valueUri\n    )\n\n\ndef test_coverage_2(base_settings):\n    \"\"\"No. 2 tests collection for Coverage.\n    Test File: coverage-example-selfpay.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"coverage-example-selfpay.json\"\n    inst = coverage.Coverage.model_validate_json(filename.read_bytes())\n    assert \"Coverage\" == inst.get_resource_type()\n\n    impl_coverage_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Coverage\" == data[\"resourceType\"]\n\n    inst2 = coverage.Coverage(**data)\n    impl_coverage_2(inst2)\n\n\ndef impl_coverage_3(inst):\n    assert inst.beneficiary.reference == \"Patient/5\"\n    assert inst.id == \"7547E\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ehic.com/insurer/123456789/member\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"A123456780\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.payor[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ehic.com/insurer\"}\n        ).valueUri\n    )\n    assert inst.payor[0].identifier.value == \"123456789\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-03-17\"}\n        ).valueDateTime\n    )\n    assert inst.relationship.coding[0].code == \"self\"\n    assert inst.status == \"active\"\n    assert inst.subscriber.reference == \"Patient/5\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the European Health Insurance Card</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"EHCPOL\"\n    assert inst.type.coding[0].display == \"extended healthcare\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n\n\ndef test_coverage_3(base_settings):\n    \"\"\"No. 3 tests collection for Coverage.\n    Test File: coverage-example-ehic.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"coverage-example-ehic.json\"\n    inst = coverage.Coverage.model_validate_json(filename.read_bytes())\n    assert \"Coverage\" == inst.get_resource_type()\n\n    impl_coverage_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Coverage\" == data[\"resourceType\"]\n\n    inst2 = coverage.Coverage(**data)\n    impl_coverage_3(inst2)\n\n\ndef impl_coverage_4(inst):\n    assert inst.beneficiary.reference == \"Patient/4\"\n    assert inst.class_fhir[0].name == \"Corporate Baker's Inc. Local #35\"\n    assert inst.class_fhir[0].type.coding[0].code == \"group\"\n    assert (\n        inst.class_fhir[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[0].value == \"CB135\"\n    assert inst.class_fhir[1].name == \"Trainee Part-time Benefits\"\n    assert inst.class_fhir[1].type.coding[0].code == \"subgroup\"\n    assert (\n        inst.class_fhir[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[1].value == \"123\"\n    assert (\n        inst.class_fhir[2].name\n        == \"Full Coverage: Medical, Dental, Pharmacy, Vision, EHC\"\n    )\n    assert inst.class_fhir[2].type.coding[0].code == \"plan\"\n    assert (\n        inst.class_fhir[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[2].value == \"B37FC\"\n    assert inst.class_fhir[3].name == \"Includes afterlife benefits\"\n    assert inst.class_fhir[3].type.coding[0].code == \"subplan\"\n    assert (\n        inst.class_fhir[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[3].value == \"P7\"\n    assert inst.class_fhir[4].name == \"Silver: Family Plan spouse only\"\n    assert inst.class_fhir[4].type.coding[0].code == \"class\"\n    assert (\n        inst.class_fhir[4].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[4].value == \"SILVER\"\n    assert inst.class_fhir[5].name == \"Low deductable, max $20 copay\"\n    assert inst.class_fhir[5].type.coding[0].code == \"subclass\"\n    assert (\n        inst.class_fhir[5].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[5].value == \"Tier2\"\n    assert inst.class_fhir[6].type.coding[0].code == \"sequence\"\n    assert (\n        inst.class_fhir[6].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[6].value == \"9\"\n    assert inst.class_fhir[7].type.coding[0].code == \"rxid\"\n    assert (\n        inst.class_fhir[7].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[7].value == \"MDF12345\"\n    assert inst.class_fhir[8].type.coding[0].code == \"rxbin\"\n    assert (\n        inst.class_fhir[8].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[8].value == \"987654\"\n    assert inst.class_fhir[9].type.coding[0].code == \"rxgroup\"\n    assert (\n        inst.class_fhir[9].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[9].value == \"M35PT\"\n    assert inst.dependent == \"0\"\n    assert inst.id == \"9876B1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://benefitsinc.com/certificate\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.payor[0].reference == \"Organization/2\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-05-23\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-05-23\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.policyHolder.reference == \"http://benefitsinc.com/FHIR/Organization/CBI35\"\n    )\n    assert inst.relationship.coding[0].code == \"self\"\n    assert inst.status == \"active\"\n    assert inst.subscriber.reference == \"Patient/4\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the coverage</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"EHCPOL\"\n    assert inst.type.coding[0].display == \"extended healthcare\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n\n\ndef test_coverage_4(base_settings):\n    \"\"\"No. 4 tests collection for Coverage.\n    Test File: coverage-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"coverage-example.json\"\n    inst = coverage.Coverage.model_validate_json(filename.read_bytes())\n    assert \"Coverage\" == inst.get_resource_type()\n\n    impl_coverage_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Coverage\" == data[\"resourceType\"]\n\n    inst2 = coverage.Coverage(**data)\n    impl_coverage_4(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_coverageeligibilityrequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import coverageeligibilityrequest\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_coverageeligibilityrequest_1(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"52345\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/coverageelegibilityrequest\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"52345\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.purpose[0] == \"validation\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the CoverageEligibilityRequest</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_coverageeligibilityrequest_1(base_settings):\n    \"\"\"No. 1 tests collection for CoverageEligibilityRequest.\n    Test File: coverageeligibilityrequest-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"coverageeligibilityrequest-example.json\"\n    )\n    inst = coverageeligibilityrequest.CoverageEligibilityRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CoverageEligibilityRequest\" == inst.get_resource_type()\n\n    impl_coverageeligibilityrequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CoverageEligibilityRequest\" == data[\"resourceType\"]\n\n    inst2 = coverageeligibilityrequest.CoverageEligibilityRequest(**data)\n    impl_coverageeligibilityrequest_1(inst2)\n\n\ndef impl_coverageeligibilityrequest_2(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.enterer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalleyclinic.com/staff\"}\n        ).valueUri\n    )\n    assert inst.enterer.identifier.value == \"14\"\n    assert (\n        inst.facility.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://statecliniclicensor.com/clinicid\"}\n        ).valueUri\n    )\n    assert inst.facility.identifier.value == \"G35B9\"\n    assert inst.id == \"52346\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/coverageelegibilityrequest\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"52346\"\n    assert inst.insurance[0].businessArrangement == \"NB8742\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].category.coding[0].code == \"69\"\n    assert inst.item[0].category.coding[0].display == \"Maternity\"\n    assert (\n        inst.item[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.purpose[0] == \"validation\"\n    assert inst.purpose[1] == \"benefits\"\n    assert (\n        inst.servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-09-17\"}).valueDate\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the CoverageEligibilityRequest</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_coverageeligibilityrequest_2(base_settings):\n    \"\"\"No. 2 tests collection for CoverageEligibilityRequest.\n    Test File: coverageeligibilityrequest-example-2.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"coverageeligibilityrequest-example-2.json\"\n    )\n    inst = coverageeligibilityrequest.CoverageEligibilityRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CoverageEligibilityRequest\" == inst.get_resource_type()\n\n    impl_coverageeligibilityrequest_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CoverageEligibilityRequest\" == data[\"resourceType\"]\n\n    inst2 = coverageeligibilityrequest.CoverageEligibilityRequest(**data)\n    impl_coverageeligibilityrequest_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_coverageeligibilityresponse.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import coverageeligibilityresponse\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_coverageeligibilityresponse_1(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Policy is currently in-force.\"\n    assert inst.id == \"E2500\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/coverageeligibilityresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"881234\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].inforce is True\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.purpose[0] == \"validation\"\n    assert inst.request.reference == (\n        \"http://www.BenefitsInc.com/fhir/coverageeligibilityrequest/2\" \"25476332402\"\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the CoverageEligibilityResponse.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_coverageeligibilityresponse_1(base_settings):\n    \"\"\"No. 1 tests collection for CoverageEligibilityResponse.\n    Test File: coverageeligibilityresponse-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"coverageeligibilityresponse-example.json\"\n    )\n    inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CoverageEligibilityResponse\" == inst.get_resource_type()\n\n    impl_coverageeligibilityresponse_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CoverageEligibilityResponse\" == data[\"resourceType\"]\n\n    inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data)\n    impl_coverageeligibilityresponse_1(inst2)\n\n\ndef impl_coverageeligibilityresponse_2(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == (\n        \"Eligibiliy request could not be processed, please address \"\n        \"errors before submitting.\"\n    )\n    assert inst.error[0].code.coding[0].code == \"a001\"\n    assert (\n        inst.error[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/adjudication-error\"}\n        ).valueUri\n    )\n    assert inst.form.coding[0].code == \"ELRSP/2017/01\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://national.org/form\"}\n        ).valueUri\n    )\n    assert inst.id == \"E2503\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/coverageeligibilityresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"8812343\"\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"error\"\n    assert inst.patient.reference == \"Patient/f201\"\n    assert inst.purpose[0] == \"validation\"\n    assert inst.request.reference == (\n        \"http://www.BenefitsInc.com/fhir/coverageeligibilityresponse/\" \"225476332406\"\n    )\n    assert (\n        inst.requestor.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://national.org/clinic\"}\n        ).valueUri\n    )\n    assert inst.requestor.identifier.value == \"OR1234\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the CoverageEligibilityResponse.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_coverageeligibilityresponse_2(base_settings):\n    \"\"\"No. 2 tests collection for CoverageEligibilityResponse.\n    Test File: coverageeligibilityresponse-example-error.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"coverageeligibilityresponse-example-error.json\"\n    )\n    inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CoverageEligibilityResponse\" == inst.get_resource_type()\n\n    impl_coverageeligibilityresponse_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CoverageEligibilityResponse\" == data[\"resourceType\"]\n\n    inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data)\n    impl_coverageeligibilityresponse_2(inst2)\n\n\ndef impl_coverageeligibilityresponse_3(inst):\n    assert inst.contained[0].id == \"coverage-1\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Policy is currently in-force.\"\n    assert inst.form.coding[0].code == \"ELRSP/2017/01\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://national.org/form\"}\n        ).valueUri\n    )\n    assert inst.id == \"E2502\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/coverageeligibilityresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"8812342\"\n    assert inst.insurance[0].coverage.reference == \"#coverage-1\"\n    assert inst.insurance[0].inforce is True\n    assert inst.insurance[0].item[0].benefit[0].allowedMoney.currency == \"USD\"\n    assert float(inst.insurance[0].item[0].benefit[0].allowedMoney.value) == float(\n        500000\n    )\n    assert inst.insurance[0].item[0].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[0].benefit[0].usedMoney.currency == \"USD\"\n    assert float(inst.insurance[0].item[0].benefit[0].usedMoney.value) == float(3748.0)\n    assert inst.insurance[0].item[0].benefit[1].allowedMoney.currency == \"USD\"\n    assert float(inst.insurance[0].item[0].benefit[1].allowedMoney.value) == float(100)\n    assert inst.insurance[0].item[0].benefit[1].type.coding[0].code == \"copay-maximum\"\n    assert inst.insurance[0].item[0].benefit[2].allowedUnsignedInt == 20\n    assert inst.insurance[0].item[0].benefit[2].type.coding[0].code == \"copay-percent\"\n    assert inst.insurance[0].item[0].category.coding[0].code == \"30\"\n    assert (\n        inst.insurance[0].item[0].category.coding[0].display\n        == \"Health Benefit Plan Coverage\"\n    )\n    assert (\n        inst.insurance[0].item[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[0].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[0].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[0].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[0].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[0].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[0].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].benefit[0].allowedMoney.currency == \"USD\"\n    assert float(inst.insurance[0].item[1].benefit[0].allowedMoney.value) == float(\n        15000\n    )\n    assert inst.insurance[0].item[1].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[1].category.coding[0].code == \"69\"\n    assert inst.insurance[0].item[1].category.coding[0].display == \"Maternity\"\n    assert (\n        inst.insurance[0].item[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[1].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[1].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[1].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].benefit[0].allowedMoney.currency == \"USD\"\n    assert float(inst.insurance[0].item[2].benefit[0].allowedMoney.value) == float(2000)\n    assert inst.insurance[0].item[2].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[2].category.coding[0].code == \"F3\"\n    assert inst.insurance[0].item[2].category.coding[0].display == \"Dental Coverage\"\n    assert (\n        inst.insurance[0].item[2].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[2].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[2].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[2].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[3].category.coding[0].code == \"F6\"\n    assert inst.insurance[0].item[3].category.coding[0].display == \"Vision Coverage\"\n    assert (\n        inst.insurance[0].item[3].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[3].description == (\n        \"Vision products and services such as exams, glasses and \" \"contact lenses.\"\n    )\n    assert inst.insurance[0].item[3].excluded is True\n    assert inst.insurance[0].item[3].name == \"Vision\"\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/f201\"\n    assert inst.purpose[0] == \"validation\"\n    assert inst.purpose[1] == \"benefits\"\n    assert inst.request.reference == (\n        \"http://www.BenefitsInc.com/fhir/coverageeligibilityrequest/2\" \"25476332405\"\n    )\n    assert (\n        inst.requestor.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://national.org/clinic\"}\n        ).valueUri\n    )\n    assert inst.requestor.identifier.value == \"OR1234\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the CoverageEligibilityResponse.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_coverageeligibilityresponse_3(base_settings):\n    \"\"\"No. 3 tests collection for CoverageEligibilityResponse.\n    Test File: coverageeligibilityresponse-example-benefits-2.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"coverageeligibilityresponse-example-benefits-2.json\"\n    )\n    inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CoverageEligibilityResponse\" == inst.get_resource_type()\n\n    impl_coverageeligibilityresponse_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CoverageEligibilityResponse\" == data[\"resourceType\"]\n\n    inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data)\n    impl_coverageeligibilityresponse_3(inst2)\n\n\ndef impl_coverageeligibilityresponse_4(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Policy is currently in-force.\"\n    assert inst.id == \"E2501\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/coverageeligibilityresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"881234\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].inforce is True\n    assert inst.insurance[0].item[0].benefit[0].allowedMoney.currency == \"SAR\"\n    assert float(inst.insurance[0].item[0].benefit[0].allowedMoney.value) == float(\n        500000\n    )\n    assert inst.insurance[0].item[0].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[0].benefit[1].allowedMoney.currency == \"SAR\"\n    assert float(inst.insurance[0].item[0].benefit[1].allowedMoney.value) == float(100)\n    assert inst.insurance[0].item[0].benefit[1].type.coding[0].code == \"copay-maximum\"\n    assert inst.insurance[0].item[0].benefit[2].allowedUnsignedInt == 20\n    assert inst.insurance[0].item[0].benefit[2].type.coding[0].code == \"copay-percent\"\n    assert inst.insurance[0].item[0].category.coding[0].code == \"30\"\n    assert (\n        inst.insurance[0].item[0].category.coding[0].display\n        == \"Health Benefit Plan Coverage\"\n    )\n    assert (\n        inst.insurance[0].item[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[0].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[0].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[0].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[0].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[0].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[0].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].benefit[0].allowedMoney.currency == \"SAR\"\n    assert float(inst.insurance[0].item[1].benefit[0].allowedMoney.value) == float(\n        15000\n    )\n    assert inst.insurance[0].item[1].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[1].category.coding[0].code == \"69\"\n    assert inst.insurance[0].item[1].category.coding[0].display == \"Maternity\"\n    assert (\n        inst.insurance[0].item[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[1].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[1].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[1].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].benefit[0].allowedMoney.currency == \"SAR\"\n    assert float(inst.insurance[0].item[2].benefit[0].allowedMoney.value) == float(2000)\n    assert inst.insurance[0].item[2].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[2].category.coding[0].code == \"F3\"\n    assert inst.insurance[0].item[2].category.coding[0].display == \"Dental Coverage\"\n    assert (\n        inst.insurance[0].item[2].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[2].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[2].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[2].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[3].benefit[0].allowedMoney.currency == \"SAR\"\n    assert float(inst.insurance[0].item[3].benefit[0].allowedMoney.value) == float(400)\n    assert inst.insurance[0].item[3].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[3].category.coding[0].code == \"F6\"\n    assert inst.insurance[0].item[3].category.coding[0].display == \"Vision Coverage\"\n    assert (\n        inst.insurance[0].item[3].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[3].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[3].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[3].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[3].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[3].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[3].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[4].benefit[0].allowedString == \"shared\"\n    assert inst.insurance[0].item[4].benefit[0].type.coding[0].code == \"room\"\n    assert inst.insurance[0].item[4].benefit[1].allowedMoney.currency == \"SAR\"\n    assert float(inst.insurance[0].item[4].benefit[1].allowedMoney.value) == float(600)\n    assert inst.insurance[0].item[4].benefit[1].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[4].category.coding[0].code == \"49\"\n    assert (\n        inst.insurance[0].item[4].category.coding[0].display\n        == \"Hospital Room and Board\"\n    )\n    assert (\n        inst.insurance[0].item[4].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[4].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[4].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[4].term.coding[0].code == \"day\"\n    assert (\n        inst.insurance[0].item[4].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[4].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[4].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.purpose[0] == \"validation\"\n    assert inst.purpose[1] == \"benefits\"\n    assert inst.request.reference == (\n        \"http://www.BenefitsInc.com/fhir/coverageeligibilityresponse/\" \"225476332402\"\n    )\n    assert (\n        inst.servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-09-17\"}).valueDate\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the CoverageEligibilityResponse.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_coverageeligibilityresponse_4(base_settings):\n    \"\"\"No. 4 tests collection for CoverageEligibilityResponse.\n    Test File: coverageeligibilityresponse-example-benefits.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"coverageeligibilityresponse-example-benefits.json\"\n    )\n    inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CoverageEligibilityResponse\" == inst.get_resource_type()\n\n    impl_coverageeligibilityresponse_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CoverageEligibilityResponse\" == data[\"resourceType\"]\n\n    inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data)\n    impl_coverageeligibilityresponse_4(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_detectedissue.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DetectedIssue\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import detectedissue\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_detectedissue_1(inst):\n    assert inst.id == \"allergy\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_detectedissue_1(base_settings):\n    \"\"\"No. 1 tests collection for DetectedIssue.\n    Test File: detectedissue-example-allergy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"detectedissue-example-allergy.json\"\n    inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes())\n    assert \"DetectedIssue\" == inst.get_resource_type()\n\n    impl_detectedissue_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DetectedIssue\" == data[\"resourceType\"]\n\n    inst2 = detectedissue.DetectedIssue(**data)\n    impl_detectedissue_1(inst2)\n\n\ndef impl_detectedissue_2(inst):\n    assert inst.author.reference == \"Device/software\"\n    assert inst.code.coding[0].code == \"DUPTHPY\"\n    assert inst.code.coding[0].display == \"Duplicate Therapy Alert\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.detail == \"Similar test was performed within the past 14 days\"\n    assert inst.id == \"duplicate\"\n    assert (\n        inst.identifiedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-05-08\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345\"\n    assert (\n        inst.implicated[0].display\n        == \"Chest CT - ordered May 8, 2013 by Dr. Adam Careful\"\n    )\n    assert inst.implicated[0].reference == \"ServiceRequest/di\"\n    assert inst.implicated[1].display == (\n        \"Image 1 from Series 3: CT Images on Patient MINT (MINT1234) \"\n        \"taken at 1-Jan 2011 01:20 AM\"\n    )\n    assert inst.implicated[1].reference == \"ImagingStudy/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/dicom\"\n    assert (\n        inst.reference\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://www.tmhp.com/RadiologyClinicalDecisionSupport/2011/CHEST%20IMAGING%20GUIDELINES%202011.pdf\"\n            }\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_detectedissue_2(base_settings):\n    \"\"\"No. 2 tests collection for DetectedIssue.\n    Test File: detectedissue-example-dup.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"detectedissue-example-dup.json\"\n    inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes())\n    assert \"DetectedIssue\" == inst.get_resource_type()\n\n    impl_detectedissue_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DetectedIssue\" == data[\"resourceType\"]\n\n    inst2 = detectedissue.DetectedIssue(**data)\n    impl_detectedissue_2(inst2)\n\n\ndef impl_detectedissue_3(inst):\n    assert inst.author.reference == \"Device/software\"\n    assert inst.code.coding[0].code == \"DRG\"\n    assert inst.code.coding[0].display == \"Drug Interaction Alert\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.id == \"ddi\"\n    assert (\n        inst.identifiedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-01-05\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.implicated[0].display\n        == \"500 mg Acetaminophen tablet 1/day, PRN since 2010\"\n    )\n    assert inst.implicated[0].reference == \"MedicationStatement/example001\"\n    assert inst.implicated[1].display == \"Warfarin 1 MG TAB prescribed Jan. 15, 2015\"\n    assert inst.implicated[1].reference == \"MedicationRequest/medrx0331\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mitigation[0].action.coding[0].code == \"13\"\n    assert inst.mitigation[0].action.coding[0].display == \"Stopped Concurrent Therapy\"\n    assert (\n        inst.mitigation[0].action.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.mitigation[0].action.text == (\n        \"Asked patient to discontinue regular use of Tylenol and to \"\n        \"consult with clinician if they need to resume to allow \"\n        \"appropriate INR monitoring\"\n    )\n    assert inst.mitigation[0].author.display == \"Dr. Adam Careful\"\n    assert inst.mitigation[0].author.reference == \"Practitioner/example\"\n    assert (\n        inst.mitigation[0].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-01-05\"}\n        ).valueDateTime\n    )\n    assert inst.severity == \"high\"\n    assert inst.status == \"final\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_detectedissue_3(base_settings):\n    \"\"\"No. 3 tests collection for DetectedIssue.\n    Test File: detectedissue-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"detectedissue-example.json\"\n    inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes())\n    assert \"DetectedIssue\" == inst.get_resource_type()\n\n    impl_detectedissue_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DetectedIssue\" == data[\"resourceType\"]\n\n    inst2 = detectedissue.DetectedIssue(**data)\n    impl_detectedissue_3(inst2)\n\n\ndef impl_detectedissue_4(inst):\n    assert inst.id == \"lab\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_detectedissue_4(base_settings):\n    \"\"\"No. 4 tests collection for DetectedIssue.\n    Test File: detectedissue-example-lab.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"detectedissue-example-lab.json\"\n    inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes())\n    assert \"DetectedIssue\" == inst.get_resource_type()\n\n    impl_detectedissue_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DetectedIssue\" == data[\"resourceType\"]\n\n    inst2 = detectedissue.DetectedIssue(**data)\n    impl_detectedissue_4(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_device.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Device\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import device\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_device_1(inst):\n    assert inst.id == \"f001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealthhospital/identifier/devices\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_device_1(base_settings):\n    \"\"\"No. 1 tests collection for Device.\n    Test File: device-example-f001-feedingtube.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"device-example-f001-feedingtube.json\"\n    )\n    inst = device.Device.model_validate_json(filename.read_bytes())\n    assert \"Device\" == inst.get_resource_type()\n\n    impl_device_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Device\" == data[\"resourceType\"]\n\n    inst2 = device.Device(**data)\n    impl_device_1(inst2)\n\n\ndef impl_device_2(inst):\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodcare.org/devices/id\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"345675\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_device_2(base_settings):\n    \"\"\"No. 2 tests collection for Device.\n    Test File: device-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"device-example.json\"\n    inst = device.Device.model_validate_json(filename.read_bytes())\n    assert \"Device\" == inst.get_resource_type()\n\n    impl_device_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Device\" == data[\"resourceType\"]\n\n    inst2 = device.Device(**data)\n    impl_device_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_devicedefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import devicedefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_devicedefinition_1(inst):\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"0\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_devicedefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for DeviceDefinition.\n    Test File: devicedefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"devicedefinition-example.json\"\n    inst = devicedefinition.DeviceDefinition.model_validate_json(filename.read_bytes())\n    assert \"DeviceDefinition\" == inst.get_resource_type()\n\n    impl_devicedefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceDefinition\" == data[\"resourceType\"]\n\n    inst2 = devicedefinition.DeviceDefinition(**data)\n    impl_devicedefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_devicemetric.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceMetric\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import devicemetric\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_devicemetric_1(inst):\n    assert inst.calibration[0].state == \"calibrated\"\n    assert (\n        inst.calibration[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-12-28T09:03:04-05:00\"}\n        ).valueInstant\n    )\n    assert inst.calibration[0].type == \"two-point\"\n    assert inst.category == \"measurement\"\n    assert inst.color == \"blue\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodcare.org/devicemetric/id\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"345675\"\n    assert inst.measurementPeriod.repeat.frequency == 1\n    assert float(inst.measurementPeriod.repeat.period) == float(1)\n    assert inst.measurementPeriod.repeat.periodUnit == \"s\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.operationalStatus == \"on\"\n    assert inst.parent.reference == \"DeviceDefinition/dc102\"\n    assert inst.source.reference == \"Device/dev1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"150456\"\n    assert inst.type.coding[0].display == \"MDC_PULS_OXIM_SAT_O2\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.unit.coding[0].code == \"262688\"\n    assert inst.unit.coding[0].display == \"MDC_DIM_PERCENT\"\n    assert (\n        inst.unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n\n\ndef test_devicemetric_1(base_settings):\n    \"\"\"No. 1 tests collection for DeviceMetric.\n    Test File: devicemetric-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"devicemetric-example.json\"\n    inst = devicemetric.DeviceMetric.model_validate_json(filename.read_bytes())\n    assert \"DeviceMetric\" == inst.get_resource_type()\n\n    impl_devicemetric_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceMetric\" == data[\"resourceType\"]\n\n    inst2 = devicemetric.DeviceMetric(**data)\n    impl_devicemetric_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_devicerequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import devicerequest\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_devicerequest_1(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-05-08T09:33:27+07:00\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].display == \"Homecare - DM follow-up\"\n    assert inst.codeCodeableConcept.coding[0].code == \"43148-6\"\n    assert (\n        inst.codeCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.codeCodeableConcept.text == \"Insulin delivery device panel\"\n    assert inst.encounter.display == \"Encounter 1\"\n    assert inst.groupIdentifier.value == \"ip_request1\"\n    assert inst.id == \"insulinpump\"\n    assert inst.identifier[0].value == \"ip_request1.1\"\n    assert inst.instantiatesCanonical[0] == (\n        \"http://motivemi.com/artifacts/PlanDefinition/low-suicide-\" \"risk-order-set\"\n    )\n    assert inst.intent == \"instance-order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"this is the right device brand and model\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-05-08T09:33:27+07:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer.display == \"Nurse Rossignol\"\n    assert inst.performerType.coding[0].display == \"Qualified nurse\"\n    assert inst.performerType.text == \"Nurse\"\n    assert inst.priorRequest[0].display == \"CGM ambulatory\"\n    assert inst.priority == \"routine\"\n    assert inst.reasonCode[0].text == \"gastroparesis\"\n    assert inst.reasonReference[0].display == \"Gastroparesis\"\n    assert inst.relevantHistory[0].display == \"Request for unspecified device\"\n    assert inst.requester.display == \"Dr. Adam Careful\"\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/dicom\"\n    assert inst.supportingInfo[0].display == \"Previous results\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_devicerequest_1(base_settings):\n    \"\"\"No. 1 tests collection for DeviceRequest.\n    Test File: devicerequest-example-insulinpump.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"devicerequest-example-insulinpump.json\"\n    )\n    inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes())\n    assert \"DeviceRequest\" == inst.get_resource_type()\n\n    impl_devicerequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceRequest\" == data[\"resourceType\"]\n\n    inst2 = devicerequest.DeviceRequest(**data)\n    impl_devicerequest_1(inst2)\n\n\ndef impl_devicerequest_2(inst):\n    assert inst.codeCodeableConcept.coding[0].code == \"lens\"\n    assert (\n        inst.codeCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.value == \"15013\"\n    assert inst.id == \"left-lens\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.happysight.com/prescription\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"15013L\"\n    assert inst.intent == \"original-order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-06-15\"}\n        ).valueDateTime\n    )\n    assert inst.parameter[0].code.coding[0].code == \"28842-3\"\n    assert (\n        inst.parameter[0].code.coding[0].display\n        == \"Sphere distance Glasses prescription.lens - left\"\n    )\n    assert (\n        inst.parameter[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[0].code.text == \"sphere, left lens\"\n    assert inst.parameter[0].valueQuantity.code == \"[diop]\"\n    assert (\n        inst.parameter[0].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[0].valueQuantity.unit == \"Diopter\"\n    assert float(inst.parameter[0].valueQuantity.value) == float(-1.0)\n    assert inst.parameter[1].code.coding[0].code == \"28843-1\"\n    assert (\n        inst.parameter[1].code.coding[0].display\n        == \"Cylinder base distance Glasses prescription.lens - left\"\n    )\n    assert (\n        inst.parameter[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[1].code.text == \"cylinder, left lens\"\n    assert inst.parameter[1].valueQuantity.code == \"[diop]\"\n    assert (\n        inst.parameter[1].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[1].valueQuantity.unit == \"Diopter\"\n    assert float(inst.parameter[1].valueQuantity.value) == float(-0.5)\n    assert inst.parameter[2].code.coding[0].code == \"28844-9\"\n    assert (\n        inst.parameter[2].code.coding[0].display\n        == \" Axis distance Glasses prescription.lens - left\"\n    )\n    assert (\n        inst.parameter[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[2].code.text == \"axis, left lens\"\n    assert inst.parameter[2].valueQuantity.code == \"deg\"\n    assert (\n        inst.parameter[2].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[2].valueQuantity.unit == \"Degrees\"\n    assert float(inst.parameter[2].valueQuantity.value) == float(180)\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_devicerequest_2(base_settings):\n    \"\"\"No. 2 tests collection for DeviceRequest.\n    Test File: devicerequest-left-lens.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"devicerequest-left-lens.json\"\n    inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes())\n    assert \"DeviceRequest\" == inst.get_resource_type()\n\n    impl_devicerequest_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceRequest\" == data[\"resourceType\"]\n\n    inst2 = devicerequest.DeviceRequest(**data)\n    impl_devicerequest_2(inst2)\n\n\ndef impl_devicerequest_3(inst):\n    assert inst.codeCodeableConcept.coding[0].code == \"lens\"\n    assert (\n        inst.codeCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.value == \"15013\"\n    assert inst.id == \"right-lens\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.happysight.com/prescription\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"15013R\"\n    assert inst.intent == \"original-order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-06-15\"}\n        ).valueDateTime\n    )\n    assert inst.parameter[0].code.coding[0].code == \"28826-6\"\n    assert (\n        inst.parameter[0].code.coding[0].display\n        == \"Sphere distance Glasses prescription.lens - right\"\n    )\n    assert (\n        inst.parameter[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[0].code.text == \"sphere, right lens\"\n    assert inst.parameter[0].valueQuantity.code == \"[diop]\"\n    assert (\n        inst.parameter[0].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[0].valueQuantity.unit == \"Diopter\"\n    assert float(inst.parameter[0].valueQuantity.value) == float(-2.0)\n    assert inst.parameter[1].code.coding[0].code == \"28829-0\"\n    assert (\n        inst.parameter[1].code.coding[0].display\n        == \"Prism base distance Glasses prescription.lens - right\"\n    )\n    assert (\n        inst.parameter[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[1].code.text == \"prisms, right lens\"\n    assert inst.parameter[1].valueQuantity.code == \"[diop]\"\n    assert (\n        inst.parameter[1].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[1].valueQuantity.unit == \"Diopter\"\n    assert float(inst.parameter[1].valueQuantity.value) == float(-2.0)\n    assert inst.parameter[2].code.coding[0].code == \"28810-0\"\n    assert inst.parameter[2].code.coding[0].display == \"Add 1 LM glasses lens - right\"\n    assert (\n        inst.parameter[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[2].code.text == \"add, right lens\"\n    assert inst.parameter[2].valueQuantity.code == \"[diop]\"\n    assert (\n        inst.parameter[2].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[2].valueQuantity.unit == \"Diopter\"\n    assert float(inst.parameter[2].valueQuantity.value) == float(2.0)\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_devicerequest_3(base_settings):\n    \"\"\"No. 3 tests collection for DeviceRequest.\n    Test File: devicerequest-right-lens.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"devicerequest-right-lens.json\"\n    inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes())\n    assert \"DeviceRequest\" == inst.get_resource_type()\n\n    impl_devicerequest_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceRequest\" == data[\"resourceType\"]\n\n    inst2 = devicerequest.DeviceRequest(**data)\n    impl_devicerequest_3(inst2)\n\n\ndef impl_devicerequest_4(inst):\n    assert inst.codeReference.reference == \"Device/example\"\n    assert inst.id == \"example\"\n    assert inst.intent == \"original-order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_devicerequest_4(base_settings):\n    \"\"\"No. 4 tests collection for DeviceRequest.\n    Test File: devicerequest-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"devicerequest-example.json\"\n    inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes())\n    assert \"DeviceRequest\" == inst.get_resource_type()\n\n    impl_devicerequest_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceRequest\" == data[\"resourceType\"]\n\n    inst2 = devicerequest.DeviceRequest(**data)\n    impl_devicerequest_4(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_deviceusestatement.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceUseStatement\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import deviceusestatement\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_deviceusestatement_1(inst):\n    assert inst.device.reference == \"Device/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:goodhealth.org/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"51ebb7a9-4e3a-4360-9a05-0cc2d869086f\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.reasonReference[0].display == \"PHx of Appendectomy (surgery)\"\n    assert inst.reasonReference[0].reference == \"Condition/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_deviceusestatement_1(base_settings):\n    \"\"\"No. 1 tests collection for DeviceUseStatement.\n    Test File: deviceusestatement-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"deviceusestatement-example.json\"\n    inst = deviceusestatement.DeviceUseStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DeviceUseStatement\" == inst.get_resource_type()\n\n    impl_deviceusestatement_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceUseStatement\" == data[\"resourceType\"]\n\n    inst2 = deviceusestatement.DeviceUseStatement(**data)\n    impl_deviceusestatement_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_diagnosticreport.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DiagnosticReport\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import diagnosticreport\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_diagnosticreport_1(inst):\n    assert inst.category[0].coding[0].code == \"394914008\"\n    assert inst.category[0].coding[0].display == \"Radiology\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[1].code == \"RAD\"\n    assert (\n        inst.category[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0074\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"45036003\"\n    assert inst.code.coding[0].display == \"Ultrasonography of abdomen\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Abdominal Ultrasound\"\n    assert inst.conclusion == \"Unremarkable study\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-12-01T12:00:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"ultrasound\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2012-12-01T12:00:00+01:00\"}\n        ).valueInstant\n    )\n    assert inst.media[0].comment == \"A comment about the image\"\n    assert inst.media[0].link.display == \"WADO example image\"\n    assert (\n        inst.media[0].link.reference\n        == \"Media/1.2.840.11361907579238403408700.3.1.04.19970327150033\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].reference == \"Practitioner/example\"\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_diagnosticreport_1(base_settings):\n    \"\"\"No. 1 tests collection for DiagnosticReport.\n    Test File: diagnosticreport-example-ultrasound.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"diagnosticreport-example-ultrasound.json\"\n    )\n    inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes())\n    assert \"DiagnosticReport\" == inst.get_resource_type()\n\n    impl_diagnosticreport_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DiagnosticReport\" == data[\"resourceType\"]\n\n    inst2 = diagnosticreport.DiagnosticReport(**data)\n    impl_diagnosticreport_1(inst2)\n\n\ndef impl_diagnosticreport_2(inst):\n    assert inst.category[0].coding[0].code == \"394914008\"\n    assert inst.category[0].coding[0].display == \"Radiology\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[1].code == \"RAD\"\n    assert (\n        inst.category[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0074\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"429858000\"\n    assert inst.code.coding[0].display == \"Computed tomography (CT) of head and neck\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"CT of head-neck\"\n    assert inst.conclusion == \"CT brains: large tumor sphenoid/clivus.\"\n    assert inst.conclusionCode[0].coding[0].code == \"188340000\"\n    assert (\n        inst.conclusionCode[0].coding[0].display\n        == \"Malignant tumor of craniopharyngeal duct\"\n    )\n    assert (\n        inst.conclusionCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-12-01T12:00:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"f201\"\n    assert inst.imagingStudy[0].display == \"HEAD and NECK CT DICOM imaging study\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2012-12-01T12:00:00+01:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Blijdorp MC\"\n    assert inst.performer[0].reference == \"Organization/f203\"\n    assert inst.status == \"final\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_diagnosticreport_2(base_settings):\n    \"\"\"No. 2 tests collection for DiagnosticReport.\n    Test File: diagnosticreport-example-f201-brainct.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"diagnosticreport-example-f201-brainct.json\"\n    )\n    inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes())\n    assert \"DiagnosticReport\" == inst.get_resource_type()\n\n    impl_diagnosticreport_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DiagnosticReport\" == data[\"resourceType\"]\n\n    inst2 = diagnosticreport.DiagnosticReport(**data)\n    impl_diagnosticreport_2(inst2)\n\n\ndef impl_diagnosticreport_3(inst):\n    assert inst.code.coding[0].code == \"47527-7\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-02-11T10:33:33+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"pap\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-02-13T11:45:33+11:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].reference == \"Practitioner/example\"\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/b248b1b2-1686-4b94-9936-37d7a5f94b51\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_diagnosticreport_3(base_settings):\n    \"\"\"No. 3 tests collection for DiagnosticReport.\n    Test File: diagnosticreport-example-papsmear.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"diagnosticreport-example-papsmear.json\"\n    )\n    inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes())\n    assert \"DiagnosticReport\" == inst.get_resource_type()\n\n    impl_diagnosticreport_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DiagnosticReport\" == data[\"resourceType\"]\n\n    inst2 = diagnosticreport.DiagnosticReport(**data)\n    impl_diagnosticreport_3(inst2)\n\n\ndef impl_diagnosticreport_4(inst):\n    assert inst.category[0].coding[0].code == \"PAT\"\n    assert (\n        inst.category[0].coding[0].display\n        == \"Pathology (gross & histopath, not surgical)\"\n    )\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0074\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Pathology\"\n    assert inst.code.coding[0].code == \"4503\"\n    assert inst.code.coding[0].display == (\n        \"Biopsy without Microscopic Description (1 \" \"Site/Lesion)-Standard\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.acmeonline.com\"}\n        ).valueUri\n    )\n    assert inst.code.text == (\n        \"Biopsy without Microscopic Description (1 \" \"Site/Lesion)-Standard\"\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"gingival-mass\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.acmeonline.com\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"P73456090\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2017-03-15T08:13:08Z\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Acme Animal Labs\"\n    assert inst.presentedForm[0].contentType == \"application/pdf\"\n    assert inst.presentedForm[0].language == \"en\"\n    assert inst.presentedForm[0].title == (\n        \"LAB ID: P73456090 MAX JONES Biopsy without Microscopic \"\n        \"Description (1 Site/Lesion)-Standard\"\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.display == \"Max Jones\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_diagnosticreport_4(base_settings):\n    \"\"\"No. 4 tests collection for DiagnosticReport.\n    Test File: diagnosticreport-example-gingival-mass.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"diagnosticreport-example-gingival-mass.json\"\n    )\n    inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes())\n    assert \"DiagnosticReport\" == inst.get_resource_type()\n\n    impl_diagnosticreport_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DiagnosticReport\" == data[\"resourceType\"]\n\n    inst2 = diagnosticreport.DiagnosticReport(**data)\n    impl_diagnosticreport_4(inst2)\n\n\ndef impl_diagnosticreport_5(inst):\n    assert inst.basedOn[0].reference == \"ServiceRequest/example-pgx\"\n    assert inst.code.coding[0].code == \"PGxReport\"\n    assert inst.code.coding[0].display == \"Pharmacogenetics Report\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://system/PGxReport\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Pharmacogenetics Report\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-15T12:34:56+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-pgx\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-10-20T14:00:05+11:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].reference == \"Organization/4829\"\n    assert inst.presentedForm[0].contentType == \"application/pdf\"\n    assert (\n        inst.presentedForm[0].creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-20T20:00:00+11:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.presentedForm[0].data\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"cGRmSW5CYXNlNjRCaW5hcnk=\"}\n        ).valueBase64Binary\n    )\n    assert (\n        inst.presentedForm[0].hash\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"571ef9c5655840f324e679072ed62b1b95eef8a0\"}\n        ).valueBase64Binary\n    )\n    assert inst.presentedForm[0].language == \"en\"\n    assert inst.presentedForm[0].title == \"Pharmacogenetics Report\"\n    assert inst.result[0].reference == \"Observation/example-phenotype\"\n    assert inst.status == \"final\"\n    assert inst.subject.display == \"Bob Smith\"\n    assert inst.subject.reference == \"Patient/899962\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_diagnosticreport_5(base_settings):\n    \"\"\"No. 5 tests collection for DiagnosticReport.\n    Test File: diagnosticreport-example-pgx.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"diagnosticreport-example-pgx.json\"\n    inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes())\n    assert \"DiagnosticReport\" == inst.get_resource_type()\n\n    impl_diagnosticreport_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DiagnosticReport\" == data[\"resourceType\"]\n\n    inst2 = diagnosticreport.DiagnosticReport(**data)\n    impl_diagnosticreport_5(inst2)\n\n\ndef impl_diagnosticreport_6(inst):\n    assert inst.code.coding[0].code == \"38269-7\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"DXA BONE DENSITOMETRY\"\n    assert inst.conclusionCode[0].coding[0].code == \"391040000\"\n    assert (\n        inst.conclusionCode[0].coding[0].display == \"At risk of osteoporotic fracture\"\n    )\n    assert (\n        inst.conclusionCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2008-06-17\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"102\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2008-06-18T09:23:00+10:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Dr Henry Seven\"\n    assert (\n        inst.performer[0].reference\n        == \"Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809\"\n    )\n    assert inst.result[0].reference == \"Observation/bmd\"\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/pat2\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_diagnosticreport_6(base_settings):\n    \"\"\"No. 6 tests collection for DiagnosticReport.\n    Test File: diagnosticreport-example-dxa.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"diagnosticreport-example-dxa.json\"\n    inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes())\n    assert \"DiagnosticReport\" == inst.get_resource_type()\n\n    impl_diagnosticreport_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DiagnosticReport\" == data[\"resourceType\"]\n\n    inst2 = diagnosticreport.DiagnosticReport(**data)\n    impl_diagnosticreport_6(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_documentmanifest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DocumentManifest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import documentmanifest\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_documentmanifest_1(inst):\n    assert inst.author[0].reference == \"#a1\"\n    assert inst.contained[0].id == \"a1\"\n    assert inst.content[0].reference == \"DocumentReference/example\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2004-12-25T23:50:50-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Physical\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/documents\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"23425234234-2347\"\n    assert (\n        inst.masterIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/documents\"}\n        ).valueUri\n    )\n    assert inst.masterIdentifier.value == \"23425234234-2346\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.recipient[0].reference == \"Practitioner/xcda1\"\n    assert (\n        inst.related[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/documents\"}\n        ).valueUri\n    )\n    assert inst.related[0].identifier.value == \"23425234234-9999\"\n    assert inst.related[0].ref.reference == \"DocumentReference/example\"\n    assert (\n        inst.source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.3.6.1.4.1.21367.2009.1.2.1\"}\n        ).valueUri\n    )\n    assert inst.status == \"current\"\n    assert inst.subject.reference == \"Patient/xcda\"\n    assert inst.text.div == '<div xmlns=\"http://www.w3.org/1999/xhtml\">Text</div>'\n    assert inst.text.status == \"generated\"\n    assert inst.type.text == \"History and Physical\"\n\n\ndef test_documentmanifest_1(base_settings):\n    \"\"\"No. 1 tests collection for DocumentManifest.\n    Test File: documentmanifest-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"documentmanifest-example.json\"\n    inst = documentmanifest.DocumentManifest.model_validate_json(filename.read_bytes())\n    assert \"DocumentManifest\" == inst.get_resource_type()\n\n    impl_documentmanifest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentManifest\" == data[\"resourceType\"]\n\n    inst2 = documentmanifest.DocumentManifest(**data)\n    impl_documentmanifest_1(inst2)\n\n\ndef impl_documentmanifest_2(inst):\n    assert inst.contained[0].id == \"org-1\"\n    assert inst.contained[1].id == \"a1\"\n    assert inst.contained[2].id == \"a2\"\n    assert inst.content[0].reference == \"#a1\"\n    assert inst.content[1].reference == \"#a2\"\n    assert inst.content[2].reference == \"DocumentReference/example\"\n    assert inst.content[3].reference == \"DiagnosticReport/f001\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-21T11:50:23-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"654789\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/supportingdocumentation\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"52345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.recipient[0].reference == \"#org-1\"\n    assert (\n        inst.related[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.related[0].identifier.value == \"12345\"\n    assert (\n        inst.related[1].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/remittance\"}\n        ).valueUri\n    )\n    assert inst.related[1].identifier.value == \"R3500\"\n    assert inst.status == \"current\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A Financial '\n        \"Management Attachment example</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_documentmanifest_2(base_settings):\n    \"\"\"No. 2 tests collection for DocumentManifest.\n    Test File: documentmanifest-fm-attachment.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"documentmanifest-fm-attachment.json\"\n    )\n    inst = documentmanifest.DocumentManifest.model_validate_json(filename.read_bytes())\n    assert \"DocumentManifest\" == inst.get_resource_type()\n\n    impl_documentmanifest_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentManifest\" == data[\"resourceType\"]\n\n    inst2 = documentmanifest.DocumentManifest(**data)\n    impl_documentmanifest_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_documentreference.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DocumentReference\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import documentreference\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_documentreference_1(inst):\n    assert inst.authenticator.reference == \"Organization/f001\"\n    assert inst.author[0].reference == \"Practitioner/xcda1\"\n    assert inst.author[1].reference == \"#a2\"\n    assert inst.category[0].coding[0].code == \"History and Physical\"\n    assert inst.category[0].coding[0].display == \"History and Physical\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/xds/connectathon/classCodes\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"a2\"\n    assert inst.content[0].attachment.contentType == \"application/hl7-v3+xml\"\n    assert (\n        inst.content[0].attachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2005-12-24T09:35:00+11:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.content[0].attachment.hash\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"2jmj7l5rSw0yVb/vlWAYkK/YBwk=\"}\n        ).valueBase64Binary\n    )\n    assert inst.content[0].attachment.language == \"en-US\"\n    assert inst.content[0].attachment.size == 3654\n    assert inst.content[0].attachment.title == \"Physical\"\n    assert (\n        inst.content[0].attachment.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://example.org/xds/mhd/Binary/07a6483f-732b-461e-86b6-edb665c45510\"\n            }\n        ).valueUrl\n    )\n    assert inst.content[0].format.code == \"urn:ihe:pcc:handp:2008\"\n    assert inst.content[0].format.display == \"History and Physical Specification\"\n    assert (\n        inst.content[0].format.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.3.6.1.4.1.19376.1.2.3\"}\n        ).valueUri\n    )\n    assert inst.context.encounter[0].reference == \"Encounter/xcda\"\n    assert inst.context.event[0].coding[0].code == \"T-D8200\"\n    assert inst.context.event[0].coding[0].display == \"Arm\"\n    assert (\n        inst.context.event[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/xds/connectathon/eventCodes\"}\n        ).valueUri\n    )\n    assert inst.context.facilityType.coding[0].code == \"Outpatient\"\n    assert inst.context.facilityType.coding[0].display == \"Outpatient\"\n    assert (\n        inst.context.facilityType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://www.ihe.net/xds/connectathon/healthcareFacilityTypeCodes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.context.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2004-12-23T08:01:00+11:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.context.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2004-12-23T08:00:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.context.practiceSetting.coding[0].code == \"General Medicine\"\n    assert inst.context.practiceSetting.coding[0].display == \"General Medicine\"\n    assert (\n        inst.context.practiceSetting.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ihe.net/xds/connectathon/practiceSettingCodes\"}\n        ).valueUri\n    )\n    assert (\n        inst.context.related[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.context.related[0].identifier.value\n        == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.2345\"\n    )\n    assert inst.context.related[0].reference == \"Patient/xcda\"\n    assert inst.context.sourcePatientInfo.reference == \"Patient/xcda\"\n    assert inst.custodian.reference == \"Organization/f001\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2005-12-24T09:43:41+11:00\"}\n        ).valueInstant\n    )\n    assert inst.description == \"Physical\"\n    assert inst.docStatus == \"preliminary\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert (\n        inst.masterIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.masterIdentifier.value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relatesTo[0].code == \"appends\"\n    assert inst.relatesTo[0].target.reference == \"DocumentReference/example\"\n    assert inst.securityLabel[0].coding[0].code == \"V\"\n    assert inst.securityLabel[0].coding[0].display == \"very restricted\"\n    assert (\n        inst.securityLabel[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.status == \"current\"\n    assert inst.subject.reference == \"Patient/xcda\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"34108-1\"\n    assert inst.type.coding[0].display == \"Outpatient Note\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_documentreference_1(base_settings):\n    \"\"\"No. 1 tests collection for DocumentReference.\n    Test File: documentreference-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"documentreference-example.json\"\n    inst = documentreference.DocumentReference.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DocumentReference\" == inst.get_resource_type()\n\n    impl_documentreference_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentReference\" == data[\"resourceType\"]\n\n    inst2 = documentreference.DocumentReference(**data)\n    impl_documentreference_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_encounter.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Encounter\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import encounter\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_encounter_1(inst):\n    assert inst.class_fhir.code == \"HH\"\n    assert inst.class_fhir.display == \"home health\"\n    assert (\n        inst.class_fhir.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"home\"\n    assert inst.id == \"home\"\n    assert inst.location[0].location.display == \"Client's home\"\n    assert inst.location[0].location.reference == \"#home\"\n    assert (\n        inst.location[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17T16:30:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.location[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17T16:00:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.location[0].status == \"completed\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].individual.display == \"Dr Adam Careful\"\n    assert inst.participant[0].individual.reference == \"Practitioner/example\"\n    assert (\n        inst.participant[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17T16:30:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.participant[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17T16:00:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17T16:30:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17T16:00:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"finished\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Encounter with '\n        \"patient @example who is at home</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_encounter_1(base_settings):\n    \"\"\"No. 1 tests collection for Encounter.\n    Test File: encounter-example-home.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"encounter-example-home.json\"\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_1(inst2)\n\n\ndef impl_encounter_2(inst):\n    assert inst.class_fhir.code == \"AMB\"\n    assert inst.class_fhir.display == \"ambulatory\"\n    assert (\n        inst.class_fhir.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.id == \"f201\"\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"Encounter_Roel_20130404\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].individual.reference == \"Practitioner/f201\"\n    assert inst.priority.coding[0].code == \"17621005\"\n    assert inst.priority.coding[0].display == \"Normal\"\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reasonCode[0].text == (\n        \"The patient had fever peaks over the last couple of days. He\"\n        \" is worried about these peaks.\"\n    )\n    assert inst.serviceProvider.reference == \"Organization/f201\"\n    assert inst.status == \"finished\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"11429006\"\n    assert inst.type[0].coding[0].display == \"Consultation\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_encounter_2(base_settings):\n    \"\"\"No. 2 tests collection for Encounter.\n    Test File: encounter-example-f201-20130404.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"encounter-example-f201-20130404.json\"\n    )\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_2(inst2)\n\n\ndef impl_encounter_3(inst):\n    assert inst.class_fhir.code == \"AMB\"\n    assert inst.class_fhir.display == \"ambulatory\"\n    assert (\n        inst.class_fhir.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.hospitalization.admitSource.coding[0].code == \"305956004\"\n    assert inst.hospitalization.admitSource.coding[0].display == \"Referral by physician\"\n    assert (\n        inst.hospitalization.admitSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.hospitalization.dischargeDisposition.coding[0].code == \"306689006\"\n    assert (\n        inst.hospitalization.dischargeDisposition.coding[0].display\n        == \"Discharge to home\"\n    )\n    assert (\n        inst.hospitalization.dischargeDisposition.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.hospitalization.preAdmissionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/pre-admissions\"}\n        ).valueUri\n    )\n    assert inst.hospitalization.preAdmissionIdentifier.use == \"official\"\n    assert inst.hospitalization.preAdmissionIdentifier.value == \"93042\"\n    assert inst.id == \"f003\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/encounters\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"v6751\"\n    assert inst.length.code == \"min\"\n    assert (\n        inst.length.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.length.unit == \"min\"\n    assert float(inst.length.value) == float(90)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].individual.display == \"E.M. van den Broek\"\n    assert inst.participant[0].individual.reference == \"Practitioner/f001\"\n    assert inst.priority.coding[0].code == \"103391001\"\n    assert (\n        inst.priority.coding[0].display == \"Non-urgent ear, nose and throat admission\"\n    )\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reasonCode[0].coding[0].code == \"18099001\"\n    assert inst.reasonCode[0].coding[0].display == \"Retropharyngeal abscess\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.serviceProvider.reference == \"Organization/f001\"\n    assert inst.status == \"finished\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"270427003\"\n    assert inst.type[0].coding[0].display == \"Patient-initiated encounter\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_encounter_3(base_settings):\n    \"\"\"No. 3 tests collection for Encounter.\n    Test File: encounter-example-f003-abscess.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"encounter-example-f003-abscess.json\"\n    )\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_3(inst2)\n\n\ndef impl_encounter_4(inst):\n    assert inst.class_fhir.code == \"IMP\"\n    assert inst.class_fhir.display == \"inpatient encounter\"\n    assert (\n        inst.class_fhir.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"in-progress\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Encounter with '\n        \"patient @example</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_encounter_4(base_settings):\n    \"\"\"No. 4 tests collection for Encounter.\n    Test File: encounter-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"encounter-example.json\"\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_4(inst2)\n\n\ndef impl_encounter_5(inst):\n    assert inst.class_fhir.code == \"AMB\"\n    assert inst.class_fhir.display == \"ambulatory\"\n    assert (\n        inst.class_fhir.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.hospitalization.admitSource.coding[0].code == \"305997006\"\n    assert (\n        inst.hospitalization.admitSource.coding[0].display == \"Referral by radiologist\"\n    )\n    assert (\n        inst.hospitalization.admitSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.hospitalization.dischargeDisposition.coding[0].code == \"306689006\"\n    assert (\n        inst.hospitalization.dischargeDisposition.coding[0].display\n        == \"Discharge to home\"\n    )\n    assert (\n        inst.hospitalization.dischargeDisposition.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.hospitalization.preAdmissionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/pre-admissions\"}\n        ).valueUri\n    )\n    assert inst.hospitalization.preAdmissionIdentifier.use == \"official\"\n    assert inst.hospitalization.preAdmissionIdentifier.value == \"98682\"\n    assert inst.id == \"f002\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/encounters\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"v3251\"\n    assert inst.length.code == \"min\"\n    assert (\n        inst.length.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.length.unit == \"min\"\n    assert float(inst.length.value) == float(140)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].individual.display == \"M.I.M Versteegh\"\n    assert inst.participant[0].individual.reference == \"Practitioner/f003\"\n    assert inst.priority.coding[0].code == \"103391001\"\n    assert inst.priority.coding[0].display == \"Urgent\"\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reasonCode[0].coding[0].code == \"34068001\"\n    assert inst.reasonCode[0].coding[0].display == \"Partial lobectomy of lung\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.serviceProvider.display == \"BMC\"\n    assert inst.serviceProvider.reference == \"Organization/f001\"\n    assert inst.status == \"finished\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"270427003\"\n    assert inst.type[0].coding[0].display == \"Patient-initiated encounter\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_encounter_5(base_settings):\n    \"\"\"No. 5 tests collection for Encounter.\n    Test File: encounter-example-f002-lung.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"encounter-example-f002-lung.json\"\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_5(inst2)\n\n\ndef impl_encounter_6(inst):\n    assert inst.account[0].reference == \"Account/example\"\n    assert inst.appointment[0].reference == \"Appointment/example\"\n    assert inst.basedOn[0].reference == \"ServiceRequest/myringotomy\"\n    assert inst.class_fhir.code == \"IMP\"\n    assert inst.class_fhir.display == \"inpatient encounter\"\n    assert (\n        inst.class_fhir.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[0].condition.reference == \"Condition/stroke\"\n    assert inst.diagnosis[0].rank == 1\n    assert inst.diagnosis[0].use.coding[0].code == \"AD\"\n    assert inst.diagnosis[0].use.coding[0].display == \"Admission diagnosis\"\n    assert (\n        inst.diagnosis[0].use.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diagnosis-role\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[1].condition.reference == \"Condition/f201\"\n    assert inst.diagnosis[1].use.coding[0].code == \"DD\"\n    assert inst.diagnosis[1].use.coding[0].display == \"Discharge diagnosis\"\n    assert (\n        inst.diagnosis[1].use.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diagnosis-role\"}\n        ).valueUri\n    )\n    assert inst.episodeOfCare[0].reference == \"EpisodeOfCare/example\"\n    assert inst.hospitalization.admitSource.coding[0].code == \"309902002\"\n    assert (\n        inst.hospitalization.admitSource.coding[0].display\n        == \"Clinical Oncology Department\"\n    )\n    assert (\n        inst.hospitalization.admitSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.hospitalization.destination.reference == \"Location/2\"\n    assert inst.hospitalization.dietPreference[0].coding[0].code == \"276026009\"\n    assert (\n        inst.hospitalization.dietPreference[0].coding[0].display\n        == \"Fluid balance regulation\"\n    )\n    assert (\n        inst.hospitalization.dietPreference[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.hospitalization.origin.reference == \"Location/2\"\n    assert inst.hospitalization.reAdmission.coding[0].display == \"readmitted\"\n    assert inst.hospitalization.specialArrangement[0].coding[0].code == \"wheel\"\n    assert inst.hospitalization.specialArrangement[0].coding[0].display == \"Wheelchair\"\n    assert (\n        inst.hospitalization.specialArrangement[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/encounter-special-arrangements\"\n            }\n        ).valueUri\n    )\n    assert inst.hospitalization.specialCourtesy[0].coding[0].code == \"NRM\"\n    assert (\n        inst.hospitalization.specialCourtesy[0].coding[0].display == \"normal courtesy\"\n    )\n    assert (\n        inst.hospitalization.specialCourtesy[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-EncounterSpecialCourtesy\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"f203\"\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"Encounter_Roel_20130311\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.partOf.reference == \"Encounter/f203\"\n    assert inst.participant[0].individual.reference == \"Practitioner/f201\"\n    assert inst.participant[0].type[0].coding[0].code == \"PART\"\n    assert (\n        inst.participant[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-20\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-11\"}\n        ).valueDateTime\n    )\n    assert inst.priority.coding[0].code == \"394849002\"\n    assert inst.priority.coding[0].display == \"High priority\"\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reasonCode[0].text == (\n        \"The patient seems to suffer from bilateral pneumonia and \"\n        \"renal insufficiency, most likely due to chemotherapy.\"\n    )\n    assert inst.serviceProvider.reference == \"Organization/2\"\n    assert inst.status == \"finished\"\n    assert (\n        inst.statusHistory[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[0].status == \"arrived\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"183807002\"\n    assert inst.type[0].coding[0].display == \"Inpatient stay for nine days\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_encounter_6(base_settings):\n    \"\"\"No. 6 tests collection for Encounter.\n    Test File: encounter-example-f203-20130311.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"encounter-example-f203-20130311.json\"\n    )\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_6(inst2)\n\n\ndef impl_encounter_7(inst):\n    assert inst.class_fhir.code == \"AMB\"\n    assert inst.class_fhir.display == \"ambulatory\"\n    assert (\n        inst.class_fhir.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.id == \"xcda\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://healthcare.example.org/identifiers/enocunter\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"1234213.52345873\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].individual.reference == \"Practitioner/xcda1\"\n    assert inst.reasonCode[0].coding[0].code == \"T-D8200\"\n    assert inst.reasonCode[0].coding[0].display == \"Arm\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/xds/connectathon/eventCodes\"}\n        ).valueUri\n    )\n    assert inst.status == \"finished\"\n    assert inst.subject.reference == \"Patient/xcda\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_encounter_7(base_settings):\n    \"\"\"No. 7 tests collection for Encounter.\n    Test File: encounter-example-xcda.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"encounter-example-xcda.json\"\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_7(inst2)\n\n\ndef impl_encounter_8(inst):\n    assert inst.class_fhir.code == \"AMB\"\n    assert inst.class_fhir.display == \"ambulatory\"\n    assert (\n        inst.class_fhir.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[0].condition.display == (\n        \"Complications from Roel's TPF chemotherapy on January 28th, \" \"2013\"\n    )\n    assert inst.diagnosis[0].rank == 2\n    assert inst.diagnosis[0].use.coding[0].code == \"AD\"\n    assert inst.diagnosis[0].use.coding[0].display == \"Admission diagnosis\"\n    assert (\n        inst.diagnosis[0].use.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diagnosis-role\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[1].condition.display == \"The patient is treated for a tumor\"\n    assert inst.diagnosis[1].rank == 1\n    assert inst.diagnosis[1].use.coding[0].code == \"CC\"\n    assert inst.diagnosis[1].use.coding[0].display == \"Chief complaint\"\n    assert (\n        inst.diagnosis[1].use.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diagnosis-role\"}\n        ).valueUri\n    )\n    assert inst.id == \"f202\"\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"Encounter_Roel_20130128\"\n    assert inst.length.code == \"min\"\n    assert (\n        inst.length.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.length.unit == \"minutes\"\n    assert float(inst.length.value) == float(56)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].individual.reference == \"Practitioner/f201\"\n    assert inst.priority.coding[0].code == \"103391001\"\n    assert inst.priority.coding[0].display == \"Urgent\"\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reasonCode[0].text == \"The patient is treated for a tumor.\"\n    assert inst.serviceProvider.reference == \"Organization/f201\"\n    assert inst.status == \"finished\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"367336001\"\n    assert inst.type[0].coding[0].display == \"Chemotherapy\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_encounter_8(base_settings):\n    \"\"\"No. 8 tests collection for Encounter.\n    Test File: encounter-example-f202-20130128.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"encounter-example-f202-20130128.json\"\n    )\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_8(inst2)\n\n\ndef impl_encounter_9(inst):\n    assert inst.classHistory[0].class_fhir.code == \"EMER\"\n    assert inst.classHistory[0].class_fhir.display == \"emergency\"\n    assert (\n        inst.classHistory[0].class_fhir.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.classHistory[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T09:27:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.classHistory[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T07:15:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.classHistory[1].class_fhir.code == \"IMP\"\n    assert inst.classHistory[1].class_fhir.display == \"inpatient encounter\"\n    assert (\n        inst.classHistory[1].class_fhir.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.classHistory[1].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T09:27:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.class_fhir.code == \"IMP\"\n    assert inst.class_fhir.display == \"inpatient encounter\"\n    assert (\n        inst.class_fhir.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.hospitalization.admitSource.coding[0].code == \"emd\"\n    assert (\n        inst.hospitalization.admitSource.coding[0].display\n        == \"From accident/emergency department\"\n    )\n    assert (\n        inst.hospitalization.admitSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/admit-source\"}\n        ).valueUri\n    )\n    assert inst.id == \"emerg\"\n    assert inst.location[0].location.display == \"Emergency Waiting Room\"\n    assert (\n        inst.location[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T08:45:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.location[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T07:15:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.location[0].status == \"active\"\n    assert inst.location[1].location.display == \"Emergency\"\n    assert (\n        inst.location[1].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T09:27:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.location[1].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T08:45:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.location[1].status == \"active\"\n    assert inst.location[2].location.display == \"Ward 1, Room 42, Bed 1\"\n    assert (\n        inst.location[2].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T12:15:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.location[2].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T09:27:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.location[2].status == \"active\"\n    assert inst.location[3].location.display == \"Ward 1, Room 42, Bed 1\"\n    assert (\n        inst.location[3].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T12:45:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.location[3].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T12:15:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.location[3].status == \"reserved\"\n    assert inst.location[4].location.display == \"Ward 1, Room 42, Bed 1\"\n    assert (\n        inst.location[4].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T12:45:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.location[4].status == \"active\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T07:15:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"in-progress\"\n    assert (\n        inst.statusHistory[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T07:35:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.statusHistory[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T07:15:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[0].status == \"arrived\"\n    assert (\n        inst.statusHistory[1].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T08:45:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.statusHistory[1].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T07:35:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[1].status == \"triaged\"\n    assert (\n        inst.statusHistory[2].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T12:15:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.statusHistory[2].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T08:45:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[2].status == \"in-progress\"\n    assert (\n        inst.statusHistory[3].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T12:45:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.statusHistory[3].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T12:15:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[3].status == \"onleave\"\n    assert (\n        inst.statusHistory[4].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T12:45:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[4].status == \"in-progress\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Emergency visit '\n        \"that escalated into inpatient patient @example</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_encounter_9(base_settings):\n    \"\"\"No. 9 tests collection for Encounter.\n    Test File: encounter-example-emerg.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"encounter-example-emerg.json\"\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_9(inst2)\n\n\ndef impl_encounter_10(inst):\n    assert inst.class_fhir.code == \"AMB\"\n    assert inst.class_fhir.display == \"ambulatory\"\n    assert (\n        inst.class_fhir.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.hospitalization.admitSource.coding[0].code == \"305956004\"\n    assert inst.hospitalization.admitSource.coding[0].display == \"Referral by physician\"\n    assert (\n        inst.hospitalization.admitSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.hospitalization.dischargeDisposition.coding[0].code == \"306689006\"\n    assert (\n        inst.hospitalization.dischargeDisposition.coding[0].display\n        == \"Discharge to home\"\n    )\n    assert (\n        inst.hospitalization.dischargeDisposition.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.hospitalization.preAdmissionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.amc.nl/zorgportal/identifiers/pre-admissions\"}\n        ).valueUri\n    )\n    assert inst.hospitalization.preAdmissionIdentifier.use == \"official\"\n    assert inst.hospitalization.preAdmissionIdentifier.value == \"93042\"\n    assert inst.id == \"f001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.amc.nl/zorgportal/identifiers/visits\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"v1451\"\n    assert inst.length.code == \"min\"\n    assert (\n        inst.length.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.length.unit == \"min\"\n    assert float(inst.length.value) == float(140)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].individual.display == \"P. Voigt\"\n    assert inst.participant[0].individual.reference == \"Practitioner/f002\"\n    assert inst.priority.coding[0].code == \"310361003\"\n    assert inst.priority.coding[0].display == \"Non-urgent cardiological admission\"\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reasonCode[0].coding[0].code == \"34068001\"\n    assert inst.reasonCode[0].coding[0].display == \"Heart valve replacement\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.serviceProvider.display == \"Burgers University Medical Center\"\n    assert inst.serviceProvider.reference == \"Organization/f001\"\n    assert inst.status == \"finished\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"270427003\"\n    assert inst.type[0].coding[0].display == \"Patient-initiated encounter\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_encounter_10(base_settings):\n    \"\"\"No. 10 tests collection for Encounter.\n    Test File: encounter-example-f001-heart.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"encounter-example-f001-heart.json\"\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_endpoint.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Endpoint\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import endpoint\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_endpoint_1(inst):\n    assert (\n        inst.address\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://pacs.hospital.org/IHEInvokeImageDisplay\"}\n        ).valueUrl\n    )\n    assert inst.connectionType.code == \"ihe-iid\"\n    assert (\n        inst.connectionType.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/endpoint-connection-type\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"example-iid\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"PACS Hospital Invoke Image Display endpoint\"\n    assert inst.payloadType[0].text == \"DICOM IID\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_endpoint_1(base_settings):\n    \"\"\"No. 1 tests collection for Endpoint.\n    Test File: endpoint-example-iid.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"endpoint-example-iid.json\"\n    inst = endpoint.Endpoint.model_validate_json(filename.read_bytes())\n    assert \"Endpoint\" == inst.get_resource_type()\n\n    impl_endpoint_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Endpoint\" == data[\"resourceType\"]\n\n    inst2 = endpoint.Endpoint(**data)\n    impl_endpoint_1(inst2)\n\n\ndef impl_endpoint_2(inst):\n    assert (\n        inst.address\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"mailto:MARTIN.SMIETANKA@directnppes.com\"}\n        ).valueUrl\n    )\n    assert inst.connectionType.code == \"direct-project\"\n    assert inst.id == \"direct-endpoint\"\n    assert inst.managingOrganization.reference == \"Organization/299\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"MARTIN SMIETANKA\"\n    assert (\n        inst.payloadType[0].coding[0].code == \"urn:hl7-org:sdwg:ccda-structuredBody:1.1\"\n    )\n    assert (\n        inst.payloadType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.3.6.1.4.1.19376.1.2.3\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_endpoint_2(base_settings):\n    \"\"\"No. 2 tests collection for Endpoint.\n    Test File: endpoint-example-direct.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"endpoint-example-direct.json\"\n    inst = endpoint.Endpoint.model_validate_json(filename.read_bytes())\n    assert \"Endpoint\" == inst.get_resource_type()\n\n    impl_endpoint_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Endpoint\" == data[\"resourceType\"]\n\n    inst2 = endpoint.Endpoint(**data)\n    impl_endpoint_2(inst2)\n\n\ndef impl_endpoint_3(inst):\n    assert (\n        inst.address\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://pacs.hospital.org/wado-rs\"}\n        ).valueUrl\n    )\n    assert inst.connectionType.code == \"dicom-wado-rs\"\n    assert (\n        inst.connectionType.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/endpoint-connection-type\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"example-wadors\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"PACS Hospital DICOM WADO-RS endpoint\"\n    assert inst.payloadMimeType[0] == \"application/dicom\"\n    assert inst.payloadType[0].text == \"DICOM WADO-RS\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_endpoint_3(base_settings):\n    \"\"\"No. 3 tests collection for Endpoint.\n    Test File: endpoint-example-wadors.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"endpoint-example-wadors.json\"\n    inst = endpoint.Endpoint.model_validate_json(filename.read_bytes())\n    assert \"Endpoint\" == inst.get_resource_type()\n\n    impl_endpoint_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Endpoint\" == data[\"resourceType\"]\n\n    inst2 = endpoint.Endpoint(**data)\n    impl_endpoint_3(inst2)\n\n\ndef impl_endpoint_4(inst):\n    assert (\n        inst.address\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://fhir3.healthintersections.com.au/open/CarePlan\"}\n        ).valueUrl\n    )\n    assert inst.connectionType.code == \"hl7-fhir-rest\"\n    assert (\n        inst.connectionType.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/endpoint-connection-type\"\n            }\n        ).valueUri\n    )\n    assert inst.contact[0].system == \"email\"\n    assert inst.contact[0].use == \"work\"\n    assert inst.contact[0].value == \"endpointmanager@example.org\"\n    assert inst.header[0] == \"bearer-code BASGS534s4\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/enpoint-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"epcp12\"\n    assert inst.managingOrganization.reference == \"Organization/hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Health Intersections CarePlan Hub\"\n    assert inst.payloadMimeType[0] == \"application/fhir+xml\"\n    assert inst.payloadType[0].coding[0].code == \"CarePlan\"\n    assert (\n        inst.payloadType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_endpoint_4(base_settings):\n    \"\"\"No. 4 tests collection for Endpoint.\n    Test File: endpoint-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"endpoint-example.json\"\n    inst = endpoint.Endpoint.model_validate_json(filename.read_bytes())\n    assert \"Endpoint\" == inst.get_resource_type()\n\n    impl_endpoint_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Endpoint\" == data[\"resourceType\"]\n\n    inst2 = endpoint.Endpoint(**data)\n    impl_endpoint_4(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_enrollmentrequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EnrollmentRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import enrollmentrequest\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_enrollmentrequest_1(inst):\n    assert inst.candidate.reference == \"Patient/1\"\n    assert inst.coverage.reference == \"Coverage/9876B1\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"22345\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/enrollmentrequest\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"EN22345\"\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the EnrollmentRequest.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_enrollmentrequest_1(base_settings):\n    \"\"\"No. 1 tests collection for EnrollmentRequest.\n    Test File: enrollmentrequest-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"enrollmentrequest-example.json\"\n    inst = enrollmentrequest.EnrollmentRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"EnrollmentRequest\" == inst.get_resource_type()\n\n    impl_enrollmentrequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EnrollmentRequest\" == data[\"resourceType\"]\n\n    inst2 = enrollmentrequest.EnrollmentRequest(**data)\n    impl_enrollmentrequest_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_enrollmentresponse.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EnrollmentResponse\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import enrollmentresponse\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_enrollmentresponse_1(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Dependant added to policy.\"\n    assert inst.id == \"ER2500\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/enrollmentresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"781234\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization.reference == \"Organization/2\"\n    assert inst.outcome == \"complete\"\n    assert (\n        inst.request.reference\n        == \"http://www.BenefitsInc.com/fhir/eligibility/225476332402\"\n    )\n    assert inst.requestProvider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the EnrollmentResponse</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_enrollmentresponse_1(base_settings):\n    \"\"\"No. 1 tests collection for EnrollmentResponse.\n    Test File: enrollmentresponse-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"enrollmentresponse-example.json\"\n    inst = enrollmentresponse.EnrollmentResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"EnrollmentResponse\" == inst.get_resource_type()\n\n    impl_enrollmentresponse_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EnrollmentResponse\" == data[\"resourceType\"]\n\n    inst2 = enrollmentresponse.EnrollmentResponse(**data)\n    impl_enrollmentresponse_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_episodeofcare.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EpisodeOfCare\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import episodeofcare\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_episodeofcare_1(inst):\n    assert inst.account[0].display == \"example account\"\n    assert inst.account[0].reference == \"Account/example\"\n    assert inst.careManager.display == \"Amanda Assigned\"\n    assert inst.careManager.reference == \"Practitioner/14\"\n    assert inst.diagnosis[0].condition.reference == \"Condition/stroke\"\n    assert inst.diagnosis[0].rank == 1\n    assert inst.diagnosis[0].role.coding[0].code == \"CC\"\n    assert inst.diagnosis[0].role.coding[0].display == \"Chief complaint\"\n    assert (\n        inst.diagnosis[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diagnosis-role\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/sampleepisodeofcare-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.managingOrganization.reference == \"Organization/hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-01\"}\n        ).valueDateTime\n    )\n    assert inst.referralRequest[0].display == \"Referral from Example Aged Care Services\"\n    assert inst.status == \"active\"\n    assert (\n        inst.statusHistory[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-14\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.statusHistory[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-01\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[0].status == \"planned\"\n    assert (\n        inst.statusHistory[1].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-21\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.statusHistory[1].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-15\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[1].status == \"active\"\n    assert (\n        inst.statusHistory[2].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-24\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.statusHistory[2].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-22\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[2].status == \"onhold\"\n    assert (\n        inst.statusHistory[3].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-25\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[3].status == \"active\"\n    assert inst.team[0].display == \"example care team\"\n    assert inst.team[0].reference == \"CareTeam/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"hacc\"\n    assert inst.type[0].coding[0].display == \"Home and Community Care\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/episodeofcare-type\"}\n        ).valueUri\n    )\n\n\ndef test_episodeofcare_1(base_settings):\n    \"\"\"No. 1 tests collection for EpisodeOfCare.\n    Test File: episodeofcare-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"episodeofcare-example.json\"\n    inst = episodeofcare.EpisodeOfCare.model_validate_json(filename.read_bytes())\n    assert \"EpisodeOfCare\" == inst.get_resource_type()\n\n    impl_episodeofcare_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EpisodeOfCare\" == data[\"resourceType\"]\n\n    inst2 = episodeofcare.EpisodeOfCare(**data)\n    impl_episodeofcare_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_eventdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EventDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import eventdefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_eventdefinition_1(inst):\n    assert inst.experimental is True\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.purpose == \"Monitor all admissions to Emergency\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.trigger[0].condition.description == (\n        \"Encounter Location = emergency (active/completed encounters,\"\n        \" current or previous)\"\n    )\n    assert inst.trigger[0].condition.expression == (\n        \"(this | %previous).location.where(location = \"\n        \"'Location/emergency' and status in {'active', \"\n        \"'completed'}).exists()\"\n    )\n    assert inst.trigger[0].condition.language == \"text/fhirpath\"\n    assert inst.trigger[0].data[0].type == \"Encounter\"\n    assert inst.trigger[0].name == \"monitor-emergency-admissions\"\n    assert inst.trigger[0].type == \"named-event\"\n\n\ndef test_eventdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for EventDefinition.\n    Test File: eventdefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"eventdefinition-example.json\"\n    inst = eventdefinition.EventDefinition.model_validate_json(filename.read_bytes())\n    assert \"EventDefinition\" == inst.get_resource_type()\n\n    impl_eventdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EventDefinition\" == data[\"resourceType\"]\n\n    inst2 = eventdefinition.EventDefinition(**data)\n    impl_eventdefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_evidence.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Evidence\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import evidence\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_evidence_1(inst):\n    assert inst.description == (\n        \"0.4% incidence of fatal intracranial hemorrhage within 7 \"\n        \"days without alteplase in patients with acute ischemic \"\n        \"stroke\"\n    )\n    assert inst.id == \"example-stroke-no-alteplase-fatalICH\"\n    assert inst.relatedArtifact[0].label == \"Emberson 2014\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1016/S0140-6736(14)60584-5\"}\n        ).valueUrl\n    )\n    assert inst.statistic[0].numberOfEvents == 13\n    assert float(inst.statistic[0].quantity.value) == float(0.00386298627)\n    assert inst.statistic[0].sampleSize.numberOfParticipants == 3365\n    assert inst.statistic[0].sampleSize.numberOfStudies == 9\n    assert inst.statistic[0].statisticType.coding[0].code == \"C44256\"\n    assert inst.statistic[0].statisticType.coding[0].display == \"Proportion\"\n    assert (\n        inst.statistic[0].statisticType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/statistic-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.studyType.coding[0].code == \"RCT\"\n    assert inst.studyType.coding[0].display == \"randomized trial\"\n    assert (\n        inst.studyType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/study-type\"}\n        ).valueUri\n    )\n    assert inst.synthesisType.coding[0].code == \"IPD-MA\"\n    assert (\n        inst.synthesisType.coding[0].display == \"individual patient data meta-analysis\"\n    )\n    assert (\n        inst.synthesisType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/synthesis-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Risk of fatal ICH without alteplase for stroke\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/Evidence/example-stroke-no-alteplase-fatalICH\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n    assert inst.useContext[1].code.code == \"1386000\"\n    assert inst.useContext[1].code.display == \"Intracranial hemorrhage\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueRange.high.unit == \"d\"\n    assert float(inst.useContext[1].valueRange.high.value) == float(7)\n    assert inst.useContext[1].valueRange.low.unit == \"d\"\n    assert float(inst.useContext[1].valueRange.low.value) == float(0)\n    assert (\n        inst.variableDefinition[0].intended.display\n        == \"adults with acute ischemic stroke\"\n    )\n    assert inst.variableDefinition[0].intended.reference == \"Group/AcuteIschemicStroke\"\n    assert (\n        inst.variableDefinition[0].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.variableDefinition[0].observed.display\n        == \"adults with acute ischemic stroke\"\n    )\n    assert inst.variableDefinition[0].observed.reference == \"Group/AcuteIschemicStroke\"\n    assert (\n        inst.variableDefinition[0].observed.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.variableDefinition[0].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[0].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[0].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].intended.display\n        == \"adults with acute ischemic stroke treated without alteplase\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.reference\n        == \"Group/AcuteIschemicStrokeTreatedWithoutAlteplase\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].observed.display\n        == \"Emberson 2014 IPD-MA No Alteplase Cohort\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.reference\n        == \"Group/Emberson-2014-IPD-MA-No-Alteplase-Cohort\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.variableDefinition[1].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[1].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].intended.display == \"fatal ICH\"\n    assert (\n        inst.variableDefinition[2].intended.reference\n        == \"EvidenceVariable/example-fatal-ICH-in-7-days\"\n    )\n    assert (\n        inst.variableDefinition[2].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].observed.display == \"fatal ICH\"\n    assert (\n        inst.variableDefinition[2].observed.reference\n        == \"EvidenceVariable/example-fatal-ICH-in-7-days\"\n    )\n    assert (\n        inst.variableDefinition[2].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].variableRole.coding[0].code == \"measuredVariable\"\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].display == \"measured variable\"\n    )\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n\n\ndef test_evidence_1(base_settings):\n    \"\"\"No. 1 tests collection for Evidence.\n    Test File: evidence-example-stroke-no-alteplase-fatalICH.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidence-example-stroke-no-alteplase-fatalICH.json\"\n    )\n    inst = evidence.Evidence.model_validate_json(filename.read_bytes())\n    assert \"Evidence\" == inst.get_resource_type()\n\n    impl_evidence_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Evidence\" == data[\"resourceType\"]\n\n    inst2 = evidence.Evidence(**data)\n    impl_evidence_1(inst2)\n\n\ndef impl_evidence_2(inst):\n    assert inst.certainty[0].description == (\n        \"Very low certainty due to risk of bias, inconsistency, \"\n        \"imprecision, and indirectness\"\n    )\n    assert inst.certainty[0].rating.coding[0].code == \"very-low\"\n    assert inst.certainty[0].rating.coding[0].display == \"Very low quality\"\n    assert (\n        inst.certainty[0].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[0].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[0].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[0].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[0].type.coding[0].code == \"PublicationBias\"\n    assert (\n        inst.certainty[0].subcomponent[0].type.coding[0].display == \"Publication bias\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[1].note[0].text == (\n        \"IST-3 had inconsistent results and contributed large \" \"proportion of data\"\n    )\n    assert inst.certainty[0].subcomponent[1].rating.coding[0].code == \"serious-concern\"\n    assert (\n        inst.certainty[0].subcomponent[1].rating.coding[0].display == \"serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[1].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[1].type.coding[0].code == \"Inconsistency\"\n    assert inst.certainty[0].subcomponent[1].type.coding[0].display == \"Inconsistency\"\n    assert (\n        inst.certainty[0].subcomponent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[2].rating.coding[0].code == \"serious-concern\"\n    assert (\n        inst.certainty[0].subcomponent[2].rating.coding[0].display == \"serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[2].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[2].type.coding[0].code == \"Imprecision\"\n    assert inst.certainty[0].subcomponent[2].type.coding[0].display == \"Imprecision\"\n    assert (\n        inst.certainty[0].subcomponent[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[3].note[0].text == (\n        \"resuts derived for 3 - 4.5 hours assume data from 0 - 6 \"\n        \"hours is informative\"\n    )\n    assert inst.certainty[0].subcomponent[3].rating.coding[0].code == \"serious-concern\"\n    assert (\n        inst.certainty[0].subcomponent[3].rating.coding[0].display == \"serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[3].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[3].type.coding[0].code == \"Indirectness\"\n    assert inst.certainty[0].subcomponent[3].type.coding[0].display == \"Indirectness\"\n    assert (\n        inst.certainty[0].subcomponent[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[4].note[0].text == (\n        \"results largely influenced by IST-3 trial which was \"\n        \"unblinded and ECASS III which had baseline imbalances\"\n    )\n    assert inst.certainty[0].subcomponent[4].rating.coding[0].code == \"serious-concern\"\n    assert (\n        inst.certainty[0].subcomponent[4].rating.coding[0].display == \"serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[4].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[4].type.coding[0].code == \"RiskOfBias\"\n    assert inst.certainty[0].subcomponent[4].type.coding[0].display == \"Risk of bias\"\n    assert (\n        inst.certainty[0].subcomponent[4].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].type.coding[0].code == \"Overall\"\n    assert inst.certainty[0].type.coding[0].display == \"Overall quality\"\n    assert (\n        inst.certainty[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.description == (\n        \"mRS 0-2 at 90 days Odds Ratio 1.2 for Alteplase vs. No \"\n        \"Alteplase in patients with acute ischemic stroke 3-4.5 hours\"\n        \" prior\"\n    )\n    assert inst.id == \"example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2\"\n    assert inst.relatedArtifact[0].display == \"Figure 2 Lees 2016\"\n    assert inst.relatedArtifact[0].label == \"Lees 2016\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1161/STROKEAHA.116.013644\"}\n        ).valueUrl\n    )\n    assert inst.statistic[0].attributeEstimate[0].description == \"95% CI 1.06 to 1.3\"\n    assert float(inst.statistic[0].attributeEstimate[0].level) == float(0.95)\n    assert float(inst.statistic[0].attributeEstimate[0].range.high.value) == float(1.3)\n    assert float(inst.statistic[0].attributeEstimate[0].range.low.value) == float(1.06)\n    assert inst.statistic[0].attributeEstimate[0].type.coding[0].code == \"C53324\"\n    assert (\n        inst.statistic[0].attributeEstimate[0].type.coding[0].display\n        == \"Confidence interval\"\n    )\n    assert (\n        inst.statistic[0].attributeEstimate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/attribute-estimate-type\"\n            }\n        ).valueUri\n    )\n    assert float(inst.statistic[0].quantity.value) == float(1.2)\n    assert inst.statistic[0].sampleSize.numberOfStudies == 9\n    assert inst.statistic[0].statisticType.coding[0].code == \"C16932\"\n    assert inst.statistic[0].statisticType.coding[0].display == \"Odds Ratio\"\n    assert (\n        inst.statistic[0].statisticType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/statistic-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.studyType.coding[0].code == \"RCT\"\n    assert inst.studyType.coding[0].display == \"randomized trial\"\n    assert (\n        inst.studyType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/study-type\"}\n        ).valueUri\n    )\n    assert inst.synthesisType.coding[0].code == \"IPD-MA\"\n    assert (\n        inst.synthesisType.coding[0].display == \"individual patient data meta-analysis\"\n    )\n    assert (\n        inst.synthesisType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/synthesis-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == (\n        \"Effect of Alteplase vs No alteplase on mRS 0-2 at 90 days in\"\n        \" Stroke 3-4.5 hours prior\"\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/Evidence/example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n    assert inst.variableDefinition[0].directnessMatch.coding[0].code == \"moderate\"\n    assert (\n        inst.variableDefinition[0].directnessMatch.coding[0].display\n        == \"Moderate quality match\"\n    )\n    assert (\n        inst.variableDefinition[0].directnessMatch.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/directness\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[0].intended.display == \"stroke at 3-4.5 hours\"\n    assert (\n        inst.variableDefinition[0].intended.reference\n        == \"Group/AcuteIschemicStroke3-4halfHours\"\n    )\n    assert (\n        inst.variableDefinition[0].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.variableDefinition[0].observed.display\n        == \"Stroke Thrombolysis Trialists’ 2014-2016 IPD-MA Cohort\"\n    )\n    assert inst.variableDefinition[0].observed.reference == (\n        \"EvidenceVariable/Stroke-Thrombolysis-\" \"Trialists-2014-2016-IPD-MA-Cohort\"\n    )\n    assert (\n        inst.variableDefinition[0].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[0].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[0].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[0].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].intended.display\n        == \"Alive and not functionally dependent at 90 days\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.reference\n        == \"EvidenceVariable/example-alive-independent-90day\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[1].observed.display == \"mRS 0-2 at 90 days\"\n    assert (\n        inst.variableDefinition[1].observed.reference\n        == \"EvidenceVariable/example-mRS0-2-at-90days\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[1].variableRole.coding[0].code == \"measuredVariable\"\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].display == \"measured variable\"\n    )\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].intended.display == \"Alteplase for Stroke\"\n    assert (\n        inst.variableDefinition[2].intended.reference\n        == \"EvidenceVariable/example-alteplase-for-stroke\"\n    )\n    assert (\n        inst.variableDefinition[2].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].observed.display == \"Alteplase for Stroke\"\n    assert (\n        inst.variableDefinition[2].observed.reference\n        == \"EvidenceVariable/example-alteplase-for-stroke\"\n    )\n    assert (\n        inst.variableDefinition[2].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].variableRole.coding[0].code == \"exposure\"\n    assert inst.variableDefinition[2].variableRole.coding[0].display == \"exposure\"\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[3].intended.display == \"no alteplase\"\n    assert (\n        inst.variableDefinition[3].intended.reference\n        == \"EvidenceVariable/example-no-alteplase\"\n    )\n    assert (\n        inst.variableDefinition[3].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[3].observed.display == \"no alteplase\"\n    assert (\n        inst.variableDefinition[3].observed.reference\n        == \"EvidenceVariable/example-no-alteplase\"\n    )\n    assert (\n        inst.variableDefinition[3].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[3].variableRole.coding[0].code == \"referenceExposure\"\n    assert (\n        inst.variableDefinition[3].variableRole.coding[0].display\n        == \"reference exposure\"\n    )\n    assert (\n        inst.variableDefinition[3].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n\n\ndef test_evidence_2(base_settings):\n    \"\"\"No. 2 tests collection for Evidence.\n    Test File: evidence-example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidence-example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2.json\"\n    )\n    inst = evidence.Evidence.model_validate_json(filename.read_bytes())\n    assert \"Evidence\" == inst.get_resource_type()\n\n    impl_evidence_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Evidence\" == data[\"resourceType\"]\n\n    inst2 = evidence.Evidence(**data)\n    impl_evidence_2(inst2)\n\n\ndef impl_evidence_3(inst):\n    assert inst.certainty[0].description == \"Moderate certainty due to risk of bias\"\n    assert inst.certainty[0].rating.coding[0].code == \"moderate\"\n    assert inst.certainty[0].rating.coding[0].display == \"Moderate\"\n    assert (\n        inst.certainty[0].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[0].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[0].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[0].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[0].type.coding[0].code == \"PublicationBias\"\n    assert (\n        inst.certainty[0].subcomponent[0].type.coding[0].display == \"Publication bias\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[1].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[1].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[1].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[1].type.coding[0].code == \"Inconsistency\"\n    assert inst.certainty[0].subcomponent[1].type.coding[0].display == \"Inconsistency\"\n    assert (\n        inst.certainty[0].subcomponent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[2].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[2].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[2].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[2].type.coding[0].code == \"Imprecision\"\n    assert inst.certainty[0].subcomponent[2].type.coding[0].display == \"Imprecision\"\n    assert (\n        inst.certainty[0].subcomponent[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[3].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[3].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[3].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[3].type.coding[0].code == \"Indirectness\"\n    assert inst.certainty[0].subcomponent[3].type.coding[0].display == \"Indirectness\"\n    assert (\n        inst.certainty[0].subcomponent[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[4].note[0].text == (\n        \"results largely influenced by IST-3 trial which was \"\n        \"unblinded and NINDS trial which had allocation concealment \"\n        \"not stated and baseline imbalances\"\n    )\n    assert inst.certainty[0].subcomponent[4].rating.coding[0].code == \"serious-concern\"\n    assert (\n        inst.certainty[0].subcomponent[4].rating.coding[0].display == \"serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[4].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[4].type.coding[0].code == \"RiskOfBias\"\n    assert inst.certainty[0].subcomponent[4].type.coding[0].display == \"Risk of bias\"\n    assert (\n        inst.certainty[0].subcomponent[4].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].type.coding[0].code == \"Overall\"\n    assert inst.certainty[0].type.coding[0].display == \"Overall quality\"\n    assert (\n        inst.certainty[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.description == (\n        \"mRS 3-6 at 90 days Odds Ratio 0.65 for Alteplase vs. No \"\n        \"Alteplase in patients with acute ischemic stroke 0-3 hours \"\n        \"prior\"\n    )\n    assert inst.id == \"example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6\"\n    assert inst.relatedArtifact[0].citation == (\n        \"Wardlaw JM, Murray V, Berge E, del Zoppo GJ. Thrombolysis \"\n        \"for acute ischaemic stroke. Cochrane Database Syst Rev. 2014\"\n        \" Jul 29(7):CD000213. PMID 25072528\"\n    )\n    assert inst.relatedArtifact[0].display == \"Analysis 1.16 from Wardlaw 2014\"\n    assert inst.relatedArtifact[0].label == \"Wardlaw 2014\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1002/14651858.CD000213.pub3\"}\n        ).valueUrl\n    )\n    assert inst.statistic[0].attributeEstimate[0].description == \"95% CI 0.54 to 0.80\"\n    assert float(inst.statistic[0].attributeEstimate[0].level) == float(0.95)\n    assert float(inst.statistic[0].attributeEstimate[0].range.high.value) == float(0.8)\n    assert float(inst.statistic[0].attributeEstimate[0].range.low.value) == float(0.54)\n    assert inst.statistic[0].attributeEstimate[0].type.coding[0].code == \"C53324\"\n    assert (\n        inst.statistic[0].attributeEstimate[0].type.coding[0].display\n        == \"Confidence interval\"\n    )\n    assert (\n        inst.statistic[0].attributeEstimate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/attribute-estimate-type\"\n            }\n        ).valueUri\n    )\n    assert inst.statistic[0].attributeEstimate[1].description == \"P-value = 0.000023\"\n    assert float(inst.statistic[0].attributeEstimate[1].quantity.value) == float(\n        2.3e-05\n    )\n    assert inst.statistic[0].attributeEstimate[1].type.coding[0].code == \"C44185\"\n    assert inst.statistic[0].attributeEstimate[1].type.coding[0].display == \"P-value\"\n    assert (\n        inst.statistic[0].attributeEstimate[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/attribute-estimate-type\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.statistic[0].attributeEstimate[2].description\n        == \"Heterogeneity I-sq = 0.0%\"\n    )\n    assert inst.statistic[0].attributeEstimate[2].quantity.code == \"%\"\n    assert (\n        inst.statistic[0].attributeEstimate[2].quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.statistic[0].attributeEstimate[2].quantity.unit == \"%\"\n    assert float(inst.statistic[0].attributeEstimate[2].quantity.value) == float(0)\n    assert inst.statistic[0].attributeEstimate[2].type.coding[0].code == \"0000420\"\n    assert inst.statistic[0].attributeEstimate[2].type.coding[0].display == \"I-squared\"\n    assert (\n        inst.statistic[0].attributeEstimate[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/attribute-estimate-type\"\n            }\n        ).valueUri\n    )\n    assert inst.statistic[0].numberOfEvents == 1137\n    assert float(inst.statistic[0].quantity.value) == float(0.65)\n    assert inst.statistic[0].sampleSize.numberOfParticipants == 1779\n    assert inst.statistic[0].sampleSize.numberOfStudies == 6\n    assert inst.statistic[0].statisticType.coding[0].code == \"C16932\"\n    assert inst.statistic[0].statisticType.coding[0].display == \"Odds Ratio\"\n    assert (\n        inst.statistic[0].statisticType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/statistic-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.studyType.coding[0].code == \"RCT\"\n    assert inst.studyType.coding[0].display == \"randomized trial\"\n    assert (\n        inst.studyType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/study-type\"}\n        ).valueUri\n    )\n    assert inst.synthesisType.coding[0].code == \"std-MA\"\n    assert inst.synthesisType.coding[0].display == \"summary data meta-analysis\"\n    assert (\n        inst.synthesisType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/synthesis-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == (\n        \"Effect of Alteplase vs No alteplase on mRS 3-6 at 90 days in\"\n        \" Stroke 0-3 hours prior\"\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/Evidence/example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n    assert inst.variableDefinition[0].intended.display == \"stroke at 0-3 hours\"\n    assert (\n        inst.variableDefinition[0].intended.reference\n        == \"Group/AcuteIschemicStroke0-3Hours\"\n    )\n    assert (\n        inst.variableDefinition[0].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.variableDefinition[0].observed.display\n        == \"Wardlaw 2014 Analysis 1.16.3 Evidence set\"\n    )\n    assert (\n        inst.variableDefinition[0].observed.reference\n        == \"EvidenceVariable/Wardlaw2014Analysis1.16.3EvidenceSet\"\n    )\n    assert (\n        inst.variableDefinition[0].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[0].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[0].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[0].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].intended.display\n        == \"Dead or functionally dependent at 90 days\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.reference\n        == \"EvidenceVariable/example-dead-or-dependent-90day\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[1].observed.display == \"mRS 3-6 at 90 days\"\n    assert (\n        inst.variableDefinition[1].observed.reference\n        == \"EvidenceVariable/example-mRS3-6-at-90days\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[1].variableRole.coding[0].code == \"measuredVariable\"\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].display == \"measured variable\"\n    )\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].intended.display == \"Alteplase for Stroke\"\n    assert (\n        inst.variableDefinition[2].intended.reference\n        == \"EvidenceVariable/example-alteplase-for-stroke\"\n    )\n    assert (\n        inst.variableDefinition[2].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].observed.display == \"Alteplase for Stroke\"\n    assert (\n        inst.variableDefinition[2].observed.reference\n        == \"EvidenceVariable/example-alteplase-for-stroke\"\n    )\n    assert (\n        inst.variableDefinition[2].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].variableRole.coding[0].code == \"exposure\"\n    assert inst.variableDefinition[2].variableRole.coding[0].display == \"exposure\"\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[3].intended.display == \"no alteplase\"\n    assert (\n        inst.variableDefinition[3].intended.reference\n        == \"EvidenceVariable/example-no-alteplase\"\n    )\n    assert (\n        inst.variableDefinition[3].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[3].observed.display == \"no alteplase\"\n    assert (\n        inst.variableDefinition[3].observed.reference\n        == \"EvidenceVariable/example-no-alteplase\"\n    )\n    assert (\n        inst.variableDefinition[3].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[3].variableRole.coding[0].code == \"referenceExposure\"\n    assert (\n        inst.variableDefinition[3].variableRole.coding[0].display\n        == \"reference exposure\"\n    )\n    assert (\n        inst.variableDefinition[3].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n\n\ndef test_evidence_3(base_settings):\n    \"\"\"No. 3 tests collection for Evidence.\n    Test File: evidence-example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidence-example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6.json\"\n    )\n    inst = evidence.Evidence.model_validate_json(filename.read_bytes())\n    assert \"Evidence\" == inst.get_resource_type()\n\n    impl_evidence_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Evidence\" == data[\"resourceType\"]\n\n    inst2 = evidence.Evidence(**data)\n    impl_evidence_3(inst2)\n\n\ndef impl_evidence_4(inst):\n    assert inst.description == (\n        \"2.7% incidence of fatal intracranial hemorrhage within 7 \"\n        \"days with alteplase in patients with acute ischemic stroke\"\n    )\n    assert inst.id == \"example-stroke-alteplase-fatalICH\"\n    assert inst.relatedArtifact[0].label == \"Emberson 2014\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1016/S0140-6736(14)60584-5\"}\n        ).valueUrl\n    )\n    assert inst.statistic[0].numberOfEvents == 91\n    assert float(inst.statistic[0].quantity.value) == float(0.026835741669)\n    assert inst.statistic[0].sampleSize.numberOfParticipants == 3391\n    assert inst.statistic[0].sampleSize.numberOfStudies == 9\n    assert inst.statistic[0].statisticType.coding[0].code == \"C44256\"\n    assert inst.statistic[0].statisticType.coding[0].display == \"Proportion\"\n    assert (\n        inst.statistic[0].statisticType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/statistic-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.studyType.coding[0].code == \"RCT\"\n    assert inst.studyType.coding[0].display == \"randomized trial\"\n    assert (\n        inst.studyType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/study-type\"}\n        ).valueUri\n    )\n    assert inst.synthesisType.coding[0].code == \"IPD-MA\"\n    assert (\n        inst.synthesisType.coding[0].display == \"individual patient data meta-analysis\"\n    )\n    assert (\n        inst.synthesisType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/synthesis-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Risk of fatal ICH with alteplase for stroke\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/Evidence/example-stroke-alteplase-fatalICH\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n    assert inst.useContext[1].code.code == \"1386000\"\n    assert inst.useContext[1].code.display == \"Intracranial hemorrhage\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueRange.high.unit == \"d\"\n    assert float(inst.useContext[1].valueRange.high.value) == float(7)\n    assert inst.useContext[1].valueRange.low.unit == \"d\"\n    assert float(inst.useContext[1].valueRange.low.value) == float(0)\n    assert (\n        inst.variableDefinition[0].intended.display\n        == \"adults with acute ischemic stroke\"\n    )\n    assert inst.variableDefinition[0].intended.reference == \"Group/AcuteIschemicStroke\"\n    assert (\n        inst.variableDefinition[0].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.variableDefinition[0].observed.display\n        == \"adults with acute ischemic stroke\"\n    )\n    assert inst.variableDefinition[0].observed.reference == \"Group/AcuteIschemicStroke\"\n    assert (\n        inst.variableDefinition[0].observed.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.variableDefinition[0].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[0].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[0].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].intended.display\n        == \"adults with acute ischemic stroke treated with alteplase\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.reference\n        == \"Group/AcuteIschemicStrokeTreatedWithAlteplase\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].observed.display\n        == \"Emberson 2014 IPD-MA Alteplase Cohort\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.reference\n        == \"Group/Emberson-2014-IPD-MA-Alteplase-Cohort\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.variableDefinition[1].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[1].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].intended.display == \"fatal ICH\"\n    assert (\n        inst.variableDefinition[2].intended.reference\n        == \"EvidenceVariable/example-fatal-ICH-in-7-days\"\n    )\n    assert (\n        inst.variableDefinition[2].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].observed.display == \"fatal ICH\"\n    assert (\n        inst.variableDefinition[2].observed.reference\n        == \"EvidenceVariable/example-fatal-ICH-in-7-days\"\n    )\n    assert (\n        inst.variableDefinition[2].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].variableRole.coding[0].code == \"measuredVariable\"\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].display == \"measured variable\"\n    )\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n\n\ndef test_evidence_4(base_settings):\n    \"\"\"No. 4 tests collection for Evidence.\n    Test File: evidence-example-stroke-alteplase-fatalICH.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidence-example-stroke-alteplase-fatalICH.json\"\n    )\n    inst = evidence.Evidence.model_validate_json(filename.read_bytes())\n    assert \"Evidence\" == inst.get_resource_type()\n\n    impl_evidence_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Evidence\" == data[\"resourceType\"]\n\n    inst2 = evidence.Evidence(**data)\n    impl_evidence_4(inst2)\n\n\ndef impl_evidence_5(inst):\n    assert inst.certainty[0].rating.coding[0].code == \"high\"\n    assert inst.certainty[0].rating.coding[0].display == \"High quality\"\n    assert (\n        inst.certainty[0].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[0].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[0].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[0].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[0].type.coding[0].code == \"RiskOfBias\"\n    assert inst.certainty[0].subcomponent[0].type.coding[0].display == \"Risk of bias\"\n    assert (\n        inst.certainty[0].subcomponent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[1].description == (\n        \"Estimated risk from validation calibration plot consistent \"\n        \"with predicted risk; observed risk in subgroup with ASTRAL \"\n        \"score = 12 consistent with validation calibration plot\"\n    )\n    assert inst.certainty[0].subcomponent[1].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[1].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[1].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[1].type.coding[0].code == \"Inconsistency\"\n    assert inst.certainty[0].subcomponent[1].type.coding[0].display == \"Inconsistency\"\n    assert (\n        inst.certainty[0].subcomponent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[2].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[2].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[2].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[2].type.coding[0].code == \"Indirectness\"\n    assert inst.certainty[0].subcomponent[2].type.coding[0].display == \"Indirectness\"\n    assert (\n        inst.certainty[0].subcomponent[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[3].description == \"Narrow confidence interval\"\n    assert inst.certainty[0].subcomponent[3].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[3].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[3].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[3].type.coding[0].code == \"Imprecision\"\n    assert inst.certainty[0].subcomponent[3].type.coding[0].display == \"Imprecision\"\n    assert (\n        inst.certainty[0].subcomponent[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[4].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[4].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[4].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[4].type.coding[0].code == \"PublicationBias\"\n    assert (\n        inst.certainty[0].subcomponent[4].type.coding[0].display == \"Publication bias\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[4].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].type.coding[0].code == \"Overall\"\n    assert inst.certainty[0].type.coding[0].display == \"Overall quality\"\n    assert (\n        inst.certainty[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.description == \"5.3% risk of mRS 3-6 at 90 days\"\n    assert inst.id == \"example-ASTRAL-12-alteplase-mRS3-6\"\n    assert inst.relatedArtifact[0].display == (\n        \"External Validation of the ASTRAL and DRAGON Scores for \"\n        \"Prediction of Functional Outcome in Stroke.\"\n    )\n    assert inst.relatedArtifact[0].label == \"Cooray 2016 Validation Study\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1161/STROKEAHA.116.012802\"}\n        ).valueUrl\n    )\n    assert inst.statistic[0].description == \"5.3% risk\"\n    assert float(inst.statistic[0].quantity.value) == float(0.0525)\n    assert inst.statistic[0].sampleSize.numberOfParticipants == 36131\n    assert inst.statistic[0].statisticType.coding[0].code == \"C44256\"\n    assert inst.statistic[0].statisticType.coding[0].display == \"Proportion\"\n    assert (\n        inst.statistic[0].statisticType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/statistic-type\"}\n        ).valueUri\n    )\n    assert inst.statistic[0].statisticType.text == \"derived proportion\"\n    assert inst.status == \"draft\"\n    assert inst.studyType.coding[0].code == \"series\"\n    assert inst.studyType.coding[0].display == \"uncontrolled cohort or case series\"\n    assert (\n        inst.studyType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/study-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == (\n        \"Risk of mRS3-6 at 90 days after Alteplase for Stroke if \" \"ASTRAL score 12\"\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/Evidence/example-ASTRAL-12-alteplase-mRS3-6\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n    assert inst.variableDefinition[0].intended.display == (\n        \"patients 0-4.5 hours after acute ischemic stroke onset with \"\n        \"ASTRAL score = 12\"\n    )\n    assert inst.variableDefinition[0].intended.reference == \"Group/ASTRAL-12\"\n    assert (\n        inst.variableDefinition[0].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.variableDefinition[0].observed.display == \"ASTRAL validation cohort\"\n    assert (\n        inst.variableDefinition[0].observed.reference\n        == \"Group/ASTRAL-Cooray-validation-cohort\"\n    )\n    assert (\n        inst.variableDefinition[0].observed.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.variableDefinition[0].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[0].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[0].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].description\n        == \"functionally dependent or dead at 3 months\"\n    )\n    assert inst.variableDefinition[1].directnessMatch.coding[0].code == \"high\"\n    assert (\n        inst.variableDefinition[1].directnessMatch.coding[0].display\n        == \"High quality match\"\n    )\n    assert (\n        inst.variableDefinition[1].directnessMatch.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/directness\"}\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].intended.display\n        == \"Dead or functionally dependent at 90 days\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.reference\n        == \"EvidenceVariable/example-dead-or-dependent-90day\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[1].observed.display == \"mRS 3-6 at 90 days\"\n    assert (\n        inst.variableDefinition[1].observed.reference\n        == \"EvidenceVariable/example-mRS3-6-at-90days\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[1].variableRole.coding[0].code == \"measuredVariable\"\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].display == \"measured variable\"\n    )\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].directnessMatch.coding[0].code == \"exact\"\n    assert inst.variableDefinition[2].directnessMatch.coding[0].display == \"Exact match\"\n    assert (\n        inst.variableDefinition[2].directnessMatch.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/directness\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].intended.display == \"Alteplase for Stroke\"\n    assert (\n        inst.variableDefinition[2].intended.reference\n        == \"EvidenceVariable/example-alteplase-for-stroke\"\n    )\n    assert (\n        inst.variableDefinition[2].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].observed.display == \"Alteplase for Stroke\"\n    assert (\n        inst.variableDefinition[2].observed.reference\n        == \"EvidenceVariable/example-alteplase-for-stroke\"\n    )\n    assert (\n        inst.variableDefinition[2].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].variableRole.coding[0].code == \"exposure\"\n    assert inst.variableDefinition[2].variableRole.coding[0].display == \"exposure\"\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n\n\ndef test_evidence_5(base_settings):\n    \"\"\"No. 5 tests collection for Evidence.\n    Test File: evidence-example-ASTRAL-12-alteplase-mRS3-6.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidence-example-ASTRAL-12-alteplase-mRS3-6.json\"\n    )\n    inst = evidence.Evidence.model_validate_json(filename.read_bytes())\n    assert \"Evidence\" == inst.get_resource_type()\n\n    impl_evidence_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Evidence\" == data[\"resourceType\"]\n\n    inst2 = evidence.Evidence(**data)\n    impl_evidence_5(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_evidencereport.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EvidenceReport\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import evidencereport\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_evidencereport_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.subject.note[0].text == \"This is just an example.\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_evidencereport_1(base_settings):\n    \"\"\"No. 1 tests collection for EvidenceReport.\n    Test File: evidencereport-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"evidencereport-example.json\"\n    inst = evidencereport.EvidenceReport.model_validate_json(filename.read_bytes())\n    assert \"EvidenceReport\" == inst.get_resource_type()\n\n    impl_evidencereport_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceReport\" == data[\"resourceType\"]\n\n    inst2 = evidencereport.EvidenceReport(**data)\n    impl_evidencereport_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_evidencevariable.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EvidenceVariable\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import evidencevariable\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_evidencevariable_1(inst):\n    assert inst.actual is True\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].code == \"182886004\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].display\n        == \"Placebo given (situation)\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].description == \"placebo\"\n    assert inst.id == \"example-placebo\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"placebo\"\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n\n\ndef test_evidencevariable_1(base_settings):\n    \"\"\"No. 1 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-placebo.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"evidencevariable-example-placebo.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_1(inst2)\n\n\ndef impl_evidencevariable_2(inst):\n    assert inst.actual is True\n    assert inst.characteristic[0].definitionExpression.description == \"mRS 0-2\"\n    assert inst.characteristic[0].definitionExpression.expression == (\n        '[\"Observation\": code in \"75859-9|LOINC\"] mRS where '\n        \"mRS.value between 0 and 2\"\n    )\n    assert inst.characteristic[0].definitionExpression.language == \"text/cql\"\n    assert inst.characteristic[0].description == \"mRS 0-2 at 90 days\"\n    assert inst.characteristic[0].timeFromStart.quantity.code == \"d\"\n    assert (\n        inst.characteristic[0].timeFromStart.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromStart.quantity.unit == \"day\"\n    assert float(inst.characteristic[0].timeFromStart.quantity.value) == float(90)\n    assert inst.handling == \"dichotomous\"\n    assert inst.id == \"example-mRS0-2-at-90days\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Modified Rankin Scale score 0-2 at 90 days after treatment\"\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n\n\ndef test_evidencevariable_2(base_settings):\n    \"\"\"No. 2 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-mRS0-2-at-90days.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-mRS0-2-at-90days.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_2(inst2)\n\n\ndef impl_evidencevariable_3(inst):\n    assert inst.actual is True\n    assert inst.characteristic[0].definitionCanonical == (\n        \"http://example.org/fhir/ActivityDefinition/example-\" \"alteplase-dosing\"\n    )\n    assert inst.characteristic[0].description == (\n        \"IV alteplase 0.9 mg/kg (maximum 90 mg) as 10% of dose over 1\"\n        \" minute and 90% over 1 hour\"\n    )\n    assert inst.id == \"example-alteplase-for-stroke\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Alteplase for Stroke\"\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n\n\ndef test_evidencevariable_3(base_settings):\n    \"\"\"No. 3 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-alteplase-for-stroke.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-alteplase-for-stroke.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_3(inst2)\n\n\ndef impl_evidencevariable_4(inst):\n    assert inst.actual is False\n    assert inst.characteristic[0].definitionCodeableConcept.coding[0].code == \"8410\"\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].display\n        == \"alteplase\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].description == \"no alteplase\"\n    assert inst.characteristic[0].exclude is True\n    assert inst.id == \"example-no-alteplase\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"no alteplase\"\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n\n\ndef test_evidencevariable_4(base_settings):\n    \"\"\"No. 4 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-no-alteplase.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-no-alteplase.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_4(inst2)\n\n\ndef impl_evidencevariable_5(inst):\n    assert inst.actual is False\n    assert inst.characteristicCombination == \"union\"\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].code == \"718705001\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].display\n        == \"Functionally dependent (finding)\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].description == \"functionally dependent at 90 days\"\n    assert inst.characteristic[0].timeFromStart.quantity.code == \"d\"\n    assert (\n        inst.characteristic[0].timeFromStart.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromStart.quantity.unit == \"day\"\n    assert float(inst.characteristic[0].timeFromStart.quantity.value) == float(90)\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].code == \"419099009\"\n    )\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].display\n        == \"Dead (finding)\"\n    )\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].description == \"dead at 90 days\"\n    assert inst.characteristic[1].timeFromStart.quantity.code == \"d\"\n    assert (\n        inst.characteristic[1].timeFromStart.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].timeFromStart.quantity.unit == \"day\"\n    assert float(inst.characteristic[1].timeFromStart.quantity.value) == float(90)\n    assert inst.handling == \"dichotomous\"\n    assert inst.id == \"example-dead-or-dependent-90day\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Dead or functionally dependent at 90 days\"\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n\n\ndef test_evidencevariable_5(base_settings):\n    \"\"\"No. 5 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-dead-or-dependent-90day.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-dead-or-dependent-90day.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_5(inst2)\n\n\ndef impl_evidencevariable_6(inst):\n    assert inst.actual is True\n    assert inst.characteristicCombination == \"union\"\n    assert (\n        inst.characteristic[0].definitionReference.display == \"ECASS III Trial Cohort\"\n    )\n    assert (\n        inst.characteristic[0].definitionReference.reference\n        == \"Group/ECASSIII-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[0].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.characteristic[1].definitionReference.display == \"IST3 Trial Cohort\"\n    assert (\n        inst.characteristic[1].definitionReference.reference\n        == \"Group/IST3-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[1].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.characteristic[2].definitionReference.display == \"ECASS Trial Cohort\"\n    assert (\n        inst.characteristic[2].definitionReference.reference\n        == \"Group/ECASS-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[2].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.characteristic[3].definitionReference.display == \"ECASSII Trial Cohort\"\n    assert (\n        inst.characteristic[3].definitionReference.reference\n        == \"Group/ECASSII-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[3].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.characteristic[4].definitionReference.display == \"EPITHET Trial Cohort\"\n    assert (\n        inst.characteristic[4].definitionReference.reference\n        == \"Group/EPITHET-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[4].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.characteristic[5].definitionReference.display == \"ATLANTIS Trial Cohort\"\n    assert (\n        inst.characteristic[5].definitionReference.reference\n        == \"Group/ATLANTIS-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[5].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.characteristic[6].definitionReference.display == \"NINDS Trial Cohort\"\n    assert (\n        inst.characteristic[6].definitionReference.reference\n        == \"Group/NINDS-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[6].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.id == (\n        \"example-Stroke-Thrombolysis-Trialists-2014-2016-IPD-MA-\" \"Cohort\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Stroke Thrombolysis Trialists’ 2014-2016 IPD-MA Cohort\"\n    assert inst.relatedArtifact[0].label == \"Emberson 2014\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1016/S0140-6736(14)60584-5\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].display == \"Figure 2 Lees 2016\"\n    assert inst.relatedArtifact[1].label == \"Lees 2016\"\n    assert inst.relatedArtifact[1].type == \"citation\"\n    assert (\n        inst.relatedArtifact[1].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1161/STROKEAHA.116.013644\"}\n        ).valueUrl\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == (\n        \"Stroke Thrombolysis Trialists’ Collaborators Group \"\n        \"collection used for individual patient data meta-analysis\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n\n\ndef test_evidencevariable_6(base_settings):\n    \"\"\"No. 6 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-Stroke-Thrombolysis-Trialists-2014-2016-IPD-MA-Cohort.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-Stroke-Thrombolysis-Trialists-2014-2016-IPD-MA-Cohort.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_6(inst2)\n\n\ndef impl_evidencevariable_7(inst):\n    assert inst.actual is True\n    assert inst.characteristicCombination == \"intersection\"\n    assert inst.characteristic[0].definitionCodeableConcept.coding[0].code == \"1386000\"\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].display\n        == \"Intracranial hemorrhage (disorder)\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].description == \"intracranial hemorrhage within 7 days\"\n    assert inst.characteristic[0].timeFromStart.description == \"within 7 days\"\n    assert inst.characteristic[0].timeFromStart.range.high.code == \"d\"\n    assert (\n        inst.characteristic[0].timeFromStart.range.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromStart.range.high.unit == \"day\"\n    assert float(inst.characteristic[0].timeFromStart.range.high.value) == float(7)\n    assert inst.characteristic[0].timeFromStart.range.low.code == \"d\"\n    assert (\n        inst.characteristic[0].timeFromStart.range.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromStart.range.low.unit == \"day\"\n    assert float(inst.characteristic[0].timeFromStart.range.low.value) == float(0)\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].code == \"419620001\"\n    )\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].display\n        == \"Death (event)\"\n    )\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].description == \"death within 7 days\"\n    assert inst.characteristic[1].timeFromStart.description == \"within 7 days\"\n    assert inst.characteristic[1].timeFromStart.range.high.code == \"d\"\n    assert (\n        inst.characteristic[1].timeFromStart.range.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].timeFromStart.range.high.unit == \"day\"\n    assert float(inst.characteristic[1].timeFromStart.range.high.value) == float(7)\n    assert inst.characteristic[1].timeFromStart.range.low.code == \"d\"\n    assert (\n        inst.characteristic[1].timeFromStart.range.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].timeFromStart.range.low.unit == \"day\"\n    assert float(inst.characteristic[1].timeFromStart.range.low.value) == float(0)\n    assert inst.handling == \"dichotomous\"\n    assert inst.id == \"example-fatal-ICH-in-7-days\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Death must be due to intracranial hemorrhage\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Fatal Intracranial Hemorrhage Within Seven Days\"\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n    assert inst.useContext[1].code.code == \"1386000\"\n    assert inst.useContext[1].code.display == \"Intracranial hemorrhage\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueRange.high.unit == \"d\"\n    assert float(inst.useContext[1].valueRange.high.value) == float(7)\n    assert inst.useContext[1].valueRange.low.unit == \"d\"\n    assert float(inst.useContext[1].valueRange.low.value) == float(0)\n\n\ndef test_evidencevariable_7(base_settings):\n    \"\"\"No. 7 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-fatal-ICH-in-7-days.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-fatal-ICH-in-7-days.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_7(inst2)\n\n\ndef impl_evidencevariable_8(inst):\n    assert inst.actual is False\n    assert inst.characteristicCombination == \"intersection\"\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].code == \"718705001\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].display\n        == \"Functionally dependent (finding)\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].description == \"not functionally dependent at 90 days\"\n    assert inst.characteristic[0].exclude is True\n    assert inst.characteristic[0].timeFromStart.quantity.code == \"d\"\n    assert (\n        inst.characteristic[0].timeFromStart.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromStart.quantity.unit == \"day\"\n    assert float(inst.characteristic[0].timeFromStart.quantity.value) == float(90)\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].code == \"419099009\"\n    )\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].display\n        == \"Dead (finding)\"\n    )\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].description == \"alive at 90 days\"\n    assert inst.characteristic[1].exclude is True\n    assert inst.characteristic[1].timeFromStart.quantity.code == \"d\"\n    assert (\n        inst.characteristic[1].timeFromStart.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].timeFromStart.quantity.unit == \"day\"\n    assert float(inst.characteristic[1].timeFromStart.quantity.value) == float(90)\n    assert inst.handling == \"dichotomous\"\n    assert inst.id == \"example-alive-independent-90day\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Alive and not functionally dependent at 90 days\"\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n\n\ndef test_evidencevariable_8(base_settings):\n    \"\"\"No. 8 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-alive-independent-90day.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-alive-independent-90day.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_8(inst2)\n\n\ndef impl_evidencevariable_9(inst):\n    assert inst.actual is True\n    assert inst.characteristic[0].definitionExpression.description == \"mRS 3-6\"\n    assert inst.characteristic[0].definitionExpression.expression == (\n        '[\"Observation\": code in \"75859-9|LOINC\"] mRS where '\n        \"mRS.value between 3 and 6\"\n    )\n    assert inst.characteristic[0].definitionExpression.language == \"text/cql\"\n    assert inst.characteristic[0].description == \"mRS 3-6 at 90 days\"\n    assert inst.characteristic[0].timeFromStart.quantity.code == \"d\"\n    assert (\n        inst.characteristic[0].timeFromStart.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromStart.quantity.unit == \"day\"\n    assert float(inst.characteristic[0].timeFromStart.quantity.value) == float(90)\n    assert inst.handling == \"dichotomous\"\n    assert inst.id == \"example-mRS3-6-at-90days\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Modified Rankin Scale score 3-6 at 90 days after treatment\"\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n\n\ndef test_evidencevariable_9(base_settings):\n    \"\"\"No. 9 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-mRS3-6-at-90days.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-mRS3-6-at-90days.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_9(inst2)\n\n\ndef impl_evidencevariable_10(inst):\n    assert inst.actual is True\n    assert inst.characteristicCombination == \"union\"\n    assert inst.characteristic[0].definitionReference.display == \"NINDS 1995\"\n    assert (\n        inst.characteristic[0].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Evidence\"}).valueUri\n    )\n    assert inst.characteristic[1].definitionReference.display == \"ECASS 1995\"\n    assert (\n        inst.characteristic[1].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Evidence\"}).valueUri\n    )\n    assert inst.characteristic[2].definitionReference.display == \"ECASS II 1998\"\n    assert (\n        inst.characteristic[2].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Evidence\"}).valueUri\n    )\n    assert inst.characteristic[3].definitionReference.display == \"ATLANTIS B 1999\"\n    assert (\n        inst.characteristic[3].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Evidence\"}).valueUri\n    )\n    assert inst.characteristic[4].definitionReference.display == \"ATLANTIS A 2000\"\n    assert (\n        inst.characteristic[4].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Evidence\"}).valueUri\n    )\n    assert inst.characteristic[5].definitionReference.display == \"IST3 2012\"\n    assert (\n        inst.characteristic[5].definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Evidence\"}).valueUri\n    )\n    assert inst.handling == \"dichotomous\"\n    assert inst.id == \"example-Wardlaw2014Analysis1.16.3EvidenceSet\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Wardlaw 2014 Analysis 1.16.3 Evidence set\"\n    assert inst.note[0].text == (\n        \"Short names for Evidence sources are detailed in \"\n        '\"References to studies included in this review\"'\n    )\n    assert inst.relatedArtifact[0].citation == (\n        \"Wardlaw JM, Murray V, Berge E, del Zoppo GJ. Thrombolysis \"\n        \"for acute ischaemic stroke. Cochrane Database Syst Rev. 2014\"\n        \" Jul 29(7):CD000213. PMID 25072528\"\n    )\n    assert inst.relatedArtifact[0].display == \"Analysis 1.16.3 from Wardlaw 2014\"\n    assert inst.relatedArtifact[0].label == \"Wardlaw 2014\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1002/14651858.CD000213.pub3\"}\n        ).valueUrl\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Wardlaw 2014 Analysis 1.16.3 Evidence set\"\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"Stroke\"\n\n\ndef test_evidencevariable_10(base_settings):\n    \"\"\"No. 10 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-Wardlaw2014Analysis1.16.3EvidenceSet.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-Wardlaw2014Analysis1.16.3EvidenceSet.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_examplescenario.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ExampleScenario\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import examplescenario\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_examplescenario_1(inst):\n    assert inst.actor[0].actorId == \"Nurse\"\n    assert inst.actor[0].description == \"The Nurse\"\n    assert inst.actor[0].name == \"Nurse\"\n    assert inst.actor[0].type == \"person\"\n    assert inst.actor[1].actorId == \"MAP\"\n    assert inst.actor[1].description == (\n        \"The entity that receives the Administration Requests to show\"\n        \" the nurse to perform them\"\n    )\n    assert inst.actor[1].name == \"Nurse's Tablet\"\n    assert inst.actor[1].type == \"entity\"\n    assert inst.actor[2].actorId == \"OP\"\n    assert inst.actor[2].description == \"The Medication Administration Order Placer\"\n    assert inst.actor[2].name == \"MAR / Scheduler\"\n    assert inst.actor[2].type == \"entity\"\n    assert inst.actor[3].actorId == \"MAC\"\n    assert inst.actor[3].description == (\n        \"The entity that receives the Medication Administration \" \"reports\"\n    )\n    assert inst.actor[3].name == \"MAR / EHR\"\n    assert inst.actor[3].type == \"entity\"\n    assert inst.experimental is True\n    assert inst.id == \"example\"\n    assert inst.instance[0].description == (\n        'The initial prescription which describes \"medication X, 3 '\n        'times per day\" - the exact scheduling is not   in the '\n        \"initial prescription (it is left for the care teams to \"\n        \"decide on the schedule).\"\n    )\n    assert inst.instance[0].name == \"Initial Prescription\"\n    assert inst.instance[0].resourceId == \"iherx001\"\n    assert (\n        inst.instance[1].description == \"The administration request for day 1, morning\"\n    )\n    assert inst.instance[1].name == \"Request for day 1, morning\"\n    assert inst.instance[1].resourceId == \"iherx001.001\"\n    assert inst.instance[2].description == \"The administration request for day 1, lunch\"\n    assert inst.instance[2].name == \"Request for day 1, lunch\"\n    assert inst.instance[2].resourceId == \"iherx001.002\"\n    assert (\n        inst.instance[3].description == \"The administration request for day 1, evening\"\n    )\n    assert inst.instance[3].name == \"Request for day 1, evening\"\n    assert inst.instance[3].resourceId == \"iherx001.003\"\n    assert (\n        inst.instance[4].description == \"The administration request for day 2, morning\"\n    )\n    assert inst.instance[4].name == \"Request for day 2, morning\"\n    assert inst.instance[4].resourceId == \"iherx001.004\"\n    assert inst.instance[5].description == \"The administration request for day 2, lunch\"\n    assert inst.instance[5].name == \"Request for day 2, lunch\"\n    assert inst.instance[5].resourceId == \"iherx001.005\"\n    assert (\n        inst.instance[6].description == \"The administration request for day 2, evening\"\n    )\n    assert inst.instance[6].name == \"Request for day 2, evening\"\n    assert inst.instance[6].resourceId == \"iherx001.006\"\n    assert (\n        inst.instance[7].description\n        == \"Administration report for day 1, morning: Taken\"\n    )\n    assert inst.instance[7].name == \"Morning meds - taken\"\n    assert inst.instance[7].resourceId == \"iheadm001a\"\n    assert (\n        inst.instance[8].description\n        == \"Administration report for day 1, morning: NOT Taken\"\n    )\n    assert inst.instance[8].name == \"Morning meds - not taken\"\n    assert inst.instance[8].resourceId == \"iheadm001b\"\n    assert inst.instance[9].containedInstance[0].resourceId == \"iherx001.001\"\n    assert inst.instance[9].containedInstance[1].resourceId == \"iherx001.002\"\n    assert inst.instance[9].containedInstance[2].resourceId == \"iherx001.003\"\n    assert inst.instance[9].containedInstance[3].resourceId == \"iherx001.004\"\n    assert inst.instance[9].containedInstance[4].resourceId == \"iherx001.005\"\n    assert inst.instance[9].containedInstance[5].resourceId == \"iherx001.006\"\n    assert inst.instance[9].description == \"All the medication Requests for Day 1\"\n    assert inst.instance[9].name == \"Bundle of Medication Requests\"\n    assert inst.instance[9].resourceId == \"iherx001bundle\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.process[0].postConditions == (\n        \"Medication administration Reports are submitted, EHR is \" \"updated.\"\n    )\n    assert inst.process[0].preConditions == (\n        \"Medication administration requests are in the EHR / MAR, \"\n        \"scheduled for each individual intake.\"\n    )\n    assert inst.process[0].step[0].operation.initiator == \"Nurse\"\n    assert inst.process[0].step[0].operation.name == \"1. Get today's schedule\"\n    assert inst.process[0].step[0].operation.number == \"1\"\n    assert inst.process[0].step[0].operation.receiver == \"MAP\"\n    assert inst.process[0].step[1].process[0].description == (\n        \"Query for medication administration orders,\\\\n- For today's \"\n        \"shifts\\\\n- For today's patients\"\n    )\n    assert inst.process[0].step[1].process[0].step[0].operation.initiator == \"MAP\"\n    assert inst.process[0].step[1].process[0].step[0].operation.name == (\n        \"2.Query for medication administration orders,\\\\n- For \"\n        \"today's shifts\\\\n- For today's patients\"\n    )\n    assert inst.process[0].step[1].process[0].step[0].operation.number == \"2\"\n    assert inst.process[0].step[1].process[0].step[0].operation.receiver == \"OP\"\n    assert (\n        inst.process[0].step[1].process[0].step[0].operation.request.resourceId\n        == \"iherxqry\"\n    )\n    assert (\n        inst.process[0].step[1].process[0].step[0].operation.response.resourceId\n        == \"iherx001bundle\"\n    )\n    assert (\n        inst.process[0].step[1].process[0].title == \"P1. Query Administration Requests\"\n    )\n    assert inst.process[0].step[2].pause is True\n    assert inst.process[0].step[3].operation.initiator == \"MAP\"\n    assert inst.process[0].step[3].operation.name == \"Notify (alert)\"\n    assert inst.process[0].step[3].operation.number == \"4\"\n    assert inst.process[0].step[3].operation.receiver == \"Nurse\"\n    assert inst.process[0].step[4].operation.initiator == \"Nurse\"\n    assert inst.process[0].step[4].operation.name == \"Read orders\"\n    assert inst.process[0].step[4].operation.number == \"5\"\n    assert inst.process[0].step[4].operation.receiver == \"MAP\"\n    assert inst.process[0].step[5].pause is True\n    assert inst.process[0].step[6].operation.initiator == \"Nurse\"\n    assert inst.process[0].step[6].operation.name == \"Ask if patient took meds\"\n    assert inst.process[0].step[6].operation.number == \"5\"\n    assert inst.process[0].step[6].operation.receiver == \"Nurse\"\n    assert (\n        inst.process[0].step[7].alternative[0].description\n        == \"Invoke if patient took medications\"\n    )\n    assert (\n        inst.process[0]\n        .step[7]\n        .alternative[0]\n        .step[0]\n        .process[0]\n        .step[0]\n        .operation.initiator\n        == \"Nurse\"\n    )\n    assert (\n        inst.process[0]\n        .step[7]\n        .alternative[0]\n        .step[0]\n        .process[0]\n        .step[0]\n        .operation.initiatorActive\n        is True\n    )\n    assert (\n        inst.process[0].step[7].alternative[0].step[0].process[0].step[0].operation.name\n        == \"Register Meds taken\"\n    )\n    assert (\n        inst.process[0]\n        .step[7]\n        .alternative[0]\n        .step[0]\n        .process[0]\n        .step[0]\n        .operation.number\n        == \"1a\"\n    )\n    assert (\n        inst.process[0]\n        .step[7]\n        .alternative[0]\n        .step[0]\n        .process[0]\n        .step[0]\n        .operation.receiver\n        == \"MAP\"\n    )\n    assert (\n        inst.process[0].step[7].alternative[0].step[0].process[0].title\n        == \"Register Meds taken\"\n    )\n    assert inst.process[0].step[7].alternative[0].title == \"Patient took drugs\"\n    assert (\n        inst.process[0].step[7].alternative[1].description\n        == \"No, patient did not take drugs\"\n    )\n    assert (\n        inst.process[0]\n        .step[7]\n        .alternative[1]\n        .step[0]\n        .process[0]\n        .step[0]\n        .operation.initiator\n        == \"Nurse\"\n    )\n    assert (\n        inst.process[0]\n        .step[7]\n        .alternative[1]\n        .step[0]\n        .process[0]\n        .step[0]\n        .operation.initiatorActive\n        is True\n    )\n    assert (\n        inst.process[0].step[7].alternative[1].step[0].process[0].step[0].operation.name\n        == \"Register Meds NOT taken\"\n    )\n    assert (\n        inst.process[0]\n        .step[7]\n        .alternative[1]\n        .step[0]\n        .process[0]\n        .step[0]\n        .operation.number\n        == \"1b\"\n    )\n    assert (\n        inst.process[0]\n        .step[7]\n        .alternative[1]\n        .step[0]\n        .process[0]\n        .step[0]\n        .operation.receiver\n        == \"MAP\"\n    )\n    assert (\n        inst.process[0].step[7].alternative[1].step[0].process[0].title\n        == \"Register Meds NOT taken\"\n    )\n    assert inst.process[0].step[7].alternative[1].title == \"No drugs\"\n    assert (\n        inst.process[0].step[7].alternative[2].description\n        == \"Unknown whether patient took medications or not\"\n    )\n    assert inst.process[0].step[7].alternative[2].step[0].pause is True\n    assert inst.process[0].step[7].alternative[2].title == \"Not clear\"\n    assert inst.process[0].step[8].pause is True\n    assert inst.process[0].step[9].operation.initiator == \"Nurse\"\n    assert inst.process[0].step[9].operation.name == \"Administer drug\"\n    assert inst.process[0].step[9].operation.number == \"6\"\n    assert inst.process[0].step[9].operation.receiver == \"Nurse\"\n    assert inst.process[0].title == \"Mobile Medication Administration\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_examplescenario_1(base_settings):\n    \"\"\"No. 1 tests collection for ExampleScenario.\n    Test File: examplescenario-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"examplescenario-example.json\"\n    inst = examplescenario.ExampleScenario.model_validate_json(filename.read_bytes())\n    assert \"ExampleScenario\" == inst.get_resource_type()\n\n    impl_examplescenario_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ExampleScenario\" == data[\"resourceType\"]\n\n    inst2 = examplescenario.ExampleScenario(**data)\n    impl_examplescenario_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_explanationofbenefit.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import explanationofbenefit\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_explanationofbenefit_1(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert inst.claim.reference == \"Claim/100150\"\n    assert inst.claimResponse.reference == \"ClaimResponse/R3500\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Claim settled as per contract.\"\n    assert inst.enterer.reference == \"Practitioner/1\"\n    assert inst.facility.reference == \"Location/1\"\n    assert inst.id == \"EB3500\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/explanationofbenefit\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"987654321\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurer.reference == \"Organization/3\"\n    assert inst.item[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[0].amount.value) == float(120.0)\n    assert inst.item[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[0].adjudication[1].category.coding[0].code == \"eligpercent\"\n    assert float(inst.item[0].adjudication[1].value) == float(0.8)\n    assert inst.item[0].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[2].amount.value) == float(96.0)\n    assert inst.item[0].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].encounter[0].reference == \"Encounter/example\"\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(135.57)\n    assert inst.item[0].productOrService.coding[0].code == \"1205\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-USCLS\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].udi[0].reference == \"Device/example\"\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(135.57)\n    assert inst.item[1].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[1].adjudication[0].amount.value) == float(180.0)\n    assert inst.item[1].adjudication[0].category.coding[0].code == \"benefit\"\n    assert inst.item[1].careTeamSequence[0] == 1\n    assert inst.item[1].detail[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[1].detail[0].adjudication[0].amount.value) == float(180.0)\n    assert inst.item[1].detail[0].adjudication[0].category.coding[0].code == \"benefit\"\n    assert inst.item[1].detail[0].net.currency == \"USD\"\n    assert float(inst.item[1].detail[0].net.value) == float(200.0)\n    assert inst.item[1].detail[0].productOrService.coding[0].code == \"group\"\n    assert inst.item[1].detail[0].sequence == 1\n    assert inst.item[1].detail[0].subDetail[0].adjudication[0].amount.currency == \"USD\"\n    assert float(\n        inst.item[1].detail[0].subDetail[0].adjudication[0].amount.value\n    ) == float(200.0)\n    assert (\n        inst.item[1].detail[0].subDetail[0].adjudication[0].category.coding[0].code\n        == \"eligible\"\n    )\n    assert (\n        inst.item[1].detail[0].subDetail[0].adjudication[1].category.coding[0].code\n        == \"eligpercent\"\n    )\n    assert float(inst.item[1].detail[0].subDetail[0].adjudication[1].value) == float(\n        0.9\n    )\n    assert inst.item[1].detail[0].subDetail[0].adjudication[2].amount.currency == \"USD\"\n    assert float(\n        inst.item[1].detail[0].subDetail[0].adjudication[2].amount.value\n    ) == float(180.0)\n    assert (\n        inst.item[1].detail[0].subDetail[0].adjudication[2].category.coding[0].code\n        == \"benefit\"\n    )\n    assert inst.item[1].detail[0].subDetail[0].net.currency == \"USD\"\n    assert float(inst.item[1].detail[0].subDetail[0].net.value) == float(200.0)\n    assert inst.item[1].detail[0].subDetail[0].productOrService.coding[0].code == \"1205\"\n    assert (\n        inst.item[1].detail[0].subDetail[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-USCLS\"}\n        ).valueUri\n    )\n    assert inst.item[1].detail[0].subDetail[0].sequence == 1\n    assert inst.item[1].detail[0].subDetail[0].udi[0].reference == \"Device/example\"\n    assert inst.item[1].detail[0].subDetail[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[1].detail[0].subDetail[0].unitPrice.value) == float(200.0)\n    assert inst.item[1].detail[0].udi[0].reference == \"Device/example\"\n    assert inst.item[1].net.currency == \"USD\"\n    assert float(inst.item[1].net.value) == float(200.0)\n    assert inst.item[1].productOrService.coding[0].code == \"group\"\n    assert inst.item[1].sequence == 2\n    assert (\n        inst.item[1].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.payee.party.reference == \"Organization/2\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert (\n        inst.payee.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payeetype\"}\n        ).valueUri\n    )\n    assert inst.provider.reference == \"Practitioner/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the ExplanationOfBenefit</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total[0].amount.currency == \"USD\"\n    assert float(inst.total[0].amount.value) == float(135.57)\n    assert inst.total[0].category.coding[0].code == \"submitted\"\n    assert inst.total[1].amount.currency == \"USD\"\n    assert float(inst.total[1].amount.value) == float(96.0)\n    assert inst.total[1].category.coding[0].code == \"benefit\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_explanationofbenefit_1(base_settings):\n    \"\"\"No. 1 tests collection for ExplanationOfBenefit.\n    Test File: explanationofbenefit-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"explanationofbenefit-example.json\"\n    inst = explanationofbenefit.ExplanationOfBenefit.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ExplanationOfBenefit\" == inst.get_resource_type()\n\n    impl_explanationofbenefit_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ExplanationOfBenefit\" == data[\"resourceType\"]\n\n    inst2 = explanationofbenefit.ExplanationOfBenefit(**data)\n    impl_explanationofbenefit_1(inst2)\n\n\ndef impl_explanationofbenefit_2(inst):\n    assert (\n        inst.accident.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-02-14\"}).valueDate\n    )\n    assert inst.accident.locationReference.reference == \"Location/ph\"\n    assert inst.accident.type.coding[0].code == \"SPT\"\n    assert (\n        inst.accident.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.billablePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-03-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.billablePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-01\"}\n        ).valueDateTime\n    )\n    assert inst.claim.reference == \"Claim/100150\"\n    assert inst.claimResponse.reference == \"ClaimResponse/R3500\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Could not process.\"\n    assert inst.enterer.reference == \"Practitioner/1\"\n    assert inst.facility.reference == \"Location/1\"\n    assert inst.formCode.coding[0].code == \"2\"\n    assert (\n        inst.formCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/forms-codes\"}\n        ).valueUri\n    )\n    assert inst.id == \"EB3501\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/explanationofbenefit\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"error-1\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.originalPrescription.reference == \"MedicationRequest/medrx0301\"\n    assert inst.outcome == \"error\"\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.precedence == 2\n    assert inst.prescription.reference == \"MedicationRequest/medrx002\"\n    assert (\n        inst.procedure[0].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-14\"}\n        ).valueDateTime\n    )\n    assert inst.procedure[0].procedureCodeableConcept.coding[0].code == \"123001\"\n    assert (\n        inst.procedure[0].procedureCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ex-icd-10-procedures\"}\n        ).valueUri\n    )\n    assert inst.procedure[0].sequence == 1\n    assert inst.procedure[0].udi[0].reference == \"Device/example\"\n    assert inst.processNote[0].language.coding[0].code == \"en-CA\"\n    assert (\n        inst.processNote[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].number == 1\n    assert inst.processNote[0].text == \"Invalid claim\"\n    assert inst.processNote[0].type == \"display\"\n    assert inst.provider.reference == \"Organization/2\"\n    assert (\n        inst.related[0].reference.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/case-number\"}\n        ).valueUri\n    )\n    assert inst.related[0].reference.value == \"23-56Tu-XX-47-20150M14\"\n    assert inst.status == \"active\"\n    assert inst.subType.coding[0].code == \"emergency\"\n    assert (\n        inst.subType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-claimsubtype\"}\n        ).valueUri\n    )\n    assert inst.supportingInfo[0].category.coding[0].code == \"employmentimpacted\"\n    assert (\n        inst.supportingInfo[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/claiminformationcategory\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[0].sequence == 1\n    assert (\n        inst.supportingInfo[0].timingPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-28\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.supportingInfo[0].timingPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-14\"}\n        ).valueDateTime\n    )\n    assert inst.supportingInfo[1].category.coding[0].code == \"hospitalized\"\n    assert (\n        inst.supportingInfo[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/claiminformationcategory\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[1].sequence == 2\n    assert (\n        inst.supportingInfo[1].timingPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-16\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.supportingInfo[1].timingPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-14\"}\n        ).valueDateTime\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total[0].amount.currency == \"USD\"\n    assert float(inst.total[0].amount.value) == float(2478.57)\n    assert inst.total[0].category.coding[0].code == \"submitted\"\n    assert inst.total[1].amount.currency == \"USD\"\n    assert float(inst.total[1].amount.value) == float(0.0)\n    assert inst.total[1].category.coding[0].code == \"benefit\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_explanationofbenefit_2(base_settings):\n    \"\"\"No. 2 tests collection for ExplanationOfBenefit.\n    Test File: explanationofbenefit-example-2.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"explanationofbenefit-example-2.json\"\n    )\n    inst = explanationofbenefit.ExplanationOfBenefit.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ExplanationOfBenefit\" == inst.get_resource_type()\n\n    impl_explanationofbenefit_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ExplanationOfBenefit\" == data[\"resourceType\"]\n\n    inst2 = explanationofbenefit.ExplanationOfBenefit(**data)\n    impl_explanationofbenefit_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_familymemberhistory.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import familymemberhistory\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_familymemberhistory_1(inst):\n    assert inst.condition[0].code.coding[0].code == \"315619001\"\n    assert inst.condition[0].code.coding[0].display == \"Myocardial Infarction\"\n    assert (\n        inst.condition[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.condition[0].code.text == \"Heart Attack\"\n    assert inst.condition[0].contributedToDeath is True\n    assert inst.condition[0].note[0].text == (\n        \"Was fishing at the time. At least he went doing someting he \" \"loved.\"\n    )\n    assert inst.condition[0].onsetAge.code == \"a\"\n    assert (\n        inst.condition[0].onsetAge.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.condition[0].onsetAge.unit == \"yr\"\n    assert float(inst.condition[0].onsetAge.value) == float(74)\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-03-18\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"father\"\n    assert inst.identifier[0].value == \"12345\"\n    assert (\n        inst.instantiatesUri[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/family-member-history-questionnaire\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.display == \"Peter Patient\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.relationship.coding[0].code == \"FTH\"\n    assert inst.relationship.coding[0].display == \"father\"\n    assert (\n        inst.relationship.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.sex.coding[0].code == \"male\"\n    assert inst.sex.coding[0].display == \"Male\"\n    assert (\n        inst.sex.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/administrative-gender\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Father died of a'\n        \" heart attack aged 74</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_familymemberhistory_1(base_settings):\n    \"\"\"No. 1 tests collection for FamilyMemberHistory.\n    Test File: familymemberhistory-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"familymemberhistory-example.json\"\n    inst = familymemberhistory.FamilyMemberHistory.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"FamilyMemberHistory\" == inst.get_resource_type()\n\n    impl_familymemberhistory_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"FamilyMemberHistory\" == data[\"resourceType\"]\n\n    inst2 = familymemberhistory.FamilyMemberHistory(**data)\n    impl_familymemberhistory_1(inst2)\n\n\ndef impl_familymemberhistory_2(inst):\n    assert inst.condition[0].code.coding[0].code == \"371041009\"\n    assert inst.condition[0].code.coding[0].display == \"Embolic Stroke\"\n    assert (\n        inst.condition[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.condition[0].code.text == \"Stroke\"\n    assert inst.condition[0].onsetAge.code == \"a\"\n    assert (\n        inst.condition[0].onsetAge.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.condition[0].onsetAge.unit == \"yr\"\n    assert float(inst.condition[0].onsetAge.value) == float(56)\n    assert inst.id == \"mother\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.display == \"Peter Patient\"\n    assert inst.patient.reference == \"Patient/100\"\n    assert inst.relationship.coding[0].code == \"MTH\"\n    assert inst.relationship.coding[0].display == \"mother\"\n    assert (\n        inst.relationship.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Mother died of a'\n        \" stroke aged 56</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_familymemberhistory_2(base_settings):\n    \"\"\"No. 2 tests collection for FamilyMemberHistory.\n    Test File: familymemberhistory-example-mother.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"familymemberhistory-example-mother.json\"\n    )\n    inst = familymemberhistory.FamilyMemberHistory.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"FamilyMemberHistory\" == inst.get_resource_type()\n\n    impl_familymemberhistory_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"FamilyMemberHistory\" == data[\"resourceType\"]\n\n    inst2 = familymemberhistory.FamilyMemberHistory(**data)\n    impl_familymemberhistory_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_flag.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Flag\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import flag\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_flag_1(inst):\n    assert inst.author.display == \"Nancy Nurse\"\n    assert inst.author.reference == \"Practitioner/example\"\n    assert inst.category[0].coding[0].code == \"safety\"\n    assert inst.category[0].coding[0].display == \"Safety\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/flag-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Safety\"\n    assert inst.code.coding[0].code == \"bigdog\"\n    assert inst.code.coding[0].display == \"Big dog\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/local\"}\n        ).valueUri\n    )\n    assert inst.code.text == (\n        \"Patient has a big dog at his home. Always always wear a suit\"\n        \" of armor or take other active counter-measures\"\n    )\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-12-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"inactive\"\n    assert inst.subject.display == \"Peter Patient\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Large Dog '\n        \"warning for Peter Patient</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_flag_1(base_settings):\n    \"\"\"No. 1 tests collection for Flag.\n    Test File: flag-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"flag-example.json\"\n    inst = flag.Flag.model_validate_json(filename.read_bytes())\n    assert \"Flag\" == inst.get_resource_type()\n\n    impl_flag_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Flag\" == data[\"resourceType\"]\n\n    inst2 = flag.Flag(**data)\n    impl_flag_1(inst2)\n\n\ndef impl_flag_2(inst):\n    assert inst.category[0].coding[0].code == \"infection\"\n    assert inst.category[0].coding[0].display == \"Infection Control Level\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/local\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"l3\"\n    assert inst.code.coding[0].display == \"Follow Level 3 Protocol\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/local/if1\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example-encounter\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter Patient\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Follow Infection'\n        \" Control Level 3 Protocol</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_flag_2(base_settings):\n    \"\"\"No. 2 tests collection for Flag.\n    Test File: flag-example-encounter.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"flag-example-encounter.json\"\n    inst = flag.Flag.model_validate_json(filename.read_bytes())\n    assert \"Flag\" == inst.get_resource_type()\n\n    impl_flag_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Flag\" == data[\"resourceType\"]\n\n    inst2 = flag.Flag(**data)\n    impl_flag_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_goal.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Goal\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import goal\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_goal_1(inst):\n    assert inst.addresses[0].display == \"obesity condition\"\n    assert inst.category[0].coding[0].code == \"dietary\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/goal-category\"}\n        ).valueUri\n    )\n    assert inst.description.text == \"Target weight is 160 to 180 lbs.\"\n    assert inst.expressedBy.display == \"Peter James Chalmers\"\n    assert inst.expressedBy.reference == \"Patient/example\"\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"123\"\n    assert inst.lifecycleStatus == \"on-hold\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcomeReference[0].display == \"Body Weight Measured\"\n    assert inst.outcomeReference[0].reference == \"Observation/example\"\n    assert inst.priority.coding[0].code == \"high-priority\"\n    assert inst.priority.coding[0].display == \"High Priority\"\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/goal-priority\"}\n        ).valueUri\n    )\n    assert inst.priority.text == \"high\"\n    assert (\n        inst.startDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-04-05\"}).valueDate\n    )\n    assert (\n        inst.statusDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-02-14\"}).valueDate\n    )\n    assert (\n        inst.statusReason == \"Patient wants to defer weight loss until after honeymoon.\"\n    )\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.target[0].detailRange.high.code == \"[lb_av]\"\n    assert (\n        inst.target[0].detailRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.target[0].detailRange.high.unit == \"lbs\"\n    assert float(inst.target[0].detailRange.high.value) == float(180)\n    assert inst.target[0].detailRange.low.code == \"[lb_av]\"\n    assert (\n        inst.target[0].detailRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.target[0].detailRange.low.unit == \"lbs\"\n    assert float(inst.target[0].detailRange.low.value) == float(160)\n    assert (\n        inst.target[0].dueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-04-05\"}).valueDate\n    )\n    assert inst.target[0].measure.coding[0].code == \"3141-9\"\n    assert inst.target[0].measure.coding[0].display == \"Weight Measured\"\n    assert (\n        inst.target[0].measure.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"additional\"\n\n\ndef test_goal_1(base_settings):\n    \"\"\"No. 1 tests collection for Goal.\n    Test File: goal-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"goal-example.json\"\n    inst = goal.Goal.model_validate_json(filename.read_bytes())\n    assert \"Goal\" == inst.get_resource_type()\n\n    impl_goal_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Goal\" == data[\"resourceType\"]\n\n    inst2 = goal.Goal(**data)\n    impl_goal_1(inst2)\n\n\ndef impl_goal_2(inst):\n    assert inst.achievementStatus.coding[0].code == \"achieved\"\n    assert inst.achievementStatus.coding[0].display == \"Achieved\"\n    assert (\n        inst.achievementStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/goal-achievement\"}\n        ).valueUri\n    )\n    assert inst.achievementStatus.text == \"Achieved\"\n    assert inst.description.text == \"Stop smoking\"\n    assert inst.id == \"stop-smoking\"\n    assert inst.identifier[0].value == \"123\"\n    assert inst.lifecycleStatus == \"completed\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcomeCode[0].coding[0].code == \"8517006\"\n    assert inst.outcomeCode[0].coding[0].display == \"Ex-smoker (finding)\"\n    assert (\n        inst.outcomeCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.outcomeCode[0].text == \"Former smoker\"\n    assert (\n        inst.startDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-04-05\"}).valueDate\n    )\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_goal_2(base_settings):\n    \"\"\"No. 2 tests collection for Goal.\n    Test File: goal-example-stop-smoking.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"goal-example-stop-smoking.json\"\n    inst = goal.Goal.model_validate_json(filename.read_bytes())\n    assert \"Goal\" == inst.get_resource_type()\n\n    impl_goal_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Goal\" == data[\"resourceType\"]\n\n    inst2 = goal.Goal(**data)\n    impl_goal_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_graphdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/GraphDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import graphdefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_graphdefinition_1(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-04\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Specify to include list references when generating a \"\n        \"document using the $document operation\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"example\"\n    assert inst.link[0].description == \"Link to List\"\n    assert inst.link[0].path == \"Composition.section.entry\"\n    assert inst.link[0].target[0].compartment[0].code == \"Patient\"\n    assert inst.link[0].target[0].compartment[0].rule == \"identical\"\n    assert inst.link[0].target[0].compartment[0].use == \"requirement\"\n    assert inst.link[0].target[0].link[0].description == \"Include any list entries\"\n    assert inst.link[0].target[0].link[0].path == \"List.entry.item\"\n    assert inst.link[0].target[0].link[0].target[0].compartment[0].code == \"Patient\"\n    assert inst.link[0].target[0].link[0].target[0].compartment[0].rule == \"identical\"\n    assert inst.link[0].target[0].link[0].target[0].compartment[0].use == \"requirement\"\n    assert inst.link[0].target[0].link[0].target[0].type == \"Resource\"\n    assert inst.link[0].target[0].type == \"List\"\n    assert inst.name == \"Document Generation Template\"\n    assert inst.publisher == \"FHIR Project\"\n    assert inst.start == \"Composition\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://h7.org/fhir/GraphDefinition/example\"}\n        ).valueUri\n    )\n\n\ndef test_graphdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for GraphDefinition.\n    Test File: graphdefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"graphdefinition-example.json\"\n    inst = graphdefinition.GraphDefinition.model_validate_json(filename.read_bytes())\n    assert \"GraphDefinition\" == inst.get_resource_type()\n\n    impl_graphdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"GraphDefinition\" == data[\"resourceType\"]\n\n    inst2 = graphdefinition.GraphDefinition(**data)\n    impl_graphdefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_group.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Group\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import group\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_group_1(inst):\n    assert inst.actual is True\n    assert inst.characteristic[0].code.text == \"gender\"\n    assert inst.characteristic[0].exclude is False\n    assert inst.characteristic[0].valueCodeableConcept.text == \"mixed\"\n    assert inst.characteristic[1].code.text == \"owner\"\n    assert inst.characteristic[1].exclude is False\n    assert inst.characteristic[1].valueCodeableConcept.text == \"John Smith\"\n    assert inst.code.text == \"Horse\"\n    assert inst.id == \"101\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://someveterinarianclinic.org/fhir/NamingSystem/herds\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"John's herd\"\n    assert inst.quantity == 25\n    assert inst.text.status == \"additional\"\n    assert inst.type == \"animal\"\n\n\ndef test_group_1(base_settings):\n    \"\"\"No. 1 tests collection for Group.\n    Test File: group-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"group-example.json\"\n    inst = group.Group.model_validate_json(filename.read_bytes())\n    assert \"Group\" == inst.get_resource_type()\n\n    impl_group_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Group\" == data[\"resourceType\"]\n\n    inst2 = group.Group(**data)\n    impl_group_1(inst2)\n\n\ndef impl_group_2(inst):\n    assert inst.actual is True\n    assert inst.id == \"102\"\n    assert inst.member[0].entity.reference == \"Patient/pat1\"\n    assert (\n        inst.member[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-10-08\"}\n        ).valueDateTime\n    )\n    assert inst.member[1].entity.reference == \"Patient/pat2\"\n    assert inst.member[1].inactive is True\n    assert (\n        inst.member[1].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-04-02\"}\n        ).valueDateTime\n    )\n    assert inst.member[2].entity.reference == \"Patient/pat3\"\n    assert (\n        inst.member[2].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-06\"}\n        ).valueDateTime\n    )\n    assert inst.member[3].entity.reference == \"Patient/pat4\"\n    assert (\n        inst.member[3].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-06\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"additional\"\n    assert inst.type == \"person\"\n\n\ndef test_group_2(base_settings):\n    \"\"\"No. 2 tests collection for Group.\n    Test File: group-example-member.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"group-example-member.json\"\n    inst = group.Group.model_validate_json(filename.read_bytes())\n    assert \"Group\" == inst.get_resource_type()\n\n    impl_group_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Group\" == data[\"resourceType\"]\n\n    inst2 = group.Group(**data)\n    impl_group_2(inst2)\n\n\ndef impl_group_3(inst):\n    assert inst.actual is True\n    assert inst.characteristic[0].code.coding[0].code == \"attributed-to\"\n    assert (\n        inst.characteristic[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].code.text == \"Patients primarily attributed to\"\n    assert inst.characteristic[0].exclude is False\n    assert inst.characteristic[0].valueReference.reference == \"Practitioner/123\"\n    assert inst.id == \"example-patientlist\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"additional\"\n    assert inst.type == \"person\"\n\n\ndef test_group_3(base_settings):\n    \"\"\"No. 3 tests collection for Group.\n    Test File: group-example-patientlist.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"group-example-patientlist.json\"\n    inst = group.Group.model_validate_json(filename.read_bytes())\n    assert \"Group\" == inst.get_resource_type()\n\n    impl_group_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Group\" == data[\"resourceType\"]\n\n    inst2 = group.Group(**data)\n    impl_group_3(inst2)\n\n\ndef impl_group_4(inst):\n    assert inst.active is True\n    assert inst.actual is True\n    assert inst.characteristic[0].code.text == \"gender\"\n    assert inst.characteristic[0].exclude is False\n    assert inst.characteristic[0].valueCodeableConcept.text == \"female\"\n    assert inst.code.coding[0].code == \"388393002\"\n    assert inst.code.coding[0].display == \"Genus Sus (organism)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[1].code == \"POR\"\n    assert inst.code.coding[1].display == \"porcine\"\n    assert (\n        inst.code.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.aphis.usda.gov\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Porcine\"\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/owner\"}\n        ).valueUri\n    )\n    assert inst.extension[0].valueReference.display == \"Peter Chalmers\"\n    assert inst.extension[0].valueReference.reference == \"RelatedPerson/peter\"\n    assert inst.id == \"herd1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://vetmed.iastate.edu/vdl\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"20171120-1234\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Breeding herd\"\n    assert inst.quantity == 2500\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"animal\"\n\n\ndef test_group_4(base_settings):\n    \"\"\"No. 4 tests collection for Group.\n    Test File: group-example-herd1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"group-example-herd1.json\"\n    inst = group.Group.model_validate_json(filename.read_bytes())\n    assert \"Group\" == inst.get_resource_type()\n\n    impl_group_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Group\" == data[\"resourceType\"]\n\n    inst2 = group.Group(**data)\n    impl_group_4(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_guidanceresponse.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/GuidanceResponse\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import guidanceresponse\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_guidanceresponse_1(inst):\n    assert inst.contained[0].id == \"outputParameters1\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"guidanceResponse1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.moduleUri\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://someguidelineprovider.org/radiology-appropriateness-guidelines.html\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-10T16:02:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.outputParameters.reference == \"#outputParameters1\"\n    assert inst.performer.reference == \"Device/software\"\n    assert inst.reasonCode[0].text == \"Guideline Appropriate Ordering Assessment\"\n    assert (\n        inst.requestIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.requestIdentifier.value == \"guidanceRequest1\"\n    assert inst.status == \"success\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_guidanceresponse_1(base_settings):\n    \"\"\"No. 1 tests collection for GuidanceResponse.\n    Test File: guidanceresponse-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"guidanceresponse-example.json\"\n    inst = guidanceresponse.GuidanceResponse.model_validate_json(filename.read_bytes())\n    assert \"GuidanceResponse\" == inst.get_resource_type()\n\n    impl_guidanceresponse_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"GuidanceResponse\" == data[\"resourceType\"]\n\n    inst2 = guidanceresponse.GuidanceResponse(**data)\n    impl_guidanceresponse_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_healthcareservice.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/HealthcareService\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import healthcareservice\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_healthcareservice_1(inst):\n    assert inst.active is True\n    assert inst.appointmentRequired is False\n    assert (\n        inst.availabilityExceptions\n        == \"Reduced capacity is available during the Christmas period\"\n    )\n    assert inst.availableTime[0].allDay is True\n    assert inst.availableTime[0].daysOfWeek[0] == \"wed\"\n    assert (\n        inst.availableTime[1].availableEndTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"05:30:00\"}).valueTime\n    )\n    assert (\n        inst.availableTime[1].availableStartTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"08:30:00\"}).valueTime\n    )\n    assert inst.availableTime[1].daysOfWeek[0] == \"mon\"\n    assert inst.availableTime[1].daysOfWeek[1] == \"tue\"\n    assert inst.availableTime[1].daysOfWeek[2] == \"thu\"\n    assert inst.availableTime[1].daysOfWeek[3] == \"fri\"\n    assert (\n        inst.availableTime[2].availableEndTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"04:30:00\"}).valueTime\n    )\n    assert (\n        inst.availableTime[2].availableStartTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"09:30:00\"}).valueTime\n    )\n    assert inst.availableTime[2].daysOfWeek[0] == \"sat\"\n    assert inst.availableTime[2].daysOfWeek[1] == \"fri\"\n    assert inst.category[0].coding[0].code == \"8\"\n    assert inst.category[0].coding[0].display == \"Counselling\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/service-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Counselling\"\n    assert inst.characteristic[0].coding[0].display == \"Wheelchair access\"\n    assert inst.comment == (\n        \"Providing Specialist psychology services to the greater Den \"\n        \"Burg area, many years of experience dealing with PTSD issues\"\n    )\n    assert inst.contained[0].id == \"DenBurg\"\n    assert inst.coverageArea[0].display == \"Greater Denburg area\"\n    assert inst.coverageArea[0].reference == \"#DenBurg\"\n    assert inst.eligibility[0].code.coding[0].display == \"DVA Required\"\n    assert inst.eligibility[0].comment == (\n        \"Evidence of application for DVA status may be sufficient for\"\n        \" commencing assessment\"\n    )\n    assert inst.endpoint[0].reference == \"Endpoint/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/shared-ids\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"HS-12\"\n    assert inst.location[0].reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Consulting psychologists and/or psychology services\"\n    assert inst.notAvailable[0].description == \"Christmas/Boxing Day\"\n    assert (\n        inst.notAvailable[0].during.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-26\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.notAvailable[0].during.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-25\"}\n        ).valueDateTime\n    )\n    assert inst.notAvailable[1].description == \"New Years Day\"\n    assert (\n        inst.notAvailable[1].during.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.notAvailable[1].during.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.program[0].text == \"PTSD outreach\"\n    assert inst.providedBy.display == \"Burgers University Medical Center\"\n    assert inst.providedBy.reference == \"Organization/f001\"\n    assert inst.referralMethod[0].coding[0].code == \"phone\"\n    assert inst.referralMethod[0].coding[0].display == \"Phone\"\n    assert inst.referralMethod[1].coding[0].code == \"fax\"\n    assert inst.referralMethod[1].coding[0].display == \"Fax\"\n    assert inst.referralMethod[2].coding[0].code == \"elec\"\n    assert inst.referralMethod[2].coding[0].display == \"Secure Messaging\"\n    assert inst.referralMethod[3].coding[0].code == \"semail\"\n    assert inst.referralMethod[3].coding[0].display == \"Secure Email\"\n    assert inst.serviceProvisionCode[0].coding[0].code == \"cost\"\n    assert inst.serviceProvisionCode[0].coding[0].display == \"Fees apply\"\n    assert (\n        inst.serviceProvisionCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/service-provision-conditions\"\n            }\n        ).valueUri\n    )\n    assert inst.specialty[0].coding[0].code == \"47505003\"\n    assert inst.specialty[0].coding[0].display == \"Posttraumatic stress disorder\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"(555) silent\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"directaddress@example.com\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"394913002\"\n    assert inst.type[0].coding[0].display == \"Psychotherapy\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.type[1].coding[0].code == \"394587001\"\n    assert inst.type[1].coding[0].display == \"Psychiatry\"\n    assert (\n        inst.type[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_healthcareservice_1(base_settings):\n    \"\"\"No. 1 tests collection for HealthcareService.\n    Test File: healthcareservice-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"healthcareservice-example.json\"\n    inst = healthcareservice.HealthcareService.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"HealthcareService\" == inst.get_resource_type()\n\n    impl_healthcareservice_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"HealthcareService\" == data[\"resourceType\"]\n\n    inst2 = healthcareservice.HealthcareService(**data)\n    impl_healthcareservice_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_imagingstudy.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImagingStudy\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import imagingstudy\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_imagingstudy_1(inst):\n    assert inst.basedOn[0].reference == \"ServiceRequest/example\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.endpoint[0].reference == \"Endpoint/example-wadors\"\n    assert inst.id == \"example-xr\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == (\n        \"urn:oid:2.16.124.113543.6003.1154777499.30246.19789.35034300\" \"46\"\n    )\n    assert inst.identifier[1].assigner.reference == \"Organization/dicom-organization\"\n    assert inst.identifier[1].type.coding[0].code == \"ACSN\"\n    assert (\n        inst.identifier[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"usual\"\n    assert inst.identifier[1].value == \"W12342398\"\n    assert inst.identifier[2].assigner.reference == \"Organization/dicom-organization\"\n    assert inst.identifier[2].use == \"secondary\"\n    assert inst.identifier[2].value == \"55551234\"\n    assert inst.interpreter[0].reference == \"Practitioner/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.modality[0].code == \"DX\"\n    assert (\n        inst.modality[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"XR Wrist 3+ Views\"\n    assert inst.numberOfInstances == 2\n    assert inst.numberOfSeries == 1\n    assert inst.procedureCode[0].coding[0].code == \"RPID2589\"\n    assert inst.procedureCode[0].coding[0].display == \"XR Wrist 3+ Views\"\n    assert (\n        inst.procedureCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.radlex.org\"}\n        ).valueUri\n    )\n    assert inst.procedureCode[0].text == \"XR Wrist 3+ Views\"\n    assert inst.procedureReference.reference == \"Procedure/example\"\n    assert inst.reasonCode[0].coding[0].code == \"357009\"\n    assert (\n        inst.reasonCode[0].coding[0].display\n        == \"Closed fracture of trapezoidal bone of wrist\"\n    )\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.referrer.reference == \"Practitioner/example\"\n    assert inst.series[0].bodySite.code == \"T-15460\"\n    assert inst.series[0].bodySite.display == \"Wrist Joint\"\n    assert (\n        inst.series[0].bodySite.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.series[0].description == \"XR Wrist 3+ Views\"\n    assert inst.series[0].endpoint[0].reference == \"Endpoint/example-wadors\"\n    assert inst.series[0].instance[0].number == 1\n    assert (\n        inst.series[0].instance[0].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.2\"\n    )\n    assert (\n        inst.series[0].instance[0].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.series[0].instance[0].title == \"PA VIEW\"\n    assert (\n        inst.series[0].instance[0].uid\n        == \"2.16.124.113543.6003.1154777499.30246.19789.3503430045.1.1\"\n    )\n    assert inst.series[0].instance[1].number == 2\n    assert (\n        inst.series[0].instance[1].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.2\"\n    )\n    assert (\n        inst.series[0].instance[1].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.series[0].instance[1].title == \"LL VIEW\"\n    assert (\n        inst.series[0].instance[1].uid\n        == \"2.16.124.113543.6003.1154777499.30246.19789.3503430045.1.2\"\n    )\n    assert inst.series[0].laterality.code == \"419161000\"\n    assert inst.series[0].laterality.display == \"Unilateral left\"\n    assert (\n        inst.series[0].laterality.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.series[0].modality.code == \"DX\"\n    assert (\n        inst.series[0].modality.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.series[0].number == 3\n    assert inst.series[0].numberOfInstances == 2\n    assert inst.series[0].performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.series[0].performer[0].function.coding[0].code == \"PRF\"\n    assert (\n        inst.series[0].performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert (\n        inst.series[0].started\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-01-01T11:01:20+03:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.series[0].uid == \"2.16.124.113543.6003.1154777499.30246.19789.3503430045.1\"\n    )\n    assert (\n        inst.started\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-01T11:01:20+03:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"available\"\n    assert inst.subject.reference == \"Patient/dicom\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">XR Wrist 3+ '\n        \"Views. John Smith (MRN: 09236). Accession: W12342398. \"\n        \"Performed: 2017-01-01. 1 series, 2 images.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_imagingstudy_1(base_settings):\n    \"\"\"No. 1 tests collection for ImagingStudy.\n    Test File: imagingstudy-example-xr.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"imagingstudy-example-xr.json\"\n    inst = imagingstudy.ImagingStudy.model_validate_json(filename.read_bytes())\n    assert \"ImagingStudy\" == inst.get_resource_type()\n\n    impl_imagingstudy_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImagingStudy\" == data[\"resourceType\"]\n\n    inst2 = imagingstudy.ImagingStudy(**data)\n    impl_imagingstudy_1(inst2)\n\n\ndef impl_imagingstudy_2(inst):\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[0].value == (\n        \"urn:oid:2.16.124.113543.6003.1154777499.30246.19789.35034300\" \"45\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.numberOfInstances == 1\n    assert inst.numberOfSeries == 1\n    assert inst.series[0].bodySite.code == \"67734004\"\n    assert inst.series[0].bodySite.display == \"Upper Trunk Structure\"\n    assert (\n        inst.series[0].bodySite.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.series[0].description == \"CT Surview 180\"\n    assert inst.series[0].instance[0].number == 1\n    assert (\n        inst.series[0].instance[0].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.2\"\n    )\n    assert (\n        inst.series[0].instance[0].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.series[0].instance[0].uid\n        == \"2.16.124.113543.6003.189642796.63084.16748.2599092903\"\n    )\n    assert inst.series[0].modality.code == \"CT\"\n    assert (\n        inst.series[0].modality.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.series[0].number == 3\n    assert inst.series[0].numberOfInstances == 1\n    assert (\n        inst.series[0].uid == \"2.16.124.113543.6003.2588828330.45298.17418.2723805630\"\n    )\n    assert (\n        inst.started\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-01-01T11:01:20+03:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"available\"\n    assert inst.subject.reference == \"Patient/dicom\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">CT Chest.  John '\n        \"Smith (MRN: 09236). Accession: W12342398. Performed: \"\n        \"2011-01-01. 3 series, 12 images.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_imagingstudy_2(base_settings):\n    \"\"\"No. 2 tests collection for ImagingStudy.\n    Test File: imagingstudy-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"imagingstudy-example.json\"\n    inst = imagingstudy.ImagingStudy.model_validate_json(filename.read_bytes())\n    assert \"ImagingStudy\" == inst.get_resource_type()\n\n    impl_imagingstudy_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImagingStudy\" == data[\"resourceType\"]\n\n    inst2 = imagingstudy.ImagingStudy(**data)\n    impl_imagingstudy_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_immunization.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Immunization\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import immunization\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_immunization_1(inst):\n    assert inst.doseQuantity.code == \"mg\"\n    assert (\n        inst.doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.doseQuantity.value) == float(5)\n    assert inst.education[0].documentType == \"253088698300010311120702\"\n    assert (\n        inst.education[0].presentationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-10\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.education[0].publicationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-07-02\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.expirationDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-02-15\"}).valueDate\n    )\n    assert inst.fundingSource.coding[0].code == \"private\"\n    assert (\n        inst.fundingSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-funding-source\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.isSubpotent is True\n    assert inst.location.reference == \"Location/1\"\n    assert inst.lotNumber == \"AAJN11K\"\n    assert inst.manufacturer.reference == \"Organization/hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Notes on adminstration of vaccine\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-10\"}\n        ).valueDateTime\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.performer[0].function.coding[0].code == \"OP\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.performer[1].actor.reference == \"Practitioner/example\"\n    assert inst.performer[1].function.coding[0].code == \"AP\"\n    assert (\n        inst.performer[1].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.primarySource is True\n    assert inst.programEligibility[0].coding[0].code == \"ineligible\"\n    assert (\n        inst.programEligibility[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-program-eligibility\"\n            }\n        ).valueUri\n    )\n    assert inst.reasonCode[0].coding[0].code == \"429060002\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.route.coding[0].code == \"IM\"\n    assert inst.route.coding[0].display == \"Injection, intramuscular\"\n    assert (\n        inst.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.site.coding[0].code == \"LA\"\n    assert inst.site.coding[0].display == \"left arm\"\n    assert (\n        inst.site.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActSite\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.text.status == \"generated\"\n    assert inst.vaccineCode.coding[0].code == \"FLUVAX\"\n    assert (\n        inst.vaccineCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.36.1.2001.1005.17\"}\n        ).valueUri\n    )\n    assert inst.vaccineCode.text == \"Fluvax (Influenza)\"\n\n\ndef test_immunization_1(base_settings):\n    \"\"\"No. 1 tests collection for Immunization.\n    Test File: immunization-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"immunization-example.json\"\n    inst = immunization.Immunization.model_validate_json(filename.read_bytes())\n    assert \"Immunization\" == inst.get_resource_type()\n\n    impl_immunization_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Immunization\" == data[\"resourceType\"]\n\n    inst2 = immunization.Immunization(**data)\n    impl_immunization_1(inst2)\n\n\ndef impl_immunization_2(inst):\n    assert inst.id == \"historical\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.location.reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Notes on adminstration of a historical vaccine\"\n    assert inst.occurrenceString == \"January 2012\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.primarySource is False\n    assert inst.reportOrigin.coding[0].code == \"record\"\n    assert (\n        inst.reportOrigin.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-origin\"}\n        ).valueUri\n    )\n    assert inst.reportOrigin.text == \"Written Record\"\n    assert inst.status == \"completed\"\n    assert inst.text.status == \"generated\"\n    assert inst.vaccineCode.coding[0].code == \"GNFLU\"\n    assert (\n        inst.vaccineCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.36.1.2001.1005.17\"}\n        ).valueUri\n    )\n    assert inst.vaccineCode.text == \"Influenza\"\n\n\ndef test_immunization_2(base_settings):\n    \"\"\"No. 2 tests collection for Immunization.\n    Test File: immunization-example-historical.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"immunization-example-historical.json\"\n    )\n    inst = immunization.Immunization.model_validate_json(filename.read_bytes())\n    assert \"Immunization\" == inst.get_resource_type()\n\n    impl_immunization_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Immunization\" == data[\"resourceType\"]\n\n    inst2 = immunization.Immunization(**data)\n    impl_immunization_2(inst2)\n\n\ndef impl_immunization_3(inst):\n    assert inst.doseQuantity.code == \"mg\"\n    assert (\n        inst.doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.doseQuantity.value) == float(5)\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.expirationDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2018-12-15\"}).valueDate\n    )\n    assert inst.fundingSource.coding[0].code == \"private\"\n    assert (\n        inst.fundingSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-funding-source\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"protocol\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.isSubpotent is False\n    assert inst.location.reference == \"Location/1\"\n    assert inst.lotNumber == \"PT123F\"\n    assert inst.manufacturer.reference == \"Organization/hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-06-18\"}\n        ).valueDateTime\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.performer[0].function.coding[0].code == \"OP\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.performer[1].actor.reference == \"Practitioner/example\"\n    assert inst.performer[1].function.coding[0].code == \"AP\"\n    assert (\n        inst.performer[1].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.primarySource is True\n    assert inst.programEligibility[0].coding[0].code == \"ineligible\"\n    assert (\n        inst.programEligibility[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-program-eligibility\"\n            }\n        ).valueUri\n    )\n    assert inst.protocolApplied[0].doseNumberPositiveInt == 1\n    assert inst.protocolApplied[0].series == \"2-dose\"\n    assert inst.protocolApplied[0].targetDisease[0].coding[0].code == \"40468003\"\n    assert (\n        inst.protocolApplied[0].targetDisease[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.protocolApplied[1].doseNumberPositiveInt == 2\n    assert inst.protocolApplied[1].series == \"3-dose\"\n    assert inst.protocolApplied[1].targetDisease[0].coding[0].code == \"66071002\"\n    assert (\n        inst.protocolApplied[1].targetDisease[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.route.coding[0].code == \"IM\"\n    assert inst.route.coding[0].display == \"Injection, intramuscular\"\n    assert (\n        inst.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.site.coding[0].code == \"LA\"\n    assert inst.site.coding[0].display == \"left arm\"\n    assert (\n        inst.site.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActSite\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.text.status == \"generated\"\n    assert inst.vaccineCode.coding[0].code == \"104\"\n    assert (\n        inst.vaccineCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/cvx\"}\n        ).valueUri\n    )\n    assert inst.vaccineCode.text == \"Twinrix (HepA/HepB)\"\n\n\ndef test_immunization_3(base_settings):\n    \"\"\"No. 3 tests collection for Immunization.\n    Test File: immunization-example-protocol.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"immunization-example-protocol.json\"\n    inst = immunization.Immunization.model_validate_json(filename.read_bytes())\n    assert \"Immunization\" == inst.get_resource_type()\n\n    impl_immunization_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Immunization\" == data[\"resourceType\"]\n\n    inst2 = immunization.Immunization(**data)\n    impl_immunization_3(inst2)\n\n\ndef impl_immunization_4(inst):\n    assert inst.id == \"notGiven\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-10\"}\n        ).valueDateTime\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.primarySource is True\n    assert inst.status == \"not-done\"\n    assert inst.statusReason.coding[0].code == \"MEDPREC\"\n    assert inst.statusReason.coding[0].display == \"medical precaution\"\n    assert (\n        inst.statusReason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.vaccineCode.coding[0].code == \"01\"\n    assert inst.vaccineCode.coding[0].display == \"DTP\"\n    assert (\n        inst.vaccineCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/cvx\"}\n        ).valueUri\n    )\n\n\ndef test_immunization_4(base_settings):\n    \"\"\"No. 4 tests collection for Immunization.\n    Test File: immunization-example-refused.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"immunization-example-refused.json\"\n    inst = immunization.Immunization.model_validate_json(filename.read_bytes())\n    assert \"Immunization\" == inst.get_resource_type()\n\n    impl_immunization_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Immunization\" == data[\"resourceType\"]\n\n    inst2 = immunization.Immunization(**data)\n    impl_immunization_4(inst2)\n\n\ndef impl_immunization_5(inst):\n    assert inst.doseQuantity.code == \"ml\"\n    assert (\n        inst.doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.doseQuantity.value) == float(0.5)\n    assert inst.education[0].documentType == \"253088698300010311120702\"\n    assert (\n        inst.education[0].presentationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-10\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.education[0].publicationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-07-02\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.expirationDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-02-28\"}).valueDate\n    )\n    assert inst.fundingSource.coding[0].code == \"private\"\n    assert (\n        inst.fundingSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-funding-source\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"subpotent\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.isSubpotent is False\n    assert inst.location.reference == \"Location/1\"\n    assert inst.lotNumber == \"AAJN11K\"\n    assert inst.manufacturer.reference == \"Organization/hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Notes on adminstration of vaccine\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.performer[0].function.coding[0].code == \"OP\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.performer[1].actor.reference == \"Practitioner/example\"\n    assert inst.performer[1].function.coding[0].code == \"AP\"\n    assert (\n        inst.performer[1].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.primarySource is True\n    assert inst.programEligibility[0].coding[0].code == \"ineligible\"\n    assert (\n        inst.programEligibility[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-program-eligibility\"\n            }\n        ).valueUri\n    )\n    assert inst.route.coding[0].code == \"IM\"\n    assert inst.route.coding[0].display == \"Injection, intramuscular\"\n    assert (\n        inst.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.site.coding[0].code == \"LT\"\n    assert inst.site.coding[0].display == \"left thigh\"\n    assert (\n        inst.site.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActSite\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.subpotentReason[0].coding[0].code == \"partial\"\n    assert (\n        inst.subpotentReason[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-subpotent-reason\"\n            }\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.vaccineCode.coding[0].code == \"GNHEP\"\n    assert (\n        inst.vaccineCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.36.1.2001.1005.17\"}\n        ).valueUri\n    )\n    assert inst.vaccineCode.text == \"Hepatitis B\"\n\n\ndef test_immunization_5(base_settings):\n    \"\"\"No. 5 tests collection for Immunization.\n    Test File: immunization-example-subpotent.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"immunization-example-subpotent.json\"\n    )\n    inst = immunization.Immunization.model_validate_json(filename.read_bytes())\n    assert \"Immunization\" == inst.get_resource_type()\n\n    impl_immunization_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Immunization\" == data[\"resourceType\"]\n\n    inst2 = immunization.Immunization(**data)\n    impl_immunization_5(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_immunizationevaluation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import immunizationevaluation\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_immunizationevaluation_1(inst):\n    assert inst.authority.reference == \"Organization/hl7\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-10\"}\n        ).valueDateTime\n    )\n    assert inst.doseNumberPositiveInt == 1\n    assert inst.doseStatus.coding[0].code == \"valid\"\n    assert inst.doseStatus.coding[0].display == \"Valid\"\n    assert (\n        inst.doseStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.immunizationEvent.reference == \"Immunization/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.series == \"Vaccination Series 1\"\n    assert inst.seriesDosesPositiveInt == 3\n    assert inst.status == \"completed\"\n    assert inst.targetDisease.coding[0].code == \"1857005\"\n    assert (\n        inst.targetDisease.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_immunizationevaluation_1(base_settings):\n    \"\"\"No. 1 tests collection for ImmunizationEvaluation.\n    Test File: immunizationevaluation-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"immunizationevaluation-example.json\"\n    )\n    inst = immunizationevaluation.ImmunizationEvaluation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ImmunizationEvaluation\" == inst.get_resource_type()\n\n    impl_immunizationevaluation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImmunizationEvaluation\" == data[\"resourceType\"]\n\n    inst2 = immunizationevaluation.ImmunizationEvaluation(**data)\n    impl_immunizationevaluation_1(inst2)\n\n\ndef impl_immunizationevaluation_2(inst):\n    assert inst.authority.reference == \"Organization/hl7\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-10\"}\n        ).valueDateTime\n    )\n    assert inst.doseNumberPositiveInt == 2\n    assert inst.doseStatus.coding[0].code == \"notvalid\"\n    assert inst.doseStatus.coding[0].display == \"Not Valid\"\n    assert (\n        inst.doseStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status\"\n            }\n        ).valueUri\n    )\n    assert inst.doseStatusReason[0].coding[0].code == \"outsidesched\"\n    assert (\n        inst.doseStatusReason[0].coding[0].display\n        == \"Administered outside recommended schedule\"\n    )\n    assert (\n        inst.doseStatusReason[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status-reason\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"notValid\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.immunizationEvent.reference == \"Immunization/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.series == \"Vaccination Series 1\"\n    assert inst.seriesDosesPositiveInt == 3\n    assert inst.status == \"completed\"\n    assert inst.targetDisease.coding[0].code == \"1857005\"\n    assert (\n        inst.targetDisease.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_immunizationevaluation_2(base_settings):\n    \"\"\"No. 2 tests collection for ImmunizationEvaluation.\n    Test File: immunizationevaluation-example-notvalid.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"immunizationevaluation-example-notvalid.json\"\n    )\n    inst = immunizationevaluation.ImmunizationEvaluation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ImmunizationEvaluation\" == inst.get_resource_type()\n\n    impl_immunizationevaluation_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImmunizationEvaluation\" == data[\"resourceType\"]\n\n    inst2 = immunizationevaluation.ImmunizationEvaluation(**data)\n    impl_immunizationevaluation_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_immunizationrecommendation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import immunizationrecommendation\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_immunizationrecommendation_1(inst):\n    assert inst.authority.reference == \"Organization/hl7\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-09T11:04:15.817-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1235\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.recommendation[0].dateCriterion[0].code.coding[0].code == \"earliest\"\n    assert (\n        inst.recommendation[0].dateCriterion[0].code.coding[0].display\n        == \"Earliest Date\"\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[0].value\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-01T00:00:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.recommendation[0].dateCriterion[1].code.coding[0].code == \"recommended\"\n    assert (\n        inst.recommendation[0].dateCriterion[1].code.coding[0].display == \"Recommended\"\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[1].value\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-01T00:00:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.recommendation[0].dateCriterion[2].code.coding[0].code == \"overdue\"\n    assert (\n        inst.recommendation[0].dateCriterion[2].code.coding[0].display\n        == \"Past Due Date\"\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[2].value\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-12-28T00:00:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.recommendation[0].description == \"First sequence in protocol\"\n    assert inst.recommendation[0].doseNumberPositiveInt == 1\n    assert inst.recommendation[0].forecastStatus.text == \"Not Complete\"\n    assert inst.recommendation[0].series == \"Vaccination Series 1\"\n    assert inst.recommendation[0].seriesDosesPositiveInt == 3\n    assert (\n        inst.recommendation[0].supportingImmunization[0].reference\n        == \"Immunization/example\"\n    )\n    assert (\n        inst.recommendation[0].supportingPatientInformation[0].reference\n        == \"Observation/example\"\n    )\n    assert inst.recommendation[0].vaccineCode[0].coding[0].code == \"14745005\"\n    assert (\n        inst.recommendation[0].vaccineCode[0].coding[0].display == \"Hepatitis A vaccine\"\n    )\n    assert (\n        inst.recommendation[0].vaccineCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Authored by ' \"Joginder Madra</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_immunizationrecommendation_1(base_settings):\n    \"\"\"No. 1 tests collection for ImmunizationRecommendation.\n    Test File: immunizationrecommendation-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"immunizationrecommendation-example.json\"\n    )\n    inst = immunizationrecommendation.ImmunizationRecommendation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ImmunizationRecommendation\" == inst.get_resource_type()\n\n    impl_immunizationrecommendation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImmunizationRecommendation\" == data[\"resourceType\"]\n\n    inst2 = immunizationrecommendation.ImmunizationRecommendation(**data)\n    impl_immunizationrecommendation_1(inst2)\n\n\ndef impl_immunizationrecommendation_2(inst):\n    assert inst.authority.reference == \"Organization/hl7\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-09T11:04:15.817-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1235\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.recommendation[0].dateCriterion[0].code.coding[0].code == \"30981-5\"\n    assert (\n        inst.recommendation[0].dateCriterion[0].code.coding[0].display\n        == \"Earliest date to give\"\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[0].value\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-01T00:00:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.recommendation[0].dateCriterion[1].code.coding[0].code == \"recommended\"\n    assert (\n        inst.recommendation[0].dateCriterion[1].code.coding[0].display == \"Recommended\"\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[1].value\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-01T00:00:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.recommendation[0].dateCriterion[2].code.coding[0].code == \"overdue\"\n    assert (\n        inst.recommendation[0].dateCriterion[2].code.coding[0].display\n        == \"Past Due Date\"\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[2].value\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-12-28T00:00:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.recommendation[0].description == \"First sequence in protocol\"\n    assert inst.recommendation[0].doseNumberPositiveInt == 1\n    assert inst.recommendation[0].forecastStatus.text == \"Not Complete\"\n    assert inst.recommendation[0].series == \"Vaccination Series 1\"\n    assert inst.recommendation[0].seriesDosesPositiveInt == 3\n    assert (\n        inst.recommendation[0].supportingImmunization[0].reference\n        == \"Immunization/example\"\n    )\n    assert (\n        inst.recommendation[0].supportingPatientInformation[0].reference\n        == \"Observation/example\"\n    )\n    assert inst.recommendation[0].targetDisease.coding[0].code == \"40468003\"\n    assert (\n        inst.recommendation[0].targetDisease.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Authored by ' \"Joginder Madra</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_immunizationrecommendation_2(base_settings):\n    \"\"\"No. 2 tests collection for ImmunizationRecommendation.\n    Test File: immunizationrecommendation-example-target-disease.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"immunizationrecommendation-example-target-disease.json\"\n    )\n    inst = immunizationrecommendation.ImmunizationRecommendation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ImmunizationRecommendation\" == inst.get_resource_type()\n\n    impl_immunizationrecommendation_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImmunizationRecommendation\" == data[\"resourceType\"]\n\n    inst2 = immunizationrecommendation.ImmunizationRecommendation(**data)\n    impl_immunizationrecommendation_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_implementationguide.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImplementationGuide\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import implementationguide\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_implementationguide_1(inst):\n    assert inst.contact[0].name == \"ONC\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://www.healthit.gov\"\n    assert inst.contact[1].name == \"HL7\"\n    assert inst.contact[1].telecom[0].system == \"url\"\n    assert inst.contact[1].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.copyright == \"Published by ONC under the standard FHIR license (CC0)\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.definition.grouping[0].description\n        == \"Base package (not broken up into multiple packages)\"\n    )\n    assert inst.definition.grouping[0].name == \"test\"\n    assert inst.definition.page.generation == \"html\"\n    assert (\n        inst.definition.page.nameUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"patient-example.html\"}\n        ).valueUrl\n    )\n    assert inst.definition.page.page[0].generation == \"html\"\n    assert (\n        inst.definition.page.page[0].nameUrl\n        == ExternalValidatorModel.model_validate({\"valueUrl\": \"list.html\"}).valueUrl\n    )\n    assert inst.definition.page.page[0].title == \"Value Set Page\"\n    assert inst.definition.page.title == \"Example Patient Page\"\n    assert inst.definition.parameter[0].code == \"apply\"\n    assert inst.definition.parameter[0].value == \"version\"\n    assert (\n        inst.definition.resource[0].description\n        == \"A test example to show how an implementation guide works\"\n    )\n    assert (\n        inst.definition.resource[0].exampleCanonical\n        == \"http://hl7.org/fhir/us/core/StructureDefinition/patient\"\n    )\n    assert inst.definition.resource[0].name == \"Test Example\"\n    assert inst.definition.resource[0].reference.reference == \"Patient/test\"\n    assert inst.dependsOn[0].uri == \"http://hl7.org/fhir/ImplementationGuide/uscore\"\n    assert inst.experimental is False\n    assert inst.fhirVersion[0] == \"4.3.0\"\n    assert (\n        inst.global_fhir[0].profile\n        == \"http://hl7.org/fhir/us/core/StructureDefinition/patient\"\n    )\n    assert inst.global_fhir[0].type == \"Patient\"\n    assert inst.id == \"example\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.license == \"CC0-1.0\"\n    assert inst.manifest.image[0] == \"fhir.png\"\n    assert inst.manifest.other[0] == \"fhir.css\"\n    assert inst.manifest.page[0].anchor[0] == \"patient-test\"\n    assert inst.manifest.page[0].anchor[1] == \"tx\"\n    assert inst.manifest.page[0].anchor[2] == \"uml\"\n    assert inst.manifest.page[0].name == \"patient-test.html\"\n    assert inst.manifest.page[0].title == \"Test Patient Example\"\n    assert (\n        inst.manifest.rendering\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://hl7.org/fhir/us/daf\"}\n        ).valueUrl\n    )\n    assert (\n        inst.manifest.resource[0].exampleCanonical\n        == \"http://hl7.org/fhir/us/core/StructureDefinition/patient\"\n    )\n    assert inst.manifest.resource[0].reference.reference == \"Patient/test\"\n    assert (\n        inst.manifest.resource[0].relativePath\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"patient-test.html#patient-test\"}\n        ).valueUrl\n    )\n    assert inst.name == \"Data Access Framework (DAF)\"\n    assert inst.packageId == \"hl7.fhir.us.daf\"\n    assert inst.publisher == \"ONC / HL7 Joint project\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/us/daf\"}\n        ).valueUri\n    )\n    assert inst.version == \"0\"\n\n\ndef test_implementationguide_1(base_settings):\n    \"\"\"No. 1 tests collection for ImplementationGuide.\n    Test File: implementationguide-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"implementationguide-example.json\"\n    inst = implementationguide.ImplementationGuide.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ImplementationGuide\" == inst.get_resource_type()\n\n    impl_implementationguide_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImplementationGuide\" == data[\"resourceType\"]\n\n    inst2 = implementationguide.ImplementationGuide(**data)\n    impl_implementationguide_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_ingredient.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Ingredient\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import ingredient\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_ingredient_1(inst):\n    assert inst.id == \"example\"\n    assert inst.manufacturer[0].manufacturer.reference == \"Organization/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.role.coding[0].code == \"ActiveBase\"\n    assert (\n        inst.role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/ingredientRole\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.substance.code.concept.coding[0].code == \"EQUIXABAN\"\n    assert (\n        inst.substance.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/substance\"}\n        ).valueUri\n    )\n    assert inst.substance.strength[0].presentationRatio.denominator.code == \"{tablet}\"\n    assert (\n        inst.substance.strength[0].presentationRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.substance.strength[0].presentationRatio.denominator.unit == \"tablet\"\n    assert float(\n        inst.substance.strength[0].presentationRatio.denominator.value\n    ) == float(1)\n    assert inst.substance.strength[0].presentationRatio.numerator.code == \"mg\"\n    assert (\n        inst.substance.strength[0].presentationRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.substance.strength[0].presentationRatio.numerator.unit == \"mg\"\n    assert float(inst.substance.strength[0].presentationRatio.numerator.value) == float(\n        2.5\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_ingredient_1(base_settings):\n    \"\"\"No. 1 tests collection for Ingredient.\n    Test File: ingredient-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"ingredient-example.json\"\n    inst = ingredient.Ingredient.model_validate_json(filename.read_bytes())\n    assert \"Ingredient\" == inst.get_resource_type()\n\n    impl_ingredient_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Ingredient\" == data[\"resourceType\"]\n\n    inst2 = ingredient.Ingredient(**data)\n    impl_ingredient_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_insuranceplan.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/InsurancePlan\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import insuranceplan\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_insuranceplan_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"foo\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_insuranceplan_1(base_settings):\n    \"\"\"No. 1 tests collection for InsurancePlan.\n    Test File: insuranceplan-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"insuranceplan-example.json\"\n    inst = insuranceplan.InsurancePlan.model_validate_json(filename.read_bytes())\n    assert \"InsurancePlan\" == inst.get_resource_type()\n\n    impl_insuranceplan_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"InsurancePlan\" == data[\"resourceType\"]\n\n    inst2 = insuranceplan.InsurancePlan(**data)\n    impl_insuranceplan_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_invoice.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Invoice\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import invoice\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_invoice_1(inst):\n    assert inst.account.reference == \"Account/example\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-25T08:00:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://myHospital.org/Invoices\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"654321\"\n    assert (\n        inst.issuer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://myhospital/NamingSystem/departments\"}\n        ).valueUri\n    )\n    assert inst.issuer.identifier.value == \"CARD_INTERMEDIATE_CARE\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/example\"\n    assert inst.participant[0].role.coding[0].code == \"17561000\"\n    assert inst.participant[0].role.coding[0].display == \"Cardiologist\"\n    assert (\n        inst.participant[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.status == \"issued\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Example of ' \"Invoice</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.totalGross.currency == \"EUR\"\n    assert float(inst.totalGross.value) == float(48)\n    assert inst.totalNet.currency == \"EUR\"\n    assert float(inst.totalNet.value) == float(40)\n\n\ndef test_invoice_1(base_settings):\n    \"\"\"No. 1 tests collection for Invoice.\n    Test File: invoice-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"invoice-example.json\"\n    inst = invoice.Invoice.model_validate_json(filename.read_bytes())\n    assert \"Invoice\" == inst.get_resource_type()\n\n    impl_invoice_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Invoice\" == data[\"resourceType\"]\n\n    inst2 = invoice.Invoice(**data)\n    impl_invoice_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_library.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Library\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import library\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_library_1(inst):\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.content[0].contentType == \"application/xml\"\n    assert (\n        inst.content[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"elm/OMTK-modelinfo-0.1.0.xml\"}\n        ).valueUrl\n    )\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-05-05\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Opioid Management Terminology Knowledge Base Model \"\n        \"Definition for use in implementing CDC Opioid Prescribing \"\n        \"Guidelines.\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"omtk-modelinfo\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"OMTKModelInfo\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert inst.purpose == (\n        \"This library defines the Opioid Management Terminology \" \"Knowledge Base model\"\n    )\n    assert inst.status == \"active\"\n    assert inst.title == \"OMTK Model Info\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"model-definition\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/library-type\"}\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This library is used to resolve data elements in the Opioid \"\n        \"Management Terminology Knowledge Base model\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_library_1(base_settings):\n    \"\"\"No. 1 tests collection for Library.\n    Test File: library-omtk-modelinfo.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"library-omtk-modelinfo.json\"\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_1(inst2)\n\n\ndef impl_library_2(inst):\n    assert inst.content[0].contentType == \"text/cql\"\n    assert (\n        inst.content[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"library-hiv-indicators-content.cql\"}\n        ).valueUrl\n    )\n    assert inst.content[1].contentType == \"application/elm+xml\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-08-03\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"HIV Indicators Reporting Example\"\n    assert inst.experimental is True\n    assert inst.id == \"hiv-indicators\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ohie.org/Library/\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"hiv-indicators\"\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://wiki.ihe.net/index.php/Aggregate_Data_Exchange_-_HIV\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://wiki.ihe.net/index.php/Aggregate_Data_Exchange_-_HIV\"}\n        ).valueUrl\n    )\n    assert inst.status == \"draft\"\n    assert inst.title == \"HIV Indicators\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert inst.type.coding[0].display == \"Logic Library\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/library-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ohie.org/Library/hiv-indicators\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.0.0\"\n\n\ndef test_library_2(base_settings):\n    \"\"\"No. 2 tests collection for Library.\n    Test File: library-hiv-indicators.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"library-hiv-indicators.json\"\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_2(inst2)\n\n\ndef impl_library_3(inst):\n    assert inst.content[0].contentType == \"application/xml\"\n    assert (\n        inst.content[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://cqlrepository.org/quick-modelinfo.xml\"}\n        ).valueUrl\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-07-08\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Model definition for the QUICK Logical Model\"\n    assert inst.experimental is True\n    assert inst.id == \"library-quick-model-definition\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"QUICK\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"QUICK Model Definition\"\n    assert inst.topic[0].text == \"QUICK\"\n    assert inst.type.coding[0].code == \"model-definition\"\n    assert inst.version == \"1.0.0\"\n\n\ndef test_library_3(base_settings):\n    \"\"\"No. 3 tests collection for Library.\n    Test File: library-quick-model-definition.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"library-quick-model-definition.json\"\n    )\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_3(inst2)\n\n\ndef impl_library_4(inst):\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.content[0].contentType == \"application/elm+xml\"\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert inst.dataRequirement[0].codeFilter[0].path == \"medicationCodeableConcept\"\n    assert (\n        inst.dataRequirement[0].codeFilter[0].valueSet\n        == \"http://example.org/fhir/ValueSet/benzodiazepines\"\n    )\n    assert inst.dataRequirement[0].type == \"MedicationRequest\"\n    assert inst.dataRequirement[1].codeFilter[0].path == \"medicationCodeableConcept\"\n    assert inst.dataRequirement[1].codeFilter[0].valueSet == (\n        \"http://example.org/fhir/ValueSet/opioids-abused-in-\" \"ambulatory-care\"\n    )\n    assert inst.dataRequirement[1].type == \"MedicationRequest\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-25T13:49:09-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Opioid decision support logic to avoid prescribing opioid \"\n        \"pain medication and benzodiazepines concurrently whenever \"\n        \"possible.\"\n    )\n    assert inst.experimental is False\n    assert inst.id == \"opioidcds-recommendation-11\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"OpioidCDS_REC_11\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert inst.purpose == (\n        \"The purpose of this library is to determine whether opioid \"\n        \"pain medication and benzodiazepines have been prescribed \"\n        \"concurrently.\"\n    )\n    assert (\n        inst.relatedArtifact[0].display\n        == \"CDC guideline for prescribing opioids for chronic pain\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://example.org/fhir/Library/opioidcds-common\"\n    )\n    assert inst.relatedArtifact[1].type == \"depends-on\"\n    assert inst.status == \"active\"\n    assert inst.title == \"Opioid CDS Logic for recommendation #11\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert inst.type.coding[0].display == \"Logic Library\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/library-type\"}\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This library is used to notify the prescriber/user to avoid \"\n        \"prescribing opioid pain medication and benzodiazepines \"\n        \"concurrently.\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_library_4(base_settings):\n    \"\"\"No. 4 tests collection for Library.\n    Test File: library-opioidcds-recommendation-11.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"library-opioidcds-recommendation-11.json\"\n    )\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_4(inst2)\n\n\ndef impl_library_5(inst):\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.content[0].contentType == \"application/elm+xml\"\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert inst.dataRequirement[0].codeFilter[0].path == \"medicationCodeableConcept\"\n    assert inst.dataRequirement[0].codeFilter[0].valueSet == (\n        \"http://example.org/fhir/ValueSet/opioids-indicating-end-of-\" \"life\"\n    )\n    assert inst.dataRequirement[0].type == \"MedicationRequest\"\n    assert inst.dataRequirement[1].codeFilter[0].path == \"code\"\n    assert inst.dataRequirement[1].type == \"Procedure\"\n    assert inst.dataRequirement[2].codeFilter[0].path == \"code\"\n    assert inst.dataRequirement[2].type == \"Procedure\"\n    assert inst.dataRequirement[3].codeFilter[0].path == \"medicationCodeableConcept\"\n    assert inst.dataRequirement[3].codeFilter[0].valueSet == (\n        \"http://example.org/fhir/ValueSet/opioids-abused-in-\" \"ambulatory-care\"\n    )\n    assert inst.dataRequirement[3].type == \"MedicationRequest\"\n    assert inst.dataRequirement[4].type == \"Encounter\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-25T13:49:09-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"opioidcds-recommendation-07\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"OpioidCDS_REC_07\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert inst.purpose == (\n        \"The purpose of this library is to determine whether the \"\n        \"patient has been evaluated for benefits and harms within 1 \"\n        \"to 4 weeks of starting opioid therapy and every 3 months or \"\n        \"more subsequently.\"\n    )\n    assert (\n        inst.relatedArtifact[0].display\n        == \"CDC guideline for prescribing opioids for chronic pain\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://example.org/fhir/Library/opioidcds-common\"\n    )\n    assert inst.relatedArtifact[1].type == \"depends-on\"\n    assert inst.status == \"active\"\n    assert inst.title == \"Opioid CDS Logic for recommendation #7\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert inst.type.coding[0].display == \"Logic Library\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/library-type\"}\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This library is used to notify the prescriber/user whether \"\n        \"an evaluation for benefits and harms associated with opioid \"\n        \"therapy is recommended for the patient.\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_library_5(base_settings):\n    \"\"\"No. 5 tests collection for Library.\n    Test File: library-opioidcds-recommendation-07.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"library-opioidcds-recommendation-07.json\"\n    )\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_5(inst2)\n\n\ndef impl_library_6(inst):\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2021-03-02\"}).valueDate\n    )\n    assert inst.content[0].contentType == \"application/xml\"\n    assert (\n        inst.content[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://cqlrepository.org/fhirmodel-modelinfo.xml\"}\n        ).valueUrl\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-07-08\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Model definition for the FHIR Model\"\n    assert inst.experimental is False\n    assert inst.id == \"FHIR-ModelInfo\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"FHIR\"\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2021-03-02\"}).valueDate\n    )\n    assert inst.name == \"FHIR\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"FHIR Model Definition\"\n    assert inst.topic[0].text == \"FHIR\"\n    assert inst.type.coding[0].code == \"model-definition\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Library/FHIR-ModelInfo\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_library_6(base_settings):\n    \"\"\"No. 6 tests collection for Library.\n    Test File: library-fhir-model-definition.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"library-fhir-model-definition.json\"\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_6(inst2)\n\n\ndef impl_library_7(inst):\n    assert inst.content[0].contentType == \"text/cql\"\n    assert inst.content[0].title == \"FHIR Helpers\"\n    assert (\n        inst.content[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"library-fhir-helpers-content.cql\"}\n        ).valueUrl\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-14\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"FHIR Helpers\"\n    assert inst.experimental is True\n    assert inst.id == \"library-fhir-helpers-predecessor\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"FHIRHelpers\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.relatedArtifact[0].resource\n        == \"http://example.org/fhir/Library/fhir-model-definition\"\n    )\n    assert inst.relatedArtifact[0].type == \"depends-on\"\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://example.org/fhir/Library/library-fhir-helpers\"\n    )\n    assert inst.relatedArtifact[1].type == \"successor\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"FHIR Helpers\"\n    assert inst.topic[0].text == \"FHIR Helpers\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert inst.version == \"1.6\"\n\n\ndef test_library_7(base_settings):\n    \"\"\"No. 7 tests collection for Library.\n    Test File: library-predecessor-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"library-predecessor-example.json\"\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_7(inst2)\n\n\ndef impl_library_8(inst):\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.content[0].contentType == \"application/elm+xml\"\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert inst.dataRequirement[0].codeFilter[0].path == \"medicationCodeableConcept\"\n    assert inst.dataRequirement[0].codeFilter[0].valueSet == (\n        \"http://example.org/fhir/ValueSet/opioids-indicating-end-of-\" \"life\"\n    )\n    assert inst.dataRequirement[0].type == \"MedicationRequest\"\n    assert inst.dataRequirement[1].codeFilter[0].path == \"medicationCodeableConcept\"\n    assert inst.dataRequirement[1].codeFilter[0].valueSet == (\n        \"http://example.org/fhir/ValueSet/opioids-abused-in-\" \"ambulatory-care\"\n    )\n    assert inst.dataRequirement[1].type == \"MedicationRequest\"\n    assert inst.dataRequirement[2].codeFilter[0].path == \"combo-code\"\n    assert inst.dataRequirement[2].codeFilter[0].valueSet == (\n        \"http://example.org/fhir/ValueSet/illicit-drug-urine-\" \"screening\"\n    )\n    assert inst.dataRequirement[2].type == \"Observation\"\n    assert inst.dataRequirement[3].codeFilter[0].path == \"combo-code\"\n    assert (\n        inst.dataRequirement[3].codeFilter[0].valueSet\n        == \"http://example.org/fhir/ValueSet/opioid-urine-screening\"\n    )\n    assert inst.dataRequirement[3].type == \"Observation\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-25T13:49:09-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Opioid decision support logic to evaluate whether the \"\n        \"patient has had a urine screening in the past 12 months and \"\n        \"provide analysis.\"\n    )\n    assert inst.experimental is False\n    assert inst.id == \"opioidcds-recommendation-10\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"OpioidCDS_REC_10\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert (\n        inst.relatedArtifact[0].display\n        == \"CDC guideline for prescribing opioids for chronic pain\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://example.org/fhir/Library/opioidcds-common\"\n    )\n    assert inst.relatedArtifact[1].type == \"depends-on\"\n    assert inst.status == \"active\"\n    assert inst.title == \"Opioid CDS Logic for recommendation #10\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert inst.type.coding[0].display == \"Logic Library\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/library-type\"}\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This library is used to notify the prescriber/user whether \"\n        \"the patient has had a urine screening in the past 12 months \"\n        \"and to provide analysis if true.\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_library_8(base_settings):\n    \"\"\"No. 8 tests collection for Library.\n    Test File: library-opioidcds-recommendation-10.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"library-opioidcds-recommendation-10.json\"\n    )\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_8(inst2)\n\n\ndef impl_library_9(inst):\n    assert inst.content[0].contentType == \"text/cql\"\n    assert inst.content[1].contentType == \"application/elm+xml\"\n    assert inst.dataRequirement[0].type == \"Patient\"\n    assert inst.dataRequirement[1].codeFilter[0].code[0].code == \"diagnosis\"\n    assert inst.dataRequirement[1].codeFilter[0].path == \"category\"\n    assert inst.dataRequirement[1].codeFilter[1].code[0].code == \"confirmed\"\n    assert inst.dataRequirement[1].codeFilter[1].path == \"clinicalStatus\"\n    assert inst.dataRequirement[1].codeFilter[2].path == \"code\"\n    assert (\n        inst.dataRequirement[1].codeFilter[2].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.102.12.1011\"\n    )\n    assert inst.dataRequirement[1].type == \"Condition\"\n    assert inst.dataRequirement[2].codeFilter[0].code[0].code == \"diagnosis\"\n    assert inst.dataRequirement[2].codeFilter[0].path == \"category\"\n    assert inst.dataRequirement[2].codeFilter[1].code[0].code == \"confirmed\"\n    assert inst.dataRequirement[2].codeFilter[1].path == \"clinicalStatus\"\n    assert inst.dataRequirement[2].codeFilter[2].path == \"code\"\n    assert (\n        inst.dataRequirement[2].codeFilter[2].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.102.12.1012\"\n    )\n    assert inst.dataRequirement[2].type == \"Condition\"\n    assert inst.dataRequirement[3].codeFilter[0].code[0].code == \"finished\"\n    assert inst.dataRequirement[3].codeFilter[0].path == \"status\"\n    assert inst.dataRequirement[3].codeFilter[1].code[0].code == \"ambulatory\"\n    assert inst.dataRequirement[3].codeFilter[1].path == \"class\"\n    assert inst.dataRequirement[3].codeFilter[2].path == \"type\"\n    assert (\n        inst.dataRequirement[3].codeFilter[2].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.101.12.1061\"\n    )\n    assert inst.dataRequirement[3].type == \"Encounter\"\n    assert inst.dataRequirement[4].codeFilter[0].path == \"diagnosis\"\n    assert (\n        inst.dataRequirement[4].codeFilter[0].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.198.12.1012\"\n    )\n    assert inst.dataRequirement[4].type == \"DiagnosticReport\"\n    assert inst.dataRequirement[5].codeFilter[0].path == \"code\"\n    assert (\n        inst.dataRequirement[5].codeFilter[0].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001\"\n    )\n    assert inst.dataRequirement[5].type == \"Medication\"\n    assert inst.dataRequirement[6].codeFilter[0].code[0].code == \"active\"\n    assert inst.dataRequirement[6].codeFilter[0].path == \"status\"\n    assert inst.dataRequirement[6].codeFilter[1].path == \"medication.code\"\n    assert (\n        inst.dataRequirement[6].codeFilter[1].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001\"\n    )\n    assert inst.dataRequirement[6].type == \"MedicationRequest\"\n    assert inst.dataRequirement[7].codeFilter[0].code[0].code == \"completed\"\n    assert inst.dataRequirement[7].codeFilter[0].path == \"status\"\n    assert inst.dataRequirement[7].codeFilter[1].path == \"medication.code\"\n    assert (\n        inst.dataRequirement[7].codeFilter[1].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001\"\n    )\n    assert inst.dataRequirement[7].type == \"MedicationStatement\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-07-22\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Logic for CMS 146: Appropriate Testing for Children with \" \"Pharyngitis\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"library-cms146-example\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"CMS146\"\n    assert inst.name == \"CMS146\"\n    assert (\n        inst.relatedArtifact[0].resource\n        == \"http://hl7.org/fhir/Library/library-quick-model-definition\"\n    )\n    assert inst.relatedArtifact[0].type == \"depends-on\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"CMS146: Appropriate Testing for Children with Pharyngitis\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Library/library-cms146-example\"}\n        ).valueUri\n    )\n    assert inst.version == \"2.0.0\"\n\n\ndef test_library_9(base_settings):\n    \"\"\"No. 9 tests collection for Library.\n    Test File: library-cms146-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"library-cms146-example.json\"\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_9(inst2)\n\n\ndef impl_library_10(inst):\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.content[0].contentType == \"application/elm+xml\"\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert inst.dataRequirement[0].codeFilter[0].code[0].code == \"active\"\n    assert inst.dataRequirement[0].codeFilter[0].path == \"status\"\n    assert inst.dataRequirement[0].codeFilter[1].code[0].code == \"outpatient\"\n    assert (\n        inst.dataRequirement[0].codeFilter[1].code[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/medicationrequest-category\"\n            }\n        ).valueUri\n    )\n    assert inst.dataRequirement[0].codeFilter[1].path == \"category\"\n    assert inst.dataRequirement[0].id == \"medications\"\n    assert inst.dataRequirement[0].type == \"MedicationRequest\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-25T13:49:09-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Opioid Decision Support Logic for use in implementing CDC \"\n        \"Opioid Prescribing Guidelines.\"\n    )\n    assert inst.experimental is False\n    assert inst.id == \"opioidcds-recommendation-05\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"OpioidCDS_REC_05\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert inst.purpose == (\n        \"This library works in concert with the OMTK logic library to\"\n        \" provide decision support for Morphine Milligram Equivalence\"\n        \" calculations and dynamic value resolution.\"\n    )\n    assert (\n        inst.relatedArtifact[0].display\n        == \"CDC guideline for prescribing opioids for chronic pain\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://example.org/fhir/Library/opioidcds-common\"\n    )\n    assert inst.relatedArtifact[1].type == \"depends-on\"\n    assert inst.relatedArtifact[2].display == \"MME Conversion Tables\"\n    assert (\n        inst.relatedArtifact[2].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[2].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.status == \"active\"\n    assert inst.title == \"Opioid CDS Logic for recommendation #5\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert inst.type.coding[0].display == \"Logic Library\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/library-type\"}\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This library is to notify the prescriber/user whether the \"\n        \"current prescription exceeds the recommended MME.\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_library_10(base_settings):\n    \"\"\"No. 10 tests collection for Library.\n    Test File: library-opioidcds-recommendation-05.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"library-opioidcds-recommendation-05.json\"\n    )\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_linkage.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Linkage\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import linkage\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_linkage_1(inst):\n    assert inst.author.reference == \"Practitioner/f201\"\n    assert inst.id == \"example\"\n    assert (\n        inst.item[0].resource.display == \"Severe burn of left ear (Date: 24-May 2012)\"\n    )\n    assert inst.item[0].resource.reference == \"Condition/example\"\n    assert inst.item[0].type == \"source\"\n    assert (\n        inst.item[1].resource.display == \"Severe burn of left ear (Date: 24-May 2012)\"\n    )\n    assert inst.item[1].resource.reference == \"Condition/condition-example\"\n    assert inst.item[1].type == \"alternate\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_linkage_1(base_settings):\n    \"\"\"No. 1 tests collection for Linkage.\n    Test File: linkage-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"linkage-example.json\"\n    inst = linkage.Linkage.model_validate_json(filename.read_bytes())\n    assert \"Linkage\" == inst.get_resource_type()\n\n    impl_linkage_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Linkage\" == data[\"resourceType\"]\n\n    inst2 = linkage.Linkage(**data)\n    impl_linkage_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_list.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/List\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import list\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_list_1(inst):\n    assert inst.code.coding[0].code == \"182836005\"\n    assert inst.code.coding[0].display == \"Review of medication\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Medication Review\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-11-20T23:10:23+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.entry[0].flag.coding[0].code == \"01\"\n    assert inst.entry[0].flag.coding[0].display == \"Prescribed\"\n    assert (\n        inst.entry[0].flag.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nehta.gov.au/codes/medications/changetype\"}\n        ).valueUri\n    )\n    assert inst.entry[0].item.display == \"hydroxocobalamin\"\n    assert inst.entry[1].deleted is True\n    assert inst.entry[1].flag.coding[0].code == \"02\"\n    assert inst.entry[1].flag.coding[0].display == \"Cancelled\"\n    assert (\n        inst.entry[1].flag.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nehta.gov.au/codes/medications/changetype\"}\n        ).valueUri\n    )\n    assert inst.entry[1].item.display == \"Morphine Sulfate\"\n    assert inst.id == \"med-list\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"changes\"\n    assert inst.source.reference == \"Patient/example\"\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_1(base_settings):\n    \"\"\"No. 1 tests collection for List.\n    Test File: list-example-medlist.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"list-example-medlist.json\"\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_1(inst2)\n\n\ndef impl_list_2(inst):\n    assert inst.code.coding[0].code == \"8670-2\"\n    assert inst.code.coding[0].display == \"History of family member diseases\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"image\"\n    assert inst.contained[1].id == \"1\"\n    assert inst.contained[2].id == \"2\"\n    assert inst.contained[3].id == \"3\"\n    assert inst.contained[4].id == \"4\"\n    assert inst.contained[5].id == \"5\"\n    assert inst.contained[6].id == \"6\"\n    assert inst.contained[7].id == \"7\"\n    assert inst.contained[8].id == \"8\"\n    assert inst.contained[9].id == \"9\"\n    assert inst.entry[0].item.reference == \"#image\"\n    assert inst.entry[1].item.reference == \"#2\"\n    assert inst.entry[2].item.reference == \"#3\"\n    assert inst.entry[3].item.reference == \"#4\"\n    assert inst.entry[4].item.reference == \"#5\"\n    assert inst.entry[5].item.reference == \"#6\"\n    assert inst.entry[6].item.reference == \"#7\"\n    assert inst.entry[7].item.reference == \"#8\"\n    assert inst.entry[8].item.reference == \"#9\"\n    assert inst.entry[9].item.reference == \"#10\"\n    assert inst.id == \"prognosis\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"snapshot\"\n    assert inst.status == \"current\"\n    assert inst.subject.display == \"Annie Proband, female, born 1966\"\n    assert inst.subject.reference == \"Patient/proband\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_2(base_settings):\n    \"\"\"No. 2 tests collection for List.\n    Test File: list-example-familyhistory-genetics-profile-annie.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"list-example-familyhistory-genetics-profile-annie.json\"\n    )\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_2(inst2)\n\n\ndef impl_list_3(inst):\n    assert inst.code.coding[0].code == \"346638\"\n    assert inst.code.coding[0].display == \"Patient Admission List\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/list-codes\"}\n        ).valueUri\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-07-14T11:54:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-simple-empty\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"snapshot\"\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_3(base_settings):\n    \"\"\"No. 3 tests collection for List.\n    Test File: list-example-simple-empty.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"list-example-simple-empty.json\"\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_3(inst2)\n\n\ndef impl_list_4(inst):\n    assert inst.code.coding[0].code == \"182836005\"\n    assert inst.code.coding[0].display == \"Review of medication\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Medication Review\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-11-26T07:30:23+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.emptyReason.coding[0].code == \"nilknown\"\n    assert inst.emptyReason.coding[0].display == \"Nil Known\"\n    assert (\n        inst.emptyReason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/list-empty-reason\"}\n        ).valueUri\n    )\n    assert inst.emptyReason.text == \"The patient is not on any medications\"\n    assert inst.id == \"example-empty\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"snapshot\"\n    assert inst.source.reference == \"Patient/example\"\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_4(base_settings):\n    \"\"\"No. 4 tests collection for List.\n    Test File: list-example-empty.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"list-example-empty.json\"\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_4(inst2)\n\n\ndef impl_list_5(inst):\n    assert inst.code.coding[0].code == \"8670-2\"\n    assert inst.code.coding[0].display == \"History of family member diseases\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"1\"\n    assert inst.contained[1].id == \"2\"\n    assert inst.contained[2].id == \"3\"\n    assert inst.contained[3].id == \"4\"\n    assert inst.contained[4].id == \"5\"\n    assert inst.contained[5].id == \"6\"\n    assert inst.contained[6].id == \"7\"\n    assert inst.contained[7].id == \"8\"\n    assert inst.entry[0].item.reference == \"#1\"\n    assert inst.entry[1].item.reference == \"#2\"\n    assert inst.entry[2].item.reference == \"#3\"\n    assert inst.entry[3].item.reference == \"#4\"\n    assert inst.entry[4].item.reference == \"#5\"\n    assert inst.entry[5].item.reference == \"#6\"\n    assert inst.entry[6].item.reference == \"#7\"\n    assert inst.entry[7].item.reference == \"#8\"\n    assert inst.entry[8].item.display == \"Family history of cancer of colon\"\n    assert inst.entry[8].item.reference == \"Condition/family-history\"\n    assert inst.id == \"genetic\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"snapshot\"\n    assert inst.status == \"current\"\n    assert inst.subject.display == \"Peter Patient\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_5(base_settings):\n    \"\"\"No. 5 tests collection for List.\n    Test File: list-example-familyhistory-genetics-profile.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"list-example-familyhistory-genetics-profile.json\"\n    )\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_5(inst2)\n\n\ndef impl_list_6(inst):\n    assert inst.code.coding[0].code == \"8670-2\"\n    assert inst.code.coding[0].display == \"History of family member diseases\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"fmh-1\"\n    assert inst.contained[1].id == \"fmh-2\"\n    assert inst.entry[0].item.reference == \"#fmh-1\"\n    assert inst.entry[1].item.reference == \"#fmh-2\"\n    assert inst.id == \"f201\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"snapshot\"\n    assert inst.note[0].text == (\n        \"Both parents, both brothers and both children (twin) are \" \"still alive.\"\n    )\n    assert inst.status == \"current\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_6(base_settings):\n    \"\"\"No. 6 tests collection for List.\n    Test File: list-example-familyhistory-f201-roel.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"list-example-familyhistory-f201-roel.json\"\n    )\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_6(inst2)\n\n\ndef impl_list_7(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-11-25T22:17:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.entry[0].deleted is True\n    assert inst.entry[0].flag.text == \"Deleted due to error\"\n    assert inst.entry[0].item.reference == \"Condition/example\"\n    assert inst.entry[1].flag.text == \"Added\"\n    assert inst.entry[1].item.reference == \"Condition/example2\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:a9fcea7c-fcdf-4d17-a5e0-f26dda030b59\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"23974652\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"changes\"\n    assert inst.source.reference == \"Patient/example\"\n    assert inst.status == \"current\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_7(base_settings):\n    \"\"\"No. 7 tests collection for List.\n    Test File: list-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"list-example.json\"\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_7(inst2)\n\n\ndef impl_list_8(inst):\n    assert inst.code.coding[0].code == \"52472-8\"\n    assert inst.code.coding[0].display == \"Allergies and Adverse Drug Reactions\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Current Allergy List\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-07-14T23:10:23+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.entry[0].item.reference == \"AllergyIntolerance/example\"\n    assert inst.entry[1].item.reference == \"AllergyIntolerance/medication\"\n    assert inst.id == \"current-allergies\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"working\"\n    assert inst.orderedBy.coding[0].code == \"entry-date\"\n    assert (\n        inst.orderedBy.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/list-order\"}\n        ).valueUri\n    )\n    assert inst.source.reference == \"Patient/example\"\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Current Allergy List\"\n\n\ndef test_list_8(base_settings):\n    \"\"\"No. 8 tests collection for List.\n    Test File: list-example-allergies.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"list-example-allergies.json\"\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_8(inst2)\n\n\ndef impl_list_9(inst):\n    assert inst.code.coding[0].code == \"80738-8\"\n    assert inst.code.coding[0].display == (\n        \"TPMT gene mutations found [Identifier] in Blood or Tissue by\"\n        \" Sequencing Nominal\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == (\n        \"TPMT gene mutations found [Identifier] in Blood or Tissue by\"\n        \" Sequencing Nominal\"\n    )\n    assert inst.contained[0].id == \"1\"\n    assert inst.contained[1].id == \"2\"\n    assert inst.contained[2].id == \"3\"\n    assert inst.contained[3].id == \"4\"\n    assert inst.contained[4].id == \"5\"\n    assert inst.contained[5].id == \"6\"\n    assert inst.entry[0].item.reference == \"#1\"\n    assert inst.entry[1].item.reference == \"#2\"\n    assert inst.entry[2].item.reference == \"#3\"\n    assert inst.entry[3].item.reference == \"#4\"\n    assert inst.entry[4].item.reference == \"#5\"\n    assert inst.entry[5].item.reference == \"#6\"\n    assert inst.id == \"example-double-cousin-relationship\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"snapshot\"\n    assert inst.status == \"current\"\n    assert inst.subject.display == \"Pam Taylor\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_9(base_settings):\n    \"\"\"No. 9 tests collection for List.\n    Test File: list-example-double-cousin-relationship-pedigree.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"list-example-double-cousin-relationship-pedigree.json\"\n    )\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_9(inst2)\n\n\ndef impl_list_10(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-02-21T12:17:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.entry[0].item.reference == \"Patient/example\"\n    assert inst.entry[1].item.reference == \"Patient/pat1\"\n    assert inst.entry[2].item.reference == \"Patient/pat2\"\n    assert inst.entry[3].item.reference == \"Patient/pat3\"\n    assert inst.entry[4].item.reference == \"Patient/pat4\"\n    assert inst.entry[5].item.reference == \"Patient/1\"\n    assert inst.entry[6].item.reference == \"Patient/2\"\n    assert inst.entry[7].item.reference == \"Patient/3\"\n    assert inst.entry[8].item.reference == \"Patient/4\"\n    assert inst.entry[9].item.reference == \"Patient/5\"\n    assert inst.id == \"long\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"changes\"\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_10(base_settings):\n    \"\"\"No. 10 tests collection for List.\n    Test File: list-example-long.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"list-example-long.json\"\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_location.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Location\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import location\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_location_1(inst):\n    assert inst.address.city == \"Den Burg\"\n    assert inst.address.country == \"NLD\"\n    assert inst.address.line[0] == \"Galapagosweg 91, Building A\"\n    assert inst.address.postalCode == \"9105 PZ\"\n    assert inst.address.use == \"work\"\n    assert inst.alias[0] == \"BU MC, SW, F2\"\n    assert (\n        inst.alias[1] == \"Burgers University Medical Center, South Wing, second floor\"\n    )\n    assert inst.description == (\n        \"Second floor of the Old South Wing, formerly in use by \" \"Psychiatry\"\n    )\n    assert inst.endpoint[0].reference == \"Endpoint/example\"\n    assert inst.id == \"1\"\n    assert inst.identifier[0].value == \"B1-S.F2\"\n    assert inst.managingOrganization.reference == \"Organization/f001\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"instance\"\n    assert inst.name == \"South Wing, second floor\"\n    assert inst.physicalType.coding[0].code == \"wi\"\n    assert inst.physicalType.coding[0].display == \"Wing\"\n    assert (\n        inst.physicalType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert float(inst.position.altitude) == float(0)\n    assert float(inst.position.latitude) == float(42.25475478)\n    assert float(inst.position.longitude) == float(-83.6945691)\n    assert inst.status == \"active\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"2328\"\n    assert inst.telecom[1].system == \"fax\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"2329\"\n    assert inst.telecom[2].system == \"email\"\n    assert inst.telecom[2].value == \"second wing admissions\"\n    assert inst.telecom[3].system == \"url\"\n    assert inst.telecom[3].use == \"work\"\n    assert inst.telecom[3].value == \"http://sampleorg.com/southwing\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Burgers UMC, '\n        \"South Wing, second floor</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_location_1(base_settings):\n    \"\"\"No. 1 tests collection for Location.\n    Test File: location-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"location-example.json\"\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_1(inst2)\n\n\ndef impl_location_2(inst):\n    assert inst.alias[0] == \"South Wing OR 5\"\n    assert inst.alias[1] == \"Main Wing OR 2\"\n    assert inst.description == (\n        \"Old South Wing, Neuro Radiology Operation Room 1 on second \" \"floor\"\n    )\n    assert inst.id == \"2\"\n    assert inst.identifier[0].value == \"B1-S.F2.1.00\"\n    assert inst.managingOrganization.reference == \"Organization/f001\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"instance\"\n    assert inst.name == \"South Wing Neuro OR 1\"\n    assert inst.operationalStatus.code == \"H\"\n    assert inst.operationalStatus.display == \"Housekeeping\"\n    assert (\n        inst.operationalStatus.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0116\"}\n        ).valueUri\n    )\n    assert inst.partOf.reference == \"Location/1\"\n    assert inst.physicalType.coding[0].code == \"ro\"\n    assert inst.physicalType.coding[0].display == \"Room\"\n    assert (\n        inst.physicalType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"suspended\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].value == \"2329\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Burgers UMC, '\n        \"South Wing, second floor, Neuro Radiology Operation Room \"\n        \"1</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"RNEU\"\n    assert inst.type[0].coding[0].display == \"Neuroradiology unit\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n\n\ndef test_location_2(base_settings):\n    \"\"\"No. 2 tests collection for Location.\n    Test File: location-example-room.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"location-example-room.json\"\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_2(inst2)\n\n\ndef impl_location_3(inst):\n    assert inst.description == \"Ambulance provided by Burgers University Medical Center\"\n    assert inst.id == \"amb\"\n    assert inst.managingOrganization.reference == \"Organization/f001\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"kind\"\n    assert inst.name == \"BUMC Ambulance\"\n    assert inst.physicalType.coding[0].code == \"ve\"\n    assert inst.physicalType.coding[0].display == \"Vehicle\"\n    assert (\n        inst.physicalType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"mobile\"\n    assert inst.telecom[0].value == \"2329\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Mobile ' \"Clinic</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"AMB\"\n    assert inst.type[0].coding[0].display == \"Ambulance\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n\n\ndef test_location_3(base_settings):\n    \"\"\"No. 3 tests collection for Location.\n    Test File: location-example-ambulance.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"location-example-ambulance.json\"\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_3(inst2)\n\n\ndef impl_location_4(inst):\n    assert inst.description == (\n        \"All Pharmacies in the United Kingdom covered by the National\"\n        \" Pharmacy Association\"\n    )\n    assert inst.id == \"ukp\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"kind\"\n    assert inst.name == \"UK Pharmacies\"\n    assert inst.physicalType.coding[0].code == \"jdn\"\n    assert inst.physicalType.coding[0].display == \"Jurisdiction\"\n    assert (\n        inst.physicalType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">UK ' \"Pharmacies</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"PHARM\"\n    assert inst.type[0].coding[0].display == \"Pharmacy\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n\n\ndef test_location_4(base_settings):\n    \"\"\"No. 4 tests collection for Location.\n    Test File: location-example-ukpharmacy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"location-example-ukpharmacy.json\"\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_4(inst2)\n\n\ndef impl_location_5(inst):\n    assert inst.description == \"Patient's Home\"\n    assert inst.id == \"ph\"\n    assert inst.managingOrganization.reference == \"Organization/f001\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"kind\"\n    assert inst.name == \"Patient's Home\"\n    assert inst.physicalType.coding[0].code == \"ho\"\n    assert inst.physicalType.coding[0].display == \"House\"\n    assert (\n        inst.physicalType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Patient\\'s ' \"Home</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"PTRES\"\n    assert inst.type[0].coding[0].display == \"Patient's Residence\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n\n\ndef test_location_5(base_settings):\n    \"\"\"No. 5 tests collection for Location.\n    Test File: location-example-patients-home.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"location-example-patients-home.json\"\n    )\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_5(inst2)\n\n\ndef impl_location_6(inst):\n    assert inst.address.city == \"Ann Arbor\"\n    assert inst.address.country == \"USA\"\n    assert inst.address.line[0] == \"3300 Washtenaw Avenue, Suite 227\"\n    assert inst.address.postalCode == \"48104\"\n    assert inst.address.state == \"MI\"\n    assert inst.description == \"HL7 Headquarters\"\n    assert inst.id == \"hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"instance\"\n    assert inst.name == \"Health Level Seven International\"\n    assert inst.physicalType.coding[0].code == \"bu\"\n    assert inst.physicalType.coding[0].display == \"Building\"\n    assert (\n        inst.physicalType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert float(inst.position.latitude) == float(-83.69471)\n    assert float(inst.position.longitude) == float(42.2565)\n    assert inst.status == \"active\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].value == \"(+1) 734-677-7777\"\n    assert inst.telecom[1].system == \"fax\"\n    assert inst.telecom[1].value == \"(+1) 734-677-6622\"\n    assert inst.telecom[2].system == \"email\"\n    assert inst.telecom[2].value == \"hq@HL7.org\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"SLEEP\"\n    assert inst.type[0].coding[0].display == \"Sleep disorders unit\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n\n\ndef test_location_6(base_settings):\n    \"\"\"No. 6 tests collection for Location.\n    Test File: location-example-hl7hq.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"location-example-hl7hq.json\"\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_6(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_manufactureditemdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ManufacturedItemDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import manufactureditemdefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_manufactureditemdefinition_1(inst):\n    assert inst.id == \"example\"\n    assert inst.manufacturedDoseForm.coding[0].code == \"Film-coatedtablet\"\n    assert (\n        inst.manufacturedDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/manufactureddoseform\"}\n        ).valueUri\n    )\n    assert inst.manufacturer[0].reference == \"Organization/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.property[0].type.coding[0].code == \"shape\"\n    assert inst.property[0].valueCodeableConcept.text == \"Oval\"\n    assert inst.property[1].type.coding[0].code == \"color\"\n    assert inst.property[1].valueCodeableConcept.text == \"pink\"\n    assert inst.property[2].type.coding[0].code == \"imprint\"\n    assert inst.property[2].valueCodeableConcept.text == \"894\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.unitOfPresentation.coding[0].code == \"Tablet\"\n    assert (\n        inst.unitOfPresentation.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/unitofpresentation\"}\n        ).valueUri\n    )\n\n\ndef test_manufactureditemdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ManufacturedItemDefinition.\n    Test File: manufactureditemdefinition-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"manufactureditemdefinition-example.json\"\n    )\n    inst = manufactureditemdefinition.ManufacturedItemDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ManufacturedItemDefinition\" == inst.get_resource_type()\n\n    impl_manufactureditemdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ManufacturedItemDefinition\" == data[\"resourceType\"]\n\n    inst2 = manufactureditemdefinition.ManufacturedItemDefinition(**data)\n    impl_manufactureditemdefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_measure.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Measure\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import measure\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_measure_1(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Exclusive breastfeeding measure of outcomes for exclusive \"\n        \"breastmilk feeding of newborns.\"\n    )\n    assert inst.experimental is True\n    assert inst.group[0].id == \"PopulationGroup1\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].criteria.expression == \"InitialPopulation1\"\n    assert inst.group[0].population[0].criteria.language == \"text/cql\"\n    assert inst.group[0].population[1].code.coding[0].code == \"denominator\"\n    assert inst.group[0].population[1].criteria.expression == \"Denominator1\"\n    assert inst.group[0].population[1].criteria.language == \"text/cql\"\n    assert inst.group[0].population[2].code.coding[0].code == \"denominator-exclusions\"\n    assert inst.group[0].population[2].criteria.expression == \"DenominatorExclusions1\"\n    assert inst.group[0].population[2].criteria.language == \"text/cql\"\n    assert inst.group[0].population[3].code.coding[0].code == \"numerator\"\n    assert inst.group[0].population[3].criteria.expression == \"Numerator1\"\n    assert inst.group[0].population[3].criteria.language == \"text/cql\"\n    assert inst.group[1].id == \"PopulationGroup2\"\n    assert inst.group[1].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[1].population[0].criteria.expression == \"InitialPopulation2\"\n    assert inst.group[1].population[0].criteria.language == \"text/cql\"\n    assert inst.group[1].population[1].code.coding[0].code == \"denominator\"\n    assert inst.group[1].population[1].criteria.expression == \"Denominator2\"\n    assert inst.group[1].population[1].criteria.language == \"text/cql\"\n    assert inst.group[1].population[2].code.coding[0].code == \"denominator-exclusion\"\n    assert inst.group[1].population[2].criteria.expression == \"DenominatorExclusions2\"\n    assert inst.group[1].population[2].criteria.language == \"text/cql\"\n    assert inst.group[1].population[3].code.coding[0].code == \"numerator\"\n    assert inst.group[1].population[3].criteria.expression == \"Numerator2\"\n    assert inst.group[1].population[3].criteria.language == \"text/cql\"\n    assert inst.id == \"measure-exclusive-breastfeeding\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"exclusive-breastfeeding-measure\"\n    assert inst.improvementNotation.coding[0].code == \"increase\"\n    assert (\n        inst.improvementNotation.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-improvement-notation\"\n            }\n        ).valueUri\n    )\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/library-exclusive-\" \"breastfeeding-cqm-logic\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.purpose == (\n        \"Measure of newborns who were fed breast milk only since \" \"birth\"\n    )\n    assert inst.relatedArtifact[0].citation == (\n        \"American Academy of Pediatrics. (2005). Section on \"\n        \"Breastfeeding. Policy Statement:Breastfeeding and the Use of\"\n        \" Human Milk. Pediatrics.115:496-506.\"\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert inst.relatedArtifact[1].type == \"documentation\"\n    assert inst.relatedArtifact[2].type == \"documentation\"\n    assert inst.relatedArtifact[3].type == \"documentation\"\n    assert inst.relatedArtifact[4].type == \"documentation\"\n    assert inst.relatedArtifact[5].type == \"documentation\"\n    assert inst.relatedArtifact[6].citation == (\n        \"Kramer, M.S. & Kakuma, R. (2002).Optimal duration of \"\n        \"exclusive breastfeeding. [107 refs] Cochrane Database of \"\n        \"Systematic Reviews. (1):CD003517.\"\n    )\n    assert inst.relatedArtifact[6].type == \"documentation\"\n    assert inst.relatedArtifact[7].citation == (\n        \"Petrova, A., Hegyi, T., & Mehta, R. (2007). Maternal \"\n        \"race/ethnicity and one-month exclusive breastfeeding in \"\n        \"association with the in-hospital feeding modality. \"\n        \"Breastfeeding Medicine. 2(2):92-8.\"\n    )\n    assert inst.relatedArtifact[7].type == \"documentation\"\n    assert inst.relatedArtifact[8].type == \"documentation\"\n    assert inst.relatedArtifact[9].type == \"documentation\"\n    assert inst.scoring.coding[0].code == \"proportion\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Exclusive Breastfeeding Measure\"\n    assert inst.topic[0].text == \"Exclusive Breastfeeding\"\n    assert inst.type[0].coding[0].code == \"process\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_measure_1(base_settings):\n    \"\"\"No. 1 tests collection for Measure.\n    Test File: measure-exclusive-breastfeeding.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"measure-exclusive-breastfeeding.json\"\n    )\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_1(inst2)\n\n\ndef impl_measure_2(inst):\n    assert inst.experimental is True\n    assert inst.group[0].id == \"Main\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].criteria.expression == \"Initial Population\"\n    assert inst.group[0].population[0].criteria.language == \"text/cql\"\n    assert inst.group[0].population[1].code.coding[0].code == \"denominator\"\n    assert inst.group[0].population[1].criteria.expression == \"Denominator\"\n    assert inst.group[0].population[1].criteria.language == \"text/cql\"\n    assert inst.group[0].population[2].code.coding[0].code == \"numerator\"\n    assert inst.group[0].population[2].criteria.expression == \"Numerator\"\n    assert inst.group[0].population[2].criteria.language == \"text/cql\"\n    assert inst.id == \"component-b-example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.scoring.coding[0].code == \"proportion\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Screening for Depression\"\n\n\ndef test_measure_2(base_settings):\n    \"\"\"No. 2 tests collection for Measure.\n    Test File: measure-component-b-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measure-component-b-example.json\"\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_2(inst2)\n\n\ndef impl_measure_3(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Exclusive breastfeeding measure of outcomes for exclusive \"\n        \"breastmilk feeding of newborns.\"\n    )\n    assert inst.experimental is True\n    assert inst.group[0].id == \"PopulationGroup1\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].criteria.expression == \"InitialPopulation1\"\n    assert inst.group[0].population[0].criteria.language == \"text/cql\"\n    assert inst.group[0].population[1].code.coding[0].code == \"denominator\"\n    assert inst.group[0].population[1].criteria.expression == \"Denominator1\"\n    assert inst.group[0].population[1].criteria.language == \"text/cql\"\n    assert inst.group[0].population[2].code.coding[0].code == \"denominator-exclusions\"\n    assert inst.group[0].population[2].criteria.expression == \"DenominatorExclusions1\"\n    assert inst.group[0].population[2].criteria.language == \"text/cql\"\n    assert inst.group[0].population[3].code.coding[0].code == \"numerator\"\n    assert inst.group[0].population[3].criteria.expression == \"Numerator1\"\n    assert inst.group[0].population[3].criteria.language == \"text/cql\"\n    assert inst.group[1].id == \"PopulationGroup2\"\n    assert inst.group[1].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[1].population[0].criteria.expression == \"InitialPopulation2\"\n    assert inst.group[1].population[0].criteria.language == \"text/cql\"\n    assert inst.group[1].population[1].code.coding[0].code == \"denominator\"\n    assert inst.group[1].population[1].criteria.expression == \"Denominator2\"\n    assert inst.group[1].population[1].criteria.language == \"text/cql\"\n    assert inst.group[1].population[2].code.coding[0].code == \"denominator-exclusion\"\n    assert inst.group[1].population[2].criteria.expression == \"DenominatorExclusions2\"\n    assert inst.group[1].population[2].criteria.language == \"text/cql\"\n    assert inst.group[1].population[3].code.coding[0].code == \"numerator\"\n    assert inst.group[1].population[3].criteria.expression == \"Numerator2\"\n    assert inst.group[1].population[3].criteria.language == \"text/cql\"\n    assert inst.id == \"measure-predecessor-example\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"exclusive-breastfeeding-measure\"\n    assert inst.improvementNotation.coding[0].code == \"increase\"\n    assert (\n        inst.improvementNotation.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-improvement-notation\"\n            }\n        ).valueUri\n    )\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/library-exclusive-\" \"breastfeeding-cqm-logic\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.purpose == (\n        \"Measure of newborns who were fed breast milk only since \" \"birth\"\n    )\n    assert inst.relatedArtifact[0].citation == (\n        \"American Academy of Pediatrics. (2005). Section on \"\n        \"Breastfeeding. Policy Statement:Breastfeeding and the Use of\"\n        \" Human Milk. Pediatrics.115:496-506.\"\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert inst.relatedArtifact[1].type == \"documentation\"\n    assert inst.relatedArtifact[2].type == \"documentation\"\n    assert inst.relatedArtifact[3].type == \"documentation\"\n    assert inst.relatedArtifact[4].type == \"documentation\"\n    assert inst.relatedArtifact[5].type == \"documentation\"\n    assert inst.relatedArtifact[6].citation == (\n        \"Kramer, M.S. & Kakuma, R. (2002).Optimal duration of \"\n        \"exclusive breastfeeding. [107 refs] Cochrane Database of \"\n        \"Systematic Reviews. (1):CD003517.\"\n    )\n    assert inst.relatedArtifact[6].type == \"documentation\"\n    assert inst.relatedArtifact[7].citation == (\n        \"Petrova, A., Hegyi, T., & Mehta, R. (2007). Maternal \"\n        \"race/ethnicity and one-month exclusive breastfeeding in \"\n        \"association with the in-hospital feeding modality. \"\n        \"Breastfeeding Medicine. 2(2):92-8.\"\n    )\n    assert inst.relatedArtifact[7].type == \"documentation\"\n    assert inst.relatedArtifact[8].type == \"documentation\"\n    assert inst.relatedArtifact[9].type == \"documentation\"\n    assert inst.scoring.coding[0].code == \"proportion\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Exclusive Breastfeeding Measure\"\n    assert inst.topic[0].text == \"Exclusive Breastfeeding\"\n    assert inst.type[0].coding[0].code == \"process\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_measure_3(base_settings):\n    \"\"\"No. 3 tests collection for Measure.\n    Test File: measure-predecessor-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measure-predecessor-example.json\"\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_3(inst2)\n\n\ndef impl_measure_4(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.group[0].code.coding[0].code == \"QRPH_ADX_ART1_N\"\n    assert (\n        inst.group[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[0].description == (\n        \"Number of adults and children newly enrolled on \"\n        \"antiretroviral therapy (ART) in the reporting period\"\n    )\n    assert inst.group[0].population[0].code.text == \"cohort\"\n    assert inst.group[0].population[0].criteria.expression == (\n        \"Newly enrolled on antiretroviral therapy (ART) during \" \"measurement period\"\n    )\n    assert inst.group[0].population[0].criteria.language == \"text/cql\"\n    assert inst.group[0].stratifier[0].code.coding[0].code == \"AGE_GROUP:SEX\"\n    assert (\n        inst.group[0].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[0].stratifier[0].criteria.expression == \"Age Group/Sex\"\n    assert inst.group[0].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[1].code.coding[0].code == \"QRPH_ADX_ART1_N_PREG_BF\"\n    assert (\n        inst.group[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[1].description == (\n        \"Number of adults and children newly enrolled on ART in the \"\n        \"reporting period_pregnant and breastfeeding\"\n    )\n    assert inst.group[1].population[0].code.text == \"cohort\"\n    assert inst.group[1].population[0].criteria.expression == (\n        \"Newly enrolled on antiretroviral therapy (ART) during \"\n        \"measurement period (pregnant and breastfeeding)\"\n    )\n    assert inst.group[1].population[0].criteria.language == \"text/cql\"\n    assert inst.group[1].stratifier[0].code.coding[0].code == \"PREG_BF\"\n    assert (\n        inst.group[1].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[1].stratifier[0].criteria.expression == \"Pregnant/Breastfeeding\"\n    assert inst.group[1].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[2].code.coding[0].code == \"QRPH_ADX_ART3_N\"\n    assert (\n        inst.group[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[2].description == (\n        \"Number of adults and children currently receiving \"\n        \"antiretroviral therapy (ART)\"\n    )\n    assert inst.group[2].population[0].code.text == \"cohort\"\n    assert inst.group[2].population[0].criteria.expression == (\n        \"Receiving antiretroviral therapy (ART) during measurement \" \"period\"\n    )\n    assert inst.group[2].population[0].criteria.language == \"text/cql\"\n    assert inst.group[3].code.coding[0].code == \"QRPH_ADX_ART5_N\"\n    assert (\n        inst.group[3].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[3].description == (\n        \"Number of adults and children who are still on treatment at \"\n        \"12 months after initiating ART\"\n    )\n    assert inst.group[3].population[0].code.text == \"cohort\"\n    assert inst.group[3].population[0].criteria.expression == (\n        \"Receiving antiretroviral therapy (ART) at 12 months after \" \"initiating\"\n    )\n    assert inst.group[3].population[0].criteria.language == \"text/cql\"\n    assert inst.group[3].stratifier[0].component[0].code.coding[0].code == \"AGE_GROUP\"\n    assert (\n        inst.group[3].stratifier[0].component[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[3].stratifier[0].component[0].criteria.expression == \"Age Group\"\n    assert inst.group[3].stratifier[0].component[0].criteria.language == \"text/cql\"\n    assert inst.group[3].stratifier[0].component[1].code.coding[0].code == \"SEX\"\n    assert (\n        inst.group[3].stratifier[0].component[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[3].stratifier[0].component[1].criteria.expression == \"Sex\"\n    assert inst.group[3].stratifier[0].component[1].criteria.language == \"text/cql\"\n    assert inst.group[4].code.coding[0].code == \"QRPH_ADX_ART5_N_PREG_BF\"\n    assert (\n        inst.group[4].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[4].description == (\n        \"Number of adults and children who are still on treatment at \"\n        \"12 months after initiating ART-pregnant and breastfeeding\"\n    )\n    assert inst.group[4].population[0].code.text == \"cohort\"\n    assert inst.group[4].population[0].criteria.expression == (\n        \"Receiving antiretroviral therapy (ART) at 12 months after \"\n        \"initiating (pregnant and breastfeeding)\"\n    )\n    assert inst.group[4].population[0].criteria.language == \"text/cql\"\n    assert inst.group[4].stratifier[0].code.coding[0].code == \"PREG_BF\"\n    assert (\n        inst.group[4].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[4].stratifier[0].criteria.expression == \"Pregnant/Breastfeeding\"\n    assert inst.group[4].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[5].code.coding[0].code == \"QRPH_ADX_ART5_D\"\n    assert (\n        inst.group[5].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[5].description == (\n        \"Number of adults and children who initiated ART in the 12 \"\n        \"months prior to the beginning of the reporting period\"\n    )\n    assert inst.group[5].population[0].code.text == \"cohort\"\n    assert inst.group[5].population[0].criteria.expression == (\n        \"Initiated antiretroviral therapy (ART) in the 12 months \"\n        \"prior to measurement period\"\n    )\n    assert inst.group[5].population[0].criteria.language == \"text/cql\"\n    assert inst.group[5].stratifier[0].code.coding[0].code == \"AGE_GROUP:SEX\"\n    assert (\n        inst.group[5].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[5].stratifier[0].criteria.expression == \"Age Group/Sex\"\n    assert inst.group[5].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[6].code.coding[0].code == \"QRPH_ADX_MTCT1_D\"\n    assert (\n        inst.group[6].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[6].description == (\n        \"Number of pregnant women who attended ANC or had a facility-\"\n        \"based delivery in the reporting period\"\n    )\n    assert inst.group[6].population[0].code.text == \"cohort\"\n    assert inst.group[6].population[0].criteria.expression == (\n        \"Antenatal Care Visit or Live Birth during the Measurement \" \"Period\"\n    )\n    assert inst.group[6].population[0].criteria.language == \"text/cql\"\n    assert inst.group[6].stratifier[0].code.coding[0].code == \"PMTCT_HIV_STATUS\"\n    assert (\n        inst.group[6].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[6].stratifier[0].criteria.expression == \"PMTCT HIV Status\"\n    assert inst.group[6].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[7].code.coding[0].code == \"QRPH_ADX_MTCT2_D\"\n    assert (\n        inst.group[7].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[7].description == (\n        \"Number of HIV positive pregnant women who attended ANC or \"\n        \"had a facility-based delivery within the reporting period\"\n    )\n    assert inst.group[7].population[0].code.text == \"cohort\"\n    assert inst.group[7].population[0].criteria.expression == (\n        \"Antenatal Care Visit or Live Birth during Measurement Period\" \" (HIV Positive)\"\n    )\n    assert inst.group[7].population[0].criteria.language == \"text/cql\"\n    assert inst.group[8].code.coding[0].code == \"QRPH_ADX_MTCT2_N\"\n    assert (\n        inst.group[8].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[8].description == (\n        \"Number of HIV-positive pregnant women who received ART to \"\n        \"reduce the risk of mother-to-child-transmission during \"\n        \"pregnancy\"\n    )\n    assert inst.group[8].population[0].code.text == \"cohort\"\n    assert inst.group[8].population[0].criteria.expression == (\n        \"HIV-positive, pregnant, and receiving antiretroviral therapy\"\n        \" (ART) to reduce the risk of mother-to-child-transmission \"\n        \"during pregnancy\"\n    )\n    assert inst.group[8].population[0].criteria.language == \"text/cql\"\n    assert inst.group[8].stratifier[0].code.coding[0].code == \"PMTCT_ART_STATUS\"\n    assert (\n        inst.group[8].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[8].stratifier[0].criteria.expression == \"PMTCT ART Status\"\n    assert inst.group[8].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[9].code.coding[0].code == \"QRPH_ADX_VLS3_N\"\n    assert (\n        inst.group[9].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[9].description == (\n        \"Number of people living with HIV and on ART who have a \"\n        \"suppressed viral load results (<1000 copies/mL)\"\n    )\n    assert inst.group[9].population[0].code.text == \"cohort\"\n    assert inst.group[9].population[0].criteria.expression == (\n        \"Living with HIV and on ART with suppressed viral load \"\n        \"results (<1000 copies/mL)\"\n    )\n    assert inst.group[9].population[0].criteria.language == \"text/cql\"\n    assert inst.group[9].stratifier[0].code.coding[0].code == \"AGE_GROUP:SEX\"\n    assert (\n        inst.group[9].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[9].stratifier[0].criteria.expression == \"Age Group/Sex\"\n    assert inst.group[9].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.id == \"hiv-indicators\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ohie.org/Measure/\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"hiv-indicators\"\n    assert inst.library[0] == \"http://ohie.org/Library/hiv-indicators\"\n    assert inst.name == \"HIV\"\n    assert inst.publisher == \"Open HIE\"\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://wiki.ihe.net/index.php/Aggregate_Data_Exchange_-_HIV\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://wiki.ihe.net/index.php/Aggregate_Data_Exchange_-_HIV\"}\n        ).valueUrl\n    )\n    assert inst.scoring.coding[0].code == \"cohort\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"HIV Indicators\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ohie.org/Measure/hiv-indicators\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.0.0\"\n\n\ndef test_measure_4(base_settings):\n    \"\"\"No. 4 tests collection for Measure.\n    Test File: measure-hiv-indicators.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measure-hiv-indicators.json\"\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_4(inst2)\n\n\ndef impl_measure_5(inst):\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-01-01\"}).valueDate\n    )\n    assert inst.author[0].name == \"National Committee for Quality Assurance\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://www.ncqa.org/\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-10\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Percentage of children 3-18 years of age who were diagnosed \"\n        \"with pharyngitis, ordered an antibiotic and received a group\"\n        \" A streptococcus (strep) test for the episode.\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.group[0].id == \"CMS146-group-1\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert (\n        inst.group[0].population[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-population\"}\n        ).valueUri\n    )\n    assert inst.group[0].population[0].criteria.expression == \"CMS146.InitialPopulation\"\n    assert inst.group[0].population[0].criteria.language == \"text/cql\"\n    assert inst.group[0].population[1].code.coding[0].code == \"numerator\"\n    assert (\n        inst.group[0].population[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-population\"}\n        ).valueUri\n    )\n    assert inst.group[0].population[1].criteria.expression == \"CMS146.Numerator\"\n    assert inst.group[0].population[1].criteria.language == \"text/cql\"\n    assert inst.group[0].population[2].code.coding[0].code == \"denominator\"\n    assert (\n        inst.group[0].population[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-population\"}\n        ).valueUri\n    )\n    assert inst.group[0].population[2].criteria.expression == \"CMS146.Denominator\"\n    assert inst.group[0].population[2].criteria.language == \"text/cql\"\n    assert inst.group[0].population[3].code.coding[0].code == \"denominator-exclusion\"\n    assert (\n        inst.group[0].population[3].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-population\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].population[3].criteria.expression == \"CMS146.DenominatorExclusion\"\n    )\n    assert inst.group[0].population[3].criteria.language == \"text/cql\"\n    assert inst.group[0].stratifier[0].code.text == \"stratifier-ages-up-to-9\"\n    assert inst.group[0].stratifier[0].criteria.expression == \"CMS146.AgesUpToNine\"\n    assert inst.group[0].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[0].stratifier[1].code.text == \"stratifier-ages-10-plus\"\n    assert inst.group[0].stratifier[1].criteria.expression == \"CMS146.AgesTenPlus\"\n    assert inst.group[0].stratifier[1].criteria.language == \"text/cql\"\n    assert inst.group[0].stratifier[2].code.text == \"stratifier-gender\"\n    assert inst.group[0].stratifier[2].criteria.expression == \"Patient.gender\"\n    assert inst.group[0].stratifier[2].criteria.language == \"text/fhirpath\"\n    assert inst.guidance == (\n        \"This is an episode of care measure that examines all \"\n        \"eligible episodes for the patient during the measurement \"\n        \"period. If the patient has more than one episode, include \"\n        \"all episodes in the measure\"\n    )\n    assert inst.id == \"measure-cms146-example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/cqi/ecqm/Measure/Identifier/cms\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"146\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/cqi/ecqm/Measure/Identifier/nqf\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"0002\"\n    assert inst.improvementNotation.coding[0].code == \"increase\"\n    assert (\n        inst.improvementNotation.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-improvement-notation\"\n            }\n        ).valueUri\n    )\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-09-01\"}).valueDate\n    )\n    assert inst.library[0] == \"http://hl7.org/fhir/Library/library-cms146-example\"\n    assert inst.name == \"CMS146\"\n    assert inst.publisher == \"National Committee for Quality Assurance\"\n    assert inst.purpose == (\n        \"Measure of children with a group A streptococcus test in the\"\n        \" 7-day period from 3 days prior through 3 days after the \"\n        \"diagnosis of pharyngitis\"\n    )\n    assert inst.relatedArtifact[0].citation == (\n        \"Linder, J.A., D.W. Bates, G.M. Lee, J.A. Finkelstein. 2005. \"\n        \"_Antibiotic treatment of children with sore throat._ JAMA \"\n        \"294(18):2315-2322.\"\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert inst.relatedArtifact[1].citation == (\n        \"Infectious Diseases Society of America. 2012. _Clinical \"\n        \"Practice Guideline for the Diagnosis and Management of Group\"\n        \" A Streptococcal Pharyngitis: 2012 Update._\"\n    )\n    assert inst.relatedArtifact[1].type == \"documentation\"\n    assert inst.relatedArtifact[2].type == \"documentation\"\n    assert inst.scoring.coding[0].code == \"proportion\"\n    assert (\n        inst.scoring.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-scoring\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.supplementalData[0].code.text == \"supplemental-data-gender\"\n    assert inst.supplementalData[0].criteria.expression == \"Patient.gender\"\n    assert inst.supplementalData[0].criteria.language == \"text/fhirpath\"\n    assert inst.supplementalData[1].code.text == \"supplemental-data-deceased\"\n    assert inst.supplementalData[1].criteria.expression == \"deceasedBoolean\"\n    assert inst.supplementalData[1].criteria.language == \"text/fhirpath\"\n    assert inst.text.status == \"additional\"\n    assert inst.title == \"Appropriate Testing for Children with Pharyngitis\"\n    assert inst.topic[0].coding[0].code == \"57024-2\"\n    assert (\n        inst.topic[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.type[0].coding[0].code == \"process\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Measure/measure-cms146-example\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"program\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"eligibile-provider\"\n    assert inst.useContext[1].code.code == \"age\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueRange.high.unit == \"a\"\n    assert float(inst.useContext[1].valueRange.high.value) == float(18)\n    assert inst.useContext[1].valueRange.low.unit == \"a\"\n    assert float(inst.useContext[1].valueRange.low.value) == float(3)\n    assert inst.version == \"1.0.0\"\n\n\ndef test_measure_5(base_settings):\n    \"\"\"No. 5 tests collection for Measure.\n    Test File: measure-cms146-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measure-cms146-example.json\"\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_5(inst2)\n\n\ndef impl_measure_6(inst):\n    assert inst.experimental is True\n    assert inst.group[0].id == \"Main\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].criteria.expression == \"Initial Population\"\n    assert inst.group[0].population[0].criteria.language == \"text/cql\"\n    assert inst.group[0].population[1].code.coding[0].code == \"denominator\"\n    assert inst.group[0].population[1].criteria.expression == \"Denominator\"\n    assert inst.group[0].population[1].criteria.language == \"text/cql\"\n    assert inst.group[0].population[2].code.coding[0].code == \"numerator\"\n    assert inst.group[0].population[2].criteria.expression == \"Numerator\"\n    assert inst.group[0].population[2].criteria.language == \"text/cql\"\n    assert inst.id == \"component-a-example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.scoring.coding[0].code == \"proportion\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Screening for Alcohol Misuse\"\n\n\ndef test_measure_6(base_settings):\n    \"\"\"No. 6 tests collection for Measure.\n    Test File: measure-component-a-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measure-component-a-example.json\"\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_6(inst2)\n\n\ndef impl_measure_7(inst):\n    assert inst.compositeScoring.coding[0].code == \"opportunity\"\n    assert inst.experimental is True\n    assert inst.id == \"composite-example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.relatedArtifact[0].resource\n        == \"http://example.org/fhir/Measure/component-a-example\"\n    )\n    assert inst.relatedArtifact[0].type == \"composed-of\"\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://example.org/fhir/Measure/component-b-example\"\n    )\n    assert inst.relatedArtifact[1].type == \"composed-of\"\n    assert inst.scoring.coding[0].code == \"proportion\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Behavioral Assessment Composite Measure\"\n\n\ndef test_measure_7(base_settings):\n    \"\"\"No. 7 tests collection for Measure.\n    Test File: measure-composite-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measure-composite-example.json\"\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_7(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_measurereport.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MeasureReport\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import measurereport\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_measurereport_1(inst):\n    assert inst.contained[0].id == \"reporter\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-04-01\"}\n        ).valueDateTime\n    )\n    assert inst.evaluatedResource[0].reference == \"Condition/example\"\n    assert inst.group[0].id == \"CMS146-group-1\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].count == 1\n    assert inst.group[0].population[1].code.coding[0].code == \"numerator\"\n    assert inst.group[0].population[1].count == 1\n    assert inst.group[0].population[2].code.coding[0].code == \"denominator\"\n    assert inst.group[0].population[2].count == 1\n    assert inst.group[0].population[3].code.coding[0].code == \"denominator-exclusion\"\n    assert inst.group[0].population[3].count == 0\n    assert inst.group[0].stratifier[0].code[0].text == \"stratifier-ages-up-to-9\"\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[0].count == 1\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[1].count == 1\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[2].count == 1\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[3].count == 0\n    assert inst.group[0].stratifier[0].stratum[0].value.text == \"true\"\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[3].count == 0\n    assert inst.group[0].stratifier[0].stratum[1].value.text == \"false\"\n    assert inst.group[0].stratifier[1].code[0].text == \"stratifier-ages-10-plus\"\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[3].count == 0\n    assert inst.group[0].stratifier[1].stratum[0].value.text == \"true\"\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[0].count == 1\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[1].count == 1\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[2].count == 1\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[3].count == 0\n    assert inst.group[0].stratifier[1].stratum[1].value.text == \"false\"\n    assert inst.group[0].stratifier[2].code[0].text == \"stratifier-gender\"\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[0].count == 1\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[1].count == 1\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[2].count == 1\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[3].count == 0\n    assert inst.group[0].stratifier[2].stratum[0].value.text == \"male\"\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[3].count == 0\n    assert inst.group[0].stratifier[2].stratum[1].value.text == \"female\"\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[3].count == 0\n    assert inst.group[0].stratifier[2].stratum[2].value.text == \"other\"\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[3].count == 0\n    assert inst.group[0].stratifier[2].stratum[3].value.text == \"unknown\"\n    assert inst.id == \"measurereport-cms146-cat1-example\"\n    assert inst.identifier[0].value == \"measurereport-cms146-cat1-example-2017-03-13\"\n    assert inst.measure == \"http://example.org/fhir/Measure/CMS146\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-03-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.reporter.reference == \"#reporter\"\n    assert inst.status == \"complete\"\n    assert inst.subject.reference == \"Patient/123\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"individual\"\n\n\ndef test_measurereport_1(base_settings):\n    \"\"\"No. 1 tests collection for MeasureReport.\n    Test File: measurereport-cms146-cat1-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"measurereport-cms146-cat1-example.json\"\n    )\n    inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes())\n    assert \"MeasureReport\" == inst.get_resource_type()\n\n    impl_measurereport_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MeasureReport\" == data[\"resourceType\"]\n\n    inst2 = measurereport.MeasureReport(**data)\n    impl_measurereport_1(inst2)\n\n\ndef impl_measurereport_2(inst):\n    assert inst.contained[0].id == \"patient-new\"\n    assert inst.group[0].code.coding[0].code == \"QRPH_ADX_ART5_N\"\n    assert float(inst.group[0].measureScore.value) == float(1)\n    assert inst.group[0].stratifier[0].code[0].coding[0].code == \"AGE_GROUP:SEX\"\n    assert float(inst.group[0].stratifier[0].stratum[0].measureScore.value) == float(0)\n    assert inst.group[0].stratifier[0].stratum[0].value.coding[0].code == \"P0Y--P20Y:F\"\n    assert float(inst.group[0].stratifier[0].stratum[1].measureScore.value) == float(0)\n    assert inst.group[0].stratifier[0].stratum[1].value.coding[0].code == \"P0Y--P20Y:M\"\n    assert float(inst.group[0].stratifier[0].stratum[2].measureScore.value) == float(0)\n    assert inst.group[0].stratifier[0].stratum[2].value.coding[0].code == \"P20Y--P40Y:F\"\n    assert float(inst.group[0].stratifier[0].stratum[3].measureScore.value) == float(0)\n    assert inst.group[0].stratifier[0].stratum[3].value.coding[0].code == \"P20Y--P40Y:M\"\n    assert float(inst.group[0].stratifier[0].stratum[4].measureScore.value) == float(0)\n    assert inst.group[0].stratifier[0].stratum[4].value.coding[0].code == \"P40Y--P65Y:F\"\n    assert float(inst.group[0].stratifier[0].stratum[5].measureScore.value) == float(1)\n    assert inst.group[0].stratifier[0].stratum[5].value.coding[0].code == \"P40Y--P65Y:M\"\n    assert inst.id == \"general-example-of-report\"\n    assert inst.measure == \"http://ohie.org/Measure/hiv-indicators\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"complete\"\n    assert inst.subject.reference == \"#patient-new\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"individual\"\n\n\ndef test_measurereport_2(base_settings):\n    \"\"\"No. 2 tests collection for MeasureReport.\n    Test File: measurereport-general-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measurereport-general-example.json\"\n    inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes())\n    assert \"MeasureReport\" == inst.get_resource_type()\n\n    impl_measurereport_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MeasureReport\" == data[\"resourceType\"]\n\n    inst2 = measurereport.MeasureReport(**data)\n    impl_measurereport_2(inst2)\n\n\ndef impl_measurereport_3(inst):\n    assert inst.group[0].code.coding[0].code == \"QRPH_ADX_ART1_N\"\n    assert float(inst.group[0].measureScore.value) == float(0)\n    assert inst.group[0].stratifier[0].code[0].coding[0].code == \"AGE_GROUP:SEX\"\n    assert float(inst.group[0].stratifier[0].stratum[0].measureScore.value) == float(0)\n    assert inst.group[0].stratifier[0].stratum[0].value.coding[0].code == \"P0Y--P1Y:F\"\n    assert float(inst.group[0].stratifier[0].stratum[1].measureScore.value) == float(0)\n    assert inst.group[0].stratifier[0].stratum[1].value.coding[0].code == \"P0Y--P1Y:M\"\n    assert float(inst.group[0].stratifier[0].stratum[2].measureScore.value) == float(0)\n    assert inst.group[0].stratifier[0].stratum[2].value.coding[0].code == \"P1Y--P5Y:F\"\n    assert float(inst.group[0].stratifier[0].stratum[3].measureScore.value) == float(0)\n    assert inst.group[0].stratifier[0].stratum[3].value.coding[0].code == \"P1Y--P5Y:M\"\n    assert float(inst.group[0].stratifier[0].stratum[4].measureScore.value) == float(0)\n    assert inst.group[0].stratifier[0].stratum[4].value.coding[0].code == \"P10Y--P15Y:F\"\n    assert float(inst.group[0].stratifier[0].stratum[5].measureScore.value) == float(0)\n    assert inst.group[0].stratifier[0].stratum[5].value.coding[0].code == \"P10Y--P15Y:M\"\n    assert inst.group[1].code.coding[0].code == \"QRPH_ADX_ART1_N\"\n    assert float(inst.group[1].measureScore.value) == float(0)\n    assert inst.group[1].stratifier[0].code[0].coding[0].code == \"AGE_GROUP:SEX\"\n    assert float(inst.group[1].stratifier[0].stratum[0].measureScore.value) == float(0)\n    assert inst.group[1].stratifier[0].stratum[0].value.coding[0].code == \"P0Y--P1Y:F\"\n    assert float(inst.group[1].stratifier[0].stratum[1].measureScore.value) == float(0)\n    assert inst.group[1].stratifier[0].stratum[1].value.coding[0].code == \"P0Y--P1Y:M\"\n    assert float(inst.group[1].stratifier[0].stratum[2].measureScore.value) == float(0)\n    assert inst.group[1].stratifier[0].stratum[2].value.coding[0].code == \"P1Y--P5Y:F\"\n    assert float(inst.group[1].stratifier[0].stratum[3].measureScore.value) == float(0)\n    assert inst.group[1].stratifier[0].stratum[3].value.coding[0].code == \"P1Y--P5Y:M\"\n    assert float(inst.group[1].stratifier[0].stratum[4].measureScore.value) == float(0)\n    assert inst.group[1].stratifier[0].stratum[4].value.coding[0].code == \"P10Y--P15Y:F\"\n    assert float(inst.group[1].stratifier[0].stratum[5].measureScore.value) == float(0)\n    assert inst.group[1].stratifier[0].stratum[5].value.coding[0].code == \"P10Y--P15Y:M\"\n    assert inst.group[2].code.coding[0].code == \"QRPH_ADX_ART1_N\"\n    assert float(inst.group[2].measureScore.value) == float(0)\n    assert inst.group[2].stratifier[0].code[0].coding[0].code == \"AGE_GROUP\"\n    assert inst.group[2].stratifier[0].code[1].coding[0].code == \"SEX\"\n    assert (\n        inst.group[2].stratifier[0].stratum[0].component[0].code.coding[0].code\n        == \"AGE_GROUP\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[0].component[0].value.coding[0].code\n        == \"P0Y--P1Y\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[0].component[1].code.coding[0].code == \"SEX\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[0].component[1].value.coding[0].code == \"F\"\n    )\n    assert float(inst.group[2].stratifier[0].stratum[0].measureScore.value) == float(0)\n    assert (\n        inst.group[2].stratifier[0].stratum[1].component[0].code.coding[0].code\n        == \"AGE_GROUP\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[1].component[0].value.coding[0].code\n        == \"P0Y--P1Y\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[1].component[1].code.coding[0].code == \"SEX\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[1].component[1].value.coding[0].code == \"M\"\n    )\n    assert float(inst.group[2].stratifier[0].stratum[1].measureScore.value) == float(0)\n    assert (\n        inst.group[2].stratifier[0].stratum[2].component[0].code.coding[0].code\n        == \"AGE_GROUP\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[2].component[0].value.coding[0].code\n        == \"P1Y--P5Y\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[2].component[1].code.coding[0].code == \"SEX\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[2].component[1].value.coding[0].code == \"F\"\n    )\n    assert float(inst.group[2].stratifier[0].stratum[2].measureScore.value) == float(0)\n    assert (\n        inst.group[2].stratifier[0].stratum[3].component[0].code.coding[0].code\n        == \"AGE_GROUP\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[3].component[0].value.coding[0].code\n        == \"P1Y--P5Y\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[3].component[1].code.coding[0].code == \"SEX\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[3].component[1].value.coding[0].code == \"F\"\n    )\n    assert float(inst.group[2].stratifier[0].stratum[3].measureScore.value) == float(0)\n    assert inst.id == \"hiv-indicators\"\n    assert inst.measure == \"http://ohie.org/Measure/hiv-indicators\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-01-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.reporter.reference == \"Organization/hl7\"\n    assert inst.status == \"complete\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"summary\"\n\n\ndef test_measurereport_3(base_settings):\n    \"\"\"No. 3 tests collection for MeasureReport.\n    Test File: measurereport-hiv-indicators.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measurereport-hiv-indicators.json\"\n    inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes())\n    assert \"MeasureReport\" == inst.get_resource_type()\n\n    impl_measurereport_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MeasureReport\" == data[\"resourceType\"]\n\n    inst2 = measurereport.MeasureReport(**data)\n    impl_measurereport_3(inst2)\n\n\ndef impl_measurereport_4(inst):\n    assert inst.contained[0].id == \"reporter\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-04-01\"}\n        ).valueDateTime\n    )\n    assert inst.group[0].id == \"CMS146-group-1\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].count == 500\n    assert inst.group[0].population[1].code.coding[0].code == \"numerator\"\n    assert inst.group[0].population[1].count == 200\n    assert inst.group[0].population[2].code.coding[0].code == \"denominator\"\n    assert inst.group[0].population[2].count == 500\n    assert inst.group[0].population[3].code.coding[0].code == \"denominator-exclusion\"\n    assert inst.group[0].population[3].count == 100\n    assert inst.group[0].stratifier[0].code[0].text == \"stratifier-ages-up-to-9\"\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[0].count == 250\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[1].count == 100\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[2].count == 250\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[3].count == 50\n    assert inst.group[0].stratifier[0].stratum[0].value.text == \"true\"\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[0].count == 250\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[1].count == 100\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[2].count == 250\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[3].count == 50\n    assert inst.group[0].stratifier[0].stratum[1].value.text == \"false\"\n    assert inst.group[0].stratifier[1].code[0].text == \"stratifier-ages-10-plus\"\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[0].count == 250\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[1].count == 100\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[2].count == 250\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[3].count == 50\n    assert inst.group[0].stratifier[1].stratum[0].value.text == \"true\"\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[0].count == 250\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[1].count == 100\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[2].count == 250\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[3].count == 50\n    assert inst.group[0].stratifier[1].stratum[1].value.text == \"false\"\n    assert inst.group[0].stratifier[2].code[0].text == \"stratifier-gender\"\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[0].count == 250\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[1].count == 100\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[2].count == 250\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[3].count == 50\n    assert inst.group[0].stratifier[2].stratum[0].value.text == \"male\"\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[0].count == 250\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[1].count == 100\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[2].count == 250\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[3].count == 50\n    assert inst.group[0].stratifier[2].stratum[1].value.text == \"female\"\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[3].count == 0\n    assert inst.group[0].stratifier[2].stratum[2].value.text == \"other\"\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[3].count == 0\n    assert inst.group[0].stratifier[2].stratum[3].value.text == \"unknown\"\n    assert inst.id == \"measurereport-cms146-cat3-example\"\n    assert inst.identifier[0].value == \"measurereport-cms146-cat3-example-2017-03-13\"\n    assert inst.measure == \"http://example.org/fhir/Measure/CMS146\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-03-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.reporter.reference == \"#reporter\"\n    assert inst.status == \"complete\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"summary\"\n\n\ndef test_measurereport_4(base_settings):\n    \"\"\"No. 4 tests collection for MeasureReport.\n    Test File: measurereport-cms146-cat3-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"measurereport-cms146-cat3-example.json\"\n    )\n    inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes())\n    assert \"MeasureReport\" == inst.get_resource_type()\n\n    impl_measurereport_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MeasureReport\" == data[\"resourceType\"]\n\n    inst2 = measurereport.MeasureReport(**data)\n    impl_measurereport_4(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_media.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Media\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import media\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_media_1(inst):\n    assert inst.content.contentType == \"image/gif\"\n    assert (\n        inst.content.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2009-09-03\"}\n        ).valueDateTime\n    )\n    assert inst.content.id == \"a1\"\n    assert (\n        inst.createdDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-17\"}\n        ).valueDateTime\n    )\n    assert inst.device.display == \"Acme Camera\"\n    assert inst.frames == 1\n    assert inst.height == 145\n    assert inst.id == \"example\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2017-12-17T14:56:18Z\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.modality.coding[0].code == \"diagram\"\n    assert (\n        inst.modality.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/media-modality\"}\n        ).valueUri\n    )\n    assert inst.operator.reference == \"Practitioner/xcda-author\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/xcda\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"image\"\n    assert inst.type.coding[0].display == \"Image\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/media-type\"}\n        ).valueUri\n    )\n    assert inst.width == 126\n\n\ndef test_media_1(base_settings):\n    \"\"\"No. 1 tests collection for Media.\n    Test File: media-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"media-example.json\"\n    inst = media.Media.model_validate_json(filename.read_bytes())\n    assert \"Media\" == inst.get_resource_type()\n\n    impl_media_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Media\" == data[\"resourceType\"]\n\n    inst2 = media.Media(**data)\n    impl_media_1(inst2)\n\n\ndef impl_media_2(inst):\n    assert inst.content.contentType == \"application/dicom\"\n    assert inst.device.display == \"G.E. Medical Systems\"\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nema.org/fhir/extensions#0002-0010\"}\n        ).valueUri\n    )\n    assert (\n        inst.extension[0].valueUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.840.10008.1.2.1\"}\n        ).valueUri\n    )\n    assert inst.height == 480\n    assert inst.id == \"1.2.840.11361907579238403408700.3.1.04.19970327150033\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[0].type.text == \"InstanceUID\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == (\n        \"urn:oid:1.2.840.11361907579238403408700.3.1.04.1997032715003\" \"3\"\n    )\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme-imaging.com/accession/2012\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].type.text == \"accessionNo\"\n    assert inst.identifier[1].value == \"1234567\"\n    assert (\n        inst.identifier[2].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[2].type.text == \"studyId\"\n    assert (\n        inst.identifier[2].value\n        == \"urn:oid:1.2.840.113619.2.21.848.34082.0.538976288.3\"\n    )\n    assert (\n        inst.identifier[3].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[3].type.text == \"seriesId\"\n    assert (\n        inst.identifier[3].value\n        == \"urn:oid:1.2.840.113619.2.21.3408.700.0.757923840.3.0\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.modality.coding[0].code == \"US\"\n    assert (\n        inst.modality.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.view.coding[0].code == \"399067008\"\n    assert inst.view.coding[0].display == \"Lateral projection\"\n    assert (\n        inst.view.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.width == 640\n\n\ndef test_media_2(base_settings):\n    \"\"\"No. 2 tests collection for Media.\n    Test File: media-example-dicom.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"media-example-dicom.json\"\n    inst = media.Media.model_validate_json(filename.read_bytes())\n    assert \"Media\" == inst.get_resource_type()\n\n    impl_media_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Media\" == data[\"resourceType\"]\n\n    inst2 = media.Media(**data)\n    impl_media_2(inst2)\n\n\ndef impl_media_3(inst):\n    assert inst.basedOn[0].identifier.assigner.display == \"XYZ Medical Clinic\"\n    assert (\n        inst.basedOn[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://someclinic.org/fhir/NamingSystem/imaging-orders\"}\n        ).valueUri\n    )\n    assert inst.basedOn[0].identifier.value == \"111222\"\n    assert inst.bodySite.coding[0].code == \"85151006\"\n    assert inst.bodySite.coding[0].display == \"Structure of left hand (body structure)\"\n    assert (\n        inst.bodySite.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.content.contentType == \"image/jpeg\"\n    assert (\n        inst.content.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-03-15\"}\n        ).valueDateTime\n    )\n    assert inst.content.id == \"a1\"\n    assert (\n        inst.content.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://someimagingcenter.org/fhir/Binary/A12345\"}\n        ).valueUrl\n    )\n    assert (\n        inst.createdDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-03-15\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.height == 432\n    assert inst.id == \"xray\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.modality.coding[0].code == \"39714003\"\n    assert inst.modality.coding[0].display == \"Skeletal X-ray of wrist and hand\"\n    assert (\n        inst.modality.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Xray of left '\n        \"hand for Patient Henry Levin (MRN 12345) 2016-03-15</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.width == 640\n\n\ndef test_media_3(base_settings):\n    \"\"\"No. 3 tests collection for Media.\n    Test File: media-example-xray.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"media-example-xray.json\"\n    inst = media.Media.model_validate_json(filename.read_bytes())\n    assert \"Media\" == inst.get_resource_type()\n\n    impl_media_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Media\" == data[\"resourceType\"]\n\n    inst2 = media.Media(**data)\n    impl_media_3(inst2)\n\n\ndef impl_media_4(inst):\n    assert inst.content.contentType == \"audio/mpeg\"\n    assert (\n        inst.content.data\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"dG9vIGJpZyB0b28gaW5jbHVkZSB0aGUgd2hvbGU=\"}\n        ).valueBase64Binary\n    )\n    assert inst.content.id == \"a1\"\n    assert float(inst.duration) == float(65)\n    assert inst.id == \"sound\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.operator.reference == \"Practitioner/xcda-author\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/xcda\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Sound recording '\n        \"of speech example for Patient Henry Levin (MRN \"\n        '12345):<br/><img src=\"#11\" alt=\"diagram\"/></div>'\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_media_4(base_settings):\n    \"\"\"No. 4 tests collection for Media.\n    Test File: media-example-sound.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"media-example-sound.json\"\n    inst = media.Media.model_validate_json(filename.read_bytes())\n    assert \"Media\" == inst.get_resource_type()\n\n    impl_media_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Media\" == data[\"resourceType\"]\n\n    inst2 = media.Media(**data)\n    impl_media_4(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_medication.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Medication\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import medication\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_medication_1(inst):\n    assert (\n        inst.batch.expirationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-31\"}\n        ).valueDateTime\n    )\n    assert inst.batch.lotNumber == \"12345\"\n    assert inst.code.coding[0].code == \"0169-7501-11\"\n    assert inst.code.coding[0].display == \"Novolog 100u/ml\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"org3\"\n    assert inst.form.coding[0].code == \"385219001\"\n    assert inst.form.coding[0].display == \"Injection solution (qualifier value)\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0307\"\n    assert inst.ingredient[0].itemCodeableConcept.coding[0].code == \"325072002\"\n    assert (\n        inst.ingredient[0].itemCodeableConcept.coding[0].display\n        == \"Insulin Aspart (substance)\"\n    )\n    assert (\n        inst.ingredient[0].itemCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.ingredient[0].strength.denominator.code == \"mL\"\n    assert (\n        inst.ingredient[0].strength.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.denominator.value) == float(1)\n    assert inst.ingredient[0].strength.numerator.code == \"U\"\n    assert (\n        inst.ingredient[0].strength.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.numerator.value) == float(100)\n    assert inst.manufacturer.reference == \"#org3\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_1(base_settings):\n    \"\"\"No. 1 tests collection for Medication.\n    Test File: medicationexample0307.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0307.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_1(inst2)\n\n\ndef impl_medication_2(inst):\n    assert inst.code.coding[0].code == \"373994007\"\n    assert inst.code.coding[0].display == \"Prednisone 5mg tablet (Product)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"sub03\"\n    assert inst.form.coding[0].code == \"385055001\"\n    assert inst.form.coding[0].display == \"Tablet dose form (qualifier value)\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0311\"\n    assert inst.ingredient[0].itemReference.reference == \"#sub03\"\n    assert inst.ingredient[0].strength.denominator.code == \"TAB\"\n    assert (\n        inst.ingredient[0].strength.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.denominator.value) == float(1)\n    assert inst.ingredient[0].strength.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].strength.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.numerator.value) == float(5)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_2(base_settings):\n    \"\"\"No. 2 tests collection for Medication.\n    Test File: medicationexample0311.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0311.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_2(inst2)\n\n\ndef impl_medication_3(inst):\n    assert inst.code.coding[0].code == \"430127000\"\n    assert inst.code.coding[0].display == \"Oral Form Oxycodone (product)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"sub03\"\n    assert inst.form.coding[0].code == \"385055001\"\n    assert inst.form.coding[0].display == \"Tablet dose form (qualifier value)\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0310\"\n    assert inst.ingredient[0].itemReference.reference == \"#sub03\"\n    assert inst.ingredient[0].strength.denominator.code == \"TAB\"\n    assert (\n        inst.ingredient[0].strength.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.denominator.value) == float(1)\n    assert inst.ingredient[0].strength.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].strength.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.numerator.value) == float(5)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_3(base_settings):\n    \"\"\"No. 3 tests collection for Medication.\n    Test File: medicationexample0310.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0310.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_3(inst2)\n\n\ndef impl_medication_4(inst):\n    assert (\n        inst.batch.expirationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-31\"}\n        ).valueDateTime\n    )\n    assert inst.batch.lotNumber == \"12345\"\n    assert inst.code.coding[0].code == \"51144-050-01\"\n    assert inst.code.coding[0].display == \"Adcetris\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"org3\"\n    assert inst.form.coding[0].code == \"421637006\"\n    assert (\n        inst.form.coding[0].display\n        == \"Lyophilized powder for injectable solution (qualifier value)\"\n    )\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0306\"\n    assert inst.manufacturer.reference == \"#org3\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_4(base_settings):\n    \"\"\"No. 4 tests collection for Medication.\n    Test File: medicationexample0306.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0306.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_4(inst2)\n\n\ndef impl_medication_5(inst):\n    assert (\n        inst.batch.expirationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-05-22\"}\n        ).valueDateTime\n    )\n    assert inst.batch.lotNumber == \"9494788\"\n    assert inst.code.coding[0].code == \"0409-6531-02\"\n    assert (\n        inst.code.coding[0].display\n        == \"Vancomycin Hydrochloride (VANCOMYCIN HYDROCHLORIDE)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"org4\"\n    assert inst.form.coding[0].code == \"385219001\"\n    assert inst.form.coding[0].display == \"Injection Solution (qualifier value)\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0301\"\n    assert inst.ingredient[0].isActive is True\n    assert inst.ingredient[0].itemCodeableConcept.coding[0].code == \"66955\"\n    assert (\n        inst.ingredient[0].itemCodeableConcept.coding[0].display\n        == \"Vancomycin Hydrochloride\"\n    )\n    assert (\n        inst.ingredient[0].itemCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.ingredient[0].strength.denominator.code == \"mL\"\n    assert (\n        inst.ingredient[0].strength.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.denominator.value) == float(10)\n    assert inst.ingredient[0].strength.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].strength.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.numerator.value) == float(500)\n    assert inst.manufacturer.reference == \"#org4\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_5(base_settings):\n    \"\"\"No. 5 tests collection for Medication.\n    Test File: medicationexample0301.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0301.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_5(inst2)\n\n\ndef impl_medication_6(inst):\n    assert inst.form.coding[0].code == \"385219001\"\n    assert inst.form.coding[0].display == \"Injection Solution (qualifier value)\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.form.text == \"Injection Solution (qualifier value)\"\n    assert inst.id == \"med0317\"\n    assert inst.ingredient[0].itemCodeableConcept.coding[0].code == \"204520\"\n    assert (\n        inst.ingredient[0].itemCodeableConcept.coding[0].display == \"Potassium Chloride\"\n    )\n    assert (\n        inst.ingredient[0].itemCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.ingredient[0].strength.denominator.code == \"mL\"\n    assert (\n        inst.ingredient[0].strength.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.denominator.value) == float(1)\n    assert inst.ingredient[0].strength.numerator.code == \"meq\"\n    assert (\n        inst.ingredient[0].strength.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.numerator.value) == float(2)\n    assert inst.ingredient[1].itemCodeableConcept.coding[0].code == \"313002\"\n    assert (\n        inst.ingredient[1].itemCodeableConcept.coding[0].display\n        == \"Sodium Chloride 0.9% injectable solution\"\n    )\n    assert (\n        inst.ingredient[1].itemCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.ingredient[1].strength.denominator.code == \"mL\"\n    assert (\n        inst.ingredient[1].strength.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[1].strength.denominator.value) == float(100)\n    assert inst.ingredient[1].strength.numerator.code == \"g\"\n    assert (\n        inst.ingredient[1].strength.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[1].strength.numerator.value) == float(0.9)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_6(base_settings):\n    \"\"\"No. 6 tests collection for Medication.\n    Test File: medicationexample0317.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0317.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_6(inst2)\n\n\ndef impl_medication_7(inst):\n    assert inst.code.text == \"Amoxicillin 250mg/5ml Suspension\"\n    assert inst.id == \"medicationexample1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Amoxicillin '\n        \"250mg/5ml Suspension</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_7(base_settings):\n    \"\"\"No. 7 tests collection for Medication.\n    Test File: medicationexample1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample1.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_7(inst2)\n\n\ndef impl_medication_8(inst):\n    assert (\n        inst.batch.expirationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-05-22\"}\n        ).valueDateTime\n    )\n    assert inst.batch.lotNumber == \"9494788\"\n    assert inst.code.coding[0].code == \"213293\"\n    assert inst.code.coding[0].display == \"Capecitabine 500mg oral tablet (Xeloda)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"org2\"\n    assert inst.contained[1].id == \"sub04\"\n    assert inst.form.coding[0].code == \"385055001\"\n    assert inst.form.coding[0].display == \"Tablet dose form (qualifier value)\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"medexample015\"\n    assert inst.ingredient[0].itemReference.reference == \"#sub04\"\n    assert inst.ingredient[0].strength.denominator.code == \"TAB\"\n    assert (\n        inst.ingredient[0].strength.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.denominator.value) == float(1)\n    assert inst.ingredient[0].strength.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].strength.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.numerator.value) == float(500)\n    assert inst.manufacturer.reference == \"#org2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_8(base_settings):\n    \"\"\"No. 8 tests collection for Medication.\n    Test File: medicationexample15.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample15.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_8(inst2)\n\n\ndef impl_medication_9(inst):\n    assert inst.code.coding[0].code == \"108761006\"\n    assert inst.code.coding[0].display == \"Capecitabine (product)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"sub03\"\n    assert inst.form.coding[0].code == \"385055001\"\n    assert inst.form.coding[0].display == \"Tablet dose form (qualifier value)\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0321\"\n    assert inst.ingredient[0].itemReference.reference == \"#sub03\"\n    assert inst.ingredient[0].strength.denominator.code == \"385055001\"\n    assert (\n        inst.ingredient[0].strength.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.ingredient[0].strength.denominator.unit == \"Tablet\"\n    assert float(inst.ingredient[0].strength.denominator.value) == float(1)\n    assert inst.ingredient[0].strength.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].strength.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.numerator.value) == float(500)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_9(base_settings):\n    \"\"\"No. 9 tests collection for Medication.\n    Test File: medicationexample0321.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0321.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_9(inst2)\n\n\ndef impl_medication_10(inst):\n    assert inst.code.coding[0].code == \"324252006\"\n    assert inst.code.coding[0].display == \"Azithromycin 250mg capsule (product)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"sub03\"\n    assert inst.form.coding[0].code == \"385055001\"\n    assert inst.form.coding[0].display == \"Tablet dose form (qualifier value)\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0320\"\n    assert inst.ingredient[0].itemReference.reference == \"#sub03\"\n    assert inst.ingredient[0].strength.denominator.code == \"TAB\"\n    assert (\n        inst.ingredient[0].strength.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.denominator.value) == float(1)\n    assert inst.ingredient[0].strength.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].strength.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strength.numerator.value) == float(250)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_10(base_settings):\n    \"\"\"No. 10 tests collection for Medication.\n    Test File: medicationexample0320.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0320.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_medicationadministration.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationAdministration\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import medicationadministration\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_medicationadministration_1(inst):\n    assert inst.contained[0].id == \"med0301\"\n    assert inst.contained[1].id == \"signature\"\n    assert inst.context.display == \"encounter who leads to this prescription\"\n    assert inst.context.reference == \"Encounter/f001\"\n    assert inst.dosage.dose.code == \"mg\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mg\"\n    assert float(inst.dosage.dose.value) == float(500)\n    assert inst.dosage.method.text == \"IV Push\"\n    assert inst.dosage.route.coding[0].code == \"47625008\"\n    assert inst.dosage.route.coding[0].display == \"Intravenous route (qualifier value)\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == \"500mg IV q6h x 3 days\"\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.eventHistory[0].display == \"Author's Signature\"\n    assert inst.eventHistory[0].reference == \"#signature\"\n    assert inst.id == \"medadmin0301\"\n    assert inst.medicationReference.reference == \"#med0301\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f007\"\n    assert inst.reasonCode[0].coding[0].code == \"b\"\n    assert inst.reasonCode[0].coding[0].display == \"Given as Ordered\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/reason-medication-given\"\n            }\n        ).valueUri\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0318\"\n    assert inst.status == \"in-progress\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_1(base_settings):\n    \"\"\"No. 1 tests collection for MedicationAdministration.\n    Test File: medicationadministration0301.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0301.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_1(inst2)\n\n\ndef impl_medicationadministration_2(inst):\n    assert inst.contained[0].id == \"med0303\"\n    assert inst.context.reference == \"Encounter/f001\"\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"medadminexample03\"\n    assert inst.medicationReference.reference == \"#med0303\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Patient started Bupropion this morning - will administer in \"\n        \"a reduced dose tomorrow\"\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0317\"\n    assert inst.status == \"on-hold\"\n    assert inst.statusReason[0].coding[0].code == \"373147003\"\n    assert inst.statusReason[0].coding[0].display == (\n        \"Administration of medication not done due to a \" \"contraindication (situation)\"\n    )\n    assert (\n        inst.statusReason[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.supportingInformation[0].reference == \"Condition/f204\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_2(base_settings):\n    \"\"\"No. 2 tests collection for MedicationAdministration.\n    Test File: medicationadministrationexample3.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"medicationadministrationexample3.json\"\n    )\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_2(inst2)\n\n\ndef impl_medicationadministration_3(inst):\n    assert inst.contained[0].id == \"med0313\"\n    assert inst.context.display == \"encounter who leads to this prescription\"\n    assert inst.context.reference == \"Encounter/f001\"\n    assert inst.device[0].reference == \"Device/f001\"\n    assert inst.dosage.dose.code == \"mg\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mg\"\n    assert float(inst.dosage.dose.value) == float(7)\n    assert inst.dosage.method.coding[0].code == \"420620005\"\n    assert (\n        inst.dosage.method.coding[0].display\n        == \"Push - dosing instruction imperative (qualifier value)\"\n    )\n    assert (\n        inst.dosage.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.rateQuantity.code == \"min\"\n    assert (\n        inst.dosage.rateQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.rateQuantity.unit == \"min\"\n    assert float(inst.dosage.rateQuantity.value) == float(4)\n    assert inst.dosage.route.coding[0].code == \"255560000\"\n    assert inst.dosage.route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == (\n        \"0.05 - 0.1mg/kg IV over 2-5 minutes every 15 minutes as \" \"needed\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T04:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"medadmin0307\"\n    assert inst.medicationReference.reference == \"#med0313\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f007\"\n    assert inst.performer[0].function.coding[0].code == \"performer\"\n    assert inst.performer[0].function.coding[0].display == \"Performer\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/med-admin-perform-function\"\n            }\n        ).valueUri\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0315\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_3(base_settings):\n    \"\"\"No. 3 tests collection for MedicationAdministration.\n    Test File: medicationadministration0307.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0307.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_3(inst2)\n\n\ndef impl_medicationadministration_4(inst):\n    assert inst.contained[0].id == \"med0304\"\n    assert inst.dosage.dose.code == \"TAB\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"TAB\"\n    assert float(inst.dosage.dose.value) == float(1)\n    assert inst.dosage.route.coding[0].code == \"26643006\"\n    assert inst.dosage.route.coding[0].display == \"Oral Route\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == (\n        \"0.25mg PO every 6-12 hours as needed for menses from Jan \"\n        \"15-20, 2015.  Do not exceed more than 4mg per day\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-16T02:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T22:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"medadmin0311\"\n    assert inst.medicationReference.reference == \"#med0304\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f007\"\n    assert inst.reasonCode[0].coding[0].code == \"266599000\"\n    assert inst.reasonCode[0].coding[0].display == \"Dysmenorrhea\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0305\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_4(base_settings):\n    \"\"\"No. 4 tests collection for MedicationAdministration.\n    Test File: medicationadministration0311.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0311.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_4(inst2)\n\n\ndef impl_medicationadministration_5(inst):\n    assert inst.contained[0].id == \"med0304\"\n    assert inst.dosage.dose.code == \"mg\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mg\"\n    assert float(inst.dosage.dose.value) == float(6)\n    assert inst.dosage.route.coding[0].code == \"26643006\"\n    assert inst.dosage.route.coding[0].display == \"Oral route (qualifier value)\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == (\n        \"6 mg PO daily for remission induction; adjust dosage to \"\n        \"white blood cell (WBC) count.  With hold treatment if WBC is\"\n        \" less than 15,000/µL; resume when WBC is greater than \"\n        \"50,000/µL\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-16T02:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T22:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"medadmin0310\"\n    assert inst.medicationReference.reference == \"#med0304\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f007\"\n    assert inst.request.reference == \"MedicationRequest/medrx0306\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_5(base_settings):\n    \"\"\"No. 5 tests collection for MedicationAdministration.\n    Test File: medicationadministration0310.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0310.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_5(inst2)\n\n\ndef impl_medicationadministration_6(inst):\n    assert inst.contained[0].id == \"med0306\"\n    assert inst.context.display == \"encounter who leads to this prescription\"\n    assert inst.context.reference == \"Encounter/f001\"\n    assert inst.dosage.dose.code == \"TAB\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"TAB\"\n    assert float(inst.dosage.dose.value) == float(2)\n    assert inst.dosage.method.coding[0].code == \"421521009\"\n    assert (\n        inst.dosage.method.coding[0].display\n        == \"Swallow - dosing instruction imperative (qualifier value)\"\n    )\n    assert (\n        inst.dosage.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.route.coding[0].code == \"26643006\"\n    assert inst.dosage.route.coding[0].display == \"Oral Route\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == \"Two tablets at once\"\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T04:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"medadmin0306\"\n    assert inst.medicationReference.reference == \"#med0306\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f007\"\n    assert inst.performer[0].function.coding[0].code == \"performer\"\n    assert inst.performer[0].function.coding[0].display == \"Performer\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/med-admin-perform-function\"\n            }\n        ).valueUri\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0302\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_6(base_settings):\n    \"\"\"No. 6 tests collection for MedicationAdministration.\n    Test File: medicationadministration0306.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0306.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_6(inst2)\n\n\ndef impl_medicationadministration_7(inst):\n    assert inst.contained[0].id == \"med0318\"\n    assert inst.device[0].reference == \"Device/f001\"\n    assert inst.dosage.dose.code == \"mL\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mL\"\n    assert float(inst.dosage.dose.value) == float(1000)\n    assert inst.dosage.method.text == \"PICC line\"\n    assert inst.dosage.rateRatio.denominator.code == \"h\"\n    assert (\n        inst.dosage.rateRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.rateRatio.denominator.unit == \"h\"\n    assert float(inst.dosage.rateRatio.denominator.value) == float(1)\n    assert inst.dosage.rateRatio.numerator.code == \"mL\"\n    assert (\n        inst.dosage.rateRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.rateRatio.numerator.unit == \"mL\"\n    assert float(inst.dosage.rateRatio.numerator.value) == float(50)\n    assert inst.dosage.route.coding[0].code == \"255560000\"\n    assert inst.dosage.route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.site.coding[0].code == \"6073002\"\n    assert (\n        inst.dosage.site.coding[0].display\n        == \"Structure of ligament of left superior vena cava\"\n    )\n    assert (\n        inst.dosage.site.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.dosage.text\n        == \"1000mL infused at 50ml/hour for 4 hours - hung at 2200 hours\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-16T02:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T22:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"medadmin0309\"\n    assert inst.medicationReference.reference == \"#med0318\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f007\"\n    assert inst.performer[0].function.coding[0].code == \"performer\"\n    assert inst.performer[0].function.coding[0].display == \"Performer\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/med-admin-perform-function\"\n            }\n        ).valueUri\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0323\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_7(base_settings):\n    \"\"\"No. 7 tests collection for MedicationAdministration.\n    Test File: medicationadministration0309.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0309.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_7(inst2)\n\n\ndef impl_medicationadministration_8(inst):\n    assert inst.dosage.dose.code == \"mg\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mg\"\n    assert float(inst.dosage.dose.value) == float(240)\n    assert inst.dosage.site.coding[0].code == \"34402009\"\n    assert inst.dosage.site.coding[0].display == \"Rectum structure\"\n    assert (\n        inst.dosage.site.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == (\n        \"Insert one suppository rectally twice daily as needed for \"\n        \"fever to a maximim of 3 per day\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-16T02:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T22:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"medadmin0313\"\n    assert inst.medicationCodeableConcept.coding[0].code == \"322254008\"\n    assert (\n        inst.medicationCodeableConcept.coding[0].display\n        == \"Paracetamol 240mg suppository (product)\"\n    )\n    assert (\n        inst.medicationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f007\"\n    assert inst.reasonCode[0].coding[0].code == \"c\"\n    assert inst.reasonCode[0].coding[0].display == \"Emergency\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/reason-medication-given\"\n            }\n        ).valueUri\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0324\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_8(base_settings):\n    \"\"\"No. 8 tests collection for MedicationAdministration.\n    Test File: medicationadministration0313.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0313.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_8(inst2)\n\n\ndef impl_medicationadministration_9(inst):\n    assert inst.contained[0].id == \"med0306\"\n    assert inst.context.display == \"encounter who leads to this prescription\"\n    assert inst.context.reference == \"Encounter/f001\"\n    assert inst.dosage.dose.code == \"mg/kg\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mg/kg\"\n    assert float(inst.dosage.dose.value) == float(1.8)\n    assert inst.dosage.rateQuantity.code == \"min\"\n    assert (\n        inst.dosage.rateQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.rateQuantity.unit == \"min\"\n    assert float(inst.dosage.rateQuantity.value) == float(20)\n    assert inst.dosage.route.coding[0].code == \"255560000\"\n    assert inst.dosage.route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == \"1.8 mg/kg IV infusion over 30 minutes\"\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T04:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"medadmin0305\"\n    assert (\n        inst.instantiates[0]\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://www.bccancer.bc.ca/chemotherapy-protocols-site/Documents/Lymphoma-Myeloma/ULYBRENTUX%20Protocol_1Jun2017.pdf\"\n            }\n        ).valueUri\n    )\n    assert inst.medicationReference.reference == \"#med0306\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f007\"\n    assert inst.request.reference == \"MedicationRequest/medrx0316\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_9(base_settings):\n    \"\"\"No. 9 tests collection for MedicationAdministration.\n    Test File: medicationadministration0305.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0305.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_9(inst2)\n\n\ndef impl_medicationadministration_10(inst):\n    assert inst.contained[0].id == \"med0303\"\n    assert inst.context.display == \"encounter who leads to this prescription\"\n    assert inst.context.reference == \"Encounter/f001\"\n    assert inst.dosage.dose.code == \"mg\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mg\"\n    assert float(inst.dosage.dose.value) == float(3)\n    assert inst.dosage.method.coding[0].code == \"422145002\"\n    assert (\n        inst.dosage.method.coding[0].display\n        == \"Inject - dosing instruction imperative (qualifier value)\"\n    )\n    assert (\n        inst.dosage.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.route.coding[0].code == \"47625008\"\n    assert inst.dosage.route.coding[0].display == \"Intravenous route (qualifier value)\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == (\n        \"Rapid daily-dose escalation, until tolerated, from 3 mg/d, \"\n        \"and then 10 mg/d, to the recommended maintenance dose of 30 \"\n        \"mg IV over 120 min, 3 times per wk on alternate days for up \"\n        \"to 12 wk\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T04:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"medadmin0304\"\n    assert inst.medicationReference.reference == \"#med0303\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f007\"\n    assert inst.reasonReference[0].reference == \"Condition/f202\"\n    assert inst.request.reference == \"MedicationRequest/medrx0319\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_10(base_settings):\n    \"\"\"No. 10 tests collection for MedicationAdministration.\n    Test File: medicationadministration0304.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0304.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_medicationdispense.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationDispense\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import medicationdispense\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_medicationdispense_1(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0316\"\n    assert inst.contained[0].id == \"med0306\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(1)\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg/kg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg/kg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1.8\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"255560000\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == (\n        \"1.8 mg/kg IV infusion over 30 minutes every 3 weeks for 16 \" \"cycles\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.count == 16\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(3)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"wk\"\n    assert inst.id == \"meddisp0317\"\n    assert inst.medicationReference.display == \"Brentixumab Vedotin (Adcetris)\"\n    assert inst.medicationReference.reference == \"#med0306\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"415818005\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(3)\n    assert inst.status == \"stopped\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"TF\"\n    assert inst.type.coding[0].display == \"Trial Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenHandedOver\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-06-26T07:13:00+05:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-06-25T07:13:00+05:00\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_1(base_settings):\n    \"\"\"No. 1 tests collection for MedicationDispense.\n    Test File: medicationdispense0317.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0317.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_1(inst2)\n\n\ndef impl_medicationdispense_2(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0318\"\n    assert inst.contained[0].id == \"med0301\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(3)\n    assert inst.destination.reference == \"Location/ph\"\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        500\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].method.coding[0].code == \"420620005\"\n    assert (\n        inst.dosageInstruction[0].method.coding[0].display\n        == \"Push - dosing instruction imperative (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"255560000\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"500mg IV q6h x 3 days\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(6)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"h\"\n    assert inst.id == \"meddisp0301\"\n    assert inst.location.display == \"Pharmacy\"\n    assert inst.location.reference == \"Location/ukp\"\n    assert inst.medicationReference.display == \"Vancomycin Hydrochloride\"\n    assert inst.medicationReference.reference == \"#med0301\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"733026001\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info.sct\"}\n        ).valueUri\n    )\n    assert inst.quantity.unit == \"Vial\"\n    assert float(inst.quantity.value) == float(12)\n    assert inst.receiver[0].display == \"Donald Duck\"\n    assert inst.receiver[0].reference == \"Patient/pat1\"\n    assert inst.status == \"in-progress\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.supportingInformation[0].reference == \"Condition/f203\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"EM\"\n    assert inst.type.coding[0].display == \"Emergency Supply\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T10:20:00Z\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_2(base_settings):\n    \"\"\"No. 2 tests collection for MedicationDispense.\n    Test File: medicationdispense0301.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0301.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_2(inst2)\n\n\ndef impl_medicationdispense_3(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0321\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(10)\n    assert (\n        inst.dosageInstruction[0].additionalInstruction[0].coding[0].code == \"418914006\"\n    )\n    assert inst.dosageInstruction[0].additionalInstruction[0].coding[0].display == (\n        \"Warning. May cause drowsiness. If affected do not drive or \"\n        \"operate machinery. Avoid alcoholic drink (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].additionalInstruction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].code == \"203082005\"\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].display\n        == \"Fibromyalgia (disorder)\"\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"TAB\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"TAB\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"26643006\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Oral Route\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert (\n        inst.dosageInstruction[0].text == \"1 tablet every four hours as needed for pain\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(4)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"h\"\n    assert inst.id == \"meddisp0321\"\n    assert inst.medicationCodeableConcept.coding[0].code == \"0074-3043-13\"\n    assert (\n        inst.medicationCodeableConcept.coding[0].display\n        == \"Vicodin 5mg Hydrocodone, 500mg Acetaminophen tablet\"\n    )\n    assert (\n        inst.medicationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"TAB\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(30)\n    assert inst.status == \"in-progress\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"RFP\"\n    assert inst.type.coding[0].display == \"Refill - Part Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T10:20:00Z\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_3(base_settings):\n    \"\"\"No. 3 tests collection for MedicationDispense.\n    Test File: medicationdispense0321.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0321.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_3(inst2)\n\n\ndef impl_medicationdispense_4(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0323\"\n    assert inst.contained[0].id == \"med0318\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(1)\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mL\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mL\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1000\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.code == \"h\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.unit == \"h\"\n    assert float(\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.value\n    ) == float(1)\n    assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.code == \"mL\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.unit == \"mL\"\n    assert float(\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.value\n    ) == float(50)\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"255560000\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert (\n        inst.dosageInstruction[0].text\n        == \"1000mL infused at 50ml/hour for 4 hours - hang at 2200 hours\"\n    )\n    assert (\n        inst.dosageInstruction[0].timing.event[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T22:00:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(24)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"h\"\n    assert inst.id == \"meddisp0320\"\n    assert inst.medicationReference.display == \"TPN Solution\"\n    assert inst.medicationReference.reference == \"#med0318\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"ml\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(1000)\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.whenHandedOver\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-17T17:13:00+05:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-16T17:13:00+05:00\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_4(base_settings):\n    \"\"\"No. 4 tests collection for MedicationDispense.\n    Test File: medicationdispense0320.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0320.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_4(inst2)\n\n\ndef impl_medicationdispense_5(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0320\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(30)\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"U\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"U\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        20\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"263887005\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].display\n        == \"Subcutaneous (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"20 Units SC three times daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 3\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"meddisp0316\"\n    assert inst.medicationCodeableConcept.coding[0].code == \"285018\"\n    assert (\n        inst.medicationCodeableConcept.coding[0].display\n        == \"Lantus 100 unit/ml injectable solution\"\n    )\n    assert (\n        inst.medicationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"ml\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(10)\n    assert inst.status == \"in-progress\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"RFP\"\n    assert inst.type.coding[0].display == \"Refill - Part Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-06-25T07:13:00+05:00\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_5(base_settings):\n    \"\"\"No. 5 tests collection for MedicationDispense.\n    Test File: medicationdispense0316.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0316.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_5(inst2)\n\n\ndef impl_medicationdispense_6(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0321\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(30)\n    assert inst.dosageInstruction[0].additionalInstruction[0].text == \"Shake Well\"\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"ORINHL\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"ea\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"Use two sprays twice daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 2\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"meddisp0327\"\n    assert inst.medicationCodeableConcept.coding[0].code == \"746763\"\n    assert inst.medicationCodeableConcept.coding[0].display == (\n        \"Proventil 0.09mg/actuat (Albuterol sulfate 0.108mg/actuat \" \"from mouthpiece)\"\n    )\n    assert (\n        inst.medicationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"ml\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(30)\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"TF\"\n    assert inst.type.coding[0].display == \"Trial Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenHandedOver\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T16:20:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T10:20:00Z\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_6(base_settings):\n    \"\"\"No. 6 tests collection for MedicationDispense.\n    Test File: medicationdispense0327.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0327.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_6(inst2)\n\n\ndef impl_medicationdispense_7(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0309\"\n    assert inst.contained[0].id == \"medexample015\"\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        500\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"394899003\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].display\n        == \"oral administration of treatment\"\n    )\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 2\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(21)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"meddisp008\"\n    assert inst.medicationReference.reference == \"#medexample015\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationdispense_7(base_settings):\n    \"\"\"No. 7 tests collection for MedicationDispense.\n    Test File: medicationdispenseexample8.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispenseexample8.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_7(inst2)\n\n\ndef impl_medicationdispense_8(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0331\"\n    assert inst.contained[0].id == \"med0352\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(1)\n    assert inst.dosageInstruction[0].additionalInstruction[0].text == (\n        \"Take along with one 2mg Coumadin tablet for a total daily \"\n        \"dose of 7mg as prescribed by physician\"\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        2\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert (\n        inst.dosageInstruction[0].text\n        == \"7mg (=one 5mg tablet PLUS one 2mg tablet) once daily\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"meddisp0331\"\n    assert inst.medicationReference.display == \"Coumadin 2mg tablet\"\n    assert inst.medicationReference.reference == \"#med0352\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"415818006\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(1)\n    assert inst.status == \"in-progress\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"DF\"\n    assert inst.type.coding[0].display == \"Daily Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T10:20:00Z\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_8(base_settings):\n    \"\"\"No. 8 tests collection for MedicationDispense.\n    Test File: medicationdispense0331.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0331.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_8(inst2)\n\n\ndef impl_medicationdispense_9(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0324\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(10)\n    assert (\n        inst.dosageInstruction[0].additionalInstruction[0].coding[0].code == \"418637003\"\n    )\n    assert inst.dosageInstruction[0].additionalInstruction[0].coding[0].display == (\n        \"Do not take with any other paracetamol products (qualifier \" \"value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].additionalInstruction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].code == \"386661006\"\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].display\n        == \"Fever (finding)\"\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        240\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].maxDosePerPeriod.denominator.code == \"d\"\n    assert (\n        inst.dosageInstruction[0].maxDosePerPeriod.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosageInstruction[0].maxDosePerPeriod.denominator.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].maxDosePerPeriod.numerator.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].maxDosePerPeriod.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosageInstruction[0].maxDosePerPeriod.numerator.value) == float(\n        720\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == (\n        \"Insert two suppositories (240mg) rectally twice daily as \"\n        \"needed for fever to a maximim of 6 per day\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 2\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"meddisp0311\"\n    assert inst.medicationCodeableConcept.coding[0].code == \"0713-0118\"\n    assert (\n        inst.medicationCodeableConcept.coding[0].display\n        == \"Acetaminophen 120mg Suppository\"\n    )\n    assert (\n        inst.medicationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"RECSUPP\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(60)\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"RFP\"\n    assert inst.type.coding[0].display == \"Refill - Part Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenHandedOver\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T16:20:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T10:20:00Z\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_9(base_settings):\n    \"\"\"No. 9 tests collection for MedicationDispense.\n    Test File: medicationdispense0311.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0311.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_9(inst2)\n\n\ndef impl_medicationdispense_10(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0306\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(30)\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        6\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"calculated\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Calculated\"\n    )\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"Take 3 tablets (6mg) once daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"meddisp0307\"\n    assert inst.medicationCodeableConcept.coding[0].code == \"76388-713-25\"\n    assert (\n        inst.medicationCodeableConcept.coding[0].display\n        == \"Myleran 2mg tablet, film coated\"\n    )\n    assert (\n        inst.medicationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"TAB\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(90)\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"RFP\"\n    assert inst.type.coding[0].display == \"Refill - Part Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenHandedOver\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T16:20:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T10:20:00Z\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_10(base_settings):\n    \"\"\"No. 10 tests collection for MedicationDispense.\n    Test File: medicationdispense0307.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0307.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_medicationknowledge.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationKnowledge\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import medicationknowledge\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_medicationknowledge_1(inst):\n    assert inst.amount.unit == \"mg/ml\"\n    assert float(inst.amount.value) == float(50)\n    assert inst.code.coding[0].code == \"0409-6531-02\"\n    assert (\n        inst.code.coding[0].display\n        == \"Vancomycin Hydrochloride (VANCOMYCIN HYDROCHLORIDE)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"org4\"\n    assert inst.doseForm.coding[0].code == \"385268001\"\n    assert inst.doseForm.coding[0].display == \"Oral Dose Form (qualifier value)\"\n    assert (\n        inst.doseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert inst.manufacturer.reference == \"#org4\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.synonym[0] == \"Vancomycin Hydrochloride (VANCOMYCIN HYDROCHLORIDE)\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationknowledge_1(base_settings):\n    \"\"\"No. 1 tests collection for MedicationKnowledge.\n    Test File: medicationknowledge-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationknowledge-example.json\"\n    inst = medicationknowledge.MedicationKnowledge.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationKnowledge\" == inst.get_resource_type()\n\n    impl_medicationknowledge_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationKnowledge\" == data[\"resourceType\"]\n\n    inst2 = medicationknowledge.MedicationKnowledge(**data)\n    impl_medicationknowledge_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_medicationrequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import medicationrequest\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_medicationrequest_1(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.code == \"d\"\n    assert (\n        inst.dispenseRequest.expectedSupplyDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.unit == \"days\"\n    assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30)\n    assert inst.dispenseRequest.numberOfRepeatsAllowed == 3\n    assert inst.dispenseRequest.quantity.code == \"mL\"\n    assert (\n        inst.dispenseRequest.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.quantity.unit == \"mL\"\n    assert float(inst.dispenseRequest.quantity.value) == float(30)\n    assert (\n        inst.dispenseRequest.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dispenseRequest.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dosageInstruction[0].additionalInstruction[0].text == \"Shake Well\"\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"ORINHL\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"ea\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"Use two sprays twice daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 2\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"medrx0326\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medicationCodeableConcept.coding[0].code == \"746763\"\n    assert (\n        inst.medicationCodeableConcept.coding[0].display\n        == \"Proventil HFA 90mcg/actuat metered dose inhaler, 200 actuat\"\n    )\n    assert (\n        inst.medicationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"on-hold\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.substitution.allowedBoolean is True\n    assert inst.substitution.reason.coding[0].code == \"FP\"\n    assert inst.substitution.reason.coding[0].display == \"formulary policy\"\n    assert (\n        inst.substitution.reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_1(base_settings):\n    \"\"\"No. 1 tests collection for MedicationRequest.\n    Test File: medicationrequest0326.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0326.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_1(inst2)\n\n\ndef impl_medicationrequest_2(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0305\"\n    assert inst.dispenseRequest.expectedSupplyDuration.code == \"d\"\n    assert (\n        inst.dispenseRequest.expectedSupplyDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.unit == \"days\"\n    assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30)\n    assert inst.dispenseRequest.numberOfRepeatsAllowed == 1\n    assert inst.dispenseRequest.quantity.code == \"mL\"\n    assert (\n        inst.dispenseRequest.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.quantity.unit == \"mL\"\n    assert float(inst.dispenseRequest.quantity.value) == float(10)\n    assert (\n        inst.dispenseRequest.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dispenseRequest.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"OPDROP\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"OPDROP\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].method.coding[0].code == \"421538008\"\n    assert (\n        inst.dosageInstruction[0].method.coding[0].display\n        == \"Instill - dosing instruction imperative (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"54485002\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].display\n        == \"Ophthalmic route (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"Instil one drop in each eye twice daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 2\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f002\"\n    assert inst.id == \"medrx0330\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medicationReference.reference == \"#med0305\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.substitution.allowedBoolean is False\n    assert inst.substitution.reason.coding[0].code == \"FP\"\n    assert inst.substitution.reason.coding[0].display == \"formulary policy\"\n    assert (\n        inst.substitution.reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_2(base_settings):\n    \"\"\"No. 2 tests collection for MedicationRequest.\n    Test File: medicationrequest0330.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0330.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_2(inst2)\n\n\ndef impl_medicationrequest_3(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0309\"\n    assert inst.dosageInstruction[0].additionalInstruction[0].text == \"Take at bedtime\"\n    assert (\n        inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].code == \"32914008\"\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].display\n        == \"Restless Legs\"\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseRange.high.code == \"TAB\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseRange.high.unit == \"TAB\"\n    assert float(\n        inst.dosageInstruction[0].doseAndRate[0].doseRange.high.value\n    ) == float(2)\n    assert inst.dosageInstruction[0].doseAndRate[0].doseRange.low.code == \"TAB\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseRange.low.unit == \"TAB\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseRange.low.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"26643006\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Oral Route\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == (\n        \"Take 1-2 tablets once daily at bedtime as needed for \" \"restless legs\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"medrx0310\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medicationReference.reference == \"#med0309\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_3(base_settings):\n    \"\"\"No. 3 tests collection for MedicationRequest.\n    Test File: medicationrequest0310.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0310.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_3(inst2)\n\n\ndef impl_medicationrequest_4(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0304\"\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        6\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"26643006\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].display\n        == \"Oral route (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == (\n        \"6 mg PO daily for remission induction; adjust dosage to \"\n        \"white blood cell (WBC) count.  With hold treatment if WBC is\"\n        \" less than 15,000/µL; resume when WBC is greater than \"\n        \"50,000/µL\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"medrx0306\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medicationReference.display == \"Myleran 2mg tablet\"\n    assert inst.medicationReference.reference == \"#med0304\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.reasonCode[0].coding[0].code == \"92818009\"\n    assert inst.reasonCode[0].coding[0].display == \"Chronic myeloid Leukemia (disorder)\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_4(base_settings):\n    \"\"\"No. 4 tests collection for MedicationRequest.\n    Test File: medicationrequest0306.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0306.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_4(inst2)\n\n\ndef impl_medicationrequest_5(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0308\"\n    assert inst.dispenseRequest.expectedSupplyDuration.code == \"d\"\n    assert (\n        inst.dispenseRequest.expectedSupplyDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.unit == \"days\"\n    assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(10)\n    assert inst.dispenseRequest.quantity.code == \"TAB\"\n    assert (\n        inst.dispenseRequest.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.quantity.unit == \"TAB\"\n    assert float(inst.dispenseRequest.quantity.value) == float(30)\n    assert (\n        inst.dispenseRequest.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dispenseRequest.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dosageInstruction[0].additionalInstruction[0].coding[0].code == \"418914006\"\n    )\n    assert inst.dosageInstruction[0].additionalInstruction[0].coding[0].display == (\n        \"Warning. May cause drowsiness. If affected do not drive or \"\n        \"operate machinery. Avoid alcoholic drink (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].additionalInstruction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].code == \"203082005\"\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].display\n        == \"Fibromyalgia (disorder)\"\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"TAB\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"TAB\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"26643006\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Oral Route\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert (\n        inst.dosageInstruction[0].text == \"1 tablet every four hours as needed for pain\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(4)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"h\"\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"medrx0307\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medicationReference.reference == \"#med0308\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.substitution.allowedBoolean is True\n    assert inst.substitution.reason.coding[0].code == \"FP\"\n    assert inst.substitution.reason.coding[0].display == \"formulary policy\"\n    assert (\n        inst.substitution.reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_5(base_settings):\n    \"\"\"No. 5 tests collection for MedicationRequest.\n    Test File: medicationrequest0307.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0307.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_5(inst2)\n\n\ndef impl_medicationrequest_6(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0350\"\n    assert inst.dispenseRequest.expectedSupplyDuration.code == \"d\"\n    assert (\n        inst.dispenseRequest.expectedSupplyDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.unit == \"days\"\n    assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30)\n    assert inst.dispenseRequest.numberOfRepeatsAllowed == 3\n    assert inst.dispenseRequest.quantity.code == \"TAB\"\n    assert (\n        inst.dispenseRequest.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.quantity.unit == \"TAB\"\n    assert float(inst.dispenseRequest.quantity.value) == float(30)\n    assert (\n        inst.dispenseRequest.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dispenseRequest.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        7\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"7mg once daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"medrx0331\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medicationReference.reference == \"#med0350\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.substitution.allowedBoolean is True\n    assert inst.substitution.reason.coding[0].code == \"FP\"\n    assert inst.substitution.reason.coding[0].display == \"formulary policy\"\n    assert (\n        inst.substitution.reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_6(base_settings):\n    \"\"\"No. 6 tests collection for MedicationRequest.\n    Test File: medicationrequest0331.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0331.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_6(inst2)\n\n\ndef impl_medicationrequest_7(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.code == \"d\"\n    assert (\n        inst.dispenseRequest.expectedSupplyDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.unit == \"days\"\n    assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(14)\n    assert inst.dispenseRequest.quantity.code == \"PATCH\"\n    assert (\n        inst.dispenseRequest.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.quantity.unit == \"patch\"\n    assert float(inst.dispenseRequest.quantity.value) == float(6)\n    assert (\n        inst.dispenseRequest.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dispenseRequest.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"PATCH\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"patch\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"apply one patch three times per week\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 3\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"wk\"\n    assert inst.id == \"medrx0327\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medicationCodeableConcept.coding[0].code == \"333919005\"\n    assert (\n        inst.medicationCodeableConcept.coding[0].display\n        == \"Fentanyl 25micrograms/hour patch (product)\"\n    )\n    assert (\n        inst.medicationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_7(base_settings):\n    \"\"\"No. 7 tests collection for MedicationRequest.\n    Test File: medicationrequest0327.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0327.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_7(inst2)\n\n\ndef impl_medicationrequest_8(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0306\"\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg/kg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg/kg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1.8\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.code == \"min\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.value\n    ) == float(20)\n    assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.code == \"mg/kg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.value\n    ) == float(1.8)\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].maxDosePerLifetime.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].maxDosePerLifetime.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].maxDosePerLifetime.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].maxDosePerLifetime.value) == float(400)\n    assert inst.dosageInstruction[0].route.coding[0].code == \"255560000\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == (\n        \"1.8 mg/kg IV infusion over 20 minutes every 3 weeks for 16 \" \"cycles\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.count == 16\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(3)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"wk\"\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"medrx0316\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert (\n        inst.instantiatesUri[0]\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://www.bccancer.bc.ca/chemotherapy-protocols-site/Documents/Lymphoma-Myeloma/ULYBRENTUX%20Protocol_1Jun2017.pdf\"\n            }\n        ).valueUri\n    )\n    assert inst.intent == \"order\"\n    assert inst.medicationReference.reference == \"#med0306\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_8(base_settings):\n    \"\"\"No. 8 tests collection for MedicationRequest.\n    Test File: medicationrequest0316.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0316.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_8(inst2)\n\n\ndef impl_medicationrequest_9(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.code == \"d\"\n    assert (\n        inst.dispenseRequest.expectedSupplyDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.unit == \"days\"\n    assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30)\n    assert inst.dispenseRequest.numberOfRepeatsAllowed == 6\n    assert inst.dispenseRequest.quantity.code == \"mL\"\n    assert (\n        inst.dispenseRequest.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.quantity.unit == \"mL\"\n    assert float(inst.dispenseRequest.quantity.value) == float(10)\n    assert (\n        inst.dispenseRequest.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dispenseRequest.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"U\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"U\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        20\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"263887005\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].display\n        == \"Subcutaneous (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"20 Units SC three times daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 3\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"medrx0320\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medicationCodeableConcept.coding[0].code == \"285018\"\n    assert (\n        inst.medicationCodeableConcept.coding[0].display\n        == \"Lantus 100 unit/ml injectable solution\"\n    )\n    assert (\n        inst.medicationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.reasonCode[0].coding[0].code == \"473189005\"\n    assert (\n        inst.reasonCode[0].coding[0].display\n        == \"On subcutaneous insulin for diabetes mellitus (finding)\"\n    )\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_9(base_settings):\n    \"\"\"No. 9 tests collection for MedicationRequest.\n    Test File: medicationrequest0320.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0320.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_9(inst2)\n\n\ndef impl_medicationrequest_10(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0336\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].rateQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].rateQuantity.unit == \"ug/kg/min\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].rateQuantity.value) == float(\n        4\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"47625008\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].display\n        == \"Intravenous route (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"Dopamine 4mcg/kg/min\"\n    assert float(inst.dosageInstruction[0].timing.repeat.duration) == float(33.33)\n    assert inst.dosageInstruction[0].timing.repeat.durationUnit == \"h\"\n    assert inst.id == \"medrx0336\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medicationReference.display == \"Dopamine 400mg in 500mL D5W\"\n    assert inst.medicationReference.reference == \"#med0336\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.supportingInformation[0].reference == \"Observation/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_10(base_settings):\n    \"\"\"No. 10 tests collection for MedicationRequest.\n    Test File: medicationrequest0336.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0336.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_medicationstatement.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationStatement\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import medicationstatement\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_medicationstatement_1(inst):\n    assert inst.basedOn[0].reference == \"CarePlan/gpvisit\"\n    assert inst.context.reference == \"Encounter/f203\"\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-22\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-01-23\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example005\"\n    assert inst.informationSource.display == \"Donald Duck\"\n    assert inst.informationSource.reference == \"Patient/pat1\"\n    assert inst.medicationCodeableConcept.coding[0].code == \"27658006\"\n    assert inst.medicationCodeableConcept.coding[0].display == \"Amoxicillin (product)\"\n    assert (\n        inst.medicationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Patient indicated that they thought it was Amoxicillin they \"\n        \"were taking but it was really Erythromycin\"\n    )\n    assert inst.status == \"entered-in-error\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_1(base_settings):\n    \"\"\"No. 1 tests collection for MedicationStatement.\n    Test File: medicationstatementexample5.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample5.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_1(inst2)\n\n\ndef impl_medicationstatement_2(inst):\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-22\"}\n        ).valueDateTime\n    )\n    assert inst.dosage[0].asNeededBoolean is False\n    assert inst.dosage[0].maxDosePerPeriod.denominator.code == \"d\"\n    assert (\n        inst.dosage[0].maxDosePerPeriod.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[0].maxDosePerPeriod.denominator.value) == float(1)\n    assert inst.dosage[0].maxDosePerPeriod.numerator.code == \"385055001\"\n    assert (\n        inst.dosage[0].maxDosePerPeriod.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].maxDosePerPeriod.numerator.unit == \"capsules\"\n    assert float(inst.dosage[0].maxDosePerPeriod.numerator.value) == float(3)\n    assert inst.dosage[0].route.coding[0].code == \"260548002\"\n    assert inst.dosage[0].route.coding[0].display == \"Oral\"\n    assert (\n        inst.dosage[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].text == \"one capsule three times daily\"\n    assert inst.dosage[0].timing.repeat.frequency == 3\n    assert float(inst.dosage[0].timing.repeat.period) == float(1)\n    assert inst.dosage[0].timing.repeat.periodUnit == \"d\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-01-23\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example004\"\n    assert inst.informationSource.display == \"Donald Duck\"\n    assert inst.informationSource.reference == \"Patient/pat1\"\n    assert inst.medicationCodeableConcept.coding[0].code == \"27658006\"\n    assert inst.medicationCodeableConcept.coding[0].display == \"Amoxicillin (product)\"\n    assert (\n        inst.medicationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Patient indicates they miss the occasional dose\"\n    assert inst.partOf[0].reference == \"Observation/blood-pressure\"\n    assert inst.reasonCode[0].coding[0].code == \"65363002\"\n    assert inst.reasonCode[0].coding[0].display == \"Otitis Media\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_2(base_settings):\n    \"\"\"No. 2 tests collection for MedicationStatement.\n    Test File: medicationstatementexample4.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample4.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_2(inst2)\n\n\ndef impl_medicationstatement_3(inst):\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-22\"}\n        ).valueDateTime\n    )\n    assert inst.dosage[0].asNeededBoolean is False\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.code == \"TAB\"\n    assert (\n        inst.dosage[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == \"tab\"\n    assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(1)\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosage[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].maxDosePerPeriod.denominator.code == \"d\"\n    assert (\n        inst.dosage[0].maxDosePerPeriod.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[0].maxDosePerPeriod.denominator.value) == float(1)\n    assert float(inst.dosage[0].maxDosePerPeriod.numerator.value) == float(1)\n    assert inst.dosage[0].route.coding[0].code == \"260548002\"\n    assert inst.dosage[0].route.coding[0].display == \"Oral\"\n    assert (\n        inst.dosage[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].sequence == 1\n    assert inst.dosage[0].text == \"1 tablet per day\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-01\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example003\"\n    assert inst.informationSource.display == \"Donald Duck\"\n    assert inst.informationSource.reference == \"Patient/pat1\"\n    assert inst.medicationCodeableConcept.text == \"Little Pink Pill for water retention\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Patient cannot remember the name of the tablet, but takes it\"\n        \" every day in the morning for water retention\"\n    )\n    assert inst.reasonReference[0].reference == \"Observation/blood-pressure\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_3(base_settings):\n    \"\"\"No. 3 tests collection for MedicationStatement.\n    Test File: medicationstatementexample3.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample3.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_3(inst2)\n\n\ndef impl_medicationstatement_4(inst):\n    assert inst.contained[0].id == \"med0309\"\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-22\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-23\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example002\"\n    assert inst.informationSource.display == \"Donald Duck\"\n    assert inst.informationSource.reference == \"Patient/pat1\"\n    assert inst.medicationReference.reference == \"#med0309\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.note[0].text == \"Patient cannot take acetaminophen as per Dr instructions\"\n    )\n    assert inst.status == \"active\"\n    assert inst.statusReason[0].coding[0].code == \"166643006\"\n    assert inst.statusReason[0].coding[0].display == \"Liver enzymes abnormal\"\n    assert (\n        inst.statusReason[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_4(base_settings):\n    \"\"\"No. 4 tests collection for MedicationStatement.\n    Test File: medicationstatementexample2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample2.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_4(inst2)\n\n\ndef impl_medicationstatement_5(inst):\n    assert inst.category.coding[0].code == \"inpatient\"\n    assert inst.category.coding[0].display == \"Inpatient\"\n    assert (\n        inst.category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/medication-statement-category\"\n            }\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"med0309\"\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-22\"}\n        ).valueDateTime\n    )\n    assert inst.derivedFrom[0].reference == \"MedicationRequest/medrx002\"\n    assert inst.dosage[0].additionalInstruction[0].text == \"Taking at bedtime\"\n    assert inst.dosage[0].asNeededCodeableConcept.coding[0].code == \"32914008\"\n    assert inst.dosage[0].asNeededCodeableConcept.coding[0].display == \"Restless Legs\"\n    assert (\n        inst.dosage[0].asNeededCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].doseAndRate[0].doseRange.high.code == \"TAB\"\n    assert (\n        inst.dosage[0].doseAndRate[0].doseRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].doseAndRate[0].doseRange.high.unit == \"TAB\"\n    assert float(inst.dosage[0].doseAndRate[0].doseRange.high.value) == float(2)\n    assert inst.dosage[0].doseAndRate[0].doseRange.low.code == \"TAB\"\n    assert (\n        inst.dosage[0].doseAndRate[0].doseRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].doseAndRate[0].doseRange.low.unit == \"TAB\"\n    assert float(inst.dosage[0].doseAndRate[0].doseRange.low.value) == float(1)\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosage[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].route.coding[0].code == \"26643006\"\n    assert inst.dosage[0].route.coding[0].display == \"Oral Route\"\n    assert (\n        inst.dosage[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].sequence == 1\n    assert inst.dosage[0].text == (\n        \"1-2 tablets once daily at bedtime as needed for restless \" \"legs\"\n    )\n    assert inst.dosage[0].timing.repeat.frequency == 1\n    assert float(inst.dosage[0].timing.repeat.period) == float(1)\n    assert inst.dosage[0].timing.repeat.periodUnit == \"d\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-23\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/medstatements\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.informationSource.display == \"Donald Duck\"\n    assert inst.informationSource.reference == \"Patient/pat1\"\n    assert inst.medicationReference.reference == \"#med0309\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Patient indicates they miss the occasional dose\"\n    assert inst.reasonCode[0].coding[0].code == \"32914008\"\n    assert inst.reasonCode[0].coding[0].display == \"Restless Legs\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_5(base_settings):\n    \"\"\"No. 5 tests collection for MedicationStatement.\n    Test File: medicationstatementexample1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample1.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_5(inst2)\n\n\ndef impl_medicationstatement_6(inst):\n    assert inst.contained[0].id == \"med0315\"\n    assert inst.id == \"example007\"\n    assert inst.informationSource.display == \"Donald Duck\"\n    assert inst.informationSource.reference == \"Patient/pat1\"\n    assert inst.medicationReference.reference == \"#med0315\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"patient plans to start using for seasonal allergies in the \"\n        \"Spring when pollen is in the air\"\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_6(base_settings):\n    \"\"\"No. 6 tests collection for MedicationStatement.\n    Test File: medicationstatementexample7.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample7.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_6(inst2)\n\n\ndef impl_medicationstatement_7(inst):\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-22\"}\n        ).valueDateTime\n    )\n    assert inst.dosage[0].asNeededBoolean is False\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.code == \"mL\"\n    assert (\n        inst.dosage[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == \"mL\"\n    assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(5)\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosage[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].maxDosePerPeriod.denominator.code == \"d\"\n    assert (\n        inst.dosage[0].maxDosePerPeriod.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[0].maxDosePerPeriod.denominator.value) == float(1)\n    assert float(inst.dosage[0].maxDosePerPeriod.numerator.value) == float(3)\n    assert inst.dosage[0].route.coding[0].code == \"260548002\"\n    assert inst.dosage[0].route.coding[0].display == \"Oral\"\n    assert (\n        inst.dosage[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].sequence == 1\n    assert inst.dosage[0].text == \"5ml three times daily\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-01\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example006\"\n    assert inst.informationSource.display == \"Peter Chalmers\"\n    assert inst.informationSource.reference == \"RelatedPerson/peter\"\n    assert inst.medicationCodeableConcept.coding[0].code == \"27658006\"\n    assert inst.medicationCodeableConcept.coding[0].display == \"Amoxicillin (product)\"\n    assert (\n        inst.medicationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Father indicates they miss the occasional dose\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_7(base_settings):\n    \"\"\"No. 7 tests collection for MedicationStatement.\n    Test File: medicationstatementexample6.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample6.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_7(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_medicinalproductdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicinalProductDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import medicinalproductdefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_medicinalproductdefinition_1(inst):\n    assert inst.contained[0].id == \"ppd1\"\n    assert inst.contained[1].id == \"i1\"\n    assert inst.id == \"product-with-contained-package-and-ingredient\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"Exampleocillin\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-with-contained-package-and-ingredient.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-with-contained-package-and-ingredient.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_1(inst2)\n\n\ndef impl_medicinalproductdefinition_2(inst):\n    assert inst.classification[0].coding[0].code == \"B01A\"\n    assert (\n        inst.classification[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.whocc.no/atc/example\"}\n        ).valueUri\n    )\n    assert inst.combinedPharmaceuticalDoseForm.coding[0].code == \"tablet\"\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/dosefom\"}\n        ).valueUri\n    )\n    assert (\n        inst.crossReference[0].product.reference.reference\n        == \"MedicinalProductDefinition/genericEquilidonium\"\n    )\n    assert inst.id == \"equilidem-basics\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/product\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"Equilidem25\"\n    assert inst.ingredient[0].text == \"Equilidonium Phosphate\"\n    assert inst.ingredient[1].text == \"Calcium Carbonate\"\n    assert inst.legalStatusOfSupply.coding[0].code == \"POM\"\n    assert inst.legalStatusOfSupply.coding[0].display == \"Prescription only medicine\"\n    assert (\n        inst.legalStatusOfSupply.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/legalstatusofsupply\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"Equilidem 2.5 mg film-coated tablets\"\n    assert inst.operation[0].organization[0].display == \"EquiliDrugCo Inc.\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-example-equilidem-basics.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-example-equilidem-basics.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_2(inst2)\n\n\ndef impl_medicinalproductdefinition_3(inst):\n    assert inst.classification[0].coding[0].code == \"B01A\"\n    assert (\n        inst.classification[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.whocc.no/atc/example\"}\n        ).valueUri\n    )\n    assert inst.combinedPharmaceuticalDoseForm.coding[0].code == \"tablet\"\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/dosefom\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"EquilidoniumPhosphate\"\n    assert inst.contained[1].id == \"CalciumCarbonate\"\n    assert (\n        inst.crossReference[0].product.reference.reference\n        == \"MedicinalProductDefinition/genericEquilidonium\"\n    )\n    assert inst.id == \"equilidem-with-ing-and-auth\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/product\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"Equilidem25\"\n    assert inst.legalStatusOfSupply.coding[0].code == \"POM\"\n    assert inst.legalStatusOfSupply.coding[0].display == \"Prescription only medicine\"\n    assert (\n        inst.legalStatusOfSupply.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/legalstatusofsupply\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"Equilidem 2.5 mg film-coated tablets\"\n    assert inst.operation[0].organization[0].display == \"EquiliDrugCo Processing Inc.\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-example-equilidem-using-ingredient-and-auth.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-example-equilidem-using-ingredient-and-auth.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_3(inst2)\n\n\ndef impl_medicinalproductdefinition_4(inst):\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].code == \"solution for injection\"\n    )\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/doseform\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"package\"\n    assert inst.contained[1].id == \"syringeDevice\"\n    assert inst.contained[2].id == \"liquidItem\"\n    assert inst.id == \"drug-and-device\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/product\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"Wonderdrug+\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"Wonderdrug+ liquid 20ml\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_4(base_settings):\n    \"\"\"No. 4 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-example-co-packaged-liquid-and-syringe.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-example-co-packaged-liquid-and-syringe.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_4(inst2)\n\n\ndef impl_medicinalproductdefinition_5(inst):\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].code\n        == \"Powder and solution for injection with itegral syringe\"\n    )\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/doseform\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"package\"\n    assert inst.contained[1].id == \"solventItem\"\n    assert inst.contained[2].id == \"powderItem\"\n    assert inst.contained[3].id == \"syringeDevice\"\n    assert inst.contained[4].id == \"administrable-form\"\n    assert inst.id == \"drug-and-device-complete\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/product\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"Wonderdrug+\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"Wonderdrug liquid 20ml (integral syringe)\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_5(base_settings):\n    \"\"\"No. 5 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-example-co-packaged-liquid-and-syringe-complete.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-example-co-packaged-liquid-and-syringe-complete.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_5(inst2)\n\n\ndef impl_medicinalproductdefinition_6(inst):\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].code\n        == \"Tablet and Cream for topical application\"\n    )\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/doseform\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"packageCombo\"\n    assert inst.contained[1].id == \"tabletItem\"\n    assert inst.contained[2].id == \"creamItem\"\n    assert inst.id == \"drug-combo-product\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/product\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"ThrushTreatCombo\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"ThrushTreat Combo\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_6(base_settings):\n    \"\"\"No. 6 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-example-combo-product.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-example-combo-product.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_6(inst2)\n\n\ndef impl_medicinalproductdefinition_7(inst):\n    assert inst.contained[0].id == \"Acetamin-pack-20\"\n    assert inst.contained[1].id == \"Acetamin-tab-500\"\n    assert inst.id == \"Acetamin-500-20-generic\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.nation.org/drugs\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"Acetaminophen 500 mg tablets [generic]\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_7(base_settings):\n    \"\"\"No. 7 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-acetaminophen-500mg-tablets-box-of-20.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-acetaminophen-500mg-tablets-box-of-20.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_7(inst2)\n\n\ndef impl_medicinalproductdefinition_8(inst):\n    assert inst.attachedDocument[0].reference == \"DocumentReference/example\"\n    assert inst.classification[0].coding[0].code == \"B01AF02\"\n    assert (\n        inst.classification[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://ema.europa.eu/example/WHOAnatomicalTherapeuticChemicalATCClassificationSystem\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/MPID\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"{mpid}\"\n    assert inst.masterFile[0].reference == \"DocumentReference/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].countryLanguage[0].country.coding[0].code == \"EU\"\n    assert (\n        inst.name[0].countryLanguage[0].country.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/countryCode\"}\n        ).valueUri\n    )\n    assert inst.name[0].countryLanguage[0].jurisdiction.coding[0].code == \"EU\"\n    assert (\n        inst.name[0].countryLanguage[0].jurisdiction.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/jurisdictionCode\"}\n        ).valueUri\n    )\n    assert inst.name[0].countryLanguage[0].language.coding[0].code == \"EN\"\n    assert (\n        inst.name[0].countryLanguage[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/languageCode\"}\n        ).valueUri\n    )\n    assert inst.name[0].namePart[0].part == \"Equilidem\"\n    assert inst.name[0].namePart[0].type.coding[0].code == \"INV\"\n    assert inst.name[0].namePart[1].part == \"2.5 mg\"\n    assert inst.name[0].namePart[1].type.coding[0].code == \"STR\"\n    assert inst.name[0].namePart[2].part == \"film-coated tablets\"\n    assert inst.name[0].namePart[2].type.coding[0].code == \"FRM\"\n    assert inst.name[0].productName == \"Equilidem 2.5 mg film-coated tablets\"\n    assert (\n        inst.operation[0].effectiveDate.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-15\"}\n        ).valueDateTime\n    )\n    assert inst.operation[0].type.concept.coding[0].code == \"Batchrelease\"\n    assert (\n        inst.operation[0].type.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/manufacturingOperationType\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_8(base_settings):\n    \"\"\"No. 8 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"medicinalproductdefinition-example.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_8(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_messagedefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MessageDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import messagedefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_messagedefinition_1(inst):\n    assert inst.category == \"notification\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-09\"}\n        ).valueDateTime\n    )\n    assert inst.eventCoding.code == \"admin-notify\"\n    assert (\n        inst.eventCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/message-events\"}\n        ).valueUri\n    )\n    assert inst.experimental is True\n    assert inst.id == \"example\"\n    assert inst.name == \"EXAMPLE\"\n    assert inst.publisher == \"Health Level Seven, Int'l\"\n    assert inst.purpose == (\n        \"Defines a base example for other MessageDefinition \" \"instances.\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Message '\n        \"definition base example</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Message definition base example\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/MessageDefinition/example\"}\n        ).valueUri\n    )\n\n\ndef test_messagedefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for MessageDefinition.\n    Test File: messagedefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"messagedefinition-example.json\"\n    inst = messagedefinition.MessageDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MessageDefinition\" == inst.get_resource_type()\n\n    impl_messagedefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MessageDefinition\" == data[\"resourceType\"]\n\n    inst2 = messagedefinition.MessageDefinition(**data)\n    impl_messagedefinition_1(inst2)\n\n\ndef impl_messagedefinition_2(inst):\n    assert (\n        inst.allowedResponse[0].message\n        == \"http://hl7.org/fhir/MessageDefinition/patient-link-response\"\n    )\n    assert inst.allowedResponse[0].situation == (\n        \"Optional response message that may provide additional \" \"information\"\n    )\n    assert inst.base == \"http://hl7.org/fhir/MessageDefinition/example\"\n    assert inst.category == \"notification\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org\"\n    assert inst.copyright == \"HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-03\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Notification of two patient records that represent the same \"\n        \"individual that require an established linkage.\"\n    )\n    assert inst.eventCoding.code == \"admin-notify\"\n    assert (\n        inst.eventCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/message-events\"}\n        ).valueUri\n    )\n    assert inst.experimental is True\n    assert inst.focus[0].code == \"Patient\"\n    assert inst.focus[0].max == \"2\"\n    assert inst.focus[0].min == 2\n    assert inst.focus[0].profile == \"http://hl7.org/fhir/StructureDefinition/example\"\n    assert inst.id == \"patient-link-notification\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.9878\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.name == \"PATIENT-LINK-NOTIFICATION\"\n    assert inst.publisher == \"Health Level Seven, Int'l\"\n    assert inst.purpose == (\n        \"Notifies recipient systems that two patients have been \"\n        \"'linked' - meaning they represent the same individual\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Link Patients ' \"Notification</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Link Patients Notification\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/MessageDefinition/patient-link-notification\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"positive\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variant-state\"}\n        ).valueUri\n    )\n    assert inst.version == \"1\"\n\n\ndef test_messagedefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for MessageDefinition.\n    Test File: messagedefinition-patient-link-notification.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"messagedefinition-patient-link-notification.json\"\n    )\n    inst = messagedefinition.MessageDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MessageDefinition\" == inst.get_resource_type()\n\n    impl_messagedefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MessageDefinition\" == data[\"resourceType\"]\n\n    inst2 = messagedefinition.MessageDefinition(**data)\n    impl_messagedefinition_2(inst2)\n\n\ndef impl_messagedefinition_3(inst):\n    assert inst.base == \"http://hl7.org/fhir/MessageDefinition/example\"\n    assert inst.category == \"consequence\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org\"\n    assert inst.copyright == \"HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-03\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Optional response to a patient link notification.\"\n    assert inst.eventCoding.code == \"admin-notify\"\n    assert (\n        inst.eventCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/message-events\"}\n        ).valueUri\n    )\n    assert inst.experimental is True\n    assert inst.focus[0].code == \"Patient\"\n    assert inst.focus[0].max == \"2\"\n    assert inst.focus[0].min == 2\n    assert inst.focus[0].profile == \"http://hl7.org/fhir/StructureDefinition/example\"\n    assert inst.id == \"patient-link-response\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.9879\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.name == \"PATIENT-LINK-RESPONSE\"\n    assert inst.publisher == \"Health Level Seven, Int'l\"\n    assert inst.purpose == (\n        \"Optional response message that may provide additional \"\n        \"information on the outcome of the patient link operation.\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Link Patients ' \"Response</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Link Patients Response\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/MessageDefinition/patient-link-response\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"positive\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variant-state\"}\n        ).valueUri\n    )\n    assert inst.version == \"1\"\n\n\ndef test_messagedefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for MessageDefinition.\n    Test File: messagedefinition-patient-link-response.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"messagedefinition-patient-link-response.json\"\n    )\n    inst = messagedefinition.MessageDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MessageDefinition\" == inst.get_resource_type()\n\n    impl_messagedefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MessageDefinition\" == data[\"resourceType\"]\n\n    inst2 = messagedefinition.MessageDefinition(**data)\n    impl_messagedefinition_3(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_messageheader.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MessageHeader\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import messageheader\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_messageheader_1(inst):\n    assert inst.author.reference == \"Practitioner/example\"\n    assert (\n        inst.definition == \"http:////acme.com/ehr/fhir/messagedefinition/patientrequest\"\n    )\n    assert (\n        inst.destination[0].endpoint\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"llp:10.11.12.14:5432\"}\n        ).valueUrl\n    )\n    assert inst.destination[0].name == \"Acme Message Gateway\"\n    assert (\n        inst.destination[0].receiver.reference\n        == \"http://acme.com/ehr/fhir/Practitioner/2323-33-4\"\n    )\n    assert inst.destination[0].target.reference == \"Device/example\"\n    assert inst.enterer.reference == \"Practitioner/example\"\n    assert inst.eventCoding.code == \"admin-notify\"\n    assert (\n        inst.eventCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/message-events\"}\n        ).valueUri\n    )\n    assert inst.focus[0].reference == \"Patient/example\"\n    assert inst.id == \"1cbdfb97-5859-48a4-8301-d54eab818d68\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.reason.coding[0].code == \"admit\"\n    assert (\n        inst.reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/message-reasons-encounter\"\n            }\n        ).valueUri\n    )\n    assert inst.response.code == \"ok\"\n    assert inst.response.identifier == \"5015fe84-8e76-4526-89d8-44b322e8d4fb\"\n    assert inst.sender.reference == \"Organization/1\"\n    assert inst.source.contact.system == \"phone\"\n    assert inst.source.contact.value == \"+1 (555) 123 4567\"\n    assert (\n        inst.source.endpoint\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"llp:10.11.12.13:5432\"}\n        ).valueUrl\n    )\n    assert inst.source.name == \"Acme Central Patient Registry\"\n    assert inst.source.software == \"FooBar Patient Manager\"\n    assert inst.source.version == \"3.1.45.AABB\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_messageheader_1(base_settings):\n    \"\"\"No. 1 tests collection for MessageHeader.\n    Test File: messageheader-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"messageheader-example.json\"\n    inst = messageheader.MessageHeader.model_validate_json(filename.read_bytes())\n    assert \"MessageHeader\" == inst.get_resource_type()\n\n    impl_messageheader_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MessageHeader\" == data[\"resourceType\"]\n\n    inst2 = messageheader.MessageHeader(**data)\n    impl_messageheader_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_molecularsequence.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MolecularSequence\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import molecularsequence\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_molecularsequence_1(inst):\n    assert inst.coordinateSystem == 0\n    assert inst.id == \"breastcancer\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/brcapat\"\n    assert inst.referenceSeq.referenceSeqId.coding[0].code == \"NM_000059.3\"\n    assert (\n        inst.referenceSeq.referenceSeqId.coding[0].display\n        == \"Homo sapiens BRCA2, DNA repair associated (BRCA2), mRNA\"\n    )\n    assert (\n        inst.referenceSeq.referenceSeqId.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore/\"}\n        ).valueUri\n    )\n    assert inst.referenceSeq.windowEnd == 101499444\n    assert inst.referenceSeq.windowStart == 101488058\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"rna\"\n    assert inst.variant[0].end == 32316187\n    assert inst.variant[0].observedAllele == \"A\"\n    assert inst.variant[0].referenceAllele == \"C\"\n    assert inst.variant[0].start == 32316186\n\n\ndef test_molecularsequence_1(base_settings):\n    \"\"\"No. 1 tests collection for MolecularSequence.\n    Test File: sequence-genetics-example-breastcancer.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"sequence-genetics-example-breastcancer.json\"\n    )\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_1(inst2)\n\n\ndef impl_molecularsequence_2(inst):\n    assert inst.coordinateSystem == 0\n    assert inst.id == \"graphic-example-1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.pointer[0].reference == \"MolecularSequence/graphic-example-2\"\n    assert inst.referenceSeq.referenceSeqId.coding[0].code == \"NC_000002.12\"\n    assert (\n        inst.referenceSeq.referenceSeqId.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.referenceSeq.strand == \"watson\"\n    assert inst.referenceSeq.windowEnd == 128273732\n    assert inst.referenceSeq.windowStart == 128273724\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n    assert inst.variant[0].cigar == \"1M\"\n    assert inst.variant[0].end == 128273726\n    assert inst.variant[0].observedAllele == \"G\"\n    assert inst.variant[0].referenceAllele == \"T\"\n    assert inst.variant[0].start == 128273725\n\n\ndef test_molecularsequence_2(base_settings):\n    \"\"\"No. 2 tests collection for MolecularSequence.\n    Test File: sequence-graphic-example-1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-graphic-example-1.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_2(inst2)\n\n\ndef impl_molecularsequence_3(inst):\n    assert inst.coordinateSystem == 1\n    assert inst.id == \"fda-vcfeval-comparison\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.quality[0].end == 101770080\n    assert float(inst.quality[0].gtFP) == float(2186)\n    assert inst.quality[0].method.coding[0].code == \"app-BxfGF8j02pBZzZxbzZxP725P\"\n    assert (\n        inst.quality[0].method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://precision.fda.gov/apps/\"}\n        ).valueUri\n    )\n    assert inst.quality[0].method.text == \"Vcfeval + Hap.py Comparison\"\n    assert float(inst.quality[0].precision) == float(0.428005)\n    assert float(inst.quality[0].queryFP) == float(10670)\n    assert float(inst.quality[0].recall) == float(0.752111)\n    assert (\n        inst.quality[0].standardSequence.coding[0].code\n        == \"file-BkZxBZ00bpJVk2q6x43b1YBx\"\n    )\n    assert (\n        inst.quality[0].standardSequence.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://precision.fda.gov/files/\"}\n        ).valueUri\n    )\n    assert inst.quality[0].start == 10453\n    assert float(inst.quality[0].truthFN) == float(2554)\n    assert float(inst.quality[0].truthTP) == float(7749)\n    assert inst.quality[0].type == \"indel\"\n    assert inst.quality[1].end == 101770080\n    assert float(inst.quality[1].gtFP) == float(493)\n    assert inst.quality[1].method.coding[0].code == \"app-BxfGF8j02pBZzZxbzZxP725P\"\n    assert (\n        inst.quality[1].method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://precision.fda.gov/apps/\"}\n        ).valueUri\n    )\n    assert inst.quality[1].method.text == \"Vcfeval + Hap.py Comparison\"\n    assert float(inst.quality[1].precision) == float(0.808602)\n    assert float(inst.quality[1].queryFP) == float(21744)\n    assert float(inst.quality[1].recall) == float(0.986642)\n    assert (\n        inst.quality[1].standardSequence.coding[0].code\n        == \"file-BkZxBZ00bpJVk2q6x43b1YBx\"\n    )\n    assert (\n        inst.quality[1].standardSequence.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://precision.fda.gov/files/\"}\n        ).valueUri\n    )\n    assert inst.quality[1].start == 10453\n    assert float(inst.quality[1].truthFN) == float(1247)\n    assert float(inst.quality[1].truthTP) == float(92106)\n    assert inst.quality[1].type == \"snp\"\n    assert inst.referenceSeq.referenceSeqId.coding[0].code == \"NC_000001.11\"\n    assert (\n        inst.referenceSeq.referenceSeqId.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.referenceSeq.strand == \"watson\"\n    assert inst.referenceSeq.windowEnd == 101770080\n    assert inst.referenceSeq.windowStart == 10453\n    assert inst.repository[0].name == \"FDA\"\n    assert inst.repository[0].type == \"login\"\n    assert (\n        inst.repository[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://precision.fda.gov/jobs/job-ByxYPx809jFVy21KJG74Jg3Y\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.variant[0].end == 13117\n    assert inst.variant[0].observedAllele == \"T\"\n    assert inst.variant[0].referenceAllele == \"G\"\n    assert inst.variant[0].start == 13116\n\n\ndef test_molecularsequence_3(base_settings):\n    \"\"\"No. 3 tests collection for MolecularSequence.\n    Test File: sequence-example-fda-vcfeval.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-example-fda-vcfeval.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_3(inst2)\n\n\ndef impl_molecularsequence_4(inst):\n    assert inst.coordinateSystem == 1\n    assert inst.device.display == \"12 lead EKG Device Metric\"\n    assert inst.id == \"sequence-complex-variant\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer.display == \"HL7\"\n    assert inst.performer.reference == \"Organization/hl7\"\n    assert float(inst.quantity.value) == float(25)\n    assert inst.readCoverage == 1\n    assert inst.referenceSeq.referenceSeqId.coding[0].code == \"NC_000002.12\"\n    assert (\n        inst.referenceSeq.referenceSeqId.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.referenceSeq.strand == \"watson\"\n    assert inst.referenceSeq.windowEnd == 128273754\n    assert inst.referenceSeq.windowStart == 128273724\n    assert inst.repository[0].datasetId == \"Ensembl\"\n    assert inst.repository[0].readsetId == \"v1beta2\"\n    assert inst.repository[0].type == \"other\"\n    assert inst.specimen.display == \"Molecular Specimen ID: MLD45-Z4-1234\"\n    assert inst.specimen.reference == \"Specimen/genetics-example1-somatic\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n    assert inst.variant[0].cigar == \"3M1D4M6N2M\"\n    assert inst.variant[0].end == 128273736\n    assert inst.variant[0].observedAllele == \"CTCATTGT\"\n    assert inst.variant[0].referenceAllele == \"CTCCATTGCATGCGTT\"\n    assert inst.variant[0].start == 128273724\n\n\ndef test_molecularsequence_4(base_settings):\n    \"\"\"No. 4 tests collection for MolecularSequence.\n    Test File: sequence-complex-variant.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-complex-variant.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_4(inst2)\n\n\ndef impl_molecularsequence_5(inst):\n    assert inst.coordinateSystem == 1\n    assert inst.id == \"example-TPMT-one\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.observedSeq == \"T-C-C-C-A-C-C-C\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.referenceSeq.referenceSeqId.coding[0].code == \"NT_007592.15\"\n    assert (\n        inst.referenceSeq.referenceSeqId.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.referenceSeq.strand == \"watson\"\n    assert inst.referenceSeq.windowEnd == 18143955\n    assert inst.referenceSeq.windowStart == 18130918\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n    assert inst.variant[0].end == 18139214\n    assert inst.variant[0].observedAllele == \"A\"\n    assert inst.variant[0].referenceAllele == \"G\"\n    assert inst.variant[0].start == 18139214\n\n\ndef test_molecularsequence_5(base_settings):\n    \"\"\"No. 5 tests collection for MolecularSequence.\n    Test File: sequence-example-TPMT-one.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-example-TPMT-one.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_5(inst2)\n\n\ndef impl_molecularsequence_6(inst):\n    assert inst.coordinateSystem == 0\n    assert inst.id == \"example-pgx-2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.referenceSeq.orientation == \"sense\"\n    assert inst.referenceSeq.referenceSeqId.coding[0].code == \"NG_007726.3\"\n    assert (\n        inst.referenceSeq.referenceSeqId.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.referenceSeq.strand == \"watson\"\n    assert inst.referenceSeq.windowEnd == 55227980\n    assert inst.referenceSeq.windowStart == 55227970\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n    assert inst.variant[0].end == 55227979\n    assert inst.variant[0].observedAllele == \"G\"\n    assert inst.variant[0].referenceAllele == \"T\"\n    assert inst.variant[0].start == 55227978\n    assert inst.variant[0].variantPointer.display == \"Target Haplotype Observation\"\n    assert inst.variant[0].variantPointer.reference == \"Observation/example-haplotype2\"\n\n\ndef test_molecularsequence_6(base_settings):\n    \"\"\"No. 6 tests collection for MolecularSequence.\n    Test File: sequence-example-pgx-2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-example-pgx-2.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_6(inst2)\n\n\ndef impl_molecularsequence_7(inst):\n    assert inst.coordinateSystem == 0\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.referenceSeq.referenceSeqId.coding[0].code == \"NC_000009.11\"\n    assert (\n        inst.referenceSeq.referenceSeqId.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.referenceSeq.strand == \"watson\"\n    assert inst.referenceSeq.windowEnd == 22125510\n    assert inst.referenceSeq.windowStart == 22125500\n    assert inst.repository[0].name == \"GA4GH API\"\n    assert inst.repository[0].type == \"openapi\"\n    assert (\n        inst.repository[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://grch37.rest.ensembl.org/ga4gh/variants/3:rs1333049?content-type=application/json\"\n            }\n        ).valueUri\n    )\n    assert inst.repository[0].variantsetId == \"3:rs1333049\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n    assert inst.variant[0].end == 22125504\n    assert inst.variant[0].observedAllele == \"C\"\n    assert inst.variant[0].referenceAllele == \"G\"\n    assert inst.variant[0].start == 22125503\n\n\ndef test_molecularsequence_7(base_settings):\n    \"\"\"No. 7 tests collection for MolecularSequence.\n    Test File: molecularsequence-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"molecularsequence-example.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_7(inst2)\n\n\ndef impl_molecularsequence_8(inst):\n    assert inst.coordinateSystem == 1\n    assert inst.id == \"fda-example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.quality[0].end == 101770080\n    assert float(inst.quality[0].fScore) == float(0.545551)\n    assert float(inst.quality[0].gtFP) == float(2186)\n    assert inst.quality[0].method.coding[0].code == \"job-ByxYPx809jFVy21KJG74Jg3Y\"\n    assert (\n        inst.quality[0].method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://precision.fda.gov/jobs/\"}\n        ).valueUri\n    )\n    assert inst.quality[0].method.text == \"Vcfeval + Hap.py Comparison\"\n    assert float(inst.quality[0].precision) == float(0.428005)\n    assert float(inst.quality[0].queryFP) == float(10670)\n    assert float(inst.quality[0].queryTP) == float(7984)\n    assert float(inst.quality[0].recall) == float(0.752111)\n    assert (\n        inst.quality[0].standardSequence.coding[0].code\n        == \"file-Bk50V4Q0qVb65P0v2VPbfYPZ\"\n    )\n    assert (\n        inst.quality[0].standardSequence.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://precision.fda.gov/files/\"}\n        ).valueUri\n    )\n    assert inst.quality[0].start == 10453\n    assert float(inst.quality[0].truthFN) == float(2554)\n    assert float(inst.quality[0].truthTP) == float(7749)\n    assert inst.quality[0].type == \"snp\"\n    assert inst.referenceSeq.referenceSeqId.coding[0].code == \"NC_000001.11\"\n    assert (\n        inst.referenceSeq.referenceSeqId.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.referenceSeq.strand == \"watson\"\n    assert inst.referenceSeq.windowEnd == 101770080\n    assert inst.referenceSeq.windowStart == 10453\n    assert inst.repository[0].name == \"FDA\"\n    assert inst.repository[0].type == \"login\"\n    assert (\n        inst.repository[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"https://precision.fda.gov/files/file-Bx37ZK009P4bX5g3qjkFZV38\"\n            }\n        ).valueUri\n    )\n    assert inst.repository[0].variantsetId == \"file-Bx37ZK009P4bX5g3qjkFZV38\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n    assert inst.variant[0].end == 13117\n    assert inst.variant[0].observedAllele == \"T\"\n    assert inst.variant[0].referenceAllele == \"G\"\n    assert inst.variant[0].start == 13116\n\n\ndef test_molecularsequence_8(base_settings):\n    \"\"\"No. 8 tests collection for MolecularSequence.\n    Test File: sequence-example-fda.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-example-fda.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_8(inst2)\n\n\ndef impl_molecularsequence_9(inst):\n    assert inst.coordinateSystem == 1\n    assert inst.id == \"coord-1-base\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.observedSeq == \"ACATGGTAGC\"\n    assert inst.referenceSeq.referenceSeqString == \"ACGTAGTC\"\n    assert inst.referenceSeq.strand == \"watson\"\n    assert inst.referenceSeq.windowEnd == 8\n    assert inst.referenceSeq.windowStart == 1\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n    assert inst.variant[0].cigar == \"3I\"\n    assert inst.variant[0].end == 3\n    assert inst.variant[0].observedAllele == \"ATG\"\n    assert inst.variant[0].referenceAllele == \"-\"\n    assert inst.variant[0].start == 2\n    assert inst.variant[1].cigar == \"3I\"\n    assert inst.variant[1].end == 5\n    assert inst.variant[1].observedAllele == \"T\"\n    assert inst.variant[1].referenceAllele == \"A\"\n    assert inst.variant[1].start == 5\n    assert inst.variant[2].cigar == \"1D\"\n    assert inst.variant[2].end == 7\n    assert inst.variant[2].observedAllele == \"-\"\n    assert inst.variant[2].referenceAllele == \"T\"\n    assert inst.variant[2].start == 7\n\n\ndef test_molecularsequence_9(base_settings):\n    \"\"\"No. 9 tests collection for MolecularSequence.\n    Test File: coord-1base-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"coord-1base-example.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_9(inst2)\n\n\ndef impl_molecularsequence_10(inst):\n    assert inst.coordinateSystem == 0\n    assert inst.id == \"graphic-example-4\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.referenceSeq.chromosome.coding[0].code == \"2\"\n    assert inst.referenceSeq.chromosome.coding[0].display == \"chromosome 2\"\n    assert (\n        inst.referenceSeq.chromosome.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/chromosome-human\"}\n        ).valueUri\n    )\n    assert inst.referenceSeq.genomeBuild == \"GRCh 38\"\n    assert inst.referenceSeq.strand == \"watson\"\n    assert inst.referenceSeq.windowEnd == 128273740\n    assert inst.referenceSeq.windowStart == 128273736\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n\n\ndef test_molecularsequence_10(base_settings):\n    \"\"\"No. 10 tests collection for MolecularSequence.\n    Test File: sequence-graphic-example-4.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-graphic-example-4.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_namingsystem.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NamingSystem\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import namingsystem\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_namingsystem_1(inst):\n    assert inst.contact[0].name == \"HL7 Australia FHIR Team\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert (\n        inst.contact[0].telecom[0].value\n        == \"http://hl7-australia.wikispaces.com/FHIR+Australia\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-31\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Australian HI Identifier as established by relevant \" \"regulations etc.\"\n    )\n    assert inst.id == \"example-id\"\n    assert inst.jurisdiction[0].coding[0].code == \"AU\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.kind == \"identifier\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Austalian Healthcare Identifier - Individual\"\n    assert inst.publisher == \"HL7 Australia on behalf of NEHTA\"\n    assert inst.responsible == \"HI Service Operator / NEHTA\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"NI\"\n    assert inst.type.coding[0].display == \"National unique individual identifier\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"IHI\"\n    assert inst.uniqueId[0].comment == \"This value is used in Australian CDA documents\"\n    assert inst.uniqueId[0].type == \"oid\"\n    assert inst.uniqueId[0].value == \"1.2.36.1.2001.1003.0\"\n    assert (\n        inst.uniqueId[1].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-21\"}\n        ).valueDateTime\n    )\n    assert inst.uniqueId[1].preferred is True\n    assert inst.uniqueId[1].type == \"uri\"\n    assert inst.uniqueId[1].value == \"http://ns.electronichealth.net.au/id/hi/ihi/1.0\"\n    assert inst.usage == \"Used in Australia for identifying patients\"\n\n\ndef test_namingsystem_1(base_settings):\n    \"\"\"No. 1 tests collection for NamingSystem.\n    Test File: namingsystem-example-id.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"namingsystem-example-id.json\"\n    inst = namingsystem.NamingSystem.model_validate_json(filename.read_bytes())\n    assert \"NamingSystem\" == inst.get_resource_type()\n\n    impl_namingsystem_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NamingSystem\" == data[\"resourceType\"]\n\n    inst2 = namingsystem.NamingSystem(**data)\n    impl_namingsystem_1(inst2)\n\n\ndef impl_namingsystem_2(inst):\n    assert inst.contact[0].name == \"FHIR project team\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-13\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example\"\n    assert inst.kind == \"codesystem\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"SNOMED CT\"\n    assert inst.publisher == \"HL7 International on behalf of IHTSDO\"\n    assert inst.responsible == \"IHTSDO & affiliates\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.uniqueId[0].type == \"oid\"\n    assert inst.uniqueId[0].value == \"2.16.840.1.113883.6.96\"\n    assert inst.uniqueId[1].preferred is True\n    assert inst.uniqueId[1].type == \"uri\"\n    assert inst.uniqueId[1].value == \"http://snomed.info/sct\"\n\n\ndef test_namingsystem_2(base_settings):\n    \"\"\"No. 2 tests collection for NamingSystem.\n    Test File: namingsystem-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"namingsystem-example.json\"\n    inst = namingsystem.NamingSystem.model_validate_json(filename.read_bytes())\n    assert \"NamingSystem\" == inst.get_resource_type()\n\n    impl_namingsystem_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NamingSystem\" == data[\"resourceType\"]\n\n    inst2 = namingsystem.NamingSystem(**data)\n    impl_namingsystem_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_nutritionorder.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NutritionOrder\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import nutritionorder\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_nutritionorder_1(inst):\n    assert inst.allergyIntolerance[0].display == \"Cashew Nuts\"\n    assert inst.allergyIntolerance[0].reference == \"AllergyIntolerance/example\"\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.excludeFoodModifier[0].coding[0].code == \"227493005\"\n    assert inst.excludeFoodModifier[0].coding[0].display == \"Cashew Nut\"\n    assert (\n        inst.excludeFoodModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].version == \"20140730\"\n    assert inst.foodPreferenceModifier[0].coding[0].code == \"kosher\"\n    assert (\n        inst.foodPreferenceModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diet\"}\n        ).valueUri\n    )\n    assert inst.id == \"diabeticsupplement\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.patient.display == \"Peter Chalmers\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.status == \"active\"\n    assert inst.supplement[0].productName == \"Glucerna\"\n    assert inst.supplement[0].quantity.unit == \"8 oz bottle\"\n    assert float(inst.supplement[0].quantity.value) == float(1)\n    assert (\n        inst.supplement[0].schedule[0].repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-10T15:00:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.supplement[0].schedule[0].repeat.frequency == 1\n    assert float(inst.supplement[0].schedule[0].repeat.period) == float(24)\n    assert inst.supplement[0].schedule[0].repeat.periodUnit == \"h\"\n    assert float(inst.supplement[0].schedule[1].repeat.duration) == float(1)\n    assert inst.supplement[0].schedule[1].repeat.durationUnit == \"h\"\n    assert inst.supplement[0].schedule[1].repeat.when[0] == \"HS\"\n    assert inst.supplement[0].type.coding[0].code == \"443051000124104\"\n    assert (\n        inst.supplement[0].type.coding[0].display == \"Adult diabetes specialty formula\"\n    )\n    assert (\n        inst.supplement[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.supplement[0].type.coding[1].code == \"1010\"\n    assert inst.supplement[0].type.coding[1].display == \"Adult diabetic formula\"\n    assert (\n        inst.supplement[0].type.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/supplement-type-codes\"}\n        ).valueUri\n    )\n    assert inst.supplement[0].type.text == \"Adult diabetic formula\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_1(base_settings):\n    \"\"\"No. 1 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-diabeticsupplement.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"nutritionorder-example-diabeticsupplement.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_1(inst2)\n\n\ndef impl_nutritionorder_2(inst):\n    assert inst.allergyIntolerance[0].display == \"Cashew Nuts\"\n    assert inst.allergyIntolerance[0].reference == \"AllergyIntolerance/example\"\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.enteralFormula.additiveProductName == \"Acme Lipid Additive\"\n    assert inst.enteralFormula.additiveType.coding[0].code == \"lipid\"\n    assert inst.enteralFormula.additiveType.coding[0].display == \"Lipid\"\n    assert (\n        inst.enteralFormula.additiveType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/entformula-additive\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administrationInstruction == \"240 mls every 4hrs\"\n    assert inst.enteralFormula.administration[0].quantity.code == \"mL\"\n    assert (\n        inst.enteralFormula.administration[0].quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administration[0].quantity.unit == \"milliliters\"\n    assert float(inst.enteralFormula.administration[0].quantity.value) == float(240)\n    assert (\n        inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17T16:00:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.enteralFormula.administration[0].schedule.repeat.frequency == 1\n    assert float(inst.enteralFormula.administration[0].schedule.repeat.period) == float(\n        4\n    )\n    assert inst.enteralFormula.administration[0].schedule.repeat.periodUnit == \"h\"\n    assert inst.enteralFormula.baseFormulaProductName == \"Acme High Protein Formula\"\n    assert inst.enteralFormula.baseFormulaType.coding[0].code == \"442991000124104\"\n    assert (\n        inst.enteralFormula.baseFormulaType.coding[0].display\n        == \"Adult high protein formula\"\n    )\n    assert (\n        inst.enteralFormula.baseFormulaType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.caloricDensity.code == \"cal/mL\"\n    assert (\n        inst.enteralFormula.caloricDensity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.caloricDensity.unit == \"calories per milliliter\"\n    assert float(inst.enteralFormula.caloricDensity.value) == float(1.5)\n    assert inst.enteralFormula.maxVolumeToDeliver.code == \"mL/d\"\n    assert (\n        inst.enteralFormula.maxVolumeToDeliver.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.maxVolumeToDeliver.unit == \"milliliter/day\"\n    assert float(inst.enteralFormula.maxVolumeToDeliver.value) == float(1440)\n    assert inst.enteralFormula.routeofAdministration.coding[0].code == \"GT\"\n    assert (\n        inst.enteralFormula.routeofAdministration.coding[0].display\n        == \"Instillation, gastrostomy tube\"\n    )\n    assert (\n        inst.enteralFormula.routeofAdministration.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].code == \"227493005\"\n    assert inst.excludeFoodModifier[0].coding[0].display == \"Cashew Nut\"\n    assert (\n        inst.excludeFoodModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].version == \"20140730\"\n    assert inst.foodPreferenceModifier[0].coding[0].code == \"dairy-free\"\n    assert (\n        inst.foodPreferenceModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diet\"}\n        ).valueUri\n    )\n    assert inst.id == \"enteralbolus\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org/nutritionorders\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.patient.display == \"Peter Chalmers\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_2(base_settings):\n    \"\"\"No. 2 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-enteralbolus.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"nutritionorder-example-enteralbolus.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_2(inst2)\n\n\ndef impl_nutritionorder_3(inst):\n    assert inst.allergyIntolerance[0].display == \"Cashew Nuts\"\n    assert inst.allergyIntolerance[0].reference == \"AllergyIntolerance/example\"\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.excludeFoodModifier[0].coding[0].code == \"227493005\"\n    assert inst.excludeFoodModifier[0].coding[0].display == \"Cashew Nut\"\n    assert (\n        inst.excludeFoodModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].version == \"20140730\"\n    assert inst.foodPreferenceModifier[0].coding[0].code == \"dairy-free\"\n    assert (\n        inst.foodPreferenceModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diet\"}\n        ).valueUri\n    )\n    assert inst.id == \"fiberrestricteddiet\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[0].amount.code == \"g\"\n    assert (\n        inst.oralDiet.nutrient[0].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[0].amount.unit == \"grams\"\n    assert float(inst.oralDiet.nutrient[0].amount.value) == float(50)\n    assert inst.oralDiet.nutrient[0].modifier.coding[0].code == \"256674009\"\n    assert inst.oralDiet.nutrient[0].modifier.coding[0].display == \"Fat\"\n    assert (\n        inst.oralDiet.nutrient[0].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.oralDiet.schedule[0].repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-10\"}\n        ).valueDateTime\n    )\n    assert inst.oralDiet.schedule[0].repeat.frequency == 3\n    assert float(inst.oralDiet.schedule[0].repeat.period) == float(1)\n    assert inst.oralDiet.schedule[0].repeat.periodUnit == \"d\"\n    assert inst.oralDiet.type[0].coding[0].code == \"15108003\"\n    assert inst.oralDiet.type[0].coding[0].display == \"Restricted fiber diet\"\n    assert (\n        inst.oralDiet.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[1].code == \"1000\"\n    assert inst.oralDiet.type[0].coding[1].display == \"Fiber restricted\"\n    assert (\n        inst.oralDiet.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].text == \"Fiber restricted diet\"\n    assert inst.oralDiet.type[1].coding[0].code == \"16208003\"\n    assert inst.oralDiet.type[1].coding[0].display == \"Low fat diet\"\n    assert (\n        inst.oralDiet.type[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[1].coding[1].code == \"1100\"\n    assert inst.oralDiet.type[1].coding[1].display == \"Low Fat\"\n    assert (\n        inst.oralDiet.type[1].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[1].text == \"Low fat diet\"\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.patient.display == \"Peter Chalmers\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_3(base_settings):\n    \"\"\"No. 3 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-fiberrestricteddiet.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"nutritionorder-example-fiberrestricteddiet.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_3(inst2)\n\n\ndef impl_nutritionorder_4(inst):\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"texturemodified\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.oralDiet.schedule[0].repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-10\"}\n        ).valueDateTime\n    )\n    assert inst.oralDiet.schedule[0].repeat.frequency == 3\n    assert float(inst.oralDiet.schedule[0].repeat.period) == float(1)\n    assert inst.oralDiet.schedule[0].repeat.periodUnit == \"d\"\n    assert inst.oralDiet.texture[0].foodType.coding[0].code == \"28647000\"\n    assert inst.oralDiet.texture[0].foodType.coding[0].display == \"Meat\"\n    assert (\n        inst.oralDiet.texture[0].foodType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.texture[0].foodType.text == \"Regular, Chopped Meat\"\n    assert inst.oralDiet.texture[0].modifier.coding[0].code == \"228049004\"\n    assert inst.oralDiet.texture[0].modifier.coding[0].display == \"Chopped food\"\n    assert (\n        inst.oralDiet.texture[0].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.texture[0].modifier.text == \"Regular, Chopped Meat\"\n    assert inst.oralDiet.type[0].coding[0].code == \"435801000124108\"\n    assert inst.oralDiet.type[0].coding[0].display == \"Texture modified diet\"\n    assert (\n        inst.oralDiet.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[1].code == \"1010\"\n    assert inst.oralDiet.type[0].coding[1].display == \"Texture modified diet\"\n    assert (\n        inst.oralDiet.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].text == \"Texture modified diet\"\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.patient.display == \"Peter Chalmers\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_4(base_settings):\n    \"\"\"No. 4 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-texture-modified.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"nutritionorder-example-texture-modified.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_4(inst2)\n\n\ndef impl_nutritionorder_5(inst):\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"pureeddiet-simple\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.fluidConsistencyType[0].coding[0].code == \"439021000124105\"\n    assert (\n        inst.oralDiet.fluidConsistencyType[0].coding[0].display\n        == \"Dietary liquid consistency - nectar thick liquid\"\n    )\n    assert (\n        inst.oralDiet.fluidConsistencyType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.fluidConsistencyType[0].text == \"Nectar thick liquids\"\n    assert (\n        inst.oralDiet.schedule[0].repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-10\"}\n        ).valueDateTime\n    )\n    assert inst.oralDiet.schedule[0].repeat.frequency == 3\n    assert float(inst.oralDiet.schedule[0].repeat.period) == float(1)\n    assert inst.oralDiet.schedule[0].repeat.periodUnit == \"d\"\n    assert inst.oralDiet.texture[0].modifier.coding[0].code == \"228055009\"\n    assert inst.oralDiet.texture[0].modifier.coding[0].display == \"Liquidized food\"\n    assert (\n        inst.oralDiet.texture[0].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.texture[0].modifier.text == \"Pureed\"\n    assert inst.oralDiet.type[0].coding[0].code == \"226211001\"\n    assert inst.oralDiet.type[0].coding[0].display == \"Pureed diet\"\n    assert (\n        inst.oralDiet.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[1].code == \"1010\"\n    assert inst.oralDiet.type[0].coding[1].display == \"Pureed diet\"\n    assert (\n        inst.oralDiet.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].text == \"Pureed diet\"\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.patient.display == \"Peter Chalmers\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.status == \"active\"\n    assert (\n        inst.supplement[0].instruction == \"Ensure Pudding at breakfast, lunch, supper\"\n    )\n    assert inst.supplement[0].productName == \"Ensure Pudding 4 oz container\"\n    assert inst.supplement[0].type.coding[0].code == \"442971000124100\"\n    assert inst.supplement[0].type.coding[0].display == \"Adult high energy formula\"\n    assert (\n        inst.supplement[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.supplement[0].type.coding[1].code == \"1040\"\n    assert inst.supplement[0].type.coding[1].display == \"Adult high energy pudding\"\n    assert (\n        inst.supplement[0].type.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/supplement-type-codes\"}\n        ).valueUri\n    )\n    assert inst.supplement[0].type.text == \"Adult high energy pudding\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_5(base_settings):\n    \"\"\"No. 5 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-pureeddiet-simple.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"nutritionorder-example-pureeddiet-simple.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_5(inst2)\n\n\ndef impl_nutritionorder_6(inst):\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.enteralFormula.additiveProductName == \"Acme High Carbohydrate Additive\"\n    assert inst.enteralFormula.additiveType.coding[0].code == \"carbohydrate\"\n    assert inst.enteralFormula.additiveType.coding[0].display == \"Carbohydrate\"\n    assert (\n        inst.enteralFormula.additiveType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/entformula-additive\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administrationInstruction == (\n        \"Add high calorie high carbohydrate additive to increase \"\n        \"cal/oz from 24 cal/oz to 27 cal/oz.\"\n    )\n    assert inst.enteralFormula.administration[0].quantity.code == \"[foz_us]\"\n    assert (\n        inst.enteralFormula.administration[0].quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administration[0].quantity.unit == \"ounces\"\n    assert float(inst.enteralFormula.administration[0].quantity.value) == float(4)\n    assert (\n        inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.enteralFormula.administration[0].schedule.repeat.frequency == 1\n    assert float(inst.enteralFormula.administration[0].schedule.repeat.period) == float(\n        3\n    )\n    assert inst.enteralFormula.administration[0].schedule.repeat.periodUnit == \"h\"\n    assert inst.enteralFormula.baseFormulaProductName == \"Acme Infant Formula + Iron\"\n    assert inst.enteralFormula.baseFormulaType.coding[0].code == \"412414007\"\n    assert (\n        inst.enteralFormula.baseFormulaType.coding[0].display == \"infant formula + iron\"\n    )\n    assert (\n        inst.enteralFormula.baseFormulaType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.caloricDensity.code == \"cal/[foz_us]\"\n    assert (\n        inst.enteralFormula.caloricDensity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.caloricDensity.unit == \"calories per ounce\"\n    assert float(inst.enteralFormula.caloricDensity.value) == float(20)\n    assert inst.enteralFormula.maxVolumeToDeliver.code == \"[foz_us]\"\n    assert (\n        inst.enteralFormula.maxVolumeToDeliver.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.maxVolumeToDeliver.unit == \"ounces\"\n    assert float(inst.enteralFormula.maxVolumeToDeliver.value) == float(32)\n    assert inst.enteralFormula.routeofAdministration.coding[0].code == \"PO\"\n    assert (\n        inst.enteralFormula.routeofAdministration.coding[0].display == \"Swallow, oral\"\n    )\n    assert (\n        inst.enteralFormula.routeofAdministration.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.enteralFormula.routeofAdministration.coding[0].userSelected is True\n    assert inst.id == \"infantenteral\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org/nutritionorders\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.patient.display == \"Peter Chalmers\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_6(base_settings):\n    \"\"\"No. 6 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-infantenteral.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"nutritionorder-example-infantenteral.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_6(inst2)\n\n\ndef impl_nutritionorder_7(inst):\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.enteralFormula.administrationInstruction == (\n        \"Hold feedings from 7 pm to 7 am. Add MCT oil to increase \"\n        \"calories from 1.0 cal/mL to 1.5 cal/mL\"\n    )\n    assert inst.enteralFormula.administration[0].rateQuantity.code == \"mL/h\"\n    assert (\n        inst.enteralFormula.administration[0].rateQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administration[0].rateQuantity.unit == \"ml/hr\"\n    assert float(inst.enteralFormula.administration[0].rateQuantity.value) == float(60)\n    assert (\n        inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17T07:00:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.enteralFormula.administration[1].rateQuantity.code == \"mL/h\"\n    assert (\n        inst.enteralFormula.administration[1].rateQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administration[1].rateQuantity.unit == \"ml/hr\"\n    assert float(inst.enteralFormula.administration[1].rateQuantity.value) == float(80)\n    assert (\n        inst.enteralFormula.administration[1].schedule.repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17T11:00:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.enteralFormula.administration[2].rateQuantity.code == \"mL/h\"\n    assert (\n        inst.enteralFormula.administration[2].rateQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administration[2].rateQuantity.unit == \"ml/hr\"\n    assert float(inst.enteralFormula.administration[2].rateQuantity.value) == float(100)\n    assert (\n        inst.enteralFormula.administration[2].schedule.repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17T15:00:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.enteralFormula.baseFormulaProductName == \" Acme Diabetes Formula\"\n    assert inst.enteralFormula.baseFormulaType.coding[0].code == \"6547210000124112\"\n    assert (\n        inst.enteralFormula.baseFormulaType.coding[0].display\n        == \"Diabetic specialty enteral formula\"\n    )\n    assert (\n        inst.enteralFormula.baseFormulaType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.caloricDensity.code == \"cal/mL\"\n    assert (\n        inst.enteralFormula.caloricDensity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.caloricDensity.unit == \"calories per milliliter\"\n    assert float(inst.enteralFormula.caloricDensity.value) == float(1)\n    assert inst.enteralFormula.maxVolumeToDeliver.code == \"mL/d\"\n    assert (\n        inst.enteralFormula.maxVolumeToDeliver.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.maxVolumeToDeliver.unit == \"milliliter/day\"\n    assert float(inst.enteralFormula.maxVolumeToDeliver.value) == float(880)\n    assert inst.enteralFormula.routeofAdministration.coding[0].code == \"NGT\"\n    assert (\n        inst.enteralFormula.routeofAdministration.coding[0].display\n        == \"Instillation, nasogastric tube\"\n    )\n    assert (\n        inst.enteralFormula.routeofAdministration.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"enteralcontinuous\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org/nutritionorders\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.patient.display == \"Peter Chalmers\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_7(base_settings):\n    \"\"\"No. 7 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-enteralcontinuous.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"nutritionorder-example-enteralcontinuous.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_7(inst2)\n\n\ndef impl_nutritionorder_8(inst):\n    assert inst.allergyIntolerance[0].display == \"Cashew Nuts\"\n    assert inst.allergyIntolerance[0].reference == \"AllergyIntolerance/example\"\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.excludeFoodModifier[0].coding[0].code == \"227493005\"\n    assert inst.excludeFoodModifier[0].coding[0].display == \"Cashew Nut\"\n    assert (\n        inst.excludeFoodModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].version == \"20140730\"\n    assert inst.foodPreferenceModifier[0].coding[0].code == \"dairy-free\"\n    assert (\n        inst.foodPreferenceModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diet\"}\n        ).valueUri\n    )\n    assert inst.id == \"cardiacdiet\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.oralDiet.instruction\n        == \"Starting on 2/10 breakfast, maximum 400 ml fluids per meal\"\n    )\n    assert inst.oralDiet.nutrient[0].amount.code == \"g\"\n    assert (\n        inst.oralDiet.nutrient[0].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[0].amount.unit == \"grams\"\n    assert float(inst.oralDiet.nutrient[0].amount.value) == float(2)\n    assert inst.oralDiet.nutrient[0].modifier.coding[0].code == \"39972003\"\n    assert inst.oralDiet.nutrient[0].modifier.coding[0].display == \"Sodium\"\n    assert (\n        inst.oralDiet.nutrient[0].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[1].amount.code == \"mL\"\n    assert (\n        inst.oralDiet.nutrient[1].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[1].amount.unit == \"milliliter\"\n    assert float(inst.oralDiet.nutrient[1].amount.value) == float(1500)\n    assert inst.oralDiet.nutrient[1].modifier.coding[0].code == \"33463005\"\n    assert inst.oralDiet.nutrient[1].modifier.coding[0].display == \"Fluid\"\n    assert (\n        inst.oralDiet.nutrient[1].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[0].code == \"386619000\"\n    assert inst.oralDiet.type[0].coding[0].display == \"Low sodium diet\"\n    assert (\n        inst.oralDiet.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[1].code == \"1040\"\n    assert inst.oralDiet.type[0].coding[1].display == \"Low Sodium Diet\"\n    assert (\n        inst.oralDiet.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].text == \"Low sodium diet\"\n    assert inst.oralDiet.type[1].coding[0].code == \"226208002\"\n    assert inst.oralDiet.type[1].coding[0].display == \"Fluid restricted diet\"\n    assert (\n        inst.oralDiet.type[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[1].coding[1].code == \"1040\"\n    assert inst.oralDiet.type[1].coding[1].display == \"Fluid restricted diet\"\n    assert (\n        inst.oralDiet.type[1].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[1].text == \"Fluid restricted diet\"\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.patient.display == \"Peter Chalmers\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_8(base_settings):\n    \"\"\"No. 8 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-cardiacdiet.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"nutritionorder-example-cardiacdiet.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_8(inst2)\n\n\ndef impl_nutritionorder_9(inst):\n    assert inst.allergyIntolerance[0].display == \"Cashew Nuts\"\n    assert inst.allergyIntolerance[0].reference == \"AllergyIntolerance/example\"\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.excludeFoodModifier[0].coding[0].code == \"227493005\"\n    assert inst.excludeFoodModifier[0].coding[0].display == \"Cashew Nut\"\n    assert (\n        inst.excludeFoodModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].version == \"20140730\"\n    assert inst.foodPreferenceModifier[0].coding[0].code == \"dairy-free\"\n    assert (\n        inst.foodPreferenceModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diet\"}\n        ).valueUri\n    )\n    assert inst.id == \"pureeddiet\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.fluidConsistencyType[0].coding[0].code == \"439021000124105\"\n    assert (\n        inst.oralDiet.fluidConsistencyType[0].coding[0].display\n        == \"Dietary liquid consistency - nectar thick liquid\"\n    )\n    assert (\n        inst.oralDiet.fluidConsistencyType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.fluidConsistencyType[0].text == \"Nectar thick liquids\"\n    assert (\n        inst.oralDiet.schedule[0].repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-10\"}\n        ).valueDateTime\n    )\n    assert inst.oralDiet.schedule[0].repeat.frequency == 3\n    assert float(inst.oralDiet.schedule[0].repeat.period) == float(1)\n    assert inst.oralDiet.schedule[0].repeat.periodUnit == \"d\"\n    assert inst.oralDiet.texture[0].modifier.coding[0].code == \"228055009\"\n    assert inst.oralDiet.texture[0].modifier.coding[0].display == \"Liquidized food\"\n    assert (\n        inst.oralDiet.texture[0].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.texture[0].modifier.text == \"Pureed\"\n    assert inst.oralDiet.type[0].coding[0].code == \"226211001\"\n    assert inst.oralDiet.type[0].coding[0].display == \"Pureed diet\"\n    assert (\n        inst.oralDiet.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[1].code == \"1010\"\n    assert inst.oralDiet.type[0].coding[1].display == \"Pureed diet\"\n    assert (\n        inst.oralDiet.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].text == \"Pureed diet\"\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.patient.display == \"Peter Chalmers\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_9(base_settings):\n    \"\"\"No. 9 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-pureeddiet.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"nutritionorder-example-pureeddiet.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_9(inst2)\n\n\ndef impl_nutritionorder_10(inst):\n    assert inst.allergyIntolerance[0].display == \"Cashew Nuts\"\n    assert inst.allergyIntolerance[0].reference == \"AllergyIntolerance/example\"\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.excludeFoodModifier[0].coding[0].code == \"227493005\"\n    assert inst.excludeFoodModifier[0].coding[0].display == \"Cashew Nut\"\n    assert (\n        inst.excludeFoodModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].version == \"20140730\"\n    assert inst.foodPreferenceModifier[0].coding[0].code == \"dairy-free\"\n    assert (\n        inst.foodPreferenceModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diet\"}\n        ).valueUri\n    )\n    assert inst.id == \"diabeticdiet\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[0].amount.code == \"g\"\n    assert (\n        inst.oralDiet.nutrient[0].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[0].amount.unit == \"grams\"\n    assert float(inst.oralDiet.nutrient[0].amount.value) == float(75)\n    assert inst.oralDiet.nutrient[0].modifier.coding[0].code == \"2331003\"\n    assert inst.oralDiet.nutrient[0].modifier.coding[0].display == \"Carbohydrate\"\n    assert (\n        inst.oralDiet.nutrient[0].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.oralDiet.schedule[0].repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-10\"}\n        ).valueDateTime\n    )\n    assert inst.oralDiet.schedule[0].repeat.frequency == 3\n    assert float(inst.oralDiet.schedule[0].repeat.period) == float(1)\n    assert inst.oralDiet.schedule[0].repeat.periodUnit == \"d\"\n    assert inst.oralDiet.type[0].coding[0].code == \"160670007\"\n    assert inst.oralDiet.type[0].coding[0].display == \"Diabetic diet\"\n    assert (\n        inst.oralDiet.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[1].code == \"1030\"\n    assert inst.oralDiet.type[0].coding[1].display == \"DD - Diabetic diet\"\n    assert (\n        inst.oralDiet.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].text == \"DD - Diabetic diet\"\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.patient.display == \"Peter Chalmers\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_10(base_settings):\n    \"\"\"No. 10 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-diabeticdiet.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"nutritionorder-example-diabeticdiet.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_nutritionproduct.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NutritionProduct\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import nutritionproduct\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_nutritionproduct_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionproduct_1(base_settings):\n    \"\"\"No. 1 tests collection for NutritionProduct.\n    Test File: nutritionproduct-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"nutritionproduct-example.json\"\n    inst = nutritionproduct.NutritionProduct.model_validate_json(filename.read_bytes())\n    assert \"NutritionProduct\" == inst.get_resource_type()\n\n    impl_nutritionproduct_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionProduct\" == data[\"resourceType\"]\n\n    inst2 = nutritionproduct.NutritionProduct(**data)\n    impl_nutritionproduct_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_observation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Observation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import observation\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_observation_1(inst):\n    assert inst.code.coding[0].code == \"55233-1\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.device.reference == \"Device/example\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-03T15:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/observation-geneticsGene\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCodeableConcept.coding[0].code == \"3236\"\n    assert inst.extension[0].valueCodeableConcept.coding[0].display == \"EGFR\"\n    assert (\n        inst.extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.genenames.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/observation-geneticsDNARegionName\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueString == \"Exon 21\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/observation-geneticsGenomicSourceClass\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCodeableConcept.coding[0].code == \"LA6684-0\"\n    assert inst.extension[2].valueCodeableConcept.coding[0].display == \"somatic\"\n    assert (\n        inst.extension[2].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.id == \"example-genetics-1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Molecular Diagnostics Laboratory\"\n    assert inst.performer[0].reference == \"Practitioner/example\"\n    assert inst.status == \"final\"\n    assert inst.subject.display == \"Molecular Lab Patient ID: HOSP-23456\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"extensions\"\n    assert inst.valueCodeableConcept.coding[0].code == \"10828004\"\n    assert inst.valueCodeableConcept.coding[0].display == \"Positive\"\n    assert (\n        inst.valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_observation_1(base_settings):\n    \"\"\"No. 1 tests collection for Observation.\n    Test File: observation-example-genetics-1.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"observation-example-genetics-1.json\"\n    )\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_1(inst2)\n\n\ndef impl_observation_2(inst):\n    assert inst.bodySite.coding[0].code == \"71341001:272741003=7771000\"\n    assert (\n        inst.bodySite.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.bodySite.text == \"Left Femur\"\n    assert inst.code.coding[0].code == \"24701-5\"\n    assert inst.code.coding[0].display == \"Femur DXA Bone density\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"BMD - Left Femur\"\n    assert inst.id == \"bmd\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Acme Imaging Diagnostics\"\n    assert (\n        inst.performer[0].reference\n        == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/pat2\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"g/cm-2\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"g/cm²\"\n    assert float(inst.valueQuantity.value) == float(0.887)\n\n\ndef test_observation_2(base_settings):\n    \"\"\"No. 2 tests collection for Observation.\n    Test File: observation-example-bmd.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observation-example-bmd.json\"\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_2(inst2)\n\n\ndef impl_observation_3(inst):\n    assert inst.category[0].coding[0].code == \"vital-signs\"\n    assert inst.category[0].coding[0].display == \"Vital Signs\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Vital Signs\"\n    assert inst.code.coding[0].code == \"9279-1\"\n    assert inst.code.coding[0].display == \"Respiratory rate\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Respiratory rate\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1999-07-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"respiratory-rate\"\n    assert inst.meta.profile[0] == \"http://hl7.org/fhir/StructureDefinition/vitalsigns\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"/min\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"breaths/minute\"\n    assert float(inst.valueQuantity.value) == float(26)\n\n\ndef test_observation_3(base_settings):\n    \"\"\"No. 3 tests collection for Observation.\n    Test File: observation-example-respiratory-rate.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"observation-example-respiratory-rate.json\"\n    )\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_3(inst2)\n\n\ndef impl_observation_4(inst):\n    assert inst.category[0].coding[0].code == \"vital-signs\"\n    assert inst.category[0].coding[0].display == \"Vital Signs\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"29463-7\"\n    assert inst.code.coding[0].display == \"Body Weight\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.coding[1].code == \"3141-9\"\n    assert inst.code.coding[1].display == \"Body weight Measured\"\n    assert (\n        inst.code.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.coding[2].code == \"27113001\"\n    assert inst.code.coding[2].display == \"Body weight\"\n    assert (\n        inst.code.coding[2].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[3].code == \"body-weight\"\n    assert inst.code.coding[3].display == \"Body Weight\"\n    assert (\n        inst.code.coding[3].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/devices/clinical-codes\"}\n        ).valueUri\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-03-28\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"[lb_av]\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"lbs\"\n    assert float(inst.valueQuantity.value) == float(185)\n\n\ndef test_observation_4(base_settings):\n    \"\"\"No. 4 tests collection for Observation.\n    Test File: observation-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observation-example.json\"\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_4(inst2)\n\n\ndef impl_observation_5(inst):\n    assert inst.code.coding[0].code == \"55233-1\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.derivedFrom[0].reference == \"MolecularSequence/example-pgx-1\"\n    assert inst.derivedFrom[1].reference == \"MolecularSequence/example-pgx-2\"\n    assert inst.device.reference == \"Device/example\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-03T15:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/observation-geneticsGene\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCodeableConcept.coding[0].code == \"2623\"\n    assert inst.extension[0].valueCodeableConcept.coding[0].display == \"CYP2C9\"\n    assert (\n        inst.extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.genenames.org\"}\n        ).valueUri\n    )\n    assert inst.id == \"example-haplotype2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"unknown\"\n    assert inst.subject.display == \"J*********** C***********\"\n    assert inst.subject.reference == \"Patient/727127\"\n    assert inst.text.status == \"extensions\"\n    assert inst.valueCodeableConcept.coding[0].code == \"PA16581679\"\n    assert inst.valueCodeableConcept.coding[0].display == \"*4\"\n    assert (\n        inst.valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://pharmakb.org\"}\n        ).valueUri\n    )\n\n\ndef test_observation_5(base_settings):\n    \"\"\"No. 5 tests collection for Observation.\n    Test File: observation-example-haplotype2.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"observation-example-haplotype2.json\"\n    )\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_5(inst2)\n\n\ndef impl_observation_6(inst):\n    assert inst.category[0].coding[0].code == \"vital-signs\"\n    assert inst.category[0].coding[0].display == \"Vital Signs\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Vital Signs\"\n    assert inst.code.coding[0].code == \"8478-0\"\n    assert inst.code.coding[0].display == \"Mean blood pressure\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Mean blood pressure\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1999-07-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"mbp\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"mm[Hg]\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"mm[Hg]\"\n    assert float(inst.valueQuantity.value) == float(80)\n\n\ndef test_observation_6(base_settings):\n    \"\"\"No. 6 tests collection for Observation.\n    Test File: observation-example-mbp.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observation-example-mbp.json\"\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_6(inst2)\n\n\ndef impl_observation_7(inst):\n    assert inst.code.coding[0].code == \"59041-4\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.device.reference == \"Device/example\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-03-03T14:50:23-05:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/observation-geneticsGene\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCodeableConcept.coding[0].code == \"KX470182.1\"\n    assert inst.extension[0].valueCodeableConcept.coding[0].display == \"BRCA\"\n    assert (\n        inst.extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCodeableConcept.coding[0].code == \"413581001\"\n    assert (\n        inst.extension[1].valueCodeableConcept.coding[0].display\n        == \"Unknown racial group\"\n    )\n    assert (\n        inst.extension[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://browser.ihtsdotools.org/\"}\n        ).valueUri\n    )\n    assert inst.id == \"example-genetics-brcapat\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.display == \"Patient1 with Breast Cancer FamilyHistory\"\n    assert inst.subject.reference == \"Patient/brcapat\"\n    assert inst.text.status == \"extensions\"\n\n\ndef test_observation_7(base_settings):\n    \"\"\"No. 7 tests collection for Observation.\n    Test File: observation-example-genetics-brcapat.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"observation-example-genetics-brcapat.json\"\n    )\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_7(inst2)\n\n\ndef impl_observation_8(inst):\n    assert inst.category[0].coding[0].code == \"vital-signs\"\n    assert inst.category[0].coding[0].display == \"Vital Signs\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Vital Signs\"\n    assert inst.code.coding[0].code == \"39156-5\"\n    assert inst.code.coding[0].display == \"Body mass index (BMI) [Ratio]\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"BMI\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1999-07-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"bmi\"\n    assert inst.meta.profile[0] == \"http://hl7.org/fhir/StructureDefinition/vitalsigns\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"kg/m2\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"kg/m2\"\n    assert float(inst.valueQuantity.value) == float(16.2)\n\n\ndef test_observation_8(base_settings):\n    \"\"\"No. 8 tests collection for Observation.\n    Test File: observation-example-bmi.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observation-example-bmi.json\"\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_8(inst2)\n\n\ndef impl_observation_9(inst):\n    assert inst.category[0].coding[0].code == \"vital-signs\"\n    assert inst.category[0].coding[0].display == \"Vital Signs\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Vital Signs\"\n    assert inst.code.coding[0].code == \"8302-2\"\n    assert inst.code.coding[0].display == \"Body height\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Body height\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1999-07-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"body-height\"\n    assert inst.meta.profile[0] == \"http://hl7.org/fhir/StructureDefinition/vitalsigns\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"[in_i]\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"in\"\n    assert float(inst.valueQuantity.value) == float(66.89999999999999)\n\n\ndef test_observation_9(base_settings):\n    \"\"\"No. 9 tests collection for Observation.\n    Test File: observation-example-body-height.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"observation-example-body-height.json\"\n    )\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_9(inst2)\n\n\ndef impl_observation_10(inst):\n    assert inst.code.text == \"eye color\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-05-18\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"eye-color\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueString == \"blue\"\n\n\ndef test_observation_10(base_settings):\n    \"\"\"No. 10 tests collection for Observation.\n    Test File: observation-example-eye-color.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observation-example-eye-color.json\"\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_observationdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ObservationDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import observationdefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_observationdefinition_1(inst):\n    assert inst.code.coding[0].code == \"15074-8\"\n    assert inst.code.coding[0].display == \"Glucose [Moles/volume] in Blood\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_observationdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ObservationDefinition.\n    Test File: observationdefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observationdefinition-example.json\"\n    inst = observationdefinition.ObservationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ObservationDefinition\" == inst.get_resource_type()\n\n    impl_observationdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ObservationDefinition\" == data[\"resourceType\"]\n\n    inst2 = observationdefinition.ObservationDefinition(**data)\n    impl_observationdefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_operationdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OperationDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import operationdefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_operationdefinition_1(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"data-requirements\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"The data-requirements operation aggregates and returns the \"\n        \"parameters and data requirements for the measure and all its\"\n        \" dependencies as a single module definition\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 3\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Measure-data-requirements\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"DataRequirements\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"periodStart\"\n    assert inst.parameter[0].type == \"date\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The end of the measurement period. The period will end at \"\n        \"the end of the period implied by the supplied timestamp. \"\n        \"E.g. a value of 2014 would set the period end to be \"\n        \"2014-12-31T23:59:59 inclusive\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 1\n    assert inst.parameter[1].name == \"periodEnd\"\n    assert inst.parameter[1].type == \"date\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == (\n        \"The result of the requirements gathering is a module-\"\n        \"definition Library that describes the aggregate parameters, \"\n        \"data requirements, and dependencies of the measure\"\n    )\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 1\n    assert inst.parameter[2].name == \"return\"\n    assert inst.parameter[2].type == \"Library\"\n    assert inst.parameter[2].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Measure\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Data Requirements\"\n    assert inst.type is False\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Measure-data-requirements\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_operationdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for OperationDefinition.\n    Test File: operation-measure-data-requirements.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operation-measure-data-requirements.json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_1(inst2)\n\n\ndef impl_operationdefinition_2(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"translate\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 3\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"ConceptMap-translate\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Translate\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"url\"\n    assert inst.parameter[0].type == \"uri\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The concept map is provided directly as part of the request.\"\n        \" Servers may choose not to accept concept maps in this \"\n        \"fashion.\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"conceptMap\"\n    assert inst.parameter[1].type == \"ConceptMap\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"conceptMapVersion\"\n    assert inst.parameter[2].type == \"string\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].documentation == (\n        \"The code that is to be translated. If a code is provided, a \"\n        \"system must be provided\"\n    )\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 0\n    assert inst.parameter[3].name == \"code\"\n    assert inst.parameter[3].type == \"code\"\n    assert inst.parameter[3].use == \"in\"\n    assert (\n        inst.parameter[4].documentation\n        == \"The system for the code that is to be translated\"\n    )\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 0\n    assert inst.parameter[4].name == \"system\"\n    assert inst.parameter[4].type == \"uri\"\n    assert inst.parameter[4].use == \"in\"\n    assert inst.parameter[5].documentation == (\n        \"The version of the system, if one was provided in the source\" \" data\"\n    )\n    assert inst.parameter[5].max == \"1\"\n    assert inst.parameter[5].min == 0\n    assert inst.parameter[5].name == \"version\"\n    assert inst.parameter[5].type == \"string\"\n    assert inst.parameter[5].use == \"in\"\n    assert inst.parameter[6].max == \"1\"\n    assert inst.parameter[6].min == 0\n    assert inst.parameter[6].name == \"source\"\n    assert inst.parameter[6].type == \"uri\"\n    assert inst.parameter[6].use == \"in\"\n    assert inst.parameter[7].documentation == \"A coding to translate\"\n    assert inst.parameter[7].max == \"1\"\n    assert inst.parameter[7].min == 0\n    assert inst.parameter[7].name == \"coding\"\n    assert inst.parameter[7].type == \"Coding\"\n    assert inst.parameter[7].use == \"in\"\n    assert inst.parameter[8].documentation == (\n        \"A full codeableConcept to validate. The server can translate\"\n        \" any of the coding values (e.g. existing translations) as it\"\n        \" chooses\"\n    )\n    assert inst.parameter[8].max == \"1\"\n    assert inst.parameter[8].min == 0\n    assert inst.parameter[8].name == \"codeableConcept\"\n    assert inst.parameter[8].type == \"CodeableConcept\"\n    assert inst.parameter[8].use == \"in\"\n    assert inst.parameter[9].max == \"1\"\n    assert inst.parameter[9].min == 0\n    assert inst.parameter[9].name == \"target\"\n    assert inst.parameter[9].type == \"uri\"\n    assert inst.parameter[9].use == \"in\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"ConceptMap\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Concept Translation\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/ConceptMap-translate\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_operationdefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for OperationDefinition.\n    Test File: operation-conceptmap-translate.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operation-conceptmap-translate.json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_2(inst2)\n\n\ndef impl_operationdefinition_3(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"expand\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 5\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"normative\"\n    assert inst.id == \"ValueSet-expand\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Expand\"\n    assert inst.parameter[0].documentation == (\n        \"A canonical reference to a value set. The server must know \"\n        \"the value set (e.g. it is defined explicitly in the server's\"\n        \" value sets, or it is defined implicitly by some code system\"\n        \" known to the server\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"url\"\n    assert inst.parameter[0].type == \"uri\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The value set is provided directly as part of the request. \"\n        \"Servers may choose not to accept value sets in this fashion\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"valueSet\"\n    assert inst.parameter[1].type == \"ValueSet\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"valueSetVersion\"\n    assert inst.parameter[2].type == \"string\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 0\n    assert inst.parameter[3].name == \"context\"\n    assert inst.parameter[3].type == \"uri\"\n    assert inst.parameter[3].use == \"in\"\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 0\n    assert inst.parameter[4].name == \"contextDirection\"\n    assert inst.parameter[4].type == \"code\"\n    assert inst.parameter[4].use == \"in\"\n    assert inst.parameter[5].max == \"1\"\n    assert inst.parameter[5].min == 0\n    assert inst.parameter[5].name == \"filter\"\n    assert inst.parameter[5].type == \"string\"\n    assert inst.parameter[5].use == \"in\"\n    assert inst.parameter[6].max == \"1\"\n    assert inst.parameter[6].min == 0\n    assert inst.parameter[6].name == \"date\"\n    assert inst.parameter[6].type == \"dateTime\"\n    assert inst.parameter[6].use == \"in\"\n    assert inst.parameter[7].documentation == (\n        \"Paging support - where to start if a subset is desired \"\n        \"(default = 0). Offset is number of records (not number of \"\n        \"pages)\"\n    )\n    assert inst.parameter[7].max == \"1\"\n    assert inst.parameter[7].min == 0\n    assert inst.parameter[7].name == \"offset\"\n    assert inst.parameter[7].type == \"integer\"\n    assert inst.parameter[7].use == \"in\"\n    assert inst.parameter[8].max == \"1\"\n    assert inst.parameter[8].min == 0\n    assert inst.parameter[8].name == \"count\"\n    assert inst.parameter[8].type == \"integer\"\n    assert inst.parameter[8].use == \"in\"\n    assert inst.parameter[9].documentation == (\n        \"Controls whether concept designations are to be included or \"\n        \"excluded in value set expansions\"\n    )\n    assert inst.parameter[9].max == \"1\"\n    assert inst.parameter[9].min == 0\n    assert inst.parameter[9].name == \"includeDesignations\"\n    assert inst.parameter[9].type == \"boolean\"\n    assert inst.parameter[9].use == \"in\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"ValueSet\"\n    assert inst.status == \"active\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Value Set Expansion\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/ValueSet-expand\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_operationdefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for OperationDefinition.\n    Test File: operation-valueset-expand.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"operation-valueset-expand.json\"\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_3(inst2)\n\n\ndef impl_operationdefinition_4(inst):\n    assert inst.affectsState is True\n    assert inst.code == \"meta-add\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This operation takes a meta, and adds the profiles, tags, \"\n        \"and security labels found in it to the nominated resource\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 3\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Resource-meta-add\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"MetaAdd\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"meta\"\n    assert inst.parameter[0].type == \"Meta\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == \"Resulting meta for the resource\"\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 1\n    assert inst.parameter[1].name == \"return\"\n    assert inst.parameter[1].type == \"Meta\"\n    assert inst.parameter[1].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Resource\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Add profiles, tags, and security labels to a resource\"\n    assert inst.type is False\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Resource-meta-add\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_operationdefinition_4(base_settings):\n    \"\"\"No. 4 tests collection for OperationDefinition.\n    Test File: operation-resource-meta-add.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"operation-resource-meta-add.json\"\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_4(inst2)\n\n\ndef impl_operationdefinition_5(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"everything\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 2\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Encounter-everything\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Everything\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"_since\"\n    assert inst.parameter[0].type == \"instant\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"One or more parameters, each containing one or more comma-\"\n        \"delimited FHIR resource types to include in the return \"\n        \"resources. In the absense of any specified types, the server\"\n        \" returns all resource types\"\n    )\n    assert inst.parameter[1].max == \"*\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"_type\"\n    assert inst.parameter[1].type == \"code\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == (\n        \"See discussion below on the utility of paging through the \"\n        \"results of the $everything operation\"\n    )\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"_count\"\n    assert inst.parameter[2].type == \"integer\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].documentation == 'The bundle type is \"searchset\"'\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 1\n    assert inst.parameter[3].name == \"return\"\n    assert inst.parameter[3].type == \"Bundle\"\n    assert inst.parameter[3].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Encounter\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Fetch Encounter Record\"\n    assert inst.type is False\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Encounter-everything\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_operationdefinition_5(base_settings):\n    \"\"\"No. 5 tests collection for OperationDefinition.\n    Test File: operation-encounter-everything.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operation-encounter-everything.json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_5(inst2)\n\n\ndef impl_operationdefinition_6(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"graph\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 1\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Resource-graph\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Graph\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"graph\"\n    assert inst.parameter[0].type == \"uri\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The set of resources that were in the graph based on the \"\n        \"provided definition\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 1\n    assert inst.parameter[1].name == \"result\"\n    assert inst.parameter[1].type == \"Bundle\"\n    assert inst.parameter[1].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Resource\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Return a graph of resources\"\n    assert inst.type is False\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Resource-graph\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_operationdefinition_6(base_settings):\n    \"\"\"No. 6 tests collection for OperationDefinition.\n    Test File: operation-resource-graph.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"operation-resource-graph.json\"\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_6(inst2)\n\n\ndef impl_operationdefinition_7(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"meta\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 3\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Resource-meta\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Meta\"\n    assert inst.parameter[0].documentation == \"The meta returned by the operation\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"return\"\n    assert inst.parameter[0].type == \"Meta\"\n    assert inst.parameter[0].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Resource\"\n    assert inst.status == \"draft\"\n    assert inst.system is True\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Access a list of profiles, tags, and security labels\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Resource-meta\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_operationdefinition_7(base_settings):\n    \"\"\"No. 7 tests collection for OperationDefinition.\n    Test File: operation-resource-meta.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"operation-resource-meta.json\"\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_7(inst2)\n\n\ndef impl_operationdefinition_8(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"care-gaps\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"The care-gaps operation is used to determine gaps-in-care \"\n        \"based on the results of quality measures\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 3\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Measure-care-gaps\"\n    assert inst.instance is False\n    assert inst.kind == \"operation\"\n    assert inst.name == \"CareGaps\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"periodStart\"\n    assert inst.parameter[0].type == \"date\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The end of the measurement period. The period will end at \"\n        \"the end of the period implied by the supplied timestamp. \"\n        \"E.g. a value of 2014 would set the period end to be \"\n        \"2014-12-31T23:59:59 inclusive\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 1\n    assert inst.parameter[1].name == \"periodEnd\"\n    assert inst.parameter[1].type == \"date\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == (\n        \"The topic to be used to determine which measures are \"\n        \"considered for the care gaps report. Any measure with the \"\n        \"given topic will be included in the report\"\n    )\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 1\n    assert inst.parameter[2].name == \"topic\"\n    assert inst.parameter[2].type == \"string\"\n    assert inst.parameter[2].use == \"in\"\n    assert (\n        inst.parameter[3].documentation\n        == \"Subject for which the care gaps report will be produced\"\n    )\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 1\n    assert inst.parameter[3].name == \"subject\"\n    assert inst.parameter[3].searchType == \"reference\"\n    assert inst.parameter[3].type == \"string\"\n    assert inst.parameter[3].use == \"in\"\n    assert inst.parameter[4].documentation == (\n        \"The result of the care gaps report will be returned as a \"\n        \"document bundle with a MeasureReport entry for each included\"\n        \" measure\"\n    )\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 1\n    assert inst.parameter[4].name == \"return\"\n    assert inst.parameter[4].type == \"Bundle\"\n    assert inst.parameter[4].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Measure\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Care Gaps\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Measure-care-gaps\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_operationdefinition_8(base_settings):\n    \"\"\"No. 8 tests collection for OperationDefinition.\n    Test File: operation-measure-care-gaps.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"operation-measure-care-gaps.json\"\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_8(inst2)\n\n\ndef impl_operationdefinition_9(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"submit-data\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 3\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Measure-submit-data\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"SubmitData\"\n    assert inst.parameter[0].documentation == \"The measure report being submitted\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"measureReport\"\n    assert inst.parameter[0].type == \"MeasureReport\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The individual resources that make up the data-of-interest \" \"being submitted\"\n    )\n    assert inst.parameter[1].max == \"*\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"resource\"\n    assert inst.parameter[1].type == \"Resource\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Measure\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Submit Data\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Measure-submit-data\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_operationdefinition_9(base_settings):\n    \"\"\"No. 9 tests collection for OperationDefinition.\n    Test File: operation-measure-submit-data.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"operation-measure-submit-data.json\"\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_9(inst2)\n\n\ndef impl_operationdefinition_10(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"evaluate-measure\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"The evaluate-measure operation is used to calculate an \"\n        \"eMeasure and obtain the results\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 3\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Measure-evaluate-measure\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"EvaluateMeasure\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"periodStart\"\n    assert inst.parameter[0].type == \"date\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The end of the measurement period. The period will end at \"\n        \"the end of the period implied by the supplied timestamp. \"\n        \"E.g. a value of 2014 would set the period end to be \"\n        \"2014-12-31T23:59:59 inclusive\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 1\n    assert inst.parameter[1].name == \"periodEnd\"\n    assert inst.parameter[1].type == \"date\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == (\n        \"The measure to evaluate. This parameter is only required \"\n        \"when the operation is invoked on the resource type, it is \"\n        \"not used when invoking the operation on a Measure instance\"\n    )\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"measure\"\n    assert inst.parameter[2].searchType == \"reference\"\n    assert inst.parameter[2].type == \"string\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].documentation == (\n        \"The type of measure report: subject, subject-list, or \"\n        \"population. If not specified, a default value of subject \"\n        \"will be used if the subject parameter is supplied, \"\n        \"otherwise, population will be used\"\n    )\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 0\n    assert inst.parameter[3].name == \"reportType\"\n    assert inst.parameter[3].type == \"code\"\n    assert inst.parameter[3].use == \"in\"\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 0\n    assert inst.parameter[4].name == \"subject\"\n    assert inst.parameter[4].searchType == \"reference\"\n    assert inst.parameter[4].type == \"string\"\n    assert inst.parameter[4].use == \"in\"\n    assert inst.parameter[5].documentation == (\n        \"Practitioner for which the measure will be calculated. If \"\n        \"specified, the measure will be calculated only for subjects \"\n        \"that have a primary relationship to the identified \"\n        \"practitioner\"\n    )\n    assert inst.parameter[5].max == \"1\"\n    assert inst.parameter[5].min == 0\n    assert inst.parameter[5].name == \"practitioner\"\n    assert inst.parameter[5].searchType == \"reference\"\n    assert inst.parameter[5].type == \"string\"\n    assert inst.parameter[5].use == \"in\"\n    assert inst.parameter[6].max == \"1\"\n    assert inst.parameter[6].min == 0\n    assert inst.parameter[6].name == \"lastReceivedOn\"\n    assert inst.parameter[6].type == \"dateTime\"\n    assert inst.parameter[6].use == \"in\"\n    assert inst.parameter[7].max == \"1\"\n    assert inst.parameter[7].min == 1\n    assert inst.parameter[7].name == \"return\"\n    assert inst.parameter[7].type == \"MeasureReport\"\n    assert inst.parameter[7].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Measure\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Evaluate Measure\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Measure-evaluate-measure\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_operationdefinition_10(base_settings):\n    \"\"\"No. 10 tests collection for OperationDefinition.\n    Test File: operation-measure-evaluate-measure.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operation-measure-evaluate-measure.json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_operationoutcome.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OperationOutcome\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import operationoutcome\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_operationoutcome_1(inst):\n    assert inst.id == \"validationfail\"\n    assert inst.issue[0].code == \"structure\"\n    assert (\n        inst.issue[0].details.text\n        == 'Error parsing resource XML (Unknown Content \"label\"'\n    )\n    assert inst.issue[0].expression[0] == \"Patient.identifier\"\n    assert inst.issue[0].location[0] == \"/f:Patient/f:identifier\"\n    assert inst.issue[0].severity == \"error\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_operationoutcome_1(base_settings):\n    \"\"\"No. 1 tests collection for OperationOutcome.\n    Test File: operationoutcome-example-validationfail.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationoutcome-example-validationfail.json\"\n    )\n    inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes())\n    assert \"OperationOutcome\" == inst.get_resource_type()\n\n    impl_operationoutcome_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationOutcome\" == data[\"resourceType\"]\n\n    inst2 = operationoutcome.OperationOutcome(**data)\n    impl_operationoutcome_1(inst2)\n\n\ndef impl_operationoutcome_2(inst):\n    assert inst.id == \"break-the-glass\"\n    assert inst.issue[0].code == \"suppressed\"\n    assert inst.issue[0].details.coding[0].code == \"ETREAT\"\n    assert inst.issue[0].details.coding[0].display == \"Emergency Treatment\"\n    assert (\n        inst.issue[0].details.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.issue[0].details.text == (\n        \"Additional information may be available using the Break-The-\" \"Glass Protocol\"\n    )\n    assert inst.issue[0].severity == \"information\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_operationoutcome_2(base_settings):\n    \"\"\"No. 2 tests collection for OperationOutcome.\n    Test File: operationoutcome-example-break-the-glass.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationoutcome-example-break-the-glass.json\"\n    )\n    inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes())\n    assert \"OperationOutcome\" == inst.get_resource_type()\n\n    impl_operationoutcome_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationOutcome\" == data[\"resourceType\"]\n\n    inst2 = operationoutcome.OperationOutcome(**data)\n    impl_operationoutcome_2(inst2)\n\n\ndef impl_operationoutcome_3(inst):\n    assert inst.id == \"searchfail\"\n    assert inst.issue[0].code == \"code-invalid\"\n    assert inst.issue[0].details.text == (\n        'The \"name\" parameter has the modifier \"exact\" which is '\n        \"not supported by this server\"\n    )\n    assert inst.issue[0].location[0] == \"http.name:exact\"\n    assert inst.issue[0].severity == \"fatal\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_operationoutcome_3(base_settings):\n    \"\"\"No. 3 tests collection for OperationOutcome.\n    Test File: operationoutcome-example-searchfail.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operationoutcome-example-searchfail.json\"\n    )\n    inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes())\n    assert \"OperationOutcome\" == inst.get_resource_type()\n\n    impl_operationoutcome_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationOutcome\" == data[\"resourceType\"]\n\n    inst2 = operationoutcome.OperationOutcome(**data)\n    impl_operationoutcome_3(inst2)\n\n\ndef impl_operationoutcome_4(inst):\n    assert inst.id == \"exception\"\n    assert inst.issue[0].code == \"exception\"\n    assert inst.issue[0].details.text == \"SQL Link Communication Error (dbx = 34234)\"\n    assert inst.issue[0].severity == \"error\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_operationoutcome_4(base_settings):\n    \"\"\"No. 4 tests collection for OperationOutcome.\n    Test File: operationoutcome-example-exception.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operationoutcome-example-exception.json\"\n    )\n    inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes())\n    assert \"OperationOutcome\" == inst.get_resource_type()\n\n    impl_operationoutcome_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationOutcome\" == data[\"resourceType\"]\n\n    inst2 = operationoutcome.OperationOutcome(**data)\n    impl_operationoutcome_4(inst2)\n\n\ndef impl_operationoutcome_5(inst):\n    assert inst.id == \"101\"\n    assert inst.issue[0].code == \"code-invalid\"\n    assert (\n        inst.issue[0].details.text\n        == 'The code \"W\" is not known and not legal in this context'\n    )\n    assert (\n        inst.issue[0].diagnostics\n        == \"Acme.Interop.FHIRProcessors.Patient.processGender line 2453\"\n    )\n    assert inst.issue[0].expression[0] == \"Patient.gender\"\n    assert inst.issue[0].location[0] == \"/f:Patient/f:gender\"\n    assert inst.issue[0].severity == \"error\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_operationoutcome_5(base_settings):\n    \"\"\"No. 5 tests collection for OperationOutcome.\n    Test File: operationoutcome-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"operationoutcome-example.json\"\n    inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes())\n    assert \"OperationOutcome\" == inst.get_resource_type()\n\n    impl_operationoutcome_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationOutcome\" == data[\"resourceType\"]\n\n    inst2 = operationoutcome.OperationOutcome(**data)\n    impl_operationoutcome_5(inst2)\n\n\ndef impl_operationoutcome_6(inst):\n    assert inst.id == \"allok\"\n    assert inst.issue[0].code == \"informational\"\n    assert inst.issue[0].details.text == \"All OK\"\n    assert inst.issue[0].severity == \"information\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_operationoutcome_6(base_settings):\n    \"\"\"No. 6 tests collection for OperationOutcome.\n    Test File: operationoutcome-example-allok.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operationoutcome-example-allok.json\"\n    )\n    inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes())\n    assert \"OperationOutcome\" == inst.get_resource_type()\n\n    impl_operationoutcome_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationOutcome\" == data[\"resourceType\"]\n\n    inst2 = operationoutcome.OperationOutcome(**data)\n    impl_operationoutcome_6(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_organization.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Organization\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import organization\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_organization_1(inst):\n    assert inst.address[0].city == \"Ann Arbor\"\n    assert inst.address[0].country == \"USA\"\n    assert inst.address[0].line[0] == \"3300 Washtenaw Avenue, Suite 227\"\n    assert inst.address[0].postalCode == \"48104\"\n    assert inst.address[0].state == \"MI\"\n    assert inst.alias[0] == \"HL7 International\"\n    assert inst.endpoint[0].reference == \"Endpoint/example\"\n    assert inst.id == \"hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Health Level Seven International\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].value == \"(+1) 734-677-7777\"\n    assert inst.telecom[1].system == \"fax\"\n    assert inst.telecom[1].value == \"(+1) 734-677-6622\"\n    assert inst.telecom[2].system == \"email\"\n    assert inst.telecom[2].value == \"hq@HL7.org\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_1(base_settings):\n    \"\"\"No. 1 tests collection for Organization.\n    Test File: organization-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"organization-example.json\"\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_1(inst2)\n\n\ndef impl_organization_2(inst):\n    assert inst.active is True\n    assert inst.address[0].country == \"Swizterland\"\n    assert inst.id == \"mmanu\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Acme Corporation\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_2(base_settings):\n    \"\"\"No. 2 tests collection for Organization.\n    Test File: organization-example-mmanu.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"organization-example-mmanu.json\"\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_2(inst2)\n\n\ndef impl_organization_3(inst):\n    assert inst.id == \"1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org.au/units\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"Gastro\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Gastroenterology\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"mobile\"\n    assert inst.telecom[0].value == \"+1 555 234 3523\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"gastro@acme.org\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_3(base_settings):\n    \"\"\"No. 3 tests collection for Organization.\n    Test File: organization-example-gastro.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"organization-example-gastro.json\"\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_3(inst2)\n\n\ndef impl_organization_4(inst):\n    assert inst.alias[0] == \"Michigan State Department of Health\"\n    assert inst.id == \"3\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://michigan.gov/state-dept-ids\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"25\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Michigan Health\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_4(base_settings):\n    \"\"\"No. 4 tests collection for Organization.\n    Test File: organization-example-mihealth.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"organization-example-mihealth.json\"\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_4(inst2)\n\n\ndef impl_organization_5(inst):\n    assert inst.id == \"1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org.au/units\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"ClinLab\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Clinical Lab\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"+1 555 234 1234\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"contact@labs.acme.org\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_5(base_settings):\n    \"\"\"No. 5 tests collection for Organization.\n    Test File: organization-example-lab.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"organization-example-lab.json\"\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_5(inst2)\n\n\ndef impl_organization_6(inst):\n    assert inst.active is True\n    assert inst.address[0].line[0] == \"South Wing, floor 2\"\n    assert inst.contact[0].address.line[0] == \"South Wing, floor 2\"\n    assert inst.contact[0].name.text == \"mevr. D. de Haan\"\n    assert inst.contact[0].purpose.coding[0].code == \"ADMIN\"\n    assert (\n        inst.contact[0].purpose.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/contactentity-type\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].value == \"022-655 2321\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"cardio@burgersumc.nl\"\n    assert inst.contact[0].telecom[2].system == \"fax\"\n    assert inst.contact[0].telecom[2].value == \"022-655 2322\"\n    assert inst.id == \"f002\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Burgers UMC Cardiology unit\"\n    assert inst.partOf.reference == \"Organization/f001\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].value == \"022-655 2320\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"dept\"\n    assert inst.type[0].coding[0].display == \"Hospital Department\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/organization-type\"}\n        ).valueUri\n    )\n\n\ndef test_organization_6(base_settings):\n    \"\"\"No. 6 tests collection for Organization.\n    Test File: organization-example-f002-burgers-card.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"organization-example-f002-burgers-card.json\"\n    )\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_6(inst2)\n\n\ndef impl_organization_7(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Den Helder\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Walvisbaai 3\"\n    assert inst.address[0].postalCode == \"2333ZA\"\n    assert inst.address[0].use == \"work\"\n    assert inst.contact[0].address.city == \"Den helder\"\n    assert inst.contact[0].address.country == \"NLD\"\n    assert inst.contact[0].address.line[0] == \"Walvisbaai 3\"\n    assert inst.contact[0].address.line[1] == \"Gebouw 2\"\n    assert inst.contact[0].address.postalCode == \"2333ZA\"\n    assert inst.contact[0].name.family == \"Brand\"\n    assert inst.contact[0].name.given[0] == \"Ronald\"\n    assert inst.contact[0].name.prefix[0] == \"Prof.Dr.\"\n    assert inst.contact[0].name.text == \"Professor Brand\"\n    assert inst.contact[0].name.use == \"official\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"+31715269702\"\n    assert inst.id == \"f201\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.zorgkaartnederland.nl/\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"Artis University Medical Center\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Artis University Medical Center (AUMC)\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"+31715269111\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"405608006\"\n    assert inst.type[0].coding[0].display == \"Academic Medical Center\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.type[0].coding[1].code == \"V6\"\n    assert inst.type[0].coding[1].display == \"University Medical Hospital\"\n    assert (\n        inst.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.15.1060\"}\n        ).valueUri\n    )\n    assert inst.type[0].coding[2].code == \"prov\"\n    assert inst.type[0].coding[2].display == \"Healthcare Provider\"\n    assert (\n        inst.type[0].coding[2].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/organization-type\"}\n        ).valueUri\n    )\n\n\ndef test_organization_7(base_settings):\n    \"\"\"No. 7 tests collection for Organization.\n    Test File: organization-example-f201-aumc.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"organization-example-f201-aumc.json\"\n    )\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_7(inst2)\n\n\ndef impl_organization_8(inst):\n    assert inst.id == \"2.16.840.1.113883.19.5\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.19.5\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Good Health Clinic\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_8(base_settings):\n    \"\"\"No. 8 tests collection for Organization.\n    Test File: organization-example-good-health-care.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"organization-example-good-health-care.json\"\n    )\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_8(inst2)\n\n\ndef impl_organization_9(inst):\n    assert inst.address[0].city == \"Den Burg\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Galapagosweg 91\"\n    assert inst.address[0].postalCode == \"9105 PZ\"\n    assert inst.address[0].use == \"work\"\n    assert inst.address[1].city == \"Den Burg\"\n    assert inst.address[1].country == \"NLD\"\n    assert inst.address[1].line[0] == \"PO Box 2311\"\n    assert inst.address[1].postalCode == \"9100 AA\"\n    assert inst.address[1].use == \"work\"\n    assert inst.contact[0].purpose.coding[0].code == \"PRESS\"\n    assert (\n        inst.contact[0].purpose.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/contactentity-type\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].value == \"022-655 2334\"\n    assert inst.contact[1].purpose.coding[0].code == \"PATINF\"\n    assert (\n        inst.contact[1].purpose.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/contactentity-type\"}\n        ).valueUri\n    )\n    assert inst.contact[1].telecom[0].system == \"phone\"\n    assert inst.contact[1].telecom[0].value == \"022-655 2335\"\n    assert inst.id == \"f001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"91654\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"usual\"\n    assert inst.identifier[1].value == \"17-0112278\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Burgers University Medical Center\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"022-655 2300\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"V6\"\n    assert inst.type[0].coding[0].display == \"University Medical Hospital\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.15.1060\"}\n        ).valueUri\n    )\n    assert inst.type[0].coding[1].code == \"prov\"\n    assert inst.type[0].coding[1].display == \"Healthcare Provider\"\n    assert (\n        inst.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/organization-type\"}\n        ).valueUri\n    )\n\n\ndef test_organization_9(base_settings):\n    \"\"\"No. 9 tests collection for Organization.\n    Test File: organization-example-f001-burgers.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"organization-example-f001-burgers.json\"\n    )\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_9(inst2)\n\n\ndef impl_organization_10(inst):\n    assert inst.alias[0] == \"ABC Insurance\"\n    assert inst.id == \"2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.3.19.2.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"666666\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"XYZ Insurance\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_10(base_settings):\n    \"\"\"No. 10 tests collection for Organization.\n    Test File: organization-example-insurer.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"organization-example-insurer.json\"\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_organizationaffiliation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import organizationaffiliation\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_organizationaffiliation_1(inst):\n    assert inst.active is True\n    assert inst.code[0].coding[0].code == \"provider\"\n    assert (\n        inst.code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/organization-role\"}\n        ).valueUri\n    )\n    assert inst.endpoint[0].reference == \"Endpoint/example\"\n    assert inst.healthcareService[0].reference == \"HealthcareService/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org/practitioners\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"23\"\n    assert inst.location[0].display == \"South Wing, second floor\"\n    assert inst.location[0].reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.network[0].display == \"HL7 Payer Network\"\n    assert inst.network[0].reference == \"Organization/hl7pay\"\n    assert inst.organization.reference == \"Organization/hl7pay\"\n    assert inst.participatingOrganization.reference == \"Organization/f001\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-03-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.specialty[0].coding[0].code == \"408443003\"\n    assert inst.specialty[0].coding[0].display == \"General medical practice\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"email\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"general.practice@example.org\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organizationaffiliation_1(base_settings):\n    \"\"\"No. 1 tests collection for OrganizationAffiliation.\n    Test File: organizationaffiliation-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"organizationaffiliation-example.json\"\n    )\n    inst = organizationaffiliation.OrganizationAffiliation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OrganizationAffiliation\" == inst.get_resource_type()\n\n    impl_organizationaffiliation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OrganizationAffiliation\" == data[\"resourceType\"]\n\n    inst2 = organizationaffiliation.OrganizationAffiliation(**data)\n    impl_organizationaffiliation_1(inst2)\n\n\ndef impl_organizationaffiliation_2(inst):\n    assert inst.active is True\n    assert inst.code[0].coding[0].code == \"member\"\n    assert inst.code[0].coding[0].display == \"Member\"\n    assert (\n        inst.code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/organization-role\"}\n        ).valueUri\n    )\n    assert inst.code[0].text == \"Hospital member\"\n    assert inst.endpoint[0].display == \"Founding Fathers Memorial Hospital HIE endpoint\"\n    assert (\n        inst.endpoint[0].reference\n        == \"http://hl7.org/fhir/ig/vhdir/Endpoint/foundingfathersHIE\"\n    )\n    assert inst.id == \"orgrole2\"\n    assert inst.identifier[0].assigner.display == \"Monument Health Information Exchange\"\n    assert (\n        inst.identifier[0].assigner.reference\n        == \"http://hl7.org/fhir/ig/vhdir/Organization/monumentHIE\"\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/www.monumentHIE.com\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"member hospital\"\n    assert inst.identifier[0].use == \"secondary\"\n    assert inst.identifier[0].value == \"hosp32\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization.display == \"Monument Health Information Exchange\"\n    assert (\n        inst.organization.reference\n        == \"http://hl7.org/fhir/ig/vhdir/Organization/monumentHIE\"\n    )\n    assert (\n        inst.participatingOrganization.display == \"Founding Fathers Memorial Hospital\"\n    )\n    assert (\n        inst.participatingOrganization.reference\n        == \"http://hl7.org/fhir/ig/vhdir/Organization/foundingfathers\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_organizationaffiliation_2(base_settings):\n    \"\"\"No. 2 tests collection for OrganizationAffiliation.\n    Test File: orgrole-example-hie.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"orgrole-example-hie.json\"\n    inst = organizationaffiliation.OrganizationAffiliation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OrganizationAffiliation\" == inst.get_resource_type()\n\n    impl_organizationaffiliation_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OrganizationAffiliation\" == data[\"resourceType\"]\n\n    inst2 = organizationaffiliation.OrganizationAffiliation(**data)\n    impl_organizationaffiliation_2(inst2)\n\n\ndef impl_organizationaffiliation_3(inst):\n    assert inst.active is True\n    assert inst.code[0].coding[0].code == \"provider\"\n    assert inst.code[0].coding[0].display == \"Provider\"\n    assert (\n        inst.code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/organization-role\"}\n        ).valueUri\n    )\n    assert inst.code[0].coding[0].userSelected is True\n    assert inst.code[0].text == \"Provider of rehabilitation services\"\n    assert inst.healthcareService[0].display == \"Inpatient rehabilitation services\"\n    assert inst.healthcareService[0].reference == (\n        \"http://hl7.org/fhir/ig/vhdir/HealthcareService/independencer\" \"ehab1\"\n    )\n    assert inst.healthcareService[1].display == \"Outpatient rehabilitation services\"\n    assert inst.healthcareService[1].reference == (\n        \"http://hl7.org/fhir/ig/vhdir/HealthcareService/independencer\" \"ehab2\"\n    )\n    assert inst.id == \"orgrole1\"\n    assert inst.identifier[0].assigner.display == \"Founding Fathers Memorial Hospital\"\n    assert (\n        inst.identifier[0].assigner.reference\n        == \"http://hl7.org/fhir/ig/vhdir/Organization/foundingfathers\"\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/www.foundingfathersmemorial.com\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"secondary\"\n    assert inst.identifier[0].value == \"service002\"\n    assert inst.location[0].display == \"Founding Fathers Memorial Hospital\"\n    assert (\n        inst.location[0].reference\n        == \"http://hl7.org/fhir/ig/vhdir/Location/foundingfathers1\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.network[0].display == \"Patriot Preferred Provider Network\"\n    assert (\n        inst.network[0].reference == \"http://hl7.org/fhir/ig/vhdir/Network/patriotppo\"\n    )\n    assert inst.organization.display == \"Founding Fathers Memorial Hospital\"\n    assert (\n        inst.organization.reference\n        == \"http://hl7.org/fhir/ig/vhdir/Organization/foundingfathers\"\n    )\n    assert (\n        inst.participatingOrganization.display\n        == \"Independence Rehabilitation Services, Inc.\"\n    )\n    assert (\n        inst.participatingOrganization.reference\n        == \"http://hl7.org/fhir/ig/vhdir/Organization/independencerehab\"\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-02-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-02-09\"}\n        ).valueDateTime\n    )\n    assert inst.specialty[0].coding[0].code == \"394602003\"\n    assert inst.specialty[0].coding[0].display == \"Rehabilitation - specialty\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.specialty[0].text == \"Rehabilitation\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"202-109-8765\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organizationaffiliation_3(base_settings):\n    \"\"\"No. 3 tests collection for OrganizationAffiliation.\n    Test File: orgrole-example-services.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"orgrole-example-services.json\"\n    inst = organizationaffiliation.OrganizationAffiliation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OrganizationAffiliation\" == inst.get_resource_type()\n\n    impl_organizationaffiliation_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OrganizationAffiliation\" == data[\"resourceType\"]\n\n    inst2 = organizationaffiliation.OrganizationAffiliation(**data)\n    impl_organizationaffiliation_3(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_packagedproductdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PackagedProductDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import packagedproductdefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_packagedproductdefinition_1(inst):\n    assert (\n        inst.description == \"ALU-PVC/PVDC BLISTERS. CARTONS OF 10 FILM-COATED TABLETS.\"\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/pcid\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"{PCID}\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.package.manufacturer[0].reference == \"Organization/example\"\n    assert inst.package.material[0].coding[0].code == \"Paperboard\"\n    assert (\n        inst.package.material[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/packageItemContainerMaterial\"}\n        ).valueUri\n    )\n    assert float(inst.package.package[0].containedItem[0].amount.value) == float(10)\n    assert (\n        inst.package.package[0].containedItem[0].item.reference.reference\n        == \"ManufacturedItemDefinition/tablet\"\n    )\n    assert inst.package.package[0].manufacturer[0].reference == \"Organization/example\"\n    assert inst.package.package[0].material[0].coding[0].code == \"PVC\"\n    assert (\n        inst.package.package[0].material[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/packageItemContainerMaterial\"}\n        ).valueUri\n    )\n    assert inst.package.package[0].material[1].coding[0].code == \"PVDC\"\n    assert (\n        inst.package.package[0].material[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/packageItemContainerMaterial\"}\n        ).valueUri\n    )\n    assert inst.package.package[0].material[2].coding[0].code == \"alu\"\n    assert (\n        inst.package.package[0].material[2].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/packageItemContainerMaterial\"}\n        ).valueUri\n    )\n    assert inst.package.package[0].property[0].type.coding[0].code == \"height\"\n    assert inst.package.package[0].property[0].valueQuantity.code == \"mm\"\n    assert (\n        inst.package.package[0].property[0].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.package.package[0].property[0].valueQuantity.unit == \"mm\"\n    assert float(inst.package.package[0].property[0].valueQuantity.value) == float(45)\n    assert inst.package.package[0].property[1].type.coding[0].code == \"width\"\n    assert inst.package.package[0].property[1].valueQuantity.code == \"mm\"\n    assert (\n        inst.package.package[0].property[1].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.package.package[0].property[1].valueQuantity.unit == \"mm\"\n    assert float(inst.package.package[0].property[1].valueQuantity.value) == float(35)\n    assert inst.package.package[0].quantity == 1\n    assert inst.package.package[0].shelfLifeStorage[0].periodDuration.code == \"a\"\n    assert (\n        inst.package.package[0].shelfLifeStorage[0].periodDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.package.package[0].shelfLifeStorage[0].periodDuration.unit == \"year\"\n    assert float(\n        inst.package.package[0].shelfLifeStorage[0].periodDuration.value\n    ) == float(3)\n    assert (\n        inst.package.package[0]\n        .shelfLifeStorage[0]\n        .specialPrecautionsForStorage[0]\n        .coding[0]\n        .code\n        == \"none\"\n    )\n    assert (\n        inst.package.package[0]\n        .shelfLifeStorage[0]\n        .specialPrecautionsForStorage[0]\n        .coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/specialprecautionsforstorage\"}\n        ).valueUri\n    )\n    assert (\n        inst.package.package[0].shelfLifeStorage[0].type.coding[0].code\n        == \"ShelfLifeofPackagedMedicinalProduct\"\n    )\n    assert (\n        inst.package.package[0].shelfLifeStorage[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/shelfLifeTypePlaceHolder\"}\n        ).valueUri\n    )\n    assert inst.package.package[0].type.coding[0].code == \"Blister\"\n    assert (\n        inst.package.package[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/packageitemcontainertype\"}\n        ).valueUri\n    )\n    assert inst.package.property[0].type.coding[0].code == \"height\"\n    assert inst.package.property[0].valueQuantity.code == \"mm\"\n    assert (\n        inst.package.property[0].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.package.property[0].valueQuantity.unit == \"mm\"\n    assert float(inst.package.property[0].valueQuantity.value) == float(50)\n    assert inst.package.property[1].type.coding[0].code == \"width\"\n    assert inst.package.property[1].valueQuantity.code == \"mm\"\n    assert (\n        inst.package.property[1].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.package.property[1].valueQuantity.unit == \"mm\"\n    assert float(inst.package.property[1].valueQuantity.value) == float(45)\n    assert inst.package.property[2].type.coding[0].code == \"depth\"\n    assert inst.package.property[2].valueQuantity.code == \"mm\"\n    assert (\n        inst.package.property[2].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.package.property[2].valueQuantity.unit == \"mm\"\n    assert float(inst.package.property[2].valueQuantity.value) == float(23.5)\n    assert inst.package.quantity == 1\n    assert inst.package.type.coding[0].code == \"Carton\"\n    assert (\n        inst.package.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/packageitemcontainertype\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_packagedproductdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for PackagedProductDefinition.\n    Test File: packagedproductdefinition-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"packagedproductdefinition-example.json\"\n    )\n    inst = packagedproductdefinition.PackagedProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"PackagedProductDefinition\" == inst.get_resource_type()\n\n    impl_packagedproductdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PackagedProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = packagedproductdefinition.PackagedProductDefinition(**data)\n    impl_packagedproductdefinition_1(inst2)\n\n\ndef impl_packagedproductdefinition_2(inst):\n    assert inst.contained[0].id == \"syringeDevice\"\n    assert inst.contained[1].id == \"liquidItem\"\n    assert inst.id == \"package-with-liquid-and-syringe\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.package.containedItem[0].amount.code == \"mL\"\n    assert (\n        inst.package.containedItem[0].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.package.containedItem[0].amount.unit == \"ml\"\n    assert float(inst.package.containedItem[0].amount.value) == float(20)\n    assert inst.package.containedItem[0].item.reference.reference == \"#liquidItem\"\n    assert inst.package.containedItem[1].item.reference.reference == \"#syringeDevice\"\n    assert (\n        inst.packageFor[0].reference\n        == \"MedicinalProductDefinition/ProductThatHasThisPackType\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_packagedproductdefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for PackagedProductDefinition.\n    Test File: packagedproductdefinition-example-co-packaged-liquid-and-syringe.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"packagedproductdefinition-example-co-packaged-liquid-and-syringe.json\"\n    )\n    inst = packagedproductdefinition.PackagedProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"PackagedProductDefinition\" == inst.get_resource_type()\n\n    impl_packagedproductdefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PackagedProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = packagedproductdefinition.PackagedProductDefinition(**data)\n    impl_packagedproductdefinition_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_parameters.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Parameters\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import parameters\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_parameters_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.parameter[0].name == \"exact\"\n    assert inst.parameter[0].valueBoolean is True\n    assert inst.parameter[1].name == \"property\"\n    assert inst.parameter[1].part[0].name == \"code\"\n    assert inst.parameter[1].part[0].valueCode == \"focus\"\n    assert inst.parameter[1].part[1].name == \"value\"\n    assert inst.parameter[1].part[1].valueCode == \"top\"\n    assert inst.parameter[2].name == \"patient\"\n    assert inst.parameter[2].resource.id == \"example\"\n\n\ndef test_parameters_1(base_settings):\n    \"\"\"No. 1 tests collection for Parameters.\n    Test File: parameters-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"parameters-example.json\"\n    inst = parameters.Parameters.model_validate_json(filename.read_bytes())\n    assert \"Parameters\" == inst.get_resource_type()\n\n    impl_parameters_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Parameters\" == data[\"resourceType\"]\n\n    inst2 = parameters.Parameters(**data)\n    impl_parameters_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_patient.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Patient\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import patient\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_patient_1(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Metropolis\"\n    assert inst.address[0].country == \"USA\"\n    assert inst.address[0].line[0] == \"100 Main St\"\n    assert inst.address[0].postalCode == \"44130\"\n    assert inst.address[0].state == \"Il\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1956-05-27\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"xds\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.3.4.5\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"89765a87b\"\n    assert inst.managingOrganization.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Doe\"\n    assert inst.name[0].given[0] == \"John\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_1(base_settings):\n    \"\"\"No. 1 tests collection for Patient.\n    Test File: patient-example-xds.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-xds.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_1(inst2)\n\n\ndef impl_patient_2(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Amsterdam\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Van Egmondkade 23\"\n    assert inst.address[0].postalCode == \"1024 RJ\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1944-11-17\"}).valueDate\n    )\n    assert inst.communication[0].language.coding[0].code == \"nl\"\n    assert inst.communication[0].language.coding[0].display == \"Dutch\"\n    assert (\n        inst.communication[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.communication[0].language.text == \"Nederlands\"\n    assert inst.communication[0].preferred is True\n    assert inst.contact[0].name.family == \"Abels\"\n    assert inst.contact[0].name.given[0] == \"Sarah\"\n    assert inst.contact[0].name.use == \"usual\"\n    assert inst.contact[0].relationship[0].coding[0].code == \"C\"\n    assert (\n        inst.contact[0].relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0131\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"mobile\"\n    assert inst.contact[0].telecom[0].value == \"0690383372\"\n    assert inst.deceasedBoolean is False\n    assert inst.gender == \"male\"\n    assert inst.id == \"f001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"738472983\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"usual\"\n    assert inst.managingOrganization.display == \"Burgers University Medical Centre\"\n    assert inst.managingOrganization.reference == \"Organization/f001\"\n    assert inst.maritalStatus.coding[0].code == \"M\"\n    assert inst.maritalStatus.coding[0].display == \"Married\"\n    assert (\n        inst.maritalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-MaritalStatus\"}\n        ).valueUri\n    )\n    assert inst.maritalStatus.text == \"Getrouwd\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.multipleBirthBoolean is True\n    assert inst.name[0].family == \"van de Heuvel\"\n    assert inst.name[0].given[0] == \"Pieter\"\n    assert inst.name[0].suffix[0] == \"MSc\"\n    assert inst.name[0].use == \"usual\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"mobile\"\n    assert inst.telecom[0].value == \"0648352638\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"home\"\n    assert inst.telecom[1].value == \"p.heuvel@gmail.com\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Pieter van'\n        \" de Heuvel </b> male, DoB: 1944-11-17 ( id: 738472983 \"\n        \"(USUAL))</p></div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_2(base_settings):\n    \"\"\"No. 2 tests collection for Patient.\n    Test File: patient-example-f001-pieter.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-f001-pieter.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_2(inst2)\n\n\ndef impl_patient_3(inst):\n    assert inst.active is True\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1982-08-02\"}).valueDate\n    )\n    assert inst.deceasedBoolean is True\n    assert inst.gender == \"female\"\n    assert inst.id == \"pat4\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:0.1.2.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"123458\"\n    assert inst.managingOrganization.display == \"ACME Healthcare, Inc\"\n    assert inst.managingOrganization.reference == \"Organization/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Notsowell\"\n    assert inst.name[0].given[0] == \"Sandy\"\n    assert inst.name[0].use == \"official\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_3(base_settings):\n    \"\"\"No. 3 tests collection for Patient.\n    Test File: patient-example-d.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-d.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_3(inst2)\n\n\ndef impl_patient_4(inst):\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2017-05-15\"}).valueDate\n    )\n    assert inst.contact[0].name.family == \"Organa\"\n    assert inst.contact[0].name.given[0] == \"Leia\"\n    assert inst.contact[0].name.use == \"maiden\"\n    assert inst.contact[0].relationship[0].coding[0].code == \"72705000\"\n    assert inst.contact[0].relationship[0].coding[0].display == \"Mother\"\n    assert (\n        inst.contact[0].relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contact[0].relationship[0].coding[1].code == \"N\"\n    assert (\n        inst.contact[0].relationship[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0131\"}\n        ).valueUri\n    )\n    assert inst.contact[0].relationship[0].coding[2].code == \"MTH\"\n    assert (\n        inst.contact[0].relationship[0].coding[2].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"mobile\"\n    assert inst.contact[0].telecom[0].value == \"+31201234567\"\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Organa\"\n    assert inst.gender == \"female\"\n    assert inst.id == \"infant-twin-1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://coruscanthealth.org/main-hospital/patient-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"MRN7465737865\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://new-republic.gov/galactic-citizen-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].value == \"7465737865\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.multipleBirthInteger == 1\n    assert inst.name[0].family == \"Solo\"\n    assert inst.name[0].given[0] == \"Jaina\"\n    assert inst.name[0].use == \"official\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Jaina Solo'\n        \" (OFFICIAL)</b> female, DoB: 2017-05-15 ( Medical record \"\n        \"number: MRN7465737865)</p></div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_4(base_settings):\n    \"\"\"No. 4 tests collection for Patient.\n    Test File: patient-example-infant-twin-1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-infant-twin-1.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_4(inst2)\n\n\ndef impl_patient_5(inst):\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1995-10-12\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.generalPractitioner[0].display == \"Too-Onebee\"\n    assert inst.generalPractitioner[0].reference == \"Practitioner/21B\"\n    assert inst.id == \"infant-mom\"\n    assert inst.maritalStatus.coding[0].code == \"M\"\n    assert inst.maritalStatus.coding[0].display == \"Married\"\n    assert (\n        inst.maritalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-MaritalStatus\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Solo\"\n    assert inst.name[0].given[0] == \"Leia\"\n    assert inst.name[0].use == \"official\"\n    assert inst.name[1].family == \"Organa\"\n    assert inst.name[1].given[0] == \"Leia\"\n    assert inst.name[1].use == \"maiden\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Leia Solo '\n        \"(OFFICIAL)</b> female, DoB: 1995-10-12</p></div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_5(base_settings):\n    \"\"\"No. 5 tests collection for Patient.\n    Test File: patient-example-infant-mom.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-infant-mom.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_5(inst2)\n\n\ndef impl_patient_6(inst):\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2017-09-05\"}).valueDate\n    )\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Everywoman\"\n    assert inst.gender == \"male\"\n    assert inst.id == \"newborn\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.multipleBirthInteger == 2\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Anonymous '\n        \"Patient</b> male, DoB: 2017-09-05</p></div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_6(base_settings):\n    \"\"\"No. 6 tests collection for Patient.\n    Test File: patient-example-newborn.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-newborn.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_6(inst2)\n\n\ndef impl_patient_7(inst):\n    assert inst.contact[0].name.family == \"Organa\"\n    assert inst.contact[0].name.given[0] == \"Leia\"\n    assert inst.contact[0].name.use == \"maiden\"\n    assert inst.contact[0].relationship[0].coding[0].code == \"72705000\"\n    assert inst.contact[0].relationship[0].coding[0].display == \"Mother\"\n    assert (\n        inst.contact[0].relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contact[0].relationship[0].coding[1].code == \"N\"\n    assert (\n        inst.contact[0].relationship[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0131\"}\n        ).valueUri\n    )\n    assert inst.contact[0].relationship[0].coding[2].code == \"MTH\"\n    assert (\n        inst.contact[0].relationship[0].coding[2].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"mobile\"\n    assert inst.contact[0].telecom[0].value == \"+31201234567\"\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Organa\"\n    assert inst.gender == \"male\"\n    assert inst.id == \"infant-fetal\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://coruscanthealth.org/main-hospital/patient-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"MRN657865757378\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Anonymous '\n        \"Patient</b> male, DoB Unknown ( Medical record number: \"\n        \"MRN657865757378)</p></div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_7(base_settings):\n    \"\"\"No. 7 tests collection for Patient.\n    Test File: patient-example-infant-fetal.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-infant-fetal.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_7(inst2)\n\n\ndef impl_patient_8(inst):\n    assert inst.active is True\n    assert inst.address[0].line[0] == \"2222 Home Street\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1973-05-31\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"genetics-example1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/us-ssn\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"SS\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"444222222\"\n    assert inst.managingOrganization.reference == \"Organization/hl7\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2012-05-29T23:45:32Z\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Everywoman\"\n    assert inst.name[0].given[0] == \"Eve\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"555-555-2003\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_8(base_settings):\n    \"\"\"No. 8 tests collection for Patient.\n    Test File: patient-genetics-example1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-genetics-example1.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_8(inst2)\n\n\ndef impl_patient_9(inst):\n    assert inst.active is True\n    assert inst.gender == \"other\"\n    assert inst.id == \"pat2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:0.1.2.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"123456\"\n    assert inst.link[0].other.reference == \"Patient/pat1\"\n    assert inst.link[0].type == \"seealso\"\n    assert inst.managingOrganization.display == \"ACME Healthcare, Inc\"\n    assert inst.managingOrganization.reference == \"Organization/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Donald\"\n    assert inst.name[0].given[0] == \"Duck\"\n    assert inst.name[0].given[1] == \"D\"\n    assert inst.name[0].use == \"official\"\n    assert inst.photo[0].contentType == \"image/gif\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_9(base_settings):\n    \"\"\"No. 9 tests collection for Patient.\n    Test File: patient-example-b.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-b.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_9(inst2)\n\n\ndef impl_patient_10(inst):\n    assert inst.active is True\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1982-01-23\"}).valueDate\n    )\n    assert (\n        inst.deceasedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-14T13:42:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"pat3\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:0.1.2.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"123457\"\n    assert inst.managingOrganization.display == \"ACME Healthcare, Inc\"\n    assert inst.managingOrganization.reference == \"Organization/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Notsowell\"\n    assert inst.name[0].given[0] == \"Simon\"\n    assert inst.name[0].use == \"official\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_10(base_settings):\n    \"\"\"No. 10 tests collection for Patient.\n    Test File: patient-example-c.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-c.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_paymentnotice.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PaymentNotice\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import paymentnotice\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_paymentnotice_1(inst):\n    assert inst.amount.currency == \"USD\"\n    assert float(inst.amount.value) == float(12500.0)\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"77654\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://benefitsinc.com/paymentnotice\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"776543\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.payee.reference == \"Organization/1\"\n    assert inst.payment.reference == \"PaymentReconciliation/ER2500\"\n    assert (\n        inst.paymentDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-15\"}).valueDate\n    )\n    assert inst.paymentStatus.coding[0].code == \"paid\"\n    assert (\n        inst.paymentStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/paymentstatus\"}\n        ).valueUri\n    )\n    assert inst.provider.reference == \"Organization/1\"\n    assert (\n        inst.recipient.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://regulators.gov\"}\n        ).valueUri\n    )\n    assert inst.recipient.identifier.value == \"AB123\"\n    assert inst.request.reference == \"http://benefitsinc.com/fhir/claim/12345\"\n    assert (\n        inst.response.reference == \"http://benefitsinc.com/fhir/claimresponse/CR12345\"\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the PaymentNotice</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_paymentnotice_1(base_settings):\n    \"\"\"No. 1 tests collection for PaymentNotice.\n    Test File: paymentnotice-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"paymentnotice-example.json\"\n    inst = paymentnotice.PaymentNotice.model_validate_json(filename.read_bytes())\n    assert \"PaymentNotice\" == inst.get_resource_type()\n\n    impl_paymentnotice_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PaymentNotice\" == data[\"resourceType\"]\n\n    inst2 = paymentnotice.PaymentNotice(**data)\n    impl_paymentnotice_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_paymentreconciliation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PaymentReconciliation\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import paymentreconciliation\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_paymentreconciliation_1(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.detail[0].amount.currency == \"USD\"\n    assert float(inst.detail[0].amount.value) == float(3500.0)\n    assert (\n        inst.detail[0].date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert (\n        inst.detail[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/payment/2018/detail\"}\n        ).valueUri\n    )\n    assert inst.detail[0].identifier.value == \"10-12345-001\"\n    assert inst.detail[0].payee.reference == \"Organization/1\"\n    assert (\n        inst.detail[0].request.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalleyclinic.com/claim\"}\n        ).valueUri\n    )\n    assert inst.detail[0].request.identifier.value == \"AB12345\"\n    assert (\n        inst.detail[0].response.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/claimresponse\"}\n        ).valueUri\n    )\n    assert inst.detail[0].response.identifier.value == \"CR20140815-AB12345\"\n    assert inst.detail[0].submitter.reference == \"Organization/1\"\n    assert inst.detail[0].type.coding[0].code == \"payment\"\n    assert (\n        inst.detail[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payment-type\"}\n        ).valueUri\n    )\n    assert inst.detail[1].amount.currency == \"USD\"\n    assert float(inst.detail[1].amount.value) == float(4000.0)\n    assert (\n        inst.detail[1].date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-12\"}).valueDate\n    )\n    assert (\n        inst.detail[1].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/payment/2018/detail\"}\n        ).valueUri\n    )\n    assert inst.detail[1].identifier.value == \"10-12345-002\"\n    assert (\n        inst.detail[1].request.reference\n        == \"http://www.BenefitsInc.com/fhir/oralhealthclaim/225476332699\"\n    )\n    assert inst.detail[1].type.coding[0].code == \"payment\"\n    assert (\n        inst.detail[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payment-type\"}\n        ).valueUri\n    )\n    assert inst.detail[2].amount.currency == \"USD\"\n    assert float(inst.detail[2].amount.value) == float(-1500.0)\n    assert (\n        inst.detail[2].date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert (\n        inst.detail[2].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/payment/2018/detail\"}\n        ).valueUri\n    )\n    assert inst.detail[2].identifier.value == \"10-12345-003\"\n    assert inst.detail[2].type.coding[0].code == \"advance\"\n    assert (\n        inst.detail[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payment-type\"}\n        ).valueUri\n    )\n    assert inst.disposition == \"2014 August mid-month settlement.\"\n    assert inst.formCode.coding[0].code == \"PAYREC/2016/01B\"\n    assert (\n        inst.formCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ncforms.org/formid\"}\n        ).valueUri\n    )\n    assert inst.id == \"ER2500\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/enrollmentresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"781234\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.paymentAmount.currency == \"USD\"\n    assert float(inst.paymentAmount.value) == float(7000.0)\n    assert (\n        inst.paymentDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-01\"}).valueDate\n    )\n    assert (\n        inst.paymentIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/payment/2018\"}\n        ).valueUri\n    )\n    assert inst.paymentIdentifier.value == \"10-12345\"\n    assert inst.paymentIssuer.reference == \"Organization/2\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.processNote[0].text == (\n        \"Due to the year end holiday the cutoff for submissions for \"\n        \"December will be the 28th.\"\n    )\n    assert inst.processNote[0].type == \"display\"\n    assert (\n        inst.request.reference\n        == \"http://www.BenefitsInc.com/fhir/eligibility/225476332402\"\n    )\n    assert inst.requestor.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the PaymentReconciliation</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_paymentreconciliation_1(base_settings):\n    \"\"\"No. 1 tests collection for PaymentReconciliation.\n    Test File: paymentreconciliation-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"paymentreconciliation-example.json\"\n    inst = paymentreconciliation.PaymentReconciliation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"PaymentReconciliation\" == inst.get_resource_type()\n\n    impl_paymentreconciliation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PaymentReconciliation\" == data[\"resourceType\"]\n\n    inst2 = paymentreconciliation.PaymentReconciliation(**data)\n    impl_paymentreconciliation_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_person.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Person\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import person\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_person_1(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Sandusky\"\n    assert inst.address[0].country == \"USA\"\n    assert inst.address[0].line[0] == \"2086 College St\"\n    assert inst.address[0].postalCode == \"44870\"\n    assert inst.address[0].state == \"OH\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1974-03-07\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"pp\"\n    assert inst.identifier[0].assigner.display == \"Ohio Bureau of Motor Vehicles\"\n    assert (\n        inst.identifier[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2041-09-23\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.3.39\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"DL\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"Ohio driver license\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"TL545786\"\n    assert inst.link[0].assurance == \"level3\"\n    assert inst.link[0].target.display == \"Eve Everywoman\"\n    assert inst.link[0].target.reference == \"http://www.goodhealth.com/Patient/98574\"\n    assert inst.link[1].assurance == \"level2\"\n    assert inst.link[1].target.display == \"Eve Marie Everywoman\"\n    assert inst.link[1].target.reference == \"http://www.acme-medical.com/Patient/ab34d\"\n    assert inst.managingOrganization.display == \"Goodhealth Patient Portal\"\n    assert (\n        inst.managingOrganization.reference\n        == \"http://www.goodhealth.com/Organization/12\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Everywoman\"\n    assert inst.name[0].given[0] == \"Eve\"\n    assert inst.name[0].given[1] == \"Marie\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"home\"\n    assert inst.telecom[0].value == \"(621)-479-9743\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_person_1(base_settings):\n    \"\"\"No. 1 tests collection for Person.\n    Test File: person-patient-portal.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-patient-portal.json\"\n    inst = person.Person.model_validate_json(filename.read_bytes())\n    assert \"Person\" == inst.get_resource_type()\n\n    impl_person_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Person\" == data[\"resourceType\"]\n\n    inst2 = person.Person(**data)\n    impl_person_1(inst2)\n\n\ndef impl_person_2(inst):\n    assert inst.active is True\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1963\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"f002\"\n    assert inst.link[0].target.display == \"Ariadne Bor-Jansma\"\n    assert inst.link[0].target.reference == \"RelatedPerson/f002\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].text == \"Ariadne Bor-Jansma\"\n    assert inst.name[0].use == \"usual\"\n    assert inst.photo.contentType == \"image/jpeg\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"home\"\n    assert inst.telecom[0].value == \"+31201234567\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_person_2(base_settings):\n    \"\"\"No. 2 tests collection for Person.\n    Test File: person-example-f002-ariadne.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-example-f002-ariadne.json\"\n    inst = person.Person.model_validate_json(filename.read_bytes())\n    assert \"Person\" == inst.get_resource_type()\n\n    impl_person_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Person\" == data[\"resourceType\"]\n\n    inst2 = person.Person(**data)\n    impl_person_2(inst2)\n\n\ndef impl_person_3(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Northfield\"\n    assert inst.address[0].line[0] == \"1003 Healthcare Drive\"\n    assert inst.address[0].state == \"MN\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1959-04-22\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"pd\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/us-ssn\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"SS\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"444444444\"\n    assert inst.link[0].assurance == \"level2\"\n    assert inst.link[0].target.display == \"Dr. Harold Hippocrates\"\n    assert (\n        inst.link[0].target.reference == \"http://www.goodhealth.com/Practitioner/98574\"\n    )\n    assert inst.link[1].assurance == \"level2\"\n    assert inst.link[1].target.display == \"Harold Hippocrates, MD\"\n    assert (\n        inst.link[1].target.reference\n        == \"http://www.acme-medical.com/Practitioner/ab34d\"\n    )\n    assert (\n        inst.managingOrganization.display == \"Northfield Regional Physician Directory\"\n    )\n    assert (\n        inst.managingOrganization.reference\n        == \"http://www.northfield-regional.com/Organization/2\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Hippocrates\"\n    assert inst.name[0].given[0] == \"Harold\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"555-555-1003\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_person_3(base_settings):\n    \"\"\"No. 3 tests collection for Person.\n    Test File: person-provider-directory.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-provider-directory.json\"\n    inst = person.Person.model_validate_json(filename.read_bytes())\n    assert \"Person\" == inst.get_resource_type()\n\n    impl_person_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Person\" == data[\"resourceType\"]\n\n    inst2 = person.Person(**data)\n    impl_person_3(inst2)\n\n\ndef impl_person_4(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"PleasantVille\"\n    assert inst.address[0].line[0] == \"534 Erewhon St\"\n    assert inst.address[0].postalCode == \"3999\"\n    assert inst.address[0].state == \"Vic\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1974-12-25\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"example\"\n    assert inst.identifier[0].assigner.display == \"Acme Healthcare\"\n    assert (\n        inst.identifier[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2001-05-06\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.36.146.595.217.0.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.link[0].target.display == \"Peter Chalmers\"\n    assert inst.link[0].target.reference == \"RelatedPerson/peter\"\n    assert inst.link[1].target.display == \"Peter Chalmers\"\n    assert inst.link[1].target.reference == \"Patient/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Chalmers\"\n    assert inst.name[0].given[0] == \"Peter\"\n    assert inst.name[0].given[1] == \"James\"\n    assert inst.name[0].use == \"official\"\n    assert inst.name[1].given[0] == \"Jim\"\n    assert inst.name[1].use == \"usual\"\n    assert inst.telecom[0].use == \"home\"\n    assert inst.telecom[1].system == \"phone\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"(03) 5555 6473\"\n    assert inst.telecom[2].system == \"email\"\n    assert inst.telecom[2].use == \"home\"\n    assert inst.telecom[2].value == \"Jim@example.org\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_person_4(base_settings):\n    \"\"\"No. 4 tests collection for Person.\n    Test File: person-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-example.json\"\n    inst = person.Person.model_validate_json(filename.read_bytes())\n    assert \"Person\" == inst.get_resource_type()\n\n    impl_person_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Person\" == data[\"resourceType\"]\n\n    inst2 = person.Person(**data)\n    impl_person_4(inst2)\n\n\ndef impl_person_5(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"PleasantVille\"\n    assert inst.address[0].line[0] == \"534 Erewhon St\"\n    assert inst.address[0].postalCode == \"3999\"\n    assert inst.address[0].state == \"Vic\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1974-12-25\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"grahame\"\n    assert inst.identifier[0].assigner.display == \"Acme Healthcare\"\n    assert (\n        inst.identifier[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2001-05-06\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.36.146.595.217.0.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.managingOrganization.reference == \"Organization/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Chalmers\"\n    assert inst.name[0].given[0] == \"Peter\"\n    assert inst.name[0].given[1] == \"James\"\n    assert inst.name[0].use == \"official\"\n    assert inst.name[1].given[0] == \"Jim\"\n    assert inst.name[1].use == \"usual\"\n    assert inst.telecom[0].use == \"home\"\n    assert inst.telecom[1].system == \"phone\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"(03) 5555 6473\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_person_5(base_settings):\n    \"\"\"No. 5 tests collection for Person.\n    Test File: person-grahame.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-grahame.json\"\n    inst = person.Person.model_validate_json(filename.read_bytes())\n    assert \"Person\" == inst.get_resource_type()\n\n    impl_person_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Person\" == data[\"resourceType\"]\n\n    inst2 = person.Person(**data)\n    impl_person_5(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_plandefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PlanDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import plandefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_plandefinition_1(inst):\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[0].definitionCanonical\n        == \"#1111\"\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[0]\n        .url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"day\"}).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[0]\n        .valueInteger\n        == 1\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[1]\n        .url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"day\"}).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[1]\n        .valueInteger\n        == 8\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle\"}\n        ).valueUri\n    )\n    assert inst.action[0].action[0].action[0].action[0].action[0].id == \"action-1\"\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[0].textEquivalent\n        == \"Gemcitabine 1250 mg/m² IV over 30 minutes on days 1 and 8\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].definitionCanonical\n        == \"#2222\"\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[1]\n        .extension[0]\n        .extension[0]\n        .url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"day\"}).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[1]\n        .extension[0]\n        .extension[0]\n        .valueInteger\n        == 1\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle\"}\n        ).valueUri\n    )\n    assert inst.action[0].action[0].action[0].action[0].action[1].id == \"action-2\"\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].relatedAction[0].actionId\n        == \"action-1\"\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[1]\n        .relatedAction[0]\n        .relationship\n        == \"concurrent-with-start\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].textEquivalent\n        == \"CARBOplatin AUC 5 IV over 30 minutes on Day 1\"\n    )\n    assert inst.action[0].action[0].action[0].action[0].id == \"cycle-definition-1\"\n    assert (\n        inst.action[0].action[0].action[0].action[0].textEquivalent\n        == \"21-day cycle for 6 cycles\"\n    )\n    assert inst.action[0].action[0].action[0].action[0].timingTiming.repeat.count == 6\n    assert float(\n        inst.action[0].action[0].action[0].action[0].timingTiming.repeat.duration\n    ) == float(21)\n    assert (\n        inst.action[0].action[0].action[0].action[0].timingTiming.repeat.durationUnit\n        == \"d\"\n    )\n    assert inst.action[0].action[0].action[0].groupingBehavior == \"sentence-group\"\n    assert inst.action[0].action[0].action[0].selectionBehavior == \"exactly-one\"\n    assert inst.action[0].action[0].selectionBehavior == \"all\"\n    assert inst.action[0].selectionBehavior == \"exactly-one\"\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-07-27\"}).valueDate\n    )\n    assert inst.author[0].name == \"Lee Surprenant\"\n    assert inst.contained[0].id == \"1111\"\n    assert inst.contained[1].id == \"2222\"\n    assert inst.copyright == \"All rights reserved.\"\n    assert inst.experimental is True\n    assert inst.id == \"KDN5\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/ordertemplates\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"KDN5\"\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-07-27\"}).valueDate\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"National Comprehensive Cancer Network, Inc.\"\n    assert (\n        inst.relatedArtifact[0].display == \"NCCN Guidelines for Kidney Cancer. V.2.2016\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://www.example.org/professionals/physician_gls/PDF/kidney.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://www.example.org/professionals/physician_gls/PDF/kidney.pdf\"\n            }\n        ).valueUrl\n    )\n    assert (\n        inst.relatedArtifact[1].citation\n        == \"Oudard S, et al. J Urol. 2007;177(5):1698-702\"\n    )\n    assert (\n        inst.relatedArtifact[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.ncbi.nlm.nih.gov/pubmed/17437788\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].type == \"citation\"\n    assert (\n        inst.relatedArtifact[1].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.ncbi.nlm.nih.gov/pubmed/17437788\"}\n        ).valueUrl\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"additional\"\n    assert inst.title == \"Gemcitabine/CARBOplatin\"\n    assert inst.type.text == \"Chemotherapy Order Template\"\n    assert inst.useContext[0].code.code == \"treamentSetting-or-diseaseStatus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/indications\"}\n        ).valueUri\n    )\n    assert (\n        inst.useContext[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/usagecontext-group\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].extension[0].valueString == \"A\"\n    assert inst.useContext[0].valueCodeableConcept.text == \"Metastatic\"\n    assert inst.useContext[1].code.code == \"disease-or-histology\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/indications\"}\n        ).valueUri\n    )\n    assert (\n        inst.useContext[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/usagecontext-group\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].extension[0].valueString == \"A\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.text\n        == \"Collecting Duct/Medullary Subtypes\"\n    )\n    assert inst.useContext[2].code.code == \"focus\"\n    assert (\n        inst.useContext[2].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.useContext[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/usagecontext-group\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].extension[0].valueString == \"A\"\n    assert inst.useContext[2].valueCodeableConcept.text == \"Kidney Cancer\"\n    assert inst.useContext[3].code.code == \"treatmentSetting-or-diseaseStatus\"\n    assert (\n        inst.useContext[3].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/indications\"}\n        ).valueUri\n    )\n    assert (\n        inst.useContext[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/usagecontext-group\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].extension[0].valueString == \"B\"\n    assert inst.useContext[3].valueCodeableConcept.text == \"Relapsed\"\n    assert inst.useContext[4].code.code == \"disease-or-histology\"\n    assert (\n        inst.useContext[4].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/indications\"}\n        ).valueUri\n    )\n    assert (\n        inst.useContext[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/usagecontext-group\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].extension[0].valueString == \"B\"\n    assert (\n        inst.useContext[4].valueCodeableConcept.text\n        == \"Collecting Duct/Medullary Subtypes\"\n    )\n    assert inst.useContext[5].code.code == \"focus\"\n    assert (\n        inst.useContext[5].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.useContext[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/usagecontext-group\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].extension[0].valueString == \"B\"\n    assert inst.useContext[5].valueCodeableConcept.text == (\n        \"Kidney Cancer – Collecting Duct/Medullary Subtypes - \" \"Metastatic\"\n    )\n    assert inst.version == \"1\"\n\n\ndef test_plandefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for PlanDefinition.\n    Test File: plandefinition-example-kdn5-simplified.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"plandefinition-example-kdn5-simplified.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_1(inst2)\n\n\ndef impl_plandefinition_2(inst):\n    assert (\n        inst.action[0].action[0].definitionCanonical\n        == \"#activitydefinition-medicationrequest-1\"\n    )\n    assert inst.action[0].action[0].id == \"medication-action-1\"\n    assert inst.action[0].action[0].title == \"Administer Medication 1\"\n    assert (\n        inst.action[0].action[1].definitionCanonical\n        == \"#activitydefinition-medicationrequest-2\"\n    )\n    assert inst.action[0].action[1].id == \"medication-action-2\"\n    assert inst.action[0].action[1].relatedAction[0].actionId == \"medication-action-1\"\n    assert inst.action[0].action[1].relatedAction[0].offsetDuration.code == \"h\"\n    assert (\n        inst.action[0].action[1].relatedAction[0].offsetDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.action[0].action[1].relatedAction[0].offsetDuration.unit == \"h\"\n    assert float(\n        inst.action[0].action[1].relatedAction[0].offsetDuration.value\n    ) == float(1)\n    assert inst.action[0].action[1].relatedAction[0].relationship == \"after-end\"\n    assert inst.action[0].action[1].title == \"Administer Medication 2\"\n    assert inst.action[0].groupingBehavior == \"logical-group\"\n    assert inst.action[0].selectionBehavior == \"all\"\n    assert inst.contained[0].id == \"activitydefinition-medicationrequest-1\"\n    assert inst.contained[1].id == \"activitydefinition-medicationrequest-2\"\n    assert inst.experimental is True\n    assert inst.id == \"options-example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"This example illustrates relationships between actions.\"\n\n\ndef test_plandefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for PlanDefinition.\n    Test File: plandefinition-options-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"plandefinition-options-example.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_2(inst2)\n\n\ndef impl_plandefinition_3(inst):\n    assert (\n        inst.action[0].action[0].dynamicValue[0].expression.expression\n        == \"Communication Request to Provider\"\n    )\n    assert inst.action[0].action[0].dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.action[0].action[0].dynamicValue[0].path == \"/\"\n    assert inst.action[0].action[0].textEquivalent == (\n        \"A Breastfeeding Readiness Assessment is recommended, please \"\n        \"authorize or reject the order.\"\n    )\n    assert inst.action[0].action[0].title == \"Notify the provider to sign the order.\"\n    assert inst.action[0].action[0].type.coding[0].code == \"create\"\n    assert (\n        inst.action[0].condition[0].expression.expression\n        == \"Should Notify Provider to Sign Assessment Order\"\n    )\n    assert inst.action[0].condition[0].expression.language == \"text/cql\"\n    assert inst.action[0].condition[0].kind == \"applicability\"\n    assert inst.action[0].title == (\n        \"Mother should be administered a breastfeeding readiness \" \"assessment.\"\n    )\n    assert inst.action[0].trigger[0].name == \"Admission\"\n    assert inst.action[0].trigger[0].type == \"named-event\"\n    assert inst.action[0].trigger[1].name == \"Birth\"\n    assert inst.action[0].trigger[1].type == \"named-event\"\n    assert inst.action[0].trigger[2].name == \"Infant Transfer to Recovery\"\n    assert inst.action[0].trigger[2].type == \"named-event\"\n    assert inst.action[0].trigger[3].name == \"Transfer to Post-Partum\"\n    assert inst.action[0].trigger[3].type == \"named-event\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"exclusive-breastfeeding-intervention-02\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"exclusive-breastfeeding-intervention-02\"\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/library-exclusive-\" \"breastfeeding-cds-logic\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relatedArtifact[0].resource == (\n        \"http://example.org/fhir/Measure/measure-exclusive-\" \"breastfeeding\"\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Exclusive Breastfeeding Intervention-02\"\n    assert inst.topic[0].text == \"Exclusive Breastfeeding\"\n    assert inst.version == \"1.0.0\"\n\n\ndef test_plandefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for PlanDefinition.\n    Test File: plandefinition-exclusive-breastfeeding-intervention-02.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"plandefinition-exclusive-breastfeeding-intervention-02.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_3(inst2)\n\n\ndef impl_plandefinition_4(inst):\n    assert (\n        inst.action[0].action[0].dynamicValue[0].expression.expression\n        == \"Communication Request to Charge Nurse\"\n    )\n    assert inst.action[0].action[0].dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.action[0].action[0].dynamicValue[0].path == \"/\"\n    assert inst.action[0].action[0].textEquivalent == (\n        \"A Breastfeeding Readiness Assessment is recommended, please \"\n        \"administer the assessment.\"\n    )\n    assert (\n        inst.action[0].action[0].title\n        == \"Notify the charge nurse to perform the assessment.\"\n    )\n    assert inst.action[0].action[0].type.coding[0].code == \"create\"\n    assert (\n        inst.action[0].action[1].dynamicValue[0].expression.expression\n        == \"Communication Request to Bedside Nurse\"\n    )\n    assert inst.action[0].action[1].dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.action[0].action[1].dynamicValue[0].path == \"/\"\n    assert inst.action[0].action[1].textEquivalent == (\n        \"A Breastfeeding Readiness Assessment is recommended, please \"\n        \"administer the assessment.\"\n    )\n    assert (\n        inst.action[0].action[1].title\n        == \"Notify the bedside nurse to perform the assessment.\"\n    )\n    assert inst.action[0].action[1].type.coding[0].code == \"create\"\n    assert (\n        inst.action[0].condition[0].expression.expression\n        == \"Should Notify Nurse to Perform Assessment\"\n    )\n    assert inst.action[0].condition[0].expression.language == \"text/cql\"\n    assert inst.action[0].condition[0].kind == \"applicability\"\n    assert inst.action[0].title == (\n        \"Mother should be administered a breastfeeding readiness \" \"assessment.\"\n    )\n    assert inst.action[0].trigger[0].name == \"Admission\"\n    assert inst.action[0].trigger[0].type == \"named-event\"\n    assert inst.action[0].trigger[1].name == \"Birth\"\n    assert inst.action[0].trigger[1].type == \"named-event\"\n    assert inst.action[0].trigger[2].name == \"Infant Transfer to Recovery\"\n    assert inst.action[0].trigger[2].type == \"named-event\"\n    assert inst.action[0].trigger[3].name == \"Transfer to Post-Partum\"\n    assert inst.action[0].trigger[3].type == \"named-event\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"exclusive-breastfeeding-intervention-03\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"exclusive-breastfeeding-intervention-03\"\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/library-exclusive-\" \"breastfeeding-cds-logic\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relatedArtifact[0].resource == (\n        \"http://example.org/fhir/Measure/measure-exclusive-\" \"breastfeeding\"\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Exclusive Breastfeeding Intervention-03\"\n    assert inst.topic[0].text == \"Exclusive Breastfeeding\"\n    assert inst.version == \"1.0.0\"\n\n\ndef test_plandefinition_4(base_settings):\n    \"\"\"No. 4 tests collection for PlanDefinition.\n    Test File: plandefinition-exclusive-breastfeeding-intervention-03.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"plandefinition-exclusive-breastfeeding-intervention-03.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_4(inst2)\n\n\ndef impl_plandefinition_5(inst):\n    assert (\n        inst.action[0].action[0].action[0].definitionCanonical\n        == \"#referralToCardiologyConsult\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[0].expression.expression\n        == \"Now()\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[0].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[0].path == \"timing.event\"\n    assert inst.action[0].action[0].action[0].dynamicValue[1].expression.expression == (\n        \"Code '261QM0850X' from CardiologyChestPainLogic.\\\"NUCC \"\n        \"Provider Taxonomy\\\" display 'Adult Mental Health'\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[1].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[1].path == \"specialty\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[2].expression.expression\n        == \"CardiologyChestPainLogic.ServiceRequestFulfillmentTime\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[2].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[2].path == \"occurrenceDateTime\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[3].expression.expression\n        == \"CardiologyChestPainLogic.Patient\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[3].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[3].path == \"subject\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[4].expression.expression\n        == \"CardiologyChestPainLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[4].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[4].path == \"requester.agent\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[5].expression.expression\n        == \"CardiologyChestPainLogic.CardiologyReferralReason\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[5].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[5].path == \"reasonCode\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[6].expression.expression\n        == \"CardiologyChestPainLogic.RiskAssessment\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[6].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[6].path == \"reasonReference\"\n    assert (\n        inst.action[0].action[0].action[0].textEquivalent\n        == \"Referral to cardiology to evaluate chest pain (routine)\"\n    )\n    assert (\n        inst.action[0].action[0].action[1].definitionCanonical\n        == \"#CollectReferralReason\"\n    )\n    assert (\n        inst.action[0].action[0].action[1].title == \"Reason for cardiology consultation\"\n    )\n    assert (\n        inst.action[0].action[0].action[2].definitionCanonical\n        == \"#CardiologyConsultationGoal\"\n    )\n    assert inst.action[0].action[0].action[2].title == \"Goal of cardiology consultation\"\n    assert inst.action[0].action[0].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[0].selectionBehavior == \"any\"\n    assert inst.action[0].action[0].title == \"Consults and Referrals\"\n    assert inst.action[0].action[1].action[0].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[1].action[0].selectionBehavior == \"at-most-one\"\n    assert (\n        inst.action[0].action[1].action[1].action[0].definitionCanonical\n        == \"#metoprololTartrate25Prescription\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[0]\n        .dynamicValue[0]\n        .expression.expression\n        == \"'draft'\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[0].dynamicValue[0].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[1].action[1].action[0].dynamicValue[0].path == \"status\"\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[0]\n        .dynamicValue[1]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Patient\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[0].dynamicValue[1].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[0].dynamicValue[1].path == \"patient\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[0]\n        .dynamicValue[2]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[0].dynamicValue[2].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[0].dynamicValue[2].path\n        == \"prescriber\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[0].textEquivalent\n        == \"metoprolol tartrate 25 mg tablet 1 tablet oral 2 time daily\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].definitionCanonical\n        == \"#metoprololTartrate50Prescription\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[1]\n        .dynamicValue[0]\n        .expression.expression\n        == \"'draft'\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].dynamicValue[0].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[1].action[1].action[1].dynamicValue[0].path == \"status\"\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[1]\n        .dynamicValue[1]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Patient\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].dynamicValue[1].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].dynamicValue[1].path == \"patient\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[1]\n        .dynamicValue[2]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].dynamicValue[2].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].dynamicValue[2].path\n        == \"prescriber\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].textEquivalent\n        == \"metoprolol tartrate 50 mg tablet 1 tablet oral 2 time daily\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].definitionCanonical\n        == \"#amlodipinePrescription\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[2]\n        .dynamicValue[0]\n        .expression.expression\n        == \"'draft'\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].dynamicValue[0].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[1].action[1].action[2].dynamicValue[0].path == \"status\"\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[2]\n        .dynamicValue[1]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Patient\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].dynamicValue[1].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].dynamicValue[1].path == \"patient\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[2]\n        .dynamicValue[2]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].dynamicValue[2].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].dynamicValue[2].path\n        == \"prescriber\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].textEquivalent\n        == \"amlodipine 5  tablet 1 tablet oral  daily\"\n    )\n    assert inst.action[0].action[1].action[1].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[1].action[1].selectionBehavior == \"at-most-one\"\n    assert inst.action[0].action[1].action[1].title == \"Antianginal Therapy\"\n    assert (\n        inst.action[0].action[1].action[2].action[0].definitionCanonical\n        == \"#nitroglycerinPrescription\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[2]\n        .action[0]\n        .dynamicValue[0]\n        .expression.expression\n        == \"'draft'\"\n    )\n    assert (\n        inst.action[0].action[1].action[2].action[0].dynamicValue[0].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[1].action[2].action[0].dynamicValue[0].path == \"status\"\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[2]\n        .action[0]\n        .dynamicValue[1]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Patient\"\n    )\n    assert (\n        inst.action[0].action[1].action[2].action[0].dynamicValue[1].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[2].action[0].dynamicValue[1].path == \"patient\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[2]\n        .action[0]\n        .dynamicValue[2]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0].action[1].action[2].action[0].dynamicValue[2].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[2].action[0].dynamicValue[2].path\n        == \"prescriber\"\n    )\n    assert inst.action[0].action[1].action[2].action[0].textEquivalent == (\n        \"nitroglycerin 0.4 mg tablet sub-lingual every 5 minutes as \"\n        \"needed for chest pain; maximum 3 tablets\"\n    )\n    assert inst.action[0].action[1].action[2].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[1].action[2].selectionBehavior == \"at-most-one\"\n    assert inst.action[0].action[1].action[2].title == \"Nitroglycerin\"\n    assert inst.action[0].action[1].description == (\n        \"Consider the following medications for stable patients to be\"\n        \" initiated prior to the cardiology consultation.\"\n    )\n    assert inst.action[0].action[1].title == \"Medications\"\n    assert inst.author[0].name == \"Bruce Bray MD\"\n    assert inst.author[1].name == \"Scott Wall MD\"\n    assert inst.author[2].name == \"Aiden Abidov MD, PhD\"\n    assert inst.contained[0].id == \"cardiology-chestPain-logic\"\n    assert inst.contained[1].id == \"referralToCardiologyConsult\"\n    assert inst.contained[2].id == \"metoprololTartrate25Prescription\"\n    assert inst.contained[3].id == \"metoprololTartrate25Medication\"\n    assert inst.contained[4].id == \"metoprololTartrate25Substance\"\n    assert inst.contained[5].id == \"metoprololTartrate50Prescription\"\n    assert inst.contained[6].id == \"metoprololTartrate50Medication\"\n    assert inst.contained[7].id == \"metoprololTartrate50Substance\"\n    assert inst.contained[8].id == \"nitroglycerinPrescription\"\n    assert inst.contained[9].id == \"nitroglycerinMedication\"\n    assert inst.copyright == (\n        \"© Copyright Cognitive Medical Systems, Inc. 9444 Waples \"\n        \"Street Suite 300 San Diego, CA 92121\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-08-29\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"example-cardiology-os\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:va.gov:kbs:knart:artifact:r1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"bb7ccea6-9744-4743-854a-bcffd87191f6\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"urn:va.gov:kbs:contract:VA118-16-D-1008:to:VA-118-16-F-1008-0007\"\n            }\n        ).valueUri\n    )\n    assert inst.identifier[1].value == \"CLIN0004AG\"\n    assert (\n        inst.identifier[2].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:cognitivemedicine.com:lab:jira\"}\n        ).valueUri\n    )\n    assert inst.identifier[2].value == \"KP-914\"\n    assert inst.library[0] == \"#cardiology-chestPain-logic\"\n    assert inst.name == \"ChestPainCoronaryArteryDiseaseOrderSetKNART\"\n    assert inst.publisher == \"Department of Veterans Affairs\"\n    assert inst.relatedArtifact[0].display == (\n        \"Cardiology: Chest Pain (CP) / Coronary Artery Disease (CAD) \"\n        \"Clinical Content White Paper\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"NEED-A-URL-HERE\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"NEED-A-URL-HERE\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].display == (\n        \"Outcome CVD (coronary death, myocardial infarction, coronary\"\n        \" insufficiency, angina, ischemic stroke, hemorrhagic stroke,\"\n        \" transient ischemic attack, peripheral artery disease, heart\"\n        \" failure)\"\n    )\n    assert (\n        inst.relatedArtifact[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.framinghamheartstudy.org/risk-functions/cardiovascular-disease/10-year-risk.php\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].type == \"justification\"\n    assert (\n        inst.relatedArtifact[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.framinghamheartstudy.org/risk-functions/cardiovascular-disease/10-year-risk.php\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[2].display == (\n        \"General cardiovascular risk profile for use in primary care:\"\n        \" the Framingham Heart Study\"\n    )\n    assert (\n        inst.relatedArtifact[2].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.framinghamheartstudy.org/risk-functions/cardiovascular-disease/10-year-risk.php\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[2].type == \"justification\"\n    assert (\n        inst.relatedArtifact[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.framinghamheartstudy.org/risk-functions/cardiovascular-disease/10-year-risk.php\"\n            }\n        ).valueUrl\n    )\n    assert (\n        inst.relatedArtifact[3].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"NEED-A-URL-HERE\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[3].type == \"justification\"\n    assert (\n        inst.relatedArtifact[3].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"NEED-A-URL-HERE\"}\n        ).valueUrl\n    )\n    assert (\n        inst.relatedArtifact[4].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"NEED-A-URL-HERE\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[4].type == \"justification\"\n    assert (\n        inst.relatedArtifact[4].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"NEED-A-URL-HERE\"}\n        ).valueUrl\n    )\n    assert (\n        inst.relatedArtifact[5].display\n        == \"LABEL: ASPIRIN 81 MG- aspirin tablet, coated\"\n    )\n    assert (\n        inst.relatedArtifact[5].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=b4064039-2345-4227-b83d-54dc13a838d3\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[5].type == \"justification\"\n    assert (\n        inst.relatedArtifact[5].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=b4064039-2345-4227-b83d-54dc13a838d3\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[6].display == (\n        \"LABEL: CLOPIDOGREL- clopidogrel bisulfate tablet, film \" \"coated\"\n    )\n    assert (\n        inst.relatedArtifact[6].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7fe85155-bc00-406b-b097-e8aece187a8a\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[6].type == \"justification\"\n    assert (\n        inst.relatedArtifact[6].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7fe85155-bc00-406b-b097-e8aece187a8a\"\n            }\n        ).valueUrl\n    )\n    assert (\n        inst.relatedArtifact[7].display\n        == \"LABEL: LIPITOR- atorvastatin calcium tablet, film coated\"\n    )\n    assert (\n        inst.relatedArtifact[7].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7fe85155-bc00-406b-b097-e8aece187a8a\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[7].type == \"justification\"\n    assert (\n        inst.relatedArtifact[7].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7fe85155-bc00-406b-b097-e8aece187a8a\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[8].display == (\n        \"LABEL: METOPROLOL SUCCINATE EXTENDED-RELEASE - metoprolol \"\n        \"succinate tablet, film coated, extended release\"\n    )\n    assert (\n        inst.relatedArtifact[8].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2d948600-35d8-4490-983b-918bdce488c8\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[8].type == \"justification\"\n    assert (\n        inst.relatedArtifact[8].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2d948600-35d8-4490-983b-918bdce488c8\"\n            }\n        ).valueUrl\n    )\n    assert (\n        inst.relatedArtifact[9].display == \"LABEL: NITROGLYCERIN- nitroglycerin tablet\"\n    )\n    assert (\n        inst.relatedArtifact[9].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=67bf2a15-b115-47ac-ae28-ce2dafd6b5c9\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[9].type == \"justification\"\n    assert (\n        inst.relatedArtifact[9].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=67bf2a15-b115-47ac-ae28-ce2dafd6b5c9\"\n            }\n        ).valueUrl\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == (\n        \"Chest Pain (CP) - Coronary Artery Disease (CAD) Order Set \" \"KNART\"\n    )\n    assert inst.type.coding[0].code == \"order-set\"\n    assert inst.type.coding[0].display == \"Order Set\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/plan-definition-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://va.gov/kas/orderset/B5-Cardiology-ChestPainCAD-OS\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"look up value\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"appropriate snomed condition\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1\"\n\n\ndef test_plandefinition_5(base_settings):\n    \"\"\"No. 5 tests collection for PlanDefinition.\n    Test File: plandefinition-example-cardiology-os.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"plandefinition-example-cardiology-os.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_5(inst2)\n\n\ndef impl_plandefinition_6(inst):\n    assert inst.action[0].cardinalityBehavior == \"single\"\n    assert inst.action[0].condition[0].expression.expression == (\n        \"exists ([Condition: Obesity]) or not exists ([Observation: \"\n        \"BMI] O where O.effectiveDateTime 2 years or less before \"\n        \"Today())\"\n    )\n    assert inst.action[0].condition[0].expression.language == \"text/cql\"\n    assert inst.action[0].condition[0].kind == \"applicability\"\n    assert inst.action[0].definitionCanonical == \"#procedure\"\n    assert (\n        inst.action[0].description\n        == \"Measure, Weight, Height, Waist, Circumference; Calculate BMI\"\n    )\n    assert inst.action[0].goalId[0] == \"reduce-bmi-ratio\"\n    assert inst.action[0].requiredBehavior == \"must-unless-documented\"\n    assert inst.action[0].title == \"Measure BMI\"\n    assert inst.author[0].name == \"National Heart, Lung, and Blood Institute\"\n    assert inst.author[0].telecom[0].system == \"url\"\n    assert (\n        inst.author[0].telecom[0].value\n        == \"https://www.nhlbi.nih.gov/health-pro/guidelines\"\n    )\n    assert inst.contained[0].id == \"procedure\"\n    assert inst.experimental is True\n    assert inst.goal[0].addresses[0].coding[0].code == \"414916001\"\n    assert inst.goal[0].addresses[0].coding[0].display == \"Obesity (disorder)\"\n    assert (\n        inst.goal[0].addresses[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.goal[0].category.text == \"Treatment\"\n    assert inst.goal[0].description.text == \"Reduce BMI to below 25\"\n    assert inst.goal[0].documentation[0].display == \"Evaluation and Treatment Strategy\"\n    assert (\n        inst.goal[0].documentation[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/42.htm\"\n            }\n        ).valueUrl\n    )\n    assert inst.goal[0].documentation[0].type == \"justification\"\n    assert (\n        inst.goal[0].documentation[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/42.htm\"\n            }\n        ).valueUrl\n    )\n    assert inst.goal[0].id == \"reduce-bmi-ratio\"\n    assert inst.goal[0].priority.text == \"medium-priority\"\n    assert inst.goal[0].start.text == \"When the patient's BMI Ratio is at or above 25\"\n    assert inst.goal[0].target[0].detailRange.high.unit == \"kg/m2\"\n    assert float(inst.goal[0].target[0].detailRange.high.value) == float(24.9)\n    assert inst.goal[0].target[0].due.code == \"a\"\n    assert (\n        inst.goal[0].target[0].due.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.goal[0].target[0].due.unit == \"yr\"\n    assert float(inst.goal[0].target[0].due.value) == float(1)\n    assert inst.goal[0].target[0].measure.coding[0].code == \"39156-5\"\n    assert (\n        inst.goal[0].target[0].measure.coding[0].display\n        == \"Body mass index (BMI) [Ratio]\"\n    )\n    assert (\n        inst.goal[0].target[0].measure.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.id == \"protocol-example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"example-1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.purpose == (\n        \"Example of A medical algorithm for assessment and treatment \"\n        \"of overweight and obesity\"\n    )\n    assert (\n        inst.relatedArtifact[0].display == \"Overweight and Obesity Treatment Guidelines\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/algorthm/algorthm.htm\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/algorthm/algorthm.htm\"\n            }\n        ).valueUrl\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Obesity Assessment Protocol\"\n    assert inst.type.coding[0].code == \"clinical-protocol\"\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"414916001\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Obesity (disorder)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_plandefinition_6(base_settings):\n    \"\"\"No. 6 tests collection for PlanDefinition.\n    Test File: plandefinition-protocol-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"plandefinition-protocol-example.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_6(inst2)\n\n\ndef impl_plandefinition_7(inst):\n    assert (\n        inst.action[0].action[0].action[0].definitionCanonical\n        == \"#referralToMentalHealthCare\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[0].expression.expression\n        == \"Now()\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[0].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[0].path == \"timing.event\"\n    assert inst.action[0].action[0].action[0].dynamicValue[1].expression.expression == (\n        \"Code '261QM0850X' from SuicideRiskLogic.\\\"NUCC Provider \"\n        \"Taxonomy\\\" display 'Adult Mental Health'\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[1].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[1].path == \"specialty\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[2].expression.expression\n        == \"SuicideRiskLogic.ServiceRequestFulfillmentTime\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[2].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[2].path == \"occurrenceDateTime\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[3].expression.expression\n        == \"SuicideRiskLogic.Patient\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[3].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[3].path == \"subject\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[4].expression.expression\n        == \"SuicideRiskLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[4].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[4].path == \"requester.agent\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[5].expression.expression\n        == \"SuicideRiskLogic.RiskAssessmentScore\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[5].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[5].path == \"reasonCode\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[6].expression.expression\n        == \"SuicideRiskLogic.RiskAssessment\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[6].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[6].path == \"reasonReference\"\n    assert inst.action[0].action[0].action[0].textEquivalent == (\n        \"Refer to outpatient mental health program for evaluation and\"\n        \" treatment of mental health conditions now\"\n    )\n    assert inst.action[0].action[0].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[0].selectionBehavior == \"any\"\n    assert inst.action[0].action[0].title == \"Consults and Referrals\"\n    assert (\n        inst.action[0].action[1].action[0].action[0].action[0].definitionCanonical\n        == \"#citalopramPrescription\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[0]\n        .expression.expression\n        == \"'draft'\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[0]\n        .expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[0].path\n        == \"status\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[1]\n        .expression.expression\n        == \"SuicideRiskLogic.Patient\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[1]\n        .expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[1].path\n        == \"patient\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[2]\n        .expression.expression\n        == \"SuicideRiskLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[2]\n        .expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[2].path\n        == \"prescriber\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[3]\n        .expression.expression\n        == \"SuicideRiskLogic.RiskAssessmentScore\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[3]\n        .expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[3].path\n        == \"reasonCode\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[4]\n        .expression.expression\n        == \"SuicideRiskLogic.RiskAssessment\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[4]\n        .expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[4].path\n        == \"reasonReference\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].action[0].textEquivalent == (\n        \"citalopram 20 mg tablet 1 tablet oral 1 time daily now (30 \"\n        \"table; 3 refills)\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].action[1].textEquivalent == (\n        \"escitalopram 10 mg tablet 1 tablet oral 1 time daily now (30\"\n        \" tablet; 3 refills)\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].action[2].textEquivalent == (\n        \"fluoxetine 20 mg capsule 1 capsule oral 1 time daily now (30\"\n        \" tablet; 3 refills)\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].action[3].textEquivalent == (\n        \"paroxetine 20 mg tablet 1 tablet oral 1 time daily now (30 \"\n        \"tablet; 3 refills)\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].action[4].textEquivalent == (\n        \"sertraline 50 mg tablet 1 tablet oral 1 time daily now (30 \"\n        \"tablet; 3 refills)\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .documentation[0]\n        .document.contentType\n        == \"text/html\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].documentation[\n        0\n    ].document.title == (\n        \"National Library of Medicine. DailyMed website. CITALOPRAM- \"\n        \"citalopram hydrobromide tablet, film coated.\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].documentation[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6daeb45c-451d-b135-bf8f-2d6dff4b6b01\"\n            }\n        ).valueUrl\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].documentation[0].type == \"citation\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].documentation[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6daeb45c-451d-b135-bf8f-2d6dff4b6b01\"\n            }\n        ).valueUrl\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].groupingBehavior == \"logical-group\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].selectionBehavior == \"at-most-one\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].title == (\n        \"Selective Serotonin Reuptake Inhibitors (Choose a mazimum of\"\n        \" one or document reasons for exception)\"\n    )\n    assert inst.action[0].action[1].action[0].action[1].textEquivalent == (\n        \"Dopamine Norepinephrine Reuptake Inhibitors (Choose a \"\n        \"maximum of one or document reasons for exception)\"\n    )\n    assert inst.action[0].action[1].action[0].action[2].textEquivalent == (\n        \"Serotonin Norepinephrine Reuptake Inhibitors (Choose a \"\n        \"maximum of one or doument reasons for exception)\"\n    )\n    assert inst.action[0].action[1].action[0].action[3].textEquivalent == (\n        \"Norepinephrine-Serotonin Modulators (Choose a maximum of one\"\n        \" or document reasons for exception)\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].documentation[0].document.contentType\n        == \"text/html\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].documentation[0].document.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"high\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/evidence-quality\"}\n        ).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.text\n        == \"High Quality\"\n    )\n    assert inst.action[0].action[1].action[0].documentation[0].document.title == (\n        \"Practice Guideline for the Treatment of Patients with Major \"\n        \"Depressive Disorder\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].documentation[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.action[0].action[1].action[0].documentation[0].type == \"citation\"\n    assert (\n        inst.action[0].action[1].action[0].documentation[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.action[0].action[1].action[0].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[1].action[0].selectionBehavior == \"at-most-one\"\n    assert inst.action[0].action[1].action[0].title == \"First-Line Antidepressants\"\n    assert inst.action[0].action[1].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[1].selectionBehavior == \"at-most-one\"\n    assert inst.action[0].action[1].title == \"Medications\"\n    assert inst.action[0].title == \"Suicide Risk Assessment and Outpatient Management\"\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-03-12\"}).valueDate\n    )\n    assert inst.author[0].name == \"Motive Medical Intelligence\"\n    assert inst.author[0].telecom[0].system == \"phone\"\n    assert inst.author[0].telecom[0].use == \"work\"\n    assert inst.author[0].telecom[0].value == \"415-362-4007\"\n    assert inst.author[0].telecom[1].system == \"email\"\n    assert inst.author[0].telecom[1].use == \"work\"\n    assert inst.author[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"415-362-4007\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.contained[0].id == \"referralToMentalHealthCare\"\n    assert inst.contained[1].id == \"citalopramPrescription\"\n    assert inst.contained[2].id == \"citalopramMedication\"\n    assert inst.contained[3].id == \"citalopramSubstance\"\n    assert inst.copyright == (\n        \"© Copyright 2016 Motive Medical Intelligence. All rights \" \"reserved.\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-15\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Orders to be applied to a patient characterized as low \" \"suicide risk.\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"low-suicide-risk-order-set\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://motivemi.com/artifacts\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"mmi:low-suicide-risk-order-set\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-08-15\"}).valueDate\n    )\n    assert (\n        inst.library[0] == \"http://example.org/fhir/Library/suiciderisk-orderset-logic\"\n    )\n    assert inst.name == \"LowSuicideRiskOrderSet\"\n    assert inst.publisher == \"Motive Medical Intelligence\"\n    assert inst.purpose == (\n        \"This order set helps ensure consistent application of \"\n        \"appropriate orders for the care of low suicide risk \"\n        \"patients.\"\n    )\n    assert inst.relatedArtifact[0].display == (\n        \"Practice Guideline for the Treatment of Patients with Major \"\n        \"Depressive Disorder\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].resource == (\n        \"http://example.org/fhir/ActivityDefinition/referralPrimaryCa\" \"reMentalHealth\"\n    )\n    assert inst.relatedArtifact[1].type == \"composed-of\"\n    assert inst.relatedArtifact[2].resource == (\n        \"http://example.org/fhir/ActivityDefinition/citalopramPrescri\" \"ption\"\n    )\n    assert inst.relatedArtifact[2].type == \"composed-of\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Low Suicide Risk Order Set\"\n    assert inst.topic[0].text == \"Suicide risk assessment\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://motivemi.com/artifacts/PlanDefinition/low-suicide-risk-order-set\"\n            }\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This order set should be applied after assessing a patient \"\n        \"for suicide risk, when the findings of that assessment \"\n        \"indicate the patient has low suicide risk.\"\n    )\n    assert inst.useContext[0].code.code == \"age\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"D000328\"\n    assert inst.useContext[0].valueCodeableConcept.coding[0].display == \"Adult\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://meshb.nlm.nih.gov\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"87512008\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Mild major depression\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].code.code == \"focus\"\n    assert (\n        inst.useContext[2].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].valueCodeableConcept.coding[0].code == \"40379007\"\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].display\n        == \"Major depression, recurrent, mild\"\n    )\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].code.code == \"focus\"\n    assert (\n        inst.useContext[3].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].valueCodeableConcept.coding[0].code == \"394687007\"\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].display == \"Low suicide risk\"\n    )\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].code.code == \"focus\"\n    assert (\n        inst.useContext[4].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].valueCodeableConcept.coding[0].code == \"225337009\"\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].display\n        == \"Suicide risk assessment\"\n    )\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].code.code == \"user\"\n    assert (\n        inst.useContext[5].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].valueCodeableConcept.coding[0].code == \"309343006\"\n    assert inst.useContext[5].valueCodeableConcept.coding[0].display == \"Physician\"\n    assert (\n        inst.useContext[5].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].code.code == \"venue\"\n    assert (\n        inst.useContext[6].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].valueCodeableConcept.coding[0].code == \"440655000\"\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].display\n        == \"Outpatient environment\"\n    )\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"1.0.0\"\n\n\ndef test_plandefinition_7(base_settings):\n    \"\"\"No. 7 tests collection for PlanDefinition.\n    Test File: plandefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"plandefinition-example.json\"\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_7(inst2)\n\n\ndef impl_plandefinition_8(inst):\n    assert inst.action[0].action[0].description == \"Will offer Naloxone instead\"\n    assert inst.action[0].action[1].description == (\n        \"Risk of overdose carefully considered and outweighed by \"\n        \"benefit; snooze 3 mo\"\n    )\n    assert inst.action[0].action[2].description == \"N/A - see comment; snooze 3 mo\"\n    assert inst.action[0].condition[0].expression.expression == \"Inclusion Criteria\"\n    assert inst.action[0].condition[0].expression.language == \"text/cql\"\n    assert inst.action[0].condition[0].kind == \"applicability\"\n    assert inst.action[0].description == (\n        \"Checking if the trigger prescription meets the inclusion \"\n        \"criteria for recommendation #8 workflow.\"\n    )\n    assert (\n        inst.action[0].documentation[0].document.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"strong\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Strong\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/recommendation-strength\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0].documentation[0].document.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[1]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"low\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[1]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Low quality\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[1]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/evidence-quality\"}\n        ).valueUri\n    )\n    assert inst.action[0].documentation[0].type == \"documentation\"\n    assert inst.action[0].dynamicValue[0].expression.expression == \"Get Detail\"\n    assert inst.action[0].dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.action[0].dynamicValue[0].path == \"action.description\"\n    assert inst.action[0].dynamicValue[1].expression.expression == \"Get Summary\"\n    assert inst.action[0].dynamicValue[1].expression.language == \"text/cql\"\n    assert inst.action[0].dynamicValue[1].path == \"action.title\"\n    assert inst.action[0].dynamicValue[2].expression.expression == \"Get Indicator\"\n    assert inst.action[0].dynamicValue[2].expression.language == \"text/cql\"\n    assert inst.action[0].dynamicValue[2].path == \"action.extension\"\n    assert inst.action[0].groupingBehavior == \"visual-group\"\n    assert inst.action[0].selectionBehavior == \"exactly-one\"\n    assert inst.action[0].title == (\n        \"Existing patient exhibits risk factors for opioid-related \" \"harms.\"\n    )\n    assert inst.action[0].trigger[0].name == \"medication-prescribe\"\n    assert inst.action[0].trigger[0].type == \"named-event\"\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-19\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"opioidcds-08\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"cdc-opioid-guidance\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.library[0] == \"http://example.org/fhir/Library/opioidcds-recommendation-08\"\n    )\n    assert inst.name == \"cdc-opioid-08\"\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert (\n        inst.relatedArtifact[0].display\n        == \"CDC guideline for prescribing opioids for chronic pain\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].display == \"MME Conversion Tables\"\n    assert (\n        inst.relatedArtifact[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"CDC Opioid Prescribing Guideline Recommendation #8\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"eca-rule\"\n    assert inst.type.coding[0].display == \"ECA Rule\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/plan-definition-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/ig/opioid-cds/PlanDefinition/opioidcds-08\"\n            }\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"Before starting and periodically during continuation of \"\n        \"opioid therapy, clinicians should evaluate risk factors for \"\n        \"opioid-related harms.\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_plandefinition_8(base_settings):\n    \"\"\"No. 8 tests collection for PlanDefinition.\n    Test File: plandefinition-opioidcds-08.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"plandefinition-opioidcds-08.json\"\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_8(inst2)\n\n\ndef impl_plandefinition_9(inst):\n    assert (\n        inst.action[0].action[0].dynamicValue[0].expression.expression\n        == \"Create Lactation Consult Request\"\n    )\n    assert inst.action[0].action[0].dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.action[0].action[0].dynamicValue[0].path == \"/\"\n    assert (\n        inst.action[0].action[0].textEquivalent == \"Create a lactation consult request\"\n    )\n    assert inst.action[0].action[0].title == \"Create a lactation consult request.\"\n    assert inst.action[0].action[0].type.coding[0].code == \"create\"\n    assert (\n        inst.action[0].condition[0].expression.expression\n        == \"Should Create Lactation Consult\"\n    )\n    assert inst.action[0].condition[0].expression.language == \"text/cql\"\n    assert inst.action[0].condition[0].kind == \"applicability\"\n    assert inst.action[0].title == (\n        \"Mother should be referred to a lactation specialist for \" \"consultation.\"\n    )\n    assert inst.action[0].trigger[0].name == \"Admission\"\n    assert inst.action[0].trigger[0].type == \"named-event\"\n    assert inst.action[0].trigger[1].name == \"Birth\"\n    assert inst.action[0].trigger[1].type == \"named-event\"\n    assert inst.action[0].trigger[2].name == \"Infant Transfer to Recovery\"\n    assert inst.action[0].trigger[2].type == \"named-event\"\n    assert inst.action[0].trigger[3].name == \"Transfer to Post-Partum\"\n    assert inst.action[0].trigger[3].type == \"named-event\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Exclusive breastfeeding intervention intended to improve \"\n        \"outcomes for exclusive breastmilk feeding of newborns by \"\n        \"creating a lactation consult for the mother if appropriate.\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"exclusive-breastfeeding-intervention-04\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"exclusive-breastfeeding-intervention-04\"\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/library-exclusive-\" \"breastfeeding-cds-logic\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relatedArtifact[0].resource == (\n        \"http://example.org/fhir/Measure/measure-exclusive-\" \"breastfeeding\"\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Exclusive Breastfeeding Intervention-04\"\n    assert inst.topic[0].text == \"Exclusive Breastfeeding\"\n    assert inst.version == \"1.0.0\"\n\n\ndef test_plandefinition_9(base_settings):\n    \"\"\"No. 9 tests collection for PlanDefinition.\n    Test File: plandefinition-exclusive-breastfeeding-intervention-04.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"plandefinition-exclusive-breastfeeding-intervention-04.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_9(inst2)\n\n\ndef impl_plandefinition_10(inst):\n    assert inst.action[0].action[0].description == \"Will precribe immediate release\"\n    assert inst.action[0].action[1].description == (\n        \"Risk of overdose carefully considered and outweighed by \"\n        \"benefit; snooze 3 mo\"\n    )\n    assert inst.action[0].action[2].description == \"N/A - see comment; snooze 3 mo\"\n    assert inst.action[0].condition[0].expression.description == (\n        \"Check whether the opioid prescription for the existing \"\n        \"patient is extended-release without any opioids-with-abuse-\"\n        \"potential prescribed in the past 90 days.\"\n    )\n    assert inst.action[0].condition[0].expression.expression == \"Inclusion Criteria\"\n    assert inst.action[0].condition[0].expression.language == \"text/cql\"\n    assert inst.action[0].condition[0].kind == \"applicability\"\n    assert inst.action[0].description == (\n        \"Checking if the trigger prescription meets the inclusion \"\n        \"criteria for recommendation #4 workflow.\"\n    )\n    assert (\n        inst.action[0].documentation[0].document.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"strong\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Strong\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/recommendation-strength\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0].documentation[0].document.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[1]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"low\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[1]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Low quality\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[1]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/evidence-quality\"}\n        ).valueUri\n    )\n    assert inst.action[0].documentation[0].type == \"documentation\"\n    assert inst.action[0].dynamicValue[0].expression.expression == \"Get Summary\"\n    assert inst.action[0].dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.action[0].dynamicValue[0].path == \"action.title\"\n    assert inst.action[0].dynamicValue[1].expression.expression == \"Get Detail\"\n    assert inst.action[0].dynamicValue[1].expression.language == \"text/cql\"\n    assert inst.action[0].dynamicValue[1].path == \"action.description\"\n    assert inst.action[0].dynamicValue[2].expression.expression == \"Get Indicator\"\n    assert inst.action[0].dynamicValue[2].expression.language == \"text/cql\"\n    assert inst.action[0].dynamicValue[2].path == \"activity.extension\"\n    assert inst.action[0].groupingBehavior == \"visual-group\"\n    assert inst.action[0].selectionBehavior == \"exactly-one\"\n    assert inst.action[0].title == \"Extended-release opioid prescription triggered.\"\n    assert inst.action[0].trigger[0].name == \"medication-prescribe\"\n    assert inst.action[0].trigger[0].type == \"named-event\"\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-19\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"When starting opioid therapy for chronic pain, clinicians \"\n        \"should prescribe immediate-release opioids instead of \"\n        \"extended-release/long-acting (ER/LA) opioids.\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"opioidcds-04\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"cdc-opioid-guidance\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.library[0] == \"http://example.org/fhir/Library/opioidcds-recommendation-04\"\n    )\n    assert inst.name == \"cdc-opioid-04\"\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert (\n        inst.relatedArtifact[0].display\n        == \"CDC guideline for prescribing opioids for chronic pain\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].display == \"MME Conversion Tables\"\n    assert (\n        inst.relatedArtifact[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"CDC Opioid Prescribing Guideline Recommendation #4\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"eca-rule\"\n    assert inst.type.coding[0].display == \"ECA Rule\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/plan-definition-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/ig/opioid-cds/PlanDefinition/opioidcds-04\"\n            }\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"Providers should use caution when prescribing extended-\"\n        \"release/long-acting (ER/LA) opioids as they carry a higher \"\n        \"risk and negligible benefit compared to immediate-release \"\n        \"opioids.\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_plandefinition_10(base_settings):\n    \"\"\"No. 10 tests collection for PlanDefinition.\n    Test File: plandefinition-opioidcds-04.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"plandefinition-opioidcds-04.json\"\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_practitioner.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Practitioner\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import practitioner\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_practitioner_1(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Den helder\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Walvisbaai 3\"\n    assert inst.address[0].postalCode == \"2333ZA\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1983-04-20\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"f203\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"UZI-nummer\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345678903\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.bigregister.nl/\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].type.text == \"BIG-nummer\"\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"12345678903\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].text == \"Juri van Gelder\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"+31715269111\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_1(base_settings):\n    \"\"\"No. 1 tests collection for Practitioner.\n    Test File: practitioner-example-f203-jvg.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f203-jvg.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_1(inst2)\n\n\ndef impl_practitioner_2(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Den helder\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Walvisbaai 3\"\n    assert inst.address[0].line[1] == \"C4 - Automatisering\"\n    assert inst.address[0].postalCode == \"2333ZA\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1956-12-24\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"f201\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"UZI-nummer\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345678901\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Bronsig\"\n    assert inst.name[0].given[0] == \"Arend\"\n    assert inst.name[0].prefix[0] == \"Dr.\"\n    assert inst.name[0].text == \"Dokter Bronsig\"\n    assert inst.name[0].use == \"official\"\n    assert inst.qualification[0].code.coding[0].code == \"41672002\"\n    assert inst.qualification[0].code.coding[0].display == \"Pulmonologist\"\n    assert (\n        inst.qualification[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"+31715269111\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_2(base_settings):\n    \"\"\"No. 2 tests collection for Practitioner.\n    Test File: practitioner-example-f201-ab.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f201-ab.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_2(inst2)\n\n\ndef impl_practitioner_3(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Den helder\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Walvisbaai 3\"\n    assert inst.address[0].line[1] == \"C4 - Automatisering\"\n    assert inst.address[0].postalCode == \"2333ZA\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1960-06-12\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"f202\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"UZI-nummer\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345678902\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.bigregister.nl/\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].type.text == \"BIG-nummer\"\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"12345678902\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Maas\"\n    assert inst.name[0].given[0] == \"Luigi\"\n    assert inst.name[0].prefix[0] == \"Dr.\"\n    assert inst.name[0].text == \"Luigi Maas\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"+31715269111\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_3(base_settings):\n    \"\"\"No. 3 tests collection for Practitioner.\n    Test File: practitioner-example-f202-lm.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f202-lm.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_3(inst2)\n\n\ndef impl_practitioner_4(inst):\n    assert inst.id == \"xcda-author\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Hippocrates\"\n    assert inst.name[0].given[0] == \"Harold\"\n    assert inst.name[0].suffix[0] == \"MD\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_4(base_settings):\n    \"\"\"No. 4 tests collection for Practitioner.\n    Test File: practitioner-example-xcda-author.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"practitioner-example-xcda-author.json\"\n    )\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_4(inst2)\n\n\ndef impl_practitioner_5(inst):\n    assert inst.address[0].city == \"Amsterdam\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Galapagosweg 91\"\n    assert inst.address[0].postalCode == \"1105 AZ\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1963-07-01\"}).valueDate\n    )\n    assert inst.communication[0].coding[0].code == \"nl\"\n    assert inst.communication[0].coding[0].display == \"Dutch\"\n    assert (\n        inst.communication[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"f003\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"846100293\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"usual\"\n    assert inst.identifier[1].value == \"243HID3RT938\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Versteegh\"\n    assert inst.name[0].given[0] == \"Marc\"\n    assert inst.name[0].suffix[0] == \"MD\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"0205562431\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"m.versteegh@bmc.nl\"\n    assert inst.telecom[2].system == \"fax\"\n    assert inst.telecom[2].use == \"work\"\n    assert inst.telecom[2].value == \"0205662948\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_5(base_settings):\n    \"\"\"No. 5 tests collection for Practitioner.\n    Test File: practitioner-example-f003-mv.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f003-mv.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_5(inst2)\n\n\ndef impl_practitioner_6(inst):\n    assert inst.address[0].city == \"Den Burg\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Galapagosweg 91\"\n    assert inst.address[0].postalCode == \"9105 PZ\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1979-04-29\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"f002\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"730291637\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"usual\"\n    assert inst.identifier[1].value == \"174BIP3JH438\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Voigt\"\n    assert inst.name[0].given[0] == \"Pieter\"\n    assert inst.name[0].suffix[0] == \"MD\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"0205569336\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"p.voigt@bmc.nl\"\n    assert inst.telecom[2].system == \"fax\"\n    assert inst.telecom[2].use == \"work\"\n    assert inst.telecom[2].value == \"0205669382\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_6(base_settings):\n    \"\"\"No. 6 tests collection for Practitioner.\n    Test File: practitioner-example-f002-pv.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f002-pv.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_6(inst2)\n\n\ndef impl_practitioner_7(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"PleasantVille\"\n    assert inst.address[0].line[0] == \"534 Erewhon St\"\n    assert inst.address[0].postalCode == \"3999\"\n    assert inst.address[0].state == \"Vic\"\n    assert inst.address[0].use == \"home\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org/practitioners\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"23\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Careful\"\n    assert inst.name[0].given[0] == \"Adam\"\n    assert inst.name[0].prefix[0] == \"Dr\"\n    assert inst.qualification[0].code.coding[0].code == \"BS\"\n    assert inst.qualification[0].code.coding[0].display == \"Bachelor of Science\"\n    assert (\n        inst.qualification[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0360/2.7\"}\n        ).valueUri\n    )\n    assert inst.qualification[0].code.text == \"Bachelor of Science\"\n    assert (\n        inst.qualification[0].identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/UniversityIdentifier\"}\n        ).valueUri\n    )\n    assert inst.qualification[0].identifier[0].value == \"12345\"\n    assert inst.qualification[0].issuer.display == \"Example University\"\n    assert (\n        inst.qualification[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1995\"}\n        ).valueDateTime\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_7(base_settings):\n    \"\"\"No. 7 tests collection for Practitioner.\n    Test File: practitioner-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_7(inst2)\n\n\ndef impl_practitioner_8(inst):\n    assert inst.address[0].city == \"Den Burg\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Galapagosweg 91\"\n    assert inst.address[0].postalCode == \"9105 PZ\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1971-11-07\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"f007\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"874635264\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"usual\"\n    assert inst.identifier[1].value == \"567IUI51C154\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Heps\"\n    assert inst.name[0].given[0] == \"Simone\"\n    assert inst.name[0].suffix[0] == \"MD\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"020556936\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"S.M.Heps@bmc.nl\"\n    assert inst.telecom[2].system == \"fax\"\n    assert inst.telecom[2].use == \"work\"\n    assert inst.telecom[2].value == \"0205669283\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_8(base_settings):\n    \"\"\"No. 8 tests collection for Practitioner.\n    Test File: practitioner-example-f007-sh.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f007-sh.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_8(inst2)\n\n\ndef impl_practitioner_9(inst):\n    assert inst.address[0].city == \"Den helder\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Walvisbaai 3\"\n    assert inst.address[0].postalCode == \"2333ZA\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1967-11-05\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"f204\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"UZI-nummer\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345678904\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].text == \"Carla Espinosa\"\n    assert inst.name[0].use == \"usual\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"+31715262169\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_9(base_settings):\n    \"\"\"No. 9 tests collection for Practitioner.\n    Test File: practitioner-example-f204-ce.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f204-ce.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_9(inst2)\n\n\ndef impl_practitioner_10(inst):\n    assert inst.id == \"xcda1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://healthcare.example.org/identifiers/staff\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"D234123\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Dopplemeyer\"\n    assert inst.name[0].given[0] == \"Sherry\"\n    assert inst.telecom[0].system == \"email\"\n    assert inst.telecom[0].value == \"john.doe@healthcare.example.org\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_10(base_settings):\n    \"\"\"No. 10 tests collection for Practitioner.\n    Test File: practitioner-example-xcda1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-xcda1.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_practitionerrole.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PractitionerRole\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import practitionerrole\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_practitionerrole_1(inst):\n    assert inst.active is True\n    assert inst.availabilityExceptions == (\n        \"Adam is generally unavailable on public holidays and during \"\n        \"the Christmas/New Year break\"\n    )\n    assert (\n        inst.availableTime[0].availableEndTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"16:30:00\"}).valueTime\n    )\n    assert (\n        inst.availableTime[0].availableStartTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"09:00:00\"}).valueTime\n    )\n    assert inst.availableTime[0].daysOfWeek[0] == \"mon\"\n    assert inst.availableTime[0].daysOfWeek[1] == \"tue\"\n    assert inst.availableTime[0].daysOfWeek[2] == \"wed\"\n    assert (\n        inst.availableTime[1].availableEndTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"12:00:00\"}).valueTime\n    )\n    assert (\n        inst.availableTime[1].availableStartTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"09:00:00\"}).valueTime\n    )\n    assert inst.availableTime[1].daysOfWeek[0] == \"thu\"\n    assert inst.availableTime[1].daysOfWeek[1] == \"fri\"\n    assert inst.code[0].coding[0].code == \"RP\"\n    assert (\n        inst.code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0286\"}\n        ).valueUri\n    )\n    assert inst.endpoint[0].reference == \"Endpoint/example\"\n    assert inst.healthcareService[0].reference == \"HealthcareService/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org/practitioners\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"23\"\n    assert inst.location[0].display == \"South Wing, second floor\"\n    assert inst.location[0].reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.notAvailable[0].description\n        == \"Adam will be on extended leave during May 2017\"\n    )\n    assert (\n        inst.notAvailable[0].during.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-05-20\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.notAvailable[0].during.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-05-01\"}\n        ).valueDateTime\n    )\n    assert inst.organization.reference == \"Organization/f001\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-03-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.practitioner.display == \"Dr Adam Careful\"\n    assert inst.practitioner.reference == \"Practitioner/example\"\n    assert inst.specialty[0].coding[0].code == \"408443003\"\n    assert inst.specialty[0].coding[0].display == \"General medical practice\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"(03) 5555 6473\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"adam.southern@example.org\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitionerrole_1(base_settings):\n    \"\"\"No. 1 tests collection for PractitionerRole.\n    Test File: practitionerrole-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitionerrole-example.json\"\n    inst = practitionerrole.PractitionerRole.model_validate_json(filename.read_bytes())\n    assert \"PractitionerRole\" == inst.get_resource_type()\n\n    impl_practitionerrole_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PractitionerRole\" == data[\"resourceType\"]\n\n    inst2 = practitionerrole.PractitionerRole(**data)\n    impl_practitionerrole_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_procedure.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Procedure\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import procedure\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_procedure_1(inst):\n    assert inst.bodySite[0].coding[0].code == \"272676008\"\n    assert inst.bodySite[0].coding[0].display == \"Sphenoid bone\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"367336001\"\n    assert inst.code.coding[0].display == \"Chemotherapy\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.display == \"Roel's encounter on January 28th, 2013\"\n    assert inst.encounter.reference == \"Encounter/f202\"\n    assert inst.id == \"f201\"\n    assert (\n        inst.instantiatesCanonical[0] == \"http://example.org/fhir/PlanDefinition/KDN5\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Eerste neo-adjuvante TPF-kuur bij groot proces in sphenoid \"\n        \"met intracraniale uitbreiding.\"\n    )\n    assert (\n        inst.performedPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-28T14:27:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.performedPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-28T13:31:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.display == \"Dokter Bronsig\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f201\"\n    assert inst.performer[0].function.coding[0].code == \"310512001\"\n    assert inst.performer[0].function.coding[0].display == \"Medical oncologist\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reasonCode[0].text == \"DiagnosticReport/f201\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_1(base_settings):\n    \"\"\"No. 1 tests collection for Procedure.\n    Test File: procedure-example-f201-tpf.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"procedure-example-f201-tpf.json\"\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_1(inst2)\n\n\ndef impl_procedure_2(inst):\n    assert inst.basedOn[0].display == \"Maternity care plan\"\n    assert inst.basedOn[0].reference == \"CarePlan/preg\"\n    assert inst.code.coding[0].code == \"62013009\"\n    assert inst.code.coding[0].display == \"Ambulating patient (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Ambulation\"\n    assert inst.id == \"ambulation\"\n    assert inst.identifier[0].value == \"12345\"\n    assert (\n        inst.instantiatesUri[0]\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/protocol-for-hypertension-during-pregnancy\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.location.display\n        == \"Burgers University Medical Center, South Wing, second floor\"\n    )\n    assert inst.location.reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Carla Espinosa\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f204\"\n    assert inst.performer[0].onBehalfOf.display == \"University Medical Hospital\"\n    assert inst.performer[0].onBehalfOf.reference == \"Organization/f001\"\n    assert inst.reasonReference[0].display == \"Blood Pressure\"\n    assert inst.reasonReference[0].reference == \"Observation/blood-pressure\"\n    assert inst.status == \"not-done\"\n    assert inst.statusReason.coding[0].code == \"398254007\"\n    assert inst.statusReason.coding[0].display == \"  Pre-eclampsia (disorder)\"\n    assert (\n        inst.statusReason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.statusReason.text == \"Pre-eclampsia\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Ambulation '\n        \"procedure was not done</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_2(base_settings):\n    \"\"\"No. 2 tests collection for Procedure.\n    Test File: procedure-example-ambulation.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"procedure-example-ambulation.json\"\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_2(inst2)\n\n\ndef impl_procedure_3(inst):\n    assert inst.code.coding[0].code == \"25267002\"\n    assert (\n        inst.code.coding[0].display == \"Insertion of intracardiac pacemaker (procedure)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Implant Pacemaker\"\n    assert inst.focalDevice[0].action.coding[0].code == \"implanted\"\n    assert (\n        inst.focalDevice[0].action.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/device-action\"}\n        ).valueUri\n    )\n    assert inst.focalDevice[0].manipulated.reference == \"Device/example-pacemaker\"\n    assert inst.followUp[0].text == \"ROS 5 days  - 2013-04-10\"\n    assert inst.id == \"example-implant\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Routine Appendectomy. Appendix was inflamed and in retro-\" \"caecal position\"\n    )\n    assert (\n        inst.performedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-04-05\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.display == \"Dr Cecil Surgeon\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.reasonCode[0].text == \"Bradycardia\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_3(base_settings):\n    \"\"\"No. 3 tests collection for Procedure.\n    Test File: procedure-example-implant.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"procedure-example-implant.json\"\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_3(inst2)\n\n\ndef impl_procedure_4(inst):\n    assert inst.code.coding[0].code == \"76164006\"\n    assert inst.code.coding[0].display == \"Biopsy of colon (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Biopsy of colon\"\n    assert inst.id == \"colon-biopsy\"\n    assert inst.identifier[0].value == \"12345\"\n    assert (\n        inst.location.display\n        == \"Burgers University Medical Center, South Wing, second floor\"\n    )\n    assert inst.location.reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.partOf[0].display == \"Colonoscopy\"\n    assert inst.partOf[0].reference == \"Procedure/colonoscopy\"\n    assert inst.performer[0].actor.display == \"Dr Adam Careful\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Biopsy of colon,'\n        \" which was part of colonoscopy</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_4(base_settings):\n    \"\"\"No. 4 tests collection for Procedure.\n    Test File: procedure-example-colon-biopsy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"procedure-example-colon-biopsy.json\"\n    )\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_4(inst2)\n\n\ndef impl_procedure_5(inst):\n    assert inst.bodySite[0].coding[0].code == \"83030008\"\n    assert inst.bodySite[0].coding[0].display == \"Retropharyngeal area\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"48387007\"\n    assert inst.code.coding[0].display == \"Tracheotomy\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/f003\"\n    assert inst.followUp[0].text == \"described in care plan\"\n    assert inst.id == \"f004\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome.text == \"removal of the retropharyngeal abscess\"\n    assert (\n        inst.performedPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-22T10:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.performedPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-22T09:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.display == \"A. Langeveld\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f005\"\n    assert inst.performer[0].function.coding[0].code == \"01.000\"\n    assert inst.performer[0].function.coding[0].display == \"Arts\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.15.111\"}\n        ).valueUri\n    )\n    assert inst.performer[0].function.text == \"Care role\"\n    assert inst.reasonCode[0].text == \"ensure breathing during surgery\"\n    assert inst.report[0].display == \"???????????\"\n    assert inst.report[0].reference == \"DiagnosticReport/f001\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_5(base_settings):\n    \"\"\"No. 5 tests collection for Procedure.\n    Test File: procedure-example-f004-tracheotomy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"procedure-example-f004-tracheotomy.json\"\n    )\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_5(inst2)\n\n\ndef impl_procedure_6(inst):\n    assert inst.basedOn[0].display == \"Order for health education\"\n    assert inst.basedOn[0].reference == \"ServiceRequest/education\"\n    assert inst.category.coding[0].code == \"311401005\"\n    assert inst.category.coding[0].display == \"Patient education (procedure)\"\n    assert (\n        inst.category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category.text == \"Education\"\n    assert inst.code.coding[0].code == \"48023004\"\n    assert (\n        inst.code.coding[0].display\n        == \"Breast self-examination technique education (procedure)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Health education - breast examination\"\n    assert inst.id == \"education\"\n    assert inst.location.display == \"Southside Community Health Center\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.performedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.display == \"Pamela Educator, RN\"\n    assert inst.reasonCode[0].text == \"early detection of breast mass\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Jane Doe\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Health education'\n        \" - breast examination for early detection of breast \"\n        \"mass</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_6(base_settings):\n    \"\"\"No. 6 tests collection for Procedure.\n    Test File: procedure-example-education.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"procedure-example-education.json\"\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_6(inst2)\n\n\ndef impl_procedure_7(inst):\n    assert inst.code.coding[0].code == \"73761001\"\n    assert inst.code.coding[0].display == \"Colonoscopy (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Colonoscopy\"\n    assert inst.complicationDetail[0].display == \"Perforated intestine condition\"\n    assert inst.id == \"colonoscopy\"\n    assert inst.identifier[0].value == \"12345\"\n    assert (\n        inst.location.display\n        == \"Burgers University Medical Center, South Wing, second floor\"\n    )\n    assert inst.location.reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Dr Adam Careful\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Colonoscopy with'\n        \" complication</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.usedReference[0].display == \"Colonoscope device\"\n\n\ndef test_procedure_7(base_settings):\n    \"\"\"No. 7 tests collection for Procedure.\n    Test File: procedure-example-colonoscopy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"procedure-example-colonoscopy.json\"\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_7(inst2)\n\n\ndef impl_procedure_8(inst):\n    assert (\n        inst.basedOn[0].display == \"Order for the assessment of passive range of motion\"\n    )\n    assert inst.basedOn[0].reference == \"ServiceRequest/physical-therapy\"\n    assert inst.bodySite[0].coding[0].code == \"36701003\"\n    assert inst.bodySite[0].coding[0].display == \"Both knees (body structure)\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.bodySite[0].text == \"Both knees\"\n    assert inst.category.coding[0].code == \"386053000\"\n    assert inst.category.coding[0].display == \"Evaluation procedure (procedure)\"\n    assert (\n        inst.category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category.text == \"Evaluation\"\n    assert inst.code.coding[0].code == \"710830005\"\n    assert (\n        inst.code.coding[0].display\n        == \"Assessment of passive range of motion (procedure)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Assessment of passive range of motion\"\n    assert inst.id == \"physical-therapy\"\n    assert inst.location.display == \"Sawbones Orthopedic Clinic\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.performedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-09-27\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.display == \"Paul Therapist, PT\"\n    assert (\n        inst.reasonCode[0].text\n        == \"assessment of mobility limitations due to osteoarthritis\"\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Assessment of '\n        \"passive range of motion for both knees on Sept 27, 2016 due \"\n        \"to osteoarthritis</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_8(base_settings):\n    \"\"\"No. 8 tests collection for Procedure.\n    Test File: procedure-example-physical-therapy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"procedure-example-physical-therapy.json\"\n    )\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_8(inst2)\n\n\ndef impl_procedure_9(inst):\n    assert inst.bodySite[0].coding[0].code == \"83030008\"\n    assert inst.bodySite[0].coding[0].display == \"Retropharyngeal area\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"172960003\"\n    assert inst.code.coding[0].display == \"Incision of retropharyngeal abscess\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/f003\"\n    assert inst.followUp[0].text == \"described in care plan\"\n    assert inst.id == \"f003\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome.text == \"removal of the retropharyngeal abscess\"\n    assert (\n        inst.performedPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-24T10:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.performedPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-24T09:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.display == \"E.M.J.M. van den broek\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f001\"\n    assert inst.performer[0].function.coding[0].code == \"01.000\"\n    assert inst.performer[0].function.coding[0].display == \"Arts\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.15.111\"}\n        ).valueUri\n    )\n    assert inst.performer[0].function.text == \"Care role\"\n    assert inst.reasonCode[0].text == \"abcess in retropharyngeal area\"\n    assert inst.report[0].display == \"Lab results blood test\"\n    assert inst.report[0].reference == \"DiagnosticReport/f001\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_9(base_settings):\n    \"\"\"No. 9 tests collection for Procedure.\n    Test File: procedure-example-f003-abscess.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"procedure-example-f003-abscess.json\"\n    )\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_9(inst2)\n\n\ndef impl_procedure_10(inst):\n    assert inst.asserter.display == \"Dr Cecil Surgeon\"\n    assert inst.asserter.reference == \"Practitioner/example\"\n    assert inst.code.coding[0].code == \"80146002\"\n    assert inst.code.coding[0].display == \"Appendectomy (Procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Appendectomy\"\n    assert inst.followUp[0].text == \"ROS 5 days  - 2013-04-10\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Routine Appendectomy. Appendix was inflamed and in retro-\" \"caecal position\"\n    )\n    assert (\n        inst.performedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-05\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.display == \"Dr Cecil Surgeon\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.reasonCode[0].text == (\n        \"Generalized abdominal pain 24 hours. Localized in RIF with \"\n        \"rebound and guarding\"\n    )\n    assert inst.recorder.display == \"Dr Cecil Surgeon\"\n    assert inst.recorder.reference == \"Practitioner/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Routine ' \"Appendectomy</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_10(base_settings):\n    \"\"\"No. 10 tests collection for Procedure.\n    Test File: procedure-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"procedure-example.json\"\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_provenance.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Provenance\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import provenance\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_provenance_1(inst):\n    assert inst.activity.coding[0].code == \"AU\"\n    assert inst.activity.coding[0].display == \"authenticated\"\n    assert (\n        inst.activity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-DocumentCompletion\"}\n        ).valueUri\n    )\n    assert inst.agent[0].type.coding[0].code == \"VERF\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/contractsignertypecodes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.agent[0].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"mailto://hhd@ssa.gov\"\n    assert inst.id == \"signature\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.reason[0].coding[0].code == \"TREAT\"\n    assert inst.reason[0].coding[0].display == \"treatment\"\n    assert (\n        inst.reason[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-08-27T08:39:24+10:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.signature[0].data\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"Li4u\"}\n        ).valueBase64Binary\n    )\n    assert inst.signature[0].sigFormat == \"application/signature+xml\"\n    assert inst.signature[0].targetFormat == \"application/fhir+xml\"\n    assert inst.signature[0].type[0].code == \"1.2.840.10065.1.12.1.5\"\n    assert inst.signature[0].type[0].display == \"Verification Signature\"\n    assert (\n        inst.signature[0].type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso-astm:E1762-95:2013\"}\n        ).valueUri\n    )\n    assert (\n        inst.signature[0].when\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-08-27T08:39:24+10:00\"}\n        ).valueInstant\n    )\n    assert inst.signature[0].who.reference == \"Practitioner/xcda-author\"\n    assert inst.target[0].reference == \"DocumentReference/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">procedure record'\n        \" authored on 27-June 2015 by Harold Hippocrates, MD Content \"\n        \"extracted from Referral received 26-June</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_1(base_settings):\n    \"\"\"No. 1 tests collection for Provenance.\n    Test File: provenance-example-sig.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"provenance-example-sig.json\"\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_1(inst2)\n\n\ndef impl_provenance_2(inst):\n    assert inst.agent[0].role[0].coding[0].code == \"AUT\"\n    assert (\n        inst.agent[0].role[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.reference == \"Patient/72\"\n    assert inst.id == \"consent-signature\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-05-26T00:41:10-04:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.signature[0].data\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"dGhpcyBibG9iIGlzIHNuaXBwZWQ=\"}\n        ).valueBase64Binary\n    )\n    assert inst.signature[0].sigFormat == \"application/signature+xml\"\n    assert inst.signature[0].targetFormat == \"application/fhir+xml\"\n    assert inst.signature[0].type[0].code == \"1.2.840.10065.1.12.1.1\"\n    assert inst.signature[0].type[0].display == \"Author's Signature\"\n    assert (\n        inst.signature[0].type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso-astm:E1762-95:2013\"}\n        ).valueUri\n    )\n    assert (\n        inst.signature[0].when\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-05-26T00:41:10-04:00\"}\n        ).valueInstant\n    )\n    assert inst.signature[0].who.reference == \"Patient/72\"\n    assert inst.target[0].reference == \"Consent/consent-example-signature\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_2(base_settings):\n    \"\"\"No. 2 tests collection for Provenance.\n    Test File: provenance-consent-signature.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"provenance-consent-signature.json\"\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_2(inst2)\n\n\ndef impl_provenance_3(inst):\n    assert inst.agent[0].type.coding[0].code == \"AUT\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.reference == \"Patient/example\"\n    assert inst.entity[0].role == \"source\"\n    assert inst.entity[0].what.identifier.type.coding[0].code == \"CWL\"\n    assert inst.entity[0].what.identifier.type.coding[0].display == \"lobSTR\"\n    assert (\n        inst.entity[0].what.identifier.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://github.com/common-workflow-language/workflows\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.identifier.value == (\n        \"https://github.com/common-workflow-\"\n        \"language/workflows/blob/master/workflows/lobSTR/lobSTR-\"\n        \"workflow.cwl\"\n    )\n    assert inst.id == \"example-cwl\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurredPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-30\"}\n        ).valueDateTime\n    )\n    assert inst.reason[0].text == (\n        \"profiling Short Tandem Repeats (STRs) from high throughput \" \"sequencing data.\"\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-12-01T08:12:14+10:00\"}\n        ).valueInstant\n    )\n    assert inst.target[0].reference == \"MolecularSequence/example-pgx-1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_3(base_settings):\n    \"\"\"No. 3 tests collection for Provenance.\n    Test File: provenance-example-cwl.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"provenance-example-cwl.json\"\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_3(inst2)\n\n\ndef impl_provenance_4(inst):\n    assert inst.agent[0].type.coding[0].code == \"AUT\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.reference == \"Practitioner/example\"\n    assert inst.entity[0].role == \"source\"\n    assert inst.entity[0].what.identifier.type.coding[0].code == \"biocompute\"\n    assert inst.entity[0].what.identifier.type.coding[0].display == \"obj.1001\"\n    assert (\n        inst.entity[0].what.identifier.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://hive.biochemistry.gwu.edu\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.identifier.value == (\n        \"https://hive.biochemistry.gwu.edu/cgi-\"\n        \"bin/prd/htscsrs/servlet.cgi?pageid=bcoexample_1\"\n    )\n    assert inst.id == \"example-biocompute-object\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurredPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-06-06\"}\n        ).valueDateTime\n    )\n    assert inst.reason[0].text == \"antiviral resistance detection\"\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-06-09T08:12:14+10:00\"}\n        ).valueInstant\n    )\n    assert inst.target[0].reference == \"MolecularSequence/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_4(base_settings):\n    \"\"\"No. 4 tests collection for Provenance.\n    Test File: provenance-example-biocompute-object.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"provenance-example-biocompute-object.json\"\n    )\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_4(inst2)\n\n\ndef impl_provenance_5(inst):\n    assert inst.agent[0].type.coding[0].code == \"AUT\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.reference == \"Practitioner/xcda-author\"\n    assert inst.agent[1].id == \"a1\"\n    assert inst.agent[1].type.coding[0].code == \"DEV\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.reference == \"Device/software\"\n    assert inst.entity[0].role == \"source\"\n    assert inst.entity[0].what.display == \"CDA Document in XDS repository\"\n    assert inst.entity[0].what.reference == \"DocumentReference/example\"\n    assert inst.id == \"example\"\n    assert inst.location.reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurredPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-06-28\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurredPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-06-27\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.policy[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/fhir/Consent/25\"}\n        ).valueUri\n    )\n    assert inst.reason[0].coding[0].code == \"3457005\"\n    assert inst.reason[0].coding[0].display == \"Referral\"\n    assert (\n        inst.reason[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-06-27T08:39:24+10:00\"}\n        ).valueInstant\n    )\n    assert inst.target[0].reference == \"Procedure/example/_history/1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_5(base_settings):\n    \"\"\"No. 5 tests collection for Provenance.\n    Test File: provenance-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"provenance-example.json\"\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_5(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_questionnaire.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Questionnaire\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import questionnaire\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_questionnaire_1(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"Person-display\"\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].linkId == \"Person-flyover\"\n    assert inst.item[0].item[1].text == (\n        \"Demographics and administrative information about a person \"\n        \"independent of a specific health-related context.\"\n    )\n    assert inst.item[0].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"Person.id-flyover\"\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].item[1].linkId == \"Person.id.value\"\n    assert inst.item[0].item[2].item[1].repeats is False\n    assert inst.item[0].item[2].item[1].required is False\n    assert inst.item[0].item[2].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[2].linkId == \"Person.id\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].linkId == \"Person.meta-flyover\"\n    assert inst.item[0].item[3].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].linkId == \"Person.meta\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].text == \"Metadata about the resource\"\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].linkId == \"Person.implicitRules-flyover\"\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"Person.implicitRules.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert (\n        inst.item[0].item[4].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[4].item[1].type == \"string\"\n    assert inst.item[0].item[4].linkId == \"Person.implicitRules\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"Person.language-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].linkId == \"Person.language.value\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"language\"\n    assert inst.item[0].item[5].item[1].type == \"choice\"\n    assert inst.item[0].item[5].linkId == \"Person.language\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"Person.text-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"Person.text\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert (\n        inst.item[0].item[6].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"Person.contained-flyover\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"Person.contained\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].linkId == \"Person.extension-flyover\"\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"Person.extension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].linkId == \"Person.modifierExtension-flyover\"\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].linkId == \"Person.modifierExtension\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"Person\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"A generic person record\"\n    assert inst.item[0].type == \"group\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"Health Level Seven International (Patient Administration)\"\n    assert inst.status == \"draft\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_questionnaire_1(base_settings):\n    \"\"\"No. 1 tests collection for Questionnaire.\n    Test File: person-questionnaire.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-questionnaire.json\"\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_1(inst2)\n\n\ndef impl_questionnaire_2(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-10-09T00:00:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"DiagnosticReport-display\"\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].linkId == \"DiagnosticReport-flyover\"\n    assert inst.item[0].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"DiagnosticReport.id-flyover\"\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].item[1].linkId == \"DiagnosticReport.id.value\"\n    assert inst.item[0].item[2].item[1].repeats is False\n    assert inst.item[0].item[2].item[1].required is False\n    assert inst.item[0].item[2].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[2].linkId == \"DiagnosticReport.id\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].linkId == \"DiagnosticReport.meta-flyover\"\n    assert inst.item[0].item[3].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].linkId == \"DiagnosticReport.meta\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].text == \"Metadata about the resource\"\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].linkId == \"DiagnosticReport.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"DiagnosticReport.implicitRules.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert (\n        inst.item[0].item[4].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[4].item[1].type == \"string\"\n    assert inst.item[0].item[4].linkId == \"DiagnosticReport.implicitRules\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"DiagnosticReport.language-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].linkId == \"DiagnosticReport.language.value\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"language\"\n    assert inst.item[0].item[5].item[1].type == \"choice\"\n    assert inst.item[0].item[5].linkId == \"DiagnosticReport.language\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"DiagnosticReport.text-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"DiagnosticReport.text\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert (\n        inst.item[0].item[6].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"DiagnosticReport.contained-flyover\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"DiagnosticReport.contained\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].linkId == \"DiagnosticReport.extension-flyover\"\n    assert inst.item[0].item[8].item[0].text == \"An Extension\"\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"DiagnosticReport.extension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extension\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId\n        == \"DiagnosticReport.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].linkId == \"DiagnosticReport.modifierExtension\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"DiagnosticReport\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == (\n        \"A Diagnostic report - a combination of request information, \"\n        \"atomic results, images, interpretation, as well as formatted\"\n        \" reports\"\n    )\n    assert inst.item[0].type == \"group\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"Health Level Seven International (Clinical Genomics)\"\n    assert inst.status == \"draft\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_questionnaire_2(base_settings):\n    \"\"\"No. 2 tests collection for Questionnaire.\n    Test File: hlaresult-questionnaire.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"hlaresult-questionnaire.json\"\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_2(inst2)\n\n\ndef impl_questionnaire_3(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"OperationOutcome-display\"\n    assert inst.item[0].item[0].text == (\n        \"Can result from the failure of a REST call or be part of the\"\n        \" response message returned from a request message.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].linkId == \"OperationOutcome-flyover\"\n    assert inst.item[0].item[1].text == (\n        \"A collection of error, warning, or information messages that\"\n        \" result from a system action.\"\n    )\n    assert inst.item[0].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"OperationOutcome.id-flyover\"\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].item[1].linkId == \"OperationOutcome.id.value\"\n    assert inst.item[0].item[2].item[1].repeats is False\n    assert inst.item[0].item[2].item[1].required is False\n    assert inst.item[0].item[2].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[2].linkId == \"OperationOutcome.id\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].linkId == \"OperationOutcome.meta-flyover\"\n    assert inst.item[0].item[3].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].linkId == \"OperationOutcome.meta\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].text == \"Metadata about the resource\"\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].linkId == \"OperationOutcome.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"OperationOutcome.implicitRules.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert (\n        inst.item[0].item[4].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[4].item[1].type == \"string\"\n    assert inst.item[0].item[4].linkId == \"OperationOutcome.implicitRules\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"OperationOutcome.language-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].linkId == \"OperationOutcome.language.value\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"language\"\n    assert inst.item[0].item[5].item[1].type == \"choice\"\n    assert inst.item[0].item[5].linkId == \"OperationOutcome.language\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"OperationOutcome.text-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"OperationOutcome.text\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert (\n        inst.item[0].item[6].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"OperationOutcome.contained-flyover\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"OperationOutcome.contained\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].linkId == \"OperationOutcome.extension-flyover\"\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"OperationOutcome.extension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId\n        == \"OperationOutcome.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].linkId == \"OperationOutcome.modifierExtension\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"OperationOutcome\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Information about the success/failure of an action\"\n    assert inst.item[0].type == \"group\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.status == \"active\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_questionnaire_3(base_settings):\n    \"\"\"No. 3 tests collection for Questionnaire.\n    Test File: operationoutcome-questionnaire.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operationoutcome-questionnaire.json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_3(inst2)\n\n\ndef impl_questionnaire_4(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"EventDefinition-flyover\"\n    assert inst.item[0].item[0].text == (\n        \"The EventDefinition resource provides a reusable description\"\n        \" of when a particular event can occur.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].linkId == \"EventDefinition.id-flyover\"\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"EventDefinition.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"EventDefinition.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"EventDefinition.meta-flyover\"\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"EventDefinition.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].linkId == \"EventDefinition.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].item[1].linkId == \"EventDefinition.implicitRules.value\"\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"EventDefinition.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].linkId == \"EventDefinition.language-flyover\"\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"EventDefinition.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"choice\"\n    assert inst.item[0].item[4].linkId == \"EventDefinition.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"EventDefinition.text-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"EventDefinition.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"EventDefinition.contained-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"EventDefinition.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"EventDefinition.extension-flyover\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"EventDefinition.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].linkId\n        == \"EventDefinition.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"EventDefinition.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[9].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].linkId == \"EventDefinition.url-flyover\"\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[1].linkId == \"EventDefinition.url.value\"\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == (\n        \"Canonical identifier for this event definition, represented \"\n        \"as a URI (globally unique)\"\n    )\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"EventDefinition.url\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"EventDefinition\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"A description of when an event can occur\"\n    assert inst.item[0].type == \"group\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.publisher == \"Health Level Seven International (Clinical Decision Support)\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_questionnaire_4(base_settings):\n    \"\"\"No. 4 tests collection for Questionnaire.\n    Test File: eventdefinition-questionnaire.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"eventdefinition-questionnaire.json\"\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_4(inst2)\n\n\ndef impl_questionnaire_5(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"ActivityDefinition-flyover\"\n    assert inst.item[0].item[0].text == (\n        \"This resource allows for the definition of some activity to \"\n        \"be performed, independent of a particular patient, \"\n        \"practitioner, or other performance context.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].linkId == \"ActivityDefinition.id-flyover\"\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"ActivityDefinition.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"ActivityDefinition.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"ActivityDefinition.meta-flyover\"\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"ActivityDefinition.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].linkId\n        == \"ActivityDefinition.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[3].item[1].linkId == \"ActivityDefinition.implicitRules.value\"\n    )\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"ActivityDefinition.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].linkId == \"ActivityDefinition.language-flyover\"\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"ActivityDefinition.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"choice\"\n    assert inst.item[0].item[4].linkId == \"ActivityDefinition.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"ActivityDefinition.text-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"ActivityDefinition.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"ActivityDefinition.contained-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"ActivityDefinition.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"ActivityDefinition.extension-flyover\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"ActivityDefinition.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].linkId\n        == \"ActivityDefinition.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"ActivityDefinition.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[9].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].linkId == \"ActivityDefinition.url-flyover\"\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[1].linkId == \"ActivityDefinition.url.value\"\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == (\n        \"Canonical identifier for this activity definition, \"\n        \"represented as a URI (globally unique)\"\n    )\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"ActivityDefinition.url\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"ActivityDefinition\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == (\n        \"The definition of a specific activity to be taken, \"\n        \"independent of any particular patient or context\"\n    )\n    assert inst.item[0].type == \"group\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.publisher == \"Health Level Seven International (Clinical Decision Support)\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_questionnaire_5(base_settings):\n    \"\"\"No. 5 tests collection for Questionnaire.\n    Test File: activitydefinition-questionnaire.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"activitydefinition-questionnaire.json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_5(inst2)\n\n\ndef impl_questionnaire_6(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].extension[1].valueInteger == 1\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"GuidanceResponse-flyover\"\n    assert inst.item[0].item[0].text == (\n        \"A guidance response is the formal response to a guidance \"\n        \"request, including any output parameters returned by the \"\n        \"evaluation, as well as the description of any proposed \"\n        \"actions to be taken.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].linkId == \"GuidanceResponse.id-flyover\"\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"GuidanceResponse.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"GuidanceResponse.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"GuidanceResponse.meta-flyover\"\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"GuidanceResponse.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].linkId == \"GuidanceResponse.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].item[1].linkId == \"GuidanceResponse.implicitRules.value\"\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"GuidanceResponse.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].linkId == \"GuidanceResponse.language-flyover\"\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"GuidanceResponse.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"choice\"\n    assert inst.item[0].item[4].linkId == \"GuidanceResponse.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"GuidanceResponse.text-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"GuidanceResponse.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"GuidanceResponse.contained-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"GuidanceResponse.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"GuidanceResponse.extension-flyover\"\n    assert inst.item[0].item[7].item[0].text == \"An Extension\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"GuidanceResponse.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Extension\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].linkId\n        == \"GuidanceResponse.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"GuidanceResponse.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[9].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[1].valueInteger == 1\n    assert (\n        inst.item[0].item[9].extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[2].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId\n        == \"GuidanceResponse.requestIdentifier-flyover\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[9].item[1].linkId\n        == \"GuidanceResponse.requestIdentifier.label\"\n    )\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[2].linkId\n        == \"GuidanceResponse.requestIdentifier.system\"\n    )\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[3].linkId\n        == \"GuidanceResponse.requestIdentifier.value\"\n    )\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"GuidanceResponse.requestIdentifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is True\n    assert inst.item[0].item[9].text == (\n        \"The identifier of the request associated with this response,\" \" if any\"\n    )\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"GuidanceResponse\"\n    assert inst.item[0].repeats is False\n    assert inst.item[0].required is True\n    assert inst.item[0].text == \"The formal response to a guidance request\"\n    assert inst.item[0].type == \"group\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"HL7\"\n    assert inst.status == \"draft\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_questionnaire_6(base_settings):\n    \"\"\"No. 6 tests collection for Questionnaire.\n    Test File: cdshooksguidanceresponse-questionnaire.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"cdshooksguidanceresponse-questionnaire.json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_6(inst2)\n\n\ndef impl_questionnaire_7(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"SearchParameter-display\"\n    assert inst.item[0].item[0].text == (\n        \"In FHIR, search is not performed directly on a resource (by \"\n        \"XML or JSON path), but on a named parameter that maps into \"\n        \"the resource content.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].linkId == \"SearchParameter-flyover\"\n    assert inst.item[0].item[1].text == (\n        \"A search parameter that defines a named search item that can\"\n        \" be used to search/filter on a resource.\"\n    )\n    assert inst.item[0].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"SearchParameter.id-flyover\"\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].item[1].linkId == \"SearchParameter.id.value\"\n    assert inst.item[0].item[2].item[1].repeats is False\n    assert inst.item[0].item[2].item[1].required is False\n    assert inst.item[0].item[2].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[2].linkId == \"SearchParameter.id\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].linkId == \"SearchParameter.meta-flyover\"\n    assert inst.item[0].item[3].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].linkId == \"SearchParameter.meta\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].text == \"Metadata about the resource\"\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].linkId == \"SearchParameter.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"SearchParameter.implicitRules.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert (\n        inst.item[0].item[4].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[4].item[1].type == \"string\"\n    assert inst.item[0].item[4].linkId == \"SearchParameter.implicitRules\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"SearchParameter.language-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].linkId == \"SearchParameter.language.value\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"language\"\n    assert inst.item[0].item[5].item[1].type == \"choice\"\n    assert inst.item[0].item[5].linkId == \"SearchParameter.language\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"SearchParameter.text-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"SearchParameter.text\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert (\n        inst.item[0].item[6].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"SearchParameter.contained-flyover\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"SearchParameter.contained\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].linkId == \"SearchParameter.extension-flyover\"\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"SearchParameter.extension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId\n        == \"SearchParameter.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].linkId == \"SearchParameter.modifierExtension\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"SearchParameter\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Search parameter for a resource\"\n    assert inst.item[0].type == \"group\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.status == \"draft\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_questionnaire_7(base_settings):\n    \"\"\"No. 7 tests collection for Questionnaire.\n    Test File: searchparameter-questionnaire.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"searchparameter-questionnaire.json\"\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_7(inst2)\n\n\ndef impl_questionnaire_8(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert inst.contained[3].id == \"vs5\"\n    assert inst.contained[4].id == \"vs6\"\n    assert inst.contained[5].id == \"vs7\"\n    assert inst.contained[6].id == \"vs8\"\n    assert inst.contained[7].id == \"vs9\"\n    assert inst.contained[8].id == \"vs10\"\n    assert inst.contained[9].id == \"vs11\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"ExplanationOfBenefit-flyover\"\n    assert inst.item[0].item[0].text == (\n        \"This resource provides: the claim details; adjudication \"\n        \"details from the processing of a Claim; and optionally \"\n        \"account balance information, for informing the subscriber of\"\n        \" the benefits provided.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].linkId == \"ExplanationOfBenefit.id-flyover\"\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"ExplanationOfBenefit.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"ExplanationOfBenefit.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"ExplanationOfBenefit.meta-flyover\"\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"ExplanationOfBenefit.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].linkId\n        == \"ExplanationOfBenefit.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[3].item[1].linkId\n        == \"ExplanationOfBenefit.implicitRules.value\"\n    )\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"ExplanationOfBenefit.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].linkId == \"ExplanationOfBenefit.language-flyover\"\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"ExplanationOfBenefit.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"choice\"\n    assert inst.item[0].item[4].linkId == \"ExplanationOfBenefit.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"ExplanationOfBenefit.text-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"ExplanationOfBenefit.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].linkId == \"ExplanationOfBenefit.contained-flyover\"\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"ExplanationOfBenefit.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].linkId == \"ExplanationOfBenefit.extension-flyover\"\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"ExplanationOfBenefit.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].linkId\n        == \"ExplanationOfBenefit.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"ExplanationOfBenefit.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId == \"ExplanationOfBenefit.identifier-flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].text\n        == \"A unique identifier assigned to this explanation of benefit.\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[9].item[1].linkId == \"ExplanationOfBenefit.identifier.label\"\n    )\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[2].linkId == \"ExplanationOfBenefit.identifier.system\"\n    )\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[3].linkId == \"ExplanationOfBenefit.identifier.value\"\n    )\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"ExplanationOfBenefit.identifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Business Identifier for the resource\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"ExplanationOfBenefit\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Explanation of Benefit resource\"\n    assert inst.item[0].type == \"group\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"Health Level Seven International (Financial Management)\"\n    assert inst.status == \"draft\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_questionnaire_8(base_settings):\n    \"\"\"No. 8 tests collection for Questionnaire.\n    Test File: explanationofbenefit-questionnaire.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"explanationofbenefit-questionnaire.json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_8(inst2)\n\n\ndef impl_questionnaire_9(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"ImmunizationEvaluation-flyover\"\n    assert inst.item[0].item[0].text == (\n        \"Describes a comparison of an immunization event against \"\n        \"published recommendations to determine if the administration\"\n        ' is \"valid\" in relation to those  recommendations.'\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].linkId == \"ImmunizationEvaluation.id-flyover\"\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"ImmunizationEvaluation.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"ImmunizationEvaluation.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"ImmunizationEvaluation.meta-flyover\"\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"ImmunizationEvaluation.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].linkId\n        == \"ImmunizationEvaluation.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[3].item[1].linkId\n        == \"ImmunizationEvaluation.implicitRules.value\"\n    )\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"ImmunizationEvaluation.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].linkId == \"ImmunizationEvaluation.language-flyover\"\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[4].item[1].linkId == \"ImmunizationEvaluation.language.value\"\n    )\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"choice\"\n    assert inst.item[0].item[4].linkId == \"ImmunizationEvaluation.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"ImmunizationEvaluation.text-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"ImmunizationEvaluation.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].linkId\n        == \"ImmunizationEvaluation.contained-flyover\"\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"ImmunizationEvaluation.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].linkId\n        == \"ImmunizationEvaluation.extension-flyover\"\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"ImmunizationEvaluation.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].linkId\n        == \"ImmunizationEvaluation.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"ImmunizationEvaluation.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId\n        == \"ImmunizationEvaluation.identifier-flyover\"\n    )\n    assert inst.item[0].item[9].item[0].text == (\n        \"A unique identifier assigned to this immunization evaluation\" \" record.\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[9].item[1].linkId == \"ImmunizationEvaluation.identifier.label\"\n    )\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[2].linkId\n        == \"ImmunizationEvaluation.identifier.system\"\n    )\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[3].linkId == \"ImmunizationEvaluation.identifier.value\"\n    )\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"ImmunizationEvaluation.identifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Business identifier\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"ImmunizationEvaluation\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Immunization evaluation information\"\n    assert inst.item[0].type == \"group\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == (\n        \"Health Level Seven International (Public Health and \" \"Emergency Response)\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_questionnaire_9(base_settings):\n    \"\"\"No. 9 tests collection for Questionnaire.\n    Test File: immunizationevaluation-questionnaire.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"immunizationevaluation-questionnaire.json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_9(inst2)\n\n\ndef impl_questionnaire_10(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"CoverageEligibilityResponse-flyover\"\n    assert inst.item[0].item[0].text == (\n        \"This resource provides eligibility and plan details from the\"\n        \" processing of an CoverageEligibilityRequest resource.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].linkId == \"CoverageEligibilityResponse.id-flyover\"\n    )\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"CoverageEligibilityResponse.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"CoverageEligibilityResponse.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].linkId\n        == \"CoverageEligibilityResponse.meta-flyover\"\n    )\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"CoverageEligibilityResponse.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].linkId\n        == \"CoverageEligibilityResponse.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[3].item[1].linkId\n        == \"CoverageEligibilityResponse.implicitRules.value\"\n    )\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"CoverageEligibilityResponse.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].linkId\n        == \"CoverageEligibilityResponse.language-flyover\"\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[4].item[1].linkId\n        == \"CoverageEligibilityResponse.language.value\"\n    )\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"choice\"\n    assert inst.item[0].item[4].linkId == \"CoverageEligibilityResponse.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].linkId\n        == \"CoverageEligibilityResponse.text-flyover\"\n    )\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"CoverageEligibilityResponse.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].linkId\n        == \"CoverageEligibilityResponse.contained-flyover\"\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"CoverageEligibilityResponse.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].linkId\n        == \"CoverageEligibilityResponse.extension-flyover\"\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"CoverageEligibilityResponse.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].linkId\n        == \"CoverageEligibilityResponse.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[8].linkId == \"CoverageEligibilityResponse.modifierExtension\"\n    )\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId\n        == \"CoverageEligibilityResponse.identifier-flyover\"\n    )\n    assert inst.item[0].item[9].item[0].text == (\n        \"A unique identifier assigned to this coverage eligiblity \" \"request.\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[9].item[1].linkId\n        == \"CoverageEligibilityResponse.identifier.label\"\n    )\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[2].linkId\n        == \"CoverageEligibilityResponse.identifier.system\"\n    )\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[3].linkId\n        == \"CoverageEligibilityResponse.identifier.value\"\n    )\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"CoverageEligibilityResponse.identifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert (\n        inst.item[0].item[9].text\n        == \"Business Identifier for coverage eligiblity request\"\n    )\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"CoverageEligibilityResponse\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"CoverageEligibilityResponse resource\"\n    assert inst.item[0].type == \"group\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"Health Level Seven International (Financial Management)\"\n    assert inst.status == \"draft\"\n    assert inst.version == \"4.3.0\"\n\n\ndef test_questionnaire_10(base_settings):\n    \"\"\"No. 10 tests collection for Questionnaire.\n    Test File: coverageeligibilityresponse-questionnaire.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"coverageeligibilityresponse-questionnaire.json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_questionnaireresponse.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import questionnaireresponse\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_questionnaireresponse_1(inst):\n    assert inst.author.reference == \"#questauth\"\n    assert (\n        inst.authored\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-02-19T14:15:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].reference == \"#order\"\n    assert inst.contained[0].id == \"patsub\"\n    assert inst.contained[1].id == \"order\"\n    assert inst.contained[2].id == \"questauth\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"3141\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/NamingSystem/questionnaire-ids\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"Q12349876\"\n    assert (\n        inst.item[0].item[0].answer[0].item[0].item[0].answer[0].valueCoding.code == \"1\"\n    )\n    assert (\n        inst.item[0].item[0].answer[0].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://cancer.questionnaire.org/system/code/yesno\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].answer[0].item[0].item[0].linkId == \"1.1.1.1\"\n    assert (\n        inst.item[0].item[0].answer[0].item[0].item[1].answer[0].valueCoding.code == \"1\"\n    )\n    assert (\n        inst.item[0].item[0].answer[0].item[0].item[1].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://cancer.questionnaire.org/system/code/yesno\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].answer[0].item[0].item[1].linkId == \"1.1.1.2\"\n    assert (\n        inst.item[0].item[0].answer[0].item[0].item[2].answer[0].valueCoding.code == \"0\"\n    )\n    assert (\n        inst.item[0].item[0].answer[0].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://cancer.questionnaire.org/system/code/yesno\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].answer[0].item[0].item[2].linkId == \"1.1.1.3\"\n    assert inst.item[0].item[0].answer[0].item[0].linkId == \"1.1.1\"\n    assert inst.item[0].item[0].answer[0].valueCoding.code == \"1\"\n    assert inst.item[0].item[0].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://cancer.questionnaire.org/system/code/yesno\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"1.1\"\n    assert inst.item[0].linkId == \"1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.partOf[0].reference == \"Procedure/f201\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"#patsub\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_questionnaireresponse_1(base_settings):\n    \"\"\"No. 1 tests collection for QuestionnaireResponse.\n    Test File: questionnaireresponse-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"questionnaireresponse-example.json\"\n    inst = questionnaireresponse.QuestionnaireResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"QuestionnaireResponse\" == inst.get_resource_type()\n\n    impl_questionnaireresponse_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"QuestionnaireResponse\" == data[\"resourceType\"]\n\n    inst2 = questionnaireresponse.QuestionnaireResponse(**data)\n    impl_questionnaireresponse_1(inst2)\n\n\ndef impl_questionnaireresponse_2(inst):\n    assert (\n        inst.authored\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2008-01-17\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"ussg-fht-answers\"\n    assert (\n        inst.item[0].item[0].answer[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2008-01-17\"}).valueDate\n    )\n    assert inst.item[0].item[0].linkId == \"0.1\"\n    assert inst.item[0].item[0].text == \"Date Done\"\n    assert inst.item[0].linkId == \"0\"\n    assert (\n        inst.item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54126-8\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[0].answer[0].valueString == \"Annie Proband\"\n    assert (\n        inst.item[1].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54125-0\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[0].linkId == \"1.1.1\"\n    assert inst.item[1].item[0].item[0].text == \"Name\"\n    assert inst.item[1].item[0].item[1].answer[0].valueCoding.code == \"LA3-6\"\n    assert inst.item[1].item[0].item[1].answer[0].valueCoding.display == \"Female\"\n    assert (\n        inst.item[1].item[0].item[1].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[1].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54131-8\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[1].linkId == \"1.1.2\"\n    assert inst.item[1].item[0].item[1].text == \"Gender\"\n    assert (\n        inst.item[1].item[0].item[2].answer[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1966-04-04\"}).valueDate\n    )\n    assert (\n        inst.item[1].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/21112-8\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[2].linkId == \"1.1.3\"\n    assert inst.item[1].item[0].item[2].text == \"Date of Birth\"\n    assert inst.item[1].item[0].item[3].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[1].item[0].item[3].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[1].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[1].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54132-6\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[3].linkId == \"1.1.4\"\n    assert inst.item[1].item[0].item[3].text == \"Were you born a twin?\"\n    assert inst.item[1].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[1].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[1].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[1].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54128-4\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[4].linkId == \"1.1.5\"\n    assert inst.item[1].item[0].item[4].text == \"Were you adopted?\"\n    assert inst.item[1].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[1].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[1].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[1].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54135-9\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[5].linkId == \"1.1.6\"\n    assert inst.item[1].item[0].item[5].text == (\n        \"Are your parents related to each other in any way other than\" \" marriage?\"\n    )\n    assert (\n        inst.item[1]\n        .item[0]\n        .item[6]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.code\n        == \"[in_i]\"\n    )\n    assert (\n        inst.item[1]\n        .item[0]\n        .item[6]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.display\n        == \"inches\"\n    )\n    assert (\n        inst.item[1]\n        .item[0]\n        .item[6]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[6].answer[0].item[0].item[0].linkId == \"1.1.7.1.1\"\n    assert inst.item[1].item[0].item[6].answer[0].item[0].item[0].text == \"Units\"\n    assert inst.item[1].item[0].item[6].answer[0].item[0].linkId == \"1.1.7.1\"\n    assert float(inst.item[1].item[0].item[6].answer[0].valueDecimal) == float(63)\n    assert (\n        inst.item[1].item[0].item[6].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/8302-2\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[6].linkId == \"1.1.7\"\n    assert inst.item[1].item[0].item[6].text == \"Height\"\n    assert (\n        inst.item[1]\n        .item[0]\n        .item[7]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.code\n        == \"[lb_av]\"\n    )\n    assert (\n        inst.item[1]\n        .item[0]\n        .item[7]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.display\n        == \"pounds\"\n    )\n    assert (\n        inst.item[1]\n        .item[0]\n        .item[7]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[7].answer[0].item[0].item[0].linkId == \"1.1.8.1.1\"\n    assert inst.item[1].item[0].item[7].answer[0].item[0].item[0].text == \"Units\"\n    assert inst.item[1].item[0].item[7].answer[0].item[0].linkId == \"1.1.8.1\"\n    assert float(inst.item[1].item[0].item[7].answer[0].valueDecimal) == float(127)\n    assert (\n        inst.item[1].item[0].item[7].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/29463-7\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[7].linkId == \"1.1.8\"\n    assert inst.item[1].item[0].item[7].text == \"Weight\"\n    assert float(inst.item[1].item[0].item[8].answer[0].valueDecimal) == float(22.5)\n    assert (\n        inst.item[1].item[0].item[8].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/39156-5\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[8].linkId == \"1.1.9\"\n    assert inst.item[1].item[0].item[8].text == \"Body mass index (BMI) [Ratio]\"\n    assert inst.item[1].item[0].item[9].answer[0].valueCoding.code == \"LA4457-3\"\n    assert inst.item[1].item[0].item[9].answer[0].valueCoding.display == \"White\"\n    assert (\n        inst.item[1].item[0].item[9].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[1].item[0].item[9].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54134-2\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[9].linkId == \"1.1.10\"\n    assert inst.item[1].item[0].item[9].text == \"Race\"\n    assert inst.item[1].item[0].linkId == \"1.1\"\n    assert inst.item[1].linkId == \"1\"\n    assert inst.item[1].text == \"Your health information\"\n    assert (\n        inst.item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54114-4\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[0].answer[0].valueCoding.code == \"LA10405-1\"\n    assert inst.item[2].item[0].item[0].answer[0].valueCoding.display == \"Daughter\"\n    assert (\n        inst.item[2].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[0].item[1].answer[0].valueString == \"Susan\"\n    assert (\n        inst.item[2].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[0].item[2].answer[0].valueCoding.code == \"LA3-6\"\n    assert inst.item[2].item[0].item[2].answer[0].valueCoding.display == \"Female\"\n    assert (\n        inst.item[2].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2].item[0].item[3].answer[0].item[0].item[0].answer[0].valueDecimal\n    ) == float(17)\n    assert (\n        inst.item[2].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[0].item[3].answer[0].item[0].item[0].linkId == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[0].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[1].item[0].item[0].answer[0].valueCoding.code == \"LA10415-0\"\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[0].answer[0].valueCoding.display == \"Brother\"\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[1].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[1].item[0].item[1].answer[0].valueString == \"Brian\"\n    assert (\n        inst.item[2].item[1].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[1].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[1].item[0].item[2].answer[0].valueCoding.code == \"LA2-8\"\n    assert inst.item[2].item[1].item[0].item[2].answer[0].valueCoding.display == \"Male\"\n    assert (\n        inst.item[2].item[1].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[1].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[1]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(32)\n    assert (\n        inst.item[2].item[1].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[1].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[1].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[1].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[1].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[1].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[1].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[1].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[1].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[1].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[1].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[1].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[1].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[1].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[1].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[1].item[0].linkId == \"2.1.1\"\n    assert (\n        inst.item[2].item[1].item[1].item[0].answer[0].valueCoding.code == \"LA10550-4\"\n    )\n    assert (\n        inst.item[2].item[1].item[1].item[0].answer[0].valueCoding.display\n        == \"-- Other Cancer\"\n    )\n    assert (\n        inst.item[2].item[1].item[1].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[1].item[0].linkId == \"2.1.2.1\"\n    assert inst.item[2].item[1].item[1].item[0].text == \"Disease or Condition\"\n    assert (\n        inst.item[2].item[1].item[1].item[1].answer[0].valueCoding.code == \"LA10397-0\"\n    )\n    assert inst.item[2].item[1].item[1].item[1].answer[0].valueCoding.display == \"30-39\"\n    assert (\n        inst.item[2].item[1].item[1].item[1].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[1].item[1].linkId == \"2.1.2.2\"\n    assert inst.item[2].item[1].item[1].item[1].text == \"Age at Diagnosis\"\n    assert inst.item[2].item[1].item[1].linkId == \"2.1.2\"\n    assert (\n        inst.item[2].item[1].item[1].text == \"This family member's history of disease\"\n    )\n    assert inst.item[2].item[1].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[2].item[0].item[0].answer[0].valueCoding.code == \"LA10418-4\"\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[0].answer[0].valueCoding.display == \"Sister\"\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[2].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[2].item[0].item[1].answer[0].valueString == \"Janet\"\n    assert (\n        inst.item[2].item[2].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[2].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[2].item[0].item[2].answer[0].valueCoding.code == \"LA3-6\"\n    assert (\n        inst.item[2].item[2].item[0].item[2].answer[0].valueCoding.display == \"Female\"\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[2].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[2]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(36)\n    assert (\n        inst.item[2].item[2].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[2].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[2].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[2].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[2].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[2].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[2].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[2].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[2].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[2].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[2].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[2].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[2].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[2].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[2].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[2].item[0].linkId == \"2.1.1\"\n    assert (\n        inst.item[2].item[2].item[1].item[0].answer[0].valueCoding.code == \"LA10536-3\"\n    )\n    assert (\n        inst.item[2].item[2].item[1].item[0].answer[0].valueCoding.display\n        == \"-- Breast Cancer\"\n    )\n    assert (\n        inst.item[2].item[2].item[1].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[1].item[0].linkId == \"2.1.2.1\"\n    assert inst.item[2].item[2].item[1].item[0].text == \"Disease or Condition\"\n    assert (\n        inst.item[2].item[2].item[1].item[1].answer[0].valueCoding.code == \"LA10397-0\"\n    )\n    assert inst.item[2].item[2].item[1].item[1].answer[0].valueCoding.display == \"30-39\"\n    assert (\n        inst.item[2].item[2].item[1].item[1].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[1].item[1].linkId == \"2.1.2.2\"\n    assert inst.item[2].item[2].item[1].item[1].text == \"Age at Diagnosis\"\n    assert inst.item[2].item[2].item[1].linkId == \"2.1.2\"\n    assert (\n        inst.item[2].item[2].item[1].text == \"This family member's history of disease\"\n    )\n    assert inst.item[2].item[2].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[3].item[0].item[0].answer[0].valueCoding.code == \"LA10419-2\"\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[0].answer[0].valueCoding.display == \"Nephew\"\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[3].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[3].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[3].item[0].item[1].answer[0].valueString == \"Ian\"\n    assert (\n        inst.item[2].item[3].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[3].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[3].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[3].item[0].item[2].answer[0].valueCoding.code == \"LA2-8\"\n    assert inst.item[2].item[3].item[0].item[2].answer[0].valueCoding.display == \"Male\"\n    assert (\n        inst.item[2].item[3].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[3].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[3].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[3]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(16)\n    assert (\n        inst.item[2].item[3].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[3].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[3].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[3].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[3].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[3].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[3].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[3].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[3].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[3].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[3].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[3].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[3].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[3].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[3].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[3].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[3].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[3].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[3].item[0].linkId == \"2.1.1\"\n    assert inst.item[2].item[3].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[4].item[0].item[0].answer[0].valueCoding.code == \"LA10420-0\"\n    )\n    assert inst.item[2].item[4].item[0].item[0].answer[0].valueCoding.display == \"Niece\"\n    assert (\n        inst.item[2].item[4].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[4].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[4].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[4].item[0].item[1].answer[0].valueString == \"Helen\"\n    assert (\n        inst.item[2].item[4].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[4].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[4].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[4].item[0].item[2].answer[0].valueCoding.code == \"LA3-6\"\n    assert (\n        inst.item[2].item[4].item[0].item[2].answer[0].valueCoding.display == \"Female\"\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[4].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[4].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[4]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(15)\n    assert (\n        inst.item[2].item[4].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[4].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[4].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[4].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[4].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[4].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[4].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[4].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[4].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[4].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[4].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[4].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[4].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[4].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[4].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[4].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[4].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[4].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[4].item[0].linkId == \"2.1.1\"\n    assert inst.item[2].item[4].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[5].item[0].item[0].answer[0].valueCoding.code == \"LA10416-8\"\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[0].answer[0].valueCoding.display == \"Father\"\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[5].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[5].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[5].item[0].item[1].answer[0].valueString == \"Donald\"\n    assert (\n        inst.item[2].item[5].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[5].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[5].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[5].item[0].item[2].answer[0].valueCoding.code == \"LA2-8\"\n    assert inst.item[2].item[5].item[0].item[2].answer[0].valueCoding.display == \"Male\"\n    assert (\n        inst.item[2].item[5].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[5].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[5].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[5]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(52)\n    assert (\n        inst.item[2].item[5].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[5].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[5].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[5].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[5].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[5].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[5].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[5].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[5].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[5].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[5].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[5].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[5].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[5].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[5].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[5].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[5].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[5].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[5].item[0].linkId == \"2.1.1\"\n    assert inst.item[2].item[5].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[6].item[0].item[0].answer[0].valueCoding.code == \"LA10425-9\"\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[0].answer[0].valueCoding.display\n        == \"Paternal Uncle\"\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[6].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[6].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[6].item[0].item[1].answer[0].valueString == \"Eric\"\n    assert (\n        inst.item[2].item[6].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[6].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[6].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[6].item[0].item[2].answer[0].valueCoding.code == \"LA2-8\"\n    assert inst.item[2].item[6].item[0].item[2].answer[0].valueCoding.display == \"Male\"\n    assert (\n        inst.item[2].item[6].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[6].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[6].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[6]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(56)\n    assert (\n        inst.item[2].item[6].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[6].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[6].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[6].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[6].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[6].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[6].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[6].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[6].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[6].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[6].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[6].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[6].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[6].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[6].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[6].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[6].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[6].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[6].item[0].linkId == \"2.1.1\"\n    assert inst.item[2].item[6].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[7].item[0].item[0].answer[0].valueCoding.code == \"LA10421-8\"\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[0].answer[0].valueCoding.display\n        == \"Paternal Aunt\"\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[7].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[7].item[0].item[1].answer[0].valueString == \"Fiona\"\n    assert (\n        inst.item[2].item[7].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[7].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[7].item[0].item[2].answer[0].valueCoding.code == \"LA3-6\"\n    assert (\n        inst.item[2].item[7].item[0].item[2].answer[0].valueCoding.display == \"Female\"\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[7].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[7]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(57)\n    assert (\n        inst.item[2].item[7].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[7].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[7].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[7].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[7].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[7].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[7].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[7].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[7].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[7].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[7].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[7].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[7].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[7].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[7].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[7].item[0].linkId == \"2.1.1\"\n    assert (\n        inst.item[2].item[7].item[1].item[0].answer[0].valueCoding.code == \"LA10543-9\"\n    )\n    assert (\n        inst.item[2].item[7].item[1].item[0].answer[0].valueCoding.display\n        == \"-- Skin Cancer\"\n    )\n    assert (\n        inst.item[2].item[7].item[1].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[1].item[0].linkId == \"2.1.2.1\"\n    assert inst.item[2].item[7].item[1].item[0].text == \"Disease or Condition\"\n    assert inst.item[2].item[7].item[1].linkId == \"2.1.2\"\n    assert (\n        inst.item[2].item[7].item[1].text == \"This family member's history of disease\"\n    )\n    assert inst.item[2].item[7].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[8].item[0].item[0].answer[0].valueCoding.code == \"LA10423-4\"\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[0].answer[0].valueCoding.display\n        == \"Paternal Grandfather\"\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[8].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[8].item[0].item[1].answer[0].valueString == \"Bob\"\n    assert (\n        inst.item[2].item[8].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[8].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[8].item[0].item[2].answer[0].valueCoding.code == \"LA2-8\"\n    assert inst.item[2].item[8].item[0].item[2].answer[0].valueCoding.display == \"Male\"\n    assert (\n        inst.item[2].item[8].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[8].item[0].item[2].text == \"Gender\"\n    assert (\n        inst.item[2]\n        .item[8]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.code\n        == \"LA10537-1\"\n    )\n    assert (\n        inst.item[2]\n        .item[8]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.display\n        == \"-- Colon Cancer\"\n    )\n    assert (\n        inst.item[2]\n        .item[8]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54112-8\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.1.1\"\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[0].text\n        == \"Cause of Death\"\n    )\n    assert (\n        inst.item[2]\n        .item[8]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[1]\n        .answer[0]\n        .valueCoding.code\n        == \"LA10400-2\"\n    )\n    assert (\n        inst.item[2]\n        .item[8]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[1]\n        .answer[0]\n        .valueCoding.display\n        == \"OVER 60\"\n    )\n    assert (\n        inst.item[2]\n        .item[8]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[1]\n        .answer[0]\n        .valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54113-6\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[1].linkId\n        == \"2.1.1.4.1.2\"\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[1].text\n        == \"Age at Death\"\n    )\n    assert inst.item[2].item[8].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.1\"\n    assert inst.item[2].item[8].item[0].item[3].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[8].item[0].item[3].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[8].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[8].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[8].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[8].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[8].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[8].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[8].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[8].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[8].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[8].item[0].linkId == \"2.1.1\"\n    assert (\n        inst.item[2].item[8].item[1].item[0].answer[0].valueCoding.code == \"LA10537-1\"\n    )\n    assert (\n        inst.item[2].item[8].item[1].item[0].answer[0].valueCoding.display\n        == \"-- Colon Cancer\"\n    )\n    assert (\n        inst.item[2].item[8].item[1].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[1].item[0].linkId == \"2.1.2.1\"\n    assert inst.item[2].item[8].item[1].item[0].text == \"Disease or Condition\"\n    assert (\n        inst.item[2].item[8].item[1].item[1].answer[0].valueCoding.code == \"LA10400-2\"\n    )\n    assert (\n        inst.item[2].item[8].item[1].item[1].answer[0].valueCoding.display == \"OVER 60\"\n    )\n    assert (\n        inst.item[2].item[8].item[1].item[1].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[1].item[1].linkId == \"2.1.2.2\"\n    assert inst.item[2].item[8].item[1].item[1].text == \"Age at Diagnosis\"\n    assert inst.item[2].item[8].item[1].linkId == \"2.1.2\"\n    assert (\n        inst.item[2].item[8].item[1].text == \"This family member's history of disease\"\n    )\n    assert inst.item[2].item[8].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[9].item[0].item[0].answer[0].valueCoding.code == \"LA10424-2\"\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[0].answer[0].valueCoding.display\n        == \"Paternal Grandmother\"\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[9].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[9].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[9].item[0].item[1].answer[0].valueString == \"Claire\"\n    assert (\n        inst.item[2].item[9].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[9].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[9].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[9].item[0].item[2].answer[0].valueCoding.code == \"LA3-6\"\n    assert (\n        inst.item[2].item[9].item[0].item[2].answer[0].valueCoding.display == \"Female\"\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[9].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[9].item[0].item[2].text == \"Gender\"\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .item[0]\n        .answer[0]\n        .valueString\n        == \"Lou Gehrigs\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .item[0]\n        .linkId\n        == \"2.1.1.4.1.1.1\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .item[0]\n        .text\n        == \"Please specify\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.code\n        == \"LA10589-2\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.display\n        == \"-- Other/Unexpected\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54112-8\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.1.1\"\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[0].text\n        == \"Cause of Death\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[1]\n        .answer[0]\n        .valueCoding.code\n        == \"LA10400-2\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[1]\n        .answer[0]\n        .valueCoding.display\n        == \"OVER 60\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[1]\n        .answer[0]\n        .valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54113-6\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[1].linkId\n        == \"2.1.1.4.1.2\"\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[1].text\n        == \"Age at Death\"\n    )\n    assert inst.item[2].item[9].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.1\"\n    assert inst.item[2].item[9].item[0].item[3].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[9].item[0].item[3].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[9].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[9].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[9].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[9].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[9].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[9].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[9].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[9].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[9].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[9].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[9].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[9].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[9].item[0].linkId == \"2.1.1\"\n    assert inst.item[2].item[9].linkId == \"2.1\"\n    assert inst.item[2].linkId == \"2\"\n    assert inst.item[2].text == \"Family member health information\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.questionnaire == \"http://hl7.org/fhir/Questionnaire/ussg-fht\"\n    assert inst.status == \"in-progress\"\n    assert inst.subject.reference == \"http://hl7.org/fhir/Patient/proband\"\n    assert (\n        inst.subject.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_questionnaireresponse_2(base_settings):\n    \"\"\"No. 2 tests collection for QuestionnaireResponse.\n    Test File: questionnaireresponse-example-ussg-fht-answers.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaireresponse-example-ussg-fht-answers.json\"\n    )\n    inst = questionnaireresponse.QuestionnaireResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"QuestionnaireResponse\" == inst.get_resource_type()\n\n    impl_questionnaireresponse_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"QuestionnaireResponse\" == data[\"resourceType\"]\n\n    inst2 = questionnaireresponse.QuestionnaireResponse(**data)\n    impl_questionnaireresponse_2(inst2)\n\n\ndef impl_questionnaireresponse_3(inst):\n    assert inst.author.reference == \"Practitioner/f201\"\n    assert (\n        inst.authored\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-06-18T00:00:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"f201\"\n    assert inst.item[0].item[0].answer[0].valueString == \"I am allergic to house dust\"\n    assert inst.item[0].item[0].linkId == \"1.1\"\n    assert inst.item[0].item[0].text == \"Do you have allergies?\"\n    assert inst.item[0].linkId == \"1\"\n    assert inst.item[1].item[0].answer[0].valueString == \"Male\"\n    assert inst.item[1].item[0].linkId == \"2.1\"\n    assert inst.item[1].item[0].text == \"What is your gender?\"\n    assert (\n        inst.item[1].item[1].answer[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1960-03-13\"}).valueDate\n    )\n    assert inst.item[1].item[1].linkId == \"2.2\"\n    assert inst.item[1].item[1].text == \"What is your date of birth?\"\n    assert inst.item[1].item[2].answer[0].valueString == \"The Netherlands\"\n    assert inst.item[1].item[2].linkId == \"2.3\"\n    assert inst.item[1].item[2].text == \"What is your country of birth?\"\n    assert inst.item[1].item[3].answer[0].valueString == \"married\"\n    assert inst.item[1].item[3].linkId == \"2.4\"\n    assert inst.item[1].item[3].text == \"What is your marital status?\"\n    assert inst.item[1].linkId == \"2\"\n    assert inst.item[1].text == \"General questions\"\n    assert inst.item[2].item[0].answer[0].valueString == \"No\"\n    assert inst.item[2].item[0].linkId == \"3.1\"\n    assert inst.item[2].item[0].text == \"Do you smoke?\"\n    assert inst.item[2].item[1].answer[0].valueString == \"No, but I used to drink\"\n    assert inst.item[2].item[1].linkId == \"3.2\"\n    assert inst.item[2].item[1].text == \"Do you drink alchohol?\"\n    assert inst.item[2].linkId == \"3\"\n    assert inst.item[2].text == \"Intoxications\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.source.reference == \"Practitioner/f201\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_questionnaireresponse_3(base_settings):\n    \"\"\"No. 3 tests collection for QuestionnaireResponse.\n    Test File: questionnaireresponse-example-f201-lifelines.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaireresponse-example-f201-lifelines.json\"\n    )\n    inst = questionnaireresponse.QuestionnaireResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"QuestionnaireResponse\" == inst.get_resource_type()\n\n    impl_questionnaireresponse_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"QuestionnaireResponse\" == data[\"resourceType\"]\n\n    inst2 = questionnaireresponse.QuestionnaireResponse(**data)\n    impl_questionnaireresponse_3(inst2)\n\n\ndef impl_questionnaireresponse_4(inst):\n    assert inst.author.reference == \"http://hl7.org/fhir/Practitioner/example\"\n    assert (\n        inst.author.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Practitioner\"}).valueUri\n    )\n    assert (\n        inst.authored\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-02-19T14:15:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"bb\"\n    assert inst.item[0].item[0].item[0].answer[0].valueString == \"Cathy Jones\"\n    assert inst.item[0].item[0].item[0].linkId == \"nameOfChild\"\n    assert inst.item[0].item[0].item[0].text == \"Name of child\"\n    assert inst.item[0].item[0].item[1].answer[0].valueCoding.code == \"f\"\n    assert inst.item[0].item[0].item[1].linkId == \"sex\"\n    assert inst.item[0].item[0].item[1].text == \"Sex\"\n    assert inst.item[0].item[0].linkId == \"group\"\n    assert float(inst.item[0].item[1].item[0].answer[0].valueDecimal) == float(3.25)\n    assert inst.item[0].item[1].item[0].linkId == \"birthWeight\"\n    assert inst.item[0].item[1].item[0].text == \"Birth weight (kg)\"\n    assert float(inst.item[0].item[1].item[1].answer[0].valueDecimal) == float(44.3)\n    assert inst.item[0].item[1].item[1].linkId == \"birthLength\"\n    assert inst.item[0].item[1].item[1].text == \"Birth length (cm)\"\n    assert (\n        inst.item[0].item[1].item[2].answer[0].item[0].item[0].answer[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1972-11-30\"}).valueDate\n    )\n    assert (\n        inst.item[0].item[1].item[2].answer[0].item[0].item[0].linkId == \"vitaminKDose1\"\n    )\n    assert inst.item[0].item[1].item[2].answer[0].item[0].item[0].text == \"1st dose\"\n    assert (\n        inst.item[0].item[1].item[2].answer[0].item[0].item[1].answer[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1972-12-11\"}).valueDate\n    )\n    assert (\n        inst.item[0].item[1].item[2].answer[0].item[0].item[1].linkId == \"vitaminKDose2\"\n    )\n    assert inst.item[0].item[1].item[2].answer[0].item[0].item[1].text == \"2nd dose\"\n    assert inst.item[0].item[1].item[2].answer[0].item[0].linkId == \"vitaminKgivenDoses\"\n    assert inst.item[0].item[1].item[2].answer[0].valueCoding.code == \"INJECTION\"\n    assert inst.item[0].item[1].item[2].linkId == \"vitaminKgiven\"\n    assert inst.item[0].item[1].item[2].text == \"Vitamin K given\"\n    assert (\n        inst.item[0].item[1].item[3].answer[0].item[0].answer[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1972-12-04\"}).valueDate\n    )\n    assert inst.item[0].item[1].item[3].answer[0].item[0].linkId == \"hepBgivenDate\"\n    assert inst.item[0].item[1].item[3].answer[0].item[0].text == \"Date given\"\n    assert inst.item[0].item[1].item[3].answer[0].valueBoolean is True\n    assert inst.item[0].item[1].item[3].linkId == \"hepBgiven\"\n    assert inst.item[0].item[1].item[3].text == \"Hep B given y / n\"\n    assert (\n        inst.item[0].item[1].item[4].answer[0].valueString\n        == \"Already able to speak Chinese\"\n    )\n    assert inst.item[0].item[1].item[4].linkId == \"abnormalitiesAtBirth\"\n    assert inst.item[0].item[1].item[4].text == \"Abnormalities noted at birth\"\n    assert inst.item[0].item[1].linkId == \"neonatalInformation\"\n    assert inst.item[0].item[1].text == \"Neonatal Information\"\n    assert inst.item[0].linkId == \"birthDetails\"\n    assert inst.item[0].text == \"Birth details - To be completed by health professional\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"http://hl7.org/fhir/Patient/1\"\n    assert (\n        inst.subject.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_questionnaireresponse_4(base_settings):\n    \"\"\"No. 4 tests collection for QuestionnaireResponse.\n    Test File: questionnaireresponse-example-bluebook.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaireresponse-example-bluebook.json\"\n    )\n    inst = questionnaireresponse.QuestionnaireResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"QuestionnaireResponse\" == inst.get_resource_type()\n\n    impl_questionnaireresponse_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"QuestionnaireResponse\" == data[\"resourceType\"]\n\n    inst2 = questionnaireresponse.QuestionnaireResponse(**data)\n    impl_questionnaireresponse_4(inst2)\n\n\ndef impl_questionnaireresponse_5(inst):\n    assert (\n        inst.authored\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-11T04:44:16Z\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"gcs\"\n    assert inst.item[0].answer[0].valueCoding.code == \"LA6560-2\"\n    assert inst.item[0].answer[0].valueCoding.display == \"Confused\"\n    assert (\n        inst.item[0].answer[0].valueCoding.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/ordinalValue\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].answer[0].valueCoding.extension[0].valueDecimal) == float(\n        4\n    )\n    assert (\n        inst.item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[0].linkId == \"1.1\"\n    assert inst.item[1].answer[0].valueCoding.code == \"LA6566-9\"\n    assert inst.item[1].answer[0].valueCoding.display == \"Localizing pain\"\n    assert (\n        inst.item[1].answer[0].valueCoding.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/ordinalValue\"}\n        ).valueUri\n    )\n    assert float(inst.item[1].answer[0].valueCoding.extension[0].valueDecimal) == float(\n        5\n    )\n    assert (\n        inst.item[1].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[1].linkId == \"1.2\"\n    assert inst.item[2].answer[0].valueCoding.code == \"LA6556-0\"\n    assert inst.item[2].answer[0].valueCoding.display == \"Eyes open spontaneously\"\n    assert (\n        inst.item[2].answer[0].valueCoding.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/ordinalValue\"}\n        ).valueUri\n    )\n    assert float(inst.item[2].answer[0].valueCoding.extension[0].valueDecimal) == float(\n        4\n    )\n    assert (\n        inst.item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].linkId == \"1.3\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.questionnaire == \"http://hl7.org/fhir/Questionnaire/gcs\"\n    assert inst.source.reference == \"Practitioner/f007\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_questionnaireresponse_5(base_settings):\n    \"\"\"No. 5 tests collection for QuestionnaireResponse.\n    Test File: questionnaireresponse-example-gcs.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"questionnaireresponse-example-gcs.json\"\n    )\n    inst = questionnaireresponse.QuestionnaireResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"QuestionnaireResponse\" == inst.get_resource_type()\n\n    impl_questionnaireresponse_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"QuestionnaireResponse\" == data[\"resourceType\"]\n\n    inst2 = questionnaireresponse.QuestionnaireResponse(**data)\n    impl_questionnaireresponse_5(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_regulatedauthorization.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RegulatedAuthorization\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import regulatedauthorization\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_regulatedauthorization_1(inst):\n    assert inst.holder.display == \"EquiliDrugCo Holdings Inc.\"\n    assert inst.holder.reference == \"Organization/EqlidrugCo\"\n    assert inst.id == \"basic-drug-auth\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.regulator.display == \"FDA\"\n    assert inst.regulator.reference == \"Organization/FDA\"\n    assert inst.status.coding[0].code == \"active\"\n    assert (\n        inst.statusDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.subject[0].reference == \"MedicinalProductDefinition/equilidem\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.text == \"Regulatory Drug Marketing Approval\"\n\n\ndef test_regulatedauthorization_1(base_settings):\n    \"\"\"No. 1 tests collection for RegulatedAuthorization.\n    Test File: regulatedauthorization-example-basic-drug-auth.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"regulatedauthorization-example-basic-drug-auth.json\"\n    )\n    inst = regulatedauthorization.RegulatedAuthorization.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"RegulatedAuthorization\" == inst.get_resource_type()\n\n    impl_regulatedauthorization_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RegulatedAuthorization\" == data[\"resourceType\"]\n\n    inst2 = regulatedauthorization.RegulatedAuthorization(**data)\n    impl_regulatedauthorization_1(inst2)\n\n\ndef impl_regulatedauthorization_2(inst):\n    assert (\n        inst.case.application[0].dateDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.case.application[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/applicationidentifier-number\"}\n        ).valueUri\n    )\n    assert inst.case.application[0].identifier.value == \"IA38G\"\n    assert (\n        inst.case.application[0].type.coding[0].code\n        == \"GroupTypeIAVariationNotification\"\n    )\n    assert (\n        inst.case.application[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://ema.europa.eu/example/marketingAuthorisationApplicationType\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.case.application[1].dateDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.case.application[1].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/applicationidentifier-number\"}\n        ).valueUri\n    )\n    assert inst.case.application[1].identifier.value == \"IA38F\"\n    assert (\n        inst.case.application[1].type.coding[0].code\n        == \"GroupTypeIAVariationNotification\"\n    )\n    assert (\n        inst.case.application[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://ema.europa.eu/example/marketingAuthorisationApplicationType\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.case.datePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-21\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.case.datePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-02\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.case.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/procedureidentifier-number\"}\n        ).valueUri\n    )\n    assert inst.case.identifier.value == \"EMEA/H/C/009999/IA/0099/G\"\n    assert inst.case.type.coding[0].code == \"VariationTypeIA\"\n    assert (\n        inst.case.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://ema.europa.eu/example/marketingAuthorisationProcedureType\"\n            }\n        ).valueUri\n    )\n    assert inst.holder.reference == \"Organization/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/marketingAuthorisationNumber\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"EU/1/11/999/001\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.region[0].coding[0].code == \"EU\"\n    assert (\n        inst.region[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/country\"}\n        ).valueUri\n    )\n    assert inst.regulator.reference == \"Organization/example\"\n    assert inst.status.coding[0].code == \"active\"\n    assert (\n        inst.status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/authorisationstatus\"}\n        ).valueUri\n    )\n    assert (\n        inst.statusDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-14\"}\n        ).valueDateTime\n    )\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-05-20\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-03\"}\n        ).valueDateTime\n    )\n\n\ndef test_regulatedauthorization_2(base_settings):\n    \"\"\"No. 2 tests collection for RegulatedAuthorization.\n    Test File: regulatedauthorization-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"regulatedauthorization-example.json\"\n    )\n    inst = regulatedauthorization.RegulatedAuthorization.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"RegulatedAuthorization\" == inst.get_resource_type()\n\n    impl_regulatedauthorization_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RegulatedAuthorization\" == data[\"resourceType\"]\n\n    inst2 = regulatedauthorization.RegulatedAuthorization(**data)\n    impl_regulatedauthorization_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_relatedperson.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RelatedPerson\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import relatedperson\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_relatedperson_1(inst):\n    assert inst.address[0].city == \"PleasantVille\"\n    assert inst.address[0].line[0] == \"534 Erewhon St\"\n    assert inst.address[0].postalCode == \"3999\"\n    assert inst.address[0].state == \"Vic\"\n    assert inst.address[0].use == \"home\"\n    assert inst.gender == \"male\"\n    assert inst.id == \"peter\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Chalmers\"\n    assert inst.name[0].given[0] == \"Peter\"\n    assert inst.name[0].given[1] == \"James\"\n    assert inst.name[0].use == \"official\"\n    assert inst.patient.reference == \"Patient/animal\"\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-03-11\"}\n        ).valueDateTime\n    )\n    assert inst.photo[0].contentType == \"image/jpeg\"\n    assert (\n        inst.photo[0].url\n        == ExternalValidatorModel.model_validate({\"valueUrl\": \"Binary/f012\"}).valueUrl\n    )\n    assert inst.relationship[0].coding[0].code == \"C\"\n    assert (\n        inst.relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0131\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"(03) 5555 6473\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_relatedperson_1(base_settings):\n    \"\"\"No. 1 tests collection for RelatedPerson.\n    Test File: relatedperson-example-peter.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"relatedperson-example-peter.json\"\n    inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes())\n    assert \"RelatedPerson\" == inst.get_resource_type()\n\n    impl_relatedperson_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RelatedPerson\" == data[\"resourceType\"]\n\n    inst2 = relatedperson.RelatedPerson(**data)\n    impl_relatedperson_1(inst2)\n\n\ndef impl_relatedperson_2(inst):\n    assert inst.gender == \"female\"\n    assert inst.id == \"f001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"BSN\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Abels\"\n    assert inst.name[0].given[0] == \"Sarah\"\n    assert inst.name[0].use == \"usual\"\n    assert inst.patient.reference == \"Patient/f001\"\n    assert inst.relationship[0].coding[0].code == \"SIGOTHR\"\n    assert (\n        inst.relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"mobile\"\n    assert inst.telecom[0].value == \"0690383372\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"home\"\n    assert inst.telecom[1].value == \"s.abels@kpn.nl\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_relatedperson_2(base_settings):\n    \"\"\"No. 2 tests collection for RelatedPerson.\n    Test File: relatedperson-example-f001-sarah.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"relatedperson-example-f001-sarah.json\"\n    )\n    inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes())\n    assert \"RelatedPerson\" == inst.get_resource_type()\n\n    impl_relatedperson_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RelatedPerson\" == data[\"resourceType\"]\n\n    inst2 = relatedperson.RelatedPerson(**data)\n    impl_relatedperson_2(inst2)\n\n\ndef impl_relatedperson_3(inst):\n    assert inst.active is True\n    assert inst.address[0].line[0] == \"2222 Home Street\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1973-05-31\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"newborn-mom\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/us-ssn\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"SS\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"444222222\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Everywoman\"\n    assert inst.name[0].given[0] == \"Eve\"\n    assert inst.name[0].use == \"official\"\n    assert inst.patient.reference == \"Patient/newborn\"\n    assert inst.relationship[0].coding[0].code == \"NMTH\"\n    assert inst.relationship[0].coding[0].display == \"natural mother\"\n    assert (\n        inst.relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.relationship[0].text == \"Natural Mother\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"555-555-2003\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_relatedperson_3(base_settings):\n    \"\"\"No. 3 tests collection for RelatedPerson.\n    Test File: relatedperson-example-newborn-mom.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"relatedperson-example-newborn-mom.json\"\n    )\n    inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes())\n    assert \"RelatedPerson\" == inst.get_resource_type()\n\n    impl_relatedperson_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RelatedPerson\" == data[\"resourceType\"]\n\n    inst2 = relatedperson.RelatedPerson(**data)\n    impl_relatedperson_3(inst2)\n\n\ndef impl_relatedperson_4(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Paris\"\n    assert inst.address[0].country == \"FRA\"\n    assert inst.address[0].line[0] == \"43, Place du Marché Sainte Catherine\"\n    assert inst.address[0].postalCode == \"75004\"\n    assert inst.gender == \"female\"\n    assert inst.id == \"benedicte\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.250.1.61\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"INSEE\"\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"272117510400399\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"du Marché\"\n    assert inst.name[0].given[0] == \"Bénédicte\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.photo[0].contentType == \"image/jpeg\"\n    assert (\n        inst.photo[0].url\n        == ExternalValidatorModel.model_validate({\"valueUrl\": \"Binary/f016\"}).valueUrl\n    )\n    assert inst.relationship[0].coding[0].code == \"N\"\n    assert (\n        inst.relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0131\"}\n        ).valueUri\n    )\n    assert inst.relationship[0].coding[1].code == \"WIFE\"\n    assert (\n        inst.relationship[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].value == \"+33 (237) 998327\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_relatedperson_4(base_settings):\n    \"\"\"No. 4 tests collection for RelatedPerson.\n    Test File: relatedperson-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"relatedperson-example.json\"\n    inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes())\n    assert \"RelatedPerson\" == inst.get_resource_type()\n\n    impl_relatedperson_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RelatedPerson\" == data[\"resourceType\"]\n\n    inst2 = relatedperson.RelatedPerson(**data)\n    impl_relatedperson_4(inst2)\n\n\ndef impl_relatedperson_5(inst):\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1963\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"f002\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].text == \"Ariadne Bor-Jansma\"\n    assert inst.name[0].use == \"usual\"\n    assert inst.patient.reference == \"Patient/f201\"\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1975\"}\n        ).valueDateTime\n    )\n    assert inst.photo[0].contentType == \"image/jpeg\"\n    assert inst.relationship[0].coding[0].code == \"SIGOTHR\"\n    assert (\n        inst.relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"home\"\n    assert inst.telecom[0].value == \"+31201234567\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_relatedperson_5(base_settings):\n    \"\"\"No. 5 tests collection for RelatedPerson.\n    Test File: relatedperson-example-f002-ariadne.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"relatedperson-example-f002-ariadne.json\"\n    )\n    inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes())\n    assert \"RelatedPerson\" == inst.get_resource_type()\n\n    impl_relatedperson_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RelatedPerson\" == data[\"resourceType\"]\n\n    inst2 = relatedperson.RelatedPerson(**data)\n    impl_relatedperson_5(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_requestgroup.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RequestGroup\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import requestgroup\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_requestgroup_1(inst):\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[0]\n        .url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"day\"}).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[0]\n        .valueInteger\n        == 1\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[1]\n        .url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"day\"}).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[1]\n        .valueInteger\n        == 8\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle\"}\n        ).valueUri\n    )\n    assert inst.action[0].action[0].action[0].action[0].action[0].id == \"action-1\"\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[0].resource.reference\n        == \"#1111\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[0].textEquivalent\n        == \"Gemcitabine 1250 mg/m² IV over 30 minutes on days 1 and 8\"\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[1]\n        .extension[0]\n        .extension[0]\n        .url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"day\"}).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[1]\n        .extension[0]\n        .extension[0]\n        .valueInteger\n        == 1\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle\"}\n        ).valueUri\n    )\n    assert inst.action[0].action[0].action[0].action[0].action[1].id == \"action-2\"\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].relatedAction[0].actionId\n        == \"action-1\"\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[1]\n        .relatedAction[0]\n        .relationship\n        == \"concurrent-with-start\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].resource.reference\n        == \"#2222\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].textEquivalent\n        == \"CARBOplatin AUC 5 IV over 30 minutes on Day 1\"\n    )\n    assert inst.action[0].action[0].action[0].action[0].id == \"cycle-definition-1\"\n    assert (\n        inst.action[0].action[0].action[0].action[0].textEquivalent\n        == \"21-day cycle for 6 cycles\"\n    )\n    assert inst.action[0].action[0].action[0].action[0].timingTiming.repeat.count == 6\n    assert float(\n        inst.action[0].action[0].action[0].action[0].timingTiming.repeat.duration\n    ) == float(21)\n    assert (\n        inst.action[0].action[0].action[0].action[0].timingTiming.repeat.durationUnit\n        == \"d\"\n    )\n    assert inst.action[0].action[0].action[0].groupingBehavior == \"sentence-group\"\n    assert inst.action[0].action[0].action[0].selectionBehavior == \"exactly-one\"\n    assert inst.action[0].action[0].selectionBehavior == \"all\"\n    assert inst.action[0].selectionBehavior == \"exactly-one\"\n    assert inst.author.reference == \"Practitioner/1\"\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-06T17:31:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"1111\"\n    assert inst.contained[1].id == \"2222\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"kdn5-example\"\n    assert inst.identifier[0].value == \"requestgroup-kdn5\"\n    assert (\n        inst.instantiatesCanonical[0] == \"http://example.org/fhir/PlanDefinition/KDN5\"\n    )\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.priority == \"routine\"\n    assert inst.status == \"draft\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Administer '\n        \"gemcitabine and carboplatin.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_requestgroup_1(base_settings):\n    \"\"\"No. 1 tests collection for RequestGroup.\n    Test File: requestgroup-kdn5-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"requestgroup-kdn5-example.json\"\n    inst = requestgroup.RequestGroup.model_validate_json(filename.read_bytes())\n    assert \"RequestGroup\" == inst.get_resource_type()\n\n    impl_requestgroup_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RequestGroup\" == data[\"resourceType\"]\n\n    inst2 = requestgroup.RequestGroup(**data)\n    impl_requestgroup_1(inst2)\n\n\ndef impl_requestgroup_2(inst):\n    assert inst.action[0].action[0].description == \"Administer medication 1\"\n    assert inst.action[0].action[0].id == \"medication-action-1\"\n    assert inst.action[0].action[0].resource.reference == \"#medicationrequest-1\"\n    assert inst.action[0].action[0].type.coding[0].code == \"create\"\n    assert inst.action[0].action[1].description == \"Administer medication 2\"\n    assert inst.action[0].action[1].id == \"medication-action-2\"\n    assert inst.action[0].action[1].relatedAction[0].actionId == \"medication-action-1\"\n    assert inst.action[0].action[1].relatedAction[0].offsetDuration.code == \"h\"\n    assert (\n        inst.action[0].action[1].relatedAction[0].offsetDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.action[0].action[1].relatedAction[0].offsetDuration.unit == \"h\"\n    assert float(\n        inst.action[0].action[1].relatedAction[0].offsetDuration.value\n    ) == float(1)\n    assert inst.action[0].action[1].relatedAction[0].relationship == \"after-end\"\n    assert inst.action[0].action[1].resource.reference == \"#medicationrequest-2\"\n    assert inst.action[0].action[1].type.coding[0].code == \"create\"\n    assert inst.action[0].cardinalityBehavior == \"single\"\n    assert (\n        inst.action[0].description == \"Administer medications at the appropriate time\"\n    )\n    assert inst.action[0].groupingBehavior == \"logical-group\"\n    assert inst.action[0].participant[0].reference == \"Practitioner/1\"\n    assert inst.action[0].precheckBehavior == \"yes\"\n    assert inst.action[0].prefix == \"1\"\n    assert inst.action[0].requiredBehavior == \"must\"\n    assert inst.action[0].selectionBehavior == \"all\"\n    assert inst.action[0].textEquivalent == (\n        \"Administer medication 1, followed an hour later by \" \"medication 2\"\n    )\n    assert (\n        inst.action[0].timingDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-06T19:00:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.action[0].title == \"Administer Medications\"\n    assert inst.author.reference == \"Practitioner/1\"\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-06T17:31:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"medicationrequest-1\"\n    assert inst.contained[1].id == \"medicationrequest-2\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/treatment-group\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.value == \"00001\"\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"requestgroup-1\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Additional notes about the request group\"\n    assert inst.priority == \"routine\"\n    assert inst.reasonCode[0].text == \"Treatment\"\n    assert inst.status == \"draft\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Example '\n        \"RequestGroup illustrating related actions to administer \"\n        \"medications in sequence with time delay.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_requestgroup_2(base_settings):\n    \"\"\"No. 2 tests collection for RequestGroup.\n    Test File: requestgroup-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"requestgroup-example.json\"\n    inst = requestgroup.RequestGroup.model_validate_json(filename.read_bytes())\n    assert \"RequestGroup\" == inst.get_resource_type()\n\n    impl_requestgroup_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RequestGroup\" == data[\"resourceType\"]\n\n    inst2 = requestgroup.RequestGroup(**data)\n    impl_requestgroup_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_researchdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import researchdefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_researchdefinition_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.population.reference == \"ResearchElementDefinition/example\"\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_researchdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ResearchDefinition.\n    Test File: researchdefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"researchdefinition-example.json\"\n    inst = researchdefinition.ResearchDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ResearchDefinition\" == inst.get_resource_type()\n\n    impl_researchdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ResearchDefinition\" == data[\"resourceType\"]\n\n    inst2 = researchdefinition.ResearchDefinition(**data)\n    impl_researchdefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_researchelementdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import researchelementdefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_researchelementdefinition_1(inst):\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.text\n        == \"Diabetic patients over 65\"\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"population\"\n\n\ndef test_researchelementdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ResearchElementDefinition.\n    Test File: researchelementdefinition-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"researchelementdefinition-example.json\"\n    )\n    inst = researchelementdefinition.ResearchElementDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ResearchElementDefinition\" == inst.get_resource_type()\n\n    impl_researchelementdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ResearchElementDefinition\" == data[\"resourceType\"]\n\n    inst2 = researchelementdefinition.ResearchElementDefinition(**data)\n    impl_researchelementdefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_researchstudy.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchStudy\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import researchstudy\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_researchstudy_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_researchstudy_1(base_settings):\n    \"\"\"No. 1 tests collection for ResearchStudy.\n    Test File: researchstudy-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"researchstudy-example.json\"\n    inst = researchstudy.ResearchStudy.model_validate_json(filename.read_bytes())\n    assert \"ResearchStudy\" == inst.get_resource_type()\n\n    impl_researchstudy_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ResearchStudy\" == data[\"resourceType\"]\n\n    inst2 = researchstudy.ResearchStudy(**data)\n    impl_researchstudy_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_researchsubject.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchSubject\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import researchsubject\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_researchsubject_1(inst):\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/studysubjectids\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"Subject id\"\n    assert inst.identifier[0].value == \"123\"\n    assert inst.individual.reference == \"Patient/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"candidate\"\n    assert inst.study.reference == \"ResearchStudy/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_researchsubject_1(base_settings):\n    \"\"\"No. 1 tests collection for ResearchSubject.\n    Test File: researchsubject-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"researchsubject-example.json\"\n    inst = researchsubject.ResearchSubject.model_validate_json(filename.read_bytes())\n    assert \"ResearchSubject\" == inst.get_resource_type()\n\n    impl_researchsubject_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ResearchSubject\" == data[\"resourceType\"]\n\n    inst2 = researchsubject.ResearchSubject(**data)\n    impl_researchsubject_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_riskassessment.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RiskAssessment\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import riskassessment\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_riskassessment_1(inst):\n    assert inst.contained[0].id == \"group1\"\n    assert inst.id == \"population\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"#group1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_riskassessment_1(base_settings):\n    \"\"\"No. 1 tests collection for RiskAssessment.\n    Test File: riskassessment-example-population.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"riskassessment-example-population.json\"\n    )\n    inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes())\n    assert \"RiskAssessment\" == inst.get_resource_type()\n\n    impl_riskassessment_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RiskAssessment\" == data[\"resourceType\"]\n\n    inst2 = riskassessment.RiskAssessment(**data)\n    impl_riskassessment_1(inst2)\n\n\ndef impl_riskassessment_2(inst):\n    assert inst.basis[0].reference == \"Patient/pat2\"\n    assert inst.basis[1].reference == \"DiagnosticReport/lipids\"\n    assert inst.basis[2].reference == \"Observation/blood-pressure\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"cardiac\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"risk-assessment-cardiac\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-07-19T16:04:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.performer.display == \"http://cvdrisk.nhlbi.nih.gov/#cholesterol\"\n    assert inst.prediction[0].outcome.text == \"Heart Attack\"\n    assert float(inst.prediction[0].probabilityDecimal) == float(0.02)\n    assert inst.prediction[0].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[0].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[0].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[0].whenRange.high.value) == float(49)\n    assert inst.prediction[0].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[0].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[0].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[0].whenRange.low.value) == float(39)\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/pat2\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_riskassessment_2(base_settings):\n    \"\"\"No. 2 tests collection for RiskAssessment.\n    Test File: riskassessment-example-cardiac.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"riskassessment-example-cardiac.json\"\n    )\n    inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes())\n    assert \"RiskAssessment\" == inst.get_resource_type()\n\n    impl_riskassessment_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RiskAssessment\" == data[\"resourceType\"]\n\n    inst2 = riskassessment.RiskAssessment(**data)\n    impl_riskassessment_2(inst2)\n\n\ndef impl_riskassessment_3(inst):\n    assert inst.basis[0].reference == \"List/prognosis\"\n    assert inst.id == \"genetic\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.method.coding[0].code == \"BRCAPRO\"\n    assert inst.note[0].text == \"High degree of certainty\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2006-01-13T23:01:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.prediction[0].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[0].probabilityDecimal) == float(0.000168)\n    assert inst.prediction[0].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[0].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[0].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[0].whenRange.high.value) == float(53)\n    assert inst.prediction[1].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[1].probabilityDecimal) == float(0.000368)\n    assert inst.prediction[1].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[1].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[1].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[1].whenRange.high.value) == float(57)\n    assert inst.prediction[1].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[1].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[1].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[1].whenRange.low.value) == float(54)\n    assert inst.prediction[2].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[2].probabilityDecimal) == float(0.000594)\n    assert inst.prediction[2].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[2].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[2].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[2].whenRange.high.value) == float(62)\n    assert inst.prediction[2].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[2].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[2].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[2].whenRange.low.value) == float(58)\n    assert inst.prediction[3].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[3].probabilityDecimal) == float(0.000838)\n    assert inst.prediction[3].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[3].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[3].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[3].whenRange.high.value) == float(67)\n    assert inst.prediction[3].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[3].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[3].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[3].whenRange.low.value) == float(63)\n    assert inst.prediction[4].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[4].probabilityDecimal) == float(0.001089)\n    assert inst.prediction[4].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[4].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[4].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[4].whenRange.high.value) == float(72)\n    assert inst.prediction[4].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[4].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[4].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[4].whenRange.low.value) == float(68)\n    assert inst.prediction[5].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[5].probabilityDecimal) == float(0.001327)\n    assert inst.prediction[5].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[5].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[5].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[5].whenRange.high.value) == float(77)\n    assert inst.prediction[5].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[5].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[5].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[5].whenRange.low.value) == float(73)\n    assert inst.prediction[6].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[6].probabilityDecimal) == float(0.00153)\n    assert inst.prediction[6].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[6].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[6].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[6].whenRange.high.value) == float(82)\n    assert inst.prediction[6].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[6].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[6].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[6].whenRange.low.value) == float(78)\n    assert inst.prediction[7].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[7].probabilityDecimal) == float(0.001663)\n    assert inst.prediction[7].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[7].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[7].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[7].whenRange.high.value) == float(88)\n    assert inst.prediction[7].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[7].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[7].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[7].whenRange.low.value) == float(83)\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/b248b1b2-1686-4b94-9936-37d7a5f94b51\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_riskassessment_3(base_settings):\n    \"\"\"No. 3 tests collection for RiskAssessment.\n    Test File: riskassessment-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"riskassessment-example.json\"\n    inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes())\n    assert \"RiskAssessment\" == inst.get_resource_type()\n\n    impl_riskassessment_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RiskAssessment\" == data[\"resourceType\"]\n\n    inst2 = riskassessment.RiskAssessment(**data)\n    impl_riskassessment_3(inst2)\n\n\ndef impl_riskassessment_4(inst):\n    assert inst.basedOn.reference == \"ImmunizationRecommendation/example\"\n    assert inst.basis[0].reference == \"DiagnosticReport/example\"\n    assert inst.basis[1].reference == \"Observation/example\"\n    assert inst.code.coding[0].code == \"709510001\"\n    assert inst.code.coding[0].display == \"Assessment of risk for disease (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://browser.ihtsdotools.org/\"}\n        ).valueUri\n    )\n    assert inst.condition.reference == \"Condition/example\"\n    assert inst.encounter.display == \"Encounter with patient @example\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"riskexample\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"risk-assessment-breastcancer1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"This risk assessment is for reference only\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-10-10\"}\n        ).valueDateTime\n    )\n    assert inst.parent.reference == \"DiagnosticReport/example\"\n    assert inst.performer.reference == \"Practitioner/example\"\n    assert inst.prediction[0].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[0].probabilityDecimal) == float(0.000368)\n    assert inst.prediction[0].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[0].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[0].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[0].whenRange.high.value) == float(57)\n    assert inst.prediction[0].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[0].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[0].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[0].whenRange.low.value) == float(54)\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Risk assessment '\n        \"for reference only</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_riskassessment_4(base_settings):\n    \"\"\"No. 4 tests collection for RiskAssessment.\n    Test File: riskassessment-riskexample.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"riskassessment-riskexample.json\"\n    inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes())\n    assert \"RiskAssessment\" == inst.get_resource_type()\n\n    impl_riskassessment_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RiskAssessment\" == data[\"resourceType\"]\n\n    inst2 = riskassessment.RiskAssessment(**data)\n    impl_riskassessment_4(inst2)\n\n\ndef impl_riskassessment_5(inst):\n    assert inst.basis[0].reference == \"Observation/example-genetics-brcapat\"\n    assert inst.code.coding[0].code == \"709510001\"\n    assert inst.code.coding[0].display == \"Assessment of risk for disease (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://browser.ihtsdotools.org/\"}\n        ).valueUri\n    )\n    assert inst.id == \"breastcancer-risk\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"risk-assessment-breastcancer1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"This risk assessment is based on BRCA1 and BRCA2 genetic \" \"mutation test\"\n    )\n    assert inst.performer.reference == \"Practitioner/example\"\n    assert inst.prediction[0].outcome.text == \"Unknown risk of developing breast cancer\"\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_riskassessment_5(base_settings):\n    \"\"\"No. 5 tests collection for RiskAssessment.\n    Test File: riskassessment-example-breastcancer.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"riskassessment-example-breastcancer.json\"\n    )\n    inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes())\n    assert \"RiskAssessment\" == inst.get_resource_type()\n\n    impl_riskassessment_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RiskAssessment\" == data[\"resourceType\"]\n\n    inst2 = riskassessment.RiskAssessment(**data)\n    impl_riskassessment_5(inst2)\n\n\ndef impl_riskassessment_6(inst):\n    assert inst.condition.display == \"Ischemic Stroke\"\n    assert inst.condition.reference == \"Condition/stroke\"\n    assert inst.id == \"prognosis\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-11-22\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.prediction[0].outcome.coding[0].code\n        == \"249943000:363698007=72098002,260868000=6934004\"\n    )\n    assert (\n        inst.prediction[0].outcome.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.prediction[0].outcome.text == \"permanent weakness of the left arm\"\n    assert inst.prediction[0].qualitativeRisk.coding[0].code == \"moderate\"\n    assert inst.prediction[0].qualitativeRisk.coding[0].display == \"moderate likelihood\"\n    assert (\n        inst.prediction[0].qualitativeRisk.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/risk-probability\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_riskassessment_6(base_settings):\n    \"\"\"No. 6 tests collection for RiskAssessment.\n    Test File: riskassessment-example-prognosis.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"riskassessment-example-prognosis.json\"\n    )\n    inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes())\n    assert \"RiskAssessment\" == inst.get_resource_type()\n\n    impl_riskassessment_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RiskAssessment\" == data[\"resourceType\"]\n\n    inst2 = riskassessment.RiskAssessment(**data)\n    impl_riskassessment_6(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_schedule.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Schedule\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import schedule\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_schedule_1(inst):\n    assert inst.active is True\n    assert inst.actor[0].display == \"Dr. Beverly Crusher\"\n    assert inst.actor[0].reference == \"Practitioner/1\"\n    assert inst.actor[1].display == \"USS Enterprise-D Sickbay\"\n    assert inst.actor[1].reference == \"Location/3\"\n    assert inst.comment == (\n        \"The slots attached to this schedule are for genetic \"\n        \"counselling in the USS Enterprise-D Sickbay.\"\n    )\n    assert inst.id == \"exampleloc1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/scheduleid\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"46\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.planningHorizon.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-25T09:30:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.planningHorizon.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-25T09:15:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.serviceCategory[0].coding[0].code == \"17\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert inst.serviceType[0].coding[0].code == \"75\"\n    assert inst.serviceType[0].coding[0].display == \"Genetic Counselling\"\n    assert inst.specialty[0].coding[0].code == \"394580004\"\n    assert inst.specialty[0].coding[0].display == \"Clinical genetics\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_schedule_1(base_settings):\n    \"\"\"No. 1 tests collection for Schedule.\n    Test File: schedule-provider-location1-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"schedule-provider-location1-example.json\"\n    )\n    inst = schedule.Schedule.model_validate_json(filename.read_bytes())\n    assert \"Schedule\" == inst.get_resource_type()\n\n    impl_schedule_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Schedule\" == data[\"resourceType\"]\n\n    inst2 = schedule.Schedule(**data)\n    impl_schedule_1(inst2)\n\n\ndef impl_schedule_2(inst):\n    assert inst.active is True\n    assert inst.actor[0].display == \"Burgers UMC, South Wing, second floor\"\n    assert inst.actor[0].reference == \"Location/1\"\n    assert inst.comment == (\n        \"The slots attached to this schedule should be specialized to\"\n        \" cover immunizations within the clinic\"\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/scheduleid\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"45\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.planningHorizon.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-12-25T09:30:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.planningHorizon.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-12-25T09:15:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.serviceCategory[0].coding[0].code == \"17\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert inst.serviceType[0].coding[0].code == \"57\"\n    assert inst.serviceType[0].coding[0].display == \"Immunization\"\n    assert inst.specialty[0].coding[0].code == \"408480009\"\n    assert inst.specialty[0].coding[0].display == \"Clinical immunology\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_schedule_2(base_settings):\n    \"\"\"No. 2 tests collection for Schedule.\n    Test File: schedule-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"schedule-example.json\"\n    inst = schedule.Schedule.model_validate_json(filename.read_bytes())\n    assert \"Schedule\" == inst.get_resource_type()\n\n    impl_schedule_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Schedule\" == data[\"resourceType\"]\n\n    inst2 = schedule.Schedule(**data)\n    impl_schedule_2(inst2)\n\n\ndef impl_schedule_3(inst):\n    assert inst.active is True\n    assert inst.actor[0].display == \"Dr. Beverly Crusher\"\n    assert inst.actor[0].reference == \"Practitioner/1\"\n    assert inst.actor[1].display == \"Starfleet HQ Sickbay\"\n    assert inst.actor[1].reference == \"Location/2\"\n    assert inst.comment == (\n        \"The slots attached to this schedule are for neurosurgery \"\n        \"operations at Starfleet HQ only.\"\n    )\n    assert inst.id == \"exampleloc2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/scheduleid\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"47\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.planningHorizon.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-25T09:30:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.planningHorizon.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-25T09:15:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.serviceCategory[0].coding[0].code == \"31\"\n    assert inst.serviceCategory[0].coding[0].display == \"Specialist Surgical\"\n    assert inst.serviceType[0].coding[0].code == \"221\"\n    assert inst.serviceType[0].coding[0].display == \"Surgery - General\"\n    assert inst.specialty[0].coding[0].code == \"394610002\"\n    assert inst.specialty[0].coding[0].display == \"Surgery-Neurosurgery\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_schedule_3(base_settings):\n    \"\"\"No. 3 tests collection for Schedule.\n    Test File: schedule-provider-location2-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"schedule-provider-location2-example.json\"\n    )\n    inst = schedule.Schedule.model_validate_json(filename.read_bytes())\n    assert \"Schedule\" == inst.get_resource_type()\n\n    impl_schedule_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Schedule\" == data[\"resourceType\"]\n\n    inst2 = schedule.Schedule(**data)\n    impl_schedule_3(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_searchparameter.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SearchParameter\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import searchparameter\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_searchparameter_1(inst):\n    assert inst.code == \"workflow\"\n    assert inst.description == \"Optional Extensions Element\"\n    assert inst.experimental is True\n    assert inst.id == \"valueset-extensions-ValueSet-workflow\"\n    assert inst.name == \"workflow\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"token\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/valueset-extensions-ValueSet-workflow\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n    assert inst.xpath == (\n        \"f:ValueSet/f:extension[@url='http://hl7.org/fhir/StructureDe\"\n        \"finition/valueset-workflowStatus'] | /f:#workflowStatus\"\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_1(base_settings):\n    \"\"\"No. 1 tests collection for SearchParameter.\n    Test File: valueset-extensions-ValueSet-workflow.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-extensions-ValueSet-workflow.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_1(inst2)\n\n\ndef impl_searchparameter_2(inst):\n    assert inst.code == \"author\"\n    assert inst.description == \"Optional Extensions Element\"\n    assert inst.experimental is True\n    assert inst.id == \"codesystem-extensions-CodeSystem-author\"\n    assert inst.name == \"author\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"string\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/codesystem-extensions-CodeSystem-author\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n    assert inst.xpath == (\n        \"f:CodeSystem/f:extension[@url='http://hl7.org/fhir/Structure\"\n        \"Definition/codesystem-author'] | /f:#author\"\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_2(base_settings):\n    \"\"\"No. 2 tests collection for SearchParameter.\n    Test File: codesystem-extensions-CodeSystem-author.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-extensions-CodeSystem-author.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_2(inst2)\n\n\ndef impl_searchparameter_3(inst):\n    assert inst.base[0] == \"Patient\"\n    assert inst.code == \"part-agree\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == (\n        \"Search by url for a participation agreement, which is stored\"\n        \" in a DocumentReference\"\n    )\n    assert inst.experimental is True\n    assert inst.expression == (\n        \"DocumentReference.extension('http://example.org/fhir/Structu\"\n        \"reDefinition/participation-agreement')\"\n    )\n    assert inst.id == \"example-extension\"\n    assert inst.name == \"Example Search Parameter on an extension\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.status == \"draft\"\n    assert inst.target[0] == \"DocumentReference\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"reference\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/example-extension\"}\n        ).valueUri\n    )\n    assert inst.xpath == (\n        \"f:DocumentReference/f:extension[@url='http://example.org/fhi\"\n        \"r/StructureDefinition/participation-agreement']\"\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_3(base_settings):\n    \"\"\"No. 3 tests collection for SearchParameter.\n    Test File: searchparameter-example-extension.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"searchparameter-example-extension.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_3(inst2)\n\n\ndef impl_searchparameter_4(inst):\n    assert inst.base[0] == \"QuestionnaireResponse\"\n    assert inst.code == \"item-subject\"\n    assert inst.description == (\n        \"Allows searching for QuestionnaireResponses by item value \"\n        \"where the item has isSubject=true\"\n    )\n    assert inst.experimental is True\n    assert inst.expression == (\n        \"QuestionnaireResponse.item.where(extension('http://hl7.org/f\"\n        \"hir/StructureDefinition/questionnaireresponse-\"\n        \"isSubject').exists()).answer.value.ofType(Reference)\"\n    )\n    assert inst.id == (\n        \"questionnaireresponse-extensions-QuestionnaireResponse-item-\" \"subject\"\n    )\n    assert inst.name == \"item-subject\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"reference\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/questionnaireresponse-extensions-QuestionnaireResponse-item-subject\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_4(base_settings):\n    \"\"\"No. 4 tests collection for SearchParameter.\n    Test File: questionnaireresponse-extensions-QuestionnaireResponse-item-subject.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaireresponse-extensions-QuestionnaireResponse-item-subject.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_4(inst2)\n\n\ndef impl_searchparameter_5(inst):\n    assert inst.base[0] == \"Resource\"\n    assert inst.code == \"_filter\"\n    assert inst.contact[0].name == \"FHIR Project\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-07-26\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This is the formal declaration for the _filter parameter, \"\n        \"documented at [http://hl7.org/fhir/search_filter.html](http:\"\n        \"//hl7.org/fhir/search_filter.html)\"\n    )\n    assert inst.experimental is False\n    assert inst.id == \"filter\"\n    assert inst.name == \"FilterSearchParameter\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.purpose == (\n        \"Support combination searches when the simple name=value \"\n        \"basis of search cannot express what is required\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"special\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/filter\"}\n        ).valueUri\n    )\n    assert inst.version == \"1\"\n\n\ndef test_searchparameter_5(base_settings):\n    \"\"\"No. 5 tests collection for SearchParameter.\n    Test File: searchparameter-filter.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"searchparameter-filter.json\"\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_5(inst2)\n\n\ndef impl_searchparameter_6(inst):\n    assert inst.base[0] == \"Condition\"\n    assert inst.chain[0] == \"name\"\n    assert inst.chain[1] == \"identifier\"\n    assert inst.code == \"subject\"\n    assert inst.contact[0].name == \"[string]\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-10-23\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Search by condition subject\"\n    assert inst.experimental is True\n    assert inst.expression == \"Condition.subject\"\n    assert inst.id == \"example-reference\"\n    assert inst.modifier[0] == \"missing\"\n    assert inst.name == \"Example Search Parameter\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.purpose == \"Need to search Condition by subject\"\n    assert inst.status == \"draft\"\n    assert inst.target[0] == \"Organization\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"reference\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/example-reference\"}\n        ).valueUri\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_6(base_settings):\n    \"\"\"No. 6 tests collection for SearchParameter.\n    Test File: searchparameter-example-reference.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"searchparameter-example-reference.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_6(inst2)\n\n\ndef impl_searchparameter_7(inst):\n    assert inst.base[0] == \"DiagnosticReport\"\n    assert inst.code == \"assessed-condition\"\n    assert inst.description == \"Condition assessed by genetic test\"\n    assert inst.experimental is True\n    assert inst.expression == (\n        \"DiagnosticReport.extension('http://hl7.org/fhir/StructureDef\"\n        \"inition/DiagnosticReport-geneticsAssessedCondition')\"\n    )\n    assert inst.id == \"diagnosticreport-genetic-DiagnosticReport-assessed-condition\"\n    assert inst.name == \"assessed-condition\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"reference\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/diagnosticreport-genetic-DiagnosticReport-assessed-condition\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_7(base_settings):\n    \"\"\"No. 7 tests collection for SearchParameter.\n    Test File: diagnosticreport-genetic-DiagnosticReport-assessed-condition.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"diagnosticreport-genetic-DiagnosticReport-assessed-condition.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_7(inst2)\n\n\ndef impl_searchparameter_8(inst):\n    assert inst.base[0] == \"Device\"\n    assert inst.code == \"din\"\n    assert inst.description == \"The donation identification number (DIN)\"\n    assert inst.experimental is True\n    assert inst.expression == (\n        \"Device.extension('http://hl7.org/fhir/SearchParameter/device\"\n        \"-extensions-Device-din')\"\n    )\n    assert inst.id == \"device-extensions-Device-din\"\n    assert inst.name == \"din\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"token\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/device-extensions-Device-din\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_8(base_settings):\n    \"\"\"No. 8 tests collection for SearchParameter.\n    Test File: device-extensions-Device-din.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"device-extensions-Device-din.json\"\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_8(inst2)\n\n\ndef impl_searchparameter_9(inst):\n    assert inst.base[0] == \"Observation\"\n    assert inst.code == \"gene-identifier\"\n    assert inst.description == \"HGNC gene symbol and identifier\"\n    assert inst.experimental is True\n    assert inst.expression == (\n        \"Observation.extension('http://hl7.org/fhir/StructureDefiniti\"\n        \"on/observation-geneticsGene')\"\n    )\n    assert inst.id == \"observation-genetic-Observation-gene-identifier\"\n    assert inst.name == \"gene-identifier\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"token\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/observation-genetic-Observation-gene-identifier\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_9(base_settings):\n    \"\"\"No. 9 tests collection for SearchParameter.\n    Test File: observation-genetic-Observation-gene-identifier.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"observation-genetic-Observation-gene-identifier.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_9(inst2)\n\n\ndef impl_searchparameter_10(inst):\n    assert inst.code == \"workflow\"\n    assert inst.description == \"Optional Extensions Element\"\n    assert inst.experimental is True\n    assert inst.id == \"codesystem-extensions-CodeSystem-workflow\"\n    assert inst.name == \"workflow\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"token\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/codesystem-extensions-CodeSystem-workflow\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n    assert inst.xpath == (\n        \"f:CodeSystem/f:extension[@url='http://hl7.org/fhir/Structure\"\n        \"Definition/codesystem-workflowStatus'] | /f:#workflowStatus\"\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_10(base_settings):\n    \"\"\"No. 10 tests collection for SearchParameter.\n    Test File: codesystem-extensions-CodeSystem-workflow.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-extensions-CodeSystem-workflow.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_servicerequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ServiceRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import servicerequest\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_servicerequest_1(inst):\n    assert inst.asNeededCodeableConcept.text == \"as needed to clear mucus\"\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T17:23:07Z\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].reference == \"CarePlan/gpvisit\"\n    assert inst.code.coding[0].code == \"34431008\"\n    assert inst.code.coding[0].display == \"Physiotherapy of chest (regime/therapy)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"signature\"\n    assert inst.contained[1].id == \"cystic-fibrosis\"\n    assert inst.id == \"physiotherapy\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealth.org/placer-ids\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"PLAC\"\n    assert inst.identifier[0].type.coding[0].display == \"Placer Identifier\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"Placer\"\n    assert inst.identifier[0].value == \"20170201-0001\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert float(inst.occurrenceTiming.repeat.duration) == float(15)\n    assert float(inst.occurrenceTiming.repeat.durationMax) == float(25)\n    assert inst.occurrenceTiming.repeat.durationUnit == \"min\"\n    assert inst.occurrenceTiming.repeat.frequency == 1\n    assert inst.occurrenceTiming.repeat.frequencyMax == 4\n    assert float(inst.occurrenceTiming.repeat.period) == float(1)\n    assert inst.occurrenceTiming.repeat.periodUnit == \"d\"\n    assert inst.reasonReference[0].reference == \"#cystic-fibrosis\"\n    assert inst.relevantHistory[0].display == \"Author's Signature\"\n    assert inst.relevantHistory[0].reference == \"#signature\"\n    assert inst.requester.display == \"Dr Adam Careful\"\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_1(base_settings):\n    \"\"\"No. 1 tests collection for ServiceRequest.\n    Test File: servicerequest-example2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"servicerequest-example2.json\"\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_1(inst2)\n\n\ndef impl_servicerequest_2(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T17:23:07Z\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"359962006\"\n    assert inst.code.coding[0].display == \"Turning patient in bed (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.doNotPerform is True\n    assert inst.id == \"do-not-turn\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealth.org/placer-ids\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"20170201-0002\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.priority == \"stat\"\n    assert inst.reasonReference[0].display == \"Patient has a spinal fracture\"\n    assert inst.requester.display == \"Dr Adam Careful\"\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_2(base_settings):\n    \"\"\"No. 2 tests collection for ServiceRequest.\n    Test File: servicerequest-example3.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"servicerequest-example3.json\"\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_2(inst2)\n\n\ndef impl_servicerequest_3(inst):\n    assert inst.code.coding[0].code == \"LIPID\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/tests\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Lipid Panel\"\n    assert inst.contained[0].id == \"fasting\"\n    assert inst.contained[1].id == \"serum\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"lipid\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"PLAC\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"Placer\"\n    assert inst.identifier[0].value == \"2345234234234\"\n    assert inst.intent == \"original-order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"patient is afraid of needles\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-05-02T16:16:00-07:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].reference == \"Practitioner/f202\"\n    assert inst.reasonCode[0].coding[0].code == \"V173\"\n    assert inst.reasonCode[0].coding[0].display == \"Fam hx-ischem heart dis\"\n    assert (\n        inst.reasonCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-9\"}\n        ).valueUri\n    )\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.specimen[0].display == \"Serum specimen\"\n    assert inst.specimen[0].reference == \"#serum\"\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.supportingInfo[0].display == \"Fasting status\"\n    assert inst.supportingInfo[0].reference == \"#fasting\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_3(base_settings):\n    \"\"\"No. 3 tests collection for ServiceRequest.\n    Test File: servicerequest-example-lipid.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"servicerequest-example-lipid.json\"\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_3(inst2)\n\n\ndef impl_servicerequest_4(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-05\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"76164006\"\n    assert inst.code.coding[0].display == \"Biopsy of colon (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Biopsy of colon\"\n    assert inst.id == \"colon-biopsy\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Dr Adam Careful\"\n    assert inst.performer[0].reference == \"Practitioner/example\"\n    assert inst.requester.display == \"Dr. Beverly Crusher\"\n    assert (\n        inst.requester.reference == \"Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809\"\n    )\n    assert (\n        inst.requisition.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://bumc.org/requisitions\"}\n        ).valueUri\n    )\n    assert inst.requisition.value == \"req12345\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_4(base_settings):\n    \"\"\"No. 4 tests collection for ServiceRequest.\n    Test File: servicerequest-example-colonoscopy-bx.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"servicerequest-example-colonoscopy-bx.json\"\n    )\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_4(inst2)\n\n\ndef impl_servicerequest_5(inst):\n    assert inst.code.coding[0].code == \"229115003\"\n    assert inst.code.coding[0].display == \"Bench Press (regime/therapy)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"benchpress\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.occurrenceTiming.repeat.count == 20\n    assert inst.occurrenceTiming.repeat.countMax == 30\n    assert inst.occurrenceTiming.repeat.frequency == 3\n    assert float(inst.occurrenceTiming.repeat.period) == float(1)\n    assert inst.occurrenceTiming.repeat.periodUnit == \"wk\"\n    assert inst.patientInstruction == (\n        \"Start with 30kg 10-15 repetitions for three sets and \"\n        \"increase in increments of 5kg when you feel ready\"\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_5(base_settings):\n    \"\"\"No. 5 tests collection for ServiceRequest.\n    Test File: servicerequest-example4.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"servicerequest-example4.json\"\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_5(inst2)\n\n\ndef impl_servicerequest_6(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.category[0].coding[0].code == \"311401005\"\n    assert inst.category[0].coding[0].display == \"Patient education (procedure)\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Education\"\n    assert inst.code.coding[0].code == \"48023004\"\n    assert (\n        inst.code.coding[0].display\n        == \"Breast self-examination technique education (procedure)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Health education - breast examination\"\n    assert inst.id == \"education\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].display == \"Pamela Educator, RN\"\n    assert inst.reasonCode[0].text == \"early detection of breast mass\"\n    assert inst.requester.display == \"Angela Care, MD\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Jane Doe\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_6(base_settings):\n    \"\"\"No. 6 tests collection for ServiceRequest.\n    Test File: servicerequest-example-edu.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"servicerequest-example-edu.json\"\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_6(inst2)\n\n\ndef impl_servicerequest_7(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-02-20\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"40617009\"\n    assert inst.code.coding[0].display == \"Artificial respiration (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Mechanical Ventilation\"\n    assert inst.id == \"vent\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.orderDetail[0].coding[0].code == \"243144002\"\n    assert (\n        inst.orderDetail[0].coding[0].display\n        == \"Patient triggered inspiratory assistance (procedure)\"\n    )\n    assert (\n        inst.orderDetail[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.orderDetail[0].text == \"IPPB\"\n    assert inst.orderDetail[1].text == (\n        \" Initial Settings : Sens: -1 cm H20 Pressure 15 cm H2O \"\n        \"moderate flow:  Monitor VS every 15 minutes x 4 at the start\"\n        \" of mechanical ventilation, then routine for unit OR every 5\"\n        \" hr\"\n    )\n    assert inst.performer[0].display == \"Dr Cecil Surgeon\"\n    assert inst.performer[0].reference == \"Practitioner/example\"\n    assert inst.reasonCode[0].text == \"chronic obstructive lung disease (COLD)\"\n    assert inst.requester.display == \"Dr. Beverly Crusher\"\n    assert (\n        inst.requester.reference == \"Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809\"\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_7(base_settings):\n    \"\"\"No. 7 tests collection for ServiceRequest.\n    Test File: servicerequest-example-ventilation.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"servicerequest-example-ventilation.json\"\n    )\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_7(inst2)\n\n\ndef impl_servicerequest_8(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-05\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].display == \"Maternity care plan\"\n    assert inst.basedOn[0].reference == \"CarePlan/preg\"\n    assert inst.code.coding[0].code == \"62013009\"\n    assert inst.code.coding[0].display == \"Ambulating patient (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Ambulation\"\n    assert inst.id == \"ambulation\"\n    assert inst.identifier[0].value == \"45678\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.reasonReference[0].display == \"Blood Pressure\"\n    assert inst.reasonReference[0].reference == \"Observation/blood-pressure\"\n    assert inst.requester.display == \"Dr. Beverly Crusher\"\n    assert (\n        inst.requester.reference == \"Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809\"\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_8(base_settings):\n    \"\"\"No. 8 tests collection for ServiceRequest.\n    Test File: servicerequest-example-ambulation.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"servicerequest-example-ambulation.json\"\n    )\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_8(inst2)\n\n\ndef impl_servicerequest_9(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-09-20\"}\n        ).valueDateTime\n    )\n    assert inst.bodySite[0].coding[0].code == \"36701003\"\n    assert inst.bodySite[0].coding[0].display == \"Both knees (body structure)\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.bodySite[0].text == \"Both knees\"\n    assert inst.category[0].coding[0].code == \"386053000\"\n    assert inst.category[0].coding[0].display == \"Evaluation procedure (procedure)\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Evaluation\"\n    assert inst.code.coding[0].code == \"710830005\"\n    assert (\n        inst.code.coding[0].display\n        == \"Assessment of passive range of motion (procedure)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Assessment of passive range of motion\"\n    assert inst.id == \"physical-therapy\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-09-27\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].display == \"Paul Therapist, PT\"\n    assert (\n        inst.reasonCode[0].text\n        == \"assessment of mobility limitations due to osteoarthritis\"\n    )\n    assert inst.requester.display == \"Ollie Ortho, MD\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_9(base_settings):\n    \"\"\"No. 9 tests collection for ServiceRequest.\n    Test File: servicerequest-example-pt.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"servicerequest-example-pt.json\"\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_9(inst2)\n\n\ndef impl_servicerequest_10(inst):\n    assert inst.code.coding[0].code == \"24627-2\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Chest CT\"\n    assert inst.id == \"di\"\n    assert inst.intent == \"original-order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-05-08T09:33:27+07:00\"}\n        ).valueDateTime\n    )\n    assert inst.reasonCode[0].text == \"Check for metastatic disease\"\n    assert inst.requester.display == \"Dr. Adam Careful\"\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/dicom\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_10(base_settings):\n    \"\"\"No. 10 tests collection for ServiceRequest.\n    Test File: servicerequest-example-di.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"servicerequest-example-di.json\"\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_slot.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Slot\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import slot\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_slot_1(inst):\n    assert inst.comment == (\n        \"Assessments should be performed before requesting \"\n        \"appointments in this slot.\"\n    )\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:15:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/identifiers/slots\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123132\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.overbooked is True\n    assert inst.schedule.reference == \"Schedule/example\"\n    assert inst.serviceCategory[0].coding[0].code == \"17\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"busy\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_slot_1(base_settings):\n    \"\"\"No. 1 tests collection for Slot.\n    Test File: slot-example-busy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"slot-example-busy.json\"\n    inst = slot.Slot.model_validate_json(filename.read_bytes())\n    assert \"Slot\" == inst.get_resource_type()\n\n    impl_slot_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Slot\" == data[\"resourceType\"]\n\n    inst2 = slot.Slot(**data)\n    impl_slot_1(inst2)\n\n\ndef impl_slot_2(inst):\n    assert inst.appointmentType.coding[0].code == \"WALKIN\"\n    assert (\n        inst.appointmentType.coding[0].display\n        == \"A previously unscheduled walk-in visit\"\n    )\n    assert (\n        inst.appointmentType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0276\"}\n        ).valueUri\n    )\n    assert inst.comment == (\n        \"Assessments should be performed before requesting \"\n        \"appointments in this slot.\"\n    )\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:30:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.schedule.reference == \"Schedule/example\"\n    assert inst.serviceCategory[0].coding[0].code == \"17\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert inst.serviceType[0].coding[0].code == \"57\"\n    assert inst.serviceType[0].coding[0].display == \"Immunization\"\n    assert inst.specialty[0].coding[0].code == \"408480009\"\n    assert inst.specialty[0].coding[0].display == \"Clinical immunology\"\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:15:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"free\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_slot_2(base_settings):\n    \"\"\"No. 2 tests collection for Slot.\n    Test File: slot-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"slot-example.json\"\n    inst = slot.Slot.model_validate_json(filename.read_bytes())\n    assert \"Slot\" == inst.get_resource_type()\n\n    impl_slot_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Slot\" == data[\"resourceType\"]\n\n    inst2 = slot.Slot(**data)\n    impl_slot_2(inst2)\n\n\ndef impl_slot_3(inst):\n    assert inst.comment == \"Dr Careful is out of the office\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:45:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"3\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.schedule.reference == \"Schedule/example\"\n    assert inst.serviceCategory[0].coding[0].code == \"17\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:30:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"busy-unavailable\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_slot_3(base_settings):\n    \"\"\"No. 3 tests collection for Slot.\n    Test File: slot-example-unavailable.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"slot-example-unavailable.json\"\n    inst = slot.Slot.model_validate_json(filename.read_bytes())\n    assert \"Slot\" == inst.get_resource_type()\n\n    impl_slot_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Slot\" == data[\"resourceType\"]\n\n    inst2 = slot.Slot(**data)\n    impl_slot_3(inst2)\n\n\ndef impl_slot_4(inst):\n    assert inst.comment == \"Dr Careful is out of the office\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T10:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.schedule.reference == \"Schedule/example\"\n    assert inst.serviceCategory[0].coding[0].code == \"17\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:45:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"busy-tentative\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_slot_4(base_settings):\n    \"\"\"No. 4 tests collection for Slot.\n    Test File: slot-example-tentative.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"slot-example-tentative.json\"\n    inst = slot.Slot.model_validate_json(filename.read_bytes())\n    assert \"Slot\" == inst.get_resource_type()\n\n    impl_slot_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Slot\" == data[\"resourceType\"]\n\n    inst2 = slot.Slot(**data)\n    impl_slot_4(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_specimen.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Specimen\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import specimen\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_specimen_1(inst):\n    assert (\n        inst.accessionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://lab.acme.org/specimens/2011\"}\n        ).valueUri\n    )\n    assert inst.accessionIdentifier.value == \"X352356-ISO1\"\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-16T07:03:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/f202\"\n    assert inst.collection.method.coding[0].code == \"BAP\"\n    assert (\n        inst.collection.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0488\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"stool\"\n    assert inst.id == \"isolate\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Patient dropped off specimen\"\n    assert inst.parent[0].reference == \"#stool\"\n    assert (\n        inst.receivedTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-18T07:03:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"available\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"429951000124103\"\n    assert inst.type.coding[0].display == \"Bacterial isolate specimen\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_1(base_settings):\n    \"\"\"No. 1 tests collection for Specimen.\n    Test File: specimen-example-isolate.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"specimen-example-isolate.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_1(inst2)\n\n\ndef impl_specimen_2(inst):\n    assert (\n        inst.accessionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://vetmed.iastate.edu/vdl\"}\n        ).valueUri\n    )\n    assert inst.accessionIdentifier.value == \"20171120-1234\"\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-11-14\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.display == \"James Herriot, FRCVS\"\n    assert inst.container[0].type.coding[0].code == \"RTT\"\n    assert inst.container[0].type.coding[0].display == \"Red Top Tube\"\n    assert (\n        inst.container[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://vetmed.iastate.edu/vdl\"}\n        ).valueUri\n    )\n    assert inst.container[0].type.text == \"Red Top Blood Collection Tube\"\n    assert inst.id == \"pooled-serum\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Pooled serum sample from 30 individuals\"\n    assert inst.subject.reference == \"Group/herd1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"Serum sample, pooled\"\n    assert inst.type.coding[0].display == \"Serum sample, pooled\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://vetmed.iastate.edu/vdl\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"Pooled serum sample\"\n\n\ndef test_specimen_2(base_settings):\n    \"\"\"No. 2 tests collection for Specimen.\n    Test File: specimen-example-pooled-serum.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"specimen-example-pooled-serum.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_2(inst2)\n\n\ndef impl_specimen_3(inst):\n    assert (\n        inst.accessionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://lab.acme.org/specimens/2015\"}\n        ).valueUri\n    )\n    assert inst.accessionIdentifier.value == \"X352356\"\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-18T07:03:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/f202\"\n    assert inst.container[0].capacity.unit == \"mls\"\n    assert float(inst.container[0].capacity.value) == float(50)\n    assert inst.container[0].specimenQuantity.unit == \"mls\"\n    assert float(inst.container[0].specimenQuantity.value) == float(10)\n    assert inst.container[0].type.text == \"Non-sterile specimen container\"\n    assert inst.id == \"vma-urine\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.processing[0].additive[0].display == \"6 N HCl\"\n    assert inst.processing[0].description == \"Acidify to pH < 3.0 with 6 N HCl.\"\n    assert inst.processing[0].procedure.coding[0].code == \"ACID\"\n    assert (\n        inst.processing[0].procedure.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0373\"}\n        ).valueUri\n    )\n    assert (\n        inst.processing[0].timeDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-18T08:10:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.receivedTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-18T07:03:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"available\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"RANDU\"\n    assert inst.type.coding[0].display == \"Urine, Random\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0487\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_3(base_settings):\n    \"\"\"No. 3 tests collection for Specimen.\n    Test File: specimen-example-urine.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"specimen-example-urine.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_3(inst2)\n\n\ndef impl_specimen_4(inst):\n    assert (\n        inst.accessionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/labs/accession-ids\"}\n        ).valueUri\n    )\n    assert inst.accessionIdentifier.value == \"20150816-00124\"\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-16T06:40:17Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/f202\"\n    assert inst.container[0].type.coding[0].code == \"SST\"\n    assert inst.container[0].type.coding[0].display == \"Serum Separator Tube\"\n    assert (\n        inst.container[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/labs\"}\n        ).valueUri\n    )\n    assert inst.id == \"sst\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.request[0].reference == \"ServiceRequest/ft4\"\n    assert inst.subject.reference == \"Patient/pat2\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"119364003\"\n    assert inst.type.coding[0].display == \"Serum sample\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_4(base_settings):\n    \"\"\"No. 4 tests collection for Specimen.\n    Test File: specimen-example-serum.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"specimen-example-serum.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_4(inst2)\n\n\ndef impl_specimen_5(inst):\n    assert (\n        inst.accessionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://lab.acme.org/specimens/2011\"}\n        ).valueUri\n    )\n    assert inst.accessionIdentifier.value == \"X352356\"\n    assert inst.collection.bodySite.coding[0].code == \"49852007\"\n    assert (\n        inst.collection.bodySite.coding[0].display\n        == \"Structure of median cubital vein (body structure)\"\n    )\n    assert (\n        inst.collection.bodySite.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.collection.bodySite.text == \"Right median cubital vein\"\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-05-30T06:15:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/example\"\n    assert inst.collection.method.coding[0].code == \"LNV\"\n    assert (\n        inst.collection.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0488\"}\n        ).valueUri\n    )\n    assert inst.collection.quantity.unit == \"mL\"\n    assert float(inst.collection.quantity.value) == float(6)\n    assert inst.contained[0].id == \"hep\"\n    assert inst.container[0].additiveReference.reference == \"#hep\"\n    assert inst.container[0].capacity.unit == \"mL\"\n    assert float(inst.container[0].capacity.value) == float(10)\n    assert inst.container[0].description == \"Green Gel tube\"\n    assert inst.container[0].identifier[0].value == \"48736-15394-75465\"\n    assert inst.container[0].specimenQuantity.unit == \"mL\"\n    assert float(inst.container[0].specimenQuantity.value) == float(6)\n    assert inst.container[0].type.text == \"Vacutainer\"\n    assert inst.id == \"101\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ehr.acme.org/identifiers/collections\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"23234352356\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Specimen is grossly lipemic\"\n    assert (\n        inst.receivedTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-03-04T07:03:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.request[0].reference == \"ServiceRequest/example\"\n    assert inst.status == \"available\"\n    assert inst.subject.display == \"Peter Patient\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"122555007\"\n    assert inst.type.coding[0].display == \"Venous blood specimen\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_5(base_settings):\n    \"\"\"No. 5 tests collection for Specimen.\n    Test File: specimen-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"specimen-example.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_5(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_specimendefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SpecimenDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import specimendefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_specimendefinition_1(inst):\n    assert inst.id == \"2364\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patientPreparation[0].text == \"12 hour fasting\"\n    assert inst.patientPreparation[1].coding[0].code == \"263678003\"\n    assert inst.patientPreparation[1].coding[0].display == \"At rest\"\n    assert (\n        inst.patientPreparation[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.timeAspect == \"preferrably morning time\"\n    assert inst.typeCollected.coding[0].code == \"122555007\"\n    assert inst.typeCollected.coding[0].display == \"Venous blood specimen\"\n    assert (\n        inst.typeCollected.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].container.cap.coding[0].code == \"yellow\"\n    assert inst.typeTested[0].container.cap.coding[0].display == \"yellow cap\"\n    assert (\n        inst.typeTested[0].container.cap.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:6710:2017\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].container.material.coding[0].code == \"61088005\"\n    assert inst.typeTested[0].container.material.coding[0].display == \"plastic\"\n    assert (\n        inst.typeTested[0].container.material.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].container.minimumVolumeQuantity.code == \"mL\"\n    assert (\n        inst.typeTested[0].container.minimumVolumeQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].container.minimumVolumeQuantity.unit == \"ml\"\n    assert float(inst.typeTested[0].container.minimumVolumeQuantity.value) == float(2)\n    assert inst.typeTested[0].container.type.coding[0].code == \"702281005\"\n    assert inst.typeTested[0].container.type.coding[0].display == (\n        \"Evacuated blood collection tube, thrombin/clot activator/gel\" \" separator\"\n    )\n    assert (\n        inst.typeTested[0].container.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[0].maxDuration.code == \"min\"\n    assert (\n        inst.typeTested[0].handling[0].maxDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[0].maxDuration.unit == \"minute\"\n    assert float(inst.typeTested[0].handling[0].maxDuration.value) == float(60)\n    assert (\n        inst.typeTested[0].handling[0].temperatureQualifier.text\n        == \"Ambient temperature\"\n    )\n    assert inst.typeTested[0].handling[0].temperatureRange.high.code == \"Cel\"\n    assert (\n        inst.typeTested[0].handling[0].temperatureRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[0].temperatureRange.high.unit == \"°C\"\n    assert float(inst.typeTested[0].handling[0].temperatureRange.high.value) == float(\n        25\n    )\n    assert inst.typeTested[0].handling[0].temperatureRange.low.code == \"Cel\"\n    assert (\n        inst.typeTested[0].handling[0].temperatureRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[0].temperatureRange.low.unit == \"°C\"\n    assert float(inst.typeTested[0].handling[0].temperatureRange.low.value) == float(15)\n    assert inst.typeTested[0].handling[1].maxDuration.code == \"h\"\n    assert (\n        inst.typeTested[0].handling[1].maxDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[1].maxDuration.unit == \"hour\"\n    assert float(inst.typeTested[0].handling[1].maxDuration.value) == float(8)\n    assert (\n        inst.typeTested[0].handling[1].temperatureQualifier.text\n        == \"Refrigerated temperature\"\n    )\n    assert inst.typeTested[0].handling[1].temperatureRange.high.code == \"Cel\"\n    assert (\n        inst.typeTested[0].handling[1].temperatureRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[1].temperatureRange.high.unit == \"°C\"\n    assert float(inst.typeTested[0].handling[1].temperatureRange.high.value) == float(8)\n    assert inst.typeTested[0].handling[1].temperatureRange.low.code == \"Cel\"\n    assert (\n        inst.typeTested[0].handling[1].temperatureRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[1].temperatureRange.low.unit == \"°C\"\n    assert float(inst.typeTested[0].handling[1].temperatureRange.low.value) == float(2)\n    assert inst.typeTested[0].preference == \"preferred\"\n    assert inst.typeTested[0].type.coding[0].code == \"119364003\"\n    assert inst.typeTested[0].type.coding[0].display == \"Serum specimen\"\n    assert (\n        inst.typeTested[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].container.cap.coding[0].code == \"green\"\n    assert inst.typeTested[1].container.cap.coding[0].display == \"green cap\"\n    assert (\n        inst.typeTested[1].container.cap.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:6710:2017\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].container.material.coding[0].code == \"32039001\"\n    assert inst.typeTested[1].container.material.coding[0].display == \"glass\"\n    assert (\n        inst.typeTested[1].container.material.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].container.minimumVolumeQuantity.code == \"mL\"\n    assert (\n        inst.typeTested[1].container.minimumVolumeQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].container.minimumVolumeQuantity.unit == \"ml\"\n    assert float(inst.typeTested[1].container.minimumVolumeQuantity.value) == float(2)\n    assert inst.typeTested[1].container.type.coding[0].code == \"767390000\"\n    assert inst.typeTested[1].container.type.coding[0].display == (\n        \"Evacuated blood collection tube with heparin lithium and gel\" \" separator\"\n    )\n    assert (\n        inst.typeTested[1].container.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[0].maxDuration.code == \"min\"\n    assert (\n        inst.typeTested[1].handling[0].maxDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[0].maxDuration.unit == \"minute\"\n    assert float(inst.typeTested[1].handling[0].maxDuration.value) == float(60)\n    assert (\n        inst.typeTested[1].handling[0].temperatureQualifier.text\n        == \"Ambient temperature\"\n    )\n    assert inst.typeTested[1].handling[0].temperatureRange.high.code == \"Cel\"\n    assert (\n        inst.typeTested[1].handling[0].temperatureRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[0].temperatureRange.high.unit == \"°C\"\n    assert float(inst.typeTested[1].handling[0].temperatureRange.high.value) == float(\n        25\n    )\n    assert inst.typeTested[1].handling[0].temperatureRange.low.code == \"Cel\"\n    assert (\n        inst.typeTested[1].handling[0].temperatureRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[0].temperatureRange.low.unit == \"°C\"\n    assert float(inst.typeTested[1].handling[0].temperatureRange.low.value) == float(15)\n    assert inst.typeTested[1].handling[1].maxDuration.code == \"h\"\n    assert (\n        inst.typeTested[1].handling[1].maxDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[1].maxDuration.unit == \"hour\"\n    assert float(inst.typeTested[1].handling[1].maxDuration.value) == float(8)\n    assert (\n        inst.typeTested[1].handling[1].temperatureQualifier.text\n        == \"Refrigerated temperature\"\n    )\n    assert inst.typeTested[1].handling[1].temperatureRange.high.code == \"Cel\"\n    assert (\n        inst.typeTested[1].handling[1].temperatureRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[1].temperatureRange.high.unit == \"°C\"\n    assert float(inst.typeTested[1].handling[1].temperatureRange.high.value) == float(8)\n    assert inst.typeTested[1].handling[1].temperatureRange.low.code == \"Cel\"\n    assert (\n        inst.typeTested[1].handling[1].temperatureRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[1].temperatureRange.low.unit == \"°C\"\n    assert float(inst.typeTested[1].handling[1].temperatureRange.low.value) == float(2)\n    assert inst.typeTested[1].preference == \"alternate\"\n    assert inst.typeTested[1].rejectionCriterion[0].coding[0].code == \"insufficient\"\n    assert (\n        inst.typeTested[1].rejectionCriterion[0].coding[0].display\n        == \"insufficient specimen volume\"\n    )\n    assert (\n        inst.typeTested[1].rejectionCriterion[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/rejection-criteria\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].rejectionCriterion[1].coding[0].code == \"hemolized\"\n    assert (\n        inst.typeTested[1].rejectionCriterion[1].coding[0].display\n        == \"hemolized specimen\"\n    )\n    assert (\n        inst.typeTested[1].rejectionCriterion[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/rejection-criteria\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].type.coding[0].code == \"119361006\"\n    assert inst.typeTested[1].type.coding[0].display == \"Plasma specimen\"\n    assert (\n        inst.typeTested[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_specimendefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for SpecimenDefinition.\n    Test File: specimendefinition-example-serum-plasma.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"specimendefinition-example-serum-plasma.json\"\n    )\n    inst = specimendefinition.SpecimenDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"SpecimenDefinition\" == inst.get_resource_type()\n\n    impl_specimendefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SpecimenDefinition\" == data[\"resourceType\"]\n\n    inst2 = specimendefinition.SpecimenDefinition(**data)\n    impl_specimendefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_structuremap.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/StructureMap\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import structuremap\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_structuremap_1(inst):\n    assert inst.experimental is True\n    assert inst.group[0].input[0].mode == \"source\"\n    assert inst.group[0].input[0].name == \"source\"\n    assert inst.group[0].input[0].type == \"ActivityDefinition\"\n    assert inst.group[0].input[1].mode == \"target\"\n    assert inst.group[0].input[1].name == \"target\"\n    assert inst.group[0].input[1].type == \"SupplyRequest\"\n    assert inst.group[0].name == \"main\"\n    assert inst.group[0].rule[0].name == \"status\"\n    assert inst.group[0].rule[0].source[0].context == \"source\"\n    assert inst.group[0].rule[0].source[0].element == \"id\"\n    assert inst.group[0].rule[0].source[0].variable == \"a\"\n    assert inst.group[0].rule[0].target[0].context == \"target\"\n    assert inst.group[0].rule[0].target[0].contextType == \"variable\"\n    assert inst.group[0].rule[0].target[0].element == \"status\"\n    assert inst.group[0].rule[0].target[0].parameter[0].valueString == \"'draft'\"\n    assert inst.group[0].rule[0].target[0].transform == \"evaluate\"\n    assert inst.group[0].rule[1].name == \"category\"\n    assert inst.group[0].rule[1].source[0].context == \"source\"\n    assert inst.group[0].rule[1].source[0].element == \"id\"\n    assert inst.group[0].rule[1].source[0].variable == \"a\"\n    assert inst.group[0].rule[1].target[0].context == \"target\"\n    assert inst.group[0].rule[1].target[0].contextType == \"variable\"\n    assert inst.group[0].rule[1].target[0].element == \"category\"\n    assert inst.group[0].rule[1].target[0].parameter[0].valueString == \"'non-stock'\"\n    assert inst.group[0].rule[1].target[0].transform == \"evaluate\"\n    assert inst.group[0].rule[2].name == \"priority\"\n    assert inst.group[0].rule[2].source[0].context == \"source\"\n    assert inst.group[0].rule[2].source[0].element == \"id\"\n    assert inst.group[0].rule[2].source[0].variable == \"a\"\n    assert inst.group[0].rule[2].target[0].context == \"target\"\n    assert inst.group[0].rule[2].target[0].contextType == \"variable\"\n    assert inst.group[0].rule[2].target[0].element == \"priority\"\n    assert inst.group[0].rule[2].target[0].parameter[0].valueString == \"'routine'\"\n    assert inst.group[0].rule[2].target[0].transform == \"evaluate\"\n    assert inst.group[0].rule[3].name == \"quantity\"\n    assert inst.group[0].rule[3].source[0].context == \"source\"\n    assert inst.group[0].rule[3].source[0].element == \"quantity\"\n    assert inst.group[0].rule[3].source[0].variable == \"a\"\n    assert inst.group[0].rule[3].target[0].context == \"target\"\n    assert inst.group[0].rule[3].target[0].contextType == \"variable\"\n    assert inst.group[0].rule[3].target[0].element == \"category\"\n    assert inst.group[0].rule[3].target[0].transform == \"copy\"\n    assert inst.group[0].rule[4].name == \"item\"\n    assert inst.group[0].rule[4].source[0].context == \"source\"\n    assert inst.group[0].rule[4].source[0].element == \"code\"\n    assert inst.group[0].rule[4].source[0].variable == \"a\"\n    assert inst.group[0].rule[4].target[0].context == \"target\"\n    assert inst.group[0].rule[4].target[0].contextType == \"variable\"\n    assert inst.group[0].rule[4].target[0].element == \"orderedItem.itemCodeableConcept\"\n    assert inst.group[0].rule[4].target[0].transform == \"copy\"\n    assert inst.group[0].rule[5].name == \"when\"\n    assert inst.group[0].rule[5].source[0].context == \"source\"\n    assert inst.group[0].rule[5].source[0].element == \"id\"\n    assert inst.group[0].rule[5].source[0].variable == \"a\"\n    assert inst.group[0].rule[5].target[0].context == \"target\"\n    assert inst.group[0].rule[5].target[0].contextType == \"variable\"\n    assert inst.group[0].rule[5].target[0].element == \"occurrenceDateTime\"\n    assert inst.group[0].rule[5].target[0].parameter[0].valueString == \"now()\"\n    assert inst.group[0].rule[5].target[0].transform == \"evaluate\"\n    assert inst.group[0].rule[6].name == \"authoredOn\"\n    assert inst.group[0].rule[6].source[0].context == \"source\"\n    assert inst.group[0].rule[6].source[0].element == \"id\"\n    assert inst.group[0].rule[6].source[0].variable == \"a\"\n    assert inst.group[0].rule[6].target[0].context == \"target\"\n    assert inst.group[0].rule[6].target[0].contextType == \"variable\"\n    assert inst.group[0].rule[6].target[0].element == \"authoredOn\"\n    assert inst.group[0].rule[6].target[0].parameter[0].valueString == \"now()\"\n    assert inst.group[0].rule[6].target[0].transform == \"evaluate\"\n    assert inst.group[0].typeMode == \"none\"\n    assert inst.id == \"supplyrequest-transform\"\n    assert inst.name == \"Transform from an ActivityDefinition to a SupplyRequest\"\n    assert inst.status == \"draft\"\n    assert inst.structure[0].mode == \"source\"\n    assert (\n        inst.structure[0].url\n        == \"http://hl7.org/fhir/StructureDefinition/activitydefinition\"\n    )\n    assert inst.structure[1].mode == \"target\"\n    assert (\n        inst.structure[1].url == \"http://hl7.org/fhir/StructureDefinition/supplyrequest\"\n    )\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureMap/supplyrequest-transform\"}\n        ).valueUri\n    )\n\n\ndef test_structuremap_1(base_settings):\n    \"\"\"No. 1 tests collection for StructureMap.\n    Test File: structuremap-supplyrequest-transform.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"structuremap-supplyrequest-transform.json\"\n    )\n    inst = structuremap.StructureMap.model_validate_json(filename.read_bytes())\n    assert \"StructureMap\" == inst.get_resource_type()\n\n    impl_structuremap_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"StructureMap\" == data[\"resourceType\"]\n\n    inst2 = structuremap.StructureMap(**data)\n    impl_structuremap_1(inst2)\n\n\ndef impl_structuremap_2(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-09\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Example Structure Map\"\n    assert inst.experimental is True\n    assert inst.group[0].documentation == \"test -> testValue\"\n    assert inst.group[0].input[0].mode == \"source\"\n    assert inst.group[0].input[0].name == \"test\"\n    assert inst.group[0].name == \"Examples\"\n    assert inst.group[0].rule[0].name == \"rule1\"\n    assert inst.group[0].rule[0].source[0].context == \"Source\"\n    assert inst.group[0].rule[0].source[0].element == \"test\"\n    assert inst.group[0].rule[0].source[0].type == \"SourceClassA\"\n    assert inst.group[0].rule[0].source[0].variable == \"t\"\n    assert inst.group[0].rule[0].target[0].context == \"Destination\"\n    assert inst.group[0].rule[0].target[0].contextType == \"variable\"\n    assert inst.group[0].rule[0].target[0].element == \"testValue\"\n    assert inst.group[0].rule[0].target[0].transform == \"copy\"\n    assert inst.group[0].typeMode == \"none\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:37843577-95fb-4adb-84c0-8837188a7bf3\"\n    assert inst.jurisdiction[0].coding[0].code == \"009\"\n    assert inst.jurisdiction[0].coding[0].display == \"Oceania\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.name == \"ExampleMap\"\n    assert inst.publisher == \"HL7 FHIR Standard\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Example Map\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureMap/example\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1\"\n\n\ndef test_structuremap_2(base_settings):\n    \"\"\"No. 2 tests collection for StructureMap.\n    Test File: structuremap-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"structuremap-example.json\"\n    inst = structuremap.StructureMap.model_validate_json(filename.read_bytes())\n    assert \"StructureMap\" == inst.get_resource_type()\n\n    impl_structuremap_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"StructureMap\" == data[\"resourceType\"]\n\n    inst2 = structuremap.StructureMap(**data)\n    impl_structuremap_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_subscription.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Subscription\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import subscription\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_subscription_1(inst):\n    assert (\n        inst.channel.endpoint\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://biliwatch.com/customers/mount-auburn-miu/on-result\"}\n        ).valueUrl\n    )\n    assert inst.channel.header[0] == \"Authorization: Bearer secret-token-abc-123\"\n    assert inst.channel.payload == \"application/fhir+json\"\n    assert inst.channel.type == \"rest-hook\"\n    assert inst.contact[0].system == \"phone\"\n    assert inst.contact[0].value == \"ext 4123\"\n    assert inst.criteria == \"Observation?code=http://loinc.org|1975-2\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2021-01-01T00:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.error == \"Socket Error 10060 - can't connect to host\"\n    assert inst.id == \"example-error\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.reason == \"Monitor new neonatal function\"\n    assert inst.status == \"error\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_subscription_1(base_settings):\n    \"\"\"No. 1 tests collection for Subscription.\n    Test File: subscription-example-error.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"subscription-example-error.json\"\n    inst = subscription.Subscription.model_validate_json(filename.read_bytes())\n    assert \"Subscription\" == inst.get_resource_type()\n\n    impl_subscription_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Subscription\" == data[\"resourceType\"]\n\n    inst2 = subscription.Subscription(**data)\n    impl_subscription_1(inst2)\n\n\ndef impl_subscription_2(inst):\n    assert (\n        inst.channel.endpoint\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://biliwatch.com/customers/mount-auburn-miu/on-result\"}\n        ).valueUrl\n    )\n    assert inst.channel.header[0] == \"Authorization: Bearer secret-token-abc-123\"\n    assert inst.channel.payload == \"application/fhir+json\"\n    assert inst.channel.type == \"rest-hook\"\n    assert inst.contact[0].system == \"phone\"\n    assert inst.contact[0].value == \"ext 4123\"\n    assert inst.criteria == \"Observation?code=http://loinc.org|1975-2\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2021-01-01T00:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.reason == \"Monitor new neonatal function\"\n    assert inst.status == \"requested\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_subscription_2(base_settings):\n    \"\"\"No. 2 tests collection for Subscription.\n    Test File: subscription-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"subscription-example.json\"\n    inst = subscription.Subscription.model_validate_json(filename.read_bytes())\n    assert \"Subscription\" == inst.get_resource_type()\n\n    impl_subscription_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Subscription\" == data[\"resourceType\"]\n\n    inst2 = subscription.Subscription(**data)\n    impl_subscription_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_subscriptionstatus.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubscriptionStatus\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import subscriptionstatus\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_subscriptionstatus_1(inst):\n    assert inst.eventsSinceSubscriptionStart == \"1000\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.notificationEvent[0].eventNumber == \"1000\"\n    assert (\n        inst.notificationEvent[0].focus.reference\n        == \"urn:uuid:9986fc11-a845-4965-af24-45312fd0cc4e\"\n    )\n    assert inst.status == \"active\"\n    assert inst.subscription.reference == \"http://example.org/FHIR/R4B/Subscription/123\"\n    assert inst.text.status == \"generated\"\n    assert inst.topic == \"http://example.org/FHIR/R4B/SubscriptionTopic/admission\"\n    assert inst.type == \"event-notification\"\n\n\ndef test_subscriptionstatus_1(base_settings):\n    \"\"\"No. 1 tests collection for SubscriptionStatus.\n    Test File: subscriptionstatus-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"subscriptionstatus-example.json\"\n    inst = subscriptionstatus.SubscriptionStatus.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"SubscriptionStatus\" == inst.get_resource_type()\n\n    impl_subscriptionstatus_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SubscriptionStatus\" == data[\"resourceType\"]\n\n    inst2 = subscriptionstatus.SubscriptionStatus(**data)\n    impl_subscriptionstatus_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_subscriptiontopic.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubscriptionTopic\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import subscriptiontopic\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_subscriptiontopic_1(inst):\n    assert inst.canFilterBy[0].description == (\n        \"Matching based on the Patient (subject) of an Encounter or \"\n        \"based on the Patient's group membership (in/not-in).\"\n    )\n    assert inst.canFilterBy[0].filterParameter == \"patient\"\n    assert inst.canFilterBy[0].modifier[0] == \"=\"\n    assert inst.canFilterBy[0].modifier[1] == \"in\"\n    assert inst.canFilterBy[0].modifier[2] == \"not-in\"\n    assert (\n        inst.canFilterBy[0].resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter\"}).valueUri\n    )\n    assert inst.description == \"Example admission topic\"\n    assert (\n        inst.eventTrigger[0].description\n        == \"Patient admission is covered by HL7v2 ADT^A01\"\n    )\n    assert inst.eventTrigger[0].event.coding[0].code == \"A01\"\n    assert (\n        inst.eventTrigger[0].event.coding[0].display\n        == \"ADT/ACK - Admit/visit notification\"\n    )\n    assert (\n        inst.eventTrigger[0].event.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0003\"}\n        ).valueUri\n    )\n    assert (\n        inst.eventTrigger[0].resource\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/Encounter\"}\n        ).valueUri\n    )\n    assert inst.id == \"admission\"\n    assert inst.notificationShape[0].include[0] == \"Encounter:patient\"\n    assert inst.notificationShape[0].include[1] == \"Encounter:practitioner\"\n    assert inst.notificationShape[0].include[2] == \"Encounter:service-provider\"\n    assert inst.notificationShape[0].include[3] == \"Encounter:account\"\n    assert inst.notificationShape[0].include[4] == \"Encounter:diagnosis\"\n    assert inst.notificationShape[0].include[5] == \"Encounter:observation\"\n    assert inst.notificationShape[0].include[6] == \"Encounter:location\"\n    assert (\n        inst.notificationShape[0].resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter\"}).valueUri\n    )\n    assert (\n        inst.resourceTrigger[0].description\n        == \"Encounter resource moving to state 'in-progress'\"\n    )\n    assert inst.resourceTrigger[0].fhirPathCriteria == (\n        \"%previous.status!='in-progress' and %current.status='in-\" \"progress'\"\n    )\n    assert inst.resourceTrigger[0].queryCriteria.current == \"status=in-progress\"\n    assert inst.resourceTrigger[0].queryCriteria.previous == \"status:not=in-progress\"\n    assert inst.resourceTrigger[0].queryCriteria.requireBoth is True\n    assert inst.resourceTrigger[0].queryCriteria.resultForCreate == \"test-passes\"\n    assert inst.resourceTrigger[0].queryCriteria.resultForDelete == \"test-fails\"\n    assert (\n        inst.resourceTrigger[0].resource\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/Encounter\"}\n        ).valueUri\n    )\n    assert inst.resourceTrigger[0].supportedInteraction[0] == \"create\"\n    assert inst.resourceTrigger[0].supportedInteraction[1] == \"update\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"admission\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/FHIR/R4B/SubscriptionTopic/admission\"}\n        ).valueUri\n    )\n\n\ndef test_subscriptiontopic_1(base_settings):\n    \"\"\"No. 1 tests collection for SubscriptionTopic.\n    Test File: subscriptiontopic-example-admission.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"subscriptiontopic-example-admission.json\"\n    )\n    inst = subscriptiontopic.SubscriptionTopic.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"SubscriptionTopic\" == inst.get_resource_type()\n\n    impl_subscriptiontopic_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SubscriptionTopic\" == data[\"resourceType\"]\n\n    inst2 = subscriptiontopic.SubscriptionTopic(**data)\n    impl_subscriptiontopic_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_substance.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Substance\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import substance\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_substance_1(inst):\n    assert inst.category[0].coding[0].code == \"chemical\"\n    assert inst.category[0].coding[0].display == \"Chemical\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/substance-category\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"333346007\"\n    assert inst.code.coding[0].display == \"Silver nitrate 20% solution (product)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.description == \"Solution for silver nitrate stain\"\n    assert inst.id == \"f204\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/identifiers/substances\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"15970\"\n    assert (\n        inst.instance[0].expiry\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.instance[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/identifiers/substances/lot\"}\n        ).valueUri\n    )\n    assert inst.instance[0].identifier.value == \"AB94687\"\n    assert inst.instance[0].quantity.code == \"mL\"\n    assert (\n        inst.instance[0].quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.instance[0].quantity.unit == \"mL\"\n    assert float(inst.instance[0].quantity.value) == float(100)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substance_1(base_settings):\n    \"\"\"No. 1 tests collection for Substance.\n    Test File: substance-example-silver-nitrate-product.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"substance-example-silver-nitrate-product.json\"\n    )\n    inst = substance.Substance.model_validate_json(filename.read_bytes())\n    assert \"Substance\" == inst.get_resource_type()\n\n    impl_substance_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Substance\" == data[\"resourceType\"]\n\n    inst2 = substance.Substance(**data)\n    impl_substance_1(inst2)\n\n\ndef impl_substance_2(inst):\n    assert inst.category[0].coding[0].code == \"drug\"\n    assert inst.category[0].coding[0].display == \"Drug or Medicament\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/substance-category\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"392259005\"\n    assert inst.code.coding[0].display == (\n        \"Amoxicillin + clavulanate potassium 875mg/125mg tablet \" \"(product)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"ingr1\"\n    assert inst.contained[1].id == \"ingr2\"\n    assert inst.description == \"Augmentin 875\"\n    assert inst.id == \"f205\"\n    assert inst.ingredient[0].quantity.denominator.code == \"mg\"\n    assert (\n        inst.ingredient[0].quantity.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredient[0].quantity.denominator.unit == \"mg\"\n    assert float(inst.ingredient[0].quantity.denominator.value) == float(1000)\n    assert inst.ingredient[0].quantity.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].quantity.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredient[0].quantity.numerator.unit == \"mg\"\n    assert float(inst.ingredient[0].quantity.numerator.value) == float(875)\n    assert inst.ingredient[0].substanceReference.reference == \"#ingr1\"\n    assert inst.ingredient[1].quantity.denominator.code == \"mg\"\n    assert (\n        inst.ingredient[1].quantity.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredient[1].quantity.denominator.unit == \"mg\"\n    assert float(inst.ingredient[1].quantity.denominator.value) == float(1000)\n    assert inst.ingredient[1].quantity.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[1].quantity.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredient[1].quantity.numerator.unit == \"mg\"\n    assert float(inst.ingredient[1].quantity.numerator.value) == float(125)\n    assert inst.ingredient[1].substanceReference.reference == \"#ingr2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substance_2(base_settings):\n    \"\"\"No. 2 tests collection for Substance.\n    Test File: substance-example-amoxicillin-clavulanate.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"substance-example-amoxicillin-clavulanate.json\"\n    )\n    inst = substance.Substance.model_validate_json(filename.read_bytes())\n    assert \"Substance\" == inst.get_resource_type()\n\n    impl_substance_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Substance\" == data[\"resourceType\"]\n\n    inst2 = substance.Substance(**data)\n    impl_substance_2(inst2)\n\n\ndef impl_substance_3(inst):\n    assert inst.category[0].coding[0].code == \"chemical\"\n    assert inst.category[0].coding[0].display == \"Chemical\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/substance-category\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"88480006\"\n    assert inst.code.coding[0].display == \"Potassium\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"f203\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/identifiers/substances\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"1234\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substance_3(base_settings):\n    \"\"\"No. 3 tests collection for Substance.\n    Test File: substance-example-f203-potassium.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"substance-example-f203-potassium.json\"\n    )\n    inst = substance.Substance.model_validate_json(filename.read_bytes())\n    assert \"Substance\" == inst.get_resource_type()\n\n    impl_substance_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Substance\" == data[\"resourceType\"]\n\n    inst2 = substance.Substance(**data)\n    impl_substance_3(inst2)\n\n\ndef impl_substance_4(inst):\n    assert inst.code.coding[0].code == \"406466009\"\n    assert inst.code.coding[0].display == \"House dust allergen\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"f201\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substance_4(base_settings):\n    \"\"\"No. 4 tests collection for Substance.\n    Test File: substance-example-f201-dust.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"substance-example-f201-dust.json\"\n    inst = substance.Substance.model_validate_json(filename.read_bytes())\n    assert \"Substance\" == inst.get_resource_type()\n\n    impl_substance_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Substance\" == data[\"resourceType\"]\n\n    inst2 = substance.Substance(**data)\n    impl_substance_4(inst2)\n\n\ndef impl_substance_5(inst):\n    assert inst.category[0].coding[0].code == \"allergen\"\n    assert inst.category[0].coding[0].display == \"Allergen\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/substance-category\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"apitoxin (Honey Bee Venom)\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/identifiers/substances\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"1463\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_substance_5(base_settings):\n    \"\"\"No. 5 tests collection for Substance.\n    Test File: substance-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"substance-example.json\"\n    inst = substance.Substance.model_validate_json(filename.read_bytes())\n    assert \"Substance\" == inst.get_resource_type()\n\n    impl_substance_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Substance\" == data[\"resourceType\"]\n\n    inst2 = substance.Substance(**data)\n    impl_substance_5(inst2)\n\n\ndef impl_substance_6(inst):\n    assert inst.code.coding[0].code == \"3092008\"\n    assert inst.code.coding[0].display == \"Staphylococcus Aureus\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"f202\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substance_6(base_settings):\n    \"\"\"No. 6 tests collection for Substance.\n    Test File: substance-example-f202-staphylococcus.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"substance-example-f202-staphylococcus.json\"\n    )\n    inst = substance.Substance.model_validate_json(filename.read_bytes())\n    assert \"Substance\" == inst.get_resource_type()\n\n    impl_substance_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Substance\" == data[\"resourceType\"]\n\n    inst2 = substance.Substance(**data)\n    impl_substance_6(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_substancedefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstanceDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import substancedefinition\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_substancedefinition_1(inst):\n    assert inst.classification[0].coding[0].code == \"100000075670\"\n    assert inst.classification[0].coding[0].display == \"Chemical\"\n    assert (\n        inst.classification[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/SubstanceType\"}\n        ).valueUri\n    )\n    assert inst.code[0].code.coding[0].code == \"SUB99611MIG\"\n    assert (\n        inst.code[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Substance\"}\n        ).valueUri\n    )\n    assert inst.domain.coding[0].code == \"100000000012\"\n    assert inst.domain.coding[0].display == \"Human use\"\n    assert (\n        inst.domain.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Domain\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/SMSId\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"100000099270\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].language[0].coding[0].code == \"100000072147\"\n    assert inst.name[0].language[0].coding[0].display == \"English\"\n    assert (\n        inst.name[0].language[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Language\"}\n        ).valueUri\n    )\n    assert inst.name[0].name == \"PARACETAMOL\"\n    assert inst.name[0].preferred is True\n    assert inst.name[0].status.coding[0].code == \"200000005004\"\n    assert inst.name[0].status.coding[0].display == \"Current\"\n    assert (\n        inst.name[0].status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Status\"}\n        ).valueUri\n    )\n    assert inst.name[1].language[0].coding[0].code == \"100000072181\"\n    assert inst.name[1].language[0].coding[0].display == \"Greek, Modern (1453-)\"\n    assert (\n        inst.name[1].language[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Language\"}\n        ).valueUri\n    )\n    assert inst.name[1].name == \"ΠΑΡΑΚΕΤΑΜΌΛΗ\"\n    assert inst.name[1].preferred is False\n    assert inst.name[1].status.coding[0].code == \"200000005004\"\n    assert inst.name[1].status.coding[0].display == \"Current\"\n    assert (\n        inst.name[1].status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Status\"}\n        ).valueUri\n    )\n    assert inst.name[2].language[0].coding[0].code == \"100000072142\"\n    assert inst.name[2].language[0].coding[0].display == \"Bulgarian\"\n    assert (\n        inst.name[2].language[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Language\"}\n        ).valueUri\n    )\n    assert inst.name[2].name == \"ПАРАЦЕТАМОЛ\"\n    assert inst.name[2].preferred is False\n    assert inst.name[2].status.coding[0].code == \"200000005004\"\n    assert inst.name[2].status.coding[0].display == \"Current\"\n    assert (\n        inst.name[2].status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Status\"}\n        ).valueUri\n    )\n    assert inst.name[3].language[0].coding[0].code == \"100000072147\"\n    assert inst.name[3].language[0].coding[0].display == \"English\"\n    assert (\n        inst.name[3].language[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Language\"}\n        ).valueUri\n    )\n    assert inst.name[3].name == \"ACETAMINOPHEN\"\n    assert inst.name[3].preferred is False\n    assert inst.name[3].status.coding[0].code == \"200000005004\"\n    assert inst.name[3].status.coding[0].display == \"Current\"\n    assert (\n        inst.name[3].status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Status\"}\n        ).valueUri\n    )\n    assert inst.status.coding[0].code == \"200000005004\"\n    assert inst.status.coding[0].display == \"Current\"\n    assert (\n        inst.status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Status\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substancedefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for SubstanceDefinition.\n    Test File: substancedefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"substancedefinition-example.json\"\n    inst = substancedefinition.SubstanceDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"SubstanceDefinition\" == inst.get_resource_type()\n\n    impl_substancedefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SubstanceDefinition\" == data[\"resourceType\"]\n\n    inst2 = substancedefinition.SubstanceDefinition(**data)\n    impl_substancedefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_supplydelivery.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SupplyDelivery\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import supplydelivery\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_supplydelivery_1(inst):\n    assert inst.basedOn[0].reference == \"SupplyRequest/simpleorder\"\n    assert inst.destination.display == \"Location 1\"\n    assert inst.id == \"simpledelivery\"\n    assert inst.identifier[0].value == \"Order10284\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-12-31\"}\n        ).valueDateTime\n    )\n    assert inst.partOf[0].display == \"Central Supply Restock\"\n    assert inst.status == \"completed\"\n    assert inst.suppliedItem.itemCodeableConcept.coding[0].code == \"BlueTubes\"\n    assert (\n        inst.suppliedItem.itemCodeableConcept.coding[0].display\n        == \"Blood collect tubes blue cap\"\n    )\n    assert float(inst.suppliedItem.quantity.value) == float(10)\n    assert inst.supplier.display == \"Vendor1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"device\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/supply-item-type\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"Blood collect tubes blue cap\"\n\n\ndef test_supplydelivery_1(base_settings):\n    \"\"\"No. 1 tests collection for SupplyDelivery.\n    Test File: supplydelivery-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"supplydelivery-example.json\"\n    inst = supplydelivery.SupplyDelivery.model_validate_json(filename.read_bytes())\n    assert \"SupplyDelivery\" == inst.get_resource_type()\n\n    impl_supplydelivery_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SupplyDelivery\" == data[\"resourceType\"]\n\n    inst2 = supplydelivery.SupplyDelivery(**data)\n    impl_supplydelivery_1(inst2)\n\n\ndef impl_supplydelivery_2(inst):\n    assert inst.destination.display == \"Home care dept\"\n    assert inst.id == \"pumpdelivery\"\n    assert inst.identifier[0].assigner.display == \"SupplierDeliveryNr\"\n    assert inst.identifier[0].value == \"98398459409\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.display == \"Mr. Belpit\"\n    assert inst.receiver[0].display == \"Nurse Smith\"\n    assert inst.status == \"in-progress\"\n    assert inst.supplier.display == \"ACME distribution\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_supplydelivery_2(base_settings):\n    \"\"\"No. 2 tests collection for SupplyDelivery.\n    Test File: supplydelivery-example-pumpdelivery.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"supplydelivery-example-pumpdelivery.json\"\n    )\n    inst = supplydelivery.SupplyDelivery.model_validate_json(filename.read_bytes())\n    assert \"SupplyDelivery\" == inst.get_resource_type()\n\n    impl_supplydelivery_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SupplyDelivery\" == data[\"resourceType\"]\n\n    inst2 = supplydelivery.SupplyDelivery(**data)\n    impl_supplydelivery_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_supplyrequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SupplyRequest\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import supplyrequest\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_supplyrequest_1(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-12-31\"}\n        ).valueDateTime\n    )\n    assert inst.category.coding[0].code == \"central\"\n    assert inst.category.coding[0].display == \"Central Stock Resupply\"\n    assert inst.deliverFrom.display == \"Location 1\"\n    assert inst.deliverTo.display == \"GoodHealth Clinic Receiving\"\n    assert inst.id == \"simpleorder\"\n    assert inst.identifier[0].value == \"Order10284\"\n    assert inst.itemCodeableConcept.coding[0].code == \"BlueTubes\"\n    assert inst.itemCodeableConcept.coding[0].display == \"Blood collect tubes blue cap\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-12-31\"}\n        ).valueDateTime\n    )\n    assert inst.priority == \"asap\"\n    assert float(inst.quantity.value) == float(10)\n    assert inst.reasonCode[0].coding[0].code == \"stock_low\"\n    assert inst.reasonCode[0].coding[0].display == \"Refill due to low stock\"\n    assert inst.requester.display == \"Henry Seven\"\n    assert inst.status == \"active\"\n    assert inst.supplier[0].display == \"Vendor1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_supplyrequest_1(base_settings):\n    \"\"\"No. 1 tests collection for SupplyRequest.\n    Test File: supplyrequest-example-simpleorder.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"supplyrequest-example-simpleorder.json\"\n    )\n    inst = supplyrequest.SupplyRequest.model_validate_json(filename.read_bytes())\n    assert \"SupplyRequest\" == inst.get_resource_type()\n\n    impl_supplyrequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SupplyRequest\" == data[\"resourceType\"]\n\n    inst2 = supplyrequest.SupplyRequest(**data)\n    impl_supplyrequest_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_task.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Task\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import task\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_task_1(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].display == \"General Wellness Careplan\"\n    assert inst.businessStatus.text == \"test completed and posted\"\n    assert inst.code.text == \"Lipid Panel\"\n    assert inst.description == (\n        \"Create order for getting specimen, Set up inhouse testing,  \"\n        \"generate order for any sendouts and submit with specimen\"\n    )\n    assert inst.encounter.display == \"Example In-Patient Encounter\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.executionPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T18:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.executionPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.focus.display == \"Lipid Panel Request\"\n    assert inst.focus.reference == \"ServiceRequest/lipid\"\n    assert inst.for_fhir.display == \"Peter James Chalmers\"\n    assert inst.for_fhir.reference == \"Patient/example\"\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/accession/identifiers\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.use == \"official\"\n    assert inst.groupIdentifier.value == \"G20170201-001\"\n    assert inst.id == \"example6\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20170201-001\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T18:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.output[0].type.text == \"DiagnosticReport generated\"\n    assert inst.output[0].valueReference.reference == \"DiagnosticReport/lipids\"\n    assert inst.output[1].type.text == \"collected specimen\"\n    assert inst.output[1].valueReference.reference == \"Specimen/101\"\n    assert inst.owner.display == \"Clinical Laboratory @ Acme Hospital\"\n    assert inst.owner.reference == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    assert inst.performerType[0].coding[0].code == \"performer\"\n    assert inst.performerType[0].coding[0].display == \"Performer\"\n    assert (\n        inst.performerType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/task-performer-type\"}\n        ).valueUri\n    )\n    assert inst.performerType[0].text == \"Performer\"\n    assert inst.priority == \"routine\"\n    assert inst.reasonCode.text == (\n        \"The Task.reason should only be included if there is no \"\n        \"Task.focus or if it differs from the reason indicated on the\"\n        \" focus\"\n    )\n    assert inst.requester.display == \"Dr Adam Careful\"\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert (\n        inst.restriction.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-02T09:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.restriction.repetitions == 1\n    assert inst.status == \"completed\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_1(base_settings):\n    \"\"\"No. 1 tests collection for Task.\n    Test File: task-example6.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example6.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_1(inst2)\n\n\ndef impl_task_2(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-12T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"poll\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskcode\"}\n        ).valueUri\n    )\n    assert inst.id == \"fm-example2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/happyvalley.com/task\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20181012-005\"\n    assert inst.input[0].type.coding[0].code == \"include\"\n    assert (\n        inst.input[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskinputtype\"}\n        ).valueUri\n    )\n    assert inst.input[0].valueCode == \"ClaimResponse\"\n    assert inst.input[1].type.coding[0].code == \"period\"\n    assert (\n        inst.input[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskinputtype\"}\n        ).valueUri\n    )\n    assert (\n        inst.input[1].valuePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-12\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.input[1].valuePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-01\"}\n        ).valueDateTime\n    )\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-12T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.owner.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/identifiers\"}\n        ).valueUri\n    )\n    assert inst.owner.identifier.value == \"12345\"\n    assert inst.priority == \"stat\"\n    assert inst.requester.display == \"Happy Valley Clinic\"\n    assert inst.requester.reference == \"Organization/example\"\n    assert inst.status == \"requested\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_2(base_settings):\n    \"\"\"No. 2 tests collection for Task.\n    Test File: task-example-fm-poll.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example-fm-poll.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_2(inst2)\n\n\ndef impl_task_3(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].display == \"General Wellness Careplan\"\n    assert inst.businessStatus.text == \"waiting for specimen\"\n    assert inst.code.text == \"Lipid Panel\"\n    assert inst.contained[0].id == \"signature\"\n    assert inst.description == (\n        \"Create order for getting specimen, Set up inhouse testing,  \"\n        \"generate order for any sendouts and submit with specimen\"\n    )\n    assert inst.encounter.display == \"Example In-Patient Encounter\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.executionPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.focus.display == \"Lipid Panel Request\"\n    assert inst.focus.reference == \"ServiceRequest/lipid\"\n    assert inst.for_fhir.display == \"Peter James Chalmers\"\n    assert inst.for_fhir.reference == \"Patient/example\"\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/accession/identifiers\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.use == \"official\"\n    assert inst.groupIdentifier.value == \"G20170201-001\"\n    assert inst.id == \"example1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20170201-001\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T09:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.owner.display == \"Clinical Laboratory @ Acme Hospital\"\n    assert inst.owner.reference == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    assert inst.performerType[0].coding[0].code == \"performer\"\n    assert inst.performerType[0].coding[0].display == \"Performer\"\n    assert (\n        inst.performerType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/task-performer-type\"}\n        ).valueUri\n    )\n    assert inst.performerType[0].text == \"Performer\"\n    assert inst.priority == \"routine\"\n    assert inst.reasonCode.text == (\n        \"The Task.reason should only be included if there is no \"\n        \"Task.focus or if it differs from the reason indicated on the\"\n        \" focus\"\n    )\n    assert inst.relevantHistory[0].display == \"Author's Signature\"\n    assert inst.relevantHistory[0].reference == \"#signature\"\n    assert inst.requester.display == \"Dr Adam Careful\"\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert (\n        inst.restriction.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-02T09:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.restriction.repetitions == 1\n    assert inst.status == \"in-progress\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_3(base_settings):\n    \"\"\"No. 3 tests collection for Task.\n    Test File: task-example1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example1.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_3(inst2)\n\n\ndef impl_task_4(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"reprocess\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskcode\"}\n        ).valueUri\n    )\n    assert (\n        inst.focus.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.focus.identifier.value == \"1501\"\n    assert inst.id == \"fm-example4\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/happyvalley.com/task\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20181012-006\"\n    assert inst.input[0].type.coding[0].code == \"origresponse\"\n    assert (\n        inst.input[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskinputtype\"}\n        ).valueUri\n    )\n    assert (\n        inst.input[0].valueReference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/claimresponse\"}\n        ).valueUri\n    )\n    assert inst.input[0].valueReference.identifier.value == \"CR201810040001234\"\n    assert inst.input[1].type.coding[0].code == \"reference\"\n    assert (\n        inst.input[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskinputtype\"}\n        ).valueUri\n    )\n    assert inst.input[1].valueString == \"BR12345\"\n    assert inst.input[2].type.coding[0].code == \"item\"\n    assert (\n        inst.input[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskinputtype\"}\n        ).valueUri\n    )\n    assert inst.input[2].valuePositiveInt == 2\n    assert inst.input[3].type.coding[0].code == \"item\"\n    assert (\n        inst.input[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskinputtype\"}\n        ).valueUri\n    )\n    assert inst.input[3].valuePositiveInt == 3\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.owner.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/identifiers\"}\n        ).valueUri\n    )\n    assert inst.owner.identifier.value == \"12345\"\n    assert inst.priority == \"stat\"\n    assert inst.requester.display == \"Happy Valley Clinic\"\n    assert inst.requester.reference == \"Organization/example\"\n    assert inst.status == \"requested\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_4(base_settings):\n    \"\"\"No. 4 tests collection for Task.\n    Test File: task-example-fm-reprocess.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example-fm-reprocess.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_4(inst2)\n\n\ndef impl_task_5(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-03-10T22:39:32-04:00\"}\n        ).valueDateTime\n    )\n    assert inst.code.text == \"Refill Request\"\n    assert inst.focus.reference == \"MedicationRequest/medrx002\"\n    assert inst.for_fhir.reference == \"Patient/f001\"\n    assert inst.id == \"example3\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-03-10T22:39:32-04:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.owner.reference == \"Practitioner/example\"\n    assert inst.requester.reference == \"Patient/example\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_5(base_settings):\n    \"\"\"No. 5 tests collection for Task.\n    Test File: task-example3.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example3.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_5(inst2)\n\n\ndef impl_task_6(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"status\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskcode\"}\n        ).valueUri\n    )\n    assert (\n        inst.focus.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.focus.identifier.value == \"1500\"\n    assert inst.id == \"fm-example6\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/happyvalley.com/task\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20181012-001\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/identifiers/12345\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"123GB5674\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.output[0].type.coding[0].code == \"status\"\n    assert (\n        inst.output[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/financial-taskoutputtype\"}\n        ).valueUri\n    )\n    assert inst.output[0].valueCode == \"complete\"\n    assert (\n        inst.owner.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/identifiers\"}\n        ).valueUri\n    )\n    assert inst.owner.identifier.value == \"12345\"\n    assert inst.priority == \"stat\"\n    assert inst.requester.display == \"Happy Valley Clinic\"\n    assert inst.requester.reference == \"Organization/example\"\n    assert inst.status == \"completed\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_6(base_settings):\n    \"\"\"No. 6 tests collection for Task.\n    Test File: task-example-fm-status-resp.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example-fm-status-resp.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_6(inst2)\n\n\ndef impl_task_7(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.businessStatus.text == \"waiting for patient\"\n    assert inst.code.text == \"Specimen Collection\"\n    assert inst.encounter.display == \"Example In-Patient Encounter\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.executionPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.focus.display == \"BloodDraw ServiceRequest\"\n    assert inst.for_fhir.display == \"Peter James Chalmers\"\n    assert inst.for_fhir.reference == \"Patient/example\"\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/accession/identifiers\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.use == \"official\"\n    assert inst.groupIdentifier.value == \"G20170201-001\"\n    assert inst.id == \"example2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20170201-002\"\n    assert inst.intent == \"filler-order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T09:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.owner.display == \"Clinical Laboratory @ Acme Hospital\"\n    assert inst.owner.reference == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    assert inst.partOf[0].display == \"Lipid Panel\"\n    assert inst.partOf[0].reference == \"Task/example1\"\n    assert inst.performerType[0].coding[0].code == \"performer\"\n    assert inst.performerType[0].coding[0].display == \"Performer\"\n    assert (\n        inst.performerType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/task-performer-type\"}\n        ).valueUri\n    )\n    assert inst.performerType[0].text == \"Performer\"\n    assert inst.priority == \"routine\"\n    assert inst.requester.display == \"Clinical Laboratory @ Acme Hospital\"\n    assert (\n        inst.requester.reference == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    )\n    assert (\n        inst.restriction.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-01T09:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.restriction.repetitions == 1\n    assert inst.status == \"accepted\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_7(base_settings):\n    \"\"\"No. 7 tests collection for Task.\n    Test File: task-example2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example2.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_7(inst2)\n\n\ndef impl_task_8(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"release\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskcode\"}\n        ).valueUri\n    )\n    assert (\n        inst.focus.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.focus.identifier.value == \"1501\"\n    assert inst.id == \"fm-example3\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/happyvalley.com/task\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20181012-001\"\n    assert inst.input[0].type.coding[0].code == \"origresponse\"\n    assert (\n        inst.input[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/financial-taskinputtype\"}\n        ).valueUri\n    )\n    assert (\n        inst.input[0].valueReference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/claimresponse\"}\n        ).valueUri\n    )\n    assert inst.input[0].valueReference.identifier.value == \"CR201810040001234\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.owner.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/identifiers\"}\n        ).valueUri\n    )\n    assert inst.owner.identifier.value == \"12345\"\n    assert inst.priority == \"stat\"\n    assert inst.requester.display == \"Happy Valley Clinic\"\n    assert inst.requester.reference == \"Organization/example\"\n    assert inst.status == \"requested\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_8(base_settings):\n    \"\"\"No. 8 tests collection for Task.\n    Test File: task-example-fm-release.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example-fm-release.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_8(inst2)\n\n\ndef impl_task_9(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"cancel\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskcode\"}\n        ).valueUri\n    )\n    assert (\n        inst.focus.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.focus.identifier.value == \"1500\"\n    assert inst.id == \"fm-example1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/happyvalley.com/task\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20181012-001\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.owner.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/identifiers\"}\n        ).valueUri\n    )\n    assert inst.owner.identifier.value == \"12345\"\n    assert inst.priority == \"stat\"\n    assert inst.requester.display == \"Happy Valley Clinic\"\n    assert inst.requester.reference == \"Organization/example\"\n    assert inst.status == \"requested\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_9(base_settings):\n    \"\"\"No. 9 tests collection for Task.\n    Test File: task-example-fm-cancel.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example-fm-cancel.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_9(inst2)\n\n\ndef impl_task_10(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].display == \"General Wellness Careplan\"\n    assert inst.businessStatus.text == \"specimen received, test in progress\"\n    assert inst.code.text == \"Lipid Panel\"\n    assert inst.description == (\n        \"Create order for getting specimen, Set up inhouse testing,  \"\n        \"generate order for any sendouts and submit with specimen\"\n    )\n    assert inst.encounter.display == \"Example In-Patient Encounter\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.executionPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.focus.display == \"Lipid Panel Request\"\n    assert inst.focus.reference == \"ServiceRequest/lipid\"\n    assert inst.for_fhir.display == \"Peter James Chalmers\"\n    assert inst.for_fhir.reference == \"Patient/example\"\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/accession/identifiers\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.use == \"official\"\n    assert inst.groupIdentifier.value == \"G20170201-001\"\n    assert inst.id == \"example5\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20170201-001\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T16:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.output[0].type.text == \"collected specimen\"\n    assert inst.output[0].valueReference.reference == \"Specimen/101\"\n    assert inst.owner.display == \"Clinical Laboratory @ Acme Hospital\"\n    assert inst.owner.reference == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    assert inst.performerType[0].coding[0].code == \"performer\"\n    assert inst.performerType[0].coding[0].display == \"Performer\"\n    assert (\n        inst.performerType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/task-performer-type\"}\n        ).valueUri\n    )\n    assert inst.performerType[0].text == \"Performer\"\n    assert inst.priority == \"routine\"\n    assert inst.reasonCode.text == (\n        \"The Task.reason should only be included if there is no \"\n        \"Task.focus or if it differs from the reason indicated on the\"\n        \" focus\"\n    )\n    assert inst.requester.display == \"Dr Adam Careful\"\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert (\n        inst.restriction.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-02T09:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.restriction.repetitions == 1\n    assert inst.status == \"in-progress\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_10(base_settings):\n    \"\"\"No. 10 tests collection for Task.\n    Test File: task-example5.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example5.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_terminologycapabilities.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import terminologycapabilities\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_terminologycapabilities_1(inst):\n    assert inst.codeSearch == \"explicit\"\n    assert inst.contact[0].name == \"System Administrator\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].value == \"wile@acme.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This is the FHIR capability statement for the main EHR at \"\n        \"ACME for the private interface - it does not describe the \"\n        \"public interface\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"example\"\n    assert inst.implementation.description == \"Acme Terminology Server\"\n    assert (\n        inst.implementation.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://example.org/tx\"}\n        ).valueUrl\n    )\n    assert inst.kind == \"instance\"\n    assert inst.name == \"ACME-EHR\"\n    assert inst.publisher == \"ACME Corporation\"\n    assert inst.software.name == \"TxServer\"\n    assert inst.software.version == \"0.1.2\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"ACME EHR capability statement\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311\"}\n        ).valueUri\n    )\n    assert inst.version == \"20130510\"\n\n\ndef test_terminologycapabilities_1(base_settings):\n    \"\"\"No. 1 tests collection for TerminologyCapabilities.\n    Test File: terminologycapabilities-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"terminologycapabilities-example.json\"\n    )\n    inst = terminologycapabilities.TerminologyCapabilities.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"TerminologyCapabilities\" == inst.get_resource_type()\n\n    impl_terminologycapabilities_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TerminologyCapabilities\" == data[\"resourceType\"]\n\n    inst2 = terminologycapabilities.TerminologyCapabilities(**data)\n    impl_terminologycapabilities_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_testreport.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TestReport\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import testreport\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_testreport_1(inst):\n    assert inst.id == \"testreport-example\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.9878\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-07T08:25:34-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestReport Example for TestScript Example\"\n    assert inst.participant[0].display == \"Crucible\"\n    assert inst.participant[0].type == \"test-engine\"\n    assert (\n        inst.participant[0].uri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://projectcrucible.org\"}\n        ).valueUri\n    )\n    assert inst.participant[1].display == \"HealthIntersections STU3\"\n    assert inst.participant[1].type == \"server\"\n    assert (\n        inst.participant[1].uri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir3.healthintersections.com.au/open\"}\n        ).valueUri\n    )\n    assert inst.result == \"pass\"\n    assert float(inst.score) == float(100.0)\n    assert (\n        inst.setup.action[0].operation.detail\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://projectcrucible.org/permalink/1\"}\n        ).valueUri\n    )\n    assert inst.setup.action[0].operation.message == \"DELETE Patient\"\n    assert inst.setup.action[0].operation.result == \"pass\"\n    assert (\n        inst.setup.action[1].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/1\"\n    )\n    assert inst.setup.action[1].assert_fhir.message == \"HTTP 204\"\n    assert inst.setup.action[1].assert_fhir.result == \"pass\"\n    assert (\n        inst.setup.action[2].operation.detail\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://projectcrucible.org/permalink/1\"}\n        ).valueUri\n    )\n    assert (\n        inst.setup.action[2].operation.message == \"POST Patient/fixture-patient-create\"\n    )\n    assert inst.setup.action[2].operation.result == \"pass\"\n    assert (\n        inst.setup.action[3].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/1\"\n    )\n    assert inst.setup.action[3].assert_fhir.message == \"HTTP 201\"\n    assert inst.setup.action[3].assert_fhir.result == \"pass\"\n    assert inst.status == \"completed\"\n    assert (\n        inst.teardown.action[0].operation.detail\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://projectcrucible.org/permalink/3\"}\n        ).valueUri\n    )\n    assert (\n        inst.teardown.action[0].operation.message\n        == \"DELETE Patient/fixture-patient-create.\"\n    )\n    assert inst.teardown.action[0].operation.result == \"pass\"\n    assert inst.testScript.reference == \"TestScript/testscript-example\"\n    assert (\n        inst.test[0].action[0].operation.detail\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://projectcrucible.org/permalink/2\"}\n        ).valueUri\n    )\n    assert (\n        inst.test[0].action[0].operation.message == \"GET Patient/fixture-patient-create\"\n    )\n    assert inst.test[0].action[0].operation.result == \"pass\"\n    assert (\n        inst.test[0].action[1].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert inst.test[0].action[1].assert_fhir.message == \"HTTP 200\"\n    assert inst.test[0].action[1].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[2].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert inst.test[0].action[2].assert_fhir.message == \"Last-Modified Present\"\n    assert inst.test[0].action[2].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[3].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert inst.test[0].action[3].assert_fhir.message == \"Response is Patient\"\n    assert inst.test[0].action[3].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[4].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert inst.test[0].action[4].assert_fhir.message == \"Response validates\"\n    assert inst.test[0].action[4].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[5].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert (\n        inst.test[0].action[5].assert_fhir.message == \"Patient.name.family 'Chalmers'\"\n    )\n    assert inst.test[0].action[5].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[6].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert inst.test[0].action[6].assert_fhir.message == \"Patient.name.given 'Peter'\"\n    assert inst.test[0].action[6].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[7].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert (\n        inst.test[0].action[7].assert_fhir.message == \"Patient.name.family 'Chalmers'\"\n    )\n    assert inst.test[0].action[7].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[8].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert (\n        inst.test[0].action[8].assert_fhir.message == \"Patient.name.family 'Chalmers'\"\n    )\n    assert inst.test[0].action[8].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[9].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert inst.test[0].action[9].assert_fhir.message == \"Patient expected values.\"\n    assert inst.test[0].action[9].assert_fhir.result == \"pass\"\n    assert inst.test[0].description == \"Read a Patient and validate response.\"\n    assert inst.test[0].id == \"01-ReadPatient\"\n    assert inst.test[0].name == \"Read Patient\"\n    assert inst.tester == \"HL7 Execution Engine\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_testreport_1(base_settings):\n    \"\"\"No. 1 tests collection for TestReport.\n    Test File: testreport-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testreport-example.json\"\n    inst = testreport.TestReport.model_validate_json(filename.read_bytes())\n    assert \"TestReport\" == inst.get_resource_type()\n\n    impl_testreport_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestReport\" == data[\"resourceType\"]\n\n    inst2 = testreport.TestReport(**data)\n    impl_testreport_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_testscript.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TestScript\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import testscript\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_testscript_1(inst):\n    assert inst.contact[0].name == \"Support\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"support@HL7.org\"\n    assert inst.copyright == \"© HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-18\"}\n        ).valueDateTime\n    )\n    assert inst.destination[0].index == 1\n    assert inst.destination[0].profile.code == \"FHIR-Server\"\n    assert inst.destination[1].index == 2\n    assert inst.destination[1].profile.code == \"FHIR-Server\"\n    assert inst.experimental is True\n    assert inst.id == \"testscript-example-multisystem\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.9878\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert inst.metadata.capability[0].description == \"Patient Read Operation\"\n    assert inst.metadata.capability[0].destination == 1\n    assert (\n        inst.metadata.capability[0].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#read\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[0].origin[0] == 1\n    assert inst.metadata.capability[0].required is True\n    assert inst.metadata.capability[0].validated is False\n    assert (\n        inst.metadata.capability[1].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert inst.metadata.capability[1].description == \"Patient Read Operation\"\n    assert inst.metadata.capability[1].destination == 2\n    assert (\n        inst.metadata.capability[1].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#read\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[1].origin[0] == 1\n    assert inst.metadata.capability[1].required is True\n    assert inst.metadata.capability[1].validated is False\n    assert inst.metadata.link[0].description == (\n        \"Demographics and other administrative information about an \"\n        \"individual or animal receiving care or other health-related \"\n        \"services.\"\n    )\n    assert (\n        inst.metadata.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/patient.html\"}\n        ).valueUri\n    )\n    assert inst.name == \"testscript-example-multisystem\"\n    assert inst.origin[0].index == 1\n    assert inst.origin[0].profile.code == \"FHIR-Client\"\n    assert inst.publisher == \"HL7\"\n    assert inst.purpose == \"Patient Read Operation\"\n    assert inst.status == \"draft\"\n    assert inst.test[0].action[0].operation.accept == \"xml\"\n    assert inst.test[0].action[0].operation.contentType == \"xml\"\n    assert inst.test[0].action[0].operation.description == (\n        \"Read a Patient from the first destination test system and \"\n        \"perform basic validation.\"\n    )\n    assert inst.test[0].action[0].operation.destination == 1\n    assert inst.test[0].action[0].operation.encodeRequestUrl is True\n    assert inst.test[0].action[0].operation.origin == 1\n    assert inst.test[0].action[0].operation.params == \"/${Dest1PatientResourceId}\"\n    assert inst.test[0].action[0].operation.requestId == \"request-read-patient-01\"\n    assert inst.test[0].action[0].operation.resource == \"Patient\"\n    assert inst.test[0].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[0].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert inst.test[0].action[1].assert_fhir.description == (\n        \"Confirm that the request method GET was sent by the client \"\n        \"system under test.\"\n    )\n    assert inst.test[0].action[1].assert_fhir.requestMethod == \"get\"\n    assert inst.test[0].action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[2].assert_fhir.description\n        == \"Confirm that the client requested an Accept of xml.\"\n    )\n    assert inst.test[0].action[2].assert_fhir.direction == \"request\"\n    assert inst.test[0].action[2].assert_fhir.headerField == \"Accept\"\n    assert inst.test[0].action[2].assert_fhir.operator == \"contains\"\n    assert inst.test[0].action[2].assert_fhir.value == \"xml\"\n    assert inst.test[0].action[2].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[3].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[0].action[3].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[3].assert_fhir.response == \"okay\"\n    assert inst.test[0].action[3].assert_fhir.warningOnly is False\n    assert inst.test[0].action[4].assert_fhir.contentType == \"xml\"\n    assert (\n        inst.test[0].action[4].assert_fhir.description\n        == \"Confirm that the returned format is XML.\"\n    )\n    assert inst.test[0].action[4].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[4].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[5].assert_fhir.description\n        == \"Confirm that the returned resource type is Patient.\"\n    )\n    assert inst.test[0].action[5].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[5].assert_fhir.resource == \"Patient\"\n    assert inst.test[0].action[5].assert_fhir.warningOnly is False\n    assert inst.test[0].description == (\n        \"Read a Patient from the first destination test system using \"\n        \"the user defined dynamic variable ${Dest1PatientResourceId}.\"\n        \" Perform basic validation.\"\n    )\n    assert inst.test[0].id == \"01-ReadPatient-Destination1\"\n    assert inst.test[0].name == \"ReadPatient-Destination1\"\n    assert inst.test[1].action[0].operation.accept == \"xml\"\n    assert inst.test[1].action[0].operation.contentType == \"xml\"\n    assert inst.test[1].action[0].operation.description == (\n        \"Read a Patient from the second destination test system and \"\n        \"perform basic validation.\"\n    )\n    assert inst.test[1].action[0].operation.destination == 2\n    assert inst.test[1].action[0].operation.encodeRequestUrl is True\n    assert inst.test[1].action[0].operation.origin == 1\n    assert inst.test[1].action[0].operation.params == \"/${Dest2PatientResourceId}\"\n    assert inst.test[1].action[0].operation.requestHeader[0].field == \"Accept-Charset\"\n    assert inst.test[1].action[0].operation.requestHeader[0].value == \"utf-8\"\n    assert inst.test[1].action[0].operation.resource == \"Patient\"\n    assert inst.test[1].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[1].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.test[1].action[1].assert_fhir.description\n        == \"Confirm that the client requested an Accept of xml.\"\n    )\n    assert inst.test[1].action[1].assert_fhir.direction == \"request\"\n    assert inst.test[1].action[1].assert_fhir.headerField == \"Accept\"\n    assert inst.test[1].action[1].assert_fhir.operator == \"contains\"\n    assert inst.test[1].action[1].assert_fhir.value == \"xml\"\n    assert inst.test[1].action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.test[1].action[2].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[1].action[2].assert_fhir.direction == \"response\"\n    assert inst.test[1].action[2].assert_fhir.response == \"okay\"\n    assert inst.test[1].action[2].assert_fhir.warningOnly is False\n    assert inst.test[1].action[3].assert_fhir.contentType == \"xml\"\n    assert (\n        inst.test[1].action[3].assert_fhir.description\n        == \"Confirm that the returned format is XML.\"\n    )\n    assert inst.test[1].action[3].assert_fhir.direction == \"response\"\n    assert inst.test[1].action[3].assert_fhir.warningOnly is False\n    assert (\n        inst.test[1].action[4].assert_fhir.description\n        == \"Confirm that the returned resource type is Patient.\"\n    )\n    assert inst.test[1].action[4].assert_fhir.direction == \"response\"\n    assert inst.test[1].action[4].assert_fhir.resource == \"Patient\"\n    assert inst.test[1].action[4].assert_fhir.warningOnly is False\n    assert inst.test[1].description == (\n        \"Read a Patient from the second destination test system using\"\n        \" the user defined dynamic variable \"\n        \"${Dest2PatientResourceId}. Perform basic validation.\"\n    )\n    assert inst.test[1].id == \"02-ReadPatient-Destination2\"\n    assert inst.test[1].name == \"ReadPatient-Destination2\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Multisystem Test Script\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/TestScript/testscript-example-multisystem\"\n            }\n        ).valueUri\n    )\n    assert inst.variable[0].defaultValue == \"example\"\n    assert inst.variable[0].name == \"Dest1PatientResourceId\"\n    assert inst.variable[1].defaultValue == \"example\"\n    assert inst.variable[1].name == \"Dest2PatientResourceId\"\n    assert inst.version == \"1.0\"\n\n\ndef test_testscript_1(base_settings):\n    \"\"\"No. 1 tests collection for TestScript.\n    Test File: testscript-example-multisystem.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"testscript-example-multisystem.json\"\n    )\n    inst = testscript.TestScript.model_validate_json(filename.read_bytes())\n    assert \"TestScript\" == inst.get_resource_type()\n\n    impl_testscript_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestScript\" == data[\"resourceType\"]\n\n    inst2 = testscript.TestScript(**data)\n    impl_testscript_1(inst2)\n\n\ndef impl_testscript_2(inst):\n    assert inst.contact[0].name == \"Support\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"support@HL7.org\"\n    assert inst.copyright == \"© HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-18\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.fixture[0].autocreate is False\n    assert inst.fixture[0].autodelete is False\n    assert inst.fixture[0].id == \"fixture-patient-create\"\n    assert inst.fixture[0].resource.display == \"Peter Chalmers\"\n    assert inst.fixture[0].resource.reference == \"Patient/example\"\n    assert inst.fixture[1].autocreate is False\n    assert inst.fixture[1].autodelete is False\n    assert inst.fixture[1].id == \"fixture-patient-update\"\n    assert inst.fixture[1].resource.display == \"Donald Duck\"\n    assert inst.fixture[1].resource.reference == \"Patient/pat1\"\n    assert inst.id == \"testscript-example-history\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.9877\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert (\n        inst.metadata.capability[0].description\n        == \"Patient Update, Delete and History (Instance) Operations\"\n    )\n    assert (\n        inst.metadata.capability[0].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#update\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].link[1]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#delete\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].link[2]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#history\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[0].required is True\n    assert inst.metadata.capability[0].validated is False\n    assert inst.metadata.link[0].description == (\n        \"Demographics and other administrative information about an \"\n        \"individual or animal receiving care or other health-related \"\n        \"services.\"\n    )\n    assert (\n        inst.metadata.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/patient.html\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestScript Example History\"\n    assert inst.profile[0].id == \"bundle-profile\"\n    assert inst.profile[0].reference == \"http://hl7.org/fhir/StructureDefinition/Bundle\"\n    assert inst.publisher == \"HL7\"\n    assert inst.purpose == (\n        \"Patient (Conditional) Create, Update, Delete and History \"\n        \"(Instance) Operations\"\n    )\n    assert inst.setup.action[0].operation.accept == \"json\"\n    assert inst.setup.action[0].operation.description == (\n        \"Execute a delete operation to insure the patient does not \"\n        \"exist on the server.\"\n    )\n    assert inst.setup.action[0].operation.encodeRequestUrl is True\n    assert inst.setup.action[0].operation.label == \"SetupDeletePatient\"\n    assert inst.setup.action[0].operation.params == \"/${createResourceId}\"\n    assert inst.setup.action[0].operation.resource == \"Patient\"\n    assert inst.setup.action[0].operation.type.code == \"delete\"\n    assert (\n        inst.setup.action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert inst.setup.action[1].assert_fhir.description == (\n        \"Confirm that the returned HTTP status is 200(OK) or 204(No \" \"Content).\"\n    )\n    assert inst.setup.action[1].assert_fhir.direction == \"response\"\n    assert inst.setup.action[1].assert_fhir.operator == \"in\"\n    assert inst.setup.action[1].assert_fhir.responseCode == \"200,204\"\n    assert inst.setup.action[1].assert_fhir.warningOnly is False\n    assert inst.setup.action[2].operation.accept == \"json\"\n    assert inst.setup.action[2].operation.contentType == \"json\"\n    assert inst.setup.action[2].operation.description == (\n        \"Create patient resource on test server using the contents of\"\n        \" fixture-patient-create\"\n    )\n    assert inst.setup.action[2].operation.encodeRequestUrl is True\n    assert inst.setup.action[2].operation.label == \"SetupCreatePatient\"\n    assert inst.setup.action[2].operation.params == \"/${createResourceId}\"\n    assert inst.setup.action[2].operation.resource == \"Patient\"\n    assert inst.setup.action[2].operation.sourceId == \"fixture-patient-create\"\n    assert inst.setup.action[2].operation.type.code == \"update\"\n    assert (\n        inst.setup.action[2].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.setup.action[3].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 201(Created).\"\n    )\n    assert inst.setup.action[3].assert_fhir.direction == \"response\"\n    assert inst.setup.action[3].assert_fhir.responseCode == \"201\"\n    assert inst.setup.action[3].assert_fhir.warningOnly is False\n    assert inst.setup.action[4].operation.accept == \"json\"\n    assert inst.setup.action[4].operation.contentType == \"json\"\n    assert inst.setup.action[4].operation.description == (\n        \"Update patient resource on test server using the contents of\"\n        \" fixture-patient-update\"\n    )\n    assert inst.setup.action[4].operation.encodeRequestUrl is True\n    assert inst.setup.action[4].operation.label == \"SetupUpdatePatient\"\n    assert inst.setup.action[4].operation.params == \"/${createResourceId}\"\n    assert inst.setup.action[4].operation.resource == \"Patient\"\n    assert inst.setup.action[4].operation.sourceId == \"fixture-patient-update\"\n    assert inst.setup.action[4].operation.type.code == \"update\"\n    assert (\n        inst.setup.action[4].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.setup.action[5].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.setup.action[5].assert_fhir.direction == \"response\"\n    assert inst.setup.action[5].assert_fhir.responseCode == \"200\"\n    assert inst.setup.action[5].assert_fhir.warningOnly is False\n    assert inst.status == \"draft\"\n    assert inst.test[0].action[0].operation.accept == \"json\"\n    assert inst.test[0].action[0].operation.contentType == \"json\"\n    assert inst.test[0].action[0].operation.description == (\n        \"Get the Patient history on the test server using the id from\"\n        \" fixture-patient-create.\"\n    )\n    assert inst.test[0].action[0].operation.encodeRequestUrl is True\n    assert inst.test[0].action[0].operation.resource == \"Patient\"\n    assert inst.test[0].action[0].operation.targetId == \"fixture-patient-create\"\n    assert inst.test[0].action[0].operation.type.code == \"history\"\n    assert (\n        inst.test[0].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.test[0].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[0].action[1].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[1].assert_fhir.response == \"okay\"\n    assert inst.test[0].action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[2].assert_fhir.description\n        == \"Confirm that the returned resource type is Bundle.\"\n    )\n    assert inst.test[0].action[2].assert_fhir.resource == \"Bundle\"\n    assert inst.test[0].action[2].assert_fhir.warningOnly is False\n    assert inst.test[0].action[3].assert_fhir.description == (\n        \"Confirm that the returned Bundle conforms to the base FHIR \" \"specification.\"\n    )\n    assert inst.test[0].action[3].assert_fhir.validateProfileId == \"bundle-profile\"\n    assert inst.test[0].action[3].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[4].assert_fhir.description\n        == \"Confirm that the returned Bundle type equals 'history'.\"\n    )\n    assert inst.test[0].action[4].assert_fhir.operator == \"equals\"\n    assert inst.test[0].action[4].assert_fhir.path == \"fhir:Bundle/fhir:type/@value\"\n    assert inst.test[0].action[4].assert_fhir.value == \"history\"\n    assert inst.test[0].action[4].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].description\n        == \"Get the history for a known Patient and validate response.\"\n    )\n    assert inst.test[0].id == \"01-HistoryPatient\"\n    assert inst.test[0].name == \"History Patient\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/TestScript/testscript-example-history\"}\n        ).valueUri\n    )\n    assert inst.variable[0].name == \"createResourceId\"\n    assert inst.variable[0].path == \"Patient/id\"\n    assert inst.variable[0].sourceId == \"fixture-patient-create\"\n    assert inst.version == \"1.0\"\n\n\ndef test_testscript_2(base_settings):\n    \"\"\"No. 2 tests collection for TestScript.\n    Test File: testscript-example-history.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testscript-example-history.json\"\n    inst = testscript.TestScript.model_validate_json(filename.read_bytes())\n    assert \"TestScript\" == inst.get_resource_type()\n\n    impl_testscript_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestScript\" == data[\"resourceType\"]\n\n    inst2 = testscript.TestScript(**data)\n    impl_testscript_2(inst2)\n\n\ndef impl_testscript_3(inst):\n    assert inst.contact[0].name == \"Support\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"support@HL7.org\"\n    assert inst.copyright == \"© HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-18\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"TestScript example resource with setup to delete if present \"\n        \"and create a new instance of a Patient; and single test \"\n        \"definition to update that Patient with various asserts.\"\n    )\n    assert inst.experimental is True\n    assert inst.fixture[0].autocreate is False\n    assert inst.fixture[0].autodelete is False\n    assert inst.fixture[0].id == \"fixture-patient-create\"\n    assert inst.fixture[0].resource.display == \"Peter Chalmers\"\n    assert inst.fixture[0].resource.reference == \"Patient/example\"\n    assert inst.fixture[1].autocreate is False\n    assert inst.fixture[1].autodelete is False\n    assert inst.fixture[1].id == \"fixture-patient-update\"\n    assert inst.fixture[1].resource.display == \"Donald Duck\"\n    assert inst.fixture[1].resource.reference == \"Patient/pat1\"\n    assert inst.id == \"testscript-example-update\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.9882\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert (\n        inst.metadata.capability[0].description\n        == \"Patient Update and Delete Operations\"\n    )\n    assert (\n        inst.metadata.capability[0].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#update\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].link[1]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#delete\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[0].required is True\n    assert inst.metadata.capability[0].validated is False\n    assert inst.metadata.link[0].description == (\n        \"Demographics and other administrative information about an \"\n        \"individual or animal receiving care or other health-related \"\n        \"services.\"\n    )\n    assert (\n        inst.metadata.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/patient.html\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestScript Example Update\"\n    assert inst.profile[0].id == \"patient-profile\"\n    assert (\n        inst.profile[0].reference == \"http://hl7.org/fhir/StructureDefinition/Patient\"\n    )\n    assert inst.publisher == \"HL7\"\n    assert inst.purpose == \"Patient (Conditional) Create, Update, Delete Operations\"\n    assert inst.setup.action[0].operation.accept == \"xml\"\n    assert inst.setup.action[0].operation.description == (\n        \"Execute a delete operation to insure the patient does not \"\n        \"exist on the server.\"\n    )\n    assert inst.setup.action[0].operation.encodeRequestUrl is True\n    assert inst.setup.action[0].operation.label == \"SetupDeletePatient\"\n    assert inst.setup.action[0].operation.params == \"/${createResourceId}\"\n    assert inst.setup.action[0].operation.resource == \"Patient\"\n    assert inst.setup.action[0].operation.type.code == \"delete\"\n    assert (\n        inst.setup.action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert inst.setup.action[1].assert_fhir.description == (\n        \"Confirm that the returned HTTP status is 200(OK) or 204(No \" \"Content).\"\n    )\n    assert inst.setup.action[1].assert_fhir.direction == \"response\"\n    assert inst.setup.action[1].assert_fhir.operator == \"in\"\n    assert inst.setup.action[1].assert_fhir.responseCode == \"200,204\"\n    assert inst.setup.action[1].assert_fhir.warningOnly is False\n    assert inst.setup.action[2].operation.accept == \"xml\"\n    assert inst.setup.action[2].operation.contentType == \"xml\"\n    assert inst.setup.action[2].operation.description == (\n        \"Create patient resource on test server using the contents of\"\n        \" fixture-patient-create\"\n    )\n    assert inst.setup.action[2].operation.encodeRequestUrl is True\n    assert inst.setup.action[2].operation.label == \"SetupCreatePatient\"\n    assert inst.setup.action[2].operation.params == \"/${createResourceId}\"\n    assert inst.setup.action[2].operation.resource == \"Patient\"\n    assert inst.setup.action[2].operation.sourceId == \"fixture-patient-create\"\n    assert inst.setup.action[2].operation.type.code == \"update\"\n    assert (\n        inst.setup.action[2].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.setup.action[3].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 201(Created).\"\n    )\n    assert inst.setup.action[3].assert_fhir.direction == \"response\"\n    assert inst.setup.action[3].assert_fhir.responseCode == \"201\"\n    assert inst.setup.action[3].assert_fhir.warningOnly is False\n    assert inst.status == \"draft\"\n    assert inst.test[0].action[0].operation.accept == \"xml\"\n    assert inst.test[0].action[0].operation.contentType == \"xml\"\n    assert inst.test[0].action[0].operation.description == (\n        \"Update patient resource on test server using the contents of\"\n        \" fixture-patient-update\"\n    )\n    assert inst.test[0].action[0].operation.encodeRequestUrl is True\n    assert inst.test[0].action[0].operation.label == \"SetupUpdatePatient\"\n    assert inst.test[0].action[0].operation.params == \"/${createResourceId}\"\n    assert inst.test[0].action[0].operation.resource == \"Patient\"\n    assert inst.test[0].action[0].operation.sourceId == \"fixture-patient-update\"\n    assert inst.test[0].action[0].operation.type.code == \"update\"\n    assert (\n        inst.test[0].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.test[0].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[0].action[1].assert_fhir.response == \"okay\"\n    assert inst.test[0].action[1].assert_fhir.warningOnly is False\n    assert inst.test[0].action[2].assert_fhir.contentType == \"xml\"\n    assert (\n        inst.test[0].action[2].assert_fhir.description\n        == \"Confirm that the returned format is XML.\"\n    )\n    assert inst.test[0].action[2].assert_fhir.warningOnly is False\n    assert inst.test[0].action[3].assert_fhir.description == (\n        \"Confirm that the returned HTTP Header Last-Modified is \"\n        \"present. Warning only as the server might not support \"\n        \"versioning.\"\n    )\n    assert inst.test[0].action[3].assert_fhir.headerField == \"Last-Modified\"\n    assert inst.test[0].action[3].assert_fhir.operator == \"notEmpty\"\n    assert inst.test[0].action[3].assert_fhir.warningOnly is True\n    assert inst.test[0].description == \"Update a Patient and validate response.\"\n    assert inst.test[0].id == \"01-UpdatePatient\"\n    assert inst.test[0].name == \"Update Patient\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/TestScript/testscript-example-update\"}\n        ).valueUri\n    )\n    assert inst.variable[0].name == \"createResourceId\"\n    assert inst.variable[0].path == \"Patient/id\"\n    assert inst.variable[0].sourceId == \"fixture-patient-create\"\n    assert inst.version == \"1.0\"\n\n\ndef test_testscript_3(base_settings):\n    \"\"\"No. 3 tests collection for TestScript.\n    Test File: testscript-example-update.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testscript-example-update.json\"\n    inst = testscript.TestScript.model_validate_json(filename.read_bytes())\n    assert \"TestScript\" == inst.get_resource_type()\n\n    impl_testscript_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestScript\" == data[\"resourceType\"]\n\n    inst2 = testscript.TestScript(**data)\n    impl_testscript_3(inst2)\n\n\ndef impl_testscript_4(inst):\n    assert inst.contact[0].name == \"Support\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"support@HL7.org\"\n    assert inst.copyright == \"© HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-18\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"TestScript example resource with simple Patient search test.\"\n        \" The read tests will utilize user defined dynamic variables \"\n        \"that will hold the Patient search parameter values.\"\n    )\n    assert inst.experimental is True\n    assert inst.fixture[0].autocreate is False\n    assert inst.fixture[0].autodelete is False\n    assert inst.fixture[0].id == \"fixture-patient-create\"\n    assert inst.fixture[0].resource.display == \"Peter Chalmers\"\n    assert inst.fixture[0].resource.reference == \"Patient/example\"\n    assert inst.id == \"testscript-example-search\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.9881\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert inst.metadata.capability[0].description == \"Patient Search Operation\"\n    assert (\n        inst.metadata.capability[0].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#search\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[0].required is True\n    assert inst.metadata.capability[0].validated is False\n    assert inst.metadata.link[0].description == (\n        \"Demographics and other administrative information about an \"\n        \"individual or animal receiving care or other health-related \"\n        \"services.\"\n    )\n    assert (\n        inst.metadata.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/patient.html\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestScript Example Search\"\n    assert inst.profile[0].id == \"bundle-profile\"\n    assert inst.profile[0].reference == \"http://hl7.org/fhir/StructureDefinition/Bundle\"\n    assert inst.publisher == \"HL7\"\n    assert inst.purpose == \"Patient Search Operation\"\n    assert inst.setup.action[0].operation.accept == \"xml\"\n    assert (\n        inst.setup.action[0].operation.description\n        == \"Test simple search to verify server support.\"\n    )\n    assert inst.setup.action[0].operation.encodeRequestUrl is True\n    assert (\n        inst.setup.action[0].operation.params\n        == \"?family=DONTEXPECTAMATCH&given=DONTEXPECTAMATCH\"\n    )\n    assert inst.setup.action[0].operation.resource == \"Patient\"\n    assert inst.setup.action[0].operation.type.code == \"search\"\n    assert (\n        inst.setup.action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert inst.setup.action[1].assert_fhir.description == (\n        \"Confirm that the request url contains the family search \" \"parameter.\"\n    )\n    assert inst.setup.action[1].assert_fhir.direction == \"request\"\n    assert inst.setup.action[1].assert_fhir.operator == \"contains\"\n    assert inst.setup.action[1].assert_fhir.requestURL == \"family\"\n    assert inst.setup.action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.setup.action[2].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.setup.action[2].assert_fhir.direction == \"response\"\n    assert inst.setup.action[2].assert_fhir.responseCode == \"200\"\n    assert inst.setup.action[2].assert_fhir.warningOnly is False\n    assert (\n        inst.setup.action[3].assert_fhir.description\n        == \"Confirm that the returned resource type is Bundle.\"\n    )\n    assert inst.setup.action[3].assert_fhir.resource == \"Bundle\"\n    assert inst.setup.action[3].assert_fhir.warningOnly is False\n    assert inst.setup.action[4].assert_fhir.description == (\n        \"Confirm that the returned Bundle correctly defines the \" \"navigation links.\"\n    )\n    assert inst.setup.action[4].assert_fhir.navigationLinks is True\n    assert inst.setup.action[4].assert_fhir.warningOnly is False\n    assert inst.status == \"draft\"\n    assert inst.test[0].action[0].operation.accept == \"xml\"\n    assert inst.test[0].action[0].operation.contentType == \"xml\"\n    assert inst.test[0].action[0].operation.description == (\n        \"Create a Patient resource and capture the returned HTTP \" \"Header Location.\"\n    )\n    assert inst.test[0].action[0].operation.encodeRequestUrl is True\n    assert inst.test[0].action[0].operation.resource == \"Patient\"\n    assert inst.test[0].action[0].operation.responseId == \"PatientCreateResponse\"\n    assert inst.test[0].action[0].operation.sourceId == \"fixture-patient-create\"\n    assert inst.test[0].action[0].operation.type.code == \"create\"\n    assert (\n        inst.test[0].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.test[0].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 201(Created).\"\n    )\n    assert inst.test[0].action[1].assert_fhir.response == \"created\"\n    assert inst.test[0].action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[2].assert_fhir.description\n        == \"Confirm that the returned HTTP Header Location is present.\"\n    )\n    assert inst.test[0].action[2].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[2].assert_fhir.headerField == \"Location\"\n    assert inst.test[0].action[2].assert_fhir.operator == \"notEmpty\"\n    assert inst.test[0].action[2].assert_fhir.warningOnly is False\n    assert inst.test[0].action[3].operation.accept == \"xml\"\n    assert inst.test[0].action[3].operation.description == (\n        \"Read the created Patient using the captured Location URL \" \"value.\"\n    )\n    assert inst.test[0].action[3].operation.encodeRequestUrl is True\n    assert inst.test[0].action[3].operation.type.code == \"read\"\n    assert (\n        inst.test[0].action[3].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert inst.test[0].action[3].operation.url == \"${PatientCreateLocation}\"\n    assert (\n        inst.test[0].action[4].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[0].action[4].assert_fhir.response == \"okay\"\n    assert inst.test[0].action[4].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[5].assert_fhir.description\n        == \"Confirm that the returned resource type is Patient.\"\n    )\n    assert inst.test[0].action[5].assert_fhir.resource == \"Patient\"\n    assert inst.test[0].action[5].assert_fhir.warningOnly is False\n    assert inst.test[0].description == (\n        \"Create a Patient resource and capture the returned HTTP \"\n        \"Header Location. Then search for (read) that Patient using \"\n        \"the Location URL value and validate the response.\"\n    )\n    assert inst.test[0].id == \"01-PatientCreateSearch\"\n    assert inst.test[0].name == \"Patient Create Search\"\n    assert inst.test[1].action[0].operation.accept == \"xml\"\n    assert (\n        inst.test[1].action[0].operation.description\n        == \"Search for Patient resources on the destination test system.\"\n    )\n    assert inst.test[1].action[0].operation.encodeRequestUrl is True\n    assert inst.test[1].action[0].operation.params == (\n        \"?family=${PatientSearchFamilyName}&given=${PatientSearchGive\" \"nName}\"\n    )\n    assert inst.test[1].action[0].operation.resource == \"Patient\"\n    assert inst.test[1].action[0].operation.type.code == \"search\"\n    assert (\n        inst.test[1].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.test[1].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[1].action[1].assert_fhir.response == \"okay\"\n    assert inst.test[1].action[1].assert_fhir.warningOnly is False\n    assert inst.test[1].action[2].assert_fhir.contentType == \"xml\"\n    assert (\n        inst.test[1].action[2].assert_fhir.description\n        == \"Confirm that the returned format is XML.\"\n    )\n    assert inst.test[1].action[2].assert_fhir.warningOnly is False\n    assert (\n        inst.test[1].action[3].assert_fhir.description\n        == \"Confirm that the returned resource type is Bundle.\"\n    )\n    assert inst.test[1].action[3].assert_fhir.resource == \"Bundle\"\n    assert inst.test[1].action[3].assert_fhir.warningOnly is False\n    assert inst.test[1].action[4].assert_fhir.description == (\n        \"Confirm that the returned Bundle conforms to the base FHIR \" \"specification.\"\n    )\n    assert inst.test[1].action[4].assert_fhir.validateProfileId == \"bundle-profile\"\n    assert inst.test[1].action[4].assert_fhir.warningOnly is False\n    assert (\n        inst.test[1].action[5].assert_fhir.description\n        == \"Confirm that the returned Bundle type equals 'searchset'.\"\n    )\n    assert inst.test[1].action[5].assert_fhir.operator == \"equals\"\n    assert inst.test[1].action[5].assert_fhir.path == \"fhir:Bundle/fhir:type/@value\"\n    assert inst.test[1].action[5].assert_fhir.value == \"searchset\"\n    assert inst.test[1].action[5].assert_fhir.warningOnly is False\n    assert inst.test[1].action[6].assert_fhir.description == (\n        \"Confirm that the returned Bundle total is greater than or \"\n        \"equal to the number of returned entries.\"\n    )\n    assert (\n        inst.test[1].action[6].assert_fhir.expression\n        == \"Bundle.total.toInteger() >= entry.count()\"\n    )\n    assert inst.test[1].action[6].assert_fhir.warningOnly is False\n    assert inst.test[1].description == (\n        \"Search for Patient resources using the user defined dynamic \"\n        \"variables ${PatientSearchFamilyName} and \"\n        \"${PatientSearchGivenName} and validate response.\"\n    )\n    assert inst.test[1].id == \"02-PatientSearchDynamic\"\n    assert inst.test[1].name == \"Patient Search Dynamic\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/TestScript/testscript-example-search\"}\n        ).valueUri\n    )\n    assert inst.variable[0].headerField == \"Location\"\n    assert inst.variable[0].name == \"PatientCreateLocation\"\n    assert inst.variable[0].sourceId == \"PatientCreateResponse\"\n    assert inst.variable[1].description == (\n        \"Enter patient search criteria for a known family name on the\" \" target system\"\n    )\n    assert inst.variable[1].hint == \"[Family name]\"\n    assert inst.variable[1].name == \"PatientSearchFamilyName\"\n    assert inst.variable[2].description == (\n        \"Enter patient search criteria for a known given name on the \" \"target system\"\n    )\n    assert inst.variable[2].hint == \"[Given name]\"\n    assert inst.variable[2].name == \"PatientSearchGivenName\"\n    assert (\n        inst.variable[3].description\n        == \"Evaluate the returned Patient searchset Bundle.total value\"\n    )\n    assert inst.variable[3].expression == \"Bundle.total.toInteger()\"\n    assert inst.variable[3].name == \"PatientSearchBundleTotal\"\n    assert inst.version == \"1.0\"\n\n\ndef test_testscript_4(base_settings):\n    \"\"\"No. 4 tests collection for TestScript.\n    Test File: testscript-example-search.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testscript-example-search.json\"\n    inst = testscript.TestScript.model_validate_json(filename.read_bytes())\n    assert \"TestScript\" == inst.get_resource_type()\n\n    impl_testscript_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestScript\" == data[\"resourceType\"]\n\n    inst2 = testscript.TestScript(**data)\n    impl_testscript_4(inst2)\n\n\ndef impl_testscript_5(inst):\n    assert inst.contact[0].name == \"Support\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"support@HL7.org\"\n    assert inst.copyright == \"© HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-18\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"TestScript example resource with setup to delete if present \"\n        \"and create a new instance of a Patient; and single test \"\n        \"definition to read the created Patient with various asserts.\"\n    )\n    assert inst.experimental is True\n    assert inst.fixture[0].autocreate is False\n    assert inst.fixture[0].autodelete is False\n    assert inst.fixture[0].id == \"fixture-patient-create\"\n    assert inst.fixture[0].resource.display == \"Peter Chalmers\"\n    assert inst.fixture[0].resource.reference == \"Patient/example\"\n    assert inst.fixture[1].autocreate is False\n    assert inst.fixture[1].autodelete is False\n    assert inst.fixture[1].id == \"fixture-patient-minimum\"\n    assert inst.fixture[1].resource.display == \"Peter Chalmers (minimum)\"\n    assert inst.fixture[1].resource.reference == \"Patient/example\"\n    assert inst.id == \"testscript-example\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.9876\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert (\n        inst.metadata.capability[0].description\n        == \"Patient Update, Read and Delete Operations\"\n    )\n    assert (\n        inst.metadata.capability[0].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#delete\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].link[1]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#read\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].link[2]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#update\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[0].required is True\n    assert inst.metadata.capability[0].validated is False\n    assert inst.metadata.link[0].description == (\n        \"Demographics and other administrative information about an \"\n        \"individual or animal receiving care or other health-related \"\n        \"services.\"\n    )\n    assert (\n        inst.metadata.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/patient.html\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestScript Example\"\n    assert inst.profile[0].id == \"patient-profile\"\n    assert (\n        inst.profile[0].reference == \"http://hl7.org/fhir/StructureDefinition/Patient\"\n    )\n    assert inst.publisher == \"HL7\"\n    assert inst.purpose == (\n        \"Patient Conditional Create (Update), Read and Delete \" \"Operations\"\n    )\n    assert inst.setup.action[0].operation.accept == \"json\"\n    assert inst.setup.action[0].operation.description == (\n        \"Execute a delete operation to insure the patient does not \"\n        \"exist on the server.\"\n    )\n    assert inst.setup.action[0].operation.encodeRequestUrl is True\n    assert inst.setup.action[0].operation.label == \"SetupDeletePatient\"\n    assert inst.setup.action[0].operation.params == \"/${createResourceId}\"\n    assert inst.setup.action[0].operation.resource == \"Patient\"\n    assert inst.setup.action[0].operation.type.code == \"delete\"\n    assert (\n        inst.setup.action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert inst.setup.action[1].assert_fhir.description == (\n        \"Confirm that the returned HTTP status is 200(OK) or 204(No \" \"Content).\"\n    )\n    assert inst.setup.action[1].assert_fhir.direction == \"response\"\n    assert inst.setup.action[1].assert_fhir.operator == \"in\"\n    assert inst.setup.action[1].assert_fhir.responseCode == \"200,204\"\n    assert inst.setup.action[1].assert_fhir.warningOnly is False\n    assert inst.setup.action[2].operation.accept == \"json\"\n    assert inst.setup.action[2].operation.contentType == \"json\"\n    assert inst.setup.action[2].operation.description == (\n        \"Create patient resource on test server using the contents of\"\n        \" fixture-patient-create\"\n    )\n    assert inst.setup.action[2].operation.encodeRequestUrl is True\n    assert inst.setup.action[2].operation.label == \"SetupCreatePatient\"\n    assert inst.setup.action[2].operation.params == \"/${createResourceId}\"\n    assert inst.setup.action[2].operation.resource == \"Patient\"\n    assert inst.setup.action[2].operation.sourceId == \"fixture-patient-create\"\n    assert inst.setup.action[2].operation.type.code == \"update\"\n    assert (\n        inst.setup.action[2].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.setup.action[3].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 201(Created).\"\n    )\n    assert inst.setup.action[3].assert_fhir.direction == \"response\"\n    assert inst.setup.action[3].assert_fhir.responseCode == \"201\"\n    assert inst.setup.action[3].assert_fhir.warningOnly is False\n    assert inst.setup.action[4].operation.description == (\n        \"Read the created patient resource on the test server using \"\n        \"the id from fixture-patient-create. Verify contents.\"\n    )\n    assert inst.setup.action[4].operation.encodeRequestUrl is True\n    assert inst.setup.action[4].operation.resource == \"Patient\"\n    assert inst.setup.action[4].operation.targetId == \"fixture-patient-create\"\n    assert inst.setup.action[4].operation.type.code == \"read\"\n    assert (\n        inst.setup.action[4].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.setup.action[5].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.setup.action[5].assert_fhir.direction == \"response\"\n    assert inst.setup.action[5].assert_fhir.response == \"okay\"\n    assert inst.setup.action[5].assert_fhir.warningOnly is False\n    assert (\n        inst.setup.action[6].assert_fhir.compareToSourceExpression\n        == \"Patient.name.first().family\"\n    )\n    assert (\n        inst.setup.action[6].assert_fhir.compareToSourceId == \"fixture-patient-create\"\n    )\n    assert inst.setup.action[6].assert_fhir.description == (\n        \"Confirm that the returned Patient contains the expected \"\n        \"family name 'Chalmers'. Uses explicit compareToSourceId \"\n        \"reference to fixture-patient-create used to create the \"\n        \"Patient.\"\n    )\n    assert inst.setup.action[6].assert_fhir.operator == \"equals\"\n    assert inst.setup.action[6].assert_fhir.warningOnly is False\n    assert inst.status == \"draft\"\n    assert inst.teardown.action[0].operation.description == (\n        \"Delete the patient resource on the test server using the id \"\n        \"from fixture-patient-create.\"\n    )\n    assert inst.teardown.action[0].operation.encodeRequestUrl is True\n    assert inst.teardown.action[0].operation.resource == \"Patient\"\n    assert inst.teardown.action[0].operation.targetId == \"fixture-patient-create\"\n    assert inst.teardown.action[0].operation.type.code == \"delete\"\n    assert (\n        inst.teardown.action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert inst.test[0].action[0].operation.description == (\n        \"Read the patient resource on the test server using the id \"\n        \"from fixture-patient-create. Prevent URL encoding of the \"\n        \"request.\"\n    )\n    assert inst.test[0].action[0].operation.encodeRequestUrl is False\n    assert inst.test[0].action[0].operation.resource == \"Patient\"\n    assert inst.test[0].action[0].operation.responseId == \"fixture-patient-read\"\n    assert inst.test[0].action[0].operation.targetId == \"fixture-patient-create\"\n    assert inst.test[0].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[0].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.test[0].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[0].action[1].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[1].assert_fhir.label == \"01-ReadPatientOK\"\n    assert inst.test[0].action[1].assert_fhir.response == \"okay\"\n    assert inst.test[0].action[1].assert_fhir.warningOnly is False\n    assert inst.test[0].action[2].assert_fhir.description == (\n        \"Confirm that the returned HTTP Header Last-Modified is \"\n        \"present. Warning only as the server might not support \"\n        \"versioning.\"\n    )\n    assert inst.test[0].action[2].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[2].assert_fhir.headerField == \"Last-Modified\"\n    assert inst.test[0].action[2].assert_fhir.operator == \"notEmpty\"\n    assert inst.test[0].action[2].assert_fhir.warningOnly is True\n    assert (\n        inst.test[0].action[3].assert_fhir.description\n        == \"Confirm that the returned resource type is Patient.\"\n    )\n    assert inst.test[0].action[3].assert_fhir.resource == \"Patient\"\n    assert inst.test[0].action[3].assert_fhir.warningOnly is False\n    assert inst.test[0].action[4].assert_fhir.description == (\n        \"Confirm that the returned Patient conforms to the base FHIR \" \"specification.\"\n    )\n    assert inst.test[0].action[4].assert_fhir.validateProfileId == \"patient-profile\"\n    assert inst.test[0].action[4].assert_fhir.warningOnly is False\n    assert inst.test[0].action[5].assert_fhir.description == (\n        \"Confirm that the returned Patient contains the expected \"\n        \"family name 'Chalmers'. Uses explicit sourceId reference to \"\n        \"read responseId fixture.\"\n    )\n    assert inst.test[0].action[5].assert_fhir.operator == \"equals\"\n    assert (\n        inst.test[0].action[5].assert_fhir.path\n        == \"fhir:Patient/fhir:name/fhir:family/@value\"\n    )\n    assert inst.test[0].action[5].assert_fhir.sourceId == \"fixture-patient-read\"\n    assert inst.test[0].action[5].assert_fhir.value == \"Chalmers\"\n    assert inst.test[0].action[5].assert_fhir.warningOnly is False\n    assert inst.test[0].action[6].assert_fhir.description == (\n        \"Confirm that the returned Patient contains the expected \"\n        \"given name 'Peter'. Uses explicit sourceId reference to read\"\n        \" responseId fixture.\"\n    )\n    assert inst.test[0].action[6].assert_fhir.operator == \"equals\"\n    assert (\n        inst.test[0].action[6].assert_fhir.path\n        == \"fhir:Patient/fhir:name/fhir:given/@value\"\n    )\n    assert inst.test[0].action[6].assert_fhir.sourceId == \"fixture-patient-read\"\n    assert inst.test[0].action[6].assert_fhir.value == \"Peter\"\n    assert inst.test[0].action[6].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[7].assert_fhir.compareToSourceId == \"fixture-patient-create\"\n    )\n    assert (\n        inst.test[0].action[7].assert_fhir.compareToSourcePath\n        == \"fhir:Patient/fhir:name/fhir:family/@value\"\n    )\n    assert inst.test[0].action[7].assert_fhir.operator == \"equals\"\n    assert (\n        inst.test[0].action[7].assert_fhir.path\n        == \"fhir:Patient/fhir:name/fhir:family/@value\"\n    )\n    assert inst.test[0].action[7].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[8].assert_fhir.compareToSourceId == \"fixture-patient-create\"\n    )\n    assert (\n        inst.test[0].action[8].assert_fhir.compareToSourcePath\n        == \"fhir:Patient/fhir:name/fhir:given/@value\"\n    )\n    assert (\n        inst.test[0].action[8].assert_fhir.path\n        == \"fhir:Patient/fhir:name/fhir:given/@value\"\n    )\n    assert inst.test[0].action[8].assert_fhir.sourceId == \"fixture-patient-read\"\n    assert inst.test[0].action[8].assert_fhir.warningOnly is False\n    assert inst.test[0].action[9].assert_fhir.description == (\n        \"Confirm that the returned resource contains the expected \"\n        \"retained elements and values. Warning only to provide users \"\n        \"with reviewable results.\"\n    )\n    assert inst.test[0].action[9].assert_fhir.minimumId == \"fixture-patient-minimum\"\n    assert inst.test[0].action[9].assert_fhir.warningOnly is True\n    assert inst.test[0].description == \"Read a Patient and validate response.\"\n    assert inst.test[0].id == \"01-ReadPatient\"\n    assert inst.test[0].name == \"Read Patient\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/TestScript/testscript-example\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"positive\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variant-state\"}\n        ).valueUri\n    )\n    assert inst.variable[0].name == \"createResourceId\"\n    assert inst.variable[0].path == \"Patient/id\"\n    assert inst.variable[0].sourceId == \"fixture-patient-create\"\n    assert inst.version == \"1.0\"\n\n\ndef test_testscript_5(base_settings):\n    \"\"\"No. 5 tests collection for TestScript.\n    Test File: testscript-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testscript-example.json\"\n    inst = testscript.TestScript.model_validate_json(filename.read_bytes())\n    assert \"TestScript\" == inst.get_resource_type()\n\n    impl_testscript_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestScript\" == data[\"resourceType\"]\n\n    inst2 = testscript.TestScript(**data)\n    impl_testscript_5(inst2)\n\n\ndef impl_testscript_6(inst):\n    assert inst.contact[0].name == \"Support\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"support@HL7.org\"\n    assert inst.copyright == \"© HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-18\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"TestScript example resource with ported Sprinkler basic read\"\n        \" tests R001, R002, R003, R004. The read tests will utilize \"\n        \"user defined dynamic variables that will hold the Patient \"\n        \"resource id values.\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"testscript-example-readtest\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.9879\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert inst.metadata.capability[0].description == \"Patient Read Operation\"\n    assert (\n        inst.metadata.capability[0].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#read\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[0].required is True\n    assert inst.metadata.capability[0].validated is False\n    assert inst.metadata.link[0].description == (\n        \"Demographics and other administrative information about an \"\n        \"individual or animal receiving care or other health-related \"\n        \"services.\"\n    )\n    assert (\n        inst.metadata.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/patient.html\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestScript Example Read Test\"\n    assert inst.profile[0].id == \"patient-profile\"\n    assert (\n        inst.profile[0].reference == \"http://hl7.org/fhir/StructureDefinition/Patient\"\n    )\n    assert inst.publisher == \"HL7\"\n    assert inst.purpose == \"Patient Read Operation\"\n    assert inst.status == \"draft\"\n    assert inst.test[0].action[0].operation.accept == \"xml\"\n    assert inst.test[0].action[0].operation.description == (\n        \"Read the known Patient resource on the destination test \"\n        \"system using the user defined dynamic variable \"\n        \"${KnownPatientResourceId}.\"\n    )\n    assert inst.test[0].action[0].operation.encodeRequestUrl is True\n    assert inst.test[0].action[0].operation.params == \"/${KnownPatientResourceId}\"\n    assert inst.test[0].action[0].operation.resource == \"Patient\"\n    assert inst.test[0].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[0].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.test[0].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[0].action[1].assert_fhir.response == \"okay\"\n    assert inst.test[0].action[1].assert_fhir.warningOnly is False\n    assert inst.test[0].action[2].assert_fhir.contentType == \"xml\"\n    assert (\n        inst.test[0].action[2].assert_fhir.description\n        == \"Confirm that the returned format is XML.\"\n    )\n    assert inst.test[0].action[2].assert_fhir.warningOnly is False\n    assert inst.test[0].action[3].assert_fhir.description == (\n        \"Confirm that the returned HTTP Header Last-Modified is \"\n        \"present. Warning only as the server might not support \"\n        \"versioning.\"\n    )\n    assert inst.test[0].action[3].assert_fhir.headerField == \"Last-Modified\"\n    assert inst.test[0].action[3].assert_fhir.operator == \"notEmpty\"\n    assert inst.test[0].action[3].assert_fhir.warningOnly is True\n    assert (\n        inst.test[0].action[4].assert_fhir.description\n        == \"Confirm that the returned resource type is Patient.\"\n    )\n    assert inst.test[0].action[4].assert_fhir.resource == \"Patient\"\n    assert inst.test[0].action[4].assert_fhir.warningOnly is False\n    assert inst.test[0].action[5].assert_fhir.description == (\n        \"Confirm that the returned Patient conforms to the base FHIR \" \"specification.\"\n    )\n    assert inst.test[0].action[5].assert_fhir.validateProfileId == \"patient-profile\"\n    assert inst.test[0].action[5].assert_fhir.warningOnly is False\n    assert inst.test[0].description == \"Read a known Patient and validate response.\"\n    assert inst.test[0].id == \"R001\"\n    assert inst.test[0].name == \"Sprinkler Read Test R001\"\n    assert inst.test[1].action[0].operation.accept == \"xml\"\n    assert inst.test[1].action[0].operation.encodeRequestUrl is True\n    assert inst.test[1].action[0].operation.params == \"/1\"\n    assert inst.test[1].action[0].operation.resource == \"Patient\"\n    assert inst.test[1].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[1].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.test[1].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 404(Not Found).\"\n    )\n    assert inst.test[1].action[1].assert_fhir.response == \"notFound\"\n    assert inst.test[1].action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.test[1].description\n        == \"Read an unknown Resource Type and validate response.\"\n    )\n    assert inst.test[1].id == \"R002\"\n    assert inst.test[1].name == \"Sprinkler Read Test R002\"\n    assert inst.test[2].action[0].operation.accept == \"xml\"\n    assert inst.test[2].action[0].operation.description == (\n        \"Attempt to read the non-existing Patient resource on the \"\n        \"destination test system using the user defined dynamic \"\n        \"variable ${NonExistsPatientResourceId}.\"\n    )\n    assert inst.test[2].action[0].operation.encodeRequestUrl is True\n    assert inst.test[2].action[0].operation.params == \"/${NonExistsPatientResourceId}\"\n    assert inst.test[2].action[0].operation.resource == \"Patient\"\n    assert inst.test[2].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[2].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.test[2].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 404(Not Found).\"\n    )\n    assert inst.test[2].action[1].assert_fhir.response == \"notFound\"\n    assert inst.test[2].action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.test[2].description\n        == \"Read a known, non-existing Patient and validate response.\"\n    )\n    assert inst.test[2].id == \"R003\"\n    assert inst.test[2].name == \"Sprinkler Read Test R003\"\n    assert inst.test[3].action[0].operation.accept == \"xml\"\n    assert inst.test[3].action[0].operation.description == (\n        \"Attempt to read a Patient resource on the destination test \"\n        \"system using known bad formatted resource id.\"\n    )\n    assert inst.test[3].action[0].operation.encodeRequestUrl is True\n    assert inst.test[3].action[0].operation.params == \"/ID-may-not-contain-CAPITALS\"\n    assert inst.test[3].action[0].operation.resource == \"Patient\"\n    assert inst.test[3].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[3].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/testscript-operation-codes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.test[3].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 400(Bad Request).\"\n    )\n    assert inst.test[3].action[1].assert_fhir.response == \"bad\"\n    assert inst.test[3].action[1].assert_fhir.warningOnly is False\n    assert inst.test[3].description == (\n        \"Read a Patient using a known bad formatted resource id and \"\n        \"validate response.\"\n    )\n    assert inst.test[3].id == \"R004\"\n    assert inst.test[3].name == \"Sprinkler Read Test R004\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/TestScript/testscript-example-readtest\"}\n        ).valueUri\n    )\n    assert inst.variable[0].defaultValue == \"example\"\n    assert inst.variable[0].name == \"KnownPatientResourceId\"\n    assert inst.variable[1].defaultValue == \"does-not-exist\"\n    assert inst.variable[1].name == \"NonExistsPatientResourceId\"\n    assert inst.version == \"1.0\"\n\n\ndef test_testscript_6(base_settings):\n    \"\"\"No. 6 tests collection for TestScript.\n    Test File: testscript-example-readtest.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testscript-example-readtest.json\"\n    inst = testscript.TestScript.model_validate_json(filename.read_bytes())\n    assert \"TestScript\" == inst.get_resource_type()\n\n    impl_testscript_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestScript\" == data[\"resourceType\"]\n\n    inst2 = testscript.TestScript(**data)\n    impl_testscript_6(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_valueset.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ValueSet\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import valueset\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_valueset_1(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/device-status-reason\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"The availability status reason of the device.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"oo\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 2\n    assert inst.id == \"device-status-reason\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.1081\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T13:47:40.239+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"FHIRDeviceStatusReason\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"FHIRDeviceStatusReason\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/device-status-reason\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_valueset_1(base_settings):\n    \"\"\"No. 1 tests collection for ValueSet.\n    Test File: valueset-device-status-reason.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"valueset-device-status-reason.json\"\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_1(inst2)\n\n\ndef impl_valueset_2(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/definition-resource-types\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"A list of all the definition resource types defined in this \"\n        \"version of the FHIR specification.\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"vocab\"\n    assert inst.id == \"definition-resource-types\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.1056\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T12:47:40.239+10:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"DefinitionResourceType\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"DefinitionResourceType\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/definition-resource-types\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_valueset_2(base_settings):\n    \"\"\"No. 2 tests collection for ValueSet.\n    Test File: valueset-definition-resource-types.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"valueset-definition-resource-types.json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_2(inst2)\n\n\ndef impl_valueset_3(inst):\n    assert inst.compose.include[0].concept[0].code == \"419161000\"\n    assert inst.compose.include[0].concept[0].display == \"Unilateral left\"\n    assert inst.compose.include[0].concept[1].code == \"419465000\"\n    assert inst.compose.include[0].concept[1].display == \"Unilateral right\"\n    assert inst.compose.include[0].concept[2].code == \"51440002\"\n    assert inst.compose.include[0].concept[2].display == \"Bilateral\"\n    assert inst.compose.include[0].concept[3].code == \"261183002\"\n    assert inst.compose.include[0].concept[3].display == \"Upper\"\n    assert inst.compose.include[0].concept[4].code == \"261122009\"\n    assert inst.compose.include[0].concept[4].display == \"Lower\"\n    assert inst.compose.include[0].concept[5].code == \"255561001\"\n    assert inst.compose.include[0].concept[5].display == \"Medial\"\n    assert inst.compose.include[0].concept[6].code == \"49370004\"\n    assert inst.compose.include[0].concept[6].display == \"Lateral\"\n    assert inst.compose.include[0].concept[7].code == \"264217000\"\n    assert inst.compose.include[0].concept[7].display == \"Superior\"\n    assert inst.compose.include[0].concept[8].code == \"261089000\"\n    assert inst.compose.include[0].concept[8].display == \"Inferior\"\n    assert inst.compose.include[0].concept[9].code == \"255551008\"\n    assert inst.compose.include[0].concept[9].display == \"Posterior\"\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == \"SNOMED-CT concepts modifying the anatomic location\"\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"oo\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"draft\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"bodystructure-relative-location\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.140\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T12:47:40.239+10:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"BodystructureLocationQualifier\"\n    assert inst.publisher == \"Order and Observation Workgroup\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Bodystructure Location Qualifier\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/bodystructure-relative-location\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_valueset_3(base_settings):\n    \"\"\"No. 3 tests collection for ValueSet.\n    Test File: valueset-bodystructure-relative-location.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-bodystructure-relative-location.json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_3(inst2)\n\n\ndef impl_valueset_4(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/encounter-status\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Current state of the encounter.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"pa\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 2\n    assert inst.id == \"encounter-status\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.246\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T13:47:40.239+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"EncounterStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"EncounterStatus\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/encounter-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_valueset_4(base_settings):\n    \"\"\"No. 4 tests collection for ValueSet.\n    Test File: valueset-encounter-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"valueset-encounter-status.json\"\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_4(inst2)\n\n\ndef impl_valueset_5(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentscope\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.copyright == \"This is an example set.\"\n    assert inst.description == \"This value set includes the four Consent scope codes.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"cbcc\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 2\n    assert inst.id == \"consent-scope\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.761\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T12:47:40.239+10:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"ConsentScopeCodes\"\n    assert inst.publisher == \"CBCC\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Consent Scope Codes\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/consent-scope\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_valueset_5(base_settings):\n    \"\"\"No. 5 tests collection for ValueSet.\n    Test File: valueset-consent-scope.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"valueset-consent-scope.json\"\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_5(inst2)\n\n\ndef impl_valueset_6(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/report-status-codes\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"The current status of the test report.\"\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fhir\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 0\n    assert inst.id == \"report-status-codes\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.724\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T13:47:40.239+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"TestReportStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"TestReportStatus\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/report-status-codes\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_valueset_6(base_settings):\n    \"\"\"No. 6 tests collection for ValueSet.\n    Test File: valueset-report-status-codes.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"valueset-report-status-codes.json\"\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_6(inst2)\n\n\ndef impl_valueset_7(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/note-type\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-28T12:47:40+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"The presentation types of notes.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fm\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 2\n    assert inst.id == \"note-type\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.15\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T12:47:40.239+10:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"NoteType\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\"><ul><li>Include '\n        'all codes defined in <a href=\"codesystem-note-'\n        'type.html\"><code>http://hl7.org/fhir/note-'\n        \"type</code></a></li></ul></div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"NoteType\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/note-type\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_valueset_7(base_settings):\n    \"\"\"No. 7 tests collection for ValueSet.\n    Test File: valueset-note-type.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"valueset-note-type.json\"\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_7(inst2)\n\n\ndef impl_valueset_8(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://precision.fda.gov/apps/\"}\n        ).valueUri\n    )\n    assert (\n        inst.compose.include[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://precision.fda.gov/jobs/\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == \"This value set includes sequence quality method\"\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"cg\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"draft\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"sequence-quality-method\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.223\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T12:47:40.239+10:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"FDA-Method\"\n    assert inst.publisher == \"FHIR Project team\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/sequence-quality-method\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_valueset_8(base_settings):\n    \"\"\"No. 8 tests collection for ValueSet.\n    Test File: valueset-sequence-quality-method.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"valueset-sequence-quality-method.json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_8(inst2)\n\n\ndef impl_valueset_9(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/issue-severity\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-17T07:06:13+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"How the issue affects the success of the action.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fhir\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"normative\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"4.0.0\"\n    assert (\n        inst.extension[3].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[3].valueInteger == 5\n    assert inst.id == \"issue-severity\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.408\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T13:47:40.239+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"IssueSeverity\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"IssueSeverity\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/issue-severity\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_valueset_9(base_settings):\n    \"\"\"No. 9 tests collection for ValueSet.\n    Test File: valueset-issue-severity.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"valueset-issue-severity.json\"\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_9(inst2)\n\n\ndef impl_valueset_10(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ensembl.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.compose.include[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == \"This value set includes all Reference codes\"\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"cg\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"draft\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"sequence-referenceSeq\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.221\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2022-05-28T12:47:40.239+10:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"ENSEMBL\"\n    assert inst.publisher == \"FHIR Project team\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/sequence-referenceSeq\"}\n        ).valueUri\n    )\n    assert inst.version == \"4.3.0\"\n\n\ndef test_valueset_10(base_settings):\n    \"\"\"No. 10 tests collection for ValueSet.\n    Test File: valueset-sequence-referenceSeq.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"valueset-sequence-referenceSeq.json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_10(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_verificationresult.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/VerificationResult\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import verificationresult\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_verificationresult_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"attested\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_verificationresult_1(base_settings):\n    \"\"\"No. 1 tests collection for VerificationResult.\n    Test File: verificationresult-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"verificationresult-example.json\"\n    inst = verificationresult.VerificationResult.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"VerificationResult\" == inst.get_resource_type()\n\n    impl_verificationresult_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"VerificationResult\" == data[\"resourceType\"]\n\n    inst2 = verificationresult.VerificationResult(**data)\n    impl_verificationresult_1(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/tests/test_visionprescription.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/VisionPrescription\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\nfrom .. import visionprescription\nfrom .conftest import ExternalValidatorModel  # noqa: F401\n\n\ndef impl_visionprescription_1(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-06-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dateWritten\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-06-15\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"33124\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.happysight.com/prescription\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"15014\"\n    assert float(inst.lensSpecification[0].add) == float(1.75)\n    assert inst.lensSpecification[0].axis == 160\n    assert float(inst.lensSpecification[0].backCurve) == float(8.7)\n    assert inst.lensSpecification[0].brand == \"OphthaGuard\"\n    assert inst.lensSpecification[0].color == \"green\"\n    assert float(inst.lensSpecification[0].cylinder) == float(-2.25)\n    assert float(inst.lensSpecification[0].diameter) == float(14.0)\n    assert inst.lensSpecification[0].duration.code == \"mo\"\n    assert (\n        inst.lensSpecification[0].duration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.lensSpecification[0].duration.unit == \"mo\"\n    assert float(inst.lensSpecification[0].duration.value) == float(1)\n    assert inst.lensSpecification[0].eye == \"right\"\n    assert (\n        inst.lensSpecification[0].note[0].text\n        == \"Shade treatment for extreme light sensitivity\"\n    )\n    assert float(inst.lensSpecification[0].power) == float(-2.75)\n    assert inst.lensSpecification[0].product.coding[0].code == \"contact\"\n    assert (\n        inst.lensSpecification[0].product.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct\"\n            }\n        ).valueUri\n    )\n    assert float(inst.lensSpecification[1].add) == float(1.75)\n    assert inst.lensSpecification[1].axis == 160\n    assert float(inst.lensSpecification[1].backCurve) == float(8.7)\n    assert inst.lensSpecification[1].brand == \"OphthaGuard\"\n    assert inst.lensSpecification[1].color == \"green\"\n    assert float(inst.lensSpecification[1].cylinder) == float(-3.5)\n    assert float(inst.lensSpecification[1].diameter) == float(14.0)\n    assert inst.lensSpecification[1].duration.code == \"mo\"\n    assert (\n        inst.lensSpecification[1].duration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.lensSpecification[1].duration.unit == \"month\"\n    assert float(inst.lensSpecification[1].duration.value) == float(1)\n    assert inst.lensSpecification[1].eye == \"left\"\n    assert (\n        inst.lensSpecification[1].note[0].text\n        == \"Shade treatment for extreme light sensitivity\"\n    )\n    assert float(inst.lensSpecification[1].power) == float(-2.75)\n    assert inst.lensSpecification[1].product.coding[0].code == \"contact\"\n    assert (\n        inst.lensSpecification[1].product.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct\"\n            }\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.prescriber.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Sample Contract '\n        \"Lens prescription</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_visionprescription_1(base_settings):\n    \"\"\"No. 1 tests collection for VisionPrescription.\n    Test File: visionprescription-example-1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"visionprescription-example-1.json\"\n    inst = visionprescription.VisionPrescription.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"VisionPrescription\" == inst.get_resource_type()\n\n    impl_visionprescription_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"VisionPrescription\" == data[\"resourceType\"]\n\n    inst2 = visionprescription.VisionPrescription(**data)\n    impl_visionprescription_1(inst2)\n\n\ndef impl_visionprescription_2(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-06-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dateWritten\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-06-15\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"33123\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.happysight.com/prescription\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"15013\"\n    assert float(inst.lensSpecification[0].add) == float(2.0)\n    assert inst.lensSpecification[0].eye == \"right\"\n    assert float(inst.lensSpecification[0].prism[0].amount) == float(0.5)\n    assert inst.lensSpecification[0].prism[0].base == \"down\"\n    assert inst.lensSpecification[0].product.coding[0].code == \"lens\"\n    assert (\n        inst.lensSpecification[0].product.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct\"\n            }\n        ).valueUri\n    )\n    assert float(inst.lensSpecification[0].sphere) == float(-2.0)\n    assert float(inst.lensSpecification[1].add) == float(2.0)\n    assert inst.lensSpecification[1].axis == 180\n    assert float(inst.lensSpecification[1].cylinder) == float(-0.5)\n    assert inst.lensSpecification[1].eye == \"left\"\n    assert float(inst.lensSpecification[1].prism[0].amount) == float(0.5)\n    assert inst.lensSpecification[1].prism[0].base == \"up\"\n    assert inst.lensSpecification[1].product.coding[0].code == \"lens\"\n    assert (\n        inst.lensSpecification[1].product.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct\"\n            }\n        ).valueUri\n    )\n    assert float(inst.lensSpecification[1].sphere) == float(-1.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.prescriber.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_visionprescription_2(base_settings):\n    \"\"\"No. 2 tests collection for VisionPrescription.\n    Test File: visionprescription-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"visionprescription-example.json\"\n    inst = visionprescription.VisionPrescription.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"VisionPrescription\" == inst.get_resource_type()\n\n    impl_visionprescription_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"VisionPrescription\" == data[\"resourceType\"]\n\n    inst2 = visionprescription.VisionPrescription(**data)\n    impl_visionprescription_2(inst2)\n"
  },
  {
    "path": "fhir/resources/R4B/testscript.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TestScript\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass TestScript(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes a set of tests.\n    A structured set of tests against a FHIR server or client implementation to\n    determine compliance against the FHIR specification.\n    \"\"\"\n\n    __resource_type__ = \"TestScript\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the test script and/or its contents.\"\n            \" Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the test script.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the test script was published. \"\n            \"The date must change when the business version changes and it must \"\n            \"change if the status code changes. In addition, it should change when \"\n            \"the substantive content of the test script changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the test script\",\n        description=(\n            \"A free text natural language description of the test script from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    destination: typing.List[fhirtypes.TestScriptDestinationType] | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=(\n            \"An abstract server representing a destination or receiver in a message\"\n            \" exchange\"\n        ),\n        description=(\n            \"An abstract server used in operations within this test script in the \"\n            \"destination element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this test script is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fixture: typing.List[fhirtypes.TestScriptFixtureType] | None = Field(\n        default=None,\n        alias=\"fixture\",\n        title=\"Fixture in the test script - by reference (uri)\",\n        description=(\n            \"Fixture in the test script - by reference (uri). All fixtures are \"\n            \"required for the test script to execute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the test script\",\n        description=(\n            \"A formal identifier that is used to identify this test script when it \"\n            \"is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for test script (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the test script is intended to \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    metadata: fhirtypes.TestScriptMetadataType | None = Field(\n        default=None,\n        alias=\"metadata\",\n        title=(\n            \"Required capability that is assumed to function correctly on the FHIR \"\n            \"server being tested\"\n        ),\n        description=(\n            \"The required capability must exist and are assumed to function \"\n            \"correctly on the FHIR server being tested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this test script (computer friendly)\",\n        description=(\n            \"A natural language name identifying the test script. This name should \"\n            \"be usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    origin: typing.List[fhirtypes.TestScriptOriginType] | None = Field(\n        default=None,\n        alias=\"origin\",\n        title=(\n            \"An abstract server representing a client or sender in a message \"\n            \"exchange\"\n        ),\n        description=(\n            \"An abstract server used in operations within this test script in the \"\n            \"origin element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    profile: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Reference of the validation profile\",\n        description=\"Reference to the profile to be used for validation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the test \"\n            \"script.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this test script is defined\",\n        description=(\n            \"Explanation of why this test script is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    setup: fhirtypes.TestScriptSetupType | None = Field(\n        default=None,\n        alias=\"setup\",\n        title=\"A series of required setup operations before tests are executed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this test script. Enables tracking the life-cycle of the\"\n            \" content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    teardown: fhirtypes.TestScriptTeardownType | None = Field(\n        default=None,\n        alias=\"teardown\",\n        title=\"A series of required clean up steps\",\n        description=(\n            \"A series of operations required to clean up after all the tests are \"\n            \"executed (successfully or otherwise).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    test: typing.List[fhirtypes.TestScriptTestType] | None = Field(\n        default=None,\n        alias=\"test\",\n        title=\"A test in this script\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this test script (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the test script.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this test script, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this test script when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this test script is (or will be) published. This URL can \"\n            \"be the target of a canonical reference. It SHALL remain the same when \"\n            \"the test script is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate test script instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    variable: typing.List[fhirtypes.TestScriptVariableType] | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"Placeholder for evaluated elements\",\n        description=(\n            \"Variable is set based either on element value in response body or on \"\n            \"header field value in the response headers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the test script\",\n        description=(\n            \"The identifier that is used to identify this version of the test \"\n            \"script when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the test script author\"\n            \" and is not expected to be globally unique. For example, it might be a\"\n            \" timestamp (e.g. yyyymmdd) if a managed version is not available. \"\n            \"There is also no expectation that versions can be placed in a \"\n            \"lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScript`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"origin\",\n            \"destination\",\n            \"metadata\",\n            \"fixture\",\n            \"profile\",\n            \"variable\",\n            \"setup\",\n            \"test\",\n            \"teardown\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScript`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n\nclass TestScriptDestination(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An abstract server representing a destination or receiver in a message\n    exchange.\n    An abstract server used in operations within this test script in the\n    destination element.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptDestination\"\n\n    index: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"index\",\n        title=\"The index of the abstract destination server starting at 1\",\n        description=(\n            \"Abstract name given to a destination server in this test script.  The \"\n            \"name is provided as a number starting at 1.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    index__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_index\", title=\"Extension field for ``index``.\"\n    )\n\n    profile: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"profile\",\n        title=(\n            \"FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-\"\n            \"FormProcessor\"\n        ),\n        description=\"The type of destination profile the test system supports.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptDestination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"index\", \"profile\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptDestination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"index\", \"index__ext\")]\n        return required_fields\n\n\nclass TestScriptFixture(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Fixture in the test script - by reference (uri).\n    Fixture in the test script - by reference (uri). All fixtures are required\n    for the test script to execute.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptFixture\"\n\n    autocreate: bool | None = Field(\n        default=None,\n        alias=\"autocreate\",\n        title=\"Whether or not to implicitly create the fixture during setup\",\n        description=(\n            \"Whether or not to implicitly create the fixture during setup. If true,\"\n            \" the fixture is automatically created on each server being tested \"\n            \"during setup, therefore no create operation is required for this \"\n            \"fixture in the TestScript.setup section.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    autocreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_autocreate\", title=\"Extension field for ``autocreate``.\"\n    )\n\n    autodelete: bool | None = Field(\n        default=None,\n        alias=\"autodelete\",\n        title=\"Whether or not to implicitly delete the fixture during teardown\",\n        description=(\n            \"Whether or not to implicitly delete the fixture during teardown. If \"\n            \"true, the fixture is automatically deleted on each server being tested\"\n            \" during teardown, therefore no delete operation is required for this \"\n            \"fixture in the TestScript.teardown section.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    autodelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_autodelete\", title=\"Extension field for ``autodelete``.\"\n    )\n\n    resource: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Reference of the resource\",\n        description=(\n            \"Reference to the resource (containing the contents of the resource \"\n            \"needed for operations).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptFixture`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"autocreate\",\n            \"autodelete\",\n            \"resource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptFixture`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"autocreate\", \"autocreate__ext\"),\n            (\"autodelete\", \"autodelete__ext\"),\n        ]\n        return required_fields\n\n\nclass TestScriptMetadata(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Required capability that is assumed to function correctly on the FHIR\n    server being tested.\n    The required capability must exist and are assumed to function correctly on\n    the FHIR server being tested.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptMetadata\"\n\n    capability: typing.List[fhirtypes.TestScriptMetadataCapabilityType] = Field(\n        default=...,\n        alias=\"capability\",\n        title=(\n            \"Capabilities  that are assumed to function correctly on the FHIR \"\n            \"server being tested\"\n        ),\n        description=(\n            \"Capabilities that must exist and are assumed to function correctly on \"\n            \"the FHIR server being tested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.TestScriptMetadataLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links to the FHIR specification\",\n        description=\"A link to the FHIR specification that this test is covering.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptMetadata`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"link\", \"capability\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptMetadata`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptMetadataCapability(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Capabilities  that are assumed to function correctly on the FHIR server\n    being tested.\n    Capabilities that must exist and are assumed to function correctly on the\n    FHIR server being tested.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptMetadataCapability\"\n\n    capabilities: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"capabilities\",\n        title=\"Required Capability Statement\",\n        description=(\n            \"Minimum capabilities required of server for test script to execute \"\n            \"successfully.   If server does not meet at a minimum the referenced \"\n            \"capability statement, then all tests in this script are skipped.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n    capabilities__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_capabilities\",\n        title=\"Extension field for ``capabilities``.\",\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The expected capabilities of the server\",\n        description=(\n            \"Description of the capabilities that this test script is requiring the\"\n            \" server to support.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    destination: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Which server these requirements apply to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    destination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_destination\", title=\"Extension field for ``destination``.\"\n    )\n\n    link: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links to the FHIR specification\",\n        description=(\n            \"Links to the FHIR specification that describes this interaction and \"\n            \"the resources involved in more detail.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    link__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_link\", title=\"Extension field for ``link``.\"\n    )\n\n    origin: typing.List[fhirtypes.IntegerType | None] | None = Field(\n        default=None,\n        alias=\"origin\",\n        title=\"Which origin server these requirements apply to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    origin__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_origin\", title=\"Extension field for ``origin``.\"\n    )\n\n    required: bool | None = Field(\n        default=None,\n        alias=\"required\",\n        title=\"Are the capabilities required?\",\n        description=(\n            \"Whether or not the test execution will require the given capabilities \"\n            \"of the server in order for this test script to execute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_required\", title=\"Extension field for ``required``.\"\n    )\n\n    validated: bool | None = Field(\n        default=None,\n        alias=\"validated\",\n        title=\"Are the capabilities validated?\",\n        description=(\n            \"Whether or not the test execution will validate the given capabilities\"\n            \" of the server in order for this test script to execute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    validated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_validated\", title=\"Extension field for ``validated``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptMetadataCapability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"required\",\n            \"validated\",\n            \"description\",\n            \"origin\",\n            \"destination\",\n            \"link\",\n            \"capabilities\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptMetadataCapability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"capabilities\", \"capabilities__ext\"),\n            (\"required\", \"required__ext\"),\n            (\"validated\", \"validated__ext\"),\n        ]\n        return required_fields\n\n\nclass TestScriptMetadataLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links to the FHIR specification.\n    A link to the FHIR specification that this test is covering.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptMetadataLink\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Short description\",\n        description=\"Short description of the link.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"URL to the specification\",\n        description=(\n            \"URL to a particular requirement or feature within the FHIR \"\n            \"specification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptMetadataLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"url\", \"description\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptMetadataLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"url\", \"url__ext\")]\n        return required_fields\n\n\nclass TestScriptOrigin(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An abstract server representing a client or sender in a message exchange.\n    An abstract server used in operations within this test script in the origin\n    element.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptOrigin\"\n\n    index: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"index\",\n        title=\"The index of the abstract origin server starting at 1\",\n        description=(\n            \"Abstract name given to an origin server in this test script.  The name\"\n            \" is provided as a number starting at 1.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    index__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_index\", title=\"Extension field for ``index``.\"\n    )\n\n    profile: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"profile\",\n        title=\"FHIR-Client | FHIR-SDC-FormFiller\",\n        description=\"The type of origin profile the test system supports.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptOrigin`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"index\", \"profile\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptOrigin`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"index\", \"index__ext\")]\n        return required_fields\n\n\nclass TestScriptSetup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A series of required setup operations before tests are executed.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetup\"\n\n    action: typing.List[fhirtypes.TestScriptSetupActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"A setup operation or assert to perform\",\n        description=\"Action would contain either an operation or an assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptSetupAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A setup operation or assert to perform.\n    Action would contain either an operation or an assertion.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupAction\"\n\n    assert_fhir: fhirtypes.TestScriptSetupActionAssertType | None = Field(\n        default=None,\n        alias=\"assert\",\n        title=\"The assertion to perform\",\n        description=(\n            \"Evaluates the results of previous operations to determine if the \"\n            \"server under test behaves appropriately.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.TestScriptSetupActionOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"The setup operation to perform\",\n        description=\"The operation to perform.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\", \"assert\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptSetupActionAssert(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The assertion to perform.\n    Evaluates the results of previous operations to determine if the server\n    under test behaves appropriately.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionAssert\"\n\n    compareToSourceExpression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"compareToSourceExpression\",\n        title=\"The FHIRPath expression to evaluate against the source fixture\",\n        description=(\n            \"The FHIRPath expression to evaluate against the source fixture. When \"\n            \"compareToSourceId is defined, either compareToSourceExpression or \"\n            \"compareToSourcePath must be defined, but not both.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    compareToSourceExpression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compareToSourceExpression\",\n        title=\"Extension field for ``compareToSourceExpression``.\",\n    )\n\n    compareToSourceId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"compareToSourceId\",\n        title=\"Id of the source fixture to be evaluated\",\n        description=(\n            \"Id of the source fixture used as the contents to be evaluated by \"\n            'either the \"source/expression\" or \"sourceId/path\" definition.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    compareToSourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compareToSourceId\",\n        title=\"Extension field for ``compareToSourceId``.\",\n    )\n\n    compareToSourcePath: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"compareToSourcePath\",\n        title=\"XPath or JSONPath expression to evaluate against the source fixture\",\n        description=(\n            \"XPath or JSONPath expression to evaluate against the source fixture. \"\n            \"When compareToSourceId is defined, either compareToSourceExpression or\"\n            \" compareToSourcePath must be defined, but not both.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    compareToSourcePath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compareToSourcePath\",\n        title=\"Extension field for ``compareToSourcePath``.\",\n    )\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"Mime type to compare against the 'Content-Type' header\",\n        description=(\n            \"The mime-type contents to compare against the request or response \"\n            \"message 'Content-Type' header.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Tracking/reporting assertion description\",\n        description=(\n            \"The description would be used by test engines for tracking and \"\n            \"reporting purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    direction: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"direction\",\n        title=\"response | request\",\n        description=\"The direction to use for the assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"response\", \"request\"],\n        },\n    )\n    direction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_direction\", title=\"Extension field for ``direction``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"The FHIRPath expression to be evaluated\",\n        description=(\n            \"The FHIRPath expression to be evaluated against the request or \"\n            \"response message contents - HTTP headers and payload.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    headerField: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"headerField\",\n        title=\"HTTP header field name\",\n        description=\"The HTTP header field name e.g. 'Location'.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    headerField__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_headerField\", title=\"Extension field for ``headerField``.\"\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Tracking/logging assertion label\",\n        description=\"The label would be used for tracking/logging purposes by test engines.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    minimumId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"minimumId\",\n        title=\"Fixture Id of minimum content resource\",\n        description=(\n            \"The ID of a fixture.  Asserts that the response contains at a minimum \"\n            \"the fixture specified by minimumId.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    minimumId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_minimumId\", title=\"Extension field for ``minimumId``.\"\n    )\n\n    navigationLinks: bool | None = Field(\n        default=None,\n        alias=\"navigationLinks\",\n        title=\"Perform validation on navigation links?\",\n        description=(\n            \"Whether or not the test execution performs validation on the bundle \"\n            \"navigation links.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    navigationLinks__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_navigationLinks\",\n        title=\"Extension field for ``navigationLinks``.\",\n    )\n\n    operator: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"operator\",\n        title=(\n            \"equals | notEquals | in | notIn | greaterThan | lessThan | empty | \"\n            \"notEmpty | contains | notContains | eval\"\n        ),\n        description=(\n            \"The operator type defines the conditional behavior of the assert. If \"\n            \"not defined, the default is equals.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"equals\",\n                \"notEquals\",\n                \"in\",\n                \"notIn\",\n                \"greaterThan\",\n                \"lessThan\",\n                \"empty\",\n                \"notEmpty\",\n                \"contains\",\n                \"notContains\",\n                \"eval\",\n            ],\n        },\n    )\n    operator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_operator\", title=\"Extension field for ``operator``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"XPath or JSONPath expression\",\n        description=(\n            \"The XPath or JSONPath expression to be evaluated against the fixture \"\n            \"representing the response received from server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    requestMethod: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"requestMethod\",\n        title=\"delete | get | options | patch | post | put | head\",\n        description=(\n            \"The request method or HTTP operation code to compare against that used\"\n            \" by the client system under test.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"delete\", \"get\", \"options\", \"patch\", \"post\", \"put\", \"head\"],\n        },\n    )\n    requestMethod__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requestMethod\",\n        title=\"Extension field for ``requestMethod``.\",\n    )\n\n    requestURL: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"requestURL\",\n        title=\"Request URL comparison value\",\n        description=\"The value to use in a comparison against the request URL path string.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    requestURL__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requestURL\", title=\"Extension field for ``requestURL``.\"\n    )\n\n    resource: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Resource type\",\n        description=(\n            \"The type of the resource.  See \" \"http://build.fhir.org/resourcelist.html.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    response: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=(\n            \"okay | created | noContent | notModified | bad | forbidden | notFound \"\n            \"| methodNotAllowed | conflict | gone | preconditionFailed | \"\n            \"unprocessable\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"okay\",\n                \"created\",\n                \"noContent\",\n                \"notModified\",\n                \"bad\",\n                \"forbidden\",\n                \"notFound\",\n                \"methodNotAllowed\",\n                \"conflict\",\n                \"gone\",\n                \"preconditionFailed\",\n                \"unprocessable\",\n            ],\n        },\n    )\n    response__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_response\", title=\"Extension field for ``response``.\"\n    )\n\n    responseCode: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"responseCode\",\n        title=\"HTTP response code to test\",\n        description=\"The value of the HTTP response code to be tested.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responseCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_responseCode\",\n        title=\"Extension field for ``responseCode``.\",\n    )\n\n    sourceId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"sourceId\",\n        title=\"Fixture Id of source expression or headerField\",\n        description=(\n            \"Fixture to evaluate the XPath/JSONPath expression or the headerField  \"\n            \"against.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceId\", title=\"Extension field for ``sourceId``.\"\n    )\n\n    validateProfileId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"validateProfileId\",\n        title=\"Profile Id of validation profile reference\",\n        description=\"The ID of the Profile to validate against.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    validateProfileId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_validateProfileId\",\n        title=\"Extension field for ``validateProfileId``.\",\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The value to compare to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    warningOnly: bool | None = Field(\n        default=None,\n        alias=\"warningOnly\",\n        title=\"Will this assert produce a warning only on error?\",\n        description=(\n            \"Whether or not the test execution will produce a warning only on error\"\n            \" for this assert.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    warningOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_warningOnly\", title=\"Extension field for ``warningOnly``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionAssert`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"label\",\n            \"description\",\n            \"direction\",\n            \"compareToSourceId\",\n            \"compareToSourceExpression\",\n            \"compareToSourcePath\",\n            \"contentType\",\n            \"expression\",\n            \"headerField\",\n            \"minimumId\",\n            \"navigationLinks\",\n            \"operator\",\n            \"path\",\n            \"requestMethod\",\n            \"requestURL\",\n            \"resource\",\n            \"response\",\n            \"responseCode\",\n            \"sourceId\",\n            \"validateProfileId\",\n            \"value\",\n            \"warningOnly\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssert`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"warningOnly\", \"warningOnly__ext\")]\n        return required_fields\n\n\nclass TestScriptSetupActionOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The setup operation to perform.\n    The operation to perform.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionOperation\"\n\n    accept: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"accept\",\n        title=\"Mime type to accept in the payload of the response, with charset etc.\",\n        description=\"The mime-type to use for RESTful operation in the 'Accept' header.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    accept__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_accept\", title=\"Extension field for ``accept``.\"\n    )\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"Mime type of the request payload contents, with charset etc.\",\n        description=(\n            \"The mime-type to use for RESTful operation in the 'Content-Type' \"\n            \"header.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Tracking/reporting operation description\",\n        description=(\n            \"The description would be used by test engines for tracking and \"\n            \"reporting purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    destination: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Server responding to the request\",\n        description=(\n            \"The server where the request message is destined for.  Must be one of \"\n            \"the server numbers listed in TestScript.destination section.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    destination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_destination\", title=\"Extension field for ``destination``.\"\n    )\n\n    encodeRequestUrl: bool | None = Field(\n        default=None,\n        alias=\"encodeRequestUrl\",\n        title=\"Whether or not to send the request url in encoded format\",\n        description=(\n            \"Whether or not to implicitly send the request url in encoded format. \"\n            \"The default is true to match the standard RESTful client behavior. Set\"\n            \" to false when communicating with a server that does not support \"\n            \"encoded url paths.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    encodeRequestUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_encodeRequestUrl\",\n        title=\"Extension field for ``encodeRequestUrl``.\",\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Tracking/logging operation label\",\n        description=\"The label would be used for tracking/logging purposes by test engines.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    method: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"delete | get | options | patch | post | put | head\",\n        description=(\n            \"The HTTP method the test engine MUST use for this operation regardless\"\n            \" of any other operation details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"delete\", \"get\", \"options\", \"patch\", \"post\", \"put\", \"head\"],\n        },\n    )\n    method__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_method\", title=\"Extension field for ``method``.\"\n    )\n\n    origin: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"origin\",\n        title=\"Server initiating the request\",\n        description=(\n            \"The server where the request message originates from.  Must be one of \"\n            \"the server numbers listed in TestScript.origin section.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    origin__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_origin\", title=\"Extension field for ``origin``.\"\n    )\n\n    params: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"params\",\n        title=\"Explicitly defined path parameters\",\n        description=(\n            \"Path plus parameters after [type].  Used to set parts of the request \"\n            \"URL explicitly.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    params__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_params\", title=\"Extension field for ``params``.\"\n    )\n\n    requestHeader: typing.List[\n        fhirtypes.TestScriptSetupActionOperationRequestHeaderType\n    ] | None = Field(\n        default=None,\n        alias=\"requestHeader\",\n        title=\"Each operation can have one or more header elements\",\n        description=\"Header elements would be used to set HTTP headers.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requestId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"requestId\",\n        title=\"Fixture Id of mapped request\",\n        description=\"The fixture id (maybe new) to map to the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    requestId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requestId\", title=\"Extension field for ``requestId``.\"\n    )\n\n    resource: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Resource type\",\n        description=(\n            \"The type of the resource.  See \" \"http://build.fhir.org/resourcelist.html.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    responseId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"responseId\",\n        title=\"Fixture Id of mapped response\",\n        description=\"The fixture id (maybe new) to map to the response.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responseId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_responseId\", title=\"Extension field for ``responseId``.\"\n    )\n\n    sourceId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"sourceId\",\n        title=\"Fixture Id of body for PUT and POST requests\",\n        description=\"The id of the fixture used as the body of a PUT or POST request.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceId\", title=\"Extension field for ``sourceId``.\"\n    )\n\n    targetId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"targetId\",\n        title=(\n            \"Id of fixture used for extracting the [id],  [type], and [vid] for GET\"\n            \" requests\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    targetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_targetId\", title=\"Extension field for ``targetId``.\"\n    )\n\n    type: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The operation code type that will be executed\",\n        description=\"Server interaction or operation type.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Request URL\",\n        description=\"Complete request URL.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"resource\",\n            \"label\",\n            \"description\",\n            \"accept\",\n            \"contentType\",\n            \"destination\",\n            \"encodeRequestUrl\",\n            \"method\",\n            \"origin\",\n            \"params\",\n            \"requestHeader\",\n            \"requestId\",\n            \"responseId\",\n            \"sourceId\",\n            \"targetId\",\n            \"url\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"encodeRequestUrl\", \"encodeRequestUrl__ext\")]\n        return required_fields\n\n\nclass TestScriptSetupActionOperationRequestHeader(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Each operation can have one or more header elements.\n    Header elements would be used to set HTTP headers.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionOperationRequestHeader\"\n\n    field: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"field\",\n        title=\"HTTP header field name\",\n        description='The HTTP header field e.g. \"Accept\".',\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    field__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_field\", title=\"Extension field for ``field``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"HTTP headerfield value\",\n        description='The value of the header e.g. \"application/fhir+xml\".',\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionOperationRequestHeader`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"field\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionOperationRequestHeader`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"field\", \"field__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass TestScriptTeardown(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A series of required clean up steps.\n    A series of operations required to clean up after all the tests are\n    executed (successfully or otherwise).\n    \"\"\"\n\n    __resource_type__ = \"TestScriptTeardown\"\n\n    action: typing.List[fhirtypes.TestScriptTeardownActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"One or more teardown operations to perform\",\n        description=\"The teardown action will only contain an operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptTeardown`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptTeardown`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptTeardownAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    One or more teardown operations to perform.\n    The teardown action will only contain an operation.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptTeardownAction\"\n\n    operation: fhirtypes.TestScriptSetupActionOperationType = Field(\n        default=...,\n        alias=\"operation\",\n        title=\"The teardown operation to perform\",\n        description=\"An operation would involve a REST request to a server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptTeardownAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptTeardownAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptTest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A test in this script.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptTest\"\n\n    action: typing.List[fhirtypes.TestScriptTestActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"A test operation or assert to perform\",\n        description=\"Action would contain either an operation or an assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Tracking/reporting short description of the test\",\n        description=(\n            \"A short description of the test used by test engines for tracking and \"\n            \"reporting purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Tracking/logging name of this test\",\n        description=(\n            \"The name of this test used for tracking/logging purposes by test \"\n            \"engines.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptTest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"description\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptTest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptTestAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A test operation or assert to perform.\n    Action would contain either an operation or an assertion.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptTestAction\"\n\n    assert_fhir: fhirtypes.TestScriptSetupActionAssertType | None = Field(\n        default=None,\n        alias=\"assert\",\n        title=\"The setup assertion to perform\",\n        description=(\n            \"Evaluates the results of previous operations to determine if the \"\n            \"server under test behaves appropriately.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.TestScriptSetupActionOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"The setup operation to perform\",\n        description=\"An operation would involve a REST request to a server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptTestAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\", \"assert\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptTestAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptVariable(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Placeholder for evaluated elements.\n    Variable is set based either on element value in response body or on header\n    field value in the response headers.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptVariable\"\n\n    defaultValue: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"defaultValue\",\n        title=\"Default, hard-coded, or user-defined value for this variable\",\n        description=\"A default, hard-coded, or user-defined value for this variable.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    defaultValue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValue\",\n        title=\"Extension field for ``defaultValue``.\",\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the variable\",\n        description=(\n            \"A free text natural language description of the variable and its \"\n            \"purpose.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"The FHIRPath expression against the fixture body\",\n        description=(\n            \"The FHIRPath expression to evaluate against the fixture body. When \"\n            \"variables are defined, only one of either expression, headerField or \"\n            \"path must be specified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    headerField: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"headerField\",\n        title=\"HTTP header field name for source\",\n        description=(\n            \"Will be used to grab the HTTP header field value from the headers that\"\n            \" sourceId is pointing to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    headerField__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_headerField\", title=\"Extension field for ``headerField``.\"\n    )\n\n    hint: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"hint\",\n        title=\"Hint help text for default value to enter\",\n        description=(\n            \"Displayable text string with hint help information to the user when \"\n            \"entering a default value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    hint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_hint\", title=\"Extension field for ``hint``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Descriptive name for this variable\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"XPath or JSONPath against the fixture body\",\n        description=(\n            \"XPath or JSONPath to evaluate against the fixture body.  When \"\n            \"variables are defined, only one of either expression, headerField or \"\n            \"path must be specified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    sourceId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"sourceId\",\n        title=\"Fixture Id of source expression or headerField within this variable\",\n        description=(\n            \"Fixture to evaluate the XPath/JSONPath expression or the headerField  \"\n            \"against within this variable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceId\", title=\"Extension field for ``sourceId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"defaultValue\",\n            \"description\",\n            \"expression\",\n            \"headerField\",\n            \"hint\",\n            \"path\",\n            \"sourceId\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/R4B/timing.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Timing\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, element, fhirtypes\n\n\nclass Timing(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A timing schedule that specifies an event that may occur multiple times.\n    Specifies an event that may occur multiple times. Timing schedules are used\n    to record when things are planned, expected or requested to occur. The most\n    common usage is in dosage instructions for medications. They are also used\n    when planning care of various kinds, and may be used for reporting the\n    schedule to which past regular activities were carried out.\n    \"\"\"\n\n    __resource_type__ = \"Timing\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"BID | TID | QID | AM | PM | QD | QOD | +\",\n        description=(\n            \"A code for the timing schedule (or just text in code.text). Some codes\"\n            \" such as BID are ubiquitous, but many institutions define their own \"\n            \"additional codes. If a code is provided, the code is understood to be \"\n            \"a complete statement of whatever is specified in the structured timing\"\n            \" data, and either the code or the data may be used to interpret the \"\n            \"Timing, with the exception that .repeat.bounds still applies over the \"\n            \"code (and is not contained in the code).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    event: typing.List[fhirtypes.DateTimeType | None] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"When the event occurs\",\n        description=\"Identifies specific times when the event occurs.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    event__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_event\", title=\"Extension field for ``event``.\"\n    )\n\n    repeat: fhirtypes.TimingRepeatType | None = Field(\n        default=None,\n        alias=\"repeat\",\n        title=\"When the event is to occur\",\n        description=\"A set of rules that describe when the event is scheduled.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Timing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"event\", \"repeat\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Timing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"event\", \"repeat\", \"code\"]\n\n\nclass TimingRepeat(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    When the event is to occur.\n    A set of rules that describe when the event is scheduled.\n    \"\"\"\n\n    __resource_type__ = \"TimingRepeat\"\n\n    boundsDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"boundsDuration\",\n        title=\"Length/Range of lengths, or (Start and/or end) limits\",\n        description=(\n            \"Either a duration for the length of the timing schedule, a range of \"\n            \"possible length, or outer bounds for start and/or end limits of the \"\n            \"timing schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e bounds[x]\n            \"one_of_many\": \"bounds\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    boundsPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"boundsPeriod\",\n        title=\"Length/Range of lengths, or (Start and/or end) limits\",\n        description=(\n            \"Either a duration for the length of the timing schedule, a range of \"\n            \"possible length, or outer bounds for start and/or end limits of the \"\n            \"timing schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e bounds[x]\n            \"one_of_many\": \"bounds\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    boundsRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"boundsRange\",\n        title=\"Length/Range of lengths, or (Start and/or end) limits\",\n        description=(\n            \"Either a duration for the length of the timing schedule, a range of \"\n            \"possible length, or outer bounds for start and/or end limits of the \"\n            \"timing schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e bounds[x]\n            \"one_of_many\": \"bounds\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    count: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Number of times to repeat\",\n        description=(\n            \"A total count of the desired number of repetitions across the duration\"\n            \" of the entire timing specification. If countMax is present, this \"\n            \"element indicates the lower bound of the allowed range of count \"\n            \"values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    countMax: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"countMax\",\n        title=\"Maximum number of times to repeat\",\n        description=(\n            \"If present, indicates that the count is a range - so to perform the \"\n            \"action between [count] and [countMax] times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    countMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_countMax\", title=\"Extension field for ``countMax``.\"\n    )\n\n    dayOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"dayOfWeek\",\n        title=\"mon | tue | wed | thu | fri | sat | sun\",\n        description=(\n            \"If one or more days of week is provided, then the action happens only \"\n            \"on the specified day(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"],\n        },\n    )\n    dayOfWeek__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_dayOfWeek\", title=\"Extension field for ``dayOfWeek``.\"\n    )\n\n    duration: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"How long when it happens\",\n        description=(\n            \"How long this thing happens for when it happens. If durationMax is \"\n            \"present, this element indicates the lower bound of the allowed range \"\n            \"of the duration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    duration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_duration\", title=\"Extension field for ``duration``.\"\n    )\n\n    durationMax: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"durationMax\",\n        title=\"How long when it happens (Max)\",\n        description=(\n            \"If present, indicates that the duration is a range - so to perform the\"\n            \" action between [duration] and [durationMax] time length.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    durationMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_durationMax\", title=\"Extension field for ``durationMax``.\"\n    )\n\n    durationUnit: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"durationUnit\",\n        title=\"s | min | h | d | wk | mo | a - unit of time (UCUM)\",\n        description=\"The units of time for the duration, in UCUM units.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"s\", \"min\", \"h\", \"d\", \"wk\", \"mo\", \"a\"],\n        },\n    )\n    durationUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_durationUnit\",\n        title=\"Extension field for ``durationUnit``.\",\n    )\n\n    frequency: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"frequency\",\n        title=\"Event occurs frequency times per period\",\n        description=(\n            \"The number of times to repeat the action within the specified period. \"\n            \"If frequencyMax is present, this element indicates the lower bound of \"\n            \"the allowed range of the frequency.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    frequency__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_frequency\", title=\"Extension field for ``frequency``.\"\n    )\n\n    frequencyMax: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"frequencyMax\",\n        title=\"Event occurs up to frequencyMax times per period\",\n        description=(\n            \"If present, indicates that the frequency is a range - so to repeat \"\n            \"between [frequency] and [frequencyMax] times within the period or \"\n            \"period range.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    frequencyMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_frequencyMax\",\n        title=\"Extension field for ``frequencyMax``.\",\n    )\n\n    offset: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"offset\",\n        title=\"Minutes from event (before or after)\",\n        description=(\n            \"The number of minutes from the event. If the event code does not \"\n            \"indicate whether the minutes is before or after the event, then the \"\n            \"offset is assumed to be after the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    offset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_offset\", title=\"Extension field for ``offset``.\"\n    )\n\n    period: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Event occurs frequency times per period\",\n        description=(\n            \"Indicates the duration of time over which repetitions are to occur; \"\n            'e.g. to express \"3 times per day\", 3 would be the frequency and \"1 '\n            'day\" would be the period. If periodMax is present, this element '\n            \"indicates the lower bound of the allowed range of the period length.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    period__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_period\", title=\"Extension field for ``period``.\"\n    )\n\n    periodMax: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"periodMax\",\n        title=\"Upper limit of period (3-4 hours)\",\n        description=(\n            \"If present, indicates that the period is a range from [period] to \"\n            '[periodMax], allowing expressing concepts such as \"do this once every '\n            \"3-5 days.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    periodMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_periodMax\", title=\"Extension field for ``periodMax``.\"\n    )\n\n    periodUnit: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"periodUnit\",\n        title=\"s | min | h | d | wk | mo | a - unit of time (UCUM)\",\n        description=\"The units of time for the period in UCUM units.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"s\", \"min\", \"h\", \"d\", \"wk\", \"mo\", \"a\"],\n        },\n    )\n    periodUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_periodUnit\", title=\"Extension field for ``periodUnit``.\"\n    )\n\n    timeOfDay: typing.List[fhirtypes.TimeType | None] | None = Field(\n        default=None,\n        alias=\"timeOfDay\",\n        title=\"Time of day for action\",\n        description=\"Specified time of day for action to take place.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    timeOfDay__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_timeOfDay\", title=\"Extension field for ``timeOfDay``.\"\n    )\n\n    when: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"when\",\n        title=\"Code for time period of occurrence\",\n        description=(\n            \"An approximate time period during the day, potentially linked to an \"\n            \"event of daily living that indicates when the action should occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    when__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_when\", title=\"Extension field for ``when``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TimingRepeat`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"boundsDuration\",\n            \"boundsRange\",\n            \"boundsPeriod\",\n            \"count\",\n            \"countMax\",\n            \"duration\",\n            \"durationMax\",\n            \"durationUnit\",\n            \"frequency\",\n            \"frequencyMax\",\n            \"period\",\n            \"periodMax\",\n            \"periodUnit\",\n            \"dayOfWeek\",\n            \"timeOfDay\",\n            \"when\",\n            \"offset\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TimingRepeat`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"boundsDuration\",\n            \"boundsRange\",\n            \"boundsPeriod\",\n            \"count\",\n            \"countMax\",\n            \"duration\",\n            \"durationMax\",\n            \"durationUnit\",\n            \"frequency\",\n            \"frequencyMax\",\n            \"period\",\n            \"periodMax\",\n            \"periodUnit\",\n            \"dayOfWeek\",\n            \"timeOfDay\",\n            \"when\",\n            \"offset\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"bounds\": [\"boundsDuration\", \"boundsPeriod\", \"boundsRange\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/triggerdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TriggerDefinition\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass TriggerDefinition(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defines an expected trigger for a module.\n    A description of a triggering event. Triggering events can be named events,\n    data events, or periodic, as determined by the type element.\n    \"\"\"\n\n    __resource_type__ = \"TriggerDefinition\"\n\n    condition: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Whether the event triggers (boolean expression)\",\n        description=(\n            \"A boolean-valued expression that is evaluated in the context of the \"\n            \"container of the trigger definition and returns whether or not the \"\n            \"trigger fires.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    data: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"Triggering data of the event (multiple = 'and')\",\n        description=(\n            \"The triggering data of the event (if this is a data trigger). If more \"\n            \"than one data is requirement is specified, then all the data \"\n            \"requirements must be true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name or URI that identifies the event\",\n        description=(\n            \"A formal name for the event. This may be an absolute URI that \"\n            \"identifies the event formally (e.g. from a trigger registry), or a \"\n            \"simple relative URI that identifies the event in a local context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    timingDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"timingDate\",\n        title=\"Timing of the event\",\n        description=\"The timing of the event (if this is a periodic trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timingDate\", title=\"Extension field for ``timingDate``.\"\n    )\n\n    timingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timingDateTime\",\n        title=\"Timing of the event\",\n        description=\"The timing of the event (if this is a periodic trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timingDateTime\",\n        title=\"Extension field for ``timingDateTime``.\",\n    )\n\n    timingReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"timingReference\",\n        title=\"Timing of the event\",\n        description=\"The timing of the event (if this is a periodic trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Schedule\"],\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"Timing of the event\",\n        description=\"The timing of the event (if this is a periodic trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"named-event | periodic | data-changed | data-added | data-modified | \"\n            \"data-removed | data-accessed | data-access-ended\"\n        ),\n        description=\"The type of triggering event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"named-event\",\n                \"periodic\",\n                \"data-changed\",\n                \"data-added\",\n                \"data-modified\",\n                \"data-removed\",\n                \"data-accessed\",\n                \"data-access-ended\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TriggerDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"name\",\n            \"timingTiming\",\n            \"timingReference\",\n            \"timingDate\",\n            \"timingDateTime\",\n            \"data\",\n            \"condition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TriggerDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"type\",\n            \"name\",\n            \"timingTiming\",\n            \"timingReference\",\n            \"timingDate\",\n            \"timingDateTime\",\n            \"data\",\n            \"condition\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\n                \"timingDate\",\n                \"timingDateTime\",\n                \"timingReference\",\n                \"timingTiming\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/usagecontext.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/UsageContext\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass UsageContext(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes the context of use for a conformance or knowledge resource.\n    Specifies clinical/business/etc. metadata that can be used to retrieve,\n    index and/or categorize an artifact. This metadata can either be specific\n    to the applicable population (e.g., age category, DRG) or the specific\n    context of care (e.g., venue, care setting, provider of care).\n    \"\"\"\n\n    __resource_type__ = \"UsageContext\"\n\n    code: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of context being specified\",\n        description=(\n            \"A code that identifies the type of context being specified by this \"\n            \"usage context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value that defines the context\",\n        description=(\n            \"A value that defines the context specified in this context of use. The\"\n            \" interpretation of the value is defined by the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value that defines the context\",\n        description=(\n            \"A value that defines the context specified in this context of use. The\"\n            \" interpretation of the value is defined by the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value that defines the context\",\n        description=(\n            \"A value that defines the context specified in this context of use. The\"\n            \" interpretation of the value is defined by the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Value that defines the context\",\n        description=(\n            \"A value that defines the context specified in this context of use. The\"\n            \" interpretation of the value is defined by the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"ResearchStudy\",\n                \"InsurancePlan\",\n                \"HealthcareService\",\n                \"Group\",\n                \"Location\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``UsageContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``UsageContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueReference\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueReference\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/valueset.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ValueSet\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ValueSet(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of codes drawn from one or more code systems.\n    A ValueSet resource instance specifies a set of codes drawn from one or\n    more code systems, intended for use in a particular context. Value sets\n    link between [CodeSystem](codesystem.html) definitions and their use in\n    [coded elements](terminologies.html).\n    \"\"\"\n\n    __resource_type__ = \"ValueSet\"\n\n    compose: fhirtypes.ValueSetComposeType | None = Field(\n        default=None,\n        alias=\"compose\",\n        title=\"Content logical definition of the value set (CLD)\",\n        description=(\n            \"A set of criteria that define the contents of the value set by \"\n            \"including or excluding codes selected from the specified code \"\n            \"system(s) that the value set draws from. This is also known as the \"\n            \"Content Logical Definition (CLD).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the value set and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date (and optionally time) when the value set was created or \"\n            \"revised (e.g. the 'content logical definition').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the value set\",\n        description=(\n            \"A free text natural language description of the value set from a \"\n            \"consumer's perspective. The textual description specifies the span of \"\n            \"meanings for concepts to be included within the Value Set Expansion, \"\n            \"and also may specify the intended use and limitations of the Value \"\n            \"Set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expansion: fhirtypes.ValueSetExpansionType | None = Field(\n        default=None,\n        alias=\"expansion\",\n        title='Used when the value set is \"expanded\"',\n        description=(\n            'A value set can also be \"expanded\", where the value set is turned into'\n            \" a simple collection of enumerated codes. This element holds the \"\n            \"expansion, if it has been performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this value set is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the value set (business identifier)\",\n        description=(\n            \"A formal identifier that is used to identify this value set when it is\"\n            \" represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    immutable: bool | None = Field(\n        default=None,\n        alias=\"immutable\",\n        title=(\n            \"Indicates whether or not any change to the content logical definition \"\n            \"may occur\"\n        ),\n        description=(\n            \"If this is set to 'true', then no new versions of the content logical \"\n            \"definition can be created.  Note: Other metadata might still change.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    immutable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_immutable\", title=\"Extension field for ``immutable``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for value set (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the value set is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this value set (computer friendly)\",\n        description=(\n            \"A natural language name identifying the value set. This name should be\"\n            \" usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the organization or individual that published the value \"\n            \"set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this value set is defined\",\n        description=(\n            \"Explanation of why this value set is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this value set. Enables tracking the life-cycle of the \"\n            \"content. The status of the value set applies to the value set \"\n            \"definition (ValueSet.compose) and the associated ValueSet metadata. \"\n            \"Expansions do not have a state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this value set (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the value set.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this value set, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this value set when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which at which an authoritative \"\n            \"instance of this value set is (or will be) published. This URL can be \"\n            \"the target of a canonical reference. It SHALL remain the same when the\"\n            \" value set is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate value set instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the value set\",\n        description=(\n            \"The identifier that is used to identify this version of the value set \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the value set author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"immutable\",\n            \"purpose\",\n            \"copyright\",\n            \"compose\",\n            \"expansion\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"immutable\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ValueSetCompose(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Content logical definition of the value set (CLD).\n    A set of criteria that define the contents of the value set by including or\n    excluding codes selected from the specified code system(s) that the value\n    set draws from. This is also known as the Content Logical Definition (CLD).\n    \"\"\"\n\n    __resource_type__ = \"ValueSetCompose\"\n\n    exclude: typing.List[fhirtypes.ValueSetComposeIncludeType] | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=\"Explicitly exclude codes from a code system or other value sets\",\n        description=(\n            \"Exclude one or more codes from the value set based on code system \"\n            \"filters and/or other value sets.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    inactive: bool | None = Field(\n        default=None,\n        alias=\"inactive\",\n        title=\"Whether inactive codes are in the value set\",\n        description=(\n            \"Whether inactive codes - codes that are not approved for current use -\"\n            \" are in the value set. If inactive = true, inactive codes are to be \"\n            \"included in the expansion, if inactive = false, the inactive codes \"\n            \"will not be included in the expansion. If absent, the behavior is \"\n            \"determined by the implementation, or by the applicable $expand \"\n            \"parameters (but generally, inactive codes would be expected to be \"\n            \"included).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_inactive\", title=\"Extension field for ``inactive``.\"\n    )\n\n    include: typing.List[fhirtypes.ValueSetComposeIncludeType] = Field(\n        default=...,\n        alias=\"include\",\n        title=\"Include one or more codes from a code system or other value set(s)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lockedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lockedDate\",\n        title=\"Fixed date for references with no specified version (transitive)\",\n        description=(\n            \"The Locked Date is  the effective date that is used to determine the \"\n            \"version of all referenced Code Systems and Value Set Definitions \"\n            \"included in the compose that are not already tied to a specific \"\n            \"version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lockedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lockedDate\", title=\"Extension field for ``lockedDate``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetCompose`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"lockedDate\",\n            \"inactive\",\n            \"include\",\n            \"exclude\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetCompose`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"lockedDate\", \"inactive\", \"include\"]\n\n\nclass ValueSetComposeInclude(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Include one or more codes from a code system or other value set(s).\n    \"\"\"\n\n    __resource_type__ = \"ValueSetComposeInclude\"\n\n    concept: typing.List[fhirtypes.ValueSetComposeIncludeConceptType] | None = Field(\n        default=None,\n        alias=\"concept\",\n        title=\"A concept defined in the system\",\n        description=\"Specifies a concept to be included or excluded.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    filter: typing.List[fhirtypes.ValueSetComposeIncludeFilterType] | None = Field(\n        default=None,\n        alias=\"filter\",\n        title=\"Select codes/concepts by their properties (including relationships)\",\n        description=(\n            \"Select concepts by specify a matching criterion based on the \"\n            \"properties (including relationships) defined by the system, or on \"\n            \"filters defined by the system. If multiple filters are specified, they\"\n            \" SHALL all be true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"The system the codes come from\",\n        description=(\n            \"An absolute URI which is the code system from which the selected codes\"\n            \" come from.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    valueSet: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Select the contents included in this value set\",\n        description=(\n            \"Selects the concepts found in this value set (based on its value set \"\n            \"definition). This is an absolute URI that is a reference to \"\n            \"ValueSet.url.  If multiple value sets are specified this includes the \"\n            \"union of the contents of all of the referenced value sets.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Specific version of the code system referred to\",\n        description=(\n            \"The version of the code system that the codes are selected from, or \"\n            \"the special version '*' for all versions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetComposeInclude`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"system\",\n            \"version\",\n            \"concept\",\n            \"filter\",\n            \"valueSet\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetComposeInclude`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"system\", \"version\", \"filter\", \"valueSet\"]\n\n\nclass ValueSetComposeIncludeConcept(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A concept defined in the system.\n    Specifies a concept to be included or excluded.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetComposeIncludeConcept\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code or expression from system\",\n        description=\"Specifies a code for the concept to be included or excluded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    designation: typing.List[\n        fhirtypes.ValueSetComposeIncludeConceptDesignationType\n    ] | None = Field(\n        default=None,\n        alias=\"designation\",\n        title=\"Additional representations for this concept\",\n        description=(\n            \"Additional representations for this concept when used in this value \"\n            \"set - other languages, aliases, specialized purposes, used for \"\n            \"particular purposes, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Text to display for this code for this value set in this valueset\",\n        description=(\n            \"The text to display to the user for this concept in the context of \"\n            \"this valueset. If no display is provided, then applications using the \"\n            \"value set use the display specified for the code by the system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetComposeIncludeConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"display\",\n            \"designation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass ValueSetComposeIncludeConceptDesignation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional representations for this concept.\n    Additional representations for this concept when used in this value set -\n    other languages, aliases, specialized purposes, used for particular\n    purposes, etc.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetComposeIncludeConceptDesignation\"\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language of the designation\",\n        description=\"The language this designation is defined for.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    use: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"Types of uses of designations\",\n        description=\"A code that represents types of uses of designations.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The text value for this designation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetComposeIncludeConceptDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"use\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeConceptDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass ValueSetComposeIncludeFilter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Select codes/concepts by their properties (including relationships).\n    Select concepts by specify a matching criterion based on the properties\n    (including relationships) defined by the system, or on filters defined by\n    the system. If multiple filters are specified, they SHALL all be true.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetComposeIncludeFilter\"\n\n    op: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"op\",\n        title=(\n            \"= | is-a | descendent-of | is-not-a | regex | in | not-in | \"\n            \"generalizes | exists\"\n        ),\n        description=\"The kind of operation to perform as a part of the filter criteria.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"=\",\n                \"is-a\",\n                \"descendent-of\",\n                \"is-not-a\",\n                \"regex\",\n                \"in\",\n                \"not-in\",\n                \"generalizes\",\n                \"exists\",\n            ],\n        },\n    )\n    op__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_op\", title=\"Extension field for ``op``.\"\n    )\n\n    property: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"A property/filter defined by the code system\",\n        description=(\n            \"A code that identifies a property or a filter defined in the code \"\n            \"system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    property__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_property\", title=\"Extension field for ``property``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Code from the system, or regex criteria, or boolean value for exists\",\n        description=(\n            \"The match value may be either a code defined by the system, or a \"\n            \"string value, which is a regex match on the literal string of the \"\n            \"property value  (if the filter represents a property defined in \"\n            \"CodeSystem) or of the system filter value (if the filter represents a \"\n            \"filter defined in CodeSystem) when the operation is 'regex', or one of\"\n            \" the values (true and false), when the operation is 'exists'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetComposeIncludeFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"property\", \"op\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"property\", \"op\", \"value\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"op\", \"op__ext\"),\n            (\"property\", \"property__ext\"),\n            (\"value\", \"value__ext\"),\n        ]\n        return required_fields\n\n\nclass ValueSetExpansion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Used when the value set is \"expanded\".\n    A value set can also be \"expanded\", where the value set is turned into a\n    simple collection of enumerated codes. This element holds the expansion, if\n    it has been performed.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetExpansion\"\n\n    contains: typing.List[fhirtypes.ValueSetExpansionContainsType] | None = Field(\n        default=None,\n        alias=\"contains\",\n        title=\"Codes in the value set\",\n        description=\"The codes that are contained in the value set expansion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifies the value set expansion (business identifier)\",\n        description=(\n            \"An identifier that uniquely identifies this expansion of the valueset,\"\n            \" based on a unique combination of the provided parameters, the system \"\n            \"default parameters, and the underlying system code system versions \"\n            \"etc. Systems may re-use the same identifier as long as those factors \"\n            \"remain the same, and the expansion is the same, but are not required \"\n            \"to do so. This is a business identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    identifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_identifier\", title=\"Extension field for ``identifier``.\"\n    )\n\n    offset: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"offset\",\n        title=\"Offset at which this resource starts\",\n        description=(\n            \"If paging is being used, the offset at which this resource starts.  \"\n            \"I.e. this resource is a partial view into the expansion. If paging is \"\n            \"not being used, this element SHALL NOT be present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    offset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_offset\", title=\"Extension field for ``offset``.\"\n    )\n\n    parameter: typing.List[fhirtypes.ValueSetExpansionParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Parameter that controlled the expansion process\",\n        description=(\n            \"A parameter that controlled the expansion process. These parameters \"\n            \"may be used by users of expanded value sets to check whether the \"\n            \"expansion is suitable for a particular purpose, or to pick the correct\"\n            \" expansion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timestamp: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timestamp\",\n        title=\"Time ValueSet expansion happened\",\n        description=\"The time at which the expansion was produced by the expanding system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timestamp\", title=\"Extension field for ``timestamp``.\"\n    )\n\n    total: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"Total number of codes in the expansion\",\n        description=(\n            \"The total number of concepts in the expansion. If the number of \"\n            \"concept nodes in this resource is less than the stated number, then \"\n            \"the server can return more using the offset parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    total__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_total\", title=\"Extension field for ``total``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetExpansion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"timestamp\",\n            \"total\",\n            \"offset\",\n            \"parameter\",\n            \"contains\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetExpansion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"timestamp\", \"timestamp__ext\")]\n        return required_fields\n\n\nclass ValueSetExpansionContains(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Codes in the value set.\n    The codes that are contained in the value set expansion.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetExpansionContains\"\n\n    abstract: bool | None = Field(\n        default=None,\n        alias=\"abstract\",\n        title=\"If user cannot select this entry\",\n        description=(\n            \"If true, this entry is included in the expansion for navigational \"\n            \"purposes, and the user cannot select the code directly as a proper \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    abstract__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_abstract\", title=\"Extension field for ``abstract``.\"\n    )\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code - if blank, this is not a selectable code\",\n        description=(\n            \"The code for this item in the expansion hierarchy. If this code is \"\n            \"missing the entry in the hierarchy is a place holder (abstract) and \"\n            \"does not represent a valid code in the value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    contains: typing.List[fhirtypes.ValueSetExpansionContainsType] | None = Field(\n        default=None,\n        alias=\"contains\",\n        title=\"Codes contained under this entry\",\n        description=\"Other codes and entries contained under this entry in the hierarchy.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    designation: typing.List[\n        fhirtypes.ValueSetComposeIncludeConceptDesignationType\n    ] | None = Field(\n        default=None,\n        alias=\"designation\",\n        title=\"Additional representations for this item\",\n        description=(\n            \"Additional representations for this item - other languages, aliases, \"\n            \"specialized purposes, used for particular purposes, etc. These are \"\n            \"relevant when the conditions of the expansion do not fix to a single \"\n            \"correct representation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"User display for the concept\",\n        description=\"The recommended display for this item in the expansion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    inactive: bool | None = Field(\n        default=None,\n        alias=\"inactive\",\n        title=\"If concept is inactive in the code system\",\n        description=(\n            \"If the concept is inactive in the code system that defines it. \"\n            \"Inactive codes are those that are no longer to be used, but are \"\n            \"maintained by the code system for understanding legacy data. It might \"\n            \"not be known or specified whether an concept is inactive (and it may \"\n            \"depend on the context of use).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_inactive\", title=\"Extension field for ``inactive``.\"\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"System value for the code\",\n        description=(\n            \"An absolute URI which is the code system in which the code for this \"\n            \"item in the expansion is defined.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version in which this code/display is defined\",\n        description=(\n            \"The version of the code system from this code was taken. Note that a \"\n            \"well-maintained code system does not need the version reported, \"\n            \"because the meaning of codes is consistent across versions. However \"\n            \"this cannot consistently be assured, and when the meaning is not \"\n            \"guaranteed to be consistent, the version SHOULD be exchanged.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetExpansionContains`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"system\",\n            \"abstract\",\n            \"inactive\",\n            \"version\",\n            \"code\",\n            \"display\",\n            \"designation\",\n            \"contains\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetExpansionContains`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ValueSetExpansionParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Parameter that controlled the expansion process.\n    A parameter that controlled the expansion process. These parameters may be\n    used by users of expanded value sets to check whether the expansion is\n    suitable for a particular purpose, or to pick the correct expansion.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetExpansionParameter\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name as assigned by the client or server\",\n        description=(\n            \"Name of the input parameter to the $expand operation; may be a server-\"\n            \"assigned name for additional default or other server-supplied \"\n            \"parameters used to control the expansion process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetExpansionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueDecimal\",\n            \"valueUri\",\n            \"valueCode\",\n            \"valueDateTime\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetExpansionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueString\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/R4B/verificationresult.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/VerificationResult\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass VerificationResult(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes validation requirements, source(s), status and dates for one or\n    more elements.\n    \"\"\"\n\n    __resource_type__ = \"VerificationResult\"\n\n    attestation: fhirtypes.VerificationResultAttestationType | None = Field(\n        default=None,\n        alias=\"attestation\",\n        title=\"Information about the entity attesting to information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    failureAction: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"failureAction\",\n        title=\"fatal | warn | rec-only | none\",\n        description=\"The result if validation fails (fatal; warning; record only; none).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    frequency: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"frequency\",\n        title=\"Frequency of revalidation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lastPerformed: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"lastPerformed\",\n        title=(\n            \"The date/time validation was last completed (including failed \"\n            \"validations)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastPerformed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastPerformed\",\n        title=\"Extension field for ``lastPerformed``.\",\n    )\n\n    need: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"need\",\n        title=\"none | initial | periodic\",\n        description=(\n            \"The frequency with which the target must be validated (none; initial; \"\n            \"periodic).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    nextScheduled: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"nextScheduled\",\n        title=\"The date when target is next validated, if appropriate\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    nextScheduled__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_nextScheduled\",\n        title=\"Extension field for ``nextScheduled``.\",\n    )\n\n    primarySource: typing.List[\n        fhirtypes.VerificationResultPrimarySourceType\n    ] | None = Field(\n        default=None,\n        alias=\"primarySource\",\n        title=\"Information about the primary source(s) involved in validation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"attested | validated | in-process | req-revalid | val-fail | reval-\" \"fail\"\n        ),\n        description=(\n            \"The validation status of the target (attested; validated; in process; \"\n            \"requires revalidation; validation failed; revalidation failed).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"attested\",\n                \"validated\",\n                \"in-process\",\n                \"req-revalid\",\n                \"val-fail\",\n                \"reval-fail\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"When the validation status was updated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    target: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"A resource that was validated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    targetLocation: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"targetLocation\",\n        title=\"The fhirpath location(s) within the resource that was validated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    targetLocation__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_targetLocation\",\n        title=\"Extension field for ``targetLocation``.\",\n    )\n\n    validationProcess: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"validationProcess\",\n        title=(\n            \"The primary process by which the target is validated (edit check; \"\n            \"value set; primary source; multiple sources; standalone; in context)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    validationType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"validationType\",\n        title=\"nothing | primary | multiple\",\n        description=(\n            \"What the target is validated against (nothing; primary source; \"\n            \"multiple sources).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    validator: typing.List[fhirtypes.VerificationResultValidatorType] | None = Field(\n        default=None,\n        alias=\"validator\",\n        title=\"Information about the entity validating information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VerificationResult`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"target\",\n            \"targetLocation\",\n            \"need\",\n            \"status\",\n            \"statusDate\",\n            \"validationType\",\n            \"validationProcess\",\n            \"frequency\",\n            \"lastPerformed\",\n            \"nextScheduled\",\n            \"failureAction\",\n            \"primarySource\",\n            \"attestation\",\n            \"validator\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VerificationResult`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"target\",\n            \"targetLocation\",\n            \"need\",\n            \"status\",\n            \"statusDate\",\n            \"validationType\",\n            \"validationProcess\",\n            \"failureAction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass VerificationResultAttestation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the entity attesting to information.\n    \"\"\"\n\n    __resource_type__ = \"VerificationResultAttestation\"\n\n    communicationMethod: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"communicationMethod\",\n        title=\"The method by which attested information was submitted/retrieved\",\n        description=(\n            \"The method by which attested information was submitted/retrieved \"\n            \"(manual; API; Push).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"The date the information was attested to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=(\n            \"When the who is asserting on behalf of another (organization or \"\n            \"individual)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    proxyIdentityCertificate: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"proxyIdentityCertificate\",\n        title=(\n            \"A digital identity certificate associated with the proxy entity \"\n            \"submitting attested information on behalf of the attestation source\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    proxyIdentityCertificate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_proxyIdentityCertificate\",\n        title=\"Extension field for ``proxyIdentityCertificate``.\",\n    )\n\n    proxySignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"proxySignature\",\n        title=\"Proxy signature\",\n        description=(\n            \"Signed assertion by the proxy entity indicating that they have the \"\n            \"right to submit attested information on behalf of the attestation \"\n            \"source.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sourceIdentityCertificate: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sourceIdentityCertificate\",\n        title=\"A digital identity certificate associated with the attestation source\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceIdentityCertificate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sourceIdentityCertificate\",\n        title=\"Extension field for ``sourceIdentityCertificate``.\",\n    )\n\n    sourceSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"sourceSignature\",\n        title=\"Attester signature\",\n        description=(\n            \"Signed assertion by the attestation source that they have attested to \"\n            \"the information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    who: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"who\",\n        title=\"The individual or organization attesting to information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VerificationResultAttestation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"who\",\n            \"onBehalfOf\",\n            \"communicationMethod\",\n            \"date\",\n            \"sourceIdentityCertificate\",\n            \"proxyIdentityCertificate\",\n            \"proxySignature\",\n            \"sourceSignature\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VerificationResultAttestation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"who\", \"onBehalfOf\", \"communicationMethod\", \"date\"]\n\n\nclass VerificationResultPrimarySource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the primary source(s) involved in validation.\n    \"\"\"\n\n    __resource_type__ = \"VerificationResultPrimarySource\"\n\n    canPushUpdates: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"canPushUpdates\",\n        title=\"yes | no | undetermined\",\n        description=(\n            \"Ability of the primary source to push updates/alerts (yes; no; \"\n            \"undetermined).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    communicationMethod: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"communicationMethod\",\n        title=\"Method for exchanging information with the primary source\",\n        description=\"Method for communicating with the primary source (manual; API; Push).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    pushTypeAvailable: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"pushTypeAvailable\",\n        title=\"specific | any | source\",\n        description=(\n            \"Type of alerts/updates the primary source can send (specific requested\"\n            \" changes; any changes; as defined by source).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Type of primary source (License Board; Primary Education; Continuing \"\n            \"Education; Postal Service; Relationship owner; Registration Authority;\"\n            \" legal source; issuing source; authoritative source)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    validationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"validationDate\",\n        title=\"When the target was validated against the primary source\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    validationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_validationDate\",\n        title=\"Extension field for ``validationDate``.\",\n    )\n\n    validationStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"validationStatus\",\n        title=\"successful | failed | unknown\",\n        description=(\n            \"Status of the validation of the target against the primary source \"\n            \"(successful; failed; unknown).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    who: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"who\",\n        title=\"Reference to the primary source\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VerificationResultPrimarySource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"who\",\n            \"type\",\n            \"communicationMethod\",\n            \"validationStatus\",\n            \"validationDate\",\n            \"canPushUpdates\",\n            \"pushTypeAvailable\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VerificationResultPrimarySource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"communicationMethod\", \"canPushUpdates\"]\n\n\nclass VerificationResultValidator(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the entity validating information.\n    \"\"\"\n\n    __resource_type__ = \"VerificationResultValidator\"\n\n    attestationSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"attestationSignature\",\n        title=\"Validator signature\",\n        description=(\n            \"Signed assertion by the validator that they have validated the \"\n            \"information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identityCertificate: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"identityCertificate\",\n        title=\"A digital identity certificate associated with the validator\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    identityCertificate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_identityCertificate\",\n        title=\"Extension field for ``identityCertificate``.\",\n    )\n\n    organization: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"organization\",\n        title=\"Reference to the organization validating information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VerificationResultValidator`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"organization\",\n            \"identityCertificate\",\n            \"attestationSignature\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VerificationResultValidator`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/R4B/visionprescription.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/VisionPrescription\nRelease: R4B\nVersion: 4.3.0\nBuild ID: c475c22\nLast updated: 2022-05-28T12:47:40.239+10:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass VisionPrescription(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Prescription for vision correction products for a patient.\n    An authorization for the provision of glasses and/or contact lenses to a\n    patient.\n    \"\"\"\n\n    __resource_type__ = \"VisionPrescription\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Response creation date\",\n        description=\"The date this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    dateWritten: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateWritten\",\n        title=\"When prescription was authorized\",\n        description=\"The date (and perhaps time) when the prescription was written.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    dateWritten__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dateWritten\", title=\"Extension field for ``dateWritten``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Created during encounter / admission / stay\",\n        description=(\n            \"A reference to a resource that identifies the particular occurrence of\"\n            \" contact between patient and health care provider during which the \"\n            \"prescription was issued.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for vision prescription\",\n        description=\"A unique identifier assigned to this vision prescription.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lensSpecification: typing.List[\n        fhirtypes.VisionPrescriptionLensSpecificationType\n    ] = Field(\n        default=...,\n        alias=\"lensSpecification\",\n        title=\"Vision lens authorization\",\n        description=(\n            \"Contain the details of  the individual lens specifications and serves \"\n            \"as the authorization for the fullfillment by certified professionals.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who prescription is for\",\n        description=(\n            \"A resource reference to the person to whom the vision prescription \"\n            \"applies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    prescriber: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"prescriber\",\n        title=\"Who authorized the vision prescription\",\n        description=(\n            \"The healthcare professional responsible for authorizing the \"\n            \"prescription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VisionPrescription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"created\",\n            \"patient\",\n            \"encounter\",\n            \"dateWritten\",\n            \"prescriber\",\n            \"lensSpecification\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VisionPrescription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"created\",\n            \"patient\",\n            \"dateWritten\",\n            \"prescriber\",\n            \"lensSpecification\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"dateWritten\", \"dateWritten__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass VisionPrescriptionLensSpecification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Vision lens authorization.\n    Contain the details of  the individual lens specifications and serves as\n    the authorization for the fullfillment by certified professionals.\n    \"\"\"\n\n    __resource_type__ = \"VisionPrescriptionLensSpecification\"\n\n    add: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"add\",\n        title=\"Added power for multifocal levels\",\n        description=(\n            \"Power adjustment for multifocal lenses measured in dioptres (0.25 \"\n            \"units).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    add__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_add\", title=\"Extension field for ``add``.\"\n    )\n\n    axis: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"axis\",\n        title=\"Lens meridian which contain no power for astigmatism\",\n        description=\"Adjustment for astigmatism measured in integer degrees.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    axis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_axis\", title=\"Extension field for ``axis``.\"\n    )\n\n    backCurve: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"backCurve\",\n        title=\"Contact lens back curvature\",\n        description=\"Back curvature measured in millimetres.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    backCurve__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_backCurve\", title=\"Extension field for ``backCurve``.\"\n    )\n\n    brand: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"brand\",\n        title=\"Brand required\",\n        description=\"Brand recommendations or restrictions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    brand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_brand\", title=\"Extension field for ``brand``.\"\n    )\n\n    color: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"color\",\n        title=\"Color required\",\n        description=\"Special color or pattern.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    color__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_color\", title=\"Extension field for ``color``.\"\n    )\n\n    cylinder: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"cylinder\",\n        title=\"Lens power for astigmatism\",\n        description=\"Power adjustment for astigmatism measured in dioptres (0.25 units).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    cylinder__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_cylinder\", title=\"Extension field for ``cylinder``.\"\n    )\n\n    diameter: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"diameter\",\n        title=\"Contact lens diameter\",\n        description=\"Contact lens diameter measured in millimetres.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    diameter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_diameter\", title=\"Extension field for ``diameter``.\"\n    )\n\n    duration: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"Lens wear duration\",\n        description=\"The recommended maximum wear period for the lens.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    eye: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"eye\",\n        title=\"right | left\",\n        description=\"The eye for which the lens specification applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"right\", \"left\"],\n        },\n    )\n    eye__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_eye\", title=\"Extension field for ``eye``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Notes for coatings\",\n        description=\"Notes for special requirements such as coatings and lens materials.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    power: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"power\",\n        title=\"Contact lens power\",\n        description=\"Contact lens power measured in dioptres (0.25 units).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    power__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_power\", title=\"Extension field for ``power``.\"\n    )\n\n    prism: typing.List[\n        fhirtypes.VisionPrescriptionLensSpecificationPrismType\n    ] | None = Field(\n        default=None,\n        alias=\"prism\",\n        title=\"Eye alignment compensation\",\n        description=\"Allows for adjustment on two axis.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    product: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"product\",\n        title=\"Product to be supplied\",\n        description=(\n            \"Identifies the type of vision correction product which is required for\"\n            \" the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sphere: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"sphere\",\n        title=\"Power of the lens\",\n        description=\"Lens power measured in dioptres (0.25 units).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sphere__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sphere\", title=\"Extension field for ``sphere``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VisionPrescriptionLensSpecification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"product\",\n            \"eye\",\n            \"sphere\",\n            \"cylinder\",\n            \"axis\",\n            \"prism\",\n            \"add\",\n            \"power\",\n            \"backCurve\",\n            \"diameter\",\n            \"duration\",\n            \"color\",\n            \"brand\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VisionPrescriptionLensSpecification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"product\", \"eye\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"eye\", \"eye__ext\")]\n        return required_fields\n\n\nclass VisionPrescriptionLensSpecificationPrism(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Eye alignment compensation.\n    Allows for adjustment on two axis.\n    \"\"\"\n\n    __resource_type__ = \"VisionPrescriptionLensSpecificationPrism\"\n\n    amount: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Amount of adjustment\",\n        description=\"Amount of prism to compensate for eye alignment in fractional units.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    amount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_amount\", title=\"Extension field for ``amount``.\"\n    )\n\n    base: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"up | down | in | out\",\n        description=\"The relative base, or reference lens edge, for the prism.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"up\", \"down\", \"in\", \"out\"],\n        },\n    )\n    base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_base\", title=\"Extension field for ``base``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VisionPrescriptionLensSpecificationPrism`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"amount\", \"base\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VisionPrescriptionLensSpecificationPrism`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"amount\", \"amount__ext\"), (\"base\", \"base__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/__init__.py",
    "content": "from __future__ import annotations as _annotations\n\nfrom functools import lru_cache\nfrom typing import TYPE_CHECKING, cast\n\nfrom fhir_core.fhirabstractmodel import FHIRAbstractModel\n\n__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n__fhir_version__ = \"3.0.2\"\n\n\n@lru_cache(maxsize=None, typed=True)\ndef get_fhir_model_class(model_name: str) -> type[FHIRAbstractModel]:\n    \"\"\" \"\"\"\n    from . import fhirtypes as ft\n\n    try:\n        model_type = getattr(ft, model_name + \"Type\")\n        if TYPE_CHECKING:\n            from fhir_core.types import FhirBase\n\n            model_type = cast(type[FhirBase], model_type)\n\n        return model_type.get_model_klass()\n\n    except AttributeError:\n        raise ValueError(f\"{model_name} is not a valid FHIR Model\")\n"
  },
  {
    "path": "fhir/resources/STU3/account.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Account\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Account(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Tracks balance, charges, for patient or cost center.\n    A financial tool for tracking value accrued for a particular purpose.  In\n    the healthcare field, used to track charges for a patient, cost centers,\n    etc.\n    \"\"\"\n\n    __resource_type__ = \"Account\"\n\n    active: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Time window that transactions may be posted to this account\",\n        description=(\n            \"Indicates the period of time over which the account is allowed to have\"\n            \" transactions posted to it. This period may be different to the \"\n            \"coveragePeriod which is the duration of time that services may occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    balance: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"balance\",\n        title=\"How much is in account?\",\n        description=(\n            \"Represents the sum of all credits less all debits associated with the \"\n            \"account.  Might be positive, zero or negative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    coverage: typing.List[fhirtypes.AccountCoverageType] | None = Field(\n        default=None,\n        alias=\"coverage\",\n        title=(\n            \"The party(s) that are responsible for covering the payment of this \"\n            \"account, and what order should they be applied to the account\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Explanation of purpose/use\",\n        description=(\n            \"Provides additional information about what the account tracks and how \"\n            \"it is used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    guarantor: typing.List[fhirtypes.AccountGuarantorType] | None = Field(\n        default=None,\n        alias=\"guarantor\",\n        title=\"Responsible for the account\",\n        description=\"Parties financially responsible for the account.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Account number\",\n        description=(\n            \"Unique identifier used to reference the account.  May or may not be \"\n            \"intended for human use (e.g. credit card number).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human-readable label\",\n        description=(\n            \"Name used for the account when displaying it to humans in reports, \" \"etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    owner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"owner\",\n        title=\"Who is responsible?\",\n        description=(\n            \"Indicates the organization, department, etc. with responsibility for \"\n            \"the account.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Transaction window\",\n        description=(\n            \"Identifies the period of time the account applies to; e.g. accounts \"\n            \"created per fiscal year, quarter, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=\"Indicates whether the account is presently used/usable or not.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"What is account tied to?\",\n        description=(\n            \"Identifies the patient, device, practitioner, location or other object\"\n            \" the account is associated with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Device\",\n                \"Practitioner\",\n                \"Location\",\n                \"HealthcareService\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"E.g. patient, expense, depreciation\",\n        description=\"Categorizes the account for reporting and searching purposes.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Account`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"name\",\n            \"subject\",\n            \"period\",\n            \"active\",\n            \"balance\",\n            \"coverage\",\n            \"owner\",\n            \"description\",\n            \"guarantor\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Account`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"name\",\n            \"subject\",\n            \"period\",\n            \"active\",\n            \"coverage\",\n            \"owner\",\n            \"description\",\n        ]\n\n\nclass AccountCoverage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The party(s) that are responsible for covering the payment of this account,\n    and what order should they be applied to the account.\n    \"\"\"\n\n    __resource_type__ = \"AccountCoverage\"\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=(\n            \"The party(s) that are responsible for covering the payment of this \"\n            \"account\"\n        ),\n        description=(\n            \"The party(s) that are responsible for payment (or part of) of charges \"\n            \"applied to this account (including self-pay).  A coverage may only be \"\n            \"resposible for specific types of charges, and the sequence of the \"\n            \"coverages in the account could be important when processing billing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    priority: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"The priority of the coverage in the context of this account\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AccountCoverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"coverage\", \"priority\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AccountCoverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"coverage\", \"priority\"]\n\n\nclass AccountGuarantor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Responsible for the account.\n    Parties financially responsible for the account.\n    \"\"\"\n\n    __resource_type__ = \"AccountGuarantor\"\n\n    onHold: bool | None = Field(\n        default=None,\n        alias=\"onHold\",\n        title=\"Credit or other hold applied\",\n        description=(\n            \"A guarantor may be placed on credit hold or otherwise have their role \"\n            \"temporarily suspended.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    onHold__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onHold\", title=\"Extension field for ``onHold``.\"\n    )\n\n    party: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"party\",\n        title=\"Responsible entity\",\n        description=\"The entity who is responsible.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\", \"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Guarrantee account during\",\n        description=(\n            \"The timeframe during which the guarantor accepts responsibility for \"\n            \"the account.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AccountGuarantor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"party\", \"onHold\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AccountGuarantor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/activitydefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ActivityDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ActivityDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The definition of a specific activity to be taken, independent of any\n    particular patient or context.\n    This resource allows for the definition of some activity to be performed,\n    independent of a particular patient, practitioner, or other performance\n    context.\n    \"\"\"\n\n    __resource_type__ = \"ActivityDefinition\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the activity definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"What part of body to perform on\",\n        description=(\n            \"Indicates the sites on the subject's body where the procedure should \"\n            \"be performed (I.e. the target sites).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Detail type of activity\",\n        description=(\n            \"Detailed description of the type of activity; e.g. What lab test, what\"\n            \" procedure, what kind of encounter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contributor: typing.List[fhirtypes.ContributorType] | None = Field(\n        default=None,\n        alias=\"contributor\",\n        title=\"A content contributor\",\n        description=(\n            \"A contributor to the content of the asset, including authors, editors,\"\n            \" reviewers, and endorsers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the activity definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the activity definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the activity definition was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the activity definition\"\n            \" changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the activity definition\",\n        description=(\n            \"A free text natural language description of the activity definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    dosage: typing.List[fhirtypes.DosageType] | None = Field(\n        default=None,\n        alias=\"dosage\",\n        title=\"Detailed dosage instructions\",\n        description=(\n            \"Provides detailed dosage instructions in the same way that they are \"\n            \"described for MedicationRequest resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dynamicValue: typing.List[\n        fhirtypes.ActivityDefinitionDynamicValueType\n    ] | None = Field(\n        default=None,\n        alias=\"dynamicValue\",\n        title=\"Dynamic aspects of the definition\",\n        description=(\n            \"Dynamic values that will be evaluated to produce values for elements \"\n            \"of the resulting resource. For example, if the dosage of a medication \"\n            \"must be computed based on the patient's weight, a dynamic value would \"\n            \"be used to specify an expression that calculated the weight, and the \"\n            \"path on the intent resource that would contain the result.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the activity definition is expected to be used\",\n        description=(\n            \"The period during which the activity definition content was or is \"\n            \"planned to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this activity definition is authored \"\n            \"for testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the activity definition\",\n        description=(\n            \"A formal identifier that is used to identify this activity definition \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for activity definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the activity definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"Kind of resource\",\n        description=(\n            \"A description of the kind of resource the activity definition is \"\n            \"representing. For example, a MedicationRequest, a ProcedureRequest, or\"\n            \" a CommunicationRequest. Typically, but not always, this is a Request \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the activity definition was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval, but doesn't change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    library: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the asset\",\n        description=(\n            \"A reference to a Library resource containing any formal logic used by \"\n            \"the asset.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where it should happen\",\n        description=(\n            \"Identifies the facility where the activity will occur; e.g. home, \"\n            \"hospital, specific clinic, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this activity definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the activity definition. This name\"\n            \" should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    participant: typing.List[\n        fhirtypes.ActivityDefinitionParticipantType\n    ] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Who should participate in the action\",\n        description=\"Indicates who should participate in performing the action described.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productCodeableConcept\",\n        title=\"What's administered/supplied\",\n        description=(\n            \"Identifies the food, drug or other product being consumed or supplied \"\n            \"in the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e product[x]\n            \"one_of_many\": \"product\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    productReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"productReference\",\n        title=\"What's administered/supplied\",\n        description=(\n            \"Identifies the food, drug or other product being consumed or supplied \"\n            \"in the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e product[x]\n            \"one_of_many\": \"product\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\", \"Substance\"],\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the activity\"\n            \" definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this activity definition is defined\",\n        description=(\n            \"Explaination of why this activity definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"How much is administered/consumed/supplied\",\n        description=(\n            \"Identifies the quantity expected to be consumed at once (per dose, per\"\n            \" meal, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this activity definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    timingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timingDateTime\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timingDateTime\",\n        title=\"Extension field for ``timingDateTime``.\",\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"timingRange\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this activity definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the activity definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptive topics related to the content of the activity. Topics \"\n            \"provide a high-level categorization of the activity that can be useful\"\n            \" for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    transform: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"transform\",\n        title=\"Transform to apply the template\",\n        description=(\n            \"A reference to a StructureMap resource that defines a transform that \"\n            \"can be executed to produce the intent resource using the \"\n            \"ActivityDefinition instance as the input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureMap\"],\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this activity definition (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this activity definition when\"\n            \" it is referenced in a specification, model, design or an instance. \"\n            \"This SHALL be a URL, SHOULD be globally unique, and SHOULD be an \"\n            \"address at which this activity definition is (or will be) published. \"\n            \"The URL SHOULD include the major version of the activity definition. \"\n            \"For more information see [Technical and Business \"\n            \"Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the asset\",\n        description=(\n            \"A detailed description of how the asset is used from a clinical \"\n            \"perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate activity definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the activity definition\",\n        description=(\n            \"The identifier that is used to identify this version of the activity \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the activity \"\n            \"definition author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence. To provide a version consistent \"\n            \"with the Decision Support Service specification, use the format \"\n            \"Major.Minor.Revision (e.g. 1.0.0). For more information on versioning \"\n            \"knowledge assets, refer to the Decision Support Service specification.\"\n            \" Note that a version is required for non-experimental active assets.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ActivityDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"description\",\n            \"purpose\",\n            \"usage\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"topic\",\n            \"contributor\",\n            \"contact\",\n            \"copyright\",\n            \"relatedArtifact\",\n            \"library\",\n            \"kind\",\n            \"code\",\n            \"timingTiming\",\n            \"timingDateTime\",\n            \"timingPeriod\",\n            \"timingRange\",\n            \"location\",\n            \"participant\",\n            \"productReference\",\n            \"productReference\",\n            \"productCodeableConcept\",\n            \"quantity\",\n            \"dosage\",\n            \"bodySite\",\n            \"transform\",\n            \"dynamicValue\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ActivityDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"description\",\n            \"effectivePeriod\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"contact\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"product\": [\"productCodeableConcept\", \"productReference\"],\n            \"timing\": [\"timingDateTime\", \"timingPeriod\", \"timingRange\", \"timingTiming\"],\n        }\n        return one_of_many_fields\n\n\nclass ActivityDefinitionDynamicValue(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dynamic aspects of the definition.\n    Dynamic values that will be evaluated to produce values for elements of the\n    resulting resource. For example, if the dosage of a medication must be\n    computed based on the patient's weight, a dynamic value would be used to\n    specify an expression that calculated the weight, and the path on the\n    intent resource that would contain the result.\n    \"\"\"\n\n    __resource_type__ = \"ActivityDefinitionDynamicValue\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the dynamic value\",\n        description=(\n            \"A brief, natural language description of the intended semantics of the\"\n            \" dynamic value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"An expression that provides the dynamic value for the customization\",\n        description=\"An expression specifying the value of the customized element.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    language: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language of the expression\",\n        description=\"The media type of the language for the expression.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"The path to the element to be set dynamically\",\n        description=(\n            \"The path to the element to be customized. This is the path on the \"\n            \"resource that will hold the result of the calculation defined by the \"\n            \"expression.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ActivityDefinitionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"path\",\n            \"language\",\n            \"expression\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ActivityDefinitionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ActivityDefinitionParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who should participate in the action.\n    Indicates who should participate in performing the action described.\n    \"\"\"\n\n    __resource_type__ = \"ActivityDefinitionParticipant\"\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"E.g. Nurse, Surgeon, Parent, etc\",\n        description=(\n            \"The role the participant should play in performing the described \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"patient | practitioner | related-person\",\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"patient\", \"practitioner\", \"related-person\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ActivityDefinitionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"role\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ActivityDefinitionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/address.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Address\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Address(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An address expressed using postal conventions (as opposed to GPS or other\n    location definition formats).\n    An address expressed using postal conventions (as opposed to GPS or other\n    location definition formats).  This data type may be used to convey\n    addresses for use in delivering mail as well as for visiting locations\n    which might not be valid for mail delivery.  There are a variety of postal\n    address formats defined around the world.\n    \"\"\"\n\n    __resource_type__ = \"Address\"\n\n    city: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"city\",\n        title=\"Name of city, town etc.\",\n        description=(\n            \"The name of the city, town, village or other community or delivery \"\n            \"center.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    city__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_city\", title=\"Extension field for ``city``.\"\n    )\n\n    country: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"country\",\n        title=\"Country (e.g. can be ISO 3166 2 or 3 letter code)\",\n        description=\"Country - a nation as commonly understood or generally accepted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    country__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_country\", title=\"Extension field for ``country``.\"\n    )\n\n    district: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"district\",\n        title=\"District name (aka county)\",\n        description=\"The name of the administrative area (county).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    district__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_district\", title=\"Extension field for ``district``.\"\n    )\n\n    line: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"line\",\n        title=\"Street name, number, direction & P.O. Box etc.\",\n        description=(\n            \"This component contains the house number, apartment number, street \"\n            \"name, street direction,  P.O. Box number, delivery hints, and similar \"\n            \"address information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    line__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_line\", title=\"Extension field for ``line``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when address was/is in use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    postalCode: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"postalCode\",\n        title=\"Postal code for area\",\n        description=\"A postal code designating a region defined by the postal service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    postalCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_postalCode\", title=\"Extension field for ``postalCode``.\"\n    )\n\n    state: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"state\",\n        title=\"Sub-unit of country (abbreviations ok)\",\n        description=(\n            \"Sub-unit of a country with limited sovereignty in a federally \"\n            \"organized country. A code may be used if codes are in common use (i.e.\"\n            \" US 2 letter state codes).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    state__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_state\", title=\"Extension field for ``state``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text representation of the address\",\n        description=\"A full text representation of the address.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"postal | physical | both\",\n        description=(\n            \"Distinguishes between physical addresses (those you can visit) and \"\n            \"mailing addresses (e.g. PO Boxes and care-of addresses). Most \"\n            \"addresses are both.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"postal\", \"physical\", \"both\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"home | work | temp | old - purpose of this address\",\n        description=\"The purpose of this address.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"home\", \"work\", \"temp\", \"old\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Address`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"use\",\n            \"type\",\n            \"text\",\n            \"line\",\n            \"city\",\n            \"district\",\n            \"state\",\n            \"postalCode\",\n            \"country\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Address`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"use\",\n            \"type\",\n            \"text\",\n            \"line\",\n            \"city\",\n            \"district\",\n            \"state\",\n            \"postalCode\",\n            \"country\",\n            \"period\",\n        ]\n"
  },
  {
    "path": "fhir/resources/STU3/adverseevent.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AdverseEvent\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass AdverseEvent(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Medical care, research study or other healthcare event causing physical\n    injury.\n    Actual or  potential/avoided event causing unintended physical injury\n    resulting from or contributed to by medical care, a research study or other\n    healthcare setting factors that requires additional monitoring, treatment,\n    or hospitalization, or that results in death.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEvent\"\n\n    category: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=(\n            \"AE | PAE  An adverse event is an event that caused harm to a patient,\"\n            \"  an adverse reaction is a something that is a subject-specific event \"\n            \"that is a result of an exposure to a medication, food, device or \"\n            \"environmental substance, a potential adverse event is something that \"\n            \"occurred and that could have caused harm to a patient but did not\"\n        ),\n        description=(\n            \"The type of event which is important to characterize what occurred and\"\n            \" caused harm to the subject, or had the potential to cause harm to the\"\n            \" subject.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"AE\", \"PAE\"],\n        },\n    )\n    category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_category\", title=\"Extension field for ``category``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the event occurred\",\n        description=\"The date (and perhaps time) when the adverse event occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the adverse event\",\n        description=\"Describes the adverse event in text.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    eventParticipant: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"eventParticipant\",\n        title=\"Who  was involved in the adverse event or the potential adverse event\",\n        description=(\n            \"Parties that may or should contribute or have contributed information \"\n            \"to the Act. Such information includes information leading to the \"\n            \"decision to perform the Act and how to perform the Act (e.g. \"\n            \"consultant), information that the Act itself seeks to reveal (e.g. \"\n            \"informant of clinical history), or information about what Act was \"\n            \"performed (e.g. informant witness).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Device\"],\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for the event\",\n        description=(\n            \"The identifier(s) of this adverse event that are assigned by business \"\n            \"processes and/or used to refer to it when a direct URL reference to \"\n            \"the resource itsefl is not appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Location where adverse event occurred\",\n        description=\"The information about where the adverse event occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=(\n            \"resolved | recovering | ongoing | resolvedWithSequelae | fatal | \"\n            \"unknown\"\n        ),\n        description=\"Describes the type of outcome from the adverse event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reaction: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reaction\",\n        title=\"Adverse Reaction Events linked to exposure to substance\",\n        description=(\n            \"Includes information about the reaction that occurred as a result of \"\n            \"exposure to a substance (for example, a drug or a chemical).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    recorder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recorder\",\n        title=\"Who recorded the adverse event\",\n        description=(\n            \"Information on who recorded the adverse event.  May be the patient or \"\n            \"a practitioner.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\", \"RelatedPerson\"],\n        },\n    )\n\n    referenceDocument: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"referenceDocument\",\n        title=\"AdverseEvent.referenceDocument\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    seriousness: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"seriousness\",\n        title=\"Mild | Moderate | Severe\",\n        description=\"Describes the seriousness or severity of the adverse event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    study: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"study\",\n        title=\"AdverseEvent.study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchStudy\"],\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Subject or group impacted by event\",\n        description=(\n            \"This subject or group impacted by the event.  With a prospective \"\n            \"adverse event, there will be no subject as the adverse event was \"\n            \"prevented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"ResearchSubject\",\n                \"Medication\",\n                \"Device\",\n            ],\n        },\n    )\n\n    subjectMedicalHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subjectMedicalHistory\",\n        title=\"AdverseEvent.subjectMedicalHistory\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"AllergyIntolerance\",\n                \"FamilyMemberHistory\",\n                \"Immunization\",\n                \"Procedure\",\n            ],\n        },\n    )\n\n    suspectEntity: typing.List[fhirtypes.AdverseEventSuspectEntityType] | None = Field(\n        default=None,\n        alias=\"suspectEntity\",\n        title=\"The suspected agent causing the adverse event\",\n        description=(\n            \"Describes the entity that is suspected to have caused the adverse \"\n            \"event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"actual | potential\",\n        description=(\n            \"This element defines the specific type of event that occurred or that \"\n            \"was prevented from occurring.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"category\",\n            \"type\",\n            \"subject\",\n            \"date\",\n            \"reaction\",\n            \"location\",\n            \"seriousness\",\n            \"outcome\",\n            \"recorder\",\n            \"eventParticipant\",\n            \"description\",\n            \"suspectEntity\",\n            \"subjectMedicalHistory\",\n            \"referenceDocument\",\n            \"study\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"category\",\n            \"type\",\n            \"subject\",\n            \"date\",\n            \"reaction\",\n            \"location\",\n            \"seriousness\",\n            \"outcome\",\n            \"recorder\",\n            \"eventParticipant\",\n            \"description\",\n            \"suspectEntity\",\n            \"subjectMedicalHistory\",\n            \"referenceDocument\",\n            \"study\",\n        ]\n\n\nclass AdverseEventSuspectEntity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The suspected agent causing the adverse event.\n    Describes the entity that is suspected to have caused the adverse event.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEventSuspectEntity\"\n\n    causality: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"causality\",\n        title=\"causality1 | causality2\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"causality1\", \"causality2\"],\n        },\n    )\n    causality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_causality\", title=\"Extension field for ``causality``.\"\n    )\n\n    causalityAssessment: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"causalityAssessment\",\n        title=\"assess1 | assess2\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    causalityAuthor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"causalityAuthor\",\n        title=\"AdverseEvent.suspectEntity.causalityAuthor\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    causalityMethod: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"causalityMethod\",\n        title=\"method1 | method2\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    causalityProductRelatedness: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"causalityProductRelatedness\",\n        title=\"AdverseEvent.suspectEntity.causalityProductRelatedness\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    causalityProductRelatedness__ext: fhirtypes.FHIRPrimitiveExtensionType | None = (\n        Field(\n            default=None,\n            alias=\"_causalityProductRelatedness\",\n            title=\"Extension field for ``causalityProductRelatedness``.\",\n        )\n    )\n\n    causalityResult: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"causalityResult\",\n        title=\"result1 | result2\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instance: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"instance\",\n        title=\"Refers to the specific entity that caused the adverse event\",\n        description=(\n            \"Identifies the actual instance of what caused the adverse event.  May \"\n            \"be a substance, medication, medication administration, medication \"\n            \"statement or a device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Substance\",\n                \"Medication\",\n                \"MedicationAdministration\",\n                \"MedicationStatement\",\n                \"Device\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEventSuspectEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"instance\",\n            \"causality\",\n            \"causalityAssessment\",\n            \"causalityProductRelatedness\",\n            \"causalityMethod\",\n            \"causalityAuthor\",\n            \"causalityResult\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEventSuspectEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"instance\",\n            \"causality\",\n            \"causalityAssessment\",\n            \"causalityProductRelatedness\",\n            \"causalityMethod\",\n            \"causalityAuthor\",\n            \"causalityResult\",\n        ]\n"
  },
  {
    "path": "fhir/resources/STU3/age.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Age\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Age(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A duration of time during which an organism (or a process) has existed.\n    \"\"\"\n\n    __resource_type__ = \"Age\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Age`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Age`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/STU3/allergyintolerance.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AllergyIntolerance\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass AllergyIntolerance(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Allergy or Intolerance (generally: Risk of adverse reaction to a substance).\n    Risk of harmful or undesirable, physiological response which is unique to\n    an individual and associated with exposure to a substance.\n    \"\"\"\n\n    __resource_type__ = \"AllergyIntolerance\"\n\n    assertedDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"assertedDate\",\n        title=\"Date record was believed accurate\",\n        description=(\n            \"The date on which the existance of the AllergyIntolerance was first \"\n            \"asserted or acknowledged.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    assertedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_assertedDate\",\n        title=\"Extension field for ``assertedDate``.\",\n    )\n\n    asserter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"asserter\",\n        title=\"Source of the information about the allergy\",\n        description=\"The source of the information about the allergy that is recorded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\", \"Practitioner\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"food | medication | environment | biologic\",\n        description=\"Category of the identified substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"food\", \"medication\", \"environment\", \"biologic\"],\n        },\n    )\n    category__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_category\", title=\"Extension field for ``category``.\"\n    )\n\n    clinicalStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"clinicalStatus\",\n        title=\"active | inactive | resolved\",\n        description=\"The clinical status of the allergy or intolerance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"resolved\"],\n        },\n    )\n    clinicalStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_clinicalStatus\",\n        title=\"Extension field for ``clinicalStatus``.\",\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies the allergy or intolerance\",\n        description=(\n            \"Code for an allergy or intolerance statement (either a positive or a \"\n            \"negated/excluded statement).  This may be a code for a substance or \"\n            \"pharmaceutical product that is considered to be responsible for the \"\n            'adverse reaction risk (e.g., \"Latex\"), an allergy or intolerance '\n            'condition (e.g., \"Latex allergy\"), or a negated/excluded code for a '\n            'specific substance or class (e.g., \"No latex allergy\") or a general or'\n            ' categorical negated statement (e.g.,  \"No known allergy\", \"No known '\n            'drug allergies\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    criticality: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"criticality\",\n        title=\"low | high | unable-to-assess\",\n        description=(\n            \"Estimate of the potential clinical harm, or seriousness, of the \"\n            \"reaction to the identified substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"low\", \"high\", \"unable-to-assess\"],\n        },\n    )\n    criticality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_criticality\", title=\"Extension field for ``criticality``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External ids for this item\",\n        description=(\n            \"This records identifiers associated with this allergy/intolerance \"\n            \"concern that are defined by business processes and/or used to refer to\"\n            \" it when a direct URL reference to the resource itself is not \"\n            \"appropriate (e.g. in CDA documents, or in written / printed \"\n            \"documentation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastOccurrence: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"lastOccurrence\",\n        title=\"Date(/time) of last known occurrence of a reaction\",\n        description=(\n            \"Represents the date and/or time of the last known occurrence of a \"\n            \"reaction event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastOccurrence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastOccurrence\",\n        title=\"Extension field for ``lastOccurrence``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional text not captured in other fields\",\n        description=(\n            \"Additional narrative about the propensity for the Adverse Reaction, \"\n            \"not captured in other fields.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onsetAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"onsetAge\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"onsetDateTime\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_onsetDateTime\",\n        title=\"Extension field for ``onsetDateTime``.\",\n    )\n\n    onsetPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"onsetPeriod\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"onsetRange\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"onsetString\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onsetString\", title=\"Extension field for ``onsetString``.\"\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who the sensitivity is for\",\n        description=\"The patient who has the allergy or intolerance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    reaction: typing.List[fhirtypes.AllergyIntoleranceReactionType] | None = Field(\n        default=None,\n        alias=\"reaction\",\n        title=\"Adverse Reaction Events linked to exposure to substance\",\n        description=(\n            \"Details about each adverse reaction event linked to exposure to the \"\n            \"identified substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recorder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recorder\",\n        title=\"Who recorded the sensitivity\",\n        description=(\n            \"Individual who recorded the record and takes responsibility for its \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Patient\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"allergy | intolerance - Underlying mechanism (if known)\",\n        description=(\n            \"Identification of the underlying physiological mechanism for the \"\n            \"reaction risk.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"allergy\", \"intolerance\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    verificationStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"verificationStatus\",\n        title=\"unconfirmed | confirmed | refuted | entered-in-error\",\n        description=(\n            \"Assertion about certainty associated with the propensity, or potential\"\n            \" risk, of a reaction to the identified substance (including \"\n            \"pharmaceutical product).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"unconfirmed\", \"confirmed\", \"refuted\", \"entered-in-error\"],\n        },\n    )\n    verificationStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_verificationStatus\",\n        title=\"Extension field for ``verificationStatus``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AllergyIntolerance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"clinicalStatus\",\n            \"verificationStatus\",\n            \"type\",\n            \"category\",\n            \"criticality\",\n            \"code\",\n            \"patient\",\n            \"onsetDateTime\",\n            \"onsetAge\",\n            \"onsetPeriod\",\n            \"onsetRange\",\n            \"onsetString\",\n            \"assertedDate\",\n            \"recorder\",\n            \"asserter\",\n            \"lastOccurrence\",\n            \"note\",\n            \"reaction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AllergyIntolerance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"clinicalStatus\",\n            \"verificationStatus\",\n            \"type\",\n            \"category\",\n            \"criticality\",\n            \"code\",\n            \"patient\",\n            \"asserter\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"verificationStatus\", \"verificationStatus__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"onset\": [\n                \"onsetAge\",\n                \"onsetDateTime\",\n                \"onsetPeriod\",\n                \"onsetRange\",\n                \"onsetString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass AllergyIntoleranceReaction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adverse Reaction Events linked to exposure to substance.\n    Details about each adverse reaction event linked to exposure to the\n    identified substance.\n    \"\"\"\n\n    __resource_type__ = \"AllergyIntoleranceReaction\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the event as a whole\",\n        description=(\n            \"Text description about the reaction as a whole, including details of \"\n            \"the manifestation if required.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    exposureRoute: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"exposureRoute\",\n        title=\"How the subject was exposed to the substance\",\n        description=(\n            \"Identification of the route by which the subject was exposed to the \"\n            \"substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    manifestation: typing.List[fhirtypes.CodeableConceptType] = Field(\n        default=...,\n        alias=\"manifestation\",\n        title=\"Clinical symptoms/signs associated with the Event\",\n        description=(\n            \"Clinical symptoms and/or signs that are observed or associated with \"\n            \"the adverse reaction event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Text about event not captured in other fields\",\n        description=(\n            \"Additional text about the adverse reaction event not captured in other\"\n            \" fields.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onset: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"onset\",\n        title=\"Date(/time) when manifestations showed\",\n        description=\"Record of the date and/or time of the onset of the Reaction.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    onset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onset\", title=\"Extension field for ``onset``.\"\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"mild | moderate | severe (of event as a whole)\",\n        description=(\n            \"Clinical assessment of the severity of the reaction event as a whole, \"\n            \"potentially considering multiple different manifestations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"mild\", \"moderate\", \"severe\"],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    substance: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"substance\",\n        title=(\n            \"Specific substance or pharmaceutical product considered to be \"\n            \"responsible for event\"\n        ),\n        description=(\n            \"Identification of the specific substance (or pharmaceutical product) \"\n            \"considered to be responsible for the Adverse Reaction event. Note: the\"\n            \" substance for a specific reaction may be different from the substance\"\n            \" identified as the cause of the risk, but it must be consistent with \"\n            \"it. For instance, it may be a more specific substance (e.g. a brand \"\n            \"medication) or a composite product that includes the identified \"\n            \"substance. It must be clinically safe to only process the 'code' and \"\n            \"ignore the 'reaction.substance'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AllergyIntoleranceReaction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"substance\",\n            \"manifestation\",\n            \"description\",\n            \"onset\",\n            \"severity\",\n            \"exposureRoute\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AllergyIntoleranceReaction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/annotation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Annotation\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Annotation(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Text node with attribution.\n    A  text note which also  contains information about who made the statement\n    and when.\n    \"\"\"\n\n    __resource_type__ = \"Annotation\"\n\n    authorReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authorReference\",\n        title=\"Individual responsible for the annotation\",\n        description=\"The individual responsible for making the annotation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e author[x]\n            \"one_of_many\": \"author\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    authorString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"authorString\",\n        title=\"Individual responsible for the annotation\",\n        description=\"The individual responsible for making the annotation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e author[x]\n            \"one_of_many\": \"author\",\n            \"one_of_many_required\": False,\n        },\n    )\n    authorString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_authorString\",\n        title=\"Extension field for ``authorString``.\",\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"The annotation  - text content\",\n        description=\"The text of the annotation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    time: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"time\",\n        title=\"When the annotation was made\",\n        description=\"Indicates when this particular annotation was made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_time\", title=\"Extension field for ``time``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Annotation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"authorReference\",\n            \"authorReference\",\n            \"authorReference\",\n            \"authorString\",\n            \"time\",\n            \"text\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Annotation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"authorReference\",\n            \"authorReference\",\n            \"authorReference\",\n            \"authorString\",\n            \"time\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"text\", \"text__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"author\": [\"authorReference\", \"authorString\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/appointment.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Appointment\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Appointment(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A booking of a healthcare event among patient(s), practitioner(s), related\n    person(s) and/or device(s) for a specific date/time. This may result in one\n    or more Encounter(s).\n    \"\"\"\n\n    __resource_type__ = \"Appointment\"\n\n    appointmentType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"appointmentType\",\n        title=(\n            \"The style of appointment or patient that has been booked in the slot \"\n            \"(not service type)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Additional comments\",\n        description=\"Additional comments about the appointment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"The date that this appointment was initially created\",\n        description=(\n            \"The date that this appointment was initially created. This could be \"\n            \"different to the meta.lastModified value on the initial entry, as this\"\n            \" could have been before the resource was created on the FHIR server, \"\n            \"and should remain unchanged over the lifespan of the appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Shown on a subject line in a meeting request, or appointment list\",\n        description=(\n            \"The brief description of the appointment as would be shown on a \"\n            \"subject line in a meeting request, or appointment list. Detailed or \"\n            \"expanded information should be put in the comment field.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    end: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"When appointment is to conclude\",\n        description=\"Date/Time that the appointment is to conclude.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this item\",\n        description=(\n            \"This records identifiers associated with this appointment concern that\"\n            \" are defined by business processes and/or used to refer to it when a \"\n            \"direct URL reference to the resource itself is not appropriate (e.g. \"\n            \"in CDA documents, or in written / printed documentation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    incomingReferral: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"incomingReferral\",\n        title=(\n            \"The ReferralRequest provided as information to allocate to the \"\n            \"Encounter\"\n        ),\n        description=(\n            \"The referral request this appointment is allocated to assess (incoming\"\n            \" referral).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ReferralRequest\"],\n        },\n    )\n\n    indication: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"indication\",\n        title=\"Reason the appointment is to takes place (resource)\",\n        description=(\n            \"Reason the appointment has been scheduled to take place, as specified \"\n            \"using information from another resource. When the patient arrives and \"\n            \"the encounter begins it may be used as the admission diagnosis. The \"\n            \"indication will typically be a Condition (with other resources \"\n            \"referenced in the evidence.detail), or a Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Procedure\"],\n        },\n    )\n\n    minutesDuration: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"minutesDuration\",\n        title=\"Can be less than start/end (e.g. estimate)\",\n        description=(\n            \"Number of minutes that the appointment is to take. This can be less \"\n            \"than the duration between the start and end times (where actual time \"\n            \"of appointment is only an estimate or is a planned appointment \"\n            \"request).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    minutesDuration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minutesDuration\",\n        title=\"Extension field for ``minutesDuration``.\",\n    )\n\n    participant: typing.List[fhirtypes.AppointmentParticipantType] = Field(\n        default=...,\n        alias=\"participant\",\n        title=\"Participants involved in appointment\",\n        description=\"List of participants involved in the appointment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Used to make informed decisions if needing to re-prioritize\",\n        description=(\n            \"The priority of the appointment. Can be used to make informed \"\n            \"decisions if needing to re-prioritize appointments. (The iCal Standard\"\n            \" specifies 0 as undefined, 1 as highest, 9 as lowest priority).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason this appointment is scheduled\",\n        description=(\n            \"The reason that this appointment is being scheduled. This is more \"\n            \"clinical than administrative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    requestedPeriod: typing.List[fhirtypes.PeriodType] | None = Field(\n        default=None,\n        alias=\"requestedPeriod\",\n        title=(\n            \"Potential date/time interval(s) requested to allocate the appointment \"\n            \"within\"\n        ),\n        description=(\n            \"A set of date ranges (potentially including times) that the \"\n            \"appointment is preferred to be scheduled within. When using these \"\n            \"values, the minutes duration should be provided to indicate the length\"\n            \" of the appointment to fill and populate the start/end times for the \"\n            \"actual allocated time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    serviceCategory: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"serviceCategory\",\n        title=(\n            \"A broad categorisation of the service that is to be performed during \"\n            \"this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceType\",\n        title=\"The specific service that is to be performed during this appointment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    slot: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"slot\",\n        title=\"The slots that this appointment is filling\",\n        description=(\n            \"The slots from the participants' schedules that will be filled by the \"\n            \"appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Slot\"],\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=(\n            \"The specialty of a practitioner that would be required to perform the \"\n            \"service requested in this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    start: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"When appointment is to take place\",\n        description=\"Date/Time that the appointment is to take place.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"proposed | pending | booked | arrived | fulfilled | cancelled | noshow\"\n            \" | entered-in-error\"\n        ),\n        description=(\n            \"The overall status of the Appointment. Each of the participants has \"\n            \"their own participation status which indicates their involvement in \"\n            \"the process, however this status indicates the shared status.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposed\",\n                \"pending\",\n                \"booked\",\n                \"arrived\",\n                \"fulfilled\",\n                \"cancelled\",\n                \"noshow\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Additional information to support the appointment\",\n        description=(\n            \"Additional information to support the appointment provided when making\"\n            \" the appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Appointment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"appointmentType\",\n            \"reason\",\n            \"indication\",\n            \"priority\",\n            \"description\",\n            \"supportingInformation\",\n            \"start\",\n            \"end\",\n            \"minutesDuration\",\n            \"slot\",\n            \"created\",\n            \"comment\",\n            \"incomingReferral\",\n            \"participant\",\n            \"requestedPeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Appointment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"appointmentType\",\n            \"reason\",\n            \"start\",\n            \"end\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass AppointmentParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Participants involved in appointment.\n    List of participants involved in the appointment.\n    \"\"\"\n\n    __resource_type__ = \"AppointmentParticipant\"\n\n    actor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Person, Location/HealthcareService or Device\",\n        description=(\n            \"A Person, Location/HealthcareService or Device that is participating \"\n            \"in the appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"HealthcareService\",\n                \"Location\",\n            ],\n        },\n    )\n\n    required: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"required\",\n        title=\"required | optional | information-only\",\n        description=(\n            \"Is this participant required to be present at the meeting. This covers\"\n            \" a use-case where 2 doctors need to meet to discuss the results for a \"\n            \"specific patient, and the patient is not required to be present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"required\", \"optional\", \"information-only\"],\n        },\n    )\n    required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_required\", title=\"Extension field for ``required``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"accepted | declined | tentative | needs-action\",\n        description=\"Participation status of the actor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"accepted\", \"declined\", \"tentative\", \"needs-action\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Role of participant in the appointment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AppointmentParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"actor\",\n            \"required\",\n            \"status\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AppointmentParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"actor\", \"required\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/appointmentresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AppointmentResponse\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass AppointmentResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reply to an appointment request for a patient and/or practitioner(s),\n    such as a confirmation or rejection.\n    \"\"\"\n\n    __resource_type__ = \"AppointmentResponse\"\n\n    actor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Person, Location/HealthcareService or Device\",\n        description=(\n            \"A Person, Location/HealthcareService or Device that is participating \"\n            \"in the appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"HealthcareService\",\n                \"Location\",\n            ],\n        },\n    )\n\n    appointment: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"appointment\",\n        title=\"Appointment this response relates to\",\n        description=\"Appointment that this response is replying to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Appointment\"],\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Additional comments\",\n        description=\"Additional comments about the appointment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    end: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"Time from appointment, or requested new end time\",\n        description=(\n            \"This may be either the same as the appointment request to confirm the \"\n            \"details of the appointment, or alternately a new time to request a re-\"\n            \"negotiation of the end time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this item\",\n        description=(\n            \"This records identifiers associated with this appointment response \"\n            \"concern that are defined by business processes and/ or used to refer \"\n            \"to it when a direct URL reference to the resource itself is not \"\n            \"appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    participantStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"participantStatus\",\n        title=(\n            \"accepted | declined | tentative | in-process | completed | needs-\"\n            \"action | entered-in-error\"\n        ),\n        description=(\n            \"Participation status of the participant. When the status is declined \"\n            \"or tentative if the start/end times are different to the appointment, \"\n            \"then these times should be interpreted as a requested time change. \"\n            \"When the status is accepted, the times can either be the time of the \"\n            \"appointment (as a confirmation of the time) or can be empty.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"accepted\",\n                \"declined\",\n                \"tentative\",\n                \"in-process\",\n                \"completed\",\n                \"needs-action\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    participantStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_participantStatus\",\n        title=\"Extension field for ``participantStatus``.\",\n    )\n\n    participantType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"participantType\",\n        title=\"Role of participant in the appointment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    start: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Time from appointment, or requested new start time\",\n        description=(\n            \"Date/Time that the appointment is to take place, or requested new \"\n            \"start time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AppointmentResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"appointment\",\n            \"start\",\n            \"end\",\n            \"participantType\",\n            \"actor\",\n            \"participantStatus\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AppointmentResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"appointment\",\n            \"participantType\",\n            \"actor\",\n            \"participantStatus\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"participantStatus\", \"participantStatus__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/attachment.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Attachment\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Attachment(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Content in a format defined elsewhere.\n    For referring to data content defined in other formats.\n    \"\"\"\n\n    __resource_type__ = \"Attachment\"\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"Mime type of the content, with charset etc.\",\n        description=(\n            \"Identifies the type of the data in the attachment and allows a method \"\n            \"to be chosen to interpret or render the data. Includes mime type \"\n            \"parameters such as charset where appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    creation: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"creation\",\n        title=\"Date attachment was first created\",\n        description=\"The date that the attachment was first created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    creation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_creation\", title=\"Extension field for ``creation``.\"\n    )\n\n    data: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"Data inline, base64ed\",\n        description=(\n            \"The actual data of the attachment - a sequence of bytes. In XML, \"\n            \"represented using base64.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_data\", title=\"Extension field for ``data``.\"\n    )\n\n    hash: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"hash\",\n        title=\"Hash of the data (sha-1, base64ed)\",\n        description=\"The calculated hash of the data using SHA-1. Represented using base64.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    hash__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_hash\", title=\"Extension field for ``hash``.\"\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language of the content (BCP-47)\",\n        description=(\n            \"The human language of the content. The value can be any valid value \"\n            \"according to BCP 47.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    size: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"size\",\n        title=\"Number of bytes of content (if url provided)\",\n        description=(\n            \"The number of bytes of data that make up this attachment (before \"\n            \"base64 encoding, if that is done).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    size__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_size\", title=\"Extension field for ``size``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label to display in place of the data\",\n        description=\"A label or set of text to display in place of the data.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Uri where the data can be found\",\n        description=\"An alternative location where the data can be accessed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Attachment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"contentType\",\n            \"language\",\n            \"data\",\n            \"url\",\n            \"size\",\n            \"hash\",\n            \"title\",\n            \"creation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Attachment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"contentType\", \"language\", \"url\", \"size\", \"hash\", \"title\", \"creation\"]\n"
  },
  {
    "path": "fhir/resources/STU3/auditevent.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AuditEvent\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass AuditEvent(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Event record kept for security purposes.\n    A record of an event made for purposes of maintaining a security log.\n    Typical uses include detection of intrusion attempts and monitoring for\n    inappropriate usage.\n    \"\"\"\n\n    __resource_type__ = \"AuditEvent\"\n\n    action: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Type of action performed during the event\",\n        description=(\n            \"Indicator for type of action performed during the event that generated\"\n            \" the audit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    action__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_action\", title=\"Extension field for ``action``.\"\n    )\n\n    agent: typing.List[fhirtypes.AuditEventAgentType] = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Actor involved in the event\",\n        description=(\n            \"An actor taking an active role in the event or activity that is \" \"logged.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entity: typing.List[fhirtypes.AuditEventEntityType] | None = Field(\n        default=None,\n        alias=\"entity\",\n        title=\"Data or objects used\",\n        description=\"Specific instances of data or objects that have been accessed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcome: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"Whether the event succeeded or failed\",\n        description=\"Indicates whether the event succeeded or failed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcome\", title=\"Extension field for ``outcome``.\"\n    )\n\n    outcomeDesc: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"outcomeDesc\",\n        title=\"Description of the event outcome\",\n        description=\"A free text description of the outcome of the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    outcomeDesc__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcomeDesc\", title=\"Extension field for ``outcomeDesc``.\"\n    )\n\n    purposeOfEvent: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"purposeOfEvent\",\n        title=\"The purposeOfUse of the event\",\n        description=(\n            \"The purposeOfUse (reason) that was used during the event being \"\n            \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    recorded: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"recorded\",\n        title=\"Time when the event occurred on source\",\n        description=\"The time when the event occurred on the source.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recorded\", title=\"Extension field for ``recorded``.\"\n    )\n\n    source: fhirtypes.AuditEventSourceType = Field(\n        default=...,\n        alias=\"source\",\n        title=\"Audit Event Reporter\",\n        description=\"The system that is reporting the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subtype: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"subtype\",\n        title=\"More specific type/id for the event\",\n        description=\"Identifier for the category of event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type/identifier of event\",\n        description=(\n            \"Identifier for a family of the event.  For example, a menu item, \"\n            \"program, rule, policy, function code, application name or URL. It \"\n            \"identifies the performed function.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"subtype\",\n            \"action\",\n            \"recorded\",\n            \"outcome\",\n            \"outcomeDesc\",\n            \"purposeOfEvent\",\n            \"agent\",\n            \"source\",\n            \"entity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"type\",\n            \"subtype\",\n            \"action\",\n            \"recorded\",\n            \"outcome\",\n            \"outcomeDesc\",\n            \"purposeOfEvent\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"recorded\", \"recorded__ext\")]\n        return required_fields\n\n\nclass AuditEventAgent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Actor involved in the event.\n    An actor taking an active role in the event or activity that is logged.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventAgent\"\n\n    altId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"altId\",\n        title=\"Alternative User id e.g. authentication\",\n        description=(\n            \"Alternative agent Identifier. For a human, this should be a user \"\n            \"identifier text string from authentication system. This identifier \"\n            \"would be one known to a common authentication system (e.g. single \"\n            \"sign-on), if available.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    altId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_altId\", title=\"Extension field for ``altId``.\"\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where\",\n        description=\"Where the event occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    media: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"media\",\n        title=\"Type of media\",\n        description=(\n            \"Type of media involved. Used when the event is about \"\n            \"exporting/importing onto media.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human-meaningful name for the agent\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    network: fhirtypes.AuditEventAgentNetworkType | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"Logical network location for application activity\",\n        description=(\n            \"Logical network location for application activity, if the activity has\"\n            \" a network location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    policy: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"policy\",\n        title=\"Policy that authorized event\",\n        description=(\n            \"The policy or plan that authorized the activity being recorded. \"\n            \"Typically, a single activity may have multiple applicable policies, \"\n            \"such as patient consent, guarantor funding, etc. The policy would also\"\n            \" indicate the security token used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    policy__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_policy\", title=\"Extension field for ``policy``.\"\n    )\n\n    purposeOfUse: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"purposeOfUse\",\n        title=\"Reason given for this user\",\n        description=(\n            \"The reason (purpose of use), specific to this agent, that was used \"\n            \"during the event being recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Direct reference to resource\",\n        description=\"Direct reference to a resource that identifies the agent.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    requestor: bool | None = Field(\n        default=None,\n        alias=\"requestor\",\n        title=\"Whether user is initiator\",\n        description=(\n            \"Indicator that the user is or is not the requestor, or initiator, for \"\n            \"the event being audited.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    requestor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requestor\", title=\"Extension field for ``requestor``.\"\n    )\n\n    role: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Agent role in the event\",\n        description=(\n            \"The security role that the user was acting under, that come from local\"\n            \" codes defined by the access control security system (e.g. RBAC, ABAC)\"\n            \" used in the local context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    userId: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"userId\",\n        title=\"Unique identifier for the user\",\n        description=\"Unique identifier for the user actively participating in the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"role\",\n            \"reference\",\n            \"userId\",\n            \"altId\",\n            \"name\",\n            \"requestor\",\n            \"location\",\n            \"policy\",\n            \"media\",\n            \"network\",\n            \"purposeOfUse\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"reference\", \"userId\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"requestor\", \"requestor__ext\")]\n        return required_fields\n\n\nclass AuditEventAgentNetwork(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Logical network location for application activity.\n    Logical network location for application activity, if the activity has a\n    network location.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventAgentNetwork\"\n\n    address: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Identifier for the network access point of the user device\",\n        description=(\n            \"An identifier for the network access point of the user device for the \"\n            \"audit event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_address\", title=\"Extension field for ``address``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of network access point\",\n        description=(\n            \"An identifier for the type of network access point that originated the\"\n            \" audit event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventAgentNetwork`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"address\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventAgentNetwork`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass AuditEventEntity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Data or objects used.\n    Specific instances of data or objects that have been accessed.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventEntity\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Descriptive text\",\n        description=\"Text that describes the entity in more detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    detail: typing.List[fhirtypes.AuditEventEntityDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Additional Information about the entity\",\n        description=(\n            \"Tagged value pairs for conveying additional information about the \"\n            \"entity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Specific instance of object\",\n        description=(\n            \"Identifies a specific instance of the entity. The reference should \"\n            \"always be version specific.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lifecycle: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"lifecycle\",\n        title=\"Life-cycle stage for the entity\",\n        description=\"Identifier for the data life-cycle stage for the entity.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Descriptor for entity\",\n        description=\"A name of the entity in the audit event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    query: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"query\",\n        title=\"Query parameters\",\n        description=\"The query parameters for a query-type entities.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    query__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_query\", title=\"Extension field for ``query``.\"\n    )\n\n    reference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Specific instance of resource\",\n        description=(\n            \"Identifies a specific instance of the entity. The reference should be \"\n            \"version specific.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    role: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"What role the entity played\",\n        description=(\n            \"Code representing the role the entity played in the event being \"\n            \"audited.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Security labels on the entity\",\n        description=\"Security labels for the identified entity.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of entity involved\",\n        description=\"The type of the object that was involved in this audit event.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"reference\",\n            \"type\",\n            \"role\",\n            \"lifecycle\",\n            \"securityLabel\",\n            \"name\",\n            \"description\",\n            \"query\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"reference\", \"name\", \"query\"]\n\n\nclass AuditEventEntityDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional Information about the entity.\n    Tagged value pairs for conveying additional information about the entity.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventEntityDetail\"\n\n    type: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Name of the property\",\n        description=\"The type of extra detail provided in the value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    value: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Property value\",\n        description=\"The details, base64 encoded. Used to carry bulk information.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventEntityDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventEntityDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass AuditEventSource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Audit Event Reporter.\n    The system that is reporting the event.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventSource\"\n\n    identifier: fhirtypes.IdentifierType = Field(\n        default=...,\n        alias=\"identifier\",\n        title=\"The identity of source detecting the event\",\n        description=\"Identifier of the source where the event was detected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    site: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Logical source location within the enterprise\",\n        description=(\n            \"Logical source location within the healthcare enterprise network.  For\"\n            \" example, a hospital or other provider location within a multi-entity \"\n            \"provider group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    site__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_site\", title=\"Extension field for ``site``.\"\n    )\n\n    type: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of source where event originated\",\n        description=\"Code specifying the type of source where event originated.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"site\", \"identifier\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\"]\n"
  },
  {
    "path": "fhir/resources/STU3/backboneelement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BackboneElement\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass BackboneElement(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base for elements defined inside a resource.\n    Base definition for all elements that are defined inside a resource - but\n    not those in a data type.\n    \"\"\"\n\n    __resource_type__ = \"BackboneElement\"\n\n    modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"modifierExtension\",\n        title=\"Extensions that cannot be ignored\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the element, and that modifies the \"\n            \"understanding of the element that contains it. Usually modifier \"\n            \"elements provide negation or qualification. In order to make the use \"\n            \"of extensions safe and manageable, there is a strict set of governance\"\n            \" applied to the definition and use of extensions. Though any \"\n            \"implementer is allowed to define an extension, there is a set of \"\n            \"requirements that SHALL be met as part of the definition of the \"\n            \"extension. Applications processing a resource are required to check \"\n            \"for modifier extensions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BackboneElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BackboneElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/basic.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Basic\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Basic(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource for non-supported content.\n    Basic is used for handling concepts not yet defined in FHIR, narrative-only\n    resources that don't map to an existing resource, and custom resources not\n    appropriate for inclusion in the FHIR specification.\n    \"\"\"\n\n    __resource_type__ = \"Basic\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who created\",\n        description=\"Indicates who was responsible for creating the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Kind of Resource\",\n        description=(\n            \"Identifies the 'type' of resource - equivalent to the resource name \"\n            \"for other resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    created: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"When created\",\n        description=\"Identifies when the resource was first created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Identifier assigned to the resource for business purposes, outside the\"\n            \" context of FHIR.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Identifies the focus of this resource\",\n        description=(\n            \"Identifies the patient, practitioner, device or any other resource \"\n            'that is the \"focus\" of this resource.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Basic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"subject\",\n            \"created\",\n            \"author\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Basic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"code\",\n            \"subject\",\n            \"created\",\n            \"author\",\n        ]\n"
  },
  {
    "path": "fhir/resources/STU3/binary.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Binary\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import fhirtypes, resource\n\n\nclass Binary(resource.Resource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Pure binary content defined by a format other than FHIR.\n    A binary resource can contain any content, whether text, image, pdf, zip\n    archive, etc.\n    \"\"\"\n\n    __resource_type__ = \"Binary\"\n\n    content: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"The actual content\",\n        description=\"The actual content, base64 encoded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    content__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_content\", title=\"Extension field for ``content``.\"\n    )\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"MimeType of the binary content\",\n        description=(\n            \"MimeType of the binary content represented as a standard MimeType (BCP\"\n            \" 13).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    securityContext: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"securityContext\",\n        title=\"Access Control Management\",\n        description=(\n            \"Treat this binary as if it was this other resource for access control \"\n            \"purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Binary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"contentType\",\n            \"securityContext\",\n            \"content\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Binary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"contentType\", \"securityContext\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"content\", \"content__ext\"),\n            (\"contentType\", \"contentType__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/bodysite.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BodySite\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass BodySite(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specific and identified anatomical location.\n    Record details about the anatomical location of a specimen or body part.\n    This resource may be used when a coded concept does not provide the\n    necessary detail needed for the use case.\n    \"\"\"\n\n    __resource_type__ = \"BodySite\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this body site record is in active use\",\n        description=\"Whether this body site is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Named anatomical location\",\n        description=\"Named anatomical location - ideally coded where possible.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Anatomical location description\",\n        description=\"A summary, charactarization or explanation of the anatomic location.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Bodysite identifier\",\n        description=\"Identifier for this instance of the anatomical location.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    image: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"image\",\n        title=\"Attached images\",\n        description=\"Image or images used to identify a location.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who this is about\",\n        description=\"The person to which the body site belongs.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    qualifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"qualifier\",\n        title=\"Modification to location code\",\n        description=(\n            \"Qualifier to refine the anatomical location.  These include qualifiers\"\n            \" for laterality, relative location, directionality, number, and plane.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BodySite`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"code\",\n            \"qualifier\",\n            \"description\",\n            \"image\",\n            \"patient\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BodySite`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"code\",\n            \"description\",\n            \"patient\",\n        ]\n"
  },
  {
    "path": "fhir/resources/STU3/bundle.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Bundle\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, fhirtypes, resource\n\n\nclass Bundle(resource.Resource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contains a collection of resources.\n    A container for a collection of resources.\n    \"\"\"\n\n    __resource_type__ = \"Bundle\"\n\n    entry: typing.List[fhirtypes.BundleEntryType] | None = Field(\n        default=None,\n        alias=\"entry\",\n        title=\"Entry in the bundle - will have a resource, or information\",\n        description=(\n            \"An entry in a bundle resource - will either contain a resource, or \"\n            \"information about a resource (transactions and history only).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Persistent identifier for the bundle\",\n        description=(\n            \"A persistent identifier for the batch that won't change as a batch is \"\n            \"copied from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.BundleLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links related to this Bundle\",\n        description=\"A series of links that provide context to this bundle.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    signature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"signature\",\n        title=\"Digital Signature\",\n        description=\"Digital Signature - base64 encoded. XML-DSIg or a JWT.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    total: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"If search, the total number of matches\",\n        description=(\n            \"If a set of search matches, this is the total number of matches for \"\n            \"the search (as opposed to the number of results in this bundle).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    total__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_total\", title=\"Extension field for ``total``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"document | message | transaction | transaction-response | batch | \"\n            \"batch-response | history | searchset | collection\"\n        ),\n        description=\"Indicates the purpose of this bundle - how it was intended to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"document\",\n                \"message\",\n                \"transaction\",\n                \"transaction-response\",\n                \"batch\",\n                \"batch-response\",\n                \"history\",\n                \"searchset\",\n                \"collection\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Bundle`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"identifier\",\n            \"type\",\n            \"total\",\n            \"link\",\n            \"entry\",\n            \"signature\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Bundle`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"type\",\n            \"total\",\n            \"link\",\n            \"entry\",\n            \"signature\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass BundleEntry(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Entry in the bundle - will have a resource, or information.\n    An entry in a bundle resource - will either contain a resource, or\n    information about a resource (transactions and history only).\n    \"\"\"\n\n    __resource_type__ = \"BundleEntry\"\n\n    fullUrl: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"fullUrl\",\n        title=\"Absolute URL for resource (server address, or UUID/OID)\",\n        description=(\n            \"The Absolute URL for the resource.  The fullUrl SHALL not disagree \"\n            \"with the id in the resource. The fullUrl is a version independent \"\n            \"reference to the resource. The fullUrl element SHALL have a value \"\n            \"except that:  * fullUrl can be empty on a POST (although it does not \"\n            \"need to when specifying a temporary id for reference in the bundle) * \"\n            \"Results from operations might involve resources that are not \"\n            \"identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fullUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fullUrl\", title=\"Extension field for ``fullUrl``.\"\n    )\n\n    link: typing.List[fhirtypes.BundleLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links related to this entry\",\n        description=\"A series of links that provide context to this entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    request: fhirtypes.BundleEntryRequestType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Transaction Related Information\",\n        description=(\n            \"Additional information about how this entry should be processed as \"\n            \"part of a transaction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.ResourceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"A resource in the bundle\",\n        description=\"The Resources for the entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    response: fhirtypes.BundleEntryResponseType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"Transaction Related Information\",\n        description=(\n            \"Additional information about how this entry should be processed as \"\n            \"part of a transaction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    search: fhirtypes.BundleEntrySearchType | None = Field(\n        default=None,\n        alias=\"search\",\n        title=\"Search related information\",\n        description=(\n            \"Information about the search process that lead to the creation of this\"\n            \" entry.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"link\",\n            \"fullUrl\",\n            \"resource\",\n            \"search\",\n            \"request\",\n            \"response\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"link\",\n            \"fullUrl\",\n            \"resource\",\n            \"search\",\n            \"request\",\n            \"response\",\n        ]\n\n\nclass BundleEntryRequest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Transaction Related Information.\n    Additional information about how this entry should be processed as part of\n    a transaction.\n    \"\"\"\n\n    __resource_type__ = \"BundleEntryRequest\"\n\n    ifMatch: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"ifMatch\",\n        title=\"For managing update contention\",\n        description=(\n            \"Only perform the operation if the Etag value matches. For more \"\n            'information, see the API section [\"Managing Resource '\n            'Contention\"](http.html#concurrency).'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ifMatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ifMatch\", title=\"Extension field for ``ifMatch``.\"\n    )\n\n    ifModifiedSince: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"ifModifiedSince\",\n        title=\"For managing update contention\",\n        description=(\n            \"Only perform the operation if the last updated date matches. See the \"\n            'API documentation for [\"Conditional Read\"](http.html#cread).'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ifModifiedSince__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_ifModifiedSince\",\n        title=\"Extension field for ``ifModifiedSince``.\",\n    )\n\n    ifNoneExist: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"ifNoneExist\",\n        title=\"For conditional creates\",\n        description=(\n            \"Instruct the server not to perform the create if a specified resource \"\n            \"already exists. For further information, see the API documentation for\"\n            ' [\"Conditional Create\"](http.html#ccreate). This is just the query '\n            'portion of the URL - what follows the \"?\" (not including the \"?\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ifNoneExist__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ifNoneExist\", title=\"Extension field for ``ifNoneExist``.\"\n    )\n\n    ifNoneMatch: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"ifNoneMatch\",\n        title=\"For managing cache currency\",\n        description=(\n            \"If the ETag values match, return a 304 Not Modified status. See the \"\n            'API documentation for [\"Conditional Read\"](http.html#cread).'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ifNoneMatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ifNoneMatch\", title=\"Extension field for ``ifNoneMatch``.\"\n    )\n\n    method: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"GET | POST | PUT | DELETE\",\n        description=(\n            \"The HTTP verb for this entry in either a change history, or a \"\n            \"transaction/ transaction response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\n        },\n    )\n    method__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_method\", title=\"Extension field for ``method``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"URL for HTTP equivalent of this entry\",\n        description=(\n            \"The URL for this entry, relative to the root (the address to which the\"\n            \" request is posted).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleEntryRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"method\",\n            \"url\",\n            \"ifNoneMatch\",\n            \"ifModifiedSince\",\n            \"ifMatch\",\n            \"ifNoneExist\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleEntryRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"method\",\n            \"url\",\n            \"ifNoneMatch\",\n            \"ifModifiedSince\",\n            \"ifMatch\",\n            \"ifNoneExist\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"method\", \"method__ext\"), (\"url\", \"url__ext\")]\n        return required_fields\n\n\nclass BundleEntryResponse(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Transaction Related Information.\n    Additional information about how this entry should be processed as part of\n    a transaction.\n    \"\"\"\n\n    __resource_type__ = \"BundleEntryResponse\"\n\n    etag: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"etag\",\n        title=\"The etag for the resource (if relevant)\",\n        description=(\n            \"The etag for the resource, it the operation for the entry produced a \"\n            \"versioned resource (see [Resource Metadata and \"\n            \"Versioning](http.html#versioning) and [Managing Resource \"\n            \"Contention](http.html#concurrency)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    etag__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_etag\", title=\"Extension field for ``etag``.\"\n    )\n\n    lastModified: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"lastModified\",\n        title=\"Server's date time modified\",\n        description=\"The date/time that the resource was modified on the server.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastModified\",\n        title=\"Extension field for ``lastModified``.\",\n    )\n\n    location: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"The location, if the operation returns a location\",\n        description=\"The location header created by processing this operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    location__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_location\", title=\"Extension field for ``location``.\"\n    )\n\n    outcome: fhirtypes.ResourceType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"OperationOutcome with hints and warnings (for batch/transaction)\",\n        description=(\n            \"An OperationOutcome containing hints and warnings produced as part of \"\n            \"processing this entry in a batch or transaction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"Status response code (text optional)\",\n        description=(\n            \"The status code returned by processing this entry. The status SHALL \"\n            \"start with a 3 digit HTTP code (e.g. 404) and may contain the standard\"\n            \" HTTP description associated with the status code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleEntryResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"status\",\n            \"location\",\n            \"etag\",\n            \"lastModified\",\n            \"outcome\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleEntryResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"status\",\n            \"location\",\n            \"etag\",\n            \"lastModified\",\n            \"outcome\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass BundleEntrySearch(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Search related information.\n    Information about the search process that lead to the creation of this\n    entry.\n    \"\"\"\n\n    __resource_type__ = \"BundleEntrySearch\"\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"match | include | outcome - why this is in the result set\",\n        description=(\n            \"Why this entry is in the result set - whether it's included as a match\"\n            \" or because of an _include requirement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"match\", \"include\", \"outcome\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    score: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"score\",\n        title=\"Search ranking (between 0 and 1)\",\n        description=\"When searching, the server's search ranking score for the entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    score__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_score\", title=\"Extension field for ``score``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleEntrySearch`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"mode\", \"score\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleEntrySearch`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\", \"score\"]\n\n\nclass BundleLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links related to this Bundle.\n    A series of links that provide context to this bundle.\n    \"\"\"\n\n    __resource_type__ = \"BundleLink\"\n\n    relation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"relation\",\n        title=(\n            \"See http://www.iana.org/assignments/link-relations/link-\"\n            \"relations.xhtml#link-relations-1\"\n        ),\n        description=(\n            \"A name which details the functional use for this link - see \"\n            \"[http://www.iana.org/assignments/link-relations/link-\"\n            \"relations.xhtml#link-\"\n            \"relations-1](http://www.iana.org/assignments/link-relations/link-\"\n            \"relations.xhtml#link-relations-1).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    relation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_relation\", title=\"Extension field for ``relation``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Reference details for the link\",\n        description=\"The reference details for the link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"relation\", \"url\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"relation\", \"url\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"relation\", \"relation__ext\"), (\"url\", \"url__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/capabilitystatement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CapabilityStatement(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A statement of system capabilities.\n    A Capability Statement documents a set of capabilities (behaviors) of a\n    FHIR Server that may be used as a statement of actual server functionality\n    or a statement of required or desired server implementation.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatement\"\n\n    acceptUnknown: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"acceptUnknown\",\n        title=\"no | extensions | elements | both\",\n        description=(\n            \"A code that indicates whether the application accepts unknown elements\"\n            \" or extensions when reading resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"no\", \"extensions\", \"elements\", \"both\"],\n        },\n    )\n    acceptUnknown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_acceptUnknown\",\n        title=\"Extension field for ``acceptUnknown``.\",\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the capability statement and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the capability statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the capability statement was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the capability \"\n            \"statement changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the capability statement\",\n        description=(\n            \"A free text natural language description of the capability statement \"\n            \"from a consumer's perspective. Typically, this is used when the \"\n            \"capability statement describes a desired rather than an actual \"\n            \"solution, for example as a formal expression of requirements as part \"\n            \"of an RFP.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    document: typing.List[fhirtypes.CapabilityStatementDocumentType] | None = Field(\n        default=None,\n        alias=\"document\",\n        title=\"Document definition\",\n        description=\"A document definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this capability statement is authored\"\n            \" for testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fhirVersion: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"fhirVersion\",\n        title=\"FHIR Version the system uses\",\n        description=(\n            \"The version of the FHIR specification on which this capability \"\n            \"statement is based.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fhirVersion\", title=\"Extension field for ``fhirVersion``.\"\n    )\n\n    format: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"format\",\n        title=\"formats supported (xml | json | ttl | mime type)\",\n        description=(\n            \"A list of the formats supported by this implementation using their \"\n            \"content types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"formats\", \"json\", \"ttl\", \"mime\"],\n        },\n    )\n    format__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_format\", title=\"Extension field for ``format``.\"\n    )\n\n    implementation: fhirtypes.CapabilityStatementImplementationType | None = Field(\n        default=None,\n        alias=\"implementation\",\n        title=\"If this describes a specific instance\",\n        description=(\n            \"Identifies a specific implementation instance that is described by the\"\n            \" capability statement - i.e. a particular installation, rather than \"\n            \"the capabilities of a software program.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    implementationGuide: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"implementationGuide\",\n        title=\"Implementation guides supported\",\n        description=(\n            \"A list of implementation guides that the server does (or should) \"\n            \"support in their entirety.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    implementationGuide__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_implementationGuide\",\n        title=\"Extension field for ``implementationGuide``.\",\n    )\n\n    instantiates: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiates\",\n        title=\"Canonical URL of another capability statement this implements\",\n        description=(\n            \"Reference to a canonical URL of another CapabilityStatement that this \"\n            \"software implements or uses. This capability statement is a published \"\n            \"API description that corresponds to a business service. The rest of \"\n            \"the capability statement does not need to repeat the details of the \"\n            \"referenced resource, but can do so.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiates__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiates\",\n        title=\"Extension field for ``instantiates``.\",\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for capability statement (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the capability statement is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"instance | capability | requirements\",\n        description=(\n            \"The way that this statement is intended to be used, to describe an \"\n            \"actual running instance of software, a particular product (kind not \"\n            \"instance of software) or a class of implementation (e.g. a desired \"\n            \"purchase).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"capability\", \"requirements\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    messaging: typing.List[fhirtypes.CapabilityStatementMessagingType] | None = Field(\n        default=None,\n        alias=\"messaging\",\n        title=\"If messaging is supported\",\n        description=\"A description of the messaging capabilities of the solution.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this capability statement (computer friendly)\",\n        description=(\n            \"A natural language name identifying the capability statement. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    patchFormat: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"patchFormat\",\n        title=\"Patch formats supported\",\n        description=(\n            \"A list of the patch formats supported by this implementation using \"\n            \"their content types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    patchFormat__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_patchFormat\", title=\"Extension field for ``patchFormat``.\"\n    )\n\n    profile: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profiles for use cases supported\",\n        description=(\n            \"A list of profiles that represent different use cases supported by the\"\n            ' system. For a server, \"supported by the system\" means the system '\n            \"hosts/produces a set of resources that are conformant to a particular \"\n            \"profile, and allows clients that use its services to search using this\"\n            \" profile and to find appropriate data. For a client, it means the \"\n            \"system will search by this profile and process data according to the \"\n            \"guidance implicit in the profile. See further discussion in [Using \"\n            \"Profiles](profiling.html#profile-uses).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the \"\n            \"capability statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this capability statement is defined\",\n        description=(\n            \"Explaination of why this capability statement is needed and why it has\"\n            \" been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    rest: typing.List[fhirtypes.CapabilityStatementRestType] | None = Field(\n        default=None,\n        alias=\"rest\",\n        title=\"If the endpoint is a RESTful one\",\n        description=\"A definition of the restful capabilities of the solution, if any.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    software: fhirtypes.CapabilityStatementSoftwareType | None = Field(\n        default=None,\n        alias=\"software\",\n        title=\"Software that is covered by this capability statement\",\n        description=(\n            \"Software that is covered by this capability statement.  It is used \"\n            \"when the capability statement describes the capabilities of a \"\n            \"particular software version, independent of an installation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this capability statement. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this capability statement (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the capability \" \"statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this capability statement (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this capability statement \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD \"\n            \"be an address at which this capability statement is (or will be) \"\n            \"published. The URL SHOULD include the major version of the capability \"\n            \"statement. For more information see [Technical and Business \"\n            \"Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate capability statement instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the capability statement\",\n        description=(\n            \"The identifier that is used to identify this version of the capability\"\n            \" statement when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the capability \"\n            \"statement author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"kind\",\n            \"instantiates\",\n            \"software\",\n            \"implementation\",\n            \"fhirVersion\",\n            \"acceptUnknown\",\n            \"format\",\n            \"patchFormat\",\n            \"implementationGuide\",\n            \"profile\",\n            \"rest\",\n            \"messaging\",\n            \"document\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"kind\",\n            \"instantiates\",\n            \"software\",\n            \"implementation\",\n            \"fhirVersion\",\n            \"acceptUnknown\",\n            \"format\",\n            \"patchFormat\",\n            \"implementationGuide\",\n            \"profile\",\n            \"rest\",\n            \"messaging\",\n            \"document\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"acceptUnknown\", \"acceptUnknown__ext\"),\n            (\"date\", \"date__ext\"),\n            (\"fhirVersion\", \"fhirVersion__ext\"),\n            (\"format\", \"format__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass CapabilityStatementDocument(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Document definition.\n    A document definition.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementDocument\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Description of document support\",\n        description=(\n            \"A description of how the application supports or uses the specified \"\n            \"document profile.  For example, when documents are created, what \"\n            \"action is taken with consumed documents, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"producer | consumer\",\n        description=(\n            \"Mode of this document declaration - whether an application is a \"\n            \"producer or consumer.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"producer\", \"consumer\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    profile: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"profile\",\n        title=\"Constraint on a resource used in the document\",\n        description=\"A constraint on a resource used in the document.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementDocument`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"mode\",\n            \"documentation\",\n            \"profile\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementDocument`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"profile\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementImplementation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If this describes a specific instance.\n    Identifies a specific implementation instance that is described by the\n    capability statement - i.e. a particular installation, rather than the\n    capabilities of a software program.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementImplementation\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Describes this specific instance\",\n        description=(\n            \"Information about the specific installation that this capability \"\n            \"statement relates to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Base URL for the installation\",\n        description=(\n            \"An absolute base URL for the implementation.  This forms the base for \"\n            \"REST interfaces as well as the mailbox and document interfaces.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementImplementation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"description\", \"url\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementImplementation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"description\", \"url\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"description\", \"description__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementMessaging(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If messaging is supported.\n    A description of the messaging capabilities of the solution.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementMessaging\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Messaging interface behavior details\",\n        description=(\n            \"Documentation about the system's messaging capabilities for this \"\n            \"endpoint not otherwise documented by the capability statement.  For \"\n            \"example, the process for becoming an authorized messaging exchange \"\n            \"partner.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    endpoint: typing.List[\n        fhirtypes.CapabilityStatementMessagingEndpointType\n    ] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Where messages should be sent\",\n        description=(\n            \"An endpoint (network accessible address) to which messages and/or \"\n            \"replies are to be sent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    event: typing.List[fhirtypes.CapabilityStatementMessagingEventType] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"Declare support for this event\",\n        description=(\n            \"A description of the solution's support for an event at this end-\" \"point.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reliableCache: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"reliableCache\",\n        title=\"Reliable Message Cache Length (min)\",\n        description=(\n            \"Length if the receiver's reliable messaging cache in minutes (if a \"\n            \"receiver) or how long the cache length on the receiver should be (if a\"\n            \" sender).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reliableCache__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_reliableCache\",\n        title=\"Extension field for ``reliableCache``.\",\n    )\n\n    supportedMessage: typing.List[\n        fhirtypes.CapabilityStatementMessagingSupportedMessageType\n    ] | None = Field(\n        default=None,\n        alias=\"supportedMessage\",\n        title=\"Messages supported by this system\",\n        description=(\n            \"References to message definitions for messages this system can send or\"\n            \" receive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementMessaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"endpoint\",\n            \"reliableCache\",\n            \"documentation\",\n            \"supportedMessage\",\n            \"event\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"supportedMessage\", \"event\"]\n\n\nclass CapabilityStatementMessagingEndpoint(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Where messages should be sent.\n    An endpoint (network accessible address) to which messages and/or replies\n    are to be sent.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementMessagingEndpoint\"\n\n    address: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Network address or identifier of the end-point\",\n        description=(\n            \"The network address of the end-point. For solutions that do not use \"\n            \"network addresses for routing, it can be just an identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_address\", title=\"Extension field for ``address``.\"\n    )\n\n    protocol: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"protocol\",\n        title=\"http | ftp | mllp +\",\n        description=(\n            \"A list of the messaging transport protocol(s) identifiers, supported \"\n            \"by this endpoint.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementMessagingEndpoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"protocol\", \"address\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingEndpoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"address\", \"address__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementMessagingEvent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Declare support for this event.\n    A description of the solution's support for an event at this end-point.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementMessagingEvent\"\n\n    category: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Consequence | Currency | Notification\",\n        description=\"The impact of the content of the message.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"Consequence\", \"Currency\", \"Notification\"],\n        },\n    )\n    category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_category\", title=\"Extension field for ``category``.\"\n    )\n\n    code: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Event type\",\n        description=\"A coded identifier of a supported messaging event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Endpoint-specific event documentation\",\n        description=(\n            \"Guidance on how this event is handled, such as internal system trigger\"\n            \" points, business rules, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    focus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"Resource that's focus of message\",\n        description=(\n            \"A resource associated with the event.  This is the resource that \"\n            \"defines the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    focus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_focus\", title=\"Extension field for ``focus``.\"\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"sender | receiver\",\n        description=(\n            \"The mode of this event declaration - whether an application is a \"\n            \"sender or receiver.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"sender\", \"receiver\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    request: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"request\",\n        title=\"Profile that describes the request\",\n        description=\"Information about the request for this event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n\n    response: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"response\",\n        title=\"Profile that describes the response\",\n        description=\"Information about the response for this event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementMessagingEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"category\",\n            \"mode\",\n            \"focus\",\n            \"request\",\n            \"response\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"request\", \"response\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"focus\", \"focus__ext\"), (\"mode\", \"mode__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementMessagingSupportedMessage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Messages supported by this system.\n    References to message definitions for messages this system can send or\n    receive.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementMessagingSupportedMessage\"\n\n    definition: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"definition\",\n        title=\"Message supported by this system\",\n        description=(\n            \"Points to a message definition that identifies the messaging event, \"\n            \"message structure, allowed responses, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"sender | receiver\",\n        description=(\n            \"The mode of this event declaration - whether application is sender or \"\n            \"receiver.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"sender\", \"receiver\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementMessagingSupportedMessage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"mode\", \"definition\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingSupportedMessage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\", \"definition\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If the endpoint is a RESTful one.\n    A definition of the restful capabilities of the solution, if any.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRest\"\n\n    compartment: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"compartment\",\n        title=\"Compartments served/used by system\",\n        description=(\n            \"An absolute URI which is a reference to the definition of a \"\n            \"compartment that the system supports. The reference is to a \"\n            \"CompartmentDefinition resource by its canonical URL .\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    compartment__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_compartment\", title=\"Extension field for ``compartment``.\"\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"General description of implementation\",\n        description=(\n            \"Information about the system's restful capabilities that apply across \"\n            \"all applications, such as security.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    interaction: typing.List[\n        fhirtypes.CapabilityStatementRestInteractionType\n    ] | None = Field(\n        default=None,\n        alias=\"interaction\",\n        title=\"What operations are supported?\",\n        description=\"A specification of restful operations supported by the system.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"client | server\",\n        description=(\n            \"Identifies whether this portion of the statement is describing the \"\n            \"ability to initiate or receive restful operations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"client\", \"server\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    operation: typing.List[\n        fhirtypes.CapabilityStatementRestOperationType\n    ] | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"Definition of an operation or a custom query\",\n        description=(\n            \"Definition of an operation or a named query together with its \"\n            \"parameters and their meaning and type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: typing.List[fhirtypes.CapabilityStatementRestResourceType] | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Resource served on the REST interface\",\n        description=(\n            \"A specification of the restful capabilities of the solution for a \"\n            \"specific resource type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    searchParam: typing.List[\n        fhirtypes.CapabilityStatementRestResourceSearchParamType\n    ] | None = Field(\n        default=None,\n        alias=\"searchParam\",\n        title=\"Search parameters for searching all resources\",\n        description=(\n            \"Search parameters that are supported for searching all resources for \"\n            \"implementations to support and/or make use of - either references to \"\n            \"ones defined in the specification, or additional ones defined for/by \"\n            \"the implementation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    security: fhirtypes.CapabilityStatementRestSecurityType | None = Field(\n        default=None,\n        alias=\"security\",\n        title=\"Information about security of implementation\",\n        description=(\n            \"Information about security implementation from an interface \"\n            \"perspective - what a client needs to know.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"mode\",\n            \"documentation\",\n            \"security\",\n            \"resource\",\n            \"interaction\",\n            \"searchParam\",\n            \"operation\",\n            \"compartment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\", \"security\", \"resource\", \"operation\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestInteraction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What operations are supported?.\n    A specification of restful operations supported by the system.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestInteraction\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"transaction | batch | search-system | history-system\",\n        description=\"A coded identifier of the operation, supported by the system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"transaction\", \"batch\", \"search-system\", \"history-system\"],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Anything special about operation behavior\",\n        description=(\n            \"Guidance specific to the implementation of this operation, such as \"\n            \"limitations on the kind of transactions allowed, or information about \"\n            \"system wide search is implemented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"documentation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of an operation or a custom query.\n    Definition of an operation or a named query together with its parameters\n    and their meaning and type.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestOperation\"\n\n    definition: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"definition\",\n        title=\"The defined operation/query\",\n        description=\"Where the formal definition can be found.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationDefinition\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name by which the operation/query is invoked\",\n        description=(\n            \"The name of the operation or query. For an operation, this is the name\"\n            \"  prefixed with $ and used in the URL. For a query, this is the name \"\n            \"used in the _query parameter when the query is called.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"definition\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"definition\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestResource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource served on the REST interface.\n    A specification of the restful capabilities of the solution for a specific\n    resource type.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestResource\"\n\n    conditionalCreate: bool | None = Field(\n        default=None,\n        alias=\"conditionalCreate\",\n        title=\"If allows/uses conditional create\",\n        description=\"A flag that indicates that the server supports conditional create.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    conditionalCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalCreate\",\n        title=\"Extension field for ``conditionalCreate``.\",\n    )\n\n    conditionalDelete: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"conditionalDelete\",\n        title=(\n            \"not-supported | single | multiple - how conditional delete is \" \"supported\"\n        ),\n        description=\"A code that indicates how the server supports conditional delete.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"not-supported\", \"single\", \"multiple\"],\n        },\n    )\n    conditionalDelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalDelete\",\n        title=\"Extension field for ``conditionalDelete``.\",\n    )\n\n    conditionalRead: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"conditionalRead\",\n        title=\"not-supported | modified-since | not-match | full-support\",\n        description=\"A code that indicates how the server supports conditional read.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"not-supported\",\n                \"modified-since\",\n                \"not-match\",\n                \"full-support\",\n            ],\n        },\n    )\n    conditionalRead__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalRead\",\n        title=\"Extension field for ``conditionalRead``.\",\n    )\n\n    conditionalUpdate: bool | None = Field(\n        default=None,\n        alias=\"conditionalUpdate\",\n        title=\"If allows/uses conditional update\",\n        description=\"A flag that indicates that the server supports conditional update.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    conditionalUpdate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalUpdate\",\n        title=\"Extension field for ``conditionalUpdate``.\",\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Additional information about the use of the resource type\",\n        description=\"Additional information about the resource type used by the system.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    interaction: typing.List[\n        fhirtypes.CapabilityStatementRestResourceInteractionType\n    ] = Field(\n        default=...,\n        alias=\"interaction\",\n        title=\"What operations are supported?\",\n        description=\"Identifies a restful operation supported by the solution.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    profile: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Base System profile for all uses of resource\",\n        description=(\n            \"A specification of the profile that describes the solution's overall \"\n            \"support for the resource, including any constraints on cardinality, \"\n            \"bindings, lengths or other limitations. See further discussion in \"\n            \"[Using Profiles](profiling.html#profile-uses).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n\n    readHistory: bool | None = Field(\n        default=None,\n        alias=\"readHistory\",\n        title=\"Whether vRead can return past versions\",\n        description=(\n            \"A flag for whether the server is able to return past versions as part \"\n            \"of the vRead operation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    readHistory__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_readHistory\", title=\"Extension field for ``readHistory``.\"\n    )\n\n    referencePolicy: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"referencePolicy\",\n        title=\"literal | logical | resolves | enforced | local\",\n        description=\"A set of flags that defines how references are supported.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"literal\", \"logical\", \"resolves\", \"enforced\", \"local\"],\n        },\n    )\n    referencePolicy__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_referencePolicy\",\n        title=\"Extension field for ``referencePolicy``.\",\n    )\n\n    searchInclude: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"searchInclude\",\n        title=\"_include values supported by the server\",\n        description=\"A list of _include values supported by the server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    searchInclude__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_searchInclude\",\n        title=\"Extension field for ``searchInclude``.\",\n    )\n\n    searchParam: typing.List[\n        fhirtypes.CapabilityStatementRestResourceSearchParamType\n    ] | None = Field(\n        default=None,\n        alias=\"searchParam\",\n        title=\"Search parameters supported by implementation\",\n        description=(\n            \"Search parameters for implementations to support and/or make use of - \"\n            \"either references to ones defined in the specification, or additional \"\n            \"ones defined for/by the implementation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    searchRevInclude: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"searchRevInclude\",\n        title=\"_revinclude values supported by the server\",\n        description=(\n            \"A list of _revinclude (reverse include) values supported by the \" \"server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    searchRevInclude__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_searchRevInclude\",\n        title=\"Extension field for ``searchRevInclude``.\",\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"A resource type that is supported\",\n        description=\"A type of resource exposed via the restful interface.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    updateCreate: bool | None = Field(\n        default=None,\n        alias=\"updateCreate\",\n        title=\"If update can commit to a new identity\",\n        description=(\n            \"A flag to indicate that the server allows or needs to allow the client\"\n            \" to create new identities on the server (e.g. that is, the client PUTs\"\n            \" to a location where there is no existing resource). Allowing this \"\n            \"operation means that the server allows the client to create new \"\n            \"identities on the server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    updateCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_updateCreate\",\n        title=\"Extension field for ``updateCreate``.\",\n    )\n\n    versioning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"versioning\",\n        title=\"no-version | versioned | versioned-update\",\n        description=(\n            \"This field is set to no-version to specify that the system does not \"\n            \"support (server) or use (client) versioning for this resource type. If\"\n            \" this has some other value, the server must at least correctly track \"\n            \"and populate the versionId meta-property on resources. If the value is\"\n            \" 'versioned-update', then the server supports all the versioning \"\n            \"features, including using e-tags for version integrity in the API.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"no-version\", \"versioned\", \"versioned-update\"],\n        },\n    )\n    versioning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_versioning\", title=\"Extension field for ``versioning``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"profile\",\n            \"documentation\",\n            \"interaction\",\n            \"versioning\",\n            \"readHistory\",\n            \"updateCreate\",\n            \"conditionalCreate\",\n            \"conditionalRead\",\n            \"conditionalUpdate\",\n            \"conditionalDelete\",\n            \"referencePolicy\",\n            \"searchInclude\",\n            \"searchRevInclude\",\n            \"searchParam\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"profile\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestResourceInteraction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What operations are supported?.\n    Identifies a restful operation supported by the solution.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestResourceInteraction\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"read | vread | update | patch | delete | history-instance | history-\"\n            \"type | create | search-type\"\n        ),\n        description=\"Coded identifier of the operation, supported by the system resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"read\",\n                \"vread\",\n                \"update\",\n                \"patch\",\n                \"delete\",\n                \"history-instance\",\n                \"history-type\",\n                \"create\",\n                \"search-type\",\n            ],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Anything special about operation behavior\",\n        description=(\n            \"Guidance specific to the implementation of this operation, such as \"\n            \"'delete is a logical delete' or 'updates are only allowed with version\"\n            \" id' or 'creates permitted from pre-authorized certificates only'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestResourceInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"documentation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestResourceSearchParam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Search parameters supported by implementation.\n    Search parameters for implementations to support and/or make use of -\n    either references to ones defined in the specification, or additional ones\n    defined for/by the implementation.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestResourceSearchParam\"\n\n    definition: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Source of definition for parameter\",\n        description=(\n            \"An absolute URI that is a formal reference to where this parameter was\"\n            \" first defined, so that a client can be confident of the meaning of \"\n            \"the search parameter (a reference to [SearchParameter.url]()).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Server-specific usage\",\n        description=(\n            \"This allows documentation of any distinct behaviors about how the \"\n            \"search parameter is used.  For example, text matching algorithms.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of search parameter\",\n        description=\"The name of the search parameter used in the interface.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"number | date | string | token | reference | composite | quantity | \" \"uri\"\n        ),\n        description=(\n            \"The type of value a search parameter refers to, and how the content is\"\n            \" interpreted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"number\",\n                \"date\",\n                \"string\",\n                \"token\",\n                \"reference\",\n                \"composite\",\n                \"quantity\",\n                \"uri\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestResourceSearchParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"definition\",\n            \"type\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceSearchParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestSecurity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about security of implementation.\n    Information about security implementation from an interface perspective -\n    what a client needs to know.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestSecurity\"\n\n    certificate: typing.List[\n        fhirtypes.CapabilityStatementRestSecurityCertificateType\n    ] | None = Field(\n        default=None,\n        alias=\"certificate\",\n        title=\"Certificates associated with security profiles\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    cors: bool | None = Field(\n        default=None,\n        alias=\"cors\",\n        title=\"Adds CORS Headers (http://enable-cors.org/)\",\n        description=(\n            \"Server adds CORS headers when responding to requests - this enables \"\n            \"javascript applications to use the server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    cors__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_cors\", title=\"Extension field for ``cors``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"General description of how security works\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    service: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates\",\n        description=\"Types of security services that are supported/required by the system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestSecurity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"cors\",\n            \"service\",\n            \"description\",\n            \"certificate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestSecurity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"cors\", \"service\"]\n\n\nclass CapabilityStatementRestSecurityCertificate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Certificates associated with security profiles.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestSecurityCertificate\"\n\n    blob: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"blob\",\n        title=\"Actual certificate\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    blob__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_blob\", title=\"Extension field for ``blob``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Mime type for certificates\",\n        description=\"Mime type for a certificate.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestSecurityCertificate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"blob\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestSecurityCertificate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CapabilityStatementSoftware(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Software that is covered by this capability statement.\n    Software that is covered by this capability statement.  It is used when the\n    capability statement describes the capabilities of a particular software\n    version, independent of an installation.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementSoftware\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name the software is known by\",\n        description=\"Name software is known by.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    releaseDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"releaseDate\",\n        title=\"Date this version released\",\n        description=\"Date this version of the software was released.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    releaseDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_releaseDate\", title=\"Extension field for ``releaseDate``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version covered by this statement\",\n        description=\"The version identifier for the software covered by this statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementSoftware`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"version\",\n            \"releaseDate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementSoftware`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"version\", \"releaseDate\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/careplan.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CarePlan\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CarePlan(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Healthcare plan for patient or group.\n    Describes the intention of how one or more practitioners intend to deliver\n    care for a particular patient, group or community for a period of time,\n    possibly limited to care for a specific condition or set of conditions.\n    \"\"\"\n\n    __resource_type__ = \"CarePlan\"\n\n    activity: typing.List[fhirtypes.CarePlanActivityType] | None = Field(\n        default=None,\n        alias=\"activity\",\n        title=\"Action to occur as part of plan\",\n        description=(\n            \"Identifies a planned action to occur as part of the plan.  For \"\n            \"example, a medication to be used, lab tests to perform, self-\"\n            \"monitoring, education, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    addresses: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"addresses\",\n        title=\"Health issues this plan addresses\",\n        description=(\n            \"Identifies the conditions/problems/concerns/diagnoses/etc. whose \"\n            \"management and/or mitigation are handled by this plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    author: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who is responsible for contents of the plan\",\n        description=(\n            \"Identifies the individual(s) or ogranization who is responsible for \"\n            \"the content of the care plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills care plan\",\n        description=\"A care plan that is fulfilled in whole or in part by this care plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\"],\n        },\n    )\n\n    careTeam: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"careTeam\",\n        title=\"Who's involved in plan?\",\n        description=(\n            \"Identifies all people and organizations who are expected to be \"\n            \"involved in the care envisioned by this plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CareTeam\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of plan\",\n        description=(\n            'Identifies what \"kind\" of plan this is to support differentiation '\n            'between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\",'\n            ' \"asthma\", \"disease management\", \"wellness plan\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Created in context of\",\n        description=(\n            \"Identifies the original context in which this particular CarePlan was \"\n            \"created.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    definition: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Protocol or definition\",\n        description=(\n            \"Identifies the protocol, questionnaire, guideline or other \"\n            \"specification the care plan should be conducted in accordance with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PlanDefinition\", \"Questionnaire\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Summary of nature of plan\",\n        description=\"A description of the scope and nature of the plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    goal: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"goal\",\n        title=\"Desired outcome of plan\",\n        description=\"Describes the intended objective(s) of carrying out the care plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Goal\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this plan\",\n        description=(\n            \"This records identifiers associated with this care plan that are \"\n            \"defined by business processes and/or used to refer to it when a direct\"\n            \" URL reference to the resource itself is not appropriate (e.g. in CDA \"\n            \"documents, or in written / printed documentation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=\"proposal | plan | order | option\",\n        description=(\n            \"Indicates the level of authority/intentionality associated with the \"\n            \"care plan and where the care plan fits into the workflow chain.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"proposal\", \"plan\", \"order\", \"option\"],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the plan\",\n        description=\"General notes about the care plan not covered elsewhere.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced CarePlan\",\n        description=(\n            \"A larger care plan of which this particular care plan is a component \"\n            \"or step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period plan covers\",\n        description=(\n            \"Indicates when the plan did (or is intended to) come into effect and \"\n            \"end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"CarePlan replaced by this CarePlan\",\n        description=(\n            \"Completed or terminated care plan whose function is taken by this new \"\n            \"care plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | suspended | completed | entered-in-error | cancelled \"\n            \"| unknown\"\n        ),\n        description=(\n            \"Indicates whether the plan is currently being acted upon, represents \"\n            \"future intentions or is now a historical record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"suspended\",\n                \"completed\",\n                \"entered-in-error\",\n                \"cancelled\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who care plan is for\",\n        description=(\n            \"Identifies the patient or group whose intended care is described by \"\n            \"the plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Information considered as part of plan\",\n        description=(\n            \"Identifies portions of the patient's record that specifically \"\n            \"influenced the formation of the plan.  These might include co-\"\n            \"morbidities, recent procedures, limitations, recent assessments, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Human-friendly name for the CarePlan\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CarePlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"replaces\",\n            \"partOf\",\n            \"status\",\n            \"intent\",\n            \"category\",\n            \"title\",\n            \"description\",\n            \"subject\",\n            \"context\",\n            \"period\",\n            \"author\",\n            \"careTeam\",\n            \"addresses\",\n            \"supportingInfo\",\n            \"goal\",\n            \"activity\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CarePlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"replaces\",\n            \"partOf\",\n            \"status\",\n            \"intent\",\n            \"category\",\n            \"title\",\n            \"description\",\n            \"subject\",\n            \"context\",\n            \"period\",\n            \"author\",\n            \"addresses\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass CarePlanActivity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Action to occur as part of plan.\n    Identifies a planned action to occur as part of the plan.  For example, a\n    medication to be used, lab tests to perform, self-monitoring, education,\n    etc.\n    \"\"\"\n\n    __resource_type__ = \"CarePlanActivity\"\n\n    detail: fhirtypes.CarePlanActivityDetailType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"In-line definition of activity\",\n        description=(\n            \"A simple summary of a planned activity suitable for a general care \"\n            \"plan system (e.g. form driven) that doesn't know about specific \"\n            \"resources such as procedure etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcomeCodeableConcept: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"outcomeCodeableConcept\",\n        title=\"Results of the activity\",\n        description=(\n            \"Identifies the outcome at the point when the status of the activity is\"\n            \" assessed.  For example, the outcome of an education activity could be\"\n            \" patient understands (or not).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcomeReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"outcomeReference\",\n        title=\"Appointment, Encounter, Procedure, etc.\",\n        description=(\n            \"Details of the outcome or action resulting from the activity.  The \"\n            'reference to an \"event\" resource, such as Procedure or Encounter or '\n            \"Observation, is the result/outcome of the activity itself.  The \"\n            \"activity can be conveyed using CarePlan.activity.detail OR using the \"\n            \"CarePlan.activity.reference (a reference to a \\u201crequest\\u201d resource).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    progress: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"progress\",\n        title=\"Comments about the activity status/progress\",\n        description=\"Notes about the adherence/status/progress of the activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Activity details defined in specific resource\",\n        description=(\n            \"The details of the proposed activity represented in a specific \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Appointment\",\n                \"CommunicationRequest\",\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"Task\",\n                \"ProcedureRequest\",\n                \"ReferralRequest\",\n                \"VisionPrescription\",\n                \"RequestGroup\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CarePlanActivity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"outcomeCodeableConcept\",\n            \"outcomeReference\",\n            \"progress\",\n            \"reference\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CarePlanActivity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CarePlanActivityDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    In-line definition of activity.\n    A simple summary of a planned activity suitable for a general care plan\n    system (e.g. form driven) that doesn't know about specific resources such\n    as procedure etc.\n    \"\"\"\n\n    __resource_type__ = \"CarePlanActivityDetail\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"diet | drug | encounter | observation | procedure | supply | other\",\n        description=\"High-level categorization of the type of activity in a care plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Detail type of activity\",\n        description=(\n            \"Detailed description of the type of planned activity; e.g. What lab \"\n            \"test, what procedure, what kind of encounter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dailyAmount: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"dailyAmount\",\n        title=\"How to consume/day?\",\n        description=\"Identifies the quantity expected to be consumed in a given day.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Protocol or definition\",\n        description=(\n            \"Identifies the protocol, questionnaire, guideline or other \"\n            \"specification the planned activity should be conducted in accordance \"\n            \"with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"ActivityDefinition\",\n                \"Questionnaire\",\n            ],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Extra info describing activity to perform\",\n        description=(\n            \"This provides a textual description of constraints on the intended \"\n            \"activity occurrence, including relation to other activities.  It may \"\n            \"also include objectives, pre-conditions and end-conditions.  Finally, \"\n            \"it may convey specifics about the activity such as body site, method, \"\n            \"route, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    goal: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"goal\",\n        title=\"Goals this activity relates to\",\n        description=(\n            \"Internal reference that identifies the goals that this activity is \"\n            \"intended to contribute towards meeting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Goal\"],\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where it should happen\",\n        description=(\n            \"Identifies the facility where the activity will occur; e.g. home, \"\n            \"hospital, specific clinic, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who will be responsible?\",\n        description=\"Identifies who's expected to be involved in the activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    productCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productCodeableConcept\",\n        title=\"What is to be administered/supplied\",\n        description=(\n            \"Identifies the food, drug or other product to be consumed or supplied \"\n            \"in the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e product[x]\n            \"one_of_many\": \"product\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    productReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"productReference\",\n        title=\"What is to be administered/supplied\",\n        description=(\n            \"Identifies the food, drug or other product to be consumed or supplied \"\n            \"in the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e product[x]\n            \"one_of_many\": \"product\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\", \"Substance\"],\n        },\n    )\n\n    prohibited: bool | None = Field(\n        default=None,\n        alias=\"prohibited\",\n        title=\"Do NOT do\",\n        description=(\n            \"If true, indicates that the described activity is one that must NOT be\"\n            \" engaged in when following the plan.  If false, indicates that the \"\n            \"described activity is one that should be engaged in when following the\"\n            \" plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    prohibited__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_prohibited\", title=\"Extension field for ``prohibited``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"How much to administer/supply/consume\",\n        description=(\n            \"Identifies the quantity expected to be supplied, administered or \"\n            \"consumed by the subject.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why activity should be done or why activity was prohibited\",\n        description=(\n            \"Provides the rationale that drove the inclusion of this particular \"\n            \"activity as part of the plan or the reason why the activity was \"\n            \"prohibited.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Condition triggering need for activity\",\n        description=(\n            \"Provides the health condition(s) that drove the inclusion of this \"\n            \"particular activity as part of the plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    scheduledPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"scheduledPeriod\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e scheduled[x]\n            \"one_of_many\": \"scheduled\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    scheduledString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"scheduledString\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e scheduled[x]\n            \"one_of_many\": \"scheduled\",\n            \"one_of_many_required\": False,\n        },\n    )\n    scheduledString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_scheduledString\",\n        title=\"Extension field for ``scheduledString``.\",\n    )\n\n    scheduledTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"scheduledTiming\",\n        title=\"When activity is to occur\",\n        description=(\n            \"The period, timing or frequency upon which the described activity is \"\n            \"to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e scheduled[x]\n            \"one_of_many\": \"scheduled\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"not-started | scheduled | in-progress | on-hold | completed | \"\n            \"cancelled | unknown\"\n        ),\n        description=\"Identifies what progress is being made for the specific activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"not-started\",\n                \"scheduled\",\n                \"in-progress\",\n                \"on-hold\",\n                \"completed\",\n                \"cancelled\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=(\n            \"Provides reason why the activity isn't yet started, is on hold, was \"\n            \"cancelled, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    statusReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_statusReason\",\n        title=\"Extension field for ``statusReason``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CarePlanActivityDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"definition\",\n            \"code\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"goal\",\n            \"status\",\n            \"statusReason\",\n            \"prohibited\",\n            \"scheduledTiming\",\n            \"scheduledPeriod\",\n            \"scheduledString\",\n            \"location\",\n            \"performer\",\n            \"productCodeableConcept\",\n            \"productReference\",\n            \"productReference\",\n            \"dailyAmount\",\n            \"quantity\",\n            \"description\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CarePlanActivityDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"product\": [\"productCodeableConcept\", \"productReference\"],\n            \"scheduled\": [\"scheduledPeriod\", \"scheduledString\", \"scheduledTiming\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/careteam.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CareTeam\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CareTeam(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Planned participants in the coordination and delivery of care for a patient\n    or group.\n    The Care Team includes all the people and organizations who plan to\n    participate in the coordination and delivery of care for a patient.\n    \"\"\"\n\n    __resource_type__ = \"CareTeam\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of team\",\n        description=(\n            \"Identifies what kind of team.  This is to support differentiation \"\n            \"between multiple co-existing teams, such as care plan team, episode of\"\n            \" care team, longitudinal care team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or episode associated with CareTeam\",\n        description=(\n            \"The encounter or episode of care that establishes the context for this\"\n            \" care team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this team\",\n        description=(\n            \"This records identifiers associated with this care team that are \"\n            \"defined by business processes and/or used to refer to it when a direct\"\n            \" URL reference to the resource itself is not appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingOrganization: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"Organization responsible for the care team\",\n        description=\"The organization responsible for the care team.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the team, such as crisis assessment team\",\n        description=(\n            \"A label for human use intended to distinguish like teams.  E.g. the \"\n            '\"red\" vs. \"green\" trauma teams.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the CareTeam\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    participant: typing.List[fhirtypes.CareTeamParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Members of the team\",\n        description=(\n            \"Identifies all people and organizations who are expected to be \"\n            \"involved in the care team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period team covers\",\n        description=(\n            \"Indicates when the team did (or is intended to) come into effect and \"\n            \"end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why the care team exists\",\n        description=\"Describes why the care team exists.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why the care team exists\",\n        description=\"Condition(s) that this care team addresses.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"proposed | active | suspended | inactive | entered-in-error\",\n        description=\"Indicates the current state of the care team.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposed\",\n                \"active\",\n                \"suspended\",\n                \"inactive\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who care team is for\",\n        description=(\n            \"Identifies the patient or group whose intended care is handled by the \"\n            \"team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"name\",\n            \"subject\",\n            \"context\",\n            \"period\",\n            \"participant\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"managingOrganization\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"name\",\n            \"subject\",\n            \"context\",\n            \"period\",\n            \"managingOrganization\",\n        ]\n\n\nclass CareTeamParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Members of the team.\n    Identifies all people and organizations who are expected to be involved in\n    the care team.\n    \"\"\"\n\n    __resource_type__ = \"CareTeamParticipant\"\n\n    member: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"member\",\n        title=\"Who is involved\",\n        description=(\n            \"The specific person or organization who is participating/expected to \"\n            \"participate in the care team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization of the practitioner\",\n        description=\"The organization of the practitioner.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period of participant\",\n        description=(\n            \"Indicates when the specific member or organization did (or is intended\"\n            \" to) come into effect and end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Type of involvement\",\n        description=(\n            \"Indicates specific responsibility of an individual within the care \"\n            'team, such as \"Primary care physician\", \"Trained social worker '\n            'counselor\", \"Caregiver\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CareTeamParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"role\",\n            \"member\",\n            \"onBehalfOf\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CareTeamParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"role\", \"member\", \"onBehalfOf\"]\n"
  },
  {
    "path": "fhir/resources/STU3/chargeitem.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ChargeItem\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ChargeItem(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Item containing charge code(s) associated with the provision of healthcare\n    provider products.\n    The resource ChargeItem describes the provision of healthcare provider\n    products for a certain patient, therefore referring not only to the\n    product, but containing in addition details of the provision, like date,\n    time, amounts and participating organizations and persons. Main Usage of\n    the ChargeItem is to enable the billing process and internal cost\n    allocation.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItem\"\n\n    account: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"account\",\n        title=\"Account to place this charge\",\n        description=\"Account into which this ChargeItems belongs.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    bodysite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodysite\",\n        title=\"Anatomical location, if relevant\",\n        description=\"The anatomical location where the related service has been applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"A code that identifies the charge, like a billing code\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter / Episode associated with event\",\n        description=(\n            \"The encounter or episode of care that establishes the context for this\"\n            \" event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    definition: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Defining information about the code of this charge item\",\n        description=(\n            \"References the source of pricing information, rules of application for\"\n            \" the code this ChargeItem uses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    enteredDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"enteredDate\",\n        title=\"Date the charge item was entered\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    enteredDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_enteredDate\", title=\"Extension field for ``enteredDate``.\"\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Individual who was entering\",\n        description=\"The device, practitioner, etc. who entered the charge item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    factorOverride: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factorOverride\",\n        title=\"Factor overriding the associated rules\",\n        description=(\n            \"Factor overriding the factor determined by the rules associated with \"\n            \"the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factorOverride__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_factorOverride\",\n        title=\"Extension field for ``factorOverride``.\",\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for item\",\n        description=\"Identifiers assigned to this event performer or other systems.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the ChargeItem\",\n        description=(\n            \"Comments made about the event by the performer, subject or other \"\n            \"participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When the charged service was applied\",\n        description=\"Date/time(s) or duration when the charged service was applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When the charged service was applied\",\n        description=\"Date/time(s) or duration when the charged service was applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When the charged service was applied\",\n        description=\"Date/time(s) or duration when the charged service was applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    overrideReason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"overrideReason\",\n        title=\"Reason for overriding the list price/factor\",\n        description=(\n            \"If the list price or the rule based factor associated with the code is\"\n            \" overridden, this attribute can capture a text to indicate the  reason\"\n            \" for this action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    overrideReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_overrideReason\",\n        title=\"Extension field for ``overrideReason``.\",\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced ChargeItem\",\n        description=(\n            \"ChargeItems can be grouped to larger ChargeItems covering the whole \"\n            \"set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ChargeItem\"],\n        },\n    )\n\n    participant: typing.List[fhirtypes.ChargeItemParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Who performed charged service\",\n        description=(\n            \"Indicates who or what performed or participated in the charged \" \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performingOrganization\",\n        title=\"Organization providing the charged sevice\",\n        description=\"The organization requesting the service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    priceOverride: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"priceOverride\",\n        title=\"Price overriding the associated rules\",\n        description=(\n            \"Total price of the charge overriding the list price associated with \"\n            \"the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Quantity of which the charge item has been serviced\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why was the charged  service rendered?\",\n        description=\"Describes why the event occurred in coded or textual form.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requestingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestingOrganization\",\n        title=\"Organization requesting the charged service\",\n        description=\"The organization performing the service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    service: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Which rendered service is being charged?\",\n        description=\"Indicated the rendered service that caused this charge.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DiagnosticReport\",\n                \"ImagingStudy\",\n                \"Immunization\",\n                \"MedicationAdministration\",\n                \"MedicationDispense\",\n                \"Observation\",\n                \"Procedure\",\n                \"SupplyDelivery\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | billable | not-billable | aborted | billed | entered-in-\"\n            \"error | unknown\"\n        ),\n        description=\"The current state of the ChargeItem.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"billable\",\n                \"not-billable\",\n                \"aborted\",\n                \"billed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Individual service was done for/to\",\n        description=(\n            \"The individual or set of individuals the action is being or was \"\n            \"performed on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Further information supporting the this charge\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definition\",\n            \"status\",\n            \"partOf\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"participant\",\n            \"performingOrganization\",\n            \"requestingOrganization\",\n            \"quantity\",\n            \"bodysite\",\n            \"factorOverride\",\n            \"priceOverride\",\n            \"overrideReason\",\n            \"enterer\",\n            \"enteredDate\",\n            \"reason\",\n            \"service\",\n            \"account\",\n            \"note\",\n            \"supportingInformation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"quantity\",\n            \"bodysite\",\n            \"enterer\",\n            \"enteredDate\",\n            \"account\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\", \"occurrenceTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass ChargeItemParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed charged service.\n    Indicates who or what performed or participated in the charged service.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItemParticipant\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual who was performing\",\n        description=(\n            \"The device, practitioner, etc. who performed or participated in the \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"What type of performance was done\",\n        description=(\n            \"Describes the type of performance or participation(e.g. primary \"\n            \"surgeon, anaesthesiologiest, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItemParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItemParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/claim.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Claim\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Claim(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Claim, Pre-determination or Pre-authorization.\n    A provider issued list of services and products provided, or to be\n    provided, to a patient which is provided to an insurer for payment\n    recovery.\n    \"\"\"\n\n    __resource_type__ = \"Claim\"\n\n    accident: fhirtypes.ClaimAccidentType | None = Field(\n        default=None,\n        alias=\"accident\",\n        title=\"Details about an accident\",\n        description=\"An accident which resulted in the need for healthcare services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    billablePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"billablePeriod\",\n        title=\"Period for charge submission\",\n        description=\"The billable period for which charges are being submitted.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    careTeam: typing.List[fhirtypes.ClaimCareTeamType] | None = Field(\n        default=None,\n        alias=\"careTeam\",\n        title=\"Members of the care team\",\n        description=(\n            \"The members of the team who provided the overall service as well as \"\n            \"their role and whether responsible and qualifications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=(\n            \"The date when the enclosed suite of services were performed or \"\n            \"completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    diagnosis: typing.List[fhirtypes.ClaimDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"List of Diagnosis\",\n        description=\"List of patient diagnosis for which care is sought.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    employmentImpacted: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"employmentImpacted\",\n        title=\"Period unable to work\",\n        description=(\n            \"The start and optional end dates of when the patient was precluded \"\n            \"from working due to the treatable condition(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Author\",\n        description=(\n            \"Person who created the invoice/claim/pre-determination or pre-\"\n            \"authorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    facility: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"facility\",\n        title=\"Servicing Facility\",\n        description=\"Facility where the services were provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    fundsReserve: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fundsReserve\",\n        title=\"Funds requested to be reserved\",\n        description=(\n            \"In the case of a Pre-Determination/Pre-Authorization the provider may \"\n            \"request that funds in the amount of the expected Benefit be reserved \"\n            \"('Patient' or 'Provider') to pay for the Benefits determined on the \"\n            \"subsequent claim(s). 'None' explicitly indicates no funds reserving is\"\n            \" requested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    hospitalization: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"hospitalization\",\n        title=\"Period in hospital\",\n        description=(\n            \"The start and optional end dates of when the patient was confined to a\"\n            \" treatment center.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Claim number\",\n        description=(\n            \"The business identifier for the instance: claim number, pre-\"\n            \"determination or pre-authorization number.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    information: typing.List[fhirtypes.ClaimInformationType] | None = Field(\n        default=None,\n        alias=\"information\",\n        title=(\n            \"Exceptions, special considerations, the condition, situation, prior or\"\n            \" concurrent issues\"\n        ),\n        description=(\n            \"Additional information codes regarding exceptions, special \"\n            \"considerations, the condition, situation, prior or concurrent issues. \"\n            \"Often there are mutiple jurisdiction specific valuesets which are \"\n            \"required.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: typing.List[fhirtypes.ClaimInsuranceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Insurance or medical plan\",\n        description=\"Financial instrument by which payment information for health care.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Target\",\n        description=\"The Insurer who is target of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    item: typing.List[fhirtypes.ClaimItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Goods and Services\",\n        description=\"First tier of goods and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Responsible organization\",\n        description=(\n            \"The organization which is responsible for the bill, claim pre-\"\n            \"determination, pre-authorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    originalPrescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"originalPrescription\",\n        title=\"Original prescription if superceded by fulfiller\",\n        description=(\n            \"Original prescription which has been superceded by this prescription \"\n            \"to support the dispensing of pharmacy services, medications or \"\n            \"products. For example, a physician may prescribe a medication which \"\n            \"the pharmacy determines is contraindicated, or for which the patient \"\n            \"has an intolerance, and therefor issues a new precription for an \"\n            \"alternate medication which has the same theraputic intent. The \"\n            \"prescription from the pharmacy becomes the 'prescription' and that \"\n            \"from the physician becomes the 'original prescription'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"The subject of the Products and Services\",\n        description=\"Patient Resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    payee: fhirtypes.ClaimPayeeType | None = Field(\n        default=None,\n        alias=\"payee\",\n        title=\"Party to be paid any benefits payable\",\n        description=\"The party to be reimbursed for the services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    prescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"prescription\",\n        title=\"Prescription authorizing services or products\",\n        description=\"Prescription to support the dispensing of Pharmacy or Vision products.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\", \"VisionPrescription\"],\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Desired processing priority\",\n        description=\"Immediate (STAT), best effort (NORMAL), deferred (DEFER).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    procedure: typing.List[fhirtypes.ClaimProcedureType] | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"Procedures performed\",\n        description=(\n            \"Ordered list of patient procedures performed to support the \"\n            \"adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Responsible provider\",\n        description=(\n            \"The provider which is responsible for the bill, claim pre-\"\n            \"determination, pre-authorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    referral: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referral\",\n        title=\"Treatment Referral\",\n        description=(\n            \"The referral resource which lists the date, practitioner, reason and \"\n            \"other supporting information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ReferralRequest\"],\n        },\n    )\n\n    related: typing.List[fhirtypes.ClaimRelatedType] | None = Field(\n        default=None,\n        alias=\"related\",\n        title=\"Related Claims which may be revelant to processing this claimn\",\n        description=(\n            \"Other claims which are related to this claim such as prior claim \"\n            \"versions or for related services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"Finer grained claim type information\",\n        description=(\n            \"A finer grained suite of claim subtype codes which may convey \"\n            \"Inpatient vs Outpatient and/or a specialty service. In the US the \"\n            \"BillType.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    total: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"Total claim cost\",\n        description=\"The total value of the claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type or discipline\",\n        description=(\n            \"The category of claim, eg, oral, pharmacy, vision, insitutional, \"\n            \"professional.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"complete | proposed | exploratory | other\",\n        description=(\n            \"Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory \"\n            \"(Pre-determination).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"complete\", \"proposed\", \"exploratory\", \"other\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Claim`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subType\",\n            \"use\",\n            \"patient\",\n            \"billablePeriod\",\n            \"created\",\n            \"enterer\",\n            \"insurer\",\n            \"provider\",\n            \"organization\",\n            \"priority\",\n            \"fundsReserve\",\n            \"related\",\n            \"prescription\",\n            \"originalPrescription\",\n            \"payee\",\n            \"referral\",\n            \"facility\",\n            \"careTeam\",\n            \"information\",\n            \"diagnosis\",\n            \"procedure\",\n            \"insurance\",\n            \"accident\",\n            \"employmentImpacted\",\n            \"hospitalization\",\n            \"item\",\n            \"total\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Claim`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n\n\nclass ClaimAccident(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details about an accident.\n    An accident which resulted in the need for healthcare services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimAccident\"\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the accident occurred see information codes see information codes\",\n        description=\"Date of an accident which these services are addressing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Accident Place\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Accident Place\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The nature of the accident\",\n        description=\"Type of accident: work, auto, etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimAccident`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"date\",\n            \"type\",\n            \"locationAddress\",\n            \"locationReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimAccident`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"date\", \"date__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"location\": [\"locationAddress\", \"locationReference\"]}\n        return one_of_many_fields\n\n\nclass ClaimCareTeam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Members of the care team.\n    The members of the team who provided the overall service as well as their\n    role and whether responsible and qualifications.\n    \"\"\"\n\n    __resource_type__ = \"ClaimCareTeam\"\n\n    provider: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"provider\",\n        title=\"Provider individual or organization\",\n        description=\"Member of the team who provided the overall service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Organization\"],\n        },\n    )\n\n    qualification: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"qualification\",\n        title=\"Type, classification or Specialization\",\n        description=\"The qualification which is applicable for this service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    responsible: bool | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Billing provider\",\n        description=(\n            \"The party who is billing and responsible for the claimed good or \"\n            \"service rendered to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_responsible\", title=\"Extension field for ``responsible``.\"\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Role on the team\",\n        description=(\n            \"The lead, assisting or supervising practitioner and their discipline \"\n            \"if a multidisiplinary team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Number to covey order of careTeam\",\n        description=\"Sequence of the careTeam which serves to order and provide a link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimCareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"provider\",\n            \"responsible\",\n            \"role\",\n            \"qualification\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimCareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of Diagnosis.\n    List of patient diagnosis for which care is sought.\n    \"\"\"\n\n    __resource_type__ = \"ClaimDiagnosis\"\n\n    diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"diagnosisCodeableConcept\",\n        title=\"Patient's diagnosis\",\n        description=\"The diagnosis.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    diagnosisReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"diagnosisReference\",\n        title=\"Patient's diagnosis\",\n        description=\"The diagnosis.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    packageCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"packageCode\",\n        title=\"Package billing code\",\n        description=(\n            \"The package billing code, for example DRG, based on the assigned \"\n            \"grouping code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Number to covey order of diagnosis\",\n        description=\"Sequence of diagnosis which serves to provide a link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Timing or nature of the diagnosis\",\n        description=(\n            \"The type of the Diagnosis, for example: admitting, primary, secondary,\"\n            \" discharge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"diagnosisCodeableConcept\",\n            \"diagnosisReference\",\n            \"type\",\n            \"packageCode\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"diagnosis\": [\"diagnosisCodeableConcept\", \"diagnosisReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ClaimInformation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Exceptions, special considerations, the condition, situation, prior or\n    concurrent issues.\n    Additional information codes regarding exceptions, special considerations,\n    the condition, situation, prior or concurrent issues. Often there are\n    mutiple jurisdiction specific valuesets which are required.\n    \"\"\"\n\n    __resource_type__ = \"ClaimInformation\"\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"General class of information\",\n        description=(\n            \"The general class of the information supplied: information; exception;\"\n            \" accident, employment; onset, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of information\",\n        description=(\n            \"System and code pertaining to the specific information regarding \"\n            \"special conditions relating to the setting, treatment or patient  for \"\n            \"which care is sought which may influence the adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason associated with the information\",\n        description=(\n            \"For example, provides the reason for: the additional stay, or missing \"\n            \"tooth or any other situation where a reason code is required in \"\n            \"addition to the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Information instance identifier\",\n        description=\"Sequence of the information element which serves to provide a link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    timingDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"timingDate\",\n        title=\"When it occurred\",\n        description=\"The date when or period to which this information refers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timingDate\", title=\"Extension field for ``timingDate``.\"\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When it occurred\",\n        description=\"The date when or period to which this information refers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Additional Data or supporting information\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Additional Data or supporting information\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Additional Data or supporting information\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Additional Data or supporting information\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimInformation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"category\",\n            \"code\",\n            \"timingDate\",\n            \"timingPeriod\",\n            \"valueString\",\n            \"valueQuantity\",\n            \"valueAttachment\",\n            \"valueReference\",\n            \"reason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimInformation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\"timingDate\", \"timingPeriod\"],\n            \"value\": [\n                \"valueAttachment\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ClaimInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurance or medical plan.\n    Financial instrument by which payment information for health care.\n    \"\"\"\n\n    __resource_type__ = \"ClaimInsurance\"\n\n    businessArrangement: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"businessArrangement\",\n        title=\"Business agreement\",\n        description=(\n            \"The contract number of a business agreement which describes the terms \"\n            \"and conditions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_businessArrangement\",\n        title=\"Extension field for ``businessArrangement``.\",\n    )\n\n    claimResponse: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claimResponse\",\n        title=\"Adjudication results\",\n        description=\"The Coverages adjudication details.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClaimResponse\"],\n        },\n    )\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=\"Reference to the program or plan identification, underwriter or payor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    focal: bool | None = Field(\n        default=None,\n        alias=\"focal\",\n        title=\"Is the focal Coverage\",\n        description=(\n            \"A flag to indicate that this Coverage is the focus for adjudication. \"\n            \"The Coverage against which the claim is to be adjudicated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_focal\", title=\"Extension field for ``focal``.\"\n    )\n\n    preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Pre-Authorization/Determination Reference\",\n        description=\"A list of references from the Insurer to which these services pertain.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Service instance identifier\",\n        description=(\n            \"Sequence of coverage which serves to provide a link and convey \"\n            \"coordination of benefit order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"focal\",\n            \"coverage\",\n            \"businessArrangement\",\n            \"preAuthRef\",\n            \"claimResponse\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"focal\", \"focal__ext\"), (\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Goods and Services.\n    First tier of goods and services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimItem\"\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Service Location\",\n        description=\"Physical service site on the patient (limb, tooth, etc).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    careTeamLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"careTeamLinkId\",\n        title=\"Applicable careTeam members\",\n        description=\"CareTeam applicable for this service or product line.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    careTeamLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_careTeamLinkId\",\n        title=\"Extension field for ``careTeamLinkId``.\",\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of service or product\",\n        description=(\n            \"Health Care Service Type Codes  to identify the classification of \"\n            \"service or benefits.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ClaimItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Additional items\",\n        description=\"Second tier of goods and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    diagnosisLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"diagnosisLinkId\",\n        title=\"Applicable diagnoses\",\n        description=\"Diagnosis applicable for this service or product line.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    diagnosisLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_diagnosisLinkId\",\n        title=\"Extension field for ``diagnosisLinkId``.\",\n    )\n\n    encounter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounters related to this billed item\",\n        description=(\n            \"A billed item may include goods or services provided in multiple \"\n            \"encounters.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    informationLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"informationLinkId\",\n        title=\"Applicable exception and supporting information\",\n        description=(\n            \"Exceptions, special conditions and supporting information pplicable \"\n            \"for this service or product line.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    informationLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_informationLinkId\",\n        title=\"Extension field for ``informationLinkId``.\",\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Place of service\",\n        description=\"Where the service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"locationCodeableConcept\",\n        title=\"Place of service\",\n        description=\"Where the service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Place of service\",\n        description=\"Where the service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes, eg for Oral whether the \"\n            \"treatment is cosmetic or associated with TMJ, or for medical whether \"\n            \"the treatment was outside the clinic or out of office hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an addittional service or \"\n            \"product or charge. For example, the formula: unit Quantity * unit \"\n            \"Price (Cost per Point) * factor Number  * points = net Amount. \"\n            \"Quantity, factor and points are assumed to be 1 if not supplied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    procedureLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"procedureLinkId\",\n        title=\"Applicable procedures\",\n        description=\"Procedures applicable for this service or product line.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    procedureLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_procedureLinkId\",\n        title=\"Extension field for ``procedureLinkId``.\",\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program specific reason for item inclusion\",\n        description=(\n            \"For programs which require reason codes for the inclusion or covering \"\n            \"of this billed item under the program or sub-program.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of Products or Services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of reveneu or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Service instance\",\n        description=\"A service line number.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    service: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Billing Code\",\n        description=(\n            \"If this is an actual service or product line, ie. not a Group, then \"\n            \"use code to indicate the Professional Service or Product supplied (eg.\"\n            \" CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,RXNorm,ACHI,CCI). If a grouping \"\n            \"item then use a group code to indicate the type of thing being grouped\"\n            \" eg. 'glasses' or 'compound'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Date or dates of Service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Date or dates of Service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subSite\",\n        title=\"Service Sub-location\",\n        description=\"A region or surface of the site, eg. limb region or tooth surface(s).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique Device Identifier\",\n        description=\"List of Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per point\",\n        description=(\n            \"If the item is a node then this is the fee for the product or service,\"\n            \" otherwise this is the total of the fees for the children of the \"\n            \"group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"careTeamLinkId\",\n            \"diagnosisLinkId\",\n            \"procedureLinkId\",\n            \"informationLinkId\",\n            \"revenue\",\n            \"category\",\n            \"service\",\n            \"modifier\",\n            \"programCode\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"locationCodeableConcept\",\n            \"locationAddress\",\n            \"locationReference\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"udi\",\n            \"bodySite\",\n            \"subSite\",\n            \"encounter\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"location\": [\n                \"locationAddress\",\n                \"locationCodeableConcept\",\n                \"locationReference\",\n            ],\n            \"serviced\": [\"servicedDate\", \"servicedPeriod\"],\n        }\n        return one_of_many_fields\n\n\nclass ClaimItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional items.\n    Second tier of goods and services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimItemDetail\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of service or product\",\n        description=(\n            \"Health Care Service Type Codes  to identify the classification of \"\n            \"service or benefits.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes, eg for Oral whether the \"\n            \"treatment is cosmetic or associated with TMJ, or for medical whether \"\n            \"the treatment was outside the clinic or out of office hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total additional item cost\",\n        description=(\n            \"The quantity times the unit price for an addittional service or \"\n            \"product or charge. For example, the formula: unit Quantity * unit \"\n            \"Price (Cost per Point) * factor Number  * points = net Amount. \"\n            \"Quantity, factor and points are assumed to be 1 if not supplied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program specific reason for item inclusion\",\n        description=(\n            \"For programs which require reson codes for the inclusion, covering, of\"\n            \" this billed item under the program or sub-program.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of Products or Services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of reveneu or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Service instance\",\n        description=\"A service line number.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    service: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Billing Code\",\n        description=(\n            \"If this is an actual service or product line, ie. not a Group, then \"\n            \"use code to indicate the Professional Service or Product supplied (eg.\"\n            \" CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then \"\n            \"use a group code to indicate the type of thing being grouped eg. \"\n            \"'glasses' or 'compound'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subDetail: typing.List[fhirtypes.ClaimItemDetailSubDetailType] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Additional items\",\n        description=\"Third tier of goods and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique Device Identifier\",\n        description=\"List of Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per point\",\n        description=(\n            \"If the item is a node then this is the fee for the product or service,\"\n            \" otherwise this is the total of the fees for the children of the \"\n            \"group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"revenue\",\n            \"category\",\n            \"service\",\n            \"modifier\",\n            \"programCode\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"udi\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional items.\n    Third tier of goods and services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimItemDetailSubDetail\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of service or product\",\n        description=(\n            \"Health Care Service Type Codes  to identify the classification of \"\n            \"service or benefits.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes, eg for Oral whether the \"\n            \"treatment is cosmetic or associated with TMJ, or for medical whether \"\n            \"the treatment was outside the clinic or out of office hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Net additional item cost\",\n        description=(\n            \"The quantity times the unit price for an addittional service or \"\n            \"product or charge. For example, the formula: unit Quantity * unit \"\n            \"Price (Cost per Point) * factor Number  * points = net Amount. \"\n            \"Quantity, factor and points are assumed to be 1 if not supplied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program specific reason for item inclusion\",\n        description=(\n            \"For programs which require reson codes for the inclusion, covering, of\"\n            \" this billed item under the program or sub-program.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of Products or Services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of reveneu or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Service instance\",\n        description=\"A service line number.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    service: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Billing Code\",\n        description=(\n            \"A code to indicate the Professional Service or Product supplied (eg. \"\n            \"CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique Device Identifier\",\n        description=\"List of Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per point\",\n        description=\"The fee for an addittional service or product or charge.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"revenue\",\n            \"category\",\n            \"service\",\n            \"modifier\",\n            \"programCode\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"udi\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimPayee(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Party to be paid any benefits payable.\n    The party to be reimbursed for the services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimPayee\"\n\n    party: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"party\",\n        title=\"Party to receive the payable\",\n        description=\"Party to be reimbursed: Subscriber, provider, other.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    resourceType: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"resourceType\",\n        title=\"organization | patient | practitioner | relatedperson\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of party: Subscriber, Provider, other\",\n        description=\"Type of Party to be reimbursed: Subscriber, provider, other.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimPayee`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"resourceType\", \"party\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimPayee`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimProcedure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Procedures performed.\n    Ordered list of patient procedures performed to support the adjudication.\n    \"\"\"\n\n    __resource_type__ = \"ClaimProcedure\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the procedure was performed\",\n        description=\"Date and optionally time the procedure was performed .\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    procedureCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"procedureCodeableConcept\",\n        title=\"Patient's list of procedures performed\",\n        description=\"The procedure code.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e procedure[x]\n            \"one_of_many\": \"procedure\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    procedureReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"procedureReference\",\n        title=\"Patient's list of procedures performed\",\n        description=\"The procedure code.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e procedure[x]\n            \"one_of_many\": \"procedure\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Procedure sequence for reference\",\n        description=\"Sequence of procedures which serves to order and provide a link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"date\",\n            \"procedureCodeableConcept\",\n            \"procedureReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"procedure\": [\"procedureCodeableConcept\", \"procedureReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ClaimRelated(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Related Claims which may be revelant to processing this claimn.\n    Other claims which are related to this claim such as prior claim versions\n    or for related services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimRelated\"\n\n    claim: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claim\",\n        title=\"Reference to the related claim\",\n        description=(\n            \"Other claims which are related to this claim such as prior claim \"\n            \"versions or for related services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Claim\"],\n        },\n    )\n\n    reference: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Related file or case reference\",\n        description=(\n            \"An alternate organizational reference to the case or file to which \"\n            \"this particular claim pertains - eg Property/Casualy insurer claim # \"\n            \"or Workers Compensation case # .\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"How the reference claim is related\",\n        description=\"For example prior or umbrella.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"claim\",\n            \"relationship\",\n            \"reference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/claimresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClaimResponse\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ClaimResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Remittance resource.\n    This resource provides the adjudication details from the processing of a\n    Claim resource.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponse\"\n\n    addItem: typing.List[fhirtypes.ClaimResponseAddItemType] | None = Field(\n        default=None,\n        alias=\"addItem\",\n        title=\"Insurer added line items\",\n        description=\"The first tier service adjudications for payor added services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    communicationRequest: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"communicationRequest\",\n        title=\"Request for additional information\",\n        description=(\n            \"Request for additional supporting or authorizing information, such as:\"\n            \" documents, images or resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CommunicationRequest\"],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=(\n            \"The date when the enclosed suite of services were performed or \"\n            \"completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    error: typing.List[fhirtypes.ClaimResponseErrorType] | None = Field(\n        default=None,\n        alias=\"error\",\n        title=\"Processing errors\",\n        description=\"Mutually exclusive with Services Provided (Item).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"Printed Form Identifier\",\n        description=\"The form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Response  number\",\n        description=\"The Response business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: typing.List[fhirtypes.ClaimResponseInsuranceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Insurance or medical plan\",\n        description=\"Financial instrument by which payment information for health care.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Insurance issuing organization\",\n        description=\"The Insurer who produced this adjudicated response.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    item: typing.List[fhirtypes.ClaimResponseItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Line items\",\n        description=\"The first tier service adjudications for submitted services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"complete | error | partial\",\n        description=\"Processing outcome errror, partial or complete processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"The subject of the Products and Services\",\n        description=\"Patient Resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    payeeType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"payeeType\",\n        title=\"Party to be paid any benefits payable\",\n        description=\"Party to be reimbursed: Subscriber, provider, other.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payment: fhirtypes.ClaimResponsePaymentType | None = Field(\n        default=None,\n        alias=\"payment\",\n        title=\"Payment details, if paid\",\n        description=\"Payment details for the claim if the claim has been paid.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    processNote: typing.List[fhirtypes.ClaimResponseProcessNoteType] | None = Field(\n        default=None,\n        alias=\"processNote\",\n        title=\"Processing notes\",\n        description=\"Note text.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Id of resource triggering adjudication\",\n        description=\"Original request resource referrence.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Claim\"],\n        },\n    )\n\n    requestOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestOrganization\",\n        title=\"Responsible organization\",\n        description=(\n            \"The organization which is responsible for the services rendered to the\"\n            \" patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    requestProvider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestProvider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    reserved: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"reserved\",\n        title=\"Funds reserved status\",\n        description=\"Status of funds reservation (For provider, for Patient, None).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    totalBenefit: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"totalBenefit\",\n        title=\"Total benefit payable for the Claim\",\n        description=(\n            \"Total amount of benefit payable (Equal to sum of the Benefit amounts \"\n            \"from all detail lines and additions less the Unallocated Deductible).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    totalCost: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"totalCost\",\n        title=\"Total Cost of service from the Claim\",\n        description=\"The total cost of the services reported.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unallocDeductable: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unallocDeductable\",\n        title=\"Unallocated deductible\",\n        description=(\n            \"The amount of deductible applied which was not allocated to any \"\n            \"particular service line.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"patient\",\n            \"created\",\n            \"insurer\",\n            \"requestProvider\",\n            \"requestOrganization\",\n            \"request\",\n            \"outcome\",\n            \"disposition\",\n            \"payeeType\",\n            \"item\",\n            \"addItem\",\n            \"error\",\n            \"totalCost\",\n            \"unallocDeductable\",\n            \"totalBenefit\",\n            \"payment\",\n            \"reserved\",\n            \"form\",\n            \"processNote\",\n            \"communicationRequest\",\n            \"insurance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n\n\nclass ClaimResponseAddItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line items.\n    The first tier service adjudications for payor added services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseAddItem\"\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items adjudication\",\n        description=\"The adjudications results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of service or product\",\n        description=(\n            \"Health Care Service Type Codes  to identify the classification of \"\n            \"service or benefits.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ClaimResponseAddItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Added items details\",\n        description=\"The second tier service adjudications for payor added services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    fee: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"fee\",\n        title=\"Professional fee or Product charge\",\n        description=\"The fee charged for the professional service or product..\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes, eg for Oral whether the \"\n            \"treatment is cosmetic or associated with TMJ, or for medical whether \"\n            \"the treatment was outside the clinic or out of office hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"List of note numbers which apply\",\n        description=\"A list of note references to the notes provided below.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of reveneu or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequenceLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"sequenceLinkId\",\n        title=\"Service instances\",\n        description=(\n            \"List of input service items which this service line is intended to \"\n            \"replace.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sequenceLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_sequenceLinkId\",\n        title=\"Extension field for ``sequenceLinkId``.\",\n    )\n\n    service: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Group, Service or Product\",\n        description=\"A code to indicate the Professional Service or Product supplied.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseAddItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequenceLinkId\",\n            \"revenue\",\n            \"category\",\n            \"service\",\n            \"modifier\",\n            \"fee\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseAddItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Added items details.\n    The second tier service adjudications for payor added services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseAddItemDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items detail adjudication\",\n        description=\"The adjudications results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of service or product\",\n        description=(\n            \"Health Care Service Type Codes  to identify the classification of \"\n            \"service or benefits.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    fee: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"fee\",\n        title=\"Professional fee or Product charge\",\n        description=\"The fee charged for the professional service or product..\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes, eg for Oral whether the \"\n            \"treatment is cosmetic or associated with TMJ, or for medical whether \"\n            \"the treatment was outside the clinic or out of office hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"List of note numbers which apply\",\n        description=\"A list of note references to the notes provided below.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of reveneu or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    service: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Service or Product\",\n        description=\"A code to indicate the Professional Service or Product supplied.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseAddItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"revenue\",\n            \"category\",\n            \"service\",\n            \"modifier\",\n            \"fee\",\n            \"noteNumber\",\n            \"adjudication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseError(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing errors.\n    Mutually exclusive with Services Provided (Item).\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseError\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Error code detailing processing issues\",\n        description=(\n            \"An error code,from a specified code system, which details why the \"\n            \"claim could not be adjudicated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detailSequenceLinkId: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"detailSequenceLinkId\",\n        title=\"Detail sequence number\",\n        description=(\n            \"The sequence number of the addition within the line item submitted \"\n            \"which contains the error. This value is omitted when the error is not \"\n            \"related to an Addition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detailSequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailSequenceLinkId\",\n        title=\"Extension field for ``detailSequenceLinkId``.\",\n    )\n\n    sequenceLinkId: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequenceLinkId\",\n        title=\"Item sequence number\",\n        description=(\n            \"The sequence number of the line item submitted which contains the \"\n            \"error. This value is omitted when the error is elsewhere.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sequenceLinkId\",\n        title=\"Extension field for ``sequenceLinkId``.\",\n    )\n\n    subdetailSequenceLinkId: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"subdetailSequenceLinkId\",\n        title=\"Subdetail sequence number\",\n        description=(\n            \"The sequence number of the addition within the line item submitted \"\n            \"which contains the error. This value is omitted when the error is not \"\n            \"related to an Addition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subdetailSequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subdetailSequenceLinkId\",\n        title=\"Extension field for ``subdetailSequenceLinkId``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseError`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequenceLinkId\",\n            \"detailSequenceLinkId\",\n            \"subdetailSequenceLinkId\",\n            \"code\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseError`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurance or medical plan.\n    Financial instrument by which payment information for health care.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseInsurance\"\n\n    businessArrangement: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"businessArrangement\",\n        title=\"Business agreement\",\n        description=(\n            \"The contract number of a business agreement which describes the terms \"\n            \"and conditions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_businessArrangement\",\n        title=\"Extension field for ``businessArrangement``.\",\n    )\n\n    claimResponse: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claimResponse\",\n        title=\"Adjudication results\",\n        description=\"The Coverages adjudication details.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClaimResponse\"],\n        },\n    )\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=\"Reference to the program or plan identification, underwriter or payor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    focal: bool | None = Field(\n        default=None,\n        alias=\"focal\",\n        title=\"Is the focal Coverage\",\n        description=(\n            \"The instance number of the Coverage which is the focus for \"\n            \"adjudication. The Coverage against which the claim is to be \"\n            \"adjudicated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_focal\", title=\"Extension field for ``focal``.\"\n    )\n\n    preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Pre-Authorization/Determination Reference\",\n        description=\"A list of references from the Insurer to which these services pertain.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Service instance identifier\",\n        description=\"A service line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"focal\",\n            \"coverage\",\n            \"businessArrangement\",\n            \"preAuthRef\",\n            \"claimResponse\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"focal\", \"focal__ext\"), (\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimResponseItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Line items.\n    The first tier service adjudications for submitted services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItem\"\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Adjudication details\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ClaimResponseItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Detail line items\",\n        description=\"The second tier service adjudications for submitted services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"List of note numbers which apply\",\n        description=\"A list of note references to the notes provided below.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    sequenceLinkId: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequenceLinkId\",\n        title=\"Service instance\",\n        description=\"A service line number.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sequenceLinkId\",\n        title=\"Extension field for ``sequenceLinkId``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequenceLinkId\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequenceLinkId\", \"sequenceLinkId__ext\")]\n        return required_fields\n\n\nclass ClaimResponseItemAdjudication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication details.\n    The adjudication results.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItemAdjudication\"\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Monetary amount\",\n        description=\"Monetary amount associated with the code.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Adjudication category such as co-pay, eligible, benefit, etc.\",\n        description=\"Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Explanation of Adjudication outcome\",\n        description=\"Adjudication reason such as limit reached.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Non-monetary value\",\n        description=(\n            \"A non-monetary value for example a percentage. Mutually exclusive to \"\n            \"the amount element above.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItemAdjudication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"reason\",\n            \"amount\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItemAdjudication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Detail line items.\n    The second tier service adjudications for submitted services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItemDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Detail level adjudication details\",\n        description=\"The adjudications results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"List of note numbers which apply\",\n        description=\"A list of note references to the notes provided below.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    sequenceLinkId: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequenceLinkId\",\n        title=\"Service instance\",\n        description=\"A service line number.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sequenceLinkId\",\n        title=\"Extension field for ``sequenceLinkId``.\",\n    )\n\n    subDetail: typing.List[\n        fhirtypes.ClaimResponseItemDetailSubDetailType\n    ] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Subdetail line items\",\n        description=\"The third tier service adjudications for submitted services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequenceLinkId\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequenceLinkId\", \"sequenceLinkId__ext\")]\n        return required_fields\n\n\nclass ClaimResponseItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Subdetail line items.\n    The third tier service adjudications for submitted services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItemDetailSubDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Subdetail level adjudication details\",\n        description=\"The adjudications results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"List of note numbers which apply\",\n        description=\"A list of note references to the notes provided below.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    sequenceLinkId: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequenceLinkId\",\n        title=\"Service instance\",\n        description=\"A service line number.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sequenceLinkId\",\n        title=\"Extension field for ``sequenceLinkId``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequenceLinkId\",\n            \"noteNumber\",\n            \"adjudication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequenceLinkId\", \"sequenceLinkId__ext\")]\n        return required_fields\n\n\nclass ClaimResponsePayment(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Payment details, if paid.\n    Payment details for the claim if the claim has been paid.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponsePayment\"\n\n    adjustment: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"adjustment\",\n        title=\"Payment adjustment for non-Claim issues\",\n        description=(\n            \"Adjustment to the payment of this transaction which is not related to \"\n            \"adjudication of this transaction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    adjustmentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"adjustmentReason\",\n        title=\"Explanation for the non-claim adjustment\",\n        description=\"Reason for the payment adjustment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Payable amount after adjustment\",\n        description=\"Payable less any payment adjustment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Expected data of Payment\",\n        description=\"Estimated payment data.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier of the payment instrument\",\n        description=\"Payment identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Partial or Complete\",\n        description=\"Whether this represents partial or complete payment of the claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponsePayment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"adjustment\",\n            \"adjustmentReason\",\n            \"date\",\n            \"amount\",\n            \"identifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponsePayment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseProcessNote(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing notes.\n    Note text.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseProcessNote\"\n\n    language: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language if different from the resource\",\n        description=(\n            \"The ISO-639-1 alpha 2 code in lower case for the language, optionally \"\n            \"followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in\"\n            ' upper case; e.g. \"en\" for English, or \"en-US\" for American English '\n            'versus \"en-EN\" for England English.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    number: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"Sequence Number for this note\",\n        description=(\n            \"An integer associated with each note which may be referred to from \"\n            \"each service line item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Note explanatory text\",\n        description=\"The note text.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"display | print | printoper\",\n        description=\"The note purpose: Print/Display.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"number\",\n            \"type\",\n            \"text\",\n            \"language\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/clinicalimpression.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClinicalImpression\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ClinicalImpression(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A clinical assessment performed when planning treatments and management\n    strategies for a patient.\n    A record of a clinical assessment performed to determine what problem(s)\n    may affect the patient and before planning the treatments or management\n    strategies that are best to manage a patient's condition. Assessments are\n    often 1:1 with a clinical consultation / encounter,  but this varies\n    greatly depending on the clinical workflow. This resource is called\n    \"ClinicalImpression\" rather than \"ClinicalAssessment\" to avoid confusion\n    with the recording of assessment tools such as Apgar score.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalImpression\"\n\n    action: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Action taken as part of assessment procedure\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"ReferralRequest\",\n                \"ProcedureRequest\",\n                \"Procedure\",\n                \"MedicationRequest\",\n                \"Appointment\",\n            ],\n        },\n    )\n\n    assessor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"assessor\",\n        title=\"The clinician performing the assessment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Kind of assessment performed\",\n        description=\"Categorizes the type of clinical assessment performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or Episode created from\",\n        description=(\n            \"The encounter or episode of care this impression was created as part \"\n            \"of.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the assessment was documented\",\n        description=\"Indicates when the documentation of the assessment was complete.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Why/how the assessment was performed\",\n        description=(\n            \"A summary of the context and/or cause of the assessment - why / where \"\n            \"was it performed, and what patient events/status prompted it.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"Time of assessment\",\n        description=\"The point in time or period over which the subject was assessed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"Time of assessment\",\n        description=\"The point in time or period over which the subject was assessed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    finding: typing.List[fhirtypes.ClinicalImpressionFindingType] | None = Field(\n        default=None,\n        alias=\"finding\",\n        title=\"Possible or likely findings and diagnoses\",\n        description=(\n            \"Specific findings or diagnoses that was considered likely or relevant \"\n            \"to ongoing treatment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"A unique identifier assigned to the clinical impression that remains \"\n            \"consistent regardless of what server the impression is stored on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    investigation: typing.List[\n        fhirtypes.ClinicalImpressionInvestigationType\n    ] | None = Field(\n        default=None,\n        alias=\"investigation\",\n        title=\"One or more sets of investigations (signs, symptions, etc.)\",\n        description=(\n            \"One or more sets of investigations (signs, symptions, etc.). The \"\n            \"actual grouping of investigations vary greatly depending on the type \"\n            \"and context of the assessment. These investigations may include data \"\n            \"generated during the assessment process, or data previously generated \"\n            \"and recorded that is pertinent to the outcomes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the ClinicalImpression\",\n        description=(\n            \"Commentary about the impression, typically recorded after the \"\n            \"impression itself was made, though supplemental notes by the original \"\n            \"author could also appear.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    previous: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"previous\",\n        title=\"Reference to last assessment\",\n        description=(\n            \"A reference to the last assesment that was conducted bon this patient.\"\n            \" Assessments are often/usually ongoing in nature; a care provider \"\n            \"(practitioner or team) will make new assessments on an ongoing basis \"\n            \"as new data arises or the patient's conditions changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClinicalImpression\"],\n        },\n    )\n\n    problem: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"problem\",\n        title=\"Relevant impressions of patient state\",\n        description=\"This a list of the relevant problems/conditions for a patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"AllergyIntolerance\"],\n        },\n    )\n\n    prognosisCodeableConcept: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"prognosisCodeableConcept\",\n        title=\"Estimate of likely outcome\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    prognosisReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"prognosisReference\",\n        title=\"RiskAssessment expressing likely outcome\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"RiskAssessment\"],\n        },\n    )\n\n    protocol: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"protocol\",\n        title=\"Clinical Protocol followed\",\n        description=(\n            \"Reference to a specific published clinical protocol that was followed \"\n            \"during this assessment, and/or that provides evidence in support of \"\n            \"the diagnosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    protocol__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_protocol\", title=\"Extension field for ``protocol``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | completed | entered-in-error\",\n        description=\"Identifies the workflow status of the assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"completed\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Patient or group assessed\",\n        description=\"The patient or group of individuals assessed as part of this record.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    summary: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"summary\",\n        title=\"Summary of the assessment\",\n        description=\"A text summary of the investigations and the diagnosis.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    summary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_summary\", title=\"Extension field for ``summary``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalImpression`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"code\",\n            \"description\",\n            \"subject\",\n            \"context\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"date\",\n            \"assessor\",\n            \"previous\",\n            \"problem\",\n            \"investigation\",\n            \"protocol\",\n            \"summary\",\n            \"finding\",\n            \"prognosisCodeableConcept\",\n            \"prognosisReference\",\n            \"action\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalImpression`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"code\",\n            \"description\",\n            \"subject\",\n            \"context\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"date\",\n            \"assessor\",\n            \"problem\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"effective\": [\"effectiveDateTime\", \"effectivePeriod\"]}\n        return one_of_many_fields\n\n\nclass ClinicalImpressionFinding(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Possible or likely findings and diagnoses.\n    Specific findings or diagnoses that was considered likely or relevant to\n    ongoing treatment.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalImpressionFinding\"\n\n    basis: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"basis\",\n        title=\"Which investigations support finding\",\n        description=\"Which investigations support finding or diagnosis.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    basis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_basis\", title=\"Extension field for ``basis``.\"\n    )\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"What was found\",\n        description=(\n            \"Specific text, code or reference for finding or diagnosis, which may \"\n            \"include ruled-out or resolved conditions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"What was found\",\n        description=(\n            \"Specific text, code or reference for finding or diagnosis, which may \"\n            \"include ruled-out or resolved conditions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalImpressionFinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n            \"itemReference\",\n            \"basis\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalImpressionFinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n\n\nclass ClinicalImpressionInvestigation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    One or more sets of investigations (signs, symptions, etc.).\n    One or more sets of investigations (signs, symptions, etc.). The actual\n    grouping of investigations vary greatly depending on the type and context\n    of the assessment. These investigations may include data generated during\n    the assessment process, or data previously generated and recorded that is\n    pertinent to the outcomes.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalImpressionInvestigation\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"A name/code for the set\",\n        description=(\n            'A name/code for the group (\"set\") of investigations. Typically, this '\n            'will be something like \"signs\", \"symptoms\", \"clinical\", \"diagnostic\", '\n            \"but the list is not constrained, and others such groups such as \"\n            \"(exposure|family|travel|nutitirional) history may be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    item: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Record of a specific investigation\",\n        description=\"A record of a specific investigation that was undertaken.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Observation\",\n                \"QuestionnaireResponse\",\n                \"FamilyMemberHistory\",\n                \"DiagnosticReport\",\n                \"RiskAssessment\",\n                \"ImagingStudy\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalImpressionInvestigation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"item\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalImpressionInvestigation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/codeableconcept.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CodeableConcept\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass CodeableConcept(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Concept - reference to a terminology or just  text.\n    A concept that may be defined by a formal reference to a terminology or\n    ontology or may be provided by text.\n    \"\"\"\n\n    __resource_type__ = \"CodeableConcept\"\n\n    coding: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"coding\",\n        title=\"Code defined by a terminology system\",\n        description=\"A reference to a code defined by a terminology system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Plain text representation of the concept\",\n        description=(\n            \"A human language representation of the concept as \"\n            \"seen/selected/uttered by the user who entered the data and/or which \"\n            \"represents the intended meaning of the user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeableConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"coding\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeableConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"coding\", \"text\"]\n"
  },
  {
    "path": "fhir/resources/STU3/codesystem.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CodeSystem\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CodeSystem(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of codes drawn from one or more code systems.\n    A code system resource specifies a set of codes drawn from one or more code\n    systems.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystem\"\n\n    caseSensitive: bool | None = Field(\n        default=None,\n        alias=\"caseSensitive\",\n        title=\"If code comparison is case sensitive\",\n        description=(\n            \"If code comparison is case sensitive when codes within this system are\"\n            \" compared to each other.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    caseSensitive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_caseSensitive\",\n        title=\"Extension field for ``caseSensitive``.\",\n    )\n\n    compositional: bool | None = Field(\n        default=None,\n        alias=\"compositional\",\n        title=\"If code system defines a post-composition grammar\",\n        description=\"True If code system defines a post-composition grammar.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    compositional__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compositional\",\n        title=\"Extension field for ``compositional``.\",\n    )\n\n    concept: typing.List[fhirtypes.CodeSystemConceptType] | None = Field(\n        default=None,\n        alias=\"concept\",\n        title=\"Concepts in the code system\",\n        description=(\n            \"Concepts that are in the code system. The concept definitions are \"\n            \"inherently hierarchical, but the definitions must be consulted to \"\n            \"determine what the meaning of the hierarchical relationships are.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    content: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"not-present | example | fragment | complete\",\n        description=(\n            \"How much of the content of the code system - the concepts and codes it\"\n            \" defines - are represented in this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"not-present\", \"example\", \"fragment\", \"complete\"],\n        },\n    )\n    content__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_content\", title=\"Extension field for ``content``.\"\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the code system and/or its contents.\"\n            \" Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    count: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Total concepts in the code system\",\n        description=(\n            \"The total number of concepts defined by the code system. Where the \"\n            \"code system has a compositional grammar, the count refers to the \"\n            \"number of base (primitive) concepts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the code system was published. \"\n            \"The date must change if and when the business version changes and it \"\n            \"must change if the status code changes. In addition, it should change \"\n            \"when the substantive content of the code system changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the code system\",\n        description=(\n            \"A free text natural language description of the code system from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this code system is authored for \"\n            \"testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    filter: typing.List[fhirtypes.CodeSystemFilterType] | None = Field(\n        default=None,\n        alias=\"filter\",\n        title=\"Filter that can be used in a value set\",\n        description=(\n            \"A filter that can be used in a value set compose statement when \"\n            \"selecting concepts using a filter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    hierarchyMeaning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"hierarchyMeaning\",\n        title=\"grouped-by | is-a | part-of | classified-with\",\n        description=\"The meaning of the hierarchy of concepts.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"grouped-by\", \"is-a\", \"part-of\", \"classified-with\"],\n        },\n    )\n    hierarchyMeaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_hierarchyMeaning\",\n        title=\"Extension field for ``hierarchyMeaning``.\",\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the code system\",\n        description=(\n            \"A formal identifier that is used to identify this code system when it \"\n            \"is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for code system (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the code system is intended to \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this code system (computer friendly)\",\n        description=(\n            \"A natural language name identifying the code system. This name should \"\n            \"be usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    property: typing.List[fhirtypes.CodeSystemPropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Additional information supplied about each concept\",\n        description=(\n            \"A property defines an additional slot through which additional \"\n            \"information can be provided about a concept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the code \"\n            \"system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this code system is defined\",\n        description=(\n            \"Explaination of why this code system is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this code system. Enables tracking the life-cycle of the\"\n            \" content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this code system (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the code system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Logical URI to reference this code system (globally unique) \"\n            \"(Coding.system)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this code system when it is \"\n            \"referenced in a specification, model, design or an instance. This \"\n            \"SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at\"\n            \" which this code system is (or will be) published. The URL SHOULD \"\n            \"include the major version of the code system. For more information see\"\n            \" [Technical and Business Versions](resource.html#versions). This is \"\n            \"used in [Coding]{datatypes.html#Coding}.system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate code system instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueSet: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Canonical URL for value set with entire code system\",\n        description=\"Canonical URL of value set that contains the entire code system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the code system (Coding.version)\",\n        description=(\n            \"The identifier that is used to identify this version of the code \"\n            \"system when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the code system author\"\n            \" and is not expected to be globally unique. For example, it might be a\"\n            \" timestamp (e.g. yyyymmdd) if a managed version is not available. \"\n            \"There is also no expectation that versions can be placed in a \"\n            \"lexicographical sequence. This is used in \"\n            \"[Coding]{datatypes.html#Coding}.version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionNeeded: bool | None = Field(\n        default=None,\n        alias=\"versionNeeded\",\n        title=\"If definitions are not stable\",\n        description=(\n            \"This flag is used to signify that the code system has not (or does \"\n            \"not) maintain the definitions, and a version must be specified when \"\n            \"referencing this code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    versionNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionNeeded\",\n        title=\"Extension field for ``versionNeeded``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"caseSensitive\",\n            \"valueSet\",\n            \"hierarchyMeaning\",\n            \"compositional\",\n            \"versionNeeded\",\n            \"content\",\n            \"count\",\n            \"filter\",\n            \"property\",\n            \"concept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"caseSensitive\",\n            \"valueSet\",\n            \"hierarchyMeaning\",\n            \"compositional\",\n            \"versionNeeded\",\n            \"content\",\n            \"count\",\n            \"filter\",\n            \"property\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"content\", \"content__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass CodeSystemConcept(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Concepts in the code system.\n    Concepts that are in the code system. The concept definitions are\n    inherently hierarchical, but the definitions must be consulted to determine\n    what the meaning of the hierarchical relationships are.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemConcept\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies concept\",\n        description=(\n            \"A code - a text symbol - that uniquely identifies the concept within \"\n            \"the code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    concept: typing.List[fhirtypes.CodeSystemConceptType] | None = Field(\n        default=None,\n        alias=\"concept\",\n        title=\"Child Concepts (is-a/contains/categorizes)\",\n        description=(\n            \"Defines children of a concept to produce a hierarchy of concepts. The \"\n            \"nature of the relationships is variable (is-a/contains/categorizes) - \"\n            \"see hierarchyMeaning.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Formal definition\",\n        description=(\n            \"The formal definition of the concept. The code system resource does \"\n            \"not make formal definitions required, because of the prevalence of \"\n            \"legacy systems. However, they are highly recommended, as without them \"\n            \"there is no formal meaning associated with the concept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    designation: typing.List[fhirtypes.CodeSystemConceptDesignationType] | None = Field(\n        default=None,\n        alias=\"designation\",\n        title=\"Additional representations for the concept\",\n        description=(\n            \"Additional representations for the concept - other languages, aliases,\"\n            \" specialized purposes, used for particular purposes, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Text to display to the user\",\n        description=(\n            \"A human readable string that is the recommended default way to present\"\n            \" this concept to a user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    property: typing.List[fhirtypes.CodeSystemConceptPropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Property value for the concept\",\n        description=\"A property value for this concept.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"display\",\n            \"definition\",\n            \"designation\",\n            \"property\",\n            \"concept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass CodeSystemConceptDesignation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional representations for the concept.\n    Additional representations for the concept - other languages, aliases,\n    specialized purposes, used for particular purposes, etc.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemConceptDesignation\"\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language of the designation\",\n        description=\"The language this designation is defined for.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    use: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"Details how this designation would be used\",\n        description=\"A code that details how this designation would be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The text value for this designation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemConceptDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"use\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemConceptDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass CodeSystemConceptProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Property value for the concept.\n    A property value for this concept.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemConceptProperty\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Reference to CodeSystem.property.code\",\n        description=\"A code that is a reference to CodeSystem.property.code.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemConceptProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCode\",\n            \"valueCoding\",\n            \"valueString\",\n            \"valueInteger\",\n            \"valueBoolean\",\n            \"valueDateTime\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemConceptProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueCoding\",\n                \"valueDateTime\",\n                \"valueInteger\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass CodeSystemFilter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Filter that can be used in a value set.\n    A filter that can be used in a value set compose statement when selecting\n    concepts using a filter.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemFilter\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies the filter\",\n        description=\"The code that identifies this filter when it is used in the instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"How or why the filter is used\",\n        description=\"A description of how or why the filter is used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    operator: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"operator\",\n        title=\"Operators that can be used with filter\",\n        description=\"A list of operators that can be used with the filter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    operator__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_operator\", title=\"Extension field for ``operator``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"What to use for the value\",\n        description=\"A description of what the value for the filter should be.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"description\",\n            \"operator\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"description\", \"operator\", \"value\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"code\", \"code__ext\"),\n            (\"operator\", \"operator__ext\"),\n            (\"value\", \"value__ext\"),\n        ]\n        return required_fields\n\n\nclass CodeSystemProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional information supplied about each concept.\n    A property defines an additional slot through which additional information\n    can be provided about a concept.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemProperty\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"Identifies the property on the concepts, and when referred to in \"\n            \"operations\"\n        ),\n        description=(\n            \"A code that is used to identify the property. The code is used \"\n            \"internally (in CodeSystem.concept.property.code) and also externally, \"\n            \"such as in property filters.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Why the property is defined, and/or what it conveys\",\n        description=(\n            \"A description of the property- why it is defined, and how its value \"\n            \"might be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"code | Coding | string | integer | boolean | dateTime\",\n        description=(\n            'The type of the property value. Properties of type \"code\" contain a '\n            \"code defined by the code system (e.g. a reference to anotherr defined \"\n            \"concept).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"code\",\n                \"Coding\",\n                \"string\",\n                \"integer\",\n                \"boolean\",\n                \"dateTime\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Formal identifier for the property\",\n        description=(\n            \"Reference to the formal meaning of the property. One possible source \"\n            \"of meaning is the [Concept Properties](codesystem-concept-\"\n            \"properties.html) code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"uri\",\n            \"description\",\n            \"type\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"uri\", \"description\", \"type\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/coding.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Coding\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Coding(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reference to a code defined by a terminology system.\n    \"\"\"\n\n    __resource_type__ = \"Coding\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Symbol in syntax defined by the system\",\n        description=(\n            \"A symbol in syntax defined by the system. The symbol may be a \"\n            \"predefined code or an expression in a syntax defined by the coding \"\n            \"system (e.g. post-coordination).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Representation defined by the system\",\n        description=(\n            \"A representation of the meaning of the code in the system, following \"\n            \"the rules of the system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"Identity of the terminology system\",\n        description=(\n            \"The identification of the code system that defines the meaning of the \"\n            \"symbol in the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    userSelected: bool | None = Field(\n        default=None,\n        alias=\"userSelected\",\n        title=\"If this coding was chosen directly by the user\",\n        description=(\n            \"Indicates that this coding was chosen by a user directly - i.e. off a \"\n            \"pick list of available items (codes or displays).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    userSelected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_userSelected\",\n        title=\"Extension field for ``userSelected``.\",\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version of the system - if relevant\",\n        description=(\n            \"The version of the code system which was used when choosing this code.\"\n            \" Note that a well-maintained code system does not need the version \"\n            \"reported, because the meaning of codes is consistent across versions. \"\n            \"However this cannot consistently be assured. and when the meaning is \"\n            \"not guaranteed to be consistent, the version SHOULD be exchanged.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Coding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"system\",\n            \"version\",\n            \"code\",\n            \"display\",\n            \"userSelected\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Coding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"system\", \"version\", \"code\", \"display\", \"userSelected\"]\n"
  },
  {
    "path": "fhir/resources/STU3/communication.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Communication\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Communication(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A record of information transmitted from a sender to a receiver.\n    An occurrence of information being transmitted; e.g. an alert that was sent\n    to a responsible provider, a public health agency was notified about a\n    reportable condition.\n    \"\"\"\n\n    __resource_type__ = \"Communication\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this communication\",\n        description=(\n            \"An order, proposal or plan fulfilled in whole or in part by this \"\n            \"Communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Message category\",\n        description=(\n            \"The type of message conveyed such as alert, notification, reminder, \"\n            \"instruction, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or episode leading to message\",\n        description=\"The encounter within which the communication was sent.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    definition: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Instantiates protocol or definition\",\n        description=(\n            \"A protocol, guideline, or other definition that was adhered to in \"\n            \"whole or in part by this communication event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PlanDefinition\", \"ActivityDefinition\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=(\n            \"Identifiers associated with this Communication that are defined by \"\n            \"business processes and/ or used to refer to it when a direct URL \"\n            \"reference to the resource itself is not appropriate (e.g. in CDA \"\n            \"documents, or in written / printed documentation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    medium: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"medium\",\n        title=\"A channel of communication\",\n        description=\"A channel that was used for this communication (e.g. email, fax).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    notDone: bool | None = Field(\n        default=None,\n        alias=\"notDone\",\n        title=\"Communication did not occur\",\n        description=(\n            \"If true, indicates that the described communication event did not \"\n            \"actually occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    notDone__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_notDone\", title=\"Extension field for ``notDone``.\"\n    )\n\n    notDoneReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"notDoneReason\",\n        title=\"Why communication did not occur\",\n        description=(\n            \"Describes why the communication event did not occur in coded and/or \"\n            \"textual form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the communication\",\n        description=(\n            \"Additional notes or commentary about the communication by the sender, \"\n            \"receiver or other interested parties.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of this action\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    payload: typing.List[fhirtypes.CommunicationPayloadType] | None = Field(\n        default=None,\n        alias=\"payload\",\n        title=\"Message payload\",\n        description=(\n            \"Text, attachment(s), or resource(s) that was communicated to the \"\n            \"recipient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Indication for message\",\n        description=\"The reason or justification for the communication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why was communication done?\",\n        description=(\n            \"Indicates another resource whose existence justifies this \"\n            \"communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    received: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"received\",\n        title=\"When received\",\n        description=\"The time when this communication arrived at the destination.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    received__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_received\", title=\"Extension field for ``received``.\"\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Message recipient\",\n        description=(\n            \"The entity (e.g. person, organization, clinical information system, or\"\n            \" device) which was the target of the communication. If receipts need \"\n            \"to be tracked by individual, a separate resource instance will need to\"\n            \" be created for each recipient. \\u00a0Multiple recipient communications are\"\n            \" intended where either a receipt(s) is not tracked (e.g. a mass mail-\"\n            \"out) or is captured in aggregate (all emails confirmed received by a \"\n            \"particular time).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Group\",\n            ],\n        },\n    )\n\n    sender: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sender\",\n        title=\"Message sender\",\n        description=(\n            \"The entity (e.g. person, organization, clinical information system, or\"\n            \" device) which was the source of the communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    sent: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"sent\",\n        title=\"When sent\",\n        description=\"The time when this communication was sent.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sent\", title=\"Extension field for ``sent``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | suspended | aborted | completed | entered-\"\n            \"in-error\"\n        ),\n        description=\"The status of the transmission.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"suspended\",\n                \"aborted\",\n                \"completed\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Focus of message\",\n        description=\"The patient or group that was the focus of this communication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    topic: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"Focal resources\",\n        description=(\n            \"The resources which were responsible for or related to producing this \"\n            \"communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Communication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"notDone\",\n            \"notDoneReason\",\n            \"category\",\n            \"medium\",\n            \"subject\",\n            \"recipient\",\n            \"topic\",\n            \"context\",\n            \"sent\",\n            \"received\",\n            \"sender\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"payload\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Communication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"notDone\",\n            \"notDoneReason\",\n            \"subject\",\n            \"context\",\n            \"reasonCode\",\n            \"reasonReference\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass CommunicationPayload(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Message payload.\n    Text, attachment(s), or resource(s) that was communicated to the recipient.\n    \"\"\"\n\n    __resource_type__ = \"CommunicationPayload\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Message part content\",\n        description=(\n            \"A communicated content (or for multi-part communications, one portion \"\n            \"of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Message part content\",\n        description=(\n            \"A communicated content (or for multi-part communications, one portion \"\n            \"of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    contentString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"contentString\",\n        title=\"Message part content\",\n        description=(\n            \"A communicated content (or for multi-part communications, one portion \"\n            \"of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n    contentString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_contentString\",\n        title=\"Extension field for ``contentString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CommunicationPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentString\",\n            \"contentAttachment\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CommunicationPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"content\": [\"contentAttachment\", \"contentReference\", \"contentString\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/communicationrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CommunicationRequest\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CommunicationRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A request for information to be sent to a receiver.\n    A request to convey information; e.g. the CDS system proposes that an alert\n    be sent to a responsible provider, the CDS system proposes that the public\n    health agency be notified about a reportable condition.\n    \"\"\"\n\n    __resource_type__ = \"CommunicationRequest\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When request transitioned to being actionable\",\n        description=(\n            \"For draft requests, indicates the date of initial creation.  For \"\n            \"requests with other statuses, indicates the date of activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan or proposal\",\n        description=(\n            \"A plan or proposal that is fulfilled in whole or in part by this \"\n            \"request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Message category\",\n        description=(\n            \"The type of message to be sent such as alert, notification, reminder, \"\n            \"instruction, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or episode leading to message\",\n        description=(\n            \"The encounter or episode of care within which the communication \"\n            \"request was created.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Composite request this is part of\",\n        description=(\n            \"A shared identifier common to all requests that were authorized more \"\n            \"or less simultaneously by a single author, representing the identifier\"\n            \" of the requisition, prescription or similar form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=(\n            \"A unique ID of this request for reference purposes. It must be \"\n            \"provided if user wants it returned as part of any output, otherwise it\"\n            \" will be autogenerated, if needed, by CDS system. Does not need to be \"\n            \"the actual ID of the source system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    medium: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"medium\",\n        title=\"A channel of communication\",\n        description=\"A channel that was used for this communication (e.g. email, fax).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about communication request\",\n        description=(\n            \"Comments made about the request by the requester, sender, recipient, \"\n            \"subject or other participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When scheduled\",\n        description=\"The time when this communication is to occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When scheduled\",\n        description=\"The time when this communication is to occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    payload: typing.List[fhirtypes.CommunicationRequestPayloadType] | None = Field(\n        default=None,\n        alias=\"payload\",\n        title=\"Message payload\",\n        description=(\n            \"Text, attachment(s), or resource(s) to be communicated to the \"\n            \"recipient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Message urgency\",\n        description=(\n            \"Characterizes how quickly the proposed act must be initiated. Includes\"\n            \" concepts such as stat, urgent, routine.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why is communication needed?\",\n        description=\"Describes why the request is being made in coded or textual form.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why is communication needed?\",\n        description=\"Indicates another resource whose existence justifies this request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Message recipient\",\n        description=(\n            \"The entity (e.g. person, organization, clinical information system, \"\n            \"device, group, or care team) which is the intended target of the \"\n            \"communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Group\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"Request(s) replaced by this request\",\n        description=(\n            \"Completed or terminated request(s) whose function is taken by this new\"\n            \" request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CommunicationRequest\"],\n        },\n    )\n\n    requester: fhirtypes.CommunicationRequestRequesterType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/what is requesting service\",\n        description=(\n            \"The individual who initiated the request and has responsibility for \"\n            \"its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sender: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sender\",\n        title=\"Message sender\",\n        description=(\n            \"The entity (e.g. person, organization, clinical information system, or\"\n            \" device) which is to be the source of the communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | suspended | cancelled | completed | entered-in-error \"\n            \"| unknown\"\n        ),\n        description=\"The status of the proposal or order.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"suspended\",\n                \"cancelled\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Focus of message\",\n        description=\"The patient or group that is the focus of this communication request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    topic: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"Focal resources\",\n        description=(\n            \"The resources which were related to producing this communication \"\n            \"request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CommunicationRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"category\",\n            \"priority\",\n            \"medium\",\n            \"subject\",\n            \"recipient\",\n            \"topic\",\n            \"context\",\n            \"payload\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"authoredOn\",\n            \"sender\",\n            \"requester\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CommunicationRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"priority\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"authoredOn\",\n            \"requester\",\n            \"reasonCode\",\n            \"reasonReference\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\"]}\n        return one_of_many_fields\n\n\nclass CommunicationRequestPayload(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Message payload.\n    Text, attachment(s), or resource(s) to be communicated to the recipient.\n    \"\"\"\n\n    __resource_type__ = \"CommunicationRequestPayload\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Message part content\",\n        description=(\n            \"The communicated content (or for multi-part communications, one \"\n            \"portion of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Message part content\",\n        description=(\n            \"The communicated content (or for multi-part communications, one \"\n            \"portion of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    contentString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"contentString\",\n        title=\"Message part content\",\n        description=(\n            \"The communicated content (or for multi-part communications, one \"\n            \"portion of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n    contentString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_contentString\",\n        title=\"Extension field for ``contentString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CommunicationRequestPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentString\",\n            \"contentAttachment\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CommunicationRequestPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"content\": [\"contentAttachment\", \"contentReference\", \"contentString\"]\n        }\n        return one_of_many_fields\n\n\nclass CommunicationRequestRequester(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who/what is requesting service.\n    The individual who initiated the request and has responsibility for its\n    activation.\n    \"\"\"\n\n    __resource_type__ = \"CommunicationRequestRequester\"\n\n    agent: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Individual making the request\",\n        description=\"The device, practitioner, etc. who initiated the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization agent is acting for\",\n        description=\"The organization the device or practitioner was acting on behalf of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CommunicationRequestRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"agent\", \"onBehalfOf\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CommunicationRequestRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"agent\", \"onBehalfOf\"]\n"
  },
  {
    "path": "fhir/resources/STU3/compartmentdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CompartmentDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CompartmentDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Compartment Definition for a resource.\n    A compartment definition that defines how resources are accessed on a\n    server.\n    \"\"\"\n\n    __resource_type__ = \"CompartmentDefinition\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Patient | Encounter | RelatedPerson | Practitioner | Device\",\n        description=\"Which compartment this definition describes.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"Patient\",\n                \"Encounter\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"Device\",\n            ],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the compartment definition was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the compartment \"\n            \"definition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the compartment definition\",\n        description=(\n            \"A free text natural language description of the compartment definition\"\n            \" from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this compartment definition is \"\n            \"authored for testing purposes (or education/evaluation/marketing), and\"\n            \" is not intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for compartment definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the compartment definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this compartment definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the compartment definition. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the \"\n            \"compartment definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this compartment definition is defined\",\n        description=(\n            \"Explaination of why this compartment definition is needed and why it \"\n            \"has been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    resource: typing.List[fhirtypes.CompartmentDefinitionResourceType] | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"How a resource is related to the compartment\",\n        description=\"Information about how a resource is related to the compartment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    search: bool | None = Field(\n        default=None,\n        alias=\"search\",\n        title=\"Whether the search syntax is supported\",\n        description=\"Whether the search syntax is supported,.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    search__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_search\", title=\"Extension field for ``search``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this compartment definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this compartment definition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the compartment \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this compartment definition (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this compartment definition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD \"\n            \"be an address at which this compartment definition is (or will be) \"\n            \"published. The URL SHOULD include the major version of the compartment\"\n            \" definition. For more information see [Technical and Business \"\n            \"Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate compartment definition \"\n            \"instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompartmentDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"purpose\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"code\",\n            \"search\",\n            \"resource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompartmentDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"code\",\n            \"search\",\n            \"resource\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"code\", \"code__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"search\", \"search__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n\nclass CompartmentDefinitionResource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    How a resource is related to the compartment.\n    Information about how a resource is related to the compartment.\n    \"\"\"\n\n    __resource_type__ = \"CompartmentDefinitionResource\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Name of resource type\",\n        description=\"The name of a resource supported by the server.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Additional documentation about the resource and compartment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    param: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"param\",\n        title=\"Search Parameter Name, or chained parameters\",\n        description=(\n            \"The name of a search parameter that represents the link to the \"\n            \"compartment. More than one may be listed because a resource may be \"\n            \"linked to a compartment in more than one way,.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    param__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_param\", title=\"Extension field for ``param``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompartmentDefinitionResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"param\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompartmentDefinitionResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"param\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/composition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Composition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Composition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of resources composed into a single coherent clinical statement with\n    clinical attestation.\n    A set of healthcare-related information that is assembled together into a\n    single logical document that provides a single coherent statement of\n    meaning, establishes its own context and that has clinical attestation with\n    regard to who is making the statement. While a Composition defines the\n    structure, it does not actually contain the content: rather the full\n    content of a document is contained in a Bundle, of which the Composition is\n    the first resource contained.\n    \"\"\"\n\n    __resource_type__ = \"Composition\"\n\n    attester: typing.List[fhirtypes.CompositionAttesterType] | None = Field(\n        default=None,\n        alias=\"attester\",\n        title=\"Attests to accuracy of composition\",\n        description=(\n            \"A participant who has attested to the accuracy of the \"\n            \"composition/document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    author: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"author\",\n        title=\"Who and/or what authored the composition\",\n        description=(\n            \"Identifies who is responsible for the information in the composition, \"\n            \"not necessarily who typed it in.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    class_fhir: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"class\",\n        title=\"Categorization of Composition\",\n        description=(\n            \"A categorization for the type of the composition - helps for indexing \"\n            \"and searching. This may be implied by or derived from the code \"\n            \"specified in the Composition Type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    confidentiality: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"confidentiality\",\n        title=\"As defined by affinity domain\",\n        description=\"The code specifying the level of confidentiality of the Composition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    confidentiality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_confidentiality\",\n        title=\"Extension field for ``confidentiality``.\",\n    )\n\n    custodian: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"custodian\",\n        title=\"Organization which maintains the composition\",\n        description=(\n            \"Identifies the organization or group who is responsible for ongoing \"\n            \"maintenance of and access to the composition/document information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Composition editing time\",\n        description=(\n            \"The composition editing time, when the composition was last logically \"\n            \"changed by the author.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Context of the Composition\",\n        description=(\n            \"Describes the clinical encounter or type of care this documentation is\"\n            \" associated with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    event: typing.List[fhirtypes.CompositionEventType] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"The clinical service(s) being documented\",\n        description=(\n            \"The clinical service, such as a colonoscopy or an appendectomy, being \"\n            \"documented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Logical identifier of composition (version-independent)\",\n        description=(\n            \"Logical identifier for the composition, assigned when created. This \"\n            \"identifier stays constant as the composition is changed over time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatesTo: typing.List[fhirtypes.CompositionRelatesToType] | None = Field(\n        default=None,\n        alias=\"relatesTo\",\n        title=\"Relationships to other compositions/documents\",\n        description=(\n            \"Relationships that this composition has with other compositions or \"\n            \"documents that already exist.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    section: typing.List[fhirtypes.CompositionSectionType] | None = Field(\n        default=None,\n        alias=\"section\",\n        title=\"Composition is broken into sections\",\n        description=\"The root of the sections that make up the composition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"preliminary | final | amended | entered-in-error\",\n        description=(\n            \"The workflow/clinical status of this composition. The status is a \"\n            \"marker for the clinical standing of the document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"preliminary\", \"final\", \"amended\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who and/or what the composition is about\",\n        description=(\n            \"Who or what the composition is about. The composition can be about a \"\n            \"person, (patient or healthcare practitioner), a device (e.g. a \"\n            \"machine) or even a group of subjects (such as a document about a herd \"\n            \"of livestock, or a set of patients that share a common exposure).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Human Readable name/title\",\n        description=\"Official human-readable label for the composition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Kind of composition (LOINC if possible)\",\n        description=(\n            \"Specifies the particular kind of composition (e.g. History and \"\n            \"Physical, Discharge Summary, Progress Note). This usually equates to \"\n            \"the purpose of making the composition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Composition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"class\",\n            \"subject\",\n            \"encounter\",\n            \"date\",\n            \"author\",\n            \"title\",\n            \"confidentiality\",\n            \"attester\",\n            \"custodian\",\n            \"relatesTo\",\n            \"event\",\n            \"section\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Composition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"class\",\n            \"subject\",\n            \"encounter\",\n            \"date\",\n            \"author\",\n            \"title\",\n            \"confidentiality\",\n            \"attester\",\n            \"custodian\",\n            \"relatesTo\",\n            \"event\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"date\", \"date__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"title\", \"title__ext\"),\n        ]\n        return required_fields\n\n\nclass CompositionAttester(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Attests to accuracy of composition.\n    A participant who has attested to the accuracy of the composition/document.\n    \"\"\"\n\n    __resource_type__ = \"CompositionAttester\"\n\n    mode: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"personal | professional | legal | official\",\n        description=\"The type of attestation the authenticator offers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"personal\", \"professional\", \"legal\", \"official\"],\n        },\n    )\n    mode__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    party: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"party\",\n        title=\"Who attested the composition\",\n        description=\"Who attested the composition in the specified way.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\", \"Organization\"],\n        },\n    )\n\n    time: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"time\",\n        title=\"When the composition was attested\",\n        description=\"When the composition was attested by the party.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_time\", title=\"Extension field for ``time``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompositionAttester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"mode\", \"time\", \"party\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompositionAttester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\", \"time\", \"party\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\")]\n        return required_fields\n\n\nclass CompositionEvent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The clinical service(s) being documented.\n    The clinical service, such as a colonoscopy or an appendectomy, being\n    documented.\n    \"\"\"\n\n    __resource_type__ = \"CompositionEvent\"\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code(s) that apply to the event being documented\",\n        description=(\n            \"This list of codes represents the main clinical acts, such as a \"\n            \"colonoscopy or an appendectomy, being documented. In some cases, the \"\n            'event is inherent in the typeCode, such as a \"History and Physical '\n            'Report\" in which the procedure being documented is necessarily a '\n            '\"History and Physical\" act.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"The event(s) being documented\",\n        description=(\n            \"The description and/or reference of the event(s) being documented. For\"\n            \" example, this could be used to document such a colonoscopy or an \"\n            \"appendectomy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"The period covered by the documentation\",\n        description=(\n            \"The period of time covered by the documentation. There is no assertion\"\n            \" that the documentation is a complete representation for this period, \"\n            \"only that it documents events during this time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompositionEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"period\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompositionEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"period\", \"detail\"]\n\n\nclass CompositionRelatesTo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationships to other compositions/documents.\n    Relationships that this composition has with other compositions or\n    documents that already exist.\n    \"\"\"\n\n    __resource_type__ = \"CompositionRelatesTo\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"replaces | transforms | signs | appends\",\n        description=(\n            \"The type of relationship that this composition has with anther \"\n            \"composition or document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"replaces\", \"transforms\", \"signs\", \"appends\"],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    targetIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"targetIdentifier\",\n        title=\"Target of the relationship\",\n        description=\"The target composition/document of this relationship.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    targetReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"targetReference\",\n        title=\"Target of the relationship\",\n        description=\"The target composition/document of this relationship.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Composition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompositionRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"targetIdentifier\",\n            \"targetReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompositionRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"targetIdentifier\", \"targetReference\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"target\": [\"targetIdentifier\", \"targetReference\"]}\n        return one_of_many_fields\n\n\nclass CompositionSection(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Composition is broken into sections.\n    The root of the sections that make up the composition.\n    \"\"\"\n\n    __resource_type__ = \"CompositionSection\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Classification of section (recommended)\",\n        description=(\n            \"A code identifying the kind of content contained within the section. \"\n            \"This must be consistent with the section title.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    emptyReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"emptyReason\",\n        title=\"Why the section is empty\",\n        description=(\n            \"If the section is empty, why the list is empty. An empty section \"\n            \"typically has some text explaining the empty reason.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entry: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"entry\",\n        title=\"A reference to data that supports this section\",\n        description=(\n            \"A reference to the actual resource from which the narrative in the \"\n            \"section is derived.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"working | snapshot | changes\",\n        description=(\n            \"How the entry list was prepared - whether it is a working list that is\"\n            \" suitable for being maintained on an ongoing basis, or if it \"\n            \"represents a snapshot of a list of items from another source, or \"\n            \"whether it is a prepared list where items may be marked as added, \"\n            \"modified or deleted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"working\", \"snapshot\", \"changes\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    orderedBy: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"orderedBy\",\n        title=\"Order of section entries\",\n        description=\"Specifies the order applied to the items in the section entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    section: typing.List[fhirtypes.CompositionSectionType] | None = Field(\n        default=None,\n        alias=\"section\",\n        title=\"Nested Section\",\n        description=\"A nested sub-section within this section.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.NarrativeType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text summary of the section, for human interpretation\",\n        description=(\n            \"A human-readable narrative that contains the attested content of the \"\n            \"section, used to represent the content of the resource to a human. The\"\n            \" narrative need not encode all the structured data, but is required to\"\n            ' contain sufficient detail to make it \"clinically safe\" for a human to'\n            \" just read the narrative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label for section (e.g. for ToC)\",\n        description=(\n            \"The label for this particular section.  This will be part of the \"\n            \"rendered content for the document, and is often used to build a table \"\n            \"of contents.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompositionSection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"title\",\n            \"code\",\n            \"text\",\n            \"mode\",\n            \"orderedBy\",\n            \"entry\",\n            \"emptyReason\",\n            \"section\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompositionSection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\"]\n"
  },
  {
    "path": "fhir/resources/STU3/conceptmap.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ConceptMap\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ConceptMap(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A map from one set of concepts to one or more other concepts.\n    A statement of relationships from one set of concepts to one or more other\n    concepts - either code systems or data elements, or classes in class\n    models.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMap\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the concept map and/or its contents.\"\n            \" Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the concept map was published. \"\n            \"The date must change if and when the business version changes and it \"\n            \"must change if the status code changes. In addition, it should change \"\n            \"when the substantive content of the concept map changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the concept map\",\n        description=(\n            \"A free text natural language description of the concept map from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this concept map is authored for \"\n            \"testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    group: typing.List[fhirtypes.ConceptMapGroupType] | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"Same source and target systems\",\n        description=\"A group of mappings that all have the same source and target system.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the concept map\",\n        description=(\n            \"A formal identifier that is used to identify this concept map when it \"\n            \"is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for concept map (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the concept map is intended to \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this concept map (computer friendly)\",\n        description=(\n            \"A natural language name identifying the concept map. This name should \"\n            \"be usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the concept \"\n            \"map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this concept map is defined\",\n        description=(\n            \"Explaination of why this concept map is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    sourceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sourceReference\",\n        title=\"Identifies the source of the concepts which are being mapped\",\n        description=(\n            \"The source value set that specifies the concepts that are being \" \"mapped.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n\n    sourceUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"sourceUri\",\n        title=\"Identifies the source of the concepts which are being mapped\",\n        description=(\n            \"The source value set that specifies the concepts that are being \" \"mapped.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n    sourceUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceUri\", title=\"Extension field for ``sourceUri``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this concept map. Enables tracking the life-cycle of the\"\n            \" content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    targetReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"targetReference\",\n        title=\"Provides context to the mappings\",\n        description=(\n            \"The target value set provides context to the mappings. Note that the \"\n            \"mapping is made between concepts, not between value sets, but the \"\n            \"value set provides important context about how the concept mapping \"\n            \"choices are made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n\n    targetUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"targetUri\",\n        title=\"Provides context to the mappings\",\n        description=(\n            \"The target value set provides context to the mappings. Note that the \"\n            \"mapping is made between concepts, not between value sets, but the \"\n            \"value set provides important context about how the concept mapping \"\n            \"choices are made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e target[x]\n            \"one_of_many\": \"target\",\n            \"one_of_many_required\": False,\n        },\n    )\n    targetUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_targetUri\", title=\"Extension field for ``targetUri``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this concept map (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the concept map.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this concept map (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this concept map when it is \"\n            \"referenced in a specification, model, design or an instance. This \"\n            \"SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at\"\n            \" which this concept map is (or will be) published. The URL SHOULD \"\n            \"include the major version of the concept map. For more information see\"\n            \" [Technical and Business Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate concept map instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the concept map\",\n        description=(\n            \"The identifier that is used to identify this version of the concept \"\n            \"map when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the concept map author\"\n            \" and is not expected to be globally unique. For example, it might be a\"\n            \" timestamp (e.g. yyyymmdd) if a managed version is not available. \"\n            \"There is also no expectation that versions can be placed in a \"\n            \"lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMap`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"sourceUri\",\n            \"sourceReference\",\n            \"targetUri\",\n            \"targetReference\",\n            \"group\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMap`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"sourceUri\",\n            \"sourceReference\",\n            \"targetUri\",\n            \"targetReference\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"source\": [\"sourceReference\", \"sourceUri\"],\n            \"target\": [\"targetReference\", \"targetUri\"],\n        }\n        return one_of_many_fields\n\n\nclass ConceptMapGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Same source and target systems.\n    A group of mappings that all have the same source and target system.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroup\"\n\n    element: typing.List[fhirtypes.ConceptMapGroupElementType] = Field(\n        default=...,\n        alias=\"element\",\n        title=\"Mappings for a concept from the source set\",\n        description=(\n            \"Mappings for an individual concept in the source to one or more \"\n            \"concepts in the target.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    source: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Code System (if value set crosses code systems)\",\n        description=(\n            \"An absolute URI that identifies the Code System (if the source is a \"\n            \"value set that crosses more than one code system).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    sourceVersion: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sourceVersion\",\n        title=\"Specific version of the  code system\",\n        description=(\n            \"The specific version of the code system, as determined by the code \"\n            \"system authority.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sourceVersion\",\n        title=\"Extension field for ``sourceVersion``.\",\n    )\n\n    target: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"System of the target (if necessary)\",\n        description=(\n            \"An absolute URI that identifies the code system of the target code (if\"\n            \" the target is a value set that cross code systems).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    target__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_target\", title=\"Extension field for ``target``.\"\n    )\n\n    targetVersion: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"targetVersion\",\n        title=\"Specific version of the  code system\",\n        description=(\n            \"The specific version of the code system, as determined by the code \"\n            \"system authority.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    targetVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_targetVersion\",\n        title=\"Extension field for ``targetVersion``.\",\n    )\n\n    unmapped: fhirtypes.ConceptMapGroupUnmappedType | None = Field(\n        default=None,\n        alias=\"unmapped\",\n        title=\"When no match in the mappings\",\n        description=\"What to do when there is no match in the mappings in the group.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"source\",\n            \"sourceVersion\",\n            \"target\",\n            \"targetVersion\",\n            \"element\",\n            \"unmapped\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConceptMapGroupElement(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Mappings for a concept from the source set.\n    Mappings for an individual concept in the source to one or more concepts in\n    the target.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupElement\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Identifies element being mapped\",\n        description=\"Identity (code or path) or the element/item being mapped.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Display for the code\",\n        description=(\n            \"The display for the code. The display is only provided to help editors\"\n            \" when editing the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    target: typing.List[fhirtypes.ConceptMapGroupElementTargetType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Concept in target system for element\",\n        description=\"A concept from the target value set that this concept maps to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"display\", \"target\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConceptMapGroupElementTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Concept in target system for element.\n    A concept from the target value set that this concept maps to.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupElementTarget\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies the target element\",\n        description=\"Identity (code or path) or the element/item that the map refers to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Description of status/issues in mapping\",\n        description=(\n            \"A description of status/issues in mapping that conveys additional \"\n            \"information not represented in  the structured data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    dependsOn: typing.List[\n        fhirtypes.ConceptMapGroupElementTargetDependsOnType\n    ] | None = Field(\n        default=None,\n        alias=\"dependsOn\",\n        title=\"Other elements required for this mapping (from context)\",\n        description=(\n            \"A set of additional dependencies for this mapping to hold. This \"\n            \"mapping is only applicable if the specified element can be resolved, \"\n            \"and it has the specified value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Display for the code\",\n        description=(\n            \"The display for the code. The display is only provided to help editors\"\n            \" when editing the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    equivalence: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"equivalence\",\n        title=(\n            \"relatedto | equivalent | equal | wider | subsumes | narrower | \"\n            \"specializes | inexact | unmatched | disjoint\"\n        ),\n        description=(\n            \"The equivalence between the source and target concepts (counting for \"\n            \"the dependencies and products). The equivalence is read from target to\"\n            \" source (e.g. the target is 'wider' than the source).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"relatedto\",\n                \"equivalent\",\n                \"equal\",\n                \"wider\",\n                \"subsumes\",\n                \"narrower\",\n                \"specializes\",\n                \"inexact\",\n                \"unmatched\",\n                \"disjoint\",\n            ],\n        },\n    )\n    equivalence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_equivalence\", title=\"Extension field for ``equivalence``.\"\n    )\n\n    product: typing.List[\n        fhirtypes.ConceptMapGroupElementTargetDependsOnType\n    ] | None = Field(\n        default=None,\n        alias=\"product\",\n        title=\"Other concepts that this mapping also produces\",\n        description=(\n            \"A set of additional outcomes from this mapping to other elements. To \"\n            \"properly execute this mapping, the specified element must be mapped to\"\n            \" some data element or source that is in context. The mapping may still\"\n            \" be useful without a place for the additional data elements, but the \"\n            \"equivalence cannot be relied on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupElementTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"display\",\n            \"equivalence\",\n            \"comment\",\n            \"dependsOn\",\n            \"product\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConceptMapGroupElementTargetDependsOn(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Other elements required for this mapping (from context).\n    A set of additional dependencies for this mapping to hold. This mapping is\n    only applicable if the specified element can be resolved, and it has the\n    specified value.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupElementTargetDependsOn\"\n\n    code: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Value of the referenced element\",\n        description=(\n            \"Identity (code or path) or the element/item/ValueSet that the map \"\n            \"depends on / refers to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Display for the code\",\n        description=(\n            \"The display for the code. The display is only provided to help editors\"\n            \" when editing the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    property: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Reference to property mapping depends on\",\n        description=(\n            \"A reference to an element that holds a coded value that corresponds to\"\n            \" a code system property. The idea is that the information model \"\n            \"carries an element somwhere that is labeled to correspond with a code \"\n            \"system property.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    property__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_property\", title=\"Extension field for ``property``.\"\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"Code System (if necessary)\",\n        description=(\n            \"An absolute URI that identifies the code system of the dependency code\"\n            \" (if the source/dependency is a value set that crosses code systems).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupElementTargetDependsOn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"property\",\n            \"system\",\n            \"code\",\n            \"display\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTargetDependsOn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"property\", \"property__ext\")]\n        return required_fields\n\n\nclass ConceptMapGroupUnmapped(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    When no match in the mappings.\n    What to do when there is no match in the mappings in the group.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupUnmapped\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Fixed code when mode = fixed\",\n        description=(\n            \"The fixed code to use when the mode = 'fixed'  - all unmapped codes \"\n            \"are mapped to a single fixed code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Display for the code\",\n        description=(\n            \"The display for the code. The display is only provided to help editors\"\n            \" when editing the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"provided | fixed | other-map\",\n        description=(\n            \"Defines which action to take if there is no match in the group. One of\"\n            \" 3 actions is possible: use the unmapped code (this is useful when \"\n            \"doing a mapping between versions, and only a few codes have changed), \"\n            \"use a fixed code (a default code), or alternatively, a reference to a \"\n            \"different concept map can be provided (by canonical URL).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"provided\", \"fixed\", \"other-map\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Canonical URL for other concept map\",\n        description=\"The canonical URL of the map to use if this map contains no mapping.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupUnmapped`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"mode\",\n            \"code\",\n            \"display\",\n            \"url\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupUnmapped`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/condition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Condition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Condition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Detailed information about conditions, problems or diagnoses.\n    A clinical condition, problem, diagnosis, or other event, situation, issue,\n    or clinical concept that has risen to a level of concern.\n    \"\"\"\n\n    __resource_type__ = \"Condition\"\n\n    abatementAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"abatementAge\",\n        title=\"If/when in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Conditions '\n            \"are never really resolved, but they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    abatementBoolean: bool | None = Field(\n        default=None,\n        alias=\"abatementBoolean\",\n        title=\"If/when in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Conditions '\n            \"are never really resolved, but they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n    abatementBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_abatementBoolean\",\n        title=\"Extension field for ``abatementBoolean``.\",\n    )\n\n    abatementDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"abatementDateTime\",\n        title=\"If/when in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Conditions '\n            \"are never really resolved, but they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n    abatementDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_abatementDateTime\",\n        title=\"Extension field for ``abatementDateTime``.\",\n    )\n\n    abatementPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"abatementPeriod\",\n        title=\"If/when in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Conditions '\n            \"are never really resolved, but they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    abatementRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"abatementRange\",\n        title=\"If/when in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Conditions '\n            \"are never really resolved, but they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    abatementString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"abatementString\",\n        title=\"If/when in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Conditions '\n            \"are never really resolved, but they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n    abatementString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_abatementString\",\n        title=\"Extension field for ``abatementString``.\",\n    )\n\n    assertedDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"assertedDate\",\n        title=\"Date record was believed accurate\",\n        description=(\n            \"The date on which the existance of the Condition was first asserted or\"\n            \" acknowledged.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    assertedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_assertedDate\",\n        title=\"Extension field for ``assertedDate``.\",\n    )\n\n    asserter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"asserter\",\n        title=\"Person who asserts this condition\",\n        description=\"Individual who is making the condition statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical location, if relevant\",\n        description=\"The anatomical location where this condition manifests itself.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"problem-list-item | encounter-diagnosis\",\n        description=\"A category assigned to the condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    clinicalStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"clinicalStatus\",\n        title=\"active | recurrence | inactive | remission | resolved\",\n        description=\"The clinical status of the condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"active\",\n                \"recurrence\",\n                \"inactive\",\n                \"remission\",\n                \"resolved\",\n            ],\n        },\n    )\n    clinicalStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_clinicalStatus\",\n        title=\"Extension field for ``clinicalStatus``.\",\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Identification of the condition, problem or diagnosis\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or episode when condition first asserted\",\n        description=\"Encounter during which the condition was first asserted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    evidence: typing.List[fhirtypes.ConditionEvidenceType] | None = Field(\n        default=None,\n        alias=\"evidence\",\n        title=\"Supporting evidence\",\n        description=(\n            \"Supporting Evidence / manifestations that are the basis on which this \"\n            \"condition is suspected or confirmed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this condition\",\n        description=(\n            \"This records identifiers associated with this condition that are \"\n            \"defined by business processes and/or used to refer to it when a direct\"\n            \" URL reference to the resource itself is not appropriate (e.g. in CDA \"\n            \"documents, or in written / printed documentation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional information about the Condition\",\n        description=(\n            \"Additional information about the Condition. This is a general \"\n            \"notes/comments entry  for description of the Condition, its diagnosis \"\n            \"and prognosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onsetAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"onsetAge\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"onsetDateTime\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_onsetDateTime\",\n        title=\"Extension field for ``onsetDateTime``.\",\n    )\n\n    onsetPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"onsetPeriod\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"onsetRange\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"onsetString\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onsetString\", title=\"Extension field for ``onsetString``.\"\n    )\n\n    severity: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"Subjective severity of condition\",\n        description=(\n            \"A subjective assessment of the severity of the condition as evaluated \"\n            \"by the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    stage: fhirtypes.ConditionStageType | None = Field(\n        default=None,\n        alias=\"stage\",\n        title=\"Stage/grade, usually assessed formally\",\n        description=(\n            \"Clinical stage or grade of a condition. May include formal severity \"\n            \"assessments.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who has the condition?\",\n        description=(\n            \"Indicates the patient or group who the condition record is associated \"\n            \"with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    verificationStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"verificationStatus\",\n        title=(\n            \"provisional | differential | confirmed | refuted | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=(\n            \"The verification status to support the clinical status of the \"\n            \"condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"provisional\",\n                \"differential\",\n                \"confirmed\",\n                \"refuted\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    verificationStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_verificationStatus\",\n        title=\"Extension field for ``verificationStatus``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Condition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"clinicalStatus\",\n            \"verificationStatus\",\n            \"category\",\n            \"severity\",\n            \"code\",\n            \"bodySite\",\n            \"subject\",\n            \"context\",\n            \"onsetDateTime\",\n            \"onsetAge\",\n            \"onsetPeriod\",\n            \"onsetRange\",\n            \"onsetString\",\n            \"abatementDateTime\",\n            \"abatementAge\",\n            \"abatementBoolean\",\n            \"abatementPeriod\",\n            \"abatementRange\",\n            \"abatementString\",\n            \"assertedDate\",\n            \"asserter\",\n            \"stage\",\n            \"evidence\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Condition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"clinicalStatus\",\n            \"verificationStatus\",\n            \"code\",\n            \"bodySite\",\n            \"subject\",\n            \"context\",\n            \"onsetDateTime\",\n            \"onsetAge\",\n            \"onsetPeriod\",\n            \"onsetRange\",\n            \"onsetString\",\n            \"assertedDate\",\n            \"asserter\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"abatement\": [\n                \"abatementAge\",\n                \"abatementBoolean\",\n                \"abatementDateTime\",\n                \"abatementPeriod\",\n                \"abatementRange\",\n                \"abatementString\",\n            ],\n            \"onset\": [\n                \"onsetAge\",\n                \"onsetDateTime\",\n                \"onsetPeriod\",\n                \"onsetRange\",\n                \"onsetString\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ConditionEvidence(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supporting evidence.\n    Supporting Evidence / manifestations that are the basis on which this\n    condition is suspected or confirmed.\n    \"\"\"\n\n    __resource_type__ = \"ConditionEvidence\"\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Manifestation/symptom\",\n        description=(\n            \"A manifestation or symptom that led to the recording of this \" \"condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Supporting information found elsewhere\",\n        description=\"Links to other relevant information, including pathology reports.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConditionEvidence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConditionEvidence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"detail\"]\n\n\nclass ConditionStage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stage/grade, usually assessed formally.\n    Clinical stage or grade of a condition. May include formal severity\n    assessments.\n    \"\"\"\n\n    __resource_type__ = \"ConditionStage\"\n\n    assessment: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"assessment\",\n        title=\"Formal record of assessment\",\n        description=(\n            \"Reference to a formal record of the evidence on which the staging \"\n            \"assessment is based.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"ClinicalImpression\",\n                \"DiagnosticReport\",\n                \"Observation\",\n            ],\n        },\n    )\n\n    summary: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"summary\",\n        title=\"Simple summary (disease specific)\",\n        description=(\n            'A simple summary of the stage such as \"Stage 3\". The determination of '\n            \"the stage is disease-specific.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConditionStage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"summary\", \"assessment\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConditionStage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/consent.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Consent\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Consent(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A healthcare consumer's policy choices to permits or denies recipients or\n    roles to perform actions for specific purposes and periods of time.\n    A record of a healthcare consumer’s policy choices, which permits or denies\n    identified recipient(s) or recipient role(s) to perform one or more actions\n    within a given policy context, for specific purposes and periods of time.\n    \"\"\"\n\n    __resource_type__ = \"Consent\"\n\n    action: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Actions controlled by this consent\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    actor: typing.List[fhirtypes.ConsentActorType] | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Who|what controlled by this consent (or group, by role)\",\n        description=(\n            \"Who or what is controlled by this consent. Use group to identify a set\"\n            \" of actors by some property they share (e.g. 'admitting officers').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classification of the consent statement - for indexing/retrieval\",\n        description=(\n            \"A classification of the type of consents found in the statement. This \"\n            \"element supports indexing and retrieval of consent statements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    consentingParty: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"consentingParty\",\n        title=\"Who is agreeing to the policy and exceptions\",\n        description=(\n            \"Either the Grantor, which is the entity responsible for granting the \"\n            \"rights listed in a Consent Directive or the Grantee, which is the \"\n            \"entity responsible for complying with the Consent Directive, including\"\n            \" any obligations or limitations on authorizations and enforcement of \"\n            \"prohibitions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    data: typing.List[fhirtypes.ConsentDataType] | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"Data controlled by this consent\",\n        description=(\n            \"The resources controlled by this consent, if specific resources are \"\n            \"referenced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dataPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"dataPeriod\",\n        title=\"Timeframe for data controlled by this consent\",\n        description=(\n            \"Clinical or Operational Relevant period of time that bounds the data \"\n            \"controlled by this consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateTime\",\n        title=\"When this Consent was created or indexed\",\n        description=\"When this  Consent was issued / created / indexed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    dateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dateTime\", title=\"Extension field for ``dateTime``.\"\n    )\n\n    except_fhir: typing.List[fhirtypes.ConsentExceptType] | None = Field(\n        default=None,\n        alias=\"except\",\n        title=\"Additional rule -  addition or removal of permissions\",\n        description=(\n            \"An exception to the base policy of this consent. An exception can be \"\n            \"an addition or removal of access permissions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier for this record (external references)\",\n        description=\"Unique identifier for this copy of the Consent Statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    organization: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Custodian of the consent\",\n        description=(\n            \"The organization that manages the consent, and the framework within \"\n            \"which it is executed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who the consent applies to\",\n        description=\"The patient/healthcare consumer to whom this consent applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period that this consent applies\",\n        description=\"Relevant time or time-period when this Consent is applicable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    policy: typing.List[fhirtypes.ConsentPolicyType] | None = Field(\n        default=None,\n        alias=\"policy\",\n        title=\"Policies covered by this consent\",\n        description=(\n            \"The references to the policies that are included in this consent \"\n            \"scope. Policies may be organizational, but are often defined \"\n            \"jurisdictionally, or in law.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    policyRule: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"policyRule\",\n        title=\"Policy that this consents to\",\n        description=\"A referece to the specific computable policy.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    policyRule__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_policyRule\", title=\"Extension field for ``policyRule``.\"\n    )\n\n    purpose: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Context of activities for which the agreement is made\",\n        description=(\n            \"The context of the activities a user is taking - why the user is \"\n            \"accessing the data - that are controlled by this consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Security Labels that define affected resources\",\n        description=(\n            \"A set of security labels that define which resources are controlled by\"\n            \" this consent. If more than one label is specified, all resources must\"\n            \" have all the specified labels.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sourceAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"sourceAttachment\",\n        title=\"Source from which this consent is taken\",\n        description=(\n            \"The source on which this consent statement is based. The source might \"\n            \"be a scanned original paper form, or a reference to a consent that \"\n            \"links back to such a source, a reference to a document repository \"\n            \"(e.g. XDS) that stores the original consent document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    sourceIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"sourceIdentifier\",\n        title=\"Source from which this consent is taken\",\n        description=(\n            \"The source on which this consent statement is based. The source might \"\n            \"be a scanned original paper form, or a reference to a consent that \"\n            \"links back to such a source, a reference to a document repository \"\n            \"(e.g. XDS) that stores the original consent document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    sourceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sourceReference\",\n        title=\"Source from which this consent is taken\",\n        description=(\n            \"The source on which this consent statement is based. The source might \"\n            \"be a scanned original paper form, or a reference to a consent that \"\n            \"links back to such a source, a reference to a document repository \"\n            \"(e.g. XDS) that stores the original consent document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Consent\",\n                \"DocumentReference\",\n                \"Contract\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | proposed | active | rejected | inactive | entered-in-error\",\n        description=\"Indicates the current state of this consent.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"proposed\",\n                \"active\",\n                \"rejected\",\n                \"inactive\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Consent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"patient\",\n            \"period\",\n            \"dateTime\",\n            \"consentingParty\",\n            \"actor\",\n            \"action\",\n            \"organization\",\n            \"sourceAttachment\",\n            \"sourceIdentifier\",\n            \"sourceReference\",\n            \"sourceReference\",\n            \"sourceReference\",\n            \"sourceReference\",\n            \"policy\",\n            \"policyRule\",\n            \"securityLabel\",\n            \"purpose\",\n            \"dataPeriod\",\n            \"data\",\n            \"except\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Consent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"patient\",\n            \"period\",\n            \"dateTime\",\n            \"consentingParty\",\n            \"actor\",\n            \"action\",\n            \"organization\",\n            \"sourceAttachment\",\n            \"sourceIdentifier\",\n            \"sourceReference\",\n            \"sourceReference\",\n            \"sourceReference\",\n            \"sourceReference\",\n            \"policyRule\",\n            \"securityLabel\",\n            \"purpose\",\n            \"dataPeriod\",\n            \"data\",\n            \"except\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"source\": [\"sourceAttachment\", \"sourceIdentifier\", \"sourceReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ConsentActor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who|what controlled by this consent (or group, by role).\n    Who or what is controlled by this consent. Use group to identify a set of\n    actors by some property they share (e.g. 'admitting officers').\n    \"\"\"\n\n    __resource_type__ = \"ConsentActor\"\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Resource for the actor (or group, by role)\",\n        description=(\n            \"The resource that identifies the actor. To identify a actors by type, \"\n            \"use group to identify a set of actors by some property they share \"\n            \"(e.g. 'admitting officers').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Group\",\n                \"CareTeam\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"role\",\n        title=\"How the actor is involved\",\n        description=(\n            \"How the individual is involved in the resources content that is \"\n            \"described in the consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConsentData(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Data controlled by this consent.\n    The resources controlled by this consent, if specific resources are\n    referenced.\n    \"\"\"\n\n    __resource_type__ = \"ConsentData\"\n\n    meaning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"meaning\",\n        title=\"instance | related | dependents | authoredby\",\n        description=(\n            \"How the resource reference is interpreted when testing consent \"\n            \"restrictions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"related\", \"dependents\", \"authoredby\"],\n        },\n    )\n    meaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_meaning\", title=\"Extension field for ``meaning``.\"\n    )\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"The actual data reference\",\n        description=(\n            \"A reference to a specific resource that defines which resources are \"\n            \"covered by this consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"meaning\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"meaning\", \"reference\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"meaning\", \"meaning__ext\")]\n        return required_fields\n\n\nclass ConsentExcept(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional rule -  addition or removal of permissions.\n    An exception to the base policy of this consent. An exception can be an\n    addition or removal of access permissions.\n    \"\"\"\n\n    __resource_type__ = \"ConsentExcept\"\n\n    action: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Actions controlled by this exception\",\n        description=\"Actions controlled by this Exception.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    actor: typing.List[fhirtypes.ConsentExceptActorType] | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Who|what controlled by this exception (or group, by role)\",\n        description=(\n            \"Who or what is controlled by this Exception. Use group to identify a \"\n            \"set of actors by some property they share (e.g. 'admitting officers').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    class_fhir: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"class\",\n        title=\"e.g. Resource Type, Profile, or CDA etc\",\n        description=(\n            \"The class of information covered by this exception. The type can be a \"\n            \"FHIR resource type, a profile on a type, or a CDA document, or some \"\n            \"other type that indicates what sort of information the consent relates\"\n            \" to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"e.g. LOINC or SNOMED CT code, etc in the content\",\n        description=\"If this code is found in an instance, then the exception applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    data: typing.List[fhirtypes.ConsentExceptDataType] | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"Data controlled by this exception\",\n        description=(\n            \"The resources controlled by this exception, if specific resources are \"\n            \"referenced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dataPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"dataPeriod\",\n        title=\"Timeframe for data controlled by this exception\",\n        description=(\n            \"Clinical or Operational Relevant period of time that bounds the data \"\n            \"controlled by this exception.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Timeframe for this exception\",\n        description=\"The timeframe in this exception is valid.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    purpose: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Context of activities covered by this exception\",\n        description=(\n            \"The context of the activities a user is taking - why the user is \"\n            \"accessing the data - that are controlled by this exception.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Security Labels that define affected resources\",\n        description=(\n            \"A set of security labels that define which resources are controlled by\"\n            \" this exception. If more than one label is specified, all resources \"\n            \"must have all the specified labels.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"deny | permit\",\n        description=(\n            \"Action  to take - permit or deny - when the exception conditions are \"\n            \"met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"deny\", \"permit\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentExcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"period\",\n            \"actor\",\n            \"action\",\n            \"securityLabel\",\n            \"purpose\",\n            \"class\",\n            \"code\",\n            \"dataPeriod\",\n            \"data\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentExcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"period\",\n            \"actor\",\n            \"action\",\n            \"securityLabel\",\n            \"purpose\",\n            \"class\",\n            \"code\",\n            \"dataPeriod\",\n            \"data\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass ConsentExceptActor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who|what controlled by this exception (or group, by role).\n    Who or what is controlled by this Exception. Use group to identify a set of\n    actors by some property they share (e.g. 'admitting officers').\n    \"\"\"\n\n    __resource_type__ = \"ConsentExceptActor\"\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Resource for the actor (or group, by role)\",\n        description=(\n            \"The resource that identifies the actor. To identify a actors by type, \"\n            \"use group to identify a set of actors by some property they share \"\n            \"(e.g. 'admitting officers').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Group\",\n                \"CareTeam\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"role\",\n        title=\"How the actor is involved\",\n        description=(\n            \"How the individual is involved in the resources content that is \"\n            \"described in the exception.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentExceptActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentExceptActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConsentExceptData(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Data controlled by this exception.\n    The resources controlled by this exception, if specific resources are\n    referenced.\n    \"\"\"\n\n    __resource_type__ = \"ConsentExceptData\"\n\n    meaning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"meaning\",\n        title=\"instance | related | dependents | authoredby\",\n        description=(\n            \"How the resource reference is interpreted when testing consent \"\n            \"restrictions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"related\", \"dependents\", \"authoredby\"],\n        },\n    )\n    meaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_meaning\", title=\"Extension field for ``meaning``.\"\n    )\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"The actual data reference\",\n        description=(\n            \"A reference to a specific resource that defines which resources are \"\n            \"covered by this consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentExceptData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"meaning\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentExceptData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"meaning\", \"reference\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"meaning\", \"meaning__ext\")]\n        return required_fields\n\n\nclass ConsentPolicy(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Policies covered by this consent.\n    The references to the policies that are included in this consent scope.\n    Policies may be organizational, but are often defined jurisdictionally, or\n    in law.\n    \"\"\"\n\n    __resource_type__ = \"ConsentPolicy\"\n\n    authority: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Enforcement source for policy\",\n        description=(\n            \"Entity or Organization having regulatory jurisdiction or \"\n            \"accountability for \\u00a0enforcing policies pertaining to Consent \"\n            \"Directives.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authority\", title=\"Extension field for ``authority``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Specific policy covered by this consent\",\n        description=(\n            \"The references to the policies that are included in this consent \"\n            \"scope. Policies may be organizational, but are often defined \"\n            \"jurisdictionally, or in law.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentPolicy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"authority\", \"uri\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentPolicy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/contactdetail.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ContactDetail\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass ContactDetail(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contact information.\n    Specifies contact information for a person or organization.\n    \"\"\"\n\n    __resource_type__ = \"ContactDetail\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of an individual to contact\",\n        description=\"The name of an individual to contact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contact details for individual or organization\",\n        description=(\n            \"The contact details for the individual (if a name was provided) or the\"\n            \" organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContactDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"name\", \"telecom\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContactDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"name\", \"telecom\"]\n"
  },
  {
    "path": "fhir/resources/STU3/contactpoint.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ContactPoint\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass ContactPoint(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of a Technology mediated contact point (phone, fax, email, etc.).\n    Details for all kinds of technology mediated contact points for a person or\n    organization, including telephone, email, etc.\n    \"\"\"\n\n    __resource_type__ = \"ContactPoint\"\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when the contact point was/is in use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    rank: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"rank\",\n        title=\"Specify preferred order of use (1 = highest)\",\n        description=(\n            \"Specifies a preferred order in which to use a set of contacts. \"\n            \"Contacts are ranked with lower values coming before higher values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rank\", title=\"Extension field for ``rank``.\"\n    )\n\n    system: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"phone | fax | email | pager | url | sms | other\",\n        description=(\n            \"Telecommunications form for contact point - what communications system\"\n            \" is required to make use of the contact.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"phone\", \"fax\", \"email\", \"pager\", \"url\", \"sms\", \"other\"],\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"home | work | temp | old | mobile - purpose of this contact point\",\n        description=\"Identifies the purpose for the contact point.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"home\", \"work\", \"temp\", \"old\", \"mobile\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The actual contact point details\",\n        description=(\n            \"The actual contact point details, in a form that is meaningful to the \"\n            \"designated communication system (i.e. phone number or email address).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContactPoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"system\", \"value\", \"use\", \"rank\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContactPoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"system\", \"value\", \"use\", \"rank\", \"period\"]\n"
  },
  {
    "path": "fhir/resources/STU3/contract.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Contract\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Contract(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Legal Agreement.\n    A formal agreement between parties regarding the conduct of business,\n    exchange of information or other matters.\n    \"\"\"\n\n    __resource_type__ = \"Contract\"\n\n    action: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Action stipulated by this Contract\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    actionReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"actionReason\",\n        title=\"Rationale for the stiplulated action\",\n        description=\"Reason for action stipulated by this Contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    agent: typing.List[fhirtypes.ContractAgentType] | None = Field(\n        default=None,\n        alias=\"agent\",\n        title=\"Entity being ascribed responsibility\",\n        description=(\n            \"An actor taking a role in an activity for which it can be assigned \"\n            \"some degree of responsibility for the activity taking place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    applies: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"applies\",\n        title=\"Effective time\",\n        description=\"Relevant time or time-period when this Contract is applicable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    authority: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Authority under which this Contract has standing\",\n        description=(\n            \"A formally or informally recognized grouping of people, principals, \"\n            \"organizations, or jurisdictions formed for the purpose of achieving \"\n            \"some form of collective action such as the promulgation, \"\n            \"administration and enforcement of contracts and policies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    bindingAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"bindingAttachment\",\n        title=\"Binding Contract\",\n        description=(\n            \"Legally binding Contract: This is the signed and legally recognized \"\n            'representation of the Contract, which is considered the \"source of '\n            'truth\" and which would be the basis for legal action related to '\n            \"enforcement of this Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e binding[x]\n            \"one_of_many\": \"binding\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    bindingReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"bindingReference\",\n        title=\"Binding Contract\",\n        description=(\n            \"Legally binding Contract: This is the signed and legally recognized \"\n            'representation of the Contract, which is considered the \"source of '\n            'truth\" and which would be the basis for legal action related to '\n            \"enforcement of this Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e binding[x]\n            \"one_of_many\": \"binding\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Composition\",\n                \"DocumentReference\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    contentDerivative: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"contentDerivative\",\n        title=\"Content derived from the basal information\",\n        description=(\n            \"The minimal content derived from the basal information source at a \"\n            \"specific stage in its lifecycle.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    decisionType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"decisionType\",\n        title=\"Decision by Grantor\",\n        description=(\n            \"The type of decision made by a grantor with respect to an offer made \"\n            \"by a grantee.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    domain: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"domain\",\n        title=\"Domain in which this Contract applies\",\n        description=(\n            \"Recognized governance framework or system operating with a \"\n            \"circumscribed scope in accordance with specified principles, policies,\"\n            \" processes or procedures for managing rights, actions, or behaviors of\"\n            \" parties or principals relative to resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    friendly: typing.List[fhirtypes.ContractFriendlyType] | None = Field(\n        default=None,\n        alias=\"friendly\",\n        title=\"Contract Friendly Language\",\n        description=(\n            'The \"patient friendly language\" versionof the Contract in whole or in '\n            'parts. \"Patient friendly language\" means the representation of the '\n            \"Contract and Contract Provisions in a manner that is readily \"\n            \"accessible and understandable by a layperson in accordance with best \"\n            \"practices for communication styles that ensure that those agreeing to \"\n            \"or signing the Contract understand the roles, actions, obligations, \"\n            \"responsibilities, and implication of the agreement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Contract number\",\n        description=\"Unique identifier for this Contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"When this Contract was issued\",\n        description=\"When this  Contract was issued.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    legal: typing.List[fhirtypes.ContractLegalType] | None = Field(\n        default=None,\n        alias=\"legal\",\n        title=\"Contract Legal Language\",\n        description=\"List of Legal expressions or representations of this Contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rule: typing.List[fhirtypes.ContractRuleType] | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"Computable Contract Language\",\n        description=(\n            \"List of Computable Policy Rule Language Representations of this \"\n            \"Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Security Labels that define affected resources\",\n        description=(\n            \"A set of security labels that define which resources are controlled by\"\n            \" this consent. If more than one label is specified, all resources must\"\n            \" have all the specified labels.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    signer: typing.List[fhirtypes.ContractSignerType] | None = Field(\n        default=None,\n        alias=\"signer\",\n        title=\"Contract Signatory\",\n        description=(\n            \"Parties with legal standing in the Contract, including the principal \"\n            \"parties, the grantor(s) and grantee(s), which are any person or \"\n            \"organization bound by the contract, and any ancillary parties, which \"\n            \"facilitate the execution of the contract such as a notary or witness.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"amended | appended | cancelled | disputed | entered-in-error | \"\n            \"executable | executed | negotiable | offered | policy | rejected | \"\n            \"renewed | revoked | resolved | terminated\"\n        ),\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"amended\",\n                \"appended\",\n                \"cancelled\",\n                \"disputed\",\n                \"entered-in-error\",\n                \"executable\",\n                \"executed\",\n                \"negotiable\",\n                \"offered\",\n                \"policy\",\n                \"rejected\",\n                \"renewed\",\n                \"revoked\",\n                \"resolved\",\n                \"terminated\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"Subtype within the context of type\",\n        description=(\n            \"More specific type or specialization of an overarching or more general\"\n            \" contract such as auto insurance, home owner  insurance, prenupial \"\n            \"agreement, Advanced-Directive, or privacy consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Contract Target Entity\",\n        description=(\n            \"The target entity impacted by or of interest to parties to the \"\n            \"agreement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    term: typing.List[fhirtypes.ContractTermType] | None = Field(\n        default=None,\n        alias=\"term\",\n        title=\"Contract Term List\",\n        description=(\n            \"One or more Contract Provisions, which may be related and conveyed as \"\n            \"a group, and may contain nested groups.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    topic: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"Context of the Contract\",\n        description=\"The matter of concern in the context of this agreement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type or form\",\n        description=(\n            \"Type of Contract such as an insurance policy, real estate contract, a \"\n            \"will, power of attorny, Privacy or Security policy , trust framework \"\n            \"agreement, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valuedItem: typing.List[fhirtypes.ContractValuedItemType] | None = Field(\n        default=None,\n        alias=\"valuedItem\",\n        title=\"Contract Valued Item List\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Contract`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"issued\",\n            \"applies\",\n            \"subject\",\n            \"topic\",\n            \"authority\",\n            \"domain\",\n            \"type\",\n            \"subType\",\n            \"action\",\n            \"actionReason\",\n            \"decisionType\",\n            \"contentDerivative\",\n            \"securityLabel\",\n            \"agent\",\n            \"signer\",\n            \"valuedItem\",\n            \"term\",\n            \"bindingAttachment\",\n            \"bindingReference\",\n            \"bindingReference\",\n            \"bindingReference\",\n            \"friendly\",\n            \"legal\",\n            \"rule\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Contract`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"issued\",\n            \"applies\",\n            \"subject\",\n            \"topic\",\n            \"type\",\n            \"subType\",\n            \"securityLabel\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"binding\": [\"bindingAttachment\", \"bindingReference\"]}\n        return one_of_many_fields\n\n\nclass ContractAgent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Entity being ascribed responsibility.\n    An actor taking a role in an activity for which it can be assigned some\n    degree of responsibility for the activity taking place.\n    \"\"\"\n\n    __resource_type__ = \"ContractAgent\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Contract Agent Type\",\n        description=\"Who or what parties are assigned roles in this Contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Contract\",\n                \"Device\",\n                \"Group\",\n                \"Location\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Substance\",\n            ],\n        },\n    )\n\n    role: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Role type of the agent\",\n        description=\"Role type of agent assigned roles in this Contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"actor\", \"role\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractFriendly(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Friendly Language.\n    The \"patient friendly language\" versionof the Contract in whole or in\n    parts. \"Patient friendly language\" means the representation of the Contract\n    and Contract Provisions in a manner that is readily accessible and\n    understandable by a layperson in accordance with best practices for\n    communication styles that ensure that those agreeing to or signing the\n    Contract understand the roles, actions, obligations, responsibilities, and\n    implication of the agreement.\n    \"\"\"\n\n    __resource_type__ = \"ContractFriendly\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Easily comprehended representation of this Contract\",\n        description=(\n            \"Human readable rendering of this Contract in a format and \"\n            \"representation intended to enhance comprehension and ensure \"\n            \"understandability.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Easily comprehended representation of this Contract\",\n        description=(\n            \"Human readable rendering of this Contract in a format and \"\n            \"representation intended to enhance comprehension and ensure \"\n            \"understandability.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Composition\",\n                \"DocumentReference\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractFriendly`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentAttachment\",\n            \"contentReference\",\n            \"contentReference\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractFriendly`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"content\": [\"contentAttachment\", \"contentReference\"]}\n        return one_of_many_fields\n\n\nclass ContractLegal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Legal Language.\n    List of Legal expressions or representations of this Contract.\n    \"\"\"\n\n    __resource_type__ = \"ContractLegal\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Contract Legal Text\",\n        description=\"Contract legal text in human renderable form.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Contract Legal Text\",\n        description=\"Contract legal text in human renderable form.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Composition\",\n                \"DocumentReference\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractLegal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentAttachment\",\n            \"contentReference\",\n            \"contentReference\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractLegal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"content\": [\"contentAttachment\", \"contentReference\"]}\n        return one_of_many_fields\n\n\nclass ContractRule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Computable Contract Language.\n    List of Computable Policy Rule Language Representations of this Contract.\n    \"\"\"\n\n    __resource_type__ = \"ContractRule\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Computable Contract Rules\",\n        description=(\n            \"Computable Contract conveyed using a policy rule language (e.g. XACML,\"\n            \" DKAL, SecPal).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Computable Contract Rules\",\n        description=(\n            \"Computable Contract conveyed using a policy rule language (e.g. XACML,\"\n            \" DKAL, SecPal).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentAttachment\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"content\": [\"contentAttachment\", \"contentReference\"]}\n        return one_of_many_fields\n\n\nclass ContractSigner(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Signatory.\n    Parties with legal standing in the Contract, including the principal\n    parties, the grantor(s) and grantee(s), which are any person or\n    organization bound by the contract, and any ancillary parties, which\n    facilitate the execution of the contract such as a notary or witness.\n    \"\"\"\n\n    __resource_type__ = \"ContractSigner\"\n\n    party: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"party\",\n        title=\"Contract Signatory Party\",\n        description=\"Party which is a signator to this Contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    signature: typing.List[fhirtypes.SignatureType] = Field(\n        default=...,\n        alias=\"signature\",\n        title=\"Contract Documentation Signature\",\n        description=\"Legally binding Contract DSIG signature contents in Base64.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Contract Signatory Role\",\n        description=\"Role of this Contract signer, e.g. notary, grantee.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractSigner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"party\", \"signature\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractSigner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractTerm(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Term List.\n    One or more Contract Provisions, which may be related and conveyed as a\n    group, and may contain nested groups.\n    \"\"\"\n\n    __resource_type__ = \"ContractTerm\"\n\n    action: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Contract Term Activity\",\n        description=\"Action stipulated by this Contract Provision.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    actionReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"actionReason\",\n        title=\"Purpose for the Contract Term Action\",\n        description=(\n            \"Reason or purpose for the action stipulated by this Contract \" \"Provision.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    agent: typing.List[fhirtypes.ContractTermAgentType] | None = Field(\n        default=None,\n        alias=\"agent\",\n        title=\"Contract Term Agent List\",\n        description=(\n            \"An actor taking a role in an activity for which it can be assigned \"\n            \"some degree of responsibility for the activity taking place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    applies: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"applies\",\n        title=\"Contract Term Effective Time\",\n        description=(\n            \"Relevant time or time-period when this Contract Provision is \"\n            \"applicable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    group: typing.List[fhirtypes.ContractTermType] | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"Nested Contract Term Group\",\n        description=\"Nested group of Contract Provisions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Contract Term Number\",\n        description=\"Unique identifier for this particular Contract Provision.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"Contract Term Issue Date Time\",\n        description=\"When this Contract Provision was issued.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    securityLabel: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Security Labels that define affected terms\",\n        description=(\n            \"A set of security labels that define which terms are controlled by \"\n            \"this condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"Contract Term Type specific classification\",\n        description=(\n            \"Subtype of this Contract Provision, e.g. life time maximum payment for\"\n            \" a contract term for specific valued item, e.g. disability payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Human readable Contract term text\",\n        description=\"Human readable form of this Contract Provision.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    topic: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"Context of the Contract term\",\n        description=(\n            \"The matter of concern in the context of this provision of the \" \"agrement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Contract Term Type or Form\",\n        description=(\n            \"Type of Contract Provision such as specific requirements, purposes for\"\n            \" actions, obligations, prohibitions, e.g. life time maximum benefit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valuedItem: typing.List[fhirtypes.ContractTermValuedItemType] | None = Field(\n        default=None,\n        alias=\"valuedItem\",\n        title=\"Contract Term Valued Item List\",\n        description=\"Contract Provision Valued Item List.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTerm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"issued\",\n            \"applies\",\n            \"type\",\n            \"subType\",\n            \"topic\",\n            \"action\",\n            \"actionReason\",\n            \"securityLabel\",\n            \"agent\",\n            \"text\",\n            \"valuedItem\",\n            \"group\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTerm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"identifier\",\n            \"issued\",\n            \"applies\",\n            \"topic\",\n            \"securityLabel\",\n        ]\n\n\nclass ContractTermAgent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Term Agent List.\n    An actor taking a role in an activity for which it can be assigned some\n    degree of responsibility for the activity taking place.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermAgent\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Contract Term Agent Subject\",\n        description=\"The agent assigned a role in this Contract Provision.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Contract\",\n                \"Device\",\n                \"Group\",\n                \"Location\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Substance\",\n            ],\n        },\n    )\n\n    role: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Type of the Contract Term Agent\",\n        description=(\n            \"Role played by the agent assigned this role in the execution of this \"\n            \"Contract Provision.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"actor\", \"role\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractTermValuedItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Term Valued Item List.\n    Contract Provision Valued Item List.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermValuedItem\"\n\n    effectiveTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveTime\",\n        title=\"Contract Term Valued Item Effective Tiem\",\n        description=(\n            \"Indicates the time during which this Contract Term ValuedItem \"\n            \"information is effective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    effectiveTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveTime\",\n        title=\"Extension field for ``effectiveTime``.\",\n    )\n\n    entityCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"entityCodeableConcept\",\n        title=\"Contract Term Valued Item Type\",\n        description=\"Specific type of Contract Provision Valued Item that may be priced.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e entity[x]\n            \"one_of_many\": \"entity\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    entityReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"entityReference\",\n        title=\"Contract Term Valued Item Type\",\n        description=\"Specific type of Contract Provision Valued Item that may be priced.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e entity[x]\n            \"one_of_many\": \"entity\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Contract Term Valued Item Price Scaling Factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of the Contract Provision Valued Item delivered. The \"\n            \"concept of a Factor allows for a discount or surcharge multiplier to \"\n            \"be applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Contract Term Valued Item Number\",\n        description=\"Identifies a Contract Provision Valued Item instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total Contract Term Valued Item Value\",\n        description=(\n            \"Expresses the product of the Contract Provision Valued Item \"\n            \"unitQuantity and the unitPriceAmt. For example, the formula: unit \"\n            \"Quantity * unit Price (Cost per Point) * factor Number  * points = net\"\n            \" Amount. Quantity, factor and points are assumed to be 1 if not \"\n            \"supplied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    points: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"points\",\n        title=\"Contract Term Valued Item Difficulty Scaling Factor\",\n        description=(\n            \"An amount that expresses the weighting (based on difficulty, cost \"\n            \"and/or resource intensiveness) associated with the Contract Provision \"\n            \"Valued Item delivered. The concept of Points allows for assignment of \"\n            \"point values for a Contract ProvisionValued Item, such that a monetary\"\n            \" amount can be assigned to each point.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    points__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_points\", title=\"Extension field for ``points``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Contract Term Valued Item Count\",\n        description=(\n            \"Specifies the units by which the Contract Provision Valued Item is \"\n            \"measured or counted, and quantifies the countable or measurable \"\n            \"Contract Term Valued Item instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Contract Term Valued Item fee, charge, or cost\",\n        description=\"A Contract Provision Valued Item unit valuation measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermValuedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"entityCodeableConcept\",\n            \"entityReference\",\n            \"identifier\",\n            \"effectiveTime\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"points\",\n            \"net\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermValuedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"entity\": [\"entityCodeableConcept\", \"entityReference\"]}\n        return one_of_many_fields\n\n\nclass ContractValuedItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Valued Item List.\n    \"\"\"\n\n    __resource_type__ = \"ContractValuedItem\"\n\n    effectiveTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveTime\",\n        title=\"Contract Valued Item Effective Tiem\",\n        description=(\n            \"Indicates the time during which this Contract ValuedItem information \"\n            \"is effective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    effectiveTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveTime\",\n        title=\"Extension field for ``effectiveTime``.\",\n    )\n\n    entityCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"entityCodeableConcept\",\n        title=\"Contract Valued Item Type\",\n        description=\"Specific type of Contract Valued Item that may be priced.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e entity[x]\n            \"one_of_many\": \"entity\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    entityReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"entityReference\",\n        title=\"Contract Valued Item Type\",\n        description=\"Specific type of Contract Valued Item that may be priced.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e entity[x]\n            \"one_of_many\": \"entity\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Contract Valued Item Price Scaling Factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of the Contract Valued Item delivered. The concept of a \"\n            \"Factor allows for a discount or surcharge multiplier to be applied to \"\n            \"a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Contract Valued Item Number\",\n        description=\"Identifies a Contract Valued Item instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total Contract Valued Item Value\",\n        description=(\n            \"Expresses the product of the Contract Valued Item unitQuantity and the\"\n            \" unitPriceAmt. For example, the formula: unit Quantity * unit Price \"\n            \"(Cost per Point) * factor Number  * points = net Amount. Quantity, \"\n            \"factor and points are assumed to be 1 if not supplied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    points: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"points\",\n        title=\"Contract Valued Item Difficulty Scaling Factor\",\n        description=(\n            \"An amount that expresses the weighting (based on difficulty, cost \"\n            \"and/or resource intensiveness) associated with the Contract Valued \"\n            \"Item delivered. The concept of Points allows for assignment of point \"\n            \"values for a Contract Valued Item, such that a monetary amount can be \"\n            \"assigned to each point.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    points__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_points\", title=\"Extension field for ``points``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of Contract Valued Items\",\n        description=(\n            \"Specifies the units by which the Contract Valued Item is measured or \"\n            \"counted, and quantifies the countable or measurable Contract Valued \"\n            \"Item instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Contract Valued Item fee, charge, or cost\",\n        description=\"A Contract Valued Item unit valuation measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractValuedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"entityCodeableConcept\",\n            \"entityReference\",\n            \"identifier\",\n            \"effectiveTime\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"points\",\n            \"net\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractValuedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"entity\": [\"entityCodeableConcept\", \"entityReference\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/contributor.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Contributor\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Contributor(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contributor information.\n    A contributor to the content of a knowledge asset, including authors,\n    editors, reviewers, and endorsers.\n    \"\"\"\n\n    __resource_type__ = \"Contributor\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details of the contributor\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" contributor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Who contributed the content\",\n        description=(\n            \"The name of the individual or organization responsible for the \"\n            \"contribution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"author | editor | reviewer | endorser\",\n        description=\"The type of contributor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"author\", \"editor\", \"reviewer\", \"endorser\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Contributor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"type\", \"name\", \"contact\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Contributor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"type\", \"name\", \"contact\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/count.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Count\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Count(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A measured or measurable amount.\n    A measured amount (or an amount that can potentially be measured). Note\n    that measured amounts include amounts that are not precisely quantified,\n    including amounts involving arbitrary units and floating currencies.\n    \"\"\"\n\n    __resource_type__ = \"Count\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Count`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Count`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/STU3/coverage.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Coverage\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Coverage(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurance or medical plan or a payment agreement.\n    Financial instrument which may be used to reimburse or pay for health care\n    products and services.\n    \"\"\"\n\n    __resource_type__ = \"Coverage\"\n\n    beneficiary: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"beneficiary\",\n        title=\"Plan Beneficiary\",\n        description=(\n            \"The party who benefits from the insurance coverage., the patient when \"\n            \"services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    contract: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"contract\",\n        title=\"Contract details\",\n        description=\"The policy(s) which constitute this insurance coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Contract\"],\n        },\n    )\n\n    dependent: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"dependent\",\n        title=\"Dependent number\",\n        description=\"A unique identifier for a dependent under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    dependent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dependent\", title=\"Extension field for ``dependent``.\"\n    )\n\n    grouping: fhirtypes.CoverageGroupingType | None = Field(\n        default=None,\n        alias=\"grouping\",\n        title=\"Additional coverage classifications\",\n        description=(\n            \"A suite of underwrite specific classifiers, for example may be used to\"\n            \" identify a class of coverage or employer group, Policy, Plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"The primary coverage ID\",\n        description=(\n            \"The main (and possibly only) identifier for the coverage - often \"\n            \"referred to as a Member Id, Certificate number, Personal Health Number\"\n            \" or Case ID. May be constructed as the concatination of the \"\n            \"Coverage.SubscriberID and the Coverage.dependant.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    network: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"Insurer network\",\n        description=(\n            \"The insurer-specific identifier for the insurer-defined network of \"\n            \"providers to which the beneficiary may seek treatment which will be \"\n            \"covered at the 'in-network' rate, otherwise 'out of network' terms and\"\n            \" conditions apply.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    network__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_network\", title=\"Extension field for ``network``.\"\n    )\n\n    order: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"order\",\n        title=\"Relative order of the coverage\",\n        description=(\n            \"The order of applicability of this coverage relative to other \"\n            \"coverages which are currently inforce. Note, there may be gaps in the \"\n            \"numbering and this does not imply primary, secondard etc. as the \"\n            \"specific positioning of coverages depends upon the episode of care.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    order__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_order\", title=\"Extension field for ``order``.\"\n    )\n\n    payor: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"payor\",\n        title=\"Identifier for the plan or agreement issuer\",\n        description=(\n            \"The program or plan underwriter or payor including both insurance and \"\n            \"non-insurance agreements, such as patient-pay agreements. May provide \"\n            \"multiple identifiers such as insurance company identifier or business \"\n            \"identifier (BIN number).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Coverage start and end dates\",\n        description=(\n            \"Time period during which the coverage is in force. A missing start \"\n            \"date indicates the start date isn't known, a missing end date means \"\n            \"the coverage is continuing to be in force.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    policyHolder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"policyHolder\",\n        title=\"Owner of the policy\",\n        description=(\n            \"The party who 'owns' the insurance policy,  may be an individual, \"\n            \"corporation or the subscriber's employer.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\", \"Organization\"],\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"Beneficiary relationship to the Subscriber\",\n        description=\"The relationship of beneficiary (patient) to the subscriber.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"The plan instance or sequence counter\",\n        description=(\n            \"An optional counter for a particular instance of the identified \"\n            \"coverage which increments upon each renewal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subscriber: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subscriber\",\n        title=\"Subscriber to the policy\",\n        description=(\n            \"The party who has signed-up for or 'owns' the contractual relationship\"\n            \" to the policy or to whom the benefit of the policy for services \"\n            \"rendered to them or their family is due.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    subscriberId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subscriberId\",\n        title=\"ID assigned to the Subscriber\",\n        description=\"The insurer assigned ID for the Subscriber.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subscriberId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subscriberId\",\n        title=\"Extension field for ``subscriberId``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of coverage such as medical or accident\",\n        description=(\n            \"The type of coverage: social program, medical plan, accident coverage \"\n            \"(workers compensation, auto), group health or payment by an individual\"\n            \" or organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Coverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"policyHolder\",\n            \"subscriber\",\n            \"subscriberId\",\n            \"beneficiary\",\n            \"relationship\",\n            \"period\",\n            \"payor\",\n            \"grouping\",\n            \"dependent\",\n            \"sequence\",\n            \"order\",\n            \"network\",\n            \"contract\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Coverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"policyHolder\",\n            \"subscriber\",\n            \"subscriberId\",\n            \"beneficiary\",\n            \"period\",\n            \"payor\",\n            \"dependent\",\n            \"sequence\",\n            \"order\",\n            \"network\",\n        ]\n\n\nclass CoverageGrouping(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional coverage classifications.\n    A suite of underwrite specific classifiers, for example may be used to\n    identify a class of coverage or employer group, Policy, Plan.\n    \"\"\"\n\n    __resource_type__ = \"CoverageGrouping\"\n\n    classDisplay: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"classDisplay\",\n        title=\"Display text for the class\",\n        description=\"A short description for the class.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    classDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_classDisplay\",\n        title=\"Extension field for ``classDisplay``.\",\n    )\n\n    class_fhir: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"class\",\n        title=\"An identifier for the class\",\n        description=(\n            \"Identifies a style or collective of coverage issues by the \"\n            \"underwriter, for example may be used to identify a class of coverage \"\n            \"such as a level of deductables or co-payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    class__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_class\", title=\"Extension field for ``class_fhir``.\"\n    )\n\n    group: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"An identifier for the group\",\n        description=(\n            \"Identifies a style or collective of coverage issued by the \"\n            \"underwriter, for example may be used to identify an employer group. \"\n            \"May also be referred to as a Policy or Group ID.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    group__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_group\", title=\"Extension field for ``group``.\"\n    )\n\n    groupDisplay: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"groupDisplay\",\n        title=\"Display text for an identifier for the group\",\n        description=\"A short description for the group.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    groupDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_groupDisplay\",\n        title=\"Extension field for ``groupDisplay``.\",\n    )\n\n    plan: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"plan\",\n        title=\"An identifier for the plan\",\n        description=(\n            \"Identifies a style or collective of coverage issued by the \"\n            \"underwriter, for example may be used to identify a collection of \"\n            \"benefits provided to employees. May be referred to as a Section or \"\n            \"Division ID.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    plan__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_plan\", title=\"Extension field for ``plan``.\"\n    )\n\n    planDisplay: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"planDisplay\",\n        title=\"Display text for the plan\",\n        description=\"A short description for the plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    planDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_planDisplay\", title=\"Extension field for ``planDisplay``.\"\n    )\n\n    subClass: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subClass\",\n        title=\"An identifier for the subsection of the class\",\n        description=(\n            \"Identifies a sub-style or sub-collective of coverage issues by the \"\n            \"underwriter, for example may be used to identify a subclass of \"\n            \"coverage such as a sub-level of deductables or co-payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subClass__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subClass\", title=\"Extension field for ``subClass``.\"\n    )\n\n    subClassDisplay: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subClassDisplay\",\n        title=\"Display text for the subsection of the subclass\",\n        description=\"A short description for the subclass.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subClassDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subClassDisplay\",\n        title=\"Extension field for ``subClassDisplay``.\",\n    )\n\n    subGroup: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subGroup\",\n        title=\"An identifier for the subsection of the group\",\n        description=(\n            \"Identifies a style or collective of coverage issued by the \"\n            \"underwriter, for example may be used to identify a subset of an \"\n            \"employer group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subGroup__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subGroup\", title=\"Extension field for ``subGroup``.\"\n    )\n\n    subGroupDisplay: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subGroupDisplay\",\n        title=\"Display text for the subsection of the group\",\n        description=\"A short description for the subgroup.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subGroupDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subGroupDisplay\",\n        title=\"Extension field for ``subGroupDisplay``.\",\n    )\n\n    subPlan: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subPlan\",\n        title=\"An identifier for the subsection of the plan\",\n        description=(\n            \"Identifies a sub-style or sub-collective of coverage issued by the \"\n            \"underwriter, for example may be used to identify a subset of a \"\n            \"collection of benefits provided to employees.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subPlan__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subPlan\", title=\"Extension field for ``subPlan``.\"\n    )\n\n    subPlanDisplay: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subPlanDisplay\",\n        title=\"Display text for the subsection of the plan\",\n        description=\"A short description for the subplan.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subPlanDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subPlanDisplay\",\n        title=\"Extension field for ``subPlanDisplay``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageGrouping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"group\",\n            \"groupDisplay\",\n            \"subGroup\",\n            \"subGroupDisplay\",\n            \"plan\",\n            \"planDisplay\",\n            \"subPlan\",\n            \"subPlanDisplay\",\n            \"class\",\n            \"classDisplay\",\n            \"subClass\",\n            \"subClassDisplay\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageGrouping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"group\",\n            \"groupDisplay\",\n            \"subGroup\",\n            \"subGroupDisplay\",\n            \"plan\",\n            \"planDisplay\",\n            \"subPlan\",\n            \"subPlanDisplay\",\n            \"class\",\n            \"classDisplay\",\n            \"subClass\",\n            \"subClassDisplay\",\n        ]\n"
  },
  {
    "path": "fhir/resources/STU3/dataelement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DataElement\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DataElement(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource data element.\n    The formal description of a single piece of information that can be\n    gathered and reported.\n    \"\"\"\n\n    __resource_type__ = \"DataElement\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the data element and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the data element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the data element was published. \"\n            \"The date must change if and when the business version changes and it \"\n            \"must change if the status code changes. In addition, it should change \"\n            \"when the substantive content of the data element changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    element: typing.List[fhirtypes.ElementDefinitionType] = Field(\n        default=...,\n        alias=\"element\",\n        title=\"Definition of element\",\n        description=(\n            \"Defines the structure, type, allowed values and other constraining \"\n            \"characteristics of the data element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this data element is authored for \"\n            \"testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the data element\",\n        description=(\n            \"A formal identifier that is used to identify this data element when it\"\n            \" is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for data element (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the data element is intended to \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    mapping: typing.List[fhirtypes.DataElementMappingType] | None = Field(\n        default=None,\n        alias=\"mapping\",\n        title=\"External specification mapped to\",\n        description=(\n            \"Identifies a specification (other than a terminology) that the \"\n            \"elements which make up the DataElement have some correspondence with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this data element (computer friendly)\",\n        description=(\n            \"A natural language name identifying the data element. This name should\"\n            \" be usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the data \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this data element. Enables tracking the life-cycle of \"\n            \"the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    stringency: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"stringency\",\n        title=(\n            \"comparable | fully-specified | equivalent | convertable | scaleable | \"\n            \"flexible\"\n        ),\n        description=\"Identifies how precise the data element is in its definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"comparable\",\n                \"fully-specified\",\n                \"equivalent\",\n                \"convertable\",\n                \"scaleable\",\n                \"flexible\",\n            ],\n        },\n    )\n    stringency__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_stringency\", title=\"Extension field for ``stringency``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this data element (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the data element.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this data element (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this data element when it is \"\n            \"referenced in a specification, model, design or an instance. This \"\n            \"SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at\"\n            \" which this data element is (or will be) published. The URL SHOULD \"\n            \"include the major version of the data element. For more information \"\n            \"see [Technical and Business Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate data element instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the data element\",\n        description=(\n            \"The identifier that is used to identify this version of the data \"\n            \"element when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the data element \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"name\",\n            \"title\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"copyright\",\n            \"stringency\",\n            \"mapping\",\n            \"element\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"name\",\n            \"title\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"stringency\",\n            \"element\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass DataElementMapping(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    External specification mapped to.\n    Identifies a specification (other than a terminology) that the elements\n    which make up the DataElement have some correspondence with.\n    \"\"\"\n\n    __resource_type__ = \"DataElementMapping\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Versions, issues, scope limitations, etc.\",\n        description=(\n            \"Comments about this mapping, including version notes, issues, scope \"\n            \"limitations, and other important notes for usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    identity: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"identity\",\n        title=\"Internal id when this mapping is used\",\n        description=(\n            \"An internal id that is used to identify this mapping set when specific\"\n            \" mappings are made on a per-element basis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_identity\", title=\"Extension field for ``identity``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Names what this mapping refers to\",\n        description=\"A name for the specification that is being mapped to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Identifies what this mapping refers to\",\n        description=(\n            \"An absolute URI that identifies the specification that this mapping is\"\n            \" expressed to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataElementMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identity\",\n            \"uri\",\n            \"name\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataElementMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"identity\", \"identity__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/datarequirement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DataRequirement\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass DataRequirement(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes a required data item.\n    Describes a required data item for evaluation in terms of the type of data,\n    and optional code or date-based filters of the data.\n    \"\"\"\n\n    __resource_type__ = \"DataRequirement\"\n\n    codeFilter: typing.List[fhirtypes.DataRequirementCodeFilterType] | None = Field(\n        default=None,\n        alias=\"codeFilter\",\n        title=\"What codes are expected\",\n        description=(\n            \"Code filters specify additional constraints on the data, specifying \"\n            \"the value set of interest for a particular element of the data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dateFilter: typing.List[fhirtypes.DataRequirementDateFilterType] | None = Field(\n        default=None,\n        alias=\"dateFilter\",\n        title=\"What dates/date ranges are expected\",\n        description=(\n            \"Date filters specify additional constraints on the data in terms of \"\n            \"the applicable date range for specific elements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    mustSupport: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"mustSupport\",\n        title=(\n            \"Indicates that specific structure elements are referenced by the \"\n            \"knowledge module\"\n        ),\n        description=(\n            \"Indicates that specific elements of the type are referenced by the \"\n            \"knowledge module and must be supported by the consumer in order to \"\n            \"obtain an effective evaluation. This does not mean that a value is \"\n            \"required for this element, only that the consuming system must \"\n            \"understand the element and be able to provide values for it if they \"\n            \"are available. Note that the value for this element can be a path to \"\n            \"allow references to nested elements. In that case, all the elements \"\n            \"along the path must be supported.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    mustSupport__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_mustSupport\", title=\"Extension field for ``mustSupport``.\"\n    )\n\n    profile: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"The profile of the required data\",\n        description=(\n            \"The profile of the required data, specified as the uri of the profile \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    profile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of the required data\",\n        description=(\n            \"The type of the required data, specified as the type name of a \"\n            \"resource. For profiles, this value is set to the type of the base \"\n            \"resource of the profile.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataRequirement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"profile\",\n            \"mustSupport\",\n            \"codeFilter\",\n            \"dateFilter\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataRequirement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"type\", \"profile\", \"mustSupport\", \"codeFilter\", \"dateFilter\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass DataRequirementCodeFilter(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What codes are expected.\n    Code filters specify additional constraints on the data, specifying the\n    value set of interest for a particular element of the data.\n    \"\"\"\n\n    __resource_type__ = \"DataRequirementCodeFilter\"\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"The code-valued attribute of the filter\",\n        description=(\n            \"The code-valued attribute of the filter. The specified path must be \"\n            \"resolvable from the type of the required data. The path is allowed to \"\n            \"contain qualifiers (.) to traverse sub-elements, as well as indexers \"\n            \"([x]) to traverse multiple-cardinality sub-elements. Note that the \"\n            \"index must be an integer constant. The path must resolve to an element\"\n            \" of type code, Coding, or CodeableConcept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    valueCode: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"What code is expected\",\n        description=(\n            \"The codes for the code filter. Only one of valueSet, valueCode, \"\n            \"valueCoding, or valueCodeableConcept may be specified. If values are \"\n            \"given, the filter will return only those data items for which the \"\n            \"code-valued attribute specified by the path has a value that is one of\"\n            \" the specified codes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    valueCode__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"What CodeableConcept is expected\",\n        description=(\n            \"The CodeableConcepts for the code filter. Only one of valueSet, \"\n            \"valueCode, valueConding, or valueCodeableConcept may be specified. If \"\n            \"values are given, the filter will return only those data items for \"\n            \"which the code-valued attribute specified by the path has a value that\"\n            \" is one of the specified CodeableConcepts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueCoding: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"What Coding is expected\",\n        description=(\n            \"The Codings for the code filter. Only one of valueSet, valueCode, \"\n            \"valueConding, or valueCodeableConcept may be specified. If values are \"\n            \"given, the filter will return only those data items for which the \"\n            \"code-valued attribute specified by the path has a value that is one of\"\n            \" the specified Codings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueSetReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueSetReference\",\n        title=\"Valueset for the filter\",\n        description=(\n            \"The valueset for the code filter. The valueSet and value elements are \"\n            \"exclusive. If valueSet is specified, the filter will return only those\"\n            \" data items for which the value of the code-valued element specified \"\n            \"in the path is a member of the specified valueset.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e valueSet[x]\n            \"one_of_many\": \"valueSet\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n\n    valueSetString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueSetString\",\n        title=\"Valueset for the filter\",\n        description=(\n            \"The valueset for the code filter. The valueSet and value elements are \"\n            \"exclusive. If valueSet is specified, the filter will return only those\"\n            \" data items for which the value of the code-valued element specified \"\n            \"in the path is a member of the specified valueset.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e valueSet[x]\n            \"one_of_many\": \"valueSet\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueSetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueSetString\",\n        title=\"Extension field for ``valueSetString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataRequirementCodeFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"path\",\n            \"valueSetString\",\n            \"valueSetReference\",\n            \"valueCode\",\n            \"valueCoding\",\n            \"valueCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataRequirementCodeFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"path\",\n            \"valueSetString\",\n            \"valueSetReference\",\n            \"valueCode\",\n            \"valueCoding\",\n            \"valueCodeableConcept\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"path\", \"path__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"valueSet\": [\"valueSetReference\", \"valueSetString\"]}\n        return one_of_many_fields\n\n\nclass DataRequirementDateFilter(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What dates/date ranges are expected.\n    Date filters specify additional constraints on the data in terms of the\n    applicable date range for specific elements.\n    \"\"\"\n\n    __resource_type__ = \"DataRequirementDateFilter\"\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"The date-valued attribute of the filter\",\n        description=(\n            \"The date-valued attribute of the filter. The specified path must be \"\n            \"resolvable from the type of the required data. The path is allowed to \"\n            \"contain qualifiers (.) to traverse sub-elements, as well as indexers \"\n            \"([x]) to traverse multiple-cardinality sub-elements. Note that the \"\n            \"index must be an integer constant. The path must resolve to an element\"\n            \" of type dateTime, Period, Schedule, or Timing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"The value of the filter, as a Period, DateTime, or Duration value\",\n        description=(\n            \"The value of the filter. If period is specified, the filter will \"\n            \"return only those data items that fall within the bounds determined by\"\n            \" the Period, inclusive of the period boundaries. If dateTime is \"\n            \"specified, the filter will return only those data items that are equal\"\n            \" to the specified dateTime. If a Duration is specified, the filter \"\n            \"will return only those data items that fall within Duration from now.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"The value of the filter, as a Period, DateTime, or Duration value\",\n        description=(\n            \"The value of the filter. If period is specified, the filter will \"\n            \"return only those data items that fall within the bounds determined by\"\n            \" the Period, inclusive of the period boundaries. If dateTime is \"\n            \"specified, the filter will return only those data items that are equal\"\n            \" to the specified dateTime. If a Duration is specified, the filter \"\n            \"will return only those data items that fall within Duration from now.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"The value of the filter, as a Period, DateTime, or Duration value\",\n        description=(\n            \"The value of the filter. If period is specified, the filter will \"\n            \"return only those data items that fall within the bounds determined by\"\n            \" the Period, inclusive of the period boundaries. If dateTime is \"\n            \"specified, the filter will return only those data items that are equal\"\n            \" to the specified dateTime. If a Duration is specified, the filter \"\n            \"will return only those data items that fall within Duration from now.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataRequirementDateFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"path\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"valueDuration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataRequirementDateFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"path\", \"valueDateTime\", \"valuePeriod\", \"valueDuration\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"path\", \"path__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\"valueDateTime\", \"valueDuration\", \"valuePeriod\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/detectedissue.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DetectedIssue\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DetectedIssue(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Clinical issue with action.\n    Indicates an actual or potential clinical issue with or between one or more\n    active or proposed clinical actions for a patient; e.g. Drug-drug\n    interaction, Ineffective treatment frequency, Procedure-condition conflict,\n    etc.\n    \"\"\"\n\n    __resource_type__ = \"DetectedIssue\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"The provider or device that identified the issue\",\n        description=(\n            \"Individual or device responsible for the issue being raised.  For \"\n            \"example, a decision support application or a pharmacist conducting a \"\n            \"medication review.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Device\"],\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Issue Category, e.g. drug-drug, duplicate therapy, etc.\",\n        description=\"Identifies the general type of issue identified.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When identified\",\n        description=(\n            \"The date or date-time when the detected issue was initially \" \"identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    detail: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Description and context\",\n        description=\"A textual explanation of the detected issue.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_detail\", title=\"Extension field for ``detail``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique id for the detected issue\",\n        description=\"Business identifier associated with the detected issue record.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    implicated: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"implicated\",\n        title=\"Problem resource\",\n        description=(\n            \"Indicates the resource representing the current activity or proposed \"\n            \"activity that is potentially problematic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    mitigation: typing.List[fhirtypes.DetectedIssueMitigationType] | None = Field(\n        default=None,\n        alias=\"mitigation\",\n        title=\"Step taken to address\",\n        description=(\n            \"Indicates an action that has been taken or is committed to to reduce \"\n            \"or eliminate the likelihood of the risk identified by the detected \"\n            \"issue from manifesting.  Can also reflect an observation of known \"\n            \"mitigating factors that may reduce/eliminate the need for any action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"Associated patient\",\n        description=(\n            \"Indicates the patient whose record the detected issue is associated \"\n            \"with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    reference: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Authority for issue\",\n        description=(\n            \"The literature, knowledge-base or similar reference that describes the\"\n            \" propensity for the detected issue identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"high | moderate | low\",\n        description=(\n            \"Indicates the degree of importance associated with the identified \"\n            \"issue based on the potential impact on the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"high\", \"moderate\", \"low\"],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | preliminary | final | amended +\",\n        description=\"Indicates the status of the detected issue.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"registered\", \"preliminary\", \"final\", \"amended\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DetectedIssue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"severity\",\n            \"patient\",\n            \"date\",\n            \"author\",\n            \"implicated\",\n            \"detail\",\n            \"reference\",\n            \"mitigation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DetectedIssue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"severity\",\n            \"patient\",\n            \"date\",\n            \"author\",\n            \"implicated\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass DetectedIssueMitigation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Step taken to address.\n    Indicates an action that has been taken or is committed to to reduce or\n    eliminate the likelihood of the risk identified by the detected issue from\n    manifesting.  Can also reflect an observation of known mitigating factors\n    that may reduce/eliminate the need for any action.\n    \"\"\"\n\n    __resource_type__ = \"DetectedIssueMitigation\"\n\n    action: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"action\",\n        title=\"What mitigation?\",\n        description=(\n            \"Describes the action that was taken or the observation that was made \"\n            \"that reduces/eliminates the risk associated with the identified issue.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who is committing?\",\n        description=(\n            \"Identifies the practitioner who determined the mitigation and takes \"\n            \"responsibility for the mitigation step occurring.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date committed\",\n        description=\"Indicates when the mitigating action was documented.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DetectedIssueMitigation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\", \"date\", \"author\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DetectedIssueMitigation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/device.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Device\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Device(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Item used in healthcare.\n    This resource identifies an instance or a type of a manufactured item that\n    is used in the provision of healthcare without being substantially changed\n    through that activity. The device may be a medical or non-medical device.\n    Medical devices include durable (reusable) medical equipment, implantable\n    devices, as well as disposable equipment used for diagnostic, treatment,\n    and research for healthcare and public health.  Non-medical devices may\n    include items such as a machine, cellphone, computer, application, etc.\n    \"\"\"\n\n    __resource_type__ = \"Device\"\n\n    contact: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Details for human/organization for support\",\n        description=(\n            \"Contact details for an organization or a particular human that is \"\n            \"responsible for the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    expirationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expirationDate\",\n        title=\"Date and time of expiry of this device (if applicable)\",\n        description=(\n            \"The date and time beyond which this device is no longer valid or \"\n            \"should not be used (if applicable).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_expirationDate\",\n        title=\"Extension field for ``expirationDate``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Instance identifier\",\n        description=(\n            \"Unique instance identifiers assigned to a device by manufacturers \"\n            \"other organizations or owners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the resource is found\",\n        description=\"The place where the device can be found.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    lotNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lotNumber\",\n        title=\"Lot number of manufacture\",\n        description=\"Lot number assigned by the manufacturer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lotNumber\", title=\"Extension field for ``lotNumber``.\"\n    )\n\n    manufactureDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"manufactureDate\",\n        title=\"Date when the device was made\",\n        description=\"The date and time when the device was manufactured.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    manufactureDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_manufactureDate\",\n        title=\"Extension field for ``manufactureDate``.\",\n    )\n\n    manufacturer: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Name of device manufacturer\",\n        description=\"A name of the manufacturer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    manufacturer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_manufacturer\",\n        title=\"Extension field for ``manufacturer``.\",\n    )\n\n    model: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"model\",\n        title=\"Model id assigned by the manufacturer\",\n        description=(\n            'The \"model\" is an identifier assigned by the manufacturer to identify '\n            \"the product by its type. This number is shared by the all devices sold\"\n            \" as the same type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    model__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_model\", title=\"Extension field for ``model``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Device notes and comments\",\n        description=(\n            \"Descriptive information, usage information or implantation information\"\n            \" that is not captured in an existing element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    owner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"owner\",\n        title=\"Organization responsible for device\",\n        description=(\n            \"An organization that is responsible for the provision and ongoing \"\n            \"maintenance of the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"Patient to whom Device is affixed\",\n        description=\"Patient information, If the device is affixed to a person.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    safety: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"safety\",\n        title=\"Safety Characteristics of Device\",\n        description=(\n            \"Provides additional safety characteristics about a medical device.  \"\n            \"For example devices containing latex.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error | unknown\",\n        description=\"Status of the Device availability.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"What kind of device this is\",\n        description=\"Code or identifier to identify a kind of device.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: fhirtypes.DeviceUdiType | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique Device Identifier (UDI) Barcode string\",\n        description=(\n            \"[Unique device identifier (UDI)](device.html#5.11.3.2.2) assigned to \"\n            \"device label or package.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Network address to contact device\",\n        description=\"A network address on which the device may be contacted directly.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version number (i.e. software)\",\n        description=(\n            \"The version of the device, if the device has multiple releases under \"\n            \"the same model, or if the device is software or carries firmware.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Device`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"udi\",\n            \"status\",\n            \"type\",\n            \"lotNumber\",\n            \"manufacturer\",\n            \"manufactureDate\",\n            \"expirationDate\",\n            \"model\",\n            \"version\",\n            \"patient\",\n            \"owner\",\n            \"contact\",\n            \"location\",\n            \"url\",\n            \"note\",\n            \"safety\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Device`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"udi\", \"status\", \"safety\"]\n\n\nclass DeviceUdi(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Unique Device Identifier (UDI) Barcode string.\n    [Unique device identifier (UDI)](device.html#5.11.3.2.2) assigned to device\n    label or package.\n    \"\"\"\n\n    __resource_type__ = \"DeviceUdi\"\n\n    carrierAIDC: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"carrierAIDC\",\n        title=\"UDI Machine Readable Barcode String\",\n        description=(\n            \"The full UDI carrier of the Automatic Identification and Data Capture \"\n            \"(AIDC) technology representation of the barcode string as printed on \"\n            \"the packaging of the device - E.g a barcode or RFID.   Because of \"\n            \"limitations on character sets in XML and the need to round-trip JSON \"\n            \"data through XML, AIDC Formats *SHALL* be base64 encoded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    carrierAIDC__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_carrierAIDC\", title=\"Extension field for ``carrierAIDC``.\"\n    )\n\n    carrierHRF: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"carrierHRF\",\n        title=\"UDI Human Readable Barcode String\",\n        description=(\n            \"The full UDI carrier as the human readable form (HRF) representation \"\n            \"of the barcode string as printed on the packaging of the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    carrierHRF__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_carrierHRF\", title=\"Extension field for ``carrierHRF``.\"\n    )\n\n    deviceIdentifier: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"deviceIdentifier\",\n        title=\"Mandatory fixed portion of UDI\",\n        description=(\n            \"The device identifier (DI) is a mandatory, fixed portion of a UDI that\"\n            \" identifies the labeler and the specific version or model of a device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    deviceIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deviceIdentifier\",\n        title=\"Extension field for ``deviceIdentifier``.\",\n    )\n\n    entryType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"entryType\",\n        title=\"barcode | rfid | manual +\",\n        description=\"A coded entry to indicate how the data was entered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"barcode\", \"rfid\", \"manual\", \"+\"],\n        },\n    )\n    entryType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_entryType\", title=\"Extension field for ``entryType``.\"\n    )\n\n    issuer: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"issuer\",\n        title=\"UDI Issuing Organization\",\n        description=(\n            \"Organization that is charged with issuing UDIs for devices.  For \"\n            \"example, the US FDA issuers include : 1) GS1:  \"\n            \"http://hl7.org/fhir/NamingSystem/gs1-di,  2) HIBCC: \"\n            \"http://hl7.org/fhir/NamingSystem/hibcc-dI,  3) ICCBBA for blood \"\n            \"containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di,  4) \"\n            \"ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-\"\n            \"other-di.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    issuer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issuer\", title=\"Extension field for ``issuer``.\"\n    )\n\n    jurisdiction: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Regional UDI authority\",\n        description=(\n            \"The identity of the authoritative source for UDI generation within a  \"\n            \"jurisdiction.  All UDIs are globally unique within a single namespace.\"\n            \" with the appropriate repository uri as the system.  For example,  \"\n            \"UDIs of devices managed in the U.S. by the FDA, the value is  \"\n            \"http://hl7.org/fhir/NamingSystem/fda-udi.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    jurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_jurisdiction\",\n        title=\"Extension field for ``jurisdiction``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Device Name as appears on UDI label\",\n        description=\"Name of device as used in labeling or catalog.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceUdi`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"deviceIdentifier\",\n            \"name\",\n            \"jurisdiction\",\n            \"carrierHRF\",\n            \"carrierAIDC\",\n            \"issuer\",\n            \"entryType\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceUdi`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"deviceIdentifier\",\n            \"name\",\n            \"carrierHRF\",\n            \"carrierAIDC\",\n        ]\n"
  },
  {
    "path": "fhir/resources/STU3/devicecomponent.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceComponent\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DeviceComponent(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An instance of a medical-related component of a medical device.\n    The characteristics, operational status and capabilities of a medical-\n    related component of a medical device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceComponent\"\n\n    identifier: fhirtypes.IdentifierType = Field(\n        default=...,\n        alias=\"identifier\",\n        title=\"Instance id assigned by the software stack\",\n        description=(\n            \"The locally assigned unique identification by the software. For \"\n            \"example: handle ID.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    languageCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"languageCode\",\n        title=(\n            \"Language code for the human-readable text strings produced by the \"\n            \"device\"\n        ),\n        description=(\n            \"The language code for the human-readable text string produced by the \"\n            \"device. This language code will follow the IETF language tag. Example:\"\n            \" en-US.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastSystemChange: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"lastSystemChange\",\n        title=\"Recent system change timestamp\",\n        description=(\n            \"The timestamp for the most recent system change which includes device \"\n            \"configuration or setting change.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastSystemChange__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastSystemChange\",\n        title=\"Extension field for ``lastSystemChange``.\",\n    )\n\n    measurementPrinciple: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"measurementPrinciple\",\n        title=(\n            \"other | chemical | electrical | impedance | nuclear | optical | \"\n            \"thermal | biological | mechanical | acoustical | manual+\"\n        ),\n        description=(\n            \"The physical principle of the measurement. For example: thermal, \"\n            \"chemical, acoustical, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"other\",\n                \"chemical\",\n                \"electrical\",\n                \"impedance\",\n                \"nuclear\",\n                \"optical\",\n                \"thermal\",\n                \"biological\",\n                \"mechanical\",\n                \"acoustical\",\n                \"manual+\",\n            ],\n        },\n    )\n    measurementPrinciple__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_measurementPrinciple\",\n        title=\"Extension field for ``measurementPrinciple``.\",\n    )\n\n    operationalStatus: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"operationalStatus\",\n        title=(\n            \"Current operational status of the component, for example On, Off or \"\n            \"Standby\"\n        ),\n        description=(\n            \"The current operational status of the device. For example: On, Off, \"\n            \"Standby, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    parameterGroup: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"parameterGroup\",\n        title=\"Current supported parameter group\",\n        description=(\n            \"The parameter group supported by the current device component that is \"\n            \"based on some nomenclature, e.g. cardiovascular.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    parent: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Parent resource link\",\n        description=(\n            \"The link to the parent resource. For example: Channel is linked to its\"\n            \" VMD parent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceComponent\"],\n        },\n    )\n\n    productionSpecification: typing.List[\n        fhirtypes.DeviceComponentProductionSpecificationType\n    ] | None = Field(\n        default=None,\n        alias=\"productionSpecification\",\n        title=\"Specification details such as Component Revisions, or Serial Numbers\",\n        description=(\n            \"The production specification such as component revision, serial \"\n            \"number, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Top-level device resource link\",\n        description=(\n            \"The link to the source Device that contains administrative device \"\n            \"information such as manufacture, serial number, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"What kind of component it is\",\n        description=(\n            \"The component type as defined in the object-oriented or metric \"\n            \"nomenclature partition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"lastSystemChange\",\n            \"source\",\n            \"parent\",\n            \"operationalStatus\",\n            \"parameterGroup\",\n            \"measurementPrinciple\",\n            \"productionSpecification\",\n            \"languageCode\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"type\",\n            \"lastSystemChange\",\n            \"source\",\n            \"parent\",\n            \"operationalStatus\",\n            \"parameterGroup\",\n            \"measurementPrinciple\",\n            \"productionSpecification\",\n            \"languageCode\",\n        ]\n\n\nclass DeviceComponentProductionSpecification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specification details such as Component Revisions, or Serial Numbers.\n    The production specification such as component revision, serial number,\n    etc.\n    \"\"\"\n\n    __resource_type__ = \"DeviceComponentProductionSpecification\"\n\n    componentId: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"componentId\",\n        title=\"Internal component unique identification\",\n        description=(\n            \"The internal component unique identification. This is a provision for \"\n            \"manufacture specific standard components using a private OID. \"\n            \"11073-10101 has a partition for private OID semantic that the \"\n            \"manufacturer can make use of.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    productionSpec: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"productionSpec\",\n        title=\"A printable string defining the component\",\n        description=\"The printable string defining the component.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    productionSpec__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_productionSpec\",\n        title=\"Extension field for ``productionSpec``.\",\n    )\n\n    specType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"specType\",\n        title=(\n            \"Type or kind of production specification, for example serial number or\"\n            \" software revision\"\n        ),\n        description=(\n            \"The specification type, such as, serial number, part number, hardware \"\n            \"revision, software revision, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceComponentProductionSpecification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"specType\",\n            \"componentId\",\n            \"productionSpec\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceComponentProductionSpecification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"specType\", \"componentId\", \"productionSpec\"]\n"
  },
  {
    "path": "fhir/resources/STU3/devicemetric.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceMetric\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DeviceMetric(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Measurement, calculation or setting capability of a medical device.\n    Describes a measurement, calculation or setting capability of a medical\n    device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceMetric\"\n\n    calibration: typing.List[fhirtypes.DeviceMetricCalibrationType] | None = Field(\n        default=None,\n        alias=\"calibration\",\n        title=(\n            \"Describes the calibrations that have been performed or that are \"\n            \"required to be performed\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"measurement | setting | calculation | unspecified\",\n        description=(\n            \"Indicates the category of the observation generation process. A \"\n            \"DeviceMetric can be for example a setting, measurement, or \"\n            \"calculation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"measurement\", \"setting\", \"calculation\", \"unspecified\"],\n        },\n    )\n    category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_category\", title=\"Extension field for ``category``.\"\n    )\n\n    color: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"color\",\n        title=\"black | red | green | yellow | blue | magenta | cyan | white\",\n        description=(\n            \"Describes the color representation for the metric. This is often used \"\n            \"to aid clinicians to track and identify parameter types by color. In \"\n            \"practice, consider a Patient Monitor that has ECG/HR and Pleth for \"\n            \"example; the parameters are displayed in different characteristic \"\n            \"colors, such as HR-blue, BP-green, and PR and SpO2- magenta.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"black\",\n                \"red\",\n                \"green\",\n                \"yellow\",\n                \"blue\",\n                \"magenta\",\n                \"cyan\",\n                \"white\",\n            ],\n        },\n    )\n    color__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_color\", title=\"Extension field for ``color``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType = Field(\n        default=...,\n        alias=\"identifier\",\n        title=\"Unique identifier of this DeviceMetric\",\n        description=(\n            \"Describes the unique identification of this metric that has been \"\n            \"assigned by the device or gateway software. For example: handle ID.  \"\n            \"It should be noted that in order to make the identifier unique, the \"\n            \"system element of the identifier should be set to the unique \"\n            \"identifier of the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    measurementPeriod: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"measurementPeriod\",\n        title=\"Describes the measurement repetition time\",\n        description=(\n            \"Describes the measurement repetition time. This is not necessarily the\"\n            \" same as the update period. The measurement repetition time can range \"\n            \"from milliseconds up to hours. An example for a measurement repetition\"\n            \" time in the range of milliseconds is the sampling rate of an ECG. An \"\n            \"example for a measurement repetition time in the range of hours is a \"\n            \"NIBP that is triggered automatically every hour. The update period may\"\n            \" be different than the measurement repetition time, if the device does\"\n            \" not update the published observed value with the same frequency as it\"\n            \" was measured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    operationalStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"operationalStatus\",\n        title=\"on | off | standby | entered-in-error\",\n        description=(\n            \"Indicates current operational state of the device. For example: On, \"\n            \"Off, Standby, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"on\", \"off\", \"standby\", \"entered-in-error\"],\n        },\n    )\n    operationalStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_operationalStatus\",\n        title=\"Extension field for ``operationalStatus``.\",\n    )\n\n    parent: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Describes the link to the parent DeviceComponent\",\n        description=(\n            \"Describes the link to the  DeviceComponent that this DeviceMetric \"\n            \"belongs to and that provide information about the location of this \"\n            \"DeviceMetric in the containment structure of the parent Device. An \"\n            \"example would be a DeviceComponent that represents a Channel. This \"\n            \"reference can be used by a client application to distinguish \"\n            \"DeviceMetrics that have the same type, but should be interpreted based\"\n            \" on their containment location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceComponent\"],\n        },\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Describes the link to the source Device\",\n        description=(\n            \"Describes the link to the  Device that this DeviceMetric belongs to \"\n            \"and that contains administrative device information such as \"\n            \"manufacturer, serial number, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Identity of metric, for example Heart Rate or PEEP Setting\",\n        description=(\n            \"Describes the type of the metric. For example: Heart Rate, PEEP \"\n            \"Setting, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    unit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Unit of Measure for the Metric\",\n        description=(\n            \"Describes the unit that an observed value determined for this metric \"\n            \"will have. For example: Percent, Seconds, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceMetric`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"unit\",\n            \"source\",\n            \"parent\",\n            \"operationalStatus\",\n            \"color\",\n            \"category\",\n            \"measurementPeriod\",\n            \"calibration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceMetric`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"type\",\n            \"unit\",\n            \"source\",\n            \"parent\",\n            \"operationalStatus\",\n            \"color\",\n            \"category\",\n            \"measurementPeriod\",\n            \"calibration\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"category\", \"category__ext\")]\n        return required_fields\n\n\nclass DeviceMetricCalibration(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes the calibrations that have been performed or that are required to\n    be performed.\n    \"\"\"\n\n    __resource_type__ = \"DeviceMetricCalibration\"\n\n    state: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"state\",\n        title=\"not-calibrated | calibration-required | calibrated | unspecified\",\n        description=\"Describes the state of the calibration.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"not-calibrated\",\n                \"calibration-required\",\n                \"calibrated\",\n                \"unspecified\",\n            ],\n        },\n    )\n    state__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_state\", title=\"Extension field for ``state``.\"\n    )\n\n    time: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"time\",\n        title=\"Describes the time last calibration has been performed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_time\", title=\"Extension field for ``time``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"unspecified | offset | gain | two-point\",\n        description=\"Describes the type of the calibration method.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"unspecified\", \"offset\", \"gain\", \"two-point\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceMetricCalibration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"state\", \"time\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceMetricCalibration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"state\", \"time\"]\n"
  },
  {
    "path": "fhir/resources/STU3/devicerequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceRequest\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DeviceRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Medical device request.\n    Represents a request for a patient to employ a medical device. The device\n    may be an implantable device, or an external assistive device, such as a\n    walker.\n    \"\"\"\n\n    __resource_type__ = \"DeviceRequest\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When recorded\",\n        description=\"When the request transitioned to being actionable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What request fulfills\",\n        description=\"Plan/proposal/order fulfilled by this request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    codeCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"codeCodeableConcept\",\n        title=\"Device requested\",\n        description=\"The details of the device to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e code[x]\n            \"one_of_many\": \"code\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    codeReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"codeReference\",\n        title=\"Device requested\",\n        description=\"The details of the device to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e code[x]\n            \"one_of_many\": \"code\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or Episode motivating request\",\n        description=(\n            \"An encounter that provides additional context in which this request is\"\n            \" made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    definition: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Protocol or definition\",\n        description=(\n            \"Protocol or definition followed by this request. For example: The \"\n            \"proposed act must be performed if the indicated conditions occur, \"\n            \"e.g.., shortness of breath, SpO2 less than x%.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Identifier of composite request\",\n        description=\"Composite request this is part of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Request identifier\",\n        description=\"Identifiers assigned to this order by the orderer or by the receiver.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    intent: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"intent\",\n        title=\"proposal | plan | original-order | encoded | reflex-order\",\n        description=(\n            \"Whether the request is a proposal, plan, an original order or a reflex\"\n            \" order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Notes or comments\",\n        description=(\n            \"Details about this request that were not represented at all or \"\n            \"sufficiently in one of the attributes provided in a class. These may \"\n            \"include for example a comment, an instruction, or a note associated \"\n            \"with the statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"Desired time or schedule for use\",\n        description=(\n            \"The timing schedule for the use of the device. The Schedule data type \"\n            'allows many different expressions, for example. \"Every 8 hours\"; '\n            '\"Three times a day\"; \"1/2 an hour before breakfast for 10 days from '\n            '23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"Desired time or schedule for use\",\n        description=(\n            \"The timing schedule for the use of the device. The Schedule data type \"\n            'allows many different expressions, for example. \"Every 8 hours\"; '\n            '\"Three times a day\"; \"1/2 an hour before breakfast for 10 days from '\n            '23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"Desired time or schedule for use\",\n        description=(\n            \"The timing schedule for the use of the device. The Schedule data type \"\n            'allows many different expressions, for example. \"Every 8 hours\"; '\n            '\"Three times a day\"; \"1/2 an hour before breakfast for 10 days from '\n            '23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Requested Filler\",\n        description=\"The desired perfomer for doing the diagnostic testing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    performerType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=\"Fille role\",\n        description=\"Desired type of performer for doing the diagnostic testing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    priorRequest: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"priorRequest\",\n        title=\"What request replaces\",\n        description=(\n            \"The request takes the place of the referenced completed or terminated \"\n            \"request(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=(\n            \"Indicates how quickly the {{title}} should be addressed with respect \"\n            \"to other requests\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Coded Reason for request\",\n        description=\"Reason or justification for the use of this device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Linked Reason for request\",\n        description=\"Reason or justification for the use of this device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Request provenance\",\n        description=\"Key events in the history of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    requester: fhirtypes.DeviceRequestRequesterType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/what is requesting diagnostics\",\n        description=(\n            \"The individual who initiated the request and has responsibility for \"\n            \"its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | suspended | completed | entered-in-error | cancelled\",\n        description=\"The status of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"suspended\",\n                \"completed\",\n                \"entered-in-error\",\n                \"cancelled\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Focus of request\",\n        description=\"The patient who will use the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Location\", \"Device\"],\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Additional clinical information\",\n        description=(\n            \"Additional clinical information about the patient that may influence \"\n            \"the request fulfilment.  For example, this may includes body where on \"\n            \"the subject's the device will be used ( i.e. the target site).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"priorRequest\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"codeReference\",\n            \"codeCodeableConcept\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"authoredOn\",\n            \"requester\",\n            \"performerType\",\n            \"performer\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"supportingInfo\",\n            \"note\",\n            \"relevantHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"priorRequest\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"codeReference\",\n            \"codeCodeableConcept\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"authoredOn\",\n            \"requester\",\n            \"performerType\",\n            \"performer\",\n            \"reasonCode\",\n            \"reasonReference\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"code\": [\"codeCodeableConcept\", \"codeReference\"],\n            \"occurrence\": [\n                \"occurrenceDateTime\",\n                \"occurrencePeriod\",\n                \"occurrenceTiming\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass DeviceRequestRequester(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who/what is requesting diagnostics.\n    The individual who initiated the request and has responsibility for its\n    activation.\n    \"\"\"\n\n    __resource_type__ = \"DeviceRequestRequester\"\n\n    agent: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Individual making the request\",\n        description=\"The device, practitioner, etc. who initiated the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"Practitioner\", \"Organization\"],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization agent is acting for\",\n        description=\"The organization the device or practitioner was acting on behalf of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceRequestRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"agent\", \"onBehalfOf\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceRequestRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"agent\", \"onBehalfOf\"]\n"
  },
  {
    "path": "fhir/resources/STU3/deviceusestatement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceUseStatement\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass DeviceUseStatement(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Record of use of a device.\n    A record of a device being used by a patient where the record is the result\n    of a report from the patient or another clinician.\n    \"\"\"\n\n    __resource_type__ = \"DeviceUseStatement\"\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Target body site\",\n        description=(\n            \"Indicates the site on the subject's body where the device was used ( \"\n            \"i.e. the target site).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    device: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"device\",\n        title=\"Reference to device used\",\n        description=\"The details of the device used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier for this record\",\n        description=\"An external identifier for this statement such as an IRI.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    indication: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"indication\",\n        title=\"Why device was used\",\n        description=\"Reason or justification for the use of the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Addition details (comments, instructions)\",\n        description=(\n            \"Details about the device statement that were not represented at all or\"\n            \" sufficiently in one of the attributes provided in a class. These may \"\n            \"include for example a comment, an instruction, or a note associated \"\n            \"with the statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recordedOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recordedOn\",\n        title=\"When statement was recorded\",\n        description=\"The time at which the statement was made/recorded.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    recordedOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recordedOn\", title=\"Extension field for ``recordedOn``.\"\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Who made the statement\",\n        description=\"Who reported the device was being used by the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\", \"RelatedPerson\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | completed | entered-in-error +\",\n        description=(\n            \"A code representing the patient or other source's judgment about the \"\n            \"state of the device used that this statement is about.  Generally this\"\n            \" will be active or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"completed\", \"entered-in-error\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Patient using device\",\n        description=\"The patient who used the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    timingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timingDateTime\",\n        title=\"How often  the device was used\",\n        description=\"How often the device was used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timingDateTime\",\n        title=\"Extension field for ``timingDateTime``.\",\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"How often  the device was used\",\n        description=\"How often the device was used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"How often  the device was used\",\n        description=\"How often the device was used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    whenUsed: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"whenUsed\",\n        title=\"Period device was used\",\n        description=\"The time period over which the device was used.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceUseStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"subject\",\n            \"whenUsed\",\n            \"timingTiming\",\n            \"timingPeriod\",\n            \"timingDateTime\",\n            \"recordedOn\",\n            \"source\",\n            \"device\",\n            \"indication\",\n            \"bodySite\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceUseStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\"timingDateTime\", \"timingPeriod\", \"timingTiming\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/diagnosticreport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DiagnosticReport\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DiagnosticReport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A Diagnostic report - a combination of request information, atomic results,\n    images, interpretation, as well as formatted reports.\n    The findings and interpretation of diagnostic  tests performed on patients,\n    groups of patients, devices, and locations, and/or specimens derived from\n    these. The report includes clinical context such as requesting and provider\n    information, and some mix of atomic results, images, textual and coded\n    interpretations, and formatted representation of diagnostic reports.\n    \"\"\"\n\n    __resource_type__ = \"DiagnosticReport\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What was requested\",\n        description=\"Details concerning a test or procedure requested.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"ImmunizationRecommendation\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ProcedureRequest\",\n                \"ReferralRequest\",\n            ],\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Service category\",\n        description=(\n            \"A code that classifies the clinical discipline, department or \"\n            \"diagnostic service that created the report (e.g. cardiology, \"\n            \"biochemistry, hematology, MRI). This is used for searching, sorting \"\n            \"and display purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Name/Code for this diagnostic report\",\n        description=\"A code or name that describes this diagnostic report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    codedDiagnosis: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"codedDiagnosis\",\n        title=\"Codes for the conclusion\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    conclusion: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"conclusion\",\n        title=\"Clinical Interpretation of test results\",\n        description=(\n            \"Concise and clinically contextualized impression / summary of the \"\n            \"diagnostic report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    conclusion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_conclusion\", title=\"Extension field for ``conclusion``.\"\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Health care event when test ordered\",\n        description=(\n            \"The healthcare event  (e.g. a patient and healthcare provider \"\n            \"interaction) which this DiagnosticReport per is about.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"Clinically relevant time/time-period for report\",\n        description=(\n            \"The time or time-period the observed values are related to. When the \"\n            \"subject of the report is a patient, this is usually either the time of\"\n            \" the procedure or of specimen collection(s), but very often the source\"\n            \" of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"Clinically relevant time/time-period for report\",\n        description=(\n            \"The time or time-period the observed values are related to. When the \"\n            \"subject of the report is a patient, this is usually either the time of\"\n            \" the procedure or of specimen collection(s), but very often the source\"\n            \" of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for report\",\n        description=\"Identifiers assigned to this report by the performer or other systems.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    image: typing.List[fhirtypes.DiagnosticReportImageType] | None = Field(\n        default=None,\n        alias=\"image\",\n        title=\"Key images associated with this report\",\n        description=(\n            \"A list of key images associated with this report. The images are \"\n            \"generally created during the diagnostic process, and may be directly \"\n            \"of the patient, or of treated specimens (i.e. slides of interest).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    imagingStudy: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"imagingStudy\",\n        title=(\n            \"Reference to full details of imaging associated with the diagnostic \"\n            \"report\"\n        ),\n        description=(\n            \"One or more links to full details of any imaging performed during the \"\n            \"diagnostic investigation. Typically, this is imaging performed by \"\n            \"DICOM enabled modalities, but this is not required. A fully enabled \"\n            \"PACS viewer can use this information to provide views of the source \"\n            \"images.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ImagingStudy\", \"ImagingManifest\"],\n        },\n    )\n\n    issued: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"DateTime this version was released\",\n        description=(\n            \"The date and time that this version of the report was released from \"\n            \"the source diagnostic service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    performer: typing.List[fhirtypes.DiagnosticReportPerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Participants in producing the report\",\n        description=\"Indicates who or what participated in producing the report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    presentedForm: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"presentedForm\",\n        title=\"Entire report as issued\",\n        description=(\n            \"Rich text representation of the entire result as issued by the \"\n            \"diagnostic service. Multiple formats are allowed but they SHALL be \"\n            \"semantically equivalent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    result: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"Observations - simple, or complex nested groups\",\n        description=(\n            \"Observations that are part of this diagnostic report. Observations can\"\n            ' be simple name/value pairs (e.g. \"atomic\" results), or they can be '\n            \"grouping observations that include references to other members of the \"\n            'group (e.g. \"panels\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    specimen: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Specimens this report is based on\",\n        description=\"Details about the specimens on which this diagnostic report is based.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | partial | preliminary | final +\",\n        description=\"The status of the diagnostic report as a whole.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"registered\", \"partial\", \"preliminary\", \"final\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The subject of the report - usually, but not always, the patient\",\n        description=(\n            \"The subject of the report. Usually, but not always, this is a patient.\"\n            \" However diagnostic services also perform analyses on specimens \"\n            \"collected from a variety of other sources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Device\", \"Location\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DiagnosticReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"issued\",\n            \"performer\",\n            \"specimen\",\n            \"result\",\n            \"imagingStudy\",\n            \"image\",\n            \"conclusion\",\n            \"codedDiagnosis\",\n            \"presentedForm\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DiagnosticReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"issued\",\n            \"performer\",\n            \"image\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"effective\": [\"effectiveDateTime\", \"effectivePeriod\"]}\n        return one_of_many_fields\n\n\nclass DiagnosticReportImage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Key images associated with this report.\n    A list of key images associated with this report. The images are generally\n    created during the diagnostic process, and may be directly of the patient,\n    or of treated specimens (i.e. slides of interest).\n    \"\"\"\n\n    __resource_type__ = \"DiagnosticReportImage\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comment about the image (e.g. explanation)\",\n        description=(\n            \"A comment about the image. Typically, this is used to provide an \"\n            \"explanation for why the image is included, or to draw the viewer's \"\n            \"attention to important features.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    link: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"link\",\n        title=\"Reference to the image source\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Media\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DiagnosticReportImage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"comment\", \"link\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DiagnosticReportImage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"link\"]\n\n\nclass DiagnosticReportPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Participants in producing the report.\n    Indicates who or what participated in producing the report.\n    \"\"\"\n\n    __resource_type__ = \"DiagnosticReportPerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Practitioner or Organization  participant\",\n        description=(\n            \"The reference to the  practitioner or organization involved in \"\n            \"producing the report. For example, the diagnostic service that is \"\n            \"responsible for issuing the report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Organization\"],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Type of performer\",\n        description=(\n            \"Describes the type of participation (e.g.  a responsible party, \"\n            \"author, or verifier).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DiagnosticReportPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DiagnosticReportPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"role\", \"actor\"]\n"
  },
  {
    "path": "fhir/resources/STU3/distance.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Distance\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Distance(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A length - a value with a unit that is a physical distance.\n    \"\"\"\n\n    __resource_type__ = \"Distance\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Distance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Distance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/STU3/documentmanifest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DocumentManifest\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DocumentManifest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A list that defines a set of documents.\n    A collection of documents compiled for a purpose together with metadata\n    that applies to the collection.\n    \"\"\"\n\n    __resource_type__ = \"DocumentManifest\"\n\n    author: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who and/or what authored the manifest\",\n        description=(\n            \"Identifies who is responsible for creating the manifest, and adding  \"\n            \"documents to it.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    content: typing.List[fhirtypes.DocumentManifestContentType] = Field(\n        default=...,\n        alias=\"content\",\n        title=\"The items included\",\n        description=\"The list of Documents included in the manifest.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"When this document manifest created\",\n        description=(\n            \"When the document manifest was created for submission to the server \"\n            \"(not necessarily the same thing as the actual resource last modified \"\n            \"time, since it may be modified, replicated, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-readable description (title)\",\n        description=(\n            \"Human-readable description of the source document. This is sometimes \"\n            'known as the \"title\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Other identifiers for the manifest\",\n        description=(\n            \"Other identifiers associated with the document manifest, including \"\n            \"version independent  identifiers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    masterIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"masterIdentifier\",\n        title=\"Unique Identifier for the set of documents\",\n        description=(\n            \"A single identifier that uniquely identifies this manifest. \"\n            \"Principally used to refer to the manifest in non-FHIR contexts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Intended to get notified about this set of documents\",\n        description=(\n            \"A patient, practitioner, or organization for which this set of \"\n            \"documents is intended.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    related: typing.List[fhirtypes.DocumentManifestRelatedType] | None = Field(\n        default=None,\n        alias=\"related\",\n        title=\"Related things\",\n        description=\"Related identifiers or resources associated with the DocumentManifest.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"The source system/application/software\",\n        description=(\n            \"Identifies the source system, application, or software that produced \"\n            \"the document manifest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"current | superseded | entered-in-error\",\n        description=\"The status of this document manifest.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"current\", \"superseded\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The subject of the set of documents\",\n        description=(\n            \"Who or what the set of documents is about. The documents can be about \"\n            \"a person, (patient or healthcare practitioner), a device (i.e. \"\n            \"machine) or even a group of subjects (such as a document about a herd \"\n            \"of farm animals, or a set of patients that share a common exposure). \"\n            \"If the documents cross more than one subject, then more than one \"\n            \"subject is allowed here (unusual use case).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\", \"Group\", \"Device\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of document set\",\n        description=(\n            \"Specifies the kind of this set of documents (e.g. Patient Summary, \"\n            \"Discharge Summary, Prescription, etc.). The type of a set of documents\"\n            \" may be the same as one of the documents in it - especially if there \"\n            \"is only one - but it may be wider.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentManifest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"masterIdentifier\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"created\",\n            \"author\",\n            \"recipient\",\n            \"source\",\n            \"description\",\n            \"content\",\n            \"related\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentManifest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"masterIdentifier\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"created\",\n            \"author\",\n            \"recipient\",\n            \"source\",\n            \"description\",\n            \"content\",\n            \"related\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass DocumentManifestContent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The items included.\n    The list of Documents included in the manifest.\n    \"\"\"\n\n    __resource_type__ = \"DocumentManifestContent\"\n\n    pAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"pAttachment\",\n        title=\"Contents of this set of documents\",\n        description=(\n            \"The list of references to document content, or Attachment that consist\"\n            \" of the parts of this document manifest. Usually, these would be \"\n            \"document references, but direct references to Media or Attachments are\"\n            \" also allowed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e p[x]\n            \"one_of_many\": \"p\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    pReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"pReference\",\n        title=\"Contents of this set of documents\",\n        description=(\n            \"The list of references to document content, or Attachment that consist\"\n            \" of the parts of this document manifest. Usually, these would be \"\n            \"document references, but direct references to Media or Attachments are\"\n            \" also allowed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e p[x]\n            \"one_of_many\": \"p\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentManifestContent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"pAttachment\", \"pReference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentManifestContent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"pAttachment\", \"pReference\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"p\": [\"pAttachment\", \"pReference\"]}\n        return one_of_many_fields\n\n\nclass DocumentManifestRelated(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Related things.\n    Related identifiers or resources associated with the DocumentManifest.\n    \"\"\"\n\n    __resource_type__ = \"DocumentManifestRelated\"\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers of things that are related\",\n        description=(\n            \"Related identifier to this DocumentManifest.  For example, Order \"\n            \"numbers, accession numbers, XDW workflow numbers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ref: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"ref\",\n        title=\"Related Resource\",\n        description=(\n            \"Related Resource to this DocumentManifest. For example, Order, \"\n            \"ProcedureRequest,  Procedure, EligibilityRequest, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentManifestRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"identifier\", \"ref\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentManifestRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"ref\"]\n"
  },
  {
    "path": "fhir/resources/STU3/documentreference.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DocumentReference\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DocumentReference(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reference to a document.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReference\"\n\n    authenticator: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authenticator\",\n        title=\"Who/what authenticated the document\",\n        description=(\n            \"Which person or organization authenticates that this document is \" \"valid.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Organization\"],\n        },\n    )\n\n    author: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who and/or what authored the document\",\n        description=(\n            \"Identifies who is responsible for adding the information to the \"\n            \"document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    class_fhir: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"class\",\n        title=\"Categorization of document\",\n        description=(\n            \"A categorization for the type of document referenced - helps for \"\n            \"indexing and searching. This may be implied by or derived from the \"\n            \"code specified in the DocumentReference.type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    content: typing.List[fhirtypes.DocumentReferenceContentType] = Field(\n        default=...,\n        alias=\"content\",\n        title=\"Document referenced\",\n        description=(\n            \"The document and format referenced. There may be multiple content \"\n            \"element repetitions, each with a different format.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.DocumentReferenceContextType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Clinical context of document\",\n        description=\"The clinical context in which the document was prepared.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Document creation time\",\n        description=\"When the document was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    custodian: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"custodian\",\n        title=\"Organization which maintains the document\",\n        description=(\n            \"Identifies the organization or group who is responsible for ongoing \"\n            \"maintenance of and access to the document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-readable description (title)\",\n        description=(\n            \"Human-readable description of the source document. This is sometimes \"\n            'known as the \"title\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    docStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"docStatus\",\n        title=\"preliminary | final | appended | amended | entered-in-error\",\n        description=\"The status of the underlying document.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preliminary\",\n                \"final\",\n                \"appended\",\n                \"amended\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    docStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_docStatus\", title=\"Extension field for ``docStatus``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Other identifiers for the document\",\n        description=(\n            \"Other identifiers associated with the document, including version \"\n            \"independent identifiers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    indexed: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"indexed\",\n        title=\"When this document reference was created\",\n        description=\"When the document reference was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    indexed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_indexed\", title=\"Extension field for ``indexed``.\"\n    )\n\n    masterIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"masterIdentifier\",\n        title=\"Master Version Specific Identifier\",\n        description=(\n            \"Document identifier as assigned by the source of the document. This \"\n            \"identifier is specific to this version of the document. This unique \"\n            \"identifier may be used elsewhere to identify this version of the \"\n            \"document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatesTo: typing.List[fhirtypes.DocumentReferenceRelatesToType] | None = Field(\n        default=None,\n        alias=\"relatesTo\",\n        title=\"Relationships to other documents\",\n        description=(\n            \"Relationships that this document has with other document references \"\n            \"that already exist.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Document security-tags\",\n        description=(\n            \"A set of Security-Tag codes specifying the level of privacy/security \"\n            \"of the Document. Note that DocumentReference.meta.security contains \"\n            'the security labels of the \"reference\" to the document, while '\n            \"DocumentReference.securityLabel contains a snapshot of the security \"\n            \"labels on the document the reference refers to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"current | superseded | entered-in-error\",\n        description=\"The status of this document reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"current\", \"superseded\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who/what is the subject of the document\",\n        description=(\n            \"Who or what the document is about. The document can be about a person,\"\n            \" (patient or healthcare practitioner), a device (e.g. a machine) or \"\n            \"even a group of subjects (such as a document about a herd of farm \"\n            \"animals, or a set of patients that share a common exposure).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\", \"Group\", \"Device\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Kind of document (LOINC if possible)\",\n        description=(\n            \"Specifies the particular kind of document referenced  (e.g. History \"\n            \"and Physical, Discharge Summary, Progress Note). This usually equates \"\n            \"to the purpose of making the document referenced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"masterIdentifier\",\n            \"identifier\",\n            \"status\",\n            \"docStatus\",\n            \"type\",\n            \"class\",\n            \"subject\",\n            \"created\",\n            \"indexed\",\n            \"author\",\n            \"authenticator\",\n            \"custodian\",\n            \"relatesTo\",\n            \"description\",\n            \"securityLabel\",\n            \"content\",\n            \"context\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"masterIdentifier\",\n            \"identifier\",\n            \"status\",\n            \"docStatus\",\n            \"type\",\n            \"class\",\n            \"subject\",\n            \"created\",\n            \"indexed\",\n            \"author\",\n            \"authenticator\",\n            \"custodian\",\n            \"relatesTo\",\n            \"description\",\n            \"securityLabel\",\n            \"content\",\n            \"context\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"indexed\", \"indexed__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass DocumentReferenceContent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Document referenced.\n    The document and format referenced. There may be multiple content element\n    repetitions, each with a different format.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReferenceContent\"\n\n    attachment: fhirtypes.AttachmentType = Field(\n        default=...,\n        alias=\"attachment\",\n        title=\"Where to access the document\",\n        description=(\n            \"The document or URL of the document along with critical metadata to \"\n            \"prove content has integrity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    format: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"format\",\n        title=\"Format/content rules for the document\",\n        description=(\n            \"An identifier of the document encoding, structure, and template that \"\n            \"the document conforms to beyond the base format indicated in the \"\n            \"mimeType.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReferenceContent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"attachment\", \"format\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReferenceContent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"attachment\", \"format\"]\n\n\nclass DocumentReferenceContext(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Clinical context of document.\n    The clinical context in which the document was prepared.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReferenceContext\"\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Context of the document  content\",\n        description=(\n            \"Describes the clinical encounter or type of care that the document \"\n            \"content is associated with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    event: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"Main clinical acts documented\",\n        description=(\n            \"This list of codes represents the main clinical acts, such as a \"\n            \"colonoscopy or an appendectomy, being documented. In some cases, the \"\n            'event is inherent in the typeCode, such as a \"History and Physical '\n            'Report\" in which the procedure being documented is necessarily a '\n            '\"History and Physical\" act.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    facilityType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"facilityType\",\n        title=\"Kind of facility where patient was seen\",\n        description=\"The kind of facility where the patient was seen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time of service that is being documented\",\n        description=(\n            \"The time period over which the service that is described by the \"\n            \"document was provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    practiceSetting: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"practiceSetting\",\n        title=(\n            \"Additional details about where the content was created (e.g. clinical \"\n            \"specialty)\"\n        ),\n        description=(\n            \"This property may convey specifics about the practice setting where \"\n            \"the content was created, often reflecting the clinical specialty.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    related: typing.List[fhirtypes.DocumentReferenceContextRelatedType] | None = Field(\n        default=None,\n        alias=\"related\",\n        title=\"Related identifiers or resources\",\n        description=(\n            \"Related identifiers or resources associated with the \" \"DocumentReference.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sourcePatientInfo: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sourcePatientInfo\",\n        title=\"Patient demographics from source\",\n        description=(\n            \"The Patient Information as known when the document was published. May \"\n            \"be a reference to a version specific, or contained.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReferenceContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"encounter\",\n            \"event\",\n            \"period\",\n            \"facilityType\",\n            \"practiceSetting\",\n            \"sourcePatientInfo\",\n            \"related\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReferenceContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"encounter\",\n            \"event\",\n            \"period\",\n            \"facilityType\",\n            \"practiceSetting\",\n            \"sourcePatientInfo\",\n            \"related\",\n        ]\n\n\nclass DocumentReferenceContextRelated(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Related identifiers or resources.\n    Related identifiers or resources associated with the DocumentReference.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReferenceContextRelated\"\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier of related objects or events\",\n        description=(\n            \"Related identifier to this DocumentReference. If both id and ref are \"\n            \"present they shall refer to the same thing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ref: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"ref\",\n        title=\"Related Resource\",\n        description=(\n            \"Related Resource to this DocumentReference. If both id and ref are \"\n            \"present they shall refer to the same thing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReferenceContextRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"identifier\", \"ref\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReferenceContextRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"ref\"]\n\n\nclass DocumentReferenceRelatesTo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationships to other documents.\n    Relationships that this document has with other document references that\n    already exist.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReferenceRelatesTo\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"replaces | transforms | signs | appends\",\n        description=\"The type of relationship that this document has with anther document.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"replaces\", \"transforms\", \"signs\", \"appends\"],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    target: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"target\",\n        title=\"Target of the relationship\",\n        description=\"The target document of this relationship.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReferenceRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"target\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReferenceRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"target\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/domainresource.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DomainResource\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import fhirtypes, resource\n\n\nclass DomainResource(resource.Resource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A resource with narrative, extensions, and contained resources.\n    A resource that includes narrative, extensions, and contained resources.\n    \"\"\"\n\n    __resource_type__ = \"DomainResource\"\n\n    contained: typing.List[fhirtypes.ResourceType] | None = Field(\n        default=None,\n        alias=\"contained\",\n        title=\"Contained, inline Resources\",\n        description=(\n            \"These resources do not have an independent existence apart from the \"\n            \"resource that contains them - they cannot be identified independently,\"\n            \" and nor can they have their own independent transaction scope.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    extension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"extension\",\n        title=\"Additional Content defined by implementations\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the resource. In order to make the use of \"\n            \"extensions safe and manageable, there is a strict set of governance  \"\n            \"applied to the definition and use of extensions. Though any \"\n            \"implementer is allowed to define an extension, there is a set of \"\n            \"requirements that SHALL be met as part of the definition of the \"\n            \"extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"modifierExtension\",\n        title=\"Extensions that cannot be ignored\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the resource, and that modifies the \"\n            \"understanding of the element that contains it. Usually modifier \"\n            \"elements provide negation or qualification. In order to make the use \"\n            \"of extensions safe and manageable, there is a strict set of governance\"\n            \" applied to the definition and use of extensions. Though any \"\n            \"implementer is allowed to define an extension, there is a set of \"\n            \"requirements that SHALL be met as part of the definition of the \"\n            \"extension. Applications processing a resource are required to check \"\n            \"for modifier extensions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.NarrativeType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text summary of the resource, for human interpretation\",\n        description=(\n            \"A human-readable narrative that contains a summary of the resource, \"\n            \"and may be used to represent the content of the resource to a human. \"\n            \"The narrative need not encode all the structured data, but is required\"\n            ' to contain sufficient detail to make it \"clinically safe\" for a human'\n            \" to just read the narrative. Resource definitions may define what \"\n            \"content should be represented in the narrative to ensure clinical \"\n            \"safety.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DomainResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DomainResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\"]\n"
  },
  {
    "path": "fhir/resources/STU3/dosage.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Dosage\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Dosage(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    How the medication is/was taken or should be taken.\n    Indicates how the medication is/was taken or should be taken by the\n    patient.\n    \"\"\"\n\n    __resource_type__ = \"Dosage\"\n\n    additionalInstruction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"additionalInstruction\",\n        title='Supplemental instruction - e.g. \"with meals\"',\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    asNeededBoolean: bool | None = Field(\n        default=None,\n        alias=\"asNeededBoolean\",\n        title='Take \"as needed\" (for x)',\n        description=(\n            \"Indicates whether the Medication is only taken when needed within a \"\n            \"specific dosing schedule (Boolean option), or it indicates the \"\n            \"precondition for taking the Medication (CodeableConcept).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n    asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_asNeededBoolean\",\n        title=\"Extension field for ``asNeededBoolean``.\",\n    )\n\n    asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"asNeededCodeableConcept\",\n        title='Take \"as needed\" (for x)',\n        description=(\n            \"Indicates whether the Medication is only taken when needed within a \"\n            \"specific dosing schedule (Boolean option), or it indicates the \"\n            \"precondition for taking the Medication (CodeableConcept).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    doseQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"doseQuantity\",\n        title=\"Amount of medication per dose\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e dose[x]\n            \"one_of_many\": \"dose\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    doseRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"doseRange\",\n        title=\"Amount of medication per dose\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e dose[x]\n            \"one_of_many\": \"dose\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    maxDosePerAdministration: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxDosePerAdministration\",\n        title=\"Upper limit on medication per administration\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxDosePerLifetime: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxDosePerLifetime\",\n        title=\"Upper limit on medication per lifetime of the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxDosePerPeriod: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"maxDosePerPeriod\",\n        title=\"Upper limit on medication per unit of time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Technique for administering medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patientInstruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"patientInstruction\",\n        title=\"Patient or consumer oriented instructions\",\n        description=\"Instructions in terms that are understood by the patient or consumer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    patientInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patientInstruction\",\n        title=\"Extension field for ``patientInstruction``.\",\n    )\n\n    rateQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"rateQuantity\",\n        title=\"Amount of medication per unit of time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"rateRange\",\n        title=\"Amount of medication per unit of time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"rateRatio\",\n        title=\"Amount of medication per unit of time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    route: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"route\",\n        title=\"How drug should enter body\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"The order of the dosage instructions\",\n        description=(\n            \"Indicates the order in which the dosage instructions should be applied\"\n            \" or interpreted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    site: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Body site to administer to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Free text dosage instructions e.g. SIG\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    timing: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timing\",\n        title=\"When medication should be administered\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Dosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"sequence\",\n            \"text\",\n            \"additionalInstruction\",\n            \"patientInstruction\",\n            \"timing\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n            \"site\",\n            \"route\",\n            \"method\",\n            \"doseRange\",\n            \"doseQuantity\",\n            \"maxDosePerPeriod\",\n            \"maxDosePerAdministration\",\n            \"maxDosePerLifetime\",\n            \"rateRatio\",\n            \"rateRange\",\n            \"rateQuantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Dosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"sequence\",\n            \"text\",\n            \"additionalInstruction\",\n            \"patientInstruction\",\n            \"timing\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n            \"site\",\n            \"route\",\n            \"method\",\n            \"doseRange\",\n            \"doseQuantity\",\n            \"maxDosePerPeriod\",\n            \"maxDosePerAdministration\",\n            \"maxDosePerLifetime\",\n            \"rateRatio\",\n            \"rateRange\",\n            \"rateQuantity\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"asNeeded\": [\"asNeededBoolean\", \"asNeededCodeableConcept\"],\n            \"dose\": [\"doseQuantity\", \"doseRange\"],\n            \"rate\": [\"rateQuantity\", \"rateRange\", \"rateRatio\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/duration.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Duration\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Duration(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A length of time.\n    \"\"\"\n\n    __resource_type__ = \"Duration\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Duration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Duration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/STU3/element.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Element\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom fhir_core import fhirabstractmodel\nfrom pydantic import Field\n\nfrom . import fhirtypes\n\n\nclass Element(fhirabstractmodel.FHIRAbstractModel):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base for all elements.\n    Base definition for all elements in a resource.\n    \"\"\"\n\n    __resource_type__ = \"Element\"\n\n    extension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"extension\",\n        title=\"Additional Content defined by implementations\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the element. In order to make the use of \"\n            \"extensions safe and manageable, there is a strict set of governance  \"\n            \"applied to the definition and use of extensions. Though any \"\n            \"implementer is allowed to define an extension, there is a set of \"\n            \"requirements that SHALL be met as part of the definition of the \"\n            \"extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    id: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"id\",\n        title=\"xml:id (or equivalent in JSON)\",\n        description=(\n            \"unique id for the element within a resource (for internal references).\"\n            \" This may be any string value that does not contain spaces.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Element`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Element`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n"
  },
  {
    "path": "fhir/resources/STU3/elementdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ElementDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass ElementDefinition(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of an element in a resource or extension.\n    Captures constraints on each element within the resource, profile, or\n    extension.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinition\"\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=\"Other names\",\n        description=\"Identifies additional names by which this element might also be known.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    base: fhirtypes.ElementDefinitionBaseType | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"Base definition information for tools\",\n        description=(\n            \"Information about the base definition of the element, provided to make\"\n            \" it unnecessary for tools to trace the deviation of the element \"\n            \"through the derived and related profiles. This information is provided\"\n            \" when the element definition is not the original definition of an \"\n            \"element - i.g. either in a constraint on another type, or for elements\"\n            \" from a super type in a snap shot.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    binding: fhirtypes.ElementDefinitionBindingType | None = Field(\n        default=None,\n        alias=\"binding\",\n        title=\"ValueSet details if this is coded\",\n        description=(\n            \"Binds to a value set if this element is coded (code, Coding, \"\n            \"CodeableConcept, Quantity), or the data types (string, uri).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Corresponding codes in terminologies\",\n        description=(\n            \"A code that has the same meaning as the element in a particular \"\n            \"terminology.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments about the use of this element\",\n        description=(\n            \"Explanatory notes and implementation guidance about the data element, \"\n            \"including notes about how to use the data properly, exceptions to \"\n            \"proper use, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    condition: typing.List[fhirtypes.IdType | None] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Reference to invariant about presence\",\n        description=(\n            \"A reference to an invariant that may make additional statements about \"\n            \"the cardinality or value in the instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    condition__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_condition\", title=\"Extension field for ``condition``.\"\n    )\n\n    constraint: typing.List[fhirtypes.ElementDefinitionConstraintType] | None = Field(\n        default=None,\n        alias=\"constraint\",\n        title=\"Condition that must evaluate to true\",\n        description=(\n            \"Formal constraints such as co-occurrence and other constraints that \"\n            \"can be computationally evaluated within the context of the instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contentReference: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Reference to definition of content for the element\",\n        description=(\n            \"Identifies the identity of an element defined elsewhere in the profile\"\n            \" whose content rules should be applied to the current element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    contentReference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_contentReference\",\n        title=\"Extension field for ``contentReference``.\",\n    )\n\n    defaultValueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"defaultValueAddress\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"defaultValueAge\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"defaultValueAnnotation\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"defaultValueAttachment\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"defaultValueBase64Binary\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueBase64Binary\",\n        title=\"Extension field for ``defaultValueBase64Binary``.\",\n    )\n\n    defaultValueBoolean: bool | None = Field(\n        default=None,\n        alias=\"defaultValueBoolean\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueBoolean\",\n        title=\"Extension field for ``defaultValueBoolean``.\",\n    )\n\n    defaultValueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"defaultValueCode\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueCode\",\n        title=\"Extension field for ``defaultValueCode``.\",\n    )\n\n    defaultValueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"defaultValueCodeableConcept\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"defaultValueCoding\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"defaultValueContactPoint\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"defaultValueCount\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"defaultValueDate\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDate\",\n        title=\"Extension field for ``defaultValueDate``.\",\n    )\n\n    defaultValueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"defaultValueDateTime\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDateTime\",\n        title=\"Extension field for ``defaultValueDateTime``.\",\n    )\n\n    defaultValueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"defaultValueDecimal\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDecimal\",\n        title=\"Extension field for ``defaultValueDecimal``.\",\n    )\n\n    defaultValueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"defaultValueDistance\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"defaultValueDuration\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"defaultValueHumanName\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"defaultValueId\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueId\",\n        title=\"Extension field for ``defaultValueId``.\",\n    )\n\n    defaultValueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"defaultValueIdentifier\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"defaultValueInstant\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueInstant\",\n        title=\"Extension field for ``defaultValueInstant``.\",\n    )\n\n    defaultValueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"defaultValueInteger\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueInteger\",\n        title=\"Extension field for ``defaultValueInteger``.\",\n    )\n\n    defaultValueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"defaultValueMarkdown\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueMarkdown\",\n        title=\"Extension field for ``defaultValueMarkdown``.\",\n    )\n\n    defaultValueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"defaultValueMeta\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"defaultValueMoney\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"defaultValueOid\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueOid\",\n        title=\"Extension field for ``defaultValueOid``.\",\n    )\n\n    defaultValuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"defaultValuePeriod\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"defaultValuePositiveInt\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValuePositiveInt\",\n        title=\"Extension field for ``defaultValuePositiveInt``.\",\n    )\n\n    defaultValueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"defaultValueQuantity\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"defaultValueRange\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"defaultValueRatio\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"defaultValueReference\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"defaultValueSampledData\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"defaultValueSignature\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"defaultValueString\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueString\",\n        title=\"Extension field for ``defaultValueString``.\",\n    )\n\n    defaultValueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"defaultValueTime\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueTime\",\n        title=\"Extension field for ``defaultValueTime``.\",\n    )\n\n    defaultValueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"defaultValueTiming\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"defaultValueUnsignedInt\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUnsignedInt\",\n        title=\"Extension field for ``defaultValueUnsignedInt``.\",\n    )\n\n    defaultValueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"defaultValueUri\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUri\",\n        title=\"Extension field for ``defaultValueUri``.\",\n    )\n\n    definition: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Full formal definition as narrative text\",\n        description=(\n            \"Provides a complete explanation of the meaning of the data element for\"\n            \" human readability.  For the case of elements derived from existing \"\n            \"elements (e.g. constraints), the definition SHALL be consistent with \"\n            \"the base definition, but convey the meaning of the element in the \"\n            \"particular context of use of the resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    example: typing.List[fhirtypes.ElementDefinitionExampleType] | None = Field(\n        default=None,\n        alias=\"example\",\n        title=\"Example value (as defined for type)\",\n        description=(\n            \"A sample value for this element demonstrating the type of information \"\n            \"that would typically be found in the element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    fixedAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"fixedAddress\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"fixedAge\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"fixedAnnotation\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"fixedAttachment\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"fixedBase64Binary\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedBase64Binary\",\n        title=\"Extension field for ``fixedBase64Binary``.\",\n    )\n\n    fixedBoolean: bool | None = Field(\n        default=None,\n        alias=\"fixedBoolean\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedBoolean\",\n        title=\"Extension field for ``fixedBoolean``.\",\n    )\n\n    fixedCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"fixedCode\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedCode\", title=\"Extension field for ``fixedCode``.\"\n    )\n\n    fixedCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fixedCodeableConcept\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"fixedCoding\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"fixedContactPoint\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"fixedCount\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"fixedDate\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedDate\", title=\"Extension field for ``fixedDate``.\"\n    )\n\n    fixedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"fixedDateTime\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedDateTime\",\n        title=\"Extension field for ``fixedDateTime``.\",\n    )\n\n    fixedDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"fixedDecimal\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedDecimal\",\n        title=\"Extension field for ``fixedDecimal``.\",\n    )\n\n    fixedDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"fixedDistance\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"fixedDuration\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"fixedHumanName\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"fixedId\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedId\", title=\"Extension field for ``fixedId``.\"\n    )\n\n    fixedIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"fixedIdentifier\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"fixedInstant\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedInstant\",\n        title=\"Extension field for ``fixedInstant``.\",\n    )\n\n    fixedInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"fixedInteger\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedInteger\",\n        title=\"Extension field for ``fixedInteger``.\",\n    )\n\n    fixedMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"fixedMarkdown\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedMarkdown\",\n        title=\"Extension field for ``fixedMarkdown``.\",\n    )\n\n    fixedMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"fixedMeta\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"fixedMoney\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"fixedOid\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedOid\", title=\"Extension field for ``fixedOid``.\"\n    )\n\n    fixedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"fixedPeriod\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"fixedPositiveInt\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedPositiveInt\",\n        title=\"Extension field for ``fixedPositiveInt``.\",\n    )\n\n    fixedQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"fixedQuantity\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"fixedRange\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"fixedRatio\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"fixedReference\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"fixedSampledData\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"fixedSignature\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"fixedString\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedString\", title=\"Extension field for ``fixedString``.\"\n    )\n\n    fixedTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"fixedTime\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedTime\", title=\"Extension field for ``fixedTime``.\"\n    )\n\n    fixedTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"fixedTiming\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"fixedUnsignedInt\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedUnsignedInt\",\n        title=\"Extension field for ``fixedUnsignedInt``.\",\n    )\n\n    fixedUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"fixedUri\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance. For purposes of comparison, non-significant whitespace \"\n            \"is ignored, and all values must be an exact match (case and accent \"\n            \"sensitive). Missing elements/attributes must also be missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedUri\", title=\"Extension field for ``fixedUri``.\"\n    )\n\n    isModifier: bool | None = Field(\n        default=None,\n        alias=\"isModifier\",\n        title=\"If this modifies the meaning of other elements\",\n        description=(\n            \"If true, the value of this element affects the interpretation of the \"\n            \"element or resource that contains it, and the value of the element \"\n            \"cannot be ignored. Typically, this is used for status, negation and \"\n            \"qualification codes. The effect of this is that the element cannot be \"\n            \"ignored by systems: they SHALL either recognize the element and \"\n            \"process it, and/or a pre-determination has been made that it is not \"\n            \"relevant to their particular system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isModifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isModifier\", title=\"Extension field for ``isModifier``.\"\n    )\n\n    isSummary: bool | None = Field(\n        default=None,\n        alias=\"isSummary\",\n        title=\"Include when _summary = true?\",\n        description=(\n            \"Whether the element should be included if a client requests a search \"\n            \"with the parameter _summary=true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isSummary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isSummary\", title=\"Extension field for ``isSummary``.\"\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Name for element to display with or prompt for element\",\n        description=(\n            \"A single preferred label which is the text to display beside the \"\n            \"element indicating its meaning or to use to prompt for the element in \"\n            \"a user display or form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    mapping: typing.List[fhirtypes.ElementDefinitionMappingType] | None = Field(\n        default=None,\n        alias=\"mapping\",\n        title=\"Map element to another set of definitions\",\n        description=(\n            \"Identifies a concept from an external specification that roughly \"\n            \"corresponds to this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum Cardinality (a number or *)\",\n        description=(\n            \"The maximum number of times this element is permitted to appear in the\"\n            \" instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    maxLength: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"maxLength\",\n        title=\"Max length for strings\",\n        description=(\n            \"Indicates the maximum length in characters that is permitted to be \"\n            \"present in conformant instances and which is expected to be supported \"\n            \"by conformant consumers that support the element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    maxLength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_maxLength\", title=\"Extension field for ``maxLength``.\"\n    )\n\n    maxValueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"maxValueDate\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueDate\",\n        title=\"Extension field for ``maxValueDate``.\",\n    )\n\n    maxValueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"maxValueDateTime\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueDateTime\",\n        title=\"Extension field for ``maxValueDateTime``.\",\n    )\n\n    maxValueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"maxValueDecimal\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueDecimal\",\n        title=\"Extension field for ``maxValueDecimal``.\",\n    )\n\n    maxValueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"maxValueInstant\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueInstant\",\n        title=\"Extension field for ``maxValueInstant``.\",\n    )\n\n    maxValueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"maxValueInteger\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueInteger\",\n        title=\"Extension field for ``maxValueInteger``.\",\n    )\n\n    maxValuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"maxValuePositiveInt\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValuePositiveInt\",\n        title=\"Extension field for ``maxValuePositiveInt``.\",\n    )\n\n    maxValueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxValueQuantity\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    maxValueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"maxValueTime\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueTime\",\n        title=\"Extension field for ``maxValueTime``.\",\n    )\n\n    maxValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"maxValueUnsignedInt\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueUnsignedInt\",\n        title=\"Extension field for ``maxValueUnsignedInt``.\",\n    )\n\n    meaningWhenMissing: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"meaningWhenMissing\",\n        title=\"Implicit meaning when this element is missing\",\n        description=(\n            \"The Implicit meaning that is to be understood when this element is \"\n            \"missing (e.g. 'when this element is missing, the period is ongoing'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    meaningWhenMissing__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_meaningWhenMissing\",\n        title=\"Extension field for ``meaningWhenMissing``.\",\n    )\n\n    min: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum Cardinality\",\n        description=\"The minimum number of times this element SHALL appear in the instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    minValueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"minValueDate\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueDate\",\n        title=\"Extension field for ``minValueDate``.\",\n    )\n\n    minValueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"minValueDateTime\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueDateTime\",\n        title=\"Extension field for ``minValueDateTime``.\",\n    )\n\n    minValueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"minValueDecimal\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueDecimal\",\n        title=\"Extension field for ``minValueDecimal``.\",\n    )\n\n    minValueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"minValueInstant\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueInstant\",\n        title=\"Extension field for ``minValueInstant``.\",\n    )\n\n    minValueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"minValueInteger\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueInteger\",\n        title=\"Extension field for ``minValueInteger``.\",\n    )\n\n    minValuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"minValuePositiveInt\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValuePositiveInt\",\n        title=\"Extension field for ``minValuePositiveInt``.\",\n    )\n\n    minValueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"minValueQuantity\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    minValueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"minValueTime\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueTime\",\n        title=\"Extension field for ``minValueTime``.\",\n    )\n\n    minValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"minValueUnsignedInt\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueUnsignedInt\",\n        title=\"Extension field for ``minValueUnsignedInt``.\",\n    )\n\n    mustSupport: bool | None = Field(\n        default=None,\n        alias=\"mustSupport\",\n        title=\"If the element must supported\",\n        description=(\n            \"If true, implementations that produce or consume resources SHALL \"\n            'provide \"support\" for the element in some meaningful way.  If false, '\n            \"the element may be ignored and not supported.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    mustSupport__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mustSupport\", title=\"Extension field for ``mustSupport``.\"\n    )\n\n    orderMeaning: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"orderMeaning\",\n        title=\"What the order of the elements means\",\n        description=(\n            \"If present, indicates that the order of the repeating element has \"\n            \"meaning and describes what that meaning is.  If absent, it means that \"\n            \"the order of the element has no meaning.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    orderMeaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_orderMeaning\",\n        title=\"Extension field for ``orderMeaning``.\",\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path of the element in the hierarchy of elements\",\n        description=(\n            'The path identifies the element and is expressed as a \".\"-separated '\n            \"list of ancestor elements, beginning with the name of the resource or \"\n            \"extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    patternAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"patternAddress\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"patternAge\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"patternAnnotation\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"patternAttachment\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"patternBase64Binary\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternBase64Binary\",\n        title=\"Extension field for ``patternBase64Binary``.\",\n    )\n\n    patternBoolean: bool | None = Field(\n        default=None,\n        alias=\"patternBoolean\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternBoolean\",\n        title=\"Extension field for ``patternBoolean``.\",\n    )\n\n    patternCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"patternCode\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternCode\", title=\"Extension field for ``patternCode``.\"\n    )\n\n    patternCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"patternCodeableConcept\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"patternCoding\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"patternContactPoint\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"patternCount\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"patternDate\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternDate\", title=\"Extension field for ``patternDate``.\"\n    )\n\n    patternDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"patternDateTime\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternDateTime\",\n        title=\"Extension field for ``patternDateTime``.\",\n    )\n\n    patternDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"patternDecimal\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternDecimal\",\n        title=\"Extension field for ``patternDecimal``.\",\n    )\n\n    patternDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"patternDistance\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"patternDuration\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"patternHumanName\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"patternId\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternId\", title=\"Extension field for ``patternId``.\"\n    )\n\n    patternIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"patternIdentifier\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"patternInstant\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternInstant\",\n        title=\"Extension field for ``patternInstant``.\",\n    )\n\n    patternInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"patternInteger\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternInteger\",\n        title=\"Extension field for ``patternInteger``.\",\n    )\n\n    patternMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"patternMarkdown\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternMarkdown\",\n        title=\"Extension field for ``patternMarkdown``.\",\n    )\n\n    patternMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"patternMeta\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patternMoney\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"patternOid\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternOid\", title=\"Extension field for ``patternOid``.\"\n    )\n\n    patternPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"patternPeriod\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"patternPositiveInt\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternPositiveInt\",\n        title=\"Extension field for ``patternPositiveInt``.\",\n    )\n\n    patternQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"patternQuantity\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"patternRange\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"patternRatio\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patternReference\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"patternSampledData\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"patternSignature\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"patternString\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternString\",\n        title=\"Extension field for ``patternString``.\",\n    )\n\n    patternTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"patternTime\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternTime\", title=\"Extension field for ``patternTime``.\"\n    )\n\n    patternTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"patternTiming\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"patternUnsignedInt\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternUnsignedInt\",\n        title=\"Extension field for ``patternUnsignedInt``.\",\n    )\n\n    patternUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"patternUri\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that the value in the instance SHALL follow - that \"\n            \"is, any value in the pattern must be found in the instance. Other \"\n            \"additional values may be found too. This is effectively constraint by \"\n            \"example.  The values of elements present in the pattern must match \"\n            \"exactly (case-sensitive, accent-sensitive, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternUri\", title=\"Extension field for ``patternUri``.\"\n    )\n\n    representation: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"representation\",\n        title=\"xmlAttr | xmlText | typeAttr | cdaText | xhtml\",\n        description=(\n            \"Codes that define how this element is represented in instances, when \"\n            \"the deviation varies from the normal case.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"xmlAttr\", \"xmlText\", \"typeAttr\", \"cdaText\", \"xhtml\"],\n        },\n    )\n    representation__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_representation\",\n        title=\"Extension field for ``representation``.\",\n    )\n\n    requirements: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"requirements\",\n        title=\"Why this resource has been created\",\n        description=(\n            \"This element is for traceability of why the element was created and \"\n            \"why the constraints exist as they do. This may be used to point to \"\n            \"source materials or specifications that drove the structure of this \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    requirements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requirements\",\n        title=\"Extension field for ``requirements``.\",\n    )\n\n    short: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"short\",\n        title=\"Concise definition for space-constrained presentation\",\n        description=(\n            \"A concise description of what this element means (e.g. for use in \"\n            \"autogenerated summaries).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    short__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_short\", title=\"Extension field for ``short``.\"\n    )\n\n    sliceName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sliceName\",\n        title=\"Name for this particular element (in a set of slices)\",\n        description=(\n            \"The name of this element definition slice, when slicing is working. \"\n            \"The name must be a token with no dots or spaces. This is a unique name\"\n            \" referring to a specific set of constraints applied to this element, \"\n            \"used to provide a name to different slices of the same element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sliceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sliceName\", title=\"Extension field for ``sliceName``.\"\n    )\n\n    slicing: fhirtypes.ElementDefinitionSlicingType | None = Field(\n        default=None,\n        alias=\"slicing\",\n        title=\"This element is sliced - slices follow\",\n        description=(\n            \"Indicates that the element is sliced into a set of alternative \"\n            \"definitions (i.e. in a structure definition, there are multiple \"\n            \"different constraints on a single element in the base resource). \"\n            \"Slicing can be used in any resource that has cardinality ..* on the \"\n            \"base resource, or any resource with a choice of types. The set of \"\n            \"slices is any elements that come after this in the element sequence \"\n            \"that have the same path, until a shorter path occurs (the shorter path\"\n            \" terminates the set).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.ElementDefinitionTypeType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Data type and Profile for this element\",\n        description=(\n            \"The data type or resource that the value of this element is permitted \"\n            \"to be.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"path\",\n            \"representation\",\n            \"sliceName\",\n            \"label\",\n            \"code\",\n            \"slicing\",\n            \"short\",\n            \"definition\",\n            \"comment\",\n            \"requirements\",\n            \"alias\",\n            \"min\",\n            \"max\",\n            \"base\",\n            \"contentReference\",\n            \"type\",\n            \"defaultValueBase64Binary\",\n            \"defaultValueBoolean\",\n            \"defaultValueCode\",\n            \"defaultValueDate\",\n            \"defaultValueDateTime\",\n            \"defaultValueDecimal\",\n            \"defaultValueId\",\n            \"defaultValueInstant\",\n            \"defaultValueInteger\",\n            \"defaultValueMarkdown\",\n            \"defaultValueOid\",\n            \"defaultValuePositiveInt\",\n            \"defaultValueString\",\n            \"defaultValueTime\",\n            \"defaultValueUnsignedInt\",\n            \"defaultValueUri\",\n            \"defaultValueAddress\",\n            \"defaultValueAge\",\n            \"defaultValueAnnotation\",\n            \"defaultValueAttachment\",\n            \"defaultValueCodeableConcept\",\n            \"defaultValueCoding\",\n            \"defaultValueContactPoint\",\n            \"defaultValueCount\",\n            \"defaultValueDistance\",\n            \"defaultValueDuration\",\n            \"defaultValueHumanName\",\n            \"defaultValueIdentifier\",\n            \"defaultValueMoney\",\n            \"defaultValuePeriod\",\n            \"defaultValueQuantity\",\n            \"defaultValueRange\",\n            \"defaultValueRatio\",\n            \"defaultValueReference\",\n            \"defaultValueSampledData\",\n            \"defaultValueSignature\",\n            \"defaultValueTiming\",\n            \"defaultValueMeta\",\n            \"meaningWhenMissing\",\n            \"orderMeaning\",\n            \"fixedBase64Binary\",\n            \"fixedBoolean\",\n            \"fixedCode\",\n            \"fixedDate\",\n            \"fixedDateTime\",\n            \"fixedDecimal\",\n            \"fixedId\",\n            \"fixedInstant\",\n            \"fixedInteger\",\n            \"fixedMarkdown\",\n            \"fixedOid\",\n            \"fixedPositiveInt\",\n            \"fixedString\",\n            \"fixedTime\",\n            \"fixedUnsignedInt\",\n            \"fixedUri\",\n            \"fixedAddress\",\n            \"fixedAge\",\n            \"fixedAnnotation\",\n            \"fixedAttachment\",\n            \"fixedCodeableConcept\",\n            \"fixedCoding\",\n            \"fixedContactPoint\",\n            \"fixedCount\",\n            \"fixedDistance\",\n            \"fixedDuration\",\n            \"fixedHumanName\",\n            \"fixedIdentifier\",\n            \"fixedMoney\",\n            \"fixedPeriod\",\n            \"fixedQuantity\",\n            \"fixedRange\",\n            \"fixedRatio\",\n            \"fixedReference\",\n            \"fixedSampledData\",\n            \"fixedSignature\",\n            \"fixedTiming\",\n            \"fixedMeta\",\n            \"patternBase64Binary\",\n            \"patternBoolean\",\n            \"patternCode\",\n            \"patternDate\",\n            \"patternDateTime\",\n            \"patternDecimal\",\n            \"patternId\",\n            \"patternInstant\",\n            \"patternInteger\",\n            \"patternMarkdown\",\n            \"patternOid\",\n            \"patternPositiveInt\",\n            \"patternString\",\n            \"patternTime\",\n            \"patternUnsignedInt\",\n            \"patternUri\",\n            \"patternAddress\",\n            \"patternAge\",\n            \"patternAnnotation\",\n            \"patternAttachment\",\n            \"patternCodeableConcept\",\n            \"patternCoding\",\n            \"patternContactPoint\",\n            \"patternCount\",\n            \"patternDistance\",\n            \"patternDuration\",\n            \"patternHumanName\",\n            \"patternIdentifier\",\n            \"patternMoney\",\n            \"patternPeriod\",\n            \"patternQuantity\",\n            \"patternRange\",\n            \"patternRatio\",\n            \"patternReference\",\n            \"patternSampledData\",\n            \"patternSignature\",\n            \"patternTiming\",\n            \"patternMeta\",\n            \"example\",\n            \"minValueDate\",\n            \"minValueDateTime\",\n            \"minValueInstant\",\n            \"minValueTime\",\n            \"minValueDecimal\",\n            \"minValueInteger\",\n            \"minValuePositiveInt\",\n            \"minValueUnsignedInt\",\n            \"minValueQuantity\",\n            \"maxValueDate\",\n            \"maxValueDateTime\",\n            \"maxValueInstant\",\n            \"maxValueTime\",\n            \"maxValueDecimal\",\n            \"maxValueInteger\",\n            \"maxValuePositiveInt\",\n            \"maxValueUnsignedInt\",\n            \"maxValueQuantity\",\n            \"maxLength\",\n            \"condition\",\n            \"constraint\",\n            \"mustSupport\",\n            \"isModifier\",\n            \"isSummary\",\n            \"binding\",\n            \"mapping\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"path\",\n            \"representation\",\n            \"sliceName\",\n            \"label\",\n            \"code\",\n            \"slicing\",\n            \"short\",\n            \"definition\",\n            \"comment\",\n            \"requirements\",\n            \"alias\",\n            \"min\",\n            \"max\",\n            \"base\",\n            \"contentReference\",\n            \"type\",\n            \"defaultValueBase64Binary\",\n            \"defaultValueBoolean\",\n            \"defaultValueCode\",\n            \"defaultValueDate\",\n            \"defaultValueDateTime\",\n            \"defaultValueDecimal\",\n            \"defaultValueId\",\n            \"defaultValueInstant\",\n            \"defaultValueInteger\",\n            \"defaultValueMarkdown\",\n            \"defaultValueOid\",\n            \"defaultValuePositiveInt\",\n            \"defaultValueString\",\n            \"defaultValueTime\",\n            \"defaultValueUnsignedInt\",\n            \"defaultValueUri\",\n            \"defaultValueAddress\",\n            \"defaultValueAge\",\n            \"defaultValueAnnotation\",\n            \"defaultValueAttachment\",\n            \"defaultValueCodeableConcept\",\n            \"defaultValueCoding\",\n            \"defaultValueContactPoint\",\n            \"defaultValueCount\",\n            \"defaultValueDistance\",\n            \"defaultValueDuration\",\n            \"defaultValueHumanName\",\n            \"defaultValueIdentifier\",\n            \"defaultValueMoney\",\n            \"defaultValuePeriod\",\n            \"defaultValueQuantity\",\n            \"defaultValueRange\",\n            \"defaultValueRatio\",\n            \"defaultValueReference\",\n            \"defaultValueSampledData\",\n            \"defaultValueSignature\",\n            \"defaultValueTiming\",\n            \"defaultValueMeta\",\n            \"meaningWhenMissing\",\n            \"orderMeaning\",\n            \"fixedBase64Binary\",\n            \"fixedBoolean\",\n            \"fixedCode\",\n            \"fixedDate\",\n            \"fixedDateTime\",\n            \"fixedDecimal\",\n            \"fixedId\",\n            \"fixedInstant\",\n            \"fixedInteger\",\n            \"fixedMarkdown\",\n            \"fixedOid\",\n            \"fixedPositiveInt\",\n            \"fixedString\",\n            \"fixedTime\",\n            \"fixedUnsignedInt\",\n            \"fixedUri\",\n            \"fixedAddress\",\n            \"fixedAge\",\n            \"fixedAnnotation\",\n            \"fixedAttachment\",\n            \"fixedCodeableConcept\",\n            \"fixedCoding\",\n            \"fixedContactPoint\",\n            \"fixedCount\",\n            \"fixedDistance\",\n            \"fixedDuration\",\n            \"fixedHumanName\",\n            \"fixedIdentifier\",\n            \"fixedMoney\",\n            \"fixedPeriod\",\n            \"fixedQuantity\",\n            \"fixedRange\",\n            \"fixedRatio\",\n            \"fixedReference\",\n            \"fixedSampledData\",\n            \"fixedSignature\",\n            \"fixedTiming\",\n            \"fixedMeta\",\n            \"patternBase64Binary\",\n            \"patternBoolean\",\n            \"patternCode\",\n            \"patternDate\",\n            \"patternDateTime\",\n            \"patternDecimal\",\n            \"patternId\",\n            \"patternInstant\",\n            \"patternInteger\",\n            \"patternMarkdown\",\n            \"patternOid\",\n            \"patternPositiveInt\",\n            \"patternString\",\n            \"patternTime\",\n            \"patternUnsignedInt\",\n            \"patternUri\",\n            \"patternAddress\",\n            \"patternAge\",\n            \"patternAnnotation\",\n            \"patternAttachment\",\n            \"patternCodeableConcept\",\n            \"patternCoding\",\n            \"patternContactPoint\",\n            \"patternCount\",\n            \"patternDistance\",\n            \"patternDuration\",\n            \"patternHumanName\",\n            \"patternIdentifier\",\n            \"patternMoney\",\n            \"patternPeriod\",\n            \"patternQuantity\",\n            \"patternRange\",\n            \"patternRatio\",\n            \"patternReference\",\n            \"patternSampledData\",\n            \"patternSignature\",\n            \"patternTiming\",\n            \"patternMeta\",\n            \"example\",\n            \"minValueDate\",\n            \"minValueDateTime\",\n            \"minValueInstant\",\n            \"minValueTime\",\n            \"minValueDecimal\",\n            \"minValueInteger\",\n            \"minValuePositiveInt\",\n            \"minValueUnsignedInt\",\n            \"minValueQuantity\",\n            \"maxValueDate\",\n            \"maxValueDateTime\",\n            \"maxValueInstant\",\n            \"maxValueTime\",\n            \"maxValueDecimal\",\n            \"maxValueInteger\",\n            \"maxValuePositiveInt\",\n            \"maxValueUnsignedInt\",\n            \"maxValueQuantity\",\n            \"maxLength\",\n            \"condition\",\n            \"constraint\",\n            \"mustSupport\",\n            \"isModifier\",\n            \"isSummary\",\n            \"binding\",\n            \"mapping\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"path\", \"path__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"defaultValue\": [\n                \"defaultValueAddress\",\n                \"defaultValueAge\",\n                \"defaultValueAnnotation\",\n                \"defaultValueAttachment\",\n                \"defaultValueBase64Binary\",\n                \"defaultValueBoolean\",\n                \"defaultValueCode\",\n                \"defaultValueCodeableConcept\",\n                \"defaultValueCoding\",\n                \"defaultValueContactPoint\",\n                \"defaultValueCount\",\n                \"defaultValueDate\",\n                \"defaultValueDateTime\",\n                \"defaultValueDecimal\",\n                \"defaultValueDistance\",\n                \"defaultValueDuration\",\n                \"defaultValueHumanName\",\n                \"defaultValueId\",\n                \"defaultValueIdentifier\",\n                \"defaultValueInstant\",\n                \"defaultValueInteger\",\n                \"defaultValueMarkdown\",\n                \"defaultValueMeta\",\n                \"defaultValueMoney\",\n                \"defaultValueOid\",\n                \"defaultValuePeriod\",\n                \"defaultValuePositiveInt\",\n                \"defaultValueQuantity\",\n                \"defaultValueRange\",\n                \"defaultValueRatio\",\n                \"defaultValueReference\",\n                \"defaultValueSampledData\",\n                \"defaultValueSignature\",\n                \"defaultValueString\",\n                \"defaultValueTime\",\n                \"defaultValueTiming\",\n                \"defaultValueUnsignedInt\",\n                \"defaultValueUri\",\n            ],\n            \"fixed\": [\n                \"fixedAddress\",\n                \"fixedAge\",\n                \"fixedAnnotation\",\n                \"fixedAttachment\",\n                \"fixedBase64Binary\",\n                \"fixedBoolean\",\n                \"fixedCode\",\n                \"fixedCodeableConcept\",\n                \"fixedCoding\",\n                \"fixedContactPoint\",\n                \"fixedCount\",\n                \"fixedDate\",\n                \"fixedDateTime\",\n                \"fixedDecimal\",\n                \"fixedDistance\",\n                \"fixedDuration\",\n                \"fixedHumanName\",\n                \"fixedId\",\n                \"fixedIdentifier\",\n                \"fixedInstant\",\n                \"fixedInteger\",\n                \"fixedMarkdown\",\n                \"fixedMeta\",\n                \"fixedMoney\",\n                \"fixedOid\",\n                \"fixedPeriod\",\n                \"fixedPositiveInt\",\n                \"fixedQuantity\",\n                \"fixedRange\",\n                \"fixedRatio\",\n                \"fixedReference\",\n                \"fixedSampledData\",\n                \"fixedSignature\",\n                \"fixedString\",\n                \"fixedTime\",\n                \"fixedTiming\",\n                \"fixedUnsignedInt\",\n                \"fixedUri\",\n            ],\n            \"maxValue\": [\n                \"maxValueDate\",\n                \"maxValueDateTime\",\n                \"maxValueDecimal\",\n                \"maxValueInstant\",\n                \"maxValueInteger\",\n                \"maxValuePositiveInt\",\n                \"maxValueQuantity\",\n                \"maxValueTime\",\n                \"maxValueUnsignedInt\",\n            ],\n            \"minValue\": [\n                \"minValueDate\",\n                \"minValueDateTime\",\n                \"minValueDecimal\",\n                \"minValueInstant\",\n                \"minValueInteger\",\n                \"minValuePositiveInt\",\n                \"minValueQuantity\",\n                \"minValueTime\",\n                \"minValueUnsignedInt\",\n            ],\n            \"pattern\": [\n                \"patternAddress\",\n                \"patternAge\",\n                \"patternAnnotation\",\n                \"patternAttachment\",\n                \"patternBase64Binary\",\n                \"patternBoolean\",\n                \"patternCode\",\n                \"patternCodeableConcept\",\n                \"patternCoding\",\n                \"patternContactPoint\",\n                \"patternCount\",\n                \"patternDate\",\n                \"patternDateTime\",\n                \"patternDecimal\",\n                \"patternDistance\",\n                \"patternDuration\",\n                \"patternHumanName\",\n                \"patternId\",\n                \"patternIdentifier\",\n                \"patternInstant\",\n                \"patternInteger\",\n                \"patternMarkdown\",\n                \"patternMeta\",\n                \"patternMoney\",\n                \"patternOid\",\n                \"patternPeriod\",\n                \"patternPositiveInt\",\n                \"patternQuantity\",\n                \"patternRange\",\n                \"patternRatio\",\n                \"patternReference\",\n                \"patternSampledData\",\n                \"patternSignature\",\n                \"patternString\",\n                \"patternTime\",\n                \"patternTiming\",\n                \"patternUnsignedInt\",\n                \"patternUri\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ElementDefinitionBase(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base definition information for tools.\n    Information about the base definition of the element, provided to make it\n    unnecessary for tools to trace the deviation of the element through the\n    derived and related profiles. This information is provided when the element\n    definition is not the original definition of an element - i.g. either in a\n    constraint on another type, or for elements from a super type in a snap\n    shot.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionBase\"\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Max cardinality of the base element\",\n        description=\"Maximum cardinality of the base element identified by the path.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Min cardinality of the base element\",\n        description=\"Minimum cardinality of the base element identified by the path.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path that identifies the base element\",\n        description=(\n            \"The Path that identifies the base element - this matches the \"\n            \"ElementDefinition.path for that element. Across FHIR, there is only \"\n            \"one base definition of any element - that is, an element definition on\"\n            \" a [StructureDefinition](structuredefinition.html#) without a \"\n            \"StructureDefinition.base.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionBase`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"path\", \"min\", \"max\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionBase`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"path\", \"min\", \"max\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"max\", \"max__ext\"),\n            (\"min\", \"min__ext\"),\n            (\"path\", \"path__ext\"),\n        ]\n        return required_fields\n\n\nclass ElementDefinitionBinding(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    ValueSet details if this is coded.\n    Binds to a value set if this element is coded (code, Coding,\n    CodeableConcept, Quantity), or the data types (string, uri).\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionBinding\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human explanation of the value set\",\n        description=\"Describes the intended use of this particular set of codes.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    strength: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"strength\",\n        title=\"required | extensible | preferred | example\",\n        description=(\n            \"Indicates the degree of conformance expectations associated with this \"\n            \"binding - that is, the degree to which the provided value set must be \"\n            \"adhered to in the instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"required\", \"extensible\", \"preferred\", \"example\"],\n        },\n    )\n    strength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_strength\", title=\"Extension field for ``strength``.\"\n    )\n\n    valueSetReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueSetReference\",\n        title=\"Source of value set\",\n        description=(\n            \"Points to the value set or external definition (e.g. implicit value \"\n            \"set) that identifies the set of codes to be used. If the binding \"\n            \"refers to an explicit value set - the normal case - then use a \"\n            \"Reference(ValueSet) preferably containing the canonical URL for the \"\n            \"value set. If the reference is to an implicit value set - usually, an \"\n            \"IETF RFC that defines a grammar, such as mime types - then use a uri.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e valueSet[x]\n            \"one_of_many\": \"valueSet\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n\n    valueSetUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueSetUri\",\n        title=\"Source of value set\",\n        description=(\n            \"Points to the value set or external definition (e.g. implicit value \"\n            \"set) that identifies the set of codes to be used. If the binding \"\n            \"refers to an explicit value set - the normal case - then use a \"\n            \"Reference(ValueSet) preferably containing the canonical URL for the \"\n            \"value set. If the reference is to an implicit value set - usually, an \"\n            \"IETF RFC that defines a grammar, such as mime types - then use a uri.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e valueSet[x]\n            \"one_of_many\": \"valueSet\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueSetUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSetUri\", title=\"Extension field for ``valueSetUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionBinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"strength\",\n            \"description\",\n            \"valueSetUri\",\n            \"valueSetReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionBinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"strength\", \"description\", \"valueSetUri\", \"valueSetReference\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"strength\", \"strength__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"valueSet\": [\"valueSetReference\", \"valueSetUri\"]}\n        return one_of_many_fields\n\n\nclass ElementDefinitionConstraint(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Condition that must evaluate to true.\n    Formal constraints such as co-occurrence and other constraints that can be\n    computationally evaluated within the context of the instance.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionConstraint\"\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"FHIRPath expression of constraint\",\n        description=(\n            \"A [FHIRPath](http://hl7.org/fluentpath) expression of constraint that \"\n            \"can be executed to see if this constraint is met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    human: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"human\",\n        title=\"Human description of constraint\",\n        description=(\n            \"Text that can be used to describe the constraint in messages \"\n            \"identifying that the constraint has been violated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    human__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_human\", title=\"Extension field for ``human``.\"\n    )\n\n    key: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"key\",\n        title=\"Target of 'condition' reference above\",\n        description=(\n            \"Allows identification of which elements have their cardinalities \"\n            \"impacted by the constraint.  Will not be referenced for constraints \"\n            \"that do not affect cardinality.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_key\", title=\"Extension field for ``key``.\"\n    )\n\n    requirements: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"requirements\",\n        title=\"Why this constraint is necessary or appropriate\",\n        description=\"Description of why this constraint is necessary or appropriate.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    requirements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requirements\",\n        title=\"Extension field for ``requirements``.\",\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"error | warning\",\n        description=(\n            \"Identifies the impact constraint violation has on the conformance of \"\n            \"the instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"error\", \"warning\"],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    source: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Reference to original source of constraint\",\n        description=(\n            \"A reference to the original source of the constraint, for traceability\"\n            \" purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    xpath: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"xpath\",\n        title=\"XPath expression of constraint\",\n        description=(\n            \"An XPath expression of constraint that can be executed to see if this \"\n            \"constraint is met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    xpath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_xpath\", title=\"Extension field for ``xpath``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionConstraint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"key\",\n            \"requirements\",\n            \"severity\",\n            \"human\",\n            \"expression\",\n            \"xpath\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionConstraint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"key\",\n            \"requirements\",\n            \"severity\",\n            \"human\",\n            \"expression\",\n            \"xpath\",\n            \"source\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"expression\", \"expression__ext\"),\n            (\"human\", \"human__ext\"),\n            (\"key\", \"key__ext\"),\n            (\"severity\", \"severity__ext\"),\n        ]\n        return required_fields\n\n\nclass ElementDefinitionExample(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Example value (as defined for type).\n    A sample value for this element demonstrating the type of information that\n    would typically be found in the element.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionExample\"\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Describes the purpose of this example\",\n        description=\"Describes the purpose of this example amoung the set of examples.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionExample`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"label\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueMeta\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionExample`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"label\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueMeta\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"label\", \"label__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCoding\",\n                \"valueContactPoint\",\n                \"valueCount\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDuration\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueReference\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ElementDefinitionMapping(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Map element to another set of definitions.\n    Identifies a concept from an external specification that roughly\n    corresponds to this element.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionMapping\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments about the mapping or its use\",\n        description=\"Comments that provide information about the mapping or its use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    identity: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"identity\",\n        title=\"Reference to mapping declaration\",\n        description=\"An internal reference to the definition of a mapping.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_identity\", title=\"Extension field for ``identity``.\"\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Computable language of mapping\",\n        description=\"Identifies the computable language in which mapping.map is expressed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    map: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"map\",\n        title=\"Details of the mapping\",\n        description=(\n            \"Expresses what part of the target specification corresponds to this \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    map__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_map\", title=\"Extension field for ``map``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"identity\", \"language\", \"map\", \"comment\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"identity\", \"language\", \"map\", \"comment\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"identity\", \"identity__ext\"), (\"map\", \"map__ext\")]\n        return required_fields\n\n\nclass ElementDefinitionSlicing(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    This element is sliced - slices follow.\n    Indicates that the element is sliced into a set of alternative definitions\n    (i.e. in a structure definition, there are multiple different constraints\n    on a single element in the base resource). Slicing can be used in any\n    resource that has cardinality ..* on the base resource, or any resource\n    with a choice of types. The set of slices is any elements that come after\n    this in the element sequence that have the same path, until a shorter path\n    occurs (the shorter path terminates the set).\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionSlicing\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Text description of how slicing works (or not)\",\n        description=(\n            \"A human-readable text description of how the slicing works. If there \"\n            \"is no discriminator, this is required to be present to provide \"\n            \"whatever information is possible about how the slices can be \"\n            \"differentiated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    discriminator: typing.List[\n        fhirtypes.ElementDefinitionSlicingDiscriminatorType\n    ] | None = Field(\n        default=None,\n        alias=\"discriminator\",\n        title=\"Element values that are used to distinguish the slices\",\n        description=(\n            \"Designates which child elements are used to discriminate between the \"\n            \"slices when processing an instance. If one or more discriminators are \"\n            \"provided, the value of the child elements in the instance data SHALL \"\n            \"completely distinguish which slice the element in the resource matches\"\n            \" based on the allowed values for those elements in each of the slices.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ordered: bool | None = Field(\n        default=None,\n        alias=\"ordered\",\n        title=\"If elements must be in same order as slices\",\n        description=(\n            \"If the matching elements have to occur in the same order as defined in\"\n            \" the profile.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ordered__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ordered\", title=\"Extension field for ``ordered``.\"\n    )\n\n    rules: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"rules\",\n        title=\"closed | open | openAtEnd\",\n        description=(\n            \"Whether additional slices are allowed or not. When the slices are \"\n            \"ordered, profile authors can also say that additional slices are only \"\n            \"allowed at the end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"closed\", \"open\", \"openAtEnd\"],\n        },\n    )\n    rules__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rules\", title=\"Extension field for ``rules``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionSlicing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"discriminator\", \"description\", \"ordered\", \"rules\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionSlicing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"discriminator\", \"description\", \"ordered\", \"rules\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"rules\", \"rules__ext\")]\n        return required_fields\n\n\nclass ElementDefinitionSlicingDiscriminator(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Element values that are used to distinguish the slices.\n    Designates which child elements are used to discriminate between the slices\n    when processing an instance. If one or more discriminators are provided,\n    the value of the child elements in the instance data SHALL completely\n    distinguish which slice the element in the resource matches based on the\n    allowed values for those elements in each of the slices.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionSlicingDiscriminator\"\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path to element value\",\n        description=(\n            \"A FHIRPath expression, using a restricted subset of FHIRPath, that is \"\n            \"used to identify the element on which discrimination is based.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"value | exists | pattern | type | profile\",\n        description=\"How the element value is interpreted when discrimination is evaluated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"value\", \"exists\", \"pattern\", \"type\", \"profile\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionSlicingDiscriminator`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"type\", \"path\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionSlicingDiscriminator`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"type\", \"path\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"path\", \"path__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass ElementDefinitionType(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Data type and Profile for this element.\n    The data type or resource that the value of this element is permitted to\n    be.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionType\"\n\n    aggregation: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"aggregation\",\n        title=\"contained | referenced | bundled - how aggregated\",\n        description=(\n            \"If the type is a reference to another resource, how the resource is or\"\n            \" can be aggregated - is it a contained resource, or a reference, and \"\n            \"if the context is a bundle, is it included in the bundle.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"contained\", \"referenced\", \"bundled\"],\n        },\n    )\n    aggregation__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_aggregation\", title=\"Extension field for ``aggregation``.\"\n    )\n\n    code: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Data type or Resource (reference to definition)\",\n        description=(\n            \"URL of Data type or Resource that is a(or the) type used for this \"\n            \"element. References are URLs that are relative to \"\n            'http://hl7.org/fhir/StructureDefinition e.g. \"string\" is a reference '\n            \"to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are \"\n            \"only allowed in logical models.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    profile: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile (StructureDefinition) to apply (or IG)\",\n        description=(\n            \"Identifies a profile structure or implementation Guide that SHALL hold\"\n            \" for the datatype this element refers to. Can be a local reference - \"\n            \"to a contained StructureDefinition, or a reference to another \"\n            \"StructureDefinition or Implementation Guide by a canonical URL. When \"\n            \"an implementation guide is specified, the resource SHALL conform to at\"\n            \" least one profile defined in the implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    targetProfile: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"targetProfile\",\n        title=\"Profile (StructureDefinition) to apply to reference target (or IG)\",\n        description=(\n            \"Identifies a profile structure or implementation Guide that SHALL hold\"\n            \" for the target of the reference this element refers to. Can be a \"\n            \"local reference - to a contained StructureDefinition, or a reference \"\n            \"to another StructureDefinition or Implementation Guide by a canonical \"\n            \"URL. When an implementation guide is specified, the resource SHALL \"\n            \"conform to at least one profile defined in the implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    targetProfile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_targetProfile\",\n        title=\"Extension field for ``targetProfile``.\",\n    )\n\n    versioning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"versioning\",\n        title=\"either | independent | specific\",\n        description=(\n            \"Whether this reference needs to be version specific or version \"\n            \"independent, or whether either can be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"either\", \"independent\", \"specific\"],\n        },\n    )\n    versioning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_versioning\", title=\"Extension field for ``versioning``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionType`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"code\",\n            \"profile\",\n            \"targetProfile\",\n            \"aggregation\",\n            \"versioning\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionType`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"code\", \"profile\", \"targetProfile\", \"aggregation\", \"versioning\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/eligibilityrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EligibilityRequest\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass EligibilityRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Determine insurance validity and scope of coverage.\n    The EligibilityRequest provides patient and insurance coverage information\n    to an insurer for them to respond, in the form of an EligibilityResponse,\n    with information regarding whether the stated coverage is valid and in-\n    force and optionally to provide the insurance details of the policy.\n    \"\"\"\n\n    __resource_type__ = \"EligibilityRequest\"\n\n    benefitCategory: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"benefitCategory\",\n        title=\"Type of services covered\",\n        description=\"Dental, Vision, Medical, Pharmacy, Rehab etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    benefitSubCategory: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"benefitSubCategory\",\n        title=\"Detailed services covered within the type\",\n        description=\"Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    businessArrangement: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"businessArrangement\",\n        title=\"Business agreement\",\n        description=(\n            \"The contract number of a business agreement which describes the terms \"\n            \"and conditions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_businessArrangement\",\n        title=\"Extension field for ``businessArrangement``.\",\n    )\n\n    coverage: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"coverage\",\n        title=\"Insurance or medical plan\",\n        description=\"Financial instrument by which payment information for health care.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Author\",\n        description=(\n            \"Person who created the invoice/claim/pre-determination or pre-\"\n            \"authorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    facility: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"facility\",\n        title=\"Servicing Facility\",\n        description=\"Facility where the services were provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The Response business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Target\",\n        description=\"The Insurer who is target  of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Responsible organization\",\n        description=(\n            \"The organization which is responsible for the services rendered to the\"\n            \" patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"The subject of the Products and Services\",\n        description=\"Patient Resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Desired processing priority\",\n        description=\"Immediate (STAT), best effort (NORMAL), deferred (DEFER).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Estimated date or dates of Service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Estimated date or dates of Service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EligibilityRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"priority\",\n            \"patient\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"created\",\n            \"enterer\",\n            \"provider\",\n            \"organization\",\n            \"insurer\",\n            \"facility\",\n            \"coverage\",\n            \"businessArrangement\",\n            \"benefitCategory\",\n            \"benefitSubCategory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EligibilityRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"serviced\": [\"servicedDate\", \"servicedPeriod\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/eligibilityresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EligibilityResponse\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass EligibilityResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    EligibilityResponse resource.\n    This resource provides eligibility and plan details from the processing of\n    an Eligibility resource.\n    \"\"\"\n\n    __resource_type__ = \"EligibilityResponse\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=(\n            \"The date when the enclosed suite of services were performed or \"\n            \"completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    error: typing.List[fhirtypes.EligibilityResponseErrorType] | None = Field(\n        default=None,\n        alias=\"error\",\n        title=\"Processing errors\",\n        description=\"Mutually exclusive with Services Provided (Item).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"Printed Form Identifier\",\n        description=\"The form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The Response business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    inforce: bool | None = Field(\n        default=None,\n        alias=\"inforce\",\n        title=\"Coverage inforce indicator\",\n        description=(\n            \"Flag indicating if the coverage provided is inforce currently  if no \"\n            \"service date(s) specified or for the whole duration of the service \"\n            \"dates.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    inforce__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_inforce\", title=\"Extension field for ``inforce``.\"\n    )\n\n    insurance: typing.List[fhirtypes.EligibilityResponseInsuranceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Details by insurance coverage\",\n        description=(\n            \"The insurer may provide both the details for the requested coverage as\"\n            \" well as details for additional coverages known to the insurer.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Insurer issuing the coverage\",\n        description=\"The Insurer who produced this adjudicated response.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"complete | error | partial\",\n        description=\"Transaction status: error, complete.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Eligibility reference\",\n        description=\"Original request resource reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EligibilityRequest\"],\n        },\n    )\n\n    requestOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestOrganization\",\n        title=\"Responsible organization\",\n        description=(\n            \"The organization which is responsible for the services rendered to the\"\n            \" patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    requestProvider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestProvider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EligibilityResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"created\",\n            \"requestProvider\",\n            \"requestOrganization\",\n            \"request\",\n            \"outcome\",\n            \"disposition\",\n            \"insurer\",\n            \"inforce\",\n            \"insurance\",\n            \"form\",\n            \"error\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EligibilityResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n\n\nclass EligibilityResponseError(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing errors.\n    Mutually exclusive with Services Provided (Item).\n    \"\"\"\n\n    __resource_type__ = \"EligibilityResponseError\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Error code detailing processing issues\",\n        description=(\n            \"An error code,from a specified code system, which details why the \"\n            \"eligibility check could not be performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EligibilityResponseError`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EligibilityResponseError`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EligibilityResponseInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details by insurance coverage.\n    The insurer may provide both the details for the requested coverage as well\n    as details for additional coverages known to the insurer.\n    \"\"\"\n\n    __resource_type__ = \"EligibilityResponseInsurance\"\n\n    benefitBalance: typing.List[\n        fhirtypes.EligibilityResponseInsuranceBenefitBalanceType\n    ] | None = Field(\n        default=None,\n        alias=\"benefitBalance\",\n        title=\"Benefits by Category\",\n        description=\"Benefits and optionally current balances by Category.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contract: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contract\",\n        title=\"Contract details\",\n        description=\"The contract resource which may provide more detailed information.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Contract\"],\n        },\n    )\n\n    coverage: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"coverage\",\n        title=\"Updated Coverage details\",\n        description=\"A suite of updated or additional Coverages from the Insurer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EligibilityResponseInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"coverage\",\n            \"contract\",\n            \"benefitBalance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EligibilityResponseInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EligibilityResponseInsuranceBenefitBalance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefits by Category.\n    Benefits and optionally current balances by Category.\n    \"\"\"\n\n    __resource_type__ = \"EligibilityResponseInsuranceBenefitBalance\"\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Type of services covered\",\n        description=\"Dental, Vision, Medical, Pharmacy, Rehab etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the benefit or services covered\",\n        description=(\n            \"A richer description of the benefit, for example 'DENT2 covers 100% of\"\n            \" basic, 50% of major but exclused Ortho, Implants and Costmetic \"\n            \"services'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    excluded: bool | None = Field(\n        default=None,\n        alias=\"excluded\",\n        title=\"Excluded from the plan\",\n        description=(\n            \"True if the indicated class of service is excluded from the plan, \"\n            \"missing or False indicated the service is included in the coverage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    excluded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_excluded\", title=\"Extension field for ``excluded``.\"\n    )\n\n    financial: typing.List[\n        fhirtypes.EligibilityResponseInsuranceBenefitBalanceFinancialType\n    ] | None = Field(\n        default=None,\n        alias=\"financial\",\n        title=\"Benefit Summary\",\n        description=\"Benefits Used to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Short name for the benefit\",\n        description=\"A short name or tag for the benefit, for example MED01, or DENT2.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    network: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"In or out of network\",\n        description=\"Network designation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subCategory: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subCategory\",\n        title=\"Detailed services covered within the type\",\n        description=\"Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    term: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"term\",\n        title=\"Annual or lifetime\",\n        description=(\n            \"The term or period of the values such as 'maximum lifetime benefit' or\"\n            \" 'maximum annual vistis'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Individual or family\",\n        description=\"Unit designation: individual or family.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EligibilityResponseInsuranceBenefitBalance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"subCategory\",\n            \"excluded\",\n            \"name\",\n            \"description\",\n            \"network\",\n            \"unit\",\n            \"term\",\n            \"financial\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EligibilityResponseInsuranceBenefitBalance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EligibilityResponseInsuranceBenefitBalanceFinancial(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefit Summary.\n    Benefits Used to date.\n    \"\"\"\n\n    __resource_type__ = \"EligibilityResponseInsuranceBenefitBalanceFinancial\"\n\n    allowedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"allowedMoney\",\n        title=\"Benefits allowed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    allowedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"allowedString\",\n        title=\"Benefits allowed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    allowedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedString\",\n        title=\"Extension field for ``allowedString``.\",\n    )\n\n    allowedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"allowedUnsignedInt\",\n        title=\"Benefits allowed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    allowedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedUnsignedInt\",\n        title=\"Extension field for ``allowedUnsignedInt``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Deductable, visits, benefit amount\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"usedMoney\",\n        title=\"Benefits used\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    usedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"usedUnsignedInt\",\n        title=\"Benefits used\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n    usedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_usedUnsignedInt\",\n        title=\"Extension field for ``usedUnsignedInt``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EligibilityResponseInsuranceBenefitBalanceFinancial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"allowedUnsignedInt\",\n            \"allowedString\",\n            \"allowedMoney\",\n            \"usedUnsignedInt\",\n            \"usedMoney\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EligibilityResponseInsuranceBenefitBalanceFinancial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"allowed\": [\"allowedMoney\", \"allowedString\", \"allowedUnsignedInt\"],\n            \"used\": [\"usedMoney\", \"usedUnsignedInt\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/encounter.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Encounter\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Encounter(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An interaction during which services are provided to the patient.\n    An interaction between a patient and healthcare provider(s) for the purpose\n    of providing healthcare service(s) or assessing the health status of a\n    patient.\n    \"\"\"\n\n    __resource_type__ = \"Encounter\"\n\n    account: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"account\",\n        title=\"The set of accounts that may be used for billing for this Encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    appointment: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"appointment\",\n        title=\"The appointment that scheduled this encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Appointment\"],\n        },\n    )\n\n    classHistory: typing.List[fhirtypes.EncounterClassHistoryType] | None = Field(\n        default=None,\n        alias=\"classHistory\",\n        title=\"List of past encounter classes\",\n        description=(\n            \"The class history permits the tracking of the encounters transitions \"\n            \"without needing to go  through the resource history.  This would be \"\n            \"used for a case where an admission starts of as an emergency \"\n            \"encounter, then transisions into an inpatient scenario. Doing this and\"\n            \" not restarting a new encounter ensures that any lab/diagnostic \"\n            \"results can more easily follow the patient and not require re-\"\n            \"processing and not get lost or cancelled during a kindof discharge \"\n            \"from emergency to inpatient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    class_fhir: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"class\",\n        title=\"inpatient | outpatient | ambulatory | emergency +\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    diagnosis: typing.List[fhirtypes.EncounterDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"The list of diagnosis relevant to this encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    episodeOfCare: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"episodeOfCare\",\n        title=\"Episode(s) of care that this encounter should be recorded against\",\n        description=(\n            \"Where a specific encounter should be classified as a part of a \"\n            \"specific episode(s) of care this field should be used. This \"\n            \"association can facilitate grouping of related encounters together for\"\n            \" a specific purpose, such as government reporting, issue tracking, \"\n            \"association via a common problem.  The association is recorded on the \"\n            \"encounter as these are typically created after the episode of care, \"\n            \"and grouped on entry rather than editing the episode of care to append\"\n            \" another encounter to it (the episode of care could span years).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EpisodeOfCare\"],\n        },\n    )\n\n    hospitalization: fhirtypes.EncounterHospitalizationType | None = Field(\n        default=None,\n        alias=\"hospitalization\",\n        title=\"Details about the admission to a healthcare service\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier(s) by which this encounter is known\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    incomingReferral: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"incomingReferral\",\n        title=\"The ReferralRequest that initiated this encounter\",\n        description=\"The referral request this encounter satisfies (incoming referral).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ReferralRequest\"],\n        },\n    )\n\n    length: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"length\",\n        title=\"Quantity of time the encounter lasted (less time absent)\",\n        description=(\n            \"Quantity of time the encounter lasted. This excludes the time during \"\n            \"leaves of absence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.EncounterLocationType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"List of locations where the patient has been\",\n        description=\"List of locations where  the patient has been during this encounter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Another Encounter this encounter is part of\",\n        description=(\n            \"Another Encounter of which this encounter is a part of \"\n            \"(administratively or in time).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    participant: typing.List[fhirtypes.EncounterParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"List of participants involved in the encounter\",\n        description=\"The\\u00a0list of\\u00a0people\\u00a0responsible for providing the service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"The start and end time of the encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Indicates the urgency of the encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason the encounter takes place (code)\",\n        description=(\n            \"Reason the encounter takes place, expressed as a code. For admissions,\"\n            \" this can be used for a coded admission diagnosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceProvider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"serviceProvider\",\n        title=\"The custodian organization of this Encounter record\",\n        description=(\n            \"An organization that is in charge of maintaining the information of \"\n            \"this Encounter (e.g. who maintains the report or the master service \"\n            \"catalog item, etc.). This MAY be the same as the organization on the \"\n            \"Patient record, however it could be different. This MAY not be not the\"\n            \" Service Delivery Location's Organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | arrived | triaged | in-progress | onleave | finished | \"\n            \"cancelled +\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"arrived\",\n                \"triaged\",\n                \"in-progress\",\n                \"onleave\",\n                \"finished\",\n                \"cancelled\",\n                \"+\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusHistory: typing.List[fhirtypes.EncounterStatusHistoryType] | None = Field(\n        default=None,\n        alias=\"statusHistory\",\n        title=\"List of past encounter statuses\",\n        description=(\n            \"The status history permits the encounter resource to contain the \"\n            \"status history without needing to read through the historical versions\"\n            \" of the resource, or even have the server store them.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The patient ro group present at the encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Specific type of encounter\",\n        description=(\n            \"Specific type of encounter (e.g. e-mail consultation, surgical day-\"\n            \"care, skilled nursing, rehabilitation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Encounter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"statusHistory\",\n            \"class\",\n            \"classHistory\",\n            \"type\",\n            \"priority\",\n            \"subject\",\n            \"episodeOfCare\",\n            \"incomingReferral\",\n            \"participant\",\n            \"appointment\",\n            \"period\",\n            \"length\",\n            \"reason\",\n            \"diagnosis\",\n            \"account\",\n            \"hospitalization\",\n            \"location\",\n            \"serviceProvider\",\n            \"partOf\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Encounter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"class\",\n            \"type\",\n            \"subject\",\n            \"episodeOfCare\",\n            \"participant\",\n            \"appointment\",\n            \"reason\",\n            \"diagnosis\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass EncounterClassHistory(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of past encounter classes.\n    The class history permits the tracking of the encounters transitions\n    without needing to go  through the resource history.\n\n    This would be used for a case where an admission starts of as an emergency\n    encounter, then transisions into an inpatient scenario. Doing this and not\n    restarting a new encounter ensures that any lab/diagnostic results can more\n    easily follow the patient and not require re-processing and not get lost or\n    cancelled during a kindof discharge from emergency to inpatient.\n    \"\"\"\n\n    __resource_type__ = \"EncounterClassHistory\"\n\n    class_fhir: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"class\",\n        title=\"inpatient | outpatient | ambulatory | emergency +\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"The time that the episode was in the specified class\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterClassHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"class\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterClassHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EncounterDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The list of diagnosis relevant to this encounter.\n    \"\"\"\n\n    __resource_type__ = \"EncounterDiagnosis\"\n\n    condition: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"condition\",\n        title=\"Reason the encounter takes place (resource)\",\n        description=(\n            \"Reason the encounter takes place, as specified using information from \"\n            \"another resource. For admissions, this is the admission diagnosis. The\"\n            \" indication will typically be a Condition (with other resources \"\n            \"referenced in the evidence.detail), or a Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Procedure\"],\n        },\n    )\n\n    rank: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"rank\",\n        title=\"Ranking of the diagnosis (for each role type)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rank\", title=\"Extension field for ``rank``.\"\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=(\n            \"Role that this diagnosis has within the encounter (e.g. admission, \"\n            \"billing, discharge \\u2026)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"condition\", \"role\", \"rank\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EncounterHospitalization(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details about the admission to a healthcare service.\n    \"\"\"\n\n    __resource_type__ = \"EncounterHospitalization\"\n\n    admitSource: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"admitSource\",\n        title=\"From where patient was admitted (physician referral, transfer)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    destination: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Location to which the patient is discharged\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    dietPreference: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"dietPreference\",\n        title=\"Diet preferences reported by the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dischargeDisposition: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"dischargeDisposition\",\n        title=\"Category or kind of location after discharge\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    origin: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"origin\",\n        title=\"The location from which the patient came before admission\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    preAdmissionIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"preAdmissionIdentifier\",\n        title=\"Pre-admission identifier\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reAdmission: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reAdmission\",\n        title=(\n            \"The type of hospital re-admission that has occurred (if any). If the \"\n            \"value is absent, then this is not identified as a readmission\"\n        ),\n        description=\"Whether this hospitalization is a readmission and why if known.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specialArrangement: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialArrangement\",\n        title=\"Wheelchair, translator, stretcher, etc.\",\n        description=(\n            \"Any special requests that have been made for this hospitalization \"\n            \"encounter, such as the provision of specific equipment or other \"\n            \"things.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specialCourtesy: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialCourtesy\",\n        title=\"Special courtesies (VIP, board member)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterHospitalization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"preAdmissionIdentifier\",\n            \"origin\",\n            \"admitSource\",\n            \"reAdmission\",\n            \"dietPreference\",\n            \"specialCourtesy\",\n            \"specialArrangement\",\n            \"destination\",\n            \"dischargeDisposition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterHospitalization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EncounterLocation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of locations where the patient has been.\n    List of locations where  the patient has been during this encounter.\n    \"\"\"\n\n    __resource_type__ = \"EncounterLocation\"\n\n    location: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"location\",\n        title=\"Location the encounter takes place\",\n        description=\"The location where the encounter takes place.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period during which the patient was present at the location\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"planned | active | reserved | completed\",\n        description=(\n            \"The status of the participants' presence at the specified location \"\n            \"during the period specified. If the participant is is no longer at the\"\n            \" location, then the period will have an end date/time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"planned\", \"active\", \"reserved\", \"completed\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterLocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"location\", \"status\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterLocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EncounterParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of participants involved in the encounter.\n    The list of people responsible for providing the service.\n    \"\"\"\n\n    __resource_type__ = \"EncounterParticipant\"\n\n    individual: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"individual\",\n        title=\"Persons involved in the encounter other than the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"RelatedPerson\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period of time during the encounter that the participant participated\",\n        description=(\n            \"The period of time that the specified participant participated in the \"\n            \"encounter. These can overlap or be sub-sets of the overall encounter's\"\n            \" period.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Role of participant in encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"period\", \"individual\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"individual\"]\n\n\nclass EncounterStatusHistory(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of past encounter statuses.\n    The status history permits the encounter resource to contain the status\n    history without needing to read through the historical versions of the\n    resource, or even have the server store them.\n    \"\"\"\n\n    __resource_type__ = \"EncounterStatusHistory\"\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"The time that the episode was in the specified status\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | arrived | triaged | in-progress | onleave | finished | \"\n            \"cancelled +\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"arrived\",\n                \"triaged\",\n                \"in-progress\",\n                \"onleave\",\n                \"finished\",\n                \"cancelled\",\n                \"+\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterStatusHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"status\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterStatusHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/endpoint.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Endpoint\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Endpoint(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The technical details of an endpoint that can be used for electronic\n    services.\n    The technical details of an endpoint that can be used for electronic\n    services, such as for web services providing XDS.b or a REST endpoint for\n    another FHIR server. This may include any security context information.\n    \"\"\"\n\n    __resource_type__ = \"Endpoint\"\n\n    address: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"The technical base address for connecting to this endpoint\",\n        description=\"The uri that describes the actual end-point to connect to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_address\", title=\"Extension field for ``address``.\"\n    )\n\n    connectionType: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"connectionType\",\n        title=\"Protocol/Profile/Standard to be used with this endpoint connection\",\n        description=(\n            \"A coded value that represents the technical details of the usage of \"\n            \"this endpoint, such as what WSDLs should be used in what way. (e.g. \"\n            \"XDS.b/DICOM/cds-hook).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for source (e.g. troubleshooting)\",\n        description=(\n            \"Contact details for a human to contact about the subscription. The \"\n            \"primary use of this for system administrator troubleshooting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    header: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"header\",\n        title=\"Usage depends on the channel type\",\n        description=\"Additional headers / information to send as part of the notification.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    header__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_header\", title=\"Extension field for ``header``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifies this endpoint across multiple systems\",\n        description=(\n            \"Identifier for the organization that is used to identify the endpoint \"\n            \"across multiple disparate systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=(\n            \"Organization that manages this endpoint (may not be the organization \"\n            \"that exposes the endpoint)\"\n        ),\n        description=(\n            \"The organization that manages this endpoint (even if technically \"\n            \"another organisation is hosting this in the cloud, it is the \"\n            \"organisation associated with the data).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name that this endpoint can be identified by\",\n        description=\"A friendly name that this endpoint can be referred to with.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    payloadMimeType: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"payloadMimeType\",\n        title=(\n            \"Mimetype to send. If not specified, the content could be anything \"\n            \"(including no payload, if the connectionType defined this)\"\n        ),\n        description=(\n            \"The mime type to send the payload in - e.g. application/fhir+xml, \"\n            \"application/fhir+json. If the mime type is not specified, then the \"\n            \"sender could send any content (including no content depending on the \"\n            \"connectionType).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    payloadMimeType__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_payloadMimeType\",\n        title=\"Extension field for ``payloadMimeType``.\",\n    )\n\n    payloadType: typing.List[fhirtypes.CodeableConceptType] = Field(\n        default=...,\n        alias=\"payloadType\",\n        title=(\n            \"The type of content that may be used at this endpoint (e.g. XDS \"\n            \"Discharge summaries)\"\n        ),\n        description=(\n            \"The payload type describes the acceptable content that can be \"\n            \"communicated on the endpoint.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Interval the endpoint is expected to be operational\",\n        description=\"The interval during which the endpoint is expected to be operational.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | suspended | error | off | entered-in-error | test\",\n        description=\"active | suspended | error | off | test.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"active\",\n                \"suspended\",\n                \"error\",\n                \"off\",\n                \"entered-in-error\",\n                \"test\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Endpoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"connectionType\",\n            \"name\",\n            \"managingOrganization\",\n            \"contact\",\n            \"period\",\n            \"payloadType\",\n            \"payloadMimeType\",\n            \"address\",\n            \"header\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Endpoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"connectionType\",\n            \"name\",\n            \"managingOrganization\",\n            \"period\",\n            \"payloadType\",\n            \"payloadMimeType\",\n            \"address\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"address\", \"address__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/enrollmentrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EnrollmentRequest\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass EnrollmentRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Enrollment request.\n    This resource provides the insurance enrollment details to the insurer\n    regarding a specified coverage.\n    \"\"\"\n\n    __resource_type__ = \"EnrollmentRequest\"\n\n    coverage: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=\"Reference to the program or plan identification, underwriter or payor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The Response business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Target\",\n        description=\"The Insurer who is target  of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Responsible organization\",\n        description=(\n            \"The organization which is responsible for the services rendered to the\"\n            \" patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The subject of the Products and Services\",\n        description=\"Patient Resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EnrollmentRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"created\",\n            \"insurer\",\n            \"provider\",\n            \"organization\",\n            \"subject\",\n            \"coverage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EnrollmentRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n"
  },
  {
    "path": "fhir/resources/STU3/enrollmentresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EnrollmentResponse\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass EnrollmentResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    EnrollmentResponse resource.\n    This resource provides enrollment and plan details from the processing of\n    an Enrollment resource.\n    \"\"\"\n\n    __resource_type__ = \"EnrollmentResponse\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=(\n            \"The date when the enclosed suite of services were performed or \"\n            \"completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The Response business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Insurer\",\n        description=\"The Insurer who produced this adjudicated response.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"complete | error | partial\",\n        description=\"Processing status: error, complete.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Claim reference\",\n        description=\"Original request resource reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EnrollmentRequest\"],\n        },\n    )\n\n    requestOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestOrganization\",\n        title=\"Responsible organization\",\n        description=(\n            \"The organization which is responsible for the services rendered to the\"\n            \" patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    requestProvider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestProvider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EnrollmentResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"request\",\n            \"outcome\",\n            \"disposition\",\n            \"created\",\n            \"organization\",\n            \"requestProvider\",\n            \"requestOrganization\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EnrollmentResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n"
  },
  {
    "path": "fhir/resources/STU3/episodeofcare.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EpisodeOfCare\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass EpisodeOfCare(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An association of a Patient with an Organization and  Healthcare\n    Provider(s) for a period of time that the Organization assumes some level\n    of responsibility.\n    An association between a patient and an organization / healthcare\n    provider(s) during which time encounters may occur. The managing\n    organization assumes a level of responsibility for the patient during this\n    time.\n    \"\"\"\n\n    __resource_type__ = \"EpisodeOfCare\"\n\n    account: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"account\",\n        title=(\n            \"The set of accounts that may be used for billing for this \" \"EpisodeOfCare\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    careManager: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"careManager\",\n        title=\"Care manager/care co-ordinator for the patient\",\n        description=(\n            \"The practitioner that is the care manager/care co-ordinator for this \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    diagnosis: typing.List[fhirtypes.EpisodeOfCareDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"The list of diagnosis relevant to this episode of care\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier(s) relevant for this EpisodeOfCare\",\n        description=(\n            \"The EpisodeOfCare may be known by different identifiers for different \"\n            \"contexts of use, such as when an external agency is tracking the \"\n            \"Episode for funding purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"Organization that assumes care\",\n        description=(\n            \"The organization that has assumed the specific responsibilities for \"\n            \"the specified duration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The patient who is the focus of this episode of care\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Interval during responsibility is assumed\",\n        description=(\n            \"The interval during which the managing organization assumes the \"\n            \"defined responsibility.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    referralRequest: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"referralRequest\",\n        title=\"Originating Referral Request(s)\",\n        description=(\n            \"Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming\"\n            \" referrals.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ReferralRequest\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | waitlist | active | onhold | finished | cancelled | entered-\"\n            \"in-error\"\n        ),\n        description=\"planned | waitlist | active | onhold | finished | cancelled.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"waitlist\",\n                \"active\",\n                \"onhold\",\n                \"finished\",\n                \"cancelled\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusHistory: typing.List[fhirtypes.EpisodeOfCareStatusHistoryType] | None = Field(\n        default=None,\n        alias=\"statusHistory\",\n        title=(\n            \"Past list of status codes (the current status may be included to cover\"\n            \" the start date of the status)\"\n        ),\n        description=(\n            \"The history of statuses that the EpisodeOfCare has been through \"\n            \"(without requiring processing the history of the resource).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    team: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"team\",\n        title=\"Other practitioners facilitating this episode of care\",\n        description=(\n            \"The list of practitioners that may be facilitating this episode of \"\n            \"care for specific purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CareTeam\"],\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type/class  - e.g. specialist referral, disease management\",\n        description=(\n            \"A classification of the type of episode of care; e.g. specialist \"\n            \"referral, disease management, type of funded care.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EpisodeOfCare`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"statusHistory\",\n            \"type\",\n            \"diagnosis\",\n            \"patient\",\n            \"managingOrganization\",\n            \"period\",\n            \"referralRequest\",\n            \"careManager\",\n            \"team\",\n            \"account\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EpisodeOfCare`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"type\",\n            \"diagnosis\",\n            \"patient\",\n            \"managingOrganization\",\n            \"period\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass EpisodeOfCareDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The list of diagnosis relevant to this episode of care.\n    \"\"\"\n\n    __resource_type__ = \"EpisodeOfCareDiagnosis\"\n\n    condition: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"condition\",\n        title=\"Conditions/problems/diagnoses this episode of care is for\",\n        description=(\n            \"A list of conditions/problems/diagnoses that this episode of care is \"\n            \"intended to be providing care for.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    rank: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"rank\",\n        title=\"Ranking of the diagnosis (for each role type)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rank\", title=\"Extension field for ``rank``.\"\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=(\n            \"Role that this diagnosis has within the episode of care (e.g. \"\n            \"admission, billing, discharge \\u2026)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EpisodeOfCareDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"condition\", \"role\", \"rank\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EpisodeOfCareDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"condition\", \"role\", \"rank\"]\n\n\nclass EpisodeOfCareStatusHistory(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Past list of status codes (the current status may be included to cover the\n    start date of the status).\n    The history of statuses that the EpisodeOfCare has been through (without\n    requiring processing the history of the resource).\n    \"\"\"\n\n    __resource_type__ = \"EpisodeOfCareStatusHistory\"\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"Duration the EpisodeOfCare was in the specified status\",\n        description=\"The period during this EpisodeOfCare that the specific status applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | waitlist | active | onhold | finished | cancelled | entered-\"\n            \"in-error\"\n        ),\n        description=\"planned | waitlist | active | onhold | finished | cancelled.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"waitlist\",\n                \"active\",\n                \"onhold\",\n                \"finished\",\n                \"cancelled\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EpisodeOfCareStatusHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"status\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EpisodeOfCareStatusHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/expansionprofile.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ExpansionProfile\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ExpansionProfile(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defines behaviour and contraints on the ValueSet Expansion operation.\n    Resource to define constraints on the Expansion of a FHIR ValueSet.\n    \"\"\"\n\n    __resource_type__ = \"ExpansionProfile\"\n\n    activeOnly: bool | None = Field(\n        default=None,\n        alias=\"activeOnly\",\n        title=\"Include or exclude inactive concepts in the expansion\",\n        description=(\n            \"Controls whether inactive concepts are included or excluded in value \"\n            \"set expansions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    activeOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_activeOnly\", title=\"Extension field for ``activeOnly``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the expansion profile was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the expansion profile \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the expansion profile\",\n        description=(\n            \"A free text natural language description of the expansion profile from\"\n            \" a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    designation: fhirtypes.ExpansionProfileDesignationType | None = Field(\n        default=None,\n        alias=\"designation\",\n        title=\"When the expansion profile imposes designation contraints\",\n        description=(\n            \"A set of criteria that provide the constraints imposed on the value \"\n            \"set expansion by including or excluding designations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    displayLanguage: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"displayLanguage\",\n        title=(\n            \"Specify the language for the display element of codes in the value set\"\n            \" expansion\"\n        ),\n        description=(\n            \"Specifies the language to be used for description in the expansions \"\n            \"i.e. the language to be used for ValueSet.expansion.contains.display.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    displayLanguage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_displayLanguage\",\n        title=\"Extension field for ``displayLanguage``.\",\n    )\n\n    excludeNested: bool | None = Field(\n        default=None,\n        alias=\"excludeNested\",\n        title=\"Nested codes in the expansion or not\",\n        description=(\n            \"Controls whether or not the value set expansion nests codes or not \"\n            \"(i.e. ValueSet.expansion.contains.contains).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    excludeNested__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_excludeNested\",\n        title=\"Extension field for ``excludeNested``.\",\n    )\n\n    excludeNotForUI: bool | None = Field(\n        default=None,\n        alias=\"excludeNotForUI\",\n        title=(\n            \"Include or exclude codes which cannot be rendered in user interfaces \"\n            \"in the value set expansion\"\n        ),\n        description=(\n            \"Controls whether or not the value set expansion includes codes which \"\n            \"cannot be displayed in user interfaces.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    excludeNotForUI__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_excludeNotForUI\",\n        title=\"Extension field for ``excludeNotForUI``.\",\n    )\n\n    excludePostCoordinated: bool | None = Field(\n        default=None,\n        alias=\"excludePostCoordinated\",\n        title=(\n            \"Include or exclude codes which are post coordinated expressions in the\"\n            \" value set expansion\"\n        ),\n        description=(\n            \"Controls whether or not the value set expansion includes post \"\n            \"coordinated codes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    excludePostCoordinated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_excludePostCoordinated\",\n        title=\"Extension field for ``excludePostCoordinated``.\",\n    )\n\n    excludedSystem: fhirtypes.ExpansionProfileExcludedSystemType | None = Field(\n        default=None,\n        alias=\"excludedSystem\",\n        title=\"Systems/Versions to be exclude\",\n        description=(\n            \"Code system, or a particular version of a code system to be excluded \"\n            \"from value set expansions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this expansion profile is authored \"\n            \"for testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fixedVersion: typing.List[\n        fhirtypes.ExpansionProfileFixedVersionType\n    ] | None = Field(\n        default=None,\n        alias=\"fixedVersion\",\n        title=\"Fix use of a code system to a particular version\",\n        description=\"Fix use of a particular code system to a particular version.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the expansion profile\",\n        description=(\n            \"A formal identifier that is used to identify this expansion profile \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    includeDefinition: bool | None = Field(\n        default=None,\n        alias=\"includeDefinition\",\n        title=\"Include or exclude the value set definition in the expansion\",\n        description=(\n            \"Controls whether the value set definition is included or excluded in \"\n            \"value set expansions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    includeDefinition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_includeDefinition\",\n        title=\"Extension field for ``includeDefinition``.\",\n    )\n\n    includeDesignations: bool | None = Field(\n        default=None,\n        alias=\"includeDesignations\",\n        title=\"Whether the expansion should include concept designations\",\n        description=(\n            \"Controls whether concept designations are to be included or excluded \"\n            \"in value set expansions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    includeDesignations__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_includeDesignations\",\n        title=\"Extension field for ``includeDesignations``.\",\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for expansion profile (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the expansion profile is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    limitedExpansion: bool | None = Field(\n        default=None,\n        alias=\"limitedExpansion\",\n        title=(\n            \"Controls behaviour of the value set expand operation when value sets \"\n            \"are too large to be completely expanded\"\n        ),\n        description=(\n            \"If the value set being expanded is incomplete (because it is too big \"\n            \"to expand), return a limited expansion (a subset) with an indicator \"\n            \"that expansion is incomplete, using the extension \"\n            \"[http://hl7.org/fhir/StructureDefinition/valueset-\"\n            \"toocostly](extension-valueset-toocostly.html).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    limitedExpansion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_limitedExpansion\",\n        title=\"Extension field for ``limitedExpansion``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this expansion profile (computer friendly)\",\n        description=(\n            \"A natural language name identifying the expansion profile. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the \"\n            \"expansion profile.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this expansion profile. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this expansion profile (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this expansion profile when \"\n            \"it is referenced in a specification, model, design or an instance. \"\n            \"This SHALL be a URL, SHOULD be globally unique, and SHOULD be an \"\n            \"address at which this expansion profile is (or will be) published. The\"\n            \" URL SHOULD include the major version of the expansion profile. For \"\n            \"more information see [Technical and Business \"\n            \"Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate expansion profile instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the expansion profile\",\n        description=(\n            \"The identifier that is used to identify this version of the expansion \"\n            \"profile when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the expansion profile \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExpansionProfile`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"fixedVersion\",\n            \"excludedSystem\",\n            \"includeDesignations\",\n            \"designation\",\n            \"includeDefinition\",\n            \"activeOnly\",\n            \"excludeNested\",\n            \"excludeNotForUI\",\n            \"excludePostCoordinated\",\n            \"displayLanguage\",\n            \"limitedExpansion\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExpansionProfile`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"fixedVersion\",\n            \"excludedSystem\",\n            \"includeDesignations\",\n            \"designation\",\n            \"includeDefinition\",\n            \"activeOnly\",\n            \"excludeNested\",\n            \"excludeNotForUI\",\n            \"excludePostCoordinated\",\n            \"displayLanguage\",\n            \"limitedExpansion\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ExpansionProfileDesignation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    When the expansion profile imposes designation contraints.\n    A set of criteria that provide the constraints imposed on the value set\n    expansion by including or excluding designations.\n    \"\"\"\n\n    __resource_type__ = \"ExpansionProfileDesignation\"\n\n    exclude: fhirtypes.ExpansionProfileDesignationExcludeType | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=\"Designations to be excluded\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    include: fhirtypes.ExpansionProfileDesignationIncludeType | None = Field(\n        default=None,\n        alias=\"include\",\n        title=\"Designations to be included\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExpansionProfileDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"include\", \"exclude\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExpansionProfileDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"include\", \"exclude\"]\n\n\nclass ExpansionProfileDesignationExclude(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Designations to be excluded.\n    \"\"\"\n\n    __resource_type__ = \"ExpansionProfileDesignationExclude\"\n\n    designation: typing.List[\n        fhirtypes.ExpansionProfileDesignationExcludeDesignationType\n    ] | None = Field(\n        default=None,\n        alias=\"designation\",\n        title=\"The designation to be excluded\",\n        description=\"A data group for each designation to be excluded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExpansionProfileDesignationExclude`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"designation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExpansionProfileDesignationExclude`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"designation\"]\n\n\nclass ExpansionProfileDesignationExcludeDesignation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The designation to be excluded.\n    A data group for each designation to be excluded.\n    \"\"\"\n\n    __resource_type__ = \"ExpansionProfileDesignationExcludeDesignation\"\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language of the designation to be excluded\",\n        description=\"The language this designation is defined for.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    use: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"What kind of Designation to exclude\",\n        description=\"Which kinds of designation to exclude from the expansion.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExpansionProfileDesignationExcludeDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"use\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExpansionProfileDesignationExcludeDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"language\", \"use\"]\n\n\nclass ExpansionProfileDesignationInclude(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Designations to be included.\n    \"\"\"\n\n    __resource_type__ = \"ExpansionProfileDesignationInclude\"\n\n    designation: typing.List[\n        fhirtypes.ExpansionProfileDesignationIncludeDesignationType\n    ] | None = Field(\n        default=None,\n        alias=\"designation\",\n        title=\"The designation to be included\",\n        description=\"A data group for each designation to be included.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExpansionProfileDesignationInclude`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"designation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExpansionProfileDesignationInclude`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"designation\"]\n\n\nclass ExpansionProfileDesignationIncludeDesignation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The designation to be included.\n    A data group for each designation to be included.\n    \"\"\"\n\n    __resource_type__ = \"ExpansionProfileDesignationIncludeDesignation\"\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language of the designation to be included\",\n        description=\"The language this designation is defined for.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    use: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"What kind of Designation to include\",\n        description=\"Which kinds of designation to include in the expansion.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExpansionProfileDesignationIncludeDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"use\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExpansionProfileDesignationIncludeDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"language\", \"use\"]\n\n\nclass ExpansionProfileExcludedSystem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Systems/Versions to be exclude.\n    Code system, or a particular version of a code system to be excluded from\n    value set expansions.\n    \"\"\"\n\n    __resource_type__ = \"ExpansionProfileExcludedSystem\"\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"The specific code system to be excluded\",\n        description=\"An absolute URI which is the code system to be excluded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Specific version of the code system referred to\",\n        description=(\n            \"The version of the code system from which codes in the expansion \"\n            \"should be excluded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExpansionProfileExcludedSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"system\", \"version\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExpansionProfileExcludedSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"system\", \"version\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"system\", \"system__ext\")]\n        return required_fields\n\n\nclass ExpansionProfileFixedVersion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Fix use of a code system to a particular version.\n    Fix use of a particular code system to a particular version.\n    \"\"\"\n\n    __resource_type__ = \"ExpansionProfileFixedVersion\"\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"default | check | override\",\n        description=(\n            \"How to manage the intersection between a fixed version in a value set,\"\n            \" and this fixed version of the system in the expansion profile.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"default\", \"check\", \"override\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"System to have its version fixed\",\n        description=\"The specific system for which to fix the version.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Specific version of the code system referred to\",\n        description=(\n            \"The version of the code system from which codes in the expansion \"\n            \"should be included.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExpansionProfileFixedVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"system\", \"version\", \"mode\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExpansionProfileFixedVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"system\", \"version\", \"mode\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"mode\", \"mode__ext\"),\n            (\"system\", \"system__ext\"),\n            (\"version\", \"version__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/explanationofbenefit.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ExplanationOfBenefit(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Explanation of Benefit resource.\n    This resource provides: the claim details; adjudication details from the\n    processing of a Claim; and optionally account balance information, for\n    informing the subscriber of the benefits provided.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefit\"\n\n    accident: fhirtypes.ExplanationOfBenefitAccidentType | None = Field(\n        default=None,\n        alias=\"accident\",\n        title=\"Details of an accident\",\n        description=\"An accident which resulted in the need for healthcare services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    addItem: typing.List[fhirtypes.ExplanationOfBenefitAddItemType] | None = Field(\n        default=None,\n        alias=\"addItem\",\n        title=\"Insurer added line items\",\n        description=\"The first tier service adjudications for payor added services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    benefitBalance: typing.List[\n        fhirtypes.ExplanationOfBenefitBenefitBalanceType\n    ] | None = Field(\n        default=None,\n        alias=\"benefitBalance\",\n        title=\"Balance by Benefit Category\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    billablePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"billablePeriod\",\n        title=\"Period for charge submission\",\n        description=\"The billable period for which charges are being submitted.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    careTeam: typing.List[fhirtypes.ExplanationOfBenefitCareTeamType] | None = Field(\n        default=None,\n        alias=\"careTeam\",\n        title=\"Care Team members\",\n        description=(\n            \"The members of the team who provided the overall service as well as \"\n            \"their role and whether responsible and qualifications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    claim: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claim\",\n        title=\"Claim reference\",\n        description=(\n            \"The business identifier for the instance: invoice number, claim \"\n            \"number, pre-determination or pre-authorization number.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Claim\"],\n        },\n    )\n\n    claimResponse: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claimResponse\",\n        title=\"Claim response reference\",\n        description=(\n            \"The business identifier for the instance: invoice number, claim \"\n            \"number, pre-determination or pre-authorization number.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClaimResponse\"],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when the EOB was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    diagnosis: typing.List[fhirtypes.ExplanationOfBenefitDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"List of Diagnosis\",\n        description=\"Ordered list of patient diagnosis for which care is sought.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    employmentImpacted: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"employmentImpacted\",\n        title=\"Period unable to work\",\n        description=(\n            \"The start and optional end dates of when the patient was precluded \"\n            \"from working due to the treatable condition(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Author\",\n        description=\"The person who created the explanation of benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    facility: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"facility\",\n        title=\"Servicing Facility\",\n        description=\"Facility where the services were provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"Printed Form Identifier\",\n        description=\"The form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    hospitalization: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"hospitalization\",\n        title=\"Period in hospital\",\n        description=(\n            \"The start and optional end dates of when the patient was confined to a\"\n            \" treatment center.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The EOB Business Identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    information: typing.List[\n        fhirtypes.ExplanationOfBenefitInformationType\n    ] | None = Field(\n        default=None,\n        alias=\"information\",\n        title=(\n            \"Exceptions, special considerations, the condition, situation, prior or\"\n            \" concurrent issues\"\n        ),\n        description=(\n            \"Additional information codes regarding exceptions, special \"\n            \"considerations, the condition, situation, prior or concurrent issues. \"\n            \"Often there are mutiple jurisdiction specific valuesets which are \"\n            \"required.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: fhirtypes.ExplanationOfBenefitInsuranceType | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Insurance or medical plan\",\n        description=\"Financial instrument by which payment information for health care.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Insurer responsible for the EOB\",\n        description=\"The insurer which is responsible for the explanation of benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    item: typing.List[fhirtypes.ExplanationOfBenefitItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Goods and Services\",\n        description=\"First tier of goods and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Responsible organization for the claim\",\n        description=\"The provider which is responsible for the claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    originalPrescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"originalPrescription\",\n        title=\"Original prescription if superceded by fulfiller\",\n        description=(\n            \"Original prescription which has been superceded by this prescription \"\n            \"to support the dispensing of pharmacy services, medications or \"\n            \"products. For example, a physician may prescribe a medication which \"\n            \"the pharmacy determines is contraindicated, or for which the patient \"\n            \"has an intolerance, and therefor issues a new precription for an \"\n            \"alternate medication which has the same theraputic intent. The \"\n            \"prescription from the pharmacy becomes the 'prescription' and that \"\n            \"from the physician becomes the 'original prescription'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"complete | error | partial\",\n        description=\"Processing outcome errror, partial or complete processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"The subject of the Products and Services\",\n        description=\"Patient Resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    payee: fhirtypes.ExplanationOfBenefitPayeeType | None = Field(\n        default=None,\n        alias=\"payee\",\n        title=\"Party to be paid any benefits payable\",\n        description=\"The party to be reimbursed for the services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payment: fhirtypes.ExplanationOfBenefitPaymentType | None = Field(\n        default=None,\n        alias=\"payment\",\n        title=\"Payment (if paid)\",\n        description=\"Payment details for the claim if the claim has been paid.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    precedence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"precedence\",\n        title=\"Precedence (primary, secondary, etc.)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    precedence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_precedence\", title=\"Extension field for ``precedence``.\"\n    )\n\n    prescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"prescription\",\n        title=\"Prescription authorizing services or products\",\n        description=\"Prescription to support the dispensing of Pharmacy or Vision products.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\", \"VisionPrescription\"],\n        },\n    )\n\n    procedure: typing.List[fhirtypes.ExplanationOfBenefitProcedureType] | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"Procedures performed\",\n        description=(\n            \"Ordered list of patient procedures performed to support the \"\n            \"adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    processNote: typing.List[\n        fhirtypes.ExplanationOfBenefitProcessNoteType\n    ] | None = Field(\n        default=None,\n        alias=\"processNote\",\n        title=\"Processing notes\",\n        description=\"Note text.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Responsible provider for the claim\",\n        description=\"The provider which is responsible for the claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    referral: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referral\",\n        title=\"Treatment Referral\",\n        description=(\n            \"The referral resource which lists the date, practitioner, reason and \"\n            \"other supporting information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ReferralRequest\"],\n        },\n    )\n\n    related: typing.List[fhirtypes.ExplanationOfBenefitRelatedType] | None = Field(\n        default=None,\n        alias=\"related\",\n        title=\"Related Claims which may be revelant to processing this claim\",\n        description=(\n            \"Other claims which are related to this claim such as prior claim \"\n            \"versions or for related services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"Finer grained claim type information\",\n        description=(\n            \"A finer grained suite of claim subtype codes which may convey \"\n            \"Inpatient vs Outpatient and/or a specialty service. In the US the \"\n            \"BillType.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    totalBenefit: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"totalBenefit\",\n        title=\"Total benefit payable for the Claim\",\n        description=(\n            \"Total amount of benefit payable (Equal to sum of the Benefit amounts \"\n            \"from all detail lines and additions less the Unallocated Deductable).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    totalCost: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"totalCost\",\n        title=\"Total Cost of service from the Claim\",\n        description=\"The total cost of the services reported.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type or discipline\",\n        description=(\n            \"The category of claim, eg, oral, pharmacy, vision, insitutional, \"\n            \"professional.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unallocDeductable: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unallocDeductable\",\n        title=\"Unallocated deductable\",\n        description=(\n            \"The amount of deductable applied which was not allocated to any \"\n            \"particular service line.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subType\",\n            \"patient\",\n            \"billablePeriod\",\n            \"created\",\n            \"enterer\",\n            \"insurer\",\n            \"provider\",\n            \"organization\",\n            \"referral\",\n            \"facility\",\n            \"claim\",\n            \"claimResponse\",\n            \"outcome\",\n            \"disposition\",\n            \"related\",\n            \"prescription\",\n            \"originalPrescription\",\n            \"payee\",\n            \"information\",\n            \"careTeam\",\n            \"diagnosis\",\n            \"procedure\",\n            \"precedence\",\n            \"insurance\",\n            \"accident\",\n            \"employmentImpacted\",\n            \"hospitalization\",\n            \"item\",\n            \"addItem\",\n            \"totalCost\",\n            \"unallocDeductable\",\n            \"totalBenefit\",\n            \"payment\",\n            \"form\",\n            \"processNote\",\n            \"benefitBalance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n\n\nclass ExplanationOfBenefitAccident(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of an accident.\n    An accident which resulted in the need for healthcare services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitAccident\"\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the accident occurred\",\n        description=\"Date of an accident which these services are addressing.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Accident Place\",\n        description=\"Where the accident occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Accident Place\",\n        description=\"Where the accident occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The nature of the accident\",\n        description=\"Type of accident: work, auto, etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitAccident`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"date\",\n            \"type\",\n            \"locationAddress\",\n            \"locationReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAccident`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"location\": [\"locationAddress\", \"locationReference\"]}\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitAddItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line items.\n    The first tier service adjudications for payor added services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitAddItem\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items adjudication\",\n        description=\"The adjudications results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of service or product\",\n        description=(\n            \"Health Care Service Type Codes  to identify the classification of \"\n            \"service or benefits.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ExplanationOfBenefitAddItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Added items details\",\n        description=\"The second tier service adjudications for payor added services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    fee: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"fee\",\n        title=\"Professional fee or Product charge\",\n        description=\"The fee charged for the professional service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes, eg for Oral whether the \"\n            \"treatment is cosmetic or associated with TMJ, or for medical whether \"\n            \"the treatment was outside the clinic or out of office hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"List of note numbers which apply\",\n        description=\"A list of note references to the notes provided below.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of reveneu or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequenceLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"sequenceLinkId\",\n        title=\"Service instances\",\n        description=(\n            \"List of input service items which this service line is intended to \"\n            \"replace.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sequenceLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_sequenceLinkId\",\n        title=\"Extension field for ``sequenceLinkId``.\",\n    )\n\n    service: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Billing Code\",\n        description=(\n            \"If this is an actual service or product line, ie. not a Group, then \"\n            \"use code to indicate the Professional Service or Product supplied (eg.\"\n            \" CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then \"\n            \"use a group code to indicate the type of thing being grouped eg. \"\n            \"'glasses' or 'compound'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitAddItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequenceLinkId\",\n            \"revenue\",\n            \"category\",\n            \"service\",\n            \"modifier\",\n            \"fee\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitAddItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Added items details.\n    The second tier service adjudications for payor added services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitAddItemDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items detail adjudication\",\n        description=\"The adjudications results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of service or product\",\n        description=(\n            \"Health Care Service Type Codes  to identify the classification of \"\n            \"service or benefits.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    fee: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"fee\",\n        title=\"Professional fee or Product charge\",\n        description=\"The fee charged for the professional service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes, eg for Oral whether the \"\n            \"treatment is cosmetic or associated with TMJ, or for medical whether \"\n            \"the treatment was outside the clinic or out of office hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"List of note numbers which apply\",\n        description=\"A list of note references to the notes provided below.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of reveneu or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    service: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Billing Code\",\n        description=(\n            \"A code to indicate the Professional Service or Product supplied (eg. \"\n            \"CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitAddItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"revenue\",\n            \"category\",\n            \"service\",\n            \"modifier\",\n            \"fee\",\n            \"noteNumber\",\n            \"adjudication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitBenefitBalance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Balance by Benefit Category.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitBenefitBalance\"\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Type of services covered\",\n        description=\"Dental, Vision, Medical, Pharmacy, Rehab etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the benefit or services covered\",\n        description=(\n            \"A richer description of the benefit, for example 'DENT2 covers 100% of\"\n            \" basic, 50% of major but exclused Ortho, Implants and Costmetic \"\n            \"services'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    excluded: bool | None = Field(\n        default=None,\n        alias=\"excluded\",\n        title=\"Excluded from the plan\",\n        description=(\n            \"True if the indicated class of service is excluded from the plan, \"\n            \"missing or False indicated the service is included in the coverage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    excluded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_excluded\", title=\"Extension field for ``excluded``.\"\n    )\n\n    financial: typing.List[\n        fhirtypes.ExplanationOfBenefitBenefitBalanceFinancialType\n    ] | None = Field(\n        default=None,\n        alias=\"financial\",\n        title=\"Benefit Summary\",\n        description=\"Benefits Used to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Short name for the benefit\",\n        description=\"A short name or tag for the benefit, for example MED01, or DENT2.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    network: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"In or out of network\",\n        description=\"Network designation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subCategory: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subCategory\",\n        title=\"Detailed services covered within the type\",\n        description=\"Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    term: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"term\",\n        title=\"Annual or lifetime\",\n        description=(\n            \"The term or period of the values such as 'maximum lifetime benefit' or\"\n            \" 'maximum annual vistis'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Individual or family\",\n        description=\"Unit designation: individual or family.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitBenefitBalance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"subCategory\",\n            \"excluded\",\n            \"name\",\n            \"description\",\n            \"network\",\n            \"unit\",\n            \"term\",\n            \"financial\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitBenefitBalance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitBenefitBalanceFinancial(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefit Summary.\n    Benefits Used to date.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitBenefitBalanceFinancial\"\n\n    allowedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"allowedMoney\",\n        title=\"Benefits allowed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    allowedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"allowedString\",\n        title=\"Benefits allowed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    allowedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedString\",\n        title=\"Extension field for ``allowedString``.\",\n    )\n\n    allowedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"allowedUnsignedInt\",\n        title=\"Benefits allowed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    allowedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedUnsignedInt\",\n        title=\"Extension field for ``allowedUnsignedInt``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Deductable, visits, benefit amount\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"usedMoney\",\n        title=\"Benefits used\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    usedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"usedUnsignedInt\",\n        title=\"Benefits used\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n    usedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_usedUnsignedInt\",\n        title=\"Extension field for ``usedUnsignedInt``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitBenefitBalanceFinancial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"allowedUnsignedInt\",\n            \"allowedString\",\n            \"allowedMoney\",\n            \"usedUnsignedInt\",\n            \"usedMoney\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitBenefitBalanceFinancial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"allowed\": [\"allowedMoney\", \"allowedString\", \"allowedUnsignedInt\"],\n            \"used\": [\"usedMoney\", \"usedUnsignedInt\"],\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitCareTeam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Care Team members.\n    The members of the team who provided the overall service as well as their\n    role and whether responsible and qualifications.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitCareTeam\"\n\n    provider: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"provider\",\n        title=\"Member of the Care Team\",\n        description=\"The members of the team who provided the overall service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Organization\"],\n        },\n    )\n\n    qualification: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"qualification\",\n        title=\"Type, classification or Specialization\",\n        description=\"The qualification which is applicable for this service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    responsible: bool | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Billing practitioner\",\n        description=(\n            \"The practitioner who is billing and responsible for the claimed \"\n            \"services rendered to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_responsible\", title=\"Extension field for ``responsible``.\"\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Role on the team\",\n        description=(\n            \"The lead, assisting or supervising practitioner and their discipline \"\n            \"if a multidisiplinary team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Number to covey order of careteam\",\n        description=\"Sequence of careteam which serves to order and provide a link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitCareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"provider\",\n            \"responsible\",\n            \"role\",\n            \"qualification\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitCareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ExplanationOfBenefitDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of Diagnosis.\n    Ordered list of patient diagnosis for which care is sought.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitDiagnosis\"\n\n    diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"diagnosisCodeableConcept\",\n        title=\"Patient's diagnosis\",\n        description=\"The diagnosis.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    diagnosisReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"diagnosisReference\",\n        title=\"Patient's diagnosis\",\n        description=\"The diagnosis.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    packageCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"packageCode\",\n        title=\"Package billing code\",\n        description=(\n            \"The package billing code, for example DRG, based on the assigned \"\n            \"grouping code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Number to covey order of diagnosis\",\n        description=\"Sequence of diagnosis which serves to provide a link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Timing or nature of the diagnosis\",\n        description=(\n            \"The type of the Diagnosis, for example: admitting, primary, secondary,\"\n            \" discharge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"diagnosisCodeableConcept\",\n            \"diagnosisReference\",\n            \"type\",\n            \"packageCode\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"diagnosis\": [\"diagnosisCodeableConcept\", \"diagnosisReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitInformation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Exceptions, special considerations, the condition, situation, prior or\n    concurrent issues.\n    Additional information codes regarding exceptions, special considerations,\n    the condition, situation, prior or concurrent issues. Often there are\n    mutiple jurisdiction specific valuesets which are required.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitInformation\"\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"General class of information\",\n        description=(\n            \"The general class of the information supplied: information; exception;\"\n            \" accident, employment; onset, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of information\",\n        description=(\n            \"System and code pertaining to the specific information regarding \"\n            \"special conditions relating to the setting, treatment or patient  for \"\n            \"which care is sought which may influence the adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason associated with the information\",\n        description=(\n            \"For example, provides the reason for: the additional stay, or missing \"\n            \"tooth or any other situation where a reason code is required in \"\n            \"addition to the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Information instance identifier\",\n        description=\"Sequence of the information element which serves to provide a link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    timingDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"timingDate\",\n        title=\"When it occurred\",\n        description=\"The date when or period to which this information refers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timingDate\", title=\"Extension field for ``timingDate``.\"\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When it occurred\",\n        description=\"The date when or period to which this information refers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Additional Data or supporting information\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Additional Data or supporting information\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Additional Data or supporting information\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Additional Data or supporting information\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitInformation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"category\",\n            \"code\",\n            \"timingDate\",\n            \"timingPeriod\",\n            \"valueString\",\n            \"valueQuantity\",\n            \"valueAttachment\",\n            \"valueReference\",\n            \"reason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitInformation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\"timingDate\", \"timingPeriod\"],\n            \"value\": [\n                \"valueAttachment\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurance or medical plan.\n    Financial instrument by which payment information for health care.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitInsurance\"\n\n    coverage: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=\"Reference to the program or plan identification, underwriter or payor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Pre-Authorization/Determination Reference\",\n        description=\"A list of references from the Insurer to which these services pertain.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"coverage\", \"preAuthRef\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Goods and Services.\n    First tier of goods and services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItem\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Adjudication details\",\n        description=\"The adjudications results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Service Location\",\n        description=\"Physical service site on the patient (limb, tooth, etc).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    careTeamLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"careTeamLinkId\",\n        title=\"Applicable careteam members\",\n        description=\"Careteam applicable for this service or product line.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    careTeamLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_careTeamLinkId\",\n        title=\"Extension field for ``careTeamLinkId``.\",\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of service or product\",\n        description=(\n            \"Health Care Service Type Codes  to identify the classification of \"\n            \"service or benefits.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ExplanationOfBenefitItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Additional items\",\n        description=\"Second tier of goods and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    diagnosisLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"diagnosisLinkId\",\n        title=\"Applicable diagnoses\",\n        description=\"Diagnosis applicable for this service or product line.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    diagnosisLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_diagnosisLinkId\",\n        title=\"Extension field for ``diagnosisLinkId``.\",\n    )\n\n    encounter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounters related to this billed item\",\n        description=(\n            \"A billed item may include goods or services provided in multiple \"\n            \"encounters.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    informationLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"informationLinkId\",\n        title=\"Applicable exception and supporting information\",\n        description=(\n            \"Exceptions, special conditions and supporting information pplicable \"\n            \"for this service or product line.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    informationLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_informationLinkId\",\n        title=\"Extension field for ``informationLinkId``.\",\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Place of service\",\n        description=\"Where the service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"locationCodeableConcept\",\n        title=\"Place of service\",\n        description=\"Where the service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Place of service\",\n        description=\"Where the service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes, eg for Oral whether the \"\n            \"treatment is cosmetic or associated with TMJ, or for medical whether \"\n            \"the treatment was outside the clinic or out of office hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The quantity times the unit price for an addittional service or \"\n            \"product or charge. For example, the formula: unit Quantity * unit \"\n            \"Price (Cost per Point) * factor Number  * points = net Amount. \"\n            \"Quantity, factor and points are assumed to be 1 if not supplied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"List of note numbers which apply\",\n        description=\"A list of note references to the notes provided below.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    procedureLinkId: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"procedureLinkId\",\n        title=\"Applicable procedures\",\n        description=\"Procedures applicable for this service or product line.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    procedureLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_procedureLinkId\",\n        title=\"Extension field for ``procedureLinkId``.\",\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program specific reason for item inclusion\",\n        description=(\n            \"For programs which require reson codes for the inclusion, covering, of\"\n            \" this billed item under the program or sub-program.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of Products or Services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of reveneu or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Service instance\",\n        description=\"A service line number.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    service: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Billing Code\",\n        description=(\n            \"If this is an actual service or product line, ie. not a Group, then \"\n            \"use code to indicate the Professional Service or Product supplied (eg.\"\n            \" CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then \"\n            \"use a group code to indicate the type of thing being grouped eg. \"\n            \"'glasses' or 'compound'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Date or dates of Service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Date or dates of Service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subSite\",\n        title=\"Service Sub-location\",\n        description=\"A region or surface of the site, eg. limb region or tooth surface(s).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique Device Identifier\",\n        description=\"List of Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per point\",\n        description=(\n            \"If the item is a node then this is the fee for the product or service,\"\n            \" otherwise this is the total of the fees for the children of the \"\n            \"group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"careTeamLinkId\",\n            \"diagnosisLinkId\",\n            \"procedureLinkId\",\n            \"informationLinkId\",\n            \"revenue\",\n            \"category\",\n            \"service\",\n            \"modifier\",\n            \"programCode\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"locationCodeableConcept\",\n            \"locationAddress\",\n            \"locationReference\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"udi\",\n            \"bodySite\",\n            \"subSite\",\n            \"encounter\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"location\": [\n                \"locationAddress\",\n                \"locationCodeableConcept\",\n                \"locationReference\",\n            ],\n            \"serviced\": [\"servicedDate\", \"servicedPeriod\"],\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitItemAdjudication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication details.\n    The adjudications results.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItemAdjudication\"\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Monetary amount\",\n        description=\"Monitory amount associated with the code.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Adjudication category such as co-pay, eligible, benefit, etc.\",\n        description=\"Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Explanation of Adjudication outcome\",\n        description=\"Adjudication reason such as limit reached.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Non-monitory value\",\n        description=(\n            \"A non-monetary value for example a percentage. Mutually exclusive to \"\n            \"the amount element above.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItemAdjudication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"reason\",\n            \"amount\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemAdjudication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional items.\n    Second tier of goods and services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItemDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Detail level adjudication details\",\n        description=\"The adjudications results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of service or product\",\n        description=(\n            \"Health Care Service Type Codes  to identify the classification of \"\n            \"service or benefits.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes, eg for Oral whether the \"\n            \"treatment is cosmetic or associated with TMJ, or for medical whether \"\n            \"the treatment was outside the clinic or out of office hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total additional item cost\",\n        description=(\n            \"The quantity times the unit price for an addittional service or \"\n            \"product or charge. For example, the formula: unit Quantity * unit \"\n            \"Price (Cost per Point) * factor Number  * points = net Amount. \"\n            \"Quantity, factor and points are assumed to be 1 if not supplied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"List of note numbers which apply\",\n        description=\"A list of note references to the notes provided below.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program specific reason for item inclusion\",\n        description=(\n            \"For programs which require reson codes for the inclusion, covering, of\"\n            \" this billed item under the program or sub-program.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of Products or Services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of reveneu or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Service instance\",\n        description=\"A service line number.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    service: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Billing Code\",\n        description=(\n            \"If this is an actual service or product line, ie. not a Group, then \"\n            \"use code to indicate the Professional Service or Product supplied (eg.\"\n            \" CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI). If a grouping item then \"\n            \"use a group code to indicate the type of thing being grouped eg. \"\n            \"'glasses' or 'compound'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subDetail: typing.List[\n        fhirtypes.ExplanationOfBenefitItemDetailSubDetailType\n    ] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Additional items\",\n        description=\"Third tier of goods and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Group or type of product or service\",\n        description=\"The type of product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique Device Identifier\",\n        description=\"List of Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per point\",\n        description=(\n            \"If the item is a node then this is the fee for the product or service,\"\n            \" otherwise this is the total of the fees for the children of the \"\n            \"group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"type\",\n            \"revenue\",\n            \"category\",\n            \"service\",\n            \"modifier\",\n            \"programCode\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"udi\",\n            \"noteNumber\",\n            \"adjudication\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ExplanationOfBenefitItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional items.\n    Third tier of goods and services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItemDetailSubDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Language if different from the resource\",\n        description=\"The adjudications results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of service or product\",\n        description=(\n            \"Health Care Service Type Codes  to identify the classification of \"\n            \"service or benefits.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes, eg for Oral whether the \"\n            \"treatment is cosmetic or associated with TMJ, or for medical whether \"\n            \"the treatment was outside the clinic or out of office hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Net additional item cost\",\n        description=(\n            \"The quantity times the unit price for an addittional service or \"\n            \"product or charge. For example, the formula: unit Quantity * unit \"\n            \"Price (Cost per Point) * factor Number  * points = net Amount. \"\n            \"Quantity, factor and points are assumed to be 1 if not supplied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"List of note numbers which apply\",\n        description=\"A list of note references to the notes provided below.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program specific reason for item inclusion\",\n        description=(\n            \"For programs which require reson codes for the inclusion, covering, of\"\n            \" this billed item under the program or sub-program.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of Products or Services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of reveneu or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Service instance\",\n        description=\"A service line number.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    service: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Billing Code\",\n        description=(\n            \"A code to indicate the Professional Service or Product supplied (eg. \"\n            \"CTP, HCPCS,USCLS,ICD10, NCPDP,DIN,ACHI,CCI).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of product or service\",\n        description=\"The type of product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique Device Identifier\",\n        description=\"List of Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per point\",\n        description=\"The fee for an addittional service or product or charge.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"type\",\n            \"revenue\",\n            \"category\",\n            \"service\",\n            \"modifier\",\n            \"programCode\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"net\",\n            \"udi\",\n            \"noteNumber\",\n            \"adjudication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ExplanationOfBenefitPayee(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Party to be paid any benefits payable.\n    The party to be reimbursed for the services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitPayee\"\n\n    party: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"party\",\n        title=\"Party to receive the payable\",\n        description=\"Party to be reimbursed: Subscriber, provider, other.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    resourceType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"resourceType\",\n        title=\"organization | patient | practitioner | relatedperson\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of party: Subscriber, Provider, other\",\n        description=\"Type of Party to be reimbursed: Subscriber, provider, other.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitPayee`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"resourceType\", \"party\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitPayee`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitPayment(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Payment (if paid).\n    Payment details for the claim if the claim has been paid.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitPayment\"\n\n    adjustment: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"adjustment\",\n        title=\"Payment adjustment for non-Claim issues\",\n        description=(\n            \"Adjustment to the payment of this transaction which is not related to \"\n            \"adjudication of this transaction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    adjustmentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"adjustmentReason\",\n        title=\"Explanation for the non-claim adjustment\",\n        description=\"Reason for the payment adjustment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Payable amount after adjustment\",\n        description=\"Payable less any payment adjustment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Expected date of Payment\",\n        description=\"Estimated payment date.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier of the payment instrument\",\n        description=\"Payment identifer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Partial or Complete\",\n        description=\"Whether this represents partial or complete payment of the claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitPayment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"adjustment\",\n            \"adjustmentReason\",\n            \"date\",\n            \"amount\",\n            \"identifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitPayment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitProcedure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Procedures performed.\n    Ordered list of patient procedures performed to support the adjudication.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitProcedure\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the procedure was performed\",\n        description=\"Date and optionally time the procedure was performed .\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    procedureCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"procedureCodeableConcept\",\n        title=\"Patient's list of procedures performed\",\n        description=\"The procedure code.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e procedure[x]\n            \"one_of_many\": \"procedure\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    procedureReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"procedureReference\",\n        title=\"Patient's list of procedures performed\",\n        description=\"The procedure code.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e procedure[x]\n            \"one_of_many\": \"procedure\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Procedure sequence for reference\",\n        description=\"Sequence of procedures which serves to order and provide a link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"date\",\n            \"procedureCodeableConcept\",\n            \"procedureReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"procedure\": [\"procedureCodeableConcept\", \"procedureReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitProcessNote(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing notes.\n    Note text.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitProcessNote\"\n\n    language: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language if different from the resource\",\n        description=(\n            \"The ISO-639-1 alpha 2 code in lower case for the language, optionally \"\n            \"followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in\"\n            ' upper case; e.g. \"en\" for English, or \"en-US\" for American English '\n            'versus \"en-EN\" for England English.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    number: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"Sequence number for this note\",\n        description=(\n            \"An integer associated with each note which may be referred to from \"\n            \"each service line item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Note explanitory text\",\n        description=\"The note text.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"display | print | printoper\",\n        description=\"The note purpose: Print/Display.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"number\",\n            \"type\",\n            \"text\",\n            \"language\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitRelated(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Related Claims which may be revelant to processing this claim.\n    Other claims which are related to this claim such as prior claim versions\n    or for related services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitRelated\"\n\n    claim: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claim\",\n        title=\"Reference to the related claim\",\n        description=(\n            \"Other claims which are related to this claim such as prior claim \"\n            \"versions or for related services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Claim\"],\n        },\n    )\n\n    reference: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Related file or case reference\",\n        description=(\n            \"An alternate organizational reference to the case or file to which \"\n            \"this particular claim pertains - eg Property/Casualy insurer claim # \"\n            \"or Workers Compensation case # .\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"How the reference claim is related\",\n        description=\"For example prior or umbrella.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"claim\",\n            \"relationship\",\n            \"reference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/extension.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Extension\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Extension(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Optional Extensions Element.\n    Optional Extension Element - found in all resources.\n    \"\"\"\n\n    __resource_type__ = \"Extension\"\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"identifies the meaning of the extension\",\n        description=(\n            \"Source of the definition for the extension code - a logical name or a \"\n            \"URL.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - may be a resource or one of a constrained set of \"\n            \"the data types (see Extensibility in the spec for list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Extension`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"url\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueMeta\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Extension`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCoding\",\n                \"valueContactPoint\",\n                \"valueCount\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDuration\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueReference\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/familymemberhistory.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass FamilyMemberHistory(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about patient's relatives, relevant for patient.\n    Significant health events and conditions for a person related to the\n    patient relevant in the context of care for the patient.\n    \"\"\"\n\n    __resource_type__ = \"FamilyMemberHistory\"\n\n    ageAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"ageAge\",\n        title=\"(approximate) age\",\n        description=(\n            \"The age of the relative at the time the family member history is \"\n            \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e age[x]\n            \"one_of_many\": \"age\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    ageRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"ageRange\",\n        title=\"(approximate) age\",\n        description=(\n            \"The age of the relative at the time the family member history is \"\n            \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e age[x]\n            \"one_of_many\": \"age\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    ageString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"ageString\",\n        title=\"(approximate) age\",\n        description=(\n            \"The age of the relative at the time the family member history is \"\n            \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e age[x]\n            \"one_of_many\": \"age\",\n            \"one_of_many_required\": False,\n        },\n    )\n    ageString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ageString\", title=\"Extension field for ``ageString``.\"\n    )\n\n    bornDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"bornDate\",\n        title=\"(approximate) date of birth\",\n        description=\"The actual or approximate date of birth of the relative.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e born[x]\n            \"one_of_many\": \"born\",\n            \"one_of_many_required\": False,\n        },\n    )\n    bornDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_bornDate\", title=\"Extension field for ``bornDate``.\"\n    )\n\n    bornPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"bornPeriod\",\n        title=\"(approximate) date of birth\",\n        description=\"The actual or approximate date of birth of the relative.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e born[x]\n            \"one_of_many\": \"born\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    bornString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"bornString\",\n        title=\"(approximate) date of birth\",\n        description=\"The actual or approximate date of birth of the relative.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e born[x]\n            \"one_of_many\": \"born\",\n            \"one_of_many_required\": False,\n        },\n    )\n    bornString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_bornString\", title=\"Extension field for ``bornString``.\"\n    )\n\n    condition: typing.List[fhirtypes.FamilyMemberHistoryConditionType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Condition that the related person had\",\n        description=(\n            \"The significant Conditions (or condition) that the family member had. \"\n            \"This is a repeating section to allow a system to represent more than \"\n            \"one condition per resource, though there is nothing stopping multiple \"\n            \"resources - one per condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When history was captured/updated\",\n        description=\"The date (and possibly time) when the family member history was taken.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    deceasedAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"deceasedAge\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    deceasedBoolean: bool | None = Field(\n        default=None,\n        alias=\"deceasedBoolean\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedBoolean\",\n        title=\"Extension field for ``deceasedBoolean``.\",\n    )\n\n    deceasedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"deceasedDate\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedDate\",\n        title=\"Extension field for ``deceasedDate``.\",\n    )\n\n    deceasedRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"deceasedRange\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    deceasedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"deceasedString\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedString\",\n        title=\"Extension field for ``deceasedString``.\",\n    )\n\n    definition: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Instantiates protocol or definition\",\n        description=(\n            \"A protocol or questionnaire that was adhered to in whole or in part by\"\n            \" this event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PlanDefinition\", \"Questionnaire\"],\n        },\n    )\n\n    estimatedAge: bool | None = Field(\n        default=None,\n        alias=\"estimatedAge\",\n        title=\"Age is estimated?\",\n        description=\"If true, indicates that the age value specified is an estimated value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    estimatedAge__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_estimatedAge\",\n        title=\"Extension field for ``estimatedAge``.\",\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the relative is considered to \"\n            \"have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Id(s) for this record\",\n        description=(\n            \"This records identifiers associated with this family member history \"\n            \"record that are defined by business processes and/ or used to refer to\"\n            \" it when a direct URL reference to the resource itself is not \"\n            \"appropriate (e.g. in CDA documents, or in written / printed \"\n            \"documentation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The family member described\",\n        description=(\n            'This will either be a name or a description; e.g. \"Aunt Susan\", \"my '\n            'cousin with the red hair\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    notDone: bool | None = Field(\n        default=None,\n        alias=\"notDone\",\n        title=\"The taking of a family member's history did not occur\",\n        description=(\n            \"If true, indicates the taking of an individual family member's history\"\n            \" did not occur. The notDone element should not be used to document \"\n            \"negated conditions, such as a family member that did not have a \"\n            \"condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    notDone__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_notDone\", title=\"Extension field for ``notDone``.\"\n    )\n\n    notDoneReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"notDoneReason\",\n        title=\"subject-unknown | withheld | unable-to-obtain | deferred\",\n        description=\"Describes why the family member's history is absent.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"General note about related person\",\n        description=(\n            \"This property allows a non condition-specific note to the made about \"\n            \"the related person. Ideally, the note would be in the condition \"\n            \"property, but this is not always possible.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Patient history is about\",\n        description=\"The person who this history concerns.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why was family member history performed?\",\n        description=(\n            \"Describes why the family member history occurred in coded or textual \"\n            \"form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why was family member history performed?\",\n        description=(\n            \"Indicates a Condition, Observation, AllergyIntolerance, or \"\n            \"QuestionnaireResponse that justifies this family member history event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"AllergyIntolerance\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"relationship\",\n        title=\"Relationship to the subject\",\n        description=(\n            \"The type of relationship this person has to the patient (father, \"\n            \"mother, brother etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"partial | completed | entered-in-error | health-unknown\",\n        description=(\n            \"A code specifying the status of the record of the family history of a \"\n            \"specific family member.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"partial\",\n                \"completed\",\n                \"entered-in-error\",\n                \"health-unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``FamilyMemberHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definition\",\n            \"status\",\n            \"notDone\",\n            \"notDoneReason\",\n            \"patient\",\n            \"date\",\n            \"name\",\n            \"relationship\",\n            \"gender\",\n            \"bornPeriod\",\n            \"bornDate\",\n            \"bornString\",\n            \"ageAge\",\n            \"ageRange\",\n            \"ageString\",\n            \"estimatedAge\",\n            \"deceasedBoolean\",\n            \"deceasedAge\",\n            \"deceasedRange\",\n            \"deceasedDate\",\n            \"deceasedString\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"note\",\n            \"condition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``FamilyMemberHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"definition\",\n            \"status\",\n            \"notDone\",\n            \"notDoneReason\",\n            \"patient\",\n            \"date\",\n            \"name\",\n            \"relationship\",\n            \"gender\",\n            \"ageAge\",\n            \"ageRange\",\n            \"ageString\",\n            \"estimatedAge\",\n            \"deceasedBoolean\",\n            \"deceasedAge\",\n            \"deceasedRange\",\n            \"deceasedDate\",\n            \"deceasedString\",\n            \"reasonCode\",\n            \"reasonReference\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"age\": [\"ageAge\", \"ageRange\", \"ageString\"],\n            \"born\": [\"bornDate\", \"bornPeriod\", \"bornString\"],\n            \"deceased\": [\n                \"deceasedAge\",\n                \"deceasedBoolean\",\n                \"deceasedDate\",\n                \"deceasedRange\",\n                \"deceasedString\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass FamilyMemberHistoryCondition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Condition that the related person had.\n    The significant Conditions (or condition) that the family member had. This\n    is a repeating section to allow a system to represent more than one\n    condition per resource, though there is nothing stopping multiple resources\n    - one per condition.\n    \"\"\"\n\n    __resource_type__ = \"FamilyMemberHistoryCondition\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Condition suffered by relation\",\n        description=(\n            \"The actual condition specified. Could be a coded condition (like MI or\"\n            \" Diabetes) or a less specific string like 'cancer' depending on how \"\n            \"much is known about the condition and the capabilities of the creating\"\n            \" system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Extra information about condition\",\n        description=(\n            \"An area where general notes can be placed about this specific \"\n            \"condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onsetAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"onsetAge\",\n        title=\"When condition first manifested\",\n        description=(\n            \"Either the age of onset, range of approximate age or descriptive \"\n            \"string can be recorded.  For conditions with multiple occurrences, \"\n            \"this describes the first known occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"onsetPeriod\",\n        title=\"When condition first manifested\",\n        description=(\n            \"Either the age of onset, range of approximate age or descriptive \"\n            \"string can be recorded.  For conditions with multiple occurrences, \"\n            \"this describes the first known occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"onsetRange\",\n        title=\"When condition first manifested\",\n        description=(\n            \"Either the age of onset, range of approximate age or descriptive \"\n            \"string can be recorded.  For conditions with multiple occurrences, \"\n            \"this describes the first known occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"onsetString\",\n        title=\"When condition first manifested\",\n        description=(\n            \"Either the age of onset, range of approximate age or descriptive \"\n            \"string can be recorded.  For conditions with multiple occurrences, \"\n            \"this describes the first known occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onsetString\", title=\"Extension field for ``onsetString``.\"\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"deceased | permanent disability | etc.\",\n        description=(\n            \"Indicates what happened as a result of this condition.  If the \"\n            \"condition resulted in death, deceased date is captured on the \"\n            \"relation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``FamilyMemberHistoryCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"outcome\",\n            \"onsetAge\",\n            \"onsetRange\",\n            \"onsetPeriod\",\n            \"onsetString\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``FamilyMemberHistoryCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"onset\": [\"onsetAge\", \"onsetPeriod\", \"onsetRange\", \"onsetString\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/fhirprimitiveextension.py",
    "content": "from __future__ import annotations as _annotations\n\nimport typing\n\nfrom fhir_core import fhirabstractmodel\nfrom pydantic import Field, model_validator\nfrom pydantic_core import PydanticCustomError\n\nfrom . import fhirtypes\n\n__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n\n\nclass FHIRPrimitiveExtension(fhirabstractmodel.FHIRAbstractModel):\n    \"\"\"@see: https://www.hl7.org/fhir/extensibility.html\n    Extensibility feature for FHIR Primitive Data Types.\"\"\"\n\n    __resource_type__ = \"FHIRPrimitiveExtension\"\n\n    id: typing.Optional[fhirtypes.StringType] = Field(\n        default=None,\n        alias=\"id\",\n        title=\"Type `String`\",\n        description=\"Unique id for inter-element referencing\",\n        # if property is an element of this resource.\n        json_schema_extra={\"element_property\": False},\n    )\n\n    extension: typing.Optional[typing.List[fhirtypes.ExtensionType]] = Field(\n        None,\n        alias=\"extension\",\n        title=\"List of `Extension` items (represented as `dict` in JSON)\",\n        description=\"Additional content defined by implementations\",\n        # if property is an element of this resource.\n        json_schema_extra={\"element_property\": False},\n    )\n\n    @model_validator(mode=\"before\")\n    def validate_extension_or_fhir_comment_required(\n        cls, values: typing.Dict[str, typing.Any]\n    ) -> typing.Dict[str, typing.Any]:\n        \"\"\"Conditional Required Validation\"\"\"\n        extension = values.get(\"extension\", None)\n        fhir_comments = values.get(\"fhir_comments\", None)\n\n        if (\n            values.get(\"id\", None) is None\n            and extension is None\n            and fhir_comments is None\n        ):\n            raise PydanticCustomError(\n                \"model_validation_format\",\n                \"One of field value is required.\",\n                {},\n            )\n        return values\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from ``FHIRPrimitiveExtension`` according to specification,\n        with preserving original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/fhirresourcemodel.py",
    "content": "from typing import Optional, Union\n\nfrom fhir_core.fhirabstractmodel import FHIRAbstractModel\n\nfrom .fhirtypes import IdType, StringType\n\n\nclass FHIRResourceModel(FHIRAbstractModel):\n    \"\"\"Abstract base model class for all FHIR elements.\"\"\"\n\n    __resource_type__ = \"FHIRAbstractResource\"\n\n    id: Optional[Union[IdType, StringType]] = None\n\n    def relative_base(self) -> str:\n        \"\"\" \"\"\"\n        return self.__resource_type__\n\n    def relative_path(self) -> str:\n        if self.id is None:\n            return self.relative_base()\n        return \"{0}/{1}\".format(self.relative_base(), self.id)\n"
  },
  {
    "path": "fhir/resources/STU3/fhirtypes.py",
    "content": "from __future__ import annotations as _annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom fhir_core.types import (\n    Base64BinaryType,\n    BooleanType,\n    CanonicalType,\n    CodeType,\n    DateTimeType,\n    DateType,\n    DecimalType,\n    IdType,\n    InstantType,\n    Integer64Type,\n    IntegerType,\n    MarkdownType,\n    OidType,\n    PositiveIntType,\n    StringType,\n    TimeType,\n    UnsignedIntType,\n    UriType,\n    UrlType,\n    UuidType,\n    XhtmlType,\n    create_fhir_element_or_resource_type,\n    create_fhir_type,\n)\n\n__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n\n# The dependency hierarchy is circular due to Extension being referenced in FHIRPrimitiveExtension\n# which itself is referenced in every resource. Extension is also referenced in several resources and refers to several resources.\n# Pydantic fields can not use forward references as this causes the \"class not fully defined\" error at runtime: https://docs.pydantic.dev/2.12/errors/usage_errors/#class-not-fully-defined\n# To properly allow type checkers to type check, use type aliases during type checking and the create_fhir_type workaround at runtime.\nif TYPE_CHECKING:\n    from . import (\n        account,\n        activitydefinition,\n        address,\n        adverseevent,\n        age,\n        allergyintolerance,\n        annotation,\n        appointment,\n        appointmentresponse,\n        attachment,\n        auditevent,\n        backboneelement,\n        basic,\n        binary,\n        bodysite,\n        bundle,\n        capabilitystatement,\n        careplan,\n        careteam,\n        chargeitem,\n        claim,\n        claimresponse,\n        clinicalimpression,\n        codeableconcept,\n        codesystem,\n        coding,\n        communication,\n        communicationrequest,\n        compartmentdefinition,\n        composition,\n        conceptmap,\n        condition,\n        consent,\n        contactdetail,\n        contactpoint,\n        contract,\n        contributor,\n        count,\n        coverage,\n        dataelement,\n        datarequirement,\n        detectedissue,\n        device,\n        devicecomponent,\n        devicemetric,\n        devicerequest,\n        deviceusestatement,\n        diagnosticreport,\n        distance,\n        documentmanifest,\n        documentreference,\n        domainresource,\n        dosage,\n        duration,\n        element,\n        elementdefinition,\n        eligibilityrequest,\n        eligibilityresponse,\n        encounter,\n        endpoint,\n        enrollmentrequest,\n        enrollmentresponse,\n        episodeofcare,\n        expansionprofile,\n        explanationofbenefit,\n        extension,\n        familymemberhistory,\n        flag,\n        goal,\n        graphdefinition,\n        group,\n        guidanceresponse,\n        healthcareservice,\n        humanname,\n        identifier,\n        imagingmanifest,\n        imagingstudy,\n        immunization,\n        immunizationrecommendation,\n        implementationguide,\n        library,\n        linkage,\n        list,\n        location,\n        measure,\n        measurereport,\n        media,\n        medication,\n        medicationadministration,\n        medicationdispense,\n        medicationrequest,\n        medicationstatement,\n        messagedefinition,\n        messageheader,\n        meta,\n        metadataresource,\n        money,\n        namingsystem,\n        narrative,\n        nutritionorder,\n        observation,\n        operationdefinition,\n        operationoutcome,\n        organization,\n        parameterdefinition,\n        parameters,\n        patient,\n        paymentnotice,\n        paymentreconciliation,\n        period,\n        person,\n        plandefinition,\n        practitioner,\n        practitionerrole,\n        procedure,\n        procedurerequest,\n        processrequest,\n        processresponse,\n        provenance,\n        quantity,\n        questionnaire,\n        questionnaireresponse,\n        range,\n        ratio,\n        reference,\n        referralrequest,\n        relatedartifact,\n        relatedperson,\n        requestgroup,\n        researchstudy,\n        researchsubject,\n        resource,\n        riskassessment,\n        sampleddata,\n        schedule,\n        searchparameter,\n        sequence,\n        servicedefinition,\n        signature,\n        slot,\n        specimen,\n        structuredefinition,\n        structuremap,\n        subscription,\n        substance,\n        supplydelivery,\n        supplyrequest,\n        task,\n        testreport,\n        testscript,\n        timing,\n        triggerdefinition,\n        usagecontext,\n        valueset,\n        visionprescription,\n    )\n    from .fhirprimitiveextension import FHIRPrimitiveExtension\n\n    FHIRPrimitiveExtensionType = FHIRPrimitiveExtension\n    AccountType = account.Account\n\n    AccountCoverageType = account.AccountCoverage\n\n    AccountGuarantorType = account.AccountGuarantor\n\n    ActivityDefinitionType = activitydefinition.ActivityDefinition\n\n    ActivityDefinitionDynamicValueType = (\n        activitydefinition.ActivityDefinitionDynamicValue\n    )\n\n    ActivityDefinitionParticipantType = activitydefinition.ActivityDefinitionParticipant\n\n    AddressType = address.Address\n\n    AdverseEventType = adverseevent.AdverseEvent\n\n    AdverseEventSuspectEntityType = adverseevent.AdverseEventSuspectEntity\n\n    AgeType = age.Age\n\n    AllergyIntoleranceType = allergyintolerance.AllergyIntolerance\n\n    AllergyIntoleranceReactionType = allergyintolerance.AllergyIntoleranceReaction\n\n    AnnotationType = annotation.Annotation\n\n    AppointmentType = appointment.Appointment\n\n    AppointmentParticipantType = appointment.AppointmentParticipant\n\n    AppointmentResponseType = appointmentresponse.AppointmentResponse\n\n    AttachmentType = attachment.Attachment\n\n    AuditEventType = auditevent.AuditEvent\n\n    AuditEventAgentType = auditevent.AuditEventAgent\n\n    AuditEventAgentNetworkType = auditevent.AuditEventAgentNetwork\n\n    AuditEventEntityType = auditevent.AuditEventEntity\n\n    AuditEventEntityDetailType = auditevent.AuditEventEntityDetail\n\n    AuditEventSourceType = auditevent.AuditEventSource\n\n    BackboneElementType = backboneelement.BackboneElement\n\n    BasicType = basic.Basic\n\n    BinaryType = binary.Binary\n\n    BodySiteType = bodysite.BodySite\n\n    BundleType = bundle.Bundle\n\n    BundleEntryType = bundle.BundleEntry\n\n    BundleEntryRequestType = bundle.BundleEntryRequest\n\n    BundleEntryResponseType = bundle.BundleEntryResponse\n\n    BundleEntrySearchType = bundle.BundleEntrySearch\n\n    BundleLinkType = bundle.BundleLink\n\n    CapabilityStatementType = capabilitystatement.CapabilityStatement\n\n    CapabilityStatementDocumentType = capabilitystatement.CapabilityStatementDocument\n\n    CapabilityStatementImplementationType = (\n        capabilitystatement.CapabilityStatementImplementation\n    )\n\n    CapabilityStatementMessagingType = capabilitystatement.CapabilityStatementMessaging\n\n    CapabilityStatementMessagingEndpointType = (\n        capabilitystatement.CapabilityStatementMessagingEndpoint\n    )\n\n    CapabilityStatementMessagingEventType = (\n        capabilitystatement.CapabilityStatementMessagingEvent\n    )\n\n    CapabilityStatementMessagingSupportedMessageType = (\n        capabilitystatement.CapabilityStatementMessagingSupportedMessage\n    )\n\n    CapabilityStatementRestType = capabilitystatement.CapabilityStatementRest\n\n    CapabilityStatementRestInteractionType = (\n        capabilitystatement.CapabilityStatementRestInteraction\n    )\n\n    CapabilityStatementRestOperationType = (\n        capabilitystatement.CapabilityStatementRestOperation\n    )\n\n    CapabilityStatementRestResourceType = (\n        capabilitystatement.CapabilityStatementRestResource\n    )\n\n    CapabilityStatementRestResourceInteractionType = (\n        capabilitystatement.CapabilityStatementRestResourceInteraction\n    )\n\n    CapabilityStatementRestResourceSearchParamType = (\n        capabilitystatement.CapabilityStatementRestResourceSearchParam\n    )\n\n    CapabilityStatementRestSecurityType = (\n        capabilitystatement.CapabilityStatementRestSecurity\n    )\n\n    CapabilityStatementRestSecurityCertificateType = (\n        capabilitystatement.CapabilityStatementRestSecurityCertificate\n    )\n\n    CapabilityStatementSoftwareType = capabilitystatement.CapabilityStatementSoftware\n\n    CarePlanType = careplan.CarePlan\n\n    CarePlanActivityType = careplan.CarePlanActivity\n\n    CarePlanActivityDetailType = careplan.CarePlanActivityDetail\n\n    CareTeamType = careteam.CareTeam\n\n    CareTeamParticipantType = careteam.CareTeamParticipant\n\n    ChargeItemType = chargeitem.ChargeItem\n\n    ChargeItemParticipantType = chargeitem.ChargeItemParticipant\n\n    ClaimType = claim.Claim\n\n    ClaimAccidentType = claim.ClaimAccident\n\n    ClaimCareTeamType = claim.ClaimCareTeam\n\n    ClaimDiagnosisType = claim.ClaimDiagnosis\n\n    ClaimInformationType = claim.ClaimInformation\n\n    ClaimInsuranceType = claim.ClaimInsurance\n\n    ClaimItemType = claim.ClaimItem\n\n    ClaimItemDetailType = claim.ClaimItemDetail\n\n    ClaimItemDetailSubDetailType = claim.ClaimItemDetailSubDetail\n\n    ClaimPayeeType = claim.ClaimPayee\n\n    ClaimProcedureType = claim.ClaimProcedure\n\n    ClaimRelatedType = claim.ClaimRelated\n\n    ClaimResponseType = claimresponse.ClaimResponse\n\n    ClaimResponseAddItemType = claimresponse.ClaimResponseAddItem\n\n    ClaimResponseAddItemDetailType = claimresponse.ClaimResponseAddItemDetail\n\n    ClaimResponseErrorType = claimresponse.ClaimResponseError\n\n    ClaimResponseInsuranceType = claimresponse.ClaimResponseInsurance\n\n    ClaimResponseItemType = claimresponse.ClaimResponseItem\n\n    ClaimResponseItemAdjudicationType = claimresponse.ClaimResponseItemAdjudication\n\n    ClaimResponseItemDetailType = claimresponse.ClaimResponseItemDetail\n\n    ClaimResponseItemDetailSubDetailType = (\n        claimresponse.ClaimResponseItemDetailSubDetail\n    )\n\n    ClaimResponsePaymentType = claimresponse.ClaimResponsePayment\n\n    ClaimResponseProcessNoteType = claimresponse.ClaimResponseProcessNote\n\n    ClinicalImpressionType = clinicalimpression.ClinicalImpression\n\n    ClinicalImpressionFindingType = clinicalimpression.ClinicalImpressionFinding\n\n    ClinicalImpressionInvestigationType = (\n        clinicalimpression.ClinicalImpressionInvestigation\n    )\n\n    CodeSystemType = codesystem.CodeSystem\n\n    CodeSystemConceptType = codesystem.CodeSystemConcept\n\n    CodeSystemConceptDesignationType = codesystem.CodeSystemConceptDesignation\n\n    CodeSystemConceptPropertyType = codesystem.CodeSystemConceptProperty\n\n    CodeSystemFilterType = codesystem.CodeSystemFilter\n\n    CodeSystemPropertyType = codesystem.CodeSystemProperty\n\n    CodeableConceptType = codeableconcept.CodeableConcept\n\n    CodingType = coding.Coding\n\n    CommunicationType = communication.Communication\n\n    CommunicationPayloadType = communication.CommunicationPayload\n\n    CommunicationRequestType = communicationrequest.CommunicationRequest\n\n    CommunicationRequestPayloadType = communicationrequest.CommunicationRequestPayload\n\n    CommunicationRequestRequesterType = (\n        communicationrequest.CommunicationRequestRequester\n    )\n\n    CompartmentDefinitionType = compartmentdefinition.CompartmentDefinition\n\n    CompartmentDefinitionResourceType = (\n        compartmentdefinition.CompartmentDefinitionResource\n    )\n\n    CompositionType = composition.Composition\n\n    CompositionAttesterType = composition.CompositionAttester\n\n    CompositionEventType = composition.CompositionEvent\n\n    CompositionRelatesToType = composition.CompositionRelatesTo\n\n    CompositionSectionType = composition.CompositionSection\n\n    ConceptMapType = conceptmap.ConceptMap\n\n    ConceptMapGroupType = conceptmap.ConceptMapGroup\n\n    ConceptMapGroupElementType = conceptmap.ConceptMapGroupElement\n\n    ConceptMapGroupElementTargetType = conceptmap.ConceptMapGroupElementTarget\n\n    ConceptMapGroupElementTargetDependsOnType = (\n        conceptmap.ConceptMapGroupElementTargetDependsOn\n    )\n\n    ConceptMapGroupUnmappedType = conceptmap.ConceptMapGroupUnmapped\n\n    ConditionType = condition.Condition\n\n    ConditionEvidenceType = condition.ConditionEvidence\n\n    ConditionStageType = condition.ConditionStage\n\n    ConsentType = consent.Consent\n\n    ConsentActorType = consent.ConsentActor\n\n    ConsentDataType = consent.ConsentData\n\n    ConsentExceptType = consent.ConsentExcept\n\n    ConsentExceptActorType = consent.ConsentExceptActor\n\n    ConsentExceptDataType = consent.ConsentExceptData\n\n    ConsentPolicyType = consent.ConsentPolicy\n\n    ContactDetailType = contactdetail.ContactDetail\n\n    ContactPointType = contactpoint.ContactPoint\n\n    ContractType = contract.Contract\n\n    ContractAgentType = contract.ContractAgent\n\n    ContractFriendlyType = contract.ContractFriendly\n\n    ContractLegalType = contract.ContractLegal\n\n    ContractRuleType = contract.ContractRule\n\n    ContractSignerType = contract.ContractSigner\n\n    ContractTermType = contract.ContractTerm\n\n    ContractTermAgentType = contract.ContractTermAgent\n\n    ContractTermValuedItemType = contract.ContractTermValuedItem\n\n    ContractValuedItemType = contract.ContractValuedItem\n\n    ContributorType = contributor.Contributor\n\n    CountType = count.Count\n\n    CoverageType = coverage.Coverage\n\n    CoverageGroupingType = coverage.CoverageGrouping\n\n    DataElementType = dataelement.DataElement\n\n    DataElementMappingType = dataelement.DataElementMapping\n\n    DataRequirementType = datarequirement.DataRequirement\n\n    DataRequirementCodeFilterType = datarequirement.DataRequirementCodeFilter\n\n    DataRequirementDateFilterType = datarequirement.DataRequirementDateFilter\n\n    DetectedIssueType = detectedissue.DetectedIssue\n\n    DetectedIssueMitigationType = detectedissue.DetectedIssueMitigation\n\n    DeviceType = device.Device\n\n    DeviceComponentType = devicecomponent.DeviceComponent\n\n    DeviceComponentProductionSpecificationType = (\n        devicecomponent.DeviceComponentProductionSpecification\n    )\n\n    DeviceMetricType = devicemetric.DeviceMetric\n\n    DeviceMetricCalibrationType = devicemetric.DeviceMetricCalibration\n\n    DeviceRequestType = devicerequest.DeviceRequest\n\n    DeviceRequestRequesterType = devicerequest.DeviceRequestRequester\n\n    DeviceUdiType = device.DeviceUdi\n\n    DeviceUseStatementType = deviceusestatement.DeviceUseStatement\n\n    DiagnosticReportType = diagnosticreport.DiagnosticReport\n\n    DiagnosticReportImageType = diagnosticreport.DiagnosticReportImage\n\n    DiagnosticReportPerformerType = diagnosticreport.DiagnosticReportPerformer\n\n    DistanceType = distance.Distance\n\n    DocumentManifestType = documentmanifest.DocumentManifest\n\n    DocumentManifestContentType = documentmanifest.DocumentManifestContent\n\n    DocumentManifestRelatedType = documentmanifest.DocumentManifestRelated\n\n    DocumentReferenceType = documentreference.DocumentReference\n\n    DocumentReferenceContentType = documentreference.DocumentReferenceContent\n\n    DocumentReferenceContextType = documentreference.DocumentReferenceContext\n\n    DocumentReferenceContextRelatedType = (\n        documentreference.DocumentReferenceContextRelated\n    )\n\n    DocumentReferenceRelatesToType = documentreference.DocumentReferenceRelatesTo\n\n    DomainResourceType = domainresource.DomainResource\n\n    DosageType = dosage.Dosage\n\n    DurationType = duration.Duration\n\n    ElementType = element.Element\n\n    ElementDefinitionType = elementdefinition.ElementDefinition\n\n    ElementDefinitionBaseType = elementdefinition.ElementDefinitionBase\n\n    ElementDefinitionBindingType = elementdefinition.ElementDefinitionBinding\n\n    ElementDefinitionConstraintType = elementdefinition.ElementDefinitionConstraint\n\n    ElementDefinitionExampleType = elementdefinition.ElementDefinitionExample\n\n    ElementDefinitionMappingType = elementdefinition.ElementDefinitionMapping\n\n    ElementDefinitionSlicingType = elementdefinition.ElementDefinitionSlicing\n\n    ElementDefinitionSlicingDiscriminatorType = (\n        elementdefinition.ElementDefinitionSlicingDiscriminator\n    )\n\n    ElementDefinitionTypeType = elementdefinition.ElementDefinitionType\n\n    EligibilityRequestType = eligibilityrequest.EligibilityRequest\n\n    EligibilityResponseType = eligibilityresponse.EligibilityResponse\n\n    EligibilityResponseErrorType = eligibilityresponse.EligibilityResponseError\n\n    EligibilityResponseInsuranceType = eligibilityresponse.EligibilityResponseInsurance\n\n    EligibilityResponseInsuranceBenefitBalanceType = (\n        eligibilityresponse.EligibilityResponseInsuranceBenefitBalance\n    )\n\n    EligibilityResponseInsuranceBenefitBalanceFinancialType = (\n        eligibilityresponse.EligibilityResponseInsuranceBenefitBalanceFinancial\n    )\n\n    EncounterType = encounter.Encounter\n\n    EncounterClassHistoryType = encounter.EncounterClassHistory\n\n    EncounterDiagnosisType = encounter.EncounterDiagnosis\n\n    EncounterHospitalizationType = encounter.EncounterHospitalization\n\n    EncounterLocationType = encounter.EncounterLocation\n\n    EncounterParticipantType = encounter.EncounterParticipant\n\n    EncounterStatusHistoryType = encounter.EncounterStatusHistory\n\n    EndpointType = endpoint.Endpoint\n\n    EnrollmentRequestType = enrollmentrequest.EnrollmentRequest\n\n    EnrollmentResponseType = enrollmentresponse.EnrollmentResponse\n\n    EpisodeOfCareType = episodeofcare.EpisodeOfCare\n\n    EpisodeOfCareDiagnosisType = episodeofcare.EpisodeOfCareDiagnosis\n\n    EpisodeOfCareStatusHistoryType = episodeofcare.EpisodeOfCareStatusHistory\n\n    ExpansionProfileType = expansionprofile.ExpansionProfile\n\n    ExpansionProfileDesignationType = expansionprofile.ExpansionProfileDesignation\n\n    ExpansionProfileDesignationExcludeType = (\n        expansionprofile.ExpansionProfileDesignationExclude\n    )\n\n    ExpansionProfileDesignationExcludeDesignationType = (\n        expansionprofile.ExpansionProfileDesignationExcludeDesignation\n    )\n\n    ExpansionProfileDesignationIncludeType = (\n        expansionprofile.ExpansionProfileDesignationInclude\n    )\n\n    ExpansionProfileDesignationIncludeDesignationType = (\n        expansionprofile.ExpansionProfileDesignationIncludeDesignation\n    )\n\n    ExpansionProfileExcludedSystemType = expansionprofile.ExpansionProfileExcludedSystem\n\n    ExpansionProfileFixedVersionType = expansionprofile.ExpansionProfileFixedVersion\n\n    ExplanationOfBenefitType = explanationofbenefit.ExplanationOfBenefit\n\n    ExplanationOfBenefitAccidentType = explanationofbenefit.ExplanationOfBenefitAccident\n\n    ExplanationOfBenefitAddItemType = explanationofbenefit.ExplanationOfBenefitAddItem\n\n    ExplanationOfBenefitAddItemDetailType = (\n        explanationofbenefit.ExplanationOfBenefitAddItemDetail\n    )\n\n    ExplanationOfBenefitBenefitBalanceType = (\n        explanationofbenefit.ExplanationOfBenefitBenefitBalance\n    )\n\n    ExplanationOfBenefitBenefitBalanceFinancialType = (\n        explanationofbenefit.ExplanationOfBenefitBenefitBalanceFinancial\n    )\n\n    ExplanationOfBenefitCareTeamType = explanationofbenefit.ExplanationOfBenefitCareTeam\n\n    ExplanationOfBenefitDiagnosisType = (\n        explanationofbenefit.ExplanationOfBenefitDiagnosis\n    )\n\n    ExplanationOfBenefitInformationType = (\n        explanationofbenefit.ExplanationOfBenefitInformation\n    )\n\n    ExplanationOfBenefitInsuranceType = (\n        explanationofbenefit.ExplanationOfBenefitInsurance\n    )\n\n    ExplanationOfBenefitItemType = explanationofbenefit.ExplanationOfBenefitItem\n\n    ExplanationOfBenefitItemAdjudicationType = (\n        explanationofbenefit.ExplanationOfBenefitItemAdjudication\n    )\n\n    ExplanationOfBenefitItemDetailType = (\n        explanationofbenefit.ExplanationOfBenefitItemDetail\n    )\n\n    ExplanationOfBenefitItemDetailSubDetailType = (\n        explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail\n    )\n\n    ExplanationOfBenefitPayeeType = explanationofbenefit.ExplanationOfBenefitPayee\n\n    ExplanationOfBenefitPaymentType = explanationofbenefit.ExplanationOfBenefitPayment\n\n    ExplanationOfBenefitProcedureType = (\n        explanationofbenefit.ExplanationOfBenefitProcedure\n    )\n\n    ExplanationOfBenefitProcessNoteType = (\n        explanationofbenefit.ExplanationOfBenefitProcessNote\n    )\n\n    ExplanationOfBenefitRelatedType = explanationofbenefit.ExplanationOfBenefitRelated\n\n    ExtensionType = extension.Extension\n\n    FamilyMemberHistoryType = familymemberhistory.FamilyMemberHistory\n\n    FamilyMemberHistoryConditionType = familymemberhistory.FamilyMemberHistoryCondition\n\n    FlagType = flag.Flag\n\n    GoalType = goal.Goal\n\n    GoalTargetType = goal.GoalTarget\n\n    GraphDefinitionType = graphdefinition.GraphDefinition\n\n    GraphDefinitionLinkType = graphdefinition.GraphDefinitionLink\n\n    GraphDefinitionLinkTargetType = graphdefinition.GraphDefinitionLinkTarget\n\n    GraphDefinitionLinkTargetCompartmentType = (\n        graphdefinition.GraphDefinitionLinkTargetCompartment\n    )\n\n    GroupType = group.Group\n\n    GroupCharacteristicType = group.GroupCharacteristic\n\n    GroupMemberType = group.GroupMember\n\n    GuidanceResponseType = guidanceresponse.GuidanceResponse\n\n    HealthcareServiceType = healthcareservice.HealthcareService\n\n    HealthcareServiceAvailableTimeType = (\n        healthcareservice.HealthcareServiceAvailableTime\n    )\n\n    HealthcareServiceNotAvailableType = healthcareservice.HealthcareServiceNotAvailable\n\n    HumanNameType = humanname.HumanName\n\n    IdentifierType = identifier.Identifier\n\n    ImagingManifestType = imagingmanifest.ImagingManifest\n\n    ImagingManifestStudyType = imagingmanifest.ImagingManifestStudy\n\n    ImagingManifestStudySeriesType = imagingmanifest.ImagingManifestStudySeries\n\n    ImagingManifestStudySeriesInstanceType = (\n        imagingmanifest.ImagingManifestStudySeriesInstance\n    )\n\n    ImagingStudyType = imagingstudy.ImagingStudy\n\n    ImagingStudySeriesType = imagingstudy.ImagingStudySeries\n\n    ImagingStudySeriesInstanceType = imagingstudy.ImagingStudySeriesInstance\n\n    ImmunizationType = immunization.Immunization\n\n    ImmunizationExplanationType = immunization.ImmunizationExplanation\n\n    ImmunizationPractitionerType = immunization.ImmunizationPractitioner\n\n    ImmunizationReactionType = immunization.ImmunizationReaction\n\n    ImmunizationRecommendationType = (\n        immunizationrecommendation.ImmunizationRecommendation\n    )\n\n    ImmunizationRecommendationRecommendationType = (\n        immunizationrecommendation.ImmunizationRecommendationRecommendation\n    )\n\n    ImmunizationRecommendationRecommendationDateCriterionType = (\n        immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion\n    )\n\n    ImmunizationRecommendationRecommendationProtocolType = (\n        immunizationrecommendation.ImmunizationRecommendationRecommendationProtocol\n    )\n\n    ImmunizationVaccinationProtocolType = immunization.ImmunizationVaccinationProtocol\n\n    ImplementationGuideType = implementationguide.ImplementationGuide\n\n    ImplementationGuideDependencyType = (\n        implementationguide.ImplementationGuideDependency\n    )\n\n    ImplementationGuideGlobalType = implementationguide.ImplementationGuideGlobal\n\n    ImplementationGuidePackageType = implementationguide.ImplementationGuidePackage\n\n    ImplementationGuidePackageResourceType = (\n        implementationguide.ImplementationGuidePackageResource\n    )\n\n    ImplementationGuidePageType = implementationguide.ImplementationGuidePage\n\n    LibraryType = library.Library\n\n    LinkageType = linkage.Linkage\n\n    LinkageItemType = linkage.LinkageItem\n\n    ListType = list.List\n\n    ListEntryType = list.ListEntry\n\n    LocationType = location.Location\n\n    LocationPositionType = location.LocationPosition\n\n    MeasureType = measure.Measure\n\n    MeasureGroupType = measure.MeasureGroup\n\n    MeasureGroupPopulationType = measure.MeasureGroupPopulation\n\n    MeasureGroupStratifierType = measure.MeasureGroupStratifier\n\n    MeasureReportType = measurereport.MeasureReport\n\n    MeasureReportGroupType = measurereport.MeasureReportGroup\n\n    MeasureReportGroupPopulationType = measurereport.MeasureReportGroupPopulation\n\n    MeasureReportGroupStratifierType = measurereport.MeasureReportGroupStratifier\n\n    MeasureReportGroupStratifierStratumType = (\n        measurereport.MeasureReportGroupStratifierStratum\n    )\n\n    MeasureReportGroupStratifierStratumPopulationType = (\n        measurereport.MeasureReportGroupStratifierStratumPopulation\n    )\n\n    MeasureSupplementalDataType = measure.MeasureSupplementalData\n\n    MediaType = media.Media\n\n    MedicationType = medication.Medication\n\n    MedicationAdministrationType = medicationadministration.MedicationAdministration\n\n    MedicationAdministrationDosageType = (\n        medicationadministration.MedicationAdministrationDosage\n    )\n\n    MedicationAdministrationPerformerType = (\n        medicationadministration.MedicationAdministrationPerformer\n    )\n\n    MedicationDispenseType = medicationdispense.MedicationDispense\n\n    MedicationDispensePerformerType = medicationdispense.MedicationDispensePerformer\n\n    MedicationDispenseSubstitutionType = (\n        medicationdispense.MedicationDispenseSubstitution\n    )\n\n    MedicationIngredientType = medication.MedicationIngredient\n\n    MedicationPackageType = medication.MedicationPackage\n\n    MedicationPackageBatchType = medication.MedicationPackageBatch\n\n    MedicationPackageContentType = medication.MedicationPackageContent\n\n    MedicationRequestType = medicationrequest.MedicationRequest\n\n    MedicationRequestDispenseRequestType = (\n        medicationrequest.MedicationRequestDispenseRequest\n    )\n\n    MedicationRequestRequesterType = medicationrequest.MedicationRequestRequester\n\n    MedicationRequestSubstitutionType = medicationrequest.MedicationRequestSubstitution\n\n    MedicationStatementType = medicationstatement.MedicationStatement\n\n    MessageDefinitionType = messagedefinition.MessageDefinition\n\n    MessageDefinitionAllowedResponseType = (\n        messagedefinition.MessageDefinitionAllowedResponse\n    )\n\n    MessageDefinitionFocusType = messagedefinition.MessageDefinitionFocus\n\n    MessageHeaderType = messageheader.MessageHeader\n\n    MessageHeaderDestinationType = messageheader.MessageHeaderDestination\n\n    MessageHeaderResponseType = messageheader.MessageHeaderResponse\n\n    MessageHeaderSourceType = messageheader.MessageHeaderSource\n\n    MetaType = meta.Meta\n\n    MetadataResourceType = metadataresource.MetadataResource\n\n    MoneyType = money.Money\n\n    NamingSystemType = namingsystem.NamingSystem\n\n    NamingSystemUniqueIdType = namingsystem.NamingSystemUniqueId\n\n    NarrativeType = narrative.Narrative\n\n    NutritionOrderType = nutritionorder.NutritionOrder\n\n    NutritionOrderEnteralFormulaType = nutritionorder.NutritionOrderEnteralFormula\n\n    NutritionOrderEnteralFormulaAdministrationType = (\n        nutritionorder.NutritionOrderEnteralFormulaAdministration\n    )\n\n    NutritionOrderOralDietType = nutritionorder.NutritionOrderOralDiet\n\n    NutritionOrderOralDietNutrientType = nutritionorder.NutritionOrderOralDietNutrient\n\n    NutritionOrderOralDietTextureType = nutritionorder.NutritionOrderOralDietTexture\n\n    NutritionOrderSupplementType = nutritionorder.NutritionOrderSupplement\n\n    ObservationType = observation.Observation\n\n    ObservationComponentType = observation.ObservationComponent\n\n    ObservationReferenceRangeType = observation.ObservationReferenceRange\n\n    ObservationRelatedType = observation.ObservationRelated\n\n    OperationDefinitionType = operationdefinition.OperationDefinition\n\n    OperationDefinitionOverloadType = operationdefinition.OperationDefinitionOverload\n\n    OperationDefinitionParameterType = operationdefinition.OperationDefinitionParameter\n\n    OperationDefinitionParameterBindingType = (\n        operationdefinition.OperationDefinitionParameterBinding\n    )\n\n    OperationOutcomeType = operationoutcome.OperationOutcome\n\n    OperationOutcomeIssueType = operationoutcome.OperationOutcomeIssue\n\n    OrganizationType = organization.Organization\n\n    OrganizationContactType = organization.OrganizationContact\n\n    ParameterDefinitionType = parameterdefinition.ParameterDefinition\n\n    ParametersType = parameters.Parameters\n\n    ParametersParameterType = parameters.ParametersParameter\n\n    PatientType = patient.Patient\n\n    PatientAnimalType = patient.PatientAnimal\n\n    PatientCommunicationType = patient.PatientCommunication\n\n    PatientContactType = patient.PatientContact\n\n    PatientLinkType = patient.PatientLink\n\n    PaymentNoticeType = paymentnotice.PaymentNotice\n\n    PaymentReconciliationType = paymentreconciliation.PaymentReconciliation\n\n    PaymentReconciliationDetailType = paymentreconciliation.PaymentReconciliationDetail\n\n    PaymentReconciliationProcessNoteType = (\n        paymentreconciliation.PaymentReconciliationProcessNote\n    )\n\n    PeriodType = period.Period\n\n    PersonType = person.Person\n\n    PersonLinkType = person.PersonLink\n\n    PlanDefinitionType = plandefinition.PlanDefinition\n\n    PlanDefinitionActionType = plandefinition.PlanDefinitionAction\n\n    PlanDefinitionActionConditionType = plandefinition.PlanDefinitionActionCondition\n\n    PlanDefinitionActionDynamicValueType = (\n        plandefinition.PlanDefinitionActionDynamicValue\n    )\n\n    PlanDefinitionActionParticipantType = plandefinition.PlanDefinitionActionParticipant\n\n    PlanDefinitionActionRelatedActionType = (\n        plandefinition.PlanDefinitionActionRelatedAction\n    )\n\n    PlanDefinitionGoalType = plandefinition.PlanDefinitionGoal\n\n    PlanDefinitionGoalTargetType = plandefinition.PlanDefinitionGoalTarget\n\n    PractitionerType = practitioner.Practitioner\n\n    PractitionerQualificationType = practitioner.PractitionerQualification\n\n    PractitionerRoleType = practitionerrole.PractitionerRole\n\n    PractitionerRoleAvailableTimeType = practitionerrole.PractitionerRoleAvailableTime\n\n    PractitionerRoleNotAvailableType = practitionerrole.PractitionerRoleNotAvailable\n\n    ProcedureType = procedure.Procedure\n\n    ProcedureFocalDeviceType = procedure.ProcedureFocalDevice\n\n    ProcedurePerformerType = procedure.ProcedurePerformer\n\n    ProcedureRequestType = procedurerequest.ProcedureRequest\n\n    ProcedureRequestRequesterType = procedurerequest.ProcedureRequestRequester\n\n    ProcessRequestType = processrequest.ProcessRequest\n\n    ProcessRequestItemType = processrequest.ProcessRequestItem\n\n    ProcessResponseType = processresponse.ProcessResponse\n\n    ProcessResponseProcessNoteType = processresponse.ProcessResponseProcessNote\n\n    ProvenanceType = provenance.Provenance\n\n    ProvenanceAgentType = provenance.ProvenanceAgent\n\n    ProvenanceEntityType = provenance.ProvenanceEntity\n\n    QuantityType = quantity.Quantity\n\n    QuestionnaireType = questionnaire.Questionnaire\n\n    QuestionnaireItemType = questionnaire.QuestionnaireItem\n\n    QuestionnaireItemEnableWhenType = questionnaire.QuestionnaireItemEnableWhen\n\n    QuestionnaireItemOptionType = questionnaire.QuestionnaireItemOption\n\n    QuestionnaireResponseType = questionnaireresponse.QuestionnaireResponse\n\n    QuestionnaireResponseItemType = questionnaireresponse.QuestionnaireResponseItem\n\n    QuestionnaireResponseItemAnswerType = (\n        questionnaireresponse.QuestionnaireResponseItemAnswer\n    )\n\n    RangeType = range.Range\n\n    RatioType = ratio.Ratio\n\n    ReferenceType = reference.Reference\n\n    ReferralRequestType = referralrequest.ReferralRequest\n\n    ReferralRequestRequesterType = referralrequest.ReferralRequestRequester\n\n    RelatedArtifactType = relatedartifact.RelatedArtifact\n\n    RelatedPersonType = relatedperson.RelatedPerson\n\n    RequestGroupType = requestgroup.RequestGroup\n\n    RequestGroupActionType = requestgroup.RequestGroupAction\n\n    RequestGroupActionConditionType = requestgroup.RequestGroupActionCondition\n\n    RequestGroupActionRelatedActionType = requestgroup.RequestGroupActionRelatedAction\n\n    ResearchStudyType = researchstudy.ResearchStudy\n\n    ResearchStudyArmType = researchstudy.ResearchStudyArm\n\n    ResearchSubjectType = researchsubject.ResearchSubject\n\n    ResourceType = resource.Resource\n\n    RiskAssessmentType = riskassessment.RiskAssessment\n\n    RiskAssessmentPredictionType = riskassessment.RiskAssessmentPrediction\n\n    SampledDataType = sampleddata.SampledData\n\n    ScheduleType = schedule.Schedule\n\n    SearchParameterType = searchparameter.SearchParameter\n\n    SearchParameterComponentType = searchparameter.SearchParameterComponent\n\n    SequenceType = sequence.Sequence\n\n    SequenceQualityType = sequence.SequenceQuality\n\n    SequenceReferenceSeqType = sequence.SequenceReferenceSeq\n\n    SequenceRepositoryType = sequence.SequenceRepository\n\n    SequenceVariantType = sequence.SequenceVariant\n\n    ServiceDefinitionType = servicedefinition.ServiceDefinition\n\n    SignatureType = signature.Signature\n\n    SlotType = slot.Slot\n\n    SpecimenType = specimen.Specimen\n\n    SpecimenCollectionType = specimen.SpecimenCollection\n\n    SpecimenContainerType = specimen.SpecimenContainer\n\n    SpecimenProcessingType = specimen.SpecimenProcessing\n\n    StructureDefinitionType = structuredefinition.StructureDefinition\n\n    StructureDefinitionDifferentialType = (\n        structuredefinition.StructureDefinitionDifferential\n    )\n\n    StructureDefinitionMappingType = structuredefinition.StructureDefinitionMapping\n\n    StructureDefinitionSnapshotType = structuredefinition.StructureDefinitionSnapshot\n\n    StructureMapType = structuremap.StructureMap\n\n    StructureMapGroupType = structuremap.StructureMapGroup\n\n    StructureMapGroupInputType = structuremap.StructureMapGroupInput\n\n    StructureMapGroupRuleType = structuremap.StructureMapGroupRule\n\n    StructureMapGroupRuleDependentType = structuremap.StructureMapGroupRuleDependent\n\n    StructureMapGroupRuleSourceType = structuremap.StructureMapGroupRuleSource\n\n    StructureMapGroupRuleTargetType = structuremap.StructureMapGroupRuleTarget\n\n    StructureMapGroupRuleTargetParameterType = (\n        structuremap.StructureMapGroupRuleTargetParameter\n    )\n\n    StructureMapStructureType = structuremap.StructureMapStructure\n\n    SubscriptionType = subscription.Subscription\n\n    SubscriptionChannelType = subscription.SubscriptionChannel\n\n    SubstanceType = substance.Substance\n\n    SubstanceIngredientType = substance.SubstanceIngredient\n\n    SubstanceInstanceType = substance.SubstanceInstance\n\n    SupplyDeliveryType = supplydelivery.SupplyDelivery\n\n    SupplyDeliverySuppliedItemType = supplydelivery.SupplyDeliverySuppliedItem\n\n    SupplyRequestType = supplyrequest.SupplyRequest\n\n    SupplyRequestOrderedItemType = supplyrequest.SupplyRequestOrderedItem\n\n    SupplyRequestRequesterType = supplyrequest.SupplyRequestRequester\n\n    TaskType = task.Task\n\n    TaskInputType = task.TaskInput\n\n    TaskOutputType = task.TaskOutput\n\n    TaskRequesterType = task.TaskRequester\n\n    TaskRestrictionType = task.TaskRestriction\n\n    TestReportType = testreport.TestReport\n\n    TestReportParticipantType = testreport.TestReportParticipant\n\n    TestReportSetupType = testreport.TestReportSetup\n\n    TestReportSetupActionType = testreport.TestReportSetupAction\n\n    TestReportSetupActionAssertType = testreport.TestReportSetupActionAssert\n\n    TestReportSetupActionOperationType = testreport.TestReportSetupActionOperation\n\n    TestReportTeardownType = testreport.TestReportTeardown\n\n    TestReportTeardownActionType = testreport.TestReportTeardownAction\n\n    TestReportTestType = testreport.TestReportTest\n\n    TestReportTestActionType = testreport.TestReportTestAction\n\n    TestScriptType = testscript.TestScript\n\n    TestScriptDestinationType = testscript.TestScriptDestination\n\n    TestScriptFixtureType = testscript.TestScriptFixture\n\n    TestScriptMetadataType = testscript.TestScriptMetadata\n\n    TestScriptMetadataCapabilityType = testscript.TestScriptMetadataCapability\n\n    TestScriptMetadataLinkType = testscript.TestScriptMetadataLink\n\n    TestScriptOriginType = testscript.TestScriptOrigin\n\n    TestScriptRuleType = testscript.TestScriptRule\n\n    TestScriptRuleParamType = testscript.TestScriptRuleParam\n\n    TestScriptRulesetType = testscript.TestScriptRuleset\n\n    TestScriptRulesetRuleType = testscript.TestScriptRulesetRule\n\n    TestScriptRulesetRuleParamType = testscript.TestScriptRulesetRuleParam\n\n    TestScriptSetupType = testscript.TestScriptSetup\n\n    TestScriptSetupActionType = testscript.TestScriptSetupAction\n\n    TestScriptSetupActionAssertType = testscript.TestScriptSetupActionAssert\n\n    TestScriptSetupActionAssertRuleType = testscript.TestScriptSetupActionAssertRule\n\n    TestScriptSetupActionAssertRuleParamType = (\n        testscript.TestScriptSetupActionAssertRuleParam\n    )\n\n    TestScriptSetupActionAssertRulesetType = (\n        testscript.TestScriptSetupActionAssertRuleset\n    )\n\n    TestScriptSetupActionAssertRulesetRuleType = (\n        testscript.TestScriptSetupActionAssertRulesetRule\n    )\n\n    TestScriptSetupActionAssertRulesetRuleParamType = (\n        testscript.TestScriptSetupActionAssertRulesetRuleParam\n    )\n\n    TestScriptSetupActionOperationType = testscript.TestScriptSetupActionOperation\n\n    TestScriptSetupActionOperationRequestHeaderType = (\n        testscript.TestScriptSetupActionOperationRequestHeader\n    )\n\n    TestScriptTeardownType = testscript.TestScriptTeardown\n\n    TestScriptTeardownActionType = testscript.TestScriptTeardownAction\n\n    TestScriptTestType = testscript.TestScriptTest\n\n    TestScriptTestActionType = testscript.TestScriptTestAction\n\n    TestScriptVariableType = testscript.TestScriptVariable\n\n    TimingType = timing.Timing\n\n    TimingRepeatType = timing.TimingRepeat\n\n    TriggerDefinitionType = triggerdefinition.TriggerDefinition\n\n    UsageContextType = usagecontext.UsageContext\n\n    ValueSetType = valueset.ValueSet\n\n    ValueSetComposeType = valueset.ValueSetCompose\n\n    ValueSetComposeIncludeType = valueset.ValueSetComposeInclude\n\n    ValueSetComposeIncludeConceptType = valueset.ValueSetComposeIncludeConcept\n\n    ValueSetComposeIncludeConceptDesignationType = (\n        valueset.ValueSetComposeIncludeConceptDesignation\n    )\n\n    ValueSetComposeIncludeFilterType = valueset.ValueSetComposeIncludeFilter\n\n    ValueSetExpansionType = valueset.ValueSetExpansion\n\n    ValueSetExpansionContainsType = valueset.ValueSetExpansionContains\n\n    ValueSetExpansionParameterType = valueset.ValueSetExpansionParameter\n\n    VisionPrescriptionType = visionprescription.VisionPrescription\n\n    VisionPrescriptionDispenseType = visionprescription.VisionPrescriptionDispense\n\nelse:\n    FHIRPrimitiveExtensionType = create_fhir_type(\n        \"FHIRPrimitiveExtensionType\",\n        \"fhir.resources.STU3.fhirprimitiveextension.FHIRPrimitiveExtension\",\n    )\n\n    ElementType = create_fhir_element_or_resource_type(\n        \"ElementType\", \"fhir.resources.STU3.element.Element\"\n    )\n\n    ResourceType = create_fhir_element_or_resource_type(\n        \"ResourceType\", \"fhir.resources.STU3.resource.Resource\"\n    )\n    AccountType = create_fhir_type(\"AccountType\", \"fhir.resources.STU3.account.Account\")\n\n    AccountCoverageType = create_fhir_type(\n        \"AccountCoverageType\", \"fhir.resources.STU3.account.AccountCoverage\"\n    )\n\n    AccountGuarantorType = create_fhir_type(\n        \"AccountGuarantorType\", \"fhir.resources.STU3.account.AccountGuarantor\"\n    )\n\n    ActivityDefinitionType = create_fhir_type(\n        \"ActivityDefinitionType\",\n        \"fhir.resources.STU3.activitydefinition.ActivityDefinition\",\n    )\n\n    ActivityDefinitionDynamicValueType = create_fhir_type(\n        \"ActivityDefinitionDynamicValueType\",\n        \"fhir.resources.STU3.activitydefinition.ActivityDefinitionDynamicValue\",\n    )\n\n    ActivityDefinitionParticipantType = create_fhir_type(\n        \"ActivityDefinitionParticipantType\",\n        \"fhir.resources.STU3.activitydefinition.ActivityDefinitionParticipant\",\n    )\n\n    AddressType = create_fhir_type(\"AddressType\", \"fhir.resources.STU3.address.Address\")\n\n    AdverseEventType = create_fhir_type(\n        \"AdverseEventType\", \"fhir.resources.STU3.adverseevent.AdverseEvent\"\n    )\n\n    AdverseEventSuspectEntityType = create_fhir_type(\n        \"AdverseEventSuspectEntityType\",\n        \"fhir.resources.STU3.adverseevent.AdverseEventSuspectEntity\",\n    )\n\n    AgeType = create_fhir_type(\"AgeType\", \"fhir.resources.STU3.age.Age\")\n\n    AllergyIntoleranceType = create_fhir_type(\n        \"AllergyIntoleranceType\",\n        \"fhir.resources.STU3.allergyintolerance.AllergyIntolerance\",\n    )\n\n    AllergyIntoleranceReactionType = create_fhir_type(\n        \"AllergyIntoleranceReactionType\",\n        \"fhir.resources.STU3.allergyintolerance.AllergyIntoleranceReaction\",\n    )\n\n    AnnotationType = create_fhir_type(\n        \"AnnotationType\", \"fhir.resources.STU3.annotation.Annotation\"\n    )\n\n    AppointmentType = create_fhir_type(\n        \"AppointmentType\", \"fhir.resources.STU3.appointment.Appointment\"\n    )\n\n    AppointmentParticipantType = create_fhir_type(\n        \"AppointmentParticipantType\",\n        \"fhir.resources.STU3.appointment.AppointmentParticipant\",\n    )\n\n    AppointmentResponseType = create_fhir_type(\n        \"AppointmentResponseType\",\n        \"fhir.resources.STU3.appointmentresponse.AppointmentResponse\",\n    )\n\n    AttachmentType = create_fhir_type(\n        \"AttachmentType\", \"fhir.resources.STU3.attachment.Attachment\"\n    )\n\n    AuditEventType = create_fhir_type(\n        \"AuditEventType\", \"fhir.resources.STU3.auditevent.AuditEvent\"\n    )\n\n    AuditEventAgentType = create_fhir_type(\n        \"AuditEventAgentType\", \"fhir.resources.STU3.auditevent.AuditEventAgent\"\n    )\n\n    AuditEventAgentNetworkType = create_fhir_type(\n        \"AuditEventAgentNetworkType\",\n        \"fhir.resources.STU3.auditevent.AuditEventAgentNetwork\",\n    )\n\n    AuditEventEntityType = create_fhir_type(\n        \"AuditEventEntityType\", \"fhir.resources.STU3.auditevent.AuditEventEntity\"\n    )\n\n    AuditEventEntityDetailType = create_fhir_type(\n        \"AuditEventEntityDetailType\",\n        \"fhir.resources.STU3.auditevent.AuditEventEntityDetail\",\n    )\n\n    AuditEventSourceType = create_fhir_type(\n        \"AuditEventSourceType\", \"fhir.resources.STU3.auditevent.AuditEventSource\"\n    )\n\n    BackboneElementType = create_fhir_type(\n        \"BackboneElementType\", \"fhir.resources.STU3.backboneelement.BackboneElement\"\n    )\n\n    BasicType = create_fhir_type(\"BasicType\", \"fhir.resources.STU3.basic.Basic\")\n\n    BinaryType = create_fhir_type(\"BinaryType\", \"fhir.resources.STU3.binary.Binary\")\n\n    BodySiteType = create_fhir_type(\n        \"BodySiteType\", \"fhir.resources.STU3.bodysite.BodySite\"\n    )\n\n    BundleType = create_fhir_type(\"BundleType\", \"fhir.resources.STU3.bundle.Bundle\")\n\n    BundleEntryType = create_fhir_type(\n        \"BundleEntryType\", \"fhir.resources.STU3.bundle.BundleEntry\"\n    )\n\n    BundleEntryRequestType = create_fhir_type(\n        \"BundleEntryRequestType\", \"fhir.resources.STU3.bundle.BundleEntryRequest\"\n    )\n\n    BundleEntryResponseType = create_fhir_type(\n        \"BundleEntryResponseType\", \"fhir.resources.STU3.bundle.BundleEntryResponse\"\n    )\n\n    BundleEntrySearchType = create_fhir_type(\n        \"BundleEntrySearchType\", \"fhir.resources.STU3.bundle.BundleEntrySearch\"\n    )\n\n    BundleLinkType = create_fhir_type(\n        \"BundleLinkType\", \"fhir.resources.STU3.bundle.BundleLink\"\n    )\n\n    CapabilityStatementType = create_fhir_type(\n        \"CapabilityStatementType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatement\",\n    )\n\n    CapabilityStatementDocumentType = create_fhir_type(\n        \"CapabilityStatementDocumentType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementDocument\",\n    )\n\n    CapabilityStatementImplementationType = create_fhir_type(\n        \"CapabilityStatementImplementationType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementImplementation\",\n    )\n\n    CapabilityStatementMessagingType = create_fhir_type(\n        \"CapabilityStatementMessagingType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementMessaging\",\n    )\n\n    CapabilityStatementMessagingEndpointType = create_fhir_type(\n        \"CapabilityStatementMessagingEndpointType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementMessagingEndpoint\",\n    )\n\n    CapabilityStatementMessagingEventType = create_fhir_type(\n        \"CapabilityStatementMessagingEventType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementMessagingEvent\",\n    )\n\n    CapabilityStatementMessagingSupportedMessageType = create_fhir_type(\n        \"CapabilityStatementMessagingSupportedMessageType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementMessagingSupportedMessage\",\n    )\n\n    CapabilityStatementRestType = create_fhir_type(\n        \"CapabilityStatementRestType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementRest\",\n    )\n\n    CapabilityStatementRestInteractionType = create_fhir_type(\n        \"CapabilityStatementRestInteractionType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementRestInteraction\",\n    )\n\n    CapabilityStatementRestOperationType = create_fhir_type(\n        \"CapabilityStatementRestOperationType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementRestOperation\",\n    )\n\n    CapabilityStatementRestResourceType = create_fhir_type(\n        \"CapabilityStatementRestResourceType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementRestResource\",\n    )\n\n    CapabilityStatementRestResourceInteractionType = create_fhir_type(\n        \"CapabilityStatementRestResourceInteractionType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementRestResourceInteraction\",\n    )\n\n    CapabilityStatementRestResourceSearchParamType = create_fhir_type(\n        \"CapabilityStatementRestResourceSearchParamType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementRestResourceSearchParam\",\n    )\n\n    CapabilityStatementRestSecurityType = create_fhir_type(\n        \"CapabilityStatementRestSecurityType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementRestSecurity\",\n    )\n\n    CapabilityStatementRestSecurityCertificateType = create_fhir_type(\n        \"CapabilityStatementRestSecurityCertificateType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementRestSecurityCertificate\",\n    )\n\n    CapabilityStatementSoftwareType = create_fhir_type(\n        \"CapabilityStatementSoftwareType\",\n        \"fhir.resources.STU3.capabilitystatement.CapabilityStatementSoftware\",\n    )\n\n    CarePlanType = create_fhir_type(\n        \"CarePlanType\", \"fhir.resources.STU3.careplan.CarePlan\"\n    )\n\n    CarePlanActivityType = create_fhir_type(\n        \"CarePlanActivityType\", \"fhir.resources.STU3.careplan.CarePlanActivity\"\n    )\n\n    CarePlanActivityDetailType = create_fhir_type(\n        \"CarePlanActivityDetailType\",\n        \"fhir.resources.STU3.careplan.CarePlanActivityDetail\",\n    )\n\n    CareTeamType = create_fhir_type(\n        \"CareTeamType\", \"fhir.resources.STU3.careteam.CareTeam\"\n    )\n\n    CareTeamParticipantType = create_fhir_type(\n        \"CareTeamParticipantType\", \"fhir.resources.STU3.careteam.CareTeamParticipant\"\n    )\n\n    ChargeItemType = create_fhir_type(\n        \"ChargeItemType\", \"fhir.resources.STU3.chargeitem.ChargeItem\"\n    )\n\n    ChargeItemParticipantType = create_fhir_type(\n        \"ChargeItemParticipantType\",\n        \"fhir.resources.STU3.chargeitem.ChargeItemParticipant\",\n    )\n\n    ClaimType = create_fhir_type(\"ClaimType\", \"fhir.resources.STU3.claim.Claim\")\n\n    ClaimAccidentType = create_fhir_type(\n        \"ClaimAccidentType\", \"fhir.resources.STU3.claim.ClaimAccident\"\n    )\n\n    ClaimCareTeamType = create_fhir_type(\n        \"ClaimCareTeamType\", \"fhir.resources.STU3.claim.ClaimCareTeam\"\n    )\n\n    ClaimDiagnosisType = create_fhir_type(\n        \"ClaimDiagnosisType\", \"fhir.resources.STU3.claim.ClaimDiagnosis\"\n    )\n\n    ClaimInformationType = create_fhir_type(\n        \"ClaimInformationType\", \"fhir.resources.STU3.claim.ClaimInformation\"\n    )\n\n    ClaimInsuranceType = create_fhir_type(\n        \"ClaimInsuranceType\", \"fhir.resources.STU3.claim.ClaimInsurance\"\n    )\n\n    ClaimItemType = create_fhir_type(\n        \"ClaimItemType\", \"fhir.resources.STU3.claim.ClaimItem\"\n    )\n\n    ClaimItemDetailType = create_fhir_type(\n        \"ClaimItemDetailType\", \"fhir.resources.STU3.claim.ClaimItemDetail\"\n    )\n\n    ClaimItemDetailSubDetailType = create_fhir_type(\n        \"ClaimItemDetailSubDetailType\",\n        \"fhir.resources.STU3.claim.ClaimItemDetailSubDetail\",\n    )\n\n    ClaimPayeeType = create_fhir_type(\n        \"ClaimPayeeType\", \"fhir.resources.STU3.claim.ClaimPayee\"\n    )\n\n    ClaimProcedureType = create_fhir_type(\n        \"ClaimProcedureType\", \"fhir.resources.STU3.claim.ClaimProcedure\"\n    )\n\n    ClaimRelatedType = create_fhir_type(\n        \"ClaimRelatedType\", \"fhir.resources.STU3.claim.ClaimRelated\"\n    )\n\n    ClaimResponseType = create_fhir_type(\n        \"ClaimResponseType\", \"fhir.resources.STU3.claimresponse.ClaimResponse\"\n    )\n\n    ClaimResponseAddItemType = create_fhir_type(\n        \"ClaimResponseAddItemType\",\n        \"fhir.resources.STU3.claimresponse.ClaimResponseAddItem\",\n    )\n\n    ClaimResponseAddItemDetailType = create_fhir_type(\n        \"ClaimResponseAddItemDetailType\",\n        \"fhir.resources.STU3.claimresponse.ClaimResponseAddItemDetail\",\n    )\n\n    ClaimResponseErrorType = create_fhir_type(\n        \"ClaimResponseErrorType\", \"fhir.resources.STU3.claimresponse.ClaimResponseError\"\n    )\n\n    ClaimResponseInsuranceType = create_fhir_type(\n        \"ClaimResponseInsuranceType\",\n        \"fhir.resources.STU3.claimresponse.ClaimResponseInsurance\",\n    )\n\n    ClaimResponseItemType = create_fhir_type(\n        \"ClaimResponseItemType\", \"fhir.resources.STU3.claimresponse.ClaimResponseItem\"\n    )\n\n    ClaimResponseItemAdjudicationType = create_fhir_type(\n        \"ClaimResponseItemAdjudicationType\",\n        \"fhir.resources.STU3.claimresponse.ClaimResponseItemAdjudication\",\n    )\n\n    ClaimResponseItemDetailType = create_fhir_type(\n        \"ClaimResponseItemDetailType\",\n        \"fhir.resources.STU3.claimresponse.ClaimResponseItemDetail\",\n    )\n\n    ClaimResponseItemDetailSubDetailType = create_fhir_type(\n        \"ClaimResponseItemDetailSubDetailType\",\n        \"fhir.resources.STU3.claimresponse.ClaimResponseItemDetailSubDetail\",\n    )\n\n    ClaimResponsePaymentType = create_fhir_type(\n        \"ClaimResponsePaymentType\",\n        \"fhir.resources.STU3.claimresponse.ClaimResponsePayment\",\n    )\n\n    ClaimResponseProcessNoteType = create_fhir_type(\n        \"ClaimResponseProcessNoteType\",\n        \"fhir.resources.STU3.claimresponse.ClaimResponseProcessNote\",\n    )\n\n    ClinicalImpressionType = create_fhir_type(\n        \"ClinicalImpressionType\",\n        \"fhir.resources.STU3.clinicalimpression.ClinicalImpression\",\n    )\n\n    ClinicalImpressionFindingType = create_fhir_type(\n        \"ClinicalImpressionFindingType\",\n        \"fhir.resources.STU3.clinicalimpression.ClinicalImpressionFinding\",\n    )\n\n    ClinicalImpressionInvestigationType = create_fhir_type(\n        \"ClinicalImpressionInvestigationType\",\n        \"fhir.resources.STU3.clinicalimpression.ClinicalImpressionInvestigation\",\n    )\n\n    CodeSystemType = create_fhir_type(\n        \"CodeSystemType\", \"fhir.resources.STU3.codesystem.CodeSystem\"\n    )\n\n    CodeSystemConceptType = create_fhir_type(\n        \"CodeSystemConceptType\", \"fhir.resources.STU3.codesystem.CodeSystemConcept\"\n    )\n\n    CodeSystemConceptDesignationType = create_fhir_type(\n        \"CodeSystemConceptDesignationType\",\n        \"fhir.resources.STU3.codesystem.CodeSystemConceptDesignation\",\n    )\n\n    CodeSystemConceptPropertyType = create_fhir_type(\n        \"CodeSystemConceptPropertyType\",\n        \"fhir.resources.STU3.codesystem.CodeSystemConceptProperty\",\n    )\n\n    CodeSystemFilterType = create_fhir_type(\n        \"CodeSystemFilterType\", \"fhir.resources.STU3.codesystem.CodeSystemFilter\"\n    )\n\n    CodeSystemPropertyType = create_fhir_type(\n        \"CodeSystemPropertyType\", \"fhir.resources.STU3.codesystem.CodeSystemProperty\"\n    )\n\n    CodeableConceptType = create_fhir_type(\n        \"CodeableConceptType\", \"fhir.resources.STU3.codeableconcept.CodeableConcept\"\n    )\n\n    CodingType = create_fhir_type(\"CodingType\", \"fhir.resources.STU3.coding.Coding\")\n\n    CommunicationType = create_fhir_type(\n        \"CommunicationType\", \"fhir.resources.STU3.communication.Communication\"\n    )\n\n    CommunicationPayloadType = create_fhir_type(\n        \"CommunicationPayloadType\",\n        \"fhir.resources.STU3.communication.CommunicationPayload\",\n    )\n\n    CommunicationRequestType = create_fhir_type(\n        \"CommunicationRequestType\",\n        \"fhir.resources.STU3.communicationrequest.CommunicationRequest\",\n    )\n\n    CommunicationRequestPayloadType = create_fhir_type(\n        \"CommunicationRequestPayloadType\",\n        \"fhir.resources.STU3.communicationrequest.CommunicationRequestPayload\",\n    )\n\n    CommunicationRequestRequesterType = create_fhir_type(\n        \"CommunicationRequestRequesterType\",\n        \"fhir.resources.STU3.communicationrequest.CommunicationRequestRequester\",\n    )\n\n    CompartmentDefinitionType = create_fhir_type(\n        \"CompartmentDefinitionType\",\n        \"fhir.resources.STU3.compartmentdefinition.CompartmentDefinition\",\n    )\n\n    CompartmentDefinitionResourceType = create_fhir_type(\n        \"CompartmentDefinitionResourceType\",\n        \"fhir.resources.STU3.compartmentdefinition.CompartmentDefinitionResource\",\n    )\n\n    CompositionType = create_fhir_type(\n        \"CompositionType\", \"fhir.resources.STU3.composition.Composition\"\n    )\n\n    CompositionAttesterType = create_fhir_type(\n        \"CompositionAttesterType\", \"fhir.resources.STU3.composition.CompositionAttester\"\n    )\n\n    CompositionEventType = create_fhir_type(\n        \"CompositionEventType\", \"fhir.resources.STU3.composition.CompositionEvent\"\n    )\n\n    CompositionRelatesToType = create_fhir_type(\n        \"CompositionRelatesToType\",\n        \"fhir.resources.STU3.composition.CompositionRelatesTo\",\n    )\n\n    CompositionSectionType = create_fhir_type(\n        \"CompositionSectionType\", \"fhir.resources.STU3.composition.CompositionSection\"\n    )\n\n    ConceptMapType = create_fhir_type(\n        \"ConceptMapType\", \"fhir.resources.STU3.conceptmap.ConceptMap\"\n    )\n\n    ConceptMapGroupType = create_fhir_type(\n        \"ConceptMapGroupType\", \"fhir.resources.STU3.conceptmap.ConceptMapGroup\"\n    )\n\n    ConceptMapGroupElementType = create_fhir_type(\n        \"ConceptMapGroupElementType\",\n        \"fhir.resources.STU3.conceptmap.ConceptMapGroupElement\",\n    )\n\n    ConceptMapGroupElementTargetType = create_fhir_type(\n        \"ConceptMapGroupElementTargetType\",\n        \"fhir.resources.STU3.conceptmap.ConceptMapGroupElementTarget\",\n    )\n\n    ConceptMapGroupElementTargetDependsOnType = create_fhir_type(\n        \"ConceptMapGroupElementTargetDependsOnType\",\n        \"fhir.resources.STU3.conceptmap.ConceptMapGroupElementTargetDependsOn\",\n    )\n\n    ConceptMapGroupUnmappedType = create_fhir_type(\n        \"ConceptMapGroupUnmappedType\",\n        \"fhir.resources.STU3.conceptmap.ConceptMapGroupUnmapped\",\n    )\n\n    ConditionType = create_fhir_type(\n        \"ConditionType\", \"fhir.resources.STU3.condition.Condition\"\n    )\n\n    ConditionEvidenceType = create_fhir_type(\n        \"ConditionEvidenceType\", \"fhir.resources.STU3.condition.ConditionEvidence\"\n    )\n\n    ConditionStageType = create_fhir_type(\n        \"ConditionStageType\", \"fhir.resources.STU3.condition.ConditionStage\"\n    )\n\n    ConsentType = create_fhir_type(\"ConsentType\", \"fhir.resources.STU3.consent.Consent\")\n\n    ConsentActorType = create_fhir_type(\n        \"ConsentActorType\", \"fhir.resources.STU3.consent.ConsentActor\"\n    )\n\n    ConsentDataType = create_fhir_type(\n        \"ConsentDataType\", \"fhir.resources.STU3.consent.ConsentData\"\n    )\n\n    ConsentExceptType = create_fhir_type(\n        \"ConsentExceptType\", \"fhir.resources.STU3.consent.ConsentExcept\"\n    )\n\n    ConsentExceptActorType = create_fhir_type(\n        \"ConsentExceptActorType\", \"fhir.resources.STU3.consent.ConsentExceptActor\"\n    )\n\n    ConsentExceptDataType = create_fhir_type(\n        \"ConsentExceptDataType\", \"fhir.resources.STU3.consent.ConsentExceptData\"\n    )\n\n    ConsentPolicyType = create_fhir_type(\n        \"ConsentPolicyType\", \"fhir.resources.STU3.consent.ConsentPolicy\"\n    )\n\n    ContactDetailType = create_fhir_type(\n        \"ContactDetailType\", \"fhir.resources.STU3.contactdetail.ContactDetail\"\n    )\n\n    ContactPointType = create_fhir_type(\n        \"ContactPointType\", \"fhir.resources.STU3.contactpoint.ContactPoint\"\n    )\n\n    ContractType = create_fhir_type(\n        \"ContractType\", \"fhir.resources.STU3.contract.Contract\"\n    )\n\n    ContractAgentType = create_fhir_type(\n        \"ContractAgentType\", \"fhir.resources.STU3.contract.ContractAgent\"\n    )\n\n    ContractFriendlyType = create_fhir_type(\n        \"ContractFriendlyType\", \"fhir.resources.STU3.contract.ContractFriendly\"\n    )\n\n    ContractLegalType = create_fhir_type(\n        \"ContractLegalType\", \"fhir.resources.STU3.contract.ContractLegal\"\n    )\n\n    ContractRuleType = create_fhir_type(\n        \"ContractRuleType\", \"fhir.resources.STU3.contract.ContractRule\"\n    )\n\n    ContractSignerType = create_fhir_type(\n        \"ContractSignerType\", \"fhir.resources.STU3.contract.ContractSigner\"\n    )\n\n    ContractTermType = create_fhir_type(\n        \"ContractTermType\", \"fhir.resources.STU3.contract.ContractTerm\"\n    )\n\n    ContractTermAgentType = create_fhir_type(\n        \"ContractTermAgentType\", \"fhir.resources.STU3.contract.ContractTermAgent\"\n    )\n\n    ContractTermValuedItemType = create_fhir_type(\n        \"ContractTermValuedItemType\",\n        \"fhir.resources.STU3.contract.ContractTermValuedItem\",\n    )\n\n    ContractValuedItemType = create_fhir_type(\n        \"ContractValuedItemType\", \"fhir.resources.STU3.contract.ContractValuedItem\"\n    )\n\n    ContributorType = create_fhir_type(\n        \"ContributorType\", \"fhir.resources.STU3.contributor.Contributor\"\n    )\n\n    CountType = create_fhir_type(\"CountType\", \"fhir.resources.STU3.count.Count\")\n\n    CoverageType = create_fhir_type(\n        \"CoverageType\", \"fhir.resources.STU3.coverage.Coverage\"\n    )\n\n    CoverageGroupingType = create_fhir_type(\n        \"CoverageGroupingType\", \"fhir.resources.STU3.coverage.CoverageGrouping\"\n    )\n\n    DataElementType = create_fhir_type(\n        \"DataElementType\", \"fhir.resources.STU3.dataelement.DataElement\"\n    )\n\n    DataElementMappingType = create_fhir_type(\n        \"DataElementMappingType\", \"fhir.resources.STU3.dataelement.DataElementMapping\"\n    )\n\n    DataRequirementType = create_fhir_type(\n        \"DataRequirementType\", \"fhir.resources.STU3.datarequirement.DataRequirement\"\n    )\n\n    DataRequirementCodeFilterType = create_fhir_type(\n        \"DataRequirementCodeFilterType\",\n        \"fhir.resources.STU3.datarequirement.DataRequirementCodeFilter\",\n    )\n\n    DataRequirementDateFilterType = create_fhir_type(\n        \"DataRequirementDateFilterType\",\n        \"fhir.resources.STU3.datarequirement.DataRequirementDateFilter\",\n    )\n\n    DetectedIssueType = create_fhir_type(\n        \"DetectedIssueType\", \"fhir.resources.STU3.detectedissue.DetectedIssue\"\n    )\n\n    DetectedIssueMitigationType = create_fhir_type(\n        \"DetectedIssueMitigationType\",\n        \"fhir.resources.STU3.detectedissue.DetectedIssueMitigation\",\n    )\n\n    DeviceType = create_fhir_type(\"DeviceType\", \"fhir.resources.STU3.device.Device\")\n\n    DeviceComponentType = create_fhir_type(\n        \"DeviceComponentType\", \"fhir.resources.STU3.devicecomponent.DeviceComponent\"\n    )\n\n    DeviceComponentProductionSpecificationType = create_fhir_type(\n        \"DeviceComponentProductionSpecificationType\",\n        \"fhir.resources.STU3.devicecomponent.DeviceComponentProductionSpecification\",\n    )\n\n    DeviceMetricType = create_fhir_type(\n        \"DeviceMetricType\", \"fhir.resources.STU3.devicemetric.DeviceMetric\"\n    )\n\n    DeviceMetricCalibrationType = create_fhir_type(\n        \"DeviceMetricCalibrationType\",\n        \"fhir.resources.STU3.devicemetric.DeviceMetricCalibration\",\n    )\n\n    DeviceRequestType = create_fhir_type(\n        \"DeviceRequestType\", \"fhir.resources.STU3.devicerequest.DeviceRequest\"\n    )\n\n    DeviceRequestRequesterType = create_fhir_type(\n        \"DeviceRequestRequesterType\",\n        \"fhir.resources.STU3.devicerequest.DeviceRequestRequester\",\n    )\n\n    DeviceUdiType = create_fhir_type(\n        \"DeviceUdiType\", \"fhir.resources.STU3.device.DeviceUdi\"\n    )\n\n    DeviceUseStatementType = create_fhir_type(\n        \"DeviceUseStatementType\",\n        \"fhir.resources.STU3.deviceusestatement.DeviceUseStatement\",\n    )\n\n    DiagnosticReportType = create_fhir_type(\n        \"DiagnosticReportType\", \"fhir.resources.STU3.diagnosticreport.DiagnosticReport\"\n    )\n\n    DiagnosticReportImageType = create_fhir_type(\n        \"DiagnosticReportImageType\",\n        \"fhir.resources.STU3.diagnosticreport.DiagnosticReportImage\",\n    )\n\n    DiagnosticReportPerformerType = create_fhir_type(\n        \"DiagnosticReportPerformerType\",\n        \"fhir.resources.STU3.diagnosticreport.DiagnosticReportPerformer\",\n    )\n\n    DistanceType = create_fhir_type(\n        \"DistanceType\", \"fhir.resources.STU3.distance.Distance\"\n    )\n\n    DocumentManifestType = create_fhir_type(\n        \"DocumentManifestType\", \"fhir.resources.STU3.documentmanifest.DocumentManifest\"\n    )\n\n    DocumentManifestContentType = create_fhir_type(\n        \"DocumentManifestContentType\",\n        \"fhir.resources.STU3.documentmanifest.DocumentManifestContent\",\n    )\n\n    DocumentManifestRelatedType = create_fhir_type(\n        \"DocumentManifestRelatedType\",\n        \"fhir.resources.STU3.documentmanifest.DocumentManifestRelated\",\n    )\n\n    DocumentReferenceType = create_fhir_type(\n        \"DocumentReferenceType\",\n        \"fhir.resources.STU3.documentreference.DocumentReference\",\n    )\n\n    DocumentReferenceContentType = create_fhir_type(\n        \"DocumentReferenceContentType\",\n        \"fhir.resources.STU3.documentreference.DocumentReferenceContent\",\n    )\n\n    DocumentReferenceContextType = create_fhir_type(\n        \"DocumentReferenceContextType\",\n        \"fhir.resources.STU3.documentreference.DocumentReferenceContext\",\n    )\n\n    DocumentReferenceContextRelatedType = create_fhir_type(\n        \"DocumentReferenceContextRelatedType\",\n        \"fhir.resources.STU3.documentreference.DocumentReferenceContextRelated\",\n    )\n\n    DocumentReferenceRelatesToType = create_fhir_type(\n        \"DocumentReferenceRelatesToType\",\n        \"fhir.resources.STU3.documentreference.DocumentReferenceRelatesTo\",\n    )\n\n    DomainResourceType = create_fhir_type(\n        \"DomainResourceType\", \"fhir.resources.STU3.domainresource.DomainResource\"\n    )\n\n    DosageType = create_fhir_type(\"DosageType\", \"fhir.resources.STU3.dosage.Dosage\")\n\n    DurationType = create_fhir_type(\n        \"DurationType\", \"fhir.resources.STU3.duration.Duration\"\n    )\n\n    ElementDefinitionType = create_fhir_type(\n        \"ElementDefinitionType\",\n        \"fhir.resources.STU3.elementdefinition.ElementDefinition\",\n    )\n\n    ElementDefinitionBaseType = create_fhir_type(\n        \"ElementDefinitionBaseType\",\n        \"fhir.resources.STU3.elementdefinition.ElementDefinitionBase\",\n    )\n\n    ElementDefinitionBindingType = create_fhir_type(\n        \"ElementDefinitionBindingType\",\n        \"fhir.resources.STU3.elementdefinition.ElementDefinitionBinding\",\n    )\n\n    ElementDefinitionConstraintType = create_fhir_type(\n        \"ElementDefinitionConstraintType\",\n        \"fhir.resources.STU3.elementdefinition.ElementDefinitionConstraint\",\n    )\n\n    ElementDefinitionExampleType = create_fhir_type(\n        \"ElementDefinitionExampleType\",\n        \"fhir.resources.STU3.elementdefinition.ElementDefinitionExample\",\n    )\n\n    ElementDefinitionMappingType = create_fhir_type(\n        \"ElementDefinitionMappingType\",\n        \"fhir.resources.STU3.elementdefinition.ElementDefinitionMapping\",\n    )\n\n    ElementDefinitionSlicingType = create_fhir_type(\n        \"ElementDefinitionSlicingType\",\n        \"fhir.resources.STU3.elementdefinition.ElementDefinitionSlicing\",\n    )\n\n    ElementDefinitionSlicingDiscriminatorType = create_fhir_type(\n        \"ElementDefinitionSlicingDiscriminatorType\",\n        \"fhir.resources.STU3.elementdefinition.ElementDefinitionSlicingDiscriminator\",\n    )\n\n    ElementDefinitionTypeType = create_fhir_type(\n        \"ElementDefinitionTypeType\",\n        \"fhir.resources.STU3.elementdefinition.ElementDefinitionType\",\n    )\n\n    EligibilityRequestType = create_fhir_type(\n        \"EligibilityRequestType\",\n        \"fhir.resources.STU3.eligibilityrequest.EligibilityRequest\",\n    )\n\n    EligibilityResponseType = create_fhir_type(\n        \"EligibilityResponseType\",\n        \"fhir.resources.STU3.eligibilityresponse.EligibilityResponse\",\n    )\n\n    EligibilityResponseErrorType = create_fhir_type(\n        \"EligibilityResponseErrorType\",\n        \"fhir.resources.STU3.eligibilityresponse.EligibilityResponseError\",\n    )\n\n    EligibilityResponseInsuranceType = create_fhir_type(\n        \"EligibilityResponseInsuranceType\",\n        \"fhir.resources.STU3.eligibilityresponse.EligibilityResponseInsurance\",\n    )\n\n    EligibilityResponseInsuranceBenefitBalanceType = create_fhir_type(\n        \"EligibilityResponseInsuranceBenefitBalanceType\",\n        \"fhir.resources.STU3.eligibilityresponse.EligibilityResponseInsuranceBenefitBalance\",\n    )\n\n    EligibilityResponseInsuranceBenefitBalanceFinancialType = create_fhir_type(\n        \"EligibilityResponseInsuranceBenefitBalanceFinancialType\",\n        \"fhir.resources.STU3.eligibilityresponse.EligibilityResponseInsuranceBenefitBalanceFinancial\",\n    )\n\n    EncounterType = create_fhir_type(\n        \"EncounterType\", \"fhir.resources.STU3.encounter.Encounter\"\n    )\n\n    EncounterClassHistoryType = create_fhir_type(\n        \"EncounterClassHistoryType\",\n        \"fhir.resources.STU3.encounter.EncounterClassHistory\",\n    )\n\n    EncounterDiagnosisType = create_fhir_type(\n        \"EncounterDiagnosisType\", \"fhir.resources.STU3.encounter.EncounterDiagnosis\"\n    )\n\n    EncounterHospitalizationType = create_fhir_type(\n        \"EncounterHospitalizationType\",\n        \"fhir.resources.STU3.encounter.EncounterHospitalization\",\n    )\n\n    EncounterLocationType = create_fhir_type(\n        \"EncounterLocationType\", \"fhir.resources.STU3.encounter.EncounterLocation\"\n    )\n\n    EncounterParticipantType = create_fhir_type(\n        \"EncounterParticipantType\", \"fhir.resources.STU3.encounter.EncounterParticipant\"\n    )\n\n    EncounterStatusHistoryType = create_fhir_type(\n        \"EncounterStatusHistoryType\",\n        \"fhir.resources.STU3.encounter.EncounterStatusHistory\",\n    )\n\n    EndpointType = create_fhir_type(\n        \"EndpointType\", \"fhir.resources.STU3.endpoint.Endpoint\"\n    )\n\n    EnrollmentRequestType = create_fhir_type(\n        \"EnrollmentRequestType\",\n        \"fhir.resources.STU3.enrollmentrequest.EnrollmentRequest\",\n    )\n\n    EnrollmentResponseType = create_fhir_type(\n        \"EnrollmentResponseType\",\n        \"fhir.resources.STU3.enrollmentresponse.EnrollmentResponse\",\n    )\n\n    EpisodeOfCareType = create_fhir_type(\n        \"EpisodeOfCareType\", \"fhir.resources.STU3.episodeofcare.EpisodeOfCare\"\n    )\n\n    EpisodeOfCareDiagnosisType = create_fhir_type(\n        \"EpisodeOfCareDiagnosisType\",\n        \"fhir.resources.STU3.episodeofcare.EpisodeOfCareDiagnosis\",\n    )\n\n    EpisodeOfCareStatusHistoryType = create_fhir_type(\n        \"EpisodeOfCareStatusHistoryType\",\n        \"fhir.resources.STU3.episodeofcare.EpisodeOfCareStatusHistory\",\n    )\n\n    ExpansionProfileType = create_fhir_type(\n        \"ExpansionProfileType\", \"fhir.resources.STU3.expansionprofile.ExpansionProfile\"\n    )\n\n    ExpansionProfileDesignationType = create_fhir_type(\n        \"ExpansionProfileDesignationType\",\n        \"fhir.resources.STU3.expansionprofile.ExpansionProfileDesignation\",\n    )\n\n    ExpansionProfileDesignationExcludeType = create_fhir_type(\n        \"ExpansionProfileDesignationExcludeType\",\n        \"fhir.resources.STU3.expansionprofile.ExpansionProfileDesignationExclude\",\n    )\n\n    ExpansionProfileDesignationExcludeDesignationType = create_fhir_type(\n        \"ExpansionProfileDesignationExcludeDesignationType\",\n        \"fhir.resources.STU3.expansionprofile.ExpansionProfileDesignationExcludeDesignation\",\n    )\n\n    ExpansionProfileDesignationIncludeType = create_fhir_type(\n        \"ExpansionProfileDesignationIncludeType\",\n        \"fhir.resources.STU3.expansionprofile.ExpansionProfileDesignationInclude\",\n    )\n\n    ExpansionProfileDesignationIncludeDesignationType = create_fhir_type(\n        \"ExpansionProfileDesignationIncludeDesignationType\",\n        \"fhir.resources.STU3.expansionprofile.ExpansionProfileDesignationIncludeDesignation\",\n    )\n\n    ExpansionProfileExcludedSystemType = create_fhir_type(\n        \"ExpansionProfileExcludedSystemType\",\n        \"fhir.resources.STU3.expansionprofile.ExpansionProfileExcludedSystem\",\n    )\n\n    ExpansionProfileFixedVersionType = create_fhir_type(\n        \"ExpansionProfileFixedVersionType\",\n        \"fhir.resources.STU3.expansionprofile.ExpansionProfileFixedVersion\",\n    )\n\n    ExplanationOfBenefitType = create_fhir_type(\n        \"ExplanationOfBenefitType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefit\",\n    )\n\n    ExplanationOfBenefitAccidentType = create_fhir_type(\n        \"ExplanationOfBenefitAccidentType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitAccident\",\n    )\n\n    ExplanationOfBenefitAddItemType = create_fhir_type(\n        \"ExplanationOfBenefitAddItemType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitAddItem\",\n    )\n\n    ExplanationOfBenefitAddItemDetailType = create_fhir_type(\n        \"ExplanationOfBenefitAddItemDetailType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitAddItemDetail\",\n    )\n\n    ExplanationOfBenefitBenefitBalanceType = create_fhir_type(\n        \"ExplanationOfBenefitBenefitBalanceType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitBenefitBalance\",\n    )\n\n    ExplanationOfBenefitBenefitBalanceFinancialType = create_fhir_type(\n        \"ExplanationOfBenefitBenefitBalanceFinancialType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitBenefitBalanceFinancial\",\n    )\n\n    ExplanationOfBenefitCareTeamType = create_fhir_type(\n        \"ExplanationOfBenefitCareTeamType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitCareTeam\",\n    )\n\n    ExplanationOfBenefitDiagnosisType = create_fhir_type(\n        \"ExplanationOfBenefitDiagnosisType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitDiagnosis\",\n    )\n\n    ExplanationOfBenefitInformationType = create_fhir_type(\n        \"ExplanationOfBenefitInformationType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitInformation\",\n    )\n\n    ExplanationOfBenefitInsuranceType = create_fhir_type(\n        \"ExplanationOfBenefitInsuranceType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitInsurance\",\n    )\n\n    ExplanationOfBenefitItemType = create_fhir_type(\n        \"ExplanationOfBenefitItemType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitItem\",\n    )\n\n    ExplanationOfBenefitItemAdjudicationType = create_fhir_type(\n        \"ExplanationOfBenefitItemAdjudicationType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitItemAdjudication\",\n    )\n\n    ExplanationOfBenefitItemDetailType = create_fhir_type(\n        \"ExplanationOfBenefitItemDetailType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitItemDetail\",\n    )\n\n    ExplanationOfBenefitItemDetailSubDetailType = create_fhir_type(\n        \"ExplanationOfBenefitItemDetailSubDetailType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail\",\n    )\n\n    ExplanationOfBenefitPayeeType = create_fhir_type(\n        \"ExplanationOfBenefitPayeeType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitPayee\",\n    )\n\n    ExplanationOfBenefitPaymentType = create_fhir_type(\n        \"ExplanationOfBenefitPaymentType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitPayment\",\n    )\n\n    ExplanationOfBenefitProcedureType = create_fhir_type(\n        \"ExplanationOfBenefitProcedureType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitProcedure\",\n    )\n\n    ExplanationOfBenefitProcessNoteType = create_fhir_type(\n        \"ExplanationOfBenefitProcessNoteType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitProcessNote\",\n    )\n\n    ExplanationOfBenefitRelatedType = create_fhir_type(\n        \"ExplanationOfBenefitRelatedType\",\n        \"fhir.resources.STU3.explanationofbenefit.ExplanationOfBenefitRelated\",\n    )\n\n    ExtensionType = create_fhir_type(\n        \"ExtensionType\", \"fhir.resources.STU3.extension.Extension\"\n    )\n\n    FamilyMemberHistoryType = create_fhir_type(\n        \"FamilyMemberHistoryType\",\n        \"fhir.resources.STU3.familymemberhistory.FamilyMemberHistory\",\n    )\n\n    FamilyMemberHistoryConditionType = create_fhir_type(\n        \"FamilyMemberHistoryConditionType\",\n        \"fhir.resources.STU3.familymemberhistory.FamilyMemberHistoryCondition\",\n    )\n\n    FlagType = create_fhir_type(\"FlagType\", \"fhir.resources.STU3.flag.Flag\")\n\n    GoalType = create_fhir_type(\"GoalType\", \"fhir.resources.STU3.goal.Goal\")\n\n    GoalTargetType = create_fhir_type(\n        \"GoalTargetType\", \"fhir.resources.STU3.goal.GoalTarget\"\n    )\n\n    GraphDefinitionType = create_fhir_type(\n        \"GraphDefinitionType\", \"fhir.resources.STU3.graphdefinition.GraphDefinition\"\n    )\n\n    GraphDefinitionLinkType = create_fhir_type(\n        \"GraphDefinitionLinkType\",\n        \"fhir.resources.STU3.graphdefinition.GraphDefinitionLink\",\n    )\n\n    GraphDefinitionLinkTargetType = create_fhir_type(\n        \"GraphDefinitionLinkTargetType\",\n        \"fhir.resources.STU3.graphdefinition.GraphDefinitionLinkTarget\",\n    )\n\n    GraphDefinitionLinkTargetCompartmentType = create_fhir_type(\n        \"GraphDefinitionLinkTargetCompartmentType\",\n        \"fhir.resources.STU3.graphdefinition.GraphDefinitionLinkTargetCompartment\",\n    )\n\n    GroupType = create_fhir_type(\"GroupType\", \"fhir.resources.STU3.group.Group\")\n\n    GroupCharacteristicType = create_fhir_type(\n        \"GroupCharacteristicType\", \"fhir.resources.STU3.group.GroupCharacteristic\"\n    )\n\n    GroupMemberType = create_fhir_type(\n        \"GroupMemberType\", \"fhir.resources.STU3.group.GroupMember\"\n    )\n\n    GuidanceResponseType = create_fhir_type(\n        \"GuidanceResponseType\", \"fhir.resources.STU3.guidanceresponse.GuidanceResponse\"\n    )\n\n    HealthcareServiceType = create_fhir_type(\n        \"HealthcareServiceType\",\n        \"fhir.resources.STU3.healthcareservice.HealthcareService\",\n    )\n\n    HealthcareServiceAvailableTimeType = create_fhir_type(\n        \"HealthcareServiceAvailableTimeType\",\n        \"fhir.resources.STU3.healthcareservice.HealthcareServiceAvailableTime\",\n    )\n\n    HealthcareServiceNotAvailableType = create_fhir_type(\n        \"HealthcareServiceNotAvailableType\",\n        \"fhir.resources.STU3.healthcareservice.HealthcareServiceNotAvailable\",\n    )\n\n    HumanNameType = create_fhir_type(\n        \"HumanNameType\", \"fhir.resources.STU3.humanname.HumanName\"\n    )\n\n    IdentifierType = create_fhir_type(\n        \"IdentifierType\", \"fhir.resources.STU3.identifier.Identifier\"\n    )\n\n    ImagingManifestType = create_fhir_type(\n        \"ImagingManifestType\", \"fhir.resources.STU3.imagingmanifest.ImagingManifest\"\n    )\n\n    ImagingManifestStudyType = create_fhir_type(\n        \"ImagingManifestStudyType\",\n        \"fhir.resources.STU3.imagingmanifest.ImagingManifestStudy\",\n    )\n\n    ImagingManifestStudySeriesType = create_fhir_type(\n        \"ImagingManifestStudySeriesType\",\n        \"fhir.resources.STU3.imagingmanifest.ImagingManifestStudySeries\",\n    )\n\n    ImagingManifestStudySeriesInstanceType = create_fhir_type(\n        \"ImagingManifestStudySeriesInstanceType\",\n        \"fhir.resources.STU3.imagingmanifest.ImagingManifestStudySeriesInstance\",\n    )\n\n    ImagingStudyType = create_fhir_type(\n        \"ImagingStudyType\", \"fhir.resources.STU3.imagingstudy.ImagingStudy\"\n    )\n\n    ImagingStudySeriesType = create_fhir_type(\n        \"ImagingStudySeriesType\", \"fhir.resources.STU3.imagingstudy.ImagingStudySeries\"\n    )\n\n    ImagingStudySeriesInstanceType = create_fhir_type(\n        \"ImagingStudySeriesInstanceType\",\n        \"fhir.resources.STU3.imagingstudy.ImagingStudySeriesInstance\",\n    )\n\n    ImmunizationType = create_fhir_type(\n        \"ImmunizationType\", \"fhir.resources.STU3.immunization.Immunization\"\n    )\n\n    ImmunizationExplanationType = create_fhir_type(\n        \"ImmunizationExplanationType\",\n        \"fhir.resources.STU3.immunization.ImmunizationExplanation\",\n    )\n\n    ImmunizationPractitionerType = create_fhir_type(\n        \"ImmunizationPractitionerType\",\n        \"fhir.resources.STU3.immunization.ImmunizationPractitioner\",\n    )\n\n    ImmunizationReactionType = create_fhir_type(\n        \"ImmunizationReactionType\",\n        \"fhir.resources.STU3.immunization.ImmunizationReaction\",\n    )\n\n    ImmunizationRecommendationType = create_fhir_type(\n        \"ImmunizationRecommendationType\",\n        \"fhir.resources.STU3.immunizationrecommendation.ImmunizationRecommendation\",\n    )\n\n    ImmunizationRecommendationRecommendationType = create_fhir_type(\n        \"ImmunizationRecommendationRecommendationType\",\n        \"fhir.resources.STU3.immunizationrecommendation.ImmunizationRecommendationRecommendation\",\n    )\n\n    ImmunizationRecommendationRecommendationDateCriterionType = create_fhir_type(\n        \"ImmunizationRecommendationRecommendationDateCriterionType\",\n        \"fhir.resources.STU3.immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion\",\n    )\n\n    ImmunizationRecommendationRecommendationProtocolType = create_fhir_type(\n        \"ImmunizationRecommendationRecommendationProtocolType\",\n        \"fhir.resources.STU3.immunizationrecommendation.ImmunizationRecommendationRecommendationProtocol\",\n    )\n\n    ImmunizationVaccinationProtocolType = create_fhir_type(\n        \"ImmunizationVaccinationProtocolType\",\n        \"fhir.resources.STU3.immunization.ImmunizationVaccinationProtocol\",\n    )\n\n    ImplementationGuideType = create_fhir_type(\n        \"ImplementationGuideType\",\n        \"fhir.resources.STU3.implementationguide.ImplementationGuide\",\n    )\n\n    ImplementationGuideDependencyType = create_fhir_type(\n        \"ImplementationGuideDependencyType\",\n        \"fhir.resources.STU3.implementationguide.ImplementationGuideDependency\",\n    )\n\n    ImplementationGuideGlobalType = create_fhir_type(\n        \"ImplementationGuideGlobalType\",\n        \"fhir.resources.STU3.implementationguide.ImplementationGuideGlobal\",\n    )\n\n    ImplementationGuidePackageType = create_fhir_type(\n        \"ImplementationGuidePackageType\",\n        \"fhir.resources.STU3.implementationguide.ImplementationGuidePackage\",\n    )\n\n    ImplementationGuidePackageResourceType = create_fhir_type(\n        \"ImplementationGuidePackageResourceType\",\n        \"fhir.resources.STU3.implementationguide.ImplementationGuidePackageResource\",\n    )\n\n    ImplementationGuidePageType = create_fhir_type(\n        \"ImplementationGuidePageType\",\n        \"fhir.resources.STU3.implementationguide.ImplementationGuidePage\",\n    )\n\n    LibraryType = create_fhir_type(\"LibraryType\", \"fhir.resources.STU3.library.Library\")\n\n    LinkageType = create_fhir_type(\"LinkageType\", \"fhir.resources.STU3.linkage.Linkage\")\n\n    LinkageItemType = create_fhir_type(\n        \"LinkageItemType\", \"fhir.resources.STU3.linkage.LinkageItem\"\n    )\n\n    ListType = create_fhir_type(\"ListType\", \"fhir.resources.STU3.list.List\")\n\n    ListEntryType = create_fhir_type(\n        \"ListEntryType\", \"fhir.resources.STU3.list.ListEntry\"\n    )\n\n    LocationType = create_fhir_type(\n        \"LocationType\", \"fhir.resources.STU3.location.Location\"\n    )\n\n    LocationPositionType = create_fhir_type(\n        \"LocationPositionType\", \"fhir.resources.STU3.location.LocationPosition\"\n    )\n\n    MeasureType = create_fhir_type(\"MeasureType\", \"fhir.resources.STU3.measure.Measure\")\n\n    MeasureGroupType = create_fhir_type(\n        \"MeasureGroupType\", \"fhir.resources.STU3.measure.MeasureGroup\"\n    )\n\n    MeasureGroupPopulationType = create_fhir_type(\n        \"MeasureGroupPopulationType\",\n        \"fhir.resources.STU3.measure.MeasureGroupPopulation\",\n    )\n\n    MeasureGroupStratifierType = create_fhir_type(\n        \"MeasureGroupStratifierType\",\n        \"fhir.resources.STU3.measure.MeasureGroupStratifier\",\n    )\n\n    MeasureReportType = create_fhir_type(\n        \"MeasureReportType\", \"fhir.resources.STU3.measurereport.MeasureReport\"\n    )\n\n    MeasureReportGroupType = create_fhir_type(\n        \"MeasureReportGroupType\", \"fhir.resources.STU3.measurereport.MeasureReportGroup\"\n    )\n\n    MeasureReportGroupPopulationType = create_fhir_type(\n        \"MeasureReportGroupPopulationType\",\n        \"fhir.resources.STU3.measurereport.MeasureReportGroupPopulation\",\n    )\n\n    MeasureReportGroupStratifierType = create_fhir_type(\n        \"MeasureReportGroupStratifierType\",\n        \"fhir.resources.STU3.measurereport.MeasureReportGroupStratifier\",\n    )\n\n    MeasureReportGroupStratifierStratumType = create_fhir_type(\n        \"MeasureReportGroupStratifierStratumType\",\n        \"fhir.resources.STU3.measurereport.MeasureReportGroupStratifierStratum\",\n    )\n\n    MeasureReportGroupStratifierStratumPopulationType = create_fhir_type(\n        \"MeasureReportGroupStratifierStratumPopulationType\",\n        \"fhir.resources.STU3.measurereport.MeasureReportGroupStratifierStratumPopulation\",\n    )\n\n    MeasureSupplementalDataType = create_fhir_type(\n        \"MeasureSupplementalDataType\",\n        \"fhir.resources.STU3.measure.MeasureSupplementalData\",\n    )\n\n    MediaType = create_fhir_type(\"MediaType\", \"fhir.resources.STU3.media.Media\")\n\n    MedicationType = create_fhir_type(\n        \"MedicationType\", \"fhir.resources.STU3.medication.Medication\"\n    )\n\n    MedicationAdministrationType = create_fhir_type(\n        \"MedicationAdministrationType\",\n        \"fhir.resources.STU3.medicationadministration.MedicationAdministration\",\n    )\n\n    MedicationAdministrationDosageType = create_fhir_type(\n        \"MedicationAdministrationDosageType\",\n        \"fhir.resources.STU3.medicationadministration.MedicationAdministrationDosage\",\n    )\n\n    MedicationAdministrationPerformerType = create_fhir_type(\n        \"MedicationAdministrationPerformerType\",\n        \"fhir.resources.STU3.medicationadministration.MedicationAdministrationPerformer\",\n    )\n\n    MedicationDispenseType = create_fhir_type(\n        \"MedicationDispenseType\",\n        \"fhir.resources.STU3.medicationdispense.MedicationDispense\",\n    )\n\n    MedicationDispensePerformerType = create_fhir_type(\n        \"MedicationDispensePerformerType\",\n        \"fhir.resources.STU3.medicationdispense.MedicationDispensePerformer\",\n    )\n\n    MedicationDispenseSubstitutionType = create_fhir_type(\n        \"MedicationDispenseSubstitutionType\",\n        \"fhir.resources.STU3.medicationdispense.MedicationDispenseSubstitution\",\n    )\n\n    MedicationIngredientType = create_fhir_type(\n        \"MedicationIngredientType\",\n        \"fhir.resources.STU3.medication.MedicationIngredient\",\n    )\n\n    MedicationPackageType = create_fhir_type(\n        \"MedicationPackageType\", \"fhir.resources.STU3.medication.MedicationPackage\"\n    )\n\n    MedicationPackageBatchType = create_fhir_type(\n        \"MedicationPackageBatchType\",\n        \"fhir.resources.STU3.medication.MedicationPackageBatch\",\n    )\n\n    MedicationPackageContentType = create_fhir_type(\n        \"MedicationPackageContentType\",\n        \"fhir.resources.STU3.medication.MedicationPackageContent\",\n    )\n\n    MedicationRequestType = create_fhir_type(\n        \"MedicationRequestType\",\n        \"fhir.resources.STU3.medicationrequest.MedicationRequest\",\n    )\n\n    MedicationRequestDispenseRequestType = create_fhir_type(\n        \"MedicationRequestDispenseRequestType\",\n        \"fhir.resources.STU3.medicationrequest.MedicationRequestDispenseRequest\",\n    )\n\n    MedicationRequestRequesterType = create_fhir_type(\n        \"MedicationRequestRequesterType\",\n        \"fhir.resources.STU3.medicationrequest.MedicationRequestRequester\",\n    )\n\n    MedicationRequestSubstitutionType = create_fhir_type(\n        \"MedicationRequestSubstitutionType\",\n        \"fhir.resources.STU3.medicationrequest.MedicationRequestSubstitution\",\n    )\n\n    MedicationStatementType = create_fhir_type(\n        \"MedicationStatementType\",\n        \"fhir.resources.STU3.medicationstatement.MedicationStatement\",\n    )\n\n    MessageDefinitionType = create_fhir_type(\n        \"MessageDefinitionType\",\n        \"fhir.resources.STU3.messagedefinition.MessageDefinition\",\n    )\n\n    MessageDefinitionAllowedResponseType = create_fhir_type(\n        \"MessageDefinitionAllowedResponseType\",\n        \"fhir.resources.STU3.messagedefinition.MessageDefinitionAllowedResponse\",\n    )\n\n    MessageDefinitionFocusType = create_fhir_type(\n        \"MessageDefinitionFocusType\",\n        \"fhir.resources.STU3.messagedefinition.MessageDefinitionFocus\",\n    )\n\n    MessageHeaderType = create_fhir_type(\n        \"MessageHeaderType\", \"fhir.resources.STU3.messageheader.MessageHeader\"\n    )\n\n    MessageHeaderDestinationType = create_fhir_type(\n        \"MessageHeaderDestinationType\",\n        \"fhir.resources.STU3.messageheader.MessageHeaderDestination\",\n    )\n\n    MessageHeaderResponseType = create_fhir_type(\n        \"MessageHeaderResponseType\",\n        \"fhir.resources.STU3.messageheader.MessageHeaderResponse\",\n    )\n\n    MessageHeaderSourceType = create_fhir_type(\n        \"MessageHeaderSourceType\",\n        \"fhir.resources.STU3.messageheader.MessageHeaderSource\",\n    )\n\n    MetaType = create_fhir_type(\"MetaType\", \"fhir.resources.STU3.meta.Meta\")\n\n    MetadataResourceType = create_fhir_type(\n        \"MetadataResourceType\", \"fhir.resources.STU3.metadataresource.MetadataResource\"\n    )\n\n    MoneyType = create_fhir_type(\"MoneyType\", \"fhir.resources.STU3.money.Money\")\n\n    NamingSystemType = create_fhir_type(\n        \"NamingSystemType\", \"fhir.resources.STU3.namingsystem.NamingSystem\"\n    )\n\n    NamingSystemUniqueIdType = create_fhir_type(\n        \"NamingSystemUniqueIdType\",\n        \"fhir.resources.STU3.namingsystem.NamingSystemUniqueId\",\n    )\n\n    NarrativeType = create_fhir_type(\n        \"NarrativeType\", \"fhir.resources.STU3.narrative.Narrative\"\n    )\n\n    NutritionOrderType = create_fhir_type(\n        \"NutritionOrderType\", \"fhir.resources.STU3.nutritionorder.NutritionOrder\"\n    )\n\n    NutritionOrderEnteralFormulaType = create_fhir_type(\n        \"NutritionOrderEnteralFormulaType\",\n        \"fhir.resources.STU3.nutritionorder.NutritionOrderEnteralFormula\",\n    )\n\n    NutritionOrderEnteralFormulaAdministrationType = create_fhir_type(\n        \"NutritionOrderEnteralFormulaAdministrationType\",\n        \"fhir.resources.STU3.nutritionorder.NutritionOrderEnteralFormulaAdministration\",\n    )\n\n    NutritionOrderOralDietType = create_fhir_type(\n        \"NutritionOrderOralDietType\",\n        \"fhir.resources.STU3.nutritionorder.NutritionOrderOralDiet\",\n    )\n\n    NutritionOrderOralDietNutrientType = create_fhir_type(\n        \"NutritionOrderOralDietNutrientType\",\n        \"fhir.resources.STU3.nutritionorder.NutritionOrderOralDietNutrient\",\n    )\n\n    NutritionOrderOralDietTextureType = create_fhir_type(\n        \"NutritionOrderOralDietTextureType\",\n        \"fhir.resources.STU3.nutritionorder.NutritionOrderOralDietTexture\",\n    )\n\n    NutritionOrderSupplementType = create_fhir_type(\n        \"NutritionOrderSupplementType\",\n        \"fhir.resources.STU3.nutritionorder.NutritionOrderSupplement\",\n    )\n\n    ObservationType = create_fhir_type(\n        \"ObservationType\", \"fhir.resources.STU3.observation.Observation\"\n    )\n\n    ObservationComponentType = create_fhir_type(\n        \"ObservationComponentType\",\n        \"fhir.resources.STU3.observation.ObservationComponent\",\n    )\n\n    ObservationReferenceRangeType = create_fhir_type(\n        \"ObservationReferenceRangeType\",\n        \"fhir.resources.STU3.observation.ObservationReferenceRange\",\n    )\n\n    ObservationRelatedType = create_fhir_type(\n        \"ObservationRelatedType\", \"fhir.resources.STU3.observation.ObservationRelated\"\n    )\n\n    OperationDefinitionType = create_fhir_type(\n        \"OperationDefinitionType\",\n        \"fhir.resources.STU3.operationdefinition.OperationDefinition\",\n    )\n\n    OperationDefinitionOverloadType = create_fhir_type(\n        \"OperationDefinitionOverloadType\",\n        \"fhir.resources.STU3.operationdefinition.OperationDefinitionOverload\",\n    )\n\n    OperationDefinitionParameterType = create_fhir_type(\n        \"OperationDefinitionParameterType\",\n        \"fhir.resources.STU3.operationdefinition.OperationDefinitionParameter\",\n    )\n\n    OperationDefinitionParameterBindingType = create_fhir_type(\n        \"OperationDefinitionParameterBindingType\",\n        \"fhir.resources.STU3.operationdefinition.OperationDefinitionParameterBinding\",\n    )\n\n    OperationOutcomeType = create_fhir_type(\n        \"OperationOutcomeType\", \"fhir.resources.STU3.operationoutcome.OperationOutcome\"\n    )\n\n    OperationOutcomeIssueType = create_fhir_type(\n        \"OperationOutcomeIssueType\",\n        \"fhir.resources.STU3.operationoutcome.OperationOutcomeIssue\",\n    )\n\n    OrganizationType = create_fhir_type(\n        \"OrganizationType\", \"fhir.resources.STU3.organization.Organization\"\n    )\n\n    OrganizationContactType = create_fhir_type(\n        \"OrganizationContactType\",\n        \"fhir.resources.STU3.organization.OrganizationContact\",\n    )\n\n    ParameterDefinitionType = create_fhir_type(\n        \"ParameterDefinitionType\",\n        \"fhir.resources.STU3.parameterdefinition.ParameterDefinition\",\n    )\n\n    ParametersType = create_fhir_type(\n        \"ParametersType\", \"fhir.resources.STU3.parameters.Parameters\"\n    )\n\n    ParametersParameterType = create_fhir_type(\n        \"ParametersParameterType\", \"fhir.resources.STU3.parameters.ParametersParameter\"\n    )\n\n    PatientType = create_fhir_type(\"PatientType\", \"fhir.resources.STU3.patient.Patient\")\n\n    PatientAnimalType = create_fhir_type(\n        \"PatientAnimalType\", \"fhir.resources.STU3.patient.PatientAnimal\"\n    )\n\n    PatientCommunicationType = create_fhir_type(\n        \"PatientCommunicationType\", \"fhir.resources.STU3.patient.PatientCommunication\"\n    )\n\n    PatientContactType = create_fhir_type(\n        \"PatientContactType\", \"fhir.resources.STU3.patient.PatientContact\"\n    )\n\n    PatientLinkType = create_fhir_type(\n        \"PatientLinkType\", \"fhir.resources.STU3.patient.PatientLink\"\n    )\n\n    PaymentNoticeType = create_fhir_type(\n        \"PaymentNoticeType\", \"fhir.resources.STU3.paymentnotice.PaymentNotice\"\n    )\n\n    PaymentReconciliationType = create_fhir_type(\n        \"PaymentReconciliationType\",\n        \"fhir.resources.STU3.paymentreconciliation.PaymentReconciliation\",\n    )\n\n    PaymentReconciliationDetailType = create_fhir_type(\n        \"PaymentReconciliationDetailType\",\n        \"fhir.resources.STU3.paymentreconciliation.PaymentReconciliationDetail\",\n    )\n\n    PaymentReconciliationProcessNoteType = create_fhir_type(\n        \"PaymentReconciliationProcessNoteType\",\n        \"fhir.resources.STU3.paymentreconciliation.PaymentReconciliationProcessNote\",\n    )\n\n    PeriodType = create_fhir_type(\"PeriodType\", \"fhir.resources.STU3.period.Period\")\n\n    PersonType = create_fhir_type(\"PersonType\", \"fhir.resources.STU3.person.Person\")\n\n    PersonLinkType = create_fhir_type(\n        \"PersonLinkType\", \"fhir.resources.STU3.person.PersonLink\"\n    )\n\n    PlanDefinitionType = create_fhir_type(\n        \"PlanDefinitionType\", \"fhir.resources.STU3.plandefinition.PlanDefinition\"\n    )\n\n    PlanDefinitionActionType = create_fhir_type(\n        \"PlanDefinitionActionType\",\n        \"fhir.resources.STU3.plandefinition.PlanDefinitionAction\",\n    )\n\n    PlanDefinitionActionConditionType = create_fhir_type(\n        \"PlanDefinitionActionConditionType\",\n        \"fhir.resources.STU3.plandefinition.PlanDefinitionActionCondition\",\n    )\n\n    PlanDefinitionActionDynamicValueType = create_fhir_type(\n        \"PlanDefinitionActionDynamicValueType\",\n        \"fhir.resources.STU3.plandefinition.PlanDefinitionActionDynamicValue\",\n    )\n\n    PlanDefinitionActionParticipantType = create_fhir_type(\n        \"PlanDefinitionActionParticipantType\",\n        \"fhir.resources.STU3.plandefinition.PlanDefinitionActionParticipant\",\n    )\n\n    PlanDefinitionActionRelatedActionType = create_fhir_type(\n        \"PlanDefinitionActionRelatedActionType\",\n        \"fhir.resources.STU3.plandefinition.PlanDefinitionActionRelatedAction\",\n    )\n\n    PlanDefinitionGoalType = create_fhir_type(\n        \"PlanDefinitionGoalType\",\n        \"fhir.resources.STU3.plandefinition.PlanDefinitionGoal\",\n    )\n\n    PlanDefinitionGoalTargetType = create_fhir_type(\n        \"PlanDefinitionGoalTargetType\",\n        \"fhir.resources.STU3.plandefinition.PlanDefinitionGoalTarget\",\n    )\n\n    PractitionerType = create_fhir_type(\n        \"PractitionerType\", \"fhir.resources.STU3.practitioner.Practitioner\"\n    )\n\n    PractitionerQualificationType = create_fhir_type(\n        \"PractitionerQualificationType\",\n        \"fhir.resources.STU3.practitioner.PractitionerQualification\",\n    )\n\n    PractitionerRoleType = create_fhir_type(\n        \"PractitionerRoleType\", \"fhir.resources.STU3.practitionerrole.PractitionerRole\"\n    )\n\n    PractitionerRoleAvailableTimeType = create_fhir_type(\n        \"PractitionerRoleAvailableTimeType\",\n        \"fhir.resources.STU3.practitionerrole.PractitionerRoleAvailableTime\",\n    )\n\n    PractitionerRoleNotAvailableType = create_fhir_type(\n        \"PractitionerRoleNotAvailableType\",\n        \"fhir.resources.STU3.practitionerrole.PractitionerRoleNotAvailable\",\n    )\n\n    ProcedureType = create_fhir_type(\n        \"ProcedureType\", \"fhir.resources.STU3.procedure.Procedure\"\n    )\n\n    ProcedureFocalDeviceType = create_fhir_type(\n        \"ProcedureFocalDeviceType\", \"fhir.resources.STU3.procedure.ProcedureFocalDevice\"\n    )\n\n    ProcedurePerformerType = create_fhir_type(\n        \"ProcedurePerformerType\", \"fhir.resources.STU3.procedure.ProcedurePerformer\"\n    )\n\n    ProcedureRequestType = create_fhir_type(\n        \"ProcedureRequestType\", \"fhir.resources.STU3.procedurerequest.ProcedureRequest\"\n    )\n\n    ProcedureRequestRequesterType = create_fhir_type(\n        \"ProcedureRequestRequesterType\",\n        \"fhir.resources.STU3.procedurerequest.ProcedureRequestRequester\",\n    )\n\n    ProcessRequestType = create_fhir_type(\n        \"ProcessRequestType\", \"fhir.resources.STU3.processrequest.ProcessRequest\"\n    )\n\n    ProcessRequestItemType = create_fhir_type(\n        \"ProcessRequestItemType\",\n        \"fhir.resources.STU3.processrequest.ProcessRequestItem\",\n    )\n\n    ProcessResponseType = create_fhir_type(\n        \"ProcessResponseType\", \"fhir.resources.STU3.processresponse.ProcessResponse\"\n    )\n\n    ProcessResponseProcessNoteType = create_fhir_type(\n        \"ProcessResponseProcessNoteType\",\n        \"fhir.resources.STU3.processresponse.ProcessResponseProcessNote\",\n    )\n\n    ProvenanceType = create_fhir_type(\n        \"ProvenanceType\", \"fhir.resources.STU3.provenance.Provenance\"\n    )\n\n    ProvenanceAgentType = create_fhir_type(\n        \"ProvenanceAgentType\", \"fhir.resources.STU3.provenance.ProvenanceAgent\"\n    )\n\n    ProvenanceEntityType = create_fhir_type(\n        \"ProvenanceEntityType\", \"fhir.resources.STU3.provenance.ProvenanceEntity\"\n    )\n\n    QuantityType = create_fhir_type(\n        \"QuantityType\", \"fhir.resources.STU3.quantity.Quantity\"\n    )\n\n    QuestionnaireType = create_fhir_type(\n        \"QuestionnaireType\", \"fhir.resources.STU3.questionnaire.Questionnaire\"\n    )\n\n    QuestionnaireItemType = create_fhir_type(\n        \"QuestionnaireItemType\", \"fhir.resources.STU3.questionnaire.QuestionnaireItem\"\n    )\n\n    QuestionnaireItemEnableWhenType = create_fhir_type(\n        \"QuestionnaireItemEnableWhenType\",\n        \"fhir.resources.STU3.questionnaire.QuestionnaireItemEnableWhen\",\n    )\n\n    QuestionnaireItemOptionType = create_fhir_type(\n        \"QuestionnaireItemOptionType\",\n        \"fhir.resources.STU3.questionnaire.QuestionnaireItemOption\",\n    )\n\n    QuestionnaireResponseType = create_fhir_type(\n        \"QuestionnaireResponseType\",\n        \"fhir.resources.STU3.questionnaireresponse.QuestionnaireResponse\",\n    )\n\n    QuestionnaireResponseItemType = create_fhir_type(\n        \"QuestionnaireResponseItemType\",\n        \"fhir.resources.STU3.questionnaireresponse.QuestionnaireResponseItem\",\n    )\n\n    QuestionnaireResponseItemAnswerType = create_fhir_type(\n        \"QuestionnaireResponseItemAnswerType\",\n        \"fhir.resources.STU3.questionnaireresponse.QuestionnaireResponseItemAnswer\",\n    )\n\n    RangeType = create_fhir_type(\"RangeType\", \"fhir.resources.STU3.range.Range\")\n\n    RatioType = create_fhir_type(\"RatioType\", \"fhir.resources.STU3.ratio.Ratio\")\n\n    ReferenceType = create_fhir_type(\n        \"ReferenceType\", \"fhir.resources.STU3.reference.Reference\"\n    )\n\n    ReferralRequestType = create_fhir_type(\n        \"ReferralRequestType\", \"fhir.resources.STU3.referralrequest.ReferralRequest\"\n    )\n\n    ReferralRequestRequesterType = create_fhir_type(\n        \"ReferralRequestRequesterType\",\n        \"fhir.resources.STU3.referralrequest.ReferralRequestRequester\",\n    )\n\n    RelatedArtifactType = create_fhir_type(\n        \"RelatedArtifactType\", \"fhir.resources.STU3.relatedartifact.RelatedArtifact\"\n    )\n\n    RelatedPersonType = create_fhir_type(\n        \"RelatedPersonType\", \"fhir.resources.STU3.relatedperson.RelatedPerson\"\n    )\n\n    RequestGroupType = create_fhir_type(\n        \"RequestGroupType\", \"fhir.resources.STU3.requestgroup.RequestGroup\"\n    )\n\n    RequestGroupActionType = create_fhir_type(\n        \"RequestGroupActionType\", \"fhir.resources.STU3.requestgroup.RequestGroupAction\"\n    )\n\n    RequestGroupActionConditionType = create_fhir_type(\n        \"RequestGroupActionConditionType\",\n        \"fhir.resources.STU3.requestgroup.RequestGroupActionCondition\",\n    )\n\n    RequestGroupActionRelatedActionType = create_fhir_type(\n        \"RequestGroupActionRelatedActionType\",\n        \"fhir.resources.STU3.requestgroup.RequestGroupActionRelatedAction\",\n    )\n\n    ResearchStudyType = create_fhir_type(\n        \"ResearchStudyType\", \"fhir.resources.STU3.researchstudy.ResearchStudy\"\n    )\n\n    ResearchStudyArmType = create_fhir_type(\n        \"ResearchStudyArmType\", \"fhir.resources.STU3.researchstudy.ResearchStudyArm\"\n    )\n\n    ResearchSubjectType = create_fhir_type(\n        \"ResearchSubjectType\", \"fhir.resources.STU3.researchsubject.ResearchSubject\"\n    )\n\n    RiskAssessmentType = create_fhir_type(\n        \"RiskAssessmentType\", \"fhir.resources.STU3.riskassessment.RiskAssessment\"\n    )\n\n    RiskAssessmentPredictionType = create_fhir_type(\n        \"RiskAssessmentPredictionType\",\n        \"fhir.resources.STU3.riskassessment.RiskAssessmentPrediction\",\n    )\n\n    SampledDataType = create_fhir_type(\n        \"SampledDataType\", \"fhir.resources.STU3.sampleddata.SampledData\"\n    )\n\n    ScheduleType = create_fhir_type(\n        \"ScheduleType\", \"fhir.resources.STU3.schedule.Schedule\"\n    )\n\n    SearchParameterType = create_fhir_type(\n        \"SearchParameterType\", \"fhir.resources.STU3.searchparameter.SearchParameter\"\n    )\n\n    SearchParameterComponentType = create_fhir_type(\n        \"SearchParameterComponentType\",\n        \"fhir.resources.STU3.searchparameter.SearchParameterComponent\",\n    )\n\n    SequenceType = create_fhir_type(\n        \"SequenceType\", \"fhir.resources.STU3.sequence.Sequence\"\n    )\n\n    SequenceQualityType = create_fhir_type(\n        \"SequenceQualityType\", \"fhir.resources.STU3.sequence.SequenceQuality\"\n    )\n\n    SequenceReferenceSeqType = create_fhir_type(\n        \"SequenceReferenceSeqType\", \"fhir.resources.STU3.sequence.SequenceReferenceSeq\"\n    )\n\n    SequenceRepositoryType = create_fhir_type(\n        \"SequenceRepositoryType\", \"fhir.resources.STU3.sequence.SequenceRepository\"\n    )\n\n    SequenceVariantType = create_fhir_type(\n        \"SequenceVariantType\", \"fhir.resources.STU3.sequence.SequenceVariant\"\n    )\n\n    ServiceDefinitionType = create_fhir_type(\n        \"ServiceDefinitionType\",\n        \"fhir.resources.STU3.servicedefinition.ServiceDefinition\",\n    )\n\n    SignatureType = create_fhir_type(\n        \"SignatureType\", \"fhir.resources.STU3.signature.Signature\"\n    )\n\n    SlotType = create_fhir_type(\"SlotType\", \"fhir.resources.STU3.slot.Slot\")\n\n    SpecimenType = create_fhir_type(\n        \"SpecimenType\", \"fhir.resources.STU3.specimen.Specimen\"\n    )\n\n    SpecimenCollectionType = create_fhir_type(\n        \"SpecimenCollectionType\", \"fhir.resources.STU3.specimen.SpecimenCollection\"\n    )\n\n    SpecimenContainerType = create_fhir_type(\n        \"SpecimenContainerType\", \"fhir.resources.STU3.specimen.SpecimenContainer\"\n    )\n\n    SpecimenProcessingType = create_fhir_type(\n        \"SpecimenProcessingType\", \"fhir.resources.STU3.specimen.SpecimenProcessing\"\n    )\n\n    StructureDefinitionType = create_fhir_type(\n        \"StructureDefinitionType\",\n        \"fhir.resources.STU3.structuredefinition.StructureDefinition\",\n    )\n\n    StructureDefinitionDifferentialType = create_fhir_type(\n        \"StructureDefinitionDifferentialType\",\n        \"fhir.resources.STU3.structuredefinition.StructureDefinitionDifferential\",\n    )\n\n    StructureDefinitionMappingType = create_fhir_type(\n        \"StructureDefinitionMappingType\",\n        \"fhir.resources.STU3.structuredefinition.StructureDefinitionMapping\",\n    )\n\n    StructureDefinitionSnapshotType = create_fhir_type(\n        \"StructureDefinitionSnapshotType\",\n        \"fhir.resources.STU3.structuredefinition.StructureDefinitionSnapshot\",\n    )\n\n    StructureMapType = create_fhir_type(\n        \"StructureMapType\", \"fhir.resources.STU3.structuremap.StructureMap\"\n    )\n\n    StructureMapGroupType = create_fhir_type(\n        \"StructureMapGroupType\", \"fhir.resources.STU3.structuremap.StructureMapGroup\"\n    )\n\n    StructureMapGroupInputType = create_fhir_type(\n        \"StructureMapGroupInputType\",\n        \"fhir.resources.STU3.structuremap.StructureMapGroupInput\",\n    )\n\n    StructureMapGroupRuleType = create_fhir_type(\n        \"StructureMapGroupRuleType\",\n        \"fhir.resources.STU3.structuremap.StructureMapGroupRule\",\n    )\n\n    StructureMapGroupRuleDependentType = create_fhir_type(\n        \"StructureMapGroupRuleDependentType\",\n        \"fhir.resources.STU3.structuremap.StructureMapGroupRuleDependent\",\n    )\n\n    StructureMapGroupRuleSourceType = create_fhir_type(\n        \"StructureMapGroupRuleSourceType\",\n        \"fhir.resources.STU3.structuremap.StructureMapGroupRuleSource\",\n    )\n\n    StructureMapGroupRuleTargetType = create_fhir_type(\n        \"StructureMapGroupRuleTargetType\",\n        \"fhir.resources.STU3.structuremap.StructureMapGroupRuleTarget\",\n    )\n\n    StructureMapGroupRuleTargetParameterType = create_fhir_type(\n        \"StructureMapGroupRuleTargetParameterType\",\n        \"fhir.resources.STU3.structuremap.StructureMapGroupRuleTargetParameter\",\n    )\n\n    StructureMapStructureType = create_fhir_type(\n        \"StructureMapStructureType\",\n        \"fhir.resources.STU3.structuremap.StructureMapStructure\",\n    )\n\n    SubscriptionType = create_fhir_type(\n        \"SubscriptionType\", \"fhir.resources.STU3.subscription.Subscription\"\n    )\n\n    SubscriptionChannelType = create_fhir_type(\n        \"SubscriptionChannelType\",\n        \"fhir.resources.STU3.subscription.SubscriptionChannel\",\n    )\n\n    SubstanceType = create_fhir_type(\n        \"SubstanceType\", \"fhir.resources.STU3.substance.Substance\"\n    )\n\n    SubstanceIngredientType = create_fhir_type(\n        \"SubstanceIngredientType\", \"fhir.resources.STU3.substance.SubstanceIngredient\"\n    )\n\n    SubstanceInstanceType = create_fhir_type(\n        \"SubstanceInstanceType\", \"fhir.resources.STU3.substance.SubstanceInstance\"\n    )\n\n    SupplyDeliveryType = create_fhir_type(\n        \"SupplyDeliveryType\", \"fhir.resources.STU3.supplydelivery.SupplyDelivery\"\n    )\n\n    SupplyDeliverySuppliedItemType = create_fhir_type(\n        \"SupplyDeliverySuppliedItemType\",\n        \"fhir.resources.STU3.supplydelivery.SupplyDeliverySuppliedItem\",\n    )\n\n    SupplyRequestType = create_fhir_type(\n        \"SupplyRequestType\", \"fhir.resources.STU3.supplyrequest.SupplyRequest\"\n    )\n\n    SupplyRequestOrderedItemType = create_fhir_type(\n        \"SupplyRequestOrderedItemType\",\n        \"fhir.resources.STU3.supplyrequest.SupplyRequestOrderedItem\",\n    )\n\n    SupplyRequestRequesterType = create_fhir_type(\n        \"SupplyRequestRequesterType\",\n        \"fhir.resources.STU3.supplyrequest.SupplyRequestRequester\",\n    )\n\n    TaskType = create_fhir_type(\"TaskType\", \"fhir.resources.STU3.task.Task\")\n\n    TaskInputType = create_fhir_type(\n        \"TaskInputType\", \"fhir.resources.STU3.task.TaskInput\"\n    )\n\n    TaskOutputType = create_fhir_type(\n        \"TaskOutputType\", \"fhir.resources.STU3.task.TaskOutput\"\n    )\n\n    TaskRequesterType = create_fhir_type(\n        \"TaskRequesterType\", \"fhir.resources.STU3.task.TaskRequester\"\n    )\n\n    TaskRestrictionType = create_fhir_type(\n        \"TaskRestrictionType\", \"fhir.resources.STU3.task.TaskRestriction\"\n    )\n\n    TestReportType = create_fhir_type(\n        \"TestReportType\", \"fhir.resources.STU3.testreport.TestReport\"\n    )\n\n    TestReportParticipantType = create_fhir_type(\n        \"TestReportParticipantType\",\n        \"fhir.resources.STU3.testreport.TestReportParticipant\",\n    )\n\n    TestReportSetupType = create_fhir_type(\n        \"TestReportSetupType\", \"fhir.resources.STU3.testreport.TestReportSetup\"\n    )\n\n    TestReportSetupActionType = create_fhir_type(\n        \"TestReportSetupActionType\",\n        \"fhir.resources.STU3.testreport.TestReportSetupAction\",\n    )\n\n    TestReportSetupActionAssertType = create_fhir_type(\n        \"TestReportSetupActionAssertType\",\n        \"fhir.resources.STU3.testreport.TestReportSetupActionAssert\",\n    )\n\n    TestReportSetupActionOperationType = create_fhir_type(\n        \"TestReportSetupActionOperationType\",\n        \"fhir.resources.STU3.testreport.TestReportSetupActionOperation\",\n    )\n\n    TestReportTeardownType = create_fhir_type(\n        \"TestReportTeardownType\", \"fhir.resources.STU3.testreport.TestReportTeardown\"\n    )\n\n    TestReportTeardownActionType = create_fhir_type(\n        \"TestReportTeardownActionType\",\n        \"fhir.resources.STU3.testreport.TestReportTeardownAction\",\n    )\n\n    TestReportTestType = create_fhir_type(\n        \"TestReportTestType\", \"fhir.resources.STU3.testreport.TestReportTest\"\n    )\n\n    TestReportTestActionType = create_fhir_type(\n        \"TestReportTestActionType\",\n        \"fhir.resources.STU3.testreport.TestReportTestAction\",\n    )\n\n    TestScriptType = create_fhir_type(\n        \"TestScriptType\", \"fhir.resources.STU3.testscript.TestScript\"\n    )\n\n    TestScriptDestinationType = create_fhir_type(\n        \"TestScriptDestinationType\",\n        \"fhir.resources.STU3.testscript.TestScriptDestination\",\n    )\n\n    TestScriptFixtureType = create_fhir_type(\n        \"TestScriptFixtureType\", \"fhir.resources.STU3.testscript.TestScriptFixture\"\n    )\n\n    TestScriptMetadataType = create_fhir_type(\n        \"TestScriptMetadataType\", \"fhir.resources.STU3.testscript.TestScriptMetadata\"\n    )\n\n    TestScriptMetadataCapabilityType = create_fhir_type(\n        \"TestScriptMetadataCapabilityType\",\n        \"fhir.resources.STU3.testscript.TestScriptMetadataCapability\",\n    )\n\n    TestScriptMetadataLinkType = create_fhir_type(\n        \"TestScriptMetadataLinkType\",\n        \"fhir.resources.STU3.testscript.TestScriptMetadataLink\",\n    )\n\n    TestScriptOriginType = create_fhir_type(\n        \"TestScriptOriginType\", \"fhir.resources.STU3.testscript.TestScriptOrigin\"\n    )\n\n    TestScriptRuleType = create_fhir_type(\n        \"TestScriptRuleType\", \"fhir.resources.STU3.testscript.TestScriptRule\"\n    )\n\n    TestScriptRuleParamType = create_fhir_type(\n        \"TestScriptRuleParamType\", \"fhir.resources.STU3.testscript.TestScriptRuleParam\"\n    )\n\n    TestScriptRulesetType = create_fhir_type(\n        \"TestScriptRulesetType\", \"fhir.resources.STU3.testscript.TestScriptRuleset\"\n    )\n\n    TestScriptRulesetRuleType = create_fhir_type(\n        \"TestScriptRulesetRuleType\",\n        \"fhir.resources.STU3.testscript.TestScriptRulesetRule\",\n    )\n\n    TestScriptRulesetRuleParamType = create_fhir_type(\n        \"TestScriptRulesetRuleParamType\",\n        \"fhir.resources.STU3.testscript.TestScriptRulesetRuleParam\",\n    )\n\n    TestScriptSetupType = create_fhir_type(\n        \"TestScriptSetupType\", \"fhir.resources.STU3.testscript.TestScriptSetup\"\n    )\n\n    TestScriptSetupActionType = create_fhir_type(\n        \"TestScriptSetupActionType\",\n        \"fhir.resources.STU3.testscript.TestScriptSetupAction\",\n    )\n\n    TestScriptSetupActionAssertType = create_fhir_type(\n        \"TestScriptSetupActionAssertType\",\n        \"fhir.resources.STU3.testscript.TestScriptSetupActionAssert\",\n    )\n\n    TestScriptSetupActionAssertRuleType = create_fhir_type(\n        \"TestScriptSetupActionAssertRuleType\",\n        \"fhir.resources.STU3.testscript.TestScriptSetupActionAssertRule\",\n    )\n\n    TestScriptSetupActionAssertRuleParamType = create_fhir_type(\n        \"TestScriptSetupActionAssertRuleParamType\",\n        \"fhir.resources.STU3.testscript.TestScriptSetupActionAssertRuleParam\",\n    )\n\n    TestScriptSetupActionAssertRulesetType = create_fhir_type(\n        \"TestScriptSetupActionAssertRulesetType\",\n        \"fhir.resources.STU3.testscript.TestScriptSetupActionAssertRuleset\",\n    )\n\n    TestScriptSetupActionAssertRulesetRuleType = create_fhir_type(\n        \"TestScriptSetupActionAssertRulesetRuleType\",\n        \"fhir.resources.STU3.testscript.TestScriptSetupActionAssertRulesetRule\",\n    )\n\n    TestScriptSetupActionAssertRulesetRuleParamType = create_fhir_type(\n        \"TestScriptSetupActionAssertRulesetRuleParamType\",\n        \"fhir.resources.STU3.testscript.TestScriptSetupActionAssertRulesetRuleParam\",\n    )\n\n    TestScriptSetupActionOperationType = create_fhir_type(\n        \"TestScriptSetupActionOperationType\",\n        \"fhir.resources.STU3.testscript.TestScriptSetupActionOperation\",\n    )\n\n    TestScriptSetupActionOperationRequestHeaderType = create_fhir_type(\n        \"TestScriptSetupActionOperationRequestHeaderType\",\n        \"fhir.resources.STU3.testscript.TestScriptSetupActionOperationRequestHeader\",\n    )\n\n    TestScriptTeardownType = create_fhir_type(\n        \"TestScriptTeardownType\", \"fhir.resources.STU3.testscript.TestScriptTeardown\"\n    )\n\n    TestScriptTeardownActionType = create_fhir_type(\n        \"TestScriptTeardownActionType\",\n        \"fhir.resources.STU3.testscript.TestScriptTeardownAction\",\n    )\n\n    TestScriptTestType = create_fhir_type(\n        \"TestScriptTestType\", \"fhir.resources.STU3.testscript.TestScriptTest\"\n    )\n\n    TestScriptTestActionType = create_fhir_type(\n        \"TestScriptTestActionType\",\n        \"fhir.resources.STU3.testscript.TestScriptTestAction\",\n    )\n\n    TestScriptVariableType = create_fhir_type(\n        \"TestScriptVariableType\", \"fhir.resources.STU3.testscript.TestScriptVariable\"\n    )\n\n    TimingType = create_fhir_type(\"TimingType\", \"fhir.resources.STU3.timing.Timing\")\n\n    TimingRepeatType = create_fhir_type(\n        \"TimingRepeatType\", \"fhir.resources.STU3.timing.TimingRepeat\"\n    )\n\n    TriggerDefinitionType = create_fhir_type(\n        \"TriggerDefinitionType\",\n        \"fhir.resources.STU3.triggerdefinition.TriggerDefinition\",\n    )\n\n    UsageContextType = create_fhir_type(\n        \"UsageContextType\", \"fhir.resources.STU3.usagecontext.UsageContext\"\n    )\n\n    ValueSetType = create_fhir_type(\n        \"ValueSetType\", \"fhir.resources.STU3.valueset.ValueSet\"\n    )\n\n    ValueSetComposeType = create_fhir_type(\n        \"ValueSetComposeType\", \"fhir.resources.STU3.valueset.ValueSetCompose\"\n    )\n\n    ValueSetComposeIncludeType = create_fhir_type(\n        \"ValueSetComposeIncludeType\",\n        \"fhir.resources.STU3.valueset.ValueSetComposeInclude\",\n    )\n\n    ValueSetComposeIncludeConceptType = create_fhir_type(\n        \"ValueSetComposeIncludeConceptType\",\n        \"fhir.resources.STU3.valueset.ValueSetComposeIncludeConcept\",\n    )\n\n    ValueSetComposeIncludeConceptDesignationType = create_fhir_type(\n        \"ValueSetComposeIncludeConceptDesignationType\",\n        \"fhir.resources.STU3.valueset.ValueSetComposeIncludeConceptDesignation\",\n    )\n\n    ValueSetComposeIncludeFilterType = create_fhir_type(\n        \"ValueSetComposeIncludeFilterType\",\n        \"fhir.resources.STU3.valueset.ValueSetComposeIncludeFilter\",\n    )\n\n    ValueSetExpansionType = create_fhir_type(\n        \"ValueSetExpansionType\", \"fhir.resources.STU3.valueset.ValueSetExpansion\"\n    )\n\n    ValueSetExpansionContainsType = create_fhir_type(\n        \"ValueSetExpansionContainsType\",\n        \"fhir.resources.STU3.valueset.ValueSetExpansionContains\",\n    )\n\n    ValueSetExpansionParameterType = create_fhir_type(\n        \"ValueSetExpansionParameterType\",\n        \"fhir.resources.STU3.valueset.ValueSetExpansionParameter\",\n    )\n\n    VisionPrescriptionType = create_fhir_type(\n        \"VisionPrescriptionType\",\n        \"fhir.resources.STU3.visionprescription.VisionPrescription\",\n    )\n\n    VisionPrescriptionDispenseType = create_fhir_type(\n        \"VisionPrescriptionDispenseType\",\n        \"fhir.resources.STU3.visionprescription.VisionPrescriptionDispense\",\n    )\n\n__all__ = [\n    \"BooleanType\",\n    \"StringType\",\n    \"Base64BinaryType\",\n    \"CodeType\",\n    \"IdType\",\n    \"IntegerType\",\n    \"Integer64Type\",\n    \"DecimalType\",\n    \"UnsignedIntType\",\n    \"PositiveIntType\",\n    \"CanonicalType\",\n    \"UriType\",\n    \"OidType\",\n    \"UuidType\",\n    \"UrlType\",\n    \"MarkdownType\",\n    \"XhtmlType\",\n    \"DateType\",\n    \"DateTimeType\",\n    \"InstantType\",\n    \"TimeType\",\n    \"FHIRPrimitiveExtensionType\",\n    \"AccountType\",\n    \"AccountCoverageType\",\n    \"AccountGuarantorType\",\n    \"ActivityDefinitionType\",\n    \"ActivityDefinitionDynamicValueType\",\n    \"ActivityDefinitionParticipantType\",\n    \"AddressType\",\n    \"AdverseEventType\",\n    \"AdverseEventSuspectEntityType\",\n    \"AgeType\",\n    \"AllergyIntoleranceType\",\n    \"AllergyIntoleranceReactionType\",\n    \"AnnotationType\",\n    \"AppointmentType\",\n    \"AppointmentParticipantType\",\n    \"AppointmentResponseType\",\n    \"AttachmentType\",\n    \"AuditEventType\",\n    \"AuditEventAgentType\",\n    \"AuditEventAgentNetworkType\",\n    \"AuditEventEntityType\",\n    \"AuditEventEntityDetailType\",\n    \"AuditEventSourceType\",\n    \"BackboneElementType\",\n    \"BasicType\",\n    \"BinaryType\",\n    \"BodySiteType\",\n    \"BundleType\",\n    \"BundleEntryType\",\n    \"BundleEntryRequestType\",\n    \"BundleEntryResponseType\",\n    \"BundleEntrySearchType\",\n    \"BundleLinkType\",\n    \"CapabilityStatementType\",\n    \"CapabilityStatementDocumentType\",\n    \"CapabilityStatementImplementationType\",\n    \"CapabilityStatementMessagingType\",\n    \"CapabilityStatementMessagingEndpointType\",\n    \"CapabilityStatementMessagingEventType\",\n    \"CapabilityStatementMessagingSupportedMessageType\",\n    \"CapabilityStatementRestType\",\n    \"CapabilityStatementRestInteractionType\",\n    \"CapabilityStatementRestOperationType\",\n    \"CapabilityStatementRestResourceType\",\n    \"CapabilityStatementRestResourceInteractionType\",\n    \"CapabilityStatementRestResourceSearchParamType\",\n    \"CapabilityStatementRestSecurityType\",\n    \"CapabilityStatementRestSecurityCertificateType\",\n    \"CapabilityStatementSoftwareType\",\n    \"CarePlanType\",\n    \"CarePlanActivityType\",\n    \"CarePlanActivityDetailType\",\n    \"CareTeamType\",\n    \"CareTeamParticipantType\",\n    \"ChargeItemType\",\n    \"ChargeItemParticipantType\",\n    \"ClaimType\",\n    \"ClaimAccidentType\",\n    \"ClaimCareTeamType\",\n    \"ClaimDiagnosisType\",\n    \"ClaimInformationType\",\n    \"ClaimInsuranceType\",\n    \"ClaimItemType\",\n    \"ClaimItemDetailType\",\n    \"ClaimItemDetailSubDetailType\",\n    \"ClaimPayeeType\",\n    \"ClaimProcedureType\",\n    \"ClaimRelatedType\",\n    \"ClaimResponseType\",\n    \"ClaimResponseAddItemType\",\n    \"ClaimResponseAddItemDetailType\",\n    \"ClaimResponseErrorType\",\n    \"ClaimResponseInsuranceType\",\n    \"ClaimResponseItemType\",\n    \"ClaimResponseItemAdjudicationType\",\n    \"ClaimResponseItemDetailType\",\n    \"ClaimResponseItemDetailSubDetailType\",\n    \"ClaimResponsePaymentType\",\n    \"ClaimResponseProcessNoteType\",\n    \"ClinicalImpressionType\",\n    \"ClinicalImpressionFindingType\",\n    \"ClinicalImpressionInvestigationType\",\n    \"CodeSystemType\",\n    \"CodeSystemConceptType\",\n    \"CodeSystemConceptDesignationType\",\n    \"CodeSystemConceptPropertyType\",\n    \"CodeSystemFilterType\",\n    \"CodeSystemPropertyType\",\n    \"CodeableConceptType\",\n    \"CodingType\",\n    \"CommunicationType\",\n    \"CommunicationPayloadType\",\n    \"CommunicationRequestType\",\n    \"CommunicationRequestPayloadType\",\n    \"CommunicationRequestRequesterType\",\n    \"CompartmentDefinitionType\",\n    \"CompartmentDefinitionResourceType\",\n    \"CompositionType\",\n    \"CompositionAttesterType\",\n    \"CompositionEventType\",\n    \"CompositionRelatesToType\",\n    \"CompositionSectionType\",\n    \"ConceptMapType\",\n    \"ConceptMapGroupType\",\n    \"ConceptMapGroupElementType\",\n    \"ConceptMapGroupElementTargetType\",\n    \"ConceptMapGroupElementTargetDependsOnType\",\n    \"ConceptMapGroupUnmappedType\",\n    \"ConditionType\",\n    \"ConditionEvidenceType\",\n    \"ConditionStageType\",\n    \"ConsentType\",\n    \"ConsentActorType\",\n    \"ConsentDataType\",\n    \"ConsentExceptType\",\n    \"ConsentExceptActorType\",\n    \"ConsentExceptDataType\",\n    \"ConsentPolicyType\",\n    \"ContactDetailType\",\n    \"ContactPointType\",\n    \"ContractType\",\n    \"ContractAgentType\",\n    \"ContractFriendlyType\",\n    \"ContractLegalType\",\n    \"ContractRuleType\",\n    \"ContractSignerType\",\n    \"ContractTermType\",\n    \"ContractTermAgentType\",\n    \"ContractTermValuedItemType\",\n    \"ContractValuedItemType\",\n    \"ContributorType\",\n    \"CountType\",\n    \"CoverageType\",\n    \"CoverageGroupingType\",\n    \"DataElementType\",\n    \"DataElementMappingType\",\n    \"DataRequirementType\",\n    \"DataRequirementCodeFilterType\",\n    \"DataRequirementDateFilterType\",\n    \"DetectedIssueType\",\n    \"DetectedIssueMitigationType\",\n    \"DeviceType\",\n    \"DeviceComponentType\",\n    \"DeviceComponentProductionSpecificationType\",\n    \"DeviceMetricType\",\n    \"DeviceMetricCalibrationType\",\n    \"DeviceRequestType\",\n    \"DeviceRequestRequesterType\",\n    \"DeviceUdiType\",\n    \"DeviceUseStatementType\",\n    \"DiagnosticReportType\",\n    \"DiagnosticReportImageType\",\n    \"DiagnosticReportPerformerType\",\n    \"DistanceType\",\n    \"DocumentManifestType\",\n    \"DocumentManifestContentType\",\n    \"DocumentManifestRelatedType\",\n    \"DocumentReferenceType\",\n    \"DocumentReferenceContentType\",\n    \"DocumentReferenceContextType\",\n    \"DocumentReferenceContextRelatedType\",\n    \"DocumentReferenceRelatesToType\",\n    \"DomainResourceType\",\n    \"DosageType\",\n    \"DurationType\",\n    \"ElementType\",\n    \"ElementDefinitionType\",\n    \"ElementDefinitionBaseType\",\n    \"ElementDefinitionBindingType\",\n    \"ElementDefinitionConstraintType\",\n    \"ElementDefinitionExampleType\",\n    \"ElementDefinitionMappingType\",\n    \"ElementDefinitionSlicingType\",\n    \"ElementDefinitionSlicingDiscriminatorType\",\n    \"ElementDefinitionTypeType\",\n    \"EligibilityRequestType\",\n    \"EligibilityResponseType\",\n    \"EligibilityResponseErrorType\",\n    \"EligibilityResponseInsuranceType\",\n    \"EligibilityResponseInsuranceBenefitBalanceType\",\n    \"EligibilityResponseInsuranceBenefitBalanceFinancialType\",\n    \"EncounterType\",\n    \"EncounterClassHistoryType\",\n    \"EncounterDiagnosisType\",\n    \"EncounterHospitalizationType\",\n    \"EncounterLocationType\",\n    \"EncounterParticipantType\",\n    \"EncounterStatusHistoryType\",\n    \"EndpointType\",\n    \"EnrollmentRequestType\",\n    \"EnrollmentResponseType\",\n    \"EpisodeOfCareType\",\n    \"EpisodeOfCareDiagnosisType\",\n    \"EpisodeOfCareStatusHistoryType\",\n    \"ExpansionProfileType\",\n    \"ExpansionProfileDesignationType\",\n    \"ExpansionProfileDesignationExcludeType\",\n    \"ExpansionProfileDesignationExcludeDesignationType\",\n    \"ExpansionProfileDesignationIncludeType\",\n    \"ExpansionProfileDesignationIncludeDesignationType\",\n    \"ExpansionProfileExcludedSystemType\",\n    \"ExpansionProfileFixedVersionType\",\n    \"ExplanationOfBenefitType\",\n    \"ExplanationOfBenefitAccidentType\",\n    \"ExplanationOfBenefitAddItemType\",\n    \"ExplanationOfBenefitAddItemDetailType\",\n    \"ExplanationOfBenefitBenefitBalanceType\",\n    \"ExplanationOfBenefitBenefitBalanceFinancialType\",\n    \"ExplanationOfBenefitCareTeamType\",\n    \"ExplanationOfBenefitDiagnosisType\",\n    \"ExplanationOfBenefitInformationType\",\n    \"ExplanationOfBenefitInsuranceType\",\n    \"ExplanationOfBenefitItemType\",\n    \"ExplanationOfBenefitItemAdjudicationType\",\n    \"ExplanationOfBenefitItemDetailType\",\n    \"ExplanationOfBenefitItemDetailSubDetailType\",\n    \"ExplanationOfBenefitPayeeType\",\n    \"ExplanationOfBenefitPaymentType\",\n    \"ExplanationOfBenefitProcedureType\",\n    \"ExplanationOfBenefitProcessNoteType\",\n    \"ExplanationOfBenefitRelatedType\",\n    \"ExtensionType\",\n    \"FamilyMemberHistoryType\",\n    \"FamilyMemberHistoryConditionType\",\n    \"FlagType\",\n    \"GoalType\",\n    \"GoalTargetType\",\n    \"GraphDefinitionType\",\n    \"GraphDefinitionLinkType\",\n    \"GraphDefinitionLinkTargetType\",\n    \"GraphDefinitionLinkTargetCompartmentType\",\n    \"GroupType\",\n    \"GroupCharacteristicType\",\n    \"GroupMemberType\",\n    \"GuidanceResponseType\",\n    \"HealthcareServiceType\",\n    \"HealthcareServiceAvailableTimeType\",\n    \"HealthcareServiceNotAvailableType\",\n    \"HumanNameType\",\n    \"IdentifierType\",\n    \"ImagingManifestType\",\n    \"ImagingManifestStudyType\",\n    \"ImagingManifestStudySeriesType\",\n    \"ImagingManifestStudySeriesInstanceType\",\n    \"ImagingStudyType\",\n    \"ImagingStudySeriesType\",\n    \"ImagingStudySeriesInstanceType\",\n    \"ImmunizationType\",\n    \"ImmunizationExplanationType\",\n    \"ImmunizationPractitionerType\",\n    \"ImmunizationReactionType\",\n    \"ImmunizationRecommendationType\",\n    \"ImmunizationRecommendationRecommendationType\",\n    \"ImmunizationRecommendationRecommendationDateCriterionType\",\n    \"ImmunizationRecommendationRecommendationProtocolType\",\n    \"ImmunizationVaccinationProtocolType\",\n    \"ImplementationGuideType\",\n    \"ImplementationGuideDependencyType\",\n    \"ImplementationGuideGlobalType\",\n    \"ImplementationGuidePackageType\",\n    \"ImplementationGuidePackageResourceType\",\n    \"ImplementationGuidePageType\",\n    \"LibraryType\",\n    \"LinkageType\",\n    \"LinkageItemType\",\n    \"ListType\",\n    \"ListEntryType\",\n    \"LocationType\",\n    \"LocationPositionType\",\n    \"MeasureType\",\n    \"MeasureGroupType\",\n    \"MeasureGroupPopulationType\",\n    \"MeasureGroupStratifierType\",\n    \"MeasureReportType\",\n    \"MeasureReportGroupType\",\n    \"MeasureReportGroupPopulationType\",\n    \"MeasureReportGroupStratifierType\",\n    \"MeasureReportGroupStratifierStratumType\",\n    \"MeasureReportGroupStratifierStratumPopulationType\",\n    \"MeasureSupplementalDataType\",\n    \"MediaType\",\n    \"MedicationType\",\n    \"MedicationAdministrationType\",\n    \"MedicationAdministrationDosageType\",\n    \"MedicationAdministrationPerformerType\",\n    \"MedicationDispenseType\",\n    \"MedicationDispensePerformerType\",\n    \"MedicationDispenseSubstitutionType\",\n    \"MedicationIngredientType\",\n    \"MedicationPackageType\",\n    \"MedicationPackageBatchType\",\n    \"MedicationPackageContentType\",\n    \"MedicationRequestType\",\n    \"MedicationRequestDispenseRequestType\",\n    \"MedicationRequestRequesterType\",\n    \"MedicationRequestSubstitutionType\",\n    \"MedicationStatementType\",\n    \"MessageDefinitionType\",\n    \"MessageDefinitionAllowedResponseType\",\n    \"MessageDefinitionFocusType\",\n    \"MessageHeaderType\",\n    \"MessageHeaderDestinationType\",\n    \"MessageHeaderResponseType\",\n    \"MessageHeaderSourceType\",\n    \"MetaType\",\n    \"MetadataResourceType\",\n    \"MoneyType\",\n    \"NamingSystemType\",\n    \"NamingSystemUniqueIdType\",\n    \"NarrativeType\",\n    \"NutritionOrderType\",\n    \"NutritionOrderEnteralFormulaType\",\n    \"NutritionOrderEnteralFormulaAdministrationType\",\n    \"NutritionOrderOralDietType\",\n    \"NutritionOrderOralDietNutrientType\",\n    \"NutritionOrderOralDietTextureType\",\n    \"NutritionOrderSupplementType\",\n    \"ObservationType\",\n    \"ObservationComponentType\",\n    \"ObservationReferenceRangeType\",\n    \"ObservationRelatedType\",\n    \"OperationDefinitionType\",\n    \"OperationDefinitionOverloadType\",\n    \"OperationDefinitionParameterType\",\n    \"OperationDefinitionParameterBindingType\",\n    \"OperationOutcomeType\",\n    \"OperationOutcomeIssueType\",\n    \"OrganizationType\",\n    \"OrganizationContactType\",\n    \"ParameterDefinitionType\",\n    \"ParametersType\",\n    \"ParametersParameterType\",\n    \"PatientType\",\n    \"PatientAnimalType\",\n    \"PatientCommunicationType\",\n    \"PatientContactType\",\n    \"PatientLinkType\",\n    \"PaymentNoticeType\",\n    \"PaymentReconciliationType\",\n    \"PaymentReconciliationDetailType\",\n    \"PaymentReconciliationProcessNoteType\",\n    \"PeriodType\",\n    \"PersonType\",\n    \"PersonLinkType\",\n    \"PlanDefinitionType\",\n    \"PlanDefinitionActionType\",\n    \"PlanDefinitionActionConditionType\",\n    \"PlanDefinitionActionDynamicValueType\",\n    \"PlanDefinitionActionParticipantType\",\n    \"PlanDefinitionActionRelatedActionType\",\n    \"PlanDefinitionGoalType\",\n    \"PlanDefinitionGoalTargetType\",\n    \"PractitionerType\",\n    \"PractitionerQualificationType\",\n    \"PractitionerRoleType\",\n    \"PractitionerRoleAvailableTimeType\",\n    \"PractitionerRoleNotAvailableType\",\n    \"ProcedureType\",\n    \"ProcedureFocalDeviceType\",\n    \"ProcedurePerformerType\",\n    \"ProcedureRequestType\",\n    \"ProcedureRequestRequesterType\",\n    \"ProcessRequestType\",\n    \"ProcessRequestItemType\",\n    \"ProcessResponseType\",\n    \"ProcessResponseProcessNoteType\",\n    \"ProvenanceType\",\n    \"ProvenanceAgentType\",\n    \"ProvenanceEntityType\",\n    \"QuantityType\",\n    \"QuestionnaireType\",\n    \"QuestionnaireItemType\",\n    \"QuestionnaireItemEnableWhenType\",\n    \"QuestionnaireItemOptionType\",\n    \"QuestionnaireResponseType\",\n    \"QuestionnaireResponseItemType\",\n    \"QuestionnaireResponseItemAnswerType\",\n    \"RangeType\",\n    \"RatioType\",\n    \"ReferenceType\",\n    \"ReferralRequestType\",\n    \"ReferralRequestRequesterType\",\n    \"RelatedArtifactType\",\n    \"RelatedPersonType\",\n    \"RequestGroupType\",\n    \"RequestGroupActionType\",\n    \"RequestGroupActionConditionType\",\n    \"RequestGroupActionRelatedActionType\",\n    \"ResearchStudyType\",\n    \"ResearchStudyArmType\",\n    \"ResearchSubjectType\",\n    \"ResourceType\",\n    \"RiskAssessmentType\",\n    \"RiskAssessmentPredictionType\",\n    \"SampledDataType\",\n    \"ScheduleType\",\n    \"SearchParameterType\",\n    \"SearchParameterComponentType\",\n    \"SequenceType\",\n    \"SequenceQualityType\",\n    \"SequenceReferenceSeqType\",\n    \"SequenceRepositoryType\",\n    \"SequenceVariantType\",\n    \"ServiceDefinitionType\",\n    \"SignatureType\",\n    \"SlotType\",\n    \"SpecimenType\",\n    \"SpecimenCollectionType\",\n    \"SpecimenContainerType\",\n    \"SpecimenProcessingType\",\n    \"StructureDefinitionType\",\n    \"StructureDefinitionDifferentialType\",\n    \"StructureDefinitionMappingType\",\n    \"StructureDefinitionSnapshotType\",\n    \"StructureMapType\",\n    \"StructureMapGroupType\",\n    \"StructureMapGroupInputType\",\n    \"StructureMapGroupRuleType\",\n    \"StructureMapGroupRuleDependentType\",\n    \"StructureMapGroupRuleSourceType\",\n    \"StructureMapGroupRuleTargetType\",\n    \"StructureMapGroupRuleTargetParameterType\",\n    \"StructureMapStructureType\",\n    \"SubscriptionType\",\n    \"SubscriptionChannelType\",\n    \"SubstanceType\",\n    \"SubstanceIngredientType\",\n    \"SubstanceInstanceType\",\n    \"SupplyDeliveryType\",\n    \"SupplyDeliverySuppliedItemType\",\n    \"SupplyRequestType\",\n    \"SupplyRequestOrderedItemType\",\n    \"SupplyRequestRequesterType\",\n    \"TaskType\",\n    \"TaskInputType\",\n    \"TaskOutputType\",\n    \"TaskRequesterType\",\n    \"TaskRestrictionType\",\n    \"TestReportType\",\n    \"TestReportParticipantType\",\n    \"TestReportSetupType\",\n    \"TestReportSetupActionType\",\n    \"TestReportSetupActionAssertType\",\n    \"TestReportSetupActionOperationType\",\n    \"TestReportTeardownType\",\n    \"TestReportTeardownActionType\",\n    \"TestReportTestType\",\n    \"TestReportTestActionType\",\n    \"TestScriptType\",\n    \"TestScriptDestinationType\",\n    \"TestScriptFixtureType\",\n    \"TestScriptMetadataType\",\n    \"TestScriptMetadataCapabilityType\",\n    \"TestScriptMetadataLinkType\",\n    \"TestScriptOriginType\",\n    \"TestScriptRuleType\",\n    \"TestScriptRuleParamType\",\n    \"TestScriptRulesetType\",\n    \"TestScriptRulesetRuleType\",\n    \"TestScriptRulesetRuleParamType\",\n    \"TestScriptSetupType\",\n    \"TestScriptSetupActionType\",\n    \"TestScriptSetupActionAssertType\",\n    \"TestScriptSetupActionAssertRuleType\",\n    \"TestScriptSetupActionAssertRuleParamType\",\n    \"TestScriptSetupActionAssertRulesetType\",\n    \"TestScriptSetupActionAssertRulesetRuleType\",\n    \"TestScriptSetupActionAssertRulesetRuleParamType\",\n    \"TestScriptSetupActionOperationType\",\n    \"TestScriptSetupActionOperationRequestHeaderType\",\n    \"TestScriptTeardownType\",\n    \"TestScriptTeardownActionType\",\n    \"TestScriptTestType\",\n    \"TestScriptTestActionType\",\n    \"TestScriptVariableType\",\n    \"TimingType\",\n    \"TimingRepeatType\",\n    \"TriggerDefinitionType\",\n    \"UsageContextType\",\n    \"ValueSetType\",\n    \"ValueSetComposeType\",\n    \"ValueSetComposeIncludeType\",\n    \"ValueSetComposeIncludeConceptType\",\n    \"ValueSetComposeIncludeConceptDesignationType\",\n    \"ValueSetComposeIncludeFilterType\",\n    \"ValueSetExpansionType\",\n    \"ValueSetExpansionContainsType\",\n    \"ValueSetExpansionParameterType\",\n    \"VisionPrescriptionType\",\n    \"VisionPrescriptionDispenseType\",\n]\n"
  },
  {
    "path": "fhir/resources/STU3/flag.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Flag\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Flag(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Key information to flag to healthcare providers.\n    Prospective warnings of potential issues when providing care to the\n    patient.\n    \"\"\"\n\n    __resource_type__ = \"Flag\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Flag creator\",\n        description=\"The person, organization or device that created the flag.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n            ],\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Clinical, administrative, etc.\",\n        description=(\n            \"Allows an flag to be divided into different categories like clinical, \"\n            \"administrative etc. Intended to be used as a means of filtering which \"\n            \"flags are displayed to particular user or in a given context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Coded or textual message to display to user\",\n        description=(\n            \"The coded value or textual component of the flag to display to the \"\n            \"user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Alert relevant during encounter\",\n        description=\"This alert is only relevant during the encounter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Identifier assigned to the flag for external use (outside the FHIR \"\n            \"environment).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when flag is active\",\n        description=(\n            \"The period of time from the activation of the flag to inactivation of \"\n            \"the flag. If the flag is active, the end of the period should be \"\n            \"unspecified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=\"Supports basic workflow.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who/What is flag about?\",\n        description=(\n            \"The patient, location, group , organization , or practitioner, etc. \"\n            \"this is about record this flag is associated with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Location\",\n                \"Group\",\n                \"Organization\",\n                \"Practitioner\",\n                \"PlanDefinition\",\n                \"Medication\",\n                \"Procedure\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Flag`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"period\",\n            \"encounter\",\n            \"author\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Flag`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"period\",\n            \"encounter\",\n            \"author\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/goal.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Goal\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Goal(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes the intended objective(s) for a patient, group or organization.\n    Describes the intended objective(s) for a patient, group or organization\n    care, for example, weight loss, restoring an activity of daily living,\n    obtaining herd immunity via immunization, meeting a process improvement\n    objective, etc.\n    \"\"\"\n\n    __resource_type__ = \"Goal\"\n\n    addresses: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"addresses\",\n        title=\"Issues addressed by this goal\",\n        description=(\n            \"The identified conditions and other health record elements that are \"\n            \"intended to be addressed by the goal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"MedicationStatement\",\n                \"NutritionOrder\",\n                \"ProcedureRequest\",\n                \"RiskAssessment\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"E.g. Treatment, dietary, behavioral, etc.\",\n        description=\"Indicates a category the goal falls within.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"description\",\n        title=\"Code or text describing goal\",\n        description=(\n            \"Human-readable and/or coded description of a specific desired \"\n            'objective of care, such as \"control blood pressure\" or \"negotiate an '\n            'obstacle course\" or \"dance with child at wedding\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    expressedBy: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"expressedBy\",\n        title=\"Who's responsible for creating Goal?\",\n        description=\"Indicates whose goal this is - patient goal, practitioner goal, etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\", \"RelatedPerson\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this goal\",\n        description=(\n            \"This records identifiers associated with this care plan that are \"\n            \"defined by business processes and/or used to refer to it when a direct\"\n            \" URL reference to the resource itself is not appropriate (e.g. in CDA \"\n            \"documents, or in written / printed documentation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the goal\",\n        description=\"Any comments related to the goal.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcomeCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"outcomeCode\",\n        title=\"What result was achieved regarding the goal?\",\n        description=(\n            \"Identifies the change (or lack of change) at the point when the status\"\n            \" of the goal is assessed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcomeReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"outcomeReference\",\n        title=\"Observation that resulted from goal\",\n        description=\"Details of what's changed (or not changed).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"high-priority | medium-priority | low-priority\",\n        description=(\n            \"Identifies the mutually agreed level of importance associated with \"\n            \"reaching/sustaining the goal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    startCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"startCodeableConcept\",\n        title=\"When goal pursuit begins\",\n        description=\"The date or event after which the goal should begin being pursued.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e start[x]\n            \"one_of_many\": \"start\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    startDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"startDate\",\n        title=\"When goal pursuit begins\",\n        description=\"The date or event after which the goal should begin being pursued.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e start[x]\n            \"one_of_many\": \"start\",\n            \"one_of_many_required\": False,\n        },\n    )\n    startDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_startDate\", title=\"Extension field for ``startDate``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"proposed | accepted | planned | in-progress | on-target | ahead-of-\"\n            \"target | behind-target | sustaining | achieved | on-hold | cancelled |\"\n            \" entered-in-error | rejected\"\n        ),\n        description=(\n            \"Indicates whether the goal has been reached and is still considered \"\n            \"relevant.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposed\",\n                \"accepted\",\n                \"planned\",\n                \"in-progress\",\n                \"on-target\",\n                \"ahead-of-target\",\n                \"behind-target\",\n                \"sustaining\",\n                \"achieved\",\n                \"on-hold\",\n                \"cancelled\",\n                \"entered-in-error\",\n                \"rejected\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"When goal status took effect\",\n        description=(\n            \"Identifies when the current status.  I.e. When initially created, when\"\n            \" achieved, when cancelled, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    statusReason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current status.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    statusReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_statusReason\",\n        title=\"Extension field for ``statusReason``.\",\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who this goal is intended for\",\n        description=(\n            \"Identifies the patient, group or organization for whom the goal is \"\n            \"being established.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Organization\"],\n        },\n    )\n\n    target: fhirtypes.GoalTargetType | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Target outcome for the goal\",\n        description=\"Indicates what should be done by when.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Goal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"priority\",\n            \"description\",\n            \"subject\",\n            \"startDate\",\n            \"startCodeableConcept\",\n            \"target\",\n            \"statusDate\",\n            \"statusReason\",\n            \"expressedBy\",\n            \"addresses\",\n            \"note\",\n            \"outcomeCode\",\n            \"outcomeReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Goal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"category\",\n            \"priority\",\n            \"description\",\n            \"subject\",\n            \"startDate\",\n            \"startCodeableConcept\",\n            \"statusDate\",\n            \"expressedBy\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"start\": [\"startCodeableConcept\", \"startDate\"]}\n        return one_of_many_fields\n\n\nclass GoalTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Target outcome for the goal.\n    Indicates what should be done by when.\n    \"\"\"\n\n    __resource_type__ = \"GoalTarget\"\n\n    detailCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"detailCodeableConcept\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"detailQuantity\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"detailRange\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    dueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"dueDate\",\n        title=\"Reach goal on or before\",\n        description=(\n            \"Indicates either the date or the duration after start by which the \"\n            \"goal should be met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e due[x]\n            \"one_of_many\": \"due\",\n            \"one_of_many_required\": False,\n        },\n    )\n    dueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dueDate\", title=\"Extension field for ``dueDate``.\"\n    )\n\n    dueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"dueDuration\",\n        title=\"Reach goal on or before\",\n        description=(\n            \"Indicates either the date or the duration after start by which the \"\n            \"goal should be met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e due[x]\n            \"one_of_many\": \"due\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    measure: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"measure\",\n        title=\"The parameter whose value is being tracked\",\n        description=(\n            \"The parameter whose value is being tracked, e.g. body weight, blood \"\n            \"pressure, or hemoglobin A1c level.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GoalTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"measure\",\n            \"detailQuantity\",\n            \"detailRange\",\n            \"detailCodeableConcept\",\n            \"dueDate\",\n            \"dueDuration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GoalTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"measure\",\n            \"detailQuantity\",\n            \"detailRange\",\n            \"detailCodeableConcept\",\n            \"dueDate\",\n            \"dueDuration\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"detail\": [\"detailCodeableConcept\", \"detailQuantity\", \"detailRange\"],\n            \"due\": [\"dueDate\", \"dueDuration\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/graphdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/GraphDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass GraphDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of an graph of resources.\n    A formal computable definition of a graph of resources - that is, a\n    coherent set of resources that form a graph by following references. The\n    Graph Definition resource defines a set and makes rules about the set.\n    \"\"\"\n\n    __resource_type__ = \"GraphDefinition\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the graph definition was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the graph definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the graph definition\",\n        description=(\n            \"A free text natural language description of the graph definition from \"\n            \"a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this graph definition is authored for\"\n            \" testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for graph definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the graph definition is intended\"\n            \" to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.GraphDefinitionLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links this graph makes rules about\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this graph definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the graph definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    profile: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile on base resource\",\n        description=\"The profile that describes the use of the base resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the graph \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this graph definition is defined\",\n        description=(\n            \"Explaination of why this graph definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    start: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Type of resource at which the graph starts\",\n        description=\"The type of FHIR resource at which instances of this graph start.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this graph definition. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this graph definition (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this graph definition when it\"\n            \" is referenced in a specification, model, design or an instance. This \"\n            \"SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at\"\n            \" which this graph definition is (or will be) published. The URL SHOULD\"\n            \" include the major version of the graph definition. For more \"\n            \"information see [Technical and Business \"\n            \"Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate graph definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the graph definition\",\n        description=(\n            \"The identifier that is used to identify this version of the graph \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the graph definition \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GraphDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"start\",\n            \"profile\",\n            \"link\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GraphDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"name\", \"name__ext\"),\n            (\"start\", \"start__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass GraphDefinitionLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links this graph makes rules about.\n    \"\"\"\n\n    __resource_type__ = \"GraphDefinitionLink\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Why this link is specified\",\n        description=(\n            \"Information about why this link is of interest in this graph \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum occurrences for this link\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum occurrences for this link\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path in the resource that contains the link\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    sliceName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sliceName\",\n        title=\"Which slice (if profiled)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sliceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sliceName\", title=\"Extension field for ``sliceName``.\"\n    )\n\n    target: typing.List[fhirtypes.GraphDefinitionLinkTargetType] = Field(\n        default=...,\n        alias=\"target\",\n        title=\"Potential target for the link\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GraphDefinitionLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"path\",\n            \"sliceName\",\n            \"min\",\n            \"max\",\n            \"description\",\n            \"target\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GraphDefinitionLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"path\", \"path__ext\")]\n        return required_fields\n\n\nclass GraphDefinitionLinkTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Potential target for the link.\n    \"\"\"\n\n    __resource_type__ = \"GraphDefinitionLinkTarget\"\n\n    compartment: typing.List[\n        fhirtypes.GraphDefinitionLinkTargetCompartmentType\n    ] | None = Field(\n        default=None,\n        alias=\"compartment\",\n        title=\"Compartment Consistency Rules\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.GraphDefinitionLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Additional links from target resource\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    profile: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile for the target resource\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of resource this link refers to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GraphDefinitionLinkTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"profile\",\n            \"compartment\",\n            \"link\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GraphDefinitionLinkTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass GraphDefinitionLinkTargetCompartment(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Compartment Consistency Rules.\n    \"\"\"\n\n    __resource_type__ = \"GraphDefinitionLinkTargetCompartment\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Identifies the compartment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Documentation for FHIRPath expression\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Custom rule, as a FHIRPath expression\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    rule: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"identical | matching | different | custom\",\n        description=\"identical | matching | different | no-rule | custom.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"identical\", \"matching\", \"different\", \"custom\"],\n        },\n    )\n    rule__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rule\", title=\"Extension field for ``rule``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GraphDefinitionLinkTargetCompartment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"rule\",\n            \"expression\",\n            \"description\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GraphDefinitionLinkTargetCompartment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"rule\", \"rule__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/group.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Group\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Group(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Group of multiple entities.\n    Represents a defined collection of entities that may be discussed or acted\n    upon collectively but which are not expected to act collectively and are\n    not formally or legally recognized; i.e. a collection of entities that\n    isn't an Organization.\n    \"\"\"\n\n    __resource_type__ = \"Group\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this group's record is in active use\",\n        description=(\n            \"Indicates whether the record for the group is available for use or is \"\n            \"merely being retained for historical purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    actual: bool | None = Field(\n        default=None,\n        alias=\"actual\",\n        title=\"Descriptive or actual\",\n        description=(\n            \"If true, indicates that the resource refers to a specific group of \"\n            \"real individuals.  If false, the group defines a set of intended \"\n            \"individuals.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actual\", title=\"Extension field for ``actual``.\"\n    )\n\n    characteristic: typing.List[fhirtypes.GroupCharacteristicType] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"Trait of group members\",\n        description=\"Identifies the traits shared by members of the group.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Kind of Group members\",\n        description=(\n            'Provides a specific type of resource the group includes; e.g. \"cow\", '\n            '\"syringe\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique id\",\n        description=\"A unique business identifier for this group.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    member: typing.List[fhirtypes.GroupMemberType] | None = Field(\n        default=None,\n        alias=\"member\",\n        title=\"Who or what is in group\",\n        description=\"Identifies the resource instances that are members of the group.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Label for Group\",\n        description=(\n            \"A label assigned to the group for human identification and \"\n            \"communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    quantity: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Number of members\",\n        description=(\n            \"A count of the number of resource instances that are part of the \" \"group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_quantity\", title=\"Extension field for ``quantity``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"person | animal | practitioner | device | medication | substance\",\n        description=(\n            \"Identifies the broad classification of the kind of resources the group\"\n            \" includes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"person\",\n                \"animal\",\n                \"practitioner\",\n                \"device\",\n                \"medication\",\n                \"substance\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Group`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"type\",\n            \"actual\",\n            \"code\",\n            \"name\",\n            \"quantity\",\n            \"characteristic\",\n            \"member\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Group`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"type\",\n            \"actual\",\n            \"code\",\n            \"name\",\n            \"quantity\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"actual\", \"actual__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass GroupCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Trait of group members.\n    Identifies the traits shared by members of the group.\n    \"\"\"\n\n    __resource_type__ = \"GroupCharacteristic\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Kind of characteristic\",\n        description=\"A code that identifies the kind of trait being asserted.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    exclude: bool | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=\"Group includes or excludes\",\n        description=(\n            \"If true, indicates the characteristic is one that is NOT held by \"\n            \"members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_exclude\", title=\"Extension field for ``exclude``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period over which characteristic is tested\",\n        description=(\n            \"The period over which the characteristic is tested; e.g. the patient \"\n            \"had an operation during the month of June.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GroupCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueBoolean\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"exclude\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GroupCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"exclude\", \"exclude__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass GroupMember(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who or what is in group.\n    Identifies the resource instances that are members of the group.\n    \"\"\"\n\n    __resource_type__ = \"GroupMember\"\n\n    entity: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"entity\",\n        title=\"Reference to the group member\",\n        description=(\n            \"A reference to the entity that is a member of the group. Must be \"\n            \"consistent with Group.type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"Device\",\n                \"Medication\",\n                \"Substance\",\n            ],\n        },\n    )\n\n    inactive: bool | None = Field(\n        default=None,\n        alias=\"inactive\",\n        title=\"If member is no longer in group\",\n        description=(\n            \"A flag to indicate that the member is no longer in the group, but \"\n            \"previously may have been a member.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_inactive\", title=\"Extension field for ``inactive``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period member belonged to the group\",\n        description=\"The period that the member was in the group, if known.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GroupMember`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"entity\", \"period\", \"inactive\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GroupMember`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/guidanceresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/GuidanceResponse\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass GuidanceResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The formal response to a guidance request.\n    A guidance response is the formal response to a guidance request, including\n    any output parameters returned by the evaluation, as well as the\n    description of any proposed actions to be taken.\n    \"\"\"\n\n    __resource_type__ = \"GuidanceResponse\"\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or Episode during which the response was returned\",\n        description=(\n            \"Allows the context of the guidance response to be provided if \"\n            \"available. In a service context, this would likely be unavailable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"dataRequirement\",\n        title=\"Additional required data\",\n        description=(\n            \"If the evaluation could not be completed due to lack of information, \"\n            \"or additional information would potentially result in a more accurate \"\n            \"response, this element will a description of the data required in \"\n            \"order to proceed with the evaluation. A subsequent request to the \"\n            \"service should include this data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    evaluationMessage: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"evaluationMessage\",\n        title=\"Messages resulting from the evaluation of the artifact or artifacts\",\n        description=(\n            \"Messages resulting from the evaluation of the artifact or artifacts. \"\n            \"As part of evaluating the request, the engine may produce \"\n            \"informational or warning messages. These messages will be provided by \"\n            \"this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationOutcome\"],\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Allows a service to provide a unique, business identifier for the \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    module: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"module\",\n        title=\"A reference to a knowledge module\",\n        description=\"A reference to the knowledge module that was invoked.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceDefinition\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional notes about the response\",\n        description=(\n            \"Provides a mechanism to communicate additional information about the \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When the guidance response was processed\",\n        description=\"Indicates when the guidance response was processed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    outputParameters: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"outputParameters\",\n        title=\"The output parameters of the evaluation, if any\",\n        description=(\n            \"The output parameters of the evaluation, if any. Many modules will \"\n            \"result in the return of specific resources such as procedure or \"\n            \"communication requests that are returned as part of the operation \"\n            \"result. However, modules may define specific outputs that would be \"\n            \"returned as the result of the evaluation, and these would be returned \"\n            \"in this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Parameters\"],\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Device returning the guidance\",\n        description=\"Provides a reference to the device that performed the guidance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    reasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reasonCodeableConcept\",\n        title=\"Reason for the response\",\n        description=(\n            \"Indicates the reason the request was initiated. This is typically \"\n            \"provided as a parameter to the evaluation and echoed by the service, \"\n            \"although for some use cases, such as subscription- or event-based \"\n            \"scenarios, it may provide an indication of the cause for the response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e reason[x]\n            \"one_of_many\": \"reason\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    reasonReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Reason for the response\",\n        description=(\n            \"Indicates the reason the request was initiated. This is typically \"\n            \"provided as a parameter to the evaluation and echoed by the service, \"\n            \"although for some use cases, such as subscription- or event-based \"\n            \"scenarios, it may provide an indication of the cause for the response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e reason[x]\n            \"one_of_many\": \"reason\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    requestId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"requestId\",\n        title=\"The id of the request associated with this response, if any\",\n        description=(\n            \"The id of the request associated with this response. If an id was \"\n            \"given as part of the request, it will be reproduced here to enable the\"\n            \" requester to more easily identify the response in a multi-request \"\n            \"scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    requestId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requestId\", title=\"Extension field for ``requestId``.\"\n    )\n\n    result: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"Proposed actions, if any\",\n        description=\"The actions, if any, produced by the evaluation of the artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\", \"RequestGroup\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"success | data-requested | data-required | in-progress | failure | \"\n            \"entered-in-error\"\n        ),\n        description=(\n            \"The status of the response. If the evaluation is completed \"\n            \"successfully, the status will indicate success. However, in order to \"\n            \"complete the evaluation, the engine may require more information. In \"\n            \"this case, the status will be data-required, and the response will \"\n            \"contain a description of the additional required information. If the \"\n            \"evaluation completed successfully, but the engine determines that a \"\n            \"potentially more accurate response could be provided if more data was \"\n            \"available, the status will be data-requested, and the response will \"\n            \"contain a description of the additional requested information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"success\",\n                \"data-requested\",\n                \"data-required\",\n                \"in-progress\",\n                \"failure\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Patient the request was performed for\",\n        description=\"The patient for which the request was processed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GuidanceResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"requestId\",\n            \"identifier\",\n            \"module\",\n            \"status\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"performer\",\n            \"reasonCodeableConcept\",\n            \"reasonReference\",\n            \"note\",\n            \"evaluationMessage\",\n            \"outputParameters\",\n            \"result\",\n            \"dataRequirement\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GuidanceResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"requestId\",\n            \"identifier\",\n            \"module\",\n            \"status\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"reason\": [\"reasonCodeableConcept\", \"reasonReference\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/healthcareservice.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/HealthcareService\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass HealthcareService(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The details of a healthcare service available at a location.\n    \"\"\"\n\n    __resource_type__ = \"HealthcareService\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this healthcareservice is in active use\",\n        description=\"Whether this healthcareservice record is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    appointmentRequired: bool | None = Field(\n        default=None,\n        alias=\"appointmentRequired\",\n        title=\"If an appointment is required for access to this service\",\n        description=(\n            \"Indicates whether or not a prospective consumer will require an \"\n            \"appointment for a particular service at a site to be provided by the \"\n            \"Organization. Indicates if an appointment is required for access to \"\n            \"this service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    appointmentRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_appointmentRequired\",\n        title=\"Extension field for ``appointmentRequired``.\",\n    )\n\n    availabilityExceptions: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"availabilityExceptions\",\n        title=\"Description of availability exceptions\",\n        description=(\n            \"A description of site availability exceptions, e.g. public holiday \"\n            \"availability. Succinctly describing all possible exceptions to normal \"\n            \"site availability as details in the available Times and not available \"\n            \"Times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availabilityExceptions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availabilityExceptions\",\n        title=\"Extension field for ``availabilityExceptions``.\",\n    )\n\n    availableTime: typing.List[\n        fhirtypes.HealthcareServiceAvailableTimeType\n    ] | None = Field(\n        default=None,\n        alias=\"availableTime\",\n        title=\"Times the Service Site is available\",\n        description=\"A collection of times that the Service Site is available.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Broad category of service being performed or delivered\",\n        description=\"Identifies the broad category of service being performed or delivered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    characteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"Collection of characteristics (attributes)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=(\n            \"Additional description and/or any specific issues not covered \" \"elsewhere\"\n        ),\n        description=(\n            \"Any additional description of the service and/or any specific issues \"\n            \"not covered by the other attributes, which can be displayed as further\"\n            \" detail under the serviceName.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"coverageArea\",\n        title=\"Location(s) service is inteded for/available to\",\n        description=(\n            \"The location(s) that this service is available to (not where the \"\n            \"service is provided).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    eligibility: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"eligibility\",\n        title=\"Specific eligibility requirements required to use the service\",\n        description=(\n            \"Does this service have specific eligibility requirements that need to \"\n            \"be met in order to use the service?\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    eligibilityNote: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"eligibilityNote\",\n        title=\"Describes the eligibility conditions for the service\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    eligibilityNote__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_eligibilityNote\",\n        title=\"Extension field for ``eligibilityNote``.\",\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to services operated for the \"\n            \"location\"\n        ),\n        description=(\n            \"Technical endpoints providing access to services operated for the \"\n            \"specific healthcare services defined at this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    extraDetails: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"extraDetails\",\n        title=(\n            \"Extra details about the service that can't be placed in the other \"\n            \"fields\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    extraDetails__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_extraDetails\",\n        title=\"Extension field for ``extraDetails``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifiers for this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Location(s) where service may be provided\",\n        description=\"The location(s) where this healthcare service may be provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Description of service as presented to a consumer while searching\",\n        description=(\n            \"Further description of the service as it would be presented to a \"\n            \"consumer while searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    notAvailable: typing.List[\n        fhirtypes.HealthcareServiceNotAvailableType\n    ] | None = Field(\n        default=None,\n        alias=\"notAvailable\",\n        title=\"Not available during this time due to provided reason\",\n        description=(\n            \"The HealthcareService is not available during this period of time due \"\n            \"to the provided reason.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    photo: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Facilitates quick identification of the service\",\n        description=(\n            \"If there is a photo/symbol associated with this HealthcareService, it \"\n            \"may be included here to facilitate quick identification of the service\"\n            \" in a list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    programName: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"programName\",\n        title=\"Program Names that categorize the service\",\n        description=\"Program Names that can be used to categorize the service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    programName__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_programName\", title=\"Extension field for ``programName``.\"\n    )\n\n    providedBy: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"providedBy\",\n        title=\"Organization that provides this service\",\n        description=\"The organization that provides this healthcare service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    referralMethod: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"referralMethod\",\n        title=\"Ways that the service accepts referrals\",\n        description=(\n            \"Ways that the service accepts referrals, if this is not provided then \"\n            \"it is implied that no referral is required.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    serviceProvisionCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceProvisionCode\",\n        title=\"Conditions under which service is available/offered\",\n        description=(\n            \"The code(s) that detail the conditions under which the healthcare \"\n            \"service is available/offered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=\"Specialties handled by the HealthcareService\",\n        description=(\n            \"Collection of specialties handled by the service site. This is more of\"\n            \" a medical term.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contacts related to the healthcare service\",\n        description=\"List of contacts related to this specific healthcare service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of service that may be delivered or performed\",\n        description=\"The specific type of service that may be delivered or performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``HealthcareService`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"providedBy\",\n            \"category\",\n            \"type\",\n            \"specialty\",\n            \"location\",\n            \"name\",\n            \"comment\",\n            \"extraDetails\",\n            \"photo\",\n            \"telecom\",\n            \"coverageArea\",\n            \"serviceProvisionCode\",\n            \"eligibility\",\n            \"eligibilityNote\",\n            \"programName\",\n            \"characteristic\",\n            \"referralMethod\",\n            \"appointmentRequired\",\n            \"availableTime\",\n            \"notAvailable\",\n            \"availabilityExceptions\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``HealthcareService`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"providedBy\",\n            \"category\",\n            \"type\",\n            \"specialty\",\n            \"location\",\n            \"name\",\n            \"comment\",\n            \"photo\",\n        ]\n\n\nclass HealthcareServiceAvailableTime(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Times the Service Site is available.\n    A collection of times that the Service Site is available.\n    \"\"\"\n\n    __resource_type__ = \"HealthcareServiceAvailableTime\"\n\n    allDay: bool | None = Field(\n        default=None,\n        alias=\"allDay\",\n        title=\"Always available? e.g. 24 hour service\",\n        description=(\n            \"Is this always available? (hence times are irrelevant) e.g. 24 hour \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    allDay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_allDay\", title=\"Extension field for ``allDay``.\"\n    )\n\n    availableEndTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"availableEndTime\",\n        title=\"Closing time of day (ignored if allDay = true)\",\n        description=(\n            \"The closing time of day. Note: If the AllDay flag is set, then this \"\n            \"time is ignored.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availableEndTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availableEndTime\",\n        title=\"Extension field for ``availableEndTime``.\",\n    )\n\n    availableStartTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"availableStartTime\",\n        title=\"Opening time of day (ignored if allDay = true)\",\n        description=(\n            \"The opening time of day. Note: If the AllDay flag is set, then this \"\n            \"time is ignored.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availableStartTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availableStartTime\",\n        title=\"Extension field for ``availableStartTime``.\",\n    )\n\n    daysOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"daysOfWeek\",\n        title=\"mon | tue | wed | thu | fri | sat | sun\",\n        description=(\n            \"Indicates which days of the week are available between the start and \"\n            \"end Times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"],\n        },\n    )\n    daysOfWeek__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_daysOfWeek\", title=\"Extension field for ``daysOfWeek``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``HealthcareServiceAvailableTime`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"daysOfWeek\",\n            \"allDay\",\n            \"availableStartTime\",\n            \"availableEndTime\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``HealthcareServiceAvailableTime`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass HealthcareServiceNotAvailable(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Not available during this time due to provided reason.\n    The HealthcareService is not available during this period of time due to\n    the provided reason.\n    \"\"\"\n\n    __resource_type__ = \"HealthcareServiceNotAvailable\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Reason presented to the user explaining why time not available\",\n        description=(\n            \"The reason that can be presented to the user as to why this time is \"\n            \"not available.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    during: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"during\",\n        title=\"Service not availablefrom this date\",\n        description=(\n            \"Service is not available (seasonally or for a public holiday) from \"\n            \"this date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``HealthcareServiceNotAvailable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"description\", \"during\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``HealthcareServiceNotAvailable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"description\", \"description__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/humanname.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/HumanName\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass HumanName(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Name of a human - parts and usage.\n    A human's name with the ability to identify parts and usage.\n    \"\"\"\n\n    __resource_type__ = \"HumanName\"\n\n    family: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"family\",\n        title=\"Family name (often called 'Surname')\",\n        description=(\n            \"The part of a name that links to the genealogy. In some cultures (e.g.\"\n            \" Eritrea) the family name of a son is the first name of his father.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    family__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_family\", title=\"Extension field for ``family``.\"\n    )\n\n    given: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"given\",\n        title=\"Given names (not always 'first'). Includes middle names\",\n        description=\"Given name.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    given__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_given\", title=\"Extension field for ``given``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when name was/is in use\",\n        description=(\n            \"Indicates the period of time when this name was valid for the named \"\n            \"person.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    prefix: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"prefix\",\n        title=\"Parts that come before the name\",\n        description=(\n            \"Part of the name that is acquired as a title due to academic, legal, \"\n            \"employment or nobility status, etc. and that appears at the start of \"\n            \"the name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    prefix__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_prefix\", title=\"Extension field for ``prefix``.\"\n    )\n\n    suffix: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"suffix\",\n        title=\"Parts that come after the name\",\n        description=(\n            \"Part of the name that is acquired as a title due to academic, legal, \"\n            \"employment or nobility status, etc. and that appears at the end of the\"\n            \" name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    suffix__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_suffix\", title=\"Extension field for ``suffix``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text representation of the full name\",\n        description=\"A full text representation of the name.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"usual | official | temp | nickname | anonymous | old | maiden\",\n        description=\"Identifies the purpose for this name.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"usual\",\n                \"official\",\n                \"temp\",\n                \"nickname\",\n                \"anonymous\",\n                \"old\",\n                \"maiden\",\n            ],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``HumanName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"use\",\n            \"text\",\n            \"family\",\n            \"given\",\n            \"prefix\",\n            \"suffix\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``HumanName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"use\", \"text\", \"family\", \"given\", \"prefix\", \"suffix\", \"period\"]\n"
  },
  {
    "path": "fhir/resources/STU3/identifier.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Identifier\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Identifier(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An identifier intended for computation.\n    A technical identifier - identifies some entity uniquely and unambiguously.\n    \"\"\"\n\n    __resource_type__ = \"Identifier\"\n\n    assigner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"assigner\",\n        title=\"Organization that issued id (may be just text)\",\n        description=\"Organization that issued/manages the identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when id is/was valid for use\",\n        description=\"Time period during which identifier is/was valid for use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"The namespace for the identifier value\",\n        description=(\n            \"Establishes the namespace for the value - that is, a URL that \"\n            \"describes a set values that are unique.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Description of identifier\",\n        description=(\n            \"A coded type for the identifier that can be used to determine which \"\n            \"identifier to use for a specific purpose.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"usual | official | temp | secondary (If known)\",\n        description=\"The purpose of this identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"usual\", \"official\", \"temp\", \"secondary\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The value that is unique\",\n        description=(\n            \"The portion of the identifier typically relevant to the user and which\"\n            \" is unique within the context of the system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Identifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"use\",\n            \"type\",\n            \"system\",\n            \"value\",\n            \"period\",\n            \"assigner\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Identifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"use\", \"type\", \"system\", \"value\", \"period\", \"assigner\"]\n"
  },
  {
    "path": "fhir/resources/STU3/imagingmanifest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImagingManifest\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ImagingManifest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Key Object Selection.\n    A text description of the DICOM SOP instances selected in the\n    ImagingManifest; or the reason for, or significance of, the selection.\n    \"\"\"\n\n    __resource_type__ = \"ImagingManifest\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Author (human or machine)\",\n        description=(\n            \"Author of ImagingManifest. It can be a human author or a device which \"\n            \"made the decision of the SOP instances selected. For example, a \"\n            \"radiologist selected a set of imaging SOP instances to attach in a \"\n            \"diagnostic report, and a CAD application may author a selection to \"\n            \"describe SOP instances it used to generate a detection conclusion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    authoringTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoringTime\",\n        title=\"Time when the selection of instances was made\",\n        description=(\n            \"Date and time when the selection of the referenced instances were \"\n            \"made. It is (typically) different from the creation date of the \"\n            \"selection resource, and from dates associated with the referenced \"\n            \"instances (e.g. capture time of the referenced image).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoringTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_authoringTime\",\n        title=\"Extension field for ``authoringTime``.\",\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description text\",\n        description=(\n            \"Free text narrative description of the ImagingManifest.   The value \"\n            \"may be derived from the DICOM Standard Part 16, CID-7010 descriptions \"\n            \"(e.g. Best in Set, Complete Study Content). Note that those values \"\n            \"cover the wide range of uses of the DICOM Key Object Selection object,\"\n            \" several of which are not supported by ImagingManifest. Specifically, \"\n            \"there is no expected behavior associated with descriptions that \"\n            \"suggest referenced images be removed or not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"SOP Instance UID\",\n        description=(\n            \"Unique identifier of the DICOM Key Object Selection (KOS) that this \"\n            \"resource represents.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Patient of the selected objects\",\n        description=(\n            \"A patient resource reference which is the patient subject of all DICOM\"\n            \" SOP Instances in this ImagingManifest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    study: typing.List[fhirtypes.ImagingManifestStudyType] = Field(\n        default=...,\n        alias=\"study\",\n        title=\"Study identity of the selected instances\",\n        description=(\n            \"Study identity and locating information of the DICOM SOP instances in \"\n            \"the selection.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingManifest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"patient\",\n            \"authoringTime\",\n            \"author\",\n            \"description\",\n            \"study\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingManifest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"patient\",\n            \"authoringTime\",\n            \"author\",\n            \"description\",\n            \"study\",\n        ]\n\n\nclass ImagingManifestStudy(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Study identity of the selected instances.\n    Study identity and locating information of the DICOM SOP instances in the\n    selection.\n    \"\"\"\n\n    __resource_type__ = \"ImagingManifestStudy\"\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Study access service endpoint\",\n        description=(\n            \"The network service providing access (e.g., query, view, or retrieval)\"\n            \" for the study. See implementation notes for information about using \"\n            \"DICOM endpoints. A study-level endpoint applies to each series in the \"\n            \"study, unless overridden by a series-level endpoint with the same \"\n            \"Endpoint.type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    imagingStudy: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"imagingStudy\",\n        title=\"Reference to ImagingStudy\",\n        description=\"Reference to the Imaging Study in FHIR form.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ImagingStudy\"],\n        },\n    )\n\n    series: typing.List[fhirtypes.ImagingManifestStudySeriesType] = Field(\n        default=...,\n        alias=\"series\",\n        title=\"Series identity of the selected instances\",\n        description=(\n            \"Series identity and locating information of the DICOM SOP instances in\"\n            \" the selection.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    uid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"uid\",\n        title=\"Study instance UID\",\n        description=\"Study instance UID of the SOP instances in the selection.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uid\", title=\"Extension field for ``uid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingManifestStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"uid\",\n            \"imagingStudy\",\n            \"endpoint\",\n            \"series\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingManifestStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"uid\", \"imagingStudy\", \"endpoint\", \"series\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"uid\", \"uid__ext\")]\n        return required_fields\n\n\nclass ImagingManifestStudySeries(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Series identity of the selected instances.\n    Series identity and locating information of the DICOM SOP instances in the\n    selection.\n    \"\"\"\n\n    __resource_type__ = \"ImagingManifestStudySeries\"\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Series access endpoint\",\n        description=(\n            \"The network service providing access (e.g., query, view, or retrieval)\"\n            \" for this series. See implementation notes for information about using\"\n            \" DICOM endpoints. A series-level endpoint, if present, has precedence \"\n            \"over a study-level endpoint with the same Endpoint.type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    instance: typing.List[fhirtypes.ImagingManifestStudySeriesInstanceType] = Field(\n        default=...,\n        alias=\"instance\",\n        title=\"The selected instance\",\n        description=\"Identity and locating information of the selected DICOM SOP instances.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    uid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"uid\",\n        title=\"Series instance UID\",\n        description=\"Series instance UID of the SOP instances in the selection.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uid\", title=\"Extension field for ``uid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingManifestStudySeries`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"uid\", \"endpoint\", \"instance\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingManifestStudySeries`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"uid\", \"endpoint\", \"instance\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"uid\", \"uid__ext\")]\n        return required_fields\n\n\nclass ImagingManifestStudySeriesInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The selected instance.\n    Identity and locating information of the selected DICOM SOP instances.\n    \"\"\"\n\n    __resource_type__ = \"ImagingManifestStudySeriesInstance\"\n\n    sopClass: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"sopClass\",\n        title=\"SOP class UID of instance\",\n        description=\"SOP class UID of the selected instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sopClass__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sopClass\", title=\"Extension field for ``sopClass``.\"\n    )\n\n    uid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"uid\",\n        title=\"Selected instance UID\",\n        description=\"SOP Instance UID of the selected instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uid\", title=\"Extension field for ``uid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingManifestStudySeriesInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"sopClass\", \"uid\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingManifestStudySeriesInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"sopClass\", \"uid\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sopClass\", \"sopClass__ext\"), (\"uid\", \"uid__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/imagingstudy.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImagingStudy\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ImagingStudy(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of images produced in single study (one or more series of references\n    images).\n    Representation of the content produced in a DICOM imaging study. A study\n    comprises a set of series, each of which includes a set of Service-Object\n    Pair Instances (SOP Instances - images or other data) acquired or produced\n    in a common context.  A series is of only one modality (e.g. X-ray, CT, MR,\n    ultrasound), but a study may have multiple series of different modalities.\n    \"\"\"\n\n    __resource_type__ = \"ImagingStudy\"\n\n    accession: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"accession\",\n        title='Related workflow identifier (\"Accession Number\")',\n        description=(\n            \"Accession Number is an identifier related to some aspect of imaging \"\n            \"workflow and data management. Usage may vary across different \"\n            \"institutions.  See for instance [IHE Radiology Technical Framework \"\n            \"Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiol\"\n            \"ogy/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    availability: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"availability\",\n        title=\"ONLINE | OFFLINE | NEARLINE | UNAVAILABLE\",\n        description=\"Availability of study (online, offline, or nearline).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"ONLINE\", \"OFFLINE\", \"NEARLINE\", \"UNAVAILABLE\"],\n        },\n    )\n    availability__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availability\",\n        title=\"Extension field for ``availability``.\",\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled\",\n        description=(\n            \"A list of the diagnostic requests that resulted in this imaging study \"\n            \"being performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ReferralRequest\", \"CarePlan\", \"ProcedureRequest\"],\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Originating context\",\n        description=\"The encounter or episode at which the request is initiated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Institution-generated description\",\n        description=(\n            \"Institution-generated description or classification of the Study \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Study access endpoint\",\n        description=(\n            \"The network service providing access (e.g., query, view, or retrieval)\"\n            \" for the study. See implementation notes for information about using \"\n            \"DICOM endpoints. A study-level endpoint applies to each series in the \"\n            \"study, unless overridden by a series-level endpoint with the same \"\n            \"Endpoint.type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Other identifiers for the study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    interpreter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"interpreter\",\n        title=\"Who interpreted images\",\n        description=\"Who read the study and interpreted the images or other content.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    modalityList: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"modalityList\",\n        title=\"All series modality if actual acquisition modalities\",\n        description=(\n            \"A list of all the Series.ImageModality values that are actual \"\n            \"acquisition modalities, i.e. those in the DICOM Context Group 29 \"\n            \"(value set OID 1.2.840.10008.6.1.19).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    numberOfInstances: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfInstances\",\n        title=\"Number of Study Related Instances\",\n        description=(\n            \"Number of SOP Instances in Study. This value given may be larger than \"\n            \"the number of instance elements this resource contains due to resource\"\n            \" availability, security, or other factors. This element should be \"\n            \"present if any instance elements are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numberOfInstances__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfInstances\",\n        title=\"Extension field for ``numberOfInstances``.\",\n    )\n\n    numberOfSeries: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfSeries\",\n        title=\"Number of Study Related Series\",\n        description=(\n            \"Number of Series in the Study. This value given may be larger than the\"\n            \" number of series elements this Resource contains due to resource \"\n            \"availability, security, or other factors. This element should be \"\n            \"present if any series elements are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numberOfSeries__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfSeries\",\n        title=\"Extension field for ``numberOfSeries``.\",\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who the images are of\",\n        description=\"The patient imaged in the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    procedureCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"procedureCode\",\n        title=\"The performed procedure code\",\n        description=\"The code for the performed procedure type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    procedureReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"procedureReference\",\n        title=\"The performed Procedure reference\",\n        description=\"A reference to the performed Procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why the study was requested\",\n        description=(\n            \"Description of clinical condition indicating why the ImagingStudy was \"\n            \"requested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    referrer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referrer\",\n        title=\"Referring physician\",\n        description=\"The requesting/referring physician.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    series: typing.List[fhirtypes.ImagingStudySeriesType] | None = Field(\n        default=None,\n        alias=\"series\",\n        title=\"Each study has one or more series of instances\",\n        description=\"Each study has one or more series of images or other content.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    started: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"started\",\n        title=\"When the study was started\",\n        description=\"Date and time the study started.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    started__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_started\", title=\"Extension field for ``started``.\"\n    )\n\n    uid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"uid\",\n        title=\"Formal DICOM identifier for the study\",\n        description=\"Formal identifier for the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uid\", title=\"Extension field for ``uid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"uid\",\n            \"accession\",\n            \"identifier\",\n            \"availability\",\n            \"modalityList\",\n            \"patient\",\n            \"context\",\n            \"started\",\n            \"basedOn\",\n            \"referrer\",\n            \"interpreter\",\n            \"endpoint\",\n            \"numberOfSeries\",\n            \"numberOfInstances\",\n            \"procedureReference\",\n            \"procedureCode\",\n            \"reason\",\n            \"description\",\n            \"series\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"uid\",\n            \"accession\",\n            \"identifier\",\n            \"availability\",\n            \"modalityList\",\n            \"patient\",\n            \"context\",\n            \"started\",\n            \"basedOn\",\n            \"referrer\",\n            \"interpreter\",\n            \"endpoint\",\n            \"numberOfSeries\",\n            \"numberOfInstances\",\n            \"procedureReference\",\n            \"procedureCode\",\n            \"reason\",\n            \"description\",\n            \"series\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"uid\", \"uid__ext\")]\n        return required_fields\n\n\nclass ImagingStudySeries(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Each study has one or more series of instances.\n    Each study has one or more series of images or other content.\n    \"\"\"\n\n    __resource_type__ = \"ImagingStudySeries\"\n\n    availability: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"availability\",\n        title=\"ONLINE | OFFLINE | NEARLINE | UNAVAILABLE\",\n        description=\"Availability of series (online, offline or nearline).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"ONLINE\", \"OFFLINE\", \"NEARLINE\", \"UNAVAILABLE\"],\n        },\n    )\n    availability__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availability\",\n        title=\"Extension field for ``availability``.\",\n    )\n\n    bodySite: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Body part examined\",\n        description=(\n            \"The anatomic structures examined. See DICOM Part 16 Annex L (http://di\"\n            \"com.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html)\"\n            \" for DICOM to SNOMED-CT mappings. The bodySite may indicate the \"\n            \"laterality of body part imaged; if so, it shall be consistent with any\"\n            \" content of ImagingStudy.series.laterality.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"A short human readable summary of the series\",\n        description=\"A description of the series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Series access endpoint\",\n        description=(\n            \"The network service providing access (e.g., query, view, or retrieval)\"\n            \" for this series. See implementation notes for information about using\"\n            \" DICOM endpoints. A series-level endpoint, if present, has precedence \"\n            \"over a study-level endpoint with the same Endpoint.type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    instance: typing.List[fhirtypes.ImagingStudySeriesInstanceType] | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"A single SOP instance from the series\",\n        description=(\n            \"A single SOP instance within the series, e.g. an image, or \"\n            \"presentation state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    laterality: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"laterality\",\n        title=\"Body part laterality\",\n        description=(\n            \"The laterality of the (possibly paired) anatomic structures examined. \"\n            \"E.g., the left knee, both lungs, or unpaired abdomen. If present, \"\n            \"shall be consistent with any laterality information indicated in \"\n            \"ImagingStudy.series.bodySite.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    modality: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"modality\",\n        title=\"The modality of the instances in the series\",\n        description=\"The modality of this series sequence.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    number: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"Numeric identifier of this series\",\n        description=\"The numeric identifier of this series in the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    numberOfInstances: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfInstances\",\n        title=\"Number of Series Related Instances\",\n        description=(\n            \"Number of SOP Instances in the Study. The value given may be larger \"\n            \"than the number of instance elements this resource contains due to \"\n            \"resource availability, security, or other factors. This element should\"\n            \" be present if any instance elements are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numberOfInstances__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfInstances\",\n        title=\"Extension field for ``numberOfInstances``.\",\n    )\n\n    performer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed the series\",\n        description=(\n            \"The physician or operator (often the radiology technician)  who \"\n            \"performed the series. The performer is recorded at the series level, \"\n            \"since each series in a study may be performed by a different \"\n            \"practitioner, at different times, and using different devices. A \"\n            \"series may be performed by multiple practitioners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    started: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"started\",\n        title=\"When the series started\",\n        description=\"The date and time the series was started.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    started__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_started\", title=\"Extension field for ``started``.\"\n    )\n\n    uid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"uid\",\n        title=\"Formal DICOM identifier for this series\",\n        description=\"Formal identifier for this series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uid\", title=\"Extension field for ``uid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingStudySeries`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"uid\",\n            \"number\",\n            \"modality\",\n            \"description\",\n            \"numberOfInstances\",\n            \"availability\",\n            \"endpoint\",\n            \"bodySite\",\n            \"laterality\",\n            \"started\",\n            \"performer\",\n            \"instance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingStudySeries`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"uid\",\n            \"number\",\n            \"modality\",\n            \"description\",\n            \"numberOfInstances\",\n            \"availability\",\n            \"endpoint\",\n            \"bodySite\",\n            \"laterality\",\n            \"started\",\n            \"performer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"uid\", \"uid__ext\")]\n        return required_fields\n\n\nclass ImagingStudySeriesInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A single SOP instance from the series.\n    A single SOP instance within the series, e.g. an image, or presentation\n    state.\n    \"\"\"\n\n    __resource_type__ = \"ImagingStudySeriesInstance\"\n\n    number: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"The number of this instance in the series\",\n        description=\"The number of instance in the series.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    sopClass: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"sopClass\",\n        title=\"DICOM class type\",\n        description=\"DICOM instance  type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sopClass__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sopClass\", title=\"Extension field for ``sopClass``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Description of instance\",\n        description=\"The description of the instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    uid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"uid\",\n        title=\"Formal DICOM identifier for this instance\",\n        description=\"Formal identifier for this image or other content.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uid\", title=\"Extension field for ``uid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingStudySeriesInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"uid\",\n            \"number\",\n            \"sopClass\",\n            \"title\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingStudySeriesInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sopClass\", \"sopClass__ext\"), (\"uid\", \"uid__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/immunization.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Immunization\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Immunization(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Immunization event information.\n    Describes the event of a patient being administered a vaccination or a\n    record of a vaccination as reported by a patient, a clinician or another\n    party and may include vaccine reaction information and what vaccination\n    protocol was followed.\n    \"\"\"\n\n    __resource_type__ = \"Immunization\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Vaccination administration date\",\n        description=\"Date vaccine administered or was to be administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    doseQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"doseQuantity\",\n        title=\"Amount of vaccine administered\",\n        description=\"The quantity of vaccine product that was administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter administered as part of\",\n        description=(\n            \"The visit or admission or other contact between patient and health \"\n            \"care provider the immunization was performed as part of.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    expirationDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"expirationDate\",\n        title=\"Vaccine expiration date\",\n        description=\"Date vaccine batch expires.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_expirationDate\",\n        title=\"Extension field for ``expirationDate``.\",\n    )\n\n    explanation: fhirtypes.ImmunizationExplanationType | None = Field(\n        default=None,\n        alias=\"explanation\",\n        title=\"Administration/non-administration reasons\",\n        description=\"Reasons why a vaccine was or was not administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=\"A unique identifier assigned to this immunization record.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where vaccination occurred\",\n        description=(\n            \"The service delivery location where the vaccine administration \"\n            \"occurred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    lotNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lotNumber\",\n        title=\"Vaccine lot number\",\n        description=\"Lot number of the  vaccine product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lotNumber\", title=\"Extension field for ``lotNumber``.\"\n    )\n\n    manufacturer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Vaccine manufacturer\",\n        description=\"Name of vaccine manufacturer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    notGiven: bool | None = Field(\n        default=None,\n        alias=\"notGiven\",\n        title=\"Flag for whether immunization was given\",\n        description=\"Indicates if the vaccination was or was not given.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    notGiven__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_notGiven\", title=\"Extension field for ``notGiven``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Vaccination notes\",\n        description=(\n            \"Extra information about the immunization that is not conveyed by the \"\n            \"other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who was immunized\",\n        description=\"The patient who either received or did not receive the immunization.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    practitioner: typing.List[fhirtypes.ImmunizationPractitionerType] | None = Field(\n        default=None,\n        alias=\"practitioner\",\n        title=\"Who performed event\",\n        description=\"Indicates who or what performed the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    primarySource: bool | None = Field(\n        default=None,\n        alias=\"primarySource\",\n        title=\"Indicates context the data was recorded in\",\n        description=(\n            \"An indication that the content of the record is based on information \"\n            \"from the person who administered the vaccine. This reflects the \"\n            \"context under which the data was originally recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    primarySource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_primarySource\",\n        title=\"Extension field for ``primarySource``.\",\n    )\n\n    reaction: typing.List[fhirtypes.ImmunizationReactionType] | None = Field(\n        default=None,\n        alias=\"reaction\",\n        title=\"Details of a reaction that follows immunization\",\n        description=(\n            \"Categorical data indicating that an adverse event is associated in \"\n            \"time to an immunization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reportOrigin: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reportOrigin\",\n        title=\"Indicates the source of a secondarily reported record\",\n        description=(\n            \"The source of the data when the report of the immunization event is \"\n            \"not based on information from the person who administered the vaccine.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    route: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"route\",\n        title=\"How vaccine entered body\",\n        description=\"The path by which the vaccine product is taken into the body.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    site: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Body site vaccine  was administered\",\n        description=\"Body site where vaccine was administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"completed | entered-in-error\",\n        description=\"Indicates the current status of the vaccination event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"completed\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    vaccinationProtocol: typing.List[\n        fhirtypes.ImmunizationVaccinationProtocolType\n    ] | None = Field(\n        default=None,\n        alias=\"vaccinationProtocol\",\n        title=\"What protocol was followed\",\n        description=(\n            \"Contains information about the protocol(s) under which the vaccine was\"\n            \" administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    vaccineCode: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"vaccineCode\",\n        title=\"Vaccine product administered\",\n        description=\"Vaccine that was administered or was to be administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Immunization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"notGiven\",\n            \"vaccineCode\",\n            \"patient\",\n            \"encounter\",\n            \"date\",\n            \"primarySource\",\n            \"reportOrigin\",\n            \"location\",\n            \"manufacturer\",\n            \"lotNumber\",\n            \"expirationDate\",\n            \"site\",\n            \"route\",\n            \"doseQuantity\",\n            \"practitioner\",\n            \"note\",\n            \"explanation\",\n            \"reaction\",\n            \"vaccinationProtocol\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Immunization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"notGiven\",\n            \"practitioner\",\n            \"note\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"notGiven\", \"notGiven__ext\"),\n            (\"primarySource\", \"primarySource__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass ImmunizationExplanation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Administration/non-administration reasons.\n    Reasons why a vaccine was or was not administered.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationExplanation\"\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why immunization occurred\",\n        description=\"Reasons why a vaccine was administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonNotGiven: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonNotGiven\",\n        title=\"Why immunization did not occur\",\n        description=\"Reason why a vaccine was not administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationExplanation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"reason\", \"reasonNotGiven\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationExplanation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ImmunizationPractitioner(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed event.\n    Indicates who or what performed the event.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationPractitioner\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual who was performing\",\n        description=\"The device, practitioner, etc. who performed the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"What type of performance was done\",\n        description=(\n            \"Describes the type of performance (e.g. ordering provider, \"\n            \"administering provider, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationPractitioner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationPractitioner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"role\", \"actor\"]\n\n\nclass ImmunizationReaction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of a reaction that follows immunization.\n    Categorical data indicating that an adverse event is associated in time to\n    an immunization.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationReaction\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When reaction started\",\n        description=\"Date of reaction to the immunization.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    detail: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Additional information on reaction\",\n        description=\"Details of the reaction.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    reported: bool | None = Field(\n        default=None,\n        alias=\"reported\",\n        title=\"Indicates self-reported reaction\",\n        description=\"Self-reported indicator.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reported__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reported\", title=\"Extension field for ``reported``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationReaction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"date\", \"detail\", \"reported\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationReaction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ImmunizationVaccinationProtocol(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What protocol was followed.\n    Contains information about the protocol(s) under which the vaccine was\n    administered.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationVaccinationProtocol\"\n\n    authority: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Who is responsible for protocol\",\n        description=\"Indicates the authority who published the protocol.  E.g. ACIP.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Details of vaccine protocol\",\n        description=(\n            \"Contains the description about the protocol under which the vaccine \"\n            \"was administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    doseSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"doseSequence\",\n        title=\"Dose number within series\",\n        description=\"Nominal position in a series.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    doseSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doseSequence\",\n        title=\"Extension field for ``doseSequence``.\",\n    )\n\n    doseStatus: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"doseStatus\",\n        title=\"Indicates if dose counts towards immunity\",\n        description=(\n            'Indicates if the immunization event should \"count\" against  the '\n            \"protocol.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    doseStatusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"doseStatusReason\",\n        title=\"Why dose does (not) count\",\n        description=(\n            \"Provides an explanation as to why an immunization event should or \"\n            \"should not count against the protocol.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    series: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"series\",\n        title=\"Name of vaccine series\",\n        description=(\n            \"One possible path to achieve presumed immunity against a disease - \"\n            \"within the context of an authority.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_series\", title=\"Extension field for ``series``.\"\n    )\n\n    seriesDoses: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"seriesDoses\",\n        title=\"Recommended number of doses for immunity\",\n        description=\"The recommended number of doses to achieve immunity.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    seriesDoses__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_seriesDoses\", title=\"Extension field for ``seriesDoses``.\"\n    )\n\n    targetDisease: typing.List[fhirtypes.CodeableConceptType] = Field(\n        default=...,\n        alias=\"targetDisease\",\n        title=\"Disease immunized against\",\n        description=\"The targeted disease.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationVaccinationProtocol`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"doseSequence\",\n            \"description\",\n            \"authority\",\n            \"series\",\n            \"seriesDoses\",\n            \"targetDisease\",\n            \"doseStatus\",\n            \"doseStatusReason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationVaccinationProtocol`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/immunizationrecommendation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ImmunizationRecommendation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Guidance or advice relating to an immunization.\n    A patient's point-in-time immunization and recommendation (i.e. forecasting\n    a patient's immunization eligibility according to a published schedule)\n    with optional supporting justification.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationRecommendation\"\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=\"A unique identifier assigned to this particular recommendation record.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who this profile is for\",\n        description=\"The patient the recommendations are for.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    recommendation: typing.List[\n        fhirtypes.ImmunizationRecommendationRecommendationType\n    ] = Field(\n        default=...,\n        alias=\"recommendation\",\n        title=\"Vaccine administration recommendations\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationRecommendation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"patient\",\n            \"recommendation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"patient\",\n            \"recommendation\",\n        ]\n\n\nclass ImmunizationRecommendationRecommendation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Vaccine administration recommendations.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationRecommendationRecommendation\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date recommendation created\",\n        description=\"The date the immunization recommendation was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    dateCriterion: typing.List[\n        fhirtypes.ImmunizationRecommendationRecommendationDateCriterionType\n    ] | None = Field(\n        default=None,\n        alias=\"dateCriterion\",\n        title=\"Dates governing proposed immunization\",\n        description=(\n            \"Vaccine date recommendations.  For example, earliest date to \"\n            \"administer, latest date to administer, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    doseNumber: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"doseNumber\",\n        title=\"Recommended dose number\",\n        description=(\n            \"The next recommended dose number (e.g. dose 2 is the next recommended \"\n            \"dose).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doseNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_doseNumber\", title=\"Extension field for ``doseNumber``.\"\n    )\n\n    forecastStatus: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"forecastStatus\",\n        title=\"Vaccine administration status\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    protocol: fhirtypes.ImmunizationRecommendationRecommendationProtocolType | None = (\n        Field(\n            default=None,\n            alias=\"protocol\",\n            title=\"Protocol used by recommendation\",\n            description=(\n                \"Contains information about the protocol under which the vaccine was \"\n                \"administered.\"\n            ),\n            json_schema_extra={\n                \"element_property\": True,\n            },\n        )\n    )\n\n    supportingImmunization: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingImmunization\",\n        title=\"Past immunizations supporting recommendation\",\n        description=(\n            \"Immunization event history that supports the status and \" \"recommendation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Immunization\"],\n        },\n    )\n\n    supportingPatientInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingPatientInformation\",\n        title=\"Patient observations supporting recommendation\",\n        description=(\n            \"Patient Information that supports the status and recommendation.  This\"\n            \" includes patient observations, adverse reactions and \"\n            \"allergy/intolerance information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\", \"AllergyIntolerance\"],\n        },\n    )\n\n    targetDisease: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"targetDisease\",\n        title=\"Disease to be immunized against\",\n        description=\"The targeted disease for the recommendation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    vaccineCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"vaccineCode\",\n        title=\"Vaccine recommendation applies to\",\n        description=\"Vaccine that pertains to the recommendation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationRecommendationRecommendation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"date\",\n            \"vaccineCode\",\n            \"targetDisease\",\n            \"doseNumber\",\n            \"forecastStatus\",\n            \"dateCriterion\",\n            \"protocol\",\n            \"supportingImmunization\",\n            \"supportingPatientInformation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"date\",\n            \"vaccineCode\",\n            \"targetDisease\",\n            \"doseNumber\",\n            \"forecastStatus\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"date\", \"date__ext\")]\n        return required_fields\n\n\nclass ImmunizationRecommendationRecommendationDateCriterion(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dates governing proposed immunization.\n    Vaccine date recommendations.  For example, earliest date to administer,\n    latest date to administer, etc.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationRecommendationRecommendationDateCriterion\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of date\",\n        description=(\n            \"Date classification of recommendation.  For example, earliest date to \"\n            \"give, latest date to give, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Recommended date\",\n        description=\"The date whose meaning is specified by dateCriterion.code.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationRecommendationRecommendationDateCriterion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendationDateCriterion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass ImmunizationRecommendationRecommendationProtocol(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Protocol used by recommendation.\n    Contains information about the protocol under which the vaccine was\n    administered.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationRecommendationRecommendationProtocol\"\n\n    authority: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Who is responsible for protocol\",\n        description=(\n            \"Indicates the authority who published the protocol.  For example, \" \"ACIP.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Protocol details\",\n        description=(\n            \"Contains the description about the protocol under which the vaccine \"\n            \"was administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    doseSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"doseSequence\",\n        title=\"Dose number within sequence\",\n        description=(\n            \"Indicates the nominal position in a series of the next dose.  This is \"\n            \"the recommended dose number as per a specified protocol.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    doseSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doseSequence\",\n        title=\"Extension field for ``doseSequence``.\",\n    )\n\n    series: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"series\",\n        title=\"Name of vaccination series\",\n        description=(\n            \"One possible path to achieve presumed immunity against a disease - \"\n            \"within the context of an authority.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_series\", title=\"Extension field for ``series``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationRecommendationRecommendationProtocol`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"doseSequence\",\n            \"description\",\n            \"authority\",\n            \"series\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendationProtocol`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/implementationguide.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImplementationGuide\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ImplementationGuide(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of rules about how FHIR is used.\n    A set of rules of how FHIR is used to solve a particular problem. This\n    resource is used to gather all the parts of an implementation guide into a\n    logical whole and to publish a computable definition of all the parts.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuide\"\n\n    binary: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"binary\",\n        title=\"Image, css, script, etc.\",\n        description=(\n            \"A binary file that is included in the  implementation guide when it is\"\n            \" published.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    binary__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_binary\", title=\"Extension field for ``binary``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the implementation guide and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the implementation guide was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the implementation \"\n            \"guide changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    dependency: typing.List[fhirtypes.ImplementationGuideDependencyType] | None = Field(\n        default=None,\n        alias=\"dependency\",\n        title=\"Another Implementation guide this depends on\",\n        description=(\n            \"Another implementation guide that this implementation depends on. \"\n            \"Typically, an implementation guide uses value sets, profiles \"\n            \"etc.defined in other implementation guides.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the implementation guide\",\n        description=(\n            \"A free text natural language description of the implementation guide \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this implementation guide is authored\"\n            \" for testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fhirVersion: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"fhirVersion\",\n        title=\"FHIR Version this Implementation Guide targets\",\n        description=(\n            \"The version of the FHIR specification on which this \"\n            \"ImplementationGuide is based - this is the formal version of the \"\n            \"specification, without the revision number, e.g. \"\n            \"[publication].[major].[minor], which is 3.0.2 for this version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fhirVersion\", title=\"Extension field for ``fhirVersion``.\"\n    )\n\n    global_fhir: typing.List[fhirtypes.ImplementationGuideGlobalType] | None = Field(\n        default=None,\n        alias=\"global\",\n        title=\"Profiles that apply globally\",\n        description=(\n            \"A set of profiles that all resources covered by this implementation \"\n            \"guide must conform to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for implementation guide (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the implementation guide is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this implementation guide (computer friendly)\",\n        description=(\n            \"A natural language name identifying the implementation guide. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    package: typing.List[fhirtypes.ImplementationGuidePackageType] | None = Field(\n        default=None,\n        alias=\"package\",\n        title=\"Group of resources as used in .page.package\",\n        description=(\n            \"A logical group of resources. Logical groups can be used when building\"\n            \" pages.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    page: fhirtypes.ImplementationGuidePageType | None = Field(\n        default=None,\n        alias=\"page\",\n        title=\"Page/Section in the Guide\",\n        description=(\n            \"A page / section in the implementation guide. The root page is the \"\n            \"implementation guide home page.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this implementation guide. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this implementation guide (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this implementation guide \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD \"\n            \"be an address at which this implementation guide is (or will be) \"\n            \"published. The URL SHOULD include the major version of the \"\n            \"implementation guide. For more information see [Technical and Business\"\n            \" Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate implementation guide instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the implementation guide\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"implementation guide when it is referenced in a specification, model, \"\n            \"design or instance. This is an arbitrary value managed by the \"\n            \"implementation guide author and is not expected to be globally unique.\"\n            \" For example, it might be a timestamp (e.g. yyyymmdd) if a managed \"\n            \"version is not available. There is also no expectation that versions \"\n            \"can be placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuide`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"copyright\",\n            \"fhirVersion\",\n            \"dependency\",\n            \"package\",\n            \"global\",\n            \"binary\",\n            \"page\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuide`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"fhirVersion\",\n            \"dependency\",\n            \"package\",\n            \"global\",\n            \"page\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n\nclass ImplementationGuideDependency(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Another Implementation guide this depends on.\n    Another implementation guide that this implementation depends on.\n    Typically, an implementation guide uses value sets, profiles etc.defined in\n    other implementation guides.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDependency\"\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"reference | inclusion\",\n        description=\"How the dependency is represented when the guide is published.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"reference\", \"inclusion\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Where to find dependency\",\n        description=\"Where the dependency is located.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDependency`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"uri\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDependency`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"uri\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\"), (\"uri\", \"uri__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideGlobal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Profiles that apply globally.\n    A set of profiles that all resources covered by this implementation guide\n    must conform to.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideGlobal\"\n\n    profile: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"profile\",\n        title=\"Profile that all resources must conform to\",\n        description=\"A reference to the profile that all instances must conform to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type this profiles applies to\",\n        description=\"The type of resource that all instances must conform to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideGlobal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"profile\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideGlobal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"profile\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass ImplementationGuidePackage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Group of resources as used in .page.package.\n    A logical group of resources. Logical groups can be used when building\n    pages.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuidePackage\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human readable text describing the package\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name used .page.package\",\n        description=\"The name for the group, as used in page.package.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    resource: typing.List[fhirtypes.ImplementationGuidePackageResourceType] = Field(\n        default=...,\n        alias=\"resource\",\n        title=\"Resource in the implementation guide\",\n        description=(\n            \"A resource that is part of the implementation guide. Conformance \"\n            \"resources (value set, structure definition, capability statements \"\n            \"etc.) are obvious candidates for inclusion, but any kind of resource \"\n            \"can be included as an example resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuidePackage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"description\",\n            \"resource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuidePackage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"resource\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass ImplementationGuidePackageResource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource in the implementation guide.\n    A resource that is part of the implementation guide. Conformance resources\n    (value set, structure definition, capability statements etc.) are obvious\n    candidates for inclusion, but any kind of resource can be included as an\n    example resource.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuidePackageResource\"\n\n    acronym: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"acronym\",\n        title=\"Short code to identify the resource\",\n        description=(\n            \"A short code that may be used to identify the resource throughout the \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    acronym__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_acronym\", title=\"Extension field for ``acronym``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Reason why included in guide\",\n        description=(\n            \"A description of the reason that a resource has been included in the \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    example: bool | None = Field(\n        default=None,\n        alias=\"example\",\n        title=\"If not an example, has its normal meaning\",\n        description=(\n            \"Whether a resource is included in the guide as part of the rules \"\n            \"defined by the guide, or just as an example of a resource that \"\n            \"conforms to the rules and/or help implementers understand the intent \"\n            \"of the guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    example__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_example\", title=\"Extension field for ``example``.\"\n    )\n\n    exampleFor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"exampleFor\",\n        title=\"Resource this is an example of (if applicable)\",\n        description=(\n            \"Another resource that this resource is an example for. This is mostly \"\n            \"used for resources that are included as examples of \"\n            \"StructureDefinitions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human Name for the resource\",\n        description=(\n            \"A human assigned name for the resource. All resources SHOULD have a \"\n            \"name, but the name may be extracted from the resource (e.g. \"\n            \"ValueSet.name).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    sourceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sourceReference\",\n        title=\"Location of the resource\",\n        description=\"Where this resource is found.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    sourceUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"sourceUri\",\n        title=\"Location of the resource\",\n        description=\"Where this resource is found.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": True,\n        },\n    )\n    sourceUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceUri\", title=\"Extension field for ``sourceUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuidePackageResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"example\",\n            \"name\",\n            \"description\",\n            \"acronym\",\n            \"sourceUri\",\n            \"sourceReference\",\n            \"exampleFor\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuidePackageResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"example\", \"name\", \"sourceUri\", \"sourceReference\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"example\", \"example__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"source\": [\"sourceReference\", \"sourceUri\"]}\n        return one_of_many_fields\n\n\nclass ImplementationGuidePage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Page/Section in the Guide.\n    A page / section in the implementation guide. The root page is the\n    implementation guide home page.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuidePage\"\n\n    format: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"format\",\n        title=\"Format of the page (e.g. html, markdown, etc.)\",\n        description=\"The format of the page.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    format__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_format\", title=\"Extension field for ``format``.\"\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=(\n            \"page | example | list | include | directory | dictionary | toc | \"\n            \"resource\"\n        ),\n        description=(\n            \"The kind of page that this is. Some pages are autogenerated (list, \"\n            \"example), and other kinds are of interest so that tools can navigate \"\n            \"the user to the page of interest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"page\",\n                \"example\",\n                \"list\",\n                \"include\",\n                \"directory\",\n                \"dictionary\",\n                \"toc\",\n                \"resource\",\n            ],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    package: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"package\",\n        title=\"Name of package to include\",\n        description=(\n            \"For constructed pages, a list of packages to include in the page (or \"\n            \"else empty for everything).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    package__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_package\", title=\"Extension field for ``package``.\"\n    )\n\n    page: typing.List[fhirtypes.ImplementationGuidePageType] | None = Field(\n        default=None,\n        alias=\"page\",\n        title=\"Nested Pages / Sections\",\n        description=\"Nested Pages/Sections under this page.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    source: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Where to find that page\",\n        description=\"The source address for the page.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Short title shown for navigational assistance\",\n        description=(\n            \"A short title used to represent this page in navigational structures \"\n            \"such as table of contents, bread crumbs, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of resource to include in the list\",\n        description=\"For constructed pages, what kind of resources to include in the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    type__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuidePage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"source\",\n            \"title\",\n            \"kind\",\n            \"type\",\n            \"package\",\n            \"format\",\n            \"page\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuidePage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"source\", \"title\", \"kind\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"kind\", \"kind__ext\"),\n            (\"source\", \"source__ext\"),\n            (\"title\", \"title__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/library.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Library\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Library(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Represents a library of quality improvement components.\n    The Library resource is a general-purpose container for knowledge asset\n    definitions. It can be used to describe and expose existing knowledge\n    assets such as logic libraries and information model descriptions, as well\n    as to describe a collection of knowledge assets.\n    \"\"\"\n\n    __resource_type__ = \"Library\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the library was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    content: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"Contents of the library, either embedded or referenced\",\n        description=(\n            \"The content of the library as an Attachment. The content may be a \"\n            \"reference to a url, or may be directly embedded as a base-64 string. \"\n            \"Either way, the contentType of the attachment determines how to \"\n            \"interpret the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contributor: typing.List[fhirtypes.ContributorType] | None = Field(\n        default=None,\n        alias=\"contributor\",\n        title=\"A content contributor\",\n        description=(\n            \"A contributor to the content of the library, including authors, \"\n            \"editors, reviewers, and endorsers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the library and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"dataRequirement\",\n        title=\"What data is referenced by this library\",\n        description=(\n            \"Describes a set of data that must be provided in order to be able to \"\n            \"successfully perform the computations defined by the library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the library was published. The \"\n            \"date must change if and when the business version changes and it must \"\n            \"change if the status code changes. In addition, it should change when \"\n            \"the substantive content of the library changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the library\",\n        description=(\n            \"A free text natural language description of the library from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the library is expected to be used\",\n        description=(\n            \"The period during which the library content was or is planned to be in\"\n            \" active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this library is authored for testing \"\n            \"purposes (or education/evaluation/marketing), and is not intended to \"\n            \"be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the library\",\n        description=(\n            \"A formal identifier that is used to identify this library when it is \"\n            \"represented in other formats, or referenced in a specification, model,\"\n            \" design or an instance. e.g. CMS or NQF identifiers for a measure \"\n            \"artifact. Note that at least one identifier is required for non-\"\n            \"experimental active artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for library (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the library is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the library was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval, but doesn't change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this library (computer friendly)\",\n        description=(\n            \"A natural language name identifying the library. This name should be \"\n            \"usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    parameter: typing.List[fhirtypes.ParameterDefinitionType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Parameters defined by the library\",\n        description=\"The parameter element defines parameters used by the library.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=\"The name of the individual or organization that published the library.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this library is defined\",\n        description=(\n            \"Explaination of why this library is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc.\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this library. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this library (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the library.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptive topics related to the content of the library. Topics \"\n            \"provide a high-level categorization of the library that can be useful \"\n            \"for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=(\n            \"logic-library | model-definition | asset-collection | module-\" \"definition\"\n        ),\n        description=(\n            \"Identifies the type of library such as a Logic Library, Model \"\n            \"Definition, Asset Collection, or Module Definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this library (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this library when it is \"\n            \"referenced in a specification, model, design or an instance. This \"\n            \"SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at\"\n            \" which this library is (or will be) published. The URL SHOULD include \"\n            \"the major version of the library. For more information see [Technical \"\n            \"and Business Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the library\",\n        description=(\n            \"A detailed description of how the library is used from a clinical \"\n            \"perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate library instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the library\",\n        description=(\n            \"The identifier that is used to identify this version of the library \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the library author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence. To provide a version consistent with the Decision Support \"\n            \"Service specification, use the format Major.Minor.Revision (e.g. \"\n            \"1.0.0). For more information on versioning knowledge assets, refer to \"\n            \"the Decision Support Service specification. Note that a version is \"\n            \"required for non-experimental active artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Library`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"type\",\n            \"date\",\n            \"publisher\",\n            \"description\",\n            \"purpose\",\n            \"usage\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"topic\",\n            \"contributor\",\n            \"contact\",\n            \"copyright\",\n            \"relatedArtifact\",\n            \"parameter\",\n            \"dataRequirement\",\n            \"content\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Library`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"type\",\n            \"date\",\n            \"publisher\",\n            \"description\",\n            \"effectivePeriod\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"contact\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/linkage.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Linkage\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Linkage(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links records for 'same' item.\n    Identifies two or more records (resource instances) that are referring to\n    the same real-world \"occurrence\".\n    \"\"\"\n\n    __resource_type__ = \"Linkage\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this linkage assertion is active or not\",\n        description=(\n            \"Indicates whether the asserted set of linkages are considered to be \"\n            '\"in effect\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who is responsible for linkages\",\n        description=(\n            \"Identifies the user or organization responsible for asserting the \"\n            \"linkages and who establishes the context for evaluating the nature of \"\n            \"each linkage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Organization\"],\n        },\n    )\n\n    item: typing.List[fhirtypes.LinkageItemType] = Field(\n        default=...,\n        alias=\"item\",\n        title=\"Item to be linked\",\n        description=(\n            \"Identifies one of the records that is considered to refer to the same \"\n            \"real-world occurrence as well as how the items hould be evaluated \"\n            \"within the collection of linked items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Linkage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"active\",\n            \"author\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Linkage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"active\", \"author\", \"item\"]\n\n\nclass LinkageItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Item to be linked.\n    Identifies one of the records that is considered to refer to the same real-\n    world occurrence as well as how the items hould be evaluated within the\n    collection of linked items.\n    \"\"\"\n\n    __resource_type__ = \"LinkageItem\"\n\n    resource: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"resource\",\n        title=\"Resource being linked\",\n        description=\"The resource instance being linked as part of the group.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"source | alternate | historical\",\n        description=(\n            'Distinguishes which item is \"source of truth\" (if any) and which items'\n            \" are no longer considered to be current representations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"source\", \"alternate\", \"historical\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``LinkageItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"resource\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``LinkageItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"resource\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/list.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/List\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass List(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information summarized from a list of other resources.\n    A set of information summarized from a list of other resources.\n    \"\"\"\n\n    __resource_type__ = \"List\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"What the purpose of this list is\",\n        description=\"This code defines the purpose of the list - why it was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the list was prepared\",\n        description=\"The date that the list was prepared.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    emptyReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"emptyReason\",\n        title=\"Why list is empty\",\n        description=\"If the list is empty, why the list is empty.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Context in which list created\",\n        description=\"The encounter that is the context in which this list was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    entry: typing.List[fhirtypes.ListEntryType] | None = Field(\n        default=None,\n        alias=\"entry\",\n        title=\"Entries in the list\",\n        description=\"Entries in this list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Identifier for the List assigned for business purposes outside the \"\n            \"context of FHIR.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"working | snapshot | changes\",\n        description=(\n            \"How this list was prepared - whether it is a working list that is \"\n            \"suitable for being maintained on an ongoing basis, or if it represents\"\n            \" a snapshot of a list of items from another source, or whether it is a\"\n            \" prepared list where items may be marked as added, modified or \"\n            \"deleted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"working\", \"snapshot\", \"changes\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the list\",\n        description=\"Comments that apply to the overall list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    orderedBy: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"orderedBy\",\n        title=\"What order the list has\",\n        description=\"What order applies to the items in the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Who and/or what defined the list contents (aka Author)\",\n        description=(\n            \"The entity responsible for deciding what the contents of the list \"\n            \"were. Where the list was created by a human, this is the same as the \"\n            \"author of the list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Patient\", \"Device\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"current | retired | entered-in-error\",\n        description=\"Indicates the current state of this list.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"current\", \"retired\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"If all resources have the same subject\",\n        description=(\n            \"The common subject (or patient) of the resources that are in the list,\"\n            \" if there is one.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Device\", \"Location\"],\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Descriptive name for the list\",\n        description=\"A label for the list assigned by the author.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``List`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"mode\",\n            \"title\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"date\",\n            \"source\",\n            \"orderedBy\",\n            \"note\",\n            \"entry\",\n            \"emptyReason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``List`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"mode\",\n            \"title\",\n            \"code\",\n            \"subject\",\n            \"date\",\n            \"source\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ListEntry(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Entries in the list.\n    Entries in this list.\n    \"\"\"\n\n    __resource_type__ = \"ListEntry\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When item added to list\",\n        description=\"When this item was added to the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    deleted: bool | None = Field(\n        default=None,\n        alias=\"deleted\",\n        title=\"If this item is actually marked as deleted\",\n        description=\"True if this item is marked as deleted in the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    deleted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_deleted\", title=\"Extension field for ``deleted``.\"\n    )\n\n    flag: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"flag\",\n        title=\"Status/Workflow information about this item\",\n        description=(\n            \"The flag allows the system constructing the list to indicate the role \"\n            \"and significance of the item in the list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    item: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"item\",\n        title=\"Actual entry\",\n        description=\"A reference to the actual resource from which data was derived.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ListEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"flag\",\n            \"deleted\",\n            \"date\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ListEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/location.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Location\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Location(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details and position information for a physical place.\n    Details and position information for a physical place where services are\n    provided  and resources and participants may be stored, found, contained or\n    accommodated.\n    \"\"\"\n\n    __resource_type__ = \"Location\"\n\n    address: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Physical location\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=(\n            \"A list of\\u00a0alternate names that the location is known as, or was known \"\n            \"as in the past\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=(\n            \"Additional details about the location that could be displayed as \"\n            \"further information to identify the location beyond its name\"\n        ),\n        description=(\n            \"Description of the Location, which helps in finding or referencing the\"\n            \" place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to services operated for the \"\n            \"location\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique code or number identifying the location to its users\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"Organization responsible for provisioning and upkeep\",\n        description=(\n            \"The organization responsible for the provisioning and upkeep of the \"\n            \"location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"instance | kind\",\n        description=(\n            \"Indicates whether a resource instance represents a specific location \"\n            \"or a class of locations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"kind\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the location as used by humans\",\n        description=\"Name of the location as used by humans. Does not need to be unique.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    operationalStatus: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"operationalStatus\",\n        title=\"The Operational status of the location (typically only for a bed/room)\",\n        description=(\n            \"The Operational status covers operation values most relevant to beds \"\n            \"(but can also apply to rooms/units/chair/etc such as an isolation \"\n            \"unit/dialisys chair). This typically covers concepts such as \"\n            \"contamination, housekeeping and other activities\\u00a0like maintenance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    partOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Another Location this one is physically part of\",\n        description=\"Another Location which this Location is physically part of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    physicalType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"physicalType\",\n        title=\"Physical form of the location\",\n        description=\"Physical form of the location, e.g. building, room, vehicle, road.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    position: fhirtypes.LocationPositionType | None = Field(\n        default=None,\n        alias=\"position\",\n        title=\"The absolute geographic location\",\n        description=(\n            \"The absolute geographic location of the Location, expressed using the \"\n            \"WGS84 datum (This is the same co-ordinate system used in KML).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | suspended | inactive\",\n        description=(\n            \"The status property covers the general availability of the resource, \"\n            \"not the current value which may be covered by the operationStatus, or \"\n            \"by a schedule/slots if they are configured for the location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"suspended\", \"inactive\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contact details of the location\",\n        description=(\n            \"The contact details of communication devices available at the \"\n            \"location. This can include phone numbers, fax numbers, mobile numbers,\"\n            \" email addresses and web sites.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of function performed\",\n        description=\"Indicates the type of function performed at the location.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Location`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"operationalStatus\",\n            \"name\",\n            \"alias\",\n            \"description\",\n            \"mode\",\n            \"type\",\n            \"telecom\",\n            \"address\",\n            \"physicalType\",\n            \"position\",\n            \"managingOrganization\",\n            \"partOf\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Location`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"operationalStatus\",\n            \"name\",\n            \"description\",\n            \"mode\",\n            \"type\",\n            \"physicalType\",\n            \"managingOrganization\",\n        ]\n\n\nclass LocationPosition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The absolute geographic location.\n    The absolute geographic location of the Location, expressed using the WGS84\n    datum (This is the same co-ordinate system used in KML).\n    \"\"\"\n\n    __resource_type__ = \"LocationPosition\"\n\n    altitude: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"altitude\",\n        title=\"Altitude with WGS84 datum\",\n        description=(\n            \"Altitude. The value domain and the interpretation are the same as for \"\n            \"the text of the altitude element in KML (see notes below).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    altitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_altitude\", title=\"Extension field for ``altitude``.\"\n    )\n\n    latitude: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"latitude\",\n        title=\"Latitude with WGS84 datum\",\n        description=(\n            \"Latitude. The value domain and the interpretation are the same as for \"\n            \"the text of the latitude element in KML (see notes below).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    latitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_latitude\", title=\"Extension field for ``latitude``.\"\n    )\n\n    longitude: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"longitude\",\n        title=\"Longitude with WGS84 datum\",\n        description=(\n            \"Longitude. The value domain and the interpretation are the same as for\"\n            \" the text of the longitude element in KML (see notes below).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    longitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_longitude\", title=\"Extension field for ``longitude``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``LocationPosition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"longitude\",\n            \"latitude\",\n            \"altitude\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``LocationPosition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"latitude\", \"latitude__ext\"),\n            (\"longitude\", \"longitude__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/measure.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Measure\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Measure(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A quality measure definition.\n    The Measure resource provides the definition of a quality measure.\n    \"\"\"\n\n    __resource_type__ = \"Measure\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the measure was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    clinicalRecommendationStatement: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"clinicalRecommendationStatement\",\n        title=\"Summary of clinical guidelines\",\n        description=(\n            \"Provides a summary of relevant clinical guidelines or other clinical \"\n            \"recommendations supporting the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    clinicalRecommendationStatement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_clinicalRecommendationStatement\",\n        title=\"Extension field for ``clinicalRecommendationStatement``.\",\n    )\n\n    compositeScoring: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"compositeScoring\",\n        title=\"opportunity | all-or-nothing | linear | weighted\",\n        description=(\n            \"If this is a composite measure, the scoring method used to combine the\"\n            \" component measures to determine the composite score.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contributor: typing.List[fhirtypes.ContributorType] | None = Field(\n        default=None,\n        alias=\"contributor\",\n        title=\"A content contributor\",\n        description=(\n            \"A contributor to the content of the measure, including authors, \"\n            \"editors, reviewers, and endorsers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the measure and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the measure was published. The \"\n            \"date must change if and when the business version changes and it must \"\n            \"change if the status code changes. In addition, it should change when \"\n            \"the substantive content of the measure changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    definition: typing.List[fhirtypes.MarkdownType | None] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Defined terms used in the measure documentation\",\n        description=\"Provides a description of an individual term used within the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    definition__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the measure\",\n        description=(\n            \"A free text natural language description of the measure from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    disclaimer: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"disclaimer\",\n        title=\"Disclaimer for use of the measure or its referenced content\",\n        description=(\n            \"Notices and disclaimers regarding the use of the measure, or related \"\n            \"to intellectual property (such as code systems) referenced by the \"\n            \"measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    disclaimer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disclaimer\", title=\"Extension field for ``disclaimer``.\"\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the measure is expected to be used\",\n        description=(\n            \"The period during which the measure content was or is planned to be in\"\n            \" active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this measure is authored for testing \"\n            \"purposes (or education/evaluation/marketing), and is not intended to \"\n            \"be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    group: typing.List[fhirtypes.MeasureGroupType] | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"Population criteria group\",\n        description=\"A group of population criteria for the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    guidance: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"guidance\",\n        title=\"Additional guidance for implementers\",\n        description=(\n            \"Additional guidance for the measure including how it can be used in a \"\n            \"clinical context, and the intent of the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    guidance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_guidance\", title=\"Extension field for ``guidance``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the measure\",\n        description=(\n            \"A formal identifier that is used to identify this measure when it is \"\n            \"represented in other formats, or referenced in a specification, model,\"\n            \" design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    improvementNotation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"improvementNotation\",\n        title=(\n            \"Improvement notation for the measure, e.g. higher score indicates \"\n            \"better quality\"\n        ),\n        description=(\n            \"Information on whether an increase or decrease in score is the \"\n            \"preferred result (e.g., a higher score indicates better quality OR a \"\n            \"lower score indicates better quality OR quality is whthin a range).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    improvementNotation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_improvementNotation\",\n        title=\"Extension field for ``improvementNotation``.\",\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for measure (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the measure is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the measure was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval, but doesn't change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    library: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the measure\",\n        description=(\n            \"A reference to a Library resource containing the formal logic used by \"\n            \"the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this measure (computer friendly)\",\n        description=(\n            \"A natural language name identifying the measure. This name should be \"\n            \"usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=\"The name of the individual or organization that published the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this measure is defined\",\n        description=(\n            \"Explaination of why this measure is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    rateAggregation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"rateAggregation\",\n        title=\"How is rate aggregation performed for this measure\",\n        description=(\n            \"Describes how to combine the information calculated, based on logic in\"\n            \" each of several populations, into one summarized result.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rateAggregation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_rateAggregation\",\n        title=\"Extension field for ``rateAggregation``.\",\n    )\n\n    rationale: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"rationale\",\n        title=\"Why does this measure exist\",\n        description=(\n            \"Provides a succint statement of the need for the measure. Usually \"\n            \"includes statements pertaining to importance criterion: impact, gap in\"\n            \" care, and evidence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rationale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rationale\", title=\"Extension field for ``rationale``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    riskAdjustment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"riskAdjustment\",\n        title=\"How is risk adjustment applied for this measure\",\n        description=(\n            \"A description of the risk adjustment factors that may impact the \"\n            \"resulting score for the measure and how they may be accounted for when\"\n            \" computing and reporting measure results.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    riskAdjustment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_riskAdjustment\",\n        title=\"Extension field for ``riskAdjustment``.\",\n    )\n\n    scoring: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"scoring\",\n        title=\"proportion | ratio | continuous-variable | cohort\",\n        description=(\n            \"Indicates how the calculation is performed for the measure, including \"\n            \"proportion, ratio, continuous variable, and cohort. The value set is \"\n            \"extensible, allowing additional measure scoring types to be \"\n            \"represented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    set: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"set\",\n        title=\"The measure set, e.g. Preventive Care and Screening\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    set__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_set\", title=\"Extension field for ``set``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this measure. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    supplementalData: typing.List[fhirtypes.MeasureSupplementalDataType] | None = Field(\n        default=None,\n        alias=\"supplementalData\",\n        title=\"What other data should be reported with the measure\",\n        description=(\n            \"The supplemental data criteria for the measure report, specified as \"\n            \"either the name of a valid CQL expression within a referenced library,\"\n            \" or a valid FHIR Resource Path.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this measure (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptive topics related to the content of the measure. Topics \"\n            \"provide a high-level categorization of the type of the measure that \"\n            \"can be useful for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"process | outcome | structure | patient-reported-outcome | composite\",\n        description=(\n            \"Indicates whether the measure is used to examine a process, an outcome\"\n            \" over time, a patient-reported outcome, or a structure measure such as\"\n            \" utilization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this measure (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this measure when it is \"\n            \"referenced in a specification, model, design or an instance. This \"\n            \"SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at\"\n            \" which this measure is (or will be) published. The URL SHOULD include \"\n            \"the major version of the measure. For more information see [Technical \"\n            \"and Business Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the measure\",\n        description=(\n            \"A detailed description of how the measure is used from a clinical \"\n            \"perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate measure instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the measure\",\n        description=(\n            \"The identifier that is used to identify this version of the measure \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the measure author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence. To provide a version consistent with the Decision Support \"\n            \"Service specification, use the format Major.Minor.Revision (e.g. \"\n            \"1.0.0). For more information on versioning knowledge assets, refer to \"\n            \"the Decision Support Service specification. Note that a version is \"\n            \"required for non-experimental active artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Measure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"description\",\n            \"purpose\",\n            \"usage\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"topic\",\n            \"contributor\",\n            \"contact\",\n            \"copyright\",\n            \"relatedArtifact\",\n            \"library\",\n            \"disclaimer\",\n            \"scoring\",\n            \"compositeScoring\",\n            \"type\",\n            \"riskAdjustment\",\n            \"rateAggregation\",\n            \"rationale\",\n            \"clinicalRecommendationStatement\",\n            \"improvementNotation\",\n            \"definition\",\n            \"guidance\",\n            \"set\",\n            \"group\",\n            \"supplementalData\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Measure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"description\",\n            \"effectivePeriod\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"contact\",\n            \"disclaimer\",\n            \"scoring\",\n            \"compositeScoring\",\n            \"type\",\n            \"riskAdjustment\",\n            \"rateAggregation\",\n            \"rationale\",\n            \"clinicalRecommendationStatement\",\n            \"improvementNotation\",\n            \"definition\",\n            \"guidance\",\n            \"set\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass MeasureGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Population criteria group.\n    A group of population criteria for the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureGroup\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Summary description\",\n        description=\"The human readable description of this population group.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType = Field(\n        default=...,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=(\n            \"A unique identifier for the group. This identifier will used to report\"\n            \" data for the group in the measure report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Short name\",\n        description=\"Optional name or short description of this group.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    population: typing.List[fhirtypes.MeasureGroupPopulationType] | None = Field(\n        default=None,\n        alias=\"population\",\n        title=\"Population criteria\",\n        description=\"A population criteria for the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    stratifier: typing.List[fhirtypes.MeasureGroupStratifierType] | None = Field(\n        default=None,\n        alias=\"stratifier\",\n        title=\"Stratifier criteria for the measure\",\n        description=(\n            \"The stratifier criteria for the measure report, specified as either \"\n            \"the name of a valid CQL expression defined within a referenced \"\n            \"library, or a valid FHIR Resource Path.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"description\",\n            \"population\",\n            \"stratifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureGroupPopulation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Population criteria.\n    A population criteria for the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureGroupPopulation\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"initial-population | numerator | numerator-exclusion | denominator | \"\n            \"denominator-exclusion | denominator-exception | measure-population | \"\n            \"measure-population-exclusion | measure-observation\"\n        ),\n        description=\"The type of population criteria.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    criteria: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"criteria\",\n        title=(\n            \"The name of a valid referenced CQL expression (may be namespaced) that\"\n            \" defines this population criteria\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    criteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_criteria\", title=\"Extension field for ``criteria``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The human readable description of this population criteria\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=(\n            \"A unique identifier for the population criteria. This identifier is \"\n            \"used to report data against this criteria within the measure report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Short name\",\n        description=\"Optional name or short description of this population.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureGroupPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"name\",\n            \"description\",\n            \"criteria\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureGroupPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"criteria\", \"criteria__ext\")]\n        return required_fields\n\n\nclass MeasureGroupStratifier(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratifier criteria for the measure.\n    The stratifier criteria for the measure report, specified as either the\n    name of a valid CQL expression defined within a referenced library, or a\n    valid FHIR Resource Path.\n    \"\"\"\n\n    __resource_type__ = \"MeasureGroupStratifier\"\n\n    criteria: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"criteria\",\n        title=\"How the measure should be stratified\",\n        description=(\n            \"The criteria for the stratifier. This must be the name of an \"\n            \"expression defined within a referenced library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    criteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_criteria\", title=\"Extension field for ``criteria``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"The identifier for the stratifier used to coordinate the reported data\"\n            \" back to this stratifier\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path to the stratifier\",\n        description=(\n            \"The path to an element that defines the stratifier, specified as a \"\n            \"valid FHIR resource path.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureGroupStratifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"criteria\",\n            \"path\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureGroupStratifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureSupplementalData(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What other data should be reported with the measure.\n    The supplemental data criteria for the measure report, specified as either\n    the name of a valid CQL expression within a referenced library, or a valid\n    FHIR Resource Path.\n    \"\"\"\n\n    __resource_type__ = \"MeasureSupplementalData\"\n\n    criteria: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"criteria\",\n        title=\"Expression describing additional data to be reported\",\n        description=(\n            \"The criteria for the supplemental data. This must be the name of a \"\n            \"valid expression defined within a referenced library, and defines the \"\n            \"data to be returned for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    criteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_criteria\", title=\"Extension field for ``criteria``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier, unique within the measure\",\n        description=\"An identifier for the supplemental data.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path to the supplemental data element\",\n        description=(\n            \"The supplemental data to be supplied as part of the measure response, \"\n            \"specified as a valid FHIR Resource Path.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    usage: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"supplemental-data | risk-adjustment-factor\",\n        description=(\n            \"An indicator of the intended usage for the supplemental data element. \"\n            \"Supplemental data indicates the data is additional information \"\n            \"requested to augment the measure information. Risk adjustment factor \"\n            \"indicates the data is additional information used to calculate risk \"\n            \"adjustment factors when applying a risk model to the measure \"\n            \"calculation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureSupplementalData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"usage\",\n            \"criteria\",\n            \"path\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureSupplementalData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/measurereport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MeasureReport\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MeasureReport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Results of a measure evaluation.\n    The MeasureReport resource contains the results of evaluating a measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReport\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the report was generated\",\n        description=\"The date this measure report was generated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    evaluatedResources: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"evaluatedResources\",\n        title=\"What data was evaluated to produce the measure score\",\n        description=(\n            \"A reference to a Bundle containing the Resources that were used in the\"\n            \" evaluation of this report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Bundle\"],\n        },\n    )\n\n    group: typing.List[fhirtypes.MeasureReportGroupType] | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"Measure results for each group\",\n        description=(\n            \"The results of the calculation, one for each population group in the \"\n            \"measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the Report\",\n        description=(\n            \"A formal identifier that is used to identify this report when it is \"\n            \"represented in other formats, or referenced in a specification, model,\"\n            \" design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    measure: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"measure\",\n        title=\"What measure was evaluated\",\n        description=\"A reference to the Measure that was evaluated to produce this report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Measure\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"What patient the report is for\",\n        description=\"Optional Patient if the report was requested for a single patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"What period the report covers\",\n        description=\"The reporting period for which the report was calculated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reportingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reportingOrganization\",\n        title=\"Who is reporting the data\",\n        description=\"Reporting Organization.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"complete | pending | error\",\n        description=(\n            \"The report status. No data will be available until the report status \"\n            \"is complete.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"complete\", \"pending\", \"error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"individual | patient-list | summary\",\n        description=(\n            \"The type of measure report. This may be an individual report, which \"\n            \"provides a single patient's score for the measure; a patient listing, \"\n            \"which returns the list of patients that meet the various criteria in \"\n            \"the measure; or a summary report, which returns a population count for\"\n            \" each of the criteria in the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"individual\", \"patient-list\", \"summary\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"measure\",\n            \"patient\",\n            \"date\",\n            \"reportingOrganization\",\n            \"period\",\n            \"group\",\n            \"evaluatedResources\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"measure\",\n            \"patient\",\n            \"date\",\n            \"reportingOrganization\",\n            \"period\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass MeasureReportGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Measure results for each group.\n    The results of the calculation, one for each population group in the\n    measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroup\"\n\n    identifier: fhirtypes.IdentifierType = Field(\n        default=...,\n        alias=\"identifier\",\n        title=\"What group of the measure\",\n        description=(\n            \"The identifier of the population group as defined in the measure \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    measureScore: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"measureScore\",\n        title=\"What score this group achieved\",\n        description=(\n            \"The measure score for this population group, calculated as appropriate\"\n            \" for the measure type and scoring method, and based on the contents of\"\n            \" the populations defined in the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    measureScore__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_measureScore\",\n        title=\"Extension field for ``measureScore``.\",\n    )\n\n    population: typing.List[fhirtypes.MeasureReportGroupPopulationType] | None = Field(\n        default=None,\n        alias=\"population\",\n        title=\"The populations in the group\",\n        description=(\n            \"The populations that make up the population group, one for each type \"\n            \"of population appropriate for the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    stratifier: typing.List[fhirtypes.MeasureReportGroupStratifierType] | None = Field(\n        default=None,\n        alias=\"stratifier\",\n        title=\"Stratification results\",\n        description=(\n            \"When a measure includes multiple stratifiers, there will be a \"\n            \"stratifier group for each stratifier defined by the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"population\",\n            \"measureScore\",\n            \"stratifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"measureScore\"]\n\n\nclass MeasureReportGroupPopulation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The populations in the group.\n    The populations that make up the population group, one for each type of\n    population appropriate for the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupPopulation\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"initial-population | numerator | numerator-exclusion | denominator | \"\n            \"denominator-exclusion | denominator-exception | measure-population | \"\n            \"measure-population-exclusion | measure-score\"\n        ),\n        description=\"The type of the population.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    count: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Size of the population\",\n        description=\"The number of members of the population.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Population identifier as defined in the measure\",\n        description=(\n            \"The identifier of the population being reported, as defined by the \"\n            \"population element of the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patients: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patients\",\n        title=\"For patient-list reports, the patients in this population\",\n        description=(\n            \"This element refers to a List of patient level MeasureReport \"\n            \"resources, one for each patient in this population.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"List\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"count\",\n            \"patients\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"code\"]\n\n\nclass MeasureReportGroupStratifier(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratification results.\n    When a measure includes multiple stratifiers, there will be a stratifier\n    group for each stratifier defined by the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupStratifier\"\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"What stratifier of the group\",\n        description=(\n            \"The identifier of this stratifier, as defined in the measure \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    stratum: typing.List[\n        fhirtypes.MeasureReportGroupStratifierStratumType\n    ] | None = Field(\n        default=None,\n        alias=\"stratum\",\n        title=\"Stratum results, one for each unique value in the stratifier\",\n        description=(\n            \"This element contains the results for a single stratum within the \"\n            \"stratifier. For example, when stratifying on administrative gender, \"\n            \"there will be four strata, one for each possible gender value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupStratifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"identifier\", \"stratum\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureReportGroupStratifierStratum(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratum results, one for each unique value in the stratifier.\n    This element contains the results for a single stratum within the\n    stratifier. For example, when stratifying on administrative gender, there\n    will be four strata, one for each possible gender value.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupStratifierStratum\"\n\n    measureScore: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"measureScore\",\n        title=\"What score this stratum achieved\",\n        description=(\n            \"The measure score for this stratum, calculated as appropriate for the \"\n            \"measure type and scoring method, and based on only the members of this\"\n            \" stratum.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    measureScore__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_measureScore\",\n        title=\"Extension field for ``measureScore``.\",\n    )\n\n    population: typing.List[\n        fhirtypes.MeasureReportGroupStratifierStratumPopulationType\n    ] | None = Field(\n        default=None,\n        alias=\"population\",\n        title=\"Population results in this stratum\",\n        description=(\n            \"The populations that make up the stratum, one for each type of \"\n            \"population appropriate to the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The stratum value, e.g. male\",\n        description=(\n            \"The value for this stratum, expressed as a string. When defining \"\n            \"stratifiers on complex values, the value must be rendered such that \"\n            \"the value for each stratum within the stratifier is unique.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupStratifierStratum`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"value\",\n            \"population\",\n            \"measureScore\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratum`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"measureScore\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass MeasureReportGroupStratifierStratumPopulation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Population results in this stratum.\n    The populations that make up the stratum, one for each type of population\n    appropriate to the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupStratifierStratumPopulation\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"initial-population | numerator | numerator-exclusion | denominator | \"\n            \"denominator-exclusion | denominator-exception | measure-population | \"\n            \"measure-population-exclusion | measure-score\"\n        ),\n        description=\"The type of the population.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    count: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Size of the population\",\n        description=\"The number of members of the population in this stratum.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Population identifier as defined in the measure\",\n        description=(\n            \"The identifier of the population being reported, as defined by the \"\n            \"population element of the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patients: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patients\",\n        title=\"For patient-list reports, the patients in this population\",\n        description=(\n            \"This element refers to a List of patient level MeasureReport \"\n            \"resources, one for each patient in this population in this stratum.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"List\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupStratifierStratumPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"count\",\n            \"patients\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratumPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/STU3/media.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Media\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Media(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A photo, video, or audio recording acquired or used in healthcare. The\n    actual content may be inline or provided by direct reference.\n    \"\"\"\n\n    __resource_type__ = \"Media\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Procedure that caused this media to be created\",\n        description=(\n            \"A procedure that is fulfilled in whole or in part by the creation of \"\n            \"this media.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ProcedureRequest\"],\n        },\n    )\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Body part in media\",\n        description=(\n            \"Indicates the site on the subject's body where the media was collected\"\n            \" (i.e. the target site).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    content: fhirtypes.AttachmentType = Field(\n        default=...,\n        alias=\"content\",\n        title=\"Actual Media - reference or data\",\n        description=(\n            \"The actual content of the media - inline or by direct reference to the\"\n            \" media source file.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter / Episode associated with media\",\n        description=(\n            \"The encounter or episode of care that establishes the context for this\"\n            \" media.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Observing Device\",\n        description=\"The device used to collect the media.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"DeviceMetric\"],\n        },\n    )\n\n    duration: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"Length in seconds (audio / video)\",\n        description=\"The duration of the recording in seconds - for audio and video.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    duration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_duration\", title=\"Extension field for ``duration``.\"\n    )\n\n    frames: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"frames\",\n        title=\"Number of frames if > 1 (photo)\",\n        description=(\n            \"The number of frames in a photo. This is used with a multi-page fax, \"\n            \"or an imaging acquisition context that takes multiple slices in a \"\n            \"single image, or an animated gif. If there is more than one frame, \"\n            \"this SHALL have a value in order to alert interface software that a \"\n            \"multi-frame capable rendering widget is required.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    frames__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_frames\", title=\"Extension field for ``frames``.\"\n    )\n\n    height: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"height\",\n        title=\"Height of the image in pixels (photo/video)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    height__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_height\", title=\"Extension field for ``height``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier(s) for the image\",\n        description=(\n            \"Identifiers associated with the image - these may include identifiers \"\n            \"for the image itself, identifiers for the context of its collection \"\n            \"(e.g. series ids) and context ids such as accession numbers or other \"\n            \"workflow identifiers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the media\",\n        description=(\n            \"Comments made about the media by the performer, subject or other \"\n            \"participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When Media was collected\",\n        description=\"The date and time(s) at which the media was collected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When Media was collected\",\n        description=\"The date and time(s) at which the media was collected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    operator: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"operator\",\n        title=\"The person who generated the image\",\n        description=\"The person who administered the collection of the image.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Why was event performed?\",\n        description=\"Describes why the event occurred in coded or textual form.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who/What this Media is a record of\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"Group\",\n                \"Device\",\n                \"Specimen\",\n            ],\n        },\n    )\n\n    subtype: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subtype\",\n        title=\"The type of acquisition equipment/process\",\n        description=(\n            \"Details of the type of the media - usually, how it was acquired (what \"\n            \"type of device). If images sourced from a DICOM system, are wrapped in\"\n            \" a Media resource, then this is the modality.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"photo | video | audio\",\n        description=(\n            \"Whether the media is a photo (still image), an audio recording, or a \"\n            \"video recording.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"photo\", \"video\", \"audio\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    view: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"view\",\n        title=\"Imaging view, e.g. Lateral or Antero-posterior\",\n        description=\"The name of the imaging view e.g. Lateral or Antero-posterior (AP).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    width: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"width\",\n        title=\"Width of the image in pixels (photo/video)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    width__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_width\", title=\"Extension field for ``width``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Media`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"type\",\n            \"subtype\",\n            \"view\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"operator\",\n            \"reasonCode\",\n            \"bodySite\",\n            \"device\",\n            \"height\",\n            \"width\",\n            \"frames\",\n            \"duration\",\n            \"content\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Media`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"basedOn\",\n            \"type\",\n            \"subtype\",\n            \"view\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"operator\",\n            \"reasonCode\",\n            \"bodySite\",\n            \"device\",\n            \"height\",\n            \"width\",\n            \"frames\",\n            \"duration\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/medication.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Medication\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Medication(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a Medication.\n    This resource is primarily used for the identification and definition of a\n    medication. It covers the ingredients and the packaging for a medication.\n    \"\"\"\n\n    __resource_type__ = \"Medication\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Codes that identify this medication\",\n        description=(\n            \"A code (or set of codes) that specify this medication, or a textual \"\n            \"description if no code is available. Usage note: This could be a \"\n            \"standard medication code such as a code from RxNorm, SNOMED CT, IDMP \"\n            \"etc. It could also be a national or local formulary code, optionally \"\n            \"with translations to other code systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"powder | tablets | capsule +\",\n        description=\"Describes the form of the item.  Powder; tablets; capsule.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    image: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"image\",\n        title=\"Picture of the medication\",\n        description=\"Photo(s) or graphic representation(s) of the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.MedicationIngredientType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=\"Active or inactive ingredient\",\n        description=\"Identifies a particular constituent of interest in the product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    isBrand: bool | None = Field(\n        default=None,\n        alias=\"isBrand\",\n        title=\"True if a brand\",\n        description=\"Set to true if the item is attributable to a specific manufacturer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isBrand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isBrand\", title=\"Extension field for ``isBrand``.\"\n    )\n\n    isOverTheCounter: bool | None = Field(\n        default=None,\n        alias=\"isOverTheCounter\",\n        title=\"True if medication does not require a prescription\",\n        description=(\n            \"Set to true if the medication can be obtained without an order from a \"\n            \"prescriber.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isOverTheCounter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_isOverTheCounter\",\n        title=\"Extension field for ``isOverTheCounter``.\",\n    )\n\n    manufacturer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Manufacturer of the item\",\n        description=(\n            \"Describes the details of the manufacturer of the medication product.  \"\n            \"This is not intended to represent the distributor of a medication \"\n            \"product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    package: fhirtypes.MedicationPackageType | None = Field(\n        default=None,\n        alias=\"package\",\n        title=\"Details about packaged medications\",\n        description=\"Information that only applies to packages (not products).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=\"A code to indicate if the medication is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Medication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"status\",\n            \"isBrand\",\n            \"isOverTheCounter\",\n            \"manufacturer\",\n            \"form\",\n            \"ingredient\",\n            \"package\",\n            \"image\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Medication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"code\",\n            \"status\",\n            \"isBrand\",\n            \"isOverTheCounter\",\n            \"manufacturer\",\n        ]\n\n\nclass MedicationIngredient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Active or inactive ingredient.\n    Identifies a particular constituent of interest in the product.\n    \"\"\"\n\n    __resource_type__ = \"MedicationIngredient\"\n\n    amount: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Quantity of ingredient present\",\n        description=(\n            \"Specifies how many (or how much) of the items there are in this \"\n            \"Medication.  For example, 250 mg per tablet.  This is expressed as a \"\n            \"ratio where the numerator is 250mg and the denominator is 1 tablet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    isActive: bool | None = Field(\n        default=None,\n        alias=\"isActive\",\n        title=\"Active ingredient indicator\",\n        description=(\n            \"Indication of whether this\\u00a0ingredient affects\\u00a0the therapeutic action \"\n            \"of the drug.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    isActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isActive\", title=\"Extension field for ``isActive``.\"\n    )\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"The product contained\",\n        description=(\n            \"The actual ingredient - either a substance (simple ingredient) or \"\n            \"another medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"The product contained\",\n        description=(\n            \"The actual ingredient - either a substance (simple ingredient) or \"\n            \"another medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\", \"Medication\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n            \"itemReference\",\n            \"isActive\",\n            \"amount\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n\n\nclass MedicationPackage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details about packaged medications.\n    Information that only applies to packages (not products).\n    \"\"\"\n\n    __resource_type__ = \"MedicationPackage\"\n\n    batch: typing.List[fhirtypes.MedicationPackageBatchType] | None = Field(\n        default=None,\n        alias=\"batch\",\n        title=\"Identifies a single production run\",\n        description=(\n            \"Information about a group of medication produced or packaged from one \"\n            \"production run.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    container: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"container\",\n        title=\"E.g. box, vial, blister-pack\",\n        description=\"The kind of container that this package comes as.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    content: typing.List[fhirtypes.MedicationPackageContentType] | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"What is  in the package\",\n        description=\"A set of components that go to make up the described item.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationPackage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"container\", \"content\", \"batch\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationPackage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationPackageBatch(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Identifies a single production run.\n    Information about a group of medication produced or packaged from one\n    production run.\n    \"\"\"\n\n    __resource_type__ = \"MedicationPackageBatch\"\n\n    expirationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expirationDate\",\n        title=\"When batch will expire\",\n        description=\"When this specific batch of product will expire.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_expirationDate\",\n        title=\"Extension field for ``expirationDate``.\",\n    )\n\n    lotNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lotNumber\",\n        title=\"Identifier assigned to batch\",\n        description=\"The assigned lot number of a batch of the specified product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lotNumber\", title=\"Extension field for ``lotNumber``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationPackageBatch`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"lotNumber\", \"expirationDate\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationPackageBatch`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationPackageContent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What is  in the package.\n    A set of components that go to make up the described item.\n    \"\"\"\n\n    __resource_type__ = \"MedicationPackageContent\"\n\n    amount: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Quantity present in the package\",\n        description=\"The amount of the product that is in the package.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"The item in the package\",\n        description=\"Identifies one of the items in the package.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"The item in the package\",\n        description=\"Identifies one of the items in the package.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationPackageContent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n            \"amount\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationPackageContent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/medicationadministration.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationAdministration\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicationAdministration(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Administration of medication to a patient.\n    Describes the event of a patient consuming or otherwise being administered\n    a medication.  This may be as simple as swallowing a tablet or it may be a\n    long running infusion.  Related resources tie this event to the authorizing\n    prescription, and the specific encounter between patient and health care\n    practitioner.\n    \"\"\"\n\n    __resource_type__ = \"MedicationAdministration\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of medication usage\",\n        description=(\n            \"Indicates the type of medication administration and where the \"\n            \"medication is expected to be consumed or administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or Episode of Care administered as part of\",\n        description=(\n            \"The visit, admission or other contact between patient and health care \"\n            \"provider the medication administration was performed as part of.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    definition: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Instantiates protocol or definition\",\n        description=(\n            \"A protocol, guideline, orderset or other definition that was adhered \"\n            \"to in whole or in part by this event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PlanDefinition\", \"ActivityDefinition\"],\n        },\n    )\n\n    device: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Device used to administer\",\n        description=(\n            \"The device used in administering the medication to the patient.  For \"\n            \"example, a particular infusion pump.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    dosage: fhirtypes.MedicationAdministrationDosageType | None = Field(\n        default=None,\n        alias=\"dosage\",\n        title=\"Details of how medication was taken\",\n        description=(\n            \"Describes the medication dosage information details e.g. dose, rate, \"\n            \"site, route, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"Start and end time of administration\",\n        description=(\n            \"A specific date/time or interval of time during which the \"\n            \"administration took place (or did not take place, when the 'notGiven' \"\n            \"attribute is true). For many administrations, such as swallowing a \"\n            \"tablet the use of dateTime is more appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": True,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"Start and end time of administration\",\n        description=(\n            \"A specific date/time or interval of time during which the \"\n            \"administration took place (or did not take place, when the 'notGiven' \"\n            \"attribute is true). For many administrations, such as swallowing a \"\n            \"tablet the use of dateTime is more appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"eventHistory\",\n        title=\"A list of events of interest in the lifecycle\",\n        description=(\n            \"A summary of the events of interest that have occurred, such as when \"\n            \"the administration was verified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"External identifier - FHIR will generate its own internal identifiers \"\n            \"(probably URLs) which do not need to be explicitly managed by the \"\n            \"resource.  The identifier here is one that would be used by another \"\n            \"non-FHIR system - for example an automated medication pump would \"\n            \"provide a record each time it operated; an administration while the \"\n            \"patient was off the ward might be made with a different system and \"\n            \"entered after the event.  Particularly important if these records have\"\n            \" to be updated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"medicationCodeableConcept\",\n        title=\"What was administered\",\n        description=(\n            \"Identifies the medication that was administered. This is either a link\"\n            \" to a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    medicationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"medicationReference\",\n        title=\"What was administered\",\n        description=(\n            \"Identifies the medication that was administered. This is either a link\"\n            \" to a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    notGiven: bool | None = Field(\n        default=None,\n        alias=\"notGiven\",\n        title=\"True if medication not administered\",\n        description=(\n            \"Set this to true if the record is saying that the medication was NOT \"\n            \"administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    notGiven__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_notGiven\", title=\"Extension field for ``notGiven``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Information about the administration\",\n        description=(\n            \"Extra information about the medication administration that is not \"\n            \"conveyed by the other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=\"A larger event of which this particular event is a component or step.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationAdministration\", \"Procedure\"],\n        },\n    )\n\n    performer: typing.List[\n        fhirtypes.MedicationAdministrationPerformerType\n    ] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who administered substance\",\n        description=(\n            \"The individual who was responsible for giving the medication to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    prescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"prescription\",\n        title=\"Request administration performed against\",\n        description=(\n            \"The original request, instruction or authority to perform the \"\n            \"administration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Reason administration performed\",\n        description=\"A code indicating why the medication was given.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonNotGiven: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonNotGiven\",\n        title=\"Reason administration not performed\",\n        description=\"A code indicating why the administration was not performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=(\n            \"Condition or Observation that supports why the medication was \"\n            \"administered\"\n        ),\n        description=(\n            \"Condition or observation that supports why the medication was \"\n            \"administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"in-progress | on-hold | completed | entered-in-error | stopped | \"\n            \"unknown\"\n        ),\n        description=(\n            \"Will generally be set to show that the administration has been \"\n            \"completed.  For some long running administrations such as infusions it\"\n            \" is possible for an administration to be started but not completed or \"\n            \"it may be paused while some other process is under way.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"in-progress\",\n                \"on-hold\",\n                \"completed\",\n                \"entered-in-error\",\n                \"stopped\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who received medication\",\n        description=\"The person or animal or group receiving the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Additional information to support administration\",\n        description=(\n            \"Additional information (for example, patient height and weight) that \"\n            \"supports the administration of the medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definition\",\n            \"partOf\",\n            \"status\",\n            \"category\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"context\",\n            \"supportingInformation\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"performer\",\n            \"notGiven\",\n            \"reasonNotGiven\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"prescription\",\n            \"device\",\n            \"note\",\n            \"dosage\",\n            \"eventHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"definition\",\n            \"partOf\",\n            \"status\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"performer\",\n            \"notGiven\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"effective\": [\"effectiveDateTime\", \"effectivePeriod\"],\n            \"medication\": [\"medicationCodeableConcept\", \"medicationReference\"],\n        }\n        return one_of_many_fields\n\n\nclass MedicationAdministrationDosage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of how medication was taken.\n    Describes the medication dosage information details e.g. dose, rate, site,\n    route, etc.\n    \"\"\"\n\n    __resource_type__ = \"MedicationAdministrationDosage\"\n\n    dose: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"dose\",\n        title=\"Amount of medication per dose\",\n        description=(\n            \"The amount of the medication given at one administration event.   Use \"\n            \"this value when the administration is essentially an instantaneous \"\n            \"event such as a swallowing a tablet or giving an injection.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"How drug was administered\",\n        description=(\n            \"A coded value indicating the method by which the medication is \"\n            \"intended to be or was introduced into or on the body.  This attribute \"\n            \"will most often NOT be populated.  It is most commonly used for \"\n            \"injections.  For example, Slow Push, Deep IV.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rateQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"rateQuantity\",\n        title=\"Dose quantity per unit of time\",\n        description=(\n            \"Identifies the speed with which the medication was or will be \"\n            \"introduced into the patient.  Typically the rate for an infusion e.g. \"\n            \"100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per \"\n            \"unit of time e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or\"\n            \" 200 mcg/1 minute; 1 liter/8 hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"rateRatio\",\n        title=\"Dose quantity per unit of time\",\n        description=(\n            \"Identifies the speed with which the medication was or will be \"\n            \"introduced into the patient.  Typically the rate for an infusion e.g. \"\n            \"100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per \"\n            \"unit of time e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or\"\n            \" 200 mcg/1 minute; 1 liter/8 hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    route: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"route\",\n        title=\"Path of substance into body\",\n        description=(\n            \"A code specifying the route or physiological path of administration of\"\n            \" a therapeutic agent into or onto the patient.  For example, topical, \"\n            \"intravenous, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    site: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Body site administered to\",\n        description=(\n            \"A coded specification of the anatomic site where the medication first \"\n            'entered the body.  For example, \"left arm\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Free text dosage instructions e.g. SIG\",\n        description=(\n            \"Free text dosage can be used for cases where the dosage administered \"\n            \"is too complex to code. When coded dosage is present, the free text \"\n            \"dosage may still be present for display to humans.  The dosage \"\n            \"instructions should reflect the dosage of the medication that was \"\n            \"administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationAdministrationDosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"text\",\n            \"site\",\n            \"route\",\n            \"method\",\n            \"dose\",\n            \"rateRatio\",\n            \"rateQuantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationAdministrationDosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"rate\": [\"rateQuantity\", \"rateRatio\"]}\n        return one_of_many_fields\n\n\nclass MedicationAdministrationPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who administered substance.\n    The individual who was responsible for giving the medication to the\n    patient.\n    \"\"\"\n\n    __resource_type__ = \"MedicationAdministrationPerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual who was performing\",\n        description=\"The device, practitioner, etc. who performed the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization organization was acting for\",\n        description=\"The organization the device or practitioner was acting on behalf of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationAdministrationPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"actor\", \"onBehalfOf\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationAdministrationPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"actor\"]\n"
  },
  {
    "path": "fhir/resources/STU3/medicationdispense.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationDispense\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicationDispense(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dispensing a medication to a named patient.\n    Indicates that a medication product is to be or has been dispensed for a\n    named person/patient.  This includes a description of the medication\n    product (supply) provided and the instructions for administering the\n    medication.  The medication dispense is the result of a pharmacy system\n    responding to a medication order.\n    \"\"\"\n\n    __resource_type__ = \"MedicationDispense\"\n\n    authorizingPrescription: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"authorizingPrescription\",\n        title=\"Medication order that authorizes the dispense\",\n        description=\"Indicates the medication order that is being dispensed against.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of medication dispense\",\n        description=(\n            \"Indicates type of medication dispense and where the medication is \"\n            \"expected to be consumed or administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter / Episode associated with event\",\n        description=(\n            \"The encounter or episode of care that establishes the context for this\"\n            \" event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    daysSupply: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"daysSupply\",\n        title=\"Amount of medication expressed as a timing amount\",\n        description=\"The amount of medication expressed as a timing amount.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    destination: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Where the medication was sent\",\n        description=(\n            \"Identification of the facility/location where the medication was \"\n            \"shipped to, as part of the dispense event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    detectedIssue: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"detectedIssue\",\n        title=\"Clinical issue with action\",\n        description=(\n            \"Indicates an actual or potential clinical issue with or between one or\"\n            \" more active or proposed clinical actions for a patient; e.g. Drug-\"\n            \"drug interaction, duplicate therapy, dosage alert etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DetectedIssue\"],\n        },\n    )\n\n    dosageInstruction: typing.List[fhirtypes.DosageType] | None = Field(\n        default=None,\n        alias=\"dosageInstruction\",\n        title=(\n            \"How the medication is to be used by the patient or administered by the\"\n            \" caregiver\"\n        ),\n        description=\"Indicates how the medication is to be used by the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"eventHistory\",\n        title=\"A list of releveant lifecycle events\",\n        description=(\n            \"A summary of the events of interest that have occurred, such as when \"\n            \"the dispense was verified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifier assigned by the dispensing facility - this is an identifier\"\n            \" assigned outside FHIR.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"medicationCodeableConcept\",\n        title=\"What medication was supplied\",\n        description=(\n            \"Identifies the medication being administered. This is either a link to\"\n            \" a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    medicationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"medicationReference\",\n        title=\"What medication was supplied\",\n        description=(\n            \"Identifies the medication being administered. This is either a link to\"\n            \" a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    notDone: bool | None = Field(\n        default=None,\n        alias=\"notDone\",\n        title=\"Whether the dispense was or was not performed\",\n        description=\"True if the dispense was not performed for some reason.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    notDone__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_notDone\", title=\"Extension field for ``notDone``.\"\n    )\n\n    notDoneReasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"notDoneReasonCodeableConcept\",\n        title=\"Why a dispense was not performed\",\n        description=\"Indicates the reason why a dispense was not performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e notDoneReason[x]\n            \"one_of_many\": \"notDoneReason\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    notDoneReasonReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"notDoneReasonReference\",\n        title=\"Why a dispense was not performed\",\n        description=\"Indicates the reason why a dispense was not performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e notDoneReason[x]\n            \"one_of_many\": \"notDoneReason\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DetectedIssue\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Information about the dispense\",\n        description=(\n            \"Extra information about the dispense that could not be conveyed in the\"\n            \" other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Event that dispense is part of\",\n        description=\"The procedure that the dispense is done because of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.MedicationDispensePerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed event\",\n        description=(\n            \"Indicates who or what performed the event.  It should be assumed that \"\n            \"the performer is the dispenser of the medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount dispensed\",\n        description=(\n            \"The amount of medication that has been dispensed. Includes unit of \"\n            \"measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    receiver: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"receiver\",\n        title=\"Who collected the medication\",\n        description=(\n            \"Identifies the person who picked up the medication.  This will usually\"\n            \" be a patient or their caregiver, but some cases exist where it can be\"\n            \" a healthcare professional.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | on-hold | completed | entered-in-error | \"\n            \"stopped\"\n        ),\n        description=\"A code specifying the state of the set of dispense events.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"on-hold\",\n                \"completed\",\n                \"entered-in-error\",\n                \"stopped\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who the dispense is for\",\n        description=(\n            \"A link to a resource representing the person or the group to whom the \"\n            \"medication will be given.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    substitution: fhirtypes.MedicationDispenseSubstitutionType | None = Field(\n        default=None,\n        alias=\"substitution\",\n        title=\"Whether a substitution was performed on the dispense\",\n        description=(\n            \"Indicates whether or not substitution was made as part of the \"\n            \"dispense.  In some cases substitution will be expected but does not \"\n            \"happen, in other cases substitution is not expected but does happen.  \"\n            \"This block explains what substitution did or did not happen and why.  \"\n            \"If nothing is specified, substitution was not done.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Information that supports the dispensing of the medication\",\n        description=\"Additional information that supports the medication being dispensed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Trial fill, partial fill, emergency fill, etc.\",\n        description=(\n            \"Indicates the type of dispensing event that is performed. For example,\"\n            \" Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, \"\n            \"Samples, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    whenHandedOver: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenHandedOver\",\n        title=\"When product was given out\",\n        description=(\n            \"The time the dispensed product was provided to the patient or their \"\n            \"representative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    whenHandedOver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenHandedOver\",\n        title=\"Extension field for ``whenHandedOver``.\",\n    )\n\n    whenPrepared: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenPrepared\",\n        title=\"When product was packaged and reviewed\",\n        description=\"The time when the dispensed product was packaged and reviewed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    whenPrepared__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenPrepared\",\n        title=\"Extension field for ``whenPrepared``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"partOf\",\n            \"status\",\n            \"category\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"context\",\n            \"supportingInformation\",\n            \"performer\",\n            \"authorizingPrescription\",\n            \"type\",\n            \"quantity\",\n            \"daysSupply\",\n            \"whenPrepared\",\n            \"whenHandedOver\",\n            \"destination\",\n            \"receiver\",\n            \"note\",\n            \"dosageInstruction\",\n            \"substitution\",\n            \"detectedIssue\",\n            \"notDone\",\n            \"notDoneReasonCodeableConcept\",\n            \"notDoneReasonReference\",\n            \"eventHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"whenPrepared\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"medication\": [\"medicationCodeableConcept\", \"medicationReference\"],\n            \"notDoneReason\": [\"notDoneReasonCodeableConcept\", \"notDoneReasonReference\"],\n        }\n        return one_of_many_fields\n\n\nclass MedicationDispensePerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed event.\n    Indicates who or what performed the event.  It should be assumed that the\n    performer is the dispenser of the medication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationDispensePerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual who was performing\",\n        description=(\n            \"The device, practitioner, etc. who performed the action.  It should be\"\n            \" assumed that the actor is the dispenser of the medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization organization was acting for\",\n        description=\"The organization the device or practitioner was acting on behalf of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationDispensePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"actor\", \"onBehalfOf\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationDispensePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationDispenseSubstitution(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Whether a substitution was performed on the dispense.\n    Indicates whether or not substitution was made as part of the dispense.  In\n    some cases substitution will be expected but does not happen, in other\n    cases substitution is not expected but does happen.  This block explains\n    what substitution did or did not happen and why.  If nothing is specified,\n    substitution was not done.\n    \"\"\"\n\n    __resource_type__ = \"MedicationDispenseSubstitution\"\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why was substitution made\",\n        description=(\n            \"Indicates the reason for the substitution of (or lack of substitution)\"\n            \" from what was prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    responsibleParty: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"responsibleParty\",\n        title=\"Who is responsible for the substitution\",\n        description=(\n            \"The person or organization that has primary responsibility for the \"\n            \"substitution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Code signifying whether a different drug was dispensed from what was \"\n            \"prescribed\"\n        ),\n        description=(\n            \"A code signifying whether a different drug was dispensed from what was\"\n            \" prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    wasSubstituted: bool | None = Field(\n        default=None,\n        alias=\"wasSubstituted\",\n        title=\"Whether a substitution was or was not performed on the dispense\",\n        description=(\n            \"True if the dispenser dispensed a different drug or product from what \"\n            \"was prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    wasSubstituted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_wasSubstituted\",\n        title=\"Extension field for ``wasSubstituted``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationDispenseSubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"wasSubstituted\",\n            \"type\",\n            \"reason\",\n            \"responsibleParty\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationDispenseSubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"wasSubstituted\", \"wasSubstituted__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/medicationrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationRequest\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicationRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Ordering of medication for patient or group.\n    An order or request for both supply of the medication and the instructions\n    for administration of the medication to a patient. The resource is called\n    \"MedicationRequest\" rather than \"MedicationPrescription\" or\n    \"MedicationOrder\" to generalize the use across inpatient and outpatient\n    settings, including care plans, etc., and to harmonize with workflow\n    patterns.\n    \"\"\"\n\n    __resource_type__ = \"MedicationRequest\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When request was initially authored\",\n        description=(\n            \"The date (and perhaps time) when the prescription was initially \"\n            \"written or authored on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What request fulfills\",\n        description=(\n            \"A plan or request that is fulfilled in whole or in part by this \"\n            \"medication request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"MedicationRequest\",\n                \"ProcedureRequest\",\n                \"ReferralRequest\",\n            ],\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of medication usage\",\n        description=(\n            \"Indicates the type of medication order and where the medication is \"\n            \"expected to be consumed or administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Created during encounter/admission/stay\",\n        description=(\n            \"A link to an encounter, or episode of care, that identifies the \"\n            \"particular occurrence or set occurrences of contact between patient \"\n            \"and health care provider.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    definition: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Protocol or definition\",\n        description=\"Protocol or definition followed by this request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n\n    detectedIssue: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"detectedIssue\",\n        title=\"Clinical Issue with action\",\n        description=(\n            \"Indicates an actual or potential clinical issue with or between one or\"\n            \" more active or proposed clinical actions for a patient; e.g. Drug-\"\n            \"drug interaction, duplicate therapy, dosage alert etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DetectedIssue\"],\n        },\n    )\n\n    dispenseRequest: fhirtypes.MedicationRequestDispenseRequestType | None = Field(\n        default=None,\n        alias=\"dispenseRequest\",\n        title=\"Medication supply authorization\",\n        description=(\n            \"Indicates the specific details for the dispense or medication supply \"\n            \"part of a medication request (also known as a Medication Prescription \"\n            \"or Medication Order).  Note that this information is not always sent \"\n            \"with the order.  There may be in some settings (e.g. hospitals) \"\n            \"institutional or system support for completing the dispense details in\"\n            \" the pharmacy department.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dosageInstruction: typing.List[fhirtypes.DosageType] | None = Field(\n        default=None,\n        alias=\"dosageInstruction\",\n        title=\"How the medication should be taken\",\n        description=\"Indicates how the medication is to be used by the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"eventHistory\",\n        title=\"A list of events of interest in the lifecycle\",\n        description=(\n            \"Links to Provenance records for past versions of this resource or \"\n            \"fulfilling request or event resources that identify key state \"\n            \"transitions or updates that are likely to be relevant to a user \"\n            \"looking at the current version of the resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Composite request this is part of\",\n        description=(\n            \"A shared identifier common to all requests that were authorized more \"\n            \"or less simultaneously by a single author, representing the identifier\"\n            \" of the requisition or prescription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External ids for this request\",\n        description=(\n            \"This records identifiers associated with this medication request that \"\n            \"are defined by business processes and/or used to refer to it when a \"\n            \"direct URL reference to the resource itself is not appropriate. For \"\n            \"example a re-imbursement system might issue its own id for each \"\n            \"prescription that is created.  This is particularly important where \"\n            \"FHIR only provides part of an entire workflow process where records \"\n            \"must be tracked through an entire system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=\"proposal | plan | order | instance-order\",\n        description=\"Whether the request is a proposal, plan, or an original order.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"proposal\", \"plan\", \"order\", \"instance-order\"],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"medicationCodeableConcept\",\n        title=\"Medication to be taken\",\n        description=(\n            \"Identifies the medication being requested. This is a link to a \"\n            \"resource that represents the medication which may be the details of \"\n            \"the medication or simply an attribute carrying a code that identifies \"\n            \"the medication from a known list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    medicationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"medicationReference\",\n        title=\"Medication to be taken\",\n        description=(\n            \"Identifies the medication being requested. This is a link to a \"\n            \"resource that represents the medication which may be the details of \"\n            \"the medication or simply an attribute carrying a code that identifies \"\n            \"the medication from a known list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Information about the prescription\",\n        description=(\n            \"Extra information about the prescription that could not be conveyed by\"\n            \" the other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priorPrescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"priorPrescription\",\n        title=\"An order/prescription that is being replaced\",\n        description=(\n            \"A link to a resource representing an earlier order related order or \"\n            \"prescription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | stat | asap\",\n        description=(\n            \"Indicates how quickly the Medication Request should be addressed with \"\n            \"respect to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"stat\", \"asap\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Reason or indication for writing the prescription\",\n        description=\"The reason or the indication for ordering the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=(\n            \"Condition or Observation that supports why the prescription is being \"\n            \"written\"\n        ),\n        description=\"Condition or observation that supports why the medication was ordered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    recorder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recorder\",\n        title=\"Person who entered the request\",\n        description=(\n            \"The person who entered the order on behalf of another individual for \"\n            \"example in the case of a verbal or a telephone order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    requester: fhirtypes.MedicationRequestRequesterType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/What requested the Request\",\n        description=(\n            \"The individual, organization or device that initiated the request and \"\n            \"has responsibility for its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"active | on-hold | cancelled | completed | entered-in-error | stopped \"\n            \"| draft | unknown\"\n        ),\n        description=(\n            \"A code specifying the current state of the order.  Generally this will\"\n            \" be active or completed state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"active\",\n                \"on-hold\",\n                \"cancelled\",\n                \"completed\",\n                \"entered-in-error\",\n                \"stopped\",\n                \"draft\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who or group medication request is for\",\n        description=(\n            \"A link to a resource representing the person or set of individuals to \"\n            \"whom the medication will be given.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    substitution: fhirtypes.MedicationRequestSubstitutionType | None = Field(\n        default=None,\n        alias=\"substitution\",\n        title=\"Any restrictions on medication substitution\",\n        description=(\n            \"Indicates whether or not substitution can or should be part of the \"\n            \"dispense. In some cases substitution must happen, in other cases \"\n            \"substitution must not happen. This block explains the prescriber's \"\n            \"intent. If nothing is specified substitution may be done.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Information to support ordering of the medication\",\n        description=(\n            \"Include additional information (for example, patient height and \"\n            \"weight) that supports the ordering of the medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"category\",\n            \"priority\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"context\",\n            \"supportingInformation\",\n            \"authoredOn\",\n            \"requester\",\n            \"recorder\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"note\",\n            \"dosageInstruction\",\n            \"dispenseRequest\",\n            \"substitution\",\n            \"priorPrescription\",\n            \"detectedIssue\",\n            \"eventHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"definition\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"subject\",\n            \"authoredOn\",\n            \"requester\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"medication\": [\"medicationCodeableConcept\", \"medicationReference\"]\n        }\n        return one_of_many_fields\n\n\nclass MedicationRequestDispenseRequest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Medication supply authorization.\n    Indicates the specific details for the dispense or medication supply part\n    of a medication request (also known as a Medication Prescription or\n    Medication Order).  Note that this information is not always sent with the\n    order.  There may be in some settings (e.g. hospitals) institutional or\n    system support for completing the dispense details in the pharmacy\n    department.\n    \"\"\"\n\n    __resource_type__ = \"MedicationRequestDispenseRequest\"\n\n    expectedSupplyDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"expectedSupplyDuration\",\n        title=\"Number of days supply per dispense\",\n        description=(\n            \"Identifies the period time over which the supplied product is expected\"\n            \" to be used, or the length of time the dispense is expected to last.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    numberOfRepeatsAllowed: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"numberOfRepeatsAllowed\",\n        title=\"Number of refills authorized\",\n        description=(\n            \"An integer indicating the number of times, in addition to the original\"\n            \" dispense, (aka refills or repeats) that the patient can receive the \"\n            \"prescribed medication. Usage Notes: This integer does not include the \"\n            \"original order dispense. This means that if an order indicates \"\n            'dispense 30 tablets plus \"3 repeats\", then the order can be dispensed '\n            \"a total of 4 times and the patient can receive a total of 120 tablets.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    numberOfRepeatsAllowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfRepeatsAllowed\",\n        title=\"Extension field for ``numberOfRepeatsAllowed``.\",\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Intended dispenser\",\n        description=(\n            \"Indicates the intended dispensing Organization specified by the \"\n            \"prescriber.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount of medication to supply per dispense\",\n        description=\"The amount that is to be dispensed for one fill.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    validityPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"validityPeriod\",\n        title=\"Time period supply is authorized for\",\n        description=(\n            \"This indicates the validity period of a prescription (stale dating the\"\n            \" Prescription).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationRequestDispenseRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"validityPeriod\",\n            \"numberOfRepeatsAllowed\",\n            \"quantity\",\n            \"expectedSupplyDuration\",\n            \"performer\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationRequestDispenseRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationRequestRequester(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who/What requested the Request.\n    The individual, organization or device that initiated the request and has\n    responsibility for its activation.\n    \"\"\"\n\n    __resource_type__ = \"MedicationRequestRequester\"\n\n    agent: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Who ordered the initial medication(s)\",\n        description=(\n            \"The healthcare professional responsible for authorizing the initial \"\n            \"prescription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization agent is acting for\",\n        description=\"The organization the device or practitioner was acting on behalf of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationRequestRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"agent\", \"onBehalfOf\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationRequestRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"agent\", \"onBehalfOf\"]\n\n\nclass MedicationRequestSubstitution(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Any restrictions on medication substitution.\n    Indicates whether or not substitution can or should be part of the\n    dispense. In some cases substitution must happen, in other cases\n    substitution must not happen. This block explains the prescriber's intent.\n    If nothing is specified substitution may be done.\n    \"\"\"\n\n    __resource_type__ = \"MedicationRequestSubstitution\"\n\n    allowed: bool | None = Field(\n        default=None,\n        alias=\"allowed\",\n        title=\"Whether substitution is allowed or not\",\n        description=(\n            \"True if the prescriber allows a different drug to be dispensed from \"\n            \"what was prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    allowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_allowed\", title=\"Extension field for ``allowed``.\"\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why should (not) substitution be made\",\n        description=(\n            \"Indicates the reason for the substitution, or why substitution must or\"\n            \" must not be performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationRequestSubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"allowed\", \"reason\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationRequestSubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"allowed\", \"allowed__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/medicationstatement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationStatement\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass MedicationStatement(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Record of medication being taken by a patient.\n    A record of a medication that is being consumed by a patient.   A\n    MedicationStatement may indicate that the patient may be taking the\n    medication now, or has taken the medication in the past or will be taking\n    the medication in the future.  The source of this information can be the\n    patient, significant other (such as a family member or spouse), or a\n    clinician.  A common scenario where this information is captured is during\n    the history taking process during a patient visit or stay.   The medication\n    information may come from sources such as the patient's memory, from a\n    prescription bottle,  or from a list of medications the patient, clinician\n    or other party maintains\n\n    The primary difference between a medication statement and a medication\n    administration is that the medication administration has complete\n    administration information and is based on actual administration\n    information from the person who administered the medication.  A medication\n    statement is often, if not always, less specific.  There is no required\n    date/time when the medication was administered, in fact we only know that a\n    source has reported the patient is taking this medication, where details\n    such as time, quantity, or rate or even medication product may be\n    incomplete or missing or less precise.  As stated earlier, the medication\n    statement information may come from the patient's memory, from a\n    prescription bottle or from a list of medications the patient, clinician or\n    other party maintains.  Medication administration is more formal and is not\n    missing detailed information.\n    \"\"\"\n\n    __resource_type__ = \"MedicationStatement\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfils plan, proposal or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicationRequest\",\n                \"CarePlan\",\n                \"ProcedureRequest\",\n                \"ReferralRequest\",\n            ],\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of medication usage\",\n        description=(\n            \"Indicates where type of medication statement and where the medication \"\n            \"is expected to be consumed or administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter / Episode associated with MedicationStatement\",\n        description=(\n            \"The encounter or episode of care that establishes the context for this\"\n            \" MedicationStatement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    dateAsserted: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateAsserted\",\n        title=\"When the statement was asserted?\",\n        description=(\n            \"The date when the medication statement was asserted by the information\"\n            \" source.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    dateAsserted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_dateAsserted\",\n        title=\"Extension field for ``dateAsserted``.\",\n    )\n\n    derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Additional supporting information\",\n        description=(\n            \"Allows linking the MedicationStatement to the underlying \"\n            \"MedicationRequest, or to other information that supports or is used to\"\n            \" derive the MedicationStatement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    dosage: typing.List[fhirtypes.DosageType] | None = Field(\n        default=None,\n        alias=\"dosage\",\n        title=\"Details of how medication is/was taken or should be taken\",\n        description=\"Indicates how the medication is/was or should be taken by the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"The date/time or interval when the medication was taken\",\n        description=(\n            \"The interval of time during which it is being asserted that the \"\n            \"patient was taking the medication (or was not taking, when the \"\n            \"wasNotGiven element is true).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"The date/time or interval when the medication was taken\",\n        description=(\n            \"The interval of time during which it is being asserted that the \"\n            \"patient was taking the medication (or was not taking, when the \"\n            \"wasNotGiven element is true).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"External identifier - FHIR will generate its own internal identifiers \"\n            \"(probably URLs) which do not need to be explicitly managed by the \"\n            \"resource.  The identifier here is one that would be used by another \"\n            \"non-FHIR system - for example an automated medication pump would \"\n            \"provide a record each time it operated; an administration while the \"\n            \"patient was off the ward might be made with a different system and \"\n            \"entered after the event.  Particularly important if these records have\"\n            \" to be updated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    informationSource: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"informationSource\",\n        title=(\n            \"Person or organization that provided the information about the taking \"\n            \"of this medication\"\n        ),\n        description=(\n            \"The person or organization that provided the information about the \"\n            \"taking of this medication. Note: Use derivedFrom when a \"\n            \"MedicationStatement is derived from other resources, e.g Claim or \"\n            \"MedicationRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    medicationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"medicationCodeableConcept\",\n        title=\"What medication was taken\",\n        description=(\n            \"Identifies the medication being administered. This is either a link to\"\n            \" a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    medicationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"medicationReference\",\n        title=\"What medication was taken\",\n        description=(\n            \"Identifies the medication being administered. This is either a link to\"\n            \" a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e medication[x]\n            \"one_of_many\": \"medication\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Further information about the statement\",\n        description=(\n            \"Provides extra information about the medication statement that is not \"\n            \"conveyed by the other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=\"A larger event of which this particular event is a component or step.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicationAdministration\",\n                \"MedicationDispense\",\n                \"MedicationStatement\",\n                \"Procedure\",\n                \"Observation\",\n            ],\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Reason for why the medication is being/was taken\",\n        description=\"A reason for why the medication is being/was taken.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonNotTaken: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonNotTaken\",\n        title=\"True if asserting medication was not given\",\n        description=\"A code indicating why the medication was not taken.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=(\n            \"Condition or observation that supports why the medication is being/was\"\n            \" taken\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | completed | entered-in-error | intended | stopped | on-hold\",\n        description=(\n            \"A code representing the patient or other source's judgment about the \"\n            \"state of the medication used that this statement is about.  Generally \"\n            \"this will be active or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"active\",\n                \"completed\",\n                \"entered-in-error\",\n                \"intended\",\n                \"stopped\",\n                \"on-hold\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who is/was taking  the medication\",\n        description=\"The person, animal or group who is/was taking the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    taken: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"taken\",\n        title=\"y | n | unk | na\",\n        description=(\n            \"Indicator of the certainty of whether the medication was taken by the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"y\", \"n\", \"unk\", \"na\"],\n        },\n    )\n    taken__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_taken\", title=\"Extension field for ``taken``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"context\",\n            \"status\",\n            \"category\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"dateAsserted\",\n            \"informationSource\",\n            \"subject\",\n            \"derivedFrom\",\n            \"taken\",\n            \"reasonNotTaken\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"note\",\n            \"dosage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"context\",\n            \"status\",\n            \"category\",\n            \"medicationCodeableConcept\",\n            \"medicationReference\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"dateAsserted\",\n            \"subject\",\n            \"taken\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\"), (\"taken\", \"taken__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"effective\": [\"effectiveDateTime\", \"effectivePeriod\"],\n            \"medication\": [\"medicationCodeableConcept\", \"medicationReference\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/messagedefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MessageDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MessageDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A resource that defines a type of message that can be exchanged between\n    systems.\n    Defines the characteristics of a message that can be shared between\n    systems, including the type of event that initiates the message, the\n    content to be transmitted and what response(s), if any, are permitted.\n    \"\"\"\n\n    __resource_type__ = \"MessageDefinition\"\n\n    allowedResponse: typing.List[\n        fhirtypes.MessageDefinitionAllowedResponseType\n    ] | None = Field(\n        default=None,\n        alias=\"allowedResponse\",\n        title=\"Responses to this message\",\n        description=(\n            \"Indicates what types of messages may be sent as an application-level \"\n            \"response to this message.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    base: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"Definition this one is based on\",\n        description=(\n            \"The MessageDefinition that is the basis for the contents of this \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n\n    category: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Consequence | Currency | Notification\",\n        description=\"The impact of the content of the message.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"Consequence\", \"Currency\", \"Notification\"],\n        },\n    )\n    category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_category\", title=\"Extension field for ``category``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the message definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the message definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the message definition was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the message definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the message definition\",\n        description=(\n            \"A free text natural language description of the message definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    event: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"event\",\n        title=\"Event type\",\n        description=\"A coded identifier of a supported messaging event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this message definition is authored \"\n            \"for testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    focus: typing.List[fhirtypes.MessageDefinitionFocusType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"Resource(s) that are the subject of the event\",\n        description=(\n            \"Identifies the resource (or resources) that are being addressed by the\"\n            \" event.  For example, the Encounter for an admit message or two \"\n            \"Account records for a merge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the message definition\",\n        description=(\n            \"A formal identifier that is used to identify this message definition \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for message definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the message definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this message definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the message definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    parent: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Protocol/workflow this is part of\",\n        description=(\n            \"Identifies a protocol or workflow that this MessageDefinition \"\n            \"represents a step in.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the message \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this message definition is defined\",\n        description=(\n            \"Explaination of why this message definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"Takes the place of\",\n        description=\"A MessageDefinition that is superseded by this definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n\n    responseRequired: bool | None = Field(\n        default=None,\n        alias=\"responseRequired\",\n        title=\"Is a response required?\",\n        description=\"Indicates whether a response is required for this message.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responseRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_responseRequired\",\n        title=\"Extension field for ``responseRequired``.\",\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this message definition. Enables tracking the life-cycle\"\n            \" of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this message definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the message definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this message definition (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this message definition when \"\n            \"it is referenced in a specification, model, design or an instance. \"\n            \"This SHALL be a URL, SHOULD be globally unique, and SHOULD be an \"\n            \"address at which this message definition is (or will be) published. \"\n            \"The URL SHOULD include the major version of the message definition. \"\n            \"For more information see [Technical and Business \"\n            \"Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate message definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the message definition\",\n        description=(\n            \"The identifier that is used to identify this version of the message \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the message definition\"\n            \" author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"base\",\n            \"parent\",\n            \"replaces\",\n            \"event\",\n            \"category\",\n            \"focus\",\n            \"responseRequired\",\n            \"allowedResponse\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"base\",\n            \"parent\",\n            \"replaces\",\n            \"event\",\n            \"category\",\n            \"focus\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"date\", \"date__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass MessageDefinitionAllowedResponse(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Responses to this message.\n    Indicates what types of messages may be sent as an application-level\n    response to this message.\n    \"\"\"\n\n    __resource_type__ = \"MessageDefinitionAllowedResponse\"\n\n    message: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"message\",\n        title=\"Reference to allowed message definition response\",\n        description=(\n            \"A reference to the message definition that must be adhered to by this \"\n            \"supported response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n\n    situation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"situation\",\n        title=\"When should this response be used\",\n        description=(\n            \"Provides a description of the circumstances in which this response \"\n            \"should be used (as opposed to one of the alternative responses).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    situation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_situation\", title=\"Extension field for ``situation``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageDefinitionAllowedResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"message\", \"situation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageDefinitionAllowedResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MessageDefinitionFocus(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource(s) that are the subject of the event.\n    Identifies the resource (or resources) that are being addressed by the\n    event.  For example, the Encounter for an admit message or two Account\n    records for a merge.\n    \"\"\"\n\n    __resource_type__ = \"MessageDefinitionFocus\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of resource\",\n        description=\"The kind of resource that must be the focus for this message.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum number of focuses of this type\",\n        description=(\n            \"Identifies the maximum number of resources of this type that must be \"\n            \"pointed to by a message in order for it to be valid against this \"\n            \"MessageDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum number of focuses of this type\",\n        description=(\n            \"Identifies the minimum number of resources of this type that must be \"\n            \"pointed to by a message in order for it to be valid against this \"\n            \"MessageDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    profile: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile that must be adhered to by focus\",\n        description=(\n            \"A profile that reflects constraints for the focal resource (and \"\n            \"potentially for related resources).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageDefinitionFocus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"profile\", \"min\", \"max\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageDefinitionFocus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/messageheader.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MessageHeader\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MessageHeader(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A resource that describes a message that is exchanged between systems.\n    The header for a message exchange that is either requesting or responding\n    to an action.  The reference(s) that are the subject of the action as well\n    as other information related to the action are typically transmitted in a\n    bundle in which the MessageHeader resource instance is the first resource\n    in the bundle.\n    \"\"\"\n\n    __resource_type__ = \"MessageHeader\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"The source of the decision\",\n        description=(\n            \"The logical author of the message - the person or device that decided \"\n            \"the described event should happen. When there is more than one \"\n            \"candidate, pick the most proximal to the MessageHeader. Can provide \"\n            \"other authors in extensions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    destination: typing.List[fhirtypes.MessageHeaderDestinationType] | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Message destination application(s)\",\n        description=\"The destination application which the message is intended for.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"The source of the data entry\",\n        description=(\n            \"The person or device that performed the data entry leading to this \"\n            \"message. When there is more than one candidate, pick the most proximal\"\n            \" to the message. Can provide other enterers in extensions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    event: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"event\",\n        title=\"Code for the event this message represents\",\n        description=(\n            \"Code that identifies the event this message represents and connects it\"\n            \" with its definition. Events defined as part of the FHIR specification\"\n            ' have the system value \"http://hl7.org/fhir/message-events\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    focus: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"The actual content of the message\",\n        description=(\n            \"The actual data of the message - a reference to the root/focus class \"\n            \"of the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Cause of event\",\n        description=(\n            \"Coded indication of the cause for the event - indicates  a reason for \"\n            \"the occurrence of the event that is a focus of this message.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    receiver: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"receiver\",\n        title='Intended \"real-world\" recipient for the data',\n        description=(\n            \"Allows data conveyed by a message to be addressed to a particular \"\n            \"person or department when routing to a specific application isn't \"\n            \"sufficient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Organization\"],\n        },\n    )\n\n    response: fhirtypes.MessageHeaderResponseType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"If this is a reply to prior message\",\n        description=(\n            \"Information about the message that this message is a response to.  \"\n            \"Only present if this message is a response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    responsible: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Final responsibility for event\",\n        description=(\n            \"The person or organization that accepts overall responsibility for the\"\n            \" contents of the message. The implication is that the message event \"\n            \"happened under the policies of the responsible party.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Organization\"],\n        },\n    )\n\n    sender: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sender\",\n        title=\"Real world sender of the message\",\n        description=(\n            \"Identifies the sending system to allow the use of a trust \" \"relationship.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Organization\"],\n        },\n    )\n\n    source: fhirtypes.MessageHeaderSourceType = Field(\n        default=...,\n        alias=\"source\",\n        title=\"Message source application\",\n        description=\"The source application from which this message originated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    timestamp: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"timestamp\",\n        title=\"Time that the message was sent\",\n        description=\"The time that the message was sent.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timestamp\", title=\"Extension field for ``timestamp``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageHeader`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"event\",\n            \"destination\",\n            \"receiver\",\n            \"sender\",\n            \"timestamp\",\n            \"enterer\",\n            \"author\",\n            \"source\",\n            \"responsible\",\n            \"reason\",\n            \"response\",\n            \"focus\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageHeader`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"event\",\n            \"destination\",\n            \"receiver\",\n            \"sender\",\n            \"timestamp\",\n            \"enterer\",\n            \"author\",\n            \"source\",\n            \"responsible\",\n            \"reason\",\n            \"response\",\n            \"focus\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"timestamp\", \"timestamp__ext\")]\n        return required_fields\n\n\nclass MessageHeaderDestination(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Message destination application(s).\n    The destination application which the message is intended for.\n    \"\"\"\n\n    __resource_type__ = \"MessageHeaderDestination\"\n\n    endpoint: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Actual destination address or id\",\n        description=\"Indicates where the message should be routed to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_endpoint\", title=\"Extension field for ``endpoint``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of system\",\n        description=\"Human-readable name for the target system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    target: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Particular delivery destination within the destination\",\n        description=(\n            \"Identifies the target end system in situations where the initial \"\n            \"message transmission is to an intermediary system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageHeaderDestination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"target\", \"endpoint\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageHeaderDestination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"target\", \"endpoint\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"endpoint\", \"endpoint__ext\")]\n        return required_fields\n\n\nclass MessageHeaderResponse(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If this is a reply to prior message.\n    Information about the message that this message is a response to.  Only\n    present if this message is a response.\n    \"\"\"\n\n    __resource_type__ = \"MessageHeaderResponse\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"ok | transient-error | fatal-error\",\n        description=(\n            \"Code that identifies the type of response to the message - whether it \"\n            \"was successful or not, and whether it should be resent or not.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"ok\", \"transient-error\", \"fatal-error\"],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    details: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"details\",\n        title=\"Specific list of hints/warnings/errors\",\n        description=\"Full details of any issues found in the message.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationOutcome\"],\n        },\n    )\n\n    identifier: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Id of original message\",\n        description=(\n            \"The MessageHeader.id of the message to which this message is a \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    identifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_identifier\", title=\"Extension field for ``identifier``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageHeaderResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"identifier\", \"code\", \"details\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageHeaderResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"code\", \"details\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"identifier\", \"identifier__ext\")]\n        return required_fields\n\n\nclass MessageHeaderSource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Message source application.\n    The source application from which this message originated.\n    \"\"\"\n\n    __resource_type__ = \"MessageHeaderSource\"\n\n    contact: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Human contact for problems\",\n        description=(\n            \"An e-mail, phone, website or other contact point to use to resolve \"\n            \"issues with message communications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endpoint: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Actual message source address or id\",\n        description=\"Identifies the routing target to send acknowledgements to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_endpoint\", title=\"Extension field for ``endpoint``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of system\",\n        description=\"Human-readable name for the source system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    software: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"software\",\n        title=\"Name of software running the system\",\n        description=\"May include configuration or other information useful in debugging.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    software__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_software\", title=\"Extension field for ``software``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version of software running\",\n        description=(\n            \"Can convey versions of multiple systems in situations where a message \"\n            \"passes through multiple hands.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageHeaderSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"software\",\n            \"version\",\n            \"contact\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageHeaderSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"name\",\n            \"software\",\n            \"version\",\n            \"contact\",\n            \"endpoint\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"endpoint\", \"endpoint__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/meta.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Meta\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Meta(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Metadata about a resource.\n    The metadata about a resource. This is content in the resource that is\n    maintained by the infrastructure. Changes to the content may not always be\n    associated with version changes to the resource.\n    \"\"\"\n\n    __resource_type__ = \"Meta\"\n\n    lastUpdated: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"lastUpdated\",\n        title=\"When the resource version last changed\",\n        description=\"When the resource last changed - e.g. when the version changed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastUpdated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lastUpdated\", title=\"Extension field for ``lastUpdated``.\"\n    )\n\n    profile: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profiles this resource claims to conform to\",\n        description=(\n            \"A list of profiles (references to \"\n            \"[StructureDefinition](structuredefinition.html#) resources) that this \"\n            \"resource claims to conform to. The URL is a reference to \"\n            \"[StructureDefinition.url]().\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    profile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    security: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"security\",\n        title=\"Security Labels applied to this resource\",\n        description=(\n            \"Security labels applied to this resource. These tags connect specific \"\n            \"resources to the overall security policy and infrastructure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    tag: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"tag\",\n        title=\"Tags applied to this resource\",\n        description=(\n            \"Tags applied to this resource. Tags are intended to be used to \"\n            \"identify and relate resources to process and workflow, and \"\n            \"applications are not required to consider the tags when interpreting \"\n            \"the meaning of a resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    versionId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"versionId\",\n        title=\"Version specific identifier\",\n        description=(\n            \"The version specific identifier, as it appears in the version portion \"\n            \"of the URL. This values changes when the resource is created, updated,\"\n            \" or deleted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    versionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_versionId\", title=\"Extension field for ``versionId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Meta`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"versionId\",\n            \"lastUpdated\",\n            \"profile\",\n            \"security\",\n            \"tag\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Meta`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"versionId\", \"lastUpdated\", \"profile\", \"security\", \"tag\"]\n"
  },
  {
    "path": "fhir/resources/STU3/metadataresource.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MetadataResource\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass MetadataResource(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Common Ancestor declaration for definitional resources.\n    Common Ancestor declaration for conformance and knowledge artifact\n    resources.\n    \"\"\"\n\n    __resource_type__ = \"MetadataResource\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the metadata resource was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the metadata resource \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the metadata resource\",\n        description=(\n            \"A free text natural language description of the metadata resource from\"\n            \" a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this metadata resource is authored \"\n            \"for testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for metadata resource (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the metadata resource is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this metadata resource (computer friendly)\",\n        description=(\n            \"A natural language name identifying the metadata resource. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the metadata\"\n            \" resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this metadata resource. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this metadata resource (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the metadata resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this metadata resource (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this metadata resource when \"\n            \"it is referenced in a specification, model, design or an instance. \"\n            \"This SHALL be a URL, SHOULD be globally unique, and SHOULD be an \"\n            \"address at which this metadata resource is (or will be) published. The\"\n            \" URL SHOULD include the major version of the metadata resource. For \"\n            \"more information see [Technical and Business \"\n            \"Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate metadata resource instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the metadata resource\",\n        description=(\n            \"The identifier that is used to identify this version of the metadata \"\n            \"resource when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the metadata resource \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MetadataResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"description\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MetadataResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/money.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Money\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Money(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An amount of economic utility in some recognized currency.\n    \"\"\"\n\n    __resource_type__ = \"Money\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Money`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Money`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/STU3/namingsystem.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NamingSystem\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass NamingSystem(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    System of unique identification.\n    A curated namespace that issues unique symbols within that namespace for\n    the identification of concepts, people, devices, etc.  Represents a\n    \"System\" used within the Identifier and Coding data types.\n    \"\"\"\n\n    __resource_type__ = \"NamingSystem\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the naming system was published. \"\n            \"The date must change if and when the business version changes and it \"\n            \"must change if the status code changes. In addition, it should change \"\n            \"when the substantive content of the naming system changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the naming system\",\n        description=(\n            \"A free text natural language description of the naming system from a \"\n            \"consumer's perspective. Details about what the namespace identifies \"\n            \"including scope, granularity, version labeling, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for naming system (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the naming system is intended to\"\n            \" be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"codesystem | identifier | root\",\n        description=(\n            \"Indicates the purpose for the naming system - what kinds of things \"\n            \"does it make unique?\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"codesystem\", \"identifier\", \"root\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this naming system (computer friendly)\",\n        description=(\n            \"A natural language name identifying the naming system. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the naming \"\n            \"system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    replacedBy: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"replacedBy\",\n        title=\"Use this instead\",\n        description=(\n            \"For naming systems that are retired, indicates the naming system that \"\n            \"should be used in their place (if any).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"NamingSystem\"],\n        },\n    )\n\n    responsible: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Who maintains system namespace?\",\n        description=(\n            \"The name of the organization that is responsible for issuing \"\n            \"identifiers or codes for this namespace and ensuring their non-\"\n            \"collision.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_responsible\", title=\"Extension field for ``responsible``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this naming system. Enables tracking the life-cycle of \"\n            \"the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"e.g. driver,  provider,  patient, bank etc.\",\n        description=(\n            \"Categorizes a naming system for easier search by grouping related \"\n            \"naming systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    uniqueId: typing.List[fhirtypes.NamingSystemUniqueIdType] = Field(\n        default=...,\n        alias=\"uniqueId\",\n        title=\"Unique identifiers used for system\",\n        description=(\n            \"Indicates how the system may be identified when referenced in \"\n            \"electronic exchange.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"How/where is it used\",\n        description=(\n            \"Provides guidance on the use of the namespace, including the handling \"\n            \"of formatting characters, use of upper vs. lower case, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate naming system instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NamingSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"status\",\n            \"kind\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"responsible\",\n            \"type\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"usage\",\n            \"uniqueId\",\n            \"replacedBy\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NamingSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"name\",\n            \"status\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"date\", \"date__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass NamingSystemUniqueId(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Unique identifiers used for system.\n    Indicates how the system may be identified when referenced in electronic\n    exchange.\n    \"\"\"\n\n    __resource_type__ = \"NamingSystemUniqueId\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Notes about identifier usage\",\n        description=\"Notes about the past or intended usage of this identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When is identifier valid?\",\n        description=(\n            \"Identifies the period of time over which this identifier is considered\"\n            \" appropriate to refer to the naming system.  Outside of this window, \"\n            \"the identifier might be non-deterministic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preferred: bool | None = Field(\n        default=None,\n        alias=\"preferred\",\n        title=\"Is this the id that should be used for this type\",\n        description=(\n            'Indicates whether this identifier is the \"preferred\" identifier of '\n            \"this type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preferred\", title=\"Extension field for ``preferred``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"oid | uuid | uri | other\",\n        description=(\n            \"Identifies the unique identifier scheme used for this particular \"\n            \"identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"oid\", \"uuid\", \"uri\", \"other\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The unique identifier\",\n        description=(\n            \"The string that should be sent over the wire to identify the code \"\n            \"system or identifier system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NamingSystemUniqueId`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"value\",\n            \"preferred\",\n            \"comment\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NamingSystemUniqueId`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/narrative.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Narrative\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Narrative(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A human-readable formatted text, including images.\n    \"\"\"\n\n    __resource_type__ = \"Narrative\"\n\n    div: fhirtypes.XhtmlType | None = Field(\n        default=None,\n        alias=\"div\",\n        title=\"Limited xhtml content\",\n        description=\"The actual narrative content, a stripped down version of XHTML.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    div__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_div\", title=\"Extension field for ``div``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"generated | extensions | additional | empty\",\n        description=(\n            \"The status of the narrative - whether it's entirely generated (from \"\n            \"just the defined data or the extensions too), or whether a human \"\n            \"authored it and it may contain additional data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"generated\", \"extensions\", \"additional\", \"empty\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Narrative`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"status\", \"div\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Narrative`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"div\", \"div__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/nutritionorder.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NutritionOrder\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass NutritionOrder(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Diet, formula or nutritional supplement request.\n    A request to supply a diet, formula feeding (enteral) or oral nutritional\n    supplement to a patient/resident.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrder\"\n\n    allergyIntolerance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"allergyIntolerance\",\n        title=(\n            \"List of the patient's food and nutrition-related allergies and \"\n            \"intolerances\"\n        ),\n        description=(\n            \"A link to a record of allergies or intolerances  which should be \"\n            \"included in the nutrition order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"AllergyIntolerance\"],\n        },\n    )\n\n    dateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateTime\",\n        title=\"Date and time the nutrition order was requested\",\n        description=\"The date and time that this nutrition order was requested.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    dateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dateTime\", title=\"Extension field for ``dateTime``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"The encounter associated with this nutrition order\",\n        description=(\n            \"An encounter that provides additional information about the healthcare\"\n            \" context in which this request is made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    enteralFormula: fhirtypes.NutritionOrderEnteralFormulaType | None = Field(\n        default=None,\n        alias=\"enteralFormula\",\n        title=\"Enteral formula components\",\n        description=(\n            \"Feeding provided through the gastrointestinal tract via a tube, \"\n            \"catheter, or stoma that delivers nutrition distal to the oral cavity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    excludeFoodModifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"excludeFoodModifier\",\n        title=(\n            \"Order-specific modifier about the type of food that should not be \" \"given\"\n        ),\n        description=(\n            \"This modifier is used to convey order-specific modifiers about the \"\n            \"type of food that should NOT be given. These can be derived from \"\n            \"patient allergies, intolerances, or preferences such as No Red Meat, \"\n            \"No Soy or No Wheat or  Gluten-Free.  While it should not be necessary \"\n            \"to repeat allergy or intolerance information captured in the \"\n            \"referenced AllergyIntolerance resource in the excludeFoodModifier, \"\n            \"this element may be used to convey additional specificity related to \"\n            \"foods that should be eliminated from the patient\\u2019s diet for any \"\n            \"reason.  This modifier applies to the entire nutrition order inclusive\"\n            \" of the oral diet, nutritional supplements and enteral formula \"\n            \"feedings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    foodPreferenceModifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"foodPreferenceModifier\",\n        title=\"Order-specific modifier about the type of food that should be given\",\n        description=(\n            \"This modifier is used to convey order-specific modifiers about the \"\n            \"type of food that should be given. These can be derived from patient \"\n            \"allergies, intolerances, or preferences such as Halal, Vegan or \"\n            \"Kosher. This modifier applies to the entire nutrition order inclusive \"\n            \"of the oral diet, nutritional supplements and enteral formula \"\n            \"feedings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers assigned to this order\",\n        description=(\n            \"Identifiers assigned to this order by the order sender or by the order\"\n            \" receiver.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    oralDiet: fhirtypes.NutritionOrderOralDietType | None = Field(\n        default=None,\n        alias=\"oralDiet\",\n        title=\"Oral diet components\",\n        description=\"Diet given orally in contrast to enteral (tube) feeding.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    orderer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"orderer\",\n        title=\"Who ordered the diet, formula or nutritional supplement\",\n        description=(\n            \"The practitioner that holds legal responsibility for ordering the \"\n            \"diet, nutritional supplement, or formula feedings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The person who requires the diet, formula or nutritional supplement\",\n        description=(\n            \"The person (patient) who needs the nutrition order for an oral diet, \"\n            \"nutritional supplement and/or enteral or formula feeding.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"proposed | draft | planned | requested | active | on-hold | completed \"\n            \"| cancelled | entered-in-error\"\n        ),\n        description=\"The workflow status of the nutrition order/request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposed\",\n                \"draft\",\n                \"planned\",\n                \"requested\",\n                \"active\",\n                \"on-hold\",\n                \"completed\",\n                \"cancelled\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    supplement: typing.List[fhirtypes.NutritionOrderSupplementType] | None = Field(\n        default=None,\n        alias=\"supplement\",\n        title=\"Supplement components\",\n        description=(\n            \"Oral nutritional products given in order to add further nutritional \"\n            \"value to the patient's diet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrder`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"patient\",\n            \"encounter\",\n            \"dateTime\",\n            \"orderer\",\n            \"allergyIntolerance\",\n            \"foodPreferenceModifier\",\n            \"excludeFoodModifier\",\n            \"oralDiet\",\n            \"supplement\",\n            \"enteralFormula\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrder`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"patient\",\n            \"dateTime\",\n            \"orderer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"dateTime\", \"dateTime__ext\")]\n        return required_fields\n\n\nclass NutritionOrderEnteralFormula(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Enteral formula components.\n    Feeding provided through the gastrointestinal tract via a tube, catheter,\n    or stoma that delivers nutrition distal to the oral cavity.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderEnteralFormula\"\n\n    additiveProductName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"additiveProductName\",\n        title=\"Product or brand name of the modular additive\",\n        description=(\n            \"The product or brand name of the type of modular component to be added\"\n            \" to the formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    additiveProductName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_additiveProductName\",\n        title=\"Extension field for ``additiveProductName``.\",\n    )\n\n    additiveType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"additiveType\",\n        title=\"Type of modular component to add to the feeding\",\n        description=(\n            \"Indicates the type of modular component such as protein, carbohydrate,\"\n            \" fat or fiber to be provided in addition to or mixed with the base \"\n            \"formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    administration: typing.List[\n        fhirtypes.NutritionOrderEnteralFormulaAdministrationType\n    ] | None = Field(\n        default=None,\n        alias=\"administration\",\n        title=\"Formula feeding instruction as structured data\",\n        description=(\n            \"Formula administration instructions as structured data.  This \"\n            \"repeating structure allows for changing the administration rate or \"\n            \"volume over time for both bolus and continuous feeding.  An example of\"\n            \" this would be an instruction to increase the rate of continuous \"\n            \"feeding every 2 hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    administrationInstruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"administrationInstruction\",\n        title=\"Formula feeding instructions expressed as text\",\n        description=(\n            \"Free text formula administration, feeding instructions or additional \"\n            \"instructions or information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    administrationInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_administrationInstruction\",\n        title=\"Extension field for ``administrationInstruction``.\",\n    )\n\n    baseFormulaProductName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"baseFormulaProductName\",\n        title=\"Product or brand name of the enteral or infant formula\",\n        description=(\n            \"The product or brand name of the enteral or infant formula product \"\n            'such as \"ACME Adult Standard Formula\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    baseFormulaProductName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_baseFormulaProductName\",\n        title=\"Extension field for ``baseFormulaProductName``.\",\n    )\n\n    baseFormulaType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"baseFormulaType\",\n        title=\"Type of enteral or infant formula\",\n        description=(\n            \"The type of enteral or infant formula such as an adult standard \"\n            \"formula with fiber or a soy-based infant formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    caloricDensity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"caloricDensity\",\n        title=\"Amount of energy per specified volume that is required\",\n        description=(\n            \"The amount of energy (calories) that the formula should provide per \"\n            \"specified volume, typically per mL or fluid oz.  For example, an \"\n            \"infant may require a formula that provides 24 calories per fluid ounce\"\n            \" or an adult may require an enteral formula that provides 1.5 \"\n            \"calorie/mL.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    maxVolumeToDeliver: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxVolumeToDeliver\",\n        title=\"Upper limit on formula volume per unit of time\",\n        description=(\n            \"The maximum total quantity of formula that may be administered to a \"\n            \"subject over the period of time, e.g. 1440 mL over 24 hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    routeofAdministration: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"routeofAdministration\",\n        title=\"How the formula should enter the patient's gastrointestinal tract\",\n        description=(\n            \"The route or physiological path of administration into the patient's \"\n            \"gastrointestinal  tract for purposes of providing the formula feeding,\"\n            \" e.g. nasogastric tube.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderEnteralFormula`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"baseFormulaType\",\n            \"baseFormulaProductName\",\n            \"additiveType\",\n            \"additiveProductName\",\n            \"caloricDensity\",\n            \"routeofAdministration\",\n            \"administration\",\n            \"maxVolumeToDeliver\",\n            \"administrationInstruction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormula`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"baseFormulaType\", \"administrationInstruction\"]\n\n\nclass NutritionOrderEnteralFormulaAdministration(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Formula feeding instruction as structured data.\n    Formula administration instructions as structured data.  This repeating\n    structure allows for changing the administration rate or volume over time\n    for both bolus and continuous feeding.  An example of this would be an\n    instruction to increase the rate of continuous feeding every 2 hours.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderEnteralFormulaAdministration\"\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"The volume of formula to provide\",\n        description=(\n            \"The volume of formula to provide to the patient per the specified \"\n            \"administration schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rateQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"rateQuantity\",\n        title=\"Speed with which the formula is provided per period of time\",\n        description=(\n            \"The rate of administration of formula via a feeding pump, e.g. 60 mL \"\n            \"per hour, according to the specified schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"rateRatio\",\n        title=\"Speed with which the formula is provided per period of time\",\n        description=(\n            \"The rate of administration of formula via a feeding pump, e.g. 60 mL \"\n            \"per hour, according to the specified schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    schedule: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"schedule\",\n        title=\"Scheduled frequency of enteral feeding\",\n        description=(\n            \"The time period and frequency at which the enteral formula should be \"\n            \"delivered to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderEnteralFormulaAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"schedule\",\n            \"quantity\",\n            \"rateQuantity\",\n            \"rateRatio\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormulaAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"rate\": [\"rateQuantity\", \"rateRatio\"]}\n        return one_of_many_fields\n\n\nclass NutritionOrderOralDiet(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Oral diet components.\n    Diet given orally in contrast to enteral (tube) feeding.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderOralDiet\"\n\n    fluidConsistencyType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"fluidConsistencyType\",\n        title=\"The required consistency of fluids and liquids provided to the patient\",\n        description=(\n            \"The required consistency (e.g. honey-thick, nectar-thick, thin, \"\n            \"thickened.) of liquids or fluids served to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"instruction\",\n        title=\"Instructions or additional information about the oral diet\",\n        description=(\n            \"Free text or additional instructions or information pertaining to the \"\n            \"oral diet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_instruction\", title=\"Extension field for ``instruction``.\"\n    )\n\n    nutrient: typing.List[fhirtypes.NutritionOrderOralDietNutrientType] | None = Field(\n        default=None,\n        alias=\"nutrient\",\n        title=\"Required  nutrient modifications\",\n        description=(\n            \"Class that defines the quantity and type of nutrient modifications \"\n            \"(for example carbohydrate, fiber or sodium) required for the oral \"\n            \"diet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    schedule: typing.List[fhirtypes.TimingType] | None = Field(\n        default=None,\n        alias=\"schedule\",\n        title=\"Scheduled frequency of diet\",\n        description=(\n            \"The time period and frequency at which the diet should be given.  The \"\n            \"diet should be given for the combination of all schedules if more than\"\n            \" one schedule is present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    texture: typing.List[fhirtypes.NutritionOrderOralDietTextureType] | None = Field(\n        default=None,\n        alias=\"texture\",\n        title=\"Required  texture modifications\",\n        description=(\n            \"Class that describes any texture modifications required for the \"\n            \"patient to safely consume various types of solid foods.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Type of oral diet or diet restrictions that describe what can be \"\n            \"consumed orally\"\n        ),\n        description=(\n            \"The kind of diet or dietary restriction such as fiber restricted diet \"\n            \"or diabetic diet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderOralDiet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"schedule\",\n            \"nutrient\",\n            \"texture\",\n            \"fluidConsistencyType\",\n            \"instruction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDiet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"instruction\"]\n\n\nclass NutritionOrderOralDietNutrient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Required  nutrient modifications.\n    Class that defines the quantity and type of nutrient modifications (for\n    example carbohydrate, fiber or sodium) required for the oral diet.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderOralDietNutrient\"\n\n    amount: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Quantity of the specified nutrient\",\n        description=\"The quantity of the specified nutrient to include in diet.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifier: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Type of nutrient that is being modified\",\n        description=\"The nutrient that is being modified such as carbohydrate or sodium.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderOralDietNutrient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"modifier\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietNutrient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionOrderOralDietTexture(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Required  texture modifications.\n    Class that describes any texture modifications required for the patient to\n    safely consume various types of solid foods.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderOralDietTexture\"\n\n    foodType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"foodType\",\n        title=(\n            \"Concepts that are used to identify an entity that is ingested for \"\n            \"nutritional purposes\"\n        ),\n        description=(\n            \"The food type(s) (e.g. meats, all foods)  that the texture \"\n            \"modification applies to.  This could be all foods types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifier: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Code to indicate how to alter the texture of the foods, e.g. pureed\",\n        description=(\n            \"Any texture modifications (for solid foods) that should be made, e.g. \"\n            \"easy to chew, chopped, ground, and pureed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderOralDietTexture`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"modifier\", \"foodType\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietTexture`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionOrderSupplement(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supplement components.\n    Oral nutritional products given in order to add further nutritional value\n    to the patient's diet.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderSupplement\"\n\n    instruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"instruction\",\n        title=\"Instructions or additional information about the oral supplement\",\n        description=(\n            \"Free text or additional instructions or information pertaining to the \"\n            \"oral supplement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_instruction\", title=\"Extension field for ``instruction``.\"\n    )\n\n    productName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"productName\",\n        title=\"Product or brand name of the nutritional supplement\",\n        description=(\n            'The product or brand name of the nutritional supplement such as \"Acme '\n            'Protein Shake\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    productName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_productName\", title=\"Extension field for ``productName``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount of the nutritional supplement\",\n        description=\"The amount of the nutritional supplement to be given.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    schedule: typing.List[fhirtypes.TimingType] | None = Field(\n        default=None,\n        alias=\"schedule\",\n        title=\"Scheduled frequency of supplement\",\n        description=(\n            \"The time period and frequency at which the supplement(s) should be \"\n            \"given.  The supplement should be given for the combination of all \"\n            \"schedules if more than one schedule is present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of supplement product requested\",\n        description=(\n            \"The kind of nutritional supplement product required such as a high \"\n            \"protein or pediatric clear liquid supplement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderSupplement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"productName\",\n            \"schedule\",\n            \"quantity\",\n            \"instruction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderSupplement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"instruction\"]\n"
  },
  {
    "path": "fhir/resources/STU3/observation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Observation\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Observation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Measurements and simple assertions.\n    Measurements and simple assertions made about a patient, device or other\n    subject.\n    \"\"\"\n\n    __resource_type__ = \"Observation\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan, proposal or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"DeviceRequest\",\n                \"ImmunizationRecommendation\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ProcedureRequest\",\n                \"ReferralRequest\",\n            ],\n        },\n    )\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Observed body part\",\n        description=(\n            \"Indicates the site on the subject's body where the observation was \"\n            \"made (i.e. the target site).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classification of  type of observation\",\n        description=\"A code that classifies the general type of observation being made.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of observation (code / type)\",\n        description=(\n            \"Describes what was observed. Sometimes this is called the observation \"\n            '\"name\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments about result\",\n        description=(\n            \"May include statements about significant, unexpected or unreliable \"\n            \"values, or information about the source of the value where this may be\"\n            \" relevant to the interpretation of the result.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    component: typing.List[fhirtypes.ObservationComponentType] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"Component results\",\n        description=(\n            \"Some observations have multiple component observations.  These \"\n            \"component observations are expressed as separate code value pairs that\"\n            \" share the same attributes.  Examples include systolic and diastolic \"\n            \"component observations for blood pressure measurement and multiple \"\n            \"component observations for genetics observations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Healthcare event during which this observation is made\",\n        description=(\n            \"The healthcare event  (e.g. a patient and healthcare provider \"\n            \"interaction) during which this observation is made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    dataAbsentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"dataAbsentReason\",\n        title=\"Why the result is missing\",\n        description=(\n            \"Provides a reason why the expected value in the element \"\n            \"Observation.value[x] is missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"(Measurement) Device\",\n        description=\"The device used to generate the observation data.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"DeviceMetric\"],\n        },\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"Clinically relevant time/time-period for observation\",\n        description=(\n            \"The time or time-period the observed value is asserted as being true. \"\n            \"For biological subjects - e.g. human patients - this is usually called\"\n            ' the \"physiologically relevant time\". This is usually either the time '\n            \"of the procedure or of specimen collection, but very often the source \"\n            \"of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"Clinically relevant time/time-period for observation\",\n        description=(\n            \"The time or time-period the observed value is asserted as being true. \"\n            \"For biological subjects - e.g. human patients - this is usually called\"\n            ' the \"physiologically relevant time\". This is usually either the time '\n            \"of the procedure or of specimen collection, but very often the source \"\n            \"of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for observation\",\n        description=\"A unique identifier assigned to this observation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    interpretation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"interpretation\",\n        title=\"High, low, normal, etc.\",\n        description=(\n            \"The assessment made based on the result of the observation.  Intended \"\n            \"as a simple compact code often placed adjacent to the result value in \"\n            \"reports and flow sheets to signal the meaning/normalcy status of the \"\n            \"result. Otherwise known as abnormal flag.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"Date/Time this was made available\",\n        description=(\n            \"The date and time this observation was made available to providers, \"\n            \"typically after the results have been reviewed and verified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"How it was done\",\n        description=\"Indicates the mechanism used to perform the observation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who is responsible for the observation\",\n        description='Who was responsible for asserting the observed value as \"true\".',\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    referenceRange: typing.List[fhirtypes.ObservationReferenceRangeType] | None = Field(\n        default=None,\n        alias=\"referenceRange\",\n        title=\"Provides guide for interpretation\",\n        description=(\n            \"Guidance on how to interpret the value by comparison to a normal or \"\n            \"recommended range.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    related: typing.List[fhirtypes.ObservationRelatedType] | None = Field(\n        default=None,\n        alias=\"related\",\n        title=\"Resource related to this observation\",\n        description=(\n            \"A  reference to another resource (usually another Observation) whose \"\n            \"relationship is defined by the relationship type code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specimen: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Specimen used for this observation\",\n        description=\"The specimen that was used when this observation was made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | preliminary | final | amended +\",\n        description=\"The status of the result value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"registered\", \"preliminary\", \"final\", \"amended\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who and/or what this is about\",\n        description=(\n            \"The patient, or group of patients, location, or device whose \"\n            \"characteristics (direct or indirect) are described by the observation \"\n            \"and into whose record the observation is placed.  Comments: Indirect \"\n            \"characteristics may be those of a specimen, fetus, donor,  other \"\n            \"observer (for example a relative or EMT), or any observation made \"\n            \"about the subject.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Device\", \"Location\"],\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Observation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"issued\",\n            \"performer\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueSampledData\",\n            \"valueAttachment\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"dataAbsentReason\",\n            \"interpretation\",\n            \"comment\",\n            \"bodySite\",\n            \"method\",\n            \"specimen\",\n            \"device\",\n            \"referenceRange\",\n            \"related\",\n            \"component\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Observation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"basedOn\",\n            \"status\",\n            \"code\",\n            \"subject\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"issued\",\n            \"performer\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueSampledData\",\n            \"valueAttachment\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"related\",\n            \"component\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"effective\": [\"effectiveDateTime\", \"effectivePeriod\"],\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDateTime\",\n                \"valuePeriod\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueSampledData\",\n                \"valueString\",\n                \"valueTime\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ObservationComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Component results.\n    Some observations have multiple component observations.  These component\n    observations are expressed as separate code value pairs that share the same\n    attributes.  Examples include systolic and diastolic component observations\n    for blood pressure measurement and multiple component observations for\n    genetics observations.\n    \"\"\"\n\n    __resource_type__ = \"ObservationComponent\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of component observation (code / type)\",\n        description=(\n            \"Describes what was observed. Sometimes this is called the observation \"\n            '\"code\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dataAbsentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"dataAbsentReason\",\n        title=\"Why the component result is missing\",\n        description=(\n            \"Provides a reason why the expected value in the element \"\n            \"Observation.value[x] is missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    interpretation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"interpretation\",\n        title=\"High, low, normal, etc.\",\n        description=(\n            \"The assessment made based on the result of the observation.  Intended \"\n            \"as a simple compact code often placed adjacent to the result value in \"\n            \"reports and flow sheets to signal the meaning/normalcy status of the \"\n            \"result. Otherwise known as abnormal flag.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    referenceRange: typing.List[fhirtypes.ObservationReferenceRangeType] | None = Field(\n        default=None,\n        alias=\"referenceRange\",\n        title=\"Provides guide for interpretation of component result\",\n        description=(\n            \"Guidance on how to interpret the value by comparison to a normal or \"\n            \"recommended range.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueSampledData\",\n            \"valueAttachment\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"dataAbsentReason\",\n            \"interpretation\",\n            \"referenceRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"code\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueSampledData\",\n            \"valueAttachment\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueCodeableConcept\",\n                \"valueDateTime\",\n                \"valuePeriod\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueSampledData\",\n                \"valueString\",\n                \"valueTime\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ObservationReferenceRange(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Provides guide for interpretation.\n    Guidance on how to interpret the value by comparison to a normal or\n    recommended range.\n    \"\"\"\n\n    __resource_type__ = \"ObservationReferenceRange\"\n\n    age: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"age\",\n        title=\"Applicable age range, if relevant\",\n        description=(\n            \"The age at which this reference range is applicable. This is a \"\n            \"neonatal age (e.g. number of weeks at term) if the meaning says so.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    appliesTo: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"appliesTo\",\n        title=\"Reference range population\",\n        description=(\n            \"Codes to indicate the target population this reference range applies \"\n            \"to.  For example, a reference range may be based on the normal \"\n            \"population or a particular sex or race.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    high: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"high\",\n        title=\"High Range, if relevant\",\n        description=(\n            \"The value of the high bound of the reference range.  The high bound of\"\n            \" the reference range endpoint is inclusive of the value (e.g.  \"\n            \"reference range is >=5 - <=9).   If the high bound is omitted,  it is \"\n            \"assumed to be meaningless (e.g. reference range is >= 2.3).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    low: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"low\",\n        title=\"Low Range, if relevant\",\n        description=(\n            \"The value of the low bound of the reference range.  The low bound of \"\n            \"the reference range endpoint is inclusive of the value (e.g.  \"\n            \"reference range is >=5 - <=9).   If the low bound is omitted,  it is \"\n            \"assumed to be meaningless (e.g. reference range is <=2.3).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text based reference range in an observation\",\n        description=(\n            \"Text based reference range in an observation which may be used when a \"\n            \"quantitative range is not appropriate for an observation.  An example \"\n            'would be a reference value of \"Negative\" or a list or table of '\n            \"'normals'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Reference range qualifier\",\n        description=(\n            \"Codes to indicate the what part of the targeted reference population \"\n            \"it applies to. For example, the normal or therapeutic range.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationReferenceRange`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"low\",\n            \"high\",\n            \"type\",\n            \"appliesTo\",\n            \"age\",\n            \"text\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationReferenceRange`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ObservationRelated(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource related to this observation.\n    A  reference to another resource (usually another Observation) whose\n    relationship is defined by the relationship type code.\n    \"\"\"\n\n    __resource_type__ = \"ObservationRelated\"\n\n    target: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"target\",\n        title=\"Resource that is related to this one\",\n        description=(\n            \"A reference to the observation or \"\n            \"[QuestionnaireResponse](questionnaireresponse.html#) resource that is \"\n            \"related to this observation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Observation\",\n                \"QuestionnaireResponse\",\n                \"Sequence\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"has-member | derived-from | sequel-to | replaces | qualified-by | \"\n            \"interfered-by\"\n        ),\n        description=(\n            \"A code specifying the kind of relationship that exists with the target\"\n            \" resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"has-member\",\n                \"derived-from\",\n                \"sequel-to\",\n                \"replaces\",\n                \"qualified-by\",\n                \"interfered-by\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"target\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/operationdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OperationDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass OperationDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of an operation or a named query.\n    A formal computable definition of an operation (on the RESTful interface)\n    or a named query (using the search interaction).\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinition\"\n\n    base: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"Marks this as a profile of the base\",\n        description=(\n            \"Indicates that this operation definition is a constraining profile on \"\n            \"the base.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationDefinition\"],\n        },\n    )\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Name used to invoke the operation\",\n        description=\"The name used to invoke the operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Additional information about use\",\n        description=\"Additional information about how to use this operation or named query.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the operation definition was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the operation \"\n            \"definition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the operation definition\",\n        description=(\n            \"A free text natural language description of the operation definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this operation definition is authored\"\n            \" for testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    idempotent: bool | None = Field(\n        default=None,\n        alias=\"idempotent\",\n        title=\"Whether content is unchanged by the operation\",\n        description=(\n            \"Operations that are idempotent (see [HTTP specification definition of \"\n            \"idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) \"\n            \"may be invoked by performing an HTTP GET operation instead of a POST.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    idempotent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_idempotent\", title=\"Extension field for ``idempotent``.\"\n    )\n\n    instance: bool | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"Invoke on an instance?\",\n        description=(\n            \"Indicates whether this operation can be invoked on a particular \"\n            \"instance of one of the given types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    instance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_instance\", title=\"Extension field for ``instance``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for operation definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the operation definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"operation | query\",\n        description=\"Whether this is an operation or a named query.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"operation\", \"query\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this operation definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the operation definition. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    overload: typing.List[fhirtypes.OperationDefinitionOverloadType] | None = Field(\n        default=None,\n        alias=\"overload\",\n        title=\"Define overloaded variants for when  generating code\",\n        description=(\n            \"Defines an appropriate combination of parameters to use when invoking \"\n            \"this operation, to help code generators when generating overloaded \"\n            \"parameter sets for this operation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    parameter: typing.List[fhirtypes.OperationDefinitionParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Parameters for the operation/query\",\n        description=\"The parameters for the operation/query.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the \"\n            \"operation definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this operation definition is defined\",\n        description=(\n            \"Explaination of why this operation definition is needed and why it has\"\n            \" been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    resource: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Types this operation applies to\",\n        description=\"The types on which this operation can be executed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    resource__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this operation definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    system: bool | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"Invoke at the system level?\",\n        description=(\n            \"Indicates whether this operation or named query can be invoked at the \"\n            \"system level (e.g. without needing to choose a resource type for the \"\n            \"context).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    type: bool | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Invole at the type level?\",\n        description=(\n            \"Indicates whether this operation or named query can be invoked at the \"\n            \"resource type level for any given resource type level (e.g. without \"\n            \"needing to choose a specific resource id for the context).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this operation definition (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this operation definition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD \"\n            \"be an address at which this operation definition is (or will be) \"\n            \"published. The URL SHOULD include the major version of the operation \"\n            \"definition. For more information see [Technical and Business \"\n            \"Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate operation definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the operation definition\",\n        description=(\n            \"The identifier that is used to identify this version of the operation \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the operation \"\n            \"definition author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"kind\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"idempotent\",\n            \"code\",\n            \"comment\",\n            \"base\",\n            \"resource\",\n            \"system\",\n            \"type\",\n            \"instance\",\n            \"parameter\",\n            \"overload\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"idempotent\",\n            \"code\",\n            \"base\",\n            \"resource\",\n            \"system\",\n            \"type\",\n            \"instance\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"code\", \"code__ext\"),\n            (\"instance\", \"instance__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"system\", \"system__ext\"),\n            (\"type\", \"type__ext\"),\n        ]\n        return required_fields\n\n\nclass OperationDefinitionOverload(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Define overloaded variants for when  generating code.\n    Defines an appropriate combination of parameters to use when invoking this\n    operation, to help code generators when generating overloaded parameter\n    sets for this operation.\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinitionOverload\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments to go on overload\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    parameterName: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"parameterName\",\n        title=\"Name of parameter to include in overload\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    parameterName__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_parameterName\",\n        title=\"Extension field for ``parameterName``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinitionOverload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"parameterName\", \"comment\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinitionOverload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass OperationDefinitionParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Parameters for the operation/query.\n    The parameters for the operation/query.\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinitionParameter\"\n\n    binding: fhirtypes.OperationDefinitionParameterBindingType | None = Field(\n        default=None,\n        alias=\"binding\",\n        title=\"ValueSet details if this is coded\",\n        description=(\n            \"Binds to a value set if this parameter is coded (code, Coding, \"\n            \"CodeableConcept).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Description of meaning/use\",\n        description=\"Describes the meaning or use of this parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum Cardinality (a number or *)\",\n        description=(\n            \"The maximum number of times this element is permitted to appear in the\"\n            \" request or response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum Cardinality\",\n        description=(\n            \"The minimum number of times this parameter SHALL appear in the request\"\n            \" or response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    name: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name in Parameters.parameter.name or in URL\",\n        description=\"The name of used to identify the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    part: typing.List[fhirtypes.OperationDefinitionParameterType] | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"Parts of a nested Parameter\",\n        description=\"The parts of a nested Parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    profile: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile on the type\",\n        description=\"A profile the specifies the rules that this parameter must conform to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n\n    searchType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"searchType\",\n        title=(\n            \"number | date | string | token | reference | composite | quantity | \" \"uri\"\n        ),\n        description=(\n            \"How the parameter is understood as a search parameter. This is only \"\n            \"used if the parameter type is 'string'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"number\",\n                \"date\",\n                \"string\",\n                \"token\",\n                \"reference\",\n                \"composite\",\n                \"quantity\",\n                \"uri\",\n            ],\n        },\n    )\n    searchType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_searchType\", title=\"Extension field for ``searchType``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"What type this parameter has\",\n        description=\"The type for this parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"in | out\",\n        description=\"Whether this is an input or an output parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"in\", \"out\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinitionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"use\",\n            \"min\",\n            \"max\",\n            \"documentation\",\n            \"type\",\n            \"searchType\",\n            \"profile\",\n            \"binding\",\n            \"part\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"max\", \"max__ext\"),\n            (\"min\", \"min__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"use\", \"use__ext\"),\n        ]\n        return required_fields\n\n\nclass OperationDefinitionParameterBinding(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    ValueSet details if this is coded.\n    Binds to a value set if this parameter is coded (code, Coding,\n    CodeableConcept).\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinitionParameterBinding\"\n\n    strength: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"strength\",\n        title=\"required | extensible | preferred | example\",\n        description=(\n            \"Indicates the degree of conformance expectations associated with this \"\n            \"binding - that is, the degree to which the provided value set must be \"\n            \"adhered to in the instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"required\", \"extensible\", \"preferred\", \"example\"],\n        },\n    )\n    strength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_strength\", title=\"Extension field for ``strength``.\"\n    )\n\n    valueSetReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueSetReference\",\n        title=\"Source of value set\",\n        description=(\n            \"Points to the value set or external definition (e.g. implicit value \"\n            \"set) that identifies the set of codes to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e valueSet[x]\n            \"one_of_many\": \"valueSet\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n\n    valueSetUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueSetUri\",\n        title=\"Source of value set\",\n        description=(\n            \"Points to the value set or external definition (e.g. implicit value \"\n            \"set) that identifies the set of codes to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e valueSet[x]\n            \"one_of_many\": \"valueSet\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueSetUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSetUri\", title=\"Extension field for ``valueSetUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinitionParameterBinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"strength\",\n            \"valueSetUri\",\n            \"valueSetReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameterBinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"strength\", \"strength__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"valueSet\": [\"valueSetReference\", \"valueSetUri\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/operationoutcome.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OperationOutcome\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass OperationOutcome(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the success/failure of an action.\n    A collection of error, warning or information messages that result from a\n    system action.\n    \"\"\"\n\n    __resource_type__ = \"OperationOutcome\"\n\n    issue: typing.List[fhirtypes.OperationOutcomeIssueType] = Field(\n        default=...,\n        alias=\"issue\",\n        title=\"A single issue associated with the action\",\n        description=(\n            \"An error, warning or information message that results from a system \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationOutcome`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"issue\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationOutcome`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"issue\"]\n\n\nclass OperationOutcomeIssue(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A single issue associated with the action.\n    An error, warning or information message that results from a system action.\n    \"\"\"\n\n    __resource_type__ = \"OperationOutcomeIssue\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Error or warning code\",\n        description=(\n            \"Describes the type of the issue. The system that creates an \"\n            \"OperationOutcome SHALL choose the most applicable code from the \"\n            \"IssueType value set, and may additional provide its own code for the \"\n            \"error in the details element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    details: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"details\",\n        title=\"Additional details about the error\",\n        description=(\n            \"Additional details about the error. This may be a text description of \"\n            \"the error, or a system code that identifies the error.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    diagnostics: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"diagnostics\",\n        title=\"Additional diagnostic information about the issue\",\n        description=(\n            \"Additional diagnostic information about the issue.  Typically, this \"\n            \"may be a description of how a value is erroneous, or a stack dump to \"\n            \"help trace the issue.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    diagnostics__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_diagnostics\", title=\"Extension field for ``diagnostics``.\"\n    )\n\n    expression: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"FHIRPath of element(s) related to issue\",\n        description=(\n            \"A simple FHIRPath limited to element names, repetition indicators and \"\n            \"the default child access that identifies one of the elements in the \"\n            \"resource that caused this issue to be raised.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    expression__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    location: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Path of element(s) related to issue\",\n        description=(\n            \"For resource issues, this will be a simple XPath limited to element \"\n            \"names, repetition indicators and the default child access that \"\n            \"identifies one of the elements in the resource that caused this issue \"\n            'to be raised.  For HTTP errors, will be \"http.\" + the parameter name.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    location__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_location\", title=\"Extension field for ``location``.\"\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"fatal | error | warning | information\",\n        description=(\n            \"Indicates whether the issue indicates a variation from successful \"\n            \"processing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"fatal\", \"error\", \"warning\", \"information\"],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationOutcomeIssue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"severity\",\n            \"code\",\n            \"details\",\n            \"diagnostics\",\n            \"location\",\n            \"expression\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationOutcomeIssue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"severity\",\n            \"code\",\n            \"details\",\n            \"diagnostics\",\n            \"location\",\n            \"expression\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"severity\", \"severity__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/organization.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Organization\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Organization(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A grouping of people or organizations with a common purpose.\n    A formally or informally recognized grouping of people or organizations\n    formed for the purpose of achieving some form of collective action.\n    Includes companies, institutions, corporations, departments, community\n    groups, healthcare practice groups, etc.\n    \"\"\"\n\n    __resource_type__ = \"Organization\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether the organization's record is still in active use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"An address for the organization\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=(\n            \"A list of\\u00a0alternate names that the organization is known as, or was \"\n            \"known as in the past\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    contact: typing.List[fhirtypes.OrganizationContactType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact for the organization for a certain purpose\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to services operated for the \"\n            \"organization\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifies this organization  across multiple systems\",\n        description=(\n            \"Identifier for the organization that is used to identify the \"\n            \"organization across multiple disparate systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name used for the organization\",\n        description=\"A name associated with the organization.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    partOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"The organization of which this organization forms a part\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the organization\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of organization\",\n        description=\"The kind(s) of organization that this is.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Organization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"type\",\n            \"name\",\n            \"alias\",\n            \"telecom\",\n            \"address\",\n            \"partOf\",\n            \"contact\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Organization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"type\",\n            \"name\",\n            \"partOf\",\n        ]\n\n\nclass OrganizationContact(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contact for the organization for a certain purpose.\n    \"\"\"\n\n    __resource_type__ = \"OrganizationContact\"\n\n    address: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Visiting or postal addresses for the contact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the contact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    purpose: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"The type of contact\",\n        description=\"Indicates a purpose for which the contact can be reached.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contact details (telephone, email, etc.)  for a contact\",\n        description=(\n            \"A contact detail (e.g. a telephone number or an email address) by \"\n            \"which the party may be contacted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OrganizationContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"purpose\",\n            \"name\",\n            \"telecom\",\n            \"address\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OrganizationContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/parameterdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ParameterDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass ParameterDefinition(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a parameter to a module.\n    The parameters to the module. This collection specifies both the input and\n    output parameters. Input parameters are provided by the caller as part of\n    the $evaluate operation. Output parameters are included in the\n    GuidanceResponse.\n    \"\"\"\n\n    __resource_type__ = \"ParameterDefinition\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"A brief description of the parameter\",\n        description=(\n            \"A brief discussion of what the parameter is for and how it is used by \"\n            \"the module.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum cardinality (a number of *)\",\n        description=(\n            \"The maximum number of times this element is permitted to appear in the\"\n            \" request or response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum cardinality\",\n        description=(\n            \"The minimum number of times this parameter SHALL appear in the request\"\n            \" or response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    name: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name used to access the parameter value\",\n        description=(\n            \"The name of the parameter used to allow access to the value of the \"\n            \"parameter in evaluation contexts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    profile: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"What profile the value is expected to be\",\n        description=(\n            \"If specified, this indicates a profile that the input data must \"\n            \"conform to, or that the output data will conform to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"What type of value\",\n        description=\"The type of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"in | out\",\n        description=\"Whether the parameter is input or output for the module.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"in\", \"out\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ParameterDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"name\",\n            \"use\",\n            \"min\",\n            \"max\",\n            \"documentation\",\n            \"type\",\n            \"profile\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ParameterDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"name\", \"use\", \"min\", \"max\", \"documentation\", \"type\", \"profile\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\"), (\"use\", \"use__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/parameters.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Parameters\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, fhirtypes, resource\n\n\nclass Parameters(resource.Resource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Operation Request or Response.\n    This special resource type is used to represent an operation request and\n    response (operations.html). It has no other use, and there is no RESTful\n    endpoint associated with it.\n    \"\"\"\n\n    __resource_type__ = \"Parameters\"\n\n    parameter: typing.List[fhirtypes.ParametersParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Operation Parameter\",\n        description=\"A parameter passed to or received from the operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Parameters`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"language\", \"parameter\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Parameters`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"parameter\"]\n\n\nclass ParametersParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Operation Parameter.\n    A parameter passed to or received from the operation.\n    \"\"\"\n\n    __resource_type__ = \"ParametersParameter\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name from the definition\",\n        description=\"The name of the parameter (reference to the operation definition).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    part: typing.List[fhirtypes.ParametersParameterType] | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"Named part of a multi-part parameter\",\n        description=\"A named part of a multi-part parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.ResourceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"If parameter is a whole resource\",\n        description=\"If the parameter is a whole resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"If parameter is a data type\",\n        description=\"If the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ParametersParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueMeta\",\n            \"resource\",\n            \"part\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ParametersParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"name\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueMeta\",\n            \"resource\",\n            \"part\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCoding\",\n                \"valueContactPoint\",\n                \"valueCount\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDuration\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueReference\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/patient.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Patient\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Patient(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about an individual or animal receiving health care services.\n    Demographics and other administrative information about an individual or\n    animal receiving care or other health-related services.\n    \"\"\"\n\n    __resource_type__ = \"Patient\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this patient's record is in active use\",\n        description=\"Whether this patient record is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Addresses for the individual\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    animal: fhirtypes.PatientAnimalType | None = Field(\n        default=None,\n        alias=\"animal\",\n        title=\"This patient is known to be an animal (non-human)\",\n        description=\"This patient is known to be an animal.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    birthDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"birthDate\",\n        title=\"The date of birth for the individual\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_birthDate\", title=\"Extension field for ``birthDate``.\"\n    )\n\n    communication: typing.List[fhirtypes.PatientCommunicationType] | None = Field(\n        default=None,\n        alias=\"communication\",\n        title=(\n            \"A list of Languages which may be used to communicate with the patient \"\n            \"about his or her health\"\n        ),\n        description=(\n            \"Languages which may be used to communicate with the patient about his \"\n            \"or her health.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.PatientContactType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"A contact party (e.g. guardian, partner, friend) for the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    deceasedBoolean: bool | None = Field(\n        default=None,\n        alias=\"deceasedBoolean\",\n        title=\"Indicates if the individual is deceased or not\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedBoolean\",\n        title=\"Extension field for ``deceasedBoolean``.\",\n    )\n\n    deceasedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"deceasedDateTime\",\n        title=\"Indicates if the individual is deceased or not\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedDateTime\",\n        title=\"Extension field for ``deceasedDateTime``.\",\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the patient is considered to \"\n            \"have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    generalPractitioner: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"generalPractitioner\",\n        title=\"Patient's nominated primary care provider\",\n        description=\"Patient's nominated care provider.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"Practitioner\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier for this patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.PatientLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Link to another patient resource that concerns the same actual person\",\n        description=(\n            \"Link to another patient resource that concerns the same actual \" \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"Organization that is the custodian of the patient record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    maritalStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"maritalStatus\",\n        title=\"Marital (civil) status of a patient\",\n        description=\"This field contains a patient's most recent marital (civil) status.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    multipleBirthBoolean: bool | None = Field(\n        default=None,\n        alias=\"multipleBirthBoolean\",\n        title=\"Whether patient is part of a multiple birth\",\n        description=(\n            \"Indicates whether the patient is part of a multiple (bool) or \"\n            \"indicates the actual birth order (integer).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e multipleBirth[x]\n            \"one_of_many\": \"multipleBirth\",\n            \"one_of_many_required\": False,\n        },\n    )\n    multipleBirthBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_multipleBirthBoolean\",\n        title=\"Extension field for ``multipleBirthBoolean``.\",\n    )\n\n    multipleBirthInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"multipleBirthInteger\",\n        title=\"Whether patient is part of a multiple birth\",\n        description=(\n            \"Indicates whether the patient is part of a multiple (bool) or \"\n            \"indicates the actual birth order (integer).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e multipleBirth[x]\n            \"one_of_many\": \"multipleBirth\",\n            \"one_of_many_required\": False,\n        },\n    )\n    multipleBirthInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_multipleBirthInteger\",\n        title=\"Extension field for ``multipleBirthInteger``.\",\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the patient\",\n        description=\"A name associated with the individual.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    photo: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Image of the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the individual\",\n        description=(\n            \"A contact detail (e.g. a telephone number or an email address) by \"\n            \"which the individual may be contacted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Patient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"deceasedBoolean\",\n            \"deceasedDateTime\",\n            \"address\",\n            \"maritalStatus\",\n            \"multipleBirthBoolean\",\n            \"multipleBirthInteger\",\n            \"photo\",\n            \"contact\",\n            \"animal\",\n            \"communication\",\n            \"generalPractitioner\",\n            \"managingOrganization\",\n            \"link\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Patient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"deceasedBoolean\",\n            \"deceasedDateTime\",\n            \"address\",\n            \"animal\",\n            \"managingOrganization\",\n            \"link\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"deceased\": [\"deceasedBoolean\", \"deceasedDateTime\"],\n            \"multipleBirth\": [\"multipleBirthBoolean\", \"multipleBirthInteger\"],\n        }\n        return one_of_many_fields\n\n\nclass PatientAnimal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    This patient is known to be an animal (non-human).\n    This patient is known to be an animal.\n    \"\"\"\n\n    __resource_type__ = \"PatientAnimal\"\n\n    breed: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"breed\",\n        title=\"E.g. Poodle, Angus\",\n        description=\"Identifies the detailed categorization of the kind of animal.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    genderStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"genderStatus\",\n        title=\"E.g. Neutered, Intact\",\n        description=\"Indicates the current state of the animal's reproductive organs.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    species: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"species\",\n        title=\"E.g. Dog, Cow\",\n        description=(\n            \"Identifies the high level taxonomic categorization of the kind of \"\n            \"animal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PatientAnimal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"species\",\n            \"breed\",\n            \"genderStatus\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PatientAnimal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"species\", \"breed\", \"genderStatus\"]\n\n\nclass PatientCommunication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A list of Languages which may be used to communicate with the patient about\n    his or her health.\n    Languages which may be used to communicate with the patient about his or\n    her health.\n    \"\"\"\n\n    __resource_type__ = \"PatientCommunication\"\n\n    language: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"language\",\n        title=(\n            \"The language which can be used to communicate with the patient about \"\n            \"his or her health\"\n        ),\n        description=(\n            \"The ISO-639-1 alpha 2 code in lower case for the language, optionally \"\n            \"followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in\"\n            ' upper case; e.g. \"en\" for English, or \"en-US\" for American English '\n            'versus \"en-EN\" for England English.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preferred: bool | None = Field(\n        default=None,\n        alias=\"preferred\",\n        title=\"Language preference indicator\",\n        description=(\n            \"Indicates whether or not the patient prefers this language (over other\"\n            \" languages he masters up a certain level).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preferred\", title=\"Extension field for ``preferred``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PatientCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"preferred\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PatientCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PatientContact(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A contact party (e.g. guardian, partner, friend) for the patient.\n    \"\"\"\n\n    __resource_type__ = \"PatientContact\"\n\n    address: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Address for the contact person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the contact person is \"\n            \"considered to have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    name: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the contact person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Organization that is associated with the contact\",\n        description=(\n            \"Organization on behalf of which the contact is acting or for which the\"\n            \" contact is working.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=(\n            \"The period during which this contact person or organization is valid \"\n            \"to be contacted relating to this patient\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"The kind of relationship\",\n        description=(\n            \"The nature of the relationship between the patient and the contact \"\n            \"person.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the person\",\n        description=(\n            \"A contact detail for the person, e.g. a telephone number or an email \"\n            \"address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PatientContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"relationship\",\n            \"name\",\n            \"telecom\",\n            \"address\",\n            \"gender\",\n            \"organization\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PatientContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PatientLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Link to another patient resource that concerns the same actual person.\n    Link to another patient resource that concerns the same actual patient.\n    \"\"\"\n\n    __resource_type__ = \"PatientLink\"\n\n    other: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"other\",\n        title=\"The other patient or related person resource that the link refers to\",\n        description=\"The other patient resource that the link refers to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"replaced-by | replaces | refer | seealso - type of link\",\n        description=(\n            \"The type of link between this patient resource and another patient \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"replaced-by\", \"replaces\", \"refer\", \"seealso\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PatientLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"other\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PatientLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"other\", \"type\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/paymentnotice.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PaymentNotice\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass PaymentNotice(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    PaymentNotice request.\n    This resource provides the status of the payment for goods and services\n    rendered, and the request and response resource references.\n    \"\"\"\n\n    __resource_type__ = \"PaymentNotice\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The notice business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Responsible organization\",\n        description=(\n            \"The organization which is responsible for the services rendered to the\"\n            \" patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    paymentStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"paymentStatus\",\n        title=\"Whether payment has been sent or cleared\",\n        description=(\n            \"The payment status, typically paid: payment sent, cleared: payment \"\n            \"received.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Request reference\",\n        description=\"Reference of resource for which payment is being made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    response: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"Response reference\",\n        description=\"Reference of response to resource for which payment is being made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"Payment or clearing date\",\n        description=\"The date when the above payment action occurrred.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    target: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Insurer or Regulatory body\",\n        description=\"The Insurer who is target  of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PaymentNotice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"request\",\n            \"response\",\n            \"statusDate\",\n            \"created\",\n            \"target\",\n            \"provider\",\n            \"organization\",\n            \"paymentStatus\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PaymentNotice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n"
  },
  {
    "path": "fhir/resources/STU3/paymentreconciliation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PaymentReconciliation\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass PaymentReconciliation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    PaymentReconciliation resource.\n    This resource provides payment details and claim references supporting a\n    bulk payment.\n    \"\"\"\n\n    __resource_type__ = \"PaymentReconciliation\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=(\n            \"The date when the enclosed suite of services were performed or \"\n            \"completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    detail: typing.List[fhirtypes.PaymentReconciliationDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"List of settlements\",\n        description=(\n            \"List of individual settlement amounts and the corresponding \"\n            \"transaction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"Printed Form Identifier\",\n        description=\"The form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The Response business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Insurer\",\n        description=\"The Insurer who produced this adjudicated response.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"complete | error | partial\",\n        description=\"Transaction status: error, complete.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period covered\",\n        description=(\n            \"The period of time for which payments have been gathered into this \"\n            \"bulk payment for settlement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    processNote: typing.List[\n        fhirtypes.PaymentReconciliationProcessNoteType\n    ] | None = Field(\n        default=None,\n        alias=\"processNote\",\n        title=\"Processing comments\",\n        description=\"Suite of notes.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Claim reference\",\n        description=\"Original request resource reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ProcessRequest\"],\n        },\n    )\n\n    requestOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestOrganization\",\n        title=\"Responsible organization\",\n        description=(\n            \"The organization which is responsible for the services rendered to the\"\n            \" patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    requestProvider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestProvider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    total: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"Total amount of Payment\",\n        description=\"Total payment amount.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PaymentReconciliation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"period\",\n            \"created\",\n            \"organization\",\n            \"request\",\n            \"outcome\",\n            \"disposition\",\n            \"requestProvider\",\n            \"requestOrganization\",\n            \"detail\",\n            \"form\",\n            \"total\",\n            \"processNote\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PaymentReconciliation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n\n\nclass PaymentReconciliationDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of settlements.\n    List of individual settlement amounts and the corresponding transaction.\n    \"\"\"\n\n    __resource_type__ = \"PaymentReconciliationDetail\"\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Amount being paid\",\n        description=\"Amount paid for this detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Invoice date\",\n        description=\"The date of the invoice or financial resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    payee: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"payee\",\n        title=\"Organization which is receiving the payment\",\n        description=\"The organization which is receiving the payment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Claim\",\n        description=\"The claim or financial resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    response: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"Claim Response\",\n        description=\"The claim response resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    submitter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"submitter\",\n        title=\"Organization which submitted the claim\",\n        description=\"The Organization which submitted the claim or financial transaction.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type code\",\n        description=(\n            \"Code to indicate the nature of the payment, adjustment, funds advance,\"\n            \" etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PaymentReconciliationDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"request\",\n            \"response\",\n            \"submitter\",\n            \"payee\",\n            \"date\",\n            \"amount\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PaymentReconciliationDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PaymentReconciliationProcessNote(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing comments.\n    Suite of notes.\n    \"\"\"\n\n    __resource_type__ = \"PaymentReconciliationProcessNote\"\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Comment on the processing\",\n        description=\"The note text.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"display | print | printoper\",\n        description=\"The note purpose: Print/Display.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PaymentReconciliationProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PaymentReconciliationProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/period.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Period\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Period(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Time range defined by start and end date/time.\n    A time period defined by a start and end date and optionally time.\n    \"\"\"\n\n    __resource_type__ = \"Period\"\n\n    end: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"End time with inclusive boundary, if not ongoing\",\n        description=(\n            \"The end of the period. If the end of the period is missing, it means \"\n            \"that the period is ongoing. The start may be in the past, and the end \"\n            \"date in the future, which means that period is expected/planned to end\"\n            \" at that time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    start: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Starting time with inclusive boundary\",\n        description=\"The start of the period. The boundary is inclusive.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Period`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"start\", \"end\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Period`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"start\", \"end\"]\n"
  },
  {
    "path": "fhir/resources/STU3/person.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Person\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Person(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A generic person record.\n    Demographics and administrative information about a person independent of a\n    specific health-related context.\n    \"\"\"\n\n    __resource_type__ = \"Person\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"This person's record is in active use\",\n        description=\"Whether this person's record is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"One or more addresses for the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    birthDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"birthDate\",\n        title=\"The date on which the person was born\",\n        description=\"The birth date for the person.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_birthDate\", title=\"Extension field for ``birthDate``.\"\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=\"Administrative Gender.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"A human identifier for this person\",\n        description=\"Identifier for a person within a particular scope.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.PersonLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Link to a resource that concerns the same actual person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"The organization that is the custodian of the person record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    photo: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Image of the person\",\n        description=(\n            \"An image that can be displayed as a thumbnail of the person to enhance\"\n            \" the identification of the individual.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the person\",\n        description=(\n            \"A contact detail for the person, e.g. a telephone number or an email \"\n            \"address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Person`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"address\",\n            \"photo\",\n            \"managingOrganization\",\n            \"active\",\n            \"link\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Person`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"managingOrganization\",\n            \"active\",\n        ]\n\n\nclass PersonLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Link to a resource that concerns the same actual person.\n    \"\"\"\n\n    __resource_type__ = \"PersonLink\"\n\n    assurance: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"assurance\",\n        title=\"level1 | level2 | level3 | level4\",\n        description=(\n            \"Level of assurance that this link is actually associated with the \"\n            \"target resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"level1\", \"level2\", \"level3\", \"level4\"],\n        },\n    )\n    assurance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_assurance\", title=\"Extension field for ``assurance``.\"\n    )\n\n    target: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"target\",\n        title=\"The resource to which this actual person is associated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Person\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PersonLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"target\", \"assurance\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PersonLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/plandefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PlanDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass PlanDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The definition of a plan for a series of actions, independent of any\n    specific patient or context.\n    This resource allows for the definition of various types of plans as a\n    sharable, consumable, and executable artifact. The resource is general\n    enough to support the description of a broad range of clinical artifacts\n    such as clinical decision support rules, order sets and protocols.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinition\"\n\n    action: typing.List[fhirtypes.PlanDefinitionActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Action defined by the plan\",\n        description=\"An action to be taken as part of the plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the plan definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contributor: typing.List[fhirtypes.ContributorType] | None = Field(\n        default=None,\n        alias=\"contributor\",\n        title=\"A content contributor\",\n        description=(\n            \"A contributor to the content of the asset, including authors, editors,\"\n            \" reviewers, and endorsers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the plan definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the plan definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the plan definition was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the plan definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the plan definition\",\n        description=(\n            \"A free text natural language description of the plan definition from a\"\n            \" consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the plan definition is expected to be used\",\n        description=(\n            \"The period during which the plan definition content was or is planned \"\n            \"to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this plan definition is authored for \"\n            \"testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    goal: typing.List[fhirtypes.PlanDefinitionGoalType] | None = Field(\n        default=None,\n        alias=\"goal\",\n        title=\"What the plan is trying to accomplish\",\n        description=(\n            \"Goals that describe what the activities within the plan are intended \"\n            \"to achieve. For example, weight loss, restoring an activity of daily \"\n            \"living, obtaining herd immunity via immunization, meeting a process \"\n            \"improvement objective, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the plan definition\",\n        description=(\n            \"A formal identifier that is used to identify this plan definition when\"\n            \" it is represented in other formats, or referenced in a specification,\"\n            \" model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for plan definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the plan definition is intended \"\n            \"to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the plan definition was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval, but doesn't change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    library: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the plan definition\",\n        description=(\n            \"A reference to a Library resource containing any formal logic used by \"\n            \"the plan definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this plan definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the plan definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the plan \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this plan definition is defined\",\n        description=(\n            \"Explaination of why this plan definition is needed and why it has been\"\n            \" designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Related artifacts for the asset\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this plan definition. Enables tracking the life-cycle of\"\n            \" the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this plan definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the plan definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptive topics related to the content of the plan definition. \"\n            \"Topics provide a high-level categorization of the definition that can \"\n            \"be useful for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"order-set | protocol | eca-rule\",\n        description=(\n            \"The type of asset the plan definition represents, e.g. an order set, \"\n            \"protocol, or event-condition-action rule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this plan definition (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this plan definition when it \"\n            \"is referenced in a specification, model, design or an instance. This \"\n            \"SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at\"\n            \" which this plan definition is (or will be) published. The URL SHOULD \"\n            \"include the major version of the plan definition. For more information\"\n            \" see [Technical and Business Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the asset\",\n        description=(\n            \"A detailed description of how the asset is used from a clinical \"\n            \"perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate plan definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the plan definition\",\n        description=(\n            \"The identifier that is used to identify this version of the plan \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the plan definition \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence. To provide a version consistent with the \"\n            \"Decision Support Service specification, use the format \"\n            \"Major.Minor.Revision (e.g. 1.0.0). For more information on versioning \"\n            \"knowledge assets, refer to the Decision Support Service specification.\"\n            \" Note that a version is required for non-experimental active \"\n            \"artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"type\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"description\",\n            \"purpose\",\n            \"usage\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"topic\",\n            \"contributor\",\n            \"contact\",\n            \"copyright\",\n            \"relatedArtifact\",\n            \"library\",\n            \"goal\",\n            \"action\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"type\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"description\",\n            \"effectivePeriod\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"contact\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass PlanDefinitionAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Action defined by the plan.\n    An action to be taken as part of the plan.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionAction\"\n\n    action: typing.List[fhirtypes.PlanDefinitionActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"A sub-action\",\n        description=(\n            \"Sub actions that are contained within the action. The behavior of this\"\n            \" action determines the functionality of the sub-actions. For example, \"\n            \"a selection behavior of at-most-one indicates that of the sub-actions,\"\n            \" at most one may be chosen as part of realizing the action definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    cardinalityBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"cardinalityBehavior\",\n        title=\"single | multiple\",\n        description=\"Defines whether the action can be selected multiple times.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"single\", \"multiple\"],\n        },\n    )\n    cardinalityBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_cardinalityBehavior\",\n        title=\"Extension field for ``cardinalityBehavior``.\",\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code representing the meaning of the action or sub-actions\",\n        description=(\n            \"A code that provides meaning for the action or action group. For \"\n            \"example, a section may have a LOINC code for a the section of a \"\n            \"documentation template.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    condition: typing.List[fhirtypes.PlanDefinitionActionConditionType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Whether or not the action is applicable\",\n        description=(\n            \"An expression that describes applicability criteria, or start/stop \"\n            \"conditions for the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Description of the activity to be performed\",\n        description=(\n            \"A reference to an ActivityDefinition that describes the action to be \"\n            \"taken in detail, or a PlanDefinition that describes a series of \"\n            \"actions to be taken.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Short description of the action\",\n        description=(\n            \"A short description of the action used to provide a summary to display\"\n            \" to the user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Supporting documentation for the intended performer of the action\",\n        description=(\n            \"Didactic or other informational resources associated with the action \"\n            \"that can be provided to the CDS recipient. Information resources can \"\n            \"include inline text commentary and links to web resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dynamicValue: typing.List[\n        fhirtypes.PlanDefinitionActionDynamicValueType\n    ] | None = Field(\n        default=None,\n        alias=\"dynamicValue\",\n        title=\"Dynamic aspects of the definition\",\n        description=(\n            \"Customizations that should be applied to the statically defined \"\n            \"resource. For example, if the dosage of a medication must be computed \"\n            \"based on the patient's weight, a customization would be used to \"\n            \"specify an expression that calculated the weight, and the path on the \"\n            \"resource that would contain the result.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    goalId: typing.List[fhirtypes.IdType | None] | None = Field(\n        default=None,\n        alias=\"goalId\",\n        title=\"What goals this action supports\",\n        description=(\n            \"Identifies goals that this action supports. The reference must be to a\"\n            \" goal element defined within this plan definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    goalId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_goalId\", title=\"Extension field for ``goalId``.\"\n    )\n\n    groupingBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"groupingBehavior\",\n        title=\"visual-group | logical-group | sentence-group\",\n        description=\"Defines the grouping behavior for the action and its children.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"visual-group\", \"logical-group\", \"sentence-group\"],\n        },\n    )\n    groupingBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_groupingBehavior\",\n        title=\"Extension field for ``groupingBehavior``.\",\n    )\n\n    input: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"input\",\n        title=\"Input data requirements\",\n        description=\"Defines input data requirements for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"User-visible label for the action (e.g. 1. or A.)\",\n        description=\"A user-visible label for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    output: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"output\",\n        title=\"Output data definition\",\n        description=\"Defines the outputs of the action, if any.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    participant: typing.List[\n        fhirtypes.PlanDefinitionActionParticipantType\n    ] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Who should participate in the action\",\n        description=\"Indicates who should participate in performing the action described.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    precheckBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"precheckBehavior\",\n        title=\"yes | no\",\n        description=\"Defines whether the action should usually be preselected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"yes\", \"no\"],\n        },\n    )\n    precheckBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_precheckBehavior\",\n        title=\"Extension field for ``precheckBehavior``.\",\n    )\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why the action should be performed\",\n        description=\"A description of why this action is necessary or appropriate.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedAction: typing.List[\n        fhirtypes.PlanDefinitionActionRelatedActionType\n    ] | None = Field(\n        default=None,\n        alias=\"relatedAction\",\n        title=\"Relationship to another action\",\n        description=(\n            'A relationship to another action such as \"before\" or \"30-60 minutes '\n            'after start of\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requiredBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"requiredBehavior\",\n        title=\"must | could | must-unless-documented\",\n        description=\"Defines the requiredness behavior for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"must\", \"could\", \"must-unless-documented\"],\n        },\n    )\n    requiredBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requiredBehavior\",\n        title=\"Extension field for ``requiredBehavior``.\",\n    )\n\n    selectionBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"selectionBehavior\",\n        title=\"any | all | all-or-none | exactly-one | at-most-one | one-or-more\",\n        description=\"Defines the selection behavior for the action and its children.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"any\",\n                \"all\",\n                \"all-or-none\",\n                \"exactly-one\",\n                \"at-most-one\",\n                \"one-or-more\",\n            ],\n        },\n    )\n    selectionBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_selectionBehavior\",\n        title=\"Extension field for ``selectionBehavior``.\",\n    )\n\n    textEquivalent: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"textEquivalent\",\n        title=(\n            \"Static text equivalent of the action, used if the dynamic aspects \"\n            \"cannot be interpreted by the receiving system\"\n        ),\n        description=(\n            \"A text equivalent of the action to be performed. This provides a \"\n            \"human-interpretable description of the action when the definition is \"\n            \"consumed by a system that may not be capable of interpreting it \"\n            \"dynamically.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    textEquivalent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_textEquivalent\",\n        title=\"Extension field for ``textEquivalent``.\",\n    )\n\n    timingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timingDateTime\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timingDateTime\",\n        title=\"Extension field for ``timingDateTime``.\",\n    )\n\n    timingDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"timingDuration\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"timingRange\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"User-visible title\",\n        description=\"The title of the action displayed to a user.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    transform: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"transform\",\n        title=\"Transform to apply the template\",\n        description=(\n            \"A reference to a StructureMap resource that defines a transform that \"\n            \"can be executed to produce the intent resource using the \"\n            \"ActivityDefinition instance as the input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureMap\"],\n        },\n    )\n\n    triggerDefinition: typing.List[fhirtypes.TriggerDefinitionType] | None = Field(\n        default=None,\n        alias=\"triggerDefinition\",\n        title=\"When the action should be triggered\",\n        description=\"A description of when the action should be triggered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"create | update | remove | fire-event\",\n        description=\"The type of action to perform (create, update, remove).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"label\",\n            \"title\",\n            \"description\",\n            \"textEquivalent\",\n            \"code\",\n            \"reason\",\n            \"documentation\",\n            \"goalId\",\n            \"triggerDefinition\",\n            \"condition\",\n            \"input\",\n            \"output\",\n            \"relatedAction\",\n            \"timingDateTime\",\n            \"timingPeriod\",\n            \"timingDuration\",\n            \"timingRange\",\n            \"timingTiming\",\n            \"participant\",\n            \"type\",\n            \"groupingBehavior\",\n            \"selectionBehavior\",\n            \"requiredBehavior\",\n            \"precheckBehavior\",\n            \"cardinalityBehavior\",\n            \"definition\",\n            \"transform\",\n            \"dynamicValue\",\n            \"action\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\n                \"timingDateTime\",\n                \"timingDuration\",\n                \"timingPeriod\",\n                \"timingRange\",\n                \"timingTiming\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass PlanDefinitionActionCondition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Whether or not the action is applicable.\n    An expression that describes applicability criteria, or start/stop\n    conditions for the action.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionCondition\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the condition\",\n        description=(\n            \"A brief, natural language description of the condition that \"\n            \"effectively communicates the intended semantics.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Boolean-valued expression\",\n        description=(\n            \"An expression that returns true or false, indicating whether or not \"\n            \"the condition is satisfied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"applicability | start | stop\",\n        description=\"The kind of condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"applicability\", \"start\", \"stop\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    language: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language of the expression\",\n        description=\"The media type of the language for the expression.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"kind\",\n            \"description\",\n            \"language\",\n            \"expression\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"kind\", \"kind__ext\")]\n        return required_fields\n\n\nclass PlanDefinitionActionDynamicValue(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dynamic aspects of the definition.\n    Customizations that should be applied to the statically defined resource.\n    For example, if the dosage of a medication must be computed based on the\n    patient's weight, a customization would be used to specify an expression\n    that calculated the weight, and the path on the resource that would contain\n    the result.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionDynamicValue\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the dynamic value\",\n        description=(\n            \"A brief, natural language description of the intended semantics of the\"\n            \" dynamic value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"An expression that provides the dynamic value for the customization\",\n        description=\"An expression specifying the value of the customized element.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    language: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language of the expression\",\n        description=\"The media type of the language for the expression.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"The path to the element to be set dynamically\",\n        description=(\n            \"The path to the element to be customized. This is the path on the \"\n            \"resource that will hold the result of the calculation defined by the \"\n            \"expression.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"path\",\n            \"language\",\n            \"expression\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PlanDefinitionActionParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who should participate in the action.\n    Indicates who should participate in performing the action described.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionParticipant\"\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"E.g. Nurse, Surgeon, Parent, etc\",\n        description=(\n            \"The role the participant should play in performing the described \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"patient | practitioner | related-person\",\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"patient\", \"practitioner\", \"related-person\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"role\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass PlanDefinitionActionRelatedAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationship to another action.\n    A relationship to another action such as \"before\" or \"30-60 minutes after\n    start of\".\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionRelatedAction\"\n\n    actionId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"actionId\",\n        title=\"What action is this related to\",\n        description=\"The element id of the related action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    actionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actionId\", title=\"Extension field for ``actionId``.\"\n    )\n\n    offsetDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"offsetDuration\",\n        title=\"Time offset for the relationship\",\n        description=(\n            \"A duration or range of durations to apply to the relationship. For \"\n            \"example, 30-60 minutes before.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e offset[x]\n            \"one_of_many\": \"offset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    offsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"offsetRange\",\n        title=\"Time offset for the relationship\",\n        description=(\n            \"A duration or range of durations to apply to the relationship. For \"\n            \"example, 30-60 minutes before.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e offset[x]\n            \"one_of_many\": \"offset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    relationship: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=(\n            \"before-start | before | before-end | concurrent-with-start | \"\n            \"concurrent | concurrent-with-end | after-start | after | after-end\"\n        ),\n        description=\"The relationship of this action to the related action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"before-start\",\n                \"before\",\n                \"before-end\",\n                \"concurrent-with-start\",\n                \"concurrent\",\n                \"concurrent-with-end\",\n                \"after-start\",\n                \"after\",\n                \"after-end\",\n            ],\n        },\n    )\n    relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relationship\",\n        title=\"Extension field for ``relationship``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionRelatedAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"actionId\",\n            \"relationship\",\n            \"offsetDuration\",\n            \"offsetRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionRelatedAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"actionId\", \"actionId__ext\"),\n            (\"relationship\", \"relationship__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"offset\": [\"offsetDuration\", \"offsetRange\"]}\n        return one_of_many_fields\n\n\nclass PlanDefinitionGoal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What the plan is trying to accomplish.\n    Goals that describe what the activities within the plan are intended to\n    achieve. For example, weight loss, restoring an activity of daily living,\n    obtaining herd immunity via immunization, meeting a process improvement\n    objective, etc.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionGoal\"\n\n    addresses: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"addresses\",\n        title=\"What does the goal address\",\n        description=(\n            \"Identifies problems, conditions, issues, or concerns the goal is \"\n            \"intended to address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"E.g. Treatment, dietary, behavioral, etc\",\n        description=\"Indicates a category the goal falls within.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"description\",\n        title=\"Code or text describing the goal\",\n        description=(\n            \"Human-readable and/or coded description of a specific desired \"\n            'objective of care, such as \"control blood pressure\" or \"negotiate an '\n            'obstacle course\" or \"dance with child at wedding\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Supporting documentation for the goal\",\n        description=(\n            \"Didactic or other informational resources associated with the goal \"\n            \"that provide further supporting information about the goal. \"\n            \"Information resources can include inline text commentary and links to \"\n            \"web resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"high-priority | medium-priority | low-priority\",\n        description=(\n            \"Identifies the expected level of importance associated with \"\n            \"reaching/sustaining the defined goal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    start: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"When goal pursuit begins\",\n        description=\"The event after which the goal should begin being pursued.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    target: typing.List[fhirtypes.PlanDefinitionGoalTargetType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Target outcome for the goal\",\n        description=\"Indicates what should be done and within what timeframe.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionGoal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"description\",\n            \"priority\",\n            \"start\",\n            \"addresses\",\n            \"documentation\",\n            \"target\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionGoal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PlanDefinitionGoalTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Target outcome for the goal.\n    Indicates what should be done and within what timeframe.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionGoalTarget\"\n\n    detailCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"detailCodeableConcept\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both \"\n            \"values of the range can be specified. Whan a low value is missing, it \"\n            \"indicates that the goal is achieved at any value at or below the high \"\n            \"value. Similarly, if the high value is missing, it indicates that the \"\n            \"goal is achieved at any value at or above the low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"detailQuantity\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both \"\n            \"values of the range can be specified. Whan a low value is missing, it \"\n            \"indicates that the goal is achieved at any value at or below the high \"\n            \"value. Similarly, if the high value is missing, it indicates that the \"\n            \"goal is achieved at any value at or above the low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"detailRange\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both \"\n            \"values of the range can be specified. Whan a low value is missing, it \"\n            \"indicates that the goal is achieved at any value at or below the high \"\n            \"value. Similarly, if the high value is missing, it indicates that the \"\n            \"goal is achieved at any value at or above the low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    due: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"due\",\n        title=\"Reach goal within\",\n        description=(\n            \"Indicates the timeframe after the start of the goal in which the goal \"\n            \"should be met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    measure: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"measure\",\n        title=\"The parameter whose value is to be tracked\",\n        description=(\n            \"The parameter whose value is to be tracked, e.g. body weigth, blood \"\n            \"pressure, or hemoglobin A1c level.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionGoalTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"measure\",\n            \"detailQuantity\",\n            \"detailRange\",\n            \"detailCodeableConcept\",\n            \"due\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionGoalTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"detail\": [\"detailCodeableConcept\", \"detailQuantity\", \"detailRange\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/practitioner.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Practitioner\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Practitioner(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A person with a  formal responsibility in the provisioning of healthcare or\n    related services.\n    A person who is directly or indirectly involved in the provisioning of\n    healthcare.\n    \"\"\"\n\n    __resource_type__ = \"Practitioner\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this practitioner's record is in active use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=(\n            \"Address(es) of the practitioner that are not role specific (typically \"\n            \"home address)\"\n        ),\n        description=(\n            \"Address(es) of the practitioner that are not role specific (typically \"\n            \"home address).  Work addresses are not typically entered in this \"\n            \"property as they are usually role dependent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    birthDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"birthDate\",\n        title=\"The date  on which the practitioner was born\",\n        description=\"The date of birth for the practitioner.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_birthDate\", title=\"Extension field for ``birthDate``.\"\n    )\n\n    communication: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"communication\",\n        title=\"A language the practitioner is able to use in patient communication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the person is considered to \"\n            \"have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"A identifier for the person as this agent\",\n        description=\"An identifier that applies to this person in this role.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The name(s) associated with the practitioner\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    photo: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Image of the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    qualification: typing.List[fhirtypes.PractitionerQualificationType] | None = Field(\n        default=None,\n        alias=\"qualification\",\n        title=\"Qualifications obtained by training and certification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the practitioner (that apply to all roles)\",\n        description=(\n            \"A contact detail for the practitioner, e.g. a telephone number or an \"\n            \"email address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Practitioner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"address\",\n            \"gender\",\n            \"birthDate\",\n            \"photo\",\n            \"qualification\",\n            \"communication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Practitioner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"address\",\n            \"gender\",\n            \"birthDate\",\n        ]\n\n\nclass PractitionerQualification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Qualifications obtained by training and certification.\n    \"\"\"\n\n    __resource_type__ = \"PractitionerQualification\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Coded representation of the qualification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier for this qualification for the practitioner\",\n        description=(\n            \"An identifier that applies to this person's qualification in this \" \"role.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    issuer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"issuer\",\n        title=\"Organization that regulates and issues the qualification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period during which the qualification is valid\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PractitionerQualification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"period\",\n            \"issuer\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PractitionerQualification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/practitionerrole.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PractitionerRole\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass PractitionerRole(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Roles/organizations the practitioner is associated with.\n    A specific set of Roles/Locations/specialties/services that a practitioner\n    may perform at an organization for a period of time.\n    \"\"\"\n\n    __resource_type__ = \"PractitionerRole\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this practitioner's record is in active use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    availabilityExceptions: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"availabilityExceptions\",\n        title=\"Description of availability exceptions\",\n        description=(\n            \"A description of site availability exceptions, e.g. public holiday \"\n            \"availability. Succinctly describing all possible exceptions to normal \"\n            \"site availability as details in the available Times and not available \"\n            \"Times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availabilityExceptions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availabilityExceptions\",\n        title=\"Extension field for ``availabilityExceptions``.\",\n    )\n\n    availableTime: typing.List[\n        fhirtypes.PractitionerRoleAvailableTimeType\n    ] | None = Field(\n        default=None,\n        alias=\"availableTime\",\n        title=\"Times the Service Site is available\",\n        description=\"A collection of times that the Service Site is available.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Roles which this practitioner may perform\",\n        description=(\n            \"Roles which this practitioner is authorized to perform for the \"\n            \"organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to services operated for the \"\n            \"practitioner with this role\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    healthcareService: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"healthcareService\",\n        title=(\n            \"The list of healthcare services that this worker provides for this \"\n            \"role's Organization/Location(s)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"HealthcareService\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifiers that are specific to a role/location\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"The location(s) at which this practitioner provides care\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    notAvailable: typing.List[\n        fhirtypes.PractitionerRoleNotAvailableType\n    ] | None = Field(\n        default=None,\n        alias=\"notAvailable\",\n        title=\"Not available during this time due to provided reason\",\n        description=(\n            \"The HealthcareService is not available during this period of time due \"\n            \"to the provided reason.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Organization where the roles are available\",\n        description=\"The organization where the Practitioner performs the roles associated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=(\n            \"The period during which the practitioner is authorized to perform in \"\n            \"these role(s)\"\n        ),\n        description=(\n            \"The period during which the person is authorized to act as a \"\n            \"practitioner in these role(s) for the organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    practitioner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"practitioner\",\n        title=(\n            \"Practitioner that is able to provide the defined services for the \"\n            \"organation\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=\"Specific specialty of the practitioner\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contact details that are specific to the role/location/service\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PractitionerRole`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"period\",\n            \"practitioner\",\n            \"organization\",\n            \"code\",\n            \"specialty\",\n            \"location\",\n            \"healthcareService\",\n            \"telecom\",\n            \"availableTime\",\n            \"notAvailable\",\n            \"availabilityExceptions\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PractitionerRole`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"period\",\n            \"practitioner\",\n            \"organization\",\n            \"code\",\n            \"specialty\",\n            \"location\",\n            \"telecom\",\n        ]\n\n\nclass PractitionerRoleAvailableTime(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Times the Service Site is available.\n    A collection of times that the Service Site is available.\n    \"\"\"\n\n    __resource_type__ = \"PractitionerRoleAvailableTime\"\n\n    allDay: bool | None = Field(\n        default=None,\n        alias=\"allDay\",\n        title=\"Always available? e.g. 24 hour service\",\n        description=(\n            \"Is this always available? (hence times are irrelevant) e.g. 24 hour \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    allDay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_allDay\", title=\"Extension field for ``allDay``.\"\n    )\n\n    availableEndTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"availableEndTime\",\n        title=\"Closing time of day (ignored if allDay = true)\",\n        description=(\n            \"The closing time of day. Note: If the AllDay flag is set, then this \"\n            \"time is ignored.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availableEndTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availableEndTime\",\n        title=\"Extension field for ``availableEndTime``.\",\n    )\n\n    availableStartTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"availableStartTime\",\n        title=\"Opening time of day (ignored if allDay = true)\",\n        description=(\n            \"The opening time of day. Note: If the AllDay flag is set, then this \"\n            \"time is ignored.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    availableStartTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availableStartTime\",\n        title=\"Extension field for ``availableStartTime``.\",\n    )\n\n    daysOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"daysOfWeek\",\n        title=\"mon | tue | wed | thu | fri | sat | sun\",\n        description=(\n            \"Indicates which days of the week are available between the start and \"\n            \"end Times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"],\n        },\n    )\n    daysOfWeek__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_daysOfWeek\", title=\"Extension field for ``daysOfWeek``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PractitionerRoleAvailableTime`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"daysOfWeek\",\n            \"allDay\",\n            \"availableStartTime\",\n            \"availableEndTime\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PractitionerRoleAvailableTime`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PractitionerRoleNotAvailable(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Not available during this time due to provided reason.\n    The HealthcareService is not available during this period of time due to\n    the provided reason.\n    \"\"\"\n\n    __resource_type__ = \"PractitionerRoleNotAvailable\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Reason presented to the user explaining why time not available\",\n        description=(\n            \"The reason that can be presented to the user as to why this time is \"\n            \"not available.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    during: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"during\",\n        title=\"Service not availablefrom this date\",\n        description=(\n            \"Service is not available (seasonally or for a public holiday) from \"\n            \"this date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PractitionerRoleNotAvailable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"description\", \"during\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PractitionerRoleNotAvailable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"description\", \"description__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/procedure.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Procedure\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Procedure(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An action that is being or was performed on a patient.\n    An action that is or was performed on a patient. This can be a physical\n    intervention like an operation, or less invasive like counseling or\n    hypnotherapy.\n    \"\"\"\n\n    __resource_type__ = \"Procedure\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"A request for this procedure\",\n        description=(\n            \"A reference to a resource that contains details of the request for \"\n            \"this procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\", \"ProcedureRequest\", \"ReferralRequest\"],\n        },\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Target body sites\",\n        description=(\n            \"Detailed and structured anatomical location information. Multiple \"\n            \"locations are allowed - e.g. multiple punch biopsies of a lesion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classification of the procedure\",\n        description=(\n            \"A code that classifies the procedure for searching, sorting and \"\n            'display purposes (e.g. \"Surgical Procedure\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Identification of the procedure\",\n        description=(\n            \"The specific procedure that is performed. Use text if the exact nature\"\n            ' of the procedure cannot be coded (e.g. \"Laparoscopic Appendectomy\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    complication: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"complication\",\n        title=\"Complication following the procedure\",\n        description=(\n            \"Any complications that occurred during the procedure, or in the \"\n            \"immediate post-performance period. These are generally tracked \"\n            \"separately from the notes, which will typically describe the procedure\"\n            \" itself rather than any 'post procedure' issues.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    complicationDetail: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"complicationDetail\",\n        title=\"A condition that\\u00a0is a result of the procedure\",\n        description=(\n            \"Any complications that occurred during the procedure, or in the \"\n            \"immediate post-performance period.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or episode associated with the procedure\",\n        description=\"The encounter during which the procedure was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    definition: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Instantiates protocol or definition\",\n        description=(\n            \"A protocol, guideline, orderset or other definition that was adhered \"\n            \"to in whole or in part by this procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"ActivityDefinition\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    focalDevice: typing.List[fhirtypes.ProcedureFocalDeviceType] | None = Field(\n        default=None,\n        alias=\"focalDevice\",\n        title=\"Device changed in procedure\",\n        description=(\n            \"A device that is implanted, removed or otherwise manipulated \"\n            \"(calibration, battery replacement, fitting a prosthesis, attaching a \"\n            \"wound-vac, etc.) as a focal portion of the Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    followUp: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"followUp\",\n        title=\"Instructions for follow up\",\n        description=(\n            \"If the procedure required specific follow up - e.g. removal of \"\n            \"sutures. The followup may be represented as a simple note, or could \"\n            \"potentially be more complex in which case the CarePlan resource can be\"\n            \" used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Identifiers for this procedure\",\n        description=(\n            \"This records identifiers associated with this procedure that are \"\n            \"defined by business processes and/or used to refer to it when a direct\"\n            \" URL reference to the resource itself is not appropriate (e.g. in CDA \"\n            \"documents, or in written / printed documentation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the procedure happened\",\n        description=(\n            \"The location where the procedure actually happened.  E.g. a newborn at\"\n            \" home, a tracheostomy at a restaurant.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    notDone: bool | None = Field(\n        default=None,\n        alias=\"notDone\",\n        title=\"True if procedure was not performed as scheduled\",\n        description=(\n            \"Set this to true if the record is saying that the procedure was NOT \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    notDone__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_notDone\", title=\"Extension field for ``notDone``.\"\n    )\n\n    notDoneReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"notDoneReason\",\n        title=\"Reason procedure was not performed\",\n        description=\"A code indicating why the procedure was not performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional information about the procedure\",\n        description=\"Any other notes about the procedure.  E.g. the operative notes.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"The result of procedure\",\n        description=(\n            \"The outcome of the procedure - did it resolve reasons for the \"\n            \"procedure being performed?\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=(\n            \"A larger event of which this particular procedure is a component or \"\n            \"step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Procedure\",\n                \"Observation\",\n                \"MedicationAdministration\",\n            ],\n        },\n    )\n\n    performedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"performedDateTime\",\n        title=\"Date/Period the procedure was performed\",\n        description=(\n            \"The date(time)/period over which the procedure was performed. Allows a\"\n            \" period to support complex procedures that span more than one date, \"\n            \"and also allows for the length of the procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e performed[x]\n            \"one_of_many\": \"performed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    performedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_performedDateTime\",\n        title=\"Extension field for ``performedDateTime``.\",\n    )\n\n    performedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"performedPeriod\",\n        title=\"Date/Period the procedure was performed\",\n        description=(\n            \"The date(time)/period over which the procedure was performed. Allows a\"\n            \" period to support complex procedures that span more than one date, \"\n            \"and also allows for the length of the procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e performed[x]\n            \"one_of_many\": \"performed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    performer: typing.List[fhirtypes.ProcedurePerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"The people who performed the procedure\",\n        description=\"Limited to 'real' people rather than equipment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Coded reason procedure performed\",\n        description=(\n            \"The coded reason why the procedure was performed. This may be coded \"\n            \"entity of some type, or may simply be present as text.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Condition that is the reason the procedure performed\",\n        description=\"The condition that is the reason why the procedure was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    report: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"report\",\n        title=\"Any report resulting from the procedure\",\n        description=(\n            \"This could be a histology result, pathology report, surgical report, \"\n            \"etc..\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DiagnosticReport\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | suspended | aborted | completed | entered-\"\n            \"in-error | unknown\"\n        ),\n        description=(\n            \"A code specifying the state of the procedure. Generally this will be \"\n            \"in-progress or completed state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"suspended\",\n                \"aborted\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who the procedure was performed on\",\n        description=\"The person, animal or group on which the procedure was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    usedCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"usedCode\",\n        title=\"Coded items used during the procedure\",\n        description=\"Identifies coded items that were used as part of the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usedReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"usedReference\",\n        title=\"Items used during procedure\",\n        description=(\n            \"Identifies medications, devices and any other substance used as part \"\n            \"of the procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"Medication\", \"Substance\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Procedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"notDone\",\n            \"notDoneReason\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"performedDateTime\",\n            \"performedPeriod\",\n            \"performer\",\n            \"location\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"bodySite\",\n            \"outcome\",\n            \"report\",\n            \"complication\",\n            \"complicationDetail\",\n            \"followUp\",\n            \"note\",\n            \"focalDevice\",\n            \"usedReference\",\n            \"usedCode\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Procedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"notDone\",\n            \"notDoneReason\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"performedDateTime\",\n            \"performedPeriod\",\n            \"performer\",\n            \"location\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"bodySite\",\n            \"outcome\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"performed\": [\"performedDateTime\", \"performedPeriod\"]}\n        return one_of_many_fields\n\n\nclass ProcedureFocalDevice(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Device changed in procedure.\n    A device that is implanted, removed or otherwise manipulated (calibration,\n    battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as\n    a focal portion of the Procedure.\n    \"\"\"\n\n    __resource_type__ = \"ProcedureFocalDevice\"\n\n    action: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Kind of change to device\",\n        description=\"The kind of change that happened to the device during the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    manipulated: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"manipulated\",\n        title=\"Device that was changed\",\n        description=\"The device that was manipulated (changed) during the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProcedureFocalDevice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\", \"manipulated\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProcedureFocalDevice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ProcedurePerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The people who performed the procedure.\n    Limited to 'real' people rather than equipment.\n    \"\"\"\n\n    __resource_type__ = \"ProcedurePerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"The reference to the practitioner\",\n        description=\"The practitioner who was involved in the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization the device or practitioner was acting for\",\n        description=\"The organization the device or practitioner was acting on behalf of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"The role the actor was in\",\n        description=\"For example: surgeon, anaethetist, endoscopist.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProcedurePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"actor\", \"onBehalfOf\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProcedurePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"role\", \"actor\"]\n"
  },
  {
    "path": "fhir/resources/STU3/procedurerequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ProcedureRequest\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ProcedureRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A request for a procedure or diagnostic to be performed.\n    A record of a request for diagnostic investigations, treatments, or\n    operations to be performed.\n    \"\"\"\n\n    __resource_type__ = \"ProcedureRequest\"\n\n    asNeededBoolean: bool | None = Field(\n        default=None,\n        alias=\"asNeededBoolean\",\n        title=\"Preconditions for procedure or diagnostic\",\n        description=(\n            \"If a CodeableConcept is present, it indicates the pre-condition for \"\n            'performing the procedure.  For example \"pain\", \"on flare-up\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n    asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_asNeededBoolean\",\n        title=\"Extension field for ``asNeededBoolean``.\",\n    )\n\n    asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"asNeededCodeableConcept\",\n        title=\"Preconditions for procedure or diagnostic\",\n        description=(\n            \"If a CodeableConcept is present, it indicates the pre-condition for \"\n            'performing the procedure.  For example \"pain\", \"on flare-up\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"Date request signed\",\n        description=\"When the request transitioned to being actionable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What request fulfills\",\n        description=\"Plan/proposal/order fulfilled by this request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Location on Body\",\n        description=(\n            \"Anatomic location where the procedure should be performed. This is the\"\n            \" target site.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classification of procedure\",\n        description=(\n            \"A code that classifies the procedure for searching, sorting and \"\n            'display purposes (e.g. \"Surgical Procedure\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"What is being requested/ordered\",\n        description=(\n            \"A code that identifies a particular procedure, diagnostic \"\n            \"investigation, or panel of investigations, that have been requested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or Episode during which request was created\",\n        description=(\n            \"An encounter or episode of care that provides additional information \"\n            \"about the healthcare context in which this request is made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    definition: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Protocol or definition\",\n        description=\"Protocol or definition followed by this request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"True if procedure should not be performed\",\n        description=(\n            \"Set this to true if the record is saying that the procedure should NOT\"\n            \" be performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers assigned to this order\",\n        description=(\n            \"Identifiers assigned to this order instance by the orderer and/or the \"\n            \"receiver and/or order fulfiller.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=\"proposal | plan | order +\",\n        description=(\n            \"Whether the request is a proposal, plan, an original order or a reflex\"\n            \" order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"proposal\", \"plan\", \"order\", \"+\"],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments\",\n        description=(\n            \"Any other notes and comments made about the service request. For \"\n            'example, letting provider know that \"patient hates needles\" or other '\n            \"provider instructions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When procedure should occur\",\n        description=\"The date/time at which the diagnostic testing should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When procedure should occur\",\n        description=\"The date/time at which the diagnostic testing should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When procedure should occur\",\n        description=\"The date/time at which the diagnostic testing should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Requested perfomer\",\n        description=(\n            \"The desired perfomer for doing the diagnostic testing.  For example, \"\n            \"the surgeon, dermatopathologist, endoscopist, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    performerType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=\"Performer role\",\n        description=\"Desired type of performer for doing the diagnostic testing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the ProcedureRequest should be addressed with \"\n            \"respect to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Explanation/Justification for test\",\n        description=(\n            \"An explanation or justification for why this diagnostic investigation \"\n            \"is being requested in coded or textual form.   This is often for \"\n            \"billing purposes.  May relate to the resources referred to in \"\n            \"supportingInformation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Explanation/Justification for test\",\n        description=(\n            \"Indicates another resource that provides a justification for why this \"\n            \"diagnostic investigation is being requested.   May relate to the \"\n            \"resources referred to in supportingInformation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Request provenance\",\n        description=\"Key events in the history of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"What request replaces\",\n        description=(\n            \"The request takes the place of the referenced completed or terminated \"\n            \"request(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    requester: fhirtypes.ProcedureRequestRequesterType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/what is requesting procedure or diagnostic\",\n        description=(\n            \"The individual who initiated the request and has responsibility for \"\n            \"its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    requisition: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"requisition\",\n        title=\"Composite Request ID\",\n        description=(\n            \"A shared identifier common to all procedure or diagnostic requests \"\n            \"that were authorized more or less simultaneously by a single author, \"\n            \"representing the composite or group identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specimen: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Procedure Samples\",\n        description=\"One or more specimens that the laboratory procedure will use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | suspended | completed | entered-in-error | cancelled\",\n        description=\"The status of the order.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"suspended\",\n                \"completed\",\n                \"entered-in-error\",\n                \"cancelled\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Individual the service is ordered for\",\n        description=(\n            \"On whom or what the procedure or diagnostic is to be performed. This \"\n            \"is usually a human patient, but can also be requested on animals, \"\n            \"groups of humans or animals, devices such as dialysis machines, or \"\n            \"even locations (typically for environmental scans).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Location\", \"Device\"],\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Additional clinical information\",\n        description=(\n            \"Additional clinical information about the patient or specimen that may\"\n            \" influence the procedure or diagnostics or their interpretations.     \"\n            \"This information includes diagnosis, clinical findings and other \"\n            \"observations.  In laboratory ordering these are typically referred to \"\n            'as \"ask at order entry questions (AOEs)\".  This includes observations '\n            \"explicitly requested by the producer (filler) to provide context or \"\n            \"supporting information needed to complete the order. For example,  \"\n            \"reporting the amount of inspired oxygen for blood gas measurements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProcedureRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"replaces\",\n            \"requisition\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"doNotPerform\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n            \"authoredOn\",\n            \"requester\",\n            \"performerType\",\n            \"performer\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"supportingInfo\",\n            \"specimen\",\n            \"bodySite\",\n            \"note\",\n            \"relevantHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProcedureRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"replaces\",\n            \"requisition\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"doNotPerform\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n            \"authoredOn\",\n            \"requester\",\n            \"performerType\",\n            \"performer\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"specimen\",\n            \"bodySite\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"asNeeded\": [\"asNeededBoolean\", \"asNeededCodeableConcept\"],\n            \"occurrence\": [\n                \"occurrenceDateTime\",\n                \"occurrencePeriod\",\n                \"occurrenceTiming\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ProcedureRequestRequester(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who/what is requesting procedure or diagnostic.\n    The individual who initiated the request and has responsibility for its\n    activation.\n    \"\"\"\n\n    __resource_type__ = \"ProcedureRequestRequester\"\n\n    agent: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Individual making the request\",\n        description=\"The device, practitioner or organization who initiated the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"Practitioner\", \"Organization\"],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization agent is acting for\",\n        description=\"The organization the device or practitioner was acting on behalf of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProcedureRequestRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"agent\", \"onBehalfOf\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProcedureRequestRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"agent\", \"onBehalfOf\"]\n"
  },
  {
    "path": "fhir/resources/STU3/processrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ProcessRequest\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ProcessRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Request to perform some action on or in regards to an existing resource.\n    This resource provides the target, request and response, and action details\n    for an action to be performed by the target on or about existing resources.\n    \"\"\"\n\n    __resource_type__ = \"ProcessRequest\"\n\n    action: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"cancel | poll | reprocess | status\",\n        description=(\n            \"The type of processing action being requested, for example Reversal, \"\n            \"Readjudication, StatusRequest,PendedRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"cancel\", \"poll\", \"reprocess\", \"status\"],\n        },\n    )\n    action__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_action\", title=\"Extension field for ``action``.\"\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    exclude: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=\"Resource type(s) to exclude\",\n        description=\"Names of resource types to exclude.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    exclude__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_exclude\", title=\"Extension field for ``exclude``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The ProcessRequest business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    include: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"include\",\n        title=\"Resource type(s) to include\",\n        description=\"Names of resource types to include.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    include__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_include\", title=\"Extension field for ``include``.\"\n    )\n\n    item: typing.List[fhirtypes.ProcessRequestItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Items to re-adjudicate\",\n        description=(\n            \"List of top level items to be re-adjudicated, if none specified then \"\n            \"the entire submission is re-adjudicated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    nullify: bool | None = Field(\n        default=None,\n        alias=\"nullify\",\n        title=\"Remove history\",\n        description=\"If true remove all history excluding audit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    nullify__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_nullify\", title=\"Extension field for ``nullify``.\"\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Responsible organization\",\n        description=(\n            \"The organization which is responsible for the action speccified in \"\n            \"this request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Selection period\",\n        description=(\n            \"A period of time during which the fulfilling resources would have been\"\n            \" created.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the action specified in this \"\n            \"request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    reference: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Reference number/string\",\n        description=\"A reference to supply which authenticates the process.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Reference to the Request resource\",\n        description=\"Reference of resource which is the target or subject of this action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    response: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"Reference to the Response resource\",\n        description=(\n            \"Reference of a prior response to resource which is the target or \"\n            \"subject of this action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    target: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Party which is the target of the request\",\n        description=\"The organization which is the target of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProcessRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"action\",\n            \"target\",\n            \"created\",\n            \"provider\",\n            \"organization\",\n            \"request\",\n            \"response\",\n            \"nullify\",\n            \"reference\",\n            \"item\",\n            \"include\",\n            \"exclude\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProcessRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n\n\nclass ProcessRequestItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Items to re-adjudicate.\n    List of top level items to be re-adjudicated, if none specified then the\n    entire submission is re-adjudicated.\n    \"\"\"\n\n    __resource_type__ = \"ProcessRequestItem\"\n\n    sequenceLinkId: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"sequenceLinkId\",\n        title=\"Service instance\",\n        description=\"A service line number.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequenceLinkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sequenceLinkId\",\n        title=\"Extension field for ``sequenceLinkId``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProcessRequestItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"sequenceLinkId\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProcessRequestItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequenceLinkId\", \"sequenceLinkId__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/processresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ProcessResponse\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ProcessResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    ProcessResponse resource.\n    This resource provides processing status, errors and notes from the\n    processing of a resource.\n    \"\"\"\n\n    __resource_type__ = \"ProcessResponse\"\n\n    communicationRequest: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"communicationRequest\",\n        title=\"Request for additional information\",\n        description=(\n            \"Request for additional supporting or authorizing information, such as:\"\n            \" documents, images or resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CommunicationRequest\"],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=(\n            \"The date when the enclosed suite of services were performed or \"\n            \"completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A description of the status of the adjudication or processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    error: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"error\",\n        title=\"Error code\",\n        description=\"Processing errors.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"Printed Form Identifier\",\n        description=\"The form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The Response business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Authoring Organization\",\n        description=\"The organization who produced this adjudicated response.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"Processing outcome\",\n        description=\"Transaction status: error, complete, held.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    processNote: typing.List[fhirtypes.ProcessResponseProcessNoteType] | None = Field(\n        default=None,\n        alias=\"processNote\",\n        title=\"Processing comments or additional requirements\",\n        description=(\n            \"Suite of processing notes or additional requirements if the processing\"\n            \" has been held.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Request reference\",\n        description=\"Original request resource reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    requestOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestOrganization\",\n        title=\"Responsible organization\",\n        description=(\n            \"The organization which is responsible for the services rendered to the\"\n            \" patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    requestProvider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestProvider\",\n        title=\"Responsible Practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProcessResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"created\",\n            \"organization\",\n            \"request\",\n            \"outcome\",\n            \"disposition\",\n            \"requestProvider\",\n            \"requestOrganization\",\n            \"form\",\n            \"processNote\",\n            \"error\",\n            \"communicationRequest\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProcessResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n\n\nclass ProcessResponseProcessNote(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing comments or additional requirements.\n    Suite of processing notes or additional requirements if the processing has\n    been held.\n    \"\"\"\n\n    __resource_type__ = \"ProcessResponseProcessNote\"\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Comment on the processing\",\n        description=\"The note text.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"display | print | printoper\",\n        description=\"The note purpose: Print/Display.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProcessResponseProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProcessResponseProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/provenance.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Provenance\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Provenance(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who, What, When for a set of resources.\n    Provenance of a resource is a record that describes entities and processes\n    involved in producing and delivering or otherwise influencing that\n    resource. Provenance provides a critical foundation for assessing\n    authenticity, enabling trust, and allowing reproducibility. Provenance\n    assertions are a form of contextual metadata and can themselves become\n    important records with their own provenance. Provenance statement indicates\n    clinical significance in terms of confidence in authenticity, reliability,\n    and trustworthiness, integrity, and stage in lifecycle (e.g. Document\n    Completion - has the artifact been legally authenticated), all of which may\n    impact security, privacy, and trust policies.\n    \"\"\"\n\n    __resource_type__ = \"Provenance\"\n\n    activity: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"activity\",\n        title=\"Activity that occurred\",\n        description=(\n            \"An activity is something that occurs over a period of time and acts \"\n            \"upon or with entities; it may include consuming, processing, \"\n            \"transforming, modifying, relocating, using, or generating entities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    agent: typing.List[fhirtypes.ProvenanceAgentType] = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Actor involved\",\n        description=(\n            \"An actor taking a role in an activity  for which it can be assigned \"\n            \"some degree of responsibility for the activity taking place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entity: typing.List[fhirtypes.ProvenanceEntityType] | None = Field(\n        default=None,\n        alias=\"entity\",\n        title=\"An entity used in this activity\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the activity occurred, if relevant\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When the activity occurred\",\n        description=\"The period during which the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    policy: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"policy\",\n        title=\"Policy or plan the activity was defined by\",\n        description=(\n            \"Policy or plan the activity was defined by. Typically, a single \"\n            \"activity may have multiple applicable policy documents, such as \"\n            \"patient consent, guarantor funding, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    policy__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_policy\", title=\"Extension field for ``policy``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason the activity is occurring\",\n        description=\"The reason that the activity was taking place.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recorded: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"recorded\",\n        title=\"When the activity was recorded / updated\",\n        description=\"The instant of time at which the activity was recorded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recorded\", title=\"Extension field for ``recorded``.\"\n    )\n\n    signature: typing.List[fhirtypes.SignatureType] | None = Field(\n        default=None,\n        alias=\"signature\",\n        title=\"Signature on target\",\n        description=(\n            \"A digital signature on the target Reference(s). The signer should \"\n            \"match a Provenance.agent. The purpose of the signature is indicated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    target: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"target\",\n        title=\"Target Reference(s) (usually version specific)\",\n        description=(\n            \"The Reference(s) that were generated or updated by  the activity \"\n            \"described in this resource. A provenance can point to more than one \"\n            \"target if multiple resources were created/updated by the same \"\n            \"activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Provenance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"target\",\n            \"period\",\n            \"recorded\",\n            \"policy\",\n            \"location\",\n            \"reason\",\n            \"activity\",\n            \"agent\",\n            \"entity\",\n            \"signature\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Provenance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"target\", \"recorded\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"recorded\", \"recorded__ext\")]\n        return required_fields\n\n\nclass ProvenanceAgent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Actor involved.\n    An actor taking a role in an activity  for which it can be assigned some\n    degree of responsibility for the activity taking place.\n    \"\"\"\n\n    __resource_type__ = \"ProvenanceAgent\"\n\n    onBehalfOfReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOfReference\",\n        title=\"Who the agent is representing\",\n        description=\"The individual, device, or organization for whom the change was made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onBehalfOf[x]\n            \"one_of_many\": \"onBehalfOf\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Device\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    onBehalfOfUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"onBehalfOfUri\",\n        title=\"Who the agent is representing\",\n        description=\"The individual, device, or organization for whom the change was made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onBehalfOf[x]\n            \"one_of_many\": \"onBehalfOf\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onBehalfOfUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_onBehalfOfUri\",\n        title=\"Extension field for ``onBehalfOfUri``.\",\n    )\n\n    relatedAgentType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"relatedAgentType\",\n        title=\"Type of relationship between agents\",\n        description=\"The type of relationship between agents.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    role: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"What the agents role was\",\n        description=(\n            \"The function of the agent with respect to the activity. The security \"\n            \"role enabling the agent with respect to the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    whoReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"whoReference\",\n        title=\"Who participated\",\n        description=\"The individual, device or organization that participated in the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e who[x]\n            \"one_of_many\": \"who\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Device\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    whoUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"whoUri\",\n        title=\"Who participated\",\n        description=\"The individual, device or organization that participated in the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e who[x]\n            \"one_of_many\": \"who\",\n            \"one_of_many_required\": True,\n        },\n    )\n    whoUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_whoUri\", title=\"Extension field for ``whoUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProvenanceAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"role\",\n            \"whoUri\",\n            \"whoReference\",\n            \"whoReference\",\n            \"whoReference\",\n            \"whoReference\",\n            \"whoReference\",\n            \"onBehalfOfUri\",\n            \"onBehalfOfReference\",\n            \"onBehalfOfReference\",\n            \"onBehalfOfReference\",\n            \"onBehalfOfReference\",\n            \"onBehalfOfReference\",\n            \"relatedAgentType\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProvenanceAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"role\",\n            \"whoUri\",\n            \"whoReference\",\n            \"whoReference\",\n            \"whoReference\",\n            \"whoReference\",\n            \"whoReference\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"onBehalfOf\": [\"onBehalfOfReference\", \"onBehalfOfUri\"],\n            \"who\": [\"whoReference\", \"whoUri\"],\n        }\n        return one_of_many_fields\n\n\nclass ProvenanceEntity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An entity used in this activity.\n    \"\"\"\n\n    __resource_type__ = \"ProvenanceEntity\"\n\n    agent: typing.List[fhirtypes.ProvenanceAgentType] | None = Field(\n        default=None,\n        alias=\"agent\",\n        title=\"Entity is attributed to this agent\",\n        description=(\n            \"The entity is attributed to an agent to express the agent's \"\n            \"responsibility for that entity, possibly along with other agents. This\"\n            \" description can be understood as shorthand for saying that the agent \"\n            \"was responsible for the activity which generated the entity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"derivation | revision | quotation | source | removal\",\n        description=\"How the entity was used during the activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"derivation\", \"revision\", \"quotation\", \"source\", \"removal\"],\n        },\n    )\n    role__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_role\", title=\"Extension field for ``role``.\"\n    )\n\n    whatIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"whatIdentifier\",\n        title=\"Identity of entity\",\n        description=(\n            \"Identity of the  Entity used. May be a logical or physical uri and \"\n            \"maybe absolute or relative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e what[x]\n            \"one_of_many\": \"what\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    whatReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"whatReference\",\n        title=\"Identity of entity\",\n        description=(\n            \"Identity of the  Entity used. May be a logical or physical uri and \"\n            \"maybe absolute or relative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e what[x]\n            \"one_of_many\": \"what\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    whatUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"whatUri\",\n        title=\"Identity of entity\",\n        description=(\n            \"Identity of the  Entity used. May be a logical or physical uri and \"\n            \"maybe absolute or relative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e what[x]\n            \"one_of_many\": \"what\",\n            \"one_of_many_required\": True,\n        },\n    )\n    whatUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_whatUri\", title=\"Extension field for ``whatUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProvenanceEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"role\",\n            \"whatUri\",\n            \"whatReference\",\n            \"whatIdentifier\",\n            \"agent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProvenanceEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"role\",\n            \"whatUri\",\n            \"whatReference\",\n            \"whatIdentifier\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"role\", \"role__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"what\": [\"whatIdentifier\", \"whatReference\", \"whatUri\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/quantity.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SimpleQuantity\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Quantity(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A measured or measurable amount.\n    A measured amount (or an amount that can potentially be measured). Note\n    that measured amounts include amounts that are not precisely quantified,\n    including amounts involving arbitrary units and floating currencies.\n    \"\"\"\n\n    __resource_type__ = \"Quantity\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Coded form of the unit\",\n        description=(\n            \"A computer processable form of the unit in some unit representation \"\n            \"system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    comparator: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"comparator\",\n        title=\"< | <= | >= | > - how to understand the value\",\n        description=(\n            \"How the value should be understood and represented - whether the \"\n            \"actual value is greater or less than the stated value due to \"\n            'measurement issues; e.g. if the comparator is \"<\" , then the real '\n            \"value is < stated value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comparator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comparator\", title=\"Extension field for ``comparator``.\"\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"System that defines coded unit form\",\n        description=(\n            \"The identification of the system that provides the coded form of the \"\n            \"unit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    unit: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Unit representation\",\n        description=\"A human-readable form of the unit.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    unit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_unit\", title=\"Extension field for ``unit``.\"\n    )\n\n    value: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Numerical value (with implicit precision)\",\n        description=(\n            \"The value of the measured amount. The value includes an implicit \"\n            \"precision in the presentation of the value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Quantity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Quantity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/STU3/questionnaire.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Questionnaire\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Questionnaire(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A structured set of questions.\n    A structured set of questions intended to guide the collection of answers\n    from end-users. Questionnaires provide detailed control over order,\n    presentation, phraseology and grouping to allow coherent, consistent data\n    collection.\n    \"\"\"\n\n    __resource_type__ = \"Questionnaire\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the questionnaire was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Concept that represents the overall questionnaire\",\n        description=(\n            \"An identifier for this question or group of questions in a particular \"\n            \"terminology such as LOINC.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the questionnaire and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the questionnaire was published. \"\n            \"The date must change if and when the business version changes and it \"\n            \"must change if the status code changes. In addition, it should change \"\n            \"when the substantive content of the questionnaire changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the questionnaire\",\n        description=(\n            \"A free text natural language description of the questionnaire from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the questionnaire is expected to be used\",\n        description=(\n            \"The period during which the questionnaire content was or is planned to\"\n            \" be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this questionnaire is authored for \"\n            \"testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the questionnaire\",\n        description=(\n            \"A formal identifier that is used to identify this questionnaire when \"\n            \"it is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    item: typing.List[fhirtypes.QuestionnaireItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Questions and sections within the Questionnaire\",\n        description=(\n            \"A particular question, question grouping or display text that is part \"\n            \"of the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for questionnaire (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the questionnaire is intended to\"\n            \" be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the questionnaire was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval, but doesn't change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this questionnaire (computer friendly)\",\n        description=(\n            \"A natural language name identifying the questionnaire. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the \"\n            \"questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this questionnaire is defined\",\n        description=(\n            \"Explaination of why this questionnaire is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this questionnaire. Enables tracking the life-cycle of \"\n            \"the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectType: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"subjectType\",\n        title=\"Resource that can be subject of QuestionnaireResponse\",\n        description=(\n            \"The types of subjects that can be the subject of responses created for\"\n            \" the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subjectType__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_subjectType\", title=\"Extension field for ``subjectType``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this questionnaire (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the questionnaire.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this questionnaire (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this questionnaire when it is\"\n            \" referenced in a specification, model, design or an instance. This \"\n            \"SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at\"\n            \" which this questionnaire is (or will be) published. The URL SHOULD \"\n            \"include the major version of the questionnaire. For more information \"\n            \"see [Technical and Business Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate questionnaire instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the questionnaire\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"questionnaire when it is referenced in a specification, model, design \"\n            \"or instance. This is an arbitrary value managed by the questionnaire \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Questionnaire`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"description\",\n            \"purpose\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"contact\",\n            \"copyright\",\n            \"code\",\n            \"subjectType\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Questionnaire`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"effectivePeriod\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"contact\",\n            \"code\",\n            \"subjectType\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass QuestionnaireItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Questions and sections within the Questionnaire.\n    A particular question, question grouping or display text that is part of\n    the questionnaire.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireItem\"\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Corresponding concept for this item in a terminology\",\n        description=(\n            \"A terminology code that corresponds to this group or question (e.g. a \"\n            \"code from LOINC, which defines many questions and answers).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"ElementDefinition - details for the item\",\n        description=(\n            \"A reference to an [ElementDefinition](elementdefinition.html) that \"\n            \"provides the details for the item. If a definition is provided, then \"\n            \"the following element values can be inferred from the definition:   * \"\n            \"code (ElementDefinition.code) * type (ElementDefinition.type) * \"\n            \"required (ElementDefinition.min) * repeats (ElementDefinition.max) * \"\n            \"maxLength (ElementDefinition.maxLength) * options \"\n            \"(ElementDefinition.binding)  Any information provided in these \"\n            \"elements on a Questionnaire Item overrides the information from the \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    enableWhen: typing.List[fhirtypes.QuestionnaireItemEnableWhenType] | None = Field(\n        default=None,\n        alias=\"enableWhen\",\n        title=\"Only allow data when\",\n        description=(\n            \"A constraint indicating that this item should only be enabled \"\n            \"(displayed/allow answers to be captured) when the specified condition \"\n            \"is true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    initialAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"initialAttachment\",\n        title=\"Default value when item is first rendered\",\n        description=(\n            \"The value that should be defaulted when initially rendering the \"\n            \"questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e initial[x]\n            \"one_of_many\": \"initial\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    initialBoolean: bool | None = Field(\n        default=None,\n        alias=\"initialBoolean\",\n        title=\"Default value when item is first rendered\",\n        description=(\n            \"The value that should be defaulted when initially rendering the \"\n            \"questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e initial[x]\n            \"one_of_many\": \"initial\",\n            \"one_of_many_required\": False,\n        },\n    )\n    initialBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_initialBoolean\",\n        title=\"Extension field for ``initialBoolean``.\",\n    )\n\n    initialCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"initialCoding\",\n        title=\"Default value when item is first rendered\",\n        description=(\n            \"The value that should be defaulted when initially rendering the \"\n            \"questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e initial[x]\n            \"one_of_many\": \"initial\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    initialDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"initialDate\",\n        title=\"Default value when item is first rendered\",\n        description=(\n            \"The value that should be defaulted when initially rendering the \"\n            \"questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e initial[x]\n            \"one_of_many\": \"initial\",\n            \"one_of_many_required\": False,\n        },\n    )\n    initialDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_initialDate\", title=\"Extension field for ``initialDate``.\"\n    )\n\n    initialDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"initialDateTime\",\n        title=\"Default value when item is first rendered\",\n        description=(\n            \"The value that should be defaulted when initially rendering the \"\n            \"questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e initial[x]\n            \"one_of_many\": \"initial\",\n            \"one_of_many_required\": False,\n        },\n    )\n    initialDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_initialDateTime\",\n        title=\"Extension field for ``initialDateTime``.\",\n    )\n\n    initialDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"initialDecimal\",\n        title=\"Default value when item is first rendered\",\n        description=(\n            \"The value that should be defaulted when initially rendering the \"\n            \"questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e initial[x]\n            \"one_of_many\": \"initial\",\n            \"one_of_many_required\": False,\n        },\n    )\n    initialDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_initialDecimal\",\n        title=\"Extension field for ``initialDecimal``.\",\n    )\n\n    initialInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"initialInteger\",\n        title=\"Default value when item is first rendered\",\n        description=(\n            \"The value that should be defaulted when initially rendering the \"\n            \"questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e initial[x]\n            \"one_of_many\": \"initial\",\n            \"one_of_many_required\": False,\n        },\n    )\n    initialInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_initialInteger\",\n        title=\"Extension field for ``initialInteger``.\",\n    )\n\n    initialQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"initialQuantity\",\n        title=\"Default value when item is first rendered\",\n        description=(\n            \"The value that should be defaulted when initially rendering the \"\n            \"questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e initial[x]\n            \"one_of_many\": \"initial\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    initialReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"initialReference\",\n        title=\"Default value when item is first rendered\",\n        description=(\n            \"The value that should be defaulted when initially rendering the \"\n            \"questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e initial[x]\n            \"one_of_many\": \"initial\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    initialString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"initialString\",\n        title=\"Default value when item is first rendered\",\n        description=(\n            \"The value that should be defaulted when initially rendering the \"\n            \"questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e initial[x]\n            \"one_of_many\": \"initial\",\n            \"one_of_many_required\": False,\n        },\n    )\n    initialString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_initialString\",\n        title=\"Extension field for ``initialString``.\",\n    )\n\n    initialTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"initialTime\",\n        title=\"Default value when item is first rendered\",\n        description=(\n            \"The value that should be defaulted when initially rendering the \"\n            \"questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e initial[x]\n            \"one_of_many\": \"initial\",\n            \"one_of_many_required\": False,\n        },\n    )\n    initialTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_initialTime\", title=\"Extension field for ``initialTime``.\"\n    )\n\n    initialUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"initialUri\",\n        title=\"Default value when item is first rendered\",\n        description=(\n            \"The value that should be defaulted when initially rendering the \"\n            \"questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e initial[x]\n            \"one_of_many\": \"initial\",\n            \"one_of_many_required\": False,\n        },\n    )\n    initialUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_initialUri\", title=\"Extension field for ``initialUri``.\"\n    )\n\n    item: typing.List[fhirtypes.QuestionnaireItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Nested questionnaire items\",\n        description=(\n            \"Text, questions and other groups to be nested beneath a question or \"\n            \"group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Unique id for item in questionnaire\",\n        description=(\n            \"An identifier that is unique within the Questionnaire allowing linkage\"\n            \" to the equivalent item in a QuestionnaireResponse resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    maxLength: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"maxLength\",\n        title=\"No more than this many characters\",\n        description=(\n            \"The maximum number of characters that are permitted in the answer to \"\n            'be considered a \"valid\" QuestionnaireResponse.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    maxLength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_maxLength\", title=\"Extension field for ``maxLength``.\"\n    )\n\n    option: typing.List[fhirtypes.QuestionnaireItemOptionType] | None = Field(\n        default=None,\n        alias=\"option\",\n        title=\"Permitted answer\",\n        description='One of the permitted answers for a \"choice\" or \"open-choice\" question.',\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    options: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"options\",\n        title=\"Valueset containing permitted answers\",\n        description=(\n            \"A reference to a value set containing a list of codes representing \"\n            'permitted answers for a \"choice\" or \"open-choice\" question.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n\n    prefix: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"prefix\",\n        title='E.g. \"1(a)\", \"2.5.3\"',\n        description=(\n            \"A short label for a particular group, question or set of display text \"\n            \"within the questionnaire used for reference by the individual \"\n            \"completing the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_prefix\", title=\"Extension field for ``prefix``.\"\n    )\n\n    readOnly: bool | None = Field(\n        default=None,\n        alias=\"readOnly\",\n        title=\"Don't allow human editing\",\n        description=(\n            \"An indication, when true, that the value cannot be changed by a human \"\n            \"respondent to the Questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    readOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_readOnly\", title=\"Extension field for ``readOnly``.\"\n    )\n\n    repeats: bool | None = Field(\n        default=None,\n        alias=\"repeats\",\n        title=\"Whether the item may repeat\",\n        description=(\n            \"An indication, if true, that the item may occur multiple times in the \"\n            \"response, collecting multiple answers answers for questions or \"\n            \"multiple sets of answers for groups.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    repeats__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_repeats\", title=\"Extension field for ``repeats``.\"\n    )\n\n    required: bool | None = Field(\n        default=None,\n        alias=\"required\",\n        title=\"Whether the item must be included in data results\",\n        description=(\n            'An indication, if true, that the item must be present in a \"completed\"'\n            \" QuestionnaireResponse.  If false, the item may be skipped when \"\n            \"answering the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_required\", title=\"Extension field for ``required``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Primary text for the item\",\n        description=(\n            \"The name of a section, the text of a question or text content for a \"\n            \"display item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"group | display | boolean | decimal | integer | date | dateTime +\",\n        description=(\n            \"The type of questionnaire item this is - whether text for display, a \"\n            \"grouping of other items or a particular type of data to be captured \"\n            \"(string, integer, coded choice, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"group\",\n                \"display\",\n                \"boolean\",\n                \"decimal\",\n                \"integer\",\n                \"date\",\n                \"dateTime\",\n                \"+\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"definition\",\n            \"code\",\n            \"prefix\",\n            \"text\",\n            \"type\",\n            \"enableWhen\",\n            \"required\",\n            \"repeats\",\n            \"readOnly\",\n            \"maxLength\",\n            \"options\",\n            \"option\",\n            \"initialBoolean\",\n            \"initialDecimal\",\n            \"initialInteger\",\n            \"initialDate\",\n            \"initialDateTime\",\n            \"initialTime\",\n            \"initialString\",\n            \"initialUri\",\n            \"initialAttachment\",\n            \"initialCoding\",\n            \"initialQuantity\",\n            \"initialReference\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"text\", \"enableWhen\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"linkId\", \"linkId__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"initial\": [\n                \"initialAttachment\",\n                \"initialBoolean\",\n                \"initialCoding\",\n                \"initialDate\",\n                \"initialDateTime\",\n                \"initialDecimal\",\n                \"initialInteger\",\n                \"initialQuantity\",\n                \"initialReference\",\n                \"initialString\",\n                \"initialTime\",\n                \"initialUri\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass QuestionnaireItemEnableWhen(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Only allow data when.\n    A constraint indicating that this item should only be enabled\n    (displayed/allow answers to be captured) when the specified condition is\n    true.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireItemEnableWhen\"\n\n    answerAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"answerAttachment\",\n        title=\"Value question must have\",\n        description=(\n            \"An answer that the referenced question must match in order for the \"\n            \"item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    answerBoolean: bool | None = Field(\n        default=None,\n        alias=\"answerBoolean\",\n        title=\"Value question must have\",\n        description=(\n            \"An answer that the referenced question must match in order for the \"\n            \"item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": False,\n        },\n    )\n    answerBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerBoolean\",\n        title=\"Extension field for ``answerBoolean``.\",\n    )\n\n    answerCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"answerCoding\",\n        title=\"Value question must have\",\n        description=(\n            \"An answer that the referenced question must match in order for the \"\n            \"item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    answerDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"answerDate\",\n        title=\"Value question must have\",\n        description=(\n            \"An answer that the referenced question must match in order for the \"\n            \"item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": False,\n        },\n    )\n    answerDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_answerDate\", title=\"Extension field for ``answerDate``.\"\n    )\n\n    answerDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"answerDateTime\",\n        title=\"Value question must have\",\n        description=(\n            \"An answer that the referenced question must match in order for the \"\n            \"item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": False,\n        },\n    )\n    answerDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerDateTime\",\n        title=\"Extension field for ``answerDateTime``.\",\n    )\n\n    answerDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"answerDecimal\",\n        title=\"Value question must have\",\n        description=(\n            \"An answer that the referenced question must match in order for the \"\n            \"item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": False,\n        },\n    )\n    answerDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerDecimal\",\n        title=\"Extension field for ``answerDecimal``.\",\n    )\n\n    answerInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"answerInteger\",\n        title=\"Value question must have\",\n        description=(\n            \"An answer that the referenced question must match in order for the \"\n            \"item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": False,\n        },\n    )\n    answerInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerInteger\",\n        title=\"Extension field for ``answerInteger``.\",\n    )\n\n    answerQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"answerQuantity\",\n        title=\"Value question must have\",\n        description=(\n            \"An answer that the referenced question must match in order for the \"\n            \"item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    answerReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"answerReference\",\n        title=\"Value question must have\",\n        description=(\n            \"An answer that the referenced question must match in order for the \"\n            \"item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    answerString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"answerString\",\n        title=\"Value question must have\",\n        description=(\n            \"An answer that the referenced question must match in order for the \"\n            \"item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": False,\n        },\n    )\n    answerString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerString\",\n        title=\"Extension field for ``answerString``.\",\n    )\n\n    answerTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"answerTime\",\n        title=\"Value question must have\",\n        description=(\n            \"An answer that the referenced question must match in order for the \"\n            \"item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": False,\n        },\n    )\n    answerTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_answerTime\", title=\"Extension field for ``answerTime``.\"\n    )\n\n    answerUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"answerUri\",\n        title=\"Value question must have\",\n        description=(\n            \"An answer that the referenced question must match in order for the \"\n            \"item to be enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": False,\n        },\n    )\n    answerUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_answerUri\", title=\"Extension field for ``answerUri``.\"\n    )\n\n    hasAnswer: bool | None = Field(\n        default=None,\n        alias=\"hasAnswer\",\n        title=\"Enable when answered or not\",\n        description=(\n            \"An indication that this item should be enabled only if the specified \"\n            \"question is answered (hasAnswer=true) or not answered \"\n            \"(hasAnswer=false).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    hasAnswer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_hasAnswer\", title=\"Extension field for ``hasAnswer``.\"\n    )\n\n    question: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"question\",\n        title=\"Question that determines whether item is enabled\",\n        description=(\n            \"The linkId for the question whose answer (or lack of answer) governs \"\n            \"whether this item is enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    question__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_question\", title=\"Extension field for ``question``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireItemEnableWhen`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"question\",\n            \"hasAnswer\",\n            \"answerBoolean\",\n            \"answerDecimal\",\n            \"answerInteger\",\n            \"answerDate\",\n            \"answerDateTime\",\n            \"answerTime\",\n            \"answerString\",\n            \"answerUri\",\n            \"answerAttachment\",\n            \"answerCoding\",\n            \"answerQuantity\",\n            \"answerReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireItemEnableWhen`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"question\", \"question__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"answer\": [\n                \"answerAttachment\",\n                \"answerBoolean\",\n                \"answerCoding\",\n                \"answerDate\",\n                \"answerDateTime\",\n                \"answerDecimal\",\n                \"answerInteger\",\n                \"answerQuantity\",\n                \"answerReference\",\n                \"answerString\",\n                \"answerTime\",\n                \"answerUri\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass QuestionnaireItemOption(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Permitted answer.\n    One of the permitted answers for a \"choice\" or \"open-choice\" question.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireItemOption\"\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireItemOption`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueInteger\",\n            \"valueDate\",\n            \"valueTime\",\n            \"valueString\",\n            \"valueCoding\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireItemOption`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueCoding\",\n                \"valueDate\",\n                \"valueInteger\",\n                \"valueString\",\n                \"valueTime\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/questionnaireresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass QuestionnaireResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A structured set of questions and their answers.\n    A structured set of questions and their answers. The questions are ordered\n    and grouped into coherent subsets, corresponding to the structure of the\n    grouping of the questionnaire being responded to.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireResponse\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Person who received and recorded the answers\",\n        description=(\n            \"Person who received the answers to the questions in the \"\n            \"QuestionnaireResponse and recorded them in the system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Practitioner\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    authored: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authored\",\n        title=\"Date the answers were gathered\",\n        description=\"The date and/or time that this set of answers were last changed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authored__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authored\", title=\"Extension field for ``authored``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this QuestionnaireResponse\",\n        description=(\n            \"The order, proposal or plan that is fulfilled in whole or in part by \"\n            \"this QuestionnaireResponse.  For example, a ProcedureRequest seeking \"\n            \"an intake assessment or a decision support recommendation to assess \"\n            \"for post-partum depression.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ReferralRequest\", \"CarePlan\", \"ProcedureRequest\"],\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or Episode during which questionnaire was completed\",\n        description=(\n            \"The encounter or episode of care with primary association to the \"\n            \"questionnaire response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique id for this set of answers\",\n        description=(\n            \"A business identifier assigned to a particular completed (or partially\"\n            \" completed) questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Groups and questions\",\n        description=(\n            \"A group or question item from the original questionnaire for which \"\n            \"answers are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    parent: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Part of this action\",\n        description=(\n            \"A procedure or observation that this questionnaire was performed as \"\n            \"part of the execution of.  For example, the surgery a checklist was \"\n            \"executed as part of.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\", \"Procedure\"],\n        },\n    )\n\n    questionnaire: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"questionnaire\",\n        title=\"Form being answered\",\n        description=(\n            \"The Questionnaire that defines and organizes the questions for which \"\n            \"answers are being provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Questionnaire\"],\n        },\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"The person who answered the questions\",\n        description=\"The person who answered the questions about the subject.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\", \"RelatedPerson\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"in-progress | completed | amended | entered-in-error | stopped\",\n        description=(\n            \"The position of the questionnaire response within its overall \"\n            \"lifecycle.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"in-progress\",\n                \"completed\",\n                \"amended\",\n                \"entered-in-error\",\n                \"stopped\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The subject of the questions\",\n        description=(\n            \"The subject of the questionnaire response.  This could be a patient, \"\n            \"organization, practitioner, device, etc.  This is who/what the answers\"\n            \" apply to, but is not necessarily the source of information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"parent\",\n            \"questionnaire\",\n            \"status\",\n            \"subject\",\n            \"context\",\n            \"authored\",\n            \"author\",\n            \"source\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"basedOn\",\n            \"parent\",\n            \"questionnaire\",\n            \"status\",\n            \"subject\",\n            \"context\",\n            \"authored\",\n            \"author\",\n            \"source\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass QuestionnaireResponseItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Groups and questions.\n    A group or question item from the original questionnaire for which answers\n    are provided.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireResponseItem\"\n\n    answer: typing.List[fhirtypes.QuestionnaireResponseItemAnswerType] | None = Field(\n        default=None,\n        alias=\"answer\",\n        title=\"The response(s) to the question\",\n        description=\"The respondent's answer(s) to the question.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"ElementDefinition - details for the item\",\n        description=(\n            \"A reference to an [ElementDefinition](elementdefinition.html) that \"\n            \"provides the details for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Nested questionnaire response items\",\n        description=\"Questions or sub-groups nested beneath a question or group.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific item from Questionnaire\",\n        description=(\n            \"The item from the Questionnaire that corresponds to this item in the \"\n            \"QuestionnaireResponse resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The subject this group's answers are about\",\n        description=(\n            \"More specific subject this section's answers are about, details the \"\n            \"subject given in QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Name for group or question text\",\n        description=(\n            \"Text that is displayed above the contents of the group or as the text \"\n            \"of the question being answered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireResponseItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"definition\",\n            \"text\",\n            \"subject\",\n            \"answer\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireResponseItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"linkId\", \"linkId__ext\")]\n        return required_fields\n\n\nclass QuestionnaireResponseItemAnswer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The response(s) to the question.\n    The respondent's answer(s) to the question.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireResponseItemAnswer\"\n\n    item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Nested groups and questions\",\n        description=\"Nested groups and/or questions found within this particular answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireResponseItemAnswer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueBoolean\",\n            \"valueDecimal\",\n            \"valueInteger\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueTime\",\n            \"valueString\",\n            \"valueUri\",\n            \"valueAttachment\",\n            \"valueCoding\",\n            \"valueQuantity\",\n            \"valueReference\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireResponseItemAnswer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCoding\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/range.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Range\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Range(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Set of values bounded by low and high.\n    A set of ordered Quantities defined by a low and high limit.\n    \"\"\"\n\n    __resource_type__ = \"Range\"\n\n    high: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"high\",\n        title=\"High limit\",\n        description=\"The high limit. The boundary is inclusive.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    low: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"low\",\n        title=\"Low limit\",\n        description=\"The low limit. The boundary is inclusive.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Range`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"low\", \"high\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Range`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"low\", \"high\"]\n"
  },
  {
    "path": "fhir/resources/STU3/ratio.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Ratio\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Ratio(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A ratio of two Quantity values - a numerator and a denominator.\n    A relationship of two Quantity values - expressed as a numerator and a\n    denominator.\n    \"\"\"\n\n    __resource_type__ = \"Ratio\"\n\n    denominator: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"denominator\",\n        title=\"Denominator value\",\n        description=\"The value of the denominator.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    numerator: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"numerator\",\n        title=\"Numerator value\",\n        description=\"The value of the numerator.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Ratio`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"numerator\", \"denominator\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Ratio`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"numerator\", \"denominator\"]\n"
  },
  {
    "path": "fhir/resources/STU3/reference.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Reference\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Reference(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reference from one resource to another.\n    \"\"\"\n\n    __resource_type__ = \"Reference\"\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Text alternative for the resource\",\n        description=(\n            \"Plain text narrative that identifies the resource in addition to the \"\n            \"resource reference.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Logical reference, when literal reference is not known\",\n        description=(\n            \"An identifier for the other resource. This is used when there is no \"\n            \"way to reference the other resource directly, either because the \"\n            \"entity is not available through a FHIR server, or because there is no \"\n            \"way for the author of the resource to convert a known identifier to an\"\n            \" actual location. There is no requirement that a Reference.identifier \"\n            \"point to something that is actually exposed as a FHIR instance, but it\"\n            \" SHALL point to a business concept that would be expected to be \"\n            \"exposed as a FHIR instance, and that instance would need to be of a \"\n            \"FHIR resource type allowed by the reference.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reference: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Literal reference, Relative, internal or absolute URL\",\n        description=(\n            \"A reference to a location at which the other resource is found. The \"\n            \"reference may be a relative reference, in which case it is relative to\"\n            \" the service base URL, or an absolute URL that resolves to the \"\n            \"location where the resource is found. The reference may be version \"\n            \"specific or not. If the reference is not to a FHIR RESTful server, \"\n            \"then it should be assumed to be version specific. Internal fragment \"\n            \"references (start with '#') refer to contained resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Reference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"reference\", \"identifier\", \"display\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Reference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"reference\", \"identifier\", \"display\"]\n"
  },
  {
    "path": "fhir/resources/STU3/referralrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ReferralRequest\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ReferralRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A request for referral or transfer of care.\n    Used to record and send details about a request for referral service or\n    transfer of a patient to the care of another provider or provider\n    organization.\n    \"\"\"\n\n    __resource_type__ = \"ReferralRequest\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"Date of creation/activation\",\n        description=(\n            \"Date/DateTime of creation for draft requests and date of activation \"\n            \"for active requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this request\",\n        description=(\n            \"Indicates any plans, proposals or orders that this request is intended\"\n            \" to satisfy - in whole or in part.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ReferralRequest\", \"CarePlan\", \"ProcedureRequest\"],\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Originating encounter\",\n        description=(\n            \"The encounter at which the request for referral or transfer of care is\"\n            \" initiated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    definition: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Instantiates protocol or definition\",\n        description=(\n            \"A protocol, guideline, orderset or other definition that is adhered to\"\n            \" in whole or in part by this request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"A textual description of the referral\",\n        description=(\n            \"The reason element gives a short description of why the referral is \"\n            \"being made, the description expands on this to support a more complete\"\n            \" clinical summary.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Composite request this is part of\",\n        description=(\n            'The business identifier of the logical \"grouping\" request/order that '\n            \"this referral is a part of.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Business identifier that uniquely identifies the referral/care \"\n            \"transfer request instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=\"proposal | plan | order\",\n        description=(\n            'Distinguishes the \"level\" of authorization/demand implicit in this '\n            \"request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"proposal\", \"plan\", \"order\"],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about referral request\",\n        description=\"Comments made about the referral request by any of the participants.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When the service(s) requested in the referral should occur\",\n        description=(\n            \"The period of time within which the services identified in the \"\n            \"referral/transfer of care is specified or required to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When the service(s) requested in the referral should occur\",\n        description=(\n            \"The period of time within which the services identified in the \"\n            \"referral/transfer of care is specified or required to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Urgency of referral / transfer of care request\",\n        description=(\n            \"An indication of the urgency of referral (or where applicable the type\"\n            \" of transfer of care) request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reasonCode\",\n        title=\"Reason for referral / transfer of care request\",\n        description=(\n            \"Description of clinical condition indicating why referral/transfer of \"\n            \"care is requested.  For example:  Pathological Anomalies, Disabled \"\n            \"(physical or mental),  Behavioral Management.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reasonReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why is service needed?\",\n        description=\"Indicates another resource whose existence justifies this request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Receiver of referral / transfer of care request\",\n        description=(\n            \"The healthcare provider(s) or provider organization(s) who/which is to\"\n            \" receive the referral/transfer of care request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Key events in history of request\",\n        description=(\n            \"Links to Provenance records for past versions of this resource or \"\n            \"fulfilling request or event resources that identify key state \"\n            \"transitions or updates that are likely to be relevant to a user \"\n            \"looking at the current version of the resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"Request(s) replaced by this request\",\n        description=(\n            \"Completed or terminated request(s) whose function is taken by this new\"\n            \" request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ReferralRequest\"],\n        },\n    )\n\n    requester: fhirtypes.ReferralRequestRequesterType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/what is requesting service\",\n        description=(\n            \"The individual who initiated the request and has responsibility for \"\n            \"its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceRequested: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceRequested\",\n        title=\"Actions requested as part of the referral\",\n        description=(\n            \"The service(s) that is/are requested to be provided to the patient.  \"\n            \"For example: cardiac pacemaker insertion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specialty: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=\"The clinical specialty (discipline) that the referral is requested for\",\n        description=(\n            \"Indication of the clinical domain or discipline to which the referral \"\n            \"or transfer of care request is sent.  For example: Cardiology \"\n            \"Gastroenterology Diabetology.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | suspended | cancelled | completed | entered-in-error \"\n            \"| unknown\"\n        ),\n        description=(\n            \"The status of the authorization/intention reflected by the referral \"\n            \"request record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"suspended\",\n                \"cancelled\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Patient referred to care or transfer\",\n        description=(\n            \"The patient who is the subject of a referral or transfer of care \"\n            \"request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Additonal information to support referral or transfer of care request\",\n        description=(\n            \"Any additional (administrative, financial or clinical) information \"\n            \"required to support request for referral or transfer of care.  For \"\n            \"example: Presenting problems/chief complaints Medical History Family \"\n            \"History Alerts Allergy/Intolerance and Adverse Reactions Medications \"\n            \"Observations/Assessments (may include cognitive and fundtional \"\n            \"assessments) Diagnostic Reports Care Plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Referral/Transition of care request type\",\n        description=(\n            \"An indication of the type of referral (or where applicable the type of\"\n            \" transfer of care) request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ReferralRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"type\",\n            \"priority\",\n            \"serviceRequested\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"authoredOn\",\n            \"requester\",\n            \"specialty\",\n            \"recipient\",\n            \"reasonCode\",\n            \"reasonReference\",\n            \"description\",\n            \"supportingInfo\",\n            \"note\",\n            \"relevantHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ReferralRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"type\",\n            \"priority\",\n            \"serviceRequested\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"authoredOn\",\n            \"requester\",\n            \"recipient\",\n            \"reasonCode\",\n            \"reasonReference\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\"]}\n        return one_of_many_fields\n\n\nclass ReferralRequestRequester(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who/what is requesting service.\n    The individual who initiated the request and has responsibility for its\n    activation.\n    \"\"\"\n\n    __resource_type__ = \"ReferralRequestRequester\"\n\n    agent: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Individual making the request\",\n        description=\"The device, practitioner, etc. who initiated the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization agent is acting for\",\n        description=\"The organization the device or practitioner was acting on behalf of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ReferralRequestRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"agent\", \"onBehalfOf\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ReferralRequestRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"agent\", \"onBehalfOf\"]\n"
  },
  {
    "path": "fhir/resources/STU3/relatedartifact.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RelatedArtifact\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass RelatedArtifact(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Related artifacts for a knowledge resource.\n    Related artifacts such as additional documentation, justification, or\n    bibliographic references.\n    \"\"\"\n\n    __resource_type__ = \"RelatedArtifact\"\n\n    citation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"citation\",\n        title=\"Bibliographic citation for the artifact\",\n        description=(\n            \"A bibliographic citation for the related artifact. This text SHOULD be\"\n            \" formatted according to an accepted citation format.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    citation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_citation\", title=\"Extension field for ``citation``.\"\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Brief description of the related artifact\",\n        description=(\n            \"A brief description of the document or knowledge resource being \"\n            \"referenced, suitable for display to a consumer.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    document: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"document\",\n        title=\"What document is being referenced\",\n        description=(\n            \"The document being referenced, represented as an attachment. This is \"\n            \"exclusive with the resource element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"What resource is being referenced\",\n        description=(\n            \"The related resource, such as a library, value set, profile, or other \"\n            \"knowledge resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"documentation | justification | citation | predecessor | successor | \"\n            \"derived-from | depends-on | composed-of\"\n        ),\n        description=\"The type of relationship to the related artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"documentation\",\n                \"justification\",\n                \"citation\",\n                \"predecessor\",\n                \"successor\",\n                \"derived-from\",\n                \"depends-on\",\n                \"composed-of\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Where the artifact can be accessed\",\n        description=(\n            \"A url for the artifact that can be followed to access the actual \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RelatedArtifact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"display\",\n            \"citation\",\n            \"url\",\n            \"document\",\n            \"resource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RelatedArtifact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"type\", \"display\", \"citation\", \"url\", \"document\", \"resource\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/relatedperson.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RelatedPerson\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass RelatedPerson(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An person that is related to a patient, but who is not a direct target of\n    care.\n    Information about a person that is involved in the care for a patient, but\n    who is not the target of healthcare, nor has a formal responsibility in the\n    care process.\n    \"\"\"\n\n    __resource_type__ = \"RelatedPerson\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this related person's record is in active use\",\n        description=\"Whether this related person record is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Address where the related person can be contacted or visited\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    birthDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"birthDate\",\n        title=\"The date on which the related person was born\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_birthDate\", title=\"Extension field for ``birthDate``.\"\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the person is considered to \"\n            \"have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"A human identifier for this person\",\n        description=\"Identifier for a person within a particular scope.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The patient this person is related to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period of time that this relationship is considered valid\",\n        description=(\n            \"The period of time that this relationship is considered to be valid. \"\n            \"If there are no dates defined, then the interval is unknown.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    photo: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Image of the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"The nature of the relationship\",\n        description=(\n            \"The nature of the relationship between a patient and the related \"\n            \"person.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the person\",\n        description=(\n            \"A contact detail for the person, e.g. a telephone number or an email \"\n            \"address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RelatedPerson`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"patient\",\n            \"relationship\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"address\",\n            \"photo\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RelatedPerson`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"patient\",\n            \"relationship\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"address\",\n        ]\n"
  },
  {
    "path": "fhir/resources/STU3/requestgroup.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RequestGroup\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass RequestGroup(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A group of related requests.\n    A group of related requests that can be used to capture intended activities\n    that have inter-dependencies such as \"give this medication after that one\".\n    \"\"\"\n\n    __resource_type__ = \"RequestGroup\"\n\n    action: typing.List[fhirtypes.RequestGroupActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Proposed actions, if any\",\n        description=\"The actions, if any, produced by the evaluation of the artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Device or practitioner that authored the request group\",\n        description=\"Provides a reference to the author of the request group.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"Practitioner\"],\n        },\n    )\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When the request group was authored\",\n        description=\"Indicates when the request group was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan, proposal, or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Encounter or Episode for the request group\",\n        description=\"Describes the context of the request group, if any.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    definition: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Instantiates protocol or definition\",\n        description=(\n            \"A protocol, guideline, orderset or other definition that is adhered to\"\n            \" in whole or in part by this request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Composite request this is part of\",\n        description=(\n            \"A shared identifier common to all requests that were authorized more \"\n            \"or less simultaneously by a single author, representing the identifier\"\n            \" of the requisition, prescription or similar form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Allows a service to provide a unique, business identifier for the \"\n            \"request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=\"proposal | plan | order\",\n        description=(\n            \"Indicates the level of authority/intentionality associated with the \"\n            \"request and where the request fits into the workflow chain.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"proposal\", \"plan\", \"order\"],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional notes about the response\",\n        description=(\n            \"Provides a mechanism to communicate additional information about the \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the request should be addressed with respect to \"\n            \"other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reasonCodeableConcept\",\n        title=\"Reason for the request group\",\n        description=(\n            \"Indicates the reason the request group was created. This is typically \"\n            \"provided as a parameter to the evaluation and echoed by the service, \"\n            \"although for some use cases, such as subscription- or event-based \"\n            \"scenarios, it may provide an indication of the cause for the response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e reason[x]\n            \"one_of_many\": \"reason\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    reasonReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Reason for the request group\",\n        description=(\n            \"Indicates the reason the request group was created. This is typically \"\n            \"provided as a parameter to the evaluation and echoed by the service, \"\n            \"although for some use cases, such as subscription- or event-based \"\n            \"scenarios, it may provide an indication of the cause for the response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e reason[x]\n            \"one_of_many\": \"reason\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"Request(s) replaced by this request\",\n        description=(\n            \"Completed or terminated request(s) whose function is taken by this new\"\n            \" request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | suspended | cancelled | completed | entered-in-error \"\n            \"| unknown\"\n        ),\n        description=(\n            \"The current state of the request. For request groups, the status \"\n            \"reflects the status of all the requests in the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"suspended\",\n                \"cancelled\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who the request group is about\",\n        description=\"The subject for which the request group was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definition\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"subject\",\n            \"context\",\n            \"authoredOn\",\n            \"author\",\n            \"reasonCodeableConcept\",\n            \"reasonReference\",\n            \"note\",\n            \"action\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"reason\": [\"reasonCodeableConcept\", \"reasonReference\"]}\n        return one_of_many_fields\n\n\nclass RequestGroupAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Proposed actions, if any.\n    The actions, if any, produced by the evaluation of the artifact.\n    \"\"\"\n\n    __resource_type__ = \"RequestGroupAction\"\n\n    action: typing.List[fhirtypes.RequestGroupActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Sub action\",\n        description=\"Sub actions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    cardinalityBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"cardinalityBehavior\",\n        title=\"single | multiple\",\n        description=\"Defines whether the action can be selected multiple times.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"single\", \"multiple\"],\n        },\n    )\n    cardinalityBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_cardinalityBehavior\",\n        title=\"Extension field for ``cardinalityBehavior``.\",\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code representing the meaning of the action or sub-actions\",\n        description=(\n            \"A code that provides meaning for the action or action group. For \"\n            \"example, a section may have a LOINC code for a the section of a \"\n            \"documentation template.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    condition: typing.List[fhirtypes.RequestGroupActionConditionType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Whether or not the action is applicable\",\n        description=(\n            \"An expression that describes applicability criteria, or start/stop \"\n            \"conditions for the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Short description of the action\",\n        description=(\n            \"A short description of the action used to provide a summary to display\"\n            \" to the user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Supporting documentation for the intended performer of the action\",\n        description=(\n            \"Didactic or other informational resources associated with the action \"\n            \"that can be provided to the CDS recipient. Information resources can \"\n            \"include inline text commentary and links to web resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    groupingBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"groupingBehavior\",\n        title=\"visual-group | logical-group | sentence-group\",\n        description=\"Defines the grouping behavior for the action and its children.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"visual-group\", \"logical-group\", \"sentence-group\"],\n        },\n    )\n    groupingBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_groupingBehavior\",\n        title=\"Extension field for ``groupingBehavior``.\",\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"User-visible label for the action (e.g. 1. or A.)\",\n        description=\"A user-visible label for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    participant: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Who should perform the action\",\n        description=\"The participant that should perform or be responsible for this action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Person\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    precheckBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"precheckBehavior\",\n        title=\"yes | no\",\n        description=\"Defines whether the action should usually be preselected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"yes\", \"no\"],\n        },\n    )\n    precheckBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_precheckBehavior\",\n        title=\"Extension field for ``precheckBehavior``.\",\n    )\n\n    relatedAction: typing.List[\n        fhirtypes.RequestGroupActionRelatedActionType\n    ] | None = Field(\n        default=None,\n        alias=\"relatedAction\",\n        title=\"Relationship to another action\",\n        description=(\n            'A relationship to another action such as \"before\" or \"30-60 minutes '\n            'after start of\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requiredBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"requiredBehavior\",\n        title=\"must | could | must-unless-documented\",\n        description=\"Defines the requiredness behavior for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"must\", \"could\", \"must-unless-documented\"],\n        },\n    )\n    requiredBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requiredBehavior\",\n        title=\"Extension field for ``requiredBehavior``.\",\n    )\n\n    resource: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"The target of the action\",\n        description=(\n            \"The resource that is the target of the action (e.g. \"\n            \"CommunicationRequest).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    selectionBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"selectionBehavior\",\n        title=\"any | all | all-or-none | exactly-one | at-most-one | one-or-more\",\n        description=\"Defines the selection behavior for the action and its children.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"any\",\n                \"all\",\n                \"all-or-none\",\n                \"exactly-one\",\n                \"at-most-one\",\n                \"one-or-more\",\n            ],\n        },\n    )\n    selectionBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_selectionBehavior\",\n        title=\"Extension field for ``selectionBehavior``.\",\n    )\n\n    textEquivalent: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"textEquivalent\",\n        title=(\n            \"Static text equivalent of the action, used if the dynamic aspects \"\n            \"cannot be interpreted by the receiving system\"\n        ),\n        description=(\n            \"A text equivalent of the action to be performed. This provides a \"\n            \"human-interpretable description of the action when the definition is \"\n            \"consumed by a system that may not be capable of interpreting it \"\n            \"dynamically.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    textEquivalent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_textEquivalent\",\n        title=\"Extension field for ``textEquivalent``.\",\n    )\n\n    timingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timingDateTime\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timingDateTime\",\n        title=\"Extension field for ``timingDateTime``.\",\n    )\n\n    timingDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"timingDuration\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"timingRange\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"User-visible title\",\n        description=\"The title of the action displayed to a user.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"create | update | remove | fire-event\",\n        description=\"The type of action to perform (create, update, remove).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestGroupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"label\",\n            \"title\",\n            \"description\",\n            \"textEquivalent\",\n            \"code\",\n            \"documentation\",\n            \"condition\",\n            \"relatedAction\",\n            \"timingDateTime\",\n            \"timingPeriod\",\n            \"timingDuration\",\n            \"timingRange\",\n            \"timingTiming\",\n            \"participant\",\n            \"type\",\n            \"groupingBehavior\",\n            \"selectionBehavior\",\n            \"requiredBehavior\",\n            \"precheckBehavior\",\n            \"cardinalityBehavior\",\n            \"resource\",\n            \"action\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestGroupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"description\", \"textEquivalent\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\n                \"timingDateTime\",\n                \"timingDuration\",\n                \"timingPeriod\",\n                \"timingRange\",\n                \"timingTiming\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass RequestGroupActionCondition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Whether or not the action is applicable.\n    An expression that describes applicability criteria, or start/stop\n    conditions for the action.\n    \"\"\"\n\n    __resource_type__ = \"RequestGroupActionCondition\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the condition\",\n        description=(\n            \"A brief, natural language description of the condition that \"\n            \"effectively communicates the intended semantics.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Boolean-valued expression\",\n        description=(\n            \"An expression that returns true or false, indicating whether or not \"\n            \"the condition is satisfied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"applicability | start | stop\",\n        description=\"The kind of condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"applicability\", \"start\", \"stop\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    language: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language of the expression\",\n        description=\"The media type of the language for the expression.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestGroupActionCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"kind\",\n            \"description\",\n            \"language\",\n            \"expression\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestGroupActionCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"kind\", \"kind__ext\")]\n        return required_fields\n\n\nclass RequestGroupActionRelatedAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationship to another action.\n    A relationship to another action such as \"before\" or \"30-60 minutes after\n    start of\".\n    \"\"\"\n\n    __resource_type__ = \"RequestGroupActionRelatedAction\"\n\n    actionId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"actionId\",\n        title=\"What action this is related to\",\n        description=\"The element id of the action this is related to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    actionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actionId\", title=\"Extension field for ``actionId``.\"\n    )\n\n    offsetDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"offsetDuration\",\n        title=\"Time offset for the relationship\",\n        description=(\n            \"A duration or range of durations to apply to the relationship. For \"\n            \"example, 30-60 minutes before.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e offset[x]\n            \"one_of_many\": \"offset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    offsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"offsetRange\",\n        title=\"Time offset for the relationship\",\n        description=(\n            \"A duration or range of durations to apply to the relationship. For \"\n            \"example, 30-60 minutes before.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e offset[x]\n            \"one_of_many\": \"offset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    relationship: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=(\n            \"before-start | before | before-end | concurrent-with-start | \"\n            \"concurrent | concurrent-with-end | after-start | after | after-end\"\n        ),\n        description=\"The relationship of this action to the related action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"before-start\",\n                \"before\",\n                \"before-end\",\n                \"concurrent-with-start\",\n                \"concurrent\",\n                \"concurrent-with-end\",\n                \"after-start\",\n                \"after\",\n                \"after-end\",\n            ],\n        },\n    )\n    relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relationship\",\n        title=\"Extension field for ``relationship``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestGroupActionRelatedAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"actionId\",\n            \"relationship\",\n            \"offsetDuration\",\n            \"offsetRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestGroupActionRelatedAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"actionId\", \"actionId__ext\"),\n            (\"relationship\", \"relationship__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"offset\": [\"offsetDuration\", \"offsetRange\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/researchstudy.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchStudy\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ResearchStudy(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Investigation to increase healthcare-related patient-independent knowledge.\n    A process where a researcher or organization plans and then executes a\n    series of steps intended to increase the field of healthcare-related\n    knowledge.  This includes studies of safety, efficacy, comparative\n    effectiveness and other information about medications, devices, therapies\n    and other interventional and investigative techniques.  A ResearchStudy\n    involves the gathering of information about human or animal subjects.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudy\"\n\n    arm: typing.List[fhirtypes.ResearchStudyArmType] | None = Field(\n        default=None,\n        alias=\"arm\",\n        title=\"Defined path through the study for a subject\",\n        description=(\n            \"Describes an expected sequence of events for one of the participants \"\n            \"of a study.  E.g. Exposure to drug A, wash-out, exposure to drug B, \"\n            \"wash-out, follow-up.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classifications for the study\",\n        description=(\n            \"Codes categorizing the type of study such as investigational vs. \"\n            \"observational, type of blinding, type of randomization, safety vs. \"\n            \"efficacy, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the study\",\n        description=(\n            \"Contact details to assist a user in learning more about or engaging \"\n            \"with the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"What this is study doing\",\n        description=\"A full description of how the study is being conducted.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    enrollment: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"enrollment\",\n        title=\"Inclusion & exclusion criteria\",\n        description=(\n            \"Reference to a Group that defines the criteria for and quantity of \"\n            'subjects participating in the study.  E.g. \" 200 female Europeans '\n            'between the ages of 20 and 45 with early onset diabetes\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    focus: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"Drugs, devices, conditions, etc. under study\",\n        description=(\n            \"The condition(s), medication(s), food(s), therapy(ies), device(s) or \"\n            \"other concerns or interventions that the study is seeking to gain more\"\n            \" information about.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for study\",\n        description=(\n            \"Identifiers assigned to this research study by the sponsor or other \"\n            \"systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Geographic region(s) for study\",\n        description=(\n            \"Indicates a country, state or other region where the study is taking \"\n            \"place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    keyword: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"keyword\",\n        title=\"Used to search for the study\",\n        description=\"Key terms to aid in searching for or filtering the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the event\",\n        description=(\n            \"Comments made about the event by the performer, subject or other \"\n            \"participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of larger study\",\n        description=(\n            \"A larger research study of which this particular study is a component \"\n            \"or step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchStudy\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When the study began and ended\",\n        description=(\n            \"Identifies the start date and the expected (or actual, depending on \"\n            \"status) end date for the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    principalInvestigator: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"principalInvestigator\",\n        title=\"The individual responsible for the study\",\n        description=(\n            \"Indicates the individual who has primary oversite of the execution of \"\n            \"the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    protocol: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"protocol\",\n        title=\"Steps followed in executing study\",\n        description=(\n            \"The set of steps expected to be performed as part of the execution of \"\n            \"the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PlanDefinition\"],\n        },\n    )\n\n    reasonStopped: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reasonStopped\",\n        title=\"Reason for terminating study early\",\n        description=(\n            \"A description and/or code explaining the premature termination of the \"\n            \"study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"References and dependencies\",\n        description=\"Citations, references and other related documents.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    site: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Location involved in study execution\",\n        description=(\n            \"Clinic, hospital or other healthcare location that is participating in\"\n            \" the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    sponsor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sponsor\",\n        title=\"Organization responsible for the study\",\n        description=\"The organization responsible for the execution of the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | in-progress | suspended | stopped | completed | entered-in-\"\n            \"error\"\n        ),\n        description=\"The current state of the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"in-progress\",\n                \"suspended\",\n                \"stopped\",\n                \"completed\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this study\",\n        description=\"A short, descriptive user-friendly label for the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"title\",\n            \"protocol\",\n            \"partOf\",\n            \"status\",\n            \"category\",\n            \"focus\",\n            \"contact\",\n            \"relatedArtifact\",\n            \"keyword\",\n            \"jurisdiction\",\n            \"description\",\n            \"enrollment\",\n            \"period\",\n            \"sponsor\",\n            \"principalInvestigator\",\n            \"site\",\n            \"reasonStopped\",\n            \"note\",\n            \"arm\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"title\",\n            \"protocol\",\n            \"partOf\",\n            \"status\",\n            \"category\",\n            \"focus\",\n            \"contact\",\n            \"keyword\",\n            \"jurisdiction\",\n            \"enrollment\",\n            \"period\",\n            \"sponsor\",\n            \"principalInvestigator\",\n            \"site\",\n            \"reasonStopped\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ResearchStudyArm(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defined path through the study for a subject.\n    Describes an expected sequence of events for one of the participants of a\n    study.  E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out,\n    follow-up.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudyArm\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Categorization of study arm\",\n        description=(\n            \"Categorization of study arm, e.g. experimental, active comparator, \"\n            \"placebo comparater.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Short explanation of study path\",\n        description=(\n            \"A succinct description of the path through the study that would be \"\n            \"followed by a subject adhering to this arm.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Label for study arm\",\n        description=\"Unique, human-readable label for this arm of the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudyArm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"code\", \"description\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudyArm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/researchsubject.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchSubject\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass ResearchSubject(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Investigation to increase healthcare-related patient-independent knowledge.\n    A process where a researcher or organization plans and then executes a\n    series of steps intended to increase the field of healthcare-related\n    knowledge.  This includes studies of safety, efficacy, comparative\n    effectiveness and other information about medications, devices, therapies\n    and other interventional and investigative techniques.  A ResearchStudy\n    involves the gathering of information about human or animal subjects.\n    \"\"\"\n\n    __resource_type__ = \"ResearchSubject\"\n\n    actualArm: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"actualArm\",\n        title=\"What path was followed\",\n        description=(\n            \"The name of the arm in the study the subject actually followed as part\"\n            \" of this study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    actualArm__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actualArm\", title=\"Extension field for ``actualArm``.\"\n    )\n\n    assignedArm: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"assignedArm\",\n        title=\"What path should be followed\",\n        description=(\n            \"The name of the arm in the study the subject is expected to follow as \"\n            \"part of this study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    assignedArm__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_assignedArm\", title=\"Extension field for ``assignedArm``.\"\n    )\n\n    consent: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"consent\",\n        title=\"Agreement to participate in study\",\n        description=(\n            \"A record of the patient's informed agreement to participate in the \"\n            \"study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Consent\"],\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for research subject\",\n        description=(\n            \"Identifiers assigned to this research study by the sponsor or other \"\n            \"systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    individual: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"individual\",\n        title=\"Who is part of study\",\n        description=\"The record of the person or animal who is involved in the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Start and end of participation\",\n        description=(\n            \"The dates the subject began and ended their participation in the \" \"study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"candidate | enrolled | active | suspended | withdrawn | completed\",\n        description=\"The current state of the subject.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"candidate\",\n                \"enrolled\",\n                \"active\",\n                \"suspended\",\n                \"withdrawn\",\n                \"completed\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    study: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"study\",\n        title=\"Study subject is part of\",\n        description=\"Reference to the study the subject is participating in.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchStudy\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"period\",\n            \"study\",\n            \"individual\",\n            \"assignedArm\",\n            \"actualArm\",\n            \"consent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"period\",\n            \"study\",\n            \"individual\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/resource.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Resource\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import fhirresourcemodel, fhirtypes\n\n\nclass Resource(fhirresourcemodel.FHIRResourceModel):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base Resource.\n    This is the base resource type for everything.\n    \"\"\"\n\n    __resource_type__ = \"Resource\"\n\n    id: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"id\",\n        title=\"Logical id of this artifact\",\n        description=(\n            \"The logical id of the resource, as used in the URL for the resource. \"\n            \"Once assigned, this value never changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    implicitRules: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"implicitRules\",\n        title=\"A set of rules under which this content was created\",\n        description=(\n            \"A reference to a set of rules that were followed when the resource was\"\n            \" constructed, and which must be understood when processing the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    implicitRules__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_implicitRules\",\n        title=\"Extension field for ``implicitRules``.\",\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language of the resource content\",\n        description=\"The base language in which the resource is written.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    meta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"meta\",\n        title=\"Metadata about the resource\",\n        description=(\n            \"The metadata about the resource. This is content that is maintained by\"\n            \" the infrastructure. Changes to the content may not always be \"\n            \"associated with version changes to the resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Resource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"language\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Resource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\"]\n"
  },
  {
    "path": "fhir/resources/STU3/riskassessment.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RiskAssessment\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass RiskAssessment(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Potential outcomes for a subject with likelihood.\n    An assessment of the likely outcome(s) for a patient or other subject as\n    well as the likelihood of each outcome.\n    \"\"\"\n\n    __resource_type__ = \"RiskAssessment\"\n\n    basedOn: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this assessment\",\n        description=\"A reference to the request that is fulfilled by this risk assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    basis: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basis\",\n        title=\"Information used in assessment\",\n        description=(\n            \"Indicates the source data considered as part of the assessment \"\n            \"(FamilyHistory, Observations, Procedures, Conditions, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of assessment\",\n        description=\"The type of the risk assessment performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments on the risk assessment\",\n        description=\"Additional comments about the risk assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    condition: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Condition assessed\",\n        description=(\n            \"For assessments or prognosis specific to a particular condition, \"\n            \"indicates the condition being assessed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Where was assessment performed?\",\n        description=\"The encounter where the assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier for the assessment\",\n        description=\"Business identifier assigned to the risk assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Evaluation mechanism\",\n        description=\"The algorithm, process or mechanism used to evaluate the risk.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    mitigation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"mitigation\",\n        title=\"How to reduce risk\",\n        description=(\n            \"A description of the steps that might be taken to reduce the \"\n            \"identified risk(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    mitigation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mitigation\", title=\"Extension field for ``mitigation``.\"\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When was assessment made?\",\n        description=\"The date (and possibly time) the risk assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When was assessment made?\",\n        description=\"The date (and possibly time) the risk assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    parent: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Part of this occurrence\",\n        description=(\n            \"A reference to a resource that this risk assessment is part of, such \"\n            \"as a Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who did assessment?\",\n        description=\"The provider or software application that performed the assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Device\"],\n        },\n    )\n\n    prediction: typing.List[fhirtypes.RiskAssessmentPredictionType] | None = Field(\n        default=None,\n        alias=\"prediction\",\n        title=\"Outcome predicted\",\n        description=\"Describes the expected outcome for the subject.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reasonCodeableConcept\",\n        title=\"Why the assessment was necessary?\",\n        description=\"The reason the risk assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e reason[x]\n            \"one_of_many\": \"reason\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    reasonReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why the assessment was necessary?\",\n        description=\"The reason the risk assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e reason[x]\n            \"one_of_many\": \"reason\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | preliminary | final | amended +\",\n        description=(\n            \"The status of the RiskAssessment, using the same statuses as an \"\n            \"Observation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"registered\", \"preliminary\", \"final\", \"amended\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who/what does assessment apply to?\",\n        description=\"The patient or group the risk assessment applies to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RiskAssessment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"parent\",\n            \"status\",\n            \"method\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"condition\",\n            \"performer\",\n            \"reasonCodeableConcept\",\n            \"reasonReference\",\n            \"basis\",\n            \"prediction\",\n            \"mitigation\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RiskAssessment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"method\",\n            \"code\",\n            \"subject\",\n            \"context\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"condition\",\n            \"performer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\"],\n            \"reason\": [\"reasonCodeableConcept\", \"reasonReference\"],\n        }\n        return one_of_many_fields\n\n\nclass RiskAssessmentPrediction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Outcome predicted.\n    Describes the expected outcome for the subject.\n    \"\"\"\n\n    __resource_type__ = \"RiskAssessmentPrediction\"\n\n    outcome: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"outcome\",\n        title=\"Possible outcome for the subject\",\n        description=(\n            \"One of the potential outcomes for the patient (e.g. remission, death,\"\n            \"  a particular condition).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    probabilityDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"probabilityDecimal\",\n        title=\"Likelihood of specified outcome\",\n        description=\"How likely is the outcome (in the specified timeframe).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e probability[x]\n            \"one_of_many\": \"probability\",\n            \"one_of_many_required\": False,\n        },\n    )\n    probabilityDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_probabilityDecimal\",\n        title=\"Extension field for ``probabilityDecimal``.\",\n    )\n\n    probabilityRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"probabilityRange\",\n        title=\"Likelihood of specified outcome\",\n        description=\"How likely is the outcome (in the specified timeframe).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e probability[x]\n            \"one_of_many\": \"probability\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    qualitativeRisk: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"qualitativeRisk\",\n        title=\"Likelihood of specified outcome as a qualitative value\",\n        description=(\n            \"How likely is the outcome (in the specified timeframe), expressed as a\"\n            \" qualitative value (e.g. low, medium, high).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rationale: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"rationale\",\n        title=\"Explanation of prediction\",\n        description=\"Additional information explaining the basis for the prediction.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    rationale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rationale\", title=\"Extension field for ``rationale``.\"\n    )\n\n    relativeRisk: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"relativeRisk\",\n        title=\"Relative likelihood\",\n        description=(\n            \"Indicates the risk for this particular subject (with their specific \"\n            \"characteristics) divided by the risk of the population in general.  \"\n            \"(Numbers greater than 1 = higher risk than the population, numbers \"\n            \"less than 1 = lower risk.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    relativeRisk__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relativeRisk\",\n        title=\"Extension field for ``relativeRisk``.\",\n    )\n\n    whenPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"whenPeriod\",\n        title=\"Timeframe or age range\",\n        description=(\n            \"Indicates the period of time or age range of the subject to which the \"\n            \"specified probability applies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    whenRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"whenRange\",\n        title=\"Timeframe or age range\",\n        description=(\n            \"Indicates the period of time or age range of the subject to which the \"\n            \"specified probability applies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RiskAssessmentPrediction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"outcome\",\n            \"probabilityDecimal\",\n            \"probabilityRange\",\n            \"qualitativeRisk\",\n            \"relativeRisk\",\n            \"whenPeriod\",\n            \"whenRange\",\n            \"rationale\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RiskAssessmentPrediction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"probability\": [\"probabilityDecimal\", \"probabilityRange\"],\n            \"when\": [\"whenPeriod\", \"whenRange\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/sampleddata.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SampledData\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass SampledData(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A series of measurements taken by a device.\n    A series of measurements taken by a device, with upper and lower limits.\n    There may be more than one dimension in the data.\n    \"\"\"\n\n    __resource_type__ = \"SampledData\"\n\n    data: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"data\",\n        title='Decimal values with spaces, or \"E\" | \"U\" | \"L\"',\n        description=(\n            \"A series of data points which are decimal values separated by a single\"\n            ' space (character u20). The special values \"E\" (error), \"L\" (below '\n            'detection limit) and \"U\" (above detection limit) can also be used in '\n            \"place of a decimal value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_data\", title=\"Extension field for ``data``.\"\n    )\n\n    dimensions: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"dimensions\",\n        title=\"Number of sample points at each time point\",\n        description=(\n            \"The number of sample points at each time point. If this value is \"\n            \"greater than one, then the dimensions will be interlaced - all the \"\n            \"sample points for a point in time will be recorded at once.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    dimensions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dimensions\", title=\"Extension field for ``dimensions``.\"\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Multiply data by this before adding to origin\",\n        description=(\n            \"A correction factor that is applied to the sampled data points before \"\n            \"they are added to the origin.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    lowerLimit: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"lowerLimit\",\n        title=\"Lower limit of detection\",\n        description=(\n            \"The lower limit of detection of the measured points. This is needed if\"\n            ' any of the data points have the value \"L\" (lower than detection '\n            \"limit).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lowerLimit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lowerLimit\", title=\"Extension field for ``lowerLimit``.\"\n    )\n\n    origin: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"origin\",\n        title=\"Zero value and units\",\n        description=(\n            \"The base quantity that a measured value of zero represents. In \"\n            \"addition, this provides the units of the entire measurement series.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Number of milliseconds between samples\",\n        description=\"The length of time between sampling times, measured in milliseconds.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    period__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_period\", title=\"Extension field for ``period``.\"\n    )\n\n    upperLimit: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"upperLimit\",\n        title=\"Upper limit of detection\",\n        description=(\n            \"The upper limit of detection of the measured points. This is needed if\"\n            ' any of the data points have the value \"U\" (higher than detection '\n            \"limit).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    upperLimit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_upperLimit\", title=\"Extension field for ``upperLimit``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SampledData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"origin\",\n            \"period\",\n            \"factor\",\n            \"lowerLimit\",\n            \"upperLimit\",\n            \"dimensions\",\n            \"data\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SampledData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"origin\", \"period\", \"factor\", \"lowerLimit\", \"upperLimit\", \"dimensions\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"data\", \"data__ext\"),\n            (\"dimensions\", \"dimensions__ext\"),\n            (\"period\", \"period__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/schedule.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Schedule\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Schedule(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A container for slots of time that may be available for booking\n    appointments.\n    \"\"\"\n\n    __resource_type__ = \"Schedule\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this schedule is in active use\",\n        description=(\n            \"Whether this schedule record is in active use, or should not be used \"\n            \"(such as was entered in error).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    actor: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"actor\",\n        title=(\n            \"The resource this Schedule resource is providing availability \"\n            \"information for. These are expected to usually be one of \"\n            \"HealthcareService, Location, Practitioner, PractitionerRole, Device, \"\n            \"Patient or RelatedPerson\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"HealthcareService\",\n                \"Location\",\n            ],\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=(\n            \"Comments on the availability to describe any extended information. \"\n            \"Such as custom constraints on the slots that may be associated\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    planningHorizon: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"planningHorizon\",\n        title=(\n            \"The period of time that the slots that are attached to this Schedule \"\n            \"resource cover (even if none exist). These  cover the amount of time \"\n            \"that an organization's planning horizon; the interval for which they \"\n            \"are currently accepting appointments. This does not define a \"\n            '\"template\" for planning outside these dates'\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceCategory: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"serviceCategory\",\n        title=(\n            \"A broad categorisation of the service that is to be performed during \"\n            \"this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceType\",\n        title=\"The specific service that is to be performed during this appointment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=(\n            \"The specialty of a practitioner that would be required to perform the \"\n            \"service requested in this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Schedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"actor\",\n            \"planningHorizon\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Schedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"active\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"actor\",\n            \"planningHorizon\",\n        ]\n"
  },
  {
    "path": "fhir/resources/STU3/searchparameter.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SearchParameter\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SearchParameter(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Search Parameter for a resource.\n    A search parameter that defines a named search item that can be used to\n    search/filter on a resource.\n    \"\"\"\n\n    __resource_type__ = \"SearchParameter\"\n\n    base: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"The resource type(s) this search parameter applies to\",\n        description=(\n            \"The base resource type(s) that this search parameter can be used \"\n            \"against.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    base__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_base\", title=\"Extension field for ``base``.\"\n    )\n\n    chain: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"chain\",\n        title=\"Chained names supported\",\n        description=(\n            \"Contains the names of any search parameters which may be chained to \"\n            \"the containing search parameter. Chained parameters may be added to \"\n            \"search parameters of type reference, and specify that resources will \"\n            \"only be returned if they contain a reference to a resource which \"\n            \"matches the chained parameter value. Values for this field should be \"\n            \"drawn from SearchParameter.code for a parameter on the target resource\"\n            \" type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    chain__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_chain\", title=\"Extension field for ``chain``.\"\n    )\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code used in URL\",\n        description=(\n            \"The code used in the URL or the parameter name in a parameters \"\n            \"resource for this search parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    comparator: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"comparator\",\n        title=\"eq | ne | gt | lt | ge | le | sa | eb | ap\",\n        description=\"Comparators supported for the search parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"eq\", \"ne\", \"gt\", \"lt\", \"ge\", \"le\", \"sa\", \"eb\", \"ap\"],\n        },\n    )\n    comparator__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_comparator\", title=\"Extension field for ``comparator``.\"\n    )\n\n    component: typing.List[fhirtypes.SearchParameterComponentType] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"For Composite resources to define the parts\",\n        description=\"Used to define the parts of a composite search parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the search parameter was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the search parameter \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFrom: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Original Definition for the search parameter\",\n        description=(\n            \"Where this search parameter is originally defined. If a derivedFrom is\"\n            \" provided, then the details in the search parameter must be consistent\"\n            \" with the definition from which it is defined. I.e. the parameter \"\n            \"should have the same meaning, and (usually) the functionality should \"\n            \"be a proper subset of the underlying search parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    derivedFrom__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_derivedFrom\", title=\"Extension field for ``derivedFrom``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the search parameter\",\n        description=(\n            \"A free text natural language description of the search parameter from \"\n            \"a consumer's perspective. and how it used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this search parameter is authored for\"\n            \" testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"FHIRPath expression that extracts the values\",\n        description=(\n            \"A FHIRPath expression that returns a set of elements for the search \"\n            \"parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for search parameter (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the search parameter is intended\"\n            \" to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=(\n            \"missing | exact | contains | not | text | in | not-in | below | above \"\n            \"| type\"\n        ),\n        description=\"A modifier supported for the search parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"missing\",\n                \"exact\",\n                \"contains\",\n                \"not\",\n                \"text\",\n                \"in\",\n                \"not-in\",\n                \"below\",\n                \"above\",\n                \"type\",\n            ],\n        },\n    )\n    modifier__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_modifier\", title=\"Extension field for ``modifier``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this search parameter (computer friendly)\",\n        description=(\n            \"A natural language name identifying the search parameter. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the search \"\n            \"parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this search parameter is defined\",\n        description=(\n            \"Explaination of why this search parameter is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this search parameter. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    target: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Types of resource (if a resource reference)\",\n        description=\"Types of resource (if a resource is referenced).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    target__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_target\", title=\"Extension field for ``target``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"number | date | string | token | reference | composite | quantity | \" \"uri\"\n        ),\n        description=(\n            \"The type of value a search parameter refers to, and how the content is\"\n            \" interpreted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"number\",\n                \"date\",\n                \"string\",\n                \"token\",\n                \"reference\",\n                \"composite\",\n                \"quantity\",\n                \"uri\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this search parameter (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this search parameter when it\"\n            \" is referenced in a specification, model, design or an instance. This \"\n            \"SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at\"\n            \" which this search parameter is (or will be) published. The URL SHOULD\"\n            \" include the major version of the search parameter. For more \"\n            \"information see [Technical and Business \"\n            \"Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate search parameter instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the search parameter\",\n        description=(\n            \"The identifier that is used to identify this version of the search \"\n            \"parameter when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the search parameter \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    xpath: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"xpath\",\n        title=\"XPath that extracts the values\",\n        description=(\n            \"An XPath expression that returns a set of elements for the search \"\n            \"parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    xpath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_xpath\", title=\"Extension field for ``xpath``.\"\n    )\n\n    xpathUsage: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"xpathUsage\",\n        title=\"normal | phonetic | nearby | distance | other\",\n        description=(\n            \"How the search parameter relates to the set of elements returned by \"\n            \"evaluating the xpath query.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"normal\", \"phonetic\", \"nearby\", \"distance\", \"other\"],\n        },\n    )\n    xpathUsage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_xpathUsage\", title=\"Extension field for ``xpathUsage``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SearchParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"code\",\n            \"base\",\n            \"type\",\n            \"derivedFrom\",\n            \"description\",\n            \"expression\",\n            \"xpath\",\n            \"xpathUsage\",\n            \"target\",\n            \"comparator\",\n            \"modifier\",\n            \"chain\",\n            \"component\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SearchParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"version\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"code\",\n            \"base\",\n            \"type\",\n            \"description\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"base\", \"base__ext\"),\n            (\"code\", \"code__ext\"),\n            (\"description\", \"description__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"type\", \"type__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n\nclass SearchParameterComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    For Composite resources to define the parts.\n    Used to define the parts of a composite search parameter.\n    \"\"\"\n\n    __resource_type__ = \"SearchParameterComponent\"\n\n    definition: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"definition\",\n        title=\"Defines how the part works\",\n        description=\"The definition of the search parameter that describes this part.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SearchParameter\"],\n        },\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Subexpression relative to main expression\",\n        description=(\n            \"A sub-expression that defines how to extract values for this component\"\n            \" from the output of the main SearchParameter.expression.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SearchParameterComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"definition\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SearchParameterComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"expression\", \"expression__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/sequence.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Sequence\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Sequence(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about a biological sequence.\n    Raw data describing a biological sequence.\n    \"\"\"\n\n    __resource_type__ = \"Sequence\"\n\n    coordinateSystem: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"coordinateSystem\",\n        title=(\n            \"Base number of coordinate system (0 for 0-based numbering or \"\n            \"coordinates, inclusive start, exclusive end, 1 for 1-based numbering, \"\n            \"inclusive start, inclusive end)\"\n        ),\n        description=(\n            \"Whether the sequence is numbered starting at 0 (0-based numbering or \"\n            \"coordinates, inclusive start, exclusive end) or starting at 1 (1-based\"\n            \" numbering, inclusive start and inclusive end).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    coordinateSystem__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_coordinateSystem\",\n        title=\"Extension field for ``coordinateSystem``.\",\n    )\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"The method for sequencing\",\n        description=\"The method for sequencing, for example, chip information.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique ID for this particular sequence. This is a FHIR-defined id\",\n        description=(\n            \"A unique identifier for this particular sequence instance. This is a \"\n            \"FHIR-defined id.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    observedSeq: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"observedSeq\",\n        title=\"Sequence that was observed\",\n        description=(\n            \"Sequence that was observed. It is the result marked by referenceSeq \"\n            \"along with variant records on referenceSeq. This shall starts from \"\n            \"referenceSeq.windowStart and end by referenceSeq.windowEnd.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    observedSeq__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_observedSeq\", title=\"Extension field for ``observedSeq``.\"\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"Who and/or what this is about\",\n        description=\"The patient whose sequencing results are described by this resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who should be responsible for test result\",\n        description=\"The organization or lab that should be responsible for this result.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    pointer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"pointer\",\n        title=\"Pointer to next atomic sequence\",\n        description=\"Pointer to next atomic sequence which at most contains one variant.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Sequence\"],\n        },\n    )\n\n    quality: typing.List[fhirtypes.SequenceQualityType] | None = Field(\n        default=None,\n        alias=\"quality\",\n        title=\"An set of value as quality of sequence\",\n        description=(\n            \"An experimental feature attribute that defines the quality of the \"\n            \"feature in a quantitative way, such as a phred quality score ([SO:0001\"\n            \"686](http://www.sequenceontology.org/browser/current_svn/term/SO:00016\"\n            \"86)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"The number of copies of the seqeunce of interest.  (RNASeq)\",\n        description=\"The number of copies of the seqeunce of interest. (RNASeq).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    readCoverage: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"readCoverage\",\n        title=(\n            \"Average number of reads representing a given nucleotide in the \"\n            \"reconstructed sequence\"\n        ),\n        description=(\n            \"Coverage (read depth or depth) is the average number of reads \"\n            \"representing a given nucleotide in the reconstructed sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    readCoverage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_readCoverage\",\n        title=\"Extension field for ``readCoverage``.\",\n    )\n\n    referenceSeq: fhirtypes.SequenceReferenceSeqType | None = Field(\n        default=None,\n        alias=\"referenceSeq\",\n        title=\"A sequence used as reference\",\n        description=(\n            \"A sequence that is used as a reference to describe variants that are \"\n            \"present in a sequence analyzed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    repository: typing.List[fhirtypes.SequenceRepositoryType] | None = Field(\n        default=None,\n        alias=\"repository\",\n        title=(\n            \"External repository which contains detailed report related with \"\n            \"observedSeq in this resource\"\n        ),\n        description=(\n            \"Configurations of the external repository. The repository shall store \"\n            \"target's observedSeq or records related with target's observedSeq.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specimen: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Specimen used for sequencing\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"aa | dna | rna\",\n        description=\"Amino Acid Sequence/ DNA Sequence / RNA Sequence.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"aa\", \"dna\", \"rna\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    variant: typing.List[fhirtypes.SequenceVariantType] | None = Field(\n        default=None,\n        alias=\"variant\",\n        title=\"Variant in sequence\",\n        description=(\n            \"The definition of variant here originates from Sequence ontology ([var\"\n            \"iant_of](http://www.sequenceontology.org/browser/current_svn/term/vari\"\n            \"ant_of)). This element can represent amino acid or nucleic sequence \"\n            \"change(including insertion,deletion,SNP,etc.)  It can represent some \"\n            \"complex mutation or segment variation with the assist of CIGAR string.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Sequence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"coordinateSystem\",\n            \"patient\",\n            \"specimen\",\n            \"device\",\n            \"performer\",\n            \"quantity\",\n            \"referenceSeq\",\n            \"variant\",\n            \"observedSeq\",\n            \"quality\",\n            \"readCoverage\",\n            \"repository\",\n            \"pointer\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Sequence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"type\",\n            \"coordinateSystem\",\n            \"patient\",\n            \"specimen\",\n            \"device\",\n            \"performer\",\n            \"quantity\",\n            \"referenceSeq\",\n            \"variant\",\n            \"observedSeq\",\n            \"quality\",\n            \"readCoverage\",\n            \"repository\",\n            \"pointer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"coordinateSystem\", \"coordinateSystem__ext\")]\n        return required_fields\n\n\nclass SequenceQuality(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An set of value as quality of sequence.\n    An experimental feature attribute that defines the quality of the feature\n    in a quantitative way, such as a phred quality score ([SO:0001686](http://w\n    ww.sequenceontology.org/browser/current_svn/term/SO:0001686)).\n    \"\"\"\n\n    __resource_type__ = \"SequenceQuality\"\n\n    end: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"End position of the sequence\",\n        description=(\n            \"End position of the sequence.If the coordinate system is 0-based then \"\n            \"end is is exclusive and does not include the last position. If the \"\n            \"coordinate system is 1-base, then end is inclusive and includes the \"\n            \"last position.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    fScore: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"fScore\",\n        title=\"F-score\",\n        description=(\n            \"Harmonic mean of Recall and Precision, computed as: 2 * precision * \"\n            \"recall / (precision + recall).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fScore__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fScore\", title=\"Extension field for ``fScore``.\"\n    )\n\n    gtFP: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"gtFP\",\n        title=(\n            \"False positives where the non-REF alleles in the Truth and Query Call \"\n            \"Sets match\"\n        ),\n        description=(\n            \"The number of false positives where the non-REF alleles in the Truth \"\n            \"and Query Call Sets match (i.e. cases where the truth is 1/1 and the \"\n            \"query is 0/1 or similar).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    gtFP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gtFP\", title=\"Extension field for ``gtFP``.\"\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Method to get quality\",\n        description=\"Which method is used to get sequence quality.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    precision: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"precision\",\n        title=\"Precision of comparison\",\n        description=\"QUERY.TP / (QUERY.TP + QUERY.FP).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    precision__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_precision\", title=\"Extension field for ``precision``.\"\n    )\n\n    queryFP: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"queryFP\",\n        title=\"False positives\",\n        description=(\n            \"False positives, i.e. the number of sites in the Query Call Set for \"\n            \"which there is no path through the Truth Call Set that is consistent \"\n            \"with this site. Sites with correct variant but incorrect genotype are \"\n            \"counted here.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    queryFP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_queryFP\", title=\"Extension field for ``queryFP``.\"\n    )\n\n    queryTP: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"queryTP\",\n        title=\"True positives from the perspective of the query data\",\n        description=(\n            \"True positives, from the perspective of the query data, i.e. the \"\n            \"number of sites in the Query Call Set for which there are paths \"\n            \"through the Truth Call Set that are consistent with all of the alleles\"\n            \" at this site, and for which there is an accurate genotype call for \"\n            \"the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    queryTP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_queryTP\", title=\"Extension field for ``queryTP``.\"\n    )\n\n    recall: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"recall\",\n        title=\"Recall of comparison\",\n        description=\"TRUTH.TP / (TRUTH.TP + TRUTH.FN).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    recall__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recall\", title=\"Extension field for ``recall``.\"\n    )\n\n    score: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"score\",\n        title=\"Quality score for the comparison\",\n        description=(\n            \"The score of an experimentally derived feature such as a p-value ([SO:\"\n            \"0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0\"\n            \"001685)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    standardSequence: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"standardSequence\",\n        title=\"Standard sequence for comparison\",\n        description=\"Gold standard sequence used for comparing against.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    start: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Start position of the sequence\",\n        description=(\n            \"Start position of the sequence. If the coordinate system is either \"\n            \"0-based or 1-based, then start position is inclusive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    truthFN: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"truthFN\",\n        title=\"False negatives\",\n        description=(\n            \"False negatives, i.e. the number of sites in the Truth Call Set for \"\n            \"which there is no path through the Query Call Set that is consistent \"\n            \"with all of the alleles at this site, or sites for which there is an \"\n            \"inaccurate genotype call for the event. Sites with correct variant but\"\n            \" incorrect genotype are counted here.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    truthFN__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_truthFN\", title=\"Extension field for ``truthFN``.\"\n    )\n\n    truthTP: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"truthTP\",\n        title=\"True positives from the perspective of the truth data\",\n        description=(\n            \"True positives, from the perspective of the truth data, i.e. the \"\n            \"number of sites in the Truth Call Set for which there are paths \"\n            \"through the Query Call Set that are consistent with all of the alleles\"\n            \" at this site, and for which there is an accurate genotype call for \"\n            \"the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    truthTP__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_truthTP\", title=\"Extension field for ``truthTP``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"indel | snp | unknown\",\n        description=\"INDEL / SNP / Undefined variant.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"indel\", \"snp\", \"unknown\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SequenceQuality`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"standardSequence\",\n            \"start\",\n            \"end\",\n            \"score\",\n            \"method\",\n            \"truthTP\",\n            \"queryTP\",\n            \"truthFN\",\n            \"queryFP\",\n            \"gtFP\",\n            \"precision\",\n            \"recall\",\n            \"fScore\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SequenceQuality`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"standardSequence\",\n            \"start\",\n            \"end\",\n            \"score\",\n            \"method\",\n            \"truthTP\",\n            \"queryTP\",\n            \"truthFN\",\n            \"queryFP\",\n            \"gtFP\",\n            \"precision\",\n            \"recall\",\n            \"fScore\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass SequenceReferenceSeq(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A sequence used as reference.\n    A sequence that is used as a reference to describe variants that are\n    present in a sequence analyzed.\n    \"\"\"\n\n    __resource_type__ = \"SequenceReferenceSeq\"\n\n    chromosome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"chromosome\",\n        title=\"Chromosome containing genetic finding\",\n        description=(\n            \"Structural unit composed of a nucleic acid molecule which controls its\"\n            \" own replication through the interaction of specific proteins at one \"\n            \"or more origins of replication ([SO:0000340](http://www.sequenceontolo\"\n            \"gy.org/browser/current_svn/term/SO:0000340)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    genomeBuild: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"genomeBuild\",\n        title=(\n            \"The Genome Build used for reference, following GRCh build versions \"\n            \"e.g. 'GRCh 37'\"\n        ),\n        description=(\n            \"The Genome Build used for reference, following GRCh build versions \"\n            \"e.g. 'GRCh 37'.  Version number must be included if a versioned \"\n            \"release of a primary build was used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    genomeBuild__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_genomeBuild\", title=\"Extension field for ``genomeBuild``.\"\n    )\n\n    referenceSeqId: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"referenceSeqId\",\n        title=\"Reference identifier\",\n        description=(\n            \"Reference identifier of reference sequence submitted to NCBI. It must \"\n            \"match the type in the Sequence.type field. For example, the prefix, \"\n            \"\\u201cNG_\\u201d identifies reference sequence for genes, \\u201cNM_\\u201d for messenger RNA\"\n            \" transcripts, and \\u201cNP_\\u201d for amino acid sequences.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    referenceSeqPointer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referenceSeqPointer\",\n        title=\"A Pointer to another Sequence entity as reference sequence\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Sequence\"],\n        },\n    )\n\n    referenceSeqString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"referenceSeqString\",\n        title=\"A string to represent reference sequence\",\n        description='A string like \"ACGT\".',\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    referenceSeqString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_referenceSeqString\",\n        title=\"Extension field for ``referenceSeqString``.\",\n    )\n\n    strand: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"strand\",\n        title=\"Directionality of DNA ( +1/-1)\",\n        description=(\n            'Directionality of DNA sequence. Available values are \"1\" for the plus '\n            \"strand (5' to 3')/Watson/Sense/positive  and \\\"-1\\\" for the minus \"\n            \"strand(3' to 5')/Crick/Antisense/negative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    strand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_strand\", title=\"Extension field for ``strand``.\"\n    )\n\n    windowEnd: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"windowEnd\",\n        title=\"End position of the window on the reference sequence\",\n        description=(\n            \"End position of the window on the reference sequence. If the \"\n            \"coordinate system is 0-based then end is is exclusive and does not \"\n            \"include the last position. If the coordinate system is 1-base, then \"\n            \"end is inclusive and includes the last position.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    windowEnd__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_windowEnd\", title=\"Extension field for ``windowEnd``.\"\n    )\n\n    windowStart: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"windowStart\",\n        title=\"Start position of the window on the  reference sequence\",\n        description=(\n            \"Start position of the window on the reference sequence. If the \"\n            \"coordinate system is either 0-based or 1-based, then start position is\"\n            \" inclusive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    windowStart__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_windowStart\", title=\"Extension field for ``windowStart``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SequenceReferenceSeq`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"chromosome\",\n            \"genomeBuild\",\n            \"referenceSeqId\",\n            \"referenceSeqPointer\",\n            \"referenceSeqString\",\n            \"strand\",\n            \"windowStart\",\n            \"windowEnd\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SequenceReferenceSeq`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"chromosome\",\n            \"genomeBuild\",\n            \"referenceSeqId\",\n            \"referenceSeqPointer\",\n            \"referenceSeqString\",\n            \"strand\",\n            \"windowStart\",\n            \"windowEnd\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"windowEnd\", \"windowEnd__ext\"),\n            (\"windowStart\", \"windowStart__ext\"),\n        ]\n        return required_fields\n\n\nclass SequenceRepository(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    External repository which contains detailed report related with observedSeq\n    in this resource.\n    Configurations of the external repository. The repository shall store\n    target's observedSeq or records related with target's observedSeq.\n    \"\"\"\n\n    __resource_type__ = \"SequenceRepository\"\n\n    datasetId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"datasetId\",\n        title=\"Id of the dataset that used to call for dataset in repository\",\n        description=(\n            \"Id of the variant in this external repository. The server will \"\n            \"understand how to use this id to call for more info about datasets in \"\n            \"external repository.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    datasetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_datasetId\", title=\"Extension field for ``datasetId``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Repository's name\",\n        description=(\n            \"URI of an external repository which contains further details about the\"\n            \" genetics data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    readsetId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"readsetId\",\n        title=\"Id of the read\",\n        description=\"Id of the read in this external repository.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    readsetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_readsetId\", title=\"Extension field for ``readsetId``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"directlink | openapi | login | oauth | other\",\n        description=(\n            \"Click and see / RESTful API / Need login to see / RESTful API with \"\n            \"authentication / Other ways to see resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"directlink\", \"openapi\", \"login\", \"oauth\", \"other\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"URI of the repository\",\n        description=(\n            \"URI of an external repository which contains further details about the\"\n            \" genetics data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    variantsetId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"variantsetId\",\n        title=\"Id of the variantset that used to call for variantset in repository\",\n        description=(\n            \"Id of the variantset in this external repository. The server will \"\n            \"understand how to use this id to call for more info about variantsets \"\n            \"in external repository.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    variantsetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_variantsetId\",\n        title=\"Extension field for ``variantsetId``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SequenceRepository`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"url\",\n            \"name\",\n            \"datasetId\",\n            \"variantsetId\",\n            \"readsetId\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SequenceRepository`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"url\",\n            \"name\",\n            \"datasetId\",\n            \"variantsetId\",\n            \"readsetId\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass SequenceVariant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Variant in sequence.\n    The definition of variant here originates from Sequence ontology ([variant_\n    of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)).\n    This element can represent amino acid or nucleic sequence change(including\n    insertion,deletion,SNP,etc.)  It can represent some complex mutation or\n    segment variation with the assist of CIGAR string.\n    \"\"\"\n\n    __resource_type__ = \"SequenceVariant\"\n\n    cigar: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"cigar\",\n        title=\"Extended CIGAR string for aligning the sequence with reference bases\",\n        description=(\n            \"Extended CIGAR string for aligning the sequence with reference bases. \"\n            \"See detailed documentation [here](http://support.illumina.com/help/Seq\"\n            \"uencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/\"\n            \"CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    cigar__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_cigar\", title=\"Extension field for ``cigar``.\"\n    )\n\n    end: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"End position of the variant on the reference sequence\",\n        description=(\n            \"End position of the variant on the reference sequence.If the \"\n            \"coordinate system is 0-based then end is is exclusive and does not \"\n            \"include the last position. If the coordinate system is 1-base, then \"\n            \"end is inclusive and includes the last position.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    observedAllele: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"observedAllele\",\n        title=\"Allele that was observed\",\n        description=(\n            \"An allele is one of a set of coexisting sequence variants of a gene ([\"\n            \"SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/S\"\n            \"O:0001023)).  Nucleotide(s)/amino acids from start position of \"\n            \"sequence to stop position of sequence on the positive (+) strand of \"\n            \"the observed  sequence. When the sequence  type is DNA, it should be \"\n            \"the sequence on the positive (+) strand. This will lay in the range \"\n            \"between variant.start and variant.end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    observedAllele__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_observedAllele\",\n        title=\"Extension field for ``observedAllele``.\",\n    )\n\n    referenceAllele: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"referenceAllele\",\n        title=\"Allele in the reference sequence\",\n        description=(\n            \"An allele is one of a set of coexisting sequence variants of a gene ([\"\n            \"SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/S\"\n            \"O:0001023)). Nucleotide(s)/amino acids from start position of sequence\"\n            \" to stop position of sequence on the positive (+) strand of the \"\n            \"reference sequence. When the sequence  type is DNA, it should be the \"\n            \"sequence on the positive (+) strand. This will lay in the range \"\n            \"between variant.start and variant.end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    referenceAllele__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_referenceAllele\",\n        title=\"Extension field for ``referenceAllele``.\",\n    )\n\n    start: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Start position of the variant on the  reference sequence\",\n        description=(\n            \"Start position of the variant on the  reference sequence.If the \"\n            \"coordinate system is either 0-based or 1-based, then start position is\"\n            \" inclusive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    variantPointer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"variantPointer\",\n        title=\"Pointer to observed variant information\",\n        description=\"A pointer to an Observation containing variant information.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SequenceVariant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"start\",\n            \"end\",\n            \"observedAllele\",\n            \"referenceAllele\",\n            \"cigar\",\n            \"variantPointer\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SequenceVariant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"start\",\n            \"end\",\n            \"observedAllele\",\n            \"referenceAllele\",\n            \"cigar\",\n            \"variantPointer\",\n        ]\n"
  },
  {
    "path": "fhir/resources/STU3/servicedefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ServiceDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass ServiceDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A description of decision support service functionality.\n    The ServiceDefinition describes a unit of decision support functionality\n    that is made available as a service, such as immunization modules or drug-\n    drug interaction checking.\n    \"\"\"\n\n    __resource_type__ = \"ServiceDefinition\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the service definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contributor: typing.List[fhirtypes.ContributorType] | None = Field(\n        default=None,\n        alias=\"contributor\",\n        title=\"A content contributor\",\n        description=(\n            \"A contributor to the content of the module, including authors, \"\n            \"editors, reviewers, and endorsers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the service definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the service definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"dataRequirement\",\n        title=\"What data is used by the module\",\n        description=(\n            \"Data requirements are a machine processable description of the data \"\n            \"required by the module in order to perform a successful evaluation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the service definition was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the service definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the service definition\",\n        description=(\n            \"A free text natural language description of the service definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the service definition is expected to be used\",\n        description=(\n            \"The period during which the service definition content was or is \"\n            \"planned to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this service definition is authored \"\n            \"for testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the service definition\",\n        description=(\n            \"A formal identifier that is used to identify this service definition \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance. This is used for CMS or \"\n            \"NQF identifiers for a measure artifact. Note that at least one \"\n            \"identifier is required for non-experimental active artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for service definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the service definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the service definition was last reviewed\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval, but doesn't change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this service definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the service definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    operationDefinition: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"operationDefinition\",\n        title=\"Operation to invoke\",\n        description=\"A reference to the operation that is used to invoke this service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationDefinition\"],\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the service \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this service definition is defined\",\n        description=(\n            \"Explaination of why this service definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related resources such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this service definition. Enables tracking the life-cycle\"\n            \" of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this service definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the service definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptive topics related to the module. Topics provide a high-level \"\n            \"categorization of the module that can be useful for filtering and \"\n            \"searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    trigger: typing.List[fhirtypes.TriggerDefinitionType] | None = Field(\n        default=None,\n        alias=\"trigger\",\n        title='\"when\" the module should be invoked',\n        description=(\n            \"The trigger element defines when the rule should be invoked. This \"\n            \"information is used by consumers of the rule to determine how to \"\n            \"integrate the rule into a specific workflow.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this service definition (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this service definition when \"\n            \"it is referenced in a specification, model, design or an instance. \"\n            \"This SHALL be a URL, SHOULD be globally unique, and SHOULD be an \"\n            \"address at which this service definition is (or will be) published. \"\n            \"The URL SHOULD include the major version of the service definition. \"\n            \"For more information see [Technical and Business \"\n            \"Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the module\",\n        description=(\n            \"A detailed description of how the module is used from a clinical \"\n            \"perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate service definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the service definition\",\n        description=(\n            \"The identifier that is used to identify this version of the service \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the service definition\"\n            \" author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ServiceDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"description\",\n            \"purpose\",\n            \"usage\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"topic\",\n            \"contributor\",\n            \"contact\",\n            \"copyright\",\n            \"relatedArtifact\",\n            \"trigger\",\n            \"dataRequirement\",\n            \"operationDefinition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ServiceDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"effectivePeriod\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"contact\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/signature.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Signature\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Signature(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A digital Signature - XML DigSig, JWT, Graphical image of signature, etc..\n    A digital signature along with supporting context. The signature may be\n    electronic/cryptographic in nature, or a graphical image representing a\n    hand-written signature, or a signature process. Different signature\n    approaches have different utilities.\n    \"\"\"\n\n    __resource_type__ = \"Signature\"\n\n    blob: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"blob\",\n        title=\"The actual signature content (XML DigSig. JWT, picture, etc.)\",\n        description=(\n            \"The base64 encoding of the Signature content. When signature is not \"\n            \"recorded electronically this element would be empty.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    blob__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_blob\", title=\"Extension field for ``blob``.\"\n    )\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"The technical format of the signature\",\n        description=(\n            \"A mime type that indicates the technical format of the signature. \"\n            \"Important mime types are application/signature+xml for X ML DigSig, \"\n            \"application/jwt for JWT, and image/* for a graphical image of a \"\n            \"signature, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    onBehalfOfReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOfReference\",\n        title=\"The party represented\",\n        description=(\n            \"A reference to an application-usable description of the identity that \"\n            \"is represented by the signature.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onBehalfOf[x]\n            \"one_of_many\": \"onBehalfOf\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Device\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    onBehalfOfUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"onBehalfOfUri\",\n        title=\"The party represented\",\n        description=(\n            \"A reference to an application-usable description of the identity that \"\n            \"is represented by the signature.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onBehalfOf[x]\n            \"one_of_many\": \"onBehalfOf\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onBehalfOfUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_onBehalfOfUri\",\n        title=\"Extension field for ``onBehalfOfUri``.\",\n    )\n\n    type: typing.List[fhirtypes.CodingType] = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Indication of the reason the entity signed the object(s)\",\n        description=(\n            \"An indication of the reason that the entity signed this document. This\"\n            \" may be explicitly included as part of the signature information and \"\n            \"can be used when determining accountability for various actions \"\n            \"concerning the document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    when: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"when\",\n        title=\"When the signature was created\",\n        description=\"When the digital signature was signed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    when__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_when\", title=\"Extension field for ``when``.\"\n    )\n\n    whoReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"whoReference\",\n        title=\"Who signed\",\n        description=(\n            \"A reference to an application-usable description of the identity that \"\n            \"signed  (e.g. the signature used their private key).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e who[x]\n            \"one_of_many\": \"who\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Device\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    whoUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"whoUri\",\n        title=\"Who signed\",\n        description=(\n            \"A reference to an application-usable description of the identity that \"\n            \"signed  (e.g. the signature used their private key).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e who[x]\n            \"one_of_many\": \"who\",\n            \"one_of_many_required\": True,\n        },\n    )\n    whoUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_whoUri\", title=\"Extension field for ``whoUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Signature`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"when\",\n            \"whoUri\",\n            \"whoReference\",\n            \"whoReference\",\n            \"whoReference\",\n            \"whoReference\",\n            \"whoReference\",\n            \"onBehalfOfUri\",\n            \"onBehalfOfReference\",\n            \"onBehalfOfReference\",\n            \"onBehalfOfReference\",\n            \"onBehalfOfReference\",\n            \"onBehalfOfReference\",\n            \"contentType\",\n            \"blob\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Signature`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"type\",\n            \"when\",\n            \"whoUri\",\n            \"whoReference\",\n            \"whoReference\",\n            \"whoReference\",\n            \"whoReference\",\n            \"whoReference\",\n            \"onBehalfOfUri\",\n            \"onBehalfOfReference\",\n            \"onBehalfOfReference\",\n            \"onBehalfOfReference\",\n            \"onBehalfOfReference\",\n            \"onBehalfOfReference\",\n            \"contentType\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"when\", \"when__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"onBehalfOf\": [\"onBehalfOfReference\", \"onBehalfOfUri\"],\n            \"who\": [\"whoReference\", \"whoUri\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/slot.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Slot\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Slot(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A slot of time on a schedule that may be available for booking appointments.\n    \"\"\"\n\n    __resource_type__ = \"Slot\"\n\n    appointmentType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"appointmentType\",\n        title=(\n            \"The style of appointment or patient that may be booked in the slot \"\n            \"(not service type)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=(\n            \"Comments on the slot to describe any extended information. Such as \"\n            \"custom constraints on the slot\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    end: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"Date/Time that the slot is to conclude\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    overbooked: bool | None = Field(\n        default=None,\n        alias=\"overbooked\",\n        title=(\n            \"This slot has already been overbooked, appointments are unlikely to be\"\n            \" accepted for this time\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    overbooked__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_overbooked\", title=\"Extension field for ``overbooked``.\"\n    )\n\n    schedule: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"schedule\",\n        title=(\n            \"The schedule resource that this slot defines an interval of status \"\n            \"information\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Schedule\"],\n        },\n    )\n\n    serviceCategory: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"serviceCategory\",\n        title=(\n            \"A broad categorisation of the service that is to be performed during \"\n            \"this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceType\",\n        title=(\n            \"The type of appointments that can be booked into this slot (ideally \"\n            \"this would be an identifiable service - which is at a location, rather\"\n            \" than the location itself). If provided then this overrides the value \"\n            \"provided on the availability resource\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=(\n            \"The specialty of a practitioner that would be required to perform the \"\n            \"service requested in this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    start: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Date/Time that the slot is to begin\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"busy | free | busy-unavailable | busy-tentative | entered-in-error\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"busy\",\n                \"free\",\n                \"busy-unavailable\",\n                \"busy-tentative\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Slot`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"appointmentType\",\n            \"schedule\",\n            \"status\",\n            \"start\",\n            \"end\",\n            \"overbooked\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Slot`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"appointmentType\",\n            \"schedule\",\n            \"status\",\n            \"start\",\n            \"end\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"end\", \"end__ext\"),\n            (\"start\", \"start__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/specimen.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Specimen\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Specimen(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Sample for analysis.\n    A sample to be used for analysis.\n    \"\"\"\n\n    __resource_type__ = \"Specimen\"\n\n    accessionIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"accessionIdentifier\",\n        title=\"Identifier assigned by the lab\",\n        description=(\n            \"The identifier assigned by the lab when accessioning specimen(s). This\"\n            \" is not necessarily the same as the specimen identifier, depending on \"\n            \"local lab procedures.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    collection: fhirtypes.SpecimenCollectionType | None = Field(\n        default=None,\n        alias=\"collection\",\n        title=\"Collection details\",\n        description=\"Details concerning the specimen collection.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    container: typing.List[fhirtypes.SpecimenContainerType] | None = Field(\n        default=None,\n        alias=\"container\",\n        title=\"Direct container of specimen (tube/slide, etc.)\",\n        description=(\n            \"The container holding the specimen.  The recursive nature of \"\n            \"containers; i.e. blood in tube in tray in rack is not addressed here.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Identifier\",\n        description=\"Id for specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments\",\n        description=(\n            \"To communicate any details or issues about the specimen or during the \"\n            \"specimen collection. (for example: broken vial, sent with patient, \"\n            \"frozen).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    parent: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Specimen from which this specimen originated\",\n        description=(\n            \"Reference to the parent (source) specimen which is used when the \"\n            \"specimen was either derived from or a component of another specimen.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    processing: typing.List[fhirtypes.SpecimenProcessingType] | None = Field(\n        default=None,\n        alias=\"processing\",\n        title=\"Processing and processing step details\",\n        description=\"Details concerning processing and processing steps for the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    receivedTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"receivedTime\",\n        title=\"The time when specimen was received for processing\",\n        description=\"Time when specimen was received for processing or testing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    receivedTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_receivedTime\",\n        title=\"Extension field for ``receivedTime``.\",\n    )\n\n    request: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Why the specimen was collected\",\n        description=(\n            \"Details concerning a test or procedure request that required a \"\n            \"specimen to be collected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ProcedureRequest\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"available | unavailable | unsatisfactory | entered-in-error\",\n        description=\"The availability of the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"available\",\n                \"unavailable\",\n                \"unsatisfactory\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=(\n            \"Where the specimen came from. This may be from the patient(s) or from \"\n            \"the environment or a device\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Device\", \"Substance\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of material that forms the specimen\",\n        description=\"The kind of material that forms the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Specimen`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"accessionIdentifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"receivedTime\",\n            \"parent\",\n            \"request\",\n            \"collection\",\n            \"processing\",\n            \"container\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Specimen`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"accessionIdentifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"receivedTime\",\n        ]\n\n\nclass SpecimenCollection(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Collection details.\n    Details concerning the specimen collection.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenCollection\"\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical collection site\",\n        description=(\n            \"Anatomical location from which the specimen was collected (if subject \"\n            \"is a patient). This is the target site.  This element is not used for \"\n            \"environmental specimens.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    collectedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"collectedDateTime\",\n        title=\"Collection time\",\n        description=(\n            \"Time when specimen was collected from subject - the physiologically \"\n            \"relevant time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e collected[x]\n            \"one_of_many\": \"collected\",\n            \"one_of_many_required\": False,\n        },\n    )\n    collectedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_collectedDateTime\",\n        title=\"Extension field for ``collectedDateTime``.\",\n    )\n\n    collectedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"collectedPeriod\",\n        title=\"Collection time\",\n        description=(\n            \"Time when specimen was collected from subject - the physiologically \"\n            \"relevant time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e collected[x]\n            \"one_of_many\": \"collected\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    collector: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"collector\",\n        title=\"Who collected the specimen\",\n        description=\"Person who collected the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Technique used to perform collection\",\n        description=(\n            \"A coded value specifying the technique that is used to perform the \"\n            \"procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"The quantity of specimen collected\",\n        description=(\n            \"The quantity of specimen collected; for instance the volume of a blood\"\n            \" sample, or the physical measurement of an anatomic pathology sample.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenCollection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"collector\",\n            \"collectedDateTime\",\n            \"collectedPeriod\",\n            \"quantity\",\n            \"method\",\n            \"bodySite\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenCollection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"collector\",\n            \"collectedDateTime\",\n            \"collectedPeriod\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"collected\": [\"collectedDateTime\", \"collectedPeriod\"]}\n        return one_of_many_fields\n\n\nclass SpecimenContainer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Direct container of specimen (tube/slide, etc.).\n    The container holding the specimen.  The recursive nature of containers;\n    i.e. blood in tube in tray in rack is not addressed here.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenContainer\"\n\n    additiveCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"additiveCodeableConcept\",\n        title=\"Additive associated with container\",\n        description=(\n            \"Introduced substance to preserve, maintain or enhance the specimen. \"\n            \"Examples: Formalin, Citrate, EDTA.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e additive[x]\n            \"one_of_many\": \"additive\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    additiveReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"additiveReference\",\n        title=\"Additive associated with container\",\n        description=(\n            \"Introduced substance to preserve, maintain or enhance the specimen. \"\n            \"Examples: Formalin, Citrate, EDTA.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e additive[x]\n            \"one_of_many\": \"additive\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    capacity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"capacity\",\n        title=\"Container volume or size\",\n        description=\"The capacity (volume or other measure) the container may contain.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of the container\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Id for the container\",\n        description=(\n            \"Id for container. There may be multiple; a manufacturer's bar code, \"\n            \"lab assigned identifier, etc. The container ID may differ from the \"\n            \"specimen id in some circumstances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specimenQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"specimenQuantity\",\n        title=\"Quantity of specimen within container\",\n        description=(\n            \"The quantity of specimen in the container; may be volume, dimensions, \"\n            \"or other appropriate measurements, depending on the specimen type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of container directly associated with specimen\",\n        description=(\n            \"The type of container associated with the specimen (e.g. slide, \"\n            \"aliquot, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenContainer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"description\",\n            \"type\",\n            \"capacity\",\n            \"specimenQuantity\",\n            \"additiveCodeableConcept\",\n            \"additiveReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenContainer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"additive\": [\"additiveCodeableConcept\", \"additiveReference\"]\n        }\n        return one_of_many_fields\n\n\nclass SpecimenProcessing(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing and processing step details.\n    Details concerning processing and processing steps for the specimen.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenProcessing\"\n\n    additive: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"additive\",\n        title=\"Material used in the processing step\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of procedure\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    procedure: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"Indicates the treatment step  applied to the specimen\",\n        description=\"A coded value specifying the procedure used to process the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timeDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timeDateTime\",\n        title=\"Date and time of specimen processing\",\n        description=(\n            \"A record of the time or period when the specimen processing occurred.\"\n            \"  For example the time of sample fixation or the period of time the \"\n            \"sample was in formalin.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e time[x]\n            \"one_of_many\": \"time\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timeDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timeDateTime\",\n        title=\"Extension field for ``timeDateTime``.\",\n    )\n\n    timePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timePeriod\",\n        title=\"Date and time of specimen processing\",\n        description=(\n            \"A record of the time or period when the specimen processing occurred.\"\n            \"  For example the time of sample fixation or the period of time the \"\n            \"sample was in formalin.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e time[x]\n            \"one_of_many\": \"time\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenProcessing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"procedure\",\n            \"additive\",\n            \"timeDateTime\",\n            \"timePeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenProcessing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"time\": [\"timeDateTime\", \"timePeriod\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/structuredefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/StructureDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass StructureDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Structural Definition.\n    A definition of a FHIR structure. This resource is used to describe the\n    underlying resources, data types defined in FHIR, and also for describing\n    extensions and constraints on resources and data types.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinition\"\n\n    abstract: bool | None = Field(\n        default=None,\n        alias=\"abstract\",\n        title=\"Whether the structure is abstract\",\n        description=(\n            \"Whether structure this definition describes is abstract or not  - that\"\n            \" is, whether the structure is not intended to be instantiated. For \"\n            \"Resources and Data types, abstract types will never be exchanged  \"\n            \"between systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    abstract__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_abstract\", title=\"Extension field for ``abstract``.\"\n    )\n\n    baseDefinition: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"baseDefinition\",\n        title=\"Definition that this type is constrained/specialized from\",\n        description=(\n            \"An absolute URI that is the base structure from which this type is \"\n            \"derived, either by specialization or constraint.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    baseDefinition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_baseDefinition\",\n        title=\"Extension field for ``baseDefinition``.\",\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Where the extension can be used in instances\",\n        description=(\n            \"Identifies the types of resource or data type elements to which the \"\n            \"extension can be applied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    context__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_context\", title=\"Extension field for ``context``.\"\n    )\n\n    contextInvariant: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"contextInvariant\",\n        title=\"FHIRPath invariants - when the extension can be used\",\n        description=(\n            \"A set of rules as Fluent Invariants about when the extension can be \"\n            \"used (e.g. co-occurrence variants for the extension).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    contextInvariant__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_contextInvariant\",\n        title=\"Extension field for ``contextInvariant``.\",\n    )\n\n    contextType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contextType\",\n        title=\"resource | datatype | extension\",\n        description=(\n            \"If this is an extension, Identifies the context within FHIR resources \"\n            \"where the extension can be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"resource\", \"datatype\", \"extension\"],\n        },\n    )\n    contextType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contextType\", title=\"Extension field for ``contextType``.\"\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the structure definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the structure definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the structure definition was \"\n            \"published. The date must change if and when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the structure \"\n            \"definition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivation: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"derivation\",\n        title=\"specialization | constraint - How relates to base definition\",\n        description=\"How the type relates to the baseDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"specialization\", \"constraint\"],\n        },\n    )\n    derivation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_derivation\", title=\"Extension field for ``derivation``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the structure definition\",\n        description=(\n            \"A free text natural language description of the structure definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    differential: fhirtypes.StructureDefinitionDifferentialType | None = Field(\n        default=None,\n        alias=\"differential\",\n        title=\"Differential view of the structure\",\n        description=(\n            \"A differential view is expressed relative to the base \"\n            \"StructureDefinition - a statement of differences that it applies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this structure definition is authored\"\n            \" for testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fhirVersion: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"fhirVersion\",\n        title=\"FHIR Version this StructureDefinition targets\",\n        description=(\n            \"The version of the FHIR specification on which this \"\n            \"StructureDefinition is based - this is the formal version of the \"\n            \"specification, without the revision number, e.g. \"\n            \"[publication].[major].[minor], which is 3.0.2 for this version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fhirVersion\", title=\"Extension field for ``fhirVersion``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the structure definition\",\n        description=(\n            \"A formal identifier that is used to identify this structure definition\"\n            \" when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for structure definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the structure definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    keyword: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"keyword\",\n        title=\"Assist with indexing and finding\",\n        description=(\n            \"A set of key words or terms from external terminologies that may be \"\n            \"used to assist with indexing and searching of templates.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"primitive-type | complex-type | resource | logical\",\n        description=\"Defines the kind of structure that this definition is describing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"primitive-type\", \"complex-type\", \"resource\", \"logical\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    mapping: typing.List[fhirtypes.StructureDefinitionMappingType] | None = Field(\n        default=None,\n        alias=\"mapping\",\n        title=\"External specification that the content is mapped to\",\n        description=\"An external specification that the content is mapped to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this structure definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the structure definition. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the \"\n            \"structure definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this structure definition is defined\",\n        description=(\n            \"Explaination of why this structure definition is needed and why it has\"\n            \" been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    snapshot: fhirtypes.StructureDefinitionSnapshotType | None = Field(\n        default=None,\n        alias=\"snapshot\",\n        title=\"Snapshot view of the structure\",\n        description=(\n            \"A snapshot view is expressed in a stand alone form that can be used \"\n            \"and interpreted without considering the base StructureDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this structure definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this structure definition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the structure \" \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type defined or constrained by this structure\",\n        description=(\n            \"The type this structure describes. If the derivation kind is \"\n            \"'specialization' then this is the master definition for a type, and \"\n            \"there is always one of these (a data type, an extension, a resource, \"\n            \"including abstract ones). Otherwise the structure definition is a \"\n            \"constraint on the stated type (and in this case, the type cannot be an\"\n            \" abstract type).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this structure definition (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this structure definition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD \"\n            \"be an address at which this structure definition is (or will be) \"\n            \"published. The URL SHOULD include the major version of the structure \"\n            \"definition. For more information see [Technical and Business \"\n            \"Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate structure definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the structure definition\",\n        description=(\n            \"The identifier that is used to identify this version of the structure \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the structure \"\n            \"definition author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"keyword\",\n            \"fhirVersion\",\n            \"mapping\",\n            \"kind\",\n            \"abstract\",\n            \"contextType\",\n            \"context\",\n            \"contextInvariant\",\n            \"type\",\n            \"baseDefinition\",\n            \"derivation\",\n            \"snapshot\",\n            \"differential\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"keyword\",\n            \"fhirVersion\",\n            \"kind\",\n            \"abstract\",\n            \"contextType\",\n            \"context\",\n            \"contextInvariant\",\n            \"type\",\n            \"baseDefinition\",\n            \"derivation\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"abstract\", \"abstract__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"type\", \"type__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n\nclass StructureDefinitionDifferential(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Differential view of the structure.\n    A differential view is expressed relative to the base StructureDefinition -\n    a statement of differences that it applies.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinitionDifferential\"\n\n    element: typing.List[fhirtypes.ElementDefinitionType] = Field(\n        default=...,\n        alias=\"element\",\n        title=\"Definition of elements in the resource (if no StructureDefinition)\",\n        description=\"Captures constraints on each element within the resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinitionDifferential`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"element\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinitionDifferential`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass StructureDefinitionMapping(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    External specification that the content is mapped to.\n    An external specification that the content is mapped to.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinitionMapping\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Versions, Issues, Scope limitations etc.\",\n        description=(\n            \"Comments about this mapping, including version notes, issues, scope \"\n            \"limitations, and other important notes for usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    identity: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"identity\",\n        title=\"Internal id when this mapping is used\",\n        description=(\n            \"An Internal id that is used to identify this mapping set when specific\"\n            \" mappings are made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_identity\", title=\"Extension field for ``identity``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Names what this mapping refers to\",\n        description=\"A name for the specification that is being mapped to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Identifies what this mapping refers to\",\n        description=(\n            \"An absolute URI that identifies the specification that this mapping is\"\n            \" expressed to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinitionMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identity\",\n            \"uri\",\n            \"name\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinitionMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"identity\", \"identity__ext\")]\n        return required_fields\n\n\nclass StructureDefinitionSnapshot(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Snapshot view of the structure.\n    A snapshot view is expressed in a stand alone form that can be used and\n    interpreted without considering the base StructureDefinition.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinitionSnapshot\"\n\n    element: typing.List[fhirtypes.ElementDefinitionType] = Field(\n        default=...,\n        alias=\"element\",\n        title=\"Definition of elements in the resource (if no StructureDefinition)\",\n        description=\"Captures constraints on each element within the resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinitionSnapshot`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"element\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinitionSnapshot`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/structuremap.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/StructureMap\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass StructureMap(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A Map of relationships between 2 structures that can be used to transform\n    data.\n    \"\"\"\n\n    __resource_type__ = \"StructureMap\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the structure map and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the structure map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the structure map was published. \"\n            \"The date must change if and when the business version changes and it \"\n            \"must change if the status code changes. In addition, it should change \"\n            \"when the substantive content of the structure map changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the structure map\",\n        description=(\n            \"A free text natural language description of the structure map from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this structure map is authored for \"\n            \"testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    group: typing.List[fhirtypes.StructureMapGroupType] = Field(\n        default=...,\n        alias=\"group\",\n        title=\"Named sections for reader convenience\",\n        description=(\n            \"Organizes the mapping into managable chunks for human review/ease of \"\n            \"maintenance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the structure map\",\n        description=(\n            \"A formal identifier that is used to identify this structure map when \"\n            \"it is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    import_fhir: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"import\",\n        title=\"Other maps used by this map (canonical URLs)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    import__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_import\", title=\"Extension field for ``import_fhir``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for structure map (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the structure map is intended to\"\n            \" be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this structure map (computer friendly)\",\n        description=(\n            \"A natural language name identifying the structure map. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the \"\n            \"structure map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this structure map is defined\",\n        description=(\n            \"Explaination of why this structure map is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this structure map. Enables tracking the life-cycle of \"\n            \"the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    structure: typing.List[fhirtypes.StructureMapStructureType] | None = Field(\n        default=None,\n        alias=\"structure\",\n        title=\"Structure Definition used by this map\",\n        description=(\n            \"A structure definition used by this map. The structure definition may \"\n            \"describe instances that are converted, or the instances that are \"\n            \"produced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this structure map (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the structure map.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this structure map (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this structure map when it is\"\n            \" referenced in a specification, model, design or an instance. This \"\n            \"SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at\"\n            \" which this structure map is (or will be) published. The URL SHOULD \"\n            \"include the major version of the structure map. For more information \"\n            \"see [Technical and Business Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate structure map instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the structure map\",\n        description=(\n            \"The identifier that is used to identify this version of the structure \"\n            \"map when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the structure map \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMap`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"structure\",\n            \"import\",\n            \"group\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMap`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"structure\",\n            \"import\",\n            \"group\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n\nclass StructureMapGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Named sections for reader convenience.\n    Organizes the mapping into managable chunks for human review/ease of\n    maintenance.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroup\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Additional description/explaination for group\",\n        description=(\n            \"Additional supporting documentation that explains the purpose of the \"\n            \"group and the types of mappings within it.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    extends: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"extends\",\n        title=\"Another group that this group adds rules to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    extends__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_extends\", title=\"Extension field for ``extends``.\"\n    )\n\n    input: typing.List[fhirtypes.StructureMapGroupInputType] = Field(\n        default=...,\n        alias=\"input\",\n        title=\"Named instance provided when invoking the map\",\n        description=(\n            \"A name assigned to an instance of data. The instance must be provided \"\n            \"when the mapping is invoked.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human-readable label\",\n        description=\"A unique name for the group for the convenience of human readers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    rule: typing.List[fhirtypes.StructureMapGroupRuleType] = Field(\n        default=...,\n        alias=\"rule\",\n        title=\"Transform Rule from source to target\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    typeMode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"typeMode\",\n        title=\"none | types | type-and-types\",\n        description=(\n            \"If this is the default rule set to apply for thie source type, or this\"\n            \" combination of types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"none\", \"types\", \"type-and-types\"],\n        },\n    )\n    typeMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_typeMode\", title=\"Extension field for ``typeMode``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"extends\",\n            \"typeMode\",\n            \"documentation\",\n            \"input\",\n            \"rule\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"name\",\n            \"extends\",\n            \"typeMode\",\n            \"documentation\",\n            \"input\",\n            \"rule\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"typeMode\", \"typeMode__ext\")]\n        return required_fields\n\n\nclass StructureMapGroupInput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Named instance provided when invoking the map.\n    A name assigned to an instance of data. The instance must be provided when\n    the mapping is invoked.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupInput\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Documentation for this instance of data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"source | target\",\n        description=\"Mode for this instance of data.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"source\", \"target\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this instance of data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type for this instance of data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"type\",\n            \"mode\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"type\", \"mode\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\"), (\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass StructureMapGroupRule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Transform Rule from source to target.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRule\"\n\n    dependent: typing.List[fhirtypes.StructureMapGroupRuleDependentType] | None = Field(\n        default=None,\n        alias=\"dependent\",\n        title=\"Which other rules to apply in the context of this rule\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Documentation for this instance of data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the rule for internal references\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    rule: typing.List[fhirtypes.StructureMapGroupRuleType] | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"Rules contained in this rule\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: typing.List[fhirtypes.StructureMapGroupRuleSourceType] = Field(\n        default=...,\n        alias=\"source\",\n        title=\"Source inputs to the mapping\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    target: typing.List[fhirtypes.StructureMapGroupRuleTargetType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Content to create because of this mapping rule\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"source\",\n            \"target\",\n            \"rule\",\n            \"dependent\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"source\", \"target\", \"rule\", \"dependent\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass StructureMapGroupRuleDependent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Which other rules to apply in the context of this rule.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRuleDependent\"\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of a rule or group to apply\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    variable: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"Variable to pass to the rule or group\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    variable__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_variable\", title=\"Extension field for ``variable``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRuleDependent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"variable\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleDependent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"variable\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"variable\", \"variable__ext\")]\n        return required_fields\n\n\nclass StructureMapGroupRuleSource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Source inputs to the mapping.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRuleSource\"\n\n    check: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"check\",\n        title=(\n            \"FHIRPath expression  - must be true or the mapping engine throws an \"\n            \"error instead of completing\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    check__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_check\", title=\"Extension field for ``check``.\"\n    )\n\n    condition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"FHIRPath expression  - must be true or the rule does not apply\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_condition\", title=\"Extension field for ``condition``.\"\n    )\n\n    context: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Type or variable this rule applies to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    context__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_context\", title=\"Extension field for ``context``.\"\n    )\n\n    defaultValueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"defaultValueAddress\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"defaultValueAge\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"defaultValueAnnotation\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"defaultValueAttachment\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"defaultValueBase64Binary\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueBase64Binary\",\n        title=\"Extension field for ``defaultValueBase64Binary``.\",\n    )\n\n    defaultValueBoolean: bool | None = Field(\n        default=None,\n        alias=\"defaultValueBoolean\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueBoolean\",\n        title=\"Extension field for ``defaultValueBoolean``.\",\n    )\n\n    defaultValueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"defaultValueCode\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueCode\",\n        title=\"Extension field for ``defaultValueCode``.\",\n    )\n\n    defaultValueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"defaultValueCodeableConcept\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"defaultValueCoding\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"defaultValueContactPoint\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"defaultValueCount\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"defaultValueDate\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDate\",\n        title=\"Extension field for ``defaultValueDate``.\",\n    )\n\n    defaultValueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"defaultValueDateTime\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDateTime\",\n        title=\"Extension field for ``defaultValueDateTime``.\",\n    )\n\n    defaultValueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"defaultValueDecimal\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDecimal\",\n        title=\"Extension field for ``defaultValueDecimal``.\",\n    )\n\n    defaultValueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"defaultValueDistance\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"defaultValueDuration\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"defaultValueHumanName\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"defaultValueId\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueId\",\n        title=\"Extension field for ``defaultValueId``.\",\n    )\n\n    defaultValueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"defaultValueIdentifier\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"defaultValueInstant\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueInstant\",\n        title=\"Extension field for ``defaultValueInstant``.\",\n    )\n\n    defaultValueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"defaultValueInteger\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueInteger\",\n        title=\"Extension field for ``defaultValueInteger``.\",\n    )\n\n    defaultValueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"defaultValueMarkdown\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueMarkdown\",\n        title=\"Extension field for ``defaultValueMarkdown``.\",\n    )\n\n    defaultValueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"defaultValueMeta\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"defaultValueMoney\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"defaultValueOid\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueOid\",\n        title=\"Extension field for ``defaultValueOid``.\",\n    )\n\n    defaultValuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"defaultValuePeriod\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"defaultValuePositiveInt\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValuePositiveInt\",\n        title=\"Extension field for ``defaultValuePositiveInt``.\",\n    )\n\n    defaultValueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"defaultValueQuantity\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"defaultValueRange\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"defaultValueRatio\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"defaultValueReference\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"defaultValueSampledData\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"defaultValueSignature\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"defaultValueString\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueString\",\n        title=\"Extension field for ``defaultValueString``.\",\n    )\n\n    defaultValueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"defaultValueTime\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueTime\",\n        title=\"Extension field for ``defaultValueTime``.\",\n    )\n\n    defaultValueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"defaultValueTiming\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"defaultValueUnsignedInt\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUnsignedInt\",\n        title=\"Extension field for ``defaultValueUnsignedInt``.\",\n    )\n\n    defaultValueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"defaultValueUri\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUri\",\n        title=\"Extension field for ``defaultValueUri``.\",\n    )\n\n    element: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"element\",\n        title=\"Optional field for this source\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    element__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_element\", title=\"Extension field for ``element``.\"\n    )\n\n    listMode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"listMode\",\n        title=\"first | not_first | last | not_last | only_one\",\n        description=\"How to handle the list mode for this element.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"first\", \"not_first\", \"last\", \"not_last\", \"only_one\"],\n        },\n    )\n    listMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_listMode\", title=\"Extension field for ``listMode``.\"\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Specified maximum cardinality (number or *)\",\n        description=(\n            'Specified maximum cardinality for the element - a number or a \"*\". '\n            \"This is optional; if present, it acts an implicit check on the input \"\n            \"content (* just serves as documentation; it's the default value).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Specified minimum cardinality\",\n        description=(\n            \"Specified minimum cardinality for the element. This is optional; if \"\n            \"present, it acts an implicit check on the input content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    type: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Rule only applies if source has this type\",\n        description=(\n            \"Specified type for the element. This works as a condition on the \"\n            \"mapping - use for polymorphic elements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    variable: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"Named context for field, if a field is specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    variable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_variable\", title=\"Extension field for ``variable``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRuleSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"context\",\n            \"min\",\n            \"max\",\n            \"type\",\n            \"defaultValueBase64Binary\",\n            \"defaultValueBoolean\",\n            \"defaultValueCode\",\n            \"defaultValueDate\",\n            \"defaultValueDateTime\",\n            \"defaultValueDecimal\",\n            \"defaultValueId\",\n            \"defaultValueInstant\",\n            \"defaultValueInteger\",\n            \"defaultValueMarkdown\",\n            \"defaultValueOid\",\n            \"defaultValuePositiveInt\",\n            \"defaultValueString\",\n            \"defaultValueTime\",\n            \"defaultValueUnsignedInt\",\n            \"defaultValueUri\",\n            \"defaultValueAddress\",\n            \"defaultValueAge\",\n            \"defaultValueAnnotation\",\n            \"defaultValueAttachment\",\n            \"defaultValueCodeableConcept\",\n            \"defaultValueCoding\",\n            \"defaultValueContactPoint\",\n            \"defaultValueCount\",\n            \"defaultValueDistance\",\n            \"defaultValueDuration\",\n            \"defaultValueHumanName\",\n            \"defaultValueIdentifier\",\n            \"defaultValueMoney\",\n            \"defaultValuePeriod\",\n            \"defaultValueQuantity\",\n            \"defaultValueRange\",\n            \"defaultValueRatio\",\n            \"defaultValueReference\",\n            \"defaultValueSampledData\",\n            \"defaultValueSignature\",\n            \"defaultValueTiming\",\n            \"defaultValueMeta\",\n            \"element\",\n            \"listMode\",\n            \"variable\",\n            \"condition\",\n            \"check\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"context\",\n            \"min\",\n            \"max\",\n            \"type\",\n            \"defaultValueBase64Binary\",\n            \"defaultValueBoolean\",\n            \"defaultValueCode\",\n            \"defaultValueDate\",\n            \"defaultValueDateTime\",\n            \"defaultValueDecimal\",\n            \"defaultValueId\",\n            \"defaultValueInstant\",\n            \"defaultValueInteger\",\n            \"defaultValueMarkdown\",\n            \"defaultValueOid\",\n            \"defaultValuePositiveInt\",\n            \"defaultValueString\",\n            \"defaultValueTime\",\n            \"defaultValueUnsignedInt\",\n            \"defaultValueUri\",\n            \"defaultValueAddress\",\n            \"defaultValueAge\",\n            \"defaultValueAnnotation\",\n            \"defaultValueAttachment\",\n            \"defaultValueCodeableConcept\",\n            \"defaultValueCoding\",\n            \"defaultValueContactPoint\",\n            \"defaultValueCount\",\n            \"defaultValueDistance\",\n            \"defaultValueDuration\",\n            \"defaultValueHumanName\",\n            \"defaultValueIdentifier\",\n            \"defaultValueMoney\",\n            \"defaultValuePeriod\",\n            \"defaultValueQuantity\",\n            \"defaultValueRange\",\n            \"defaultValueRatio\",\n            \"defaultValueReference\",\n            \"defaultValueSampledData\",\n            \"defaultValueSignature\",\n            \"defaultValueTiming\",\n            \"defaultValueMeta\",\n            \"element\",\n            \"listMode\",\n            \"variable\",\n            \"condition\",\n            \"check\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"context\", \"context__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"defaultValue\": [\n                \"defaultValueAddress\",\n                \"defaultValueAge\",\n                \"defaultValueAnnotation\",\n                \"defaultValueAttachment\",\n                \"defaultValueBase64Binary\",\n                \"defaultValueBoolean\",\n                \"defaultValueCode\",\n                \"defaultValueCodeableConcept\",\n                \"defaultValueCoding\",\n                \"defaultValueContactPoint\",\n                \"defaultValueCount\",\n                \"defaultValueDate\",\n                \"defaultValueDateTime\",\n                \"defaultValueDecimal\",\n                \"defaultValueDistance\",\n                \"defaultValueDuration\",\n                \"defaultValueHumanName\",\n                \"defaultValueId\",\n                \"defaultValueIdentifier\",\n                \"defaultValueInstant\",\n                \"defaultValueInteger\",\n                \"defaultValueMarkdown\",\n                \"defaultValueMeta\",\n                \"defaultValueMoney\",\n                \"defaultValueOid\",\n                \"defaultValuePeriod\",\n                \"defaultValuePositiveInt\",\n                \"defaultValueQuantity\",\n                \"defaultValueRange\",\n                \"defaultValueRatio\",\n                \"defaultValueReference\",\n                \"defaultValueSampledData\",\n                \"defaultValueSignature\",\n                \"defaultValueString\",\n                \"defaultValueTime\",\n                \"defaultValueTiming\",\n                \"defaultValueUnsignedInt\",\n                \"defaultValueUri\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass StructureMapGroupRuleTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Content to create because of this mapping rule.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRuleTarget\"\n\n    context: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Type or variable this rule applies to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    context__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_context\", title=\"Extension field for ``context``.\"\n    )\n\n    contextType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contextType\",\n        title=\"type | variable\",\n        description=\"How to interpret the context.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"type\", \"variable\"],\n        },\n    )\n    contextType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contextType\", title=\"Extension field for ``contextType``.\"\n    )\n\n    element: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"element\",\n        title=\"Field to create in the context\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    element__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_element\", title=\"Extension field for ``element``.\"\n    )\n\n    listMode: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"listMode\",\n        title=\"first | share | last | collate\",\n        description=\"If field is a list, how to manage the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"first\", \"share\", \"last\", \"collate\"],\n        },\n    )\n    listMode__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_listMode\", title=\"Extension field for ``listMode``.\"\n    )\n\n    listRuleId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"listRuleId\",\n        title=\"Internal rule reference for shared list items\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    listRuleId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_listRuleId\", title=\"Extension field for ``listRuleId``.\"\n    )\n\n    parameter: typing.List[\n        fhirtypes.StructureMapGroupRuleTargetParameterType\n    ] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Parameters to the transform\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    transform: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"transform\",\n        title=\"create | copy +\",\n        description=\"How the data is copied / created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"create\", \"copy\", \"+\"],\n        },\n    )\n    transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_transform\", title=\"Extension field for ``transform``.\"\n    )\n\n    variable: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"Named context for field, if desired, and a field is specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    variable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_variable\", title=\"Extension field for ``variable``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRuleTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"context\",\n            \"contextType\",\n            \"element\",\n            \"variable\",\n            \"listMode\",\n            \"listRuleId\",\n            \"transform\",\n            \"parameter\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"context\",\n            \"contextType\",\n            \"element\",\n            \"variable\",\n            \"listMode\",\n            \"listRuleId\",\n            \"transform\",\n            \"parameter\",\n        ]\n\n\nclass StructureMapGroupRuleTargetParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Parameters to the transform.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRuleTargetParameter\"\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRuleTargetParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueId\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueDecimal\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleTargetParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"valueId\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueDecimal\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueDecimal\",\n                \"valueId\",\n                \"valueInteger\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass StructureMapStructure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Structure Definition used by this map.\n    A structure definition used by this map. The structure definition may\n    describe instances that are converted, or the instances that are produced.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapStructure\"\n\n    alias: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=\"Name for type in this map\",\n        description=\"The name used for this type in the map.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    alias__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Documentation on use of structure\",\n        description=\"Documentation that describes how the structure is used in the mapping.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"source | queried | target | produced\",\n        description=\"How the referenced structure is used in this mapping.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"source\", \"queried\", \"target\", \"produced\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Canonical URL for structure definition\",\n        description=\"The canonical URL that identifies the structure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"mode\",\n            \"alias\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"url\", \"mode\", \"alias\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\"), (\"url\", \"url__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/subscription.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Subscription\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Subscription(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A server push subscription criteria.\n    The subscription resource is used to define a push based subscription from\n    a server to another system. Once a subscription is registered with the\n    server, the server checks every resource that is created or updated, and if\n    the resource matches the given criteria, it sends a message on the defined\n    \"channel\" so that another system is able to take an appropriate action.\n    \"\"\"\n\n    __resource_type__ = \"Subscription\"\n\n    channel: fhirtypes.SubscriptionChannelType = Field(\n        default=...,\n        alias=\"channel\",\n        title=\"The channel on which to report matches to the criteria\",\n        description=(\n            \"Details where to send notifications when resources are received that \"\n            \"meet the criteria.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for source (e.g. troubleshooting)\",\n        description=(\n            \"Contact details for a human to contact about the subscription. The \"\n            \"primary use of this for system administrator troubleshooting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    criteria: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"criteria\",\n        title=\"Rule for server push criteria\",\n        description=(\n            \"The rules that the server should use to determine when to generate \"\n            \"notifications for this subscription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    criteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_criteria\", title=\"Extension field for ``criteria``.\"\n    )\n\n    end: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"When to automatically delete the subscription\",\n        description=\"The time for the server to turn the subscription off.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    error: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"error\",\n        title=\"Latest error note\",\n        description=(\n            \"A record of the last error that occurred when the server processed a \"\n            \"notification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    error__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_error\", title=\"Extension field for ``error``.\"\n    )\n\n    reason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Description of why this subscription was created\",\n        description=\"A description of why this subscription is defined.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    reason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reason\", title=\"Extension field for ``reason``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"requested | active | error | off\",\n        description=(\n            \"The status of the subscription, which marks the server state for \"\n            \"managing the subscription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"requested\", \"active\", \"error\", \"off\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    tag: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"tag\",\n        title=\"A tag to add to matching resources\",\n        description=(\n            \"A tag to add to any resource that matches the criteria, after the \"\n            \"subscription is processed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Subscription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"status\",\n            \"contact\",\n            \"end\",\n            \"reason\",\n            \"criteria\",\n            \"error\",\n            \"channel\",\n            \"tag\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Subscription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"status\",\n            \"contact\",\n            \"end\",\n            \"reason\",\n            \"criteria\",\n            \"error\",\n            \"channel\",\n            \"tag\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"criteria\", \"criteria__ext\"),\n            (\"reason\", \"reason__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass SubscriptionChannel(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The channel on which to report matches to the criteria.\n    Details where to send notifications when resources are received that meet\n    the criteria.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionChannel\"\n\n    endpoint: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Where the channel points to\",\n        description=\"The uri that describes the actual end-point to send messages to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_endpoint\", title=\"Extension field for ``endpoint``.\"\n    )\n\n    header: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"header\",\n        title=\"Usage depends on the channel type\",\n        description=\"Additional headers / information to send as part of the notification.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    header__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_header\", title=\"Extension field for ``header``.\"\n    )\n\n    payload: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"payload\",\n        title=\"Mimetype to send, or omit for no payload\",\n        description=(\n            \"The mime type to send the payload in - either application/fhir+xml, or\"\n            \" application/fhir+json. If the payload is not present, then there is \"\n            \"no payload in the notification, just a notification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    payload__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_payload\", title=\"Extension field for ``payload``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"rest-hook | websocket | email | sms | message\",\n        description=\"The type of channel to send notifications on.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"rest-hook\", \"websocket\", \"email\", \"sms\", \"message\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionChannel`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"endpoint\",\n            \"payload\",\n            \"header\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionChannel`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"endpoint\", \"payload\", \"header\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/substance.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Substance\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Substance(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A homogeneous material with a definite composition.\n    \"\"\"\n\n    __resource_type__ = \"Substance\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"What class/type of substance this is\",\n        description=(\n            \"A code that classifies the general type of substance.  This is used  \"\n            \"for searching, sorting and display purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"What substance this is\",\n        description=\"A code (or set of codes) that identify this substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of the substance, comments\",\n        description=(\n            \"A description of the substance - its appearance, handling \"\n            \"requirements, and other usage notes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=\"Unique identifier for the substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.SubstanceIngredientType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=\"Composition information about the substance\",\n        description=\"A substance can be composed of other substances.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instance: typing.List[fhirtypes.SubstanceInstanceType] | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"If this describes a specific package/container of the substance\",\n        description=(\n            \"Substance may be used to describe a kind of substance, or a specific \"\n            \"package/container of the substance: an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=\"A code to indicate if the substance is actively used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Substance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"description\",\n            \"instance\",\n            \"ingredient\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Substance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"description\",\n            \"instance\",\n            \"ingredient\",\n        ]\n\n\nclass SubstanceIngredient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Composition information about the substance.\n    A substance can be composed of other substances.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceIngredient\"\n\n    quantity: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Optional amount (concentration)\",\n        description=\"The amount of the ingredient in the substance - a concentration ratio.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    substanceCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"substanceCodeableConcept\",\n        title=\"A component of the substance\",\n        description=\"Another substance that is a component of this substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e substance[x]\n            \"one_of_many\": \"substance\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    substanceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"substanceReference\",\n        title=\"A component of the substance\",\n        description=\"Another substance that is a component of this substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e substance[x]\n            \"one_of_many\": \"substance\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"quantity\",\n            \"substanceCodeableConcept\",\n            \"substanceReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"quantity\",\n            \"substanceCodeableConcept\",\n            \"substanceReference\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"substance\": [\"substanceCodeableConcept\", \"substanceReference\"]\n        }\n        return one_of_many_fields\n\n\nclass SubstanceInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If this describes a specific package/container of the substance.\n    Substance may be used to describe a kind of substance, or a specific\n    package/container of the substance: an instance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceInstance\"\n\n    expiry: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expiry\",\n        title=\"When no longer valid to use\",\n        description=(\n            \"When the substance is no longer valid to use. For some substances, a \"\n            \"single arbitrary date is used for expiry.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    expiry__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expiry\", title=\"Extension field for ``expiry``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier of the package/container\",\n        description=(\n            \"Identifier associated with the package/container (usually a label \"\n            \"affixed directly).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount of substance in the package\",\n        description=\"The amount of the substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"expiry\",\n            \"quantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"expiry\", \"quantity\"]\n"
  },
  {
    "path": "fhir/resources/STU3/supplydelivery.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SupplyDelivery\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SupplyDelivery(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Delivery of bulk Supplies.\n    Record of delivery of what is supplied.\n    \"\"\"\n\n    __resource_type__ = \"SupplyDelivery\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan, proposal or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SupplyRequest\"],\n        },\n    )\n\n    destination: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Where the Supply was sent\",\n        description=(\n            \"Identification of the facility/location where the Supply was shipped \"\n            \"to, as part of the dispense event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifier assigned by the dispensing facility when the item(s) is \"\n            \"dispensed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When event occurred\",\n        description=\"The date or time(s) the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When event occurred\",\n        description=\"The date or time(s) the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When event occurred\",\n        description=\"The date or time(s) the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=\"A larger event of which this particular event is a component or step.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SupplyDelivery\", \"Contract\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"Patient for whom the item is supplied\",\n        description=(\n            \"A link to a resource representing the person whom the delivered item \"\n            \"is for.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    receiver: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"receiver\",\n        title=\"Who collected the Supply\",\n        description=\"Identifies the person who picked up the Supply.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"in-progress | completed | abandoned | entered-in-error\",\n        description=\"A code specifying the state of the dispense event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"in-progress\",\n                \"completed\",\n                \"abandoned\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    suppliedItem: fhirtypes.SupplyDeliverySuppliedItemType | None = Field(\n        default=None,\n        alias=\"suppliedItem\",\n        title=\"The item that is delivered or supplied\",\n        description=\"The item that is being delivered or has been supplied.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supplier: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"supplier\",\n        title=\"Dispenser\",\n        description=(\n            \"The individual responsible for dispensing the medication, supplier or \"\n            \"device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Organization\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Category of dispense event\",\n        description=(\n            \"Indicates the type of dispensing event that is performed. Examples \"\n            \"include: Trial Fill, Completion of Trial, Partial Fill, Emergency \"\n            \"Fill, Samples, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyDelivery`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"patient\",\n            \"type\",\n            \"suppliedItem\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"supplier\",\n            \"destination\",\n            \"receiver\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyDelivery`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\", \"occurrenceTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass SupplyDeliverySuppliedItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The item that is delivered or supplied.\n    The item that is being delivered or has been supplied.\n    \"\"\"\n\n    __resource_type__ = \"SupplyDeliverySuppliedItem\"\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"Medication, Substance, or Device supplied\",\n        description=(\n            \"Identifies the medication, substance or device being dispensed. This \"\n            \"is either a link to a resource representing the details of the item or\"\n            \" a code that identifies the item from a known list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"Medication, Substance, or Device supplied\",\n        description=(\n            \"Identifies the medication, substance or device being dispensed. This \"\n            \"is either a link to a resource representing the details of the item or\"\n            \" a code that identifies the item from a known list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\", \"Substance\", \"Device\"],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount dispensed\",\n        description=(\n            \"The amount of supply that has been dispensed. Includes unit of \" \"measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyDeliverySuppliedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"quantity\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n            \"itemReference\",\n            \"itemReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyDeliverySuppliedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/supplyrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SupplyRequest\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SupplyRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Request for a medication, substance or device.\n    A record of a request for a medication, substance or device used in the\n    healthcare setting.\n    \"\"\"\n\n    __resource_type__ = \"SupplyRequest\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When the request was made\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"The kind of supply (central, non-stock, etc.)\",\n        description=(\n            \"Category of supply, e.g.  central, non-stock, etc. This is used to \"\n            \"support work flows associated with the supply process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    deliverFrom: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"deliverFrom\",\n        title=\"The origin of the supply\",\n        description=\"Where the supply is expected to come from.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"Location\"],\n        },\n    )\n\n    deliverTo: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"deliverTo\",\n        title=\"The destination of the supply\",\n        description=\"Where the supply is destined to go.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"Location\", \"Patient\"],\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=\"Unique identifier for this supply request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When the request should be fulfilled\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When the request should be fulfilled\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When the request should be fulfilled\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    orderedItem: fhirtypes.SupplyRequestOrderedItemType | None = Field(\n        default=None,\n        alias=\"orderedItem\",\n        title=\"The item being requested\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly this SupplyRequest should be addressed with \"\n            \"respect to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reasonCodeableConcept\",\n        title=\"Why the supply item was requested\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e reason[x]\n            \"one_of_many\": \"reason\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    reasonReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Why the supply item was requested\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e reason[x]\n            \"one_of_many\": \"reason\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    requester: fhirtypes.SupplyRequestRequesterType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/what is requesting service\",\n        description=(\n            \"The individual who initiated the request and has responsibility for \"\n            \"its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | suspended +\",\n        description=\"Status of the supply request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"suspended\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    supplier: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supplier\",\n        title=\"Who is intended to fulfill the request\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"priority\",\n            \"orderedItem\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"authoredOn\",\n            \"requester\",\n            \"supplier\",\n            \"reasonCodeableConcept\",\n            \"reasonReference\",\n            \"deliverFrom\",\n            \"deliverTo\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"priority\",\n            \"orderedItem\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"authoredOn\",\n            \"requester\",\n            \"supplier\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\n                \"occurrenceDateTime\",\n                \"occurrencePeriod\",\n                \"occurrenceTiming\",\n            ],\n            \"reason\": [\"reasonCodeableConcept\", \"reasonReference\"],\n        }\n        return one_of_many_fields\n\n\nclass SupplyRequestOrderedItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The item being requested.\n    \"\"\"\n\n    __resource_type__ = \"SupplyRequestOrderedItem\"\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"Medication, Substance, or Device requested to be supplied\",\n        description=(\n            \"The item that is requested to be supplied. This is either a link to a \"\n            \"resource representing the details of the item or a code that \"\n            \"identifies the item from a known list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"Medication, Substance, or Device requested to be supplied\",\n        description=(\n            \"The item that is requested to be supplied. This is either a link to a \"\n            \"resource representing the details of the item or a code that \"\n            \"identifies the item from a known list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\", \"Substance\", \"Device\"],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"quantity\",\n        title=\"The requested amount of the item indicated\",\n        description=\"The amount that is being ordered of the indicated item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyRequestOrderedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"quantity\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n            \"itemReference\",\n            \"itemReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyRequestOrderedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"quantity\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n            \"itemReference\",\n            \"itemReference\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n\n\nclass SupplyRequestRequester(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who/what is requesting service.\n    The individual who initiated the request and has responsibility for its\n    activation.\n    \"\"\"\n\n    __resource_type__ = \"SupplyRequestRequester\"\n\n    agent: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Individual making the request\",\n        description=\"The device, practitioner, etc. who initiated the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization agent is acting for\",\n        description=\"The organization the device or practitioner was acting on behalf of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyRequestRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"agent\", \"onBehalfOf\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyRequestRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"agent\"]\n"
  },
  {
    "path": "fhir/resources/STU3/task.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Task\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Task(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A task to be performed.\n    \"\"\"\n\n    __resource_type__ = \"Task\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"Task Creation Date\",\n        description=\"The date and time this task was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this task\",\n        description=(\n            \"BasedOn refers to a higher-level authorization that triggered the \"\n            'creation of the task.  It references a \"request\" resource such as a '\n            \"ProcedureRequest, MedicationRequest, ProcedureRequest, CarePlan, etc. \"\n            'which is distinct from the \"request\" resource the task is seeking to '\n            \"fulfil.  This latter resource is referenced by FocusOn.  For example, \"\n            \"based on a ProcedureRequest (= BasedOn), a task is created to fulfil a\"\n            \" procedureRequest ( = FocusOn ) to collect a specimen from a patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    businessStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"businessStatus\",\n        title='E.g. \"Specimen collected\", \"IV prepped\"',\n        description=\"Contains business-specific nuances of the business state.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Task Type\",\n        description=\"A name or code (or both) briefly describing what the task involves.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Healthcare event during which this task originated\",\n        description=(\n            \"The healthcare event  (e.g. a patient and healthcare provider \"\n            \"interaction) during which this task was created.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    definitionReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"definitionReference\",\n        title=\"Formal definition of task\",\n        description=(\n            \"A reference to a formal or informal definition of the task.  For \"\n            \"example, a protocol, a step within a defined workflow definition, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\"],\n        },\n    )\n\n    definitionUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"definitionUri\",\n        title=\"Formal definition of task\",\n        description=(\n            \"A reference to a formal or informal definition of the task.  For \"\n            \"example, a protocol, a step within a defined workflow definition, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": False,\n        },\n    )\n    definitionUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_definitionUri\",\n        title=\"Extension field for ``definitionUri``.\",\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-readable explanation of task\",\n        description=\"A free-text description of what is to be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    executionPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"executionPeriod\",\n        title=\"Start and end time of execution\",\n        description=(\n            \"Identifies the time action was first taken against the task (start) \"\n            \"and/or the time final action was taken against the task prior to \"\n            \"marking it as completed (end).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    focus: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"What task is acting on\",\n        description=(\n            \"The request being actioned or the resource being manipulated by this \"\n            \"task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    for_fhir: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"for\",\n        title=\"Beneficiary of the Task\",\n        description=(\n            \"The entity who benefits from the performance of the service specified \"\n            \"in the task (e.g., the patient).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Requisition or grouper id\",\n        description=(\n            \"An identifier that links together multiple tasks and other requests \"\n            \"that were created in the same context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Task Instance Identifier\",\n        description=\"The business identifier for this task.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    input: typing.List[fhirtypes.TaskInputType] | None = Field(\n        default=None,\n        alias=\"input\",\n        title=\"Information used to perform task\",\n        description=(\n            \"Additional information that may be needed in the execution of the \" \"task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=\"proposal | plan | order +\",\n        description=(\n            'Indicates the \"level\" of actionability associated with the Task.  I.e.'\n            \" Is this a proposed task, a planned task, an actionable task, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"proposal\", \"plan\", \"order\", \"+\"],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    lastModified: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"lastModified\",\n        title=\"Task Last Modified Date\",\n        description=\"The date and time of last modification to this task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastModified\",\n        title=\"Extension field for ``lastModified``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the task\",\n        description=\"Free-text information captured about the task as it progresses.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    output: typing.List[fhirtypes.TaskOutputType] | None = Field(\n        default=None,\n        alias=\"output\",\n        title=\"Information produced as part of task\",\n        description=\"Outputs produced by the Task.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    owner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"owner\",\n        title=\"Responsible individual\",\n        description=(\n            \"Individual organization or Device currently responsible for task \"\n            \"execution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Composite task\",\n        description=\"Task that this particular task is part of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Task\"],\n        },\n    )\n\n    performerType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=(\n            \"requester | dispatcher | scheduler | performer | monitor | manager | \"\n            \"acquirer | reviewer\"\n        ),\n        description=\"The type of participant that can execute the task.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"normal | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the Task should be addressed with respect to \"\n            \"other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"normal\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why task is needed\",\n        description=\"A description or code indicating why this task needs to be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Key events in history of the Task\",\n        description=(\n            \"Links to Provenance records for past versions of this Task that \"\n            \"identify key state transitions or updates that are likely to be \"\n            \"relevant to a user looking at the current version of the task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    requester: fhirtypes.TaskRequesterType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who is asking for task to be done\",\n        description=\"The creator of the task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    restriction: fhirtypes.TaskRestrictionType | None = Field(\n        default=None,\n        alias=\"restriction\",\n        title=\"Constraints on fulfillment tasks\",\n        description=(\n            \"If the Task.focus is a request resource and the task is seeking \"\n            \"fulfillment (i.e is asking for the request to be actioned), this \"\n            \"element identifies any limitations on what parts of the referenced \"\n            \"request should be actioned.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | requested | received | accepted | +\",\n        description=\"The current status of the task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"requested\", \"received\", \"accepted\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"An explanation as to why this task is held, failed, was refused, etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Task`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definitionUri\",\n            \"definitionReference\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"businessStatus\",\n            \"intent\",\n            \"priority\",\n            \"code\",\n            \"description\",\n            \"focus\",\n            \"for\",\n            \"context\",\n            \"executionPeriod\",\n            \"authoredOn\",\n            \"lastModified\",\n            \"requester\",\n            \"performerType\",\n            \"owner\",\n            \"reason\",\n            \"note\",\n            \"relevantHistory\",\n            \"restriction\",\n            \"input\",\n            \"output\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Task`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"definitionUri\",\n            \"definitionReference\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"businessStatus\",\n            \"intent\",\n            \"code\",\n            \"description\",\n            \"focus\",\n            \"for\",\n            \"context\",\n            \"executionPeriod\",\n            \"lastModified\",\n            \"requester\",\n            \"owner\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"definition\": [\"definitionReference\", \"definitionUri\"]}\n        return one_of_many_fields\n\n\nclass TaskInput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information used to perform task.\n    Additional information that may be needed in the execution of the task.\n    \"\"\"\n\n    __resource_type__ = \"TaskInput\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Label for the input\",\n        description=(\n            \"A code or description indicating how the input is intended to be used \"\n            \"as part of the task execution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TaskInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueMeta\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TaskInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCoding\",\n                \"valueContactPoint\",\n                \"valueCount\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDuration\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueReference\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass TaskOutput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information produced as part of task.\n    Outputs produced by the Task.\n    \"\"\"\n\n    __resource_type__ = \"TaskOutput\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Label for output\",\n        description=\"The name of the Output parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TaskOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueMeta\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TaskOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCoding\",\n                \"valueContactPoint\",\n                \"valueCount\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDuration\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueReference\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass TaskRequester(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who is asking for task to be done.\n    The creator of the task.\n    \"\"\"\n\n    __resource_type__ = \"TaskRequester\"\n\n    agent: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Individual asking for task\",\n        description=\"The device, practitioner, etc. who initiated the task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization individual is acting for\",\n        description=(\n            \"The organization the device or practitioner was acting on behalf of \"\n            \"when they initiated the task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TaskRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"agent\", \"onBehalfOf\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TaskRequester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"agent\"]\n\n\nclass TaskRestriction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Constraints on fulfillment tasks.\n    If the Task.focus is a request resource and the task is seeking fulfillment\n    (i.e is asking for the request to be actioned), this element identifies any\n    limitations on what parts of the referenced request should be actioned.\n    \"\"\"\n\n    __resource_type__ = \"TaskRestriction\"\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When fulfillment sought\",\n        description=\"Over what time-period is fulfillment sought.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"For whom is fulfillment sought?\",\n        description=(\n            \"For requests that are targeted to more than on potential \"\n            \"recipient/target, for whom is fulfillment sought?\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Group\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    repetitions: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"repetitions\",\n        title=\"How many times to repeat\",\n        description=\"Indicates the number of times the requested action should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    repetitions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_repetitions\", title=\"Extension field for ``repetitions``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TaskRestriction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"repetitions\",\n            \"period\",\n            \"recipient\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TaskRestriction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/testreport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TestReport\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass TestReport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes the results of a TestScript execution.\n    A summary of information based on the results of executing a TestScript.\n    \"\"\"\n\n    __resource_type__ = \"TestReport\"\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifier for the TestScript assigned for external purposes outside \"\n            \"the context of FHIR.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"When the TestScript was executed and this TestReport was generated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Informal name of the executed TestScript\",\n        description=\"A free text natural language name identifying the executed TestScript.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    participant: typing.List[fhirtypes.TestReportParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=(\n            \"A participant in the test execution, either the execution engine, a \"\n            \"client, or a server\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    result: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"pass | fail | pending\",\n        description=\"The overall result from the execution of the TestScript.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"pass\", \"fail\", \"pending\"],\n        },\n    )\n    result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_result\", title=\"Extension field for ``result``.\"\n    )\n\n    score: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"score\",\n        title=(\n            \"The final score (percentage of tests passed) resulting from the \"\n            \"execution of the TestScript\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    score__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_score\", title=\"Extension field for ``score``.\"\n    )\n\n    setup: fhirtypes.TestReportSetupType | None = Field(\n        default=None,\n        alias=\"setup\",\n        title=(\n            \"The results of the series of required setup operations before the \"\n            \"tests were executed\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"completed | in-progress | waiting | stopped | entered-in-error\",\n        description=\"The current state of this test report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"completed\",\n                \"in-progress\",\n                \"waiting\",\n                \"stopped\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    teardown: fhirtypes.TestReportTeardownType | None = Field(\n        default=None,\n        alias=\"teardown\",\n        title=\"The results of running the series of required clean up steps\",\n        description=(\n            \"The results of the series of operations required to clean up after the\"\n            \" all the tests were executed (successfully or otherwise).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    test: typing.List[fhirtypes.TestReportTestType] | None = Field(\n        default=None,\n        alias=\"test\",\n        title=\"A test executed from the test script\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    testScript: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"testScript\",\n        title=(\n            \"Reference to the  version-specific TestScript that was executed to \"\n            \"produce this TestReport\"\n        ),\n        description=(\n            \"Ideally this is an absolute URL that is used to identify the version-\"\n            \"specific TestScript that was executed, matching the `TestScript.url`.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"TestScript\"],\n        },\n    )\n\n    tester: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"tester\",\n        title=\"Name of the tester producing this report (Organization or individual)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    tester__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_tester\", title=\"Extension field for ``tester``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"status\",\n            \"testScript\",\n            \"result\",\n            \"score\",\n            \"tester\",\n            \"issued\",\n            \"participant\",\n            \"setup\",\n            \"test\",\n            \"teardown\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"name\",\n            \"status\",\n            \"testScript\",\n            \"result\",\n            \"score\",\n            \"tester\",\n            \"issued\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"result\", \"result__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass TestReportParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A participant in the test execution, either the execution engine, a client,\n    or a server.\n    \"\"\"\n\n    __resource_type__ = \"TestReportParticipant\"\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"The display name of the participant\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"test-engine | client | server\",\n        description=\"The type of participant.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"test-engine\", \"client\", \"server\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"The uri of the participant. An absolute URL is preferred\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"uri\", \"display\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\"), (\"uri\", \"uri__ext\")]\n        return required_fields\n\n\nclass TestReportSetup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The results of the series of required setup operations before the tests\n    were executed.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetup\"\n\n    action: typing.List[fhirtypes.TestReportSetupActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"A setup operation or assert that was executed\",\n        description=\"Action would contain either an operation or an assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportSetupAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A setup operation or assert that was executed.\n    Action would contain either an operation or an assertion.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetupAction\"\n\n    assert_fhir: fhirtypes.TestReportSetupActionAssertType | None = Field(\n        default=None,\n        alias=\"assert\",\n        title=\"The assertion to perform\",\n        description=\"The results of the assertion performed on the previous operations.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.TestReportSetupActionOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"The operation to perform\",\n        description=\"The operation performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\", \"assert\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportSetupActionAssert(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The assertion to perform.\n    The results of the assertion performed on the previous operations.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetupActionAssert\"\n\n    detail: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"A link to further details on the result\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_detail\", title=\"Extension field for ``detail``.\"\n    )\n\n    message: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"message\",\n        title=\"A message associated with the result\",\n        description=\"An explanatory message associated with the result.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_message\", title=\"Extension field for ``message``.\"\n    )\n\n    result: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"pass | skip | fail | warning | error\",\n        description=\"The result of this assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"pass\", \"skip\", \"fail\", \"warning\", \"error\"],\n        },\n    )\n    result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_result\", title=\"Extension field for ``result``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetupActionAssert`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"result\", \"message\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetupActionAssert`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"result\", \"result__ext\")]\n        return required_fields\n\n\nclass TestReportSetupActionOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The operation to perform.\n    The operation performed.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetupActionOperation\"\n\n    detail: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"A link to further details on the result\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_detail\", title=\"Extension field for ``detail``.\"\n    )\n\n    message: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"message\",\n        title=\"A message associated with the result\",\n        description=\"An explanatory message associated with the result.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_message\", title=\"Extension field for ``message``.\"\n    )\n\n    result: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"pass | skip | fail | warning | error\",\n        description=\"The result of this operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"pass\", \"skip\", \"fail\", \"warning\", \"error\"],\n        },\n    )\n    result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_result\", title=\"Extension field for ``result``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetupActionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"result\", \"message\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetupActionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"result\", \"result__ext\")]\n        return required_fields\n\n\nclass TestReportTeardown(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The results of running the series of required clean up steps.\n    The results of the series of operations required to clean up after the all\n    the tests were executed (successfully or otherwise).\n    \"\"\"\n\n    __resource_type__ = \"TestReportTeardown\"\n\n    action: typing.List[fhirtypes.TestReportTeardownActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"One or more teardown operations performed\",\n        description=\"The teardown action will only contain an operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportTeardown`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportTeardown`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportTeardownAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    One or more teardown operations performed.\n    The teardown action will only contain an operation.\n    \"\"\"\n\n    __resource_type__ = \"TestReportTeardownAction\"\n\n    operation: fhirtypes.TestReportSetupActionOperationType = Field(\n        default=...,\n        alias=\"operation\",\n        title=\"The teardown operation performed\",\n        description=\"An operation would involve a REST request to a server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportTeardownAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportTeardownAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportTest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A test executed from the test script.\n    \"\"\"\n\n    __resource_type__ = \"TestReportTest\"\n\n    action: typing.List[fhirtypes.TestReportTestActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"A test operation or assert that was performed\",\n        description=\"Action would contain either an operation or an assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Tracking/reporting short description of the test\",\n        description=(\n            \"A short description of the test used by test engines for tracking and \"\n            \"reporting purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Tracking/logging name of this test\",\n        description=(\n            \"The name of this test used for tracking/logging purposes by test \"\n            \"engines.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportTest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"description\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportTest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportTestAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A test operation or assert that was performed.\n    Action would contain either an operation or an assertion.\n    \"\"\"\n\n    __resource_type__ = \"TestReportTestAction\"\n\n    assert_fhir: fhirtypes.TestReportSetupActionAssertType | None = Field(\n        default=None,\n        alias=\"assert\",\n        title=\"The assertion performed\",\n        description=\"The results of the assertion performed on the previous operations.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.TestReportSetupActionOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"The operation performed\",\n        description=\"An operation would involve a REST request to a server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportTestAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\", \"assert\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportTestAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/STU3/tests/__init__.py",
    "content": "__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n__fhir_version__ = \"3.0.2\"\n"
  },
  {
    "path": "fhir/resources/STU3/tests/conftest.py",
    "content": "import hashlib\nimport io\nimport os\nimport pathlib\nimport shutil\nimport sys\nimport tempfile\nimport zipfile\nfrom os.path import dirname\n\nimport pytest\nfrom fhir_core.types import (\n    Base64BinaryType,\n    DateTimeType,\n    DateType,\n    InstantType,\n    TimeType,\n    UriType,\n    UrlType,\n)\nfrom pydantic import BaseModel, Field\n\nEXAMPLE_RESOURCES_URL = (\n    \"https://github.com/nazrulworld/hl7-archives/raw/\"\n    \"0.4.0/FHIR/STU3/\"\n    \"3.0.2-examples-json.zip\"\n)\nROOT_PATH = dirname(dirname(dirname(dirname(os.path.abspath(__file__)))))\nCACHE_PATH = os.path.join(ROOT_PATH, \".cache\")\n\n\ndef download_and_store(url, path):\n    \"\"\" \"\"\"\n    import requests\n\n    try:\n        sys.stdout.write(\"Attempting to download from {0}\\n\".format(url))\n        ret = requests.get(url)\n    except requests.HTTPError as exc:\n        raise LookupError(\"Failed to download. Full error: {0!s}\".format(exc))\n    else:\n        if not ret.ok:\n            raise Exception(\"Failed to download {0}\".format(url))\n        with io.open(path, \"wb\") as handle:\n            for chunk in ret.iter_content():\n                handle.write(chunk)\n            sys.stdout.write(\n                \"Download has been completed, now saved to {0}\\n\".format(path)\n            )\n\n\ndef expand(self, local):\n    \"\"\"Expand the ZIP file at the given path to the cache directory.\"\"\"\n    path = os.path.join(self.cache, local)\n    assert os.path.exists(path)\n    import zipfile  # import here as we can bypass its use with a manual unzip\n\n    with zipfile.ZipFile(path) as z:\n        z.extractall(self.cache)\n\n\n@pytest.fixture(scope=\"session\")\ndef base_settings():\n    if not os.path.exists(CACHE_PATH):\n        os.makedirs(CACHE_PATH)\n\n    settings = {}\n\n    example_data_file_uri = EXAMPLE_RESOURCES_URL\n\n    example_data_file_id = hashlib.md5(example_data_file_uri.encode()).hexdigest()\n\n    example_data_file_location = os.path.join(\n        CACHE_PATH, (example_data_file_id + \".zip\")\n    )\n\n    if not os.path.exists(example_data_file_location):\n        download_and_store(example_data_file_uri, example_data_file_location)\n\n    temp_data_dir = tempfile.mkdtemp()\n    # extract all files from archive and put into temp dir\n    with zipfile.ZipFile(example_data_file_location) as z:\n        z.extractall(temp_data_dir)\n\n    zip_dir_name = pathlib.Path(EXAMPLE_RESOURCES_URL).name[:-4]\n    if \"FHIR_UNITTEST_DATADIR\" not in os.environ:\n        os.environ.setdefault(\n            \"FHIR_UNITTEST_DATADIR\", os.path.join(temp_data_dir, zip_dir_name)\n        )\n\n    settings[\"unittest_data_dir\"] = pathlib.Path(os.environ[\"FHIR_UNITTEST_DATADIR\"])\n\n    yield settings\n\n    os.environ.pop(\"FHIR_UNITTEST_DATADIR\")\n    shutil.rmtree(temp_data_dir)\n\n\nclass ExternalValidatorModel(BaseModel):\n    \"\"\"This model is used to validate datetime objects against in the tests\"\"\"\n\n    valueDate: DateType = Field(None, title=\"Date\")\n    valueTime: TimeType = Field(None, title=\"Time\")\n    valueDateTime: DateTimeType = Field(None, title=\"DateTime\")\n    valueInstant: InstantType = Field(None, title=\"Instant\")\n    valueUri: UriType = Field(None, title=\"Uri\")\n    valueUrl: UrlType = Field(None, title=\"Url\")\n    valueBase64Binary: Base64BinaryType = Field(None, title=\"Base64Binary\")\n"
  },
  {
    "path": "fhir/resources/STU3/tests/test_bundle.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Bundle\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\nfrom .. import bundle\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_bundle_1(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-sct\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"tx-sct\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-rxnorm\"}\n        ).valueUri\n    )\n    assert inst.entry[1].resource.id == \"tx-rxnorm\"\n    assert (\n        inst.entry[2].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-loinc\"}\n        ).valueUri\n    )\n    assert inst.entry[2].resource.id == \"tx-loinc\"\n    assert (\n        inst.entry[3].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-ucum\"}\n        ).valueUri\n    )\n    assert inst.entry[3].resource.id == \"tx-ucum\"\n    assert (\n        inst.entry[4].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-nci\"}\n        ).valueUri\n    )\n    assert inst.entry[4].resource.id == \"tx-nci\"\n    assert (\n        inst.entry[5].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-cpt\"}\n        ).valueUri\n    )\n    assert inst.entry[5].resource.id == \"tx-cpt\"\n    assert (\n        inst.entry[6].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-ndf-rt\"}\n        ).valueUri\n    )\n    assert inst.entry[6].resource.id == \"tx-ndf-rt\"\n    assert (\n        inst.entry[7].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-unii\"}\n        ).valueUri\n    )\n    assert inst.entry[7].resource.id == \"tx-unii\"\n    assert (\n        inst.entry[8].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-ndc\"}\n        ).valueUri\n    )\n    assert inst.entry[8].resource.id == \"tx-ndc\"\n    assert (\n        inst.entry[9].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/tx-cvx\"}\n        ).valueUri\n    )\n    assert inst.entry[9].resource.id == \"tx-cvx\"\n    assert inst.id == \"terminologies\"\n    assert inst.type == \"collection\"\n\n\ndef test_bundle_1(base_settings):\n    \"\"\"No. 1 tests collection for Bundle.\n    Test File: bundle-namingsystem-terminologies(terminologies).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"bundle-namingsystem-terminologies(terminologies).json\"\n    )\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_1(inst2)\n"
  },
  {
    "path": "fhir/resources/STU3/tests/test_capabilitystatement.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\nfrom .. import capabilitystatement\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_capabilitystatement_1(inst):\n    assert inst.acceptUnknown == \"no\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"3.0.2\"\n    assert inst.format[0] == \"xml\"\n    assert inst.format[1] == \"json\"\n    assert inst.id == \"base2\"\n    assert inst.kind == \"capability\"\n    assert inst.name == \"Base FHIR Capability Statement (Empty)\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.rest[0].documentation == \"An empty Capability Statement\"\n    assert inst.rest[0].mode == \"server\"\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert (\n        inst.rest[0].resource[0].interaction[0].documentation\n        == \"Read CapabilityStatement Resource\"\n    )\n    assert inst.rest[0].resource[0].type == \"CapabilityStatement\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.description == (\n        \"This is the Capability Statement to declare that the server \"\n        \"supports SMART-on-FHIR. See the SMART-on-FHIR docs for the \"\n        \"extension that would go with such a server\"\n    )\n    assert inst.rest[0].security.service[0].coding[0].code == \"SMART-on-FHIR\"\n    assert inst.rest[0].security.service[0].coding[0].display == \"SMART-on-FHIR\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-security-service\"}\n        ).valueUri\n    )\n    assert inst.rest[0].security.service[0].text == \"See http://docs.smarthealthit.org/\"\n    assert inst.software.name == \"Insert your softwware name here...\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CapabilityStatement/base2\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2-11200\"\n\n\ndef test_capabilitystatement_1(base_settings):\n    \"\"\"No. 1 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-capabilitystatement-base2(base2).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"capabilitystatement-capabilitystatement-base2(base2).json\"\n    )\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_1(inst2)\n\n\ndef impl_capabilitystatement_2(inst):\n    assert inst.acceptUnknown == \"both\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"3.0.2\"\n    assert inst.format[0] == \"xml\"\n    assert inst.format[1] == \"json\"\n    assert inst.id == \"base\"\n    assert inst.kind == \"capability\"\n    assert inst.name == \"Base FHIR Capability Statement (Full)\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.rest[0].documentation == \"All the functionality defined in FHIR\"\n    assert inst.rest[0].interaction[0].code == \"transaction\"\n    assert inst.rest[0].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].interaction[1].code == \"batch\"\n    assert inst.rest[0].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].interaction[2].code == \"history-system\"\n    assert inst.rest[0].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].interaction[3].code == \"search-system\"\n    assert inst.rest[0].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].mode == \"server\"\n    assert (\n        inst.rest[0].operation[0].definition.reference\n        == \"http://hl7.org/fhir/OperationDefinition/resource-validate\"\n    )\n    assert inst.rest[0].operation[0].name == \"validate\"\n    assert (\n        inst.rest[0].operation[1].definition.reference\n        == \"http://hl7.org/fhir/OperationDefinition/resource-meta\"\n    )\n    assert inst.rest[0].operation[1].name == \"meta\"\n    assert (\n        inst.rest[0].operation[2].definition.reference\n        == \"http://hl7.org/fhir/OperationDefinition/resource-meta-add\"\n    )\n    assert inst.rest[0].operation[2].name == \"meta-add\"\n    assert (\n        inst.rest[0].operation[3].definition.reference\n        == \"http://hl7.org/fhir/OperationDefinition/resource-meta-delete\"\n    )\n    assert inst.rest[0].operation[3].name == \"meta-delete\"\n    assert inst.rest[0].operation[4].definition.reference == (\n        \"http://hl7.org/fhir/OperationDefinition/activitydefinition-\" \"apply\"\n    )\n    assert inst.rest[0].operation[4].name == \"apply\"\n    assert inst.rest[0].operation[5].definition.reference == (\n        \"http://hl7.org/fhir/OperationDefinition/activitydefinition-\"\n        \"data-requirements\"\n    )\n    assert inst.rest[0].operation[5].name == \"data-requirements\"\n    assert inst.rest[0].operation[6].definition.reference == (\n        \"http://hl7.org/fhir/OperationDefinition/capabilitystatement-\" \"subset\"\n    )\n    assert inst.rest[0].operation[6].name == \"subset\"\n    assert inst.rest[0].operation[7].definition.reference == (\n        \"http://hl7.org/fhir/OperationDefinition/capabilitystatement-\" \"implements\"\n    )\n    assert inst.rest[0].operation[7].name == \"implements\"\n    assert inst.rest[0].operation[8].definition.reference == (\n        \"http://hl7.org/fhir/OperationDefinition/capabilitystatement-\" \"conforms\"\n    )\n    assert inst.rest[0].operation[8].name == \"conforms\"\n    assert (\n        inst.rest[0].operation[9].definition.reference\n        == \"http://hl7.org/fhir/OperationDefinition/codesystem-lookup\"\n    )\n    assert inst.rest[0].operation[9].name == \"lookup\"\n    assert inst.rest[0].resource[0].conditionalCreate is True\n    assert inst.rest[0].resource[0].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[0].conditionalUpdate is True\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[0].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[0].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[0].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[0].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[0].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[0].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[0].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[0].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[0].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/Account\"\n    )\n    assert inst.rest[0].resource[0].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[0].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[0].searchInclude[0] == \"Account.owner\"\n    assert inst.rest[0].resource[0].searchInclude[1] == \"Account.subject\"\n    assert inst.rest[0].resource[0].searchInclude[2] == \"Account.patient\"\n    assert (\n        inst.rest[0].resource[0].searchParam[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Account-owner\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[0].documentation == \"Who is responsible?\"\n    )\n    assert inst.rest[0].resource[0].searchParam[0].name == \"owner\"\n    assert inst.rest[0].resource[0].searchParam[0].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Account-identifier\"}\n        ).valueUri\n    )\n    assert inst.rest[0].resource[0].searchParam[1].documentation == \"Account number\"\n    assert inst.rest[0].resource[0].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[0].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Account-period\"}\n        ).valueUri\n    )\n    assert inst.rest[0].resource[0].searchParam[2].documentation == \"Transaction window\"\n    assert inst.rest[0].resource[0].searchParam[2].name == \"period\"\n    assert inst.rest[0].resource[0].searchParam[2].type == \"date\"\n    assert (\n        inst.rest[0].resource[0].searchParam[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Account-balance\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[3].documentation\n        == \"How much is in account?\"\n    )\n    assert inst.rest[0].resource[0].searchParam[3].name == \"balance\"\n    assert inst.rest[0].resource[0].searchParam[3].type == \"quantity\"\n    assert (\n        inst.rest[0].resource[0].searchParam[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Account-subject\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[4].documentation\n        == \"What is account tied to?\"\n    )\n    assert inst.rest[0].resource[0].searchParam[4].name == \"subject\"\n    assert inst.rest[0].resource[0].searchParam[4].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Account-patient\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[5].documentation\n        == \"What is account tied to?\"\n    )\n    assert inst.rest[0].resource[0].searchParam[5].name == \"patient\"\n    assert inst.rest[0].resource[0].searchParam[5].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[6].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Account-name\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[6].documentation == \"Human-readable label\"\n    )\n    assert inst.rest[0].resource[0].searchParam[6].name == \"name\"\n    assert inst.rest[0].resource[0].searchParam[6].type == \"string\"\n    assert (\n        inst.rest[0].resource[0].searchParam[7].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Account-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[7].documentation\n        == \"E.g. patient, expense, depreciation\"\n    )\n    assert inst.rest[0].resource[0].searchParam[7].name == \"type\"\n    assert inst.rest[0].resource[0].searchParam[7].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[8].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Account-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[8].documentation\n        == \"active | inactive | entered-in-error\"\n    )\n    assert inst.rest[0].resource[0].searchParam[8].name == \"status\"\n    assert inst.rest[0].resource[0].searchParam[8].type == \"token\"\n    assert inst.rest[0].resource[0].searchRevInclude[0] == \"ChargeItem.account\"\n    assert inst.rest[0].resource[0].type == \"Account\"\n    assert inst.rest[0].resource[1].conditionalCreate is True\n    assert inst.rest[0].resource[1].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[1].conditionalUpdate is True\n    assert inst.rest[0].resource[1].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[1].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[1].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[1].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[1].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[1].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[1].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[1].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[1].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[1].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/ActivityDefinition\"\n    )\n    assert inst.rest[0].resource[1].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[1].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[1].searchInclude[0] == \"ActivityDefinition.successor\"\n    assert (\n        inst.rest[0].resource[1].searchInclude[1] == \"ActivityDefinition.derived-from\"\n    )\n    assert inst.rest[0].resource[1].searchInclude[2] == \"ActivityDefinition.predecessor\"\n    assert inst.rest[0].resource[1].searchInclude[3] == \"ActivityDefinition.composed-of\"\n    assert inst.rest[0].resource[1].searchInclude[4] == \"ActivityDefinition.depends-on\"\n    assert (\n        inst.rest[0].resource[1].searchParam[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-date\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[0].documentation\n        == \"The activity definition publication date\"\n    )\n    assert inst.rest[0].resource[1].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[1].searchParam[0].type == \"date\"\n    assert (\n        inst.rest[0].resource[1].searchParam[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-identifier\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[1].documentation\n        == \"External identifier for the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[1].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[1].searchParam[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-successor\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[2].documentation\n        == \"What resource is being referenced\"\n    )\n    assert inst.rest[0].resource[1].searchParam[2].name == \"successor\"\n    assert inst.rest[0].resource[1].searchParam[2].type == \"reference\"\n    assert (\n        inst.rest[0].resource[1].searchParam[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-jurisdiction\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[3].documentation\n        == \"Intended jurisdiction for the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[3].name == \"jurisdiction\"\n    assert inst.rest[0].resource[1].searchParam[3].type == \"token\"\n    assert (\n        inst.rest[0].resource[1].searchParam[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-description\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[4].documentation\n        == \"The description of the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[4].name == \"description\"\n    assert inst.rest[0].resource[1].searchParam[4].type == \"string\"\n    assert (\n        inst.rest[0].resource[1].searchParam[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-derived-from\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[5].documentation\n        == \"What resource is being referenced\"\n    )\n    assert inst.rest[0].resource[1].searchParam[5].name == \"derived-from\"\n    assert inst.rest[0].resource[1].searchParam[5].type == \"reference\"\n    assert (\n        inst.rest[0].resource[1].searchParam[6].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-predecessor\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[6].documentation\n        == \"What resource is being referenced\"\n    )\n    assert inst.rest[0].resource[1].searchParam[6].name == \"predecessor\"\n    assert inst.rest[0].resource[1].searchParam[6].type == \"reference\"\n    assert (\n        inst.rest[0].resource[1].searchParam[7].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-title\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[7].documentation\n        == \"The human-friendly name of the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[7].name == \"title\"\n    assert inst.rest[0].resource[1].searchParam[7].type == \"string\"\n    assert (\n        inst.rest[0].resource[1].searchParam[8].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-composed-of\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[8].documentation\n        == \"What resource is being referenced\"\n    )\n    assert inst.rest[0].resource[1].searchParam[8].name == \"composed-of\"\n    assert inst.rest[0].resource[1].searchParam[8].type == \"reference\"\n    assert (\n        inst.rest[0].resource[1].searchParam[9].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-version\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[9].documentation\n        == \"The business version of the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[9].name == \"version\"\n    assert inst.rest[0].resource[1].searchParam[9].type == \"token\"\n    assert inst.rest[0].resource[1].searchRevInclude[0] == \"Communication.definition\"\n    assert inst.rest[0].resource[1].searchRevInclude[1] == \"DeviceRequest.definition\"\n    assert inst.rest[0].resource[1].searchRevInclude[2] == \"Procedure.definition\"\n    assert inst.rest[0].resource[1].searchRevInclude[3] == \"ProcedureRequest.definition\"\n    assert inst.rest[0].resource[1].searchRevInclude[4] == \"ReferralRequest.definition\"\n    assert inst.rest[0].resource[1].type == \"ActivityDefinition\"\n    assert inst.rest[0].resource[2].conditionalCreate is True\n    assert inst.rest[0].resource[2].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[2].conditionalUpdate is True\n    assert inst.rest[0].resource[2].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[2].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[2].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[2].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[2].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[2].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[2].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[2].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[2].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[2].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/AdverseEvent\"\n    )\n    assert inst.rest[0].resource[2].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[2].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[2].searchInclude[0] == \"AdverseEvent.recorder\"\n    assert inst.rest[0].resource[2].searchInclude[1] == \"AdverseEvent.study\"\n    assert inst.rest[0].resource[2].searchInclude[2] == \"AdverseEvent.reaction\"\n    assert inst.rest[0].resource[2].searchInclude[3] == \"AdverseEvent.subject\"\n    assert inst.rest[0].resource[2].searchInclude[4] == \"AdverseEvent.substance\"\n    assert inst.rest[0].resource[2].searchInclude[5] == \"AdverseEvent.location\"\n    assert (\n        inst.rest[0].resource[2].searchParam[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AdverseEvent-date\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[0].documentation\n        == \"When the event occurred\"\n    )\n    assert inst.rest[0].resource[2].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[2].searchParam[0].type == \"date\"\n    assert (\n        inst.rest[0].resource[2].searchParam[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AdverseEvent-recorder\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[1].documentation\n        == \"Who recorded the adverse event\"\n    )\n    assert inst.rest[0].resource[2].searchParam[1].name == \"recorder\"\n    assert inst.rest[0].resource[2].searchParam[1].type == \"reference\"\n    assert (\n        inst.rest[0].resource[2].searchParam[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AdverseEvent-study\"}\n        ).valueUri\n    )\n    assert inst.rest[0].resource[2].searchParam[2].documentation == \"AdverseEvent.study\"\n    assert inst.rest[0].resource[2].searchParam[2].name == \"study\"\n    assert inst.rest[0].resource[2].searchParam[2].type == \"reference\"\n    assert (\n        inst.rest[0].resource[2].searchParam[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AdverseEvent-reaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[3].documentation\n        == \"Adverse Reaction Events linked to exposure to substance\"\n    )\n    assert inst.rest[0].resource[2].searchParam[3].name == \"reaction\"\n    assert inst.rest[0].resource[2].searchParam[3].type == \"reference\"\n    assert (\n        inst.rest[0].resource[2].searchParam[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AdverseEvent-seriousness\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[4].documentation\n        == \"Mild | Moderate | Severe\"\n    )\n    assert inst.rest[0].resource[2].searchParam[4].name == \"seriousness\"\n    assert inst.rest[0].resource[2].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].resource[2].searchParam[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AdverseEvent-subject\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[5].documentation\n        == \"Subject or group impacted by event\"\n    )\n    assert inst.rest[0].resource[2].searchParam[5].name == \"subject\"\n    assert inst.rest[0].resource[2].searchParam[5].type == \"reference\"\n    assert (\n        inst.rest[0].resource[2].searchParam[6].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AdverseEvent-substance\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[6].documentation\n        == \"Refers to the specific entity that caused the adverse event\"\n    )\n    assert inst.rest[0].resource[2].searchParam[6].name == \"substance\"\n    assert inst.rest[0].resource[2].searchParam[6].type == \"reference\"\n    assert (\n        inst.rest[0].resource[2].searchParam[7].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AdverseEvent-location\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[7].documentation\n        == \"Location where adverse event occurred\"\n    )\n    assert inst.rest[0].resource[2].searchParam[7].name == \"location\"\n    assert inst.rest[0].resource[2].searchParam[7].type == \"reference\"\n    assert (\n        inst.rest[0].resource[2].searchParam[8].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AdverseEvent-category\"}\n        ).valueUri\n    )\n    assert inst.rest[0].resource[2].searchParam[8].name == \"category\"\n    assert inst.rest[0].resource[2].searchParam[8].type == \"token\"\n    assert (\n        inst.rest[0].resource[2].searchParam[9].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AdverseEvent-type\"}\n        ).valueUri\n    )\n    assert inst.rest[0].resource[2].searchParam[9].documentation == \"actual | potential\"\n    assert inst.rest[0].resource[2].searchParam[9].name == \"type\"\n    assert inst.rest[0].resource[2].searchParam[9].type == \"token\"\n    assert inst.rest[0].resource[2].type == \"AdverseEvent\"\n    assert inst.rest[0].resource[3].conditionalCreate is True\n    assert inst.rest[0].resource[3].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[3].conditionalUpdate is True\n    assert inst.rest[0].resource[3].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[3].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[3].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[3].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[3].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[3].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[3].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[3].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[3].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[3].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/AllergyIntolerance\"\n    )\n    assert inst.rest[0].resource[3].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[3].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[3].searchInclude[0] == \"AllergyIntolerance.recorder\"\n    assert inst.rest[0].resource[3].searchInclude[1] == \"AllergyIntolerance.asserter\"\n    assert inst.rest[0].resource[3].searchInclude[2] == \"AllergyIntolerance.patient\"\n    assert (\n        inst.rest[0].resource[3].searchParam[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-severity\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[0].documentation\n        == \"mild | moderate | severe (of event as a whole)\"\n    )\n    assert inst.rest[0].resource[3].searchParam[0].name == \"severity\"\n    assert inst.rest[0].resource[3].searchParam[0].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/clinical-date\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[1].documentation\n        == \"Date record was believed accurate\"\n    )\n    assert inst.rest[0].resource[3].searchParam[1].name == \"date\"\n    assert inst.rest[0].resource[3].searchParam[1].type == \"date\"\n    assert (\n        inst.rest[0].resource[3].searchParam[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/clinical-identifier\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[2].documentation\n        == \"External ids for this item\"\n    )\n    assert inst.rest[0].resource[3].searchParam[2].name == \"identifier\"\n    assert inst.rest[0].resource[3].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-manifestation\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[3].documentation\n        == \"Clinical symptoms/signs associated with the Event\"\n    )\n    assert inst.rest[0].resource[3].searchParam[3].name == \"manifestation\"\n    assert inst.rest[0].resource[3].searchParam[3].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-recorder\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[4].documentation\n        == \"Who recorded the sensitivity\"\n    )\n    assert inst.rest[0].resource[3].searchParam[4].name == \"recorder\"\n    assert inst.rest[0].resource[3].searchParam[4].type == \"reference\"\n    assert (\n        inst.rest[0].resource[3].searchParam[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/clinical-code\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[5].documentation\n        == \"Code that identifies the allergy or intolerance\"\n    )\n    assert inst.rest[0].resource[3].searchParam[5].name == \"code\"\n    assert inst.rest[0].resource[3].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[6].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-verification-status\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[6].documentation\n        == \"unconfirmed | confirmed | refuted | entered-in-error\"\n    )\n    assert inst.rest[0].resource[3].searchParam[6].name == \"verification-status\"\n    assert inst.rest[0].resource[3].searchParam[6].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[7].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-criticality\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[7].documentation\n        == \"low | high | unable-to-assess\"\n    )\n    assert inst.rest[0].resource[3].searchParam[7].name == \"criticality\"\n    assert inst.rest[0].resource[3].searchParam[7].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[8].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-clinical-status\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[8].documentation\n        == \"active | inactive | resolved\"\n    )\n    assert inst.rest[0].resource[3].searchParam[8].name == \"clinical-status\"\n    assert inst.rest[0].resource[3].searchParam[8].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[9].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/clinical-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[9].documentation\n        == \"allergy | intolerance - Underlying mechanism (if known)\"\n    )\n    assert inst.rest[0].resource[3].searchParam[9].name == \"type\"\n    assert inst.rest[0].resource[3].searchParam[9].type == \"token\"\n    assert inst.rest[0].resource[3].searchRevInclude[0] == \"ClinicalImpression.problem\"\n    assert (\n        inst.rest[0].resource[3].searchRevInclude[1]\n        == \"ImmunizationRecommendation.information\"\n    )\n    assert inst.rest[0].resource[3].type == \"AllergyIntolerance\"\n    assert inst.rest[0].resource[4].conditionalCreate is True\n    assert inst.rest[0].resource[4].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[4].conditionalUpdate is True\n    assert inst.rest[0].resource[4].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[4].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[4].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[4].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[4].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[4].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[4].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[4].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[4].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[4].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/Appointment\"\n    )\n    assert inst.rest[0].resource[4].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[4].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[4].searchInclude[0] == \"Appointment.actor\"\n    assert inst.rest[0].resource[4].searchInclude[1] == \"Appointment.practitioner\"\n    assert inst.rest[0].resource[4].searchInclude[2] == \"Appointment.incomingreferral\"\n    assert inst.rest[0].resource[4].searchInclude[3] == \"Appointment.patient\"\n    assert inst.rest[0].resource[4].searchInclude[4] == \"Appointment.location\"\n    assert (\n        inst.rest[0].resource[4].searchParam[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Appointment-date\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[0].documentation\n        == \"Appointment date/time.\"\n    )\n    assert inst.rest[0].resource[4].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[4].searchParam[0].type == \"date\"\n    assert (\n        inst.rest[0].resource[4].searchParam[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Appointment-actor\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[1].documentation\n        == \"Any one of the individuals participating in the appointment\"\n    )\n    assert inst.rest[0].resource[4].searchParam[1].name == \"actor\"\n    assert inst.rest[0].resource[4].searchParam[1].type == \"reference\"\n    assert (\n        inst.rest[0].resource[4].searchParam[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Appointment-identifier\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[2].documentation\n        == \"An Identifier of the Appointment\"\n    )\n    assert inst.rest[0].resource[4].searchParam[2].name == \"identifier\"\n    assert inst.rest[0].resource[4].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Appointment-practitioner\"}\n        ).valueUri\n    )\n    assert inst.rest[0].resource[4].searchParam[3].documentation == (\n        \"One of the individuals of the appointment is this \" \"practitioner\"\n    )\n    assert inst.rest[0].resource[4].searchParam[3].name == \"practitioner\"\n    assert inst.rest[0].resource[4].searchParam[3].type == \"reference\"\n    assert (\n        inst.rest[0].resource[4].searchParam[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/Appointment-incomingreferral\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[4].searchParam[4].documentation == (\n        \"The ReferralRequest provided as information to allocate to \" \"the Encounter\"\n    )\n    assert inst.rest[0].resource[4].searchParam[4].name == \"incomingreferral\"\n    assert inst.rest[0].resource[4].searchParam[4].type == \"reference\"\n    assert (\n        inst.rest[0].resource[4].searchParam[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Appointment-part-status\"}\n        ).valueUri\n    )\n    assert inst.rest[0].resource[4].searchParam[5].documentation == (\n        \"The Participation status of the subject, or other \"\n        \"participant on the appointment. Can be used to locate \"\n        \"participants that have not responded to meeting requests.\"\n    )\n    assert inst.rest[0].resource[4].searchParam[5].name == \"part-status\"\n    assert inst.rest[0].resource[4].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[6].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Appointment-patient\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[6].documentation\n        == \"One of the individuals of the appointment is this patient\"\n    )\n    assert inst.rest[0].resource[4].searchParam[6].name == \"patient\"\n    assert inst.rest[0].resource[4].searchParam[6].type == \"reference\"\n    assert (\n        inst.rest[0].resource[4].searchParam[7].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/Appointment-appointment-type\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[4].searchParam[7].documentation == (\n        \"The style of appointment or patient that has been booked in \"\n        \"the slot (not service type)\"\n    )\n    assert inst.rest[0].resource[4].searchParam[7].name == \"appointment-type\"\n    assert inst.rest[0].resource[4].searchParam[7].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[8].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Appointment-service-type\"}\n        ).valueUri\n    )\n    assert inst.rest[0].resource[4].searchParam[8].documentation == (\n        \"The specific service that is to be performed during this \" \"appointment\"\n    )\n    assert inst.rest[0].resource[4].searchParam[8].name == \"service-type\"\n    assert inst.rest[0].resource[4].searchParam[8].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[9].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Appointment-location\"}\n        ).valueUri\n    )\n    assert inst.rest[0].resource[4].searchParam[9].documentation == (\n        \"This location is listed in the participants of the \" \"appointment\"\n    )\n    assert inst.rest[0].resource[4].searchParam[9].name == \"location\"\n    assert inst.rest[0].resource[4].searchParam[9].type == \"reference\"\n    assert (\n        inst.rest[0].resource[4].searchRevInclude[0]\n        == \"AppointmentResponse.appointment\"\n    )\n    assert inst.rest[0].resource[4].searchRevInclude[1] == \"CarePlan.activity-reference\"\n    assert inst.rest[0].resource[4].searchRevInclude[2] == \"ClinicalImpression.action\"\n    assert inst.rest[0].resource[4].searchRevInclude[3] == \"Encounter.appointment\"\n    assert inst.rest[0].resource[4].type == \"Appointment\"\n    assert inst.rest[0].resource[5].conditionalCreate is True\n    assert inst.rest[0].resource[5].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[5].conditionalUpdate is True\n    assert inst.rest[0].resource[5].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[5].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[5].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[5].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[5].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[5].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[5].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[5].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[5].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[5].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/AppointmentResponse\"\n    )\n    assert inst.rest[0].resource[5].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[5].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[5].searchInclude[0] == \"AppointmentResponse.actor\"\n    assert (\n        inst.rest[0].resource[5].searchInclude[1] == \"AppointmentResponse.practitioner\"\n    )\n    assert inst.rest[0].resource[5].searchInclude[2] == \"AppointmentResponse.patient\"\n    assert (\n        inst.rest[0].resource[5].searchInclude[3] == \"AppointmentResponse.appointment\"\n    )\n    assert inst.rest[0].resource[5].searchInclude[4] == \"AppointmentResponse.location\"\n    assert (\n        inst.rest[0].resource[5].searchParam[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-actor\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[5].searchParam[0].documentation == (\n        \"The Person, Location/HealthcareService or Device that this \"\n        \"appointment response replies for\"\n    )\n    assert inst.rest[0].resource[5].searchParam[0].name == \"actor\"\n    assert inst.rest[0].resource[5].searchParam[0].type == \"reference\"\n    assert (\n        inst.rest[0].resource[5].searchParam[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-identifier\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[1].documentation\n        == \"An Identifier in this appointment response\"\n    )\n    assert inst.rest[0].resource[5].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[5].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[5].searchParam[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-practitioner\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[2].documentation\n        == \"This Response is for this Practitioner\"\n    )\n    assert inst.rest[0].resource[5].searchParam[2].name == \"practitioner\"\n    assert inst.rest[0].resource[5].searchParam[2].type == \"reference\"\n    assert (\n        inst.rest[0].resource[5].searchParam[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-part-status\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[3].documentation\n        == \"The participants acceptance status for this appointment\"\n    )\n    assert inst.rest[0].resource[5].searchParam[3].name == \"part-status\"\n    assert inst.rest[0].resource[5].searchParam[3].type == \"token\"\n    assert (\n        inst.rest[0].resource[5].searchParam[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-patient\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[4].documentation\n        == \"This Response is for this Patient\"\n    )\n    assert inst.rest[0].resource[5].searchParam[4].name == \"patient\"\n    assert inst.rest[0].resource[5].searchParam[4].type == \"reference\"\n    assert (\n        inst.rest[0].resource[5].searchParam[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-appointment\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[5].documentation\n        == \"The appointment that the response is attached to\"\n    )\n    assert inst.rest[0].resource[5].searchParam[5].name == \"appointment\"\n    assert inst.rest[0].resource[5].searchParam[5].type == \"reference\"\n    assert (\n        inst.rest[0].resource[5].searchParam[6].definition\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-location\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[6].documentation\n        == \"This Response is for this Location\"\n    )\n    assert inst.rest[0].resource[5].searchParam[6].name == \"location\"\n    assert inst.rest[0].resource[5].searchParam[6].type == \"reference\"\n    assert inst.rest[0].resource[5].type == \"AppointmentResponse\"\n    assert inst.rest[0].resource[6].conditionalCreate is True\n    assert inst.rest[0].resource[6].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[6].conditionalUpdate is True\n    assert inst.rest[0].resource[6].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[6].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[6].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[6].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[6].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[6].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[6].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[6].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[6].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[6].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/AuditEvent\"\n    )\n    assert inst.rest[0].resource[6].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[6].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[6].searchInclude[0] == \"AuditEvent.agent\"\n    assert inst.rest[0].resource[6].searchInclude[1] == \"AuditEvent.patient\"\n    assert inst.rest[0].resource[6].searchInclude[2] == \"AuditEvent.entity\"\n    assert (\n        inst.rest[0].resource[6].searchParam[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AuditEvent-date\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[0].documentation\n        == \"Time when the event occurred on source\"\n    )\n    assert inst.rest[0].resource[6].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[6].searchParam[0].type == \"date\"\n    assert (\n        inst.rest[0].resource[6].searchParam[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AuditEvent-entity-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[1].documentation\n        == \"Type of entity involved\"\n    )\n    assert inst.rest[0].resource[6].searchParam[1].name == \"entity-type\"\n    assert inst.rest[0].resource[6].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[6].searchParam[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AuditEvent-agent\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[2].documentation\n        == \"Direct reference to resource\"\n    )\n    assert inst.rest[0].resource[6].searchParam[2].name == \"agent\"\n    assert inst.rest[0].resource[6].searchParam[2].type == \"reference\"\n    assert (\n        inst.rest[0].resource[6].searchParam[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AuditEvent-address\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[3].documentation\n        == \"Identifier for the network access point of the user device\"\n    )\n    assert inst.rest[0].resource[6].searchParam[3].name == \"address\"\n    assert inst.rest[0].resource[6].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[6].searchParam[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AuditEvent-entity-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[4].documentation\n        == \"What role the entity played\"\n    )\n    assert inst.rest[0].resource[6].searchParam[4].name == \"entity-role\"\n    assert inst.rest[0].resource[6].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].resource[6].searchParam[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AuditEvent-source\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[5].documentation\n        == \"The identity of source detecting the event\"\n    )\n    assert inst.rest[0].resource[6].searchParam[5].name == \"source\"\n    assert inst.rest[0].resource[6].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[6].searchParam[6].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AuditEvent-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[6].documentation\n        == \"Type/identifier of event\"\n    )\n    assert inst.rest[0].resource[6].searchParam[6].name == \"type\"\n    assert inst.rest[0].resource[6].searchParam[6].type == \"token\"\n    assert (\n        inst.rest[0].resource[6].searchParam[7].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AuditEvent-altid\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[7].documentation\n        == \"Alternative User id e.g. authentication\"\n    )\n    assert inst.rest[0].resource[6].searchParam[7].name == \"altid\"\n    assert inst.rest[0].resource[6].searchParam[7].type == \"token\"\n    assert (\n        inst.rest[0].resource[6].searchParam[8].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AuditEvent-site\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[8].documentation\n        == \"Logical source location within the enterprise\"\n    )\n    assert inst.rest[0].resource[6].searchParam[8].name == \"site\"\n    assert inst.rest[0].resource[6].searchParam[8].type == \"token\"\n    assert (\n        inst.rest[0].resource[6].searchParam[9].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/AuditEvent-agent-name\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[9].documentation\n        == \"Human-meaningful name for the agent\"\n    )\n    assert inst.rest[0].resource[6].searchParam[9].name == \"agent-name\"\n    assert inst.rest[0].resource[6].searchParam[9].type == \"string\"\n    assert inst.rest[0].resource[6].type == \"AuditEvent\"\n    assert inst.rest[0].resource[7].conditionalCreate is True\n    assert inst.rest[0].resource[7].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[7].conditionalUpdate is True\n    assert inst.rest[0].resource[7].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[7].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[7].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[7].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[7].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[7].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[7].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[7].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[7].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[7].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/Basic\"\n    )\n    assert inst.rest[0].resource[7].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[7].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[7].searchInclude[0] == \"Basic.subject\"\n    assert inst.rest[0].resource[7].searchInclude[1] == \"Basic.patient\"\n    assert inst.rest[0].resource[7].searchInclude[2] == \"Basic.author\"\n    assert (\n        inst.rest[0].resource[7].searchParam[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Basic-identifier\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[0].documentation == \"Business identifier\"\n    )\n    assert inst.rest[0].resource[7].searchParam[0].name == \"identifier\"\n    assert inst.rest[0].resource[7].searchParam[0].type == \"token\"\n    assert (\n        inst.rest[0].resource[7].searchParam[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Basic-code\"}\n        ).valueUri\n    )\n    assert inst.rest[0].resource[7].searchParam[1].documentation == \"Kind of Resource\"\n    assert inst.rest[0].resource[7].searchParam[1].name == \"code\"\n    assert inst.rest[0].resource[7].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[7].searchParam[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Basic-subject\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[2].documentation\n        == \"Identifies the focus of this resource\"\n    )\n    assert inst.rest[0].resource[7].searchParam[2].name == \"subject\"\n    assert inst.rest[0].resource[7].searchParam[2].type == \"reference\"\n    assert (\n        inst.rest[0].resource[7].searchParam[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Basic-created\"}\n        ).valueUri\n    )\n    assert inst.rest[0].resource[7].searchParam[3].documentation == \"When created\"\n    assert inst.rest[0].resource[7].searchParam[3].name == \"created\"\n    assert inst.rest[0].resource[7].searchParam[3].type == \"date\"\n    assert (\n        inst.rest[0].resource[7].searchParam[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Basic-patient\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[4].documentation\n        == \"Identifies the focus of this resource\"\n    )\n    assert inst.rest[0].resource[7].searchParam[4].name == \"patient\"\n    assert inst.rest[0].resource[7].searchParam[4].type == \"reference\"\n    assert (\n        inst.rest[0].resource[7].searchParam[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Basic-author\"}\n        ).valueUri\n    )\n    assert inst.rest[0].resource[7].searchParam[5].documentation == \"Who created\"\n    assert inst.rest[0].resource[7].searchParam[5].name == \"author\"\n    assert inst.rest[0].resource[7].searchParam[5].type == \"reference\"\n    assert inst.rest[0].resource[7].type == \"Basic\"\n    assert inst.rest[0].resource[8].conditionalCreate is True\n    assert inst.rest[0].resource[8].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[8].conditionalUpdate is True\n    assert inst.rest[0].resource[8].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[8].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[8].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[8].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[8].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[8].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[8].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[8].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[8].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[8].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/Binary\"\n    )\n    assert inst.rest[0].resource[8].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[8].referencePolicy[1] == \"logical\"\n    assert (\n        inst.rest[0].resource[8].searchParam[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Binary-contenttype\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[8].searchParam[0].documentation\n        == \"MimeType of the binary content\"\n    )\n    assert inst.rest[0].resource[8].searchParam[0].name == \"contenttype\"\n    assert inst.rest[0].resource[8].searchParam[0].type == \"token\"\n    assert inst.rest[0].resource[8].type == \"Binary\"\n    assert inst.rest[0].resource[9].conditionalCreate is True\n    assert inst.rest[0].resource[9].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[9].conditionalUpdate is True\n    assert inst.rest[0].resource[9].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[9].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[9].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[9].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[9].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[9].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[9].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[9].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[9].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[9].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/BodySite\"\n    )\n    assert inst.rest[0].resource[9].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[9].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[9].searchInclude[0] == \"BodySite.patient\"\n    assert (\n        inst.rest[0].resource[9].searchParam[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/BodySite-identifier\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[9].searchParam[0].documentation\n        == \"Identifier for this instance of the anatomical location\"\n    )\n    assert inst.rest[0].resource[9].searchParam[0].name == \"identifier\"\n    assert inst.rest[0].resource[9].searchParam[0].type == \"token\"\n    assert (\n        inst.rest[0].resource[9].searchParam[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/BodySite-code\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[9].searchParam[1].documentation\n        == \"Named anatomical location\"\n    )\n    assert inst.rest[0].resource[9].searchParam[1].name == \"code\"\n    assert inst.rest[0].resource[9].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[9].searchParam[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/BodySite-patient\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].resource[9].searchParam[2].documentation\n        == \"Patient to whom bodysite belongs\"\n    )\n    assert inst.rest[0].resource[9].searchParam[2].name == \"patient\"\n    assert inst.rest[0].resource[9].searchParam[2].type == \"reference\"\n    assert inst.rest[0].resource[9].type == \"BodySite\"\n    assert (\n        inst.rest[0].searchParam[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/DomainResource-text\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].searchParam[0].documentation\n        == \"Search on the narrative of the resource\"\n    )\n    assert inst.rest[0].searchParam[0].name == \"_text\"\n    assert inst.rest[0].searchParam[0].type == \"string\"\n    assert (\n        inst.rest[0].searchParam[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-query\"}\n        ).valueUri\n    )\n    assert inst.rest[0].searchParam[1].documentation == (\n        \"A custom search profile that describes a specific defined \" \"query operation\"\n    )\n    assert inst.rest[0].searchParam[1].name == \"_query\"\n    assert inst.rest[0].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-profile\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].searchParam[2].documentation\n        == \"Profiles this resource claims to conform to\"\n    )\n    assert inst.rest[0].searchParam[2].name == \"_profile\"\n    assert inst.rest[0].searchParam[2].type == \"uri\"\n    assert (\n        inst.rest[0].searchParam[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-lastUpdated\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].searchParam[3].documentation\n        == \"When the resource version last changed\"\n    )\n    assert inst.rest[0].searchParam[3].name == \"_lastUpdated\"\n    assert inst.rest[0].searchParam[3].type == \"date\"\n    assert (\n        inst.rest[0].searchParam[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-tag\"}\n        ).valueUri\n    )\n    assert inst.rest[0].searchParam[4].documentation == \"Tags applied to this resource\"\n    assert inst.rest[0].searchParam[4].name == \"_tag\"\n    assert inst.rest[0].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-security\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].searchParam[5].documentation\n        == \"Security Labels applied to this resource\"\n    )\n    assert inst.rest[0].searchParam[5].name == \"_security\"\n    assert inst.rest[0].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[6].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-id\"}\n        ).valueUri\n    )\n    assert inst.rest[0].searchParam[6].documentation == \"Logical id of this artifact\"\n    assert inst.rest[0].searchParam[6].name == \"_id\"\n    assert inst.rest[0].searchParam[6].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[7].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-content\"}\n        ).valueUri\n    )\n    assert (\n        inst.rest[0].searchParam[7].documentation\n        == \"Search on the entire content of the resource\"\n    )\n    assert inst.rest[0].searchParam[7].name == \"_content\"\n    assert inst.rest[0].searchParam[7].type == \"string\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.description == (\n        \"This is the Capability Statement to declare that the server \"\n        \"supports SMART-on-FHIR. See the SMART-on-FHIR docs for the \"\n        \"extension that would go with such a server\"\n    )\n    assert inst.rest[0].security.service[0].coding[0].code == \"SMART-on-FHIR\"\n    assert inst.rest[0].security.service[0].coding[0].display == \"SMART-on-FHIR\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-security-service\"}\n        ).valueUri\n    )\n    assert inst.rest[0].security.service[0].text == \"See http://docs.smarthealthit.org/\"\n    assert inst.software.name == \"Insert your softwware name here...\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CapabilityStatement/base\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2-11200\"\n\n\ndef test_capabilitystatement_2(base_settings):\n    \"\"\"No. 2 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-capabilitystatement-base(base).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"capabilitystatement-capabilitystatement-base(base).json\"\n    )\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_2(inst2)\n"
  },
  {
    "path": "fhir/resources/STU3/tests/test_codesystem.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CodeSystem\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\nfrom .. import codesystem\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_codesystem_1(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"proposal\"\n    assert inst.concept[0].definition == (\n        \"The request is a suggestion made by someone/something that \"\n        \"doesn't have an intention to ensure it occurs and without \"\n        \"providing an authorization to act\"\n    )\n    assert inst.concept[0].display == \"Proposal\"\n    assert inst.concept[1].code == \"plan\"\n    assert inst.concept[1].definition == (\n        \"The request represents an intension to ensure something \"\n        \"occurs without providing an authorization for others to act\"\n    )\n    assert inst.concept[1].display == \"Plan\"\n    assert inst.concept[2].code == \"order\"\n    assert inst.concept[2].concept[0].code == \"original-order\"\n    assert (\n        inst.concept[2].concept[0].definition\n        == \"The request represents an original authorization for action\"\n    )\n    assert inst.concept[2].concept[0].display == \"Original Order\"\n    assert inst.concept[2].concept[1].code == \"reflex-order\"\n    assert inst.concept[2].concept[1].display == \"Reflex Order\"\n    assert inst.concept[2].concept[2].code == \"filler-order\"\n    assert inst.concept[2].concept[2].concept[0].code == \"instance-order\"\n    assert inst.concept[2].concept[2].concept[0].definition == (\n        \"An order created in fulfillment of a broader order that \"\n        \"represents the authorization for a single activity \"\n        \"occurrence.  E.g. The administration of a single dose of a \"\n        \"drug.\"\n    )\n    assert inst.concept[2].concept[2].concept[0].display == \"Instance Order\"\n    assert inst.concept[2].concept[2].definition == (\n        \"The request represents the view of an authorization \"\n        \"instantiated by a fulfilling system representing the details\"\n        \" of the fulfiller's intention to act upon a submitted order\"\n    )\n    assert inst.concept[2].concept[2].display == \"Filler Order\"\n    assert inst.concept[2].definition == (\n        \"The request represents a request/demand and authorization \" \"for action\"\n    )\n    assert inst.concept[2].display == \"Order\"\n    assert inst.concept[3].code == \"option\"\n    assert inst.concept[3].display == \"Option\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Codes indicating the degree of authority/intentionality \"\n        \"associated with a request\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 3\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"oo\"\n    assert inst.id == \"request-intent\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:2.16.840.1.113883.4.642.1.105\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert inst.name == \"RequestIntent\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/request-intent\"}\n        ).valueUri\n    )\n    assert (\n        inst.valueSet\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/request-intent\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_codesystem_1(base_settings):\n    \"\"\"No. 1 tests collection for CodeSystem.\n    Test File: codesystem-codesystem-request-intent(request-intent).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-codesystem-request-intent(request-intent).json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_1(inst2)\n\n\ndef impl_codesystem_2(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"as\"\n    assert inst.concept[0].definition == \"Child Asthma Program\"\n    assert inst.concept[0].display == \"Child Asthma\"\n    assert inst.concept[1].code == \"hd\"\n    assert inst.concept[1].definition == \"Heamodialisis Program.\"\n    assert inst.concept[1].display == \"Heamodialisis\"\n    assert inst.concept[2].code == \"auscr\"\n    assert inst.concept[2].definition == \"Autism Screening Program.\"\n    assert inst.concept[2].display == \"Autism Screening\"\n    assert inst.concept[3].code == \"none\"\n    assert inst.concept[3].definition == \"No program code applies.\"\n    assert inst.concept[3].display == \"None\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.content == \"complete\"\n    assert inst.copyright == \"This is an example set.\"\n    assert (\n        inst.description == \"This value set includes sample Program Reason Span codes.\"\n    )\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fm\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueString == \"Draft\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"ex-program-code\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:2.16.840.1.113883.4.642.1.569\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"}\n        ).valueUri\n    )\n    assert inst.name == \"Example Program Reason Codes\"\n    assert inst.publisher == \"Financial Management\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-programcode\"}\n        ).valueUri\n    )\n    assert (\n        inst.valueSet\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/ex-program-code\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_codesystem_2(base_settings):\n    \"\"\"No. 2 tests collection for CodeSystem.\n    Test File: codesystem-codesystem-ex-program-code(ex-program-code).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-codesystem-ex-program-code(ex-program-code).json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_2(inst2)\n\n\ndef impl_codesystem_3(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"nilknown\"\n    assert inst.concept[0].display == \"Nil Known\"\n    assert inst.concept[1].code == \"notasked\"\n    assert inst.concept[1].definition == (\n        \"The investigation to find out whether there are items for \"\n        \"this list has not occurred.\"\n    )\n    assert inst.concept[1].display == \"Not Asked\"\n    assert inst.concept[2].code == \"withheld\"\n    assert inst.concept[2].display == \"Information Withheld\"\n    assert inst.concept[3].code == \"unavailable\"\n    assert inst.concept[3].definition == (\n        \"Information to populate this list cannot be obtained; e.g. \"\n        \"unconscious patient.\"\n    )\n    assert inst.concept[3].display == \"Unavailable\"\n    assert inst.concept[4].code == \"notstarted\"\n    assert (\n        inst.concept[4].definition\n        == \"The work to populate this list has not yet begun.\"\n    )\n    assert inst.concept[4].display == \"Not Started\"\n    assert inst.concept[5].code == \"closed\"\n    assert inst.concept[5].definition == (\n        \"This list has now closed or has ceased to be relevant or \" \"useful.\"\n    )\n    assert inst.concept[5].display == \"Closed\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.content == \"complete\"\n    assert inst.description == (\n        \"General reasons for a list to be empty. Reasons are either \"\n        \"related to a summary list (i.e. problem or medication list) \"\n        \"or to a workflow related list (i.e. consultation list).\"\n    )\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 2\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"sd\"\n    assert inst.id == \"list-empty-reason\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:2.16.840.1.113883.4.642.1.314\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"}\n        ).valueUri\n    )\n    assert inst.name == \"List Empty Reasons\"\n    assert inst.publisher == \"FHIR Project\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/list-empty-reason\"}\n        ).valueUri\n    )\n    assert (\n        inst.valueSet\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/list-empty-reason\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_codesystem_3(base_settings):\n    \"\"\"No. 3 tests collection for CodeSystem.\n    Test File: codesystem-codesystem-list-empty-reason(list-empty-reason).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-codesystem-list-empty-reason(list-empty-reason).json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_3(inst2)\n\n\ndef impl_codesystem_4(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"complete\"\n    assert inst.concept[0].definition == \"The report is complete and ready for use\"\n    assert inst.concept[0].display == \"Complete\"\n    assert inst.concept[1].code == \"pending\"\n    assert inst.concept[1].definition == \"The report is currently being generated\"\n    assert inst.concept[1].display == \"Pending\"\n    assert inst.concept[2].code == \"error\"\n    assert (\n        inst.concept[2].definition\n        == \"An error occurred attempting to generate the report\"\n    )\n    assert inst.concept[2].display == \"Error\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"The status of the measure report\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 2\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"cqi\"\n    assert inst.id == \"measure-report-status\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:2.16.840.1.113883.4.642.1.760\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert inst.name == \"MeasureReportStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/measure-report-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.valueSet\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/measure-report-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_codesystem_4(base_settings):\n    \"\"\"No. 4 tests collection for CodeSystem.\n    Test File: codesystem-codesystem-measure-report-status(measure-report-status).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-codesystem-measure-report-status(measure-report-status).json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_4(inst2)\n\n\ndef impl_codesystem_5(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"inactive\"\n    assert inst.concept[0].definition == (\n        \"True if the concept is not considered active - e.g. not a \"\n        \"valid concept any more. Property type is boolean, default \"\n        \"value is false\"\n    )\n    assert inst.concept[0].display == \"Inactive\"\n    assert inst.concept[1].code == \"deprecated\"\n    assert inst.concept[1].display == \"Deprecated\"\n    assert inst.concept[2].code == \"notSelectable\"\n    assert inst.concept[2].display == \"Not Selectable\"\n    assert inst.concept[3].code == \"parent\"\n    assert inst.concept[3].definition == (\n        \"The concept identified in this property is a parent of the \"\n        \"concept on which it is a property. The property type will be\"\n        \" 'code'. The meaning of 'parent' is defined by the \"\n        \"hierarchyMeaning attribute\"\n    )\n    assert inst.concept[3].display == \"Parent\"\n    assert inst.concept[4].code == \"child\"\n    assert inst.concept[4].definition == (\n        \"The concept identified in this property is a child of the \"\n        \"concept on which it is a property. The property type will be\"\n        \" 'code'. The meaning of 'child' is defined by the \"\n        \"hierarchyMeaning attribute\"\n    )\n    assert inst.concept[4].display == \"Child\"\n    assert inst.content == \"complete\"\n    assert inst.description == (\n        \"A set of common concept properties for use on coded systems \"\n        \"through out the FHIR eco-system.\"\n    )\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 0\n    assert inst.id == \"concept-properties\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert inst.name == \"FHIR Defined Concept Properties\"\n    assert inst.publisher == \"FHIR Project\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/concept-properties\"}\n        ).valueUri\n    )\n    assert (\n        inst.valueSet\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/concept-properties\"}\n        ).valueUri\n    )\n\n\ndef test_codesystem_5(base_settings):\n    \"\"\"No. 5 tests collection for CodeSystem.\n    Test File: codesystem-codesystem-concept-properties(concept-properties).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-codesystem-concept-properties(concept-properties).json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_5(inst2)\n\n\ndef impl_codesystem_6(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"current\"\n    assert (\n        inst.concept[0].definition == \"This is the current reference for this document.\"\n    )\n    assert inst.concept[0].display == \"Current\"\n    assert inst.concept[1].code == \"superseded\"\n    assert (\n        inst.concept[1].definition\n        == \"This reference has been superseded by another reference.\"\n    )\n    assert inst.concept[1].display == \"Superseded\"\n    assert inst.concept[2].code == \"entered-in-error\"\n    assert inst.concept[2].definition == \"This reference was created in error.\"\n    assert inst.concept[2].display == \"Entered in Error\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"The status of the document reference.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 3\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"sd\"\n    assert inst.id == \"document-reference-status\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:2.16.840.1.113883.4.642.1.8\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert inst.name == \"DocumentReferenceStatus\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/document-reference-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.valueSet\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/document-reference-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_codesystem_6(base_settings):\n    \"\"\"No. 6 tests collection for CodeSystem.\n    Test File: codesystem-codesystem-document-reference-status(document-reference-status).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-codesystem-document-reference-status(document-reference-status).json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_6(inst2)\n\n\ndef impl_codesystem_7(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"ampoule\"\n    assert inst.concept[0].definition == \"A sealed glass capsule containing a liquid\"\n    assert inst.concept[0].display == \"Ampoule\"\n    assert inst.concept[1].code == \"bottle\"\n    assert inst.concept[1].definition == (\n        \"A container, typically made of glass or plastic and with a \"\n        \"narrow neck, used for storing liquids.\"\n    )\n    assert inst.concept[1].display == \"Bottle\"\n    assert inst.concept[2].code == \"box\"\n    assert inst.concept[2].definition == (\n        \"A container with a flat base and sides, typically square or \"\n        \"rectangular and having a lid.\"\n    )\n    assert inst.concept[2].display == \"Box\"\n    assert inst.concept[3].code == \"cartridge\"\n    assert inst.concept[3].definition == (\n        \"A device of various configuration and composition used with \"\n        \"a syringe for the application of anesthetic or other \"\n        \"materials to a patient.\"\n    )\n    assert inst.concept[3].display == \"Cartridge\"\n    assert inst.concept[4].code == \"container\"\n    assert inst.concept[4].definition == \"A package intended to store pharmaceuticals.\"\n    assert inst.concept[4].display == \"Container\"\n    assert inst.concept[5].code == \"tube\"\n    assert inst.concept[5].definition == (\n        \"A long, hollow cylinder of metal, plastic, glass, etc., for \"\n        \"holding medications, typically creams or ointments\"\n    )\n    assert inst.concept[5].display == \"Tube\"\n    assert inst.concept[6].code == \"unitdose\"\n    assert inst.concept[6].definition == (\n        \"A dose of medicine prepared in an individual package for \"\n        \"convenience, safety or monitoring.\"\n    )\n    assert inst.concept[6].display == \"Unit Dose Blister\"\n    assert inst.concept[7].code == \"vial\"\n    assert inst.concept[7].definition == (\n        \"A small container, typically cylindrical and made of glass, \"\n        \"used especially for holding liquid medications.\"\n    )\n    assert inst.concept[7].display == \"Vial\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"A coded concept defining the kind of container a medication \"\n        \"package is packaged in\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 1\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"phx\"\n    assert inst.id == \"medication-package-form\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:2.16.840.1.113883.4.642.1.362\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert inst.name == \"MedicationContainer\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/medication-package-form\"}\n        ).valueUri\n    )\n    assert (\n        inst.valueSet\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/medication-package-form\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_codesystem_7(base_settings):\n    \"\"\"No. 7 tests collection for CodeSystem.\n    Test File: codesystem-codesystem-medication-package-form(medication-package-form).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-codesystem-medication-package-form(medication-package-form).json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_7(inst2)\n\n\ndef impl_codesystem_8(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"unlikely\"\n    assert inst.concept[0].definition == (\n        \"There is a low level of clinical certainty that the reaction\"\n        \" was caused by the identified substance.\"\n    )\n    assert inst.concept[0].display == \"Unlikely\"\n    assert inst.concept[1].code == \"likely\"\n    assert inst.concept[1].definition == (\n        \"There is a high level of clinical certainty that the \"\n        \"reaction was caused by the identified substance.\"\n    )\n    assert inst.concept[1].display == \"Likely\"\n    assert inst.concept[2].code == \"confirmed\"\n    assert inst.concept[2].definition == (\n        \"There is a very high level of clinical certainty that the \"\n        \"reaction was due to the identified substance, which may \"\n        \"include clinical evidence by testing or rechallenge.\"\n    )\n    assert inst.concept[2].display == \"Confirmed\"\n    assert inst.concept[3].code == \"unknown\"\n    assert inst.concept[3].definition == (\n        \"The clinical certainty that the reaction was caused by the \"\n        \"identified substance is unknown.  It is an explicit \"\n        \"assertion that certainty is not known.\"\n    )\n    assert inst.concept[3].display == \"Unknown\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Statement about the degree of clinical certainty that a \"\n        \"specific substance was the cause of the manifestation in a \"\n        \"reaction event.\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 0\n    assert inst.id == \"reaction-event-certainty\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:2.16.840.1.113883.4.642.1.860\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert inst.name == \"AllergyIntoleranceCertainty\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/reaction-event-certainty\"}\n        ).valueUri\n    )\n    assert (\n        inst.valueSet\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/reaction-event-certainty\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_codesystem_8(base_settings):\n    \"\"\"No. 8 tests collection for CodeSystem.\n    Test File: codesystem-codesystem-reaction-event-certainty(reaction-event-certainty).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-codesystem-reaction-event-certainty(reaction-event-certainty).json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_8(inst2)\n\n\ndef impl_codesystem_9(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"311405\"\n    assert inst.concept[0].definition == \"Dentist General Practitioner (DDS, DDM).\"\n    assert inst.concept[0].display == \"Dentist\"\n    assert inst.concept[1].code == \"604215\"\n    assert inst.concept[1].definition == \"Ophthalmologist.\"\n    assert inst.concept[1].display == \"Ophthalmologist\"\n    assert inst.concept[2].code == \"604210\"\n    assert inst.concept[2].definition == \"Optometrist.\"\n    assert inst.concept[2].display == \"Optometrist\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.content == \"complete\"\n    assert inst.copyright == \"This is an example set.\"\n    assert (\n        inst.description\n        == \"This value set includes sample Provider Qualification codes.\"\n    )\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fm\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueString == \"Draft\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"provider-qualification\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:2.16.840.1.113883.4.642.1.563\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"}\n        ).valueUri\n    )\n    assert inst.name == \"Example Provider Qualification Codes\"\n    assert inst.publisher == \"Financial Management\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-providerqualification\"}\n        ).valueUri\n    )\n    assert (\n        inst.valueSet\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/provider-qualification\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_codesystem_9(base_settings):\n    \"\"\"No. 9 tests collection for CodeSystem.\n    Test File: codesystem-codesystem-provider-qualification(provider-qualification).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-codesystem-provider-qualification(provider-qualification).json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_9(inst2)\n\n\ndef impl_codesystem_10(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"in-progress\"\n    assert inst.concept[0].definition == \"Supply has been requested, but not delivered.\"\n    assert inst.concept[0].display == \"In Progress\"\n    assert inst.concept[1].code == \"completed\"\n    assert inst.concept[1].definition == 'Supply has been delivered (\"completed\").'\n    assert inst.concept[1].display == \"Delivered\"\n    assert inst.concept[2].code == \"abandoned\"\n    assert inst.concept[2].definition == \"Delivery was not completed.\"\n    assert inst.concept[2].display == \"Abandoned\"\n    assert inst.concept[3].code == \"entered-in-error\"\n    assert inst.concept[3].display == \"Entered In Error\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Status of the supply delivery.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 1\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"oo\"\n    assert inst.id == \"supplydelivery-status\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:2.16.840.1.113883.4.642.1.687\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert inst.name == \"SupplyDeliveryStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/supplydelivery-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.valueSet\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/supplydelivery-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_codesystem_10(base_settings):\n    \"\"\"No. 10 tests collection for CodeSystem.\n    Test File: codesystem-codesystem-supplydelivery-status(supplydelivery-status).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-codesystem-supplydelivery-status(supplydelivery-status).json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_10(inst2)\n"
  },
  {
    "path": "fhir/resources/STU3/tests/test_compartmentdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CompartmentDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\nfrom .. import compartmentdefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_compartmentdefinition_1(inst):\n    assert inst.code == \"RelatedPerson\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"relatedPerson\"\n    assert inst.name == \"Base FHIR compartment definition for RelatedPerson\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"AdverseEvent\"\n    assert inst.resource[2].param[0] == \"recorder\"\n    assert inst.resource[3].code == \"AllergyIntolerance\"\n    assert inst.resource[3].param[0] == \"asserter\"\n    assert inst.resource[4].code == \"Appointment\"\n    assert inst.resource[4].param[0] == \"actor\"\n    assert inst.resource[5].code == \"AppointmentResponse\"\n    assert inst.resource[5].param[0] == \"actor\"\n    assert inst.resource[6].code == \"AuditEvent\"\n    assert inst.resource[7].code == \"Basic\"\n    assert inst.resource[7].param[0] == \"author\"\n    assert inst.resource[8].code == \"Binary\"\n    assert inst.resource[9].code == \"BodySite\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/relatedPerson\"}\n        ).valueUri\n    )\n\n\ndef test_compartmentdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-compartmentdefinition-relatedperson(relatedPerson).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"compartmentdefinition-compartmentdefinition-relatedperson(relatedPerson).json\"\n    )\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_1(inst2)\n\n\ndef impl_compartmentdefinition_2(inst):\n    assert inst.code == \"Patient\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"patient\"\n    assert inst.name == \"Base FHIR compartment definition for Patient\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[0].param[0] == \"subject\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"AdverseEvent\"\n    assert inst.resource[2].param[0] == \"subject\"\n    assert inst.resource[3].code == \"AllergyIntolerance\"\n    assert inst.resource[3].param[0] == \"patient\"\n    assert inst.resource[3].param[1] == \"recorder\"\n    assert inst.resource[3].param[2] == \"asserter\"\n    assert inst.resource[4].code == \"Appointment\"\n    assert inst.resource[4].param[0] == \"actor\"\n    assert inst.resource[5].code == \"AppointmentResponse\"\n    assert inst.resource[5].param[0] == \"actor\"\n    assert inst.resource[6].code == \"AuditEvent\"\n    assert inst.resource[6].param[0] == \"patient\"\n    assert inst.resource[6].param[1] == \"agent.patient\"\n    assert inst.resource[6].param[2] == \"entity.patient\"\n    assert inst.resource[7].code == \"Basic\"\n    assert inst.resource[7].param[0] == \"patient\"\n    assert inst.resource[7].param[1] == \"author\"\n    assert inst.resource[8].code == \"Binary\"\n    assert inst.resource[9].code == \"BodySite\"\n    assert inst.resource[9].param[0] == \"patient\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/patient\"}\n        ).valueUri\n    )\n\n\ndef test_compartmentdefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-compartmentdefinition-patient(patient).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"compartmentdefinition-compartmentdefinition-patient(patient).json\"\n    )\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_2(inst2)\n\n\ndef impl_compartmentdefinition_3(inst):\n    assert inst.code == \"Encounter\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"encounter\"\n    assert inst.name == \"Base FHIR compartment definition for Encounter\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"AdverseEvent\"\n    assert inst.resource[3].code == \"AllergyIntolerance\"\n    assert inst.resource[4].code == \"Appointment\"\n    assert inst.resource[5].code == \"AppointmentResponse\"\n    assert inst.resource[6].code == \"AuditEvent\"\n    assert inst.resource[7].code == \"Basic\"\n    assert inst.resource[8].code == \"Binary\"\n    assert inst.resource[9].code == \"BodySite\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/encounter\"}\n        ).valueUri\n    )\n\n\ndef test_compartmentdefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-compartmentdefinition-encounter(encounter).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"compartmentdefinition-compartmentdefinition-encounter(encounter).json\"\n    )\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_3(inst2)\n\n\ndef impl_compartmentdefinition_4(inst):\n    assert inst.code == \"Device\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"There is an instance of the practitioner compartment for \"\n        \"each Device resource, and the identity of the compartment is\"\n        \" the same as the Device. The set of resources associated \"\n        \"with a particular device\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"device\"\n    assert inst.name == \"Base FHIR compartment definition for Device\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[0].param[0] == \"subject\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"AdverseEvent\"\n    assert inst.resource[3].code == \"AllergyIntolerance\"\n    assert inst.resource[4].code == \"Appointment\"\n    assert inst.resource[4].param[0] == \"actor\"\n    assert inst.resource[5].code == \"AppointmentResponse\"\n    assert inst.resource[5].param[0] == \"actor\"\n    assert inst.resource[6].code == \"AuditEvent\"\n    assert inst.resource[6].param[0] == \"agent\"\n    assert inst.resource[7].code == \"Basic\"\n    assert inst.resource[8].code == \"Binary\"\n    assert inst.resource[9].code == \"BodySite\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/device\"}\n        ).valueUri\n    )\n\n\ndef test_compartmentdefinition_4(base_settings):\n    \"\"\"No. 4 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-compartmentdefinition-device(device).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"compartmentdefinition-compartmentdefinition-device(device).json\"\n    )\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_4(inst2)\n\n\ndef impl_compartmentdefinition_5(inst):\n    assert inst.code == \"Practitioner\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"practitioner\"\n    assert inst.name == \"Base FHIR compartment definition for Practitioner\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[0].param[0] == \"subject\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"AdverseEvent\"\n    assert inst.resource[2].param[0] == \"recorder\"\n    assert inst.resource[3].code == \"AllergyIntolerance\"\n    assert inst.resource[3].param[0] == \"recorder\"\n    assert inst.resource[3].param[1] == \"asserter\"\n    assert inst.resource[4].code == \"Appointment\"\n    assert inst.resource[4].param[0] == \"actor\"\n    assert inst.resource[5].code == \"AppointmentResponse\"\n    assert inst.resource[5].param[0] == \"actor\"\n    assert inst.resource[6].code == \"AuditEvent\"\n    assert inst.resource[6].param[0] == \"agent\"\n    assert inst.resource[7].code == \"Basic\"\n    assert inst.resource[7].param[0] == \"author\"\n    assert inst.resource[8].code == \"Binary\"\n    assert inst.resource[9].code == \"BodySite\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/practitioner\"}\n        ).valueUri\n    )\n\n\ndef test_compartmentdefinition_5(base_settings):\n    \"\"\"No. 5 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-compartmentdefinition-practitioner(practitioner).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"compartmentdefinition-compartmentdefinition-practitioner(practitioner).json\"\n    )\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_5(inst2)\n"
  },
  {
    "path": "fhir/resources/STU3/tests/test_conceptmap.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ConceptMap\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\nfrom .. import conceptmap\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_conceptmap_1(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.group[0].element[0].code == \"in-progress\"\n    assert inst.group[0].element[0].target[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[1].code == \"on-hold\"\n    assert inst.group[0].element[1].target[0].code == \"suspended\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[2].code == \"completed\"\n    assert inst.group[0].element[2].target[0].code == \"completed\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[3].code == \"entered-in-error\"\n    assert inst.group[0].element[3].target[0].code == \"nullified\"\n    assert inst.group[0].element[3].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[4].code == \"stopped\"\n    assert inst.group[0].element[4].target[0].code == \"aborted\"\n    assert inst.group[0].element[4].target[0].equivalence == \"equal\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/medication-dispense-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/v3/ActStatus\"}\n        ).valueUri\n    )\n    assert inst.id == \"cm-medication-dispense-status-v3\"\n    assert inst.name == \"v3 map for MedicationDispenseStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert (\n        inst.sourceReference.reference\n        == \"http://hl7.org/fhir/ValueSet/medication-dispense-status\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.targetReference.reference == \"http://hl7.org/fhir/ValueSet/v3-ActStatus\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-medication-dispense-status-v3\"\n            }\n        ).valueUri\n    )\n\n\ndef test_conceptmap_1(base_settings):\n    \"\"\"No. 1 tests collection for ConceptMap.\n    Test File: conceptmap-cm-medication-dispense-status-v3.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"conceptmap-cm-medication-dispense-status-v3.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_1(inst2)\n\n\ndef impl_conceptmap_2(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.group[0].element[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[1].code == \"on-hold\"\n    assert inst.group[0].element[1].target[0].code == \"suspended\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[2].code == \"cancelled\"\n    assert inst.group[0].element[2].target[0].code == \"cancelled\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[3].code == \"completed\"\n    assert inst.group[0].element[3].target[0].code == \"completed\"\n    assert inst.group[0].element[3].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[4].code == \"entered-in-error\"\n    assert inst.group[0].element[4].target[0].code == \"nullified\"\n    assert inst.group[0].element[4].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[5].code == \"stopped\"\n    assert inst.group[0].element[5].target[0].code == \"aborted\"\n    assert inst.group[0].element[5].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[6].code == \"draft\"\n    assert inst.group[0].element[6].target[0].code == \"new\"\n    assert inst.group[0].element[6].target[0].equivalence == \"equal\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/medication-request-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/v3/ActStatus\"}\n        ).valueUri\n    )\n    assert inst.id == \"cm-medication-request-status-v3\"\n    assert inst.name == \"v3 map for MedicationRequestStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert (\n        inst.sourceReference.reference\n        == \"http://hl7.org/fhir/ValueSet/medication-request-status\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.targetReference.reference == \"http://hl7.org/fhir/ValueSet/v3-ActStatus\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-medication-request-status-v3\"\n            }\n        ).valueUri\n    )\n\n\ndef test_conceptmap_2(base_settings):\n    \"\"\"No. 2 tests collection for ConceptMap.\n    Test File: conceptmap-cm-medication-request-status-v3.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"conceptmap-cm-medication-request-status-v3.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_2(inst2)\n\n\ndef impl_conceptmap_3(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.group[0].element[0].code == \"in-progress\"\n    assert inst.group[0].element[0].target[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[1].code == \"on-hold\"\n    assert inst.group[0].element[1].target[0].code == \"suspended\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[2].code == \"completed\"\n    assert inst.group[0].element[2].target[0].code == \"completed\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[3].code == \"entered-in-error\"\n    assert inst.group[0].element[3].target[0].code == \"nullified\"\n    assert inst.group[0].element[3].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[4].code == \"stopped\"\n    assert inst.group[0].element[4].target[0].code == \"aborted\"\n    assert inst.group[0].element[4].target[0].equivalence == \"equal\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/medication-admin-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/v3/ActStatus\"}\n        ).valueUri\n    )\n    assert inst.id == \"cm-medication-admin-status-v3\"\n    assert inst.name == \"v3 map for MedicationAdministrationStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert (\n        inst.sourceReference.reference\n        == \"http://hl7.org/fhir/ValueSet/medication-admin-status\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.targetReference.reference == \"http://hl7.org/fhir/ValueSet/v3-ActStatus\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-medication-admin-status-v3\"}\n        ).valueUri\n    )\n\n\ndef test_conceptmap_3(base_settings):\n    \"\"\"No. 3 tests collection for ConceptMap.\n    Test File: conceptmap-cm-medication-admin-status-v3.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"conceptmap-cm-medication-admin-status-v3.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_3(inst2)\n\n\ndef impl_conceptmap_4(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.group[0].element[0].code == \"phone\"\n    assert inst.group[0].element[0].target[0].code == \"PH\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[1].code == \"fax\"\n    assert inst.group[0].element[1].target[0].code == \"FX\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[2].code == \"email\"\n    assert inst.group[0].element[2].target[0].code == \"Internet\"\n    assert inst.group[0].element[2].target[0].comment == \"for email addresses\"\n    assert inst.group[0].element[2].target[0].equivalence == \"narrower\"\n    assert inst.group[0].element[3].code == \"pager\"\n    assert inst.group[0].element[3].target[0].code == \"BP\"\n    assert inst.group[0].element[3].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[4].code == \"url\"\n    assert inst.group[0].element[4].target[0].code == \"Internet\"\n    assert (\n        inst.group[0].element[4].target[0].comment == \"for non-email kinds of addresses\"\n    )\n    assert inst.group[0].element[4].target[0].equivalence == \"narrower\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/contact-point-system\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/v2/0202\"}\n        ).valueUri\n    )\n    assert inst.id == \"cm-contact-point-system-v2\"\n    assert inst.name == \"v2 map for ContactPointSystem\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert (\n        inst.sourceReference.reference\n        == \"http://hl7.org/fhir/ValueSet/contact-point-system\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.targetReference.reference == \"http://hl7.org/fhir/ValueSet/v2-0202\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-contact-point-system-v2\"}\n        ).valueUri\n    )\n\n\ndef test_conceptmap_4(base_settings):\n    \"\"\"No. 4 tests collection for ConceptMap.\n    Test File: conceptmap-cm-contact-point-system-v2.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"conceptmap-cm-contact-point-system-v2.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_4(inst2)\n\n\ndef impl_conceptmap_5(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.group[0].element[0].code == \"unknown\"\n    assert inst.group[0].element[0].target[0].code == \"UNK\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[1].code == \"asked\"\n    assert inst.group[0].element[1].target[0].code == \"ASKU\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[2].code == \"temp\"\n    assert inst.group[0].element[2].target[0].code == \"NAV\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[3].code == \"not-asked\"\n    assert inst.group[0].element[3].target[0].code == \"NASK\"\n    assert inst.group[0].element[3].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[4].code == \"masked\"\n    assert inst.group[0].element[4].target[0].code == \"MSK\"\n    assert inst.group[0].element[4].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[5].code == \"unsupported\"\n    assert inst.group[0].element[5].target[0].code == \"NA\"\n    assert inst.group[0].element[5].target[0].equivalence == \"wider\"\n    assert inst.group[0].element[6].code == \"error\"\n    assert inst.group[0].element[6].target[0].code == \"NA\"\n    assert inst.group[0].element[6].target[0].equivalence == \"wider\"\n    assert inst.group[0].element[7].code == \"NaN\"\n    assert inst.group[0].element[7].target[0].code == \"NA\"\n    assert inst.group[0].element[7].target[0].equivalence == \"wider\"\n    assert inst.group[0].element[8].code == \"not-performed\"\n    assert inst.group[0].element[8].target[0].code == \"NA\"\n    assert inst.group[0].element[8].target[0].equivalence == \"wider\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/data-absent-reason\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/v3/NullFlavor\"}\n        ).valueUri\n    )\n    assert inst.id == \"cm-data-absent-reason-v3\"\n    assert inst.name == \"v3 map for DataAbsentReason\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert (\n        inst.sourceReference.reference\n        == \"http://hl7.org/fhir/ValueSet/data-absent-reason\"\n    )\n    assert inst.status == \"draft\"\n    assert (\n        inst.targetReference.reference == \"http://hl7.org/fhir/ValueSet/v3-NullFlavor\"\n    )\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-data-absent-reason-v3\"}\n        ).valueUri\n    )\n\n\ndef test_conceptmap_5(base_settings):\n    \"\"\"No. 5 tests collection for ConceptMap.\n    Test File: conceptmap-cm-data-absent-reason-v3.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"conceptmap-cm-data-absent-reason-v3.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_5(inst2)\n\n\ndef impl_conceptmap_6(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.group[0].element[0].code == \"preliminary\"\n    assert inst.group[0].element[0].target[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equivalent\"\n    assert inst.group[0].element[1].code == \"final\"\n    assert inst.group[0].element[1].target[0].code == \"completed\"\n    assert inst.group[0].element[1].target[0].equivalence == \"wider\"\n    assert inst.group[0].element[2].code == \"amended\"\n    assert inst.group[0].element[2].target[0].code == \"completed\"\n    assert inst.group[0].element[2].target[0].equivalence == \"wider\"\n    assert inst.group[0].element[3].code == \"entered-in-error\"\n    assert inst.group[0].element[3].target[0].code == \"nullified\"\n    assert inst.group[0].element[3].target[0].equivalence == \"equivalent\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/composition-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/v3/ActStatus\"}\n        ).valueUri\n    )\n    assert inst.id == \"cm-composition-status-v3\"\n    assert inst.name == \"v3 map for CompositionStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert (\n        inst.sourceReference.reference\n        == \"http://hl7.org/fhir/ValueSet/composition-status\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.targetReference.reference == \"http://hl7.org/fhir/ValueSet/v3-ActStatus\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-composition-status-v3\"}\n        ).valueUri\n    )\n\n\ndef test_conceptmap_6(base_settings):\n    \"\"\"No. 6 tests collection for ConceptMap.\n    Test File: conceptmap-cm-composition-status-v3.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"conceptmap-cm-composition-status-v3.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_6(inst2)\n\n\ndef impl_conceptmap_7(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.group[0].element[0].code == \"high\"\n    assert inst.group[0].element[0].target[0].code == \"H\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[1].code == \"moderate\"\n    assert inst.group[0].element[1].target[0].code == \"M\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[2].code == \"low\"\n    assert inst.group[0].element[2].target[0].code == \"L\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equal\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/detectedissue-severity\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/v3/ObservationValue\"}\n        ).valueUri\n    )\n    assert inst.id == \"cm-detectedissue-severity-v3\"\n    assert inst.name == \"v3 map for DetectedIssueSeverity\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert (\n        inst.sourceReference.reference\n        == \"http://hl7.org/fhir/ValueSet/detectedissue-severity\"\n    )\n    assert inst.status == \"draft\"\n    assert (\n        inst.targetReference.reference\n        == \"http://hl7.org/fhir/ValueSet/v3-SeverityObservation\"\n    )\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-detectedissue-severity-v3\"}\n        ).valueUri\n    )\n\n\ndef test_conceptmap_7(base_settings):\n    \"\"\"No. 7 tests collection for ConceptMap.\n    Test File: conceptmap-cm-detectedissue-severity-v3.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"conceptmap-cm-detectedissue-severity-v3.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_7(inst2)\n\n\ndef impl_conceptmap_8(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.group[0].element[0].code == \"postal\"\n    assert inst.group[0].element[0].target[0].code == \"PHYS\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[1].code == \"physical\"\n    assert inst.group[0].element[1].target[0].code == \"PST\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equal\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/address-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/v3/AddressUse\"}\n        ).valueUri\n    )\n    assert inst.id == \"cm-address-type-v3\"\n    assert inst.name == \"v3 map for AddressType\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.sourceReference.reference == \"http://hl7.org/fhir/ValueSet/address-type\"\n    assert inst.status == \"draft\"\n    assert (\n        inst.targetReference.reference == \"http://hl7.org/fhir/ValueSet/v3-AddressUse\"\n    )\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-address-type-v3\"}\n        ).valueUri\n    )\n\n\ndef test_conceptmap_8(base_settings):\n    \"\"\"No. 8 tests collection for ConceptMap.\n    Test File: conceptmap-cm-address-type-v3.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"conceptmap-cm-address-type-v3.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_8(inst2)\n\n\ndef impl_conceptmap_9(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.group[0].element[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[1].code == \"completed\"\n    assert inst.group[0].element[1].target[0].code == \"completed\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[2].code == \"entered-in-error\"\n    assert inst.group[0].element[2].target[0].code == \"nullified\"\n    assert inst.group[0].element[2].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[3].code == \"stopped\"\n    assert inst.group[0].element[3].target[0].code == \"aborted\"\n    assert inst.group[0].element[3].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[4].code == \"on-hold\"\n    assert inst.group[0].element[4].target[0].code == \"suspended\"\n    assert inst.group[0].element[4].target[0].equivalence == \"equal\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/medication-statement-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/v3/ActStatus\"}\n        ).valueUri\n    )\n    assert inst.id == \"cm-medication-statement-status-v3\"\n    assert inst.name == \"v3 map for MedicationStatementStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert (\n        inst.sourceReference.reference\n        == \"http://hl7.org/fhir/ValueSet/medication-statement-status\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.targetReference.reference == \"http://hl7.org/fhir/ValueSet/v3-ActStatus\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-medication-statement-status-v3\"\n            }\n        ).valueUri\n    )\n\n\ndef test_conceptmap_9(base_settings):\n    \"\"\"No. 9 tests collection for ConceptMap.\n    Test File: conceptmap-cm-medication-statement-status-v3.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"conceptmap-cm-medication-statement-status-v3.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_9(inst2)\n\n\ndef impl_conceptmap_10(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.group[0].element[0].code == \"male\"\n    assert inst.group[0].element[0].target[0].code == \"M\"\n    assert inst.group[0].element[0].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[1].code == \"female\"\n    assert inst.group[0].element[1].target[0].code == \"F\"\n    assert inst.group[0].element[1].target[0].equivalence == \"equal\"\n    assert inst.group[0].element[2].code == \"other\"\n    assert inst.group[0].element[2].target[0].code == \"UN\"\n    assert inst.group[0].element[2].target[0].equivalence == \"wider\"\n    assert inst.group[0].element[3].code == \"unknown\"\n    assert inst.group[0].element[3].target[0].code == \"UNK\"\n    assert inst.group[0].element[3].target[0].equivalence == \"equal\"\n    assert (\n        inst.group[0].source\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/administrative-gender\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].target\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/v3/AdministrativeGender\"}\n        ).valueUri\n    )\n    assert inst.id == \"cm-administrative-gender-v3\"\n    assert inst.name == \"v3 map for AdministrativeGender\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert (\n        inst.sourceReference.reference\n        == \"http://hl7.org/fhir/ValueSet/administrative-gender\"\n    )\n    assert inst.status == \"draft\"\n    assert (\n        inst.targetReference.reference\n        == \"http://hl7.org/fhir/ValueSet/v3-AdministrativeGender\"\n    )\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-administrative-gender-v3\"}\n        ).valueUri\n    )\n\n\ndef test_conceptmap_10(base_settings):\n    \"\"\"No. 10 tests collection for ConceptMap.\n    Test File: conceptmap-cm-administrative-gender-v3.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"conceptmap-cm-administrative-gender-v3.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_10(inst2)\n"
  },
  {
    "path": "fhir/resources/STU3/tests/test_operationdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OperationDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\nfrom .. import operationdefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_operationdefinition_1(inst):\n    assert inst.code == \"everything\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"Patient-everything\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Fetch Patient Record\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"start\"\n    assert inst.parameter[0].type == \"date\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"end\"\n    assert inst.parameter[1].type == \"date\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == 'The bundle type is \"searchset\"'\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 1\n    assert inst.parameter[2].name == \"return\"\n    assert inst.parameter[2].type == \"Bundle\"\n    assert inst.parameter[2].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Patient\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"generated\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Patient-everything\"}\n        ).valueUri\n    )\n\n\ndef test_operationdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for OperationDefinition.\n    Test File: operationdefinition-operation-patient-everything(Patient-everything).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationdefinition-operation-patient-everything(Patient-everything).json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_1(inst2)\n\n\ndef impl_operationdefinition_2(inst):\n    assert inst.code == \"find\"\n    assert inst.comment == (\n        \"Note that servers may support searching by a functional \"\n        \"list, and not support this operation that allows clients to \"\n        \"find the list directly\"\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"List-find\"\n    assert inst.instance is False\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Find a functional list\"\n    assert inst.parameter[0].documentation == (\n        \"The id of a patient resource located on the server on which \"\n        \"this operation is executed\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"patient\"\n    assert inst.parameter[0].type == \"id\"\n    assert inst.parameter[0].use == \"in\"\n    assert (\n        inst.parameter[1].documentation\n        == \"The code for the functional list that is being found\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 1\n    assert inst.parameter[1].name == \"name\"\n    assert inst.parameter[1].type == \"code\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"List\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"generated\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/List-find\"}\n        ).valueUri\n    )\n\n\ndef test_operationdefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for OperationDefinition.\n    Test File: operationdefinition-operation-list-find(List-find).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationdefinition-operation-list-find(List-find).json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_2(inst2)\n\n\ndef impl_operationdefinition_3(inst):\n    assert inst.code == \"questionnaire\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"StructureDefinition-questionnaire\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Build Questionnaire\"\n    assert inst.parameter[0].documentation == (\n        \"A logical profile identifier (i.e. \"\n        \"'StructureDefinition.identifier''). The server must know the\"\n        \" profile or be able to retrieve it from other known \"\n        \"repositories.\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"identifier\"\n    assert inst.parameter[0].type == \"uri\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The [StructureDefinition](structuredefinition.html) is \"\n        \"provided directly as part of the request. Servers may choose\"\n        \" not to accept profiles in this fashion\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"profile\"\n    assert inst.parameter[1].searchType == \"token\"\n    assert inst.parameter[1].type == \"string\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == (\n        \"The profile's official URL (i.e. 'StructureDefinition.url').\"\n        \" The server must know the profile or be able to retrieve it \"\n        \"from other known repositories.\"\n    )\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"url\"\n    assert inst.parameter[2].type == \"uri\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].documentation == (\n        \"If true, the questionnaire will only include those elements \"\n        \"marked as \\\"mustSupport='true'\\\" in the StructureDefinition.\"\n    )\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 0\n    assert inst.parameter[3].name == \"supportedOnly\"\n    assert inst.parameter[3].type == \"boolean\"\n    assert inst.parameter[3].use == \"in\"\n    assert inst.parameter[4].documentation == (\n        \"The questionnaire form generated based on the \" \"StructureDefinition.\"\n    )\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 1\n    assert inst.parameter[4].name == \"return\"\n    assert inst.parameter[4].type == \"Questionnaire\"\n    assert inst.parameter[4].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"StructureDefinition\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"generated\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/OperationDefinition/StructureDefinition-questionnaire\"\n            }\n        ).valueUri\n    )\n\n\ndef test_operationdefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for OperationDefinition.\n    Test File: operationdefinition-operation-structuredefinition-questionnaire(StructureDefinition-questionnaire).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationdefinition-operation-structuredefinition-questionnaire(StructureDefinition-questionnaire).json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_3(inst2)\n\n\ndef impl_operationdefinition_4(inst):\n    assert inst.code == \"populatelink\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"Questionnaire-populatelink\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Generate a link to a Questionnaire completion webpage\"\n    assert inst.parameter[0].documentation == (\n        \"A logical questionnaire identifier (i.e. \"\n        \"''Questionnaire.identifier''). The server must know the \"\n        \"questionnaire or be able to retrieve it from other known \"\n        \"repositories.\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"identifier\"\n    assert inst.parameter[0].type == \"uri\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The [Questionnaire](questionnaire.html) is provided directly\"\n        \" as part of the request. Servers may choose not to accept \"\n        \"questionnaires in this fashion\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"questionnaire\"\n    assert inst.parameter[1].type == \"Questionnaire\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"questionnaireRef\"\n    assert (\n        inst.parameter[2].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/Questionnaire\"\n    )\n    assert inst.parameter[2].type == \"Reference\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].max == \"*\"\n    assert inst.parameter[3].min == 0\n    assert inst.parameter[3].name == \"content\"\n    assert inst.parameter[3].type == \"Reference\"\n    assert inst.parameter[3].use == \"in\"\n    assert inst.parameter[4].documentation == (\n        \"If specified and set to 'true' (and the server is capable), \"\n        \"the server should use what resources and other knowledge it \"\n        \"has about the referenced subject when pre-populating answers\"\n        \" to questions.\"\n    )\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 0\n    assert inst.parameter[4].name == \"local\"\n    assert inst.parameter[4].type == \"boolean\"\n    assert inst.parameter[4].use == \"in\"\n    assert inst.parameter[5].documentation == (\n        \"The URL for the web form  that supports capturing the \"\n        \"information defined by questionnaire, possibly partially (or\"\n        \" fully)-populated with a set of answers for the specified \"\n        \"Questionnaire\"\n    )\n    assert inst.parameter[5].max == \"1\"\n    assert inst.parameter[5].min == 1\n    assert inst.parameter[5].name == \"link\"\n    assert inst.parameter[5].type == \"uri\"\n    assert inst.parameter[5].use == \"out\"\n    assert inst.parameter[6].max == \"1\"\n    assert inst.parameter[6].min == 0\n    assert inst.parameter[6].name == \"issues\"\n    assert inst.parameter[6].type == \"OperationOutcome\"\n    assert inst.parameter[6].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Questionnaire\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"generated\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Questionnaire-populatelink\"\n            }\n        ).valueUri\n    )\n\n\ndef test_operationdefinition_4(base_settings):\n    \"\"\"No. 4 tests collection for OperationDefinition.\n    Test File: operationdefinition-operation-questionnaire-populatelink(Questionnaire-populatelink).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationdefinition-operation-questionnaire-populatelink(Questionnaire-populatelink).json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_4(inst2)\n\n\ndef impl_operationdefinition_5(inst):\n    assert inst.code == \"apply\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"The apply operation realizes a definition in a specific \" \"context\"\n    )\n    assert inst.id == \"ActivityDefinition-apply\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Apply\"\n    assert (\n        inst.parameter[0].documentation\n        == \"The patient that is the target of the activity to be applied\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"patient\"\n    assert (\n        inst.parameter[0].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/Patient\"\n    )\n    assert inst.parameter[0].type == \"Reference\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == \"The encounter in context, if any\"\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"encounter\"\n    assert (\n        inst.parameter[1].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/Encounter\"\n    )\n    assert inst.parameter[1].type == \"Reference\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == \"The practitioner in context\"\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"practitioner\"\n    assert (\n        inst.parameter[2].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/Practitioner\"\n    )\n    assert inst.parameter[2].type == \"Reference\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].documentation == \"The organization in context\"\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 0\n    assert inst.parameter[3].name == \"organization\"\n    assert (\n        inst.parameter[3].profile.reference\n        == \"http://hl7.org/fhir/StructureDefinition/Organization\"\n    )\n    assert inst.parameter[3].type == \"Reference\"\n    assert inst.parameter[3].use == \"in\"\n    assert inst.parameter[4].documentation == (\n        \"The type of user initiating the request, e.g. patient, \"\n        \"healthcare provider, or specific type of healthcare provider\"\n        \" (physician, nurse, etc.)\"\n    )\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 0\n    assert inst.parameter[4].name == \"userType\"\n    assert inst.parameter[4].type == \"CodeableConcept\"\n    assert inst.parameter[4].use == \"in\"\n    assert (\n        inst.parameter[5].documentation\n        == \"Preferred language of the person using the system\"\n    )\n    assert inst.parameter[5].max == \"1\"\n    assert inst.parameter[5].min == 0\n    assert inst.parameter[5].name == \"userLanguage\"\n    assert inst.parameter[5].type == \"CodeableConcept\"\n    assert inst.parameter[5].use == \"in\"\n    assert inst.parameter[6].max == \"1\"\n    assert inst.parameter[6].min == 0\n    assert inst.parameter[6].name == \"userTaskContext\"\n    assert inst.parameter[6].type == \"CodeableConcept\"\n    assert inst.parameter[6].use == \"in\"\n    assert inst.parameter[7].documentation == (\n        \"The current setting of the request (inpatient, outpatient, \" \"etc)\"\n    )\n    assert inst.parameter[7].max == \"1\"\n    assert inst.parameter[7].min == 0\n    assert inst.parameter[7].name == \"setting\"\n    assert inst.parameter[7].type == \"CodeableConcept\"\n    assert inst.parameter[7].use == \"in\"\n    assert (\n        inst.parameter[8].documentation\n        == \"Additional detail about the setting of the request, if any\"\n    )\n    assert inst.parameter[8].max == \"1\"\n    assert inst.parameter[8].min == 0\n    assert inst.parameter[8].name == \"settingContext\"\n    assert inst.parameter[8].type == \"CodeableConcept\"\n    assert inst.parameter[8].use == \"in\"\n    assert (\n        inst.parameter[9].documentation\n        == \"The resource that is the result of applying the definition\"\n    )\n    assert inst.parameter[9].max == \"1\"\n    assert inst.parameter[9].min == 1\n    assert inst.parameter[9].name == \"return\"\n    assert inst.parameter[9].type == \"Any\"\n    assert inst.parameter[9].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"ActivityDefinition\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"generated\"\n    assert inst.type is False\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/OperationDefinition/ActivityDefinition-apply\"\n            }\n        ).valueUri\n    )\n\n\ndef test_operationdefinition_5(base_settings):\n    \"\"\"No. 5 tests collection for OperationDefinition.\n    Test File: operationdefinition-operation-activitydefinition-apply(ActivityDefinition-apply).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationdefinition-operation-activitydefinition-apply(ActivityDefinition-apply).json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_5(inst2)\n\n\ndef impl_operationdefinition_6(inst):\n    assert inst.code == \"expand\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"ValueSet-expand\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Value Set Expansion\"\n    assert inst.parameter[0].documentation == (\n        \"A canonical url for a value set. The server must know the \"\n        \"value set (e.g. it is defined explicitly in the server's \"\n        \"value sets, or it is defined implicitly by some code system \"\n        \"known to the server\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"url\"\n    assert inst.parameter[0].type == \"uri\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The value set is provided directly as part of the request. \"\n        \"Servers may choose not to accept value sets in this fashion\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"valueSet\"\n    assert inst.parameter[1].type == \"ValueSet\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"context\"\n    assert inst.parameter[2].type == \"uri\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 0\n    assert inst.parameter[3].name == \"filter\"\n    assert inst.parameter[3].type == \"string\"\n    assert inst.parameter[3].use == \"in\"\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 0\n    assert inst.parameter[4].name == \"profile\"\n    assert inst.parameter[4].type == \"uri\"\n    assert inst.parameter[4].use == \"in\"\n    assert inst.parameter[5].max == \"1\"\n    assert inst.parameter[5].min == 0\n    assert inst.parameter[5].name == \"date\"\n    assert inst.parameter[5].type == \"dateTime\"\n    assert inst.parameter[5].use == \"in\"\n    assert inst.parameter[6].documentation == (\n        \"Paging support - where to start if a subset is desired \"\n        \"(default = 0). Offset is number of records (not number of \"\n        \"pages)\"\n    )\n    assert inst.parameter[6].max == \"1\"\n    assert inst.parameter[6].min == 0\n    assert inst.parameter[6].name == \"offset\"\n    assert inst.parameter[6].type == \"integer\"\n    assert inst.parameter[6].use == \"in\"\n    assert inst.parameter[7].max == \"1\"\n    assert inst.parameter[7].min == 0\n    assert inst.parameter[7].name == \"count\"\n    assert inst.parameter[7].type == \"integer\"\n    assert inst.parameter[7].use == \"in\"\n    assert inst.parameter[8].documentation == (\n        \"Controls whether concept designations are to be included or \"\n        \"excluded in value set expansions. Overrides the value in the\"\n        \" expansion profile if there is one\"\n    )\n    assert inst.parameter[8].max == \"1\"\n    assert inst.parameter[8].min == 0\n    assert inst.parameter[8].name == \"includeDesignations\"\n    assert inst.parameter[8].type == \"boolean\"\n    assert inst.parameter[8].use == \"in\"\n    assert inst.parameter[9].documentation == (\n        \"Controls whether the value set definition is included or \"\n        \"excluded in value set expansions. Overrides the value in the\"\n        \" expansion profile if there is one\"\n    )\n    assert inst.parameter[9].max == \"1\"\n    assert inst.parameter[9].min == 0\n    assert inst.parameter[9].name == \"includeDefinition\"\n    assert inst.parameter[9].type == \"boolean\"\n    assert inst.parameter[9].use == \"in\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"ValueSet\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"generated\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/ValueSet-expand\"}\n        ).valueUri\n    )\n\n\ndef test_operationdefinition_6(base_settings):\n    \"\"\"No. 6 tests collection for OperationDefinition.\n    Test File: operationdefinition-operation-valueset-expand(ValueSet-expand).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationdefinition-operation-valueset-expand(ValueSet-expand).json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_6(inst2)\n\n\ndef impl_operationdefinition_7(inst):\n    assert inst.code == \"meta-delete\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This operation takes a meta, and deletes the profiles, tags,\"\n        \" and security labels found in it from the nominated \"\n        \"resource.   This operation can also be used on historical \"\n        \"entries\"\n    )\n    assert inst.id == \"Resource-meta-delete\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Delete profiles, tags, and security labels for a resource\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"meta\"\n    assert inst.parameter[0].type == \"Meta\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == \"Resulting meta for the resource\"\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 1\n    assert inst.parameter[1].name == \"return\"\n    assert inst.parameter[1].type == \"Meta\"\n    assert inst.parameter[1].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Resource\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"generated\"\n    assert inst.type is False\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Resource-meta-delete\"}\n        ).valueUri\n    )\n\n\ndef test_operationdefinition_7(base_settings):\n    \"\"\"No. 7 tests collection for OperationDefinition.\n    Test File: operationdefinition-operation-resource-meta-delete(Resource-meta-delete).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationdefinition-operation-resource-meta-delete(Resource-meta-delete).json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_7(inst2)\n\n\ndef impl_operationdefinition_8(inst):\n    assert inst.code == \"data-requirements\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"The data-requirements operation aggregates and returns the \"\n        \"parameters and data requirements for the activity definition\"\n        \" and all its dependencies as a single module definition \"\n        \"library\"\n    )\n    assert inst.id == \"ActivityDefinition-data-requirements\"\n    assert inst.instance is True\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Data Requirements\"\n    assert inst.parameter[0].documentation == (\n        \"The result of the requirements gathering represented as a \"\n        \"module-definition Library that describes the aggregate \"\n        \"parameters, data requirements, and dependencies of the \"\n        \"activity definition\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"return\"\n    assert inst.parameter[0].type == \"Library\"\n    assert inst.parameter[0].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"ActivityDefinition\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"generated\"\n    assert inst.type is False\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/OperationDefinition/ActivityDefinition-data-requirements\"\n            }\n        ).valueUri\n    )\n\n\ndef test_operationdefinition_8(base_settings):\n    \"\"\"No. 8 tests collection for OperationDefinition.\n    Test File: operationdefinition-operation-activitydefinition-data-requirements(ActivityDefinition-data-requirements).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationdefinition-operation-activitydefinition-data-requirements(ActivityDefinition-data-requirements).json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_8(inst2)\n\n\ndef impl_operationdefinition_9(inst):\n    assert inst.code == \"closure\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"ConceptMap-closure\"\n    assert inst.instance is False\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Closure Table Maintenance\"\n    assert inst.parameter[0].documentation == (\n        \"The name that defines the particular context for the \"\n        \"subsumption based closure table\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"name\"\n    assert inst.parameter[0].type == \"string\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == \"Concepts to add to the closure table\"\n    assert inst.parameter[1].max == \"*\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"concept\"\n    assert inst.parameter[1].type == \"Coding\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == (\n        \"A request to resynchronise - request to send all new entries\"\n        \" since the nominated version was sent by the server\"\n    )\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"version\"\n    assert inst.parameter[2].type == \"id\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 1\n    assert inst.parameter[3].name == \"return\"\n    assert inst.parameter[3].type == \"ConceptMap\"\n    assert inst.parameter[3].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"ConceptMap\"\n    assert inst.status == \"draft\"\n    assert inst.system is True\n    assert inst.text.status == \"generated\"\n    assert inst.type is False\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/ConceptMap-closure\"}\n        ).valueUri\n    )\n\n\ndef test_operationdefinition_9(base_settings):\n    \"\"\"No. 9 tests collection for OperationDefinition.\n    Test File: operationdefinition-operation-conceptmap-closure(ConceptMap-closure).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationdefinition-operation-conceptmap-closure(ConceptMap-closure).json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_9(inst2)\n\n\ndef impl_operationdefinition_10(inst):\n    assert inst.code == \"conforms\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"CapabilityStatement-conforms\"\n    assert inst.instance is False\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Test if a server implements a client's required operations\"\n    assert inst.parameter[0].documentation == (\n        \"The canonical URL for the left-hand system's capability \" \"statement\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"left\"\n    assert inst.parameter[0].type == \"uri\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The canonical URL for the right-hand system's capability \" \"statement\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"right\"\n    assert inst.parameter[1].type == \"uri\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == (\n        \"What kind of comparison to perform - server to server, or \"\n        \"client to server (use the codes 'server/server' or \"\n        \"'client/server')\"\n    )\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"mode\"\n    assert inst.parameter[2].type == \"code\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].documentation == \"Outcome of the CapabilityStatement test\"\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 1\n    assert inst.parameter[3].name == \"issues\"\n    assert inst.parameter[3].type == \"OperationOutcome\"\n    assert inst.parameter[3].use == \"out\"\n    assert inst.parameter[4].documentation == (\n        \"The intersection of the functionality described by the \"\n        \"CapabilityStatement resources\"\n    )\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 0\n    assert inst.parameter[4].name == \"union\"\n    assert inst.parameter[4].type == \"CapabilityStatement\"\n    assert inst.parameter[4].use == \"out\"\n    assert inst.parameter[5].documentation == (\n        \"The union of the functionality described by the \"\n        \"CapabilityStatement resources\"\n    )\n    assert inst.parameter[5].max == \"1\"\n    assert inst.parameter[5].min == 0\n    assert inst.parameter[5].name == \"intersection\"\n    assert inst.parameter[5].type == \"CapabilityStatement\"\n    assert inst.parameter[5].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"CapabilityStatement\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"generated\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/OperationDefinition/CapabilityStatement-conforms\"\n            }\n        ).valueUri\n    )\n\n\ndef test_operationdefinition_10(base_settings):\n    \"\"\"No. 10 tests collection for OperationDefinition.\n    Test File: operationdefinition-operation-capabilitystatement-conforms(CapabilityStatement-conforms).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationdefinition-operation-capabilitystatement-conforms(CapabilityStatement-conforms).json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_10(inst2)\n"
  },
  {
    "path": "fhir/resources/STU3/tests/test_questionnaire.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Questionnaire\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\nfrom .. import questionnaire\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_questionnaire_1(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert inst.contained[3].id == \"vs5\"\n    assert inst.contained[4].id == \"vs6\"\n    assert inst.contained[5].id == \"vs7\"\n    assert inst.contained[6].id == \"vs8\"\n    assert inst.contained[7].id == \"vs9\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-05-12T00:00:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].extension[1].valueInteger == 1\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].text == \"Group of elements for HDL Cholesterol result.\"\n    assert inst.item[0].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].item[1].linkId == \"Observation.id.value\"\n    assert inst.item[0].item[2].item[1].repeats is False\n    assert inst.item[0].item[2].item[1].required is False\n    assert inst.item[0].item[2].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[2].linkId == \"Observation.id\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content may\"\n        \" not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].linkId == \"Observation.meta\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].text == \"Metadata about the resource\"\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"Observation.implicitRules.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert (\n        inst.item[0].item[4].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[4].item[1].type == \"string\"\n    assert inst.item[0].item[4].linkId == \"Observation.implicitRules\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].linkId == \"Observation.language.value\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"language\"\n    assert inst.item[0].item[5].item[1].type == \"choice\"\n    assert inst.item[0].item[5].linkId == \"Observation.language\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"Observation.text\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert (\n        inst.item[0].item[6].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"Observation.contained\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"Observation.extension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Additional Content defined by implementations\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].linkId == \"Observation.modifierExtension\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"Observation\"\n    assert inst.item[0].repeats is False\n    assert inst.item[0].required is True\n    assert inst.item[0].text == \"HDL Cholesterol Result\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == \"Grahame Grieve\"\n    assert inst.status == \"draft\"\n\n\ndef test_questionnaire_1(base_settings):\n    \"\"\"No. 1 tests collection for Questionnaire.\n    Test File: questionnaire-hdlcholesterol-questionnaire(qs1).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaire-hdlcholesterol-questionnaire(qs1).json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_1(inst2)\n\n\ndef impl_questionnaire_2(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert inst.contained[3].id == \"vs5\"\n    assert inst.contained[4].id == \"vs6\"\n    assert inst.contained[5].id == \"vs7\"\n    assert inst.contained[6].id == \"vs8\"\n    assert inst.contained[7].id == \"vs9\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-05-12T00:00:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].extension[1].valueInteger == 1\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].text == \"Group of elements for Triglyceride result.\"\n    assert inst.item[0].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].item[1].linkId == \"Observation.id.value\"\n    assert inst.item[0].item[2].item[1].repeats is False\n    assert inst.item[0].item[2].item[1].required is False\n    assert inst.item[0].item[2].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[2].linkId == \"Observation.id\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content may\"\n        \" not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].linkId == \"Observation.meta\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].text == \"Metadata about the resource\"\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"Observation.implicitRules.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert (\n        inst.item[0].item[4].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[4].item[1].type == \"string\"\n    assert inst.item[0].item[4].linkId == \"Observation.implicitRules\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].linkId == \"Observation.language.value\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"language\"\n    assert inst.item[0].item[5].item[1].type == \"choice\"\n    assert inst.item[0].item[5].linkId == \"Observation.language\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"Observation.text\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert (\n        inst.item[0].item[6].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"Observation.contained\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"Observation.extension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Additional Content defined by implementations\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].linkId == \"Observation.modifierExtension\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"Observation\"\n    assert inst.item[0].repeats is False\n    assert inst.item[0].required is True\n    assert inst.item[0].text == \"Triglyceride Result\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == \"Grahame Grieve\"\n    assert inst.status == \"draft\"\n\n\ndef test_questionnaire_2(base_settings):\n    \"\"\"No. 2 tests collection for Questionnaire.\n    Test File: questionnaire-triglyceride-questionnaire(qs1).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaire-triglyceride-questionnaire(qs1).json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_2(inst2)\n\n\ndef impl_questionnaire_3(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].text == (\n        \"A booking of a healthcare event among patient(s), \"\n        \"practitioner(s), related person(s) and/or device(s) for a \"\n        \"specific date/time. This may result in one or more \"\n        \"Encounter(s).\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"Appointment.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"Appointment.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content may\"\n        \" not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"Appointment.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].item[1].linkId == \"Appointment.implicitRules.value\"\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"Appointment.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"Appointment.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"choice\"\n    assert inst.item[0].item[4].linkId == \"Appointment.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"Appointment.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"Appointment.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"Appointment.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional Content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"Appointment.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[1].linkId == \"Appointment.identifier.label\"\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert inst.item[0].item[9].item[2].linkId == \"Appointment.identifier.system\"\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert inst.item[0].item[9].item[3].linkId == \"Appointment.identifier.value\"\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"Appointment.identifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"External Ids for this item\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"Appointment\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == (\n        \"A booking of a healthcare event among patient(s), \"\n        \"practitioner(s), related person(s) and/or device(s) for a \"\n        \"specific date/time. This may result in one or more \"\n        \"Encounter(s)\"\n    )\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == \"Health Level Seven International (Patient Administration)\"\n    assert inst.status == \"draft\"\n\n\ndef test_questionnaire_3(base_settings):\n    \"\"\"No. 3 tests collection for Questionnaire.\n    Test File: questionnaire-appointment-questionnaire(qs1).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaire-appointment-questionnaire(qs1).json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_3(inst2)\n\n\ndef impl_questionnaire_4(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert inst.contained[3].id == \"vs5\"\n    assert inst.contained[4].id == \"vs6\"\n    assert inst.contained[5].id == \"vs7\"\n    assert inst.contained[6].id == \"vs8\"\n    assert inst.contained[7].id == \"vs9\"\n    assert inst.contained[8].id == \"vs10\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].text == (\n        \"A formal agreement between parties regarding the conduct of \"\n        \"business, exchange of information or other matters.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"Contract.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"Contract.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content may\"\n        \" not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"Contract.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].item[1].linkId == \"Contract.implicitRules.value\"\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"Contract.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"Contract.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"choice\"\n    assert inst.item[0].item[4].linkId == \"Contract.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"Contract.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"Contract.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"Contract.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional Content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"Contract.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[9].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[1].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].text == \"Unique identifier for this Contract.\"\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[1].linkId == \"Contract.identifier.label\"\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert inst.item[0].item[9].item[2].linkId == \"Contract.identifier.system\"\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert inst.item[0].item[9].item[3].linkId == \"Contract.identifier.value\"\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"Contract.identifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Contract number\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"Contract\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Legal Agreement\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == \"Health Level Seven International (Financial Management)\"\n    assert inst.status == \"draft\"\n\n\ndef test_questionnaire_4(base_settings):\n    \"\"\"No. 4 tests collection for Questionnaire.\n    Test File: questionnaire-contract-questionnaire(qs1).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaire-contract-questionnaire(qs1).json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_4(inst2)\n\n\ndef impl_questionnaire_5(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].text == (\n        \"A text description of the DICOM SOP instances selected in \"\n        \"the ImagingManifest; or the reason for, or significance of, \"\n        \"the selection.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"ImagingManifest.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"ImagingManifest.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content may\"\n        \" not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"ImagingManifest.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].item[1].linkId == \"ImagingManifest.implicitRules.value\"\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"ImagingManifest.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"ImagingManifest.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"choice\"\n    assert inst.item[0].item[4].linkId == \"ImagingManifest.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"ImagingManifest.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"ImagingManifest.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"ImagingManifest.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional Content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"ImagingManifest.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[9].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[1].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].text == (\n        \"Unique identifier of the DICOM Key Object Selection (KOS) \"\n        \"that this resource represents.\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[1].linkId == \"ImagingManifest.identifier.label\"\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert inst.item[0].item[9].item[2].linkId == \"ImagingManifest.identifier.system\"\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert inst.item[0].item[9].item[3].linkId == \"ImagingManifest.identifier.value\"\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"ImagingManifest.identifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"SOP Instance UID\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"ImagingManifest\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Key Object Selection\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == \"Health Level Seven International (Imaging Integration)\"\n    assert inst.status == \"draft\"\n\n\ndef test_questionnaire_5(base_settings):\n    \"\"\"No. 5 tests collection for Questionnaire.\n    Test File: questionnaire-imagingmanifest-questionnaire(qs1).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaire-imagingmanifest-questionnaire(qs1).json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_5(inst2)\n\n\ndef impl_questionnaire_6(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].text == (\n        \"A summary of information based on the results of executing a\" \" TestScript.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"TestReport.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"TestReport.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content may\"\n        \" not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"TestReport.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].item[1].linkId == \"TestReport.implicitRules.value\"\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"TestReport.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"TestReport.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"choice\"\n    assert inst.item[0].item[4].linkId == \"TestReport.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"TestReport.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"TestReport.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"TestReport.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional Content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"TestReport.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[9].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[1].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].text == (\n        \"Identifier for the TestScript assigned for external purposes\"\n        \" outside the context of FHIR.\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[1].linkId == \"TestReport.identifier.label\"\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert inst.item[0].item[9].item[2].linkId == \"TestReport.identifier.system\"\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert inst.item[0].item[9].item[3].linkId == \"TestReport.identifier.value\"\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"TestReport.identifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"External identifier\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"TestReport\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Describes the results of a TestScript execution\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.status == \"draft\"\n\n\ndef test_questionnaire_6(base_settings):\n    \"\"\"No. 6 tests collection for Questionnaire.\n    Test File: questionnaire-testreport-questionnaire(qs1).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaire-testreport-questionnaire(qs1).json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_6(inst2)\n\n\ndef impl_questionnaire_7(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].text == (\n        \"A record of a device being used by a patient where the \"\n        \"record is the result of a report from the patient or another\"\n        \" clinician.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"DeviceUseStatement.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"DeviceUseStatement.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content may\"\n        \" not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"DeviceUseStatement.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[3].item[1].linkId == \"DeviceUseStatement.implicitRules.value\"\n    )\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"DeviceUseStatement.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"DeviceUseStatement.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"choice\"\n    assert inst.item[0].item[4].linkId == \"DeviceUseStatement.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"DeviceUseStatement.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"DeviceUseStatement.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"DeviceUseStatement.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional Content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"DeviceUseStatement.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].text\n        == \"An external identifier for this statement such as an IRI.\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[1].linkId == \"DeviceUseStatement.identifier.label\"\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert inst.item[0].item[9].item[2].linkId == \"DeviceUseStatement.identifier.system\"\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert inst.item[0].item[9].item[3].linkId == \"DeviceUseStatement.identifier.value\"\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"DeviceUseStatement.identifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"External identifier for this record\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"DeviceUseStatement\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Record of use of a device\"\n    assert inst.item[0].type == \"group\"\n    assert (\n        inst.publisher == \"Health Level Seven International (Orders and Observations)\"\n    )\n    assert inst.status == \"draft\"\n\n\ndef test_questionnaire_7(base_settings):\n    \"\"\"No. 7 tests collection for Questionnaire.\n    Test File: questionnaire-deviceusestatement-questionnaire(qs1).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaire-deviceusestatement-questionnaire(qs1).json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_7(inst2)\n\n\ndef impl_questionnaire_8(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert inst.contained[3].id == \"vs5\"\n    assert inst.contained[4].id == \"vs6\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-03-25T00:00:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].text == (\n        \"This profile defines how to represent heart rate \"\n        \"observations in FHIR using a standard LOINC code and UCUM \"\n        \"units of measure.\"\n    )\n    assert inst.item[0].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].item[1].linkId == \"Observation.id.value\"\n    assert inst.item[0].item[2].item[1].repeats is False\n    assert inst.item[0].item[2].item[1].required is False\n    assert inst.item[0].item[2].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[2].linkId == \"Observation.id\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content may\"\n        \" not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].linkId == \"Observation.meta\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].text == \"Metadata about the resource\"\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"Observation.implicitRules.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert (\n        inst.item[0].item[4].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[4].item[1].type == \"string\"\n    assert inst.item[0].item[4].linkId == \"Observation.implicitRules\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].linkId == \"Observation.language.value\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"language\"\n    assert inst.item[0].item[5].item[1].type == \"choice\"\n    assert inst.item[0].item[5].linkId == \"Observation.language\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"Observation.text\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert (\n        inst.item[0].item[6].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"Observation.contained\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"Observation.extension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Additional Content defined by implementations\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].linkId == \"Observation.modifierExtension\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"Observation\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"FHIR Heart Rate Profile\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == (\n        \"Health Level Seven International (Orders and Observations \" \"Workgroup)\"\n    )\n    assert inst.status == \"draft\"\n\n\ndef test_questionnaire_8(base_settings):\n    \"\"\"No. 8 tests collection for Questionnaire.\n    Test File: questionnaire-heartrate-questionnaire(qs1).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaire-heartrate-questionnaire(qs1).json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_8(inst2)\n\n\ndef impl_questionnaire_9(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].item[1].linkId == \"Composition.id.value\"\n    assert inst.item[0].item[2].item[1].repeats is False\n    assert inst.item[0].item[2].item[1].required is False\n    assert inst.item[0].item[2].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[2].linkId == \"Composition.id\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content may\"\n        \" not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].linkId == \"Composition.meta\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].text == \"Metadata about the resource\"\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"Composition.implicitRules.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert (\n        inst.item[0].item[4].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[4].item[1].type == \"string\"\n    assert inst.item[0].item[4].linkId == \"Composition.implicitRules\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].linkId == \"Composition.language.value\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"language\"\n    assert inst.item[0].item[5].item[1].type == \"choice\"\n    assert inst.item[0].item[5].linkId == \"Composition.language\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"Composition.text\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert (\n        inst.item[0].item[6].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"Composition.contained\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"Composition.extension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Additional Content defined by implementations\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].linkId == \"Composition.modifierExtension\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"Composition\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == (\n        \"A set of resources composed into a single coherent clinical \"\n        \"statement with clinical attestation\"\n    )\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == \"Health Level Seven International (Structured Documents)\"\n    assert inst.status == \"draft\"\n\n\ndef test_questionnaire_9(base_settings):\n    \"\"\"No. 9 tests collection for Questionnaire.\n    Test File: questionnaire-composition-questionnaire(qs1).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaire-composition-questionnaire(qs1).json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_9(inst2)\n\n\ndef impl_questionnaire_10(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert inst.contained[3].id == \"vs5\"\n    assert inst.contained[4].id == \"vs6\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-03-25T00:00:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"qs1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].text == (\n        \"The FHIR Vitals Signs profile sets a minimum expectations \"\n        \"for the Observation Resource to record, search and fetch the\"\n        \" vital signs associated with a patient.\"\n    )\n    assert inst.item[0].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].item[1].linkId == \"Observation.id.value\"\n    assert inst.item[0].item[2].item[1].repeats is False\n    assert inst.item[0].item[2].item[1].required is False\n    assert inst.item[0].item[2].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[2].linkId == \"Observation.id\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content may\"\n        \" not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].linkId == \"Observation.meta\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].text == \"Metadata about the resource\"\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"Observation.implicitRules.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert (\n        inst.item[0].item[4].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[4].item[1].type == \"string\"\n    assert inst.item[0].item[4].linkId == \"Observation.implicitRules\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].linkId == \"Observation.language.value\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"language\"\n    assert inst.item[0].item[5].item[1].type == \"choice\"\n    assert inst.item[0].item[5].linkId == \"Observation.language\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"Observation.text\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert (\n        inst.item[0].item[6].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"Observation.contained\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"Observation.extension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Additional Content defined by implementations\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].linkId == \"Observation.modifierExtension\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"Observation\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"FHIR Vital Signs Profile\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == (\n        \"Health Level Seven International (Orders and Observations \" \"Workgroup)\"\n    )\n    assert inst.status == \"draft\"\n\n\ndef test_questionnaire_10(base_settings):\n    \"\"\"No. 10 tests collection for Questionnaire.\n    Test File: questionnaire-vitalsigns-questionnaire(qs1).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaire-vitalsigns-questionnaire(qs1).json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_10(inst2)\n"
  },
  {
    "path": "fhir/resources/STU3/tests/test_searchparameter.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SearchParameter\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\nfrom .. import searchparameter\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_searchparameter_1(inst):\n    assert inst.code == \"effective\"\n    assert inst.description == \"Optional Extensions Element\"\n    assert inst.experimental is True\n    assert inst.id == \"valueset-extensions-ValueSet-effective\"\n    assert inst.name == \"effective\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"date\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/valueset-extensions-ValueSet-effective\"\n            }\n        ).valueUri\n    )\n    assert inst.xpath == (\n        \"f:ValueSet/f:extension[@url='http://hl7.org/fhir/StructureDe\"\n        \"finition/valueset-effectiveDate'] | /f:#effectiveDate\"\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_1(base_settings):\n    \"\"\"No. 1 tests collection for SearchParameter.\n    Test File: searchparameter-valueset-extensions-ValueSet-effective.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"searchparameter-valueset-extensions-ValueSet-effective.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_1(inst2)\n\n\ndef impl_searchparameter_2(inst):\n    assert inst.base[0] == \"Observation\"\n    assert inst.code == \"dna-variant\"\n    assert inst.description == \"HGVS DNA variant\"\n    assert inst.experimental is True\n    assert inst.id == \"observation-genetic-Observation-dna-variant\"\n    assert inst.name == \"dna-variant\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"string\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/observation-genetic-Observation-dna-variant\"\n            }\n        ).valueUri\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_2(base_settings):\n    \"\"\"No. 2 tests collection for SearchParameter.\n    Test File: searchparameter-observation-genetic-Observation-dna-variant.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"searchparameter-observation-genetic-Observation-dna-variant.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_2(inst2)\n\n\ndef impl_searchparameter_3(inst):\n    assert inst.base[0] == \"Observation\"\n    assert inst.code == \"gene-dnavariant\"\n    assert inst.description == \"HGNC gene symbol and HGVS DNA Variant\"\n    assert inst.experimental is True\n    assert inst.id == \"observation-genetic-Observation-gene-dnavariant\"\n    assert inst.name == \"gene-dnavariant\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"string\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/observation-genetic-Observation-gene-dnavariant\"\n            }\n        ).valueUri\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_3(base_settings):\n    \"\"\"No. 3 tests collection for SearchParameter.\n    Test File: searchparameter-observation-genetic-Observation-gene-dnavariant.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"searchparameter-observation-genetic-Observation-gene-dnavariant.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_3(inst2)\n\n\ndef impl_searchparameter_4(inst):\n    assert inst.code == \"alias\"\n    assert inst.description == \"Include Locations that contain the provided alias\"\n    assert inst.experimental is True\n    assert inst.id == \"location-extensions-Location-alias\"\n    assert inst.name == \"alias\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"string\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/location-extensions-Location-alias\"\n            }\n        ).valueUri\n    )\n    assert inst.xpath == (\n        \"f:Location/f:extension[@url='http://hl7.org/fhir/StructureDe\"\n        \"finition/location-alias'] | /f:#alias\"\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_4(base_settings):\n    \"\"\"No. 4 tests collection for SearchParameter.\n    Test File: searchparameter-location-extensions-Location-alias.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"searchparameter-location-extensions-Location-alias.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_4(inst2)\n\n\ndef impl_searchparameter_5(inst):\n    assert inst.base[0] == \"Condition\"\n    assert inst.code == \"definition\"\n    assert inst.description == \"Matches on the definition extension value\"\n    assert inst.experimental is True\n    assert inst.id == \"condition-extensions-Condition-definition\"\n    assert inst.name == \"definition\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"reference\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/condition-extensions-Condition-definition\"\n            }\n        ).valueUri\n    )\n    assert inst.xpath == (\n        \"f:Condition/f:extension[@url='http://hl7.org/fhir/StructureD\"\n        \"efinition/condition-definition'] | f:Condition/f:extension[@\"\n        \"url='http://hl7.org/fhir/StructureDefinition/condition-\"\n        \"definition']\"\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_5(base_settings):\n    \"\"\"No. 5 tests collection for SearchParameter.\n    Test File: searchparameter-condition-extensions-Condition-definition.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"searchparameter-condition-extensions-Condition-definition.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_5(inst2)\n\n\ndef impl_searchparameter_6(inst):\n    assert inst.code == \"author\"\n    assert inst.description == \"Optional Extensions Element\"\n    assert inst.experimental is True\n    assert inst.id == \"codesystem-extensions-CodeSystem-author\"\n    assert inst.name == \"author\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"string\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/codesystem-extensions-CodeSystem-author\"\n            }\n        ).valueUri\n    )\n    assert inst.xpath == (\n        \"f:CodeSystem/f:extension[@url='http://hl7.org/fhir/Structure\"\n        \"Definition/codesystem-author'] | /f:#author\"\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_6(base_settings):\n    \"\"\"No. 6 tests collection for SearchParameter.\n    Test File: searchparameter-codesystem-extensions-CodeSystem-author.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"searchparameter-codesystem-extensions-CodeSystem-author.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_6(inst2)\n\n\ndef impl_searchparameter_7(inst):\n    assert inst.code == \"end\"\n    assert inst.description == \"Optional Extensions Element\"\n    assert inst.experimental is True\n    assert inst.id == \"codesystem-extensions-CodeSystem-end\"\n    assert inst.name == \"end\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"date\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/codesystem-extensions-CodeSystem-end\"\n            }\n        ).valueUri\n    )\n    assert inst.xpath == (\n        \"f:CodeSystem/f:extension[@url='http://hl7.org/fhir/Structure\"\n        \"Definition/codesystem-expirationDate'] | /f:#expirationDate\"\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_7(base_settings):\n    \"\"\"No. 7 tests collection for SearchParameter.\n    Test File: searchparameter-codesystem-extensions-CodeSystem-end.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"searchparameter-codesystem-extensions-CodeSystem-end.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_7(inst2)\n\n\ndef impl_searchparameter_8(inst):\n    assert inst.code == \"effective\"\n    assert inst.description == \"Optional Extensions Element\"\n    assert inst.experimental is True\n    assert inst.id == \"codesystem-extensions-CodeSystem-effective\"\n    assert inst.name == \"effective\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"date\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/codesystem-extensions-CodeSystem-effective\"\n            }\n        ).valueUri\n    )\n    assert inst.xpath == (\n        \"f:CodeSystem/f:extension[@url='http://hl7.org/fhir/Structure\"\n        \"Definition/codesystem-effectiveDate'] | /f:#effectiveDate\"\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_8(base_settings):\n    \"\"\"No. 8 tests collection for SearchParameter.\n    Test File: searchparameter-codesystem-extensions-CodeSystem-effective.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"searchparameter-codesystem-extensions-CodeSystem-effective.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_8(inst2)\n\n\ndef impl_searchparameter_9(inst):\n    assert inst.base[0] == \"Observation\"\n    assert inst.code == \"amino-acid-change\"\n    assert inst.description == \"HGVS Protein Change\"\n    assert inst.experimental is True\n    assert inst.id == \"observation-genetic-Observation-amino-acid-change\"\n    assert inst.name == \"amino-acid-change\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"string\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/observation-genetic-Observation-amino-acid-change\"\n            }\n        ).valueUri\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_9(base_settings):\n    \"\"\"No. 9 tests collection for SearchParameter.\n    Test File: searchparameter-observation-genetic-Observation-amino-acid-change.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"searchparameter-observation-genetic-Observation-amino-acid-change.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_9(inst2)\n\n\ndef impl_searchparameter_10(inst):\n    assert inst.base[0] == \"DiagnosticReport\"\n    assert inst.code == \"assessed-condition\"\n    assert inst.description == \"Condition assessed by genetic test\"\n    assert inst.experimental is True\n    assert inst.id == \"diagnosticreport-genetic-DiagnosticReport-assessed-condition\"\n    assert inst.name == \"assessed-condition\"\n    assert inst.status == \"draft\"\n    assert inst.type == \"reference\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/SearchParameter/diagnosticreport-genetic-DiagnosticReport-assessed-condition\"\n            }\n        ).valueUri\n    )\n    assert inst.xpathUsage == \"normal\"\n\n\ndef test_searchparameter_10(base_settings):\n    \"\"\"No. 10 tests collection for SearchParameter.\n    Test File: searchparameter-diagnosticreport-genetic-DiagnosticReport-assessed-condition.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"searchparameter-diagnosticreport-genetic-DiagnosticReport-assessed-condition.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_10(inst2)\n"
  },
  {
    "path": "fhir/resources/STU3/tests/test_valueset.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ValueSet\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\nfrom .. import valueset\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_valueset_1(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/message-reasons-encounter\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Example Message Reasons. These are the set of codes that \"\n        \"might be used an updating an encounter using admin-update.\"\n    )\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 1\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"inm\"\n    assert inst.id == \"message-reason-encounter\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.365\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"}\n        ).valueUri\n    )\n    assert inst.name == \"Example Message Reason Codes\"\n    assert inst.publisher == \"FHIR Project\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/message-reason-encounter\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_valueset_1(base_settings):\n    \"\"\"No. 1 tests collection for ValueSet.\n    Test File: valueset-valueset-message-reason-encounter(message-reason-encounter).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-valueset-message-reason-encounter(message-reason-encounter).json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_1(inst2)\n\n\ndef impl_valueset_2(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/implant-status\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"A set codes that define the functional status of an \" \"implanted device.\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 0\n    assert inst.id == \"implant-status\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.865\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"}\n        ).valueUri\n    )\n    assert inst.name == \"Implant Status\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/implant-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_valueset_2(base_settings):\n    \"\"\"No. 2 tests collection for ValueSet.\n    Test File: valueset-valueset-implant-status(implant-status).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-valueset-implant-status(implant-status).json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_2(inst2)\n\n\ndef impl_valueset_3(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/action-selection-behavior\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Defines selection behavior of a group\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 2\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"cds\"\n    assert inst.id == \"action-selection-behavior\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.784\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"}\n        ).valueUri\n    )\n    assert inst.name == \"ActionSelectionBehavior\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/action-selection-behavior\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_valueset_3(base_settings):\n    \"\"\"No. 3 tests collection for ValueSet.\n    Test File: valueset-valueset-action-selection-behavior(action-selection-behavior).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-valueset-action-selection-behavior(action-selection-behavior).json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_3(inst2)\n\n\ndef impl_valueset_4(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/search-param-type\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Data types allowed to be used for search parameters.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 4\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"fhir\"\n    assert inst.id == \"search-param-type\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.11\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"}\n        ).valueUri\n    )\n    assert inst.name == \"SearchParamType\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/search-param-type\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_valueset_4(base_settings):\n    \"\"\"No. 4 tests collection for ValueSet.\n    Test File: valueset-valueset-search-param-type(search-param-type).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-valueset-search-param-type(search-param-type).json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_4(inst2)\n\n\ndef impl_valueset_5(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.copyright == (\n        \"This content from LOINC® is copyright © 1995 Regenstrief \"\n        \"Institute, Inc. and the LOINC Committee, and available at no\"\n        \" cost under the license at http://loinc.org/terms-of-use.\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This value set includes all the LOINC codes which relate to \"\n        \"Diagnostic Observations.\"\n    )\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 3\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"oo\"\n    assert inst.id == \"report-codes\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.228\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"}\n        ).valueUri\n    )\n    assert inst.name == \"LOINC Diagnostic Report Codes\"\n    assert inst.publisher == \"FHIR Project team\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/report-codes\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_valueset_5(base_settings):\n    \"\"\"No. 5 tests collection for ValueSet.\n    Test File: valueset-valueset-report-codes(report-codes).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-valueset-report-codes(report-codes).json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_5(inst2)\n\n\ndef impl_valueset_6(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/observation-relationshiptypes\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Codes specifying how two observations are related.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 5\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"oo\"\n    assert inst.id == \"observation-relationshiptypes\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.389\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"}\n        ).valueUri\n    )\n    assert inst.name == \"ObservationRelationshipType\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/observation-relationshiptypes\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_valueset_6(base_settings):\n    \"\"\"No. 6 tests collection for ValueSet.\n    Test File: valueset-valueset-observation-relationshiptypes(observation-relationshiptypes).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-valueset-observation-relationshiptypes(observation-relationshiptypes).json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_6(inst2)\n\n\ndef impl_valueset_7(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/bundle-type\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Indicates the purpose of a bundle - how it was intended to \" \"be used.\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 5\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"fhir\"\n    assert inst.id == \"bundle-type\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.612\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"}\n        ).valueUri\n    )\n    assert inst.name == \"BundleType\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/bundle-type\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_valueset_7(base_settings):\n    \"\"\"No. 7 tests collection for ValueSet.\n    Test File: valueset-valueset-bundle-type(bundle-type).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-valueset-bundle-type(bundle-type).json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_7(inst2)\n\n\ndef impl_valueset_8(inst):\n    assert inst.compose.include[0].filter[0].op == \"is-a\"\n    assert inst.compose.include[0].filter[0].property == \"concept\"\n    assert inst.compose.include[0].filter[0].value == \"_ActAccountCode\"\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/v3/ActCode\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This examples value set defines the set of codes that can be\"\n        \" used to represent the type of an account.\"\n    )\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 1\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"pa\"\n    assert inst.id == \"account-type\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.716\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"}\n        ).valueUri\n    )\n    assert inst.name == \"Account Types\"\n    assert inst.publisher == \"FHIR Project team\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/account-type\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_valueset_8(base_settings):\n    \"\"\"No. 8 tests collection for ValueSet.\n    Test File: valueset-valueset-account-type(account-type).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-valueset-account-type(account-type).json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_8(inst2)\n\n\ndef impl_valueset_9(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/testscript-operation-codes\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This value set defines a set of codes that are used to \"\n        \"indicate the supported operations of a testing engine or \"\n        \"tool.\"\n    )\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 2\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"fhir\"\n    assert inst.id == \"testscript-operation-codes\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.690\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestScriptOperationCode\"\n    assert inst.publisher == \"FHIR Project team\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/testscript-operation-codes\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_valueset_9(base_settings):\n    \"\"\"No. 9 tests collection for ValueSet.\n    Test File: valueset-valueset-testscript-operation-codes(testscript-operation-codes).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-valueset-testscript-operation-codes(testscript-operation-codes).json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_9(inst2)\n\n\ndef impl_valueset_10(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.hl7.org/fhir/contractsignertypecodes\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.description == \"This value set includes sample Contract Signer Type codes.\"\n    )\n    assert inst.experimental is True\n    assert inst.extensible is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-ballot-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Informative\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueInteger == 1\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"fm\"\n    assert inst.id == \"contract-signer-type\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.725\"\n    assert inst.immutable is True\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-10-24T11:53:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"}\n        ).valueUri\n    )\n    assert inst.name == \"Contract Signer Type Codes\"\n    assert inst.publisher == \"Financial Management\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/contract-signer-type\"}\n        ).valueUri\n    )\n    assert inst.version == \"3.0.2\"\n\n\ndef test_valueset_10(base_settings):\n    \"\"\"No. 10 tests collection for ValueSet.\n    Test File: valueset-valueset-contract-signer-type(contract-signer-type).json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-valueset-contract-signer-type(contract-signer-type).json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_10(inst2)\n"
  },
  {
    "path": "fhir/resources/STU3/testscript.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TestScript\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass TestScript(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes a set of tests.\n    A structured set of tests against a FHIR server implementation to determine\n    compliance against the FHIR specification.\n    \"\"\"\n\n    __resource_type__ = \"TestScript\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the test script and/or its contents.\"\n            \" Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the test script.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the test script was published. \"\n            \"The date must change if and when the business version changes and it \"\n            \"must change if the status code changes. In addition, it should change \"\n            \"when the substantive content of the test script changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the test script\",\n        description=(\n            \"A free text natural language description of the test script from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    destination: typing.List[fhirtypes.TestScriptDestinationType] | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=(\n            \"An abstract server representing a destination or receiver in a message\"\n            \" exchange\"\n        ),\n        description=(\n            \"An abstract server used in operations within this test script in the \"\n            \"destination element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this test script is authored for \"\n            \"testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fixture: typing.List[fhirtypes.TestScriptFixtureType] | None = Field(\n        default=None,\n        alias=\"fixture\",\n        title=\"Fixture in the test script - by reference (uri)\",\n        description=(\n            \"Fixture in the test script - by reference (uri). All fixtures are \"\n            \"required for the test script to execute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the test script\",\n        description=(\n            \"A formal identifier that is used to identify this test script when it \"\n            \"is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for test script (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the test script is intended to \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    metadata: fhirtypes.TestScriptMetadataType | None = Field(\n        default=None,\n        alias=\"metadata\",\n        title=(\n            \"Required capability that is assumed to function correctly on the FHIR \"\n            \"server being tested\"\n        ),\n        description=(\n            \"The required capability must exist and are assumed to function \"\n            \"correctly on the FHIR server being tested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this test script (computer friendly)\",\n        description=(\n            \"A natural language name identifying the test script. This name should \"\n            \"be usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    origin: typing.List[fhirtypes.TestScriptOriginType] | None = Field(\n        default=None,\n        alias=\"origin\",\n        title=(\n            \"An abstract server representing a client or sender in a message \"\n            \"exchange\"\n        ),\n        description=(\n            \"An abstract server used in operations within this test script in the \"\n            \"origin element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    profile: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Reference of the validation profile\",\n        description=\"Reference to the profile to be used for validation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the test \"\n            \"script.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this test script is defined\",\n        description=(\n            \"Explaination of why this test script is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    rule: typing.List[fhirtypes.TestScriptRuleType] | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"Assert rule used within the test script\",\n        description=\"Assert rule to be used in one or more asserts within the test script.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    ruleset: typing.List[fhirtypes.TestScriptRulesetType] | None = Field(\n        default=None,\n        alias=\"ruleset\",\n        title=\"Assert ruleset used within the test script\",\n        description=(\n            \"Contains one or more rules.  Offers a way to group rules so assertions\"\n            \" could reference the group of rules and have them all applied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    setup: fhirtypes.TestScriptSetupType | None = Field(\n        default=None,\n        alias=\"setup\",\n        title=\"A series of required setup operations before tests are executed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this test script. Enables tracking the life-cycle of the\"\n            \" content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    teardown: fhirtypes.TestScriptTeardownType | None = Field(\n        default=None,\n        alias=\"teardown\",\n        title=\"A series of required clean up steps\",\n        description=(\n            \"A series of operations required to clean up after the all the tests \"\n            \"are executed (successfully or otherwise).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    test: typing.List[fhirtypes.TestScriptTestType] | None = Field(\n        default=None,\n        alias=\"test\",\n        title=\"A test in this script\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this test script (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the test script.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this test script (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this test script when it is \"\n            \"referenced in a specification, model, design or an instance. This \"\n            \"SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at\"\n            \" which this test script is (or will be) published. The URL SHOULD \"\n            \"include the major version of the test script. For more information see\"\n            \" [Technical and Business Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate test script instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    variable: typing.List[fhirtypes.TestScriptVariableType] | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"Placeholder for evaluated elements\",\n        description=(\n            \"Variable is set based either on element value in response body or on \"\n            \"header field value in the response headers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the test script\",\n        description=(\n            \"The identifier that is used to identify this version of the test \"\n            \"script when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the test script author\"\n            \" and is not expected to be globally unique. For example, it might be a\"\n            \" timestamp (e.g. yyyymmdd) if a managed version is not available. \"\n            \"There is also no expectation that versions can be placed in a \"\n            \"lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScript`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"origin\",\n            \"destination\",\n            \"metadata\",\n            \"fixture\",\n            \"profile\",\n            \"variable\",\n            \"rule\",\n            \"ruleset\",\n            \"setup\",\n            \"test\",\n            \"teardown\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScript`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n\nclass TestScriptDestination(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An abstract server representing a destination or receiver in a message\n    exchange.\n    An abstract server used in operations within this test script in the\n    destination element.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptDestination\"\n\n    index: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"index\",\n        title=\"The index of the abstract destination server starting at 1\",\n        description=(\n            \"Abstract name given to a destination server in this test script.  The \"\n            \"name is provided as a number starting at 1.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    index__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_index\", title=\"Extension field for ``index``.\"\n    )\n\n    profile: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"profile\",\n        title=(\n            \"FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-\"\n            \"FormProcessor\"\n        ),\n        description=\"The type of destination profile the test system supports.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptDestination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"index\", \"profile\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptDestination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"index\", \"index__ext\")]\n        return required_fields\n\n\nclass TestScriptFixture(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Fixture in the test script - by reference (uri).\n    Fixture in the test script - by reference (uri). All fixtures are required\n    for the test script to execute.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptFixture\"\n\n    autocreate: bool | None = Field(\n        default=None,\n        alias=\"autocreate\",\n        title=\"Whether or not to implicitly create the fixture during setup\",\n        description=(\n            \"Whether or not to implicitly create the fixture during setup. If true,\"\n            \" the fixture is automatically created on each server being tested \"\n            \"during setup, therefore no create operation is required for this \"\n            \"fixture in the TestScript.setup section.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    autocreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_autocreate\", title=\"Extension field for ``autocreate``.\"\n    )\n\n    autodelete: bool | None = Field(\n        default=None,\n        alias=\"autodelete\",\n        title=\"Whether or not to implicitly delete the fixture during teardown\",\n        description=(\n            \"Whether or not to implicitly delete the fixture during teardown. If \"\n            \"true, the fixture is automatically deleted on each server being tested\"\n            \" during teardown, therefore no delete operation is required for this \"\n            \"fixture in the TestScript.teardown section.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    autodelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_autodelete\", title=\"Extension field for ``autodelete``.\"\n    )\n\n    resource: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Reference of the resource\",\n        description=(\n            \"Reference to the resource (containing the contents of the resource \"\n            \"needed for operations).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptFixture`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"autocreate\",\n            \"autodelete\",\n            \"resource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptFixture`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptMetadata(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Required capability that is assumed to function correctly on the FHIR\n    server being tested.\n    The required capability must exist and are assumed to function correctly on\n    the FHIR server being tested.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptMetadata\"\n\n    capability: typing.List[fhirtypes.TestScriptMetadataCapabilityType] = Field(\n        default=...,\n        alias=\"capability\",\n        title=(\n            \"Capabilities  that are assumed to function correctly on the FHIR \"\n            \"server being tested\"\n        ),\n        description=(\n            \"Capabilities that must exist and are assumed to function correctly on \"\n            \"the FHIR server being tested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.TestScriptMetadataLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links to the FHIR specification\",\n        description=\"A link to the FHIR specification that this test is covering.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptMetadata`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"link\", \"capability\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptMetadata`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptMetadataCapability(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Capabilities  that are assumed to function correctly on the FHIR server\n    being tested.\n    Capabilities that must exist and are assumed to function correctly on the\n    FHIR server being tested.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptMetadataCapability\"\n\n    capabilities: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"capabilities\",\n        title=\"Required Capability Statement\",\n        description=(\n            \"Minimum capabilities required of server for test script to execute \"\n            \"successfully.   If server does not meet at a minimum the referenced \"\n            \"capability statement, then all tests in this script are skipped.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The expected capabilities of the server\",\n        description=(\n            \"Description of the capabilities that this test script is requiring the\"\n            \" server to support.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    destination: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Which server these requirements apply to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    destination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_destination\", title=\"Extension field for ``destination``.\"\n    )\n\n    link: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links to the FHIR specification\",\n        description=(\n            \"Links to the FHIR specification that describes this interaction and \"\n            \"the resources involved in more detail.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    link__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_link\", title=\"Extension field for ``link``.\"\n    )\n\n    origin: typing.List[fhirtypes.IntegerType | None] | None = Field(\n        default=None,\n        alias=\"origin\",\n        title=\"Which origin server these requirements apply to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    origin__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_origin\", title=\"Extension field for ``origin``.\"\n    )\n\n    required: bool | None = Field(\n        default=None,\n        alias=\"required\",\n        title=\"Are the capabilities required?\",\n        description=(\n            \"Whether or not the test execution will require the given capabilities \"\n            \"of the server in order for this test script to execute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_required\", title=\"Extension field for ``required``.\"\n    )\n\n    validated: bool | None = Field(\n        default=None,\n        alias=\"validated\",\n        title=\"Are the capabilities validated?\",\n        description=(\n            \"Whether or not the test execution will validate the given capabilities\"\n            \" of the server in order for this test script to execute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    validated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_validated\", title=\"Extension field for ``validated``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptMetadataCapability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"required\",\n            \"validated\",\n            \"description\",\n            \"origin\",\n            \"destination\",\n            \"link\",\n            \"capabilities\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptMetadataCapability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptMetadataLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links to the FHIR specification.\n    A link to the FHIR specification that this test is covering.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptMetadataLink\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Short description\",\n        description=\"Short description of the link.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"URL to the specification\",\n        description=(\n            \"URL to a particular requirement or feature within the FHIR \"\n            \"specification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptMetadataLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"url\", \"description\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptMetadataLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"url\", \"url__ext\")]\n        return required_fields\n\n\nclass TestScriptOrigin(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An abstract server representing a client or sender in a message exchange.\n    An abstract server used in operations within this test script in the origin\n    element.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptOrigin\"\n\n    index: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"index\",\n        title=\"The index of the abstract origin server starting at 1\",\n        description=(\n            \"Abstract name given to an origin server in this test script.  The name\"\n            \" is provided as a number starting at 1.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    index__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_index\", title=\"Extension field for ``index``.\"\n    )\n\n    profile: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"profile\",\n        title=\"FHIR-Client | FHIR-SDC-FormFiller\",\n        description=\"The type of origin profile the test system supports.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptOrigin`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"index\", \"profile\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptOrigin`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"index\", \"index__ext\")]\n        return required_fields\n\n\nclass TestScriptRule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Assert rule used within the test script.\n    Assert rule to be used in one or more asserts within the test script.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptRule\"\n\n    param: typing.List[fhirtypes.TestScriptRuleParamType] | None = Field(\n        default=None,\n        alias=\"param\",\n        title=\"Rule parameter template\",\n        description=(\n            \"Each rule template can take one or more parameters for rule \" \"evaluation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"resource\",\n        title=\"Assert rule resource reference\",\n        description=(\n            \"Reference to the resource (containing the contents of the rule needed \"\n            \"for assertions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"resource\", \"param\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptRuleParam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Rule parameter template.\n    Each rule template can take one or more parameters for rule evaluation.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptRuleParam\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Parameter name matching external assert rule parameter\",\n        description=(\n            \"Descriptive name for this parameter that matches the external assert \"\n            \"rule parameter name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Parameter value defined either explicitly or dynamically\",\n        description=(\n            \"The explicit or dynamic value for the parameter that will be passed on\"\n            \" to the external rule template.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptRuleParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptRuleParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass TestScriptRuleset(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Assert ruleset used within the test script.\n    Contains one or more rules.  Offers a way to group rules so assertions\n    could reference the group of rules and have them all applied.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptRuleset\"\n\n    resource: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"resource\",\n        title=\"Assert ruleset resource reference\",\n        description=(\n            \"Reference to the resource (containing the contents of the ruleset \"\n            \"needed for assertions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    rule: typing.List[fhirtypes.TestScriptRulesetRuleType] = Field(\n        default=...,\n        alias=\"rule\",\n        title=\"The referenced rule within the ruleset\",\n        description=\"The referenced rule within the external ruleset template.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptRuleset`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"resource\", \"rule\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptRuleset`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptRulesetRule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The referenced rule within the ruleset.\n    The referenced rule within the external ruleset template.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptRulesetRule\"\n\n    param: typing.List[fhirtypes.TestScriptRulesetRuleParamType] | None = Field(\n        default=None,\n        alias=\"param\",\n        title=\"Ruleset rule parameter template\",\n        description=(\n            \"Each rule template can take one or more parameters for rule \" \"evaluation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    ruleId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"ruleId\",\n        title=\"Id of referenced rule within the ruleset\",\n        description=\"Id of the referenced rule within the external ruleset template.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    ruleId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ruleId\", title=\"Extension field for ``ruleId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptRulesetRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"ruleId\", \"param\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptRulesetRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"ruleId\", \"ruleId__ext\")]\n        return required_fields\n\n\nclass TestScriptRulesetRuleParam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Ruleset rule parameter template.\n    Each rule template can take one or more parameters for rule evaluation.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptRulesetRuleParam\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Parameter name matching external assert ruleset rule parameter\",\n        description=(\n            \"Descriptive name for this parameter that matches the external assert \"\n            \"ruleset rule parameter name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Parameter value defined either explicitly or dynamically\",\n        description=(\n            \"The value for the parameter that will be passed on to the external \"\n            \"ruleset rule template.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptRulesetRuleParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptRulesetRuleParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass TestScriptSetup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A series of required setup operations before tests are executed.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetup\"\n\n    action: typing.List[fhirtypes.TestScriptSetupActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"A setup operation or assert to perform\",\n        description=\"Action would contain either an operation or an assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptSetupAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A setup operation or assert to perform.\n    Action would contain either an operation or an assertion.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupAction\"\n\n    assert_fhir: fhirtypes.TestScriptSetupActionAssertType | None = Field(\n        default=None,\n        alias=\"assert\",\n        title=\"The assertion to perform\",\n        description=(\n            \"Evaluates the results of previous operations to determine if the \"\n            \"server under test behaves appropriately.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.TestScriptSetupActionOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"The setup operation to perform\",\n        description=\"The operation to perform.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\", \"assert\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptSetupActionAssert(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The assertion to perform.\n    Evaluates the results of previous operations to determine if the server\n    under test behaves appropriately.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionAssert\"\n\n    compareToSourceExpression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"compareToSourceExpression\",\n        title=\"The fluentpath expression to evaluate against the source fixture\",\n        description=(\n            \"The fluentpath expression to evaluate against the source fixture. When\"\n            \" compareToSourceId is defined, either compareToSourceExpression or \"\n            \"compareToSourcePath must be defined, but not both.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    compareToSourceExpression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compareToSourceExpression\",\n        title=\"Extension field for ``compareToSourceExpression``.\",\n    )\n\n    compareToSourceId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"compareToSourceId\",\n        title=\"Id of the source fixture to be evaluated\",\n        description=(\n            \"Id of the source fixture used as the contents to be evaluated by \"\n            'either the \"source/expression\" or \"sourceId/path\" definition.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    compareToSourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compareToSourceId\",\n        title=\"Extension field for ``compareToSourceId``.\",\n    )\n\n    compareToSourcePath: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"compareToSourcePath\",\n        title=\"XPath or JSONPath expression to evaluate against the source fixture\",\n        description=(\n            \"XPath or JSONPath expression to evaluate against the source fixture. \"\n            \"When compareToSourceId is defined, either compareToSourceExpression or\"\n            \" compareToSourcePath must be defined, but not both.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    compareToSourcePath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compareToSourcePath\",\n        title=\"Extension field for ``compareToSourcePath``.\",\n    )\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"xml | json | ttl | none\",\n        description=(\n            \"The content-type or mime-type to use for RESTful operation in the \"\n            \"'Content-Type' header.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"xml\", \"json\", \"ttl\", \"none\"],\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Tracking/reporting assertion description\",\n        description=(\n            \"The description would be used by test engines for tracking and \"\n            \"reporting purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    direction: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"direction\",\n        title=\"response | request\",\n        description=\"The direction to use for the assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"response\", \"request\"],\n        },\n    )\n    direction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_direction\", title=\"Extension field for ``direction``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"The fluentpath expression to be evaluated\",\n        description=(\n            \"The fluentpath expression to be evaluated against the request or \"\n            \"response message contents - HTTP headers and payload.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    headerField: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"headerField\",\n        title=\"HTTP header field name\",\n        description=\"The HTTP header field name e.g. 'Location'.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    headerField__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_headerField\", title=\"Extension field for ``headerField``.\"\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Tracking/logging assertion label\",\n        description=\"The label would be used for tracking/logging purposes by test engines.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    minimumId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"minimumId\",\n        title=\"Fixture Id of minimum content resource\",\n        description=(\n            \"The ID of a fixture.  Asserts that the response contains at a minimum \"\n            \"the fixture specified by minimumId.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    minimumId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_minimumId\", title=\"Extension field for ``minimumId``.\"\n    )\n\n    navigationLinks: bool | None = Field(\n        default=None,\n        alias=\"navigationLinks\",\n        title=\"Perform validation on navigation links?\",\n        description=(\n            \"Whether or not the test execution performs validation on the bundle \"\n            \"navigation links.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    navigationLinks__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_navigationLinks\",\n        title=\"Extension field for ``navigationLinks``.\",\n    )\n\n    operator: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"operator\",\n        title=(\n            \"equals | notEquals | in | notIn | greaterThan | lessThan | empty | \"\n            \"notEmpty | contains | notContains | eval\"\n        ),\n        description=(\n            \"The operator type defines the conditional behavior of the assert. If \"\n            \"not defined, the default is equals.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"equals\",\n                \"notEquals\",\n                \"in\",\n                \"notIn\",\n                \"greaterThan\",\n                \"lessThan\",\n                \"empty\",\n                \"notEmpty\",\n                \"contains\",\n                \"notContains\",\n                \"eval\",\n            ],\n        },\n    )\n    operator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_operator\", title=\"Extension field for ``operator``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"XPath or JSONPath expression\",\n        description=(\n            \"The XPath or JSONPath expression to be evaluated against the fixture \"\n            \"representing the response received from server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    requestMethod: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"requestMethod\",\n        title=\"delete | get | options | patch | post | put\",\n        description=(\n            \"The request method or HTTP operation code to compare against that used\"\n            \" by the client system under test.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"delete\", \"get\", \"options\", \"patch\", \"post\", \"put\"],\n        },\n    )\n    requestMethod__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requestMethod\",\n        title=\"Extension field for ``requestMethod``.\",\n    )\n\n    requestURL: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"requestURL\",\n        title=\"Request URL comparison value\",\n        description=\"The value to use in a comparison against the request URL path string.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    requestURL__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requestURL\", title=\"Extension field for ``requestURL``.\"\n    )\n\n    resource: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Resource type\",\n        description=(\n            \"The type of the resource.  See \"\n            \"http://hl7.org/fhir/STU3/resourcelist.html.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    response: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=(\n            \"okay | created | noContent | notModified | bad | forbidden | notFound \"\n            \"| methodNotAllowed | conflict | gone | preconditionFailed | \"\n            \"unprocessable\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"okay\",\n                \"created\",\n                \"noContent\",\n                \"notModified\",\n                \"bad\",\n                \"forbidden\",\n                \"notFound\",\n                \"methodNotAllowed\",\n                \"conflict\",\n                \"gone\",\n                \"preconditionFailed\",\n                \"unprocessable\",\n            ],\n        },\n    )\n    response__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_response\", title=\"Extension field for ``response``.\"\n    )\n\n    responseCode: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"responseCode\",\n        title=\"HTTP response code to test\",\n        description=\"The value of the HTTP response code to be tested.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responseCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_responseCode\",\n        title=\"Extension field for ``responseCode``.\",\n    )\n\n    rule: fhirtypes.TestScriptSetupActionAssertRuleType | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"The reference to a TestScript.rule\",\n        description=\"The TestScript.rule this assert will evaluate.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    ruleset: fhirtypes.TestScriptSetupActionAssertRulesetType | None = Field(\n        default=None,\n        alias=\"ruleset\",\n        title=\"The reference to a TestScript.ruleset\",\n        description=\"The TestScript.ruleset this assert will evaluate.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sourceId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"sourceId\",\n        title=\"Fixture Id of source expression or headerField\",\n        description=(\n            \"Fixture to evaluate the XPath/JSONPath expression or the headerField  \"\n            \"against.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceId\", title=\"Extension field for ``sourceId``.\"\n    )\n\n    validateProfileId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"validateProfileId\",\n        title=\"Profile Id of validation profile reference\",\n        description=\"The ID of the Profile to validate against.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    validateProfileId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_validateProfileId\",\n        title=\"Extension field for ``validateProfileId``.\",\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The value to compare to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    warningOnly: bool | None = Field(\n        default=None,\n        alias=\"warningOnly\",\n        title=\"Will this assert produce a warning only on error?\",\n        description=(\n            \"Whether or not the test execution will produce a warning only on error\"\n            \" for this assert.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    warningOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_warningOnly\", title=\"Extension field for ``warningOnly``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionAssert`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"label\",\n            \"description\",\n            \"direction\",\n            \"compareToSourceId\",\n            \"compareToSourceExpression\",\n            \"compareToSourcePath\",\n            \"contentType\",\n            \"expression\",\n            \"headerField\",\n            \"minimumId\",\n            \"navigationLinks\",\n            \"operator\",\n            \"path\",\n            \"requestMethod\",\n            \"requestURL\",\n            \"resource\",\n            \"response\",\n            \"responseCode\",\n            \"rule\",\n            \"ruleset\",\n            \"sourceId\",\n            \"validateProfileId\",\n            \"value\",\n            \"warningOnly\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssert`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptSetupActionAssertRule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The reference to a TestScript.rule.\n    The TestScript.rule this assert will evaluate.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionAssertRule\"\n\n    param: typing.List[\n        fhirtypes.TestScriptSetupActionAssertRuleParamType\n    ] | None = Field(\n        default=None,\n        alias=\"param\",\n        title=\"Rule parameter template\",\n        description=(\n            \"Each rule template can take one or more parameters for rule \" \"evaluation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    ruleId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"ruleId\",\n        title=\"Id of the TestScript.rule\",\n        description=\"The TestScript.rule id value this assert will evaluate.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    ruleId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ruleId\", title=\"Extension field for ``ruleId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionAssertRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"ruleId\", \"param\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssertRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"ruleId\", \"ruleId__ext\")]\n        return required_fields\n\n\nclass TestScriptSetupActionAssertRuleParam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Rule parameter template.\n    Each rule template can take one or more parameters for rule evaluation.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionAssertRuleParam\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Parameter name matching external assert rule parameter\",\n        description=(\n            \"Descriptive name for this parameter that matches the external assert \"\n            \"rule parameter name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Parameter value defined either explicitly or dynamically\",\n        description=(\n            \"The value for the parameter that will be passed on to the external \"\n            \"rule template.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionAssertRuleParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssertRuleParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass TestScriptSetupActionAssertRuleset(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The reference to a TestScript.ruleset.\n    The TestScript.ruleset this assert will evaluate.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionAssertRuleset\"\n\n    rule: typing.List[\n        fhirtypes.TestScriptSetupActionAssertRulesetRuleType\n    ] | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"The referenced rule within the ruleset\",\n        description=\"The referenced rule within the external ruleset template.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rulesetId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"rulesetId\",\n        title=\"Id of the TestScript.ruleset\",\n        description=\"The TestScript.ruleset id value this assert will evaluate.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    rulesetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rulesetId\", title=\"Extension field for ``rulesetId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionAssertRuleset`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"rulesetId\", \"rule\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssertRuleset`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"rulesetId\", \"rulesetId__ext\")]\n        return required_fields\n\n\nclass TestScriptSetupActionAssertRulesetRule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The referenced rule within the ruleset.\n    The referenced rule within the external ruleset template.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionAssertRulesetRule\"\n\n    param: typing.List[\n        fhirtypes.TestScriptSetupActionAssertRulesetRuleParamType\n    ] | None = Field(\n        default=None,\n        alias=\"param\",\n        title=\"Rule parameter template\",\n        description=(\n            \"Each rule template can take one or more parameters for rule \" \"evaluation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    ruleId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"ruleId\",\n        title=\"Id of referenced rule within the ruleset\",\n        description=\"Id of the referenced rule within the external ruleset template.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    ruleId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ruleId\", title=\"Extension field for ``ruleId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionAssertRulesetRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"ruleId\", \"param\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssertRulesetRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"ruleId\", \"ruleId__ext\")]\n        return required_fields\n\n\nclass TestScriptSetupActionAssertRulesetRuleParam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Rule parameter template.\n    Each rule template can take one or more parameters for rule evaluation.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionAssertRulesetRuleParam\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Parameter name matching external assert ruleset rule parameter\",\n        description=(\n            \"Descriptive name for this parameter that matches the external assert \"\n            \"ruleset rule parameter name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Parameter value defined either explicitly or dynamically\",\n        description=(\n            \"The value for the parameter that will be passed on to the external \"\n            \"ruleset rule template.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionAssertRulesetRuleParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssertRulesetRuleParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass TestScriptSetupActionOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The setup operation to perform.\n    The operation to perform.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionOperation\"\n\n    accept: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"accept\",\n        title=\"xml | json | ttl | none\",\n        description=(\n            \"The content-type or mime-type to use for RESTful operation in the \"\n            \"'Accept' header.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"xml\", \"json\", \"ttl\", \"none\"],\n        },\n    )\n    accept__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_accept\", title=\"Extension field for ``accept``.\"\n    )\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"xml | json | ttl | none\",\n        description=(\n            \"The content-type or mime-type to use for RESTful operation in the \"\n            \"'Content-Type' header.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"xml\", \"json\", \"ttl\", \"none\"],\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Tracking/reporting operation description\",\n        description=(\n            \"The description would be used by test engines for tracking and \"\n            \"reporting purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    destination: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Server responding to the request\",\n        description=(\n            \"The server where the request message is destined for.  Must be one of \"\n            \"the server numbers listed in TestScript.destination section.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    destination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_destination\", title=\"Extension field for ``destination``.\"\n    )\n\n    encodeRequestUrl: bool | None = Field(\n        default=None,\n        alias=\"encodeRequestUrl\",\n        title=\"Whether or not to send the request url in encoded format\",\n        description=(\n            \"Whether or not to implicitly send the request url in encoded format. \"\n            \"The default is true to match the standard RESTful client behavior. Set\"\n            \" to false when communicating with a server that does not support \"\n            \"encoded url paths.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    encodeRequestUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_encodeRequestUrl\",\n        title=\"Extension field for ``encodeRequestUrl``.\",\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Tracking/logging operation label\",\n        description=\"The label would be used for tracking/logging purposes by test engines.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    origin: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"origin\",\n        title=\"Server initiating the request\",\n        description=(\n            \"The server where the request message originates from.  Must be one of \"\n            \"the server numbers listed in TestScript.origin section.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    origin__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_origin\", title=\"Extension field for ``origin``.\"\n    )\n\n    params: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"params\",\n        title=\"Explicitly defined path parameters\",\n        description=(\n            \"Path plus parameters after [type].  Used to set parts of the request \"\n            \"URL explicitly.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    params__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_params\", title=\"Extension field for ``params``.\"\n    )\n\n    requestHeader: typing.List[\n        fhirtypes.TestScriptSetupActionOperationRequestHeaderType\n    ] | None = Field(\n        default=None,\n        alias=\"requestHeader\",\n        title=\"Each operation can have one or more header elements\",\n        description=\"Header elements would be used to set HTTP headers.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requestId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"requestId\",\n        title=\"Fixture Id of mapped request\",\n        description=\"The fixture id (maybe new) to map to the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    requestId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requestId\", title=\"Extension field for ``requestId``.\"\n    )\n\n    resource: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Resource type\",\n        description=(\n            \"The type of the resource.  See \"\n            \"http://hl7.org/fhir/STU3/resourcelist.html.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    responseId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"responseId\",\n        title=\"Fixture Id of mapped response\",\n        description=\"The fixture id (maybe new) to map to the response.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responseId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_responseId\", title=\"Extension field for ``responseId``.\"\n    )\n\n    sourceId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"sourceId\",\n        title=\"Fixture Id of body for PUT and POST requests\",\n        description=\"The id of the fixture used as the body of a PUT or POST request.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceId\", title=\"Extension field for ``sourceId``.\"\n    )\n\n    targetId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"targetId\",\n        title=(\n            \"Id of fixture used for extracting the [id],  [type], and [vid] for GET\"\n            \" requests\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    targetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_targetId\", title=\"Extension field for ``targetId``.\"\n    )\n\n    type: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The operation code type that will be executed\",\n        description=\"Server interaction or operation type.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Request URL\",\n        description=\"Complete request URL.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"resource\",\n            \"label\",\n            \"description\",\n            \"accept\",\n            \"contentType\",\n            \"destination\",\n            \"encodeRequestUrl\",\n            \"origin\",\n            \"params\",\n            \"requestHeader\",\n            \"requestId\",\n            \"responseId\",\n            \"sourceId\",\n            \"targetId\",\n            \"url\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptSetupActionOperationRequestHeader(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Each operation can have one or more header elements.\n    Header elements would be used to set HTTP headers.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionOperationRequestHeader\"\n\n    field: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"field\",\n        title=\"HTTP header field name\",\n        description='The HTTP header field e.g. \"Accept\".',\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    field__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_field\", title=\"Extension field for ``field``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"HTTP headerfield value\",\n        description='The value of the header e.g. \"application/fhir+xml\".',\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionOperationRequestHeader`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"field\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionOperationRequestHeader`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"field\", \"field__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass TestScriptTeardown(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A series of required clean up steps.\n    A series of operations required to clean up after the all the tests are\n    executed (successfully or otherwise).\n    \"\"\"\n\n    __resource_type__ = \"TestScriptTeardown\"\n\n    action: typing.List[fhirtypes.TestScriptTeardownActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"One or more teardown operations to perform\",\n        description=\"The teardown action will only contain an operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptTeardown`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptTeardown`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptTeardownAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    One or more teardown operations to perform.\n    The teardown action will only contain an operation.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptTeardownAction\"\n\n    operation: fhirtypes.TestScriptSetupActionOperationType = Field(\n        default=...,\n        alias=\"operation\",\n        title=\"The teardown operation to perform\",\n        description=\"An operation would involve a REST request to a server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptTeardownAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptTeardownAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptTest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A test in this script.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptTest\"\n\n    action: typing.List[fhirtypes.TestScriptTestActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"A test operation or assert to perform\",\n        description=\"Action would contain either an operation or an assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Tracking/reporting short description of the test\",\n        description=(\n            \"A short description of the test used by test engines for tracking and \"\n            \"reporting purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Tracking/logging name of this test\",\n        description=(\n            \"The name of this test used for tracking/logging purposes by test \"\n            \"engines.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptTest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"description\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptTest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptTestAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A test operation or assert to perform.\n    Action would contain either an operation or an assertion.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptTestAction\"\n\n    assert_fhir: fhirtypes.TestScriptSetupActionAssertType | None = Field(\n        default=None,\n        alias=\"assert\",\n        title=\"The setup assertion to perform\",\n        description=(\n            \"Evaluates the results of previous operations to determine if the \"\n            \"server under test behaves appropriately.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.TestScriptSetupActionOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"The setup operation to perform\",\n        description=\"An operation would involve a REST request to a server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptTestAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\", \"assert\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptTestAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptVariable(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Placeholder for evaluated elements.\n    Variable is set based either on element value in response body or on header\n    field value in the response headers.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptVariable\"\n\n    defaultValue: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"defaultValue\",\n        title=\"Default, hard-coded, or user-defined value for this variable\",\n        description=\"A default, hard-coded, or user-defined value for this variable.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    defaultValue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValue\",\n        title=\"Extension field for ``defaultValue``.\",\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the variable\",\n        description=(\n            \"A free text natural language description of the variable and its \"\n            \"purpose.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"The fluentpath expression against the fixture body\",\n        description=(\n            \"The fluentpath expression to evaluate against the fixture body. When \"\n            \"variables are defined, only one of either expression, headerField or \"\n            \"path must be specified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    headerField: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"headerField\",\n        title=\"HTTP header field name for source\",\n        description=(\n            \"Will be used to grab the HTTP header field value from the headers that\"\n            \" sourceId is pointing to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    headerField__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_headerField\", title=\"Extension field for ``headerField``.\"\n    )\n\n    hint: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"hint\",\n        title=\"Hint help text for default value to enter\",\n        description=(\n            \"Displayable text string with hint help information to the user when \"\n            \"entering a default value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    hint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_hint\", title=\"Extension field for ``hint``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Descriptive name for this variable\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"XPath or JSONPath against the fixture body\",\n        description=(\n            \"XPath or JSONPath to evaluate against the fixture body.  When \"\n            \"variables are defined, only one of either expression, headerField or \"\n            \"path must be specified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    sourceId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"sourceId\",\n        title=\"Fixture Id of source expression or headerField within this variable\",\n        description=(\n            \"Fixture to evaluate the XPath/JSONPath expression or the headerField  \"\n            \"against within this variable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceId\", title=\"Extension field for ``sourceId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"defaultValue\",\n            \"description\",\n            \"expression\",\n            \"headerField\",\n            \"hint\",\n            \"path\",\n            \"sourceId\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/STU3/timing.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Timing\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass Timing(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A timing schedule that specifies an event that may occur multiple times.\n    Specifies an event that may occur multiple times. Timing schedules are used\n    to record when things are planned, expected or requested to occur. The most\n    common usage is in dosage instructions for medications. They are also used\n    when planning care of various kinds, and may be used for reporting the\n    schedule to which past regular activities were carried out.\n    \"\"\"\n\n    __resource_type__ = \"Timing\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"BID | TID | QID | AM | PM | QD | QOD | Q4H | Q6H +\",\n        description=(\n            \"A code for the timing schedule. Some codes such as BID are ubiquitous,\"\n            \" but many institutions define their own additional codes. If a code is\"\n            \" provided, the code is understood to be a complete statement of \"\n            \"whatever is specified in the structured timing data, and either the \"\n            \"code or the data may be used to interpret the Timing, with the \"\n            \"exception that .repeat.bounds still applies over the code (and is not \"\n            \"contained in the code).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    event: typing.List[fhirtypes.DateTimeType | None] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"When the event occurs\",\n        description=\"Identifies specific times when the event occurs.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    event__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_event\", title=\"Extension field for ``event``.\"\n    )\n\n    repeat: fhirtypes.TimingRepeatType | None = Field(\n        default=None,\n        alias=\"repeat\",\n        title=\"When the event is to occur\",\n        description=\"A set of rules that describe when the event is scheduled.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Timing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"event\", \"repeat\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Timing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"event\", \"repeat\", \"code\"]\n\n\nclass TimingRepeat(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    When the event is to occur.\n    A set of rules that describe when the event is scheduled.\n    \"\"\"\n\n    __resource_type__ = \"TimingRepeat\"\n\n    boundsDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"boundsDuration\",\n        title=\"Length/Range of lengths, or (Start and/or end) limits\",\n        description=(\n            \"Either a duration for the length of the timing schedule, a range of \"\n            \"possible length, or outer bounds for start and/or end limits of the \"\n            \"timing schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e bounds[x]\n            \"one_of_many\": \"bounds\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    boundsPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"boundsPeriod\",\n        title=\"Length/Range of lengths, or (Start and/or end) limits\",\n        description=(\n            \"Either a duration for the length of the timing schedule, a range of \"\n            \"possible length, or outer bounds for start and/or end limits of the \"\n            \"timing schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e bounds[x]\n            \"one_of_many\": \"bounds\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    boundsRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"boundsRange\",\n        title=\"Length/Range of lengths, or (Start and/or end) limits\",\n        description=(\n            \"Either a duration for the length of the timing schedule, a range of \"\n            \"possible length, or outer bounds for start and/or end limits of the \"\n            \"timing schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e bounds[x]\n            \"one_of_many\": \"bounds\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    count: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Number of times to repeat\",\n        description=\"A total count of the desired number of repetitions.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    countMax: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"countMax\",\n        title=\"Maximum number of times to repeat\",\n        description=(\n            \"A maximum value for the count of the desired repetitions (e.g. do \"\n            \"something 6-8 times).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    countMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_countMax\", title=\"Extension field for ``countMax``.\"\n    )\n\n    dayOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"dayOfWeek\",\n        title=\"mon | tue | wed | thu | fri | sat | sun\",\n        description=(\n            \"If one or more days of week is provided, then the action happens only \"\n            \"on the specified day(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"],\n        },\n    )\n    dayOfWeek__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_dayOfWeek\", title=\"Extension field for ``dayOfWeek``.\"\n    )\n\n    duration: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"How long when it happens\",\n        description=\"How long this thing happens for when it happens.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    duration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_duration\", title=\"Extension field for ``duration``.\"\n    )\n\n    durationMax: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"durationMax\",\n        title=\"How long when it happens (Max)\",\n        description=\"The upper limit of how long this thing happens for when it happens.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    durationMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_durationMax\", title=\"Extension field for ``durationMax``.\"\n    )\n\n    durationUnit: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"durationUnit\",\n        title=\"s | min | h | d | wk | mo | a - unit of time (UCUM)\",\n        description=\"The units of time for the duration, in UCUM units.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"s\", \"min\", \"h\", \"d\", \"wk\", \"mo\", \"a\"],\n        },\n    )\n    durationUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_durationUnit\",\n        title=\"Extension field for ``durationUnit``.\",\n    )\n\n    frequency: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"frequency\",\n        title=\"Event occurs frequency times per period\",\n        description=(\n            \"The number of times to repeat the action within the specified period /\"\n            \" period range (i.e. both period and periodMax provided).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    frequency__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_frequency\", title=\"Extension field for ``frequency``.\"\n    )\n\n    frequencyMax: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"frequencyMax\",\n        title=\"Event occurs up to frequencyMax times per period\",\n        description=(\n            \"If present, indicates that the frequency is a range - so to repeat \"\n            \"between [frequency] and [frequencyMax] times within the period or \"\n            \"period range.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    frequencyMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_frequencyMax\",\n        title=\"Extension field for ``frequencyMax``.\",\n    )\n\n    offset: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"offset\",\n        title=\"Minutes from event (before or after)\",\n        description=(\n            \"The number of minutes from the event. If the event code does not \"\n            \"indicate whether the minutes is before or after the event, then the \"\n            \"offset is assumed to be after the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    offset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_offset\", title=\"Extension field for ``offset``.\"\n    )\n\n    period: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Event occurs frequency times per period\",\n        description=(\n            \"Indicates the duration of time over which repetitions are to occur; \"\n            'e.g. to express \"3 times per day\", 3 would be the frequency and \"1 '\n            'day\" would be the period.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    period__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_period\", title=\"Extension field for ``period``.\"\n    )\n\n    periodMax: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"periodMax\",\n        title=\"Upper limit of period (3-4 hours)\",\n        description=(\n            \"If present, indicates that the period is a range from [period] to \"\n            '[periodMax], allowing expressing concepts such as \"do this once every '\n            \"3-5 days.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    periodMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_periodMax\", title=\"Extension field for ``periodMax``.\"\n    )\n\n    periodUnit: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"periodUnit\",\n        title=\"s | min | h | d | wk | mo | a - unit of time (UCUM)\",\n        description=\"The units of time for the period in UCUM units.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"s\", \"min\", \"h\", \"d\", \"wk\", \"mo\", \"a\"],\n        },\n    )\n    periodUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_periodUnit\", title=\"Extension field for ``periodUnit``.\"\n    )\n\n    timeOfDay: typing.List[fhirtypes.TimeType | None] | None = Field(\n        default=None,\n        alias=\"timeOfDay\",\n        title=\"Time of day for action\",\n        description=\"Specified time of day for action to take place.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    timeOfDay__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_timeOfDay\", title=\"Extension field for ``timeOfDay``.\"\n    )\n\n    when: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"when\",\n        title=\"Regular life events the event is tied to\",\n        description=\"Real world events that the occurrence of the event should be tied to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    when__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_when\", title=\"Extension field for ``when``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TimingRepeat`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"boundsDuration\",\n            \"boundsRange\",\n            \"boundsPeriod\",\n            \"count\",\n            \"countMax\",\n            \"duration\",\n            \"durationMax\",\n            \"durationUnit\",\n            \"frequency\",\n            \"frequencyMax\",\n            \"period\",\n            \"periodMax\",\n            \"periodUnit\",\n            \"dayOfWeek\",\n            \"timeOfDay\",\n            \"when\",\n            \"offset\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TimingRepeat`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"boundsDuration\",\n            \"boundsRange\",\n            \"boundsPeriod\",\n            \"count\",\n            \"countMax\",\n            \"duration\",\n            \"durationMax\",\n            \"durationUnit\",\n            \"frequency\",\n            \"frequencyMax\",\n            \"period\",\n            \"periodMax\",\n            \"periodUnit\",\n            \"dayOfWeek\",\n            \"timeOfDay\",\n            \"when\",\n            \"offset\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"bounds\": [\"boundsDuration\", \"boundsPeriod\", \"boundsRange\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/triggerdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TriggerDefinition\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass TriggerDefinition(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defines an expected trigger for a module.\n    A description of a triggering event.\n    \"\"\"\n\n    __resource_type__ = \"TriggerDefinition\"\n\n    eventData: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"eventData\",\n        title=\"Triggering data of the event\",\n        description=\"The triggering data of the event (if this is a data trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    eventName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"eventName\",\n        title=\"Triggering event name\",\n        description=\"The name of the event (if this is a named-event trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    eventName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_eventName\", title=\"Extension field for ``eventName``.\"\n    )\n\n    eventTimingDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"eventTimingDate\",\n        title=\"Timing of the event\",\n        description=\"The timing of the event (if this is a period trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e eventTiming[x]\n            \"one_of_many\": \"eventTiming\",\n            \"one_of_many_required\": False,\n        },\n    )\n    eventTimingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_eventTimingDate\",\n        title=\"Extension field for ``eventTimingDate``.\",\n    )\n\n    eventTimingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"eventTimingDateTime\",\n        title=\"Timing of the event\",\n        description=\"The timing of the event (if this is a period trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e eventTiming[x]\n            \"one_of_many\": \"eventTiming\",\n            \"one_of_many_required\": False,\n        },\n    )\n    eventTimingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_eventTimingDateTime\",\n        title=\"Extension field for ``eventTimingDateTime``.\",\n    )\n\n    eventTimingReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"eventTimingReference\",\n        title=\"Timing of the event\",\n        description=\"The timing of the event (if this is a period trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e eventTiming[x]\n            \"one_of_many\": \"eventTiming\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Schedule\"],\n        },\n    )\n\n    eventTimingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"eventTimingTiming\",\n        title=\"Timing of the event\",\n        description=\"The timing of the event (if this is a period trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e eventTiming[x]\n            \"one_of_many\": \"eventTiming\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"named-event | periodic | data-added | data-modified | data-removed | \"\n            \"data-accessed | data-access-ended\"\n        ),\n        description=\"The type of triggering event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"named-event\",\n                \"periodic\",\n                \"data-added\",\n                \"data-modified\",\n                \"data-removed\",\n                \"data-accessed\",\n                \"data-access-ended\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TriggerDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"eventName\",\n            \"eventTimingTiming\",\n            \"eventTimingReference\",\n            \"eventTimingDate\",\n            \"eventTimingDateTime\",\n            \"eventData\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TriggerDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"type\",\n            \"eventName\",\n            \"eventTimingTiming\",\n            \"eventTimingReference\",\n            \"eventTimingDate\",\n            \"eventTimingDateTime\",\n            \"eventData\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"eventTiming\": [\n                \"eventTimingDate\",\n                \"eventTimingDateTime\",\n                \"eventTimingReference\",\n                \"eventTimingTiming\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/usagecontext.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/UsageContext\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass UsageContext(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes the context of use for a conformance or knowledge resource.\n    Specifies clinical/business/etc metadata that can be used to retrieve,\n    index and/or categorize an artifact. This metadata can either be specific\n    to the applicable population (e.g., age category, DRG) or the specific\n    context of care (e.g., venue, care setting, provider of care).\n    \"\"\"\n\n    __resource_type__ = \"UsageContext\"\n\n    code: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of context being specified\",\n        description=(\n            \"A code that identifies the type of context being specified by this \"\n            \"usage context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value that defines the context\",\n        description=(\n            \"A value that defines the context specified in this context of use. The\"\n            \" interpretation of the value is defined by the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value that defines the context\",\n        description=(\n            \"A value that defines the context specified in this context of use. The\"\n            \" interpretation of the value is defined by the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value that defines the context\",\n        description=(\n            \"A value that defines the context specified in this context of use. The\"\n            \" interpretation of the value is defined by the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``UsageContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``UsageContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"code\", \"valueCodeableConcept\", \"valueQuantity\", \"valueRange\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\"valueCodeableConcept\", \"valueQuantity\", \"valueRange\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/valueset.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ValueSet\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ValueSet(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of codes drawn from one or more code systems.\n    A value set specifies a set of codes drawn from one or more code systems.\n    \"\"\"\n\n    __resource_type__ = \"ValueSet\"\n\n    compose: fhirtypes.ValueSetComposeType | None = Field(\n        default=None,\n        alias=\"compose\",\n        title=\"Definition of the content of the value set (CLD)\",\n        description=(\n            \"A set of criteria that define the content logical definition of the \"\n            \"value set by including or excluding codes from outside this value set.\"\n            ' This I also known as the \"Content Logical Definition\" (CLD).'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the value set and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date this was last changed\",\n        description=(\n            \"The date  (and optionally time) when the value set was published. The \"\n            \"date must change if and when the business version changes and it must \"\n            \"change if the status code changes. In addition, it should change when \"\n            \"the substantive content of the value set changes. (e.g. the 'content \"\n            \"logical definition').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the value set\",\n        description=(\n            \"A free text natural language description of the value set from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expansion: fhirtypes.ValueSetExpansionType | None = Field(\n        default=None,\n        alias=\"expansion\",\n        title='Used when the value set is \"expanded\"',\n        description=(\n            'A value set can also be \"expanded\", where the value set is turned into'\n            \" a simple collection of enumerated codes. This element holds the \"\n            \"expansion, if it has been performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A boolean value to indicate that this value set is authored for \"\n            \"testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    extensible: bool | None = Field(\n        default=None,\n        alias=\"extensible\",\n        title=\"Whether this is intended to be used with an extensible binding\",\n        description=\"Whether this is intended to be used with an extensible binding or not.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    extensible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_extensible\", title=\"Extension field for ``extensible``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the value set\",\n        description=(\n            \"A formal identifier that is used to identify this value set when it is\"\n            \" represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    immutable: bool | None = Field(\n        default=None,\n        alias=\"immutable\",\n        title=(\n            \"Indicates whether or not any change to the content logical definition \"\n            \"may occur\"\n        ),\n        description=(\n            \"If this is set to 'true', then no new versions of the content logical \"\n            \"definition can be created.  Note: Other metadata might still change.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    immutable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_immutable\", title=\"Extension field for ``immutable``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for value set (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the value set is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this value set (computer friendly)\",\n        description=(\n            \"A natural language name identifying the value set. This name should be\"\n            \" usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher (organization or individual)\",\n        description=(\n            \"The name of the individual or organization that published the value \"\n            \"set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this value set is defined\",\n        description=(\n            \"Explaination of why this value set is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this value set. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this value set (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the value set.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Logical URI to reference this value set (globally unique)\",\n        description=(\n            \"An absolute URI that is used to identify this value set when it is \"\n            \"referenced in a specification, model, design or an instance. This \"\n            \"SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at\"\n            \" which this value set is (or will be) published. The URL SHOULD \"\n            \"include the major version of the value set. For more information see \"\n            \"[Technical and Business Versions](resource.html#versions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Context the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching for appropriate value set instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the value set\",\n        description=(\n            \"The identifier that is used to identify this version of the value set \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the value set author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"immutable\",\n            \"purpose\",\n            \"copyright\",\n            \"extensible\",\n            \"compose\",\n            \"expansion\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"immutable\",\n            \"extensible\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ValueSetCompose(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of the content of the value set (CLD).\n    A set of criteria that define the content logical definition of the value\n    set by including or excluding codes from outside this value set. This I\n    also known as the \"Content Logical Definition\" (CLD).\n    \"\"\"\n\n    __resource_type__ = \"ValueSetCompose\"\n\n    exclude: typing.List[fhirtypes.ValueSetComposeIncludeType] | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=\"Explicitly exclude codes from a code system or other value sets\",\n        description=(\n            \"Exclude one or more codes from the value set based on code system \"\n            \"filters and/or other value sets.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    inactive: bool | None = Field(\n        default=None,\n        alias=\"inactive\",\n        title=\"Whether inactive codes are in the value set\",\n        description=(\n            \"Whether inactive codes - codes that are not approved for current use -\"\n            \" are in the value set. If inactive = true, inactive codes are to be \"\n            \"included in the expansion, if inactive = false, the inactive codes \"\n            \"will not be included in the expansion. If absent, the behavior is \"\n            \"determined by the implementation, or by the applicable \"\n            \"ExpansionProfile (but generally, inactive codes would be expected to \"\n            \"be included).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_inactive\", title=\"Extension field for ``inactive``.\"\n    )\n\n    include: typing.List[fhirtypes.ValueSetComposeIncludeType] = Field(\n        default=...,\n        alias=\"include\",\n        title=\"Include one or more codes from a code system or other value set(s)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lockedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lockedDate\",\n        title=\"Fixed date for version-less references (transitive)\",\n        description=(\n            \"If a locked date is defined, then the Content Logical Definition must \"\n            \"be evaluated using the current version as of the locked date for \"\n            \"referenced code system(s) and value set instances where \"\n            \"ValueSet.compose.include.version is not defined.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lockedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lockedDate\", title=\"Extension field for ``lockedDate``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetCompose`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"lockedDate\",\n            \"inactive\",\n            \"include\",\n            \"exclude\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetCompose`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"lockedDate\", \"inactive\", \"include\"]\n\n\nclass ValueSetComposeInclude(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Include one or more codes from a code system or other value set(s).\n    \"\"\"\n\n    __resource_type__ = \"ValueSetComposeInclude\"\n\n    concept: typing.List[fhirtypes.ValueSetComposeIncludeConceptType] | None = Field(\n        default=None,\n        alias=\"concept\",\n        title=\"A concept defined in the system\",\n        description=\"Specifies a concept to be included or excluded.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    filter: typing.List[fhirtypes.ValueSetComposeIncludeFilterType] | None = Field(\n        default=None,\n        alias=\"filter\",\n        title=\"Select codes/concepts by their properties (including relationships)\",\n        description=(\n            \"Select concepts by specify a matching criteria based on the properties\"\n            \" (including relationships) defined by the system. If multiple filters \"\n            \"are specified, they SHALL all be true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"The system the codes come from\",\n        description=(\n            \"An absolute URI which is the code system from which the selected codes\"\n            \" come from.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    valueSet: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Select only contents included in this value set\",\n        description=(\n            \"Selects concepts found in this value set. This is an absolute URI that\"\n            \" is a reference to ValueSet.url.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    valueSet__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Specific version of the code system referred to\",\n        description=\"The version of the code system that the codes are selected from.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetComposeInclude`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"system\",\n            \"version\",\n            \"concept\",\n            \"filter\",\n            \"valueSet\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetComposeInclude`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"system\", \"version\", \"filter\", \"valueSet\"]\n\n\nclass ValueSetComposeIncludeConcept(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A concept defined in the system.\n    Specifies a concept to be included or excluded.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetComposeIncludeConcept\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code or expression from system\",\n        description=\"Specifies a code for the concept to be included or excluded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    designation: typing.List[\n        fhirtypes.ValueSetComposeIncludeConceptDesignationType\n    ] | None = Field(\n        default=None,\n        alias=\"designation\",\n        title=\"Additional representations for this concept\",\n        description=(\n            \"Additional representations for this concept when used in this value \"\n            \"set - other languages, aliases, specialized purposes, used for \"\n            \"particular purposes, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Text to display for this code for this value set in this valueset\",\n        description=(\n            \"The text to display to the user for this concept in the context of \"\n            \"this valueset. If no display is provided, then applications using the \"\n            \"value set use the display specified for the code by the system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetComposeIncludeConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"display\",\n            \"designation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass ValueSetComposeIncludeConceptDesignation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional representations for this concept.\n    Additional representations for this concept when used in this value set -\n    other languages, aliases, specialized purposes, used for particular\n    purposes, etc.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetComposeIncludeConceptDesignation\"\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language of the designation\",\n        description=\"The language this designation is defined for.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    use: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"Details how this designation would be used\",\n        description=\"A code that details how this designation would be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The text value for this designation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetComposeIncludeConceptDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"use\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeConceptDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass ValueSetComposeIncludeFilter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Select codes/concepts by their properties (including relationships).\n    Select concepts by specify a matching criteria based on the properties\n    (including relationships) defined by the system. If multiple filters are\n    specified, they SHALL all be true.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetComposeIncludeFilter\"\n\n    op: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"op\",\n        title=(\n            \"= | is-a | descendent-of | is-not-a | regex | in | not-in | \"\n            \"generalizes | exists\"\n        ),\n        description=\"The kind of operation to perform as a part of the filter criteria.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"=\",\n                \"is-a\",\n                \"descendent-of\",\n                \"is-not-a\",\n                \"regex\",\n                \"in\",\n                \"not-in\",\n                \"generalizes\",\n                \"exists\",\n            ],\n        },\n    )\n    op__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_op\", title=\"Extension field for ``op``.\"\n    )\n\n    property: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"A property defined by the code system\",\n        description=\"A code that identifies a property defined in the code system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    property__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_property\", title=\"Extension field for ``property``.\"\n    )\n\n    value: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Code from the system, or regex criteria, or boolean value for exists\",\n        description=(\n            \"The match value may be either a code defined by the system, or a \"\n            \"string value, which is a regex match on the literal string of the \"\n            \"property value when the operation is 'regex', or one of the values \"\n            \"(true and false), when the operation is 'exists'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetComposeIncludeFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"property\", \"op\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"property\", \"op\", \"value\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"op\", \"op__ext\"),\n            (\"property\", \"property__ext\"),\n            (\"value\", \"value__ext\"),\n        ]\n        return required_fields\n\n\nclass ValueSetExpansion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Used when the value set is \"expanded\".\n    A value set can also be \"expanded\", where the value set is turned into a\n    simple collection of enumerated codes. This element holds the expansion, if\n    it has been performed.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetExpansion\"\n\n    contains: typing.List[fhirtypes.ValueSetExpansionContainsType] | None = Field(\n        default=None,\n        alias=\"contains\",\n        title=\"Codes in the value set\",\n        description=\"The codes that are contained in the value set expansion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Uniquely identifies this expansion\",\n        description=(\n            \"An identifier that uniquely identifies this expansion of the valueset.\"\n            \" Systems may re-use the same identifier as long as the expansion and \"\n            \"the definition remain the same, but are not required to do so.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    identifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_identifier\", title=\"Extension field for ``identifier``.\"\n    )\n\n    offset: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"offset\",\n        title=\"Offset at which this resource starts\",\n        description=(\n            \"If paging is being used, the offset at which this resource starts.  \"\n            \"I.e. this resource is a partial view into the expansion. If paging is \"\n            \"not being used, this element SHALL not be present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    offset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_offset\", title=\"Extension field for ``offset``.\"\n    )\n\n    parameter: typing.List[fhirtypes.ValueSetExpansionParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Parameter that controlled the expansion process\",\n        description=(\n            \"A parameter that controlled the expansion process. These parameters \"\n            \"may be used by users of expanded value sets to check whether the \"\n            \"expansion is suitable for a particular purpose, or to pick the correct\"\n            \" expansion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timestamp: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timestamp\",\n        title=\"Time ValueSet expansion happened\",\n        description=\"The time at which the expansion was produced by the expanding system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timestamp\", title=\"Extension field for ``timestamp``.\"\n    )\n\n    total: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"Total number of codes in the expansion\",\n        description=(\n            \"The total number of concepts in the expansion. If the number of \"\n            \"concept nodes in this resource is less than the stated number, then \"\n            \"the server can return more using the offset parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    total__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_total\", title=\"Extension field for ``total``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetExpansion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"timestamp\",\n            \"total\",\n            \"offset\",\n            \"parameter\",\n            \"contains\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetExpansion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"identifier\", \"identifier__ext\"),\n            (\"timestamp\", \"timestamp__ext\"),\n        ]\n        return required_fields\n\n\nclass ValueSetExpansionContains(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Codes in the value set.\n    The codes that are contained in the value set expansion.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetExpansionContains\"\n\n    abstract: bool | None = Field(\n        default=None,\n        alias=\"abstract\",\n        title=\"If user cannot select this entry\",\n        description=(\n            \"If true, this entry is included in the expansion for navigational \"\n            \"purposes, and the user cannot select the code directly as a proper \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    abstract__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_abstract\", title=\"Extension field for ``abstract``.\"\n    )\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code - if blank, this is not a selectable code\",\n        description=(\n            \"The code for this item in the expansion hierarchy. If this code is \"\n            \"missing the entry in the hierarchy is a place holder (abstract) and \"\n            \"does not represent a valid code in the value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    contains: typing.List[fhirtypes.ValueSetExpansionContainsType] | None = Field(\n        default=None,\n        alias=\"contains\",\n        title=\"Codes contained under this entry\",\n        description=\"Other codes and entries contained under this entry in the hierarchy.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    designation: typing.List[\n        fhirtypes.ValueSetComposeIncludeConceptDesignationType\n    ] | None = Field(\n        default=None,\n        alias=\"designation\",\n        title=\"Additional representations for this item\",\n        description=(\n            \"Additional representations for this item - other languages, aliases, \"\n            \"specialized purposes, used for particular purposes, etc. These are \"\n            \"relevant when the conditions of the expansion do not fix to a single \"\n            \"correct representation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"User display for the concept\",\n        description=\"The recommended display for this item in the expansion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    inactive: bool | None = Field(\n        default=None,\n        alias=\"inactive\",\n        title=\"If concept is inactive in the code system\",\n        description=(\n            \"If the concept is inactive in the code system that defines it. \"\n            \"Inactive codes are those that are no longer to be used, but are \"\n            \"maintained by the code system for understanding legacy data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_inactive\", title=\"Extension field for ``inactive``.\"\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"System value for the code\",\n        description=(\n            \"An absolute URI which is the code system in which the code for this \"\n            \"item in the expansion is defined.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version in which this code/display is defined\",\n        description=(\n            \"The version of this code system that defined this code and/or display.\"\n            \" This should only be used with code systems that do not enforce \"\n            \"concept permanence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetExpansionContains`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"system\",\n            \"abstract\",\n            \"inactive\",\n            \"version\",\n            \"code\",\n            \"display\",\n            \"designation\",\n            \"contains\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetExpansionContains`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ValueSetExpansionParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Parameter that controlled the expansion process.\n    A parameter that controlled the expansion process. These parameters may be\n    used by users of expanded value sets to check whether the expansion is\n    suitable for a particular purpose, or to pick the correct expansion.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetExpansionParameter\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name as assigned by the server\",\n        description=\"The name of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetExpansionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueDecimal\",\n            \"valueUri\",\n            \"valueCode\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetExpansionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueString\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/STU3/visionprescription.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/VisionPrescription\nRelease: STU3\nVersion: 3.0.2\nRevision: 11917\nLast updated: 2019-10-24T11:53:00+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass VisionPrescription(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Prescription for vision correction products for a patient.\n    An authorization for the supply of glasses and/or contact lenses to a\n    patient.\n    \"\"\"\n\n    __resource_type__ = \"VisionPrescription\"\n\n    dateWritten: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateWritten\",\n        title=\"When prescription was authorized\",\n        description=\"The date (and perhaps time) when the prescription was written.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    dateWritten__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dateWritten\", title=\"Extension field for ``dateWritten``.\"\n    )\n\n    dispense: typing.List[fhirtypes.VisionPrescriptionDispenseType] | None = Field(\n        default=None,\n        alias=\"dispense\",\n        title=\"Vision supply authorization\",\n        description=\"Deals with details of the dispense part of the supply specification.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Created during encounter / admission / stay\",\n        description=(\n            \"A link to a resource that identifies the particular occurrence of \"\n            \"contact between patient and health care provider.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Business identifier which may be used by other parties to reference or\"\n            \" identify the prescription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"Who prescription is for\",\n        description=(\n            \"A link to a resource representing the person to whom the vision \"\n            \"products will be supplied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    prescriber: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"prescriber\",\n        title=\"Who authorizes the vision product\",\n        description=(\n            \"The healthcare professional responsible for authorizing the \"\n            \"prescription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    reasonCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reasonCodeableConcept\",\n        title=\"Reason or indication for writing the prescription\",\n        description=\"Can be the reason or the indication for writing the prescription.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e reason[x]\n            \"one_of_many\": \"reason\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    reasonReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reasonReference\",\n        title=\"Reason or indication for writing the prescription\",\n        description=\"Can be the reason or the indication for writing the prescription.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e reason[x]\n            \"one_of_many\": \"reason\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VisionPrescription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"patient\",\n            \"encounter\",\n            \"dateWritten\",\n            \"prescriber\",\n            \"reasonCodeableConcept\",\n            \"reasonReference\",\n            \"dispense\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VisionPrescription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"status\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"reason\": [\"reasonCodeableConcept\", \"reasonReference\"]}\n        return one_of_many_fields\n\n\nclass VisionPrescriptionDispense(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Vision supply authorization.\n    Deals with details of the dispense part of the supply specification.\n    \"\"\"\n\n    __resource_type__ = \"VisionPrescriptionDispense\"\n\n    add: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"add\",\n        title=\"Lens add\",\n        description=(\n            \"Power adjustment for multifocal lenses measured in diopters (0.25 \"\n            \"units).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    add__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_add\", title=\"Extension field for ``add``.\"\n    )\n\n    axis: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"axis\",\n        title=\"Lens axis\",\n        description=\"Adjustment for astigmatism measured in integer degrees.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    axis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_axis\", title=\"Extension field for ``axis``.\"\n    )\n\n    backCurve: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"backCurve\",\n        title=\"Contact lens back curvature\",\n        description=\"Back curvature measured in millimeters.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    backCurve__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_backCurve\", title=\"Extension field for ``backCurve``.\"\n    )\n\n    base: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"up | down | in | out\",\n        description=\"The relative base, or reference lens edge, for the prism.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"up\", \"down\", \"in\", \"out\"],\n        },\n    )\n    base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_base\", title=\"Extension field for ``base``.\"\n    )\n\n    brand: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"brand\",\n        title=\"Brand required\",\n        description=\"Brand recommendations or restrictions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    brand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_brand\", title=\"Extension field for ``brand``.\"\n    )\n\n    color: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"color\",\n        title=\"Color required\",\n        description=\"Special color or pattern.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    color__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_color\", title=\"Extension field for ``color``.\"\n    )\n\n    cylinder: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"cylinder\",\n        title=\"Lens cylinder\",\n        description=\"Power adjustment for astigmatism measured in diopters (0.25 units).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    cylinder__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_cylinder\", title=\"Extension field for ``cylinder``.\"\n    )\n\n    diameter: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"diameter\",\n        title=\"Contact lens diameter\",\n        description=\"Contact lens diameter measured in millimeters.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    diameter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_diameter\", title=\"Extension field for ``diameter``.\"\n    )\n\n    duration: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"Lens wear duration\",\n        description=\"The recommended maximum wear period for the lens.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    eye: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"eye\",\n        title=\"right | left\",\n        description=\"The eye for which the lens applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"right\", \"left\"],\n        },\n    )\n    eye__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_eye\", title=\"Extension field for ``eye``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Notes for coatings\",\n        description=\"Notes for special requirements such as coatings and lens materials.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    power: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"power\",\n        title=\"Contact lens power\",\n        description=\"Contact lens power measured in diopters (0.25 units).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    power__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_power\", title=\"Extension field for ``power``.\"\n    )\n\n    prism: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"prism\",\n        title=\"Lens prism\",\n        description=\"Amount of prism to compensate for eye alignment in fractional units.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    prism__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_prism\", title=\"Extension field for ``prism``.\"\n    )\n\n    product: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"product\",\n        title=\"Product to be supplied\",\n        description=(\n            \"Identifies the type of vision correction product which is required for\"\n            \" the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sphere: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"sphere\",\n        title=\"Lens sphere\",\n        description=\"Lens power measured in diopters (0.25 units).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sphere__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sphere\", title=\"Extension field for ``sphere``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VisionPrescriptionDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"product\",\n            \"eye\",\n            \"sphere\",\n            \"cylinder\",\n            \"axis\",\n            \"prism\",\n            \"base\",\n            \"add\",\n            \"power\",\n            \"backCurve\",\n            \"diameter\",\n            \"duration\",\n            \"color\",\n            \"brand\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VisionPrescriptionDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/__init__.py",
    "content": "from __future__ import annotations as _annotations\n\nfrom functools import lru_cache\nfrom typing import TYPE_CHECKING, cast\n\nif TYPE_CHECKING:\n    from fhir_core.fhirabstractmodel import FHIRAbstractModel\n\n__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n__version__ = \"8.2.1\"\n__fhir_version__ = \"5.0.0\"\n\n\n@lru_cache(maxsize=None, typed=True)\ndef get_fhir_model_class(model_name: str) -> type[FHIRAbstractModel]:\n    \"\"\" \"\"\"\n    from . import fhirtypes as ft\n\n    try:\n        model_type = getattr(ft, model_name + \"Type\")\n        if TYPE_CHECKING:\n            from fhir_core.types import FhirBase\n\n            model_type = cast(\"type[FhirBase]\", model_type)\n\n        return model_type.get_model_klass()\n\n    except AttributeError:\n        raise ValueError(f\"{model_name} is not a valid FHIR Model\")\n"
  },
  {
    "path": "fhir/resources/account.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Account\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Account(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Tracks balance, charges, for patient or cost center.\n    A financial tool for tracking value accrued for a particular purpose.  In\n    the healthcare field, used to track charges for a patient, cost centers,\n    etc.\n    \"\"\"\n\n    __resource_type__ = \"Account\"\n\n    balance: typing.List[fhirtypes.AccountBalanceType] | None = Field(\n        default=None,\n        alias=\"balance\",\n        title=\"Calculated account balance(s)\",\n        description=(\n            \"The calculated account balances - these are calculated and processed \"\n            \"by the finance system.  The balances with a `term` that is not current\"\n            \" are usually generated/updated by an invoicing or similar process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    billingStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"billingStatus\",\n        title=\"Tracks the lifecycle of the account through the billing process\",\n        description=(\n            \"The BillingStatus tracks the lifecycle of the account through the \"\n            \"billing process. It indicates how transactions are treated when they \"\n            \"are allocated to the account.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    calculatedAt: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"calculatedAt\",\n        title=\"Time the balance amount was calculated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    calculatedAt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_calculatedAt\",\n        title=\"Extension field for ``calculatedAt``.\",\n    )\n\n    coverage: typing.List[fhirtypes.AccountCoverageType] | None = Field(\n        default=None,\n        alias=\"coverage\",\n        title=(\n            \"The party(s) that are responsible for covering the payment of this \"\n            \"account, and what order should they be applied to the account\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    currency: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"currency\",\n        title=\"The base or default currency\",\n        description=\"The default currency for the account.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Explanation of purpose/use\",\n        description=(\n            \"Provides additional information about what the account tracks and how \"\n            \"it is used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    diagnosis: typing.List[fhirtypes.AccountDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"The list of diagnoses relevant to this account\",\n        description=(\n            \"When using an account for billing a specific Encounter the set of \"\n            \"diagnoses that are relevant for billing are stored here on the account\"\n            \" where they are able to be sequenced appropriately prior to processing\"\n            \" to produce claim(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    guarantor: typing.List[fhirtypes.AccountGuarantorType] | None = Field(\n        default=None,\n        alias=\"guarantor\",\n        title=\"The parties ultimately responsible for balancing the Account\",\n        description=(\n            \"The parties responsible for balancing the account if other payment \"\n            \"options fall short.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Account number\",\n        description=(\n            \"Unique identifier used to reference the account.  Might or might not \"\n            \"be intended for human use (e.g. credit card number).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human-readable label\",\n        description=(\n            \"Name used for the account when displaying it to humans in reports, \" \"etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    owner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"owner\",\n        title=\"Entity managing the Account\",\n        description=(\n            \"Indicates the service area, hospital, department, etc. with \"\n            \"responsibility for managing the Account.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    procedure: typing.List[fhirtypes.AccountProcedureType] | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"The list of procedures relevant to this account\",\n        description=(\n            \"When using an account for billing a specific Encounter the set of \"\n            \"procedures that are relevant for billing are stored here on the \"\n            \"account where they are able to be sequenced appropriately prior to \"\n            \"processing to produce claim(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatedAccount: typing.List[fhirtypes.AccountRelatedAccountType] | None = Field(\n        default=None,\n        alias=\"relatedAccount\",\n        title=\"Other associated accounts related to this account\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    servicePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicePeriod\",\n        title=\"Transaction window\",\n        description=\"The date range of services associated with this account.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error | on-hold | unknown\",\n        description=\"Indicates whether the account is presently used/usable or not.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"active\",\n                \"inactive\",\n                \"entered-in-error\",\n                \"on-hold\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The entity that caused the expenses\",\n        description=(\n            \"Identifies the entity which incurs the expenses. While the immediate \"\n            \"recipients of services or goods might be entities related to the \"\n            \"subject, the expenses were ultimately incurred by the subject of the \"\n            \"Account.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Device\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Location\",\n                \"HealthcareService\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"E.g. patient, expense, depreciation\",\n        description=\"Categorizes the account for reporting and searching purposes.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Account`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"billingStatus\",\n            \"type\",\n            \"name\",\n            \"subject\",\n            \"servicePeriod\",\n            \"coverage\",\n            \"owner\",\n            \"description\",\n            \"guarantor\",\n            \"diagnosis\",\n            \"procedure\",\n            \"relatedAccount\",\n            \"currency\",\n            \"balance\",\n            \"calculatedAt\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Account`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"billingStatus\",\n            \"type\",\n            \"name\",\n            \"subject\",\n            \"servicePeriod\",\n            \"coverage\",\n            \"owner\",\n            \"description\",\n            \"diagnosis\",\n            \"procedure\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass AccountBalance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Calculated account balance(s).\n    The calculated account balances - these are calculated and processed by the\n    finance system.\n\n    The balances with a `term` that is not current are usually\n    generated/updated by an invoicing or similar process.\n    \"\"\"\n\n    __resource_type__ = \"AccountBalance\"\n\n    aggregate: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"aggregate\",\n        title=\"Who is expected to pay this part of the balance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    amount: fhirtypes.MoneyType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Calculated amount\",\n        description=(\n            \"The actual balance value calculated for the age defined in the term \"\n            \"property.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    estimate: bool | None = Field(\n        default=None,\n        alias=\"estimate\",\n        title=\"Estimated balance\",\n        description=(\n            \"The amount is only an estimated value - this is likely common for \"\n            \"`current` term balances, but not with known terms (that were generated\"\n            \" by a backend process).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    estimate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_estimate\", title=\"Extension field for ``estimate``.\"\n    )\n\n    term: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"term\",\n        title=\"current | 30 | 60 | 90 | 120\",\n        description=(\n            \"The term of the account balances - The balance value is the amount \"\n            \"that was outstanding for this age.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AccountBalance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"aggregate\",\n            \"term\",\n            \"estimate\",\n            \"amount\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AccountBalance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass AccountCoverage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The party(s) that are responsible for covering the payment of this account,\n    and what order should they be applied to the account.\n    \"\"\"\n\n    __resource_type__ = \"AccountCoverage\"\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=(\n            \"The party(s), such as insurances, that may contribute to the payment \"\n            \"of this account\"\n        ),\n        description=(\n            \"The party(s) that contribute to payment (or part of) of the charges \"\n            \"applied to this account (including self-pay).  A coverage may only be \"\n            \"responsible for specific types of charges, and the sequence of the \"\n            \"coverages in the account could be important when processing billing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    priority: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"The priority of the coverage in the context of this account\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AccountCoverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"coverage\", \"priority\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AccountCoverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"coverage\", \"priority\"]\n\n\nclass AccountDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The list of diagnoses relevant to this account.\n    When using an account for billing a specific Encounter the set of diagnoses\n    that are relevant for billing are stored here on the account where they are\n    able to be sequenced appropriately prior to processing to produce claim(s).\n    \"\"\"\n\n    __resource_type__ = \"AccountDiagnosis\"\n\n    condition: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"condition\",\n        title=\"The diagnosis relevant to the account\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    dateOfDiagnosis: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateOfDiagnosis\",\n        title=\"Date of the diagnosis (when coded diagnosis)\",\n        description=\"Ranking of the diagnosis (for each type).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    dateOfDiagnosis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_dateOfDiagnosis\",\n        title=\"Extension field for ``dateOfDiagnosis``.\",\n    )\n\n    onAdmission: bool | None = Field(\n        default=None,\n        alias=\"onAdmission\",\n        title=\"Diagnosis present on Admission\",\n        description=\"Was the Diagnosis present on Admission in the related Encounter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    onAdmission__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onAdmission\", title=\"Extension field for ``onAdmission``.\"\n    )\n\n    packageCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"packageCode\",\n        title=\"Package Code specific for billing\",\n        description=(\n            \"The package code can be used to group diagnoses that may be priced or \"\n            \"delivered as a single product. Such as DRGs.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Ranking of the diagnosis (for each type)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Type that this diagnosis has relevant to the account (e.g. admission, \"\n            \"billing, discharge \\u2026)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AccountDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"condition\",\n            \"dateOfDiagnosis\",\n            \"type\",\n            \"onAdmission\",\n            \"packageCode\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AccountDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"condition\"]\n\n\nclass AccountGuarantor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The parties ultimately responsible for balancing the Account.\n    The parties responsible for balancing the account if other payment options\n    fall short.\n    \"\"\"\n\n    __resource_type__ = \"AccountGuarantor\"\n\n    onHold: bool | None = Field(\n        default=None,\n        alias=\"onHold\",\n        title=\"Credit or other hold applied\",\n        description=(\n            \"A guarantor may be placed on credit hold or otherwise have their role \"\n            \"temporarily suspended.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    onHold__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onHold\", title=\"Extension field for ``onHold``.\"\n    )\n\n    party: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"party\",\n        title=\"Responsible entity\",\n        description=\"The entity who is responsible.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\", \"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Guarantee account during\",\n        description=(\n            \"The timeframe during which the guarantor accepts responsibility for \"\n            \"the account.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AccountGuarantor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"party\", \"onHold\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AccountGuarantor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass AccountProcedure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The list of procedures relevant to this account.\n    When using an account for billing a specific Encounter the set of\n    procedures that are relevant for billing are stored here on the account\n    where they are able to be sequenced appropriately prior to processing to\n    produce claim(s).\n    \"\"\"\n\n    __resource_type__ = \"AccountProcedure\"\n\n    code: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"The procedure relevant to the account\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    dateOfService: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateOfService\",\n        title=\"Date of the procedure (when coded procedure)\",\n        description=(\n            \"Date of the procedure when using a coded procedure. If using a \"\n            \"reference to a procedure, then the date on the procedure should be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    dateOfService__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_dateOfService\",\n        title=\"Extension field for ``dateOfService``.\",\n    )\n\n    device: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Any devices that were associated with the procedure\",\n        description=(\n            \"Any devices that were associated with the procedure relevant to the \"\n            \"account.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    packageCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"packageCode\",\n        title=\"Package Code specific for billing\",\n        description=(\n            \"The package code can be used to group procedures that may be priced or\"\n            \" delivered as a single product. Such as DRGs.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Ranking of the procedure (for each type)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"How this procedure value should be used in charging the account\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AccountProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"code\",\n            \"dateOfService\",\n            \"type\",\n            \"packageCode\",\n            \"device\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AccountProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"device\"]\n\n\nclass AccountRelatedAccount(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Other associated accounts related to this account.\n    \"\"\"\n\n    __resource_type__ = \"AccountRelatedAccount\"\n\n    account: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"account\",\n        title=\"Reference to an associated Account\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"Relationship of the associated Account\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AccountRelatedAccount`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"relationship\", \"account\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AccountRelatedAccount`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/activitydefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ActivityDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ActivityDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The definition of a specific activity to be taken, independent of any\n    particular patient or context.\n    This resource allows for the definition of some activity to be performed,\n    independent of a particular patient, practitioner, or other performance\n    context.\n    \"\"\"\n\n    __resource_type__ = \"ActivityDefinition\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the activity definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    asNeededBoolean: bool | None = Field(\n        default=None,\n        alias=\"asNeededBoolean\",\n        title=\"Preconditions for service\",\n        description=(\n            \"If a CodeableConcept is present, it indicates the pre-condition for \"\n            'performing the service.  For example \"pain\", \"on flare-up\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n    asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_asNeededBoolean\",\n        title=\"Extension field for ``asNeededBoolean``.\",\n    )\n\n    asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"asNeededCodeableConcept\",\n        title=\"Preconditions for service\",\n        description=(\n            \"If a CodeableConcept is present, it indicates the pre-condition for \"\n            'performing the service.  For example \"pain\", \"on flare-up\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"What part of body to perform on\",\n        description=(\n            \"Indicates the sites on the subject's body where the procedure should \"\n            \"be performed (I.e. the target sites).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Detail type of activity\",\n        description=(\n            \"Detailed description of the type of activity; e.g. What lab test, what\"\n            \" procedure, what kind of encounter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the activity definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the activity definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the activity definition was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the activity definition\"\n            \" changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the activity definition\",\n        description=(\n            \"A free text natural language description of the activity definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"True if the activity should not be performed\",\n        description=(\n            \"Set this to true if the definition is to indicate that a particular \"\n            \"activity should NOT be performed. If true, this element should be \"\n            \"interpreted to reinforce a negative coding. For example NPO as a code \"\n            \"with a doNotPerform of true would still indicate to NOT perform the \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    dosage: typing.List[fhirtypes.DosageType] | None = Field(\n        default=None,\n        alias=\"dosage\",\n        title=\"Detailed dosage instructions\",\n        description=(\n            \"Provides detailed dosage instructions in the same way that they are \"\n            \"described for MedicationRequest resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dynamicValue: typing.List[\n        fhirtypes.ActivityDefinitionDynamicValueType\n    ] | None = Field(\n        default=None,\n        alias=\"dynamicValue\",\n        title=\"Dynamic aspects of the definition\",\n        description=(\n            \"Dynamic values that will be evaluated to produce values for elements \"\n            \"of the resulting resource. For example, if the dosage of a medication \"\n            \"must be computed based on the patient's weight, a dynamic value would \"\n            \"be used to specify an expression that calculated the weight, and the \"\n            \"path on the request resource that would contain the result.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the activity definition is expected to be used\",\n        description=(\n            \"The period during which the activity definition content was or is \"\n            \"planned to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"responsible for officially endorsing the content for use in some \"\n            \"setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this activity definition is authored \"\n            \"for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the activity definition\",\n        description=(\n            \"A formal identifier that is used to identify this activity definition \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"proposal | plan | directive | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            \"Indicates the level of authority/intentionality associated with the \"\n            \"activity and where the request should fit into the workflow chain.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposal\",\n                \"plan\",\n                \"directive\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for activity definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the activity definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"Kind of resource\",\n        description=(\n            \"A description of the kind of resource the activity definition is \"\n            \"representing. For example, a MedicationRequest, a ServiceRequest, or a\"\n            \" CommunicationRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the activity definition was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    library: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the activity definition\",\n        description=(\n            \"A reference to a Library resource containing any formal logic used by \"\n            \"the activity definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n    library__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_library\", title=\"Extension field for ``library``.\"\n    )\n\n    location: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where it should happen\",\n        description=(\n            \"Identifies the facility where the activity will occur; e.g. home, \"\n            \"hospital, specific clinic, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this activity definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the activity definition. This name\"\n            \" should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    observationRequirement: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"observationRequirement\",\n        title=\"What observations are required to perform this action\",\n        description=(\n            \"Defines observation requirements for the action to be performed, such \"\n            \"as body weight or surface area.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n    observationRequirement__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_observationRequirement\",\n        title=\"Extension field for ``observationRequirement``.\",\n    )\n\n    observationResultRequirement: typing.List[\n        fhirtypes.CanonicalType | None\n    ] | None = Field(\n        default=None,\n        alias=\"observationResultRequirement\",\n        title=\"What observations must be produced by this action\",\n        description=(\n            \"Defines the observations that are expected to be produced by the \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n    observationResultRequirement__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_observationResultRequirement\",\n        title=\"Extension field for ``observationResultRequirement``.\",\n    )\n\n    participant: typing.List[\n        fhirtypes.ActivityDefinitionParticipantType\n    ] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Who should participate in the action\",\n        description=\"Indicates who should participate in performing the action described.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the activity  should be addressed with respect \"\n            \"to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    productCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productCodeableConcept\",\n        title=\"What's administered/supplied\",\n        description=(\n            \"Identifies the food, drug or other product being consumed or supplied \"\n            \"in the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e product[x]\n            \"one_of_many\": \"product\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    productReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"productReference\",\n        title=\"What's administered/supplied\",\n        description=(\n            \"Identifies the food, drug or other product being consumed or supplied \"\n            \"in the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e product[x]\n            \"one_of_many\": \"product\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Medication\",\n                \"Ingredient\",\n                \"Substance\",\n                \"SubstanceDefinition\",\n            ],\n        },\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"What profile the resource needs to conform to\",\n        description=(\n            \"A profile to which the target of the activity definition is expected \"\n            \"to conform.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the activity definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this activity definition is defined\",\n        description=(\n            \"Explanation of why this activity definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"How much is administered/consumed/supplied\",\n        description=(\n            \"Identifies the quantity expected to be consumed at once (per dose, per\"\n            \" meal, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"primarily responsible for review of some aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specimenRequirement: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"specimenRequirement\",\n        title=\"What specimens are required to perform this action\",\n        description=(\n            \"Defines specimen requirements for the action to be performed, such as \"\n            \"required specimens for a lab test.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SpecimenDefinition\"],\n        },\n    )\n    specimenRequirement__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_specimenRequirement\",\n        title=\"Extension field for ``specimenRequirement``.\",\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this activity definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"subjectCanonical\",\n        title=\"Type of individual the activity definition is intended for\",\n        description=(\n            \"A code, group definition, or canonical reference that describes  or \"\n            \"identifies the intended subject of the activity being defined.  \"\n            \"Canonical references are allowed to support the definition of \"\n            \"protocols for drug and substance quality specifications, and is \"\n            \"allowed to reference a MedicinalProductDefinition, \"\n            \"SubstanceDefinition, AdministrableProductDefinition, \"\n            \"ManufacturedItemDefinition, or PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EvidenceVariable\"],\n        },\n    )\n    subjectCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subjectCanonical\",\n        title=\"Extension field for ``subjectCanonical``.\",\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=\"Type of individual the activity definition is intended for\",\n        description=(\n            \"A code, group definition, or canonical reference that describes  or \"\n            \"identifies the intended subject of the activity being defined.  \"\n            \"Canonical references are allowed to support the definition of \"\n            \"protocols for drug and substance quality specifications, and is \"\n            \"allowed to reference a MedicinalProductDefinition, \"\n            \"SubstanceDefinition, AdministrableProductDefinition, \"\n            \"ManufacturedItemDefinition, or PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=\"Type of individual the activity definition is intended for\",\n        description=(\n            \"A code, group definition, or canonical reference that describes  or \"\n            \"identifies the intended subject of the activity being defined.  \"\n            \"Canonical references are allowed to support the definition of \"\n            \"protocols for drug and substance quality specifications, and is \"\n            \"allowed to reference a MedicinalProductDefinition, \"\n            \"SubstanceDefinition, AdministrableProductDefinition, \"\n            \"ManufacturedItemDefinition, or PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Group\",\n                \"MedicinalProductDefinition\",\n                \"SubstanceDefinition\",\n                \"AdministrableProductDefinition\",\n                \"ManufacturedItemDefinition\",\n                \"PackagedProductDefinition\",\n            ],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the activity definition\",\n        description=(\n            \"An explanatory or alternate title for the activity definition giving \"\n            \"additional information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    timingAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"timingAge\",\n        title=\"When activity is to occur\",\n        description=\"The timing or frequency upon which the described activity is to occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"timingDuration\",\n        title=\"When activity is to occur\",\n        description=\"The timing or frequency upon which the described activity is to occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"timingRange\",\n        title=\"When activity is to occur\",\n        description=\"The timing or frequency upon which the described activity is to occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"When activity is to occur\",\n        description=\"The timing or frequency upon which the described activity is to occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this activity definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the activity definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptive topics related to the content of the activity. Topics \"\n            \"provide a high-level categorization of the activity that can be useful\"\n            \" for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    transform: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"transform\",\n        title=\"Transform to apply the template\",\n        description=(\n            \"A reference to a StructureMap resource that defines a transform that \"\n            \"can be executed to produce the intent resource using the \"\n            \"ActivityDefinition instance as the input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureMap\"],\n        },\n    )\n    transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_transform\", title=\"Extension field for ``transform``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this activity definition, represented as a \"\n            \"URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this activity definition when\"\n            \" it is referenced in a specification, model, design or an instance; \"\n            \"also called its canonical identifier. This SHOULD be globally unique \"\n            \"and SHOULD be a literal address at which an authoritative instance of \"\n            \"this activity definition is (or will be) published. This URL can be \"\n            \"the target of a canonical reference. It SHALL remain the same when the\"\n            \" activity definition is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the activity definition\",\n        description=(\n            \"A detailed description of how the activity definition is used from a \"\n            \"clinical perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate activity definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the activity definition\",\n        description=(\n            \"The identifier that is used to identify this version of the activity \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the activity \"\n            \"definition author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence. To provide a version consistent \"\n            \"with the Decision Support Service specification, use the format \"\n            \"Major.Minor.Revision (e.g. 1.0.0). For more information on versioning \"\n            \"knowledge assets, refer to the Decision Support Service specification.\"\n            \" Note that a version is required for non-experimental active assets.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ActivityDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"status\",\n            \"experimental\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"subjectCanonical\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"usage\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"library\",\n            \"kind\",\n            \"profile\",\n            \"code\",\n            \"intent\",\n            \"priority\",\n            \"doNotPerform\",\n            \"timingTiming\",\n            \"timingAge\",\n            \"timingRange\",\n            \"timingDuration\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n            \"location\",\n            \"participant\",\n            \"productReference\",\n            \"productCodeableConcept\",\n            \"quantity\",\n            \"dosage\",\n            \"bodySite\",\n            \"specimenRequirement\",\n            \"observationRequirement\",\n            \"observationResultRequirement\",\n            \"transform\",\n            \"dynamicValue\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ActivityDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"kind\",\n            \"code\",\n            \"doNotPerform\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"asNeeded\": [\"asNeededBoolean\", \"asNeededCodeableConcept\"],\n            \"product\": [\"productCodeableConcept\", \"productReference\"],\n            \"subject\": [\n                \"subjectCanonical\",\n                \"subjectCodeableConcept\",\n                \"subjectReference\",\n            ],\n            \"timing\": [\"timingAge\", \"timingDuration\", \"timingRange\", \"timingTiming\"],\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"],\n        }\n        return one_of_many_fields\n\n\nclass ActivityDefinitionDynamicValue(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dynamic aspects of the definition.\n    Dynamic values that will be evaluated to produce values for elements of the\n    resulting resource. For example, if the dosage of a medication must be\n    computed based on the patient's weight, a dynamic value would be used to\n    specify an expression that calculated the weight, and the path on the\n    request resource that would contain the result.\n    \"\"\"\n\n    __resource_type__ = \"ActivityDefinitionDynamicValue\"\n\n    expression: fhirtypes.ExpressionType = Field(\n        default=...,\n        alias=\"expression\",\n        title=\"An expression that provides the dynamic value for the customization\",\n        description=\"An expression specifying the value of the customized element.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"The path to the element to be set dynamically\",\n        description=(\n            \"The path to the element to be customized. This is the path on the \"\n            \"resource that will hold the result of the calculation defined by the \"\n            \"expression. The specified path SHALL be a FHIRPath resolvable on the \"\n            \"specified target type of the ActivityDefinition, and SHALL consist \"\n            \"only of identifiers, constant indexers, and a restricted subset of \"\n            \"functions. The path is allowed to contain qualifiers (.) to traverse \"\n            \"sub-elements, as well as indexers ([x]) to traverse multiple-\"\n            \"cardinality sub-elements (see the [Simple FHIRPath \"\n            \"Profile](fhirpath.html#simple) for full details).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ActivityDefinitionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"path\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ActivityDefinitionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"path\", \"path__ext\")]\n        return required_fields\n\n\nclass ActivityDefinitionParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who should participate in the action.\n    Indicates who should participate in performing the action described.\n    \"\"\"\n\n    __resource_type__ = \"ActivityDefinitionParticipant\"\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"E.g. Author, Reviewer, Witness, etc\",\n        description=(\n            \"Indicates how the actor will be involved in the action - author, \"\n            \"reviewer, witness, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"E.g. Nurse, Surgeon, Parent, etc\",\n        description=(\n            \"The role the participant should play in performing the described \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"careteam | device | group | healthcareservice | location | \"\n            \"organization | patient | practitioner | practitionerrole | \"\n            \"relatedperson\"\n        ),\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"careteam\",\n                \"device\",\n                \"group\",\n                \"healthcareservice\",\n                \"location\",\n                \"organization\",\n                \"patient\",\n                \"practitioner\",\n                \"practitionerrole\",\n                \"relatedperson\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    typeCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"typeCanonical\",\n        title=\"Who or what can participate\",\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n    typeCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_typeCanonical\",\n        title=\"Extension field for ``typeCanonical``.\",\n    )\n\n    typeReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"typeReference\",\n        title=\"Who or what can participate\",\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"Device\",\n                \"DeviceDefinition\",\n                \"Endpoint\",\n                \"Group\",\n                \"HealthcareService\",\n                \"Location\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ActivityDefinitionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"typeCanonical\",\n            \"typeReference\",\n            \"role\",\n            \"function\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ActivityDefinitionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/actordefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ActorDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass ActorDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An application that exchanges data.\n    Describes an actor - a human or an application that plays a role in data\n    exchange, and that may have obligations associated with the role the actor\n    plays.\n    \"\"\"\n\n    __resource_type__ = \"ActorDefinition\"\n\n    capabilities: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"capabilities\",\n        title=\"CapabilityStatement for the actor (if applicable)\",\n        description=\"The capability statement for the actor (if the concept is applicable).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n    capabilities__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_capabilities\",\n        title=\"Extension field for ``capabilities``.\",\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the actor definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the actor definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the actor definition was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the actor definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFrom: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Definition of this actor in another context / IG\",\n        description=(\n            \"A url that identifies the definition of this actor in another IG \"\n            \"(which IG must be listed in the dependencies). This actor inherits all\"\n            \" the obligations etc. as defined in the other IG.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActorDefinition\"],\n        },\n    )\n    derivedFrom__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_derivedFrom\", title=\"Extension field for ``derivedFrom``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the actor\",\n        description=\"A free text natural language description of the actor.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Functionality associated with the actor\",\n        description=\"Documentation about the functionality of the actor.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this actor definition is authored for\"\n            \" testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the actor definition (business identifier)\",\n        description=(\n            \"A formal identifier that is used to identify this actor definition \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for actor definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the actor definition is intended\"\n            \" to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this actor definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the actor definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the actor definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this actor definition is defined\",\n        description=(\n            \"Explanation of why this actor definition is needed and why it has been\"\n            \" designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    reference: typing.List[fhirtypes.UrlType | None] | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Reference to more information about the actor\",\n        description=(\n            \"A reference to additional documentation about the actor, but \"\n            \"description and documentation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reference__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this actor definition. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this actor definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the actor definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"person | system\",\n        description=\"Whether the actor represents a human or an appliction.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"person\", \"system\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this actor definition, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this actor definition when it\"\n            \" is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" actor definition is (or will be) published. This URL can be the \"\n            \"target of a canonical reference. It SHALL remain the same when the \"\n            \"actor definition is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate actor definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the actor definition\",\n        description=(\n            \"The identifier that is used to identify this version of the actor \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the actor definition \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ActorDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"type\",\n            \"documentation\",\n            \"reference\",\n            \"capabilities\",\n            \"derivedFrom\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ActorDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"type\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/address.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Address\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Address(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An address expressed using postal conventions (as opposed to GPS or other\n    location definition formats).\n    An address expressed using postal conventions (as opposed to GPS or other\n    location definition formats).  This data type may be used to convey\n    addresses for use in delivering mail as well as for visiting locations\n    which might not be valid for mail delivery.  There are a variety of postal\n    address formats defined around the world.\n    The ISO21090-codedString may be used to provide a coded representation of\n    the contents of strings in an Address.\n    \"\"\"\n\n    __resource_type__ = \"Address\"\n\n    city: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"city\",\n        title=\"Name of city, town etc.\",\n        description=(\n            \"The name of the city, town, suburb, village or other community or \"\n            \"delivery center.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    city__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_city\", title=\"Extension field for ``city``.\"\n    )\n\n    country: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"country\",\n        title=\"Country (e.g. may be ISO 3166 2 or 3 letter code)\",\n        description=\"Country - a nation as commonly understood or generally accepted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    country__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_country\", title=\"Extension field for ``country``.\"\n    )\n\n    district: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"district\",\n        title=\"District name (aka county)\",\n        description=\"The name of the administrative area (county).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    district__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_district\", title=\"Extension field for ``district``.\"\n    )\n\n    line: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"line\",\n        title=\"Street name, number, direction & P.O. Box etc.\",\n        description=(\n            \"This component contains the house number, apartment number, street \"\n            \"name, street direction,  P.O. Box number, delivery hints, and similar \"\n            \"address information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    line__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_line\", title=\"Extension field for ``line``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when address was/is in use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    postalCode: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"postalCode\",\n        title=\"Postal code for area\",\n        description=\"A postal code designating a region defined by the postal service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    postalCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_postalCode\", title=\"Extension field for ``postalCode``.\"\n    )\n\n    state: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"state\",\n        title=\"Sub-unit of country (abbreviations ok)\",\n        description=(\n            \"Sub-unit of a country with limited sovereignty in a federally \"\n            \"organized country. A code may be used if codes are in common use (e.g.\"\n            \" US 2 letter state codes).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    state__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_state\", title=\"Extension field for ``state``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text representation of the address\",\n        description=(\n            \"Specifies the entire address as it should be displayed e.g. on a \"\n            \"postal label. This may be provided instead of or as well as the \"\n            \"specific parts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"postal | physical | both\",\n        description=(\n            \"Distinguishes between physical addresses (those you can visit) and \"\n            \"mailing addresses (e.g. PO Boxes and care-of addresses). Most \"\n            \"addresses are both.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"postal\", \"physical\", \"both\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"home | work | temp | old | billing - purpose of this address\",\n        description=\"The purpose of this address.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"home\", \"work\", \"temp\", \"old\", \"billing\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Address`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"use\",\n            \"type\",\n            \"text\",\n            \"line\",\n            \"city\",\n            \"district\",\n            \"state\",\n            \"postalCode\",\n            \"country\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Address`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"use\",\n            \"type\",\n            \"text\",\n            \"line\",\n            \"city\",\n            \"district\",\n            \"state\",\n            \"postalCode\",\n            \"country\",\n            \"period\",\n        ]\n"
  },
  {
    "path": "fhir/resources/administrableproductdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AdministrableProductDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass AdministrableProductDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A medicinal product in the final form, suitable for administration - after\n    any mixing of multiple components.\n    A medicinal product in the final form which is suitable for administering\n    to a patient (after any mixing of multiple components, dissolution etc. has\n    been performed).\n    \"\"\"\n\n    __resource_type__ = \"AdministrableProductDefinition\"\n\n    administrableDoseForm: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"administrableDoseForm\",\n        title=(\n            \"The dose form of the final product after necessary reconstitution or \"\n            \"processing\"\n        ),\n        description=(\n            \"The dose form of the final product after necessary reconstitution or \"\n            \"processing. Contrasts to the manufactured dose form (see \"\n            \"ManufacturedItemDefinition). If the manufactured form was 'powder for \"\n            \"solution for injection', the administrable dose form could be \"\n            \"'solution for injection' (once mixed with another item having \"\n            \"manufactured form 'solvent for solution for injection').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=(\n            \"A general description of the product, when in its final form, suitable\"\n            \" for administration e.g. effervescent blue liquid, to be swallowed\"\n        ),\n        description=(\n            \"A general description of the product, when in its final form, suitable\"\n            \" for administration e.g. effervescent blue liquid, to be swallowed. \"\n            \"Intended to be used when the other structured properties of this \"\n            \"resource are insufficient or cannot be supported. It is not intended \"\n            \"to duplicate information already carried elswehere.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=(\n            \"A device that is integral to the medicinal product, in effect being \"\n            'considered as an \"ingredient\" of the medicinal product'\n        ),\n        description=(\n            \"A device that is integral to the medicinal product, in effect being \"\n            'considered as an \"ingredient\" of the medicinal product. This is not '\n            \"intended for devices that are just co-packaged.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceDefinition\"],\n        },\n    )\n\n    formOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"formOf\",\n        title=(\n            \"References a product from which one or more of the constituent parts \"\n            \"of that product can be prepared and used as described by this \"\n            \"administrable product\"\n        ),\n        description=(\n            \"References a product from which one or more of the constituent parts \"\n            \"of that product can be prepared and used as described by this \"\n            \"administrable product.  If this administrable product describes the \"\n            \"administration of a crushed tablet, the 'formOf' would be the product \"\n            \"representing a distribution containing tablets and possibly also a \"\n            \"cream.  This is distinct from the 'producedFrom' which refers to the \"\n            \"specific components of the product that are used in this preparation, \"\n            \"rather than the product as a whole.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicinalProductDefinition\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier for the administrable product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=(\n            \"The ingredients of this administrable medicinal product. This is only \"\n            \"needed if the ingredients are not specified either using \"\n            \"ManufacturedItemDefiniton, or using by incoming references from the \"\n            \"Ingredient resource\"\n        ),\n        description=(\n            \"The ingredients of this administrable medicinal product. This is only \"\n            \"needed if the ingredients are not specified either using \"\n            \"ManufacturedItemDefiniton (via \"\n            \"AdministrableProductDefinition.producedFrom) to state which component \"\n            \"items are used to make this, or using by incoming references from the \"\n            \"Ingredient resource, to state in detail which substances exist within \"\n            \"this. This element allows a basic coded ingredient to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    producedFrom: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"producedFrom\",\n        title=(\n            \"Indicates the specific manufactured items that are part of the \"\n            \"'formOf' product that are used in the preparation of this specific \"\n            \"administrable form\"\n        ),\n        description=(\n            \"Indicates the specific manufactured items that are part of the \"\n            \"'formOf' product that are used in the preparation of this specific \"\n            \"administrable form.  In some cases, an administrable form might use \"\n            \"all of the items from the overall product (or there might only be one \"\n            \"item), while in other cases, an administrable form might use only a \"\n            \"subset of the items available in the overall product.  For example, an\"\n            \" administrable form might involve combining a liquid and a powder \"\n            \"available as part of an overall product, but not involve applying the \"\n            \"also supplied cream.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ManufacturedItemDefinition\"],\n        },\n    )\n\n    property: typing.List[\n        fhirtypes.AdministrableProductDefinitionPropertyType\n    ] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Characteristics e.g. a product's onset of action\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    routeOfAdministration: typing.List[\n        fhirtypes.AdministrableProductDefinitionRouteOfAdministrationType\n    ] = Field(\n        default=...,\n        alias=\"routeOfAdministration\",\n        title=(\n            \"The path by which the product is taken into or makes contact with the \"\n            \"body\"\n        ),\n        description=(\n            \"The path by which the product is taken into or makes contact with the \"\n            \"body. In some regions this is referred to as the licenced or approved \"\n            \"route. RouteOfAdministration cannot be used when the 'formOf' product \"\n            \"already uses MedicinalProductDefinition.route (and vice versa).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this administrable product. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    unitOfPresentation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unitOfPresentation\",\n        title=(\n            \"The presentation type in which this item is given to a patient. e.g. \"\n            \"for a spray - 'puff'\"\n        ),\n        description=(\n            \"The presentation type in which this item is given to a patient. e.g. \"\n            \"for a spray - 'puff' (as in 'contains 100 mcg per puff'), or for a \"\n            \"liquid - 'vial' (as in 'contains 5 ml per vial').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdministrableProductDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"formOf\",\n            \"administrableDoseForm\",\n            \"unitOfPresentation\",\n            \"producedFrom\",\n            \"ingredient\",\n            \"device\",\n            \"description\",\n            \"property\",\n            \"routeOfAdministration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"formOf\",\n            \"administrableDoseForm\",\n            \"unitOfPresentation\",\n            \"producedFrom\",\n            \"ingredient\",\n            \"device\",\n            \"property\",\n            \"routeOfAdministration\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass AdministrableProductDefinitionProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Characteristics e.g. a product's onset of action.\n    \"\"\"\n\n    __resource_type__ = \"AdministrableProductDefinitionProperty\"\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"The status of characteristic e.g. assigned or pending\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"A code expressing the type of characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Binary\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdministrableProductDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueMarkdown\",\n            \"valueAttachment\",\n            \"valueReference\",\n            \"status\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueMarkdown\",\n            \"valueAttachment\",\n            \"valueReference\",\n            \"status\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDate\",\n                \"valueMarkdown\",\n                \"valueQuantity\",\n                \"valueReference\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass AdministrableProductDefinitionRouteOfAdministration(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The path by which the product is taken into or makes contact with the body.\n    The path by which the product is taken into or makes contact with the body.\n    In some regions this is referred to as the licenced or approved route.\n    RouteOfAdministration cannot be used when the 'formOf' product already uses\n    MedicinalProductDefinition.route (and vice versa).\n    \"\"\"\n\n    __resource_type__ = \"AdministrableProductDefinitionRouteOfAdministration\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Coded expression for the route\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    firstDose: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"firstDose\",\n        title=(\n            \"The first dose (dose quantity) administered can be specified for the \"\n            \"product\"\n        ),\n        description=(\n            \"The first dose (dose quantity) administered can be specified for the \"\n            \"product, using a numerical value and its unit of measurement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxDosePerDay: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxDosePerDay\",\n        title=\"The maximum dose quantity to be administered in any one 24-h period\",\n        description=(\n            \"The maximum dose per day (maximum dose quantity to be administered in \"\n            \"any one 24-h period) that can be administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxDosePerTreatmentPeriod: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"maxDosePerTreatmentPeriod\",\n        title=\"The maximum dose per treatment period that can be administered\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxSingleDose: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxSingleDose\",\n        title=\"The maximum single dose that can be administered\",\n        description=(\n            \"The maximum single dose that can be administered, specified using a \"\n            \"numerical value and its unit of measurement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxTreatmentPeriod: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"maxTreatmentPeriod\",\n        title=(\n            \"The maximum treatment period during which the product can be \"\n            \"administered\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    targetSpecies: typing.List[\n        fhirtypes.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType\n    ] | None = Field(\n        default=None,\n        alias=\"targetSpecies\",\n        title=\"A species for which this route applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdministrableProductDefinitionRouteOfAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"firstDose\",\n            \"maxSingleDose\",\n            \"maxDosePerDay\",\n            \"maxDosePerTreatmentPeriod\",\n            \"maxTreatmentPeriod\",\n            \"targetSpecies\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionRouteOfAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"code\",\n            \"firstDose\",\n            \"maxSingleDose\",\n            \"maxDosePerDay\",\n            \"maxDosePerTreatmentPeriod\",\n            \"maxTreatmentPeriod\",\n            \"targetSpecies\",\n        ]\n\n\nclass AdministrableProductDefinitionRouteOfAdministrationTargetSpecies(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A species for which this route applies.\n    \"\"\"\n\n    __resource_type__ = (\n        \"AdministrableProductDefinitionRouteOfAdministrationTargetSpecies\"\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Coded expression for the species\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    withdrawalPeriod: typing.List[\n        fhirtypes.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType\n    ] | None = Field(\n        default=None,\n        alias=\"withdrawalPeriod\",\n        title=(\n            \"A species specific time during which consumption of animal product is \"\n            \"not appropriate\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdministrableProductDefinitionRouteOfAdministrationTargetSpecies`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"withdrawalPeriod\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionRouteOfAdministrationTargetSpecies`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"withdrawalPeriod\"]\n\n\nclass AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A species specific time during which consumption of animal product is not\n    appropriate.\n    \"\"\"\n\n    __resource_type__ = \"AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod\"\n\n    supportingInformation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Extra information about the withdrawal period\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    supportingInformation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_supportingInformation\",\n        title=\"Extension field for ``supportingInformation``.\",\n    )\n\n    tissue: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"tissue\",\n        title=(\n            \"The type of tissue for which the withdrawal period applies, e.g. meat,\"\n            \" milk\"\n        ),\n        description=(\n            \"Coded expression for the type of tissue for which the withdrawal \"\n            \"period applies, e.g. meat, milk.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    value: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"value\",\n        title=\"A value for the time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"tissue\",\n            \"value\",\n            \"supportingInformation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"tissue\", \"value\", \"supportingInformation\"]\n"
  },
  {
    "path": "fhir/resources/adverseevent.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AdverseEvent\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass AdverseEvent(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An event that may be related to unintended effects on a patient or research\n    participant.\n    An event (i.e. any change to current patient status) that may be related to\n    unintended effects on a patient or research participant. The unintended\n    effects may require additional monitoring, treatment, hospitalization, or\n    may result in death. The AdverseEvent resource also extends to potential or\n    avoided events that could have had such effects. There are two major\n    domains where the AdverseEvent resource is expected to be used. One is in\n    clinical care reported adverse events and the other is in reporting adverse\n    events in clinical  research trial management. Adverse events can be\n    reported by healthcare providers, patients, caregivers or by medical\n    products manufacturers. Given the differences between these two concepts,\n    we recommend consulting the domain specific implementation guides when\n    implementing the AdverseEvent Resource. The implementation guides include\n    specific extensions, value sets and constraints.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEvent\"\n\n    actuality: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"actuality\",\n        title=\"actual | potential\",\n        description=(\n            \"Whether the event actually happened or was a near miss. Note that this\"\n            \" is independent of whether anyone was affected or harmed or how \"\n            \"severely.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"actual\", \"potential\"],\n        },\n    )\n    actuality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actuality\", title=\"Extension field for ``actuality``.\"\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=(\n            \"wrong-patient | procedure-mishap | medication-mishap | device | \"\n            \"unsafe-physical-environment | hospital-aquired-infection | wrong-body-\"\n            \"site\"\n        ),\n        description=\"The overall type of event, intended for search and filtering purposes.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Event or incident that occurred or was averted\",\n        description=(\n            \"Specific event that occurred or that was averted, such as patient \"\n            \"fall, wrong organ removed, or wrong blood transfused.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contributingFactor: typing.List[\n        fhirtypes.AdverseEventContributingFactorType\n    ] | None = Field(\n        default=None,\n        alias=\"contributingFactor\",\n        title=(\n            \"Contributing factors suspected to have increased the probability or \"\n            \"severity of the adverse event\"\n        ),\n        description=(\n            \"The contributing factors suspected to have increased the probability \"\n            \"or severity of the adverse event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    detected: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"detected\",\n        title=\"When the event was detected\",\n        description=(\n            \"Estimated or actual date the AdverseEvent began, in the opinion of the\"\n            \" reporter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    detected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_detected\", title=\"Extension field for ``detected``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"The Encounter associated with the start of the AdverseEvent\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    expectedInResearchStudy: bool | None = Field(\n        default=None,\n        alias=\"expectedInResearchStudy\",\n        title=\"Considered likely or probable or anticipated in the research study\",\n        description=(\n            \"Considered likely or probable or anticipated in the research study.  \"\n            \"Whether the reported event matches any of the outcomes for the patient\"\n            \" that are considered by the study as known or likely.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expectedInResearchStudy__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_expectedInResearchStudy\",\n        title=\"Extension field for ``expectedInResearchStudy``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for the event\",\n        description=(\n            \"Business identifiers assigned to this adverse event by the performer \"\n            \"or other systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Location where adverse event occurred\",\n        description=\"The information about where the adverse event occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    mitigatingAction: typing.List[\n        fhirtypes.AdverseEventMitigatingActionType\n    ] | None = Field(\n        default=None,\n        alias=\"mitigatingAction\",\n        title=(\n            \"Ameliorating actions taken after the adverse event occured in order to\"\n            \" reduce the extent of harm\"\n        ),\n        description=(\n            \"The ameliorating action taken after the adverse event occured in order\"\n            \" to reduce the extent of harm.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comment on adverse event\",\n        description=(\n            \"Comments made about the adverse event by the performer, subject or \"\n            \"other participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When the event occurred\",\n        description=\"The date (and perhaps time) when the adverse event occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When the event occurred\",\n        description=\"The date (and perhaps time) when the adverse event occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When the event occurred\",\n        description=\"The date (and perhaps time) when the adverse event occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    outcome: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"Type of outcome from the adverse event\",\n        description=(\n            \"Describes the type of outcome from the adverse event, such as \"\n            \"resolved, recovering, ongoing, resolved-with-sequelae, or fatal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    participant: typing.List[fhirtypes.AdverseEventParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=(\n            \"Who was involved in the adverse event or the potential adverse event \"\n            \"and what they did\"\n        ),\n        description=(\n            \"Indicates who or what participated in the adverse event and how they \"\n            \"were involved.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    preventiveAction: typing.List[\n        fhirtypes.AdverseEventPreventiveActionType\n    ] | None = Field(\n        default=None,\n        alias=\"preventiveAction\",\n        title=\"Preventive actions that contributed to avoiding the adverse event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    recordedDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recordedDate\",\n        title=\"When the event was recorded\",\n        description=(\n            \"The date on which the existence of the AdverseEvent was first \" \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    recordedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_recordedDate\",\n        title=\"Extension field for ``recordedDate``.\",\n    )\n\n    recorder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recorder\",\n        title=\"Who recorded the adverse event\",\n        description=(\n            \"Information on who recorded the adverse event.  May be the patient or \"\n            \"a practitioner.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"ResearchSubject\",\n            ],\n        },\n    )\n\n    resultingEffect: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"resultingEffect\",\n        title=\"Effect on the subject due to this event\",\n        description=(\n            \"Information about the condition that occurred as a result of the \"\n            \"adverse event, such as hives due to the exposure to a substance (for \"\n            \"example, a drug or a chemical) or a broken leg as a result of the \"\n            \"fall.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    seriousness: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"seriousness\",\n        title=\"Seriousness or gravity of the event\",\n        description=(\n            \"Assessment whether this event, or averted event, was of clinical \"\n            \"importance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"in-progress | completed | entered-in-error | unknown\",\n        description=\"The current state of the adverse event or potential adverse event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"in-progress\", \"completed\", \"entered-in-error\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    study: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"study\",\n        title=\"Research study that the subject is enrolled in\",\n        description=\"The research study that the subject is enrolled in.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchStudy\"],\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Subject impacted by event\",\n        description=\"This subject or group impacted by the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"ResearchSubject\",\n            ],\n        },\n    )\n\n    supportingInfo: typing.List[\n        fhirtypes.AdverseEventSupportingInfoType\n    ] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Supporting information relevant to the event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    suspectEntity: typing.List[fhirtypes.AdverseEventSuspectEntityType] | None = Field(\n        default=None,\n        alias=\"suspectEntity\",\n        title=\"The suspected agent causing the adverse event\",\n        description=(\n            \"Describes the entity that is suspected to have caused the adverse \"\n            \"event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"actuality\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"detected\",\n            \"recordedDate\",\n            \"resultingEffect\",\n            \"location\",\n            \"seriousness\",\n            \"outcome\",\n            \"recorder\",\n            \"participant\",\n            \"study\",\n            \"expectedInResearchStudy\",\n            \"suspectEntity\",\n            \"contributingFactor\",\n            \"preventiveAction\",\n            \"mitigatingAction\",\n            \"supportingInfo\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"actuality\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"detected\",\n            \"recordedDate\",\n            \"resultingEffect\",\n            \"location\",\n            \"seriousness\",\n            \"outcome\",\n            \"recorder\",\n            \"participant\",\n            \"study\",\n            \"suspectEntity\",\n            \"contributingFactor\",\n            \"preventiveAction\",\n            \"mitigatingAction\",\n            \"supportingInfo\",\n            \"note\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"actuality\", \"actuality__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\", \"occurrenceTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass AdverseEventContributingFactor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contributing factors suspected to have increased the probability or\n    severity of the adverse event.\n    The contributing factors suspected to have increased the probability or\n    severity of the adverse event.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEventContributingFactor\"\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=(\n            \"Item suspected to have increased the probability or severity of the \"\n            \"adverse event\"\n        ),\n        description=(\n            \"The item that is suspected to have increased the probability or \"\n            \"severity of the adverse event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=(\n            \"Item suspected to have increased the probability or severity of the \"\n            \"adverse event\"\n        ),\n        description=(\n            \"The item that is suspected to have increased the probability or \"\n            \"severity of the adverse event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"AllergyIntolerance\",\n                \"FamilyMemberHistory\",\n                \"Immunization\",\n                \"Procedure\",\n                \"Device\",\n                \"DeviceUsage\",\n                \"DocumentReference\",\n                \"MedicationAdministration\",\n                \"MedicationStatement\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEventContributingFactor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemReference\",\n            \"itemCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEventContributingFactor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"itemReference\", \"itemCodeableConcept\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n\n\nclass AdverseEventMitigatingAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Ameliorating actions taken after the adverse event occured in order to\n    reduce the extent of harm.\n    The ameliorating action taken after the adverse event occured in order to\n    reduce the extent of harm.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEventMitigatingAction\"\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=(\n            \"Ameliorating action taken after the adverse event occured in order to \"\n            \"reduce the extent of harm\"\n        ),\n        description=(\n            \"The ameliorating action taken after the adverse event occured in order\"\n            \" to reduce the extent of harm.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=(\n            \"Ameliorating action taken after the adverse event occured in order to \"\n            \"reduce the extent of harm\"\n        ),\n        description=(\n            \"The ameliorating action taken after the adverse event occured in order\"\n            \" to reduce the extent of harm.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Procedure\",\n                \"DocumentReference\",\n                \"MedicationAdministration\",\n                \"MedicationRequest\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEventMitigatingAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemReference\",\n            \"itemCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEventMitigatingAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"itemReference\", \"itemCodeableConcept\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n\n\nclass AdverseEventParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who was involved in the adverse event or the potential adverse event and\n    what they did.\n    Indicates who or what participated in the adverse event and how they were\n    involved.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEventParticipant\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Who was involved in the adverse event or the potential adverse event\",\n        description=\"Indicates who or what participated in the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n                \"ResearchSubject\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of involvement\",\n        description=(\n            \"Distinguishes the type of involvement of the actor in the adverse \"\n            \"event, such as contributor or informant.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEventParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEventParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n\n\nclass AdverseEventPreventiveAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Preventive actions that contributed to avoiding the adverse event.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEventPreventiveAction\"\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"Action that contributed to avoiding the adverse event\",\n        description=\"The action that contributed to avoiding the adverse event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"Action that contributed to avoiding the adverse event\",\n        description=\"The action that contributed to avoiding the adverse event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Immunization\",\n                \"Procedure\",\n                \"DocumentReference\",\n                \"MedicationAdministration\",\n                \"MedicationRequest\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEventPreventiveAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemReference\",\n            \"itemCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEventPreventiveAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"itemReference\", \"itemCodeableConcept\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n\n\nclass AdverseEventSupportingInfo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supporting information relevant to the event.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEventSupportingInfo\"\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"Subject medical history or document relevant to this adverse event\",\n        description=(\n            \"Relevant past history for the subject. In a clinical care context, an \"\n            \"example being a patient had an adverse event following a pencillin \"\n            \"administration and the patient had a previously documented penicillin \"\n            \"allergy. In a clinical trials context, an example is a bunion or rash \"\n            \"that was present prior to the study. Additionally, the supporting item\"\n            \" can be a document that is relevant to this instance of the adverse \"\n            \"event that is not part of the subject's medical history. For example, \"\n            \"a clinical note, staff list, or material safety data sheet (MSDS).  \"\n            \"Supporting information is not a contributing factor, preventive \"\n            \"action, or mitigating action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"Subject medical history or document relevant to this adverse event\",\n        description=(\n            \"Relevant past history for the subject. In a clinical care context, an \"\n            \"example being a patient had an adverse event following a pencillin \"\n            \"administration and the patient had a previously documented penicillin \"\n            \"allergy. In a clinical trials context, an example is a bunion or rash \"\n            \"that was present prior to the study. Additionally, the supporting item\"\n            \" can be a document that is relevant to this instance of the adverse \"\n            \"event that is not part of the subject's medical history. For example, \"\n            \"a clinical note, staff list, or material safety data sheet (MSDS).  \"\n            \"Supporting information is not a contributing factor, preventive \"\n            \"action, or mitigating action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"AllergyIntolerance\",\n                \"FamilyMemberHistory\",\n                \"Immunization\",\n                \"Procedure\",\n                \"DocumentReference\",\n                \"MedicationAdministration\",\n                \"MedicationStatement\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEventSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemReference\",\n            \"itemCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEventSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"itemReference\", \"itemCodeableConcept\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n\n\nclass AdverseEventSuspectEntity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The suspected agent causing the adverse event.\n    Describes the entity that is suspected to have caused the adverse event.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEventSuspectEntity\"\n\n    causality: fhirtypes.AdverseEventSuspectEntityCausalityType | None = Field(\n        default=None,\n        alias=\"causality\",\n        title=\"Information on the possible cause of the event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instanceCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"instanceCodeableConcept\",\n        title=\"Refers to the specific entity that caused the adverse event\",\n        description=(\n            \"Identifies the actual instance of what caused the adverse event.  May \"\n            \"be a substance, medication, medication administration, medication \"\n            \"statement or a device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e instance[x]\n            \"one_of_many\": \"instance\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    instanceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"instanceReference\",\n        title=\"Refers to the specific entity that caused the adverse event\",\n        description=(\n            \"Identifies the actual instance of what caused the adverse event.  May \"\n            \"be a substance, medication, medication administration, medication \"\n            \"statement or a device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e instance[x]\n            \"one_of_many\": \"instance\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Immunization\",\n                \"Procedure\",\n                \"Substance\",\n                \"Medication\",\n                \"MedicationAdministration\",\n                \"MedicationStatement\",\n                \"Device\",\n                \"BiologicallyDerivedProduct\",\n                \"ResearchStudy\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEventSuspectEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"instanceCodeableConcept\",\n            \"instanceReference\",\n            \"causality\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEventSuspectEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"instanceCodeableConcept\",\n            \"instanceReference\",\n            \"causality\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"instance\": [\"instanceCodeableConcept\", \"instanceReference\"]\n        }\n        return one_of_many_fields\n\n\nclass AdverseEventSuspectEntityCausality(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information on the possible cause of the event.\n    \"\"\"\n\n    __resource_type__ = \"AdverseEventSuspectEntityCausality\"\n\n    assessmentMethod: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"assessmentMethod\",\n        title=(\n            \"Method of evaluating the relatedness of the suspected entity to the \"\n            \"event\"\n        ),\n        description=(\n            \"The method of evaluating the relatedness of the suspected entity to \"\n            \"the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Author of the information on the possible cause of the event\",\n        description=\"The author of the information on the possible cause of the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"ResearchSubject\",\n            ],\n        },\n    )\n\n    entityRelatedness: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"entityRelatedness\",\n        title=(\n            \"Result of the assessment regarding the relatedness of the suspected \"\n            \"entity to the event\"\n        ),\n        description=(\n            \"The result of the assessment regarding the relatedness of the \"\n            \"suspected entity to the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AdverseEventSuspectEntityCausality`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"assessmentMethod\",\n            \"entityRelatedness\",\n            \"author\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AdverseEventSuspectEntityCausality`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"assessmentMethod\", \"entityRelatedness\", \"author\"]\n"
  },
  {
    "path": "fhir/resources/age.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Age\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Age(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A duration of time during which an organism (or a process) has existed.\n    \"\"\"\n\n    __resource_type__ = \"Age\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Age`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Age`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/allergyintolerance.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AllergyIntolerance\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass AllergyIntolerance(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Allergy or Intolerance (generally: Risk of adverse reaction to a substance).\n    Risk of harmful or undesirable physiological response which is specific to\n    an individual and associated with exposure to a substance.\n    \"\"\"\n\n    __resource_type__ = \"AllergyIntolerance\"\n\n    category: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"food | medication | environment | biologic\",\n        description=\"Category of the identified substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"food\", \"medication\", \"environment\", \"biologic\"],\n        },\n    )\n    category__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_category\", title=\"Extension field for ``category``.\"\n    )\n\n    clinicalStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"clinicalStatus\",\n        title=\"active | inactive | resolved\",\n        description=\"The clinical status of the allergy or intolerance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies the allergy or intolerance\",\n        description=(\n            \"Code for an allergy or intolerance statement (either a positive or a \"\n            \"negated/excluded statement).  This may be a code for a substance or \"\n            \"pharmaceutical product that is considered to be responsible for the \"\n            'adverse reaction risk (e.g., \"Latex\"), an allergy or intolerance '\n            'condition (e.g., \"Latex allergy\"), or a negated/excluded code for a '\n            'specific substance or class (e.g., \"No latex allergy\") or a general or'\n            ' categorical negated statement (e.g.,  \"No known allergy\", \"No known '\n            'drug allergies\").  Note: the substance for a specific reaction may be '\n            \"different from the substance identified as the cause of the risk, but \"\n            \"it must be consistent with it. For instance, it may be a more specific\"\n            \" substance (e.g. a brand medication) or a composite product that \"\n            \"includes the identified substance. It must be clinically safe to only \"\n            \"process the 'code' and ignore the 'reaction.substance'.  If a \"\n            \"receiving system is unable to confirm that \"\n            \"AllergyIntolerance.reaction.substance falls within the semantic scope \"\n            \"of AllergyIntolerance.code, then the receiving system should ignore \"\n            \"AllergyIntolerance.reaction.substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    criticality: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"criticality\",\n        title=\"low | high | unable-to-assess\",\n        description=(\n            \"Estimate of the potential clinical harm, or seriousness, of the \"\n            \"reaction to the identified substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"low\", \"high\", \"unable-to-assess\"],\n        },\n    )\n    criticality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_criticality\", title=\"Extension field for ``criticality``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter when the allergy or intolerance was asserted\",\n        description=\"The encounter when the allergy or intolerance was asserted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External ids for this item\",\n        description=(\n            \"Business identifiers assigned to this AllergyIntolerance by the \"\n            \"performer or other systems which remain constant as the resource is \"\n            \"updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastOccurrence: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"lastOccurrence\",\n        title=\"Date(/time) of last known occurrence of a reaction\",\n        description=(\n            \"Represents the date and/or time of the last known occurrence of a \"\n            \"reaction event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastOccurrence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastOccurrence\",\n        title=\"Extension field for ``lastOccurrence``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional text not captured in other fields\",\n        description=(\n            \"Additional narrative about the propensity for the Adverse Reaction, \"\n            \"not captured in other fields.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onsetAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"onsetAge\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"onsetDateTime\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_onsetDateTime\",\n        title=\"Extension field for ``onsetDateTime``.\",\n    )\n\n    onsetPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"onsetPeriod\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"onsetRange\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"onsetString\",\n        title=\"When allergy or intolerance was identified\",\n        description=(\n            \"Estimated or actual date,  date-time, or age when allergy or \"\n            \"intolerance was identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onsetString\", title=\"Extension field for ``onsetString``.\"\n    )\n\n    participant: typing.List[\n        fhirtypes.AllergyIntoleranceParticipantType\n    ] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=(\n            \"Who or what participated in the activities related to the allergy or \"\n            \"intolerance and how they were involved\"\n        ),\n        description=(\n            \"Indicates who or what participated in the activities related to the \"\n            \"allergy or intolerance and how they were involved.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who the allergy or intolerance is for\",\n        description=\"The patient who has the allergy or intolerance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    reaction: typing.List[fhirtypes.AllergyIntoleranceReactionType] | None = Field(\n        default=None,\n        alias=\"reaction\",\n        title=\"Adverse Reaction Events linked to exposure to substance\",\n        description=(\n            \"Details about each adverse reaction event linked to exposure to the \"\n            \"identified substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recordedDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recordedDate\",\n        title=\"Date allergy or intolerance was first recorded\",\n        description=(\n            \"The recordedDate represents when this particular AllergyIntolerance \"\n            \"record was created in the system, which is often a system-generated \"\n            \"date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    recordedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_recordedDate\",\n        title=\"Extension field for ``recordedDate``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"allergy | intolerance - Underlying mechanism (if known)\",\n        description=(\n            \"Identification of the underlying physiological mechanism for the \"\n            \"reaction risk.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    verificationStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"verificationStatus\",\n        title=\"unconfirmed | presumed | confirmed | refuted | entered-in-error\",\n        description=(\n            \"Assertion about certainty associated with the propensity, or potential\"\n            \" risk, of a reaction to the identified substance (including \"\n            \"pharmaceutical product).  The verification status pertains to the \"\n            \"allergy or intolerance, itself, not to any specific AllergyIntolerance\"\n            \" attribute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AllergyIntolerance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"clinicalStatus\",\n            \"verificationStatus\",\n            \"type\",\n            \"category\",\n            \"criticality\",\n            \"code\",\n            \"patient\",\n            \"encounter\",\n            \"onsetDateTime\",\n            \"onsetAge\",\n            \"onsetPeriod\",\n            \"onsetRange\",\n            \"onsetString\",\n            \"recordedDate\",\n            \"participant\",\n            \"lastOccurrence\",\n            \"note\",\n            \"reaction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AllergyIntolerance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"clinicalStatus\",\n            \"verificationStatus\",\n            \"type\",\n            \"category\",\n            \"criticality\",\n            \"code\",\n            \"patient\",\n            \"participant\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"onset\": [\n                \"onsetAge\",\n                \"onsetDateTime\",\n                \"onsetPeriod\",\n                \"onsetRange\",\n                \"onsetString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass AllergyIntoleranceParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who or what participated in the activities related to the allergy or\n    intolerance and how they were involved.\n    Indicates who or what participated in the activities related to the allergy\n    or intolerance and how they were involved.\n    \"\"\"\n\n    __resource_type__ = \"AllergyIntoleranceParticipant\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=(\n            \"Who or what participated in the activities related to the allergy or \"\n            \"intolerance\"\n        ),\n        description=(\n            \"Indicates who or what participated in the activities related to the \"\n            \"allergy or intolerance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of involvement\",\n        description=(\n            \"Distinguishes the type of involvement of the actor in the activities \"\n            \"related to the allergy or intolerance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AllergyIntoleranceParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AllergyIntoleranceParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n\n\nclass AllergyIntoleranceReaction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adverse Reaction Events linked to exposure to substance.\n    Details about each adverse reaction event linked to exposure to the\n    identified substance.\n    \"\"\"\n\n    __resource_type__ = \"AllergyIntoleranceReaction\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the event as a whole\",\n        description=(\n            \"Text description about the reaction as a whole, including details of \"\n            \"the manifestation if required.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    exposureRoute: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"exposureRoute\",\n        title=\"How the subject was exposed to the substance\",\n        description=(\n            \"Identification of the route by which the subject was exposed to the \"\n            \"substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    manifestation: typing.List[fhirtypes.CodeableReferenceType] = Field(\n        default=...,\n        alias=\"manifestation\",\n        title=\"Clinical symptoms/signs associated with the Event\",\n        description=(\n            \"Clinical symptoms and/or signs that are observed or associated with \"\n            \"the adverse reaction event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Text about event not captured in other fields\",\n        description=(\n            \"Additional text about the adverse reaction event not captured in other\"\n            \" fields.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onset: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"onset\",\n        title=\"Date(/time) when manifestations showed\",\n        description=\"Record of the date and/or time of the onset of the Reaction.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    onset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onset\", title=\"Extension field for ``onset``.\"\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"mild | moderate | severe (of event as a whole)\",\n        description=(\n            \"Clinical assessment of the severity of the reaction event as a whole, \"\n            \"potentially considering multiple different manifestations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"mild\", \"moderate\", \"severe\"],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    substance: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"substance\",\n        title=(\n            \"Specific substance or pharmaceutical product considered to be \"\n            \"responsible for event\"\n        ),\n        description=(\n            \"Identification of the specific substance (or pharmaceutical product) \"\n            \"considered to be responsible for the Adverse Reaction event. Note: the\"\n            \" substance for a specific reaction may be different from the substance\"\n            \" identified as the cause of the risk, but it must be consistent with \"\n            \"it. For instance, it may be a more specific substance (e.g. a brand \"\n            \"medication) or a composite product that includes the identified \"\n            \"substance. It must be clinically safe to only process the 'code' and \"\n            \"ignore the 'reaction.substance'.  If a receiving system is unable to \"\n            \"confirm that AllergyIntolerance.reaction.substance falls within the \"\n            \"semantic scope of AllergyIntolerance.code, then the receiving system \"\n            \"should ignore AllergyIntolerance.reaction.substance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AllergyIntoleranceReaction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"substance\",\n            \"manifestation\",\n            \"description\",\n            \"onset\",\n            \"severity\",\n            \"exposureRoute\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AllergyIntoleranceReaction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/annotation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Annotation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Annotation(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Text node with attribution.\n    A  text note which also  contains information about who made the statement\n    and when.\n    \"\"\"\n\n    __resource_type__ = \"Annotation\"\n\n    authorReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authorReference\",\n        title=\"Individual responsible for the annotation\",\n        description=\"The individual responsible for making the annotation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e author[x]\n            \"one_of_many\": \"author\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    authorString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"authorString\",\n        title=\"Individual responsible for the annotation\",\n        description=\"The individual responsible for making the annotation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e author[x]\n            \"one_of_many\": \"author\",\n            \"one_of_many_required\": False,\n        },\n    )\n    authorString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_authorString\",\n        title=\"Extension field for ``authorString``.\",\n    )\n\n    text: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"The annotation  - text content (as markdown)\",\n        description=\"The text of the annotation in markdown format.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    time: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"time\",\n        title=\"When the annotation was made\",\n        description=\"Indicates when this particular annotation was made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_time\", title=\"Extension field for ``time``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Annotation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"authorReference\", \"authorString\", \"time\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Annotation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"authorReference\", \"authorString\", \"time\", \"text\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"text\", \"text__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"author\": [\"authorReference\", \"authorString\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/appointment.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Appointment\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Appointment(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A booking of a healthcare event among patient(s), practitioner(s), related\n    person(s) and/or device(s) for a specific date/time. This may result in one\n    or more Encounter(s).\n    \"\"\"\n\n    __resource_type__ = \"Appointment\"\n\n    account: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"account\",\n        title=\"The set of accounts that may be used for billing for this Appointment\",\n        description=(\n            \"The set of accounts that is expected to be used for billing the \"\n            \"activities that result from this Appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    appointmentType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"appointmentType\",\n        title=(\n            \"The style of appointment or patient that has been booked in the slot \"\n            \"(not service type)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"The request this appointment is allocated to assess\",\n        description=(\n            \"The request this appointment is allocated to assess (e.g. incoming \"\n            \"referral or procedure request).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"ServiceRequest\",\n            ],\n        },\n    )\n\n    cancellationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"cancellationDate\",\n        title=\"When the appointment was cancelled\",\n        description=\"The date/time describing when the appointment was cancelled.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    cancellationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_cancellationDate\",\n        title=\"Extension field for ``cancellationDate``.\",\n    )\n\n    cancellationReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"cancellationReason\",\n        title=\"The coded reason for the appointment being cancelled\",\n        description=(\n            \"The coded reason for the appointment being cancelled. This is often \"\n            \"used in reporting/billing/futher processing to determine if further \"\n            \"actions are required, or specific fees apply.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    class_fhir: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"class\",\n        title=\"Classification when becoming an encounter\",\n        description=(\n            \"Concepts representing classification of patient encounter such as \"\n            \"ambulatory (outpatient), inpatient, emergency, home health or others \"\n            \"due to local variations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"The date that this appointment was initially created\",\n        description=(\n            \"The date that this appointment was initially created. This could be \"\n            \"different to the meta.lastModified value on the initial entry, as this\"\n            \" could have been before the resource was created on the FHIR server, \"\n            \"and should remain unchanged over the lifespan of the appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Shown on a subject line in a meeting request, or appointment list\",\n        description=(\n            \"The brief description of the appointment as would be shown on a \"\n            \"subject line in a meeting request, or appointment list. Detailed or \"\n            \"expanded information should be put in the note field.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    end: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"When appointment is to conclude\",\n        description=\"Date/Time that the appointment is to conclude.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this item\",\n        description=(\n            \"This records identifiers associated with this appointment concern that\"\n            \" are defined by business processes and/or used to refer to it when a \"\n            \"direct URL reference to the resource itself is not appropriate (e.g. \"\n            \"in CDA documents, or in written / printed documentation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    minutesDuration: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"minutesDuration\",\n        title=\"Can be less than start/end (e.g. estimate)\",\n        description=(\n            \"Number of minutes that the appointment is to take. This can be less \"\n            \"than the duration between the start and end times.  For example, where\"\n            \" the actual time of appointment is only an estimate or if a 30 minute \"\n            \"appointment is being requested, but any time would work.  Also, if \"\n            \"there is, for example, a planned 15 minute break in the middle of a \"\n            \"long appointment, the duration may be 15 minutes less than the \"\n            \"difference between the start and end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    minutesDuration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minutesDuration\",\n        title=\"Extension field for ``minutesDuration``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional comments\",\n        description=\"Additional notes/comments about the appointment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceChanged: bool | None = Field(\n        default=None,\n        alias=\"occurrenceChanged\",\n        title=\"Indicates that this appointment varies from a recurrence pattern\",\n        description=\"This appointment varies from the recurring pattern.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    occurrenceChanged__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceChanged\",\n        title=\"Extension field for ``occurrenceChanged``.\",\n    )\n\n    originatingAppointment: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"originatingAppointment\",\n        title=\"The originating appointment in a recurring set of appointments\",\n        description=(\n            \"The originating appointment in a recurring set of related \" \"appointments.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Appointment\"],\n        },\n    )\n\n    participant: typing.List[fhirtypes.AppointmentParticipantType] = Field(\n        default=...,\n        alias=\"participant\",\n        title=\"Participants involved in appointment\",\n        description=\"List of participants involved in the appointment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patientInstruction: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"patientInstruction\",\n        title=\"Detailed information and instructions for the patient\",\n        description=(\n            \"While Appointment.note contains information for internal use, \"\n            \"Appointment.patientInstructions is used to capture patient facing \"\n            \"information about the Appointment (e.g. please bring your referral or \"\n            \"fast from 8pm night before).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\", \"Binary\", \"Communication\"],\n        },\n    )\n\n    previousAppointment: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"previousAppointment\",\n        title=\"The previous appointment in a series\",\n        description=\"The previous appointment in a series of related appointments.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Appointment\"],\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Used to make informed decisions if needing to re-prioritize\",\n        description=(\n            \"The priority of the appointment. Can be used to make informed \"\n            \"decisions if needing to re-prioritize appointments. (The iCal Standard\"\n            \" specifies 0 as undefined, 1 as highest, 9 as lowest priority).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason this appointment is scheduled\",\n        description=(\n            \"The reason that this appointment is being scheduled. This is more \"\n            \"clinical than administrative. This can be coded, or as specified using\"\n            \" information from another resource. When the patient arrives and the \"\n            \"encounter begins it may be used as the admission diagnosis. The \"\n            \"indication will typically be a Condition (with other resources \"\n            \"referenced in the evidence.detail), or a Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Procedure\",\n                \"Observation\",\n                \"ImmunizationRecommendation\",\n            ],\n        },\n    )\n\n    recurrenceId: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"recurrenceId\",\n        title=\"The sequence number in the recurrence\",\n        description=(\n            \"The sequence number that identifies a specific appointment in a \"\n            \"recurring pattern.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    recurrenceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_recurrenceId\",\n        title=\"Extension field for ``recurrenceId``.\",\n    )\n\n    recurrenceTemplate: typing.List[\n        fhirtypes.AppointmentRecurrenceTemplateType\n    ] | None = Field(\n        default=None,\n        alias=\"recurrenceTemplate\",\n        title=(\n            \"Details of the recurrence pattern/template used to generate \" \"occurrences\"\n        ),\n        description=(\n            \"The details of the recurrence pattern or template that is used to \"\n            \"generate recurring appointments.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"Appointment replaced by this Appointment\",\n        description=(\n            \"Appointment replaced by this Appointment in cases where there is a \"\n            \"cancellation, the details of the cancellation can be found in the \"\n            \"cancellationReason property (on the referenced resource).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Appointment\"],\n        },\n    )\n\n    requestedPeriod: typing.List[fhirtypes.PeriodType] | None = Field(\n        default=None,\n        alias=\"requestedPeriod\",\n        title=(\n            \"Potential date/time interval(s) requested to allocate the appointment \"\n            \"within\"\n        ),\n        description=(\n            \"A set of date ranges (potentially including times) that the \"\n            \"appointment is preferred to be scheduled within.  The duration \"\n            \"(usually in minutes) could also be provided to indicate the length of \"\n            \"the appointment to fill and populate the start/end times for the \"\n            \"actual allocated time. However, in other situations the duration may \"\n            \"be calculated by the scheduling system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    serviceCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceCategory\",\n        title=(\n            \"A broad categorization of the service that is to be performed during \"\n            \"this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceType: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"serviceType\",\n        title=\"The specific service that is to be performed during this appointment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"HealthcareService\"],\n        },\n    )\n\n    slot: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"slot\",\n        title=\"The slots that this appointment is filling\",\n        description=(\n            \"The slots from the participants' schedules that will be filled by the \"\n            \"appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Slot\"],\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=(\n            \"The specialty of a practitioner that would be required to perform the \"\n            \"service requested in this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    start: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"When appointment is to take place\",\n        description=\"Date/Time that the appointment is to take place.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"proposed | pending | booked | arrived | fulfilled | cancelled | noshow\"\n            \" | entered-in-error | checked-in | waitlist\"\n        ),\n        description=(\n            \"The overall status of the Appointment. Each of the participants has \"\n            \"their own participation status which indicates their involvement in \"\n            \"the process, however this status indicates the shared status.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposed\",\n                \"pending\",\n                \"booked\",\n                \"arrived\",\n                \"fulfilled\",\n                \"cancelled\",\n                \"noshow\",\n                \"entered-in-error\",\n                \"checked-in\",\n                \"waitlist\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The patient or group associated with the appointment\",\n        description=(\n            \"The patient or group associated with the appointment, if they are to \"\n            \"be present (usually) then they should also be included in the \"\n            \"participant backbone element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Additional information to support the appointment\",\n        description=(\n            \"Additional information to support the appointment provided when making\"\n            \" the appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    virtualService: typing.List[fhirtypes.VirtualServiceDetailType] | None = Field(\n        default=None,\n        alias=\"virtualService\",\n        title=\"Connection details of a virtual service (e.g. conference call)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Appointment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"cancellationReason\",\n            \"class\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"appointmentType\",\n            \"reason\",\n            \"priority\",\n            \"description\",\n            \"replaces\",\n            \"virtualService\",\n            \"supportingInformation\",\n            \"previousAppointment\",\n            \"originatingAppointment\",\n            \"start\",\n            \"end\",\n            \"minutesDuration\",\n            \"requestedPeriod\",\n            \"slot\",\n            \"account\",\n            \"created\",\n            \"cancellationDate\",\n            \"note\",\n            \"patientInstruction\",\n            \"basedOn\",\n            \"subject\",\n            \"participant\",\n            \"recurrenceId\",\n            \"occurrenceChanged\",\n            \"recurrenceTemplate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Appointment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"cancellationReason\",\n            \"class\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"appointmentType\",\n            \"reason\",\n            \"start\",\n            \"end\",\n            \"subject\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass AppointmentParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Participants involved in appointment.\n    List of participants involved in the appointment.\n    \"\"\"\n\n    __resource_type__ = \"AppointmentParticipant\"\n\n    actor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=(\n            \"The individual, device, location, or service participating in the \"\n            \"appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"CareTeam\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"HealthcareService\",\n                \"Location\",\n            ],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Participation period of the actor\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    required: bool | None = Field(\n        default=None,\n        alias=\"required\",\n        title=\"The participant is required to attend (optional when false)\",\n        description=(\n            \"Whether this participant is required to be present at the meeting. If \"\n            \"false, the participant is optional.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_required\", title=\"Extension field for ``required``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"accepted | declined | tentative | needs-action\",\n        description=\"Participation status of the actor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"accepted\", \"declined\", \"tentative\", \"needs-action\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Role of participant in the appointment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AppointmentParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"period\",\n            \"actor\",\n            \"required\",\n            \"status\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AppointmentParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"actor\", \"required\", \"status\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass AppointmentRecurrenceTemplate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of the recurrence pattern/template used to generate occurrences.\n    The details of the recurrence pattern or template that is used to generate\n    recurring appointments.\n    \"\"\"\n\n    __resource_type__ = \"AppointmentRecurrenceTemplate\"\n\n    excludingDate: typing.List[fhirtypes.DateType | None] | None = Field(\n        default=None,\n        alias=\"excludingDate\",\n        title=\"Any dates that should be excluded from the series\",\n        description=(\n            \"Any dates, such as holidays, that should be excluded from the \"\n            \"recurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    excludingDate__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_excludingDate\",\n        title=\"Extension field for ``excludingDate``.\",\n    )\n\n    excludingRecurrenceId: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"excludingRecurrenceId\",\n        title=\"Any recurrence IDs that should be excluded from the recurrence\",\n        description=(\n            \"Any dates, such as holidays, that should be excluded from the \"\n            \"recurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    excludingRecurrenceId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_excludingRecurrenceId\",\n        title=\"Extension field for ``excludingRecurrenceId``.\",\n    )\n\n    lastOccurrenceDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastOccurrenceDate\",\n        title=\"The date when the recurrence should end\",\n        description=\"Recurring appointments will not occur after this date.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastOccurrenceDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastOccurrenceDate\",\n        title=\"Extension field for ``lastOccurrenceDate``.\",\n    )\n\n    monthlyTemplate: fhirtypes.AppointmentRecurrenceTemplateMonthlyTemplateType | None = Field(\n        default=None,\n        alias=\"monthlyTemplate\",\n        title=\"Information about monthly recurring appointments\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceCount: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"occurrenceCount\",\n        title=\"The number of planned occurrences\",\n        description=\"How many appointments are planned in the recurrence.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    occurrenceCount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceCount\",\n        title=\"Extension field for ``occurrenceCount``.\",\n    )\n\n    occurrenceDate: typing.List[fhirtypes.DateType | None] | None = Field(\n        default=None,\n        alias=\"occurrenceDate\",\n        title=\"Specific dates for a recurring set of appointments (no template)\",\n        description=\"The list of specific dates that will have appointments generated.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    occurrenceDate__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_occurrenceDate\",\n        title=\"Extension field for ``occurrenceDate``.\",\n    )\n\n    recurrenceType: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"recurrenceType\",\n        title=\"The frequency of the recurrence\",\n        description=\"How often the appointment series should recur.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timezone: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"timezone\",\n        title=\"The timezone of the occurrences\",\n        description=\"The timezone of the recurring appointment occurrences.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    weeklyTemplate: fhirtypes.AppointmentRecurrenceTemplateWeeklyTemplateType | None = (\n        Field(\n            default=None,\n            alias=\"weeklyTemplate\",\n            title=\"Information about weekly recurring appointments\",\n            description=None,\n            json_schema_extra={\n                \"element_property\": True,\n            },\n        )\n    )\n\n    yearlyTemplate: fhirtypes.AppointmentRecurrenceTemplateYearlyTemplateType | None = (\n        Field(\n            default=None,\n            alias=\"yearlyTemplate\",\n            title=\"Information about yearly recurring appointments\",\n            description=None,\n            json_schema_extra={\n                \"element_property\": True,\n            },\n        )\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AppointmentRecurrenceTemplate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"timezone\",\n            \"recurrenceType\",\n            \"lastOccurrenceDate\",\n            \"occurrenceCount\",\n            \"occurrenceDate\",\n            \"weeklyTemplate\",\n            \"monthlyTemplate\",\n            \"yearlyTemplate\",\n            \"excludingDate\",\n            \"excludingRecurrenceId\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AppointmentRecurrenceTemplate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass AppointmentRecurrenceTemplateMonthlyTemplate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about monthly recurring appointments.\n    \"\"\"\n\n    __resource_type__ = \"AppointmentRecurrenceTemplateMonthlyTemplate\"\n\n    dayOfMonth: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"dayOfMonth\",\n        title=\"Recurs on a specific day of the month\",\n        description=(\n            \"Indicates that appointments in the series of recurring appointments \"\n            \"should occur on a specific day of the month.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    dayOfMonth__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dayOfMonth\", title=\"Extension field for ``dayOfMonth``.\"\n    )\n\n    dayOfWeek: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"dayOfWeek\",\n        title=\"Indicates which day of the week the appointment should occur\",\n        description=(\n            \"Indicates which day of the week the recurring appointments should \"\n            \"occur each nth week.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    monthInterval: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"monthInterval\",\n        title=\"Recurs every nth month\",\n        description=\"Indicates that recurring appointments should occur every nth month.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    monthInterval__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_monthInterval\",\n        title=\"Extension field for ``monthInterval``.\",\n    )\n\n    nthWeekOfMonth: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"nthWeekOfMonth\",\n        title=\"Indicates which week of the month the appointment should occur\",\n        description=(\n            \"Indicates which week within a month the appointments in the series of \"\n            \"recurring appointments should occur on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AppointmentRecurrenceTemplateMonthlyTemplate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"dayOfMonth\",\n            \"nthWeekOfMonth\",\n            \"dayOfWeek\",\n            \"monthInterval\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AppointmentRecurrenceTemplateMonthlyTemplate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"monthInterval\", \"monthInterval__ext\")]\n        return required_fields\n\n\nclass AppointmentRecurrenceTemplateWeeklyTemplate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about weekly recurring appointments.\n    \"\"\"\n\n    __resource_type__ = \"AppointmentRecurrenceTemplateWeeklyTemplate\"\n\n    friday: bool | None = Field(\n        default=None,\n        alias=\"friday\",\n        title=\"Recurs on Friday\",\n        description=\"Indicates that recurring appointments should occur on Fridays.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    friday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_friday\", title=\"Extension field for ``friday``.\"\n    )\n\n    monday: bool | None = Field(\n        default=None,\n        alias=\"monday\",\n        title=\"Recurs on Mondays\",\n        description=\"Indicates that recurring appointments should occur on Mondays.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    monday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_monday\", title=\"Extension field for ``monday``.\"\n    )\n\n    saturday: bool | None = Field(\n        default=None,\n        alias=\"saturday\",\n        title=\"Recurs on Saturday\",\n        description=\"Indicates that recurring appointments should occur on Saturdays.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    saturday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_saturday\", title=\"Extension field for ``saturday``.\"\n    )\n\n    sunday: bool | None = Field(\n        default=None,\n        alias=\"sunday\",\n        title=\"Recurs on Sunday\",\n        description=\"Indicates that recurring appointments should occur on Sundays.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sunday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sunday\", title=\"Extension field for ``sunday``.\"\n    )\n\n    thursday: bool | None = Field(\n        default=None,\n        alias=\"thursday\",\n        title=\"Recurs on Thursday\",\n        description=\"Indicates that recurring appointments should occur on Thursdays.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    thursday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_thursday\", title=\"Extension field for ``thursday``.\"\n    )\n\n    tuesday: bool | None = Field(\n        default=None,\n        alias=\"tuesday\",\n        title=\"Recurs on Tuesday\",\n        description=\"Indicates that recurring appointments should occur on Tuesdays.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    tuesday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_tuesday\", title=\"Extension field for ``tuesday``.\"\n    )\n\n    wednesday: bool | None = Field(\n        default=None,\n        alias=\"wednesday\",\n        title=\"Recurs on Wednesday\",\n        description=\"Indicates that recurring appointments should occur on Wednesdays.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    wednesday__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_wednesday\", title=\"Extension field for ``wednesday``.\"\n    )\n\n    weekInterval: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"weekInterval\",\n        title=\"Recurs every nth week\",\n        description=(\n            \"The interval defines if the recurrence is every nth week. The default \"\n            \"is every week, so it is expected that this value will be 2 or more.  \"\n            \"e.g. For recurring every second week this interval would be 2, or \"\n            \"every third week the interval would be 3.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    weekInterval__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_weekInterval\",\n        title=\"Extension field for ``weekInterval``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AppointmentRecurrenceTemplateWeeklyTemplate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"monday\",\n            \"tuesday\",\n            \"wednesday\",\n            \"thursday\",\n            \"friday\",\n            \"saturday\",\n            \"sunday\",\n            \"weekInterval\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AppointmentRecurrenceTemplateWeeklyTemplate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass AppointmentRecurrenceTemplateYearlyTemplate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about yearly recurring appointments.\n    \"\"\"\n\n    __resource_type__ = \"AppointmentRecurrenceTemplateYearlyTemplate\"\n\n    yearInterval: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"yearInterval\",\n        title=\"Recurs every nth year\",\n        description=\"Appointment recurs every nth year.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    yearInterval__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_yearInterval\",\n        title=\"Extension field for ``yearInterval``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AppointmentRecurrenceTemplateYearlyTemplate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"yearInterval\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AppointmentRecurrenceTemplateYearlyTemplate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"yearInterval\", \"yearInterval__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/appointmentresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AppointmentResponse\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass AppointmentResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reply to an appointment request for a patient and/or practitioner(s),\n    such as a confirmation or rejection.\n    \"\"\"\n\n    __resource_type__ = \"AppointmentResponse\"\n\n    actor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Person(s), Location, HealthcareService, or Device\",\n        description=(\n            \"A Person, Location, HealthcareService, or Device that is participating\"\n            \" in the appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"HealthcareService\",\n                \"Location\",\n            ],\n        },\n    )\n\n    appointment: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"appointment\",\n        title=\"Appointment this response relates to\",\n        description=\"Appointment that this response is replying to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Appointment\"],\n        },\n    )\n\n    comment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Additional comments\",\n        description=\"Additional comments about the appointment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    end: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"Time from appointment, or requested new end time\",\n        description=(\n            \"This may be either the same as the appointment request to confirm the \"\n            \"details of the appointment, or alternately a new time to request a re-\"\n            \"negotiation of the end time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this item\",\n        description=(\n            \"This records identifiers associated with this appointment response \"\n            \"concern that are defined by business processes and/ or used to refer \"\n            \"to it when a direct URL reference to the resource itself is not \"\n            \"appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    occurrenceDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"occurrenceDate\",\n        title=\"Original date within a recurring request\",\n        description=(\n            \"The original date within a recurring request. This could be used in \"\n            \"place of the recurrenceId to be more direct (or where the template is \"\n            \"provided through the simple list of dates in \"\n            \"`Appointment.occurrenceDate`).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    occurrenceDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDate\",\n        title=\"Extension field for ``occurrenceDate``.\",\n    )\n\n    participantStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"participantStatus\",\n        title=\"accepted | declined | tentative | needs-action | entered-in-error\",\n        description=(\n            \"Participation status of the participant. When the status is declined \"\n            \"or tentative if the start/end times are different to the appointment, \"\n            \"then these times should be interpreted as a requested time change. \"\n            \"When the status is accepted, the times can either be the time of the \"\n            \"appointment (as a confirmation of the time) or can be empty.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"accepted\",\n                \"declined\",\n                \"tentative\",\n                \"needs-action\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    participantStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_participantStatus\",\n        title=\"Extension field for ``participantStatus``.\",\n    )\n\n    participantType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"participantType\",\n        title=\"Role of participant in the appointment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    proposedNewTime: bool | None = Field(\n        default=None,\n        alias=\"proposedNewTime\",\n        title=\"Indicator for a counter proposal\",\n        description=(\n            \"Indicates that the response is proposing a different time that was \"\n            \"initially requested.  The new proposed time will be indicated in the \"\n            \"start and end properties.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    proposedNewTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_proposedNewTime\",\n        title=\"Extension field for ``proposedNewTime``.\",\n    )\n\n    recurrenceId: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"recurrenceId\",\n        title=\"The recurrence ID of the specific recurring request\",\n        description=(\n            \"The recurrence ID (sequence number) of the specific appointment when \"\n            \"responding to a recurring request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    recurrenceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_recurrenceId\",\n        title=\"Extension field for ``recurrenceId``.\",\n    )\n\n    recurring: bool | None = Field(\n        default=None,\n        alias=\"recurring\",\n        title=\"This response is for all occurrences in a recurring request\",\n        description=(\n            \"Indicates that this AppointmentResponse applies to all occurrences in \"\n            \"a recurring request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    recurring__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recurring\", title=\"Extension field for ``recurring``.\"\n    )\n\n    start: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Time from appointment, or requested new start time\",\n        description=(\n            \"Date/Time that the appointment is to take place, or requested new \"\n            \"start time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AppointmentResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"appointment\",\n            \"proposedNewTime\",\n            \"start\",\n            \"end\",\n            \"participantType\",\n            \"actor\",\n            \"participantStatus\",\n            \"comment\",\n            \"recurring\",\n            \"occurrenceDate\",\n            \"recurrenceId\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AppointmentResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"appointment\",\n            \"proposedNewTime\",\n            \"participantType\",\n            \"actor\",\n            \"participantStatus\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"participantStatus\", \"participantStatus__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/artifactassessment.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ArtifactAssessment\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ArtifactAssessment(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adds metadata-supported comments, classifiers or ratings related to a\n    Resource.\n    This Resource provides one or more comments, classifiers or ratings about a\n    Resource and supports attribution and rights management metadata for the\n    added content.\n    \"\"\"\n\n    __resource_type__ = \"ArtifactAssessment\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the artifact assessment was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    artifactCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"artifactCanonical\",\n        title=\"The artifact assessed, commented upon or rated\",\n        description=(\n            \"A reference to a resource, canonical resource, or non-FHIR resource \"\n            \"which the comment or assessment is about.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e artifact[x]\n            \"one_of_many\": \"artifact\",\n            \"one_of_many_required\": True,\n        },\n    )\n    artifactCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_artifactCanonical\",\n        title=\"Extension field for ``artifactCanonical``.\",\n    )\n\n    artifactReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"artifactReference\",\n        title=\"The artifact assessed, commented upon or rated\",\n        description=(\n            \"A reference to a resource, canonical resource, or non-FHIR resource \"\n            \"which the comment or assessment is about.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e artifact[x]\n            \"one_of_many\": \"artifact\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    artifactUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"artifactUri\",\n        title=\"The artifact assessed, commented upon or rated\",\n        description=(\n            \"A reference to a resource, canonical resource, or non-FHIR resource \"\n            \"which the comment or assessment is about.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e artifact[x]\n            \"one_of_many\": \"artifact\",\n            \"one_of_many_required\": True,\n        },\n    )\n    artifactUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_artifactUri\", title=\"Extension field for ``artifactUri``.\"\n    )\n\n    citeAsMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"citeAsMarkdown\",\n        title=\"How to cite the comment or rating\",\n        description=(\n            \"Display of or reference to the bibliographic citation of the comment, \"\n            \"classifier, or rating.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e citeAs[x]\n            \"one_of_many\": \"citeAs\",\n            \"one_of_many_required\": False,\n        },\n    )\n    citeAsMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_citeAsMarkdown\",\n        title=\"Extension field for ``citeAsMarkdown``.\",\n    )\n\n    citeAsReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"citeAsReference\",\n        title=\"How to cite the comment or rating\",\n        description=(\n            \"Display of or reference to the bibliographic citation of the comment, \"\n            \"classifier, or rating.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e citeAs[x]\n            \"one_of_many\": \"citeAs\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Citation\"],\n        },\n    )\n\n    content: typing.List[fhirtypes.ArtifactAssessmentContentType] | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"Comment, classifier, or rating content\",\n        description=\"A component comment, classifier, or rating of the artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the artifact assessment and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the artifact assessment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the artifact assessment was \"\n            \"published. The date must change when the disposition changes and it \"\n            \"must change if the workflow status code changes. In addition, it \"\n            \"should change when the substantive content of the artifact assessment \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    disposition: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=(\n            \"unresolved | not-persuasive | persuasive | persuasive-with-\"\n            \"modification | not-persuasive-with-modification\"\n        ),\n        description=(\n            \"Indicates the disposition of the responsible party to the comment or \"\n            \"change request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"unresolved\",\n                \"not-persuasive\",\n                \"persuasive\",\n                \"persuasive-with-modification\",\n                \"not-persuasive-with-modification\",\n            ],\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the artifact assessment\",\n        description=(\n            \"A formal identifier that is used to identify this artifact assessment \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the artifact assessment was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"A short title for the assessment for use in displaying and selecting\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    workflowStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"workflowStatus\",\n        title=(\n            \"submitted | triaged | waiting-for-input | resolved-no-change | \"\n            \"resolved-change-required | deferred | duplicate | applied | published \"\n            \"| entered-in-error\"\n        ),\n        description=\"Indicates the workflow status of the comment or change request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"submitted\",\n                \"triaged\",\n                \"waiting-for-input\",\n                \"resolved-no-change\",\n                \"resolved-change-required\",\n                \"deferred\",\n                \"duplicate\",\n                \"applied\",\n                \"published\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    workflowStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_workflowStatus\",\n        title=\"Extension field for ``workflowStatus``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ArtifactAssessment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"title\",\n            \"citeAsReference\",\n            \"citeAsMarkdown\",\n            \"date\",\n            \"copyright\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"artifactReference\",\n            \"artifactCanonical\",\n            \"artifactUri\",\n            \"content\",\n            \"workflowStatus\",\n            \"disposition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ArtifactAssessment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"title\",\n            \"date\",\n            \"lastReviewDate\",\n            \"artifactReference\",\n            \"artifactCanonical\",\n            \"artifactUri\",\n            \"workflowStatus\",\n            \"disposition\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"artifact\": [\"artifactCanonical\", \"artifactReference\", \"artifactUri\"],\n            \"citeAs\": [\"citeAsMarkdown\", \"citeAsReference\"],\n        }\n        return one_of_many_fields\n\n\nclass ArtifactAssessmentContent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Comment, classifier, or rating content.\n    A component comment, classifier, or rating of the artifact.\n    \"\"\"\n\n    __resource_type__ = \"ArtifactAssessmentContent\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=\"Indicates who or what authored the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Device\",\n            ],\n        },\n    )\n\n    classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classifier\",\n        title=\"Rating, classifier, or assessment\",\n        description=\"Represents a rating, classifier, or assessment of the artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    component: typing.List[fhirtypes.ArtifactAssessmentContentType] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"Contained content\",\n        description=\"If the informationType is container, the components of the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    freeToShare: bool | None = Field(\n        default=None,\n        alias=\"freeToShare\",\n        title=\"Acceptable to publicly share the resource content\",\n        description=\"Acceptable to publicly share the comment, classifier or rating.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    freeToShare__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_freeToShare\", title=\"Extension field for ``freeToShare``.\"\n    )\n\n    informationType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"informationType\",\n        title=\"comment | classifier | rating | container | response | change-request\",\n        description=\"The type of information this component of the content represents.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"comment\",\n                \"classifier\",\n                \"rating\",\n                \"container\",\n                \"response\",\n                \"change-request\",\n            ],\n        },\n    )\n    informationType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_informationType\",\n        title=\"Extension field for ``informationType``.\",\n    )\n\n    path: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"What the comment is directed to\",\n        description=(\n            \"A URI that points to what the comment is about, such as a line of text\"\n            \" in the CQL, or a specific element in a resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Quantitative rating\",\n        description=\"A quantitative rating of the artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional information\",\n        description=(\n            \"Additional related artifacts that provide supporting documentation, \"\n            \"additional evidence, or further information related to the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    summary: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"summary\",\n        title=\"Brief summary of the content\",\n        description=\"A brief summary of the content of this component.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    summary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_summary\", title=\"Extension field for ``summary``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"What type of content\",\n        description=\"Indicates what type of content this component represents.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ArtifactAssessmentContent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"informationType\",\n            \"summary\",\n            \"type\",\n            \"classifier\",\n            \"quantity\",\n            \"author\",\n            \"path\",\n            \"relatedArtifact\",\n            \"freeToShare\",\n            \"component\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ArtifactAssessmentContent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/attachment.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Attachment\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Attachment(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Content in a format defined elsewhere.\n    For referring to data content defined in other formats.\n    \"\"\"\n\n    __resource_type__ = \"Attachment\"\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"Mime type of the content, with charset etc.\",\n        description=(\n            \"Identifies the type of the data in the attachment and allows a method \"\n            \"to be chosen to interpret or render the data. Includes mime type \"\n            \"parameters such as charset where appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    creation: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"creation\",\n        title=\"Date attachment was first created\",\n        description=\"The date that the attachment was first created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    creation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_creation\", title=\"Extension field for ``creation``.\"\n    )\n\n    data: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"Data inline, base64ed\",\n        description=(\n            \"The actual data of the attachment - a sequence of bytes, base64 \"\n            \"encoded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_data\", title=\"Extension field for ``data``.\"\n    )\n\n    duration: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"Length in seconds (audio / video)\",\n        description=\"The duration of the recording in seconds - for audio and video.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    duration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_duration\", title=\"Extension field for ``duration``.\"\n    )\n\n    frames: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"frames\",\n        title=\"Number of frames if > 1 (photo)\",\n        description=(\n            \"The number of frames in a photo. This is used with a multi-page fax, \"\n            \"or an imaging acquisition context that takes multiple slices in a \"\n            \"single image, or an animated gif. If there is more than one frame, \"\n            \"this SHALL have a value in order to alert interface software that a \"\n            \"multi-frame capable rendering widget is required.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    frames__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_frames\", title=\"Extension field for ``frames``.\"\n    )\n\n    hash: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"hash\",\n        title=\"Hash of the data (sha-1, base64ed)\",\n        description=\"The calculated hash of the data using SHA-1. Represented using base64.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    hash__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_hash\", title=\"Extension field for ``hash``.\"\n    )\n\n    height: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"height\",\n        title=\"Height of the image in pixels (photo/video)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    height__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_height\", title=\"Extension field for ``height``.\"\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language of the content (BCP-47)\",\n        description=(\n            \"The human language of the content. The value can be any valid value \"\n            \"according to BCP 47.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    pages: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"pages\",\n        title=\"Number of printed pages\",\n        description=\"The number of pages when printed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    pages__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_pages\", title=\"Extension field for ``pages``.\"\n    )\n\n    size: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"size\",\n        title=\"Number of bytes of content (if url provided)\",\n        description=(\n            \"The number of bytes of data that make up this attachment (before \"\n            \"base64 encoding, if that is done).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    size__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_size\", title=\"Extension field for ``size``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label to display in place of the data\",\n        description=\"A label or set of text to display in place of the data.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Uri where the data can be found\",\n        description=\"A location where the data can be accessed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    width: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"width\",\n        title=\"Width of the image in pixels (photo/video)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    width__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_width\", title=\"Extension field for ``width``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Attachment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"contentType\",\n            \"language\",\n            \"data\",\n            \"url\",\n            \"size\",\n            \"hash\",\n            \"title\",\n            \"creation\",\n            \"height\",\n            \"width\",\n            \"frames\",\n            \"duration\",\n            \"pages\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Attachment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"contentType\", \"language\", \"url\", \"size\", \"hash\", \"title\", \"creation\"]\n"
  },
  {
    "path": "fhir/resources/auditevent.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AuditEvent\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass AuditEvent(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Record of an event.\n    A record of an event relevant for purposes such as operations, privacy,\n    security, maintenance, and performance analysis.\n    \"\"\"\n\n    __resource_type__ = \"AuditEvent\"\n\n    action: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Type of action performed during the event\",\n        description=(\n            \"Indicator for type of action performed during the event that generated\"\n            \" the audit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    action__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_action\", title=\"Extension field for ``action``.\"\n    )\n\n    agent: typing.List[fhirtypes.AuditEventAgentType] = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Actor involved in the event\",\n        description=(\n            \"An actor taking an active role in the event or activity that is \" \"logged.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    authorization: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"authorization\",\n        title=\"Authorization related to the event\",\n        description=(\n            \"The authorization (e.g., PurposeOfUse) that was used during the event \"\n            \"being recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Workflow authorization within which this event occurred\",\n        description=(\n            \"Allows tracing of authorizatino for the events and tracking whether \"\n            \"proposals/recommendations were acted upon.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"DeviceRequest\",\n                \"ImmunizationRecommendation\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ServiceRequest\",\n                \"Task\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type/identifier of event\",\n        description=\"Classification of the type of event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Specific type of event\",\n        description=\"Describes what happened. The most specific code for the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=(\n            \"Encounter within which this event occurred or which the event is \"\n            \"tightly associated\"\n        ),\n        description=(\n            \"This will typically be the encounter the event occurred, but some \"\n            \"events may be initiated prior to or after the official completion of \"\n            \"an encounter but still be tied to the context of the encounter (e.g. \"\n            \"pre-admission lab tests).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    entity: typing.List[fhirtypes.AuditEventEntityType] | None = Field(\n        default=None,\n        alias=\"entity\",\n        title=\"Data or objects used\",\n        description=\"Specific instances of data or objects that have been accessed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    occurredDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurredDateTime\",\n        title=\"When the activity occurred\",\n        description=\"The time or period during which the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e occurred[x]\n            \"one_of_many\": \"occurred\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurredDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurredDateTime\",\n        title=\"Extension field for ``occurredDateTime``.\",\n    )\n\n    occurredPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurredPeriod\",\n        title=\"When the activity occurred\",\n        description=\"The time or period during which the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e occurred[x]\n            \"one_of_many\": \"occurred\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    outcome: fhirtypes.AuditEventOutcomeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"Whether the event succeeded or failed\",\n        description=(\n            \"Indicates whether the event succeeded or failed. A free text \"\n            \"descripiton can be given in outcome.text.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=(\n            \"The patient is the subject of the data used/created/updated/deleted \"\n            \"during the activity\"\n        ),\n        description=(\n            \"The patient element is available to enable deterministic tracking of \"\n            \"activities that involve the patient as the subject of the data used in\"\n            \" an activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    recorded: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"recorded\",\n        title=\"Time when the event was recorded\",\n        description=\"The time when the event was recorded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recorded\", title=\"Extension field for ``recorded``.\"\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=(\n            \"emergency | alert | critical | error | warning | notice | \"\n            \"informational | debug\"\n        ),\n        description=(\n            \"Indicates and enables segmentation of various severity including \"\n            \"debugging from critical.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"emergency\",\n                \"alert\",\n                \"critical\",\n                \"error\",\n                \"warning\",\n                \"notice\",\n                \"informational\",\n                \"debug\",\n            ],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    source: fhirtypes.AuditEventSourceType = Field(\n        default=...,\n        alias=\"source\",\n        title=\"Audit Event Reporter\",\n        description=\"The actor that is reporting the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"code\",\n            \"action\",\n            \"severity\",\n            \"occurredPeriod\",\n            \"occurredDateTime\",\n            \"recorded\",\n            \"outcome\",\n            \"authorization\",\n            \"basedOn\",\n            \"patient\",\n            \"encounter\",\n            \"agent\",\n            \"source\",\n            \"entity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"category\",\n            \"code\",\n            \"action\",\n            \"severity\",\n            \"recorded\",\n            \"outcome\",\n            \"authorization\",\n            \"agent\",\n            \"source\",\n            \"entity\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"recorded\", \"recorded__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"occurred\": [\"occurredDateTime\", \"occurredPeriod\"]}\n        return one_of_many_fields\n\n\nclass AuditEventAgent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Actor involved in the event.\n    An actor taking an active role in the event or activity that is logged.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventAgent\"\n\n    authorization: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"authorization\",\n        title=\"Allowable authorization for this agent\",\n        description=(\n            \"The authorization (e.g., PurposeOfUse) that was used during the event \"\n            \"being recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"The agent location when the event occurred\",\n        description=(\n            \"Where the agent location is known, the agent location when the event \"\n            \"occurred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    networkReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"networkReference\",\n        title=\"This agent network location for the activity\",\n        description=(\n            \"When the event utilizes a network there should be an agent describing \"\n            \"the local system, and an agent describing remote system, with the \"\n            \"network interface details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e network[x]\n            \"one_of_many\": \"network\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    networkString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"networkString\",\n        title=\"This agent network location for the activity\",\n        description=(\n            \"When the event utilizes a network there should be an agent describing \"\n            \"the local system, and an agent describing remote system, with the \"\n            \"network interface details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e network[x]\n            \"one_of_many\": \"network\",\n            \"one_of_many_required\": False,\n        },\n    )\n    networkString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_networkString\",\n        title=\"Extension field for ``networkString``.\",\n    )\n\n    networkUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"networkUri\",\n        title=\"This agent network location for the activity\",\n        description=(\n            \"When the event utilizes a network there should be an agent describing \"\n            \"the local system, and an agent describing remote system, with the \"\n            \"network interface details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e network[x]\n            \"one_of_many\": \"network\",\n            \"one_of_many_required\": False,\n        },\n    )\n    networkUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_networkUri\", title=\"Extension field for ``networkUri``.\"\n    )\n\n    policy: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"policy\",\n        title=\"Policy that authorized the agent participation in the event\",\n        description=(\n            \"Where the policy(ies) are known that authorized the agent \"\n            \"participation in the event. Typically, a single activity may have \"\n            \"multiple applicable policies, such as patient consent, guarantor \"\n            \"funding, etc. The policy would also indicate the security token used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    policy__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_policy\", title=\"Extension field for ``policy``.\"\n    )\n\n    requestor: bool | None = Field(\n        default=None,\n        alias=\"requestor\",\n        title=\"Whether user is initiator\",\n        description=(\n            \"Indicator that the user is or is not the requestor, or initiator, for \"\n            \"the event being audited.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    requestor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requestor\", title=\"Extension field for ``requestor``.\"\n    )\n\n    role: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Agent role in the event\",\n        description=(\n            \"The structural roles of the agent indicating the agent's competency. \"\n            \"The security role enabling the agent with respect to the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"How agent participated\",\n        description=\"The Functional Role of the user when performing the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    who: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"who\",\n        title=\"Identifier of who\",\n        description=\"Reference to who this agent is that was involved in the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"role\",\n            \"who\",\n            \"requestor\",\n            \"location\",\n            \"policy\",\n            \"networkReference\",\n            \"networkUri\",\n            \"networkString\",\n            \"authorization\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"who\", \"requestor\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"network\": [\"networkReference\", \"networkString\", \"networkUri\"]\n        }\n        return one_of_many_fields\n\n\nclass AuditEventEntity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Data or objects used.\n    Specific instances of data or objects that have been accessed.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventEntity\"\n\n    agent: typing.List[fhirtypes.AuditEventAgentType] | None = Field(\n        default=None,\n        alias=\"agent\",\n        title=\"Entity is attributed to this agent\",\n        description=(\n            \"The entity is attributed to an agent to express the agent's \"\n            \"responsibility for that entity in the activity. This is most used to \"\n            \"indicate when persistence media (the entity) are used by an agent. For\"\n            \" example when importing data from a device, the device would be \"\n            \"described in an entity, and the user importing data from that media \"\n            \"would be indicated as the entity.agent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.AuditEventEntityDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Additional Information about the entity\",\n        description=(\n            \"Tagged value pairs for conveying additional information about the \"\n            \"entity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    query: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"query\",\n        title=\"Query parameters\",\n        description=\"The query parameters for a query-type entities.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    query__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_query\", title=\"Extension field for ``query``.\"\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"What role the entity played\",\n        description=(\n            \"Code representing the role the entity played in the event being \"\n            \"audited.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Security labels on the entity\",\n        description=\"Security labels for the identified entity.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    what: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"what\",\n        title=\"Specific instance of resource\",\n        description=(\n            \"Identifies a specific instance of the entity. The reference should be \"\n            \"version specific. This is allowed to be a Parameters resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"what\",\n            \"role\",\n            \"securityLabel\",\n            \"query\",\n            \"detail\",\n            \"agent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"what\", \"query\"]\n\n\nclass AuditEventEntityDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional Information about the entity.\n    Tagged value pairs for conveying additional information about the entity.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventEntityDetail\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Name of the property\",\n        description=\"The type of extra detail provided in the value.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Property value\",\n        description=\"The  value of the extra detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventEntityDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"valueBase64Binary\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventEntityDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDateTime\",\n                \"valueInteger\",\n                \"valuePeriod\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueString\",\n                \"valueTime\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass AuditEventOutcome(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Whether the event succeeded or failed.\n    Indicates whether the event succeeded or failed. A free text descripiton\n    can be given in outcome.text.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventOutcome\"\n\n    code: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Whether the event succeeded or failed\",\n        description=\"Indicates whether the event succeeded or failed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Additional outcome detail\",\n        description=(\n            \"Additional details about the error. This may be a text description of \"\n            \"the error or a system code that identifies the error.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventOutcome`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventOutcome`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"detail\"]\n\n\nclass AuditEventSource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Audit Event Reporter.\n    The actor that is reporting the event.\n    \"\"\"\n\n    __resource_type__ = \"AuditEventSource\"\n\n    observer: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"observer\",\n        title=\"The identity of source detecting the event\",\n        description=\"Identifier of the source where the event was detected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    site: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Logical source location within the enterprise\",\n        description=(\n            \"Logical source location within the healthcare enterprise network.  For\"\n            \" example, a hospital or other provider location within a multi-entity \"\n            \"provider group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of source where event originated\",\n        description=\"Code specifying the type of source where event originated.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AuditEventSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"site\", \"observer\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AuditEventSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"observer\"]\n"
  },
  {
    "path": "fhir/resources/availability.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Availability\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, element, fhirtypes\n\n\nclass Availability(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Availability data for an {item}.\n    \"\"\"\n\n    __resource_type__ = \"Availability\"\n\n    availableTime: typing.List[fhirtypes.AvailabilityAvailableTimeType] | None = Field(\n        default=None,\n        alias=\"availableTime\",\n        title=\"Times the {item} is available\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    notAvailableTime: typing.List[\n        fhirtypes.AvailabilityNotAvailableTimeType\n    ] | None = Field(\n        default=None,\n        alias=\"notAvailableTime\",\n        title=\"Not available during this time due to provided reason\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Availability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"availableTime\", \"notAvailableTime\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Availability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"availableTime\", \"notAvailableTime\"]\n\n\nclass AvailabilityAvailableTime(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Times the {item} is available.\n    \"\"\"\n\n    __resource_type__ = \"AvailabilityAvailableTime\"\n\n    allDay: bool | None = Field(\n        default=None,\n        alias=\"allDay\",\n        title=\"Always available? i.e. 24 hour service\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    allDay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_allDay\", title=\"Extension field for ``allDay``.\"\n    )\n\n    availableEndTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"availableEndTime\",\n        title=\"Closing time of day (ignored if allDay = true)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    availableEndTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availableEndTime\",\n        title=\"Extension field for ``availableEndTime``.\",\n    )\n\n    availableStartTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"availableStartTime\",\n        title=\"Opening time of day (ignored if allDay = true)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    availableStartTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_availableStartTime\",\n        title=\"Extension field for ``availableStartTime``.\",\n    )\n\n    daysOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"daysOfWeek\",\n        title=\"mon | tue | wed | thu | fri | sat | sun\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"],\n        },\n    )\n    daysOfWeek__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_daysOfWeek\", title=\"Extension field for ``daysOfWeek``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AvailabilityAvailableTime`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"daysOfWeek\",\n            \"allDay\",\n            \"availableStartTime\",\n            \"availableEndTime\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AvailabilityAvailableTime`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"daysOfWeek\", \"allDay\", \"availableStartTime\", \"availableEndTime\"]\n\n\nclass AvailabilityNotAvailableTime(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Not available during this time due to provided reason.\n    \"\"\"\n\n    __resource_type__ = \"AvailabilityNotAvailableTime\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Reason presented to the user explaining why time not available\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    during: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"during\",\n        title=\"Service not available during this period\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``AvailabilityNotAvailableTime`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"description\", \"during\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``AvailabilityNotAvailableTime`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"description\", \"during\"]\n"
  },
  {
    "path": "fhir/resources/backboneelement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BackboneElement\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import element, fhirtypes\n\n\nclass BackboneElement(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base for elements defined inside a resource.\n    Base definition for all elements that are defined inside a resource - but\n    not those in a data type.\n    \"\"\"\n\n    __resource_type__ = \"BackboneElement\"\n\n    modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"modifierExtension\",\n        title=\"Extensions that cannot be ignored even if unrecognized\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the element and that modifies the \"\n            \"understanding of the element in which it is contained and/or the \"\n            \"understanding of the containing element's descendants. Usually \"\n            \"modifier elements provide negation or qualification. To make the use \"\n            \"of extensions safe and managable, there is a strict set of governance \"\n            \"applied to the definition and use of extensions. Though any \"\n            \"implementer can define an extension, there is a set of requirements \"\n            \"that SHALL be met as part of the definition of the extension. \"\n            \"Applications processing a resource are required to check for modifier \"\n            \"extensions.  Modifier extensions SHALL NOT change the meaning of any \"\n            \"elements on Resource or DomainResource (including cannot change the \"\n            \"meaning of modifierExtension itself).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BackboneElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BackboneElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/backbonetype.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BackboneType\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass BackboneType(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base for datatypes that can carry modifier extensions.\n    Base definition for the few data types that are allowed to carry modifier\n    extensions.\n    \"\"\"\n\n    __resource_type__ = \"BackboneType\"\n\n    modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"modifierExtension\",\n        title=\"Extensions that cannot be ignored even if unrecognized\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the element and that modifies the \"\n            \"understanding of the element in which it is contained and/or the \"\n            \"understanding of the containing element's descendants. Usually \"\n            \"modifier elements provide negation or qualification. To make the use \"\n            \"of extensions safe and managable, there is a strict set of governance \"\n            \"applied to the definition and use of extensions. Though any \"\n            \"implementer can define an extension, there is a set of requirements \"\n            \"that SHALL be met as part of the definition of the extension. \"\n            \"Applications processing a resource are required to check for modifier \"\n            \"extensions.  Modifier extensions SHALL NOT change the meaning of any \"\n            \"elements on Resource or DomainResource (including cannot change the \"\n            \"meaning of modifierExtension itself).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BackboneType`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BackboneType`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/base.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Base\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom fhir_core import fhirabstractmodel\n\n\nclass Base(fhirabstractmodel.FHIRAbstractModel):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base for all types and resources.\n    Base definition for all types defined in FHIR type system.\n    \"\"\"\n\n    __resource_type__ = \"Base\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Base`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Base`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n"
  },
  {
    "path": "fhir/resources/basic.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Basic\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Basic(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource for non-supported content.\n    Basic is used for handling concepts not yet defined in FHIR, narrative-only\n    resources that don't map to an existing resource, and custom resources not\n    appropriate for inclusion in the FHIR specification.\n    \"\"\"\n\n    __resource_type__ = \"Basic\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who created\",\n        description=\"Indicates who was responsible for creating the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Organization\",\n                \"Device\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Kind of Resource\",\n        description=(\n            \"Identifies the 'type' of resource - equivalent to the resource name \"\n            \"for other resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"When created\",\n        description=\"Identifies when the resource was first created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Identifier assigned to the resource for business purposes, outside the\"\n            \" context of FHIR.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Identifies the focus of this resource\",\n        description=(\n            \"Identifies the patient, practitioner, device or any other resource \"\n            'that is the \"focus\" of this resource.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Basic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"subject\",\n            \"created\",\n            \"author\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Basic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"subject\",\n            \"created\",\n            \"author\",\n        ]\n"
  },
  {
    "path": "fhir/resources/binary.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Binary\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import fhirtypes, resource\n\n\nclass Binary(resource.Resource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Pure binary content defined by a format other than FHIR.\n    A resource that represents the data of a single raw artifact as digital\n    content accessible in its native format.  A Binary resource can contain any\n    content, whether text, image, pdf, zip archive, etc.\n    \"\"\"\n\n    __resource_type__ = \"Binary\"\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"MimeType of the binary content\",\n        description=(\n            \"MimeType of the binary content represented as a standard MimeType (BCP\"\n            \" 13).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    data: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"The actual content\",\n        description=\"The actual content, base64 encoded.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_data\", title=\"Extension field for ``data``.\"\n    )\n\n    securityContext: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"securityContext\",\n        title=(\n            \"Identifies another resource to use as proxy when enforcing access \"\n            \"control\"\n        ),\n        description=(\n            \"This element identifies another resource that can be used as a proxy \"\n            \"of the security sensitivity to use when deciding and enforcing access \"\n            \"control rules for the Binary resource. Given that the Binary resource \"\n            \"contains very few elements that can be used to determine the \"\n            \"sensitivity of the data and relationships to individuals, the \"\n            \"referenced resource stands in as a proxy equivalent for this purpose. \"\n            \"This referenced resource may be related to the Binary (e.g. \"\n            \"DocumentReference), or may be some non-related Resource purely as a \"\n            \"security proxy. E.g. to identify that the binary resource relates to a\"\n            \" patient, and access should only be granted to applications that have \"\n            \"access to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Binary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"contentType\",\n            \"securityContext\",\n            \"data\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Binary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"contentType\", \"securityContext\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"contentType\", \"contentType__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/biologicallyderivedproduct.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass BiologicallyDerivedProduct(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    This resource reflects an instance of a biologically derived product.\n    This resource reflects an instance of a biologically derived product. A\n    material substance originating from a biological entity intended to be\n    transplanted or infused\n    into another (possibly the same) biological entity.\n    \"\"\"\n\n    __resource_type__ = \"BiologicallyDerivedProduct\"\n\n    biologicalSourceEvent: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"biologicalSourceEvent\",\n        title=(\n            \"An identifier that supports traceability to the event during which \"\n            \"material in this product from one or more biological entities was \"\n            \"obtained or pooled\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    collection: fhirtypes.BiologicallyDerivedProductCollectionType | None = Field(\n        default=None,\n        alias=\"collection\",\n        title=\"How this product was collected\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    division: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"division\",\n        title=\"A unique identifier for an aliquot of a product\",\n        description=(\n            \"A unique identifier for an aliquot of a product.  Used to distinguish \"\n            \"individual aliquots of a product carrying the same biologicalSource \"\n            \"and productCode identifiers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    division__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_division\", title=\"Extension field for ``division``.\"\n    )\n\n    expirationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expirationDate\",\n        title=\"Date, and where relevant time, of expiration\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_expirationDate\",\n        title=\"Extension field for ``expirationDate``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Instance identifier\",\n        description=(\n            \"Unique instance identifiers assigned to a biologically derived \"\n            \"product. Note: This is a business identifier, not a resource \"\n            \"identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    parent: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"The parent biologically-derived product\",\n        description=\"Parent product (if any) for this biologically-derived product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BiologicallyDerivedProduct\"],\n        },\n    )\n\n    processingFacility: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"processingFacility\",\n        title=(\n            \"Processing facilities responsible for the labeling and distribution of\"\n            \" this biologically derived product\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    productCategory: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"productCategory\",\n        title=\"organ | tissue | fluid | cells | biologicalAgent\",\n        description=\"Broad category of this product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productCode\",\n        title=\"A code that identifies the kind of this biologically derived product\",\n        description=(\n            \"A codified value that systematically supports characterization and \"\n            \"classification of medical products of human origin inclusive of \"\n            \"processing conditions such as additives, volumes and handling \"\n            \"conditions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productStatus: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"productStatus\",\n        title=\"available | unavailable\",\n        description=\"Whether the product is currently available.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    property: typing.List[\n        fhirtypes.BiologicallyDerivedProductPropertyType\n    ] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=(\n            \"A property that is specific to this BiologicallyDerviedProduct \" \"instance\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Request to obtain and/or infuse this product\",\n        description=\"Request to obtain and/or infuse this biologically derived product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    storageTempRequirements: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"storageTempRequirements\",\n        title=\"Product storage temperature requirements\",\n        description=(\n            \"The temperature requirements for storage of the biologically-derived \"\n            \"product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BiologicallyDerivedProduct`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"productCategory\",\n            \"productCode\",\n            \"parent\",\n            \"request\",\n            \"identifier\",\n            \"biologicalSourceEvent\",\n            \"processingFacility\",\n            \"division\",\n            \"productStatus\",\n            \"expirationDate\",\n            \"collection\",\n            \"storageTempRequirements\",\n            \"property\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProduct`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"biologicalSourceEvent\",\n        ]\n\n\nclass BiologicallyDerivedProductCollection(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    How this product was collected.\n    \"\"\"\n\n    __resource_type__ = \"BiologicallyDerivedProductCollection\"\n\n    collectedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"collectedDateTime\",\n        title=\"Time of product collection\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e collected[x]\n            \"one_of_many\": \"collected\",\n            \"one_of_many_required\": False,\n        },\n    )\n    collectedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_collectedDateTime\",\n        title=\"Extension field for ``collectedDateTime``.\",\n    )\n\n    collectedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"collectedPeriod\",\n        title=\"Time of product collection\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e collected[x]\n            \"one_of_many\": \"collected\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    collector: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"collector\",\n        title=\"Individual performing collection\",\n        description=\"Healthcare professional who is performing the collection.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=(\n            \"The patient who underwent the medical procedure to collect the product\"\n            \" or the organization that facilitated the collection\"\n        ),\n        description=(\n            \"The patient or entity, such as a hospital or vendor in the case of a \"\n            \"processed/manipulated/manufactured product, providing the product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BiologicallyDerivedProductCollection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"collector\",\n            \"source\",\n            \"collectedDateTime\",\n            \"collectedPeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductCollection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"collected\": [\"collectedDateTime\", \"collectedPeriod\"]}\n        return one_of_many_fields\n\n\nclass BiologicallyDerivedProductProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A property that is specific to this BiologicallyDerviedProduct instance.\n    \"\"\"\n\n    __resource_type__ = \"BiologicallyDerivedProductProperty\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Code that specifies the property\",\n        description=(\n            \"Code that specifies the property. It should reference an established \"\n            \"coding system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Property values\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Property values\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Property values\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Property values\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Property values\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Property values\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Property values\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Property values\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Property values\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BiologicallyDerivedProductProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueCodeableConcept\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueString\",\n            \"valueAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueInteger\",\n                \"valuePeriod\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/biologicallyderivedproductdispense.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProductDispense\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass BiologicallyDerivedProductDispense(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A record of dispensation of a biologically derived product.\n    This resource reflects an instance of a biologically derived product\n    dispense. The supply or dispense of a biologically derived product from the\n    supply organization or department (e.g. hospital transfusion laboratory) to\n    the clinical team responsible for clinical application.\n    \"\"\"\n\n    __resource_type__ = \"BiologicallyDerivedProductDispense\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"The order or request that this dispense is fulfilling\",\n        description=(\n            \"The order or request that the dispense is fulfilling. This is a \"\n            \"reference to a ServiceRequest resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    destination: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Where the product was dispatched to\",\n        description=(\n            \"Link to a resource identifying the physical location that the product \"\n            \"was dispatched to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for this dispense\",\n        description=(\n            \"Unique instance identifiers assigned to a biologically derived product\"\n            \" dispense. Note: This is a business identifier, not a resource \"\n            \"identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the dispense occurred\",\n        description=\"The physical location where the dispense was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    matchStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"matchStatus\",\n        title=\"Indicates the type of matching associated with the dispense\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional notes\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    originRelationshipType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"originRelationshipType\",\n        title=\"Relationship between the donor and intended recipient\",\n        description=(\n            \"Indicates the relationship between the donor of the biologically \"\n            \"derived product and the intended recipient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Short description\",\n        description=\"A larger event of which this particular event is a component.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BiologicallyDerivedProductDispense\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The intended recipient of the dispensed product\",\n        description=(\n            \"A link to a resource representing the patient that the product is \"\n            \"dispensed for.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    performer: typing.List[\n        fhirtypes.BiologicallyDerivedProductDispensePerformerType\n    ] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Indicates who or what performed an action\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    preparedDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"preparedDate\",\n        title=\"When product was selected/matched\",\n        description=\"When the product was selected/ matched.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    preparedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_preparedDate\",\n        title=\"Extension field for ``preparedDate``.\",\n    )\n\n    product: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"product\",\n        title=\"The BiologicallyDerivedProduct that is dispensed\",\n        description=(\n            \"A link to a resource identifying the biologically derived product that\"\n            \" is being dispensed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BiologicallyDerivedProduct\"],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount dispensed\",\n        description=(\n            \"The amount of product in the dispense. Quantity will depend on the \"\n            \"product being dispensed. Examples are: volume; cell count; \"\n            \"concentration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | allocated | issued | unfulfilled | \"\n            \"returned | entered-in-error | unknown\"\n        ),\n        description=\"A code specifying the state of the dispense event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"allocated\",\n                \"issued\",\n                \"unfulfilled\",\n                \"returned\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    usageInstruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usageInstruction\",\n        title=\"Specific instructions for use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    usageInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_usageInstruction\",\n        title=\"Extension field for ``usageInstruction``.\",\n    )\n\n    whenHandedOver: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenHandedOver\",\n        title=\"When the product was dispatched\",\n        description=\"When the product was dispatched for clinical use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    whenHandedOver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenHandedOver\",\n        title=\"Extension field for ``whenHandedOver``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BiologicallyDerivedProductDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"originRelationshipType\",\n            \"product\",\n            \"patient\",\n            \"matchStatus\",\n            \"performer\",\n            \"location\",\n            \"quantity\",\n            \"preparedDate\",\n            \"whenHandedOver\",\n            \"destination\",\n            \"note\",\n            \"usageInstruction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"originRelationshipType\",\n            \"product\",\n            \"patient\",\n            \"matchStatus\",\n            \"performer\",\n            \"location\",\n            \"quantity\",\n            \"preparedDate\",\n            \"whenHandedOver\",\n            \"destination\",\n            \"note\",\n            \"usageInstruction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass BiologicallyDerivedProductDispensePerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Indicates who or what performed an action.\n    \"\"\"\n\n    __resource_type__ = \"BiologicallyDerivedProductDispensePerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Who performed the action\",\n        description=\"Identifies the person responsible for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Identifies the function of the performer during the dispense\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BiologicallyDerivedProductDispensePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BiologicallyDerivedProductDispensePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n"
  },
  {
    "path": "fhir/resources/bodystructure.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BodyStructure\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass BodyStructure(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specific and identified anatomical structure.\n    Record details about an anatomical structure.  This resource may be used\n    when a coded concept does not provide the necessary detail needed for the\n    use case.\n    \"\"\"\n\n    __resource_type__ = \"BodyStructure\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this record is in active use\",\n        description=\"Whether this body site is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Text description\",\n        description=\"A summary, characterization or explanation of the body structure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    excludedStructure: typing.List[\n        fhirtypes.BodyStructureIncludedStructureType\n    ] | None = Field(\n        default=None,\n        alias=\"excludedStructure\",\n        title=\"Excluded anatomic locations(s)\",\n        description=(\n            \"The anatomical location(s) or region(s) not occupied or represented by\"\n            \" the specimen, lesion, or body structure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Bodystructure identifier\",\n        description=\"Identifier for this instance of the anatomical structure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    image: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"image\",\n        title=\"Attached images\",\n        description=\"Image or images used to identify a location.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    includedStructure: typing.List[\n        fhirtypes.BodyStructureIncludedStructureType\n    ] = Field(\n        default=...,\n        alias=\"includedStructure\",\n        title=\"Included anatomic location(s)\",\n        description=(\n            \"The anatomical location(s) or region(s) of the specimen, lesion, or \"\n            \"body structure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    morphology: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"morphology\",\n        title=\"Kind of Structure\",\n        description=(\n            \"The kind of structure being represented by the body structure at \"\n            \"`BodyStructure.location`.  This can define both normal and abnormal \"\n            \"morphologies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who this is about\",\n        description=\"The person to which the body site belongs.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BodyStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"morphology\",\n            \"includedStructure\",\n            \"excludedStructure\",\n            \"description\",\n            \"image\",\n            \"patient\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BodyStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"morphology\",\n            \"description\",\n            \"patient\",\n        ]\n\n\nclass BodyStructureIncludedStructure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Included anatomic location(s).\n    The anatomical location(s) or region(s) of the specimen, lesion, or body\n    structure.\n    \"\"\"\n\n    __resource_type__ = \"BodyStructureIncludedStructure\"\n\n    bodyLandmarkOrientation: typing.List[\n        fhirtypes.BodyStructureIncludedStructureBodyLandmarkOrientationType\n    ] | None = Field(\n        default=None,\n        alias=\"bodyLandmarkOrientation\",\n        title=\"Landmark relative location\",\n        description=(\n            \"Body locations in relation to a specific body landmark (tatoo, scar, \"\n            \"other body structure).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    laterality: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"laterality\",\n        title=\"Code that represents the included structure laterality\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    qualifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"qualifier\",\n        title=\"Code that represents the included structure qualifier\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    spatialReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"spatialReference\",\n        title=\"Cartesian reference for structure\",\n        description=\"XY or XYZ-coordinate orientation for structure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ImagingSelection\"],\n        },\n    )\n\n    structure: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"structure\",\n        title=\"Code that represents the included structure\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BodyStructureIncludedStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"structure\",\n            \"laterality\",\n            \"bodyLandmarkOrientation\",\n            \"spatialReference\",\n            \"qualifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BodyStructureIncludedStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"structure\"]\n\n\nclass BodyStructureIncludedStructureBodyLandmarkOrientation(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Landmark relative location.\n    Body locations in relation to a specific body landmark (tatoo, scar, other\n    body structure).\n    \"\"\"\n\n    __resource_type__ = \"BodyStructureIncludedStructureBodyLandmarkOrientation\"\n\n    clockFacePosition: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"clockFacePosition\",\n        title=\"Clockface orientation\",\n        description=(\n            \"An description of the direction away from a landmark something is \"\n            \"located based on a radial clock dial.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    distanceFromLandmark: typing.List[\n        fhirtypes.BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkType\n    ] | None = Field(\n        default=None,\n        alias=\"distanceFromLandmark\",\n        title=\"Landmark relative location\",\n        description=(\n            \"The distance in centimeters a certain observation is made from a body \"\n            \"landmark.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    landmarkDescription: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"landmarkDescription\",\n        title=\"Body ]andmark description\",\n        description=(\n            \"A description of a landmark on the body used as a reference to locate \"\n            \"something else.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    surfaceOrientation: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"surfaceOrientation\",\n        title=\"Relative landmark surface orientation\",\n        description=\"The surface area a body location is in relation to a landmark.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BodyStructureIncludedStructureBodyLandmarkOrientation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"landmarkDescription\",\n            \"clockFacePosition\",\n            \"distanceFromLandmark\",\n            \"surfaceOrientation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BodyStructureIncludedStructureBodyLandmarkOrientation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmark(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Landmark relative location.\n    The distance in centimeters a certain observation is made from a body\n    landmark.\n    \"\"\"\n\n    __resource_type__ = (\n        \"BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmark\"\n    )\n\n    device: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Measurement device\",\n        description=\"An instrument, tool, analyzer, etc. used in the measurement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    value: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Measured distance from body landmark\",\n        description=\"The measured distance (e.g., in cm) from a body landmark.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmark`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"device\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmark`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/bundle.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Bundle\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, fhirtypes, resource\n\n\nclass Bundle(resource.Resource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contains a collection of resources.\n    A container for a collection of resources.\n    \"\"\"\n\n    __resource_type__ = \"Bundle\"\n\n    entry: typing.List[fhirtypes.BundleEntryType] | None = Field(\n        default=None,\n        alias=\"entry\",\n        title=\"Entry in the bundle - will have a resource or information\",\n        description=(\n            \"An entry in a bundle resource - will either contain a resource or \"\n            \"information about a resource (transactions and history only).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Persistent identifier for the bundle\",\n        description=(\n            \"A persistent identifier for the bundle that won't change as a bundle \"\n            \"is copied from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issues: fhirtypes.ResourceType | None = Field(\n        default=None,\n        alias=\"issues\",\n        title=\"Issues with the Bundle\",\n        description=(\n            \"Captures issues and warnings that relate to the construction of the \"\n            \"Bundle and the content within it.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.BundleLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links related to this Bundle\",\n        description=\"A series of links that provide context to this bundle.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    signature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"signature\",\n        title=\"Digital Signature\",\n        description=\"Digital Signature - base64 encoded. XML-DSig or a JWS.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    timestamp: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"timestamp\",\n        title=\"When the bundle was assembled\",\n        description=(\n            \"The date/time that the bundle was assembled - i.e. when the resources \"\n            \"were placed in the bundle.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timestamp\", title=\"Extension field for ``timestamp``.\"\n    )\n\n    total: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"If search, the total number of matches\",\n        description=(\n            \"If a set of search matches, this is the (potentially estimated) total \"\n            \"number of entries of type 'match' across all pages in the search.  It \"\n            \"does not include search.mode = 'include' or 'outcome' entries and it \"\n            \"does not provide a count of the number of entries in the Bundle.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    total__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_total\", title=\"Extension field for ``total``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"document | message | transaction | transaction-response | batch | \"\n            \"batch-response | history | searchset | collection | subscription-\"\n            \"notification\"\n        ),\n        description=\"Indicates the purpose of this bundle - how it is intended to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"document\",\n                \"message\",\n                \"transaction\",\n                \"transaction-response\",\n                \"batch\",\n                \"batch-response\",\n                \"history\",\n                \"searchset\",\n                \"collection\",\n                \"subscription-notification\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Bundle`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"identifier\",\n            \"type\",\n            \"timestamp\",\n            \"total\",\n            \"link\",\n            \"entry\",\n            \"signature\",\n            \"issues\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Bundle`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"identifier\",\n            \"type\",\n            \"timestamp\",\n            \"total\",\n            \"link\",\n            \"entry\",\n            \"signature\",\n            \"issues\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass BundleEntry(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Entry in the bundle - will have a resource or information.\n    An entry in a bundle resource - will either contain a resource or\n    information about a resource (transactions and history only).\n    \"\"\"\n\n    __resource_type__ = \"BundleEntry\"\n\n    fullUrl: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"fullUrl\",\n        title=(\n            \"URI for resource (e.g. the absolute URL server address, URI for \"\n            \"UUID/OID, etc.)\"\n        ),\n        description=(\n            \"The Absolute URL for the resource. Except for transactions and \"\n            \"batches, each entry in a Bundle must have a fullUrl. The fullUrl SHALL\"\n            \" NOT disagree with the id in the resource - i.e. if the fullUrl is not\"\n            \" a urn:uuid, the URL shall be version-independent URL consistent with \"\n            \"the Resource.id. The fullUrl is a version independent reference to the\"\n            \" resource. Even when not required, fullUrl MAY be set to a urn:uuid to\"\n            \" allow referencing entries in a transaction. The fullUrl can be an \"\n            \"arbitrary URI and is not limited to urn:uuid, urn:oid, http, and \"\n            \"https. The fullUrl element SHALL have a value except when:  * invoking\"\n            \" a create * invoking or responding to an operation where the body is \"\n            \"not a single identified resource * invoking or returning the results \"\n            \"of a search or history operation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fullUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fullUrl\", title=\"Extension field for ``fullUrl``.\"\n    )\n\n    link: typing.List[fhirtypes.BundleLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links related to this entry\",\n        description=\"A series of links that provide context to this entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    request: fhirtypes.BundleEntryRequestType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Additional execution information (transaction/batch/history)\",\n        description=(\n            \"Additional information about how this entry should be processed as \"\n            \"part of a transaction or batch.  For history, it shows how the entry \"\n            \"was processed to create the version contained in the entry.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.ResourceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"A resource in the bundle\",\n        description=(\n            \"The Resource for the entry. The purpose/meaning of the resource is \"\n            \"determined by the Bundle.type. This is allowed to be a Parameters \"\n            \"resource if and only if it is referenced by something else within the \"\n            \"Bundle that provides context/meaning.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    response: fhirtypes.BundleEntryResponseType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"Results of execution (transaction/batch/history)\",\n        description=(\n            \"Indicates the results of processing the corresponding 'request' entry \"\n            \"in the batch or transaction being responded to or what the results of \"\n            \"an operation where when returning history.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    search: fhirtypes.BundleEntrySearchType | None = Field(\n        default=None,\n        alias=\"search\",\n        title=\"Search related information\",\n        description=(\n            \"Information about the search process that lead to the creation of this\"\n            \" entry.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"link\",\n            \"fullUrl\",\n            \"resource\",\n            \"search\",\n            \"request\",\n            \"response\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"link\",\n            \"fullUrl\",\n            \"resource\",\n            \"search\",\n            \"request\",\n            \"response\",\n        ]\n\n\nclass BundleEntryRequest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional execution information (transaction/batch/history).\n    Additional information about how this entry should be processed as part of\n    a transaction or batch.  For history, it shows how the entry was processed\n    to create the version contained in the entry.\n    \"\"\"\n\n    __resource_type__ = \"BundleEntryRequest\"\n\n    ifMatch: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"ifMatch\",\n        title=\"For managing update contention\",\n        description=(\n            \"Only perform the operation if the Etag value matches. For more \"\n            'information, see the API section [\"Managing Resource '\n            'Contention\"](http.html#concurrency).'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ifMatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ifMatch\", title=\"Extension field for ``ifMatch``.\"\n    )\n\n    ifModifiedSince: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"ifModifiedSince\",\n        title=\"For managing cache currency\",\n        description=(\n            \"Only perform the operation if the last updated date matches. See the \"\n            'API documentation for [\"Conditional Read\"](http.html#cread).'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ifModifiedSince__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_ifModifiedSince\",\n        title=\"Extension field for ``ifModifiedSince``.\",\n    )\n\n    ifNoneExist: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"ifNoneExist\",\n        title=\"For conditional creates\",\n        description=(\n            \"Instruct the server not to perform the create if a specified resource \"\n            \"already exists. For further information, see the API documentation for\"\n            ' [\"Conditional Create\"](http.html#ccreate). This is just the query '\n            'portion of the URL - what follows the \"?\" (not including the \"?\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ifNoneExist__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ifNoneExist\", title=\"Extension field for ``ifNoneExist``.\"\n    )\n\n    ifNoneMatch: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"ifNoneMatch\",\n        title=\"For managing cache validation\",\n        description=(\n            \"If the ETag values match, return a 304 Not Modified status. See the \"\n            'API documentation for [\"Conditional Read\"](http.html#cread).'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ifNoneMatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ifNoneMatch\", title=\"Extension field for ``ifNoneMatch``.\"\n    )\n\n    method: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"GET | HEAD | POST | PUT | DELETE | PATCH\",\n        description=(\n            \"In a transaction or batch, this is the HTTP action to be executed for \"\n            \"this entry. In a history bundle, this indicates the HTTP action that \"\n            \"occurred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"GET\", \"HEAD\", \"POST\", \"PUT\", \"DELETE\", \"PATCH\"],\n        },\n    )\n    method__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_method\", title=\"Extension field for ``method``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"URL for HTTP equivalent of this entry\",\n        description=(\n            \"The URL for this entry, relative to the root (the address to which the\"\n            \" request is posted).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleEntryRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"method\",\n            \"url\",\n            \"ifNoneMatch\",\n            \"ifModifiedSince\",\n            \"ifMatch\",\n            \"ifNoneExist\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleEntryRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"method\",\n            \"url\",\n            \"ifNoneMatch\",\n            \"ifModifiedSince\",\n            \"ifMatch\",\n            \"ifNoneExist\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"method\", \"method__ext\"), (\"url\", \"url__ext\")]\n        return required_fields\n\n\nclass BundleEntryResponse(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Results of execution (transaction/batch/history).\n    Indicates the results of processing the corresponding 'request' entry in\n    the batch or transaction being responded to or what the results of an\n    operation where when returning history.\n    \"\"\"\n\n    __resource_type__ = \"BundleEntryResponse\"\n\n    etag: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"etag\",\n        title=\"The Etag for the resource (if relevant)\",\n        description=(\n            \"The Etag for the resource, if the operation for the entry produced a \"\n            \"versioned resource (see [Resource Metadata and \"\n            \"Versioning](http.html#versioning) and [Managing Resource \"\n            \"Contention](http.html#concurrency)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    etag__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_etag\", title=\"Extension field for ``etag``.\"\n    )\n\n    lastModified: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"lastModified\",\n        title=\"Server's date time modified\",\n        description=\"The date/time that the resource was modified on the server.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastModified\",\n        title=\"Extension field for ``lastModified``.\",\n    )\n\n    location: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"The location (if the operation returns a location)\",\n        description=(\n            \"The location header created by processing this operation, populated if\"\n            \" the operation returns a location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    location__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_location\", title=\"Extension field for ``location``.\"\n    )\n\n    outcome: fhirtypes.ResourceType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"OperationOutcome with hints and warnings (for batch/transaction)\",\n        description=(\n            \"An OperationOutcome containing hints and warnings produced as part of \"\n            \"processing this entry in a batch or transaction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"Status response code (text optional)\",\n        description=(\n            \"The status code returned by processing this entry. The status SHALL \"\n            \"start with a 3 digit HTTP code (e.g. 404) and may contain the standard\"\n            \" HTTP description associated with the status code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleEntryResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"status\",\n            \"location\",\n            \"etag\",\n            \"lastModified\",\n            \"outcome\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleEntryResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"status\",\n            \"location\",\n            \"etag\",\n            \"lastModified\",\n            \"outcome\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass BundleEntrySearch(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Search related information.\n    Information about the search process that lead to the creation of this\n    entry.\n    \"\"\"\n\n    __resource_type__ = \"BundleEntrySearch\"\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"match | include - why this is in the result set\",\n        description=(\n            \"Why this entry is in the result set - whether it's included as a match\"\n            \" or because of an _include requirement, or to convey information or \"\n            \"warning information about the search process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"match\", \"include\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    score: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"score\",\n        title=\"Search ranking (between 0 and 1)\",\n        description=\"When searching, the server's search ranking score for the entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    score__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_score\", title=\"Extension field for ``score``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleEntrySearch`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"mode\", \"score\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleEntrySearch`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\", \"score\"]\n\n\nclass BundleLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links related to this Bundle.\n    A series of links that provide context to this bundle.\n    \"\"\"\n\n    __resource_type__ = \"BundleLink\"\n\n    relation: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"relation\",\n        title=(\n            \"See http://www.iana.org/assignments/link-relations/link-\"\n            \"relations.xhtml#link-relations-1\"\n        ),\n        description=(\n            \"A name which details the functional use for this link - see \"\n            \"[http://www.iana.org/assignments/link-relations/link-\"\n            \"relations.xhtml#link-\"\n            \"relations-1](http://www.iana.org/assignments/link-relations/link-\"\n            \"relations.xhtml#link-relations-1).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    relation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_relation\", title=\"Extension field for ``relation``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Reference details for the link\",\n        description=\"The reference details for the link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``BundleLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"relation\", \"url\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``BundleLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"relation\", \"url\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"relation\", \"relation__ext\"), (\"url\", \"url__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/canonicalresource.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CanonicalResource\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass CanonicalResource(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Common Interface declaration for definitional resources.\n    Common Interface declaration for conformance and knowledge artifact\n    resources.\n    \"\"\"\n\n    __resource_type__ = \"CanonicalResource\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the {{title}} and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the {{title}}.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date (and optionally time) when the {{title}} was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the {{title}} changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the {{title}}\",\n        description=(\n            \"A free text natural language description of the {{title}} from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this {{title}} is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the {{title}}\",\n        description=(\n            \"A formal identifier that is used to identify this {{title}} when it is\"\n            \" represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for {{title}} (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the {{title}} is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this {{title}} (computer friendly)\",\n        description=(\n            \"A natural language name identifying the {{title}}. This name should be\"\n            \" usable as an identifier for the resource by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the {{title}}.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this {{title}} is defined\",\n        description=(\n            \"Explanation of why this {{title}} is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The current state of this {{title}}. \",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this {{title}} (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the {{title}}.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this {{title}}, represented as an absolute \"\n            \"URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this {{title}} when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" {{title}} is (or will be) published. This URL can be the target of a \"\n            \"canonical reference. It SHALL remain the same when the {{title}} is \"\n            \"stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate {{title}}s.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the {{title}}\",\n        description=(\n            \"The identifier that is used to identify this version of the {{title}} \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the {{title}} author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence without additional knowledge.  (See the versionAlgorithm \"\n            \"element.)\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CanonicalResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CanonicalResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/capabilitystatement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CapabilityStatement(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A statement of system capabilities.\n    A Capability Statement documents a set of capabilities (behaviors) of a\n    FHIR Server or Client for a particular version of FHIR that may be used as\n    a statement of actual server functionality or a statement of required or\n    desired server implementation.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatement\"\n\n    acceptLanguage: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"acceptLanguage\",\n        title=\"Languages supported\",\n        description=(\n            \"A list of the languages supported by this implementation that are \"\n            \"usefully supported in the ```Accept-Language``` header.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    acceptLanguage__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_acceptLanguage\",\n        title=\"Extension field for ``acceptLanguage``.\",\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the capability statement and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the capability statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the capability statement was last\"\n            \" significantly changed. The date must change when the business version\"\n            \" changes and it must change if the status code changes. In addition, \"\n            \"it should change when the substantive content of the capability \"\n            \"statement changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the capability statement\",\n        description=(\n            \"A free text natural language description of the capability statement \"\n            \"from a consumer's perspective. Typically, this is used when the \"\n            \"capability statement describes a desired rather than an actual \"\n            \"solution, for example as a formal expression of requirements as part \"\n            \"of an RFP.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    document: typing.List[fhirtypes.CapabilityStatementDocumentType] | None = Field(\n        default=None,\n        alias=\"document\",\n        title=\"Document definition\",\n        description=\"A document definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this capability statement is authored\"\n            \" for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fhirVersion: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"fhirVersion\",\n        title=\"FHIR Version the system supports\",\n        description=(\n            \"The version of the FHIR specification that this CapabilityStatement \"\n            \"describes (which SHALL be the same as the FHIR version of the \"\n            \"CapabilityStatement itself). There is no default value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fhirVersion\", title=\"Extension field for ``fhirVersion``.\"\n    )\n\n    format: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"format\",\n        title=\"formats supported (xml | json | ttl | mime type)\",\n        description=(\n            \"A list of the formats supported by this implementation using their \"\n            \"content types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"formats\", \"json\", \"ttl\", \"mime\"],\n        },\n    )\n    format__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_format\", title=\"Extension field for ``format``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"Additional identifier for the CapabilityStatement (business \" \"identifier)\"\n        ),\n        description=(\n            \"A formal identifier that is used to identify this CapabilityStatement \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    implementation: fhirtypes.CapabilityStatementImplementationType | None = Field(\n        default=None,\n        alias=\"implementation\",\n        title=\"If this describes a specific instance\",\n        description=(\n            \"Identifies a specific implementation instance that is described by the\"\n            \" capability statement - i.e. a particular installation, rather than \"\n            \"the capabilities of a software program.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    implementationGuide: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"implementationGuide\",\n        title=\"Implementation guides supported\",\n        description=(\n            \"A list of implementation guides that the server does (or should) \"\n            \"support in their entirety.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ImplementationGuide\"],\n        },\n    )\n    implementationGuide__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_implementationGuide\",\n        title=\"Extension field for ``implementationGuide``.\",\n    )\n\n    imports: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"imports\",\n        title=\"Canonical URL of another capability statement this adds to\",\n        description=(\n            \"Reference to a canonical URL of another CapabilityStatement that this \"\n            \"software adds to. The capability statement automatically includes \"\n            \"everything in the other statement, and it is not duplicated, though \"\n            \"the server may repeat the same resources, interactions and operations \"\n            \"to add additional details to them.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n    imports__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_imports\", title=\"Extension field for ``imports``.\"\n    )\n\n    instantiates: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiates\",\n        title=\"Canonical URL of another capability statement this implements\",\n        description=(\n            \"Reference to a canonical URL of another CapabilityStatement that this \"\n            \"software implements. This capability statement is a published API \"\n            \"description that corresponds to a business service. The server may \"\n            \"actually implement a subset of the capability statement it claims to \"\n            \"implement, so the capability statement must specify the full \"\n            \"capability details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n    instantiates__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiates\",\n        title=\"Extension field for ``instantiates``.\",\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for capability statement (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the capability statement is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"instance | capability | requirements\",\n        description=(\n            \"The way that this statement is intended to be used, to describe an \"\n            \"actual running instance of software, a particular product (kind, not \"\n            \"instance of software) or a class of implementation (e.g. a desired \"\n            \"purchase).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"capability\", \"requirements\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    messaging: typing.List[fhirtypes.CapabilityStatementMessagingType] | None = Field(\n        default=None,\n        alias=\"messaging\",\n        title=\"If messaging is supported\",\n        description=\"A description of the messaging capabilities of the solution.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this capability statement (computer friendly)\",\n        description=(\n            \"A natural language name identifying the capability statement. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    patchFormat: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"patchFormat\",\n        title=\"Patch formats supported\",\n        description=(\n            \"A list of the patch formats supported by this implementation using \"\n            \"their content types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    patchFormat__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_patchFormat\", title=\"Extension field for ``patchFormat``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the capability statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this capability statement is defined\",\n        description=(\n            \"Explanation of why this capability statement is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    rest: typing.List[fhirtypes.CapabilityStatementRestType] | None = Field(\n        default=None,\n        alias=\"rest\",\n        title=\"If the endpoint is a RESTful one\",\n        description=\"A definition of the restful capabilities of the solution, if any.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    software: fhirtypes.CapabilityStatementSoftwareType | None = Field(\n        default=None,\n        alias=\"software\",\n        title=\"Software that is covered by this capability statement\",\n        description=(\n            \"Software that is covered by this capability statement.  It is used \"\n            \"when the capability statement describes the capabilities of a \"\n            \"particular software version, independent of an installation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this capability statement. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this capability statement (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the capability \" \"statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this capability statement, represented as a \"\n            \"URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this capability statement \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which an \"\n            \"authoritative instance of this capability statement is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the capability statement is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate capability statement instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the capability statement\",\n        description=(\n            \"The identifier that is used to identify this version of the capability\"\n            \" statement when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the capability \"\n            \"statement author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"kind\",\n            \"instantiates\",\n            \"imports\",\n            \"software\",\n            \"implementation\",\n            \"fhirVersion\",\n            \"format\",\n            \"patchFormat\",\n            \"acceptLanguage\",\n            \"implementationGuide\",\n            \"rest\",\n            \"messaging\",\n            \"document\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"kind\",\n            \"instantiates\",\n            \"imports\",\n            \"software\",\n            \"implementation\",\n            \"fhirVersion\",\n            \"format\",\n            \"patchFormat\",\n            \"acceptLanguage\",\n            \"implementationGuide\",\n            \"rest\",\n            \"messaging\",\n            \"document\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"date\", \"date__ext\"),\n            (\"fhirVersion\", \"fhirVersion__ext\"),\n            (\"format\", \"format__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass CapabilityStatementDocument(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Document definition.\n    A document definition.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementDocument\"\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Description of document support\",\n        description=(\n            \"A description of how the application supports or uses the specified \"\n            \"document profile.  For example, when documents are created, what \"\n            \"action is taken with consumed documents, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"producer | consumer\",\n        description=(\n            \"Mode of this document declaration - whether an application is a \"\n            \"producer or consumer.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"producer\", \"consumer\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Constraint on the resources used in the document\",\n        description=(\n            \"A profile on the document Bundle that constrains which resources are \"\n            \"present, and their contents.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementDocument`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"mode\",\n            \"documentation\",\n            \"profile\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementDocument`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\", \"profile\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\"), (\"profile\", \"profile__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementImplementation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If this describes a specific instance.\n    Identifies a specific implementation instance that is described by the\n    capability statement - i.e. a particular installation, rather than the\n    capabilities of a software program.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementImplementation\"\n\n    custodian: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"custodian\",\n        title=\"Organization that manages the data\",\n        description=(\n            \"The organization responsible for the management of the instance and \"\n            \"oversight of the data on the server at the specified URL.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Describes this specific instance\",\n        description=(\n            \"Information about the specific installation that this capability \"\n            \"statement relates to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    url: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Base URL for the installation\",\n        description=(\n            \"An absolute base URL for the implementation.  This forms the base for \"\n            \"REST interfaces as well as the mailbox and document interfaces.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementImplementation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"url\",\n            \"custodian\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementImplementation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"description\", \"url\", \"custodian\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"description\", \"description__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementMessaging(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If messaging is supported.\n    A description of the messaging capabilities of the solution.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementMessaging\"\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Messaging interface behavior details\",\n        description=(\n            \"Documentation about the system's messaging capabilities for this \"\n            \"endpoint not otherwise documented by the capability statement.  For \"\n            \"example, the process for becoming an authorized messaging exchange \"\n            \"partner.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    endpoint: typing.List[\n        fhirtypes.CapabilityStatementMessagingEndpointType\n    ] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Where messages should be sent\",\n        description=(\n            \"An endpoint (network accessible address) to which messages and/or \"\n            \"replies are to be sent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reliableCache: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"reliableCache\",\n        title=\"Reliable Message Cache Length (min)\",\n        description=(\n            \"Length if the receiver's reliable messaging cache in minutes (if a \"\n            \"receiver) or how long the cache length on the receiver should be (if a\"\n            \" sender).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reliableCache__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_reliableCache\",\n        title=\"Extension field for ``reliableCache``.\",\n    )\n\n    supportedMessage: typing.List[\n        fhirtypes.CapabilityStatementMessagingSupportedMessageType\n    ] | None = Field(\n        default=None,\n        alias=\"supportedMessage\",\n        title=\"Messages supported by this system\",\n        description=(\n            \"References to message definitions for messages this system can send or\"\n            \" receive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementMessaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"endpoint\",\n            \"reliableCache\",\n            \"documentation\",\n            \"supportedMessage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"supportedMessage\"]\n\n\nclass CapabilityStatementMessagingEndpoint(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Where messages should be sent.\n    An endpoint (network accessible address) to which messages and/or replies\n    are to be sent.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementMessagingEndpoint\"\n\n    address: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Network address or identifier of the end-point\",\n        description=(\n            \"The network address of the endpoint. For solutions that do not use \"\n            \"network addresses for routing, it can be just an identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_address\", title=\"Extension field for ``address``.\"\n    )\n\n    protocol: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"protocol\",\n        title=\"http | ftp | mllp +\",\n        description=(\n            \"A list of the messaging transport protocol(s) identifiers, supported \"\n            \"by this endpoint.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementMessagingEndpoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"protocol\", \"address\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingEndpoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"address\", \"address__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementMessagingSupportedMessage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Messages supported by this system.\n    References to message definitions for messages this system can send or\n    receive.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementMessagingSupportedMessage\"\n\n    definition: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Message supported by this system\",\n        description=(\n            \"Points to a message definition that identifies the messaging event, \"\n            \"message structure, allowed responses, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"sender | receiver\",\n        description=(\n            \"The mode of this event declaration - whether application is sender or \"\n            \"receiver.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"sender\", \"receiver\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementMessagingSupportedMessage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"mode\", \"definition\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementMessagingSupportedMessage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\", \"definition\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"definition\", \"definition__ext\"), (\"mode\", \"mode__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If the endpoint is a RESTful one.\n    A definition of the restful capabilities of the solution, if any.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRest\"\n\n    compartment: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"compartment\",\n        title=\"Compartments served/used by system\",\n        description=(\n            \"An absolute URI which is a reference to the definition of a \"\n            \"compartment that the system supports. The reference is to a \"\n            \"CompartmentDefinition resource by its canonical URL .\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CompartmentDefinition\"],\n        },\n    )\n    compartment__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_compartment\", title=\"Extension field for ``compartment``.\"\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"General description of implementation\",\n        description=(\n            \"Information about the system's restful capabilities that apply across \"\n            \"all applications, such as security.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    interaction: typing.List[\n        fhirtypes.CapabilityStatementRestInteractionType\n    ] | None = Field(\n        default=None,\n        alias=\"interaction\",\n        title=\"What operations are supported?\",\n        description=\"A specification of restful operations supported by the system.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"client | server\",\n        description=(\n            \"Identifies whether this portion of the statement is describing the \"\n            \"ability to initiate or receive restful operations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"client\", \"server\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    operation: typing.List[\n        fhirtypes.CapabilityStatementRestResourceOperationType\n    ] | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"Definition of a system level operation\",\n        description=(\n            \"Definition of an operation or a named query together with its \"\n            \"parameters and their meaning and type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: typing.List[fhirtypes.CapabilityStatementRestResourceType] | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Resource served on the REST interface\",\n        description=(\n            \"A specification of the restful capabilities of the solution for a \"\n            \"specific resource type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    searchParam: typing.List[\n        fhirtypes.CapabilityStatementRestResourceSearchParamType\n    ] | None = Field(\n        default=None,\n        alias=\"searchParam\",\n        title=\"Search parameters for searching all resources\",\n        description=(\n            \"Search parameters that are supported for searching all resources for \"\n            \"implementations to support and/or make use of - either references to \"\n            \"ones defined in the specification, or additional ones defined for/by \"\n            \"the implementation. This is only for searches executed against the \"\n            \"system-level endpoint.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    security: fhirtypes.CapabilityStatementRestSecurityType | None = Field(\n        default=None,\n        alias=\"security\",\n        title=\"Information about security of implementation\",\n        description=(\n            \"Information about security implementation from an interface \"\n            \"perspective - what a client needs to know.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"mode\",\n            \"documentation\",\n            \"security\",\n            \"resource\",\n            \"interaction\",\n            \"searchParam\",\n            \"operation\",\n            \"compartment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"mode\", \"security\", \"resource\", \"operation\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestInteraction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What operations are supported?.\n    A specification of restful operations supported by the system.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestInteraction\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"transaction | batch | search-system | history-system\",\n        description=\"A coded identifier of the operation, supported by the system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"transaction\", \"batch\", \"search-system\", \"history-system\"],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Anything special about operation behavior\",\n        description=(\n            \"Guidance specific to the implementation of this operation, such as \"\n            \"limitations on the kind of transactions allowed, or information about \"\n            \"system wide search is implemented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"documentation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestResource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource served on the REST interface.\n    A specification of the restful capabilities of the solution for a specific\n    resource type.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestResource\"\n\n    conditionalCreate: bool | None = Field(\n        default=None,\n        alias=\"conditionalCreate\",\n        title=\"If allows/uses conditional create\",\n        description=\"A flag that indicates that the server supports conditional create.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    conditionalCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalCreate\",\n        title=\"Extension field for ``conditionalCreate``.\",\n    )\n\n    conditionalDelete: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"conditionalDelete\",\n        title=(\n            \"not-supported | single | multiple - how conditional delete is \" \"supported\"\n        ),\n        description=\"A code that indicates how the server supports conditional delete.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"not-supported\", \"single\", \"multiple\"],\n        },\n    )\n    conditionalDelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalDelete\",\n        title=\"Extension field for ``conditionalDelete``.\",\n    )\n\n    conditionalPatch: bool | None = Field(\n        default=None,\n        alias=\"conditionalPatch\",\n        title=\"If allows/uses conditional patch\",\n        description=\"A flag that indicates that the server supports conditional patch.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    conditionalPatch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalPatch\",\n        title=\"Extension field for ``conditionalPatch``.\",\n    )\n\n    conditionalRead: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"conditionalRead\",\n        title=\"not-supported | modified-since | not-match | full-support\",\n        description=\"A code that indicates how the server supports conditional read.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"not-supported\",\n                \"modified-since\",\n                \"not-match\",\n                \"full-support\",\n            ],\n        },\n    )\n    conditionalRead__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalRead\",\n        title=\"Extension field for ``conditionalRead``.\",\n    )\n\n    conditionalUpdate: bool | None = Field(\n        default=None,\n        alias=\"conditionalUpdate\",\n        title=\"If allows/uses conditional update\",\n        description=\"A flag that indicates that the server supports conditional update.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    conditionalUpdate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionalUpdate\",\n        title=\"Extension field for ``conditionalUpdate``.\",\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Additional information about the use of the resource type\",\n        description=\"Additional information about the resource type used by the system.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    interaction: typing.List[\n        fhirtypes.CapabilityStatementRestResourceInteractionType\n    ] | None = Field(\n        default=None,\n        alias=\"interaction\",\n        title=\"What operations are supported?\",\n        description=\"Identifies a restful operation supported by the solution.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: typing.List[\n        fhirtypes.CapabilityStatementRestResourceOperationType\n    ] | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"Definition of a resource operation\",\n        description=(\n            \"Definition of an operation or a named query together with its \"\n            \"parameters and their meaning and type. Consult the definition of the \"\n            \"operation for details about how to invoke the operation, and the \"\n            \"parameters.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"System-wide profile\",\n        description=(\n            \"A system-wide profile that is applied across *all* instances of the \"\n            \"resource supported by the system. For example, if declared on \"\n            'Observation, this profile is the \"superset\" of capabilities for '\n            \"laboratory *and* vitals *and* other domains. See further discussion in\"\n            \" [Using Profiles](profiling.html#profile-uses).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    readHistory: bool | None = Field(\n        default=None,\n        alias=\"readHistory\",\n        title=\"Whether vRead can return past versions\",\n        description=(\n            \"A flag for whether the server is able to return past versions as part \"\n            \"of the vRead operation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    readHistory__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_readHistory\", title=\"Extension field for ``readHistory``.\"\n    )\n\n    referencePolicy: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"referencePolicy\",\n        title=\"literal | logical | resolves | enforced | local\",\n        description=\"A set of flags that defines how references are supported.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"literal\", \"logical\", \"resolves\", \"enforced\", \"local\"],\n        },\n    )\n    referencePolicy__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_referencePolicy\",\n        title=\"Extension field for ``referencePolicy``.\",\n    )\n\n    searchInclude: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"searchInclude\",\n        title=\"_include values supported by the server\",\n        description=\"A list of _include values supported by the server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    searchInclude__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_searchInclude\",\n        title=\"Extension field for ``searchInclude``.\",\n    )\n\n    searchParam: typing.List[\n        fhirtypes.CapabilityStatementRestResourceSearchParamType\n    ] | None = Field(\n        default=None,\n        alias=\"searchParam\",\n        title=\"Search parameters supported by implementation\",\n        description=(\n            \"Search parameters for implementations to support and/or make use of - \"\n            \"either references to ones defined in the specification, or additional \"\n            \"ones defined for/by the implementation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    searchRevInclude: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"searchRevInclude\",\n        title=\"_revinclude values supported by the server\",\n        description=(\n            \"A list of _revinclude (reverse include) values supported by the \" \"server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    searchRevInclude__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_searchRevInclude\",\n        title=\"Extension field for ``searchRevInclude``.\",\n    )\n\n    supportedProfile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"supportedProfile\",\n        title=\"Use-case specific profiles\",\n        description=(\n            \"A list of profiles representing different use cases the system \"\n            \"hosts/produces. A supported profile is a statement about the \"\n            \"functionality of the data and services provided by the server (or the \"\n            \"client) for supported use cases. For example, a system can define and \"\n            \"declare multiple Observation profiles for laboratory observations, \"\n            \"vital sign observations, etc. By declaring supported profiles, systems\"\n            \" provide a way to determine whether individual resources are \"\n            \"conformant. See further discussion in [Using \"\n            \"Profiles](profiling.html#profile-uses).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    supportedProfile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_supportedProfile\",\n        title=\"Extension field for ``supportedProfile``.\",\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"A resource type that is supported\",\n        description=\"A type of resource exposed via the restful interface.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    updateCreate: bool | None = Field(\n        default=None,\n        alias=\"updateCreate\",\n        title=\"If update can commit to a new identity\",\n        description=(\n            \"A flag to indicate that the server allows or needs to allow the client\"\n            \" to create new identities on the server (that is, the client PUTs to a\"\n            \" location where there is no existing resource). Allowing this \"\n            \"operation means that the server allows the client to create new \"\n            \"identities on the server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    updateCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_updateCreate\",\n        title=\"Extension field for ``updateCreate``.\",\n    )\n\n    versioning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"versioning\",\n        title=\"no-version | versioned | versioned-update\",\n        description=(\n            \"This field is set to no-version to specify that the system does not \"\n            \"support (server) or use (client) versioning for this resource type. If\"\n            \" this has some other value, the server must at least correctly track \"\n            \"and populate the versionId meta-property on resources. If the value is\"\n            \" 'versioned-update', then the server supports all the versioning \"\n            \"features, including using e-tags for version integrity in the API.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"no-version\", \"versioned\", \"versioned-update\"],\n        },\n    )\n    versioning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_versioning\", title=\"Extension field for ``versioning``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"profile\",\n            \"supportedProfile\",\n            \"documentation\",\n            \"interaction\",\n            \"versioning\",\n            \"readHistory\",\n            \"updateCreate\",\n            \"conditionalCreate\",\n            \"conditionalRead\",\n            \"conditionalUpdate\",\n            \"conditionalPatch\",\n            \"conditionalDelete\",\n            \"referencePolicy\",\n            \"searchInclude\",\n            \"searchRevInclude\",\n            \"searchParam\",\n            \"operation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"profile\", \"supportedProfile\", \"operation\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestResourceInteraction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What operations are supported?.\n    Identifies a restful operation supported by the solution.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestResourceInteraction\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"read | vread | update | patch | delete | history-instance | history-\"\n            \"type | create | search-type\"\n        ),\n        description=\"Coded identifier of the operation, supported by the system resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"read\",\n                \"vread\",\n                \"update\",\n                \"patch\",\n                \"delete\",\n                \"history-instance\",\n                \"history-type\",\n                \"create\",\n                \"search-type\",\n            ],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Anything special about operation behavior\",\n        description=(\n            \"Guidance specific to the implementation of this operation, such as \"\n            \"'delete is a logical delete' or 'updates are only allowed with version\"\n            \" id' or 'creates permitted from pre-authorized certificates only'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestResourceInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"documentation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestResourceOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a resource operation.\n    Definition of an operation or a named query together with its parameters\n    and their meaning and type. Consult the definition of the operation for\n    details about how to invoke the operation, and the parameters.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestResourceOperation\"\n\n    definition: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"The defined operation/query\",\n        description=(\n            \"Where the formal definition can be found. If a server references the \"\n            \"base definition of an Operation (i.e. from the specification itself \"\n            \"such as ```http://hl7.org/fhir/OperationDefinition/ValueSet-\"\n            \"expand```), that means it supports the full capabilities of the \"\n            \"operation - e.g. both GET and POST invocation.  If it only supports a \"\n            \"subset, it must define its own custom \"\n            \"[OperationDefinition](operationdefinition.html#) with a 'base' of the \"\n            \"original OperationDefinition.  The custom definition would describe \"\n            \"the specific subset of functionality supported.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationDefinition\"],\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Specific details about operation behavior\",\n        description=(\n            \"Documentation that describes anything special about the operation \"\n            \"behavior, possibly detailing different behavior for system, type and \"\n            \"instance-level invocation of the operation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name by which the operation/query is invoked\",\n        description=(\n            \"The name of the operation or query. For an operation, this name is \"\n            \"prefixed with $ and used in the URL. For a query, this is the name \"\n            \"used in the _query parameter when the query is called. This SHOULD be \"\n            \"the same as the OperationDefinition.code of the defining \"\n            \"OperationDefinition.  However, it can sometimes differ if necessary to\"\n            \" disambiguate when a server supports multiple OperationDefinition that\"\n            \" happen to share the same code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestResourceOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"definition\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"definition\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"definition\", \"definition__ext\"), (\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestResourceSearchParam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Search parameters supported by implementation.\n    Search parameters for implementations to support and/or make use of -\n    either references to ones defined in the specification, or additional ones\n    defined for/by the implementation.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestResourceSearchParam\"\n\n    definition: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Source of definition for parameter\",\n        description=(\n            \"An absolute URI that is a formal reference to where this parameter was\"\n            \" first defined, so that a client can be confident of the meaning of \"\n            \"the search parameter (a reference to \"\n            \"[SearchParameter.url](searchparameter-\"\n            \"definitions.html#SearchParameter.url)). This element SHALL be \"\n            \"populated if the search parameter refers to a SearchParameter defined \"\n            \"by the FHIR core specification or externally defined IGs.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SearchParameter\"],\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Server-specific usage\",\n        description=(\n            \"This allows documentation of any distinct behaviors about how the \"\n            \"search parameter is used.  For example, text matching algorithms.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for parameter in search url\",\n        description=(\n            \"The label used for the search parameter in this particular system's \"\n            \"API - i.e. the 'name' portion of the name-value pair that will appear \"\n            \"as part of the search URL.  This SHOULD be the same as the \"\n            \"SearchParameter.code of the defining SearchParameter.  However, it can\"\n            \" sometimes differ if necessary to disambiguate when a server supports \"\n            \"multiple SearchParameters that happen to share the same code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"number | date | string | token | reference | composite | quantity | \"\n            \"uri | special\"\n        ),\n        description=(\n            \"The type of value a search parameter refers to, and how the content is\"\n            \" interpreted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"number\",\n                \"date\",\n                \"string\",\n                \"token\",\n                \"reference\",\n                \"composite\",\n                \"quantity\",\n                \"uri\",\n                \"special\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestResourceSearchParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"definition\",\n            \"type\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestResourceSearchParam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass CapabilityStatementRestSecurity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about security of implementation.\n    Information about security implementation from an interface perspective -\n    what a client needs to know.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementRestSecurity\"\n\n    cors: bool | None = Field(\n        default=None,\n        alias=\"cors\",\n        title=\"Adds CORS Headers (http://enable-cors.org/)\",\n        description=(\n            \"Server adds CORS headers when responding to requests - this enables \"\n            \"Javascript applications to use the server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    cors__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_cors\", title=\"Extension field for ``cors``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"General description of how security works\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    service: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates\",\n        description=\"Types of security services that are supported/required by the system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementRestSecurity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"cors\",\n            \"service\",\n            \"description\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementRestSecurity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"cors\", \"service\"]\n\n\nclass CapabilityStatementSoftware(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Software that is covered by this capability statement.\n    Software that is covered by this capability statement.  It is used when the\n    capability statement describes the capabilities of a particular software\n    version, independent of an installation.\n    \"\"\"\n\n    __resource_type__ = \"CapabilityStatementSoftware\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name the software is known by\",\n        description=\"Name the software is known by.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    releaseDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"releaseDate\",\n        title=\"Date this version was released\",\n        description=\"Date this version of the software was released.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    releaseDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_releaseDate\", title=\"Extension field for ``releaseDate``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version covered by this statement\",\n        description=\"The version identifier for the software covered by this statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CapabilityStatementSoftware`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"version\",\n            \"releaseDate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CapabilityStatementSoftware`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"version\", \"releaseDate\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/careplan.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CarePlan\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CarePlan(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Healthcare plan for patient or group.\n    Describes the intention of how one or more practitioners intend to deliver\n    care for a particular patient, group or community for a period of time,\n    possibly limited to care for a specific condition or set of conditions.\n    \"\"\"\n\n    __resource_type__ = \"CarePlan\"\n\n    activity: typing.List[fhirtypes.CarePlanActivityType] | None = Field(\n        default=None,\n        alias=\"activity\",\n        title=\"Action to occur or has occurred as part of plan\",\n        description=(\n            \"Identifies an action that has occurred or is a planned action to occur\"\n            \" as part of the plan. For example, a medication to be used, lab tests \"\n            \"to perform, self-monitoring that has occurred, education etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    addresses: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"addresses\",\n        title=\"Health issues this plan addresses\",\n        description=(\n            \"Identifies the conditions/problems/concerns/diagnoses/etc. whose \"\n            \"management and/or mitigation are handled by this plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan, proposal or order\",\n        description=(\n            \"A higher-level request resource (i.e. a plan, proposal or order) that \"\n            \"is fulfilled in whole or in part by this care plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"ServiceRequest\",\n                \"RequestOrchestration\",\n                \"NutritionOrder\",\n            ],\n        },\n    )\n\n    careTeam: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"careTeam\",\n        title=\"Who's involved in plan?\",\n        description=(\n            \"Identifies all people and organizations who are expected to be \"\n            \"involved in the care envisioned by this plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CareTeam\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of plan\",\n        description=(\n            'Identifies what \"kind\" of plan this is to support differentiation '\n            'between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\",'\n            ' \"asthma\", \"disease management\", \"wellness plan\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contributor: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"contributor\",\n        title=\"Who provided the content of the care plan\",\n        description=(\n            \"Identifies the individual(s), organization or device who provided the \"\n            \"contents of the care plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"RelatedPerson\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Date record was first recorded\",\n        description=(\n            \"Represents when this particular CarePlan record was created in the \"\n            \"system, which is often a system-generated date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    custodian: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"custodian\",\n        title=\"Who is the designated responsible party\",\n        description=(\n            \"When populated, the custodian is responsible for the care plan. The \"\n            \"care plan is attributed to the custodian.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"RelatedPerson\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Summary of nature of plan\",\n        description=\"A description of the scope and nature of the plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"The Encounter during which this CarePlan was created\",\n        description=(\n            \"The Encounter during which this CarePlan was created or to which the \"\n            \"creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    goal: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"goal\",\n        title=\"Desired outcome of plan\",\n        description=\"Describes the intended objective(s) of carrying out the care plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Goal\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this plan\",\n        description=(\n            \"Business identifiers assigned to this care plan by the performer or \"\n            \"other systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, questionnaire \"\n            \"or other definition that is adhered to in whole or in part by this \"\n            \"CarePlan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"Questionnaire\",\n                \"Measure\",\n                \"ActivityDefinition\",\n                \"OperationDefinition\",\n            ],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"questionnaire or other definition that is adhered to in whole or in \"\n            \"part by this CarePlan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=\"proposal | plan | order | option | directive\",\n        description=(\n            \"Indicates the level of authority/intentionality associated with the \"\n            \"care plan and where the care plan fits into the workflow chain.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"proposal\", \"plan\", \"order\", \"option\", \"directive\"],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the plan\",\n        description=\"General notes about the care plan not covered elsewhere.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced CarePlan\",\n        description=(\n            \"A larger care plan of which this particular care plan is a component \"\n            \"or step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period plan covers\",\n        description=(\n            \"Indicates when the plan did (or is intended to) come into effect and \"\n            \"end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"CarePlan replaced by this CarePlan\",\n        description=(\n            \"Completed or terminated care plan whose function is taken by this new \"\n            \"care plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | on-hold | revoked | completed | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=(\n            \"Indicates whether the plan is currently being acted upon, represents \"\n            \"future intentions or is now a historical record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"on-hold\",\n                \"revoked\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who the care plan is for\",\n        description=(\n            \"Identifies the patient or group whose intended care is described by \"\n            \"the plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Information considered as part of plan\",\n        description=(\n            \"Identifies portions of the patient's record that specifically \"\n            \"influenced the formation of the plan.  These might include \"\n            \"comorbidities, recent procedures, limitations, recent assessments, \"\n            \"etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Human-friendly name for the care plan\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CarePlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"replaces\",\n            \"partOf\",\n            \"status\",\n            \"intent\",\n            \"category\",\n            \"title\",\n            \"description\",\n            \"subject\",\n            \"encounter\",\n            \"period\",\n            \"created\",\n            \"custodian\",\n            \"contributor\",\n            \"careTeam\",\n            \"addresses\",\n            \"supportingInfo\",\n            \"goal\",\n            \"activity\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CarePlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"replaces\",\n            \"partOf\",\n            \"status\",\n            \"intent\",\n            \"category\",\n            \"title\",\n            \"description\",\n            \"subject\",\n            \"encounter\",\n            \"period\",\n            \"created\",\n            \"custodian\",\n            \"addresses\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass CarePlanActivity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Action to occur or has occurred as part of plan.\n    Identifies an action that has occurred or is a planned action to occur as\n    part of the plan. For example, a medication to be used, lab tests to\n    perform, self-monitoring that has occurred, education etc.\n    \"\"\"\n\n    __resource_type__ = \"CarePlanActivity\"\n\n    performedActivity: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"performedActivity\",\n        title=(\n            \"Results of the activity (concept, or Appointment, Encounter, \"\n            \"Procedure, etc.)\"\n        ),\n        description=(\n            \"Identifies the activity that was performed. For example, an activity \"\n            \"could be patient education, exercise, or a medication administration. \"\n            'The reference to an \"event\" resource, such as Procedure or Encounter '\n            \"or Observation, represents the activity that was performed. The \"\n            \"requested activity can be conveyed using the \"\n            \"CarePlan.activity.plannedActivityReference (a reference to a \\u201crequest\\u201d\"\n            \" resource).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    plannedActivityReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"plannedActivityReference\",\n        title=\"Activity that is intended to be part of the care plan\",\n        description=(\n            \"The details of the proposed activity represented in a specific \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Appointment\",\n                \"CommunicationRequest\",\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"Task\",\n                \"ServiceRequest\",\n                \"VisionPrescription\",\n                \"RequestOrchestration\",\n                \"ImmunizationRecommendation\",\n                \"SupplyRequest\",\n            ],\n        },\n    )\n\n    progress: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"progress\",\n        title=\"Comments about the activity status/progress\",\n        description=\"Notes about the adherence/status/progress of the activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CarePlanActivity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"performedActivity\",\n            \"progress\",\n            \"plannedActivityReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CarePlanActivity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/careteam.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CareTeam\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CareTeam(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Planned participants in the coordination and delivery of care.\n    The Care Team includes all the people and organizations who plan to\n    participate in the coordination and delivery of care.\n    \"\"\"\n\n    __resource_type__ = \"CareTeam\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of team\",\n        description=(\n            \"Identifies what kind of team.  This is to support differentiation \"\n            \"between multiple co-existing teams, such as care plan team, episode of\"\n            \" care team, longitudinal care team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this team\",\n        description=(\n            \"Business identifiers assigned to this care team by the performer or \"\n            \"other systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingOrganization: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"Organization responsible for the care team\",\n        description=\"The organization responsible for the care team.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the team, such as crisis assessment team\",\n        description=(\n            \"A label for human use intended to distinguish like teams.  E.g. the \"\n            '\"red\" vs. \"green\" trauma teams.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the CareTeam\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    participant: typing.List[fhirtypes.CareTeamParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Members of the team\",\n        description=(\n            \"Identifies all people and organizations who are expected to be \"\n            \"involved in the care team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period team covers\",\n        description=(\n            \"Indicates when the team did (or is intended to) come into effect and \"\n            \"end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why the care team exists\",\n        description=\"Describes why the care team exists.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"proposed | active | suspended | inactive | entered-in-error\",\n        description=\"Indicates the current state of the care team.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposed\",\n                \"active\",\n                \"suspended\",\n                \"inactive\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who care team is for\",\n        description=(\n            \"Identifies the patient or group whose intended care is handled by the \"\n            \"team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the care team (that applies to all members)\",\n        description=(\n            \"A central contact detail for the care team (that applies to all \"\n            \"members).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"name\",\n            \"subject\",\n            \"period\",\n            \"participant\",\n            \"reason\",\n            \"managingOrganization\",\n            \"telecom\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"name\",\n            \"subject\",\n            \"period\",\n            \"managingOrganization\",\n        ]\n\n\nclass CareTeamParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Members of the team.\n    Identifies all people and organizations who are expected to be involved in\n    the care team.\n    \"\"\"\n\n    __resource_type__ = \"CareTeamParticipant\"\n\n    coveragePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"coveragePeriod\",\n        title=\"When the member is generally available within this care team\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e coverage[x]\n            \"one_of_many\": \"coverage\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    coverageTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"coverageTiming\",\n        title=\"When the member is generally available within this care team\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e coverage[x]\n            \"one_of_many\": \"coverage\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    member: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"member\",\n        title=\"Who is involved\",\n        description=(\n            \"The specific person or organization who is participating/expected to \"\n            \"participate in the care team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization of the practitioner\",\n        description=\"The organization of the practitioner.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Type of involvement\",\n        description=(\n            \"Indicates specific responsibility of an individual within the care \"\n            'team, such as \"Primary care physician\", \"Trained social worker '\n            'counselor\", \"Caregiver\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CareTeamParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"role\",\n            \"member\",\n            \"onBehalfOf\",\n            \"coveragePeriod\",\n            \"coverageTiming\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CareTeamParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"role\", \"member\", \"onBehalfOf\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"coverage\": [\"coveragePeriod\", \"coverageTiming\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/chargeitem.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ChargeItem\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ChargeItem(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Item containing charge code(s) associated with the provision of healthcare\n    provider products.\n    The resource ChargeItem describes the provision of healthcare provider\n    products for a certain patient, therefore referring not only to the\n    product, but containing in addition details of the provision, like date,\n    time, amounts and participating organizations and persons. Main Usage of\n    the ChargeItem is to enable the billing process and internal cost\n    allocation.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItem\"\n\n    account: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"account\",\n        title=\"Account to place this charge\",\n        description=\"Account into which this ChargeItems belongs.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    bodysite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodysite\",\n        title=\"Anatomical location, if relevant\",\n        description=\"The anatomical location where the related service has been applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"A code that identifies the charge, like a billing code\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    costCenter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"costCenter\",\n        title=\"Organization that has ownership of the (potential, future) revenue\",\n        description=\"The financial cost center permits the tracking of charge attribution.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    definitionCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"definitionCanonical\",\n        title=\"Resource defining the code of this ChargeItem\",\n        description=(\n            \"References the source of pricing information, rules of application for\"\n            \" the code this ChargeItem uses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ChargeItemDefinition\"],\n        },\n    )\n    definitionCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_definitionCanonical\",\n        title=\"Extension field for ``definitionCanonical``.\",\n    )\n\n    definitionUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"definitionUri\",\n        title=\"Defining information about the code of this charge item\",\n        description=(\n            \"References the (external) source of pricing information, rules of \"\n            \"application for the code this ChargeItem uses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definitionUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_definitionUri\",\n        title=\"Extension field for ``definitionUri``.\",\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter associated with this ChargeItem\",\n        description=(\n            \"This ChargeItem has the details of how the associated Encounter should\"\n            \" be billed or otherwise be handled by finance systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    enteredDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"enteredDate\",\n        title=\"Date the charge item was entered\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    enteredDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_enteredDate\", title=\"Extension field for ``enteredDate``.\"\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Individual who was entering\",\n        description=\"The device, practitioner, etc. who entered the charge item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for item\",\n        description=\"Identifiers assigned to this event performer or other systems.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the ChargeItem\",\n        description=(\n            \"Comments made about the event by the performer, subject or other \"\n            \"participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When the charged service was applied\",\n        description=\"Date/time(s) or duration when the charged service was applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When the charged service was applied\",\n        description=\"Date/time(s) or duration when the charged service was applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When the charged service was applied\",\n        description=\"Date/time(s) or duration when the charged service was applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    overrideReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"overrideReason\",\n        title=\"Reason for overriding the list price/factor\",\n        description=(\n            \"If the list price or the rule-based factor associated with the code is\"\n            \" overridden, this attribute can capture a text to indicate the  reason\"\n            \" for this action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced ChargeItem\",\n        description=(\n            \"ChargeItems can be grouped to larger ChargeItems covering the whole \"\n            \"set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ChargeItem\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.ChargeItemPerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed charged service\",\n        description=(\n            \"Indicates who or what performed or participated in the charged \" \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performingOrganization\",\n        title=\"Organization providing the charged service\",\n        description=\"The organization performing the service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    product: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"product\",\n        title=\"Product charged\",\n        description=(\n            \"Identifies the device, food, drug or other product being charged \"\n            \"either by type code or reference to an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"Medication\", \"Substance\"],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Quantity of which the charge item has been serviced\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why was the charged  service rendered?\",\n        description=\"Describes why the event occurred in coded or textual form.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requestingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestingOrganization\",\n        title=\"Organization requesting the charged service\",\n        description=\"The organization requesting the service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    service: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"service\",\n        title=\"Which rendered service is being charged?\",\n        description=\"Indicated the rendered service that caused this charge.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DiagnosticReport\",\n                \"ImagingStudy\",\n                \"Immunization\",\n                \"MedicationAdministration\",\n                \"MedicationDispense\",\n                \"MedicationRequest\",\n                \"Observation\",\n                \"Procedure\",\n                \"ServiceRequest\",\n                \"SupplyDelivery\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | billable | not-billable | aborted | billed | entered-in-\"\n            \"error | unknown\"\n        ),\n        description=\"The current state of the ChargeItem.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"billable\",\n                \"not-billable\",\n                \"aborted\",\n                \"billed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Individual service was done for/to\",\n        description=(\n            \"The individual or set of individuals the action is being or was \"\n            \"performed on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Further information supporting this charge\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    totalPriceComponent: fhirtypes.MonetaryComponentType | None = Field(\n        default=None,\n        alias=\"totalPriceComponent\",\n        title=\"Total price overriding the associated rules\",\n        description=\"The total price for the chargable item, accounting for the quantity.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPriceComponent: fhirtypes.MonetaryComponentType | None = Field(\n        default=None,\n        alias=\"unitPriceComponent\",\n        title=\"Unit price overriding the associated rules\",\n        description=\"The unit price of the chargable item.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"definitionUri\",\n            \"definitionCanonical\",\n            \"status\",\n            \"partOf\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"performer\",\n            \"performingOrganization\",\n            \"requestingOrganization\",\n            \"costCenter\",\n            \"quantity\",\n            \"bodysite\",\n            \"unitPriceComponent\",\n            \"totalPriceComponent\",\n            \"overrideReason\",\n            \"enterer\",\n            \"enteredDate\",\n            \"reason\",\n            \"service\",\n            \"product\",\n            \"account\",\n            \"note\",\n            \"supportingInformation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"quantity\",\n            \"bodysite\",\n            \"enterer\",\n            \"enteredDate\",\n            \"account\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\", \"occurrenceTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass ChargeItemPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed charged service.\n    Indicates who or what performed or participated in the charged service.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItemPerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual who was performing\",\n        description=(\n            \"The device, practitioner, etc. who performed or participated in the \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"HealthcareService\",\n                \"CareTeam\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"What type of performance was done\",\n        description=(\n            \"Describes the type of performance or participation(e.g. primary \"\n            \"surgeon, anesthesiologiest, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItemPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItemPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/chargeitemdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ChargeItemDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of properties and rules about how the price and the\n    applicability of a ChargeItem can be determined.\n    The ChargeItemDefinition resource provides the properties that apply to the\n    (billing) codes necessary to calculate costs and prices. The properties may\n    differ largely depending on type and realm, therefore this resource gives\n    only a rough structure and requires profiling for each type of billing code\n    system.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItemDefinition\"\n\n    applicability: typing.List[\n        fhirtypes.ChargeItemDefinitionApplicabilityType\n    ] | None = Field(\n        default=None,\n        alias=\"applicability\",\n        title=\"Whether or not the billing code is applicable\",\n        description=\"Expressions that describe applicability criteria for the billing code.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the charge item definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Billing code or product type this definition applies to\",\n        description=(\n            \"The defined billing details in this resource pertain to the given \"\n            \"billing code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the charge item definition and/or \"\n            \"its contents. Copyright statements are generally legal restrictions on\"\n            \" the use and publishing of the charge item definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the charge item definition was \"\n            \"last significantly changed. The date must change when the business \"\n            \"version changes and it must change if the status code changes. In \"\n            \"addition, it should change when the substantive content of the charge \"\n            \"item definition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFromUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"derivedFromUri\",\n        title=\"Underlying externally-defined charge item definition\",\n        description=(\n            \"The URL pointing to an externally-defined charge item definition that \"\n            \"is adhered to in whole or in part by this definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    derivedFromUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_derivedFromUri\",\n        title=\"Extension field for ``derivedFromUri``.\",\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the charge item definition\",\n        description=(\n            \"A free text natural language description of the charge item definition\"\n            \" from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this charge item definition is \"\n            \"authored for testing purposes (or education/evaluation/marketing) and \"\n            \"is not intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the charge item definition\",\n        description=(\n            \"A formal identifier that is used to identify this charge item \"\n            \"definition when it is represented in other formats, or referenced in a\"\n            \" specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"Instances this definition applies to\",\n        description=(\n            \"The defined billing details in this resource pertain to the given \"\n            \"product instance(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Medication\",\n                \"Substance\",\n                \"Device\",\n                \"DeviceDefinition\",\n                \"ActivityDefinition\",\n                \"PlanDefinition\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for charge item definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the charge item definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the charge item definition was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this charge item definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the ChargeItemDefinition. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    partOf: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=(\n            \"A larger definition of which this particular definition is a component\"\n            \" or step\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ChargeItemDefinition\"],\n        },\n    )\n    partOf__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_partOf\", title=\"Extension field for ``partOf``.\"\n    )\n\n    propertyGroup: typing.List[\n        fhirtypes.ChargeItemDefinitionPropertyGroupType\n    ] | None = Field(\n        default=None,\n        alias=\"propertyGroup\",\n        title=\"Group of properties which are applicable under the same conditions\",\n        description=(\n            \"Group of properties which are applicable under the same conditions. If\"\n            \" no applicability rules are established for the group, then all \"\n            \"properties always apply.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the charge item definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this charge item definition is defined\",\n        description=(\n            \"Explanation of why this charge item definition is needed and why it \"\n            \"has been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    replaces: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=(\n            \"Completed or terminated request(s) whose function is taken by this new\"\n            \" request\"\n        ),\n        description=(\n            \"As new versions of a protocol or guideline are defined, allows \"\n            \"identification of what versions are replaced by a new instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ChargeItemDefinition\"],\n        },\n    )\n    replaces__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_replaces\", title=\"Extension field for ``replaces``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The current state of the ChargeItemDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this charge item definition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the charge item \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this charge item definition, represented as a\"\n            \" URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this charge item definition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which an \"\n            \"authoritative instance of this charge item definition is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the charge item definition is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate charge item definition \"\n            \"instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the charge item definition\",\n        description=(\n            \"The identifier that is used to identify this version of the charge \"\n            \"item definition when it is referenced in a specification, model, \"\n            \"design or instance. This is an arbitrary value managed by the charge \"\n            \"item definition author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence. To provide a version consistent \"\n            \"with the Decision Support Service specification, use the format \"\n            \"Major.Minor.Revision (e.g. 1.0.0). For more information on versioning \"\n            \"knowledge assets, refer to the Decision Support Service specification.\"\n            \" Note that a version is required for non-experimental active assets.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItemDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"derivedFromUri\",\n            \"partOf\",\n            \"replaces\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"code\",\n            \"instance\",\n            \"applicability\",\n            \"propertyGroup\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItemDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"derivedFromUri\",\n            \"partOf\",\n            \"replaces\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"code\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass ChargeItemDefinitionApplicability(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Whether or not the billing code is applicable.\n    Expressions that describe applicability criteria for the billing code.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItemDefinitionApplicability\"\n\n    condition: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Boolean-valued expression\",\n        description=(\n            \"An expression that returns true or false, indicating whether the \"\n            \"condition is satisfied. When using FHIRPath expressions, the %context \"\n            \"environment variable must be replaced at runtime with the ChargeItem \"\n            \"resource to which this definition is applied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the charge item definition is expected to be used\",\n        description=(\n            \"The period during which the charge item definition content was or is \"\n            \"planned to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=(\n            \"Reference to / quotation of the external source of the group of \"\n            \"properties\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItemDefinitionApplicability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"condition\",\n            \"effectivePeriod\",\n            \"relatedArtifact\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItemDefinitionApplicability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"effectivePeriod\"]\n\n\nclass ChargeItemDefinitionPropertyGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Group of properties which are applicable under the same conditions.\n    Group of properties which are applicable under the same conditions. If no\n    applicability rules are established for the group, then all properties\n    always apply.\n    \"\"\"\n\n    __resource_type__ = \"ChargeItemDefinitionPropertyGroup\"\n\n    applicability: typing.List[\n        fhirtypes.ChargeItemDefinitionApplicabilityType\n    ] | None = Field(\n        default=None,\n        alias=\"applicability\",\n        title=\"Conditions under which the priceComponent is applicable\",\n        description=(\n            \"Expressions that describe applicability criteria for the \"\n            \"priceComponent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priceComponent: typing.List[fhirtypes.MonetaryComponentType] | None = Field(\n        default=None,\n        alias=\"priceComponent\",\n        title=\"Components of total line item price\",\n        description=(\n            \"The price for a ChargeItem may be calculated as a base price with \"\n            \"surcharges/deductions that apply in certain conditions. A \"\n            \"ChargeItemDefinition resource that defines the prices, factors and \"\n            \"conditions that apply to a billing code is currently under \"\n            \"development. The priceComponent element can be used to offer \"\n            \"transparency to the recipient of the Invoice of how the prices have \"\n            \"been calculated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ChargeItemDefinitionPropertyGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"applicability\",\n            \"priceComponent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ChargeItemDefinitionPropertyGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/citation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Citation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Citation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A description of identification, location, or contributorship of a\n    publication (article or artifact).\n    The Citation Resource enables reference to any knowledge artifact for\n    purposes of identification and attribution. The Citation Resource supports\n    existing reference structures and developing publication practices such as\n    versioning, expressing complex contributorship roles, and referencing\n    computable resources.\n    \"\"\"\n\n    __resource_type__ = \"Citation\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the citation record was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the citation record\",\n        description=\"Who authored or created the citation record.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    citedArtifact: fhirtypes.CitationCitedArtifactType | None = Field(\n        default=None,\n        alias=\"citedArtifact\",\n        title=\"The article or artifact being described\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    classification: typing.List[fhirtypes.CitationClassificationType] | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=\"The assignment to an organizing scheme\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher of the citation record\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=(\n            \"Use and/or publishing restrictions for the citation record, not for \"\n            \"the cited artifact\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=(\n            \"Copyright holder and year(s) for the ciation record, not for the cited\"\n            \" artifact\"\n        ),\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    currentState: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"currentState\",\n        title=\"The status of the citation record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date (and optionally time) when the citation record was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the citation record \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the citation\",\n        description=(\n            \"A free text natural language description of the citation from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the citation record\",\n        description=\"Who edited or revised the citation record.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the citation record is expected to be used\",\n        description=(\n            \"The period during which the citation record content was or is planned \"\n            \"to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the citation record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this citation record is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier for the citation record itself\",\n        description=(\n            \"A formal identifier that is used to identify this citation record when\"\n            \" it is represented in other formats, or referenced in a specification,\"\n            \" model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for citation record (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the citation record is intended \"\n            \"to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the citation record was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this citation record (computer friendly)\",\n        description=(\n            \"A natural language name identifying the citation record. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Used for general notes and annotations not coded elsewhere\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=(\n            \"The publisher of the citation record, not the publisher of the article\"\n            \" or artifact being cited\"\n        ),\n        description=(\n            \"The name of the organization or individual that published the citation\"\n            \" record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this citation is defined\",\n        description=(\n            \"Explanation of why this citation is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Artifact related to the citation record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the citation record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this summary. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusDate: typing.List[fhirtypes.CitationStatusDateType] | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"An effective date or period for a status of the citation record\",\n        description=(\n            \"The state or status of the citation record paired with an effective \"\n            \"date or period for that state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    summary: typing.List[fhirtypes.CitationSummaryType] | None = Field(\n        default=None,\n        alias=\"summary\",\n        title=\"A human-readable display of key concepts to represent the citation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this citation record (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the citation record.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this citation record, represented as a \"\n            \"globally unique URI\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this citation record when it \"\n            \"is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" summary is (or will be) published. This URL can be the target of a \"\n            \"canonical reference. It SHALL remain the same when the summary is \"\n            \"stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the citation record content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate citation record instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the citation record\",\n        description=(\n            \"The identifier that is used to identify this version of the citation \"\n            \"record when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the citation record \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Citation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"summary\",\n            \"classification\",\n            \"note\",\n            \"currentState\",\n            \"statusDate\",\n            \"relatedArtifact\",\n            \"citedArtifact\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Citation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass CitationCitedArtifact(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The article or artifact being described.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifact\"\n\n    abstract: typing.List[fhirtypes.CitationCitedArtifactAbstractType] | None = Field(\n        default=None,\n        alias=\"abstract\",\n        title=\"Summary of the article or artifact\",\n        description=(\n            \"The abstract may be used to convey article-contained abstracts, \"\n            \"externally-created abstracts, or other descriptive summaries.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    classification: typing.List[\n        fhirtypes.CitationCitedArtifactClassificationType\n    ] | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=\"The assignment to an organizing scheme\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contributorship: fhirtypes.CitationCitedArtifactContributorshipType | None = Field(\n        default=None,\n        alias=\"contributorship\",\n        title=\"Attribution of authors and other contributors\",\n        description=(\n            \"This element is used to list authors and other contributors, their \"\n            \"contact information, specific contributions, and summary statements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    currentState: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"currentState\",\n        title=\"The status of the cited artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dateAccessed: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateAccessed\",\n        title=\"When the cited artifact was accessed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    dateAccessed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_dateAccessed\",\n        title=\"Extension field for ``dateAccessed``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier. May include DOI, PMID, PMCID, etc\",\n        description=(\n            \"A formal identifier that is used to identify the cited artifact when \"\n            \"it is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Any additional information or content for the article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    part: fhirtypes.CitationCitedArtifactPartType | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"The component of the article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publicationForm: typing.List[\n        fhirtypes.CitationCitedArtifactPublicationFormType\n    ] | None = Field(\n        default=None,\n        alias=\"publicationForm\",\n        title=(\n            \"If multiple, used to represent alternative forms of the article that \"\n            \"are not separate citations\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedIdentifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"relatedIdentifier\",\n        title=(\n            \"Identifier not unique to the cited artifact. May include trial \"\n            \"registry identifiers\"\n        ),\n        description=(\n            \"A formal identifier that is used to identify things closely related to\"\n            \" the cited artifact.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatesTo: typing.List[fhirtypes.CitationCitedArtifactRelatesToType] | None = Field(\n        default=None,\n        alias=\"relatesTo\",\n        title=\"The artifact related to the cited artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    statusDate: typing.List[\n        fhirtypes.CitationCitedArtifactStatusDateType\n    ] | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"An effective date or period for a status of the cited artifact\",\n        description=(\n            \"An effective date or period, historical or future, actual or expected,\"\n            \" for a status of the cited artifact.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: typing.List[fhirtypes.CitationCitedArtifactTitleType] | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"The title details of the article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: fhirtypes.CitationCitedArtifactVersionType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"The defined version of the cited artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    webLocation: typing.List[\n        fhirtypes.CitationCitedArtifactWebLocationType\n    ] | None = Field(\n        default=None,\n        alias=\"webLocation\",\n        title=\"Used for any URL for the article or artifact cited\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"relatedIdentifier\",\n            \"dateAccessed\",\n            \"version\",\n            \"currentState\",\n            \"statusDate\",\n            \"title\",\n            \"abstract\",\n            \"part\",\n            \"relatesTo\",\n            \"publicationForm\",\n            \"webLocation\",\n            \"classification\",\n            \"contributorship\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"relatedIdentifier\", \"dateAccessed\"]\n\n\nclass CitationCitedArtifactAbstract(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Summary of the article or artifact.\n    The abstract may be used to convey article-contained abstracts, externally-\n    created abstracts, or other descriptive summaries.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactAbstract\"\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Copyright notice for the abstract\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    language: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Used to express the specific language\",\n        description=\"Used to express the specific language of the abstract.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Abstract content\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of abstract\",\n        description=\"Used to express the reason for or classification of the abstract.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactAbstract`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"language\",\n            \"text\",\n            \"copyright\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactAbstract`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"text\", \"text__ext\")]\n        return required_fields\n\n\nclass CitationCitedArtifactClassification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The assignment to an organizing scheme.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactClassification\"\n\n    artifactAssessment: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"artifactAssessment\",\n        title=\"Complex or externally created classification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ArtifactAssessment\"],\n        },\n    )\n\n    classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classifier\",\n        title=\"The specific classification value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of classifier (e.g. publication type, keyword)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"classifier\",\n            \"artifactAssessment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactContributorship(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Attribution of authors and other contributors.\n    This element is used to list authors and other contributors, their contact\n    information, specific contributions, and summary statements.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactContributorship\"\n\n    complete: bool | None = Field(\n        default=None,\n        alias=\"complete\",\n        title=\"Indicates if the list includes all authors and/or contributors\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    complete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_complete\", title=\"Extension field for ``complete``.\"\n    )\n\n    entry: typing.List[\n        fhirtypes.CitationCitedArtifactContributorshipEntryType\n    ] | None = Field(\n        default=None,\n        alias=\"entry\",\n        title=\"An individual entity named as a contributor\",\n        description=(\n            \"An individual entity named as a contributor, for example in the author\"\n            \" list or contributor list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    summary: typing.List[\n        fhirtypes.CitationCitedArtifactContributorshipSummaryType\n    ] | None = Field(\n        default=None,\n        alias=\"summary\",\n        title=(\n            \"Used to record a display of the author/contributor list without \"\n            \"separate data element for each list member\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactContributorship`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"complete\", \"entry\", \"summary\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorship`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactContributorshipEntry(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An individual entity named as a contributor.\n    An individual entity named as a contributor, for example in the author list\n    or contributor list.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactContributorshipEntry\"\n\n    affiliation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"affiliation\",\n        title=\"Organizational affiliation\",\n        description=\"Organization affiliated with the contributor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"PractitionerRole\"],\n        },\n    )\n\n    contributionInstance: typing.List[\n        fhirtypes.CitationCitedArtifactContributorshipEntryContributionInstanceType\n    ] | None = Field(\n        default=None,\n        alias=\"contributionInstance\",\n        title=\"Contributions with accounting for time or number\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contributionType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"contributionType\",\n        title=\"The specific contribution\",\n        description=(\n            \"This element identifies the specific nature of an individual\\u2019s \"\n            \"contribution with respect to the cited work.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contributor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"contributor\",\n        title=\"The identity of the individual contributor\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"Organization\"],\n        },\n    )\n\n    correspondingContact: bool | None = Field(\n        default=None,\n        alias=\"correspondingContact\",\n        title=\"Whether the contributor is the corresponding contributor for the role\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    correspondingContact__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_correspondingContact\",\n        title=\"Extension field for ``correspondingContact``.\",\n    )\n\n    forenameInitials: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"forenameInitials\",\n        title=\"For citation styles that use initials\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    forenameInitials__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_forenameInitials\",\n        title=\"Extension field for ``forenameInitials``.\",\n    )\n\n    rankingOrder: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"rankingOrder\",\n        title=\"Ranked order of contribution\",\n        description=(\n            \"Provides a numerical ranking to represent the degree of \"\n            \"contributorship relative to other contributors, such as 1 for first \"\n            \"author and 2 for second author.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    rankingOrder__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_rankingOrder\",\n        title=\"Extension field for ``rankingOrder``.\",\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"The role of the contributor (e.g. author, editor, reviewer, funder)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactContributorshipEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contributor\",\n            \"forenameInitials\",\n            \"affiliation\",\n            \"contributionType\",\n            \"role\",\n            \"contributionInstance\",\n            \"correspondingContact\",\n            \"rankingOrder\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactContributorshipEntryContributionInstance(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contributions with accounting for time or number.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactContributorshipEntryContributionInstance\"\n\n    time: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"time\",\n        title=\"The time that the contribution was made\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_time\", title=\"Extension field for ``time``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"The specific contribution\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactContributorshipEntryContributionInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"time\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipEntryContributionInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactContributorshipSummary(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Used to record a display of the author/contributor list without separate\n    data element for each list member.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactContributorshipSummary\"\n\n    source: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Used to code the producer or rule for creating the display string\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    style: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"style\",\n        title=\"The format for the display string\",\n        description=(\n            \"The format for the display string, such as author last name with first\"\n            \" letter capitalized followed by forename initials.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Such as author list, contributorship statement, funding statement, \"\n            \"acknowledgements statement, or conflicts of interest statement\"\n        ),\n        description=(\n            \"Used most commonly to express an author list or a contributorship \"\n            \"statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=(\n            \"The display string for the author list, contributor list, or \"\n            \"contributorship statement\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactContributorshipSummary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"style\",\n            \"source\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactContributorshipSummary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass CitationCitedArtifactPart(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The component of the article or artifact.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactPart\"\n\n    baseCitation: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"baseCitation\",\n        title=\"The citation for the full article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Citation\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of component\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The specification of the component\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactPart`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"value\", \"baseCitation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPart`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactPublicationForm(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If multiple, used to represent alternative forms of the article that are\n    not separate citations.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactPublicationForm\"\n\n    accessionNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"accessionNumber\",\n        title=\"Entry number or identifier for inclusion in a database\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    accessionNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_accessionNumber\",\n        title=\"Extension field for ``accessionNumber``.\",\n    )\n\n    articleDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"articleDate\",\n        title=(\n            \"The date the article was added to the database, or the date the \"\n            \"article was released\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    articleDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_articleDate\", title=\"Extension field for ``articleDate``.\"\n    )\n\n    citedMedium: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"citedMedium\",\n        title=\"Internet or Print\",\n        description=(\n            'Describes the form of the medium cited. Common codes are \"Internet\" or'\n            ' \"Print\". The CitedMedium value set has 6 codes. The codes internet, '\n            \"print, and offline-digital-storage are the common codes for a typical \"\n            \"publication form, though internet and print are more common for study \"\n            \"citations. Three additional codes (each appending one of the primary \"\n            'codes with \"-without-issue\" are used for situations when a study is '\n            \"published both within an issue (of a periodical release as commonly \"\n            \"done for journals) AND is published separately from the issue (as \"\n            \"commonly done with early online publication), to represent specific \"\n            \"identification of the publication form not associated with the issue.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Copyright notice for the full article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    firstPage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"firstPage\",\n        title=\"Used for isolated representation of first page\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    firstPage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_firstPage\", title=\"Extension field for ``firstPage``.\"\n    )\n\n    issue: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"issue\",\n        title=(\n            \"Issue, part or supplement of journal or other collection in which the \"\n            \"article is published\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    issue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issue\", title=\"Extension field for ``issue``.\"\n    )\n\n    language: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language(s) in which this form of the article is published\",\n        description=(\n            \"The language or languages in which this form of the article is \"\n            \"published.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lastPage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lastPage\",\n        title=\"Used for isolated representation of last page\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastPage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lastPage\", title=\"Extension field for ``lastPage``.\"\n    )\n\n    lastRevisionDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"lastRevisionDate\",\n        title=\"The date the article was last revised or updated in the database\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastRevisionDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastRevisionDate\",\n        title=\"Extension field for ``lastRevisionDate``.\",\n    )\n\n    pageCount: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"pageCount\",\n        title=\"Number of pages or screens\",\n        description=(\n            \"Actual or approximate number of pages or screens. Distinct from \"\n            \"reporting the page numbers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    pageCount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_pageCount\", title=\"Extension field for ``pageCount``.\"\n    )\n\n    pageString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"pageString\",\n        title=\"Used for full display of pagination\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    pageString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_pageString\", title=\"Extension field for ``pageString``.\"\n    )\n\n    publicationDateSeason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publicationDateSeason\",\n        title=\"Season in which the cited artifact was published\",\n        description=\"Spring, Summer, Fall/Autumn, Winter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    publicationDateSeason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_publicationDateSeason\",\n        title=\"Extension field for ``publicationDateSeason``.\",\n    )\n\n    publicationDateText: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publicationDateText\",\n        title=(\n            \"Text representation of the date on which the issue of the cited \"\n            \"artifact was published\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    publicationDateText__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_publicationDateText\",\n        title=\"Extension field for ``publicationDateText``.\",\n    )\n\n    publishedIn: fhirtypes.CitationCitedArtifactPublicationFormPublishedInType | None = Field(\n        default=None,\n        alias=\"publishedIn\",\n        title=\"The collection the cited article or artifact is published in\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    volume: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"volume\",\n        title=(\n            \"Volume number of journal or other collection in which the article is \"\n            \"published\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    volume__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_volume\", title=\"Extension field for ``volume``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactPublicationForm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"publishedIn\",\n            \"citedMedium\",\n            \"volume\",\n            \"issue\",\n            \"articleDate\",\n            \"publicationDateText\",\n            \"publicationDateSeason\",\n            \"lastRevisionDate\",\n            \"language\",\n            \"accessionNumber\",\n            \"pageString\",\n            \"firstPage\",\n            \"lastPage\",\n            \"pageCount\",\n            \"copyright\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPublicationForm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactPublicationFormPublishedIn(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The collection the cited article or artifact is published in.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactPublicationFormPublishedIn\"\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"Journal identifiers include ISSN, ISO Abbreviation and NLMuniqueID; \"\n            \"Book identifiers include ISBN\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of or resource describing the publisher\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    publisherLocation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisherLocation\",\n        title=\"Geographic location of the publisher\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    publisherLocation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_publisherLocation\",\n        title=\"Extension field for ``publisherLocation``.\",\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name of the database or title of the book or journal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of container (e.g. Periodical, database, or book)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactPublicationFormPublishedIn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"identifier\",\n            \"title\",\n            \"publisher\",\n            \"publisherLocation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactPublicationFormPublishedIn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactRelatesTo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The artifact related to the cited artifact.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactRelatesTo\"\n\n    citation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"citation\",\n        title=\"Bibliographic citation for the artifact\",\n        description=(\n            \"A bibliographic citation for the related artifact. This text SHOULD be\"\n            \" formatted according to an accepted citation format.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    citation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_citation\", title=\"Extension field for ``citation``.\"\n    )\n\n    classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classifier\",\n        title=\"Additional classifiers\",\n        description=\"Provides additional classifiers of the related artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Brief description of the related artifact\",\n        description=(\n            \"A brief description of the document or knowledge resource being \"\n            \"referenced, suitable for display to a consumer.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    document: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"document\",\n        title=\"What document is being referenced\",\n        description=(\n            \"The document being referenced, represented as an attachment. Do not \"\n            \"use this element if using the resource element to provide the \"\n            \"canonical to the related artifact.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Short label\",\n        description=(\n            \"A short label that can be used to reference the related artifact from \"\n            \"elsewhere in the containing artifact, such as a footnote index.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    resource: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"What artifact is being referenced\",\n        description=(\n            \"The related artifact, such as a library, value set, profile, or other \"\n            \"knowledge resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    resourceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"resourceReference\",\n        title=\"What artifact, if not a conformance resource\",\n        description=(\n            \"The related artifact, if the artifact is not a canonical resource, or \"\n            \"a resource reference to a canonical resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"documentation | justification | citation | predecessor | successor | \"\n            \"derived-from | depends-on | composed-of | part-of | amends | amended-\"\n            \"with | appends | appended-with | cites | cited-by | comments-on | \"\n            \"comment-in | contains | contained-in | corrects | correction-in | \"\n            \"replaces | replaced-with | retracts | retracted-by | signs | similar-\"\n            \"to | supports | supported-with | transforms | transformed-into | \"\n            \"transformed-with | documents | specification-of | created-with | cite-\"\n            \"as | reprint | reprint-of\"\n        ),\n        description=\"The type of relationship to the related artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"documentation\",\n                \"justification\",\n                \"citation\",\n                \"predecessor\",\n                \"successor\",\n                \"derived-from\",\n                \"depends-on\",\n                \"composed-of\",\n                \"part-of\",\n                \"amends\",\n                \"amended-with\",\n                \"appends\",\n                \"appended-with\",\n                \"cites\",\n                \"cited-by\",\n                \"comments-on\",\n                \"comment-in\",\n                \"contains\",\n                \"contained-in\",\n                \"corrects\",\n                \"correction-in\",\n                \"replaces\",\n                \"replaced-with\",\n                \"retracts\",\n                \"retracted-by\",\n                \"signs\",\n                \"similar-to\",\n                \"supports\",\n                \"supported-with\",\n                \"transforms\",\n                \"transformed-into\",\n                \"transformed-with\",\n                \"documents\",\n                \"specification-of\",\n                \"created-with\",\n                \"cite-as\",\n                \"reprint\",\n                \"reprint-of\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"classifier\",\n            \"label\",\n            \"display\",\n            \"citation\",\n            \"document\",\n            \"resource\",\n            \"resourceReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass CitationCitedArtifactStatusDate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An effective date or period for a status of the cited artifact.\n    An effective date or period, historical or future, actual or expected, for\n    a status of the cited artifact.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactStatusDate\"\n\n    activity: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"activity\",\n        title=\"Classification of the status\",\n        description=\"A definition of the status associated with a date or period.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    actual: bool | None = Field(\n        default=None,\n        alias=\"actual\",\n        title=\"Either occurred or expected\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actual\", title=\"Extension field for ``actual``.\"\n    )\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"When the status started and/or ended\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactStatusDate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"activity\", \"actual\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactStatusDate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationCitedArtifactTitle(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The title details of the article or artifact.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactTitle\"\n\n    language: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Used to express the specific language\",\n        description=\"Used to express the specific language of the title.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"The title of the article or artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of title\",\n        description=\"Used to express the reason for or classification of the title.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactTitle`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"language\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactTitle`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"text\", \"text__ext\")]\n        return required_fields\n\n\nclass CitationCitedArtifactVersion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The defined version of the cited artifact.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactVersion\"\n\n    baseCitation: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"baseCitation\",\n        title=\"Citation for the main version of the cited artifact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Citation\"],\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The version number or other version identifier\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"value\", \"baseCitation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass CitationCitedArtifactWebLocation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Used for any URL for the article or artifact cited.\n    \"\"\"\n\n    __resource_type__ = \"CitationCitedArtifactWebLocation\"\n\n    classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classifier\",\n        title=\"Code the reason for different URLs, e.g. abstract and full-text\",\n        description=\"A characterization of the object expected at the web location.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"The specific URL\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationCitedArtifactWebLocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"classifier\", \"url\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationCitedArtifactWebLocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationClassification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The assignment to an organizing scheme.\n    \"\"\"\n\n    __resource_type__ = \"CitationClassification\"\n\n    classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classifier\",\n        title=\"The specific classification value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of classifier (e.g. publication type, keyword)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"classifier\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationStatusDate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An effective date or period for a status of the citation record.\n    The state or status of the citation record paired with an effective date or\n    period for that state.\n    \"\"\"\n\n    __resource_type__ = \"CitationStatusDate\"\n\n    activity: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"activity\",\n        title=\"Classification of the status\",\n        description=(\n            \"The state or status of the citation record (that will be paired with \"\n            \"the period).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    actual: bool | None = Field(\n        default=None,\n        alias=\"actual\",\n        title=\"Either occurred or expected\",\n        description=(\n            \"Whether the status date is actual (has occurred) or expected \"\n            \"(estimated or anticipated).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actual\", title=\"Extension field for ``actual``.\"\n    )\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"When the status started and/or ended\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationStatusDate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"activity\", \"actual\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationStatusDate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CitationSummary(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A human-readable display of key concepts to represent the citation.\n    \"\"\"\n\n    __resource_type__ = \"CitationSummary\"\n\n    style: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"style\",\n        title=\"Format for display of the citation summary\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"The human-readable display of the citation summary\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CitationSummary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"style\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CitationSummary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"text\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"text\", \"text__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/claim.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Claim\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Claim(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Claim, Pre-determination or Pre-authorization.\n    A provider issued list of professional services and products which have\n    been provided, or are to be provided, to a patient which is sent to an\n    insurer for reimbursement.\n    \"\"\"\n\n    __resource_type__ = \"Claim\"\n\n    accident: fhirtypes.ClaimAccidentType | None = Field(\n        default=None,\n        alias=\"accident\",\n        title=\"Details of the event\",\n        description=(\n            \"Details of an accident which resulted in injuries which required the \"\n            \"products and services listed in the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    billablePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"billablePeriod\",\n        title=\"Relevant time frame for the claim\",\n        description=\"The period for which charges are being submitted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    careTeam: typing.List[fhirtypes.ClaimCareTeamType] | None = Field(\n        default=None,\n        alias=\"careTeam\",\n        title=\"Members of the care team\",\n        description=\"The members of the team who provided the products and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Resource creation date\",\n        description=\"The date this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    diagnosis: typing.List[fhirtypes.ClaimDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"Pertinent diagnosis information\",\n        description=\"Information about diagnoses relevant to the claim items.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    diagnosisRelatedGroup: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"diagnosisRelatedGroup\",\n        title=\"Package billing code\",\n        description=(\n            \"A package billing code or bundle code used to group products and \"\n            \"services to a particular health condition (such as heart attack) which\"\n            \" is based on a predetermined grouping code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounters associated with the listed treatments\",\n        description=\"Healthcare encounters related to this claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Author of the claim\",\n        description=(\n            \"Individual who created the claim, predetermination or \" \"preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    event: typing.List[fhirtypes.ClaimEventType] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"Event information\",\n        description=\"Information code for an event with a corresponding date or period.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    facility: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"facility\",\n        title=\"Servicing facility\",\n        description=\"Facility where the services were provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\", \"Organization\"],\n        },\n    )\n\n    fundsReserve: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fundsReserve\",\n        title=\"For whom to reserve funds\",\n        description=(\n            \"A code to indicate whether and for whom funds are to be reserved for \"\n            \"future claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for claim\",\n        description=\"A unique identifier assigned to this claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: typing.List[fhirtypes.ClaimInsuranceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Patient insurance information\",\n        description=(\n            \"Financial instruments for reimbursement for the health care products \"\n            \"and services specified on the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Target\",\n        description=\"The Insurer who is target of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    item: typing.List[fhirtypes.ClaimItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Product or service provided\",\n        description=(\n            \"A claim line. Either a simple  product or service or a 'group' of \"\n            \"details which can each be a simple items or groups of sub-details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    originalPrescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"originalPrescription\",\n        title=\"Original prescription if superseded by fulfiller\",\n        description=(\n            \"Original prescription which has been superseded by this prescription \"\n            \"to support the dispensing of pharmacy services, medications or \"\n            \"products.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"VisionPrescription\",\n            ],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The recipient of the products and services\",\n        description=(\n            \"The party to whom the professional services and/or products have been \"\n            \"supplied or are being considered and for whom actual or forecast \"\n            \"reimbursement is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    patientPaid: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patientPaid\",\n        title=\"Paid by the patient\",\n        description=(\n            \"The amount paid by the patient, in total at the claim claim level or \"\n            \"specifically for the item and detail level, to the provider for goods \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payee: fhirtypes.ClaimPayeeType | None = Field(\n        default=None,\n        alias=\"payee\",\n        title=\"Recipient of benefits payable\",\n        description=(\n            \"The party to be reimbursed for cost of the products and services \"\n            \"according to the terms of the policy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    prescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"prescription\",\n        title=\"Prescription authorizing services and products\",\n        description=(\n            \"Prescription is the document/authorization given to the claim author \"\n            \"for them to provide products and services for which consideration \"\n            \"(reimbursement) is sought. Could be a RX for medications, an 'order' \"\n            \"for oxygen or wheelchair or physiotherapy treatments.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"VisionPrescription\",\n            ],\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Desired processing urgency\",\n        description=(\n            \"The provider-required urgency of processing the request. Typical \"\n            \"values include: stat, normal, deferred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    procedure: typing.List[fhirtypes.ClaimProcedureType] | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"Clinical procedures performed\",\n        description=(\n            \"Procedures performed on the patient relevant to the billing items with\"\n            \" the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Party responsible for the claim\",\n        description=(\n            \"The provider which is responsible for the claim, predetermination or \"\n            \"preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    referral: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referral\",\n        title=\"Treatment referral\",\n        description=(\n            \"The referral information received by the claim author, it is not to be\"\n            \" used when the author generates a referral for a patient. A copy of \"\n            \"that referral may be provided as supporting information. Some insurers\"\n            \" require proof of referral to pay for services or to pay specialist \"\n            \"rates for services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    related: typing.List[fhirtypes.ClaimRelatedType] | None = Field(\n        default=None,\n        alias=\"related\",\n        title=\"Prior or corollary claims\",\n        description=(\n            \"Other claims which are related to this claim such as prior submissions\"\n            \" or claims for related services or for the same event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"More granular claim type\",\n        description=(\n            \"A finer grained suite of claim type codes which may convey additional \"\n            \"information such as Inpatient vs Outpatient and/or a specialty \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.ClaimSupportingInfoType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Supporting information\",\n        description=(\n            \"Additional information codes regarding exceptions, special \"\n            \"considerations, the condition, situation, prior or concurrent issues.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    total: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"Total claim cost\",\n        description=\"The total value of the all the items in the claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Category or discipline\",\n        description=(\n            \"The category of claim, e.g. oral, pharmacy, vision, institutional, \"\n            \"professional.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"claim | preauthorization | predetermination\",\n        description=(\n            \"A code to indicate whether the nature of the request is: Claim - A \"\n            \"request to an Insurer to adjudicate the supplied charges for health \"\n            \"care goods and services under the identified policy and to pay the \"\n            \"determined Benefit amount, if any; Preauthorization - A request to an \"\n            \"Insurer to adjudicate the supplied proposed future charges for health \"\n            \"care goods and services under the identified policy and to approve the\"\n            \" services and provide the expected benefit amounts and potentially to \"\n            \"reserve funds to pay the benefits when Claims for the indicated \"\n            \"services are later submitted; or, Pre-determination - A request to an \"\n            \"Insurer to adjudicate the supplied 'what if' charges for health care \"\n            \"goods and services under the identified policy and report back what \"\n            \"the Benefit payable would be had the services actually been provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"claim\", \"preauthorization\", \"predetermination\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Claim`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"traceNumber\",\n            \"status\",\n            \"type\",\n            \"subType\",\n            \"use\",\n            \"patient\",\n            \"billablePeriod\",\n            \"created\",\n            \"enterer\",\n            \"insurer\",\n            \"provider\",\n            \"priority\",\n            \"fundsReserve\",\n            \"related\",\n            \"prescription\",\n            \"originalPrescription\",\n            \"payee\",\n            \"referral\",\n            \"encounter\",\n            \"facility\",\n            \"diagnosisRelatedGroup\",\n            \"event\",\n            \"careTeam\",\n            \"supportingInfo\",\n            \"diagnosis\",\n            \"procedure\",\n            \"insurance\",\n            \"accident\",\n            \"patientPaid\",\n            \"item\",\n            \"total\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Claim`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"type\",\n            \"use\",\n            \"patient\",\n            \"billablePeriod\",\n            \"created\",\n            \"insurer\",\n            \"provider\",\n            \"priority\",\n            \"insurance\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"use\", \"use__ext\"),\n        ]\n        return required_fields\n\n\nclass ClaimAccident(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of the event.\n    Details of an accident which resulted in injuries which required the\n    products and services listed in the claim.\n    \"\"\"\n\n    __resource_type__ = \"ClaimAccident\"\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the incident occurred\",\n        description=(\n            \"Date of an accident event  related to the products and services \"\n            \"contained in the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Where the event occurred\",\n        description=\"The physical location of the accident event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Where the event occurred\",\n        description=\"The physical location of the accident event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The nature of the accident\",\n        description=(\n            \"The type or context of the accident event for the purposes of \"\n            \"selection of potential insurance coverages and determination of \"\n            \"coordination between insurers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimAccident`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"date\",\n            \"type\",\n            \"locationAddress\",\n            \"locationReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimAccident`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"date\", \"date__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"location\": [\"locationAddress\", \"locationReference\"]}\n        return one_of_many_fields\n\n\nclass ClaimCareTeam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Members of the care team.\n    The members of the team who provided the products and services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimCareTeam\"\n\n    provider: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"provider\",\n        title=\"Practitioner or organization\",\n        description=\"Member of the team who provided the product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    responsible: bool | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Indicator of the lead practitioner\",\n        description=(\n            \"The party who is billing and/or responsible for the claimed products \"\n            \"or services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_responsible\", title=\"Extension field for ``responsible``.\"\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Function within the team\",\n        description=(\n            \"The lead, assisting or supervising practitioner and their discipline \"\n            \"if a multidisciplinary team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Order of care team\",\n        description=\"A number to uniquely identify care team entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    specialty: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=\"Practitioner or provider specialization\",\n        description=(\n            \"The specialization of the practitioner or provider which is applicable\"\n            \" for this service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimCareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"provider\",\n            \"responsible\",\n            \"role\",\n            \"specialty\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimCareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Pertinent diagnosis information.\n    Information about diagnoses relevant to the claim items.\n    \"\"\"\n\n    __resource_type__ = \"ClaimDiagnosis\"\n\n    diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"diagnosisCodeableConcept\",\n        title=\"Nature of illness or problem\",\n        description=(\n            \"The nature of illness or problem in a coded form or as a reference to \"\n            \"an external defined Condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    diagnosisReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"diagnosisReference\",\n        title=\"Nature of illness or problem\",\n        description=(\n            \"The nature of illness or problem in a coded form or as a reference to \"\n            \"an external defined Condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    onAdmission: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"onAdmission\",\n        title=\"Present on admission\",\n        description=(\n            \"Indication of whether the diagnosis was present on admission to a \"\n            \"facility.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Diagnosis instance identifier\",\n        description=\"A number to uniquely identify diagnosis entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Timing or nature of the diagnosis\",\n        description=\"When the condition was observed or the relative ranking.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"diagnosisCodeableConcept\",\n            \"diagnosisReference\",\n            \"type\",\n            \"onAdmission\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"diagnosis\": [\"diagnosisCodeableConcept\", \"diagnosisReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ClaimEvent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Event information.\n    Information code for an event with a corresponding date or period.\n    \"\"\"\n\n    __resource_type__ = \"ClaimEvent\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Specific event\",\n        description=\"A coded event such as when a service is expected or a card printed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    whenDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenDateTime\",\n        title=\"Occurance date or period\",\n        description=(\n            \"A date or period in the past or future indicating when the event \"\n            \"occurred or is expectd to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": True,\n        },\n    )\n    whenDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenDateTime\",\n        title=\"Extension field for ``whenDateTime``.\",\n    )\n\n    whenPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"whenPeriod\",\n        title=\"Occurance date or period\",\n        description=(\n            \"A date or period in the past or future indicating when the event \"\n            \"occurred or is expectd to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"whenDateTime\",\n            \"whenPeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"when\": [\"whenDateTime\", \"whenPeriod\"]}\n        return one_of_many_fields\n\n\nclass ClaimInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient insurance information.\n    Financial instruments for reimbursement for the health care products and\n    services specified on the claim.\n    \"\"\"\n\n    __resource_type__ = \"ClaimInsurance\"\n\n    businessArrangement: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"businessArrangement\",\n        title=\"Additional provider contract number\",\n        description=(\n            \"A business agreement number established between the provider and the \"\n            \"insurer for special business processing purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_businessArrangement\",\n        title=\"Extension field for ``businessArrangement``.\",\n    )\n\n    claimResponse: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claimResponse\",\n        title=\"Adjudication results\",\n        description=(\n            \"The result of the adjudication of the line items for the Coverage \"\n            \"specified in this insurance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClaimResponse\"],\n        },\n    )\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=(\n            \"Reference to the insurance card level information contained in the \"\n            \"Coverage resource. The coverage issuing insurer will use these details\"\n            \" to locate the patient's actual coverage within the insurer's \"\n            \"information system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    focal: bool | None = Field(\n        default=None,\n        alias=\"focal\",\n        title=\"Coverage to be used for adjudication\",\n        description=(\n            \"A flag to indicate that this Coverage is to be used for adjudication \"\n            \"of this claim when set to true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_focal\", title=\"Extension field for ``focal``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Pre-assigned Claim number\",\n        description=(\n            \"The business identifier to be used when the claim is sent for \"\n            \"adjudication against this insurance policy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Prior authorization reference number\",\n        description=(\n            \"Reference numbers previously provided by the insurer to the provider \"\n            \"to be quoted on subsequent claims containing services or products \"\n            \"related to the prior authorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Insurance instance identifier\",\n        description=(\n            \"A number to uniquely identify insurance entries and provide a sequence\"\n            \" of coverages to convey coordination of benefit order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"focal\",\n            \"identifier\",\n            \"coverage\",\n            \"businessArrangement\",\n            \"preAuthRef\",\n            \"claimResponse\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"sequence\", \"focal\", \"coverage\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"focal\", \"focal__ext\"), (\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Product or service provided.\n    A claim line. Either a simple  product or service or a 'group' of details\n    which can each be a simple items or groups of sub-details.\n    \"\"\"\n\n    __resource_type__ = \"ClaimItem\"\n\n    bodySite: typing.List[fhirtypes.ClaimItemBodySiteType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical location\",\n        description=\"Physical location where the service is performed or applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    careTeamSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"careTeamSequence\",\n        title=\"Applicable careTeam members\",\n        description=\"CareTeam members related to this service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    careTeamSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_careTeamSequence\",\n        title=\"Extension field for ``careTeamSequence``.\",\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ClaimItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Product or service provided\",\n        description=(\n            \"A claim detail line. Either a simple (a product or service) or a \"\n            \"'group' of sub-details which are simple items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    diagnosisSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"diagnosisSequence\",\n        title=\"Applicable diagnoses\",\n        description=\"Diagnosis applicable for this service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    diagnosisSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_diagnosisSequence\",\n        title=\"Extension field for ``diagnosisSequence``.\",\n    )\n\n    encounter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounters associated with the listed treatments\",\n        description=\"Healthcare encounters related to this claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    informationSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"informationSequence\",\n        title=\"Applicable exception and supporting information\",\n        description=(\n            \"Exceptions, special conditions and supporting information applicable \"\n            \"for this service or product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    informationSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_informationSequence\",\n        title=\"Extension field for ``informationSequence``.\",\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"locationCodeableConcept\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Product or service billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The total amount claimed for the group (if a grouper) or the line \"\n            \"item. Net = unit price * quantity * factor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patientPaid: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patientPaid\",\n        title=\"Paid by the patient\",\n        description=(\n            \"The amount paid by the patient, in total at the claim claim level or \"\n            \"specifically for the item and detail level, to the provider for goods \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    procedureSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"procedureSequence\",\n        title=\"Applicable procedures\",\n        description=\"Procedures applicable for this service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    procedureSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_procedureSequence\",\n        title=\"Extension field for ``procedureSequence``.\",\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related item details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item. This element may be the start\"\n            \" of a range of .productOrService codes used in conjunction with \"\n            \".productOrServiceEnd or it may be a solo element where \"\n            \".productOrServiceEnd is not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrServiceEnd\",\n        title=\"End of a range of codes\",\n        description=(\n            \"This contains the end of a range of product, service, drug or other \"\n            \"billing codes for the item. This element is not used when the \"\n            \".productOrService is a group code. This value may only be present when\"\n            \" a .productOfService code has been provided to convey the start of the\"\n            \" range. Typically this value may be used only with preauthorizations \"\n            \"and not with claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Request or Referral for Service\",\n        description=\"Request or Referral for Goods or Service to be rendered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ServiceRequest\",\n                \"SupplyRequest\",\n                \"VisionPrescription\",\n            ],\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Item instance identifier\",\n        description=\"A number to uniquely identify item entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    tax: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tax\",\n        title=\"Total tax\",\n        description=\"The total of taxes applicable for this product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"traceNumber\",\n            \"careTeamSequence\",\n            \"diagnosisSequence\",\n            \"procedureSequence\",\n            \"informationSequence\",\n            \"revenue\",\n            \"category\",\n            \"productOrService\",\n            \"productOrServiceEnd\",\n            \"request\",\n            \"modifier\",\n            \"programCode\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"locationCodeableConcept\",\n            \"locationAddress\",\n            \"locationReference\",\n            \"patientPaid\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"tax\",\n            \"net\",\n            \"udi\",\n            \"bodySite\",\n            \"encounter\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"location\": [\n                \"locationAddress\",\n                \"locationCodeableConcept\",\n                \"locationReference\",\n            ],\n            \"serviced\": [\"servicedDate\", \"servicedPeriod\"],\n        }\n        return one_of_many_fields\n\n\nclass ClaimItemBodySite(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Anatomical location.\n    Physical location where the service is performed or applies.\n    \"\"\"\n\n    __resource_type__ = \"ClaimItemBodySite\"\n\n    site: typing.List[fhirtypes.CodeableReferenceType] = Field(\n        default=...,\n        alias=\"site\",\n        title=\"Location\",\n        description=\"Physical service site on the patient (limb, tooth, etc.).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BodyStructure\"],\n        },\n    )\n\n    subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subSite\",\n        title=\"Sub-location\",\n        description=(\n            \"A region or surface of the bodySite, e.g. limb region or tooth \"\n            \"surface(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimItemBodySite`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"site\", \"subSite\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimItemBodySite`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Product or service provided.\n    A claim detail line. Either a simple (a product or service) or a 'group' of\n    sub-details which are simple items.\n    \"\"\"\n\n    __resource_type__ = \"ClaimItemDetail\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The total amount claimed for the group (if a grouper) or the line \"\n            \"item.detail. Net = unit price * quantity * factor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patientPaid: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patientPaid\",\n        title=\"Paid by the patient\",\n        description=(\n            \"The amount paid by the patient, in total at the claim claim level or \"\n            \"specifically for the item and detail level, to the provider for goods \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related item details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item. This element may be the start\"\n            \" of a range of .productOrService codes used in conjunction with \"\n            \".productOrServiceEnd or it may be a solo element where \"\n            \".productOrServiceEnd is not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrServiceEnd\",\n        title=\"End of a range of codes\",\n        description=(\n            \"This contains the end of a range of product, service, drug or other \"\n            \"billing codes for the item. This element is not used when the \"\n            \".productOrService is a group code. This value may only be present when\"\n            \" a .productOfService code has been provided to convey the start of the\"\n            \" range. Typically this value may be used only with preauthorizations \"\n            \"and not with claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Item instance identifier\",\n        description=\"A number to uniquely identify item entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    subDetail: typing.List[fhirtypes.ClaimItemDetailSubDetailType] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Product or service provided\",\n        description=(\n            \"A claim detail line. Either a simple (a product or service) or a \"\n            \"'group' of sub-details which are simple items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    tax: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tax\",\n        title=\"Total tax\",\n        description=\"The total of taxes applicable for this product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"traceNumber\",\n            \"revenue\",\n            \"category\",\n            \"productOrService\",\n            \"productOrServiceEnd\",\n            \"modifier\",\n            \"programCode\",\n            \"patientPaid\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"tax\",\n            \"net\",\n            \"udi\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Product or service provided.\n    A claim detail line. Either a simple (a product or service) or a 'group' of\n    sub-details which are simple items.\n    \"\"\"\n\n    __resource_type__ = \"ClaimItemDetailSubDetail\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The total amount claimed for line item.detail.subDetail. Net = unit \"\n            \"price * quantity * factor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patientPaid: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patientPaid\",\n        title=\"Paid by the patient\",\n        description=(\n            \"The amount paid by the patient, in total at the claim claim level or \"\n            \"specifically for the item and detail level, to the provider for goods \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related item details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item. This element may be the start\"\n            \" of a range of .productOrService codes used in conjunction with \"\n            \".productOrServiceEnd or it may be a solo element where \"\n            \".productOrServiceEnd is not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrServiceEnd\",\n        title=\"End of a range of codes\",\n        description=(\n            \"This contains the end of a range of product, service, drug or other \"\n            \"billing codes for the item. This element is not used when the \"\n            \".productOrService is a group code. This value may only be present when\"\n            \" a .productOfService code has been provided to convey the start of the\"\n            \" range. Typically this value may be used only with preauthorizations \"\n            \"and not with claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Item instance identifier\",\n        description=\"A number to uniquely identify item entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    tax: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tax\",\n        title=\"Total tax\",\n        description=\"The total of taxes applicable for this product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"traceNumber\",\n            \"revenue\",\n            \"category\",\n            \"productOrService\",\n            \"productOrServiceEnd\",\n            \"modifier\",\n            \"programCode\",\n            \"patientPaid\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"tax\",\n            \"net\",\n            \"udi\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimPayee(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Recipient of benefits payable.\n    The party to be reimbursed for cost of the products and services according\n    to the terms of the policy.\n    \"\"\"\n\n    __resource_type__ = \"ClaimPayee\"\n\n    party: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"party\",\n        title=\"Recipient reference\",\n        description=(\n            \"Reference to the individual or organization to whom any payment will \"\n            \"be made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Category of recipient\",\n        description=\"Type of Party to be reimbursed: subscriber, provider, other.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimPayee`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"party\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimPayee`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimProcedure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Clinical procedures performed.\n    Procedures performed on the patient relevant to the billing items with the\n    claim.\n    \"\"\"\n\n    __resource_type__ = \"ClaimProcedure\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the procedure was performed\",\n        description=\"Date and optionally time the procedure was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    procedureCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"procedureCodeableConcept\",\n        title=\"Specific clinical procedure\",\n        description=(\n            \"The code or reference to a Procedure resource which identifies the \"\n            \"clinical intervention performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e procedure[x]\n            \"one_of_many\": \"procedure\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    procedureReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"procedureReference\",\n        title=\"Specific clinical procedure\",\n        description=(\n            \"The code or reference to a Procedure resource which identifies the \"\n            \"clinical intervention performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e procedure[x]\n            \"one_of_many\": \"procedure\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Procedure instance identifier\",\n        description=\"A number to uniquely identify procedure entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Category of Procedure\",\n        description=\"When the condition was observed or the relative ranking.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"type\",\n            \"date\",\n            \"procedureCodeableConcept\",\n            \"procedureReference\",\n            \"udi\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"procedure\": [\"procedureCodeableConcept\", \"procedureReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ClaimRelated(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Prior or corollary claims.\n    Other claims which are related to this claim such as prior submissions or\n    claims for related services or for the same event.\n    \"\"\"\n\n    __resource_type__ = \"ClaimRelated\"\n\n    claim: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claim\",\n        title=\"Reference to the related claim\",\n        description=\"Reference to a related claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Claim\"],\n        },\n    )\n\n    reference: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"File or case reference\",\n        description=(\n            \"An alternate organizational reference to the case or file to which \"\n            \"this particular claim pertains.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"How the reference claim is related\",\n        description=\"A code to convey how the claims are related.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"claim\",\n            \"relationship\",\n            \"reference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimSupportingInfo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supporting information.\n    Additional information codes regarding exceptions, special considerations,\n    the condition, situation, prior or concurrent issues.\n    \"\"\"\n\n    __resource_type__ = \"ClaimSupportingInfo\"\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Classification of the supplied information\",\n        description=(\n            \"The general class of the information supplied: information; exception;\"\n            \" accident, employment; onset, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of information\",\n        description=(\n            \"System and code pertaining to the specific information regarding \"\n            \"special conditions relating to the setting, treatment or patient  for \"\n            \"which care is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Explanation for the information\",\n        description=(\n            \"Provides the reason in the situation where a reason code is required \"\n            \"in addition to the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Information instance identifier\",\n        description=\"A number to uniquely identify supporting information entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    timingDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"timingDate\",\n        title=\"When it occurred\",\n        description=\"The date when or period to which this information refers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timingDate\", title=\"Extension field for ``timingDate``.\"\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When it occurred\",\n        description=\"The date when or period to which this information refers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"category\",\n            \"code\",\n            \"timingDate\",\n            \"timingPeriod\",\n            \"valueBoolean\",\n            \"valueString\",\n            \"valueQuantity\",\n            \"valueAttachment\",\n            \"valueReference\",\n            \"valueIdentifier\",\n            \"reason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\"timingDate\", \"timingPeriod\"],\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueIdentifier\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n            ],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/claimresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClaimResponse\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ClaimResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Response to a claim predetermination or preauthorization.\n    This resource provides the adjudication details from the processing of a\n    Claim resource.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponse\"\n\n    addItem: typing.List[fhirtypes.ClaimResponseAddItemType] | None = Field(\n        default=None,\n        alias=\"addItem\",\n        title=\"Insurer added line items\",\n        description=(\n            \"The first-tier service adjudications for payor added product or \"\n            \"service lines.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Header-level adjudication\",\n        description=(\n            \"The adjudication results which are presented at the header level \"\n            \"rather than at the line-item or add-item levels.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    communicationRequest: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"communicationRequest\",\n        title=\"Request for additional information\",\n        description=\"Request for additional supporting or authorizing information.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CommunicationRequest\"],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Response creation date\",\n        description=\"The date this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    decision: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"decision\",\n        title=\"Result of the adjudication\",\n        description=(\n            \"The result of the claim, predetermination, or preauthorization \"\n            \"adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    diagnosisRelatedGroup: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"diagnosisRelatedGroup\",\n        title=\"Package billing code\",\n        description=(\n            \"A package billing code or bundle code used to group products and \"\n            \"services to a particular health condition (such as heart attack) which\"\n            \" is based on a predetermined grouping code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A human readable description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    encounter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounters associated with the listed treatments\",\n        description=\"Healthcare encounters related to this claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    error: typing.List[fhirtypes.ClaimResponseErrorType] | None = Field(\n        default=None,\n        alias=\"error\",\n        title=\"Processing errors\",\n        description=\"Errors encountered during the processing of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    event: typing.List[fhirtypes.ClaimResponseEventType] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"Event information\",\n        description=\"Information code for an event with a corresponding date or period.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    form: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"Printed reference or actual form\",\n        description=(\n            \"The actual form, by reference or inclusion, for printing the content \"\n            \"or an EOB.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    formCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"formCode\",\n        title=\"Printed form identifier\",\n        description=\"A code for the form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    fundsReserve: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fundsReserve\",\n        title=\"Funds reserved status\",\n        description=(\n            \"A code, used only on a response to a preauthorization, to indicate \"\n            \"whether the benefits payable have been reserved and for whom.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for a claim response\",\n        description=\"A unique identifier assigned to this claim response.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: typing.List[fhirtypes.ClaimResponseInsuranceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Patient insurance information\",\n        description=(\n            \"Financial instruments for reimbursement for the health care products \"\n            \"and services specified on the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Party responsible for reimbursement\",\n        description=(\n            \"The party responsible for authorization, adjudication and \"\n            \"reimbursement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    item: typing.List[fhirtypes.ClaimResponseItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Adjudication for claim line items\",\n        description=(\n            \"A claim line. Either a simple (a product or service) or a 'group' of \"\n            \"details which can also be a simple items or groups of sub-details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcome: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"queued | complete | error | partial\",\n        description=(\n            \"The outcome of the claim, predetermination, or preauthorization \"\n            \"processing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"queued\", \"complete\", \"error\", \"partial\"],\n        },\n    )\n    outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcome\", title=\"Extension field for ``outcome``.\"\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The recipient of the products and services\",\n        description=(\n            \"The party to whom the professional services and/or products have been \"\n            \"supplied or are being considered and for whom actual for facast \"\n            \"reimbursement is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    payeeType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"payeeType\",\n        title=\"Party to be paid any benefits payable\",\n        description=\"Type of Party to be reimbursed: subscriber, provider, other.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payment: fhirtypes.ClaimResponsePaymentType | None = Field(\n        default=None,\n        alias=\"payment\",\n        title=\"Payment Details\",\n        description=\"Payment details for the adjudication of the claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preAuthPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"preAuthPeriod\",\n        title=\"Preauthorization reference effective period\",\n        description=\"The time frame during which this authorization is effective.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preAuthRef: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Preauthorization reference\",\n        description=(\n            \"Reference from the Insurer which is used in later communications which\"\n            \" refers to this adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    processNote: typing.List[fhirtypes.ClaimResponseProcessNoteType] | None = Field(\n        default=None,\n        alias=\"processNote\",\n        title=\"Note concerning adjudication\",\n        description=(\n            \"A note that describes or explains adjudication results in a human \"\n            \"readable form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Id of resource triggering adjudication\",\n        description=\"Original request resource reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Claim\"],\n        },\n    )\n\n    requestor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestor\",\n        title=\"Party responsible for the claim\",\n        description=(\n            \"The provider which is responsible for the claim, predetermination or \"\n            \"preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"More granular claim type\",\n        description=(\n            \"A finer grained suite of claim type codes which may convey additional \"\n            \"information such as Inpatient vs Outpatient and/or a specialty \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    total: typing.List[fhirtypes.ClaimResponseTotalType] | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"Adjudication totals\",\n        description=\"Categorized monetary totals for the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"More granular claim type\",\n        description=(\n            \"A finer grained suite of claim type codes which may convey additional \"\n            \"information such as Inpatient vs Outpatient and/or a specialty \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"claim | preauthorization | predetermination\",\n        description=(\n            \"A code to indicate whether the nature of the request is: Claim - A \"\n            \"request to an Insurer to adjudicate the supplied charges for health \"\n            \"care goods and services under the identified policy and to pay the \"\n            \"determined Benefit amount, if any; Preauthorization - A request to an \"\n            \"Insurer to adjudicate the supplied proposed future charges for health \"\n            \"care goods and services under the identified policy and to approve the\"\n            \" services and provide the expected benefit amounts and potentially to \"\n            \"reserve funds to pay the benefits when Claims for the indicated \"\n            \"services are later submitted; or, Pre-determination - A request to an \"\n            \"Insurer to adjudicate the supplied 'what if' charges for health care \"\n            \"goods and services under the identified policy and report back what \"\n            \"the Benefit payable would be had the services actually been provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"claim\", \"preauthorization\", \"predetermination\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"traceNumber\",\n            \"status\",\n            \"type\",\n            \"subType\",\n            \"use\",\n            \"patient\",\n            \"created\",\n            \"insurer\",\n            \"requestor\",\n            \"request\",\n            \"outcome\",\n            \"decision\",\n            \"disposition\",\n            \"preAuthRef\",\n            \"preAuthPeriod\",\n            \"event\",\n            \"payeeType\",\n            \"encounter\",\n            \"diagnosisRelatedGroup\",\n            \"item\",\n            \"addItem\",\n            \"adjudication\",\n            \"total\",\n            \"payment\",\n            \"fundsReserve\",\n            \"formCode\",\n            \"form\",\n            \"processNote\",\n            \"communicationRequest\",\n            \"insurance\",\n            \"error\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"type\",\n            \"use\",\n            \"patient\",\n            \"created\",\n            \"insurer\",\n            \"request\",\n            \"outcome\",\n            \"decision\",\n            \"total\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"outcome\", \"outcome__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"use\", \"use__ext\"),\n        ]\n        return required_fields\n\n\nclass ClaimResponseAddItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line items.\n    The first-tier service adjudications for payor added product or service\n    lines.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseAddItem\"\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items adjudication\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    bodySite: typing.List[fhirtypes.ClaimResponseAddItemBodySiteType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical location\",\n        description=\"Physical location where the service is performed or applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ClaimResponseAddItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Insurer added line details\",\n        description=\"The second-tier service adjudications for payor added services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"detailSequence\",\n        title=\"Detail sequence number\",\n        description=(\n            \"The sequence number of the details within the claim item which this \"\n            \"line is intended to replace.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detailSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_detailSequence\",\n        title=\"Extension field for ``detailSequence``.\",\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    itemSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"itemSequence\",\n        title=\"Item sequence number\",\n        description=\"Claim items which this service line is intended to replace.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    itemSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_itemSequence\",\n        title=\"Extension field for ``itemSequence``.\",\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"locationCodeableConcept\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The total amount claimed for the group (if a grouper) or the addItem. \"\n            \"Net = unit price * quantity * factor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related item details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item. This element may be the start\"\n            \" of a range of .productOrService codes used in conjunction with \"\n            \".productOrServiceEnd or it may be a solo element where \"\n            \".productOrServiceEnd is not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrServiceEnd\",\n        title=\"End of a range of codes\",\n        description=(\n            \"This contains the end of a range of product, service, drug or other \"\n            \"billing codes for the item. This element is not used when the \"\n            \".productOrService is a group code. This value may only be present when\"\n            \" a .productOfService code has been provided to convey the start of the\"\n            \" range. Typically this value may be used only with preauthorizations \"\n            \"and not with claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Authorized providers\",\n        description=(\n            \"The providers who are authorized for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Request or Referral for Service\",\n        description=\"Request or Referral for Goods or Service to be rendered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ServiceRequest\",\n                \"SupplyRequest\",\n                \"VisionPrescription\",\n            ],\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewOutcome: fhirtypes.ClaimResponseItemReviewOutcomeType | None = Field(\n        default=None,\n        alias=\"reviewOutcome\",\n        title=\"Added items adjudication results\",\n        description=(\n            \"The high-level results of the adjudication if adjudication has been \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subdetailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"subdetailSequence\",\n        title=\"Subdetail sequence number\",\n        description=(\n            \"The sequence number of the sub-details within the details within the \"\n            \"claim item which this line is intended to replace.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subdetailSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_subdetailSequence\",\n        title=\"Extension field for ``subdetailSequence``.\",\n    )\n\n    tax: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tax\",\n        title=\"Total tax\",\n        description=\"The total of taxes applicable for this product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseAddItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemSequence\",\n            \"detailSequence\",\n            \"subdetailSequence\",\n            \"traceNumber\",\n            \"provider\",\n            \"revenue\",\n            \"productOrService\",\n            \"productOrServiceEnd\",\n            \"request\",\n            \"modifier\",\n            \"programCode\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"locationCodeableConcept\",\n            \"locationAddress\",\n            \"locationReference\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"tax\",\n            \"net\",\n            \"bodySite\",\n            \"noteNumber\",\n            \"reviewOutcome\",\n            \"adjudication\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"location\": [\n                \"locationAddress\",\n                \"locationCodeableConcept\",\n                \"locationReference\",\n            ],\n            \"serviced\": [\"servicedDate\", \"servicedPeriod\"],\n        }\n        return one_of_many_fields\n\n\nclass ClaimResponseAddItemBodySite(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Anatomical location.\n    Physical location where the service is performed or applies.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseAddItemBodySite\"\n\n    site: typing.List[fhirtypes.CodeableReferenceType] = Field(\n        default=...,\n        alias=\"site\",\n        title=\"Location\",\n        description=\"Physical service site on the patient (limb, tooth, etc.).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BodyStructure\"],\n        },\n    )\n\n    subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subSite\",\n        title=\"Sub-location\",\n        description=(\n            \"A region or surface of the bodySite, e.g. limb region or tooth \"\n            \"surface(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseAddItemBodySite`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"site\", \"subSite\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItemBodySite`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseAddItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line details.\n    The second-tier service adjudications for payor added services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseAddItemDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items detail adjudication\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The total amount claimed for the group (if a grouper) or the \"\n            \"addItem.detail. Net = unit price * quantity * factor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related item details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item. This element may be the start\"\n            \" of a range of .productOrService codes used in conjunction with \"\n            \".productOrServiceEnd or it may be a solo element where \"\n            \".productOrServiceEnd is not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrServiceEnd\",\n        title=\"End of a range of codes\",\n        description=(\n            \"This contains the end of a range of product, service, drug or other \"\n            \"billing codes for the item. This element is not used when the \"\n            \".productOrService is a group code. This value may only be present when\"\n            \" a .productOfService code has been provided to convey the start of the\"\n            \" range. Typically this value may be used only with preauthorizations \"\n            \"and not with claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewOutcome: fhirtypes.ClaimResponseItemReviewOutcomeType | None = Field(\n        default=None,\n        alias=\"reviewOutcome\",\n        title=\"Added items detail level adjudication results\",\n        description=(\n            \"The high-level results of the adjudication if adjudication has been \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subDetail: typing.List[\n        fhirtypes.ClaimResponseAddItemDetailSubDetailType\n    ] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Insurer added line items\",\n        description=\"The third-tier service adjudications for payor added services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    tax: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tax\",\n        title=\"Total tax\",\n        description=\"The total of taxes applicable for this product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseAddItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"traceNumber\",\n            \"revenue\",\n            \"productOrService\",\n            \"productOrServiceEnd\",\n            \"modifier\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"tax\",\n            \"net\",\n            \"noteNumber\",\n            \"reviewOutcome\",\n            \"adjudication\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseAddItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line items.\n    The third-tier service adjudications for payor added services.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseAddItemDetailSubDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items subdetail adjudication\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The total amount claimed for the addItem.detail.subDetail. Net = unit \"\n            \"price * quantity * factor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related item details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item. This element may be the start\"\n            \" of a range of .productOrService codes used in conjunction with \"\n            \".productOrServiceEnd or it may be a solo element where \"\n            \".productOrServiceEnd is not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrServiceEnd\",\n        title=\"End of a range of codes\",\n        description=(\n            \"This contains the end of a range of product, service, drug or other \"\n            \"billing codes for the item. This element is not used when the \"\n            \".productOrService is a group code. This value may only be present when\"\n            \" a .productOfService code has been provided to convey the start of the\"\n            \" range. Typically this value may be used only with preauthorizations \"\n            \"and not with claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewOutcome: fhirtypes.ClaimResponseItemReviewOutcomeType | None = Field(\n        default=None,\n        alias=\"reviewOutcome\",\n        title=\"Added items subdetail level adjudication results\",\n        description=(\n            \"The high-level results of the adjudication if adjudication has been \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    tax: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tax\",\n        title=\"Total tax\",\n        description=\"The total of taxes applicable for this product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseAddItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"traceNumber\",\n            \"revenue\",\n            \"productOrService\",\n            \"productOrServiceEnd\",\n            \"modifier\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"tax\",\n            \"net\",\n            \"noteNumber\",\n            \"reviewOutcome\",\n            \"adjudication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseAddItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseError(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing errors.\n    Errors encountered during the processing of the adjudication.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseError\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Error code detailing processing issues\",\n        description=(\n            \"An error code, from a specified code system, which details why the \"\n            \"claim could not be adjudicated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    detailSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"detailSequence\",\n        title=\"Detail sequence number\",\n        description=(\n            \"The sequence number of the detail within the line item submitted which\"\n            \" contains the error. This value is omitted when the error occurs \"\n            \"outside of the item structure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailSequence\",\n        title=\"Extension field for ``detailSequence``.\",\n    )\n\n    expression: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"FHIRPath of element(s) related to issue\",\n        description=(\n            \"A [simple subset of FHIRPath](fhirpath.html#simple) limited to element\"\n            \" names, repetition indicators and the default child accessor that \"\n            \"identifies one of the elements in the resource that caused this issue \"\n            \"to be raised.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    expression__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    itemSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"itemSequence\",\n        title=\"Item sequence number\",\n        description=(\n            \"The sequence number of the line item submitted which contains the \"\n            \"error. This value is omitted when the error occurs outside of the item\"\n            \" structure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    itemSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_itemSequence\",\n        title=\"Extension field for ``itemSequence``.\",\n    )\n\n    subDetailSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"subDetailSequence\",\n        title=\"Subdetail sequence number\",\n        description=(\n            \"The sequence number of the sub-detail within the detail within the \"\n            \"line item submitted which contains the error. This value is omitted \"\n            \"when the error occurs outside of the item structure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subDetailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subDetailSequence\",\n        title=\"Extension field for ``subDetailSequence``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseError`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemSequence\",\n            \"detailSequence\",\n            \"subDetailSequence\",\n            \"code\",\n            \"expression\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseError`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"expression\"]\n\n\nclass ClaimResponseEvent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Event information.\n    Information code for an event with a corresponding date or period.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseEvent\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Specific event\",\n        description=\"A coded event such as when a service is expected or a card printed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    whenDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenDateTime\",\n        title=\"Occurance date or period\",\n        description=(\n            \"A date or period in the past or future indicating when the event \"\n            \"occurred or is expectd to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": True,\n        },\n    )\n    whenDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenDateTime\",\n        title=\"Extension field for ``whenDateTime``.\",\n    )\n\n    whenPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"whenPeriod\",\n        title=\"Occurance date or period\",\n        description=(\n            \"A date or period in the past or future indicating when the event \"\n            \"occurred or is expectd to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"whenDateTime\",\n            \"whenPeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"when\": [\"whenDateTime\", \"whenPeriod\"]}\n        return one_of_many_fields\n\n\nclass ClaimResponseInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient insurance information.\n    Financial instruments for reimbursement for the health care products and\n    services specified on the claim.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseInsurance\"\n\n    businessArrangement: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"businessArrangement\",\n        title=\"Additional provider contract number\",\n        description=(\n            \"A business agreement number established between the provider and the \"\n            \"insurer for special business processing purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_businessArrangement\",\n        title=\"Extension field for ``businessArrangement``.\",\n    )\n\n    claimResponse: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claimResponse\",\n        title=\"Adjudication results\",\n        description=(\n            \"The result of the adjudication of the line items for the Coverage \"\n            \"specified in this insurance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClaimResponse\"],\n        },\n    )\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=(\n            \"Reference to the insurance card level information contained in the \"\n            \"Coverage resource. The coverage issuing insurer will use these details\"\n            \" to locate the patient's actual coverage within the insurer's \"\n            \"information system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    focal: bool | None = Field(\n        default=None,\n        alias=\"focal\",\n        title=\"Coverage to be used for adjudication\",\n        description=(\n            \"A flag to indicate that this Coverage is to be used for adjudication \"\n            \"of this claim when set to true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_focal\", title=\"Extension field for ``focal``.\"\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Insurance instance identifier\",\n        description=(\n            \"A number to uniquely identify insurance entries and provide a sequence\"\n            \" of coverages to convey coordination of benefit order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"focal\",\n            \"coverage\",\n            \"businessArrangement\",\n            \"claimResponse\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"focal\", \"focal__ext\"), (\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ClaimResponseItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication for claim line items.\n    A claim line. Either a simple (a product or service) or a 'group' of\n    details which can also be a simple items or groups of sub-details.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItem\"\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Adjudication details\",\n        description=(\n            \"If this item is a group then the values here are a summary of the \"\n            \"adjudication of the detail items. If this item is a simple product or \"\n            \"service then this is the result of the adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ClaimResponseItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Adjudication for claim details\",\n        description=(\n            \"A claim detail. Either a simple (a product or service) or a 'group' of\"\n            \" sub-details which are simple items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    itemSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"itemSequence\",\n        title=\"Claim item instance identifier\",\n        description=\"A number to uniquely reference the claim item entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    itemSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_itemSequence\",\n        title=\"Extension field for ``itemSequence``.\",\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    reviewOutcome: fhirtypes.ClaimResponseItemReviewOutcomeType | None = Field(\n        default=None,\n        alias=\"reviewOutcome\",\n        title=\"Adjudication results\",\n        description=(\n            \"The high-level results of the adjudication if adjudication has been \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemSequence\",\n            \"traceNumber\",\n            \"noteNumber\",\n            \"reviewOutcome\",\n            \"adjudication\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"itemSequence\", \"itemSequence__ext\")]\n        return required_fields\n\n\nclass ClaimResponseItemAdjudication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication details.\n    If this item is a group then the values here are a summary of the\n    adjudication of the detail items. If this item is a simple product or\n    service then this is the result of the adjudication of this item.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItemAdjudication\"\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Monetary amount\",\n        description=\"Monetary amount associated with the category.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Type of adjudication information\",\n        description=(\n            \"A code to indicate the information type of this adjudication record. \"\n            \"Information types may include the value submitted, maximum values or \"\n            \"percentages allowed or payable under the plan, amounts that: the \"\n            \"patient is responsible for in aggregate or pertaining to this item; \"\n            \"amounts paid by other coverages; and, the benefit payable for this \"\n            \"item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Non-monetary value\",\n        description=(\n            \"A non-monetary value associated with the category. Mutually exclusive \"\n            \"to the amount element above.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Explanation of adjudication outcome\",\n        description=(\n            \"A code supporting the understanding of the adjudication result and \"\n            \"explaining variance from expected amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItemAdjudication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"reason\",\n            \"amount\",\n            \"quantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItemAdjudication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication for claim details.\n    A claim detail. Either a simple (a product or service) or a 'group' of sub-\n    details which are simple items.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItemDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Detail level adjudication details\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detailSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"detailSequence\",\n        title=\"Claim detail instance identifier\",\n        description=\"A number to uniquely reference the claim detail entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    detailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailSequence\",\n        title=\"Extension field for ``detailSequence``.\",\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    reviewOutcome: fhirtypes.ClaimResponseItemReviewOutcomeType | None = Field(\n        default=None,\n        alias=\"reviewOutcome\",\n        title=\"Detail level adjudication results\",\n        description=(\n            \"The high-level results of the adjudication if adjudication has been \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subDetail: typing.List[\n        fhirtypes.ClaimResponseItemDetailSubDetailType\n    ] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Adjudication for claim sub-details\",\n        description=\"A sub-detail adjudication of a simple product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"detailSequence\",\n            \"traceNumber\",\n            \"noteNumber\",\n            \"reviewOutcome\",\n            \"adjudication\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"detailSequence\", \"detailSequence__ext\")]\n        return required_fields\n\n\nclass ClaimResponseItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication for claim sub-details.\n    A sub-detail adjudication of a simple product or service.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItemDetailSubDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ClaimResponseItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Subdetail level adjudication details\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    reviewOutcome: fhirtypes.ClaimResponseItemReviewOutcomeType | None = Field(\n        default=None,\n        alias=\"reviewOutcome\",\n        title=\"Subdetail level adjudication results\",\n        description=(\n            \"The high-level results of the adjudication if adjudication has been \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subDetailSequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"subDetailSequence\",\n        title=\"Claim sub-detail instance identifier\",\n        description=\"A number to uniquely reference the claim sub-detail entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    subDetailSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subDetailSequence\",\n        title=\"Extension field for ``subDetailSequence``.\",\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"subDetailSequence\",\n            \"traceNumber\",\n            \"noteNumber\",\n            \"reviewOutcome\",\n            \"adjudication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"subDetailSequence\", \"subDetailSequence__ext\")]\n        return required_fields\n\n\nclass ClaimResponseItemReviewOutcome(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication results.\n    The high-level results of the adjudication if adjudication has been\n    performed.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseItemReviewOutcome\"\n\n    decision: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"decision\",\n        title=\"Result of the adjudication\",\n        description=(\n            \"The result of the claim, predetermination, or preauthorization \"\n            \"adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preAuthPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"preAuthPeriod\",\n        title=\"Preauthorization reference effective period\",\n        description=\"The time frame during which this authorization is effective.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preAuthRef: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Preauthorization reference\",\n        description=(\n            \"Reference from the Insurer which is used in later communications which\"\n            \" refers to this adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason for result of the adjudication\",\n        description=(\n            \"The reasons for the result of the claim, predetermination, or \"\n            \"preauthorization adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseItemReviewOutcome`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"decision\",\n            \"reason\",\n            \"preAuthRef\",\n            \"preAuthPeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseItemReviewOutcome`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponsePayment(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Payment Details.\n    Payment details for the adjudication of the claim.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponsePayment\"\n\n    adjustment: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"adjustment\",\n        title=\"Payment adjustment for non-claim issues\",\n        description=(\n            \"Total amount of all adjustments to this payment included in this \"\n            \"transaction which are not related to this claim's adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    adjustmentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"adjustmentReason\",\n        title=\"Explanation for the adjustment\",\n        description=\"Reason for the payment adjustment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    amount: fhirtypes.MoneyType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Payable amount after adjustment\",\n        description=\"Benefits payable less any payment adjustment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Expected date of payment\",\n        description=(\n            \"Estimated date the payment will be issued or the actual issue date of \"\n            \"payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for the payment\",\n        description=\"Issuer's unique identifier for the payment instrument.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Partial or complete payment\",\n        description=(\n            \"Whether this represents partial or complete payment of the benefits \"\n            \"payable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponsePayment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"adjustment\",\n            \"adjustmentReason\",\n            \"date\",\n            \"amount\",\n            \"identifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponsePayment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ClaimResponseProcessNote(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Note concerning adjudication.\n    A note that describes or explains adjudication results in a human readable\n    form.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseProcessNote\"\n\n    language: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language of the text\",\n        description=\"A code to define the language used in the text of the note.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    number: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"Note instance identifier\",\n        description=\"A number to uniquely identify a note entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Note explanatory text\",\n        description=\"The explanation or description associated with the processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Note purpose\",\n        description=\"The business purpose of the note text.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"number\",\n            \"type\",\n            \"text\",\n            \"language\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"text\", \"text__ext\")]\n        return required_fields\n\n\nclass ClaimResponseTotal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication totals.\n    Categorized monetary totals for the adjudication.\n    \"\"\"\n\n    __resource_type__ = \"ClaimResponseTotal\"\n\n    amount: fhirtypes.MoneyType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Financial total for the category\",\n        description=\"Monetary total amount associated with the category.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Type of adjudication information\",\n        description=(\n            \"A code to indicate the information type of this adjudication record. \"\n            \"Information types may include: the value submitted, maximum values or \"\n            \"percentages allowed or payable under the plan, amounts that the \"\n            \"patient is responsible for in aggregate or pertaining to this item, \"\n            \"amounts paid by other coverages, and the benefit payable for this \"\n            \"item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClaimResponseTotal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"category\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClaimResponseTotal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"category\", \"amount\"]\n"
  },
  {
    "path": "fhir/resources/clinicalimpression.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClinicalImpression\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ClinicalImpression(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A clinical assessment performed when planning treatments and management\n    strategies for a patient.\n    A record of a clinical assessment performed to determine what problem(s)\n    may affect the patient and before planning the treatments or management\n    strategies that are best to manage a patient's condition. Assessments are\n    often 1:1 with a clinical consultation / encounter,  but this varies\n    greatly depending on the clinical workflow. This resource is called\n    \"ClinicalImpression\" rather than \"ClinicalAssessment\" to avoid confusion\n    with the recording of assessment tools such as Apgar score.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalImpression\"\n\n    changePattern: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"changePattern\",\n        title=(\n            \"Change in the status/pattern of a subject's condition since previously\"\n            \" assessed, such as worsening, improving, or no change\"\n        ),\n        description=(\n            \"Change in the status/pattern of a subject's condition since previously\"\n            \" assessed, such as worsening, improving, or no change.  It is a \"\n            \"subjective assessment of the direction of the change.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the assessment was documented\",\n        description=\"Indicates when the documentation of the assessment was complete.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Why/how the assessment was performed\",\n        description=(\n            \"A summary of the context and/or cause of the assessment - why / where \"\n            \"it was performed, and what patient events/status prompted it.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"Time of assessment\",\n        description=\"The point in time or period over which the subject was assessed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"Time of assessment\",\n        description=\"The point in time or period over which the subject was assessed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"The Encounter during which this ClinicalImpression was created\",\n        description=(\n            \"The Encounter during which this ClinicalImpression was created or to \"\n            \"which the creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    finding: typing.List[fhirtypes.ClinicalImpressionFindingType] | None = Field(\n        default=None,\n        alias=\"finding\",\n        title=\"Possible or likely findings and diagnoses\",\n        description=(\n            \"Specific findings or diagnoses that were considered likely or relevant\"\n            \" to ongoing treatment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Business identifiers assigned to this clinical impression by the \"\n            \"performer or other systems which remain constant as the resource is \"\n            \"updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the ClinicalImpression\",\n        description=(\n            \"Commentary about the impression, typically recorded after the \"\n            \"impression itself was made, though supplemental notes by the original \"\n            \"author could also appear.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"The clinician performing the assessment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    previous: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"previous\",\n        title=\"Reference to last assessment\",\n        description=(\n            \"A reference to the last assessment that was conducted on this patient.\"\n            \" Assessments are often/usually ongoing in nature; a care provider \"\n            \"(practitioner or team) will make new assessments on an ongoing basis \"\n            \"as new data arises or the patient's conditions changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClinicalImpression\"],\n        },\n    )\n\n    problem: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"problem\",\n        title=\"Relevant impressions of patient state\",\n        description=\"A list of the relevant problems/conditions for a patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"AllergyIntolerance\"],\n        },\n    )\n\n    prognosisCodeableConcept: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"prognosisCodeableConcept\",\n        title=\"Estimate of likely outcome\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    prognosisReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"prognosisReference\",\n        title=\"RiskAssessment expressing likely outcome\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"RiskAssessment\"],\n        },\n    )\n\n    protocol: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"protocol\",\n        title=\"Clinical Protocol followed\",\n        description=(\n            \"Reference to a specific published clinical protocol that was followed \"\n            \"during this assessment, and/or that provides evidence in support of \"\n            \"the diagnosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    protocol__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_protocol\", title=\"Extension field for ``protocol``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | not-done | on-hold | stopped | completed |\"\n            \" entered-in-error | unknown\"\n        ),\n        description=\"Identifies the workflow status of the assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"not-done\",\n                \"on-hold\",\n                \"stopped\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current state of the ClinicalImpression.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Patient or group assessed\",\n        description=\"The patient or group of individuals assessed as part of this record.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    summary: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"summary\",\n        title=\"Summary of the assessment\",\n        description=\"A text summary of the investigations and the diagnosis.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    summary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_summary\", title=\"Extension field for ``summary``.\"\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Information supporting the clinical impression\",\n        description=(\n            \"Information supporting the clinical impression, which can contain \"\n            \"investigation results.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalImpression`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"statusReason\",\n            \"description\",\n            \"subject\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"date\",\n            \"performer\",\n            \"previous\",\n            \"problem\",\n            \"changePattern\",\n            \"protocol\",\n            \"summary\",\n            \"finding\",\n            \"prognosisCodeableConcept\",\n            \"prognosisReference\",\n            \"supportingInfo\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalImpression`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"description\",\n            \"subject\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"date\",\n            \"performer\",\n            \"problem\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"effective\": [\"effectiveDateTime\", \"effectivePeriod\"]}\n        return one_of_many_fields\n\n\nclass ClinicalImpressionFinding(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Possible or likely findings and diagnoses.\n    Specific findings or diagnoses that were considered likely or relevant to\n    ongoing treatment.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalImpressionFinding\"\n\n    basis: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"basis\",\n        title=\"Which investigations support finding\",\n        description=\"Which investigations support finding or diagnosis.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    basis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_basis\", title=\"Extension field for ``basis``.\"\n    )\n\n    item: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"What was found\",\n        description=(\n            \"Specific text, code or reference for finding or diagnosis, which may \"\n            \"include ruled-out or resolved conditions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\", \"DocumentReference\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalImpressionFinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"item\", \"basis\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalImpressionFinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/clinicalusedefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClinicalUseDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ClinicalUseDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A single issue - either an indication, contraindication, interaction or an\n    undesirable effect for a medicinal product, medication, device or procedure.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinition\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=(\n            \"A categorisation of the issue, primarily for dividing warnings into \"\n            'subject heading areas such as \"Pregnancy\", \"Overdose\"'\n        ),\n        description=(\n            \"A categorisation of the issue, primarily for dividing warnings into \"\n            'subject heading areas such as \"Pregnancy and Lactation\", \"Overdose\", '\n            '\"Effects on Ability to Drive and Use Machines\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contraindication: fhirtypes.ClinicalUseDefinitionContraindicationType | None = (\n        Field(\n            default=None,\n            alias=\"contraindication\",\n            title=\"Specifics for when this is a contraindication\",\n            description=None,\n            json_schema_extra={\n                \"element_property\": True,\n                \"summary_element_property\": True,\n            },\n        )\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for this issue\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    indication: fhirtypes.ClinicalUseDefinitionIndicationType | None = Field(\n        default=None,\n        alias=\"indication\",\n        title=\"Specifics for when this is an indication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    interaction: fhirtypes.ClinicalUseDefinitionInteractionType | None = Field(\n        default=None,\n        alias=\"interaction\",\n        title=\"Specifics for when this is an interaction\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    library: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the clinical use definition\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n    library__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_library\", title=\"Extension field for ``library``.\"\n    )\n\n    population: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"population\",\n        title=\"The population group to which this applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"Whether this is a current issue or one that has been retired etc\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=(\n            \"The medication, product, substance, device, procedure etc. for which \"\n            \"this is an indication\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicinalProductDefinition\",\n                \"Medication\",\n                \"ActivityDefinition\",\n                \"PlanDefinition\",\n                \"Device\",\n                \"DeviceDefinition\",\n                \"Substance\",\n                \"NutritionProduct\",\n                \"BiologicallyDerivedProduct\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"indication | contraindication | interaction | undesirable-effect | \"\n            \"warning\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"indication\",\n                \"contraindication\",\n                \"interaction\",\n                \"undesirable-effect\",\n                \"warning\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    undesirableEffect: fhirtypes.ClinicalUseDefinitionUndesirableEffectType | None = (\n        Field(\n            default=None,\n            alias=\"undesirableEffect\",\n            title=\"A possible negative outcome from the use of this treatment\",\n            description=(\n                \"Describe the possible undesirable effects (negative outcomes) from the\"\n                \" use of the medicinal product as treatment.\"\n            ),\n            json_schema_extra={\n                \"element_property\": True,\n                \"summary_element_property\": True,\n            },\n        )\n    )\n\n    warning: fhirtypes.ClinicalUseDefinitionWarningType | None = Field(\n        default=None,\n        alias=\"warning\",\n        title=(\n            \"Critical environmental, health or physical risks or hazards. For \"\n            \"example 'Do not operate heavy machinery', 'May cause drowsiness'\"\n        ),\n        description=(\n            \"A critical piece of information about environmental, health or \"\n            \"physical risks or hazards that serve as caution to the user. For \"\n            \"example 'Do not operate heavy machinery', 'May cause drowsiness', or \"\n            \"'Get medical advice/attention if you feel unwell'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"category\",\n            \"subject\",\n            \"status\",\n            \"contraindication\",\n            \"indication\",\n            \"interaction\",\n            \"population\",\n            \"library\",\n            \"undesirableEffect\",\n            \"warning\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"category\",\n            \"subject\",\n            \"status\",\n            \"contraindication\",\n            \"indication\",\n            \"interaction\",\n            \"population\",\n            \"library\",\n            \"undesirableEffect\",\n            \"warning\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass ClinicalUseDefinitionContraindication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifics for when this is a contraindication.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionContraindication\"\n\n    applicability: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"applicability\",\n        title=(\n            \"An expression that returns true or false, indicating whether the \"\n            \"indication is applicable or not, after having applied its other \"\n            \"elements\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    comorbidity: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"comorbidity\",\n        title=\"A comorbidity (concurrent condition) or coinfection\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    diseaseStatus: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"diseaseStatus\",\n        title=\"The status of the disease or symptom for the contraindication\",\n        description=(\n            \"The status of the disease or symptom for the contraindication, for \"\n            'example \"chronic\" or \"metastatic\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    diseaseSymptomProcedure: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"diseaseSymptomProcedure\",\n        title=(\n            \"The situation that is being documented as contraindicating against \"\n            \"this item\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    indication: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"indication\",\n        title=\"The indication which this is a contraidication for\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClinicalUseDefinition\"],\n        },\n    )\n\n    otherTherapy: typing.List[\n        fhirtypes.ClinicalUseDefinitionContraindicationOtherTherapyType\n    ] | None = Field(\n        default=None,\n        alias=\"otherTherapy\",\n        title=(\n            \"Information about use of the product in relation to other therapies \"\n            \"described as part of the contraindication\"\n        ),\n        description=(\n            \"Information about the use of the medicinal product in relation to \"\n            \"other therapies described as part of the contraindication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionContraindication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"diseaseSymptomProcedure\",\n            \"diseaseStatus\",\n            \"comorbidity\",\n            \"indication\",\n            \"applicability\",\n            \"otherTherapy\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionContraindication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"diseaseSymptomProcedure\",\n            \"diseaseStatus\",\n            \"comorbidity\",\n            \"indication\",\n            \"otherTherapy\",\n        ]\n\n\nclass ClinicalUseDefinitionContraindicationOtherTherapy(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about use of the product in relation to other therapies\n    described as part of the contraindication.\n    Information about the use of the medicinal product in relation to other\n    therapies described as part of the contraindication.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionContraindicationOtherTherapy\"\n\n    relationshipType: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"relationshipType\",\n        title=(\n            \"The type of relationship between the product \"\n            \"indication/contraindication and another therapy\"\n        ),\n        description=(\n            \"The type of relationship between the medicinal product indication or \"\n            \"contraindication and another therapy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    treatment: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"treatment\",\n        title=(\n            \"Reference to a specific medication, substance etc. as part of an \"\n            \"indication or contraindication\"\n        ),\n        description=(\n            \"Reference to a specific medication (active substance, medicinal \"\n            \"product or class of products, biological, food etc.) as part of an \"\n            \"indication or contraindication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicinalProductDefinition\",\n                \"Medication\",\n                \"Substance\",\n                \"SubstanceDefinition\",\n                \"NutritionProduct\",\n                \"BiologicallyDerivedProduct\",\n                \"ActivityDefinition\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionContraindicationOtherTherapy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"relationshipType\", \"treatment\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionContraindicationOtherTherapy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"relationshipType\", \"treatment\"]\n\n\nclass ClinicalUseDefinitionIndication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifics for when this is an indication.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionIndication\"\n\n    applicability: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"applicability\",\n        title=(\n            \"An expression that returns true or false, indicating whether the \"\n            \"indication is applicable or not, after having applied its other \"\n            \"elements\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    comorbidity: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"comorbidity\",\n        title=\"A comorbidity or coinfection as part of the indication\",\n        description=(\n            \"A comorbidity (concurrent condition) or coinfection as part of the \"\n            \"indication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    diseaseStatus: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"diseaseStatus\",\n        title=\"The status of the disease or symptom for the indication\",\n        description=(\n            \"The status of the disease or symptom for the indication, for example \"\n            '\"chronic\" or \"metastatic\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    diseaseSymptomProcedure: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"diseaseSymptomProcedure\",\n        title=\"The situation that is being documented as an indicaton for this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    durationRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"durationRange\",\n        title=\"Timing or duration information\",\n        description=(\n            \"Timing or duration information, that may be associated with use with \"\n            \"the indicated condition e.g. Adult patients suffering from myocardial \"\n            \"infarction (from a few days until less than 35 days), ischaemic stroke\"\n            \" (from 7 days until less than 6 months).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e duration[x]\n            \"one_of_many\": \"duration\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    durationString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"durationString\",\n        title=\"Timing or duration information\",\n        description=(\n            \"Timing or duration information, that may be associated with use with \"\n            \"the indicated condition e.g. Adult patients suffering from myocardial \"\n            \"infarction (from a few days until less than 35 days), ischaemic stroke\"\n            \" (from 7 days until less than 6 months).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e duration[x]\n            \"one_of_many\": \"duration\",\n            \"one_of_many_required\": False,\n        },\n    )\n    durationString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_durationString\",\n        title=\"Extension field for ``durationString``.\",\n    )\n\n    intendedEffect: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"intendedEffect\",\n        title=\"The intended effect, aim or strategy to be achieved\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    otherTherapy: typing.List[\n        fhirtypes.ClinicalUseDefinitionContraindicationOtherTherapyType\n    ] | None = Field(\n        default=None,\n        alias=\"otherTherapy\",\n        title=(\n            \"The use of the medicinal product in relation to other therapies \"\n            \"described as part of the indication\"\n        ),\n        description=(\n            \"Information about the use of the medicinal product in relation to \"\n            \"other therapies described as part of the indication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    undesirableEffect: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"undesirableEffect\",\n        title=(\n            \"An unwanted side effect or negative outcome of the subject of this \"\n            \"resource when being used for this indication\"\n        ),\n        description=(\n            \"An unwanted side effect or negative outcome that may happen if you use\"\n            \" the drug (or other subject of this resource) for this indication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClinicalUseDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionIndication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"diseaseSymptomProcedure\",\n            \"diseaseStatus\",\n            \"comorbidity\",\n            \"intendedEffect\",\n            \"durationRange\",\n            \"durationString\",\n            \"undesirableEffect\",\n            \"applicability\",\n            \"otherTherapy\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionIndication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"diseaseSymptomProcedure\",\n            \"diseaseStatus\",\n            \"comorbidity\",\n            \"intendedEffect\",\n            \"durationRange\",\n            \"durationString\",\n            \"undesirableEffect\",\n            \"otherTherapy\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"duration\": [\"durationRange\", \"durationString\"]}\n        return one_of_many_fields\n\n\nclass ClinicalUseDefinitionInteraction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifics for when this is an interaction.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionInteraction\"\n\n    effect: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"effect\",\n        title=(\n            'The effect of the interaction, for example \"reduced gastric absorption'\n            ' of primary medication\"'\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    incidence: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"incidence\",\n        title=\"The incidence of the interaction, e.g. theoretical, observed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    interactant: typing.List[\n        fhirtypes.ClinicalUseDefinitionInteractionInteractantType\n    ] | None = Field(\n        default=None,\n        alias=\"interactant\",\n        title=(\n            \"The specific medication, product, food etc. or laboratory test that \"\n            \"interacts\"\n        ),\n        description=(\n            \"The specific medication, product, food, substance etc. or laboratory \"\n            \"test that interacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    management: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"management\",\n        title=\"Actions for managing the interaction\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"The type of the interaction e.g. drug-drug interaction, drug-lab test \"\n            \"interaction\"\n        ),\n        description=(\n            \"The type of the interaction e.g. drug-drug interaction, drug-food \"\n            \"interaction, drug-lab test interaction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"interactant\",\n            \"type\",\n            \"effect\",\n            \"incidence\",\n            \"management\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionInteraction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"interactant\",\n            \"type\",\n            \"effect\",\n            \"incidence\",\n            \"management\",\n        ]\n\n\nclass ClinicalUseDefinitionInteractionInteractant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The specific medication, product, food etc. or laboratory test that\n    interacts.\n    The specific medication, product, food, substance etc. or laboratory test\n    that interacts.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionInteractionInteractant\"\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=(\n            \"The specific medication, product, food etc. or laboratory test that \"\n            \"interacts\"\n        ),\n        description=(\n            \"The specific medication, product, food, substance etc. or laboratory \"\n            \"test that interacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=(\n            \"The specific medication, product, food etc. or laboratory test that \"\n            \"interacts\"\n        ),\n        description=(\n            \"The specific medication, product, food, substance etc. or laboratory \"\n            \"test that interacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicinalProductDefinition\",\n                \"Medication\",\n                \"Substance\",\n                \"NutritionProduct\",\n                \"BiologicallyDerivedProduct\",\n                \"ObservationDefinition\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionInteractionInteractant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemReference\",\n            \"itemCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionInteractionInteractant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"itemReference\", \"itemCodeableConcept\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n\n\nclass ClinicalUseDefinitionUndesirableEffect(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A possible negative outcome from the use of this treatment.\n    Describe the possible undesirable effects (negative outcomes) from the use\n    of the medicinal product as treatment.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionUndesirableEffect\"\n\n    classification: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=\"High level classification of the effect\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    frequencyOfOccurrence: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"frequencyOfOccurrence\",\n        title=\"How often the effect is seen\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    symptomConditionEffect: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"symptomConditionEffect\",\n        title=\"The situation in which the undesirable effect may manifest\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionUndesirableEffect`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"symptomConditionEffect\",\n            \"classification\",\n            \"frequencyOfOccurrence\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionUndesirableEffect`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"symptomConditionEffect\",\n            \"classification\",\n            \"frequencyOfOccurrence\",\n        ]\n\n\nclass ClinicalUseDefinitionWarning(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Critical environmental, health or physical risks or hazards. For example\n    'Do not operate heavy machinery', 'May cause drowsiness'.\n    A critical piece of information about environmental, health or physical\n    risks or hazards that serve as caution to the user. For example 'Do not\n    operate heavy machinery', 'May cause drowsiness', or 'Get medical\n    advice/attention if you feel unwell'.\n    \"\"\"\n\n    __resource_type__ = \"ClinicalUseDefinitionWarning\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"A coded or unformatted textual definition of this warning\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"A textual definition of this warning, with formatting\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ClinicalUseDefinitionWarning`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"description\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ClinicalUseDefinitionWarning`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"description\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/codeableconcept.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CodeableConcept\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass CodeableConcept(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Concept - reference to a terminology or just  text.\n    A concept that may be defined by a formal reference to a terminology or\n    ontology or may be provided by text.\n    \"\"\"\n\n    __resource_type__ = \"CodeableConcept\"\n\n    coding: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"coding\",\n        title=\"Code defined by a terminology system\",\n        description=\"A reference to a code defined by a terminology system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Plain text representation of the concept\",\n        description=(\n            \"A human language representation of the concept as \"\n            \"seen/selected/uttered by the user who entered the data and/or which \"\n            \"represents the intended meaning of the user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeableConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"coding\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeableConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"coding\", \"text\"]\n"
  },
  {
    "path": "fhir/resources/codeablereference.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CodeableReference\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass CodeableReference(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Reference to a resource or a concept.\n    A reference to a resource (by instance), or instead, a reference to a\n    concept defined in a terminology or ontology (by class).\n    \"\"\"\n\n    __resource_type__ = \"CodeableReference\"\n\n    concept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"concept\",\n        title=\"Reference to a concept (by class)\",\n        description=(\n            \"A reference to a concept - e.g. the information is identified by its \"\n            \"general class to the degree of precision found in the terminology.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Reference to a resource (by instance)\",\n        description=(\n            \"A reference to a resource the provides exact details about the \"\n            \"information being referenced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeableReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"concept\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeableReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"concept\", \"reference\"]\n"
  },
  {
    "path": "fhir/resources/codesystem.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CodeSystem\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CodeSystem(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Declares the existence of and describes a code system or code system\n    supplement.\n    The CodeSystem resource is used to declare the existence of and describe a\n    code system or code system supplement and its key properties, and\n    optionally define a part or all of its content.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystem\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the CodeSystem was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the CodeSystem\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the CodeSystem.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    caseSensitive: bool | None = Field(\n        default=None,\n        alias=\"caseSensitive\",\n        title=\"If code comparison is case sensitive\",\n        description=(\n            \"If code comparison is case sensitive when codes within this system are\"\n            \" compared to each other.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    caseSensitive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_caseSensitive\",\n        title=\"Extension field for ``caseSensitive``.\",\n    )\n\n    compositional: bool | None = Field(\n        default=None,\n        alias=\"compositional\",\n        title=\"If code system defines a compositional grammar\",\n        description=\"The code system defines a compositional (post-coordination) grammar.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    compositional__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compositional\",\n        title=\"Extension field for ``compositional``.\",\n    )\n\n    concept: typing.List[fhirtypes.CodeSystemConceptType] | None = Field(\n        default=None,\n        alias=\"concept\",\n        title=\"Concepts in the code system\",\n        description=(\n            \"Concepts that are in the code system. The concept definitions are \"\n            \"inherently hierarchical, but the definitions must be consulted to \"\n            \"determine what the meanings of the hierarchical relationships are.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    content: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"not-present | example | fragment | complete | supplement\",\n        description=(\n            \"The extent of the content of the code system (the concepts and codes \"\n            \"it defines) are represented in this resource instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"not-present\",\n                \"example\",\n                \"fragment\",\n                \"complete\",\n                \"supplement\",\n            ],\n        },\n    )\n    content__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_content\", title=\"Extension field for ``content``.\"\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the code system and/or its contents.\"\n            \" Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    count: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Total concepts in the code system\",\n        description=(\n            \"The total number of concepts defined by the code system. Where the \"\n            \"code system has a compositional grammar, the basis of this count is \"\n            \"defined by the system steward.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the code system was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the code system \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the code system\",\n        description=(\n            \"A free text natural language description of the code system from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the CodeSystem\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the CodeSystem.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the CodeSystem is expected to be used\",\n        description=(\n            \"The period during which the CodeSystem content was or is planned to be\"\n            \" in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the CodeSystem\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"responsible for officially endorsing the CodeSystem for use in some \"\n            \"setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this code system is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    filter: typing.List[fhirtypes.CodeSystemFilterType] | None = Field(\n        default=None,\n        alias=\"filter\",\n        title=\"Filter that can be used in a value set\",\n        description=(\n            \"A filter that can be used in a value set compose statement when \"\n            \"selecting concepts using a filter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    hierarchyMeaning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"hierarchyMeaning\",\n        title=\"grouped-by | is-a | part-of | classified-with\",\n        description=(\n            \"The meaning of the hierarchy of concepts as represented in this \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"grouped-by\", \"is-a\", \"part-of\", \"classified-with\"],\n        },\n    )\n    hierarchyMeaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_hierarchyMeaning\",\n        title=\"Extension field for ``hierarchyMeaning``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the code system (business identifier)\",\n        description=(\n            \"A formal identifier that is used to identify this code system when it \"\n            \"is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for code system (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the code system is intended to \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the CodeSystem was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this code system (computer friendly)\",\n        description=(\n            \"A natural language name identifying the code system. This name should \"\n            \"be usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    property: typing.List[fhirtypes.CodeSystemPropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Additional information supplied about each concept\",\n        description=(\n            \"A property defines an additional slot through which additional \"\n            \"information can be provided about a concept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this code system is defined\",\n        description=(\n            \"Explanation of why this code system is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, \"\n            \"dependencies, bibliographic references, and predecessor and successor \"\n            \"artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the CodeSystem\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"primarily responsible for review of some aspect of the CodeSystem.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this code system. Enables tracking the life-cycle of the\"\n            \" content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    supplements: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"supplements\",\n        title=\"Canonical URL of Code System this adds designations and properties to\",\n        description=(\n            \"The canonical URL of the code system that this code system supplement \"\n            \"is adding designations and properties to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CodeSystem\"],\n        },\n    )\n    supplements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_supplements\", title=\"Extension field for ``supplements``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this code system (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the code system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptions related to the content of the CodeSystem. Topics provide \"\n            \"a high-level categorization as well as keywords for the CodeSystem \"\n            \"that can be useful for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this code system, represented as a URI \"\n            \"(globally unique) (Coding.system)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this code system when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" code system is (or will be) published. This URL can be the target of \"\n            \"a canonical reference. It SHALL remain the same when the code system \"\n            \"is stored on different servers. This is used in \"\n            \"[Coding](datatypes.html#Coding).system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate code system instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Canonical reference to the value set with entire code system\",\n        description=(\n            \"Canonical reference to the value set that contains all codes in the \"\n            \"code system independent of code status.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the code system (Coding.version)\",\n        description=(\n            \"The identifier that is used to identify this version of the code \"\n            \"system when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the code system author\"\n            \" and is not expected to be globally unique. For example, it might be a\"\n            \" timestamp (e.g. yyyymmdd) if a managed version is not available. \"\n            \"There is also no expectation that versions can be placed in a \"\n            \"lexicographical sequence. This is used in \"\n            \"[Coding](datatypes.html#Coding).version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which \"\n            \"CodeSystem is more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which \"\n            \"CodeSystem is more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    versionNeeded: bool | None = Field(\n        default=None,\n        alias=\"versionNeeded\",\n        title=\"If definitions are not stable\",\n        description=(\n            \"This flag is used to signify that the code system does not commit to \"\n            \"concept permanence across versions. If true, a version must be \"\n            \"specified when referencing this code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    versionNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionNeeded\",\n        title=\"Extension field for ``versionNeeded``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"caseSensitive\",\n            \"valueSet\",\n            \"hierarchyMeaning\",\n            \"compositional\",\n            \"versionNeeded\",\n            \"content\",\n            \"supplements\",\n            \"count\",\n            \"filter\",\n            \"property\",\n            \"concept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"caseSensitive\",\n            \"valueSet\",\n            \"hierarchyMeaning\",\n            \"compositional\",\n            \"versionNeeded\",\n            \"content\",\n            \"supplements\",\n            \"count\",\n            \"filter\",\n            \"property\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"content\", \"content__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass CodeSystemConcept(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Concepts in the code system.\n    Concepts that are in the code system. The concept definitions are\n    inherently hierarchical, but the definitions must be consulted to determine\n    what the meanings of the hierarchical relationships are.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemConcept\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies concept\",\n        description=(\n            \"A code - a text symbol - that uniquely identifies the concept within \"\n            \"the code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    concept: typing.List[fhirtypes.CodeSystemConceptType] | None = Field(\n        default=None,\n        alias=\"concept\",\n        title=\"Child Concepts (is-a/contains/categorizes)\",\n        description=(\n            \"Defines children of a concept to produce a hierarchy of concepts. The \"\n            \"nature of the relationships is variable (is-a/contains/categorizes) - \"\n            \"see hierarchyMeaning.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Formal definition\",\n        description=(\n            \"The formal definition of the concept. The code system resource does \"\n            \"not make formal definitions required, because of the prevalence of \"\n            \"legacy systems. However, they are highly recommended, as without them \"\n            \"there is no formal meaning associated with the concept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    designation: typing.List[fhirtypes.CodeSystemConceptDesignationType] | None = Field(\n        default=None,\n        alias=\"designation\",\n        title=\"Additional representations for the concept\",\n        description=(\n            \"Additional representations for the concept - other languages, aliases,\"\n            \" specialized purposes, used for particular purposes, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Text to display to the user\",\n        description=(\n            \"A human readable string that is the recommended default way to present\"\n            \" this concept to a user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    property: typing.List[fhirtypes.CodeSystemConceptPropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Property value for the concept\",\n        description=\"A property value for this concept.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"display\",\n            \"definition\",\n            \"designation\",\n            \"property\",\n            \"concept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass CodeSystemConceptDesignation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional representations for the concept.\n    Additional representations for the concept - other languages, aliases,\n    specialized purposes, used for particular purposes, etc.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemConceptDesignation\"\n\n    additionalUse: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"additionalUse\",\n        title=\"Additional ways how this designation would be used\",\n        description=(\n            \"Additional codes that detail how this designation would be used, if \"\n            \"there is more than one use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language of the designation\",\n        description=\"The language this designation is defined for.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    use: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"Details how this designation would be used\",\n        description=\"A code that details how this designation would be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The text value for this designation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemConceptDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"language\",\n            \"use\",\n            \"additionalUse\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemConceptDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass CodeSystemConceptProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Property value for the concept.\n    A property value for this concept.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemConceptProperty\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Reference to CodeSystem.property.code\",\n        description=\"A code that is a reference to CodeSystem.property.code.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemConceptProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCode\",\n            \"valueCoding\",\n            \"valueString\",\n            \"valueInteger\",\n            \"valueBoolean\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemConceptProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueCoding\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass CodeSystemFilter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Filter that can be used in a value set.\n    A filter that can be used in a value set compose statement when selecting\n    concepts using a filter.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemFilter\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies the filter\",\n        description=(\n            \"The code that identifies this filter when it is used as a filter in \"\n            \"[ValueSet](valueset.html#).compose.include.filter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"How or why the filter is used\",\n        description=\"A description of how or why the filter is used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    operator: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"operator\",\n        title=(\n            \"= | is-a | descendent-of | is-not-a | regex | in | not-in | \"\n            \"generalizes | child-of | descendent-leaf | exists\"\n        ),\n        description=\"A list of operators that can be used with the filter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"=\",\n                \"is-a\",\n                \"descendent-of\",\n                \"is-not-a\",\n                \"regex\",\n                \"in\",\n                \"not-in\",\n                \"generalizes\",\n                \"child-of\",\n                \"descendent-leaf\",\n                \"exists\",\n            ],\n        },\n    )\n    operator__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_operator\", title=\"Extension field for ``operator``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"What to use for the value\",\n        description=\"A description of what the value for the filter should be.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"description\",\n            \"operator\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"description\", \"operator\", \"value\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"code\", \"code__ext\"),\n            (\"operator\", \"operator__ext\"),\n            (\"value\", \"value__ext\"),\n        ]\n        return required_fields\n\n\nclass CodeSystemProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional information supplied about each concept.\n    A property defines an additional slot through which additional information\n    can be provided about a concept.\n    \"\"\"\n\n    __resource_type__ = \"CodeSystemProperty\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"Identifies the property on the concepts, and when referred to in \"\n            \"operations\"\n        ),\n        description=(\n            \"A code that is used to identify the property. The code is used \"\n            \"internally (in CodeSystem.concept.property.code) and also externally, \"\n            \"such as in property filters.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Why the property is defined, and/or what it conveys\",\n        description=(\n            \"A description of the property- why it is defined, and how its value \"\n            \"might be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"code | Coding | string | integer | boolean | dateTime | decimal\",\n        description=(\n            'The type of the property value. Properties of type \"code\" contain a '\n            \"code defined by the code system (e.g. a reference to another defined \"\n            \"concept).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"code\",\n                \"Coding\",\n                \"string\",\n                \"integer\",\n                \"boolean\",\n                \"dateTime\",\n                \"decimal\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Formal identifier for the property\",\n        description=(\n            \"Reference to the formal meaning of the property. One possible source \"\n            \"of meaning is the [Concept Properties](codesystem-concept-\"\n            \"properties.html) code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CodeSystemProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"uri\",\n            \"description\",\n            \"type\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CodeSystemProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"uri\", \"description\", \"type\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/coding.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Coding\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Coding(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reference to a code defined by a terminology system.\n    \"\"\"\n\n    __resource_type__ = \"Coding\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Symbol in syntax defined by the system\",\n        description=(\n            \"A symbol in syntax defined by the system. The symbol may be a \"\n            \"predefined code or an expression in a syntax defined by the coding \"\n            \"system (e.g. post-coordination).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Representation defined by the system\",\n        description=(\n            \"A representation of the meaning of the code in the system, following \"\n            \"the rules of the system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"Identity of the terminology system\",\n        description=(\n            \"The identification of the code system that defines the meaning of the \"\n            \"symbol in the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    userSelected: bool | None = Field(\n        default=None,\n        alias=\"userSelected\",\n        title=\"If this coding was chosen directly by the user\",\n        description=(\n            \"Indicates that this coding was chosen by a user directly - e.g. off a \"\n            \"pick list of available items (codes or displays).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    userSelected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_userSelected\",\n        title=\"Extension field for ``userSelected``.\",\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version of the system - if relevant\",\n        description=(\n            \"The version of the code system which was used when choosing this code.\"\n            \" Note that a well-maintained code system does not need the version \"\n            \"reported, because the meaning of codes is consistent across versions. \"\n            \"However this cannot consistently be assured, and when the meaning is \"\n            \"not guaranteed to be consistent, the version SHOULD be exchanged.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Coding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"system\",\n            \"version\",\n            \"code\",\n            \"display\",\n            \"userSelected\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Coding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"system\", \"version\", \"code\", \"display\", \"userSelected\"]\n"
  },
  {
    "path": "fhir/resources/communication.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Communication\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Communication(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A clinical or business level record of information being transmitted or\n    shared.\n    A clinical or business level record of information being transmitted or\n    shared; e.g. an alert that was sent to a responsible provider, a public\n    health agency communication to a provider/reporter in response to a case\n    report for a reportable condition.\n    \"\"\"\n\n    __resource_type__ = \"Communication\"\n\n    about: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"about\",\n        title=\"Resources that pertain to this communication\",\n        description=(\n            \"Other resources that pertain to this communication and to which this \"\n            \"communication should be associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this communication\",\n        description=(\n            \"An order, proposal or plan fulfilled in whole or in part by this \"\n            \"Communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Message category\",\n        description=(\n            \"The type of message conveyed such as alert, notification, reminder, \"\n            \"instruction, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"The Encounter during which this Communication was created\",\n        description=(\n            \"The Encounter during which this Communication was created or to which \"\n            \"the creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=(\n            \"Business identifiers assigned to this communication by the performer \"\n            \"or other systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    inResponseTo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"inResponseTo\",\n        title=\"Reply to\",\n        description=\"Prior communication that this communication is in response to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Communication\"],\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"Communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"ActivityDefinition\",\n                \"Measure\",\n                \"OperationDefinition\",\n                \"Questionnaire\",\n            ],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this Communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    medium: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"medium\",\n        title=\"A channel of communication\",\n        description=\"A channel that was used for this communication (e.g. email, fax).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the communication\",\n        description=(\n            \"Additional notes or commentary about the communication by the sender, \"\n            \"receiver or other interested parties.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event (e.g. Communication, Procedure)\",\n        description=(\n            \"A larger event (e.g. Communication, Procedure) of which this \"\n            \"particular communication is a component or step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    payload: typing.List[fhirtypes.CommunicationPayloadType] | None = Field(\n        default=None,\n        alias=\"payload\",\n        title=\"Message payload\",\n        description=(\n            \"Text, attachment(s), or resource(s) that was communicated to the \"\n            \"recipient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Characterizes how quickly the planned or in progress communication \"\n            \"must be addressed. Includes concepts such as stat, urgent, routine.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Indication for message\",\n        description=\"The reason or justification for the communication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    received: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"received\",\n        title=\"When received\",\n        description=\"The time when this communication arrived at the destination.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    received__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_received\", title=\"Extension field for ``received``.\"\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Who the information is shared with\",\n        description=(\n            \"The entity (e.g. person, organization, clinical information system, \"\n            \"care team or device) which is the target of the communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"Device\",\n                \"Group\",\n                \"HealthcareService\",\n                \"Location\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Endpoint\",\n            ],\n        },\n    )\n\n    sender: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sender\",\n        title=\"Who shares the information\",\n        description=(\n            \"The entity (e.g. person, organization, clinical information system, or\"\n            \" device) which is the source of the communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"HealthcareService\",\n                \"Endpoint\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    sent: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"sent\",\n        title=\"When sent\",\n        description=\"The time when this communication was sent.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sent\", title=\"Extension field for ``sent``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | not-done | on-hold | stopped | completed |\"\n            \" entered-in-error | unknown\"\n        ),\n        description=\"The status of the transmission.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"not-done\",\n                \"on-hold\",\n                \"stopped\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current state of the Communication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Focus of message\",\n        description=\"The patient or group that was the focus of this communication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    topic: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"Description of the purpose/content\",\n        description=(\n            \"Description of the purpose/content, similar to a subject line in an \"\n            \"email.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Communication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"partOf\",\n            \"inResponseTo\",\n            \"status\",\n            \"statusReason\",\n            \"category\",\n            \"priority\",\n            \"medium\",\n            \"subject\",\n            \"topic\",\n            \"about\",\n            \"encounter\",\n            \"sent\",\n            \"received\",\n            \"recipient\",\n            \"sender\",\n            \"reason\",\n            \"payload\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Communication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"priority\",\n            \"subject\",\n            \"encounter\",\n            \"reason\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass CommunicationPayload(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Message payload.\n    Text, attachment(s), or resource(s) that was communicated to the recipient.\n    \"\"\"\n\n    __resource_type__ = \"CommunicationPayload\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Message part content\",\n        description=(\n            \"A communicated content (or for multi-part communications, one portion \"\n            \"of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"contentCodeableConcept\",\n        title=\"Message part content\",\n        description=(\n            \"A communicated content (or for multi-part communications, one portion \"\n            \"of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Message part content\",\n        description=(\n            \"A communicated content (or for multi-part communications, one portion \"\n            \"of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CommunicationPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentAttachment\",\n            \"contentReference\",\n            \"contentCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CommunicationPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"content\": [\n                \"contentAttachment\",\n                \"contentCodeableConcept\",\n                \"contentReference\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/communicationrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CommunicationRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CommunicationRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A request for information to be sent to a receiver.\n    A request to convey information; e.g. the CDS system proposes that an alert\n    be sent to a responsible provider, the CDS system proposes that the public\n    health agency be notified about a reportable condition.\n    \"\"\"\n\n    __resource_type__ = \"CommunicationRequest\"\n\n    about: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"about\",\n        title=\"Resources that pertain to this communication request\",\n        description=(\n            \"Other resources that pertain to this communication request and to \"\n            \"which this communication request should be associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When request transitioned to being actionable\",\n        description=(\n            \"For draft requests, indicates the date of initial creation.  For \"\n            \"requests with other statuses, indicates the date of activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan or proposal\",\n        description=(\n            \"A plan or proposal that is fulfilled in whole or in part by this \"\n            \"request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Message category\",\n        description=(\n            \"The type of message to be sent such as alert, notification, reminder, \"\n            \"instruction, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"True if request is prohibiting action\",\n        description=(\n            \"If true indicates that the CommunicationRequest is asking for the \"\n            \"specified action to *not* occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"The Encounter during which this CommunicationRequest was created\",\n        description=(\n            \"The Encounter during which this CommunicationRequest was created or to\"\n            \" which the creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Composite request this is part of\",\n        description=(\n            \"A shared identifier common to multiple independent Request instances \"\n            \"that were activated/authorized more or less simultaneously by a single\"\n            \" author.  The presence of the same identifier on each request ties \"\n            \"those requests together and may have business ramifications in terms \"\n            \"of reporting of results, billing, etc.  E.g. a requisition number \"\n            \"shared by a set of lab tests ordered together, or a prescription \"\n            \"number shared by all meds ordered at one time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=(\n            \"Business identifiers assigned to this communication request by the \"\n            \"performer or other systems which remain constant as the resource is \"\n            \"updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    informationProvider: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"informationProvider\",\n        title=\"Who should share the information\",\n        description=(\n            \"The entity (e.g. person, organization, clinical information system, or\"\n            \" device) which is to be the source of the communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"HealthcareService\",\n                \"Endpoint\",\n            ],\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"proposal | plan | directive | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            \"Indicates the level of authority/intentionality associated with the \"\n            \"CommunicationRequest and where the request fits into the workflow \"\n            \"chain.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposal\",\n                \"plan\",\n                \"directive\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    medium: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"medium\",\n        title=\"A channel of communication\",\n        description=\"A channel that was used for this communication (e.g. email, fax).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about communication request\",\n        description=(\n            \"Comments made about the request by the requester, sender, recipient, \"\n            \"subject or other participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When scheduled\",\n        description=\"The time when this communication is to occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When scheduled\",\n        description=\"The time when this communication is to occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    payload: typing.List[fhirtypes.CommunicationRequestPayloadType] | None = Field(\n        default=None,\n        alias=\"payload\",\n        title=\"Message payload\",\n        description=(\n            \"Text, attachment(s), or resource(s) to be communicated to the \"\n            \"recipient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Characterizes how quickly the proposed act must be initiated. Includes\"\n            \" concepts such as stat, urgent, routine.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why is communication needed?\",\n        description=\"Describes why the request is being made in coded or textual form.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Who to share the information with\",\n        description=(\n            \"The entity (e.g. person, organization, clinical information system, \"\n            \"device, group, or care team) which is the intended target of the \"\n            \"communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Group\",\n                \"CareTeam\",\n                \"HealthcareService\",\n                \"Endpoint\",\n            ],\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"Request(s) replaced by this request\",\n        description=(\n            \"Completed or terminated request(s) whose function is taken by this new\"\n            \" request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CommunicationRequest\"],\n        },\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who asks for the information to be shared\",\n        description=(\n            \"The device, individual, or organization who asks for the information \"\n            \"to be shared.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | on-hold | revoked | completed | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=\"The status of the proposal or order.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"on-hold\",\n                \"revoked\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current state of the CommunicationRequest.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Focus of message\",\n        description=\"The patient or group that is the focus of this communication request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CommunicationRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"statusReason\",\n            \"intent\",\n            \"category\",\n            \"priority\",\n            \"doNotPerform\",\n            \"medium\",\n            \"subject\",\n            \"about\",\n            \"encounter\",\n            \"payload\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"authoredOn\",\n            \"requester\",\n            \"recipient\",\n            \"informationProvider\",\n            \"reason\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CommunicationRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"doNotPerform\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"authoredOn\",\n            \"requester\",\n            \"informationProvider\",\n            \"reason\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\"]}\n        return one_of_many_fields\n\n\nclass CommunicationRequestPayload(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Message payload.\n    Text, attachment(s), or resource(s) to be communicated to the recipient.\n    \"\"\"\n\n    __resource_type__ = \"CommunicationRequestPayload\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Message part content\",\n        description=(\n            \"The communicated content (or for multi-part communications, one \"\n            \"portion of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"contentCodeableConcept\",\n        title=\"Message part content\",\n        description=(\n            \"The communicated content (or for multi-part communications, one \"\n            \"portion of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Message part content\",\n        description=(\n            \"The communicated content (or for multi-part communications, one \"\n            \"portion of the communication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CommunicationRequestPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentAttachment\",\n            \"contentReference\",\n            \"contentCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CommunicationRequestPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"content\": [\n                \"contentAttachment\",\n                \"contentCodeableConcept\",\n                \"contentReference\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/compartmentdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CompartmentDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CompartmentDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Compartment Definition for a resource.\n    A compartment definition that defines how resources are accessed on a\n    server.\n    \"\"\"\n\n    __resource_type__ = \"CompartmentDefinition\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"Patient | Encounter | RelatedPerson | Practitioner | Device | \"\n            \"EpisodeOfCare\"\n        ),\n        description=\"Which compartment this definition describes.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"Patient\",\n                \"Encounter\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"Device\",\n                \"EpisodeOfCare\",\n            ],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the compartment definition was \"\n            \"last significantly changed. The date must change when the business \"\n            \"version changes and it must change if the status code changes. In \"\n            \"addition, it should change when the substantive content of the \"\n            \"compartment definition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the compartment definition\",\n        description=(\n            \"A free text natural language description of the compartment definition\"\n            \" from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this compartment definition is \"\n            \"authored for testing purposes (or education/evaluation/marketing) and \"\n            \"is not intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this compartment definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the compartment definition. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the compartment definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this compartment definition is defined\",\n        description=(\n            \"Explanation of why this compartment definition is needed and why it \"\n            \"has been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    resource: typing.List[fhirtypes.CompartmentDefinitionResourceType] | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"How a resource is related to the compartment\",\n        description=\"Information about how a resource is related to the compartment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    search: bool | None = Field(\n        default=None,\n        alias=\"search\",\n        title=\"Whether the search syntax is supported\",\n        description=\"Whether the search syntax is supported,.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    search__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_search\", title=\"Extension field for ``search``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this compartment definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this compartment definition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the capability \" \"statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this compartment definition, represented as a\"\n            \" URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this compartment definition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which an \"\n            \"authoritative instance of this compartment definition is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the compartment definition is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate compartment definition \"\n            \"instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the compartment definition\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"compartment definition when it is referenced in a specification, \"\n            \"model, design or instance. This is an arbitrary value managed by the \"\n            \"compartment definition author and is not expected to be globally \"\n            \"unique. For example, it might be a timestamp (e.g. yyyymmdd) if a \"\n            \"managed version is not available. There is also no expectation that \"\n            \"versions can be placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompartmentDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"purpose\",\n            \"code\",\n            \"search\",\n            \"resource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompartmentDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"code\",\n            \"search\",\n            \"resource\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"code\", \"code__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"search\", \"search__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass CompartmentDefinitionResource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    How a resource is related to the compartment.\n    Information about how a resource is related to the compartment.\n    \"\"\"\n\n    __resource_type__ = \"CompartmentDefinitionResource\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Name of resource type\",\n        description=\"The name of a resource supported by the server.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Additional documentation about the resource and compartment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    endParam: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"endParam\",\n        title=\"Search Param for interpreting $everything.end\",\n        description=(\n            \"Search Parameter for mapping requests made with $everything.end (e.g. \"\n            \"on [Patient.$everything](patient-operation-everything.html)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    endParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_endParam\", title=\"Extension field for ``endParam``.\"\n    )\n\n    param: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"param\",\n        title=\"Search Parameter Name, or chained parameters\",\n        description=(\n            \"The name of a search parameter that represents the link to the \"\n            \"compartment. More than one may be listed because a resource may be \"\n            \"linked to a compartment in more than one way,.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    param__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_param\", title=\"Extension field for ``param``.\"\n    )\n\n    startParam: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"startParam\",\n        title=\"Search Param for interpreting $everything.start\",\n        description=(\n            \"Search Parameter for mapping requests made with $everything.start \"\n            \"(e.g. on [Patient.$everything](patient-operation-everything.html)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    startParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_startParam\", title=\"Extension field for ``startParam``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompartmentDefinitionResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"param\",\n            \"documentation\",\n            \"startParam\",\n            \"endParam\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompartmentDefinitionResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"param\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/composition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Composition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Composition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of resources composed into a single coherent clinical statement with\n    clinical attestation.\n    A set of healthcare-related information that is assembled together into a\n    single logical package that provides a single coherent statement of\n    meaning, establishes its own context and that has clinical attestation with\n    regard to who is making the statement. A Composition defines the structure\n    and narrative content necessary for a document. However, a Composition\n    alone does not constitute a document. Rather, the Composition must be the\n    first entry in a Bundle where Bundle.type=document, and any other resources\n    referenced from Composition must be included as subsequent entries in the\n    Bundle (for example Patient, Practitioner, Encounter, etc.).\n    \"\"\"\n\n    __resource_type__ = \"Composition\"\n\n    attester: typing.List[fhirtypes.CompositionAttesterType] | None = Field(\n        default=None,\n        alias=\"attester\",\n        title=\"Attests to accuracy of composition\",\n        description=(\n            \"A participant who has attested to the accuracy of the \"\n            \"composition/document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    author: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"author\",\n        title=\"Who and/or what authored the composition\",\n        description=(\n            \"Identifies who is responsible for the information in the composition, \"\n            \"not necessarily who typed it in.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Categorization of Composition\",\n        description=(\n            \"A categorization for the type of the composition - helps for indexing \"\n            \"and searching. This may be implied by or derived from the code \"\n            \"specified in the Composition Type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    custodian: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"custodian\",\n        title=\"Organization which maintains the composition\",\n        description=(\n            \"Identifies the organization or group who is responsible for ongoing \"\n            \"maintenance of and access to the composition/document information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Composition editing time\",\n        description=(\n            \"The composition editing time, when the composition was last logically \"\n            \"changed by the author.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Context of the Composition\",\n        description=(\n            \"Describes the clinical encounter or type of care this documentation is\"\n            \" associated with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    event: typing.List[fhirtypes.CompositionEventType] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"The clinical service(s) being documented\",\n        description=(\n            \"The clinical service, such as a colonoscopy or an appendectomy, being \"\n            \"documented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Version-independent identifier for the Composition\",\n        description=(\n            \"A version-independent identifier for the Composition. This identifier \"\n            \"stays constant as the composition is changed over time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this Composition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the {{title}}. This name should be\"\n            \" usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"For any additional notes\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatesTo: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatesTo\",\n        title=\"Relationships to other compositions/documents\",\n        description=(\n            \"Relationships that this composition has with other compositions or \"\n            \"documents that already exist.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    section: typing.List[fhirtypes.CompositionSectionType] | None = Field(\n        default=None,\n        alias=\"section\",\n        title=\"Composition is broken into sections\",\n        description=\"The root of the sections that make up the composition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"registered | partial | preliminary | final | amended | corrected | \"\n            \"appended | cancelled | entered-in-error | deprecated | unknown\"\n        ),\n        description=(\n            \"The workflow/clinical status of this composition. The status is a \"\n            \"marker for the clinical standing of the document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"registered\",\n                \"partial\",\n                \"preliminary\",\n                \"final\",\n                \"amended\",\n                \"corrected\",\n                \"appended\",\n                \"cancelled\",\n                \"entered-in-error\",\n                \"deprecated\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who and/or what the composition is about\",\n        description=(\n            \"Who or what the composition is about. The composition can be about a \"\n            \"person, (patient or healthcare practitioner), a device (e.g. a \"\n            \"machine) or even a group of subjects (such as a document about a herd \"\n            \"of livestock, or a set of patients that share a common exposure).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Human Readable name/title\",\n        description=\"Official human-readable label for the composition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Kind of composition (LOINC if possible)\",\n        description=(\n            \"Specifies the particular kind of composition (e.g. History and \"\n            \"Physical, Discharge Summary, Progress Note). This usually equates to \"\n            \"the purpose of making the composition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this Composition, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this Composition when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" Composition is (or will be) published. This URL can be the target of \"\n            \"a canonical reference. It SHALL remain the same when the Composition \"\n            \"is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate Composition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=(\n            \"An explicitly assigned identifer of a variation of the content in the \"\n            \"Composition\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Composition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"status\",\n            \"type\",\n            \"category\",\n            \"subject\",\n            \"encounter\",\n            \"date\",\n            \"useContext\",\n            \"author\",\n            \"name\",\n            \"title\",\n            \"note\",\n            \"attester\",\n            \"custodian\",\n            \"relatesTo\",\n            \"event\",\n            \"section\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Composition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"status\",\n            \"type\",\n            \"category\",\n            \"subject\",\n            \"encounter\",\n            \"date\",\n            \"useContext\",\n            \"author\",\n            \"name\",\n            \"title\",\n            \"custodian\",\n            \"event\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"date\", \"date__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"title\", \"title__ext\"),\n        ]\n        return required_fields\n\n\nclass CompositionAttester(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Attests to accuracy of composition.\n    A participant who has attested to the accuracy of the composition/document.\n    \"\"\"\n\n    __resource_type__ = \"CompositionAttester\"\n\n    mode: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"mode\",\n        title=\"personal | professional | legal | official\",\n        description=\"The type of attestation the authenticator offers.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    party: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"party\",\n        title=\"Who attested the composition\",\n        description=\"Who attested the composition in the specified way.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    time: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"time\",\n        title=\"When the composition was attested\",\n        description=\"When the composition was attested by the party.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_time\", title=\"Extension field for ``time``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompositionAttester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"mode\", \"time\", \"party\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompositionAttester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CompositionEvent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The clinical service(s) being documented.\n    The clinical service, such as a colonoscopy or an appendectomy, being\n    documented.\n    \"\"\"\n\n    __resource_type__ = \"CompositionEvent\"\n\n    detail: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"The event(s) being documented, as code(s), reference(s), or both\",\n        description=(\n            \"Represents the main clinical acts, such as a colonoscopy or an \"\n            \"appendectomy, being documented. In some cases, the event is inherent \"\n            'in the typeCode, such as a \"History and Physical Report\" in which case'\n            ' the procedure being documented is necessarily a \"History and '\n            'Physical\" act. The events may be included as a code or as a reference '\n            \"to an other resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"The period covered by the documentation\",\n        description=(\n            \"The period of time covered by the documentation. There is no assertion\"\n            \" that the documentation is a complete representation for this period, \"\n            \"only that it documents events during this time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompositionEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"period\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompositionEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"period\", \"detail\"]\n\n\nclass CompositionSection(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Composition is broken into sections.\n    The root of the sections that make up the composition.\n    \"\"\"\n\n    __resource_type__ = \"CompositionSection\"\n\n    author: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who and/or what authored the section\",\n        description=(\n            \"Identifies who is responsible for the information in this section, not\"\n            \" necessarily who typed it in.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Classification of section (recommended)\",\n        description=(\n            \"A code identifying the kind of content contained within the section. \"\n            \"This must be consistent with the section title.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    emptyReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"emptyReason\",\n        title=\"Why the section is empty\",\n        description=(\n            \"If the section is empty, why the list is empty. An empty section \"\n            \"typically has some text explaining the empty reason.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entry: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"entry\",\n        title=\"A reference to data that supports this section\",\n        description=(\n            \"A reference to the actual resource from which the narrative in the \"\n            \"section is derived.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    focus: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=(\n            \"Who/what the section is about, when it is not about the subject of \"\n            \"composition\"\n        ),\n        description=(\n            \"The actual focus of the section when it is not the subject of the \"\n            \"composition, but instead represents something or someone associated \"\n            \"with the subject such as (for a patient subject) a spouse, parent, \"\n            \"fetus, or donor. If not focus is specified, the focus is assumed to be\"\n            \" focus of the parent section, or, for a section in the Composition \"\n            \"itself, the subject of the composition. Sections with a focus SHALL \"\n            \"only include resources where the logical subject (patient, subject, \"\n            \"focus, etc.) matches the section focus, or the resources have no \"\n            \"logical subject (few resources).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    orderedBy: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"orderedBy\",\n        title=\"Order of section entries\",\n        description=\"Specifies the order applied to the items in the section entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    section: typing.List[fhirtypes.CompositionSectionType] | None = Field(\n        default=None,\n        alias=\"section\",\n        title=\"Nested Section\",\n        description=\"A nested sub-section within this section.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.NarrativeType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text summary of the section, for human interpretation\",\n        description=(\n            \"A human-readable narrative that contains the attested content of the \"\n            \"section, used to represent the content of the resource to a human. The\"\n            \" narrative need not encode all the structured data, but is required to\"\n            ' contain sufficient detail to make it \"clinically safe\" for a human to'\n            \" just read the narrative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label for section (e.g. for ToC)\",\n        description=(\n            \"The label for this particular section.  This will be part of the \"\n            \"rendered content for the document, and is often used to build a table \"\n            \"of contents.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CompositionSection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"title\",\n            \"code\",\n            \"author\",\n            \"focus\",\n            \"text\",\n            \"orderedBy\",\n            \"entry\",\n            \"emptyReason\",\n            \"section\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CompositionSection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/conceptmap.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ConceptMap\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ConceptMap(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A map from one set of concepts to one or more other concepts.\n    A statement of relationships from one set of concepts to one or more other\n    concepts - either concepts in code systems, or data element/data element\n    concepts, or classes in class models.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMap\"\n\n    additionalAttribute: typing.List[\n        fhirtypes.ConceptMapAdditionalAttributeType\n    ] | None = Field(\n        default=None,\n        alias=\"additionalAttribute\",\n        title=(\n            \"Definition of an additional attribute to act as a data source or \" \"target\"\n        ),\n        description=(\n            \"An additionalAttribute defines an additional data element found in the\"\n            \" source or target data model where the data will come from or be \"\n            \"mapped to. Some mappings are based on data in addition to the source \"\n            \"data element, where codes in multiple fields are combined to a single \"\n            \"field (or vice versa).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the ConceptMap was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the ConceptMap\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the ConceptMap.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the concept map and/or its contents.\"\n            \" Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the concept map was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the concept map \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the concept map\",\n        description=(\n            \"A free text natural language description of the concept map from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the ConceptMap\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the ConceptMap.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the ConceptMap is expected to be used\",\n        description=(\n            \"The period during which the ConceptMap content was or is planned to be\"\n            \" in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the ConceptMap\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"responsible for officially endorsing the ConceptMap for use in some \"\n            \"setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this concept map is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    group: typing.List[fhirtypes.ConceptMapGroupType] | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"Same source and target systems\",\n        description=\"A group of mappings that all have the same source and target system.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the concept map\",\n        description=(\n            \"A formal identifier that is used to identify this concept map when it \"\n            \"is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for concept map (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the concept map is intended to \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the ConceptMap was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this concept map (computer friendly)\",\n        description=(\n            \"A natural language name identifying the concept map. This name should \"\n            \"be usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    property: typing.List[fhirtypes.ConceptMapPropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Additional properties of the mapping\",\n        description=(\n            \"A property defines a slot through which additional information can be \"\n            \"provided about a map from source -> target.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this concept map is defined\",\n        description=(\n            \"Explanation of why this concept map is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, \"\n            \"dependencies, bibliographic references, and predecessor and successor \"\n            \"artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the ConceptMap\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"primarily responsible for review of some aspect of the ConceptMap.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sourceScopeCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"sourceScopeCanonical\",\n        title=\"The source value set that contains the concepts that are being mapped\",\n        description=(\n            \"Identifier for the source value set that contains the concepts that \"\n            \"are being mapped and provides context for the mappings.  Limits the \"\n            \"scope of the map to source codes (ConceptMap.group.element code or \"\n            \"valueSet) that are members of this value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e sourceScope[x]\n            \"one_of_many\": \"sourceScope\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    sourceScopeCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sourceScopeCanonical\",\n        title=\"Extension field for ``sourceScopeCanonical``.\",\n    )\n\n    sourceScopeUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"sourceScopeUri\",\n        title=\"The source value set that contains the concepts that are being mapped\",\n        description=(\n            \"Identifier for the source value set that contains the concepts that \"\n            \"are being mapped and provides context for the mappings.  Limits the \"\n            \"scope of the map to source codes (ConceptMap.group.element code or \"\n            \"valueSet) that are members of this value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e sourceScope[x]\n            \"one_of_many\": \"sourceScope\",\n            \"one_of_many_required\": False,\n        },\n    )\n    sourceScopeUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sourceScopeUri\",\n        title=\"Extension field for ``sourceScopeUri``.\",\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this concept map. Enables tracking the life-cycle of the\"\n            \" content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    targetScopeCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"targetScopeCanonical\",\n        title=\"The target value set which provides context for the mappings\",\n        description=(\n            \"Identifier for the target value set that provides important context \"\n            \"about how the mapping choices are made.  Limits the scope of the map \"\n            \"to target codes (ConceptMap.group.element.target code or valueSet) \"\n            \"that are members of this value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e targetScope[x]\n            \"one_of_many\": \"targetScope\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    targetScopeCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_targetScopeCanonical\",\n        title=\"Extension field for ``targetScopeCanonical``.\",\n    )\n\n    targetScopeUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"targetScopeUri\",\n        title=\"The target value set which provides context for the mappings\",\n        description=(\n            \"Identifier for the target value set that provides important context \"\n            \"about how the mapping choices are made.  Limits the scope of the map \"\n            \"to target codes (ConceptMap.group.element.target code or valueSet) \"\n            \"that are members of this value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e targetScope[x]\n            \"one_of_many\": \"targetScope\",\n            \"one_of_many_required\": False,\n        },\n    )\n    targetScopeUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_targetScopeUri\",\n        title=\"Extension field for ``targetScopeUri``.\",\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this concept map (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the concept map.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptions related to the content of the ConceptMap. Topics provide \"\n            \"a high-level categorization as well as keywords for the ConceptMap \"\n            \"that can be useful for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this concept map, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this concept map when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" concept map is (or will be) published. This URL can be the target of \"\n            \"a canonical reference. It SHALL remain the same when the concept map \"\n            \"is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate concept map instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the concept map\",\n        description=(\n            \"The identifier that is used to identify this version of the concept \"\n            \"map when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the concept map author\"\n            \" and is not expected to be globally unique. For example, it might be a\"\n            \" timestamp (e.g. yyyymmdd) if a managed version is not available. \"\n            \"There is also no expectation that versions can be placed in a \"\n            \"lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which \"\n            \"ConceptMap is more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which \"\n            \"ConceptMap is more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMap`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"property\",\n            \"additionalAttribute\",\n            \"sourceScopeUri\",\n            \"sourceScopeCanonical\",\n            \"targetScopeUri\",\n            \"targetScopeCanonical\",\n            \"group\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMap`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"property\",\n            \"additionalAttribute\",\n            \"sourceScopeUri\",\n            \"sourceScopeCanonical\",\n            \"targetScopeUri\",\n            \"targetScopeCanonical\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"sourceScope\": [\"sourceScopeCanonical\", \"sourceScopeUri\"],\n            \"targetScope\": [\"targetScopeCanonical\", \"targetScopeUri\"],\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"],\n        }\n        return one_of_many_fields\n\n\nclass ConceptMapAdditionalAttribute(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of an additional attribute to act as a data source or target.\n    An additionalAttribute defines an additional data element found in the\n    source or target data model where the data will come from or be mapped to.\n    Some mappings are based on data in addition to the source data element,\n    where codes in multiple fields are combined to a single field (or vice\n    versa).\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapAdditionalAttribute\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Identifies this additional attribute through this resource\",\n        description=(\n            \"A code that is used to identify this additional data attribute. The \"\n            \"code is used internally in \"\n            \"ConceptMap.group.element.target.dependsOn.attribute and \"\n            \"ConceptMap.group.element.target.product.attribute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=(\n            \"Why the additional attribute is defined, and/or what the data element \"\n            \"it refers to is\"\n        ),\n        description=(\n            \"A description of the additional attribute and/or the data element it \"\n            \"refers to - why it is defined, and how the value might be used in \"\n            \"mappings, and a discussion of issues associated with the use of the \"\n            \"data element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"code | Coding | string | boolean | Quantity\",\n        description=(\n            \"The type of the source data contained in this concept map for this \"\n            \"data element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"code\", \"Coding\", \"string\", \"boolean\", \"Quantity\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Formal identifier for the data element referred to in this attribte\",\n        description=(\n            \"Reference to the formal definition of the source/target data element. \"\n            \"For elements defined by the FHIR specification, or using a FHIR \"\n            \"logical model, the correct format is {canonical-url}#{element-id}.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapAdditionalAttribute`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"uri\",\n            \"description\",\n            \"type\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapAdditionalAttribute`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"uri\", \"description\", \"type\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass ConceptMapGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Same source and target systems.\n    A group of mappings that all have the same source and target system.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroup\"\n\n    element: typing.List[fhirtypes.ConceptMapGroupElementType] = Field(\n        default=...,\n        alias=\"element\",\n        title=\"Mappings for a concept from the source set\",\n        description=(\n            \"Mappings for an individual concept in the source to one or more \"\n            \"concepts in the target.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    source: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Source system where concepts to be mapped are defined\",\n        description=(\n            \"An absolute URI that identifies the source system where the concepts \"\n            \"to be mapped are defined.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CodeSystem\"],\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    target: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Target system that the concepts are to be mapped to\",\n        description=(\n            \"An absolute URI that identifies the target system that the concepts \"\n            \"will be mapped to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CodeSystem\"],\n        },\n    )\n    target__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_target\", title=\"Extension field for ``target``.\"\n    )\n\n    unmapped: fhirtypes.ConceptMapGroupUnmappedType | None = Field(\n        default=None,\n        alias=\"unmapped\",\n        title=(\n            \"What to do when there is no mapping target for the source concept and \"\n            \"ConceptMap.group.element.noMap is not true\"\n        ),\n        description=(\n            \"What to do when there is no mapping to a target concept from the \"\n            \"source concept and ConceptMap.group.element.noMap is not true. This \"\n            'provides the \"default\" to be applied when there is no target concept '\n            \"mapping specified or the expansion of \"\n            \"ConceptMap.group.element.target.valueSet is empty.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"source\",\n            \"target\",\n            \"element\",\n            \"unmapped\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConceptMapGroupElement(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Mappings for a concept from the source set.\n    Mappings for an individual concept in the source to one or more concepts in\n    the target.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupElement\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Identifies element being mapped\",\n        description=\"Identity (code or path) or the element/item being mapped.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Display for the code\",\n        description=(\n            \"The display for the code. The display is only provided to help editors\"\n            \" when editing the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    noMap: bool | None = Field(\n        default=None,\n        alias=\"noMap\",\n        title=\"No mapping to a target concept for this source concept\",\n        description=(\n            \"If noMap = true this indicates that no mapping to a target concept \"\n            \"exists for this source concept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noMap__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_noMap\", title=\"Extension field for ``noMap``.\"\n    )\n\n    target: typing.List[fhirtypes.ConceptMapGroupElementTargetType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Concept in target system for element\",\n        description=\"A concept from the target value set that this concept maps to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Identifies the set of concepts being mapped\",\n        description=(\n            \"The set of concepts from the ConceptMap.group.source code system which\"\n            \" are all being mapped to the target as part of this mapping rule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"display\",\n            \"valueSet\",\n            \"noMap\",\n            \"target\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConceptMapGroupElementTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Concept in target system for element.\n    A concept from the target value set that this concept maps to.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupElementTarget\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies the target element\",\n        description=\"Identity (code or path) or the element/item that the map refers to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Description of status/issues in mapping\",\n        description=(\n            \"A description of status/issues in mapping that conveys additional \"\n            \"information not represented in  the structured data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    dependsOn: typing.List[\n        fhirtypes.ConceptMapGroupElementTargetDependsOnType\n    ] | None = Field(\n        default=None,\n        alias=\"dependsOn\",\n        title=\"Other properties required for this mapping\",\n        description=(\n            \"A set of additional dependencies for this mapping to hold. This \"\n            \"mapping is only applicable if the specified data attribute can be \"\n            \"resolved, and it has the specified value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Display for the code\",\n        description=(\n            \"The display for the code. The display is only provided to help editors\"\n            \" when editing the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    product: typing.List[\n        fhirtypes.ConceptMapGroupElementTargetDependsOnType\n    ] | None = Field(\n        default=None,\n        alias=\"product\",\n        title=\"Other data elements that this mapping also produces\",\n        description=(\n            \"Product is the output of a ConceptMap that provides additional values \"\n            \"that go in other attributes / data elemnts of the target data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    property: typing.List[\n        fhirtypes.ConceptMapGroupElementTargetPropertyType\n    ] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Property value for the source -> target mapping\",\n        description=\"A property value for this source -> target mapping.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=(\n            \"related-to | equivalent | source-is-narrower-than-target | source-is-\"\n            \"broader-than-target | not-related-to\"\n        ),\n        description=(\n            \"The relationship between the source and target concepts. The \"\n            \"relationship is read from source to target (e.g. source-is-narrower-\"\n            \"than-target).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"related-to\",\n                \"equivalent\",\n                \"source-is-narrower-than-target\",\n                \"source-is-broader-than-target\",\n                \"not-related-to\",\n            ],\n        },\n    )\n    relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relationship\",\n        title=\"Extension field for ``relationship``.\",\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Identifies the set of target concepts\",\n        description=(\n            \"The set of concepts from the ConceptMap.group.target code system which\"\n            \" are all being mapped to as part of this mapping rule. The effect of \"\n            \"using this data element is the same as having multiple \"\n            \"ConceptMap.group.element.target elements with one for each concept in \"\n            \"the ConceptMap.group.element.target.valueSet value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupElementTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"display\",\n            \"valueSet\",\n            \"relationship\",\n            \"comment\",\n            \"property\",\n            \"dependsOn\",\n            \"product\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"relationship\", \"relationship__ext\")]\n        return required_fields\n\n\nclass ConceptMapGroupElementTargetDependsOn(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Other properties required for this mapping.\n    A set of additional dependencies for this mapping to hold. This mapping is\n    only applicable if the specified data attribute can be resolved, and it has\n    the specified value.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupElementTargetDependsOn\"\n\n    attribute: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"attribute\",\n        title=(\n            \"A reference to a mapping attribute defined in \"\n            \"ConceptMap.additionalAttribute\"\n        ),\n        description=(\n            \"A reference to the additional attribute that holds a value the map \"\n            \"depends on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    attribute__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_attribute\", title=\"Extension field for ``attribute``.\"\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of the referenced data element\",\n        description=\"Data element value that the map depends on / produces.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of the referenced data element\",\n        description=\"Data element value that the map depends on / produces.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of the referenced data element\",\n        description=\"Data element value that the map depends on / produces.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of the referenced data element\",\n        description=\"Data element value that the map depends on / produces.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"The mapping depends on a data element with a value from this value set\",\n        description=(\n            \"This mapping applies if the data element value is a code from this \"\n            \"value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of the referenced data element\",\n        description=\"Data element value that the map depends on / produces.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupElementTargetDependsOn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"attribute\",\n            \"valueCode\",\n            \"valueCoding\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueQuantity\",\n            \"valueSet\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTargetDependsOn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"attribute\", \"attribute__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueCoding\",\n                \"valueQuantity\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ConceptMapGroupElementTargetProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Property value for the source -> target mapping.\n    A property value for this source -> target mapping.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupElementTargetProperty\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Reference to ConceptMap.property.code\",\n        description=\"A reference to a mapping property defined in ConceptMap.property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of the property for this concept\",\n        description=(\n            \"The value of this property. If the type chosen for this element is \"\n            \"'code', then the property SHALL be defined in a ConceptMap.property \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of the property for this concept\",\n        description=(\n            \"The value of this property. If the type chosen for this element is \"\n            \"'code', then the property SHALL be defined in a ConceptMap.property \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of the property for this concept\",\n        description=(\n            \"The value of this property. If the type chosen for this element is \"\n            \"'code', then the property SHALL be defined in a ConceptMap.property \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of the property for this concept\",\n        description=(\n            \"The value of this property. If the type chosen for this element is \"\n            \"'code', then the property SHALL be defined in a ConceptMap.property \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of the property for this concept\",\n        description=(\n            \"The value of this property. If the type chosen for this element is \"\n            \"'code', then the property SHALL be defined in a ConceptMap.property \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of the property for this concept\",\n        description=(\n            \"The value of this property. If the type chosen for this element is \"\n            \"'code', then the property SHALL be defined in a ConceptMap.property \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of the property for this concept\",\n        description=(\n            \"The value of this property. If the type chosen for this element is \"\n            \"'code', then the property SHALL be defined in a ConceptMap.property \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupElementTargetProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCoding\",\n            \"valueString\",\n            \"valueInteger\",\n            \"valueBoolean\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueCode\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupElementTargetProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueCoding\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ConceptMapGroupUnmapped(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What to do when there is no mapping target for the source concept and\n    ConceptMap.group.element.noMap is not true.\n    What to do when there is no mapping to a target concept from the source\n    concept and ConceptMap.group.element.noMap is not true. This provides the\n    \"default\" to be applied when there is no target concept mapping specified\n    or the expansion of ConceptMap.group.element.target.valueSet is empty.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapGroupUnmapped\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Fixed code when mode = fixed\",\n        description=(\n            \"The fixed code to use when the mode = 'fixed'  - all unmapped codes \"\n            \"are mapped to a single fixed code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Display for the code\",\n        description=(\n            \"The display for the code. The display is only provided to help editors\"\n            \" when editing the concept map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"use-source-code | fixed | other-map\",\n        description=(\n            \"Defines which action to take if there is no match for the source \"\n            \"concept in the target system designated for the group. One of 3 \"\n            \"actions are possible: use the unmapped source code (this is useful \"\n            \"when doing a mapping between versions, and only a few codes have \"\n            \"changed), use a fixed code (a default code), or alternatively, a \"\n            \"reference to a different concept map can be provided (by canonical \"\n            \"URL).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"use-source-code\", \"fixed\", \"other-map\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    otherMap: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"otherMap\",\n        title=(\n            \"canonical reference to an additional ConceptMap to use for mapping if \"\n            \"the source concept is unmapped\"\n        ),\n        description=(\n            \"The canonical reference to an additional ConceptMap resource instance \"\n            \"to use for mapping if this ConceptMap resource contains no matching \"\n            \"mapping for the source concept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ConceptMap\"],\n        },\n    )\n    otherMap__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_otherMap\", title=\"Extension field for ``otherMap``.\"\n    )\n\n    relationship: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=(\n            \"related-to | equivalent | source-is-narrower-than-target | source-is-\"\n            \"broader-than-target | not-related-to\"\n        ),\n        description=(\n            \"The default relationship value to apply between the source and target \"\n            \"concepts when the source code is unmapped and the mode is 'fixed' or \"\n            \"'use-source-code'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"related-to\",\n                \"equivalent\",\n                \"source-is-narrower-than-target\",\n                \"source-is-broader-than-target\",\n                \"not-related-to\",\n            ],\n        },\n    )\n    relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relationship\",\n        title=\"Extension field for ``relationship``.\",\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Fixed code set when mode = fixed\",\n        description=(\n            \"The set of fixed codes to use when the mode = 'fixed'  - all unmapped \"\n            \"codes are mapped to each of the fixed codes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapGroupUnmapped`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"mode\",\n            \"code\",\n            \"display\",\n            \"valueSet\",\n            \"relationship\",\n            \"otherMap\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapGroupUnmapped`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\")]\n        return required_fields\n\n\nclass ConceptMapProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional properties of the mapping.\n    A property defines a slot through which additional information can be\n    provided about a map from source -> target.\n    \"\"\"\n\n    __resource_type__ = \"ConceptMapProperty\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"Identifies the property on the mappings, and when referred to in the \"\n            \"$translate operation\"\n        ),\n        description=(\n            \"A code that is used to identify the property. The code is used \"\n            \"internally (in ConceptMap.group.element.target.property.code) and also\"\n            \" in the $translate operation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Why the property is defined, and/or what it conveys\",\n        description=(\n            \"A description of the property - why it is defined, and how its value \"\n            \"might be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    system: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"The CodeSystem from which code values come\",\n        description=(\n            \"The CodeSystem that defines the codes from which values of type \"\n            \"```code``` in property values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CodeSystem\"],\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Coding | string | integer | boolean | dateTime | decimal | code\",\n        description=\"The type of the property value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"Coding\",\n                \"string\",\n                \"integer\",\n                \"boolean\",\n                \"dateTime\",\n                \"decimal\",\n                \"code\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Formal identifier for the property\",\n        description=\"Reference to the formal meaning of the property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConceptMapProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"uri\",\n            \"description\",\n            \"type\",\n            \"system\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConceptMapProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"uri\", \"description\", \"type\", \"system\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/condition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Condition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Condition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Detailed information about conditions, problems or diagnoses.\n    A clinical condition, problem, diagnosis, or other event, situation, issue,\n    or clinical concept that has risen to a level of concern.\n    \"\"\"\n\n    __resource_type__ = \"Condition\"\n\n    abatementAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"abatementAge\",\n        title=\"When in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Some '\n            \"conditions, such as chronic conditions, are never really resolved, but\"\n            \" they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    abatementDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"abatementDateTime\",\n        title=\"When in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Some '\n            \"conditions, such as chronic conditions, are never really resolved, but\"\n            \" they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n    abatementDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_abatementDateTime\",\n        title=\"Extension field for ``abatementDateTime``.\",\n    )\n\n    abatementPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"abatementPeriod\",\n        title=\"When in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Some '\n            \"conditions, such as chronic conditions, are never really resolved, but\"\n            \" they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    abatementRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"abatementRange\",\n        title=\"When in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Some '\n            \"conditions, such as chronic conditions, are never really resolved, but\"\n            \" they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    abatementString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"abatementString\",\n        title=\"When in resolution/remission\",\n        description=(\n            \"The date or estimated date that the condition resolved or went into \"\n            'remission. This is called \"abatement\" because of the many overloaded '\n            'connotations associated with \"remission\" or \"resolution\" - Some '\n            \"conditions, such as chronic conditions, are never really resolved, but\"\n            \" they can abate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e abatement[x]\n            \"one_of_many\": \"abatement\",\n            \"one_of_many_required\": False,\n        },\n    )\n    abatementString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_abatementString\",\n        title=\"Extension field for ``abatementString``.\",\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical location, if relevant\",\n        description=\"The anatomical location where this condition manifests itself.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"problem-list-item | encounter-diagnosis\",\n        description=\"A category assigned to the condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    clinicalStatus: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"clinicalStatus\",\n        title=(\n            \"active | recurrence | relapse | inactive | remission | resolved | \"\n            \"unknown\"\n        ),\n        description=\"The clinical status of the condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Identification of the condition, problem or diagnosis\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"The Encounter during which this Condition was created\",\n        description=(\n            \"The Encounter during which this Condition was created or to which the \"\n            \"creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    evidence: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"evidence\",\n        title=\"Supporting evidence for the verification status\",\n        description=(\n            \"Supporting evidence / manifestations that are the basis of the \"\n            \"Condition's verification status, such as evidence that confirmed or \"\n            \"refuted the condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this condition\",\n        description=(\n            \"Business identifiers assigned to this condition by the performer or \"\n            \"other systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional information about the Condition\",\n        description=(\n            \"Additional information about the Condition. This is a general \"\n            \"notes/comments entry  for description of the Condition, its diagnosis \"\n            \"and prognosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onsetAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"onsetAge\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"onsetDateTime\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_onsetDateTime\",\n        title=\"Extension field for ``onsetDateTime``.\",\n    )\n\n    onsetPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"onsetPeriod\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"onsetRange\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"onsetString\",\n        title=\"Estimated or actual date,  date-time, or age\",\n        description=(\n            \"Estimated or actual date or date-time  the condition began, in the \"\n            \"opinion of the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onsetString\", title=\"Extension field for ``onsetString``.\"\n    )\n\n    participant: typing.List[fhirtypes.ConditionParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=(\n            \"Who or what participated in the activities related to the condition \"\n            \"and how they were involved\"\n        ),\n        description=(\n            \"Indicates who or what participated in the activities related to the \"\n            \"condition and how they were involved.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    recordedDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recordedDate\",\n        title=\"Date condition was first recorded\",\n        description=(\n            \"The recordedDate represents when this particular Condition record was \"\n            \"created in the system, which is often a system-generated date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    recordedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_recordedDate\",\n        title=\"Extension field for ``recordedDate``.\",\n    )\n\n    severity: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"Subjective severity of condition\",\n        description=(\n            \"A subjective assessment of the severity of the condition as evaluated \"\n            \"by the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    stage: typing.List[fhirtypes.ConditionStageType] | None = Field(\n        default=None,\n        alias=\"stage\",\n        title=\"Stage/grade, usually assessed formally\",\n        description=(\n            'A simple summary of the stage such as \"Stage 3\" or \"Early Onset\". The '\n            \"determination of the stage is disease-specific, such as cancer, \"\n            \"retinopathy of prematurity, kidney diseases, Alzheimer's, or Parkinson\"\n            \" disease.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who has the condition?\",\n        description=(\n            \"Indicates the patient or group who the condition record is associated \"\n            \"with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    verificationStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"verificationStatus\",\n        title=(\n            \"unconfirmed | provisional | differential | confirmed | refuted | \"\n            \"entered-in-error\"\n        ),\n        description=(\n            \"The verification status to support the clinical status of the \"\n            \"condition.  The verification status pertains to the condition, itself,\"\n            \" not to any specific condition attribute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Condition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"clinicalStatus\",\n            \"verificationStatus\",\n            \"category\",\n            \"severity\",\n            \"code\",\n            \"bodySite\",\n            \"subject\",\n            \"encounter\",\n            \"onsetDateTime\",\n            \"onsetAge\",\n            \"onsetPeriod\",\n            \"onsetRange\",\n            \"onsetString\",\n            \"abatementDateTime\",\n            \"abatementAge\",\n            \"abatementPeriod\",\n            \"abatementRange\",\n            \"abatementString\",\n            \"recordedDate\",\n            \"participant\",\n            \"stage\",\n            \"evidence\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Condition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"clinicalStatus\",\n            \"verificationStatus\",\n            \"code\",\n            \"bodySite\",\n            \"subject\",\n            \"encounter\",\n            \"onsetDateTime\",\n            \"onsetAge\",\n            \"onsetPeriod\",\n            \"onsetRange\",\n            \"onsetString\",\n            \"recordedDate\",\n            \"participant\",\n            \"evidence\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"abatement\": [\n                \"abatementAge\",\n                \"abatementDateTime\",\n                \"abatementPeriod\",\n                \"abatementRange\",\n                \"abatementString\",\n            ],\n            \"onset\": [\n                \"onsetAge\",\n                \"onsetDateTime\",\n                \"onsetPeriod\",\n                \"onsetRange\",\n                \"onsetString\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ConditionParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who or what participated in the activities related to the condition and how\n    they were involved.\n    Indicates who or what participated in the activities related to the\n    condition and how they were involved.\n    \"\"\"\n\n    __resource_type__ = \"ConditionParticipant\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Who or what participated in the activities related to the condition\",\n        description=(\n            \"Indicates who or what participated in the activities related to the \"\n            \"condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of involvement\",\n        description=(\n            \"Distinguishes the type of involvement of the actor in the activities \"\n            \"related to the condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConditionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConditionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n\n\nclass ConditionStage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stage/grade, usually assessed formally.\n    A simple summary of the stage such as \"Stage 3\" or \"Early Onset\". The\n    determination of the stage is disease-specific, such as cancer, retinopathy\n    of prematurity, kidney diseases, Alzheimer's, or Parkinson disease.\n    \"\"\"\n\n    __resource_type__ = \"ConditionStage\"\n\n    assessment: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"assessment\",\n        title=\"Formal record of assessment\",\n        description=(\n            \"Reference to a formal record of the evidence on which the staging \"\n            \"assessment is based.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"ClinicalImpression\",\n                \"DiagnosticReport\",\n                \"Observation\",\n            ],\n        },\n    )\n\n    summary: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"summary\",\n        title=\"Simple summary (disease specific)\",\n        description=(\n            'A simple summary of the stage such as \"Stage 3\" or \"Early Onset\". The '\n            \"determination of the stage is disease-specific, such as cancer, \"\n            \"retinopathy of prematurity, kidney diseases, Alzheimer's, or Parkinson\"\n            \" disease.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of staging\",\n        description=\"The kind of staging, such as pathological or clinical staging.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConditionStage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"summary\", \"assessment\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConditionStage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/conditiondefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ConditionDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ConditionDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A definition of a condition.\n    A definition of a condition and information relevant to managing it.\n    \"\"\"\n\n    __resource_type__ = \"ConditionDefinition\"\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical location, if relevant\",\n        description=\"The anatomical location where this condition manifests itself.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Identification of the condition, problem or diagnosis\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the condition definition was last\"\n            \" significantly changed. The date must change when the business version\"\n            \" changes and it must change if the status code changes. In addition, \"\n            \"it should change when the substantive content of the condition \"\n            \"definition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    definition: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Formal Definition for the condition\",\n        description=(\n            \"Formal definitions of the condition. These may be references to \"\n            \"ontologies, published clinical protocols or research papers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the condition definition\",\n        description=(\n            \"A free text natural language description of the condition definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this condition definition is authored\"\n            \" for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    hasBodySite: bool | None = Field(\n        default=None,\n        alias=\"hasBodySite\",\n        title=\"Whether bodySite is appropriate\",\n        description=\"Whether bodySite is appropriate to collect for this condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    hasBodySite__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_hasBodySite\", title=\"Extension field for ``hasBodySite``.\"\n    )\n\n    hasSeverity: bool | None = Field(\n        default=None,\n        alias=\"hasSeverity\",\n        title=\"Whether Severity is appropriate\",\n        description=\"Whether Severity is appropriate to collect for this condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    hasSeverity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_hasSeverity\", title=\"Extension field for ``hasSeverity``.\"\n    )\n\n    hasStage: bool | None = Field(\n        default=None,\n        alias=\"hasStage\",\n        title=\"Whether stage is appropriate\",\n        description=\"Whether stage is appropriate to collect for this condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    hasStage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_hasStage\", title=\"Extension field for ``hasStage``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the condition definition\",\n        description=(\n            \"A formal identifier that is used to identify this condition definition\"\n            \" when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for condition definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the condition definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    medication: typing.List[fhirtypes.ConditionDefinitionMedicationType] | None = Field(\n        default=None,\n        alias=\"medication\",\n        title=\"Medications particularly relevant for this condition\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this condition definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the condition definition. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    observation: typing.List[\n        fhirtypes.ConditionDefinitionObservationType\n    ] | None = Field(\n        default=None,\n        alias=\"observation\",\n        title=\"Observations particularly relevant to this condition\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    plan: typing.List[fhirtypes.ConditionDefinitionPlanType] | None = Field(\n        default=None,\n        alias=\"plan\",\n        title=\"Plan that is appropriate\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    precondition: typing.List[\n        fhirtypes.ConditionDefinitionPreconditionType\n    ] | None = Field(\n        default=None,\n        alias=\"precondition\",\n        title=\"Observation that suggets this condition\",\n        description=\"An observation that suggests that this condition applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the condition definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    questionnaire: typing.List[\n        fhirtypes.ConditionDefinitionQuestionnaireType\n    ] | None = Field(\n        default=None,\n        alias=\"questionnaire\",\n        title=\"Questionnaire for this condition\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    severity: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"Subjective severity of condition\",\n        description=(\n            \"A subjective assessment of the severity of the condition as evaluated \"\n            \"by the clinician.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    stage: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"stage\",\n        title=\"Stage/grade, usually assessed formally\",\n        description=(\n            \"Clinical stage or grade of a condition. May include formal severity \"\n            \"assessments.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this condition definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the event definition\",\n        description=(\n            \"An explanatory or alternate title for the event definition giving \"\n            \"additional information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    team: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"team\",\n        title=\"Appropriate team for this condition\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CareTeam\"],\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this condition definition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the condition \" \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this condition definition, represented as a \"\n            \"URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this condition definition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which an \"\n            \"authoritative instance of this condition definition is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the condition definition is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate condition definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the condition definition\",\n        description=(\n            \"The identifier that is used to identify this version of the condition \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the condition \"\n            \"definition author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConditionDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"code\",\n            \"severity\",\n            \"bodySite\",\n            \"stage\",\n            \"hasSeverity\",\n            \"hasBodySite\",\n            \"hasStage\",\n            \"definition\",\n            \"observation\",\n            \"medication\",\n            \"precondition\",\n            \"team\",\n            \"questionnaire\",\n            \"plan\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConditionDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"code\",\n            \"severity\",\n            \"bodySite\",\n            \"stage\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass ConditionDefinitionMedication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Medications particularly relevant for this condition.\n    \"\"\"\n\n    __resource_type__ = \"ConditionDefinitionMedication\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Category that is relevant\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code for relevant Medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConditionDefinitionMedication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"category\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConditionDefinitionMedication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConditionDefinitionObservation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Observations particularly relevant to this condition.\n    \"\"\"\n\n    __resource_type__ = \"ConditionDefinitionObservation\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Category that is relevant\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code for relevant Observation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConditionDefinitionObservation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"category\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConditionDefinitionObservation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConditionDefinitionPlan(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Plan that is appropriate.\n    \"\"\"\n\n    __resource_type__ = \"ConditionDefinitionPlan\"\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"The actual plan\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PlanDefinition\"],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Use for the plan\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConditionDefinitionPlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConditionDefinitionPlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConditionDefinitionPrecondition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Observation that suggets this condition.\n    An observation that suggests that this condition applies.\n    \"\"\"\n\n    __resource_type__ = \"ConditionDefinitionPrecondition\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Code for relevant Observation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"sensitive | specific\",\n        description=\"Kind of pre-condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"sensitive\", \"specific\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of Observation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of Observation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConditionDefinitionPrecondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConditionDefinitionPrecondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"value\": [\"valueCodeableConcept\", \"valueQuantity\"]}\n        return one_of_many_fields\n\n\nclass ConditionDefinitionQuestionnaire(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Questionnaire for this condition.\n    \"\"\"\n\n    __resource_type__ = \"ConditionDefinitionQuestionnaire\"\n\n    purpose: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"preadmit | diff-diagnosis | outcome\",\n        description=\"Use of the questionnaire.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"preadmit\", \"diff-diagnosis\", \"outcome\"],\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Specific Questionnaire\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Questionnaire\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConditionDefinitionQuestionnaire`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"purpose\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConditionDefinitionQuestionnaire`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"purpose\", \"purpose__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/consent.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Consent\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Consent(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A healthcare consumer's  or third party's choices to permit or deny\n    recipients or roles to perform actions for specific purposes and periods of\n    time.\n    A record of a healthcare consumer’s  choices  or choices made on their\n    behalf by a third party, which permits or denies identified recipient(s) or\n    recipient role(s) to perform one or more actions within a given policy\n    context, for specific purposes and periods of time.\n    \"\"\"\n\n    __resource_type__ = \"Consent\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classification of the consent statement - for indexing/retrieval\",\n        description=(\n            \"A classification of the type of consents found in the statement. This \"\n            \"element supports indexing and retrieval of consent statements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    controller: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"controller\",\n        title=\"Consent Enforcer\",\n        description=\"The actor that controls/enforces the access according to the consent.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"HealthcareService\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n            ],\n        },\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Fully executed date of the consent\",\n        description=\"Date the consent instance was agreed to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    decision: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"decision\",\n        title=\"deny | permit\",\n        description=\"Action to take - permit or deny - as default.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"deny\", \"permit\"],\n        },\n    )\n    decision__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_decision\", title=\"Extension field for ``decision``.\"\n    )\n\n    grantee: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"grantee\",\n        title=\"Who is agreeing to the policy and rules\",\n        description=(\n            \"The entity responsible for complying with the Consent Directive, \"\n            \"including any obligations or limitations on authorizations and \"\n            \"enforcement of prohibitions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"HealthcareService\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    grantor: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"grantor\",\n        title=\"Who is granting rights according to the policy and rules\",\n        description=(\n            \"The entity responsible for granting the rights listed in a Consent \"\n            \"Directive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"HealthcareService\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier for this record (external references)\",\n        description=\"Unique identifier for this copy of the Consent Statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    manager: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"manager\",\n        title=\"Consent workflow management\",\n        description=\"The actor that manages the consent through its lifecycle.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"HealthcareService\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n            ],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Effective period for this Consent\",\n        description=(\n            \"Effective period for this Consent Resource and all provisions unless \"\n            \"specified in that provision.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    policyBasis: fhirtypes.ConsentPolicyBasisType | None = Field(\n        default=None,\n        alias=\"policyBasis\",\n        title=\"Computable version of the backing policy\",\n        description=(\n            \"A Reference or URL used to uniquely identify the policy the \"\n            \"organization will enforce for this Consent. This Reference or URL \"\n            \"should be specific to the version of the policy and should be \"\n            \"dereferencable to a computable policy of some form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    policyText: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"policyText\",\n        title=\"Human Readable Policy\",\n        description=(\n            \"A Reference to the human readable policy explaining the basis for the \"\n            \"Consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    provision: typing.List[fhirtypes.ConsentProvisionType] | None = Field(\n        default=None,\n        alias=\"provision\",\n        title=\"Constraints to the base Consent.policyRule/Consent.policy\",\n        description=(\n            \"An exception to the base policy of this consent. An exception can be \"\n            \"an addition or removal of access permissions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    regulatoryBasis: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"regulatoryBasis\",\n        title=\"Regulations establishing base Consent\",\n        description=(\n            \"A set of codes that indicate the regulatory basis (if any) that this \"\n            \"consent supports.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sourceAttachment: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"sourceAttachment\",\n        title=\"Source from which this consent is taken\",\n        description=(\n            \"The source on which this consent statement is based. The source might \"\n            \"be a scanned original paper form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sourceReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"sourceReference\",\n        title=\"Source from which this consent is taken\",\n        description=(\n            \"A reference to a consent that links back to such a source, a reference\"\n            \" to a document repository (e.g. XDS) that stores the original consent \"\n            \"document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Consent\",\n                \"DocumentReference\",\n                \"Contract\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | inactive | not-done | entered-in-error | unknown\",\n        description=\"Indicates the current state of this Consent resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"inactive\",\n                \"not-done\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who the consent applies to\",\n        description=(\n            \"The patient/healthcare practitioner or group of persons to whom this \"\n            \"consent applies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\", \"Group\"],\n        },\n    )\n\n    verification: typing.List[fhirtypes.ConsentVerificationType] | None = Field(\n        default=None,\n        alias=\"verification\",\n        title=\"Consent Verified by patient or family\",\n        description=(\n            \"Whether a treatment instruction (e.g. artificial respiration: yes or \"\n            \"no) was verified with the patient, his/her family or another \"\n            \"authorized person.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Consent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"subject\",\n            \"date\",\n            \"period\",\n            \"grantor\",\n            \"grantee\",\n            \"manager\",\n            \"controller\",\n            \"sourceAttachment\",\n            \"sourceReference\",\n            \"regulatoryBasis\",\n            \"policyBasis\",\n            \"policyText\",\n            \"verification\",\n            \"decision\",\n            \"provision\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Consent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"subject\",\n            \"date\",\n            \"period\",\n            \"grantor\",\n            \"grantee\",\n            \"verification\",\n            \"decision\",\n            \"provision\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ConsentPolicyBasis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Computable version of the backing policy.\n    A Reference or URL used to uniquely identify the policy the organization\n    will enforce for this Consent. This Reference or URL should be specific to\n    the version of the policy and should be dereferencable to a computable\n    policy of some form.\n    \"\"\"\n\n    __resource_type__ = \"ConsentPolicyBasis\"\n\n    reference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Reference backing policy resource\",\n        description=(\n            \"A Reference that identifies the policy the organization will enforce \"\n            \"for this Consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    url: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"URL to a computable backing policy\",\n        description=(\n            \"A URL that links to a computable version of the policy the \"\n            \"organization will enforce for this Consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentPolicyBasis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"reference\", \"url\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentPolicyBasis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConsentProvision(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Constraints to the base Consent.policyRule/Consent.policy.\n    An exception to the base policy of this consent. An exception can be an\n    addition or removal of access permissions.\n    \"\"\"\n\n    __resource_type__ = \"ConsentProvision\"\n\n    action: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Actions controlled by this provision\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    actor: typing.List[fhirtypes.ConsentProvisionActorType] | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Who|what controlled by this provision (or group, by role)\",\n        description=(\n            \"Who or what is controlled by this provision. Use group to identify a \"\n            \"set of actors by some property they share (e.g. 'admitting officers').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"e.g. LOINC or SNOMED CT code, etc. in the content\",\n        description=\"If this code is found in an instance, then the provision applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    data: typing.List[fhirtypes.ConsentProvisionDataType] | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"Data controlled by this provision\",\n        description=(\n            \"The resources controlled by this provision if specific resources are \"\n            \"referenced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dataPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"dataPeriod\",\n        title=\"Timeframe for data controlled by this provision\",\n        description=(\n            \"Clinical or Operational Relevant period of time that bounds the data \"\n            \"controlled by this provision.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    documentType: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"documentType\",\n        title=\"e.g. Resource Type, Profile, CDA, etc\",\n        description=(\n            \"The documentType(s) covered by this provision. The type can be a CDA \"\n            \"document, or some other type that indicates what sort of information \"\n            \"the consent relates to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    expression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"A computable expression of the consent\",\n        description=(\n            \"A computable (FHIRPath or other) definition of what is controlled by \"\n            \"this consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Timeframe for this provision\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    provision: typing.List[fhirtypes.ConsentProvisionType] | None = Field(\n        default=None,\n        alias=\"provision\",\n        title=\"Nested Exception Provisions\",\n        description=(\n            \"Provisions which provide exceptions to the base provision or \"\n            \"subprovisions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    purpose: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Context of activities covered by this provision\",\n        description=(\n            \"The context of the activities a user is taking - why the user is \"\n            \"accessing the data - that are controlled by this provision.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resourceType: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"resourceType\",\n        title=\"e.g. Resource Type, Profile, etc\",\n        description=(\n            \"The resourceType(s) covered by this provision. The type can be a FHIR \"\n            \"resource type or a profile on a type that indicates what information \"\n            \"the consent relates to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Security Labels that define affected resources\",\n        description=(\n            \"A security label, comprised of 0..* security label fields (Privacy \"\n            \"tags), which define which resources are controlled by this exception.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentProvision`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"period\",\n            \"actor\",\n            \"action\",\n            \"securityLabel\",\n            \"purpose\",\n            \"documentType\",\n            \"resourceType\",\n            \"code\",\n            \"dataPeriod\",\n            \"data\",\n            \"expression\",\n            \"provision\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentProvision`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"period\",\n            \"action\",\n            \"securityLabel\",\n            \"purpose\",\n            \"documentType\",\n            \"resourceType\",\n            \"code\",\n            \"dataPeriod\",\n            \"data\",\n        ]\n\n\nclass ConsentProvisionActor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who|what controlled by this provision (or group, by role).\n    Who or what is controlled by this provision. Use group to identify a set of\n    actors by some property they share (e.g. 'admitting officers').\n    \"\"\"\n\n    __resource_type__ = \"ConsentProvisionActor\"\n\n    reference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Resource for the actor (or group, by role)\",\n        description=(\n            \"The resource that identifies the actor. To identify actors by type, \"\n            \"use group to identify a set of actors by some property they share \"\n            \"(e.g. 'admitting officers').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Group\",\n                \"CareTeam\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"How the actor is involved\",\n        description=(\n            \"How the individual is involved in the resources content that is \"\n            \"described in the exception.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentProvisionActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentProvisionActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ConsentProvisionData(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Data controlled by this provision.\n    The resources controlled by this provision if specific resources are\n    referenced.\n    \"\"\"\n\n    __resource_type__ = \"ConsentProvisionData\"\n\n    meaning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"meaning\",\n        title=\"instance | related | dependents | authoredby\",\n        description=(\n            \"How the resource reference is interpreted when testing consent \"\n            \"restrictions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"related\", \"dependents\", \"authoredby\"],\n        },\n    )\n    meaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_meaning\", title=\"Extension field for ``meaning``.\"\n    )\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"The actual data reference\",\n        description=(\n            \"A reference to a specific resource that defines which resources are \"\n            \"covered by this consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentProvisionData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"meaning\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentProvisionData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"meaning\", \"reference\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"meaning\", \"meaning__ext\")]\n        return required_fields\n\n\nclass ConsentVerification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Consent Verified by patient or family.\n    Whether a treatment instruction (e.g. artificial respiration: yes or no)\n    was verified with the patient, his/her family or another authorized person.\n    \"\"\"\n\n    __resource_type__ = \"ConsentVerification\"\n\n    verificationDate: typing.List[fhirtypes.DateTimeType | None] | None = Field(\n        default=None,\n        alias=\"verificationDate\",\n        title=\"When consent verified\",\n        description=\"Date(s) verification was collected.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    verificationDate__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_verificationDate\",\n        title=\"Extension field for ``verificationDate``.\",\n    )\n\n    verificationType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"verificationType\",\n        title=\"Business case of verification\",\n        description=(\n            \"Extensible list of verification type starting with verification and \"\n            \"re-validation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    verified: bool | None = Field(\n        default=None,\n        alias=\"verified\",\n        title=\"Has been verified\",\n        description=\"Has the instruction been verified.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    verified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_verified\", title=\"Extension field for ``verified``.\"\n    )\n\n    verifiedBy: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"verifiedBy\",\n        title=\"Person conducting verification\",\n        description=(\n            \"The person who conducted the verification/validation of the Grantor \"\n            \"decision.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    verifiedWith: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"verifiedWith\",\n        title=\"Person who verified\",\n        description=(\n            \"Who verified the instruction (Patient, Relative or other Authorized \"\n            \"Person).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ConsentVerification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"verified\",\n            \"verificationType\",\n            \"verifiedBy\",\n            \"verifiedWith\",\n            \"verificationDate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ConsentVerification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"verified\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"verified\", \"verified__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/contactdetail.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ContactDetail\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass ContactDetail(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contact information.\n    Specifies contact information for a person or organization.\n    \"\"\"\n\n    __resource_type__ = \"ContactDetail\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of an individual to contact\",\n        description=\"The name of an individual to contact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contact details for individual or organization\",\n        description=(\n            \"The contact details for the individual (if a name was provided) or the\"\n            \" organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContactDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"name\", \"telecom\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContactDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"name\", \"telecom\"]\n"
  },
  {
    "path": "fhir/resources/contactpoint.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ContactPoint\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass ContactPoint(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of a Technology mediated contact point (phone, fax, email, etc.).\n    Details for all kinds of technology mediated contact points for a person or\n    organization, including telephone, email, etc.\n    \"\"\"\n\n    __resource_type__ = \"ContactPoint\"\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when the contact point was/is in use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    rank: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"rank\",\n        title=\"Specify preferred order of use (1 = highest)\",\n        description=(\n            \"Specifies a preferred order in which to use a set of contacts. \"\n            \"ContactPoints with lower rank values are more preferred than those \"\n            \"with higher rank values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rank__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rank\", title=\"Extension field for ``rank``.\"\n    )\n\n    system: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"phone | fax | email | pager | url | sms | other\",\n        description=(\n            \"Telecommunications form for contact point - what communications system\"\n            \" is required to make use of the contact.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"phone\", \"fax\", \"email\", \"pager\", \"url\", \"sms\", \"other\"],\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"home | work | temp | old | mobile - purpose of this contact point\",\n        description=\"Identifies the purpose for the contact point.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"home\", \"work\", \"temp\", \"old\", \"mobile\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The actual contact point details\",\n        description=(\n            \"The actual contact point details, in a form that is meaningful to the \"\n            \"designated communication system (i.e. phone number or email address).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContactPoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"system\", \"value\", \"use\", \"rank\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContactPoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"system\", \"value\", \"use\", \"rank\", \"period\"]\n"
  },
  {
    "path": "fhir/resources/contract.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Contract\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Contract(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Legal Agreement.\n    Legally enforceable, formally recorded unilateral or bilateral directive\n    i.e., a policy or agreement.\n    \"\"\"\n\n    __resource_type__ = \"Contract\"\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=\"Acronym or short name\",\n        description=(\n            \"Alternative representation of the title for this Contract definition, \"\n            \"derivative, or instance in any legal state., e.g., a domain specific \"\n            \"contract number related to legislation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    applies: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"applies\",\n        title=\"Effective time\",\n        description=\"Relevant time or time-period when this Contract is applicable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Source of Contract\",\n        description=(\n            \"The individual or organization that authored the Contract definition, \"\n            \"derivative, or instance in any legal state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    authority: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Authority under which this Contract has standing\",\n        description=(\n            \"A formally or informally recognized grouping of people, principals, \"\n            \"organizations, or jurisdictions formed for the purpose of achieving \"\n            \"some form of collective action such as the promulgation, \"\n            \"administration and enforcement of contracts and policies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    contentDefinition: fhirtypes.ContractContentDefinitionType | None = Field(\n        default=None,\n        alias=\"contentDefinition\",\n        title=\"Contract precursor content\",\n        description=(\n            \"Precusory content developed with a focus and intent of supporting the \"\n            \"formation a Contract instance, which may be associated with and \"\n            \"transformable into a Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contentDerivative: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"contentDerivative\",\n        title=\"Content derived from the basal information\",\n        description=(\n            \"The minimal content derived from the basal information source at a \"\n            \"specific stage in its lifecycle.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    domain: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"domain\",\n        title=(\n            \"A sphere of control governed by an authoritative jurisdiction, \"\n            \"organization, or person\"\n        ),\n        description=(\n            \"Recognized governance framework or system operating with a \"\n            \"circumscribed scope in accordance with specified principles, policies,\"\n            \" processes or procedures for managing rights, actions, or behaviors of\"\n            \" parties or principals relative to resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    expirationType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"expirationType\",\n        title=\"Contract cessation cause\",\n        description=(\n            \"Event resulting in discontinuation or termination of this Contract \"\n            \"instance by one or more parties to the contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    friendly: typing.List[fhirtypes.ContractFriendlyType] | None = Field(\n        default=None,\n        alias=\"friendly\",\n        title=\"Contract Friendly Language\",\n        description=(\n            'The \"patient friendly language\" versionof the Contract in whole or in '\n            'parts. \"Patient friendly language\" means the representation of the '\n            \"Contract and Contract Provisions in a manner that is readily \"\n            \"accessible and understandable by a layperson in accordance with best \"\n            \"practices for communication styles that ensure that those agreeing to \"\n            \"or signing the Contract understand the roles, actions, obligations, \"\n            \"responsibilities, and implication of the agreement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Contract number\",\n        description=(\n            \"Unique identifier for this Contract or a derivative that references a \"\n            \"Source Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Source Contract Definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined Contract Definition that is adhered\"\n            \" to in whole or part by this Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Contract\"],\n        },\n    )\n\n    instantiatesUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"External Contract Definition\",\n        description=(\n            \"The URL pointing to an externally maintained definition that is \"\n            \"adhered to in whole or in part by this Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    issued: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"When this Contract was issued\",\n        description=\"When this  Contract was issued.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    legal: typing.List[fhirtypes.ContractLegalType] | None = Field(\n        default=None,\n        alias=\"legal\",\n        title=\"Contract Legal Language\",\n        description=\"List of Legal expressions or representations of this Contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    legalState: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"legalState\",\n        title=\"Negotiation status\",\n        description=(\n            \"Legal states of the formation of a legal instrument, which is a \"\n            \"formally executed written document that can be formally attributed to \"\n            \"its author, records and formally expresses a legally enforceable act, \"\n            \"process, or contractual duty, obligation, or right, and therefore \"\n            \"evidences that act, process, or agreement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    legallyBindingAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"legallyBindingAttachment\",\n        title=\"Binding Contract\",\n        description=(\n            \"Legally binding Contract: This is the signed and legally recognized \"\n            'representation of the Contract, which is considered the \"source of '\n            'truth\" and which would be the basis for legal action related to '\n            \"enforcement of this Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e legallyBinding[x]\n            \"one_of_many\": \"legallyBinding\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    legallyBindingReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"legallyBindingReference\",\n        title=\"Binding Contract\",\n        description=(\n            \"Legally binding Contract: This is the signed and legally recognized \"\n            'representation of the Contract, which is considered the \"source of '\n            'truth\" and which would be the basis for legal action related to '\n            \"enforcement of this Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e legallyBinding[x]\n            \"one_of_many\": \"legallyBinding\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Composition\",\n                \"DocumentReference\",\n                \"QuestionnaireResponse\",\n                \"Contract\",\n            ],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Computer friendly designation\",\n        description=(\n            \"A natural language name identifying this Contract definition, \"\n            \"derivative, or instance in any legal state. Provides additional \"\n            \"information about its content. This name should be usable as an \"\n            \"identifier for the module by machine processing applications such as \"\n            \"code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Key event in Contract History\",\n        description=(\n            \"Links to Provenance records for past versions of this Contract \"\n            \"definition, derivative, or instance, which identify key state \"\n            \"transitions or updates that are likely to be relevant to a user \"\n            \"looking at the current version of the Contract.  The Provenance.entity\"\n            \" indicates the target that was changed in the update (see \"\n            \"[Provenance.entity](provenance-definitions.html#Provenance.entity)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    rule: typing.List[fhirtypes.ContractRuleType] | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"Computable Contract Language\",\n        description=(\n            \"List of Computable Policy Rule Language Representations of this \"\n            \"Contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    scope: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"scope\",\n        title=\"Range of Legal Concerns\",\n        description=(\n            \"A selector of legal concerns for this Contract definition, derivative,\"\n            \" or instance in any legal state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    signer: typing.List[fhirtypes.ContractSignerType] | None = Field(\n        default=None,\n        alias=\"signer\",\n        title=\"Contract Signatory\",\n        description=(\n            \"Parties with legal standing in the Contract, including the principal \"\n            \"parties, the grantor(s) and grantee(s), which are any person or \"\n            \"organization bound by the contract, and any ancillary parties, which \"\n            \"facilitate the execution of the contract such as a notary or witness.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    site: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Specific Location\",\n        description=\"Sites in which the contract is complied with,  exercised, or in force.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"amended | appended | cancelled | disputed | entered-in-error | \"\n            \"executable +\"\n        ),\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"amended\",\n                \"appended\",\n                \"cancelled\",\n                \"disputed\",\n                \"entered-in-error\",\n                \"executable\",\n                \"+\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"Subtype within the context of type\",\n        description=(\n            \"Sub-category for the Contract that distinguishes the kinds of systems \"\n            \"that would be interested in the Contract within the context of the \"\n            \"Contract's scope.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Contract Target Entity\",\n        description=(\n            \"The target entity impacted by or of interest to parties to the \"\n            \"agreement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate Friendly name\",\n        description=(\n            \"A more detailed or qualifying explanatory or alternate user-friendly \"\n            \"title for this Contract definition, derivative, or instance in any \"\n            \"legal state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Extra Information\",\n        description=(\n            \"Information that may be needed by/relevant to the performer in their \"\n            \"execution of this term action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    term: typing.List[fhirtypes.ContractTermType] | None = Field(\n        default=None,\n        alias=\"term\",\n        title=\"Contract Term List\",\n        description=(\n            \"One or more Contract Provisions, which may be related and conveyed as \"\n            \"a group, and may contain nested groups.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Human Friendly name\",\n        description=(\n            \"A short, descriptive, user-friendly title for this Contract \"\n            \"definition, derivative, or instance in any legal state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topicCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"topicCodeableConcept\",\n        title=\"Focus of contract interest\",\n        description=(\n            \"Narrows the range of legal concerns to focus on the achievement of \"\n            \"specific contractual objectives.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e topic[x]\n            \"one_of_many\": \"topic\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    topicReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"topicReference\",\n        title=\"Focus of contract interest\",\n        description=(\n            \"Narrows the range of legal concerns to focus on the achievement of \"\n            \"specific contractual objectives.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e topic[x]\n            \"one_of_many\": \"topic\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Legal instrument category\",\n        description=(\n            \"A high-level category for the legal instrument, whether constructed as\"\n            \" a Contract definition, derivative, or instance in any legal state.  \"\n            \"Provides additional information about its content within the context \"\n            \"of the Contract's scope to distinguish the kinds of systems that would\"\n            \" be interested in the contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Basal definition\",\n        description=(\n            \"Canonical identifier for this contract, represented as a URI (globally\"\n            \" unique).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business edition\",\n        description=(\n            \"An edition identifier used for business purposes to label business \"\n            \"significant variants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Contract`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"url\",\n            \"version\",\n            \"status\",\n            \"legalState\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"contentDerivative\",\n            \"issued\",\n            \"applies\",\n            \"expirationType\",\n            \"subject\",\n            \"authority\",\n            \"domain\",\n            \"site\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"alias\",\n            \"author\",\n            \"scope\",\n            \"topicCodeableConcept\",\n            \"topicReference\",\n            \"type\",\n            \"subType\",\n            \"contentDefinition\",\n            \"term\",\n            \"supportingInfo\",\n            \"relevantHistory\",\n            \"signer\",\n            \"friendly\",\n            \"legal\",\n            \"rule\",\n            \"legallyBindingAttachment\",\n            \"legallyBindingReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Contract`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"version\",\n            \"status\",\n            \"issued\",\n            \"applies\",\n            \"subject\",\n            \"name\",\n            \"title\",\n            \"type\",\n            \"subType\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"legallyBinding\": [\"legallyBindingAttachment\", \"legallyBindingReference\"],\n            \"topic\": [\"topicCodeableConcept\", \"topicReference\"],\n        }\n        return one_of_many_fields\n\n\nclass ContractContentDefinition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract precursor content.\n    Precusory content developed with a focus and intent of supporting the\n    formation a Contract instance, which may be associated with and\n    transformable into a Contract.\n    \"\"\"\n\n    __resource_type__ = \"ContractContentDefinition\"\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Publication Ownership\",\n        description=(\n            \"A copyright statement relating to Contract precursor content. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the Contract precursor content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    publicationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"publicationDate\",\n        title=\"When published\",\n        description=(\n            \"The date (and optionally time) when the contract was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the contract changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    publicationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_publicationDate\",\n        title=\"Extension field for ``publicationDate``.\",\n    )\n\n    publicationStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"publicationStatus\",\n        title=(\n            \"amended | appended | cancelled | disputed | entered-in-error | \"\n            \"executable +\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"amended\",\n                \"appended\",\n                \"cancelled\",\n                \"disputed\",\n                \"entered-in-error\",\n                \"executable\",\n                \"+\",\n            ],\n        },\n    )\n    publicationStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_publicationStatus\",\n        title=\"Extension field for ``publicationStatus``.\",\n    )\n\n    publisher: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Publisher Entity\",\n        description=(\n            \"The  individual or organization that published the Contract precursor \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    subType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"Detailed Content Type Definition\",\n        description=\"Detailed Precusory content type.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Content structure and use\",\n        description=(\n            \"Precusory content structure and use, i.e., a boilerplate, template, \"\n            \"application for a contract such as an insurance policy or benefits \"\n            \"under a program, e.g., workers compensation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractContentDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"subType\",\n            \"publisher\",\n            \"publicationDate\",\n            \"publicationStatus\",\n            \"copyright\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractContentDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"publicationStatus\", \"publicationStatus__ext\")]\n        return required_fields\n\n\nclass ContractFriendly(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Friendly Language.\n    The \"patient friendly language\" versionof the Contract in whole or in\n    parts. \"Patient friendly language\" means the representation of the Contract\n    and Contract Provisions in a manner that is readily accessible and\n    understandable by a layperson in accordance with best practices for\n    communication styles that ensure that those agreeing to or signing the\n    Contract understand the roles, actions, obligations, responsibilities, and\n    implication of the agreement.\n    \"\"\"\n\n    __resource_type__ = \"ContractFriendly\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Easily comprehended representation of this Contract\",\n        description=(\n            \"Human readable rendering of this Contract in a format and \"\n            \"representation intended to enhance comprehension and ensure \"\n            \"understandability.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Easily comprehended representation of this Contract\",\n        description=(\n            \"Human readable rendering of this Contract in a format and \"\n            \"representation intended to enhance comprehension and ensure \"\n            \"understandability.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Composition\",\n                \"DocumentReference\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractFriendly`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentAttachment\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractFriendly`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"content\": [\"contentAttachment\", \"contentReference\"]}\n        return one_of_many_fields\n\n\nclass ContractLegal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Legal Language.\n    List of Legal expressions or representations of this Contract.\n    \"\"\"\n\n    __resource_type__ = \"ContractLegal\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Contract Legal Text\",\n        description=\"Contract legal text in human renderable form.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Contract Legal Text\",\n        description=\"Contract legal text in human renderable form.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Composition\",\n                \"DocumentReference\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractLegal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentAttachment\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractLegal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"content\": [\"contentAttachment\", \"contentReference\"]}\n        return one_of_many_fields\n\n\nclass ContractRule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Computable Contract Language.\n    List of Computable Policy Rule Language Representations of this Contract.\n    \"\"\"\n\n    __resource_type__ = \"ContractRule\"\n\n    contentAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"contentAttachment\",\n        title=\"Computable Contract Rules\",\n        description=(\n            \"Computable Contract conveyed using a policy rule language (e.g. XACML,\"\n            \" DKAL, SecPal).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    contentReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Computable Contract Rules\",\n        description=(\n            \"Computable Contract conveyed using a policy rule language (e.g. XACML,\"\n            \" DKAL, SecPal).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e content[x]\n            \"one_of_many\": \"content\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"contentAttachment\",\n            \"contentReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"content\": [\"contentAttachment\", \"contentReference\"]}\n        return one_of_many_fields\n\n\nclass ContractSigner(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Signatory.\n    Parties with legal standing in the Contract, including the principal\n    parties, the grantor(s) and grantee(s), which are any person or\n    organization bound by the contract, and any ancillary parties, which\n    facilitate the execution of the contract such as a notary or witness.\n    \"\"\"\n\n    __resource_type__ = \"ContractSigner\"\n\n    party: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"party\",\n        title=\"Contract Signatory Party\",\n        description=\"Party which is a signator to this Contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    signature: typing.List[fhirtypes.SignatureType] = Field(\n        default=...,\n        alias=\"signature\",\n        title=\"Contract Documentation Signature\",\n        description=\"Legally binding Contract DSIG signature contents in Base64.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Contract Signatory Role\",\n        description=\"Role of this Contract signer, e.g. notary, grantee.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractSigner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"party\", \"signature\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractSigner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractTerm(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Term List.\n    One or more Contract Provisions, which may be related and conveyed as a\n    group, and may contain nested groups.\n    \"\"\"\n\n    __resource_type__ = \"ContractTerm\"\n\n    action: typing.List[fhirtypes.ContractTermActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Entity being ascribed responsibility\",\n        description=(\n            \"An actor taking a role in an activity for which it can be assigned \"\n            \"some degree of responsibility for the activity taking place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    applies: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"applies\",\n        title=\"Contract Term Effective Time\",\n        description=(\n            \"Relevant time or time-period when this Contract Provision is \"\n            \"applicable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    asset: typing.List[fhirtypes.ContractTermAssetType] | None = Field(\n        default=None,\n        alias=\"asset\",\n        title=\"Contract Term Asset List\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    group: typing.List[fhirtypes.ContractTermType] | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"Nested Contract Term Group\",\n        description=\"Nested group of Contract Provisions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Contract Term Number\",\n        description=\"Unique identifier for this particular Contract Provision.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"Contract Term Issue Date Time\",\n        description=\"When this Contract Provision was issued.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    offer: fhirtypes.ContractTermOfferType = Field(\n        default=...,\n        alias=\"offer\",\n        title=\"Context of the Contract term\",\n        description=(\n            \"The matter of concern in the context of this provision of the \" \"agrement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.ContractTermSecurityLabelType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Protection for the Term\",\n        description=(\n            \"Security labels that protect the handling of information about the \"\n            \"term and its elements, which may be specifically identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"Contract Term Type specific classification\",\n        description=(\n            \"A specialized legal clause or condition based on overarching contract \"\n            \"type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Term Statement\",\n        description=\"Statement of a provision in a policy or a contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    topicCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"topicCodeableConcept\",\n        title=\"Term Concern\",\n        description=\"The entity that the term applies to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e topic[x]\n            \"one_of_many\": \"topic\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    topicReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"topicReference\",\n        title=\"Term Concern\",\n        description=\"The entity that the term applies to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e topic[x]\n            \"one_of_many\": \"topic\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Contract Term Type or Form\",\n        description=(\n            \"A legal clause or condition contained within a contract that requires \"\n            \"one or both parties to perform a particular requirement by some \"\n            \"specified time or prevents one or both parties from performing a \"\n            \"particular requirement by some specified time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTerm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"issued\",\n            \"applies\",\n            \"topicCodeableConcept\",\n            \"topicReference\",\n            \"type\",\n            \"subType\",\n            \"text\",\n            \"securityLabel\",\n            \"offer\",\n            \"asset\",\n            \"action\",\n            \"group\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTerm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"issued\", \"applies\", \"text\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"topic\": [\"topicCodeableConcept\", \"topicReference\"]}\n        return one_of_many_fields\n\n\nclass ContractTermAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Entity being ascribed responsibility.\n    An actor taking a role in an activity for which it can be assigned some\n    degree of responsibility for the activity taking place.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermAction\"\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Episode associated with action\",\n        description=(\n            \"Encounter or Episode with primary association to the specified term \"\n            \"activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    contextLinkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"contextLinkId\",\n        title=\"Pointer to specific item\",\n        description=(\n            \"Id [identifier??] of the clause or question text related to the \"\n            \"requester of this action in the referenced form or \"\n            \"QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    contextLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_contextLinkId\",\n        title=\"Extension field for ``contextLinkId``.\",\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"True if the term prohibits the  action\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    intent: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"intent\",\n        title=\"Purpose for the Contract Term Action\",\n        description=(\n            \"Reason or purpose for the action stipulated by this Contract \" \"Provision.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific item\",\n        description=(\n            \"Id [identifier??] of the clause or question text related to this \"\n            \"action in the referenced form or QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the action\",\n        description=(\n            \"Comments made about the term action made by the requester, performer, \"\n            \"subject or other participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When action happens\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When action happens\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When action happens\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Actor that wil execute (or not) the action\",\n        description=(\n            \"Indicates who or what is being asked to perform (or not perform) the \"\n            \"ction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"CareTeam\",\n                \"Device\",\n                \"Substance\",\n                \"Organization\",\n                \"Location\",\n            ],\n        },\n    )\n\n    performerLinkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"performerLinkId\",\n        title=\"Pointer to specific item\",\n        description=(\n            \"Id [identifier??] of the clause or question text related to the reason\"\n            \" type or reference of this  action in the referenced form or \"\n            \"QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    performerLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_performerLinkId\",\n        title=\"Extension field for ``performerLinkId``.\",\n    )\n\n    performerRole: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"performerRole\",\n        title=\"Competency of the performer\",\n        description=(\n            \"The type of role or competency of an individual desired or required to\"\n            \" perform or not perform the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performerType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=\"Kind of service performer\",\n        description=(\n            \"The type of individual that is desired or required to perform or not \"\n            \"perform the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why is action (not) needed?\",\n        description=(\n            \"Rationale for the action to be performed or not performed. Describes \"\n            \"why the action is permitted or prohibited. Either a coded concept, or \"\n            \"another resource whose existence justifies permitting or not \"\n            \"permitting this action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n                \"Questionnaire\",\n                \"QuestionnaireResponse\",\n            ],\n        },\n    )\n\n    reasonLinkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"reasonLinkId\",\n        title=\"Pointer to specific item\",\n        description=(\n            \"Id [identifier??] of the clause or question text related to the reason\"\n            \" type or reference of this  action in the referenced form or \"\n            \"QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reasonLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_reasonLinkId\",\n        title=\"Extension field for ``reasonLinkId``.\",\n    )\n\n    requester: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who asked for action\",\n        description=(\n            \"Who or what initiated the action and has responsibility for its \"\n            \"activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Group\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    requesterLinkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"requesterLinkId\",\n        title=\"Pointer to specific item\",\n        description=(\n            \"Id [identifier??] of the clause or question text related to the \"\n            \"requester of this action in the referenced form or \"\n            \"QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    requesterLinkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_requesterLinkId\",\n        title=\"Extension field for ``requesterLinkId``.\",\n    )\n\n    securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field(\n        default=None,\n        alias=\"securityLabelNumber\",\n        title=\"Action restriction numbers\",\n        description=\"Security labels that protects the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    securityLabelNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_securityLabelNumber\",\n        title=\"Extension field for ``securityLabelNumber``.\",\n    )\n\n    status: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"status\",\n        title=\"State of the action\",\n        description=\"Current state of the term action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: typing.List[fhirtypes.ContractTermActionSubjectType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Entity of the action\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type or form of the action\",\n        description=(\n            \"Activity or service obligation to be done or not done, performed or \"\n            \"not performed, effectuated or not by this Contract term.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"doNotPerform\",\n            \"type\",\n            \"subject\",\n            \"intent\",\n            \"linkId\",\n            \"status\",\n            \"context\",\n            \"contextLinkId\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"requester\",\n            \"requesterLinkId\",\n            \"performerType\",\n            \"performerRole\",\n            \"performer\",\n            \"performerLinkId\",\n            \"reason\",\n            \"reasonLinkId\",\n            \"note\",\n            \"securityLabelNumber\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\", \"occurrenceTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass ContractTermActionSubject(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Entity of the action.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermActionSubject\"\n\n    reference: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Entity of the action\",\n        description=\"The entity the action is performed or not performed on or for.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Group\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Role type of the agent\",\n        description=\"Role type of agent assigned roles in this Contract.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermActionSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"reference\", \"role\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermActionSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractTermAsset(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Term Asset List.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermAsset\"\n\n    answer: typing.List[fhirtypes.ContractTermOfferAnswerType] | None = Field(\n        default=None,\n        alias=\"answer\",\n        title=\"Response to assets\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    condition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Quality desctiption of asset\",\n        description=(\n            \"Description of the quality and completeness of the asset that may be a\"\n            \" factor in its valuation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_condition\", title=\"Extension field for ``condition``.\"\n    )\n\n    context: typing.List[fhirtypes.ContractTermAssetContextType] | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Circumstance of the asset\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to asset text\",\n        description=(\n            \"Id [identifier??] of the clause or question text about the asset in \"\n            \"the referenced form or QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    period: typing.List[fhirtypes.PeriodType] | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period of the asset\",\n        description=\"Asset relevant contractual time period.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    periodType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"periodType\",\n        title=\"Asset availability types\",\n        description=\"Type of Asset availability for use or ownership.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"Kinship of the asset\",\n        description=(\n            \"Specifies the applicability of the term to an asset resource instance,\"\n            \" and instances it refers to or instances that refer to it, and/or are \"\n            \"owned by the offeree.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    scope: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"scope\",\n        title=\"Range of asset\",\n        description=\"Differentiates the kind of the asset .\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field(\n        default=None,\n        alias=\"securityLabelNumber\",\n        title=\"Asset restriction numbers\",\n        description=\"Security labels that protects the asset.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    securityLabelNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_securityLabelNumber\",\n        title=\"Extension field for ``securityLabelNumber``.\",\n    )\n\n    subtype: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subtype\",\n        title=\"Asset sub-category\",\n        description=\"May be a subtype or part of an offered asset.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Asset clause or question text\",\n        description=(\n            \"Clause or question text (Prose Object) concerning the asset in a \"\n            \"linked form, such as a QuestionnaireResponse used in the formation of \"\n            \"the contract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Asset category\",\n        description=\"Target entity type about which the term may be concerned.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    typeReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"typeReference\",\n        title=\"Associated entities\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    usePeriod: typing.List[fhirtypes.PeriodType] | None = Field(\n        default=None,\n        alias=\"usePeriod\",\n        title=\"Time period\",\n        description=\"Time period of asset use.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valuedItem: typing.List[fhirtypes.ContractTermAssetValuedItemType] | None = Field(\n        default=None,\n        alias=\"valuedItem\",\n        title=\"Contract Valued Item List\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermAsset`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"scope\",\n            \"type\",\n            \"typeReference\",\n            \"subtype\",\n            \"relationship\",\n            \"context\",\n            \"condition\",\n            \"periodType\",\n            \"period\",\n            \"usePeriod\",\n            \"text\",\n            \"linkId\",\n            \"answer\",\n            \"securityLabelNumber\",\n            \"valuedItem\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermAsset`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractTermAssetContext(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Circumstance of the asset.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermAssetContext\"\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Codeable asset context\",\n        description=(\n            \"Coded representation of the context generally or of the Referenced \"\n            \"entity, such as the asset holder type or location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Creator,custodian or owner\",\n        description=(\n            \"Asset context reference may include the creator, custodian, or owning \"\n            \"Person or Organization (e.g., bank, repository),  location held, e.g.,\"\n            \" building,  jurisdiction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Context description\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermAssetContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"reference\", \"code\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermAssetContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractTermAssetValuedItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contract Valued Item List.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermAssetValuedItem\"\n\n    effectiveTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveTime\",\n        title=\"Contract Valued Item Effective Tiem\",\n        description=(\n            \"Indicates the time during which this Contract ValuedItem information \"\n            \"is effective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    effectiveTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveTime\",\n        title=\"Extension field for ``effectiveTime``.\",\n    )\n\n    entityCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"entityCodeableConcept\",\n        title=\"Contract Valued Item Type\",\n        description=\"Specific type of Contract Valued Item that may be priced.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e entity[x]\n            \"one_of_many\": \"entity\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    entityReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"entityReference\",\n        title=\"Contract Valued Item Type\",\n        description=\"Specific type of Contract Valued Item that may be priced.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e entity[x]\n            \"one_of_many\": \"entity\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Contract Valued Item Price Scaling Factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of the Contract Valued Item delivered. The concept of a \"\n            \"Factor allows for a discount or surcharge multiplier to be applied to \"\n            \"a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Contract Valued Item Number\",\n        description=\"Identifies a Contract Valued Item instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific item\",\n        description=(\n            \"Id  of the clause or question text related to the context of this \"\n            \"valuedItem in the referenced form or QuestionnaireResponse.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total Contract Valued Item Value\",\n        description=(\n            \"Expresses the product of the Contract Valued Item unitQuantity and the\"\n            \" unitPriceAmt. For example, the formula: unit Quantity * unit Price \"\n            \"(Cost per Point) * factor Number  * points = net Amount. Quantity, \"\n            \"factor and points are assumed to be 1 if not supplied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"payment\",\n        title=\"Terms of valuation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    payment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_payment\", title=\"Extension field for ``payment``.\"\n    )\n\n    paymentDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"paymentDate\",\n        title=\"When payment is due\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    paymentDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_paymentDate\", title=\"Extension field for ``paymentDate``.\"\n    )\n\n    points: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"points\",\n        title=\"Contract Valued Item Difficulty Scaling Factor\",\n        description=(\n            \"An amount that expresses the weighting (based on difficulty, cost \"\n            \"and/or resource intensiveness) associated with the Contract Valued \"\n            \"Item delivered. The concept of Points allows for assignment of point \"\n            \"values for a Contract Valued Item, such that a monetary amount can be \"\n            \"assigned to each point.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    points__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_points\", title=\"Extension field for ``points``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of Contract Valued Items\",\n        description=(\n            \"Specifies the units by which the Contract Valued Item is measured or \"\n            \"counted, and quantifies the countable or measurable Contract Valued \"\n            \"Item instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recipient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Who will receive payment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    responsible: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Who will make payment\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field(\n        default=None,\n        alias=\"securityLabelNumber\",\n        title=\"Security Labels that define affected terms\",\n        description=(\n            \"A set of security labels that define which terms are controlled by \"\n            \"this condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    securityLabelNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_securityLabelNumber\",\n        title=\"Extension field for ``securityLabelNumber``.\",\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Contract Valued Item fee, charge, or cost\",\n        description=\"A Contract Valued Item unit valuation measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermAssetValuedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"entityCodeableConcept\",\n            \"entityReference\",\n            \"identifier\",\n            \"effectiveTime\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"points\",\n            \"net\",\n            \"payment\",\n            \"paymentDate\",\n            \"responsible\",\n            \"recipient\",\n            \"linkId\",\n            \"securityLabelNumber\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermAssetValuedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"entity\": [\"entityCodeableConcept\", \"entityReference\"]}\n        return one_of_many_fields\n\n\nclass ContractTermOffer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Context of the Contract term.\n    The matter of concern in the context of this provision of the agrement.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermOffer\"\n\n    answer: typing.List[fhirtypes.ContractTermOfferAnswerType] | None = Field(\n        default=None,\n        alias=\"answer\",\n        title=\"Response to offer text\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    decision: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"decision\",\n        title=\"Accepting party choice\",\n        description=(\n            \"Type of choice made by accepting party with respect to an offer made \"\n            \"by an offeror/ grantee.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    decisionMode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"decisionMode\",\n        title=\"How decision is conveyed\",\n        description=\"How the decision about a Contract was conveyed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Offer business ID\",\n        description=\"Unique identifier for this particular Contract Provision.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to text\",\n        description=(\n            \"The id of the clause or question text of the offer in the referenced \"\n            \"questionnaire/response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    party: typing.List[fhirtypes.ContractTermOfferPartyType] | None = Field(\n        default=None,\n        alias=\"party\",\n        title=\"Offer Recipient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    securityLabelNumber: typing.List[fhirtypes.UnsignedIntType | None] | None = Field(\n        default=None,\n        alias=\"securityLabelNumber\",\n        title=\"Offer restriction numbers\",\n        description=\"Security labels that protects the offer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    securityLabelNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_securityLabelNumber\",\n        title=\"Extension field for ``securityLabelNumber``.\",\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Human readable offer text\",\n        description=\"Human readable form of this Contract Offer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    topic: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"Negotiable offer asset\",\n        description=(\n            \"The owner of an asset has the residual control rights over the asset: \"\n            \"the right to decide all usages of the asset in any way not \"\n            \"inconsistent with a prior contract, custom, or law (Hart, 1995, p. \"\n            \"30).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Contract Offer Type or Form\",\n        description=(\n            \"Type of Contract Provision such as specific requirements, purposes for\"\n            \" actions, obligations, prohibitions, e.g. life time maximum benefit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermOffer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"party\",\n            \"topic\",\n            \"type\",\n            \"decision\",\n            \"decisionMode\",\n            \"answer\",\n            \"text\",\n            \"linkId\",\n            \"securityLabelNumber\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermOffer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"topic\"]\n\n\nclass ContractTermOfferAnswer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Response to offer text.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermOfferAnswer\"\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warranty duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warranty duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warranty duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warranty duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warranty duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warranty duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warranty duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warranty duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warranty duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warranty duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warranty duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"The actual answer response\",\n        description=(\n            \"Response to an offer clause or question text,  which enables selection\"\n            \" of values to be agreed to, e.g., the period of participation, the \"\n            \"date of occupancy of a rental, warranty duration, or whether \"\n            \"biospecimen may be used for further research.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermOfferAnswer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueBoolean\",\n            \"valueDecimal\",\n            \"valueInteger\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueTime\",\n            \"valueString\",\n            \"valueUri\",\n            \"valueAttachment\",\n            \"valueCoding\",\n            \"valueQuantity\",\n            \"valueReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermOfferAnswer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCoding\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ContractTermOfferParty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Offer Recipient.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermOfferParty\"\n\n    reference: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Referenced entity\",\n        description=\"Participant in the offer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Group\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"role\",\n        title=\"Participant engagement type\",\n        description=\"How the party participates in the offer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermOfferParty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"reference\", \"role\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermOfferParty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ContractTermSecurityLabel(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Protection for the Term.\n    Security labels that protect the handling of information about the term and\n    its elements, which may be specifically identified.\n    \"\"\"\n\n    __resource_type__ = \"ContractTermSecurityLabel\"\n\n    category: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Applicable Policy\",\n        description=(\n            \"Security label privacy tag that specifies the applicable privacy and \"\n            \"security policies governing this term and/or term elements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    classification: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"classification\",\n        title=\"Confidentiality Protection\",\n        description=(\n            \"Security label privacy tag that specifies the level of confidentiality\"\n            \" protection required for this term and/or term elements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    control: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"control\",\n        title=\"Handling Instructions\",\n        description=(\n            \"Security label privacy tag that specifies the manner in which term \"\n            \"and/or term elements are to be protected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    number: typing.List[fhirtypes.UnsignedIntType | None] | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"Link to Security Labels\",\n        description=(\n            \"Number used to link this term or term element to the applicable \"\n            \"Security Label.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    number__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ContractTermSecurityLabel`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"number\",\n            \"classification\",\n            \"category\",\n            \"control\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ContractTermSecurityLabel`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/contributor.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Contributor\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Contributor(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contributor information.\n    A contributor to the content of a knowledge asset, including authors,\n    editors, reviewers, and endorsers.\n    \"\"\"\n\n    __resource_type__ = \"Contributor\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details of the contributor\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" contributor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Who contributed the content\",\n        description=(\n            \"The name of the individual or organization responsible for the \"\n            \"contribution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"author | editor | reviewer | endorser\",\n        description=\"The type of contributor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"author\", \"editor\", \"reviewer\", \"endorser\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Contributor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"type\", \"name\", \"contact\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Contributor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"type\", \"name\", \"contact\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/count.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Count\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Count(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A measured or measurable amount.\n    A measured amount (or an amount that can potentially be measured). Note\n    that measured amounts include amounts that are not precisely quantified,\n    including amounts involving arbitrary units and floating currencies.\n    \"\"\"\n\n    __resource_type__ = \"Count\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Count`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Count`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/coverage.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Coverage\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Coverage(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurance or medical plan or a payment agreement.\n    Financial instrument which may be used to reimburse or pay for health care\n    products and services. Includes both insurance and self-payment.\n    \"\"\"\n\n    __resource_type__ = \"Coverage\"\n\n    beneficiary: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"beneficiary\",\n        title=\"Plan beneficiary\",\n        description=(\n            \"The party who benefits from the insurance coverage; the patient when \"\n            \"products and/or services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    class_fhir: typing.List[fhirtypes.CoverageClassType] | None = Field(\n        default=None,\n        alias=\"class\",\n        title=\"Additional coverage classifications\",\n        description=\"A suite of underwriter specific classifiers.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contract: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"contract\",\n        title=\"Contract details\",\n        description=\"The policy(s) which constitute this insurance coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Contract\"],\n        },\n    )\n\n    costToBeneficiary: typing.List[\n        fhirtypes.CoverageCostToBeneficiaryType\n    ] | None = Field(\n        default=None,\n        alias=\"costToBeneficiary\",\n        title=\"Patient payments for services/products\",\n        description=(\n            \"A suite of codes indicating the cost category and associated amount \"\n            \"which have been detailed in the policy and may have been  included on \"\n            \"the health card.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dependent: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"dependent\",\n        title=\"Dependent number\",\n        description=\"A designator for a dependent under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    dependent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dependent\", title=\"Extension field for ``dependent``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier(s) for this coverage\",\n        description=\"The identifier of the coverage as issued by the insurer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    insurancePlan: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurancePlan\",\n        title=\"Insurance plan details\",\n        description=(\n            \"The insurance plan details, benefits and costs, which constitute this \"\n            \"insurance coverage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"InsurancePlan\"],\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Issuer of the policy\",\n        description=\"The program or plan underwriter, payor, insurance company.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"insurance | self-pay | other\",\n        description=(\n            \"The nature of the coverage be it insurance, or cash payment such as \"\n            \"self-pay.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"insurance\", \"self-pay\", \"other\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    network: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"Insurer network\",\n        description=(\n            \"The insurer-specific identifier for the insurer-defined network of \"\n            \"providers to which the beneficiary may seek treatment which will be \"\n            \"covered at the 'in-network' rate, otherwise 'out of network' terms and\"\n            \" conditions apply.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    network__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_network\", title=\"Extension field for ``network``.\"\n    )\n\n    order: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"order\",\n        title=\"Relative order of the coverage\",\n        description=(\n            \"The order of applicability of this coverage relative to other \"\n            \"coverages which are currently in force. Note, there may be gaps in the\"\n            \" numbering and this does not imply primary, secondary etc. as the \"\n            \"specific positioning of coverages depends upon the episode of care. \"\n            \"For example; a patient might have (0) auto insurance (1) their own \"\n            \"health insurance and (2) spouse's health insurance. When claiming for \"\n            \"treatments which were not the result of an auto accident then only \"\n            \"coverages (1) and (2) above would be applicatble and would apply in \"\n            \"the order specified in parenthesis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    order__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_order\", title=\"Extension field for ``order``.\"\n    )\n\n    paymentBy: typing.List[fhirtypes.CoveragePaymentByType] | None = Field(\n        default=None,\n        alias=\"paymentBy\",\n        title=\"Self-pay parties and responsibility\",\n        description=(\n            \"Link to the paying party and optionally what specifically they will be\"\n            \" responsible to pay.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Coverage start and end dates\",\n        description=(\n            \"Time period during which the coverage is in force. A missing start \"\n            \"date indicates the start date isn't known, a missing end date means \"\n            \"the coverage is continuing to be in force.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    policyHolder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"policyHolder\",\n        title=\"Owner of the policy\",\n        description=\"The party who 'owns' the insurance policy.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\", \"Organization\"],\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"Beneficiary relationship to the subscriber\",\n        description=\"The relationship of beneficiary (patient) to the subscriber.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subrogation: bool | None = Field(\n        default=None,\n        alias=\"subrogation\",\n        title=\"Reimbursement to insurer\",\n        description=(\n            \"When 'subrogation=true' this insurance instance has been included not \"\n            \"for adjudication but to provide insurers with the details to recover \"\n            \"costs.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subrogation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subrogation\", title=\"Extension field for ``subrogation``.\"\n    )\n\n    subscriber: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subscriber\",\n        title=\"Subscriber to the policy\",\n        description=(\n            \"The party who has signed-up for or 'owns' the contractual relationship\"\n            \" to the policy or to whom the benefit of the policy for services \"\n            \"rendered to them or their family is due.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    subscriberId: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"subscriberId\",\n        title=\"ID assigned to the subscriber\",\n        description=\"The insurer assigned ID for the Subscriber.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Coverage category such as medical or accident\",\n        description=(\n            \"The type of coverage: social program, medical plan, accident coverage \"\n            \"(workers compensation, auto), group health or payment by an individual\"\n            \" or organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Coverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"kind\",\n            \"paymentBy\",\n            \"type\",\n            \"policyHolder\",\n            \"subscriber\",\n            \"subscriberId\",\n            \"beneficiary\",\n            \"dependent\",\n            \"relationship\",\n            \"period\",\n            \"insurer\",\n            \"class\",\n            \"order\",\n            \"network\",\n            \"costToBeneficiary\",\n            \"subrogation\",\n            \"contract\",\n            \"insurancePlan\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Coverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"kind\",\n            \"type\",\n            \"policyHolder\",\n            \"subscriber\",\n            \"subscriberId\",\n            \"beneficiary\",\n            \"dependent\",\n            \"period\",\n            \"insurer\",\n            \"order\",\n            \"network\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"kind\", \"kind__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass CoverageClass(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional coverage classifications.\n    A suite of underwriter specific classifiers.\n    \"\"\"\n\n    __resource_type__ = \"CoverageClass\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human readable description of the type and value\",\n        description=\"A short description for the class.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of class such as 'group' or 'plan'\",\n        description=(\n            \"The type of classification for which an insurer-specific class label \"\n            \"or number and optional name is provided.  For example, type may be \"\n            \"used to identify a class of coverage or employer group, policy, or \"\n            \"plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    value: fhirtypes.IdentifierType = Field(\n        default=...,\n        alias=\"value\",\n        title=\"Value associated with the type\",\n        description=\"The alphanumeric identifier associated with the insurer issued label.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageClass`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"value\", \"name\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageClass`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"value\", \"name\"]\n\n\nclass CoverageCostToBeneficiary(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient payments for services/products.\n    A suite of codes indicating the cost category and associated amount which\n    have been detailed in the policy and may have been  included on the health\n    card.\n    \"\"\"\n\n    __resource_type__ = \"CoverageCostToBeneficiary\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    exception: typing.List[\n        fhirtypes.CoverageCostToBeneficiaryExceptionType\n    ] | None = Field(\n        default=None,\n        alias=\"exception\",\n        title=\"Exceptions for patient payments\",\n        description=(\n            \"A suite of codes indicating exceptions or reductions to patient costs \"\n            \"and their effective periods.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    network: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"In or out of network\",\n        description=(\n            \"Is a flag to indicate whether the benefits refer to in-network \"\n            \"providers or out-of-network providers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    term: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"term\",\n        title=\"Annual or lifetime\",\n        description=(\n            \"The term or period of the values such as 'maximum lifetime benefit' or\"\n            \" 'maximum annual visits'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Cost category\",\n        description=\"The category of patient centric costs associated with treatment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    unit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Individual or family\",\n        description=\"Indicates if the benefits apply to an individual or to the family.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"The amount or percentage due from the beneficiary\",\n        description=\"The amount due from the patient for the cost category.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"The amount or percentage due from the beneficiary\",\n        description=\"The amount due from the patient for the cost category.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageCostToBeneficiary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"category\",\n            \"network\",\n            \"unit\",\n            \"term\",\n            \"valueQuantity\",\n            \"valueMoney\",\n            \"exception\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageCostToBeneficiary`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"valueQuantity\", \"valueMoney\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"value\": [\"valueMoney\", \"valueQuantity\"]}\n        return one_of_many_fields\n\n\nclass CoverageCostToBeneficiaryException(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Exceptions for patient payments.\n    A suite of codes indicating exceptions or reductions to patient costs and\n    their effective periods.\n    \"\"\"\n\n    __resource_type__ = \"CoverageCostToBeneficiaryException\"\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"The effective period of the exception\",\n        description=\"The timeframe the exception is in force.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Exception category\",\n        description=\"The code for the specific exception.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageCostToBeneficiaryException`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageCostToBeneficiaryException`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"period\"]\n\n\nclass CoveragePaymentBy(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Self-pay parties and responsibility.\n    Link to the paying party and optionally what specifically they will be\n    responsible to pay.\n    \"\"\"\n\n    __resource_type__ = \"CoveragePaymentBy\"\n\n    party: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"party\",\n        title=\"Parties performing self-payment\",\n        description=(\n            \"The list of parties providing non-insurance payment for the treatment \"\n            \"costs.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\", \"Organization\"],\n        },\n    )\n\n    responsibility: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"responsibility\",\n        title=\"Party's responsibility\",\n        description=\" Description of the financial responsibility.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    responsibility__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_responsibility\",\n        title=\"Extension field for ``responsibility``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoveragePaymentBy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"party\", \"responsibility\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoveragePaymentBy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"party\", \"responsibility\"]\n"
  },
  {
    "path": "fhir/resources/coverageeligibilityrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CoverageEligibilityRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    CoverageEligibilityRequest resource.\n    The CoverageEligibilityRequest provides patient and insurance coverage\n    information to an insurer for them to respond, in the form of an\n    CoverageEligibilityResponse, with information regarding whether the stated\n    coverage is valid and in-force and optionally to provide the insurance\n    details of the policy.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityRequest\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Author\",\n        description=\"Person who created the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    event: typing.List[fhirtypes.CoverageEligibilityRequestEventType] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"Event information\",\n        description=\"Information code for an event with a corresponding date or period.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    facility: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"facility\",\n        title=\"Servicing facility\",\n        description=\"Facility where the services are intended to be provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for coverage eligiblity request\",\n        description=\"A unique identifier assigned to this coverage eligiblity request.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: typing.List[\n        fhirtypes.CoverageEligibilityRequestInsuranceType\n    ] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Patient insurance information\",\n        description=(\n            \"Financial instruments for reimbursement for the health care products \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"insurer\",\n        title=\"Coverage issuer\",\n        description=(\n            \"The Insurer who issued the coverage in question and is the recipient \"\n            \"of the request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    item: typing.List[fhirtypes.CoverageEligibilityRequestItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Item to be evaluated for eligibiity\",\n        description=(\n            \"Service categories or billable services for which benefit details \"\n            \"and/or an authorization prior to service delivery may be required by \"\n            \"the payor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Intended recipient of products and services\",\n        description=(\n            \"The party who is the beneficiary of the supplied coverage and for whom\"\n            \" eligibility is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Desired processing priority\",\n        description=\"When the requestor expects the processor to complete processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Party responsible for the request\",\n        description=\"The provider which is responsible for the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    purpose: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"auth-requirements | benefits | discovery | validation\",\n        description=(\n            \"Code to specify whether requesting: prior authorization requirements \"\n            \"for some service categories or billing codes; benefits for coverages \"\n            \"specified or discovered; discovery and return of coverages for the \"\n            \"patient; and/or validation that the specified coverage is in-force at \"\n            \"the date/period specified or 'now' if not specified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"auth-requirements\", \"benefits\", \"discovery\", \"validation\"],\n        },\n    )\n    purpose__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Estimated date or dates of service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Estimated date or dates of service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    supportingInfo: typing.List[\n        fhirtypes.CoverageEligibilityRequestSupportingInfoType\n    ] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Supporting information\",\n        description=(\n            \"Additional information codes regarding exceptions, special \"\n            \"considerations, the condition, situation, prior or concurrent issues.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"priority\",\n            \"purpose\",\n            \"patient\",\n            \"event\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"created\",\n            \"enterer\",\n            \"provider\",\n            \"insurer\",\n            \"facility\",\n            \"supportingInfo\",\n            \"insurance\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"purpose\",\n            \"patient\",\n            \"created\",\n            \"insurer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"purpose\", \"purpose__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"serviced\": [\"servicedDate\", \"servicedPeriod\"]}\n        return one_of_many_fields\n\n\nclass CoverageEligibilityRequestEvent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Event information.\n    Information code for an event with a corresponding date or period.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityRequestEvent\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Specific event\",\n        description=\"A coded event such as when a service is expected or a card printed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    whenDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenDateTime\",\n        title=\"Occurance date or period\",\n        description=(\n            \"A date or period in the past or future indicating when the event \"\n            \"occurred or is expectd to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": True,\n        },\n    )\n    whenDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenDateTime\",\n        title=\"Extension field for ``whenDateTime``.\",\n    )\n\n    whenPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"whenPeriod\",\n        title=\"Occurance date or period\",\n        description=(\n            \"A date or period in the past or future indicating when the event \"\n            \"occurred or is expectd to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityRequestEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"whenDateTime\",\n            \"whenPeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"when\": [\"whenDateTime\", \"whenPeriod\"]}\n        return one_of_many_fields\n\n\nclass CoverageEligibilityRequestInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient insurance information.\n    Financial instruments for reimbursement for the health care products and\n    services.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityRequestInsurance\"\n\n    businessArrangement: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"businessArrangement\",\n        title=\"Additional provider contract number\",\n        description=(\n            \"A business agreement number established between the provider and the \"\n            \"insurer for special business processing purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    businessArrangement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_businessArrangement\",\n        title=\"Extension field for ``businessArrangement``.\",\n    )\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=(\n            \"Reference to the insurance card level information contained in the \"\n            \"Coverage resource. The coverage issuing insurer will use these details\"\n            \" to locate the patient's actual coverage within the insurer's \"\n            \"information system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    focal: bool | None = Field(\n        default=None,\n        alias=\"focal\",\n        title=\"Applicable coverage\",\n        description=(\n            \"A flag to indicate that this Coverage is to be used for evaluation of \"\n            \"this request when set to true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_focal\", title=\"Extension field for ``focal``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityRequestInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"focal\",\n            \"coverage\",\n            \"businessArrangement\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CoverageEligibilityRequestItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Item to be evaluated for eligibiity.\n    Service categories or billable services for which benefit details and/or an\n    authorization prior to service delivery may be required by the payor.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityRequestItem\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Product or service details\",\n        description=\"The plan/proposal/order describing the proposed service in detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    diagnosis: typing.List[\n        fhirtypes.CoverageEligibilityRequestItemDiagnosisType\n    ] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"Applicable diagnosis\",\n        description=\"Patient diagnosis for which care is sought.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    facility: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"facility\",\n        title=\"Servicing facility\",\n        description=\"Facility where the services will be provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\", \"Organization\"],\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Product or service billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"This contains the product, service, drug or other billing code for the\"\n            \" item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Perfoming practitioner\",\n        description=(\n            \"The practitioner who is responsible for the product or service to be \"\n            \"rendered to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInfoSequence: typing.List[\n        fhirtypes.PositiveIntType | None\n    ] | None = Field(\n        default=None,\n        alias=\"supportingInfoSequence\",\n        title=\"Applicable exception or supporting information\",\n        description=(\n            \"Exceptions, special conditions and supporting information applicable \"\n            \"for this service or product line.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    supportingInfoSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_supportingInfoSequence\",\n        title=\"Extension field for ``supportingInfoSequence``.\",\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=\"The amount charged to the patient by the provider for a single unit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityRequestItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"supportingInfoSequence\",\n            \"category\",\n            \"productOrService\",\n            \"modifier\",\n            \"provider\",\n            \"quantity\",\n            \"unitPrice\",\n            \"facility\",\n            \"diagnosis\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CoverageEligibilityRequestItemDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Applicable diagnosis.\n    Patient diagnosis for which care is sought.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityRequestItemDiagnosis\"\n\n    diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"diagnosisCodeableConcept\",\n        title=\"Nature of illness or problem\",\n        description=(\n            \"The nature of illness or problem in a coded form or as a reference to \"\n            \"an external defined Condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    diagnosisReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"diagnosisReference\",\n        title=\"Nature of illness or problem\",\n        description=(\n            \"The nature of illness or problem in a coded form or as a reference to \"\n            \"an external defined Condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityRequestItemDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"diagnosisCodeableConcept\",\n            \"diagnosisReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestItemDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"diagnosis\": [\"diagnosisCodeableConcept\", \"diagnosisReference\"]\n        }\n        return one_of_many_fields\n\n\nclass CoverageEligibilityRequestSupportingInfo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supporting information.\n    Additional information codes regarding exceptions, special considerations,\n    the condition, situation, prior or concurrent issues.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityRequestSupportingInfo\"\n\n    appliesToAll: bool | None = Field(\n        default=None,\n        alias=\"appliesToAll\",\n        title=\"Applies to all items\",\n        description=(\n            \"The supporting materials are applicable for all detail items, \"\n            \"product/servce categories and specific billing codes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    appliesToAll__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_appliesToAll\",\n        title=\"Extension field for ``appliesToAll``.\",\n    )\n\n    information: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"information\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Information instance identifier\",\n        description=\"A number to uniquely identify supporting information entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityRequestSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"information\",\n            \"appliesToAll\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityRequestSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/coverageeligibilityresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass CoverageEligibilityResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    CoverageEligibilityResponse resource.\n    This resource provides eligibility and plan details from the processing of\n    an CoverageEligibilityRequest resource.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityResponse\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Response creation date\",\n        description=\"The date this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A human readable description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    error: typing.List[fhirtypes.CoverageEligibilityResponseErrorType] | None = Field(\n        default=None,\n        alias=\"error\",\n        title=\"Processing errors\",\n        description=\"Errors encountered during the processing of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    event: typing.List[fhirtypes.CoverageEligibilityResponseEventType] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"Event information\",\n        description=\"Information code for an event with a corresponding date or period.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"Printed form identifier\",\n        description=\"A code for the form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for coverage eligiblity request\",\n        description=\"A unique identifier assigned to this coverage eligiblity request.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: typing.List[\n        fhirtypes.CoverageEligibilityResponseInsuranceType\n    ] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Patient insurance information\",\n        description=(\n            \"Financial instruments for reimbursement for the health care products \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"insurer\",\n        title=\"Coverage issuer\",\n        description=(\n            \"The Insurer who issued the coverage in question and is the author of \"\n            \"the response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"queued | complete | error | partial\",\n        description=\"The outcome of the request processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"queued\", \"complete\", \"error\", \"partial\"],\n        },\n    )\n    outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcome\", title=\"Extension field for ``outcome``.\"\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Intended recipient of products and services\",\n        description=(\n            \"The party who is the beneficiary of the supplied coverage and for whom\"\n            \" eligibility is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    preAuthRef: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Preauthorization reference\",\n        description=(\n            \"A reference from the Insurer to which these services pertain to be \"\n            \"used on further communication and as proof that the request occurred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    purpose: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"auth-requirements | benefits | discovery | validation\",\n        description=(\n            \"Code to specify whether requesting: prior authorization requirements \"\n            \"for some service categories or billing codes; benefits for coverages \"\n            \"specified or discovered; discovery and return of coverages for the \"\n            \"patient; and/or validation that the specified coverage is in-force at \"\n            \"the date/period specified or 'now' if not specified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"auth-requirements\", \"benefits\", \"discovery\", \"validation\"],\n        },\n    )\n    purpose__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    request: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"request\",\n        title=\"Eligibility request reference\",\n        description=\"Reference to the original request resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CoverageEligibilityRequest\"],\n        },\n    )\n\n    requestor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestor\",\n        title=\"Party responsible for the request\",\n        description=\"The provider which is responsible for the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Estimated date or dates of service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Estimated date or dates of service\",\n        description=(\n            \"The date or dates when the enclosed suite of services were performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"purpose\",\n            \"patient\",\n            \"event\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"created\",\n            \"requestor\",\n            \"request\",\n            \"outcome\",\n            \"disposition\",\n            \"insurer\",\n            \"insurance\",\n            \"preAuthRef\",\n            \"form\",\n            \"error\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"purpose\",\n            \"patient\",\n            \"created\",\n            \"request\",\n            \"outcome\",\n            \"insurer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"outcome\", \"outcome__ext\"),\n            (\"purpose\", \"purpose__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"serviced\": [\"servicedDate\", \"servicedPeriod\"]}\n        return one_of_many_fields\n\n\nclass CoverageEligibilityResponseError(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing errors.\n    Errors encountered during the processing of the request.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityResponseError\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Error code detailing processing issues\",\n        description=(\n            \"An error code,from a specified code system, which details why the \"\n            \"eligibility check could not be performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    expression: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"FHIRPath of element(s) related to issue\",\n        description=(\n            \"A [simple subset of FHIRPath](fhirpath.html#simple) limited to element\"\n            \" names, repetition indicators and the default child accessor that \"\n            \"identifies one of the elements in the resource that caused this issue \"\n            \"to be raised.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    expression__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityResponseError`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseError`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"expression\"]\n\n\nclass CoverageEligibilityResponseEvent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Event information.\n    Information code for an event with a corresponding date or period.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityResponseEvent\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Specific event\",\n        description=\"A coded event such as when a service is expected or a card printed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    whenDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenDateTime\",\n        title=\"Occurance date or period\",\n        description=(\n            \"A date or period in the past or future indicating when the event \"\n            \"occurred or is expectd to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": True,\n        },\n    )\n    whenDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenDateTime\",\n        title=\"Extension field for ``whenDateTime``.\",\n    )\n\n    whenPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"whenPeriod\",\n        title=\"Occurance date or period\",\n        description=(\n            \"A date or period in the past or future indicating when the event \"\n            \"occurred or is expectd to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityResponseEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"whenDateTime\",\n            \"whenPeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"when\": [\"whenDateTime\", \"whenPeriod\"]}\n        return one_of_many_fields\n\n\nclass CoverageEligibilityResponseInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient insurance information.\n    Financial instruments for reimbursement for the health care products and\n    services.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityResponseInsurance\"\n\n    benefitPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"benefitPeriod\",\n        title=\"When the benefits are applicable\",\n        description=\"The term of the benefits documented in this response.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=(\n            \"Reference to the insurance card level information contained in the \"\n            \"Coverage resource. The coverage issuing insurer will use these details\"\n            \" to locate the patient's actual coverage within the insurer's \"\n            \"information system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    inforce: bool | None = Field(\n        default=None,\n        alias=\"inforce\",\n        title=\"Coverage inforce indicator\",\n        description=(\n            \"Flag indicating if the coverage provided is inforce currently if no \"\n            \"service date(s) specified or for the whole duration of the service \"\n            \"dates.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    inforce__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_inforce\", title=\"Extension field for ``inforce``.\"\n    )\n\n    item: typing.List[\n        fhirtypes.CoverageEligibilityResponseInsuranceItemType\n    ] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Benefits and authorization details\",\n        description=(\n            \"Benefits and optionally current balances, and authorization details by\"\n            \" category or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityResponseInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"coverage\",\n            \"inforce\",\n            \"benefitPeriod\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"coverage\"]\n\n\nclass CoverageEligibilityResponseInsuranceItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefits and authorization details.\n    Benefits and optionally current balances, and authorization details by\n    category or service.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityResponseInsuranceItem\"\n\n    authorizationRequired: bool | None = Field(\n        default=None,\n        alias=\"authorizationRequired\",\n        title=\"Authorization required flag\",\n        description=(\n            \"A boolean flag indicating whether a preauthorization is required prior\"\n            \" to actual service delivery.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authorizationRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_authorizationRequired\",\n        title=\"Extension field for ``authorizationRequired``.\",\n    )\n\n    authorizationSupporting: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"authorizationSupporting\",\n        title=\"Type of required supporting materials\",\n        description=(\n            \"Codes or comments regarding information or actions associated with the\"\n            \" preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    authorizationUrl: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"authorizationUrl\",\n        title=\"Preauthorization requirements endpoint\",\n        description=(\n            \"A web location for obtaining requirements or descriptive information \"\n            \"regarding the preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authorizationUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_authorizationUrl\",\n        title=\"Extension field for ``authorizationUrl``.\",\n    )\n\n    benefit: typing.List[\n        fhirtypes.CoverageEligibilityResponseInsuranceItemBenefitType\n    ] | None = Field(\n        default=None,\n        alias=\"benefit\",\n        title=\"Benefit Summary\",\n        description=\"Benefits used to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the benefit or services covered\",\n        description=\"A richer description of the benefit or services covered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    excluded: bool | None = Field(\n        default=None,\n        alias=\"excluded\",\n        title=\"Excluded from the plan\",\n        description=(\n            \"True if the indicated class of service is excluded from the plan, \"\n            \"missing or False indicates the product or service is included in the \"\n            \"coverage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    excluded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_excluded\", title=\"Extension field for ``excluded``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Product or service billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Short name for the benefit\",\n        description=\"A short name or tag for the benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    network: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"In or out of network\",\n        description=(\n            \"Is a flag to indicate whether the benefits refer to in-network \"\n            \"providers or out-of-network providers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"This contains the product, service, drug or other billing code for the\"\n            \" item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Performing practitioner\",\n        description=(\n            \"The practitioner who is eligible for the provision of the product or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    term: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"term\",\n        title=\"Annual or lifetime\",\n        description=(\n            \"The term or period of the values such as 'maximum lifetime benefit' or\"\n            \" 'maximum annual visits'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Individual or family\",\n        description=\"Indicates if the benefits apply to an individual or to the family.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityResponseInsuranceItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"productOrService\",\n            \"modifier\",\n            \"provider\",\n            \"excluded\",\n            \"name\",\n            \"description\",\n            \"network\",\n            \"unit\",\n            \"term\",\n            \"benefit\",\n            \"authorizationRequired\",\n            \"authorizationSupporting\",\n            \"authorizationUrl\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseInsuranceItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass CoverageEligibilityResponseInsuranceItemBenefit(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefit Summary.\n    Benefits used to date.\n    \"\"\"\n\n    __resource_type__ = \"CoverageEligibilityResponseInsuranceItemBenefit\"\n\n    allowedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"allowedMoney\",\n        title=\"Benefits allowed\",\n        description=\"The quantity of the benefit which is permitted under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    allowedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"allowedString\",\n        title=\"Benefits allowed\",\n        description=\"The quantity of the benefit which is permitted under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    allowedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedString\",\n        title=\"Extension field for ``allowedString``.\",\n    )\n\n    allowedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"allowedUnsignedInt\",\n        title=\"Benefits allowed\",\n        description=\"The quantity of the benefit which is permitted under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    allowedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedUnsignedInt\",\n        title=\"Extension field for ``allowedUnsignedInt``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Benefit classification\",\n        description=\"Classification of benefit being provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"usedMoney\",\n        title=\"Benefits used\",\n        description=\"The quantity of the benefit which have been consumed to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    usedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usedString\",\n        title=\"Benefits used\",\n        description=\"The quantity of the benefit which have been consumed to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n    usedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usedString\", title=\"Extension field for ``usedString``.\"\n    )\n\n    usedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"usedUnsignedInt\",\n        title=\"Benefits used\",\n        description=\"The quantity of the benefit which have been consumed to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n    usedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_usedUnsignedInt\",\n        title=\"Extension field for ``usedUnsignedInt``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``CoverageEligibilityResponseInsuranceItemBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"allowedUnsignedInt\",\n            \"allowedString\",\n            \"allowedMoney\",\n            \"usedUnsignedInt\",\n            \"usedString\",\n            \"usedMoney\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``CoverageEligibilityResponseInsuranceItemBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"allowed\": [\"allowedMoney\", \"allowedString\", \"allowedUnsignedInt\"],\n            \"used\": [\"usedMoney\", \"usedString\", \"usedUnsignedInt\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/datarequirement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DataRequirement\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, element, fhirtypes\n\n\nclass DataRequirement(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes a required data item.\n    Describes a required data item for evaluation in terms of the type of data,\n    and optional code or date-based filters of the data.\n    \"\"\"\n\n    __resource_type__ = \"DataRequirement\"\n\n    codeFilter: typing.List[fhirtypes.DataRequirementCodeFilterType] | None = Field(\n        default=None,\n        alias=\"codeFilter\",\n        title=\"What codes are expected\",\n        description=(\n            \"Code filters specify additional constraints on the data, specifying \"\n            \"the value set of interest for a particular element of the data. Each \"\n            \"code filter defines an additional constraint on the data, i.e. code \"\n            \"filters are AND'ed, not OR'ed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dateFilter: typing.List[fhirtypes.DataRequirementDateFilterType] | None = Field(\n        default=None,\n        alias=\"dateFilter\",\n        title=\"What dates/date ranges are expected\",\n        description=(\n            \"Date filters specify additional constraints on the data in terms of \"\n            \"the applicable date range for specific elements. Each date filter \"\n            \"specifies an additional constraint on the data, i.e. date filters are \"\n            \"AND'ed, not OR'ed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    limit: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"limit\",\n        title=\"Number of results\",\n        description=(\n            \"Specifies a maximum number of results that are required (uses the \"\n            \"_count search parameter).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    limit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_limit\", title=\"Extension field for ``limit``.\"\n    )\n\n    mustSupport: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"mustSupport\",\n        title=(\n            \"Indicates specific structure elements that are referenced by the \"\n            \"knowledge module\"\n        ),\n        description=(\n            \"Indicates that specific elements of the type are referenced by the \"\n            \"knowledge module and must be supported by the consumer in order to \"\n            \"obtain an effective evaluation. This does not mean that a value is \"\n            \"required for this element, only that the consuming system must \"\n            \"understand the element and be able to provide values for it if they \"\n            \"are available.   The value of mustSupport SHALL be a FHIRPath \"\n            \"resolvable on the type of the DataRequirement. The path SHALL consist \"\n            \"only of identifiers, constant indexers, and .resolve() (see the \"\n            \"[Simple FHIRPath Profile](fhirpath.html#simple) for full details).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    mustSupport__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_mustSupport\", title=\"Extension field for ``mustSupport``.\"\n    )\n\n    profile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"The profile of the required data\",\n        description=(\n            \"The profile of the required data, specified as the uri of the profile \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    sort: typing.List[fhirtypes.DataRequirementSortType] | None = Field(\n        default=None,\n        alias=\"sort\",\n        title=\"Order of the results\",\n        description=\"Specifies the order of the results to be returned.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects of the data requirement. If this element is not \"\n            \"provided, a Patient subject is assumed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects of the data requirement. If this element is not \"\n            \"provided, a Patient subject is assumed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of the required data\",\n        description=(\n            \"The type of the required data, specified as the type name of a \"\n            \"resource. For profiles, this value is set to the type of the base \"\n            \"resource of the profile.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    valueFilter: typing.List[fhirtypes.DataRequirementValueFilterType] | None = Field(\n        default=None,\n        alias=\"valueFilter\",\n        title=\"What values are expected\",\n        description=(\n            \"Value filters specify additional constraints on the data for elements \"\n            \"other than code-valued or date-valued. Each value filter specifies an \"\n            \"additional constraint on the data (i.e. valueFilters are AND'ed, not \"\n            \"OR'ed).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataRequirement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"profile\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"mustSupport\",\n            \"codeFilter\",\n            \"dateFilter\",\n            \"valueFilter\",\n            \"limit\",\n            \"sort\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataRequirement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"type\",\n            \"profile\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"mustSupport\",\n            \"codeFilter\",\n            \"dateFilter\",\n            \"valueFilter\",\n            \"limit\",\n            \"sort\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"subject\": [\"subjectCodeableConcept\", \"subjectReference\"]}\n        return one_of_many_fields\n\n\nclass DataRequirementCodeFilter(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What codes are expected.\n    Code filters specify additional constraints on the data, specifying the\n    value set of interest for a particular element of the data. Each code\n    filter defines an additional constraint on the data, i.e. code filters are\n    AND'ed, not OR'ed.\n    \"\"\"\n\n    __resource_type__ = \"DataRequirementCodeFilter\"\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"What code is expected\",\n        description=(\n            \"The codes for the code filter. If values are given, the filter will \"\n            \"return only those data items for which the code-valued attribute \"\n            \"specified by the path has a value that is one of the specified codes. \"\n            \"If codes are specified in addition to a value set, the filter returns \"\n            \"items matching a code in the value set or one of the specified codes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"A code-valued attribute to filter on\",\n        description=(\n            \"The code-valued attribute of the filter. The specified path SHALL be a\"\n            \" FHIRPath resolvable on the specified type of the DataRequirement, and\"\n            \" SHALL consist only of identifiers, constant indexers, and .resolve().\"\n            \" The path is allowed to contain qualifiers (.) to traverse sub-\"\n            \"elements, as well as indexers ([x]) to traverse multiple-cardinality \"\n            \"sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) \"\n            \"for full details). Note that the index must be an integer constant. \"\n            \"The path must resolve to an element of type code, Coding, or \"\n            \"CodeableConcept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    searchParam: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"searchParam\",\n        title=\"A coded (token) parameter to search on\",\n        description=(\n            \"A token parameter that refers to a search parameter defined on the \"\n            \"specified type of the DataRequirement, and which searches on elements \"\n            \"of type code, Coding, or CodeableConcept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    searchParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_searchParam\", title=\"Extension field for ``searchParam``.\"\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"ValueSet for the filter\",\n        description=(\n            \"The valueset for the code filter. The valueSet and code elements are \"\n            \"additive. If valueSet is specified, the filter will return only those \"\n            \"data items for which the value of the code-valued element specified in\"\n            \" the path is a member of the specified valueset.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataRequirementCodeFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"path\", \"searchParam\", \"valueSet\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataRequirementCodeFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"path\", \"searchParam\", \"valueSet\", \"code\"]\n\n\nclass DataRequirementDateFilter(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What dates/date ranges are expected.\n    Date filters specify additional constraints on the data in terms of the\n    applicable date range for specific elements. Each date filter specifies an\n    additional constraint on the data, i.e. date filters are AND'ed, not OR'ed.\n    \"\"\"\n\n    __resource_type__ = \"DataRequirementDateFilter\"\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"A date-valued attribute to filter on\",\n        description=(\n            \"The date-valued attribute of the filter. The specified path SHALL be a\"\n            \" FHIRPath resolvable on the specified type of the DataRequirement, and\"\n            \" SHALL consist only of identifiers, constant indexers, and .resolve().\"\n            \" The path is allowed to contain qualifiers (.) to traverse sub-\"\n            \"elements, as well as indexers ([x]) to traverse multiple-cardinality \"\n            \"sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) \"\n            \"for full details). Note that the index must be an integer constant. \"\n            \"The path must resolve to an element of type date, dateTime, Period, \"\n            \"Schedule, or Timing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    searchParam: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"searchParam\",\n        title=\"A date valued parameter to search on\",\n        description=(\n            \"A date parameter that refers to a search parameter defined on the \"\n            \"specified type of the DataRequirement, and which searches on elements \"\n            \"of type date, dateTime, Period, Schedule, or Timing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    searchParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_searchParam\", title=\"Extension field for ``searchParam``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"The value of the filter, as a Period, DateTime, or Duration value\",\n        description=(\n            \"The value of the filter. If period is specified, the filter will \"\n            \"return only those data items that fall within the bounds determined by\"\n            \" the Period, inclusive of the period boundaries. If dateTime is \"\n            \"specified, the filter will return only those data items that are equal\"\n            \" to the specified dateTime. If a Duration is specified, the filter \"\n            \"will return only those data items that fall within Duration before \"\n            \"now.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"The value of the filter, as a Period, DateTime, or Duration value\",\n        description=(\n            \"The value of the filter. If period is specified, the filter will \"\n            \"return only those data items that fall within the bounds determined by\"\n            \" the Period, inclusive of the period boundaries. If dateTime is \"\n            \"specified, the filter will return only those data items that are equal\"\n            \" to the specified dateTime. If a Duration is specified, the filter \"\n            \"will return only those data items that fall within Duration before \"\n            \"now.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"The value of the filter, as a Period, DateTime, or Duration value\",\n        description=(\n            \"The value of the filter. If period is specified, the filter will \"\n            \"return only those data items that fall within the bounds determined by\"\n            \" the Period, inclusive of the period boundaries. If dateTime is \"\n            \"specified, the filter will return only those data items that are equal\"\n            \" to the specified dateTime. If a Duration is specified, the filter \"\n            \"will return only those data items that fall within Duration before \"\n            \"now.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataRequirementDateFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"path\",\n            \"searchParam\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"valueDuration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataRequirementDateFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"path\", \"searchParam\", \"valueDateTime\", \"valuePeriod\", \"valueDuration\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\"valueDateTime\", \"valueDuration\", \"valuePeriod\"]\n        }\n        return one_of_many_fields\n\n\nclass DataRequirementSort(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Order of the results.\n    Specifies the order of the results to be returned.\n    \"\"\"\n\n    __resource_type__ = \"DataRequirementSort\"\n\n    direction: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"direction\",\n        title=\"ascending | descending\",\n        description=\"The direction of the sort, ascending or descending.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"ascending\", \"descending\"],\n        },\n    )\n    direction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_direction\", title=\"Extension field for ``direction``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"The name of the attribute to perform the sort\",\n        description=(\n            \"The attribute of the sort. The specified path must be resolvable from \"\n            \"the type of the required data. The path is allowed to contain \"\n            \"qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to \"\n            \"traverse multiple-cardinality sub-elements. Note that the index must \"\n            \"be an integer constant.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataRequirementSort`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"path\", \"direction\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataRequirementSort`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"path\", \"direction\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"direction\", \"direction__ext\"), (\"path\", \"path__ext\")]\n        return required_fields\n\n\nclass DataRequirementValueFilter(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What values are expected.\n    Value filters specify additional constraints on the data for elements other\n    than code-valued or date-valued. Each value filter specifies an additional\n    constraint on the data (i.e. valueFilters are AND'ed, not OR'ed).\n    \"\"\"\n\n    __resource_type__ = \"DataRequirementValueFilter\"\n\n    comparator: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"comparator\",\n        title=\"eq | gt | lt | ge | le | sa | eb\",\n        description=\"The comparator to be used to determine whether the value is matching.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"eq\", \"gt\", \"lt\", \"ge\", \"le\", \"sa\", \"eb\"],\n        },\n    )\n    comparator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comparator\", title=\"Extension field for ``comparator``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"An attribute to filter on\",\n        description=(\n            \"The attribute of the filter. The specified path SHALL be a FHIRPath \"\n            \"resolvable on the specified type of the DataRequirement, and SHALL \"\n            \"consist only of identifiers, constant indexers, and .resolve(). The \"\n            \"path is allowed to contain qualifiers (.) to traverse sub-elements, as\"\n            \" well as indexers ([x]) to traverse multiple-cardinality sub-elements \"\n            \"(see the [Simple FHIRPath Profile](fhirpath.html#simple) for full \"\n            \"details). Note that the index must be an integer constant. The path \"\n            \"must resolve to an element of a type that is comparable to the \"\n            \"valueFilter.value[x] element for the filter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    searchParam: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"searchParam\",\n        title=\"A parameter to search on\",\n        description=(\n            \"A search parameter defined on the specified type of the \"\n            \"DataRequirement, and which searches on elements of a type compatible \"\n            \"with the type of the valueFilter.value[x] for the filter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    searchParam__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_searchParam\", title=\"Extension field for ``searchParam``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"The value of the filter, as a Period, DateTime, or Duration value\",\n        description=\"The value of the filter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"The value of the filter, as a Period, DateTime, or Duration value\",\n        description=\"The value of the filter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"The value of the filter, as a Period, DateTime, or Duration value\",\n        description=\"The value of the filter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataRequirementValueFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"path\",\n            \"searchParam\",\n            \"comparator\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"valueDuration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataRequirementValueFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"path\",\n            \"searchParam\",\n            \"comparator\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"valueDuration\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\"valueDateTime\", \"valueDuration\", \"valuePeriod\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/datatype.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DataType\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import element\n\n\nclass DataType(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Reuseable Types.\n    The base class for all re-useable types defined as part of the FHIR\n    Specification.\n    \"\"\"\n\n    __resource_type__ = \"DataType\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DataType`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DataType`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n"
  },
  {
    "path": "fhir/resources/detectedissue.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DetectedIssue\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DetectedIssue(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Clinical issue with action.\n    Indicates an actual or potential clinical issue with or between one or more\n    active or proposed clinical actions for a patient; e.g. Drug-drug\n    interaction, Ineffective treatment frequency, Procedure-condition conflict,\n    gaps in care, etc.\n    \"\"\"\n\n    __resource_type__ = \"DetectedIssue\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"The provider or device that identified the issue\",\n        description=(\n            \"Individual or device responsible for the issue being raised.  For \"\n            \"example, a decision support application or a pharmacist conducting a \"\n            \"medication review.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of detected issue, e.g. drug-drug, duplicate therapy, etc\",\n        description=\"A code that classifies the general type of detected issue.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"Specific type of detected issue, e.g. drug-drug, duplicate therapy, \" \"etc\"\n        ),\n        description=\"Identifies the specific type of issue identified.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    detail: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Description and context\",\n        description=\"A textual explanation of the detected issue.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_detail\", title=\"Extension field for ``detail``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter detected issue is part of\",\n        description=\"The encounter during which this issue was detected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    evidence: typing.List[fhirtypes.DetectedIssueEvidenceType] | None = Field(\n        default=None,\n        alias=\"evidence\",\n        title=\"Supporting evidence\",\n        description=(\n            \"Supporting evidence or manifestations that provide the basis for \"\n            \"identifying the detected issue such as a GuidanceResponse or \"\n            \"MeasureReport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifiedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"identifiedDateTime\",\n        title=\"When identified\",\n        description=\"The date or period when the detected issue was initially identified.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e identified[x]\n            \"one_of_many\": \"identified\",\n            \"one_of_many_required\": False,\n        },\n    )\n    identifiedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_identifiedDateTime\",\n        title=\"Extension field for ``identifiedDateTime``.\",\n    )\n\n    identifiedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"identifiedPeriod\",\n        title=\"When identified\",\n        description=\"The date or period when the detected issue was initially identified.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e identified[x]\n            \"one_of_many\": \"identified\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique id for the detected issue\",\n        description=\"Business identifier associated with the detected issue record.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    implicated: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"implicated\",\n        title=\"Problem resource\",\n        description=(\n            \"Indicates the resource representing the current activity or proposed \"\n            \"activity that is potentially problematic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    mitigation: typing.List[fhirtypes.DetectedIssueMitigationType] | None = Field(\n        default=None,\n        alias=\"mitigation\",\n        title=\"Step taken to address\",\n        description=(\n            \"Indicates an action that has been taken or is committed to reduce or \"\n            \"eliminate the likelihood of the risk identified by the detected issue \"\n            \"from manifesting.  Can also reflect an observation of known mitigating\"\n            \" factors that may reduce/eliminate the need for any action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reference: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Authority for issue\",\n        description=(\n            \"The literature, knowledge-base or similar reference that describes the\"\n            \" propensity for the detected issue identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"high | moderate | low\",\n        description=(\n            \"Indicates the degree of importance associated with the identified \"\n            \"issue based on the potential impact on the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"high\", \"moderate\", \"low\"],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"preliminary | final | entered-in-error | mitigated\",\n        description=\"Indicates the status of the detected issue.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"preliminary\", \"final\", \"entered-in-error\", \"mitigated\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Associated subject\",\n        description=(\n            \"Indicates the subject whose record the detected issue is associated \"\n            \"with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Device\",\n                \"Location\",\n                \"Organization\",\n                \"Procedure\",\n                \"Practitioner\",\n                \"Medication\",\n                \"Substance\",\n                \"BiologicallyDerivedProduct\",\n                \"NutritionProduct\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DetectedIssue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"severity\",\n            \"subject\",\n            \"encounter\",\n            \"identifiedDateTime\",\n            \"identifiedPeriod\",\n            \"author\",\n            \"implicated\",\n            \"evidence\",\n            \"detail\",\n            \"reference\",\n            \"mitigation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DetectedIssue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"code\",\n            \"severity\",\n            \"subject\",\n            \"encounter\",\n            \"identifiedDateTime\",\n            \"identifiedPeriod\",\n            \"author\",\n            \"implicated\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"identified\": [\"identifiedDateTime\", \"identifiedPeriod\"]}\n        return one_of_many_fields\n\n\nclass DetectedIssueEvidence(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supporting evidence.\n    Supporting evidence or manifestations that provide the basis for\n    identifying the detected issue such as a GuidanceResponse or MeasureReport.\n    \"\"\"\n\n    __resource_type__ = \"DetectedIssueEvidence\"\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Manifestation\",\n        description=\"A manifestation that led to the recording of this detected issue.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Supporting information\",\n        description=(\n            \"Links to resources that constitute evidence for the detected issue \"\n            \"such as a GuidanceResponse or MeasureReport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DetectedIssueEvidence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DetectedIssueEvidence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DetectedIssueMitigation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Step taken to address.\n    Indicates an action that has been taken or is committed to reduce or\n    eliminate the likelihood of the risk identified by the detected issue from\n    manifesting.  Can also reflect an observation of known mitigating factors\n    that may reduce/eliminate the need for any action.\n    \"\"\"\n\n    __resource_type__ = \"DetectedIssueMitigation\"\n\n    action: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"action\",\n        title=\"What mitigation?\",\n        description=(\n            \"Describes the action that was taken or the observation that was made \"\n            \"that reduces/eliminates the risk associated with the identified issue.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who is committing?\",\n        description=(\n            \"Identifies the practitioner who determined the mitigation and takes \"\n            \"responsibility for the mitigation step occurring.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date committed\",\n        description=\"Indicates when the mitigating action was documented.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional notes about the mitigation\",\n        description=(\n            \"Clinicians may add additional notes or justifications about the \"\n            \"mitigation action. For example, patient can have this drug because \"\n            \"they have had it before without any issues. Multiple justifications \"\n            \"may be provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DetectedIssueMitigation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"action\",\n            \"date\",\n            \"author\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DetectedIssueMitigation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/device.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Device\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Device(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Item used in healthcare.\n    A type of a manufactured item that is used in the provision of healthcare\n    without being substantially changed through that activity. The device may\n    be a medical or non-medical device.\n    \"\"\"\n\n    __resource_type__ = \"Device\"\n\n    availabilityStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"availabilityStatus\",\n        title=\"lost | damaged | destroyed | available\",\n        description=\"The availability of the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    biologicalSourceEvent: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"biologicalSourceEvent\",\n        title=(\n            \"An identifier that supports traceability to the event during which \"\n            \"material in this product from one or more biological entities was \"\n            \"obtained or pooled\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Indicates a high-level grouping of the device\",\n        description=\"Devices may be associated with one or more categories.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    conformsTo: typing.List[fhirtypes.DeviceConformsToType] | None = Field(\n        default=None,\n        alias=\"conformsTo\",\n        title=(\n            \"Identifies the standards, specifications, or formal guidances for the \"\n            \"capabilities supported by the device\"\n        ),\n        description=(\n            \"Identifies the standards, specifications, or formal guidances for the \"\n            \"capabilities supported by the device. The device may be certified as \"\n            \"conformant to these specifications e.g., communication, performance, \"\n            \"process, measurement, or specialization standards.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Details for human/organization for support\",\n        description=(\n            \"Contact details for an organization or a particular human that is \"\n            \"responsible for the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    cycle: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"cycle\",\n        title=(\n            \"The series of occurrences that repeats during the operation of the \"\n            \"device\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"The reference to the definition for the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceDefinition\"],\n        },\n    )\n\n    displayName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"displayName\",\n        title=\"The name used to display by default when the device is referenced\",\n        description=(\n            \"The name used to display by default when the device is referenced. \"\n            \"Based on intent of use by the resource creator, this may reflect one \"\n            \"of the names in Device.name, or may be another simple name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    displayName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_displayName\", title=\"Extension field for ``displayName``.\"\n    )\n\n    duration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=(\n            \"A measurement of time during the device's operation (e.g., days, \"\n            \"hours, mins, etc.)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to electronic services provided \"\n            \"by the device\"\n        ),\n        description=(\n            \"Technical endpoints providing access to services provided by the \"\n            \"device defined at this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    expirationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expirationDate\",\n        title=\"Date and time of expiry of this device (if applicable)\",\n        description=(\n            \"The date and time beyond which this device is no longer valid or \"\n            \"should not be used (if applicable).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_expirationDate\",\n        title=\"Extension field for ``expirationDate``.\",\n    )\n\n    gateway: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"gateway\",\n        title=(\n            \"Linked device acting as a communication/data collector, translator or \"\n            \"controller\"\n        ),\n        description=(\n            \"The linked device acting as a communication controller, data \"\n            \"collector, translator, or concentrator for the current device (e.g., \"\n            \"mobile phone application that relays a blood pressure device's data).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Instance identifier\",\n        description=(\n            \"Unique instance identifiers assigned to a device by manufacturers \"\n            \"other organizations or owners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the device is found\",\n        description=\"The place where the device can be found.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    lotNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lotNumber\",\n        title=\"Lot number of manufacture\",\n        description=\"Lot number assigned by the manufacturer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lotNumber\", title=\"Extension field for ``lotNumber``.\"\n    )\n\n    manufactureDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"manufactureDate\",\n        title=\"Date when the device was made\",\n        description=\"The date and time when the device was manufactured.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    manufactureDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_manufactureDate\",\n        title=\"Extension field for ``manufactureDate``.\",\n    )\n\n    manufacturer: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Name of device manufacturer\",\n        description=(\n            \"A name of the manufacturer or entity legally responsible for the \"\n            \"device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    manufacturer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_manufacturer\",\n        title=\"Extension field for ``manufacturer``.\",\n    )\n\n    mode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"The designated condition for performing a task\",\n        description=\"The designated condition for performing a task with the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modelNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"modelNumber\",\n        title=\"The manufacturer's model number for the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    modelNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_modelNumber\", title=\"Extension field for ``modelNumber``.\"\n    )\n\n    name: typing.List[fhirtypes.DeviceNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=(\n            \"The name or names of the device as known to the manufacturer and/or \"\n            \"patient\"\n        ),\n        description=(\n            \"This represents the manufacturer's name of the device as provided by \"\n            \"the device, from a UDI label, or by a person describing the Device.  \"\n            \"This typically would be used when a person provides the name(s) or \"\n            \"when the device represents one of the names available from \"\n            \"DeviceDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Device notes and comments\",\n        description=(\n            \"Descriptive information, usage information or implantation information\"\n            \" that is not captured in an existing element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    owner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"owner\",\n        title=\"Organization responsible for device\",\n        description=(\n            \"An organization that is responsible for the provision and ongoing \"\n            \"maintenance of the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    parent: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=(\n            \"The higher level or encompassing device that this device is a logical \"\n            \"part of\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    partNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"partNumber\",\n        title=\"The part number or catalog number of the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    partNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_partNumber\", title=\"Extension field for ``partNumber``.\"\n    )\n\n    property: typing.List[fhirtypes.DevicePropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=(\n            \"Inherent, essentially fixed, characteristics of the device.  e.g., \"\n            \"time properties, size, material, etc.\"\n        ),\n        description=(\n            \"Static or essentially fixed characteristics or features of the device \"\n            \"(e.g., time or timing attributes, resolution, accuracy, intended use \"\n            \"or instructions for use, and physical attributes) that are not \"\n            \"otherwise captured in more specific attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    safety: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"safety\",\n        title=\"Safety Characteristics of Device\",\n        description=(\n            \"Provides additional safety characteristics about a medical device.  \"\n            \"For example devices containing latex.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serialNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"serialNumber\",\n        title=\"Serial number assigned by the manufacturer\",\n        description=(\n            \"The serial number assigned by the organization when the device was \"\n            \"manufactured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    serialNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_serialNumber\",\n        title=\"Extension field for ``serialNumber``.\",\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=(\n            \"The Device record status. This is not the status of the device like \"\n            \"availability.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind or type of device\",\n        description=(\n            \"The kind or type of device. A device instance may have more than one \"\n            \"type - in which case those are the types that apply to the specific \"\n            \"instance of the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udiCarrier: typing.List[fhirtypes.DeviceUdiCarrierType] | None = Field(\n        default=None,\n        alias=\"udiCarrier\",\n        title=\"Unique Device Identifier (UDI) Barcode string\",\n        description=(\n            \"Unique device identifier (UDI) assigned to device label or package.  \"\n            \"Note that the Device may include multiple udiCarriers as it either may\"\n            \" include just the udiCarrier for the jurisdiction it is sold, or for \"\n            \"multiple jurisdictions it could have been sold.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Network address to contact device\",\n        description=\"A network address on which the device may be contacted directly.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    version: typing.List[fhirtypes.DeviceVersionType] | None = Field(\n        default=None,\n        alias=\"version\",\n        title=(\n            \"The actual design of the device or software version running on the \"\n            \"device\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Device`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"displayName\",\n            \"definition\",\n            \"udiCarrier\",\n            \"status\",\n            \"availabilityStatus\",\n            \"biologicalSourceEvent\",\n            \"manufacturer\",\n            \"manufactureDate\",\n            \"expirationDate\",\n            \"lotNumber\",\n            \"serialNumber\",\n            \"name\",\n            \"modelNumber\",\n            \"partNumber\",\n            \"category\",\n            \"type\",\n            \"version\",\n            \"conformsTo\",\n            \"property\",\n            \"mode\",\n            \"cycle\",\n            \"duration\",\n            \"owner\",\n            \"contact\",\n            \"location\",\n            \"url\",\n            \"endpoint\",\n            \"gateway\",\n            \"note\",\n            \"safety\",\n            \"parent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Device`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"udiCarrier\",\n            \"status\",\n            \"safety\",\n        ]\n\n\nclass DeviceConformsTo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Identifies the standards, specifications, or formal guidances for the\n    capabilities supported by the device.\n    Identifies the standards, specifications, or formal guidances for the\n    capabilities supported by the device. The device may be certified as\n    conformant to these specifications e.g., communication, performance,\n    process, measurement, or specialization standards.\n    \"\"\"\n\n    __resource_type__ = \"DeviceConformsTo\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=(\n            \"Describes the common type of the standard, specification, or formal \"\n            \"guidance.  communication | performance | measurement\"\n        ),\n        description=\"Describes the type of the standard, specification, or formal guidance.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specification: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"specification\",\n        title=(\n            \"Identifies the standard, specification, or formal guidance that the \"\n            \"device adheres to\"\n        ),\n        description=(\n            \"Code that identifies the specific standard, specification, protocol, \"\n            \"formal guidance, regulation, legislation, or certification scheme to \"\n            \"which the device adheres.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Specific form or variant of the standard\",\n        description=(\n            \"Identifies the specific form or variant of the standard, \"\n            \"specification, or formal guidance. This may be a 'version number', \"\n            \"release, document edition, publication year, or other label.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceConformsTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"specification\",\n            \"version\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceConformsTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DeviceName(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The name or names of the device as known to the manufacturer and/or patient.\n    This represents the manufacturer's name of the device as provided by the\n    device, from a UDI label, or by a person describing the Device.  This\n    typically would be used when a person provides the name(s) or when the\n    device represents one of the names available from DeviceDefinition.\n    \"\"\"\n\n    __resource_type__ = \"DeviceName\"\n\n    display: bool | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"The preferred device name\",\n        description=\"Indicates the default or preferred name to be displayed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"registered-name | user-friendly-name | patient-reported-name\",\n        description=(\n            \"Indicates the kind of name. RegisteredName | UserFriendlyName | \"\n            \"PatientReportedName.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"registered-name\",\n                \"user-friendly-name\",\n                \"patient-reported-name\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The term that names the device\",\n        description=\"The actual name that identifies the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"value\", \"type\", \"display\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"value\", \"type\", \"display\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass DeviceProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Inherent, essentially fixed, characteristics of the device.  e.g., time\n    properties, size, material, etc..\n    Static or essentially fixed characteristics or features of the device\n    (e.g., time or timing attributes, resolution, accuracy, intended use or\n    instructions for use, and physical attributes) that are not otherwise\n    captured in more specific attributes.\n    \"\"\"\n\n    __resource_type__ = \"DeviceProperty\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Code that specifies the property being represented\",\n        description=(\n            \"Code that specifies the property, such as resolution, color, size, \"\n            \"being represented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueRange\",\n            \"valueAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueInteger\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass DeviceUdiCarrier(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Unique Device Identifier (UDI) Barcode string.\n    Unique device identifier (UDI) assigned to device label or package.  Note\n    that the Device may include multiple udiCarriers as it either may include\n    just the udiCarrier for the jurisdiction it is sold, or for multiple\n    jurisdictions it could have been sold.\n    \"\"\"\n\n    __resource_type__ = \"DeviceUdiCarrier\"\n\n    carrierAIDC: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"carrierAIDC\",\n        title=\"UDI Machine Readable Barcode String\",\n        description=(\n            \"The full UDI carrier of the Automatic Identification and Data Capture \"\n            \"(AIDC) technology representation of the barcode string as printed on \"\n            \"the packaging of the device - e.g., a barcode or RFID.   Because of \"\n            \"limitations on character sets in XML and the need to round-trip JSON \"\n            \"data through XML, AIDC Formats *SHALL* be base64 encoded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    carrierAIDC__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_carrierAIDC\", title=\"Extension field for ``carrierAIDC``.\"\n    )\n\n    carrierHRF: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"carrierHRF\",\n        title=\"UDI Human Readable Barcode String\",\n        description=(\n            \"The full UDI carrier as the human readable form (HRF) representation \"\n            \"of the barcode string as printed on the packaging of the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    carrierHRF__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_carrierHRF\", title=\"Extension field for ``carrierHRF``.\"\n    )\n\n    deviceIdentifier: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"deviceIdentifier\",\n        title=\"Mandatory fixed portion of UDI\",\n        description=(\n            \"The device identifier (DI) is a mandatory, fixed portion of a UDI that\"\n            \" identifies the labeler and the specific version or model of a device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    deviceIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deviceIdentifier\",\n        title=\"Extension field for ``deviceIdentifier``.\",\n    )\n\n    entryType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"entryType\",\n        title=(\n            \"barcode | rfid | manual | card | self-reported | electronic-\"\n            \"transmission | unknown\"\n        ),\n        description=\"A coded entry to indicate how the data was entered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"barcode\",\n                \"rfid\",\n                \"manual\",\n                \"card\",\n                \"self-reported\",\n                \"electronic-transmission\",\n                \"unknown\",\n            ],\n        },\n    )\n    entryType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_entryType\", title=\"Extension field for ``entryType``.\"\n    )\n\n    issuer: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"issuer\",\n        title=\"UDI Issuing Organization\",\n        description=(\n            \"Organization that is charged with issuing UDIs for devices. For \"\n            \"example, the US FDA issuers include:  1) GS1: \"\n            \"http://hl7.org/fhir/NamingSystem/gs1-di,  2) HIBCC: \"\n            \"http://hl7.org/fhir/NamingSystem/hibcc-diI,  3) ICCBBA for blood \"\n            \"containers: http://hl7.org/fhir/NamingSystem/iccbba-blood-di,  4) \"\n            \"ICCBA for other devices: http://hl7.org/fhir/NamingSystem/iccbba-\"\n            \"other-di # Informationsstelle f\\u00fcr Arzneispezialit\\u00e4ten (IFA GmbH) (EU \"\n            \"only): http://hl7.org/fhir/NamingSystem/ifa-gmbh-di.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    issuer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issuer\", title=\"Extension field for ``issuer``.\"\n    )\n\n    jurisdiction: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Regional UDI authority\",\n        description=(\n            \"The identity of the authoritative source for UDI generation within a \"\n            \"jurisdiction. All UDIs are globally unique within a single namespace \"\n            \"with the appropriate repository uri as the system. For example, UDIs \"\n            \"of devices managed in the U.S. by the FDA, the value is \"\n            \"http://hl7.org/fhir/NamingSystem/us-fda-udi or in the European Union \"\n            \"by the European Commission http://hl7.org/fhir/NamingSystem/eu-ec-udi.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    jurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_jurisdiction\",\n        title=\"Extension field for ``jurisdiction``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceUdiCarrier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"deviceIdentifier\",\n            \"issuer\",\n            \"jurisdiction\",\n            \"carrierAIDC\",\n            \"carrierHRF\",\n            \"entryType\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceUdiCarrier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"deviceIdentifier\",\n            \"issuer\",\n            \"carrierAIDC\",\n            \"carrierHRF\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"deviceIdentifier\", \"deviceIdentifier__ext\"),\n            (\"issuer\", \"issuer__ext\"),\n        ]\n        return required_fields\n\n\nclass DeviceVersion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The actual design of the device or software version running on the device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceVersion\"\n\n    component: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"component\",\n        title=(\n            \"The hardware or software module of the device to which the version \"\n            \"applies\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    installDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"installDate\",\n        title=\"The date the version was installed on the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    installDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_installDate\", title=\"Extension field for ``installDate``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of the device version, e.g. manufacturer, approved, internal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The version text\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"component\",\n            \"installDate\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/deviceassociation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceAssociation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DeviceAssociation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A record of association or dissociation of a device with a patient.\n    \"\"\"\n\n    __resource_type__ = \"DeviceAssociation\"\n\n    bodyStructure: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"bodyStructure\",\n        title=\"Current anatomical location of the device in/on subject\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BodyStructure\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Describes the relationship between the device and subject\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    device: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"device\",\n        title=\"Reference to the devices associated with the patient or group\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Instance identifier\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    operation: typing.List[fhirtypes.DeviceAssociationOperationType] | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=(\n            \"The details about the device when it is in use to describe its \"\n            \"operation\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Begin and end dates and times for the device association\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"status\",\n        title=\"implanted | explanted | attached | entered-in-error | unknown\",\n        description=\"Indicates the state of the Device association.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    statusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"The reasons given for the current association status\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=(\n            \"The individual, group of individuals or device that the device is on \"\n            \"or associated with\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceAssociation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"device\",\n            \"category\",\n            \"status\",\n            \"statusReason\",\n            \"subject\",\n            \"bodyStructure\",\n            \"period\",\n            \"operation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceAssociation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"device\",\n            \"category\",\n            \"status\",\n            \"statusReason\",\n            \"subject\",\n            \"bodyStructure\",\n            \"period\",\n            \"operation\",\n        ]\n\n\nclass DeviceAssociationOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The details about the device when it is in use to describe its operation.\n    \"\"\"\n\n    __resource_type__ = \"DeviceAssociationOperation\"\n\n    operator: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"operator\",\n        title=\"The individual performing the action enabled by the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\", \"RelatedPerson\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Begin and end dates and times for the device's operation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"status\",\n        title=\"Device operational condition\",\n        description=\"Device operational condition corresponding to the association.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceAssociationOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"status\", \"operator\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceAssociationOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"status\", \"operator\", \"period\"]\n"
  },
  {
    "path": "fhir/resources/devicedefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DeviceDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An instance of a medical-related component of a medical device.\n    The characteristics, operational status and capabilities of a medical-\n    related component of a medical device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinition\"\n\n    chargeItem: typing.List[fhirtypes.DeviceDefinitionChargeItemType] | None = Field(\n        default=None,\n        alias=\"chargeItem\",\n        title=\"Billing code or reference associated with the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    classification: typing.List[\n        fhirtypes.DeviceDefinitionClassificationType\n    ] | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=\"What kind of device or device system this is\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    conformsTo: typing.List[fhirtypes.DeviceDefinitionConformsToType] | None = Field(\n        default=None,\n        alias=\"conformsTo\",\n        title=(\n            \"Identifies the standards, specifications, or formal guidances for the \"\n            \"capabilities supported by the device\"\n        ),\n        description=(\n            \"Identifies the standards, specifications, or formal guidances for the \"\n            \"capabilities supported by the device. The device may be certified as \"\n            \"conformant to these specifications e.g., communication, performance, \"\n            \"process, measurement, or specialization standards.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Details for human/organization for support\",\n        description=(\n            \"Contact details for an organization or a particular human that is \"\n            \"responsible for the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    correctiveAction: fhirtypes.DeviceDefinitionCorrectiveActionType | None = Field(\n        default=None,\n        alias=\"correctiveAction\",\n        title=\"Tracking of latest field safety corrective action\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Additional information to describe the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    deviceName: typing.List[fhirtypes.DeviceDefinitionDeviceNameType] | None = Field(\n        default=None,\n        alias=\"deviceName\",\n        title=\"The name or names of the device as given by the manufacturer\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    guideline: fhirtypes.DeviceDefinitionGuidelineType | None = Field(\n        default=None,\n        alias=\"guideline\",\n        title=(\n            \"Information aimed at providing directions for the usage of this model \"\n            \"of device\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    hasPart: typing.List[fhirtypes.DeviceDefinitionHasPartType] | None = Field(\n        default=None,\n        alias=\"hasPart\",\n        title=\"A device, part of the current one\",\n        description=\"A device that is part (for example a component) of the present device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Instance identifier\",\n        description=(\n            \"Unique instance identifiers assigned to a device by the software, \"\n            \"manufacturers, other organizations or owners. For example: handle ID. \"\n            \"The identifier is typically valued if the udiDeviceIdentifier, \"\n            \"partNumber or modelNumber is not valued and represents a different \"\n            \"type of identifier.  However, it is permissible to still include those\"\n            \" identifiers in DeviceDefinition.identifier with the appropriate \"\n            \"identifier.type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    languageCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"languageCode\",\n        title=(\n            \"Language code for the human-readable text strings produced by the \"\n            \"device (all supported)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.DeviceDefinitionLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=(\n            \"An associated device, attached to, used with, communicating with or \"\n            \"linking a previous or new device model to the focal device\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    manufacturer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Name of device manufacturer\",\n        description=(\n            \"A name of the manufacturer  or legal representative e.g. labeler. \"\n            \"Whether this is the actual manufacturer or the labeler or responsible \"\n            \"depends on implementation and jurisdiction.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    material: typing.List[fhirtypes.DeviceDefinitionMaterialType] | None = Field(\n        default=None,\n        alias=\"material\",\n        title=\"A substance used to create the material(s) of which the device is made\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modelNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"modelNumber\",\n        title=(\n            \"The catalog or model number for the device for example as defined by \"\n            \"the manufacturer\"\n        ),\n        description=(\n            \"The model number for the device for example as defined by the \"\n            \"manufacturer or labeler, or other agency.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    modelNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_modelNumber\", title=\"Extension field for ``modelNumber``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Device notes and comments\",\n        description=(\n            \"Descriptive information, usage information or implantation information\"\n            \" that is not captured in an existing element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    owner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"owner\",\n        title=\"Organization responsible for device\",\n        description=(\n            \"An organization that is responsible for the provision and ongoing \"\n            \"maintenance of the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    packaging: typing.List[fhirtypes.DeviceDefinitionPackagingType] | None = Field(\n        default=None,\n        alias=\"packaging\",\n        title=(\n            \"Information about the packaging of the device, i.e. how the device is \"\n            \"packaged\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"partNumber\",\n        title=\"The part number or catalog number of the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    partNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_partNumber\", title=\"Extension field for ``partNumber``.\"\n    )\n\n    productionIdentifierInUDI: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"productionIdentifierInUDI\",\n        title=(\n            \"lot-number | manufactured-date | serial-number | expiration-date | \"\n            \"biological-source | software-version\"\n        ),\n        description=(\n            \"Indicates the production identifier(s) that are expected to appear in \"\n            \"the UDI carrier on the device label.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"lot-number\",\n                \"manufactured-date\",\n                \"serial-number\",\n                \"expiration-date\",\n                \"biological-source\",\n                \"software-version\",\n            ],\n        },\n    )\n    productionIdentifierInUDI__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_productionIdentifierInUDI\",\n        title=\"Extension field for ``productionIdentifierInUDI``.\",\n    )\n\n    property: typing.List[fhirtypes.DeviceDefinitionPropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=(\n            \"Inherent, essentially fixed, characteristics of this kind of device, \"\n            \"e.g., time properties, size, etc\"\n        ),\n        description=(\n            \"Static or essentially fixed characteristics or features of this kind \"\n            \"of device that are otherwise not captured in more specific attributes,\"\n            \" e.g., time or timing attributes, resolution, accuracy, and physical \"\n            \"attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    regulatoryIdentifier: typing.List[\n        fhirtypes.DeviceDefinitionRegulatoryIdentifierType\n    ] | None = Field(\n        default=None,\n        alias=\"regulatoryIdentifier\",\n        title=\"Regulatory identifier(s) associated with this device\",\n        description=(\n            \"Identifier associated with the regulatory documentation (certificates,\"\n            \" technical documentation, post-market surveillance documentation and \"\n            \"reports) of a set of device models sharing the same intended purpose, \"\n            \"risk class and essential design and manufacturing characteristics. One\"\n            \" example is the Basic UDI-DI in Europe.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    safety: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"safety\",\n        title=\"Safety characteristics of the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    shelfLifeStorage: typing.List[fhirtypes.ProductShelfLifeType] | None = Field(\n        default=None,\n        alias=\"shelfLifeStorage\",\n        title=\"Shelf Life and storage information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udiDeviceIdentifier: typing.List[\n        fhirtypes.DeviceDefinitionUdiDeviceIdentifierType\n    ] | None = Field(\n        default=None,\n        alias=\"udiDeviceIdentifier\",\n        title=\"Unique Device Identifier (UDI) Barcode string\",\n        description=(\n            \"Unique device identifier (UDI) assigned to device label or package.  \"\n            \"Note that the Device may include multiple udiCarriers as it either may\"\n            \" include just the udiCarrier for the jurisdiction it is sold, or for \"\n            \"multiple jurisdictions it could have been sold.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: typing.List[fhirtypes.DeviceDefinitionVersionType] | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"The version of the device or software\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"identifier\",\n            \"udiDeviceIdentifier\",\n            \"regulatoryIdentifier\",\n            \"partNumber\",\n            \"manufacturer\",\n            \"deviceName\",\n            \"modelNumber\",\n            \"classification\",\n            \"conformsTo\",\n            \"hasPart\",\n            \"packaging\",\n            \"version\",\n            \"safety\",\n            \"shelfLifeStorage\",\n            \"languageCode\",\n            \"property\",\n            \"owner\",\n            \"contact\",\n            \"link\",\n            \"note\",\n            \"material\",\n            \"productionIdentifierInUDI\",\n            \"guideline\",\n            \"correctiveAction\",\n            \"chargeItem\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"manufacturer\",\n            \"deviceName\",\n            \"modelNumber\",\n            \"classification\",\n            \"conformsTo\",\n            \"hasPart\",\n            \"safety\",\n        ]\n\n\nclass DeviceDefinitionChargeItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Billing code or reference associated with the device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionChargeItem\"\n\n    chargeItemCode: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"chargeItemCode\",\n        title=\"The code or reference for the charge item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ChargeItemDefinition\"],\n        },\n    )\n\n    count: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"count\",\n        title=\"Coefficient applicable to the billing code\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"A specific time period in which this charge item applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context to which this charge item applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionChargeItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"chargeItemCode\",\n            \"count\",\n            \"effectivePeriod\",\n            \"useContext\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionChargeItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DeviceDefinitionClassification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What kind of device or device system this is.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionClassification\"\n\n    justification: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"justification\",\n        title=\"Further information qualifying this classification of the device model\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"A classification or risk class of the device model\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"justification\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\"]\n\n\nclass DeviceDefinitionConformsTo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Identifies the standards, specifications, or formal guidances for the\n    capabilities supported by the device.\n    Identifies the standards, specifications, or formal guidances for the\n    capabilities supported by the device. The device may be certified as\n    conformant to these specifications e.g., communication, performance,\n    process, measurement, or specialization standards.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionConformsTo\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=(\n            \"Describes the common type of the standard, specification, or formal \"\n            \"guidance\"\n        ),\n        description=\"Describes the type of the standard, specification, or formal guidance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"source\",\n        title=(\n            \"Standard, regulation, certification, or guidance website, document, or\"\n            \" other publication, or similar, supporting the conformance\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specification: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"specification\",\n        title=(\n            \"Identifies the standard, specification, or formal guidance that the \"\n            \"device adheres to the Device Specification type\"\n        ),\n        description=(\n            \"Code that identifies the specific standard, specification, protocol, \"\n            \"formal guidance, regulation, legislation, or certification scheme to \"\n            \"which the device adheres.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"version\",\n        title=(\n            \"The specific form or variant of the standard, specification or formal \"\n            \"guidance\"\n        ),\n        description=(\n            \"Identifies the specific form or variant of the standard, \"\n            \"specification, or formal guidance. This may be a 'version number', \"\n            \"release, document edition, publication year, or other label.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionConformsTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"specification\",\n            \"version\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionConformsTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"category\", \"specification\", \"version\"]\n\n\nclass DeviceDefinitionCorrectiveAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Tracking of latest field safety corrective action.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionCorrectiveAction\"\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"Start and end dates of the  corrective action\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recall: bool | None = Field(\n        default=None,\n        alias=\"recall\",\n        title=\"Whether the corrective action was a recall\",\n        description=\"Whether the last corrective action known for this device was a recall.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    recall__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recall\", title=\"Extension field for ``recall``.\"\n    )\n\n    scope: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"scope\",\n        title=\"model | lot-numbers | serial-numbers\",\n        description=(\n            \"The scope of the corrective action - whether the action targeted all \"\n            \"units of a given device model, or only a specific set of batches \"\n            \"identified by lot numbers, or individually identified devices \"\n            \"identified by the serial name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"model\", \"lot-numbers\", \"serial-numbers\"],\n        },\n    )\n    scope__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_scope\", title=\"Extension field for ``scope``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionCorrectiveAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"recall\", \"scope\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionCorrectiveAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"recall\", \"recall__ext\")]\n        return required_fields\n\n\nclass DeviceDefinitionDeviceName(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The name or names of the device as given by the manufacturer.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionDeviceName\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name that is used to refer to the device\",\n        description=(\n            \"A human-friendly name that is used to refer to the device - depending \"\n            \"on the type, it can be the brand name, the common name or alias, or \"\n            \"other.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"registered-name | user-friendly-name | patient-reported-name\",\n        description=(\n            \"The type of deviceName. RegisteredName | UserFriendlyName | \"\n            \"PatientReportedName.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"registered-name\",\n                \"user-friendly-name\",\n                \"patient-reported-name\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionDeviceName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionDeviceName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"type\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass DeviceDefinitionGuideline(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information aimed at providing directions for the usage of this model of\n    device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionGuideline\"\n\n    contraindication: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"contraindication\",\n        title=(\n            \"A specific situation when a device should not be used because it may \"\n            \"cause harm\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    indication: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"indication\",\n        title=\"A clinical condition for which the device was designed to be used\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    intendedUse: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"intendedUse\",\n        title=(\n            \"A description of the general purpose or medical use of the device or \"\n            \"its function\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    intendedUse__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intendedUse\", title=\"Extension field for ``intendedUse``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"A source of information or reference for this guideline\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usageInstruction: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"usageInstruction\",\n        title=(\n            \"Detailed written and visual directions for the user on how to use the \"\n            \"device\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usageInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_usageInstruction\",\n        title=\"Extension field for ``usageInstruction``.\",\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The circumstances that form the setting for using the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    warning: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"warning\",\n        title=(\n            \"Specific hazard alert information that a user needs to know before \"\n            \"using the device\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionGuideline`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"useContext\",\n            \"usageInstruction\",\n            \"relatedArtifact\",\n            \"indication\",\n            \"contraindication\",\n            \"warning\",\n            \"intendedUse\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionGuideline`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DeviceDefinitionHasPart(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A device, part of the current one.\n    A device that is part (for example a component) of the present device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionHasPart\"\n\n    count: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Number of occurrences of the part\",\n        description=\"Number of instances of the component device in the current device.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Reference to the part\",\n        description=\"Reference to the device that is part of the current device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionHasPart`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"reference\", \"count\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionHasPart`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"reference\"]\n\n\nclass DeviceDefinitionLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An associated device, attached to, used with, communicating with or linking\n    a previous or new device model to the focal device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionLink\"\n\n    relatedDevice: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"relatedDevice\",\n        title=\"A reference to the linked device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceDefinition\"],\n        },\n    )\n\n    relation: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"relation\",\n        title=(\n            \"The type indicates the relationship of the related device to the \"\n            \"device instance\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"relation\", \"relatedDevice\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DeviceDefinitionMaterial(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A substance used to create the material(s) of which the device is made.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionMaterial\"\n\n    allergenicIndicator: bool | None = Field(\n        default=None,\n        alias=\"allergenicIndicator\",\n        title=\"Whether the substance is a known or suspected allergen\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    allergenicIndicator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allergenicIndicator\",\n        title=\"Extension field for ``allergenicIndicator``.\",\n    )\n\n    alternate: bool | None = Field(\n        default=None,\n        alias=\"alternate\",\n        title=\"Indicates an alternative material of the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    alternate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_alternate\", title=\"Extension field for ``alternate``.\"\n    )\n\n    substance: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"substance\",\n        title=(\n            \"A relevant substance that the device contains, may contain, or is made\"\n            \" of\"\n        ),\n        description=(\n            \"A substance that the device contains, may contain, or is made of - for\"\n            \" example latex - to be used to determine patient compatibility. This \"\n            \"is not intended to represent the composition of the device, only the \"\n            \"clinically relevant materials.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionMaterial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"substance\",\n            \"alternate\",\n            \"allergenicIndicator\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionMaterial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DeviceDefinitionPackaging(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the packaging of the device, i.e. how the device is\n    packaged.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionPackaging\"\n\n    count: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"The number of items contained in the package (devices or sub-packages)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    distributor: typing.List[\n        fhirtypes.DeviceDefinitionPackagingDistributorType\n    ] | None = Field(\n        default=None,\n        alias=\"distributor\",\n        title=\"An organization that distributes the packaged device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier of the packaged medication\",\n        description=\"The business identifier of the packaged medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    packaging: typing.List[fhirtypes.DeviceDefinitionPackagingType] | None = Field(\n        default=None,\n        alias=\"packaging\",\n        title=\"Allows packages within packages\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"A code that defines the specific type of packaging\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udiDeviceIdentifier: typing.List[\n        fhirtypes.DeviceDefinitionUdiDeviceIdentifierType\n    ] | None = Field(\n        default=None,\n        alias=\"udiDeviceIdentifier\",\n        title=\"Unique Device Identifier (UDI) Barcode string on the packaging\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionPackaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"count\",\n            \"distributor\",\n            \"udiDeviceIdentifier\",\n            \"packaging\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionPackaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DeviceDefinitionPackagingDistributor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An organization that distributes the packaged device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionPackagingDistributor\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Distributor's human-readable name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    organizationReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"organizationReference\",\n        title=\"Distributor as an Organization resource\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionPackagingDistributor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"organizationReference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionPackagingDistributor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DeviceDefinitionProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Inherent, essentially fixed, characteristics of this kind of device, e.g.,\n    time properties, size, etc.\n    Static or essentially fixed characteristics or features of this kind of\n    device that are otherwise not captured in more specific attributes, e.g.,\n    time or timing attributes, resolution, accuracy, and physical attributes.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionProperty\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Code that specifies the property being represented\",\n        description=(\n            \"Code that specifies the property such as a resolution or color being \"\n            \"represented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of the property\",\n        description=(\n            \"The value of the property specified by the associated property.type \"\n            \"code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueRange\",\n            \"valueAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueInteger\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass DeviceDefinitionRegulatoryIdentifier(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Regulatory identifier(s) associated with this device.\n    Identifier associated with the regulatory documentation (certificates,\n    technical documentation, post-market surveillance documentation and\n    reports) of a set of device models sharing the same intended purpose, risk\n    class and essential design and manufacturing characteristics. One example\n    is the Basic UDI-DI in Europe.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionRegulatoryIdentifier\"\n\n    deviceIdentifier: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"deviceIdentifier\",\n        title=\"The identifier itself\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    deviceIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deviceIdentifier\",\n        title=\"Extension field for ``deviceIdentifier``.\",\n    )\n\n    issuer: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"issuer\",\n        title=\"The organization that issued this identifier\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    issuer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issuer\", title=\"Extension field for ``issuer``.\"\n    )\n\n    jurisdiction: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"The jurisdiction to which the deviceIdentifier applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    jurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_jurisdiction\",\n        title=\"Extension field for ``jurisdiction``.\",\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"basic | master | license\",\n        description=\"The type of identifier itself.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"basic\", \"master\", \"license\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionRegulatoryIdentifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"deviceIdentifier\",\n            \"issuer\",\n            \"jurisdiction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionRegulatoryIdentifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"deviceIdentifier\", \"deviceIdentifier__ext\"),\n            (\"issuer\", \"issuer__ext\"),\n            (\"jurisdiction\", \"jurisdiction__ext\"),\n            (\"type\", \"type__ext\"),\n        ]\n        return required_fields\n\n\nclass DeviceDefinitionUdiDeviceIdentifier(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Unique Device Identifier (UDI) Barcode string.\n    Unique device identifier (UDI) assigned to device label or package.  Note\n    that the Device may include multiple udiCarriers as it either may include\n    just the udiCarrier for the jurisdiction it is sold, or for multiple\n    jurisdictions it could have been sold.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionUdiDeviceIdentifier\"\n\n    deviceIdentifier: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"deviceIdentifier\",\n        title=(\n            \"The identifier that is to be associated with every Device that \"\n            \"references this DeviceDefintiion for the issuer and jurisdiction \"\n            \"provided in the DeviceDefinition.udiDeviceIdentifier\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    deviceIdentifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deviceIdentifier\",\n        title=\"Extension field for ``deviceIdentifier``.\",\n    )\n\n    issuer: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"issuer\",\n        title=\"The organization that assigns the identifier algorithm\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    issuer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issuer\", title=\"Extension field for ``issuer``.\"\n    )\n\n    jurisdiction: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"The jurisdiction to which the deviceIdentifier applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    jurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_jurisdiction\",\n        title=\"Extension field for ``jurisdiction``.\",\n    )\n\n    marketDistribution: typing.List[\n        fhirtypes.DeviceDefinitionUdiDeviceIdentifierMarketDistributionType\n    ] | None = Field(\n        default=None,\n        alias=\"marketDistribution\",\n        title=\"Indicates whether and when the device is available on the market\",\n        description=\"Indicates where and when the device is available on the market.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionUdiDeviceIdentifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"deviceIdentifier\",\n            \"issuer\",\n            \"jurisdiction\",\n            \"marketDistribution\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionUdiDeviceIdentifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"deviceIdentifier\", \"deviceIdentifier__ext\"),\n            (\"issuer\", \"issuer__ext\"),\n            (\"jurisdiction\", \"jurisdiction__ext\"),\n        ]\n        return required_fields\n\n\nclass DeviceDefinitionUdiDeviceIdentifierMarketDistribution(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Indicates whether and when the device is available on the market.\n    Indicates where and when the device is available on the market.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionUdiDeviceIdentifierMarketDistribution\"\n\n    marketPeriod: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"marketPeriod\",\n        title=\"Begin and end dates for the commercial distribution of the device\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subJurisdiction: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"subJurisdiction\",\n        title=\"National state or territory where the device is commercialized\",\n        description=(\n            \"National state or territory to which the marketDistribution recers, \"\n            \"typically where the device is commercialized.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    subJurisdiction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subJurisdiction\",\n        title=\"Extension field for ``subJurisdiction``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionUdiDeviceIdentifierMarketDistribution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"marketPeriod\",\n            \"subJurisdiction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionUdiDeviceIdentifierMarketDistribution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"subJurisdiction\", \"subJurisdiction__ext\")]\n        return required_fields\n\n\nclass DeviceDefinitionVersion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The version of the device or software.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDefinitionVersion\"\n\n    component: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"component\",\n        title=(\n            \"The hardware or software module of the device to which the version \"\n            \"applies\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of the device version, e.g. manufacturer, approved, internal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The version text\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDefinitionVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"component\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDefinitionVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/devicedispense.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceDispense\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DeviceDispense(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A record of dispensation of a device.\n    A record of dispensation of a device - i.e., assigning a device to a\n    patient, or to a professional for their use.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDispense\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"The order or request that this dispense is fulfilling\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\", \"DeviceRequest\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of device dispense\",\n        description=\"Indicates the type of device dispense.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    destination: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Where the device was sent or should be sent\",\n        description=(\n            \"Identification of the facility/location where the device was /should \"\n            \"be shipped to, as part of the dispense process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    device: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"device\",\n        title=\"What device was supplied\",\n        description=(\n            \"Identifies the device being dispensed. This is either a link to a \"\n            \"resource representing the details of the device or a simple attribute \"\n            \"carrying a code that identifies the device from a known list of \"\n            \"devices.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"DeviceDefinition\"],\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter associated with event\",\n        description=\"The encounter that establishes the context for this event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"eventHistory\",\n        title=\"A list of relevant lifecycle events\",\n        description=(\n            \"A summary of the events of interest that have occurred, such as when \"\n            \"the dispense was verified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for this dispensation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the dispense occurred\",\n        description=\"The principal physical location where the dispense was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Information about the dispense\",\n        description=(\n            \"Extra information about the dispense that could not be conveyed in the\"\n            \" other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"The bigger event that this dispense is a part of\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.DeviceDispensePerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed event\",\n        description=\"Indicates who or what performed the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preparedDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"preparedDate\",\n        title=\"When product was packaged and reviewed\",\n        description=\"The time when the dispensed product was packaged and reviewed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    preparedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_preparedDate\",\n        title=\"Extension field for ``preparedDate``.\",\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount dispensed\",\n        description=\"The number of devices that have been dispensed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    receiver: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"receiver\",\n        title=\"Who collected the device or where the medication was delivered\",\n        description=(\n            \"Identifies the person who picked up the device or the person or \"\n            \"location where the device was delivered.  This may be a patient or \"\n            \"their caregiver, but some cases exist where it can be a healthcare \"\n            \"professional or a location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Location\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | cancelled | on-hold | completed | entered-\"\n            \"in-error | stopped | declined | unknown\"\n        ),\n        description=\"A code specifying the state of the set of dispense events.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"cancelled\",\n                \"on-hold\",\n                \"completed\",\n                \"entered-in-error\",\n                \"stopped\",\n                \"declined\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Why a dispense was or was not performed\",\n        description=\"Indicates the reason why a dispense was or was not performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DetectedIssue\"],\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who the dispense is for\",\n        description=(\n            \"A link to a resource representing the person to whom the device is \"\n            \"intended.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Practitioner\"],\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Information that supports the dispensing of the device\",\n        description=\"Additional information that supports the device being dispensed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Trial fill, partial fill, emergency fill, etc\",\n        description=\"Indicates the type of dispensing event that is performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usageInstruction: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"usageInstruction\",\n        title=\"Full representation of the usage instructions\",\n        description=\"The full representation of the instructions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usageInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_usageInstruction\",\n        title=\"Extension field for ``usageInstruction``.\",\n    )\n\n    whenHandedOver: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenHandedOver\",\n        title=\"When product was given out\",\n        description=(\n            \"The time the dispensed product was made available to the patient or \"\n            \"their representative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    whenHandedOver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenHandedOver\",\n        title=\"Extension field for ``whenHandedOver``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"category\",\n            \"device\",\n            \"subject\",\n            \"receiver\",\n            \"encounter\",\n            \"supportingInformation\",\n            \"performer\",\n            \"location\",\n            \"type\",\n            \"quantity\",\n            \"preparedDate\",\n            \"whenHandedOver\",\n            \"destination\",\n            \"note\",\n            \"usageInstruction\",\n            \"eventHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"device\",\n            \"subject\",\n            \"preparedDate\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass DeviceDispensePerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed event.\n    Indicates who or what performed the event.\n    \"\"\"\n\n    __resource_type__ = \"DeviceDispensePerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual who was performing\",\n        description=(\n            \"The device, practitioner, etc. who performed the action.  It should be\"\n            \" assumed that the actor is the dispenser of the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Who performed the dispense and what they did\",\n        description=(\n            \"Distinguishes the type of performer in the dispense.  For example, \"\n            \"date enterer, packager, final checker.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceDispensePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceDispensePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/devicemetric.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceMetric\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DeviceMetric(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Measurement, calculation or setting capability of a medical device.\n    Describes a measurement, calculation or setting capability of a device.\n    \"\"\"\n\n    __resource_type__ = \"DeviceMetric\"\n\n    calibration: typing.List[fhirtypes.DeviceMetricCalibrationType] | None = Field(\n        default=None,\n        alias=\"calibration\",\n        title=(\n            \"Describes the calibrations that have been performed or that are \"\n            \"required to be performed\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"measurement | setting | calculation | unspecified\",\n        description=(\n            \"Indicates the category of the observation generation process. A \"\n            \"DeviceMetric can be for example a setting, measurement, or \"\n            \"calculation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"measurement\", \"setting\", \"calculation\", \"unspecified\"],\n        },\n    )\n    category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_category\", title=\"Extension field for ``category``.\"\n    )\n\n    color: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"color\",\n        title=\"Color name (from CSS4) or #RRGGBB code\",\n        description=(\n            \"The preferred color associated with the metric (e.g., display color). \"\n            \"This is often used to aid clinicians to track and identify parameter \"\n            \"types by color. In practice, consider a Patient Monitor that has \"\n            \"ECG/HR and Pleth; the metrics are displayed in different \"\n            \"characteristic colors, such as HR in blue, BP in green, and PR and \"\n            \"SpO2 in magenta.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    color__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_color\", title=\"Extension field for ``color``.\"\n    )\n\n    device: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"device\",\n        title=\"Describes the link to the Device\",\n        description=(\n            \"Describes the link to the Device.  This is also known as a channel \"\n            \"device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Instance identifier\",\n        description=(\n            \"Instance identifiers assigned to a device, by the device or gateway \"\n            \"software, manufacturers, other organizations or owners. For example, \"\n            \"handle ID.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    measurementFrequency: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"measurementFrequency\",\n        title=\"Indicates how often the metric is taken or recorded\",\n        description=(\n            \"The frequency at which the metric is taken or recorded. Devices \"\n            \"measure metrics at a wide range of frequencies; for example, an ECG \"\n            \"might sample measurements in the millisecond range, while an NIBP \"\n            \"might trigger only once an hour. Less often, the measurementFrequency \"\n            \"may be based on a unit other than time, such as distance (e.g. for a \"\n            \"measuring wheel). The update period may be different than the \"\n            \"measurement frequency, if the device does not update the published \"\n            \"observed value with the same frequency as it was measured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operationalStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"operationalStatus\",\n        title=\"on | off | standby | entered-in-error\",\n        description=(\n            \"Indicates current operational state of the device. For example: On, \"\n            \"Off, Standby, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"on\", \"off\", \"standby\", \"entered-in-error\"],\n        },\n    )\n    operationalStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_operationalStatus\",\n        title=\"Extension field for ``operationalStatus``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Identity of metric, for example Heart Rate or PEEP Setting\",\n        description=(\n            \"Describes the type of the metric. For example: Heart Rate, PEEP \"\n            \"Setting, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    unit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Unit of Measure for the Metric\",\n        description=(\n            \"Describes the unit that an observed value determined for this metric \"\n            \"will have. For example: Percent, Seconds, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceMetric`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"unit\",\n            \"device\",\n            \"operationalStatus\",\n            \"color\",\n            \"category\",\n            \"measurementFrequency\",\n            \"calibration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceMetric`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"unit\",\n            \"device\",\n            \"operationalStatus\",\n            \"category\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"category\", \"category__ext\")]\n        return required_fields\n\n\nclass DeviceMetricCalibration(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes the calibrations that have been performed or that are required to\n    be performed.\n    \"\"\"\n\n    __resource_type__ = \"DeviceMetricCalibration\"\n\n    state: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"state\",\n        title=\"not-calibrated | calibration-required | calibrated | unspecified\",\n        description=\"Describes the state of the calibration.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"not-calibrated\",\n                \"calibration-required\",\n                \"calibrated\",\n                \"unspecified\",\n            ],\n        },\n    )\n    state__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_state\", title=\"Extension field for ``state``.\"\n    )\n\n    time: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"time\",\n        title=\"Describes the time last calibration has been performed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_time\", title=\"Extension field for ``time``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"unspecified | offset | gain | two-point\",\n        description=\"Describes the type of the calibration method.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"unspecified\", \"offset\", \"gain\", \"two-point\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceMetricCalibration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"state\", \"time\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceMetricCalibration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/devicerequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DeviceRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Medical device request.\n    Represents a request for a patient to employ a medical device. The device\n    may be an implantable device, or an external assistive device, such as a\n    walker.\n    \"\"\"\n\n    __resource_type__ = \"DeviceRequest\"\n\n    asNeeded: bool | None = Field(\n        default=None,\n        alias=\"asNeeded\",\n        title=\"PRN status of request\",\n        description=(\n            \"This status is to indicate whether the request is a PRN or may be \"\n            \"given as needed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    asNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_asNeeded\", title=\"Extension field for ``asNeeded``.\"\n    )\n\n    asNeededFor: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"asNeededFor\",\n        title=\"Device usage reason\",\n        description=\"The reason for using the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When recorded\",\n        description=\"When the request transitioned to being actionable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What request fulfills\",\n        description=\"Plan/proposal/order fulfilled by this request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    code: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Device requested\",\n        description=\"The details of the device to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"DeviceDefinition\"],\n        },\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"True if the request is to stop or not to start using the device\",\n        description=(\n            \"If true, indicates that the provider is asking for the patient to \"\n            \"either stop using or to not start using the specified device or \"\n            \"category of devices. For example, the patient has undergone surgery \"\n            \"and the provider is indicating that the patient should not wear \"\n            \"contact lenses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter motivating request\",\n        description=(\n            \"An encounter that provides additional context in which this request is\"\n            \" made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Identifier of composite request\",\n        description=(\n            \"A shared identifier common to multiple independent Request instances \"\n            \"that were activated/authorized more or less simultaneously by a single\"\n            \" author.  The presence of the same identifier on each request ties \"\n            \"those requests together and may have business ramifications in terms \"\n            \"of reporting of results, billing, etc.  E.g. a requisition number \"\n            \"shared by a set of lab tests ordered together, or a prescription \"\n            \"number shared by all meds ordered at one time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Request identifier\",\n        description=\"Identifiers assigned to this order by the orderer or by the receiver.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"DeviceRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this DeviceRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    insurance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Associated insurance coverage\",\n        description=(\n            \"Insurance plans, coverage extensions, pre-authorizations and/or pre-\"\n            \"determinations that may be required for delivering the requested \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\", \"ClaimResponse\"],\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"proposal | plan | directive | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            \"Whether the request is a proposal, plan, an original order or a reflex\"\n            \" order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposal\",\n                \"plan\",\n                \"directive\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Notes or comments\",\n        description=(\n            \"Details about this request that were not represented at all or \"\n            \"sufficiently in one of the attributes provided in a class. These may \"\n            \"include for example a comment, an instruction, or a note associated \"\n            \"with the statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"Desired time or schedule for use\",\n        description=(\n            \"The timing schedule for the use of the device. The Schedule data type \"\n            'allows many different expressions, for example. \"Every 8 hours\"; '\n            '\"Three times a day\"; \"1/2 an hour before breakfast for 10 days from '\n            '23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"Desired time or schedule for use\",\n        description=(\n            \"The timing schedule for the use of the device. The Schedule data type \"\n            'allows many different expressions, for example. \"Every 8 hours\"; '\n            '\"Three times a day\"; \"1/2 an hour before breakfast for 10 days from '\n            '23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"Desired time or schedule for use\",\n        description=(\n            \"The timing schedule for the use of the device. The Schedule data type \"\n            'allows many different expressions, for example. \"Every 8 hours\"; '\n            '\"Three times a day\"; \"1/2 an hour before breakfast for 10 days from '\n            '23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    parameter: typing.List[fhirtypes.DeviceRequestParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Device details\",\n        description=(\n            \"Specific parameters for the ordered item.  For example, the prism \"\n            \"value for lenses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performer: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Requested Filler\",\n        description=(\n            \"The desired individual or entity to provide the device to the subject \"\n            \"of the request (e.g., patient, location).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"HealthcareService\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the request should be addressed with respect to \"\n            \"other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    quantity: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Quantity of devices to supply\",\n        description=\"The number of devices to be provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_quantity\", title=\"Extension field for ``quantity``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Coded/Linked Reason for request\",\n        description=\"Reason or justification for the use of this device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Request provenance\",\n        description=\"Key events in the history of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"What request replaces\",\n        description=(\n            \"The request takes the place of the referenced completed or terminated \"\n            \"request(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceRequest\"],\n        },\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/what submitted the device request\",\n        description=(\n            \"The individual or entity who initiated the request and has \"\n            \"responsibility for its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | on-hold | revoked | completed | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=\"The status of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"on-hold\",\n                \"revoked\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Focus of request\",\n        description=\"The patient who will use the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Location\", \"Device\"],\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Additional clinical information\",\n        description=(\n            \"Additional clinical information about the patient that may influence \"\n            \"the request fulfilment.  For example, this may include where on the \"\n            \"subject's body the device will be used (i.e. the target site).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"doNotPerform\",\n            \"code\",\n            \"quantity\",\n            \"parameter\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"authoredOn\",\n            \"requester\",\n            \"performer\",\n            \"reason\",\n            \"asNeeded\",\n            \"asNeededFor\",\n            \"insurance\",\n            \"supportingInfo\",\n            \"note\",\n            \"relevantHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"doNotPerform\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"authoredOn\",\n            \"requester\",\n            \"performer\",\n            \"reason\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\", \"occurrenceTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass DeviceRequestParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Device details.\n    Specific parameters for the ordered item.  For example, the prism value for\n    lenses.\n    \"\"\"\n\n    __resource_type__ = \"DeviceRequestParameter\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Device detail\",\n        description=\"A code or string that identifies the device detail being asserted.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceRequestParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueBoolean\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceRequestParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/deviceusage.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceUsage\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DeviceUsage(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Record of use of a device.\n    A record of a device being used by a patient where the record is the result\n    of a report from the patient or a clinician.\n    \"\"\"\n\n    __resource_type__ = \"DeviceUsage\"\n\n    adherence: fhirtypes.DeviceUsageAdherenceType | None = Field(\n        default=None,\n        alias=\"adherence\",\n        title=\"How device is being used\",\n        description=\"This indicates how or if the device is being used.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan, proposal or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this DeviceUsage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    bodySite: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Target body site\",\n        description=(\n            \"Indicates the anotomic location on the subject's body where the device\"\n            \" was used ( i.e. the target).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BodyStructure\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"The category of the statement - classifying how the statement is made\",\n        description=(\n            \"This attribute indicates a category for the statement - The device \"\n            \"statement may be made in an inpatient or outpatient settting \"\n            \"(inpatient | outpatient | community | patientspecified).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    context: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=(\n            \"The encounter or episode of care that establishes the context for this\"\n            \" device use statement\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    dateAsserted: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateAsserted\",\n        title=\"When the statement was made (and recorded)\",\n        description=\"The time at which the statement was recorded by informationSource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    dateAsserted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_dateAsserted\",\n        title=\"Extension field for ``dateAsserted``.\",\n    )\n\n    derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Supporting information\",\n        description=(\n            \"Allows linking the DeviceUsage to the underlying Request, or to other \"\n            \"information that supports or is used to derive the DeviceUsage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"ServiceRequest\",\n                \"Procedure\",\n                \"Claim\",\n                \"Observation\",\n                \"QuestionnaireResponse\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    device: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"device\",\n        title=\"Code or Reference to device used\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"DeviceDefinition\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier for this record\",\n        description=\"An external identifier for this statement such as an IRI.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    informationSource: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"informationSource\",\n        title=\"Who made the statement\",\n        description=\"Who reported the device was being used by the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Addition details (comments, instructions)\",\n        description=(\n            \"Details about the device statement that were not represented at all or\"\n            \" sufficiently in one of the attributes provided in a class. These may \"\n            \"include for example a comment, an instruction, or a note associated \"\n            \"with the statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Patient using device\",\n        description=\"The patient who used the device.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why device was used\",\n        description=(\n            \"Reason or justification for the use of the device. A coded concept, or\"\n            \" another resource whose existence justifies this DeviceUsage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n                \"Procedure\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | completed | not-done | entered-in-error +\",\n        description=(\n            \"A code representing the patient or other source's judgment about the \"\n            \"state of the device used that this statement is about.  Generally this\"\n            \" will be active or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"completed\", \"not-done\", \"entered-in-error\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    timingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timingDateTime\",\n        title=\"How often  the device was used\",\n        description=\"How often the device was used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timingDateTime\",\n        title=\"Extension field for ``timingDateTime``.\",\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"How often  the device was used\",\n        description=\"How often the device was used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"How often  the device was used\",\n        description=\"How often the device was used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    usageReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"usageReason\",\n        title=(\n            \"The reason for asserting the usage status - for example forgot, lost, \"\n            \"stolen, broken\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usageStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"usageStatus\",\n        title=(\n            \"The status of the device usage, for example always, sometimes, never. \"\n            \"This is not the same as the status of the statement\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceUsage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"status\",\n            \"category\",\n            \"patient\",\n            \"derivedFrom\",\n            \"context\",\n            \"timingTiming\",\n            \"timingPeriod\",\n            \"timingDateTime\",\n            \"dateAsserted\",\n            \"usageStatus\",\n            \"usageReason\",\n            \"adherence\",\n            \"informationSource\",\n            \"device\",\n            \"reason\",\n            \"bodySite\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceUsage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"status\",\n            \"patient\",\n            \"derivedFrom\",\n            \"context\",\n            \"timingTiming\",\n            \"timingPeriod\",\n            \"timingDateTime\",\n            \"dateAsserted\",\n            \"informationSource\",\n            \"device\",\n            \"reason\",\n            \"bodySite\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\"timingDateTime\", \"timingPeriod\", \"timingTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass DeviceUsageAdherence(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    How device is being used.\n    This indicates how or if the device is being used.\n    \"\"\"\n\n    __resource_type__ = \"DeviceUsageAdherence\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"always | never | sometimes\",\n        description=\"Type of adherence.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableConceptType] = Field(\n        default=...,\n        alias=\"reason\",\n        title=\"lost | stolen | prescribed | broken | burned | forgot\",\n        description=\"Reason for adherence type.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DeviceUsageAdherence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"reason\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DeviceUsageAdherence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/diagnosticreport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DiagnosticReport\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DiagnosticReport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A Diagnostic report - a combination of request information, atomic results,\n    images, interpretation, as well as formatted reports.\n    The findings and interpretation of diagnostic tests performed on patients,\n    groups of patients, products, substances, devices, and locations, and/or\n    specimens derived from these. The report includes clinical context such as\n    requesting provider information, and some mix of atomic results, images,\n    textual and coded interpretations, and formatted representation of\n    diagnostic reports. The report also includes non-clinical context such as\n    batch analysis and stability reporting of products and substances.\n    \"\"\"\n\n    __resource_type__ = \"DiagnosticReport\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What was requested\",\n        description=\"Details concerning a service requested.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"ImmunizationRecommendation\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ServiceRequest\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Service category\",\n        description=(\n            \"A code that classifies the clinical discipline, department or \"\n            \"diagnostic service that created the report (e.g. cardiology, \"\n            \"biochemistry, hematology, MRI). This is used for searching, sorting \"\n            \"and display purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Name/Code for this diagnostic report\",\n        description=\"A code or name that describes this diagnostic report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    composition: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"composition\",\n        title=\"Reference to a Composition resource for the DiagnosticReport structure\",\n        description=(\n            \"Reference to a Composition resource instance that provides structure \"\n            \"for organizing the contents of the DiagnosticReport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Composition\"],\n        },\n    )\n\n    conclusion: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"conclusion\",\n        title=\"Clinical conclusion (interpretation) of test results\",\n        description=(\n            \"Concise and clinically contextualized summary conclusion \"\n            \"(interpretation/impression) of the diagnostic report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    conclusion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_conclusion\", title=\"Extension field for ``conclusion``.\"\n    )\n\n    conclusionCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"conclusionCode\",\n        title=\"Codes for the clinical conclusion of test results\",\n        description=(\n            \"One or more codes that represent the summary conclusion \"\n            \"(interpretation/impression) of the diagnostic report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"Clinically relevant time/time-period for report\",\n        description=(\n            \"The time or time-period the observed values are related to. When the \"\n            \"subject of the report is a patient, this is usually either the time of\"\n            \" the procedure or of specimen collection(s), but very often the source\"\n            \" of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"Clinically relevant time/time-period for report\",\n        description=(\n            \"The time or time-period the observed values are related to. When the \"\n            \"subject of the report is a patient, this is usually either the time of\"\n            \" the procedure or of specimen collection(s), but very often the source\"\n            \" of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Health care event when test ordered\",\n        description=(\n            \"The healthcare event  (e.g. a patient and healthcare provider \"\n            \"interaction) which this DiagnosticReport is about.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for report\",\n        description=\"Identifiers assigned to this report by the performer or other systems.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"DateTime this version was made\",\n        description=(\n            \"The date and time that this version of the report was made available \"\n            \"to providers, typically after the report was reviewed and verified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    media: typing.List[fhirtypes.DiagnosticReportMediaType] | None = Field(\n        default=None,\n        alias=\"media\",\n        title=\"Key images or data associated with this report\",\n        description=(\n            \"A list of key images or data associated with this report. The images \"\n            \"or data are generally created during the diagnostic process, and may \"\n            \"be directly of the patient, or of treated specimens (i.e. slides of \"\n            \"interest).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the diagnostic report\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Responsible Diagnostic Service\",\n        description=\"The diagnostic service that is responsible for issuing the report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    presentedForm: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"presentedForm\",\n        title=\"Entire report as issued\",\n        description=(\n            \"Rich text representation of the entire result as issued by the \"\n            \"diagnostic service. Multiple formats are allowed but they SHALL be \"\n            \"semantically equivalent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    result: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"Observations\",\n        description=(\n            \"[Observations](observation.html)  that are part of this diagnostic \"\n            \"report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    resultsInterpreter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"resultsInterpreter\",\n        title=\"Primary result interpreter\",\n        description=(\n            \"The practitioner or organization that is responsible for the report's \"\n            \"conclusions and interpretations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    specimen: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Specimens this report is based on\",\n        description=\"Details about the specimens on which this diagnostic report is based.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"registered | partial | preliminary | modified | final | amended | \"\n            \"corrected | appended | cancelled | entered-in-error | unknown\"\n        ),\n        description=\"The status of the diagnostic report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"registered\",\n                \"partial\",\n                \"preliminary\",\n                \"modified\",\n                \"final\",\n                \"amended\",\n                \"corrected\",\n                \"appended\",\n                \"cancelled\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    study: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"study\",\n        title=(\n            \"Reference to full details of an analysis associated with the \"\n            \"diagnostic report\"\n        ),\n        description=(\n            \"One or more links to full details of any study performed during the \"\n            \"diagnostic investigation. An ImagingStudy might comprise a set of \"\n            \"radiologic images obtained via a procedure that are analyzed as a \"\n            \"group. Typically, this is imaging performed by DICOM enabled \"\n            \"modalities, but this is not required. A fully enabled PACS viewer can \"\n            \"use this information to provide views of the source images. A \"\n            \"GenomicStudy might comprise one or more analyses, each serving a \"\n            \"specific purpose. These analyses may vary in method (e.g., \"\n            \"karyotyping, CNV, or SNV detection), performer, software, devices \"\n            \"used, or regions targeted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"GenomicStudy\", \"ImagingStudy\"],\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The subject of the report - usually, but not always, the patient\",\n        description=(\n            \"The subject of the report. Usually, but not always, this is a patient.\"\n            \" However, diagnostic services also perform analyses on specimens \"\n            \"collected from a variety of other sources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Device\",\n                \"Location\",\n                \"Organization\",\n                \"Practitioner\",\n                \"Medication\",\n                \"Substance\",\n                \"BiologicallyDerivedProduct\",\n            ],\n        },\n    )\n\n    supportingInfo: typing.List[\n        fhirtypes.DiagnosticReportSupportingInfoType\n    ] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Additional information supporting the diagnostic report\",\n        description=(\n            \"This backbone element contains supporting information that was used in\"\n            \" the creation of the report not included in the results already \"\n            \"included in the report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DiagnosticReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"issued\",\n            \"performer\",\n            \"resultsInterpreter\",\n            \"specimen\",\n            \"result\",\n            \"note\",\n            \"study\",\n            \"supportingInfo\",\n            \"media\",\n            \"composition\",\n            \"conclusion\",\n            \"conclusionCode\",\n            \"presentedForm\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DiagnosticReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"issued\",\n            \"performer\",\n            \"resultsInterpreter\",\n            \"media\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"effective\": [\"effectiveDateTime\", \"effectivePeriod\"]}\n        return one_of_many_fields\n\n\nclass DiagnosticReportMedia(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Key images or data associated with this report.\n    A list of key images or data associated with this report. The images or\n    data are generally created during the diagnostic process, and may be\n    directly of the patient, or of treated specimens (i.e. slides of interest).\n    \"\"\"\n\n    __resource_type__ = \"DiagnosticReportMedia\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comment about the image or data (e.g. explanation)\",\n        description=(\n            \"A comment about the image or data. Typically, this is used to provide \"\n            \"an explanation for why the image or data is included, or to draw the \"\n            \"viewer's attention to important features.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    link: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"link\",\n        title=\"Reference to the image or data source\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DiagnosticReportMedia`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"comment\", \"link\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DiagnosticReportMedia`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"link\"]\n\n\nclass DiagnosticReportSupportingInfo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional information supporting the diagnostic report.\n    This backbone element contains supporting information that was used in the\n    creation of the report not included in the results already included in the\n    report.\n    \"\"\"\n\n    __resource_type__ = \"DiagnosticReportSupportingInfo\"\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Supporting information reference\",\n        description=\"The reference for the supporting information in the diagnostic report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Procedure\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"Citation\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Supporting information role code\",\n        description=(\n            \"The code value for the role of the supporting information in the \"\n            \"diagnostic report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DiagnosticReportSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DiagnosticReportSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/distance.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Distance\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Distance(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A length - a value with a unit that is a physical distance.\n    \"\"\"\n\n    __resource_type__ = \"Distance\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Distance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Distance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/documentreference.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DocumentReference\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass DocumentReference(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reference to a document.\n    A reference to a document of any kind for any purpose. While the term\n    “document” implies a more narrow focus, for this resource this \"document\"\n    encompasses *any* serialized object with a mime-type, it includes formal\n    patient-centric documents (CDA), clinical notes, scanned paper, non-patient\n    specific documents like policy text, as well as a photo, video, or audio\n    recording acquired or used in healthcare.  The DocumentReference resource\n    provides metadata about the document so that the document can be discovered\n    and managed.  The actual content may be inline base64 encoded data or\n    provided by direct reference.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReference\"\n\n    attester: typing.List[fhirtypes.DocumentReferenceAttesterType] | None = Field(\n        default=None,\n        alias=\"attester\",\n        title=\"Attests to accuracy of the document\",\n        description=\"A participant who has authenticated the accuracy of the document.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    author: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who and/or what authored the document\",\n        description=(\n            \"Identifies who is responsible for adding the information to the \"\n            \"document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Device\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Procedure that caused this media to be created\",\n        description=(\n            \"A procedure that is fulfilled in whole or in part by the creation of \"\n            \"this media.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Appointment\",\n                \"AppointmentResponse\",\n                \"CarePlan\",\n                \"Claim\",\n                \"CommunicationRequest\",\n                \"Contract\",\n                \"CoverageEligibilityRequest\",\n                \"DeviceRequest\",\n                \"EnrollmentRequest\",\n                \"ImmunizationRecommendation\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"RequestOrchestration\",\n                \"ServiceRequest\",\n                \"SupplyRequest\",\n                \"VisionPrescription\",\n            ],\n        },\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Body part included\",\n        description=\"The anatomic structures included in the document.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BodyStructure\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Categorization of document\",\n        description=(\n            \"A categorization for the type of document referenced - helps for \"\n            \"indexing and searching. This may be implied by or derived from the \"\n            \"code specified in the DocumentReference.type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    content: typing.List[fhirtypes.DocumentReferenceContentType] = Field(\n        default=...,\n        alias=\"content\",\n        title=\"Document referenced\",\n        description=(\n            \"The document and format referenced.  If there are multiple content \"\n            \"element repetitions, these must all represent the same document in \"\n            \"different format, or attachment metadata.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Context of the document content\",\n        description=(\n            \"Describes the clinical encounter or type of care that the document \"\n            \"content is associated with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Appointment\", \"Encounter\", \"EpisodeOfCare\"],\n        },\n    )\n\n    custodian: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"custodian\",\n        title=\"Organization which maintains the document\",\n        description=(\n            \"Identifies the organization or group who is responsible for ongoing \"\n            \"maintenance of and access to the document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    date: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When this document reference was created\",\n        description=\"When the document reference was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-readable description\",\n        description=\"Human-readable description of the source document.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    docStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"docStatus\",\n        title=(\n            \"registered | partial | preliminary | final | amended | corrected | \"\n            \"appended | cancelled | entered-in-error | deprecated | unknown\"\n        ),\n        description=\"The status of the underlying document.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"registered\",\n                \"partial\",\n                \"preliminary\",\n                \"final\",\n                \"amended\",\n                \"corrected\",\n                \"appended\",\n                \"cancelled\",\n                \"entered-in-error\",\n                \"deprecated\",\n                \"unknown\",\n            ],\n        },\n    )\n    docStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_docStatus\", title=\"Extension field for ``docStatus``.\"\n    )\n\n    event: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"Main clinical acts documented\",\n        description=(\n            \"This list of codes represents the main clinical acts, such as a \"\n            \"colonoscopy or an appendectomy, being documented. In some cases, the \"\n            'event is inherent in the type Code, such as a \"History and Physical '\n            'Report\" in which the procedure being documented is necessarily a '\n            '\"History and Physical\" act.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    facilityType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"facilityType\",\n        title=\"Kind of facility where patient was seen\",\n        description=\"The kind of facility where the patient was seen.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifiers for the document\",\n        description=(\n            \"Other business identifiers associated with the document, including \"\n            \"version independent identifiers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    modality: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modality\",\n        title=\"Imaging modality used\",\n        description=(\n            \"Imaging modality used. This may include both acquisition and non-\"\n            \"acquisition modalities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time of service that is being documented\",\n        description=(\n            \"The time period over which the service that is described by the \"\n            \"document was provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    practiceSetting: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"practiceSetting\",\n        title=(\n            \"Additional details about where the content was created (e.g. clinical \"\n            \"specialty)\"\n        ),\n        description=(\n            \"This property may convey specifics about the practice setting where \"\n            \"the content was created, often reflecting the clinical specialty.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatesTo: typing.List[fhirtypes.DocumentReferenceRelatesToType] | None = Field(\n        default=None,\n        alias=\"relatesTo\",\n        title=\"Relationships to other documents\",\n        description=(\n            \"Relationships that this document has with other document references \"\n            \"that already exist.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    securityLabel: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"securityLabel\",\n        title=\"Document security-tags\",\n        description=(\n            \"A set of Security-Tag codes specifying the level of privacy/security \"\n            \"of the Document found at DocumentReference.content.attachment.url. \"\n            \"Note that DocumentReference.meta.security contains the security labels\"\n            \" of the data elements in DocumentReference, while \"\n            \"DocumentReference.securityLabel contains the security labels for the \"\n            \"document the reference refers to. The distinction recognizes that the \"\n            \"document may contain sensitive information, while the \"\n            \"DocumentReference is metadata about the document and thus might not be\"\n            \" as sensitive as the document. For example: a psychotherapy episode \"\n            \"may contain highly sensitive information, while the metadata may \"\n            \"simply indicate that some episode happened.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"current | superseded | entered-in-error\",\n        description=\"The status of this document reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"current\", \"superseded\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who/what is the subject of the document\",\n        description=(\n            \"Who or what the document is about. The document can be about a person,\"\n            \" (patient or healthcare practitioner), a device (e.g. a machine) or \"\n            \"even a group of subjects (such as a document about a herd of farm \"\n            \"animals, or a set of patients that share a common exposure).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of document (LOINC if possible)\",\n        description=(\n            \"Specifies the particular kind of document referenced  (e.g. History \"\n            \"and Physical, Discharge Summary, Progress Note). This usually equates \"\n            \"to the purpose of making the document referenced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=(\n            \"An explicitly assigned identifer of a variation of the content in the \"\n            \"DocumentReference\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"version\",\n            \"basedOn\",\n            \"status\",\n            \"docStatus\",\n            \"modality\",\n            \"type\",\n            \"category\",\n            \"subject\",\n            \"context\",\n            \"event\",\n            \"bodySite\",\n            \"facilityType\",\n            \"practiceSetting\",\n            \"period\",\n            \"date\",\n            \"author\",\n            \"attester\",\n            \"custodian\",\n            \"relatesTo\",\n            \"description\",\n            \"securityLabel\",\n            \"content\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"version\",\n            \"status\",\n            \"docStatus\",\n            \"modality\",\n            \"type\",\n            \"category\",\n            \"subject\",\n            \"bodySite\",\n            \"period\",\n            \"date\",\n            \"author\",\n            \"relatesTo\",\n            \"description\",\n            \"securityLabel\",\n            \"content\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass DocumentReferenceAttester(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Attests to accuracy of the document.\n    A participant who has authenticated the accuracy of the document.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReferenceAttester\"\n\n    mode: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"mode\",\n        title=\"personal | professional | legal | official\",\n        description=\"The type of attestation the authenticator offers.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    party: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"party\",\n        title=\"Who attested the document\",\n        description=\"Who attested the document in the specified way.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    time: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"time\",\n        title=\"When the document was attested\",\n        description=\"When the document was attested by the party.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    time__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_time\", title=\"Extension field for ``time``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReferenceAttester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"mode\", \"time\", \"party\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReferenceAttester`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass DocumentReferenceContent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Document referenced.\n    The document and format referenced.  If there are multiple content element\n    repetitions, these must all represent the same document in different\n    format, or attachment metadata.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReferenceContent\"\n\n    attachment: fhirtypes.AttachmentType = Field(\n        default=...,\n        alias=\"attachment\",\n        title=\"Where to access the document\",\n        description=(\n            \"The document or URL of the document along with critical metadata to \"\n            \"prove content has integrity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    profile: typing.List[fhirtypes.DocumentReferenceContentProfileType] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Content profile rules for the document\",\n        description=(\n            \"An identifier of the document constraints, encoding, structure, and \"\n            \"template that the document conforms to beyond the base format \"\n            \"indicated in the mimeType.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReferenceContent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"attachment\", \"profile\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReferenceContent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"attachment\", \"profile\"]\n\n\nclass DocumentReferenceContentProfile(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Content profile rules for the document.\n    An identifier of the document constraints, encoding, structure, and\n    template that the document conforms to beyond the base format indicated in\n    the mimeType.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReferenceContentProfile\"\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"Code|uri|canonical\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueCanonical\",\n        title=\"Extension field for ``valueCanonical``.\",\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Code|uri|canonical\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Code|uri|canonical\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReferenceContentProfile`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueCoding\",\n            \"valueUri\",\n            \"valueCanonical\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReferenceContentProfile`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"valueCoding\", \"valueUri\", \"valueCanonical\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"value\": [\"valueCanonical\", \"valueCoding\", \"valueUri\"]}\n        return one_of_many_fields\n\n\nclass DocumentReferenceRelatesTo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationships to other documents.\n    Relationships that this document has with other document references that\n    already exist.\n    \"\"\"\n\n    __resource_type__ = \"DocumentReferenceRelatesTo\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"The relationship type with another document\",\n        description=\"The type of relationship that this document has with anther document.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    target: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"target\",\n        title=\"Target of the relationship\",\n        description=\"The target document of this relationship.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DocumentReferenceRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"target\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DocumentReferenceRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"target\"]\n"
  },
  {
    "path": "fhir/resources/domainresource.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DomainResource\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import fhirtypes, resource\n\n\nclass DomainResource(resource.Resource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A resource with narrative, extensions, and contained resources.\n    A resource that includes narrative, extensions, and contained resources.\n    \"\"\"\n\n    __resource_type__ = \"DomainResource\"\n\n    contained: typing.List[fhirtypes.ResourceType] | None = Field(\n        default=None,\n        alias=\"contained\",\n        title=\"Contained, inline Resources\",\n        description=(\n            \"These resources do not have an independent existence apart from the \"\n            \"resource that contains them - they cannot be identified independently,\"\n            \" nor can they have their own independent transaction scope. This is \"\n            \"allowed to be a Parameters resource if and only if it is referenced by\"\n            \" a resource that provides context/meaning.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    extension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"extension\",\n        title=\"Additional content defined by implementations\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the resource. To make the use of extensions \"\n            \"safe and managable, there is a strict set of governance applied to the\"\n            \" definition and use of extensions. Though any implementer can define \"\n            \"an extension, there is a set of requirements that SHALL be met as part\"\n            \" of the definition of the extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifierExtension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"modifierExtension\",\n        title=\"Extensions that cannot be ignored\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the resource and that modifies the \"\n            \"understanding of the element that contains it and/or the understanding\"\n            \" of the containing element's descendants. Usually modifier elements \"\n            \"provide negation or qualification. To make the use of extensions safe \"\n            \"and managable, there is a strict set of governance applied to the \"\n            \"definition and use of extensions. Though any implementer is allowed to\"\n            \" define an extension, there is a set of requirements that SHALL be met\"\n            \" as part of the definition of the extension. Applications processing a\"\n            \" resource are required to check for modifier extensions.  Modifier \"\n            \"extensions SHALL NOT change the meaning of any elements on Resource or\"\n            \" DomainResource (including cannot change the meaning of \"\n            \"modifierExtension itself).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    text: fhirtypes.NarrativeType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text summary of the resource, for human interpretation\",\n        description=(\n            \"A human-readable narrative that contains a summary of the resource and\"\n            \" can be used to represent the content of the resource to a human. The \"\n            \"narrative need not encode all the structured data, but is required to \"\n            'contain sufficient detail to make it \"clinically safe\" for a human to '\n            \"just read the narrative. Resource definitions may define what content \"\n            \"should be represented in the narrative to ensure clinical safety.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DomainResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DomainResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/dosage.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Dosage\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backbonetype, element, fhirtypes\n\n\nclass Dosage(backbonetype.BackboneType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    How the medication is/was taken or should be taken.\n    Indicates how the medication is/was taken or should be taken by the\n    patient.\n    \"\"\"\n\n    __resource_type__ = \"Dosage\"\n\n    additionalInstruction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"additionalInstruction\",\n        title=(\n            'Supplemental instruction or warnings to the patient - e.g. \"with '\n            'meals\", \"may cause drowsiness\"'\n        ),\n        description=(\n            \"Supplemental instructions to the patient on how to take the medication\"\n            '  (e.g. \"with meals\" or\"take half to one hour before food\") or '\n            'warnings for the patient about the medication (e.g. \"may cause '\n            'drowsiness\" or \"avoid exposure of skin to direct sunlight or '\n            'sunlamps\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    asNeeded: bool | None = Field(\n        default=None,\n        alias=\"asNeeded\",\n        title='Take \"as needed\"',\n        description=(\n            \"Indicates whether the Medication is only taken when needed within a \"\n            \"specific dosing schedule (Boolean option).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    asNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_asNeeded\", title=\"Extension field for ``asNeeded``.\"\n    )\n\n    asNeededFor: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"asNeededFor\",\n        title='Take \"as needed\" (for x)',\n        description=(\n            \"Indicates whether the Medication is only taken based on a precondition\"\n            \" for taking the Medication (CodeableConcept).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    doseAndRate: typing.List[fhirtypes.DosageDoseAndRateType] | None = Field(\n        default=None,\n        alias=\"doseAndRate\",\n        title=(\n            \"Amount of medication administered, to be administered or typical \"\n            \"amount to be administered\"\n        ),\n        description=(\n            \"Depending on the resource,this is the amount of medication \"\n            \"administered, to  be administered or typical amount to be \"\n            \"administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxDosePerAdministration: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxDosePerAdministration\",\n        title=\"Upper limit on medication per administration\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxDosePerLifetime: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxDosePerLifetime\",\n        title=\"Upper limit on medication per lifetime of the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxDosePerPeriod: typing.List[fhirtypes.RatioType] | None = Field(\n        default=None,\n        alias=\"maxDosePerPeriod\",\n        title=\"Upper limit on medication per unit of time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Technique for administering medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patientInstruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"patientInstruction\",\n        title=\"Patient or consumer oriented instructions\",\n        description=\"Instructions in terms that are understood by the patient or consumer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    patientInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patientInstruction\",\n        title=\"Extension field for ``patientInstruction``.\",\n    )\n\n    route: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"route\",\n        title=\"How drug should enter body\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"The order of the dosage instructions\",\n        description=(\n            \"Indicates the order in which the dosage instructions should be applied\"\n            \" or interpreted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    site: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Body site to administer to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Free text dosage instructions e.g. SIG\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    timing: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timing\",\n        title=\"When medication should be administered\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Dosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"text\",\n            \"additionalInstruction\",\n            \"patientInstruction\",\n            \"timing\",\n            \"asNeeded\",\n            \"asNeededFor\",\n            \"site\",\n            \"route\",\n            \"method\",\n            \"doseAndRate\",\n            \"maxDosePerPeriod\",\n            \"maxDosePerAdministration\",\n            \"maxDosePerLifetime\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Dosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"sequence\",\n            \"text\",\n            \"additionalInstruction\",\n            \"patientInstruction\",\n            \"timing\",\n            \"asNeeded\",\n            \"asNeededFor\",\n            \"site\",\n            \"route\",\n            \"method\",\n            \"doseAndRate\",\n            \"maxDosePerPeriod\",\n            \"maxDosePerAdministration\",\n            \"maxDosePerLifetime\",\n        ]\n\n\nclass DosageDoseAndRate(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Amount of medication administered, to be administered or typical amount to\n    be administered.\n    Depending on the resource,this is the amount of medication administered, to\n    be administered or typical amount to be administered.\n    \"\"\"\n\n    __resource_type__ = \"DosageDoseAndRate\"\n\n    doseQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"doseQuantity\",\n        title=\"Amount of medication per dose\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e dose[x]\n            \"one_of_many\": \"dose\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    doseRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"doseRange\",\n        title=\"Amount of medication per dose\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e dose[x]\n            \"one_of_many\": \"dose\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"rateQuantity\",\n        title=\"Amount of medication per unit of time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"rateRange\",\n        title=\"Amount of medication per unit of time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"rateRatio\",\n        title=\"Amount of medication per unit of time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of dose or rate specified\",\n        description=(\n            \"The kind of dose or rate specified, for example, ordered or \" \"calculated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``DosageDoseAndRate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"doseRange\",\n            \"doseQuantity\",\n            \"rateRatio\",\n            \"rateRange\",\n            \"rateQuantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``DosageDoseAndRate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"type\",\n            \"doseRange\",\n            \"doseQuantity\",\n            \"rateRatio\",\n            \"rateRange\",\n            \"rateQuantity\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"dose\": [\"doseQuantity\", \"doseRange\"],\n            \"rate\": [\"rateQuantity\", \"rateRange\", \"rateRatio\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/duration.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Duration\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import quantity\n\n\nclass Duration(quantity.Quantity):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A length of time.\n    \"\"\"\n\n    __resource_type__ = \"Duration\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Duration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Duration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/element.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Element\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import base, fhirtypes\n\n\nclass Element(base.Base):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base for all elements.\n    Base definition for all elements in a resource.\n    \"\"\"\n\n    __resource_type__ = \"Element\"\n\n    extension: typing.List[fhirtypes.ExtensionType] | None = Field(\n        default=None,\n        alias=\"extension\",\n        title=\"Additional content defined by implementations\",\n        description=(\n            \"May be used to represent additional information that is not part of \"\n            \"the basic definition of the element. To make the use of extensions \"\n            \"safe and managable, there is a strict set of governance applied to the\"\n            \" definition and use of extensions. Though any implementer can define \"\n            \"an extension, there is a set of requirements that SHALL be met as part\"\n            \" of the definition of the extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    id: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"id\",\n        title=\"Unique id for inter-element referencing\",\n        description=(\n            \"Unique id for the element within a resource (for internal references).\"\n            \" This may be any string value that does not contain spaces.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Element`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Element`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n"
  },
  {
    "path": "fhir/resources/elementdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ElementDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backbonetype, element, fhirtypes\n\n\nclass ElementDefinition(backbonetype.BackboneType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of an element in a resource or extension.\n    Captures constraints on each element within the resource, profile, or\n    extension.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinition\"\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=\"Other names\",\n        description=\"Identifies additional names by which this element might also be known.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    base: fhirtypes.ElementDefinitionBaseType | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"Base definition information for tools\",\n        description=(\n            \"Information about the base definition of the element, provided to make\"\n            \" it unnecessary for tools to trace the deviation of the element \"\n            \"through the derived and related profiles. When the element definition \"\n            \"is not the original definition of an element - e.g. either in a \"\n            \"constraint on another type, or for elements from a super type in a \"\n            \"snap shot - then the information in provided in the element definition\"\n            \" may be different to the base definition. On the original definition \"\n            \"of the element, it will be same.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    binding: fhirtypes.ElementDefinitionBindingType | None = Field(\n        default=None,\n        alias=\"binding\",\n        title=\"ValueSet details if this is coded\",\n        description=(\n            \"Binds to a value set if this element is coded (code, Coding, \"\n            \"CodeableConcept, Quantity), or the data types (string, uri).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Corresponding codes in terminologies\",\n        description=(\n            \"A code that has the same meaning as the element in a particular \"\n            \"terminology.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments about the use of this element\",\n        description=(\n            \"Explanatory notes and implementation guidance about the data element, \"\n            \"including notes about how to use the data properly, exceptions to \"\n            \"proper use, etc. (Note: The text you are reading is specified in \"\n            \"ElementDefinition.comment).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    condition: typing.List[fhirtypes.IdType | None] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Reference to invariant about presence\",\n        description=(\n            \"A reference to an invariant that may make additional statements about \"\n            \"the cardinality or value in the instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    condition__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_condition\", title=\"Extension field for ``condition``.\"\n    )\n\n    constraint: typing.List[fhirtypes.ElementDefinitionConstraintType] | None = Field(\n        default=None,\n        alias=\"constraint\",\n        title=\"Condition that must evaluate to true\",\n        description=(\n            \"Formal constraints such as co-occurrence and other constraints that \"\n            \"can be computationally evaluated within the context of the instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contentReference: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"contentReference\",\n        title=\"Reference to definition of content for the element\",\n        description=(\n            \"Identifies an element defined elsewhere in the definition whose \"\n            \"content rules should be applied to the current element. \"\n            \"ContentReferences bring across all the rules that are in the \"\n            \"ElementDefinition for the element, including definitions, cardinality \"\n            \"constraints, bindings, invariants etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    contentReference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_contentReference\",\n        title=\"Extension field for ``contentReference``.\",\n    )\n\n    defaultValueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"defaultValueAddress\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"defaultValueAge\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"defaultValueAnnotation\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"defaultValueAttachment\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueAvailability: fhirtypes.AvailabilityType | None = Field(\n        default=None,\n        alias=\"defaultValueAvailability\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"defaultValueBase64Binary\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueBase64Binary\",\n        title=\"Extension field for ``defaultValueBase64Binary``.\",\n    )\n\n    defaultValueBoolean: bool | None = Field(\n        default=None,\n        alias=\"defaultValueBoolean\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueBoolean\",\n        title=\"Extension field for ``defaultValueBoolean``.\",\n    )\n\n    defaultValueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"defaultValueCanonical\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueCanonical\",\n        title=\"Extension field for ``defaultValueCanonical``.\",\n    )\n\n    defaultValueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"defaultValueCode\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueCode\",\n        title=\"Extension field for ``defaultValueCode``.\",\n    )\n\n    defaultValueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"defaultValueCodeableConcept\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"defaultValueCodeableReference\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"defaultValueCoding\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"defaultValueContactDetail\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"defaultValueContactPoint\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"defaultValueCount\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"defaultValueDataRequirement\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"defaultValueDate\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDate\",\n        title=\"Extension field for ``defaultValueDate``.\",\n    )\n\n    defaultValueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"defaultValueDateTime\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDateTime\",\n        title=\"Extension field for ``defaultValueDateTime``.\",\n    )\n\n    defaultValueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"defaultValueDecimal\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueDecimal\",\n        title=\"Extension field for ``defaultValueDecimal``.\",\n    )\n\n    defaultValueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"defaultValueDistance\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"defaultValueDosage\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"defaultValueDuration\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"defaultValueExpression\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field(\n        default=None,\n        alias=\"defaultValueExtendedContactDetail\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"defaultValueHumanName\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"defaultValueId\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueId\",\n        title=\"Extension field for ``defaultValueId``.\",\n    )\n\n    defaultValueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"defaultValueIdentifier\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"defaultValueInstant\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueInstant\",\n        title=\"Extension field for ``defaultValueInstant``.\",\n    )\n\n    defaultValueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"defaultValueInteger\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueInteger\",\n        title=\"Extension field for ``defaultValueInteger``.\",\n    )\n\n    defaultValueInteger64: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"defaultValueInteger64\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueInteger64\",\n        title=\"Extension field for ``defaultValueInteger64``.\",\n    )\n\n    defaultValueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"defaultValueMarkdown\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueMarkdown\",\n        title=\"Extension field for ``defaultValueMarkdown``.\",\n    )\n\n    defaultValueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"defaultValueMeta\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"defaultValueMoney\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"defaultValueOid\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueOid\",\n        title=\"Extension field for ``defaultValueOid``.\",\n    )\n\n    defaultValueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"defaultValueParameterDefinition\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"defaultValuePeriod\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"defaultValuePositiveInt\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValuePositiveInt\",\n        title=\"Extension field for ``defaultValuePositiveInt``.\",\n    )\n\n    defaultValueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"defaultValueQuantity\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"defaultValueRange\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"defaultValueRatio\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"defaultValueRatioRange\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"defaultValueReference\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"defaultValueRelatedArtifact\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"defaultValueSampledData\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"defaultValueSignature\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"defaultValueString\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueString\",\n        title=\"Extension field for ``defaultValueString``.\",\n    )\n\n    defaultValueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"defaultValueTime\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueTime\",\n        title=\"Extension field for ``defaultValueTime``.\",\n    )\n\n    defaultValueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"defaultValueTiming\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"defaultValueTriggerDefinition\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"defaultValueUnsignedInt\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUnsignedInt\",\n        title=\"Extension field for ``defaultValueUnsignedInt``.\",\n    )\n\n    defaultValueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"defaultValueUri\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUri\",\n        title=\"Extension field for ``defaultValueUri``.\",\n    )\n\n    defaultValueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"defaultValueUrl\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUrl\",\n        title=\"Extension field for ``defaultValueUrl``.\",\n    )\n\n    defaultValueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"defaultValueUsageContext\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    defaultValueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"defaultValueUuid\",\n        title=\"Specified value if missing from instance\",\n        description=(\n            \"The value that should be used if there is no value stated in the \"\n            \"instance (e.g. 'if not otherwise specified, the abstract is false').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e defaultValue[x]\n            \"one_of_many\": \"defaultValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    defaultValueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValueUuid\",\n        title=\"Extension field for ``defaultValueUuid``.\",\n    )\n\n    definition: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Full formal definition as narrative text\",\n        description=(\n            \"Provides a complete explanation of the meaning of the data element for\"\n            \" human readability.  For the case of elements derived from existing \"\n            \"elements (e.g. constraints), the definition SHALL be consistent with \"\n            \"the base definition, but convey the meaning of the element in the \"\n            \"particular context of use of the resource. (Note: The text you are \"\n            \"reading is specified in ElementDefinition.definition).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    example: typing.List[fhirtypes.ElementDefinitionExampleType] | None = Field(\n        default=None,\n        alias=\"example\",\n        title=\"Example value (as defined for type)\",\n        description=(\n            \"A sample value for this element demonstrating the type of information \"\n            \"that would typically be found in the element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    fixedAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"fixedAddress\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"fixedAge\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"fixedAnnotation\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"fixedAttachment\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedAvailability: fhirtypes.AvailabilityType | None = Field(\n        default=None,\n        alias=\"fixedAvailability\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"fixedBase64Binary\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedBase64Binary\",\n        title=\"Extension field for ``fixedBase64Binary``.\",\n    )\n\n    fixedBoolean: bool | None = Field(\n        default=None,\n        alias=\"fixedBoolean\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedBoolean\",\n        title=\"Extension field for ``fixedBoolean``.\",\n    )\n\n    fixedCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"fixedCanonical\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedCanonical\",\n        title=\"Extension field for ``fixedCanonical``.\",\n    )\n\n    fixedCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"fixedCode\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedCode\", title=\"Extension field for ``fixedCode``.\"\n    )\n\n    fixedCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fixedCodeableConcept\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"fixedCodeableReference\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"fixedCoding\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"fixedContactDetail\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"fixedContactPoint\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"fixedCount\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"fixedDataRequirement\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"fixedDate\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedDate\", title=\"Extension field for ``fixedDate``.\"\n    )\n\n    fixedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"fixedDateTime\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedDateTime\",\n        title=\"Extension field for ``fixedDateTime``.\",\n    )\n\n    fixedDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"fixedDecimal\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedDecimal\",\n        title=\"Extension field for ``fixedDecimal``.\",\n    )\n\n    fixedDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"fixedDistance\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"fixedDosage\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"fixedDuration\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"fixedExpression\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field(\n        default=None,\n        alias=\"fixedExtendedContactDetail\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"fixedHumanName\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"fixedId\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedId\", title=\"Extension field for ``fixedId``.\"\n    )\n\n    fixedIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"fixedIdentifier\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"fixedInstant\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedInstant\",\n        title=\"Extension field for ``fixedInstant``.\",\n    )\n\n    fixedInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"fixedInteger\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedInteger\",\n        title=\"Extension field for ``fixedInteger``.\",\n    )\n\n    fixedInteger64: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"fixedInteger64\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedInteger64\",\n        title=\"Extension field for ``fixedInteger64``.\",\n    )\n\n    fixedMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"fixedMarkdown\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedMarkdown\",\n        title=\"Extension field for ``fixedMarkdown``.\",\n    )\n\n    fixedMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"fixedMeta\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"fixedMoney\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"fixedOid\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedOid\", title=\"Extension field for ``fixedOid``.\"\n    )\n\n    fixedParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"fixedParameterDefinition\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"fixedPeriod\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"fixedPositiveInt\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedPositiveInt\",\n        title=\"Extension field for ``fixedPositiveInt``.\",\n    )\n\n    fixedQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"fixedQuantity\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"fixedRange\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"fixedRatio\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"fixedRatioRange\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"fixedReference\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"fixedRelatedArtifact\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"fixedSampledData\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"fixedSignature\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"fixedString\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedString\", title=\"Extension field for ``fixedString``.\"\n    )\n\n    fixedTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"fixedTime\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedTime\", title=\"Extension field for ``fixedTime``.\"\n    )\n\n    fixedTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"fixedTiming\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"fixedTriggerDefinition\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"fixedUnsignedInt\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fixedUnsignedInt\",\n        title=\"Extension field for ``fixedUnsignedInt``.\",\n    )\n\n    fixedUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"fixedUri\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedUri\", title=\"Extension field for ``fixedUri``.\"\n    )\n\n    fixedUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"fixedUrl\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedUrl\", title=\"Extension field for ``fixedUrl``.\"\n    )\n\n    fixedUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"fixedUsageContext\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fixedUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"fixedUuid\",\n        title=\"Value must be exactly this\",\n        description=(\n            \"Specifies a value that SHALL be exactly the value  for this element in\"\n            \" the instance, if present. For purposes of comparison, non-significant\"\n            \" whitespace is ignored, and all values must be an exact match (case \"\n            \"and accent sensitive). Missing elements/attributes must also be \"\n            \"missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fixed[x]\n            \"one_of_many\": \"fixed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    fixedUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fixedUuid\", title=\"Extension field for ``fixedUuid``.\"\n    )\n\n    isModifier: bool | None = Field(\n        default=None,\n        alias=\"isModifier\",\n        title=\"If this modifies the meaning of other elements\",\n        description=(\n            \"If true, the value of this element affects the interpretation of the \"\n            \"element or resource that contains it, and the value of the element \"\n            \"cannot be ignored. Typically, this is used for status, negation and \"\n            \"qualification codes. The effect of this is that the element cannot be \"\n            \"ignored by systems: they SHALL either recognize the element and \"\n            \"process it, and/or a pre-determination has been made that it is not \"\n            \"relevant to their particular system. When used on the root element in \"\n            \"an extension definition, this indicates whether or not the extension \"\n            \"is a modifier extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isModifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isModifier\", title=\"Extension field for ``isModifier``.\"\n    )\n\n    isModifierReason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"isModifierReason\",\n        title=\"Reason that this element is marked as a modifier\",\n        description=(\n            \"Explains how that element affects the interpretation of the resource \"\n            \"or element that contains it.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isModifierReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_isModifierReason\",\n        title=\"Extension field for ``isModifierReason``.\",\n    )\n\n    isSummary: bool | None = Field(\n        default=None,\n        alias=\"isSummary\",\n        title=\"Include when _summary = true?\",\n        description=(\n            \"Whether the element should be included if a client requests a search \"\n            \"with the parameter _summary=true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isSummary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isSummary\", title=\"Extension field for ``isSummary``.\"\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Name for element to display with or prompt for element\",\n        description=(\n            \"A single preferred label which is the text to display beside the \"\n            \"element indicating its meaning or to use to prompt for the element in \"\n            \"a user display or form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    mapping: typing.List[fhirtypes.ElementDefinitionMappingType] | None = Field(\n        default=None,\n        alias=\"mapping\",\n        title=\"Map element to another set of definitions\",\n        description=(\n            \"Identifies a concept from an external specification that roughly \"\n            \"corresponds to this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum Cardinality (a number or *)\",\n        description=(\n            \"The maximum number of times this element is permitted to appear in the\"\n            \" instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    maxLength: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"maxLength\",\n        title=\"Max length for string type data\",\n        description=(\n            \"Indicates the maximum length in characters that is permitted to be \"\n            \"present in conformant instances and which is expected to be supported \"\n            \"by conformant consumers that support the element. ```maxLength``` \"\n            \"SHOULD only be used on primitive data types that have a string \"\n            \"representation (see \"\n            \"[http://hl7.org/fhir/StructureDefinition/structuredefinition-type-\"\n            \"characteristics](http://hl7.org/fhir/extensions/StructureDefinition-\"\n            \"structuredefinition-type-characteristics.html)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    maxLength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_maxLength\", title=\"Extension field for ``maxLength``.\"\n    )\n\n    maxValueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"maxValueDate\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueDate\",\n        title=\"Extension field for ``maxValueDate``.\",\n    )\n\n    maxValueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"maxValueDateTime\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueDateTime\",\n        title=\"Extension field for ``maxValueDateTime``.\",\n    )\n\n    maxValueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"maxValueDecimal\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueDecimal\",\n        title=\"Extension field for ``maxValueDecimal``.\",\n    )\n\n    maxValueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"maxValueInstant\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueInstant\",\n        title=\"Extension field for ``maxValueInstant``.\",\n    )\n\n    maxValueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"maxValueInteger\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueInteger\",\n        title=\"Extension field for ``maxValueInteger``.\",\n    )\n\n    maxValueInteger64: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"maxValueInteger64\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueInteger64\",\n        title=\"Extension field for ``maxValueInteger64``.\",\n    )\n\n    maxValuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"maxValuePositiveInt\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValuePositiveInt\",\n        title=\"Extension field for ``maxValuePositiveInt``.\",\n    )\n\n    maxValueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxValueQuantity\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    maxValueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"maxValueTime\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueTime\",\n        title=\"Extension field for ``maxValueTime``.\",\n    )\n\n    maxValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"maxValueUnsignedInt\",\n        title=\"Maximum Allowed Value (for some types)\",\n        description=(\n            \"The maximum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e maxValue[x]\n            \"one_of_many\": \"maxValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    maxValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxValueUnsignedInt\",\n        title=\"Extension field for ``maxValueUnsignedInt``.\",\n    )\n\n    meaningWhenMissing: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"meaningWhenMissing\",\n        title=\"Implicit meaning when this element is missing\",\n        description=(\n            \"The Implicit meaning that is to be understood when this element is \"\n            \"missing (e.g. 'when this element is missing, the period is ongoing').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    meaningWhenMissing__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_meaningWhenMissing\",\n        title=\"Extension field for ``meaningWhenMissing``.\",\n    )\n\n    min: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum Cardinality\",\n        description=\"The minimum number of times this element SHALL appear in the instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    minValueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"minValueDate\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueDate\",\n        title=\"Extension field for ``minValueDate``.\",\n    )\n\n    minValueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"minValueDateTime\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueDateTime\",\n        title=\"Extension field for ``minValueDateTime``.\",\n    )\n\n    minValueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"minValueDecimal\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueDecimal\",\n        title=\"Extension field for ``minValueDecimal``.\",\n    )\n\n    minValueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"minValueInstant\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueInstant\",\n        title=\"Extension field for ``minValueInstant``.\",\n    )\n\n    minValueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"minValueInteger\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueInteger\",\n        title=\"Extension field for ``minValueInteger``.\",\n    )\n\n    minValueInteger64: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"minValueInteger64\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueInteger64\",\n        title=\"Extension field for ``minValueInteger64``.\",\n    )\n\n    minValuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"minValuePositiveInt\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValuePositiveInt\",\n        title=\"Extension field for ``minValuePositiveInt``.\",\n    )\n\n    minValueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"minValueQuantity\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    minValueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"minValueTime\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueTime\",\n        title=\"Extension field for ``minValueTime``.\",\n    )\n\n    minValueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"minValueUnsignedInt\",\n        title=\"Minimum Allowed Value (for some types)\",\n        description=(\n            \"The minimum allowed value for the element. The value is inclusive. \"\n            \"This is allowed for the types date, dateTime, instant, time, decimal, \"\n            \"integer, and Quantity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e minValue[x]\n            \"one_of_many\": \"minValue\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minValueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minValueUnsignedInt\",\n        title=\"Extension field for ``minValueUnsignedInt``.\",\n    )\n\n    mustHaveValue: bool | None = Field(\n        default=None,\n        alias=\"mustHaveValue\",\n        title=(\n            \"For primitives, that a value must be present - not replaced by an \"\n            \"extension\"\n        ),\n        description=(\n            \"Specifies for a primitive data type that the value of the data type \"\n            \"cannot be replaced by an extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    mustHaveValue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_mustHaveValue\",\n        title=\"Extension field for ``mustHaveValue``.\",\n    )\n\n    mustSupport: bool | None = Field(\n        default=None,\n        alias=\"mustSupport\",\n        title=\"If the element must be supported (discouraged - see obligations)\",\n        description=(\n            \"If true, implementations that produce or consume resources SHALL \"\n            'provide \"support\" for the element in some meaningful way. Note that '\n            \"this is being phased out and replaced by obligations (see below).  If \"\n            \"false, the element may be ignored and not supported. If false, whether\"\n            \" to populate or use the data element in any way is at the discretion \"\n            \"of the implementation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    mustSupport__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mustSupport\", title=\"Extension field for ``mustSupport``.\"\n    )\n\n    orderMeaning: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"orderMeaning\",\n        title=\"What the order of the elements means\",\n        description=(\n            \"If present, indicates that the order of the repeating element has \"\n            \"meaning and describes what that meaning is.  If absent, it means that \"\n            \"the order of the element has no meaning.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    orderMeaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_orderMeaning\",\n        title=\"Extension field for ``orderMeaning``.\",\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path of the element in the hierarchy of elements\",\n        description=(\n            'The path identifies the element and is expressed as a \".\"-separated '\n            \"list of ancestor elements, beginning with the name of the resource or \"\n            \"extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    patternAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"patternAddress\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"patternAge\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"patternAnnotation\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"patternAttachment\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternAvailability: fhirtypes.AvailabilityType | None = Field(\n        default=None,\n        alias=\"patternAvailability\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"patternBase64Binary\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternBase64Binary\",\n        title=\"Extension field for ``patternBase64Binary``.\",\n    )\n\n    patternBoolean: bool | None = Field(\n        default=None,\n        alias=\"patternBoolean\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternBoolean\",\n        title=\"Extension field for ``patternBoolean``.\",\n    )\n\n    patternCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"patternCanonical\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternCanonical\",\n        title=\"Extension field for ``patternCanonical``.\",\n    )\n\n    patternCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"patternCode\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternCode\", title=\"Extension field for ``patternCode``.\"\n    )\n\n    patternCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"patternCodeableConcept\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"patternCodeableReference\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"patternCoding\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"patternContactDetail\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"patternContactPoint\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"patternCount\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"patternDataRequirement\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"patternDate\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternDate\", title=\"Extension field for ``patternDate``.\"\n    )\n\n    patternDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"patternDateTime\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternDateTime\",\n        title=\"Extension field for ``patternDateTime``.\",\n    )\n\n    patternDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"patternDecimal\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternDecimal\",\n        title=\"Extension field for ``patternDecimal``.\",\n    )\n\n    patternDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"patternDistance\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"patternDosage\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"patternDuration\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"patternExpression\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field(\n        default=None,\n        alias=\"patternExtendedContactDetail\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"patternHumanName\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"patternId\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternId\", title=\"Extension field for ``patternId``.\"\n    )\n\n    patternIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"patternIdentifier\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"patternInstant\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternInstant\",\n        title=\"Extension field for ``patternInstant``.\",\n    )\n\n    patternInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"patternInteger\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternInteger\",\n        title=\"Extension field for ``patternInteger``.\",\n    )\n\n    patternInteger64: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"patternInteger64\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternInteger64\",\n        title=\"Extension field for ``patternInteger64``.\",\n    )\n\n    patternMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"patternMarkdown\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternMarkdown\",\n        title=\"Extension field for ``patternMarkdown``.\",\n    )\n\n    patternMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"patternMeta\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patternMoney\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"patternOid\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternOid\", title=\"Extension field for ``patternOid``.\"\n    )\n\n    patternParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"patternParameterDefinition\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"patternPeriod\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"patternPositiveInt\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternPositiveInt\",\n        title=\"Extension field for ``patternPositiveInt``.\",\n    )\n\n    patternQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"patternQuantity\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"patternRange\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"patternRatio\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"patternRatioRange\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patternReference\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"patternRelatedArtifact\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"patternSampledData\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"patternSignature\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"patternString\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternString\",\n        title=\"Extension field for ``patternString``.\",\n    )\n\n    patternTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"patternTime\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternTime\", title=\"Extension field for ``patternTime``.\"\n    )\n\n    patternTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"patternTiming\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"patternTriggerDefinition\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"patternUnsignedInt\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_patternUnsignedInt\",\n        title=\"Extension field for ``patternUnsignedInt``.\",\n    )\n\n    patternUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"patternUri\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternUri\", title=\"Extension field for ``patternUri``.\"\n    )\n\n    patternUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"patternUrl\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternUrl\", title=\"Extension field for ``patternUrl``.\"\n    )\n\n    patternUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"patternUsageContext\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patternUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"patternUuid\",\n        title=\"Value must have at least these property values\",\n        description=(\n            \"Specifies a value that each occurrence of the element in the instance \"\n            \"SHALL follow - that is, any value in the pattern must be found in the \"\n            \"instance, if the element has a value. Other additional values may be \"\n            \"found too. This is effectively constraint by example.    When \"\n            \"pattern[x] is used to constrain a primitive, it means that the value \"\n            \"provided in the pattern[x] must match the instance value exactly.  \"\n            \"When an element within a pattern[x] is used to constrain an array, it \"\n            \"means that each element provided in the pattern[x] must (recursively) \"\n            \"match at least one element from the instance array.  When pattern[x] \"\n            \"is used to constrain a complex object, it means that each property in \"\n            \"the pattern must be present in the complex object, and its value must \"\n            \"recursively match -- i.e.,  1. If primitive: it must match exactly the\"\n            \" pattern value 2. If a complex object: it must match (recursively) the\"\n            \" pattern value 3. If an array: it must match (recursively) the pattern\"\n            \" value  If a pattern[x] is declared on a repeating element, the \"\n            \"pattern applies to all repetitions.  If the desire is for a pattern to\"\n            \" apply to only one element or a subset of elements, slicing must be \"\n            \"used. See [Examples of Patterns](elementdefinition-\"\n            \"examples.html#pattern-examples) for examples of pattern usage and the \"\n            \"effect it will have.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e pattern[x]\n            \"one_of_many\": \"pattern\",\n            \"one_of_many_required\": False,\n        },\n    )\n    patternUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_patternUuid\", title=\"Extension field for ``patternUuid``.\"\n    )\n\n    representation: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"representation\",\n        title=\"xmlAttr | xmlText | typeAttr | cdaText | xhtml\",\n        description=(\n            \"Codes that define how this element is represented in instances, when \"\n            \"the deviation varies from the normal case. No extensions are allowed \"\n            \"on elements with a representation of 'xmlAttr', no matter what FHIR \"\n            \"serialization format is used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"xmlAttr\", \"xmlText\", \"typeAttr\", \"cdaText\", \"xhtml\"],\n        },\n    )\n    representation__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_representation\",\n        title=\"Extension field for ``representation``.\",\n    )\n\n    requirements: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"requirements\",\n        title=\"Why this resource has been created\",\n        description=(\n            \"This element is for traceability of why the element was created and \"\n            \"why the constraints exist as they do. This may be used to point to \"\n            \"source materials or specifications that drove the structure of this \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    requirements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requirements\",\n        title=\"Extension field for ``requirements``.\",\n    )\n\n    short: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"short\",\n        title=\"Concise definition for space-constrained presentation\",\n        description=(\n            \"A concise description of what this element means (e.g. for use in \"\n            \"autogenerated summaries).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    short__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_short\", title=\"Extension field for ``short``.\"\n    )\n\n    sliceIsConstraining: bool | None = Field(\n        default=None,\n        alias=\"sliceIsConstraining\",\n        title=(\n            \"If this slice definition constrains an inherited slice definition (or \"\n            \"not)\"\n        ),\n        description=(\n            \"If true, indicates that this slice definition is constraining a slice \"\n            \"definition with the same name in an inherited profile. If false, the \"\n            \"slice is not overriding any slice in an inherited profile. If missing,\"\n            \" the slice might or might not be overriding a slice in an inherited \"\n            \"profile, depending on the sliceName.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sliceIsConstraining__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sliceIsConstraining\",\n        title=\"Extension field for ``sliceIsConstraining``.\",\n    )\n\n    sliceName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sliceName\",\n        title=\"Name for this particular element (in a set of slices)\",\n        description=(\n            \"The name of this element definition slice, when slicing is working. \"\n            \"The name must be a token with no dots or spaces. This is a unique name\"\n            \" referring to a specific set of constraints applied to this element, \"\n            \"used to provide a name to different slices of the same element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sliceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sliceName\", title=\"Extension field for ``sliceName``.\"\n    )\n\n    slicing: fhirtypes.ElementDefinitionSlicingType | None = Field(\n        default=None,\n        alias=\"slicing\",\n        title=\"This element is sliced - slices follow\",\n        description=(\n            \"Indicates that the element is sliced into a set of alternative \"\n            \"definitions (i.e. in a structure definition, there are multiple \"\n            \"different constraints on a single element in the base resource). \"\n            \"Slicing can be used in any resource that has cardinality ..* on the \"\n            \"base resource, or any resource with a choice of types. The set of \"\n            \"slices is any elements that come after this in the element sequence \"\n            \"that have the same path, until a shorter path occurs (the shorter path\"\n            \" terminates the set).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.ElementDefinitionTypeType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Data type and Profile for this element\",\n        description=(\n            \"The data type or resource that the value of this element is permitted \"\n            \"to be.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAlternatives: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"valueAlternatives\",\n        title=\"Extensions that are allowed to replace a primitive value\",\n        description=(\n            \"Specifies a list of extensions that can appear in place of a primitive\"\n            \" value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    valueAlternatives__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_valueAlternatives\",\n        title=\"Extension field for ``valueAlternatives``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"path\",\n            \"representation\",\n            \"sliceName\",\n            \"sliceIsConstraining\",\n            \"label\",\n            \"code\",\n            \"slicing\",\n            \"short\",\n            \"definition\",\n            \"comment\",\n            \"requirements\",\n            \"alias\",\n            \"min\",\n            \"max\",\n            \"base\",\n            \"contentReference\",\n            \"type\",\n            \"defaultValueBase64Binary\",\n            \"defaultValueBoolean\",\n            \"defaultValueCanonical\",\n            \"defaultValueCode\",\n            \"defaultValueDate\",\n            \"defaultValueDateTime\",\n            \"defaultValueDecimal\",\n            \"defaultValueId\",\n            \"defaultValueInstant\",\n            \"defaultValueInteger\",\n            \"defaultValueInteger64\",\n            \"defaultValueMarkdown\",\n            \"defaultValueOid\",\n            \"defaultValuePositiveInt\",\n            \"defaultValueString\",\n            \"defaultValueTime\",\n            \"defaultValueUnsignedInt\",\n            \"defaultValueUri\",\n            \"defaultValueUrl\",\n            \"defaultValueUuid\",\n            \"defaultValueAddress\",\n            \"defaultValueAge\",\n            \"defaultValueAnnotation\",\n            \"defaultValueAttachment\",\n            \"defaultValueCodeableConcept\",\n            \"defaultValueCodeableReference\",\n            \"defaultValueCoding\",\n            \"defaultValueContactPoint\",\n            \"defaultValueCount\",\n            \"defaultValueDistance\",\n            \"defaultValueDuration\",\n            \"defaultValueHumanName\",\n            \"defaultValueIdentifier\",\n            \"defaultValueMoney\",\n            \"defaultValuePeriod\",\n            \"defaultValueQuantity\",\n            \"defaultValueRange\",\n            \"defaultValueRatio\",\n            \"defaultValueRatioRange\",\n            \"defaultValueReference\",\n            \"defaultValueSampledData\",\n            \"defaultValueSignature\",\n            \"defaultValueTiming\",\n            \"defaultValueContactDetail\",\n            \"defaultValueDataRequirement\",\n            \"defaultValueExpression\",\n            \"defaultValueParameterDefinition\",\n            \"defaultValueRelatedArtifact\",\n            \"defaultValueTriggerDefinition\",\n            \"defaultValueUsageContext\",\n            \"defaultValueAvailability\",\n            \"defaultValueExtendedContactDetail\",\n            \"defaultValueDosage\",\n            \"defaultValueMeta\",\n            \"meaningWhenMissing\",\n            \"orderMeaning\",\n            \"fixedBase64Binary\",\n            \"fixedBoolean\",\n            \"fixedCanonical\",\n            \"fixedCode\",\n            \"fixedDate\",\n            \"fixedDateTime\",\n            \"fixedDecimal\",\n            \"fixedId\",\n            \"fixedInstant\",\n            \"fixedInteger\",\n            \"fixedInteger64\",\n            \"fixedMarkdown\",\n            \"fixedOid\",\n            \"fixedPositiveInt\",\n            \"fixedString\",\n            \"fixedTime\",\n            \"fixedUnsignedInt\",\n            \"fixedUri\",\n            \"fixedUrl\",\n            \"fixedUuid\",\n            \"fixedAddress\",\n            \"fixedAge\",\n            \"fixedAnnotation\",\n            \"fixedAttachment\",\n            \"fixedCodeableConcept\",\n            \"fixedCodeableReference\",\n            \"fixedCoding\",\n            \"fixedContactPoint\",\n            \"fixedCount\",\n            \"fixedDistance\",\n            \"fixedDuration\",\n            \"fixedHumanName\",\n            \"fixedIdentifier\",\n            \"fixedMoney\",\n            \"fixedPeriod\",\n            \"fixedQuantity\",\n            \"fixedRange\",\n            \"fixedRatio\",\n            \"fixedRatioRange\",\n            \"fixedReference\",\n            \"fixedSampledData\",\n            \"fixedSignature\",\n            \"fixedTiming\",\n            \"fixedContactDetail\",\n            \"fixedDataRequirement\",\n            \"fixedExpression\",\n            \"fixedParameterDefinition\",\n            \"fixedRelatedArtifact\",\n            \"fixedTriggerDefinition\",\n            \"fixedUsageContext\",\n            \"fixedAvailability\",\n            \"fixedExtendedContactDetail\",\n            \"fixedDosage\",\n            \"fixedMeta\",\n            \"patternBase64Binary\",\n            \"patternBoolean\",\n            \"patternCanonical\",\n            \"patternCode\",\n            \"patternDate\",\n            \"patternDateTime\",\n            \"patternDecimal\",\n            \"patternId\",\n            \"patternInstant\",\n            \"patternInteger\",\n            \"patternInteger64\",\n            \"patternMarkdown\",\n            \"patternOid\",\n            \"patternPositiveInt\",\n            \"patternString\",\n            \"patternTime\",\n            \"patternUnsignedInt\",\n            \"patternUri\",\n            \"patternUrl\",\n            \"patternUuid\",\n            \"patternAddress\",\n            \"patternAge\",\n            \"patternAnnotation\",\n            \"patternAttachment\",\n            \"patternCodeableConcept\",\n            \"patternCodeableReference\",\n            \"patternCoding\",\n            \"patternContactPoint\",\n            \"patternCount\",\n            \"patternDistance\",\n            \"patternDuration\",\n            \"patternHumanName\",\n            \"patternIdentifier\",\n            \"patternMoney\",\n            \"patternPeriod\",\n            \"patternQuantity\",\n            \"patternRange\",\n            \"patternRatio\",\n            \"patternRatioRange\",\n            \"patternReference\",\n            \"patternSampledData\",\n            \"patternSignature\",\n            \"patternTiming\",\n            \"patternContactDetail\",\n            \"patternDataRequirement\",\n            \"patternExpression\",\n            \"patternParameterDefinition\",\n            \"patternRelatedArtifact\",\n            \"patternTriggerDefinition\",\n            \"patternUsageContext\",\n            \"patternAvailability\",\n            \"patternExtendedContactDetail\",\n            \"patternDosage\",\n            \"patternMeta\",\n            \"example\",\n            \"minValueDate\",\n            \"minValueDateTime\",\n            \"minValueInstant\",\n            \"minValueTime\",\n            \"minValueDecimal\",\n            \"minValueInteger\",\n            \"minValueInteger64\",\n            \"minValuePositiveInt\",\n            \"minValueUnsignedInt\",\n            \"minValueQuantity\",\n            \"maxValueDate\",\n            \"maxValueDateTime\",\n            \"maxValueInstant\",\n            \"maxValueTime\",\n            \"maxValueDecimal\",\n            \"maxValueInteger\",\n            \"maxValueInteger64\",\n            \"maxValuePositiveInt\",\n            \"maxValueUnsignedInt\",\n            \"maxValueQuantity\",\n            \"maxLength\",\n            \"condition\",\n            \"constraint\",\n            \"mustHaveValue\",\n            \"valueAlternatives\",\n            \"mustSupport\",\n            \"isModifier\",\n            \"isModifierReason\",\n            \"isSummary\",\n            \"binding\",\n            \"mapping\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"path\",\n            \"representation\",\n            \"sliceName\",\n            \"sliceIsConstraining\",\n            \"label\",\n            \"code\",\n            \"slicing\",\n            \"short\",\n            \"definition\",\n            \"comment\",\n            \"requirements\",\n            \"alias\",\n            \"min\",\n            \"max\",\n            \"base\",\n            \"contentReference\",\n            \"type\",\n            \"defaultValueBase64Binary\",\n            \"defaultValueBoolean\",\n            \"defaultValueCanonical\",\n            \"defaultValueCode\",\n            \"defaultValueDate\",\n            \"defaultValueDateTime\",\n            \"defaultValueDecimal\",\n            \"defaultValueId\",\n            \"defaultValueInstant\",\n            \"defaultValueInteger\",\n            \"defaultValueInteger64\",\n            \"defaultValueMarkdown\",\n            \"defaultValueOid\",\n            \"defaultValuePositiveInt\",\n            \"defaultValueString\",\n            \"defaultValueTime\",\n            \"defaultValueUnsignedInt\",\n            \"defaultValueUri\",\n            \"defaultValueUrl\",\n            \"defaultValueUuid\",\n            \"defaultValueAddress\",\n            \"defaultValueAge\",\n            \"defaultValueAnnotation\",\n            \"defaultValueAttachment\",\n            \"defaultValueCodeableConcept\",\n            \"defaultValueCodeableReference\",\n            \"defaultValueCoding\",\n            \"defaultValueContactPoint\",\n            \"defaultValueCount\",\n            \"defaultValueDistance\",\n            \"defaultValueDuration\",\n            \"defaultValueHumanName\",\n            \"defaultValueIdentifier\",\n            \"defaultValueMoney\",\n            \"defaultValuePeriod\",\n            \"defaultValueQuantity\",\n            \"defaultValueRange\",\n            \"defaultValueRatio\",\n            \"defaultValueRatioRange\",\n            \"defaultValueReference\",\n            \"defaultValueSampledData\",\n            \"defaultValueSignature\",\n            \"defaultValueTiming\",\n            \"defaultValueContactDetail\",\n            \"defaultValueDataRequirement\",\n            \"defaultValueExpression\",\n            \"defaultValueParameterDefinition\",\n            \"defaultValueRelatedArtifact\",\n            \"defaultValueTriggerDefinition\",\n            \"defaultValueUsageContext\",\n            \"defaultValueAvailability\",\n            \"defaultValueExtendedContactDetail\",\n            \"defaultValueDosage\",\n            \"defaultValueMeta\",\n            \"meaningWhenMissing\",\n            \"orderMeaning\",\n            \"fixedBase64Binary\",\n            \"fixedBoolean\",\n            \"fixedCanonical\",\n            \"fixedCode\",\n            \"fixedDate\",\n            \"fixedDateTime\",\n            \"fixedDecimal\",\n            \"fixedId\",\n            \"fixedInstant\",\n            \"fixedInteger\",\n            \"fixedInteger64\",\n            \"fixedMarkdown\",\n            \"fixedOid\",\n            \"fixedPositiveInt\",\n            \"fixedString\",\n            \"fixedTime\",\n            \"fixedUnsignedInt\",\n            \"fixedUri\",\n            \"fixedUrl\",\n            \"fixedUuid\",\n            \"fixedAddress\",\n            \"fixedAge\",\n            \"fixedAnnotation\",\n            \"fixedAttachment\",\n            \"fixedCodeableConcept\",\n            \"fixedCodeableReference\",\n            \"fixedCoding\",\n            \"fixedContactPoint\",\n            \"fixedCount\",\n            \"fixedDistance\",\n            \"fixedDuration\",\n            \"fixedHumanName\",\n            \"fixedIdentifier\",\n            \"fixedMoney\",\n            \"fixedPeriod\",\n            \"fixedQuantity\",\n            \"fixedRange\",\n            \"fixedRatio\",\n            \"fixedRatioRange\",\n            \"fixedReference\",\n            \"fixedSampledData\",\n            \"fixedSignature\",\n            \"fixedTiming\",\n            \"fixedContactDetail\",\n            \"fixedDataRequirement\",\n            \"fixedExpression\",\n            \"fixedParameterDefinition\",\n            \"fixedRelatedArtifact\",\n            \"fixedTriggerDefinition\",\n            \"fixedUsageContext\",\n            \"fixedAvailability\",\n            \"fixedExtendedContactDetail\",\n            \"fixedDosage\",\n            \"fixedMeta\",\n            \"patternBase64Binary\",\n            \"patternBoolean\",\n            \"patternCanonical\",\n            \"patternCode\",\n            \"patternDate\",\n            \"patternDateTime\",\n            \"patternDecimal\",\n            \"patternId\",\n            \"patternInstant\",\n            \"patternInteger\",\n            \"patternInteger64\",\n            \"patternMarkdown\",\n            \"patternOid\",\n            \"patternPositiveInt\",\n            \"patternString\",\n            \"patternTime\",\n            \"patternUnsignedInt\",\n            \"patternUri\",\n            \"patternUrl\",\n            \"patternUuid\",\n            \"patternAddress\",\n            \"patternAge\",\n            \"patternAnnotation\",\n            \"patternAttachment\",\n            \"patternCodeableConcept\",\n            \"patternCodeableReference\",\n            \"patternCoding\",\n            \"patternContactPoint\",\n            \"patternCount\",\n            \"patternDistance\",\n            \"patternDuration\",\n            \"patternHumanName\",\n            \"patternIdentifier\",\n            \"patternMoney\",\n            \"patternPeriod\",\n            \"patternQuantity\",\n            \"patternRange\",\n            \"patternRatio\",\n            \"patternRatioRange\",\n            \"patternReference\",\n            \"patternSampledData\",\n            \"patternSignature\",\n            \"patternTiming\",\n            \"patternContactDetail\",\n            \"patternDataRequirement\",\n            \"patternExpression\",\n            \"patternParameterDefinition\",\n            \"patternRelatedArtifact\",\n            \"patternTriggerDefinition\",\n            \"patternUsageContext\",\n            \"patternAvailability\",\n            \"patternExtendedContactDetail\",\n            \"patternDosage\",\n            \"patternMeta\",\n            \"example\",\n            \"minValueDate\",\n            \"minValueDateTime\",\n            \"minValueInstant\",\n            \"minValueTime\",\n            \"minValueDecimal\",\n            \"minValueInteger\",\n            \"minValueInteger64\",\n            \"minValuePositiveInt\",\n            \"minValueUnsignedInt\",\n            \"minValueQuantity\",\n            \"maxValueDate\",\n            \"maxValueDateTime\",\n            \"maxValueInstant\",\n            \"maxValueTime\",\n            \"maxValueDecimal\",\n            \"maxValueInteger\",\n            \"maxValueInteger64\",\n            \"maxValuePositiveInt\",\n            \"maxValueUnsignedInt\",\n            \"maxValueQuantity\",\n            \"maxLength\",\n            \"condition\",\n            \"constraint\",\n            \"mustHaveValue\",\n            \"valueAlternatives\",\n            \"mustSupport\",\n            \"isModifier\",\n            \"isModifierReason\",\n            \"isSummary\",\n            \"binding\",\n            \"mapping\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"path\", \"path__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"defaultValue\": [\n                \"defaultValueAddress\",\n                \"defaultValueAge\",\n                \"defaultValueAnnotation\",\n                \"defaultValueAttachment\",\n                \"defaultValueAvailability\",\n                \"defaultValueBase64Binary\",\n                \"defaultValueBoolean\",\n                \"defaultValueCanonical\",\n                \"defaultValueCode\",\n                \"defaultValueCodeableConcept\",\n                \"defaultValueCodeableReference\",\n                \"defaultValueCoding\",\n                \"defaultValueContactDetail\",\n                \"defaultValueContactPoint\",\n                \"defaultValueCount\",\n                \"defaultValueDataRequirement\",\n                \"defaultValueDate\",\n                \"defaultValueDateTime\",\n                \"defaultValueDecimal\",\n                \"defaultValueDistance\",\n                \"defaultValueDosage\",\n                \"defaultValueDuration\",\n                \"defaultValueExpression\",\n                \"defaultValueExtendedContactDetail\",\n                \"defaultValueHumanName\",\n                \"defaultValueId\",\n                \"defaultValueIdentifier\",\n                \"defaultValueInstant\",\n                \"defaultValueInteger\",\n                \"defaultValueInteger64\",\n                \"defaultValueMarkdown\",\n                \"defaultValueMeta\",\n                \"defaultValueMoney\",\n                \"defaultValueOid\",\n                \"defaultValueParameterDefinition\",\n                \"defaultValuePeriod\",\n                \"defaultValuePositiveInt\",\n                \"defaultValueQuantity\",\n                \"defaultValueRange\",\n                \"defaultValueRatio\",\n                \"defaultValueRatioRange\",\n                \"defaultValueReference\",\n                \"defaultValueRelatedArtifact\",\n                \"defaultValueSampledData\",\n                \"defaultValueSignature\",\n                \"defaultValueString\",\n                \"defaultValueTime\",\n                \"defaultValueTiming\",\n                \"defaultValueTriggerDefinition\",\n                \"defaultValueUnsignedInt\",\n                \"defaultValueUri\",\n                \"defaultValueUrl\",\n                \"defaultValueUsageContext\",\n                \"defaultValueUuid\",\n            ],\n            \"fixed\": [\n                \"fixedAddress\",\n                \"fixedAge\",\n                \"fixedAnnotation\",\n                \"fixedAttachment\",\n                \"fixedAvailability\",\n                \"fixedBase64Binary\",\n                \"fixedBoolean\",\n                \"fixedCanonical\",\n                \"fixedCode\",\n                \"fixedCodeableConcept\",\n                \"fixedCodeableReference\",\n                \"fixedCoding\",\n                \"fixedContactDetail\",\n                \"fixedContactPoint\",\n                \"fixedCount\",\n                \"fixedDataRequirement\",\n                \"fixedDate\",\n                \"fixedDateTime\",\n                \"fixedDecimal\",\n                \"fixedDistance\",\n                \"fixedDosage\",\n                \"fixedDuration\",\n                \"fixedExpression\",\n                \"fixedExtendedContactDetail\",\n                \"fixedHumanName\",\n                \"fixedId\",\n                \"fixedIdentifier\",\n                \"fixedInstant\",\n                \"fixedInteger\",\n                \"fixedInteger64\",\n                \"fixedMarkdown\",\n                \"fixedMeta\",\n                \"fixedMoney\",\n                \"fixedOid\",\n                \"fixedParameterDefinition\",\n                \"fixedPeriod\",\n                \"fixedPositiveInt\",\n                \"fixedQuantity\",\n                \"fixedRange\",\n                \"fixedRatio\",\n                \"fixedRatioRange\",\n                \"fixedReference\",\n                \"fixedRelatedArtifact\",\n                \"fixedSampledData\",\n                \"fixedSignature\",\n                \"fixedString\",\n                \"fixedTime\",\n                \"fixedTiming\",\n                \"fixedTriggerDefinition\",\n                \"fixedUnsignedInt\",\n                \"fixedUri\",\n                \"fixedUrl\",\n                \"fixedUsageContext\",\n                \"fixedUuid\",\n            ],\n            \"maxValue\": [\n                \"maxValueDate\",\n                \"maxValueDateTime\",\n                \"maxValueDecimal\",\n                \"maxValueInstant\",\n                \"maxValueInteger\",\n                \"maxValueInteger64\",\n                \"maxValuePositiveInt\",\n                \"maxValueQuantity\",\n                \"maxValueTime\",\n                \"maxValueUnsignedInt\",\n            ],\n            \"minValue\": [\n                \"minValueDate\",\n                \"minValueDateTime\",\n                \"minValueDecimal\",\n                \"minValueInstant\",\n                \"minValueInteger\",\n                \"minValueInteger64\",\n                \"minValuePositiveInt\",\n                \"minValueQuantity\",\n                \"minValueTime\",\n                \"minValueUnsignedInt\",\n            ],\n            \"pattern\": [\n                \"patternAddress\",\n                \"patternAge\",\n                \"patternAnnotation\",\n                \"patternAttachment\",\n                \"patternAvailability\",\n                \"patternBase64Binary\",\n                \"patternBoolean\",\n                \"patternCanonical\",\n                \"patternCode\",\n                \"patternCodeableConcept\",\n                \"patternCodeableReference\",\n                \"patternCoding\",\n                \"patternContactDetail\",\n                \"patternContactPoint\",\n                \"patternCount\",\n                \"patternDataRequirement\",\n                \"patternDate\",\n                \"patternDateTime\",\n                \"patternDecimal\",\n                \"patternDistance\",\n                \"patternDosage\",\n                \"patternDuration\",\n                \"patternExpression\",\n                \"patternExtendedContactDetail\",\n                \"patternHumanName\",\n                \"patternId\",\n                \"patternIdentifier\",\n                \"patternInstant\",\n                \"patternInteger\",\n                \"patternInteger64\",\n                \"patternMarkdown\",\n                \"patternMeta\",\n                \"patternMoney\",\n                \"patternOid\",\n                \"patternParameterDefinition\",\n                \"patternPeriod\",\n                \"patternPositiveInt\",\n                \"patternQuantity\",\n                \"patternRange\",\n                \"patternRatio\",\n                \"patternRatioRange\",\n                \"patternReference\",\n                \"patternRelatedArtifact\",\n                \"patternSampledData\",\n                \"patternSignature\",\n                \"patternString\",\n                \"patternTime\",\n                \"patternTiming\",\n                \"patternTriggerDefinition\",\n                \"patternUnsignedInt\",\n                \"patternUri\",\n                \"patternUrl\",\n                \"patternUsageContext\",\n                \"patternUuid\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ElementDefinitionBase(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base definition information for tools.\n    Information about the base definition of the element, provided to make it\n    unnecessary for tools to trace the deviation of the element through the\n    derived and related profiles. When the element definition is not the\n    original definition of an element - e.g. either in a constraint on another\n    type, or for elements from a super type in a snap shot - then the\n    information in provided in the element definition may be different to the\n    base definition. On the original definition of the element, it will be\n    same.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionBase\"\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Max cardinality of the base element\",\n        description=\"Maximum cardinality of the base element identified by the path.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Min cardinality of the base element\",\n        description=\"Minimum cardinality of the base element identified by the path.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path that identifies the base element\",\n        description=(\n            \"The Path that identifies the base element - this matches the \"\n            \"ElementDefinition.path for that element. Across FHIR, there is only \"\n            \"one base definition of any element - that is, an element definition on\"\n            \" a [StructureDefinition](structuredefinition.html#) without a \"\n            \"StructureDefinition.base.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionBase`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"path\", \"min\", \"max\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionBase`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"path\", \"min\", \"max\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"max\", \"max__ext\"),\n            (\"min\", \"min__ext\"),\n            (\"path\", \"path__ext\"),\n        ]\n        return required_fields\n\n\nclass ElementDefinitionBinding(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    ValueSet details if this is coded.\n    Binds to a value set if this element is coded (code, Coding,\n    CodeableConcept, Quantity), or the data types (string, uri).\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionBinding\"\n\n    additional: typing.List[\n        fhirtypes.ElementDefinitionBindingAdditionalType\n    ] | None = Field(\n        default=None,\n        alias=\"additional\",\n        title=\"Additional Bindings - more rules about the binding\",\n        description=(\n            \"Additional bindings that help applications implementing this element. \"\n            \"Additional bindings do not replace the main binding but provide more \"\n            \"information and/or context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Intended use of codes in the bound value set\",\n        description=\"Describes the intended use of this particular set of codes.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    strength: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"strength\",\n        title=\"required | extensible | preferred | example\",\n        description=(\n            \"Indicates the degree of conformance expectations associated with this \"\n            \"binding - that is, the degree to which the provided value set must be \"\n            \"adhered to in the instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"required\", \"extensible\", \"preferred\", \"example\"],\n        },\n    )\n    strength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_strength\", title=\"Extension field for ``strength``.\"\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Source of value set\",\n        description=(\n            \"Refers to the value set that identifies the set of codes the binding \"\n            \"refers to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionBinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"strength\", \"description\", \"valueSet\", \"additional\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionBinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"strength\", \"description\", \"valueSet\", \"additional\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"strength\", \"strength__ext\")]\n        return required_fields\n\n\nclass ElementDefinitionBindingAdditional(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional Bindings - more rules about the binding.\n    Additional bindings that help applications implementing this element.\n    Additional bindings do not replace the main binding but provide more\n    information and/or context.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionBindingAdditional\"\n\n    any: bool | None = Field(\n        default=None,\n        alias=\"any\",\n        title=\"Whether binding can applies to all repeats, or just one\",\n        description=(\n            \"Whether the binding applies to all repeats, or just to any one of \"\n            \"them. This is only relevant for elements that can repeat.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    any__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_any\", title=\"Extension field for ``any``.\"\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Documentation of the purpose of use of the binding\",\n        description=(\n            \"Documentation of the purpose of use of the bindingproviding additional\"\n            \" information about how it is intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    purpose: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=(\n            \"maximum | minimum | required | extensible | candidate | current | \"\n            \"preferred | ui | starter | component\"\n        ),\n        description=\"The use of this additional binding.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"maximum\",\n                \"minimum\",\n                \"required\",\n                \"extensible\",\n                \"candidate\",\n                \"current\",\n                \"preferred\",\n                \"ui\",\n                \"starter\",\n                \"component\",\n            ],\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    shortDoco: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"shortDoco\",\n        title=\"Concise documentation - for summary tables\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    shortDoco__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_shortDoco\", title=\"Extension field for ``shortDoco``.\"\n    )\n\n    usage: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Qualifies the usage - jurisdiction, gender, workflow status etc.\",\n        description=(\n            \"Qualifies the usage of the binding. Typically bindings are qualified \"\n            \"by jurisdiction, but they may also be qualified by gender, workflow \"\n            \"status, clinical domain etc. The information to decide whether a usege\"\n            \" context applies is usually outside the resource, determined by \"\n            \"context, and this might present challenges for validation tooling.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"The value set for the additional binding\",\n        description=\"The valueSet that is being bound for the purpose.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionBindingAdditional`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"purpose\",\n            \"valueSet\",\n            \"documentation\",\n            \"shortDoco\",\n            \"usage\",\n            \"any\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionBindingAdditional`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"purpose\", \"valueSet\", \"documentation\", \"shortDoco\", \"usage\", \"any\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"purpose\", \"purpose__ext\"), (\"valueSet\", \"valueSet__ext\")]\n        return required_fields\n\n\nclass ElementDefinitionConstraint(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Condition that must evaluate to true.\n    Formal constraints such as co-occurrence and other constraints that can be\n    computationally evaluated within the context of the instance.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionConstraint\"\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"FHIRPath expression of constraint\",\n        description=(\n            \"A [FHIRPath](fhirpath.html) expression of constraint that can be \"\n            \"executed to see if this constraint is met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    human: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"human\",\n        title=\"Human description of constraint\",\n        description=(\n            \"Text that can be used to describe the constraint in messages \"\n            \"identifying that the constraint has been violated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    human__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_human\", title=\"Extension field for ``human``.\"\n    )\n\n    key: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"key\",\n        title=\"Target of 'condition' reference above\",\n        description=(\n            \"Allows identification of which elements have their cardinalities \"\n            \"impacted by the constraint.  Will not be referenced for constraints \"\n            \"that do not affect cardinality.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_key\", title=\"Extension field for ``key``.\"\n    )\n\n    requirements: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"requirements\",\n        title=\"Why this constraint is necessary or appropriate\",\n        description=\"Description of why this constraint is necessary or appropriate.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    requirements__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requirements\",\n        title=\"Extension field for ``requirements``.\",\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"error | warning\",\n        description=(\n            \"Identifies the impact constraint violation has on the conformance of \"\n            \"the instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"error\", \"warning\"],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    source: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Reference to original source of constraint\",\n        description=(\n            \"A reference to the original source of the constraint, for traceability\"\n            \" purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    suppress: bool | None = Field(\n        default=None,\n        alias=\"suppress\",\n        title=\"Suppress warning or hint in profile\",\n        description=(\n            \"If true, indicates that the warning or best practice guideline should \"\n            \"be suppressed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    suppress__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_suppress\", title=\"Extension field for ``suppress``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionConstraint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"key\",\n            \"requirements\",\n            \"severity\",\n            \"suppress\",\n            \"human\",\n            \"expression\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionConstraint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"key\",\n            \"requirements\",\n            \"severity\",\n            \"suppress\",\n            \"human\",\n            \"expression\",\n            \"source\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"human\", \"human__ext\"),\n            (\"key\", \"key__ext\"),\n            (\"severity\", \"severity__ext\"),\n        ]\n        return required_fields\n\n\nclass ElementDefinitionExample(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Example value (as defined for type).\n    A sample value for this element demonstrating the type of information that\n    would typically be found in the element.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionExample\"\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Describes the purpose of this example\",\n        description=\"Describes the purpose of this example among the set of examples.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAvailability: fhirtypes.AvailabilityType | None = Field(\n        default=None,\n        alias=\"valueAvailability\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueCanonical\",\n        title=\"Extension field for ``valueCanonical``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"valueCodeableReference\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"valueContactDetail\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"valueDataRequirement\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"valueDosage\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"valueExpression\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field(\n        default=None,\n        alias=\"valueExtendedContactDetail\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueInteger64: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"valueInteger64\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger64\",\n        title=\"Extension field for ``valueInteger64``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"valueParameterDefinition\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"valueRatioRange\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"valueRelatedArtifact\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"valueTriggerDefinition\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUrl\", title=\"Extension field for ``valueUrl``.\"\n    )\n\n    valueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"valueUsageContext\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"valueUuid\",\n        title=\"Value of Example (one of allowed types)\",\n        description=(\n            \"The actual value for the element, which must be one of the types \"\n            \"allowed for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUuid\", title=\"Extension field for ``valueUuid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionExample`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"label\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueInteger64\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCodeableReference\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueRatioRange\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueAvailability\",\n            \"valueExtendedContactDetail\",\n            \"valueDosage\",\n            \"valueMeta\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionExample`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"label\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueInteger64\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCodeableReference\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueRatioRange\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueAvailability\",\n            \"valueExtendedContactDetail\",\n            \"valueDosage\",\n            \"valueMeta\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"label\", \"label__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueAvailability\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCanonical\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCodeableReference\",\n                \"valueCoding\",\n                \"valueContactDetail\",\n                \"valueContactPoint\",\n                \"valueCount\",\n                \"valueDataRequirement\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDosage\",\n                \"valueDuration\",\n                \"valueExpression\",\n                \"valueExtendedContactDetail\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueInteger64\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valueParameterDefinition\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueRatioRange\",\n                \"valueReference\",\n                \"valueRelatedArtifact\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueTriggerDefinition\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n                \"valueUrl\",\n                \"valueUsageContext\",\n                \"valueUuid\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ElementDefinitionMapping(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Map element to another set of definitions.\n    Identifies a concept from an external specification that roughly\n    corresponds to this element.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionMapping\"\n\n    comment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments about the mapping or its use\",\n        description=\"Comments that provide information about the mapping or its use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    identity: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"identity\",\n        title=\"Reference to mapping declaration\",\n        description=\"An internal reference to the definition of a mapping.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_identity\", title=\"Extension field for ``identity``.\"\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Computable language of mapping\",\n        description=\"Identifies the computable language in which mapping.map is expressed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    map: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"map\",\n        title=\"Details of the mapping\",\n        description=(\n            \"Expresses what part of the target specification corresponds to this \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    map__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_map\", title=\"Extension field for ``map``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"identity\", \"language\", \"map\", \"comment\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"identity\", \"language\", \"map\", \"comment\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"identity\", \"identity__ext\"), (\"map\", \"map__ext\")]\n        return required_fields\n\n\nclass ElementDefinitionSlicing(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    This element is sliced - slices follow.\n    Indicates that the element is sliced into a set of alternative definitions\n    (i.e. in a structure definition, there are multiple different constraints\n    on a single element in the base resource). Slicing can be used in any\n    resource that has cardinality ..* on the base resource, or any resource\n    with a choice of types. The set of slices is any elements that come after\n    this in the element sequence that have the same path, until a shorter path\n    occurs (the shorter path terminates the set).\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionSlicing\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Text description of how slicing works (or not)\",\n        description=(\n            \"A human-readable text description of how the slicing works. If there \"\n            \"is no discriminator, this is required to be present to provide \"\n            \"whatever information is possible about how the slices can be \"\n            \"differentiated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    discriminator: typing.List[\n        fhirtypes.ElementDefinitionSlicingDiscriminatorType\n    ] | None = Field(\n        default=None,\n        alias=\"discriminator\",\n        title=\"Element values that are used to distinguish the slices\",\n        description=(\n            \"Designates which child elements are used to discriminate between the \"\n            \"slices when processing an instance. If one or more discriminators are \"\n            \"provided, the value of the child elements in the instance data SHALL \"\n            \"completely distinguish which slice the element in the resource matches\"\n            \" based on the allowed values for those elements in each of the slices.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ordered: bool | None = Field(\n        default=None,\n        alias=\"ordered\",\n        title=\"If elements must be in same order as slices\",\n        description=(\n            \"If the matching elements have to occur in the same order as defined in\"\n            \" the profile.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    ordered__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ordered\", title=\"Extension field for ``ordered``.\"\n    )\n\n    rules: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"rules\",\n        title=\"closed | open | openAtEnd\",\n        description=(\n            \"Whether additional slices are allowed or not. When the slices are \"\n            \"ordered, profile authors can also say that additional slices are only \"\n            \"allowed at the end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"closed\", \"open\", \"openAtEnd\"],\n        },\n    )\n    rules__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rules\", title=\"Extension field for ``rules``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionSlicing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"discriminator\", \"description\", \"ordered\", \"rules\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionSlicing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"discriminator\", \"description\", \"ordered\", \"rules\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"rules\", \"rules__ext\")]\n        return required_fields\n\n\nclass ElementDefinitionSlicingDiscriminator(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Element values that are used to distinguish the slices.\n    Designates which child elements are used to discriminate between the slices\n    when processing an instance. If one or more discriminators are provided,\n    the value of the child elements in the instance data SHALL completely\n    distinguish which slice the element in the resource matches based on the\n    allowed values for those elements in each of the slices.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionSlicingDiscriminator\"\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path to element value\",\n        description=(\n            \"A FHIRPath expression, using [the simple subset of \"\n            \"FHIRPath](fhirpath.html#simple), that is used to identify the element \"\n            \"on which discrimination is based.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"value | exists | type | profile | position\",\n        description=\"How the element value is interpreted when discrimination is evaluated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"value\", \"exists\", \"type\", \"profile\", \"position\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionSlicingDiscriminator`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"type\", \"path\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionSlicingDiscriminator`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"type\", \"path\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"path\", \"path__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass ElementDefinitionType(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Data type and Profile for this element.\n    The data type or resource that the value of this element is permitted to\n    be.\n    \"\"\"\n\n    __resource_type__ = \"ElementDefinitionType\"\n\n    aggregation: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"aggregation\",\n        title=\"contained | referenced | bundled - how aggregated\",\n        description=(\n            \"If the type is a reference to another resource, how the resource is or\"\n            \" can be aggregated - is it a contained resource, or a reference, and \"\n            \"if the context is a bundle, is it included in the bundle.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"contained\", \"referenced\", \"bundled\"],\n        },\n    )\n    aggregation__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_aggregation\", title=\"Extension field for ``aggregation``.\"\n    )\n\n    code: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Data type or Resource (reference to definition)\",\n        description=(\n            \"URL of Data type or Resource that is a(or the) type used for this \"\n            \"element. References are URLs that are relative to \"\n            'http://hl7.org/fhir/StructureDefinition e.g. \"string\" is a reference '\n            \"to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are \"\n            \"only allowed in logical models.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    profile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profiles (StructureDefinition or IG) - one must apply\",\n        description=(\n            \"Identifies a profile structure or implementation Guide that applies to\"\n            \" the datatype this element refers to. If any profiles are specified, \"\n            \"then the content must conform to at least one of them. The URL can be \"\n            \"a local reference - to a contained StructureDefinition, or a reference\"\n            \" to another StructureDefinition or Implementation Guide by a canonical\"\n            \" URL. When an implementation guide is specified, the type SHALL \"\n            \"conform to at least one profile defined in the implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\", \"ImplementationGuide\"],\n        },\n    )\n    profile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    targetProfile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"targetProfile\",\n        title=(\n            \"Profile (StructureDefinition or IG) on the Reference/canonical target \"\n            \"- one must apply\"\n        ),\n        description=(\n            'Used when the type is \"Reference\" or \"canonical\", and identifies a '\n            \"profile structure or implementation Guide that applies to the target \"\n            \"of the reference this element refers to. If any profiles are \"\n            \"specified, then the content must conform to at least one of them. The \"\n            \"URL can be a local reference - to a contained StructureDefinition, or \"\n            \"a reference to another StructureDefinition or Implementation Guide by \"\n            \"a canonical URL. When an implementation guide is specified, the target\"\n            \" resource SHALL conform to at least one profile defined in the \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\", \"ImplementationGuide\"],\n        },\n    )\n    targetProfile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_targetProfile\",\n        title=\"Extension field for ``targetProfile``.\",\n    )\n\n    versioning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"versioning\",\n        title=\"either | independent | specific\",\n        description=(\n            \"Whether this reference needs to be version specific or version \"\n            \"independent, or whether either can be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"either\", \"independent\", \"specific\"],\n        },\n    )\n    versioning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_versioning\", title=\"Extension field for ``versioning``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ElementDefinitionType`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"code\",\n            \"profile\",\n            \"targetProfile\",\n            \"aggregation\",\n            \"versioning\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ElementDefinitionType`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"code\", \"profile\", \"targetProfile\", \"aggregation\", \"versioning\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/encounter.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Encounter\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Encounter(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An interaction during which services are provided to the patient.\n    An interaction between a patient and healthcare provider(s) for the purpose\n    of providing healthcare service(s) or assessing the health status of a\n    patient.  Encounter is primarily used to record information about the\n    actual activities that occurred, where Appointment is used to record\n    planned activities.\n    \"\"\"\n\n    __resource_type__ = \"Encounter\"\n\n    account: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"account\",\n        title=\"The set of accounts that may be used for billing for this Encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    actualPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"actualPeriod\",\n        title=\"The actual start and end time of the encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    admission: fhirtypes.EncounterAdmissionType | None = Field(\n        default=None,\n        alias=\"admission\",\n        title=\"Details about the admission to a healthcare service\",\n        description=(\n            \"Details about the stay during which a healthcare service is provided.\"\n            \"  This does not describe the event of admitting the patient, but \"\n            \"rather any information that is relevant from the time of admittance \"\n            \"until the time of discharge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    appointment: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"appointment\",\n        title=\"The appointment that scheduled this encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Appointment\"],\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"The request that initiated this encounter\",\n        description=(\n            \"The request this encounter satisfies (e.g. incoming referral or \"\n            \"procedure request).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"ServiceRequest\",\n            ],\n        },\n    )\n\n    careTeam: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"careTeam\",\n        title=\"The group(s) that are allocated to participate in this encounter\",\n        description=(\n            \"The group(s) of individuals, organizations that are allocated to \"\n            \"participate in this encounter. The participants backbone will record \"\n            \"the actuals of when these individuals participated during the \"\n            \"encounter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CareTeam\"],\n        },\n    )\n\n    class_fhir: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"class\",\n        title=(\n            \"Classification of patient encounter context - e.g. Inpatient, \"\n            \"outpatient\"\n        ),\n        description=(\n            \"Concepts representing classification of patient encounter such as \"\n            \"ambulatory (outpatient), inpatient, emergency, home health or others \"\n            \"due to local variations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    diagnosis: typing.List[fhirtypes.EncounterDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"The list of diagnosis relevant to this encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dietPreference: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"dietPreference\",\n        title=\"Diet preferences reported by the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    episodeOfCare: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"episodeOfCare\",\n        title=\"Episode(s) of care that this encounter should be recorded against\",\n        description=(\n            \"Where a specific encounter should be classified as a part of a \"\n            \"specific episode(s) of care this field should be used. This \"\n            \"association can facilitate grouping of related encounters together for\"\n            \" a specific purpose, such as government reporting, issue tracking, \"\n            \"association via a common problem.  The association is recorded on the \"\n            \"encounter as these are typically created after the episode of care and\"\n            \" grouped on entry rather than editing the episode of care to append \"\n            \"another encounter to it (the episode of care could span years).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EpisodeOfCare\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier(s) by which this encounter is known\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    length: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"length\",\n        title=\"Actual quantity of time the encounter lasted (less time absent)\",\n        description=(\n            \"Actual quantity of time the encounter lasted. This excludes the time \"\n            \"during leaves of absence.  When missing it is the time in between the \"\n            \"start and end values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.EncounterLocationType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"List of locations where the patient has been\",\n        description=\"List of locations where  the patient has been during this encounter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Another Encounter this encounter is part of\",\n        description=(\n            \"Another Encounter of which this encounter is a part of \"\n            \"(administratively or in time).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    participant: typing.List[fhirtypes.EncounterParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"List of participants involved in the encounter\",\n        description=\"The list of people responsible for providing the service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    plannedEndDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"plannedEndDate\",\n        title=\"The planned end date/time (or discharge date) of the encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    plannedEndDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_plannedEndDate\",\n        title=\"Extension field for ``plannedEndDate``.\",\n    )\n\n    plannedStartDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"plannedStartDate\",\n        title=\"The planned start date/time (or admission date) of the encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    plannedStartDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_plannedStartDate\",\n        title=\"Extension field for ``plannedStartDate``.\",\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Indicates the urgency of the encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.EncounterReasonType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=(\n            \"The list of medical reasons that are expected to be addressed during \"\n            \"the episode of care\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceProvider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"serviceProvider\",\n        title=\"The organization (facility) responsible for this encounter\",\n        description=(\n            \"The organization that is primarily responsible for this Encounter's \"\n            \"services. This MAY be the same as the organization on the Patient \"\n            \"record, however it could be different, such as if the actor performing\"\n            \" the services was from an external organization (which may be billed \"\n            \"seperately) for an external consultation.  Refer to the colonoscopy \"\n            \"example on the Encounter examples tab.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    serviceType: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"serviceType\",\n        title=\"Specific type of service\",\n        description=(\n            \"Broad categorization of the service that is to be provided (e.g. \"\n            \"cardiology).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"HealthcareService\"],\n        },\n    )\n\n    specialArrangement: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialArrangement\",\n        title=\"Wheelchair, translator, stretcher, etc\",\n        description=(\n            \"Any special requests that have been made for this encounter, such as \"\n            \"the provision of specific equipment or other things.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specialCourtesy: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialCourtesy\",\n        title=\"Special courtesies (VIP, board member)\",\n        description=(\n            \"Special courtesies that may be provided to the patient during the \"\n            \"encounter (VIP, board member, professional courtesy).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | in-progress | on-hold | discharged | completed | cancelled |\"\n            \" discontinued | entered-in-error | unknown\"\n        ),\n        description=(\n            \"The current state of the encounter (not the state of the patient \"\n            \"within the encounter - that is subjectState).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"in-progress\",\n                \"on-hold\",\n                \"discharged\",\n                \"completed\",\n                \"cancelled\",\n                \"discontinued\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The patient or group related to this encounter\",\n        description=(\n            \"The patient or group related to this encounter. In some use-cases the \"\n            \"patient MAY not be present, such as a case meeting about a patient \"\n            \"between several practitioners or a careteam.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    subjectStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectStatus\",\n        title=\"The current status of the subject in relation to the Encounter\",\n        description=(\n            \"The subjectStatus value can be used to track the patient's status \"\n            \"within the encounter. It details whether the patient has arrived or \"\n            \"departed, has been triaged or is currently in a waiting status.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Specific type of encounter (e.g. e-mail consultation, surgical day-\"\n            \"care, ...)\"\n        ),\n        description=(\n            \"Specific type of encounter (e.g. e-mail consultation, surgical day-\"\n            \"care, skilled nursing, rehabilitation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    virtualService: typing.List[fhirtypes.VirtualServiceDetailType] | None = Field(\n        default=None,\n        alias=\"virtualService\",\n        title=\"Connection details of a virtual service (e.g. conference call)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Encounter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"class\",\n            \"priority\",\n            \"type\",\n            \"serviceType\",\n            \"subject\",\n            \"subjectStatus\",\n            \"episodeOfCare\",\n            \"basedOn\",\n            \"careTeam\",\n            \"partOf\",\n            \"serviceProvider\",\n            \"participant\",\n            \"appointment\",\n            \"virtualService\",\n            \"actualPeriod\",\n            \"plannedStartDate\",\n            \"plannedEndDate\",\n            \"length\",\n            \"reason\",\n            \"diagnosis\",\n            \"account\",\n            \"dietPreference\",\n            \"specialArrangement\",\n            \"specialCourtesy\",\n            \"admission\",\n            \"location\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Encounter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"class\",\n            \"type\",\n            \"serviceType\",\n            \"subject\",\n            \"episodeOfCare\",\n            \"participant\",\n            \"appointment\",\n            \"reason\",\n            \"diagnosis\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass EncounterAdmission(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details about the admission to a healthcare service.\n    Details about the stay during which a healthcare service is provided.\n\n    This does not describe the event of admitting the patient, but rather any\n    information that is relevant from the time of admittance until the time of\n    discharge.\n    \"\"\"\n\n    __resource_type__ = \"EncounterAdmission\"\n\n    admitSource: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"admitSource\",\n        title=\"From where patient was admitted (physician referral, transfer)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    destination: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Location/organization to which the patient is discharged\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\", \"Organization\"],\n        },\n    )\n\n    dischargeDisposition: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"dischargeDisposition\",\n        title=\"Category or kind of location after discharge\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    origin: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"origin\",\n        title=\"The location/organization from which the patient came before admission\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\", \"Organization\"],\n        },\n    )\n\n    preAdmissionIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"preAdmissionIdentifier\",\n        title=\"Pre-admission identifier\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reAdmission: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reAdmission\",\n        title=\"Indicates that the patient is being re-admitted\",\n        description=(\n            \"Indicates that this encounter is directly related to a prior \"\n            \"admission, often because the conditions addressed in the prior \"\n            \"admission were not fully addressed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterAdmission`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"preAdmissionIdentifier\",\n            \"origin\",\n            \"admitSource\",\n            \"reAdmission\",\n            \"destination\",\n            \"dischargeDisposition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterAdmission`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EncounterDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The list of diagnosis relevant to this encounter.\n    \"\"\"\n\n    __resource_type__ = \"EncounterDiagnosis\"\n\n    condition: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"The diagnosis relevant to the encounter\",\n        description=(\n            \"The coded diagnosis or a reference to a Condition (with other \"\n            \"resources referenced in the evidence.detail), the use property will \"\n            \"indicate the purpose of this specific diagnosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    use: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"use\",\n        title=(\n            \"Role that this diagnosis has within the encounter (e.g. admission, \"\n            \"billing, discharge \\u2026)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"condition\", \"use\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"condition\"]\n\n\nclass EncounterLocation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of locations where the patient has been.\n    List of locations where  the patient has been during this encounter.\n    \"\"\"\n\n    __resource_type__ = \"EncounterLocation\"\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=(\n            \"The physical type of the location (usually the level in the location \"\n            \"hierarchy - bed, room, ward, virtual etc.)\"\n        ),\n        description=(\n            \"This will be used to specify the required levels (bed/ward/room/etc.) \"\n            \"desired to be recorded to simplify either messaging or query.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"location\",\n        title=\"Location the encounter takes place\",\n        description=\"The location where the encounter takes place.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period during which the patient was present at the location\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"planned | active | reserved | completed\",\n        description=(\n            \"The status of the participants' presence at the specified location \"\n            \"during the period specified. If the participant is no longer at the \"\n            \"location, then the period will have an end date/time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"planned\", \"active\", \"reserved\", \"completed\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterLocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"location\",\n            \"status\",\n            \"form\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterLocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EncounterParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of participants involved in the encounter.\n    The list of people responsible for providing the service.\n    \"\"\"\n\n    __resource_type__ = \"EncounterParticipant\"\n\n    actor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"The individual, device, or service participating in the encounter\",\n        description=(\n            \"Person involved in the encounter, the patient/group is also included \"\n            \"here to indicate that the patient was actually participating in the \"\n            \"encounter. Not including the patient here covers use cases such as a \"\n            \"case meeting between practitioners about a patient - non contact \"\n            \"times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period of time during the encounter that the participant participated\",\n        description=(\n            \"The period of time that the specified participant participated in the \"\n            \"encounter. These can overlap or be sub-sets of the overall encounter's\"\n            \" period.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Role of participant in encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"period\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"actor\"]\n\n\nclass EncounterReason(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The list of medical reasons that are expected to be addressed during the\n    episode of care.\n    \"\"\"\n\n    __resource_type__ = \"EncounterReason\"\n\n    use: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"What the reason value should be used for/as\",\n        description=(\n            \"What the reason value should be used as e.g. Chief Complaint, Health \"\n            \"Concern, Health Maintenance (including screening).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    value: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Reason the encounter takes place (core or reference)\",\n        description=(\n            \"Reason the encounter takes place, expressed as a code or a reference \"\n            \"to another resource. For admissions, this can be used for a coded \"\n            \"admission diagnosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"DiagnosticReport\",\n                \"Observation\",\n                \"ImmunizationRecommendation\",\n                \"Procedure\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterReason`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"use\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterReason`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"use\", \"value\"]\n"
  },
  {
    "path": "fhir/resources/encounterhistory.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EncounterHistory\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass EncounterHistory(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A record of significant events/milestones key data throughout the history\n    of an Encounter.\n    A record of significant events/milestones key data throughout the history\n    of an Encounter, often tracked for specific purposes such as billing.\n    \"\"\"\n\n    __resource_type__ = \"EncounterHistory\"\n\n    actualPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"actualPeriod\",\n        title=(\n            \"The actual start and end time associated with this set of values \"\n            \"associated with the encounter\"\n        ),\n        description=(\n            \"The start and end time associated with this set of values associated \"\n            \"with the encounter, may be different to the planned times for various \"\n            \"reasons.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    class_fhir: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"class\",\n        title=\"Classification of patient encounter\",\n        description=(\n            \"Concepts representing classification of patient encounter such as \"\n            \"ambulatory (outpatient), inpatient, emergency, home health or others \"\n            \"due to local variations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"The Encounter associated with this set of historic values\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier(s) by which this encounter is known\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    length: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"length\",\n        title=\"Actual quantity of time the encounter lasted (less time absent)\",\n        description=(\n            \"Actual quantity of time the encounter lasted. This excludes the time \"\n            \"during leaves of absence.  When missing it is the time in between the \"\n            \"start and end values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.EncounterHistoryLocationType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Location of the patient at this point in the encounter\",\n        description=(\n            \"The location of the patient at this point in the encounter, the \"\n            \"multiple cardinality permits de-normalizing the levels of the location\"\n            \" hierarchy, such as site/ward/room/bed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    plannedEndDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"plannedEndDate\",\n        title=\"The planned end date/time (or discharge date) of the encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    plannedEndDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_plannedEndDate\",\n        title=\"Extension field for ``plannedEndDate``.\",\n    )\n\n    plannedStartDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"plannedStartDate\",\n        title=\"The planned start date/time (or admission date) of the encounter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    plannedStartDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_plannedStartDate\",\n        title=\"Extension field for ``plannedStartDate``.\",\n    )\n\n    serviceType: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"serviceType\",\n        title=\"Specific type of service\",\n        description=(\n            \"Broad categorization of the service that is to be provided (e.g. \"\n            \"cardiology).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"HealthcareService\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | in-progress | on-hold | discharged | completed | cancelled |\"\n            \" discontinued | entered-in-error | unknown\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"in-progress\",\n                \"on-hold\",\n                \"discharged\",\n                \"completed\",\n                \"cancelled\",\n                \"discontinued\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The patient or group related to this encounter\",\n        description=(\n            \"The patient or group related to this encounter. In some use-cases the \"\n            \"patient MAY not be present, such as a case meeting about a patient \"\n            \"between several practitioners or a careteam.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    subjectStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectStatus\",\n        title=\"The current status of the subject in relation to the Encounter\",\n        description=(\n            \"The subjectStatus value can be used to track the patient's status \"\n            \"within the encounter. It details whether the patient has arrived or \"\n            \"departed, has been triaged or is currently in a waiting status.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Specific type of encounter\",\n        description=(\n            \"Specific type of encounter (e.g. e-mail consultation, surgical day-\"\n            \"care, skilled nursing, rehabilitation).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"encounter\",\n            \"identifier\",\n            \"status\",\n            \"class\",\n            \"type\",\n            \"serviceType\",\n            \"subject\",\n            \"subjectStatus\",\n            \"actualPeriod\",\n            \"plannedStartDate\",\n            \"plannedEndDate\",\n            \"length\",\n            \"location\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"class\",\n            \"type\",\n            \"serviceType\",\n            \"subject\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass EncounterHistoryLocation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Location of the patient at this point in the encounter.\n    The location of the patient at this point in the encounter, the multiple\n    cardinality permits de-normalizing the levels of the location hierarchy,\n    such as site/ward/room/bed.\n    \"\"\"\n\n    __resource_type__ = \"EncounterHistoryLocation\"\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=(\n            \"The physical type of the location (usually the level in the location \"\n            \"hierarchy - bed, room, ward, virtual etc.)\"\n        ),\n        description=(\n            \"This will be used to specify the required levels (bed/ward/room/etc.) \"\n            \"desired to be recorded to simplify either messaging or query.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"location\",\n        title=\"Location the encounter takes place\",\n        description=\"The location where the encounter takes place.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EncounterHistoryLocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"location\", \"form\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EncounterHistoryLocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/endpoint.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Endpoint\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Endpoint(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The technical details of an endpoint that can be used for electronic\n    services.\n    The technical details of an endpoint that can be used for electronic\n    services, such as for web services providing XDS.b, a REST endpoint for\n    another FHIR server, or a s/Mime email address. This may include any\n    security context information.\n    \"\"\"\n\n    __resource_type__ = \"Endpoint\"\n\n    address: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"The technical base address for connecting to this endpoint\",\n        description=\"The uri that describes the actual end-point to connect to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    address__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_address\", title=\"Extension field for ``address``.\"\n    )\n\n    connectionType: typing.List[fhirtypes.CodeableConceptType] = Field(\n        default=...,\n        alias=\"connectionType\",\n        title=\"Protocol/Profile/Standard to be used with this endpoint connection\",\n        description=(\n            \"A coded value that represents the technical details of the usage of \"\n            \"this endpoint, such as what WSDLs should be used in what way. (e.g. \"\n            \"XDS.b/DICOM/cds-hook).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for source (e.g. troubleshooting)\",\n        description=(\n            \"Contact details for a human to contact about the endpoint. The primary\"\n            \" use of this for system administrator troubleshooting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=(\n            \"Additional details about the endpoint that could be displayed as \"\n            \"further information to identify the description beyond its name\"\n        ),\n        description=(\n            \"The description of the endpoint and what it is for (typically used as \"\n            \"supplemental information in an endpoint directory describing its \"\n            \"usage/purpose).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    environmentType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"environmentType\",\n        title=\"The type of environment(s) exposed at this endpoint\",\n        description=(\n            \"The type of environment(s) exposed at this endpoint (dev, prod, test, \"\n            \"etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    header: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"header\",\n        title=\"Usage depends on the channel type\",\n        description=\"Additional headers / information to send as part of the notification.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    header__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_header\", title=\"Extension field for ``header``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifies this endpoint across multiple systems\",\n        description=(\n            \"Identifier for the organization that is used to identify the endpoint \"\n            \"across multiple disparate systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=(\n            \"Organization that manages this endpoint (might not be the organization\"\n            \" that exposes the endpoint)\"\n        ),\n        description=(\n            \"The organization that manages this endpoint (even if technically \"\n            \"another organization is hosting this in the cloud, it is the \"\n            \"organization associated with the data).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name that this endpoint can be identified by\",\n        description=\"A friendly name that this endpoint can be referred to with.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    payload: typing.List[fhirtypes.EndpointPayloadType] | None = Field(\n        default=None,\n        alias=\"payload\",\n        title=\"Set of payloads that are provided by this endpoint\",\n        description=\"The set of payloads that are provided/available at this endpoint.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Interval the endpoint is expected to be operational\",\n        description=\"The interval during which the endpoint is expected to be operational.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | suspended | error | off | entered-in-error | test\",\n        description=(\n            \"The endpoint status represents the general expected availability of an\"\n            \" endpoint.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"active\",\n                \"suspended\",\n                \"error\",\n                \"off\",\n                \"entered-in-error\",\n                \"test\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Endpoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"connectionType\",\n            \"name\",\n            \"description\",\n            \"environmentType\",\n            \"managingOrganization\",\n            \"contact\",\n            \"period\",\n            \"payload\",\n            \"address\",\n            \"header\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Endpoint`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"connectionType\",\n            \"name\",\n            \"description\",\n            \"environmentType\",\n            \"managingOrganization\",\n            \"period\",\n            \"address\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"address\", \"address__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass EndpointPayload(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Set of payloads that are provided by this endpoint.\n    The set of payloads that are provided/available at this endpoint.\n    \"\"\"\n\n    __resource_type__ = \"EndpointPayload\"\n\n    mimeType: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"mimeType\",\n        title=(\n            \"Mimetype to send. If not specified, the content could be anything \"\n            \"(including no payload, if the connectionType defined this)\"\n        ),\n        description=(\n            \"The mime type to send the payload in - e.g. application/fhir+xml, \"\n            \"application/fhir+json. If the mime type is not specified, then the \"\n            \"sender could send any content (including no content depending on the \"\n            \"connectionType).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    mimeType__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_mimeType\", title=\"Extension field for ``mimeType``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"The type of content that may be used at this endpoint (e.g. XDS \"\n            \"Discharge summaries)\"\n        ),\n        description=(\n            \"The payload type describes the acceptable content that can be \"\n            \"communicated on the endpoint.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EndpointPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"mimeType\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EndpointPayload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"mimeType\"]\n"
  },
  {
    "path": "fhir/resources/enrollmentrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EnrollmentRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass EnrollmentRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Enroll in coverage.\n    This resource provides the insurance enrollment details to the insurer\n    regarding a specified coverage.\n    \"\"\"\n\n    __resource_type__ = \"EnrollmentRequest\"\n\n    candidate: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"candidate\",\n        title=\"The subject to be enrolled\",\n        description=\"Patient Resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    coverage: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=\"Reference to the program or plan identification, underwriter or payor.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The Response business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Target\",\n        description=\"The Insurer who is target  of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EnrollmentRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"created\",\n            \"insurer\",\n            \"provider\",\n            \"candidate\",\n            \"coverage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EnrollmentRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"modifierExtension\", \"status\"]\n"
  },
  {
    "path": "fhir/resources/enrollmentresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EnrollmentResponse\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass EnrollmentResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    EnrollmentResponse resource.\n    This resource provides enrollment and plan details from the processing of\n    an EnrollmentRequest resource.\n    \"\"\"\n\n    __resource_type__ = \"EnrollmentResponse\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=(\n            \"The date when the enclosed suite of services were performed or \"\n            \"completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier\",\n        description=\"The Response business identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Insurer\",\n        description=\"The Insurer who produced this adjudicated response.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"queued | complete | error | partial\",\n        description=\"Processing status: error, complete.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"queued\", \"complete\", \"error\", \"partial\"],\n        },\n    )\n    outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcome\", title=\"Extension field for ``outcome``.\"\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Claim reference\",\n        description=\"Original request resource reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EnrollmentRequest\"],\n        },\n    )\n\n    requestProvider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestProvider\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EnrollmentResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"request\",\n            \"outcome\",\n            \"disposition\",\n            \"created\",\n            \"organization\",\n            \"requestProvider\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EnrollmentResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"modifierExtension\", \"status\"]\n"
  },
  {
    "path": "fhir/resources/episodeofcare.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EpisodeOfCare\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass EpisodeOfCare(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An association of a Patient with an Organization and  Healthcare\n    Provider(s) for a period of time that the Organization assumes some level\n    of responsibility.\n    An association between a patient and an organization / healthcare\n    provider(s) during which time encounters may occur. The managing\n    organization assumes a level of responsibility for the patient during this\n    time.\n    \"\"\"\n\n    __resource_type__ = \"EpisodeOfCare\"\n\n    account: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"account\",\n        title=(\n            \"The set of accounts that may be used for billing for this \" \"EpisodeOfCare\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    careManager: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"careManager\",\n        title=\"Care manager/care coordinator for the patient\",\n        description=(\n            \"The practitioner that is the care manager/care coordinator for this \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    careTeam: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"careTeam\",\n        title=\"Other practitioners facilitating this episode of care\",\n        description=(\n            \"The list of practitioners that may be facilitating this episode of \"\n            \"care for specific purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CareTeam\"],\n        },\n    )\n\n    diagnosis: typing.List[fhirtypes.EpisodeOfCareDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=(\n            \"The list of medical conditions that were addressed during the episode \"\n            \"of care\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier(s) relevant for this EpisodeOfCare\",\n        description=(\n            \"The EpisodeOfCare may be known by different identifiers for different \"\n            \"contexts of use, such as when an external agency is tracking the \"\n            \"Episode for funding purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"Organization that assumes responsibility for care coordination\",\n        description=(\n            \"The organization that has assumed the specific responsibilities for \"\n            \"care coordination, care delivery, or other services for the specified \"\n            \"duration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The patient who is the focus of this episode of care\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Interval during responsibility is assumed\",\n        description=(\n            \"The interval during which the managing organization assumes the \"\n            \"defined responsibility.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.EpisodeOfCareReasonType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=(\n            \"The list of medical reasons that are expected to be addressed during \"\n            \"the episode of care\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    referralRequest: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"referralRequest\",\n        title=\"Originating Referral Request(s)\",\n        description=(\n            \"Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming\"\n            \" referrals.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | waitlist | active | onhold | finished | cancelled | entered-\"\n            \"in-error\"\n        ),\n        description=\"planned | waitlist | active | onhold | finished | cancelled.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"waitlist\",\n                \"active\",\n                \"onhold\",\n                \"finished\",\n                \"cancelled\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusHistory: typing.List[fhirtypes.EpisodeOfCareStatusHistoryType] | None = Field(\n        default=None,\n        alias=\"statusHistory\",\n        title=(\n            \"Past list of status codes (the current status may be included to cover\"\n            \" the start date of the status)\"\n        ),\n        description=(\n            \"The history of statuses that the EpisodeOfCare has been through \"\n            \"(without requiring processing the history of the resource).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type/class  - e.g. specialist referral, disease management\",\n        description=(\n            \"A classification of the type of episode of care; e.g. specialist \"\n            \"referral, disease management, type of funded care.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EpisodeOfCare`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"statusHistory\",\n            \"type\",\n            \"reason\",\n            \"diagnosis\",\n            \"patient\",\n            \"managingOrganization\",\n            \"period\",\n            \"referralRequest\",\n            \"careManager\",\n            \"careTeam\",\n            \"account\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EpisodeOfCare`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"type\",\n            \"reason\",\n            \"diagnosis\",\n            \"patient\",\n            \"managingOrganization\",\n            \"period\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass EpisodeOfCareDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The list of medical conditions that were addressed during the episode of\n    care.\n    \"\"\"\n\n    __resource_type__ = \"EpisodeOfCareDiagnosis\"\n\n    condition: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"The medical condition that was addressed during the episode of care\",\n        description=(\n            \"The medical condition that was addressed during the episode of care, \"\n            \"expressed as a text, code or a reference to another resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    use: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=(\n            \"Role that this diagnosis has within the episode of care (e.g. \"\n            \"admission, billing, discharge \\u2026)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EpisodeOfCareDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"condition\", \"use\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EpisodeOfCareDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"condition\", \"use\"]\n\n\nclass EpisodeOfCareReason(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The list of medical reasons that are expected to be addressed during the\n    episode of care.\n    \"\"\"\n\n    __resource_type__ = \"EpisodeOfCareReason\"\n\n    use: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"What the reason value should be used for/as\",\n        description=(\n            \"What the reason value should be used as e.g. Chief Complaint, Health \"\n            \"Concern, Health Maintenance (including screening).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    value: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Medical reason to be addressed\",\n        description=(\n            \"The medical reason that is expected to be addressed during the episode\"\n            \" of care, expressed as a text, code or a reference to another \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Procedure\",\n                \"Observation\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EpisodeOfCareReason`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"use\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EpisodeOfCareReason`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"use\", \"value\"]\n\n\nclass EpisodeOfCareStatusHistory(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Past list of status codes (the current status may be included to cover the\n    start date of the status).\n    The history of statuses that the EpisodeOfCare has been through (without\n    requiring processing the history of the resource).\n    \"\"\"\n\n    __resource_type__ = \"EpisodeOfCareStatusHistory\"\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"Duration the EpisodeOfCare was in the specified status\",\n        description=\"The period during this EpisodeOfCare that the specific status applied.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"planned | waitlist | active | onhold | finished | cancelled | entered-\"\n            \"in-error\"\n        ),\n        description=\"planned | waitlist | active | onhold | finished | cancelled.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"planned\",\n                \"waitlist\",\n                \"active\",\n                \"onhold\",\n                \"finished\",\n                \"cancelled\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EpisodeOfCareStatusHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"status\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EpisodeOfCareStatusHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/eventdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EventDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass EventDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A description of when an event can occur.\n    The EventDefinition resource provides a reusable description of when a\n    particular event can occur.\n    \"\"\"\n\n    __resource_type__ = \"EventDefinition\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the event definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the event definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the event definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the event definition was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the event definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the event definition\",\n        description=(\n            \"A free text natural language description of the event definition from \"\n            \"a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the event definition is expected to be used\",\n        description=(\n            \"The period during which the event definition content was or is planned\"\n            \" to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"responsible for officially endorsing the content for use in some \"\n            \"setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this event definition is authored for\"\n            \" testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the event definition\",\n        description=(\n            \"A formal identifier that is used to identify this event definition \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for event definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the event definition is intended\"\n            \" to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the event definition was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this event definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the event definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the event definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this event definition is defined\",\n        description=(\n            \"Explanation of why this event definition is needed and why it has been\"\n            \" designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related resources such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"primarily responsible for review of some aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this event definition. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=\"Type of individual the event definition is focused on\",\n        description=(\n            \"A code or group definition that describes the intended subject of the \"\n            \"event definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=\"Type of individual the event definition is focused on\",\n        description=(\n            \"A code or group definition that describes the intended subject of the \"\n            \"event definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the event definition\",\n        description=(\n            \"An explanatory or alternate title for the event definition giving \"\n            \"additional information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this event definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the event definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptive topics related to the module. Topics provide a high-level \"\n            \"categorization of the module that can be useful for filtering and \"\n            \"searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    trigger: typing.List[fhirtypes.TriggerDefinitionType] = Field(\n        default=...,\n        alias=\"trigger\",\n        title=\"\\\"when\\\" the event occurs (multiple = 'or')\",\n        description=(\n            \"The trigger element defines when the event occurs. If more than one \"\n            \"trigger condition is specified, the event fires whenever any one of \"\n            \"the trigger conditions is met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this event definition, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this event definition when it\"\n            \" is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" event definition is (or will be) published. This URL can be the \"\n            \"target of a canonical reference. It SHALL remain the same when the \"\n            \"event definition is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the event definition\",\n        description=(\n            \"A detailed description of how the event definition is used from a \"\n            \"clinical perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate event definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the event definition\",\n        description=(\n            \"The identifier that is used to identify this version of the event \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the event definition \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EventDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"status\",\n            \"experimental\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"usage\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"trigger\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EventDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"trigger\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"subject\": [\"subjectCodeableConcept\", \"subjectReference\"],\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/evidence.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Evidence\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Evidence(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Single evidence bit.\n    The Evidence Resource provides a machine-interpretable expression of an\n    evidence concept including the evidence variables (e.g., population,\n    exposures/interventions, comparators, outcomes, measured variables,\n    confounding variables), the statistics, and the certainty of this evidence.\n    \"\"\"\n\n    __resource_type__ = \"Evidence\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the summary was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    assertion: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"assertion\",\n        title=\"Declarative description of the Evidence\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    assertion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_assertion\", title=\"Extension field for ``assertion``.\"\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual, organization, or device primarily involved in the \"\n            \"creation and maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    certainty: typing.List[fhirtypes.EvidenceCertaintyType] | None = Field(\n        default=None,\n        alias=\"certainty\",\n        title=\"Certainty or quality of the evidence\",\n        description=(\n            \"Assessment of certainty, confidence in the estimates, or quality of \"\n            \"the evidence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    citeAsMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"citeAsMarkdown\",\n        title=\"Citation for this evidence\",\n        description=\"Citation Resource or display of suggested citation for this evidence.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e citeAs[x]\n            \"one_of_many\": \"citeAs\",\n            \"one_of_many_required\": False,\n        },\n    )\n    citeAsMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_citeAsMarkdown\",\n        title=\"Extension field for ``citeAsMarkdown``.\",\n    )\n\n    citeAsReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"citeAsReference\",\n        title=\"Citation for this evidence\",\n        description=\"Citation Resource or display of suggested citation for this evidence.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e citeAs[x]\n            \"one_of_many\": \"citeAs\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Citation\"],\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the Evidence and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the Evidence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the summary was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the summary changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the particular summary\",\n        description=(\n            \"A free text natural language description of the evidence from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individiual, organization, or device primarily responsible for \"\n            \"internal coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individiual, organization, or device responsible for officially \"\n            \"endorsing the content for use in some setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this resource is authored for testing\"\n            \" purposes (or education/evaluation/marketing) and is not intended to \"\n            \"be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the summary\",\n        description=(\n            \"A formal identifier that is used to identify this summary when it is \"\n            \"represented in other formats, or referenced in a specification, model,\"\n            \" design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the summary was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this summary (machine friendly)\",\n        description=(\n            \"A natural language name identifying the evidence. This name should be \"\n            \"usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnotes and/or explanatory notes\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the evidence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this Evidence is defined\",\n        description=(\n            \"Explanation of why this Evidence is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Link or citation to artifact associated with the summary\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individiual, organization, or device primarily responsible for \"\n            \"review of some aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    statistic: typing.List[fhirtypes.EvidenceStatisticType] | None = Field(\n        default=None,\n        alias=\"statistic\",\n        title=\"Values and parameters for a single statistic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this summary. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    studyDesign: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"studyDesign\",\n        title=\"The design of the study that produced this evidence\",\n        description=(\n            \"The design of the study that produced this evidence. The design is \"\n            \"described with any number of study design characteristics.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    synthesisType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"synthesisType\",\n        title=\"The method to combine studies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this summary (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the summary.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this evidence, represented as a globally \"\n            \"unique URI\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this evidence when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" summary is (or will be) published. This URL can be the target of a \"\n            \"canonical reference. It SHALL remain the same when the summary is \"\n            \"stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate evidence instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    variableDefinition: typing.List[fhirtypes.EvidenceVariableDefinitionType] = Field(\n        default=...,\n        alias=\"variableDefinition\",\n        title=\"Evidence variable such as population, exposure, or outcome\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of this summary\",\n        description=(\n            \"The identifier that is used to identify this version of the summary \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the summary author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Evidence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"citeAsReference\",\n            \"citeAsMarkdown\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"publisher\",\n            \"contact\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"useContext\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"relatedArtifact\",\n            \"description\",\n            \"assertion\",\n            \"note\",\n            \"variableDefinition\",\n            \"synthesisType\",\n            \"studyDesign\",\n            \"statistic\",\n            \"certainty\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Evidence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"title\",\n            \"status\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"author\",\n            \"endorser\",\n            \"useContext\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"citeAs\": [\"citeAsMarkdown\", \"citeAsReference\"],\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"],\n        }\n        return one_of_many_fields\n\n\nclass EvidenceCertainty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Certainty or quality of the evidence.\n    Assessment of certainty, confidence in the estimates, or quality of the\n    evidence.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceCertainty\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of certainty\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnotes and/or explanatory notes\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rater: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"rater\",\n        title=\"Individual or group who did the rating\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    rater__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rater\", title=\"Extension field for ``rater``.\"\n    )\n\n    rating: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"rating\",\n        title=\"Assessment or judgement of the aspect\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subcomponent: typing.List[fhirtypes.EvidenceCertaintyType] | None = Field(\n        default=None,\n        alias=\"subcomponent\",\n        title=\"A domain or subdomain of certainty\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Aspect of certainty being rated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceCertainty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"note\",\n            \"type\",\n            \"rating\",\n            \"rater\",\n            \"subcomponent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceCertainty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceStatistic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Values and parameters for a single statistic.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceStatistic\"\n\n    attributeEstimate: typing.List[\n        fhirtypes.EvidenceStatisticAttributeEstimateType\n    ] | None = Field(\n        default=None,\n        alias=\"attributeEstimate\",\n        title=\"An attribute of the Statistic\",\n        description=(\n            \"A statistical attribute of the statistic such as a measure of \"\n            \"heterogeneity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Associated category for categorical variable\",\n        description=(\n            \"When the measured variable is handled categorically, the category \"\n            \"element is used to define which category the statistic is reporting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of content\",\n        description=\"A description of the content value of the statistic.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    modelCharacteristic: typing.List[\n        fhirtypes.EvidenceStatisticModelCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"modelCharacteristic\",\n        title=\"An aspect of the statistical model\",\n        description=\"A component of the method to generate the statistic.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnotes and/or explanatory notes\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    numberAffected: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberAffected\",\n        title=\"The number of participants affected\",\n        description=(\n            \"The number of participants affected where the unit of analysis is the \"\n            \"same as sampleSize.knownDataCount and sampleSize.numberOfParticipants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    numberAffected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberAffected\",\n        title=\"Extension field for ``numberAffected``.\",\n    )\n\n    numberOfEvents: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfEvents\",\n        title=\"The number of events associated with the statistic\",\n        description=(\n            \"The number of events associated with the statistic, where the unit of \"\n            \"analysis is different from numberAffected, sampleSize.knownDataCount \"\n            \"and sampleSize.numberOfParticipants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    numberOfEvents__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfEvents\",\n        title=\"Extension field for ``numberOfEvents``.\",\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Statistic value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sampleSize: fhirtypes.EvidenceStatisticSampleSizeType | None = Field(\n        default=None,\n        alias=\"sampleSize\",\n        title=\"Number of samples in the statistic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    statisticType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statisticType\",\n        title=\"Type of statistic, e.g., relative risk\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceStatistic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"note\",\n            \"statisticType\",\n            \"category\",\n            \"quantity\",\n            \"numberOfEvents\",\n            \"numberAffected\",\n            \"sampleSize\",\n            \"attributeEstimate\",\n            \"modelCharacteristic\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceStatistic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceStatisticAttributeEstimate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An attribute of the Statistic.\n    A statistical attribute of the statistic such as a measure of\n    heterogeneity.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceStatisticAttributeEstimate\"\n\n    attributeEstimate: typing.List[\n        fhirtypes.EvidenceStatisticAttributeEstimateType\n    ] | None = Field(\n        default=None,\n        alias=\"attributeEstimate\",\n        title=(\n            \"A nested attribute estimate; which is the attribute estimate of an \"\n            \"attribute estimate\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of the attribute estimate\",\n        description=\"Human-readable summary of the estimate.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    level: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"level\",\n        title=\"Level of confidence interval, e.g., 0.95 for 95% confidence interval\",\n        description=\"Use 95 for a 95% confidence interval.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    level__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_level\", title=\"Extension field for ``level``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnote or explanatory note about the estimate\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=(\n            \"The singular quantity of the attribute estimate, for attribute \"\n            \"estimates represented as single values; also used to report unit of \"\n            \"measure\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    range: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"range\",\n        title=\"Lower and upper bound values of the attribute estimate\",\n        description=\"Lower bound of confidence interval.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of attribute estimate, e.g., confidence interval or p value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceStatisticAttributeEstimate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"note\",\n            \"type\",\n            \"quantity\",\n            \"level\",\n            \"range\",\n            \"attributeEstimate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceStatisticAttributeEstimate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceStatisticModelCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An aspect of the statistical model.\n    A component of the method to generate the statistic.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceStatisticModelCharacteristic\"\n\n    attributeEstimate: typing.List[\n        fhirtypes.EvidenceStatisticAttributeEstimateType\n    ] | None = Field(\n        default=None,\n        alias=\"attributeEstimate\",\n        title=\"An attribute of the statistic used as a model characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Model specification\",\n        description=\"Description of a component of the method to generate the statistic.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Numerical value to complete model specification\",\n        description=(\n            \"Further specification of the quantified value of the component of the \"\n            \"method to generate the statistic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    variable: typing.List[\n        fhirtypes.EvidenceStatisticModelCharacteristicVariableType\n    ] | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"A variable adjusted for in the adjusted analysis\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceStatisticModelCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"value\",\n            \"variable\",\n            \"attributeEstimate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceStatisticModelCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceStatisticModelCharacteristicVariable(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A variable adjusted for in the adjusted analysis.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceStatisticModelCharacteristicVariable\"\n\n    handling: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"handling\",\n        title=\"continuous | dichotomous | ordinal | polychotomous\",\n        description=\"How the variable is classified for use in adjusted analysis.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"continuous\", \"dichotomous\", \"ordinal\", \"polychotomous\"],\n        },\n    )\n    handling__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_handling\", title=\"Extension field for ``handling``.\"\n    )\n\n    valueCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"valueCategory\",\n        title=\"Description for grouping of ordinal or polychotomous variables\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueQuantity: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Discrete value for grouping of ordinal or polychotomous variables\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueRange: typing.List[fhirtypes.RangeType] | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Range of values for grouping of ordinal or polychotomous variables\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    variableDefinition: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"variableDefinition\",\n        title=\"Description of the variable\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\", \"EvidenceVariable\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceStatisticModelCharacteristicVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"variableDefinition\",\n            \"handling\",\n            \"valueCategory\",\n            \"valueQuantity\",\n            \"valueRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceStatisticModelCharacteristicVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceStatisticSampleSize(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Number of samples in the statistic.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceStatisticSampleSize\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of sample size for statistic\",\n        description=\"Human-readable summary of population sample size.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    knownDataCount: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"knownDataCount\",\n        title=\"Number of participants with known results for measured variables\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    knownDataCount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_knownDataCount\",\n        title=\"Extension field for ``knownDataCount``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnote or explanatory note about the sample size\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    numberOfParticipants: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfParticipants\",\n        title=\"Cumulative number of participants\",\n        description=(\n            \"A human-readable string to clarify or explain concepts about the \"\n            \"sample size.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    numberOfParticipants__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfParticipants\",\n        title=\"Extension field for ``numberOfParticipants``.\",\n    )\n\n    numberOfStudies: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfStudies\",\n        title=\"Number of contributing studies\",\n        description=\"Number of participants in the population.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    numberOfStudies__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfStudies\",\n        title=\"Extension field for ``numberOfStudies``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceStatisticSampleSize`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"note\",\n            \"numberOfStudies\",\n            \"numberOfParticipants\",\n            \"knownDataCount\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceStatisticSampleSize`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceVariableDefinition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Evidence variable such as population, exposure, or outcome.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceVariableDefinition\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"A text description or summary of the variable\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    directnessMatch: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"directnessMatch\",\n        title=\"low | moderate | high | exact\",\n        description=(\n            \"Indication of quality of match between intended variable to actual \"\n            \"variable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    intended: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"intended\",\n        title=\"Definition of the intended variable related to the Evidence\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\", \"EvidenceVariable\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnotes and/or explanatory notes\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    observed: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"observed\",\n        title=\"Definition of the actual variable related to the statistic(s)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\", \"EvidenceVariable\"],\n        },\n    )\n\n    variableRole: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"variableRole\",\n        title=(\n            \"population | subpopulation | exposure | referenceExposure | \"\n            \"measuredVariable | confounder\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceVariableDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"note\",\n            \"variableRole\",\n            \"observed\",\n            \"intended\",\n            \"directnessMatch\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceVariableDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"variableRole\", \"observed\"]\n"
  },
  {
    "path": "fhir/resources/evidencereport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EvidenceReport\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass EvidenceReport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A EvidenceReport.\n    The EvidenceReport Resource is a specialized container for a collection of\n    resources and codeable concepts, adapted to support compositions of\n    Evidence, EvidenceVariable, and Citation resources and related concepts.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceReport\"\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual, organization, or device primarily involved in the \"\n            \"creation and maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    citeAsMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"citeAsMarkdown\",\n        title=\"Citation for this report\",\n        description=\"Citation Resource or display of suggested citation for this report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e citeAs[x]\n            \"one_of_many\": \"citeAs\",\n            \"one_of_many_required\": False,\n        },\n    )\n    citeAsMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_citeAsMarkdown\",\n        title=\"Extension field for ``citeAsMarkdown``.\",\n    )\n\n    citeAsReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"citeAsReference\",\n        title=\"Citation for this report\",\n        description=\"Citation Resource or display of suggested citation for this report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e citeAs[x]\n            \"one_of_many\": \"citeAs\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Citation\"],\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individiual, organization, or device primarily responsible for \"\n            \"internal coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individiual, organization, or device responsible for officially \"\n            \"endorsing the content for use in some setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier for the evidence report\",\n        description=(\n            \"A formal identifier that is used to identify this EvidenceReport when \"\n            \"it is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Used for footnotes and annotations\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the evidence report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Link, description or reference to artifact associated with the report\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedIdentifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"relatedIdentifier\",\n        title=(\n            \"Identifiers for articles that may relate to more than one evidence \"\n            \"report\"\n        ),\n        description=(\n            \"A formal identifier that is used to identify things closely related to\"\n            \" this EvidenceReport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatesTo: typing.List[fhirtypes.EvidenceReportRelatesToType] | None = Field(\n        default=None,\n        alias=\"relatesTo\",\n        title=\"Relationships to other compositions/documents\",\n        description=(\n            \"Relationships that this composition has with other compositions or \"\n            \"documents that already exist.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individiual, organization, or device primarily responsible for \"\n            \"review of some aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    section: typing.List[fhirtypes.EvidenceReportSectionType] | None = Field(\n        default=None,\n        alias=\"section\",\n        title=\"Composition is broken into sections\",\n        description=\"The root of the sections that make up the composition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this summary. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.EvidenceReportSubjectType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Focus of the report\",\n        description=(\n            'Specifies the subject or focus of the report. Answers \"What is this '\n            'report about?\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of report\",\n        description=(\n            \"Specifies the kind of report, such as grouping of classifiers, search \"\n            \"results, or human-compiled expression.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this EvidenceReport, represented as a \"\n            \"globally unique URI\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this EvidenceReport when it \"\n            \"is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" summary is (or will be) published. This URL can be the target of a \"\n            \"canonical reference. It SHALL remain the same when the summary is \"\n            \"stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate evidence report instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"status\",\n            \"useContext\",\n            \"identifier\",\n            \"relatedIdentifier\",\n            \"citeAsReference\",\n            \"citeAsMarkdown\",\n            \"type\",\n            \"note\",\n            \"relatedArtifact\",\n            \"subject\",\n            \"publisher\",\n            \"contact\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatesTo\",\n            \"section\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"status\",\n            \"useContext\",\n            \"identifier\",\n            \"relatedIdentifier\",\n            \"subject\",\n            \"publisher\",\n            \"contact\",\n            \"author\",\n            \"endorser\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"citeAs\": [\"citeAsMarkdown\", \"citeAsReference\"]}\n        return one_of_many_fields\n\n\nclass EvidenceReportRelatesTo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationships to other compositions/documents.\n    Relationships that this composition has with other compositions or\n    documents that already exist.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceReportRelatesTo\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"replaces | amends | appends | transforms | replacedWith | amendedWith \"\n            \"| appendedWith | transformedWith\"\n        ),\n        description=(\n            \"The type of relationship that this composition has with anther \"\n            \"composition or document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"replaces\",\n                \"amends\",\n                \"appends\",\n                \"transforms\",\n                \"replacedWith\",\n                \"amendedWith\",\n                \"appendedWith\",\n                \"transformedWith\",\n            ],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    target: fhirtypes.EvidenceReportRelatesToTargetType = Field(\n        default=...,\n        alias=\"target\",\n        title=\"Target of the relationship\",\n        description=\"The target composition/document of this relationship.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceReportRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"target\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceReportRelatesTo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass EvidenceReportRelatesToTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Target of the relationship.\n    The target composition/document of this relationship.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceReportRelatesToTarget\"\n\n    display: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Target of the relationship Display\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Target of the relationship Identifier\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Target of the relationship Resource reference\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Target of the relationship URL\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceReportRelatesToTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"display\",\n            \"resource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceReportRelatesToTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceReportSection(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Composition is broken into sections.\n    The root of the sections that make up the composition.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceReportSection\"\n\n    author: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who and/or what authored the section\",\n        description=(\n            \"Identifies who is responsible for the information in this section, not\"\n            \" necessarily who typed it in.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"Group\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    emptyReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"emptyReason\",\n        title=\"Why the section is empty\",\n        description=(\n            \"If the section is empty, why the list is empty. An empty section \"\n            \"typically has some text explaining the empty reason.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entryClassifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"entryClassifier\",\n        title=\"Extensible classifiers as content\",\n        description=\"Specifies any type of classification of the evidence report.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entryQuantity: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"entryQuantity\",\n        title=\"Quantity as content\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    entryReference: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"entryReference\",\n        title=\"Reference to resources as content\",\n        description=(\n            \"A reference to the actual resource from which the narrative in the \"\n            \"section is derived.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    focus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"Classification of section (recommended)\",\n        description=(\n            \"A code identifying the kind of content contained within the section. \"\n            \"This should be consistent with the section title.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    focusReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"focusReference\",\n        title=\"Classification of section by Resource\",\n        description=(\n            \"A definitional Resource identifying the kind of content contained \"\n            \"within the section. This should be consistent with the section title.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"working | snapshot | changes\",\n        description=(\n            \"How the entry list was prepared - whether it is a working list that is\"\n            \" suitable for being maintained on an ongoing basis, or if it \"\n            \"represents a snapshot of a list of items from another source, or \"\n            \"whether it is a prepared list where items may be marked as added, \"\n            \"modified or deleted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"working\", \"snapshot\", \"changes\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    orderedBy: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"orderedBy\",\n        title=\"Order of section entries\",\n        description=\"Specifies the order applied to the items in the section entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    section: typing.List[fhirtypes.EvidenceReportSectionType] | None = Field(\n        default=None,\n        alias=\"section\",\n        title=\"Nested Section\",\n        description=\"A nested sub-section within this section.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.NarrativeType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text summary of the section, for human interpretation\",\n        description=(\n            \"A human-readable narrative that contains the attested content of the \"\n            \"section, used to represent the content of the resource to a human. The\"\n            \" narrative need not encode all the structured data, but is peferred to\"\n            \" contain sufficient detail to make it acceptable for a human to just \"\n            \"read the narrative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label for section (e.g. for ToC)\",\n        description=(\n            \"The label for this particular section.  This will be part of the \"\n            \"rendered content for the document, and is often used to build a table \"\n            \"of contents.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceReportSection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"title\",\n            \"focus\",\n            \"focusReference\",\n            \"author\",\n            \"text\",\n            \"mode\",\n            \"orderedBy\",\n            \"entryClassifier\",\n            \"entryReference\",\n            \"entryQuantity\",\n            \"emptyReason\",\n            \"section\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceReportSection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceReportSubject(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Focus of the report.\n    Specifies the subject or focus of the report. Answers \"What is this report\n    about?\".\n    \"\"\"\n\n    __resource_type__ = \"EvidenceReportSubject\"\n\n    characteristic: typing.List[\n        fhirtypes.EvidenceReportSubjectCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"Characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Footnotes and/or explanatory notes\",\n        description=\"Used for general notes and annotations not coded elsewhere.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceReportSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"characteristic\", \"note\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceReportSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass EvidenceReportSubjectCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Characteristic.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceReportSubjectCharacteristic\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Characteristic code\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    exclude: bool | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=\"Is used to express not the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_exclude\", title=\"Extension field for ``exclude``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Timeframe for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Characteristic value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Characteristic value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Characteristic value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Characteristic value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Characteristic value\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceReportSubjectCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueReference\",\n            \"valueCodeableConcept\",\n            \"valueBoolean\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"exclude\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceReportSubjectCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueReference\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/evidencevariable.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EvidenceVariable\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass EvidenceVariable(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A definition of an exposure, outcome, or other variable.\n    The EvidenceVariable resource describes an element that knowledge\n    (Evidence) is about.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceVariable\"\n\n    actual: bool | None = Field(\n        default=None,\n        alias=\"actual\",\n        title=\"Actual or conceptual\",\n        description=(\n            \"True if the actual variable measured, false if a conceptual \"\n            \"representation of the intended variable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actual\", title=\"Extension field for ``actual``.\"\n    )\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the resource was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.  See guidance around (not) making local changes to elements \"\n            \"[here](canonicalresource.html#localization).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.EvidenceVariableCategoryType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"A grouping for ordinal or polychotomous variables\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    characteristic: typing.List[\n        fhirtypes.EvidenceVariableCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"A defining factor of the EvidenceVariable\",\n        description=(\n            \"A defining factor of the EvidenceVariable. Multiple characteristics \"\n            'are applied with \"and\" semantics.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the resource and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the evidence variable was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the evidence variable \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the evidence variable\",\n        description=(\n            \"A free text natural language description of the evidence variable from\"\n            \" a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the resource is expected to be used\",\n        description=(\n            \"The period during which the resource content was or is planned to be \"\n            \"in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"responsible for officially endorsing the content for use in some \"\n            \"setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this resource is authored for testing\"\n            \" purposes (or education/evaluation/marketing) and is not intended to \"\n            \"be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    handling: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"handling\",\n        title=\"continuous | dichotomous | ordinal | polychotomous\",\n        description=\"The method of handling in statistical analysis.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"continuous\", \"dichotomous\", \"ordinal\", \"polychotomous\"],\n        },\n    )\n    handling__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_handling\", title=\"Extension field for ``handling``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the evidence variable\",\n        description=(\n            \"A formal identifier that is used to identify this evidence variable \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the resource was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this evidence variable (computer friendly)\",\n        description=(\n            \"A natural language name identifying the evidence variable. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Used for footnotes or explanatory notes\",\n        description=(\n            \"A human-readable string to clarify or explain concepts about the \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the evidence variable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this EvidenceVariable is defined\",\n        description=(\n            \"Explanation of why this EvidenceVariable is needed and why it has been\"\n            \" designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"primarily responsible for review of some aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    shortTitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"shortTitle\",\n        title=\"Title for use in informal contexts\",\n        description=(\n            \"The short title provides an alternate title for use in informal \"\n            \"descriptive contexts where the full, formal title is not necessary.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    shortTitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_shortTitle\", title=\"Extension field for ``shortTitle``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this evidence variable. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this evidence variable (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the evidence variable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this evidence variable, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this evidence variable when \"\n            \"it is referenced in a specification, model, design or an instance; \"\n            \"also called its canonical identifier. This SHOULD be globally unique \"\n            \"and SHOULD be a literal address at which an authoritative instance of \"\n            \"this evidence variable is (or will be) published. This URL can be the \"\n            \"target of a canonical reference. It SHALL remain the same when the \"\n            \"evidence variable is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate evidence variable instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the evidence variable\",\n        description=(\n            \"The identifier that is used to identify this version of the evidence \"\n            \"variable when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the evidence variable \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence. To provide a version consistent with the \"\n            \"Decision Support Service specification, use the format \"\n            \"Major.Minor.Revision (e.g. 1.0.0). For more information on versioning \"\n            \"knowledge assets, refer to the Decision Support Service specification.\"\n            \" Note that a version is required for non-experimental active \"\n            \"artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"shortTitle\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"note\",\n            \"useContext\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"actual\",\n            \"characteristic\",\n            \"handling\",\n            \"category\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"shortTitle\",\n            \"status\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"characteristic\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass EvidenceVariableCategory(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A grouping for ordinal or polychotomous variables.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceVariableCategory\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Description of the grouping\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Definition of the grouping\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Definition of the grouping\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Definition of the grouping\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceVariableCategory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceVariableCategory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\"valueCodeableConcept\", \"valueQuantity\", \"valueRange\"]\n        }\n        return one_of_many_fields\n\n\nclass EvidenceVariableCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A defining factor of the EvidenceVariable.\n    A defining factor of the EvidenceVariable. Multiple characteristics are\n    applied with \"and\" semantics.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceVariableCharacteristic\"\n\n    definitionByCombination: fhirtypes.EvidenceVariableCharacteristicDefinitionByCombinationType | None = Field(\n        default=None,\n        alias=\"definitionByCombination\",\n        title=\"Used to specify how two or more characteristics are combined\",\n        description=(\n            \"Defines the characteristic as a combination of two or more \"\n            \"characteristics.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definitionByTypeAndValue: fhirtypes.EvidenceVariableCharacteristicDefinitionByTypeAndValueType | None = Field(\n        default=None,\n        alias=\"definitionByTypeAndValue\",\n        title=\"Defines the characteristic using type and value\",\n        description=\"Defines the characteristic using both a type and value[x] elements.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    definitionCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definitionCanonical\",\n        title=(\n            \"Defines the characteristic (without using type and value) by a \"\n            \"Canonical\"\n        ),\n        description=\"Defines the characteristic using Canonical.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EvidenceVariable\", \"Evidence\"],\n        },\n    )\n    definitionCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_definitionCanonical\",\n        title=\"Extension field for ``definitionCanonical``.\",\n    )\n\n    definitionCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"definitionCodeableConcept\",\n        title=(\n            \"Defines the characteristic (without using type and value) by a \"\n            \"CodeableConcept\"\n        ),\n        description=\"Defines the characteristic using CodeableConcept.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    definitionExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"definitionExpression\",\n        title=(\n            \"Defines the characteristic (without using type and value) by an \"\n            \"expression\"\n        ),\n        description=\"Defines the characteristic using Expression.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    definitionId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"definitionId\",\n        title=\"Defines the characteristic (without using type and value) by an id\",\n        description=\"Defines the characteristic using id.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    definitionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_definitionId\",\n        title=\"Extension field for ``definitionId``.\",\n    )\n\n    definitionReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"definitionReference\",\n        title=(\n            \"Defines the characteristic (without using type and value) by a \"\n            \"Reference\"\n        ),\n        description=\"Defines the characteristic using a Reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EvidenceVariable\", \"Group\", \"Evidence\"],\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the characteristic\",\n        description=(\n            \"A short, natural language description of the characteristic that could\"\n            \" be used to communicate the criteria to an end-user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    durationQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"durationQuantity\",\n        title=\"Length of time in which the characteristic is met\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e duration[x]\n            \"one_of_many\": \"duration\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    durationRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"durationRange\",\n        title=\"Length of time in which the characteristic is met\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e duration[x]\n            \"one_of_many\": \"duration\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    exclude: bool | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=(\n            \"Whether the characteristic is an inclusion criterion or exclusion \"\n            \"criterion\"\n        ),\n        description=(\n            \"When true, this characteristic is an exclusion criterion. In other \"\n            \"words, not matching this characteristic definition is equivalent to \"\n            \"meeting this criterion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_exclude\", title=\"Extension field for ``exclude``.\"\n    )\n\n    instancesQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"instancesQuantity\",\n        title=\"Number of occurrences meeting the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e instances[x]\n            \"one_of_many\": \"instances\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    instancesRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"instancesRange\",\n        title=\"Number of occurrences meeting the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e instances[x]\n            \"one_of_many\": \"instances\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    linkId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Label for internal linking\",\n        description=\"Label used for when a characteristic refers to another characteristic.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Used for footnotes or explanatory notes\",\n        description=(\n            \"A human-readable string to clarify or explain concepts about the \"\n            \"characteristic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timeFromEvent: typing.List[\n        fhirtypes.EvidenceVariableCharacteristicTimeFromEventType\n    ] | None = Field(\n        default=None,\n        alias=\"timeFromEvent\",\n        title=\"Timing in which the characteristic is determined\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceVariableCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"description\",\n            \"note\",\n            \"exclude\",\n            \"definitionReference\",\n            \"definitionCanonical\",\n            \"definitionCodeableConcept\",\n            \"definitionExpression\",\n            \"definitionId\",\n            \"definitionByTypeAndValue\",\n            \"definitionByCombination\",\n            \"instancesQuantity\",\n            \"instancesRange\",\n            \"durationQuantity\",\n            \"durationRange\",\n            \"timeFromEvent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceVariableCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"definitionReference\",\n            \"definitionCanonical\",\n            \"definitionCodeableConcept\",\n            \"definitionExpression\",\n            \"definitionId\",\n            \"definitionByTypeAndValue\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"duration\": [\"durationQuantity\", \"durationRange\"],\n            \"instances\": [\"instancesQuantity\", \"instancesRange\"],\n        }\n        return one_of_many_fields\n\n\nclass EvidenceVariableCharacteristicDefinitionByCombination(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Used to specify how two or more characteristics are combined.\n    Defines the characteristic as a combination of two or more characteristics.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceVariableCharacteristicDefinitionByCombination\"\n\n    characteristic: typing.List[fhirtypes.EvidenceVariableCharacteristicType] = Field(\n        default=...,\n        alias=\"characteristic\",\n        title=\"A defining factor of the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"all-of | any-of | at-least | at-most | statistical | net-effect | \"\n            \"dataset\"\n        ),\n        description=(\n            \"Used to specify if two or more characteristics are combined with OR or\"\n            \" AND.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"all-of\",\n                \"any-of\",\n                \"at-least\",\n                \"at-most\",\n                \"statistical\",\n                \"net-effect\",\n                \"dataset\",\n            ],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    threshold: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"threshold\",\n        title='Provides the value of \"n\" when \"at-least\" or \"at-most\" codes are used',\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    threshold__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_threshold\", title=\"Extension field for ``threshold``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceVariableCharacteristicDefinitionByCombination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"threshold\",\n            \"characteristic\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceVariableCharacteristicDefinitionByCombination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass EvidenceVariableCharacteristicDefinitionByTypeAndValue(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defines the characteristic using type and value.\n    Defines the characteristic using both a type and value[x] elements.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceVariableCharacteristicDefinitionByTypeAndValue\"\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Device used for determining characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"DeviceMetric\"],\n        },\n    )\n\n    method: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Method for how the characteristic value was determined\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    offset: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"offset\",\n        title=\"Reference point for valueQuantity or valueRange\",\n        description=(\n            \"Defines the reference point for comparison when valueQuantity or \"\n            \"valueRange is not compared to zero.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Expresses the type of characteristic\",\n        description=\"Used to express the type of characteristic.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Defines the characteristic when coupled with characteristic.type\",\n        description=\"Defines the characteristic when paired with characteristic.type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Defines the characteristic when coupled with characteristic.type\",\n        description=\"Defines the characteristic when paired with characteristic.type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Defines the characteristic when coupled with characteristic.type\",\n        description=\"Defines the characteristic when paired with characteristic.type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Defines the characteristic when coupled with characteristic.type\",\n        description=\"Defines the characteristic when paired with characteristic.type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Defines the characteristic when coupled with characteristic.type\",\n        description=\"Defines the characteristic when paired with characteristic.type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Defines the characteristic when coupled with characteristic.type\",\n        description=\"Defines the characteristic when paired with characteristic.type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceVariableCharacteristicDefinitionByTypeAndValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"method\",\n            \"device\",\n            \"valueCodeableConcept\",\n            \"valueBoolean\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueReference\",\n            \"valueId\",\n            \"offset\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceVariableCharacteristicDefinitionByTypeAndValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueBoolean\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueReference\",\n            \"valueId\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueId\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueReference\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass EvidenceVariableCharacteristicTimeFromEvent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Timing in which the characteristic is determined.\n    \"\"\"\n\n    __resource_type__ = \"EvidenceVariableCharacteristicTimeFromEvent\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human readable description\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    eventCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"eventCodeableConcept\",\n        title=\"The event used as a base point (reference point) in time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e event[x]\n            \"one_of_many\": \"event\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    eventDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"eventDateTime\",\n        title=\"The event used as a base point (reference point) in time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e event[x]\n            \"one_of_many\": \"event\",\n            \"one_of_many_required\": False,\n        },\n    )\n    eventDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_eventDateTime\",\n        title=\"Extension field for ``eventDateTime``.\",\n    )\n\n    eventId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"eventId\",\n        title=\"The event used as a base point (reference point) in time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e event[x]\n            \"one_of_many\": \"event\",\n            \"one_of_many_required\": False,\n        },\n    )\n    eventId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_eventId\", title=\"Extension field for ``eventId``.\"\n    )\n\n    eventReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"eventReference\",\n        title=\"The event used as a base point (reference point) in time\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e event[x]\n            \"one_of_many\": \"event\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Used for footnotes or explanatory notes\",\n        description=(\n            \"A human-readable string to clarify or explain concepts about the \"\n            \"timeFromEvent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=(\n            \"Used to express the observation at a defined amount of time before or \"\n            \"after the event\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    range: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"range\",\n        title=(\n            \"Used to express the observation within a period before and/or after \"\n            \"the event\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``EvidenceVariableCharacteristicTimeFromEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"note\",\n            \"eventCodeableConcept\",\n            \"eventReference\",\n            \"eventDateTime\",\n            \"eventId\",\n            \"quantity\",\n            \"range\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``EvidenceVariableCharacteristicTimeFromEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"event\": [\n                \"eventCodeableConcept\",\n                \"eventDateTime\",\n                \"eventId\",\n                \"eventReference\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/examplescenario.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ExampleScenario\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ExampleScenario(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Example of workflow instance.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenario\"\n\n    actor: typing.List[fhirtypes.ExampleScenarioActorType] | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Individual involved in exchange\",\n        description=(\n            \"A system or person who shares or receives an instance within the \"\n            \"scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the example scenario and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the example scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the example scenario was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the example scenario \"\n            \"changes. (e.g. the 'content logical definition').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the ExampleScenario\",\n        description=(\n            \"A free text natural language description of the ExampleScenario from a\"\n            \" consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this example scenario is authored for\"\n            \" testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the example scenario\",\n        description=(\n            \"A formal identifier that is used to identify this example scenario \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instance: typing.List[fhirtypes.ExampleScenarioInstanceType] | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"Data used in the scenario\",\n        description=\"A single data collection that is shared as part of the scenario.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for example scenario (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the example scenario is intended\"\n            \" to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"To be removed?\",\n        description=\"Temporarily retained for tooling purposes.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    process: typing.List[fhirtypes.ExampleScenarioProcessType] | None = Field(\n        default=None,\n        alias=\"process\",\n        title=\"Major process within scenario\",\n        description=(\n            \"A group of operations that represents a significant step within a \"\n            \"scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the example scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"The purpose of the example, e.g. to illustrate a scenario\",\n        description=(\n            \"What the example scenario resource is created for. This should not be \"\n            \"used to show the business purpose of the scenario itself, but the \"\n            \"purpose of documenting a scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this example scenario. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this example scenario (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the ExampleScenario.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this example scenario, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this example scenario when it\"\n            \" is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" example scenario is (or will be) published. This URL can be the \"\n            \"target of a canonical reference. It SHALL remain the same when the \"\n            \"example scenario is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate example scenario instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the example scenario\",\n        description=(\n            \"The identifier that is used to identify this version of the example \"\n            \"scenario when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the example scenario \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenario`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"actor\",\n            \"instance\",\n            \"process\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenario`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass ExampleScenarioActor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Individual involved in exchange.\n    A system or person who shares or receives an instance within the scenario.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioActor\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Details about actor\",\n        description=\"An explanation of who/what the actor is and its role in the scenario.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    key: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"key\",\n        title=\"ID or acronym of the actor\",\n        description=(\n            \"A unique string within the scenario that is used to reference the \"\n            \"actor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_key\", title=\"Extension field for ``key``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label for actor when rendering\",\n        description=(\n            \"The human-readable name for the actor used when rendering the \" \"scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"person | system\",\n        description=\"The category of actor - person or system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"person\", \"system\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"key\",\n            \"type\",\n            \"title\",\n            \"description\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"key\", \"key__ext\"),\n            (\"title\", \"title__ext\"),\n            (\"type\", \"type__ext\"),\n        ]\n        return required_fields\n\n\nclass ExampleScenarioInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Data used in the scenario.\n    A single data collection that is shared as part of the scenario.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioInstance\"\n\n    containedInstance: typing.List[\n        fhirtypes.ExampleScenarioInstanceContainedInstanceType\n    ] | None = Field(\n        default=None,\n        alias=\"containedInstance\",\n        title=\"Resources contained in the instance\",\n        description=(\n            \"References to other instances that can be found within this instance \"\n            \"(e.g. the observations contained in a bundle).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    content: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"Example instance data\",\n        description=(\n            \"Points to an instance (typically an example) that shows the data that \"\n            \"would corespond to this instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-friendly description of the instance\",\n        description=\"An explanation of what the instance contains and what it's for.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    key: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"key\",\n        title=\"ID or acronym of the instance\",\n        description=(\n            \"A unique string within the scenario that is used to reference the \"\n            \"instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_key\", title=\"Extension field for ``key``.\"\n    )\n\n    structureProfileCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"structureProfileCanonical\",\n        title=\"Rules instance adheres to\",\n        description=(\n            \"Refers to a profile, template or other ruleset the instance adheres \" \"to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e structureProfile[x]\n            \"one_of_many\": \"structureProfile\",\n            \"one_of_many_required\": False,\n        },\n    )\n    structureProfileCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_structureProfileCanonical\",\n        title=\"Extension field for ``structureProfileCanonical``.\",\n    )\n\n    structureProfileUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"structureProfileUri\",\n        title=\"Rules instance adheres to\",\n        description=(\n            \"Refers to a profile, template or other ruleset the instance adheres \" \"to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e structureProfile[x]\n            \"one_of_many\": \"structureProfile\",\n            \"one_of_many_required\": False,\n        },\n    )\n    structureProfileUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_structureProfileUri\",\n        title=\"Extension field for ``structureProfileUri``.\",\n    )\n\n    structureType: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"structureType\",\n        title=\"Data structure for example\",\n        description=(\n            \"A code indicating the kind of data structure (FHIR resource or some \"\n            \"other standard) this is an instance of.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    structureVersion: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"structureVersion\",\n        title=\"E.g. 4.0.1\",\n        description=(\n            \"Conveys the version of the data structure instantiated.  I.e. what \"\n            \"release of FHIR, X12, OpenEHR, etc. is instance compliant with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    structureVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_structureVersion\",\n        title=\"Extension field for ``structureVersion``.\",\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label for instance\",\n        description=(\n            \"A short descriptive label the instance to be used in tables or \"\n            \"diagrams.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    version: typing.List[fhirtypes.ExampleScenarioInstanceVersionType] | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Snapshot of instance that changes\",\n        description=\"Represents the instance as it was at a specific time-point.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"key\",\n            \"structureType\",\n            \"structureVersion\",\n            \"structureProfileCanonical\",\n            \"structureProfileUri\",\n            \"title\",\n            \"description\",\n            \"content\",\n            \"version\",\n            \"containedInstance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"key\", \"key__ext\"), (\"title\", \"title__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"structureProfile\": [\"structureProfileCanonical\", \"structureProfileUri\"]\n        }\n        return one_of_many_fields\n\n\nclass ExampleScenarioInstanceContainedInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resources contained in the instance.\n    References to other instances that can be found within this instance (e.g.\n    the observations contained in a bundle).\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioInstanceContainedInstance\"\n\n    instanceReference: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"instanceReference\",\n        title=\"Key of contained instance\",\n        description=\"A reference to the key of an instance found within this one.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    instanceReference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instanceReference\",\n        title=\"Extension field for ``instanceReference``.\",\n    )\n\n    versionReference: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionReference\",\n        title=\"Key of contained instance version\",\n        description=(\n            \"A reference to the key of a specific version of an instance in this \"\n            \"instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    versionReference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionReference\",\n        title=\"Extension field for ``versionReference``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioInstanceContainedInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"instanceReference\",\n            \"versionReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioInstanceContainedInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"instanceReference\", \"instanceReference__ext\")]\n        return required_fields\n\n\nclass ExampleScenarioInstanceVersion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Snapshot of instance that changes.\n    Represents the instance as it was at a specific time-point.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioInstanceVersion\"\n\n    content: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"Example instance version data\",\n        description=(\n            \"Points to an instance (typically an example) that shows the data that \"\n            \"would flow at this point in the scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Details about version\",\n        description=(\n            \"An explanation of what this specific version of the instance contains \"\n            \"and represents.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    key: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"key\",\n        title=\"ID or acronym of the version\",\n        description=(\n            \"A unique string within the instance that is used to reference the \"\n            \"version of the instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_key\", title=\"Extension field for ``key``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label for instance version\",\n        description=(\n            \"A short descriptive label the version to be used in tables or \" \"diagrams.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioInstanceVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"key\",\n            \"title\",\n            \"description\",\n            \"content\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioInstanceVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"key\", \"key__ext\"), (\"title\", \"title__ext\")]\n        return required_fields\n\n\nclass ExampleScenarioProcess(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Major process within scenario.\n    A group of operations that represents a significant step within a scenario.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioProcess\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-friendly description of the process\",\n        description=\"An explanation of what the process represents and what it does.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    postConditions: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"postConditions\",\n        title=\"Status after successful completion\",\n        description=(\n            \"Description of the final state of the actors, environment and data \"\n            \"after the process has been successfully completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    postConditions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_postConditions\",\n        title=\"Extension field for ``postConditions``.\",\n    )\n\n    preConditions: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"preConditions\",\n        title=\"Status before process starts\",\n        description=(\n            \"Description of the initial state of the actors, environment and data \"\n            \"before the process starts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preConditions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_preConditions\",\n        title=\"Extension field for ``preConditions``.\",\n    )\n\n    step: typing.List[fhirtypes.ExampleScenarioProcessStepType] | None = Field(\n        default=None,\n        alias=\"step\",\n        title=\"Event within of the process\",\n        description=\"A significant action that occurs as part of the process.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label for procss\",\n        description=(\n            \"A short descriptive label the process to be used in tables or \" \"diagrams.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioProcess`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"title\",\n            \"description\",\n            \"preConditions\",\n            \"postConditions\",\n            \"step\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcess`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"title\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"title\", \"title__ext\")]\n        return required_fields\n\n\nclass ExampleScenarioProcessStep(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Event within of the process.\n    A significant action that occurs as part of the process.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioProcessStep\"\n\n    alternative: typing.List[\n        fhirtypes.ExampleScenarioProcessStepAlternativeType\n    ] | None = Field(\n        default=None,\n        alias=\"alternative\",\n        title=\"Alternate non-typical step action\",\n        description=(\n            \"Indicates an alternative step that can be taken instead of the sub-\"\n            \"process, scenario or operation.  E.g. to represent non-happy-\"\n            \"path/exceptional/atypical circumstances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    number: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"Sequential number of the step\",\n        description=\"The sequential number of the step, e.g. 1.2.5.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    operation: fhirtypes.ExampleScenarioProcessStepOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"Step is simple action\",\n        description=\"The step represents a single operation invoked on receiver by sender.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    pause: bool | None = Field(\n        default=None,\n        alias=\"pause\",\n        title=\"Pause in the flow?\",\n        description=(\n            \"If true, indicates that, following this step, there is a pause in the \"\n            \"flow and the subsequent step will occur at some later time (triggered \"\n            \"by some event).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    pause__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_pause\", title=\"Extension field for ``pause``.\"\n    )\n\n    process: fhirtypes.ExampleScenarioProcessType | None = Field(\n        default=None,\n        alias=\"process\",\n        title=\"Step is nested process\",\n        description=\"Indicates that the step is a complex sub-process with its own steps.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    workflow: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"workflow\",\n        title=\"Step is nested workflow\",\n        description=\"Indicates that the step is defined by a seaparate scenario instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ExampleScenario\"],\n        },\n    )\n    workflow__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_workflow\", title=\"Extension field for ``workflow``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioProcessStep`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"number\",\n            \"process\",\n            \"workflow\",\n            \"operation\",\n            \"alternative\",\n            \"pause\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcessStep`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExampleScenarioProcessStepAlternative(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Alternate non-typical step action.\n    Indicates an alternative step that can be taken instead of the sub-process,\n    scenario or operation.  E.g. to represent non-happy-\n    path/exceptional/atypical circumstances.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioProcessStepAlternative\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-readable description of option\",\n        description=(\n            \"A human-readable description of the alternative explaining when the \"\n            \"alternative should occur rather than the base step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    step: typing.List[fhirtypes.ExampleScenarioProcessStepType] | None = Field(\n        default=None,\n        alias=\"step\",\n        title=\"Alternative action(s)\",\n        description=(\n            \"Indicates the operation, sub-process or scenario that happens if the \"\n            \"alternative option is selected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label for alternative\",\n        description=(\n            \"The label to display for the alternative that gives a sense of the \"\n            \"circumstance in which the alternative should be invoked.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioProcessStepAlternative`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"title\", \"description\", \"step\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcessStepAlternative`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"title\", \"title__ext\")]\n        return required_fields\n\n\nclass ExampleScenarioProcessStepOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Step is simple action.\n    The step represents a single operation invoked on receiver by sender.\n    \"\"\"\n\n    __resource_type__ = \"ExampleScenarioProcessStepOperation\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-friendly description of the operation\",\n        description=\"An explanation of what the operation represents and what it does.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    initiator: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"initiator\",\n        title=\"Who starts the operation\",\n        description=\"The system that invokes the action/transmits the data.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    initiator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_initiator\", title=\"Extension field for ``initiator``.\"\n    )\n\n    initiatorActive: bool | None = Field(\n        default=None,\n        alias=\"initiatorActive\",\n        title=\"Initiator stays active?\",\n        description=\"If false, the initiator is deactivated right after the operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    initiatorActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_initiatorActive\",\n        title=\"Extension field for ``initiatorActive``.\",\n    )\n\n    receiver: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"receiver\",\n        title=\"Who receives the operation\",\n        description=\"The system on which the action is invoked/receives the data.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    receiver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_receiver\", title=\"Extension field for ``receiver``.\"\n    )\n\n    receiverActive: bool | None = Field(\n        default=None,\n        alias=\"receiverActive\",\n        title=\"Receiver stays active?\",\n        description=\"If false, the receiver is deactivated right after the operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    receiverActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_receiverActive\",\n        title=\"Extension field for ``receiverActive``.\",\n    )\n\n    request: fhirtypes.ExampleScenarioInstanceContainedInstanceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Instance transmitted on invocation\",\n        description=(\n            \"A reference to the instance that is transmitted from requester to \"\n            \"receiver as part of the invocation of the operation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    response: fhirtypes.ExampleScenarioInstanceContainedInstanceType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"Instance transmitted on invocation response\",\n        description=(\n            \"A reference to the instance that is transmitted from receiver to \"\n            \"requester as part of the operation's synchronous response (if any).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Label for step\",\n        description=\"A short descriptive label the step to be used in tables or diagrams.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of action\",\n        description=\"The standardized type of action (FHIR or otherwise).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExampleScenarioProcessStepOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"title\",\n            \"initiator\",\n            \"receiver\",\n            \"description\",\n            \"initiatorActive\",\n            \"receiverActive\",\n            \"request\",\n            \"response\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExampleScenarioProcessStepOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"title\", \"title__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/explanationofbenefit.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ExplanationOfBenefit(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Explanation of Benefit resource.\n    This resource provides: the claim details; adjudication details from the\n    processing of a Claim; and optionally account balance information, for\n    informing the subscriber of the benefits provided.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefit\"\n\n    accident: fhirtypes.ExplanationOfBenefitAccidentType | None = Field(\n        default=None,\n        alias=\"accident\",\n        title=\"Details of the event\",\n        description=(\n            \"Details of a accident which resulted in injuries which required the \"\n            \"products and services listed in the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    addItem: typing.List[fhirtypes.ExplanationOfBenefitAddItemType] | None = Field(\n        default=None,\n        alias=\"addItem\",\n        title=\"Insurer added line items\",\n        description=(\n            \"The first-tier service adjudications for payor added product or \"\n            \"service lines.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Header-level adjudication\",\n        description=(\n            \"The adjudication results which are presented at the header level \"\n            \"rather than at the line-item or add-item levels.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    benefitBalance: typing.List[\n        fhirtypes.ExplanationOfBenefitBenefitBalanceType\n    ] | None = Field(\n        default=None,\n        alias=\"benefitBalance\",\n        title=\"Balance by Benefit Category\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    benefitPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"benefitPeriod\",\n        title=\"When the benefits are applicable\",\n        description=\"The term of the benefits documented in this response.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    billablePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"billablePeriod\",\n        title=\"Relevant time frame for the claim\",\n        description=\"The period for which charges are being submitted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    careTeam: typing.List[fhirtypes.ExplanationOfBenefitCareTeamType] | None = Field(\n        default=None,\n        alias=\"careTeam\",\n        title=\"Care Team members\",\n        description=\"The members of the team who provided the products and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    claim: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claim\",\n        title=\"Claim reference\",\n        description=(\n            \"The business identifier for the instance of the adjudication request: \"\n            \"claim predetermination or preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Claim\"],\n        },\n    )\n\n    claimResponse: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claimResponse\",\n        title=\"Claim response reference\",\n        description=(\n            \"The business identifier for the instance of the adjudication response:\"\n            \" claim, predetermination or preauthorization response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClaimResponse\"],\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Response creation date\",\n        description=\"The date this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    decision: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"decision\",\n        title=\"Result of the adjudication\",\n        description=(\n            \"The result of the claim, predetermination, or preauthorization \"\n            \"adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    diagnosis: typing.List[fhirtypes.ExplanationOfBenefitDiagnosisType] | None = Field(\n        default=None,\n        alias=\"diagnosis\",\n        title=\"Pertinent diagnosis information\",\n        description=\"Information about diagnoses relevant to the claim items.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    diagnosisRelatedGroup: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"diagnosisRelatedGroup\",\n        title=\"Package billing code\",\n        description=(\n            \"A package billing code or bundle code used to group products and \"\n            \"services to a particular health condition (such as heart attack) which\"\n            \" is based on a predetermined grouping code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition Message\",\n        description=\"A human readable description of the status of the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    encounter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounters associated with the listed treatments\",\n        description=\"Healthcare encounters related to this claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Author of the claim\",\n        description=(\n            \"Individual who created the claim, predetermination or \" \"preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    event: typing.List[fhirtypes.ExplanationOfBenefitEventType] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"Event information\",\n        description=\"Information code for an event with a corresponding date or period.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    facility: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"facility\",\n        title=\"Servicing Facility\",\n        description=\"Facility where the services were provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\", \"Organization\"],\n        },\n    )\n\n    form: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"Printed reference or actual form\",\n        description=(\n            \"The actual form, by reference or inclusion, for printing the content \"\n            \"or an EOB.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    formCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"formCode\",\n        title=\"Printed form identifier\",\n        description=\"A code for the form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    fundsReserve: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fundsReserve\",\n        title=\"Funds reserved status\",\n        description=(\n            \"A code, used only on a response to a preauthorization, to indicate \"\n            \"whether the benefits payable have been reserved and for whom.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    fundsReserveRequested: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fundsReserveRequested\",\n        title=\"For whom to reserve funds\",\n        description=(\n            \"A code to indicate whether and for whom funds are to be reserved for \"\n            \"future claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for the resource\",\n        description=\"A unique identifier assigned to this explanation of benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    insurance: typing.List[fhirtypes.ExplanationOfBenefitInsuranceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Patient insurance information\",\n        description=(\n            \"Financial instruments for reimbursement for the health care products \"\n            \"and services specified on the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    insurer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"insurer\",\n        title=\"Party responsible for reimbursement\",\n        description=(\n            \"The party responsible for authorization, adjudication and \"\n            \"reimbursement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    item: typing.List[fhirtypes.ExplanationOfBenefitItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Product or service provided\",\n        description=(\n            \"A claim line. Either a simple (a product or service) or a 'group' of \"\n            \"details which can also be a simple items or groups of sub-details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    originalPrescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"originalPrescription\",\n        title=\"Original prescription if superceded by fulfiller\",\n        description=(\n            \"Original prescription which has been superseded by this prescription \"\n            \"to support the dispensing of pharmacy services, medications or \"\n            \"products.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    outcome: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"queued | complete | error | partial\",\n        description=(\n            \"The outcome of the claim, predetermination, or preauthorization \"\n            \"processing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"queued\", \"complete\", \"error\", \"partial\"],\n        },\n    )\n    outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcome\", title=\"Extension field for ``outcome``.\"\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The recipient of the products and services\",\n        description=(\n            \"The party to whom the professional services and/or products have been \"\n            \"supplied or are being considered and for whom actual for forecast \"\n            \"reimbursement is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    patientPaid: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patientPaid\",\n        title=\"Paid by the patient\",\n        description=(\n            \"The amount paid by the patient, in total at the claim claim level or \"\n            \"specifically for the item and detail level, to the provider for goods \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payee: fhirtypes.ExplanationOfBenefitPayeeType | None = Field(\n        default=None,\n        alias=\"payee\",\n        title=\"Recipient of benefits payable\",\n        description=(\n            \"The party to be reimbursed for cost of the products and services \"\n            \"according to the terms of the policy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payment: fhirtypes.ExplanationOfBenefitPaymentType | None = Field(\n        default=None,\n        alias=\"payment\",\n        title=\"Payment Details\",\n        description=\"Payment details for the adjudication of the claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Preauthorization reference\",\n        description=(\n            \"Reference from the Insurer which is used in later communications which\"\n            \" refers to this adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    preAuthRefPeriod: typing.List[fhirtypes.PeriodType] | None = Field(\n        default=None,\n        alias=\"preAuthRefPeriod\",\n        title=\"Preauthorization in-effect period\",\n        description=(\n            \"The timeframe during which the supplied preauthorization reference may\"\n            \" be quoted on claims to obtain the adjudication as provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    precedence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"precedence\",\n        title=\"Precedence (primary, secondary, etc.)\",\n        description=(\n            \"This indicates the relative order of a series of EOBs related to \"\n            \"different coverages for the same suite of services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    precedence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_precedence\", title=\"Extension field for ``precedence``.\"\n    )\n\n    prescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"prescription\",\n        title=\"Prescription authorizing services or products\",\n        description=(\n            \"Prescription is the document/authorization given to the claim author \"\n            \"for them to provide products and services for which consideration \"\n            \"(reimbursement) is sought. Could be a RX for medications, an 'order' \"\n            \"for oxygen or wheelchair or physiotherapy treatments.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\", \"VisionPrescription\"],\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"Desired processing urgency\",\n        description=(\n            \"The provider-required urgency of processing the request. Typical \"\n            \"values include: stat, normal deferred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    procedure: typing.List[fhirtypes.ExplanationOfBenefitProcedureType] | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"Clinical procedures performed\",\n        description=(\n            \"Procedures performed on the patient relevant to the billing items with\"\n            \" the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    processNote: typing.List[\n        fhirtypes.ExplanationOfBenefitProcessNoteType\n    ] | None = Field(\n        default=None,\n        alias=\"processNote\",\n        title=\"Note concerning adjudication\",\n        description=(\n            \"A note that describes or explains adjudication results in a human \"\n            \"readable form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Party responsible for the claim\",\n        description=(\n            \"The provider which is responsible for the claim, predetermination or \"\n            \"preauthorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    referral: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referral\",\n        title=\"Treatment Referral\",\n        description=(\n            \"The referral information received by the claim author, it is not to be\"\n            \" used when the author generates a referral for a patient. A copy of \"\n            \"that referral may be provided as supporting information. Some insurers\"\n            \" require proof of referral to pay for services or to pay specialist \"\n            \"rates for services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    related: typing.List[fhirtypes.ExplanationOfBenefitRelatedType] | None = Field(\n        default=None,\n        alias=\"related\",\n        title=\"Prior or corollary claims\",\n        description=(\n            \"Other claims which are related to this claim such as prior submissions\"\n            \" or claims for related services or for the same event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subType\",\n        title=\"More granular claim type\",\n        description=(\n            \"A finer grained suite of claim type codes which may convey additional \"\n            \"information such as Inpatient vs Outpatient and/or a specialty \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInfo: typing.List[\n        fhirtypes.ExplanationOfBenefitSupportingInfoType\n    ] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Supporting information\",\n        description=(\n            \"Additional information codes regarding exceptions, special \"\n            \"considerations, the condition, situation, prior or concurrent issues.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    total: typing.List[fhirtypes.ExplanationOfBenefitTotalType] | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"Adjudication totals\",\n        description=\"Categorized monetary totals for the adjudication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Category or discipline\",\n        description=(\n            \"The category of claim, e.g. oral, pharmacy, vision, institutional, \"\n            \"professional.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"claim | preauthorization | predetermination\",\n        description=(\n            \"A code to indicate whether the nature of the request is: Claim - A \"\n            \"request to an Insurer to adjudicate the supplied charges for health \"\n            \"care goods and services under the identified policy and to pay the \"\n            \"determined Benefit amount, if any; Preauthorization - A request to an \"\n            \"Insurer to adjudicate the supplied proposed future charges for health \"\n            \"care goods and services under the identified policy and to approve the\"\n            \" services and provide the expected benefit amounts and potentially to \"\n            \"reserve funds to pay the benefits when Claims for the indicated \"\n            \"services are later submitted; or, Pre-determination - A request to an \"\n            \"Insurer to adjudicate the supplied 'what if' charges for health care \"\n            \"goods and services under the identified policy and report back what \"\n            \"the Benefit payable would be had the services actually been provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"claim\", \"preauthorization\", \"predetermination\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"traceNumber\",\n            \"status\",\n            \"type\",\n            \"subType\",\n            \"use\",\n            \"patient\",\n            \"billablePeriod\",\n            \"created\",\n            \"enterer\",\n            \"insurer\",\n            \"provider\",\n            \"priority\",\n            \"fundsReserveRequested\",\n            \"fundsReserve\",\n            \"related\",\n            \"prescription\",\n            \"originalPrescription\",\n            \"event\",\n            \"payee\",\n            \"referral\",\n            \"encounter\",\n            \"facility\",\n            \"claim\",\n            \"claimResponse\",\n            \"outcome\",\n            \"decision\",\n            \"disposition\",\n            \"preAuthRef\",\n            \"preAuthRefPeriod\",\n            \"diagnosisRelatedGroup\",\n            \"careTeam\",\n            \"supportingInfo\",\n            \"diagnosis\",\n            \"procedure\",\n            \"precedence\",\n            \"insurance\",\n            \"accident\",\n            \"patientPaid\",\n            \"item\",\n            \"addItem\",\n            \"adjudication\",\n            \"total\",\n            \"payment\",\n            \"formCode\",\n            \"form\",\n            \"processNote\",\n            \"benefitPeriod\",\n            \"benefitBalance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"type\",\n            \"use\",\n            \"patient\",\n            \"billablePeriod\",\n            \"created\",\n            \"insurer\",\n            \"provider\",\n            \"outcome\",\n            \"decision\",\n            \"insurance\",\n            \"total\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"outcome\", \"outcome__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"use\", \"use__ext\"),\n        ]\n        return required_fields\n\n\nclass ExplanationOfBenefitAccident(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of the event.\n    Details of a accident which resulted in injuries which required the\n    products and services listed in the claim.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitAccident\"\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the incident occurred\",\n        description=(\n            \"Date of an accident event  related to the products and services \"\n            \"contained in the claim.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Where the event occurred\",\n        description=\"The physical location of the accident event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Where the event occurred\",\n        description=\"The physical location of the accident event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The nature of the accident\",\n        description=(\n            \"The type or context of the accident event for the purposes of \"\n            \"selection of potential insurance coverages and determination of \"\n            \"coordination between insurers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitAccident`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"date\",\n            \"type\",\n            \"locationAddress\",\n            \"locationReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAccident`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"location\": [\"locationAddress\", \"locationReference\"]}\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitAddItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line items.\n    The first-tier service adjudications for payor added product or service\n    lines.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitAddItem\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items adjudication\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    bodySite: typing.List[\n        fhirtypes.ExplanationOfBenefitAddItemBodySiteType\n    ] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical location\",\n        description=\"Physical location where the service is performed or applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ExplanationOfBenefitAddItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Insurer added line items\",\n        description=\"The second-tier service adjudications for payor added services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"detailSequence\",\n        title=\"Detail sequence number\",\n        description=(\n            \"The sequence number of the details within the claim item which this \"\n            \"line is intended to replace.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detailSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_detailSequence\",\n        title=\"Extension field for ``detailSequence``.\",\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    itemSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"itemSequence\",\n        title=\"Item sequence number\",\n        description=\"Claim items which this service line is intended to replace.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    itemSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_itemSequence\",\n        title=\"Extension field for ``itemSequence``.\",\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"locationCodeableConcept\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The total amount claimed for the group (if a grouper) or the addItem. \"\n            \"Net = unit price * quantity * factor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    patientPaid: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patientPaid\",\n        title=\"Paid by the patient\",\n        description=(\n            \"The amount paid by the patient, in total at the claim claim level or \"\n            \"specifically for the item and detail level, to the provider for goods \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related item details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item. This element may be the start\"\n            \" of a range of .productOrService codes used in conjunction with \"\n            \".productOrServiceEnd or it may be a solo element where \"\n            \".productOrServiceEnd is not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrServiceEnd\",\n        title=\"End of a range of codes\",\n        description=(\n            \"This contains the end of a range of product, service, drug or other \"\n            \"billing codes for the item. This element is not used when the \"\n            \".productOrService is a group code. This value may only be present when\"\n            \" a .productOfService code has been provided to convey the start of the\"\n            \" range. Typically this value may be used only with preauthorizations \"\n            \"and not with claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    provider: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"provider\",\n        title=\"Authorized providers\",\n        description=(\n            \"The providers who are authorized for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Request or Referral for Service\",\n        description=\"Request or Referral for Goods or Service to be rendered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ServiceRequest\",\n                \"SupplyRequest\",\n                \"VisionPrescription\",\n            ],\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewOutcome: fhirtypes.ExplanationOfBenefitItemReviewOutcomeType | None = Field(\n        default=None,\n        alias=\"reviewOutcome\",\n        title=\"Additem level adjudication results\",\n        description=(\n            \"The high-level results of the adjudication if adjudication has been \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subDetailSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"subDetailSequence\",\n        title=\"Subdetail sequence number\",\n        description=(\n            \"The sequence number of the sub-details woithin the details within the \"\n            \"claim item which this line is intended to replace.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subDetailSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_subDetailSequence\",\n        title=\"Extension field for ``subDetailSequence``.\",\n    )\n\n    tax: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tax\",\n        title=\"Total tax\",\n        description=\"The total of taxes applicable for this product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitAddItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"itemSequence\",\n            \"detailSequence\",\n            \"subDetailSequence\",\n            \"traceNumber\",\n            \"provider\",\n            \"revenue\",\n            \"productOrService\",\n            \"productOrServiceEnd\",\n            \"request\",\n            \"modifier\",\n            \"programCode\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"locationCodeableConcept\",\n            \"locationAddress\",\n            \"locationReference\",\n            \"patientPaid\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"tax\",\n            \"net\",\n            \"bodySite\",\n            \"noteNumber\",\n            \"reviewOutcome\",\n            \"adjudication\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"location\": [\n                \"locationAddress\",\n                \"locationCodeableConcept\",\n                \"locationReference\",\n            ],\n            \"serviced\": [\"servicedDate\", \"servicedPeriod\"],\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitAddItemBodySite(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Anatomical location.\n    Physical location where the service is performed or applies.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitAddItemBodySite\"\n\n    site: typing.List[fhirtypes.CodeableReferenceType] = Field(\n        default=...,\n        alias=\"site\",\n        title=\"Location\",\n        description=\"Physical service site on the patient (limb, tooth, etc.).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BodyStructure\"],\n        },\n    )\n\n    subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subSite\",\n        title=\"Sub-location\",\n        description=(\n            \"A region or surface of the bodySite, e.g. limb region or tooth \"\n            \"surface(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitAddItemBodySite`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"site\", \"subSite\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItemBodySite`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitAddItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line items.\n    The second-tier service adjudications for payor added services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitAddItemDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items adjudication\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The total amount claimed for the group (if a grouper) or the \"\n            \"addItem.detail. Net = unit price * quantity * factor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    patientPaid: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patientPaid\",\n        title=\"Paid by the patient\",\n        description=(\n            \"The amount paid by the patient, in total at the claim claim level or \"\n            \"specifically for the item and detail level, to the provider for goods \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related item details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item. This element may be the start\"\n            \" of a range of .productOrService codes used in conjunction with \"\n            \".productOrServiceEnd or it may be a solo element where \"\n            \".productOrServiceEnd is not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrServiceEnd\",\n        title=\"End of a range of codes\",\n        description=(\n            \"This contains the end of a range of product, service, drug or other \"\n            \"billing codes for the item. This element is not used when the \"\n            \".productOrService is a group code. This value may only be present when\"\n            \" a .productOfService code has been provided to convey the start of the\"\n            \" range. Typically this value may be used only with preauthorizations \"\n            \"and not with claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewOutcome: fhirtypes.ExplanationOfBenefitItemReviewOutcomeType | None = Field(\n        default=None,\n        alias=\"reviewOutcome\",\n        title=\"Additem detail level adjudication results\",\n        description=(\n            \"The high-level results of the adjudication if adjudication has been \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subDetail: typing.List[\n        fhirtypes.ExplanationOfBenefitAddItemDetailSubDetailType\n    ] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Insurer added line items\",\n        description=\"The third-tier service adjudications for payor added services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    tax: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tax\",\n        title=\"Total tax\",\n        description=\"The total of taxes applicable for this product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitAddItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"traceNumber\",\n            \"revenue\",\n            \"productOrService\",\n            \"productOrServiceEnd\",\n            \"modifier\",\n            \"patientPaid\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"tax\",\n            \"net\",\n            \"noteNumber\",\n            \"reviewOutcome\",\n            \"adjudication\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitAddItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Insurer added line items.\n    The third-tier service adjudications for payor added services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitAddItemDetailSubDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Added items adjudication\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The total amount claimed for the addItem.detail.subDetail. Net = unit \"\n            \"price * quantity * factor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    patientPaid: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patientPaid\",\n        title=\"Paid by the patient\",\n        description=(\n            \"The amount paid by the patient, in total at the claim claim level or \"\n            \"specifically for the item and detail level, to the provider for goods \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related item details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item. This element may be the start\"\n            \" of a range of .productOrService codes used in conjunction with \"\n            \".productOrServiceEnd or it may be a solo element where \"\n            \".productOrServiceEnd is not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrServiceEnd\",\n        title=\"End of a range of codes\",\n        description=(\n            \"This contains the end of a range of product, service, drug or other \"\n            \"billing codes for the item. This element is not used when the \"\n            \".productOrService is a group code. This value may only be present when\"\n            \" a .productOfService code has been provided to convey the start of the\"\n            \" range. Typically this value may be used only with preauthorizations \"\n            \"and not with claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewOutcome: fhirtypes.ExplanationOfBenefitItemReviewOutcomeType | None = Field(\n        default=None,\n        alias=\"reviewOutcome\",\n        title=\"Additem subdetail level adjudication results\",\n        description=(\n            \"The high-level results of the adjudication if adjudication has been \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    tax: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tax\",\n        title=\"Total tax\",\n        description=\"The total of taxes applicable for this product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitAddItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"traceNumber\",\n            \"revenue\",\n            \"productOrService\",\n            \"productOrServiceEnd\",\n            \"modifier\",\n            \"patientPaid\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"tax\",\n            \"net\",\n            \"noteNumber\",\n            \"reviewOutcome\",\n            \"adjudication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitAddItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitBenefitBalance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Balance by Benefit Category.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitBenefitBalance\"\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the benefit or services covered\",\n        description=\"A richer description of the benefit or services covered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    excluded: bool | None = Field(\n        default=None,\n        alias=\"excluded\",\n        title=\"Excluded from the plan\",\n        description=(\n            \"True if the indicated class of service is excluded from the plan, \"\n            \"missing or False indicates the product or service is included in the \"\n            \"coverage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    excluded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_excluded\", title=\"Extension field for ``excluded``.\"\n    )\n\n    financial: typing.List[\n        fhirtypes.ExplanationOfBenefitBenefitBalanceFinancialType\n    ] | None = Field(\n        default=None,\n        alias=\"financial\",\n        title=\"Benefit Summary\",\n        description=\"Benefits Used to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Short name for the benefit\",\n        description=\"A short name or tag for the benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    network: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"In or out of network\",\n        description=(\n            \"Is a flag to indicate whether the benefits refer to in-network \"\n            \"providers or out-of-network providers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    term: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"term\",\n        title=\"Annual or lifetime\",\n        description=(\n            \"The term or period of the values such as 'maximum lifetime benefit' or\"\n            \" 'maximum annual visits'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    unit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Individual or family\",\n        description=\"Indicates if the benefits apply to an individual or to the family.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitBenefitBalance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"excluded\",\n            \"name\",\n            \"description\",\n            \"network\",\n            \"unit\",\n            \"term\",\n            \"financial\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitBenefitBalance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitBenefitBalanceFinancial(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefit Summary.\n    Benefits Used to date.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitBenefitBalanceFinancial\"\n\n    allowedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"allowedMoney\",\n        title=\"Benefits allowed\",\n        description=\"The quantity of the benefit which is permitted under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    allowedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"allowedString\",\n        title=\"Benefits allowed\",\n        description=\"The quantity of the benefit which is permitted under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    allowedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedString\",\n        title=\"Extension field for ``allowedString``.\",\n    )\n\n    allowedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"allowedUnsignedInt\",\n        title=\"Benefits allowed\",\n        description=\"The quantity of the benefit which is permitted under the coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    allowedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedUnsignedInt\",\n        title=\"Extension field for ``allowedUnsignedInt``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Benefit classification\",\n        description=\"Classification of benefit being provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    usedMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"usedMoney\",\n        title=\"Benefits used\",\n        description=\"The quantity of the benefit which have been consumed to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    usedUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"usedUnsignedInt\",\n        title=\"Benefits used\",\n        description=\"The quantity of the benefit which have been consumed to date.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e used[x]\n            \"one_of_many\": \"used\",\n            \"one_of_many_required\": False,\n        },\n    )\n    usedUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_usedUnsignedInt\",\n        title=\"Extension field for ``usedUnsignedInt``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitBenefitBalanceFinancial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"allowedUnsignedInt\",\n            \"allowedString\",\n            \"allowedMoney\",\n            \"usedUnsignedInt\",\n            \"usedMoney\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitBenefitBalanceFinancial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"allowed\": [\"allowedMoney\", \"allowedString\", \"allowedUnsignedInt\"],\n            \"used\": [\"usedMoney\", \"usedUnsignedInt\"],\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitCareTeam(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Care Team members.\n    The members of the team who provided the products and services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitCareTeam\"\n\n    provider: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"provider\",\n        title=\"Practitioner or organization\",\n        description=\"Member of the team who provided the product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    responsible: bool | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Indicator of the lead practitioner\",\n        description=(\n            \"The party who is billing and/or responsible for the claimed products \"\n            \"or services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_responsible\", title=\"Extension field for ``responsible``.\"\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Function within the team\",\n        description=(\n            \"The lead, assisting or supervising practitioner and their discipline \"\n            \"if a multidisciplinary team.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Order of care team\",\n        description=\"A number to uniquely identify care team entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    specialty: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=\"Practitioner or provider specialization\",\n        description=(\n            \"The specialization of the practitioner or provider which is applicable\"\n            \" for this service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitCareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"provider\",\n            \"responsible\",\n            \"role\",\n            \"specialty\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitCareTeam`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ExplanationOfBenefitDiagnosis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Pertinent diagnosis information.\n    Information about diagnoses relevant to the claim items.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitDiagnosis\"\n\n    diagnosisCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"diagnosisCodeableConcept\",\n        title=\"Nature of illness or problem\",\n        description=(\n            \"The nature of illness or problem in a coded form or as a reference to \"\n            \"an external defined Condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    diagnosisReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"diagnosisReference\",\n        title=\"Nature of illness or problem\",\n        description=(\n            \"The nature of illness or problem in a coded form or as a reference to \"\n            \"an external defined Condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e diagnosis[x]\n            \"one_of_many\": \"diagnosis\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    onAdmission: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"onAdmission\",\n        title=\"Present on admission\",\n        description=(\n            \"Indication of whether the diagnosis was present on admission to a \"\n            \"facility.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Diagnosis instance identifier\",\n        description=\"A number to uniquely identify diagnosis entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Timing or nature of the diagnosis\",\n        description=\"When the condition was observed or the relative ranking.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"diagnosisCodeableConcept\",\n            \"diagnosisReference\",\n            \"type\",\n            \"onAdmission\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitDiagnosis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"diagnosis\": [\"diagnosisCodeableConcept\", \"diagnosisReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitEvent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Event information.\n    Information code for an event with a corresponding date or period.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitEvent\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Specific event\",\n        description=\"A coded event such as when a service is expected or a card printed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    whenDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenDateTime\",\n        title=\"Occurance date or period\",\n        description=(\n            \"A date or period in the past or future indicating when the event \"\n            \"occurred or is expectd to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": True,\n        },\n    )\n    whenDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenDateTime\",\n        title=\"Extension field for ``whenDateTime``.\",\n    )\n\n    whenPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"whenPeriod\",\n        title=\"Occurance date or period\",\n        description=(\n            \"A date or period in the past or future indicating when the event \"\n            \"occurred or is expectd to occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"whenDateTime\",\n            \"whenPeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"when\": [\"whenDateTime\", \"whenPeriod\"]}\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitInsurance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient insurance information.\n    Financial instruments for reimbursement for the health care products and\n    services specified on the claim.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitInsurance\"\n\n    coverage: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"coverage\",\n        title=\"Insurance information\",\n        description=(\n            \"Reference to the insurance card level information contained in the \"\n            \"Coverage resource. The coverage issuing insurer will use these details\"\n            \" to locate the patient's actual coverage within the insurer's \"\n            \"information system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\"],\n        },\n    )\n\n    focal: bool | None = Field(\n        default=None,\n        alias=\"focal\",\n        title=\"Coverage to be used for adjudication\",\n        description=(\n            \"A flag to indicate that this Coverage is to be used for adjudication \"\n            \"of this claim when set to true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    focal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_focal\", title=\"Extension field for ``focal``.\"\n    )\n\n    preAuthRef: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Prior authorization reference number\",\n        description=(\n            \"Reference numbers previously provided by the insurer to the provider \"\n            \"to be quoted on subsequent claims containing services or products \"\n            \"related to the prior authorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"focal\",\n            \"coverage\",\n            \"preAuthRef\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitInsurance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"focal\", \"coverage\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"focal\", \"focal__ext\")]\n        return required_fields\n\n\nclass ExplanationOfBenefitItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Product or service provided.\n    A claim line. Either a simple (a product or service) or a 'group' of\n    details which can also be a simple items or groups of sub-details.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItem\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Adjudication details\",\n        description=(\n            \"If this item is a group then the values here are a summary of the \"\n            \"adjudication of the detail items. If this item is a simple product or \"\n            \"service then this is the result of the adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    bodySite: typing.List[\n        fhirtypes.ExplanationOfBenefitItemBodySiteType\n    ] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical location\",\n        description=\"Physical location where the service is performed or applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    careTeamSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"careTeamSequence\",\n        title=\"Applicable care team members\",\n        description=\"Care team members related to this service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    careTeamSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_careTeamSequence\",\n        title=\"Extension field for ``careTeamSequence``.\",\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    detail: typing.List[fhirtypes.ExplanationOfBenefitItemDetailType] | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"Additional items\",\n        description=\"Second-tier of goods and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    diagnosisSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"diagnosisSequence\",\n        title=\"Applicable diagnoses\",\n        description=\"Diagnoses applicable for this service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    diagnosisSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_diagnosisSequence\",\n        title=\"Extension field for ``diagnosisSequence``.\",\n    )\n\n    encounter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounters associated with the listed treatments\",\n        description=\"Healthcare encounters related to this claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    informationSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"informationSequence\",\n        title=\"Applicable exception and supporting information\",\n        description=(\n            \"Exceptions, special conditions and supporting information applicable \"\n            \"for this service or product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    informationSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_informationSequence\",\n        title=\"Extension field for ``informationSequence``.\",\n    )\n\n    locationAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"locationAddress\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"locationCodeableConcept\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    locationReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"locationReference\",\n        title=\"Place of service or where product was supplied\",\n        description=\"Where the product or service was provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e location[x]\n            \"one_of_many\": \"location\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Product or service billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The total amount claimed for the group (if a grouper) or the line \"\n            \"item. Net = unit price * quantity * factor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    patientPaid: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patientPaid\",\n        title=\"Paid by the patient\",\n        description=(\n            \"The amount paid by the patient, in total at the claim claim level or \"\n            \"specifically for the item and detail level, to the provider for goods \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    procedureSequence: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"procedureSequence\",\n        title=\"Applicable procedures\",\n        description=\"Procedures applicable for this service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    procedureSequence__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_procedureSequence\",\n        title=\"Extension field for ``procedureSequence``.\",\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related item details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item. This element may be the start\"\n            \" of a range of .productOrService codes used in conjunction with \"\n            \".productOrServiceEnd or it may be a solo element where \"\n            \".productOrServiceEnd is not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrServiceEnd\",\n        title=\"End of a range of codes\",\n        description=(\n            \"This contains the end of a range of product, service, drug or other \"\n            \"billing codes for the item. This element is not used when the \"\n            \".productOrService is a group code. This value may only be present when\"\n            \" a .productOfService code has been provided to convey the start of the\"\n            \" range. Typically this value may be used only with preauthorizations \"\n            \"and not with claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    request: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Request or Referral for Service\",\n        description=\"Request or Referral for Goods or Service to be rendered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DeviceRequest\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ServiceRequest\",\n                \"SupplyRequest\",\n                \"VisionPrescription\",\n            ],\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewOutcome: fhirtypes.ExplanationOfBenefitItemReviewOutcomeType | None = Field(\n        default=None,\n        alias=\"reviewOutcome\",\n        title=\"Adjudication results\",\n        description=(\n            \"The high-level results of the adjudication if adjudication has been \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Item instance identifier\",\n        description=\"A number to uniquely identify item entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Date or dates of service or product delivery\",\n        description=(\n            \"The date or dates when the service or product was supplied, performed \"\n            \"or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    tax: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tax\",\n        title=\"Total tax\",\n        description=\"The total of taxes applicable for this product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"careTeamSequence\",\n            \"diagnosisSequence\",\n            \"procedureSequence\",\n            \"informationSequence\",\n            \"traceNumber\",\n            \"revenue\",\n            \"category\",\n            \"productOrService\",\n            \"productOrServiceEnd\",\n            \"request\",\n            \"modifier\",\n            \"programCode\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"locationCodeableConcept\",\n            \"locationAddress\",\n            \"locationReference\",\n            \"patientPaid\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"tax\",\n            \"net\",\n            \"udi\",\n            \"bodySite\",\n            \"encounter\",\n            \"noteNumber\",\n            \"reviewOutcome\",\n            \"adjudication\",\n            \"detail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"location\": [\n                \"locationAddress\",\n                \"locationCodeableConcept\",\n                \"locationReference\",\n            ],\n            \"serviced\": [\"servicedDate\", \"servicedPeriod\"],\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitItemAdjudication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication details.\n    If this item is a group then the values here are a summary of the\n    adjudication of the detail items. If this item is a simple product or\n    service then this is the result of the adjudication of this item.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItemAdjudication\"\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Monetary amount\",\n        description=\"Monetary amount associated with the category.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Type of adjudication information\",\n        description=(\n            \"A code to indicate the information type of this adjudication record. \"\n            \"Information types may include: the value submitted, maximum values or \"\n            \"percentages allowed or payable under the plan, amounts that the \"\n            \"patient is responsible for in-aggregate or pertaining to this item, \"\n            \"amounts paid by other coverages, and the benefit payable for this \"\n            \"item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Non-monitary value\",\n        description=(\n            \"A non-monetary value associated with the category. Mutually exclusive \"\n            \"to the amount element above.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Explanation of adjudication outcome\",\n        description=(\n            \"A code supporting the understanding of the adjudication result and \"\n            \"explaining variance from expected amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItemAdjudication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"reason\",\n            \"amount\",\n            \"quantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemAdjudication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitItemBodySite(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Anatomical location.\n    Physical location where the service is performed or applies.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItemBodySite\"\n\n    site: typing.List[fhirtypes.CodeableReferenceType] = Field(\n        default=...,\n        alias=\"site\",\n        title=\"Location\",\n        description=\"Physical service site on the patient (limb, tooth, etc.).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BodyStructure\"],\n        },\n    )\n\n    subSite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subSite\",\n        title=\"Sub-location\",\n        description=(\n            \"A region or surface of the bodySite, e.g. limb region or tooth \"\n            \"surface(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItemBodySite`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"site\", \"subSite\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemBodySite`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitItemDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional items.\n    Second-tier of goods and services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItemDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Detail level adjudication details\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The total amount claimed for the group (if a grouper) or the line \"\n            \"item.detail. Net = unit price * quantity * factor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    patientPaid: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patientPaid\",\n        title=\"Paid by the patient\",\n        description=(\n            \"The amount paid by the patient, in total at the claim claim level or \"\n            \"specifically for the item and detail level, to the provider for goods \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related item details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item. This element may be the start\"\n            \" of a range of .productOrService codes used in conjunction with \"\n            \".productOrServiceEnd or it may be a solo element where \"\n            \".productOrServiceEnd is not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrServiceEnd\",\n        title=\"End of a range of codes\",\n        description=(\n            \"This contains the end of a range of product, service, drug or other \"\n            \"billing codes for the item. This element is not used when the \"\n            \".productOrService is a group code. This value may only be present when\"\n            \" a .productOfService code has been provided to convey the start of the\"\n            \" range. Typically this value may be used only with preauthorizations \"\n            \"and not with claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewOutcome: fhirtypes.ExplanationOfBenefitItemReviewOutcomeType | None = Field(\n        default=None,\n        alias=\"reviewOutcome\",\n        title=\"Detail level adjudication results\",\n        description=(\n            \"The high-level results of the adjudication if adjudication has been \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Product or service provided\",\n        description=(\n            \"A claim detail line. Either a simple (a product or service) or a \"\n            \"'group' of sub-details which are simple items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    subDetail: typing.List[\n        fhirtypes.ExplanationOfBenefitItemDetailSubDetailType\n    ] | None = Field(\n        default=None,\n        alias=\"subDetail\",\n        title=\"Additional items\",\n        description=\"Third-tier of goods and services.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    tax: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tax\",\n        title=\"Total tax\",\n        description=\"The total of taxes applicable for this product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"traceNumber\",\n            \"revenue\",\n            \"category\",\n            \"productOrService\",\n            \"productOrServiceEnd\",\n            \"modifier\",\n            \"programCode\",\n            \"patientPaid\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"tax\",\n            \"net\",\n            \"udi\",\n            \"noteNumber\",\n            \"reviewOutcome\",\n            \"adjudication\",\n            \"subDetail\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ExplanationOfBenefitItemDetailSubDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional items.\n    Third-tier of goods and services.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItemDetailSubDetail\"\n\n    adjudication: typing.List[\n        fhirtypes.ExplanationOfBenefitItemAdjudicationType\n    ] | None = Field(\n        default=None,\n        alias=\"adjudication\",\n        title=\"Subdetail level adjudication details\",\n        description=\"The adjudication results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Benefit classification\",\n        description=(\n            \"Code to identify the general type of benefits under which products and\"\n            \" services are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Price scaling factor\",\n        description=(\n            \"A real number that represents a multiplier used in determining the \"\n            \"overall value of services delivered and/or goods received. The concept\"\n            \" of a Factor allows for a discount or surcharge multiplier to be \"\n            \"applied to a monetary amount.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    modifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Service/Product billing modifiers\",\n        description=(\n            \"Item typification or modifiers codes to convey additional context for \"\n            \"the product or service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    net: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"net\",\n        title=\"Total item cost\",\n        description=(\n            \"The total amount claimed for the line item.detail.subDetail. Net = \"\n            \"unit price * quantity * factor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    noteNumber: typing.List[fhirtypes.PositiveIntType | None] | None = Field(\n        default=None,\n        alias=\"noteNumber\",\n        title=\"Applicable note numbers\",\n        description=(\n            \"The numbers associated with notes below which apply to the \"\n            \"adjudication of this item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    noteNumber__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_noteNumber\", title=\"Extension field for ``noteNumber``.\"\n    )\n\n    patientPaid: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"patientPaid\",\n        title=\"Paid by the patient\",\n        description=(\n            \"The amount paid by the patient, in total at the claim claim level or \"\n            \"specifically for the item and detail level, to the provider for goods \"\n            \"and services.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrService: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrService\",\n        title=\"Billing, service, product, or drug code\",\n        description=(\n            \"When the value is a group code then this item collects a set of \"\n            \"related item details, otherwise this contains the product, service, \"\n            \"drug or other billing code for the item. This element may be the start\"\n            \" of a range of .productOrService codes used in conjunction with \"\n            \".productOrServiceEnd or it may be a solo element where \"\n            \".productOrServiceEnd is not used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    productOrServiceEnd: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"productOrServiceEnd\",\n        title=\"End of a range of codes\",\n        description=(\n            \"This contains the end of a range of product, service, drug or other \"\n            \"billing codes for the item. This element is not used when the \"\n            \".productOrService is a group code. This value may only be present when\"\n            \" a .productOfService code has been provided to convey the start of the\"\n            \" range. Typically this value may be used only with preauthorizations \"\n            \"and not with claims.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"programCode\",\n        title=\"Program the product or service is provided under\",\n        description=\"Identifies the program under which this may be recovered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Count of products or services\",\n        description=\"The number of repetitions of a service or product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    revenue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"revenue\",\n        title=\"Revenue or cost center code\",\n        description=(\n            \"The type of revenue or cost center providing the product and/or \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewOutcome: fhirtypes.ExplanationOfBenefitItemReviewOutcomeType | None = Field(\n        default=None,\n        alias=\"reviewOutcome\",\n        title=\"Subdetail level adjudication results\",\n        description=(\n            \"The high-level results of the adjudication if adjudication has been \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Product or service provided\",\n        description=(\n            \"A claim detail line. Either a simple (a product or service) or a \"\n            \"'group' of sub-details which are simple items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    tax: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tax\",\n        title=\"Total tax\",\n        description=\"The total of taxes applicable for this product or service.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    traceNumber: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"traceNumber\",\n        title=\"Number for tracking\",\n        description=(\n            \"Trace number for tracking purposes. May be defined at the jurisdiction\"\n            \" level or between trading partners.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    unitPrice: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"unitPrice\",\n        title=\"Fee, charge or cost per item\",\n        description=(\n            \"If the item is not a group then this is the fee for the product or \"\n            \"service, otherwise this is the total of the fees for the details of \"\n            \"the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"traceNumber\",\n            \"revenue\",\n            \"category\",\n            \"productOrService\",\n            \"productOrServiceEnd\",\n            \"modifier\",\n            \"programCode\",\n            \"patientPaid\",\n            \"quantity\",\n            \"unitPrice\",\n            \"factor\",\n            \"tax\",\n            \"net\",\n            \"udi\",\n            \"noteNumber\",\n            \"reviewOutcome\",\n            \"adjudication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemDetailSubDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n\nclass ExplanationOfBenefitItemReviewOutcome(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication results.\n    The high-level results of the adjudication if adjudication has been\n    performed.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitItemReviewOutcome\"\n\n    decision: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"decision\",\n        title=\"Result of the adjudication\",\n        description=(\n            \"The result of the claim, predetermination, or preauthorization \"\n            \"adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preAuthPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"preAuthPeriod\",\n        title=\"Preauthorization reference effective period\",\n        description=\"The time frame during which this authorization is effective.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preAuthRef: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"preAuthRef\",\n        title=\"Preauthorization reference\",\n        description=(\n            \"Reference from the Insurer which is used in later communications which\"\n            \" refers to this adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preAuthRef__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preAuthRef\", title=\"Extension field for ``preAuthRef``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason for result of the adjudication\",\n        description=(\n            \"The reasons for the result of the claim, predetermination, or \"\n            \"preauthorization adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitItemReviewOutcome`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"decision\",\n            \"reason\",\n            \"preAuthRef\",\n            \"preAuthPeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitItemReviewOutcome`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitPayee(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Recipient of benefits payable.\n    The party to be reimbursed for cost of the products and services according\n    to the terms of the policy.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitPayee\"\n\n    party: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"party\",\n        title=\"Recipient reference\",\n        description=(\n            \"Reference to the individual or organization to whom any payment will \"\n            \"be made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Category of recipient\",\n        description=\"Type of Party to be reimbursed: Subscriber, provider, other.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitPayee`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"party\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitPayee`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitPayment(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Payment Details.\n    Payment details for the adjudication of the claim.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitPayment\"\n\n    adjustment: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"adjustment\",\n        title=\"Payment adjustment for non-claim issues\",\n        description=(\n            \"Total amount of all adjustments to this payment included in this \"\n            \"transaction which are not related to this claim's adjudication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    adjustmentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"adjustmentReason\",\n        title=\"Explanation for the variance\",\n        description=\"Reason for the payment adjustment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Payable amount after adjustment\",\n        description=\"Benefits payable less any payment adjustment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Expected date of payment\",\n        description=(\n            \"Estimated date the payment will be issued or the actual issue date of \"\n            \"payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for the payment\",\n        description=\"Issuer's unique identifier for the payment instrument.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Partial or complete payment\",\n        description=(\n            \"Whether this represents partial or complete payment of the benefits \"\n            \"payable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitPayment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"adjustment\",\n            \"adjustmentReason\",\n            \"date\",\n            \"amount\",\n            \"identifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitPayment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitProcedure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Clinical procedures performed.\n    Procedures performed on the patient relevant to the billing items with the\n    claim.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitProcedure\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the procedure was performed\",\n        description=\"Date and optionally time the procedure was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    procedureCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"procedureCodeableConcept\",\n        title=\"Specific clinical procedure\",\n        description=(\n            \"The code or reference to a Procedure resource which identifies the \"\n            \"clinical intervention performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e procedure[x]\n            \"one_of_many\": \"procedure\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    procedureReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"procedureReference\",\n        title=\"Specific clinical procedure\",\n        description=(\n            \"The code or reference to a Procedure resource which identifies the \"\n            \"clinical intervention performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e procedure[x]\n            \"one_of_many\": \"procedure\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Procedure instance identifier\",\n        description=\"A number to uniquely identify procedure entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Category of Procedure\",\n        description=\"When the condition was observed or the relative ranking.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    udi: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"udi\",\n        title=\"Unique device identifier\",\n        description=\"Unique Device Identifiers associated with this line item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"type\",\n            \"date\",\n            \"procedureCodeableConcept\",\n            \"procedureReference\",\n            \"udi\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"procedure\": [\"procedureCodeableConcept\", \"procedureReference\"]\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitProcessNote(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Note concerning adjudication.\n    A note that describes or explains adjudication results in a human readable\n    form.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitProcessNote\"\n\n    language: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language of the text\",\n        description=\"A code to define the language used in the text of the note.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    number: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"Note instance identifier\",\n        description=\"A number to uniquely identify a note entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Note explanatory text\",\n        description=\"The explanation or description associated with the processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Note purpose\",\n        description=\"The business purpose of the note text.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"number\",\n            \"type\",\n            \"text\",\n            \"language\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitRelated(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Prior or corollary claims.\n    Other claims which are related to this claim such as prior submissions or\n    claims for related services or for the same event.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitRelated\"\n\n    claim: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"claim\",\n        title=\"Reference to the related claim\",\n        description=\"Reference to a related claim.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Claim\"],\n        },\n    )\n\n    reference: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"File or case reference\",\n        description=(\n            \"An alternate organizational reference to the case or file to which \"\n            \"this particular claim pertains.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"How the reference claim is related\",\n        description=\"A code to convey how the claims are related.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"claim\",\n            \"relationship\",\n            \"reference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitRelated`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ExplanationOfBenefitSupportingInfo(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supporting information.\n    Additional information codes regarding exceptions, special considerations,\n    the condition, situation, prior or concurrent issues.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitSupportingInfo\"\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Classification of the supplied information\",\n        description=(\n            \"The general class of the information supplied: information; exception;\"\n            \" accident, employment; onset, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of information\",\n        description=(\n            \"System and code pertaining to the specific information regarding \"\n            \"special conditions relating to the setting, treatment or patient  for \"\n            \"which care is sought.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Explanation for the information\",\n        description=(\n            \"Provides the reason in the situation where a reason code is required \"\n            \"in addition to the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Information instance identifier\",\n        description=\"A number to uniquely identify supporting information entries.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    timingDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"timingDate\",\n        title=\"When it occurred\",\n        description=\"The date when or period to which this information refers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timingDate\", title=\"Extension field for ``timingDate``.\"\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When it occurred\",\n        description=\"The date when or period to which this information refers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Data to be provided\",\n        description=(\n            \"Additional data or information such as resources, documents, images \"\n            \"etc. including references to the data or the actual inclusion of the \"\n            \"data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"category\",\n            \"code\",\n            \"timingDate\",\n            \"timingPeriod\",\n            \"valueBoolean\",\n            \"valueString\",\n            \"valueQuantity\",\n            \"valueAttachment\",\n            \"valueReference\",\n            \"valueIdentifier\",\n            \"reason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitSupportingInfo`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sequence\", \"sequence__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\"timingDate\", \"timingPeriod\"],\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueIdentifier\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ExplanationOfBenefitTotal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Adjudication totals.\n    Categorized monetary totals for the adjudication.\n    \"\"\"\n\n    __resource_type__ = \"ExplanationOfBenefitTotal\"\n\n    amount: fhirtypes.MoneyType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Financial total for the category\",\n        description=\"Monetary total amount associated with the category.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"Type of adjudication information\",\n        description=(\n            \"A code to indicate the information type of this adjudication record. \"\n            \"Information types may include: the value submitted, maximum values or \"\n            \"percentages allowed or payable under the plan, amounts that the \"\n            \"patient is responsible for in aggregate or pertaining to this item, \"\n            \"amounts paid by other coverages, and the benefit payable for this \"\n            \"item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExplanationOfBenefitTotal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"category\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExplanationOfBenefitTotal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"category\", \"amount\"]\n"
  },
  {
    "path": "fhir/resources/expression.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Expression\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Expression(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An expression that can be used to generate a value.\n    A expression that is evaluated in a specified context and returns a value.\n    The context of use of the expression must specify the context in which the\n    expression is evaluated, and how the result of the expression is used.\n    \"\"\"\n\n    __resource_type__ = \"Expression\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the condition\",\n        description=(\n            \"A brief, natural language description of the condition that \"\n            \"effectively communicates the intended semantics.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Expression in specified language\",\n        description=\"An expression in the specified language that returns a value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"text/cql | text/fhirpath | application/x-fhir-query | etc.\",\n        description=\"The media type of the language for the expression.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"text/cql\",\n                \"text/fhirpath\",\n                \"application/x-fhir-query\",\n                \"etc.\",\n            ],\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    name: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Short name assigned to expression for reuse\",\n        description=(\n            \"A short name assigned to the expression to allow for multiple reuse of\"\n            \" the expression in the context where it is defined.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    reference: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Where the expression is found\",\n        description=\"A URI that defines where the expression is found.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Expression`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"description\",\n            \"name\",\n            \"language\",\n            \"expression\",\n            \"reference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Expression`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"description\", \"name\", \"language\", \"expression\", \"reference\"]\n"
  },
  {
    "path": "fhir/resources/extendedcontactdetail.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ExtendedContactDetail\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass ExtendedContactDetail(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Contact information.\n    Specifies contact information for a specific purpose over a period of time,\n    might be handled/monitored by a specific named person or organization.\n    \"\"\"\n\n    __resource_type__ = \"ExtendedContactDetail\"\n\n    address: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Address for the contact\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of an individual to contact\",\n        description=(\n            \"The name of an individual to contact, some types of contact detail are\"\n            \" usually blank.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"This contact detail is handled/monitored by a specific organization\",\n        description=(\n            \"This contact detail is handled/monitored by a specific organization. \"\n            \"If the name is provided in the contact, then it is referring to the \"\n            \"named individual within this organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period that this contact was valid for usage\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    purpose: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"The type of contact\",\n        description=\"The purpose/type of contact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"Contact details (e.g.phone/fax/url)\",\n        description=\"The contact details application for the purpose defined.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ExtendedContactDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"purpose\",\n            \"name\",\n            \"telecom\",\n            \"address\",\n            \"organization\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ExtendedContactDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"purpose\", \"name\", \"telecom\", \"address\", \"organization\", \"period\"]\n"
  },
  {
    "path": "fhir/resources/extension.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Extension\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Extension(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Optional Extensions Element.\n    Optional Extension Element - found in all resources.\n    \"\"\"\n\n    __resource_type__ = \"Extension\"\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"identifies the meaning of the extension\",\n        description=(\n            \"Source of the definition for the extension code - a logical name or a \"\n            \"URL.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAvailability: fhirtypes.AvailabilityType | None = Field(\n        default=None,\n        alias=\"valueAvailability\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"valueCodeableReference\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"valueContactDetail\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"valueDataRequirement\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"valueDosage\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"valueExpression\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field(\n        default=None,\n        alias=\"valueExtendedContactDetail\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueInteger64: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"valueInteger64\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"valueParameterDefinition\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"valueRatioRange\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"valueRelatedArtifact\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"valueTriggerDefinition\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"valueUsageContext\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"valueUuid\",\n        title=\"Value of extension\",\n        description=(\n            \"Value of extension - must be one of a constrained set of the data \"\n            \"types (see [Extensibility](extensibility.html) for a list).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Extension`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"url\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueInteger64\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCodeableReference\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueRatioRange\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueAvailability\",\n            \"valueExtendedContactDetail\",\n            \"valueDosage\",\n            \"valueMeta\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Extension`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueAvailability\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCanonical\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCodeableReference\",\n                \"valueCoding\",\n                \"valueContactDetail\",\n                \"valueContactPoint\",\n                \"valueCount\",\n                \"valueDataRequirement\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDosage\",\n                \"valueDuration\",\n                \"valueExpression\",\n                \"valueExtendedContactDetail\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueInteger64\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valueParameterDefinition\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueRatioRange\",\n                \"valueReference\",\n                \"valueRelatedArtifact\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueTriggerDefinition\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n                \"valueUrl\",\n                \"valueUsageContext\",\n                \"valueUuid\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/familymemberhistory.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass FamilyMemberHistory(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about patient's relatives, relevant for patient.\n    Significant health conditions for a person related to the patient relevant\n    in the context of care for the patient.\n    \"\"\"\n\n    __resource_type__ = \"FamilyMemberHistory\"\n\n    ageAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"ageAge\",\n        title=\"(approximate) age\",\n        description=(\n            \"The age of the relative at the time the family member history is \"\n            \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e age[x]\n            \"one_of_many\": \"age\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    ageRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"ageRange\",\n        title=\"(approximate) age\",\n        description=(\n            \"The age of the relative at the time the family member history is \"\n            \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e age[x]\n            \"one_of_many\": \"age\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    ageString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"ageString\",\n        title=\"(approximate) age\",\n        description=(\n            \"The age of the relative at the time the family member history is \"\n            \"recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e age[x]\n            \"one_of_many\": \"age\",\n            \"one_of_many_required\": False,\n        },\n    )\n    ageString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_ageString\", title=\"Extension field for ``ageString``.\"\n    )\n\n    bornDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"bornDate\",\n        title=\"(approximate) date of birth\",\n        description=\"The actual or approximate date of birth of the relative.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e born[x]\n            \"one_of_many\": \"born\",\n            \"one_of_many_required\": False,\n        },\n    )\n    bornDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_bornDate\", title=\"Extension field for ``bornDate``.\"\n    )\n\n    bornPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"bornPeriod\",\n        title=\"(approximate) date of birth\",\n        description=\"The actual or approximate date of birth of the relative.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e born[x]\n            \"one_of_many\": \"born\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    bornString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"bornString\",\n        title=\"(approximate) date of birth\",\n        description=\"The actual or approximate date of birth of the relative.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e born[x]\n            \"one_of_many\": \"born\",\n            \"one_of_many_required\": False,\n        },\n    )\n    bornString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_bornString\", title=\"Extension field for ``bornString``.\"\n    )\n\n    condition: typing.List[fhirtypes.FamilyMemberHistoryConditionType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Condition that the related person had\",\n        description=(\n            \"The significant Conditions (or condition) that the family member had. \"\n            \"This is a repeating section to allow a system to represent more than \"\n            \"one condition per resource, though there is nothing stopping multiple \"\n            \"resources - one per condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dataAbsentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"dataAbsentReason\",\n        title=\"subject-unknown | withheld | unable-to-obtain | deferred\",\n        description=\"Describes why the family member's history is not available.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When history was recorded or last updated\",\n        description=(\n            \"The date (and possibly time) when the family member history was \"\n            \"recorded or last updated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    deceasedAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"deceasedAge\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    deceasedBoolean: bool | None = Field(\n        default=None,\n        alias=\"deceasedBoolean\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedBoolean\",\n        title=\"Extension field for ``deceasedBoolean``.\",\n    )\n\n    deceasedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"deceasedDate\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedDate\",\n        title=\"Extension field for ``deceasedDate``.\",\n    )\n\n    deceasedRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"deceasedRange\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    deceasedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"deceasedString\",\n        title=\"Dead? How old/when?\",\n        description=(\n            \"Deceased flag or the actual or approximate age of the relative at the \"\n            \"time of death for the family member history record.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedString\",\n        title=\"Extension field for ``deceasedString``.\",\n    )\n\n    estimatedAge: bool | None = Field(\n        default=None,\n        alias=\"estimatedAge\",\n        title=\"Age is estimated?\",\n        description=\"If true, indicates that the age value specified is an estimated value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    estimatedAge__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_estimatedAge\",\n        title=\"Extension field for ``estimatedAge``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Id(s) for this record\",\n        description=(\n            \"Business identifiers assigned to this family member history by the \"\n            \"performer or other systems which remain constant as the resource is \"\n            \"updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"FamilyMemberHistory.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"Questionnaire\",\n                \"ActivityDefinition\",\n                \"Measure\",\n                \"OperationDefinition\",\n            ],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this FamilyMemberHistory.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The family member described\",\n        description=(\n            'This will either be a name or a description; e.g. \"Aunt Susan\", \"my '\n            'cousin with the red hair\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"General note about related person\",\n        description=(\n            \"This property allows a non condition-specific note to the made about \"\n            \"the related person. Ideally, the note would be in the condition \"\n            \"property, but this is not always possible.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    participant: typing.List[\n        fhirtypes.FamilyMemberHistoryParticipantType\n    ] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=(\n            \"Who or what participated in the activities related to the family \"\n            \"member history and how they were involved\"\n        ),\n        description=(\n            \"Indicates who or what participated in the activities related to the \"\n            \"family member history and how they were involved.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Patient history is about\",\n        description=\"The person who this history concerns.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    procedure: typing.List[fhirtypes.FamilyMemberHistoryProcedureType] | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"Procedures that the related person had\",\n        description=(\n            \"The significant Procedures (or procedure) that the family member had. \"\n            \"This is a repeating section to allow a system to represent more than \"\n            \"one procedure per resource, though there is nothing stopping multiple \"\n            \"resources - one per procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why was family member history performed?\",\n        description=(\n            \"Describes why the family member history occurred in coded or textual \"\n            \"form, or Indicates a Condition, Observation, AllergyIntolerance, or \"\n            \"QuestionnaireResponse that justifies this family member history event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"AllergyIntolerance\",\n                \"QuestionnaireResponse\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    relationship: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"relationship\",\n        title=\"Relationship to the subject\",\n        description=(\n            \"The type of relationship this person has to the patient (father, \"\n            \"mother, brother etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sex: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"sex\",\n        title=\"male | female | other | unknown\",\n        description=\"The birth sex of the family member.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"partial | completed | entered-in-error | health-unknown\",\n        description=(\n            \"A code specifying the status of the record of the family history of a \"\n            \"specific family member.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"partial\",\n                \"completed\",\n                \"entered-in-error\",\n                \"health-unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``FamilyMemberHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"status\",\n            \"dataAbsentReason\",\n            \"patient\",\n            \"date\",\n            \"participant\",\n            \"name\",\n            \"relationship\",\n            \"sex\",\n            \"bornPeriod\",\n            \"bornDate\",\n            \"bornString\",\n            \"ageAge\",\n            \"ageRange\",\n            \"ageString\",\n            \"estimatedAge\",\n            \"deceasedBoolean\",\n            \"deceasedAge\",\n            \"deceasedRange\",\n            \"deceasedDate\",\n            \"deceasedString\",\n            \"reason\",\n            \"note\",\n            \"condition\",\n            \"procedure\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``FamilyMemberHistory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"status\",\n            \"dataAbsentReason\",\n            \"patient\",\n            \"date\",\n            \"participant\",\n            \"name\",\n            \"relationship\",\n            \"sex\",\n            \"ageAge\",\n            \"ageRange\",\n            \"ageString\",\n            \"estimatedAge\",\n            \"deceasedBoolean\",\n            \"deceasedAge\",\n            \"deceasedRange\",\n            \"deceasedDate\",\n            \"deceasedString\",\n            \"reason\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"age\": [\"ageAge\", \"ageRange\", \"ageString\"],\n            \"born\": [\"bornDate\", \"bornPeriod\", \"bornString\"],\n            \"deceased\": [\n                \"deceasedAge\",\n                \"deceasedBoolean\",\n                \"deceasedDate\",\n                \"deceasedRange\",\n                \"deceasedString\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass FamilyMemberHistoryCondition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Condition that the related person had.\n    The significant Conditions (or condition) that the family member had. This\n    is a repeating section to allow a system to represent more than one\n    condition per resource, though there is nothing stopping multiple resources\n    - one per condition.\n    \"\"\"\n\n    __resource_type__ = \"FamilyMemberHistoryCondition\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Condition suffered by relation\",\n        description=(\n            \"The actual condition specified. Could be a coded condition (like MI or\"\n            \" Diabetes) or a less specific string like 'cancer' depending on how \"\n            \"much is known about the condition and the capabilities of the creating\"\n            \" system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contributedToDeath: bool | None = Field(\n        default=None,\n        alias=\"contributedToDeath\",\n        title=\"Whether the condition contributed to the cause of death\",\n        description=(\n            \"This condition contributed to the cause of death of the related \"\n            \"person. If contributedToDeath is not populated, then it is unknown.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    contributedToDeath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_contributedToDeath\",\n        title=\"Extension field for ``contributedToDeath``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Extra information about condition\",\n        description=(\n            \"An area where general notes can be placed about this specific \"\n            \"condition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    onsetAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"onsetAge\",\n        title=\"When condition first manifested\",\n        description=(\n            \"Either the age of onset, range of approximate age or descriptive \"\n            \"string can be recorded.  For conditions with multiple occurrences, \"\n            \"this describes the first known occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"onsetPeriod\",\n        title=\"When condition first manifested\",\n        description=(\n            \"Either the age of onset, range of approximate age or descriptive \"\n            \"string can be recorded.  For conditions with multiple occurrences, \"\n            \"this describes the first known occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"onsetRange\",\n        title=\"When condition first manifested\",\n        description=(\n            \"Either the age of onset, range of approximate age or descriptive \"\n            \"string can be recorded.  For conditions with multiple occurrences, \"\n            \"this describes the first known occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    onsetString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"onsetString\",\n        title=\"When condition first manifested\",\n        description=(\n            \"Either the age of onset, range of approximate age or descriptive \"\n            \"string can be recorded.  For conditions with multiple occurrences, \"\n            \"this describes the first known occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e onset[x]\n            \"one_of_many\": \"onset\",\n            \"one_of_many_required\": False,\n        },\n    )\n    onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_onsetString\", title=\"Extension field for ``onsetString``.\"\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"deceased | permanent disability | etc\",\n        description=(\n            \"Indicates what happened following the condition.  If the condition \"\n            \"resulted in death, deceased date is captured on the relation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``FamilyMemberHistoryCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"outcome\",\n            \"contributedToDeath\",\n            \"onsetAge\",\n            \"onsetRange\",\n            \"onsetPeriod\",\n            \"onsetString\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``FamilyMemberHistoryCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"onset\": [\"onsetAge\", \"onsetPeriod\", \"onsetRange\", \"onsetString\"]\n        }\n        return one_of_many_fields\n\n\nclass FamilyMemberHistoryParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who or what participated in the activities related to the family member\n    history and how they were involved.\n    Indicates who or what participated in the activities related to the family\n    member history and how they were involved.\n    \"\"\"\n\n    __resource_type__ = \"FamilyMemberHistoryParticipant\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=(\n            \"Who or what participated in the activities related to the family \"\n            \"member history\"\n        ),\n        description=(\n            \"Indicates who or what participated in the activities related to the \"\n            \"family member history.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"Organization\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of involvement\",\n        description=(\n            \"Distinguishes the type of involvement of the actor in the activities \"\n            \"related to the family member history.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``FamilyMemberHistoryParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``FamilyMemberHistoryParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n\n\nclass FamilyMemberHistoryProcedure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Procedures that the related person had.\n    The significant Procedures (or procedure) that the family member had. This\n    is a repeating section to allow a system to represent more than one\n    procedure per resource, though there is nothing stopping multiple resources\n    - one per procedure.\n    \"\"\"\n\n    __resource_type__ = \"FamilyMemberHistoryProcedure\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Procedures performed on the related person\",\n        description=(\n            \"The actual procedure specified. Could be a coded procedure or a less \"\n            \"specific string depending on how much is known about the procedure and\"\n            \" the capabilities of the creating system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contributedToDeath: bool | None = Field(\n        default=None,\n        alias=\"contributedToDeath\",\n        title=\"Whether the procedure contributed to the cause of death\",\n        description=(\n            \"This procedure contributed to the cause of death of the related \"\n            \"person. If contributedToDeath is not populated, then it is unknown.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    contributedToDeath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_contributedToDeath\",\n        title=\"Extension field for ``contributedToDeath``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Extra information about the procedure\",\n        description=(\n            \"An area where general notes can be placed about this specific \"\n            \"procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"What happened following the procedure\",\n        description=(\n            \"Indicates what happened following the procedure. If the procedure \"\n            \"resulted in death, deceased date is captured on the relation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performedAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"performedAge\",\n        title=\"When the procedure was performed\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" was performed. Allows a period to support complex procedures that \"\n            \"span more than one date, and also allows for the length of the \"\n            \"procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e performed[x]\n            \"one_of_many\": \"performed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    performedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"performedDateTime\",\n        title=\"When the procedure was performed\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" was performed. Allows a period to support complex procedures that \"\n            \"span more than one date, and also allows for the length of the \"\n            \"procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e performed[x]\n            \"one_of_many\": \"performed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    performedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_performedDateTime\",\n        title=\"Extension field for ``performedDateTime``.\",\n    )\n\n    performedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"performedPeriod\",\n        title=\"When the procedure was performed\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" was performed. Allows a period to support complex procedures that \"\n            \"span more than one date, and also allows for the length of the \"\n            \"procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e performed[x]\n            \"one_of_many\": \"performed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    performedRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"performedRange\",\n        title=\"When the procedure was performed\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" was performed. Allows a period to support complex procedures that \"\n            \"span more than one date, and also allows for the length of the \"\n            \"procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e performed[x]\n            \"one_of_many\": \"performed\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    performedString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"performedString\",\n        title=\"When the procedure was performed\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" was performed. Allows a period to support complex procedures that \"\n            \"span more than one date, and also allows for the length of the \"\n            \"procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e performed[x]\n            \"one_of_many\": \"performed\",\n            \"one_of_many_required\": False,\n        },\n    )\n    performedString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_performedString\",\n        title=\"Extension field for ``performedString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``FamilyMemberHistoryProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"outcome\",\n            \"contributedToDeath\",\n            \"performedAge\",\n            \"performedRange\",\n            \"performedPeriod\",\n            \"performedString\",\n            \"performedDateTime\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``FamilyMemberHistoryProcedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"performed\": [\n                \"performedAge\",\n                \"performedDateTime\",\n                \"performedPeriod\",\n                \"performedRange\",\n                \"performedString\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/fhirprimitiveextension.py",
    "content": "from __future__ import annotations as _annotations\n\nimport typing\n\nfrom fhir_core import fhirabstractmodel\nfrom pydantic import Field, model_validator\nfrom pydantic_core import PydanticCustomError\n\nfrom . import fhirtypes\n\n__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n\n\nclass FHIRPrimitiveExtension(fhirabstractmodel.FHIRAbstractModel):\n    \"\"\"@see: https://www.hl7.org/fhir/extensibility.html\n    Extensibility feature for FHIR Primitive Data Types.\"\"\"\n\n    __resource_type__ = \"FHIRPrimitiveExtension\"\n\n    id: typing.Optional[fhirtypes.StringType] = Field(\n        default=None,\n        alias=\"id\",\n        title=\"Type `String`\",\n        description=\"Unique id for inter-element referencing\",\n        # if property is an element of this resource.\n        json_schema_extra={\"element_property\": False},\n    )\n\n    extension: typing.Optional[typing.List[fhirtypes.ExtensionType]] = Field(\n        None,\n        alias=\"extension\",\n        title=\"List of `Extension` items (represented as `dict` in JSON)\",\n        description=\"Additional content defined by implementations\",\n        # if property is an element of this resource.\n        json_schema_extra={\"element_property\": False},\n    )\n\n    @model_validator(mode=\"before\")\n    def validate_extension_or_fhir_comment_required(\n        cls, values: typing.Dict[str, typing.Any]\n    ) -> typing.Dict[str, typing.Any]:\n        \"\"\"Conditional Required Validation\"\"\"\n        extension = values.get(\"extension\", None)\n        fhir_comments = values.get(\"fhir_comments\", None)\n\n        if (\n            values.get(\"id\", None) is None\n            and extension is None\n            and fhir_comments is None\n        ):\n            raise PydanticCustomError(\n                \"model_validation_format\",\n                \"One of field value is required.\",\n                {},\n            )\n        return values\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from ``FHIRPrimitiveExtension`` according to specification,\n        with preserving original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\"]\n"
  },
  {
    "path": "fhir/resources/fhirresourcemodel.py",
    "content": "from typing import Optional, Union\n\nfrom fhir_core.fhirabstractmodel import FHIRAbstractModel\n\nfrom .fhirtypes import IdType, StringType\n\n\nclass FHIRResourceModel(FHIRAbstractModel):\n    \"\"\"Abstract base model class for all FHIR elements.\"\"\"\n\n    __resource_type__ = \"FHIRAbstractResource\"\n\n    id: Optional[Union[IdType, StringType]] = None\n\n    def relative_base(self) -> str:\n        \"\"\" \"\"\"\n        return self.__resource_type__\n\n    def relative_path(self) -> str:\n        if self.id is None:\n            return self.relative_base()\n        return \"{0}/{1}\".format(self.relative_base(), self.id)\n"
  },
  {
    "path": "fhir/resources/fhirtypes.py",
    "content": "from __future__ import annotations as _annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom fhir_core.types import (\n    Base64BinaryType,\n    BooleanType,\n    CanonicalType,\n    CodeType,\n    DateTimeType,\n    DateType,\n    DecimalType,\n    IdType,\n    InstantType,\n    Integer64Type,\n    IntegerType,\n    MarkdownType,\n    OidType,\n    PositiveIntType,\n    StringType,\n    TimeType,\n    UnsignedIntType,\n    UriType,\n    UrlType,\n    UuidType,\n    XhtmlType,\n    create_fhir_element_or_resource_type,\n    create_fhir_type,\n)\n\n__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n\n# The dependency hierarchy is circular due to Extension being referenced in FHIRPrimitiveExtension\n# which itself is referenced in every resource. Extension is also referenced in several resources and refers to several resources.\n# Pydantic fields can not use forward references as this causes the \"class not fully defined\" error at runtime: https://docs.pydantic.dev/2.12/errors/usage_errors/#class-not-fully-defined\n# To properly allow type checkers to type check, use type aliases during type checking and the create_fhir_type workaround at runtime.\nif TYPE_CHECKING:\n    from . import (\n        account,\n        activitydefinition,\n        actordefinition,\n        address,\n        administrableproductdefinition,\n        adverseevent,\n        age,\n        allergyintolerance,\n        annotation,\n        appointment,\n        appointmentresponse,\n        artifactassessment,\n        attachment,\n        auditevent,\n        availability,\n        backboneelement,\n        backbonetype,\n        base,\n        basic,\n        binary,\n        biologicallyderivedproduct,\n        biologicallyderivedproductdispense,\n        bodystructure,\n        bundle,\n        canonicalresource,\n        capabilitystatement,\n        careplan,\n        careteam,\n        chargeitem,\n        chargeitemdefinition,\n        citation,\n        claim,\n        claimresponse,\n        clinicalimpression,\n        clinicalusedefinition,\n        codeableconcept,\n        codeablereference,\n        codesystem,\n        coding,\n        communication,\n        communicationrequest,\n        compartmentdefinition,\n        composition,\n        conceptmap,\n        condition,\n        conditiondefinition,\n        consent,\n        contactdetail,\n        contactpoint,\n        contract,\n        contributor,\n        count,\n        coverage,\n        coverageeligibilityrequest,\n        coverageeligibilityresponse,\n        datarequirement,\n        datatype,\n        detectedissue,\n        device,\n        deviceassociation,\n        devicedefinition,\n        devicedispense,\n        devicemetric,\n        devicerequest,\n        deviceusage,\n        diagnosticreport,\n        distance,\n        documentreference,\n        domainresource,\n        dosage,\n        duration,\n        element,\n        elementdefinition,\n        encounter,\n        encounterhistory,\n        endpoint,\n        enrollmentrequest,\n        enrollmentresponse,\n        episodeofcare,\n        eventdefinition,\n        evidence,\n        evidencereport,\n        evidencevariable,\n        examplescenario,\n        explanationofbenefit,\n        expression,\n        extendedcontactdetail,\n        extension,\n        familymemberhistory,\n        flag,\n        formularyitem,\n        genomicstudy,\n        goal,\n        graphdefinition,\n        group,\n        guidanceresponse,\n        healthcareservice,\n        humanname,\n        identifier,\n        imagingselection,\n        imagingstudy,\n        immunization,\n        immunizationevaluation,\n        immunizationrecommendation,\n        implementationguide,\n        ingredient,\n        insuranceplan,\n        inventoryitem,\n        inventoryreport,\n        invoice,\n        library,\n        linkage,\n        list,\n        location,\n        manufactureditemdefinition,\n        marketingstatus,\n        measure,\n        measurereport,\n        medication,\n        medicationadministration,\n        medicationdispense,\n        medicationknowledge,\n        medicationrequest,\n        medicationstatement,\n        medicinalproductdefinition,\n        messagedefinition,\n        messageheader,\n        meta,\n        metadataresource,\n        molecularsequence,\n        monetarycomponent,\n        money,\n        namingsystem,\n        narrative,\n        nutritionintake,\n        nutritionorder,\n        nutritionproduct,\n        observation,\n        observationdefinition,\n        operationdefinition,\n        operationoutcome,\n        organization,\n        organizationaffiliation,\n        packagedproductdefinition,\n        parameterdefinition,\n        parameters,\n        patient,\n        paymentnotice,\n        paymentreconciliation,\n        period,\n        permission,\n        person,\n        plandefinition,\n        practitioner,\n        practitionerrole,\n        primitivetype,\n        procedure,\n        productshelflife,\n        provenance,\n        quantity,\n        questionnaire,\n        questionnaireresponse,\n        range,\n        ratio,\n        ratiorange,\n        reference,\n        regulatedauthorization,\n        relatedartifact,\n        relatedperson,\n        requestorchestration,\n        requirements,\n        researchstudy,\n        researchsubject,\n        resource,\n        riskassessment,\n        sampleddata,\n        schedule,\n        searchparameter,\n        servicerequest,\n        signature,\n        slot,\n        specimen,\n        specimendefinition,\n        structuredefinition,\n        structuremap,\n        subscription,\n        subscriptionstatus,\n        subscriptiontopic,\n        substance,\n        substancedefinition,\n        substancenucleicacid,\n        substancepolymer,\n        substanceprotein,\n        substancereferenceinformation,\n        substancesourcematerial,\n        supplydelivery,\n        supplyrequest,\n        task,\n        terminologycapabilities,\n        testplan,\n        testreport,\n        testscript,\n        timing,\n        transport,\n        triggerdefinition,\n        usagecontext,\n        valueset,\n        verificationresult,\n        virtualservicedetail,\n        visionprescription,\n    )\n    from .fhirprimitiveextension import FHIRPrimitiveExtension\n\n    FHIRPrimitiveExtensionType = FHIRPrimitiveExtension\n    AccountType = account.Account\n\n    AccountBalanceType = account.AccountBalance\n\n    AccountCoverageType = account.AccountCoverage\n\n    AccountDiagnosisType = account.AccountDiagnosis\n\n    AccountGuarantorType = account.AccountGuarantor\n\n    AccountProcedureType = account.AccountProcedure\n\n    AccountRelatedAccountType = account.AccountRelatedAccount\n\n    ActivityDefinitionType = activitydefinition.ActivityDefinition\n\n    ActivityDefinitionDynamicValueType = (\n        activitydefinition.ActivityDefinitionDynamicValue\n    )\n\n    ActivityDefinitionParticipantType = activitydefinition.ActivityDefinitionParticipant\n\n    ActorDefinitionType = actordefinition.ActorDefinition\n\n    AddressType = address.Address\n\n    AdministrableProductDefinitionType = (\n        administrableproductdefinition.AdministrableProductDefinition\n    )\n\n    AdministrableProductDefinitionPropertyType = (\n        administrableproductdefinition.AdministrableProductDefinitionProperty\n    )\n\n    AdministrableProductDefinitionRouteOfAdministrationType = (\n        administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministration\n    )\n\n    AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType = (\n        administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpecies\n    )\n\n    AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType = (\n        administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod\n    )\n\n    AdverseEventType = adverseevent.AdverseEvent\n\n    AdverseEventContributingFactorType = adverseevent.AdverseEventContributingFactor\n\n    AdverseEventMitigatingActionType = adverseevent.AdverseEventMitigatingAction\n\n    AdverseEventParticipantType = adverseevent.AdverseEventParticipant\n\n    AdverseEventPreventiveActionType = adverseevent.AdverseEventPreventiveAction\n\n    AdverseEventSupportingInfoType = adverseevent.AdverseEventSupportingInfo\n\n    AdverseEventSuspectEntityType = adverseevent.AdverseEventSuspectEntity\n\n    AdverseEventSuspectEntityCausalityType = (\n        adverseevent.AdverseEventSuspectEntityCausality\n    )\n\n    AgeType = age.Age\n\n    AllergyIntoleranceType = allergyintolerance.AllergyIntolerance\n\n    AllergyIntoleranceParticipantType = allergyintolerance.AllergyIntoleranceParticipant\n\n    AllergyIntoleranceReactionType = allergyintolerance.AllergyIntoleranceReaction\n\n    AnnotationType = annotation.Annotation\n\n    AppointmentType = appointment.Appointment\n\n    AppointmentParticipantType = appointment.AppointmentParticipant\n\n    AppointmentRecurrenceTemplateType = appointment.AppointmentRecurrenceTemplate\n\n    AppointmentRecurrenceTemplateMonthlyTemplateType = (\n        appointment.AppointmentRecurrenceTemplateMonthlyTemplate\n    )\n\n    AppointmentRecurrenceTemplateWeeklyTemplateType = (\n        appointment.AppointmentRecurrenceTemplateWeeklyTemplate\n    )\n\n    AppointmentRecurrenceTemplateYearlyTemplateType = (\n        appointment.AppointmentRecurrenceTemplateYearlyTemplate\n    )\n\n    AppointmentResponseType = appointmentresponse.AppointmentResponse\n\n    ArtifactAssessmentType = artifactassessment.ArtifactAssessment\n\n    ArtifactAssessmentContentType = artifactassessment.ArtifactAssessmentContent\n\n    AttachmentType = attachment.Attachment\n\n    AuditEventType = auditevent.AuditEvent\n\n    AuditEventAgentType = auditevent.AuditEventAgent\n\n    AuditEventEntityType = auditevent.AuditEventEntity\n\n    AuditEventEntityDetailType = auditevent.AuditEventEntityDetail\n\n    AuditEventOutcomeType = auditevent.AuditEventOutcome\n\n    AuditEventSourceType = auditevent.AuditEventSource\n\n    AvailabilityType = availability.Availability\n\n    AvailabilityAvailableTimeType = availability.AvailabilityAvailableTime\n\n    AvailabilityNotAvailableTimeType = availability.AvailabilityNotAvailableTime\n\n    BackboneElementType = backboneelement.BackboneElement\n\n    BackboneTypeType = backbonetype.BackboneType\n\n    BaseType = base.Base\n\n    BasicType = basic.Basic\n\n    BinaryType = binary.Binary\n\n    BiologicallyDerivedProductType = (\n        biologicallyderivedproduct.BiologicallyDerivedProduct\n    )\n\n    BiologicallyDerivedProductCollectionType = (\n        biologicallyderivedproduct.BiologicallyDerivedProductCollection\n    )\n\n    BiologicallyDerivedProductDispenseType = (\n        biologicallyderivedproductdispense.BiologicallyDerivedProductDispense\n    )\n\n    BiologicallyDerivedProductDispensePerformerType = (\n        biologicallyderivedproductdispense.BiologicallyDerivedProductDispensePerformer\n    )\n\n    BiologicallyDerivedProductPropertyType = (\n        biologicallyderivedproduct.BiologicallyDerivedProductProperty\n    )\n\n    BodyStructureType = bodystructure.BodyStructure\n\n    BodyStructureIncludedStructureType = bodystructure.BodyStructureIncludedStructure\n\n    BodyStructureIncludedStructureBodyLandmarkOrientationType = (\n        bodystructure.BodyStructureIncludedStructureBodyLandmarkOrientation\n    )\n\n    BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkType = (\n        bodystructure.BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmark\n    )\n\n    BundleType = bundle.Bundle\n\n    BundleEntryType = bundle.BundleEntry\n\n    BundleEntryRequestType = bundle.BundleEntryRequest\n\n    BundleEntryResponseType = bundle.BundleEntryResponse\n\n    BundleEntrySearchType = bundle.BundleEntrySearch\n\n    BundleLinkType = bundle.BundleLink\n\n    CanonicalResourceType = canonicalresource.CanonicalResource\n\n    CapabilityStatementType = capabilitystatement.CapabilityStatement\n\n    CapabilityStatementDocumentType = capabilitystatement.CapabilityStatementDocument\n\n    CapabilityStatementImplementationType = (\n        capabilitystatement.CapabilityStatementImplementation\n    )\n\n    CapabilityStatementMessagingType = capabilitystatement.CapabilityStatementMessaging\n\n    CapabilityStatementMessagingEndpointType = (\n        capabilitystatement.CapabilityStatementMessagingEndpoint\n    )\n\n    CapabilityStatementMessagingSupportedMessageType = (\n        capabilitystatement.CapabilityStatementMessagingSupportedMessage\n    )\n\n    CapabilityStatementRestType = capabilitystatement.CapabilityStatementRest\n\n    CapabilityStatementRestInteractionType = (\n        capabilitystatement.CapabilityStatementRestInteraction\n    )\n\n    CapabilityStatementRestResourceType = (\n        capabilitystatement.CapabilityStatementRestResource\n    )\n\n    CapabilityStatementRestResourceInteractionType = (\n        capabilitystatement.CapabilityStatementRestResourceInteraction\n    )\n\n    CapabilityStatementRestResourceOperationType = (\n        capabilitystatement.CapabilityStatementRestResourceOperation\n    )\n\n    CapabilityStatementRestResourceSearchParamType = (\n        capabilitystatement.CapabilityStatementRestResourceSearchParam\n    )\n\n    CapabilityStatementRestSecurityType = (\n        capabilitystatement.CapabilityStatementRestSecurity\n    )\n\n    CapabilityStatementSoftwareType = capabilitystatement.CapabilityStatementSoftware\n\n    CarePlanType = careplan.CarePlan\n\n    CarePlanActivityType = careplan.CarePlanActivity\n\n    CareTeamType = careteam.CareTeam\n\n    CareTeamParticipantType = careteam.CareTeamParticipant\n\n    ChargeItemType = chargeitem.ChargeItem\n\n    ChargeItemDefinitionType = chargeitemdefinition.ChargeItemDefinition\n\n    ChargeItemDefinitionApplicabilityType = (\n        chargeitemdefinition.ChargeItemDefinitionApplicability\n    )\n\n    ChargeItemDefinitionPropertyGroupType = (\n        chargeitemdefinition.ChargeItemDefinitionPropertyGroup\n    )\n\n    ChargeItemPerformerType = chargeitem.ChargeItemPerformer\n\n    CitationType = citation.Citation\n\n    CitationCitedArtifactType = citation.CitationCitedArtifact\n\n    CitationCitedArtifactAbstractType = citation.CitationCitedArtifactAbstract\n\n    CitationCitedArtifactClassificationType = (\n        citation.CitationCitedArtifactClassification\n    )\n\n    CitationCitedArtifactContributorshipType = (\n        citation.CitationCitedArtifactContributorship\n    )\n\n    CitationCitedArtifactContributorshipEntryType = (\n        citation.CitationCitedArtifactContributorshipEntry\n    )\n\n    CitationCitedArtifactContributorshipEntryContributionInstanceType = (\n        citation.CitationCitedArtifactContributorshipEntryContributionInstance\n    )\n\n    CitationCitedArtifactContributorshipSummaryType = (\n        citation.CitationCitedArtifactContributorshipSummary\n    )\n\n    CitationCitedArtifactPartType = citation.CitationCitedArtifactPart\n\n    CitationCitedArtifactPublicationFormType = (\n        citation.CitationCitedArtifactPublicationForm\n    )\n\n    CitationCitedArtifactPublicationFormPublishedInType = (\n        citation.CitationCitedArtifactPublicationFormPublishedIn\n    )\n\n    CitationCitedArtifactRelatesToType = citation.CitationCitedArtifactRelatesTo\n\n    CitationCitedArtifactStatusDateType = citation.CitationCitedArtifactStatusDate\n\n    CitationCitedArtifactTitleType = citation.CitationCitedArtifactTitle\n\n    CitationCitedArtifactVersionType = citation.CitationCitedArtifactVersion\n\n    CitationCitedArtifactWebLocationType = citation.CitationCitedArtifactWebLocation\n\n    CitationClassificationType = citation.CitationClassification\n\n    CitationStatusDateType = citation.CitationStatusDate\n\n    CitationSummaryType = citation.CitationSummary\n\n    ClaimType = claim.Claim\n\n    ClaimAccidentType = claim.ClaimAccident\n\n    ClaimCareTeamType = claim.ClaimCareTeam\n\n    ClaimDiagnosisType = claim.ClaimDiagnosis\n\n    ClaimEventType = claim.ClaimEvent\n\n    ClaimInsuranceType = claim.ClaimInsurance\n\n    ClaimItemType = claim.ClaimItem\n\n    ClaimItemBodySiteType = claim.ClaimItemBodySite\n\n    ClaimItemDetailType = claim.ClaimItemDetail\n\n    ClaimItemDetailSubDetailType = claim.ClaimItemDetailSubDetail\n\n    ClaimPayeeType = claim.ClaimPayee\n\n    ClaimProcedureType = claim.ClaimProcedure\n\n    ClaimRelatedType = claim.ClaimRelated\n\n    ClaimResponseType = claimresponse.ClaimResponse\n\n    ClaimResponseAddItemType = claimresponse.ClaimResponseAddItem\n\n    ClaimResponseAddItemBodySiteType = claimresponse.ClaimResponseAddItemBodySite\n\n    ClaimResponseAddItemDetailType = claimresponse.ClaimResponseAddItemDetail\n\n    ClaimResponseAddItemDetailSubDetailType = (\n        claimresponse.ClaimResponseAddItemDetailSubDetail\n    )\n\n    ClaimResponseErrorType = claimresponse.ClaimResponseError\n\n    ClaimResponseEventType = claimresponse.ClaimResponseEvent\n\n    ClaimResponseInsuranceType = claimresponse.ClaimResponseInsurance\n\n    ClaimResponseItemType = claimresponse.ClaimResponseItem\n\n    ClaimResponseItemAdjudicationType = claimresponse.ClaimResponseItemAdjudication\n\n    ClaimResponseItemDetailType = claimresponse.ClaimResponseItemDetail\n\n    ClaimResponseItemDetailSubDetailType = (\n        claimresponse.ClaimResponseItemDetailSubDetail\n    )\n\n    ClaimResponseItemReviewOutcomeType = claimresponse.ClaimResponseItemReviewOutcome\n\n    ClaimResponsePaymentType = claimresponse.ClaimResponsePayment\n\n    ClaimResponseProcessNoteType = claimresponse.ClaimResponseProcessNote\n\n    ClaimResponseTotalType = claimresponse.ClaimResponseTotal\n\n    ClaimSupportingInfoType = claim.ClaimSupportingInfo\n\n    ClinicalImpressionType = clinicalimpression.ClinicalImpression\n\n    ClinicalImpressionFindingType = clinicalimpression.ClinicalImpressionFinding\n\n    ClinicalUseDefinitionType = clinicalusedefinition.ClinicalUseDefinition\n\n    ClinicalUseDefinitionContraindicationType = (\n        clinicalusedefinition.ClinicalUseDefinitionContraindication\n    )\n\n    ClinicalUseDefinitionContraindicationOtherTherapyType = (\n        clinicalusedefinition.ClinicalUseDefinitionContraindicationOtherTherapy\n    )\n\n    ClinicalUseDefinitionIndicationType = (\n        clinicalusedefinition.ClinicalUseDefinitionIndication\n    )\n\n    ClinicalUseDefinitionInteractionType = (\n        clinicalusedefinition.ClinicalUseDefinitionInteraction\n    )\n\n    ClinicalUseDefinitionInteractionInteractantType = (\n        clinicalusedefinition.ClinicalUseDefinitionInteractionInteractant\n    )\n\n    ClinicalUseDefinitionUndesirableEffectType = (\n        clinicalusedefinition.ClinicalUseDefinitionUndesirableEffect\n    )\n\n    ClinicalUseDefinitionWarningType = (\n        clinicalusedefinition.ClinicalUseDefinitionWarning\n    )\n\n    CodeSystemType = codesystem.CodeSystem\n\n    CodeSystemConceptType = codesystem.CodeSystemConcept\n\n    CodeSystemConceptDesignationType = codesystem.CodeSystemConceptDesignation\n\n    CodeSystemConceptPropertyType = codesystem.CodeSystemConceptProperty\n\n    CodeSystemFilterType = codesystem.CodeSystemFilter\n\n    CodeSystemPropertyType = codesystem.CodeSystemProperty\n\n    CodeableConceptType = codeableconcept.CodeableConcept\n\n    CodeableReferenceType = codeablereference.CodeableReference\n\n    CodingType = coding.Coding\n\n    CommunicationType = communication.Communication\n\n    CommunicationPayloadType = communication.CommunicationPayload\n\n    CommunicationRequestType = communicationrequest.CommunicationRequest\n\n    CommunicationRequestPayloadType = communicationrequest.CommunicationRequestPayload\n\n    CompartmentDefinitionType = compartmentdefinition.CompartmentDefinition\n\n    CompartmentDefinitionResourceType = (\n        compartmentdefinition.CompartmentDefinitionResource\n    )\n\n    CompositionType = composition.Composition\n\n    CompositionAttesterType = composition.CompositionAttester\n\n    CompositionEventType = composition.CompositionEvent\n\n    CompositionSectionType = composition.CompositionSection\n\n    ConceptMapType = conceptmap.ConceptMap\n\n    ConceptMapAdditionalAttributeType = conceptmap.ConceptMapAdditionalAttribute\n\n    ConceptMapGroupType = conceptmap.ConceptMapGroup\n\n    ConceptMapGroupElementType = conceptmap.ConceptMapGroupElement\n\n    ConceptMapGroupElementTargetType = conceptmap.ConceptMapGroupElementTarget\n\n    ConceptMapGroupElementTargetDependsOnType = (\n        conceptmap.ConceptMapGroupElementTargetDependsOn\n    )\n\n    ConceptMapGroupElementTargetPropertyType = (\n        conceptmap.ConceptMapGroupElementTargetProperty\n    )\n\n    ConceptMapGroupUnmappedType = conceptmap.ConceptMapGroupUnmapped\n\n    ConceptMapPropertyType = conceptmap.ConceptMapProperty\n\n    ConditionType = condition.Condition\n\n    ConditionDefinitionType = conditiondefinition.ConditionDefinition\n\n    ConditionDefinitionMedicationType = (\n        conditiondefinition.ConditionDefinitionMedication\n    )\n\n    ConditionDefinitionObservationType = (\n        conditiondefinition.ConditionDefinitionObservation\n    )\n\n    ConditionDefinitionPlanType = conditiondefinition.ConditionDefinitionPlan\n\n    ConditionDefinitionPreconditionType = (\n        conditiondefinition.ConditionDefinitionPrecondition\n    )\n\n    ConditionDefinitionQuestionnaireType = (\n        conditiondefinition.ConditionDefinitionQuestionnaire\n    )\n\n    ConditionParticipantType = condition.ConditionParticipant\n\n    ConditionStageType = condition.ConditionStage\n\n    ConsentType = consent.Consent\n\n    ConsentPolicyBasisType = consent.ConsentPolicyBasis\n\n    ConsentProvisionType = consent.ConsentProvision\n\n    ConsentProvisionActorType = consent.ConsentProvisionActor\n\n    ConsentProvisionDataType = consent.ConsentProvisionData\n\n    ConsentVerificationType = consent.ConsentVerification\n\n    ContactDetailType = contactdetail.ContactDetail\n\n    ContactPointType = contactpoint.ContactPoint\n\n    ContractType = contract.Contract\n\n    ContractContentDefinitionType = contract.ContractContentDefinition\n\n    ContractFriendlyType = contract.ContractFriendly\n\n    ContractLegalType = contract.ContractLegal\n\n    ContractRuleType = contract.ContractRule\n\n    ContractSignerType = contract.ContractSigner\n\n    ContractTermType = contract.ContractTerm\n\n    ContractTermActionType = contract.ContractTermAction\n\n    ContractTermActionSubjectType = contract.ContractTermActionSubject\n\n    ContractTermAssetType = contract.ContractTermAsset\n\n    ContractTermAssetContextType = contract.ContractTermAssetContext\n\n    ContractTermAssetValuedItemType = contract.ContractTermAssetValuedItem\n\n    ContractTermOfferType = contract.ContractTermOffer\n\n    ContractTermOfferAnswerType = contract.ContractTermOfferAnswer\n\n    ContractTermOfferPartyType = contract.ContractTermOfferParty\n\n    ContractTermSecurityLabelType = contract.ContractTermSecurityLabel\n\n    ContributorType = contributor.Contributor\n\n    CountType = count.Count\n\n    CoverageType = coverage.Coverage\n\n    CoverageClassType = coverage.CoverageClass\n\n    CoverageCostToBeneficiaryType = coverage.CoverageCostToBeneficiary\n\n    CoverageCostToBeneficiaryExceptionType = coverage.CoverageCostToBeneficiaryException\n\n    CoverageEligibilityRequestType = (\n        coverageeligibilityrequest.CoverageEligibilityRequest\n    )\n\n    CoverageEligibilityRequestEventType = (\n        coverageeligibilityrequest.CoverageEligibilityRequestEvent\n    )\n\n    CoverageEligibilityRequestInsuranceType = (\n        coverageeligibilityrequest.CoverageEligibilityRequestInsurance\n    )\n\n    CoverageEligibilityRequestItemType = (\n        coverageeligibilityrequest.CoverageEligibilityRequestItem\n    )\n\n    CoverageEligibilityRequestItemDiagnosisType = (\n        coverageeligibilityrequest.CoverageEligibilityRequestItemDiagnosis\n    )\n\n    CoverageEligibilityRequestSupportingInfoType = (\n        coverageeligibilityrequest.CoverageEligibilityRequestSupportingInfo\n    )\n\n    CoverageEligibilityResponseType = (\n        coverageeligibilityresponse.CoverageEligibilityResponse\n    )\n\n    CoverageEligibilityResponseErrorType = (\n        coverageeligibilityresponse.CoverageEligibilityResponseError\n    )\n\n    CoverageEligibilityResponseEventType = (\n        coverageeligibilityresponse.CoverageEligibilityResponseEvent\n    )\n\n    CoverageEligibilityResponseInsuranceType = (\n        coverageeligibilityresponse.CoverageEligibilityResponseInsurance\n    )\n\n    CoverageEligibilityResponseInsuranceItemType = (\n        coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItem\n    )\n\n    CoverageEligibilityResponseInsuranceItemBenefitType = (\n        coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItemBenefit\n    )\n\n    CoveragePaymentByType = coverage.CoveragePaymentBy\n\n    DataRequirementType = datarequirement.DataRequirement\n\n    DataRequirementCodeFilterType = datarequirement.DataRequirementCodeFilter\n\n    DataRequirementDateFilterType = datarequirement.DataRequirementDateFilter\n\n    DataRequirementSortType = datarequirement.DataRequirementSort\n\n    DataRequirementValueFilterType = datarequirement.DataRequirementValueFilter\n\n    DataTypeType = datatype.DataType\n\n    DetectedIssueType = detectedissue.DetectedIssue\n\n    DetectedIssueEvidenceType = detectedissue.DetectedIssueEvidence\n\n    DetectedIssueMitigationType = detectedissue.DetectedIssueMitigation\n\n    DeviceType = device.Device\n\n    DeviceAssociationType = deviceassociation.DeviceAssociation\n\n    DeviceAssociationOperationType = deviceassociation.DeviceAssociationOperation\n\n    DeviceConformsToType = device.DeviceConformsTo\n\n    DeviceDefinitionType = devicedefinition.DeviceDefinition\n\n    DeviceDefinitionChargeItemType = devicedefinition.DeviceDefinitionChargeItem\n\n    DeviceDefinitionClassificationType = devicedefinition.DeviceDefinitionClassification\n\n    DeviceDefinitionConformsToType = devicedefinition.DeviceDefinitionConformsTo\n\n    DeviceDefinitionCorrectiveActionType = (\n        devicedefinition.DeviceDefinitionCorrectiveAction\n    )\n\n    DeviceDefinitionDeviceNameType = devicedefinition.DeviceDefinitionDeviceName\n\n    DeviceDefinitionGuidelineType = devicedefinition.DeviceDefinitionGuideline\n\n    DeviceDefinitionHasPartType = devicedefinition.DeviceDefinitionHasPart\n\n    DeviceDefinitionLinkType = devicedefinition.DeviceDefinitionLink\n\n    DeviceDefinitionMaterialType = devicedefinition.DeviceDefinitionMaterial\n\n    DeviceDefinitionPackagingType = devicedefinition.DeviceDefinitionPackaging\n\n    DeviceDefinitionPackagingDistributorType = (\n        devicedefinition.DeviceDefinitionPackagingDistributor\n    )\n\n    DeviceDefinitionPropertyType = devicedefinition.DeviceDefinitionProperty\n\n    DeviceDefinitionRegulatoryIdentifierType = (\n        devicedefinition.DeviceDefinitionRegulatoryIdentifier\n    )\n\n    DeviceDefinitionUdiDeviceIdentifierType = (\n        devicedefinition.DeviceDefinitionUdiDeviceIdentifier\n    )\n\n    DeviceDefinitionUdiDeviceIdentifierMarketDistributionType = (\n        devicedefinition.DeviceDefinitionUdiDeviceIdentifierMarketDistribution\n    )\n\n    DeviceDefinitionVersionType = devicedefinition.DeviceDefinitionVersion\n\n    DeviceDispenseType = devicedispense.DeviceDispense\n\n    DeviceDispensePerformerType = devicedispense.DeviceDispensePerformer\n\n    DeviceMetricType = devicemetric.DeviceMetric\n\n    DeviceMetricCalibrationType = devicemetric.DeviceMetricCalibration\n\n    DeviceNameType = device.DeviceName\n\n    DevicePropertyType = device.DeviceProperty\n\n    DeviceRequestType = devicerequest.DeviceRequest\n\n    DeviceRequestParameterType = devicerequest.DeviceRequestParameter\n\n    DeviceUdiCarrierType = device.DeviceUdiCarrier\n\n    DeviceUsageType = deviceusage.DeviceUsage\n\n    DeviceUsageAdherenceType = deviceusage.DeviceUsageAdherence\n\n    DeviceVersionType = device.DeviceVersion\n\n    DiagnosticReportType = diagnosticreport.DiagnosticReport\n\n    DiagnosticReportMediaType = diagnosticreport.DiagnosticReportMedia\n\n    DiagnosticReportSupportingInfoType = diagnosticreport.DiagnosticReportSupportingInfo\n\n    DistanceType = distance.Distance\n\n    DocumentReferenceType = documentreference.DocumentReference\n\n    DocumentReferenceAttesterType = documentreference.DocumentReferenceAttester\n\n    DocumentReferenceContentType = documentreference.DocumentReferenceContent\n\n    DocumentReferenceContentProfileType = (\n        documentreference.DocumentReferenceContentProfile\n    )\n\n    DocumentReferenceRelatesToType = documentreference.DocumentReferenceRelatesTo\n\n    DomainResourceType = domainresource.DomainResource\n\n    DosageType = dosage.Dosage\n\n    DosageDoseAndRateType = dosage.DosageDoseAndRate\n\n    DurationType = duration.Duration\n\n    ElementType = element.Element\n\n    ElementDefinitionType = elementdefinition.ElementDefinition\n\n    ElementDefinitionBaseType = elementdefinition.ElementDefinitionBase\n\n    ElementDefinitionBindingType = elementdefinition.ElementDefinitionBinding\n\n    ElementDefinitionBindingAdditionalType = (\n        elementdefinition.ElementDefinitionBindingAdditional\n    )\n\n    ElementDefinitionConstraintType = elementdefinition.ElementDefinitionConstraint\n\n    ElementDefinitionExampleType = elementdefinition.ElementDefinitionExample\n\n    ElementDefinitionMappingType = elementdefinition.ElementDefinitionMapping\n\n    ElementDefinitionSlicingType = elementdefinition.ElementDefinitionSlicing\n\n    ElementDefinitionSlicingDiscriminatorType = (\n        elementdefinition.ElementDefinitionSlicingDiscriminator\n    )\n\n    ElementDefinitionTypeType = elementdefinition.ElementDefinitionType\n\n    EncounterType = encounter.Encounter\n\n    EncounterAdmissionType = encounter.EncounterAdmission\n\n    EncounterDiagnosisType = encounter.EncounterDiagnosis\n\n    EncounterHistoryType = encounterhistory.EncounterHistory\n\n    EncounterHistoryLocationType = encounterhistory.EncounterHistoryLocation\n\n    EncounterLocationType = encounter.EncounterLocation\n\n    EncounterParticipantType = encounter.EncounterParticipant\n\n    EncounterReasonType = encounter.EncounterReason\n\n    EndpointType = endpoint.Endpoint\n\n    EndpointPayloadType = endpoint.EndpointPayload\n\n    EnrollmentRequestType = enrollmentrequest.EnrollmentRequest\n\n    EnrollmentResponseType = enrollmentresponse.EnrollmentResponse\n\n    EpisodeOfCareType = episodeofcare.EpisodeOfCare\n\n    EpisodeOfCareDiagnosisType = episodeofcare.EpisodeOfCareDiagnosis\n\n    EpisodeOfCareReasonType = episodeofcare.EpisodeOfCareReason\n\n    EpisodeOfCareStatusHistoryType = episodeofcare.EpisodeOfCareStatusHistory\n\n    EventDefinitionType = eventdefinition.EventDefinition\n\n    EvidenceType = evidence.Evidence\n\n    EvidenceCertaintyType = evidence.EvidenceCertainty\n\n    EvidenceReportType = evidencereport.EvidenceReport\n\n    EvidenceReportRelatesToType = evidencereport.EvidenceReportRelatesTo\n\n    EvidenceReportRelatesToTargetType = evidencereport.EvidenceReportRelatesToTarget\n\n    EvidenceReportSectionType = evidencereport.EvidenceReportSection\n\n    EvidenceReportSubjectType = evidencereport.EvidenceReportSubject\n\n    EvidenceReportSubjectCharacteristicType = (\n        evidencereport.EvidenceReportSubjectCharacteristic\n    )\n\n    EvidenceStatisticType = evidence.EvidenceStatistic\n\n    EvidenceStatisticAttributeEstimateType = evidence.EvidenceStatisticAttributeEstimate\n\n    EvidenceStatisticModelCharacteristicType = (\n        evidence.EvidenceStatisticModelCharacteristic\n    )\n\n    EvidenceStatisticModelCharacteristicVariableType = (\n        evidence.EvidenceStatisticModelCharacteristicVariable\n    )\n\n    EvidenceStatisticSampleSizeType = evidence.EvidenceStatisticSampleSize\n\n    EvidenceVariableType = evidencevariable.EvidenceVariable\n\n    EvidenceVariableCategoryType = evidencevariable.EvidenceVariableCategory\n\n    EvidenceVariableCharacteristicType = evidencevariable.EvidenceVariableCharacteristic\n\n    EvidenceVariableCharacteristicDefinitionByCombinationType = (\n        evidencevariable.EvidenceVariableCharacteristicDefinitionByCombination\n    )\n\n    EvidenceVariableCharacteristicDefinitionByTypeAndValueType = (\n        evidencevariable.EvidenceVariableCharacteristicDefinitionByTypeAndValue\n    )\n\n    EvidenceVariableCharacteristicTimeFromEventType = (\n        evidencevariable.EvidenceVariableCharacteristicTimeFromEvent\n    )\n\n    EvidenceVariableDefinitionType = evidence.EvidenceVariableDefinition\n\n    ExampleScenarioType = examplescenario.ExampleScenario\n\n    ExampleScenarioActorType = examplescenario.ExampleScenarioActor\n\n    ExampleScenarioInstanceType = examplescenario.ExampleScenarioInstance\n\n    ExampleScenarioInstanceContainedInstanceType = (\n        examplescenario.ExampleScenarioInstanceContainedInstance\n    )\n\n    ExampleScenarioInstanceVersionType = examplescenario.ExampleScenarioInstanceVersion\n\n    ExampleScenarioProcessType = examplescenario.ExampleScenarioProcess\n\n    ExampleScenarioProcessStepType = examplescenario.ExampleScenarioProcessStep\n\n    ExampleScenarioProcessStepAlternativeType = (\n        examplescenario.ExampleScenarioProcessStepAlternative\n    )\n\n    ExampleScenarioProcessStepOperationType = (\n        examplescenario.ExampleScenarioProcessStepOperation\n    )\n\n    ExplanationOfBenefitType = explanationofbenefit.ExplanationOfBenefit\n\n    ExplanationOfBenefitAccidentType = explanationofbenefit.ExplanationOfBenefitAccident\n\n    ExplanationOfBenefitAddItemType = explanationofbenefit.ExplanationOfBenefitAddItem\n\n    ExplanationOfBenefitAddItemBodySiteType = (\n        explanationofbenefit.ExplanationOfBenefitAddItemBodySite\n    )\n\n    ExplanationOfBenefitAddItemDetailType = (\n        explanationofbenefit.ExplanationOfBenefitAddItemDetail\n    )\n\n    ExplanationOfBenefitAddItemDetailSubDetailType = (\n        explanationofbenefit.ExplanationOfBenefitAddItemDetailSubDetail\n    )\n\n    ExplanationOfBenefitBenefitBalanceType = (\n        explanationofbenefit.ExplanationOfBenefitBenefitBalance\n    )\n\n    ExplanationOfBenefitBenefitBalanceFinancialType = (\n        explanationofbenefit.ExplanationOfBenefitBenefitBalanceFinancial\n    )\n\n    ExplanationOfBenefitCareTeamType = explanationofbenefit.ExplanationOfBenefitCareTeam\n\n    ExplanationOfBenefitDiagnosisType = (\n        explanationofbenefit.ExplanationOfBenefitDiagnosis\n    )\n\n    ExplanationOfBenefitEventType = explanationofbenefit.ExplanationOfBenefitEvent\n\n    ExplanationOfBenefitInsuranceType = (\n        explanationofbenefit.ExplanationOfBenefitInsurance\n    )\n\n    ExplanationOfBenefitItemType = explanationofbenefit.ExplanationOfBenefitItem\n\n    ExplanationOfBenefitItemAdjudicationType = (\n        explanationofbenefit.ExplanationOfBenefitItemAdjudication\n    )\n\n    ExplanationOfBenefitItemBodySiteType = (\n        explanationofbenefit.ExplanationOfBenefitItemBodySite\n    )\n\n    ExplanationOfBenefitItemDetailType = (\n        explanationofbenefit.ExplanationOfBenefitItemDetail\n    )\n\n    ExplanationOfBenefitItemDetailSubDetailType = (\n        explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail\n    )\n\n    ExplanationOfBenefitItemReviewOutcomeType = (\n        explanationofbenefit.ExplanationOfBenefitItemReviewOutcome\n    )\n\n    ExplanationOfBenefitPayeeType = explanationofbenefit.ExplanationOfBenefitPayee\n\n    ExplanationOfBenefitPaymentType = explanationofbenefit.ExplanationOfBenefitPayment\n\n    ExplanationOfBenefitProcedureType = (\n        explanationofbenefit.ExplanationOfBenefitProcedure\n    )\n\n    ExplanationOfBenefitProcessNoteType = (\n        explanationofbenefit.ExplanationOfBenefitProcessNote\n    )\n\n    ExplanationOfBenefitRelatedType = explanationofbenefit.ExplanationOfBenefitRelated\n\n    ExplanationOfBenefitSupportingInfoType = (\n        explanationofbenefit.ExplanationOfBenefitSupportingInfo\n    )\n\n    ExplanationOfBenefitTotalType = explanationofbenefit.ExplanationOfBenefitTotal\n\n    ExpressionType = expression.Expression\n\n    ExtendedContactDetailType = extendedcontactdetail.ExtendedContactDetail\n\n    ExtensionType = extension.Extension\n\n    FamilyMemberHistoryType = familymemberhistory.FamilyMemberHistory\n\n    FamilyMemberHistoryConditionType = familymemberhistory.FamilyMemberHistoryCondition\n\n    FamilyMemberHistoryParticipantType = (\n        familymemberhistory.FamilyMemberHistoryParticipant\n    )\n\n    FamilyMemberHistoryProcedureType = familymemberhistory.FamilyMemberHistoryProcedure\n\n    FlagType = flag.Flag\n\n    FormularyItemType = formularyitem.FormularyItem\n\n    GenomicStudyType = genomicstudy.GenomicStudy\n\n    GenomicStudyAnalysisType = genomicstudy.GenomicStudyAnalysis\n\n    GenomicStudyAnalysisDeviceType = genomicstudy.GenomicStudyAnalysisDevice\n\n    GenomicStudyAnalysisInputType = genomicstudy.GenomicStudyAnalysisInput\n\n    GenomicStudyAnalysisOutputType = genomicstudy.GenomicStudyAnalysisOutput\n\n    GenomicStudyAnalysisPerformerType = genomicstudy.GenomicStudyAnalysisPerformer\n\n    GoalType = goal.Goal\n\n    GoalTargetType = goal.GoalTarget\n\n    GraphDefinitionType = graphdefinition.GraphDefinition\n\n    GraphDefinitionLinkType = graphdefinition.GraphDefinitionLink\n\n    GraphDefinitionLinkCompartmentType = graphdefinition.GraphDefinitionLinkCompartment\n\n    GraphDefinitionNodeType = graphdefinition.GraphDefinitionNode\n\n    GroupType = group.Group\n\n    GroupCharacteristicType = group.GroupCharacteristic\n\n    GroupMemberType = group.GroupMember\n\n    GuidanceResponseType = guidanceresponse.GuidanceResponse\n\n    HealthcareServiceType = healthcareservice.HealthcareService\n\n    HealthcareServiceEligibilityType = healthcareservice.HealthcareServiceEligibility\n\n    HumanNameType = humanname.HumanName\n\n    IdentifierType = identifier.Identifier\n\n    ImagingSelectionType = imagingselection.ImagingSelection\n\n    ImagingSelectionInstanceType = imagingselection.ImagingSelectionInstance\n\n    ImagingSelectionInstanceImageRegion2DType = (\n        imagingselection.ImagingSelectionInstanceImageRegion2D\n    )\n\n    ImagingSelectionInstanceImageRegion3DType = (\n        imagingselection.ImagingSelectionInstanceImageRegion3D\n    )\n\n    ImagingSelectionPerformerType = imagingselection.ImagingSelectionPerformer\n\n    ImagingStudyType = imagingstudy.ImagingStudy\n\n    ImagingStudySeriesType = imagingstudy.ImagingStudySeries\n\n    ImagingStudySeriesInstanceType = imagingstudy.ImagingStudySeriesInstance\n\n    ImagingStudySeriesPerformerType = imagingstudy.ImagingStudySeriesPerformer\n\n    ImmunizationType = immunization.Immunization\n\n    ImmunizationEvaluationType = immunizationevaluation.ImmunizationEvaluation\n\n    ImmunizationPerformerType = immunization.ImmunizationPerformer\n\n    ImmunizationProgramEligibilityType = immunization.ImmunizationProgramEligibility\n\n    ImmunizationProtocolAppliedType = immunization.ImmunizationProtocolApplied\n\n    ImmunizationReactionType = immunization.ImmunizationReaction\n\n    ImmunizationRecommendationType = (\n        immunizationrecommendation.ImmunizationRecommendation\n    )\n\n    ImmunizationRecommendationRecommendationType = (\n        immunizationrecommendation.ImmunizationRecommendationRecommendation\n    )\n\n    ImmunizationRecommendationRecommendationDateCriterionType = (\n        immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion\n    )\n\n    ImplementationGuideType = implementationguide.ImplementationGuide\n\n    ImplementationGuideDefinitionType = (\n        implementationguide.ImplementationGuideDefinition\n    )\n\n    ImplementationGuideDefinitionGroupingType = (\n        implementationguide.ImplementationGuideDefinitionGrouping\n    )\n\n    ImplementationGuideDefinitionPageType = (\n        implementationguide.ImplementationGuideDefinitionPage\n    )\n\n    ImplementationGuideDefinitionParameterType = (\n        implementationguide.ImplementationGuideDefinitionParameter\n    )\n\n    ImplementationGuideDefinitionResourceType = (\n        implementationguide.ImplementationGuideDefinitionResource\n    )\n\n    ImplementationGuideDefinitionTemplateType = (\n        implementationguide.ImplementationGuideDefinitionTemplate\n    )\n\n    ImplementationGuideDependsOnType = implementationguide.ImplementationGuideDependsOn\n\n    ImplementationGuideGlobalType = implementationguide.ImplementationGuideGlobal\n\n    ImplementationGuideManifestType = implementationguide.ImplementationGuideManifest\n\n    ImplementationGuideManifestPageType = (\n        implementationguide.ImplementationGuideManifestPage\n    )\n\n    ImplementationGuideManifestResourceType = (\n        implementationguide.ImplementationGuideManifestResource\n    )\n\n    IngredientType = ingredient.Ingredient\n\n    IngredientManufacturerType = ingredient.IngredientManufacturer\n\n    IngredientSubstanceType = ingredient.IngredientSubstance\n\n    IngredientSubstanceStrengthType = ingredient.IngredientSubstanceStrength\n\n    IngredientSubstanceStrengthReferenceStrengthType = (\n        ingredient.IngredientSubstanceStrengthReferenceStrength\n    )\n\n    InsurancePlanType = insuranceplan.InsurancePlan\n\n    InsurancePlanCoverageType = insuranceplan.InsurancePlanCoverage\n\n    InsurancePlanCoverageBenefitType = insuranceplan.InsurancePlanCoverageBenefit\n\n    InsurancePlanCoverageBenefitLimitType = (\n        insuranceplan.InsurancePlanCoverageBenefitLimit\n    )\n\n    InsurancePlanPlanType = insuranceplan.InsurancePlanPlan\n\n    InsurancePlanPlanGeneralCostType = insuranceplan.InsurancePlanPlanGeneralCost\n\n    InsurancePlanPlanSpecificCostType = insuranceplan.InsurancePlanPlanSpecificCost\n\n    InsurancePlanPlanSpecificCostBenefitType = (\n        insuranceplan.InsurancePlanPlanSpecificCostBenefit\n    )\n\n    InsurancePlanPlanSpecificCostBenefitCostType = (\n        insuranceplan.InsurancePlanPlanSpecificCostBenefitCost\n    )\n\n    InventoryItemType = inventoryitem.InventoryItem\n\n    InventoryItemAssociationType = inventoryitem.InventoryItemAssociation\n\n    InventoryItemCharacteristicType = inventoryitem.InventoryItemCharacteristic\n\n    InventoryItemDescriptionType = inventoryitem.InventoryItemDescription\n\n    InventoryItemInstanceType = inventoryitem.InventoryItemInstance\n\n    InventoryItemNameType = inventoryitem.InventoryItemName\n\n    InventoryItemResponsibleOrganizationType = (\n        inventoryitem.InventoryItemResponsibleOrganization\n    )\n\n    InventoryReportType = inventoryreport.InventoryReport\n\n    InventoryReportInventoryListingType = (\n        inventoryreport.InventoryReportInventoryListing\n    )\n\n    InventoryReportInventoryListingItemType = (\n        inventoryreport.InventoryReportInventoryListingItem\n    )\n\n    InvoiceType = invoice.Invoice\n\n    InvoiceLineItemType = invoice.InvoiceLineItem\n\n    InvoiceParticipantType = invoice.InvoiceParticipant\n\n    LibraryType = library.Library\n\n    LinkageType = linkage.Linkage\n\n    LinkageItemType = linkage.LinkageItem\n\n    ListType = list.List\n\n    ListEntryType = list.ListEntry\n\n    LocationType = location.Location\n\n    LocationPositionType = location.LocationPosition\n\n    ManufacturedItemDefinitionType = (\n        manufactureditemdefinition.ManufacturedItemDefinition\n    )\n\n    ManufacturedItemDefinitionComponentType = (\n        manufactureditemdefinition.ManufacturedItemDefinitionComponent\n    )\n\n    ManufacturedItemDefinitionComponentConstituentType = (\n        manufactureditemdefinition.ManufacturedItemDefinitionComponentConstituent\n    )\n\n    ManufacturedItemDefinitionPropertyType = (\n        manufactureditemdefinition.ManufacturedItemDefinitionProperty\n    )\n\n    MarketingStatusType = marketingstatus.MarketingStatus\n\n    MeasureType = measure.Measure\n\n    MeasureGroupType = measure.MeasureGroup\n\n    MeasureGroupPopulationType = measure.MeasureGroupPopulation\n\n    MeasureGroupStratifierType = measure.MeasureGroupStratifier\n\n    MeasureGroupStratifierComponentType = measure.MeasureGroupStratifierComponent\n\n    MeasureReportType = measurereport.MeasureReport\n\n    MeasureReportGroupType = measurereport.MeasureReportGroup\n\n    MeasureReportGroupPopulationType = measurereport.MeasureReportGroupPopulation\n\n    MeasureReportGroupStratifierType = measurereport.MeasureReportGroupStratifier\n\n    MeasureReportGroupStratifierStratumType = (\n        measurereport.MeasureReportGroupStratifierStratum\n    )\n\n    MeasureReportGroupStratifierStratumComponentType = (\n        measurereport.MeasureReportGroupStratifierStratumComponent\n    )\n\n    MeasureReportGroupStratifierStratumPopulationType = (\n        measurereport.MeasureReportGroupStratifierStratumPopulation\n    )\n\n    MeasureSupplementalDataType = measure.MeasureSupplementalData\n\n    MeasureTermType = measure.MeasureTerm\n\n    MedicationType = medication.Medication\n\n    MedicationAdministrationType = medicationadministration.MedicationAdministration\n\n    MedicationAdministrationDosageType = (\n        medicationadministration.MedicationAdministrationDosage\n    )\n\n    MedicationAdministrationPerformerType = (\n        medicationadministration.MedicationAdministrationPerformer\n    )\n\n    MedicationBatchType = medication.MedicationBatch\n\n    MedicationDispenseType = medicationdispense.MedicationDispense\n\n    MedicationDispensePerformerType = medicationdispense.MedicationDispensePerformer\n\n    MedicationDispenseSubstitutionType = (\n        medicationdispense.MedicationDispenseSubstitution\n    )\n\n    MedicationIngredientType = medication.MedicationIngredient\n\n    MedicationKnowledgeType = medicationknowledge.MedicationKnowledge\n\n    MedicationKnowledgeCostType = medicationknowledge.MedicationKnowledgeCost\n\n    MedicationKnowledgeDefinitionalType = (\n        medicationknowledge.MedicationKnowledgeDefinitional\n    )\n\n    MedicationKnowledgeDefinitionalDrugCharacteristicType = (\n        medicationknowledge.MedicationKnowledgeDefinitionalDrugCharacteristic\n    )\n\n    MedicationKnowledgeDefinitionalIngredientType = (\n        medicationknowledge.MedicationKnowledgeDefinitionalIngredient\n    )\n\n    MedicationKnowledgeIndicationGuidelineType = (\n        medicationknowledge.MedicationKnowledgeIndicationGuideline\n    )\n\n    MedicationKnowledgeIndicationGuidelineDosingGuidelineType = (\n        medicationknowledge.MedicationKnowledgeIndicationGuidelineDosingGuideline\n    )\n\n    MedicationKnowledgeIndicationGuidelineDosingGuidelineDosageType = (\n        medicationknowledge.MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage\n    )\n\n    MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristicType = (\n        medicationknowledge.MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristic\n    )\n\n    MedicationKnowledgeMedicineClassificationType = (\n        medicationknowledge.MedicationKnowledgeMedicineClassification\n    )\n\n    MedicationKnowledgeMonitoringProgramType = (\n        medicationknowledge.MedicationKnowledgeMonitoringProgram\n    )\n\n    MedicationKnowledgeMonographType = medicationknowledge.MedicationKnowledgeMonograph\n\n    MedicationKnowledgePackagingType = medicationknowledge.MedicationKnowledgePackaging\n\n    MedicationKnowledgeRegulatoryType = (\n        medicationknowledge.MedicationKnowledgeRegulatory\n    )\n\n    MedicationKnowledgeRegulatoryMaxDispenseType = (\n        medicationknowledge.MedicationKnowledgeRegulatoryMaxDispense\n    )\n\n    MedicationKnowledgeRegulatorySubstitutionType = (\n        medicationknowledge.MedicationKnowledgeRegulatorySubstitution\n    )\n\n    MedicationKnowledgeRelatedMedicationKnowledgeType = (\n        medicationknowledge.MedicationKnowledgeRelatedMedicationKnowledge\n    )\n\n    MedicationKnowledgeStorageGuidelineType = (\n        medicationknowledge.MedicationKnowledgeStorageGuideline\n    )\n\n    MedicationKnowledgeStorageGuidelineEnvironmentalSettingType = (\n        medicationknowledge.MedicationKnowledgeStorageGuidelineEnvironmentalSetting\n    )\n\n    MedicationRequestType = medicationrequest.MedicationRequest\n\n    MedicationRequestDispenseRequestType = (\n        medicationrequest.MedicationRequestDispenseRequest\n    )\n\n    MedicationRequestDispenseRequestInitialFillType = (\n        medicationrequest.MedicationRequestDispenseRequestInitialFill\n    )\n\n    MedicationRequestSubstitutionType = medicationrequest.MedicationRequestSubstitution\n\n    MedicationStatementType = medicationstatement.MedicationStatement\n\n    MedicationStatementAdherenceType = medicationstatement.MedicationStatementAdherence\n\n    MedicinalProductDefinitionType = (\n        medicinalproductdefinition.MedicinalProductDefinition\n    )\n\n    MedicinalProductDefinitionCharacteristicType = (\n        medicinalproductdefinition.MedicinalProductDefinitionCharacteristic\n    )\n\n    MedicinalProductDefinitionContactType = (\n        medicinalproductdefinition.MedicinalProductDefinitionContact\n    )\n\n    MedicinalProductDefinitionCrossReferenceType = (\n        medicinalproductdefinition.MedicinalProductDefinitionCrossReference\n    )\n\n    MedicinalProductDefinitionNameType = (\n        medicinalproductdefinition.MedicinalProductDefinitionName\n    )\n\n    MedicinalProductDefinitionNamePartType = (\n        medicinalproductdefinition.MedicinalProductDefinitionNamePart\n    )\n\n    MedicinalProductDefinitionNameUsageType = (\n        medicinalproductdefinition.MedicinalProductDefinitionNameUsage\n    )\n\n    MedicinalProductDefinitionOperationType = (\n        medicinalproductdefinition.MedicinalProductDefinitionOperation\n    )\n\n    MessageDefinitionType = messagedefinition.MessageDefinition\n\n    MessageDefinitionAllowedResponseType = (\n        messagedefinition.MessageDefinitionAllowedResponse\n    )\n\n    MessageDefinitionFocusType = messagedefinition.MessageDefinitionFocus\n\n    MessageHeaderType = messageheader.MessageHeader\n\n    MessageHeaderDestinationType = messageheader.MessageHeaderDestination\n\n    MessageHeaderResponseType = messageheader.MessageHeaderResponse\n\n    MessageHeaderSourceType = messageheader.MessageHeaderSource\n\n    MetaType = meta.Meta\n\n    MetadataResourceType = metadataresource.MetadataResource\n\n    MolecularSequenceType = molecularsequence.MolecularSequence\n\n    MolecularSequenceRelativeType = molecularsequence.MolecularSequenceRelative\n\n    MolecularSequenceRelativeEditType = molecularsequence.MolecularSequenceRelativeEdit\n\n    MolecularSequenceRelativeStartingSequenceType = (\n        molecularsequence.MolecularSequenceRelativeStartingSequence\n    )\n\n    MonetaryComponentType = monetarycomponent.MonetaryComponent\n\n    MoneyType = money.Money\n\n    NamingSystemType = namingsystem.NamingSystem\n\n    NamingSystemUniqueIdType = namingsystem.NamingSystemUniqueId\n\n    NarrativeType = narrative.Narrative\n\n    NutritionIntakeType = nutritionintake.NutritionIntake\n\n    NutritionIntakeConsumedItemType = nutritionintake.NutritionIntakeConsumedItem\n\n    NutritionIntakeIngredientLabelType = nutritionintake.NutritionIntakeIngredientLabel\n\n    NutritionIntakePerformerType = nutritionintake.NutritionIntakePerformer\n\n    NutritionOrderType = nutritionorder.NutritionOrder\n\n    NutritionOrderEnteralFormulaType = nutritionorder.NutritionOrderEnteralFormula\n\n    NutritionOrderEnteralFormulaAdditiveType = (\n        nutritionorder.NutritionOrderEnteralFormulaAdditive\n    )\n\n    NutritionOrderEnteralFormulaAdministrationType = (\n        nutritionorder.NutritionOrderEnteralFormulaAdministration\n    )\n\n    NutritionOrderEnteralFormulaAdministrationScheduleType = (\n        nutritionorder.NutritionOrderEnteralFormulaAdministrationSchedule\n    )\n\n    NutritionOrderOralDietType = nutritionorder.NutritionOrderOralDiet\n\n    NutritionOrderOralDietNutrientType = nutritionorder.NutritionOrderOralDietNutrient\n\n    NutritionOrderOralDietScheduleType = nutritionorder.NutritionOrderOralDietSchedule\n\n    NutritionOrderOralDietTextureType = nutritionorder.NutritionOrderOralDietTexture\n\n    NutritionOrderSupplementType = nutritionorder.NutritionOrderSupplement\n\n    NutritionOrderSupplementScheduleType = (\n        nutritionorder.NutritionOrderSupplementSchedule\n    )\n\n    NutritionProductType = nutritionproduct.NutritionProduct\n\n    NutritionProductCharacteristicType = nutritionproduct.NutritionProductCharacteristic\n\n    NutritionProductIngredientType = nutritionproduct.NutritionProductIngredient\n\n    NutritionProductInstanceType = nutritionproduct.NutritionProductInstance\n\n    NutritionProductNutrientType = nutritionproduct.NutritionProductNutrient\n\n    ObservationType = observation.Observation\n\n    ObservationComponentType = observation.ObservationComponent\n\n    ObservationDefinitionType = observationdefinition.ObservationDefinition\n\n    ObservationDefinitionComponentType = (\n        observationdefinition.ObservationDefinitionComponent\n    )\n\n    ObservationDefinitionQualifiedValueType = (\n        observationdefinition.ObservationDefinitionQualifiedValue\n    )\n\n    ObservationReferenceRangeType = observation.ObservationReferenceRange\n\n    ObservationTriggeredByType = observation.ObservationTriggeredBy\n\n    OperationDefinitionType = operationdefinition.OperationDefinition\n\n    OperationDefinitionOverloadType = operationdefinition.OperationDefinitionOverload\n\n    OperationDefinitionParameterType = operationdefinition.OperationDefinitionParameter\n\n    OperationDefinitionParameterBindingType = (\n        operationdefinition.OperationDefinitionParameterBinding\n    )\n\n    OperationDefinitionParameterReferencedFromType = (\n        operationdefinition.OperationDefinitionParameterReferencedFrom\n    )\n\n    OperationOutcomeType = operationoutcome.OperationOutcome\n\n    OperationOutcomeIssueType = operationoutcome.OperationOutcomeIssue\n\n    OrganizationType = organization.Organization\n\n    OrganizationAffiliationType = organizationaffiliation.OrganizationAffiliation\n\n    OrganizationQualificationType = organization.OrganizationQualification\n\n    PackagedProductDefinitionType = packagedproductdefinition.PackagedProductDefinition\n\n    PackagedProductDefinitionLegalStatusOfSupplyType = (\n        packagedproductdefinition.PackagedProductDefinitionLegalStatusOfSupply\n    )\n\n    PackagedProductDefinitionPackagingType = (\n        packagedproductdefinition.PackagedProductDefinitionPackaging\n    )\n\n    PackagedProductDefinitionPackagingContainedItemType = (\n        packagedproductdefinition.PackagedProductDefinitionPackagingContainedItem\n    )\n\n    PackagedProductDefinitionPackagingPropertyType = (\n        packagedproductdefinition.PackagedProductDefinitionPackagingProperty\n    )\n\n    ParameterDefinitionType = parameterdefinition.ParameterDefinition\n\n    ParametersType = parameters.Parameters\n\n    ParametersParameterType = parameters.ParametersParameter\n\n    PatientType = patient.Patient\n\n    PatientCommunicationType = patient.PatientCommunication\n\n    PatientContactType = patient.PatientContact\n\n    PatientLinkType = patient.PatientLink\n\n    PaymentNoticeType = paymentnotice.PaymentNotice\n\n    PaymentReconciliationType = paymentreconciliation.PaymentReconciliation\n\n    PaymentReconciliationAllocationType = (\n        paymentreconciliation.PaymentReconciliationAllocation\n    )\n\n    PaymentReconciliationProcessNoteType = (\n        paymentreconciliation.PaymentReconciliationProcessNote\n    )\n\n    PeriodType = period.Period\n\n    PermissionType = permission.Permission\n\n    PermissionJustificationType = permission.PermissionJustification\n\n    PermissionRuleType = permission.PermissionRule\n\n    PermissionRuleActivityType = permission.PermissionRuleActivity\n\n    PermissionRuleDataType = permission.PermissionRuleData\n\n    PermissionRuleDataResourceType = permission.PermissionRuleDataResource\n\n    PersonType = person.Person\n\n    PersonCommunicationType = person.PersonCommunication\n\n    PersonLinkType = person.PersonLink\n\n    PlanDefinitionType = plandefinition.PlanDefinition\n\n    PlanDefinitionActionType = plandefinition.PlanDefinitionAction\n\n    PlanDefinitionActionConditionType = plandefinition.PlanDefinitionActionCondition\n\n    PlanDefinitionActionDynamicValueType = (\n        plandefinition.PlanDefinitionActionDynamicValue\n    )\n\n    PlanDefinitionActionInputType = plandefinition.PlanDefinitionActionInput\n\n    PlanDefinitionActionOutputType = plandefinition.PlanDefinitionActionOutput\n\n    PlanDefinitionActionParticipantType = plandefinition.PlanDefinitionActionParticipant\n\n    PlanDefinitionActionRelatedActionType = (\n        plandefinition.PlanDefinitionActionRelatedAction\n    )\n\n    PlanDefinitionActorType = plandefinition.PlanDefinitionActor\n\n    PlanDefinitionActorOptionType = plandefinition.PlanDefinitionActorOption\n\n    PlanDefinitionGoalType = plandefinition.PlanDefinitionGoal\n\n    PlanDefinitionGoalTargetType = plandefinition.PlanDefinitionGoalTarget\n\n    PractitionerType = practitioner.Practitioner\n\n    PractitionerCommunicationType = practitioner.PractitionerCommunication\n\n    PractitionerQualificationType = practitioner.PractitionerQualification\n\n    PractitionerRoleType = practitionerrole.PractitionerRole\n\n    PrimitiveTypeType = primitivetype.PrimitiveType\n\n    ProcedureType = procedure.Procedure\n\n    ProcedureFocalDeviceType = procedure.ProcedureFocalDevice\n\n    ProcedurePerformerType = procedure.ProcedurePerformer\n\n    ProductShelfLifeType = productshelflife.ProductShelfLife\n\n    ProvenanceType = provenance.Provenance\n\n    ProvenanceAgentType = provenance.ProvenanceAgent\n\n    ProvenanceEntityType = provenance.ProvenanceEntity\n\n    QuantityType = quantity.Quantity\n\n    QuestionnaireType = questionnaire.Questionnaire\n\n    QuestionnaireItemType = questionnaire.QuestionnaireItem\n\n    QuestionnaireItemAnswerOptionType = questionnaire.QuestionnaireItemAnswerOption\n\n    QuestionnaireItemEnableWhenType = questionnaire.QuestionnaireItemEnableWhen\n\n    QuestionnaireItemInitialType = questionnaire.QuestionnaireItemInitial\n\n    QuestionnaireResponseType = questionnaireresponse.QuestionnaireResponse\n\n    QuestionnaireResponseItemType = questionnaireresponse.QuestionnaireResponseItem\n\n    QuestionnaireResponseItemAnswerType = (\n        questionnaireresponse.QuestionnaireResponseItemAnswer\n    )\n\n    RangeType = range.Range\n\n    RatioType = ratio.Ratio\n\n    RatioRangeType = ratiorange.RatioRange\n\n    ReferenceType = reference.Reference\n\n    RegulatedAuthorizationType = regulatedauthorization.RegulatedAuthorization\n\n    RegulatedAuthorizationCaseType = regulatedauthorization.RegulatedAuthorizationCase\n\n    RelatedArtifactType = relatedartifact.RelatedArtifact\n\n    RelatedPersonType = relatedperson.RelatedPerson\n\n    RelatedPersonCommunicationType = relatedperson.RelatedPersonCommunication\n\n    RequestOrchestrationType = requestorchestration.RequestOrchestration\n\n    RequestOrchestrationActionType = requestorchestration.RequestOrchestrationAction\n\n    RequestOrchestrationActionConditionType = (\n        requestorchestration.RequestOrchestrationActionCondition\n    )\n\n    RequestOrchestrationActionDynamicValueType = (\n        requestorchestration.RequestOrchestrationActionDynamicValue\n    )\n\n    RequestOrchestrationActionInputType = (\n        requestorchestration.RequestOrchestrationActionInput\n    )\n\n    RequestOrchestrationActionOutputType = (\n        requestorchestration.RequestOrchestrationActionOutput\n    )\n\n    RequestOrchestrationActionParticipantType = (\n        requestorchestration.RequestOrchestrationActionParticipant\n    )\n\n    RequestOrchestrationActionRelatedActionType = (\n        requestorchestration.RequestOrchestrationActionRelatedAction\n    )\n\n    RequirementsType = requirements.Requirements\n\n    RequirementsStatementType = requirements.RequirementsStatement\n\n    ResearchStudyType = researchstudy.ResearchStudy\n\n    ResearchStudyAssociatedPartyType = researchstudy.ResearchStudyAssociatedParty\n\n    ResearchStudyComparisonGroupType = researchstudy.ResearchStudyComparisonGroup\n\n    ResearchStudyLabelType = researchstudy.ResearchStudyLabel\n\n    ResearchStudyObjectiveType = researchstudy.ResearchStudyObjective\n\n    ResearchStudyOutcomeMeasureType = researchstudy.ResearchStudyOutcomeMeasure\n\n    ResearchStudyProgressStatusType = researchstudy.ResearchStudyProgressStatus\n\n    ResearchStudyRecruitmentType = researchstudy.ResearchStudyRecruitment\n\n    ResearchSubjectType = researchsubject.ResearchSubject\n\n    ResearchSubjectProgressType = researchsubject.ResearchSubjectProgress\n\n    ResourceType = resource.Resource\n\n    RiskAssessmentType = riskassessment.RiskAssessment\n\n    RiskAssessmentPredictionType = riskassessment.RiskAssessmentPrediction\n\n    SampledDataType = sampleddata.SampledData\n\n    ScheduleType = schedule.Schedule\n\n    SearchParameterType = searchparameter.SearchParameter\n\n    SearchParameterComponentType = searchparameter.SearchParameterComponent\n\n    ServiceRequestType = servicerequest.ServiceRequest\n\n    ServiceRequestOrderDetailType = servicerequest.ServiceRequestOrderDetail\n\n    ServiceRequestOrderDetailParameterType = (\n        servicerequest.ServiceRequestOrderDetailParameter\n    )\n\n    ServiceRequestPatientInstructionType = (\n        servicerequest.ServiceRequestPatientInstruction\n    )\n\n    SignatureType = signature.Signature\n\n    SlotType = slot.Slot\n\n    SpecimenType = specimen.Specimen\n\n    SpecimenCollectionType = specimen.SpecimenCollection\n\n    SpecimenContainerType = specimen.SpecimenContainer\n\n    SpecimenDefinitionType = specimendefinition.SpecimenDefinition\n\n    SpecimenDefinitionTypeTestedType = specimendefinition.SpecimenDefinitionTypeTested\n\n    SpecimenDefinitionTypeTestedContainerType = (\n        specimendefinition.SpecimenDefinitionTypeTestedContainer\n    )\n\n    SpecimenDefinitionTypeTestedContainerAdditiveType = (\n        specimendefinition.SpecimenDefinitionTypeTestedContainerAdditive\n    )\n\n    SpecimenDefinitionTypeTestedHandlingType = (\n        specimendefinition.SpecimenDefinitionTypeTestedHandling\n    )\n\n    SpecimenFeatureType = specimen.SpecimenFeature\n\n    SpecimenProcessingType = specimen.SpecimenProcessing\n\n    StructureDefinitionType = structuredefinition.StructureDefinition\n\n    StructureDefinitionContextType = structuredefinition.StructureDefinitionContext\n\n    StructureDefinitionDifferentialType = (\n        structuredefinition.StructureDefinitionDifferential\n    )\n\n    StructureDefinitionMappingType = structuredefinition.StructureDefinitionMapping\n\n    StructureDefinitionSnapshotType = structuredefinition.StructureDefinitionSnapshot\n\n    StructureMapType = structuremap.StructureMap\n\n    StructureMapConstType = structuremap.StructureMapConst\n\n    StructureMapGroupType = structuremap.StructureMapGroup\n\n    StructureMapGroupInputType = structuremap.StructureMapGroupInput\n\n    StructureMapGroupRuleType = structuremap.StructureMapGroupRule\n\n    StructureMapGroupRuleDependentType = structuremap.StructureMapGroupRuleDependent\n\n    StructureMapGroupRuleSourceType = structuremap.StructureMapGroupRuleSource\n\n    StructureMapGroupRuleTargetType = structuremap.StructureMapGroupRuleTarget\n\n    StructureMapGroupRuleTargetParameterType = (\n        structuremap.StructureMapGroupRuleTargetParameter\n    )\n\n    StructureMapStructureType = structuremap.StructureMapStructure\n\n    SubscriptionType = subscription.Subscription\n\n    SubscriptionFilterByType = subscription.SubscriptionFilterBy\n\n    SubscriptionParameterType = subscription.SubscriptionParameter\n\n    SubscriptionStatusType = subscriptionstatus.SubscriptionStatus\n\n    SubscriptionStatusNotificationEventType = (\n        subscriptionstatus.SubscriptionStatusNotificationEvent\n    )\n\n    SubscriptionTopicType = subscriptiontopic.SubscriptionTopic\n\n    SubscriptionTopicCanFilterByType = subscriptiontopic.SubscriptionTopicCanFilterBy\n\n    SubscriptionTopicEventTriggerType = subscriptiontopic.SubscriptionTopicEventTrigger\n\n    SubscriptionTopicNotificationShapeType = (\n        subscriptiontopic.SubscriptionTopicNotificationShape\n    )\n\n    SubscriptionTopicResourceTriggerType = (\n        subscriptiontopic.SubscriptionTopicResourceTrigger\n    )\n\n    SubscriptionTopicResourceTriggerQueryCriteriaType = (\n        subscriptiontopic.SubscriptionTopicResourceTriggerQueryCriteria\n    )\n\n    SubstanceType = substance.Substance\n\n    SubstanceDefinitionType = substancedefinition.SubstanceDefinition\n\n    SubstanceDefinitionCharacterizationType = (\n        substancedefinition.SubstanceDefinitionCharacterization\n    )\n\n    SubstanceDefinitionCodeType = substancedefinition.SubstanceDefinitionCode\n\n    SubstanceDefinitionMoietyType = substancedefinition.SubstanceDefinitionMoiety\n\n    SubstanceDefinitionMolecularWeightType = (\n        substancedefinition.SubstanceDefinitionMolecularWeight\n    )\n\n    SubstanceDefinitionNameType = substancedefinition.SubstanceDefinitionName\n\n    SubstanceDefinitionNameOfficialType = (\n        substancedefinition.SubstanceDefinitionNameOfficial\n    )\n\n    SubstanceDefinitionPropertyType = substancedefinition.SubstanceDefinitionProperty\n\n    SubstanceDefinitionRelationshipType = (\n        substancedefinition.SubstanceDefinitionRelationship\n    )\n\n    SubstanceDefinitionSourceMaterialType = (\n        substancedefinition.SubstanceDefinitionSourceMaterial\n    )\n\n    SubstanceDefinitionStructureType = substancedefinition.SubstanceDefinitionStructure\n\n    SubstanceDefinitionStructureRepresentationType = (\n        substancedefinition.SubstanceDefinitionStructureRepresentation\n    )\n\n    SubstanceIngredientType = substance.SubstanceIngredient\n\n    SubstanceNucleicAcidType = substancenucleicacid.SubstanceNucleicAcid\n\n    SubstanceNucleicAcidSubunitType = substancenucleicacid.SubstanceNucleicAcidSubunit\n\n    SubstanceNucleicAcidSubunitLinkageType = (\n        substancenucleicacid.SubstanceNucleicAcidSubunitLinkage\n    )\n\n    SubstanceNucleicAcidSubunitSugarType = (\n        substancenucleicacid.SubstanceNucleicAcidSubunitSugar\n    )\n\n    SubstancePolymerType = substancepolymer.SubstancePolymer\n\n    SubstancePolymerMonomerSetType = substancepolymer.SubstancePolymerMonomerSet\n\n    SubstancePolymerMonomerSetStartingMaterialType = (\n        substancepolymer.SubstancePolymerMonomerSetStartingMaterial\n    )\n\n    SubstancePolymerRepeatType = substancepolymer.SubstancePolymerRepeat\n\n    SubstancePolymerRepeatRepeatUnitType = (\n        substancepolymer.SubstancePolymerRepeatRepeatUnit\n    )\n\n    SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationType = (\n        substancepolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation\n    )\n\n    SubstancePolymerRepeatRepeatUnitStructuralRepresentationType = (\n        substancepolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentation\n    )\n\n    SubstanceProteinType = substanceprotein.SubstanceProtein\n\n    SubstanceProteinSubunitType = substanceprotein.SubstanceProteinSubunit\n\n    SubstanceReferenceInformationType = (\n        substancereferenceinformation.SubstanceReferenceInformation\n    )\n\n    SubstanceReferenceInformationGeneType = (\n        substancereferenceinformation.SubstanceReferenceInformationGene\n    )\n\n    SubstanceReferenceInformationGeneElementType = (\n        substancereferenceinformation.SubstanceReferenceInformationGeneElement\n    )\n\n    SubstanceReferenceInformationTargetType = (\n        substancereferenceinformation.SubstanceReferenceInformationTarget\n    )\n\n    SubstanceSourceMaterialType = substancesourcematerial.SubstanceSourceMaterial\n\n    SubstanceSourceMaterialFractionDescriptionType = (\n        substancesourcematerial.SubstanceSourceMaterialFractionDescription\n    )\n\n    SubstanceSourceMaterialOrganismType = (\n        substancesourcematerial.SubstanceSourceMaterialOrganism\n    )\n\n    SubstanceSourceMaterialOrganismAuthorType = (\n        substancesourcematerial.SubstanceSourceMaterialOrganismAuthor\n    )\n\n    SubstanceSourceMaterialOrganismHybridType = (\n        substancesourcematerial.SubstanceSourceMaterialOrganismHybrid\n    )\n\n    SubstanceSourceMaterialOrganismOrganismGeneralType = (\n        substancesourcematerial.SubstanceSourceMaterialOrganismOrganismGeneral\n    )\n\n    SubstanceSourceMaterialPartDescriptionType = (\n        substancesourcematerial.SubstanceSourceMaterialPartDescription\n    )\n\n    SupplyDeliveryType = supplydelivery.SupplyDelivery\n\n    SupplyDeliverySuppliedItemType = supplydelivery.SupplyDeliverySuppliedItem\n\n    SupplyRequestType = supplyrequest.SupplyRequest\n\n    SupplyRequestParameterType = supplyrequest.SupplyRequestParameter\n\n    TaskType = task.Task\n\n    TaskInputType = task.TaskInput\n\n    TaskOutputType = task.TaskOutput\n\n    TaskPerformerType = task.TaskPerformer\n\n    TaskRestrictionType = task.TaskRestriction\n\n    TerminologyCapabilitiesType = terminologycapabilities.TerminologyCapabilities\n\n    TerminologyCapabilitiesClosureType = (\n        terminologycapabilities.TerminologyCapabilitiesClosure\n    )\n\n    TerminologyCapabilitiesCodeSystemType = (\n        terminologycapabilities.TerminologyCapabilitiesCodeSystem\n    )\n\n    TerminologyCapabilitiesCodeSystemVersionType = (\n        terminologycapabilities.TerminologyCapabilitiesCodeSystemVersion\n    )\n\n    TerminologyCapabilitiesCodeSystemVersionFilterType = (\n        terminologycapabilities.TerminologyCapabilitiesCodeSystemVersionFilter\n    )\n\n    TerminologyCapabilitiesExpansionType = (\n        terminologycapabilities.TerminologyCapabilitiesExpansion\n    )\n\n    TerminologyCapabilitiesExpansionParameterType = (\n        terminologycapabilities.TerminologyCapabilitiesExpansionParameter\n    )\n\n    TerminologyCapabilitiesImplementationType = (\n        terminologycapabilities.TerminologyCapabilitiesImplementation\n    )\n\n    TerminologyCapabilitiesSoftwareType = (\n        terminologycapabilities.TerminologyCapabilitiesSoftware\n    )\n\n    TerminologyCapabilitiesTranslationType = (\n        terminologycapabilities.TerminologyCapabilitiesTranslation\n    )\n\n    TerminologyCapabilitiesValidateCodeType = (\n        terminologycapabilities.TerminologyCapabilitiesValidateCode\n    )\n\n    TestPlanType = testplan.TestPlan\n\n    TestPlanDependencyType = testplan.TestPlanDependency\n\n    TestPlanTestCaseType = testplan.TestPlanTestCase\n\n    TestPlanTestCaseAssertionType = testplan.TestPlanTestCaseAssertion\n\n    TestPlanTestCaseDependencyType = testplan.TestPlanTestCaseDependency\n\n    TestPlanTestCaseTestDataType = testplan.TestPlanTestCaseTestData\n\n    TestPlanTestCaseTestRunType = testplan.TestPlanTestCaseTestRun\n\n    TestPlanTestCaseTestRunScriptType = testplan.TestPlanTestCaseTestRunScript\n\n    TestReportType = testreport.TestReport\n\n    TestReportParticipantType = testreport.TestReportParticipant\n\n    TestReportSetupType = testreport.TestReportSetup\n\n    TestReportSetupActionType = testreport.TestReportSetupAction\n\n    TestReportSetupActionAssertType = testreport.TestReportSetupActionAssert\n\n    TestReportSetupActionAssertRequirementType = (\n        testreport.TestReportSetupActionAssertRequirement\n    )\n\n    TestReportSetupActionOperationType = testreport.TestReportSetupActionOperation\n\n    TestReportTeardownType = testreport.TestReportTeardown\n\n    TestReportTeardownActionType = testreport.TestReportTeardownAction\n\n    TestReportTestType = testreport.TestReportTest\n\n    TestReportTestActionType = testreport.TestReportTestAction\n\n    TestScriptType = testscript.TestScript\n\n    TestScriptDestinationType = testscript.TestScriptDestination\n\n    TestScriptFixtureType = testscript.TestScriptFixture\n\n    TestScriptMetadataType = testscript.TestScriptMetadata\n\n    TestScriptMetadataCapabilityType = testscript.TestScriptMetadataCapability\n\n    TestScriptMetadataLinkType = testscript.TestScriptMetadataLink\n\n    TestScriptOriginType = testscript.TestScriptOrigin\n\n    TestScriptScopeType = testscript.TestScriptScope\n\n    TestScriptSetupType = testscript.TestScriptSetup\n\n    TestScriptSetupActionType = testscript.TestScriptSetupAction\n\n    TestScriptSetupActionAssertType = testscript.TestScriptSetupActionAssert\n\n    TestScriptSetupActionAssertRequirementType = (\n        testscript.TestScriptSetupActionAssertRequirement\n    )\n\n    TestScriptSetupActionOperationType = testscript.TestScriptSetupActionOperation\n\n    TestScriptSetupActionOperationRequestHeaderType = (\n        testscript.TestScriptSetupActionOperationRequestHeader\n    )\n\n    TestScriptTeardownType = testscript.TestScriptTeardown\n\n    TestScriptTeardownActionType = testscript.TestScriptTeardownAction\n\n    TestScriptTestType = testscript.TestScriptTest\n\n    TestScriptTestActionType = testscript.TestScriptTestAction\n\n    TestScriptVariableType = testscript.TestScriptVariable\n\n    TimingType = timing.Timing\n\n    TimingRepeatType = timing.TimingRepeat\n\n    TransportType = transport.Transport\n\n    TransportInputType = transport.TransportInput\n\n    TransportOutputType = transport.TransportOutput\n\n    TransportRestrictionType = transport.TransportRestriction\n\n    TriggerDefinitionType = triggerdefinition.TriggerDefinition\n\n    UsageContextType = usagecontext.UsageContext\n\n    ValueSetType = valueset.ValueSet\n\n    ValueSetComposeType = valueset.ValueSetCompose\n\n    ValueSetComposeIncludeType = valueset.ValueSetComposeInclude\n\n    ValueSetComposeIncludeConceptType = valueset.ValueSetComposeIncludeConcept\n\n    ValueSetComposeIncludeConceptDesignationType = (\n        valueset.ValueSetComposeIncludeConceptDesignation\n    )\n\n    ValueSetComposeIncludeFilterType = valueset.ValueSetComposeIncludeFilter\n\n    ValueSetExpansionType = valueset.ValueSetExpansion\n\n    ValueSetExpansionContainsType = valueset.ValueSetExpansionContains\n\n    ValueSetExpansionContainsPropertyType = valueset.ValueSetExpansionContainsProperty\n\n    ValueSetExpansionContainsPropertySubPropertyType = (\n        valueset.ValueSetExpansionContainsPropertySubProperty\n    )\n\n    ValueSetExpansionParameterType = valueset.ValueSetExpansionParameter\n\n    ValueSetExpansionPropertyType = valueset.ValueSetExpansionProperty\n\n    ValueSetScopeType = valueset.ValueSetScope\n\n    VerificationResultType = verificationresult.VerificationResult\n\n    VerificationResultAttestationType = verificationresult.VerificationResultAttestation\n\n    VerificationResultPrimarySourceType = (\n        verificationresult.VerificationResultPrimarySource\n    )\n\n    VerificationResultValidatorType = verificationresult.VerificationResultValidator\n\n    VirtualServiceDetailType = virtualservicedetail.VirtualServiceDetail\n\n    VisionPrescriptionType = visionprescription.VisionPrescription\n\n    VisionPrescriptionLensSpecificationType = (\n        visionprescription.VisionPrescriptionLensSpecification\n    )\n\n    VisionPrescriptionLensSpecificationPrismType = (\n        visionprescription.VisionPrescriptionLensSpecificationPrism\n    )\n\nelse:\n    FHIRPrimitiveExtensionType = create_fhir_type(\n        \"FHIRPrimitiveExtensionType\",\n        \"fhir.resources.fhirprimitiveextension.FHIRPrimitiveExtension\",\n    )\n\n    ElementType = create_fhir_element_or_resource_type(\n        \"ElementType\", \"fhir.resources.element.Element\"\n    )\n\n    ResourceType = create_fhir_element_or_resource_type(\n        \"ResourceType\", \"fhir.resources.resource.Resource\"\n    )\n    AccountType = create_fhir_type(\"AccountType\", \"fhir.resources.account.Account\")\n\n    AccountBalanceType = create_fhir_type(\n        \"AccountBalanceType\", \"fhir.resources.account.AccountBalance\"\n    )\n\n    AccountCoverageType = create_fhir_type(\n        \"AccountCoverageType\", \"fhir.resources.account.AccountCoverage\"\n    )\n\n    AccountDiagnosisType = create_fhir_type(\n        \"AccountDiagnosisType\", \"fhir.resources.account.AccountDiagnosis\"\n    )\n\n    AccountGuarantorType = create_fhir_type(\n        \"AccountGuarantorType\", \"fhir.resources.account.AccountGuarantor\"\n    )\n\n    AccountProcedureType = create_fhir_type(\n        \"AccountProcedureType\", \"fhir.resources.account.AccountProcedure\"\n    )\n\n    AccountRelatedAccountType = create_fhir_type(\n        \"AccountRelatedAccountType\", \"fhir.resources.account.AccountRelatedAccount\"\n    )\n\n    ActivityDefinitionType = create_fhir_type(\n        \"ActivityDefinitionType\", \"fhir.resources.activitydefinition.ActivityDefinition\"\n    )\n\n    ActivityDefinitionDynamicValueType = create_fhir_type(\n        \"ActivityDefinitionDynamicValueType\",\n        \"fhir.resources.activitydefinition.ActivityDefinitionDynamicValue\",\n    )\n\n    ActivityDefinitionParticipantType = create_fhir_type(\n        \"ActivityDefinitionParticipantType\",\n        \"fhir.resources.activitydefinition.ActivityDefinitionParticipant\",\n    )\n\n    ActorDefinitionType = create_fhir_type(\n        \"ActorDefinitionType\", \"fhir.resources.actordefinition.ActorDefinition\"\n    )\n\n    AddressType = create_fhir_type(\"AddressType\", \"fhir.resources.address.Address\")\n\n    AdministrableProductDefinitionType = create_fhir_type(\n        \"AdministrableProductDefinitionType\",\n        \"fhir.resources.administrableproductdefinition.AdministrableProductDefinition\",\n    )\n\n    AdministrableProductDefinitionPropertyType = create_fhir_type(\n        \"AdministrableProductDefinitionPropertyType\",\n        \"fhir.resources.administrableproductdefinition.AdministrableProductDefinitionProperty\",\n    )\n\n    AdministrableProductDefinitionRouteOfAdministrationType = create_fhir_type(\n        \"AdministrableProductDefinitionRouteOfAdministrationType\",\n        \"fhir.resources.administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministration\",\n    )\n\n    AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType = create_fhir_type(\n        \"AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType\",\n        \"fhir.resources.administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpecies\",\n    )\n\n    AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType = create_fhir_type(\n        \"AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType\",\n        \"fhir.resources.administrableproductdefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriod\",\n    )\n\n    AdverseEventType = create_fhir_type(\n        \"AdverseEventType\", \"fhir.resources.adverseevent.AdverseEvent\"\n    )\n\n    AdverseEventContributingFactorType = create_fhir_type(\n        \"AdverseEventContributingFactorType\",\n        \"fhir.resources.adverseevent.AdverseEventContributingFactor\",\n    )\n\n    AdverseEventMitigatingActionType = create_fhir_type(\n        \"AdverseEventMitigatingActionType\",\n        \"fhir.resources.adverseevent.AdverseEventMitigatingAction\",\n    )\n\n    AdverseEventParticipantType = create_fhir_type(\n        \"AdverseEventParticipantType\",\n        \"fhir.resources.adverseevent.AdverseEventParticipant\",\n    )\n\n    AdverseEventPreventiveActionType = create_fhir_type(\n        \"AdverseEventPreventiveActionType\",\n        \"fhir.resources.adverseevent.AdverseEventPreventiveAction\",\n    )\n\n    AdverseEventSupportingInfoType = create_fhir_type(\n        \"AdverseEventSupportingInfoType\",\n        \"fhir.resources.adverseevent.AdverseEventSupportingInfo\",\n    )\n\n    AdverseEventSuspectEntityType = create_fhir_type(\n        \"AdverseEventSuspectEntityType\",\n        \"fhir.resources.adverseevent.AdverseEventSuspectEntity\",\n    )\n\n    AdverseEventSuspectEntityCausalityType = create_fhir_type(\n        \"AdverseEventSuspectEntityCausalityType\",\n        \"fhir.resources.adverseevent.AdverseEventSuspectEntityCausality\",\n    )\n\n    AgeType = create_fhir_type(\"AgeType\", \"fhir.resources.age.Age\")\n\n    AllergyIntoleranceType = create_fhir_type(\n        \"AllergyIntoleranceType\", \"fhir.resources.allergyintolerance.AllergyIntolerance\"\n    )\n\n    AllergyIntoleranceParticipantType = create_fhir_type(\n        \"AllergyIntoleranceParticipantType\",\n        \"fhir.resources.allergyintolerance.AllergyIntoleranceParticipant\",\n    )\n\n    AllergyIntoleranceReactionType = create_fhir_type(\n        \"AllergyIntoleranceReactionType\",\n        \"fhir.resources.allergyintolerance.AllergyIntoleranceReaction\",\n    )\n\n    AnnotationType = create_fhir_type(\n        \"AnnotationType\", \"fhir.resources.annotation.Annotation\"\n    )\n\n    AppointmentType = create_fhir_type(\n        \"AppointmentType\", \"fhir.resources.appointment.Appointment\"\n    )\n\n    AppointmentParticipantType = create_fhir_type(\n        \"AppointmentParticipantType\",\n        \"fhir.resources.appointment.AppointmentParticipant\",\n    )\n\n    AppointmentRecurrenceTemplateType = create_fhir_type(\n        \"AppointmentRecurrenceTemplateType\",\n        \"fhir.resources.appointment.AppointmentRecurrenceTemplate\",\n    )\n\n    AppointmentRecurrenceTemplateMonthlyTemplateType = create_fhir_type(\n        \"AppointmentRecurrenceTemplateMonthlyTemplateType\",\n        \"fhir.resources.appointment.AppointmentRecurrenceTemplateMonthlyTemplate\",\n    )\n\n    AppointmentRecurrenceTemplateWeeklyTemplateType = create_fhir_type(\n        \"AppointmentRecurrenceTemplateWeeklyTemplateType\",\n        \"fhir.resources.appointment.AppointmentRecurrenceTemplateWeeklyTemplate\",\n    )\n\n    AppointmentRecurrenceTemplateYearlyTemplateType = create_fhir_type(\n        \"AppointmentRecurrenceTemplateYearlyTemplateType\",\n        \"fhir.resources.appointment.AppointmentRecurrenceTemplateYearlyTemplate\",\n    )\n\n    AppointmentResponseType = create_fhir_type(\n        \"AppointmentResponseType\",\n        \"fhir.resources.appointmentresponse.AppointmentResponse\",\n    )\n\n    ArtifactAssessmentType = create_fhir_type(\n        \"ArtifactAssessmentType\", \"fhir.resources.artifactassessment.ArtifactAssessment\"\n    )\n\n    ArtifactAssessmentContentType = create_fhir_type(\n        \"ArtifactAssessmentContentType\",\n        \"fhir.resources.artifactassessment.ArtifactAssessmentContent\",\n    )\n\n    AttachmentType = create_fhir_type(\n        \"AttachmentType\", \"fhir.resources.attachment.Attachment\"\n    )\n\n    AuditEventType = create_fhir_type(\n        \"AuditEventType\", \"fhir.resources.auditevent.AuditEvent\"\n    )\n\n    AuditEventAgentType = create_fhir_type(\n        \"AuditEventAgentType\", \"fhir.resources.auditevent.AuditEventAgent\"\n    )\n\n    AuditEventEntityType = create_fhir_type(\n        \"AuditEventEntityType\", \"fhir.resources.auditevent.AuditEventEntity\"\n    )\n\n    AuditEventEntityDetailType = create_fhir_type(\n        \"AuditEventEntityDetailType\", \"fhir.resources.auditevent.AuditEventEntityDetail\"\n    )\n\n    AuditEventOutcomeType = create_fhir_type(\n        \"AuditEventOutcomeType\", \"fhir.resources.auditevent.AuditEventOutcome\"\n    )\n\n    AuditEventSourceType = create_fhir_type(\n        \"AuditEventSourceType\", \"fhir.resources.auditevent.AuditEventSource\"\n    )\n\n    AvailabilityType = create_fhir_type(\n        \"AvailabilityType\", \"fhir.resources.availability.Availability\"\n    )\n\n    AvailabilityAvailableTimeType = create_fhir_type(\n        \"AvailabilityAvailableTimeType\",\n        \"fhir.resources.availability.AvailabilityAvailableTime\",\n    )\n\n    AvailabilityNotAvailableTimeType = create_fhir_type(\n        \"AvailabilityNotAvailableTimeType\",\n        \"fhir.resources.availability.AvailabilityNotAvailableTime\",\n    )\n\n    BackboneElementType = create_fhir_type(\n        \"BackboneElementType\", \"fhir.resources.backboneelement.BackboneElement\"\n    )\n\n    BackboneTypeType = create_fhir_type(\n        \"BackboneTypeType\", \"fhir.resources.backbonetype.BackboneType\"\n    )\n\n    BaseType = create_fhir_type(\"BaseType\", \"fhir.resources.base.Base\")\n\n    BasicType = create_fhir_type(\"BasicType\", \"fhir.resources.basic.Basic\")\n\n    BinaryType = create_fhir_type(\"BinaryType\", \"fhir.resources.binary.Binary\")\n\n    BiologicallyDerivedProductType = create_fhir_type(\n        \"BiologicallyDerivedProductType\",\n        \"fhir.resources.biologicallyderivedproduct.BiologicallyDerivedProduct\",\n    )\n\n    BiologicallyDerivedProductCollectionType = create_fhir_type(\n        \"BiologicallyDerivedProductCollectionType\",\n        \"fhir.resources.biologicallyderivedproduct.BiologicallyDerivedProductCollection\",\n    )\n\n    BiologicallyDerivedProductDispenseType = create_fhir_type(\n        \"BiologicallyDerivedProductDispenseType\",\n        \"fhir.resources.biologicallyderivedproductdispense.BiologicallyDerivedProductDispense\",\n    )\n\n    BiologicallyDerivedProductDispensePerformerType = create_fhir_type(\n        \"BiologicallyDerivedProductDispensePerformerType\",\n        \"fhir.resources.biologicallyderivedproductdispense.BiologicallyDerivedProductDispensePerformer\",\n    )\n\n    BiologicallyDerivedProductPropertyType = create_fhir_type(\n        \"BiologicallyDerivedProductPropertyType\",\n        \"fhir.resources.biologicallyderivedproduct.BiologicallyDerivedProductProperty\",\n    )\n\n    BodyStructureType = create_fhir_type(\n        \"BodyStructureType\", \"fhir.resources.bodystructure.BodyStructure\"\n    )\n\n    BodyStructureIncludedStructureType = create_fhir_type(\n        \"BodyStructureIncludedStructureType\",\n        \"fhir.resources.bodystructure.BodyStructureIncludedStructure\",\n    )\n\n    BodyStructureIncludedStructureBodyLandmarkOrientationType = create_fhir_type(\n        \"BodyStructureIncludedStructureBodyLandmarkOrientationType\",\n        \"fhir.resources.bodystructure.BodyStructureIncludedStructureBodyLandmarkOrientation\",\n    )\n\n    BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkType = create_fhir_type(\n        \"BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkType\",\n        \"fhir.resources.bodystructure.BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmark\",\n    )\n\n    BundleType = create_fhir_type(\"BundleType\", \"fhir.resources.bundle.Bundle\")\n\n    BundleEntryType = create_fhir_type(\n        \"BundleEntryType\", \"fhir.resources.bundle.BundleEntry\"\n    )\n\n    BundleEntryRequestType = create_fhir_type(\n        \"BundleEntryRequestType\", \"fhir.resources.bundle.BundleEntryRequest\"\n    )\n\n    BundleEntryResponseType = create_fhir_type(\n        \"BundleEntryResponseType\", \"fhir.resources.bundle.BundleEntryResponse\"\n    )\n\n    BundleEntrySearchType = create_fhir_type(\n        \"BundleEntrySearchType\", \"fhir.resources.bundle.BundleEntrySearch\"\n    )\n\n    BundleLinkType = create_fhir_type(\n        \"BundleLinkType\", \"fhir.resources.bundle.BundleLink\"\n    )\n\n    CanonicalResourceType = create_fhir_type(\n        \"CanonicalResourceType\", \"fhir.resources.canonicalresource.CanonicalResource\"\n    )\n\n    CapabilityStatementType = create_fhir_type(\n        \"CapabilityStatementType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatement\",\n    )\n\n    CapabilityStatementDocumentType = create_fhir_type(\n        \"CapabilityStatementDocumentType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementDocument\",\n    )\n\n    CapabilityStatementImplementationType = create_fhir_type(\n        \"CapabilityStatementImplementationType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementImplementation\",\n    )\n\n    CapabilityStatementMessagingType = create_fhir_type(\n        \"CapabilityStatementMessagingType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementMessaging\",\n    )\n\n    CapabilityStatementMessagingEndpointType = create_fhir_type(\n        \"CapabilityStatementMessagingEndpointType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementMessagingEndpoint\",\n    )\n\n    CapabilityStatementMessagingSupportedMessageType = create_fhir_type(\n        \"CapabilityStatementMessagingSupportedMessageType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementMessagingSupportedMessage\",\n    )\n\n    CapabilityStatementRestType = create_fhir_type(\n        \"CapabilityStatementRestType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementRest\",\n    )\n\n    CapabilityStatementRestInteractionType = create_fhir_type(\n        \"CapabilityStatementRestInteractionType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementRestInteraction\",\n    )\n\n    CapabilityStatementRestResourceType = create_fhir_type(\n        \"CapabilityStatementRestResourceType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementRestResource\",\n    )\n\n    CapabilityStatementRestResourceInteractionType = create_fhir_type(\n        \"CapabilityStatementRestResourceInteractionType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementRestResourceInteraction\",\n    )\n\n    CapabilityStatementRestResourceOperationType = create_fhir_type(\n        \"CapabilityStatementRestResourceOperationType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementRestResourceOperation\",\n    )\n\n    CapabilityStatementRestResourceSearchParamType = create_fhir_type(\n        \"CapabilityStatementRestResourceSearchParamType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementRestResourceSearchParam\",\n    )\n\n    CapabilityStatementRestSecurityType = create_fhir_type(\n        \"CapabilityStatementRestSecurityType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementRestSecurity\",\n    )\n\n    CapabilityStatementSoftwareType = create_fhir_type(\n        \"CapabilityStatementSoftwareType\",\n        \"fhir.resources.capabilitystatement.CapabilityStatementSoftware\",\n    )\n\n    CarePlanType = create_fhir_type(\"CarePlanType\", \"fhir.resources.careplan.CarePlan\")\n\n    CarePlanActivityType = create_fhir_type(\n        \"CarePlanActivityType\", \"fhir.resources.careplan.CarePlanActivity\"\n    )\n\n    CareTeamType = create_fhir_type(\"CareTeamType\", \"fhir.resources.careteam.CareTeam\")\n\n    CareTeamParticipantType = create_fhir_type(\n        \"CareTeamParticipantType\", \"fhir.resources.careteam.CareTeamParticipant\"\n    )\n\n    ChargeItemType = create_fhir_type(\n        \"ChargeItemType\", \"fhir.resources.chargeitem.ChargeItem\"\n    )\n\n    ChargeItemDefinitionType = create_fhir_type(\n        \"ChargeItemDefinitionType\",\n        \"fhir.resources.chargeitemdefinition.ChargeItemDefinition\",\n    )\n\n    ChargeItemDefinitionApplicabilityType = create_fhir_type(\n        \"ChargeItemDefinitionApplicabilityType\",\n        \"fhir.resources.chargeitemdefinition.ChargeItemDefinitionApplicability\",\n    )\n\n    ChargeItemDefinitionPropertyGroupType = create_fhir_type(\n        \"ChargeItemDefinitionPropertyGroupType\",\n        \"fhir.resources.chargeitemdefinition.ChargeItemDefinitionPropertyGroup\",\n    )\n\n    ChargeItemPerformerType = create_fhir_type(\n        \"ChargeItemPerformerType\", \"fhir.resources.chargeitem.ChargeItemPerformer\"\n    )\n\n    CitationType = create_fhir_type(\"CitationType\", \"fhir.resources.citation.Citation\")\n\n    CitationCitedArtifactType = create_fhir_type(\n        \"CitationCitedArtifactType\", \"fhir.resources.citation.CitationCitedArtifact\"\n    )\n\n    CitationCitedArtifactAbstractType = create_fhir_type(\n        \"CitationCitedArtifactAbstractType\",\n        \"fhir.resources.citation.CitationCitedArtifactAbstract\",\n    )\n\n    CitationCitedArtifactClassificationType = create_fhir_type(\n        \"CitationCitedArtifactClassificationType\",\n        \"fhir.resources.citation.CitationCitedArtifactClassification\",\n    )\n\n    CitationCitedArtifactContributorshipType = create_fhir_type(\n        \"CitationCitedArtifactContributorshipType\",\n        \"fhir.resources.citation.CitationCitedArtifactContributorship\",\n    )\n\n    CitationCitedArtifactContributorshipEntryType = create_fhir_type(\n        \"CitationCitedArtifactContributorshipEntryType\",\n        \"fhir.resources.citation.CitationCitedArtifactContributorshipEntry\",\n    )\n\n    CitationCitedArtifactContributorshipEntryContributionInstanceType = create_fhir_type(\n        \"CitationCitedArtifactContributorshipEntryContributionInstanceType\",\n        \"fhir.resources.citation.CitationCitedArtifactContributorshipEntryContributionInstance\",\n    )\n\n    CitationCitedArtifactContributorshipSummaryType = create_fhir_type(\n        \"CitationCitedArtifactContributorshipSummaryType\",\n        \"fhir.resources.citation.CitationCitedArtifactContributorshipSummary\",\n    )\n\n    CitationCitedArtifactPartType = create_fhir_type(\n        \"CitationCitedArtifactPartType\",\n        \"fhir.resources.citation.CitationCitedArtifactPart\",\n    )\n\n    CitationCitedArtifactPublicationFormType = create_fhir_type(\n        \"CitationCitedArtifactPublicationFormType\",\n        \"fhir.resources.citation.CitationCitedArtifactPublicationForm\",\n    )\n\n    CitationCitedArtifactPublicationFormPublishedInType = create_fhir_type(\n        \"CitationCitedArtifactPublicationFormPublishedInType\",\n        \"fhir.resources.citation.CitationCitedArtifactPublicationFormPublishedIn\",\n    )\n\n    CitationCitedArtifactRelatesToType = create_fhir_type(\n        \"CitationCitedArtifactRelatesToType\",\n        \"fhir.resources.citation.CitationCitedArtifactRelatesTo\",\n    )\n\n    CitationCitedArtifactStatusDateType = create_fhir_type(\n        \"CitationCitedArtifactStatusDateType\",\n        \"fhir.resources.citation.CitationCitedArtifactStatusDate\",\n    )\n\n    CitationCitedArtifactTitleType = create_fhir_type(\n        \"CitationCitedArtifactTitleType\",\n        \"fhir.resources.citation.CitationCitedArtifactTitle\",\n    )\n\n    CitationCitedArtifactVersionType = create_fhir_type(\n        \"CitationCitedArtifactVersionType\",\n        \"fhir.resources.citation.CitationCitedArtifactVersion\",\n    )\n\n    CitationCitedArtifactWebLocationType = create_fhir_type(\n        \"CitationCitedArtifactWebLocationType\",\n        \"fhir.resources.citation.CitationCitedArtifactWebLocation\",\n    )\n\n    CitationClassificationType = create_fhir_type(\n        \"CitationClassificationType\", \"fhir.resources.citation.CitationClassification\"\n    )\n\n    CitationStatusDateType = create_fhir_type(\n        \"CitationStatusDateType\", \"fhir.resources.citation.CitationStatusDate\"\n    )\n\n    CitationSummaryType = create_fhir_type(\n        \"CitationSummaryType\", \"fhir.resources.citation.CitationSummary\"\n    )\n\n    ClaimType = create_fhir_type(\"ClaimType\", \"fhir.resources.claim.Claim\")\n\n    ClaimAccidentType = create_fhir_type(\n        \"ClaimAccidentType\", \"fhir.resources.claim.ClaimAccident\"\n    )\n\n    ClaimCareTeamType = create_fhir_type(\n        \"ClaimCareTeamType\", \"fhir.resources.claim.ClaimCareTeam\"\n    )\n\n    ClaimDiagnosisType = create_fhir_type(\n        \"ClaimDiagnosisType\", \"fhir.resources.claim.ClaimDiagnosis\"\n    )\n\n    ClaimEventType = create_fhir_type(\n        \"ClaimEventType\", \"fhir.resources.claim.ClaimEvent\"\n    )\n\n    ClaimInsuranceType = create_fhir_type(\n        \"ClaimInsuranceType\", \"fhir.resources.claim.ClaimInsurance\"\n    )\n\n    ClaimItemType = create_fhir_type(\"ClaimItemType\", \"fhir.resources.claim.ClaimItem\")\n\n    ClaimItemBodySiteType = create_fhir_type(\n        \"ClaimItemBodySiteType\", \"fhir.resources.claim.ClaimItemBodySite\"\n    )\n\n    ClaimItemDetailType = create_fhir_type(\n        \"ClaimItemDetailType\", \"fhir.resources.claim.ClaimItemDetail\"\n    )\n\n    ClaimItemDetailSubDetailType = create_fhir_type(\n        \"ClaimItemDetailSubDetailType\", \"fhir.resources.claim.ClaimItemDetailSubDetail\"\n    )\n\n    ClaimPayeeType = create_fhir_type(\n        \"ClaimPayeeType\", \"fhir.resources.claim.ClaimPayee\"\n    )\n\n    ClaimProcedureType = create_fhir_type(\n        \"ClaimProcedureType\", \"fhir.resources.claim.ClaimProcedure\"\n    )\n\n    ClaimRelatedType = create_fhir_type(\n        \"ClaimRelatedType\", \"fhir.resources.claim.ClaimRelated\"\n    )\n\n    ClaimResponseType = create_fhir_type(\n        \"ClaimResponseType\", \"fhir.resources.claimresponse.ClaimResponse\"\n    )\n\n    ClaimResponseAddItemType = create_fhir_type(\n        \"ClaimResponseAddItemType\", \"fhir.resources.claimresponse.ClaimResponseAddItem\"\n    )\n\n    ClaimResponseAddItemBodySiteType = create_fhir_type(\n        \"ClaimResponseAddItemBodySiteType\",\n        \"fhir.resources.claimresponse.ClaimResponseAddItemBodySite\",\n    )\n\n    ClaimResponseAddItemDetailType = create_fhir_type(\n        \"ClaimResponseAddItemDetailType\",\n        \"fhir.resources.claimresponse.ClaimResponseAddItemDetail\",\n    )\n\n    ClaimResponseAddItemDetailSubDetailType = create_fhir_type(\n        \"ClaimResponseAddItemDetailSubDetailType\",\n        \"fhir.resources.claimresponse.ClaimResponseAddItemDetailSubDetail\",\n    )\n\n    ClaimResponseErrorType = create_fhir_type(\n        \"ClaimResponseErrorType\", \"fhir.resources.claimresponse.ClaimResponseError\"\n    )\n\n    ClaimResponseEventType = create_fhir_type(\n        \"ClaimResponseEventType\", \"fhir.resources.claimresponse.ClaimResponseEvent\"\n    )\n\n    ClaimResponseInsuranceType = create_fhir_type(\n        \"ClaimResponseInsuranceType\",\n        \"fhir.resources.claimresponse.ClaimResponseInsurance\",\n    )\n\n    ClaimResponseItemType = create_fhir_type(\n        \"ClaimResponseItemType\", \"fhir.resources.claimresponse.ClaimResponseItem\"\n    )\n\n    ClaimResponseItemAdjudicationType = create_fhir_type(\n        \"ClaimResponseItemAdjudicationType\",\n        \"fhir.resources.claimresponse.ClaimResponseItemAdjudication\",\n    )\n\n    ClaimResponseItemDetailType = create_fhir_type(\n        \"ClaimResponseItemDetailType\",\n        \"fhir.resources.claimresponse.ClaimResponseItemDetail\",\n    )\n\n    ClaimResponseItemDetailSubDetailType = create_fhir_type(\n        \"ClaimResponseItemDetailSubDetailType\",\n        \"fhir.resources.claimresponse.ClaimResponseItemDetailSubDetail\",\n    )\n\n    ClaimResponseItemReviewOutcomeType = create_fhir_type(\n        \"ClaimResponseItemReviewOutcomeType\",\n        \"fhir.resources.claimresponse.ClaimResponseItemReviewOutcome\",\n    )\n\n    ClaimResponsePaymentType = create_fhir_type(\n        \"ClaimResponsePaymentType\", \"fhir.resources.claimresponse.ClaimResponsePayment\"\n    )\n\n    ClaimResponseProcessNoteType = create_fhir_type(\n        \"ClaimResponseProcessNoteType\",\n        \"fhir.resources.claimresponse.ClaimResponseProcessNote\",\n    )\n\n    ClaimResponseTotalType = create_fhir_type(\n        \"ClaimResponseTotalType\", \"fhir.resources.claimresponse.ClaimResponseTotal\"\n    )\n\n    ClaimSupportingInfoType = create_fhir_type(\n        \"ClaimSupportingInfoType\", \"fhir.resources.claim.ClaimSupportingInfo\"\n    )\n\n    ClinicalImpressionType = create_fhir_type(\n        \"ClinicalImpressionType\", \"fhir.resources.clinicalimpression.ClinicalImpression\"\n    )\n\n    ClinicalImpressionFindingType = create_fhir_type(\n        \"ClinicalImpressionFindingType\",\n        \"fhir.resources.clinicalimpression.ClinicalImpressionFinding\",\n    )\n\n    ClinicalUseDefinitionType = create_fhir_type(\n        \"ClinicalUseDefinitionType\",\n        \"fhir.resources.clinicalusedefinition.ClinicalUseDefinition\",\n    )\n\n    ClinicalUseDefinitionContraindicationType = create_fhir_type(\n        \"ClinicalUseDefinitionContraindicationType\",\n        \"fhir.resources.clinicalusedefinition.ClinicalUseDefinitionContraindication\",\n    )\n\n    ClinicalUseDefinitionContraindicationOtherTherapyType = create_fhir_type(\n        \"ClinicalUseDefinitionContraindicationOtherTherapyType\",\n        \"fhir.resources.clinicalusedefinition.ClinicalUseDefinitionContraindicationOtherTherapy\",\n    )\n\n    ClinicalUseDefinitionIndicationType = create_fhir_type(\n        \"ClinicalUseDefinitionIndicationType\",\n        \"fhir.resources.clinicalusedefinition.ClinicalUseDefinitionIndication\",\n    )\n\n    ClinicalUseDefinitionInteractionType = create_fhir_type(\n        \"ClinicalUseDefinitionInteractionType\",\n        \"fhir.resources.clinicalusedefinition.ClinicalUseDefinitionInteraction\",\n    )\n\n    ClinicalUseDefinitionInteractionInteractantType = create_fhir_type(\n        \"ClinicalUseDefinitionInteractionInteractantType\",\n        \"fhir.resources.clinicalusedefinition.ClinicalUseDefinitionInteractionInteractant\",\n    )\n\n    ClinicalUseDefinitionUndesirableEffectType = create_fhir_type(\n        \"ClinicalUseDefinitionUndesirableEffectType\",\n        \"fhir.resources.clinicalusedefinition.ClinicalUseDefinitionUndesirableEffect\",\n    )\n\n    ClinicalUseDefinitionWarningType = create_fhir_type(\n        \"ClinicalUseDefinitionWarningType\",\n        \"fhir.resources.clinicalusedefinition.ClinicalUseDefinitionWarning\",\n    )\n\n    CodeSystemType = create_fhir_type(\n        \"CodeSystemType\", \"fhir.resources.codesystem.CodeSystem\"\n    )\n\n    CodeSystemConceptType = create_fhir_type(\n        \"CodeSystemConceptType\", \"fhir.resources.codesystem.CodeSystemConcept\"\n    )\n\n    CodeSystemConceptDesignationType = create_fhir_type(\n        \"CodeSystemConceptDesignationType\",\n        \"fhir.resources.codesystem.CodeSystemConceptDesignation\",\n    )\n\n    CodeSystemConceptPropertyType = create_fhir_type(\n        \"CodeSystemConceptPropertyType\",\n        \"fhir.resources.codesystem.CodeSystemConceptProperty\",\n    )\n\n    CodeSystemFilterType = create_fhir_type(\n        \"CodeSystemFilterType\", \"fhir.resources.codesystem.CodeSystemFilter\"\n    )\n\n    CodeSystemPropertyType = create_fhir_type(\n        \"CodeSystemPropertyType\", \"fhir.resources.codesystem.CodeSystemProperty\"\n    )\n\n    CodeableConceptType = create_fhir_type(\n        \"CodeableConceptType\", \"fhir.resources.codeableconcept.CodeableConcept\"\n    )\n\n    CodeableReferenceType = create_fhir_type(\n        \"CodeableReferenceType\", \"fhir.resources.codeablereference.CodeableReference\"\n    )\n\n    CodingType = create_fhir_type(\"CodingType\", \"fhir.resources.coding.Coding\")\n\n    CommunicationType = create_fhir_type(\n        \"CommunicationType\", \"fhir.resources.communication.Communication\"\n    )\n\n    CommunicationPayloadType = create_fhir_type(\n        \"CommunicationPayloadType\", \"fhir.resources.communication.CommunicationPayload\"\n    )\n\n    CommunicationRequestType = create_fhir_type(\n        \"CommunicationRequestType\",\n        \"fhir.resources.communicationrequest.CommunicationRequest\",\n    )\n\n    CommunicationRequestPayloadType = create_fhir_type(\n        \"CommunicationRequestPayloadType\",\n        \"fhir.resources.communicationrequest.CommunicationRequestPayload\",\n    )\n\n    CompartmentDefinitionType = create_fhir_type(\n        \"CompartmentDefinitionType\",\n        \"fhir.resources.compartmentdefinition.CompartmentDefinition\",\n    )\n\n    CompartmentDefinitionResourceType = create_fhir_type(\n        \"CompartmentDefinitionResourceType\",\n        \"fhir.resources.compartmentdefinition.CompartmentDefinitionResource\",\n    )\n\n    CompositionType = create_fhir_type(\n        \"CompositionType\", \"fhir.resources.composition.Composition\"\n    )\n\n    CompositionAttesterType = create_fhir_type(\n        \"CompositionAttesterType\", \"fhir.resources.composition.CompositionAttester\"\n    )\n\n    CompositionEventType = create_fhir_type(\n        \"CompositionEventType\", \"fhir.resources.composition.CompositionEvent\"\n    )\n\n    CompositionSectionType = create_fhir_type(\n        \"CompositionSectionType\", \"fhir.resources.composition.CompositionSection\"\n    )\n\n    ConceptMapType = create_fhir_type(\n        \"ConceptMapType\", \"fhir.resources.conceptmap.ConceptMap\"\n    )\n\n    ConceptMapAdditionalAttributeType = create_fhir_type(\n        \"ConceptMapAdditionalAttributeType\",\n        \"fhir.resources.conceptmap.ConceptMapAdditionalAttribute\",\n    )\n\n    ConceptMapGroupType = create_fhir_type(\n        \"ConceptMapGroupType\", \"fhir.resources.conceptmap.ConceptMapGroup\"\n    )\n\n    ConceptMapGroupElementType = create_fhir_type(\n        \"ConceptMapGroupElementType\", \"fhir.resources.conceptmap.ConceptMapGroupElement\"\n    )\n\n    ConceptMapGroupElementTargetType = create_fhir_type(\n        \"ConceptMapGroupElementTargetType\",\n        \"fhir.resources.conceptmap.ConceptMapGroupElementTarget\",\n    )\n\n    ConceptMapGroupElementTargetDependsOnType = create_fhir_type(\n        \"ConceptMapGroupElementTargetDependsOnType\",\n        \"fhir.resources.conceptmap.ConceptMapGroupElementTargetDependsOn\",\n    )\n\n    ConceptMapGroupElementTargetPropertyType = create_fhir_type(\n        \"ConceptMapGroupElementTargetPropertyType\",\n        \"fhir.resources.conceptmap.ConceptMapGroupElementTargetProperty\",\n    )\n\n    ConceptMapGroupUnmappedType = create_fhir_type(\n        \"ConceptMapGroupUnmappedType\",\n        \"fhir.resources.conceptmap.ConceptMapGroupUnmapped\",\n    )\n\n    ConceptMapPropertyType = create_fhir_type(\n        \"ConceptMapPropertyType\", \"fhir.resources.conceptmap.ConceptMapProperty\"\n    )\n\n    ConditionType = create_fhir_type(\n        \"ConditionType\", \"fhir.resources.condition.Condition\"\n    )\n\n    ConditionDefinitionType = create_fhir_type(\n        \"ConditionDefinitionType\",\n        \"fhir.resources.conditiondefinition.ConditionDefinition\",\n    )\n\n    ConditionDefinitionMedicationType = create_fhir_type(\n        \"ConditionDefinitionMedicationType\",\n        \"fhir.resources.conditiondefinition.ConditionDefinitionMedication\",\n    )\n\n    ConditionDefinitionObservationType = create_fhir_type(\n        \"ConditionDefinitionObservationType\",\n        \"fhir.resources.conditiondefinition.ConditionDefinitionObservation\",\n    )\n\n    ConditionDefinitionPlanType = create_fhir_type(\n        \"ConditionDefinitionPlanType\",\n        \"fhir.resources.conditiondefinition.ConditionDefinitionPlan\",\n    )\n\n    ConditionDefinitionPreconditionType = create_fhir_type(\n        \"ConditionDefinitionPreconditionType\",\n        \"fhir.resources.conditiondefinition.ConditionDefinitionPrecondition\",\n    )\n\n    ConditionDefinitionQuestionnaireType = create_fhir_type(\n        \"ConditionDefinitionQuestionnaireType\",\n        \"fhir.resources.conditiondefinition.ConditionDefinitionQuestionnaire\",\n    )\n\n    ConditionParticipantType = create_fhir_type(\n        \"ConditionParticipantType\", \"fhir.resources.condition.ConditionParticipant\"\n    )\n\n    ConditionStageType = create_fhir_type(\n        \"ConditionStageType\", \"fhir.resources.condition.ConditionStage\"\n    )\n\n    ConsentType = create_fhir_type(\"ConsentType\", \"fhir.resources.consent.Consent\")\n\n    ConsentPolicyBasisType = create_fhir_type(\n        \"ConsentPolicyBasisType\", \"fhir.resources.consent.ConsentPolicyBasis\"\n    )\n\n    ConsentProvisionType = create_fhir_type(\n        \"ConsentProvisionType\", \"fhir.resources.consent.ConsentProvision\"\n    )\n\n    ConsentProvisionActorType = create_fhir_type(\n        \"ConsentProvisionActorType\", \"fhir.resources.consent.ConsentProvisionActor\"\n    )\n\n    ConsentProvisionDataType = create_fhir_type(\n        \"ConsentProvisionDataType\", \"fhir.resources.consent.ConsentProvisionData\"\n    )\n\n    ConsentVerificationType = create_fhir_type(\n        \"ConsentVerificationType\", \"fhir.resources.consent.ConsentVerification\"\n    )\n\n    ContactDetailType = create_fhir_type(\n        \"ContactDetailType\", \"fhir.resources.contactdetail.ContactDetail\"\n    )\n\n    ContactPointType = create_fhir_type(\n        \"ContactPointType\", \"fhir.resources.contactpoint.ContactPoint\"\n    )\n\n    ContractType = create_fhir_type(\"ContractType\", \"fhir.resources.contract.Contract\")\n\n    ContractContentDefinitionType = create_fhir_type(\n        \"ContractContentDefinitionType\",\n        \"fhir.resources.contract.ContractContentDefinition\",\n    )\n\n    ContractFriendlyType = create_fhir_type(\n        \"ContractFriendlyType\", \"fhir.resources.contract.ContractFriendly\"\n    )\n\n    ContractLegalType = create_fhir_type(\n        \"ContractLegalType\", \"fhir.resources.contract.ContractLegal\"\n    )\n\n    ContractRuleType = create_fhir_type(\n        \"ContractRuleType\", \"fhir.resources.contract.ContractRule\"\n    )\n\n    ContractSignerType = create_fhir_type(\n        \"ContractSignerType\", \"fhir.resources.contract.ContractSigner\"\n    )\n\n    ContractTermType = create_fhir_type(\n        \"ContractTermType\", \"fhir.resources.contract.ContractTerm\"\n    )\n\n    ContractTermActionType = create_fhir_type(\n        \"ContractTermActionType\", \"fhir.resources.contract.ContractTermAction\"\n    )\n\n    ContractTermActionSubjectType = create_fhir_type(\n        \"ContractTermActionSubjectType\",\n        \"fhir.resources.contract.ContractTermActionSubject\",\n    )\n\n    ContractTermAssetType = create_fhir_type(\n        \"ContractTermAssetType\", \"fhir.resources.contract.ContractTermAsset\"\n    )\n\n    ContractTermAssetContextType = create_fhir_type(\n        \"ContractTermAssetContextType\",\n        \"fhir.resources.contract.ContractTermAssetContext\",\n    )\n\n    ContractTermAssetValuedItemType = create_fhir_type(\n        \"ContractTermAssetValuedItemType\",\n        \"fhir.resources.contract.ContractTermAssetValuedItem\",\n    )\n\n    ContractTermOfferType = create_fhir_type(\n        \"ContractTermOfferType\", \"fhir.resources.contract.ContractTermOffer\"\n    )\n\n    ContractTermOfferAnswerType = create_fhir_type(\n        \"ContractTermOfferAnswerType\", \"fhir.resources.contract.ContractTermOfferAnswer\"\n    )\n\n    ContractTermOfferPartyType = create_fhir_type(\n        \"ContractTermOfferPartyType\", \"fhir.resources.contract.ContractTermOfferParty\"\n    )\n\n    ContractTermSecurityLabelType = create_fhir_type(\n        \"ContractTermSecurityLabelType\",\n        \"fhir.resources.contract.ContractTermSecurityLabel\",\n    )\n\n    ContributorType = create_fhir_type(\n        \"ContributorType\", \"fhir.resources.contributor.Contributor\"\n    )\n\n    CountType = create_fhir_type(\"CountType\", \"fhir.resources.count.Count\")\n\n    CoverageType = create_fhir_type(\"CoverageType\", \"fhir.resources.coverage.Coverage\")\n\n    CoverageClassType = create_fhir_type(\n        \"CoverageClassType\", \"fhir.resources.coverage.CoverageClass\"\n    )\n\n    CoverageCostToBeneficiaryType = create_fhir_type(\n        \"CoverageCostToBeneficiaryType\",\n        \"fhir.resources.coverage.CoverageCostToBeneficiary\",\n    )\n\n    CoverageCostToBeneficiaryExceptionType = create_fhir_type(\n        \"CoverageCostToBeneficiaryExceptionType\",\n        \"fhir.resources.coverage.CoverageCostToBeneficiaryException\",\n    )\n\n    CoverageEligibilityRequestType = create_fhir_type(\n        \"CoverageEligibilityRequestType\",\n        \"fhir.resources.coverageeligibilityrequest.CoverageEligibilityRequest\",\n    )\n\n    CoverageEligibilityRequestEventType = create_fhir_type(\n        \"CoverageEligibilityRequestEventType\",\n        \"fhir.resources.coverageeligibilityrequest.CoverageEligibilityRequestEvent\",\n    )\n\n    CoverageEligibilityRequestInsuranceType = create_fhir_type(\n        \"CoverageEligibilityRequestInsuranceType\",\n        \"fhir.resources.coverageeligibilityrequest.CoverageEligibilityRequestInsurance\",\n    )\n\n    CoverageEligibilityRequestItemType = create_fhir_type(\n        \"CoverageEligibilityRequestItemType\",\n        \"fhir.resources.coverageeligibilityrequest.CoverageEligibilityRequestItem\",\n    )\n\n    CoverageEligibilityRequestItemDiagnosisType = create_fhir_type(\n        \"CoverageEligibilityRequestItemDiagnosisType\",\n        \"fhir.resources.coverageeligibilityrequest.CoverageEligibilityRequestItemDiagnosis\",\n    )\n\n    CoverageEligibilityRequestSupportingInfoType = create_fhir_type(\n        \"CoverageEligibilityRequestSupportingInfoType\",\n        \"fhir.resources.coverageeligibilityrequest.CoverageEligibilityRequestSupportingInfo\",\n    )\n\n    CoverageEligibilityResponseType = create_fhir_type(\n        \"CoverageEligibilityResponseType\",\n        \"fhir.resources.coverageeligibilityresponse.CoverageEligibilityResponse\",\n    )\n\n    CoverageEligibilityResponseErrorType = create_fhir_type(\n        \"CoverageEligibilityResponseErrorType\",\n        \"fhir.resources.coverageeligibilityresponse.CoverageEligibilityResponseError\",\n    )\n\n    CoverageEligibilityResponseEventType = create_fhir_type(\n        \"CoverageEligibilityResponseEventType\",\n        \"fhir.resources.coverageeligibilityresponse.CoverageEligibilityResponseEvent\",\n    )\n\n    CoverageEligibilityResponseInsuranceType = create_fhir_type(\n        \"CoverageEligibilityResponseInsuranceType\",\n        \"fhir.resources.coverageeligibilityresponse.CoverageEligibilityResponseInsurance\",\n    )\n\n    CoverageEligibilityResponseInsuranceItemType = create_fhir_type(\n        \"CoverageEligibilityResponseInsuranceItemType\",\n        \"fhir.resources.coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItem\",\n    )\n\n    CoverageEligibilityResponseInsuranceItemBenefitType = create_fhir_type(\n        \"CoverageEligibilityResponseInsuranceItemBenefitType\",\n        \"fhir.resources.coverageeligibilityresponse.CoverageEligibilityResponseInsuranceItemBenefit\",\n    )\n\n    CoveragePaymentByType = create_fhir_type(\n        \"CoveragePaymentByType\", \"fhir.resources.coverage.CoveragePaymentBy\"\n    )\n\n    DataRequirementType = create_fhir_type(\n        \"DataRequirementType\", \"fhir.resources.datarequirement.DataRequirement\"\n    )\n\n    DataRequirementCodeFilterType = create_fhir_type(\n        \"DataRequirementCodeFilterType\",\n        \"fhir.resources.datarequirement.DataRequirementCodeFilter\",\n    )\n\n    DataRequirementDateFilterType = create_fhir_type(\n        \"DataRequirementDateFilterType\",\n        \"fhir.resources.datarequirement.DataRequirementDateFilter\",\n    )\n\n    DataRequirementSortType = create_fhir_type(\n        \"DataRequirementSortType\", \"fhir.resources.datarequirement.DataRequirementSort\"\n    )\n\n    DataRequirementValueFilterType = create_fhir_type(\n        \"DataRequirementValueFilterType\",\n        \"fhir.resources.datarequirement.DataRequirementValueFilter\",\n    )\n\n    DataTypeType = create_fhir_type(\"DataTypeType\", \"fhir.resources.datatype.DataType\")\n\n    DetectedIssueType = create_fhir_type(\n        \"DetectedIssueType\", \"fhir.resources.detectedissue.DetectedIssue\"\n    )\n\n    DetectedIssueEvidenceType = create_fhir_type(\n        \"DetectedIssueEvidenceType\",\n        \"fhir.resources.detectedissue.DetectedIssueEvidence\",\n    )\n\n    DetectedIssueMitigationType = create_fhir_type(\n        \"DetectedIssueMitigationType\",\n        \"fhir.resources.detectedissue.DetectedIssueMitigation\",\n    )\n\n    DeviceType = create_fhir_type(\"DeviceType\", \"fhir.resources.device.Device\")\n\n    DeviceAssociationType = create_fhir_type(\n        \"DeviceAssociationType\", \"fhir.resources.deviceassociation.DeviceAssociation\"\n    )\n\n    DeviceAssociationOperationType = create_fhir_type(\n        \"DeviceAssociationOperationType\",\n        \"fhir.resources.deviceassociation.DeviceAssociationOperation\",\n    )\n\n    DeviceConformsToType = create_fhir_type(\n        \"DeviceConformsToType\", \"fhir.resources.device.DeviceConformsTo\"\n    )\n\n    DeviceDefinitionType = create_fhir_type(\n        \"DeviceDefinitionType\", \"fhir.resources.devicedefinition.DeviceDefinition\"\n    )\n\n    DeviceDefinitionChargeItemType = create_fhir_type(\n        \"DeviceDefinitionChargeItemType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionChargeItem\",\n    )\n\n    DeviceDefinitionClassificationType = create_fhir_type(\n        \"DeviceDefinitionClassificationType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionClassification\",\n    )\n\n    DeviceDefinitionConformsToType = create_fhir_type(\n        \"DeviceDefinitionConformsToType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionConformsTo\",\n    )\n\n    DeviceDefinitionCorrectiveActionType = create_fhir_type(\n        \"DeviceDefinitionCorrectiveActionType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionCorrectiveAction\",\n    )\n\n    DeviceDefinitionDeviceNameType = create_fhir_type(\n        \"DeviceDefinitionDeviceNameType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionDeviceName\",\n    )\n\n    DeviceDefinitionGuidelineType = create_fhir_type(\n        \"DeviceDefinitionGuidelineType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionGuideline\",\n    )\n\n    DeviceDefinitionHasPartType = create_fhir_type(\n        \"DeviceDefinitionHasPartType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionHasPart\",\n    )\n\n    DeviceDefinitionLinkType = create_fhir_type(\n        \"DeviceDefinitionLinkType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionLink\",\n    )\n\n    DeviceDefinitionMaterialType = create_fhir_type(\n        \"DeviceDefinitionMaterialType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionMaterial\",\n    )\n\n    DeviceDefinitionPackagingType = create_fhir_type(\n        \"DeviceDefinitionPackagingType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionPackaging\",\n    )\n\n    DeviceDefinitionPackagingDistributorType = create_fhir_type(\n        \"DeviceDefinitionPackagingDistributorType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionPackagingDistributor\",\n    )\n\n    DeviceDefinitionPropertyType = create_fhir_type(\n        \"DeviceDefinitionPropertyType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionProperty\",\n    )\n\n    DeviceDefinitionRegulatoryIdentifierType = create_fhir_type(\n        \"DeviceDefinitionRegulatoryIdentifierType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionRegulatoryIdentifier\",\n    )\n\n    DeviceDefinitionUdiDeviceIdentifierType = create_fhir_type(\n        \"DeviceDefinitionUdiDeviceIdentifierType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionUdiDeviceIdentifier\",\n    )\n\n    DeviceDefinitionUdiDeviceIdentifierMarketDistributionType = create_fhir_type(\n        \"DeviceDefinitionUdiDeviceIdentifierMarketDistributionType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionUdiDeviceIdentifierMarketDistribution\",\n    )\n\n    DeviceDefinitionVersionType = create_fhir_type(\n        \"DeviceDefinitionVersionType\",\n        \"fhir.resources.devicedefinition.DeviceDefinitionVersion\",\n    )\n\n    DeviceDispenseType = create_fhir_type(\n        \"DeviceDispenseType\", \"fhir.resources.devicedispense.DeviceDispense\"\n    )\n\n    DeviceDispensePerformerType = create_fhir_type(\n        \"DeviceDispensePerformerType\",\n        \"fhir.resources.devicedispense.DeviceDispensePerformer\",\n    )\n\n    DeviceMetricType = create_fhir_type(\n        \"DeviceMetricType\", \"fhir.resources.devicemetric.DeviceMetric\"\n    )\n\n    DeviceMetricCalibrationType = create_fhir_type(\n        \"DeviceMetricCalibrationType\",\n        \"fhir.resources.devicemetric.DeviceMetricCalibration\",\n    )\n\n    DeviceNameType = create_fhir_type(\n        \"DeviceNameType\", \"fhir.resources.device.DeviceName\"\n    )\n\n    DevicePropertyType = create_fhir_type(\n        \"DevicePropertyType\", \"fhir.resources.device.DeviceProperty\"\n    )\n\n    DeviceRequestType = create_fhir_type(\n        \"DeviceRequestType\", \"fhir.resources.devicerequest.DeviceRequest\"\n    )\n\n    DeviceRequestParameterType = create_fhir_type(\n        \"DeviceRequestParameterType\",\n        \"fhir.resources.devicerequest.DeviceRequestParameter\",\n    )\n\n    DeviceUdiCarrierType = create_fhir_type(\n        \"DeviceUdiCarrierType\", \"fhir.resources.device.DeviceUdiCarrier\"\n    )\n\n    DeviceUsageType = create_fhir_type(\n        \"DeviceUsageType\", \"fhir.resources.deviceusage.DeviceUsage\"\n    )\n\n    DeviceUsageAdherenceType = create_fhir_type(\n        \"DeviceUsageAdherenceType\", \"fhir.resources.deviceusage.DeviceUsageAdherence\"\n    )\n\n    DeviceVersionType = create_fhir_type(\n        \"DeviceVersionType\", \"fhir.resources.device.DeviceVersion\"\n    )\n\n    DiagnosticReportType = create_fhir_type(\n        \"DiagnosticReportType\", \"fhir.resources.diagnosticreport.DiagnosticReport\"\n    )\n\n    DiagnosticReportMediaType = create_fhir_type(\n        \"DiagnosticReportMediaType\",\n        \"fhir.resources.diagnosticreport.DiagnosticReportMedia\",\n    )\n\n    DiagnosticReportSupportingInfoType = create_fhir_type(\n        \"DiagnosticReportSupportingInfoType\",\n        \"fhir.resources.diagnosticreport.DiagnosticReportSupportingInfo\",\n    )\n\n    DistanceType = create_fhir_type(\"DistanceType\", \"fhir.resources.distance.Distance\")\n\n    DocumentReferenceType = create_fhir_type(\n        \"DocumentReferenceType\", \"fhir.resources.documentreference.DocumentReference\"\n    )\n\n    DocumentReferenceAttesterType = create_fhir_type(\n        \"DocumentReferenceAttesterType\",\n        \"fhir.resources.documentreference.DocumentReferenceAttester\",\n    )\n\n    DocumentReferenceContentType = create_fhir_type(\n        \"DocumentReferenceContentType\",\n        \"fhir.resources.documentreference.DocumentReferenceContent\",\n    )\n\n    DocumentReferenceContentProfileType = create_fhir_type(\n        \"DocumentReferenceContentProfileType\",\n        \"fhir.resources.documentreference.DocumentReferenceContentProfile\",\n    )\n\n    DocumentReferenceRelatesToType = create_fhir_type(\n        \"DocumentReferenceRelatesToType\",\n        \"fhir.resources.documentreference.DocumentReferenceRelatesTo\",\n    )\n\n    DomainResourceType = create_fhir_type(\n        \"DomainResourceType\", \"fhir.resources.domainresource.DomainResource\"\n    )\n\n    DosageType = create_fhir_type(\"DosageType\", \"fhir.resources.dosage.Dosage\")\n\n    DosageDoseAndRateType = create_fhir_type(\n        \"DosageDoseAndRateType\", \"fhir.resources.dosage.DosageDoseAndRate\"\n    )\n\n    DurationType = create_fhir_type(\"DurationType\", \"fhir.resources.duration.Duration\")\n\n    ElementDefinitionType = create_fhir_type(\n        \"ElementDefinitionType\", \"fhir.resources.elementdefinition.ElementDefinition\"\n    )\n\n    ElementDefinitionBaseType = create_fhir_type(\n        \"ElementDefinitionBaseType\",\n        \"fhir.resources.elementdefinition.ElementDefinitionBase\",\n    )\n\n    ElementDefinitionBindingType = create_fhir_type(\n        \"ElementDefinitionBindingType\",\n        \"fhir.resources.elementdefinition.ElementDefinitionBinding\",\n    )\n\n    ElementDefinitionBindingAdditionalType = create_fhir_type(\n        \"ElementDefinitionBindingAdditionalType\",\n        \"fhir.resources.elementdefinition.ElementDefinitionBindingAdditional\",\n    )\n\n    ElementDefinitionConstraintType = create_fhir_type(\n        \"ElementDefinitionConstraintType\",\n        \"fhir.resources.elementdefinition.ElementDefinitionConstraint\",\n    )\n\n    ElementDefinitionExampleType = create_fhir_type(\n        \"ElementDefinitionExampleType\",\n        \"fhir.resources.elementdefinition.ElementDefinitionExample\",\n    )\n\n    ElementDefinitionMappingType = create_fhir_type(\n        \"ElementDefinitionMappingType\",\n        \"fhir.resources.elementdefinition.ElementDefinitionMapping\",\n    )\n\n    ElementDefinitionSlicingType = create_fhir_type(\n        \"ElementDefinitionSlicingType\",\n        \"fhir.resources.elementdefinition.ElementDefinitionSlicing\",\n    )\n\n    ElementDefinitionSlicingDiscriminatorType = create_fhir_type(\n        \"ElementDefinitionSlicingDiscriminatorType\",\n        \"fhir.resources.elementdefinition.ElementDefinitionSlicingDiscriminator\",\n    )\n\n    ElementDefinitionTypeType = create_fhir_type(\n        \"ElementDefinitionTypeType\",\n        \"fhir.resources.elementdefinition.ElementDefinitionType\",\n    )\n\n    EncounterType = create_fhir_type(\n        \"EncounterType\", \"fhir.resources.encounter.Encounter\"\n    )\n\n    EncounterAdmissionType = create_fhir_type(\n        \"EncounterAdmissionType\", \"fhir.resources.encounter.EncounterAdmission\"\n    )\n\n    EncounterDiagnosisType = create_fhir_type(\n        \"EncounterDiagnosisType\", \"fhir.resources.encounter.EncounterDiagnosis\"\n    )\n\n    EncounterHistoryType = create_fhir_type(\n        \"EncounterHistoryType\", \"fhir.resources.encounterhistory.EncounterHistory\"\n    )\n\n    EncounterHistoryLocationType = create_fhir_type(\n        \"EncounterHistoryLocationType\",\n        \"fhir.resources.encounterhistory.EncounterHistoryLocation\",\n    )\n\n    EncounterLocationType = create_fhir_type(\n        \"EncounterLocationType\", \"fhir.resources.encounter.EncounterLocation\"\n    )\n\n    EncounterParticipantType = create_fhir_type(\n        \"EncounterParticipantType\", \"fhir.resources.encounter.EncounterParticipant\"\n    )\n\n    EncounterReasonType = create_fhir_type(\n        \"EncounterReasonType\", \"fhir.resources.encounter.EncounterReason\"\n    )\n\n    EndpointType = create_fhir_type(\"EndpointType\", \"fhir.resources.endpoint.Endpoint\")\n\n    EndpointPayloadType = create_fhir_type(\n        \"EndpointPayloadType\", \"fhir.resources.endpoint.EndpointPayload\"\n    )\n\n    EnrollmentRequestType = create_fhir_type(\n        \"EnrollmentRequestType\", \"fhir.resources.enrollmentrequest.EnrollmentRequest\"\n    )\n\n    EnrollmentResponseType = create_fhir_type(\n        \"EnrollmentResponseType\", \"fhir.resources.enrollmentresponse.EnrollmentResponse\"\n    )\n\n    EpisodeOfCareType = create_fhir_type(\n        \"EpisodeOfCareType\", \"fhir.resources.episodeofcare.EpisodeOfCare\"\n    )\n\n    EpisodeOfCareDiagnosisType = create_fhir_type(\n        \"EpisodeOfCareDiagnosisType\",\n        \"fhir.resources.episodeofcare.EpisodeOfCareDiagnosis\",\n    )\n\n    EpisodeOfCareReasonType = create_fhir_type(\n        \"EpisodeOfCareReasonType\", \"fhir.resources.episodeofcare.EpisodeOfCareReason\"\n    )\n\n    EpisodeOfCareStatusHistoryType = create_fhir_type(\n        \"EpisodeOfCareStatusHistoryType\",\n        \"fhir.resources.episodeofcare.EpisodeOfCareStatusHistory\",\n    )\n\n    EventDefinitionType = create_fhir_type(\n        \"EventDefinitionType\", \"fhir.resources.eventdefinition.EventDefinition\"\n    )\n\n    EvidenceType = create_fhir_type(\"EvidenceType\", \"fhir.resources.evidence.Evidence\")\n\n    EvidenceCertaintyType = create_fhir_type(\n        \"EvidenceCertaintyType\", \"fhir.resources.evidence.EvidenceCertainty\"\n    )\n\n    EvidenceReportType = create_fhir_type(\n        \"EvidenceReportType\", \"fhir.resources.evidencereport.EvidenceReport\"\n    )\n\n    EvidenceReportRelatesToType = create_fhir_type(\n        \"EvidenceReportRelatesToType\",\n        \"fhir.resources.evidencereport.EvidenceReportRelatesTo\",\n    )\n\n    EvidenceReportRelatesToTargetType = create_fhir_type(\n        \"EvidenceReportRelatesToTargetType\",\n        \"fhir.resources.evidencereport.EvidenceReportRelatesToTarget\",\n    )\n\n    EvidenceReportSectionType = create_fhir_type(\n        \"EvidenceReportSectionType\",\n        \"fhir.resources.evidencereport.EvidenceReportSection\",\n    )\n\n    EvidenceReportSubjectType = create_fhir_type(\n        \"EvidenceReportSubjectType\",\n        \"fhir.resources.evidencereport.EvidenceReportSubject\",\n    )\n\n    EvidenceReportSubjectCharacteristicType = create_fhir_type(\n        \"EvidenceReportSubjectCharacteristicType\",\n        \"fhir.resources.evidencereport.EvidenceReportSubjectCharacteristic\",\n    )\n\n    EvidenceStatisticType = create_fhir_type(\n        \"EvidenceStatisticType\", \"fhir.resources.evidence.EvidenceStatistic\"\n    )\n\n    EvidenceStatisticAttributeEstimateType = create_fhir_type(\n        \"EvidenceStatisticAttributeEstimateType\",\n        \"fhir.resources.evidence.EvidenceStatisticAttributeEstimate\",\n    )\n\n    EvidenceStatisticModelCharacteristicType = create_fhir_type(\n        \"EvidenceStatisticModelCharacteristicType\",\n        \"fhir.resources.evidence.EvidenceStatisticModelCharacteristic\",\n    )\n\n    EvidenceStatisticModelCharacteristicVariableType = create_fhir_type(\n        \"EvidenceStatisticModelCharacteristicVariableType\",\n        \"fhir.resources.evidence.EvidenceStatisticModelCharacteristicVariable\",\n    )\n\n    EvidenceStatisticSampleSizeType = create_fhir_type(\n        \"EvidenceStatisticSampleSizeType\",\n        \"fhir.resources.evidence.EvidenceStatisticSampleSize\",\n    )\n\n    EvidenceVariableType = create_fhir_type(\n        \"EvidenceVariableType\", \"fhir.resources.evidencevariable.EvidenceVariable\"\n    )\n\n    EvidenceVariableCategoryType = create_fhir_type(\n        \"EvidenceVariableCategoryType\",\n        \"fhir.resources.evidencevariable.EvidenceVariableCategory\",\n    )\n\n    EvidenceVariableCharacteristicType = create_fhir_type(\n        \"EvidenceVariableCharacteristicType\",\n        \"fhir.resources.evidencevariable.EvidenceVariableCharacteristic\",\n    )\n\n    EvidenceVariableCharacteristicDefinitionByCombinationType = create_fhir_type(\n        \"EvidenceVariableCharacteristicDefinitionByCombinationType\",\n        \"fhir.resources.evidencevariable.EvidenceVariableCharacteristicDefinitionByCombination\",\n    )\n\n    EvidenceVariableCharacteristicDefinitionByTypeAndValueType = create_fhir_type(\n        \"EvidenceVariableCharacteristicDefinitionByTypeAndValueType\",\n        \"fhir.resources.evidencevariable.EvidenceVariableCharacteristicDefinitionByTypeAndValue\",\n    )\n\n    EvidenceVariableCharacteristicTimeFromEventType = create_fhir_type(\n        \"EvidenceVariableCharacteristicTimeFromEventType\",\n        \"fhir.resources.evidencevariable.EvidenceVariableCharacteristicTimeFromEvent\",\n    )\n\n    EvidenceVariableDefinitionType = create_fhir_type(\n        \"EvidenceVariableDefinitionType\",\n        \"fhir.resources.evidence.EvidenceVariableDefinition\",\n    )\n\n    ExampleScenarioType = create_fhir_type(\n        \"ExampleScenarioType\", \"fhir.resources.examplescenario.ExampleScenario\"\n    )\n\n    ExampleScenarioActorType = create_fhir_type(\n        \"ExampleScenarioActorType\",\n        \"fhir.resources.examplescenario.ExampleScenarioActor\",\n    )\n\n    ExampleScenarioInstanceType = create_fhir_type(\n        \"ExampleScenarioInstanceType\",\n        \"fhir.resources.examplescenario.ExampleScenarioInstance\",\n    )\n\n    ExampleScenarioInstanceContainedInstanceType = create_fhir_type(\n        \"ExampleScenarioInstanceContainedInstanceType\",\n        \"fhir.resources.examplescenario.ExampleScenarioInstanceContainedInstance\",\n    )\n\n    ExampleScenarioInstanceVersionType = create_fhir_type(\n        \"ExampleScenarioInstanceVersionType\",\n        \"fhir.resources.examplescenario.ExampleScenarioInstanceVersion\",\n    )\n\n    ExampleScenarioProcessType = create_fhir_type(\n        \"ExampleScenarioProcessType\",\n        \"fhir.resources.examplescenario.ExampleScenarioProcess\",\n    )\n\n    ExampleScenarioProcessStepType = create_fhir_type(\n        \"ExampleScenarioProcessStepType\",\n        \"fhir.resources.examplescenario.ExampleScenarioProcessStep\",\n    )\n\n    ExampleScenarioProcessStepAlternativeType = create_fhir_type(\n        \"ExampleScenarioProcessStepAlternativeType\",\n        \"fhir.resources.examplescenario.ExampleScenarioProcessStepAlternative\",\n    )\n\n    ExampleScenarioProcessStepOperationType = create_fhir_type(\n        \"ExampleScenarioProcessStepOperationType\",\n        \"fhir.resources.examplescenario.ExampleScenarioProcessStepOperation\",\n    )\n\n    ExplanationOfBenefitType = create_fhir_type(\n        \"ExplanationOfBenefitType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefit\",\n    )\n\n    ExplanationOfBenefitAccidentType = create_fhir_type(\n        \"ExplanationOfBenefitAccidentType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitAccident\",\n    )\n\n    ExplanationOfBenefitAddItemType = create_fhir_type(\n        \"ExplanationOfBenefitAddItemType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitAddItem\",\n    )\n\n    ExplanationOfBenefitAddItemBodySiteType = create_fhir_type(\n        \"ExplanationOfBenefitAddItemBodySiteType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitAddItemBodySite\",\n    )\n\n    ExplanationOfBenefitAddItemDetailType = create_fhir_type(\n        \"ExplanationOfBenefitAddItemDetailType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitAddItemDetail\",\n    )\n\n    ExplanationOfBenefitAddItemDetailSubDetailType = create_fhir_type(\n        \"ExplanationOfBenefitAddItemDetailSubDetailType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitAddItemDetailSubDetail\",\n    )\n\n    ExplanationOfBenefitBenefitBalanceType = create_fhir_type(\n        \"ExplanationOfBenefitBenefitBalanceType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitBenefitBalance\",\n    )\n\n    ExplanationOfBenefitBenefitBalanceFinancialType = create_fhir_type(\n        \"ExplanationOfBenefitBenefitBalanceFinancialType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitBenefitBalanceFinancial\",\n    )\n\n    ExplanationOfBenefitCareTeamType = create_fhir_type(\n        \"ExplanationOfBenefitCareTeamType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitCareTeam\",\n    )\n\n    ExplanationOfBenefitDiagnosisType = create_fhir_type(\n        \"ExplanationOfBenefitDiagnosisType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitDiagnosis\",\n    )\n\n    ExplanationOfBenefitEventType = create_fhir_type(\n        \"ExplanationOfBenefitEventType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitEvent\",\n    )\n\n    ExplanationOfBenefitInsuranceType = create_fhir_type(\n        \"ExplanationOfBenefitInsuranceType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitInsurance\",\n    )\n\n    ExplanationOfBenefitItemType = create_fhir_type(\n        \"ExplanationOfBenefitItemType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitItem\",\n    )\n\n    ExplanationOfBenefitItemAdjudicationType = create_fhir_type(\n        \"ExplanationOfBenefitItemAdjudicationType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitItemAdjudication\",\n    )\n\n    ExplanationOfBenefitItemBodySiteType = create_fhir_type(\n        \"ExplanationOfBenefitItemBodySiteType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitItemBodySite\",\n    )\n\n    ExplanationOfBenefitItemDetailType = create_fhir_type(\n        \"ExplanationOfBenefitItemDetailType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitItemDetail\",\n    )\n\n    ExplanationOfBenefitItemDetailSubDetailType = create_fhir_type(\n        \"ExplanationOfBenefitItemDetailSubDetailType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitItemDetailSubDetail\",\n    )\n\n    ExplanationOfBenefitItemReviewOutcomeType = create_fhir_type(\n        \"ExplanationOfBenefitItemReviewOutcomeType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitItemReviewOutcome\",\n    )\n\n    ExplanationOfBenefitPayeeType = create_fhir_type(\n        \"ExplanationOfBenefitPayeeType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitPayee\",\n    )\n\n    ExplanationOfBenefitPaymentType = create_fhir_type(\n        \"ExplanationOfBenefitPaymentType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitPayment\",\n    )\n\n    ExplanationOfBenefitProcedureType = create_fhir_type(\n        \"ExplanationOfBenefitProcedureType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitProcedure\",\n    )\n\n    ExplanationOfBenefitProcessNoteType = create_fhir_type(\n        \"ExplanationOfBenefitProcessNoteType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitProcessNote\",\n    )\n\n    ExplanationOfBenefitRelatedType = create_fhir_type(\n        \"ExplanationOfBenefitRelatedType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitRelated\",\n    )\n\n    ExplanationOfBenefitSupportingInfoType = create_fhir_type(\n        \"ExplanationOfBenefitSupportingInfoType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitSupportingInfo\",\n    )\n\n    ExplanationOfBenefitTotalType = create_fhir_type(\n        \"ExplanationOfBenefitTotalType\",\n        \"fhir.resources.explanationofbenefit.ExplanationOfBenefitTotal\",\n    )\n\n    ExpressionType = create_fhir_type(\n        \"ExpressionType\", \"fhir.resources.expression.Expression\"\n    )\n\n    ExtendedContactDetailType = create_fhir_type(\n        \"ExtendedContactDetailType\",\n        \"fhir.resources.extendedcontactdetail.ExtendedContactDetail\",\n    )\n\n    ExtensionType = create_fhir_type(\n        \"ExtensionType\", \"fhir.resources.extension.Extension\"\n    )\n\n    FamilyMemberHistoryType = create_fhir_type(\n        \"FamilyMemberHistoryType\",\n        \"fhir.resources.familymemberhistory.FamilyMemberHistory\",\n    )\n\n    FamilyMemberHistoryConditionType = create_fhir_type(\n        \"FamilyMemberHistoryConditionType\",\n        \"fhir.resources.familymemberhistory.FamilyMemberHistoryCondition\",\n    )\n\n    FamilyMemberHistoryParticipantType = create_fhir_type(\n        \"FamilyMemberHistoryParticipantType\",\n        \"fhir.resources.familymemberhistory.FamilyMemberHistoryParticipant\",\n    )\n\n    FamilyMemberHistoryProcedureType = create_fhir_type(\n        \"FamilyMemberHistoryProcedureType\",\n        \"fhir.resources.familymemberhistory.FamilyMemberHistoryProcedure\",\n    )\n\n    FlagType = create_fhir_type(\"FlagType\", \"fhir.resources.flag.Flag\")\n\n    FormularyItemType = create_fhir_type(\n        \"FormularyItemType\", \"fhir.resources.formularyitem.FormularyItem\"\n    )\n\n    GenomicStudyType = create_fhir_type(\n        \"GenomicStudyType\", \"fhir.resources.genomicstudy.GenomicStudy\"\n    )\n\n    GenomicStudyAnalysisType = create_fhir_type(\n        \"GenomicStudyAnalysisType\", \"fhir.resources.genomicstudy.GenomicStudyAnalysis\"\n    )\n\n    GenomicStudyAnalysisDeviceType = create_fhir_type(\n        \"GenomicStudyAnalysisDeviceType\",\n        \"fhir.resources.genomicstudy.GenomicStudyAnalysisDevice\",\n    )\n\n    GenomicStudyAnalysisInputType = create_fhir_type(\n        \"GenomicStudyAnalysisInputType\",\n        \"fhir.resources.genomicstudy.GenomicStudyAnalysisInput\",\n    )\n\n    GenomicStudyAnalysisOutputType = create_fhir_type(\n        \"GenomicStudyAnalysisOutputType\",\n        \"fhir.resources.genomicstudy.GenomicStudyAnalysisOutput\",\n    )\n\n    GenomicStudyAnalysisPerformerType = create_fhir_type(\n        \"GenomicStudyAnalysisPerformerType\",\n        \"fhir.resources.genomicstudy.GenomicStudyAnalysisPerformer\",\n    )\n\n    GoalType = create_fhir_type(\"GoalType\", \"fhir.resources.goal.Goal\")\n\n    GoalTargetType = create_fhir_type(\n        \"GoalTargetType\", \"fhir.resources.goal.GoalTarget\"\n    )\n\n    GraphDefinitionType = create_fhir_type(\n        \"GraphDefinitionType\", \"fhir.resources.graphdefinition.GraphDefinition\"\n    )\n\n    GraphDefinitionLinkType = create_fhir_type(\n        \"GraphDefinitionLinkType\", \"fhir.resources.graphdefinition.GraphDefinitionLink\"\n    )\n\n    GraphDefinitionLinkCompartmentType = create_fhir_type(\n        \"GraphDefinitionLinkCompartmentType\",\n        \"fhir.resources.graphdefinition.GraphDefinitionLinkCompartment\",\n    )\n\n    GraphDefinitionNodeType = create_fhir_type(\n        \"GraphDefinitionNodeType\", \"fhir.resources.graphdefinition.GraphDefinitionNode\"\n    )\n\n    GroupType = create_fhir_type(\"GroupType\", \"fhir.resources.group.Group\")\n\n    GroupCharacteristicType = create_fhir_type(\n        \"GroupCharacteristicType\", \"fhir.resources.group.GroupCharacteristic\"\n    )\n\n    GroupMemberType = create_fhir_type(\n        \"GroupMemberType\", \"fhir.resources.group.GroupMember\"\n    )\n\n    GuidanceResponseType = create_fhir_type(\n        \"GuidanceResponseType\", \"fhir.resources.guidanceresponse.GuidanceResponse\"\n    )\n\n    HealthcareServiceType = create_fhir_type(\n        \"HealthcareServiceType\", \"fhir.resources.healthcareservice.HealthcareService\"\n    )\n\n    HealthcareServiceEligibilityType = create_fhir_type(\n        \"HealthcareServiceEligibilityType\",\n        \"fhir.resources.healthcareservice.HealthcareServiceEligibility\",\n    )\n\n    HumanNameType = create_fhir_type(\n        \"HumanNameType\", \"fhir.resources.humanname.HumanName\"\n    )\n\n    IdentifierType = create_fhir_type(\n        \"IdentifierType\", \"fhir.resources.identifier.Identifier\"\n    )\n\n    ImagingSelectionType = create_fhir_type(\n        \"ImagingSelectionType\", \"fhir.resources.imagingselection.ImagingSelection\"\n    )\n\n    ImagingSelectionInstanceType = create_fhir_type(\n        \"ImagingSelectionInstanceType\",\n        \"fhir.resources.imagingselection.ImagingSelectionInstance\",\n    )\n\n    ImagingSelectionInstanceImageRegion2DType = create_fhir_type(\n        \"ImagingSelectionInstanceImageRegion2DType\",\n        \"fhir.resources.imagingselection.ImagingSelectionInstanceImageRegion2D\",\n    )\n\n    ImagingSelectionInstanceImageRegion3DType = create_fhir_type(\n        \"ImagingSelectionInstanceImageRegion3DType\",\n        \"fhir.resources.imagingselection.ImagingSelectionInstanceImageRegion3D\",\n    )\n\n    ImagingSelectionPerformerType = create_fhir_type(\n        \"ImagingSelectionPerformerType\",\n        \"fhir.resources.imagingselection.ImagingSelectionPerformer\",\n    )\n\n    ImagingStudyType = create_fhir_type(\n        \"ImagingStudyType\", \"fhir.resources.imagingstudy.ImagingStudy\"\n    )\n\n    ImagingStudySeriesType = create_fhir_type(\n        \"ImagingStudySeriesType\", \"fhir.resources.imagingstudy.ImagingStudySeries\"\n    )\n\n    ImagingStudySeriesInstanceType = create_fhir_type(\n        \"ImagingStudySeriesInstanceType\",\n        \"fhir.resources.imagingstudy.ImagingStudySeriesInstance\",\n    )\n\n    ImagingStudySeriesPerformerType = create_fhir_type(\n        \"ImagingStudySeriesPerformerType\",\n        \"fhir.resources.imagingstudy.ImagingStudySeriesPerformer\",\n    )\n\n    ImmunizationType = create_fhir_type(\n        \"ImmunizationType\", \"fhir.resources.immunization.Immunization\"\n    )\n\n    ImmunizationEvaluationType = create_fhir_type(\n        \"ImmunizationEvaluationType\",\n        \"fhir.resources.immunizationevaluation.ImmunizationEvaluation\",\n    )\n\n    ImmunizationPerformerType = create_fhir_type(\n        \"ImmunizationPerformerType\", \"fhir.resources.immunization.ImmunizationPerformer\"\n    )\n\n    ImmunizationProgramEligibilityType = create_fhir_type(\n        \"ImmunizationProgramEligibilityType\",\n        \"fhir.resources.immunization.ImmunizationProgramEligibility\",\n    )\n\n    ImmunizationProtocolAppliedType = create_fhir_type(\n        \"ImmunizationProtocolAppliedType\",\n        \"fhir.resources.immunization.ImmunizationProtocolApplied\",\n    )\n\n    ImmunizationReactionType = create_fhir_type(\n        \"ImmunizationReactionType\", \"fhir.resources.immunization.ImmunizationReaction\"\n    )\n\n    ImmunizationRecommendationType = create_fhir_type(\n        \"ImmunizationRecommendationType\",\n        \"fhir.resources.immunizationrecommendation.ImmunizationRecommendation\",\n    )\n\n    ImmunizationRecommendationRecommendationType = create_fhir_type(\n        \"ImmunizationRecommendationRecommendationType\",\n        \"fhir.resources.immunizationrecommendation.ImmunizationRecommendationRecommendation\",\n    )\n\n    ImmunizationRecommendationRecommendationDateCriterionType = create_fhir_type(\n        \"ImmunizationRecommendationRecommendationDateCriterionType\",\n        \"fhir.resources.immunizationrecommendation.ImmunizationRecommendationRecommendationDateCriterion\",\n    )\n\n    ImplementationGuideType = create_fhir_type(\n        \"ImplementationGuideType\",\n        \"fhir.resources.implementationguide.ImplementationGuide\",\n    )\n\n    ImplementationGuideDefinitionType = create_fhir_type(\n        \"ImplementationGuideDefinitionType\",\n        \"fhir.resources.implementationguide.ImplementationGuideDefinition\",\n    )\n\n    ImplementationGuideDefinitionGroupingType = create_fhir_type(\n        \"ImplementationGuideDefinitionGroupingType\",\n        \"fhir.resources.implementationguide.ImplementationGuideDefinitionGrouping\",\n    )\n\n    ImplementationGuideDefinitionPageType = create_fhir_type(\n        \"ImplementationGuideDefinitionPageType\",\n        \"fhir.resources.implementationguide.ImplementationGuideDefinitionPage\",\n    )\n\n    ImplementationGuideDefinitionParameterType = create_fhir_type(\n        \"ImplementationGuideDefinitionParameterType\",\n        \"fhir.resources.implementationguide.ImplementationGuideDefinitionParameter\",\n    )\n\n    ImplementationGuideDefinitionResourceType = create_fhir_type(\n        \"ImplementationGuideDefinitionResourceType\",\n        \"fhir.resources.implementationguide.ImplementationGuideDefinitionResource\",\n    )\n\n    ImplementationGuideDefinitionTemplateType = create_fhir_type(\n        \"ImplementationGuideDefinitionTemplateType\",\n        \"fhir.resources.implementationguide.ImplementationGuideDefinitionTemplate\",\n    )\n\n    ImplementationGuideDependsOnType = create_fhir_type(\n        \"ImplementationGuideDependsOnType\",\n        \"fhir.resources.implementationguide.ImplementationGuideDependsOn\",\n    )\n\n    ImplementationGuideGlobalType = create_fhir_type(\n        \"ImplementationGuideGlobalType\",\n        \"fhir.resources.implementationguide.ImplementationGuideGlobal\",\n    )\n\n    ImplementationGuideManifestType = create_fhir_type(\n        \"ImplementationGuideManifestType\",\n        \"fhir.resources.implementationguide.ImplementationGuideManifest\",\n    )\n\n    ImplementationGuideManifestPageType = create_fhir_type(\n        \"ImplementationGuideManifestPageType\",\n        \"fhir.resources.implementationguide.ImplementationGuideManifestPage\",\n    )\n\n    ImplementationGuideManifestResourceType = create_fhir_type(\n        \"ImplementationGuideManifestResourceType\",\n        \"fhir.resources.implementationguide.ImplementationGuideManifestResource\",\n    )\n\n    IngredientType = create_fhir_type(\n        \"IngredientType\", \"fhir.resources.ingredient.Ingredient\"\n    )\n\n    IngredientManufacturerType = create_fhir_type(\n        \"IngredientManufacturerType\", \"fhir.resources.ingredient.IngredientManufacturer\"\n    )\n\n    IngredientSubstanceType = create_fhir_type(\n        \"IngredientSubstanceType\", \"fhir.resources.ingredient.IngredientSubstance\"\n    )\n\n    IngredientSubstanceStrengthType = create_fhir_type(\n        \"IngredientSubstanceStrengthType\",\n        \"fhir.resources.ingredient.IngredientSubstanceStrength\",\n    )\n\n    IngredientSubstanceStrengthReferenceStrengthType = create_fhir_type(\n        \"IngredientSubstanceStrengthReferenceStrengthType\",\n        \"fhir.resources.ingredient.IngredientSubstanceStrengthReferenceStrength\",\n    )\n\n    InsurancePlanType = create_fhir_type(\n        \"InsurancePlanType\", \"fhir.resources.insuranceplan.InsurancePlan\"\n    )\n\n    InsurancePlanCoverageType = create_fhir_type(\n        \"InsurancePlanCoverageType\",\n        \"fhir.resources.insuranceplan.InsurancePlanCoverage\",\n    )\n\n    InsurancePlanCoverageBenefitType = create_fhir_type(\n        \"InsurancePlanCoverageBenefitType\",\n        \"fhir.resources.insuranceplan.InsurancePlanCoverageBenefit\",\n    )\n\n    InsurancePlanCoverageBenefitLimitType = create_fhir_type(\n        \"InsurancePlanCoverageBenefitLimitType\",\n        \"fhir.resources.insuranceplan.InsurancePlanCoverageBenefitLimit\",\n    )\n\n    InsurancePlanPlanType = create_fhir_type(\n        \"InsurancePlanPlanType\", \"fhir.resources.insuranceplan.InsurancePlanPlan\"\n    )\n\n    InsurancePlanPlanGeneralCostType = create_fhir_type(\n        \"InsurancePlanPlanGeneralCostType\",\n        \"fhir.resources.insuranceplan.InsurancePlanPlanGeneralCost\",\n    )\n\n    InsurancePlanPlanSpecificCostType = create_fhir_type(\n        \"InsurancePlanPlanSpecificCostType\",\n        \"fhir.resources.insuranceplan.InsurancePlanPlanSpecificCost\",\n    )\n\n    InsurancePlanPlanSpecificCostBenefitType = create_fhir_type(\n        \"InsurancePlanPlanSpecificCostBenefitType\",\n        \"fhir.resources.insuranceplan.InsurancePlanPlanSpecificCostBenefit\",\n    )\n\n    InsurancePlanPlanSpecificCostBenefitCostType = create_fhir_type(\n        \"InsurancePlanPlanSpecificCostBenefitCostType\",\n        \"fhir.resources.insuranceplan.InsurancePlanPlanSpecificCostBenefitCost\",\n    )\n\n    InventoryItemType = create_fhir_type(\n        \"InventoryItemType\", \"fhir.resources.inventoryitem.InventoryItem\"\n    )\n\n    InventoryItemAssociationType = create_fhir_type(\n        \"InventoryItemAssociationType\",\n        \"fhir.resources.inventoryitem.InventoryItemAssociation\",\n    )\n\n    InventoryItemCharacteristicType = create_fhir_type(\n        \"InventoryItemCharacteristicType\",\n        \"fhir.resources.inventoryitem.InventoryItemCharacteristic\",\n    )\n\n    InventoryItemDescriptionType = create_fhir_type(\n        \"InventoryItemDescriptionType\",\n        \"fhir.resources.inventoryitem.InventoryItemDescription\",\n    )\n\n    InventoryItemInstanceType = create_fhir_type(\n        \"InventoryItemInstanceType\",\n        \"fhir.resources.inventoryitem.InventoryItemInstance\",\n    )\n\n    InventoryItemNameType = create_fhir_type(\n        \"InventoryItemNameType\", \"fhir.resources.inventoryitem.InventoryItemName\"\n    )\n\n    InventoryItemResponsibleOrganizationType = create_fhir_type(\n        \"InventoryItemResponsibleOrganizationType\",\n        \"fhir.resources.inventoryitem.InventoryItemResponsibleOrganization\",\n    )\n\n    InventoryReportType = create_fhir_type(\n        \"InventoryReportType\", \"fhir.resources.inventoryreport.InventoryReport\"\n    )\n\n    InventoryReportInventoryListingType = create_fhir_type(\n        \"InventoryReportInventoryListingType\",\n        \"fhir.resources.inventoryreport.InventoryReportInventoryListing\",\n    )\n\n    InventoryReportInventoryListingItemType = create_fhir_type(\n        \"InventoryReportInventoryListingItemType\",\n        \"fhir.resources.inventoryreport.InventoryReportInventoryListingItem\",\n    )\n\n    InvoiceType = create_fhir_type(\"InvoiceType\", \"fhir.resources.invoice.Invoice\")\n\n    InvoiceLineItemType = create_fhir_type(\n        \"InvoiceLineItemType\", \"fhir.resources.invoice.InvoiceLineItem\"\n    )\n\n    InvoiceParticipantType = create_fhir_type(\n        \"InvoiceParticipantType\", \"fhir.resources.invoice.InvoiceParticipant\"\n    )\n\n    LibraryType = create_fhir_type(\"LibraryType\", \"fhir.resources.library.Library\")\n\n    LinkageType = create_fhir_type(\"LinkageType\", \"fhir.resources.linkage.Linkage\")\n\n    LinkageItemType = create_fhir_type(\n        \"LinkageItemType\", \"fhir.resources.linkage.LinkageItem\"\n    )\n\n    ListType = create_fhir_type(\"ListType\", \"fhir.resources.list.List\")\n\n    ListEntryType = create_fhir_type(\"ListEntryType\", \"fhir.resources.list.ListEntry\")\n\n    LocationType = create_fhir_type(\"LocationType\", \"fhir.resources.location.Location\")\n\n    LocationPositionType = create_fhir_type(\n        \"LocationPositionType\", \"fhir.resources.location.LocationPosition\"\n    )\n\n    ManufacturedItemDefinitionType = create_fhir_type(\n        \"ManufacturedItemDefinitionType\",\n        \"fhir.resources.manufactureditemdefinition.ManufacturedItemDefinition\",\n    )\n\n    ManufacturedItemDefinitionComponentType = create_fhir_type(\n        \"ManufacturedItemDefinitionComponentType\",\n        \"fhir.resources.manufactureditemdefinition.ManufacturedItemDefinitionComponent\",\n    )\n\n    ManufacturedItemDefinitionComponentConstituentType = create_fhir_type(\n        \"ManufacturedItemDefinitionComponentConstituentType\",\n        \"fhir.resources.manufactureditemdefinition.ManufacturedItemDefinitionComponentConstituent\",\n    )\n\n    ManufacturedItemDefinitionPropertyType = create_fhir_type(\n        \"ManufacturedItemDefinitionPropertyType\",\n        \"fhir.resources.manufactureditemdefinition.ManufacturedItemDefinitionProperty\",\n    )\n\n    MarketingStatusType = create_fhir_type(\n        \"MarketingStatusType\", \"fhir.resources.marketingstatus.MarketingStatus\"\n    )\n\n    MeasureType = create_fhir_type(\"MeasureType\", \"fhir.resources.measure.Measure\")\n\n    MeasureGroupType = create_fhir_type(\n        \"MeasureGroupType\", \"fhir.resources.measure.MeasureGroup\"\n    )\n\n    MeasureGroupPopulationType = create_fhir_type(\n        \"MeasureGroupPopulationType\", \"fhir.resources.measure.MeasureGroupPopulation\"\n    )\n\n    MeasureGroupStratifierType = create_fhir_type(\n        \"MeasureGroupStratifierType\", \"fhir.resources.measure.MeasureGroupStratifier\"\n    )\n\n    MeasureGroupStratifierComponentType = create_fhir_type(\n        \"MeasureGroupStratifierComponentType\",\n        \"fhir.resources.measure.MeasureGroupStratifierComponent\",\n    )\n\n    MeasureReportType = create_fhir_type(\n        \"MeasureReportType\", \"fhir.resources.measurereport.MeasureReport\"\n    )\n\n    MeasureReportGroupType = create_fhir_type(\n        \"MeasureReportGroupType\", \"fhir.resources.measurereport.MeasureReportGroup\"\n    )\n\n    MeasureReportGroupPopulationType = create_fhir_type(\n        \"MeasureReportGroupPopulationType\",\n        \"fhir.resources.measurereport.MeasureReportGroupPopulation\",\n    )\n\n    MeasureReportGroupStratifierType = create_fhir_type(\n        \"MeasureReportGroupStratifierType\",\n        \"fhir.resources.measurereport.MeasureReportGroupStratifier\",\n    )\n\n    MeasureReportGroupStratifierStratumType = create_fhir_type(\n        \"MeasureReportGroupStratifierStratumType\",\n        \"fhir.resources.measurereport.MeasureReportGroupStratifierStratum\",\n    )\n\n    MeasureReportGroupStratifierStratumComponentType = create_fhir_type(\n        \"MeasureReportGroupStratifierStratumComponentType\",\n        \"fhir.resources.measurereport.MeasureReportGroupStratifierStratumComponent\",\n    )\n\n    MeasureReportGroupStratifierStratumPopulationType = create_fhir_type(\n        \"MeasureReportGroupStratifierStratumPopulationType\",\n        \"fhir.resources.measurereport.MeasureReportGroupStratifierStratumPopulation\",\n    )\n\n    MeasureSupplementalDataType = create_fhir_type(\n        \"MeasureSupplementalDataType\", \"fhir.resources.measure.MeasureSupplementalData\"\n    )\n\n    MeasureTermType = create_fhir_type(\n        \"MeasureTermType\", \"fhir.resources.measure.MeasureTerm\"\n    )\n\n    MedicationType = create_fhir_type(\n        \"MedicationType\", \"fhir.resources.medication.Medication\"\n    )\n\n    MedicationAdministrationType = create_fhir_type(\n        \"MedicationAdministrationType\",\n        \"fhir.resources.medicationadministration.MedicationAdministration\",\n    )\n\n    MedicationAdministrationDosageType = create_fhir_type(\n        \"MedicationAdministrationDosageType\",\n        \"fhir.resources.medicationadministration.MedicationAdministrationDosage\",\n    )\n\n    MedicationAdministrationPerformerType = create_fhir_type(\n        \"MedicationAdministrationPerformerType\",\n        \"fhir.resources.medicationadministration.MedicationAdministrationPerformer\",\n    )\n\n    MedicationBatchType = create_fhir_type(\n        \"MedicationBatchType\", \"fhir.resources.medication.MedicationBatch\"\n    )\n\n    MedicationDispenseType = create_fhir_type(\n        \"MedicationDispenseType\", \"fhir.resources.medicationdispense.MedicationDispense\"\n    )\n\n    MedicationDispensePerformerType = create_fhir_type(\n        \"MedicationDispensePerformerType\",\n        \"fhir.resources.medicationdispense.MedicationDispensePerformer\",\n    )\n\n    MedicationDispenseSubstitutionType = create_fhir_type(\n        \"MedicationDispenseSubstitutionType\",\n        \"fhir.resources.medicationdispense.MedicationDispenseSubstitution\",\n    )\n\n    MedicationIngredientType = create_fhir_type(\n        \"MedicationIngredientType\", \"fhir.resources.medication.MedicationIngredient\"\n    )\n\n    MedicationKnowledgeType = create_fhir_type(\n        \"MedicationKnowledgeType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledge\",\n    )\n\n    MedicationKnowledgeCostType = create_fhir_type(\n        \"MedicationKnowledgeCostType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeCost\",\n    )\n\n    MedicationKnowledgeDefinitionalType = create_fhir_type(\n        \"MedicationKnowledgeDefinitionalType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeDefinitional\",\n    )\n\n    MedicationKnowledgeDefinitionalDrugCharacteristicType = create_fhir_type(\n        \"MedicationKnowledgeDefinitionalDrugCharacteristicType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeDefinitionalDrugCharacteristic\",\n    )\n\n    MedicationKnowledgeDefinitionalIngredientType = create_fhir_type(\n        \"MedicationKnowledgeDefinitionalIngredientType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeDefinitionalIngredient\",\n    )\n\n    MedicationKnowledgeIndicationGuidelineType = create_fhir_type(\n        \"MedicationKnowledgeIndicationGuidelineType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeIndicationGuideline\",\n    )\n\n    MedicationKnowledgeIndicationGuidelineDosingGuidelineType = create_fhir_type(\n        \"MedicationKnowledgeIndicationGuidelineDosingGuidelineType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeIndicationGuidelineDosingGuideline\",\n    )\n\n    MedicationKnowledgeIndicationGuidelineDosingGuidelineDosageType = create_fhir_type(\n        \"MedicationKnowledgeIndicationGuidelineDosingGuidelineDosageType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage\",\n    )\n\n    MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristicType = create_fhir_type(\n        \"MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristicType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristic\",\n    )\n\n    MedicationKnowledgeMedicineClassificationType = create_fhir_type(\n        \"MedicationKnowledgeMedicineClassificationType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeMedicineClassification\",\n    )\n\n    MedicationKnowledgeMonitoringProgramType = create_fhir_type(\n        \"MedicationKnowledgeMonitoringProgramType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeMonitoringProgram\",\n    )\n\n    MedicationKnowledgeMonographType = create_fhir_type(\n        \"MedicationKnowledgeMonographType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeMonograph\",\n    )\n\n    MedicationKnowledgePackagingType = create_fhir_type(\n        \"MedicationKnowledgePackagingType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgePackaging\",\n    )\n\n    MedicationKnowledgeRegulatoryType = create_fhir_type(\n        \"MedicationKnowledgeRegulatoryType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeRegulatory\",\n    )\n\n    MedicationKnowledgeRegulatoryMaxDispenseType = create_fhir_type(\n        \"MedicationKnowledgeRegulatoryMaxDispenseType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeRegulatoryMaxDispense\",\n    )\n\n    MedicationKnowledgeRegulatorySubstitutionType = create_fhir_type(\n        \"MedicationKnowledgeRegulatorySubstitutionType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeRegulatorySubstitution\",\n    )\n\n    MedicationKnowledgeRelatedMedicationKnowledgeType = create_fhir_type(\n        \"MedicationKnowledgeRelatedMedicationKnowledgeType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeRelatedMedicationKnowledge\",\n    )\n\n    MedicationKnowledgeStorageGuidelineType = create_fhir_type(\n        \"MedicationKnowledgeStorageGuidelineType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeStorageGuideline\",\n    )\n\n    MedicationKnowledgeStorageGuidelineEnvironmentalSettingType = create_fhir_type(\n        \"MedicationKnowledgeStorageGuidelineEnvironmentalSettingType\",\n        \"fhir.resources.medicationknowledge.MedicationKnowledgeStorageGuidelineEnvironmentalSetting\",\n    )\n\n    MedicationRequestType = create_fhir_type(\n        \"MedicationRequestType\", \"fhir.resources.medicationrequest.MedicationRequest\"\n    )\n\n    MedicationRequestDispenseRequestType = create_fhir_type(\n        \"MedicationRequestDispenseRequestType\",\n        \"fhir.resources.medicationrequest.MedicationRequestDispenseRequest\",\n    )\n\n    MedicationRequestDispenseRequestInitialFillType = create_fhir_type(\n        \"MedicationRequestDispenseRequestInitialFillType\",\n        \"fhir.resources.medicationrequest.MedicationRequestDispenseRequestInitialFill\",\n    )\n\n    MedicationRequestSubstitutionType = create_fhir_type(\n        \"MedicationRequestSubstitutionType\",\n        \"fhir.resources.medicationrequest.MedicationRequestSubstitution\",\n    )\n\n    MedicationStatementType = create_fhir_type(\n        \"MedicationStatementType\",\n        \"fhir.resources.medicationstatement.MedicationStatement\",\n    )\n\n    MedicationStatementAdherenceType = create_fhir_type(\n        \"MedicationStatementAdherenceType\",\n        \"fhir.resources.medicationstatement.MedicationStatementAdherence\",\n    )\n\n    MedicinalProductDefinitionType = create_fhir_type(\n        \"MedicinalProductDefinitionType\",\n        \"fhir.resources.medicinalproductdefinition.MedicinalProductDefinition\",\n    )\n\n    MedicinalProductDefinitionCharacteristicType = create_fhir_type(\n        \"MedicinalProductDefinitionCharacteristicType\",\n        \"fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionCharacteristic\",\n    )\n\n    MedicinalProductDefinitionContactType = create_fhir_type(\n        \"MedicinalProductDefinitionContactType\",\n        \"fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionContact\",\n    )\n\n    MedicinalProductDefinitionCrossReferenceType = create_fhir_type(\n        \"MedicinalProductDefinitionCrossReferenceType\",\n        \"fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionCrossReference\",\n    )\n\n    MedicinalProductDefinitionNameType = create_fhir_type(\n        \"MedicinalProductDefinitionNameType\",\n        \"fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionName\",\n    )\n\n    MedicinalProductDefinitionNamePartType = create_fhir_type(\n        \"MedicinalProductDefinitionNamePartType\",\n        \"fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionNamePart\",\n    )\n\n    MedicinalProductDefinitionNameUsageType = create_fhir_type(\n        \"MedicinalProductDefinitionNameUsageType\",\n        \"fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionNameUsage\",\n    )\n\n    MedicinalProductDefinitionOperationType = create_fhir_type(\n        \"MedicinalProductDefinitionOperationType\",\n        \"fhir.resources.medicinalproductdefinition.MedicinalProductDefinitionOperation\",\n    )\n\n    MessageDefinitionType = create_fhir_type(\n        \"MessageDefinitionType\", \"fhir.resources.messagedefinition.MessageDefinition\"\n    )\n\n    MessageDefinitionAllowedResponseType = create_fhir_type(\n        \"MessageDefinitionAllowedResponseType\",\n        \"fhir.resources.messagedefinition.MessageDefinitionAllowedResponse\",\n    )\n\n    MessageDefinitionFocusType = create_fhir_type(\n        \"MessageDefinitionFocusType\",\n        \"fhir.resources.messagedefinition.MessageDefinitionFocus\",\n    )\n\n    MessageHeaderType = create_fhir_type(\n        \"MessageHeaderType\", \"fhir.resources.messageheader.MessageHeader\"\n    )\n\n    MessageHeaderDestinationType = create_fhir_type(\n        \"MessageHeaderDestinationType\",\n        \"fhir.resources.messageheader.MessageHeaderDestination\",\n    )\n\n    MessageHeaderResponseType = create_fhir_type(\n        \"MessageHeaderResponseType\",\n        \"fhir.resources.messageheader.MessageHeaderResponse\",\n    )\n\n    MessageHeaderSourceType = create_fhir_type(\n        \"MessageHeaderSourceType\", \"fhir.resources.messageheader.MessageHeaderSource\"\n    )\n\n    MetaType = create_fhir_type(\"MetaType\", \"fhir.resources.meta.Meta\")\n\n    MetadataResourceType = create_fhir_type(\n        \"MetadataResourceType\", \"fhir.resources.metadataresource.MetadataResource\"\n    )\n\n    MolecularSequenceType = create_fhir_type(\n        \"MolecularSequenceType\", \"fhir.resources.molecularsequence.MolecularSequence\"\n    )\n\n    MolecularSequenceRelativeType = create_fhir_type(\n        \"MolecularSequenceRelativeType\",\n        \"fhir.resources.molecularsequence.MolecularSequenceRelative\",\n    )\n\n    MolecularSequenceRelativeEditType = create_fhir_type(\n        \"MolecularSequenceRelativeEditType\",\n        \"fhir.resources.molecularsequence.MolecularSequenceRelativeEdit\",\n    )\n\n    MolecularSequenceRelativeStartingSequenceType = create_fhir_type(\n        \"MolecularSequenceRelativeStartingSequenceType\",\n        \"fhir.resources.molecularsequence.MolecularSequenceRelativeStartingSequence\",\n    )\n\n    MonetaryComponentType = create_fhir_type(\n        \"MonetaryComponentType\", \"fhir.resources.monetarycomponent.MonetaryComponent\"\n    )\n\n    MoneyType = create_fhir_type(\"MoneyType\", \"fhir.resources.money.Money\")\n\n    NamingSystemType = create_fhir_type(\n        \"NamingSystemType\", \"fhir.resources.namingsystem.NamingSystem\"\n    )\n\n    NamingSystemUniqueIdType = create_fhir_type(\n        \"NamingSystemUniqueIdType\", \"fhir.resources.namingsystem.NamingSystemUniqueId\"\n    )\n\n    NarrativeType = create_fhir_type(\n        \"NarrativeType\", \"fhir.resources.narrative.Narrative\"\n    )\n\n    NutritionIntakeType = create_fhir_type(\n        \"NutritionIntakeType\", \"fhir.resources.nutritionintake.NutritionIntake\"\n    )\n\n    NutritionIntakeConsumedItemType = create_fhir_type(\n        \"NutritionIntakeConsumedItemType\",\n        \"fhir.resources.nutritionintake.NutritionIntakeConsumedItem\",\n    )\n\n    NutritionIntakeIngredientLabelType = create_fhir_type(\n        \"NutritionIntakeIngredientLabelType\",\n        \"fhir.resources.nutritionintake.NutritionIntakeIngredientLabel\",\n    )\n\n    NutritionIntakePerformerType = create_fhir_type(\n        \"NutritionIntakePerformerType\",\n        \"fhir.resources.nutritionintake.NutritionIntakePerformer\",\n    )\n\n    NutritionOrderType = create_fhir_type(\n        \"NutritionOrderType\", \"fhir.resources.nutritionorder.NutritionOrder\"\n    )\n\n    NutritionOrderEnteralFormulaType = create_fhir_type(\n        \"NutritionOrderEnteralFormulaType\",\n        \"fhir.resources.nutritionorder.NutritionOrderEnteralFormula\",\n    )\n\n    NutritionOrderEnteralFormulaAdditiveType = create_fhir_type(\n        \"NutritionOrderEnteralFormulaAdditiveType\",\n        \"fhir.resources.nutritionorder.NutritionOrderEnteralFormulaAdditive\",\n    )\n\n    NutritionOrderEnteralFormulaAdministrationType = create_fhir_type(\n        \"NutritionOrderEnteralFormulaAdministrationType\",\n        \"fhir.resources.nutritionorder.NutritionOrderEnteralFormulaAdministration\",\n    )\n\n    NutritionOrderEnteralFormulaAdministrationScheduleType = create_fhir_type(\n        \"NutritionOrderEnteralFormulaAdministrationScheduleType\",\n        \"fhir.resources.nutritionorder.NutritionOrderEnteralFormulaAdministrationSchedule\",\n    )\n\n    NutritionOrderOralDietType = create_fhir_type(\n        \"NutritionOrderOralDietType\",\n        \"fhir.resources.nutritionorder.NutritionOrderOralDiet\",\n    )\n\n    NutritionOrderOralDietNutrientType = create_fhir_type(\n        \"NutritionOrderOralDietNutrientType\",\n        \"fhir.resources.nutritionorder.NutritionOrderOralDietNutrient\",\n    )\n\n    NutritionOrderOralDietScheduleType = create_fhir_type(\n        \"NutritionOrderOralDietScheduleType\",\n        \"fhir.resources.nutritionorder.NutritionOrderOralDietSchedule\",\n    )\n\n    NutritionOrderOralDietTextureType = create_fhir_type(\n        \"NutritionOrderOralDietTextureType\",\n        \"fhir.resources.nutritionorder.NutritionOrderOralDietTexture\",\n    )\n\n    NutritionOrderSupplementType = create_fhir_type(\n        \"NutritionOrderSupplementType\",\n        \"fhir.resources.nutritionorder.NutritionOrderSupplement\",\n    )\n\n    NutritionOrderSupplementScheduleType = create_fhir_type(\n        \"NutritionOrderSupplementScheduleType\",\n        \"fhir.resources.nutritionorder.NutritionOrderSupplementSchedule\",\n    )\n\n    NutritionProductType = create_fhir_type(\n        \"NutritionProductType\", \"fhir.resources.nutritionproduct.NutritionProduct\"\n    )\n\n    NutritionProductCharacteristicType = create_fhir_type(\n        \"NutritionProductCharacteristicType\",\n        \"fhir.resources.nutritionproduct.NutritionProductCharacteristic\",\n    )\n\n    NutritionProductIngredientType = create_fhir_type(\n        \"NutritionProductIngredientType\",\n        \"fhir.resources.nutritionproduct.NutritionProductIngredient\",\n    )\n\n    NutritionProductInstanceType = create_fhir_type(\n        \"NutritionProductInstanceType\",\n        \"fhir.resources.nutritionproduct.NutritionProductInstance\",\n    )\n\n    NutritionProductNutrientType = create_fhir_type(\n        \"NutritionProductNutrientType\",\n        \"fhir.resources.nutritionproduct.NutritionProductNutrient\",\n    )\n\n    ObservationType = create_fhir_type(\n        \"ObservationType\", \"fhir.resources.observation.Observation\"\n    )\n\n    ObservationComponentType = create_fhir_type(\n        \"ObservationComponentType\", \"fhir.resources.observation.ObservationComponent\"\n    )\n\n    ObservationDefinitionType = create_fhir_type(\n        \"ObservationDefinitionType\",\n        \"fhir.resources.observationdefinition.ObservationDefinition\",\n    )\n\n    ObservationDefinitionComponentType = create_fhir_type(\n        \"ObservationDefinitionComponentType\",\n        \"fhir.resources.observationdefinition.ObservationDefinitionComponent\",\n    )\n\n    ObservationDefinitionQualifiedValueType = create_fhir_type(\n        \"ObservationDefinitionQualifiedValueType\",\n        \"fhir.resources.observationdefinition.ObservationDefinitionQualifiedValue\",\n    )\n\n    ObservationReferenceRangeType = create_fhir_type(\n        \"ObservationReferenceRangeType\",\n        \"fhir.resources.observation.ObservationReferenceRange\",\n    )\n\n    ObservationTriggeredByType = create_fhir_type(\n        \"ObservationTriggeredByType\",\n        \"fhir.resources.observation.ObservationTriggeredBy\",\n    )\n\n    OperationDefinitionType = create_fhir_type(\n        \"OperationDefinitionType\",\n        \"fhir.resources.operationdefinition.OperationDefinition\",\n    )\n\n    OperationDefinitionOverloadType = create_fhir_type(\n        \"OperationDefinitionOverloadType\",\n        \"fhir.resources.operationdefinition.OperationDefinitionOverload\",\n    )\n\n    OperationDefinitionParameterType = create_fhir_type(\n        \"OperationDefinitionParameterType\",\n        \"fhir.resources.operationdefinition.OperationDefinitionParameter\",\n    )\n\n    OperationDefinitionParameterBindingType = create_fhir_type(\n        \"OperationDefinitionParameterBindingType\",\n        \"fhir.resources.operationdefinition.OperationDefinitionParameterBinding\",\n    )\n\n    OperationDefinitionParameterReferencedFromType = create_fhir_type(\n        \"OperationDefinitionParameterReferencedFromType\",\n        \"fhir.resources.operationdefinition.OperationDefinitionParameterReferencedFrom\",\n    )\n\n    OperationOutcomeType = create_fhir_type(\n        \"OperationOutcomeType\", \"fhir.resources.operationoutcome.OperationOutcome\"\n    )\n\n    OperationOutcomeIssueType = create_fhir_type(\n        \"OperationOutcomeIssueType\",\n        \"fhir.resources.operationoutcome.OperationOutcomeIssue\",\n    )\n\n    OrganizationType = create_fhir_type(\n        \"OrganizationType\", \"fhir.resources.organization.Organization\"\n    )\n\n    OrganizationAffiliationType = create_fhir_type(\n        \"OrganizationAffiliationType\",\n        \"fhir.resources.organizationaffiliation.OrganizationAffiliation\",\n    )\n\n    OrganizationQualificationType = create_fhir_type(\n        \"OrganizationQualificationType\",\n        \"fhir.resources.organization.OrganizationQualification\",\n    )\n\n    PackagedProductDefinitionType = create_fhir_type(\n        \"PackagedProductDefinitionType\",\n        \"fhir.resources.packagedproductdefinition.PackagedProductDefinition\",\n    )\n\n    PackagedProductDefinitionLegalStatusOfSupplyType = create_fhir_type(\n        \"PackagedProductDefinitionLegalStatusOfSupplyType\",\n        \"fhir.resources.packagedproductdefinition.PackagedProductDefinitionLegalStatusOfSupply\",\n    )\n\n    PackagedProductDefinitionPackagingType = create_fhir_type(\n        \"PackagedProductDefinitionPackagingType\",\n        \"fhir.resources.packagedproductdefinition.PackagedProductDefinitionPackaging\",\n    )\n\n    PackagedProductDefinitionPackagingContainedItemType = create_fhir_type(\n        \"PackagedProductDefinitionPackagingContainedItemType\",\n        \"fhir.resources.packagedproductdefinition.PackagedProductDefinitionPackagingContainedItem\",\n    )\n\n    PackagedProductDefinitionPackagingPropertyType = create_fhir_type(\n        \"PackagedProductDefinitionPackagingPropertyType\",\n        \"fhir.resources.packagedproductdefinition.PackagedProductDefinitionPackagingProperty\",\n    )\n\n    ParameterDefinitionType = create_fhir_type(\n        \"ParameterDefinitionType\",\n        \"fhir.resources.parameterdefinition.ParameterDefinition\",\n    )\n\n    ParametersType = create_fhir_type(\n        \"ParametersType\", \"fhir.resources.parameters.Parameters\"\n    )\n\n    ParametersParameterType = create_fhir_type(\n        \"ParametersParameterType\", \"fhir.resources.parameters.ParametersParameter\"\n    )\n\n    PatientType = create_fhir_type(\"PatientType\", \"fhir.resources.patient.Patient\")\n\n    PatientCommunicationType = create_fhir_type(\n        \"PatientCommunicationType\", \"fhir.resources.patient.PatientCommunication\"\n    )\n\n    PatientContactType = create_fhir_type(\n        \"PatientContactType\", \"fhir.resources.patient.PatientContact\"\n    )\n\n    PatientLinkType = create_fhir_type(\n        \"PatientLinkType\", \"fhir.resources.patient.PatientLink\"\n    )\n\n    PaymentNoticeType = create_fhir_type(\n        \"PaymentNoticeType\", \"fhir.resources.paymentnotice.PaymentNotice\"\n    )\n\n    PaymentReconciliationType = create_fhir_type(\n        \"PaymentReconciliationType\",\n        \"fhir.resources.paymentreconciliation.PaymentReconciliation\",\n    )\n\n    PaymentReconciliationAllocationType = create_fhir_type(\n        \"PaymentReconciliationAllocationType\",\n        \"fhir.resources.paymentreconciliation.PaymentReconciliationAllocation\",\n    )\n\n    PaymentReconciliationProcessNoteType = create_fhir_type(\n        \"PaymentReconciliationProcessNoteType\",\n        \"fhir.resources.paymentreconciliation.PaymentReconciliationProcessNote\",\n    )\n\n    PeriodType = create_fhir_type(\"PeriodType\", \"fhir.resources.period.Period\")\n\n    PermissionType = create_fhir_type(\n        \"PermissionType\", \"fhir.resources.permission.Permission\"\n    )\n\n    PermissionJustificationType = create_fhir_type(\n        \"PermissionJustificationType\",\n        \"fhir.resources.permission.PermissionJustification\",\n    )\n\n    PermissionRuleType = create_fhir_type(\n        \"PermissionRuleType\", \"fhir.resources.permission.PermissionRule\"\n    )\n\n    PermissionRuleActivityType = create_fhir_type(\n        \"PermissionRuleActivityType\", \"fhir.resources.permission.PermissionRuleActivity\"\n    )\n\n    PermissionRuleDataType = create_fhir_type(\n        \"PermissionRuleDataType\", \"fhir.resources.permission.PermissionRuleData\"\n    )\n\n    PermissionRuleDataResourceType = create_fhir_type(\n        \"PermissionRuleDataResourceType\",\n        \"fhir.resources.permission.PermissionRuleDataResource\",\n    )\n\n    PersonType = create_fhir_type(\"PersonType\", \"fhir.resources.person.Person\")\n\n    PersonCommunicationType = create_fhir_type(\n        \"PersonCommunicationType\", \"fhir.resources.person.PersonCommunication\"\n    )\n\n    PersonLinkType = create_fhir_type(\n        \"PersonLinkType\", \"fhir.resources.person.PersonLink\"\n    )\n\n    PlanDefinitionType = create_fhir_type(\n        \"PlanDefinitionType\", \"fhir.resources.plandefinition.PlanDefinition\"\n    )\n\n    PlanDefinitionActionType = create_fhir_type(\n        \"PlanDefinitionActionType\", \"fhir.resources.plandefinition.PlanDefinitionAction\"\n    )\n\n    PlanDefinitionActionConditionType = create_fhir_type(\n        \"PlanDefinitionActionConditionType\",\n        \"fhir.resources.plandefinition.PlanDefinitionActionCondition\",\n    )\n\n    PlanDefinitionActionDynamicValueType = create_fhir_type(\n        \"PlanDefinitionActionDynamicValueType\",\n        \"fhir.resources.plandefinition.PlanDefinitionActionDynamicValue\",\n    )\n\n    PlanDefinitionActionInputType = create_fhir_type(\n        \"PlanDefinitionActionInputType\",\n        \"fhir.resources.plandefinition.PlanDefinitionActionInput\",\n    )\n\n    PlanDefinitionActionOutputType = create_fhir_type(\n        \"PlanDefinitionActionOutputType\",\n        \"fhir.resources.plandefinition.PlanDefinitionActionOutput\",\n    )\n\n    PlanDefinitionActionParticipantType = create_fhir_type(\n        \"PlanDefinitionActionParticipantType\",\n        \"fhir.resources.plandefinition.PlanDefinitionActionParticipant\",\n    )\n\n    PlanDefinitionActionRelatedActionType = create_fhir_type(\n        \"PlanDefinitionActionRelatedActionType\",\n        \"fhir.resources.plandefinition.PlanDefinitionActionRelatedAction\",\n    )\n\n    PlanDefinitionActorType = create_fhir_type(\n        \"PlanDefinitionActorType\", \"fhir.resources.plandefinition.PlanDefinitionActor\"\n    )\n\n    PlanDefinitionActorOptionType = create_fhir_type(\n        \"PlanDefinitionActorOptionType\",\n        \"fhir.resources.plandefinition.PlanDefinitionActorOption\",\n    )\n\n    PlanDefinitionGoalType = create_fhir_type(\n        \"PlanDefinitionGoalType\", \"fhir.resources.plandefinition.PlanDefinitionGoal\"\n    )\n\n    PlanDefinitionGoalTargetType = create_fhir_type(\n        \"PlanDefinitionGoalTargetType\",\n        \"fhir.resources.plandefinition.PlanDefinitionGoalTarget\",\n    )\n\n    PractitionerType = create_fhir_type(\n        \"PractitionerType\", \"fhir.resources.practitioner.Practitioner\"\n    )\n\n    PractitionerCommunicationType = create_fhir_type(\n        \"PractitionerCommunicationType\",\n        \"fhir.resources.practitioner.PractitionerCommunication\",\n    )\n\n    PractitionerQualificationType = create_fhir_type(\n        \"PractitionerQualificationType\",\n        \"fhir.resources.practitioner.PractitionerQualification\",\n    )\n\n    PractitionerRoleType = create_fhir_type(\n        \"PractitionerRoleType\", \"fhir.resources.practitionerrole.PractitionerRole\"\n    )\n\n    PrimitiveTypeType = create_fhir_type(\n        \"PrimitiveTypeType\", \"fhir.resources.primitivetype.PrimitiveType\"\n    )\n\n    ProcedureType = create_fhir_type(\n        \"ProcedureType\", \"fhir.resources.procedure.Procedure\"\n    )\n\n    ProcedureFocalDeviceType = create_fhir_type(\n        \"ProcedureFocalDeviceType\", \"fhir.resources.procedure.ProcedureFocalDevice\"\n    )\n\n    ProcedurePerformerType = create_fhir_type(\n        \"ProcedurePerformerType\", \"fhir.resources.procedure.ProcedurePerformer\"\n    )\n\n    ProductShelfLifeType = create_fhir_type(\n        \"ProductShelfLifeType\", \"fhir.resources.productshelflife.ProductShelfLife\"\n    )\n\n    ProvenanceType = create_fhir_type(\n        \"ProvenanceType\", \"fhir.resources.provenance.Provenance\"\n    )\n\n    ProvenanceAgentType = create_fhir_type(\n        \"ProvenanceAgentType\", \"fhir.resources.provenance.ProvenanceAgent\"\n    )\n\n    ProvenanceEntityType = create_fhir_type(\n        \"ProvenanceEntityType\", \"fhir.resources.provenance.ProvenanceEntity\"\n    )\n\n    QuantityType = create_fhir_type(\"QuantityType\", \"fhir.resources.quantity.Quantity\")\n\n    QuestionnaireType = create_fhir_type(\n        \"QuestionnaireType\", \"fhir.resources.questionnaire.Questionnaire\"\n    )\n\n    QuestionnaireItemType = create_fhir_type(\n        \"QuestionnaireItemType\", \"fhir.resources.questionnaire.QuestionnaireItem\"\n    )\n\n    QuestionnaireItemAnswerOptionType = create_fhir_type(\n        \"QuestionnaireItemAnswerOptionType\",\n        \"fhir.resources.questionnaire.QuestionnaireItemAnswerOption\",\n    )\n\n    QuestionnaireItemEnableWhenType = create_fhir_type(\n        \"QuestionnaireItemEnableWhenType\",\n        \"fhir.resources.questionnaire.QuestionnaireItemEnableWhen\",\n    )\n\n    QuestionnaireItemInitialType = create_fhir_type(\n        \"QuestionnaireItemInitialType\",\n        \"fhir.resources.questionnaire.QuestionnaireItemInitial\",\n    )\n\n    QuestionnaireResponseType = create_fhir_type(\n        \"QuestionnaireResponseType\",\n        \"fhir.resources.questionnaireresponse.QuestionnaireResponse\",\n    )\n\n    QuestionnaireResponseItemType = create_fhir_type(\n        \"QuestionnaireResponseItemType\",\n        \"fhir.resources.questionnaireresponse.QuestionnaireResponseItem\",\n    )\n\n    QuestionnaireResponseItemAnswerType = create_fhir_type(\n        \"QuestionnaireResponseItemAnswerType\",\n        \"fhir.resources.questionnaireresponse.QuestionnaireResponseItemAnswer\",\n    )\n\n    RangeType = create_fhir_type(\"RangeType\", \"fhir.resources.range.Range\")\n\n    RatioType = create_fhir_type(\"RatioType\", \"fhir.resources.ratio.Ratio\")\n\n    RatioRangeType = create_fhir_type(\n        \"RatioRangeType\", \"fhir.resources.ratiorange.RatioRange\"\n    )\n\n    ReferenceType = create_fhir_type(\n        \"ReferenceType\", \"fhir.resources.reference.Reference\"\n    )\n\n    RegulatedAuthorizationType = create_fhir_type(\n        \"RegulatedAuthorizationType\",\n        \"fhir.resources.regulatedauthorization.RegulatedAuthorization\",\n    )\n\n    RegulatedAuthorizationCaseType = create_fhir_type(\n        \"RegulatedAuthorizationCaseType\",\n        \"fhir.resources.regulatedauthorization.RegulatedAuthorizationCase\",\n    )\n\n    RelatedArtifactType = create_fhir_type(\n        \"RelatedArtifactType\", \"fhir.resources.relatedartifact.RelatedArtifact\"\n    )\n\n    RelatedPersonType = create_fhir_type(\n        \"RelatedPersonType\", \"fhir.resources.relatedperson.RelatedPerson\"\n    )\n\n    RelatedPersonCommunicationType = create_fhir_type(\n        \"RelatedPersonCommunicationType\",\n        \"fhir.resources.relatedperson.RelatedPersonCommunication\",\n    )\n\n    RequestOrchestrationType = create_fhir_type(\n        \"RequestOrchestrationType\",\n        \"fhir.resources.requestorchestration.RequestOrchestration\",\n    )\n\n    RequestOrchestrationActionType = create_fhir_type(\n        \"RequestOrchestrationActionType\",\n        \"fhir.resources.requestorchestration.RequestOrchestrationAction\",\n    )\n\n    RequestOrchestrationActionConditionType = create_fhir_type(\n        \"RequestOrchestrationActionConditionType\",\n        \"fhir.resources.requestorchestration.RequestOrchestrationActionCondition\",\n    )\n\n    RequestOrchestrationActionDynamicValueType = create_fhir_type(\n        \"RequestOrchestrationActionDynamicValueType\",\n        \"fhir.resources.requestorchestration.RequestOrchestrationActionDynamicValue\",\n    )\n\n    RequestOrchestrationActionInputType = create_fhir_type(\n        \"RequestOrchestrationActionInputType\",\n        \"fhir.resources.requestorchestration.RequestOrchestrationActionInput\",\n    )\n\n    RequestOrchestrationActionOutputType = create_fhir_type(\n        \"RequestOrchestrationActionOutputType\",\n        \"fhir.resources.requestorchestration.RequestOrchestrationActionOutput\",\n    )\n\n    RequestOrchestrationActionParticipantType = create_fhir_type(\n        \"RequestOrchestrationActionParticipantType\",\n        \"fhir.resources.requestorchestration.RequestOrchestrationActionParticipant\",\n    )\n\n    RequestOrchestrationActionRelatedActionType = create_fhir_type(\n        \"RequestOrchestrationActionRelatedActionType\",\n        \"fhir.resources.requestorchestration.RequestOrchestrationActionRelatedAction\",\n    )\n\n    RequirementsType = create_fhir_type(\n        \"RequirementsType\", \"fhir.resources.requirements.Requirements\"\n    )\n\n    RequirementsStatementType = create_fhir_type(\n        \"RequirementsStatementType\", \"fhir.resources.requirements.RequirementsStatement\"\n    )\n\n    ResearchStudyType = create_fhir_type(\n        \"ResearchStudyType\", \"fhir.resources.researchstudy.ResearchStudy\"\n    )\n\n    ResearchStudyAssociatedPartyType = create_fhir_type(\n        \"ResearchStudyAssociatedPartyType\",\n        \"fhir.resources.researchstudy.ResearchStudyAssociatedParty\",\n    )\n\n    ResearchStudyComparisonGroupType = create_fhir_type(\n        \"ResearchStudyComparisonGroupType\",\n        \"fhir.resources.researchstudy.ResearchStudyComparisonGroup\",\n    )\n\n    ResearchStudyLabelType = create_fhir_type(\n        \"ResearchStudyLabelType\", \"fhir.resources.researchstudy.ResearchStudyLabel\"\n    )\n\n    ResearchStudyObjectiveType = create_fhir_type(\n        \"ResearchStudyObjectiveType\",\n        \"fhir.resources.researchstudy.ResearchStudyObjective\",\n    )\n\n    ResearchStudyOutcomeMeasureType = create_fhir_type(\n        \"ResearchStudyOutcomeMeasureType\",\n        \"fhir.resources.researchstudy.ResearchStudyOutcomeMeasure\",\n    )\n\n    ResearchStudyProgressStatusType = create_fhir_type(\n        \"ResearchStudyProgressStatusType\",\n        \"fhir.resources.researchstudy.ResearchStudyProgressStatus\",\n    )\n\n    ResearchStudyRecruitmentType = create_fhir_type(\n        \"ResearchStudyRecruitmentType\",\n        \"fhir.resources.researchstudy.ResearchStudyRecruitment\",\n    )\n\n    ResearchSubjectType = create_fhir_type(\n        \"ResearchSubjectType\", \"fhir.resources.researchsubject.ResearchSubject\"\n    )\n\n    ResearchSubjectProgressType = create_fhir_type(\n        \"ResearchSubjectProgressType\",\n        \"fhir.resources.researchsubject.ResearchSubjectProgress\",\n    )\n\n    RiskAssessmentType = create_fhir_type(\n        \"RiskAssessmentType\", \"fhir.resources.riskassessment.RiskAssessment\"\n    )\n\n    RiskAssessmentPredictionType = create_fhir_type(\n        \"RiskAssessmentPredictionType\",\n        \"fhir.resources.riskassessment.RiskAssessmentPrediction\",\n    )\n\n    SampledDataType = create_fhir_type(\n        \"SampledDataType\", \"fhir.resources.sampleddata.SampledData\"\n    )\n\n    ScheduleType = create_fhir_type(\"ScheduleType\", \"fhir.resources.schedule.Schedule\")\n\n    SearchParameterType = create_fhir_type(\n        \"SearchParameterType\", \"fhir.resources.searchparameter.SearchParameter\"\n    )\n\n    SearchParameterComponentType = create_fhir_type(\n        \"SearchParameterComponentType\",\n        \"fhir.resources.searchparameter.SearchParameterComponent\",\n    )\n\n    ServiceRequestType = create_fhir_type(\n        \"ServiceRequestType\", \"fhir.resources.servicerequest.ServiceRequest\"\n    )\n\n    ServiceRequestOrderDetailType = create_fhir_type(\n        \"ServiceRequestOrderDetailType\",\n        \"fhir.resources.servicerequest.ServiceRequestOrderDetail\",\n    )\n\n    ServiceRequestOrderDetailParameterType = create_fhir_type(\n        \"ServiceRequestOrderDetailParameterType\",\n        \"fhir.resources.servicerequest.ServiceRequestOrderDetailParameter\",\n    )\n\n    ServiceRequestPatientInstructionType = create_fhir_type(\n        \"ServiceRequestPatientInstructionType\",\n        \"fhir.resources.servicerequest.ServiceRequestPatientInstruction\",\n    )\n\n    SignatureType = create_fhir_type(\n        \"SignatureType\", \"fhir.resources.signature.Signature\"\n    )\n\n    SlotType = create_fhir_type(\"SlotType\", \"fhir.resources.slot.Slot\")\n\n    SpecimenType = create_fhir_type(\"SpecimenType\", \"fhir.resources.specimen.Specimen\")\n\n    SpecimenCollectionType = create_fhir_type(\n        \"SpecimenCollectionType\", \"fhir.resources.specimen.SpecimenCollection\"\n    )\n\n    SpecimenContainerType = create_fhir_type(\n        \"SpecimenContainerType\", \"fhir.resources.specimen.SpecimenContainer\"\n    )\n\n    SpecimenDefinitionType = create_fhir_type(\n        \"SpecimenDefinitionType\", \"fhir.resources.specimendefinition.SpecimenDefinition\"\n    )\n\n    SpecimenDefinitionTypeTestedType = create_fhir_type(\n        \"SpecimenDefinitionTypeTestedType\",\n        \"fhir.resources.specimendefinition.SpecimenDefinitionTypeTested\",\n    )\n\n    SpecimenDefinitionTypeTestedContainerType = create_fhir_type(\n        \"SpecimenDefinitionTypeTestedContainerType\",\n        \"fhir.resources.specimendefinition.SpecimenDefinitionTypeTestedContainer\",\n    )\n\n    SpecimenDefinitionTypeTestedContainerAdditiveType = create_fhir_type(\n        \"SpecimenDefinitionTypeTestedContainerAdditiveType\",\n        \"fhir.resources.specimendefinition.SpecimenDefinitionTypeTestedContainerAdditive\",\n    )\n\n    SpecimenDefinitionTypeTestedHandlingType = create_fhir_type(\n        \"SpecimenDefinitionTypeTestedHandlingType\",\n        \"fhir.resources.specimendefinition.SpecimenDefinitionTypeTestedHandling\",\n    )\n\n    SpecimenFeatureType = create_fhir_type(\n        \"SpecimenFeatureType\", \"fhir.resources.specimen.SpecimenFeature\"\n    )\n\n    SpecimenProcessingType = create_fhir_type(\n        \"SpecimenProcessingType\", \"fhir.resources.specimen.SpecimenProcessing\"\n    )\n\n    StructureDefinitionType = create_fhir_type(\n        \"StructureDefinitionType\",\n        \"fhir.resources.structuredefinition.StructureDefinition\",\n    )\n\n    StructureDefinitionContextType = create_fhir_type(\n        \"StructureDefinitionContextType\",\n        \"fhir.resources.structuredefinition.StructureDefinitionContext\",\n    )\n\n    StructureDefinitionDifferentialType = create_fhir_type(\n        \"StructureDefinitionDifferentialType\",\n        \"fhir.resources.structuredefinition.StructureDefinitionDifferential\",\n    )\n\n    StructureDefinitionMappingType = create_fhir_type(\n        \"StructureDefinitionMappingType\",\n        \"fhir.resources.structuredefinition.StructureDefinitionMapping\",\n    )\n\n    StructureDefinitionSnapshotType = create_fhir_type(\n        \"StructureDefinitionSnapshotType\",\n        \"fhir.resources.structuredefinition.StructureDefinitionSnapshot\",\n    )\n\n    StructureMapType = create_fhir_type(\n        \"StructureMapType\", \"fhir.resources.structuremap.StructureMap\"\n    )\n\n    StructureMapConstType = create_fhir_type(\n        \"StructureMapConstType\", \"fhir.resources.structuremap.StructureMapConst\"\n    )\n\n    StructureMapGroupType = create_fhir_type(\n        \"StructureMapGroupType\", \"fhir.resources.structuremap.StructureMapGroup\"\n    )\n\n    StructureMapGroupInputType = create_fhir_type(\n        \"StructureMapGroupInputType\",\n        \"fhir.resources.structuremap.StructureMapGroupInput\",\n    )\n\n    StructureMapGroupRuleType = create_fhir_type(\n        \"StructureMapGroupRuleType\", \"fhir.resources.structuremap.StructureMapGroupRule\"\n    )\n\n    StructureMapGroupRuleDependentType = create_fhir_type(\n        \"StructureMapGroupRuleDependentType\",\n        \"fhir.resources.structuremap.StructureMapGroupRuleDependent\",\n    )\n\n    StructureMapGroupRuleSourceType = create_fhir_type(\n        \"StructureMapGroupRuleSourceType\",\n        \"fhir.resources.structuremap.StructureMapGroupRuleSource\",\n    )\n\n    StructureMapGroupRuleTargetType = create_fhir_type(\n        \"StructureMapGroupRuleTargetType\",\n        \"fhir.resources.structuremap.StructureMapGroupRuleTarget\",\n    )\n\n    StructureMapGroupRuleTargetParameterType = create_fhir_type(\n        \"StructureMapGroupRuleTargetParameterType\",\n        \"fhir.resources.structuremap.StructureMapGroupRuleTargetParameter\",\n    )\n\n    StructureMapStructureType = create_fhir_type(\n        \"StructureMapStructureType\", \"fhir.resources.structuremap.StructureMapStructure\"\n    )\n\n    SubscriptionType = create_fhir_type(\n        \"SubscriptionType\", \"fhir.resources.subscription.Subscription\"\n    )\n\n    SubscriptionFilterByType = create_fhir_type(\n        \"SubscriptionFilterByType\", \"fhir.resources.subscription.SubscriptionFilterBy\"\n    )\n\n    SubscriptionParameterType = create_fhir_type(\n        \"SubscriptionParameterType\", \"fhir.resources.subscription.SubscriptionParameter\"\n    )\n\n    SubscriptionStatusType = create_fhir_type(\n        \"SubscriptionStatusType\", \"fhir.resources.subscriptionstatus.SubscriptionStatus\"\n    )\n\n    SubscriptionStatusNotificationEventType = create_fhir_type(\n        \"SubscriptionStatusNotificationEventType\",\n        \"fhir.resources.subscriptionstatus.SubscriptionStatusNotificationEvent\",\n    )\n\n    SubscriptionTopicType = create_fhir_type(\n        \"SubscriptionTopicType\", \"fhir.resources.subscriptiontopic.SubscriptionTopic\"\n    )\n\n    SubscriptionTopicCanFilterByType = create_fhir_type(\n        \"SubscriptionTopicCanFilterByType\",\n        \"fhir.resources.subscriptiontopic.SubscriptionTopicCanFilterBy\",\n    )\n\n    SubscriptionTopicEventTriggerType = create_fhir_type(\n        \"SubscriptionTopicEventTriggerType\",\n        \"fhir.resources.subscriptiontopic.SubscriptionTopicEventTrigger\",\n    )\n\n    SubscriptionTopicNotificationShapeType = create_fhir_type(\n        \"SubscriptionTopicNotificationShapeType\",\n        \"fhir.resources.subscriptiontopic.SubscriptionTopicNotificationShape\",\n    )\n\n    SubscriptionTopicResourceTriggerType = create_fhir_type(\n        \"SubscriptionTopicResourceTriggerType\",\n        \"fhir.resources.subscriptiontopic.SubscriptionTopicResourceTrigger\",\n    )\n\n    SubscriptionTopicResourceTriggerQueryCriteriaType = create_fhir_type(\n        \"SubscriptionTopicResourceTriggerQueryCriteriaType\",\n        \"fhir.resources.subscriptiontopic.SubscriptionTopicResourceTriggerQueryCriteria\",\n    )\n\n    SubstanceType = create_fhir_type(\n        \"SubstanceType\", \"fhir.resources.substance.Substance\"\n    )\n\n    SubstanceDefinitionType = create_fhir_type(\n        \"SubstanceDefinitionType\",\n        \"fhir.resources.substancedefinition.SubstanceDefinition\",\n    )\n\n    SubstanceDefinitionCharacterizationType = create_fhir_type(\n        \"SubstanceDefinitionCharacterizationType\",\n        \"fhir.resources.substancedefinition.SubstanceDefinitionCharacterization\",\n    )\n\n    SubstanceDefinitionCodeType = create_fhir_type(\n        \"SubstanceDefinitionCodeType\",\n        \"fhir.resources.substancedefinition.SubstanceDefinitionCode\",\n    )\n\n    SubstanceDefinitionMoietyType = create_fhir_type(\n        \"SubstanceDefinitionMoietyType\",\n        \"fhir.resources.substancedefinition.SubstanceDefinitionMoiety\",\n    )\n\n    SubstanceDefinitionMolecularWeightType = create_fhir_type(\n        \"SubstanceDefinitionMolecularWeightType\",\n        \"fhir.resources.substancedefinition.SubstanceDefinitionMolecularWeight\",\n    )\n\n    SubstanceDefinitionNameType = create_fhir_type(\n        \"SubstanceDefinitionNameType\",\n        \"fhir.resources.substancedefinition.SubstanceDefinitionName\",\n    )\n\n    SubstanceDefinitionNameOfficialType = create_fhir_type(\n        \"SubstanceDefinitionNameOfficialType\",\n        \"fhir.resources.substancedefinition.SubstanceDefinitionNameOfficial\",\n    )\n\n    SubstanceDefinitionPropertyType = create_fhir_type(\n        \"SubstanceDefinitionPropertyType\",\n        \"fhir.resources.substancedefinition.SubstanceDefinitionProperty\",\n    )\n\n    SubstanceDefinitionRelationshipType = create_fhir_type(\n        \"SubstanceDefinitionRelationshipType\",\n        \"fhir.resources.substancedefinition.SubstanceDefinitionRelationship\",\n    )\n\n    SubstanceDefinitionSourceMaterialType = create_fhir_type(\n        \"SubstanceDefinitionSourceMaterialType\",\n        \"fhir.resources.substancedefinition.SubstanceDefinitionSourceMaterial\",\n    )\n\n    SubstanceDefinitionStructureType = create_fhir_type(\n        \"SubstanceDefinitionStructureType\",\n        \"fhir.resources.substancedefinition.SubstanceDefinitionStructure\",\n    )\n\n    SubstanceDefinitionStructureRepresentationType = create_fhir_type(\n        \"SubstanceDefinitionStructureRepresentationType\",\n        \"fhir.resources.substancedefinition.SubstanceDefinitionStructureRepresentation\",\n    )\n\n    SubstanceIngredientType = create_fhir_type(\n        \"SubstanceIngredientType\", \"fhir.resources.substance.SubstanceIngredient\"\n    )\n\n    SubstanceNucleicAcidType = create_fhir_type(\n        \"SubstanceNucleicAcidType\",\n        \"fhir.resources.substancenucleicacid.SubstanceNucleicAcid\",\n    )\n\n    SubstanceNucleicAcidSubunitType = create_fhir_type(\n        \"SubstanceNucleicAcidSubunitType\",\n        \"fhir.resources.substancenucleicacid.SubstanceNucleicAcidSubunit\",\n    )\n\n    SubstanceNucleicAcidSubunitLinkageType = create_fhir_type(\n        \"SubstanceNucleicAcidSubunitLinkageType\",\n        \"fhir.resources.substancenucleicacid.SubstanceNucleicAcidSubunitLinkage\",\n    )\n\n    SubstanceNucleicAcidSubunitSugarType = create_fhir_type(\n        \"SubstanceNucleicAcidSubunitSugarType\",\n        \"fhir.resources.substancenucleicacid.SubstanceNucleicAcidSubunitSugar\",\n    )\n\n    SubstancePolymerType = create_fhir_type(\n        \"SubstancePolymerType\", \"fhir.resources.substancepolymer.SubstancePolymer\"\n    )\n\n    SubstancePolymerMonomerSetType = create_fhir_type(\n        \"SubstancePolymerMonomerSetType\",\n        \"fhir.resources.substancepolymer.SubstancePolymerMonomerSet\",\n    )\n\n    SubstancePolymerMonomerSetStartingMaterialType = create_fhir_type(\n        \"SubstancePolymerMonomerSetStartingMaterialType\",\n        \"fhir.resources.substancepolymer.SubstancePolymerMonomerSetStartingMaterial\",\n    )\n\n    SubstancePolymerRepeatType = create_fhir_type(\n        \"SubstancePolymerRepeatType\",\n        \"fhir.resources.substancepolymer.SubstancePolymerRepeat\",\n    )\n\n    SubstancePolymerRepeatRepeatUnitType = create_fhir_type(\n        \"SubstancePolymerRepeatRepeatUnitType\",\n        \"fhir.resources.substancepolymer.SubstancePolymerRepeatRepeatUnit\",\n    )\n\n    SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationType = create_fhir_type(\n        \"SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationType\",\n        \"fhir.resources.substancepolymer.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation\",\n    )\n\n    SubstancePolymerRepeatRepeatUnitStructuralRepresentationType = create_fhir_type(\n        \"SubstancePolymerRepeatRepeatUnitStructuralRepresentationType\",\n        \"fhir.resources.substancepolymer.SubstancePolymerRepeatRepeatUnitStructuralRepresentation\",\n    )\n\n    SubstanceProteinType = create_fhir_type(\n        \"SubstanceProteinType\", \"fhir.resources.substanceprotein.SubstanceProtein\"\n    )\n\n    SubstanceProteinSubunitType = create_fhir_type(\n        \"SubstanceProteinSubunitType\",\n        \"fhir.resources.substanceprotein.SubstanceProteinSubunit\",\n    )\n\n    SubstanceReferenceInformationType = create_fhir_type(\n        \"SubstanceReferenceInformationType\",\n        \"fhir.resources.substancereferenceinformation.SubstanceReferenceInformation\",\n    )\n\n    SubstanceReferenceInformationGeneType = create_fhir_type(\n        \"SubstanceReferenceInformationGeneType\",\n        \"fhir.resources.substancereferenceinformation.SubstanceReferenceInformationGene\",\n    )\n\n    SubstanceReferenceInformationGeneElementType = create_fhir_type(\n        \"SubstanceReferenceInformationGeneElementType\",\n        \"fhir.resources.substancereferenceinformation.SubstanceReferenceInformationGeneElement\",\n    )\n\n    SubstanceReferenceInformationTargetType = create_fhir_type(\n        \"SubstanceReferenceInformationTargetType\",\n        \"fhir.resources.substancereferenceinformation.SubstanceReferenceInformationTarget\",\n    )\n\n    SubstanceSourceMaterialType = create_fhir_type(\n        \"SubstanceSourceMaterialType\",\n        \"fhir.resources.substancesourcematerial.SubstanceSourceMaterial\",\n    )\n\n    SubstanceSourceMaterialFractionDescriptionType = create_fhir_type(\n        \"SubstanceSourceMaterialFractionDescriptionType\",\n        \"fhir.resources.substancesourcematerial.SubstanceSourceMaterialFractionDescription\",\n    )\n\n    SubstanceSourceMaterialOrganismType = create_fhir_type(\n        \"SubstanceSourceMaterialOrganismType\",\n        \"fhir.resources.substancesourcematerial.SubstanceSourceMaterialOrganism\",\n    )\n\n    SubstanceSourceMaterialOrganismAuthorType = create_fhir_type(\n        \"SubstanceSourceMaterialOrganismAuthorType\",\n        \"fhir.resources.substancesourcematerial.SubstanceSourceMaterialOrganismAuthor\",\n    )\n\n    SubstanceSourceMaterialOrganismHybridType = create_fhir_type(\n        \"SubstanceSourceMaterialOrganismHybridType\",\n        \"fhir.resources.substancesourcematerial.SubstanceSourceMaterialOrganismHybrid\",\n    )\n\n    SubstanceSourceMaterialOrganismOrganismGeneralType = create_fhir_type(\n        \"SubstanceSourceMaterialOrganismOrganismGeneralType\",\n        \"fhir.resources.substancesourcematerial.SubstanceSourceMaterialOrganismOrganismGeneral\",\n    )\n\n    SubstanceSourceMaterialPartDescriptionType = create_fhir_type(\n        \"SubstanceSourceMaterialPartDescriptionType\",\n        \"fhir.resources.substancesourcematerial.SubstanceSourceMaterialPartDescription\",\n    )\n\n    SupplyDeliveryType = create_fhir_type(\n        \"SupplyDeliveryType\", \"fhir.resources.supplydelivery.SupplyDelivery\"\n    )\n\n    SupplyDeliverySuppliedItemType = create_fhir_type(\n        \"SupplyDeliverySuppliedItemType\",\n        \"fhir.resources.supplydelivery.SupplyDeliverySuppliedItem\",\n    )\n\n    SupplyRequestType = create_fhir_type(\n        \"SupplyRequestType\", \"fhir.resources.supplyrequest.SupplyRequest\"\n    )\n\n    SupplyRequestParameterType = create_fhir_type(\n        \"SupplyRequestParameterType\",\n        \"fhir.resources.supplyrequest.SupplyRequestParameter\",\n    )\n\n    TaskType = create_fhir_type(\"TaskType\", \"fhir.resources.task.Task\")\n\n    TaskInputType = create_fhir_type(\"TaskInputType\", \"fhir.resources.task.TaskInput\")\n\n    TaskOutputType = create_fhir_type(\n        \"TaskOutputType\", \"fhir.resources.task.TaskOutput\"\n    )\n\n    TaskPerformerType = create_fhir_type(\n        \"TaskPerformerType\", \"fhir.resources.task.TaskPerformer\"\n    )\n\n    TaskRestrictionType = create_fhir_type(\n        \"TaskRestrictionType\", \"fhir.resources.task.TaskRestriction\"\n    )\n\n    TerminologyCapabilitiesType = create_fhir_type(\n        \"TerminologyCapabilitiesType\",\n        \"fhir.resources.terminologycapabilities.TerminologyCapabilities\",\n    )\n\n    TerminologyCapabilitiesClosureType = create_fhir_type(\n        \"TerminologyCapabilitiesClosureType\",\n        \"fhir.resources.terminologycapabilities.TerminologyCapabilitiesClosure\",\n    )\n\n    TerminologyCapabilitiesCodeSystemType = create_fhir_type(\n        \"TerminologyCapabilitiesCodeSystemType\",\n        \"fhir.resources.terminologycapabilities.TerminologyCapabilitiesCodeSystem\",\n    )\n\n    TerminologyCapabilitiesCodeSystemVersionType = create_fhir_type(\n        \"TerminologyCapabilitiesCodeSystemVersionType\",\n        \"fhir.resources.terminologycapabilities.TerminologyCapabilitiesCodeSystemVersion\",\n    )\n\n    TerminologyCapabilitiesCodeSystemVersionFilterType = create_fhir_type(\n        \"TerminologyCapabilitiesCodeSystemVersionFilterType\",\n        \"fhir.resources.terminologycapabilities.TerminologyCapabilitiesCodeSystemVersionFilter\",\n    )\n\n    TerminologyCapabilitiesExpansionType = create_fhir_type(\n        \"TerminologyCapabilitiesExpansionType\",\n        \"fhir.resources.terminologycapabilities.TerminologyCapabilitiesExpansion\",\n    )\n\n    TerminologyCapabilitiesExpansionParameterType = create_fhir_type(\n        \"TerminologyCapabilitiesExpansionParameterType\",\n        \"fhir.resources.terminologycapabilities.TerminologyCapabilitiesExpansionParameter\",\n    )\n\n    TerminologyCapabilitiesImplementationType = create_fhir_type(\n        \"TerminologyCapabilitiesImplementationType\",\n        \"fhir.resources.terminologycapabilities.TerminologyCapabilitiesImplementation\",\n    )\n\n    TerminologyCapabilitiesSoftwareType = create_fhir_type(\n        \"TerminologyCapabilitiesSoftwareType\",\n        \"fhir.resources.terminologycapabilities.TerminologyCapabilitiesSoftware\",\n    )\n\n    TerminologyCapabilitiesTranslationType = create_fhir_type(\n        \"TerminologyCapabilitiesTranslationType\",\n        \"fhir.resources.terminologycapabilities.TerminologyCapabilitiesTranslation\",\n    )\n\n    TerminologyCapabilitiesValidateCodeType = create_fhir_type(\n        \"TerminologyCapabilitiesValidateCodeType\",\n        \"fhir.resources.terminologycapabilities.TerminologyCapabilitiesValidateCode\",\n    )\n\n    TestPlanType = create_fhir_type(\"TestPlanType\", \"fhir.resources.testplan.TestPlan\")\n\n    TestPlanDependencyType = create_fhir_type(\n        \"TestPlanDependencyType\", \"fhir.resources.testplan.TestPlanDependency\"\n    )\n\n    TestPlanTestCaseType = create_fhir_type(\n        \"TestPlanTestCaseType\", \"fhir.resources.testplan.TestPlanTestCase\"\n    )\n\n    TestPlanTestCaseAssertionType = create_fhir_type(\n        \"TestPlanTestCaseAssertionType\",\n        \"fhir.resources.testplan.TestPlanTestCaseAssertion\",\n    )\n\n    TestPlanTestCaseDependencyType = create_fhir_type(\n        \"TestPlanTestCaseDependencyType\",\n        \"fhir.resources.testplan.TestPlanTestCaseDependency\",\n    )\n\n    TestPlanTestCaseTestDataType = create_fhir_type(\n        \"TestPlanTestCaseTestDataType\",\n        \"fhir.resources.testplan.TestPlanTestCaseTestData\",\n    )\n\n    TestPlanTestCaseTestRunType = create_fhir_type(\n        \"TestPlanTestCaseTestRunType\", \"fhir.resources.testplan.TestPlanTestCaseTestRun\"\n    )\n\n    TestPlanTestCaseTestRunScriptType = create_fhir_type(\n        \"TestPlanTestCaseTestRunScriptType\",\n        \"fhir.resources.testplan.TestPlanTestCaseTestRunScript\",\n    )\n\n    TestReportType = create_fhir_type(\n        \"TestReportType\", \"fhir.resources.testreport.TestReport\"\n    )\n\n    TestReportParticipantType = create_fhir_type(\n        \"TestReportParticipantType\", \"fhir.resources.testreport.TestReportParticipant\"\n    )\n\n    TestReportSetupType = create_fhir_type(\n        \"TestReportSetupType\", \"fhir.resources.testreport.TestReportSetup\"\n    )\n\n    TestReportSetupActionType = create_fhir_type(\n        \"TestReportSetupActionType\", \"fhir.resources.testreport.TestReportSetupAction\"\n    )\n\n    TestReportSetupActionAssertType = create_fhir_type(\n        \"TestReportSetupActionAssertType\",\n        \"fhir.resources.testreport.TestReportSetupActionAssert\",\n    )\n\n    TestReportSetupActionAssertRequirementType = create_fhir_type(\n        \"TestReportSetupActionAssertRequirementType\",\n        \"fhir.resources.testreport.TestReportSetupActionAssertRequirement\",\n    )\n\n    TestReportSetupActionOperationType = create_fhir_type(\n        \"TestReportSetupActionOperationType\",\n        \"fhir.resources.testreport.TestReportSetupActionOperation\",\n    )\n\n    TestReportTeardownType = create_fhir_type(\n        \"TestReportTeardownType\", \"fhir.resources.testreport.TestReportTeardown\"\n    )\n\n    TestReportTeardownActionType = create_fhir_type(\n        \"TestReportTeardownActionType\",\n        \"fhir.resources.testreport.TestReportTeardownAction\",\n    )\n\n    TestReportTestType = create_fhir_type(\n        \"TestReportTestType\", \"fhir.resources.testreport.TestReportTest\"\n    )\n\n    TestReportTestActionType = create_fhir_type(\n        \"TestReportTestActionType\", \"fhir.resources.testreport.TestReportTestAction\"\n    )\n\n    TestScriptType = create_fhir_type(\n        \"TestScriptType\", \"fhir.resources.testscript.TestScript\"\n    )\n\n    TestScriptDestinationType = create_fhir_type(\n        \"TestScriptDestinationType\", \"fhir.resources.testscript.TestScriptDestination\"\n    )\n\n    TestScriptFixtureType = create_fhir_type(\n        \"TestScriptFixtureType\", \"fhir.resources.testscript.TestScriptFixture\"\n    )\n\n    TestScriptMetadataType = create_fhir_type(\n        \"TestScriptMetadataType\", \"fhir.resources.testscript.TestScriptMetadata\"\n    )\n\n    TestScriptMetadataCapabilityType = create_fhir_type(\n        \"TestScriptMetadataCapabilityType\",\n        \"fhir.resources.testscript.TestScriptMetadataCapability\",\n    )\n\n    TestScriptMetadataLinkType = create_fhir_type(\n        \"TestScriptMetadataLinkType\", \"fhir.resources.testscript.TestScriptMetadataLink\"\n    )\n\n    TestScriptOriginType = create_fhir_type(\n        \"TestScriptOriginType\", \"fhir.resources.testscript.TestScriptOrigin\"\n    )\n\n    TestScriptScopeType = create_fhir_type(\n        \"TestScriptScopeType\", \"fhir.resources.testscript.TestScriptScope\"\n    )\n\n    TestScriptSetupType = create_fhir_type(\n        \"TestScriptSetupType\", \"fhir.resources.testscript.TestScriptSetup\"\n    )\n\n    TestScriptSetupActionType = create_fhir_type(\n        \"TestScriptSetupActionType\", \"fhir.resources.testscript.TestScriptSetupAction\"\n    )\n\n    TestScriptSetupActionAssertType = create_fhir_type(\n        \"TestScriptSetupActionAssertType\",\n        \"fhir.resources.testscript.TestScriptSetupActionAssert\",\n    )\n\n    TestScriptSetupActionAssertRequirementType = create_fhir_type(\n        \"TestScriptSetupActionAssertRequirementType\",\n        \"fhir.resources.testscript.TestScriptSetupActionAssertRequirement\",\n    )\n\n    TestScriptSetupActionOperationType = create_fhir_type(\n        \"TestScriptSetupActionOperationType\",\n        \"fhir.resources.testscript.TestScriptSetupActionOperation\",\n    )\n\n    TestScriptSetupActionOperationRequestHeaderType = create_fhir_type(\n        \"TestScriptSetupActionOperationRequestHeaderType\",\n        \"fhir.resources.testscript.TestScriptSetupActionOperationRequestHeader\",\n    )\n\n    TestScriptTeardownType = create_fhir_type(\n        \"TestScriptTeardownType\", \"fhir.resources.testscript.TestScriptTeardown\"\n    )\n\n    TestScriptTeardownActionType = create_fhir_type(\n        \"TestScriptTeardownActionType\",\n        \"fhir.resources.testscript.TestScriptTeardownAction\",\n    )\n\n    TestScriptTestType = create_fhir_type(\n        \"TestScriptTestType\", \"fhir.resources.testscript.TestScriptTest\"\n    )\n\n    TestScriptTestActionType = create_fhir_type(\n        \"TestScriptTestActionType\", \"fhir.resources.testscript.TestScriptTestAction\"\n    )\n\n    TestScriptVariableType = create_fhir_type(\n        \"TestScriptVariableType\", \"fhir.resources.testscript.TestScriptVariable\"\n    )\n\n    TimingType = create_fhir_type(\"TimingType\", \"fhir.resources.timing.Timing\")\n\n    TimingRepeatType = create_fhir_type(\n        \"TimingRepeatType\", \"fhir.resources.timing.TimingRepeat\"\n    )\n\n    TransportType = create_fhir_type(\n        \"TransportType\", \"fhir.resources.transport.Transport\"\n    )\n\n    TransportInputType = create_fhir_type(\n        \"TransportInputType\", \"fhir.resources.transport.TransportInput\"\n    )\n\n    TransportOutputType = create_fhir_type(\n        \"TransportOutputType\", \"fhir.resources.transport.TransportOutput\"\n    )\n\n    TransportRestrictionType = create_fhir_type(\n        \"TransportRestrictionType\", \"fhir.resources.transport.TransportRestriction\"\n    )\n\n    TriggerDefinitionType = create_fhir_type(\n        \"TriggerDefinitionType\", \"fhir.resources.triggerdefinition.TriggerDefinition\"\n    )\n\n    UsageContextType = create_fhir_type(\n        \"UsageContextType\", \"fhir.resources.usagecontext.UsageContext\"\n    )\n\n    ValueSetType = create_fhir_type(\"ValueSetType\", \"fhir.resources.valueset.ValueSet\")\n\n    ValueSetComposeType = create_fhir_type(\n        \"ValueSetComposeType\", \"fhir.resources.valueset.ValueSetCompose\"\n    )\n\n    ValueSetComposeIncludeType = create_fhir_type(\n        \"ValueSetComposeIncludeType\", \"fhir.resources.valueset.ValueSetComposeInclude\"\n    )\n\n    ValueSetComposeIncludeConceptType = create_fhir_type(\n        \"ValueSetComposeIncludeConceptType\",\n        \"fhir.resources.valueset.ValueSetComposeIncludeConcept\",\n    )\n\n    ValueSetComposeIncludeConceptDesignationType = create_fhir_type(\n        \"ValueSetComposeIncludeConceptDesignationType\",\n        \"fhir.resources.valueset.ValueSetComposeIncludeConceptDesignation\",\n    )\n\n    ValueSetComposeIncludeFilterType = create_fhir_type(\n        \"ValueSetComposeIncludeFilterType\",\n        \"fhir.resources.valueset.ValueSetComposeIncludeFilter\",\n    )\n\n    ValueSetExpansionType = create_fhir_type(\n        \"ValueSetExpansionType\", \"fhir.resources.valueset.ValueSetExpansion\"\n    )\n\n    ValueSetExpansionContainsType = create_fhir_type(\n        \"ValueSetExpansionContainsType\",\n        \"fhir.resources.valueset.ValueSetExpansionContains\",\n    )\n\n    ValueSetExpansionContainsPropertyType = create_fhir_type(\n        \"ValueSetExpansionContainsPropertyType\",\n        \"fhir.resources.valueset.ValueSetExpansionContainsProperty\",\n    )\n\n    ValueSetExpansionContainsPropertySubPropertyType = create_fhir_type(\n        \"ValueSetExpansionContainsPropertySubPropertyType\",\n        \"fhir.resources.valueset.ValueSetExpansionContainsPropertySubProperty\",\n    )\n\n    ValueSetExpansionParameterType = create_fhir_type(\n        \"ValueSetExpansionParameterType\",\n        \"fhir.resources.valueset.ValueSetExpansionParameter\",\n    )\n\n    ValueSetExpansionPropertyType = create_fhir_type(\n        \"ValueSetExpansionPropertyType\",\n        \"fhir.resources.valueset.ValueSetExpansionProperty\",\n    )\n\n    ValueSetScopeType = create_fhir_type(\n        \"ValueSetScopeType\", \"fhir.resources.valueset.ValueSetScope\"\n    )\n\n    VerificationResultType = create_fhir_type(\n        \"VerificationResultType\", \"fhir.resources.verificationresult.VerificationResult\"\n    )\n\n    VerificationResultAttestationType = create_fhir_type(\n        \"VerificationResultAttestationType\",\n        \"fhir.resources.verificationresult.VerificationResultAttestation\",\n    )\n\n    VerificationResultPrimarySourceType = create_fhir_type(\n        \"VerificationResultPrimarySourceType\",\n        \"fhir.resources.verificationresult.VerificationResultPrimarySource\",\n    )\n\n    VerificationResultValidatorType = create_fhir_type(\n        \"VerificationResultValidatorType\",\n        \"fhir.resources.verificationresult.VerificationResultValidator\",\n    )\n\n    VirtualServiceDetailType = create_fhir_type(\n        \"VirtualServiceDetailType\",\n        \"fhir.resources.virtualservicedetail.VirtualServiceDetail\",\n    )\n\n    VisionPrescriptionType = create_fhir_type(\n        \"VisionPrescriptionType\", \"fhir.resources.visionprescription.VisionPrescription\"\n    )\n\n    VisionPrescriptionLensSpecificationType = create_fhir_type(\n        \"VisionPrescriptionLensSpecificationType\",\n        \"fhir.resources.visionprescription.VisionPrescriptionLensSpecification\",\n    )\n\n    VisionPrescriptionLensSpecificationPrismType = create_fhir_type(\n        \"VisionPrescriptionLensSpecificationPrismType\",\n        \"fhir.resources.visionprescription.VisionPrescriptionLensSpecificationPrism\",\n    )\n\n__all__ = [\n    \"BooleanType\",\n    \"StringType\",\n    \"Base64BinaryType\",\n    \"CodeType\",\n    \"IdType\",\n    \"IntegerType\",\n    \"Integer64Type\",\n    \"DecimalType\",\n    \"UnsignedIntType\",\n    \"PositiveIntType\",\n    \"CanonicalType\",\n    \"UriType\",\n    \"OidType\",\n    \"UuidType\",\n    \"UrlType\",\n    \"MarkdownType\",\n    \"XhtmlType\",\n    \"DateType\",\n    \"DateTimeType\",\n    \"InstantType\",\n    \"TimeType\",\n    \"FHIRPrimitiveExtensionType\",\n    \"AccountType\",\n    \"AccountBalanceType\",\n    \"AccountCoverageType\",\n    \"AccountDiagnosisType\",\n    \"AccountGuarantorType\",\n    \"AccountProcedureType\",\n    \"AccountRelatedAccountType\",\n    \"ActivityDefinitionType\",\n    \"ActivityDefinitionDynamicValueType\",\n    \"ActivityDefinitionParticipantType\",\n    \"ActorDefinitionType\",\n    \"AddressType\",\n    \"AdministrableProductDefinitionType\",\n    \"AdministrableProductDefinitionPropertyType\",\n    \"AdministrableProductDefinitionRouteOfAdministrationType\",\n    \"AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesType\",\n    \"AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodType\",\n    \"AdverseEventType\",\n    \"AdverseEventContributingFactorType\",\n    \"AdverseEventMitigatingActionType\",\n    \"AdverseEventParticipantType\",\n    \"AdverseEventPreventiveActionType\",\n    \"AdverseEventSupportingInfoType\",\n    \"AdverseEventSuspectEntityType\",\n    \"AdverseEventSuspectEntityCausalityType\",\n    \"AgeType\",\n    \"AllergyIntoleranceType\",\n    \"AllergyIntoleranceParticipantType\",\n    \"AllergyIntoleranceReactionType\",\n    \"AnnotationType\",\n    \"AppointmentType\",\n    \"AppointmentParticipantType\",\n    \"AppointmentRecurrenceTemplateType\",\n    \"AppointmentRecurrenceTemplateMonthlyTemplateType\",\n    \"AppointmentRecurrenceTemplateWeeklyTemplateType\",\n    \"AppointmentRecurrenceTemplateYearlyTemplateType\",\n    \"AppointmentResponseType\",\n    \"ArtifactAssessmentType\",\n    \"ArtifactAssessmentContentType\",\n    \"AttachmentType\",\n    \"AuditEventType\",\n    \"AuditEventAgentType\",\n    \"AuditEventEntityType\",\n    \"AuditEventEntityDetailType\",\n    \"AuditEventOutcomeType\",\n    \"AuditEventSourceType\",\n    \"AvailabilityType\",\n    \"AvailabilityAvailableTimeType\",\n    \"AvailabilityNotAvailableTimeType\",\n    \"BackboneElementType\",\n    \"BackboneTypeType\",\n    \"BaseType\",\n    \"BasicType\",\n    \"BinaryType\",\n    \"BiologicallyDerivedProductType\",\n    \"BiologicallyDerivedProductCollectionType\",\n    \"BiologicallyDerivedProductDispenseType\",\n    \"BiologicallyDerivedProductDispensePerformerType\",\n    \"BiologicallyDerivedProductPropertyType\",\n    \"BodyStructureType\",\n    \"BodyStructureIncludedStructureType\",\n    \"BodyStructureIncludedStructureBodyLandmarkOrientationType\",\n    \"BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkType\",\n    \"BundleType\",\n    \"BundleEntryType\",\n    \"BundleEntryRequestType\",\n    \"BundleEntryResponseType\",\n    \"BundleEntrySearchType\",\n    \"BundleLinkType\",\n    \"CanonicalResourceType\",\n    \"CapabilityStatementType\",\n    \"CapabilityStatementDocumentType\",\n    \"CapabilityStatementImplementationType\",\n    \"CapabilityStatementMessagingType\",\n    \"CapabilityStatementMessagingEndpointType\",\n    \"CapabilityStatementMessagingSupportedMessageType\",\n    \"CapabilityStatementRestType\",\n    \"CapabilityStatementRestInteractionType\",\n    \"CapabilityStatementRestResourceType\",\n    \"CapabilityStatementRestResourceInteractionType\",\n    \"CapabilityStatementRestResourceOperationType\",\n    \"CapabilityStatementRestResourceSearchParamType\",\n    \"CapabilityStatementRestSecurityType\",\n    \"CapabilityStatementSoftwareType\",\n    \"CarePlanType\",\n    \"CarePlanActivityType\",\n    \"CareTeamType\",\n    \"CareTeamParticipantType\",\n    \"ChargeItemType\",\n    \"ChargeItemDefinitionType\",\n    \"ChargeItemDefinitionApplicabilityType\",\n    \"ChargeItemDefinitionPropertyGroupType\",\n    \"ChargeItemPerformerType\",\n    \"CitationType\",\n    \"CitationCitedArtifactType\",\n    \"CitationCitedArtifactAbstractType\",\n    \"CitationCitedArtifactClassificationType\",\n    \"CitationCitedArtifactContributorshipType\",\n    \"CitationCitedArtifactContributorshipEntryType\",\n    \"CitationCitedArtifactContributorshipEntryContributionInstanceType\",\n    \"CitationCitedArtifactContributorshipSummaryType\",\n    \"CitationCitedArtifactPartType\",\n    \"CitationCitedArtifactPublicationFormType\",\n    \"CitationCitedArtifactPublicationFormPublishedInType\",\n    \"CitationCitedArtifactRelatesToType\",\n    \"CitationCitedArtifactStatusDateType\",\n    \"CitationCitedArtifactTitleType\",\n    \"CitationCitedArtifactVersionType\",\n    \"CitationCitedArtifactWebLocationType\",\n    \"CitationClassificationType\",\n    \"CitationStatusDateType\",\n    \"CitationSummaryType\",\n    \"ClaimType\",\n    \"ClaimAccidentType\",\n    \"ClaimCareTeamType\",\n    \"ClaimDiagnosisType\",\n    \"ClaimEventType\",\n    \"ClaimInsuranceType\",\n    \"ClaimItemType\",\n    \"ClaimItemBodySiteType\",\n    \"ClaimItemDetailType\",\n    \"ClaimItemDetailSubDetailType\",\n    \"ClaimPayeeType\",\n    \"ClaimProcedureType\",\n    \"ClaimRelatedType\",\n    \"ClaimResponseType\",\n    \"ClaimResponseAddItemType\",\n    \"ClaimResponseAddItemBodySiteType\",\n    \"ClaimResponseAddItemDetailType\",\n    \"ClaimResponseAddItemDetailSubDetailType\",\n    \"ClaimResponseErrorType\",\n    \"ClaimResponseEventType\",\n    \"ClaimResponseInsuranceType\",\n    \"ClaimResponseItemType\",\n    \"ClaimResponseItemAdjudicationType\",\n    \"ClaimResponseItemDetailType\",\n    \"ClaimResponseItemDetailSubDetailType\",\n    \"ClaimResponseItemReviewOutcomeType\",\n    \"ClaimResponsePaymentType\",\n    \"ClaimResponseProcessNoteType\",\n    \"ClaimResponseTotalType\",\n    \"ClaimSupportingInfoType\",\n    \"ClinicalImpressionType\",\n    \"ClinicalImpressionFindingType\",\n    \"ClinicalUseDefinitionType\",\n    \"ClinicalUseDefinitionContraindicationType\",\n    \"ClinicalUseDefinitionContraindicationOtherTherapyType\",\n    \"ClinicalUseDefinitionIndicationType\",\n    \"ClinicalUseDefinitionInteractionType\",\n    \"ClinicalUseDefinitionInteractionInteractantType\",\n    \"ClinicalUseDefinitionUndesirableEffectType\",\n    \"ClinicalUseDefinitionWarningType\",\n    \"CodeSystemType\",\n    \"CodeSystemConceptType\",\n    \"CodeSystemConceptDesignationType\",\n    \"CodeSystemConceptPropertyType\",\n    \"CodeSystemFilterType\",\n    \"CodeSystemPropertyType\",\n    \"CodeableConceptType\",\n    \"CodeableReferenceType\",\n    \"CodingType\",\n    \"CommunicationType\",\n    \"CommunicationPayloadType\",\n    \"CommunicationRequestType\",\n    \"CommunicationRequestPayloadType\",\n    \"CompartmentDefinitionType\",\n    \"CompartmentDefinitionResourceType\",\n    \"CompositionType\",\n    \"CompositionAttesterType\",\n    \"CompositionEventType\",\n    \"CompositionSectionType\",\n    \"ConceptMapType\",\n    \"ConceptMapAdditionalAttributeType\",\n    \"ConceptMapGroupType\",\n    \"ConceptMapGroupElementType\",\n    \"ConceptMapGroupElementTargetType\",\n    \"ConceptMapGroupElementTargetDependsOnType\",\n    \"ConceptMapGroupElementTargetPropertyType\",\n    \"ConceptMapGroupUnmappedType\",\n    \"ConceptMapPropertyType\",\n    \"ConditionType\",\n    \"ConditionDefinitionType\",\n    \"ConditionDefinitionMedicationType\",\n    \"ConditionDefinitionObservationType\",\n    \"ConditionDefinitionPlanType\",\n    \"ConditionDefinitionPreconditionType\",\n    \"ConditionDefinitionQuestionnaireType\",\n    \"ConditionParticipantType\",\n    \"ConditionStageType\",\n    \"ConsentType\",\n    \"ConsentPolicyBasisType\",\n    \"ConsentProvisionType\",\n    \"ConsentProvisionActorType\",\n    \"ConsentProvisionDataType\",\n    \"ConsentVerificationType\",\n    \"ContactDetailType\",\n    \"ContactPointType\",\n    \"ContractType\",\n    \"ContractContentDefinitionType\",\n    \"ContractFriendlyType\",\n    \"ContractLegalType\",\n    \"ContractRuleType\",\n    \"ContractSignerType\",\n    \"ContractTermType\",\n    \"ContractTermActionType\",\n    \"ContractTermActionSubjectType\",\n    \"ContractTermAssetType\",\n    \"ContractTermAssetContextType\",\n    \"ContractTermAssetValuedItemType\",\n    \"ContractTermOfferType\",\n    \"ContractTermOfferAnswerType\",\n    \"ContractTermOfferPartyType\",\n    \"ContractTermSecurityLabelType\",\n    \"ContributorType\",\n    \"CountType\",\n    \"CoverageType\",\n    \"CoverageClassType\",\n    \"CoverageCostToBeneficiaryType\",\n    \"CoverageCostToBeneficiaryExceptionType\",\n    \"CoverageEligibilityRequestType\",\n    \"CoverageEligibilityRequestEventType\",\n    \"CoverageEligibilityRequestInsuranceType\",\n    \"CoverageEligibilityRequestItemType\",\n    \"CoverageEligibilityRequestItemDiagnosisType\",\n    \"CoverageEligibilityRequestSupportingInfoType\",\n    \"CoverageEligibilityResponseType\",\n    \"CoverageEligibilityResponseErrorType\",\n    \"CoverageEligibilityResponseEventType\",\n    \"CoverageEligibilityResponseInsuranceType\",\n    \"CoverageEligibilityResponseInsuranceItemType\",\n    \"CoverageEligibilityResponseInsuranceItemBenefitType\",\n    \"CoveragePaymentByType\",\n    \"DataRequirementType\",\n    \"DataRequirementCodeFilterType\",\n    \"DataRequirementDateFilterType\",\n    \"DataRequirementSortType\",\n    \"DataRequirementValueFilterType\",\n    \"DataTypeType\",\n    \"DetectedIssueType\",\n    \"DetectedIssueEvidenceType\",\n    \"DetectedIssueMitigationType\",\n    \"DeviceType\",\n    \"DeviceAssociationType\",\n    \"DeviceAssociationOperationType\",\n    \"DeviceConformsToType\",\n    \"DeviceDefinitionType\",\n    \"DeviceDefinitionChargeItemType\",\n    \"DeviceDefinitionClassificationType\",\n    \"DeviceDefinitionConformsToType\",\n    \"DeviceDefinitionCorrectiveActionType\",\n    \"DeviceDefinitionDeviceNameType\",\n    \"DeviceDefinitionGuidelineType\",\n    \"DeviceDefinitionHasPartType\",\n    \"DeviceDefinitionLinkType\",\n    \"DeviceDefinitionMaterialType\",\n    \"DeviceDefinitionPackagingType\",\n    \"DeviceDefinitionPackagingDistributorType\",\n    \"DeviceDefinitionPropertyType\",\n    \"DeviceDefinitionRegulatoryIdentifierType\",\n    \"DeviceDefinitionUdiDeviceIdentifierType\",\n    \"DeviceDefinitionUdiDeviceIdentifierMarketDistributionType\",\n    \"DeviceDefinitionVersionType\",\n    \"DeviceDispenseType\",\n    \"DeviceDispensePerformerType\",\n    \"DeviceMetricType\",\n    \"DeviceMetricCalibrationType\",\n    \"DeviceNameType\",\n    \"DevicePropertyType\",\n    \"DeviceRequestType\",\n    \"DeviceRequestParameterType\",\n    \"DeviceUdiCarrierType\",\n    \"DeviceUsageType\",\n    \"DeviceUsageAdherenceType\",\n    \"DeviceVersionType\",\n    \"DiagnosticReportType\",\n    \"DiagnosticReportMediaType\",\n    \"DiagnosticReportSupportingInfoType\",\n    \"DistanceType\",\n    \"DocumentReferenceType\",\n    \"DocumentReferenceAttesterType\",\n    \"DocumentReferenceContentType\",\n    \"DocumentReferenceContentProfileType\",\n    \"DocumentReferenceRelatesToType\",\n    \"DomainResourceType\",\n    \"DosageType\",\n    \"DosageDoseAndRateType\",\n    \"DurationType\",\n    \"ElementType\",\n    \"ElementDefinitionType\",\n    \"ElementDefinitionBaseType\",\n    \"ElementDefinitionBindingType\",\n    \"ElementDefinitionBindingAdditionalType\",\n    \"ElementDefinitionConstraintType\",\n    \"ElementDefinitionExampleType\",\n    \"ElementDefinitionMappingType\",\n    \"ElementDefinitionSlicingType\",\n    \"ElementDefinitionSlicingDiscriminatorType\",\n    \"ElementDefinitionTypeType\",\n    \"EncounterType\",\n    \"EncounterAdmissionType\",\n    \"EncounterDiagnosisType\",\n    \"EncounterHistoryType\",\n    \"EncounterHistoryLocationType\",\n    \"EncounterLocationType\",\n    \"EncounterParticipantType\",\n    \"EncounterReasonType\",\n    \"EndpointType\",\n    \"EndpointPayloadType\",\n    \"EnrollmentRequestType\",\n    \"EnrollmentResponseType\",\n    \"EpisodeOfCareType\",\n    \"EpisodeOfCareDiagnosisType\",\n    \"EpisodeOfCareReasonType\",\n    \"EpisodeOfCareStatusHistoryType\",\n    \"EventDefinitionType\",\n    \"EvidenceType\",\n    \"EvidenceCertaintyType\",\n    \"EvidenceReportType\",\n    \"EvidenceReportRelatesToType\",\n    \"EvidenceReportRelatesToTargetType\",\n    \"EvidenceReportSectionType\",\n    \"EvidenceReportSubjectType\",\n    \"EvidenceReportSubjectCharacteristicType\",\n    \"EvidenceStatisticType\",\n    \"EvidenceStatisticAttributeEstimateType\",\n    \"EvidenceStatisticModelCharacteristicType\",\n    \"EvidenceStatisticModelCharacteristicVariableType\",\n    \"EvidenceStatisticSampleSizeType\",\n    \"EvidenceVariableType\",\n    \"EvidenceVariableCategoryType\",\n    \"EvidenceVariableCharacteristicType\",\n    \"EvidenceVariableCharacteristicDefinitionByCombinationType\",\n    \"EvidenceVariableCharacteristicDefinitionByTypeAndValueType\",\n    \"EvidenceVariableCharacteristicTimeFromEventType\",\n    \"EvidenceVariableDefinitionType\",\n    \"ExampleScenarioType\",\n    \"ExampleScenarioActorType\",\n    \"ExampleScenarioInstanceType\",\n    \"ExampleScenarioInstanceContainedInstanceType\",\n    \"ExampleScenarioInstanceVersionType\",\n    \"ExampleScenarioProcessType\",\n    \"ExampleScenarioProcessStepType\",\n    \"ExampleScenarioProcessStepAlternativeType\",\n    \"ExampleScenarioProcessStepOperationType\",\n    \"ExplanationOfBenefitType\",\n    \"ExplanationOfBenefitAccidentType\",\n    \"ExplanationOfBenefitAddItemType\",\n    \"ExplanationOfBenefitAddItemBodySiteType\",\n    \"ExplanationOfBenefitAddItemDetailType\",\n    \"ExplanationOfBenefitAddItemDetailSubDetailType\",\n    \"ExplanationOfBenefitBenefitBalanceType\",\n    \"ExplanationOfBenefitBenefitBalanceFinancialType\",\n    \"ExplanationOfBenefitCareTeamType\",\n    \"ExplanationOfBenefitDiagnosisType\",\n    \"ExplanationOfBenefitEventType\",\n    \"ExplanationOfBenefitInsuranceType\",\n    \"ExplanationOfBenefitItemType\",\n    \"ExplanationOfBenefitItemAdjudicationType\",\n    \"ExplanationOfBenefitItemBodySiteType\",\n    \"ExplanationOfBenefitItemDetailType\",\n    \"ExplanationOfBenefitItemDetailSubDetailType\",\n    \"ExplanationOfBenefitItemReviewOutcomeType\",\n    \"ExplanationOfBenefitPayeeType\",\n    \"ExplanationOfBenefitPaymentType\",\n    \"ExplanationOfBenefitProcedureType\",\n    \"ExplanationOfBenefitProcessNoteType\",\n    \"ExplanationOfBenefitRelatedType\",\n    \"ExplanationOfBenefitSupportingInfoType\",\n    \"ExplanationOfBenefitTotalType\",\n    \"ExpressionType\",\n    \"ExtendedContactDetailType\",\n    \"ExtensionType\",\n    \"FamilyMemberHistoryType\",\n    \"FamilyMemberHistoryConditionType\",\n    \"FamilyMemberHistoryParticipantType\",\n    \"FamilyMemberHistoryProcedureType\",\n    \"FlagType\",\n    \"FormularyItemType\",\n    \"GenomicStudyType\",\n    \"GenomicStudyAnalysisType\",\n    \"GenomicStudyAnalysisDeviceType\",\n    \"GenomicStudyAnalysisInputType\",\n    \"GenomicStudyAnalysisOutputType\",\n    \"GenomicStudyAnalysisPerformerType\",\n    \"GoalType\",\n    \"GoalTargetType\",\n    \"GraphDefinitionType\",\n    \"GraphDefinitionLinkType\",\n    \"GraphDefinitionLinkCompartmentType\",\n    \"GraphDefinitionNodeType\",\n    \"GroupType\",\n    \"GroupCharacteristicType\",\n    \"GroupMemberType\",\n    \"GuidanceResponseType\",\n    \"HealthcareServiceType\",\n    \"HealthcareServiceEligibilityType\",\n    \"HumanNameType\",\n    \"IdentifierType\",\n    \"ImagingSelectionType\",\n    \"ImagingSelectionInstanceType\",\n    \"ImagingSelectionInstanceImageRegion2DType\",\n    \"ImagingSelectionInstanceImageRegion3DType\",\n    \"ImagingSelectionPerformerType\",\n    \"ImagingStudyType\",\n    \"ImagingStudySeriesType\",\n    \"ImagingStudySeriesInstanceType\",\n    \"ImagingStudySeriesPerformerType\",\n    \"ImmunizationType\",\n    \"ImmunizationEvaluationType\",\n    \"ImmunizationPerformerType\",\n    \"ImmunizationProgramEligibilityType\",\n    \"ImmunizationProtocolAppliedType\",\n    \"ImmunizationReactionType\",\n    \"ImmunizationRecommendationType\",\n    \"ImmunizationRecommendationRecommendationType\",\n    \"ImmunizationRecommendationRecommendationDateCriterionType\",\n    \"ImplementationGuideType\",\n    \"ImplementationGuideDefinitionType\",\n    \"ImplementationGuideDefinitionGroupingType\",\n    \"ImplementationGuideDefinitionPageType\",\n    \"ImplementationGuideDefinitionParameterType\",\n    \"ImplementationGuideDefinitionResourceType\",\n    \"ImplementationGuideDefinitionTemplateType\",\n    \"ImplementationGuideDependsOnType\",\n    \"ImplementationGuideGlobalType\",\n    \"ImplementationGuideManifestType\",\n    \"ImplementationGuideManifestPageType\",\n    \"ImplementationGuideManifestResourceType\",\n    \"IngredientType\",\n    \"IngredientManufacturerType\",\n    \"IngredientSubstanceType\",\n    \"IngredientSubstanceStrengthType\",\n    \"IngredientSubstanceStrengthReferenceStrengthType\",\n    \"InsurancePlanType\",\n    \"InsurancePlanCoverageType\",\n    \"InsurancePlanCoverageBenefitType\",\n    \"InsurancePlanCoverageBenefitLimitType\",\n    \"InsurancePlanPlanType\",\n    \"InsurancePlanPlanGeneralCostType\",\n    \"InsurancePlanPlanSpecificCostType\",\n    \"InsurancePlanPlanSpecificCostBenefitType\",\n    \"InsurancePlanPlanSpecificCostBenefitCostType\",\n    \"InventoryItemType\",\n    \"InventoryItemAssociationType\",\n    \"InventoryItemCharacteristicType\",\n    \"InventoryItemDescriptionType\",\n    \"InventoryItemInstanceType\",\n    \"InventoryItemNameType\",\n    \"InventoryItemResponsibleOrganizationType\",\n    \"InventoryReportType\",\n    \"InventoryReportInventoryListingType\",\n    \"InventoryReportInventoryListingItemType\",\n    \"InvoiceType\",\n    \"InvoiceLineItemType\",\n    \"InvoiceParticipantType\",\n    \"LibraryType\",\n    \"LinkageType\",\n    \"LinkageItemType\",\n    \"ListType\",\n    \"ListEntryType\",\n    \"LocationType\",\n    \"LocationPositionType\",\n    \"ManufacturedItemDefinitionType\",\n    \"ManufacturedItemDefinitionComponentType\",\n    \"ManufacturedItemDefinitionComponentConstituentType\",\n    \"ManufacturedItemDefinitionPropertyType\",\n    \"MarketingStatusType\",\n    \"MeasureType\",\n    \"MeasureGroupType\",\n    \"MeasureGroupPopulationType\",\n    \"MeasureGroupStratifierType\",\n    \"MeasureGroupStratifierComponentType\",\n    \"MeasureReportType\",\n    \"MeasureReportGroupType\",\n    \"MeasureReportGroupPopulationType\",\n    \"MeasureReportGroupStratifierType\",\n    \"MeasureReportGroupStratifierStratumType\",\n    \"MeasureReportGroupStratifierStratumComponentType\",\n    \"MeasureReportGroupStratifierStratumPopulationType\",\n    \"MeasureSupplementalDataType\",\n    \"MeasureTermType\",\n    \"MedicationType\",\n    \"MedicationAdministrationType\",\n    \"MedicationAdministrationDosageType\",\n    \"MedicationAdministrationPerformerType\",\n    \"MedicationBatchType\",\n    \"MedicationDispenseType\",\n    \"MedicationDispensePerformerType\",\n    \"MedicationDispenseSubstitutionType\",\n    \"MedicationIngredientType\",\n    \"MedicationKnowledgeType\",\n    \"MedicationKnowledgeCostType\",\n    \"MedicationKnowledgeDefinitionalType\",\n    \"MedicationKnowledgeDefinitionalDrugCharacteristicType\",\n    \"MedicationKnowledgeDefinitionalIngredientType\",\n    \"MedicationKnowledgeIndicationGuidelineType\",\n    \"MedicationKnowledgeIndicationGuidelineDosingGuidelineType\",\n    \"MedicationKnowledgeIndicationGuidelineDosingGuidelineDosageType\",\n    \"MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristicType\",\n    \"MedicationKnowledgeMedicineClassificationType\",\n    \"MedicationKnowledgeMonitoringProgramType\",\n    \"MedicationKnowledgeMonographType\",\n    \"MedicationKnowledgePackagingType\",\n    \"MedicationKnowledgeRegulatoryType\",\n    \"MedicationKnowledgeRegulatoryMaxDispenseType\",\n    \"MedicationKnowledgeRegulatorySubstitutionType\",\n    \"MedicationKnowledgeRelatedMedicationKnowledgeType\",\n    \"MedicationKnowledgeStorageGuidelineType\",\n    \"MedicationKnowledgeStorageGuidelineEnvironmentalSettingType\",\n    \"MedicationRequestType\",\n    \"MedicationRequestDispenseRequestType\",\n    \"MedicationRequestDispenseRequestInitialFillType\",\n    \"MedicationRequestSubstitutionType\",\n    \"MedicationStatementType\",\n    \"MedicationStatementAdherenceType\",\n    \"MedicinalProductDefinitionType\",\n    \"MedicinalProductDefinitionCharacteristicType\",\n    \"MedicinalProductDefinitionContactType\",\n    \"MedicinalProductDefinitionCrossReferenceType\",\n    \"MedicinalProductDefinitionNameType\",\n    \"MedicinalProductDefinitionNamePartType\",\n    \"MedicinalProductDefinitionNameUsageType\",\n    \"MedicinalProductDefinitionOperationType\",\n    \"MessageDefinitionType\",\n    \"MessageDefinitionAllowedResponseType\",\n    \"MessageDefinitionFocusType\",\n    \"MessageHeaderType\",\n    \"MessageHeaderDestinationType\",\n    \"MessageHeaderResponseType\",\n    \"MessageHeaderSourceType\",\n    \"MetaType\",\n    \"MetadataResourceType\",\n    \"MolecularSequenceType\",\n    \"MolecularSequenceRelativeType\",\n    \"MolecularSequenceRelativeEditType\",\n    \"MolecularSequenceRelativeStartingSequenceType\",\n    \"MonetaryComponentType\",\n    \"MoneyType\",\n    \"NamingSystemType\",\n    \"NamingSystemUniqueIdType\",\n    \"NarrativeType\",\n    \"NutritionIntakeType\",\n    \"NutritionIntakeConsumedItemType\",\n    \"NutritionIntakeIngredientLabelType\",\n    \"NutritionIntakePerformerType\",\n    \"NutritionOrderType\",\n    \"NutritionOrderEnteralFormulaType\",\n    \"NutritionOrderEnteralFormulaAdditiveType\",\n    \"NutritionOrderEnteralFormulaAdministrationType\",\n    \"NutritionOrderEnteralFormulaAdministrationScheduleType\",\n    \"NutritionOrderOralDietType\",\n    \"NutritionOrderOralDietNutrientType\",\n    \"NutritionOrderOralDietScheduleType\",\n    \"NutritionOrderOralDietTextureType\",\n    \"NutritionOrderSupplementType\",\n    \"NutritionOrderSupplementScheduleType\",\n    \"NutritionProductType\",\n    \"NutritionProductCharacteristicType\",\n    \"NutritionProductIngredientType\",\n    \"NutritionProductInstanceType\",\n    \"NutritionProductNutrientType\",\n    \"ObservationType\",\n    \"ObservationComponentType\",\n    \"ObservationDefinitionType\",\n    \"ObservationDefinitionComponentType\",\n    \"ObservationDefinitionQualifiedValueType\",\n    \"ObservationReferenceRangeType\",\n    \"ObservationTriggeredByType\",\n    \"OperationDefinitionType\",\n    \"OperationDefinitionOverloadType\",\n    \"OperationDefinitionParameterType\",\n    \"OperationDefinitionParameterBindingType\",\n    \"OperationDefinitionParameterReferencedFromType\",\n    \"OperationOutcomeType\",\n    \"OperationOutcomeIssueType\",\n    \"OrganizationType\",\n    \"OrganizationAffiliationType\",\n    \"OrganizationQualificationType\",\n    \"PackagedProductDefinitionType\",\n    \"PackagedProductDefinitionLegalStatusOfSupplyType\",\n    \"PackagedProductDefinitionPackagingType\",\n    \"PackagedProductDefinitionPackagingContainedItemType\",\n    \"PackagedProductDefinitionPackagingPropertyType\",\n    \"ParameterDefinitionType\",\n    \"ParametersType\",\n    \"ParametersParameterType\",\n    \"PatientType\",\n    \"PatientCommunicationType\",\n    \"PatientContactType\",\n    \"PatientLinkType\",\n    \"PaymentNoticeType\",\n    \"PaymentReconciliationType\",\n    \"PaymentReconciliationAllocationType\",\n    \"PaymentReconciliationProcessNoteType\",\n    \"PeriodType\",\n    \"PermissionType\",\n    \"PermissionJustificationType\",\n    \"PermissionRuleType\",\n    \"PermissionRuleActivityType\",\n    \"PermissionRuleDataType\",\n    \"PermissionRuleDataResourceType\",\n    \"PersonType\",\n    \"PersonCommunicationType\",\n    \"PersonLinkType\",\n    \"PlanDefinitionType\",\n    \"PlanDefinitionActionType\",\n    \"PlanDefinitionActionConditionType\",\n    \"PlanDefinitionActionDynamicValueType\",\n    \"PlanDefinitionActionInputType\",\n    \"PlanDefinitionActionOutputType\",\n    \"PlanDefinitionActionParticipantType\",\n    \"PlanDefinitionActionRelatedActionType\",\n    \"PlanDefinitionActorType\",\n    \"PlanDefinitionActorOptionType\",\n    \"PlanDefinitionGoalType\",\n    \"PlanDefinitionGoalTargetType\",\n    \"PractitionerType\",\n    \"PractitionerCommunicationType\",\n    \"PractitionerQualificationType\",\n    \"PractitionerRoleType\",\n    \"PrimitiveTypeType\",\n    \"ProcedureType\",\n    \"ProcedureFocalDeviceType\",\n    \"ProcedurePerformerType\",\n    \"ProductShelfLifeType\",\n    \"ProvenanceType\",\n    \"ProvenanceAgentType\",\n    \"ProvenanceEntityType\",\n    \"QuantityType\",\n    \"QuestionnaireType\",\n    \"QuestionnaireItemType\",\n    \"QuestionnaireItemAnswerOptionType\",\n    \"QuestionnaireItemEnableWhenType\",\n    \"QuestionnaireItemInitialType\",\n    \"QuestionnaireResponseType\",\n    \"QuestionnaireResponseItemType\",\n    \"QuestionnaireResponseItemAnswerType\",\n    \"RangeType\",\n    \"RatioType\",\n    \"RatioRangeType\",\n    \"ReferenceType\",\n    \"RegulatedAuthorizationType\",\n    \"RegulatedAuthorizationCaseType\",\n    \"RelatedArtifactType\",\n    \"RelatedPersonType\",\n    \"RelatedPersonCommunicationType\",\n    \"RequestOrchestrationType\",\n    \"RequestOrchestrationActionType\",\n    \"RequestOrchestrationActionConditionType\",\n    \"RequestOrchestrationActionDynamicValueType\",\n    \"RequestOrchestrationActionInputType\",\n    \"RequestOrchestrationActionOutputType\",\n    \"RequestOrchestrationActionParticipantType\",\n    \"RequestOrchestrationActionRelatedActionType\",\n    \"RequirementsType\",\n    \"RequirementsStatementType\",\n    \"ResearchStudyType\",\n    \"ResearchStudyAssociatedPartyType\",\n    \"ResearchStudyComparisonGroupType\",\n    \"ResearchStudyLabelType\",\n    \"ResearchStudyObjectiveType\",\n    \"ResearchStudyOutcomeMeasureType\",\n    \"ResearchStudyProgressStatusType\",\n    \"ResearchStudyRecruitmentType\",\n    \"ResearchSubjectType\",\n    \"ResearchSubjectProgressType\",\n    \"ResourceType\",\n    \"RiskAssessmentType\",\n    \"RiskAssessmentPredictionType\",\n    \"SampledDataType\",\n    \"ScheduleType\",\n    \"SearchParameterType\",\n    \"SearchParameterComponentType\",\n    \"ServiceRequestType\",\n    \"ServiceRequestOrderDetailType\",\n    \"ServiceRequestOrderDetailParameterType\",\n    \"ServiceRequestPatientInstructionType\",\n    \"SignatureType\",\n    \"SlotType\",\n    \"SpecimenType\",\n    \"SpecimenCollectionType\",\n    \"SpecimenContainerType\",\n    \"SpecimenDefinitionType\",\n    \"SpecimenDefinitionTypeTestedType\",\n    \"SpecimenDefinitionTypeTestedContainerType\",\n    \"SpecimenDefinitionTypeTestedContainerAdditiveType\",\n    \"SpecimenDefinitionTypeTestedHandlingType\",\n    \"SpecimenFeatureType\",\n    \"SpecimenProcessingType\",\n    \"StructureDefinitionType\",\n    \"StructureDefinitionContextType\",\n    \"StructureDefinitionDifferentialType\",\n    \"StructureDefinitionMappingType\",\n    \"StructureDefinitionSnapshotType\",\n    \"StructureMapType\",\n    \"StructureMapConstType\",\n    \"StructureMapGroupType\",\n    \"StructureMapGroupInputType\",\n    \"StructureMapGroupRuleType\",\n    \"StructureMapGroupRuleDependentType\",\n    \"StructureMapGroupRuleSourceType\",\n    \"StructureMapGroupRuleTargetType\",\n    \"StructureMapGroupRuleTargetParameterType\",\n    \"StructureMapStructureType\",\n    \"SubscriptionType\",\n    \"SubscriptionFilterByType\",\n    \"SubscriptionParameterType\",\n    \"SubscriptionStatusType\",\n    \"SubscriptionStatusNotificationEventType\",\n    \"SubscriptionTopicType\",\n    \"SubscriptionTopicCanFilterByType\",\n    \"SubscriptionTopicEventTriggerType\",\n    \"SubscriptionTopicNotificationShapeType\",\n    \"SubscriptionTopicResourceTriggerType\",\n    \"SubscriptionTopicResourceTriggerQueryCriteriaType\",\n    \"SubstanceType\",\n    \"SubstanceDefinitionType\",\n    \"SubstanceDefinitionCharacterizationType\",\n    \"SubstanceDefinitionCodeType\",\n    \"SubstanceDefinitionMoietyType\",\n    \"SubstanceDefinitionMolecularWeightType\",\n    \"SubstanceDefinitionNameType\",\n    \"SubstanceDefinitionNameOfficialType\",\n    \"SubstanceDefinitionPropertyType\",\n    \"SubstanceDefinitionRelationshipType\",\n    \"SubstanceDefinitionSourceMaterialType\",\n    \"SubstanceDefinitionStructureType\",\n    \"SubstanceDefinitionStructureRepresentationType\",\n    \"SubstanceIngredientType\",\n    \"SubstanceNucleicAcidType\",\n    \"SubstanceNucleicAcidSubunitType\",\n    \"SubstanceNucleicAcidSubunitLinkageType\",\n    \"SubstanceNucleicAcidSubunitSugarType\",\n    \"SubstancePolymerType\",\n    \"SubstancePolymerMonomerSetType\",\n    \"SubstancePolymerMonomerSetStartingMaterialType\",\n    \"SubstancePolymerRepeatType\",\n    \"SubstancePolymerRepeatRepeatUnitType\",\n    \"SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationType\",\n    \"SubstancePolymerRepeatRepeatUnitStructuralRepresentationType\",\n    \"SubstanceProteinType\",\n    \"SubstanceProteinSubunitType\",\n    \"SubstanceReferenceInformationType\",\n    \"SubstanceReferenceInformationGeneType\",\n    \"SubstanceReferenceInformationGeneElementType\",\n    \"SubstanceReferenceInformationTargetType\",\n    \"SubstanceSourceMaterialType\",\n    \"SubstanceSourceMaterialFractionDescriptionType\",\n    \"SubstanceSourceMaterialOrganismType\",\n    \"SubstanceSourceMaterialOrganismAuthorType\",\n    \"SubstanceSourceMaterialOrganismHybridType\",\n    \"SubstanceSourceMaterialOrganismOrganismGeneralType\",\n    \"SubstanceSourceMaterialPartDescriptionType\",\n    \"SupplyDeliveryType\",\n    \"SupplyDeliverySuppliedItemType\",\n    \"SupplyRequestType\",\n    \"SupplyRequestParameterType\",\n    \"TaskType\",\n    \"TaskInputType\",\n    \"TaskOutputType\",\n    \"TaskPerformerType\",\n    \"TaskRestrictionType\",\n    \"TerminologyCapabilitiesType\",\n    \"TerminologyCapabilitiesClosureType\",\n    \"TerminologyCapabilitiesCodeSystemType\",\n    \"TerminologyCapabilitiesCodeSystemVersionType\",\n    \"TerminologyCapabilitiesCodeSystemVersionFilterType\",\n    \"TerminologyCapabilitiesExpansionType\",\n    \"TerminologyCapabilitiesExpansionParameterType\",\n    \"TerminologyCapabilitiesImplementationType\",\n    \"TerminologyCapabilitiesSoftwareType\",\n    \"TerminologyCapabilitiesTranslationType\",\n    \"TerminologyCapabilitiesValidateCodeType\",\n    \"TestPlanType\",\n    \"TestPlanDependencyType\",\n    \"TestPlanTestCaseType\",\n    \"TestPlanTestCaseAssertionType\",\n    \"TestPlanTestCaseDependencyType\",\n    \"TestPlanTestCaseTestDataType\",\n    \"TestPlanTestCaseTestRunType\",\n    \"TestPlanTestCaseTestRunScriptType\",\n    \"TestReportType\",\n    \"TestReportParticipantType\",\n    \"TestReportSetupType\",\n    \"TestReportSetupActionType\",\n    \"TestReportSetupActionAssertType\",\n    \"TestReportSetupActionAssertRequirementType\",\n    \"TestReportSetupActionOperationType\",\n    \"TestReportTeardownType\",\n    \"TestReportTeardownActionType\",\n    \"TestReportTestType\",\n    \"TestReportTestActionType\",\n    \"TestScriptType\",\n    \"TestScriptDestinationType\",\n    \"TestScriptFixtureType\",\n    \"TestScriptMetadataType\",\n    \"TestScriptMetadataCapabilityType\",\n    \"TestScriptMetadataLinkType\",\n    \"TestScriptOriginType\",\n    \"TestScriptScopeType\",\n    \"TestScriptSetupType\",\n    \"TestScriptSetupActionType\",\n    \"TestScriptSetupActionAssertType\",\n    \"TestScriptSetupActionAssertRequirementType\",\n    \"TestScriptSetupActionOperationType\",\n    \"TestScriptSetupActionOperationRequestHeaderType\",\n    \"TestScriptTeardownType\",\n    \"TestScriptTeardownActionType\",\n    \"TestScriptTestType\",\n    \"TestScriptTestActionType\",\n    \"TestScriptVariableType\",\n    \"TimingType\",\n    \"TimingRepeatType\",\n    \"TransportType\",\n    \"TransportInputType\",\n    \"TransportOutputType\",\n    \"TransportRestrictionType\",\n    \"TriggerDefinitionType\",\n    \"UsageContextType\",\n    \"ValueSetType\",\n    \"ValueSetComposeType\",\n    \"ValueSetComposeIncludeType\",\n    \"ValueSetComposeIncludeConceptType\",\n    \"ValueSetComposeIncludeConceptDesignationType\",\n    \"ValueSetComposeIncludeFilterType\",\n    \"ValueSetExpansionType\",\n    \"ValueSetExpansionContainsType\",\n    \"ValueSetExpansionContainsPropertyType\",\n    \"ValueSetExpansionContainsPropertySubPropertyType\",\n    \"ValueSetExpansionParameterType\",\n    \"ValueSetExpansionPropertyType\",\n    \"ValueSetScopeType\",\n    \"VerificationResultType\",\n    \"VerificationResultAttestationType\",\n    \"VerificationResultPrimarySourceType\",\n    \"VerificationResultValidatorType\",\n    \"VirtualServiceDetailType\",\n    \"VisionPrescriptionType\",\n    \"VisionPrescriptionLensSpecificationType\",\n    \"VisionPrescriptionLensSpecificationPrismType\",\n]\n"
  },
  {
    "path": "fhir/resources/flag.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Flag\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Flag(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Key information to flag to healthcare providers.\n    Prospective warnings of potential issues when providing care to the\n    patient.\n    \"\"\"\n\n    __resource_type__ = \"Flag\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Flag creator\",\n        description=\"The person, organization or device that created the flag.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Clinical, administrative, etc\",\n        description=(\n            \"Allows a flag to be divided into different categories like clinical, \"\n            \"administrative etc. Intended to be used as a means of filtering which \"\n            \"flags are displayed to particular user or in a given context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Coded or textual message to display to user\",\n        description=(\n            \"The coded value or textual component of the flag to display to the \"\n            \"user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Alert relevant during encounter\",\n        description=\"This alert is only relevant during the encounter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Business identifiers assigned to this flag by the performer or other \"\n            \"systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when flag is active\",\n        description=(\n            \"The period of time from the activation of the flag to inactivation of \"\n            \"the flag. If the flag is active, the end of the period should be \"\n            \"unspecified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=\"Supports basic workflow.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who/What is flag about?\",\n        description=(\n            \"The patient, related person, location, group, organization, or \"\n            \"practitioner etc. this is about record this flag is associated with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Location\",\n                \"Group\",\n                \"Organization\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"PlanDefinition\",\n                \"Medication\",\n                \"Procedure\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Flag`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"period\",\n            \"encounter\",\n            \"author\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Flag`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"period\",\n            \"encounter\",\n            \"author\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/formularyitem.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/FormularyItem\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass FormularyItem(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a FormularyItem.\n    This resource describes a product or service that is available through a\n    program and includes the conditions and constraints of availability.  All\n    of the information in this resource is specific to the inclusion of the\n    item in the formulary and is not inherent to the item itself.\n    \"\"\"\n\n    __resource_type__ = \"FormularyItem\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Codes that identify this formulary item\",\n        description=(\n            \"A code (or set of codes) that specify the product or service that is \"\n            \"identified by this formulary item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for this formulary item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | entered-in-error | inactive\",\n        description=(\n            \"The validity about the information of the formulary item and not of \"\n            \"the underlying product or service itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"entered-in-error\", \"inactive\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``FormularyItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"status\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``FormularyItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"status\",\n        ]\n"
  },
  {
    "path": "fhir/resources/genomicstudy.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/GenomicStudy\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass GenomicStudy(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Genomic Study.\n    A GenomicStudy is a set of analyses performed to analyze and generate\n    genomic data.\n    \"\"\"\n\n    __resource_type__ = \"GenomicStudy\"\n\n    analysis: typing.List[fhirtypes.GenomicStudyAnalysisType] | None = Field(\n        default=None,\n        alias=\"analysis\",\n        title=\"Genomic Analysis Event\",\n        description=(\n            \"The details about a specific analysis that was performed in this \"\n            \"GenomicStudy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Event resources that the genomic study is based on\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\", \"Task\"],\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the genomic study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"The healthcare event with which this genomics study is associated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers for this genomic study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"The defined protocol that describes the study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PlanDefinition\"],\n        },\n    )\n    instantiatesCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=(\n            \"The URL pointing to an externally maintained protocol that describes \"\n            \"the study\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    interpreter: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"interpreter\",\n        title=\"Healthcare professionals who interpreted the genomic study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments related to the genomic study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why the genomic study was performed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    referrer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referrer\",\n        title=\"Healthcare professional who requested or referred the genomic study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    startDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"startDate\",\n        title=\"When the genomic study was started\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    startDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_startDate\", title=\"Extension field for ``startDate``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | available | cancelled | entered-in-error | unknown\",\n        description=\"The status of the genomic study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"registered\",\n                \"available\",\n                \"cancelled\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"The primary subject of the genomic study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Substance\",\n                \"BiologicallyDerivedProduct\",\n                \"NutritionProduct\",\n            ],\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"The type of the study (e.g., Familial variant segregation, Functional \"\n            \"variation detection, or Gene expression profiling)\"\n        ),\n        description=(\n            \"The type of the study, e.g., Familial variant segregation, Functional \"\n            \"variation detection, or Gene expression profiling.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GenomicStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"encounter\",\n            \"startDate\",\n            \"basedOn\",\n            \"referrer\",\n            \"interpreter\",\n            \"reason\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"note\",\n            \"description\",\n            \"analysis\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GenomicStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"encounter\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass GenomicStudyAnalysis(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Genomic Analysis Event.\n    The details about a specific analysis that was performed in this\n    GenomicStudy.\n    \"\"\"\n\n    __resource_type__ = \"GenomicStudyAnalysis\"\n\n    changeType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"changeType\",\n        title=(\n            \"Type of the genomic changes studied in the analysis (e.g., DNA, RNA, \"\n            \"or AA change)\"\n        ),\n        description=(\n            \"Type of the genomic changes studied in the analysis, e.g., DNA, RNA, \"\n            \"or amino acid change.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"The date of the analysis event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    device: typing.List[fhirtypes.GenomicStudyAnalysisDeviceType] | None = Field(\n        default=None,\n        alias=\"device\",\n        title=(\n            \"Devices used for the analysis (e.g., instruments, software), with \"\n            \"settings and parameters\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    focus: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=(\n            \"What the genomic analysis is about, when it is not about the subject \"\n            \"of record\"\n        ),\n        description=(\n            \"The focus of a genomic analysis when it is not the patient of record \"\n            \"representing something or someone associated with the patient such as \"\n            \"a spouse, parent, child, or sibling. For example, in trio testing, the\"\n            \" GenomicStudy.subject would be the child (proband) and the \"\n            \"GenomicStudy.analysis.focus of a specific analysis would be the \"\n            \"parent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    genomeBuild: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"genomeBuild\",\n        title=\"Genome build that is used in this analysis\",\n        description=\"The reference genome build that is used in this analysis.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers for the analysis event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    input: typing.List[fhirtypes.GenomicStudyAnalysisInputType] | None = Field(\n        default=None,\n        alias=\"input\",\n        title=\"Inputs for the analysis event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"The defined protocol that describes the analysis\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PlanDefinition\", \"ActivityDefinition\"],\n        },\n    )\n    instantiatesCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=(\n            \"The URL pointing to an externally maintained protocol that describes \"\n            \"the analysis\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    methodType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"methodType\",\n        title=(\n            \"Type of the methods used in the analysis (e.g., FISH, Karyotyping, \" \"MSI)\"\n        ),\n        description=(\n            \"Type of the methods used in the analysis, e.g., Fluorescence in situ \"\n            \"hybridization (FISH), Karyotyping, or Microsatellite instability \"\n            \"testing (MSI).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Any notes capture with the analysis event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    output: typing.List[fhirtypes.GenomicStudyAnalysisOutputType] | None = Field(\n        default=None,\n        alias=\"output\",\n        title=\"Outputs for the analysis event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performer: typing.List[fhirtypes.GenomicStudyAnalysisPerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Performer for the analysis event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    protocolPerformed: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"protocolPerformed\",\n        title=\"The protocol that was performed for the analysis event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\", \"Task\"],\n        },\n    )\n\n    regionsCalled: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"regionsCalled\",\n        title=\"Genomic regions actually called in the analysis event (BED file)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\", \"Observation\"],\n        },\n    )\n\n    regionsStudied: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"regionsStudied\",\n        title=\"The genomic regions to be studied in the analysis (BED file)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\", \"Observation\"],\n        },\n    )\n\n    specimen: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"The specimen used in the analysis event\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name of the analysis event (human friendly)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GenomicStudyAnalysis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"methodType\",\n            \"changeType\",\n            \"genomeBuild\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"title\",\n            \"focus\",\n            \"specimen\",\n            \"date\",\n            \"note\",\n            \"protocolPerformed\",\n            \"regionsStudied\",\n            \"regionsCalled\",\n            \"input\",\n            \"output\",\n            \"performer\",\n            \"device\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GenomicStudyAnalysis`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"identifier\",\n            \"methodType\",\n            \"title\",\n            \"focus\",\n            \"specimen\",\n        ]\n\n\nclass GenomicStudyAnalysisDevice(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Devices used for the analysis (e.g., instruments, software), with settings\n    and parameters.\n    \"\"\"\n\n    __resource_type__ = \"GenomicStudyAnalysisDevice\"\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Device used for the analysis\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Specific function for the device used for the analysis\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GenomicStudyAnalysisDevice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"device\", \"function\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GenomicStudyAnalysisDevice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass GenomicStudyAnalysisInput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Inputs for the analysis event.\n    \"\"\"\n\n    __resource_type__ = \"GenomicStudyAnalysisInput\"\n\n    file: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"file\",\n        title=\"File containing input data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    generatedByIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"generatedByIdentifier\",\n        title=(\n            \"The analysis event or other GenomicStudy that generated this input \" \"file\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e generatedBy[x]\n            \"one_of_many\": \"generatedBy\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    generatedByReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"generatedByReference\",\n        title=(\n            \"The analysis event or other GenomicStudy that generated this input \" \"file\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e generatedBy[x]\n            \"one_of_many\": \"generatedBy\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"GenomicStudy\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of input data (e.g., BAM, CRAM, or FASTA)\",\n        description=\"Type of input data, e.g., BAM, CRAM, or FASTA.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GenomicStudyAnalysisInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"file\",\n            \"type\",\n            \"generatedByIdentifier\",\n            \"generatedByReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GenomicStudyAnalysisInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"file\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"generatedBy\": [\"generatedByIdentifier\", \"generatedByReference\"]\n        }\n        return one_of_many_fields\n\n\nclass GenomicStudyAnalysisOutput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Outputs for the analysis event.\n    \"\"\"\n\n    __resource_type__ = \"GenomicStudyAnalysisOutput\"\n\n    file: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"file\",\n        title=\"File containing output data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of output data (e.g., VCF, MAF, or BAM)\",\n        description=\"Type of output data, e.g., VCF, MAF, or BAM.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GenomicStudyAnalysisOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"file\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GenomicStudyAnalysisOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"file\", \"type\"]\n\n\nclass GenomicStudyAnalysisPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Performer for the analysis event.\n    \"\"\"\n\n    __resource_type__ = \"GenomicStudyAnalysisPerformer\"\n\n    actor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=(\n            \"The organization, healthcare professional, or others who participated \"\n            \"in performing this analysis\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Device\",\n            ],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Role of the actor for this analysis\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GenomicStudyAnalysisPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"actor\", \"role\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GenomicStudyAnalysisPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/goal.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Goal\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Goal(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes the intended objective(s) for a patient, group or organization.\n    Describes the intended objective(s) for a patient, group or organization\n    care, for example, weight loss, restoring an activity of daily living,\n    obtaining herd immunity via immunization, meeting a process improvement\n    objective, etc.\n    \"\"\"\n\n    __resource_type__ = \"Goal\"\n\n    achievementStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"achievementStatus\",\n        title=(\n            \"in-progress | improving | worsening | no-change | achieved | \"\n            \"sustaining | not-achieved | no-progress | not-attainable\"\n        ),\n        description=(\n            \"Describes the progression, or lack thereof, towards the goal against \"\n            \"the target.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    addresses: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"addresses\",\n        title=\"Issues addressed by this goal\",\n        description=(\n            \"The identified conditions and other health record elements that are \"\n            \"intended to be addressed by the goal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"MedicationStatement\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ServiceRequest\",\n                \"RiskAssessment\",\n                \"Procedure\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"E.g. Treatment, dietary, behavioral, etc\",\n        description=\"Indicates a category the goal falls within.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    continuous: bool | None = Field(\n        default=None,\n        alias=\"continuous\",\n        title=(\n            \"After meeting the goal, ongoing activity is needed to sustain the goal\"\n            \" objective\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    continuous__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_continuous\", title=\"Extension field for ``continuous``.\"\n    )\n\n    description: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"description\",\n        title=\"Code or text describing goal\",\n        description=(\n            \"Human-readable and/or coded description of a specific desired \"\n            'objective of care, such as \"control blood pressure\" or \"negotiate an '\n            'obstacle course\" or \"dance with child at wedding\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this goal\",\n        description=(\n            \"Business identifiers assigned to this goal by the performer or other \"\n            \"systems which remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lifecycleStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"lifecycleStatus\",\n        title=(\n            \"proposed | planned | accepted | active | on-hold | completed | \"\n            \"cancelled | entered-in-error | rejected\"\n        ),\n        description=\"The state of the goal throughout its lifecycle.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposed\",\n                \"planned\",\n                \"accepted\",\n                \"active\",\n                \"on-hold\",\n                \"completed\",\n                \"cancelled\",\n                \"entered-in-error\",\n                \"rejected\",\n            ],\n        },\n    )\n    lifecycleStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lifecycleStatus\",\n        title=\"Extension field for ``lifecycleStatus``.\",\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the goal\",\n        description=\"Any comments related to the goal.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcome: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"What result was achieved regarding the goal?\",\n        description=(\n            \"Identifies the change (or lack of change) at the point when the status\"\n            \" of the goal is assessed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"high-priority | medium-priority | low-priority\",\n        description=(\n            \"Identifies the mutually agreed level of importance associated with \"\n            \"reaching/sustaining the goal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Who's responsible for creating Goal?\",\n        description=\"Indicates whose goal this is - patient goal, practitioner goal, etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    startCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"startCodeableConcept\",\n        title=\"When goal pursuit begins\",\n        description=\"The date or event after which the goal should begin being pursued.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e start[x]\n            \"one_of_many\": \"start\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    startDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"startDate\",\n        title=\"When goal pursuit begins\",\n        description=\"The date or event after which the goal should begin being pursued.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e start[x]\n            \"one_of_many\": \"start\",\n            \"one_of_many_required\": False,\n        },\n    )\n    startDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_startDate\", title=\"Extension field for ``startDate``.\"\n    )\n\n    statusDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"When goal status took effect\",\n        description=(\n            \"Identifies when the current status.  I.e. When initially created, when\"\n            \" achieved, when cancelled, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    statusReason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current status.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    statusReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_statusReason\",\n        title=\"Extension field for ``statusReason``.\",\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who this goal is intended for\",\n        description=(\n            \"Identifies the patient, group or organization for whom the goal is \"\n            \"being established.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Organization\"],\n        },\n    )\n\n    target: typing.List[fhirtypes.GoalTargetType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Target outcome for the goal\",\n        description=\"Indicates what should be done by when.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Goal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"lifecycleStatus\",\n            \"achievementStatus\",\n            \"category\",\n            \"continuous\",\n            \"priority\",\n            \"description\",\n            \"subject\",\n            \"startDate\",\n            \"startCodeableConcept\",\n            \"target\",\n            \"statusDate\",\n            \"statusReason\",\n            \"source\",\n            \"addresses\",\n            \"note\",\n            \"outcome\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Goal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"lifecycleStatus\",\n            \"achievementStatus\",\n            \"category\",\n            \"priority\",\n            \"description\",\n            \"subject\",\n            \"startDate\",\n            \"startCodeableConcept\",\n            \"statusDate\",\n            \"source\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"lifecycleStatus\", \"lifecycleStatus__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"start\": [\"startCodeableConcept\", \"startDate\"]}\n        return one_of_many_fields\n\n\nclass GoalTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Target outcome for the goal.\n    Indicates what should be done by when.\n    \"\"\"\n\n    __resource_type__ = \"GoalTarget\"\n\n    detailBoolean: bool | None = Field(\n        default=None,\n        alias=\"detailBoolean\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n    detailBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailBoolean\",\n        title=\"Extension field for ``detailBoolean``.\",\n    )\n\n    detailCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"detailCodeableConcept\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"detailInteger\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n    detailInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailInteger\",\n        title=\"Extension field for ``detailInteger``.\",\n    )\n\n    detailQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"detailQuantity\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"detailRange\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"detailRatio\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"detailString\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the focus to be achieved to signify the \"\n            \"fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low\"\n            \" or both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any focus value at \"\n            \"or below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any focus value at or above the\"\n            \" low value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n    detailString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailString\",\n        title=\"Extension field for ``detailString``.\",\n    )\n\n    dueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"dueDate\",\n        title=\"Reach goal on or before\",\n        description=(\n            \"Indicates either the date or the duration after start by which the \"\n            \"goal should be met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e due[x]\n            \"one_of_many\": \"due\",\n            \"one_of_many_required\": False,\n        },\n    )\n    dueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dueDate\", title=\"Extension field for ``dueDate``.\"\n    )\n\n    dueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"dueDuration\",\n        title=\"Reach goal on or before\",\n        description=(\n            \"Indicates either the date or the duration after start by which the \"\n            \"goal should be met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e due[x]\n            \"one_of_many\": \"due\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    measure: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"measure\",\n        title=\"The parameter whose value is being tracked\",\n        description=(\n            \"The parameter whose value is being tracked, e.g. body weight, blood \"\n            \"pressure, or hemoglobin A1c level.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GoalTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"measure\",\n            \"detailQuantity\",\n            \"detailRange\",\n            \"detailCodeableConcept\",\n            \"detailString\",\n            \"detailBoolean\",\n            \"detailInteger\",\n            \"detailRatio\",\n            \"dueDate\",\n            \"dueDuration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GoalTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"measure\",\n            \"detailQuantity\",\n            \"detailRange\",\n            \"detailCodeableConcept\",\n            \"detailString\",\n            \"detailBoolean\",\n            \"detailInteger\",\n            \"detailRatio\",\n            \"dueDate\",\n            \"dueDuration\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"detail\": [\n                \"detailBoolean\",\n                \"detailCodeableConcept\",\n                \"detailInteger\",\n                \"detailQuantity\",\n                \"detailRange\",\n                \"detailRatio\",\n                \"detailString\",\n            ],\n            \"due\": [\"dueDate\", \"dueDuration\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/graphdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/GraphDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass GraphDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a graph of resources.\n    A formal computable definition of a graph of resources - that is, a\n    coherent set of resources that form a graph by following references. The\n    Graph Definition resource defines a set and makes rules about the set.\n    \"\"\"\n\n    __resource_type__ = \"GraphDefinition\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the graph definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the graph definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the graph definition was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the graph definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the graph definition\",\n        description=(\n            \"A free text natural language description of the graph definition from \"\n            \"a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this graph definition is authored for\"\n            \" testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the GraphDefinition (business identifier)\",\n        description=(\n            \"A formal identifier that is used to identify this GraphDefinition when\"\n            \" it is represented in other formats, or referenced in a specification,\"\n            \" model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for graph definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the graph definition is intended\"\n            \" to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.GraphDefinitionLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links this graph makes rules about\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this graph definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the graph definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    node: typing.List[fhirtypes.GraphDefinitionNodeType] | None = Field(\n        default=None,\n        alias=\"node\",\n        title=\"Potential target for the link\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the graph definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this graph definition is defined\",\n        description=(\n            \"Explanation of why this graph definition is needed and why it has been\"\n            \" designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    start: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Starting Node\",\n        description=(\n            \"The Node at which instances of this graph start. If there is no \"\n            \"nominated start, the graph can start at any of the nodes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this graph definition. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this graph definition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the capability \" \"statement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this graph definition, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this graph definition when it\"\n            \" is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" graph definition is (or will be) published. This URL can be the \"\n            \"target of a canonical reference. It SHALL remain the same when the \"\n            \"graph definition is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate graph definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the graph definition\",\n        description=(\n            \"The identifier that is used to identify this version of the graph \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the graph definition \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GraphDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"start\",\n            \"node\",\n            \"link\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GraphDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass GraphDefinitionLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links this graph makes rules about.\n    \"\"\"\n\n    __resource_type__ = \"GraphDefinitionLink\"\n\n    compartment: typing.List[\n        fhirtypes.GraphDefinitionLinkCompartmentType\n    ] | None = Field(\n        default=None,\n        alias=\"compartment\",\n        title=\"Compartment Consistency Rules\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Why this link is specified\",\n        description=(\n            \"Information about why this link is of interest in this graph \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum occurrences for this link\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum occurrences for this link\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    params: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"params\",\n        title=\"Criteria for reverse lookup\",\n        description=\"A set of parameters to look up.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    params__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_params\", title=\"Extension field for ``params``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"Path in the resource that contains the link\",\n        description=(\n            \"A FHIRPath expression that identifies one of FHIR References to other \"\n            \"resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    sliceName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sliceName\",\n        title=\"Which slice (if profiled)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sliceName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sliceName\", title=\"Extension field for ``sliceName``.\"\n    )\n\n    sourceId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"sourceId\",\n        title=\"Source Node for this link\",\n        description=\"The source node for this link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceId\", title=\"Extension field for ``sourceId``.\"\n    )\n\n    targetId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"targetId\",\n        title=\"Target Node for this link\",\n        description=\"The target node for this link.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    targetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_targetId\", title=\"Extension field for ``targetId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GraphDefinitionLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"min\",\n            \"max\",\n            \"sourceId\",\n            \"path\",\n            \"sliceName\",\n            \"targetId\",\n            \"params\",\n            \"compartment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GraphDefinitionLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"sourceId\", \"sourceId__ext\"), (\"targetId\", \"targetId__ext\")]\n        return required_fields\n\n\nclass GraphDefinitionLinkCompartment(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Compartment Consistency Rules.\n    \"\"\"\n\n    __resource_type__ = \"GraphDefinitionLinkCompartment\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"Patient | Encounter | RelatedPerson | Practitioner | Device | \"\n            \"EpisodeOfCare\"\n        ),\n        description=\"Identifies the compartment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"Patient\",\n                \"Encounter\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"Device\",\n                \"EpisodeOfCare\",\n            ],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Documentation for FHIRPath expression\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Custom rule, as a FHIRPath expression\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    rule: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"identical | matching | different | custom\",\n        description=\"identical | matching | different | no-rule | custom.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"identical\", \"matching\", \"different\", \"custom\"],\n        },\n    )\n    rule__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rule\", title=\"Extension field for ``rule``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"where | requires\",\n        description=(\n            \"Defines how the compartment rule is used - whether it it is used to \"\n            \"test whether resources are subject to the rule, or whether it is a \"\n            \"rule that must be followed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"where\", \"requires\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GraphDefinitionLinkCompartment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"use\",\n            \"rule\",\n            \"code\",\n            \"expression\",\n            \"description\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GraphDefinitionLinkCompartment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"code\", \"code__ext\"),\n            (\"rule\", \"rule__ext\"),\n            (\"use\", \"use__ext\"),\n        ]\n        return required_fields\n\n\nclass GraphDefinitionNode(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Potential target for the link.\n    \"\"\"\n\n    __resource_type__ = \"GraphDefinitionNode\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Why this node is specified\",\n        description=(\n            \"Information about why this node is of interest in this graph \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    nodeId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"nodeId\",\n        title=\"Internal ID - target for link references\",\n        description=\"Internal ID of node - target for link references.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    nodeId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_nodeId\", title=\"Extension field for ``nodeId``.\"\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile for the target resource\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of resource this link refers to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GraphDefinitionNode`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"nodeId\",\n            \"description\",\n            \"type\",\n            \"profile\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GraphDefinitionNode`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"nodeId\", \"nodeId__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/group.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Group\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Group(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Group of multiple entities.\n    Represents a defined collection of entities that may be discussed or acted\n    upon collectively but which are not expected to act collectively, and are\n    not formally or legally recognized; i.e. a collection of entities that\n    isn't an Organization.\n    \"\"\"\n\n    __resource_type__ = \"Group\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this group's record is in active use\",\n        description=(\n            \"Indicates whether the record for the group is available for use or is \"\n            \"merely being retained for historical purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    characteristic: typing.List[fhirtypes.GroupCharacteristicType] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"Include / Exclude group members by Trait\",\n        description=(\n            \"Identifies traits whose presence r absence is shared by members of the\"\n            \" group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Kind of Group members\",\n        description=(\n            'Provides a specific type of resource the group includes; e.g. \"cow\", '\n            '\"syringe\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the group\",\n        description=(\n            \"Explanation of what the group represents and how it is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for this Group\",\n        description=(\n            \"Business identifiers assigned to this participant by one of the \"\n            \"applications involved.  These identifiers remain constant as the \"\n            \"resource is updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingEntity: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingEntity\",\n        title=\"Entity that is the custodian of the Group's definition\",\n        description=(\n            \"Entity responsible for defining and maintaining Group characteristics \"\n            \"and/or registered members.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    member: typing.List[fhirtypes.GroupMemberType] | None = Field(\n        default=None,\n        alias=\"member\",\n        title=\"Who or what is in group\",\n        description=\"Identifies the resource instances that are members of the group.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    membership: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"membership\",\n        title=\"definitional | enumerated\",\n        description=(\n            \"Basis for membership in the Group:  * 'definitional': The \"\n            \"Group.characteristics specified are both necessary and sufficient to \"\n            \"determine membership. All entities that meet the criteria are \"\n            \"considered to be members of the group, whether referenced by the group\"\n            \" or not. If members are present, they are individuals that happen to \"\n            \"be known as meeting the Group.characteristics. The list cannot be \"\n            \"presumed to be complete. * 'enumerated': The Group.characteristics are\"\n            \" necessary but not sufficient to determine membership. Membership is \"\n            \"determined by being listed as one of the Group.member.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"definitional\", \"enumerated\"],\n        },\n    )\n    membership__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_membership\", title=\"Extension field for ``membership``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Label for Group\",\n        description=(\n            \"A label assigned to the group for human identification and \"\n            \"communication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    quantity: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Number of members\",\n        description=(\n            \"A count of the number of resource instances that are part of the \" \"group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_quantity\", title=\"Extension field for ``quantity``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"person | animal | practitioner | device | careteam | healthcareservice\"\n            \" | location | organization | relatedperson | specimen\"\n        ),\n        description=(\n            \"Identifies the broad classification of the kind of resources the group\"\n            \" includes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"person\",\n                \"animal\",\n                \"practitioner\",\n                \"device\",\n                \"careteam\",\n                \"healthcareservice\",\n                \"location\",\n                \"organization\",\n                \"relatedperson\",\n                \"specimen\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Group`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"type\",\n            \"membership\",\n            \"code\",\n            \"name\",\n            \"description\",\n            \"quantity\",\n            \"managingEntity\",\n            \"characteristic\",\n            \"member\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Group`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"type\",\n            \"membership\",\n            \"code\",\n            \"name\",\n            \"quantity\",\n            \"managingEntity\",\n            \"characteristic\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"membership\", \"membership__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass GroupCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Include / Exclude group members by Trait.\n    Identifies traits whose presence r absence is shared by members of the\n    group.\n    \"\"\"\n\n    __resource_type__ = \"GroupCharacteristic\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Kind of characteristic\",\n        description=\"A code that identifies the kind of trait being asserted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    exclude: bool | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=\"Group includes or excludes\",\n        description=(\n            \"If true, indicates the characteristic is one that is NOT held by \"\n            \"members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    exclude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_exclude\", title=\"Extension field for ``exclude``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period over which characteristic is tested\",\n        description=(\n            \"The period over which the characteristic is tested; e.g. the patient \"\n            \"had an operation during the month of June.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Value held by characteristic\",\n        description=(\n            \"The value of the trait that holds (or does not hold - see 'exclude') \"\n            \"for members of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GroupCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueBoolean\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueReference\",\n            \"exclude\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GroupCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueBoolean\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueReference\",\n            \"exclude\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"exclude\", \"exclude__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueReference\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass GroupMember(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who or what is in group.\n    Identifies the resource instances that are members of the group.\n    \"\"\"\n\n    __resource_type__ = \"GroupMember\"\n\n    entity: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"entity\",\n        title=\"Reference to the group member\",\n        description=(\n            \"A reference to the entity that is a member of the group. Must be \"\n            \"consistent with Group.type. If the entity is another group, then the \"\n            \"type must be the same.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"Device\",\n                \"Group\",\n                \"HealthcareService\",\n                \"Location\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Specimen\",\n            ],\n        },\n    )\n\n    inactive: bool | None = Field(\n        default=None,\n        alias=\"inactive\",\n        title=\"If member is no longer in group\",\n        description=(\n            \"A flag to indicate that the member is no longer in the group, but \"\n            \"previously may have been a member.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_inactive\", title=\"Extension field for ``inactive``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period member belonged to the group\",\n        description=\"The period that the member was in the group, if known.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GroupMember`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"entity\", \"period\", \"inactive\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GroupMember`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/guidanceresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/GuidanceResponse\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass GuidanceResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The formal response to a guidance request.\n    A guidance response is the formal response to a guidance request, including\n    any output parameters returned by the evaluation, as well as the\n    description of any proposed actions to be taken.\n    \"\"\"\n\n    __resource_type__ = \"GuidanceResponse\"\n\n    dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"dataRequirement\",\n        title=\"Additional required data\",\n        description=(\n            \"If the evaluation could not be completed due to lack of information, \"\n            \"or additional information would potentially result in a more accurate \"\n            \"response, this element will a description of the data required in \"\n            \"order to proceed with the evaluation. A subsequent request to the \"\n            \"service should include this data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter during which the response was returned\",\n        description=(\n            \"The encounter during which this response was created or to which the \"\n            \"creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    evaluationMessage: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"evaluationMessage\",\n        title=\"Messages resulting from the evaluation of the artifact or artifacts\",\n        description=(\n            \"Messages resulting from the evaluation of the artifact or artifacts. \"\n            \"As part of evaluating the request, the engine may produce \"\n            \"informational or warning messages. These messages will be provided by \"\n            \"this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationOutcome\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Allows a service to provide  unique, business identifiers for the \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    moduleCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"moduleCanonical\",\n        title=\"What guidance was requested\",\n        description=(\n            \"An identifier, CodeableConcept or canonical reference to the guidance \"\n            \"that was requested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e module[x]\n            \"one_of_many\": \"module\",\n            \"one_of_many_required\": True,\n        },\n    )\n    moduleCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_moduleCanonical\",\n        title=\"Extension field for ``moduleCanonical``.\",\n    )\n\n    moduleCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"moduleCodeableConcept\",\n        title=\"What guidance was requested\",\n        description=(\n            \"An identifier, CodeableConcept or canonical reference to the guidance \"\n            \"that was requested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e module[x]\n            \"one_of_many\": \"module\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    moduleUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"moduleUri\",\n        title=\"What guidance was requested\",\n        description=(\n            \"An identifier, CodeableConcept or canonical reference to the guidance \"\n            \"that was requested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e module[x]\n            \"one_of_many\": \"module\",\n            \"one_of_many_required\": True,\n        },\n    )\n    moduleUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_moduleUri\", title=\"Extension field for ``moduleUri``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional notes about the response\",\n        description=(\n            \"Provides a mechanism to communicate additional information about the \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When the guidance response was processed\",\n        description=\"Indicates when the guidance response was processed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    outputParameters: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"outputParameters\",\n        title=\"The output parameters of the evaluation, if any\",\n        description=(\n            \"The output parameters of the evaluation, if any. Many modules will \"\n            \"result in the return of specific resources such as procedure or \"\n            \"communication requests that are returned as part of the operation \"\n            \"result. However, modules may define specific outputs that would be \"\n            \"returned as the result of the evaluation, and these would be returned \"\n            \"in this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Parameters\"],\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Device returning the guidance\",\n        description=\"Provides a reference to the device that performed the guidance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why guidance is needed\",\n        description=(\n            \"Describes the reason for the guidance response in coded or textual \"\n            \"form, or Indicates the reason the request was initiated. This is \"\n            \"typically provided as a parameter to the evaluation and echoed by the \"\n            \"service, although for some use cases, such as subscription- or event-\"\n            \"based scenarios, it may provide an indication of the cause for the \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requestIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"requestIdentifier\",\n        title=\"The identifier of the request associated with this response, if any\",\n        description=(\n            \"The identifier of the request associated with this response. If an \"\n            \"identifier was given as part of the request, it will be reproduced \"\n            \"here to enable the requester to more easily identify the response in a\"\n            \" multi-request scenario.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    result: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"Proposed actions, if any\",\n        description=\"The actions, if any, produced by the evaluation of the artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Appointment\",\n                \"AppointmentResponse\",\n                \"CarePlan\",\n                \"Claim\",\n                \"CommunicationRequest\",\n                \"Contract\",\n                \"CoverageEligibilityRequest\",\n                \"DeviceRequest\",\n                \"EnrollmentRequest\",\n                \"ImmunizationRecommendation\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"RequestOrchestration\",\n                \"ServiceRequest\",\n                \"SupplyRequest\",\n                \"Task\",\n                \"VisionPrescription\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"success | data-requested | data-required | in-progress | failure | \"\n            \"entered-in-error\"\n        ),\n        description=(\n            \"The status of the response. If the evaluation is completed \"\n            \"successfully, the status will indicate success. However, in order to \"\n            \"complete the evaluation, the engine may require more information. In \"\n            \"this case, the status will be data-required, and the response will \"\n            \"contain a description of the additional required information. If the \"\n            \"evaluation completed successfully, but the engine determines that a \"\n            \"potentially more accurate response could be provided if more data was \"\n            \"available, the status will be data-requested, and the response will \"\n            \"contain a description of the additional requested information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"success\",\n                \"data-requested\",\n                \"data-required\",\n                \"in-progress\",\n                \"failure\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Patient the request was performed for\",\n        description=\"The patient for which the request was processed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``GuidanceResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"requestIdentifier\",\n            \"identifier\",\n            \"moduleUri\",\n            \"moduleCanonical\",\n            \"moduleCodeableConcept\",\n            \"status\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"performer\",\n            \"reason\",\n            \"note\",\n            \"evaluationMessage\",\n            \"outputParameters\",\n            \"result\",\n            \"dataRequirement\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``GuidanceResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"requestIdentifier\",\n            \"identifier\",\n            \"moduleUri\",\n            \"moduleCanonical\",\n            \"moduleCodeableConcept\",\n            \"status\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"module\": [\"moduleCanonical\", \"moduleCodeableConcept\", \"moduleUri\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/healthcareservice.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/HealthcareService\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass HealthcareService(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The details of a healthcare service available at a location.\n    \"\"\"\n\n    __resource_type__ = \"HealthcareService\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this HealthcareService record is in active use\",\n        description=(\n            \"This flag is used to mark the record to not be used. This is not used \"\n            \"when a center is closed for maintenance, or for holidays, the \"\n            \"notAvailable period is to be used for this.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    appointmentRequired: bool | None = Field(\n        default=None,\n        alias=\"appointmentRequired\",\n        title=\"If an appointment is required for access to this service\",\n        description=(\n            \"Indicates whether or not a prospective consumer will require an \"\n            \"appointment for a particular service at a site to be provided by the \"\n            \"Organization. Indicates if an appointment is required for access to \"\n            \"this service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    appointmentRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_appointmentRequired\",\n        title=\"Extension field for ``appointmentRequired``.\",\n    )\n\n    availability: typing.List[fhirtypes.AvailabilityType] | None = Field(\n        default=None,\n        alias=\"availability\",\n        title=\"Times the healthcare service is available (including exceptions)\",\n        description=\"A collection of times that the healthcare service is available.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Broad category of service being performed or delivered\",\n        description=\"Identifies the broad category of service being performed or delivered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    characteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"Collection of characteristics (attributes)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=(\n            \"Additional description and/or any specific issues not covered \" \"elsewhere\"\n        ),\n        description=(\n            \"Any additional description of the service and/or any specific issues \"\n            \"not covered by the other attributes, which can be displayed as further\"\n            \" detail under the serviceName.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    communication: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"communication\",\n        title=\"The language that this service is offered in\",\n        description=(\n            \"Some services are specifically made available in multiple languages, \"\n            \"this property permits a directory to declare the languages this is \"\n            \"offered in. Typically this is only provided where a service operates \"\n            \"in communities with mixed languages used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ExtendedContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Official contact details for the HealthcareService\",\n        description=(\n            \"The contact details of communication devices available relevant to the\"\n            \" specific HealthcareService. This can include addresses, phone \"\n            \"numbers, fax numbers, mobile numbers, email addresses and web sites.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"coverageArea\",\n        title=\"Location(s) service is intended for/available to\",\n        description=(\n            \"The location(s) that this service is available to (not where the \"\n            \"service is provided).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    eligibility: typing.List[fhirtypes.HealthcareServiceEligibilityType] | None = Field(\n        default=None,\n        alias=\"eligibility\",\n        title=\"Specific eligibility requirements required to use the service\",\n        description=(\n            \"Does this service have specific eligibility requirements that need to \"\n            \"be met in order to use the service?\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to electronic services operated \"\n            \"for the healthcare service\"\n        ),\n        description=(\n            \"Technical endpoints providing access to services operated for the \"\n            \"specific healthcare services defined at this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    extraDetails: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"extraDetails\",\n        title=(\n            \"Extra details about the service that can't be placed in the other \"\n            \"fields\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    extraDetails__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_extraDetails\",\n        title=\"Extension field for ``extraDetails``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifiers for this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Location(s) where service may be provided\",\n        description=\"The location(s) where this healthcare service may be provided.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Description of service as presented to a consumer while searching\",\n        description=(\n            \"Further description of the service as it would be presented to a \"\n            \"consumer while searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    offeredIn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"offeredIn\",\n        title=\"The service within which this service is offered\",\n        description=(\n            \"When the HealthcareService is representing a specific, schedulable \"\n            \"service, the availableIn property can refer to a generic service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"HealthcareService\"],\n        },\n    )\n\n    photo: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Facilitates quick identification of the service\",\n        description=(\n            \"If there is a photo/symbol associated with this HealthcareService, it \"\n            \"may be included here to facilitate quick identification of the service\"\n            \" in a list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    program: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"program\",\n        title=\"Programs that this service is applicable to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    providedBy: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"providedBy\",\n        title=\"Organization that provides this service\",\n        description=\"The organization that provides this healthcare service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    referralMethod: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"referralMethod\",\n        title=\"Ways that the service accepts referrals\",\n        description=(\n            \"Ways that the service accepts referrals, if this is not provided then \"\n            \"it is implied that no referral is required.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    serviceProvisionCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceProvisionCode\",\n        title=\"Conditions under which service is available/offered\",\n        description=(\n            \"The code(s) that detail the conditions under which the healthcare \"\n            \"service is available/offered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=\"Specialties handled by the HealthcareService\",\n        description=(\n            \"Collection of specialties handled by the Healthcare service. This is \"\n            \"more of a medical term.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of service that may be delivered or performed\",\n        description=\"The specific type of service that may be delivered or performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``HealthcareService`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"providedBy\",\n            \"offeredIn\",\n            \"category\",\n            \"type\",\n            \"specialty\",\n            \"location\",\n            \"name\",\n            \"comment\",\n            \"extraDetails\",\n            \"photo\",\n            \"contact\",\n            \"coverageArea\",\n            \"serviceProvisionCode\",\n            \"eligibility\",\n            \"program\",\n            \"characteristic\",\n            \"communication\",\n            \"referralMethod\",\n            \"appointmentRequired\",\n            \"availability\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``HealthcareService`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"providedBy\",\n            \"category\",\n            \"type\",\n            \"specialty\",\n            \"location\",\n            \"name\",\n            \"comment\",\n            \"photo\",\n        ]\n\n\nclass HealthcareServiceEligibility(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specific eligibility requirements required to use the service.\n    Does this service have specific eligibility requirements that need to be\n    met in order to use the service?\n    \"\"\"\n\n    __resource_type__ = \"HealthcareServiceEligibility\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Coded value for the eligibility\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Describes the eligibility conditions for the service\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``HealthcareServiceEligibility`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"comment\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``HealthcareServiceEligibility`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/humanname.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/HumanName\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass HumanName(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Name of a human or other living entity - parts and usage.\n    A name, normally of a human, that can be used for other living entities\n    (e.g. animals but not organizations) that have been assigned names by a\n    human and may need the use of name parts or the need for usage information.\n    \"\"\"\n\n    __resource_type__ = \"HumanName\"\n\n    family: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"family\",\n        title=\"Family name (often called 'Surname')\",\n        description=(\n            \"The part of a name that links to the genealogy. In some cultures (e.g.\"\n            \" Eritrea) the family name of a son is the first name of his father.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    family__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_family\", title=\"Extension field for ``family``.\"\n    )\n\n    given: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"given\",\n        title=\"Given names (not always 'first'). Includes middle names\",\n        description=\"Given name.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    given__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_given\", title=\"Extension field for ``given``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when name was/is in use\",\n        description=(\n            \"Indicates the period of time when this name was valid for the named \"\n            \"person.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    prefix: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"prefix\",\n        title=\"Parts that come before the name\",\n        description=(\n            \"Part of the name that is acquired as a title due to academic, legal, \"\n            \"employment or nobility status, etc. and that appears at the start of \"\n            \"the name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    prefix__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_prefix\", title=\"Extension field for ``prefix``.\"\n    )\n\n    suffix: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"suffix\",\n        title=\"Parts that come after the name\",\n        description=(\n            \"Part of the name that is acquired as a title due to academic, legal, \"\n            \"employment or nobility status, etc. and that appears at the end of the\"\n            \" name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    suffix__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_suffix\", title=\"Extension field for ``suffix``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text representation of the full name\",\n        description=(\n            \"Specifies the entire name as it should be displayed e.g. on an \"\n            \"application UI. This may be provided instead of or as well as the \"\n            \"specific parts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"usual | official | temp | nickname | anonymous | old | maiden\",\n        description=\"Identifies the purpose for this name.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"usual\",\n                \"official\",\n                \"temp\",\n                \"nickname\",\n                \"anonymous\",\n                \"old\",\n                \"maiden\",\n            ],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``HumanName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"use\",\n            \"text\",\n            \"family\",\n            \"given\",\n            \"prefix\",\n            \"suffix\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``HumanName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"use\", \"text\", \"family\", \"given\", \"prefix\", \"suffix\", \"period\"]\n"
  },
  {
    "path": "fhir/resources/identifier.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Identifier\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Identifier(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An identifier intended for computation.\n    An identifier - identifies some entity uniquely and unambiguously.\n    Typically this is used for business identifiers.\n    \"\"\"\n\n    __resource_type__ = \"Identifier\"\n\n    assigner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"assigner\",\n        title=\"Organization that issued id (may be just text)\",\n        description=\"Organization that issued/manages the identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Time period when id is/was valid for use\",\n        description=\"Time period during which identifier is/was valid for use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"The namespace for the identifier value\",\n        description=(\n            \"Establishes the namespace for the value - that is, an absolute URL \"\n            \"that describes a set values that are unique.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Description of identifier\",\n        description=(\n            \"A coded type for the identifier that can be used to determine which \"\n            \"identifier to use for a specific purpose.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"usual | official | temp | secondary | old (If known)\",\n        description=\"The purpose of this identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"usual\", \"official\", \"temp\", \"secondary\", \"old\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The value that is unique\",\n        description=(\n            \"The portion of the identifier typically relevant to the user and which\"\n            \" is unique within the context of the system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Identifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"use\",\n            \"type\",\n            \"system\",\n            \"value\",\n            \"period\",\n            \"assigner\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Identifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"use\", \"type\", \"system\", \"value\", \"period\", \"assigner\"]\n"
  },
  {
    "path": "fhir/resources/imagingselection.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImagingSelection\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ImagingSelection(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A selection of DICOM SOP instances and/or frames.\n    A selection of DICOM SOP instances and/or frames within a single Study and\n    Series. This might include additional specifics such as an image region, an\n    Observation UID or a Segmentation Number, allowing linkage to an\n    Observation Resource or transferring this information along with the\n    ImagingStudy Resource.\n    \"\"\"\n\n    __resource_type__ = \"ImagingSelection\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Associated request\",\n        description=(\n            \"A list of the diagnostic requests that resulted in this imaging \"\n            \"selection being performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"ServiceRequest\",\n                \"Appointment\",\n                \"AppointmentResponse\",\n                \"Task\",\n            ],\n        },\n    )\n\n    bodySite: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Body part examined\",\n        description=(\n            \"The anatomic structures examined. See DICOM Part 16 Annex L (http://di\"\n            \"com.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html)\"\n            \" for DICOM to SNOMED-CT mappings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BodyStructure\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classifies the imaging selection\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Imaging Selection purpose text or code\",\n        description=\"Reason for referencing the selected content.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"The imaging study from which the imaging selection is derived\",\n        description=\"The imaging study from which the imaging selection is made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ImagingStudy\", \"DocumentReference\"],\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"The network service providing retrieval for the images referenced in \"\n            \"the imaging selection\"\n        ),\n        description=(\n            \"The network service providing retrieval access to the selected images,\"\n            \" frames, etc. See implementation notes for information about using \"\n            \"DICOM endpoints.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    focus: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"Related resource that is the focus for the imaging selection\",\n        description=(\n            \"The actual focus of an observation when it is not the patient of \"\n            \"record representing something or someone associated with the patient \"\n            \"such as a spouse, parent, fetus, or donor. For example, fetus \"\n            \"observations in a mother's record.  The focus of an observation could \"\n            \"also be an existing condition,  an intervention, the subject's diet,  \"\n            \"another observation of the subject,  or a body structure such as tumor\"\n            \" or implanted device.   An example use case would be using the \"\n            \"Observation resource to capture whether the mother is trained to \"\n            \"change her child's tracheostomy tube. In this example, the child is \"\n            \"the patient of record and the mother is the focus.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ImagingSelection\"],\n        },\n    )\n\n    frameOfReferenceUid: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"frameOfReferenceUid\",\n        title=\"The Frame of Reference UID for the selected images\",\n        description=(\n            \"The Frame of Reference UID identifying the coordinate system that \"\n            \"conveys spatial and/or temporal information for the selected images or\"\n            \" frames.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    frameOfReferenceUid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_frameOfReferenceUid\",\n        title=\"Extension field for ``frameOfReferenceUid``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for Imaging Selection\",\n        description=\"A unique identifier assigned to this imaging selection.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instance: typing.List[fhirtypes.ImagingSelectionInstanceType] | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"The selected instances\",\n        description=(\n            \"Each imaging selection includes one or more selected DICOM SOP \"\n            \"instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"Date / Time when this imaging selection was created\",\n        description=\"The date and time this imaging selection was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    performer: typing.List[fhirtypes.ImagingSelectionPerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Selector of the instances (human or machine)\",\n        description=\"Selector of the instances \\u2013 human or machine.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    seriesNumber: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"seriesNumber\",\n        title=\"DICOM Series Number\",\n        description=(\n            \"The Series Number for the DICOM Series from which the images were \"\n            \"selected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    seriesNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_seriesNumber\",\n        title=\"Extension field for ``seriesNumber``.\",\n    )\n\n    seriesUid: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"seriesUid\",\n        title=\"DICOM Series Instance UID\",\n        description=(\n            \"The Series Instance UID for the DICOM Series from which the images \"\n            \"were selected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    seriesUid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_seriesUid\", title=\"Extension field for ``seriesUid``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"available | entered-in-error | unknown\",\n        description=(\n            \"The current state of the ImagingSelection resource. This is not the \"\n            \"status of any ImagingStudy, ServiceRequest, or Task resources \"\n            \"associated with the ImagingSelection.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"available\", \"entered-in-error\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    studyUid: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"studyUid\",\n        title=\"DICOM Study Instance UID\",\n        description=(\n            \"The Study Instance UID for the DICOM Study from which the images were \"\n            \"selected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    studyUid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_studyUid\", title=\"Extension field for ``studyUid``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Subject of the selected instances\",\n        description=(\n            \"The patient, or group of patients, location, device, organization, \"\n            \"procedure or practitioner this imaging selection is about and into \"\n            \"whose or what record the imaging selection is placed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Device\",\n                \"Location\",\n                \"Organization\",\n                \"Procedure\",\n                \"Practitioner\",\n                \"Medication\",\n                \"Substance\",\n                \"Specimen\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingSelection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"subject\",\n            \"issued\",\n            \"performer\",\n            \"basedOn\",\n            \"category\",\n            \"code\",\n            \"studyUid\",\n            \"derivedFrom\",\n            \"endpoint\",\n            \"seriesUid\",\n            \"seriesNumber\",\n            \"frameOfReferenceUid\",\n            \"bodySite\",\n            \"focus\",\n            \"instance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingSelection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"subject\",\n            \"issued\",\n            \"performer\",\n            \"basedOn\",\n            \"category\",\n            \"code\",\n            \"studyUid\",\n            \"derivedFrom\",\n            \"endpoint\",\n            \"seriesUid\",\n            \"seriesNumber\",\n            \"frameOfReferenceUid\",\n            \"bodySite\",\n            \"focus\",\n            \"instance\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ImagingSelectionInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The selected instances.\n    Each imaging selection includes one or more selected DICOM SOP instances.\n    \"\"\"\n\n    __resource_type__ = \"ImagingSelectionInstance\"\n\n    imageRegion2D: typing.List[\n        fhirtypes.ImagingSelectionInstanceImageRegion2DType\n    ] | None = Field(\n        default=None,\n        alias=\"imageRegion2D\",\n        title=\"A specific 2D region in a DICOM image / frame\",\n        description=(\n            \"Each imaging selection instance or frame list might includes an image \"\n            \"region, specified by a region type and a set of 2D coordinates.\"\n            \"        If the parent imagingSelection.instance contains a subset \"\n            \"element of type frame, the image region applies to all frames in the \"\n            \"subset list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    imageRegion3D: typing.List[\n        fhirtypes.ImagingSelectionInstanceImageRegion3DType\n    ] | None = Field(\n        default=None,\n        alias=\"imageRegion3D\",\n        title=\"A specific 3D region in a DICOM frame of reference\",\n        description=(\n            \"Each imaging selection might includes a 3D image region, specified by \"\n            \"a region type and a set of 3D coordinates.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    number: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"DICOM Instance Number\",\n        description=\"The Instance Number for the selected DICOM instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    sopClass: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"sopClass\",\n        title=\"DICOM SOP Class UID\",\n        description=\"The SOP Class UID for the selected DICOM instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subset: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"subset\",\n        title=\"The selected subset of the SOP Instance\",\n        description=(\n            \"Selected subset of the SOP Instance. The content and format of the \"\n            \"subset item is determined by the SOP Class of the selected instance.\"\n            \"        May be one of:        - A list of frame numbers selected from \"\n            \"a multiframe SOP Instance.        - A list of Content Item Observation\"\n            \" UID values selected from a DICOM SR or other structured document SOP \"\n            \"Instance.        - A list of segment numbers selected from a \"\n            \"segmentation SOP Instance.        - A list of Region of Interest (ROI)\"\n            \" numbers selected from a radiotherapy structure set SOP Instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subset__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_subset\", title=\"Extension field for ``subset``.\"\n    )\n\n    uid: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"uid\",\n        title=\"DICOM SOP Instance UID\",\n        description=\"The SOP Instance UID for the selected DICOM instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uid\", title=\"Extension field for ``uid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingSelectionInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"uid\",\n            \"number\",\n            \"sopClass\",\n            \"subset\",\n            \"imageRegion2D\",\n            \"imageRegion3D\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingSelectionInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"uid\", \"number\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"uid\", \"uid__ext\")]\n        return required_fields\n\n\nclass ImagingSelectionInstanceImageRegion2D(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A specific 2D region in a DICOM image / frame.\n    Each imaging selection instance or frame list might includes an image\n    region, specified by a region type and a set of 2D coordinates.\n           If the parent imagingSelection.instance contains a subset element of\n    type frame, the image region applies to all frames in the subset list.\n    \"\"\"\n\n    __resource_type__ = \"ImagingSelectionInstanceImageRegion2D\"\n\n    coordinate: typing.List[fhirtypes.DecimalType | None] | None = Field(\n        default=None,\n        alias=\"coordinate\",\n        title=\"Specifies the coordinates that define the image region\",\n        description=(\n            \"The coordinates describing the image region. Encoded as a set of \"\n            \"(column, row) pairs that denote positions in the selected image / \"\n            \"frames specified with sub-pixel resolution.        The origin at the \"\n            \"TLHC of the TLHC pixel is 0.0\\\\0.0, the BRHC of the TLHC pixel is \"\n            \"1.0\\\\1.0, and the BRHC of the BRHC pixel is the number of columns\\\\rows \"\n            \"in the image / frames. The values must be within the range 0\\\\0 to the \"\n            \"number of columns\\\\rows in the image / frames.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    coordinate__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_coordinate\", title=\"Extension field for ``coordinate``.\"\n    )\n\n    regionType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"regionType\",\n        title=\"point | polyline | interpolated | circle | ellipse\",\n        description=\"Specifies the type of image region.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"point\", \"polyline\", \"interpolated\", \"circle\", \"ellipse\"],\n        },\n    )\n    regionType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_regionType\", title=\"Extension field for ``regionType``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingSelectionInstanceImageRegion2D`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"regionType\", \"coordinate\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingSelectionInstanceImageRegion2D`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"coordinate\", \"coordinate__ext\"),\n            (\"regionType\", \"regionType__ext\"),\n        ]\n        return required_fields\n\n\nclass ImagingSelectionInstanceImageRegion3D(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A specific 3D region in a DICOM frame of reference.\n    Each imaging selection might includes a 3D image region, specified by a\n    region type and a set of 3D coordinates.\n    \"\"\"\n\n    __resource_type__ = \"ImagingSelectionInstanceImageRegion3D\"\n\n    coordinate: typing.List[fhirtypes.DecimalType | None] | None = Field(\n        default=None,\n        alias=\"coordinate\",\n        title=\"Specifies the coordinates that define the image region\",\n        description=(\n            \"The coordinates describing the image region. Encoded as an ordered set\"\n            \" of (x,y,z) triplets (in mm and may be negative) that define a region \"\n            \"of interest in the patient-relative Reference Coordinate System \"\n            \"defined by ImagingSelection.frameOfReferenceUid element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    coordinate__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_coordinate\", title=\"Extension field for ``coordinate``.\"\n    )\n\n    regionType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"regionType\",\n        title=\"point | multipoint | polyline | polygon | ellipse | ellipsoid\",\n        description=\"Specifies the type of image region.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"point\",\n                \"multipoint\",\n                \"polyline\",\n                \"polygon\",\n                \"ellipse\",\n                \"ellipsoid\",\n            ],\n        },\n    )\n    regionType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_regionType\", title=\"Extension field for ``regionType``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingSelectionInstanceImageRegion3D`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"regionType\", \"coordinate\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingSelectionInstanceImageRegion3D`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"coordinate\", \"coordinate__ext\"),\n            (\"regionType\", \"regionType__ext\"),\n        ]\n        return required_fields\n\n\nclass ImagingSelectionPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Selector of the instances (human or machine).\n    Selector of the instances – human or machine.\n    \"\"\"\n\n    __resource_type__ = \"ImagingSelectionPerformer\"\n\n    actor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Author (human or machine)\",\n        description=\"Author \\u2013 human or machine.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of performer\",\n        description=\"Distinguishes the type of involvement of the performer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingSelectionPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingSelectionPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n"
  },
  {
    "path": "fhir/resources/imagingstudy.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImagingStudy\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ImagingStudy(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of images produced in single study (one or more series of references\n    images).\n    Representation of the content produced in a DICOM imaging study. A study\n    comprises a set of series, each of which includes a set of Service-Object\n    Pair Instances (SOP Instances - images or other data) acquired or produced\n    in a common context.  A series is of only one modality (e.g. X-ray, CT, MR,\n    ultrasound), but a study may have multiple series of different modalities.\n    \"\"\"\n\n    __resource_type__ = \"ImagingStudy\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled\",\n        description=(\n            \"A list of the diagnostic requests that resulted in this imaging study \"\n            \"being performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"ServiceRequest\",\n                \"Appointment\",\n                \"AppointmentResponse\",\n                \"Task\",\n            ],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Institution-generated description\",\n        description=(\n            \"The Imaging Manager description of the study. Institution-generated \"\n            \"description or classification of the Study (component) performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter with which this imaging study is associated\",\n        description=(\n            \"The healthcare event (e.g. a patient and healthcare provider \"\n            \"interaction) during which this ImagingStudy is made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Study access endpoint\",\n        description=(\n            \"The network service providing access (e.g., query, view, or retrieval)\"\n            \" for the study. See implementation notes for information about using \"\n            \"DICOM endpoints. A study-level endpoint applies to each series in the \"\n            \"study, unless overridden by a series-level endpoint with the same \"\n            \"Endpoint.connectionType.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers for the whole study\",\n        description=\"Identifiers for the ImagingStudy such as DICOM Study Instance UID.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where ImagingStudy occurred\",\n        description=\"The principal physical location where the ImagingStudy was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    modality: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"modality\",\n        title=\"All of the distinct values for series' modalities\",\n        description=(\n            \"A list of all the distinct values of series.modality. This may include\"\n            \" both acquisition and non-acquisition modalities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"User-defined comments\",\n        description=(\n            \"Per the recommended DICOM mapping, this element is derived from the \"\n            \"Study Description attribute (0008,1030). Observations or findings \"\n            \"about the imaging study should be recorded in another resource, e.g. \"\n            \"Observation, and not in this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    numberOfInstances: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfInstances\",\n        title=\"Number of Study Related Instances\",\n        description=(\n            \"Number of SOP Instances in Study. This value given may be larger than \"\n            \"the number of instance elements this resource contains due to resource\"\n            \" availability, security, or other factors. This element should be \"\n            \"present if any instance elements are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numberOfInstances__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfInstances\",\n        title=\"Extension field for ``numberOfInstances``.\",\n    )\n\n    numberOfSeries: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfSeries\",\n        title=\"Number of Study Related Series\",\n        description=(\n            \"Number of Series in the Study. This value given may be larger than the\"\n            \" number of series elements this Resource contains due to resource \"\n            \"availability, security, or other factors. This element should be \"\n            \"present if any series elements are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numberOfSeries__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfSeries\",\n        title=\"Extension field for ``numberOfSeries``.\",\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=(\n            \"A larger event of which this particular ImagingStudy is a component or\"\n            \" step.  For example,  an ImagingStudy as part of a procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    procedure: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"The performed procedure or code\",\n        description=(\n            \"This field corresponds to the DICOM Procedure Code Sequence \"\n            \"(0008,1032). This is different from the FHIR Procedure resource that \"\n            \"may include the ImagingStudy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PlanDefinition\", \"ActivityDefinition\"],\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why the study was requested / performed\",\n        description=(\n            \"Description of clinical condition indicating why the ImagingStudy was \"\n            \"requested, and/or Indicates another resource whose existence justifies\"\n            \" this Study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    referrer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referrer\",\n        title=\"Referring physician\",\n        description=\"The requesting/referring physician.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    series: typing.List[fhirtypes.ImagingStudySeriesType] | None = Field(\n        default=None,\n        alias=\"series\",\n        title=\"Each study has one or more series of instances\",\n        description=\"Each study has one or more series of images or other content.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    started: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"started\",\n        title=\"When the study was started\",\n        description=\"Date and time the study started.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    started__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_started\", title=\"Extension field for ``started``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | available | cancelled | entered-in-error | unknown\",\n        description=(\n            \"The current state of the ImagingStudy resource. This is not the status\"\n            \" of any ServiceRequest or Task resources associated with the \"\n            \"ImagingStudy.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"registered\",\n                \"available\",\n                \"cancelled\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who or what is the subject of the study\",\n        description=\"The subject, typically a patient, of the imaging study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Device\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"modality\",\n            \"subject\",\n            \"encounter\",\n            \"started\",\n            \"basedOn\",\n            \"partOf\",\n            \"referrer\",\n            \"endpoint\",\n            \"numberOfSeries\",\n            \"numberOfInstances\",\n            \"procedure\",\n            \"location\",\n            \"reason\",\n            \"note\",\n            \"description\",\n            \"series\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"modality\",\n            \"subject\",\n            \"encounter\",\n            \"started\",\n            \"basedOn\",\n            \"partOf\",\n            \"referrer\",\n            \"endpoint\",\n            \"numberOfSeries\",\n            \"numberOfInstances\",\n            \"procedure\",\n            \"location\",\n            \"reason\",\n            \"note\",\n            \"description\",\n            \"series\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ImagingStudySeries(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Each study has one or more series of instances.\n    Each study has one or more series of images or other content.\n    \"\"\"\n\n    __resource_type__ = \"ImagingStudySeries\"\n\n    bodySite: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Body part examined\",\n        description=(\n            \"The anatomic structures examined. See DICOM Part 16 Annex L (http://di\"\n            \"com.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html)\"\n            \" for DICOM to SNOMED-CT mappings. The bodySite may indicate the \"\n            \"laterality of body part imaged; if so, it shall be consistent with any\"\n            \" content of ImagingStudy.series.laterality.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BodyStructure\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"A short human readable summary of the series\",\n        description=\"A description of the series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Series access endpoint\",\n        description=(\n            \"The network service providing access (e.g., query, view, or retrieval)\"\n            \" for this series. See implementation notes for information about using\"\n            \" DICOM endpoints. A series-level endpoint, if present, has precedence \"\n            \"over a study-level endpoint with the same Endpoint.connectionType.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    instance: typing.List[fhirtypes.ImagingStudySeriesInstanceType] | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"A single SOP instance from the series\",\n        description=(\n            \"A single SOP instance within the series, e.g. an image, or \"\n            \"presentation state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    laterality: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"laterality\",\n        title=\"Body part laterality\",\n        description=(\n            \"The laterality of the (possibly paired) anatomic structures examined. \"\n            \"E.g., the left knee, both lungs, or unpaired abdomen. If present, \"\n            \"shall be consistent with any laterality information indicated in \"\n            \"ImagingStudy.series.bodySite.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    modality: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"modality\",\n        title=\"The modality used for this series\",\n        description=(\n            \"The distinct modality for this series. This may include both \"\n            \"acquisition and non-acquisition modalities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    number: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"Numeric identifier of this series\",\n        description=\"The numeric identifier of this series in the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    numberOfInstances: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfInstances\",\n        title=\"Number of Series Related Instances\",\n        description=(\n            \"Number of SOP Instances in the Study. The value given may be larger \"\n            \"than the number of instance elements this resource contains due to \"\n            \"resource availability, security, or other factors. This element should\"\n            \" be present if any instance elements are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numberOfInstances__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfInstances\",\n        title=\"Extension field for ``numberOfInstances``.\",\n    )\n\n    performer: typing.List[fhirtypes.ImagingStudySeriesPerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed the series\",\n        description=\"Indicates who or what performed the series and how they were involved.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specimen: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Specimen imaged\",\n        description=\"The specimen imaged, e.g., for whole slide imaging of a biopsy.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    started: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"started\",\n        title=\"When the series started\",\n        description=\"The date and time the series was started.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    started__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_started\", title=\"Extension field for ``started``.\"\n    )\n\n    uid: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"uid\",\n        title=\"DICOM Series Instance UID for the series\",\n        description=\"The DICOM Series Instance UID for the series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uid\", title=\"Extension field for ``uid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingStudySeries`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"uid\",\n            \"number\",\n            \"modality\",\n            \"description\",\n            \"numberOfInstances\",\n            \"endpoint\",\n            \"bodySite\",\n            \"laterality\",\n            \"specimen\",\n            \"started\",\n            \"performer\",\n            \"instance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingStudySeries`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"uid\",\n            \"number\",\n            \"modality\",\n            \"description\",\n            \"numberOfInstances\",\n            \"endpoint\",\n            \"bodySite\",\n            \"laterality\",\n            \"specimen\",\n            \"started\",\n            \"performer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"uid\", \"uid__ext\")]\n        return required_fields\n\n\nclass ImagingStudySeriesInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A single SOP instance from the series.\n    A single SOP instance within the series, e.g. an image, or presentation\n    state.\n    \"\"\"\n\n    __resource_type__ = \"ImagingStudySeriesInstance\"\n\n    number: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"number\",\n        title=\"The number of this instance in the series\",\n        description=\"The number of instance in the series.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    number__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_number\", title=\"Extension field for ``number``.\"\n    )\n\n    sopClass: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"sopClass\",\n        title=\"DICOM class type\",\n        description=\"DICOM instance  type.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Description of instance\",\n        description=\"The description of the instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    uid: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"uid\",\n        title=\"DICOM SOP Instance UID\",\n        description=\"The DICOM SOP Instance UID for this image or other DICOM content.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uid\", title=\"Extension field for ``uid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingStudySeriesInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"uid\",\n            \"sopClass\",\n            \"number\",\n            \"title\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingStudySeriesInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"uid\", \"uid__ext\")]\n        return required_fields\n\n\nclass ImagingStudySeriesPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed the series.\n    Indicates who or what performed the series and how they were involved.\n    \"\"\"\n\n    __resource_type__ = \"ImagingStudySeriesPerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Who performed the series\",\n        description=\"Indicates who or what performed the series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of performance\",\n        description=\"Distinguishes the type of involvement of the performer in the series.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImagingStudySeriesPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImagingStudySeriesPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n"
  },
  {
    "path": "fhir/resources/immunization.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Immunization\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Immunization(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Immunization event information.\n    Describes the event of a patient being administered a vaccine or a record\n    of an immunization as reported by a patient, a clinician or another party.\n    \"\"\"\n\n    __resource_type__ = \"Immunization\"\n\n    administeredProduct: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"administeredProduct\",\n        title=\"Product that was administered\",\n        description=(\n            \"An indication of which product was administered to the patient. This \"\n            \"is typically a more detailed representation of the concept conveyed by\"\n            \" the vaccineCode data element. If a Medication resource is referenced,\"\n            \" it may be to a stand-alone resource or a contained resource within \"\n            \"the Immunization resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Authority that the immunization event is based on\",\n        description=(\n            \"A plan, order or recommendation fulfilled in whole or in part by this \"\n            \"immunization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"MedicationRequest\",\n                \"ServiceRequest\",\n                \"ImmunizationRecommendation\",\n            ],\n        },\n    )\n\n    doseQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"doseQuantity\",\n        title=\"Amount of vaccine administered\",\n        description=\"The quantity of vaccine product that was administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter immunization was part of\",\n        description=(\n            \"The visit or admission or other contact between patient and health \"\n            \"care provider the immunization was performed as part of.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    expirationDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"expirationDate\",\n        title=\"Vaccine expiration date\",\n        description=\"Date vaccine batch expires.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_expirationDate\",\n        title=\"Extension field for ``expirationDate``.\",\n    )\n\n    fundingSource: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fundingSource\",\n        title=\"Funding source for the vaccine\",\n        description=(\n            \"Indicates the source of the vaccine actually administered. This may be\"\n            \" different than the patient eligibility (e.g. the patient may be \"\n            \"eligible for a publically purchased vaccine but due to inventory \"\n            \"issues, vaccine purchased with private funds was actually \"\n            \"administered).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=\"A unique identifier assigned to this immunization record.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    informationSource: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"informationSource\",\n        title=\"Indicates the source of a  reported record\",\n        description=(\n            \"Typically the source of the data when the report of the immunization \"\n            \"event is not based on information from the person who administered the\"\n            \" vaccine.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    isSubpotent: bool | None = Field(\n        default=None,\n        alias=\"isSubpotent\",\n        title=\"Dose potency\",\n        description=(\n            \"Indication if a dose is considered to be subpotent. By default, a dose\"\n            \" should be considered to be potent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isSubpotent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isSubpotent\", title=\"Extension field for ``isSubpotent``.\"\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where immunization occurred\",\n        description=(\n            \"The service delivery location where the vaccine administration \"\n            \"occurred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    lotNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lotNumber\",\n        title=\"Vaccine lot number\",\n        description=\"Lot number of the  vaccine product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lotNumber\", title=\"Extension field for ``lotNumber``.\"\n    )\n\n    manufacturer: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Vaccine manufacturer\",\n        description=\"Name of vaccine manufacturer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional immunization notes\",\n        description=(\n            \"Extra information about the immunization that is not conveyed by the \"\n            \"other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"Vaccine administration date\",\n        description=\"Date vaccine administered or was to be administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": True,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrenceString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"occurrenceString\",\n        title=\"Vaccine administration date\",\n        description=\"Date vaccine administered or was to be administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": True,\n        },\n    )\n    occurrenceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceString\",\n        title=\"Extension field for ``occurrenceString``.\",\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who was immunized\",\n        description=\"The patient who either received or did not receive the immunization.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.ImmunizationPerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed event\",\n        description=\"Indicates who performed the immunization event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    primarySource: bool | None = Field(\n        default=None,\n        alias=\"primarySource\",\n        title=\"Indicates context the data was captured in\",\n        description=(\n            \"Indicates whether the data contained in the resource was captured by \"\n            \"the individual/organization which was responsible for the \"\n            \"administration of the vaccine rather than as 'secondary reported' data\"\n            \" documented by a third party. A value of 'true' means this data \"\n            \"originated with the individual/organization which was responsible for \"\n            \"the administration of the vaccine.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    primarySource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_primarySource\",\n        title=\"Extension field for ``primarySource``.\",\n    )\n\n    programEligibility: typing.List[\n        fhirtypes.ImmunizationProgramEligibilityType\n    ] | None = Field(\n        default=None,\n        alias=\"programEligibility\",\n        title=\"Patient eligibility for a specific vaccination program\",\n        description=\"Indicates a patient's eligibility for a funding program.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    protocolApplied: typing.List[\n        fhirtypes.ImmunizationProtocolAppliedType\n    ] | None = Field(\n        default=None,\n        alias=\"protocolApplied\",\n        title=\"Protocol followed by the provider\",\n        description=(\n            \"The protocol (set of recommendations) being followed by the provider \"\n            \"who administered the dose.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reaction: typing.List[fhirtypes.ImmunizationReactionType] | None = Field(\n        default=None,\n        alias=\"reaction\",\n        title=\"Details of a reaction that follows immunization\",\n        description=(\n            \"Categorical data indicating that an adverse event is associated in \"\n            \"time to an immunization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why immunization occurred\",\n        description=(\n            \"Describes why the immunization occurred in coded or textual form, or \"\n            \"Indicates another resource (Condition, Observation or \"\n            \"DiagnosticReport) whose existence justifies this immunization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\", \"DiagnosticReport\"],\n        },\n    )\n\n    route: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"route\",\n        title=\"How vaccine entered body\",\n        description=\"The path by which the vaccine product is taken into the body.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    site: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Body site vaccine  was administered\",\n        description=\"Body site where vaccine was administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"completed | entered-in-error | not-done\",\n        description=\"Indicates the current status of the immunization event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"completed\", \"entered-in-error\", \"not-done\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Indicates the reason the immunization event was not performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subpotentReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subpotentReason\",\n        title=\"Reason for being subpotent\",\n        description=\"Reason why a dose is considered to be subpotent.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Additional information in support of the immunization\",\n        description=(\n            \"Additional information that is relevant to the immunization (e.g. for \"\n            \"a vaccine recipient who is pregnant, the gestational age of the \"\n            \"fetus). The reason why a vaccine was given (e.g. occupation, \"\n            \"underlying medical condition) should be conveyed in \"\n            \"Immunization.reason, not as supporting information. The reason why a \"\n            \"vaccine was not given (e.g. contraindication) should be conveyed in \"\n            \"Immunization.statusReason, not as supporting information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    vaccineCode: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"vaccineCode\",\n        title=\"Vaccine administered\",\n        description=\"Vaccine that was administered or was to be administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Immunization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"status\",\n            \"statusReason\",\n            \"vaccineCode\",\n            \"administeredProduct\",\n            \"manufacturer\",\n            \"lotNumber\",\n            \"expirationDate\",\n            \"patient\",\n            \"encounter\",\n            \"supportingInformation\",\n            \"occurrenceDateTime\",\n            \"occurrenceString\",\n            \"primarySource\",\n            \"informationSource\",\n            \"location\",\n            \"site\",\n            \"route\",\n            \"doseQuantity\",\n            \"performer\",\n            \"note\",\n            \"reason\",\n            \"isSubpotent\",\n            \"subpotentReason\",\n            \"programEligibility\",\n            \"fundingSource\",\n            \"reaction\",\n            \"protocolApplied\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Immunization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"basedOn\",\n            \"status\",\n            \"vaccineCode\",\n            \"patient\",\n            \"occurrenceDateTime\",\n            \"occurrenceString\",\n            \"primarySource\",\n            \"performer\",\n            \"note\",\n            \"isSubpotent\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"occurrence\": [\"occurrenceDateTime\", \"occurrenceString\"]}\n        return one_of_many_fields\n\n\nclass ImmunizationPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed event.\n    Indicates who performed the immunization event.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationPerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual or organization who was performing\",\n        description=\"The practitioner or organization who performed the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"What type of performance was done\",\n        description=(\n            \"Describes the type of performance (e.g. ordering provider, \"\n            \"administering provider, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n\n\nclass ImmunizationProgramEligibility(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient eligibility for a specific vaccination program.\n    Indicates a patient's eligibility for a funding program.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationProgramEligibility\"\n\n    program: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"program\",\n        title=\"The program that eligibility is declared for\",\n        description=\"Indicates which program the patient had their eligility evaluated for.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    programStatus: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"programStatus\",\n        title=\"The patient's eligibility status for the program\",\n        description=(\n            \"Indicates the patient's eligility status for for a specific payment \"\n            \"program.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationProgramEligibility`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"program\", \"programStatus\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationProgramEligibility`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ImmunizationProtocolApplied(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Protocol followed by the provider.\n    The protocol (set of recommendations) being followed by the provider who\n    administered the dose.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationProtocolApplied\"\n\n    authority: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Who is responsible for publishing the recommendations\",\n        description=(\n            \"Indicates the authority who published the protocol (e.g. ACIP) that is\"\n            \" being followed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    doseNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"doseNumber\",\n        title=\"Dose number within series\",\n        description=(\n            \"Nominal position in a series as intended by the practitioner \"\n            \"administering the dose.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    doseNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_doseNumber\", title=\"Extension field for ``doseNumber``.\"\n    )\n\n    series: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"series\",\n        title=\"Name of vaccine series\",\n        description=(\n            \"One possible path to achieve presumed immunity against a disease - \"\n            \"within the context of an authority.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_series\", title=\"Extension field for ``series``.\"\n    )\n\n    seriesDoses: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"seriesDoses\",\n        title=\"Recommended number of doses for immunity\",\n        description=(\n            \"The recommended number of doses to achieve immunity as intended by the\"\n            \" practitioner administering the dose.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    seriesDoses__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_seriesDoses\", title=\"Extension field for ``seriesDoses``.\"\n    )\n\n    targetDisease: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"targetDisease\",\n        title=\"Vaccine preventatable disease being targeted\",\n        description=(\n            \"The vaccine preventable disease the dose is being administered \" \"against.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationProtocolApplied`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"series\",\n            \"authority\",\n            \"targetDisease\",\n            \"doseNumber\",\n            \"seriesDoses\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationProtocolApplied`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"doseNumber\", \"doseNumber__ext\")]\n        return required_fields\n\n\nclass ImmunizationReaction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of a reaction that follows immunization.\n    Categorical data indicating that an adverse event is associated in time to\n    an immunization.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationReaction\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When reaction started\",\n        description=\"Date of reaction to the immunization.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    manifestation: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"manifestation\",\n        title=\"Additional information on reaction\",\n        description=\"Details of the reaction.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    reported: bool | None = Field(\n        default=None,\n        alias=\"reported\",\n        title=\"Indicates self-reported reaction\",\n        description=\"Self-reported indicator.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reported__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reported\", title=\"Extension field for ``reported``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationReaction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"date\",\n            \"manifestation\",\n            \"reported\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationReaction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/immunizationevaluation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass ImmunizationEvaluation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Immunization evaluation information.\n    Describes a comparison of an immunization event against published\n    recommendations to determine if the administration is \"valid\" in relation\n    to those  recommendations.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationEvaluation\"\n\n    authority: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Who is responsible for publishing the recommendations\",\n        description=\"Indicates the authority who published the protocol (e.g. ACIP).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date evaluation was performed\",\n        description=(\n            \"The date the evaluation of the vaccine administration event was \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Evaluation notes\",\n        description=\"Additional information about the evaluation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    doseNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"doseNumber\",\n        title=\"Dose number within series\",\n        description=(\n            \"Nominal position in a series as determined by the outcome of the \"\n            \"evaluation process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    doseNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_doseNumber\", title=\"Extension field for ``doseNumber``.\"\n    )\n\n    doseStatus: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"doseStatus\",\n        title=\"Status of the dose relative to published recommendations\",\n        description=(\n            \"Indicates if the dose is valid or not valid with respect to the \"\n            \"published recommendations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    doseStatusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"doseStatusReason\",\n        title=\"Reason why the doese is considered valid, invalid or some other status\",\n        description=(\n            \"Provides an explanation as to why the vaccine administration event is \"\n            \"valid or not relative to the published recommendations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=\"A unique identifier assigned to this immunization evaluation record.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    immunizationEvent: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"immunizationEvent\",\n        title=\"Immunization being evaluated\",\n        description=\"The vaccine administration event being evaluated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Immunization\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who this evaluation is for\",\n        description=\"The individual for whom the evaluation is being done.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    series: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"series\",\n        title=\"Name of vaccine series\",\n        description=(\n            \"One possible path to achieve presumed immunity against a disease - \"\n            \"within the context of an authority.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_series\", title=\"Extension field for ``series``.\"\n    )\n\n    seriesDoses: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"seriesDoses\",\n        title=\"Recommended number of doses for immunity\",\n        description=(\n            \"The recommended number of doses to achieve immunity as determined by \"\n            \"the outcome of the evaluation process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    seriesDoses__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_seriesDoses\", title=\"Extension field for ``seriesDoses``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"completed | entered-in-error\",\n        description=(\n            \"Indicates the current status of the evaluation of the vaccination \"\n            \"administration event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"completed\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    targetDisease: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"targetDisease\",\n        title=\"The vaccine preventable disease schedule being evaluated\",\n        description=\"The vaccine preventable disease the dose is being evaluated against.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationEvaluation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"patient\",\n            \"date\",\n            \"authority\",\n            \"targetDisease\",\n            \"immunizationEvent\",\n            \"doseStatus\",\n            \"doseStatusReason\",\n            \"description\",\n            \"series\",\n            \"doseNumber\",\n            \"seriesDoses\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationEvaluation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"patient\",\n            \"targetDisease\",\n            \"immunizationEvent\",\n            \"doseStatus\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/immunizationrecommendation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ImmunizationRecommendation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Guidance or advice relating to an immunization.\n    A patient's point-in-time set of recommendations (i.e. forecasting)\n    according to a published schedule with optional supporting justification.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationRecommendation\"\n\n    authority: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Who is responsible for protocol\",\n        description=\"Indicates the authority who published the protocol (e.g. ACIP).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date recommendation(s) created\",\n        description=\"The date the immunization recommendation(s) were created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=\"A unique identifier assigned to this particular recommendation record.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who this profile is for\",\n        description=\"The patient the recommendation(s) are for.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    recommendation: typing.List[\n        fhirtypes.ImmunizationRecommendationRecommendationType\n    ] = Field(\n        default=...,\n        alias=\"recommendation\",\n        title=\"Vaccine administration recommendations\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationRecommendation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"patient\",\n            \"date\",\n            \"authority\",\n            \"recommendation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"patient\",\n            \"date\",\n            \"recommendation\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"date\", \"date__ext\")]\n        return required_fields\n\n\nclass ImmunizationRecommendationRecommendation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Vaccine administration recommendations.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationRecommendationRecommendation\"\n\n    contraindicatedVaccineCode: typing.List[\n        fhirtypes.CodeableConceptType\n    ] | None = Field(\n        default=None,\n        alias=\"contraindicatedVaccineCode\",\n        title=\"Vaccine which is contraindicated to fulfill the recommendation\",\n        description=\"Vaccine(s) which should not be used to fulfill the recommendation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dateCriterion: typing.List[\n        fhirtypes.ImmunizationRecommendationRecommendationDateCriterionType\n    ] | None = Field(\n        default=None,\n        alias=\"dateCriterion\",\n        title=\"Dates governing proposed immunization\",\n        description=(\n            \"Vaccine date recommendations.  For example, earliest date to \"\n            \"administer, latest date to administer, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Protocol details\",\n        description=(\n            \"Contains the description about the protocol under which the vaccine \"\n            \"was administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    doseNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"doseNumber\",\n        title=\"Recommended dose number within series\",\n        description=(\n            \"Nominal position of the recommended dose in a series as determined by \"\n            \"the evaluation and forecasting process (e.g. dose 2 is the next \"\n            \"recommended dose).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doseNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_doseNumber\", title=\"Extension field for ``doseNumber``.\"\n    )\n\n    forecastReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"forecastReason\",\n        title=\"Vaccine administration status reason\",\n        description=\"The reason for the assigned forecast status.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    forecastStatus: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"forecastStatus\",\n        title=\"Vaccine recommendation status\",\n        description=(\n            \"Indicates the patient status with respect to the path to immunity for \"\n            \"the target disease.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    series: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"series\",\n        title=\"Name of vaccination series\",\n        description=(\n            \"One possible path to achieve presumed immunity against a disease - \"\n            \"within the context of an authority.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    series__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_series\", title=\"Extension field for ``series``.\"\n    )\n\n    seriesDoses: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"seriesDoses\",\n        title=\"Recommended number of doses for immunity\",\n        description=(\n            \"The recommended number of doses to achieve immunity as determined by \"\n            \"the evaluation and forecasting process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    seriesDoses__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_seriesDoses\", title=\"Extension field for ``seriesDoses``.\"\n    )\n\n    supportingImmunization: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingImmunization\",\n        title=\"Past immunizations supporting recommendation\",\n        description=(\n            \"Immunization event history and/or evaluation that supports the status \"\n            \"and recommendation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Immunization\", \"ImmunizationEvaluation\"],\n        },\n    )\n\n    supportingPatientInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingPatientInformation\",\n        title=\"Patient observations supporting recommendation\",\n        description=(\n            \"Patient Information that supports the status and recommendation.  This\"\n            \" includes patient observations, adverse reactions and \"\n            \"allergy/intolerance information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    targetDisease: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"targetDisease\",\n        title=\"Disease to be immunized against\",\n        description=\"The targeted disease for the recommendation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    vaccineCode: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"vaccineCode\",\n        title=\"Vaccine  or vaccine group recommendation applies to\",\n        description=\"Vaccine(s) or vaccine group that pertain to the recommendation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationRecommendationRecommendation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"vaccineCode\",\n            \"targetDisease\",\n            \"contraindicatedVaccineCode\",\n            \"forecastStatus\",\n            \"forecastReason\",\n            \"dateCriterion\",\n            \"description\",\n            \"series\",\n            \"doseNumber\",\n            \"seriesDoses\",\n            \"supportingImmunization\",\n            \"supportingPatientInformation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"vaccineCode\",\n            \"targetDisease\",\n            \"contraindicatedVaccineCode\",\n            \"forecastStatus\",\n            \"forecastReason\",\n            \"doseNumber\",\n        ]\n\n\nclass ImmunizationRecommendationRecommendationDateCriterion(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dates governing proposed immunization.\n    Vaccine date recommendations.  For example, earliest date to administer,\n    latest date to administer, etc.\n    \"\"\"\n\n    __resource_type__ = \"ImmunizationRecommendationRecommendationDateCriterion\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of date\",\n        description=(\n            \"Date classification of recommendation.  For example, earliest date to \"\n            \"give, latest date to give, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Recommended date\",\n        description=\"The date whose meaning is specified by dateCriterion.code.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImmunizationRecommendationRecommendationDateCriterion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImmunizationRecommendationRecommendationDateCriterion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/implementationguide.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImplementationGuide\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ImplementationGuide(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of rules about how FHIR is used.\n    A set of rules of how a particular interoperability or standards problem is\n    solved - typically through the use of FHIR resources. This resource is used\n    to gather all the parts of an implementation guide into a logical whole and\n    to publish a computable definition of all the parts.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuide\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the implementation guide and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the implementation guide was last\"\n            \" significantly changed. The date must change when the business version\"\n            \" changes and it must change if the status code changes. In addition, \"\n            \"it should change when the substantive content of the implementation \"\n            \"guide changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    definition: fhirtypes.ImplementationGuideDefinitionType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Information needed to build the IG\",\n        description=(\n            \"The information needed by an IG publisher tool to publish the whole \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dependsOn: typing.List[fhirtypes.ImplementationGuideDependsOnType] | None = Field(\n        default=None,\n        alias=\"dependsOn\",\n        title=\"Another Implementation guide this depends on\",\n        description=(\n            \"Another implementation guide that this implementation depends on. \"\n            \"Typically, an implementation guide uses value sets, profiles \"\n            \"etc.defined in other implementation guides.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the implementation guide\",\n        description=(\n            \"A free text natural language description of the implementation guide \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this implementation guide is authored\"\n            \" for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fhirVersion: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"fhirVersion\",\n        title=\"FHIR Version(s) this Implementation Guide targets\",\n        description=(\n            \"The version(s) of the FHIR specification that this ImplementationGuide\"\n            \" targets - e.g. describes how to use. The value of this element is the\"\n            \" formal version of the specification, without the revision number, \"\n            \"e.g. [publication].[major].[minor], which is 4.6.0. for this version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    fhirVersion__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_fhirVersion\", title=\"Extension field for ``fhirVersion``.\"\n    )\n\n    global_fhir: typing.List[fhirtypes.ImplementationGuideGlobalType] | None = Field(\n        default=None,\n        alias=\"global\",\n        title=\"Profiles that apply globally\",\n        description=(\n            \"A set of profiles that all resources covered by this implementation \"\n            \"guide must conform to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"Additional identifier for the implementation guide (business \"\n            \"identifier)\"\n        ),\n        description=(\n            \"A formal identifier that is used to identify this implementation guide\"\n            \" when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for implementation guide (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the implementation guide is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    license: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"license\",\n        title=\"SPDX license code for this IG (or not-open-source)\",\n        description=(\n            \"The license that applies to this Implementation Guide, using an SPDX \"\n            \"license code, or 'not-open-source'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    license__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_license\", title=\"Extension field for ``license``.\"\n    )\n\n    manifest: fhirtypes.ImplementationGuideManifestType | None = Field(\n        default=None,\n        alias=\"manifest\",\n        title=\"Information about an assembled IG\",\n        description=(\n            \"Information about an assembled implementation guide, created by the \"\n            \"publication tooling.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this implementation guide (computer friendly)\",\n        description=(\n            \"A natural language name identifying the implementation guide. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    packageId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"packageId\",\n        title=\"NPM Package name for IG\",\n        description=(\n            \"The NPM package name for this Implementation Guide, used in the NPM \"\n            \"package distribution, which is the primary mechanism by which FHIR \"\n            \"based tooling manages IG dependencies. This value must be globally \"\n            \"unique, and should be assigned with care.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    packageId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_packageId\", title=\"Extension field for ``packageId``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this implementation guide is defined\",\n        description=(\n            \"Explanation of why this implementation guide is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this implementation guide. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this implementation guide (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the implementation \" \"guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this implementation guide, represented as a \"\n            \"URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this implementation guide \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which an \"\n            \"authoritative instance of this implementation guide is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the implementation guide is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate implementation guide instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the implementation guide\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"implementation guide when it is referenced in a specification, model, \"\n            \"design or instance. This is an arbitrary value managed by the \"\n            \"implementation guide author and is not expected to be globally unique.\"\n            \" For example, it might be a timestamp (e.g. yyyymmdd) if a managed \"\n            \"version is not available. There is also no expectation that versions \"\n            \"can be placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuide`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"packageId\",\n            \"license\",\n            \"fhirVersion\",\n            \"dependsOn\",\n            \"global\",\n            \"definition\",\n            \"manifest\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuide`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"packageId\",\n            \"license\",\n            \"fhirVersion\",\n            \"dependsOn\",\n            \"global\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"fhirVersion\", \"fhirVersion__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"packageId\", \"packageId__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass ImplementationGuideDefinition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information needed to build the IG.\n    The information needed by an IG publisher tool to publish the whole\n    implementation guide.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDefinition\"\n\n    grouping: typing.List[\n        fhirtypes.ImplementationGuideDefinitionGroupingType\n    ] | None = Field(\n        default=None,\n        alias=\"grouping\",\n        title=\"Grouping used to present related resources in the IG\",\n        description=(\n            \"A logical group of resources. Logical groups can be used when building\"\n            \" pages.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    page: fhirtypes.ImplementationGuideDefinitionPageType | None = Field(\n        default=None,\n        alias=\"page\",\n        title=\"Page/Section in the Guide\",\n        description=(\n            \"A page / section in the implementation guide. The root page is the \"\n            \"implementation guide home page.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    parameter: typing.List[\n        fhirtypes.ImplementationGuideDefinitionParameterType\n    ] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Defines how IG is built by tools\",\n        description=(\n            \"A set of parameters that defines how the implementation guide is \"\n            \"built. The parameters are defined by the relevant tools that build the\"\n            \" implementation guides.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    resource: typing.List[\n        fhirtypes.ImplementationGuideDefinitionResourceType\n    ] | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Resource in the implementation guide\",\n        description=(\n            \"A resource that is part of the implementation guide. Conformance \"\n            \"resources (value set, structure definition, capability statements \"\n            \"etc.) are obvious candidates for inclusion, but any kind of resource \"\n            \"can be included as an example resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    template: typing.List[\n        fhirtypes.ImplementationGuideDefinitionTemplateType\n    ] | None = Field(\n        default=None,\n        alias=\"template\",\n        title=\"A template for building resources\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"grouping\",\n            \"resource\",\n            \"page\",\n            \"parameter\",\n            \"template\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ImplementationGuideDefinitionGrouping(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Grouping used to present related resources in the IG.\n    A logical group of resources. Logical groups can be used when building\n    pages.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDefinitionGrouping\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human readable text describing the package\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Descriptive name for the package\",\n        description=(\n            \"The human-readable title to display for the package of resources when \"\n            \"rendering the implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDefinitionGrouping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"description\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionGrouping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideDefinitionPage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Page/Section in the Guide.\n    A page / section in the implementation guide. The root page is the\n    implementation guide home page.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDefinitionPage\"\n\n    generation: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"generation\",\n        title=\"html | markdown | xml | generated\",\n        description=\"A code that indicates how the page is generated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"html\", \"markdown\", \"xml\", \"generated\"],\n        },\n    )\n    generation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_generation\", title=\"Extension field for ``generation``.\"\n    )\n\n    name: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the page when published\",\n        description=\"The url by which the page should be known when published.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    page: typing.List[fhirtypes.ImplementationGuideDefinitionPageType] | None = Field(\n        default=None,\n        alias=\"page\",\n        title=\"Nested Pages / Sections\",\n        description=\"Nested Pages/Sections under this page.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sourceMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"sourceMarkdown\",\n        title=\"Source for page\",\n        description=\"Indicates the URL or the actual content to provide for the page.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n    sourceMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sourceMarkdown\",\n        title=\"Extension field for ``sourceMarkdown``.\",\n    )\n\n    sourceString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sourceString\",\n        title=\"Source for page\",\n        description=\"Indicates the URL or the actual content to provide for the page.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n    sourceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sourceString\",\n        title=\"Extension field for ``sourceString``.\",\n    )\n\n    sourceUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"sourceUrl\",\n        title=\"Source for page\",\n        description=\"Indicates the URL or the actual content to provide for the page.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n    sourceUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceUrl\", title=\"Extension field for ``sourceUrl``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Short title shown for navigational assistance\",\n        description=(\n            \"A short title used to represent this page in navigational structures \"\n            \"such as table of contents, bread crumbs, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDefinitionPage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sourceUrl\",\n            \"sourceString\",\n            \"sourceMarkdown\",\n            \"name\",\n            \"title\",\n            \"generation\",\n            \"page\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionPage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"generation\", \"generation__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"title\", \"title__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"source\": [\"sourceMarkdown\", \"sourceString\", \"sourceUrl\"]}\n        return one_of_many_fields\n\n\nclass ImplementationGuideDefinitionParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defines how IG is built by tools.\n    A set of parameters that defines how the implementation guide is built. The\n    parameters are defined by the relevant tools that build the implementation\n    guides.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDefinitionParameter\"\n\n    code: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Code that identifies parameter\",\n        description=\"A tool-specific code that defines the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Value for named type\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDefinitionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideDefinitionResource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource in the implementation guide.\n    A resource that is part of the implementation guide. Conformance resources\n    (value set, structure definition, capability statements etc.) are obvious\n    candidates for inclusion, but any kind of resource can be included as an\n    example resource.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDefinitionResource\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Reason why included in guide\",\n        description=(\n            \"A description of the reason that a resource has been included in the \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    fhirVersion: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"fhirVersion\",\n        title=\"Versions this applies to (if different to IG)\",\n        description=(\n            \"Indicates the FHIR Version(s) this artifact is intended to apply to. \"\n            \"If no versions are specified, the resource is assumed to apply to all \"\n            \"the versions stated in ImplementationGuide.fhirVersion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    fhirVersion__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_fhirVersion\", title=\"Extension field for ``fhirVersion``.\"\n    )\n\n    groupingId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"groupingId\",\n        title=\"Grouping this is part of\",\n        description=\"Reference to the id of the grouping this resource appears in.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    groupingId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_groupingId\", title=\"Extension field for ``groupingId``.\"\n    )\n\n    isExample: bool | None = Field(\n        default=None,\n        alias=\"isExample\",\n        title=\"Is this an example\",\n        description=\"If true, indicates the resource is an example instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    isExample__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isExample\", title=\"Extension field for ``isExample``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human readable name for the resource\",\n        description=(\n            \"A human assigned name for the resource. All resources SHOULD have a \"\n            \"name, but the name may be extracted from the resource (e.g. \"\n            \"ValueSet.name).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    profile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile(s) this is an example of\",\n        description=\"If present, indicates profile(s) the instance is valid against.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Location of the resource\",\n        description=\"Where this resource is found.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDefinitionResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"reference\",\n            \"fhirVersion\",\n            \"name\",\n            \"description\",\n            \"isExample\",\n            \"profile\",\n            \"groupingId\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ImplementationGuideDefinitionTemplate(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A template for building resources.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDefinitionTemplate\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of template specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    scope: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"scope\",\n        title=\"The scope in which the template applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    scope__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_scope\", title=\"Extension field for ``scope``.\"\n    )\n\n    source: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"The source location for the template\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDefinitionTemplate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"source\", \"scope\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDefinitionTemplate`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"source\", \"source__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideDependsOn(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Another Implementation guide this depends on.\n    Another implementation guide that this implementation depends on.\n    Typically, an implementation guide uses value sets, profiles etc.defined in\n    other implementation guides.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideDependsOn\"\n\n    packageId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"packageId\",\n        title=\"NPM Package name for IG this depends on\",\n        description=(\n            \"The NPM package name for the Implementation Guide that this IG depends\"\n            \" on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    packageId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_packageId\", title=\"Extension field for ``packageId``.\"\n    )\n\n    reason: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why dependency exists\",\n        description=(\n            \"A description explaining the nature of the dependency on the listed \" \"IG.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reason\", title=\"Extension field for ``reason``.\"\n    )\n\n    uri: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Identity of the IG that this depends on\",\n        description=\"A canonical reference to the Implementation guide for the dependency.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ImplementationGuide\"],\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version of the IG\",\n        description=(\n            \"The version of the IG that is depended on, when the correct version is\"\n            \" required to understand the IG correctly.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideDependsOn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"uri\",\n            \"packageId\",\n            \"version\",\n            \"reason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideDependsOn`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"uri\", \"packageId\", \"version\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"uri\", \"uri__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideGlobal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Profiles that apply globally.\n    A set of profiles that all resources covered by this implementation guide\n    must conform to.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideGlobal\"\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile that all resources must conform to\",\n        description=\"A reference to the profile that all instances must conform to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type this profile applies to\",\n        description=\"The type of resource that all instances must conform to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideGlobal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"profile\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideGlobal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"profile\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"profile\", \"profile__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideManifest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about an assembled IG.\n    Information about an assembled implementation guide, created by the\n    publication tooling.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideManifest\"\n\n    image: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"image\",\n        title=\"Image within the IG\",\n        description=\"Indicates a relative path to an image that exists within the IG.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    image__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_image\", title=\"Extension field for ``image``.\"\n    )\n\n    other: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"other\",\n        title=\"Additional linkable file in IG\",\n        description=(\n            \"Indicates the relative path of an additional non-page, non-image file \"\n            \"that is part of the IG - e.g. zip, jar and similar files that could be\"\n            \" the target of a hyperlink in a derived IG.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    other__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_other\", title=\"Extension field for ``other``.\"\n    )\n\n    page: typing.List[fhirtypes.ImplementationGuideManifestPageType] | None = Field(\n        default=None,\n        alias=\"page\",\n        title=\"HTML page within the parent IG\",\n        description=\"Information about a page within the IG.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rendering: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"rendering\",\n        title=\"Location of rendered implementation guide\",\n        description=(\n            \"A pointer to official web page, PDF or other rendering of the \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rendering__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rendering\", title=\"Extension field for ``rendering``.\"\n    )\n\n    resource: typing.List[fhirtypes.ImplementationGuideManifestResourceType] = Field(\n        default=...,\n        alias=\"resource\",\n        title=\"Resource in the implementation guide\",\n        description=(\n            \"A resource that is part of the implementation guide. Conformance \"\n            \"resources (value set, structure definition, capability statements \"\n            \"etc.) are obvious candidates for inclusion, but any kind of resource \"\n            \"can be included as an example resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideManifest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"rendering\",\n            \"resource\",\n            \"page\",\n            \"image\",\n            \"other\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideManifest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"rendering\", \"resource\"]\n\n\nclass ImplementationGuideManifestPage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    HTML page within the parent IG.\n    Information about a page within the IG.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideManifestPage\"\n\n    anchor: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"anchor\",\n        title=\"Anchor available on the page\",\n        description=\"The name of an anchor available on the page.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    anchor__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_anchor\", title=\"Extension field for ``anchor``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"HTML page name\",\n        description=\"Relative path to the page.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Title of the page, for references\",\n        description=\"Label for the page intended for human display.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideManifestPage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"title\", \"anchor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideManifestPage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass ImplementationGuideManifestResource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource in the implementation guide.\n    A resource that is part of the implementation guide. Conformance resources\n    (value set, structure definition, capability statements etc.) are obvious\n    candidates for inclusion, but any kind of resource can be included as an\n    example resource.\n    \"\"\"\n\n    __resource_type__ = \"ImplementationGuideManifestResource\"\n\n    isExample: bool | None = Field(\n        default=None,\n        alias=\"isExample\",\n        title=\"Is this an example\",\n        description=\"If true, indicates the resource is an example instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    isExample__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isExample\", title=\"Extension field for ``isExample``.\"\n    )\n\n    profile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile(s) this is an example of\",\n        description=\"If present, indicates profile(s) the instance is valid against.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Location of the resource\",\n        description=\"Where this resource is found.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    relativePath: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"relativePath\",\n        title=\"Relative path for page in IG\",\n        description=\"The relative path for primary page for this resource within the IG.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    relativePath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relativePath\",\n        title=\"Extension field for ``relativePath``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ImplementationGuideManifestResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"reference\",\n            \"isExample\",\n            \"profile\",\n            \"relativePath\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ImplementationGuideManifestResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"reference\"]\n"
  },
  {
    "path": "fhir/resources/ingredient.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Ingredient\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Ingredient(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An ingredient of a manufactured item or pharmaceutical product.\n    \"\"\"\n\n    __resource_type__ = \"Ingredient\"\n\n    allergenicIndicator: bool | None = Field(\n        default=None,\n        alias=\"allergenicIndicator\",\n        title=\"If the ingredient is a known or suspected allergen\",\n        description=(\n            \"If the ingredient is a known or suspected allergen. Note that this is \"\n            \"a property of the substance, so if a reference to a \"\n            \"SubstanceDefinition is used to decribe that (rather than just a code),\"\n            \" the allergen information should go there, not here.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    allergenicIndicator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allergenicIndicator\",\n        title=\"Extension field for ``allergenicIndicator``.\",\n    )\n\n    comment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=(\n            \"A place for providing any notes that are relevant to the component, \"\n            \"e.g. removed during process, adjusted for loss on drying\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    for_fhir: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"for\",\n        title=\"The product which this ingredient is a constituent part of\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicinalProductDefinition\",\n                \"AdministrableProductDefinition\",\n                \"ManufacturedItemDefinition\",\n            ],\n        },\n    )\n\n    function: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"function\",\n        title=(\n            \"Precise action within the drug product, e.g. antioxidant, alkalizing \"\n            \"agent\"\n        ),\n        description=(\n            \"A classification of the ingredient identifying its precise purpose(s) \"\n            \"in the drug product. This extends the Ingredient.role to add more \"\n            \"detail. Example: antioxidant, alkalizing agent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    group: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"group\",\n        title=(\n            \"A classification of the ingredient according to where in the physical \"\n            \"item it tends to be used, such the outer shell of a tablet, inner body\"\n            \" or ink\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier or code by which the ingredient can be referenced\",\n        description=(\n            \"The identifier(s) of this Ingredient that are assigned by business \"\n            \"processes and/or used to refer to it when a direct URL reference to \"\n            \"the resource itself is not appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    manufacturer: typing.List[fhirtypes.IngredientManufacturerType] | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"An organization that manufactures this ingredient\",\n        description=(\n            \"The organization(s) that manufacture this ingredient. Can be used to \"\n            \"indicate:         1) Organizations we are aware of that manufacture \"\n            \"this ingredient         2) Specific Manufacturer(s) currently being \"\n            \"used         3) Set of organisations allowed to manufacture this \"\n            \"ingredient for this product         Users must be clear on the \"\n            \"application of context relevant to their use case.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"role\",\n        title=\"Purpose of the ingredient within the product, e.g. active, inactive\",\n        description=(\n            \"A classification of the ingredient identifying its purpose within the \"\n            \"product, e.g. active, inactive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this ingredient. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    substance: fhirtypes.IngredientSubstanceType = Field(\n        default=...,\n        alias=\"substance\",\n        title=\"The substance that comprises this ingredient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Ingredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"for\",\n            \"role\",\n            \"function\",\n            \"group\",\n            \"allergenicIndicator\",\n            \"comment\",\n            \"manufacturer\",\n            \"substance\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Ingredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"for\",\n            \"role\",\n            \"function\",\n            \"group\",\n            \"allergenicIndicator\",\n            \"manufacturer\",\n            \"substance\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass IngredientManufacturer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An organization that manufactures this ingredient.\n    The organization(s) that manufacture this ingredient. Can be used to\n    indicate:         1) Organizations we are aware of that manufacture this\n    ingredient         2) Specific Manufacturer(s) currently being used\n    3) Set of organisations allowed to manufacture this ingredient for this\n    product         Users must be clear on the application of context relevant\n    to their use case.\n    \"\"\"\n\n    __resource_type__ = \"IngredientManufacturer\"\n\n    manufacturer: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"manufacturer\",\n        title=\"An organization that manufactures this ingredient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    role: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"allowed | possible | actual\",\n        description=(\n            \"The way in which this manufacturer is associated with the ingredient. \"\n            \"For example whether it is a possible one (others allowed), or an \"\n            \"exclusive authorized one for this ingredient. Note that this is not \"\n            \"the manufacturing process role.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"allowed\", \"possible\", \"actual\"],\n        },\n    )\n    role__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_role\", title=\"Extension field for ``role``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``IngredientManufacturer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"manufacturer\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``IngredientManufacturer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"role\", \"manufacturer\"]\n\n\nclass IngredientSubstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The substance that comprises this ingredient.\n    \"\"\"\n\n    __resource_type__ = \"IngredientSubstance\"\n\n    code: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"A code or full resource that represents the ingredient substance\",\n        description=\"A code or full resource that represents the ingredient's substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceDefinition\"],\n        },\n    )\n\n    strength: typing.List[fhirtypes.IngredientSubstanceStrengthType] | None = Field(\n        default=None,\n        alias=\"strength\",\n        title=(\n            \"The quantity of substance, per presentation, or per volume or mass, \"\n            \"and type of quantity\"\n        ),\n        description=(\n            \"The quantity of substance in the unit of presentation, or in the \"\n            \"volume (or mass) of the single pharmaceutical product or manufactured \"\n            \"item. The allowed repetitions do not represent different strengths, \"\n            \"but are different representations - mathematically equivalent - of a \"\n            \"single strength.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``IngredientSubstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"strength\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``IngredientSubstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"strength\"]\n\n\nclass IngredientSubstanceStrength(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The quantity of substance, per presentation, or per volume or mass, and\n    type of quantity.\n    The quantity of substance in the unit of presentation, or in the volume (or\n    mass) of the single pharmaceutical product or manufactured item. The\n    allowed repetitions do not represent different strengths, but are different\n    representations - mathematically equivalent - of a single strength.\n    \"\"\"\n\n    __resource_type__ = \"IngredientSubstanceStrength\"\n\n    basis: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"basis\",\n        title=(\n            \"A code that indicates if the strength is, for example, based on the \"\n            \"ingredient substance as stated or on the substance base (when the \"\n            \"ingredient is a salt)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    concentrationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"concentrationCodeableConcept\",\n        title=\"The strength per unitary volume (or mass)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e concentration[x]\n            \"one_of_many\": \"concentration\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    concentrationQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"concentrationQuantity\",\n        title=\"The strength per unitary volume (or mass)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e concentration[x]\n            \"one_of_many\": \"concentration\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    concentrationRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"concentrationRatio\",\n        title=\"The strength per unitary volume (or mass)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e concentration[x]\n            \"one_of_many\": \"concentration\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    concentrationRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"concentrationRatioRange\",\n        title=\"The strength per unitary volume (or mass)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e concentration[x]\n            \"one_of_many\": \"concentration\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    country: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"country\",\n        title=\"Where the strength range applies\",\n        description=\"The country or countries for which the strength range applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    measurementPoint: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"measurementPoint\",\n        title=\"When strength is measured at a particular point or distance\",\n        description=(\n            \"For when strength is measured at a particular point or distance. There\"\n            \" are products where strength is measured at a particular point. For \"\n            \"example, the strength of the ingredient in some inhalers is measured \"\n            \"at a particular position relative to the point of aerosolization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    measurementPoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_measurementPoint\",\n        title=\"Extension field for ``measurementPoint``.\",\n    )\n\n    presentationCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"presentationCodeableConcept\",\n        title=\"The quantity of substance in the unit of presentation\",\n        description=(\n            \"The quantity of substance in the unit of presentation, or in the \"\n            \"volume (or mass) of the single pharmaceutical product or manufactured \"\n            \"item. Unit of presentation refers to the quantity that the item occurs\"\n            \" in e.g. a strength per tablet size, perhaps 'per 20mg' (the size of \"\n            \"the tablet). It is not generally normalized as a unitary unit, which \"\n            \"would be 'per mg').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e presentation[x]\n            \"one_of_many\": \"presentation\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    presentationQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"presentationQuantity\",\n        title=\"The quantity of substance in the unit of presentation\",\n        description=(\n            \"The quantity of substance in the unit of presentation, or in the \"\n            \"volume (or mass) of the single pharmaceutical product or manufactured \"\n            \"item. Unit of presentation refers to the quantity that the item occurs\"\n            \" in e.g. a strength per tablet size, perhaps 'per 20mg' (the size of \"\n            \"the tablet). It is not generally normalized as a unitary unit, which \"\n            \"would be 'per mg').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e presentation[x]\n            \"one_of_many\": \"presentation\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    presentationRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"presentationRatio\",\n        title=\"The quantity of substance in the unit of presentation\",\n        description=(\n            \"The quantity of substance in the unit of presentation, or in the \"\n            \"volume (or mass) of the single pharmaceutical product or manufactured \"\n            \"item. Unit of presentation refers to the quantity that the item occurs\"\n            \" in e.g. a strength per tablet size, perhaps 'per 20mg' (the size of \"\n            \"the tablet). It is not generally normalized as a unitary unit, which \"\n            \"would be 'per mg').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e presentation[x]\n            \"one_of_many\": \"presentation\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    presentationRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"presentationRatioRange\",\n        title=\"The quantity of substance in the unit of presentation\",\n        description=(\n            \"The quantity of substance in the unit of presentation, or in the \"\n            \"volume (or mass) of the single pharmaceutical product or manufactured \"\n            \"item. Unit of presentation refers to the quantity that the item occurs\"\n            \" in e.g. a strength per tablet size, perhaps 'per 20mg' (the size of \"\n            \"the tablet). It is not generally normalized as a unitary unit, which \"\n            \"would be 'per mg').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e presentation[x]\n            \"one_of_many\": \"presentation\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    referenceStrength: typing.List[\n        fhirtypes.IngredientSubstanceStrengthReferenceStrengthType\n    ] | None = Field(\n        default=None,\n        alias=\"referenceStrength\",\n        title=\"Strength expressed in terms of a reference substance\",\n        description=(\n            \"Strength expressed in terms of a reference substance. For when the \"\n            \"ingredient strength is additionally expressed as equivalent to the \"\n            \"strength of some other closely related substance (e.g. salt vs. base).\"\n            \" Reference strength represents the strength (quantitative composition)\"\n            \" of the active moiety of the active substance. There are situations \"\n            \"when the active substance and active moiety are different, therefore \"\n            \"both a strength and a reference strength are needed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    textConcentration: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"textConcentration\",\n        title=(\n            \"Text of either the whole concentration strength or a part of it (rest \"\n            \"being in Strength.concentration as a ratio)\"\n        ),\n        description=(\n            \"A textual represention of either the whole of the concentration \"\n            \"strength or a part of it - with the rest being in \"\n            \"Strength.concentration as a ratio.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    textConcentration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_textConcentration\",\n        title=\"Extension field for ``textConcentration``.\",\n    )\n\n    textPresentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"textPresentation\",\n        title=(\n            \"Text of either the whole presentation strength or a part of it (rest \"\n            \"being in Strength.presentation as a ratio)\"\n        ),\n        description=(\n            \"A textual represention of either the whole of the presentation \"\n            \"strength or a part of it - with the rest being in \"\n            \"Strength.presentation as a ratio.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    textPresentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_textPresentation\",\n        title=\"Extension field for ``textPresentation``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``IngredientSubstanceStrength`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"presentationRatio\",\n            \"presentationRatioRange\",\n            \"presentationCodeableConcept\",\n            \"presentationQuantity\",\n            \"textPresentation\",\n            \"concentrationRatio\",\n            \"concentrationRatioRange\",\n            \"concentrationCodeableConcept\",\n            \"concentrationQuantity\",\n            \"textConcentration\",\n            \"basis\",\n            \"measurementPoint\",\n            \"country\",\n            \"referenceStrength\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``IngredientSubstanceStrength`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"presentationRatio\",\n            \"presentationRatioRange\",\n            \"presentationCodeableConcept\",\n            \"presentationQuantity\",\n            \"textPresentation\",\n            \"concentrationRatio\",\n            \"concentrationRatioRange\",\n            \"concentrationCodeableConcept\",\n            \"concentrationQuantity\",\n            \"textConcentration\",\n            \"basis\",\n            \"measurementPoint\",\n            \"country\",\n            \"referenceStrength\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"concentration\": [\n                \"concentrationCodeableConcept\",\n                \"concentrationQuantity\",\n                \"concentrationRatio\",\n                \"concentrationRatioRange\",\n            ],\n            \"presentation\": [\n                \"presentationCodeableConcept\",\n                \"presentationQuantity\",\n                \"presentationRatio\",\n                \"presentationRatioRange\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass IngredientSubstanceStrengthReferenceStrength(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Strength expressed in terms of a reference substance.\n    Strength expressed in terms of a reference substance. For when the\n    ingredient strength is additionally expressed as equivalent to the strength\n    of some other closely related substance (e.g. salt vs. base). Reference\n    strength represents the strength (quantitative composition) of the active\n    moiety of the active substance. There are situations when the active\n    substance and active moiety are different, therefore both a strength and a\n    reference strength are needed.\n    \"\"\"\n\n    __resource_type__ = \"IngredientSubstanceStrengthReferenceStrength\"\n\n    country: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"country\",\n        title=\"Where the strength range applies\",\n        description=\"The country or countries for which the strength range applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    measurementPoint: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"measurementPoint\",\n        title=\"When strength is measured at a particular point or distance\",\n        description=\"For when strength is measured at a particular point or distance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    measurementPoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_measurementPoint\",\n        title=\"Extension field for ``measurementPoint``.\",\n    )\n\n    strengthQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"strengthQuantity\",\n        title=\"Strength expressed in terms of a reference substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e strength[x]\n            \"one_of_many\": \"strength\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    strengthRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"strengthRatio\",\n        title=\"Strength expressed in terms of a reference substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e strength[x]\n            \"one_of_many\": \"strength\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    strengthRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"strengthRatioRange\",\n        title=\"Strength expressed in terms of a reference substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e strength[x]\n            \"one_of_many\": \"strength\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    substance: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"substance\",\n        title=\"Relevant reference substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``IngredientSubstanceStrengthReferenceStrength`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"substance\",\n            \"strengthRatio\",\n            \"strengthRatioRange\",\n            \"strengthQuantity\",\n            \"measurementPoint\",\n            \"country\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``IngredientSubstanceStrengthReferenceStrength`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"substance\",\n            \"strengthRatio\",\n            \"strengthRatioRange\",\n            \"strengthQuantity\",\n            \"measurementPoint\",\n            \"country\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"strength\": [\"strengthQuantity\", \"strengthRatio\", \"strengthRatioRange\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/insuranceplan.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/InsurancePlan\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass InsurancePlan(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of a Health Insurance product/plan provided by an organization.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlan\"\n\n    administeredBy: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"administeredBy\",\n        title=\"Product administrator\",\n        description=(\n            \"An organization which administer other services such as underwriting, \"\n            \"customer service and/or claims processing on behalf of the health \"\n            \"insurance product owner.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=\"Alternate names\",\n        description=(\n            \"A list of alternate names that the product is known as, or was known \"\n            \"as in the past.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    contact: typing.List[fhirtypes.ExtendedContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Official contact details relevant to the health insurance plan/product\",\n        description=(\n            \"The contact details of communication devices available relevant to the\"\n            \" specific Insurance Plan/Product. This can include addresses, phone \"\n            \"numbers, fax numbers, mobile numbers, email addresses and web sites.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    coverage: typing.List[fhirtypes.InsurancePlanCoverageType] | None = Field(\n        default=None,\n        alias=\"coverage\",\n        title=\"Coverage details\",\n        description=\"Details about the coverage offered by the insurance product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"coverageArea\",\n        title=\"Where product applies\",\n        description=(\n            \"The geographic region in which a health insurance product's benefits \"\n            \"apply.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Technical endpoint\",\n        description=(\n            \"The technical endpoints providing access to services operated for the \"\n            \"health insurance product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for Product\",\n        description=(\n            \"Business identifiers assigned to this health insurance product which \"\n            \"remain constant as the resource is updated and propagates from server \"\n            \"to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Official name\",\n        description=(\n            \"Official name of the health insurance product as designated by the \"\n            \"owner.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    network: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"What networks are Included\",\n        description=\"Reference to the network included in the health insurance product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    ownedBy: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"ownedBy\",\n        title=\"Product issuer\",\n        description=(\n            \"The entity that is providing  the health insurance product and \"\n            \"underwriting the risk.  This is typically an insurance carriers, other\"\n            \" third-party payers, or health plan sponsors comonly referred to as \"\n            \"'payers'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When the product is available\",\n        description=\"The period of time that the health insurance product is available.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    plan: typing.List[fhirtypes.InsurancePlanPlanType] | None = Field(\n        default=None,\n        alias=\"plan\",\n        title=\"Plan details\",\n        description=\"Details about an insurance plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The current state of the health insurance product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of product\",\n        description=\"The kind of health insurance product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"name\",\n            \"alias\",\n            \"period\",\n            \"ownedBy\",\n            \"administeredBy\",\n            \"coverageArea\",\n            \"contact\",\n            \"endpoint\",\n            \"network\",\n            \"coverage\",\n            \"plan\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"name\",\n            \"ownedBy\",\n            \"administeredBy\",\n            \"coverageArea\",\n        ]\n\n\nclass InsurancePlanCoverage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Coverage details.\n    Details about the coverage offered by the insurance product.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanCoverage\"\n\n    benefit: typing.List[fhirtypes.InsurancePlanCoverageBenefitType] = Field(\n        default=...,\n        alias=\"benefit\",\n        title=\"List of benefits\",\n        description=\"Specific benefits under this type of coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    network: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"What networks provide coverage\",\n        description=\"Reference to the network that providing the type of coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of coverage\",\n        description=(\n            \"Type of coverage  (Medical; Dental; Mental Health; Substance Abuse; \"\n            \"Vision; Drug; Short Term; Long Term Care; Hospice; Home Health).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanCoverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"network\", \"benefit\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanCoverage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanCoverageBenefit(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of benefits.\n    Specific benefits under this type of coverage.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanCoverageBenefit\"\n\n    limit: typing.List[fhirtypes.InsurancePlanCoverageBenefitLimitType] | None = Field(\n        default=None,\n        alias=\"limit\",\n        title=\"Benefit limits\",\n        description=\"The specific limits on the benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requirement: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"requirement\",\n        title=\"Referral requirements\",\n        description=\"The referral requirements to have access/coverage for this benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    requirement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requirement\", title=\"Extension field for ``requirement``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of benefit\",\n        description=(\n            \"Type of benefit (primary care; speciality care; inpatient; \" \"outpatient).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanCoverageBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"requirement\", \"limit\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanCoverageBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanCoverageBenefitLimit(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefit limits.\n    The specific limits on the benefit.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanCoverageBenefitLimit\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Benefit limit details\",\n        description=\"The specific limit on the benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Maximum value allowed\",\n        description=(\n            \"The maximum amount of a service item a plan will pay for a covered \"\n            \"benefit.  For examples. wellness visits, or eyeglasses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanCoverageBenefitLimit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"value\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanCoverageBenefitLimit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanPlan(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Plan details.\n    Details about an insurance plan.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanPlan\"\n\n    coverageArea: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"coverageArea\",\n        title=\"Where product applies\",\n        description=(\n            \"The geographic region in which a health insurance plan's benefits \"\n            \"apply.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    generalCost: typing.List[fhirtypes.InsurancePlanPlanGeneralCostType] | None = Field(\n        default=None,\n        alias=\"generalCost\",\n        title=\"Overall costs\",\n        description=\"Overall costs associated with the plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for Product\",\n        description=(\n            \"Business identifiers assigned to this health insurance plan which \"\n            \"remain constant as the resource is updated and propagates from server \"\n            \"to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    network: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"network\",\n        title=\"What networks provide coverage\",\n        description=\"Reference to the network that providing the type of coverage.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    specificCost: typing.List[\n        fhirtypes.InsurancePlanPlanSpecificCostType\n    ] | None = Field(\n        default=None,\n        alias=\"specificCost\",\n        title=\"Specific costs\",\n        description=\"Costs associated with the coverage provided by the product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of plan\",\n        description='Type of plan. For example, \"Platinum\" or \"High Deductable\".',\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanPlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"coverageArea\",\n            \"network\",\n            \"generalCost\",\n            \"specificCost\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanPlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"coverageArea\"]\n\n\nclass InsurancePlanPlanGeneralCost(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Overall costs.\n    Overall costs associated with the plan.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanPlanGeneralCost\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Additional cost information\",\n        description=(\n            \"Additional information about the general costs associated with this \"\n            \"plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    cost: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"cost\",\n        title=\"Cost value\",\n        description=\"Value of the cost.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    groupSize: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"groupSize\",\n        title=\"Number of enrollees\",\n        description=\"Number of participants enrolled in the plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    groupSize__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_groupSize\", title=\"Extension field for ``groupSize``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of cost\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanPlanGeneralCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"groupSize\",\n            \"cost\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanGeneralCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanPlanSpecificCost(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specific costs.\n    Costs associated with the coverage provided by the product.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanPlanSpecificCost\"\n\n    benefit: typing.List[\n        fhirtypes.InsurancePlanPlanSpecificCostBenefitType\n    ] | None = Field(\n        default=None,\n        alias=\"benefit\",\n        title=\"Benefits list\",\n        description=\"List of the specific benefits under this category of benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"category\",\n        title=\"General category of benefit\",\n        description=(\n            \"General category of benefit (Medical; Dental; Vision; Drug; Mental \"\n            \"Health; Substance Abuse; Hospice, Home Health).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanPlanSpecificCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"category\", \"benefit\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanSpecificCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanPlanSpecificCostBenefit(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Benefits list.\n    List of the specific benefits under this category of benefit.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanPlanSpecificCostBenefit\"\n\n    cost: typing.List[\n        fhirtypes.InsurancePlanPlanSpecificCostBenefitCostType\n    ] | None = Field(\n        default=None,\n        alias=\"cost\",\n        title=\"List of the costs\",\n        description=\"List of the costs associated with a specific benefit.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of specific benefit\",\n        description=(\n            \"Type of specific benefit (preventative; primary care office visit; \"\n            \"speciality office visit; hospitalization; emergency room; urgent \"\n            \"care).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanPlanSpecificCostBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"cost\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanSpecificCostBenefit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InsurancePlanPlanSpecificCostBenefitCost(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    List of the costs.\n    List of the costs associated with a specific benefit.\n    \"\"\"\n\n    __resource_type__ = \"InsurancePlanPlanSpecificCostBenefitCost\"\n\n    applicability: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"applicability\",\n        title=\"in-network | out-of-network | other\",\n        description=(\n            \"Whether the cost applies to in-network or out-of-network providers \"\n            \"(in-network; out-of-network; other).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    qualifiers: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"qualifiers\",\n        title=\"Additional information about the cost\",\n        description=(\n            \"Additional information about the cost, such as information about \"\n            \"funding sources (e.g. HSA, HRA, FSA, RRA).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Type of cost\",\n        description=(\n            \"Type of cost (copay; individual cap; family cap; coinsurance; \"\n            \"deductible).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The actual cost value\",\n        description=(\n            \"The actual cost value. (some of the costs may be represented as \"\n            \"percentages rather than currency, e.g. 10% coinsurance).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InsurancePlanPlanSpecificCostBenefitCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"applicability\",\n            \"qualifiers\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InsurancePlanPlanSpecificCostBenefitCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/integer64.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/integer64\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import fhirtypes, primitivetype\n\n\nclass Integer64(primitivetype.PrimitiveType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Primitive Type integer64.\n    A very large whole number\n    \"\"\"\n\n    __resource_type__ = \"integer64\"\n\n    value: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Primitive value for integer64\",\n        description=\"Primitive value for integer64\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Integer64`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Integer64`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n"
  },
  {
    "path": "fhir/resources/inventoryitem.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/InventoryItem\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass InventoryItem(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A functional description of an inventory item used in inventory and supply-\n    related workflows.\n    \"\"\"\n\n    __resource_type__ = \"InventoryItem\"\n\n    association: typing.List[fhirtypes.InventoryItemAssociationType] | None = Field(\n        default=None,\n        alias=\"association\",\n        title=\"Association with other items or products\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    baseUnit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"baseUnit\",\n        title=(\n            \"The base unit of measure - the unit in which the product is used or \"\n            \"counted\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Category or class of the item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    characteristic: typing.List[\n        fhirtypes.InventoryItemCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"Characteristic of the item\",\n        description=\"The descriptive or identifying characteristics of the item.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code designating the specific type of item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.InventoryItemDescriptionType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Descriptive characteristics of the item\",\n        description=\"The descriptive characteristics of the inventory item.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for the inventory item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instance: fhirtypes.InventoryItemInstanceType | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"Instances or occurrences of the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    inventoryStatus: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"inventoryStatus\",\n        title=\"The usage status like recalled, in use, discarded\",\n        description=(\n            \"The usage status e.g. recalled, in use, discarded... This can be used \"\n            \"to indicate that the items have been taken out of inventory, or are in\"\n            \" use, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: typing.List[fhirtypes.InventoryItemNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=(\n            \"The item name(s) - the brand name, or common name, functional name, \"\n            \"generic name or others\"\n        ),\n        description=(\n            \"The item name(s) - the brand name, or common name, functional name, \"\n            \"generic name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    netContent: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"netContent\",\n        title=\"Net content or amount present in the item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    productReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"productReference\",\n        title=\"Link to a product resource used in clinical workflows\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Medication\",\n                \"Device\",\n                \"NutritionProduct\",\n                \"BiologicallyDerivedProduct\",\n            ],\n        },\n    )\n\n    responsibleOrganization: typing.List[\n        fhirtypes.InventoryItemResponsibleOrganizationType\n    ] | None = Field(\n        default=None,\n        alias=\"responsibleOrganization\",\n        title=\"Organization(s) responsible for the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error | unknown\",\n        description=\"Status of the item entry.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InventoryItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"name\",\n            \"responsibleOrganization\",\n            \"description\",\n            \"inventoryStatus\",\n            \"baseUnit\",\n            \"netContent\",\n            \"association\",\n            \"characteristic\",\n            \"instance\",\n            \"productReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InventoryItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"name\",\n            \"inventoryStatus\",\n            \"baseUnit\",\n            \"netContent\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass InventoryItemAssociation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Association with other items or products.\n    \"\"\"\n\n    __resource_type__ = \"InventoryItemAssociation\"\n\n    associationType: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"associationType\",\n        title=\"The type of association between the device and the other item\",\n        description=(\n            \"This attribute defined the type of association when establishing \"\n            \"associations or relations between items, e.g. 'packaged within' or \"\n            \"'used with' or 'to be mixed with.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.RatioType = Field(\n        default=...,\n        alias=\"quantity\",\n        title=\"The quantity of the product in this product\",\n        description=(\n            \"The quantity of the related product in this product - Numerator is the\"\n            \" quantity of the related product. Denominator is the quantity of the \"\n            \"present product. For example a value of 20 means that this product \"\n            \"contains 20 units of the related product; a value of 1:20 means the \"\n            \"inverse - that the contained product contains 20 units of the present \"\n            \"product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatedItem: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"relatedItem\",\n        title=\"The related item or product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"InventoryItem\",\n                \"Medication\",\n                \"MedicationKnowledge\",\n                \"Device\",\n                \"DeviceDefinition\",\n                \"NutritionProduct\",\n                \"BiologicallyDerivedProduct\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InventoryItemAssociation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"associationType\",\n            \"relatedItem\",\n            \"quantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InventoryItemAssociation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"associationType\", \"relatedItem\", \"quantity\"]\n\n\nclass InventoryItemCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Characteristic of the item.\n    The descriptive or identifying characteristics of the item.\n    \"\"\"\n\n    __resource_type__ = \"InventoryItemCharacteristic\"\n\n    characteristicType: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"characteristicType\",\n        title=\"The characteristic that is being defined\",\n        description=\"The type of characteristic that is being defined.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"The value of the attribute\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUrl\", title=\"Extension field for ``valueUrl``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InventoryItemCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"characteristicType\",\n            \"valueString\",\n            \"valueInteger\",\n            \"valueDecimal\",\n            \"valueBoolean\",\n            \"valueUrl\",\n            \"valueDateTime\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueAnnotation\",\n            \"valueAddress\",\n            \"valueDuration\",\n            \"valueCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InventoryItemCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAnnotation\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDuration\",\n                \"valueInteger\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueString\",\n                \"valueUrl\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass InventoryItemDescription(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Descriptive characteristics of the item.\n    The descriptive characteristics of the inventory item.\n    \"\"\"\n\n    __resource_type__ = \"InventoryItemDescription\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of the item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"The language that is used in the item description\",\n        description=(\n            \"The language for the item description, when an item must be described \"\n            \"in different languages and those languages may be authoritative and \"\n            \"not translations of a 'main' language.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InventoryItemDescription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"description\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InventoryItemDescription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InventoryItemInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Instances or occurrences of the product.\n    \"\"\"\n\n    __resource_type__ = \"InventoryItemInstance\"\n\n    expiry: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expiry\",\n        title=\"The expiry date or date and time for the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expiry__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expiry\", title=\"Extension field for ``expiry``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"The identifier for the physical instance, typically a serial number\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"The location that the item is associated with\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    lotNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lotNumber\",\n        title=\"The lot or batch number of the item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lotNumber\", title=\"Extension field for ``lotNumber``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The subject that the item is associated with\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InventoryItemInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"lotNumber\",\n            \"expiry\",\n            \"subject\",\n            \"location\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InventoryItemInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass InventoryItemName(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The item name(s) - the brand name, or common name, functional name, generic\n    name or others.\n    The item name(s) - the brand name, or common name, functional name, generic\n    name.\n    \"\"\"\n\n    __resource_type__ = \"InventoryItemName\"\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"The language used to express the item name\",\n        description=\"The language that the item name is expressed in.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The name or designation of the item\",\n        description=\"The name or designation that the item is given.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    nameType: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"nameType\",\n        title=\"The type of name e.g. 'brand-name', 'functional-name', 'common-name'\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InventoryItemName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"nameType\", \"language\", \"name\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InventoryItemName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"nameType\", \"language\", \"name\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"language\", \"language__ext\"), (\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass InventoryItemResponsibleOrganization(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Organization(s) responsible for the product.\n    \"\"\"\n\n    __resource_type__ = \"InventoryItemResponsibleOrganization\"\n\n    organization: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"organization\",\n        title=\"An organization that is associated with the item\",\n        description=(\n            \"An organization that has an association with the item, e.g. \"\n            \"manufacturer, distributor, responsible, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"role\",\n        title=\"The role of the organization e.g. manufacturer, distributor, or other\",\n        description=\"The role of the organization e.g. manufacturer, distributor, etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InventoryItemResponsibleOrganization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"organization\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InventoryItemResponsibleOrganization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/inventoryreport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/InventoryReport\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass InventoryReport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A report of inventory or stock items.\n    \"\"\"\n\n    __resource_type__ = \"InventoryReport\"\n\n    countType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"countType\",\n        title=\"snapshot | difference\",\n        description=(\n            \"Whether the report is about the current inventory count (snapshot) or \"\n            \"a differential change in inventory (change).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"snapshot\", \"difference\"],\n        },\n    )\n    countType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_countType\", title=\"Extension field for ``countType``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for the report\",\n        description=\"Business identifier for the InventoryReport.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    inventoryListing: typing.List[\n        fhirtypes.InventoryReportInventoryListingType\n    ] | None = Field(\n        default=None,\n        alias=\"inventoryListing\",\n        title=\"An inventory listing section (grouped by any of the attributes)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"A note associated with the InventoryReport\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operationType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"operationType\",\n        title=\"addition | subtraction\",\n        description=\"What type of operation is being performed - addition or subtraction.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    operationTypeReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"operationTypeReason\",\n        title=(\n            \"The reason for this count - regular count, ad-hoc count, new arrivals,\"\n            \" etc\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reportedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"reportedDateTime\",\n        title=\"When the report has been submitted\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    reportedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_reportedDateTime\",\n        title=\"Extension field for ``reportedDateTime``.\",\n    )\n\n    reporter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reporter\",\n        title=\"Who submits the report\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    reportingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"reportingPeriod\",\n        title=\"The period the report refers to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | requested | active | entered-in-error\",\n        description=(\n            \"The status of the inventory check or notification - whether this is \"\n            \"draft (e.g. the report is still pending some updates) or active.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"requested\", \"active\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InventoryReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"countType\",\n            \"operationType\",\n            \"operationTypeReason\",\n            \"reportedDateTime\",\n            \"reporter\",\n            \"reportingPeriod\",\n            \"inventoryListing\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InventoryReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"countType\",\n            \"operationType\",\n            \"operationTypeReason\",\n            \"reportedDateTime\",\n            \"inventoryListing\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"countType\", \"countType__ext\"),\n            (\"reportedDateTime\", \"reportedDateTime__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass InventoryReportInventoryListing(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An inventory listing section (grouped by any of the attributes).\n    \"\"\"\n\n    __resource_type__ = \"InventoryReportInventoryListing\"\n\n    countingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"countingDateTime\",\n        title=\"The date and time when the items were counted\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    countingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_countingDateTime\",\n        title=\"Extension field for ``countingDateTime``.\",\n    )\n\n    item: typing.List[fhirtypes.InventoryReportInventoryListingItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"The item or items in this listing\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    itemStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemStatus\",\n        title=\"The status of the items that are being reported\",\n        description=\"The status of the items.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Location of the inventory items\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InventoryReportInventoryListing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"location\",\n            \"itemStatus\",\n            \"countingDateTime\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InventoryReportInventoryListing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"itemStatus\", \"item\"]\n\n\nclass InventoryReportInventoryListingItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The item or items in this listing.\n    \"\"\"\n\n    __resource_type__ = \"InventoryReportInventoryListingItem\"\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"The inventory category or classification of the items being reported\",\n        description=(\n            \"The inventory category or classification of the items being reported. \"\n            \"This is meant not for defining the product, but for inventory \"\n            \"categories e.g. 'pending recount' or 'damaged'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    item: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"item\",\n        title=\"The code or reference to the item type\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Medication\",\n                \"Device\",\n                \"Medication\",\n                \"NutritionProduct\",\n                \"InventoryItem\",\n                \"BiologicallyDerivedProduct\",\n                \"InventoryItem\",\n            ],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"quantity\",\n        title=\"The quantity of the item or items being reported\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InventoryReportInventoryListingItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"category\", \"quantity\", \"item\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InventoryReportInventoryListingItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"category\", \"quantity\", \"item\"]\n"
  },
  {
    "path": "fhir/resources/invoice.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Invoice\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Invoice(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Invoice containing ChargeItems from an Account.\n    Invoice containing collected ChargeItems from an Account with calculated\n    individual and total price for Billing purpose.\n    \"\"\"\n\n    __resource_type__ = \"Invoice\"\n\n    account: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"account\",\n        title=\"Account that is being balanced\",\n        description=\"Account which is supposed to be balanced with this Invoice.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    cancelledReason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"cancelledReason\",\n        title=\"Reason for cancellation of this Invoice\",\n        description=(\n            \"In case of Invoice cancellation a reason must be given (entered in \"\n            \"error, superseded by corrected invoice etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    cancelledReason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_cancelledReason\",\n        title=\"Extension field for ``cancelledReason``.\",\n    )\n\n    creation: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"creation\",\n        title=\"When posted\",\n        description=\"Date/time(s) of when this Invoice was posted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    creation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_creation\", title=\"Extension field for ``creation``.\"\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"DEPRICATED\",\n        description=\"Depricared by the element below.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for item\",\n        description=(\n            \"Identifier of this Invoice, often used for reference in correspondence\"\n            \" about this invoice or for tracking of payments.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issuer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"issuer\",\n        title=\"Issuing Organization of Invoice\",\n        description=\"The organizationissuing the Invoice.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    lineItem: typing.List[fhirtypes.InvoiceLineItemType] | None = Field(\n        default=None,\n        alias=\"lineItem\",\n        title=\"Line items of this Invoice\",\n        description=(\n            \"Each line item represents one charge for goods and services rendered. \"\n            \"Details such.ofType(date), code and amount are found in the referenced\"\n            \" ChargeItem resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the invoice\",\n        description=(\n            \"Comments made about the invoice by the issuer, subject, or other \"\n            \"participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    participant: typing.List[fhirtypes.InvoiceParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Participant in creation of this Invoice\",\n        description=(\n            \"Indicates who or what performed or participated in the charged \" \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    paymentTerms: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"paymentTerms\",\n        title=\"Payment details\",\n        description=(\n            \"Payment details such as banking details, period of payment, \"\n            \"deductibles, methods of payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    paymentTerms__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_paymentTerms\",\n        title=\"Extension field for ``paymentTerms``.\",\n    )\n\n    periodDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"periodDate\",\n        title=\"Billing date or period\",\n        description=\"Date/time(s) range of services included in this invoice.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e period[x]\n            \"one_of_many\": \"period\",\n            \"one_of_many_required\": False,\n        },\n    )\n    periodDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_periodDate\", title=\"Extension field for ``periodDate``.\"\n    )\n\n    periodPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"periodPeriod\",\n        title=\"Billing date or period\",\n        description=\"Date/time(s) range of services included in this invoice.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e period[x]\n            \"one_of_many\": \"period\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    recipient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"Recipient of this invoice\",\n        description=(\n            \"The individual or Organization responsible for balancing of this \"\n            \"invoice.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | issued | balanced | cancelled | entered-in-error\",\n        description=\"The current state of the Invoice.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"issued\",\n                \"balanced\",\n                \"cancelled\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Recipient(s) of goods and services\",\n        description=(\n            \"The individual or set of individuals receiving the goods and services \"\n            \"billed in this invoice.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    totalGross: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"totalGross\",\n        title=\"Gross total of this Invoice\",\n        description=\"Invoice total, tax included.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    totalNet: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"totalNet\",\n        title=\"Net total of this Invoice\",\n        description=\"Invoice total , taxes excluded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    totalPriceComponent: typing.List[fhirtypes.MonetaryComponentType] | None = Field(\n        default=None,\n        alias=\"totalPriceComponent\",\n        title=\"Components of Invoice total\",\n        description=(\n            \"The total amount for the Invoice may be calculated as the sum of the \"\n            \"line items with surcharges/deductions that apply in certain \"\n            \"conditions.  The priceComponent element can be used to offer \"\n            \"transparency to the recipient of the Invoice of how the total price \"\n            \"was calculated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of Invoice\",\n        description=(\n            \"Type of Invoice depending on domain, realm an usage (e.g. \"\n            \"internal/external, dental, preliminary).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Invoice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"cancelledReason\",\n            \"type\",\n            \"subject\",\n            \"recipient\",\n            \"date\",\n            \"creation\",\n            \"periodDate\",\n            \"periodPeriod\",\n            \"participant\",\n            \"issuer\",\n            \"account\",\n            \"lineItem\",\n            \"totalPriceComponent\",\n            \"totalNet\",\n            \"totalGross\",\n            \"paymentTerms\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Invoice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"recipient\",\n            \"creation\",\n            \"periodDate\",\n            \"periodPeriod\",\n            \"totalNet\",\n            \"totalGross\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"period\": [\"periodDate\", \"periodPeriod\"]}\n        return one_of_many_fields\n\n\nclass InvoiceLineItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Line items of this Invoice.\n    Each line item represents one charge for goods and services rendered.\n    Details such.ofType(date), code and amount are found in the referenced\n    ChargeItem resource.\n    \"\"\"\n\n    __resource_type__ = \"InvoiceLineItem\"\n\n    chargeItemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"chargeItemCodeableConcept\",\n        title=(\n            \"Reference to ChargeItem containing details of this line item or an \"\n            \"inline billing code\"\n        ),\n        description=(\n            \"The ChargeItem contains information such as the billing code, date, \"\n            \"amount etc. If no further details are required for the lineItem, \"\n            \"inline billing codes can be added using the CodeableConcept data type \"\n            \"instead of the Reference.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e chargeItem[x]\n            \"one_of_many\": \"chargeItem\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    chargeItemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"chargeItemReference\",\n        title=(\n            \"Reference to ChargeItem containing details of this line item or an \"\n            \"inline billing code\"\n        ),\n        description=(\n            \"The ChargeItem contains information such as the billing code, date, \"\n            \"amount etc. If no further details are required for the lineItem, \"\n            \"inline billing codes can be added using the CodeableConcept data type \"\n            \"instead of the Reference.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e chargeItem[x]\n            \"one_of_many\": \"chargeItem\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ChargeItem\"],\n        },\n    )\n\n    priceComponent: typing.List[fhirtypes.MonetaryComponentType] | None = Field(\n        default=None,\n        alias=\"priceComponent\",\n        title=\"Components of total line item price\",\n        description=(\n            \"The price for a ChargeItem may be calculated as a base price with \"\n            \"surcharges/deductions that apply in certain conditions. A \"\n            \"ChargeItemDefinition resource that defines the prices, factors and \"\n            \"conditions that apply to a billing code is currently under \"\n            \"development. The priceComponent element can be used to offer \"\n            \"transparency to the recipient of the Invoice as to how the prices have\"\n            \" been calculated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Sequence number of line item\",\n        description=\"Sequence in which the items appear on the invoice.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    servicedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"servicedDate\",\n        title=\"Service data or period\",\n        description=\"Date/time(s) range when this service was delivered or completed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n    servicedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_servicedDate\",\n        title=\"Extension field for ``servicedDate``.\",\n    )\n\n    servicedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"servicedPeriod\",\n        title=\"Service data or period\",\n        description=\"Date/time(s) range when this service was delivered or completed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e serviced[x]\n            \"one_of_many\": \"serviced\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InvoiceLineItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"servicedDate\",\n            \"servicedPeriod\",\n            \"chargeItemReference\",\n            \"chargeItemCodeableConcept\",\n            \"priceComponent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InvoiceLineItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"chargeItem\": [\"chargeItemCodeableConcept\", \"chargeItemReference\"],\n            \"serviced\": [\"servicedDate\", \"servicedPeriod\"],\n        }\n        return one_of_many_fields\n\n\nclass InvoiceParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Participant in creation of this Invoice.\n    Indicates who or what performed or participated in the charged service.\n    \"\"\"\n\n    __resource_type__ = \"InvoiceParticipant\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual who was involved\",\n        description=(\n            \"The device, practitioner, etc. who performed or participated in the \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"Organization\",\n                \"Patient\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Type of involvement in creation of this Invoice\",\n        description=(\n            \"Describes the type of involvement (e.g. transcriptionist, creator \"\n            \"etc.). If the invoice has been created automatically, the Participant \"\n            \"may be a billing engine or another kind of device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``InvoiceParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``InvoiceParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/library.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Library\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Library(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Represents a library of quality improvement components.\n    The Library resource is a general-purpose container for knowledge asset\n    definitions. It can be used to describe and expose existing knowledge\n    assets such as logic libraries and information model descriptions, as well\n    as to describe a collection of knowledge assets.\n    \"\"\"\n\n    __resource_type__ = \"Library\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the library was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    content: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"Contents of the library, either embedded or referenced\",\n        description=(\n            \"The content of the library as an Attachment. The content may be a \"\n            \"reference to a url, or may be directly embedded as a base-64 string. \"\n            \"Either way, the contentType of the attachment determines how to \"\n            \"interpret the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the library and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    dataRequirement: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"dataRequirement\",\n        title=\"What data is referenced by this library\",\n        description=(\n            \"Describes a set of data that must be provided in order to be able to \"\n            \"successfully perform the computations defined by the library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the library was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the library changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the library\",\n        description=(\n            \"A free text natural language description of the library from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the library is expected to be used\",\n        description=(\n            \"The period during which the library content was or is planned to be in\"\n            \" active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"responsible for officially endorsing the content for use in some \"\n            \"setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this library is authored for testing \"\n            \"purposes (or education/evaluation/marketing) and is not intended to be\"\n            \" used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the library\",\n        description=(\n            \"A formal identifier that is used to identify this library when it is \"\n            \"represented in other formats, or referenced in a specification, model,\"\n            \" design or an instance. e.g. CMS or NQF identifiers for a measure \"\n            \"artifact. Note that at least one identifier is required for non-\"\n            \"experimental active artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for library (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the library is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the library was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this library (computer friendly)\",\n        description=(\n            \"A natural language name identifying the library. This name should be \"\n            \"usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    parameter: typing.List[fhirtypes.ParameterDefinitionType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Parameters defined by the library\",\n        description=\"The parameter element defines parameters used by the library.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this library is defined\",\n        description=(\n            \"Explanation of why this library is needed and why it has been designed\"\n            \" as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"primarily responsible for review of some aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this library. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=\"Type of individual the library content is focused on\",\n        description=(\n            \"A code or group definition that describes the intended subject of the \"\n            \"contents of the library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=\"Type of individual the library content is focused on\",\n        description=(\n            \"A code or group definition that describes the intended subject of the \"\n            \"contents of the library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the library\",\n        description=(\n            \"An explanatory or alternate title for the library giving additional \"\n            \"information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this library (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the library.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptive topics related to the content of the library. Topics \"\n            \"provide a high-level categorization of the library that can be useful \"\n            \"for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=(\n            \"logic-library | model-definition | asset-collection | module-\" \"definition\"\n        ),\n        description=(\n            \"Identifies the type of library such as a Logic Library, Model \"\n            \"Definition, Asset Collection, or Module Definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this library, represented as a URI (globally \"\n            \"unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this library when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" library is (or will be) published. This URL can be the target of a \"\n            \"canonical reference. It SHALL remain the same when the library is \"\n            \"stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the library\",\n        description=(\n            \"A detailed description of how the library is used from a clinical \"\n            \"perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate library instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the library\",\n        description=(\n            \"The identifier that is used to identify this version of the library \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the library author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence. To provide a version consistent with the Decision Support \"\n            \"Service specification, use the format Major.Minor.Revision (e.g. \"\n            \"1.0.0). For more information on versioning knowledge assets, refer to \"\n            \"the Decision Support Service specification. Note that a version is \"\n            \"required for non-experimental active artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Library`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"status\",\n            \"experimental\",\n            \"type\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"usage\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"parameter\",\n            \"dataRequirement\",\n            \"content\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Library`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"type\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"content\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"subject\": [\"subjectCodeableConcept\", \"subjectReference\"],\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/linkage.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Linkage\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Linkage(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links records for 'same' item.\n    Identifies two or more records (resource instances) that refer to the same\n    real-world \"occurrence\".\n    \"\"\"\n\n    __resource_type__ = \"Linkage\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this linkage assertion is active or not\",\n        description=(\n            \"Indicates whether the asserted set of linkages are considered to be \"\n            '\"in effect\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who is responsible for linkages\",\n        description=(\n            \"Identifies the user or organization responsible for asserting the \"\n            \"linkages as well as the user or organization who establishes the \"\n            \"context in which the nature of each linkage is evaluated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    item: typing.List[fhirtypes.LinkageItemType] = Field(\n        default=...,\n        alias=\"item\",\n        title=\"Item to be linked\",\n        description=(\n            \"Identifies which record considered as the reference to the same real-\"\n            \"world occurrence as well as how the items should be evaluated within \"\n            \"the collection of linked items.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Linkage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"active\",\n            \"author\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Linkage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"active\",\n            \"author\",\n            \"item\",\n        ]\n\n\nclass LinkageItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Item to be linked.\n    Identifies which record considered as the reference to the same real-world\n    occurrence as well as how the items should be evaluated within the\n    collection of linked items.\n    \"\"\"\n\n    __resource_type__ = \"LinkageItem\"\n\n    resource: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"resource\",\n        title=\"Resource being linked\",\n        description=\"The resource instance being linked as part of the group.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"source | alternate | historical\",\n        description=(\n            'Distinguishes which item is \"source of truth\" (if any) and which items'\n            \" are no longer considered to be current representations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"source\", \"alternate\", \"historical\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``LinkageItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"resource\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``LinkageItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"resource\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/list.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/List\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass List(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A list is a curated collection of resources.\n    A List is a curated collection of resources, for things such as problem\n    lists, allergy lists, facility list, organization list, etc.\n    \"\"\"\n\n    __resource_type__ = \"List\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"What the purpose of this list is\",\n        description=\"This code defines the purpose of the list - why it was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the list was prepared\",\n        description=\"Date list was last reviewed/revised and determined to be 'current'.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    emptyReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"emptyReason\",\n        title=\"Why list is empty\",\n        description=\"If the list is empty, why the list is empty.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Context in which list created\",\n        description=\"The encounter that is the context in which this list was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    entry: typing.List[fhirtypes.ListEntryType] | None = Field(\n        default=None,\n        alias=\"entry\",\n        title=\"Entries in the list\",\n        description=\"Entries in this list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Identifier for the List assigned for business purposes outside the \"\n            \"context of FHIR.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"working | snapshot | changes\",\n        description=(\n            \"How this list was prepared - whether it is a working list that is \"\n            \"suitable for being maintained on an ongoing basis, or if it represents\"\n            \" a snapshot of a list of items from another source, or whether it is a\"\n            \" prepared list where items may be marked as added, modified or \"\n            \"deleted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"working\", \"snapshot\", \"changes\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the list\",\n        description=\"Comments that apply to the overall list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    orderedBy: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"orderedBy\",\n        title=\"What order the list has\",\n        description=\"What order applies to the items in the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Who and/or what defined the list contents (aka Author)\",\n        description=(\n            \"The entity responsible for deciding what the contents of the list \"\n            \"were. Where the list was created by a human, this is the same as the \"\n            \"author of the list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"Device\",\n                \"Organization\",\n                \"RelatedPerson\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"current | retired | entered-in-error\",\n        description=\"Indicates the current state of this list.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"current\", \"retired\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"If all resources have the same subject(s)\",\n        description=(\n            \"The common subject(s) (or patient(s)) of the resources that are in the\"\n            \" list if there is one (or a set of subjects).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Descriptive name for the list\",\n        description=\"A label for the list assigned by the author.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``List`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"mode\",\n            \"title\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"date\",\n            \"source\",\n            \"orderedBy\",\n            \"note\",\n            \"entry\",\n            \"emptyReason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``List`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"mode\",\n            \"title\",\n            \"code\",\n            \"subject\",\n            \"date\",\n            \"source\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ListEntry(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Entries in the list.\n    Entries in this list.\n    \"\"\"\n\n    __resource_type__ = \"ListEntry\"\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When item added to list\",\n        description=\"When this item was added to the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    deleted: bool | None = Field(\n        default=None,\n        alias=\"deleted\",\n        title=\"If this item is actually marked as deleted\",\n        description=\"True if this item is marked as deleted in the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    deleted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_deleted\", title=\"Extension field for ``deleted``.\"\n    )\n\n    flag: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"flag\",\n        title=\"Status/Workflow information about this item\",\n        description=(\n            \"The flag allows the system constructing the list to indicate the role \"\n            \"and significance of the item in the list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    item: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"item\",\n        title=\"Actual entry\",\n        description=\"A reference to the actual resource from which data was derived.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ListEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"flag\",\n            \"deleted\",\n            \"date\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ListEntry`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/location.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Location\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Location(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details and position information for a place.\n    Details and position information for a place where services are provided\n    and resources and participants may be stored, found, contained, or\n    accommodated.\n    \"\"\"\n\n    __resource_type__ = \"Location\"\n\n    address: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Physical location\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=(\n            \"A list of alternate names that the location is known as, or was known \"\n            \"as, in the past\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    characteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"Collection of characteristics (attributes)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ExtendedContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Official contact details for the location\",\n        description=(\n            \"The contact details of communication devices available at the \"\n            \"location. This can include addresses, phone numbers, fax numbers, \"\n            \"mobile numbers, email addresses and web sites.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=(\n            \"Additional details about the location that could be displayed as \"\n            \"further information to identify the location beyond its name\"\n        ),\n        description=(\n            \"Description of the Location, which helps in finding or referencing the\"\n            \" place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to services operated for the \"\n            \"location\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=\"Physical form of the location\",\n        description=(\n            \"Physical form of the location, e.g. building, room, vehicle, road, \"\n            \"virtual.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    hoursOfOperation: typing.List[fhirtypes.AvailabilityType] | None = Field(\n        default=None,\n        alias=\"hoursOfOperation\",\n        title=(\n            \"What days/times during a week is this location usually open (including\"\n            \" exceptions)\"\n        ),\n        description=(\n            \"What days/times during a week is this location usually open, and any \"\n            \"exceptions where the location is not available.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique code or number identifying the location to its users\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"Organization responsible for provisioning and upkeep\",\n        description=(\n            \"The organization responsible for the provisioning and upkeep of the \"\n            \"location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"instance | kind\",\n        description=(\n            \"Indicates whether a resource instance represents a specific location \"\n            \"or a class of locations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"kind\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the location as used by humans\",\n        description=\"Name of the location as used by humans. Does not need to be unique.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    operationalStatus: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"operationalStatus\",\n        title=\"The operational status of the location (typically only for a bed/room)\",\n        description=(\n            \"The operational status covers operation values most relevant to beds \"\n            \"(but can also apply to rooms/units/chairs/etc. such as an isolation \"\n            \"unit/dialysis chair). This typically covers concepts such as \"\n            \"contamination, housekeeping, and other activities like maintenance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    partOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Another Location this one is physically a part of\",\n        description=\"Another Location of which this Location is physically a part of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    position: fhirtypes.LocationPositionType | None = Field(\n        default=None,\n        alias=\"position\",\n        title=\"The absolute geographic location\",\n        description=(\n            \"The absolute geographic location of the Location, expressed using the \"\n            \"WGS84 datum (This is the same co-ordinate system used in KML).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | suspended | inactive\",\n        description=(\n            \"The status property covers the general availability of the resource, \"\n            \"not the current value which may be covered by the operationStatus, or \"\n            \"by a schedule/slots if they are configured for the location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"suspended\", \"inactive\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of function performed\",\n        description=\"Indicates the type of function performed at the location.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    virtualService: typing.List[fhirtypes.VirtualServiceDetailType] | None = Field(\n        default=None,\n        alias=\"virtualService\",\n        title=\"Connection details of a virtual service (e.g. conference call)\",\n        description=(\n            \"Connection details of a virtual service (e.g. shared conference call \"\n            \"facility with dedicated number/details).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Location`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"operationalStatus\",\n            \"name\",\n            \"alias\",\n            \"description\",\n            \"mode\",\n            \"type\",\n            \"contact\",\n            \"address\",\n            \"form\",\n            \"position\",\n            \"managingOrganization\",\n            \"partOf\",\n            \"characteristic\",\n            \"hoursOfOperation\",\n            \"virtualService\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Location`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"operationalStatus\",\n            \"name\",\n            \"description\",\n            \"mode\",\n            \"type\",\n            \"form\",\n            \"managingOrganization\",\n        ]\n\n\nclass LocationPosition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The absolute geographic location.\n    The absolute geographic location of the Location, expressed using the WGS84\n    datum (This is the same co-ordinate system used in KML).\n    \"\"\"\n\n    __resource_type__ = \"LocationPosition\"\n\n    altitude: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"altitude\",\n        title=\"Altitude with WGS84 datum\",\n        description=(\n            \"Altitude. The value domain and the interpretation are the same as for \"\n            \"the text of the altitude element in KML (see notes on Location main \"\n            \"page).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    altitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_altitude\", title=\"Extension field for ``altitude``.\"\n    )\n\n    latitude: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"latitude\",\n        title=\"Latitude with WGS84 datum\",\n        description=(\n            \"Latitude. The value domain and the interpretation are the same as for \"\n            \"the text of the latitude element in KML (see notes on Location main \"\n            \"page).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    latitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_latitude\", title=\"Extension field for ``latitude``.\"\n    )\n\n    longitude: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"longitude\",\n        title=\"Longitude with WGS84 datum\",\n        description=(\n            \"Longitude. The value domain and the interpretation are the same as for\"\n            \" the text of the longitude element in KML (see notes on Location main \"\n            \"page).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    longitude__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_longitude\", title=\"Extension field for ``longitude``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``LocationPosition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"longitude\",\n            \"latitude\",\n            \"altitude\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``LocationPosition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"latitude\", \"latitude__ext\"),\n            (\"longitude\", \"longitude__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/manufactureditemdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ManufacturedItemDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ManufacturedItemDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The definition and characteristics of a medicinal manufactured item, such\n    as a tablet or capsule, as contained in a packaged medicinal product.\n    \"\"\"\n\n    __resource_type__ = \"ManufacturedItemDefinition\"\n\n    component: typing.List[\n        fhirtypes.ManufacturedItemDefinitionComponentType\n    ] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=(\n            \"Physical parts of the manufactured item, that it is intrisically made \"\n            \"from. This is distinct from the ingredients that are part of its \"\n            \"chemical makeup\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=(\n            \"The ingredients of this manufactured item. Only needed if these are \"\n            \"not specified by incoming references from the Ingredient resource\"\n        ),\n        description=(\n            \"The ingredients of this manufactured item. This is only needed if the \"\n            \"ingredients are not specified by incoming references from the \"\n            \"Ingredient resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    manufacturedDoseForm: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"manufacturedDoseForm\",\n        title=\"Dose form as manufactured (before any necessary transformation)\",\n        description=(\n            \"Dose form as manufactured and before any transformation into the \"\n            \"pharmaceutical product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Manufacturer of the item, one of several possible\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    marketingStatus: typing.List[fhirtypes.MarketingStatusType] | None = Field(\n        default=None,\n        alias=\"marketingStatus\",\n        title=(\n            \"Allows specifying that an item is on the market for sale, or that it \"\n            \"is not available, and the dates and locations associated\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A descriptive name applied to this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    property: typing.List[\n        fhirtypes.ManufacturedItemDefinitionPropertyType\n    ] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"General characteristics of this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this item. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    unitOfPresentation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"unitOfPresentation\",\n        title=\"The \\u201creal-world\\u201d units in which the quantity of the item is described\",\n        description=(\n            \"The \\u201creal-world\\u201d units in which the quantity of the manufactured item \"\n            \"is described.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ManufacturedItemDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"name\",\n            \"manufacturedDoseForm\",\n            \"unitOfPresentation\",\n            \"manufacturer\",\n            \"marketingStatus\",\n            \"ingredient\",\n            \"property\",\n            \"component\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ManufacturedItemDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"name\",\n            \"manufacturedDoseForm\",\n            \"unitOfPresentation\",\n            \"manufacturer\",\n            \"marketingStatus\",\n            \"ingredient\",\n            \"property\",\n            \"component\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ManufacturedItemDefinitionComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Physical parts of the manufactured item, that it is intrisically made from.\n    This is distinct from the ingredients that are part of its chemical makeup.\n    \"\"\"\n\n    __resource_type__ = \"ManufacturedItemDefinitionComponent\"\n\n    amount: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=(\n            \"The measurable amount of total quantity of all substances in the \"\n            \"component, expressable in different ways (e.g. by mass or volume)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    component: typing.List[\n        fhirtypes.ManufacturedItemDefinitionComponentType\n    ] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"A component that this component contains or is made from\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    constituent: typing.List[\n        fhirtypes.ManufacturedItemDefinitionComponentConstituentType\n    ] | None = Field(\n        default=None,\n        alias=\"constituent\",\n        title=(\n            \"A reference to a constituent of the manufactured item as a whole, \"\n            \"linked here so that its component location within the item can be \"\n            \"indicated. This not where the item's ingredient are primarily stated \"\n            \"(for which see Ingredient.for or \"\n            \"ManufacturedItemDefinition.ingredient)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    function: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"function\",\n        title=(\n            \"The function of this component within the item e.g. delivers active \"\n            \"ingredient, masks taste\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    property: typing.List[\n        fhirtypes.ManufacturedItemDefinitionPropertyType\n    ] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"General characteristics of this component\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Defining type of the component e.g. shell, layer, ink\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ManufacturedItemDefinitionComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"function\",\n            \"amount\",\n            \"constituent\",\n            \"property\",\n            \"component\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ManufacturedItemDefinitionComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"function\",\n            \"amount\",\n            \"constituent\",\n            \"property\",\n            \"component\",\n        ]\n\n\nclass ManufacturedItemDefinitionComponentConstituent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reference to a constituent of the manufactured item as a whole, linked\n    here so that its component location within the item can be indicated. This\n    not where the item's ingredient are primarily stated (for which see\n    Ingredient.for or ManufacturedItemDefinition.ingredient).\n    \"\"\"\n\n    __resource_type__ = \"ManufacturedItemDefinitionComponentConstituent\"\n\n    amount: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=(\n            \"The measurable amount of the substance, expressable in different ways \"\n            \"(e.g. by mass or volume)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    function: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"The function of this constituent within the component e.g. binder\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    hasIngredient: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"hasIngredient\",\n        title=\"The ingredient that is the constituent of the given component\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Ingredient\"],\n        },\n    )\n\n    location: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=(\n            \"The physical location of the constituent/ingredient within the \"\n            \"component\"\n        ),\n        description=(\n            \"The physical location of the constituent/ingredient within the \"\n            \"component. Example \\u2013 if the component is the bead in the capsule, then\"\n            \" the location would be where the ingredient resides within the product\"\n            \" part \\u2013 intragranular, extra-granular, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ManufacturedItemDefinitionComponentConstituent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"amount\",\n            \"location\",\n            \"function\",\n            \"hasIngredient\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ManufacturedItemDefinitionComponentConstituent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"amount\", \"location\", \"function\", \"hasIngredient\"]\n\n\nclass ManufacturedItemDefinitionProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    General characteristics of this item.\n    \"\"\"\n\n    __resource_type__ = \"ManufacturedItemDefinitionProperty\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"A code expressing the type of characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Binary\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ManufacturedItemDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueMarkdown\",\n            \"valueAttachment\",\n            \"valueReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ManufacturedItemDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueMarkdown\",\n            \"valueAttachment\",\n            \"valueReference\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDate\",\n                \"valueMarkdown\",\n                \"valueQuantity\",\n                \"valueReference\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/marketingstatus.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MarketingStatus\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backbonetype, fhirtypes\n\n\nclass MarketingStatus(backbonetype.BackboneType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The marketing status describes the date when a medicinal product is\n    actually put on the market or the date as of which it is no longer\n    available.\n    \"\"\"\n\n    __resource_type__ = \"MarketingStatus\"\n\n    country: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"country\",\n        title=(\n            \"The country in which the marketing authorization has been granted \"\n            \"shall be specified It should be specified using the ISO 3166 \\u2011 1 \"\n            \"alpha-2 code elements\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dateRange: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"dateRange\",\n        title=(\n            \"The date when the Medicinal Product is placed on the market by the \"\n            \"Marketing Authorization Holder (or where applicable, the \"\n            \"manufacturer/distributor) in a country and/or jurisdiction shall be \"\n            \"provided A complete date consisting of day, month and year shall be \"\n            \"specified using the ISO 8601 date format NOTE \\u201cPlaced on the market\\u201d \"\n            \"refers to the release of the Medicinal Product into the distribution \"\n            \"chain\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=(\n            \"Where a Medicines Regulatory Agency has granted a marketing \"\n            \"authorization for which specific provisions within a jurisdiction \"\n            \"apply, the jurisdiction can be specified using an appropriate \"\n            \"controlled terminology The controlled term and the controlled term \"\n            \"identifier shall be specified\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    restoreDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"restoreDate\",\n        title=(\n            \"The date when the Medicinal Product is placed on the market by the \"\n            \"Marketing Authorization Holder (or where applicable, the \"\n            \"manufacturer/distributor) in a country and/or jurisdiction shall be \"\n            \"provided A complete date consisting of day, month and year shall be \"\n            \"specified using the ISO 8601 date format NOTE \\u201cPlaced on the market\\u201d \"\n            \"refers to the release of the Medicinal Product into the distribution \"\n            \"chain\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    restoreDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_restoreDate\", title=\"Extension field for ``restoreDate``.\"\n    )\n\n    status: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"status\",\n        title=(\n            \"This attribute provides information on the status of the marketing of \"\n            \"the medicinal product See ISO/TS 20443 for more information and \"\n            \"examples\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MarketingStatus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"country\",\n            \"jurisdiction\",\n            \"status\",\n            \"dateRange\",\n            \"restoreDate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MarketingStatus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"country\",\n            \"jurisdiction\",\n            \"status\",\n            \"dateRange\",\n            \"restoreDate\",\n        ]\n"
  },
  {
    "path": "fhir/resources/measure.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Measure\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Measure(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A quality measure definition.\n    The Measure resource provides the definition of a quality measure.\n    \"\"\"\n\n    __resource_type__ = \"Measure\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the measure was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    basis: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"basis\",\n        title=\"Population basis\",\n        description=(\n            \"The population basis specifies the type of elements in the population.\"\n            \" For a subject-based measure, this is boolean (because the subject and\"\n            \" the population basis are the same, and the population criteria define\"\n            \" yes/no values for each individual in the population). For measures \"\n            \"that have a population basis that is different than the subject, this \"\n            \"element specifies the type of the population basis. For example, an \"\n            \"encounter-based measure has a subject of Patient and a population \"\n            \"basis of Encounter, and the population criteria all return lists of \"\n            \"Encounters.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    basis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_basis\", title=\"Extension field for ``basis``.\"\n    )\n\n    clinicalRecommendationStatement: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"clinicalRecommendationStatement\",\n        title=\"Summary of clinical guidelines\",\n        description=(\n            \"Provides a summary of relevant clinical guidelines or other clinical \"\n            \"recommendations supporting the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    clinicalRecommendationStatement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_clinicalRecommendationStatement\",\n        title=\"Extension field for ``clinicalRecommendationStatement``.\",\n    )\n\n    compositeScoring: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"compositeScoring\",\n        title=\"opportunity | all-or-nothing | linear | weighted\",\n        description=(\n            \"If this is a composite measure, the scoring method used to combine the\"\n            \" component measures to determine the composite score.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the measure and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the measure was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the measure changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the measure\",\n        description=(\n            \"A free text natural language description of the measure from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    disclaimer: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"disclaimer\",\n        title=\"Disclaimer for use of the measure or its referenced content\",\n        description=(\n            \"Notices and disclaimers regarding the use of the measure or related to\"\n            \" intellectual property (such as code systems) referenced by the \"\n            \"measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    disclaimer__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disclaimer\", title=\"Extension field for ``disclaimer``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the measure is expected to be used\",\n        description=(\n            \"The period during which the measure content was or is planned to be in\"\n            \" active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"responsible for officially endorsing the content for use in some \"\n            \"setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this measure is authored for testing \"\n            \"purposes (or education/evaluation/marketing) and is not intended to be\"\n            \" used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    group: typing.List[fhirtypes.MeasureGroupType] | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"Population criteria group\",\n        description=\"A group of population criteria for the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    guidance: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"guidance\",\n        title=\"Additional guidance for implementers (deprecated)\",\n        description=(\n            \"Additional guidance for the measure including how it can be used in a \"\n            \"clinical context, and the intent of the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    guidance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_guidance\", title=\"Extension field for ``guidance``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the measure\",\n        description=(\n            \"A formal identifier that is used to identify this measure when it is \"\n            \"represented in other formats, or referenced in a specification, model,\"\n            \" design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    improvementNotation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"improvementNotation\",\n        title=\"increase | decrease\",\n        description=(\n            \"Information on whether an increase or decrease in score is the \"\n            \"preferred result (e.g., a higher score indicates better quality OR a \"\n            \"lower score indicates better quality OR quality is within a range).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for measure (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the measure is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the measure was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    library: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the measure\",\n        description=(\n            \"A reference to a Library resource containing the formal logic used by \"\n            \"the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n    library__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_library\", title=\"Extension field for ``library``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this measure (computer friendly)\",\n        description=(\n            \"A natural language name identifying the measure. This name should be \"\n            \"usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this measure is defined\",\n        description=(\n            \"Explanation of why this measure is needed and why it has been designed\"\n            \" as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    rateAggregation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"rateAggregation\",\n        title=\"How is rate aggregation performed for this measure\",\n        description=(\n            \"Describes how to combine the information calculated, based on logic in\"\n            \" each of several populations, into one summarized result.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rateAggregation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_rateAggregation\",\n        title=\"Extension field for ``rateAggregation``.\",\n    )\n\n    rationale: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"rationale\",\n        title=\"Detailed description of why the measure exists\",\n        description=(\n            \"Provides a succinct statement of the need for the measure. Usually \"\n            \"includes statements pertaining to importance criterion: impact, gap in\"\n            \" care, and evidence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rationale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rationale\", title=\"Extension field for ``rationale``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"primarily responsible for review of some aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    riskAdjustment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"riskAdjustment\",\n        title=\"How risk adjustment is applied for this measure\",\n        description=(\n            \"A description of the risk adjustment factors that may impact the \"\n            \"resulting score for the measure and how they may be accounted for when\"\n            \" computing and reporting measure results.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    riskAdjustment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_riskAdjustment\",\n        title=\"Extension field for ``riskAdjustment``.\",\n    )\n\n    scoring: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"scoring\",\n        title=\"proportion | ratio | continuous-variable | cohort\",\n        description=(\n            \"Indicates how the calculation is performed for the measure, including \"\n            \"proportion, ratio, continuous-variable, and cohort. The value set is \"\n            \"extensible, allowing additional measure scoring types to be \"\n            \"represented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    scoringUnit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"scoringUnit\",\n        title=\"What units?\",\n        description=(\n            \"Defines the expected units of measure for the measure score. This \"\n            \"element SHOULD be specified as a UCUM unit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this measure. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects for the measure. If this element is not \"\n            \"provided, a Patient subject is assumed, but the subject of the measure\"\n            \" can be anything.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects for the measure. If this element is not \"\n            \"provided, a Patient subject is assumed, but the subject of the measure\"\n            \" can be anything.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the measure\",\n        description=(\n            \"An explanatory or alternate title for the measure giving additional \"\n            \"information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    supplementalData: typing.List[fhirtypes.MeasureSupplementalDataType] | None = Field(\n        default=None,\n        alias=\"supplementalData\",\n        title=\"What other data should be reported with the measure\",\n        description=(\n            \"The supplemental data criteria for the measure report, specified as \"\n            \"either the name of a valid CQL expression within a referenced library,\"\n            \" or a valid FHIR Resource Path.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    term: typing.List[fhirtypes.MeasureTermType] | None = Field(\n        default=None,\n        alias=\"term\",\n        title=\"Defined terms used in the measure documentation\",\n        description=\"Provides a description of an individual term used within the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this measure (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=(\n            \"The category of the measure, such as Education, Treatment, Assessment,\"\n            \" etc\"\n        ),\n        description=(\n            \"Descriptive topics related to the content of the measure. Topics \"\n            \"provide a high-level categorization grouping types of measures that \"\n            \"can be useful for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"process | outcome | structure | patient-reported-outcome | composite\",\n        description=(\n            \"Indicates whether the measure is used to examine a process, an outcome\"\n            \" over time, a patient-reported outcome, or a structure measure such as\"\n            \" utilization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this measure, represented as a URI (globally \"\n            \"unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this measure when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" measure is (or will be) published. This URL can be the target of a \"\n            \"canonical reference. It SHALL remain the same when the measure is \"\n            \"stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the measure\",\n        description=(\n            \"A detailed description, from a clinical perspective, of how the \"\n            \"measure is used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate measure instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the measure\",\n        description=(\n            \"The identifier that is used to identify this version of the measure \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the measure author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence. To provide a version consistent with the Decision Support \"\n            \"Service specification, use the format Major.Minor.Revision (e.g. \"\n            \"1.0.0). For more information on versioning knowledge assets, refer to \"\n            \"the Decision Support Service specification. Note that a version is \"\n            \"required for non-experimental active artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Measure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"status\",\n            \"experimental\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"basis\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"usage\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"library\",\n            \"disclaimer\",\n            \"scoring\",\n            \"scoringUnit\",\n            \"compositeScoring\",\n            \"type\",\n            \"riskAdjustment\",\n            \"rateAggregation\",\n            \"rationale\",\n            \"clinicalRecommendationStatement\",\n            \"improvementNotation\",\n            \"term\",\n            \"guidance\",\n            \"group\",\n            \"supplementalData\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Measure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"basis\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"disclaimer\",\n            \"scoring\",\n            \"scoringUnit\",\n            \"compositeScoring\",\n            \"type\",\n            \"riskAdjustment\",\n            \"rateAggregation\",\n            \"rationale\",\n            \"clinicalRecommendationStatement\",\n            \"improvementNotation\",\n            \"guidance\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"subject\": [\"subjectCodeableConcept\", \"subjectReference\"],\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"],\n        }\n        return one_of_many_fields\n\n\nclass MeasureGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Population criteria group.\n    A group of population criteria for the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureGroup\"\n\n    basis: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"basis\",\n        title=\"Population basis\",\n        description=(\n            \"The population basis specifies the type of elements in the population.\"\n            \" For a subject-based measure, this is boolean (because the subject and\"\n            \" the population basis are the same, and the population criteria define\"\n            \" yes/no values for each individual in the population). For measures \"\n            \"that have a population basis that is different than the subject, this \"\n            \"element specifies the type of the population basis. For example, an \"\n            \"encounter-based measure has a subject of Patient and a population \"\n            \"basis of Encounter, and the population criteria all return lists of \"\n            \"Encounters.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    basis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_basis\", title=\"Extension field for ``basis``.\"\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Meaning of the group\",\n        description=(\n            \"Indicates a meaning for the group. This can be as simple as a unique \"\n            \"identifier, or it can establish meaning in a broader context by \"\n            \"drawing from a terminology, allowing groups to be correlated across \"\n            \"measures.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Summary description\",\n        description=\"The human readable description of this population group.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    improvementNotation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"improvementNotation\",\n        title=\"increase | decrease\",\n        description=(\n            \"Information on whether an increase or decrease in score is the \"\n            \"preferred result (e.g., a higher score indicates better quality OR a \"\n            \"lower score indicates better quality OR quality is within a range).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    library: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the measure group\",\n        description=(\n            \"A reference to a Library resource containing the formal logic used by \"\n            \"the measure group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n    library__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_library\", title=\"Extension field for ``library``.\"\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Unique id for group in measure\",\n        description=(\n            \"An identifier that is unique within the Measure allowing linkage to \"\n            \"the equivalent item in a MeasureReport resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    population: typing.List[fhirtypes.MeasureGroupPopulationType] | None = Field(\n        default=None,\n        alias=\"population\",\n        title=\"Population criteria\",\n        description=\"A population criteria for the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rateAggregation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"rateAggregation\",\n        title=\"How is rate aggregation performed for this measure\",\n        description=(\n            \"Describes how to combine the information calculated, based on logic in\"\n            \" each of several populations, into one summarized result.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    rateAggregation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_rateAggregation\",\n        title=\"Extension field for ``rateAggregation``.\",\n    )\n\n    scoring: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"scoring\",\n        title=\"proportion | ratio | continuous-variable | cohort\",\n        description=(\n            \"Indicates how the calculation is performed for the measure, including \"\n            \"proportion, ratio, continuous-variable, and cohort. The value set is \"\n            \"extensible, allowing additional measure scoring types to be \"\n            \"represented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    scoringUnit: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"scoringUnit\",\n        title=\"What units?\",\n        description=(\n            \"Defines the expected units of measure for the measure score. This \"\n            \"element SHOULD be specified as a UCUM unit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    stratifier: typing.List[fhirtypes.MeasureGroupStratifierType] | None = Field(\n        default=None,\n        alias=\"stratifier\",\n        title=\"Stratifier criteria for the measure\",\n        description=(\n            \"The stratifier criteria for the measure report, specified as either \"\n            \"the name of a valid CQL expression defined within a referenced library\"\n            \" or a valid FHIR Resource Path.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects for the measure. If this element is not \"\n            \"provided, a Patient subject is assumed, but the subject of the measure\"\n            \" can be anything.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=(\n            \"E.g. Patient, Practitioner, RelatedPerson, Organization, Location, \"\n            \"Device\"\n        ),\n        description=(\n            \"The intended subjects for the measure. If this element is not \"\n            \"provided, a Patient subject is assumed, but the subject of the measure\"\n            \" can be anything.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"process | outcome | structure | patient-reported-outcome | composite\",\n        description=(\n            \"Indicates whether the measure is used to examine a process, an outcome\"\n            \" over time, a patient-reported outcome, or a structure measure such as\"\n            \" utilization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"code\",\n            \"description\",\n            \"type\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"basis\",\n            \"scoring\",\n            \"scoringUnit\",\n            \"rateAggregation\",\n            \"improvementNotation\",\n            \"library\",\n            \"population\",\n            \"stratifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"basis\",\n            \"scoring\",\n            \"scoringUnit\",\n            \"rateAggregation\",\n            \"improvementNotation\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"subject\": [\"subjectCodeableConcept\", \"subjectReference\"]}\n        return one_of_many_fields\n\n\nclass MeasureGroupPopulation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Population criteria.\n    A population criteria for the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureGroupPopulation\"\n\n    aggregateMethod: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"aggregateMethod\",\n        title=(\n            \"Aggregation method for a measure score (e.g. sum, average, median, \"\n            \"minimum, maximum, count)\"\n        ),\n        description=(\n            \"Specifies which method should be used to aggregate measure observation\"\n            \" values. For most scoring types, this is implied by scoring (e.g. a \"\n            \"proportion measure counts members of the populations). For continuous \"\n            \"variables, however, this information must be specified to ensure \"\n            \"correct calculation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"initial-population | numerator | numerator-exclusion | denominator | \"\n            \"denominator-exclusion | denominator-exception | measure-population | \"\n            \"measure-population-exclusion | measure-observation\"\n        ),\n        description=\"The type of population criteria.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    criteria: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"criteria\",\n        title=\"The criteria that defines this population\",\n        description=(\n            \"An expression that specifies the criteria for the population, \"\n            \"typically the name of an expression in a library.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The human readable description of this population criteria\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    groupDefinition: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"groupDefinition\",\n        title=\"A group resource that defines this population\",\n        description=(\n            \"A Group resource that defines this population as a set of \"\n            \"characteristics.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    inputPopulationId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"inputPopulationId\",\n        title=\"Which population\",\n        description=(\n            \"The id of a population element in this measure that provides the input\"\n            \" for this population criteria. In most cases, the scoring structure of\"\n            \" the measure implies specific relationships (e.g. the Numerator uses \"\n            \"the Denominator as the source in a proportion scoring). In some cases,\"\n            \" however, multiple possible choices exist and must be resolved \"\n            \"explicitly. For example in a ratio measure with multiple initial \"\n            \"populations, the denominator must specify which population should be \"\n            \"used as the starting point.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    inputPopulationId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_inputPopulationId\",\n        title=\"Extension field for ``inputPopulationId``.\",\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Unique id for population in measure\",\n        description=(\n            \"An identifier that is unique within the Measure allowing linkage to \"\n            \"the equivalent population in a MeasureReport resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureGroupPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"code\",\n            \"description\",\n            \"criteria\",\n            \"groupDefinition\",\n            \"inputPopulationId\",\n            \"aggregateMethod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureGroupPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureGroupStratifier(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratifier criteria for the measure.\n    The stratifier criteria for the measure report, specified as either the\n    name of a valid CQL expression defined within a referenced library or a\n    valid FHIR Resource Path.\n    \"\"\"\n\n    __resource_type__ = \"MeasureGroupStratifier\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Meaning of the stratifier\",\n        description=(\n            \"Indicates a meaning for the stratifier. This can be as simple as a \"\n            \"unique identifier, or it can establish meaning in a broader context by\"\n            \" drawing from a terminology, allowing stratifiers to be correlated \"\n            \"across measures.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    component: typing.List[\n        fhirtypes.MeasureGroupStratifierComponentType\n    ] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"Stratifier criteria component for the measure\",\n        description=(\n            \"A component of the stratifier criteria for the measure report, \"\n            \"specified as either the name of a valid CQL expression defined within \"\n            \"a referenced library or a valid FHIR Resource Path.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    criteria: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"criteria\",\n        title=\"How the measure should be stratified\",\n        description=(\n            \"An expression that specifies the criteria for the stratifier. This is \"\n            \"typically the name of an expression defined within a referenced \"\n            \"library, but it may also be a path to a stratifier element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The human readable description of this stratifier\",\n        description=\"The human readable description of this stratifier criteria.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    groupDefinition: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"groupDefinition\",\n        title=\"A group resource that defines this population\",\n        description=(\n            \"A Group resource that defines this population as a set of \"\n            \"characteristics.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Unique id for stratifier in measure\",\n        description=(\n            \"An identifier that is unique within the Measure allowing linkage to \"\n            \"the equivalent item in a MeasureReport resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureGroupStratifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"code\",\n            \"description\",\n            \"criteria\",\n            \"groupDefinition\",\n            \"component\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureGroupStratifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureGroupStratifierComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratifier criteria component for the measure.\n    A component of the stratifier criteria for the measure report, specified as\n    either the name of a valid CQL expression defined within a referenced\n    library or a valid FHIR Resource Path.\n    \"\"\"\n\n    __resource_type__ = \"MeasureGroupStratifierComponent\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Meaning of the stratifier component\",\n        description=(\n            \"Indicates a meaning for the stratifier component. This can be as \"\n            \"simple as a unique identifier, or it can establish meaning in a \"\n            \"broader context by drawing from a terminology, allowing stratifiers to\"\n            \" be correlated across measures.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    criteria: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"criteria\",\n        title=\"Component of how the measure should be stratified\",\n        description=(\n            \"An expression that specifies the criteria for this component of the \"\n            \"stratifier. This is typically the name of an expression defined within\"\n            \" a referenced library, but it may also be a path to a stratifier \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The human readable description of this stratifier component\",\n        description=\"The human readable description of this stratifier criteria component.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    groupDefinition: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"groupDefinition\",\n        title=\"A group resource that defines this population\",\n        description=(\n            \"A Group resource that defines this population as a set of \"\n            \"characteristics.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Unique id for stratifier component in measure\",\n        description=(\n            \"An identifier that is unique within the Measure allowing linkage to \"\n            \"the equivalent item in a MeasureReport resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureGroupStratifierComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"code\",\n            \"description\",\n            \"criteria\",\n            \"groupDefinition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureGroupStratifierComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureSupplementalData(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What other data should be reported with the measure.\n    The supplemental data criteria for the measure report, specified as either\n    the name of a valid CQL expression within a referenced library, or a valid\n    FHIR Resource Path.\n    \"\"\"\n\n    __resource_type__ = \"MeasureSupplementalData\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Meaning of the supplemental data\",\n        description=(\n            \"Indicates a meaning for the supplemental data. This can be as simple \"\n            \"as a unique identifier, or it can establish meaning in a broader \"\n            \"context by drawing from a terminology, allowing supplemental data to \"\n            \"be correlated across measures.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    criteria: fhirtypes.ExpressionType = Field(\n        default=...,\n        alias=\"criteria\",\n        title=\"Expression describing additional data to be reported\",\n        description=(\n            \"The criteria for the supplemental data. This is typically the name of \"\n            \"a valid expression defined within a referenced library, but it may \"\n            \"also be a path to a specific data element. The criteria defines the \"\n            \"data to be returned for this element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The human readable description of this supplemental data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Unique id for supplementalData in measure\",\n        description=(\n            \"An identifier that is unique within the Measure allowing linkage to \"\n            \"the equivalent item in a MeasureReport resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    usage: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"supplemental-data | risk-adjustment-factor\",\n        description=(\n            \"An indicator of the intended usage for the supplemental data element. \"\n            \"Supplemental data indicates the data is additional information \"\n            \"requested to augment the measure information. Risk adjustment factor \"\n            \"indicates the data is additional information used to calculate risk \"\n            \"adjustment factors when applying a risk model to the measure \"\n            \"calculation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureSupplementalData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"code\",\n            \"usage\",\n            \"description\",\n            \"criteria\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureSupplementalData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureTerm(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defined terms used in the measure documentation.\n    Provides a description of an individual term used within the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureTerm\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"What term?\",\n        description=\"A codeable representation of the defined term.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Meaning of the term\",\n        description=\"Provides a definition for the term as used within the measure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureTerm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"definition\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureTerm`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/measurereport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MeasureReport\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MeasureReport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Results of a measure evaluation.\n    The MeasureReport resource contains the results of the calculation of a\n    measure; and optionally a reference to the resources involved in that\n    calculation.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReport\"\n\n    dataUpdateType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"dataUpdateType\",\n        title=\"incremental | snapshot\",\n        description=(\n            \"Indicates whether the data submitted in a data-exchange report \"\n            \"represents a snapshot or incremental update. A snapshot update \"\n            \"replaces all previously submitted data for the receiver, whereas an \"\n            \"incremental update represents only updated and/or changed data and \"\n            \"should be applied as a differential update to the existing submitted \"\n            \"data for the receiver.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"incremental\", \"snapshot\"],\n        },\n    )\n    dataUpdateType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_dataUpdateType\",\n        title=\"Extension field for ``dataUpdateType``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When the measure was calculated\",\n        description=\"The date this measure was calculated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    evaluatedResource: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"evaluatedResource\",\n        title=\"What data was used to calculate the measure score\",\n        description=(\n            \"Evaluated resources are used to capture what data was involved in the \"\n            \"calculation of a measure. This usage is only allowed for individual \"\n            \"reports to ensure that the size of the MeasureReport resource is \"\n            \"bounded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    group: typing.List[fhirtypes.MeasureReportGroupType] | None = Field(\n        default=None,\n        alias=\"group\",\n        title=\"Measure results for each group\",\n        description=(\n            \"The results of the calculation, one for each population group in the \"\n            \"measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the MeasureReport\",\n        description=(\n            \"A formal identifier that is used to identify this MeasureReport when \"\n            \"it is represented in other formats or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    improvementNotation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"improvementNotation\",\n        title=\"increase | decrease\",\n        description=(\n            \"Whether improvement in the measure is noted by an increase or decrease\"\n            \" in the measure score.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    inputParameters: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"inputParameters\",\n        title=\"What parameters were provided to the report\",\n        description=(\n            \"A reference to a Parameters resource (typically represented using a \"\n            \"contained resource) that represents any input parameters that were \"\n            \"provided to the operation that generated the report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Parameters\"],\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the reported data is from\",\n        description=\"A reference to the location for which the data is being reported.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    measure: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"measure\",\n        title=\"What measure was calculated\",\n        description=\"A reference to the Measure that was calculated to produce this report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Measure\"],\n        },\n    )\n    measure__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_measure\", title=\"Extension field for ``measure``.\"\n    )\n\n    period: fhirtypes.PeriodType = Field(\n        default=...,\n        alias=\"period\",\n        title=\"What period the report covers\",\n        description=\"The reporting period for which the report was calculated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reporter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reporter\",\n        title=\"Who is reporting the data\",\n        description=\"The individual or organization that is reporting the data.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Group\",\n            ],\n        },\n    )\n\n    reportingVendor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reportingVendor\",\n        title=\"What vendor prepared the data\",\n        description=(\n            \"A reference to the vendor who queried the data, calculated results \"\n            \"and/or generated the report. The \\u2018reporting vendor\\u2019 is intended to \"\n            \"represent the submitting entity when it is not the same as the \"\n            \"reporting entity. This extension is used when the Receiver is \"\n            \"interested in getting vendor information in the report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    scoring: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"scoring\",\n        title=\"What scoring method (e.g. proportion, ratio, continuous-variable)\",\n        description=(\n            \"Indicates how the calculation is performed for the measure, including \"\n            \"proportion, ratio, continuous-variable, and cohort. The value set is \"\n            \"extensible, allowing additional measure scoring types to be \"\n            \"represented. It is expected to be the same as the scoring element on \"\n            \"the referenced Measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"complete | pending | error\",\n        description=(\n            \"The MeasureReport status. No data will be available until the \"\n            \"MeasureReport status is complete.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"complete\", \"pending\", \"error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"What individual(s) the report is for\",\n        description=(\n            \"Optional subject identifying the individual or individuals the report \"\n            \"is for.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"Device\",\n                \"Group\",\n                \"HealthcareService\",\n                \"Location\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    supplementalData: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supplementalData\",\n        title=\"Additional information collected for the report\",\n        description=(\n            \"A reference to a Resource that represents additional information \"\n            \"collected for the report. If the value of the supplemental data is not\"\n            \" a Resource (i.e. evaluating the supplementalData expression for this \"\n            \"case in the measure results in a value that is not a FHIR Resource), \"\n            \"it is reported as a reference to a contained Observation resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"individual | subject-list | summary | data-exchange\",\n        description=(\n            \"The type of measure report. This may be an individual report, which \"\n            \"provides the score for the measure for an individual member of the \"\n            \"population; a subject-listing, which returns the list of members that \"\n            \"meet the various criteria in the measure; a summary report, which \"\n            \"returns a population count for each of the criteria in the measure; or\"\n            \" a data-collection, which enables the MeasureReport to be used to \"\n            \"exchange the data-of-interest for a quality measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"individual\", \"subject-list\", \"summary\", \"data-exchange\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"dataUpdateType\",\n            \"measure\",\n            \"subject\",\n            \"date\",\n            \"reporter\",\n            \"reportingVendor\",\n            \"location\",\n            \"period\",\n            \"inputParameters\",\n            \"scoring\",\n            \"improvementNotation\",\n            \"group\",\n            \"supplementalData\",\n            \"evaluatedResource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"type\",\n            \"dataUpdateType\",\n            \"measure\",\n            \"subject\",\n            \"date\",\n            \"reporter\",\n            \"period\",\n            \"scoring\",\n            \"improvementNotation\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass MeasureReportGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Measure results for each group.\n    The results of the calculation, one for each population group in the\n    measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroup\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Meaning of the group\",\n        description=(\n            \"The meaning of the population group as defined in the measure \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific group from Measure\",\n        description=(\n            \"The group from the Measure that corresponds to this group in the \"\n            \"MeasureReport resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    measureScoreCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"measureScoreCodeableConcept\",\n        title=\"What score this group achieved\",\n        description=(\n            \"The measure score for this population group, calculated as appropriate\"\n            \" for the measure type and scoring method, and based on the contents of\"\n            \" the populations defined in the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e measureScore[x]\n            \"one_of_many\": \"measureScore\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    measureScoreDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"measureScoreDateTime\",\n        title=\"What score this group achieved\",\n        description=(\n            \"The measure score for this population group, calculated as appropriate\"\n            \" for the measure type and scoring method, and based on the contents of\"\n            \" the populations defined in the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e measureScore[x]\n            \"one_of_many\": \"measureScore\",\n            \"one_of_many_required\": False,\n        },\n    )\n    measureScoreDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_measureScoreDateTime\",\n        title=\"Extension field for ``measureScoreDateTime``.\",\n    )\n\n    measureScoreDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"measureScoreDuration\",\n        title=\"What score this group achieved\",\n        description=(\n            \"The measure score for this population group, calculated as appropriate\"\n            \" for the measure type and scoring method, and based on the contents of\"\n            \" the populations defined in the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e measureScore[x]\n            \"one_of_many\": \"measureScore\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    measureScorePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"measureScorePeriod\",\n        title=\"What score this group achieved\",\n        description=(\n            \"The measure score for this population group, calculated as appropriate\"\n            \" for the measure type and scoring method, and based on the contents of\"\n            \" the populations defined in the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e measureScore[x]\n            \"one_of_many\": \"measureScore\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    measureScoreQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"measureScoreQuantity\",\n        title=\"What score this group achieved\",\n        description=(\n            \"The measure score for this population group, calculated as appropriate\"\n            \" for the measure type and scoring method, and based on the contents of\"\n            \" the populations defined in the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e measureScore[x]\n            \"one_of_many\": \"measureScore\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    measureScoreRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"measureScoreRange\",\n        title=\"What score this group achieved\",\n        description=(\n            \"The measure score for this population group, calculated as appropriate\"\n            \" for the measure type and scoring method, and based on the contents of\"\n            \" the populations defined in the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e measureScore[x]\n            \"one_of_many\": \"measureScore\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    population: typing.List[fhirtypes.MeasureReportGroupPopulationType] | None = Field(\n        default=None,\n        alias=\"population\",\n        title=\"The populations in the group\",\n        description=(\n            \"The populations that make up the population group, one for each type \"\n            \"of population appropriate for the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    stratifier: typing.List[fhirtypes.MeasureReportGroupStratifierType] | None = Field(\n        default=None,\n        alias=\"stratifier\",\n        title=\"Stratification results\",\n        description=(\n            \"When a measure includes multiple stratifiers, there will be a \"\n            \"stratifier group for each stratifier defined by the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"What individual(s) the report is for\",\n        description=(\n            \"Optional subject identifying the individual or individuals the report \"\n            \"is for.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"Device\",\n                \"Group\",\n                \"HealthcareService\",\n                \"Location\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"code\",\n            \"subject\",\n            \"population\",\n            \"measureScoreQuantity\",\n            \"measureScoreDateTime\",\n            \"measureScoreCodeableConcept\",\n            \"measureScorePeriod\",\n            \"measureScoreRange\",\n            \"measureScoreDuration\",\n            \"stratifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"code\",\n            \"subject\",\n            \"measureScoreQuantity\",\n            \"measureScoreDateTime\",\n            \"measureScoreCodeableConcept\",\n            \"measureScorePeriod\",\n            \"measureScoreRange\",\n            \"measureScoreDuration\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"measureScore\": [\n                \"measureScoreCodeableConcept\",\n                \"measureScoreDateTime\",\n                \"measureScoreDuration\",\n                \"measureScorePeriod\",\n                \"measureScoreQuantity\",\n                \"measureScoreRange\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass MeasureReportGroupPopulation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The populations in the group.\n    The populations that make up the population group, one for each type of\n    population appropriate for the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupPopulation\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"initial-population | numerator | numerator-exclusion | denominator | \"\n            \"denominator-exclusion | denominator-exception | measure-population | \"\n            \"measure-population-exclusion | measure-observation\"\n        ),\n        description=\"The type of the population.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    count: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Size of the population\",\n        description=\"The number of members of the population.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific population from Measure\",\n        description=(\n            \"The population from the Measure that corresponds to this population in\"\n            \" the MeasureReport resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    subjectReport: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subjectReport\",\n        title=\"For subject-list reports, a subject result in this population\",\n        description=(\n            \"A reference to an individual level MeasureReport resource for a member\"\n            \" of the population.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MeasureReport\"],\n        },\n    )\n\n    subjectResults: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectResults\",\n        title=\"For subject-list reports, the subject results in this population\",\n        description=(\n            \"This element refers to a List of individual level MeasureReport \"\n            \"resources, one for each subject in this population.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"List\"],\n        },\n    )\n\n    subjects: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjects\",\n        title=\"What individual(s) in the population\",\n        description=(\n            \"Optional Group identifying the individuals that make up the \" \"population.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"code\",\n            \"count\",\n            \"subjectResults\",\n            \"subjectReport\",\n            \"subjects\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\"]\n\n\nclass MeasureReportGroupStratifier(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratification results.\n    When a measure includes multiple stratifiers, there will be a stratifier\n    group for each stratifier defined by the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupStratifier\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"What stratifier of the group\",\n        description=\"The meaning of this stratifier, as defined in the measure definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific stratifier from Measure\",\n        description=(\n            \"The stratifier from the Measure that corresponds to this stratifier in\"\n            \" the MeasureReport resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    stratum: typing.List[\n        fhirtypes.MeasureReportGroupStratifierStratumType\n    ] | None = Field(\n        default=None,\n        alias=\"stratum\",\n        title=(\n            \"Stratum results, one for each unique value, or set of values, in the \"\n            \"stratifier, or stratifier components\"\n        ),\n        description=(\n            \"This element contains the results for a single stratum within the \"\n            \"stratifier. For example, when stratifying on administrative gender, \"\n            \"there will be four strata, one for each possible gender value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupStratifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"linkId\", \"code\", \"stratum\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifier`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MeasureReportGroupStratifierStratum(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratum results, one for each unique value, or set of values, in the\n    stratifier, or stratifier components.\n    This element contains the results for a single stratum within the\n    stratifier. For example, when stratifying on administrative gender, there\n    will be four strata, one for each possible gender value.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupStratifierStratum\"\n\n    component: typing.List[\n        fhirtypes.MeasureReportGroupStratifierStratumComponentType\n    ] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"Stratifier component values\",\n        description=\"A stratifier component value.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    measureScoreCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"measureScoreCodeableConcept\",\n        title=\"What score this stratum achieved\",\n        description=(\n            \"The measure score for this stratum, calculated as appropriate for the \"\n            \"measure type and scoring method, and based on only the members of this\"\n            \" stratum.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e measureScore[x]\n            \"one_of_many\": \"measureScore\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    measureScoreDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"measureScoreDateTime\",\n        title=\"What score this stratum achieved\",\n        description=(\n            \"The measure score for this stratum, calculated as appropriate for the \"\n            \"measure type and scoring method, and based on only the members of this\"\n            \" stratum.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e measureScore[x]\n            \"one_of_many\": \"measureScore\",\n            \"one_of_many_required\": False,\n        },\n    )\n    measureScoreDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_measureScoreDateTime\",\n        title=\"Extension field for ``measureScoreDateTime``.\",\n    )\n\n    measureScoreDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"measureScoreDuration\",\n        title=\"What score this stratum achieved\",\n        description=(\n            \"The measure score for this stratum, calculated as appropriate for the \"\n            \"measure type and scoring method, and based on only the members of this\"\n            \" stratum.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e measureScore[x]\n            \"one_of_many\": \"measureScore\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    measureScorePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"measureScorePeriod\",\n        title=\"What score this stratum achieved\",\n        description=(\n            \"The measure score for this stratum, calculated as appropriate for the \"\n            \"measure type and scoring method, and based on only the members of this\"\n            \" stratum.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e measureScore[x]\n            \"one_of_many\": \"measureScore\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    measureScoreQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"measureScoreQuantity\",\n        title=\"What score this stratum achieved\",\n        description=(\n            \"The measure score for this stratum, calculated as appropriate for the \"\n            \"measure type and scoring method, and based on only the members of this\"\n            \" stratum.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e measureScore[x]\n            \"one_of_many\": \"measureScore\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    measureScoreRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"measureScoreRange\",\n        title=\"What score this stratum achieved\",\n        description=(\n            \"The measure score for this stratum, calculated as appropriate for the \"\n            \"measure type and scoring method, and based on only the members of this\"\n            \" stratum.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e measureScore[x]\n            \"one_of_many\": \"measureScore\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    population: typing.List[\n        fhirtypes.MeasureReportGroupStratifierStratumPopulationType\n    ] | None = Field(\n        default=None,\n        alias=\"population\",\n        title=\"Population results in this stratum\",\n        description=(\n            \"The populations that make up the stratum, one for each type of \"\n            \"population appropriate to the measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"The stratum value, e.g. male\",\n        description=(\n            \"The value for this stratum, expressed as a CodeableConcept. When \"\n            \"defining stratifiers on complex values, the value must be rendered \"\n            \"such that the value for each stratum within the stratifier is unique.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"The stratum value, e.g. male\",\n        description=(\n            \"The value for this stratum, expressed as a CodeableConcept. When \"\n            \"defining stratifiers on complex values, the value must be rendered \"\n            \"such that the value for each stratum within the stratifier is unique.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"The stratum value, e.g. male\",\n        description=(\n            \"The value for this stratum, expressed as a CodeableConcept. When \"\n            \"defining stratifiers on complex values, the value must be rendered \"\n            \"such that the value for each stratum within the stratifier is unique.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"The stratum value, e.g. male\",\n        description=(\n            \"The value for this stratum, expressed as a CodeableConcept. When \"\n            \"defining stratifiers on complex values, the value must be rendered \"\n            \"such that the value for each stratum within the stratifier is unique.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"The stratum value, e.g. male\",\n        description=(\n            \"The value for this stratum, expressed as a CodeableConcept. When \"\n            \"defining stratifiers on complex values, the value must be rendered \"\n            \"such that the value for each stratum within the stratifier is unique.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupStratifierStratum`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueCodeableConcept\",\n            \"valueBoolean\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueReference\",\n            \"component\",\n            \"population\",\n            \"measureScoreQuantity\",\n            \"measureScoreDateTime\",\n            \"measureScoreCodeableConcept\",\n            \"measureScorePeriod\",\n            \"measureScoreRange\",\n            \"measureScoreDuration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratum`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"measureScore\": [\n                \"measureScoreCodeableConcept\",\n                \"measureScoreDateTime\",\n                \"measureScoreDuration\",\n                \"measureScorePeriod\",\n                \"measureScoreQuantity\",\n                \"measureScoreRange\",\n            ],\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueReference\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass MeasureReportGroupStratifierStratumComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Stratifier component values.\n    A stratifier component value.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupStratifierStratumComponent\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"What stratifier component of the group\",\n        description=\"The code for the stratum component value.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific stratifier component from Measure\",\n        description=(\n            \"The stratifier component from the Measure that corresponds to this \"\n            \"stratifier component in the MeasureReport resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"The stratum component value, e.g. male\",\n        description=\"The stratum component value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"The stratum component value, e.g. male\",\n        description=\"The stratum component value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"The stratum component value, e.g. male\",\n        description=\"The stratum component value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"The stratum component value, e.g. male\",\n        description=\"The stratum component value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"The stratum component value, e.g. male\",\n        description=\"The stratum component value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupStratifierStratumComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueBoolean\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratumComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueReference\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass MeasureReportGroupStratifierStratumPopulation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Population results in this stratum.\n    The populations that make up the stratum, one for each type of population\n    appropriate to the measure.\n    \"\"\"\n\n    __resource_type__ = \"MeasureReportGroupStratifierStratumPopulation\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"initial-population | numerator | numerator-exclusion | denominator | \"\n            \"denominator-exclusion | denominator-exception | measure-population | \"\n            \"measure-population-exclusion | measure-observation\"\n        ),\n        description=\"The type of the population.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    count: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Size of the population\",\n        description=\"The number of members of the population in this stratum.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific population from Measure\",\n        description=(\n            \"The population from the Measure that corresponds to this population in\"\n            \" the MeasureReport resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    subjectReport: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subjectReport\",\n        title=\"For subject-list reports, a subject result in this population\",\n        description=(\n            \"A reference to an individual level MeasureReport resource for a member\"\n            \" of the population.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MeasureReport\"],\n        },\n    )\n\n    subjectResults: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectResults\",\n        title=\"For subject-list reports, the subject results in this population\",\n        description=(\n            \"This element refers to a List of individual level MeasureReport \"\n            \"resources, one for each subject in this population in this stratum.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"List\"],\n        },\n    )\n\n    subjects: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjects\",\n        title=\"What individual(s) in the population\",\n        description=(\n            \"Optional Group identifying the individuals that make up the \" \"population.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MeasureReportGroupStratifierStratumPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"code\",\n            \"count\",\n            \"subjectResults\",\n            \"subjectReport\",\n            \"subjects\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MeasureReportGroupStratifierStratumPopulation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/medication.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Medication\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Medication(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a Medication.\n    This resource is primarily used for the identification and definition of a\n    medication, including ingredients, for the purposes of prescribing,\n    dispensing, and administering a medication as well as for making statements\n    about medication use.\n    \"\"\"\n\n    __resource_type__ = \"Medication\"\n\n    batch: fhirtypes.MedicationBatchType | None = Field(\n        default=None,\n        alias=\"batch\",\n        title=\"Details about packaged medications\",\n        description=\"Information that only applies to packages (not products).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Codes that identify this medication\",\n        description=(\n            \"A code (or set of codes) that specify this medication, or a textual \"\n            \"description if no code is available. Usage note: This could be a \"\n            \"standard medication code such as a code from RxNorm, SNOMED CT, IDMP \"\n            \"etc. It could also be a national or local formulary code, optionally \"\n            \"with translations to other code systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Knowledge about this medication\",\n        description=(\n            \"A reference to a knowledge resource that provides more information \"\n            \"about this medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationKnowledge\"],\n        },\n    )\n\n    doseForm: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"doseForm\",\n        title=\"powder | tablets | capsule +\",\n        description=\"Describes the form of the item.  Powder; tablets; capsule.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for this medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.MedicationIngredientType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=\"Active or inactive ingredient\",\n        description=\"Identifies a particular constituent of interest in the product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    marketingAuthorizationHolder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"marketingAuthorizationHolder\",\n        title=\"Organization that has authorization to market medication\",\n        description=(\n            \"The company or other legal entity that has authorization, from the \"\n            \"appropriate drug regulatory authority,  to market a medicine in one or\"\n            \" more jurisdictions.  Typically abbreviated MAH.Note:  The MAH may \"\n            \"manufacture the product and may also contract the manufacturing of the\"\n            \" product to one or more companies (organizations).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=\"A code to indicate if the medication is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    totalVolume: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"totalVolume\",\n        title=(\n            \"When the specified product code does not infer a package size, this is\"\n            \" the specific amount of drug in the product\"\n        ),\n        description=(\n            \"When the specified product code does not infer a package size, this is\"\n            \" the specific amount of drug in the product.  For example, when \"\n            \"specifying a product that has the same strength (For example, Insulin \"\n            \"glargine 100 unit per mL solution for injection), this attribute \"\n            \"provides additional clarification of the package amount (For example, \"\n            \"3 mL, 10mL, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Medication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"status\",\n            \"marketingAuthorizationHolder\",\n            \"doseForm\",\n            \"totalVolume\",\n            \"ingredient\",\n            \"batch\",\n            \"definition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Medication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"status\",\n            \"marketingAuthorizationHolder\",\n            \"totalVolume\",\n        ]\n\n\nclass MedicationBatch(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details about packaged medications.\n    Information that only applies to packages (not products).\n    \"\"\"\n\n    __resource_type__ = \"MedicationBatch\"\n\n    expirationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expirationDate\",\n        title=\"When batch will expire\",\n        description=\"When this specific batch of product will expire.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_expirationDate\",\n        title=\"Extension field for ``expirationDate``.\",\n    )\n\n    lotNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lotNumber\",\n        title=\"Identifier assigned to batch\",\n        description=\"The assigned lot number of a batch of the specified product.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lotNumber\", title=\"Extension field for ``lotNumber``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationBatch`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"lotNumber\", \"expirationDate\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationBatch`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationIngredient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Active or inactive ingredient.\n    Identifies a particular constituent of interest in the product.\n    \"\"\"\n\n    __resource_type__ = \"MedicationIngredient\"\n\n    isActive: bool | None = Field(\n        default=None,\n        alias=\"isActive\",\n        title=\"Active ingredient indicator\",\n        description=(\n            \"Indication of whether this ingredient affects the therapeutic action \"\n            \"of the drug.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    isActive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isActive\", title=\"Extension field for ``isActive``.\"\n    )\n\n    item: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"item\",\n        title=(\n            \"The ingredient (substance or medication) that the ingredient.strength \"\n            \"relates to\"\n        ),\n        description=(\n            \"The ingredient (substance or medication) that the ingredient.strength \"\n            \"relates to.  This is represented as a concept from a code system or \"\n            \"described in another resource (Substance or Medication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\", \"Medication\"],\n        },\n    )\n\n    strengthCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"strengthCodeableConcept\",\n        title=\"Quantity of ingredient present\",\n        description=(\n            \"Specifies how many (or how much) of the items there are in this \"\n            \"Medication.  For example, 250 mg per tablet.  This is expressed as a \"\n            \"ratio where the numerator is 250mg and the denominator is 1 tablet but\"\n            \" can also be expressed a quantity when the denominator is assumed to \"\n            \"be 1 tablet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e strength[x]\n            \"one_of_many\": \"strength\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    strengthQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"strengthQuantity\",\n        title=\"Quantity of ingredient present\",\n        description=(\n            \"Specifies how many (or how much) of the items there are in this \"\n            \"Medication.  For example, 250 mg per tablet.  This is expressed as a \"\n            \"ratio where the numerator is 250mg and the denominator is 1 tablet but\"\n            \" can also be expressed a quantity when the denominator is assumed to \"\n            \"be 1 tablet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e strength[x]\n            \"one_of_many\": \"strength\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    strengthRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"strengthRatio\",\n        title=\"Quantity of ingredient present\",\n        description=(\n            \"Specifies how many (or how much) of the items there are in this \"\n            \"Medication.  For example, 250 mg per tablet.  This is expressed as a \"\n            \"ratio where the numerator is 250mg and the denominator is 1 tablet but\"\n            \" can also be expressed a quantity when the denominator is assumed to \"\n            \"be 1 tablet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e strength[x]\n            \"one_of_many\": \"strength\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"item\",\n            \"isActive\",\n            \"strengthRatio\",\n            \"strengthCodeableConcept\",\n            \"strengthQuantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"strength\": [\"strengthCodeableConcept\", \"strengthQuantity\", \"strengthRatio\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/medicationadministration.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationAdministration\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicationAdministration(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Administration of medication to a patient.\n    Describes the event of a patient consuming or otherwise being administered\n    a medication.  This may be as simple as swallowing a tablet or it may be a\n    long running infusion.  Related resources tie this event to the authorizing\n    prescription, and the specific encounter between patient and health care\n    practitioner.\n    \"\"\"\n\n    __resource_type__ = \"MedicationAdministration\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Plan this is fulfilled by this administration\",\n        description=(\n            \"A plan that is fulfilled in whole or in part by this \"\n            \"MedicationAdministration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of medication administration\",\n        description=(\n            \"The type of medication administration (for example, drug \"\n            \"classification like ATC, where meds would be administered, legal \"\n            \"category of the medication).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    device: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Device used to administer\",\n        description=(\n            \"The device that is to be used for the administration of the medication\"\n            \" (for example, PCA Pump).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    dosage: fhirtypes.MedicationAdministrationDosageType | None = Field(\n        default=None,\n        alias=\"dosage\",\n        title=\"Details of how medication was taken\",\n        description=(\n            \"Describes the medication dosage information details e.g. dose, rate, \"\n            \"site, route, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter administered as part of\",\n        description=(\n            \"The visit, admission, or other contact between patient and health care\"\n            \" provider during which the medication administration was performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"eventHistory\",\n        title=\"A list of events of interest in the lifecycle\",\n        description=(\n            \"A summary of the events of interest that have occurred, such as when \"\n            \"the administration was verified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifiers associated with this Medication Administration that are \"\n            \"defined by business processes and/or used to refer to it when a direct\"\n            \" URL reference to the resource itself is not appropriate. They are \"\n            \"business identifiers assigned to this resource by the performer or \"\n            \"other systems and remain constant as the resource is updated and \"\n            \"propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    isSubPotent: bool | None = Field(\n        default=None,\n        alias=\"isSubPotent\",\n        title=\"Full dose was not administered\",\n        description=\"An indication that the full dose was not administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    isSubPotent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isSubPotent\", title=\"Extension field for ``isSubPotent``.\"\n    )\n\n    medication: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"medication\",\n        title=\"What was administered\",\n        description=(\n            \"Identifies the medication that was administered. This is either a link\"\n            \" to a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Information about the administration\",\n        description=(\n            \"Extra information about the medication administration that is not \"\n            \"conveyed by the other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurenceDateTime\",\n        title=(\n            \"Specific date/time or interval of time during which the administration\"\n            \" took place (or did not take place)\"\n        ),\n        description=(\n            \"A specific date/time or interval of time during which the \"\n            \"administration took place (or did not take place). For many \"\n            \"administrations, such as swallowing a tablet the use of dateTime is \"\n            \"more appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurence[x]\n            \"one_of_many\": \"occurence\",\n            \"one_of_many_required\": True,\n        },\n    )\n    occurenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurenceDateTime\",\n        title=\"Extension field for ``occurenceDateTime``.\",\n    )\n\n    occurencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurencePeriod\",\n        title=(\n            \"Specific date/time or interval of time during which the administration\"\n            \" took place (or did not take place)\"\n        ),\n        description=(\n            \"A specific date/time or interval of time during which the \"\n            \"administration took place (or did not take place). For many \"\n            \"administrations, such as swallowing a tablet the use of dateTime is \"\n            \"more appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurence[x]\n            \"one_of_many\": \"occurence\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    occurenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurenceTiming\",\n        title=(\n            \"Specific date/time or interval of time during which the administration\"\n            \" took place (or did not take place)\"\n        ),\n        description=(\n            \"A specific date/time or interval of time during which the \"\n            \"administration took place (or did not take place). For many \"\n            \"administrations, such as swallowing a tablet the use of dateTime is \"\n            \"more appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurence[x]\n            \"one_of_many\": \"occurence\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=\"A larger event of which this particular event is a component or step.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicationAdministration\",\n                \"Procedure\",\n                \"MedicationDispense\",\n            ],\n        },\n    )\n\n    performer: typing.List[\n        fhirtypes.MedicationAdministrationPerformerType\n    ] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=(\n            \"Who or what performed the medication administration and what type of \"\n            \"performance they did\"\n        ),\n        description=(\n            \"The performer of the medication treatment.  For devices this is the \"\n            \"device that performed the administration of the medication.  An IV \"\n            \"Pump would be an example of a device that is performing the \"\n            \"administration. Both the IV Pump and the practitioner that set the \"\n            \"rate or bolus on the pump can be listed as performers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=(\n            \"Concept, condition or observation that supports why the medication was\"\n            \" administered\"\n        ),\n        description=(\n            \"A code, Condition or observation that supports why the medication was \"\n            \"administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\", \"DiagnosticReport\"],\n        },\n    )\n\n    recorded: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recorded\",\n        title=(\n            \"When the MedicationAdministration was first captured in the subject's \"\n            \"record\"\n        ),\n        description=(\n            \"The date the occurrence of the  MedicationAdministration was first \"\n            \"captured in the record - potentially significantly after the \"\n            \"occurrence of the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recorded\", title=\"Extension field for ``recorded``.\"\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Request administration performed against\",\n        description=(\n            \"The original request, instruction or authority to perform the \"\n            \"administration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"in-progress | not-done | on-hold | completed | entered-in-error | \"\n            \"stopped | unknown\"\n        ),\n        description=(\n            \"Will generally be set to show that the administration has been \"\n            \"completed.  For some long running administrations such as infusions, \"\n            \"it is possible for an administration to be started but not completed \"\n            \"or it may be paused while some other process is under way.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"in-progress\",\n                \"not-done\",\n                \"on-hold\",\n                \"completed\",\n                \"entered-in-error\",\n                \"stopped\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason administration not performed\",\n        description=\"A code indicating why the administration was not performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subPotentReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subPotentReason\",\n        title=\"Reason full dose was not administered\",\n        description=\"The reason or reasons why the full dose was not administered.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who received medication\",\n        description=\"The person or animal or group receiving the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Additional information to support administration\",\n        description=(\n            \"Additional information (for example, patient height and weight) that \"\n            \"supports the administration of the medication.  This attribute can be \"\n            \"used to provide documentation of specific characteristics of the \"\n            \"patient present at the time of administration.  For example, if the \"\n            'dose says \"give \"x\" if the heartrate exceeds \"y\"\", then the heart rate'\n            \" can be included using this attribute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"category\",\n            \"medication\",\n            \"subject\",\n            \"encounter\",\n            \"supportingInformation\",\n            \"occurenceDateTime\",\n            \"occurencePeriod\",\n            \"occurenceTiming\",\n            \"recorded\",\n            \"isSubPotent\",\n            \"subPotentReason\",\n            \"performer\",\n            \"reason\",\n            \"request\",\n            \"device\",\n            \"note\",\n            \"dosage\",\n            \"eventHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"partOf\",\n            \"status\",\n            \"medication\",\n            \"subject\",\n            \"occurenceDateTime\",\n            \"occurencePeriod\",\n            \"occurenceTiming\",\n            \"recorded\",\n            \"performer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurence\": [\"occurenceDateTime\", \"occurencePeriod\", \"occurenceTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass MedicationAdministrationDosage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of how medication was taken.\n    Describes the medication dosage information details e.g. dose, rate, site,\n    route, etc.\n    \"\"\"\n\n    __resource_type__ = \"MedicationAdministrationDosage\"\n\n    dose: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"dose\",\n        title=\"Amount of medication per dose\",\n        description=(\n            \"The amount of the medication given at one administration event.   Use \"\n            \"this value when the administration is essentially an instantaneous \"\n            \"event such as a swallowing a tablet or giving an injection.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"How drug was administered\",\n        description=(\n            \"A coded value indicating the method by which the medication is \"\n            \"intended to be or was introduced into or on the body.  This attribute \"\n            \"will most often NOT be populated.  It is most commonly used for \"\n            \"injections.  For example, Slow Push, Deep IV.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rateQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"rateQuantity\",\n        title=\"Dose quantity per unit of time\",\n        description=(\n            \"Identifies the speed with which the medication was or will be \"\n            \"introduced into the patient.  Typically, the rate for an infusion e.g.\"\n            \" 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per \"\n            \"unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min \"\n            \"or 200 mcg/1 minute; 1 liter/8 hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"rateRatio\",\n        title=\"Dose quantity per unit of time\",\n        description=(\n            \"Identifies the speed with which the medication was or will be \"\n            \"introduced into the patient.  Typically, the rate for an infusion e.g.\"\n            \" 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per \"\n            \"unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min \"\n            \"or 200 mcg/1 minute; 1 liter/8 hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    route: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"route\",\n        title=\"Path of substance into body\",\n        description=(\n            \"A code specifying the route or physiological path of administration of\"\n            \" a therapeutic agent into or onto the patient.  For example, topical, \"\n            \"intravenous, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    site: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Body site administered to\",\n        description=(\n            \"A coded specification of the anatomic site where the medication first \"\n            'entered the body.  For example, \"left arm\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Free text dosage instructions e.g. SIG\",\n        description=(\n            \"Free text dosage can be used for cases where the dosage administered \"\n            \"is too complex to code. When coded dosage is present, the free text \"\n            \"dosage may still be present for display to humans.  The dosage \"\n            \"instructions should reflect the dosage of the medication that was \"\n            \"administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationAdministrationDosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"text\",\n            \"site\",\n            \"route\",\n            \"method\",\n            \"dose\",\n            \"rateRatio\",\n            \"rateQuantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationAdministrationDosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"rate\": [\"rateQuantity\", \"rateRatio\"]}\n        return one_of_many_fields\n\n\nclass MedicationAdministrationPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who or what performed the medication administration and what type of\n    performance they did.\n    The performer of the medication treatment.  For devices this is the device\n    that performed the administration of the medication.  An IV Pump would be\n    an example of a device that is performing the administration. Both the IV\n    Pump and the practitioner that set the rate or bolus on the pump can be\n    listed as performers.\n    \"\"\"\n\n    __resource_type__ = \"MedicationAdministrationPerformer\"\n\n    actor: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Who or what performed the medication administration\",\n        description=\"Indicates who or what performed the medication administration.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of performance\",\n        description=(\n            \"Distinguishes the type of involvement of the performer in the \"\n            \"medication administration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationAdministrationPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationAdministrationPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"actor\"]\n"
  },
  {
    "path": "fhir/resources/medicationdispense.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationDispense\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicationDispense(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dispensing a medication to a named patient.\n    Indicates that a medication product is to be or has been dispensed for a\n    named person/patient.  This includes a description of the medication\n    product (supply) provided and the instructions for administering the\n    medication.  The medication dispense is the result of a pharmacy system\n    responding to a medication order.\n    \"\"\"\n\n    __resource_type__ = \"MedicationDispense\"\n\n    authorizingPrescription: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"authorizingPrescription\",\n        title=\"Medication order that authorizes the dispense\",\n        description=\"Indicates the medication order that is being dispensed against.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Plan that is fulfilled by this dispense\",\n        description=(\n            \"A plan that is fulfilled in whole or in part by this \"\n            \"MedicationDispense.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of medication dispense\",\n        description=(\n            \"Indicates the type of medication dispense (for example, drug \"\n            \"classification like ATC, where meds would be administered, legal \"\n            \"category of the medication.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    daysSupply: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"daysSupply\",\n        title=\"Amount of medication expressed as a timing amount\",\n        description=\"The amount of medication expressed as a timing amount.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    destination: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Where the medication was/will be sent\",\n        description=(\n            \"Identification of the facility/location where the medication was/will \"\n            \"be shipped to, as part of the dispense event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    dosageInstruction: typing.List[fhirtypes.DosageType] | None = Field(\n        default=None,\n        alias=\"dosageInstruction\",\n        title=(\n            \"How the medication is to be used by the patient or administered by the\"\n            \" caregiver\"\n        ),\n        description=\"Indicates how the medication is to be used by the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter associated with event\",\n        description=\"The encounter that establishes the context for this event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"eventHistory\",\n        title=\"A list of relevant lifecycle events\",\n        description=(\n            \"A summary of the events of interest that have occurred, such as when \"\n            \"the dispense was verified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifiers associated with this Medication Dispense that are defined \"\n            \"by business processes and/or used to refer to it when a direct URL \"\n            \"reference to the resource itself is not appropriate. They are business\"\n            \" identifiers assigned to this resource by the performer or other \"\n            \"systems and remain constant as the resource is updated and propagates \"\n            \"from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the dispense occurred\",\n        description=\"The principal physical location where the dispense was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    medication: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"medication\",\n        title=\"What medication was supplied\",\n        description=(\n            \"Identifies the medication supplied. This is either a link to a \"\n            \"resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    notPerformedReason: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"notPerformedReason\",\n        title=\"Why a dispense was not performed\",\n        description=\"Indicates the reason why a dispense was not performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DetectedIssue\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Information about the dispense\",\n        description=(\n            \"Extra information about the dispense that could not be conveyed in the\"\n            \" other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Event that dispense is part of\",\n        description=(\n            \"The procedure or medication administration that triggered the \" \"dispense.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\", \"MedicationAdministration\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.MedicationDispensePerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed event\",\n        description=\"Indicates who or what performed the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount dispensed\",\n        description=(\n            \"The amount of medication that has been dispensed. Includes unit of \"\n            \"measure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    receiver: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"receiver\",\n        title=\"Who collected the medication or where the medication was delivered\",\n        description=(\n            \"Identifies the person who picked up the medication or the location of \"\n            \"where the medication was delivered.  This will usually be a patient or\"\n            \" their caregiver, but some cases exist where it can be a healthcare \"\n            \"professional or a location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Location\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    recorded: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recorded\",\n        title=\"When the recording of the dispense started\",\n        description=(\n            \"The date (and maybe time) when the dispense activity started if \"\n            \"whenPrepared or whenHandedOver is not populated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recorded\", title=\"Extension field for ``recorded``.\"\n    )\n\n    renderedDosageInstruction: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"renderedDosageInstruction\",\n        title=\"Full representation of the dosage instructions\",\n        description=(\n            \"The full representation of the dose of the medication included in all \"\n            \"dosage instructions.  To be used when multiple dosage instructions are\"\n            \" included to represent complex dosing such as increasing or tapering \"\n            \"doses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    renderedDosageInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_renderedDosageInstruction\",\n        title=\"Extension field for ``renderedDosageInstruction``.\",\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | cancelled | on-hold | completed | entered-\"\n            \"in-error | stopped | declined | unknown\"\n        ),\n        description=\"A code specifying the state of the set of dispense events.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"cancelled\",\n                \"on-hold\",\n                \"completed\",\n                \"entered-in-error\",\n                \"stopped\",\n                \"declined\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusChanged: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"statusChanged\",\n        title=\"When the status changed\",\n        description=(\n            \"The date (and maybe time) when the status of the dispense record \"\n            \"changed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    statusChanged__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_statusChanged\",\n        title=\"Extension field for ``statusChanged``.\",\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who the dispense is for\",\n        description=(\n            \"A link to a resource representing the person or the group to whom the \"\n            \"medication will be given.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    substitution: fhirtypes.MedicationDispenseSubstitutionType | None = Field(\n        default=None,\n        alias=\"substitution\",\n        title=\"Whether a substitution was performed on the dispense\",\n        description=(\n            \"Indicates whether or not substitution was made as part of the \"\n            \"dispense.  In some cases, substitution will be expected but does not \"\n            \"happen, in other cases substitution is not expected but does happen.  \"\n            \"This block explains what substitution did or did not happen and why.  \"\n            \"If nothing is specified, substitution was not done.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Information that supports the dispensing of the medication\",\n        description=(\n            \"Additional information that supports the medication being dispensed.  \"\n            \"For example, there may be requirements that a specific lab test has \"\n            \"been completed prior to dispensing or the patient's weight at the time\"\n            \" of dispensing is documented.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Trial fill, partial fill, emergency fill, etc\",\n        description=(\n            \"Indicates the type of dispensing event that is performed. For example,\"\n            \" Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, \"\n            \"Samples, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    whenHandedOver: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenHandedOver\",\n        title=\"When product was given out\",\n        description=(\n            \"The time the dispensed product was provided to the patient or their \"\n            \"representative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    whenHandedOver__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenHandedOver\",\n        title=\"Extension field for ``whenHandedOver``.\",\n    )\n\n    whenPrepared: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"whenPrepared\",\n        title=\"When product was packaged and reviewed\",\n        description=\"The time when the dispensed product was packaged and reviewed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    whenPrepared__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_whenPrepared\",\n        title=\"Extension field for ``whenPrepared``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"notPerformedReason\",\n            \"statusChanged\",\n            \"category\",\n            \"medication\",\n            \"subject\",\n            \"encounter\",\n            \"supportingInformation\",\n            \"performer\",\n            \"location\",\n            \"authorizingPrescription\",\n            \"type\",\n            \"quantity\",\n            \"daysSupply\",\n            \"recorded\",\n            \"whenPrepared\",\n            \"whenHandedOver\",\n            \"destination\",\n            \"receiver\",\n            \"note\",\n            \"renderedDosageInstruction\",\n            \"dosageInstruction\",\n            \"substitution\",\n            \"eventHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"medication\",\n            \"subject\",\n            \"whenPrepared\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass MedicationDispensePerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed event.\n    Indicates who or what performed the event.\n    \"\"\"\n\n    __resource_type__ = \"MedicationDispensePerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Individual who was performing\",\n        description=(\n            \"The device, practitioner, etc. who performed the action.  It should be\"\n            \" assumed that the actor is the dispenser of the medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Who performed the dispense and what they did\",\n        description=(\n            \"Distinguishes the type of performer in the dispense.  For example, \"\n            \"date enterer, packager, final checker.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationDispensePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationDispensePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationDispenseSubstitution(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Whether a substitution was performed on the dispense.\n    Indicates whether or not substitution was made as part of the dispense.  In\n    some cases, substitution will be expected but does not happen, in other\n    cases substitution is not expected but does happen.  This block explains\n    what substitution did or did not happen and why.  If nothing is specified,\n    substitution was not done.\n    \"\"\"\n\n    __resource_type__ = \"MedicationDispenseSubstitution\"\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why was substitution made\",\n        description=(\n            \"Indicates the reason for the substitution (or lack of substitution) \"\n            \"from what was prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    responsibleParty: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"responsibleParty\",\n        title=\"Who is responsible for the substitution\",\n        description=(\n            \"The person or organization that has primary responsibility for the \"\n            \"substitution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Code signifying whether a different drug was dispensed from what was \"\n            \"prescribed\"\n        ),\n        description=(\n            \"A code signifying whether a different drug was dispensed from what was\"\n            \" prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    wasSubstituted: bool | None = Field(\n        default=None,\n        alias=\"wasSubstituted\",\n        title=\"Whether a substitution was or was not performed on the dispense\",\n        description=(\n            \"True if the dispenser dispensed a different drug or product from what \"\n            \"was prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    wasSubstituted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_wasSubstituted\",\n        title=\"Extension field for ``wasSubstituted``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationDispenseSubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"wasSubstituted\",\n            \"type\",\n            \"reason\",\n            \"responsibleParty\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationDispenseSubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"wasSubstituted\", \"wasSubstituted__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/medicationknowledge.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationKnowledge\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicationKnowledge(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of Medication Knowledge.\n    Information about a medication that is used to support knowledge.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledge\"\n\n    associatedMedication: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"associatedMedication\",\n        title=(\n            \"The set of medication resources that are associated with this \"\n            \"medication\"\n        ),\n        description=(\n            \"Links to associated medications that could be prescribed, dispensed or\"\n            \" administered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Creator or owner of the knowledge or information about the medication\",\n        description=(\n            \"The creator or owner of the knowledge or information about the \"\n            \"medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    clinicalUseIssue: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"clinicalUseIssue\",\n        title=\"Potential clinical issue with or between medication(s)\",\n        description=(\n            \"Potential clinical issue with or between medication(s) (for example, \"\n            \"drug-drug interaction, drug-disease contraindication, drug-allergy \"\n            \"interaction, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClinicalUseDefinition\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code that identifies this medication\",\n        description=(\n            \"A code that specifies this medication, or a textual description if no \"\n            \"code is available. Usage note: This could be a standard medication \"\n            \"code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be\"\n            \" a national or local formulary code, optionally with translations to \"\n            \"other code systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    cost: typing.List[fhirtypes.MedicationKnowledgeCostType] | None = Field(\n        default=None,\n        alias=\"cost\",\n        title=\"The pricing of the medication\",\n        description=\"The price of the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definitional: fhirtypes.MedicationKnowledgeDefinitionalType | None = Field(\n        default=None,\n        alias=\"definitional\",\n        title=\"Minimal definition information about the medication\",\n        description=(\n            \"Along with the link to a Medicinal Product Definition resource, this \"\n            \"information provides common definitional elements that are needed to \"\n            \"understand the specific medication that is being described.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for this medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    indicationGuideline: typing.List[\n        fhirtypes.MedicationKnowledgeIndicationGuidelineType\n    ] | None = Field(\n        default=None,\n        alias=\"indicationGuideline\",\n        title=(\n            \"Guidelines or protocols for administration of the medication for an \"\n            \"indication\"\n        ),\n        description=(\n            \"Guidelines or protocols that are applicable for the administration of \"\n            \"the medication based on indication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    intendedJurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"intendedJurisdiction\",\n        title=(\n            \"Codes that identify the different jurisdictions for which the \"\n            \"information of this resource was created\"\n        ),\n        description=(\n            \"Lists the jurisdictions that this medication knowledge was written \" \"for.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    medicineClassification: typing.List[\n        fhirtypes.MedicationKnowledgeMedicineClassificationType\n    ] | None = Field(\n        default=None,\n        alias=\"medicineClassification\",\n        title=(\n            \"Categorization of the medication within a formulary or classification \"\n            \"system\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    monitoringProgram: typing.List[\n        fhirtypes.MedicationKnowledgeMonitoringProgramType\n    ] | None = Field(\n        default=None,\n        alias=\"monitoringProgram\",\n        title=\"Program under which a medication is reviewed\",\n        description=\"The program under which the medication is reviewed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    monograph: typing.List[fhirtypes.MedicationKnowledgeMonographType] | None = Field(\n        default=None,\n        alias=\"monograph\",\n        title=\"Associated documentation about the medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the medication being described\",\n        description=(\n            \"All of the names for a medication, for example, the name(s) given to a\"\n            \" medication in different countries.  For example, acetaminophen and \"\n            \"paracetamol or salbutamol and albuterol.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    packaging: typing.List[fhirtypes.MedicationKnowledgePackagingType] | None = Field(\n        default=None,\n        alias=\"packaging\",\n        title=\"Details about packaged medications\",\n        description=\"Information that only applies to packages (not products).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preparationInstruction: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"preparationInstruction\",\n        title=\"The instructions for preparing the medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preparationInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_preparationInstruction\",\n        title=\"Extension field for ``preparationInstruction``.\",\n    )\n\n    productType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"productType\",\n        title=\"Category of the medication or product\",\n        description=(\n            \"Category of the medication or product (e.g. branded product, \"\n            \"therapeutic moeity, generic product, innovator product, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    regulatory: typing.List[fhirtypes.MedicationKnowledgeRegulatoryType] | None = Field(\n        default=None,\n        alias=\"regulatory\",\n        title=\"Regulatory information about a medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedMedicationKnowledge: typing.List[\n        fhirtypes.MedicationKnowledgeRelatedMedicationKnowledgeType\n    ] | None = Field(\n        default=None,\n        alias=\"relatedMedicationKnowledge\",\n        title=\"Associated or related medication information\",\n        description=(\n            \"Associated or related medications. For example, if the medication is a\"\n            \" branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. \"\n            \"Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), \"\n            \"this would link to a branded product (e.g. Crestor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | entered-in-error | inactive\",\n        description=(\n            \"A code to indicate if the medication referred to by this \"\n            \"MedicationKnowledge is in active use within the drug database or \"\n            \"inventory system. The status refers to the validity about the \"\n            \"information of the medication and not to its medicinal properties.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"entered-in-error\", \"inactive\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    storageGuideline: typing.List[\n        fhirtypes.MedicationKnowledgeStorageGuidelineType\n    ] | None = Field(\n        default=None,\n        alias=\"storageGuideline\",\n        title=\"How the medication should be stored\",\n        description=(\n            \"Information on how the medication should be stored, for example, \"\n            \"refrigeration temperatures and length of stability at a given \"\n            \"temperature.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledge`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"status\",\n            \"author\",\n            \"intendedJurisdiction\",\n            \"name\",\n            \"relatedMedicationKnowledge\",\n            \"associatedMedication\",\n            \"productType\",\n            \"monograph\",\n            \"preparationInstruction\",\n            \"cost\",\n            \"monitoringProgram\",\n            \"indicationGuideline\",\n            \"medicineClassification\",\n            \"packaging\",\n            \"clinicalUseIssue\",\n            \"storageGuideline\",\n            \"regulatory\",\n            \"definitional\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledge`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"status\",\n            \"name\",\n            \"monitoringProgram\",\n        ]\n\n\nclass MedicationKnowledgeCost(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The pricing of the medication.\n    The price of the medication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeCost\"\n\n    costCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"costCodeableConcept\",\n        title=\"The price or category of the cost of the medication\",\n        description=(\n            \"The price or representation of the cost (for example, Band A, Band B \"\n            \"or $, $$) of the medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e cost[x]\n            \"one_of_many\": \"cost\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    costMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"costMoney\",\n        title=\"The price or category of the cost of the medication\",\n        description=(\n            \"The price or representation of the cost (for example, Band A, Band B \"\n            \"or $, $$) of the medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e cost[x]\n            \"one_of_many\": \"cost\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    effectiveDate: typing.List[fhirtypes.PeriodType] | None = Field(\n        default=None,\n        alias=\"effectiveDate\",\n        title=\"The date range for which the cost is effective\",\n        description=(\n            \"The date range for which the cost information of the medication is \"\n            \"effective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    source: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"The source or owner for the price information\",\n        description=\"The source or owner that assigns the price to the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"The category of the cost information\",\n        description=(\n            \"The category of the cost information.  For example, manufacturers' \"\n            \"cost, patient cost, claim reimbursement cost, actual acquisition cost.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"effectiveDate\",\n            \"type\",\n            \"source\",\n            \"costMoney\",\n            \"costCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeCost`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"cost\": [\"costCodeableConcept\", \"costMoney\"]}\n        return one_of_many_fields\n\n\nclass MedicationKnowledgeDefinitional(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Minimal definition information about the medication.\n    Along with the link to a Medicinal Product Definition resource, this\n    information provides common definitional elements that are needed to\n    understand the specific medication that is being described.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeDefinitional\"\n\n    definition: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=(\n            \"Definitional resources that provide more information about this \"\n            \"medication\"\n        ),\n        description=\"Associated definitions for this medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicinalProductDefinition\"],\n        },\n    )\n\n    doseForm: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"doseForm\",\n        title=\"powder | tablets | capsule +\",\n        description=\"Describes the form of the item.  Powder; tablets; capsule.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    drugCharacteristic: typing.List[\n        fhirtypes.MedicationKnowledgeDefinitionalDrugCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"drugCharacteristic\",\n        title=\"Specifies descriptive properties of the medicine\",\n        description=(\n            \"Specifies descriptive properties of the medicine, such as color, \"\n            \"shape, imprints, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[\n        fhirtypes.MedicationKnowledgeDefinitionalIngredientType\n    ] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=\"Active or inactive ingredient\",\n        description=\"Identifies a particular constituent of interest in the product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    intendedRoute: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"intendedRoute\",\n        title=\"The intended or approved route of administration\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeDefinitional`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"definition\",\n            \"doseForm\",\n            \"intendedRoute\",\n            \"ingredient\",\n            \"drugCharacteristic\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeDefinitional`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"ingredient\"]\n\n\nclass MedicationKnowledgeDefinitionalDrugCharacteristic(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifies descriptive properties of the medicine.\n    Specifies descriptive properties of the medicine, such as color, shape,\n    imprints, etc.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeDefinitionalDrugCharacteristic\"\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Code specifying the type of characteristic of medication\",\n        description=(\n            \"A code specifying which characteristic of the medicine is being \"\n            \"described (for example, colour, shape, imprint).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Description of the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Description of the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Description of the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Description of the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Description of the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeDefinitionalDrugCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueQuantity\",\n            \"valueBase64Binary\",\n            \"valueAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeDefinitionalDrugCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass MedicationKnowledgeDefinitionalIngredient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Active or inactive ingredient.\n    Identifies a particular constituent of interest in the product.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeDefinitionalIngredient\"\n\n    item: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"item\",\n        title=\"Substances contained in the medication\",\n        description=(\n            \"A reference to the resource that provides information about the \"\n            \"ingredient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    strengthCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"strengthCodeableConcept\",\n        title=\"Quantity of ingredient present\",\n        description=(\n            \"Specifies how many (or how much) of the items there are in this \"\n            \"Medication.  For example, 250 mg per tablet.  This is expressed as a \"\n            \"ratio where the numerator is 250mg and the denominator is 1 tablet but\"\n            \" can also be expressed a quantity when the denominator is assumed to \"\n            \"be 1 tablet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e strength[x]\n            \"one_of_many\": \"strength\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    strengthQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"strengthQuantity\",\n        title=\"Quantity of ingredient present\",\n        description=(\n            \"Specifies how many (or how much) of the items there are in this \"\n            \"Medication.  For example, 250 mg per tablet.  This is expressed as a \"\n            \"ratio where the numerator is 250mg and the denominator is 1 tablet but\"\n            \" can also be expressed a quantity when the denominator is assumed to \"\n            \"be 1 tablet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e strength[x]\n            \"one_of_many\": \"strength\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    strengthRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"strengthRatio\",\n        title=\"Quantity of ingredient present\",\n        description=(\n            \"Specifies how many (or how much) of the items there are in this \"\n            \"Medication.  For example, 250 mg per tablet.  This is expressed as a \"\n            \"ratio where the numerator is 250mg and the denominator is 1 tablet but\"\n            \" can also be expressed a quantity when the denominator is assumed to \"\n            \"be 1 tablet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e strength[x]\n            \"one_of_many\": \"strength\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"A code that defines the type of ingredient, active, base, etc\",\n        description=(\n            \"Indication of whether this ingredient affects the therapeutic action \"\n            \"of the drug.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeDefinitionalIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"item\",\n            \"type\",\n            \"strengthRatio\",\n            \"strengthCodeableConcept\",\n            \"strengthQuantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeDefinitionalIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"item\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"strength\": [\"strengthCodeableConcept\", \"strengthQuantity\", \"strengthRatio\"]\n        }\n        return one_of_many_fields\n\n\nclass MedicationKnowledgeIndicationGuideline(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Guidelines or protocols for administration of the medication for an\n    indication.\n    Guidelines or protocols that are applicable for the administration of the\n    medication based on indication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeIndicationGuideline\"\n\n    dosingGuideline: typing.List[\n        fhirtypes.MedicationKnowledgeIndicationGuidelineDosingGuidelineType\n    ] | None = Field(\n        default=None,\n        alias=\"dosingGuideline\",\n        title=\"Guidelines for dosage of the medication\",\n        description=\"The guidelines for the dosage of the medication for the indication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    indication: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"indication\",\n        title=(\n            \"Indication for use that applies to the specific administration \"\n            \"guideline\"\n        ),\n        description=(\n            \"Indication or reason for use of the medication that applies to the \"\n            \"specific administration guideline.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClinicalUseDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeIndicationGuideline`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"indication\", \"dosingGuideline\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeIndicationGuideline`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeIndicationGuidelineDosingGuideline(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Guidelines for dosage of the medication.\n    The guidelines for the dosage of the medication for the indication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeIndicationGuidelineDosingGuideline\"\n\n    administrationTreatment: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"administrationTreatment\",\n        title=\"Type of treatment the guideline applies to\",\n        description=(\n            \"The type of the treatment that the guideline applies to, for example, \"\n            \"long term therapy, first line treatment, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dosage: typing.List[\n        fhirtypes.MedicationKnowledgeIndicationGuidelineDosingGuidelineDosageType\n    ] | None = Field(\n        default=None,\n        alias=\"dosage\",\n        title=\"Dosage for the medication for the specific guidelines\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    patientCharacteristic: typing.List[\n        fhirtypes.MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"patientCharacteristic\",\n        title=(\n            \"Characteristics of the patient that are relevant to the administration\"\n            \" guidelines\"\n        ),\n        description=(\n            \"Characteristics of the patient that are relevant to the administration\"\n            \" guidelines (for example, height, weight, gender, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    treatmentIntent: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"treatmentIntent\",\n        title=\"Intention of the treatment\",\n        description=(\n            \"The overall intention of the treatment, for example, prophylactic, \"\n            \"supporative, curative, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeIndicationGuidelineDosingGuideline`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"treatmentIntent\",\n            \"dosage\",\n            \"administrationTreatment\",\n            \"patientCharacteristic\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeIndicationGuidelineDosingGuideline`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dosage for the medication for the specific guidelines.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage\"\n\n    dosage: typing.List[fhirtypes.DosageType] = Field(\n        default=...,\n        alias=\"dosage\",\n        title=\"Dosage for the medication for the specific guidelines\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Category of dosage for a medication\",\n        description=(\n            \"The type or category of dosage for a given medication (for example, \"\n            \"prophylaxis, maintenance, therapeutic, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"dosage\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeIndicationGuidelineDosingGuidelineDosage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristic(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Characteristics of the patient that are relevant to the administration\n    guidelines.\n    Characteristics of the patient that are relevant to the administration\n    guidelines (for example, height, weight, gender, etc.).\n    \"\"\"\n\n    __resource_type__ = (\n        \"MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristic\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=(\n            \"Categorization of specific characteristic that is relevant to the \"\n            \"administration guideline\"\n        ),\n        description=(\n            \"The categorization of the specific characteristic that is relevant to \"\n            \"the administration guideline (e.g. height, weight, gender).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"The specific characteristic\",\n        description=\"The specific characteristic (e.g. height, weight, gender, etc.).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"The specific characteristic\",\n        description=\"The specific characteristic (e.g. height, weight, gender, etc.).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"The specific characteristic\",\n        description=\"The specific characteristic (e.g. height, weight, gender, etc.).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeIndicationGuidelineDosingGuidelinePatientCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\"valueCodeableConcept\", \"valueQuantity\", \"valueRange\"]\n        }\n        return one_of_many_fields\n\n\nclass MedicationKnowledgeMedicineClassification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Categorization of the medication within a formulary or classification\n    system.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeMedicineClassification\"\n\n    classification: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=\"Specific category assigned to the medication\",\n        description=(\n            \"Specific category assigned to the medication (e.g. anti-infective, \"\n            \"anti-hypertensive, antibiotic, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sourceString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sourceString\",\n        title=\"The source of the classification\",\n        description=(\n            \"Either a textual source of the classification or a reference to an \"\n            \"online source.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n    sourceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sourceString\",\n        title=\"Extension field for ``sourceString``.\",\n    )\n\n    sourceUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"sourceUri\",\n        title=\"The source of the classification\",\n        description=(\n            \"Either a textual source of the classification or a reference to an \"\n            \"online source.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n    sourceUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceUri\", title=\"Extension field for ``sourceUri``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=(\n            \"The type of category for the medication (for example, therapeutic \"\n            \"classification, therapeutic sub-classification)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeMedicineClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"sourceString\",\n            \"sourceUri\",\n            \"classification\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeMedicineClassification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"source\": [\"sourceString\", \"sourceUri\"]}\n        return one_of_many_fields\n\n\nclass MedicationKnowledgeMonitoringProgram(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Program under which a medication is reviewed.\n    The program under which the medication is reviewed.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeMonitoringProgram\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the reviewing program\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of program under which the medication is monitored\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeMonitoringProgram`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"name\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeMonitoringProgram`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeMonograph(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Associated documentation about the medication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeMonograph\"\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Associated documentation about the medication\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The category of medication document\",\n        description=(\n            \"The category of documentation about the medication. (e.g. professional\"\n            \" monograph, patient education monograph).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeMonograph`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"source\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeMonograph`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgePackaging(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details about packaged medications.\n    Information that only applies to packages (not products).\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgePackaging\"\n\n    cost: typing.List[fhirtypes.MedicationKnowledgeCostType] | None = Field(\n        default=None,\n        alias=\"cost\",\n        title=\"Cost of the packaged medication\",\n        description=\"The cost of the packaged medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    packagedProduct: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"packagedProduct\",\n        title=\"The packaged medication that is being priced\",\n        description=(\n            \"A reference to a PackagedProductDefinition that provides the details \"\n            \"of the product that is in the packaging and is being priced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PackagedProductDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgePackaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"cost\", \"packagedProduct\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgePackaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeRegulatory(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Regulatory information about a medication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeRegulatory\"\n\n    maxDispense: fhirtypes.MedicationKnowledgeRegulatoryMaxDispenseType | None = Field(\n        default=None,\n        alias=\"maxDispense\",\n        title=(\n            \"The maximum number of units of the medication that can be dispensed in\"\n            \" a period\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    regulatoryAuthority: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"regulatoryAuthority\",\n        title=\"Specifies the authority of the regulation\",\n        description=\"The authority that is specifying the regulations.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    schedule: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"schedule\",\n        title=\"Specifies the schedule of a medication in jurisdiction\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    substitution: typing.List[\n        fhirtypes.MedicationKnowledgeRegulatorySubstitutionType\n    ] | None = Field(\n        default=None,\n        alias=\"substitution\",\n        title=(\n            \"Specifies if changes are allowed when dispensing a medication from a \"\n            \"regulatory perspective\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeRegulatory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"regulatoryAuthority\",\n            \"substitution\",\n            \"schedule\",\n            \"maxDispense\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatory`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeRegulatoryMaxDispense(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The maximum number of units of the medication that can be dispensed in a\n    period.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeRegulatoryMaxDispense\"\n\n    period: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"The period that applies to the maximum number of units\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"quantity\",\n        title=\"The maximum number of units of the medication that can be dispensed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeRegulatoryMaxDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"quantity\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatoryMaxDispense`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeRegulatorySubstitution(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifies if changes are allowed when dispensing a medication from a\n    regulatory perspective.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeRegulatorySubstitution\"\n\n    allowed: bool | None = Field(\n        default=None,\n        alias=\"allowed\",\n        title=(\n            \"Specifies if regulation allows for changes in the medication when \"\n            \"dispensing\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    allowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_allowed\", title=\"Extension field for ``allowed``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Specifies the type of substitution allowed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeRegulatorySubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"allowed\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRegulatorySubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"allowed\", \"allowed__ext\")]\n        return required_fields\n\n\nclass MedicationKnowledgeRelatedMedicationKnowledge(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Associated or related medication information.\n    Associated or related medications. For example, if the medication is a\n    branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g.\n    Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this\n    would link to a branded product (e.g. Crestor.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeRelatedMedicationKnowledge\"\n\n    reference: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"Associated documentation about the associated medication knowledge\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationKnowledge\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Category of medicationKnowledge\",\n        description=\"The category of the associated medication knowledge reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeRelatedMedicationKnowledge`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeRelatedMedicationKnowledge`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeStorageGuideline(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    How the medication should be stored.\n    Information on how the medication should be stored, for example,\n    refrigeration temperatures and length of stability at a given temperature.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeStorageGuideline\"\n\n    environmentalSetting: typing.List[\n        fhirtypes.MedicationKnowledgeStorageGuidelineEnvironmentalSettingType\n    ] | None = Field(\n        default=None,\n        alias=\"environmentalSetting\",\n        title=\"Setting or value of environment for adequate storage\",\n        description=(\n            \"Describes a setting/value on the environment for the adequate storage \"\n            \"of the medication and other substances.  Environment settings may \"\n            \"involve temperature, humidity, or exposure to light.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional storage notes\",\n        description=\"Additional notes about the storage.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reference: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Reference to additional information\",\n        description=\"Reference to additional information about the storage guidelines.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    stabilityDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"stabilityDuration\",\n        title=\"Duration remains stable\",\n        description=(\n            \"Duration that the medication remains stable if the \"\n            \"environmentalSetting is respected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeStorageGuideline`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"reference\",\n            \"note\",\n            \"stabilityDuration\",\n            \"environmentalSetting\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeStorageGuideline`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationKnowledgeStorageGuidelineEnvironmentalSetting(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Setting or value of environment for adequate storage.\n    Describes a setting/value on the environment for the adequate storage of\n    the medication and other substances.  Environment settings may involve\n    temperature, humidity, or exposure to light.\n    \"\"\"\n\n    __resource_type__ = \"MedicationKnowledgeStorageGuidelineEnvironmentalSetting\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Categorization of the setting\",\n        description=(\n            \"Identifies the category or type of setting (e.g., type of location, \"\n            \"temperature, humidity).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of the setting\",\n        description=\"Value associated to the setting. E.g., 40\\u00b0 \\u2013 50\\u00b0F for temperature.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of the setting\",\n        description=\"Value associated to the setting. E.g., 40\\u00b0 \\u2013 50\\u00b0F for temperature.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of the setting\",\n        description=\"Value associated to the setting. E.g., 40\\u00b0 \\u2013 50\\u00b0F for temperature.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationKnowledgeStorageGuidelineEnvironmentalSetting`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationKnowledgeStorageGuidelineEnvironmentalSetting`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\"valueCodeableConcept\", \"valueQuantity\", \"valueRange\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/medicationrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicationRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Ordering of medication for patient or group.\n    An order or request for both supply of the medication and the instructions\n    for administration of the medication to a patient. The resource is called\n    \"MedicationRequest\" rather than \"MedicationPrescription\" or\n    \"MedicationOrder\" to generalize the use across inpatient and outpatient\n    settings, including care plans, etc., and to harmonize with workflow\n    patterns.\n    \"\"\"\n\n    __resource_type__ = \"MedicationRequest\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When request was initially authored\",\n        description=(\n            \"The date (and perhaps time) when the prescription was initially \"\n            \"written or authored on.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=(\n            \"A plan or request that is fulfilled in whole or in part by this \"\n            \"medication request\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"MedicationRequest\",\n                \"ServiceRequest\",\n                \"ImmunizationRecommendation\",\n            ],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Grouping or category of medication request\",\n        description=(\n            \"An arbitrary categorization or grouping of the medication request.  It\"\n            \" could be used for indicating where meds are intended to be \"\n            \"administered, eg. in an inpatient setting or in a patient's home, or a\"\n            \" legal category of the medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    courseOfTherapyType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"courseOfTherapyType\",\n        title=\"Overall pattern of medication administration\",\n        description=(\n            \"The description of the overall pattern of the administration of the \"\n            \"medication to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    device: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Intended type of device for the administration\",\n        description=(\n            \"The intended type of device that is to be used for the administration \"\n            \"of the medication (for example, PCA Pump).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceDefinition\"],\n        },\n    )\n\n    dispenseRequest: fhirtypes.MedicationRequestDispenseRequestType | None = Field(\n        default=None,\n        alias=\"dispenseRequest\",\n        title=\"Medication supply authorization\",\n        description=(\n            \"Indicates the specific details for the dispense or medication supply \"\n            \"part of a medication request (also known as a Medication Prescription \"\n            \"or Medication Order).  Note that this information is not always sent \"\n            \"with the order.  There may be in some settings (e.g. hospitals) \"\n            \"institutional or system support for completing the dispense details in\"\n            \" the pharmacy department.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=(\n            \"True if patient is to stop taking or not to start taking the \" \"medication\"\n        ),\n        description=(\n            \"If true, indicates that the provider is asking for the patient to \"\n            \"either stop taking or to not start taking the specified medication. \"\n            \"For example, the patient is taking an existing medication and the \"\n            \"provider is changing their medication. They want to create two \"\n            \"seperate requests: one to stop using the current medication and \"\n            \"another to start the new medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    dosageInstruction: typing.List[fhirtypes.DosageType] | None = Field(\n        default=None,\n        alias=\"dosageInstruction\",\n        title=\"Specific instructions for how the medication should be taken\",\n        description=(\n            \"Specific instructions for how the medication is to be used by the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectiveDosePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectiveDosePeriod\",\n        title=\"Period over which the medication is to be taken\",\n        description=(\n            \"The period over which the medication is to be taken.  Where there are \"\n            \"multiple dosageInstruction lines (for example, tapering doses), this \"\n            \"is the earliest date and the latest end date of the \"\n            \"dosageInstructions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter created as part of encounter/admission/stay\",\n        description=(\n            \"The Encounter during which this [x] was created or to which the \"\n            \"creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    eventHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"eventHistory\",\n        title=\"A list of events of interest in the lifecycle\",\n        description=(\n            \"Links to Provenance records for past versions of this resource or \"\n            \"fulfilling request or event resources that identify key state \"\n            \"transitions or updates that are likely to be relevant to a user \"\n            \"looking at the current version of the resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Composite request this is part of\",\n        description=(\n            \"A shared identifier common to multiple independent Request instances \"\n            \"that were activated/authorized more or less simultaneously by a single\"\n            \" author.  The presence of the same identifier on each request ties \"\n            \"those requests together and may have business ramifications in terms \"\n            \"of reporting of results, billing, etc.  E.g. a requisition number \"\n            \"shared by a set of lab tests ordered together, or a prescription \"\n            \"number shared by all meds ordered at one time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External ids for this request\",\n        description=(\n            \"Identifiers associated with this medication request that are defined \"\n            \"by business processes and/or used to refer to it when a direct URL \"\n            \"reference to the resource itself is not appropriate. They are business\"\n            \" identifiers assigned to this resource by the performer or other \"\n            \"systems and remain constant as the resource is updated and propagates \"\n            \"from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    informationSource: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"informationSource\",\n        title=(\n            \"The person or organization who provided the information about this \"\n            \"request, if the source is someone other than the requestor\"\n        ),\n        description=(\n            \"The person or organization who provided the information about this \"\n            \"request, if the source is someone other than the requestor.  This is \"\n            \"often used when the MedicationRequest is reported by another person.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    insurance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Associated insurance coverage\",\n        description=(\n            \"Insurance plans, coverage extensions, pre-authorizations and/or pre-\"\n            \"determinations that may be required for delivering the requested \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\", \"ClaimResponse\"],\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"proposal | plan | order | original-order | reflex-order | filler-order\"\n            \" | instance-order | option\"\n        ),\n        description=\"Whether the request is a proposal, plan, or an original order.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposal\",\n                \"plan\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    medication: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"medication\",\n        title=\"Medication to be taken\",\n        description=(\n            \"Identifies the medication being requested. This is a link to a \"\n            \"resource that represents the medication which may be the details of \"\n            \"the medication or simply an attribute carrying a code that identifies \"\n            \"the medication from a known list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Information about the prescription\",\n        description=(\n            \"Extra information about the prescription that could not be conveyed by\"\n            \" the other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Intended performer of administration\",\n        description=(\n            \"The specified desired performer of the medication treatment (e.g. the \"\n            \"performer of the medication administration).  For devices, this is the\"\n            \" device that is intended to perform the administration of the \"\n            \"medication.  An IV Pump would be an example of a device that is \"\n            \"performing the administration.  Both the IV Pump and the practitioner \"\n            \"that set the rate or bolus on the pump can be listed as performers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"DeviceDefinition\",\n                \"RelatedPerson\",\n                \"CareTeam\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    performerType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=\"Desired kind of performer of the medication administration\",\n        description=(\n            \"Indicates the type of performer of the administration of the \"\n            \"medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    priorPrescription: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"priorPrescription\",\n        title=(\n            \"Reference to an order/prescription that is being replaced by this \"\n            \"MedicationRequest\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicationRequest\"],\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the Medication Request should be addressed with \"\n            \"respect to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason or indication for ordering or not ordering the medication\",\n        description=(\n            \"The reason or the indication for ordering or not ordering the \"\n            \"medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\"],\n        },\n    )\n\n    recorder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recorder\",\n        title=\"Person who entered the request\",\n        description=(\n            \"The person who entered the order on behalf of another individual for \"\n            \"example in the case of a verbal or a telephone order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    renderedDosageInstruction: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"renderedDosageInstruction\",\n        title=\"Full representation of the dosage instructions\",\n        description=(\n            \"The full representation of the dose of the medication included in all \"\n            \"dosage instructions.  To be used when multiple dosage instructions are\"\n            \" included to represent complex dosing such as increasing or tapering \"\n            \"doses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    renderedDosageInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_renderedDosageInstruction\",\n        title=\"Extension field for ``renderedDosageInstruction``.\",\n    )\n\n    reported: bool | None = Field(\n        default=None,\n        alias=\"reported\",\n        title=\"Reported rather than primary record\",\n        description=(\n            \"Indicates if this record was captured as a secondary 'reported' record\"\n            \" rather than as an original primary source-of-truth record.  It may \"\n            \"also indicate the source of the report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    reported__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reported\", title=\"Extension field for ``reported``.\"\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/What requested the Request\",\n        description=(\n            \"The individual, organization, or device that initiated the request and\"\n            \" has responsibility for its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"active | on-hold | ended | stopped | completed | cancelled | entered-\"\n            \"in-error | draft | unknown\"\n        ),\n        description=(\n            \"A code specifying the current state of the order.  Generally, this \"\n            \"will be active or completed state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"active\",\n                \"on-hold\",\n                \"ended\",\n                \"stopped\",\n                \"completed\",\n                \"cancelled\",\n                \"entered-in-error\",\n                \"draft\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusChanged: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"statusChanged\",\n        title=\"When the status was changed\",\n        description=\"The date (and perhaps time) when the status was changed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    statusChanged__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_statusChanged\",\n        title=\"Extension field for ``statusChanged``.\",\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current state of the MedicationRequest.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Individual or group for whom the medication has been requested\",\n        description=\"The individual or group for whom the medication has been requested.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    substitution: fhirtypes.MedicationRequestSubstitutionType | None = Field(\n        default=None,\n        alias=\"substitution\",\n        title=\"Any restrictions on medication substitution\",\n        description=(\n            \"Indicates whether or not substitution can or should be part of the \"\n            \"dispense. In some cases, substitution must happen, in other cases \"\n            \"substitution must not happen. This block explains the prescriber's \"\n            \"intent. If nothing is specified substitution may be done.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Information to support fulfilling of the medication\",\n        description=(\n            \"Information to support fulfilling (i.e. dispensing or administering) \"\n            \"of the medication, for example, patient height and weight, a \"\n            \"MedicationStatement for the patient).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"priorPrescription\",\n            \"groupIdentifier\",\n            \"status\",\n            \"statusReason\",\n            \"statusChanged\",\n            \"intent\",\n            \"category\",\n            \"priority\",\n            \"doNotPerform\",\n            \"medication\",\n            \"subject\",\n            \"informationSource\",\n            \"encounter\",\n            \"supportingInformation\",\n            \"authoredOn\",\n            \"requester\",\n            \"reported\",\n            \"performerType\",\n            \"performer\",\n            \"device\",\n            \"recorder\",\n            \"reason\",\n            \"courseOfTherapyType\",\n            \"insurance\",\n            \"note\",\n            \"renderedDosageInstruction\",\n            \"effectiveDosePeriod\",\n            \"dosageInstruction\",\n            \"dispenseRequest\",\n            \"substitution\",\n            \"eventHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"doNotPerform\",\n            \"medication\",\n            \"subject\",\n            \"authoredOn\",\n            \"requester\",\n            \"reported\",\n            \"performerType\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass MedicationRequestDispenseRequest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Medication supply authorization.\n    Indicates the specific details for the dispense or medication supply part\n    of a medication request (also known as a Medication Prescription or\n    Medication Order).  Note that this information is not always sent with the\n    order.  There may be in some settings (e.g. hospitals) institutional or\n    system support for completing the dispense details in the pharmacy\n    department.\n    \"\"\"\n\n    __resource_type__ = \"MedicationRequestDispenseRequest\"\n\n    dispenseInterval: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"dispenseInterval\",\n        title=\"Minimum period of time between dispenses\",\n        description=(\n            \"The minimum period of time that must occur between dispenses of the \"\n            \"medication.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dispenser: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"dispenser\",\n        title=\"Intended performer of dispense\",\n        description=(\n            \"Indicates the intended performing Organization that will dispense the \"\n            \"medication as specified by the prescriber.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    dispenserInstruction: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"dispenserInstruction\",\n        title=\"Additional information for the dispenser\",\n        description=(\n            \"Provides additional information to the dispenser, for example, \"\n            \"counselling to be provided to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    doseAdministrationAid: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"doseAdministrationAid\",\n        title=\"Type of adherence packaging to use for the dispense\",\n        description=(\n            \"Provides information about the type of adherence packaging to be \"\n            \"supplied for the medication dispense.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    expectedSupplyDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"expectedSupplyDuration\",\n        title=\"Number of days supply per dispense\",\n        description=(\n            \"Identifies the period time over which the supplied product is expected\"\n            \" to be used, or the length of time the dispense is expected to last.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    initialFill: fhirtypes.MedicationRequestDispenseRequestInitialFillType | None = (\n        Field(\n            default=None,\n            alias=\"initialFill\",\n            title=\"First fill details\",\n            description=(\n                \"Indicates the quantity or duration for the first dispense of the \"\n                \"medication.\"\n            ),\n            json_schema_extra={\n                \"element_property\": True,\n            },\n        )\n    )\n\n    numberOfRepeatsAllowed: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"numberOfRepeatsAllowed\",\n        title=\"Number of refills authorized\",\n        description=(\n            \"An integer indicating the number of times, in addition to the original\"\n            \" dispense, (aka refills or repeats) that the patient can receive the \"\n            \"prescribed medication. Usage Notes: This integer does not include the \"\n            \"original order dispense. This means that if an order indicates \"\n            'dispense 30 tablets plus \"3 repeats\", then the order can be dispensed '\n            \"a total of 4 times and the patient can receive a total of 120 tablets.\"\n            \"  A prescriber may explicitly say that zero refills are permitted \"\n            \"after the initial dispense.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    numberOfRepeatsAllowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfRepeatsAllowed\",\n        title=\"Extension field for ``numberOfRepeatsAllowed``.\",\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount of medication to supply per dispense\",\n        description=\"The amount that is to be dispensed for one fill.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    validityPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"validityPeriod\",\n        title=\"Time period supply is authorized for\",\n        description=(\n            \"This indicates the validity period of a prescription (stale dating the\"\n            \" Prescription).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationRequestDispenseRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"initialFill\",\n            \"dispenseInterval\",\n            \"validityPeriod\",\n            \"numberOfRepeatsAllowed\",\n            \"quantity\",\n            \"expectedSupplyDuration\",\n            \"dispenser\",\n            \"dispenserInstruction\",\n            \"doseAdministrationAid\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationRequestDispenseRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationRequestDispenseRequestInitialFill(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    First fill details.\n    Indicates the quantity or duration for the first dispense of the\n    medication.\n    \"\"\"\n\n    __resource_type__ = \"MedicationRequestDispenseRequestInitialFill\"\n\n    duration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"First fill duration\",\n        description=\"The length of time that the first dispense is expected to last.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"First fill quantity\",\n        description=\"The amount or quantity to provide as part of the first dispense.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationRequestDispenseRequestInitialFill`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"quantity\", \"duration\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationRequestDispenseRequestInitialFill`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass MedicationRequestSubstitution(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Any restrictions on medication substitution.\n    Indicates whether or not substitution can or should be part of the\n    dispense. In some cases, substitution must happen, in other cases\n    substitution must not happen. This block explains the prescriber's intent.\n    If nothing is specified substitution may be done.\n    \"\"\"\n\n    __resource_type__ = \"MedicationRequestSubstitution\"\n\n    allowedBoolean: bool | None = Field(\n        default=None,\n        alias=\"allowedBoolean\",\n        title=\"Whether substitution is allowed or not\",\n        description=(\n            \"True if the prescriber allows a different drug to be dispensed from \"\n            \"what was prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": True,\n        },\n    )\n    allowedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_allowedBoolean\",\n        title=\"Extension field for ``allowedBoolean``.\",\n    )\n\n    allowedCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"allowedCodeableConcept\",\n        title=\"Whether substitution is allowed or not\",\n        description=(\n            \"True if the prescriber allows a different drug to be dispensed from \"\n            \"what was prescribed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e allowed[x]\n            \"one_of_many\": \"allowed\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why should (not) substitution be made\",\n        description=(\n            \"Indicates the reason for the substitution, or why substitution must or\"\n            \" must not be performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationRequestSubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"allowedBoolean\",\n            \"allowedCodeableConcept\",\n            \"reason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationRequestSubstitution`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"allowed\": [\"allowedBoolean\", \"allowedCodeableConcept\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/medicationstatement.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationStatement\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicationStatement(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Record of medication being taken by a patient.\n    A record of a medication that is being consumed by a patient.   A\n    MedicationStatement may indicate that the patient may be taking the\n    medication now or has taken the medication in the past or will be taking\n    the medication in the future.  The source of this information can be the\n    patient, significant other (such as a family member or spouse), or a\n    clinician.  A common scenario where this information is captured is during\n    the history taking process during a patient visit or stay.   The medication\n    information may come from sources such as the patient's memory, from a\n    prescription bottle,  or from a list of medications the patient, clinician\n    or other party maintains.\n\n    The primary difference between a medicationstatement and a\n    medicationadministration is that the medication administration has complete\n    administration information and is based on actual administration\n    information from the person who administered the medication.  A\n    medicationstatement is often, if not always, less specific.  There is no\n    required date/time when the medication was administered, in fact we only\n    know that a source has reported the patient is taking this medication,\n    where details such as time, quantity, or rate or even medication product\n    may be incomplete or missing or less precise.  As stated earlier, the\n    Medication Statement information may come from the patient's memory, from a\n    prescription bottle or from a list of medications the patient, clinician or\n    other party maintains.  Medication administration is more formal and is not\n    missing detailed information.\n\n    The MedicationStatement resource was previously called MedicationStatement.\n    \"\"\"\n\n    __resource_type__ = \"MedicationStatement\"\n\n    adherence: fhirtypes.MedicationStatementAdherenceType | None = Field(\n        default=None,\n        alias=\"adherence\",\n        title=(\n            \"Indicates whether the medication is or is not being consumed or \"\n            \"administered\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Type of medication statement\",\n        description=(\n            \"Type of medication statement (for example, drug classification like \"\n            \"ATC, where meds would be administered, legal category of the \"\n            \"medication.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dateAsserted: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateAsserted\",\n        title=\"When the usage was asserted?\",\n        description=(\n            \"The date when the Medication Statement was asserted by the information\"\n            \" source.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    dateAsserted__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_dateAsserted\",\n        title=\"Extension field for ``dateAsserted``.\",\n    )\n\n    derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Link to information used to derive the MedicationStatement\",\n        description=(\n            \"Allows linking the MedicationStatement to the underlying \"\n            \"MedicationRequest, or to other information that supports or is used to\"\n            \" derive the MedicationStatement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    dosage: typing.List[fhirtypes.DosageType] | None = Field(\n        default=None,\n        alias=\"dosage\",\n        title=\"Details of how medication is/was taken or should be taken\",\n        description=\"Indicates how the medication is/was or should be taken by the patient.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"The date/time or interval when the medication is/was/will be taken\",\n        description=(\n            \"The interval of time during which it is being asserted that the \"\n            \"patient is/was/will be taking the medication (or was not taking, when \"\n            \"the MedicationStatement.adherence element is Not Taking).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"The date/time or interval when the medication is/was/will be taken\",\n        description=(\n            \"The interval of time during which it is being asserted that the \"\n            \"patient is/was/will be taking the medication (or was not taking, when \"\n            \"the MedicationStatement.adherence element is Not Taking).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    effectiveTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"effectiveTiming\",\n        title=\"The date/time or interval when the medication is/was/will be taken\",\n        description=(\n            \"The interval of time during which it is being asserted that the \"\n            \"patient is/was/will be taking the medication (or was not taking, when \"\n            \"the MedicationStatement.adherence element is Not Taking).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter associated with MedicationStatement\",\n        description=(\n            \"The encounter that establishes the context for this \"\n            \"MedicationStatement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifiers associated with this Medication Statement that are defined\"\n            \" by business processes and/or used to refer to it when a direct URL \"\n            \"reference to the resource itself is not appropriate. They are business\"\n            \" identifiers assigned to this resource by the performer or other \"\n            \"systems and remain constant as the resource is updated and propagates \"\n            \"from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    informationSource: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"informationSource\",\n        title=(\n            \"Person or organization that provided the information about the taking \"\n            \"of this medication\"\n        ),\n        description=(\n            \"The person or organization that provided the information about the \"\n            \"taking of this medication. Note: Use derivedFrom when a \"\n            \"MedicationStatement is derived from other resources, e.g. Claim or \"\n            \"MedicationRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    medication: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"medication\",\n        title=\"What medication was taken\",\n        description=(\n            \"Identifies the medication being administered. This is either a link to\"\n            \" a resource representing the details of the medication or a simple \"\n            \"attribute carrying a code that identifies the medication from a known \"\n            \"list of medications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Medication\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Further information about the usage\",\n        description=(\n            \"Provides extra information about the Medication Statement that is not \"\n            \"conveyed by the other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=(\n            \"A larger event of which this particular MedicationStatement is a \"\n            \"component or step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\", \"MedicationStatement\"],\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason for why the medication is being/was taken\",\n        description=(\n            \"A concept, Condition or observation that supports why the medication \"\n            \"is being/was taken.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\", \"Observation\", \"DiagnosticReport\"],\n        },\n    )\n\n    relatedClinicalInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relatedClinicalInformation\",\n        title=\"Link to information relevant to the usage of a medication\",\n        description=(\n            \"Link to information that is relevant to a medication statement, for \"\n            \"example, illicit drug use, gestational age, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\", \"Condition\"],\n        },\n    )\n\n    renderedDosageInstruction: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"renderedDosageInstruction\",\n        title=\"Full representation of the dosage instructions\",\n        description=(\n            \"The full representation of the dose of the medication included in all \"\n            \"dosage instructions.  To be used when multiple dosage instructions are\"\n            \" included to represent complex dosing such as increasing or tapering \"\n            \"doses.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    renderedDosageInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_renderedDosageInstruction\",\n        title=\"Extension field for ``renderedDosageInstruction``.\",\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"recorded | entered-in-error | draft\",\n        description=\"A code representing the status of recording the medication statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"recorded\", \"entered-in-error\", \"draft\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who is/was taking  the medication\",\n        description=\"The person, animal or group who is/was taking the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"partOf\",\n            \"status\",\n            \"category\",\n            \"medication\",\n            \"subject\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"effectiveTiming\",\n            \"dateAsserted\",\n            \"informationSource\",\n            \"derivedFrom\",\n            \"reason\",\n            \"note\",\n            \"relatedClinicalInformation\",\n            \"renderedDosageInstruction\",\n            \"dosage\",\n            \"adherence\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"category\",\n            \"medication\",\n            \"subject\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"effectiveTiming\",\n            \"dateAsserted\",\n            \"adherence\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"effective\": [\"effectiveDateTime\", \"effectivePeriod\", \"effectiveTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass MedicationStatementAdherence(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Indicates whether the medication is or is not being consumed or\n    administered.\n    \"\"\"\n\n    __resource_type__ = \"MedicationStatementAdherence\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of adherence\",\n        description=\"Type of the adherence for the medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Details of the reason for the current use of the medication\",\n        description=\"Captures the reason for the current use or adherence of a medication.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicationStatementAdherence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"reason\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicationStatementAdherence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/medicinalproductdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicinalProductDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MedicinalProductDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Detailed definition of a medicinal product.\n    A medicinal product, being a substance or combination of substances that is\n    intended to treat, prevent or diagnose a disease, or to restore, correct or\n    modify physiological functions by exerting a pharmacological, immunological\n    or metabolic action. This resource is intended to define and detail such\n    products and their properties, for uses other than direct patient care\n    (e.g. regulatory use, or drug catalogs).\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinition\"\n\n    additionalMonitoringIndicator: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"additionalMonitoringIndicator\",\n        title=(\n            \"Whether the Medicinal Product is subject to additional monitoring for \"\n            \"regulatory reasons\"\n        ),\n        description=(\n            \"Whether the Medicinal Product is subject to additional monitoring for \"\n            \"regulatory reasons, such as heightened reporting requirements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    attachedDocument: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"attachedDocument\",\n        title=\"Additional documentation about the medicinal product\",\n        description=(\n            \"Additional information or supporting documentation about the medicinal\"\n            \" product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    characteristic: typing.List[\n        fhirtypes.MedicinalProductDefinitionCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title='Key product features such as \"sugar free\", \"modified release\"',\n        description=(\n            'Allows the key product features to be recorded, such as \"sugar free\", '\n            '\"modified release\", \"parallel import\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    classification: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=\"Allows the product to be classified by various systems\",\n        description=(\n            \"Allows the product to be classified by various systems, commonly WHO \"\n            \"ATC.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    clinicalTrial: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"clinicalTrial\",\n        title=\"Clinical trials or studies that this product is involved in\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchStudy\"],\n        },\n    )\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"A code that this product is known by, within some formal terminology\",\n        description=(\n            \"A code that this product is known by, usually within some formal \"\n            \"terminology, perhaps assigned by a third party (i.e. not the \"\n            \"manufacturer or regulator). Products (types of medications) tend to be\"\n            \" known by identifiers during development and within regulatory \"\n            \"process. However when they are prescribed they tend to be identified \"\n            \"by codes. The same product may be have multiple codes, applied to it \"\n            \"by multiple organizations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    combinedPharmaceuticalDoseForm: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"combinedPharmaceuticalDoseForm\",\n        title=(\n            \"The dose form for a single part product, or combined form of a \"\n            \"multiple part product\"\n        ),\n        description=(\n            \"The dose form for a single part product, or combined form of a \"\n            \"multiple part product. This is one concept that describes all the \"\n            \"components. It does not represent the form with components physically \"\n            \"mixed, if that might be necessary, for which see \"\n            \"(AdministrableProductDefinition.administrableDoseForm).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    comprisedOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"comprisedOf\",\n        title=(\n            \"Types of medicinal manufactured items and/or devices that this product\"\n            \" consists of, such as tablets, capsule, or syringes\"\n        ),\n        description=(\n            \"Types of medicinal manufactured items and/or devices that this product\"\n            \" consists of, such as tablets, capsule, or syringes. Used as a direct \"\n            \"link when the item's packaging is not being recorded (see also \"\n            \"PackagedProductDefinition.package.containedItem.item).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ManufacturedItemDefinition\", \"DeviceDefinition\"],\n        },\n    )\n\n    contact: typing.List[\n        fhirtypes.MedicinalProductDefinitionContactType\n    ] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"A product specific contact, person (in a role), or an organization\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    crossReference: typing.List[\n        fhirtypes.MedicinalProductDefinitionCrossReferenceType\n    ] | None = Field(\n        default=None,\n        alias=\"crossReference\",\n        title=(\n            \"Reference to another product, e.g. for linking authorised to \"\n            \"investigational product\"\n        ),\n        description=(\n            \"Reference to another product, e.g. for linking authorised to \"\n            \"investigational product, or a virtual product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"General description of this product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    domain: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"domain\",\n        title=\"If this medicine applies to human or veterinary uses\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for this product. Could be an MPID\",\n        description=(\n            \"Business identifier for this product. Could be an MPID. When in \"\n            \"development or being regulated, products are typically referenced by \"\n            \"official identifiers, assigned by a manufacturer or regulator, and \"\n            \"unique to a product (which, when compared to a product instance being \"\n            \"prescribed, is actually a product type). See also \"\n            \"MedicinalProductDefinition.code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    impurity: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"impurity\",\n        title=(\n            \"Any component of the drug product which is not the chemical entity \"\n            \"defined as the drug substance, or an excipient in the drug product\"\n        ),\n        description=(\n            \"Any component of the drug product which is not the chemical entity \"\n            \"defined as the drug substance, or an excipient in the drug product. \"\n            \"This includes process-related impurities and contaminants, product-\"\n            \"related impurities including degradation products.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceDefinition\"],\n        },\n    )\n\n    indication: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"indication\",\n        title=(\n            \"Description of indication(s) for this product, used when structured \"\n            \"indications are not required\"\n        ),\n        description=(\n            \"Description of indication(s) for this product, used when structured \"\n            \"indications are not required. In cases where structured indications \"\n            \"are required, they are captured using the ClinicalUseDefinition \"\n            \"resource. An indication is a medical situation for which using the \"\n            \"product is appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    indication__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_indication\", title=\"Extension field for ``indication``.\"\n    )\n\n    ingredient: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=(\n            \"The ingredients of this medicinal product - when not detailed in other\"\n            \" resources\"\n        ),\n        description=(\n            \"The ingredients of this medicinal product - when not detailed in other\"\n            \" resources. This is only needed if the ingredients are not specified \"\n            \"by incoming references from the Ingredient resource, or indirectly via\"\n            \" incoming AdministrableProductDefinition, PackagedProductDefinition or\"\n            \" ManufacturedItemDefinition references. In cases where those levels of\"\n            \" detail are not used, the ingredients may be specified directly here \"\n            \"as codes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    legalStatusOfSupply: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"legalStatusOfSupply\",\n        title=(\n            \"The legal status of supply of the medicinal product as classified by \"\n            \"the regulator\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    marketingStatus: typing.List[fhirtypes.MarketingStatusType] | None = Field(\n        default=None,\n        alias=\"marketingStatus\",\n        title=(\n            \"Marketing status of the medicinal product, in contrast to marketing \"\n            \"authorization\"\n        ),\n        description=(\n            \"Marketing status of the medicinal product, in contrast to marketing \"\n            \"authorization. This refers to the product being actually 'on the \"\n            \"market' as opposed to being allowed to be on the market (which is an \"\n            \"authorization).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    masterFile: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"masterFile\",\n        title=(\n            \"A master file for the medicinal product (e.g. Pharmacovigilance System\"\n            \" Master File)\"\n        ),\n        description=(\n            \"A master file for the medicinal product (e.g. Pharmacovigilance System\"\n            \" Master File). Drug master files (DMFs) are documents submitted to \"\n            \"regulatory agencies to provide confidential detailed information about\"\n            \" facilities, processes or articles used in the manufacturing, \"\n            \"processing, packaging and storing of drug products.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    name: typing.List[fhirtypes.MedicinalProductDefinitionNameType] = Field(\n        default=...,\n        alias=\"name\",\n        title=\"The product's name, including full name and possibly coded parts\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    operation: typing.List[\n        fhirtypes.MedicinalProductDefinitionOperationType\n    ] | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"A manufacturing or administrative process for the medicinal product\",\n        description=(\n            \"A manufacturing or administrative process or step associated with (or \"\n            \"performed on) the medicinal product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    packagedMedicinalProduct: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"packagedMedicinalProduct\",\n        title=\"Package type for the product\",\n        description=(\n            \"Package type for the product. See also the PackagedProductDefinition \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    pediatricUseIndicator: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"pediatricUseIndicator\",\n        title=\"If authorised for use in children\",\n        description=\"If authorised for use in children, or infants, neonates etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    route: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"route\",\n        title=(\n            \"The path by which the product is taken into or makes contact with the \"\n            \"body\"\n        ),\n        description=(\n            \"The path by which the product is taken into or makes contact with the \"\n            \"body. In some regions this is referred to as the licenced or approved \"\n            \"route. See also AdministrableProductDefinition resource. \"\n            \"MedicinalProductDefinition.route is the same concept as \"\n            \"AdministrableProductDefinition.routeOfAdministration.code, and they \"\n            \"cannot be used together.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specialMeasures: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialMeasures\",\n        title=(\n            \"Whether the Medicinal Product is subject to special measures for \"\n            \"regulatory reasons\"\n        ),\n        description=(\n            \"Whether the Medicinal Product is subject to special measures for \"\n            \"regulatory reasons, such as a requirement to conduct post-\"\n            \"authorization studies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"The status within the lifecycle of this product record\",\n        description=(\n            \"The status within the lifecycle of this product record. A high-level \"\n            \"status, this is not intended to duplicate details carried elsewhere \"\n            \"such as legal status, or authorization status.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    statusDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"The date at which the given status became applicable\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Regulatory type, e.g. Investigational or Authorized\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"A business identifier relating to a specific version of the product\",\n        description=(\n            \"A business identifier relating to a specific version of the product, \"\n            \"this is commonly used to support revisions to an existing product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"domain\",\n            \"version\",\n            \"status\",\n            \"statusDate\",\n            \"description\",\n            \"combinedPharmaceuticalDoseForm\",\n            \"route\",\n            \"indication\",\n            \"legalStatusOfSupply\",\n            \"additionalMonitoringIndicator\",\n            \"specialMeasures\",\n            \"pediatricUseIndicator\",\n            \"classification\",\n            \"marketingStatus\",\n            \"packagedMedicinalProduct\",\n            \"comprisedOf\",\n            \"ingredient\",\n            \"impurity\",\n            \"attachedDocument\",\n            \"masterFile\",\n            \"contact\",\n            \"clinicalTrial\",\n            \"code\",\n            \"name\",\n            \"crossReference\",\n            \"operation\",\n            \"characteristic\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"domain\",\n            \"version\",\n            \"status\",\n            \"statusDate\",\n            \"description\",\n            \"combinedPharmaceuticalDoseForm\",\n            \"route\",\n            \"indication\",\n            \"legalStatusOfSupply\",\n            \"additionalMonitoringIndicator\",\n            \"specialMeasures\",\n            \"pediatricUseIndicator\",\n            \"classification\",\n            \"marketingStatus\",\n            \"packagedMedicinalProduct\",\n            \"comprisedOf\",\n            \"ingredient\",\n            \"impurity\",\n            \"attachedDocument\",\n            \"masterFile\",\n            \"contact\",\n            \"clinicalTrial\",\n            \"code\",\n            \"name\",\n            \"crossReference\",\n            \"operation\",\n            \"characteristic\",\n        ]\n\n\nclass MedicinalProductDefinitionCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Key product features such as \"sugar free\", \"modified release\".\n    Allows the key product features to be recorded, such as \"sugar free\",\n    \"modified release\", \"parallel import\".\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionCharacteristic\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"A code expressing the type of characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"A value for the characteristic\",\n        description=\"A value for the characteristic.text.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"A value for the characteristic\",\n        description=\"A value for the characteristic.text.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"A value for the characteristic\",\n        description=\"A value for the characteristic.text.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"A value for the characteristic\",\n        description=\"A value for the characteristic.text.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"A value for the characteristic\",\n        description=\"A value for the characteristic.text.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"A value for the characteristic\",\n        description=\"A value for the characteristic.text.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"A value for the characteristic\",\n        description=\"A value for the characteristic.text.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueMarkdown\",\n            \"valueQuantity\",\n            \"valueInteger\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueMarkdown\",\n            \"valueQuantity\",\n            \"valueInteger\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDate\",\n                \"valueInteger\",\n                \"valueMarkdown\",\n                \"valueQuantity\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass MedicinalProductDefinitionContact(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A product specific contact, person (in a role), or an organization.\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionContact\"\n\n    contact: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"contact\",\n        title=\"A product specific contact, person (in a role), or an organization\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"PractitionerRole\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Allows the contact to be classified, for example QPPV, \"\n            \"Pharmacovigilance Enquiry Information\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"contact\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"contact\"]\n\n\nclass MedicinalProductDefinitionCrossReference(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Reference to another product, e.g. for linking authorised to\n    investigational product.\n    Reference to another product, e.g. for linking authorised to\n    investigational product, or a virtual product.\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionCrossReference\"\n\n    product: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"product\",\n        title=(\n            \"Reference to another product, e.g. for linking authorised to \"\n            \"investigational product\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicinalProductDefinition\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"The type of relationship, for instance branded to generic or virtual \"\n            \"to actual product\"\n        ),\n        description=(\n            \"The type of relationship, for instance branded to generic, virtual to \"\n            \"actual product, product to development product (investigational), \"\n            \"parallel import version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionCrossReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"product\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionCrossReference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"product\", \"type\"]\n\n\nclass MedicinalProductDefinitionName(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The product's name, including full name and possibly coded parts.\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionName\"\n\n    part: typing.List[fhirtypes.MedicinalProductDefinitionNamePartType] | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"Coding words or phrases of the name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    productName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"productName\",\n        title=\"The full product name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    productName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_productName\", title=\"Extension field for ``productName``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of product name, such as rINN, BAN, Proprietary, Non-Proprietary\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    usage: typing.List[\n        fhirtypes.MedicinalProductDefinitionNameUsageType\n    ] | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Country and jurisdiction where the name applies\",\n        description=(\n            \"Country and jurisdiction where the name applies, and associated \"\n            \"language.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"productName\",\n            \"type\",\n            \"part\",\n            \"usage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"productName\", \"type\", \"part\", \"usage\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"productName\", \"productName__ext\")]\n        return required_fields\n\n\nclass MedicinalProductDefinitionNamePart(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Coding words or phrases of the name.\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionNamePart\"\n\n    part: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"A fragment of a product name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    part__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_part\", title=\"Extension field for ``part``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Identifying type for this part of the name (e.g. strength part)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionNamePart`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"part\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionNamePart`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"part\", \"type\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"part\", \"part__ext\")]\n        return required_fields\n\n\nclass MedicinalProductDefinitionNameUsage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Country and jurisdiction where the name applies.\n    Country and jurisdiction where the name applies, and associated language.\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionNameUsage\"\n\n    country: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"country\",\n        title=\"Country code for where this name applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Jurisdiction code for where this name applies\",\n        description=(\n            \"Jurisdiction code for where this name applies. A jurisdiction may be a\"\n            \" sub- or supra-national entity (e.g. a state or a geographic region).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    language: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"language\",\n        title=\"Language code for this name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionNameUsage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"country\",\n            \"jurisdiction\",\n            \"language\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionNameUsage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"country\", \"jurisdiction\", \"language\"]\n\n\nclass MedicinalProductDefinitionOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A manufacturing or administrative process for the medicinal product.\n    A manufacturing or administrative process or step associated with (or\n    performed on) the medicinal product.\n    \"\"\"\n\n    __resource_type__ = \"MedicinalProductDefinitionOperation\"\n\n    confidentialityIndicator: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"confidentialityIndicator\",\n        title=(\n            \"Specifies whether this process is considered proprietary or \"\n            \"confidential\"\n        ),\n        description=(\n            \"Specifies whether this particular business or manufacturing process is\"\n            \" considered proprietary or confidential.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    effectiveDate: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectiveDate\",\n        title=\"Date range of applicability\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    organization: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=(\n            \"The organization responsible for the particular process, e.g. the \"\n            \"manufacturer or importer\"\n        ),\n        description=(\n            \"The organization or establishment responsible for (or associated with)\"\n            \" the particular process or step, examples include the manufacturer, \"\n            \"importer, agent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    type: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"The type of manufacturing operation e.g. manufacturing itself, re-\"\n            \"packaging\"\n        ),\n        description=(\n            \"The type of manufacturing operation e.g. manufacturing itself, re-\"\n            \"packaging. For the authorization of this, a RegulatedAuthorization \"\n            \"would point to the same plan or activity referenced here.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MedicinalProductDefinitionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"effectiveDate\",\n            \"organization\",\n            \"confidentialityIndicator\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MedicinalProductDefinitionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"effectiveDate\",\n            \"organization\",\n            \"confidentialityIndicator\",\n        ]\n"
  },
  {
    "path": "fhir/resources/messagedefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MessageDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MessageDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A resource that defines a type of message that can be exchanged between\n    systems.\n    Defines the characteristics of a message that can be shared between\n    systems, including the type of event that initiates the message, the\n    content to be transmitted and what response(s), if any, are permitted.\n    \"\"\"\n\n    __resource_type__ = \"MessageDefinition\"\n\n    allowedResponse: typing.List[\n        fhirtypes.MessageDefinitionAllowedResponseType\n    ] | None = Field(\n        default=None,\n        alias=\"allowedResponse\",\n        title=\"Responses to this message\",\n        description=(\n            \"Indicates what types of messages may be sent as an application-level \"\n            \"response to this message.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    base: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"Definition this one is based on\",\n        description=(\n            \"The MessageDefinition that is the basis for the contents of this \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n    base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_base\", title=\"Extension field for ``base``.\"\n    )\n\n    category: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"consequence | currency | notification\",\n        description=\"The impact of the content of the message.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"consequence\", \"currency\", \"notification\"],\n        },\n    )\n    category__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_category\", title=\"Extension field for ``category``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the message definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the message definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the message definition was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the message definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the message definition\",\n        description=(\n            \"A free text natural language description of the message definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    eventCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"eventCoding\",\n        title=\"Event code  or link to the EventDefinition\",\n        description=\"Event code or link to the EventDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e event[x]\n            \"one_of_many\": \"event\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    eventUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"eventUri\",\n        title=\"Event code  or link to the EventDefinition\",\n        description=\"Event code or link to the EventDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e event[x]\n            \"one_of_many\": \"event\",\n            \"one_of_many_required\": True,\n        },\n    )\n    eventUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_eventUri\", title=\"Extension field for ``eventUri``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this message definition is authored \"\n            \"for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    focus: typing.List[fhirtypes.MessageDefinitionFocusType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"Resource(s) that are the subject of the event\",\n        description=(\n            \"Identifies the resource (or resources) that are being addressed by the\"\n            \" event.  For example, the Encounter for an admit message or two \"\n            \"Account records for a merge.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    graph: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"graph\",\n        title=\"Canonical reference to a GraphDefinition\",\n        description=(\n            \"Graph is Canonical reference to a GraphDefinition. If a URL is \"\n            \"provided, it is the canonical reference to a GraphDefinition that it \"\n            \"controls what additional resources are to be added to the Bundle when \"\n            \"building the message. The GraphDefinition can also specify profiles \"\n            \"that apply to the various resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"GraphDefinition\"],\n        },\n    )\n    graph__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_graph\", title=\"Extension field for ``graph``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for a given MessageDefinition\",\n        description=(\n            \"A formal identifier that is used to identify this message definition \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for message definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the message definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this message definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the message definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    parent: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Protocol/workflow this is part of\",\n        description=(\n            \"Identifies a protocol or workflow that this MessageDefinition \"\n            \"represents a step in.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n    parent__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_parent\", title=\"Extension field for ``parent``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the message definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this message definition is defined\",\n        description=(\n            \"Explanation of why this message definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    replaces: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"Takes the place of\",\n        description=\"A MessageDefinition that is superseded by this definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n    replaces__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_replaces\", title=\"Extension field for ``replaces``.\"\n    )\n\n    responseRequired: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"responseRequired\",\n        title=\"always | on-error | never | on-success\",\n        description=(\n            \"Declare at a message definition level whether a response is required \"\n            \"or only upon error or success, or never.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"always\", \"on-error\", \"never\", \"on-success\"],\n        },\n    )\n    responseRequired__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_responseRequired\",\n        title=\"Extension field for ``responseRequired``.\",\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this message definition. Enables tracking the life-cycle\"\n            \" of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this message definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the message definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"The cannonical URL for a given MessageDefinition\",\n        description=(\n            \"The business identifier that is used to reference the \"\n            \"MessageDefinition and *is* expected to be consistent from server to \"\n            \"server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate message definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the message definition\",\n        description=(\n            \"The identifier that is used to identify this version of the message \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the message definition\"\n            \" author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"replaces\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"base\",\n            \"parent\",\n            \"eventCoding\",\n            \"eventUri\",\n            \"category\",\n            \"focus\",\n            \"responseRequired\",\n            \"allowedResponse\",\n            \"graph\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"replaces\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"base\",\n            \"parent\",\n            \"eventCoding\",\n            \"eventUri\",\n            \"category\",\n            \"focus\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"date\", \"date__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"event\": [\"eventCoding\", \"eventUri\"],\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"],\n        }\n        return one_of_many_fields\n\n\nclass MessageDefinitionAllowedResponse(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Responses to this message.\n    Indicates what types of messages may be sent as an application-level\n    response to this message.\n    \"\"\"\n\n    __resource_type__ = \"MessageDefinitionAllowedResponse\"\n\n    message: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"message\",\n        title=\"Reference to allowed message definition response\",\n        description=(\n            \"A reference to the message definition that must be adhered to by this \"\n            \"supported response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n    message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_message\", title=\"Extension field for ``message``.\"\n    )\n\n    situation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"situation\",\n        title=\"When should this response be used\",\n        description=(\n            \"Provides a description of the circumstances in which this response \"\n            \"should be used (as opposed to one of the alternative responses).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    situation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_situation\", title=\"Extension field for ``situation``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageDefinitionAllowedResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"message\", \"situation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageDefinitionAllowedResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"message\", \"message__ext\")]\n        return required_fields\n\n\nclass MessageDefinitionFocus(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Resource(s) that are the subject of the event.\n    Identifies the resource (or resources) that are being addressed by the\n    event.  For example, the Encounter for an admit message or two Account\n    records for a merge.\n    \"\"\"\n\n    __resource_type__ = \"MessageDefinitionFocus\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of resource\",\n        description=\"The kind of resource that must be the focus for this message.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum number of focuses of this type\",\n        description=(\n            \"Identifies the maximum number of resources of this type that must be \"\n            \"pointed to by a message in order for it to be valid against this \"\n            \"MessageDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum number of focuses of this type\",\n        description=(\n            \"Identifies the minimum number of resources of this type that must be \"\n            \"pointed to by a message in order for it to be valid against this \"\n            \"MessageDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profile that must be adhered to by focus\",\n        description=(\n            \"A profile that reflects constraints for the focal resource (and \"\n            \"potentially for related resources).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageDefinitionFocus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"profile\", \"min\", \"max\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageDefinitionFocus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"min\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"min\", \"min__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/messageheader.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MessageHeader\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MessageHeader(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A resource that describes a message that is exchanged between systems.\n    The header for a message exchange that is either requesting or responding\n    to an action.  The reference(s) that are the subject of the action as well\n    as other information related to the action are typically transmitted in a\n    bundle in which the MessageHeader resource instance is the first resource\n    in the bundle.\n    \"\"\"\n\n    __resource_type__ = \"MessageHeader\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"The source of the decision\",\n        description=(\n            \"The logical author of the message - the personor device that decided \"\n            \"the described event should happen. When there is more than one \"\n            \"candidate, pick the most proximal to the MessageHeader. Can provide \"\n            \"other authors in extensions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    definition: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Link to the definition for this message\",\n        description=\"Permanent link to the MessageDefinition for this message.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MessageDefinition\"],\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    destination: typing.List[fhirtypes.MessageHeaderDestinationType] | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Message destination application(s)\",\n        description=\"The destination application which the message is intended for.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    eventCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"eventCanonical\",\n        title=\"Event code or link to EventDefinition\",\n        description=(\n            \"Code that identifies the event this message represents and connects it\"\n            \" with its definition. Events defined as part of the FHIR specification\"\n            \" are defined by the implementation.  Alternatively a canonical uri to \"\n            \"the EventDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e event[x]\n            \"one_of_many\": \"event\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EventDefinition\"],\n        },\n    )\n    eventCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_eventCanonical\",\n        title=\"Extension field for ``eventCanonical``.\",\n    )\n\n    eventCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"eventCoding\",\n        title=\"Event code or link to EventDefinition\",\n        description=(\n            \"Code that identifies the event this message represents and connects it\"\n            \" with its definition. Events defined as part of the FHIR specification\"\n            \" are defined by the implementation.  Alternatively a canonical uri to \"\n            \"the EventDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e event[x]\n            \"one_of_many\": \"event\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    focus: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"The actual content of the message\",\n        description=(\n            \"The actual data of the message - a reference to the root/focus class \"\n            \"of the event. This is allowed to be a Parameters resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Cause of event\",\n        description=(\n            \"Coded indication of the cause for the event - indicates  a reason for \"\n            \"the occurrence of the event that is a focus of this message.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    response: fhirtypes.MessageHeaderResponseType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"If this is a reply to prior message\",\n        description=(\n            \"Information about the message that this message is a response to.  \"\n            \"Only present if this message is a response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    responsible: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Final responsibility for event\",\n        description=(\n            \"The person or organization that accepts overall responsibility for the\"\n            \" contents of the message. The implication is that the message event \"\n            \"happened under the policies of the responsible party.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    sender: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sender\",\n        title=\"Real world sender of the message\",\n        description=(\n            \"Identifies the sending system to allow the use of a trust \" \"relationship.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Device\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    source: fhirtypes.MessageHeaderSourceType = Field(\n        default=...,\n        alias=\"source\",\n        title=\"Message source application\",\n        description=\"The source application from which this message originated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageHeader`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"eventCoding\",\n            \"eventCanonical\",\n            \"destination\",\n            \"sender\",\n            \"author\",\n            \"source\",\n            \"responsible\",\n            \"reason\",\n            \"response\",\n            \"focus\",\n            \"definition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageHeader`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"eventCoding\",\n            \"eventCanonical\",\n            \"destination\",\n            \"sender\",\n            \"author\",\n            \"source\",\n            \"responsible\",\n            \"reason\",\n            \"response\",\n            \"focus\",\n            \"definition\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"event\": [\"eventCanonical\", \"eventCoding\"]}\n        return one_of_many_fields\n\n\nclass MessageHeaderDestination(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Message destination application(s).\n    The destination application which the message is intended for.\n    \"\"\"\n\n    __resource_type__ = \"MessageHeaderDestination\"\n\n    endpointReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"endpointReference\",\n        title=\"Actual destination address or Endpoint resource\",\n        description=\"Indicates where the message should be routed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e endpoint[x]\n            \"one_of_many\": \"endpoint\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    endpointUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"endpointUrl\",\n        title=\"Actual destination address or Endpoint resource\",\n        description=\"Indicates where the message should be routed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e endpoint[x]\n            \"one_of_many\": \"endpoint\",\n            \"one_of_many_required\": False,\n        },\n    )\n    endpointUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_endpointUrl\", title=\"Extension field for ``endpointUrl``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of system\",\n        description=\"Human-readable name for the target system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    receiver: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"receiver\",\n        title='Intended \"real-world\" recipient for the data',\n        description=(\n            \"Allows data conveyed by a message to be addressed to a particular \"\n            \"person or department when routing to a specific application isn't \"\n            \"sufficient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    target: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Particular delivery destination within the destination\",\n        description=(\n            \"Identifies the target end system in situations where the initial \"\n            \"message transmission is to an intermediary system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageHeaderDestination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"endpointUrl\",\n            \"endpointReference\",\n            \"name\",\n            \"target\",\n            \"receiver\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageHeaderDestination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"endpointUrl\",\n            \"endpointReference\",\n            \"name\",\n            \"target\",\n            \"receiver\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"endpoint\": [\"endpointReference\", \"endpointUrl\"]}\n        return one_of_many_fields\n\n\nclass MessageHeaderResponse(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If this is a reply to prior message.\n    Information about the message that this message is a response to.  Only\n    present if this message is a response.\n    \"\"\"\n\n    __resource_type__ = \"MessageHeaderResponse\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"ok | transient-error | fatal-error\",\n        description=(\n            \"Code that identifies the type of response to the message - whether it \"\n            \"was successful or not, and whether it should be resent or not.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"ok\", \"transient-error\", \"fatal-error\"],\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    details: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"details\",\n        title=\"Specific list of hints/warnings/errors\",\n        description=\"Full details of any issues found in the message.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationOutcome\"],\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType = Field(\n        default=...,\n        alias=\"identifier\",\n        title=\"Bundle.identifier of original message\",\n        description=(\n            \"The Bundle.identifier of the message to which this message is a \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageHeaderResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"identifier\", \"code\", \"details\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageHeaderResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"code\", \"details\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass MessageHeaderSource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Message source application.\n    The source application from which this message originated.\n    \"\"\"\n\n    __resource_type__ = \"MessageHeaderSource\"\n\n    contact: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Human contact for problems\",\n        description=(\n            \"An e-mail, phone, website or other contact point to use to resolve \"\n            \"issues with message communications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endpointReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"endpointReference\",\n        title=\"Actual source address or Endpoint resource\",\n        description=\"Identifies the routing target to send acknowledgements to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e endpoint[x]\n            \"one_of_many\": \"endpoint\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    endpointUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"endpointUrl\",\n        title=\"Actual source address or Endpoint resource\",\n        description=\"Identifies the routing target to send acknowledgements to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e endpoint[x]\n            \"one_of_many\": \"endpoint\",\n            \"one_of_many_required\": False,\n        },\n    )\n    endpointUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_endpointUrl\", title=\"Extension field for ``endpointUrl``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of system\",\n        description=\"Human-readable name for the source system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    software: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"software\",\n        title=\"Name of software running the system\",\n        description=\"May include configuration or other information useful in debugging.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    software__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_software\", title=\"Extension field for ``software``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version of software running\",\n        description=(\n            \"Can convey versions of multiple systems in situations where a message \"\n            \"passes through multiple hands.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MessageHeaderSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"endpointUrl\",\n            \"endpointReference\",\n            \"name\",\n            \"software\",\n            \"version\",\n            \"contact\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MessageHeaderSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"endpointUrl\",\n            \"endpointReference\",\n            \"name\",\n            \"software\",\n            \"version\",\n            \"contact\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"endpoint\": [\"endpointReference\", \"endpointUrl\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/meta.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Meta\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Meta(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Metadata about a resource.\n    The metadata about a resource. This is content in the resource that is\n    maintained by the infrastructure. Changes to the content might not always\n    be associated with version changes to the resource.\n    \"\"\"\n\n    __resource_type__ = \"Meta\"\n\n    lastUpdated: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"lastUpdated\",\n        title=\"When the resource version last changed\",\n        description=\"When the resource last changed - e.g. when the version changed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastUpdated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lastUpdated\", title=\"Extension field for ``lastUpdated``.\"\n    )\n\n    profile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Profiles this resource claims to conform to\",\n        description=(\n            \"A list of profiles (references to \"\n            \"[StructureDefinition](structuredefinition.html#) resources) that this \"\n            \"resource claims to conform to. The URL is a reference to \"\n            \"[StructureDefinition.url](structuredefinition-\"\n            \"definitions.html#StructureDefinition.url).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    security: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"security\",\n        title=\"Security Labels applied to this resource\",\n        description=(\n            \"Security labels applied to this resource. These tags connect specific \"\n            \"resources to the overall security policy and infrastructure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Identifies where the resource comes from\",\n        description=(\n            \"A uri that identifies the source system of the resource. This provides\"\n            \" a minimal amount of [Provenance](provenance.html#) information that \"\n            \"can be used to track or differentiate the source of information in the\"\n            \" resource. The source may identify another FHIR server, document, \"\n            \"message, database, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    tag: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"tag\",\n        title=\"Tags applied to this resource\",\n        description=(\n            \"Tags applied to this resource. Tags are intended to be used to \"\n            \"identify and relate resources to process and workflow, and \"\n            \"applications are not required to consider the tags when interpreting \"\n            \"the meaning of a resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    versionId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"versionId\",\n        title=\"Version specific identifier\",\n        description=(\n            \"The version specific identifier, as it appears in the version portion \"\n            \"of the URL. This value changes when the resource is created, updated, \"\n            \"or deleted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    versionId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_versionId\", title=\"Extension field for ``versionId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Meta`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"versionId\",\n            \"lastUpdated\",\n            \"source\",\n            \"profile\",\n            \"security\",\n            \"tag\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Meta`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"versionId\", \"lastUpdated\", \"source\", \"profile\", \"security\", \"tag\"]\n"
  },
  {
    "path": "fhir/resources/metadataresource.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MetadataResource\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass MetadataResource(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Common Interface declaration for definitional resources.\n    Common Interface declaration for conformance and knowledge artifact\n    resources.\n    \"\"\"\n\n    __resource_type__ = \"MetadataResource\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the {{title}} was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the {{title}}\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the {{title}}.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the {{title}}\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the {{title}}.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the {{title}} is expected to be used\",\n        description=(\n            \"The period during which the {{title}} content was or is planned to be \"\n            \"in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the {{title}}\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"responsible for officially endorsing the {{title}} for use in some \"\n            \"setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the {{title}} was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, \"\n            \"dependencies, bibliographic references, and predecessor and successor \"\n            \"artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the {{title}}\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"primarily responsible for review of some aspect of the {{title}}.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptive topics related to the content of the {{title}}. Topics \"\n            \"provide a high-level categorization as well as keywords for the \"\n            \"{{title}} that can be useful for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MetadataResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MetadataResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"modifierExtension\", \"effectivePeriod\"]\n"
  },
  {
    "path": "fhir/resources/molecularsequence.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MolecularSequence\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass MolecularSequence(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Representation of a molecular sequence.\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequence\"\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"The method for sequencing\",\n        description=\"The method for sequencing, for example, chip information.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    focus: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=(\n            \"What the molecular sequence is about, when it is not about the subject\"\n            \" of record\"\n        ),\n        description=(\n            \"The actual focus of a molecular sequence when it is not the patient of\"\n            \" record representing something or someone associated with the patient \"\n            \"such as a spouse, parent, child, or sibling. For example, in trio \"\n            \"testing, the subject would be the child (proband) and the focus would \"\n            \"be the parent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    formatted: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"formatted\",\n        title=(\n            \"Embedded file or a link (URL) which contains content to represent the \"\n            \"sequence\"\n        ),\n        description=(\n            \"Sequence that was observed as file content. Can be an actual file \"\n            \"contents, or referenced by a URL to an external system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique ID for this particular sequence\",\n        description=\"A unique identifier for this particular sequence instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    literal: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"literal\",\n        title=\"Sequence that was observed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    literal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_literal\", title=\"Extension field for ``literal``.\"\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who should be responsible for test result\",\n        description=\"The organization or lab that should be responsible for this result.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    relative: typing.List[fhirtypes.MolecularSequenceRelativeType] | None = Field(\n        default=None,\n        alias=\"relative\",\n        title=\"A sequence defined relative to another sequence\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specimen: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Specimen used for sequencing\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Subject this sequence is associated too\",\n        description=\"Indicates the subject this sequence is associated too.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Substance\",\n                \"BiologicallyDerivedProduct\",\n                \"NutritionProduct\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"aa | dna | rna\",\n        description=\"Amino Acid Sequence/ DNA Sequence / RNA Sequence.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"aa\", \"dna\", \"rna\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"subject\",\n            \"focus\",\n            \"specimen\",\n            \"device\",\n            \"performer\",\n            \"literal\",\n            \"formatted\",\n            \"relative\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"subject\",\n            \"focus\",\n            \"specimen\",\n            \"device\",\n            \"performer\",\n            \"literal\",\n            \"formatted\",\n            \"relative\",\n        ]\n\n\nclass MolecularSequenceRelative(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A sequence defined relative to another sequence.\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequenceRelative\"\n\n    coordinateSystem: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"coordinateSystem\",\n        title=\"Ways of identifying nucleotides or amino acids within a sequence\",\n        description=(\n            \"These are different ways of identifying nucleotides or amino acids \"\n            \"within a sequence. Different databases and file types may use \"\n            \"different systems. For detail definitions, see \"\n            \"https://loinc.org/92822-6/ for more detail.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    edit: typing.List[fhirtypes.MolecularSequenceRelativeEditType] | None = Field(\n        default=None,\n        alias=\"edit\",\n        title=\"Changes in sequence from the starting sequence\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ordinalPosition: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"ordinalPosition\",\n        title=(\n            \"Indicates the order in which the sequence should be considered when \"\n            \"putting multiple 'relative' elements together\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    ordinalPosition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_ordinalPosition\",\n        title=\"Extension field for ``ordinalPosition``.\",\n    )\n\n    sequenceRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"sequenceRange\",\n        title=(\n            \"Indicates the nucleotide range in the composed sequence when multiple \"\n            \"'relative' elements are used together\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    startingSequence: fhirtypes.MolecularSequenceRelativeStartingSequenceType | None = (\n        Field(\n            default=None,\n            alias=\"startingSequence\",\n            title=\"A sequence used as starting sequence\",\n            description=(\n                \"A sequence that is used as a starting sequence to describe variants \"\n                \"that are present in a sequence analyzed.\"\n            ),\n            json_schema_extra={\n                \"element_property\": True,\n                \"summary_element_property\": True,\n            },\n        )\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequenceRelative`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"coordinateSystem\",\n            \"ordinalPosition\",\n            \"sequenceRange\",\n            \"startingSequence\",\n            \"edit\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequenceRelative`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"coordinateSystem\", \"startingSequence\", \"edit\"]\n\n\nclass MolecularSequenceRelativeEdit(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Changes in sequence from the starting sequence.\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequenceRelativeEdit\"\n\n    end: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"End position of the edit on the starting sequence\",\n        description=(\n            \"End position of the edit on the starting sequence. If the coordinate \"\n            \"system is 0-based then end is exclusive and does not include the last \"\n            \"position. If the coordinate system is 1-base, then end is inclusive \"\n            \"and includes the last position.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    replacedSequence: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"replacedSequence\",\n        title=\"Allele in the starting sequence\",\n        description=(\n            \"Allele in the starting sequence. Nucleotide(s)/amino acids from start \"\n            \"position of sequence to stop position of sequence on the positive (+) \"\n            \"strand of the starting sequence. When the sequence  type is DNA, it \"\n            \"should be the sequence on the positive (+) strand. This will lay in \"\n            \"the range between variant.start and variant.end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    replacedSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_replacedSequence\",\n        title=\"Extension field for ``replacedSequence``.\",\n    )\n\n    replacementSequence: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"replacementSequence\",\n        title=\"Allele that was observed\",\n        description=(\n            \"Allele that was observed. Nucleotide(s)/amino acids from start \"\n            \"position of sequence to stop position of sequence on the positive (+) \"\n            \"strand of the observed sequence. When the sequence type is DNA, it \"\n            \"should be the sequence on the positive (+) strand. This will lay in \"\n            \"the range between variant.start and variant.end.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    replacementSequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_replacementSequence\",\n        title=\"Extension field for ``replacementSequence``.\",\n    )\n\n    start: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Start position of the edit on the starting sequence\",\n        description=(\n            \"Start position of the edit on the starting sequence. If the coordinate\"\n            \" system is either 0-based or 1-based, then start position is \"\n            \"inclusive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequenceRelativeEdit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"start\",\n            \"end\",\n            \"replacementSequence\",\n            \"replacedSequence\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequenceRelativeEdit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"start\",\n            \"end\",\n            \"replacementSequence\",\n            \"replacedSequence\",\n        ]\n\n\nclass MolecularSequenceRelativeStartingSequence(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A sequence used as starting sequence.\n    A sequence that is used as a starting sequence to describe variants that\n    are present in a sequence analyzed.\n    \"\"\"\n\n    __resource_type__ = \"MolecularSequenceRelativeStartingSequence\"\n\n    chromosome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"chromosome\",\n        title=\"Chromosome Identifier\",\n        description=(\n            \"Structural unit composed of a nucleic acid molecule which controls its\"\n            \" own replication through the interaction of specific proteins at one \"\n            \"or more origins of replication ([SO:0000340](http://www.sequenceontolo\"\n            \"gy.org/browser/current_svn/term/SO:0000340)).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    genomeAssembly: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"genomeAssembly\",\n        title=\"The genome assembly used for starting sequence, e.g. GRCh38\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    orientation: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"orientation\",\n        title=\"sense | antisense\",\n        description=(\n            \"A relative reference to a DNA strand based on gene orientation. The \"\n            'strand that contains the open reading frame of the gene is the \"sense\"'\n            ' strand, and the opposite complementary strand is the \"antisense\" '\n            \"strand.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"sense\", \"antisense\"],\n        },\n    )\n    orientation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_orientation\", title=\"Extension field for ``orientation``.\"\n    )\n\n    sequenceCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"sequenceCodeableConcept\",\n        title=\"The reference sequence that represents the starting sequence\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e sequence[x]\n            \"one_of_many\": \"sequence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    sequenceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sequenceReference\",\n        title=\"The reference sequence that represents the starting sequence\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e sequence[x]\n            \"one_of_many\": \"sequence\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MolecularSequence\"],\n        },\n    )\n\n    sequenceString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sequenceString\",\n        title=\"The reference sequence that represents the starting sequence\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e sequence[x]\n            \"one_of_many\": \"sequence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    sequenceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sequenceString\",\n        title=\"Extension field for ``sequenceString``.\",\n    )\n\n    strand: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"strand\",\n        title=\"watson | crick\",\n        description=(\n            \"An absolute reference to a strand. The Watson strand is the strand \"\n            \"whose 5'-end is on the short arm of the chromosome, and the Crick \"\n            \"strand as the one whose 5'-end is on the long arm.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"watson\", \"crick\"],\n        },\n    )\n    strand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_strand\", title=\"Extension field for ``strand``.\"\n    )\n\n    windowEnd: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"windowEnd\",\n        title=\"End position of the window on the starting sequence\",\n        description=(\n            \"End position of the window on the starting sequence. This value should\"\n            \" honor the rules of the  coordinateSystem.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    windowEnd__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_windowEnd\", title=\"Extension field for ``windowEnd``.\"\n    )\n\n    windowStart: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"windowStart\",\n        title=\"Start position of the window on the starting sequence\",\n        description=(\n            \"Start position of the window on the starting sequence. This value \"\n            \"should honor the rules of the coordinateSystem.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    windowStart__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_windowStart\", title=\"Extension field for ``windowStart``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MolecularSequenceRelativeStartingSequence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"genomeAssembly\",\n            \"chromosome\",\n            \"sequenceCodeableConcept\",\n            \"sequenceString\",\n            \"sequenceReference\",\n            \"windowStart\",\n            \"windowEnd\",\n            \"orientation\",\n            \"strand\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MolecularSequenceRelativeStartingSequence`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"genomeAssembly\",\n            \"chromosome\",\n            \"sequenceCodeableConcept\",\n            \"sequenceString\",\n            \"sequenceReference\",\n            \"windowStart\",\n            \"windowEnd\",\n            \"orientation\",\n            \"strand\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"sequence\": [\n                \"sequenceCodeableConcept\",\n                \"sequenceReference\",\n                \"sequenceString\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/monetarycomponent.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MonetaryComponent\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass MonetaryComponent(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Availability data for an {item}.\n    \"\"\"\n\n    __resource_type__ = \"MonetaryComponent\"\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Explicit value amount to be used\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"Codes may be used to differentiate between kinds of taxes, surcharges,\"\n            \" discounts etc.\"\n        ),\n        description=(\n            \"Codes may be used to differentiate between kinds of taxes, surcharges,\"\n            \" discounts etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Factor used for calculating this component\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"base | surcharge | deduction | discount | tax | informational\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"base\",\n                \"surcharge\",\n                \"deduction\",\n                \"discount\",\n                \"tax\",\n                \"informational\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``MonetaryComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"type\", \"code\", \"factor\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``MonetaryComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"type\", \"code\", \"factor\", \"amount\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/money.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Money\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Money(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An amount of economic utility in some recognized currency.\n    \"\"\"\n\n    __resource_type__ = \"Money\"\n\n    currency: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"currency\",\n        title=\"ISO 4217 Currency Code\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    currency__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_currency\", title=\"Extension field for ``currency``.\"\n    )\n\n    value: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Numerical value (with implicit precision)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Money`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"currency\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Money`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"currency\"]\n"
  },
  {
    "path": "fhir/resources/namingsystem.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NamingSystem\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass NamingSystem(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    System of unique identification.\n    A curated namespace that issues unique symbols within that namespace for\n    the identification of concepts, people, devices, etc.  Represents a\n    \"System\" used within the Identifier and Coding data types.\n    \"\"\"\n\n    __resource_type__ = \"NamingSystem\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the NamingSystem was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the CodeSystem\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the NamingSystem.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the naming system and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the naming system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the naming system was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the naming system \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the naming system\",\n        description=(\n            \"A free text natural language description of the naming system from a \"\n            \"consumer's perspective. Details about what the namespace identifies \"\n            \"including scope, granularity, version labeling, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the NamingSystem\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the NamingSystem.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the NamingSystem is expected to be used\",\n        description=(\n            \"The period during which the NamingSystem content was or is planned to \"\n            \"be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the NamingSystem\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"responsible for officially endorsing the NamingSystem for use in some \"\n            \"setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this naming system is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the naming system (business identifier)\",\n        description=(\n            \"A formal identifier that is used to identify this naming system when \"\n            \"it is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for naming system (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the naming system is intended to\"\n            \" be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"codesystem | identifier | root\",\n        description=(\n            \"Indicates the purpose for the naming system - what kinds of things \"\n            \"does it make unique?\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"codesystem\", \"identifier\", \"root\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the NamingSystem was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this naming system (computer friendly)\",\n        description=(\n            \"A natural language name identifying the naming system. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the naming system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this naming system is defined\",\n        description=(\n            \"Explanation of why this naming system is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, \"\n            \"dependencies, bibliographic references, and predecessor and successor \"\n            \"artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    responsible: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Who maintains system namespace?\",\n        description=(\n            \"The name of the organization that is responsible for issuing \"\n            \"identifiers or codes for this namespace and ensuring their non-\"\n            \"collision.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responsible__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_responsible\", title=\"Extension field for ``responsible``.\"\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the NamingSystem\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"primarily responsible for review of some aspect of the NamingSystem.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this naming system. Enables tracking the life-cycle of \"\n            \"the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Title for this naming system (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the naming system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptions related to the content of the NamingSystem. Topics \"\n            \"provide a high-level categorization as well as keywords for the \"\n            \"NamingSystem that can be useful for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"e.g. driver,  provider,  patient, bank etc\",\n        description=(\n            \"Categorizes a naming system for easier search by grouping related \"\n            \"naming systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    uniqueId: typing.List[fhirtypes.NamingSystemUniqueIdType] = Field(\n        default=...,\n        alias=\"uniqueId\",\n        title=\"Unique identifiers used for system\",\n        description=(\n            \"Indicates how the system may be identified when referenced in \"\n            \"electronic exchange.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this naming system, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this naming system when it is\"\n            \" referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" naming system is (or will be) published. This URL can be the target \"\n            \"of a canonical reference. It SHALL remain the same when the naming \"\n            \"system is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"How/where is it used\",\n        description=(\n            \"Provides guidance on the use of the namespace, including the handling \"\n            \"of formatting characters, use of upper vs. lower case, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate naming system instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the naming system\",\n        description=(\n            \"The identifier that is used to identify this version of the naming \"\n            \"system when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the naming system \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which \"\n            \"NamingSystem is more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which \"\n            \"NamingSystem is more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NamingSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"kind\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"responsible\",\n            \"type\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"usage\",\n            \"uniqueId\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NamingSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"kind\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"uniqueId\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"date\", \"date__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass NamingSystemUniqueId(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Unique identifiers used for system.\n    Indicates how the system may be identified when referenced in electronic\n    exchange.\n    \"\"\"\n\n    __resource_type__ = \"NamingSystemUniqueId\"\n\n    authoritative: bool | None = Field(\n        default=None,\n        alias=\"authoritative\",\n        title=\"Whether the identifier is authoritative\",\n        description=(\n            \"Indicates whether this identifier ie endorsed by the official owner of\"\n            \" the associated naming system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authoritative__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_authoritative\",\n        title=\"Extension field for ``authoritative``.\",\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Notes about identifier usage\",\n        description=\"Notes about the past or intended usage of this identifier.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When is identifier valid?\",\n        description=(\n            \"Identifies the period of time over which this identifier is considered\"\n            \" appropriate to refer to the naming system.  Outside of this window, \"\n            \"the identifier might be non-deterministic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preferred: bool | None = Field(\n        default=None,\n        alias=\"preferred\",\n        title=\"Is this the id that should be used for this type\",\n        description=(\n            'Indicates whether this identifier is the \"preferred\" identifier of '\n            \"this type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preferred\", title=\"Extension field for ``preferred``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"oid | uuid | uri | iri-stem | v2csmnemonic | other\",\n        description=(\n            \"Identifies the unique identifier scheme used for this particular \"\n            \"identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"oid\", \"uuid\", \"uri\", \"iri-stem\", \"v2csmnemonic\", \"other\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The unique identifier\",\n        description=(\n            \"The string that should be sent over the wire to identify the code \"\n            \"system or identifier system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NamingSystemUniqueId`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"value\",\n            \"preferred\",\n            \"comment\",\n            \"period\",\n            \"authoritative\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NamingSystemUniqueId`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"value\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/narrative.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Narrative\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Narrative(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Human-readable summary of the resource (essential clinical and business\n    information).\n    A human-readable summary of the resource conveying the essential clinical\n    and business information for the resource.\n    \"\"\"\n\n    __resource_type__ = \"Narrative\"\n\n    div: fhirtypes.XhtmlType | None = Field(\n        default=None,\n        alias=\"div\",\n        title=\"Limited xhtml content\",\n        description=\"The actual narrative content, a stripped down version of XHTML.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    div__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_div\", title=\"Extension field for ``div``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"generated | extensions | additional | empty\",\n        description=(\n            \"The status of the narrative - whether it's entirely generated (from \"\n            \"just the defined data or the extensions too), or whether a human \"\n            \"authored it and it may contain additional data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"generated\", \"extensions\", \"additional\", \"empty\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Narrative`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"status\", \"div\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Narrative`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"div\", \"div__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/nutritionintake.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NutritionIntake\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass NutritionIntake(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Record of food or fluid being taken by a patient.\n    A record of food or fluid that is being consumed by a patient.   A\n    NutritionIntake may indicate that the patient may be consuming the food or\n    fluid now or has consumed the food or fluid in the past.  The source of\n    this information can be the patient, significant other (such as a family\n    member or spouse), or a clinician.  A common scenario where this\n    information is captured is during the history taking process during a\n    patient visit or stay or through an app that tracks food or fluids\n    consumed.   The consumption information may come from sources such as the\n    patient's memory, from a nutrition label,  or from a clinician documenting\n    observed intake.\n    \"\"\"\n\n    __resource_type__ = \"NutritionIntake\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfils plan, proposal or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"NutritionOrder\", \"CarePlan\", \"ServiceRequest\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code representing an overall type of nutrition intake\",\n        description=\"Overall type of nutrition intake.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    consumedItem: typing.List[fhirtypes.NutritionIntakeConsumedItemType] = Field(\n        default=...,\n        alias=\"consumedItem\",\n        title=\"What food or fluid product or item was consumed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Additional supporting information\",\n        description=(\n            \"Allows linking the NutritionIntake to the underlying NutritionOrder, \"\n            \"or to other information, such as AllergyIntolerance, that supports or \"\n            \"is used to derive the NutritionIntake.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter associated with NutritionIntake\",\n        description=\"The encounter that establishes the context for this NutritionIntake.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifiers associated with this Nutrition Intake that are defined by \"\n            \"business processes and/or used to refer to it when a direct URL \"\n            \"reference to the resource itself is not appropriate. They are business\"\n            \" identifiers assigned to this resource by the performer or other \"\n            \"systems and remain constant as the resource is updated and propagates \"\n            \"from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ingredientLabel: typing.List[\n        fhirtypes.NutritionIntakeIngredientLabelType\n    ] | None = Field(\n        default=None,\n        alias=\"ingredientLabel\",\n        title=\"Total nutrient for the whole meal, product, serving\",\n        description=\"Total nutrient amounts for the whole meal, product, serving, etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"ActivityDefinition\",\n                \"ChargeItemDefinition\",\n                \"ClinicalUseDefinition\",\n                \"EventDefinition\",\n                \"Measure\",\n                \"MessageDefinition\",\n                \"ObservationDefinition\",\n                \"OperationDefinition\",\n                \"PlanDefinition\",\n                \"Questionnaire\",\n                \"Requirements\",\n                \"SubscriptionTopic\",\n                \"TestPlan\",\n                \"TestScript\",\n            ],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the intake occurred\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Further information about the consumption\",\n        description=(\n            \"Provides extra information about the Nutrition Intake that is not \"\n            \"conveyed by the other attributes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"The date/time or interval when the food or fluid is/was consumed\",\n        description=(\n            \"The interval of time during which it is being asserted that the \"\n            \"patient is/was consuming the food or fluid.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"The date/time or interval when the food or fluid is/was consumed\",\n        description=(\n            \"The interval of time during which it is being asserted that the \"\n            \"patient is/was consuming the food or fluid.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=\"A larger event of which this particular event is a component or step.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"NutritionIntake\", \"Procedure\", \"Observation\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.NutritionIntakePerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who was performed in the intake\",\n        description=\"Who performed the intake and how they were involved.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason for why the food or fluid is /was consumed\",\n        description=(\n            \"A reason, Condition or observation for why the food or fluid is /was \"\n            \"consumed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    recorded: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recorded\",\n        title=\"When the intake was recorded\",\n        description=(\n            \"The date when the Nutrition Intake was asserted by the information \"\n            \"source.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recorded\", title=\"Extension field for ``recorded``.\"\n    )\n\n    reportedBoolean: bool | None = Field(\n        default=None,\n        alias=\"reportedBoolean\",\n        title=(\n            \"Person or organization that provided the information about the \"\n            \"consumption of this food or fluid\"\n        ),\n        description=(\n            \"The person or organization that provided the information about the \"\n            \"consumption of this food or fluid. Note: Use derivedFrom when a \"\n            \"NutritionIntake is derived from other resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e reported[x]\n            \"one_of_many\": \"reported\",\n            \"one_of_many_required\": False,\n        },\n    )\n    reportedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_reportedBoolean\",\n        title=\"Extension field for ``reportedBoolean``.\",\n    )\n\n    reportedReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reportedReference\",\n        title=(\n            \"Person or organization that provided the information about the \"\n            \"consumption of this food or fluid\"\n        ),\n        description=(\n            \"The person or organization that provided the information about the \"\n            \"consumption of this food or fluid. Note: Use derivedFrom when a \"\n            \"NutritionIntake is derived from other resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e reported[x]\n            \"one_of_many\": \"reported\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | not-done | on-hold | stopped | completed |\"\n            \" entered-in-error | unknown\"\n        ),\n        description=(\n            \"A code representing the patient or other source's judgment about the \"\n            \"state of the intake that this assertion is about.  Generally, this \"\n            \"will be active or completed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"not-done\",\n                \"on-hold\",\n                \"stopped\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current state of the NutritionIntake.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who is/was consuming the food or fluid\",\n        description=\"The person, animal or group who is/was consuming the food or fluid.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionIntake`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"recorded\",\n            \"reportedBoolean\",\n            \"reportedReference\",\n            \"consumedItem\",\n            \"ingredientLabel\",\n            \"performer\",\n            \"location\",\n            \"derivedFrom\",\n            \"reason\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionIntake`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"recorded\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\"],\n            \"reported\": [\"reportedBoolean\", \"reportedReference\"],\n        }\n        return one_of_many_fields\n\n\nclass NutritionIntakeConsumedItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What food or fluid product or item was consumed.\n    \"\"\"\n\n    __resource_type__ = \"NutritionIntakeConsumedItem\"\n\n    amount: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Quantity of the specified food\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    notConsumed: bool | None = Field(\n        default=None,\n        alias=\"notConsumed\",\n        title=(\n            \"Flag to indicate if the food or fluid item was refused or otherwise \"\n            \"not consumed\"\n        ),\n        description=(\n            \"Indicator when a patient is in a setting where it is helpful to know \"\n            \"if food was not consumed, such as it was refused, held (as in tube \"\n            \"feedings), or otherwise not provided. If a consumption is being \"\n            \"recorded from an app, such as MyFitnessPal, this indicator will likely\"\n            \" not be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    notConsumed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_notConsumed\", title=\"Extension field for ``notConsumed``.\"\n    )\n\n    notConsumedReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"notConsumedReason\",\n        title=\"Reason food or fluid was not consumed\",\n        description=(\n            \"Document the reason the food or fluid was not consumed, such as \"\n            \"refused, held, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    nutritionProduct: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"nutritionProduct\",\n        title=\"Code that identifies the food or fluid product that was consumed\",\n        description=(\n            \"Identifies the food or fluid product that was consumed. This is \"\n            \"potentially a link to a resource representing the details of the food \"\n            \"product (TBD) or a simple attribute carrying a code that identifies \"\n            \"the food from a known list of foods.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"NutritionProduct\"],\n        },\n    )\n\n    rate: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"rate\",\n        title=\"Rate at which enteral feeding was administered\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    schedule: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"schedule\",\n        title=\"Scheduled frequency of consumption\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"The type of food or fluid product\",\n        description=(\n            \"Indicates what a category of item that was consumed: e.g., food, \"\n            \"fluid, enteral, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionIntakeConsumedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"nutritionProduct\",\n            \"schedule\",\n            \"amount\",\n            \"rate\",\n            \"notConsumed\",\n            \"notConsumedReason\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionIntakeConsumedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"nutritionProduct\", \"amount\", \"rate\"]\n\n\nclass NutritionIntakeIngredientLabel(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Total nutrient for the whole meal, product, serving.\n    Total nutrient amounts for the whole meal, product, serving, etc.\n    \"\"\"\n\n    __resource_type__ = \"NutritionIntakeIngredientLabel\"\n\n    amount: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Total amount of nutrient consumed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    nutrient: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"nutrient\",\n        title=\"Total nutrient consumed\",\n        description=(\n            \"Total nutrient consumed. This could be a macronutrient (protein, fat, \"\n            \"carbohydrate), or a vitamin and mineral.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionIntakeIngredientLabel`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"nutrient\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionIntakeIngredientLabel`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionIntakePerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who was performed in the intake.\n    Who performed the intake and how they were involved.\n    \"\"\"\n\n    __resource_type__ = \"NutritionIntakePerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Who performed the intake\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of performer\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionIntakePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionIntakePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/nutritionorder.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NutritionOrder\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass NutritionOrder(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Diet, formula or nutritional supplement request.\n    A request to supply a diet, formula feeding (enteral) or oral nutritional\n    supplement to a patient/resident.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrder\"\n\n    allergyIntolerance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"allergyIntolerance\",\n        title=(\n            \"List of the patient's food and nutrition-related allergies and \"\n            \"intolerances\"\n        ),\n        description=(\n            \"A link to a record of allergies or intolerances  which should be \"\n            \"included in the nutrition order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"AllergyIntolerance\"],\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What this order fulfills\",\n        description=(\n            \"A plan or request that is fulfilled in whole or in part by this \"\n            \"nutrition order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\", \"NutritionOrder\", \"ServiceRequest\"],\n        },\n    )\n\n    dateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateTime\",\n        title=\"Date and time the nutrition order was requested\",\n        description=\"The date and time that this nutrition order was requested.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    dateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dateTime\", title=\"Extension field for ``dateTime``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"The encounter associated with this nutrition order\",\n        description=(\n            \"An encounter that provides additional information about the healthcare\"\n            \" context in which this request is made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    enteralFormula: fhirtypes.NutritionOrderEnteralFormulaType | None = Field(\n        default=None,\n        alias=\"enteralFormula\",\n        title=\"Enteral formula components\",\n        description=(\n            \"Feeding provided through the gastrointestinal tract via a tube, \"\n            \"catheter, or stoma that delivers nutrition distal to the oral cavity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    excludeFoodModifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"excludeFoodModifier\",\n        title=(\n            \"Order-specific modifier about the type of food that should not be \" \"given\"\n        ),\n        description=(\n            \"This modifier is used to convey Order-specific modifier about the type\"\n            \" of oral food or oral fluids that should not be given. These can be \"\n            \"derived from patient allergies, intolerances, or preferences such as \"\n            \"No Red Meat, No Soy or No Wheat or  Gluten-Free.  While it should not \"\n            \"be necessary to repeat allergy or intolerance information captured in \"\n            \"the referenced AllergyIntolerance resource in the excludeFoodModifier,\"\n            \" this element may be used to convey additional specificity related to \"\n            \"foods that should be eliminated from the patient\\u2019s diet for any \"\n            \"reason.  This modifier applies to the entire nutrition order inclusive\"\n            \" of the oral diet, nutritional supplements and enteral formula \"\n            \"feedings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    foodPreferenceModifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"foodPreferenceModifier\",\n        title=\"Order-specific modifier about the type of food that should be given\",\n        description=(\n            \"This modifier is used to convey order-specific modifiers about the \"\n            \"type of food that should be given. These can be derived from patient \"\n            \"allergies, intolerances, or preferences such as Halal, Vegan or \"\n            \"Kosher. This modifier applies to the entire nutrition order inclusive \"\n            \"of the oral diet, nutritional supplements and enteral formula \"\n            \"feedings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Composite Request ID\",\n        description=(\n            \"A shared identifier common to all nutrition orders that were \"\n            \"authorized more or less simultaneously by a single author, \"\n            \"representing the composite or group identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers assigned to this order\",\n        description=(\n            \"Identifiers assigned to this order by the order sender or by the order\"\n            \" receiver.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instantiates: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiates\",\n        title=\"Instantiates protocol or definition\",\n        description=(\n            \"The URL pointing to a protocol, guideline, orderset or other \"\n            \"definition that is adhered to in whole or in part by this \"\n            \"NutritionOrder.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    instantiates__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiates\",\n        title=\"Extension field for ``instantiates``.\",\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"NutritionOrder.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this NutritionOrder.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"proposal | plan | directive | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            \"Indicates the level of authority/intentionality associated with the \"\n            \"NutrionOrder and where the request fits into the workflow chain.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposal\",\n                \"plan\",\n                \"directive\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments\",\n        description=(\n            \"Comments made about the {{title}} by the requester, performer, subject\"\n            \" or other participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    oralDiet: fhirtypes.NutritionOrderOralDietType | None = Field(\n        default=None,\n        alias=\"oralDiet\",\n        title=\"Oral diet components\",\n        description=\"Diet given orally in contrast to enteral (tube) feeding.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    orderer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"orderer\",\n        title=\"Who ordered the diet, formula or nutritional supplement\",\n        description=(\n            \"The practitioner that holds legal responsibility for ordering the \"\n            \"diet, nutritional supplement, or formula feedings.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    outsideFoodAllowed: bool | None = Field(\n        default=None,\n        alias=\"outsideFoodAllowed\",\n        title=\"Capture when a food item is brought in by the patient and/or family\",\n        description=(\n            \"This modifier is used to convey whether a food item is allowed to be \"\n            \"brought in by the patient and/or family.  If set to true, indicates \"\n            \"that the receiving system does not need to supply the food item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    outsideFoodAllowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_outsideFoodAllowed\",\n        title=\"Extension field for ``outsideFoodAllowed``.\",\n    )\n\n    performer: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who is desired to perform the administration of what is being ordered\",\n        description=\"The specified desired performer of the nutrition order.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the Nutrition Order should be addressed with \"\n            \"respect to other        requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | on-hold | revoked | completed | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=\"The workflow status of the nutrition order/request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"on-hold\",\n                \"revoked\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who requires the diet, formula or nutritional supplement\",\n        description=(\n            \"The person or set of individuals who needs the nutrition order for an \"\n            \"oral diet, nutritional supplement and/or enteral or formula feeding.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    supplement: typing.List[fhirtypes.NutritionOrderSupplementType] | None = Field(\n        default=None,\n        alias=\"supplement\",\n        title=\"Supplement components\",\n        description=(\n            \"Oral nutritional products given in order to add further nutritional \"\n            \"value to the patient's diet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supportingInformation: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInformation\",\n        title=\"Information to support fulfilling of the nutrition order\",\n        description=(\n            \"Information to support fulfilling (i.e. dispensing or administering) \"\n            \"of the nutrition,        for example, patient height and weight).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrder`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"instantiates\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"subject\",\n            \"encounter\",\n            \"supportingInformation\",\n            \"dateTime\",\n            \"orderer\",\n            \"performer\",\n            \"allergyIntolerance\",\n            \"foodPreferenceModifier\",\n            \"excludeFoodModifier\",\n            \"outsideFoodAllowed\",\n            \"oralDiet\",\n            \"supplement\",\n            \"enteralFormula\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrder`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"subject\",\n            \"dateTime\",\n            \"orderer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"dateTime\", \"dateTime__ext\"),\n            (\"intent\", \"intent__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass NutritionOrderEnteralFormula(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Enteral formula components.\n    Feeding provided through the gastrointestinal tract via a tube, catheter,\n    or stoma that delivers nutrition distal to the oral cavity.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderEnteralFormula\"\n\n    additive: typing.List[\n        fhirtypes.NutritionOrderEnteralFormulaAdditiveType\n    ] | None = Field(\n        default=None,\n        alias=\"additive\",\n        title=\"Components to add to the feeding\",\n        description=(\n            \"Indicates modular components to be provided in addition or mixed with \"\n            \"the base formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    administration: typing.List[\n        fhirtypes.NutritionOrderEnteralFormulaAdministrationType\n    ] | None = Field(\n        default=None,\n        alias=\"administration\",\n        title=\"Formula feeding instruction as structured data\",\n        description=(\n            \"Formula administration instructions as structured data.  This \"\n            \"repeating structure allows for changing the administration rate or \"\n            \"volume over time for both bolus and continuous feeding.  An example of\"\n            \" this would be an instruction to increase the rate of continuous \"\n            \"feeding every 2 hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    administrationInstruction: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"administrationInstruction\",\n        title=\"Formula feeding instructions expressed as text\",\n        description=(\n            \"Free text formula administration, feeding instructions or additional \"\n            \"instructions or information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    administrationInstruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_administrationInstruction\",\n        title=\"Extension field for ``administrationInstruction``.\",\n    )\n\n    baseFormulaProductName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"baseFormulaProductName\",\n        title=\"Product or brand name of the enteral or infant formula\",\n        description=(\n            \"The product or brand name of the enteral or infant formula product \"\n            'such as \"ACME Adult Standard Formula\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    baseFormulaProductName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_baseFormulaProductName\",\n        title=\"Extension field for ``baseFormulaProductName``.\",\n    )\n\n    baseFormulaType: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"baseFormulaType\",\n        title=\"Type of enteral or infant formula\",\n        description=(\n            \"The type of enteral or infant formula such as an adult standard \"\n            \"formula with fiber or a soy-based infant formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"NutritionProduct\"],\n        },\n    )\n\n    caloricDensity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"caloricDensity\",\n        title=\"Amount of energy per specified volume that is required\",\n        description=(\n            \"The amount of energy (calories) that the formula should provide per \"\n            \"specified volume, typically per mL or fluid oz.  For example, an \"\n            \"infant may require a formula that provides 24 calories per fluid ounce\"\n            \" or an adult may require an enteral formula that provides 1.5 \"\n            \"calorie/mL.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    deliveryDevice: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"deliveryDevice\",\n        title=\"Intended type of device for the administration\",\n        description=(\n            \"The intended type of device that is to be used for the administration \"\n            \"of the enteral formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceDefinition\"],\n        },\n    )\n\n    maxVolumeToDeliver: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"maxVolumeToDeliver\",\n        title=\"Upper limit on formula volume per unit of time\",\n        description=(\n            \"The maximum total quantity of formula that may be administered to a \"\n            \"subject over the period of time, e.g. 1440 mL over 24 hours.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    routeOfAdministration: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"routeOfAdministration\",\n        title=\"How the formula should enter the patient's gastrointestinal tract\",\n        description=(\n            \"The route or physiological path of administration into the patient's \"\n            \"gastrointestinal  tract for purposes of providing the formula feeding,\"\n            \" e.g. nasogastric tube.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderEnteralFormula`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"baseFormulaType\",\n            \"baseFormulaProductName\",\n            \"deliveryDevice\",\n            \"additive\",\n            \"caloricDensity\",\n            \"routeOfAdministration\",\n            \"administration\",\n            \"maxVolumeToDeliver\",\n            \"administrationInstruction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormula`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"baseFormulaType\", \"administrationInstruction\"]\n\n\nclass NutritionOrderEnteralFormulaAdditive(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Components to add to the feeding.\n    Indicates modular components to be provided in addition or mixed with the\n    base formula.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderEnteralFormulaAdditive\"\n\n    productName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"productName\",\n        title=\"Product or brand name of the modular additive\",\n        description=(\n            \"The product or brand name of the type of modular component to be added\"\n            \" to the formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    productName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_productName\", title=\"Extension field for ``productName``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount of additive to be given or mixed in\",\n        description=(\n            \"The amount of additive to be given in addition or to be mixed in with \"\n            \"the base formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of modular component to add to the feeding\",\n        description=(\n            \"Indicates the type of modular component such as protein, carbohydrate,\"\n            \" fat or fiber to be provided in addition to or mixed with the base \"\n            \"formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"NutritionProduct\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderEnteralFormulaAdditive`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"productName\",\n            \"quantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormulaAdditive`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionOrderEnteralFormulaAdministration(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Formula feeding instruction as structured data.\n    Formula administration instructions as structured data.  This repeating\n    structure allows for changing the administration rate or volume over time\n    for both bolus and continuous feeding.  An example of this would be an\n    instruction to increase the rate of continuous feeding every 2 hours.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderEnteralFormulaAdministration\"\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"The volume of formula to provide\",\n        description=(\n            \"The volume of formula to provide to the patient per the specified \"\n            \"administration schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rateQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"rateQuantity\",\n        title=\"Speed with which the formula is provided per period of time\",\n        description=(\n            \"The rate of administration of formula via a feeding pump, e.g. 60 mL \"\n            \"per hour, according to the specified schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    rateRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"rateRatio\",\n        title=\"Speed with which the formula is provided per period of time\",\n        description=(\n            \"The rate of administration of formula via a feeding pump, e.g. 60 mL \"\n            \"per hour, according to the specified schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e rate[x]\n            \"one_of_many\": \"rate\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    schedule: fhirtypes.NutritionOrderEnteralFormulaAdministrationScheduleType | None = Field(\n        default=None,\n        alias=\"schedule\",\n        title=\"Scheduling information for enteral formula products\",\n        description=\"Schedule information for an enteral formula.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderEnteralFormulaAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"schedule\",\n            \"quantity\",\n            \"rateQuantity\",\n            \"rateRatio\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormulaAdministration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"rate\": [\"rateQuantity\", \"rateRatio\"]}\n        return one_of_many_fields\n\n\nclass NutritionOrderEnteralFormulaAdministrationSchedule(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Scheduling information for enteral formula products.\n    Schedule information for an enteral formula.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderEnteralFormulaAdministrationSchedule\"\n\n    asNeeded: bool | None = Field(\n        default=None,\n        alias=\"asNeeded\",\n        title=\"Take 'as needed'\",\n        description=(\n            \"Indicates whether the enteral formula is only taken when needed within\"\n            \" a specific dosing schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    asNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_asNeeded\", title=\"Extension field for ``asNeeded``.\"\n    )\n\n    asNeededFor: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"asNeededFor\",\n        title=\"Take 'as needed' for x\",\n        description=(\n            \"Indicates whether the enteral formula is only taken based on a \"\n            \"precondition for taking the enteral formula.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timing: typing.List[fhirtypes.TimingType] | None = Field(\n        default=None,\n        alias=\"timing\",\n        title=\"Scheduled frequency of enteral formula\",\n        description=(\n            \"The time period and frequency at which the enteral formula should be \"\n            \"given.  The enteral formula should be given for the combination of all\"\n            \" schedules if more than one schedule is present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderEnteralFormulaAdministrationSchedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"timing\",\n            \"asNeeded\",\n            \"asNeededFor\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderEnteralFormulaAdministrationSchedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionOrderOralDiet(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Oral diet components.\n    Diet given orally in contrast to enteral (tube) feeding.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderOralDiet\"\n\n    fluidConsistencyType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"fluidConsistencyType\",\n        title=\"The required consistency of fluids and liquids provided to the patient\",\n        description=(\n            \"The required consistency (e.g. honey-thick, nectar-thick, thin, \"\n            \"thickened.) of liquids or fluids served to the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"instruction\",\n        title=\"Instructions or additional information about the oral diet\",\n        description=(\n            \"Free text or additional instructions or information pertaining to the \"\n            \"oral diet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_instruction\", title=\"Extension field for ``instruction``.\"\n    )\n\n    nutrient: typing.List[fhirtypes.NutritionOrderOralDietNutrientType] | None = Field(\n        default=None,\n        alias=\"nutrient\",\n        title=\"Required  nutrient modifications\",\n        description=(\n            \"Class that defines the quantity and type of nutrient modifications \"\n            \"(for example carbohydrate, fiber or sodium) required for the oral \"\n            \"diet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    schedule: fhirtypes.NutritionOrderOralDietScheduleType | None = Field(\n        default=None,\n        alias=\"schedule\",\n        title=\"Scheduling information for oral diets\",\n        description=\"Schedule information for an oral diet.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    texture: typing.List[fhirtypes.NutritionOrderOralDietTextureType] | None = Field(\n        default=None,\n        alias=\"texture\",\n        title=\"Required  texture modifications\",\n        description=(\n            \"Class that describes any texture modifications required for the \"\n            \"patient to safely consume various types of solid foods.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Type of oral diet or diet restrictions that describe what can be \"\n            \"consumed orally\"\n        ),\n        description=(\n            \"The kind of diet or dietary restriction such as fiber restricted diet \"\n            \"or diabetic diet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderOralDiet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"schedule\",\n            \"nutrient\",\n            \"texture\",\n            \"fluidConsistencyType\",\n            \"instruction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDiet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"instruction\"]\n\n\nclass NutritionOrderOralDietNutrient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Required  nutrient modifications.\n    Class that defines the quantity and type of nutrient modifications (for\n    example carbohydrate, fiber or sodium) required for the oral diet.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderOralDietNutrient\"\n\n    amount: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Quantity of the specified nutrient\",\n        description=\"The quantity of the specified nutrient to include in diet.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifier: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Type of nutrient that is being modified\",\n        description=\"The nutrient that is being modified such as carbohydrate or sodium.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderOralDietNutrient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"modifier\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietNutrient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionOrderOralDietSchedule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Scheduling information for oral diets.\n    Schedule information for an oral diet.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderOralDietSchedule\"\n\n    asNeeded: bool | None = Field(\n        default=None,\n        alias=\"asNeeded\",\n        title=\"Take 'as needed'\",\n        description=(\n            \"Indicates whether the product is only taken when needed within a \"\n            \"specific dosing schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    asNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_asNeeded\", title=\"Extension field for ``asNeeded``.\"\n    )\n\n    asNeededFor: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"asNeededFor\",\n        title=\"Take 'as needed' for x\",\n        description=(\n            \"Indicates whether the product is only taken based on a precondition \"\n            \"for taking the product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timing: typing.List[fhirtypes.TimingType] | None = Field(\n        default=None,\n        alias=\"timing\",\n        title=\"Scheduled frequency of diet\",\n        description=(\n            \"The time period and frequency at which the diet should be given.  The \"\n            \"diet should be given for the combination of all schedules if more than\"\n            \" one schedule is present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderOralDietSchedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"timing\",\n            \"asNeeded\",\n            \"asNeededFor\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietSchedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionOrderOralDietTexture(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Required  texture modifications.\n    Class that describes any texture modifications required for the patient to\n    safely consume various types of solid foods.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderOralDietTexture\"\n\n    foodType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"foodType\",\n        title=(\n            \"Concepts that are used to identify an entity that is ingested for \"\n            \"nutritional purposes\"\n        ),\n        description=(\n            \"The food type(s) (e.g. meats, all foods)  that the texture \"\n            \"modification applies to.  This could be all foods types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    modifier: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=\"Code to indicate how to alter the texture of the foods, e.g. pureed\",\n        description=(\n            \"Any texture modifications (for solid foods) that should be made, e.g. \"\n            \"easy to chew, chopped, ground, and pureed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderOralDietTexture`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"modifier\", \"foodType\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderOralDietTexture`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionOrderSupplement(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supplement components.\n    Oral nutritional products given in order to add further nutritional value\n    to the patient's diet.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderSupplement\"\n\n    instruction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"instruction\",\n        title=\"Instructions or additional information about the oral supplement\",\n        description=(\n            \"Free text or additional instructions or information pertaining to the \"\n            \"oral supplement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_instruction\", title=\"Extension field for ``instruction``.\"\n    )\n\n    productName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"productName\",\n        title=\"Product or brand name of the nutritional supplement\",\n        description=(\n            'The product or brand name of the nutritional supplement such as \"Acme '\n            'Protein Shake\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    productName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_productName\", title=\"Extension field for ``productName``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount of the nutritional supplement\",\n        description=\"The amount of the nutritional supplement to be given.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    schedule: fhirtypes.NutritionOrderSupplementScheduleType | None = Field(\n        default=None,\n        alias=\"schedule\",\n        title=\"Scheduling information for supplements\",\n        description=\"Schedule information for a supplement.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of supplement product requested\",\n        description=(\n            \"The kind of nutritional supplement product required such as a high \"\n            \"protein or pediatric clear liquid supplement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"NutritionProduct\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderSupplement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"productName\",\n            \"schedule\",\n            \"quantity\",\n            \"instruction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderSupplement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"instruction\"]\n\n\nclass NutritionOrderSupplementSchedule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Scheduling information for supplements.\n    Schedule information for a supplement.\n    \"\"\"\n\n    __resource_type__ = \"NutritionOrderSupplementSchedule\"\n\n    asNeeded: bool | None = Field(\n        default=None,\n        alias=\"asNeeded\",\n        title=\"Take 'as needed'\",\n        description=(\n            \"Indicates whether the supplement is only taken when needed within a \"\n            \"specific dosing schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    asNeeded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_asNeeded\", title=\"Extension field for ``asNeeded``.\"\n    )\n\n    asNeededFor: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"asNeededFor\",\n        title=\"Take 'as needed' for x\",\n        description=(\n            \"Indicates whether the supplement is only taken based on a precondition\"\n            \" for taking the supplement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timing: typing.List[fhirtypes.TimingType] | None = Field(\n        default=None,\n        alias=\"timing\",\n        title=\"Scheduled frequency of diet\",\n        description=(\n            \"The time period and frequency at which the supplement should be given.\"\n            \"  The supplement should be given for the combination of all schedules \"\n            \"if more than one schedule is present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionOrderSupplementSchedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"timing\",\n            \"asNeeded\",\n            \"asNeededFor\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionOrderSupplementSchedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/nutritionproduct.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NutritionProduct\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass NutritionProduct(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A product used for nutritional purposes (i.e. food or supplement).\n    A food or supplement that is consumed by patients.\n    \"\"\"\n\n    __resource_type__ = \"NutritionProduct\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=(\n            \"Broad product groups or categories used to classify the product, such \"\n            \"as Legume and Legume Products, Beverages, or Beef Products\"\n        ),\n        description=(\n            \"Nutrition products can have different classifications - according to \"\n            \"its nutritional properties, preparation methods, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    characteristic: typing.List[\n        fhirtypes.NutritionProductCharacteristicType\n    ] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"Specifies descriptive properties of the nutrition product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"A code that can identify the detailed nutrients and ingredients in a \"\n            \"specific food product\"\n        ),\n        description=(\n            \"The code assigned to the product, for example a USDA NDB number, a \"\n            \"USDA FDC ID number, or a Langual code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.NutritionProductIngredientType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=\"Ingredients contained in this product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instance: typing.List[fhirtypes.NutritionProductInstanceType] | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=(\n            \"One or several physical instances or occurrences of the nutrition \"\n            \"product\"\n        ),\n        description=(\n            \"Conveys instance-level information about this product item. One or \"\n            \"several physical, countable instances or occurrences of the product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    knownAllergen: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"knownAllergen\",\n        title=\"Known or suspected allergens that are a part of this product\",\n        description=(\n            \"Allergens that are known or suspected to be a part of this nutrition \"\n            \"product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"Manufacturer, representative or officially responsible for the product\",\n        description=(\n            \"The organisation (manufacturer, representative or legal authorization \"\n            \"holder) that is responsible for the device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    nutrient: typing.List[fhirtypes.NutritionProductNutrientType] | None = Field(\n        default=None,\n        alias=\"nutrient\",\n        title=\"The product's nutritional information expressed by the nutrients\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=\"The current state of the product.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionProduct`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"status\",\n            \"category\",\n            \"manufacturer\",\n            \"nutrient\",\n            \"ingredient\",\n            \"knownAllergen\",\n            \"characteristic\",\n            \"instance\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionProduct`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"code\",\n            \"status\",\n            \"category\",\n            \"manufacturer\",\n            \"nutrient\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass NutritionProductCharacteristic(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifies descriptive properties of the nutrition product.\n    \"\"\"\n\n    __resource_type__ = \"NutritionProductCharacteristic\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Code specifying the type of characteristic\",\n        description=(\n            \"A code specifying which characteristic of the product is being \"\n            \"described (for example, colour, shape).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"The value of the characteristic\",\n        description=\"The actual characteristic value corresponding to the type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"The value of the characteristic\",\n        description=\"The actual characteristic value corresponding to the type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"The value of the characteristic\",\n        description=\"The actual characteristic value corresponding to the type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"The value of the characteristic\",\n        description=\"The actual characteristic value corresponding to the type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"The value of the characteristic\",\n        description=\"The actual characteristic value corresponding to the type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"The value of the characteristic\",\n        description=\"The actual characteristic value corresponding to the type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionProductCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueQuantity\",\n            \"valueBase64Binary\",\n            \"valueAttachment\",\n            \"valueBoolean\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionProductCharacteristic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass NutritionProductIngredient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Ingredients contained in this product.\n    \"\"\"\n\n    __resource_type__ = \"NutritionProductIngredient\"\n\n    amount: typing.List[fhirtypes.RatioType] | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"The amount of ingredient that is in the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    item: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"item\",\n        title=\"The ingredient contained in the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"NutritionProduct\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionProductIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"item\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionProductIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"item\", \"amount\"]\n\n\nclass NutritionProductInstance(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    One or several physical instances or occurrences of the nutrition product.\n    Conveys instance-level information about this product item. One or several\n    physical, countable instances or occurrences of the product.\n    \"\"\"\n\n    __resource_type__ = \"NutritionProductInstance\"\n\n    biologicalSourceEvent: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"biologicalSourceEvent\",\n        title=(\n            \"An identifier that supports traceability to the event during which \"\n            \"material in this product from one or more biological entities was \"\n            \"obtained or pooled\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    expiry: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expiry\",\n        title=\"The expiry date or date and time for the product\",\n        description=(\n            \"The time after which the product is no longer expected to be in proper\"\n            \" condition, or its use is not advised or not allowed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expiry__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expiry\", title=\"Extension field for ``expiry``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"The identifier for the physical instance, typically a serial number or\"\n            \" manufacturer number\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lotNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"lotNumber\",\n        title=\"The identification of the batch or lot of the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lotNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lotNumber\", title=\"Extension field for ``lotNumber``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The name for the specific product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"The amount of items or instances\",\n        description=(\n            \"The amount of items or instances that the resource considers, for \"\n            \"instance when referring to 2 identical units together.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    useBy: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"useBy\",\n        title=(\n            \"The date until which the product is expected to be good for \" \"consumption\"\n        ),\n        description=(\n            \"The time after which the product is no longer expected to be in proper\"\n            \" condition, or its use is not advised or not allowed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    useBy__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_useBy\", title=\"Extension field for ``useBy``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionProductInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"quantity\",\n            \"identifier\",\n            \"name\",\n            \"lotNumber\",\n            \"expiry\",\n            \"useBy\",\n            \"biologicalSourceEvent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionProductInstance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass NutritionProductNutrient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The product's nutritional information expressed by the nutrients.\n    \"\"\"\n\n    __resource_type__ = \"NutritionProductNutrient\"\n\n    amount: typing.List[fhirtypes.RatioType] | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=(\n            \"The amount of nutrient expressed in one or more units: X per pack / \"\n            \"per serving / per dose\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    item: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"The (relevant) nutrients in the product\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``NutritionProductNutrient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"item\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``NutritionProductNutrient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/observation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Observation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Observation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Measurements and simple assertions.\n    Measurements and simple assertions made about a patient, device or other\n    subject.\n    \"\"\"\n\n    __resource_type__ = \"Observation\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan, proposal or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this event.  For example, a MedicationRequest may require a patient to\"\n            \" have laboratory test performed before  it is dispensed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"DeviceRequest\",\n                \"ImmunizationRecommendation\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ServiceRequest\",\n            ],\n        },\n    )\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Observed body part\",\n        description=(\n            \"Indicates the site on the subject's body where the observation was \"\n            \"made (i.e. the target site).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    bodyStructure: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"bodyStructure\",\n        title=\"Observed body structure\",\n        description=(\n            \"Indicates the body structure on the subject's body where the \"\n            \"observation was made (i.e. the target site).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BodyStructure\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classification of  type of observation\",\n        description=\"A code that classifies the general type of observation being made.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of observation (code / type)\",\n        description=(\n            \"Describes what was observed. Sometimes this is called the observation \"\n            '\"name\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    component: typing.List[fhirtypes.ObservationComponentType] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"Component results\",\n        description=(\n            \"Some observations have multiple component observations.  These \"\n            \"component observations are expressed as separate code value pairs that\"\n            \" share the same attributes.  Examples include systolic and diastolic \"\n            \"component observations for blood pressure measurement and multiple \"\n            \"component observations for genetics observations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dataAbsentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"dataAbsentReason\",\n        title=\"Why the result is missing\",\n        description=(\n            \"Provides a reason why the expected value in the element \"\n            \"Observation.value[x] is missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    derivedFrom: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Related resource from which the observation is made\",\n        description=(\n            \"The target resource that represents a measurement from which this \"\n            \"observation value is derived. For example, a calculated anion gap or a\"\n            \" fetal measurement based on an ultrasound image.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DocumentReference\",\n                \"ImagingStudy\",\n                \"ImagingSelection\",\n                \"QuestionnaireResponse\",\n                \"Observation\",\n                \"MolecularSequence\",\n                \"GenomicStudy\",\n            ],\n        },\n    )\n\n    device: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=(\n            \"A reference to the device that generates the measurements or the \"\n            \"device settings for the device\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"DeviceMetric\"],\n        },\n    )\n\n    effectiveDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"effectiveDateTime\",\n        title=\"Clinically relevant time/time-period for observation\",\n        description=(\n            \"The time or time-period the observed value is asserted as being true. \"\n            \"For biological subjects - e.g. human patients - this is usually called\"\n            ' the \"physiologically relevant time\". This is usually either the time '\n            \"of the procedure or of specimen collection, but very often the source \"\n            \"of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveDateTime\",\n        title=\"Extension field for ``effectiveDateTime``.\",\n    )\n\n    effectiveInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"effectiveInstant\",\n        title=\"Clinically relevant time/time-period for observation\",\n        description=(\n            \"The time or time-period the observed value is asserted as being true. \"\n            \"For biological subjects - e.g. human patients - this is usually called\"\n            ' the \"physiologically relevant time\". This is usually either the time '\n            \"of the procedure or of specimen collection, but very often the source \"\n            \"of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n    effectiveInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_effectiveInstant\",\n        title=\"Extension field for ``effectiveInstant``.\",\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"Clinically relevant time/time-period for observation\",\n        description=(\n            \"The time or time-period the observed value is asserted as being true. \"\n            \"For biological subjects - e.g. human patients - this is usually called\"\n            ' the \"physiologically relevant time\". This is usually either the time '\n            \"of the procedure or of specimen collection, but very often the source \"\n            \"of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    effectiveTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"effectiveTiming\",\n        title=\"Clinically relevant time/time-period for observation\",\n        description=(\n            \"The time or time-period the observed value is asserted as being true. \"\n            \"For biological subjects - e.g. human patients - this is usually called\"\n            ' the \"physiologically relevant time\". This is usually either the time '\n            \"of the procedure or of specimen collection, but very often the source \"\n            \"of the date/time is not known, only the date/time itself.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e effective[x]\n            \"one_of_many\": \"effective\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Healthcare event during which this observation is made\",\n        description=(\n            \"The healthcare event  (e.g. a patient and healthcare provider \"\n            \"interaction) during which this observation is made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    focus: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=(\n            \"What the observation is about, when it is not about the subject of \"\n            \"record\"\n        ),\n        description=(\n            \"The actual focus of an observation when it is not the patient of \"\n            \"record representing something or someone associated with the patient \"\n            \"such as a spouse, parent, fetus, or donor. For example, fetus \"\n            \"observations in a mother's record.  The focus of an observation could \"\n            \"also be an existing condition,  an intervention, the subject's diet,  \"\n            \"another observation of the subject,  or a body structure such as tumor\"\n            \" or implanted device.   An example use case would be using the \"\n            \"Observation resource to capture whether the mother is trained to \"\n            \"change her child's tracheostomy tube. In this example, the child is \"\n            \"the patient of record and the mother is the focus.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    hasMember: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"hasMember\",\n        title=\"Related resource that belongs to the Observation group\",\n        description=(\n            \"This observation is a group observation (e.g. a battery, a panel of \"\n            \"tests, a set of vital sign measurements) that includes the target as a\"\n            \" member of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Observation\",\n                \"QuestionnaireResponse\",\n                \"MolecularSequence\",\n            ],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for observation\",\n        description=\"A unique identifier assigned to this observation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR ObservationDefinition\",\n        description=(\n            \"The reference to a FHIR ObservationDefinition resource that provides \"\n            \"the definition that is adhered to in whole or in part by this \"\n            \"Observation instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e instantiates[x]\n            \"one_of_many\": \"instantiates\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n    instantiatesCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"instantiatesReference\",\n        title=\"Instantiates FHIR ObservationDefinition\",\n        description=(\n            \"The reference to a FHIR ObservationDefinition resource that provides \"\n            \"the definition that is adhered to in whole or in part by this \"\n            \"Observation instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e instantiates[x]\n            \"one_of_many\": \"instantiates\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n\n    interpretation: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"interpretation\",\n        title=\"High, low, normal, etc\",\n        description=(\n            \"A categorical assessment of an observation value.  For example, high, \"\n            \"low, normal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"Date/Time this version was made available\",\n        description=(\n            \"The date and time this version of the observation was made available \"\n            \"to providers, typically after the results have been reviewed and \"\n            \"verified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"How it was done\",\n        description=\"Indicates the mechanism used to perform the observation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments about the observation\",\n        description=\"Comments about the observation or the results.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=(\n            \"A larger event of which this particular Observation is a component or \"\n            \"step.  For example,  an observation as part of a procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicationAdministration\",\n                \"MedicationDispense\",\n                \"MedicationStatement\",\n                \"Procedure\",\n                \"Immunization\",\n                \"ImagingStudy\",\n                \"GenomicStudy\",\n            ],\n        },\n    )\n\n    performer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who is responsible for the observation\",\n        description='Who was responsible for asserting the observed value as \"true\".',\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    referenceRange: typing.List[fhirtypes.ObservationReferenceRangeType] | None = Field(\n        default=None,\n        alias=\"referenceRange\",\n        title=\"Provides guide for interpretation\",\n        description=(\n            \"Guidance on how to interpret the value by comparison to a normal or \"\n            \"recommended range.  Multiple reference ranges are interpreted as an \"\n            '\"OR\".   In other words, to represent two distinct target populations, '\n            \"two `referenceRange` elements would be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specimen: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Specimen used for this observation\",\n        description=\"The specimen that was used when this observation was made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\", \"Group\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | preliminary | final | amended +\",\n        description=\"The status of the result value.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"registered\", \"preliminary\", \"final\", \"amended\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who and/or what the observation is about\",\n        description=(\n            \"The patient, or group of patients, location, device, organization, \"\n            \"procedure or practitioner this observation is about and into whose or \"\n            \"what record the observation is placed. If the actual focus of the \"\n            \"observation is different from the subject (or a sample of, part, or \"\n            \"region of the subject), the `focus` element or the `code` itself \"\n            \"specifies the actual focus of the observation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Device\",\n                \"Location\",\n                \"Organization\",\n                \"Procedure\",\n                \"Practitioner\",\n                \"Medication\",\n                \"Substance\",\n                \"BiologicallyDerivedProduct\",\n                \"NutritionProduct\",\n            ],\n        },\n    )\n\n    triggeredBy: typing.List[fhirtypes.ObservationTriggeredByType] | None = Field(\n        default=None,\n        alias=\"triggeredBy\",\n        title=\"Triggering observation(s)\",\n        description=(\n            \"Identifies the observation(s) that triggered the performance of this \"\n            \"observation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MolecularSequence\"],\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Actual result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Observation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesReference\",\n            \"basedOn\",\n            \"triggeredBy\",\n            \"partOf\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"focus\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"effectiveTiming\",\n            \"effectiveInstant\",\n            \"issued\",\n            \"performer\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueSampledData\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"valueAttachment\",\n            \"valueReference\",\n            \"dataAbsentReason\",\n            \"interpretation\",\n            \"note\",\n            \"bodySite\",\n            \"bodyStructure\",\n            \"method\",\n            \"specimen\",\n            \"device\",\n            \"referenceRange\",\n            \"hasMember\",\n            \"derivedFrom\",\n            \"component\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Observation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesReference\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"code\",\n            \"subject\",\n            \"focus\",\n            \"encounter\",\n            \"effectiveDateTime\",\n            \"effectivePeriod\",\n            \"effectiveTiming\",\n            \"effectiveInstant\",\n            \"issued\",\n            \"performer\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueSampledData\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"valueAttachment\",\n            \"valueReference\",\n            \"hasMember\",\n            \"derivedFrom\",\n            \"component\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"effective\": [\n                \"effectiveDateTime\",\n                \"effectiveInstant\",\n                \"effectivePeriod\",\n                \"effectiveTiming\",\n            ],\n            \"instantiates\": [\"instantiatesCanonical\", \"instantiatesReference\"],\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDateTime\",\n                \"valueInteger\",\n                \"valuePeriod\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueReference\",\n                \"valueSampledData\",\n                \"valueString\",\n                \"valueTime\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass ObservationComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Component results.\n    Some observations have multiple component observations.  These component\n    observations are expressed as separate code value pairs that share the same\n    attributes.  Examples include systolic and diastolic component observations\n    for blood pressure measurement and multiple component observations for\n    genetics observations.\n    \"\"\"\n\n    __resource_type__ = \"ObservationComponent\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of component observation (code / type)\",\n        description=(\n            \"Describes what was observed. Sometimes this is called the observation \"\n            '\"code\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dataAbsentReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"dataAbsentReason\",\n        title=\"Why the component result is missing\",\n        description=(\n            \"Provides a reason why the expected value in the element \"\n            \"Observation.component.value[x] is missing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    interpretation: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"interpretation\",\n        title=\"High, low, normal, etc\",\n        description=(\n            \"A categorical assessment of an observation value.  For example, high, \"\n            \"low, normal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    referenceRange: typing.List[fhirtypes.ObservationReferenceRangeType] | None = Field(\n        default=None,\n        alias=\"referenceRange\",\n        title=\"Provides guide for interpretation of component result\",\n        description=(\n            \"Guidance on how to interpret the value by comparison to a normal or \"\n            \"recommended range.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MolecularSequence\"],\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Actual component result\",\n        description=(\n            \"The information determined as a result of making the observation, if \"\n            \"the information has a simple value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueSampledData\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"valueAttachment\",\n            \"valueReference\",\n            \"dataAbsentReason\",\n            \"interpretation\",\n            \"referenceRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"code\",\n            \"valueQuantity\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueSampledData\",\n            \"valueTime\",\n            \"valueDateTime\",\n            \"valuePeriod\",\n            \"valueAttachment\",\n            \"valueReference\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDateTime\",\n                \"valueInteger\",\n                \"valuePeriod\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueReference\",\n                \"valueSampledData\",\n                \"valueString\",\n                \"valueTime\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ObservationReferenceRange(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Provides guide for interpretation.\n    Guidance on how to interpret the value by comparison to a normal or\n    recommended range.  Multiple reference ranges are interpreted as an \"OR\".\n    In other words, to represent two distinct target populations, two\n    `referenceRange` elements would be used.\n    \"\"\"\n\n    __resource_type__ = \"ObservationReferenceRange\"\n\n    age: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"age\",\n        title=\"Applicable age range, if relevant\",\n        description=(\n            \"The age at which this reference range is applicable. This is a \"\n            \"neonatal age (e.g. number of weeks at term) if the meaning says so.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    appliesTo: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"appliesTo\",\n        title=\"Reference range population\",\n        description=(\n            \"Codes to indicate the target population this reference range applies \"\n            \"to.  For example, a reference range may be based on the normal \"\n            \"population or a particular sex or race.  Multiple `appliesTo`  are \"\n            'interpreted as an \"AND\" of the target populations.  For example, to '\n            \"represent a target population of African American females, both a code\"\n            \" of female and a code for African American would be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    high: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"high\",\n        title=\"High Range, if relevant\",\n        description=(\n            \"The value of the high bound of the reference range.  The high bound of\"\n            \" the reference range endpoint is inclusive of the value (e.g.  \"\n            \"reference range is >=5 - <=9). If the high bound is omitted,  it is \"\n            \"assumed to be meaningless (e.g. reference range is >= 2.3).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    low: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"low\",\n        title=\"Low Range, if relevant\",\n        description=(\n            \"The value of the low bound of the reference range.  The low bound of \"\n            \"the reference range endpoint is inclusive of the value (e.g.  \"\n            \"reference range is >=5 - <=9). If the low bound is omitted,  it is \"\n            \"assumed to be meaningless (e.g. reference range is <=2.3).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    normalValue: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"normalValue\",\n        title=\"Normal value, if relevant\",\n        description=\"The value of the normal value of the reference range.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    text: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Text based reference range in an observation\",\n        description=(\n            \"Text based reference range in an observation which may be used when a \"\n            \"quantitative range is not appropriate for an observation.  An example \"\n            'would be a reference value of \"Negative\" or a list or table of '\n            '\"normals\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Reference range qualifier\",\n        description=(\n            \"Codes to indicate the what part of the targeted reference population \"\n            \"it applies to. For example, the normal or therapeutic range.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationReferenceRange`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"low\",\n            \"high\",\n            \"normalValue\",\n            \"type\",\n            \"appliesTo\",\n            \"age\",\n            \"text\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationReferenceRange`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ObservationTriggeredBy(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Triggering observation(s).\n    Identifies the observation(s) that triggered the performance of this\n    observation.\n    \"\"\"\n\n    __resource_type__ = \"ObservationTriggeredBy\"\n\n    observation: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"observation\",\n        title=\"Triggering observation\",\n        description=\"Reference to the triggering observation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\"],\n        },\n    )\n\n    reason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Reason that the observation was triggered\",\n        description=(\n            \"Provides the reason why this observation was performed as a result of \"\n            \"the observation(s) referenced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reason\", title=\"Extension field for ``reason``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"reflex | repeat | re-run\",\n        description=\"The type of trigger. Reflex | Repeat | Re-run.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"reflex\", \"repeat\", \"re-run\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationTriggeredBy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"observation\", \"type\", \"reason\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationTriggeredBy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"observation\", \"type\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/observationdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ObservationDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ObservationDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of an observation.\n    Set of definitional characteristics for a kind of observation or\n    measurement produced or consumed by an orderable health care service.\n    \"\"\"\n\n    __resource_type__ = \"ObservationDefinition\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When ObservationDefinition was approved by publisher\",\n        description=(\n            \"The date on which the asset content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    bodySite: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Body part to be observed\",\n        description=\"The site on the subject's body where the  observation is to be made.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"General type of observation\",\n        description=\"A code that classifies the general type of observation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of observation\",\n        description=(\n            \"Describes what will be observed. Sometimes this is called the \"\n            'observation \"name\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    component: typing.List[fhirtypes.ObservationDefinitionComponentType] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"Component results\",\n        description=(\n            \"Some observations have multiple component observations, expressed as \"\n            \"separate code value pairs.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"Copyright statement relating to the ObservationDefinition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date (and optionally time) when the ObservationDefinition was last\"\n            \" significantly changed. The date must change when the business version\"\n            \" changes and it must change if the status code changes. In addition, \"\n            \"it should change when the substantive content of the \"\n            \"ObservationDefinition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFromCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"derivedFromCanonical\",\n        title=\"Based on FHIR definition of another observation\",\n        description=(\n            \"The canonical URL pointing to another FHIR-defined \"\n            \"ObservationDefinition that is adhered to in whole or in part by this \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\"],\n        },\n    )\n    derivedFromCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_derivedFromCanonical\",\n        title=\"Extension field for ``derivedFromCanonical``.\",\n    )\n\n    derivedFromUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"derivedFromUri\",\n        title=\"Based on external definition\",\n        description=(\n            \"The URL pointing to an externally-defined observation definition, \"\n            \"guideline or other definition that is adhered to in whole or in part \"\n            \"by this definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    derivedFromUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_derivedFromUri\",\n        title=\"Extension field for ``derivedFromUri``.\",\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the ObservationDefinition\",\n        description=(\n            \"A free text natural language description of the ObservationDefinition \"\n            \"from the consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    device: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Measurement device or model of device\",\n        description=(\n            \"The measurement model of device or actual device used to produce \"\n            \"observations of this type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DeviceDefinition\", \"Device\"],\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"The effective date range for the ObservationDefinition\",\n        description=(\n            \"The period during which the ObservationDefinition content was or is \"\n            \"planned to be effective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"If for testing purposes, not real usage\",\n        description=(\n            \"A flag to indicate that this ObservationDefinition is authored for \"\n            \"testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    hasMember: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"hasMember\",\n        title=(\n            \"Definitions of related resources belonging to this kind of observation\"\n            \" group\"\n        ),\n        description=(\n            \"This ObservationDefinition defines a group  observation (e.g. a \"\n            \"battery, a panel of tests, a set of vital sign measurements) that \"\n            \"includes the target as a member of the group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ObservationDefinition\", \"Questionnaire\"],\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier of the ObservationDefinition\",\n        description=(\n            \"Business identifiers assigned to this ObservationDefinition. by the \"\n            \"performer and/or other systems. These identifiers remain constant as \"\n            \"the resource is updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for this ObservationDefinition (if applicable)\",\n        description=(\n            \"A jurisdiction in which the ObservationDefinition is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"Date on which the asset content was last reviewed by the publisher\",\n        description=(\n            \"The date on which the asset content was last reviewed. Review happens \"\n            \"periodically after that, but doesn't change the original approval \"\n            \"date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Method used to produce the observation\",\n        description=\"The method or technique used to perform the observation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    multipleResultsAllowed: bool | None = Field(\n        default=None,\n        alias=\"multipleResultsAllowed\",\n        title=\"Multiple results allowed for conforming observations\",\n        description=(\n            \"Multiple results allowed for observations conforming to this \"\n            \"ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    multipleResultsAllowed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_multipleResultsAllowed\",\n        title=\"Extension field for ``multipleResultsAllowed``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this ObservationDefinition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the ObservationDefinition. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    performerType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=\"Desired kind of performer for such kind of observation\",\n        description=(\n            \"The type of individual/organization/device that is expected to act \"\n            \"upon instances of this definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    permittedDataType: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"permittedDataType\",\n        title=(\n            \"Quantity | CodeableConcept | string | boolean | integer | Range | \"\n            \"Ratio | SampledData | time | dateTime | Period\"\n        ),\n        description=(\n            \"The data types allowed for the value element of the instance \"\n            \"observations conforming to this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"Quantity\",\n                \"CodeableConcept\",\n                \"string\",\n                \"boolean\",\n                \"integer\",\n                \"Range\",\n                \"Ratio\",\n                \"SampledData\",\n                \"time\",\n                \"dateTime\",\n                \"Period\",\n            ],\n        },\n    )\n    permittedDataType__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_permittedDataType\",\n        title=\"Extension field for ``permittedDataType``.\",\n    )\n\n    permittedUnit: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"permittedUnit\",\n        title=\"Unit for quantitative results\",\n        description=(\n            \"Units allowed for the valueQuantity element in the instance \"\n            \"observations conforming to this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preferredReportName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"preferredReportName\",\n        title=\"The preferred name to be used when reporting the observation results\",\n        description=(\n            \"The preferred name to be used when reporting the results of \"\n            \"observations conforming to this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preferredReportName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_preferredReportName\",\n        title=\"Extension field for ``preferredReportName``.\",\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=(\n            \"The name of the individual or organization that published the \"\n            \"ObservationDefinition\"\n        ),\n        description=(\n            'Helps establish the \"authority/credibility\" of the '\n            \"ObservationDefinition. May also allow for contact.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this ObservationDefinition is defined\",\n        description=(\n            \"Explains why this ObservationDefinition is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    qualifiedValue: typing.List[\n        fhirtypes.ObservationDefinitionQualifiedValueType\n    ] | None = Field(\n        default=None,\n        alias=\"qualifiedValue\",\n        title=\"Set of qualified values for observation results\",\n        description=(\n            \"A set of qualified values associated with a context and a set of \"\n            \"conditions -  provides a range for quantitative and ordinal \"\n            \"observations and a collection of value sets for qualitative \"\n            \"observations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    specimen: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Kind of specimen used by this type of observation\",\n        description=\"The kind of specimen that this type of observation is produced on.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SpecimenDefinition\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The current state of the ObservationDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Type of subject for the defined observation\",\n        description=(\n            \"A code that describes the intended kind of subject of Observation \"\n            \"instances conforming to this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this ObservationDefinition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the \"\n            \"ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Logical canonical URL to reference this ObservationDefinition \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URL that is used to identify this ObservationDefinition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD \"\n            \"be an address at which this ObservationDefinition is (or will be) \"\n            \"published. The URL SHOULD include the major version of the \"\n            \"ObservationDefinition. For more information see Technical and Business\"\n            \" Versions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Content intends to support these contexts\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate ObservationDefinition \"\n            \"instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the ObservationDefinition\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"ObservationDefinition when it is referenced in a specification, model,\"\n            \" design or instance. This is an arbitrary value managed by the \"\n            \"ObservationDefinition author and is not expected to be globally \"\n            \"unique. For example, it might be a timestamp (e.g. yyyymmdd) if a \"\n            \"managed version is not available. There is also no expectation that \"\n            \"versions are orderable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"derivedFromCanonical\",\n            \"derivedFromUri\",\n            \"subject\",\n            \"performerType\",\n            \"category\",\n            \"code\",\n            \"permittedDataType\",\n            \"multipleResultsAllowed\",\n            \"bodySite\",\n            \"method\",\n            \"specimen\",\n            \"device\",\n            \"preferredReportName\",\n            \"permittedUnit\",\n            \"qualifiedValue\",\n            \"hasMember\",\n            \"component\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"derivedFromCanonical\",\n            \"derivedFromUri\",\n            \"subject\",\n            \"performerType\",\n            \"category\",\n            \"code\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass ObservationDefinitionComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Component results.\n    Some observations have multiple component observations, expressed as\n    separate code value pairs.\n    \"\"\"\n\n    __resource_type__ = \"ObservationDefinitionComponent\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of observation\",\n        description=\"Describes what will be observed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    permittedDataType: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"permittedDataType\",\n        title=(\n            \"Quantity | CodeableConcept | string | boolean | integer | Range | \"\n            \"Ratio | SampledData | time | dateTime | Period\"\n        ),\n        description=(\n            \"The data types allowed for the value element of the instance of this \"\n            \"component observations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"Quantity\",\n                \"CodeableConcept\",\n                \"string\",\n                \"boolean\",\n                \"integer\",\n                \"Range\",\n                \"Ratio\",\n                \"SampledData\",\n                \"time\",\n                \"dateTime\",\n                \"Period\",\n            ],\n        },\n    )\n    permittedDataType__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_permittedDataType\",\n        title=\"Extension field for ``permittedDataType``.\",\n    )\n\n    permittedUnit: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"permittedUnit\",\n        title=\"Unit for quantitative results\",\n        description=(\n            \"Units allowed for the valueQuantity element in the instance \"\n            \"observations conforming to this ObservationDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    qualifiedValue: typing.List[\n        fhirtypes.ObservationDefinitionQualifiedValueType\n    ] | None = Field(\n        default=None,\n        alias=\"qualifiedValue\",\n        title=\"Set of qualified values for observation results\",\n        description=(\n            \"A set of qualified values associated with a context and a set of \"\n            \"conditions -  provides a range for quantitative and ordinal \"\n            \"observations and a collection of value sets for qualitative \"\n            \"observations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationDefinitionComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"permittedDataType\",\n            \"permittedUnit\",\n            \"qualifiedValue\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationDefinitionComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ObservationDefinitionQualifiedValue(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Set of qualified values for observation results.\n    A set of qualified values associated with a context and a set of conditions\n    -  provides a range for quantitative and ordinal observations and a\n    collection of value sets for qualitative observations.\n    \"\"\"\n\n    __resource_type__ = \"ObservationDefinitionQualifiedValue\"\n\n    abnormalCodedValueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"abnormalCodedValueSet\",\n        title=(\n            \"Value set of abnormal coded values as part of this set of qualified \"\n            \"values\"\n        ),\n        description=(\n            \"The set of abnormal coded results for qualitative observations  that \"\n            \"match the criteria of this set of qualified values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    abnormalCodedValueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_abnormalCodedValueSet\",\n        title=\"Extension field for ``abnormalCodedValueSet``.\",\n    )\n\n    age: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"age\",\n        title=\"Applicable age range for the set of qualified values\",\n        description=\"The age range this  set of qualified values applies to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    appliesTo: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"appliesTo\",\n        title=\"Targetted population for the set of qualified values\",\n        description=\"The target population this  set of qualified values applies to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    condition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Condition associated with the set of qualified values\",\n        description=(\n            \"Text based condition for which the the set of qualified values is \"\n            \"valid.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_condition\", title=\"Extension field for ``condition``.\"\n    )\n\n    context: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Context qualifier for the set of qualified values\",\n        description=\"A concept defining the context for this set of qualified values.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    criticalCodedValueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"criticalCodedValueSet\",\n        title=(\n            \"Value set of critical coded values as part of this set of qualified \"\n            \"values\"\n        ),\n        description=(\n            \"The set of critical coded results for qualitative observations  that \"\n            \"match the criteria of this set of qualified values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    criticalCodedValueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_criticalCodedValueSet\",\n        title=\"Extension field for ``criticalCodedValueSet``.\",\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=\"The gender this  set of qualified values applies to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    gestationalAge: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"gestationalAge\",\n        title=\"Applicable gestational age range for the set of qualified values\",\n        description=\"The gestational age this  set of qualified values applies to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    normalCodedValueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"normalCodedValueSet\",\n        title=(\n            \"Value set of normal coded values as part of this set of qualified \"\n            \"values\"\n        ),\n        description=(\n            \"The set of normal coded results for qualitative observations  that \"\n            \"match the criteria of this set of qualified values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    normalCodedValueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_normalCodedValueSet\",\n        title=\"Extension field for ``normalCodedValueSet``.\",\n    )\n\n    range: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"range\",\n        title=\"The range for continuous or ordinal observations\",\n        description=(\n            \"The range of values defined for continuous or ordinal observations \"\n            \"that match the criteria of this set of qualified values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rangeCategory: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"rangeCategory\",\n        title=\"reference | critical | absolute\",\n        description=(\n            \"The category of range of values for continuous or ordinal observations\"\n            \" that match the criteria of this set of qualified values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"reference\", \"critical\", \"absolute\"],\n        },\n    )\n    rangeCategory__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_rangeCategory\",\n        title=\"Extension field for ``rangeCategory``.\",\n    )\n\n    validCodedValueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"validCodedValueSet\",\n        title=(\n            \"Value set of valid coded values as part of this set of qualified \" \"values\"\n        ),\n        description=(\n            \"The set of valid coded results for qualitative observations  that \"\n            \"match the criteria of this set of qualified values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    validCodedValueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_validCodedValueSet\",\n        title=\"Extension field for ``validCodedValueSet``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ObservationDefinitionQualifiedValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"context\",\n            \"appliesTo\",\n            \"gender\",\n            \"age\",\n            \"gestationalAge\",\n            \"condition\",\n            \"rangeCategory\",\n            \"range\",\n            \"validCodedValueSet\",\n            \"normalCodedValueSet\",\n            \"abnormalCodedValueSet\",\n            \"criticalCodedValueSet\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ObservationDefinitionQualifiedValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/operationdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OperationDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass OperationDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of an operation or a named query.\n    A formal computable definition of an operation (on the RESTful interface)\n    or a named query (using the search interaction).\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinition\"\n\n    affectsState: bool | None = Field(\n        default=None,\n        alias=\"affectsState\",\n        title=\"Whether content is changed by the operation\",\n        description=(\n            \"Whether the operation affects state. Side effects such as producing \"\n            \"audit trail entries do not count as 'affecting  state'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    affectsState__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_affectsState\",\n        title=\"Extension field for ``affectsState``.\",\n    )\n\n    base: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"Marks this as a profile of the base\",\n        description=(\n            \"Indicates that this operation definition is a constraining profile on \"\n            \"the base.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"OperationDefinition\"],\n        },\n    )\n    base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_base\", title=\"Extension field for ``base``.\"\n    )\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Recommended name for operation in search url\",\n        description=(\n            \"The label that is recommended to be used in the URL for this \"\n            \"operation. In some cases, servers may need to use a different \"\n            \"CapabilityStatement operation.name to differentiate between multiple \"\n            \"SearchParameters that happen to have the same code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    comment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Additional information about use\",\n        description=\"Additional information about how to use this operation or named query.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the operation definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the operation definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the operation definition was last\"\n            \" significantly changed. The date must change when the business version\"\n            \" changes and it must change if the status code changes. In addition, \"\n            \"it should change when the substantive content of the operation \"\n            \"definition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the operation definition\",\n        description=(\n            \"A free text natural language description of the operation definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this operation definition is authored\"\n            \" for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"Additional identifier for the implementation guide (business \"\n            \"identifier)\"\n        ),\n        description=(\n            \"A formal identifier that is used to identify this implementation guide\"\n            \" when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    inputProfile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"inputProfile\",\n        title=\"Validation information for in parameters\",\n        description=(\n            \"Additional validation information for the in parameters - a single \"\n            \"profile that covers all the parameters. The profile is a constraint on\"\n            \" the parameters resource as a whole.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    inputProfile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_inputProfile\",\n        title=\"Extension field for ``inputProfile``.\",\n    )\n\n    instance: bool | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"Invoke on an instance?\",\n        description=(\n            \"Indicates whether this operation can be invoked on a particular \"\n            \"instance of one of the given types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    instance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_instance\", title=\"Extension field for ``instance``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for operation definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the operation definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"operation | query\",\n        description=\"Whether this is an operation or a named query.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"operation\", \"query\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this operation definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the operation definition. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    outputProfile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"outputProfile\",\n        title=\"Validation information for out parameters\",\n        description=(\n            \"Additional validation information for the out parameters - a single \"\n            \"profile that covers all the parameters. The profile is a constraint on\"\n            \" the parameters resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    outputProfile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_outputProfile\",\n        title=\"Extension field for ``outputProfile``.\",\n    )\n\n    overload: typing.List[fhirtypes.OperationDefinitionOverloadType] | None = Field(\n        default=None,\n        alias=\"overload\",\n        title=\"Define overloaded variants for when  generating code\",\n        description=(\n            \"Defines an appropriate combination of parameters to use when invoking \"\n            \"this operation, to help code generators when generating overloaded \"\n            \"parameter sets for this operation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    parameter: typing.List[fhirtypes.OperationDefinitionParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Parameters for the operation/query\",\n        description=\"The parameters for the operation/query.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the operation definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this operation definition is defined\",\n        description=(\n            \"Explanation of why this operation definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    resource: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Types this operation applies to\",\n        description=\"The types on which this operation can be executed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    resource__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The current state of this operation definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    system: bool | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"Invoke at the system level?\",\n        description=(\n            \"Indicates whether this operation or named query can be invoked at the \"\n            \"system level (e.g. without needing to choose a resource type for the \"\n            \"context).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this operation definition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the operation \" \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: bool | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Invoke at the type level?\",\n        description=(\n            \"Indicates whether this operation or named query can be invoked at the \"\n            \"resource type level for any given resource type level (e.g. without \"\n            \"needing to choose a specific resource id for the context).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this operation definition, represented as an \"\n            \"absolute URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this operation definition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which an \"\n            \"authoritative instance of this operation definition is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the operation definition is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate operation definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the operation definition\",\n        description=(\n            \"The identifier that is used to identify this version of the operation \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the operation \"\n            \"definition author and is not expected to be globally unique. For \"\n            \"example, it might be a timestamp (e.g. yyyymmdd) if a managed version \"\n            \"is not available. There is also no expectation that versions can be \"\n            \"placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"kind\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"affectsState\",\n            \"code\",\n            \"comment\",\n            \"base\",\n            \"resource\",\n            \"system\",\n            \"type\",\n            \"instance\",\n            \"inputProfile\",\n            \"outputProfile\",\n            \"parameter\",\n            \"overload\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"kind\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"affectsState\",\n            \"code\",\n            \"base\",\n            \"resource\",\n            \"system\",\n            \"type\",\n            \"instance\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"code\", \"code__ext\"),\n            (\"instance\", \"instance__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"system\", \"system__ext\"),\n            (\"type\", \"type__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass OperationDefinitionOverload(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Define overloaded variants for when  generating code.\n    Defines an appropriate combination of parameters to use when invoking this\n    operation, to help code generators when generating overloaded parameter\n    sets for this operation.\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinitionOverload\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments to go on overload\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    parameterName: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"parameterName\",\n        title=\"Name of parameter to include in overload\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    parameterName__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_parameterName\",\n        title=\"Extension field for ``parameterName``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinitionOverload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"parameterName\", \"comment\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinitionOverload`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass OperationDefinitionParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Parameters for the operation/query.\n    The parameters for the operation/query.\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinitionParameter\"\n\n    allowedType: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"allowedType\",\n        title=\"Allowed sub-type this parameter can have (if type is abstract)\",\n        description=(\n            \"Support for polymorphic types. If the parameter type is abstract, this\"\n            \" element lists allowed sub-types for the parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    allowedType__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_allowedType\", title=\"Extension field for ``allowedType``.\"\n    )\n\n    binding: fhirtypes.OperationDefinitionParameterBindingType | None = Field(\n        default=None,\n        alias=\"binding\",\n        title=\"ValueSet details if this is coded\",\n        description=(\n            \"Binds to a value set if this parameter is coded (code, Coding, \"\n            \"CodeableConcept).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    documentation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Description of meaning/use\",\n        description=\"Describes the meaning or use of this parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum Cardinality (a number or *)\",\n        description=(\n            \"The maximum number of times this element is permitted to appear in the\"\n            \" request or response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum Cardinality\",\n        description=(\n            \"The minimum number of times this parameter SHALL appear in the request\"\n            \" or response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    name: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name in Parameters.parameter.name or in URL\",\n        description=\"The name of used to identify the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    part: typing.List[fhirtypes.OperationDefinitionParameterType] | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"Parts of a nested Parameter\",\n        description=\"The parts of a nested Parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    referencedFrom: typing.List[\n        fhirtypes.OperationDefinitionParameterReferencedFromType\n    ] | None = Field(\n        default=None,\n        alias=\"referencedFrom\",\n        title=\"References to this parameter\",\n        description=(\n            \"Identifies other resource parameters within the operation invocation \"\n            \"that are expected to resolve to this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    scope: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"scope\",\n        title=\"instance | type | system\",\n        description=(\n            \"If present, indicates that the parameter applies when the operation is\"\n            \" being invoked at the specified level.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"type\", \"system\"],\n        },\n    )\n    scope__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_scope\", title=\"Extension field for ``scope``.\"\n    )\n\n    searchType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"searchType\",\n        title=(\n            \"number | date | string | token | reference | composite | quantity | \"\n            \"uri | special\"\n        ),\n        description=(\n            \"How the parameter is understood if/when it used as search parameter. \"\n            \"This is only used if the parameter is a string.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"number\",\n                \"date\",\n                \"string\",\n                \"token\",\n                \"reference\",\n                \"composite\",\n                \"quantity\",\n                \"uri\",\n                \"special\",\n            ],\n        },\n    )\n    searchType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_searchType\", title=\"Extension field for ``searchType``.\"\n    )\n\n    targetProfile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"targetProfile\",\n        title=(\n            \"If type is Reference | canonical, allowed targets. If type is \"\n            \"'Resource', then this constrains the allowed resource types\"\n        ),\n        description=(\n            'Used when the type is \"Reference\" or \"canonical\", and identifies a '\n            \"profile structure or implementation Guide that applies to the target \"\n            \"of the reference this parameter refers to. If any profiles are \"\n            \"specified, then the content must conform to at least one of them. The \"\n            \"URL can be a local reference - to a contained StructureDefinition, or \"\n            \"a reference to another StructureDefinition or Implementation Guide by \"\n            \"a canonical URL. When an implementation guide is specified, the target\"\n            \" resource SHALL conform to at least one profile defined in the \"\n            \"implementation guide.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    targetProfile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_targetProfile\",\n        title=\"Extension field for ``targetProfile``.\",\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"What type this parameter has\",\n        description=\"The type for this parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"in | out\",\n        description=\"Whether this is an input or an output parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"in\", \"out\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinitionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"use\",\n            \"scope\",\n            \"min\",\n            \"max\",\n            \"documentation\",\n            \"type\",\n            \"allowedType\",\n            \"targetProfile\",\n            \"searchType\",\n            \"binding\",\n            \"referencedFrom\",\n            \"part\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"max\", \"max__ext\"),\n            (\"min\", \"min__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"use\", \"use__ext\"),\n        ]\n        return required_fields\n\n\nclass OperationDefinitionParameterBinding(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    ValueSet details if this is coded.\n    Binds to a value set if this parameter is coded (code, Coding,\n    CodeableConcept).\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinitionParameterBinding\"\n\n    strength: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"strength\",\n        title=\"required | extensible | preferred | example\",\n        description=(\n            \"Indicates the degree of conformance expectations associated with this \"\n            \"binding - that is, the degree to which the provided value set must be \"\n            \"adhered to in the instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"required\", \"extensible\", \"preferred\", \"example\"],\n        },\n    )\n    strength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_strength\", title=\"Extension field for ``strength``.\"\n    )\n\n    valueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Source of value set\",\n        description=(\n            \"Points to the value set or external definition (e.g. implicit value \"\n            \"set) that identifies the set of codes to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinitionParameterBinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"strength\", \"valueSet\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameterBinding`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"strength\", \"strength__ext\"), (\"valueSet\", \"valueSet__ext\")]\n        return required_fields\n\n\nclass OperationDefinitionParameterReferencedFrom(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    References to this parameter.\n    Identifies other resource parameters within the operation invocation that\n    are expected to resolve to this resource.\n    \"\"\"\n\n    __resource_type__ = \"OperationDefinitionParameterReferencedFrom\"\n\n    source: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Referencing parameter\",\n        description=(\n            \"The name of the parameter or dot-separated path of parameter names \"\n            \"pointing to the resource parameter that is expected to contain a \"\n            \"reference to this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    source__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_source\", title=\"Extension field for ``source``.\"\n    )\n\n    sourceId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sourceId\",\n        title=\"Element id of reference\",\n        description=(\n            \"The id of the element in the referencing resource that is expected to \"\n            \"resolve to this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceId\", title=\"Extension field for ``sourceId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationDefinitionParameterReferencedFrom`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"source\", \"sourceId\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationDefinitionParameterReferencedFrom`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"source\", \"source__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/operationoutcome.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OperationOutcome\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass OperationOutcome(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the success/failure of an action.\n    A collection of error, warning, or information messages that result from a\n    system action.\n    \"\"\"\n\n    __resource_type__ = \"OperationOutcome\"\n\n    issue: typing.List[fhirtypes.OperationOutcomeIssueType] = Field(\n        default=...,\n        alias=\"issue\",\n        title=\"A single issue associated with the action\",\n        description=(\n            \"An error, warning, or information message that results from a system \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationOutcome`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"issue\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationOutcome`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"modifierExtension\", \"issue\"]\n\n\nclass OperationOutcomeIssue(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A single issue associated with the action.\n    An error, warning, or information message that results from a system\n    action.\n    \"\"\"\n\n    __resource_type__ = \"OperationOutcomeIssue\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Error or warning code\",\n        description=(\n            \"Describes the type of the issue. The system that creates an \"\n            \"OperationOutcome SHALL choose the most applicable code from the \"\n            \"IssueType value set, and may additional provide its own code for the \"\n            \"error in the details element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    details: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"details\",\n        title=\"Additional details about the error\",\n        description=(\n            \"Additional details about the error. This may be a text description of \"\n            \"the error or a system code that identifies the error.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    diagnostics: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"diagnostics\",\n        title=\"Additional diagnostic information about the issue\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    diagnostics__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_diagnostics\", title=\"Extension field for ``diagnostics``.\"\n    )\n\n    expression: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"FHIRPath of element(s) related to issue\",\n        description=(\n            \"A [simple subset of FHIRPath](fhirpath.html#simple) limited to element\"\n            \" names, repetition indicators and the default child accessor that \"\n            \"identifies one of the elements in the resource that caused this issue \"\n            \"to be raised.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    expression__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    location: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Deprecated: Path of element(s) related to issue\",\n        description=(\n            \"This element is deprecated because it is XML specific. It is replaced \"\n            \"by issue.expression, which is format independent, and simpler to \"\n            \"parse.   For resource issues, this will be a simple XPath limited to \"\n            \"element names, repetition indicators and the default child accessor \"\n            \"that identifies one of the elements in the resource that caused this \"\n            'issue to be raised.  For HTTP errors, will be \"http.\" + the parameter '\n            \"name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    location__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_location\", title=\"Extension field for ``location``.\"\n    )\n\n    severity: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"severity\",\n        title=\"fatal | error | warning | information | success\",\n        description=(\n            \"Indicates whether the issue indicates a variation from successful \"\n            \"processing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"fatal\", \"error\", \"warning\", \"information\", \"success\"],\n        },\n    )\n    severity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_severity\", title=\"Extension field for ``severity``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OperationOutcomeIssue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"severity\",\n            \"code\",\n            \"details\",\n            \"diagnostics\",\n            \"location\",\n            \"expression\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OperationOutcomeIssue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"severity\",\n            \"code\",\n            \"details\",\n            \"diagnostics\",\n            \"location\",\n            \"expression\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"severity\", \"severity__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/organization.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Organization\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Organization(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A grouping of people or organizations with a common purpose.\n    A formally or informally recognized grouping of people or organizations\n    formed for the purpose of achieving some form of collective action.\n    Includes companies, institutions, corporations, departments, community\n    groups, healthcare practice groups, payer/insurer, etc.\n    \"\"\"\n\n    __resource_type__ = \"Organization\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether the organization's record is still in active use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    alias: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=(\n            \"A list of alternate names that the organization is known as, or was \"\n            \"known as in the past\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    alias__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    contact: typing.List[fhirtypes.ExtendedContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Official contact details for the Organization\",\n        description=(\n            \"The contact details of communication devices available relevant to the\"\n            \" specific Organization. This can include addresses, phone numbers, fax\"\n            \" numbers, mobile numbers, email addresses and web sites.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=(\n            \"Additional details about the Organization that could be displayed as \"\n            \"further information to identify the Organization beyond its name\"\n        ),\n        description=(\n            \"Description of the organization, which helps provide additional \"\n            \"general context on the organization to ensure that the correct \"\n            \"organization is selected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to services operated for the \"\n            \"organization\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifies this organization  across multiple systems\",\n        description=(\n            \"Identifier for the organization that is used to identify the \"\n            \"organization across multiple disparate systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name used for the organization\",\n        description=\"A name associated with the organization.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    partOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"The organization of which this organization forms a part\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    qualification: typing.List[fhirtypes.OrganizationQualificationType] | None = Field(\n        default=None,\n        alias=\"qualification\",\n        title=(\n            \"Qualifications, certifications, accreditations, licenses, training, \"\n            \"etc. pertaining to the provision of care\"\n        ),\n        description=(\n            \"The official certifications, accreditations, training, designations \"\n            \"and licenses that authorize and/or otherwise endorse the provision of \"\n            \"care by the organization.  For example, an approval to provide a type \"\n            \"of services issued by a certifying body (such as the US Joint \"\n            \"Commission) to an organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of organization\",\n        description=\"The kind(s) of organization that this is.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Organization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"type\",\n            \"name\",\n            \"alias\",\n            \"description\",\n            \"contact\",\n            \"partOf\",\n            \"endpoint\",\n            \"qualification\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Organization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"type\",\n            \"name\",\n            \"description\",\n            \"partOf\",\n        ]\n\n\nclass OrganizationQualification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Qualifications, certifications, accreditations, licenses, training, etc.\n    pertaining to the provision of care.\n    The official certifications, accreditations, training, designations and\n    licenses that authorize and/or otherwise endorse the provision of care by\n    the organization.\n\n    For example, an approval to provide a type of services issued by a\n    certifying body (such as the US Joint Commission) to an organization.\n    \"\"\"\n\n    __resource_type__ = \"OrganizationQualification\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Coded representation of the qualification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier for this qualification for the organization\",\n        description=\"An identifier allocated to this qualification for this organization.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    issuer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"issuer\",\n        title=\"Organization that regulates and issues the qualification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period during which the qualification is valid\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OrganizationQualification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"period\",\n            \"issuer\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OrganizationQualification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/organizationaffiliation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass OrganizationAffiliation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defines an affiliation/association/relationship between 2 distinct\n    organizations, that is not a part-of relationship/sub-division relationship.\n    \"\"\"\n\n    __resource_type__ = \"OrganizationAffiliation\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this organization affiliation record is in active use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Definition of the role the participatingOrganization plays\",\n        description=(\n            \"Definition of the role the participatingOrganization plays in the \"\n            \"association.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ExtendedContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=(\n            \"Official contact details at the participatingOrganization relevant to \"\n            \"this Affiliation\"\n        ),\n        description=(\n            \"The contact details of communication devices available at the \"\n            \"participatingOrganization relevant to this Affiliation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=(\n            \"Technical endpoints providing access to services operated for this \" \"role\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    healthcareService: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"healthcareService\",\n        title=\"Healthcare services provided through the role\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"HealthcareService\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifiers that are specific to this role\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"The location(s) at which the role occurs\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    network: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"network\",\n        title=(\n            \"The network in which the participatingOrganization provides the role's\"\n            \" services (if defined) at the indicated locations (if defined)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Organization where the role is available\",\n        description=(\n            \"Organization where the role is available (primary organization/has \"\n            \"members).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    participatingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"participatingOrganization\",\n        title=(\n            \"Organization that provides/performs the role (e.g. providing services \"\n            \"or is a member of)\"\n        ),\n        description=(\n            \"The Participating Organization provides/performs the role(s) defined \"\n            \"by the code to the Primary Organization (e.g. providing services or is\"\n            \" a member of).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=(\n            \"The period during which the participatingOrganization is affiliated \"\n            \"with the primary organization\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=(\n            \"Specific specialty of the participatingOrganization in the context of \"\n            \"the role\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``OrganizationAffiliation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"period\",\n            \"organization\",\n            \"participatingOrganization\",\n            \"network\",\n            \"code\",\n            \"specialty\",\n            \"location\",\n            \"healthcareService\",\n            \"contact\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``OrganizationAffiliation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"period\",\n            \"organization\",\n            \"participatingOrganization\",\n            \"network\",\n            \"code\",\n            \"specialty\",\n            \"location\",\n        ]\n"
  },
  {
    "path": "fhir/resources/packagedproductdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PackagedProductDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass PackagedProductDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A medically related item or items, in a container or package.\n    \"\"\"\n\n    __resource_type__ = \"PackagedProductDefinition\"\n\n    attachedDocument: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"attachedDocument\",\n        title=(\n            \"Additional information or supporting documentation about the packaged \"\n            \"product\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    characteristic: typing.List[\n        fhirtypes.PackagedProductDefinitionPackagingPropertyType\n    ] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=(\n            'Allows the key features to be recorded, such as \"hospital pack\", '\n            '\"nurse prescribable\"'\n        ),\n        description=(\n            'Allows the key features to be recorded, such as \"hospital pack\", '\n            '\"nurse prescribable\", \"calendar pack\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    containedItemQuantity: typing.List[fhirtypes.QuantityType] | None = Field(\n        default=None,\n        alias=\"containedItemQuantity\",\n        title=(\n            \"A total of the complete count of contained items of a particular \"\n            \"type/form, independent of sub-packaging or organization. This can be \"\n            \"considered as the pack size. See also packaging.containedItem.amount \"\n            \"(especially the long definition)\"\n        ),\n        description=(\n            \"A total of the complete count of contained items of a particular \"\n            \"type/form, independent of sub-packaging or organization. This can be \"\n            \"considered as the pack size. This attribute differs from \"\n            \"containedItem.amount in that it can give a single aggregated count of \"\n            \"all tablet types in a pack, even when these are different manufactured\"\n            \" items. For example a pill pack of 21 tablets plus 7 sugar tablets, \"\n            \"can be denoted here as '28 tablets'. This attribute is repeatable so \"\n            \"that the different item types in one pack type can be counted (e.g. a \"\n            \"count of vials and count of syringes). Each repeat must have different\"\n            \" units, so that it is clear what the different sets of counted items \"\n            \"are, and it is not intended to allow different counts of similar items\"\n            \" (e.g. not '2 tubes and 3 tubes'). Repeats are not to be used to \"\n            \"represent different pack sizes (e.g. 20 pack vs. 50 pack) - which \"\n            \"would be different instances of this resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copackagedIndicator: bool | None = Field(\n        default=None,\n        alias=\"copackagedIndicator\",\n        title=(\n            \"Identifies if the drug product is supplied with another item such as a\"\n            \" diluent or adjuvant\"\n        ),\n        description=(\n            \"Identifies if the package contains different items, such as when a \"\n            \"drug product is supplied with another item e.g. a diluent or adjuvant.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    copackagedIndicator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copackagedIndicator\",\n        title=\"Extension field for ``copackagedIndicator``.\",\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=(\n            \"Textual description. Note that this is not the name of the package or \"\n            \"product\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"A unique identifier for this package as whole - not for the content of\"\n            \" the package\"\n        ),\n        description=(\n            \"A unique identifier for this package as whole - not the the content of\"\n            \" the package. Unique instance identifiers assigned to a package by \"\n            \"manufacturers, regulators, drug catalogue custodians or other \"\n            \"organizations.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    legalStatusOfSupply: typing.List[\n        fhirtypes.PackagedProductDefinitionLegalStatusOfSupplyType\n    ] | None = Field(\n        default=None,\n        alias=\"legalStatusOfSupply\",\n        title=(\n            \"The legal status of supply of the packaged item as classified by the \"\n            \"regulator\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=(\n            \"Manufacturer of this package type (multiple means these are all \"\n            \"possible manufacturers)\"\n        ),\n        description=(\n            \"Manufacturer of this package type. When there are multiple it means \"\n            \"these are all possible manufacturers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    marketingStatus: typing.List[fhirtypes.MarketingStatusType] | None = Field(\n        default=None,\n        alias=\"marketingStatus\",\n        title=(\n            \"Allows specifying that an item is on the market for sale, or that it \"\n            \"is not available, and the dates and locations associated\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=(\n            \"A name for this package. Typically as listed in a drug formulary, \"\n            \"catalogue, inventory etc\"\n        ),\n        description=(\n            \"A name for this package. Typically what it would be listed as in a \"\n            \"drug formulary or catalogue, inventory etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    packageFor: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"packageFor\",\n        title=\"The product that this is a pack for\",\n        description=(\n            \"The product this package model relates to, not the contents of the \"\n            \"package (for which see package.containedItem).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"MedicinalProductDefinition\"],\n        },\n    )\n\n    packaging: fhirtypes.PackagedProductDefinitionPackagingType | None = Field(\n        default=None,\n        alias=\"packaging\",\n        title=(\n            \"A packaging item, as a container for medically related items, possibly\"\n            \" with other packaging items within, or a packaging component, such as \"\n            \"bottle cap\"\n        ),\n        description=(\n            \"A packaging item, as a container for medically related items, possibly\"\n            \" with other packaging items within, or a packaging component, such as \"\n            \"bottle cap (which is not a device or a medication manufactured item).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"The status within the lifecycle of this item. High level - not \"\n            \"intended to duplicate details elsewhere e.g. legal status, or \"\n            \"authorization/marketing status\"\n        ),\n        description=(\n            \"The status within the lifecycle of this item. A high level status, \"\n            \"this is not intended to duplicate details carried elsewhere such as \"\n            \"legal status, or authorization or marketing status.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    statusDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"The date at which the given status became applicable\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"A high level category e.g. medicinal product, raw material, shipping \"\n            \"container etc\"\n        ),\n        description=(\n            \"A high level category e.g. medicinal product, raw material, \"\n            \"shipping/transport container, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PackagedProductDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"type\",\n            \"packageFor\",\n            \"status\",\n            \"statusDate\",\n            \"containedItemQuantity\",\n            \"description\",\n            \"legalStatusOfSupply\",\n            \"marketingStatus\",\n            \"copackagedIndicator\",\n            \"manufacturer\",\n            \"attachedDocument\",\n            \"packaging\",\n            \"characteristic\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PackagedProductDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"type\",\n            \"packageFor\",\n            \"status\",\n            \"statusDate\",\n            \"containedItemQuantity\",\n            \"description\",\n            \"legalStatusOfSupply\",\n            \"marketingStatus\",\n            \"copackagedIndicator\",\n            \"manufacturer\",\n            \"attachedDocument\",\n            \"packaging\",\n            \"characteristic\",\n        ]\n\n\nclass PackagedProductDefinitionLegalStatusOfSupply(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The legal status of supply of the packaged item as classified by the\n    regulator.\n    \"\"\"\n\n    __resource_type__ = \"PackagedProductDefinitionLegalStatusOfSupply\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"The actual status of supply. In what situation this package type may \"\n            \"be supplied for use\"\n        ),\n        description=(\n            \"The actual status of supply. Conveys in what situation this package \"\n            \"type may be supplied for use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"The place where the legal status of supply applies\",\n        description=(\n            \"The place where the legal status of supply applies. When not \"\n            \"specified, this indicates it is unknown in this context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PackagedProductDefinitionLegalStatusOfSupply`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"jurisdiction\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionLegalStatusOfSupply`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"jurisdiction\"]\n\n\nclass PackagedProductDefinitionPackaging(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A packaging item, as a container for medically related items, possibly with\n    other packaging items within, or a packaging component, such as bottle cap.\n    A packaging item, as a container for medically related items, possibly with\n    other packaging items within, or a packaging component, such as bottle cap\n    (which is not a device or a medication manufactured item).\n    \"\"\"\n\n    __resource_type__ = \"PackagedProductDefinitionPackaging\"\n\n    alternateMaterial: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"alternateMaterial\",\n        title=(\n            \"A possible alternate material for this part of the packaging, that is \"\n            \"allowed to be used instead of the usual material\"\n        ),\n        description=(\n            \"A possible alternate material for this part of the packaging, that is \"\n            \"allowed to be used instead of the usual material (e.g. different types\"\n            \" of plastic for a blister sleeve).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    componentPart: bool | None = Field(\n        default=None,\n        alias=\"componentPart\",\n        title=(\n            \"Is this a part of the packaging (e.g. a cap or bottle stopper), rather\"\n            \" than the packaging itself (e.g. a bottle or vial)\"\n        ),\n        description=(\n            \"Is this a part of the packaging (e.g. a cap or bottle stopper), rather\"\n            \" than the packaging itself (e.g. a bottle or vial). The latter type \"\n            \"are designed be a container, but the former are not.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    componentPart__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_componentPart\",\n        title=\"Extension field for ``componentPart``.\",\n    )\n\n    containedItem: typing.List[\n        fhirtypes.PackagedProductDefinitionPackagingContainedItemType\n    ] | None = Field(\n        default=None,\n        alias=\"containedItem\",\n        title=\"The item(s) within the packaging\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"An identifier that is specific to this particular part of the \"\n            \"packaging. Including possibly a Data Carrier Identifier\"\n        ),\n        description=(\n            \"A business identifier that is specific to this particular part of the \"\n            \"packaging, often assigned by the manufacturer. Including possibly Data\"\n            \" Carrier Identifier (a GS1 barcode).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=(\n            \"Manufacturer of this packaging item (multiple means these are all \"\n            \"potential manufacturers)\"\n        ),\n        description=(\n            \"Manufacturer of this packaging item. When there are multiple values \"\n            \"each one is a potential manufacturer of this packaging item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    material: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"material\",\n        title=\"Material type of the package item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    packaging: typing.List[\n        fhirtypes.PackagedProductDefinitionPackagingType\n    ] | None = Field(\n        default=None,\n        alias=\"packaging\",\n        title=(\n            \"Allows containers (and parts of containers) within containers, still \"\n            \"as a part of single packaged product\"\n        ),\n        description=(\n            \"Allows containers (and parts of containers) within containers, still \"\n            \"as a part of a single packaged product. See also PackagedProductDefini\"\n            \"tion.packaging.containedItem.item(PackagedProductDefinition).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    property: typing.List[\n        fhirtypes.PackagedProductDefinitionPackagingPropertyType\n    ] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"General characteristics of this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    quantity: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=(\n            \"The quantity of this level of packaging in the package that contains \"\n            \"it (with the outermost level being 1)\"\n        ),\n        description=(\n            \"The quantity of packaging items contained at this layer of the \"\n            \"package. This does not relate to the number of contained items but \"\n            \"relates solely to the number of packaging items. When looking at the \"\n            \"outermost layer it is always 1. If there are two boxes within, at the \"\n            \"next layer it would be 2.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    quantity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_quantity\", title=\"Extension field for ``quantity``.\"\n    )\n\n    shelfLifeStorage: typing.List[fhirtypes.ProductShelfLifeType] | None = Field(\n        default=None,\n        alias=\"shelfLifeStorage\",\n        title=\"Shelf Life and storage information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The physical type of the container of the items\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PackagedProductDefinitionPackaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"componentPart\",\n            \"quantity\",\n            \"material\",\n            \"alternateMaterial\",\n            \"shelfLifeStorage\",\n            \"manufacturer\",\n            \"property\",\n            \"containedItem\",\n            \"packaging\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackaging`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"componentPart\",\n            \"quantity\",\n            \"material\",\n            \"alternateMaterial\",\n            \"shelfLifeStorage\",\n            \"manufacturer\",\n            \"property\",\n            \"containedItem\",\n            \"packaging\",\n        ]\n\n\nclass PackagedProductDefinitionPackagingContainedItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The item(s) within the packaging.\n    \"\"\"\n\n    __resource_type__ = \"PackagedProductDefinitionPackagingContainedItem\"\n\n    amount: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=(\n            \"The number of this type of item within this packaging or for \"\n            \"continuous items such as liquids it is the quantity (for example \"\n            \"25ml). See also PackagedProductDefinition.containedItemQuantity \"\n            \"(especially the long definition)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    item: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"item\",\n        title=(\n            \"The actual item(s) of medication, as manufactured, or a device, or \"\n            \"other medically related item (food, biologicals, raw materials, \"\n            \"medical fluids, gases etc.), as contained in the package\"\n        ),\n        description=(\n            \"The actual item(s) of medication, as manufactured, or a device \"\n            \"(typically, but not necessarily, a co-packaged one), or other \"\n            \"medically related item (such as food, biologicals, raw materials, \"\n            \"medical fluids, gases etc.), as contained in the package. This also \"\n            \"allows another whole packaged product to be included, which is solely \"\n            \"for the case where a package of other entire packages is wanted - such\"\n            \" as a wholesale or distribution pack (for layers within one package, \"\n            \"use PackagedProductDefinition.packaging.packaging).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"ManufacturedItemDefinition\",\n                \"DeviceDefinition\",\n                \"PackagedProductDefinition\",\n                \"BiologicallyDerivedProduct\",\n                \"NutritionProduct\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PackagedProductDefinitionPackagingContainedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"item\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackagingContainedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"item\", \"amount\"]\n\n\nclass PackagedProductDefinitionPackagingProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    General characteristics of this item.\n    \"\"\"\n\n    __resource_type__ = \"PackagedProductDefinitionPackagingProperty\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"A code expressing the type of characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"A value for the characteristic\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PackagedProductDefinitionPackagingProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PackagedProductDefinitionPackagingProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDate\",\n                \"valueQuantity\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/parameterdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ParameterDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass ParameterDefinition(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a parameter to a module.\n    The parameters to the module. This collection specifies both the input and\n    output parameters. Input parameters are provided by the caller as part of\n    the $evaluate operation. Output parameters are included in the\n    GuidanceResponse.\n    \"\"\"\n\n    __resource_type__ = \"ParameterDefinition\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"A brief description of the parameter\",\n        description=(\n            \"A brief discussion of what the parameter is for and how it is used by \"\n            \"the module.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Maximum cardinality (a number of *)\",\n        description=(\n            \"The maximum number of times this element is permitted to appear in the\"\n            \" request or response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Minimum cardinality\",\n        description=(\n            \"The minimum number of times this parameter SHALL appear in the request\"\n            \" or response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    name: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name used to access the parameter value\",\n        description=(\n            \"The name of the parameter used to allow access to the value of the \"\n            \"parameter in evaluation contexts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    profile: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"What profile the value is expected to be\",\n        description=(\n            \"If specified, this indicates a profile that the input data must \"\n            \"conform to, or that the output data will conform to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"What type of value\",\n        description=\"The type of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    use: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"in | out\",\n        description=\"Whether the parameter is input or output for the module.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"in\", \"out\"],\n        },\n    )\n    use__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_use\", title=\"Extension field for ``use``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ParameterDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"name\",\n            \"use\",\n            \"min\",\n            \"max\",\n            \"documentation\",\n            \"type\",\n            \"profile\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ParameterDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"name\", \"use\", \"min\", \"max\", \"documentation\", \"type\", \"profile\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\"), (\"use\", \"use__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/parameters.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Parameters\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, fhirtypes, resource\n\n\nclass Parameters(resource.Resource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Operation Request or Response.\n    This resource is used to pass information into and back from an operation\n    (whether invoked directly from REST or within a messaging environment).  It\n    is not persisted or allowed to be referenced by other resources.\n    \"\"\"\n\n    __resource_type__ = \"Parameters\"\n\n    parameter: typing.List[fhirtypes.ParametersParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Operation Parameter\",\n        description=\"A parameter passed to or received from the operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Parameters`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"language\", \"parameter\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Parameters`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"parameter\"]\n\n\nclass ParametersParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Operation Parameter.\n    A parameter passed to or received from the operation.\n    \"\"\"\n\n    __resource_type__ = \"ParametersParameter\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name from the definition\",\n        description=\"The name of the parameter (reference to the operation definition).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    part: typing.List[fhirtypes.ParametersParameterType] | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"Named part of a multi-part parameter\",\n        description=\"A named part of a multi-part parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.ResourceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"If parameter is a whole resource\",\n        description=\"Conveys the content if the parameter is a whole resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueAvailability: fhirtypes.AvailabilityType | None = Field(\n        default=None,\n        alias=\"valueAvailability\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueCanonical\",\n        title=\"Extension field for ``valueCanonical``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"valueCodeableReference\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"valueContactDetail\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"valueDataRequirement\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"valueDosage\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"valueExpression\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field(\n        default=None,\n        alias=\"valueExtendedContactDetail\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueInteger64: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"valueInteger64\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger64\",\n        title=\"Extension field for ``valueInteger64``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"valueParameterDefinition\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"valueRatioRange\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"valueRelatedArtifact\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"valueTriggerDefinition\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUrl\", title=\"Extension field for ``valueUrl``.\"\n    )\n\n    valueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"valueUsageContext\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"valueUuid\",\n        title=\"If parameter is a data type\",\n        description=\"Conveys the content if the parameter is a data type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUuid\", title=\"Extension field for ``valueUuid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ParametersParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueInteger64\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCodeableReference\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueRatioRange\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueAvailability\",\n            \"valueExtendedContactDetail\",\n            \"valueDosage\",\n            \"valueMeta\",\n            \"resource\",\n            \"part\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ParametersParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"name\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueInteger64\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCodeableReference\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueRatioRange\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueAvailability\",\n            \"valueExtendedContactDetail\",\n            \"valueDosage\",\n            \"valueMeta\",\n            \"resource\",\n            \"part\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueAvailability\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCanonical\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCodeableReference\",\n                \"valueCoding\",\n                \"valueContactDetail\",\n                \"valueContactPoint\",\n                \"valueCount\",\n                \"valueDataRequirement\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDosage\",\n                \"valueDuration\",\n                \"valueExpression\",\n                \"valueExtendedContactDetail\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueInteger64\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valueParameterDefinition\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueRatioRange\",\n                \"valueReference\",\n                \"valueRelatedArtifact\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueTriggerDefinition\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n                \"valueUrl\",\n                \"valueUsageContext\",\n                \"valueUuid\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/patient.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Patient\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Patient(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about an individual or animal receiving health care services.\n    Demographics and other administrative information about an individual or\n    animal receiving care or other health-related services.\n    \"\"\"\n\n    __resource_type__ = \"Patient\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this patient's record is in active use\",\n        description=(\n            \"Whether this patient record is in active use.  Many systems use this \"\n            \"property to mark as non-current patients, such as those that have not \"\n            \"been seen for a period of time based on an organization's business \"\n            \"rules.  It is often used to filter patient lists to exclude inactive \"\n            \"patients  Deceased patients may also be marked as inactive for the \"\n            \"same reasons, but may be active for some time after death.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"An address for the individual\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    birthDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"birthDate\",\n        title=\"The date of birth for the individual\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_birthDate\", title=\"Extension field for ``birthDate``.\"\n    )\n\n    communication: typing.List[fhirtypes.PatientCommunicationType] | None = Field(\n        default=None,\n        alias=\"communication\",\n        title=(\n            \"A language which may be used to communicate with the patient about his\"\n            \" or her health\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.PatientContactType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"A contact party (e.g. guardian, partner, friend) for the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    deceasedBoolean: bool | None = Field(\n        default=None,\n        alias=\"deceasedBoolean\",\n        title=\"Indicates if the individual is deceased or not\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedBoolean\",\n        title=\"Extension field for ``deceasedBoolean``.\",\n    )\n\n    deceasedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"deceasedDateTime\",\n        title=\"Indicates if the individual is deceased or not\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedDateTime\",\n        title=\"Extension field for ``deceasedDateTime``.\",\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the patient is considered to \"\n            \"have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    generalPractitioner: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"generalPractitioner\",\n        title=\"Patient's nominated primary care provider\",\n        description=\"Patient's nominated care provider.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier for this patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.PatientLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=(\n            \"Link to a Patient or RelatedPerson resource that concerns the same \"\n            \"actual individual\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"Organization that is the custodian of the patient record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    maritalStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"maritalStatus\",\n        title=\"Marital (civil) status of a patient\",\n        description=\"This field contains a patient's most recent marital (civil) status.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    multipleBirthBoolean: bool | None = Field(\n        default=None,\n        alias=\"multipleBirthBoolean\",\n        title=\"Whether patient is part of a multiple birth\",\n        description=(\n            \"Indicates whether the patient is part of a multiple (boolean) or \"\n            \"indicates the actual birth order (integer).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e multipleBirth[x]\n            \"one_of_many\": \"multipleBirth\",\n            \"one_of_many_required\": False,\n        },\n    )\n    multipleBirthBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_multipleBirthBoolean\",\n        title=\"Extension field for ``multipleBirthBoolean``.\",\n    )\n\n    multipleBirthInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"multipleBirthInteger\",\n        title=\"Whether patient is part of a multiple birth\",\n        description=(\n            \"Indicates whether the patient is part of a multiple (boolean) or \"\n            \"indicates the actual birth order (integer).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e multipleBirth[x]\n            \"one_of_many\": \"multipleBirth\",\n            \"one_of_many_required\": False,\n        },\n    )\n    multipleBirthInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_multipleBirthInteger\",\n        title=\"Extension field for ``multipleBirthInteger``.\",\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the patient\",\n        description=\"A name associated with the individual.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    photo: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Image of the patient\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the individual\",\n        description=(\n            \"A contact detail (e.g. a telephone number or an email address) by \"\n            \"which the individual may be contacted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Patient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"deceasedBoolean\",\n            \"deceasedDateTime\",\n            \"address\",\n            \"maritalStatus\",\n            \"multipleBirthBoolean\",\n            \"multipleBirthInteger\",\n            \"photo\",\n            \"contact\",\n            \"communication\",\n            \"generalPractitioner\",\n            \"managingOrganization\",\n            \"link\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Patient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"deceasedBoolean\",\n            \"deceasedDateTime\",\n            \"address\",\n            \"managingOrganization\",\n            \"link\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"deceased\": [\"deceasedBoolean\", \"deceasedDateTime\"],\n            \"multipleBirth\": [\"multipleBirthBoolean\", \"multipleBirthInteger\"],\n        }\n        return one_of_many_fields\n\n\nclass PatientCommunication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A language which may be used to communicate with the patient about his or\n    her health.\n    \"\"\"\n\n    __resource_type__ = \"PatientCommunication\"\n\n    language: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"language\",\n        title=(\n            \"The language which can be used to communicate with the patient about \"\n            \"his or her health\"\n        ),\n        description=(\n            \"The ISO-639-1 alpha 2 code in lower case for the language, optionally \"\n            \"followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in\"\n            ' upper case; e.g. \"en\" for English, or \"en-US\" for American English '\n            'versus \"en-AU\" for Australian English.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preferred: bool | None = Field(\n        default=None,\n        alias=\"preferred\",\n        title=\"Language preference indicator\",\n        description=(\n            \"Indicates whether or not the patient prefers this language (over other\"\n            \" languages he masters up a certain level).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preferred\", title=\"Extension field for ``preferred``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PatientCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"preferred\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PatientCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PatientContact(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A contact party (e.g. guardian, partner, friend) for the patient.\n    \"\"\"\n\n    __resource_type__ = \"PatientContact\"\n\n    address: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Address for the contact person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the contact person is \"\n            \"considered to have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    name: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the contact person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Organization that is associated with the contact\",\n        description=(\n            \"Organization on behalf of which the contact is acting or for which the\"\n            \" contact is working.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=(\n            \"The period during which this contact person or organization is valid \"\n            \"to be contacted relating to this patient\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"The kind of relationship\",\n        description=(\n            \"The nature of the relationship between the patient and the contact \"\n            \"person.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the person\",\n        description=(\n            \"A contact detail for the person, e.g. a telephone number or an email \"\n            \"address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PatientContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"relationship\",\n            \"name\",\n            \"telecom\",\n            \"address\",\n            \"gender\",\n            \"organization\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PatientContact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PatientLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Link to a Patient or RelatedPerson resource that concerns the same actual\n    individual.\n    \"\"\"\n\n    __resource_type__ = \"PatientLink\"\n\n    other: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"other\",\n        title=\"The other patient or related person resource that the link refers to\",\n        description=(\n            \"Link to a Patient or RelatedPerson resource that concerns the same \"\n            \"actual individual.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"replaced-by | replaces | refer | seealso\",\n        description=(\n            \"The type of link between this patient resource and another patient \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"replaced-by\", \"replaces\", \"refer\", \"seealso\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PatientLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"other\", \"type\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PatientLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"other\", \"type\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/paymentnotice.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PaymentNotice\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass PaymentNotice(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    PaymentNotice request.\n    This resource provides the status of the payment for goods and services\n    rendered, and the request and response resource references.\n    \"\"\"\n\n    __resource_type__ = \"PaymentNotice\"\n\n    amount: fhirtypes.MoneyType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Monetary amount of the payment\",\n        description=\"The amount sent to the payee.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for the payment notice\",\n        description=\"A unique identifier assigned to this payment notice.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payee: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"payee\",\n        title=\"Party being paid\",\n        description=(\n            \"The party who will receive or has received payment that is the subject\"\n            \" of this notification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    payment: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"payment\",\n        title=\"Payment reference\",\n        description=\"A reference to the payment which is the subject of this notice.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PaymentReconciliation\"],\n        },\n    )\n\n    paymentDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"paymentDate\",\n        title=\"Payment or clearing date\",\n        description=\"The date when the above payment action occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    paymentDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_paymentDate\", title=\"Extension field for ``paymentDate``.\"\n    )\n\n    paymentStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"paymentStatus\",\n        title=\"Issued or cleared Status of the payment\",\n        description=\"A code indicating whether payment has been sent or cleared.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recipient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"recipient\",\n        title=\"Party being notified\",\n        description=\"The party who is notified of the payment status.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    reporter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reporter\",\n        title=\"Responsible practitioner\",\n        description=\"The party who reports the payment notice.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Request reference\",\n        description=\"Reference of resource for which payment is being made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    response: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"Response reference\",\n        description=\"Reference of response to resource for which payment is being made.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PaymentNotice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"request\",\n            \"response\",\n            \"created\",\n            \"reporter\",\n            \"payment\",\n            \"paymentDate\",\n            \"payee\",\n            \"recipient\",\n            \"amount\",\n            \"paymentStatus\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PaymentNotice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"created\",\n            \"payment\",\n            \"recipient\",\n            \"amount\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"created\", \"created__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/paymentreconciliation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PaymentReconciliation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass PaymentReconciliation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    PaymentReconciliation resource.\n    This resource provides the details including amount of a payment and\n    allocates the payment items being paid.\n    \"\"\"\n\n    __resource_type__ = \"PaymentReconciliation\"\n\n    accountNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"accountNumber\",\n        title=\"Digits for verification\",\n        description=(\n            \"A portion of the account number, often the last 4 digits, used for \"\n            \"verification not charging purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    accountNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_accountNumber\",\n        title=\"Extension field for ``accountNumber``.\",\n    )\n\n    allocation: typing.List[\n        fhirtypes.PaymentReconciliationAllocationType\n    ] | None = Field(\n        default=None,\n        alias=\"allocation\",\n        title=\"Settlement particulars\",\n        description=(\n            \"Distribution of the payment amount for a previously acknowledged \"\n            \"payable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    amount: fhirtypes.MoneyType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Total amount of Payment\",\n        description=\"Total payment amount as indicated on the financial instrument.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    authorization: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"authorization\",\n        title=\"Authorization number\",\n        description=(\n            \"An alphanumeric issued by the processor to confirm the successful \"\n            \"issuance of payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authorization__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_authorization\",\n        title=\"Extension field for ``authorization``.\",\n    )\n\n    cardBrand: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"cardBrand\",\n        title=\"Type of card\",\n        description=(\n            \"The card brand such as debit, Visa, Amex etc. used if a card is the \"\n            \"method of payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    cardBrand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_cardBrand\", title=\"Extension field for ``cardBrand``.\"\n    )\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Creation date\",\n        description=\"The date when the resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"When payment issued\",\n        description=\"The date of payment as indicated on the financial instrument.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    disposition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"disposition\",\n        title=\"Disposition message\",\n        description=(\n            \"A human readable description of the status of the request for the \"\n            \"reconciliation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    disposition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_disposition\", title=\"Extension field for ``disposition``.\"\n    )\n\n    enterer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"enterer\",\n        title=\"Who entered the payment\",\n        description=\"Payment enterer if not the actual payment issuer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    expirationDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"expirationDate\",\n        title=\"Expiration year-month\",\n        description=(\n            \"The year and month (YYYY-MM) when the instrument, typically card, \"\n            \"expires.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expirationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_expirationDate\",\n        title=\"Extension field for ``expirationDate``.\",\n    )\n\n    formCode: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"formCode\",\n        title=\"Printed form identifier\",\n        description=\"A code for the form to be used for printing the content.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for a payment reconciliation\",\n        description=\"A unique identifier assigned to this payment reconciliation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    issuerType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"issuerType\",\n        title=\"Nature of the source\",\n        description=\"The type of the source such as patient or insurance.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"Workflow originating payment\",\n        description=(\n            \"The workflow or activity which gave rise to or during which the \"\n            \"payment ocurred such as a kiosk, deposit on account, periodic payment \"\n            \"etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where payment collected\",\n        description=(\n            \"The location of the site or device for electronic transfers or \"\n            \"physical location for cash payments.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Payment instrument\",\n        description=(\n            \"The means of payment such as check, card cash, or electronic funds \"\n            \"transfer.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcome: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"queued | complete | error | partial\",\n        description=\"The outcome of a request for a reconciliation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"queued\", \"complete\", \"error\", \"partial\"],\n        },\n    )\n    outcome__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_outcome\", title=\"Extension field for ``outcome``.\"\n    )\n\n    paymentIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"paymentIdentifier\",\n        title=\"Business identifier for the payment\",\n        description=\"Issuer's unique identifier for the payment instrument.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    paymentIssuer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"paymentIssuer\",\n        title=\"Party generating payment\",\n        description=\"The party who generated the payment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"Patient\", \"RelatedPerson\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period covered\",\n        description=(\n            \"The period of time for which payments have been gathered into this \"\n            \"bulk payment for settlement.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    processNote: typing.List[\n        fhirtypes.PaymentReconciliationProcessNoteType\n    ] | None = Field(\n        default=None,\n        alias=\"processNote\",\n        title=\"Note concerning processing\",\n        description=(\n            \"A note that describes or explains the processing in a human readable \"\n            \"form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    processor: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"processor\",\n        title=\"Processor name\",\n        description=\"The name of the card processor, etf processor, bank for checks.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    processor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_processor\", title=\"Extension field for ``processor``.\"\n    )\n\n    referenceNumber: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"referenceNumber\",\n        title=\"Check number or payment reference\",\n        description=\"The check number, eft reference, car processor reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    referenceNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_referenceNumber\",\n        title=\"Extension field for ``referenceNumber``.\",\n    )\n\n    request: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Reference to requesting resource\",\n        description=\"Original request resource reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Task\"],\n        },\n    )\n\n    requestor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requestor\",\n        title=\"Responsible practitioner\",\n        description=(\n            \"The practitioner who is responsible for the services rendered to the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    returnedAmount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"returnedAmount\",\n        title=\"Amount returned by the receiver\",\n        description=(\n            \"The amount returned by the receiver which is excess to the amount \"\n            \"payable, often referred to as 'change'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    tenderedAmount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"tenderedAmount\",\n        title=\"Amount offered by the issuer\",\n        description=(\n            \"The amount offered by the issuer, typically applies to cash when the \"\n            \"issuer provides an amount in bank note denominations equal to or \"\n            \"excess of the amount actually being paid.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Category of payment\",\n        description=(\n            \"Code to indicate the nature of the payment such as payment, \" \"adjustment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PaymentReconciliation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"status\",\n            \"kind\",\n            \"period\",\n            \"created\",\n            \"enterer\",\n            \"issuerType\",\n            \"paymentIssuer\",\n            \"request\",\n            \"requestor\",\n            \"outcome\",\n            \"disposition\",\n            \"date\",\n            \"location\",\n            \"method\",\n            \"cardBrand\",\n            \"accountNumber\",\n            \"expirationDate\",\n            \"processor\",\n            \"referenceNumber\",\n            \"authorization\",\n            \"tenderedAmount\",\n            \"returnedAmount\",\n            \"amount\",\n            \"paymentIdentifier\",\n            \"allocation\",\n            \"formCode\",\n            \"processNote\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PaymentReconciliation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"type\",\n            \"status\",\n            \"period\",\n            \"created\",\n            \"paymentIssuer\",\n            \"date\",\n            \"amount\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"date\", \"date__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass PaymentReconciliationAllocation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Settlement particulars.\n    Distribution of the payment amount for a previously acknowledged payable.\n    \"\"\"\n\n    __resource_type__ = \"PaymentReconciliationAllocation\"\n\n    account: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"account\",\n        title=\"Applied-to account\",\n        description=(\n            \"The Account to which this payment applies, may be completed by the \"\n            \"receiver, used for search.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Account\"],\n        },\n    )\n\n    amount: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Amount allocated to this payable\",\n        description=\"The monetary amount allocated from the total payment to the payable.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date of commitment to pay\",\n        description=\"The date from the response resource containing a commitment to pay.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Applied-to encounter\",\n        description=(\n            \"The Encounter to which this payment applies, may be completed by the \"\n            \"receiver, used for search.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier of the payment detail\",\n        description=(\n            \"Unique identifier for the current payment item for the referenced \"\n            \"payable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    payee: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"payee\",\n        title=\"Recipient of the payment\",\n        description=\"The party which is receiving the payment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    predecessor: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"predecessor\",\n        title=\"Business identifier of the prior payment detail\",\n        description=(\n            \"Unique identifier for the prior payment item for the referenced \"\n            \"payable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    response: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=\"Response committing to a payment\",\n        description=(\n            \"A resource, such as a ClaimResponse, which contains a commitment to \"\n            \"payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClaimResponse\"],\n        },\n    )\n\n    responsible: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"responsible\",\n        title=\"Contact for the response\",\n        description=(\n            \"A reference to the individual who is responsible for inquiries \"\n            \"regarding the response and its payment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PractitionerRole\"],\n        },\n    )\n\n    submitter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"submitter\",\n        title=\"Submitter of the request\",\n        description=\"The party which submitted the claim or financial transaction.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    target: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Subject of the payment\",\n        description=\"Specific resource to which the payment/adjustment/advance applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Claim\",\n                \"Account\",\n                \"Invoice\",\n                \"ChargeItem\",\n                \"Encounter\",\n                \"Contract\",\n            ],\n        },\n    )\n\n    targetItemIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"targetItemIdentifier\",\n        title=\"Sub-element of the subject\",\n        description=(\n            \" Identifies the claim line item, encounter or other sub-element being \"\n            \"paid. Note payment may be partial, that is not match the then \"\n            \"outstanding balance or amount incurred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e targetItem[x]\n            \"one_of_many\": \"targetItem\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    targetItemPositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"targetItemPositiveInt\",\n        title=\"Sub-element of the subject\",\n        description=(\n            \" Identifies the claim line item, encounter or other sub-element being \"\n            \"paid. Note payment may be partial, that is not match the then \"\n            \"outstanding balance or amount incurred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e targetItem[x]\n            \"one_of_many\": \"targetItem\",\n            \"one_of_many_required\": False,\n        },\n    )\n    targetItemPositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_targetItemPositiveInt\",\n        title=\"Extension field for ``targetItemPositiveInt``.\",\n    )\n\n    targetItemString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"targetItemString\",\n        title=\"Sub-element of the subject\",\n        description=(\n            \" Identifies the claim line item, encounter or other sub-element being \"\n            \"paid. Note payment may be partial, that is not match the then \"\n            \"outstanding balance or amount incurred.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e targetItem[x]\n            \"one_of_many\": \"targetItem\",\n            \"one_of_many_required\": False,\n        },\n    )\n    targetItemString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_targetItemString\",\n        title=\"Extension field for ``targetItemString``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Category of payment\",\n        description=\"Code to indicate the nature of the payment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PaymentReconciliationAllocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"predecessor\",\n            \"target\",\n            \"targetItemString\",\n            \"targetItemIdentifier\",\n            \"targetItemPositiveInt\",\n            \"encounter\",\n            \"account\",\n            \"type\",\n            \"submitter\",\n            \"response\",\n            \"date\",\n            \"responsible\",\n            \"payee\",\n            \"amount\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PaymentReconciliationAllocation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"targetItem\": [\n                \"targetItemIdentifier\",\n                \"targetItemPositiveInt\",\n                \"targetItemString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass PaymentReconciliationProcessNote(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Note concerning processing.\n    A note that describes or explains the processing in a human readable form.\n    \"\"\"\n\n    __resource_type__ = \"PaymentReconciliationProcessNote\"\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Note explanatory text\",\n        description=\"The explanation or description associated with the processing.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"display | print | printoper\",\n        description=\"The business purpose of the note text.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"display\", \"print\", \"printoper\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PaymentReconciliationProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"text\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PaymentReconciliationProcessNote`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/period.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Period\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Period(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Time range defined by start and end date/time.\n    A time period defined by a start and end date and optionally time.\n    \"\"\"\n\n    __resource_type__ = \"Period\"\n\n    end: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"End time with inclusive boundary, if not ongoing\",\n        description=(\n            \"The end of the period. If the end of the period is missing, it means \"\n            \"no end was known or planned at the time the instance was created. The \"\n            \"start may be in the past, and the end date in the future, which means \"\n            \"that period is expected/planned to end at that time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    start: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Starting time with inclusive boundary\",\n        description=\"The start of the period. The boundary is inclusive.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Period`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"start\", \"end\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Period`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"start\", \"end\"]\n"
  },
  {
    "path": "fhir/resources/permission.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Permission\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Permission(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Access Rules.\n    Permission resource holds access rules for a given data and context.\n    \"\"\"\n\n    __resource_type__ = \"Permission\"\n\n    asserter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"asserter\",\n        title=\"The person or entity that asserts the permission\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    combining: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"combining\",\n        title=(\n            \"deny-overrides | permit-overrides | ordered-deny-overrides | ordered-\"\n            \"permit-overrides | deny-unless-permit | permit-unless-deny\"\n        ),\n        description=(\n            \"Defines a procedure for arriving at an access decision given the set \"\n            \"of rules.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"deny-overrides\",\n                \"permit-overrides\",\n                \"ordered-deny-overrides\",\n                \"ordered-permit-overrides\",\n                \"deny-unless-permit\",\n                \"permit-unless-deny\",\n            ],\n        },\n    )\n    combining__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_combining\", title=\"Extension field for ``combining``.\"\n    )\n\n    date: typing.List[fhirtypes.DateTimeType | None] | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"The date that permission was asserted\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    justification: fhirtypes.PermissionJustificationType | None = Field(\n        default=None,\n        alias=\"justification\",\n        title=\"The asserted justification for using the data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    rule: typing.List[fhirtypes.PermissionRuleType] | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"Constraints to the Permission\",\n        description=\"A set of rules.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | entered-in-error | draft | rejected\",\n        description=\"Status.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"entered-in-error\", \"draft\", \"rejected\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    validity: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"validity\",\n        title=\"The period in which the permission is active\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Permission`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"status\",\n            \"asserter\",\n            \"date\",\n            \"validity\",\n            \"justification\",\n            \"combining\",\n            \"rule\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Permission`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"asserter\",\n            \"date\",\n            \"validity\",\n            \"justification\",\n            \"combining\",\n            \"rule\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"combining\", \"combining__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass PermissionJustification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The asserted justification for using the data.\n    \"\"\"\n\n    __resource_type__ = \"PermissionJustification\"\n\n    basis: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"basis\",\n        title=\"The regulatory grounds upon which this Permission builds\",\n        description=(\n            \"This would be a codeableconcept, or a coding, which can be constrained\"\n            \" to , for example, the 6 grounds for processing in GDPR.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    evidence: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"evidence\",\n        title=\"Justifing rational\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PermissionJustification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"basis\", \"evidence\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PermissionJustification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"basis\", \"evidence\"]\n\n\nclass PermissionRule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Constraints to the Permission.\n    A set of rules.\n    \"\"\"\n\n    __resource_type__ = \"PermissionRule\"\n\n    activity: typing.List[fhirtypes.PermissionRuleActivityType] | None = Field(\n        default=None,\n        alias=\"activity\",\n        title=(\n            \"A description or definition of which activities are allowed to be done\"\n            \" on the data\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    data: typing.List[fhirtypes.PermissionRuleDataType] | None = Field(\n        default=None,\n        alias=\"data\",\n        title=(\n            \"The selection criteria to identify data that is within scope of this \"\n            \"provision\"\n        ),\n        description=(\n            \"A description or definition of which activities are allowed to be done\"\n            \" on the data.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    limit: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"limit\",\n        title=\"What limits apply to the use of the data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"deny | permit\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"deny\", \"permit\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PermissionRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"data\",\n            \"activity\",\n            \"limit\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PermissionRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"data\", \"activity\", \"limit\"]\n\n\nclass PermissionRuleActivity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A description or definition of which activities are allowed to be done on\n    the data.\n    \"\"\"\n\n    __resource_type__ = \"PermissionRuleActivity\"\n\n    action: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Actions controlled by this rule\",\n        description=\"Actions controlled by this Rule.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    actor: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Authorized actor(s)\",\n        description=\"The actor(s) authorized for the defined activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Group\",\n                \"CareTeam\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    purpose: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"The purpose for which the permission is given\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PermissionRuleActivity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"actor\", \"action\", \"purpose\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PermissionRuleActivity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"actor\", \"action\", \"purpose\"]\n\n\nclass PermissionRuleData(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The selection criteria to identify data that is within scope of this\n    provision.\n    A description or definition of which activities are allowed to be done on\n    the data.\n    \"\"\"\n\n    __resource_type__ = \"PermissionRuleData\"\n\n    expression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Expression identifying the data\",\n        description=\"Used when other data selection elements are insufficient.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: typing.List[fhirtypes.PeriodType] | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Timeframe encompasing data create/update\",\n        description=(\n            \"Clinical or Operational Relevant period of time that bounds the data \"\n            \"controlled by this rule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: typing.List[fhirtypes.PermissionRuleDataResourceType] | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Explicit FHIR Resource references\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    security: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"security\",\n        title=\"Security tag code on .meta.security\",\n        description=(\n            \"The data in scope are those with the given codes present in that data \"\n            \".meta.security element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PermissionRuleData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"resource\",\n            \"security\",\n            \"period\",\n            \"expression\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PermissionRuleData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"resource\", \"security\", \"period\", \"expression\"]\n\n\nclass PermissionRuleDataResource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Explicit FHIR Resource references.\n    \"\"\"\n\n    __resource_type__ = \"PermissionRuleDataResource\"\n\n    meaning: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"meaning\",\n        title=\"instance | related | dependents | authoredby\",\n        description=(\n            \"How the resource reference is interpreted when testing consent \"\n            \"restrictions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"related\", \"dependents\", \"authoredby\"],\n        },\n    )\n    meaning__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_meaning\", title=\"Extension field for ``meaning``.\"\n    )\n\n    reference: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"reference\",\n        title=\"The actual data reference\",\n        description=(\n            \"A reference to a specific resource that defines which resources are \"\n            \"covered by this consent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PermissionRuleDataResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"meaning\", \"reference\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PermissionRuleDataResource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"meaning\", \"reference\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"meaning\", \"meaning__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/person.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Person\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Person(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A generic person record.\n    Demographics and administrative information about a person independent of a\n    specific health-related context.\n    \"\"\"\n\n    __resource_type__ = \"Person\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"This person's record is in active use\",\n        description=\"Whether this person's record is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"One or more addresses for the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    birthDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"birthDate\",\n        title=\"The date on which the person was born\",\n        description=\"The birth date for the person.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_birthDate\", title=\"Extension field for ``birthDate``.\"\n    )\n\n    communication: typing.List[fhirtypes.PersonCommunicationType] | None = Field(\n        default=None,\n        alias=\"communication\",\n        title=(\n            \"A language which may be used to communicate with the person about his \"\n            \"or her health\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    deceasedBoolean: bool | None = Field(\n        default=None,\n        alias=\"deceasedBoolean\",\n        title=\"Indicates if the individual is deceased or not\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedBoolean\",\n        title=\"Extension field for ``deceasedBoolean``.\",\n    )\n\n    deceasedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"deceasedDateTime\",\n        title=\"Indicates if the individual is deceased or not\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedDateTime\",\n        title=\"Extension field for ``deceasedDateTime``.\",\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=\"Administrative Gender.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"A human identifier for this person\",\n        description=\"Identifier for a person within a particular scope.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.PersonLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Link to a resource that concerns the same actual person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    managingOrganization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingOrganization\",\n        title=\"The organization that is the custodian of the person record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    maritalStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"maritalStatus\",\n        title=\"Marital (civil) status of a person\",\n        description=\"This field contains a person's most recent marital (civil) status.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    photo: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Image of the person\",\n        description=(\n            \"An image that can be displayed as a thumbnail of the person to enhance\"\n            \" the identification of the individual.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the person\",\n        description=(\n            \"A contact detail for the person, e.g. a telephone number or an email \"\n            \"address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Person`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"deceasedBoolean\",\n            \"deceasedDateTime\",\n            \"address\",\n            \"maritalStatus\",\n            \"photo\",\n            \"communication\",\n            \"managingOrganization\",\n            \"link\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Person`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"deceasedBoolean\",\n            \"deceasedDateTime\",\n            \"address\",\n            \"managingOrganization\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"deceased\": [\"deceasedBoolean\", \"deceasedDateTime\"]}\n        return one_of_many_fields\n\n\nclass PersonCommunication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A language which may be used to communicate with the person about his or\n    her health.\n    \"\"\"\n\n    __resource_type__ = \"PersonCommunication\"\n\n    language: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"language\",\n        title=(\n            \"The language which can be used to communicate with the person about \"\n            \"his or her health\"\n        ),\n        description=(\n            \"The ISO-639-1 alpha 2 code in lower case for the language, optionally \"\n            \"followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in\"\n            ' upper case; e.g. \"en\" for English, or \"en-US\" for American English '\n            'versus \"en-AU\" for Australian English.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preferred: bool | None = Field(\n        default=None,\n        alias=\"preferred\",\n        title=\"Language preference indicator\",\n        description=(\n            \"Indicates whether or not the person prefers this language (over other \"\n            \"languages he masters up a certain level).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preferred\", title=\"Extension field for ``preferred``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PersonCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"preferred\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PersonCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PersonLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Link to a resource that concerns the same actual person.\n    \"\"\"\n\n    __resource_type__ = \"PersonLink\"\n\n    assurance: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"assurance\",\n        title=\"level1 | level2 | level3 | level4\",\n        description=(\n            \"Level of assurance that this link is associated with the target \"\n            \"resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"level1\", \"level2\", \"level3\", \"level4\"],\n        },\n    )\n    assurance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_assurance\", title=\"Extension field for ``assurance``.\"\n    )\n\n    target: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"target\",\n        title=\"The resource to which this actual person is associated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"RelatedPerson\",\n                \"Person\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PersonLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"target\", \"assurance\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PersonLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/plandefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PlanDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass PlanDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The definition of a plan for a series of actions, independent of any\n    specific patient or context.\n    This resource allows for the definition of various types of plans as a\n    sharable, consumable, and executable artifact. The resource is general\n    enough to support the description of a broad range of clinical and non-\n    clinical artifacts such as clinical decision support rules, order sets,\n    protocols, and drug quality specifications.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinition\"\n\n    action: typing.List[fhirtypes.PlanDefinitionActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Action defined by the plan\",\n        description=(\n            \"An action or group of actions to be taken as part of the plan. For \"\n            \"example, in clinical care, an action would be to prescribe a \"\n            \"particular indicated medication, or perform a particular test as \"\n            \"appropriate. In pharmaceutical quality, an action would be the test \"\n            \"that needs to be performed on a drug product as defined in the quality\"\n            \" specification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    actor: typing.List[fhirtypes.PlanDefinitionActorType] | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Actors within the plan\",\n        description=(\n            \"Actors represent the individuals or groups involved in the execution \"\n            \"of the defined set of activities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the plan definition was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    asNeededBoolean: bool | None = Field(\n        default=None,\n        alias=\"asNeededBoolean\",\n        title=\"Preconditions for service\",\n        description=(\n            \"If a CodeableConcept is present, it indicates the pre-condition for \"\n            'performing the service.  For example \"pain\", \"on flare-up\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n    asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_asNeededBoolean\",\n        title=\"Extension field for ``asNeededBoolean``.\",\n    )\n\n    asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"asNeededCodeableConcept\",\n        title=\"Preconditions for service\",\n        description=(\n            \"If a CodeableConcept is present, it indicates the pre-condition for \"\n            'performing the service.  For example \"pain\", \"on flare-up\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the content\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the plan definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the plan definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the plan definition was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the plan definition \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the plan definition\",\n        description=(\n            \"A free text natural language description of the plan definition from a\"\n            \" consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the content\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the plan definition is expected to be used\",\n        description=(\n            \"The period during which the plan definition content was or is planned \"\n            \"to be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the content\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"responsible for officially endorsing the content for use in some \"\n            \"setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this plan definition is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    goal: typing.List[fhirtypes.PlanDefinitionGoalType] | None = Field(\n        default=None,\n        alias=\"goal\",\n        title=\"What the plan is trying to accomplish\",\n        description=(\n            \"A goal describes an expected outcome that activities within the plan \"\n            \"are intended to achieve. For example, weight loss, restoring an \"\n            \"activity of daily living, obtaining herd immunity via immunization, \"\n            \"meeting a process improvement objective, meeting the acceptance \"\n            \"criteria for a test as specified by a quality specification, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the plan definition\",\n        description=(\n            \"A formal identifier that is used to identify this plan definition when\"\n            \" it is represented in other formats, or referenced in a specification,\"\n            \" model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for plan definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the plan definition is intended \"\n            \"to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the plan definition was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    library: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"library\",\n        title=\"Logic used by the plan definition\",\n        description=(\n            \"A reference to a Library resource containing any formal logic used by \"\n            \"the plan definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Library\"],\n        },\n    )\n    library__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_library\", title=\"Extension field for ``library``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this plan definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the plan definition. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the plan definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this plan definition is defined\",\n        description=(\n            \"Explanation of why this plan definition is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, or \"\n            \"bibliographic references.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the content\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"primarily responsible for review of some aspect of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this plan definition. Enables tracking the life-cycle of\"\n            \" the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"subjectCanonical\",\n        title=\"Type of individual the plan definition is focused on\",\n        description=(\n            \"A code, group definition, or canonical reference that describes  or \"\n            \"identifies the intended subject of the plan definition. Canonical \"\n            \"references are allowed to support the definition of protocols for drug\"\n            \" and substance quality specifications, and is allowed to reference a \"\n            \"MedicinalProductDefinition, SubstanceDefinition, \"\n            \"AdministrableProductDefinition, ManufacturedItemDefinition, or \"\n            \"PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EvidenceVariable\"],\n        },\n    )\n    subjectCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subjectCanonical\",\n        title=\"Extension field for ``subjectCanonical``.\",\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=\"Type of individual the plan definition is focused on\",\n        description=(\n            \"A code, group definition, or canonical reference that describes  or \"\n            \"identifies the intended subject of the plan definition. Canonical \"\n            \"references are allowed to support the definition of protocols for drug\"\n            \" and substance quality specifications, and is allowed to reference a \"\n            \"MedicinalProductDefinition, SubstanceDefinition, \"\n            \"AdministrableProductDefinition, ManufacturedItemDefinition, or \"\n            \"PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=\"Type of individual the plan definition is focused on\",\n        description=(\n            \"A code, group definition, or canonical reference that describes  or \"\n            \"identifies the intended subject of the plan definition. Canonical \"\n            \"references are allowed to support the definition of protocols for drug\"\n            \" and substance quality specifications, and is allowed to reference a \"\n            \"MedicinalProductDefinition, SubstanceDefinition, \"\n            \"AdministrableProductDefinition, ManufacturedItemDefinition, or \"\n            \"PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Group\",\n                \"MedicinalProductDefinition\",\n                \"SubstanceDefinition\",\n                \"AdministrableProductDefinition\",\n                \"ManufacturedItemDefinition\",\n                \"PackagedProductDefinition\",\n            ],\n        },\n    )\n\n    subtitle: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"subtitle\",\n        title=\"Subordinate title of the plan definition\",\n        description=(\n            \"An explanatory or alternate title for the plan definition giving \"\n            \"additional information about its content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subtitle__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subtitle\", title=\"Extension field for ``subtitle``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this plan definition (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the plan definition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment\",\n        description=(\n            \"Descriptive topics related to the content of the plan definition. \"\n            \"Topics provide a high-level categorization of the definition that can \"\n            \"be useful for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"order-set | clinical-protocol | eca-rule | workflow-definition\",\n        description=(\n            \"A high-level category for the plan definition that distinguishes the \"\n            \"kinds of systems that would be interested in the plan definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this plan definition, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this plan definition when it \"\n            \"is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" plan definition is (or will be) published. This URL can be the target\"\n            \" of a canonical reference. It SHALL remain the same when the plan \"\n            \"definition is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    usage: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"usage\",\n        title=\"Describes the clinical usage of the plan\",\n        description=(\n            \"A detailed description of how the plan definition is used from a \"\n            \"clinical perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    usage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_usage\", title=\"Extension field for ``usage``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate plan definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the plan definition\",\n        description=(\n            \"The identifier that is used to identify this version of the plan \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the plan definition \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence. To provide a version consistent with the \"\n            \"Decision Support Service specification, use the format \"\n            \"Major.Minor.Revision (e.g. 1.0.0). For more information on versioning \"\n            \"knowledge assets, refer to the Decision Support Service specification.\"\n            \" Note that a version is required for non-experimental active \"\n            \"artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"subtitle\",\n            \"type\",\n            \"status\",\n            \"experimental\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"subjectCanonical\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"usage\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"library\",\n            \"goal\",\n            \"actor\",\n            \"action\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"type\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"asNeeded\": [\"asNeededBoolean\", \"asNeededCodeableConcept\"],\n            \"subject\": [\n                \"subjectCanonical\",\n                \"subjectCodeableConcept\",\n                \"subjectReference\",\n            ],\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"],\n        }\n        return one_of_many_fields\n\n\nclass PlanDefinitionAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Action defined by the plan.\n    An action or group of actions to be taken as part of the plan. For example,\n    in clinical care, an action would be to prescribe a particular indicated\n    medication, or perform a particular test as appropriate. In pharmaceutical\n    quality, an action would be the test that needs to be performed on a drug\n    product as defined in the quality specification.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionAction\"\n\n    action: typing.List[fhirtypes.PlanDefinitionActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"A sub-action\",\n        description=(\n            \"Sub actions that are contained within the action. The behavior of this\"\n            \" action determines the functionality of the sub-actions. For example, \"\n            \"a selection behavior of at-most-one indicates that of the sub-actions,\"\n            \" at most one may be chosen as part of realizing the action definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    cardinalityBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"cardinalityBehavior\",\n        title=\"single | multiple\",\n        description=\"Defines whether the action can be selected multiple times.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"single\", \"multiple\"],\n        },\n    )\n    cardinalityBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_cardinalityBehavior\",\n        title=\"Extension field for ``cardinalityBehavior``.\",\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code representing the meaning of the action or sub-actions\",\n        description=(\n            \"A code that provides a meaning, grouping, or classification for the \"\n            \"action or action group. For example, a section may have a LOINC code \"\n            \"for the section of a documentation template. In pharmaceutical \"\n            \"quality, an action (Test) such as pH could be classified as a physical\"\n            \" property.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    condition: typing.List[fhirtypes.PlanDefinitionActionConditionType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Whether or not the action is applicable\",\n        description=(\n            \"An expression that describes applicability criteria or start/stop \"\n            \"conditions for the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definitionCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definitionCanonical\",\n        title=\"Description of the activity to be performed\",\n        description=(\n            \"A reference to an ActivityDefinition that describes the action to be \"\n            \"taken in detail, a MessageDefinition describing a message to be snet, \"\n            \"a PlanDefinition that describes a series of actions to be taken, a \"\n            \"Questionnaire that should be filled out, a SpecimenDefinition \"\n            \"describing a specimen to be collected, or an ObservationDefinition \"\n            \"that specifies what observation should be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"ActivityDefinition\",\n                \"MessageDefinition\",\n                \"ObservationDefinition\",\n                \"PlanDefinition\",\n                \"Questionnaire\",\n                \"SpecimenDefinition\",\n            ],\n        },\n    )\n    definitionCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_definitionCanonical\",\n        title=\"Extension field for ``definitionCanonical``.\",\n    )\n\n    definitionUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"definitionUri\",\n        title=\"Description of the activity to be performed\",\n        description=(\n            \"A reference to an ActivityDefinition that describes the action to be \"\n            \"taken in detail, a MessageDefinition describing a message to be snet, \"\n            \"a PlanDefinition that describes a series of actions to be taken, a \"\n            \"Questionnaire that should be filled out, a SpecimenDefinition \"\n            \"describing a specimen to be collected, or an ObservationDefinition \"\n            \"that specifies what observation should be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": False,\n        },\n    )\n    definitionUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_definitionUri\",\n        title=\"Extension field for ``definitionUri``.\",\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Brief description of the action\",\n        description=(\n            \"A brief description of the action used to provide a summary to display\"\n            \" to the user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Supporting documentation for the intended performer of the action\",\n        description=(\n            \"Didactic or other informational resources associated with the action \"\n            \"that can be provided to the CDS recipient. Information resources can \"\n            \"include inline text commentary and links to web resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dynamicValue: typing.List[\n        fhirtypes.PlanDefinitionActionDynamicValueType\n    ] | None = Field(\n        default=None,\n        alias=\"dynamicValue\",\n        title=\"Dynamic aspects of the definition\",\n        description=(\n            \"Customizations that should be applied to the statically defined \"\n            \"resource. For example, if the dosage of a medication must be computed \"\n            \"based on the patient's weight, a customization would be used to \"\n            \"specify an expression that calculated the weight, and the path on the \"\n            \"resource that would contain the result.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    goalId: typing.List[fhirtypes.IdType | None] | None = Field(\n        default=None,\n        alias=\"goalId\",\n        title=\"What goals this action supports\",\n        description=(\n            \"Identifies goals that this action supports. The reference must be to a\"\n            \" goal element defined within this plan definition. In pharmaceutical \"\n            \"quality, a goal represents acceptance criteria (Goal) for a given \"\n            \"action (Test), so the goalId would be the unique id of a defined goal \"\n            \"element establishing the acceptance criteria for the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    goalId__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_goalId\", title=\"Extension field for ``goalId``.\"\n    )\n\n    groupingBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"groupingBehavior\",\n        title=\"visual-group | logical-group | sentence-group\",\n        description=\"Defines the grouping behavior for the action and its children.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"visual-group\", \"logical-group\", \"sentence-group\"],\n        },\n    )\n    groupingBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_groupingBehavior\",\n        title=\"Extension field for ``groupingBehavior``.\",\n    )\n\n    input: typing.List[fhirtypes.PlanDefinitionActionInputType] | None = Field(\n        default=None,\n        alias=\"input\",\n        title=\"Input data requirements\",\n        description=\"Defines input data requirements for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Unique id for the action in the PlanDefinition\",\n        description=(\n            \"An identifier that is unique within the PlanDefinition to allow \"\n            \"linkage within the realized CarePlan and/or RequestOrchestration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    location: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where it should happen\",\n        description=(\n            \"Identifies the facility where the action will occur; e.g. home, \"\n            \"hospital, specific clinic, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    output: typing.List[fhirtypes.PlanDefinitionActionOutputType] | None = Field(\n        default=None,\n        alias=\"output\",\n        title=\"Output data definition\",\n        description=\"Defines the outputs of the action, if any.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    participant: typing.List[\n        fhirtypes.PlanDefinitionActionParticipantType\n    ] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Who should participate in the action\",\n        description=\"Indicates who should participate in performing the action described.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    precheckBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"precheckBehavior\",\n        title=\"yes | no\",\n        description=\"Defines whether the action should usually be preselected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"yes\", \"no\"],\n        },\n    )\n    precheckBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_precheckBehavior\",\n        title=\"Extension field for ``precheckBehavior``.\",\n    )\n\n    prefix: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"prefix\",\n        title=\"User-visible prefix for the action (e.g. 1. or A.)\",\n        description=(\n            \"A user-visible prefix for the action. For example a section or item \"\n            \"numbering such as 1. or A.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_prefix\", title=\"Extension field for ``prefix``.\"\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the action should be addressed with respect to \"\n            \"other actions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why the action should be performed\",\n        description=\"A description of why this action is necessary or appropriate.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relatedAction: typing.List[\n        fhirtypes.PlanDefinitionActionRelatedActionType\n    ] | None = Field(\n        default=None,\n        alias=\"relatedAction\",\n        title=\"Relationship to another action\",\n        description=(\n            'A relationship to another action such as \"before\" or \"30-60 minutes '\n            'after start of\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requiredBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"requiredBehavior\",\n        title=\"must | could | must-unless-documented\",\n        description=\"Defines the required behavior for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"must\", \"could\", \"must-unless-documented\"],\n        },\n    )\n    requiredBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requiredBehavior\",\n        title=\"Extension field for ``requiredBehavior``.\",\n    )\n\n    selectionBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"selectionBehavior\",\n        title=\"any | all | all-or-none | exactly-one | at-most-one | one-or-more\",\n        description=\"Defines the selection behavior for the action and its children.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"any\",\n                \"all\",\n                \"all-or-none\",\n                \"exactly-one\",\n                \"at-most-one\",\n                \"one-or-more\",\n            ],\n        },\n    )\n    selectionBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_selectionBehavior\",\n        title=\"Extension field for ``selectionBehavior``.\",\n    )\n\n    subjectCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"subjectCanonical\",\n        title=\"Type of individual the action is focused on\",\n        description=(\n            \"A code, group definition, or canonical reference that describes the \"\n            \"intended subject of the action and its children, if any. Canonical \"\n            \"references are allowed to support the definition of protocols for drug\"\n            \" and substance quality specifications, and is allowed to reference a \"\n            \"MedicinalProductDefinition, SubstanceDefinition, \"\n            \"AdministrableProductDefinition, ManufacturedItemDefinition, or \"\n            \"PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n    subjectCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subjectCanonical\",\n        title=\"Extension field for ``subjectCanonical``.\",\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=\"Type of individual the action is focused on\",\n        description=(\n            \"A code, group definition, or canonical reference that describes the \"\n            \"intended subject of the action and its children, if any. Canonical \"\n            \"references are allowed to support the definition of protocols for drug\"\n            \" and substance quality specifications, and is allowed to reference a \"\n            \"MedicinalProductDefinition, SubstanceDefinition, \"\n            \"AdministrableProductDefinition, ManufacturedItemDefinition, or \"\n            \"PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=\"Type of individual the action is focused on\",\n        description=(\n            \"A code, group definition, or canonical reference that describes the \"\n            \"intended subject of the action and its children, if any. Canonical \"\n            \"references are allowed to support the definition of protocols for drug\"\n            \" and substance quality specifications, and is allowed to reference a \"\n            \"MedicinalProductDefinition, SubstanceDefinition, \"\n            \"AdministrableProductDefinition, ManufacturedItemDefinition, or \"\n            \"PackagedProductDefinition resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    textEquivalent: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"textEquivalent\",\n        title=(\n            \"Static text equivalent of the action, used if the dynamic aspects \"\n            \"cannot be interpreted by the receiving system\"\n        ),\n        description=(\n            \"A text equivalent of the action to be performed. This provides a \"\n            \"human-interpretable description of the action when the definition is \"\n            \"consumed by a system that might not be capable of interpreting it \"\n            \"dynamically.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    textEquivalent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_textEquivalent\",\n        title=\"Extension field for ``textEquivalent``.\",\n    )\n\n    timingAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"timingAge\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"timingDuration\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"timingRange\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"User-visible title\",\n        description=(\n            \"The textual description of the action displayed to a user. For \"\n            \"example, when the action is a test to be performed, the title would be\"\n            \" the title of the test such as Assay by HPLC.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    transform: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"transform\",\n        title=\"Transform to apply the template\",\n        description=(\n            \"A reference to a StructureMap resource that defines a transform that \"\n            \"can be executed to produce the intent resource using the \"\n            \"ActivityDefinition instance as the input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureMap\"],\n        },\n    )\n    transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_transform\", title=\"Extension field for ``transform``.\"\n    )\n\n    trigger: typing.List[fhirtypes.TriggerDefinitionType] | None = Field(\n        default=None,\n        alias=\"trigger\",\n        title=\"When the action should be triggered\",\n        description=(\n            \"A description of when the action should be triggered. When multiple \"\n            \"triggers are specified on an action, any triggering event invokes the \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"create | update | remove | fire-event\",\n        description=\"The type of action to perform (create, update, remove).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"prefix\",\n            \"title\",\n            \"description\",\n            \"textEquivalent\",\n            \"priority\",\n            \"code\",\n            \"reason\",\n            \"documentation\",\n            \"goalId\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"subjectCanonical\",\n            \"trigger\",\n            \"condition\",\n            \"input\",\n            \"output\",\n            \"relatedAction\",\n            \"timingAge\",\n            \"timingDuration\",\n            \"timingRange\",\n            \"timingTiming\",\n            \"location\",\n            \"participant\",\n            \"type\",\n            \"groupingBehavior\",\n            \"selectionBehavior\",\n            \"requiredBehavior\",\n            \"precheckBehavior\",\n            \"cardinalityBehavior\",\n            \"definitionCanonical\",\n            \"definitionUri\",\n            \"transform\",\n            \"dynamicValue\",\n            \"action\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"definition\": [\"definitionCanonical\", \"definitionUri\"],\n            \"subject\": [\n                \"subjectCanonical\",\n                \"subjectCodeableConcept\",\n                \"subjectReference\",\n            ],\n            \"timing\": [\"timingAge\", \"timingDuration\", \"timingRange\", \"timingTiming\"],\n        }\n        return one_of_many_fields\n\n\nclass PlanDefinitionActionCondition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Whether or not the action is applicable.\n    An expression that describes applicability criteria or start/stop\n    conditions for the action.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionCondition\"\n\n    expression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Boolean-valued expression\",\n        description=(\n            \"An expression that returns true or false, indicating whether the \"\n            \"condition is satisfied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"applicability | start | stop\",\n        description=\"The kind of condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"applicability\", \"start\", \"stop\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"kind\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"kind\", \"kind__ext\")]\n        return required_fields\n\n\nclass PlanDefinitionActionDynamicValue(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dynamic aspects of the definition.\n    Customizations that should be applied to the statically defined resource.\n    For example, if the dosage of a medication must be computed based on the\n    patient's weight, a customization would be used to specify an expression\n    that calculated the weight, and the path on the resource that would contain\n    the result.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionDynamicValue\"\n\n    expression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"An expression that provides the dynamic value for the customization\",\n        description=\"An expression specifying the value of the customized element.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"The path to the element to be set dynamically\",\n        description=(\n            \"The path to the element to be customized. This is the path on the \"\n            \"resource that will hold the result of the calculation defined by the \"\n            \"expression. The specified path SHALL be a FHIRPath resolvable on the \"\n            \"specified target type of the ActivityDefinition, and SHALL consist \"\n            \"only of identifiers, constant indexers, and a restricted subset of \"\n            \"functions. The path is allowed to contain qualifiers (.) to traverse \"\n            \"sub-elements, as well as indexers ([x]) to traverse multiple-\"\n            \"cardinality sub-elements (see the [Simple FHIRPath \"\n            \"Profile](fhirpath.html#simple) for full details).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"path\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PlanDefinitionActionInput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Input data requirements.\n    Defines input data requirements for the action.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionInput\"\n\n    relatedData: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"relatedData\",\n        title=\"What data is provided\",\n        description=(\n            \"Points to an existing input or output element that provides data to \"\n            \"this input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    relatedData__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_relatedData\", title=\"Extension field for ``relatedData``.\"\n    )\n\n    requirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"requirement\",\n        title=\"What data is provided\",\n        description=\"Defines the data that is to be provided as input to the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"User-visible title\",\n        description=(\n            \"A human-readable label for the data requirement used to label data \"\n            \"flows in BPMN or similar diagrams. Also provides a human readable \"\n            \"label when rendering the data requirement that conveys its purpose to \"\n            \"human readers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"title\",\n            \"requirement\",\n            \"relatedData\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PlanDefinitionActionOutput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Output data definition.\n    Defines the outputs of the action, if any.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionOutput\"\n\n    relatedData: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"relatedData\",\n        title=\"What data is provided\",\n        description=(\n            \"Points to an existing input or output element that is results as \"\n            \"output from the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    relatedData__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_relatedData\", title=\"Extension field for ``relatedData``.\"\n    )\n\n    requirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"requirement\",\n        title=\"What data is provided\",\n        description=\"Defines the data that results as output from the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"User-visible title\",\n        description=(\n            \"A human-readable label for the data requirement used to label data \"\n            \"flows in BPMN or similar diagrams. Also provides a human readable \"\n            \"label when rendering the data requirement that conveys its purpose to \"\n            \"human readers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"title\",\n            \"requirement\",\n            \"relatedData\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PlanDefinitionActionParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who should participate in the action.\n    Indicates who should participate in performing the action described.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionParticipant\"\n\n    actorId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"actorId\",\n        title=\"What actor\",\n        description=(\n            \"A reference to the id element of the actor who will participate in \"\n            \"this action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    actorId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actorId\", title=\"Extension field for ``actorId``.\"\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"E.g. Author, Reviewer, Witness, etc\",\n        description=(\n            \"Indicates how the actor will be involved in the action - author, \"\n            \"reviewer, witness, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"E.g. Nurse, Surgeon, Parent\",\n        description=(\n            \"The role the participant should play in performing the described \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"careteam | device | group | healthcareservice | location | \"\n            \"organization | patient | practitioner | practitionerrole | \"\n            \"relatedperson\"\n        ),\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"careteam\",\n                \"device\",\n                \"group\",\n                \"healthcareservice\",\n                \"location\",\n                \"organization\",\n                \"patient\",\n                \"practitioner\",\n                \"practitionerrole\",\n                \"relatedperson\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    typeCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"typeCanonical\",\n        title=\"Who or what can participate\",\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n    typeCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_typeCanonical\",\n        title=\"Extension field for ``typeCanonical``.\",\n    )\n\n    typeReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"typeReference\",\n        title=\"Who or what can participate\",\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"Device\",\n                \"DeviceDefinition\",\n                \"Endpoint\",\n                \"Group\",\n                \"HealthcareService\",\n                \"Location\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"actorId\",\n            \"type\",\n            \"typeCanonical\",\n            \"typeReference\",\n            \"role\",\n            \"function\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PlanDefinitionActionRelatedAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationship to another action.\n    A relationship to another action such as \"before\" or \"30-60 minutes after\n    start of\".\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActionRelatedAction\"\n\n    endRelationship: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"endRelationship\",\n        title=(\n            \"before | before-start | before-end | concurrent | concurrent-with-\"\n            \"start | concurrent-with-end | after | after-start | after-end\"\n        ),\n        description=\"The relationship of the end of this action to the related action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"before\",\n                \"before-start\",\n                \"before-end\",\n                \"concurrent\",\n                \"concurrent-with-start\",\n                \"concurrent-with-end\",\n                \"after\",\n                \"after-start\",\n                \"after-end\",\n            ],\n        },\n    )\n    endRelationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_endRelationship\",\n        title=\"Extension field for ``endRelationship``.\",\n    )\n\n    offsetDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"offsetDuration\",\n        title=\"Time offset for the relationship\",\n        description=(\n            \"A duration or range of durations to apply to the relationship. For \"\n            \"example, 30-60 minutes before.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e offset[x]\n            \"one_of_many\": \"offset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    offsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"offsetRange\",\n        title=\"Time offset for the relationship\",\n        description=(\n            \"A duration or range of durations to apply to the relationship. For \"\n            \"example, 30-60 minutes before.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e offset[x]\n            \"one_of_many\": \"offset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    relationship: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=(\n            \"before | before-start | before-end | concurrent | concurrent-with-\"\n            \"start | concurrent-with-end | after | after-start | after-end\"\n        ),\n        description=\"The relationship of the start of this action to the related action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"before\",\n                \"before-start\",\n                \"before-end\",\n                \"concurrent\",\n                \"concurrent-with-start\",\n                \"concurrent-with-end\",\n                \"after\",\n                \"after-start\",\n                \"after-end\",\n            ],\n        },\n    )\n    relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relationship\",\n        title=\"Extension field for ``relationship``.\",\n    )\n\n    targetId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"targetId\",\n        title=\"What action is this related to\",\n        description=\"The element id of the target related action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    targetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_targetId\", title=\"Extension field for ``targetId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActionRelatedAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"targetId\",\n            \"relationship\",\n            \"endRelationship\",\n            \"offsetDuration\",\n            \"offsetRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActionRelatedAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"relationship\", \"relationship__ext\"),\n            (\"targetId\", \"targetId__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"offset\": [\"offsetDuration\", \"offsetRange\"]}\n        return one_of_many_fields\n\n\nclass PlanDefinitionActor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Actors within the plan.\n    Actors represent the individuals or groups involved in the execution of the\n    defined set of activities.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActor\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Describes the actor\",\n        description=(\n            \"A description of how the actor fits into the overall actions of the \"\n            \"plan definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    option: typing.List[fhirtypes.PlanDefinitionActorOptionType] = Field(\n        default=...,\n        alias=\"option\",\n        title=\"Who or what can be this actor\",\n        description=\"The characteristics of the candidates that could serve as the actor.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"User-visible title\",\n        description=\"A descriptive label for the actor.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"title\",\n            \"description\",\n            \"option\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PlanDefinitionActorOption(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who or what can be this actor.\n    The characteristics of the candidates that could serve as the actor.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionActorOption\"\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"E.g. Nurse, Surgeon, Parent\",\n        description=(\n            \"The role the participant should play in performing the described \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"careteam | device | group | healthcareservice | location | \"\n            \"organization | patient | practitioner | practitionerrole | \"\n            \"relatedperson\"\n        ),\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"careteam\",\n                \"device\",\n                \"group\",\n                \"healthcareservice\",\n                \"location\",\n                \"organization\",\n                \"patient\",\n                \"practitioner\",\n                \"practitionerrole\",\n                \"relatedperson\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    typeCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"typeCanonical\",\n        title=\"Who or what can participate\",\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n    typeCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_typeCanonical\",\n        title=\"Extension field for ``typeCanonical``.\",\n    )\n\n    typeReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"typeReference\",\n        title=\"Who or what can participate\",\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"Device\",\n                \"DeviceDefinition\",\n                \"Endpoint\",\n                \"Group\",\n                \"HealthcareService\",\n                \"Location\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionActorOption`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"typeCanonical\",\n            \"typeReference\",\n            \"role\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionActorOption`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PlanDefinitionGoal(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    What the plan is trying to accomplish.\n    A goal describes an expected outcome that activities within the plan are\n    intended to achieve. For example, weight loss, restoring an activity of\n    daily living, obtaining herd immunity via immunization, meeting a process\n    improvement objective, meeting the acceptance criteria for a test as\n    specified by a quality specification, etc.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionGoal\"\n\n    addresses: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"addresses\",\n        title=\"What does the goal address\",\n        description=(\n            \"Identifies problems, conditions, issues, or concerns the goal is \"\n            \"intended to address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"E.g. Treatment, dietary, behavioral\",\n        description=\"Indicates a category the goal falls within.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"description\",\n        title=\"Code or text describing the goal\",\n        description=(\n            \"Human-readable and/or coded description of a specific desired \"\n            'objective of care, such as \"control blood pressure\" or \"negotiate an '\n            'obstacle course\" or \"dance with child at wedding\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Supporting documentation for the goal\",\n        description=(\n            \"Didactic or other informational resources associated with the goal \"\n            \"that provide further supporting information about the goal. \"\n            \"Information resources can include inline text commentary and links to \"\n            \"web resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"high-priority | medium-priority | low-priority\",\n        description=(\n            \"Identifies the expected level of importance associated with \"\n            \"reaching/sustaining the defined goal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    start: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"When goal pursuit begins\",\n        description=\"The event after which the goal should begin being pursued.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    target: typing.List[fhirtypes.PlanDefinitionGoalTargetType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Target outcome for the goal\",\n        description=\"Indicates what should be done and within what timeframe.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionGoal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"category\",\n            \"description\",\n            \"priority\",\n            \"start\",\n            \"addresses\",\n            \"documentation\",\n            \"target\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionGoal`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PlanDefinitionGoalTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Target outcome for the goal.\n    Indicates what should be done and within what timeframe.\n    \"\"\"\n\n    __resource_type__ = \"PlanDefinitionGoalTarget\"\n\n    detailBoolean: bool | None = Field(\n        default=None,\n        alias=\"detailBoolean\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical\"\n            \" quality - NMT 0.6%, Clear solution, etc. Either the high or low or \"\n            \"both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any value at or \"\n            \"below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any value at or above the low \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n    detailBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailBoolean\",\n        title=\"Extension field for ``detailBoolean``.\",\n    )\n\n    detailCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"detailCodeableConcept\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical\"\n            \" quality - NMT 0.6%, Clear solution, etc. Either the high or low or \"\n            \"both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any value at or \"\n            \"below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any value at or above the low \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"detailInteger\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical\"\n            \" quality - NMT 0.6%, Clear solution, etc. Either the high or low or \"\n            \"both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any value at or \"\n            \"below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any value at or above the low \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n    detailInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailInteger\",\n        title=\"Extension field for ``detailInteger``.\",\n    )\n\n    detailQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"detailQuantity\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical\"\n            \" quality - NMT 0.6%, Clear solution, etc. Either the high or low or \"\n            \"both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any value at or \"\n            \"below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any value at or above the low \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"detailRange\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical\"\n            \" quality - NMT 0.6%, Clear solution, etc. Either the high or low or \"\n            \"both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any value at or \"\n            \"below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any value at or above the low \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"detailRatio\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical\"\n            \" quality - NMT 0.6%, Clear solution, etc. Either the high or low or \"\n            \"both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any value at or \"\n            \"below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any value at or above the low \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    detailString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"detailString\",\n        title=\"The target value to be achieved\",\n        description=(\n            \"The target value of the measure to be achieved to signify fulfillment \"\n            \"of the goal, e.g. 150 pounds or 7.0%, or in the case of pharmaceutical\"\n            \" quality - NMT 0.6%, Clear solution, etc. Either the high or low or \"\n            \"both values of the range can be specified. When a low value is \"\n            \"missing, it indicates that the goal is achieved at any value at or \"\n            \"below the high value. Similarly, if the high value is missing, it \"\n            \"indicates that the goal is achieved at any value at or above the low \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e detail[x]\n            \"one_of_many\": \"detail\",\n            \"one_of_many_required\": False,\n        },\n    )\n    detailString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_detailString\",\n        title=\"Extension field for ``detailString``.\",\n    )\n\n    due: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"due\",\n        title=\"Reach goal within\",\n        description=(\n            \"Indicates the timeframe after the start of the goal in which the goal \"\n            \"should be met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    measure: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"measure\",\n        title=\"The parameter whose value is to be tracked\",\n        description=(\n            \"The parameter whose value is to be tracked, e.g. body weight, blood \"\n            \"pressure, or hemoglobin A1c level.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PlanDefinitionGoalTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"measure\",\n            \"detailQuantity\",\n            \"detailRange\",\n            \"detailCodeableConcept\",\n            \"detailString\",\n            \"detailBoolean\",\n            \"detailInteger\",\n            \"detailRatio\",\n            \"due\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PlanDefinitionGoalTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"detail\": [\n                \"detailBoolean\",\n                \"detailCodeableConcept\",\n                \"detailInteger\",\n                \"detailQuantity\",\n                \"detailRange\",\n                \"detailRatio\",\n                \"detailString\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/practitioner.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Practitioner\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Practitioner(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A person with a  formal responsibility in the provisioning of healthcare or\n    related services.\n    A person who is directly or indirectly involved in the provisioning of\n    healthcare or related services.\n    \"\"\"\n\n    __resource_type__ = \"Practitioner\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this practitioner's record is in active use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=(\n            \"Address(es) of the practitioner that are not role specific (typically \"\n            \"home address)\"\n        ),\n        description=(\n            \"Address(es) of the practitioner that are not role specific (typically \"\n            \"home address).  Work addresses are not typically entered in this \"\n            \"property as they are usually role dependent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    birthDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"birthDate\",\n        title=\"The date  on which the practitioner was born\",\n        description=\"The date of birth for the practitioner.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_birthDate\", title=\"Extension field for ``birthDate``.\"\n    )\n\n    communication: typing.List[fhirtypes.PractitionerCommunicationType] | None = Field(\n        default=None,\n        alias=\"communication\",\n        title=\"A language which may be used to communicate with the practitioner\",\n        description=(\n            \"A language which may be used to communicate with the practitioner, \"\n            \"often for correspondence/administrative purposes.  The \"\n            \"`PractitionerRole.communication` property should be used for \"\n            \"publishing the languages that a practitioner is able to communicate \"\n            \"with patients (on a per Organization/Role basis).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    deceasedBoolean: bool | None = Field(\n        default=None,\n        alias=\"deceasedBoolean\",\n        title=\"Indicates if the practitioner is deceased or not\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedBoolean\",\n        title=\"Extension field for ``deceasedBoolean``.\",\n    )\n\n    deceasedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"deceasedDateTime\",\n        title=\"Indicates if the practitioner is deceased or not\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e deceased[x]\n            \"one_of_many\": \"deceased\",\n            \"one_of_many_required\": False,\n        },\n    )\n    deceasedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_deceasedDateTime\",\n        title=\"Extension field for ``deceasedDateTime``.\",\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the person is considered to \"\n            \"have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier for the person as this agent\",\n        description=\"An identifier that applies to this person in this role.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The name(s) associated with the practitioner\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    photo: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Image of the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    qualification: typing.List[fhirtypes.PractitionerQualificationType] | None = Field(\n        default=None,\n        alias=\"qualification\",\n        title=(\n            \"Qualifications, certifications, accreditations, licenses, training, \"\n            \"etc. pertaining to the provision of care\"\n        ),\n        description=(\n            \"The official qualifications, certifications, accreditations, training,\"\n            \" licenses (and other types of educations/skills/capabilities) that \"\n            \"authorize or otherwise pertain to the provision of care by the \"\n            \"practitioner.  For example, a medical license issued by a medical \"\n            \"board of licensure authorizing the practitioner to practice medicine \"\n            \"within a certain locality.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the practitioner (that apply to all roles)\",\n        description=(\n            \"A contact detail for the practitioner, e.g. a telephone number or an \"\n            \"email address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Practitioner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"deceasedBoolean\",\n            \"deceasedDateTime\",\n            \"address\",\n            \"photo\",\n            \"qualification\",\n            \"communication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Practitioner`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"deceasedBoolean\",\n            \"deceasedDateTime\",\n            \"address\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"deceased\": [\"deceasedBoolean\", \"deceasedDateTime\"]}\n        return one_of_many_fields\n\n\nclass PractitionerCommunication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A language which may be used to communicate with the practitioner.\n    A language which may be used to communicate with the practitioner, often\n    for correspondence/administrative purposes.\n\n    The `PractitionerRole.communication` property should be used for publishing\n    the languages that a practitioner is able to communicate with patients (on\n    a per Organization/Role basis).\n    \"\"\"\n\n    __resource_type__ = \"PractitionerCommunication\"\n\n    language: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"language\",\n        title=\"The language code used to communicate with the practitioner\",\n        description=(\n            \"The ISO-639-1 alpha 2 code in lower case for the language, optionally \"\n            \"followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in\"\n            ' upper case; e.g. \"en\" for English, or \"en-US\" for American English '\n            'versus \"en-AU\" for Australian English.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preferred: bool | None = Field(\n        default=None,\n        alias=\"preferred\",\n        title=\"Language preference indicator\",\n        description=(\n            \"Indicates whether or not the person prefers this language (over other \"\n            \"languages he masters up a certain level).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preferred\", title=\"Extension field for ``preferred``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PractitionerCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"preferred\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PractitionerCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass PractitionerQualification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Qualifications, certifications, accreditations, licenses, training, etc.\n    pertaining to the provision of care.\n    The official qualifications, certifications, accreditations, training,\n    licenses (and other types of educations/skills/capabilities) that authorize\n    or otherwise pertain to the provision of care by the practitioner.\n\n    For example, a medical license issued by a medical board of licensure\n    authorizing the practitioner to practice medicine within a certain\n    locality.\n    \"\"\"\n\n    __resource_type__ = \"PractitionerQualification\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Coded representation of the qualification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"An identifier for this qualification for the practitioner\",\n        description=\"An identifier that applies to this person's qualification.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    issuer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"issuer\",\n        title=\"Organization that regulates and issues the qualification\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period during which the qualification is valid\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PractitionerQualification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"code\",\n            \"period\",\n            \"issuer\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PractitionerQualification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/practitionerrole.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PractitionerRole\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass PractitionerRole(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Roles/organizations the practitioner is associated with.\n    A specific set of Roles/Locations/specialties/services that a practitioner\n    may perform at an organization for a period of time.\n    \"\"\"\n\n    __resource_type__ = \"PractitionerRole\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this practitioner role record is in active use\",\n        description=(\n            \" Whether this practitioner role record is in active use. Some systems \"\n            \"may use this property to mark non-active practitioners, such as those \"\n            \"that are not currently employed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    availability: typing.List[fhirtypes.AvailabilityType] | None = Field(\n        default=None,\n        alias=\"availability\",\n        title=(\n            \"Times the Practitioner is available at this location and/or healthcare\"\n            \" service (including exceptions)\"\n        ),\n        description=(\n            \"A collection of times the practitioner is available or performing this\"\n            \" role at the location and/or healthcareservice.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    characteristic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"characteristic\",\n        title=\"Collection of characteristics (attributes)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Roles which this practitioner may perform\",\n        description=(\n            \"Roles which this practitioner is authorized to perform for the \"\n            \"organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    communication: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"communication\",\n        title=(\n            \"A language the practitioner (in this role) can use in patient \"\n            \"communication\"\n        ),\n        description=(\n            \"A language the practitioner can use in patient communication. The \"\n            \"practitioner may know several languages (listed in \"\n            \"practitioner.communication), however these are the languages that \"\n            \"could be advertised in a directory for a patient to search.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ExtendedContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Official contact details relating to this PractitionerRole\",\n        description=(\n            \"The contact details of communication devices available relevant to the\"\n            \" specific PractitionerRole. This can include addresses, phone numbers,\"\n            \" fax numbers, mobile numbers, email addresses and web sites.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    endpoint: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Endpoints for interacting with the practitioner in this role\",\n        description=(\n            \" Technical endpoints providing access to services operated for the \"\n            \"practitioner with this role. Commonly used for locating scheduling \"\n            \"services, or identifying where to send referrals electronically.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Endpoint\"],\n        },\n    )\n\n    healthcareService: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"healthcareService\",\n        title=\"Healthcare services provided for this role's Organization/Location(s)\",\n        description=(\n            \"The list of healthcare services that this worker provides for this \"\n            \"role's Organization/Location(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"HealthcareService\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers for a role/location\",\n        description=\"Business Identifiers that are specific to a role/location.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Location(s) where the practitioner provides care\",\n        description=\"The location(s) at which this practitioner provides care.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    organization: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"organization\",\n        title=\"Organization where the roles are available\",\n        description=\"The organization where the Practitioner performs the roles associated.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=(\n            \"The period during which the practitioner is authorized to perform in \"\n            \"these role(s)\"\n        ),\n        description=(\n            \"The period during which the person is authorized to act as a \"\n            \"practitioner in these role(s) for the organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    practitioner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"practitioner\",\n        title=\"Practitioner that provides services for the organization\",\n        description=(\n            \"Practitioner that is able to provide the defined services for the \"\n            \"organization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\"],\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=\"Specific specialty of the practitioner\",\n        description=(\n            \"The specialty of a practitioner that describes the functional role \"\n            \"they are practicing at a given organization or location.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PractitionerRole`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"period\",\n            \"practitioner\",\n            \"organization\",\n            \"code\",\n            \"specialty\",\n            \"location\",\n            \"healthcareService\",\n            \"contact\",\n            \"characteristic\",\n            \"communication\",\n            \"availability\",\n            \"endpoint\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PractitionerRole`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"period\",\n            \"practitioner\",\n            \"organization\",\n            \"code\",\n            \"specialty\",\n            \"location\",\n        ]\n"
  },
  {
    "path": "fhir/resources/primitivetype.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PrimitiveType\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom . import datatype\n\n\nclass PrimitiveType(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Parent type for DataTypes with a simple value.\n    The base type for all re-useable types defined that have a simple property.\n    \"\"\"\n\n    __resource_type__ = \"PrimitiveType\"\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``PrimitiveType`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``PrimitiveType`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return []\n"
  },
  {
    "path": "fhir/resources/procedure.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Procedure\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Procedure(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An action that is being or was performed on an individual or entity.\n    An action that is or was performed on or for a patient, practitioner,\n    device, organization, or location. For example, this can be a physical\n    intervention on a patient like an operation, or less invasive like long\n    term services, counseling, or hypnotherapy.  This can be a quality or\n    safety inspection for a location, organization, or device.  This can be an\n    accreditation procedure on a practitioner for licensing.\n    \"\"\"\n\n    __resource_type__ = \"Procedure\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"A request for this procedure\",\n        description=(\n            \"A reference to a resource that contains details of the request for \"\n            \"this procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\", \"ServiceRequest\"],\n        },\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Target body sites\",\n        description=(\n            \"Detailed and structured anatomical location information. Multiple \"\n            \"locations are allowed - e.g. multiple punch biopsies of a lesion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classification of the procedure\",\n        description=(\n            \"A code that classifies the procedure for searching, sorting and \"\n            'display purposes (e.g. \"Surgical Procedure\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Identification of the procedure\",\n        description=(\n            \"The specific procedure that is performed. Use text if the exact nature\"\n            ' of the procedure cannot be coded (e.g. \"Laparoscopic Appendectomy\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    complication: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"complication\",\n        title=\"Complication following the procedure\",\n        description=(\n            \"Any complications that occurred during the procedure, or in the \"\n            \"immediate post-performance period. These are generally tracked \"\n            \"separately from the notes, which will typically describe the procedure\"\n            \" itself rather than any 'post procedure' issues.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"The Encounter during which this Procedure was created\",\n        description=(\n            \"The Encounter during which this Procedure was created or performed or \"\n            \"to which the creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    focalDevice: typing.List[fhirtypes.ProcedureFocalDeviceType] | None = Field(\n        default=None,\n        alias=\"focalDevice\",\n        title=\"Manipulated, implanted, or removed device\",\n        description=(\n            \"A device that is implanted, removed or otherwise manipulated \"\n            \"(calibration, battery replacement, fitting a prosthesis, attaching a \"\n            \"wound-vac, etc.) as a focal portion of the Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    focus: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=(\n            \"Who is the target of the procedure when it is not the subject of \"\n            \"record only\"\n        ),\n        description=(\n            \"Who is the target of the procedure when it is not the subject of \"\n            \"record only.  If focus is not present, then subject is the focus.  If \"\n            \"focus is present and the subject is one of the targets of the \"\n            \"procedure, include subject as a focus as well. If focus is present and\"\n            \" the subject is not included in focus, it implies that the procedure \"\n            \"was only targeted on the focus. For example, when a caregiver is given\"\n            \" education for a patient, the caregiver would be the focus and the \"\n            \"procedure record is associated with the subject (e.g. patient).  For \"\n            \"example, use focus when recording the target of the education, \"\n            \"training, or counseling is the parent or relative of a patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"Organization\",\n                \"CareTeam\",\n                \"PractitionerRole\",\n                \"Specimen\",\n            ],\n        },\n    )\n\n    followUp: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"followUp\",\n        title=\"Instructions for follow up\",\n        description=(\n            \"If the procedure required specific follow up - e.g. removal of \"\n            \"sutures. The follow up may be represented as a simple note or could \"\n            \"potentially be more complex, in which case the CarePlan resource can \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Identifiers for this procedure\",\n        description=(\n            \"Business identifiers assigned to this procedure by the performer or \"\n            \"other systems which remain constant as the resource is updated and is \"\n            \"propagated from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, order set or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"ActivityDefinition\",\n                \"Measure\",\n                \"OperationDefinition\",\n                \"Questionnaire\",\n            ],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"order set or other definition that is adhered to in whole or in part \"\n            \"by this Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the procedure happened\",\n        description=(\n            \"The location where the procedure actually happened.  E.g. a newborn at\"\n            \" home, a tracheostomy at a restaurant.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional information about the procedure\",\n        description=\"Any other notes and comments about the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"occurrenceAge\",\n        title=\"When the procedure occurred or is occurring\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" did occur or is occurring.  Allows a period to support complex \"\n            \"procedures that span more than one date, and also allows for the \"\n            \"length of the procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When the procedure occurred or is occurring\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" did occur or is occurring.  Allows a period to support complex \"\n            \"procedures that span more than one date, and also allows for the \"\n            \"length of the procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When the procedure occurred or is occurring\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" did occur or is occurring.  Allows a period to support complex \"\n            \"procedures that span more than one date, and also allows for the \"\n            \"length of the procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"occurrenceRange\",\n        title=\"When the procedure occurred or is occurring\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" did occur or is occurring.  Allows a period to support complex \"\n            \"procedures that span more than one date, and also allows for the \"\n            \"length of the procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"occurrenceString\",\n        title=\"When the procedure occurred or is occurring\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" did occur or is occurring.  Allows a period to support complex \"\n            \"procedures that span more than one date, and also allows for the \"\n            \"length of the procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceString\",\n        title=\"Extension field for ``occurrenceString``.\",\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When the procedure occurred or is occurring\",\n        description=(\n            \"Estimated or actual date, date-time, period, or age when the procedure\"\n            \" did occur or is occurring.  Allows a period to support complex \"\n            \"procedures that span more than one date, and also allows for the \"\n            \"length of the procedure to be captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"The result of procedure\",\n        description=(\n            \"The outcome of the procedure - did it resolve the reasons for the \"\n            \"procedure being performed?\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=(\n            \"A larger event of which this particular procedure is a component or \"\n            \"step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Procedure\",\n                \"Observation\",\n                \"MedicationAdministration\",\n            ],\n        },\n    )\n\n    performer: typing.List[fhirtypes.ProcedurePerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who performed the procedure and what they did\",\n        description=(\n            \"Indicates who or what performed the procedure and how they were \"\n            \"involved.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"The justification that the procedure was performed\",\n        description=(\n            \"The coded reason or reference why the procedure was performed. This \"\n            \"may be a coded entity of some type, be present as text, or be a \"\n            \"reference to one of several resources that justify the procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"Procedure\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    recorded: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"recorded\",\n        title=\"When the procedure was first captured in the subject's record\",\n        description=(\n            \"The date the occurrence of the procedure was first captured in the \"\n            \"record regardless of Procedure.status (potentially after the \"\n            \"occurrence of the event).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recorded\", title=\"Extension field for ``recorded``.\"\n    )\n\n    recorder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"recorder\",\n        title=\"Who recorded the procedure\",\n        description=(\n            \"Individual who recorded the record and takes responsibility for its \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    report: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"report\",\n        title=\"Any report resulting from the procedure\",\n        description=(\n            \"This could be a histology result, pathology report, surgical report, \"\n            \"etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n                \"Composition\",\n            ],\n        },\n    )\n\n    reportedBoolean: bool | None = Field(\n        default=None,\n        alias=\"reportedBoolean\",\n        title=\"Reported rather than primary record\",\n        description=(\n            \"Indicates if this record was captured as a secondary 'reported' record\"\n            \" rather than as an original primary source-of-truth record.  It may \"\n            \"also indicate the source of the report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e reported[x]\n            \"one_of_many\": \"reported\",\n            \"one_of_many_required\": False,\n        },\n    )\n    reportedBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_reportedBoolean\",\n        title=\"Extension field for ``reportedBoolean``.\",\n    )\n\n    reportedReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reportedReference\",\n        title=\"Reported rather than primary record\",\n        description=(\n            \"Indicates if this record was captured as a secondary 'reported' record\"\n            \" rather than as an original primary source-of-truth record.  It may \"\n            \"also indicate the source of the report.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e reported[x]\n            \"one_of_many\": \"reported\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"preparation | in-progress | not-done | on-hold | stopped | completed |\"\n            \" entered-in-error | unknown\"\n        ),\n        description=(\n            \"A code specifying the state of the procedure. Generally, this will be \"\n            \"the in-progress or completed state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"preparation\",\n                \"in-progress\",\n                \"not-done\",\n                \"on-hold\",\n                \"stopped\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"Captures the reason for the current state of the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Individual or entity the procedure was performed on\",\n        description=(\n            \"On whom or on what the procedure was performed. This is usually an \"\n            \"individual human, but can also be performed on animals, groups of \"\n            \"humans or animals, organizations or practitioners (for licensing), \"\n            \"locations or devices (for safety inspections or regulatory \"\n            \"authorizations).  If the actual focus of the procedure is different \"\n            \"from the subject, the focus element specifies the actual focus of the \"\n            \"procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Device\",\n                \"Practitioner\",\n                \"Organization\",\n                \"Location\",\n            ],\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Extra information relevant to the procedure\",\n        description=(\n            \"Other resources from the patient record that may be relevant to the \"\n            \"procedure.  The information from these resources was either used to \"\n            \"create the instance or is provided to help with its interpretation. \"\n            \"This extension should not be used if more specific inline elements or \"\n            \"extensions are available.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    used: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"used\",\n        title=\"Items used during procedure\",\n        description=(\n            \"Identifies medications, devices and any other substance used as part \"\n            \"of the procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Medication\",\n                \"Substance\",\n                \"BiologicallyDerivedProduct\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Procedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"focus\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceString\",\n            \"occurrenceAge\",\n            \"occurrenceRange\",\n            \"occurrenceTiming\",\n            \"recorded\",\n            \"recorder\",\n            \"reportedBoolean\",\n            \"reportedReference\",\n            \"performer\",\n            \"location\",\n            \"reason\",\n            \"bodySite\",\n            \"outcome\",\n            \"report\",\n            \"complication\",\n            \"followUp\",\n            \"note\",\n            \"focalDevice\",\n            \"used\",\n            \"supportingInfo\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Procedure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"category\",\n            \"code\",\n            \"subject\",\n            \"focus\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceString\",\n            \"occurrenceAge\",\n            \"occurrenceRange\",\n            \"occurrenceTiming\",\n            \"recorded\",\n            \"recorder\",\n            \"reportedBoolean\",\n            \"reportedReference\",\n            \"performer\",\n            \"location\",\n            \"reason\",\n            \"bodySite\",\n            \"outcome\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\n                \"occurrenceAge\",\n                \"occurrenceDateTime\",\n                \"occurrencePeriod\",\n                \"occurrenceRange\",\n                \"occurrenceString\",\n                \"occurrenceTiming\",\n            ],\n            \"reported\": [\"reportedBoolean\", \"reportedReference\"],\n        }\n        return one_of_many_fields\n\n\nclass ProcedureFocalDevice(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Manipulated, implanted, or removed device.\n    A device that is implanted, removed or otherwise manipulated (calibration,\n    battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as\n    a focal portion of the Procedure.\n    \"\"\"\n\n    __resource_type__ = \"ProcedureFocalDevice\"\n\n    action: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Kind of change to device\",\n        description=\"The kind of change that happened to the device during the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    manipulated: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"manipulated\",\n        title=\"Device that was changed\",\n        description=\"The device that was manipulated (changed) during the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProcedureFocalDevice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\", \"manipulated\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProcedureFocalDevice`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ProcedurePerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who performed the procedure and what they did.\n    Indicates who or what performed the procedure and how they were involved.\n    \"\"\"\n\n    __resource_type__ = \"ProcedurePerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Who performed the procedure\",\n        description=\"Indicates who or what performed the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"CareTeam\",\n                \"HealthcareService\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of performance\",\n        description=(\n            \"Distinguishes the type of involvement of the performer in the \"\n            \"procedure. For example, surgeon, anaesthetist, endoscopist.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"Organization the device or practitioner was acting for\",\n        description=(\n            \"The Organization the Patient, RelatedPerson, Device, CareTeam, and \"\n            \"HealthcareService was acting on behalf of.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When the performer performed the procedure\",\n        description=\"Time period during which the performer performed the procedure.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProcedurePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"function\",\n            \"actor\",\n            \"onBehalfOf\",\n            \"period\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProcedurePerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n"
  },
  {
    "path": "fhir/resources/productshelflife.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ProductShelfLife\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backbonetype, fhirtypes\n\n\nclass ProductShelfLife(backbonetype.BackboneType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The shelf-life and storage information for a medicinal product item or\n    container can be described using this class.\n    \"\"\"\n\n    __resource_type__ = \"ProductShelfLife\"\n\n    periodDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"periodDuration\",\n        title=(\n            \"The shelf life time period can be specified using a numerical value \"\n            \"for the period of time and its unit of time measurement The unit of \"\n            \"measurement shall be specified in accordance with ISO 11240 and the \"\n            \"resulting terminology The symbol and the symbol identifier shall be \"\n            \"used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e period[x]\n            \"one_of_many\": \"period\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    periodString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"periodString\",\n        title=(\n            \"The shelf life time period can be specified using a numerical value \"\n            \"for the period of time and its unit of time measurement The unit of \"\n            \"measurement shall be specified in accordance with ISO 11240 and the \"\n            \"resulting terminology The symbol and the symbol identifier shall be \"\n            \"used\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e period[x]\n            \"one_of_many\": \"period\",\n            \"one_of_many_required\": False,\n        },\n    )\n    periodString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_periodString\",\n        title=\"Extension field for ``periodString``.\",\n    )\n\n    specialPrecautionsForStorage: typing.List[\n        fhirtypes.CodeableConceptType\n    ] | None = Field(\n        default=None,\n        alias=\"specialPrecautionsForStorage\",\n        title=(\n            \"Special precautions for storage, if any, can be specified using an \"\n            \"appropriate controlled vocabulary The controlled term and the \"\n            \"controlled term identifier shall be specified\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"This describes the shelf life, taking into account various scenarios \"\n            \"such as shelf life of the packaged Medicinal Product itself, shelf \"\n            \"life after transformation where necessary and shelf life after the \"\n            \"first opening of a bottle, etc. The shelf life type shall be specified\"\n            \" using an appropriate controlled vocabulary The controlled term and \"\n            \"the controlled term identifier shall be specified\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProductShelfLife`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"periodDuration\",\n            \"periodString\",\n            \"specialPrecautionsForStorage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProductShelfLife`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"periodDuration\",\n            \"periodString\",\n            \"specialPrecautionsForStorage\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"period\": [\"periodDuration\", \"periodString\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/provenance.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Provenance\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Provenance(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who, What, When for a set of resources.\n    Provenance of a resource is a record that describes entities and processes\n    involved in producing and delivering or otherwise influencing that\n    resource. Provenance provides a critical foundation for assessing\n    authenticity, enabling trust, and allowing reproducibility. Provenance\n    assertions are a form of contextual metadata and can themselves become\n    important records with their own provenance. Provenance statement indicates\n    clinical significance in terms of confidence in authenticity, reliability,\n    and trustworthiness, integrity, and stage in lifecycle (e.g. Document\n    Completion - has the artifact been legally authenticated), all of which may\n    impact security, privacy, and trust policies.\n    \"\"\"\n\n    __resource_type__ = \"Provenance\"\n\n    activity: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"activity\",\n        title=\"Activity that occurred\",\n        description=(\n            \"An activity is something that occurs over a period of time and acts \"\n            \"upon or with entities; it may include consuming, processing, \"\n            \"transforming, modifying, relocating, using, or generating entities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    agent: typing.List[fhirtypes.ProvenanceAgentType] = Field(\n        default=...,\n        alias=\"agent\",\n        title=\"Actor involved\",\n        description=(\n            \"An actor taking a role in an activity  for which it can be assigned \"\n            \"some degree of responsibility for the activity taking place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    authorization: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"authorization\",\n        title=\"Authorization (purposeOfUse) related to the event\",\n        description=(\n            \"The authorization (e.g., PurposeOfUse) that was used during the event \"\n            \"being recorded.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Workflow authorization within which this event occurred\",\n        description=(\n            \"Allows tracing of authorizatino for the events and tracking whether \"\n            \"proposals/recommendations were acted upon.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CarePlan\",\n                \"DeviceRequest\",\n                \"ImmunizationRecommendation\",\n                \"MedicationRequest\",\n                \"NutritionOrder\",\n                \"ServiceRequest\",\n                \"Task\",\n            ],\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=(\n            \"Encounter within which this event occurred or which the event is \"\n            \"tightly associated\"\n        ),\n        description=(\n            \"This will typically be the encounter the event occurred, but some \"\n            \"events may be initiated prior to or after the official completion of \"\n            \"an encounter but still be tied to the context of the encounter (e.g. \"\n            \"pre-admission lab tests).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    entity: typing.List[fhirtypes.ProvenanceEntityType] | None = Field(\n        default=None,\n        alias=\"entity\",\n        title=\"An entity used in this activity\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the activity occurred, if relevant\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    occurredDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurredDateTime\",\n        title=\"When the activity occurred\",\n        description=\"The period during which the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e occurred[x]\n            \"one_of_many\": \"occurred\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurredDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurredDateTime\",\n        title=\"Extension field for ``occurredDateTime``.\",\n    )\n\n    occurredPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurredPeriod\",\n        title=\"When the activity occurred\",\n        description=\"The period during which the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e occurred[x]\n            \"one_of_many\": \"occurred\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=(\n            \"The patient is the subject of the data created/updated (.target) by \"\n            \"the activity\"\n        ),\n        description=(\n            \"The patient element is available to enable deterministic tracking of \"\n            \"activities that involve the patient as the subject of the data used in\"\n            \" an activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    policy: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"policy\",\n        title=\"Policy or plan the activity was defined by\",\n        description=(\n            \"Policy or plan the activity was defined by. Typically, a single \"\n            \"activity may have multiple applicable policy documents, such as \"\n            \"patient consent, guarantor funding, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    policy__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_policy\", title=\"Extension field for ``policy``.\"\n    )\n\n    recorded: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"recorded\",\n        title=\"When the activity was recorded / updated\",\n        description=\"The instant of time at which the activity was recorded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    recorded__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_recorded\", title=\"Extension field for ``recorded``.\"\n    )\n\n    signature: typing.List[fhirtypes.SignatureType] | None = Field(\n        default=None,\n        alias=\"signature\",\n        title=\"Signature on target\",\n        description=(\n            \"A digital signature on the target Reference(s). The signer should \"\n            \"match a Provenance.agent. The purpose of the signature is indicated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    target: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"target\",\n        title=\"Target Reference(s) (usually version specific)\",\n        description=(\n            \"The Reference(s) that were generated or updated by  the activity \"\n            \"described in this resource. A provenance can point to more than one \"\n            \"target if multiple resources were created/updated by the same \"\n            \"activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Provenance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"target\",\n            \"occurredPeriod\",\n            \"occurredDateTime\",\n            \"recorded\",\n            \"policy\",\n            \"location\",\n            \"authorization\",\n            \"activity\",\n            \"basedOn\",\n            \"patient\",\n            \"encounter\",\n            \"agent\",\n            \"entity\",\n            \"signature\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Provenance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"target\",\n            \"recorded\",\n            \"agent\",\n            \"entity\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"occurred\": [\"occurredDateTime\", \"occurredPeriod\"]}\n        return one_of_many_fields\n\n\nclass ProvenanceAgent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Actor involved.\n    An actor taking a role in an activity  for which it can be assigned some\n    degree of responsibility for the activity taking place.\n    \"\"\"\n\n    __resource_type__ = \"ProvenanceAgent\"\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"The agent that delegated\",\n        description=(\n            \"The agent that delegated authority to perform the activity performed \"\n            \"by the agent.who element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n            ],\n        },\n    )\n\n    role: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"What the agents role was\",\n        description=(\n            \"The structural roles of the agent indicating the agent's competency. \"\n            \"The security role enabling the agent with respect to the activity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"How the agent participated\",\n        description=\"The Functional Role of the agent with respect to the activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    who: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"who\",\n        title=\"The agent that participated in the event\",\n        description=\"Indicates who or what performed in the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProvenanceAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"role\",\n            \"who\",\n            \"onBehalfOf\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProvenanceAgent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"who\"]\n\n\nclass ProvenanceEntity(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An entity used in this activity.\n    \"\"\"\n\n    __resource_type__ = \"ProvenanceEntity\"\n\n    agent: typing.List[fhirtypes.ProvenanceAgentType] | None = Field(\n        default=None,\n        alias=\"agent\",\n        title=\"Entity is attributed to this agent\",\n        description=(\n            \"The entity is attributed to an agent to express the agent's \"\n            \"responsibility for that entity, possibly along with other agents. This\"\n            \" description can be understood as shorthand for saying that the agent \"\n            \"was responsible for the activity which used the entity.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"revision | quotation | source | instantiates | removal\",\n        description=\"How the entity was used during the activity.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"revision\",\n                \"quotation\",\n                \"source\",\n                \"instantiates\",\n                \"removal\",\n            ],\n        },\n    )\n    role__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_role\", title=\"Extension field for ``role``.\"\n    )\n\n    what: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"what\",\n        title=\"Identity of entity\",\n        description=(\n            \"Identity of the  Entity used. May be a logical or physical uri and \"\n            \"maybe absolute or relative.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ProvenanceEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"role\", \"what\", \"agent\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ProvenanceEntity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"role\", \"what\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"role\", \"role__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/py.typed",
    "content": ""
  },
  {
    "path": "fhir/resources/quantity.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SimpleQuantity\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Quantity(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A measured or measurable amount.\n    A measured amount (or an amount that can potentially be measured). Note\n    that measured amounts include amounts that are not precisely quantified,\n    including amounts involving arbitrary units and floating currencies.\n    \"\"\"\n\n    __resource_type__ = \"Quantity\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Coded form of the unit\",\n        description=(\n            \"A computer processable form of the unit in some unit representation \"\n            \"system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    comparator: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"comparator\",\n        title=\"< | <= | >= | > | ad - how to understand the value\",\n        description=(\n            \"How the value should be understood and represented - whether the \"\n            \"actual value is greater or less than the stated value due to \"\n            'measurement issues; e.g. if the comparator is \"<\" , then the real '\n            \"value is < stated value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comparator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comparator\", title=\"Extension field for ``comparator``.\"\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"System that defines coded unit form\",\n        description=(\n            \"The identification of the system that provides the coded form of the \"\n            \"unit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    unit: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Unit representation\",\n        description=\"A human-readable form of the unit.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    unit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_unit\", title=\"Extension field for ``unit``.\"\n    )\n\n    value: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Numerical value (with implicit precision)\",\n        description=(\n            \"The value of the measured amount. The value includes an implicit \"\n            \"precision in the presentation of the value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Quantity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Quantity`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"value\", \"comparator\", \"unit\", \"system\", \"code\"]\n"
  },
  {
    "path": "fhir/resources/questionnaire.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Questionnaire\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Questionnaire(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A structured set of questions.\n    A structured set of questions intended to guide the collection of answers\n    from end-users. Questionnaires provide detailed control over order,\n    presentation, phraseology and grouping to allow coherent, consistent data\n    collection.\n    \"\"\"\n\n    __resource_type__ = \"Questionnaire\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the questionnaire was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Concept that represents the overall questionnaire\",\n        description=(\n            \"An identifier for this collection of questions in a particular \"\n            \"terminology such as LOINC.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the questionnaire and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the questionnaire was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the questionnaire \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFrom: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Based on Questionnaire\",\n        description=\"The URL of a Questionnaire that this Questionnaire is based on.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Questionnaire\"],\n        },\n    )\n    derivedFrom__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_derivedFrom\", title=\"Extension field for ``derivedFrom``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the questionnaire\",\n        description=(\n            \"A free text natural language description of the questionnaire from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the questionnaire is expected to be used\",\n        description=(\n            \"The period during which the questionnaire content was or is planned to\"\n            \" be in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this questionnaire is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for questionnaire\",\n        description=(\n            \"A formal identifier that is used to identify this questionnaire when \"\n            \"it is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    item: typing.List[fhirtypes.QuestionnaireItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Questions and sections within the Questionnaire\",\n        description=(\n            \"A particular question, question grouping or display text that is part \"\n            \"of the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for questionnaire (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the questionnaire is intended to\"\n            \" be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the questionnaire was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this questionnaire (computer friendly)\",\n        description=(\n            \"A natural language name identifying the questionnaire. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this questionnaire is defined\",\n        description=(\n            \"Explanation of why this questionnaire is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The current state of this questionnaire.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectType: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"subjectType\",\n        title=\"Resource that can be subject of QuestionnaireResponse\",\n        description=(\n            \"The types of subjects that can be the subject of responses created for\"\n            \" the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subjectType__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_subjectType\", title=\"Extension field for ``subjectType``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this questionnaire (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the questionnaire.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this questionnaire, represented as an \"\n            \"absolute URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this questionnaire when it is\"\n            \" referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" questionnaire is (or will be) published. This URL can be the target \"\n            \"of a canonical reference. It SHALL remain the same when the \"\n            \"questionnaire is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate questionnaires.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the questionnaire\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"questionnaire when it is referenced in a specification, model, design \"\n            \"or instance. This is an arbitrary value managed by the questionnaire \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Questionnaire`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"derivedFrom\",\n            \"status\",\n            \"experimental\",\n            \"subjectType\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"code\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Questionnaire`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"derivedFrom\",\n            \"status\",\n            \"experimental\",\n            \"subjectType\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"code\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass QuestionnaireItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Questions and sections within the Questionnaire.\n    A particular question, question grouping or display text that is part of\n    the questionnaire.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireItem\"\n\n    answerConstraint: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"answerConstraint\",\n        title=\"optionsOnly | optionsOrType | optionsOrString\",\n        description=(\n            \"For items that have a defined set of allowed answers (via answerOption\"\n            \" or answerValueSet), indicates whether values *other* than those \"\n            \"specified can be selected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"optionsOnly\", \"optionsOrType\", \"optionsOrString\"],\n        },\n    )\n    answerConstraint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerConstraint\",\n        title=\"Extension field for ``answerConstraint``.\",\n    )\n\n    answerOption: typing.List[\n        fhirtypes.QuestionnaireItemAnswerOptionType\n    ] | None = Field(\n        default=None,\n        alias=\"answerOption\",\n        title=\"Permitted answer\",\n        description=\"One of the permitted answers for the question.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    answerValueSet: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"answerValueSet\",\n        title=\"ValueSet containing permitted answers\",\n        description=(\n            \"A reference to a value set containing a list of values representing \"\n            \"permitted answers for a question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    answerValueSet__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerValueSet\",\n        title=\"Extension field for ``answerValueSet``.\",\n    )\n\n    code: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Corresponding concept for this item in a terminology\",\n        description=(\n            \"A terminology code that corresponds to this group or question (e.g. a \"\n            \"code from LOINC, which defines many questions and answers).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"ElementDefinition - details for the item\",\n        description=(\n            \"This element is a URI that refers to an \"\n            \"[ElementDefinition](elementdefinition.html) or to an \"\n            \"[ObservationDefinition](observationdefinition.html) that provides \"\n            \"information about this item, including information that might \"\n            \"otherwise be included in the instance of the Questionnaire resource. A\"\n            \" detailed description of the construction of the URI is shown in \"\n            \"[Comments](questionnaire.html#definition), below.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    disabledDisplay: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"disabledDisplay\",\n        title=\"hidden | protected\",\n        description=(\n            \"Indicates if and how items that are disabled (because enableWhen \"\n            \"evaluates to 'false') should be displayed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"hidden\", \"protected\"],\n        },\n    )\n    disabledDisplay__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_disabledDisplay\",\n        title=\"Extension field for ``disabledDisplay``.\",\n    )\n\n    enableBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"enableBehavior\",\n        title=\"all | any\",\n        description=(\n            \"Controls how multiple enableWhen values are interpreted -  whether all\"\n            \" or any must be true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"all\", \"any\"],\n        },\n    )\n    enableBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_enableBehavior\",\n        title=\"Extension field for ``enableBehavior``.\",\n    )\n\n    enableWhen: typing.List[fhirtypes.QuestionnaireItemEnableWhenType] | None = Field(\n        default=None,\n        alias=\"enableWhen\",\n        title=\"Only allow data when\",\n        description=(\n            \"A constraint indicating that this item should only be enabled \"\n            \"(displayed/allow answers to be captured) when the specified condition \"\n            \"is true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    initial: typing.List[fhirtypes.QuestionnaireItemInitialType] | None = Field(\n        default=None,\n        alias=\"initial\",\n        title=\"Initial value(s) when item is first rendered\",\n        description=(\n            \"One or more values that should be pre-populated in the answer when \"\n            \"initially rendering the questionnaire for user input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    item: typing.List[fhirtypes.QuestionnaireItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Nested questionnaire items\",\n        description=(\n            \"Text, questions and other groups to be nested beneath a question or \"\n            \"group.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Unique id for item in questionnaire\",\n        description=(\n            \"An identifier that is unique within the Questionnaire allowing linkage\"\n            \" to the equivalent item in a QuestionnaireResponse resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    maxLength: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"maxLength\",\n        title=\"No more than these many characters\",\n        description=(\n            \"The maximum number of characters that are permitted in the answer to \"\n            'be considered a \"valid\" QuestionnaireResponse.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    maxLength__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_maxLength\", title=\"Extension field for ``maxLength``.\"\n    )\n\n    prefix: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"prefix\",\n        title='E.g. \"1(a)\", \"2.5.3\"',\n        description=(\n            \"A short label for a particular group, question or set of display text \"\n            \"within the questionnaire used for reference by the individual \"\n            \"completing the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_prefix\", title=\"Extension field for ``prefix``.\"\n    )\n\n    readOnly: bool | None = Field(\n        default=None,\n        alias=\"readOnly\",\n        title=\"Don't allow human editing\",\n        description=(\n            \"An indication, when true, that the value cannot be changed by a human \"\n            \"respondent to the Questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    readOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_readOnly\", title=\"Extension field for ``readOnly``.\"\n    )\n\n    repeats: bool | None = Field(\n        default=None,\n        alias=\"repeats\",\n        title=\"Whether the item may repeat\",\n        description=(\n            \"An indication, if true, that a QuestionnaireResponse for this item may\"\n            \" include multiple answers associated with a single instance of this \"\n            \"item (for question-type items) or multiple repetitions of the item \"\n            \"(for group-type items).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    repeats__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_repeats\", title=\"Extension field for ``repeats``.\"\n    )\n\n    required: bool | None = Field(\n        default=None,\n        alias=\"required\",\n        title=\"Whether the item must be included in data results\",\n        description=(\n            'An indication, if true, that the item must be present in a \"completed\"'\n            \" QuestionnaireResponse.  If false, the item may be skipped when \"\n            \"answering the questionnaire.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_required\", title=\"Extension field for ``required``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Primary text for the item\",\n        description=(\n            \"The name of a section, the text of a question or text content for a \"\n            \"display item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"group | display | boolean | decimal | integer | date | dateTime +\",\n        description=(\n            \"The type of questionnaire item this is - whether text for display, a \"\n            \"grouping of other items or a particular type of data to be captured \"\n            \"(string, integer, Coding, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"group\",\n                \"display\",\n                \"boolean\",\n                \"decimal\",\n                \"integer\",\n                \"date\",\n                \"dateTime\",\n                \"+\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"definition\",\n            \"code\",\n            \"prefix\",\n            \"text\",\n            \"type\",\n            \"enableWhen\",\n            \"enableBehavior\",\n            \"disabledDisplay\",\n            \"required\",\n            \"repeats\",\n            \"readOnly\",\n            \"maxLength\",\n            \"answerConstraint\",\n            \"answerValueSet\",\n            \"answerOption\",\n            \"initial\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"linkId\", \"linkId__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass QuestionnaireItemAnswerOption(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Permitted answer.\n    One of the permitted answers for the question.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireItemAnswerOption\"\n\n    initialSelected: bool | None = Field(\n        default=None,\n        alias=\"initialSelected\",\n        title=\"Whether option is selected by default\",\n        description=(\n            \"Indicates whether the answer value is selected when the list of \"\n            \"possible answers is initially shown.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    initialSelected__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_initialSelected\",\n        title=\"Extension field for ``initialSelected``.\",\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Answer value\",\n        description=\"A potential answer that's allowed as the answer to this question.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireItemAnswerOption`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueInteger\",\n            \"valueDate\",\n            \"valueTime\",\n            \"valueString\",\n            \"valueCoding\",\n            \"valueReference\",\n            \"initialSelected\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireItemAnswerOption`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueCoding\",\n                \"valueDate\",\n                \"valueInteger\",\n                \"valueReference\",\n                \"valueString\",\n                \"valueTime\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass QuestionnaireItemEnableWhen(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Only allow data when.\n    A constraint indicating that this item should only be enabled\n    (displayed/allow answers to be captured) when the specified condition is\n    true.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireItemEnableWhen\"\n\n    answerBoolean: bool | None = Field(\n        default=None,\n        alias=\"answerBoolean\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.  If there are multiple \"\n            \"answers, a match on any of the answers suffices.  If different \"\n            \"behavior is desired (all must match, at least 2 must match, etc.), \"\n            \"consider using the enableWhenExpression extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerBoolean\",\n        title=\"Extension field for ``answerBoolean``.\",\n    )\n\n    answerCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"answerCoding\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.  If there are multiple \"\n            \"answers, a match on any of the answers suffices.  If different \"\n            \"behavior is desired (all must match, at least 2 must match, etc.), \"\n            \"consider using the enableWhenExpression extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    answerDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"answerDate\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.  If there are multiple \"\n            \"answers, a match on any of the answers suffices.  If different \"\n            \"behavior is desired (all must match, at least 2 must match, etc.), \"\n            \"consider using the enableWhenExpression extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_answerDate\", title=\"Extension field for ``answerDate``.\"\n    )\n\n    answerDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"answerDateTime\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.  If there are multiple \"\n            \"answers, a match on any of the answers suffices.  If different \"\n            \"behavior is desired (all must match, at least 2 must match, etc.), \"\n            \"consider using the enableWhenExpression extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerDateTime\",\n        title=\"Extension field for ``answerDateTime``.\",\n    )\n\n    answerDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"answerDecimal\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.  If there are multiple \"\n            \"answers, a match on any of the answers suffices.  If different \"\n            \"behavior is desired (all must match, at least 2 must match, etc.), \"\n            \"consider using the enableWhenExpression extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerDecimal\",\n        title=\"Extension field for ``answerDecimal``.\",\n    )\n\n    answerInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"answerInteger\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.  If there are multiple \"\n            \"answers, a match on any of the answers suffices.  If different \"\n            \"behavior is desired (all must match, at least 2 must match, etc.), \"\n            \"consider using the enableWhenExpression extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerInteger\",\n        title=\"Extension field for ``answerInteger``.\",\n    )\n\n    answerQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"answerQuantity\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.  If there are multiple \"\n            \"answers, a match on any of the answers suffices.  If different \"\n            \"behavior is desired (all must match, at least 2 must match, etc.), \"\n            \"consider using the enableWhenExpression extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    answerReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"answerReference\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.  If there are multiple \"\n            \"answers, a match on any of the answers suffices.  If different \"\n            \"behavior is desired (all must match, at least 2 must match, etc.), \"\n            \"consider using the enableWhenExpression extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    answerString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"answerString\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.  If there are multiple \"\n            \"answers, a match on any of the answers suffices.  If different \"\n            \"behavior is desired (all must match, at least 2 must match, etc.), \"\n            \"consider using the enableWhenExpression extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_answerString\",\n        title=\"Extension field for ``answerString``.\",\n    )\n\n    answerTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"answerTime\",\n        title=\"Value for question comparison based on operator\",\n        description=(\n            \"A value that the referenced question is tested using the specified \"\n            \"operator in order for the item to be enabled.  If there are multiple \"\n            \"answers, a match on any of the answers suffices.  If different \"\n            \"behavior is desired (all must match, at least 2 must match, etc.), \"\n            \"consider using the enableWhenExpression extension.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e answer[x]\n            \"one_of_many\": \"answer\",\n            \"one_of_many_required\": True,\n        },\n    )\n    answerTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_answerTime\", title=\"Extension field for ``answerTime``.\"\n    )\n\n    operator: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"operator\",\n        title=\"exists | = | != | > | < | >= | <=\",\n        description=\"Specifies the criteria by which the question is enabled.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"exists\",\n                \"=\",\n                \"!=\",\n                \"\\u003e\",\n                \"\\u003c\",\n                \"\\u003e=\",\n                \"\\u003c=\",\n            ],\n        },\n    )\n    operator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_operator\", title=\"Extension field for ``operator``.\"\n    )\n\n    question: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"question\",\n        title=(\n            \"The linkId of question that determines whether item is \" \"enabled/disabled\"\n        ),\n        description=(\n            \"The linkId for the question whose answer (or lack of answer) governs \"\n            \"whether this item is enabled.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    question__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_question\", title=\"Extension field for ``question``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireItemEnableWhen`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"question\",\n            \"operator\",\n            \"answerBoolean\",\n            \"answerDecimal\",\n            \"answerInteger\",\n            \"answerDate\",\n            \"answerDateTime\",\n            \"answerTime\",\n            \"answerString\",\n            \"answerCoding\",\n            \"answerQuantity\",\n            \"answerReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireItemEnableWhen`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"operator\", \"operator__ext\"), (\"question\", \"question__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"answer\": [\n                \"answerBoolean\",\n                \"answerCoding\",\n                \"answerDate\",\n                \"answerDateTime\",\n                \"answerDecimal\",\n                \"answerInteger\",\n                \"answerQuantity\",\n                \"answerReference\",\n                \"answerString\",\n                \"answerTime\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass QuestionnaireItemInitial(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Initial value(s) when item is first rendered.\n    One or more values that should be pre-populated in the answer when\n    initially rendering the questionnaire for user input.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireItemInitial\"\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Actual value for initializing the question\",\n        description=\"The actual value to for an initial answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireItemInitial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueBoolean\",\n            \"valueDecimal\",\n            \"valueInteger\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueTime\",\n            \"valueString\",\n            \"valueUri\",\n            \"valueAttachment\",\n            \"valueCoding\",\n            \"valueQuantity\",\n            \"valueReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireItemInitial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCoding\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/questionnaireresponse.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass QuestionnaireResponse(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A structured set of questions and their answers.\n    A structured set of questions and their answers. The questions are ordered\n    and grouped into coherent subsets, corresponding to the structure of the\n    grouping of the questionnaire being responded to.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireResponse\"\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"The individual or device that received and recorded the answers\",\n        description=(\n            \"The individual or device that received the answers to the questions in\"\n            \" the QuestionnaireResponse and recorded them in the system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    authored: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authored\",\n        title=\"Date the answers were gathered\",\n        description=(\n            \"The date and/or time that this questionnaire response was last \"\n            \"modified by the user - e.g. changing answers or revising status.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authored__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authored\", title=\"Extension field for ``authored``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this QuestionnaireResponse\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this questionnaire response.  For example, a ServiceRequest seeking an\"\n            \" intake assessment or a decision support recommendation to assess for \"\n            \"post-partum depression.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\", \"ServiceRequest\"],\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter the questionnaire response is part of\",\n        description=(\n            \"The Encounter during which this questionnaire response was created or \"\n            \"to which the creation of this record is tightly associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for this set of answers\",\n        description=(\n            \"Business identifiers assigned to this questionnaire response by the \"\n            \"performer and/or other systems.  These identifiers remain constant as \"\n            \"the resource is updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Groups and questions\",\n        description=(\n            \"A group or question item from the original questionnaire for which \"\n            \"answers are provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=(\n            \"A procedure or observation that this questionnaire was performed as \"\n            \"part of the execution of.  For example, the surgery a checklist was \"\n            \"executed as part of.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Observation\", \"Procedure\"],\n        },\n    )\n\n    questionnaire: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"questionnaire\",\n        title=\"Canonical URL of Questionnaire being answered\",\n        description=(\n            \"The Questionnaire that defines and organizes the questions for which \"\n            \"answers are being provided.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Questionnaire\"],\n        },\n    )\n    questionnaire__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_questionnaire\",\n        title=\"Extension field for ``questionnaire``.\",\n    )\n\n    source: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"The individual or device that answered the questions\",\n        description=(\n            \"The individual or device that answered the questions about the \" \"subject.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"in-progress | completed | amended | entered-in-error | stopped\",\n        description=\"The current state of the questionnaire response.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"in-progress\",\n                \"completed\",\n                \"amended\",\n                \"entered-in-error\",\n                \"stopped\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"The subject of the questions\",\n        description=(\n            \"The subject of the questionnaire response.  This could be a patient, \"\n            \"organization, practitioner, device, etc.  This is who/what the answers\"\n            \" apply to, but is not necessarily the source of information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"questionnaire\",\n            \"status\",\n            \"subject\",\n            \"encounter\",\n            \"authored\",\n            \"author\",\n            \"source\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireResponse`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"questionnaire\",\n            \"status\",\n            \"subject\",\n            \"encounter\",\n            \"authored\",\n            \"author\",\n            \"source\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"questionnaire\", \"questionnaire__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass QuestionnaireResponseItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Groups and questions.\n    A group or question item from the original questionnaire for which answers\n    are provided.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireResponseItem\"\n\n    answer: typing.List[fhirtypes.QuestionnaireResponseItemAnswerType] | None = Field(\n        default=None,\n        alias=\"answer\",\n        title=\"The response(s) to the question\",\n        description=\"The respondent's answer(s) to the question.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definition: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"ElementDefinition - details for the item\",\n        description=(\n            \"A reference to an [ElementDefinition](elementdefinition.html) that \"\n            \"provides the details for the item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Child items of group item\",\n        description=\"Sub-questions, sub-groups or display items nested beneath a group.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific item from Questionnaire\",\n        description=(\n            \"The item from the Questionnaire that corresponds to this item in the \"\n            \"QuestionnaireResponse resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    text: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"text\",\n        title=\"Name for group or question text\",\n        description=(\n            \"Text that is displayed above the contents of the group or as the text \"\n            \"of the question being answered.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    text__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_text\", title=\"Extension field for ``text``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireResponseItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"definition\",\n            \"text\",\n            \"answer\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireResponseItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"linkId\", \"linkId__ext\")]\n        return required_fields\n\n\nclass QuestionnaireResponseItemAnswer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The response(s) to the question.\n    The respondent's answer(s) to the question.\n    \"\"\"\n\n    __resource_type__ = \"QuestionnaireResponseItemAnswer\"\n\n    item: typing.List[fhirtypes.QuestionnaireResponseItemType] | None = Field(\n        default=None,\n        alias=\"item\",\n        title=\"Child items of question\",\n        description=\"Nested groups and/or questions found within this particular answer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Single-valued answer to the question\",\n        description=(\n            \"The answer (or one of the answers) provided by the respondent to the \"\n            \"question.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``QuestionnaireResponseItemAnswer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueBoolean\",\n            \"valueDecimal\",\n            \"valueInteger\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueTime\",\n            \"valueString\",\n            \"valueUri\",\n            \"valueAttachment\",\n            \"valueCoding\",\n            \"valueQuantity\",\n            \"valueReference\",\n            \"item\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``QuestionnaireResponseItemAnswer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCoding\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueQuantity\",\n                \"valueReference\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/range.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Range\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Range(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Set of values bounded by low and high.\n    A set of ordered Quantities defined by a low and high limit.\n    \"\"\"\n\n    __resource_type__ = \"Range\"\n\n    high: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"high\",\n        title=\"High limit\",\n        description=\"The high limit. The boundary is inclusive.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    low: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"low\",\n        title=\"Low limit\",\n        description=\"The low limit. The boundary is inclusive.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Range`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"low\", \"high\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Range`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"low\", \"high\"]\n"
  },
  {
    "path": "fhir/resources/ratio.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Ratio\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Ratio(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A ratio of two Quantity values - a numerator and a denominator.\n    A relationship of two Quantity values - expressed as a numerator and a\n    denominator.\n    \"\"\"\n\n    __resource_type__ = \"Ratio\"\n\n    denominator: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"denominator\",\n        title=\"Denominator value\",\n        description=\"The value of the denominator.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    numerator: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"numerator\",\n        title=\"Numerator value\",\n        description=\"The value of the numerator.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Ratio`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"numerator\", \"denominator\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Ratio`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"numerator\", \"denominator\"]\n"
  },
  {
    "path": "fhir/resources/ratiorange.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RatioRange\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass RatioRange(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Range of ratio values.\n    A range of ratios expressed as a low and high numerator and a denominator.\n    \"\"\"\n\n    __resource_type__ = \"RatioRange\"\n\n    denominator: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"denominator\",\n        title=\"Denominator value\",\n        description=\"The value of the denominator.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    highNumerator: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"highNumerator\",\n        title=\"High Numerator limit\",\n        description=\"The value of the high limit numerator.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lowNumerator: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"lowNumerator\",\n        title=\"Low Numerator limit\",\n        description=\"The value of the low limit numerator.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RatioRange`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"lowNumerator\", \"highNumerator\", \"denominator\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RatioRange`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"lowNumerator\", \"highNumerator\", \"denominator\"]\n"
  },
  {
    "path": "fhir/resources/reference.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Reference\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Reference(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A reference from one resource to another.\n    \"\"\"\n\n    __resource_type__ = \"Reference\"\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Text alternative for the resource\",\n        description=(\n            \"Plain text narrative that identifies the resource in addition to the \"\n            \"resource reference.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Logical reference, when literal reference is not known\",\n        description=(\n            \"An identifier for the target resource. This is used when there is no \"\n            \"way to reference the other resource directly, either because the \"\n            \"entity it represents is not available through a FHIR server, or \"\n            \"because there is no way for the author of the resource to convert a \"\n            \"known identifier to an actual location. There is no requirement that a\"\n            \" Reference.identifier point to something that is actually exposed as a\"\n            \" FHIR instance, but it SHALL point to a business concept that would be\"\n            \" expected to be exposed as a FHIR instance, and that instance would \"\n            \"need to be of a FHIR resource type allowed by the reference.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reference: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Literal reference, Relative, internal or absolute URL\",\n        description=(\n            \"A reference to a location at which the other resource is found. The \"\n            \"reference may be a relative reference, in which case it is relative to\"\n            \" the service base URL, or an absolute URL that resolves to the \"\n            \"location where the resource is found. The reference may be version \"\n            \"specific or not. If the reference is not to a FHIR RESTful server, \"\n            \"then it should be assumed to be version specific. Internal fragment \"\n            \"references (start with '#') refer to contained resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    reference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    type: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            'Type the reference refers to (e.g. \"Patient\") - must be a resource in '\n            \"resources\"\n        ),\n        description=(\n            \"The expected type of the target of the reference. If both \"\n            \"Reference.type and Reference.reference are populated and \"\n            \"Reference.reference is a FHIR URL, both SHALL be consistent.  The type\"\n            \" is the Canonical URL of Resource Definition that is the type this \"\n            \"reference refers to. References are URLs that are relative to \"\n            'http://hl7.org/fhir/StructureDefinition/ e.g. \"Patient\" is a reference'\n            \" to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are\"\n            \" only allowed for logical models (and can only be used in references \"\n            \"in logical models, not resources).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Reference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"reference\", \"type\", \"identifier\", \"display\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Reference`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"reference\", \"type\", \"identifier\", \"display\"]\n"
  },
  {
    "path": "fhir/resources/regulatedauthorization.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RegulatedAuthorization\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass RegulatedAuthorization(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Regulatory approval, clearance or licencing related to a regulated product,\n    treatment, facility or activity e.g. Market Authorization for a Medicinal\n    Product.\n    Regulatory approval, clearance or licencing related to a regulated product,\n    treatment, facility or activity that is cited in a guidance, regulation,\n    rule or legislative act. An example is Market Authorization relating to a\n    Medicinal Product.\n    \"\"\"\n\n    __resource_type__ = \"RegulatedAuthorization\"\n\n    attachedDocument: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"attachedDocument\",\n        title=(\n            \"Additional information or supporting documentation about the \"\n            \"authorization\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    basis: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"basis\",\n        title=(\n            \"The legal/regulatory framework or reasons under which this \"\n            \"authorization is granted\"\n        ),\n        description=(\n            \"The legal or regulatory framework against which this authorization is \"\n            \"granted, or other reasons for it.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    case: fhirtypes.RegulatedAuthorizationCaseType | None = Field(\n        default=None,\n        alias=\"case\",\n        title=(\n            \"The case or regulatory procedure for granting or amending a regulated \"\n            \"authorization. Note: This area is subject to ongoing review and the \"\n            \"workgroup is seeking implementer feedback on its use (see link at \"\n            \"bottom of page)\"\n        ),\n        description=(\n            \"The case or regulatory procedure for granting or amending a regulated \"\n            \"authorization. An authorization is granted in response to \"\n            \"submissions/applications by those seeking authorization. A case is the\"\n            \" administrative process that deals with the application(s) that relate\"\n            \" to this and assesses them. Note: This area is subject to ongoing \"\n            \"review and the workgroup is seeking implementer feedback on its use \"\n            \"(see link at bottom of page).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"General textual supporting information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    holder: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"holder\",\n        title=(\n            \"The organization that has been granted this authorization, by the \"\n            \"regulator\"\n        ),\n        description=(\n            \"The organization that has been granted this authorization, by some \"\n            \"authoritative body (the 'regulator').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"Business identifier for the authorization, typically assigned by the \"\n            \"authorizing body\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    indication: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"indication\",\n        title=\"Condition for which the use of the regulated product applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ClinicalUseDefinition\"],\n        },\n    )\n\n    intendedUse: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"intendedUse\",\n        title=\"The intended use of the product, e.g. prevention, treatment\",\n        description=(\n            \"The intended use of the product, e.g. prevention, treatment, \" \"diagnosis.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    region: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"region\",\n        title=\"The territory in which the authorization has been granted\",\n        description=(\n            \"The territory (e.g., country, jurisdiction etc.) in which the \"\n            \"authorization has been granted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    regulator: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"regulator\",\n        title=(\n            \"The regulatory authority or authorizing body granting the \" \"authorization\"\n        ),\n        description=(\n            \"The regulatory authority or authorizing body granting the \"\n            \"authorization. For example, European Medicines Agency (EMA), Food and \"\n            \"Drug Administration (FDA), Health Canada (HC), etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"The status that is authorised e.g. approved. Intermediate states can \"\n            \"be tracked with cases and applications\"\n        ),\n        description=(\n            \"The status that is authorised e.g. approved. Intermediate states and \"\n            \"actions can be tracked with cases and applications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    statusDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"The date at which the current status was assigned\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    subject: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=(\n            \"The product type, treatment, facility or activity that is being \"\n            \"authorized\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"MedicinalProductDefinition\",\n                \"BiologicallyDerivedProduct\",\n                \"NutritionProduct\",\n                \"PackagedProductDefinition\",\n                \"ManufacturedItemDefinition\",\n                \"Ingredient\",\n                \"SubstanceDefinition\",\n                \"DeviceDefinition\",\n                \"ResearchStudy\",\n                \"ActivityDefinition\",\n                \"PlanDefinition\",\n                \"ObservationDefinition\",\n                \"Practitioner\",\n                \"Organization\",\n                \"Location\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Overall type of this authorization, for example drug marketing \"\n            \"approval, orphan drug designation\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    validityPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"validityPeriod\",\n        title=(\n            \"The time period in which the regulatory approval etc. is in effect, \"\n            \"e.g. a Marketing Authorization includes the date of authorization \"\n            \"and/or expiration date\"\n        ),\n        description=(\n            \"The time period in which the regulatory approval, clearance or \"\n            \"licencing is in effect. As an example, a Marketing Authorization \"\n            \"includes the date of authorization and/or an expiration date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RegulatedAuthorization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"subject\",\n            \"type\",\n            \"description\",\n            \"region\",\n            \"status\",\n            \"statusDate\",\n            \"validityPeriod\",\n            \"indication\",\n            \"intendedUse\",\n            \"basis\",\n            \"holder\",\n            \"regulator\",\n            \"attachedDocument\",\n            \"case\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RegulatedAuthorization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"subject\",\n            \"type\",\n            \"description\",\n            \"region\",\n            \"status\",\n            \"statusDate\",\n            \"validityPeriod\",\n            \"indication\",\n            \"intendedUse\",\n            \"basis\",\n            \"holder\",\n            \"regulator\",\n            \"attachedDocument\",\n            \"case\",\n        ]\n\n\nclass RegulatedAuthorizationCase(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The case or regulatory procedure for granting or amending a regulated\n    authorization. Note: This area is subject to ongoing review and the\n    workgroup is seeking implementer feedback on its use (see link at bottom of\n    page).\n    The case or regulatory procedure for granting or amending a regulated\n    authorization. An authorization is granted in response to\n    submissions/applications by those seeking authorization. A case is the\n    administrative process that deals with the application(s) that relate to\n    this and assesses them. Note: This area is subject to ongoing review and\n    the workgroup is seeking implementer feedback on its use (see link at\n    bottom of page).\n    \"\"\"\n\n    __resource_type__ = \"RegulatedAuthorizationCase\"\n\n    application: typing.List[fhirtypes.RegulatedAuthorizationCaseType] | None = Field(\n        default=None,\n        alias=\"application\",\n        title=(\n            \"Applications submitted to obtain a regulated authorization. Steps \"\n            \"within the longer running case or procedure\"\n        ),\n        description=(\n            \"A regulatory submission from an organization to a regulator, as part \"\n            \"of an assessing case. Multiple applications may occur over time, with \"\n            \"more or different information to support or modify the submission or \"\n            \"the authorization. The applications can be considered as steps within \"\n            \"the longer running case or procedure for this authorization process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    dateDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateDateTime\",\n        title=\"Relevant date for this case\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e date[x]\n            \"one_of_many\": \"date\",\n            \"one_of_many_required\": False,\n        },\n    )\n    dateDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_dateDateTime\",\n        title=\"Extension field for ``dateDateTime``.\",\n    )\n\n    datePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"datePeriod\",\n        title=\"Relevant date for this case\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e date[x]\n            \"one_of_many\": \"date\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier by which this case can be referenced\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"The status associated with the case\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The defining type of case\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RegulatedAuthorizationCase`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"status\",\n            \"datePeriod\",\n            \"dateDateTime\",\n            \"application\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RegulatedAuthorizationCase`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"identifier\",\n            \"type\",\n            \"status\",\n            \"datePeriod\",\n            \"dateDateTime\",\n            \"application\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"date\": [\"dateDateTime\", \"datePeriod\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/relatedartifact.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RelatedArtifact\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass RelatedArtifact(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Related artifacts for a knowledge resource.\n    Related artifacts such as additional documentation, justification, or\n    bibliographic references.\n    \"\"\"\n\n    __resource_type__ = \"RelatedArtifact\"\n\n    citation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"citation\",\n        title=\"Bibliographic citation for the artifact\",\n        description=(\n            \"A bibliographic citation for the related artifact. This text SHOULD be\"\n            \" formatted according to an accepted citation format.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    citation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_citation\", title=\"Extension field for ``citation``.\"\n    )\n\n    classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classifier\",\n        title=\"Additional classifiers\",\n        description=\"Provides additional classifiers of the related artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Brief description of the related artifact\",\n        description=(\n            \"A brief description of the document or knowledge resource being \"\n            \"referenced, suitable for display to a consumer.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    document: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"document\",\n        title=\"What document is being referenced\",\n        description=(\n            \"The document being referenced, represented as an attachment. This is \"\n            \"exclusive with the resource element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Short label\",\n        description=(\n            \"A short label that can be used to reference the citation from \"\n            \"elsewhere in the containing artifact, such as a footnote index.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    publicationDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"publicationDate\",\n        title=\"Date of publication of the artifact being referred to\",\n        description=\"The date of publication of the artifact being referred to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publicationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_publicationDate\",\n        title=\"Extension field for ``publicationDate``.\",\n    )\n\n    publicationStatus: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"publicationStatus\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The publication status of the artifact being referred to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    publicationStatus__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_publicationStatus\",\n        title=\"Extension field for ``publicationStatus``.\",\n    )\n\n    resource: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"What artifact is being referenced\",\n        description=(\n            \"The related artifact, such as a library, value set, profile, or other \"\n            \"knowledge resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    resourceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"resourceReference\",\n        title=\"What artifact, if not a conformance resource\",\n        description=(\n            \"The related artifact, if the artifact is not a canonical resource, or \"\n            \"a resource reference to a canonical resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"documentation | justification | citation | predecessor | successor | \"\n            \"derived-from | depends-on | composed-of | part-of | amends | amended-\"\n            \"with | appends | appended-with | cites | cited-by | comments-on | \"\n            \"comment-in | contains | contained-in | corrects | correction-in | \"\n            \"replaces | replaced-with | retracts | retracted-by | signs | similar-\"\n            \"to | supports | supported-with | transforms | transformed-into | \"\n            \"transformed-with | documents | specification-of | created-with | cite-\"\n            \"as\"\n        ),\n        description=\"The type of relationship to the related artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"documentation\",\n                \"justification\",\n                \"citation\",\n                \"predecessor\",\n                \"successor\",\n                \"derived-from\",\n                \"depends-on\",\n                \"composed-of\",\n                \"part-of\",\n                \"amends\",\n                \"amended-with\",\n                \"appends\",\n                \"appended-with\",\n                \"cites\",\n                \"cited-by\",\n                \"comments-on\",\n                \"comment-in\",\n                \"contains\",\n                \"contained-in\",\n                \"corrects\",\n                \"correction-in\",\n                \"replaces\",\n                \"replaced-with\",\n                \"retracts\",\n                \"retracted-by\",\n                \"signs\",\n                \"similar-to\",\n                \"supports\",\n                \"supported-with\",\n                \"transforms\",\n                \"transformed-into\",\n                \"transformed-with\",\n                \"documents\",\n                \"specification-of\",\n                \"created-with\",\n                \"cite-as\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RelatedArtifact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"classifier\",\n            \"label\",\n            \"display\",\n            \"citation\",\n            \"document\",\n            \"resource\",\n            \"resourceReference\",\n            \"publicationStatus\",\n            \"publicationDate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RelatedArtifact`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"type\",\n            \"classifier\",\n            \"label\",\n            \"display\",\n            \"citation\",\n            \"document\",\n            \"resource\",\n            \"resourceReference\",\n            \"publicationStatus\",\n            \"publicationDate\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/relatedperson.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RelatedPerson\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass RelatedPerson(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A person that is related to a patient, but who is not a direct target of\n    care.\n    Information about a person that is involved in a patient's health or the\n    care for a patient, but who is not the target of healthcare, nor has a\n    formal responsibility in the care process.\n    \"\"\"\n\n    __resource_type__ = \"RelatedPerson\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this related person's record is in active use\",\n        description=\"Whether this related person record is in active use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    address: typing.List[fhirtypes.AddressType] | None = Field(\n        default=None,\n        alias=\"address\",\n        title=\"Address where the related person can be contacted or visited\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    birthDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"birthDate\",\n        title=\"The date on which the related person was born\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    birthDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_birthDate\", title=\"Extension field for ``birthDate``.\"\n    )\n\n    communication: typing.List[fhirtypes.RelatedPersonCommunicationType] | None = Field(\n        default=None,\n        alias=\"communication\",\n        title=(\n            \"A language which may be used to communicate with the related person \"\n            \"about the patient's health\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    gender: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"gender\",\n        title=\"male | female | other | unknown\",\n        description=(\n            \"Administrative Gender - the gender that the person is considered to \"\n            \"have for administration and record keeping purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"male\", \"female\", \"other\", \"unknown\"],\n        },\n    )\n    gender__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_gender\", title=\"Extension field for ``gender``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"A human identifier for this person\",\n        description=\"Identifier for a person within a particular scope.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: typing.List[fhirtypes.HumanNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name associated with the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"The patient this person is related to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Period of time that this relationship is considered valid\",\n        description=(\n            \"The period of time during which this relationship is or was active. If\"\n            \" there are no dates defined, then the interval is unknown.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    photo: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"photo\",\n        title=\"Image of the person\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relationship: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"The relationship of the related person to the patient\",\n        description=(\n            \"The nature of the relationship between the related person and the \"\n            \"patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    telecom: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"telecom\",\n        title=\"A contact detail for the person\",\n        description=(\n            \"A contact detail for the person, e.g. a telephone number or an email \"\n            \"address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RelatedPerson`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"patient\",\n            \"relationship\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"address\",\n            \"photo\",\n            \"period\",\n            \"communication\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RelatedPerson`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"patient\",\n            \"relationship\",\n            \"name\",\n            \"telecom\",\n            \"gender\",\n            \"birthDate\",\n            \"address\",\n        ]\n\n\nclass RelatedPersonCommunication(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A language which may be used to communicate with the related person about\n    the patient's health.\n    \"\"\"\n\n    __resource_type__ = \"RelatedPersonCommunication\"\n\n    language: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"language\",\n        title=(\n            \"The language which can be used to communicate with the related person \"\n            \"about the patient's health\"\n        ),\n        description=(\n            \"The ISO-639-1 alpha 2 code in lower case for the language, optionally \"\n            \"followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in\"\n            ' upper case; e.g. \"en\" for English, or \"en-US\" for American English '\n            'versus \"en-AU\" for Australian English.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    preferred: bool | None = Field(\n        default=None,\n        alias=\"preferred\",\n        title=\"Language preference indicator\",\n        description=(\n            \"Indicates whether or not the related person prefers this language \"\n            \"(over other languages he or she masters up a certain level).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preferred\", title=\"Extension field for ``preferred``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RelatedPersonCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"language\", \"preferred\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RelatedPersonCommunication`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/requestorchestration.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RequestOrchestration\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass RequestOrchestration(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of related requests.\n    A set of related requests that can be used to capture intended activities\n    that have inter-dependencies such as \"give this medication after that one\".\n    \"\"\"\n\n    __resource_type__ = \"RequestOrchestration\"\n\n    action: typing.List[fhirtypes.RequestOrchestrationActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Proposed actions, if any\",\n        description=\"The actions, if any, produced by the evaluation of the artifact.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    author: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Device or practitioner that authored the request orchestration\",\n        description=\"Provides a reference to the author of the request orchestration.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\", \"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When the request orchestration was authored\",\n        description=\"Indicates when the request orchestration was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan, proposal, or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"What's being requested/ordered\",\n        description=\"A code that identifies what the overall request orchestration is.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Created as part of\",\n        description=\"Describes the context of the request orchestration, if any.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    goal: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"goal\",\n        title=\"What goals\",\n        description=(\n            \"Goals that are intended to be achieved by following the requests in \"\n            \"this RequestOrchestration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Goal\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Composite request this is part of\",\n        description=(\n            \"A shared identifier common to multiple independent Request instances \"\n            \"that were activated/authorized more or less simultaneously by a single\"\n            \" author.  The presence of the same identifier on each request ties \"\n            \"those requests together and may have business ramifications in terms \"\n            \"of reporting of results, billing, etc.  E.g. a requisition number \"\n            \"shared by a set of lab tests ordered together, or a prescription \"\n            \"number shared by all meds ordered at one time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=(\n            \"Allows a service to provide a unique, business identifier for the \"\n            \"request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"A canonical URL referencing a FHIR-defined protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"A URL referencing an externally defined protocol, guideline, orderset \"\n            \"or other definition that is adhered to in whole or in part by this \"\n            \"request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"proposal | plan | directive | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            \"Indicates the level of authority/intentionality associated with the \"\n            \"request and where the request fits into the workflow chain.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"proposal\",\n                \"plan\",\n                \"directive\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Additional notes about the response\",\n        description=(\n            \"Provides a mechanism to communicate additional information about the \"\n            \"response.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the request should be addressed with respect to \"\n            \"other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why the request orchestration is needed\",\n        description=(\n            \"Describes the reason for the request orchestration in coded or textual\"\n            \" form.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"Request(s) replaced by this request\",\n        description=(\n            \"Completed or terminated request(s) whose function is taken by this new\"\n            \" request.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | on-hold | revoked | completed | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=(\n            \"The current state of the request. For request orchestrations, the \"\n            \"status reflects the status of all the requests in the orchestration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"on-hold\",\n                \"revoked\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=\"Who the request orchestration is about\",\n        description=\"The subject for which the request orchestration was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"Device\",\n                \"Group\",\n                \"HealthcareService\",\n                \"Location\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestOrchestration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"replaces\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"authoredOn\",\n            \"author\",\n            \"reason\",\n            \"goal\",\n            \"note\",\n            \"action\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestOrchestration`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"groupIdentifier\",\n            \"status\",\n            \"intent\",\n            \"priority\",\n            \"code\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass RequestOrchestrationAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Proposed actions, if any.\n    The actions, if any, produced by the evaluation of the artifact.\n    \"\"\"\n\n    __resource_type__ = \"RequestOrchestrationAction\"\n\n    action: typing.List[fhirtypes.RequestOrchestrationActionType] | None = Field(\n        default=None,\n        alias=\"action\",\n        title=\"Sub action\",\n        description=\"Sub actions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    cardinalityBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"cardinalityBehavior\",\n        title=\"single | multiple\",\n        description=\"Defines whether the action can be selected multiple times.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"single\", \"multiple\"],\n        },\n    )\n    cardinalityBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_cardinalityBehavior\",\n        title=\"Extension field for ``cardinalityBehavior``.\",\n    )\n\n    code: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code representing the meaning of the action or sub-actions\",\n        description=(\n            \"A code that provides meaning for the action or action group. For \"\n            \"example, a section may have a LOINC code for a section of a \"\n            \"documentation template.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    condition: typing.List[\n        fhirtypes.RequestOrchestrationActionConditionType\n    ] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Whether or not the action is applicable\",\n        description=(\n            \"An expression that describes applicability criteria, or start/stop \"\n            \"conditions for the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    definitionCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definitionCanonical\",\n        title=\"Description of the activity to be performed\",\n        description=(\n            \"A reference to an ActivityDefinition that describes the action to be \"\n            \"taken in detail, a PlanDefinition that describes a series of actions \"\n            \"to be taken, a Questionnaire that should be filled out, a \"\n            \"SpecimenDefinition describing a specimen to be collected, or an \"\n            \"ObservationDefinition that specifies what observation should be \"\n            \"captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"ActivityDefinition\",\n                \"ObservationDefinition\",\n                \"PlanDefinition\",\n                \"Questionnaire\",\n                \"SpecimenDefinition\",\n            ],\n        },\n    )\n    definitionCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_definitionCanonical\",\n        title=\"Extension field for ``definitionCanonical``.\",\n    )\n\n    definitionUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"definitionUri\",\n        title=\"Description of the activity to be performed\",\n        description=(\n            \"A reference to an ActivityDefinition that describes the action to be \"\n            \"taken in detail, a PlanDefinition that describes a series of actions \"\n            \"to be taken, a Questionnaire that should be filled out, a \"\n            \"SpecimenDefinition describing a specimen to be collected, or an \"\n            \"ObservationDefinition that specifies what observation should be \"\n            \"captured.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e definition[x]\n            \"one_of_many\": \"definition\",\n            \"one_of_many_required\": False,\n        },\n    )\n    definitionUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_definitionUri\",\n        title=\"Extension field for ``definitionUri``.\",\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Short description of the action\",\n        description=(\n            \"A short description of the action used to provide a summary to display\"\n            \" to the user.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    documentation: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Supporting documentation for the intended performer of the action\",\n        description=(\n            \"Didactic or other informational resources associated with the action \"\n            \"that can be provided to the CDS recipient. Information resources can \"\n            \"include inline text commentary and links to web resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dynamicValue: typing.List[\n        fhirtypes.RequestOrchestrationActionDynamicValueType\n    ] | None = Field(\n        default=None,\n        alias=\"dynamicValue\",\n        title=\"Dynamic aspects of the definition\",\n        description=(\n            \"Customizations that should be applied to the statically defined \"\n            \"resource. For example, if the dosage of a medication must be computed \"\n            \"based on the patient's weight, a customization would be used to \"\n            \"specify an expression that calculated the weight, and the path on the \"\n            \"resource that would contain the result.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    goal: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"goal\",\n        title=\"What goals\",\n        description=(\n            \"Goals that are intended to be achieved by following the requests in \"\n            \"this action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Goal\"],\n        },\n    )\n\n    groupingBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"groupingBehavior\",\n        title=\"visual-group | logical-group | sentence-group\",\n        description=\"Defines the grouping behavior for the action and its children.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"visual-group\", \"logical-group\", \"sentence-group\"],\n        },\n    )\n    groupingBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_groupingBehavior\",\n        title=\"Extension field for ``groupingBehavior``.\",\n    )\n\n    input: typing.List[fhirtypes.RequestOrchestrationActionInputType] | None = Field(\n        default=None,\n        alias=\"input\",\n        title=\"Input data requirements\",\n        description=\"Defines input data requirements for the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    linkId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=\"Pointer to specific item from the PlanDefinition\",\n        description=(\n            \"The linkId of the action from the PlanDefinition that corresponds to \"\n            \"this action in the RequestOrchestration resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    location: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where it should happen\",\n        description=(\n            \"Identifies the facility where the action will occur; e.g. home, \"\n            \"hospital, specific clinic, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    output: typing.List[fhirtypes.RequestOrchestrationActionOutputType] | None = Field(\n        default=None,\n        alias=\"output\",\n        title=\"Output data definition\",\n        description=\"Defines the outputs of the action, if any.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    participant: typing.List[\n        fhirtypes.RequestOrchestrationActionParticipantType\n    ] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=\"Who should perform the action\",\n        description=\"The participant that should perform or be responsible for this action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    precheckBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"precheckBehavior\",\n        title=\"yes | no\",\n        description=\"Defines whether the action should usually be preselected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"yes\", \"no\"],\n        },\n    )\n    precheckBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_precheckBehavior\",\n        title=\"Extension field for ``precheckBehavior``.\",\n    )\n\n    prefix: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"prefix\",\n        title=\"User-visible prefix for the action (e.g. 1. or A.)\",\n        description=(\n            \"A user-visible prefix for the action. For example a section or item \"\n            \"numbering such as 1. or A.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    prefix__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_prefix\", title=\"Extension field for ``prefix``.\"\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the action should be addressed with respect to \"\n            \"other actions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    relatedAction: typing.List[\n        fhirtypes.RequestOrchestrationActionRelatedActionType\n    ] | None = Field(\n        default=None,\n        alias=\"relatedAction\",\n        title=\"Relationship to another action\",\n        description=(\n            'A relationship to another action such as \"before\" or \"30-60 minutes '\n            'after start of\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requiredBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"requiredBehavior\",\n        title=\"must | could | must-unless-documented\",\n        description=\"Defines expectations around whether an action is required.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"must\", \"could\", \"must-unless-documented\"],\n        },\n    )\n    requiredBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requiredBehavior\",\n        title=\"Extension field for ``requiredBehavior``.\",\n    )\n\n    resource: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"The target of the action\",\n        description=(\n            \"The resource that is the target of the action (e.g. \"\n            \"CommunicationRequest).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    selectionBehavior: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"selectionBehavior\",\n        title=\"any | all | all-or-none | exactly-one | at-most-one | one-or-more\",\n        description=\"Defines the selection behavior for the action and its children.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"any\",\n                \"all\",\n                \"all-or-none\",\n                \"exactly-one\",\n                \"at-most-one\",\n                \"one-or-more\",\n            ],\n        },\n    )\n    selectionBehavior__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_selectionBehavior\",\n        title=\"Extension field for ``selectionBehavior``.\",\n    )\n\n    textEquivalent: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"textEquivalent\",\n        title=(\n            \"Static text equivalent of the action, used if the dynamic aspects \"\n            \"cannot be interpreted by the receiving system\"\n        ),\n        description=(\n            \"A text equivalent of the action to be performed. This provides a \"\n            \"human-interpretable description of the action when the definition is \"\n            \"consumed by a system that might not be capable of interpreting it \"\n            \"dynamically.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    textEquivalent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_textEquivalent\",\n        title=\"Extension field for ``textEquivalent``.\",\n    )\n\n    timingAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"timingAge\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timingDateTime\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timingDateTime\",\n        title=\"Extension field for ``timingDateTime``.\",\n    )\n\n    timingDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"timingDuration\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timingPeriod\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"timingRange\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"When the action should take place\",\n        description=\"An optional value describing when the action should be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"User-visible title\",\n        description=\"The title of the action displayed to a user.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    transform: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"transform\",\n        title=\"Transform to apply the template\",\n        description=(\n            \"A reference to a StructureMap resource that defines a transform that \"\n            \"can be executed to produce the intent resource using the \"\n            \"ActivityDefinition instance as the input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureMap\"],\n        },\n    )\n    transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_transform\", title=\"Extension field for ``transform``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"create | update | remove | fire-event\",\n        description=\"The type of action to perform (create, update, remove).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestOrchestrationAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"prefix\",\n            \"title\",\n            \"description\",\n            \"textEquivalent\",\n            \"priority\",\n            \"code\",\n            \"documentation\",\n            \"goal\",\n            \"condition\",\n            \"input\",\n            \"output\",\n            \"relatedAction\",\n            \"timingDateTime\",\n            \"timingAge\",\n            \"timingPeriod\",\n            \"timingDuration\",\n            \"timingRange\",\n            \"timingTiming\",\n            \"location\",\n            \"participant\",\n            \"type\",\n            \"groupingBehavior\",\n            \"selectionBehavior\",\n            \"requiredBehavior\",\n            \"precheckBehavior\",\n            \"cardinalityBehavior\",\n            \"resource\",\n            \"definitionCanonical\",\n            \"definitionUri\",\n            \"transform\",\n            \"dynamicValue\",\n            \"action\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestOrchestrationAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"description\", \"textEquivalent\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"definition\": [\"definitionCanonical\", \"definitionUri\"],\n            \"timing\": [\n                \"timingAge\",\n                \"timingDateTime\",\n                \"timingDuration\",\n                \"timingPeriod\",\n                \"timingRange\",\n                \"timingTiming\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass RequestOrchestrationActionCondition(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Whether or not the action is applicable.\n    An expression that describes applicability criteria, or start/stop\n    conditions for the action.\n    \"\"\"\n\n    __resource_type__ = \"RequestOrchestrationActionCondition\"\n\n    expression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Boolean-valued expression\",\n        description=(\n            \"An expression that returns true or false, indicating whether or not \"\n            \"the condition is satisfied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"applicability | start | stop\",\n        description=\"The kind of condition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"applicability\", \"start\", \"stop\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestOrchestrationActionCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"kind\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestOrchestrationActionCondition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"kind\", \"kind__ext\")]\n        return required_fields\n\n\nclass RequestOrchestrationActionDynamicValue(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Dynamic aspects of the definition.\n    Customizations that should be applied to the statically defined resource.\n    For example, if the dosage of a medication must be computed based on the\n    patient's weight, a customization would be used to specify an expression\n    that calculated the weight, and the path on the resource that would contain\n    the result.\n    \"\"\"\n\n    __resource_type__ = \"RequestOrchestrationActionDynamicValue\"\n\n    expression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"An expression that provides the dynamic value for the customization\",\n        description=\"An expression specifying the value of the customized element.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"The path to the element to be set dynamically\",\n        description=(\n            \"The path to the element to be customized. This is the path on the \"\n            \"resource that will hold the result of the calculation defined by the \"\n            \"expression. The specified path SHALL be a FHIRPath resolvable on the \"\n            \"specified target type of the ActivityDefinition, and SHALL consist \"\n            \"only of identifiers, constant indexers, and a restricted subset of \"\n            \"functions. The path is allowed to contain qualifiers (.) to traverse \"\n            \"sub-elements, as well as indexers ([x]) to traverse multiple-\"\n            \"cardinality sub-elements (see the [Simple FHIRPath \"\n            \"Profile](fhirpath.html#simple) for full details).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestOrchestrationActionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"path\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestOrchestrationActionDynamicValue`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass RequestOrchestrationActionInput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Input data requirements.\n    Defines input data requirements for the action.\n    \"\"\"\n\n    __resource_type__ = \"RequestOrchestrationActionInput\"\n\n    relatedData: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"relatedData\",\n        title=\"What data is provided\",\n        description=(\n            \"Points to an existing input or output element that provides data to \"\n            \"this input.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    relatedData__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_relatedData\", title=\"Extension field for ``relatedData``.\"\n    )\n\n    requirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"requirement\",\n        title=\"What data is provided\",\n        description=\"Defines the data that is to be provided as input to the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"User-visible title\",\n        description=(\n            \"A human-readable label for the data requirement used to label data \"\n            \"flows in BPMN or similar diagrams. Also provides a human readable \"\n            \"label when rendering the data requirement that conveys its purpose to \"\n            \"human readers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestOrchestrationActionInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"title\",\n            \"requirement\",\n            \"relatedData\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestOrchestrationActionInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass RequestOrchestrationActionOutput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Output data definition.\n    Defines the outputs of the action, if any.\n    \"\"\"\n\n    __resource_type__ = \"RequestOrchestrationActionOutput\"\n\n    relatedData: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"relatedData\",\n        title=\"What data is provided\",\n        description=(\n            \"Points to an existing input or output element that is results as \"\n            \"output from the action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    relatedData__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_relatedData\", title=\"Extension field for ``relatedData``.\"\n    )\n\n    requirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"requirement\",\n        title=\"What data is provided\",\n        description=\"Defines the data that results as output from the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"User-visible title\",\n        description=(\n            \"A human-readable label for the data requirement used to label data \"\n            \"flows in BPMN or similar diagrams. Also provides a human readable \"\n            \"label when rendering the data requirement that conveys its purpose to \"\n            \"human readers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestOrchestrationActionOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"title\",\n            \"requirement\",\n            \"relatedData\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestOrchestrationActionOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass RequestOrchestrationActionParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who should perform the action.\n    The participant that should perform or be responsible for this action.\n    \"\"\"\n\n    __resource_type__ = \"RequestOrchestrationActionParticipant\"\n\n    actorCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"actorCanonical\",\n        title=\"Who/what is participating?\",\n        description=\"A reference to the actual participant.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e actor[x]\n            \"one_of_many\": \"actor\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n    actorCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_actorCanonical\",\n        title=\"Extension field for ``actorCanonical``.\",\n    )\n\n    actorReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"actorReference\",\n        title=\"Who/what is participating?\",\n        description=\"A reference to the actual participant.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e actor[x]\n            \"one_of_many\": \"actor\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"Device\",\n                \"DeviceDefinition\",\n                \"Endpoint\",\n                \"Group\",\n                \"HealthcareService\",\n                \"Location\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"E.g. Author, Reviewer, Witness, etc\",\n        description=(\n            \"Indicates how the actor will be involved in the action - author, \"\n            \"reviewer, witness, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"E.g. Nurse, Surgeon, Parent, etc\",\n        description=(\n            \"The role the participant should play in performing the described \"\n            \"action.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"careteam | device | group | healthcareservice | location | \"\n            \"organization | patient | practitioner | practitionerrole | \"\n            \"relatedperson\"\n        ),\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"careteam\",\n                \"device\",\n                \"group\",\n                \"healthcareservice\",\n                \"location\",\n                \"organization\",\n                \"patient\",\n                \"practitioner\",\n                \"practitionerrole\",\n                \"relatedperson\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    typeCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"typeCanonical\",\n        title=\"Who or what can participate\",\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n    typeCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_typeCanonical\",\n        title=\"Extension field for ``typeCanonical``.\",\n    )\n\n    typeReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"typeReference\",\n        title=\"Who or what can participate\",\n        description=\"The type of participant in the action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"Device\",\n                \"DeviceDefinition\",\n                \"Endpoint\",\n                \"Group\",\n                \"HealthcareService\",\n                \"Location\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestOrchestrationActionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"typeCanonical\",\n            \"typeReference\",\n            \"role\",\n            \"function\",\n            \"actorCanonical\",\n            \"actorReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestOrchestrationActionParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"actor\": [\"actorCanonical\", \"actorReference\"]}\n        return one_of_many_fields\n\n\nclass RequestOrchestrationActionRelatedAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Relationship to another action.\n    A relationship to another action such as \"before\" or \"30-60 minutes after\n    start of\".\n    \"\"\"\n\n    __resource_type__ = \"RequestOrchestrationActionRelatedAction\"\n\n    endRelationship: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"endRelationship\",\n        title=(\n            \"before | before-start | before-end | concurrent | concurrent-with-\"\n            \"start | concurrent-with-end | after | after-start | after-end\"\n        ),\n        description=\"The relationship of the end of this action to the related action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"before\",\n                \"before-start\",\n                \"before-end\",\n                \"concurrent\",\n                \"concurrent-with-start\",\n                \"concurrent-with-end\",\n                \"after\",\n                \"after-start\",\n                \"after-end\",\n            ],\n        },\n    )\n    endRelationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_endRelationship\",\n        title=\"Extension field for ``endRelationship``.\",\n    )\n\n    offsetDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"offsetDuration\",\n        title=\"Time offset for the relationship\",\n        description=(\n            \"A duration or range of durations to apply to the relationship. For \"\n            \"example, 30-60 minutes before.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e offset[x]\n            \"one_of_many\": \"offset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    offsetRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"offsetRange\",\n        title=\"Time offset for the relationship\",\n        description=(\n            \"A duration or range of durations to apply to the relationship. For \"\n            \"example, 30-60 minutes before.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e offset[x]\n            \"one_of_many\": \"offset\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    relationship: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=(\n            \"before | before-start | before-end | concurrent | concurrent-with-\"\n            \"start | concurrent-with-end | after | after-start | after-end\"\n        ),\n        description=\"The relationship of this action to the related action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"before\",\n                \"before-start\",\n                \"before-end\",\n                \"concurrent\",\n                \"concurrent-with-start\",\n                \"concurrent-with-end\",\n                \"after\",\n                \"after-start\",\n                \"after-end\",\n            ],\n        },\n    )\n    relationship__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relationship\",\n        title=\"Extension field for ``relationship``.\",\n    )\n\n    targetId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"targetId\",\n        title=\"What action this is related to\",\n        description=\"The element id of the target related action.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    targetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_targetId\", title=\"Extension field for ``targetId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequestOrchestrationActionRelatedAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"targetId\",\n            \"relationship\",\n            \"endRelationship\",\n            \"offsetDuration\",\n            \"offsetRange\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequestOrchestrationActionRelatedAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"relationship\", \"relationship__ext\"),\n            (\"targetId\", \"targetId__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"offset\": [\"offsetDuration\", \"offsetRange\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/requirements.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Requirements\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Requirements(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of requirements - features of systems that are necessary.\n    A set of requirements - a list of features or behaviors of designed systems\n    that are necessary to achieve organizational or regulatory goals.\n    \"\"\"\n\n    __resource_type__ = \"Requirements\"\n\n    actor: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"actor\",\n        title=\"Actor for these requirements\",\n        description=\"An actor these requirements are in regard to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActorDefinition\"],\n        },\n    )\n    actor__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_actor\", title=\"Extension field for ``actor``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the Requirements and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the Requirements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the Requirements was published. \"\n            \"The date must change when the business version changes and it must \"\n            \"change if the status code changes. In addition, it should change when \"\n            \"the substantive content of the Requirements changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFrom: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Other set of Requirements this builds on\",\n        description=(\n            \"Another set of Requirements that this set of Requirements builds on \"\n            \"and updates.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Requirements\"],\n        },\n    )\n    derivedFrom__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_derivedFrom\", title=\"Extension field for ``derivedFrom``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the requirements\",\n        description=\"A free text natural language description of the requirements.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this Requirements is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the Requirements (business identifier)\",\n        description=(\n            \"A formal identifier that is used to identify this Requirements when it\"\n            \" is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for Requirements (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the Requirements is intended to \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this Requirements (computer friendly)\",\n        description=(\n            \"A natural language name identifying the Requirements. This name should\"\n            \" be usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the Requirements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this Requirements is defined\",\n        description=(\n            \"Explanation of why this Requirements is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    reference: typing.List[fhirtypes.UrlType | None] | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=(\n            \"External artifact (rule/document etc. that) created this set of \"\n            \"requirements\"\n        ),\n        description=(\n            \"A reference to another artifact that created this set of requirements.\"\n            \" This could be a Profile, etc., or external regulation, or business \"\n            \"requirements expressed elsewhere.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reference__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    statement: typing.List[fhirtypes.RequirementsStatementType] | None = Field(\n        default=None,\n        alias=\"statement\",\n        title=\"Actual statement as markdown\",\n        description=\"The actual statement of requirement, in markdown format.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this Requirements. Enables tracking the life-cycle of \"\n            \"the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this Requirements (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the Requirements.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this Requirements, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this Requirements when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" Requirements is (or will be) published. This URL can be the target of\"\n            \" a canonical reference. It SHALL remain the same when the Requirements\"\n            \" is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate Requirements instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the Requirements\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"Requirements when it is referenced in a specification, model, design \"\n            \"or instance. This is an arbitrary value managed by the Requirements \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Requirements`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"derivedFrom\",\n            \"reference\",\n            \"actor\",\n            \"statement\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Requirements`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"derivedFrom\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass RequirementsStatement(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Actual statement as markdown.\n    The actual statement of requirement, in markdown format.\n    \"\"\"\n\n    __resource_type__ = \"RequirementsStatement\"\n\n    conditionality: bool | None = Field(\n        default=None,\n        alias=\"conditionality\",\n        title=\"Set to true if requirements statement is conditional\",\n        description=(\n            \"This boolean flag is set to true of the text of the requirement is \"\n            \"conditional on something e.g. it includes lanauage like 'if x then y'.\"\n            \" This conditionality flag is introduced for purposes of filtering and \"\n            \"colour highlighting etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    conditionality__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_conditionality\",\n        title=\"Extension field for ``conditionality``.\",\n    )\n\n    conformance: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"conformance\",\n        title=\"SHALL | SHOULD | MAY | SHOULD-NOT\",\n        description=\"A short human usable label for this statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"SHALL\", \"SHOULD\", \"MAY\", \"SHOULD-NOT\"],\n        },\n    )\n    conformance__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_conformance\", title=\"Extension field for ``conformance``.\"\n    )\n\n    derivedFrom: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Another statement this clarifies/restricts ([url#]key)\",\n        description=(\n            \"Another statement on one of the requirements that this requirement \"\n            \"clarifies or restricts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    derivedFrom__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_derivedFrom\", title=\"Extension field for ``derivedFrom``.\"\n    )\n\n    key: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"key\",\n        title=\"Key that identifies this statement\",\n        description=\"Key that identifies this statement (unique within this resource).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    key__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_key\", title=\"Extension field for ``key``.\"\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Short Human label for this statement\",\n        description=\"A short human usable label for this statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    parent: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"A larger requirement that this requirement helps to refine and enable\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    parent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_parent\", title=\"Extension field for ``parent``.\"\n    )\n\n    reference: typing.List[fhirtypes.UrlType | None] | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"External artifact (rule/document etc. that) created this requirement\",\n        description=(\n            \"A reference to another artifact that created this requirement. This \"\n            \"could be a Profile, etc., or external regulation, or business \"\n            \"requirements expressed elsewhere.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    reference__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_reference\", title=\"Extension field for ``reference``.\"\n    )\n\n    requirement: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"requirement\",\n        title=\"The actual requirement\",\n        description=\"The actual requirement for human consumption.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    requirement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requirement\", title=\"Extension field for ``requirement``.\"\n    )\n\n    satisfiedBy: typing.List[fhirtypes.UrlType | None] | None = Field(\n        default=None,\n        alias=\"satisfiedBy\",\n        title=\"Design artifact that satisfies this requirement\",\n        description=(\n            \"A reference to another artifact that satisfies this requirement. This \"\n            \"could be a Profile, extension, or an element in one of those, or a \"\n            \"CapabilityStatement, OperationDefinition, SearchParameter, \"\n            \"CodeSystem(/code), ValueSet, Libary etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    satisfiedBy__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_satisfiedBy\", title=\"Extension field for ``satisfiedBy``.\"\n    )\n\n    source: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Who asked for this statement\",\n        description=(\n            \"Who asked for this statement to be a requirement. By default, it's \"\n            \"assumed that the publisher knows who it is if it matters.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"Device\",\n                \"Group\",\n                \"HealthcareService\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RequirementsStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"key\",\n            \"label\",\n            \"conformance\",\n            \"conditionality\",\n            \"requirement\",\n            \"derivedFrom\",\n            \"parent\",\n            \"satisfiedBy\",\n            \"reference\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RequirementsStatement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"key\", \"key__ext\"), (\"requirement\", \"requirement__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/researchstudy.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchStudy\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ResearchStudy(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Investigation to increase healthcare-related patient-independent knowledge.\n    A scientific study of nature that sometimes includes processes involved in\n    health and disease. For example, clinical trials are research studies that\n    involve people. These studies may be related to new ways to screen,\n    prevent, diagnose, and treat disease. They may also study certain outcomes\n    and certain groups of people by looking at data collected in the past or\n    future.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudy\"\n\n    associatedParty: typing.List[\n        fhirtypes.ResearchStudyAssociatedPartyType\n    ] | None = Field(\n        default=None,\n        alias=\"associatedParty\",\n        title=\"Sponsors, collaborators, and other parties\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classifier\",\n        title=\"Classification for the study\",\n        description=(\n            \"Additional grouping mechanism or categorization of a research study. \"\n            \"Example: FDA regulated device, FDA regulated drug, MPG Paragraph 23b \"\n            \"(a German legal requirement), IRB-exempt, etc. Implementation Note: do\"\n            \" not use the classifier element to support existing semantics that are\"\n            \" already supported thru explicit elements in the resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    comparisonGroup: typing.List[\n        fhirtypes.ResearchStudyComparisonGroupType\n    ] | None = Field(\n        default=None,\n        alias=\"comparisonGroup\",\n        title=\"Defined path through the study for a subject\",\n        description=(\n            \"Describes an expected event or sequence of events for one of the \"\n            \"subjects of a study. E.g. for a living subject: exposure to drug A, \"\n            \"wash-out, exposure to drug B, wash-out, follow-up. E.g. for a \"\n            \"stability study: {store sample from lot A at 25 degrees for 1 month}, \"\n            \"{store sample from lot A at 40 degrees for 1 month}.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    condition: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Condition being studied\",\n        description=(\n            \"The condition that is the focus of the study.  For example, In a study\"\n            \" to examine risk factors for Lupus, might have as an inclusion \"\n            'criterion \"healthy volunteer\", but the target condition code would be '\n            \"a Lupus SNOMED code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date the resource last changed\",\n        description=(\n            \"The date (and optionally time) when the ResearchStudy Resource was \"\n            \"last significantly changed. The date must change when the business \"\n            \"version changes and it must change if the status code changes. In \"\n            \"addition, it should change when the substantive content of the \"\n            \"ResearchStudy Resource changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Detailed narrative of the study\",\n        description=(\n            \"A detailed and human-readable narrative of the study. E.g., study \"\n            \"abstract.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    descriptionSummary: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"descriptionSummary\",\n        title=\"Brief text explaining the study\",\n        description=\"A brief text for explaining the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    descriptionSummary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_descriptionSummary\",\n        title=\"Extension field for ``descriptionSummary``.\",\n    )\n\n    focus: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"Drugs, devices, etc. under study\",\n        description=(\n            \"The medication(s), food(s), therapy(ies), device(s) or other concerns \"\n            \"or interventions that the study is seeking to gain more information \"\n            \"about.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Medication\",\n                \"MedicinalProductDefinition\",\n                \"SubstanceDefinition\",\n                \"EvidenceVariable\",\n            ],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for study\",\n        description=(\n            \"Identifiers assigned to this research study by the sponsor or other \"\n            \"systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    keyword: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"keyword\",\n        title=\"Used to search for the study\",\n        description=\"Key terms to aid in searching for or filtering the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    label: typing.List[fhirtypes.ResearchStudyLabelType] | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Additional names for the study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this study (computer friendly)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the study\",\n        description=(\n            \"Comments made about the study by the performer, subject or other \"\n            \"participants.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    objective: typing.List[fhirtypes.ResearchStudyObjectiveType] | None = Field(\n        default=None,\n        alias=\"objective\",\n        title=\"A goal for the study\",\n        description=(\n            \"A goal that the study is aiming to achieve in terms of a scientific \"\n            \"question to be answered by the analysis of data collected during the \"\n            \"study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    outcomeMeasure: typing.List[\n        fhirtypes.ResearchStudyOutcomeMeasureType\n    ] | None = Field(\n        default=None,\n        alias=\"outcomeMeasure\",\n        title=\"A variable measured during the study\",\n        description=(\n            'An \"outcome measure\", \"endpoint\", \"effect measure\" or \"measure of '\n            'effect\" is a specific measurement or observation used to quantify the '\n            \"effect of experimental variables on the participants in a study, or \"\n            \"for observational studies, to describe patterns of diseases or traits \"\n            \"or associations with exposures, risk factors or treatment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of larger study\",\n        description=(\n            \"A larger research study of which this particular study is a component \"\n            \"or step.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchStudy\"],\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When the study began and ended\",\n        description=(\n            \"Identifies the start date and the expected (or actual, depending on \"\n            \"status) end date for the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    phase: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"phase\",\n        title=(\n            \"n-a | early-phase-1 | phase-1 | phase-1-phase-2 | phase-2 | \"\n            \"phase-2-phase-3 | phase-3 | phase-4\"\n        ),\n        description=(\n            \"The stage in the progression of a therapy from initial experimental \"\n            \"use in humans in clinical trials to post-market evaluation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    primaryPurposeType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"primaryPurposeType\",\n        title=(\n            \"treatment | prevention | diagnostic | supportive-care | screening | \"\n            \"health-services-research | basic-science | device-feasibility\"\n        ),\n        description=(\n            \"The type of study based upon the intent of the study activities. A \"\n            \"classification of the intent of the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    progressStatus: typing.List[\n        fhirtypes.ResearchStudyProgressStatusType\n    ] | None = Field(\n        default=None,\n        alias=\"progressStatus\",\n        title=\"Status of study with time for that status\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    protocol: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"protocol\",\n        title=\"Steps followed in executing study\",\n        description=(\n            \"The set of steps expected to be performed as part of the execution of \"\n            \"the study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"PlanDefinition\"],\n        },\n    )\n\n    recruitment: fhirtypes.ResearchStudyRecruitmentType | None = Field(\n        default=None,\n        alias=\"recruitment\",\n        title=\"Target or actual group of participants enrolled in study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    region: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"region\",\n        title=\"Geographic area for the study\",\n        description=(\n            \"A country, state or other area where the study is taking place rather \"\n            \"than its precise geographic location or address.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"References, URLs, and attachments\",\n        description=(\n            \"Citations, references, URLs and other related documents.  When using \"\n            \"relatedArtifact to share URLs, the relatedArtifact.type will often be \"\n            'set to one of \"documentation\" or \"supported-with\" and the URL value '\n            \"will often be in relatedArtifact.document.url but another possible \"\n            \"location is relatedArtifact.resource when it is a canonical URL.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    result: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"Link to results generated during the study\",\n        description=(\n            \"Link to one or more sets of results generated by the study.  Could \"\n            \"also link to a research registry holding the results such as \"\n            \"ClinicalTrials.gov.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EvidenceReport\", \"Citation\", \"DiagnosticReport\"],\n        },\n    )\n\n    site: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"site\",\n        title=\"Facility where study activities are conducted\",\n        description=\"A facility in which study activities are conducted.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\", \"ResearchStudy\", \"Organization\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The publication state of the resource (not of the study).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    studyDesign: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"studyDesign\",\n        title=\"Classifications of the study design characteristics\",\n        description=(\n            \"Codes categorizing the type of study such as investigational vs. \"\n            \"observational, type of blinding, type of randomization, safety vs. \"\n            \"efficacy, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Human readable name of the study\",\n        description=\"The human readable name of the research study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Canonical identifier for this study resource\",\n        description=(\n            \"Canonical identifier for this study resource, represented as a \"\n            \"globally unique URI.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"The business version for the study record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    whyStopped: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"whyStopped\",\n        title=(\n            \"accrual-goal-met | closed-due-to-toxicity | closed-due-to-lack-of-\"\n            \"study-progress | temporarily-closed-per-study-design\"\n        ),\n        description=(\n            \"A description and/or code explaining the premature termination of the \"\n            \"study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"name\",\n            \"title\",\n            \"label\",\n            \"protocol\",\n            \"partOf\",\n            \"relatedArtifact\",\n            \"date\",\n            \"status\",\n            \"primaryPurposeType\",\n            \"phase\",\n            \"studyDesign\",\n            \"focus\",\n            \"condition\",\n            \"keyword\",\n            \"region\",\n            \"descriptionSummary\",\n            \"description\",\n            \"period\",\n            \"site\",\n            \"note\",\n            \"classifier\",\n            \"associatedParty\",\n            \"progressStatus\",\n            \"whyStopped\",\n            \"recruitment\",\n            \"comparisonGroup\",\n            \"objective\",\n            \"outcomeMeasure\",\n            \"result\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"title\",\n            \"protocol\",\n            \"partOf\",\n            \"status\",\n            \"primaryPurposeType\",\n            \"phase\",\n            \"studyDesign\",\n            \"condition\",\n            \"keyword\",\n            \"region\",\n            \"period\",\n            \"site\",\n            \"whyStopped\",\n            \"recruitment\",\n            \"result\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ResearchStudyAssociatedParty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Sponsors, collaborators, and other parties.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudyAssociatedParty\"\n\n    classifier: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classifier\",\n        title=\"nih | fda | government | nonprofit | academic | industry\",\n        description=\"A categorization other than role for the associated party.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of associated party\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    party: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"party\",\n        title=(\n            \"Individual or organization associated with study (use practitionerRole\"\n            \" to specify their organisation)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    period: typing.List[fhirtypes.PeriodType] | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When active in the role\",\n        description=(\n            \"Identifies the start date and the end date of the associated party in \"\n            \"the role.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"role\",\n        title=(\n            \"sponsor | lead-sponsor | sponsor-investigator | primary-investigator |\"\n            \" collaborator | funding-source | general-contact | recruitment-contact\"\n            \" | sub-investigator | study-director | study-chair\"\n        ),\n        description=\"Type of association.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudyAssociatedParty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"role\",\n            \"period\",\n            \"classifier\",\n            \"party\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudyAssociatedParty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ResearchStudyComparisonGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defined path through the study for a subject.\n    Describes an expected event or sequence of events for one of the subjects\n    of a study. E.g. for a living subject: exposure to drug A, wash-out,\n    exposure to drug B, wash-out, follow-up. E.g. for a stability study: {store\n    sample from lot A at 25 degrees for 1 month}, {store sample from lot A at\n    40 degrees for 1 month}.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudyComparisonGroup\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Short explanation of study path\",\n        description=(\n            \"A succinct description of the path through the study that would be \"\n            \"followed by a subject adhering to this comparisonGroup.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    intendedExposure: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"intendedExposure\",\n        title=\"Interventions or exposures in this comparisonGroup or cohort\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EvidenceVariable\"],\n        },\n    )\n\n    linkId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"linkId\",\n        title=(\n            \"Allows the comparisonGroup for the study and the comparisonGroup for \"\n            \"the subject to be linked easily\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    linkId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkId\", title=\"Extension field for ``linkId``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Label for study comparisonGroup\",\n        description=\"Unique, human-readable label for this comparisonGroup of the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    observedGroup: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"observedGroup\",\n        title=\"Group of participants who were enrolled in study comparisonGroup\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Categorization of study comparisonGroup\",\n        description=(\n            \"Categorization of study comparisonGroup, e.g. experimental, active \"\n            \"comparator, placebo comparater.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudyComparisonGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"linkId\",\n            \"name\",\n            \"type\",\n            \"description\",\n            \"intendedExposure\",\n            \"observedGroup\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudyComparisonGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass ResearchStudyLabel(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional names for the study.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudyLabel\"\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"primary | official | scientific | plain-language | subtitle | short-\"\n            \"title | acronym | earlier-title | language | auto-translated | human-\"\n            \"use | machine-use | duplicate-uid\"\n        ),\n        description=\"Kind of name.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudyLabel`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudyLabel`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ResearchStudyObjective(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A goal for the study.\n    A goal that the study is aiming to achieve in terms of a scientific\n    question to be answered by the analysis of data collected during the study.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudyObjective\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the objective\",\n        description=(\n            \"Free text description of the objective of the study.  This is what the\"\n            \" study is trying to achieve rather than how it is going to achieve it \"\n            \"(see ResearchStudy.description).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Label for the objective\",\n        description=\"Unique, human-readable label for this objective of the study.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"primary | secondary | exploratory\",\n        description=\"The kind of study objective.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudyObjective`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"type\", \"description\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudyObjective`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ResearchStudyOutcomeMeasure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A variable measured during the study.\n    An \"outcome measure\", \"endpoint\", \"effect measure\" or \"measure of effect\"\n    is a specific measurement or observation used to quantify the effect of\n    experimental variables on the participants in a study, or for observational\n    studies, to describe patterns of diseases or traits or associations with\n    exposures, risk factors or treatment.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudyOutcomeMeasure\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the outcome\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Label for the outcome\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    reference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"reference\",\n        title=\"Structured outcome definition\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"EvidenceVariable\"],\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"primary | secondary | exploratory\",\n        description=(\n            \"The parameter or characteristic being assessed as one of the values by\"\n            \" which the study is assessed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudyOutcomeMeasure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"type\",\n            \"description\",\n            \"reference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudyOutcomeMeasure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ResearchStudyProgressStatus(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Status of study with time for that status.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudyProgressStatus\"\n\n    actual: bool | None = Field(\n        default=None,\n        alias=\"actual\",\n        title=\"Actual if true else anticipated\",\n        description=(\n            \"An indication of whether or not the date is a known date when the \"\n            \"state changed or will change. A value of true indicates a known date. \"\n            \"A value of false indicates an estimated date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    actual__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_actual\", title=\"Extension field for ``actual``.\"\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Date range\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    state: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"state\",\n        title=\"Label for status or state (e.g. recruitment status)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudyProgressStatus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"state\", \"actual\", \"period\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudyProgressStatus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ResearchStudyRecruitment(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Target or actual group of participants enrolled in study.\n    \"\"\"\n\n    __resource_type__ = \"ResearchStudyRecruitment\"\n\n    actualGroup: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"actualGroup\",\n        title=\"Group of participants who were enrolled in study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    actualNumber: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"actualNumber\",\n        title=\"Actual total number of participants enrolled in study\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    actualNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_actualNumber\",\n        title=\"Extension field for ``actualNumber``.\",\n    )\n\n    eligibility: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"eligibility\",\n        title=\"Inclusion and exclusion criteria\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\", \"EvidenceVariable\"],\n        },\n    )\n\n    targetNumber: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"targetNumber\",\n        title=\"Estimated total number of participants to be enrolled\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    targetNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_targetNumber\",\n        title=\"Extension field for ``targetNumber``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchStudyRecruitment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"targetNumber\",\n            \"actualNumber\",\n            \"eligibility\",\n            \"actualGroup\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchStudyRecruitment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"actualGroup\"]\n"
  },
  {
    "path": "fhir/resources/researchsubject.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchSubject\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ResearchSubject(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Participant or object which is the recipient of investigative activities in\n    a study.\n    A ResearchSubject is a participant or object which is the recipient of\n    investigative activities in a research study.\n    \"\"\"\n\n    __resource_type__ = \"ResearchSubject\"\n\n    actualComparisonGroup: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"actualComparisonGroup\",\n        title=\"What path was followed\",\n        description=(\n            \"The name of the arm in the study the subject actually followed as part\"\n            \" of this study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    actualComparisonGroup__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_actualComparisonGroup\",\n        title=\"Extension field for ``actualComparisonGroup``.\",\n    )\n\n    assignedComparisonGroup: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"assignedComparisonGroup\",\n        title=\"What path should be followed\",\n        description=(\n            \"The name of the arm in the study the subject is expected to follow as \"\n            \"part of this study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    assignedComparisonGroup__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_assignedComparisonGroup\",\n        title=\"Extension field for ``assignedComparisonGroup``.\",\n    )\n\n    consent: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"consent\",\n        title=\"Agreement to participate in study\",\n        description=(\n            \"A record of the patient's informed agreement to participate in the \"\n            \"study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Consent\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for research subject in a study\",\n        description=\"Identifiers assigned to this research subject for a study.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"Start and end of participation\",\n        description=(\n            \"The dates the subject began and ended their participation in the \" \"study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    progress: typing.List[fhirtypes.ResearchSubjectProgressType] | None = Field(\n        default=None,\n        alias=\"progress\",\n        title=\"Subject status\",\n        description=(\n            \"The current state (status) of the subject and resons for status change\"\n            \" where appropriate.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The publication state of the resource (not of the subject).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    study: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"study\",\n        title=\"Study subject is part of\",\n        description=\"Reference to the study the subject is participating in.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ResearchStudy\"],\n        },\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who or what is part of study\",\n        description=(\n            \"The record of the person, animal or other entity involved in the \" \"study.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Specimen\",\n                \"Device\",\n                \"Medication\",\n                \"Substance\",\n                \"BiologicallyDerivedProduct\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"progress\",\n            \"period\",\n            \"study\",\n            \"subject\",\n            \"assignedComparisonGroup\",\n            \"actualComparisonGroup\",\n            \"consent\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchSubject`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"period\",\n            \"study\",\n            \"subject\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass ResearchSubjectProgress(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Subject status.\n    The current state (status) of the subject and resons for status change\n    where appropriate.\n    \"\"\"\n\n    __resource_type__ = \"ResearchSubjectProgress\"\n\n    endDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"endDate\",\n        title=\"State change date\",\n        description=\"The date when the state ended.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    endDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_endDate\", title=\"Extension field for ``endDate``.\"\n    )\n\n    milestone: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"milestone\",\n        title=\"SignedUp | Screened | Randomized\",\n        description=\"The milestones the subject has passed through.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"State change reason\",\n        description=(\n            \"The reason for the state change.  If coded it should follow the formal\"\n            \" subject state model.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    startDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"startDate\",\n        title=\"State change date\",\n        description=\"The date when the new status started.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    startDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_startDate\", title=\"Extension field for ``startDate``.\"\n    )\n\n    subjectState: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectState\",\n        title=(\n            \"candidate | eligible | follow-up | ineligible | not-registered | off-\"\n            \"study | on-study | on-study-intervention | on-study-observation | \"\n            \"pending-on-study | potential-candidate | screening | withdrawn\"\n        ),\n        description=\"The current state of the subject.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"state | milestone\",\n        description=(\n            \"Identifies the aspect of the subject's journey that the state refers \"\n            \"to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ResearchSubjectProgress`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"subjectState\",\n            \"milestone\",\n            \"reason\",\n            \"startDate\",\n            \"endDate\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ResearchSubjectProgress`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/resource.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Resource\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import base, fhirtypes\n\n\nclass Resource(base.Base):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Base Resource.\n    This is the base resource type for everything.\n    \"\"\"\n\n    __resource_type__ = \"Resource\"\n\n    id: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"id\",\n        title=\"Logical id of this artifact\",\n        description=(\n            \"The logical id of the resource, as used in the URL for the resource. \"\n            \"Once assigned, this value never changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    implicitRules: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"implicitRules\",\n        title=\"A set of rules under which this content was created\",\n        description=(\n            \"A reference to a set of rules that were followed when the resource was\"\n            \" constructed, and which must be understood when processing the \"\n            \"content. Often, this is a reference to an implementation guide that \"\n            \"defines the special rules along with other profiles etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    implicitRules__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_implicitRules\",\n        title=\"Extension field for ``implicitRules``.\",\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language of the resource content\",\n        description=\"The base language in which the resource is written.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    meta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"meta\",\n        title=\"Metadata about the resource\",\n        description=(\n            \"The metadata about the resource. This is content that is maintained by\"\n            \" the infrastructure. Changes to the content might not always be \"\n            \"associated with version changes to the resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Resource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\", \"language\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Resource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"meta\", \"implicitRules\"]\n"
  },
  {
    "path": "fhir/resources/riskassessment.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RiskAssessment\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass RiskAssessment(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Potential outcomes for a subject with likelihood.\n    An assessment of the likely outcome(s) for a patient or other subject as\n    well as the likelihood of each outcome.\n    \"\"\"\n\n    __resource_type__ = \"RiskAssessment\"\n\n    basedOn: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this assessment\",\n        description=\"A reference to the request that is fulfilled by this risk assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    basis: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basis\",\n        title=\"Information used in assessment\",\n        description=(\n            \"Indicates the source data considered as part of the assessment (for \"\n            \"example, FamilyHistory, Observations, Procedures, Conditions, etc.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Type of assessment\",\n        description=\"The type of the risk assessment performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    condition: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Condition assessed\",\n        description=(\n            \"For assessments or prognosis specific to a particular condition, \"\n            \"indicates the condition being assessed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Condition\"],\n        },\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Where was assessment performed?\",\n        description=\"The encounter where the assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier for the assessment\",\n        description=\"Business identifier assigned to the risk assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Evaluation mechanism\",\n        description=\"The algorithm, process or mechanism used to evaluate the risk.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    mitigation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"mitigation\",\n        title=\"How to reduce risk\",\n        description=(\n            \"A description of the steps that might be taken to reduce the \"\n            \"identified risk(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    mitigation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mitigation\", title=\"Extension field for ``mitigation``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments on the risk assessment\",\n        description=\"Additional comments about the risk assessment.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When was assessment made?\",\n        description=\"The date (and possibly time) the risk assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When was assessment made?\",\n        description=\"The date (and possibly time) the risk assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    parent: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Part of this occurrence\",\n        description=(\n            \"A reference to a resource that this risk assessment is part of, such \"\n            \"as a Procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    performer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who did assessment?\",\n        description=(\n            \"The provider, patient, related person, or software application that \"\n            \"performed the assessment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    prediction: typing.List[fhirtypes.RiskAssessmentPredictionType] | None = Field(\n        default=None,\n        alias=\"prediction\",\n        title=\"Outcome predicted\",\n        description=\"Describes the expected outcome for the subject.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why the assessment was necessary?\",\n        description=\"The reason the risk assessment was performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"registered | preliminary | final | amended +\",\n        description=(\n            \"The status of the RiskAssessment, using the same statuses as an \"\n            \"Observation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"registered\", \"preliminary\", \"final\", \"amended\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Who/what does assessment apply to?\",\n        description=\"The patient or group the risk assessment applies to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RiskAssessment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"parent\",\n            \"status\",\n            \"method\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"condition\",\n            \"performer\",\n            \"reason\",\n            \"basis\",\n            \"prediction\",\n            \"mitigation\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RiskAssessment`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"method\",\n            \"code\",\n            \"subject\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"condition\",\n            \"performer\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\"]}\n        return one_of_many_fields\n\n\nclass RiskAssessmentPrediction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Outcome predicted.\n    Describes the expected outcome for the subject.\n    \"\"\"\n\n    __resource_type__ = \"RiskAssessmentPrediction\"\n\n    outcome: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"outcome\",\n        title=\"Possible outcome for the subject\",\n        description=(\n            \"One of the potential outcomes for the patient (e.g. remission, death,\"\n            \"  a particular condition).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    probabilityDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"probabilityDecimal\",\n        title=\"Likelihood of specified outcome\",\n        description=\"Indicates how likely the outcome is (in the specified timeframe).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e probability[x]\n            \"one_of_many\": \"probability\",\n            \"one_of_many_required\": False,\n        },\n    )\n    probabilityDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_probabilityDecimal\",\n        title=\"Extension field for ``probabilityDecimal``.\",\n    )\n\n    probabilityRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"probabilityRange\",\n        title=\"Likelihood of specified outcome\",\n        description=\"Indicates how likely the outcome is (in the specified timeframe).\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e probability[x]\n            \"one_of_many\": \"probability\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    qualitativeRisk: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"qualitativeRisk\",\n        title=\"Likelihood of specified outcome as a qualitative value\",\n        description=(\n            \"Indicates how likely the outcome is (in the specified timeframe), \"\n            \"expressed as a qualitative value (e.g. low, medium, or high).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    rationale: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"rationale\",\n        title=\"Explanation of prediction\",\n        description=\"Additional information explaining the basis for the prediction.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    rationale__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_rationale\", title=\"Extension field for ``rationale``.\"\n    )\n\n    relativeRisk: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"relativeRisk\",\n        title=\"Relative likelihood\",\n        description=(\n            \"Indicates the risk for this particular subject (with their specific \"\n            \"characteristics) divided by the risk of the population in general.  \"\n            \"(Numbers greater than 1 = higher risk than the population, numbers \"\n            \"less than 1 = lower risk.).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    relativeRisk__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_relativeRisk\",\n        title=\"Extension field for ``relativeRisk``.\",\n    )\n\n    whenPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"whenPeriod\",\n        title=\"Timeframe or age range\",\n        description=(\n            \"Indicates the period of time or age range of the subject to which the \"\n            \"specified probability applies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    whenRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"whenRange\",\n        title=\"Timeframe or age range\",\n        description=(\n            \"Indicates the period of time or age range of the subject to which the \"\n            \"specified probability applies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e when[x]\n            \"one_of_many\": \"when\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``RiskAssessmentPrediction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"outcome\",\n            \"probabilityDecimal\",\n            \"probabilityRange\",\n            \"qualitativeRisk\",\n            \"relativeRisk\",\n            \"whenPeriod\",\n            \"whenRange\",\n            \"rationale\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``RiskAssessmentPrediction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"probability\": [\"probabilityDecimal\", \"probabilityRange\"],\n            \"when\": [\"whenPeriod\", \"whenRange\"],\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/sampleddata.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SampledData\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass SampledData(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A series of measurements taken by a device.\n    A series of measurements taken by a device, with upper and lower limits.\n    There may be more than one dimension in the data.\n    \"\"\"\n\n    __resource_type__ = \"SampledData\"\n\n    codeMap: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"codeMap\",\n        title=\"Defines the codes used in the data\",\n        description=\"Reference to ConceptMap that defines the codes used in the data.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ConceptMap\"],\n        },\n    )\n    codeMap__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_codeMap\", title=\"Extension field for ``codeMap``.\"\n    )\n\n    data: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"data\",\n        title='Decimal values with spaces, or \"E\" | \"U\" | \"L\", or another code',\n        description=(\n            \"A series of data points which are decimal values or codes separated by\"\n            ' a single space (character u20). The special codes \"E\" (error), \"L\" '\n            '(below detection limit) and \"U\" (above detection limit) are also '\n            \"defined for used in place of decimal values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_data\", title=\"Extension field for ``data``.\"\n    )\n\n    dimensions: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"dimensions\",\n        title=\"Number of sample points at each time point\",\n        description=(\n            \"The number of sample points at each time point. If this value is \"\n            \"greater than one, then the dimensions will be interlaced - all the \"\n            \"sample points for a point in time will be recorded at once.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    dimensions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dimensions\", title=\"Extension field for ``dimensions``.\"\n    )\n\n    factor: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"factor\",\n        title=\"Multiply data by this before adding to origin\",\n        description=(\n            \"A correction factor that is applied to the sampled data points before \"\n            \"they are added to the origin.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    factor__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_factor\", title=\"Extension field for ``factor``.\"\n    )\n\n    interval: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"interval\",\n        title=\"Number of intervalUnits between samples\",\n        description=(\n            \"Amount of intervalUnits between samples, e.g. milliseconds for time-\"\n            \"based sampling.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    interval__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_interval\", title=\"Extension field for ``interval``.\"\n    )\n\n    intervalUnit: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intervalUnit\",\n        title=\"The measurement unit of the interval between samples\",\n        description=\"The measurement unit in which the sample interval is expressed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    intervalUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_intervalUnit\",\n        title=\"Extension field for ``intervalUnit``.\",\n    )\n\n    lowerLimit: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"lowerLimit\",\n        title=\"Lower limit of detection\",\n        description=(\n            \"The lower limit of detection of the measured points. This is needed if\"\n            ' any of the data points have the value \"L\" (lower than detection '\n            \"limit).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lowerLimit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lowerLimit\", title=\"Extension field for ``lowerLimit``.\"\n    )\n\n    offsets: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"offsets\",\n        title=\"Offsets, typically in time, at which data values were taken\",\n        description=(\n            \"A series of data points which are decimal values separated by a single\"\n            \" space (character u20).  The units in which the offsets are expressed \"\n            \"are found in intervalUnit.  The absolute point at which the \"\n            \"measurements begin SHALL be conveyed outside the scope of this \"\n            \"datatype, e.g. Observation.effectiveDateTime for a timing offset.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    offsets__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_offsets\", title=\"Extension field for ``offsets``.\"\n    )\n\n    origin: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"origin\",\n        title=\"Zero value and units\",\n        description=(\n            \"The base quantity that a measured value of zero represents. In \"\n            \"addition, this provides the units of the entire measurement series.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    upperLimit: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"upperLimit\",\n        title=\"Upper limit of detection\",\n        description=(\n            \"The upper limit of detection of the measured points. This is needed if\"\n            ' any of the data points have the value \"U\" (higher than detection '\n            \"limit).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    upperLimit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_upperLimit\", title=\"Extension field for ``upperLimit``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SampledData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"origin\",\n            \"interval\",\n            \"intervalUnit\",\n            \"factor\",\n            \"lowerLimit\",\n            \"upperLimit\",\n            \"dimensions\",\n            \"codeMap\",\n            \"offsets\",\n            \"data\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SampledData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"origin\",\n            \"interval\",\n            \"intervalUnit\",\n            \"factor\",\n            \"lowerLimit\",\n            \"upperLimit\",\n            \"dimensions\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"dimensions\", \"dimensions__ext\"),\n            (\"intervalUnit\", \"intervalUnit__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/schedule.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Schedule\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Schedule(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A container for slots of time that may be available for booking\n    appointments.\n    \"\"\"\n\n    __resource_type__ = \"Schedule\"\n\n    active: bool | None = Field(\n        default=None,\n        alias=\"active\",\n        title=\"Whether this schedule is in active use\",\n        description=(\n            \"Whether this schedule record is in active use or should not be used \"\n            \"(such as was entered in error).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    active__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_active\", title=\"Extension field for ``active``.\"\n    )\n\n    actor: typing.List[fhirtypes.ReferenceType] = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Resource(s) that availability information is being provided for\",\n        description=(\n            \"Slots that reference this schedule resource provide the availability \"\n            \"details to these referenced resource(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"CareTeam\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"HealthcareService\",\n                \"Location\",\n            ],\n        },\n    )\n\n    comment: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Comments on availability\",\n        description=(\n            \"Comments on the availability to describe any extended information. \"\n            \"Such as custom constraints on the slots that may be associated.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human-readable label\",\n        description=(\n            \"Further description of the schedule as it would be presented to a \"\n            \"consumer while searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    planningHorizon: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"planningHorizon\",\n        title=\"Period of time covered by schedule\",\n        description=(\n            \"The period of time that the slots that reference this Schedule \"\n            \"resource cover (even if none exist). These  cover the amount of time \"\n            \"that an organization's planning horizon; the interval for which they \"\n            \"are currently accepting appointments. This does not define a \"\n            '\"template\" for planning outside these dates.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceCategory\",\n        title=\"High-level category\",\n        description=(\n            \"A broad categorization of the service that is to be performed during \"\n            \"this appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceType: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"serviceType\",\n        title=\"Specific service\",\n        description=\"The specific service that is to be performed during this appointment.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"HealthcareService\"],\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=\"Type of specialty needed\",\n        description=(\n            \"The specialty of a practitioner that would be required to perform the \"\n            \"service requested in this appointment.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Schedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"name\",\n            \"actor\",\n            \"planningHorizon\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Schedule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"active\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"name\",\n            \"actor\",\n            \"planningHorizon\",\n        ]\n"
  },
  {
    "path": "fhir/resources/searchparameter.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SearchParameter\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SearchParameter(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Search parameter for a resource.\n    A search parameter that defines a named search item that can be used to\n    search/filter on a resource.\n    \"\"\"\n\n    __resource_type__ = \"SearchParameter\"\n\n    base: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"The resource type(s) this search parameter applies to\",\n        description=(\n            \"The base resource type(s) that this search parameter can be used \"\n            \"against.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    base__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_base\", title=\"Extension field for ``base``.\"\n    )\n\n    chain: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"chain\",\n        title=\"Chained names supported\",\n        description=(\n            \"Contains the names of any search parameters which may be chained to \"\n            \"the containing search parameter. Chained parameters may be added to \"\n            \"search parameters of type reference and specify that resources will \"\n            \"only be returned if they contain a reference to a resource which \"\n            \"matches the chained parameter value. Values for this field should be \"\n            \"drawn from SearchParameter.code for a parameter on the target resource\"\n            \" type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    chain__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_chain\", title=\"Extension field for ``chain``.\"\n    )\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Recommended name for parameter in search url\",\n        description=(\n            \"The label that is recommended to be used in the URL or the parameter \"\n            \"name in a parameters resource for this search parameter.  In some \"\n            \"cases, servers may need to use a different CapabilityStatement \"\n            \"searchParam.name to differentiate between multiple SearchParameters \"\n            \"that happen to have the same code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    comparator: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"comparator\",\n        title=\"eq | ne | gt | lt | ge | le | sa | eb | ap\",\n        description=\"Comparators supported for the search parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"eq\", \"ne\", \"gt\", \"lt\", \"ge\", \"le\", \"sa\", \"eb\", \"ap\"],\n        },\n    )\n    comparator__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_comparator\", title=\"Extension field for ``comparator``.\"\n    )\n\n    component: typing.List[fhirtypes.SearchParameterComponentType] | None = Field(\n        default=None,\n        alias=\"component\",\n        title=\"For Composite resources to define the parts\",\n        description=\"Used to define the parts of a composite search parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    constraint: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"constraint\",\n        title=\"FHIRPath expression that constraints the usage of this SearchParamete\",\n        description=(\n            \"FHIRPath expression that defines/sets a complex constraint for when \"\n            \"this SearchParameter is applicable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    constraint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_constraint\", title=\"Extension field for ``constraint``.\"\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the search parameter and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the search parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the search parameter was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the search parameter \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFrom: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Original definition for the search parameter\",\n        description=(\n            \"Where this search parameter is originally defined. If a derivedFrom is\"\n            \" provided, then the details in the search parameter must be consistent\"\n            \" with the definition from which it is defined. i.e. the parameter \"\n            \"should have the same meaning, and (usually) the functionality should \"\n            \"be a proper subset of the underlying search parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SearchParameter\"],\n        },\n    )\n    derivedFrom__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_derivedFrom\", title=\"Extension field for ``derivedFrom``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the search parameter\",\n        description=\"And how it used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this search parameter is authored for\"\n            \" testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"FHIRPath expression that extracts the values\",\n        description=(\n            \"A FHIRPath expression that returns a set of elements for the search \"\n            \"parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the search parameter (business identifier)\",\n        description=(\n            \"A formal identifier that is used to identify this search parameter \"\n            \"when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for search parameter (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the search parameter is intended\"\n            \" to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    modifier: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=(\n            \"missing | exact | contains | not | text | in | not-in | below | above \"\n            \"| type | identifier | of-type | code-text | text-advanced | iterate\"\n        ),\n        description=\"A modifier supported for the search parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"missing\",\n                \"exact\",\n                \"contains\",\n                \"not\",\n                \"text\",\n                \"in\",\n                \"not-in\",\n                \"below\",\n                \"above\",\n                \"type\",\n                \"identifier\",\n                \"of-type\",\n                \"code-text\",\n                \"text-advanced\",\n                \"iterate\",\n            ],\n        },\n    )\n    modifier__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_modifier\", title=\"Extension field for ``modifier``.\"\n    )\n\n    multipleAnd: bool | None = Field(\n        default=None,\n        alias=\"multipleAnd\",\n        title=\"Allow multiple parameters (and)\",\n        description=(\n            \"Whether multiple parameters are allowed - e.g. more than one parameter\"\n            \" with the same name. The search matches if all the parameters match.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    multipleAnd__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_multipleAnd\", title=\"Extension field for ``multipleAnd``.\"\n    )\n\n    multipleOr: bool | None = Field(\n        default=None,\n        alias=\"multipleOr\",\n        title=\"Allow multiple values per parameter (or)\",\n        description=(\n            \"Whether multiple values are allowed for each time the parameter \"\n            \"exists. Values are separated by commas, and the parameter matches if \"\n            \"any of the values match.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    multipleOr__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_multipleOr\", title=\"Extension field for ``multipleOr``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this search parameter (computer friendly)\",\n        description=(\n            \"A natural language name identifying the search parameter. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    processingMode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"processingMode\",\n        title=\"normal | phonetic | other\",\n        description=(\n            \"How the search parameter relates to the set of elements returned by \"\n            \"evaluating the expression query.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"normal\", \"phonetic\", \"other\"],\n        },\n    )\n    processingMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_processingMode\",\n        title=\"Extension field for ``processingMode``.\",\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual tresponsible for the \"\n            \"release and ongoing maintenance of the search parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this search parameter is defined\",\n        description=(\n            \"Explanation of why this search parameter is needed and why it has been\"\n            \" designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this search parameter. Enables tracking the life-cycle \"\n            \"of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    target: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Types of resource (if a resource reference)\",\n        description=\"Types of resource (if a resource is referenced).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    target__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_target\", title=\"Extension field for ``target``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this search parameter (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the search parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"number | date | string | token | reference | composite | quantity | \"\n            \"uri | special\"\n        ),\n        description=(\n            \"The type of value that a search parameter may contain, and how the \"\n            \"content is interpreted.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"number\",\n                \"date\",\n                \"string\",\n                \"token\",\n                \"reference\",\n                \"composite\",\n                \"quantity\",\n                \"uri\",\n                \"special\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this search parameter, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this search parameter when it\"\n            \" is referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" search parameter is (or will be) published. This URL can be the \"\n            \"target of a canonical reference. It SHALL remain the same when the \"\n            \"search parameter is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate search parameter instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the search parameter\",\n        description=(\n            \"The identifier that is used to identify this version of the search \"\n            \"parameter when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the search parameter \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SearchParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"derivedFrom\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"code\",\n            \"base\",\n            \"type\",\n            \"expression\",\n            \"processingMode\",\n            \"constraint\",\n            \"target\",\n            \"multipleOr\",\n            \"multipleAnd\",\n            \"comparator\",\n            \"modifier\",\n            \"chain\",\n            \"component\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SearchParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"code\",\n            \"base\",\n            \"type\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"base\", \"base__ext\"),\n            (\"code\", \"code__ext\"),\n            (\"description\", \"description__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"type\", \"type__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass SearchParameterComponent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    For Composite resources to define the parts.\n    Used to define the parts of a composite search parameter.\n    \"\"\"\n\n    __resource_type__ = \"SearchParameterComponent\"\n\n    definition: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"definition\",\n        title=\"Defines how the part works\",\n        description=\"The definition of the search parameter that describes this part.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SearchParameter\"],\n        },\n    )\n    definition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_definition\", title=\"Extension field for ``definition``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Subexpression relative to main expression\",\n        description=(\n            \"A sub-expression that defines how to extract values for this component\"\n            \" from the output of the main SearchParameter.expression.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SearchParameterComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"definition\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SearchParameterComponent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"definition\", \"definition__ext\"),\n            (\"expression\", \"expression__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/servicerequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ServiceRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ServiceRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A request for a service to be performed.\n    A record of a request for service such as diagnostic investigations,\n    treatments, or operations to be performed.\n    \"\"\"\n\n    __resource_type__ = \"ServiceRequest\"\n\n    asNeededBoolean: bool | None = Field(\n        default=None,\n        alias=\"asNeededBoolean\",\n        title=\"Preconditions for service\",\n        description=(\n            \"If a CodeableConcept is present, it indicates the pre-condition for \"\n            'performing the service.  For example \"pain\", \"on flare-up\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n    asNeededBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_asNeededBoolean\",\n        title=\"Extension field for ``asNeededBoolean``.\",\n    )\n\n    asNeededCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"asNeededCodeableConcept\",\n        title=\"Preconditions for service\",\n        description=(\n            \"If a CodeableConcept is present, it indicates the pre-condition for \"\n            'performing the service.  For example \"pain\", \"on flare-up\", etc.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e asNeeded[x]\n            \"one_of_many\": \"asNeeded\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"Date request signed\",\n        description=\"When the request transitioned to being actionable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What request fulfills\",\n        description=\"Plan/proposal/order fulfilled by this request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CarePlan\", \"ServiceRequest\", \"MedicationRequest\"],\n        },\n    )\n\n    bodySite: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Coded location on Body\",\n        description=(\n            \"Anatomic location where the procedure should be performed. This is the\"\n            \" target site.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    bodyStructure: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"bodyStructure\",\n        title=\"BodyStructure-based location on the body\",\n        description=(\n            \"Anatomic location where the procedure should be performed. This is the\"\n            \" target site.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BodyStructure\"],\n        },\n    )\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Classification of service\",\n        description=(\n            \"A code that classifies the service for searching, sorting and display \"\n            'purposes (e.g. \"Surgical Procedure\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"What is being requested/ordered\",\n        description=(\n            \"A code or reference that identifies a particular service (i.e., \"\n            \"procedure, diagnostic investigation, or panel of investigations) that \"\n            \"have been requested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"True if service/procedure should not be performed\",\n        description=(\n            \"Set this to true if the record is saying that the service/procedure \"\n            \"should NOT be performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Encounter in which the request was created\",\n        description=(\n            \"An encounter that provides additional information about the healthcare\"\n            \" context in which this request is made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    focus: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=(\n            \"What the service request is about, when it is not about the subject of\"\n            \" record\"\n        ),\n        description=(\n            \"The actual focus of a service request when it is not the subject of \"\n            \"record representing something or someone associated with the subject \"\n            \"such as a spouse, parent, fetus, or donor. The focus of a service \"\n            \"request could also be an existing condition,  an intervention, the \"\n            \"subject's diet,  another service request on the subject,  or a body \"\n            \"structure such as tumor or implanted device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifiers assigned to this order\",\n        description=(\n            \"Identifiers assigned to this order instance by the orderer and/or the \"\n            \"receiver and/or order fulfiller.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Instantiates FHIR protocol or definition\",\n        description=(\n            \"The URL pointing to a FHIR-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"ServiceRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\", \"PlanDefinition\"],\n        },\n    )\n    instantiatesCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Instantiates external protocol or definition\",\n        description=(\n            \"The URL pointing to an externally maintained protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this ServiceRequest.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    insurance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Associated insurance coverage\",\n        description=(\n            \"Insurance plans, coverage extensions, pre-authorizations and/or pre-\"\n            \"determinations that may be needed for delivering the requested \"\n            \"service.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\", \"ClaimResponse\"],\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=\"proposal | plan | directive | order +\",\n        description=(\n            \"Whether the request is a proposal, plan, an original order or a reflex\"\n            \" order.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"proposal\", \"plan\", \"directive\", \"order\", \"+\"],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    location: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Requested location\",\n        description=(\n            \"The preferred location(s) where the procedure should actually happen \"\n            \"in coded or free text form. E.g. at home or nursing day care center.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments\",\n        description=(\n            \"Any other notes and comments made about the service request. For \"\n            \"example, internal billing notes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When service should occur\",\n        description=\"The date/time at which the requested service should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When service should occur\",\n        description=\"The date/time at which the requested service should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When service should occur\",\n        description=\"The date/time at which the requested service should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    orderDetail: typing.List[fhirtypes.ServiceRequestOrderDetailType] | None = Field(\n        default=None,\n        alias=\"orderDetail\",\n        title=\"Additional order information\",\n        description=(\n            \"Additional details and instructions about the how the services are to \"\n            \"be delivered.   For example, and order for a urinary catheter may have\"\n            \" an order detail for an external or indwelling catheter, or an order \"\n            \"for a bandage may require additional instructions specifying how the \"\n            \"bandage should be applied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patientInstruction: typing.List[\n        fhirtypes.ServiceRequestPatientInstructionType\n    ] | None = Field(\n        default=None,\n        alias=\"patientInstruction\",\n        title=\"Patient or consumer-oriented instructions\",\n        description=\"Instructions in terms that are understood by the patient or consumer.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    performer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Requested performer\",\n        description=(\n            \"The desired performer for doing the requested service.  For example, \"\n            \"the surgeon, dermatopathologist, endoscopist, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"HealthcareService\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    performerType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=\"Performer role\",\n        description=\"Desired type of performer for doing the requested service.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the ServiceRequest should be addressed with \"\n            \"respect to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    quantityQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantityQuantity\",\n        title=\"Service amount\",\n        description=(\n            \"An amount of service being requested which can be a quantity ( for \"\n            \"example $1,500 home modification), a ratio ( for example, 20 half day \"\n            \"visits per month), or a range (2.0 to 1.8 Gy per fraction).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e quantity[x]\n            \"one_of_many\": \"quantity\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    quantityRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"quantityRange\",\n        title=\"Service amount\",\n        description=(\n            \"An amount of service being requested which can be a quantity ( for \"\n            \"example $1,500 home modification), a ratio ( for example, 20 half day \"\n            \"visits per month), or a range (2.0 to 1.8 Gy per fraction).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e quantity[x]\n            \"one_of_many\": \"quantity\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    quantityRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"quantityRatio\",\n        title=\"Service amount\",\n        description=(\n            \"An amount of service being requested which can be a quantity ( for \"\n            \"example $1,500 home modification), a ratio ( for example, 20 half day \"\n            \"visits per month), or a range (2.0 to 1.8 Gy per fraction).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e quantity[x]\n            \"one_of_many\": \"quantity\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Explanation/Justification for procedure or service\",\n        description=(\n            \"An explanation or justification for why this service is being \"\n            \"requested in coded or textual form.   This is often for billing \"\n            \"purposes.  May relate to the resources referred to in \"\n            \"`supportingInfo`.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n                \"DetectedIssue\",\n            ],\n        },\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Request provenance\",\n        description=\"Key events in the history of the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    replaces: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"replaces\",\n        title=\"What request replaces\",\n        description=(\n            \"The request takes the place of the referenced completed or terminated \"\n            \"request(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who/what is requesting service\",\n        description=(\n            \"The individual who initiated the request and has responsibility for \"\n            \"its activation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n            ],\n        },\n    )\n\n    requisition: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"requisition\",\n        title=\"Composite Request ID\",\n        description=(\n            \"A shared identifier common to all service requests that were \"\n            \"authorized more or less simultaneously by a single author, \"\n            \"representing the composite or group identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    specimen: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"specimen\",\n        title=\"Procedure Samples\",\n        description=\"One or more specimens that the laboratory procedure will use.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"draft | active | on-hold | revoked | completed | entered-in-error | \"\n            \"unknown\"\n        ),\n        description=\"The status of the order.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"draft\",\n                \"active\",\n                \"on-hold\",\n                \"revoked\",\n                \"completed\",\n                \"entered-in-error\",\n                \"unknown\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subject\",\n        title=\"Individual or Entity the service is ordered for\",\n        description=(\n            \"On whom or what the service is to be performed. This is usually a \"\n            \"human patient, but can also be requested on animals, groups of humans \"\n            \"or animals, devices such as dialysis machines, or even locations \"\n            \"(typically for environmental scans).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\", \"Group\", \"Location\", \"Device\"],\n        },\n    )\n\n    supportingInfo: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"supportingInfo\",\n        title=\"Additional clinical information\",\n        description=(\n            \"Additional clinical information about the patient or specimen that may\"\n            \" influence the services or their interpretations.     This information\"\n            \" includes diagnosis, clinical findings and other observations.  In \"\n            'laboratory ordering these are typically referred to as \"ask at order '\n            'entry questions (AOEs)\".  This includes observations explicitly '\n            \"requested by the producer (filler) to provide context or supporting \"\n            \"information needed to complete the order. For example,  reporting the \"\n            \"amount of inspired oxygen for blood gas measurements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ServiceRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"replaces\",\n            \"requisition\",\n            \"status\",\n            \"intent\",\n            \"category\",\n            \"priority\",\n            \"doNotPerform\",\n            \"code\",\n            \"orderDetail\",\n            \"quantityQuantity\",\n            \"quantityRatio\",\n            \"quantityRange\",\n            \"subject\",\n            \"focus\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n            \"authoredOn\",\n            \"requester\",\n            \"performerType\",\n            \"performer\",\n            \"location\",\n            \"reason\",\n            \"insurance\",\n            \"supportingInfo\",\n            \"specimen\",\n            \"bodySite\",\n            \"bodyStructure\",\n            \"note\",\n            \"patientInstruction\",\n            \"relevantHistory\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ServiceRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"replaces\",\n            \"requisition\",\n            \"status\",\n            \"intent\",\n            \"category\",\n            \"priority\",\n            \"doNotPerform\",\n            \"code\",\n            \"orderDetail\",\n            \"quantityQuantity\",\n            \"quantityRatio\",\n            \"quantityRange\",\n            \"subject\",\n            \"focus\",\n            \"encounter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"asNeededBoolean\",\n            \"asNeededCodeableConcept\",\n            \"authoredOn\",\n            \"requester\",\n            \"performerType\",\n            \"performer\",\n            \"location\",\n            \"reason\",\n            \"specimen\",\n            \"bodySite\",\n            \"bodyStructure\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"asNeeded\": [\"asNeededBoolean\", \"asNeededCodeableConcept\"],\n            \"occurrence\": [\n                \"occurrenceDateTime\",\n                \"occurrencePeriod\",\n                \"occurrenceTiming\",\n            ],\n            \"quantity\": [\"quantityQuantity\", \"quantityRange\", \"quantityRatio\"],\n        }\n        return one_of_many_fields\n\n\nclass ServiceRequestOrderDetail(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional order information.\n    Additional details and instructions about the how the services are to be\n    delivered.   For example, and order for a urinary catheter may have an\n    order detail for an external or indwelling catheter, or an order for a\n    bandage may require additional instructions specifying how the bandage\n    should be applied.\n    \"\"\"\n\n    __resource_type__ = \"ServiceRequestOrderDetail\"\n\n    parameter: typing.List[fhirtypes.ServiceRequestOrderDetailParameterType] = Field(\n        default=...,\n        alias=\"parameter\",\n        title=\"The parameter details for the service being requested\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    parameterFocus: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"parameterFocus\",\n        title=\"The context of the order details by reference\",\n        description=\"Indicates the context of the order details by reference.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"DeviceDefinition\",\n                \"DeviceRequest\",\n                \"SupplyRequest\",\n                \"Medication\",\n                \"MedicationRequest\",\n                \"BiologicallyDerivedProduct\",\n                \"Substance\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ServiceRequestOrderDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"parameterFocus\", \"parameter\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ServiceRequestOrderDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"parameter\"]\n\n\nclass ServiceRequestOrderDetailParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The parameter details for the service being requested.\n    \"\"\"\n\n    __resource_type__ = \"ServiceRequestOrderDetailParameter\"\n\n    code: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"The detail of the order being requested\",\n        description=(\n            \"A value representing the additional detail or instructions for the \"\n            \"order (e.g., catheter insertion, body elevation, descriptive device \"\n            \"configuration and/or setting instructions).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"The value for the order detail\",\n        description=\"Indicates a value for the order detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"The value for the order detail\",\n        description=\"Indicates a value for the order detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"The value for the order detail\",\n        description=\"Indicates a value for the order detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"The value for the order detail\",\n        description=\"Indicates a value for the order detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"The value for the order detail\",\n        description=\"Indicates a value for the order detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"The value for the order detail\",\n        description=\"Indicates a value for the order detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"The value for the order detail\",\n        description=\"Indicates a value for the order detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ServiceRequestOrderDetailParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueQuantity\",\n            \"valueRatio\",\n            \"valueRange\",\n            \"valueBoolean\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valuePeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ServiceRequestOrderDetailParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"code\",\n            \"valueQuantity\",\n            \"valueRatio\",\n            \"valueRange\",\n            \"valueBoolean\",\n            \"valueCodeableConcept\",\n            \"valueString\",\n            \"valuePeriod\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valuePeriod\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ServiceRequestPatientInstruction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Patient or consumer-oriented instructions.\n    Instructions in terms that are understood by the patient or consumer.\n    \"\"\"\n\n    __resource_type__ = \"ServiceRequestPatientInstruction\"\n\n    instructionMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"instructionMarkdown\",\n        title=\"Patient or consumer-oriented instructions\",\n        description=\"Instructions in terms that are understood by the patient or consumer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e instruction[x]\n            \"one_of_many\": \"instruction\",\n            \"one_of_many_required\": False,\n        },\n    )\n    instructionMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instructionMarkdown\",\n        title=\"Extension field for ``instructionMarkdown``.\",\n    )\n\n    instructionReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"instructionReference\",\n        title=\"Patient or consumer-oriented instructions\",\n        description=\"Instructions in terms that are understood by the patient or consumer.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e instruction[x]\n            \"one_of_many\": \"instruction\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ServiceRequestPatientInstruction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"instructionMarkdown\",\n            \"instructionReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ServiceRequestPatientInstruction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"instructionMarkdown\", \"instructionReference\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"instruction\": [\"instructionMarkdown\", \"instructionReference\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/signature.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Signature\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass Signature(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A Signature - XML DigSig, JWS, Graphical image of signature, etc..\n    A signature along with supporting context. The signature may be a digital\n    signature that is cryptographic in nature, or some other signature\n    acceptable to the domain. This other signature may be as simple as a\n    graphical image representing a hand-written signature, or a signature\n    ceremony Different signature approaches have different utilities.\n    \"\"\"\n\n    __resource_type__ = \"Signature\"\n\n    data: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"The actual signature content (XML DigSig. JWS, picture, etc.)\",\n        description=(\n            \"The base64 encoding of the Signature content. When signature is not \"\n            \"recorded electronically this element would be empty.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    data__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_data\", title=\"Extension field for ``data``.\"\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=\"The party represented\",\n        description=(\n            \"A reference to an application-usable description of the identity that \"\n            \"is represented by the signature.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Device\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    sigFormat: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"sigFormat\",\n        title=\"The technical format of the signature\",\n        description=(\n            \"A mime type that indicates the technical format of the signature. \"\n            \"Important mime types are application/signature+xml for X ML DigSig, \"\n            \"application/jose for JWS, and image/* for a graphical image of a \"\n            \"signature, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sigFormat__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sigFormat\", title=\"Extension field for ``sigFormat``.\"\n    )\n\n    targetFormat: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"targetFormat\",\n        title=\"The technical format of the signed resources\",\n        description=(\n            \"A mime type that indicates the technical format of the target \"\n            \"resources signed by the signature.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    targetFormat__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_targetFormat\",\n        title=\"Extension field for ``targetFormat``.\",\n    )\n\n    type: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Indication of the reason the entity signed the object(s)\",\n        description=(\n            \"An indication of the reason that the entity signed this document. This\"\n            \" may be explicitly included as part of the signature information and \"\n            \"can be used when determining accountability for various actions \"\n            \"concerning the document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    when: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"when\",\n        title=\"When the signature was created\",\n        description=\"When the digital signature was signed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    when__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_when\", title=\"Extension field for ``when``.\"\n    )\n\n    who: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"who\",\n        title=\"Who signed\",\n        description=(\n            \"A reference to an application-usable description of the identity that \"\n            \"signed  (e.g. the signature used their private key).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Device\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Signature`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"when\",\n            \"who\",\n            \"onBehalfOf\",\n            \"targetFormat\",\n            \"sigFormat\",\n            \"data\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Signature`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"type\", \"when\", \"who\", \"onBehalfOf\"]\n"
  },
  {
    "path": "fhir/resources/slot.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Slot\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import domainresource, fhirtypes\n\n\nclass Slot(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A slot of time on a schedule that may be available for booking appointments.\n    \"\"\"\n\n    __resource_type__ = \"Slot\"\n\n    appointmentType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"appointmentType\",\n        title=(\n            \"The style of appointment or patient that may be booked in the slot \"\n            \"(not service type)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=(\n            \"Comments on the slot to describe any extended information. Such as \"\n            \"custom constraints on the slot\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    end: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"Date/Time that the slot is to conclude\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Ids for this item\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    overbooked: bool | None = Field(\n        default=None,\n        alias=\"overbooked\",\n        title=(\n            \"This slot has already been overbooked, appointments are unlikely to be\"\n            \" accepted for this time\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    overbooked__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_overbooked\", title=\"Extension field for ``overbooked``.\"\n    )\n\n    schedule: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"schedule\",\n        title=(\n            \"The schedule resource that this slot defines an interval of status \"\n            \"information\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Schedule\"],\n        },\n    )\n\n    serviceCategory: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"serviceCategory\",\n        title=(\n            \"A broad categorization of the service that is to be performed during \"\n            \"this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    serviceType: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"serviceType\",\n        title=(\n            \"The type of appointments that can be booked into this slot (ideally \"\n            \"this would be an identifiable service - which is at a location, rather\"\n            \" than the location itself). If provided then this overrides the value \"\n            \"provided on the Schedule resource\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"HealthcareService\"],\n        },\n    )\n\n    specialty: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"specialty\",\n        title=(\n            \"The specialty of a practitioner that would be required to perform the \"\n            \"service requested in this appointment\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    start: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"start\",\n        title=\"Date/Time that the slot is to begin\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    start__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_start\", title=\"Extension field for ``start``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"busy | free | busy-unavailable | busy-tentative | entered-in-error\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"busy\",\n                \"free\",\n                \"busy-unavailable\",\n                \"busy-tentative\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Slot`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"appointmentType\",\n            \"schedule\",\n            \"status\",\n            \"start\",\n            \"end\",\n            \"overbooked\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Slot`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"serviceCategory\",\n            \"serviceType\",\n            \"specialty\",\n            \"appointmentType\",\n            \"schedule\",\n            \"status\",\n            \"start\",\n            \"end\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"end\", \"end__ext\"),\n            (\"start\", \"start__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/specimen.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Specimen\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Specimen(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Sample for analysis.\n    A sample to be used for analysis.\n    \"\"\"\n\n    __resource_type__ = \"Specimen\"\n\n    accessionIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"accessionIdentifier\",\n        title=\"Identifier assigned by the lab\",\n        description=(\n            \"The identifier assigned by the lab when accessioning specimen(s). This\"\n            \" is not necessarily the same as the specimen identifier, depending on \"\n            \"local lab procedures.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    collection: fhirtypes.SpecimenCollectionType | None = Field(\n        default=None,\n        alias=\"collection\",\n        title=\"Collection details\",\n        description=\"Details concerning the specimen collection.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    combined: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"combined\",\n        title=\"grouped | pooled\",\n        description=\"This element signifies if the specimen is part of a group or pooled.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"grouped\", \"pooled\"],\n        },\n    )\n    combined__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_combined\", title=\"Extension field for ``combined``.\"\n    )\n\n    condition: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"State of the specimen\",\n        description=\"A mode or state of being that describes the nature of the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    container: typing.List[fhirtypes.SpecimenContainerType] | None = Field(\n        default=None,\n        alias=\"container\",\n        title=\"Direct container of specimen (tube/slide, etc.)\",\n        description=(\n            \"The container holding the specimen.  The recursive nature of \"\n            \"containers; i.e. blood in tube in tray in rack is not addressed here.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    feature: typing.List[fhirtypes.SpecimenFeatureType] | None = Field(\n        default=None,\n        alias=\"feature\",\n        title=\"The physical feature of a specimen\",\n        description=(\n            \"A physical feature or landmark on a specimen, highlighted for context \"\n            \"by the collector of the specimen (e.g. surgeon), that identifies the \"\n            \"type of feature as well as its meaning (e.g. the red ink indicating \"\n            \"the resection margin of the right lobe of the excised prostate tissue \"\n            \"or wire loop at radiologically suspected tumor location).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External Identifier\",\n        description=\"Id for specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments\",\n        description=(\n            \"To communicate any details or issues about the specimen or during the \"\n            \"specimen collection. (for example: broken vial, sent with patient, \"\n            \"frozen).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    parent: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"parent\",\n        title=\"Specimen from which this specimen originated\",\n        description=(\n            \"Reference to the parent (source) specimen which is used when the \"\n            \"specimen was either derived from or a component of another specimen.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Specimen\"],\n        },\n    )\n\n    processing: typing.List[fhirtypes.SpecimenProcessingType] | None = Field(\n        default=None,\n        alias=\"processing\",\n        title=\"Processing and processing step details\",\n        description=\"Details concerning processing and processing steps for the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    receivedTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"receivedTime\",\n        title=\"The time when specimen is received by the testing laboratory\",\n        description=(\n            \"Time when specimen is received by the testing laboratory for \"\n            \"processing or testing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    receivedTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_receivedTime\",\n        title=\"Extension field for ``receivedTime``.\",\n    )\n\n    request: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"request\",\n        title=\"Why the specimen was collected\",\n        description=(\n            \"Details concerning a service request that required a specimen to be \"\n            \"collected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ServiceRequest\"],\n        },\n    )\n\n    role: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"The role the specimen serves\",\n        description=\"The role or reason for the specimen in the testing workflow.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"available | unavailable | unsatisfactory | entered-in-error\",\n        description=\"The availability of the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"available\",\n                \"unavailable\",\n                \"unsatisfactory\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subject: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subject\",\n        title=(\n            \"Where the specimen came from. This may be from patient(s), from a \"\n            \"location (e.g., the source of an environmental sample), or a sampling \"\n            \"of a substance, a biologically-derived product, or a device\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Group\",\n                \"Device\",\n                \"BiologicallyDerivedProduct\",\n                \"Substance\",\n                \"Location\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of material that forms the specimen\",\n        description=\"The kind of material that forms the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Specimen`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"accessionIdentifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"receivedTime\",\n            \"parent\",\n            \"request\",\n            \"combined\",\n            \"role\",\n            \"feature\",\n            \"collection\",\n            \"processing\",\n            \"container\",\n            \"condition\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Specimen`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"accessionIdentifier\",\n            \"status\",\n            \"type\",\n            \"subject\",\n            \"receivedTime\",\n            \"combined\",\n            \"condition\",\n        ]\n\n\nclass SpecimenCollection(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Collection details.\n    Details concerning the specimen collection.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenCollection\"\n\n    bodySite: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"bodySite\",\n        title=\"Anatomical collection site\",\n        description=(\n            \"Anatomical location from which the specimen was collected (if subject \"\n            \"is a patient). This is the target site.  This element is not used for \"\n            \"environmental specimens.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"BodyStructure\"],\n        },\n    )\n\n    collectedDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"collectedDateTime\",\n        title=\"Collection time\",\n        description=(\n            \"Time when specimen was collected from subject - the physiologically \"\n            \"relevant time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e collected[x]\n            \"one_of_many\": \"collected\",\n            \"one_of_many_required\": False,\n        },\n    )\n    collectedDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_collectedDateTime\",\n        title=\"Extension field for ``collectedDateTime``.\",\n    )\n\n    collectedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"collectedPeriod\",\n        title=\"Collection time\",\n        description=(\n            \"Time when specimen was collected from subject - the physiologically \"\n            \"relevant time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e collected[x]\n            \"one_of_many\": \"collected\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    collector: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"collector\",\n        title=\"Who collected the specimen\",\n        description=\"Person who collected the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    device: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"device\",\n        title=\"Device used to perform collection\",\n        description=(\n            \"A coded value specifying the technique that is used to perform the \"\n            \"procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    duration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"How long it took to collect specimen\",\n        description=\"The span of time over which the collection of a specimen occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    fastingStatusCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fastingStatusCodeableConcept\",\n        title=\"Whether or how long patient abstained from food and/or drink\",\n        description=(\n            \"Abstinence or reduction from some or all food, drink, or both, for a \"\n            \"period of time prior to sample collection.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fastingStatus[x]\n            \"one_of_many\": \"fastingStatus\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    fastingStatusDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"fastingStatusDuration\",\n        title=\"Whether or how long patient abstained from food and/or drink\",\n        description=(\n            \"Abstinence or reduction from some or all food, drink, or both, for a \"\n            \"period of time prior to sample collection.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e fastingStatus[x]\n            \"one_of_many\": \"fastingStatus\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Technique used to perform collection\",\n        description=(\n            \"A coded value specifying the technique that is used to perform the \"\n            \"procedure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    procedure: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"procedure\",\n        title=\"The procedure that collects the specimen\",\n        description=(\n            \"The procedure event during which the specimen was collected (e.g. the \"\n            \"surgery leading to the collection of a pathology sample).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Procedure\"],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"The quantity of specimen collected\",\n        description=(\n            \"The quantity of specimen collected; for instance the volume of a blood\"\n            \" sample, or the physical measurement of an anatomic pathology sample.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenCollection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"collector\",\n            \"collectedDateTime\",\n            \"collectedPeriod\",\n            \"duration\",\n            \"quantity\",\n            \"method\",\n            \"device\",\n            \"procedure\",\n            \"bodySite\",\n            \"fastingStatusCodeableConcept\",\n            \"fastingStatusDuration\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenCollection`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"collector\",\n            \"collectedDateTime\",\n            \"collectedPeriod\",\n            \"duration\",\n            \"fastingStatusCodeableConcept\",\n            \"fastingStatusDuration\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"collected\": [\"collectedDateTime\", \"collectedPeriod\"],\n            \"fastingStatus\": [\"fastingStatusCodeableConcept\", \"fastingStatusDuration\"],\n        }\n        return one_of_many_fields\n\n\nclass SpecimenContainer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Direct container of specimen (tube/slide, etc.).\n    The container holding the specimen.  The recursive nature of containers;\n    i.e. blood in tube in tray in rack is not addressed here.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenContainer\"\n\n    device: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"device\",\n        title=\"Device resource for the container\",\n        description=(\n            \"The device resource for the the container holding the specimen. If the\"\n            \" container is in a holder then the referenced device will point to a \"\n            \"parent device.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Device\"],\n        },\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where the container is\",\n        description=\"The location of the container holding the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    specimenQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"specimenQuantity\",\n        title=\"Quantity of specimen within container\",\n        description=(\n            \"The quantity of specimen in the container; may be volume, dimensions, \"\n            \"or other appropriate measurements, depending on the specimen type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenContainer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"device\",\n            \"location\",\n            \"specimenQuantity\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenContainer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass SpecimenFeature(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The physical feature of a specimen.\n    A physical feature or landmark on a specimen, highlighted for context by\n    the collector of the specimen (e.g. surgeon), that identifies the type of\n    feature as well as its meaning (e.g. the red ink indicating the resection\n    margin of the right lobe of the excised prostate tissue or wire loop at\n    radiologically suspected tumor location).\n    \"\"\"\n\n    __resource_type__ = \"SpecimenFeature\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Information about the feature\",\n        description=\"Description of the feature of the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Highlighted feature\",\n        description=\"The landmark or feature being highlighted.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenFeature`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"description\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenFeature`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"description\", \"description__ext\")]\n        return required_fields\n\n\nclass SpecimenProcessing(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Processing and processing step details.\n    Details concerning processing and processing steps for the specimen.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenProcessing\"\n\n    additive: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"additive\",\n        title=\"Material used in the processing step\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of procedure\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"Indicates the treatment step  applied to the specimen\",\n        description=\"A coded value specifying the method used to process the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timeDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timeDateTime\",\n        title=\"Date and time of specimen processing\",\n        description=(\n            \"A record of the time or period when the specimen processing occurred.\"\n            \"  For example the time of sample fixation or the period of time the \"\n            \"sample was in formalin.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e time[x]\n            \"one_of_many\": \"time\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timeDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timeDateTime\",\n        title=\"Extension field for ``timeDateTime``.\",\n    )\n\n    timePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"timePeriod\",\n        title=\"Date and time of specimen processing\",\n        description=(\n            \"A record of the time or period when the specimen processing occurred.\"\n            \"  For example the time of sample fixation or the period of time the \"\n            \"sample was in formalin.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e time[x]\n            \"one_of_many\": \"time\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenProcessing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"method\",\n            \"additive\",\n            \"timeDateTime\",\n            \"timePeriod\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenProcessing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"time\": [\"timeDateTime\", \"timePeriod\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/specimendefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SpecimenDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SpecimenDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Kind of specimen.\n    A kind of specimen with associated set of requirements.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenDefinition\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When SpecimenDefinition was approved by publisher\",\n        description=(\n            \"The date on which the asset content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    collection: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"collection\",\n        title=\"Specimen collection procedure\",\n        description=\"The action to be performed for collecting the specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"Copyright statement relating to the SpecimenDefinition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the SpecimenDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date status first applied\",\n        description=(\n            \"For draft definitions, indicates the date of initial creation. For \"\n            \"active definitions, represents the date of activation. For withdrawn \"\n            \"definitions, indicates the date of withdrawal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFromCanonical: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"derivedFromCanonical\",\n        title=\"Based on FHIR definition of another SpecimenDefinition\",\n        description=(\n            \"The canonical URL pointing to another FHIR-defined SpecimenDefinition \"\n            \"that is adhered to in whole or in part by this definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SpecimenDefinition\"],\n        },\n    )\n    derivedFromCanonical__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_derivedFromCanonical\",\n        title=\"Extension field for ``derivedFromCanonical``.\",\n    )\n\n    derivedFromUri: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"derivedFromUri\",\n        title=\"Based on external definition\",\n        description=(\n            \"The URL pointing to an externally-defined type of specimen, guideline \"\n            \"or other definition that is adhered to in whole or in part by this \"\n            \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    derivedFromUri__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_derivedFromUri\",\n        title=\"Extension field for ``derivedFromUri``.\",\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the SpecimenDefinition\",\n        description=(\n            \"A free text natural language description of the SpecimenDefinition \"\n            \"from the consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"The effective date range for the SpecimenDefinition\",\n        description=(\n            \"The period during which the SpecimenDefinition content was or is \"\n            \"planned to be effective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"If this SpecimenDefinition is not for real usage\",\n        description=(\n            \"A flag to indicate that this SpecimenDefinition is not authored for  \"\n            \"genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier\",\n        description=\"A business identifier assigned to this SpecimenDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for this SpecimenDefinition (if applicable)\",\n        description=\"A jurisdiction in which the SpecimenDefinition is intended to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"The date on which the asset content was last reviewed by the publisher\",\n        description=(\n            \"The date on which the asset content was last reviewed. Review happens \"\n            \"periodically after that, but doesn't change the original approval \"\n            \"date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this {{title}} (computer friendly)\",\n        description=(\n            \"A natural language name identifying the {{title}}. This name should be\"\n            \" usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    patientPreparation: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"patientPreparation\",\n        title=\"Patient preparation for collection\",\n        description=\"Preparation of the patient for specimen collection.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=(\n            \"The name of the individual or organization that published the \"\n            \"SpecimenDefinition\"\n        ),\n        description=(\n            'Helps establish the \"authority/credibility\" of the SpecimenDefinition.'\n            \" May also allow for contact.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this SpecimenDefinition is defined\",\n        description=(\n            \"Explains why this SpecimeDefinition is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The current state of theSpecimenDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subjectCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"subjectCodeableConcept\",\n        title=\"Type of subject for specimen collection\",\n        description=(\n            \"A code or group definition that describes the intended subject  from \"\n            \"which this kind of specimen is to be collected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    subjectReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"subjectReference\",\n        title=\"Type of subject for specimen collection\",\n        description=(\n            \"A code or group definition that describes the intended subject  from \"\n            \"which this kind of specimen is to be collected.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e subject[x]\n            \"one_of_many\": \"subject\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Group\"],\n        },\n    )\n\n    timeAspect: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"timeAspect\",\n        title=\"Time aspect for collection\",\n        description=\"Time aspect of specimen collection (duration or offset).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    timeAspect__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timeAspect\", title=\"Extension field for ``timeAspect``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this SpecimenDefinition (Human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the SpecimenDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    typeCollected: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"typeCollected\",\n        title=\"Kind of material to collect\",\n        description=\"The kind of material to be collected.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    typeTested: typing.List[fhirtypes.SpecimenDefinitionTypeTestedType] | None = Field(\n        default=None,\n        alias=\"typeTested\",\n        title=\"Specimen in container intended for testing by lab\",\n        description=(\n            \"Specimen conditioned in a container as expected by the testing \"\n            \"laboratory.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Logical canonical URL to reference this SpecimenDefinition (globally \"\n            \"unique)\"\n        ),\n        description=(\n            \"An absolute URL that is used to identify this SpecimenDefinition when \"\n            \"it is referenced in a specification, model, design or an instance. \"\n            \"This SHALL be a URL, SHOULD be globally unique, and SHOULD be an \"\n            \"address at which this SpecimenDefinition is (or will be) published. \"\n            \"The URL SHOULD include the major version of the SpecimenDefinition. \"\n            \"For more information see Technical and Business Versions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Content intends to support these contexts\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching of specimen definitions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the SpecimenDefinition\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"SpecimenDefinition when it is referenced in a specification, model, \"\n            \"design or instance. This is an arbitrary value managed by the \"\n            \"SpecimenDefinition author and is not expected to be globally unique.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"derivedFromCanonical\",\n            \"derivedFromUri\",\n            \"status\",\n            \"experimental\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"typeCollected\",\n            \"patientPreparation\",\n            \"timeAspect\",\n            \"collection\",\n            \"typeTested\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"derivedFromCanonical\",\n            \"derivedFromUri\",\n            \"status\",\n            \"experimental\",\n            \"subjectCodeableConcept\",\n            \"subjectReference\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"typeCollected\",\n            \"patientPreparation\",\n            \"timeAspect\",\n            \"collection\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"subject\": [\"subjectCodeableConcept\", \"subjectReference\"],\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"],\n        }\n        return one_of_many_fields\n\n\nclass SpecimenDefinitionTypeTested(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specimen in container intended for testing by lab.\n    Specimen conditioned in a container as expected by the testing laboratory.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenDefinitionTypeTested\"\n\n    container: fhirtypes.SpecimenDefinitionTypeTestedContainerType | None = Field(\n        default=None,\n        alias=\"container\",\n        title=\"The specimen's container\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    handling: typing.List[\n        fhirtypes.SpecimenDefinitionTypeTestedHandlingType\n    ] | None = Field(\n        default=None,\n        alias=\"handling\",\n        title=\"Specimen handling before testing\",\n        description=(\n            \"Set of instructions for preservation/transport of the specimen at a \"\n            \"defined temperature interval, prior the testing process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    isDerived: bool | None = Field(\n        default=None,\n        alias=\"isDerived\",\n        title=\"Primary or secondary specimen\",\n        description=\"Primary of secondary specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    isDerived__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isDerived\", title=\"Extension field for ``isDerived``.\"\n    )\n\n    preference: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"preference\",\n        title=\"preferred | alternate\",\n        description=\"The preference for this type of conditioned specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"preferred\", \"alternate\"],\n        },\n    )\n    preference__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preference\", title=\"Extension field for ``preference``.\"\n    )\n\n    rejectionCriterion: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"rejectionCriterion\",\n        title=\"Criterion specified for specimen rejection\",\n        description=(\n            \"Criterion for rejection of the specimen in its container by the \"\n            \"laboratory.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requirement: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"requirement\",\n        title=\"Requirements for specimen delivery and special handling\",\n        description=(\n            \"Requirements for delivery and special handling of this kind of \"\n            \"conditioned specimen.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    requirement__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requirement\", title=\"Extension field for ``requirement``.\"\n    )\n\n    retentionTime: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"retentionTime\",\n        title=\"The usual time for retaining this kind of specimen\",\n        description=(\n            \"The usual time that a specimen of this kind is retained after the \"\n            \"ordered tests are completed, for the purpose of additional testing.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    singleUse: bool | None = Field(\n        default=None,\n        alias=\"singleUse\",\n        title=\"Specimen for single use only\",\n        description='Specimen can be used by only one test or panel if the value is \"true\".',\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    singleUse__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_singleUse\", title=\"Extension field for ``singleUse``.\"\n    )\n\n    testingDestination: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"testingDestination\",\n        title=\"Where the specimen will be tested\",\n        description=(\n            \"Where the specimen will be tested: e.g., lab, sector, device or any \"\n            \"combination of these.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of intended specimen\",\n        description=\"The kind of specimen conditioned for testing expected by lab.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenDefinitionTypeTested`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"isDerived\",\n            \"type\",\n            \"preference\",\n            \"container\",\n            \"requirement\",\n            \"retentionTime\",\n            \"singleUse\",\n            \"rejectionCriterion\",\n            \"handling\",\n            \"testingDestination\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTested`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"preference\", \"preference__ext\")]\n        return required_fields\n\n\nclass SpecimenDefinitionTypeTestedContainer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The specimen's container.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenDefinitionTypeTestedContainer\"\n\n    additive: typing.List[\n        fhirtypes.SpecimenDefinitionTypeTestedContainerAdditiveType\n    ] | None = Field(\n        default=None,\n        alias=\"additive\",\n        title=\"Additive associated with container\",\n        description=(\n            \"Substance introduced in the kind of container to preserve, maintain or\"\n            \" enhance the specimen. Examples: Formalin, Citrate, EDTA.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    cap: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"cap\",\n        title=\"Color of container cap\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    capacity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"capacity\",\n        title=\"The capacity of this kind of container\",\n        description=\"The capacity (volume or other measure) of this kind of container.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The description of the kind of container\",\n        description=\"The textual description of the kind of container.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    material: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"material\",\n        title=\"The material type used for the container\",\n        description=\"The type of material of the container.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    minimumVolumeQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"minimumVolumeQuantity\",\n        title=\"Minimum volume\",\n        description=\"The minimum volume to be conditioned in the container.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e minimumVolume[x]\n            \"one_of_many\": \"minimumVolume\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    minimumVolumeString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"minimumVolumeString\",\n        title=\"Minimum volume\",\n        description=\"The minimum volume to be conditioned in the container.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e minimumVolume[x]\n            \"one_of_many\": \"minimumVolume\",\n            \"one_of_many_required\": False,\n        },\n    )\n    minimumVolumeString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_minimumVolumeString\",\n        title=\"Extension field for ``minimumVolumeString``.\",\n    )\n\n    preparation: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"preparation\",\n        title=\"Special processing applied to the container for this specimen type\",\n        description=(\n            \"Special processing that should be applied to the container for this \"\n            \"kind of specimen.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    preparation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preparation\", title=\"Extension field for ``preparation``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Kind of container associated with the kind of specimen\",\n        description=\"The type of container used to contain this kind of specimen.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenDefinitionTypeTestedContainer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"material\",\n            \"type\",\n            \"cap\",\n            \"description\",\n            \"capacity\",\n            \"minimumVolumeQuantity\",\n            \"minimumVolumeString\",\n            \"additive\",\n            \"preparation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTestedContainer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"minimumVolume\": [\"minimumVolumeQuantity\", \"minimumVolumeString\"]\n        }\n        return one_of_many_fields\n\n\nclass SpecimenDefinitionTypeTestedContainerAdditive(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additive associated with container.\n    Substance introduced in the kind of container to preserve, maintain or\n    enhance the specimen. Examples: Formalin, Citrate, EDTA.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenDefinitionTypeTestedContainerAdditive\"\n\n    additiveCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"additiveCodeableConcept\",\n        title=\"Additive associated with container\",\n        description=(\n            \"Substance introduced in the kind of container to preserve, maintain or\"\n            \" enhance the specimen. Examples: Formalin, Citrate, EDTA.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e additive[x]\n            \"one_of_many\": \"additive\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    additiveReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"additiveReference\",\n        title=\"Additive associated with container\",\n        description=(\n            \"Substance introduced in the kind of container to preserve, maintain or\"\n            \" enhance the specimen. Examples: Formalin, Citrate, EDTA.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e additive[x]\n            \"one_of_many\": \"additive\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceDefinition\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenDefinitionTypeTestedContainerAdditive`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"additiveCodeableConcept\",\n            \"additiveReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTestedContainerAdditive`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"additive\": [\"additiveCodeableConcept\", \"additiveReference\"]\n        }\n        return one_of_many_fields\n\n\nclass SpecimenDefinitionTypeTestedHandling(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specimen handling before testing.\n    Set of instructions for preservation/transport of the specimen at a defined\n    temperature interval, prior the testing process.\n    \"\"\"\n\n    __resource_type__ = \"SpecimenDefinitionTypeTestedHandling\"\n\n    instruction: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"instruction\",\n        title=\"Preservation instruction\",\n        description=(\n            \"Additional textual instructions for the preservation or transport of \"\n            \"the specimen. For instance, 'Protect from light exposure'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    instruction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_instruction\", title=\"Extension field for ``instruction``.\"\n    )\n\n    maxDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"maxDuration\",\n        title=\"Maximum preservation time\",\n        description=(\n            \"The maximum time interval of preservation of the specimen with these \"\n            \"conditions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    temperatureQualifier: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"temperatureQualifier\",\n        title=\"Qualifies the interval of temperature\",\n        description=(\n            \"It qualifies the interval of temperature, which characterizes an \"\n            \"occurrence of handling. Conditions that are not related to temperature\"\n            \" may be handled in the instruction element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    temperatureRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"temperatureRange\",\n        title=\"Temperature range for these handling instructions\",\n        description=\"The temperature interval for this set of handling instructions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SpecimenDefinitionTypeTestedHandling`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"temperatureQualifier\",\n            \"temperatureRange\",\n            \"maxDuration\",\n            \"instruction\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SpecimenDefinitionTypeTestedHandling`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/structuredefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/StructureDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass StructureDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Structural Definition.\n    A definition of a FHIR structure. This resource is used to describe the\n    underlying resources, data types defined in FHIR, and also for describing\n    extensions and constraints on resources and data types.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinition\"\n\n    abstract: bool | None = Field(\n        default=None,\n        alias=\"abstract\",\n        title=\"Whether the structure is abstract\",\n        description=(\n            \"Whether structure this definition describes is abstract or not  - that\"\n            \" is, whether the structure is not intended to be instantiated. For \"\n            \"Resources and Data types, abstract types will never be exchanged  \"\n            \"between systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    abstract__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_abstract\", title=\"Extension field for ``abstract``.\"\n    )\n\n    baseDefinition: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"baseDefinition\",\n        title=\"Definition that this type is constrained/specialized from\",\n        description=(\n            \"An absolute URI that is the base structure from which this type is \"\n            \"derived, either by specialization or constraint.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    baseDefinition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_baseDefinition\",\n        title=\"Extension field for ``baseDefinition``.\",\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    context: typing.List[fhirtypes.StructureDefinitionContextType] | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"If an extension, where it can be used in instances\",\n        description=(\n            \"Identifies the types of resource or data type elements to which the \"\n            \"extension can be applied. For more guidance on using the 'context' \"\n            \"element, see the [defining extensions page](defining-\"\n            \"extensions.html#context).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contextInvariant: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"contextInvariant\",\n        title=\"FHIRPath invariants - when the extension can be used\",\n        description=(\n            \"A set of rules as FHIRPath Invariants about when the extension can be \"\n            \"used (e.g. co-occurrence variants for the extension). All the rules \"\n            \"must be true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    contextInvariant__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_contextInvariant\",\n        title=\"Extension field for ``contextInvariant``.\",\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the structure definition and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the structure definition.  The short copyright \"\n            \"declaration (e.g. (c) '2015+ xyz organization' should be sent in the \"\n            \"copyrightLabel element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the structure definition was last\"\n            \" significantly changed. The date must change when the business version\"\n            \" changes and it must change if the status code changes. In addition, \"\n            \"it should change when the substantive content of the structure \"\n            \"definition changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivation: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"derivation\",\n        title=\"specialization | constraint - How relates to base definition\",\n        description=\"How the type relates to the baseDefinition.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"specialization\", \"constraint\"],\n        },\n    )\n    derivation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_derivation\", title=\"Extension field for ``derivation``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the structure definition\",\n        description=(\n            \"A free text natural language description of the structure definition \"\n            \"from a consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    differential: fhirtypes.StructureDefinitionDifferentialType | None = Field(\n        default=None,\n        alias=\"differential\",\n        title=\"Differential view of the structure\",\n        description=(\n            \"A differential view is expressed relative to the base \"\n            \"StructureDefinition - a statement of differences that it applies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this structure definition is authored\"\n            \" for testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fhirVersion: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"fhirVersion\",\n        title=\"FHIR Version this StructureDefinition targets\",\n        description=(\n            \"The version of the FHIR specification on which this \"\n            \"StructureDefinition is based - this is the formal version of the \"\n            \"specification, without the revision number, e.g. \"\n            \"[publication].[major].[minor], which is 4.6.0. for this version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fhirVersion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fhirVersion\", title=\"Extension field for ``fhirVersion``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the structure definition\",\n        description=(\n            \"A formal identifier that is used to identify this structure definition\"\n            \" when it is represented in other formats, or referenced in a \"\n            \"specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for structure definition (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the structure definition is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    keyword: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"keyword\",\n        title=\"Assist with indexing and finding\",\n        description=(\n            \"(DEPRECATED) A set of key words or terms from external terminologies \"\n            \"that may be used to assist with indexing and searching of templates \"\n            \"nby describing the use of this structure definition, or the content it\"\n            \" describes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"primitive-type | complex-type | resource | logical\",\n        description=\"Defines the kind of structure that this definition is describing.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"primitive-type\", \"complex-type\", \"resource\", \"logical\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    mapping: typing.List[fhirtypes.StructureDefinitionMappingType] | None = Field(\n        default=None,\n        alias=\"mapping\",\n        title=\"External specification that the content is mapped to\",\n        description=\"An external specification that the content is mapped to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this structure definition (computer friendly)\",\n        description=(\n            \"A natural language name identifying the structure definition. This \"\n            \"name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the structure definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this structure definition is defined\",\n        description=(\n            \"Explanation of why this structure definition is needed and why it has \"\n            \"been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    snapshot: fhirtypes.StructureDefinitionSnapshotType | None = Field(\n        default=None,\n        alias=\"snapshot\",\n        title=\"Snapshot view of the structure\",\n        description=(\n            \"A snapshot view is expressed in a standalone form that can be used and\"\n            \" interpreted without considering the base StructureDefinition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this structure definition. Enables tracking the life-\"\n            \"cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this structure definition (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the structure \" \"definition.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    type: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type defined or constrained by this structure\",\n        description=(\n            \"The type this structure describes. If the derivation kind is \"\n            \"'specialization' then this is the master definition for a type, and \"\n            \"there is always one of these (a data type, an extension, a resource, \"\n            \"including abstract ones). Otherwise the structure definition is a \"\n            \"constraint on the stated type (and in this case, the type cannot be an\"\n            \" abstract type).  References are URLs that are relative to \"\n            'http://hl7.org/fhir/StructureDefinition e.g. \"string\" is a reference '\n            \"to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are \"\n            \"only allowed in logical models, where they are required.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this structure definition, represented as a \"\n            \"URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this structure definition \"\n            \"when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which an \"\n            \"authoritative instance of this structure definition is (or will be) \"\n            \"published. This URL can be the target of a canonical reference. It \"\n            \"SHALL remain the same when the structure definition is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate structure definition instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the structure definition\",\n        description=(\n            \"The identifier that is used to identify this version of the structure \"\n            \"definition when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the structure \"\n            \"definition author and is not expected to be globally unique. There is \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence, so authors are encouraged to populate the \"\n            \"StructureDefinition.versionAlgorithm[x] element to enable comparisons.\"\n            \" If there is no managed version available, authors can consider using \"\n            \"ISO date/time syntax (e.g., '2023-01-01').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"keyword\",\n            \"fhirVersion\",\n            \"mapping\",\n            \"kind\",\n            \"abstract\",\n            \"context\",\n            \"contextInvariant\",\n            \"type\",\n            \"baseDefinition\",\n            \"derivation\",\n            \"snapshot\",\n            \"differential\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"keyword\",\n            \"fhirVersion\",\n            \"kind\",\n            \"abstract\",\n            \"context\",\n            \"contextInvariant\",\n            \"type\",\n            \"baseDefinition\",\n            \"derivation\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"abstract\", \"abstract__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"type\", \"type__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass StructureDefinitionContext(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If an extension, where it can be used in instances.\n    Identifies the types of resource or data type elements to which the\n    extension can be applied. For more guidance on using the 'context' element,\n    see the [defining extensions page](defining-extensions.html#context).\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinitionContext\"\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"Where the extension can be used in instances\",\n        description=(\n            \"An expression that defines where an extension can be used in \" \"resources.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"fhirpath | element | extension\",\n        description=(\n            \"Defines how to interpret the expression that defines what the context \"\n            \"of the extension is.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"fhirpath\", \"element\", \"extension\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinitionContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"expression\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinitionContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"expression\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"expression\", \"expression__ext\"), (\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass StructureDefinitionDifferential(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Differential view of the structure.\n    A differential view is expressed relative to the base StructureDefinition -\n    a statement of differences that it applies.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinitionDifferential\"\n\n    element: typing.List[fhirtypes.ElementDefinitionType] = Field(\n        default=...,\n        alias=\"element\",\n        title=\"Definition of elements in the resource (if no StructureDefinition)\",\n        description=\"Captures constraints on each element within the resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinitionDifferential`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"element\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinitionDifferential`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass StructureDefinitionMapping(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    External specification that the content is mapped to.\n    An external specification that the content is mapped to.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinitionMapping\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Versions, Issues, Scope limitations etc\",\n        description=(\n            \"Comments about this mapping, including version notes, issues, scope \"\n            \"limitations, and other important notes for usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    identity: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"identity\",\n        title=\"Internal id when this mapping is used\",\n        description=(\n            \"An Internal id that is used to identify this mapping set when specific\"\n            \" mappings are made.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    identity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_identity\", title=\"Extension field for ``identity``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Names what this mapping refers to\",\n        description=\"A name for the specification that is being mapped to.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Identifies what this mapping refers to\",\n        description=(\n            \"An absolute URI that identifies the specification that this mapping is\"\n            \" expressed to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinitionMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identity\",\n            \"uri\",\n            \"name\",\n            \"comment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinitionMapping`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"identity\", \"identity__ext\")]\n        return required_fields\n\n\nclass StructureDefinitionSnapshot(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Snapshot view of the structure.\n    A snapshot view is expressed in a standalone form that can be used and\n    interpreted without considering the base StructureDefinition.\n    \"\"\"\n\n    __resource_type__ = \"StructureDefinitionSnapshot\"\n\n    element: typing.List[fhirtypes.ElementDefinitionType] = Field(\n        default=...,\n        alias=\"element\",\n        title=\"Definition of elements in the resource (if no StructureDefinition)\",\n        description=\"Captures constraints on each element within the resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureDefinitionSnapshot`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"element\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureDefinitionSnapshot`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/structuremap.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/StructureMap\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass StructureMap(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A Map of relationships between 2 structures that can be used to transform\n    data.\n    \"\"\"\n\n    __resource_type__ = \"StructureMap\"\n\n    const: typing.List[fhirtypes.StructureMapConstType] | None = Field(\n        default=None,\n        alias=\"const\",\n        title=\"Definition of the constant value used in the map rules\",\n        description=\"Definition of a constant value used in the map rules.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the structure map and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the structure map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the structure map was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the structure map \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the structure map\",\n        description=(\n            \"A free text natural language description of the structure map from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this structure map is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    group: typing.List[fhirtypes.StructureMapGroupType] = Field(\n        default=...,\n        alias=\"group\",\n        title=\"Named sections for reader convenience\",\n        description=(\n            \"Organizes the mapping into managable chunks for human review/ease of \"\n            \"maintenance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the structure map\",\n        description=(\n            \"A formal identifier that is used to identify this structure map when \"\n            \"it is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    import_fhir: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"import\",\n        title=\"Other maps used by this map (canonical URLs)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureMap\"],\n        },\n    )\n    import__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_import\", title=\"Extension field for ``import_fhir``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for structure map (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the structure map is intended to\"\n            \" be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this structure map (computer friendly)\",\n        description=(\n            \"A natural language name identifying the structure map. This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the structure map.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this structure map is defined\",\n        description=(\n            \"Explanation of why this structure map is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this structure map. Enables tracking the life-cycle of \"\n            \"the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    structure: typing.List[fhirtypes.StructureMapStructureType] | None = Field(\n        default=None,\n        alias=\"structure\",\n        title=\"Structure Definition used by this map\",\n        description=(\n            \"A structure definition used by this map. The structure definition may \"\n            \"describe instances that are converted, or the instances that are \"\n            \"produced.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this structure map (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the structure map.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this structure map, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this structure map when it is\"\n            \" referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" structure map is (or will be) published. This URL can be the target \"\n            \"of a canonical reference. It SHALL remain the same when the structure \"\n            \"map is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate structure map instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the structure map\",\n        description=(\n            \"The identifier that is used to identify this version of the structure \"\n            \"map when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the structure map \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions can be placed in\"\n            \" a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMap`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"structure\",\n            \"import\",\n            \"const\",\n            \"group\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMap`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"structure\",\n            \"import\",\n            \"const\",\n            \"group\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"name\", \"name__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"url\", \"url__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass StructureMapConst(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of the constant value used in the map rules.\n    Definition of a constant value used in the map rules.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapConst\"\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Constant name\",\n        description=\"Other maps used by this map (canonical URLs).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"FHIRPath exression - value of the constant\",\n        description=\"A FHIRPath expression that is the value of this variable.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapConst`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapConst`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"value\"]\n\n\nclass StructureMapGroup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Named sections for reader convenience.\n    Organizes the mapping into managable chunks for human review/ease of\n    maintenance.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroup\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Additional description/explanation for group\",\n        description=(\n            \"Additional supporting documentation that explains the purpose of the \"\n            \"group and the types of mappings within it.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    extends: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"extends\",\n        title=\"Another group that this group adds rules to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    extends__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_extends\", title=\"Extension field for ``extends``.\"\n    )\n\n    input: typing.List[fhirtypes.StructureMapGroupInputType] = Field(\n        default=...,\n        alias=\"input\",\n        title=\"Named instance provided when invoking the map\",\n        description=(\n            \"A name assigned to an instance of data. The instance must be provided \"\n            \"when the mapping is invoked.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human-readable label\",\n        description=\"A unique name for the group for the convenience of human readers.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    rule: typing.List[fhirtypes.StructureMapGroupRuleType] | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"Transform Rule from source to target\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    typeMode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"typeMode\",\n        title=\"types | type-and-types\",\n        description=(\n            \"If this is the default rule set to apply for the source type or this \"\n            \"combination of types.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"types\", \"type-and-types\"],\n        },\n    )\n    typeMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_typeMode\", title=\"Extension field for ``typeMode``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"extends\",\n            \"typeMode\",\n            \"documentation\",\n            \"input\",\n            \"rule\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"name\",\n            \"extends\",\n            \"typeMode\",\n            \"documentation\",\n            \"input\",\n            \"rule\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass StructureMapGroupInput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Named instance provided when invoking the map.\n    A name assigned to an instance of data. The instance must be provided when\n    the mapping is invoked.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupInput\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Documentation for this instance of data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"source | target\",\n        description=\"Mode for this instance of data.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"source\", \"target\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this instance of data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    type: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type for this instance of data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"type\",\n            \"mode\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"type\", \"mode\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\"), (\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass StructureMapGroupRule(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Transform Rule from source to target.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRule\"\n\n    dependent: typing.List[fhirtypes.StructureMapGroupRuleDependentType] | None = Field(\n        default=None,\n        alias=\"dependent\",\n        title=\"Which other rules to apply in the context of this rule\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Documentation for this instance of data\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the rule for internal references\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    rule: typing.List[fhirtypes.StructureMapGroupRuleType] | None = Field(\n        default=None,\n        alias=\"rule\",\n        title=\"Rules contained in this rule\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: typing.List[fhirtypes.StructureMapGroupRuleSourceType] = Field(\n        default=...,\n        alias=\"source\",\n        title=\"Source inputs to the mapping\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    target: typing.List[fhirtypes.StructureMapGroupRuleTargetType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Content to create because of this mapping rule\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"source\",\n            \"target\",\n            \"rule\",\n            \"dependent\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRule`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"source\", \"target\", \"rule\", \"dependent\"]\n\n\nclass StructureMapGroupRuleDependent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Which other rules to apply in the context of this rule.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRuleDependent\"\n\n    name: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of a rule or group to apply\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    parameter: typing.List[fhirtypes.StructureMapGroupRuleTargetParameterType] = Field(\n        default=...,\n        alias=\"parameter\",\n        title=\"Parameter to pass to the rule or group\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRuleDependent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"parameter\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleDependent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"parameter\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass StructureMapGroupRuleSource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Source inputs to the mapping.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRuleSource\"\n\n    check: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"check\",\n        title=(\n            \"FHIRPath expression  - must be true or the mapping engine throws an \"\n            \"error instead of completing\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    check__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_check\", title=\"Extension field for ``check``.\"\n    )\n\n    condition: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"FHIRPath expression  - must be true or the rule does not apply\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    condition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_condition\", title=\"Extension field for ``condition``.\"\n    )\n\n    context: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Type or variable this rule applies to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    context__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_context\", title=\"Extension field for ``context``.\"\n    )\n\n    defaultValue: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"defaultValue\",\n        title=\"Default value if no value exists\",\n        description=\"A value to use if there is no existing value in the source object.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    defaultValue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValue\",\n        title=\"Extension field for ``defaultValue``.\",\n    )\n\n    element: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"element\",\n        title=\"Optional field for this source\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    element__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_element\", title=\"Extension field for ``element``.\"\n    )\n\n    listMode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"listMode\",\n        title=\"first | not_first | last | not_last | only_one\",\n        description=\"How to handle the list mode for this element.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"first\", \"not_first\", \"last\", \"not_last\", \"only_one\"],\n        },\n    )\n    listMode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_listMode\", title=\"Extension field for ``listMode``.\"\n    )\n\n    logMessage: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"logMessage\",\n        title=\"Message to put in log if source exists (FHIRPath)\",\n        description=(\n            \"A FHIRPath expression which specifies a message to put in the \"\n            \"transform log when content matching the source rule is found.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    logMessage__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_logMessage\", title=\"Extension field for ``logMessage``.\"\n    )\n\n    max: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"max\",\n        title=\"Specified maximum cardinality (number or *)\",\n        description=(\n            'Specified maximum cardinality for the element - a number or a \"*\". '\n            \"This is optional; if present, it acts an implicit check on the input \"\n            \"content (* just serves as documentation; it's the default value).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    max__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_max\", title=\"Extension field for ``max``.\"\n    )\n\n    min: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"min\",\n        title=\"Specified minimum cardinality\",\n        description=(\n            \"Specified minimum cardinality for the element. This is optional; if \"\n            \"present, it acts an implicit check on the input content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    min__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_min\", title=\"Extension field for ``min``.\"\n    )\n\n    type: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Rule only applies if source has this type\",\n        description=(\n            \"Specified type for the element. This works as a condition on the \"\n            \"mapping - use for polymorphic elements.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    variable: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"Named context for field, if a field is specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    variable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_variable\", title=\"Extension field for ``variable``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRuleSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"context\",\n            \"min\",\n            \"max\",\n            \"type\",\n            \"defaultValue\",\n            \"element\",\n            \"listMode\",\n            \"variable\",\n            \"condition\",\n            \"check\",\n            \"logMessage\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleSource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"context\",\n            \"min\",\n            \"max\",\n            \"type\",\n            \"defaultValue\",\n            \"element\",\n            \"listMode\",\n            \"variable\",\n            \"condition\",\n            \"check\",\n            \"logMessage\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"context\", \"context__ext\")]\n        return required_fields\n\n\nclass StructureMapGroupRuleTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Content to create because of this mapping rule.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRuleTarget\"\n\n    context: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"context\",\n        title=\"Variable this rule applies to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    context__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_context\", title=\"Extension field for ``context``.\"\n    )\n\n    element: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"element\",\n        title=\"Field to create in the context\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    element__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_element\", title=\"Extension field for ``element``.\"\n    )\n\n    listMode: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"listMode\",\n        title=\"first | share | last | single\",\n        description=\"If field is a list, how to manage the list.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"first\", \"share\", \"last\", \"single\"],\n        },\n    )\n    listMode__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_listMode\", title=\"Extension field for ``listMode``.\"\n    )\n\n    listRuleId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"listRuleId\",\n        title=\"Internal rule reference for shared list items\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    listRuleId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_listRuleId\", title=\"Extension field for ``listRuleId``.\"\n    )\n\n    parameter: typing.List[\n        fhirtypes.StructureMapGroupRuleTargetParameterType\n    ] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Parameters to the transform\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    transform: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"transform\",\n        title=\"create | copy +\",\n        description=\"How the data is copied / created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"create\", \"copy\", \"+\"],\n        },\n    )\n    transform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_transform\", title=\"Extension field for ``transform``.\"\n    )\n\n    variable: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"Named context for field, if desired, and a field is specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    variable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_variable\", title=\"Extension field for ``variable``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRuleTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"context\",\n            \"element\",\n            \"variable\",\n            \"listMode\",\n            \"listRuleId\",\n            \"transform\",\n            \"parameter\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"context\",\n            \"element\",\n            \"variable\",\n            \"listMode\",\n            \"listRuleId\",\n            \"transform\",\n            \"parameter\",\n        ]\n\n\nclass StructureMapGroupRuleTargetParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Parameters to the transform.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapGroupRuleTargetParameter\"\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Parameter value - variable or literal\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapGroupRuleTargetParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"valueId\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueDecimal\",\n            \"valueDate\",\n            \"valueTime\",\n            \"valueDateTime\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapGroupRuleTargetParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"valueId\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueDecimal\",\n            \"valueDate\",\n            \"valueTime\",\n            \"valueDateTime\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueId\",\n                \"valueInteger\",\n                \"valueString\",\n                \"valueTime\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass StructureMapStructure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Structure Definition used by this map.\n    A structure definition used by this map. The structure definition may\n    describe instances that are converted, or the instances that are produced.\n    \"\"\"\n\n    __resource_type__ = \"StructureMapStructure\"\n\n    alias: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"alias\",\n        title=\"Name for type in this map\",\n        description=\"The name used for this type in the map.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    alias__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_alias\", title=\"Extension field for ``alias``.\"\n    )\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Documentation on use of structure\",\n        description=\"Documentation that describes how the structure is used in the mapping.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    mode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"mode\",\n        title=\"source | queried | target | produced\",\n        description=\"How the referenced structure is used in this mapping.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"source\", \"queried\", \"target\", \"produced\"],\n        },\n    )\n    mode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_mode\", title=\"Extension field for ``mode``.\"\n    )\n\n    url: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Canonical reference to structure definition\",\n        description=\"The canonical reference to the structure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``StructureMapStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"mode\",\n            \"alias\",\n            \"documentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``StructureMapStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"url\", \"mode\", \"alias\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"mode\", \"mode__ext\"), (\"url\", \"url__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/subscription.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Subscription\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Subscription(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Notification about a SubscriptionTopic.\n    The subscription resource describes a particular client's request to be\n    notified about a SubscriptionTopic.\n    \"\"\"\n\n    __resource_type__ = \"Subscription\"\n\n    channelType: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"channelType\",\n        title=\"Channel type for notifications\",\n        description=\"The type of channel to send notifications on.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactPointType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for source (e.g. troubleshooting)\",\n        description=(\n            \"Contact details for a human to contact about the subscription. The \"\n            \"primary use of this for system administrator troubleshooting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    content: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"empty | id-only | full-resource\",\n        description=(\n            \"How much of the resource content to deliver in the notification \"\n            \"payload. The choices are an empty payload, only the resource id, or \"\n            \"the full resource content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"empty\", \"id-only\", \"full-resource\"],\n        },\n    )\n    content__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_content\", title=\"Extension field for ``content``.\"\n    )\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"MIME type to send, or omit for no payload\",\n        description=(\n            \"The MIME type to send the payload in - e.g., `application/fhir+xml` or\"\n            \" `application/fhir+json`. Note that:  * clients may request \"\n            \"notifications in a specific FHIR version by using the [FHIR Version \"\n            \"Parameter](http.html#version-parameter) - e.g., \"\n            \"`application/fhir+json; fhirVersion=4.0`.  * additional MIME types can\"\n            \" be allowed by channels - e.g., `text/plain` and `text/html` are \"\n            \"defined by the Email channel.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    end: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"end\",\n        title=\"When to automatically delete the subscription\",\n        description=\"The time for the server to turn the subscription off.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    end__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_end\", title=\"Extension field for ``end``.\"\n    )\n\n    endpoint: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"endpoint\",\n        title=\"Where the channel points to\",\n        description=\"The url that describes the actual end-point to send notifications to.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    endpoint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_endpoint\", title=\"Extension field for ``endpoint``.\"\n    )\n\n    filterBy: typing.List[fhirtypes.SubscriptionFilterByType] | None = Field(\n        default=None,\n        alias=\"filterBy\",\n        title=\"Criteria for narrowing the subscription topic stream\",\n        description=(\n            \"The filter properties to be applied to narrow the subscription topic \"\n            \"stream.  When multiple filters are applied, evaluates to true if all \"\n            \"the conditions applicable to that resource are met; otherwise it \"\n            \"returns false (i.e., logical AND).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    heartbeatPeriod: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"heartbeatPeriod\",\n        title=\"Interval in seconds to send 'heartbeat' notification\",\n        description=(\n            \"If present, a 'heartbeat' notification (keep-alive) is sent via this \"\n            \"channel with an interval period equal to this elements integer value \"\n            \"in seconds.  If not present, a heartbeat notification is not sent.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    heartbeatPeriod__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_heartbeatPeriod\",\n        title=\"Extension field for ``heartbeatPeriod``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifiers (business identifier)\",\n        description=(\n            \"A formal identifier that is used to identify this code system when it \"\n            \"is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    managingEntity: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"managingEntity\",\n        title=\"Entity responsible for Subscription changes\",\n        description=(\n            \"Entity with authorization to make subsequent revisions to the \"\n            \"Subscription and also determines what data the subscription is \"\n            \"authorized to disclose.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"CareTeam\",\n                \"HealthcareService\",\n                \"Organization\",\n                \"RelatedPerson\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    maxCount: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"maxCount\",\n        title=\"Maximum number of events that can be combined in a single notification\",\n        description=(\n            \"If present, the maximum number of events that will be included in a \"\n            \"notification bundle. Note that this is not a strict limit on the \"\n            \"number of entries in a bundle, as dependent resources can be included.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    maxCount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_maxCount\", title=\"Extension field for ``maxCount``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Human readable name for this subscription\",\n        description=\"A natural language name identifying the subscription.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    parameter: typing.List[fhirtypes.SubscriptionParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Channel type\",\n        description=(\n            \"Channel-dependent information to send as part of the notification \"\n            \"(e.g., HTTP Headers).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reason: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Description of why this subscription was created\",\n        description=\"A description of why this subscription is defined.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    reason__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_reason\", title=\"Extension field for ``reason``.\"\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"requested | active | error | off | entered-in-error\",\n        description=(\n            \"The status of the subscription, which marks the server state for \"\n            \"managing the subscription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"requested\", \"active\", \"error\", \"off\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    timeout: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"timeout\",\n        title=\"Timeout in seconds to attempt notification delivery\",\n        description=(\n            \"If present, the maximum amount of time a server will allow before \"\n            \"failing a notification attempt.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    timeout__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timeout\", title=\"Extension field for ``timeout``.\"\n    )\n\n    topic: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"Reference to the subscription topic being subscribed to\",\n        description=\"The reference to the subscription topic to be notified about.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubscriptionTopic\"],\n        },\n    )\n    topic__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_topic\", title=\"Extension field for ``topic``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Subscription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"status\",\n            \"topic\",\n            \"contact\",\n            \"end\",\n            \"managingEntity\",\n            \"reason\",\n            \"filterBy\",\n            \"channelType\",\n            \"endpoint\",\n            \"parameter\",\n            \"heartbeatPeriod\",\n            \"timeout\",\n            \"contentType\",\n            \"content\",\n            \"maxCount\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Subscription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"status\",\n            \"topic\",\n            \"contact\",\n            \"end\",\n            \"managingEntity\",\n            \"reason\",\n            \"filterBy\",\n            \"channelType\",\n            \"endpoint\",\n            \"heartbeatPeriod\",\n            \"timeout\",\n            \"contentType\",\n            \"content\",\n            \"maxCount\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\"), (\"topic\", \"topic__ext\")]\n        return required_fields\n\n\nclass SubscriptionFilterBy(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Criteria for narrowing the subscription topic stream.\n    The filter properties to be applied to narrow the subscription topic\n    stream.  When multiple filters are applied, evaluates to true if all the\n    conditions applicable to that resource are met; otherwise it returns false\n    (i.e., logical AND).\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionFilterBy\"\n\n    comparator: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"comparator\",\n        title=\"eq | ne | gt | lt | ge | le | sa | eb | ap\",\n        description=\"Comparator applied to this filter parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"eq\", \"ne\", \"gt\", \"lt\", \"ge\", \"le\", \"sa\", \"eb\", \"ap\"],\n        },\n    )\n    comparator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comparator\", title=\"Extension field for ``comparator``.\"\n    )\n\n    filterParameter: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"filterParameter\",\n        title=\"Filter label defined in SubscriptionTopic\",\n        description=(\n            \"The filter as defined in the \"\n            \"`SubscriptionTopic.canFilterBy.filterParameter` element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    filterParameter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_filterParameter\",\n        title=\"Extension field for ``filterParameter``.\",\n    )\n\n    modifier: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=(\n            \"missing | exact | contains | not | text | in | not-in | below | above \"\n            \"| type | identifier | of-type | code-text | text-advanced | iterate\"\n        ),\n        description=\"Modifier applied to this filter parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"missing\",\n                \"exact\",\n                \"contains\",\n                \"not\",\n                \"text\",\n                \"in\",\n                \"not-in\",\n                \"below\",\n                \"above\",\n                \"type\",\n                \"identifier\",\n                \"of-type\",\n                \"code-text\",\n                \"text-advanced\",\n                \"iterate\",\n            ],\n        },\n    )\n    modifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_modifier\", title=\"Extension field for ``modifier``.\"\n    )\n\n    resourceType: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"resourceType\",\n        title=(\n            \"Allowed Resource (reference to definition) for this Subscription \" \"filter\"\n        ),\n        description=(\n            \"A resource listed in the `SubscriptionTopic` this `Subscription` \"\n            \"references (`SubscriptionTopic.canFilterBy.resource`). This element \"\n            \"can be used to differentiate filters for topics that include more than\"\n            \" one resource type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    resourceType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_resourceType\",\n        title=\"Extension field for ``resourceType``.\",\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Literal value or resource path\",\n        description=(\n            \"The literal value or resource path as is legal in search - for \"\n            \"example, `Patient/123` or `le1950`.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionFilterBy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"resourceType\",\n            \"filterParameter\",\n            \"comparator\",\n            \"modifier\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionFilterBy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"resourceType\", \"filterParameter\", \"value\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"filterParameter\", \"filterParameter__ext\"),\n            (\"value\", \"value__ext\"),\n        ]\n        return required_fields\n\n\nclass SubscriptionParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Channel type.\n    Channel-dependent information to send as part of the notification (e.g.,\n    HTTP Headers).\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionParameter\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name (key) of the parameter\",\n        description=(\n            \"Parameter name for information passed to the channel for \"\n            \"notifications, for example in the case of a REST hook wanting to pass \"\n            \"through an authorization header, the name would be Authorization.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Value of the parameter to use or pass through\",\n        description=(\n            \"Parameter value for information passed to the channel for \"\n            \"notifications, for example in the case of a REST hook wanting to pass \"\n            \"through an authorization header, the value would be `Bearer 0193...`.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/subscriptionstatus.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubscriptionStatus\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SubscriptionStatus(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Status information about a Subscription provided during event notification.\n    The SubscriptionStatus resource describes the state of a Subscription\n    during notifications.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionStatus\"\n\n    error: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"error\",\n        title=\"List of errors on the subscription\",\n        description=(\n            \"A record of errors that occurred when the server processed a \"\n            \"notification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    eventsSinceSubscriptionStart: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"eventsSinceSubscriptionStart\",\n        title=\"Events since the Subscription was created\",\n        description=(\n            \"The total number of actual events which have been generated since the \"\n            \"Subscription was created (inclusive of this notification) - regardless\"\n            \" of how many have been successfully communicated.  This number is NOT \"\n            \"incremented for handshake and heartbeat notifications.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    eventsSinceSubscriptionStart__ext: fhirtypes.FHIRPrimitiveExtensionType | None = (\n        Field(\n            default=None,\n            alias=\"_eventsSinceSubscriptionStart\",\n            title=\"Extension field for ``eventsSinceSubscriptionStart``.\",\n        )\n    )\n\n    notificationEvent: typing.List[\n        fhirtypes.SubscriptionStatusNotificationEventType\n    ] | None = Field(\n        default=None,\n        alias=\"notificationEvent\",\n        title=\"Detailed information about any events relevant to this notification\",\n        description=(\n            \"Detailed information about events relevant to this subscription \"\n            \"notification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"requested | active | error | off | entered-in-error\",\n        description=(\n            \"The status of the subscription, which marks the server state for \"\n            \"managing the subscription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"requested\", \"active\", \"error\", \"off\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    subscription: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"subscription\",\n        title=\"Reference to the Subscription responsible for this notification\",\n        description=\"The reference to the Subscription which generated this notification.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Subscription\"],\n        },\n    )\n\n    topic: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"Reference to the SubscriptionTopic this notification relates to\",\n        description=(\n            \"The reference to the SubscriptionTopic for the Subscription which \"\n            \"generated this notification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubscriptionTopic\"],\n        },\n    )\n    topic__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_topic\", title=\"Extension field for ``topic``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"handshake | heartbeat | event-notification | query-status | query-\" \"event\"\n        ),\n        description=\"The type of event being conveyed with this notification.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"handshake\",\n                \"heartbeat\",\n                \"event-notification\",\n                \"query-status\",\n                \"query-event\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionStatus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"status\",\n            \"type\",\n            \"eventsSinceSubscriptionStart\",\n            \"notificationEvent\",\n            \"subscription\",\n            \"topic\",\n            \"error\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionStatus`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"type\",\n            \"eventsSinceSubscriptionStart\",\n            \"subscription\",\n            \"topic\",\n            \"error\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n\nclass SubscriptionStatusNotificationEvent(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Detailed information about any events relevant to this notification.\n    Detailed information about events relevant to this subscription\n    notification.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionStatusNotificationEvent\"\n\n    additionalContext: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"additionalContext\",\n        title=\"References related to the focus resource and/or context of this event\",\n        description=(\n            \"Additional context information for this event. Generally, this will \"\n            \"contain references to additional resources included with the event \"\n            \"(e.g., the Patient relevant to an Encounter), however it MAY refer to \"\n            \"non-FHIR objects.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    eventNumber: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"eventNumber\",\n        title=\"Sequencing index of this event\",\n        description=(\n            \"Either the sequential number of this event in this subscription \"\n            \"context or a relative event number for this notification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    eventNumber__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_eventNumber\", title=\"Extension field for ``eventNumber``.\"\n    )\n\n    focus: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"Reference to the primary resource or information of this event\",\n        description=(\n            \"The focus of this event. While this will usually be a reference to the\"\n            \" focus resource of the event, it MAY contain a reference to a non-FHIR\"\n            \" object.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    timestamp: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"timestamp\",\n        title=\"The instant this event occurred\",\n        description=\"The actual time this event occurred on the server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timestamp\", title=\"Extension field for ``timestamp``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionStatusNotificationEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"eventNumber\",\n            \"timestamp\",\n            \"focus\",\n            \"additionalContext\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionStatusNotificationEvent`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"eventNumber\", \"eventNumber__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/subscriptiontopic.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubscriptionTopic\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SubscriptionTopic(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The definition of a specific topic for triggering events within the\n    Subscriptions framework.\n    Describes a stream of resource state changes or events and annotated with\n    labels useful to filter projections from this topic.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionTopic\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When SubscriptionTopic is/was approved by publisher\",\n        description=(\n            \"The date on which the asset content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    canFilterBy: typing.List[fhirtypes.SubscriptionTopicCanFilterByType] | None = Field(\n        default=None,\n        alias=\"canFilterBy\",\n        title=(\n            \"Properties by which a Subscription can filter notifications from the \"\n            \"SubscriptionTopic\"\n        ),\n        description=(\n            \"List of properties by which Subscriptions on the SubscriptionTopic can\"\n            \" be filtered. May be defined Search Parameters (e.g., \"\n            \"Encounter.patient) or parameters defined within this SubscriptionTopic\"\n            \" context (e.g., hub.event).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the SubscriptionTopic and/or its \"\n            \"contents. Copyright statements are generally legal restrictions on the\"\n            \" use and publishing of the SubscriptionTopic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date status first applied\",\n        description=(\n            \"The date (and optionally time) when the subscription topic was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the subscription topic \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    derivedFrom: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"derivedFrom\",\n        title=\"Based on FHIR protocol or definition\",\n        description=(\n            \"The canonical URL pointing to another FHIR-defined SubscriptionTopic \"\n            \"that is adhered to in whole or in part by this SubscriptionTopic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubscriptionTopic\"],\n        },\n    )\n    derivedFrom__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_derivedFrom\", title=\"Extension field for ``derivedFrom``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the SubscriptionTopic\",\n        description=(\n            \"A free text natural language description of the Topic from the \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"The effective date range for the SubscriptionTopic\",\n        description=(\n            \"The period during which the SubscriptionTopic content was or is \"\n            \"planned to be effective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    eventTrigger: typing.List[\n        fhirtypes.SubscriptionTopicEventTriggerType\n    ] | None = Field(\n        default=None,\n        alias=\"eventTrigger\",\n        title=\"Event definitions the SubscriptionTopic\",\n        description=\"Event definition which can be used to trigger the SubscriptionTopic.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"If for testing purposes, not real usage\",\n        description=(\n            \"A flag to indicate that this TopSubscriptionTopicic is authored for \"\n            \"testing purposes (or education/evaluation/marketing), and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier for subscription topic\",\n        description=(\n            \"Business identifiers assigned to this subscription topic by the \"\n            \"performer and/or other systems.  These identifiers remain constant as \"\n            \"the resource is updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction of the SubscriptionTopic (if applicable)\",\n        description=\"A jurisdiction in which the Topic is intended to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"Date the Subscription Topic was last reviewed by the publisher\",\n        description=(\n            \"The date on which the asset content was last reviewed. Review happens \"\n            \"periodically after that, but doesn't change the original approval \"\n            \"date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this subscription topic (computer friendly)\",\n        description=(\n            \"A natural language name identifying the subscription topic This name \"\n            \"should be usable as an identifier for the module by machine processing\"\n            \" applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    notificationShape: typing.List[\n        fhirtypes.SubscriptionTopicNotificationShapeType\n    ] | None = Field(\n        default=None,\n        alias=\"notificationShape\",\n        title=(\n            \"Properties for describing the shape of notifications generated by this\"\n            \" topic\"\n        ),\n        description=(\n            \"List of properties to describe the shape (e.g., resources) included in\"\n            \" notifications from this Subscription Topic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=(\n            \"The name of the individual or organization that published the \"\n            \"SubscriptionTopic\"\n        ),\n        description=(\n            'Helps establish the \"authority/credibility\" of the SubscriptionTopic.'\n            \"  May also allow for contact.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this SubscriptionTopic is defined\",\n        description=(\n            \"Explains why this Topic is needed and why it has been designed as it \"\n            \"has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    resourceTrigger: typing.List[\n        fhirtypes.SubscriptionTopicResourceTriggerType\n    ] | None = Field(\n        default=None,\n        alias=\"resourceTrigger\",\n        title=\"Definition of a resource-based trigger for the subscription topic\",\n        description=(\n            \"A definition of a resource-based event that triggers a notification \"\n            \"based on the SubscriptionTopic. The criteria may be just a human \"\n            \"readable description and/or a full FHIR search string or FHIRPath \"\n            \"expression. Multiple triggers are considered OR joined (e.g., a \"\n            \"resource update matching ANY of the definitions will trigger a \"\n            \"notification).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=\"The current state of the SubscriptionTopic.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this subscription topic (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the subscription topic.\"\n            '  For example, \"admission\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this subscription topic, represented as an \"\n            \"absolute URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this subscription topic when \"\n            \"it is referenced in a specification, model, design or an instance; \"\n            \"also called its canonical identifier. This SHOULD be globally unique \"\n            \"and SHOULD be a literal address at which an authoritative instance of \"\n            \"this subscription topic is (or will be) published. This URL can be the\"\n            \" target of a canonical reference. It SHALL remain the same when the \"\n            \"subscription topic is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"Content intends to support these contexts\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These terms may be used to assist with \"\n            \"indexing and searching of code system definitions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the subscription topic\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"subscription topic when it is referenced in a specification, model, \"\n            \"design or instance. This is an arbitrary value managed by the Topic \"\n            \"author and is not expected to be globally unique. For example, it \"\n            \"might be a timestamp (e.g. yyyymmdd) if a managed version is not \"\n            \"available. There is also no expectation that versions are orderable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionTopic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"derivedFrom\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"resourceTrigger\",\n            \"eventTrigger\",\n            \"canFilterBy\",\n            \"notificationShape\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionTopic`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"derivedFrom\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"effectivePeriod\",\n            \"resourceTrigger\",\n            \"eventTrigger\",\n            \"canFilterBy\",\n            \"notificationShape\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\"), (\"url\", \"url__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass SubscriptionTopicCanFilterBy(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Properties by which a Subscription can filter notifications from the\n    SubscriptionTopic.\n    List of properties by which Subscriptions on the SubscriptionTopic can be\n    filtered. May be defined Search Parameters (e.g., Encounter.patient) or\n    parameters defined within this SubscriptionTopic context (e.g., hub.event).\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionTopicCanFilterBy\"\n\n    comparator: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"comparator\",\n        title=\"eq | ne | gt | lt | ge | le | sa | eb | ap\",\n        description=\"Comparators allowed for the filter parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"eq\", \"ne\", \"gt\", \"lt\", \"ge\", \"le\", \"sa\", \"eb\", \"ap\"],\n        },\n    )\n    comparator__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_comparator\", title=\"Extension field for ``comparator``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of this filter parameter\",\n        description=\"Description of how this filtering parameter is intended to be used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    filterDefinition: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"filterDefinition\",\n        title=\"Canonical URL for a filterParameter definition\",\n        description=(\n            \"Either the canonical URL to a search parameter (like \"\n            '\"http://hl7.org/fhir/SearchParameter/encounter-patient\") or the '\n            \"officially-defined URI for a shared filter concept (like \"\n            '\"http://example.org/concepts/shared-common-event\").'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    filterDefinition__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_filterDefinition\",\n        title=\"Extension field for ``filterDefinition``.\",\n    )\n\n    filterParameter: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"filterParameter\",\n        title=(\n            \"Human-readable and computation-friendly name for a filter parameter \"\n            \"usable by subscriptions on this topic, via \"\n            \"Subscription.filterBy.filterParameter\"\n        ),\n        description=(\n            \"Either the canonical URL to a search parameter (like \"\n            '\"http://hl7.org/fhir/SearchParameter/encounter-patient\") or topic-'\n            'defined parameter (like \"hub.event\") which is a label for the filter.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    filterParameter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_filterParameter\",\n        title=\"Extension field for ``filterParameter``.\",\n    )\n\n    modifier: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"modifier\",\n        title=(\n            \"missing | exact | contains | not | text | in | not-in | below | above \"\n            \"| type | identifier | of-type | code-text | text-advanced | iterate\"\n        ),\n        description=\"Modifiers allowed for the filter parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"missing\",\n                \"exact\",\n                \"contains\",\n                \"not\",\n                \"text\",\n                \"in\",\n                \"not-in\",\n                \"below\",\n                \"above\",\n                \"type\",\n                \"identifier\",\n                \"of-type\",\n                \"code-text\",\n                \"text-advanced\",\n                \"iterate\",\n            ],\n        },\n    )\n    modifier__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_modifier\", title=\"Extension field for ``modifier``.\"\n    )\n\n    resource: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"URL of the triggering Resource that this filter applies to\",\n        description=(\n            \"URL of the Resource that is the type used in this filter. This is the \"\n            '\"focus\" of the topic (or one of them if there are more than one). It '\n            \"will be the same, a generality, or a specificity of \"\n            \"SubscriptionTopic.resourceTrigger.resource or \"\n            \"SubscriptionTopic.eventTrigger.resource when they are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionTopicCanFilterBy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"resource\",\n            \"filterParameter\",\n            \"filterDefinition\",\n            \"comparator\",\n            \"modifier\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionTopicCanFilterBy`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"description\",\n            \"resource\",\n            \"filterParameter\",\n            \"filterDefinition\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"filterParameter\", \"filterParameter__ext\")]\n        return required_fields\n\n\nclass SubscriptionTopicEventTrigger(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Event definitions the SubscriptionTopic.\n    Event definition which can be used to trigger the SubscriptionTopic.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionTopicEventTrigger\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Text representation of the event trigger\",\n        description=(\n            \"The human readable description of an event to trigger a notification \"\n            'for the SubscriptionTopic - for example, \"Patient Admission, as '\n            'defined in HL7v2 via message ADT^A01\". Multiple values are considered '\n            \"OR joined (e.g., matching any single event listed).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    event: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"event\",\n        title=\"Event which can trigger a notification from the SubscriptionTopic\",\n        description=(\n            \"A well-defined event which can be used to trigger notifications from \"\n            \"the SubscriptionTopic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=(\n            \"Data Type or Resource (reference to definition) for this trigger \"\n            \"definition\"\n        ),\n        description=(\n            \"URL of the Resource that is the focus type used in this event trigger.\"\n            \"  Relative URLs are relative to the StructureDefinition root of the \"\n            \"implemented FHIR version (e.g., \"\n            'http://hl7.org/fhir/StructureDefinition). For example, \"Patient\" maps '\n            \"to http://hl7.org/fhir/StructureDefinition/Patient.  For more \"\n            'information, see <a href=\"elementdefinition-definitions.html#ElementDe'\n            'finition.type.code\">ElementDefinition.type.code</a>.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionTopicEventTrigger`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"event\",\n            \"resource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionTopicEventTrigger`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"description\", \"event\", \"resource\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"resource\", \"resource__ext\")]\n        return required_fields\n\n\nclass SubscriptionTopicNotificationShape(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Properties for describing the shape of notifications generated by this\n    topic.\n    List of properties to describe the shape (e.g., resources) included in\n    notifications from this Subscription Topic.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionTopicNotificationShape\"\n\n    include: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"include\",\n        title=\"Include directives, rooted in the resource for this shape\",\n        description=(\n            \"Search-style _include directives, rooted in the resource for this \"\n            \"shape. Servers SHOULD include resources listed here, if they exist and\"\n            \" the user is authorized to receive them.  Clients SHOULD be prepared \"\n            \"to receive these additional resources, but SHALL function properly \"\n            \"without them.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    include__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_include\", title=\"Extension field for ``include``.\"\n    )\n\n    resource: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=(\n            \"URL of the Resource that is the focus (main) resource in a \"\n            \"notification shape\"\n        ),\n        description=(\n            \"URL of the Resource that is the type used in this shape. This is the \"\n            \"'focus' resource of the topic (or one of them if there are more than \"\n            \"one) and the root resource for this shape definition. It will be the \"\n            \"same, a generality, or a specificity of \"\n            \"SubscriptionTopic.resourceTrigger.resource or \"\n            \"SubscriptionTopic.eventTrigger.resource when they are present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    revInclude: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"revInclude\",\n        title=\"Reverse include directives, rooted in the resource for this shape\",\n        description=(\n            \"Search-style _revinclude directives, rooted in the resource for this \"\n            \"shape. Servers SHOULD include resources listed here, if they exist and\"\n            \" the user is authorized to receive them.  Clients SHOULD be prepared \"\n            \"to receive these additional resources, but SHALL function properly \"\n            \"without them.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    revInclude__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_revInclude\", title=\"Extension field for ``revInclude``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionTopicNotificationShape`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"resource\",\n            \"include\",\n            \"revInclude\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionTopicNotificationShape`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"resource\", \"include\", \"revInclude\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"resource\", \"resource__ext\")]\n        return required_fields\n\n\nclass SubscriptionTopicResourceTrigger(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Definition of a resource-based trigger for the subscription topic.\n    A definition of a resource-based event that triggers a notification based\n    on the SubscriptionTopic. The criteria may be just a human readable\n    description and/or a full FHIR search string or FHIRPath expression.\n    Multiple triggers are considered OR joined (e.g., a resource update\n    matching ANY of the definitions will trigger a notification).\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionTopicResourceTrigger\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Text representation of the resource trigger\",\n        description=(\n            \"The human readable description of this resource trigger for the \"\n            \"SubscriptionTopic -  for example, \\\"An Encounter enters the 'in-\"\n            \"progress' state\\\".\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    fhirPathCriteria: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"fhirPathCriteria\",\n        title=\"FHIRPath based trigger rule\",\n        description=(\n            \"The FHIRPath based rules that the server should use to determine when \"\n            \"to trigger a notification for this topic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fhirPathCriteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_fhirPathCriteria\",\n        title=\"Extension field for ``fhirPathCriteria``.\",\n    )\n\n    queryCriteria: fhirtypes.SubscriptionTopicResourceTriggerQueryCriteriaType | None = Field(\n        default=None,\n        alias=\"queryCriteria\",\n        title=\"Query based trigger rule\",\n        description=(\n            \"The FHIR query based rules that the server should use to determine \"\n            \"when to trigger a notification for this subscription topic.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=(\n            \"Data Type or Resource (reference to definition) for this trigger \"\n            \"definition\"\n        ),\n        description=(\n            \"URL of the Resource that is the type used in this resource trigger.  \"\n            \"Relative URLs are relative to the StructureDefinition root of the \"\n            \"implemented FHIR version (e.g., \"\n            'http://hl7.org/fhir/StructureDefinition). For example, \"Patient\" maps '\n            \"to http://hl7.org/fhir/StructureDefinition/Patient.  For more \"\n            'information, see <a href=\"elementdefinition-definitions.html#ElementDe'\n            'finition.type.code\">ElementDefinition.type.code</a>.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    supportedInteraction: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"supportedInteraction\",\n        title=\"create | update | delete\",\n        description=(\n            \"The FHIR RESTful interaction which can be used to trigger a \"\n            \"notification for the SubscriptionTopic. Multiple values are considered\"\n            \" OR joined (e.g., CREATE or UPDATE). If not present, all supported \"\n            \"interactions are assumed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"create\", \"update\", \"delete\"],\n        },\n    )\n    supportedInteraction__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_supportedInteraction\",\n        title=\"Extension field for ``supportedInteraction``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionTopicResourceTrigger`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"description\",\n            \"resource\",\n            \"supportedInteraction\",\n            \"queryCriteria\",\n            \"fhirPathCriteria\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionTopicResourceTrigger`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"description\",\n            \"resource\",\n            \"supportedInteraction\",\n            \"queryCriteria\",\n            \"fhirPathCriteria\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"resource\", \"resource__ext\")]\n        return required_fields\n\n\nclass SubscriptionTopicResourceTriggerQueryCriteria(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Query based trigger rule.\n    The FHIR query based rules that the server should use to determine when to\n    trigger a notification for this subscription topic.\n    \"\"\"\n\n    __resource_type__ = \"SubscriptionTopicResourceTriggerQueryCriteria\"\n\n    current: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"current\",\n        title=\"Rule applied to current resource state\",\n        description=(\n            \"The FHIR query based rules are applied to the current resource state \"\n            \"(e.g., state after an update).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    current__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_current\", title=\"Extension field for ``current``.\"\n    )\n\n    previous: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"previous\",\n        title=\"Rule applied to previous resource state\",\n        description=(\n            \"The FHIR query based rules are applied to the previous resource state \"\n            \"(e.g., state before an update).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    previous__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_previous\", title=\"Extension field for ``previous``.\"\n    )\n\n    requireBoth: bool | None = Field(\n        default=None,\n        alias=\"requireBoth\",\n        title=\"Both must be true flag\",\n        description=(\n            \"If set to `true`, both the `current` and `previous` query criteria \"\n            \"must evaluate `true` to trigger a notification for this topic.  If set\"\n            \" to `false` or not present, a notification for this topic will be \"\n            \"triggered if either the `current` or `previous` tests evaluate to \"\n            \"`true`.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    requireBoth__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requireBoth\", title=\"Extension field for ``requireBoth``.\"\n    )\n\n    resultForCreate: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"resultForCreate\",\n        title=\"test-passes | test-fails\",\n        description=(\n            \"For `create` interactions, should the `previous` criteria count as an \"\n            \"automatic pass or an automatic fail. If not present, the testing \"\n            \"behavior during `create` interactions is unspecified (server \"\n            \"discretion).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"test-passes\", \"test-fails\"],\n        },\n    )\n    resultForCreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_resultForCreate\",\n        title=\"Extension field for ``resultForCreate``.\",\n    )\n\n    resultForDelete: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"resultForDelete\",\n        title=\"test-passes | test-fails\",\n        description=(\n            \"For 'delete' interactions, should the 'current' query criteria count \"\n            \"as an automatic pass or an automatic fail. If not present, the testing\"\n            \" behavior during `delete` interactions is unspecified (server \"\n            \"discretion).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"test-passes\", \"test-fails\"],\n        },\n    )\n    resultForDelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_resultForDelete\",\n        title=\"Extension field for ``resultForDelete``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubscriptionTopicResourceTriggerQueryCriteria`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"previous\",\n            \"resultForCreate\",\n            \"current\",\n            \"resultForDelete\",\n            \"requireBoth\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubscriptionTopicResourceTriggerQueryCriteria`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"previous\",\n            \"resultForCreate\",\n            \"current\",\n            \"resultForDelete\",\n            \"requireBoth\",\n        ]\n"
  },
  {
    "path": "fhir/resources/substance.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Substance\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Substance(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A homogeneous material with a definite composition.\n    \"\"\"\n\n    __resource_type__ = \"Substance\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"What class/type of substance this is\",\n        description=(\n            \"A code that classifies the general type of substance.  This is used  \"\n            \"for searching, sorting and display purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"What substance this is\",\n        description=\"A code (or set of codes) that identify this substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceDefinition\"],\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of the substance, comments\",\n        description=(\n            \"A description of the substance - its appearance, handling \"\n            \"requirements, and other usage notes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expiry: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"expiry\",\n        title=\"When no longer valid to use\",\n        description=(\n            \"When the substance is no longer valid to use. For some substances, a \"\n            \"single arbitrary date is used for expiry.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    expiry__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expiry\", title=\"Extension field for ``expiry``.\"\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Unique identifier\",\n        description=(\n            \"Unique identifier for the substance. For an instance, an identifier \"\n            \"associated with the package/container (usually a label affixed \"\n            \"directly).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    ingredient: typing.List[fhirtypes.SubstanceIngredientType] | None = Field(\n        default=None,\n        alias=\"ingredient\",\n        title=\"Composition information about the substance\",\n        description=\"A substance can be composed of other substances.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    instance: bool | None = Field(\n        default=None,\n        alias=\"instance\",\n        title=\"Is this an instance of a substance or a kind of one\",\n        description=(\n            \"A boolean to indicate if this an instance of a substance or a kind of \"\n            \"one (a definition).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    instance__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_instance\", title=\"Extension field for ``instance``.\"\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount of substance in the package\",\n        description=\"The amount of the substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | inactive | entered-in-error\",\n        description=\"A code to indicate if the substance is actively used.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"inactive\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Substance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instance\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"description\",\n            \"expiry\",\n            \"quantity\",\n            \"ingredient\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Substance`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instance\",\n            \"status\",\n            \"category\",\n            \"code\",\n            \"description\",\n            \"expiry\",\n            \"quantity\",\n            \"ingredient\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"instance\", \"instance__ext\")]\n        return required_fields\n\n\nclass SubstanceIngredient(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Composition information about the substance.\n    A substance can be composed of other substances.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceIngredient\"\n\n    quantity: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Optional amount (concentration)\",\n        description=\"The amount of the ingredient in the substance - a concentration ratio.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    substanceCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"substanceCodeableConcept\",\n        title=\"A component of the substance\",\n        description=\"Another substance that is a component of this substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e substance[x]\n            \"one_of_many\": \"substance\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    substanceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"substanceReference\",\n        title=\"A component of the substance\",\n        description=\"Another substance that is a component of this substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e substance[x]\n            \"one_of_many\": \"substance\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Substance\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"quantity\",\n            \"substanceCodeableConcept\",\n            \"substanceReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceIngredient`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"quantity\",\n            \"substanceCodeableConcept\",\n            \"substanceReference\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"substance\": [\"substanceCodeableConcept\", \"substanceReference\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/substancedefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstanceDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SubstanceDefinition(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The detailed description of a substance, typically at a level beyond what\n    is used for prescribing.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinition\"\n\n    characterization: typing.List[\n        fhirtypes.SubstanceDefinitionCharacterizationType\n    ] | None = Field(\n        default=None,\n        alias=\"characterization\",\n        title=\"General specifications for this substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    classification: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"classification\",\n        title=(\n            \"A categorization, high level e.g. polymer or nucleic acid, or food, \"\n            \"chemical, biological, or lower e.g. polymer linear or branch chain, or\"\n            \" type of impurity\"\n        ),\n        description=(\n            \"A high level categorization, e.g. polymer or nucleic acid, or food, \"\n            \"chemical, biological, or a lower level such as the general types of \"\n            \"polymer (linear or branch chain) or type of impurity (process related \"\n            \"or contaminant).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: typing.List[fhirtypes.SubstanceDefinitionCodeType] | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Codes associated with the substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Textual description of the substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    domain: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"domain\",\n        title=\"If the substance applies to human or veterinary use\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    grade: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"grade\",\n        title=(\n            \"The quality standard, established benchmark, to which substance \"\n            \"complies (e.g. USP/NF, BP)\"\n        ),\n        description=(\n            \"The quality standard, established benchmark, to which substance \"\n            \"complies (e.g. USP/NF, Ph. Eur, JP, BP, Company Standard).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier by which this substance is known\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    informationSource: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"informationSource\",\n        title=\"Supporting literature\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Citation\"],\n        },\n    )\n\n    manufacturer: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"manufacturer\",\n        title=\"The entity that creates, makes, produces or fabricates the substance\",\n        description=(\n            \"The entity that creates, makes, produces or fabricates the substance. \"\n            \"This is a set of potential manufacturers but is not necessarily \"\n            \"comprehensive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    moiety: typing.List[fhirtypes.SubstanceDefinitionMoietyType] | None = Field(\n        default=None,\n        alias=\"moiety\",\n        title=\"Moiety, for structural modifications\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    molecularWeight: typing.List[\n        fhirtypes.SubstanceDefinitionMolecularWeightType\n    ] | None = Field(\n        default=None,\n        alias=\"molecularWeight\",\n        title=\"The average mass of a molecule of a compound\",\n        description=(\n            \"The average mass of a molecule of a compound compared to 1/12 the mass\"\n            \" of carbon 12 and calculated as the sum of the atomic weights of the \"\n            \"constituent atoms.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: typing.List[fhirtypes.SubstanceDefinitionNameType] | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Names applicable to this substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Textual comment about the substance's catalogue or registry record\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    nucleicAcid: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"nucleicAcid\",\n        title=\"Data items specific to nucleic acids\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceNucleicAcid\"],\n        },\n    )\n\n    polymer: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"polymer\",\n        title=\"Data items specific to polymers\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstancePolymer\"],\n        },\n    )\n\n    property: typing.List[fhirtypes.SubstanceDefinitionPropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"General specifications for this substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    protein: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"protein\",\n        title=\"Data items specific to proteins\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceProtein\"],\n        },\n    )\n\n    referenceInformation: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"referenceInformation\",\n        title=\"General information detailing this substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceReferenceInformation\"],\n        },\n    )\n\n    relationship: typing.List[\n        fhirtypes.SubstanceDefinitionRelationshipType\n    ] | None = Field(\n        default=None,\n        alias=\"relationship\",\n        title=\"A link between this substance and another\",\n        description=(\n            \"A link between this substance and another, with details of the \"\n            \"relationship.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sourceMaterial: fhirtypes.SubstanceDefinitionSourceMaterialType | None = Field(\n        default=None,\n        alias=\"sourceMaterial\",\n        title=\"Material or taxonomic/anatomical source\",\n        description=\"Material or taxonomic/anatomical source for the substance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"Status of substance within the catalogue e.g. active, retired\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    structure: fhirtypes.SubstanceDefinitionStructureType | None = Field(\n        default=None,\n        alias=\"structure\",\n        title=\"Structural information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    supplier: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supplier\",\n        title=(\n            \"An entity that is the source for the substance. It may be different \"\n            \"from the manufacturer\"\n        ),\n        description=(\n            \"An entity that is the source for the substance. It may be different \"\n            \"from the manufacturer. Supplier is synonymous to a distributor.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"A business level version identifier of the substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"version\",\n            \"status\",\n            \"classification\",\n            \"domain\",\n            \"grade\",\n            \"description\",\n            \"informationSource\",\n            \"note\",\n            \"manufacturer\",\n            \"supplier\",\n            \"moiety\",\n            \"characterization\",\n            \"property\",\n            \"referenceInformation\",\n            \"molecularWeight\",\n            \"structure\",\n            \"code\",\n            \"name\",\n            \"relationship\",\n            \"nucleicAcid\",\n            \"polymer\",\n            \"protein\",\n            \"sourceMaterial\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"version\",\n            \"status\",\n            \"classification\",\n            \"domain\",\n            \"grade\",\n            \"description\",\n            \"informationSource\",\n            \"note\",\n            \"manufacturer\",\n            \"supplier\",\n            \"moiety\",\n            \"characterization\",\n            \"property\",\n            \"referenceInformation\",\n            \"molecularWeight\",\n            \"structure\",\n            \"code\",\n            \"name\",\n            \"relationship\",\n            \"nucleicAcid\",\n            \"polymer\",\n            \"protein\",\n            \"sourceMaterial\",\n        ]\n\n\nclass SubstanceDefinitionCharacterization(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    General specifications for this substance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionCharacterization\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=(\n            \"The description or justification in support of the interpretation of \"\n            \"the data file\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    file: typing.List[fhirtypes.AttachmentType] | None = Field(\n        default=None,\n        alias=\"file\",\n        title=(\n            \"The data produced by the analytical instrument or a pictorial \"\n            \"representation of that data. Examples: a JCAMP, JDX, or ADX file, or a\"\n            \" chromatogram or spectrum analysis\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    form: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"form\",\n        title=(\n            \"Describes the nature of the chemical entity and explains, for \"\n            \"instance, whether this is a base or a salt form\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    technique: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"technique\",\n        title=\"The method used to find the characterization e.g. HPLC\",\n        description=(\n            \"The method used to elucidate the characterization of the drug \"\n            \"substance. Example: HPLC.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionCharacterization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"technique\",\n            \"form\",\n            \"description\",\n            \"file\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionCharacterization`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"technique\", \"form\", \"description\", \"file\"]\n\n\nclass SubstanceDefinitionCode(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Codes associated with the substance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionCode\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"The specific code\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Any comment can be provided in this field\",\n        description=\"Any comment can be provided in this field, if necessary.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Supporting literature\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"Status of the code assignment, for example 'provisional', 'approved'\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    statusDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"The date at which the code status was changed\",\n        description=(\n            \"The date at which the code status was changed as part of the \"\n            \"terminology maintenance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionCode`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"status\",\n            \"statusDate\",\n            \"note\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionCode`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"status\", \"statusDate\", \"note\", \"source\"]\n\n\nclass SubstanceDefinitionMoiety(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Moiety, for structural modifications.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionMoiety\"\n\n    amountQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amountQuantity\",\n        title=\"Quantitative value for this moiety\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    amountString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"amountString\",\n        title=\"Quantitative value for this moiety\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n    amountString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_amountString\",\n        title=\"Extension field for ``amountString``.\",\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifier by which this moiety substance is known\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    measurementType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"measurementType\",\n        title=\"The measurement type of the quantitative value\",\n        description=(\n            \"The measurement type of the quantitative value. In capturing the \"\n            \"actual relative amounts of substances or molecular fragments it may be\"\n            \" necessary to indicate whether the amount refers to, for example, a \"\n            \"mole ratio or weight ratio.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    molecularFormula: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"molecularFormula\",\n        title=\"Molecular formula for this moiety (e.g. with the Hill system)\",\n        description=(\n            \"Molecular formula for this moiety of this substance, typically using \"\n            \"the Hill system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    molecularFormula__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_molecularFormula\",\n        title=\"Extension field for ``molecularFormula``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Textual name for this moiety substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    opticalActivity: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"opticalActivity\",\n        title=\"Optical activity type\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    role: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"role\",\n        title=\"Role that the moiety is playing\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    stereochemistry: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"stereochemistry\",\n        title=\"Stereochemistry type\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionMoiety`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"role\",\n            \"identifier\",\n            \"name\",\n            \"stereochemistry\",\n            \"opticalActivity\",\n            \"molecularFormula\",\n            \"amountQuantity\",\n            \"amountString\",\n            \"measurementType\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionMoiety`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"role\",\n            \"identifier\",\n            \"name\",\n            \"stereochemistry\",\n            \"opticalActivity\",\n            \"molecularFormula\",\n            \"amountQuantity\",\n            \"amountString\",\n            \"measurementType\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"amount\": [\"amountQuantity\", \"amountString\"]}\n        return one_of_many_fields\n\n\nclass SubstanceDefinitionMolecularWeight(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The average mass of a molecule of a compound.\n    The average mass of a molecule of a compound compared to 1/12 the mass of\n    carbon 12 and calculated as the sum of the atomic weights of the\n    constituent atoms.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionMolecularWeight\"\n\n    amount: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"amount\",\n        title=\"Used to capture quantitative values for a variety of elements\",\n        description=(\n            \"Used to capture quantitative values for a variety of elements. If only\"\n            \" limits are given, the arithmetic mean would be the average. If only a\"\n            \" single definite value for a given element is given, it would be \"\n            \"captured in this field.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    method: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"The method by which the weight was determined\",\n        description=\"The method by which the molecular weight was determined.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Type of molecular weight e.g. exact, average, weight average\",\n        description=(\n            \"Type of molecular weight such as exact, average (also known as. number\"\n            \" average), weight average.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionMolecularWeight`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"method\", \"type\", \"amount\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionMolecularWeight`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"method\", \"type\", \"amount\"]\n\n\nclass SubstanceDefinitionName(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Names applicable to this substance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionName\"\n\n    domain: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"domain\",\n        title=(\n            \"The use context of this name e.g. as an active ingredient or as a food\"\n            \" colour additive\"\n        ),\n        description=(\n            \"The use context of this name for example if there is a different name \"\n            \"a drug active ingredient as opposed to a food colour additive.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"The jurisdiction where this name applies\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    language: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language that the name is written in\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"The actual name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    official: typing.List[fhirtypes.SubstanceDefinitionNameOfficialType] | None = Field(\n        default=None,\n        alias=\"official\",\n        title=\"Details of the official nature of this name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    preferred: bool | None = Field(\n        default=None,\n        alias=\"preferred\",\n        title=\"If this is the preferred name for this substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    preferred__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_preferred\", title=\"Extension field for ``preferred``.\"\n    )\n\n    source: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Supporting literature\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"The status of the name e.g. 'current', 'proposed'\",\n        description=\"The status of the name, for example 'current', 'proposed'.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    synonym: typing.List[fhirtypes.SubstanceDefinitionNameType] | None = Field(\n        default=None,\n        alias=\"synonym\",\n        title=(\n            \"A synonym of this particular name, by which the substance is also \" \"known\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    translation: typing.List[fhirtypes.SubstanceDefinitionNameType] | None = Field(\n        default=None,\n        alias=\"translation\",\n        title=\"A translation for this name into another human language\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Name type e.g. 'systematic',  'scientific, 'brand'\",\n        description=\"Name type, for example 'systematic',  'scientific, 'brand'.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"type\",\n            \"status\",\n            \"preferred\",\n            \"language\",\n            \"domain\",\n            \"jurisdiction\",\n            \"synonym\",\n            \"translation\",\n            \"official\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionName`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"name\",\n            \"type\",\n            \"status\",\n            \"preferred\",\n            \"language\",\n            \"domain\",\n            \"jurisdiction\",\n            \"synonym\",\n            \"translation\",\n            \"official\",\n            \"source\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass SubstanceDefinitionNameOfficial(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Details of the official nature of this name.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionNameOfficial\"\n\n    authority: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"authority\",\n        title=\"Which authority uses this official name\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date of official name change\",\n        description=\"Date of the official name change.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    status: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"The status of the official name, for example 'draft', 'active'\",\n        description=(\n            \"The status of the official name, for example 'draft', 'active', \"\n            \"'retired'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionNameOfficial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"authority\", \"status\", \"date\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionNameOfficial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"authority\", \"status\", \"date\"]\n\n\nclass SubstanceDefinitionProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    General specifications for this substance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionProperty\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"A code expressing the type of property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"A value for the property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"A value for the property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"A value for the property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"A value for the property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"A value for the property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueDate\",\n            \"valueBoolean\",\n            \"valueAttachment\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAttachment\",\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueDate\",\n                \"valueQuantity\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass SubstanceDefinitionRelationship(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A link between this substance and another.\n    A link between this substance and another, with details of the\n    relationship.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionRelationship\"\n\n    amountQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amountQuantity\",\n        title=(\n            \"A numeric factor for the relationship, e.g. that a substance salt has \"\n            \"some percentage of active substance in relation to some other\"\n        ),\n        description=(\n            \"A numeric factor for the relationship, for instance to express that \"\n            \"the salt of a substance has some percentage of the active substance in\"\n            \" relation to some other.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    amountRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"amountRatio\",\n        title=(\n            \"A numeric factor for the relationship, e.g. that a substance salt has \"\n            \"some percentage of active substance in relation to some other\"\n        ),\n        description=(\n            \"A numeric factor for the relationship, for instance to express that \"\n            \"the salt of a substance has some percentage of the active substance in\"\n            \" relation to some other.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    amountString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"amountString\",\n        title=(\n            \"A numeric factor for the relationship, e.g. that a substance salt has \"\n            \"some percentage of active substance in relation to some other\"\n        ),\n        description=(\n            \"A numeric factor for the relationship, for instance to express that \"\n            \"the salt of a substance has some percentage of the active substance in\"\n            \" relation to some other.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n    amountString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_amountString\",\n        title=\"Extension field for ``amountString``.\",\n    )\n\n    comparator: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"comparator\",\n        title=(\n            'An operator for the amount, for example \"average\", \"approximately\", '\n            '\"less than\"'\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    isDefining: bool | None = Field(\n        default=None,\n        alias=\"isDefining\",\n        title=(\n            \"For example where an enzyme strongly bonds with a particular \"\n            \"substance, this is a defining relationship for that enzyme, out of \"\n            \"several possible relationships\"\n        ),\n        description=(\n            \"For example where an enzyme strongly bonds with a particular \"\n            \"substance, this is a defining relationship for that enzyme, out of \"\n            \"several possible substance relationships.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isDefining__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isDefining\", title=\"Extension field for ``isDefining``.\"\n    )\n\n    ratioHighLimitAmount: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"ratioHighLimitAmount\",\n        title=\"For use when the numeric has an uncertain range\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Supporting literature\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    substanceDefinitionCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"substanceDefinitionCodeableConcept\",\n        title=(\n            \"A pointer to another substance, as a resource or a representational \"\n            \"code\"\n        ),\n        description=(\n            \"A pointer to another substance, as a resource or just a \"\n            \"representational code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e substanceDefinition[x]\n            \"one_of_many\": \"substanceDefinition\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    substanceDefinitionReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"substanceDefinitionReference\",\n        title=(\n            \"A pointer to another substance, as a resource or a representational \"\n            \"code\"\n        ),\n        description=(\n            \"A pointer to another substance, as a resource or just a \"\n            \"representational code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e substanceDefinition[x]\n            \"one_of_many\": \"substanceDefinition\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubstanceDefinition\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title='For example \"salt to parent\", \"active moiety\"',\n        description=(\n            'For example \"salt to parent\", \"active moiety\", \"starting material\", '\n            '\"polymorph\", \"impurity of\".'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionRelationship`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"substanceDefinitionReference\",\n            \"substanceDefinitionCodeableConcept\",\n            \"type\",\n            \"isDefining\",\n            \"amountQuantity\",\n            \"amountRatio\",\n            \"amountString\",\n            \"ratioHighLimitAmount\",\n            \"comparator\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionRelationship`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"substanceDefinitionReference\",\n            \"substanceDefinitionCodeableConcept\",\n            \"type\",\n            \"isDefining\",\n            \"amountQuantity\",\n            \"amountRatio\",\n            \"amountString\",\n            \"ratioHighLimitAmount\",\n            \"comparator\",\n            \"source\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"amount\": [\"amountQuantity\", \"amountRatio\", \"amountString\"],\n            \"substanceDefinition\": [\n                \"substanceDefinitionCodeableConcept\",\n                \"substanceDefinitionReference\",\n            ],\n        }\n        return one_of_many_fields\n\n\nclass SubstanceDefinitionSourceMaterial(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Material or taxonomic/anatomical source.\n    Material or taxonomic/anatomical source for the substance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionSourceMaterial\"\n\n    countryOfOrigin: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"countryOfOrigin\",\n        title=\"The country or countries where the material is harvested\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    genus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"genus\",\n        title=(\n            \"The genus of an organism e.g. the Latin epithet of the plant/animal \"\n            \"scientific name\"\n        ),\n        description=(\n            \"The genus of an organism, typically referring to the Latin epithet of \"\n            \"the genus element of the plant/animal scientific name.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    part: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"An anatomical origin of the source material within an organism\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    species: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"species\",\n        title=(\n            \"The species of an organism e.g. the Latin epithet of the species of \"\n            \"the plant/animal\"\n        ),\n        description=(\n            \"The species of an organism, typically referring to the Latin epithet \"\n            \"of the species of the plant/animal.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Classification of the origin of the raw material. e.g. cat hair is an \"\n            \"Animal source type\"\n        ),\n        description=(\n            \"A classification that provides the origin of the raw material. \"\n            \"Example: cat hair would be an Animal source type.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionSourceMaterial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"genus\",\n            \"species\",\n            \"part\",\n            \"countryOfOrigin\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionSourceMaterial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"type\",\n            \"genus\",\n            \"species\",\n            \"part\",\n            \"countryOfOrigin\",\n        ]\n\n\nclass SubstanceDefinitionStructure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Structural information.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionStructure\"\n\n    molecularFormula: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"molecularFormula\",\n        title=(\n            \"An expression which states the number and type of atoms present in a \"\n            \"molecule of a substance\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    molecularFormula__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_molecularFormula\",\n        title=\"Extension field for ``molecularFormula``.\",\n    )\n\n    molecularFormulaByMoiety: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"molecularFormulaByMoiety\",\n        title=\"Specified per moiety according to the Hill system\",\n        description=(\n            \"Specified per moiety according to the Hill system, i.e. first C, then \"\n            \"H, then alphabetical, each moiety separated by a dot.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    molecularFormulaByMoiety__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_molecularFormulaByMoiety\",\n        title=\"Extension field for ``molecularFormulaByMoiety``.\",\n    )\n\n    molecularWeight: fhirtypes.SubstanceDefinitionMolecularWeightType | None = Field(\n        default=None,\n        alias=\"molecularWeight\",\n        title=\"The molecular weight or weight range\",\n        description=(\n            \"The molecular weight or weight range (for proteins, polymers or \"\n            \"nucleic acids).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    opticalActivity: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"opticalActivity\",\n        title=\"Optical activity type\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    representation: typing.List[\n        fhirtypes.SubstanceDefinitionStructureRepresentationType\n    ] | None = Field(\n        default=None,\n        alias=\"representation\",\n        title=\"A depiction of the structure of the substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sourceDocument: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"sourceDocument\",\n        title=\"Source of information for the structure\",\n        description=\"The source of information about the structure.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    stereochemistry: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"stereochemistry\",\n        title=\"Stereochemistry type\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    technique: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"technique\",\n        title=\"The method used to find the structure e.g. X-ray, NMR\",\n        description=(\n            \"The method used to elucidate the structure of the drug substance. \"\n            \"Examples: X-ray, NMR, Peptide mapping, Ligand binding assay.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"stereochemistry\",\n            \"opticalActivity\",\n            \"molecularFormula\",\n            \"molecularFormulaByMoiety\",\n            \"molecularWeight\",\n            \"technique\",\n            \"sourceDocument\",\n            \"representation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionStructure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"stereochemistry\",\n            \"opticalActivity\",\n            \"molecularFormula\",\n            \"molecularFormulaByMoiety\",\n            \"molecularWeight\",\n            \"technique\",\n            \"sourceDocument\",\n            \"representation\",\n        ]\n\n\nclass SubstanceDefinitionStructureRepresentation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A depiction of the structure of the substance.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceDefinitionStructureRepresentation\"\n\n    document: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"document\",\n        title=(\n            \"An attachment with the structural representation e.g. a structure \"\n            \"graphic or AnIML file\"\n        ),\n        description=(\n            \"An attached file with the structural representation e.g. a molecular \"\n            \"structure graphic of the substance, a JCAMP or AnIML file.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    format: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"format\",\n        title=(\n            \"The format of the representation e.g. InChI, SMILES, MOLFILE (note: \"\n            \"not the physical file format)\"\n        ),\n        description=(\n            \"The format of the representation e.g. InChI, SMILES, MOLFILE, CDX, \"\n            \"SDF, PDB, mmCIF. The logical content type rather than the physical \"\n            \"file format of a document.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    representation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"representation\",\n        title=\"The structural representation as a text string in a standard format\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    representation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_representation\",\n        title=\"Extension field for ``representation``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The kind of structural representation (e.g. full, partial)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceDefinitionStructureRepresentation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"representation\",\n            \"format\",\n            \"document\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceDefinitionStructureRepresentation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"representation\", \"format\", \"document\"]\n"
  },
  {
    "path": "fhir/resources/substancenucleicacid.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstanceNucleicAcid\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SubstanceNucleicAcid(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Nucleic acids are defined by three distinct elements: the base, sugar and\n    linkage. Individual substance/moiety IDs will be created for each of these\n    elements. The nucleotide sequence will be always entered in the 5’-3’\n    direction.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceNucleicAcid\"\n\n    areaOfHybridisation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"areaOfHybridisation\",\n        title=(\n            \"The area of hybridisation shall be described if applicable for double \"\n            \"stranded RNA or DNA. The number associated with the subunit followed \"\n            \"by the number associated to the residue shall be specified in \"\n            \"increasing order. The underscore \\u201c\\u201d shall be used as separator as \"\n            \"follows: \\u201cSubunitnumber Residue\\u201d\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    areaOfHybridisation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_areaOfHybridisation\",\n        title=\"Extension field for ``areaOfHybridisation``.\",\n    )\n\n    numberOfSubunits: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"numberOfSubunits\",\n        title=(\n            \"The number of linear sequences of nucleotides linked through \"\n            \"phosphodiester bonds shall be described. Subunits would be strands of \"\n            \"nucleic acids that are tightly associated typically through Watson-\"\n            \"Crick base pairing. NOTE: If not specified in the reference source, \"\n            \"the assumption is that there is 1 subunit\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numberOfSubunits__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfSubunits\",\n        title=\"Extension field for ``numberOfSubunits``.\",\n    )\n\n    oligoNucleotideType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"oligoNucleotideType\",\n        title=\"(TBC)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sequenceType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"sequenceType\",\n        title=(\n            \"The type of the sequence shall be specified based on a controlled \"\n            \"vocabulary\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subunit: typing.List[fhirtypes.SubstanceNucleicAcidSubunitType] | None = Field(\n        default=None,\n        alias=\"subunit\",\n        title=(\n            \"Subunits are listed in order of decreasing length; sequences of the \"\n            \"same length will be ordered by molecular weight; subunits that have \"\n            \"identical sequences will be repeated multiple times\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceNucleicAcid`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequenceType\",\n            \"numberOfSubunits\",\n            \"areaOfHybridisation\",\n            \"oligoNucleotideType\",\n            \"subunit\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceNucleicAcid`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"sequenceType\",\n            \"numberOfSubunits\",\n            \"areaOfHybridisation\",\n            \"oligoNucleotideType\",\n            \"subunit\",\n        ]\n\n\nclass SubstanceNucleicAcidSubunit(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Subunits are listed in order of decreasing length; sequences of the same\n    length will be ordered by molecular weight; subunits that have identical\n    sequences will be repeated multiple times.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceNucleicAcidSubunit\"\n\n    fivePrime: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"fivePrime\",\n        title=(\n            \"The nucleotide present at the 5\\u2019 terminal shall be specified based on \"\n            \"a controlled vocabulary. Since the sequence is represented from the 5'\"\n            \" to the 3' end, the 5\\u2019 prime nucleotide is the letter at the first \"\n            \"position in the sequence. A separate representation would be redundant\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    length: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"length\",\n        title=\"The length of the sequence shall be captured\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    length__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_length\", title=\"Extension field for ``length``.\"\n    )\n\n    linkage: typing.List[\n        fhirtypes.SubstanceNucleicAcidSubunitLinkageType\n    ] | None = Field(\n        default=None,\n        alias=\"linkage\",\n        title=\"The linkages between sugar residues will also be captured\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=(\n            \"Actual nucleotide sequence notation from 5' to 3' end using standard \"\n            \"single letter codes. In addition to the base sequence, sugar and type \"\n            \"of phosphate or non-phosphate linkage should also be captured\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    sequenceAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"sequenceAttachment\",\n        title=\"(TBC)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subunit: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"subunit\",\n        title=(\n            \"Index of linear sequences of nucleic acids in order of decreasing \"\n            \"length. Sequences of the same length will be ordered by molecular \"\n            \"weight. Subunits that have identical sequences will be repeated and \"\n            \"have sequential subscripts\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subunit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subunit\", title=\"Extension field for ``subunit``.\"\n    )\n\n    sugar: typing.List[fhirtypes.SubstanceNucleicAcidSubunitSugarType] | None = Field(\n        default=None,\n        alias=\"sugar\",\n        title=\"5.3.6.8.1 Sugar ID (Mandatory)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    threePrime: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"threePrime\",\n        title=(\n            \"The nucleotide present at the 3\\u2019 terminal shall be specified based on \"\n            \"a controlled vocabulary. Since the sequence is represented from the 5'\"\n            \" to the 3' end, the 5\\u2019 prime nucleotide is the letter at the last \"\n            \"position in the sequence. A separate representation would be redundant\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceNucleicAcidSubunit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"subunit\",\n            \"sequence\",\n            \"length\",\n            \"sequenceAttachment\",\n            \"fivePrime\",\n            \"threePrime\",\n            \"linkage\",\n            \"sugar\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceNucleicAcidSubunit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"subunit\",\n            \"sequence\",\n            \"length\",\n            \"sequenceAttachment\",\n            \"fivePrime\",\n            \"threePrime\",\n            \"linkage\",\n            \"sugar\",\n        ]\n\n\nclass SubstanceNucleicAcidSubunitLinkage(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The linkages between sugar residues will also be captured.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceNucleicAcidSubunitLinkage\"\n\n    connectivity: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"connectivity\",\n        title=(\n            \"The entity that links the sugar residues together should also be \"\n            \"captured for nearly all naturally occurring nucleic acid the linkage \"\n            \"is a phosphate group. For many synthetic oligonucleotides \"\n            \"phosphorothioate linkages are often seen. Linkage connectivity is \"\n            \"assumed to be 3\\u2019-5\\u2019. If the linkage is either 3\\u2019-3\\u2019 or 5\\u2019-5\\u2019 this \"\n            \"should be specified\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    connectivity__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_connectivity\",\n        title=\"Extension field for ``connectivity``.\",\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Each linkage will be registered as a fragment and have an ID\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=(\n            \"Each linkage will be registered as a fragment and have at least one \"\n            \"name. A single name shall be assigned to each linkage\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    residueSite: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"residueSite\",\n        title=\"Residues shall be captured as described in 5.3.6.8.3\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    residueSite__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_residueSite\", title=\"Extension field for ``residueSite``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceNucleicAcidSubunitLinkage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"connectivity\",\n            \"identifier\",\n            \"name\",\n            \"residueSite\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceNucleicAcidSubunitLinkage`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"connectivity\",\n            \"identifier\",\n            \"name\",\n            \"residueSite\",\n        ]\n\n\nclass SubstanceNucleicAcidSubunitSugar(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    5.3.6.8.1 Sugar ID (Mandatory).\n    \"\"\"\n\n    __resource_type__ = \"SubstanceNucleicAcidSubunitSugar\"\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"The Substance ID of the sugar or sugar-like component that make up the\"\n            \" nucleotide\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=(\n            \"The name of the sugar or sugar-like component that make up the \"\n            \"nucleotide\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    residueSite: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"residueSite\",\n        title=(\n            \"The residues that contain a given sugar will be captured. The order of\"\n            \" given residues will be captured in the 5\\u2018-3\\u2018direction consistent with\"\n            \" the base sequences listed above\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    residueSite__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_residueSite\", title=\"Extension field for ``residueSite``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceNucleicAcidSubunitSugar`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"residueSite\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceNucleicAcidSubunitSugar`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"identifier\", \"name\", \"residueSite\"]\n"
  },
  {
    "path": "fhir/resources/substancepolymer.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstancePolymer\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SubstancePolymer(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Properties of a substance specific to it being a polymer.\n    \"\"\"\n\n    __resource_type__ = \"SubstancePolymer\"\n\n    class_fhir: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"class\",\n        title=\"Overall type of the polymer\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copolymerConnectivity: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"copolymerConnectivity\",\n        title=\"Descrtibes the copolymer sequence type (polymer connectivity)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    geometry: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"geometry\",\n        title=(\n            \"Polymer geometry, e.g. linear, branched, cross-linked, network or \"\n            \"dendritic\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=(\n            \"A business idenfier for this polymer, but typically this is handled by\"\n            \" a SubstanceDefinition identifier\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    modification: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"modification\",\n        title=(\n            \"Todo - this is intended to connect to a repeating full modification \"\n            \"structure, also used by Protein and Nucleic Acid . String is just a \"\n            \"placeholder\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    modification__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_modification\",\n        title=\"Extension field for ``modification``.\",\n    )\n\n    monomerSet: typing.List[fhirtypes.SubstancePolymerMonomerSetType] | None = Field(\n        default=None,\n        alias=\"monomerSet\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    repeat: typing.List[fhirtypes.SubstancePolymerRepeatType] | None = Field(\n        default=None,\n        alias=\"repeat\",\n        title=\"Specifies and quantifies the repeated units and their configuration\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstancePolymer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"class\",\n            \"geometry\",\n            \"copolymerConnectivity\",\n            \"modification\",\n            \"monomerSet\",\n            \"repeat\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstancePolymer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"class\",\n            \"geometry\",\n            \"copolymerConnectivity\",\n            \"modification\",\n            \"monomerSet\",\n            \"repeat\",\n        ]\n\n\nclass SubstancePolymerMonomerSet(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Todo.\n    \"\"\"\n\n    __resource_type__ = \"SubstancePolymerMonomerSet\"\n\n    ratioType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"ratioType\",\n        title=(\n            \"Captures the type of ratio to the entire polymer, e.g. Monomer/Polymer\"\n            \" ratio, SRU/Polymer Ratio\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    startingMaterial: typing.List[\n        fhirtypes.SubstancePolymerMonomerSetStartingMaterialType\n    ] | None = Field(\n        default=None,\n        alias=\"startingMaterial\",\n        title=(\n            \"The starting materials - monomer(s) used in the synthesis of the \"\n            \"polymer\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstancePolymerMonomerSet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"ratioType\", \"startingMaterial\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstancePolymerMonomerSet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"ratioType\", \"startingMaterial\"]\n\n\nclass SubstancePolymerMonomerSetStartingMaterial(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The starting materials - monomer(s) used in the synthesis of the polymer.\n    \"\"\"\n\n    __resource_type__ = \"SubstancePolymerMonomerSetStartingMaterial\"\n\n    amount: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"A percentage\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"Substance high level category, e.g. chemical substance\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"The type of substance for this starting material\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    isDefining: bool | None = Field(\n        default=None,\n        alias=\"isDefining\",\n        title=(\n            \"Used to specify whether the attribute described is a defining element \"\n            \"for the unique identification of the polymer\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isDefining__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isDefining\", title=\"Extension field for ``isDefining``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstancePolymerMonomerSetStartingMaterial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"category\",\n            \"isDefining\",\n            \"amount\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstancePolymerMonomerSetStartingMaterial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"category\", \"isDefining\", \"amount\"]\n\n\nclass SubstancePolymerRepeat(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Specifies and quantifies the repeated units and their configuration.\n    \"\"\"\n\n    __resource_type__ = \"SubstancePolymerRepeat\"\n\n    averageMolecularFormula: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"averageMolecularFormula\",\n        title=\"A representation of an (average) molecular formula from a polymer\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    averageMolecularFormula__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_averageMolecularFormula\",\n        title=\"Extension field for ``averageMolecularFormula``.\",\n    )\n\n    repeatUnit: typing.List[\n        fhirtypes.SubstancePolymerRepeatRepeatUnitType\n    ] | None = Field(\n        default=None,\n        alias=\"repeatUnit\",\n        title=\"An SRU - Structural Repeat Unit\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    repeatUnitAmountType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"repeatUnitAmountType\",\n        title=(\n            \"How the quantitative amount of Structural Repeat Units is captured \"\n            \"(e.g. Exact, Numeric, Average)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstancePolymerRepeat`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"averageMolecularFormula\",\n            \"repeatUnitAmountType\",\n            \"repeatUnit\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstancePolymerRepeat`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"averageMolecularFormula\",\n            \"repeatUnitAmountType\",\n            \"repeatUnit\",\n        ]\n\n\nclass SubstancePolymerRepeatRepeatUnit(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An SRU - Structural Repeat Unit.\n    \"\"\"\n\n    __resource_type__ = \"SubstancePolymerRepeatRepeatUnit\"\n\n    amount: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Number of repeats of this unit\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    amount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_amount\", title=\"Extension field for ``amount``.\"\n    )\n\n    degreeOfPolymerisation: typing.List[\n        fhirtypes.SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisationType\n    ] | None = Field(\n        default=None,\n        alias=\"degreeOfPolymerisation\",\n        title=(\n            \"Applies to homopolymer and block co-polymers where the degree of \"\n            \"polymerisation within a block can be described\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    orientation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"orientation\",\n        title=(\n            \"The orientation of the polymerisation, e.g. head-tail, head-head, \"\n            \"random\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    structuralRepresentation: typing.List[\n        fhirtypes.SubstancePolymerRepeatRepeatUnitStructuralRepresentationType\n    ] | None = Field(\n        default=None,\n        alias=\"structuralRepresentation\",\n        title=\"A graphical structure for this SRU\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    unit: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"unit\",\n        title=\"Structural repeat units are essential elements for defining polymers\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    unit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_unit\", title=\"Extension field for ``unit``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstancePolymerRepeatRepeatUnit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"unit\",\n            \"orientation\",\n            \"amount\",\n            \"degreeOfPolymerisation\",\n            \"structuralRepresentation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstancePolymerRepeatRepeatUnit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"unit\",\n            \"orientation\",\n            \"amount\",\n            \"degreeOfPolymerisation\",\n            \"structuralRepresentation\",\n        ]\n\n\nclass SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Applies to homopolymer and block co-polymers where the degree of\n    polymerisation within a block can be described.\n    \"\"\"\n\n    __resource_type__ = \"SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation\"\n\n    average: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"average\",\n        title=\"An average amount of polymerisation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    average__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_average\", title=\"Extension field for ``average``.\"\n    )\n\n    high: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"high\",\n        title=\"A high expected limit of the amount\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    high__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_high\", title=\"Extension field for ``high``.\"\n    )\n\n    low: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"low\",\n        title=\"A low expected limit of the amount\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    low__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_low\", title=\"Extension field for ``low``.\"\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"The type of the degree of polymerisation shall be described, e.g. \"\n            \"SRU/Polymer Ratio\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"average\",\n            \"low\",\n            \"high\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstancePolymerRepeatRepeatUnitDegreeOfPolymerisation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"average\", \"low\", \"high\"]\n\n\nclass SubstancePolymerRepeatRepeatUnitStructuralRepresentation(\n    backboneelement.BackboneElement\n):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A graphical structure for this SRU.\n    \"\"\"\n\n    __resource_type__ = \"SubstancePolymerRepeatRepeatUnitStructuralRepresentation\"\n\n    attachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"attachment\",\n        title=\"An attached file with the structural representation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    format: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"format\",\n        title=(\n            \"The format of the representation e.g. InChI, SMILES, MOLFILE, CDX, \"\n            \"SDF, PDB, mmCIF\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    representation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"representation\",\n        title=(\n            \"The structural representation as text string in a standard format e.g.\"\n            \" InChI, SMILES, MOLFILE, CDX, SDF, PDB, mmCIF\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    representation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_representation\",\n        title=\"Extension field for ``representation``.\",\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The type of structure (e.g. Full, Partial, Representative)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstancePolymerRepeatRepeatUnitStructuralRepresentation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"representation\",\n            \"format\",\n            \"attachment\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstancePolymerRepeatRepeatUnitStructuralRepresentation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"representation\", \"format\", \"attachment\"]\n"
  },
  {
    "path": "fhir/resources/substanceprotein.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstanceProtein\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SubstanceProtein(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A SubstanceProtein is defined as a single unit of a linear amino acid\n    sequence, or a combination of subunits that are either covalently linked or\n    have a defined invariant stoichiometric relationship. This includes all\n    synthetic, recombinant and purified SubstanceProteins of defined sequence,\n    whether the use is therapeutic or prophylactic. This set of elements will\n    be used to describe albumins, coagulation factors, cytokines, growth\n    factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids,\n    recombinant vaccines, and immunomodulators.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceProtein\"\n\n    disulfideLinkage: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"disulfideLinkage\",\n        title=(\n            \"The disulphide bond between two cysteine residues either on the same \"\n            \"subunit or on two different subunits shall be described. The position \"\n            \"of the disulfide bonds in the SubstanceProtein shall be listed in \"\n            \"increasing order of subunit number and position within subunit \"\n            \"followed by the abbreviation of the amino acids involved. The \"\n            \"disulfide linkage positions shall actually contain the amino acid \"\n            \"Cysteine at the respective positions\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    disulfideLinkage__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_disulfideLinkage\",\n        title=\"Extension field for ``disulfideLinkage``.\",\n    )\n\n    numberOfSubunits: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"numberOfSubunits\",\n        title=(\n            \"Number of linear sequences of amino acids linked through peptide \"\n            \"bonds. The number of subunits constituting the SubstanceProtein shall \"\n            \"be described. It is possible that the number of subunits can be \"\n            \"variable\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    numberOfSubunits__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_numberOfSubunits\",\n        title=\"Extension field for ``numberOfSubunits``.\",\n    )\n\n    sequenceType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"sequenceType\",\n        title=(\n            \"The SubstanceProtein descriptive elements will only be used when a \"\n            \"complete or partial amino acid sequence is available or derivable from\"\n            \" a nucleic acid sequence\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subunit: typing.List[fhirtypes.SubstanceProteinSubunitType] | None = Field(\n        default=None,\n        alias=\"subunit\",\n        title=(\n            \"This subclause refers to the description of each subunit constituting \"\n            \"the SubstanceProtein. A subunit is a linear sequence of amino acids \"\n            \"linked through peptide bonds. The Subunit information shall be \"\n            \"provided when the finished SubstanceProtein is a complex of multiple \"\n            \"sequences; subunits are not used to delineate domains within a single \"\n            \"sequence. Subunits are listed in order of decreasing length; sequences\"\n            \" of the same length will be ordered by decreasing molecular weight; \"\n            \"subunits that have identical sequences will be repeated multiple times\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceProtein`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequenceType\",\n            \"numberOfSubunits\",\n            \"disulfideLinkage\",\n            \"subunit\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceProtein`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"sequenceType\",\n            \"numberOfSubunits\",\n            \"disulfideLinkage\",\n            \"subunit\",\n        ]\n\n\nclass SubstanceProteinSubunit(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    This subclause refers to the description of each subunit constituting the\n    SubstanceProtein. A subunit is a linear sequence of amino acids linked\n    through peptide bonds. The Subunit information shall be provided when the\n    finished SubstanceProtein is a complex of multiple sequences; subunits are\n    not used to delineate domains within a single sequence. Subunits are listed\n    in order of decreasing length; sequences of the same length will be ordered\n    by decreasing molecular weight; subunits that have identical sequences will\n    be repeated multiple times.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceProteinSubunit\"\n\n    cTerminalModification: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"cTerminalModification\",\n        title=\"The modification at the C-terminal shall be specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    cTerminalModification__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_cTerminalModification\",\n        title=\"Extension field for ``cTerminalModification``.\",\n    )\n\n    cTerminalModificationId: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"cTerminalModificationId\",\n        title=(\n            \"Unique identifier for molecular fragment modification based on the ISO\"\n            \" 11238 Substance ID\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    length: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"length\",\n        title=\"Length of linear sequences of amino acids contained in the subunit\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    length__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_length\", title=\"Extension field for ``length``.\"\n    )\n\n    nTerminalModification: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"nTerminalModification\",\n        title=(\n            \"The name of the fragment modified at the N-terminal of the \"\n            \"SubstanceProtein shall be specified\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    nTerminalModification__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_nTerminalModification\",\n        title=\"Extension field for ``nTerminalModification``.\",\n    )\n\n    nTerminalModificationId: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"nTerminalModificationId\",\n        title=(\n            \"Unique identifier for molecular fragment modification based on the ISO\"\n            \" 11238 Substance ID\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=(\n            \"The sequence information shall be provided enumerating the amino acids\"\n            \" from N- to C-terminal end using standard single-letter amino acid \"\n            \"codes. Uppercase shall be used for L-amino acids and lowercase for \"\n            \"D-amino acids. Transcribed SubstanceProteins will always be described \"\n            \"using the translated sequence; for synthetic peptide containing amino \"\n            \"acids that are not represented with a single letter code an X should \"\n            \"be used within the sequence. The modified amino acids will be \"\n            \"distinguished by their position in the sequence\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    sequenceAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"sequenceAttachment\",\n        title=(\n            \"The sequence information shall be provided enumerating the amino acids\"\n            \" from N- to C-terminal end using standard single-letter amino acid \"\n            \"codes. Uppercase shall be used for L-amino acids and lowercase for \"\n            \"D-amino acids. Transcribed SubstanceProteins will always be described \"\n            \"using the translated sequence; for synthetic peptide containing amino \"\n            \"acids that are not represented with a single letter code an X should \"\n            \"be used within the sequence. The modified amino acids will be \"\n            \"distinguished by their position in the sequence\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    subunit: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"subunit\",\n        title=(\n            \"Index of primary sequences of amino acids linked through peptide bonds\"\n            \" in order of decreasing length. Sequences of the same length will be \"\n            \"ordered by molecular weight. Subunits that have identical sequences \"\n            \"will be repeated and have sequential subscripts\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    subunit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subunit\", title=\"Extension field for ``subunit``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceProteinSubunit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"subunit\",\n            \"sequence\",\n            \"length\",\n            \"sequenceAttachment\",\n            \"nTerminalModificationId\",\n            \"nTerminalModification\",\n            \"cTerminalModificationId\",\n            \"cTerminalModification\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceProteinSubunit`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"subunit\",\n            \"sequence\",\n            \"length\",\n            \"sequenceAttachment\",\n            \"nTerminalModificationId\",\n            \"nTerminalModification\",\n            \"cTerminalModificationId\",\n            \"cTerminalModification\",\n        ]\n"
  },
  {
    "path": "fhir/resources/substancereferenceinformation.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstanceReferenceInformation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SubstanceReferenceInformation(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Todo.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceReferenceInformation\"\n\n    comment: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"comment\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    comment__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_comment\", title=\"Extension field for ``comment``.\"\n    )\n\n    gene: typing.List[fhirtypes.SubstanceReferenceInformationGeneType] | None = Field(\n        default=None,\n        alias=\"gene\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    geneElement: typing.List[\n        fhirtypes.SubstanceReferenceInformationGeneElementType\n    ] | None = Field(\n        default=None,\n        alias=\"geneElement\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    target: typing.List[\n        fhirtypes.SubstanceReferenceInformationTargetType\n    ] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceReferenceInformation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"comment\",\n            \"gene\",\n            \"geneElement\",\n            \"target\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceReferenceInformation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"comment\",\n            \"gene\",\n            \"geneElement\",\n            \"target\",\n        ]\n\n\nclass SubstanceReferenceInformationGene(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Todo.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceReferenceInformationGene\"\n\n    gene: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"gene\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    geneSequenceOrigin: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"geneSequenceOrigin\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceReferenceInformationGene`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"geneSequenceOrigin\",\n            \"gene\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceReferenceInformationGene`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"geneSequenceOrigin\", \"gene\", \"source\"]\n\n\nclass SubstanceReferenceInformationGeneElement(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Todo.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceReferenceInformationGeneElement\"\n\n    element: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"element\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceReferenceInformationGeneElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"element\", \"source\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceReferenceInformationGeneElement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"element\", \"source\"]\n\n\nclass SubstanceReferenceInformationTarget(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Todo.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceReferenceInformationTarget\"\n\n    amountQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"amountQuantity\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    amountRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"amountRange\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    amountString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"amountString\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e amount[x]\n            \"one_of_many\": \"amount\",\n            \"one_of_many_required\": False,\n        },\n    )\n    amountString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_amountString\",\n        title=\"Extension field for ``amountString``.\",\n    )\n\n    amountType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"amountType\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    interaction: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"interaction\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    organism: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"organism\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    organismType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"organismType\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    source: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"source\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"DocumentReference\"],\n        },\n    )\n\n    target: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Todo\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceReferenceInformationTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"target\",\n            \"type\",\n            \"interaction\",\n            \"organism\",\n            \"organismType\",\n            \"amountQuantity\",\n            \"amountRange\",\n            \"amountString\",\n            \"amountType\",\n            \"source\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceReferenceInformationTarget`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"target\",\n            \"type\",\n            \"interaction\",\n            \"organism\",\n            \"organismType\",\n            \"amountQuantity\",\n            \"amountRange\",\n            \"amountString\",\n            \"amountType\",\n            \"source\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"amount\": [\"amountQuantity\", \"amountRange\", \"amountString\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/substancesourcematerial.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstanceSourceMaterial\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SubstanceSourceMaterial(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Source material shall capture information on the taxonomic and anatomical\n    origins as well as the fraction of a material that can result in or can be\n    modified to form a substance. This set of data elements shall be used to\n    define polymer substances isolated from biological matrices. Taxonomic and\n    anatomical origins shall be described using a controlled vocabulary as\n    required. This information is captured for naturally derived polymers ( .\n    starch) and structurally diverse substances. For Organisms belonging to the\n    Kingdom Plantae the Substance level defines the fresh material of a single\n    species or infraspecies, the Herbal Drug and the Herbal preparation. For\n    Herbal preparations, the fraction information will be captured at the\n    Substance information level and additional information for herbal extracts\n    will be captured at the Specified Substance Group 1 information level. See\n    for further explanation the Substance Class: Structurally Diverse and the\n    herbal annex.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceSourceMaterial\"\n\n    countryOfOrigin: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"countryOfOrigin\",\n        title=(\n            \"The country where the plant material is harvested or the countries \"\n            \"where the plasma is sourced from as laid down in accordance with the \"\n            \"Plasma Master File. For \\u201cPlasma-derived substances\\u201d the attribute \"\n            \"country of origin provides information about the countries used for \"\n            \"the manufacturing of the Cryopoor plama or Crioprecipitate\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    developmentStage: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"developmentStage\",\n        title=(\n            \"Stage of life for animals, plants, insects and microorganisms. This \"\n            \"information shall be provided only when the substance is significantly\"\n            \" different in these stages (e.g. foetal bovine serum)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    fractionDescription: typing.List[\n        fhirtypes.SubstanceSourceMaterialFractionDescriptionType\n    ] | None = Field(\n        default=None,\n        alias=\"fractionDescription\",\n        title=(\n            \"Many complex materials are fractions of parts of plants, animals, or \"\n            \"minerals. Fraction elements are often necessary to define both \"\n            \"Substances and Specified Group 1 Substances. For substances derived \"\n            \"from Plants, fraction information will be captured at the Substance \"\n            \"information level ( . Oils, Juices and Exudates). Additional \"\n            \"information for Extracts, such as extraction solvent composition, will\"\n            \" be captured at the Specified Substance Group 1 information level. For\"\n            \" plasma-derived products fraction information will be captured at the \"\n            \"Substance and the Specified Substance Group 1 levels\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    geographicalLocation: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"geographicalLocation\",\n        title=(\n            \"The place/region where the plant is harvested or the places/regions \"\n            \"where the animal source material has its habitat\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    geographicalLocation__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_geographicalLocation\",\n        title=\"Extension field for ``geographicalLocation``.\",\n    )\n\n    organism: fhirtypes.SubstanceSourceMaterialOrganismType | None = Field(\n        default=None,\n        alias=\"organism\",\n        title=(\n            \"This subclause describes the organism which the substance is derived \"\n            \"from. For vaccines, the parent organism shall be specified based on \"\n            \"these subclause elements. As an example, full taxonomy will be \"\n            \"described for the Substance Name: ., Leaf\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    organismId: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"organismId\",\n        title=(\n            \"The unique identifier associated with the source material parent \"\n            \"organism shall be specified\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    organismName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"organismName\",\n        title=(\n            \"The organism accepted Scientific name shall be provided based on the \"\n            \"organism taxonomy\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    organismName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_organismName\",\n        title=\"Extension field for ``organismName``.\",\n    )\n\n    parentSubstanceId: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"parentSubstanceId\",\n        title=(\n            \"The parent of the herbal drug Ginkgo biloba, Leaf is the substance ID \"\n            \"of the substance (fresh) of Ginkgo biloba L. or Ginkgo biloba L. \"\n            \"(Whole plant)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    parentSubstanceName: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"parentSubstanceName\",\n        title=\"The parent substance of the Herbal Drug, or Herbal preparation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    parentSubstanceName__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_parentSubstanceName\",\n        title=\"Extension field for ``parentSubstanceName``.\",\n    )\n\n    partDescription: typing.List[\n        fhirtypes.SubstanceSourceMaterialPartDescriptionType\n    ] | None = Field(\n        default=None,\n        alias=\"partDescription\",\n        title=\"To do\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sourceMaterialClass: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"sourceMaterialClass\",\n        title=(\n            \"General high level classification of the source material specific to \"\n            \"the origin of the material\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sourceMaterialState: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"sourceMaterialState\",\n        title=\"The state of the source material when extracted\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sourceMaterialType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"sourceMaterialType\",\n        title=(\n            \"The type of the source material shall be specified based on a \"\n            \"controlled vocabulary. For vaccines, this subclause refers to the \"\n            \"class of infectious agent\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceSourceMaterial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sourceMaterialClass\",\n            \"sourceMaterialType\",\n            \"sourceMaterialState\",\n            \"organismId\",\n            \"organismName\",\n            \"parentSubstanceId\",\n            \"parentSubstanceName\",\n            \"countryOfOrigin\",\n            \"geographicalLocation\",\n            \"developmentStage\",\n            \"fractionDescription\",\n            \"organism\",\n            \"partDescription\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterial`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"sourceMaterialClass\",\n            \"sourceMaterialType\",\n            \"sourceMaterialState\",\n            \"organismId\",\n            \"organismName\",\n            \"parentSubstanceId\",\n            \"parentSubstanceName\",\n            \"countryOfOrigin\",\n            \"geographicalLocation\",\n            \"developmentStage\",\n            \"fractionDescription\",\n            \"organism\",\n            \"partDescription\",\n        ]\n\n\nclass SubstanceSourceMaterialFractionDescription(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Many complex materials are fractions of parts of plants, animals, or\n    minerals. Fraction elements are often necessary to define both Substances\n    and Specified Group 1 Substances. For substances derived from Plants,\n    fraction information will be captured at the Substance information level (\n    . Oils, Juices and Exudates). Additional information for Extracts, such as\n    extraction solvent composition, will be captured at the Specified Substance\n    Group 1 information level. For plasma-derived products fraction information\n    will be captured at the Substance and the Specified Substance Group 1\n    levels.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceSourceMaterialFractionDescription\"\n\n    fraction: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"fraction\",\n        title=(\n            \"This element is capturing information about the fraction of a plant \"\n            \"part, or human plasma for fractionation\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    fraction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_fraction\", title=\"Extension field for ``fraction``.\"\n    )\n\n    materialType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"materialType\",\n        title=(\n            \"The specific type of the material constituting the component. For \"\n            \"Herbal preparations the particulars of the extracts (liquid/dry) is \"\n            \"described in Specified Substance Group 1\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceSourceMaterialFractionDescription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"fraction\", \"materialType\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterialFractionDescription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"fraction\", \"materialType\"]\n\n\nclass SubstanceSourceMaterialOrganism(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    This subclause describes the organism which the substance is derived from.\n    For vaccines, the parent organism shall be specified based on these\n    subclause elements. As an example, full taxonomy will be described for the\n    Substance Name: ., Leaf.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceSourceMaterialOrganism\"\n\n    author: typing.List[\n        fhirtypes.SubstanceSourceMaterialOrganismAuthorType\n    ] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"4.9.13.6.1 Author type (Conditional)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    family: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"family\",\n        title=\"The family of an organism shall be specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    genus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"genus\",\n        title=(\n            \"The genus of an organism shall be specified; refers to the Latin \"\n            \"epithet of the genus element of the plant/animal scientific name; it \"\n            \"is present in names for genera, species and infraspecies\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    hybrid: fhirtypes.SubstanceSourceMaterialOrganismHybridType | None = Field(\n        default=None,\n        alias=\"hybrid\",\n        title=\"4.9.13.8.1 Hybrid species maternal organism ID (Optional)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    intraspecificDescription: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"intraspecificDescription\",\n        title=(\n            \"The intraspecific description of an organism shall be specified based \"\n            \"on a controlled vocabulary. For Influenza Vaccine, the intraspecific \"\n            \"description shall contain the syntax of the antigen in line with the \"\n            \"WHO convention\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    intraspecificDescription__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_intraspecificDescription\",\n        title=\"Extension field for ``intraspecificDescription``.\",\n    )\n\n    intraspecificType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"intraspecificType\",\n        title=\"The Intraspecific type of an organism shall be specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    organismGeneral: fhirtypes.SubstanceSourceMaterialOrganismOrganismGeneralType | None = Field(\n        default=None,\n        alias=\"organismGeneral\",\n        title=\"4.9.13.7.1 Kingdom (Conditional)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    species: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"species\",\n        title=(\n            \"The species of an organism shall be specified; refers to the Latin \"\n            \"epithet of the species of the plant/animal; it is present in names for\"\n            \" species and infraspecies\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceSourceMaterialOrganism`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"family\",\n            \"genus\",\n            \"species\",\n            \"intraspecificType\",\n            \"intraspecificDescription\",\n            \"author\",\n            \"hybrid\",\n            \"organismGeneral\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterialOrganism`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"family\",\n            \"genus\",\n            \"species\",\n            \"intraspecificType\",\n            \"intraspecificDescription\",\n            \"author\",\n            \"hybrid\",\n            \"organismGeneral\",\n        ]\n\n\nclass SubstanceSourceMaterialOrganismAuthor(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    4.9.13.6.1 Author type (Conditional).\n    \"\"\"\n\n    __resource_type__ = \"SubstanceSourceMaterialOrganismAuthor\"\n\n    authorDescription: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"authorDescription\",\n        title=(\n            \"The author of an organism species shall be specified. The author year \"\n            \"of an organism shall also be specified when applicable; refers to the \"\n            \"year in which the first author(s) published the infraspecific \"\n            \"plant/animal name (of any rank)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authorDescription__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_authorDescription\",\n        title=\"Extension field for ``authorDescription``.\",\n    )\n\n    authorType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"authorType\",\n        title=(\n            \"The type of author of an organism species shall be specified. The \"\n            \"parenthetical author of an organism species refers to the first author\"\n            \" who published the plant/animal name (of any rank). The primary author\"\n            \" of an organism species refers to the first author(s), who validly \"\n            \"published the plant/animal name\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceSourceMaterialOrganismAuthor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"authorType\",\n            \"authorDescription\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterialOrganismAuthor`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"authorType\", \"authorDescription\"]\n\n\nclass SubstanceSourceMaterialOrganismHybrid(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    4.9.13.8.1 Hybrid species maternal organism ID (Optional).\n    \"\"\"\n\n    __resource_type__ = \"SubstanceSourceMaterialOrganismHybrid\"\n\n    hybridType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"hybridType\",\n        title=\"The hybrid type of an organism shall be specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maternalOrganismId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"maternalOrganismId\",\n        title=(\n            \"The identifier of the maternal species constituting the hybrid \"\n            \"organism shall be specified based on a controlled vocabulary. For \"\n            \"plants, the parents aren\\u2019t always known, and it is unlikely that it \"\n            \"will be known which is maternal and which is paternal\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    maternalOrganismId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maternalOrganismId\",\n        title=\"Extension field for ``maternalOrganismId``.\",\n    )\n\n    maternalOrganismName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"maternalOrganismName\",\n        title=(\n            \"The name of the maternal species constituting the hybrid organism \"\n            \"shall be specified. For plants, the parents aren\\u2019t always known, and \"\n            \"it is unlikely that it will be known which is maternal and which is \"\n            \"paternal\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    maternalOrganismName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maternalOrganismName\",\n        title=\"Extension field for ``maternalOrganismName``.\",\n    )\n\n    paternalOrganismId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"paternalOrganismId\",\n        title=(\n            \"The identifier of the paternal species constituting the hybrid \"\n            \"organism shall be specified based on a controlled vocabulary\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    paternalOrganismId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_paternalOrganismId\",\n        title=\"Extension field for ``paternalOrganismId``.\",\n    )\n\n    paternalOrganismName: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"paternalOrganismName\",\n        title=(\n            \"The name of the paternal species constituting the hybrid organism \"\n            \"shall be specified\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    paternalOrganismName__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_paternalOrganismName\",\n        title=\"Extension field for ``paternalOrganismName``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceSourceMaterialOrganismHybrid`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"maternalOrganismId\",\n            \"maternalOrganismName\",\n            \"paternalOrganismId\",\n            \"paternalOrganismName\",\n            \"hybridType\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterialOrganismHybrid`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"modifierExtension\",\n            \"maternalOrganismId\",\n            \"maternalOrganismName\",\n            \"paternalOrganismId\",\n            \"paternalOrganismName\",\n            \"hybridType\",\n        ]\n\n\nclass SubstanceSourceMaterialOrganismOrganismGeneral(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    4.9.13.7.1 Kingdom (Conditional).\n    \"\"\"\n\n    __resource_type__ = \"SubstanceSourceMaterialOrganismOrganismGeneral\"\n\n    class_fhir: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"class\",\n        title=\"The class of an organism shall be specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kingdom: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"kingdom\",\n        title=\"The kingdom of an organism shall be specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    order: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"order\",\n        title=\"The order of an organism shall be specified,\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    phylum: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"phylum\",\n        title=\"The phylum of an organism shall be specified\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceSourceMaterialOrganismOrganismGeneral`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"kingdom\",\n            \"phylum\",\n            \"class\",\n            \"order\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterialOrganismOrganismGeneral`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"kingdom\", \"phylum\", \"class\", \"order\"]\n\n\nclass SubstanceSourceMaterialPartDescription(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    To do.\n    \"\"\"\n\n    __resource_type__ = \"SubstanceSourceMaterialPartDescription\"\n\n    part: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"part\",\n        title=\"Entity of anatomical origin of source material within an organism\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    partLocation: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"partLocation\",\n        title=(\n            \"The detailed anatomic location when the part can be extracted from \"\n            \"different anatomical locations of the organism. Multiple alternative \"\n            \"locations may apply\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SubstanceSourceMaterialPartDescription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"part\", \"partLocation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SubstanceSourceMaterialPartDescription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"part\", \"partLocation\"]\n"
  },
  {
    "path": "fhir/resources/supplydelivery.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SupplyDelivery\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SupplyDelivery(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Delivery of bulk Supplies.\n    Record of delivery of what is supplied.\n    \"\"\"\n\n    __resource_type__ = \"SupplyDelivery\"\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Fulfills plan, proposal or order\",\n        description=(\n            \"A plan, proposal or order that is fulfilled in whole or in part by \"\n            \"this event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SupplyRequest\"],\n        },\n    )\n\n    destination: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Where the delivery was sent\",\n        description=(\n            \"Identification of the facility/location where the delivery was shipped\"\n            \" to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifier for the supply delivery event that is used to identify it \"\n            \"across multiple disparate systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When event occurred\",\n        description=\"The date or time(s) the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When event occurred\",\n        description=\"The date or time(s) the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When event occurred\",\n        description=\"The date or time(s) the activity occurred.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=\"A larger event of which this particular event is a component or step.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SupplyDelivery\", \"Contract\"],\n        },\n    )\n\n    patient: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"patient\",\n        title=\"Patient for whom the item is supplied\",\n        description=(\n            \"A link to a resource representing the person whom the delivered item \"\n            \"is for.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    receiver: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"receiver\",\n        title=\"Who received the delivery\",\n        description=\"Identifies the individual or organization that received the delivery.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"in-progress | completed | abandoned | entered-in-error\",\n        description=\"A code specifying the state of the dispense event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"in-progress\",\n                \"completed\",\n                \"abandoned\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    suppliedItem: typing.List[fhirtypes.SupplyDeliverySuppliedItemType] | None = Field(\n        default=None,\n        alias=\"suppliedItem\",\n        title=\"The item that is delivered or supplied\",\n        description=\"The item that is being delivered or has been supplied.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    supplier: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"supplier\",\n        title=\"The item supplier\",\n        description=\"The individual or organization responsible for supplying the delivery.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    type: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Category of supply event\",\n        description=(\n            \"Indicates the type of supply being provided.  Examples include: \"\n            \"Medication, Device, Biologically Derived Product.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyDelivery`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"patient\",\n            \"type\",\n            \"suppliedItem\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"supplier\",\n            \"destination\",\n            \"receiver\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyDelivery`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"basedOn\",\n            \"partOf\",\n            \"status\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\", \"occurrenceTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass SupplyDeliverySuppliedItem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The item that is delivered or supplied.\n    The item that is being delivered or has been supplied.\n    \"\"\"\n\n    __resource_type__ = \"SupplyDeliverySuppliedItem\"\n\n    itemCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"itemCodeableConcept\",\n        title=\"Medication, Substance, Device or Biologically Derived Product supplied\",\n        description=(\n            \"Identifies the medication, substance, device or biologically derived \"\n            \"product being supplied. This is either a link to a resource \"\n            \"representing the details of the item or a code that identifies the \"\n            \"item from a known list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    itemReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"itemReference\",\n        title=\"Medication, Substance, Device or Biologically Derived Product supplied\",\n        description=(\n            \"Identifies the medication, substance, device or biologically derived \"\n            \"product being supplied. This is either a link to a resource \"\n            \"representing the details of the item or a code that identifies the \"\n            \"item from a known list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e item[x]\n            \"one_of_many\": \"item\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Medication\",\n                \"Substance\",\n                \"Device\",\n                \"BiologicallyDerivedProduct\",\n                \"NutritionProduct\",\n                \"InventoryItem\",\n            ],\n        },\n    )\n\n    quantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"quantity\",\n        title=\"Amount supplied\",\n        description=(\n            \"The amount of the item that has been supplied.  Unit of measure may be\"\n            \" included.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyDeliverySuppliedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"quantity\",\n            \"itemCodeableConcept\",\n            \"itemReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyDeliverySuppliedItem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"item\": [\"itemCodeableConcept\", \"itemReference\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/supplyrequest.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SupplyRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass SupplyRequest(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Request for a medication, substance or device.\n    A record of a request to deliver a medication, substance or device used in\n    the healthcare setting to a particular destination for a particular person\n    or organization.\n    \"\"\"\n\n    __resource_type__ = \"SupplyRequest\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"When the request was made\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"What other request is fulfilled by this supply request\",\n        description=\"Plan/proposal/order fulfilled by this request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    category: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"The kind of supply (central, non-stock, etc.)\",\n        description=(\n            \"Category of supply, e.g.  central, non-stock, etc. This is used to \"\n            \"support work flows associated with the supply process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    deliverFor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"deliverFor\",\n        title=\"The patient for who the supply request is for\",\n        description=(\n            \"The patient to whom the supply will be given or for whom they will be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    deliverFrom: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"deliverFrom\",\n        title=\"The origin of the supply\",\n        description=\"Where the supply is expected to come from.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"Location\"],\n        },\n    )\n\n    deliverTo: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"deliverTo\",\n        title=\"The destination of the supply\",\n        description=\"Where the supply is destined to go.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Location\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for SupplyRequest\",\n        description=(\n            \"Business identifiers assigned to this SupplyRequest by the author \"\n            \"and/or other systems. These identifiers remain constant as the \"\n            \"resource is updated and propagates from server to server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    item: fhirtypes.CodeableReferenceType = Field(\n        default=...,\n        alias=\"item\",\n        title=\"Medication, Substance, or Device requested to be supplied\",\n        description=(\n            \"The item that is requested to be supplied. This is either a link to a \"\n            \"resource representing the details of the item or a code that \"\n            \"identifies the item from a known list.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Medication\",\n                \"Substance\",\n                \"Device\",\n                \"DeviceDefinition\",\n                \"BiologicallyDerivedProduct\",\n                \"NutritionProduct\",\n                \"InventoryItem\",\n            ],\n        },\n    )\n\n    occurrenceDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"occurrenceDateTime\",\n        title=\"When the request should be fulfilled\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n    occurrenceDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_occurrenceDateTime\",\n        title=\"Extension field for ``occurrenceDateTime``.\",\n    )\n\n    occurrencePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"occurrencePeriod\",\n        title=\"When the request should be fulfilled\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    occurrenceTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"occurrenceTiming\",\n        title=\"When the request should be fulfilled\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e occurrence[x]\n            \"one_of_many\": \"occurrence\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    parameter: typing.List[fhirtypes.SupplyRequestParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Ordered item details\",\n        description=(\n            \"Specific parameters for the ordered item.  For example, the size of \"\n            \"the indicated item.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly this SupplyRequest should be addressed with \"\n            \"respect to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    quantity: fhirtypes.QuantityType = Field(\n        default=...,\n        alias=\"quantity\",\n        title=\"The requested amount of the item indicated\",\n        description=\"The amount that is being ordered of the indicated item.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"The reason why the supply item was requested\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Condition\",\n                \"Observation\",\n                \"DiagnosticReport\",\n                \"DocumentReference\",\n            ],\n        },\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Individual making the request\",\n        description=\"The device, practitioner, etc. who initiated the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"Patient\",\n                \"RelatedPerson\",\n                \"Device\",\n                \"CareTeam\",\n            ],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | suspended +\",\n        description=\"Status of the supply request.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"suspended\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    supplier: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"supplier\",\n        title=\"Who is intended to fulfill the request\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\", \"HealthcareService\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"basedOn\",\n            \"category\",\n            \"priority\",\n            \"deliverFor\",\n            \"item\",\n            \"quantity\",\n            \"parameter\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"authoredOn\",\n            \"requester\",\n            \"supplier\",\n            \"reason\",\n            \"deliverFrom\",\n            \"deliverTo\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyRequest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"basedOn\",\n            \"category\",\n            \"priority\",\n            \"item\",\n            \"quantity\",\n            \"occurrenceDateTime\",\n            \"occurrencePeriod\",\n            \"occurrenceTiming\",\n            \"authoredOn\",\n            \"requester\",\n            \"supplier\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"occurrence\": [\"occurrenceDateTime\", \"occurrencePeriod\", \"occurrenceTiming\"]\n        }\n        return one_of_many_fields\n\n\nclass SupplyRequestParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Ordered item details.\n    Specific parameters for the ordered item.  For example, the size of the\n    indicated item.\n    \"\"\"\n\n    __resource_type__ = \"SupplyRequestParameter\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Item detail\",\n        description=\"A code or string that identifies the device detail being asserted.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value of detail\",\n        description=\"The value of the device detail.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``SupplyRequestParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueBoolean\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``SupplyRequestParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/task.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Task\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Task(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A task to be performed.\n    \"\"\"\n\n    __resource_type__ = \"Task\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"Task Creation Date\",\n        description=\"The date and time this task was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this task\",\n        description=(\n            \"BasedOn refers to a higher-level authorization that triggered the \"\n            'creation of the task.  It references a \"request\" resource such as a '\n            \"ServiceRequest, MedicationRequest, CarePlan, etc. which is distinct \"\n            'from the \"request\" resource the task is seeking to fulfill.  This '\n            \"latter resource is referenced by focus.  For example, based on a \"\n            \"CarePlan (= basedOn), a task is created to fulfill a ServiceRequest ( \"\n            \"= focus ) to collect a specimen from a patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    businessStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"businessStatus\",\n        title='E.g. \"Specimen collected\", \"IV prepped\"',\n        description=\"Contains business-specific nuances of the business state.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Task Type\",\n        description=\"A name or code (or both) briefly describing what the task involves.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-readable explanation of task\",\n        description=\"A free-text description of what is to be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    doNotPerform: bool | None = Field(\n        default=None,\n        alias=\"doNotPerform\",\n        title=\"True if Task is prohibiting action\",\n        description=(\n            \"If true indicates that the Task is asking for the specified action to \"\n            \"*not* occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    doNotPerform__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_doNotPerform\",\n        title=\"Extension field for ``doNotPerform``.\",\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Healthcare event during which this task originated\",\n        description=(\n            \"The healthcare event  (e.g. a patient and healthcare provider \"\n            \"interaction) during which this task was created.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    executionPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"executionPeriod\",\n        title=\"Start and end time of execution\",\n        description=(\n            \"Identifies the time action was first taken against the task (start) \"\n            \"and/or the time final action was taken against the task prior to \"\n            \"marking it as completed (end).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    focus: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"What task is acting on\",\n        description=(\n            \"The request being fulfilled or the resource being manipulated \"\n            \"(changed, suspended, etc.) by this task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    for_fhir: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"for\",\n        title=\"Beneficiary of the Task\",\n        description=(\n            \"The entity who benefits from the performance of the service specified \"\n            \"in the task (e.g., the patient).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Requisition or grouper id\",\n        description=(\n            \"A shared identifier common to multiple independent Task and Request \"\n            \"instances that were activated/authorized more or less simultaneously \"\n            \"by a single author.  The presence of the same identifier on each \"\n            \"request ties those requests together and may have business \"\n            \"ramifications in terms of reporting of results, billing, etc.  E.g. a \"\n            \"requisition number shared by a set of lab tests ordered together, or a\"\n            \" prescription number shared by all meds ordered at one time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Task Instance Identifier\",\n        description=\"The business identifier for this task.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    input: typing.List[fhirtypes.TaskInputType] | None = Field(\n        default=None,\n        alias=\"input\",\n        title=\"Information used to perform task\",\n        description=(\n            \"Additional information that may be needed in the execution of the \" \"task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Formal definition of task\",\n        description=(\n            \"The URL pointing to a *FHIR*-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this Task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\"],\n        },\n    )\n    instantiatesCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Formal definition of task\",\n        description=(\n            \"The URL pointing to an *externally* maintained  protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this Task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    insurance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Associated insurance coverage\",\n        description=(\n            \"Insurance plans, coverage extensions, pre-authorizations and/or pre-\"\n            \"determinations that may be relevant to the Task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\", \"ClaimResponse\"],\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"unknown | proposal | plan | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            'Indicates the \"level\" of actionability associated with the Task, i.e. '\n            \"i+R[9]Cs this a proposed task, a planned task, an actionable task, \"\n            \"etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"unknown\",\n                \"proposal\",\n                \"plan\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    lastModified: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"lastModified\",\n        title=\"Task Last Modified Date\",\n        description=\"The date and time of last modification to this task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastModified\",\n        title=\"Extension field for ``lastModified``.\",\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where task occurs\",\n        description=\"Principal physical location where this task is performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the task\",\n        description=\"Free-text information captured about the task as it progresses.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    output: typing.List[fhirtypes.TaskOutputType] | None = Field(\n        default=None,\n        alias=\"output\",\n        title=\"Information produced as part of task\",\n        description=\"Outputs produced by the Task.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    owner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"owner\",\n        title=\"Responsible individual\",\n        description=\"Party responsible for managing task execution.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Composite task\",\n        description=\"Task that this particular task is part of.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Task\"],\n        },\n    )\n\n    performer: typing.List[fhirtypes.TaskPerformerType] | None = Field(\n        default=None,\n        alias=\"performer\",\n        title=\"Who or what performed the task\",\n        description=\"The entity who performed the requested task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the Task should be addressed with respect to \"\n            \"other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reason: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why task is needed\",\n        description=(\n            \"A description, code, or reference indicating why this task needs to be\"\n            \" performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Key events in history of the Task\",\n        description=(\n            \"Links to Provenance records for past versions of this Task that \"\n            \"identify key state transitions or updates that are likely to be \"\n            \"relevant to a user looking at the current version of the task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    requestedPerformer: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"requestedPerformer\",\n        title=\"Who should perform Task\",\n        description=(\n            \"The kind of participant or specific participant that should perform \"\n            \"the task.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"HealthcareService\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    requestedPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"requestedPeriod\",\n        title=\"When the task should be performed\",\n        description=(\n            \"Indicates the start and/or end of the period of time when completion \"\n            \"of the task is desired to take place.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who is asking for task to be done\",\n        description=\"The creator of the task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    restriction: fhirtypes.TaskRestrictionType | None = Field(\n        default=None,\n        alias=\"restriction\",\n        title=\"Constraints on fulfillment tasks\",\n        description=(\n            \"If the Task.focus is a request resource and the task is seeking \"\n            \"fulfillment (i.e. is asking for the request to be actioned), this \"\n            \"element identifies any limitations on what parts of the referenced \"\n            \"request should be actioned.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | requested | received | accepted | +\",\n        description=\"The current status of the task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"requested\", \"received\", \"accepted\", \"+\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=\"An explanation as to why this task is held, failed, was refused, etc.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Task`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"businessStatus\",\n            \"intent\",\n            \"priority\",\n            \"doNotPerform\",\n            \"code\",\n            \"description\",\n            \"focus\",\n            \"for\",\n            \"encounter\",\n            \"requestedPeriod\",\n            \"executionPeriod\",\n            \"authoredOn\",\n            \"lastModified\",\n            \"requester\",\n            \"requestedPerformer\",\n            \"owner\",\n            \"performer\",\n            \"location\",\n            \"reason\",\n            \"insurance\",\n            \"note\",\n            \"relevantHistory\",\n            \"restriction\",\n            \"input\",\n            \"output\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Task`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"businessStatus\",\n            \"intent\",\n            \"doNotPerform\",\n            \"code\",\n            \"description\",\n            \"focus\",\n            \"for\",\n            \"encounter\",\n            \"requestedPeriod\",\n            \"executionPeriod\",\n            \"lastModified\",\n            \"requester\",\n            \"owner\",\n            \"performer\",\n            \"location\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass TaskInput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information used to perform task.\n    Additional information that may be needed in the execution of the task.\n    \"\"\"\n\n    __resource_type__ = \"TaskInput\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Label for the input\",\n        description=(\n            \"A code or description indicating how the input is intended to be used \"\n            \"as part of the task execution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAvailability: fhirtypes.AvailabilityType | None = Field(\n        default=None,\n        alias=\"valueAvailability\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueCanonical\",\n        title=\"Extension field for ``valueCanonical``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"valueCodeableReference\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"valueContactDetail\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"valueDataRequirement\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"valueDosage\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"valueExpression\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field(\n        default=None,\n        alias=\"valueExtendedContactDetail\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueInteger64: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"valueInteger64\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger64\",\n        title=\"Extension field for ``valueInteger64``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"valueParameterDefinition\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"valueRatioRange\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"valueRelatedArtifact\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"valueTriggerDefinition\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUrl\", title=\"Extension field for ``valueUrl``.\"\n    )\n\n    valueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"valueUsageContext\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"valueUuid\",\n        title=\"Content to use in performing the task\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUuid\", title=\"Extension field for ``valueUuid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TaskInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueInteger64\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCodeableReference\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueRatioRange\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueAvailability\",\n            \"valueExtendedContactDetail\",\n            \"valueDosage\",\n            \"valueMeta\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TaskInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueAvailability\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCanonical\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCodeableReference\",\n                \"valueCoding\",\n                \"valueContactDetail\",\n                \"valueContactPoint\",\n                \"valueCount\",\n                \"valueDataRequirement\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDosage\",\n                \"valueDuration\",\n                \"valueExpression\",\n                \"valueExtendedContactDetail\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueInteger64\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valueParameterDefinition\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueRatioRange\",\n                \"valueReference\",\n                \"valueRelatedArtifact\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueTriggerDefinition\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n                \"valueUrl\",\n                \"valueUsageContext\",\n                \"valueUuid\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass TaskOutput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information produced as part of task.\n    Outputs produced by the Task.\n    \"\"\"\n\n    __resource_type__ = \"TaskOutput\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Label for output\",\n        description=\"The name of the Output parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAvailability: fhirtypes.AvailabilityType | None = Field(\n        default=None,\n        alias=\"valueAvailability\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueCanonical\",\n        title=\"Extension field for ``valueCanonical``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"valueCodeableReference\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"valueContactDetail\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"valueDataRequirement\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"valueDosage\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"valueExpression\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field(\n        default=None,\n        alias=\"valueExtendedContactDetail\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueInteger64: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"valueInteger64\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger64\",\n        title=\"Extension field for ``valueInteger64``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"valueParameterDefinition\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"valueRatioRange\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"valueRelatedArtifact\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"valueTriggerDefinition\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUrl\", title=\"Extension field for ``valueUrl``.\"\n    )\n\n    valueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"valueUsageContext\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"valueUuid\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUuid\", title=\"Extension field for ``valueUuid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TaskOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueInteger64\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCodeableReference\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueRatioRange\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueAvailability\",\n            \"valueExtendedContactDetail\",\n            \"valueDosage\",\n            \"valueMeta\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TaskOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueAvailability\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCanonical\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCodeableReference\",\n                \"valueCoding\",\n                \"valueContactDetail\",\n                \"valueContactPoint\",\n                \"valueCount\",\n                \"valueDataRequirement\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDosage\",\n                \"valueDuration\",\n                \"valueExpression\",\n                \"valueExtendedContactDetail\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueInteger64\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valueParameterDefinition\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueRatioRange\",\n                \"valueReference\",\n                \"valueRelatedArtifact\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueTriggerDefinition\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n                \"valueUrl\",\n                \"valueUsageContext\",\n                \"valueUuid\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass TaskPerformer(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Who or what performed the task.\n    The entity who performed the requested task.\n    \"\"\"\n\n    __resource_type__ = \"TaskPerformer\"\n\n    actor: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"actor\",\n        title=\"Who performed the task\",\n        description=\"The actor or entity who performed the task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"Patient\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    function: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"function\",\n        title=\"Type of performance\",\n        description=\"A code or description of the performer of the task.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TaskPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"function\", \"actor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TaskPerformer`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"function\", \"actor\"]\n\n\nclass TaskRestriction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Constraints on fulfillment tasks.\n    If the Task.focus is a request resource and the task is seeking fulfillment\n    (i.e. is asking for the request to be actioned), this element identifies\n    any limitations on what parts of the referenced request should be actioned.\n    \"\"\"\n\n    __resource_type__ = \"TaskRestriction\"\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When fulfillment is sought\",\n        description=(\n            \"The time-period for which fulfillment is sought. This must fall within\"\n            \" the overall time period authorized in the referenced request.  E.g. \"\n            \"ServiceRequest.occurance[x].\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"For whom is fulfillment sought?\",\n        description=(\n            \"For requests that are targeted to more than one potential \"\n            \"recipient/target, to identify who is fulfillment is sought for.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Group\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    repetitions: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"repetitions\",\n        title=\"How many times to repeat\",\n        description=\"Indicates the number of times the requested action should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    repetitions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_repetitions\", title=\"Extension field for ``repetitions``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TaskRestriction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"repetitions\",\n            \"period\",\n            \"recipient\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TaskRestriction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/terminologycapabilities.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass TerminologyCapabilities(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A statement of system capabilities.\n    A TerminologyCapabilities resource documents a set of capabilities\n    (behaviors) of a FHIR Terminology Server that may be used as a statement of\n    actual server functionality or a statement of required or desired server\n    implementation.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilities\"\n\n    closure: fhirtypes.TerminologyCapabilitiesClosureType | None = Field(\n        default=None,\n        alias=\"closure\",\n        title=(\n            \"Information about the [ConceptMap/$closure](conceptmap-operation-\"\n            \"closure.html) operation\"\n        ),\n        description=\"Whether the $closure operation is supported.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    codeSearch: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"codeSearch\",\n        title=\"in-compose | in-expansion | in-compose-or-expansion\",\n        description=(\n            \"The degree to which the server supports the code search parameter on \"\n            \"ValueSet, if it is supported.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"in-compose\", \"in-expansion\", \"in-compose-or-expansion\"],\n        },\n    )\n    codeSearch__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_codeSearch\", title=\"Extension field for ``codeSearch``.\"\n    )\n\n    codeSystem: typing.List[\n        fhirtypes.TerminologyCapabilitiesCodeSystemType\n    ] | None = Field(\n        default=None,\n        alias=\"codeSystem\",\n        title=\"A code system supported by the server\",\n        description=(\n            \"Identifies a code system that is supported by the server. If there is \"\n            \"a no code system URL, then this declares the general assumptions a \"\n            \"client can make about support for any CodeSystem resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the terminology capabilities and/or \"\n            \"its contents. Copyright statements are generally legal restrictions on\"\n            \" the use and publishing of the terminology capabilities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date  (and optionally time) when the terminology capabilities was \"\n            \"last significantly changed. The date must change when the business \"\n            \"version changes and it must change if the status code changes. In \"\n            \"addition, it should change when the substantive content of the \"\n            \"terminology capabilities changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the terminology capabilities\",\n        description=(\n            \"A free text natural language description of the terminology \"\n            \"capabilities from a consumer's perspective. Typically, this is used \"\n            \"when the capability statement describes a desired rather than an \"\n            \"actual solution, for example as a formal expression of requirements as\"\n            \" part of an RFP.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expansion: fhirtypes.TerminologyCapabilitiesExpansionType | None = Field(\n        default=None,\n        alias=\"expansion\",\n        title=(\n            \"Information about the [ValueSet/$expand](valueset-operation-\"\n            \"expand.html) operation\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this terminology capabilities is \"\n            \"authored for testing purposes (or education/evaluation/marketing) and \"\n            \"is not intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the terminology capabilities\",\n        description=(\n            \"A formal identifier that is used to identify this terminology \"\n            \"capabilities when it is represented in other formats, or referenced in\"\n            \" a specification, model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    implementation: fhirtypes.TerminologyCapabilitiesImplementationType | None = Field(\n        default=None,\n        alias=\"implementation\",\n        title=\"If this describes a specific instance\",\n        description=(\n            \"Identifies a specific implementation instance that is described by the\"\n            \" terminology capability statement - i.e. a particular installation, \"\n            \"rather than the capabilities of a software program.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for terminology capabilities (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the terminology capabilities is \"\n            \"intended to be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    kind: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"kind\",\n        title=\"instance | capability | requirements\",\n        description=(\n            \"The way that this statement is intended to be used, to describe an \"\n            \"actual running instance of software, a particular product (kind, not \"\n            \"instance of software) or a class of implementation (e.g. a desired \"\n            \"purchase).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"instance\", \"capability\", \"requirements\"],\n        },\n    )\n    kind__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_kind\", title=\"Extension field for ``kind``.\"\n    )\n\n    lockedDate: bool | None = Field(\n        default=None,\n        alias=\"lockedDate\",\n        title=\"Whether lockedDate is supported\",\n        description=\"Whether the server supports lockedDate.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lockedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lockedDate\", title=\"Extension field for ``lockedDate``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this terminology capabilities (computer friendly)\",\n        description=(\n            \"A natural language name identifying the terminology capabilities. This\"\n            \" name should be usable as an identifier for the module by machine \"\n            \"processing applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the terminology capabilities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this terminology capabilities is defined\",\n        description=(\n            \"Explanation of why this terminology capabilities is needed and why it \"\n            \"has been designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    software: fhirtypes.TerminologyCapabilitiesSoftwareType | None = Field(\n        default=None,\n        alias=\"software\",\n        title=\"Software that is covered by this terminology capability statement\",\n        description=(\n            \"Software that is covered by this terminology capability statement.  It\"\n            \" is used when the statement describes the capabilities of a particular\"\n            \" software version, independent of an installation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this terminology capabilities. Enables tracking the \"\n            \"life-cycle of the content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this terminology capabilities (human friendly)\",\n        description=(\n            \"A short, descriptive, user-friendly title for the terminology \"\n            \"capabilities.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    translation: fhirtypes.TerminologyCapabilitiesTranslationType | None = Field(\n        default=None,\n        alias=\"translation\",\n        title=(\n            \"Information about the [ConceptMap/$translate](conceptmap-operation-\"\n            \"translate.html) operation\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this terminology capabilities, represented as\"\n            \" a URI (globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this terminology capabilities\"\n            \" when it is referenced in a specification, model, design or an \"\n            \"instance; also called its canonical identifier. This SHOULD be \"\n            \"globally unique and SHOULD be a literal address at which an \"\n            \"authoritative instance of this terminology capabilities is (or will \"\n            \"be) published. This URL can be the target of a canonical reference. It\"\n            \" SHALL remain the same when the terminology capabilities is stored on \"\n            \"different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate terminology capabilities \"\n            \"instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    validateCode: fhirtypes.TerminologyCapabilitiesValidateCodeType | None = Field(\n        default=None,\n        alias=\"validateCode\",\n        title=(\n            \"Information about the [ValueSet/$validate-code](valueset-operation-\"\n            \"validate-code.html) operation\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the terminology capabilities\",\n        description=(\n            \"The identifier that is used to identify this version of the \"\n            \"terminology capabilities when it is referenced in a specification, \"\n            \"model, design or instance. This is an arbitrary value managed by the \"\n            \"terminology capabilities author and is not expected to be globally \"\n            \"unique. For example, it might be a timestamp (e.g. yyyymmdd) if a \"\n            \"managed version is not available. There is also no expectation that \"\n            \"versions can be placed in a lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilities`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"kind\",\n            \"software\",\n            \"implementation\",\n            \"lockedDate\",\n            \"codeSystem\",\n            \"expansion\",\n            \"codeSearch\",\n            \"validateCode\",\n            \"translation\",\n            \"closure\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilities`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"copyright\",\n            \"kind\",\n            \"software\",\n            \"implementation\",\n            \"lockedDate\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"date\", \"date__ext\"),\n            (\"kind\", \"kind__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass TerminologyCapabilitiesClosure(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the [ConceptMap/$closure](conceptmap-operation-\n    closure.html) operation.\n    Whether the $closure operation is supported.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesClosure\"\n\n    translation: bool | None = Field(\n        default=None,\n        alias=\"translation\",\n        title=\"If cross-system closure is supported\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    translation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_translation\", title=\"Extension field for ``translation``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesClosure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"translation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesClosure`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TerminologyCapabilitiesCodeSystem(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A code system supported by the server.\n    Identifies a code system that is supported by the server. If there is a no\n    code system URL, then this declares the general assumptions a client can\n    make about support for any CodeSystem resource.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesCodeSystem\"\n\n    content: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"not-present | example | fragment | complete | supplement\",\n        description=(\n            \"The extent of the content of the code system (the concepts and codes \"\n            \"it defines) are represented in this resource instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"not-present\",\n                \"example\",\n                \"fragment\",\n                \"complete\",\n                \"supplement\",\n            ],\n        },\n    )\n    content__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_content\", title=\"Extension field for ``content``.\"\n    )\n\n    subsumption: bool | None = Field(\n        default=None,\n        alias=\"subsumption\",\n        title=\"Whether subsumption is supported\",\n        description=\"True if subsumption is supported for this version of the code system.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    subsumption__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_subsumption\", title=\"Extension field for ``subsumption``.\"\n    )\n\n    uri: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Canonical identifier for the code system, represented as a URI\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CodeSystem\"],\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    version: typing.List[\n        fhirtypes.TerminologyCapabilitiesCodeSystemVersionType\n    ] | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version of Code System supported\",\n        description=(\n            \"For the code system, a list of versions that are supported by the \"\n            \"server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesCodeSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"uri\",\n            \"version\",\n            \"content\",\n            \"subsumption\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesCodeSystem`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"content\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"content\", \"content__ext\")]\n        return required_fields\n\n\nclass TerminologyCapabilitiesCodeSystemVersion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Version of Code System supported.\n    For the code system, a list of versions that are supported by the server.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesCodeSystemVersion\"\n\n    code: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Version identifier for this version\",\n        description=(\n            \"For version-less code systems, there should be a single version with \"\n            \"no identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    compositional: bool | None = Field(\n        default=None,\n        alias=\"compositional\",\n        title=\"If compositional grammar is supported\",\n        description=\"If the compositional grammar defined by the code system is supported.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    compositional__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compositional\",\n        title=\"Extension field for ``compositional``.\",\n    )\n\n    filter: typing.List[\n        fhirtypes.TerminologyCapabilitiesCodeSystemVersionFilterType\n    ] | None = Field(\n        default=None,\n        alias=\"filter\",\n        title=\"Filter Properties supported\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    isDefault: bool | None = Field(\n        default=None,\n        alias=\"isDefault\",\n        title=\"If this is the default version for this code system\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    isDefault__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_isDefault\", title=\"Extension field for ``isDefault``.\"\n    )\n\n    language: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Language Displays supported\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    property: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Properties supported for $lookup\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    property__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_property\", title=\"Extension field for ``property``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesCodeSystemVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"isDefault\",\n            \"compositional\",\n            \"language\",\n            \"filter\",\n            \"property\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesCodeSystemVersion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"code\", \"isDefault\"]\n\n\nclass TerminologyCapabilitiesCodeSystemVersionFilter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Filter Properties supported.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesCodeSystemVersionFilter\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code of the property supported\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    op: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"op\",\n        title=\"Operations supported for the property\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    op__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_op\", title=\"Extension field for ``op``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesCodeSystemVersionFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"op\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesCodeSystemVersionFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\"), (\"op\", \"op__ext\")]\n        return required_fields\n\n\nclass TerminologyCapabilitiesExpansion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the [ValueSet/$expand](valueset-operation-expand.html)\n    operation.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesExpansion\"\n\n    hierarchical: bool | None = Field(\n        default=None,\n        alias=\"hierarchical\",\n        title=\"Whether the server can return nested value sets\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    hierarchical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_hierarchical\",\n        title=\"Extension field for ``hierarchical``.\",\n    )\n\n    incomplete: bool | None = Field(\n        default=None,\n        alias=\"incomplete\",\n        title=\"Allow request for incomplete expansions?\",\n        description=\"True if requests for incomplete expansions are allowed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    incomplete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_incomplete\", title=\"Extension field for ``incomplete``.\"\n    )\n\n    paging: bool | None = Field(\n        default=None,\n        alias=\"paging\",\n        title=\"Whether the server supports paging on expansion\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    paging__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_paging\", title=\"Extension field for ``paging``.\"\n    )\n\n    parameter: typing.List[\n        fhirtypes.TerminologyCapabilitiesExpansionParameterType\n    ] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Supported expansion parameter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    textFilter: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"textFilter\",\n        title=\"Documentation about text searching works\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    textFilter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_textFilter\", title=\"Extension field for ``textFilter``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesExpansion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"hierarchical\",\n            \"paging\",\n            \"incomplete\",\n            \"parameter\",\n            \"textFilter\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesExpansion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TerminologyCapabilitiesExpansionParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Supported expansion parameter.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesExpansionParameter\"\n\n    documentation: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"documentation\",\n        title=\"Description of support for parameter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    documentation__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_documentation\",\n        title=\"Extension field for ``documentation``.\",\n    )\n\n    name: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name of the supported expansion parameter\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesExpansionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"documentation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesExpansionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass TerminologyCapabilitiesImplementation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    If this describes a specific instance.\n    Identifies a specific implementation instance that is described by the\n    terminology capability statement - i.e. a particular installation, rather\n    than the capabilities of a software program.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesImplementation\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Describes this specific instance\",\n        description=(\n            \"Information about the specific installation that this terminology \"\n            \"capability statement relates to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    url: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Base URL for the implementation\",\n        description=\"An absolute base URL for the implementation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesImplementation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"description\", \"url\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesImplementation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"description\", \"url\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"description\", \"description__ext\")]\n        return required_fields\n\n\nclass TerminologyCapabilitiesSoftware(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Software that is covered by this terminology capability statement.\n    Software that is covered by this terminology capability statement.  It is\n    used when the statement describes the capabilities of a particular software\n    version, independent of an installation.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesSoftware\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"A name the software is known by\",\n        description=\"Name the software is known by.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version covered by this statement\",\n        description=\"The version identifier for the software covered by this statement.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesSoftware`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"version\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesSoftware`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"name\", \"version\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n\nclass TerminologyCapabilitiesTranslation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the [ConceptMap/$translate](conceptmap-operation-\n    translate.html) operation.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesTranslation\"\n\n    needsMap: bool | None = Field(\n        default=None,\n        alias=\"needsMap\",\n        title=\"Whether the client must identify the map\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    needsMap__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_needsMap\", title=\"Extension field for ``needsMap``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesTranslation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"needsMap\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesTranslation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"needsMap\", \"needsMap__ext\")]\n        return required_fields\n\n\nclass TerminologyCapabilitiesValidateCode(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the [ValueSet/$validate-code](valueset-operation-\n    validate-code.html) operation.\n    \"\"\"\n\n    __resource_type__ = \"TerminologyCapabilitiesValidateCode\"\n\n    translations: bool | None = Field(\n        default=None,\n        alias=\"translations\",\n        title=\"Whether translations are validated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    translations__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_translations\",\n        title=\"Extension field for ``translations``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TerminologyCapabilitiesValidateCode`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"translations\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TerminologyCapabilitiesValidateCode`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"translations\", \"translations__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/testplan.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TestPlan\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass TestPlan(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Description of intented testing.\n    A plan for executing testing on an artifact or specifications.\n    \"\"\"\n\n    __resource_type__ = \"TestPlan\"\n\n    category: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"category\",\n        title=\"The category of the Test Plan - can be acceptance, unit, performance\",\n        description=(\n            \"The category of the Test Plan - can be acceptance, unit, performance, \"\n            \"etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the test plan and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the test plan. The short copyright declaration (e.g. (c)\"\n            \" '2015+ xyz organization' should be sent in the copyrightLabel \"\n            \"element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date (and optionally time) when the test plan was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the test plan changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    dependency: typing.List[fhirtypes.TestPlanDependencyType] | None = Field(\n        default=None,\n        alias=\"dependency\",\n        title=(\n            \"The required criteria to execute the test plan - e.g. preconditions, \"\n            \"previous tests\"\n        ),\n        description=(\n            \"The required criteria to execute the test plan - e.g. preconditions, \"\n            \"previous tests...\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the test plan\",\n        description=(\n            \"A free text natural language description of the test plan from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    exitCriteria: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"exitCriteria\",\n        title=(\n            \"The threshold or criteria for the test plan to be considered \"\n            \"successfully executed - narrative\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    exitCriteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_exitCriteria\",\n        title=\"Extension field for ``exitCriteria``.\",\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this test plan is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business identifier identifier for the test plan\",\n        description=(\n            \"A formal identifier that is used to identify this test plan when it is\"\n            \" represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction where the test plan applies (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the test plan is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this test plan (computer friendly)\",\n        description=(\n            \"A natural language name identifying the test plan. This name should be\"\n            \" usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the test plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this test plan is defined\",\n        description=(\n            \"Explanation of why this test plan is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    scope: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"scope\",\n        title=(\n            \"What is being tested with this Test Plan - a conformance resource, or \"\n            \"narrative criteria, or an external reference\"\n        ),\n        description=(\n            \"What is being tested with this Test Plan - a conformance resource, or \"\n            \"narrative criteria, or an external reference...\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this test plan. Enables tracking the life-cycle of the \"\n            \"content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    testCase: typing.List[fhirtypes.TestPlanTestCaseType] | None = Field(\n        default=None,\n        alias=\"testCase\",\n        title=\"The test cases that constitute this plan\",\n        description=(\n            \"The individual test cases that are part of this plan, when they they \"\n            \"are made explicit.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    testTools: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"testTools\",\n        title=(\n            \"A description of test tools to be used in the test plan - narrative \"\n            \"for now\"\n        ),\n        description=\"A description of test tools to be used in the test plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    testTools__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_testTools\", title=\"Extension field for ``testTools``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this test plan (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the test plan.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this test plan, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this test plan when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" test plan is (or will be) published. This URL can be the target of a \"\n            \"canonical reference. It SHALL remain the same when the test plan is \"\n            \"stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate test plan instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the test plan\",\n        description=(\n            \"The identifier that is used to identify this version of the test plan \"\n            \"when it is referenced in a specification, model, design or instance.  \"\n            \"This is an arbitrary value managed by the test plan author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestPlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"category\",\n            \"scope\",\n            \"testTools\",\n            \"dependency\",\n            \"exitCriteria\",\n            \"testCase\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestPlan`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass TestPlanDependency(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The required criteria to execute the test plan - e.g. preconditions,\n    previous tests.\n    The required criteria to execute the test plan - e.g. preconditions,\n    previous tests...\n    \"\"\"\n\n    __resource_type__ = \"TestPlanDependency\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the dependency criterium\",\n        description=(\n            \"A textual description of the criterium - what is needed for the \"\n            \"dependency to be considered met.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    predecessor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"predecessor\",\n        title=\"Link to predecessor test plans\",\n        description=(\n            \"Predecessor test plans - those that are expected to be successfully \"\n            \"performed as a dependency for the execution of this test plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestPlanDependency`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"description\", \"predecessor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestPlanDependency`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestPlanTestCase(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The test cases that constitute this plan.\n    The individual test cases that are part of this plan, when they they are\n    made explicit.\n    \"\"\"\n\n    __resource_type__ = \"TestPlanTestCase\"\n\n    assertion: typing.List[fhirtypes.TestPlanTestCaseAssertionType] | None = Field(\n        default=None,\n        alias=\"assertion\",\n        title=\"Test assertions or expectations\",\n        description=(\n            \"The test assertions - the expectations of test results from the \"\n            \"execution of the test case.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    dependency: typing.List[fhirtypes.TestPlanTestCaseDependencyType] | None = Field(\n        default=None,\n        alias=\"dependency\",\n        title=\"Required criteria to execute the test case\",\n        description=(\n            \"The required criteria to execute the test case - e.g. preconditions, \"\n            \"previous tests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    scope: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"scope\",\n        title=\"The scope or artifact covered by the case\",\n        description=(\n            \"The scope or artifact covered by the case, when the individual test \"\n            \"case is associated with a testable artifact.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sequence: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"sequence\",\n        title=\"Sequence of test case in the test plan\",\n        description=(\n            \"Sequence of test case - an ordinal number that indicates the order for\"\n            \" the present test case in the test plan.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sequence__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sequence\", title=\"Extension field for ``sequence``.\"\n    )\n\n    testData: typing.List[fhirtypes.TestPlanTestCaseTestDataType] | None = Field(\n        default=None,\n        alias=\"testData\",\n        title=\"The test data used in the test case\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    testRun: typing.List[fhirtypes.TestPlanTestCaseTestRunType] | None = Field(\n        default=None,\n        alias=\"testRun\",\n        title=\"The actual test to be executed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestPlanTestCase`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"sequence\",\n            \"scope\",\n            \"dependency\",\n            \"testRun\",\n            \"testData\",\n            \"assertion\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestPlanTestCase`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestPlanTestCaseAssertion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Test assertions or expectations.\n    The test assertions - the expectations of test results from the execution\n    of the test case.\n    \"\"\"\n\n    __resource_type__ = \"TestPlanTestCaseAssertion\"\n\n    object: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"object\",\n        title=\"The focus or object of the assertion\",\n        description=\"The focus or object of the assertion i.e. a resource.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    result: typing.List[fhirtypes.CodeableReferenceType] | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"The actual result assertion\",\n        description=(\n            \"The test assertion - the expected outcome from the test case \" \"execution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"Assertion type - for example 'informative' or 'required' \",\n        description=(\n            \"The test assertion type - this can be used to group assertions as \"\n            \"'required' or 'optional', or can be used for other classification of \"\n            \"the assertion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestPlanTestCaseAssertion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"object\", \"result\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestPlanTestCaseAssertion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestPlanTestCaseDependency(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Required criteria to execute the test case.\n    The required criteria to execute the test case - e.g. preconditions,\n    previous tests.\n    \"\"\"\n\n    __resource_type__ = \"TestPlanTestCaseDependency\"\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Description of the criteria\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    predecessor: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"predecessor\",\n        title=\"Link to predecessor test plans\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestPlanTestCaseDependency`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"description\", \"predecessor\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestPlanTestCaseDependency`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestPlanTestCaseTestData(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The test data used in the test case.\n    \"\"\"\n\n    __resource_type__ = \"TestPlanTestCaseTestData\"\n\n    content: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"content\",\n        title=\"The actual test resources when they exist\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sourceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sourceReference\",\n        title=(\n            \"Pointer to a definition of test resources - narrative or structured \"\n            \"e.g. synthetic data generation, etc\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    sourceString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sourceString\",\n        title=(\n            \"Pointer to a definition of test resources - narrative or structured \"\n            \"e.g. synthetic data generation, etc\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n    sourceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sourceString\",\n        title=\"Extension field for ``sourceString``.\",\n    )\n\n    type: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"The type of test data description, e.g. 'synthea'\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestPlanTestCaseTestData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"content\",\n            \"sourceString\",\n            \"sourceReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestPlanTestCaseTestData`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"source\": [\"sourceReference\", \"sourceString\"]}\n        return one_of_many_fields\n\n\nclass TestPlanTestCaseTestRun(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The actual test to be executed.\n    \"\"\"\n\n    __resource_type__ = \"TestPlanTestCaseTestRun\"\n\n    narrative: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"narrative\",\n        title=\"The narrative description of the tests\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    narrative__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_narrative\", title=\"Extension field for ``narrative``.\"\n    )\n\n    script: fhirtypes.TestPlanTestCaseTestRunScriptType | None = Field(\n        default=None,\n        alias=\"script\",\n        title=(\n            \"The test cases in a structured language e.g. gherkin, Postman, or FHIR\"\n            \" TestScript\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestPlanTestCaseTestRun`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"narrative\", \"script\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestPlanTestCaseTestRun`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestPlanTestCaseTestRunScript(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The test cases in a structured language e.g. gherkin, Postman, or FHIR\n    TestScript.\n    \"\"\"\n\n    __resource_type__ = \"TestPlanTestCaseTestRunScript\"\n\n    language: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"The language for the test cases e.g. 'gherkin', 'testscript'\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sourceReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"sourceReference\",\n        title=(\n            \"The actual content of the cases - references to TestScripts or \"\n            \"externally defined content\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    sourceString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sourceString\",\n        title=(\n            \"The actual content of the cases - references to TestScripts or \"\n            \"externally defined content\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e source[x]\n            \"one_of_many\": \"source\",\n            \"one_of_many_required\": False,\n        },\n    )\n    sourceString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sourceString\",\n        title=\"Extension field for ``sourceString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestPlanTestCaseTestRunScript`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"language\",\n            \"sourceString\",\n            \"sourceReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestPlanTestCaseTestRunScript`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"source\": [\"sourceReference\", \"sourceString\"]}\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/testreport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TestReport\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass TestReport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes the results of a TestScript execution.\n    A summary of information based on the results of executing a TestScript.\n    \"\"\"\n\n    __resource_type__ = \"TestReport\"\n\n    identifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifier for the TestReport assigned for external purposes outside \"\n            \"the context of FHIR.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    issued: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"issued\",\n        title=\"When the TestScript was executed and this TestReport was generated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    issued__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_issued\", title=\"Extension field for ``issued``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Informal name of the executed TestReport\",\n        description=\"A free text natural language name identifying the executed TestReport.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    participant: typing.List[fhirtypes.TestReportParticipantType] | None = Field(\n        default=None,\n        alias=\"participant\",\n        title=(\n            \"A participant in the test execution, either the execution engine, a \"\n            \"client, or a server\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    result: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"pass | fail | pending\",\n        description=\"The overall result from the execution of the TestScript.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"pass\", \"fail\", \"pending\"],\n        },\n    )\n    result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_result\", title=\"Extension field for ``result``.\"\n    )\n\n    score: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"score\",\n        title=(\n            \"The final score (percentage of tests passed) resulting from the \"\n            \"execution of the TestScript\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    score__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_score\", title=\"Extension field for ``score``.\"\n    )\n\n    setup: fhirtypes.TestReportSetupType | None = Field(\n        default=None,\n        alias=\"setup\",\n        title=(\n            \"The results of the series of required setup operations before the \"\n            \"tests were executed\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"completed | in-progress | waiting | stopped | entered-in-error\",\n        description=\"The current state of this test report.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"completed\",\n                \"in-progress\",\n                \"waiting\",\n                \"stopped\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    teardown: fhirtypes.TestReportTeardownType | None = Field(\n        default=None,\n        alias=\"teardown\",\n        title=\"The results of running the series of required clean up steps\",\n        description=(\n            \"The results of the series of operations required to clean up after all\"\n            \" the tests were executed (successfully or otherwise).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    test: typing.List[fhirtypes.TestReportTestType] | None = Field(\n        default=None,\n        alias=\"test\",\n        title=\"A test executed from the test script\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    testScript: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"testScript\",\n        title=(\n            \"Canonical URL to the  version-specific TestScript that was executed to\"\n            \" produce this TestReport\"\n        ),\n        description=(\n            \"Ideally this is an absolute URL that is used to identify the version-\"\n            \"specific TestScript that was executed, matching the `TestScript.url`.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"TestScript\"],\n        },\n    )\n    testScript__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_testScript\", title=\"Extension field for ``testScript``.\"\n    )\n\n    tester: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"tester\",\n        title=\"Name of the tester producing this report (Organization or individual)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    tester__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_tester\", title=\"Extension field for ``tester``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"status\",\n            \"testScript\",\n            \"result\",\n            \"score\",\n            \"tester\",\n            \"issued\",\n            \"participant\",\n            \"setup\",\n            \"test\",\n            \"teardown\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"name\",\n            \"status\",\n            \"testScript\",\n            \"result\",\n            \"score\",\n            \"tester\",\n            \"issued\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"result\", \"result__ext\"),\n            (\"status\", \"status__ext\"),\n            (\"testScript\", \"testScript__ext\"),\n        ]\n        return required_fields\n\n\nclass TestReportParticipant(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A participant in the test execution, either the execution engine, a client,\n    or a server.\n    \"\"\"\n\n    __resource_type__ = \"TestReportParticipant\"\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"The display name of the participant\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"test-engine | client | server\",\n        description=\"The type of participant.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"test-engine\", \"client\", \"server\"],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"The uri of the participant. An absolute URL is preferred\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"type\", \"uri\", \"display\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportParticipant`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\"), (\"uri\", \"uri__ext\")]\n        return required_fields\n\n\nclass TestReportSetup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The results of the series of required setup operations before the tests\n    were executed.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetup\"\n\n    action: typing.List[fhirtypes.TestReportSetupActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"A setup operation or assert that was executed\",\n        description=\"Action would contain either an operation or an assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportSetupAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A setup operation or assert that was executed.\n    Action would contain either an operation or an assertion.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetupAction\"\n\n    assert_fhir: fhirtypes.TestReportSetupActionAssertType | None = Field(\n        default=None,\n        alias=\"assert\",\n        title=\"The assertion to perform\",\n        description=\"The results of the assertion performed on the previous operations.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.TestReportSetupActionOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"The operation to perform\",\n        description=\"The operation performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\", \"assert\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportSetupActionAssert(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The assertion to perform.\n    The results of the assertion performed on the previous operations.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetupActionAssert\"\n\n    detail: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"A link to further details on the result\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_detail\", title=\"Extension field for ``detail``.\"\n    )\n\n    message: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"message\",\n        title=\"A message associated with the result\",\n        description=\"An explanatory message associated with the result.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_message\", title=\"Extension field for ``message``.\"\n    )\n\n    requirement: typing.List[\n        fhirtypes.TestReportSetupActionAssertRequirementType\n    ] | None = Field(\n        default=None,\n        alias=\"requirement\",\n        title=\"Links or references to the testing requirements\",\n        description=(\n            \"Links or references providing traceability to the testing requirements\"\n            \" for this assert.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    result: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"pass | skip | fail | warning | error\",\n        description=\"The result of this assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"pass\", \"skip\", \"fail\", \"warning\", \"error\"],\n        },\n    )\n    result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_result\", title=\"Extension field for ``result``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetupActionAssert`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"result\",\n            \"message\",\n            \"detail\",\n            \"requirement\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetupActionAssert`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"result\", \"result__ext\")]\n        return required_fields\n\n\nclass TestReportSetupActionAssertRequirement(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links or references to the testing requirements.\n    Links or references providing traceability to the testing requirements for\n    this assert.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetupActionAssertRequirement\"\n\n    linkCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"linkCanonical\",\n        title=\"Link or reference to the testing requirement\",\n        description=(\n            \"Link or reference providing traceability to the testing requirement \"\n            \"for this test.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e link[x]\n            \"one_of_many\": \"link\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Requirements\"],\n        },\n    )\n    linkCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_linkCanonical\",\n        title=\"Extension field for ``linkCanonical``.\",\n    )\n\n    linkUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"linkUri\",\n        title=\"Link or reference to the testing requirement\",\n        description=(\n            \"Link or reference providing traceability to the testing requirement \"\n            \"for this test.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e link[x]\n            \"one_of_many\": \"link\",\n            \"one_of_many_required\": False,\n        },\n    )\n    linkUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkUri\", title=\"Extension field for ``linkUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetupActionAssertRequirement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"linkUri\", \"linkCanonical\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetupActionAssertRequirement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"link\": [\"linkCanonical\", \"linkUri\"]}\n        return one_of_many_fields\n\n\nclass TestReportSetupActionOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The operation to perform.\n    The operation performed.\n    \"\"\"\n\n    __resource_type__ = \"TestReportSetupActionOperation\"\n\n    detail: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"detail\",\n        title=\"A link to further details on the result\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    detail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_detail\", title=\"Extension field for ``detail``.\"\n    )\n\n    message: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"message\",\n        title=\"A message associated with the result\",\n        description=\"An explanatory message associated with the result.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    message__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_message\", title=\"Extension field for ``message``.\"\n    )\n\n    result: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"result\",\n        title=\"pass | skip | fail | warning | error\",\n        description=\"The result of this operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"pass\", \"skip\", \"fail\", \"warning\", \"error\"],\n        },\n    )\n    result__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_result\", title=\"Extension field for ``result``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportSetupActionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"result\", \"message\", \"detail\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportSetupActionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"result\", \"result__ext\")]\n        return required_fields\n\n\nclass TestReportTeardown(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The results of running the series of required clean up steps.\n    The results of the series of operations required to clean up after all the\n    tests were executed (successfully or otherwise).\n    \"\"\"\n\n    __resource_type__ = \"TestReportTeardown\"\n\n    action: typing.List[fhirtypes.TestReportTeardownActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"One or more teardown operations performed\",\n        description=\"The teardown action will only contain an operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportTeardown`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportTeardown`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportTeardownAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    One or more teardown operations performed.\n    The teardown action will only contain an operation.\n    \"\"\"\n\n    __resource_type__ = \"TestReportTeardownAction\"\n\n    operation: fhirtypes.TestReportSetupActionOperationType = Field(\n        default=...,\n        alias=\"operation\",\n        title=\"The teardown operation performed\",\n        description=\"An operation would involve a REST request to a server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportTeardownAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportTeardownAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportTest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A test executed from the test script.\n    \"\"\"\n\n    __resource_type__ = \"TestReportTest\"\n\n    action: typing.List[fhirtypes.TestReportTestActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"A test operation or assert that was performed\",\n        description=\"Action would contain either an operation or an assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Tracking/reporting short description of the test\",\n        description=(\n            \"A short description of the test used by test engines for tracking and \"\n            \"reporting purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Tracking/logging name of this test\",\n        description=(\n            \"The name of this test used for tracking/logging purposes by test \"\n            \"engines.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportTest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"description\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportTest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestReportTestAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A test operation or assert that was performed.\n    Action would contain either an operation or an assertion.\n    \"\"\"\n\n    __resource_type__ = \"TestReportTestAction\"\n\n    assert_fhir: fhirtypes.TestReportSetupActionAssertType | None = Field(\n        default=None,\n        alias=\"assert\",\n        title=\"The assertion performed\",\n        description=\"The results of the assertion performed on the previous operations.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.TestReportSetupActionOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"The operation performed\",\n        description=\"An operation would involve a REST request to a server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestReportTestAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\", \"assert\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestReportTestAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/tests/__init__.py",
    "content": "__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n__fhir_version__ = \"5.0.0\"\n"
  },
  {
    "path": "fhir/resources/tests/conftest.py",
    "content": "import hashlib\nimport io\nimport os\nimport pathlib\nimport shutil\nimport sys\nimport tempfile\nimport zipfile\nfrom os.path import dirname\n\nimport pytest\nfrom fhir_core.types import (\n    Base64BinaryType,\n    DateTimeType,\n    DateType,\n    InstantType,\n    TimeType,\n    UriType,\n    UrlType,\n)\nfrom pydantic import BaseModel, Field\n\nEXAMPLE_RESOURCES_URL = (\n    \"https://github.com/nazrulworld/hl7-archives/raw/\"\n    \"0.4.0/FHIR/R5/\"\n    \"5.0.0-examples-json.zip\"\n)\nROOT_PATH = dirname(dirname(dirname(dirname(os.path.abspath(__file__)))))\nCACHE_PATH = os.path.join(ROOT_PATH, \".cache\")\n\n\ndef download_and_store(url, path):\n    \"\"\" \"\"\"\n    import requests\n\n    try:\n        sys.stdout.write(\"Attempting to download from {0}\\n\".format(url))\n        ret = requests.get(url)\n    except requests.HTTPError as exc:  # pragma: no cover\n        raise LookupError(\"Failed to download. Full error: {0!s}\".format(exc))\n    else:\n        if not ret.ok:  # pragma: no cover\n            raise Exception(\"Failed to download {0}\".format(url))\n        with io.open(path, \"wb\") as handle:\n            for chunk in ret.iter_content():\n                handle.write(chunk)\n            sys.stdout.write(\n                \"Download has been completed, now saved to {0}\\n\".format(path)\n            )\n\n\ndef expand(self, local):  # pragma: no cover\n    \"\"\"Expand the ZIP file at the given path to the cache directory.\"\"\"\n    path = os.path.join(self.cache, local)\n    assert os.path.exists(path)\n    import zipfile  # import here as we can bypass its use with a manual unzip\n\n    with zipfile.ZipFile(path) as z:\n        z.extractall(self.cache)\n\n\n@pytest.fixture(scope=\"session\")\ndef base_settings():\n    if not os.path.exists(CACHE_PATH):  # pragma: no cover\n        os.makedirs(CACHE_PATH)\n\n    settings = {}\n\n    example_data_file_uri = EXAMPLE_RESOURCES_URL\n\n    example_data_file_id = hashlib.md5(example_data_file_uri.encode()).hexdigest()\n\n    example_data_file_location = os.path.join(\n        CACHE_PATH, (example_data_file_id + \".zip\")\n    )\n\n    if not os.path.exists(example_data_file_location):\n        download_and_store(example_data_file_uri, example_data_file_location)\n\n    temp_data_dir = tempfile.mkdtemp()\n    # extract all files from archive and put into temp dir\n    with zipfile.ZipFile(example_data_file_location) as z:\n        z.extractall(temp_data_dir)\n\n    zip_dir_name = pathlib.Path(EXAMPLE_RESOURCES_URL).name[:-4]\n    if \"FHIR_UNITTEST_DATADIR\" not in os.environ:\n        os.environ.setdefault(\n            \"FHIR_UNITTEST_DATADIR\", os.path.join(temp_data_dir, zip_dir_name)\n        )\n\n    settings[\"unittest_data_dir\"] = pathlib.Path(os.environ[\"FHIR_UNITTEST_DATADIR\"])\n\n    yield settings\n\n    os.environ.pop(\"FHIR_UNITTEST_DATADIR\")\n    shutil.rmtree(temp_data_dir)\n\n\nclass ExternalValidatorModel(BaseModel):\n    \"\"\"This model is used to validate datetime objects against in the tests\"\"\"\n\n    valueDate: DateType = Field(None, title=\"Date\")\n    valueTime: TimeType = Field(None, title=\"Time\")\n    valueDateTime: DateTimeType = Field(None, title=\"DateTime\")\n    valueInstant: InstantType = Field(None, title=\"Instant\")\n    valueUri: UriType = Field(None, title=\"Uri\")\n    valueUrl: UrlType = Field(None, title=\"Url\")\n    valueBase64Binary: Base64BinaryType = Field(None, title=\"Base64Binary\")\n"
  },
  {
    "path": "fhir/resources/tests/test_account.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Account\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import account\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_account_1(inst):\n    assert inst.coverage[0].coverage.reference == \"Coverage/7546D\"\n    assert inst.coverage[0].priority == 1\n    assert inst.description == \"Hospital charges\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:0.1.2.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"654321\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"HACC Funded Billing for Peter James Chalmers\"\n    assert inst.owner.reference == \"Organization/hl7\"\n    assert inst.relatedAccount[0].account.reference == \"Account/ewg\"\n    assert inst.relatedAccount[0].relationship.coding[0].code == \"guarantor\"\n    assert (\n        inst.relatedAccount[0].relationship.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/account-relationship\"}\n        ).valueUri\n    )\n    assert (\n        inst.servicePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-30\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.servicePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"active\"\n    assert inst.subject[0].display == \"Peter James Chalmers\"\n    assert inst.subject[0].reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">HACC Funded '\n        \"Billing for Peter James Chalmers</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"PBILLACCT\"\n    assert inst.type.coding[0].display == \"patient billing account\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"patient\"\n\n\ndef test_account_1(base_settings):\n    \"\"\"No. 1 tests collection for Account.\n    Test File: account-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"account-example.json\"\n    inst = account.Account.model_validate_json(filename.read_bytes())\n    assert \"Account\" == inst.get_resource_type()\n\n    impl_account_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Account\" == data[\"resourceType\"]\n\n    inst2 = account.Account(**data)\n    impl_account_1(inst2)\n\n\ndef impl_account_2(inst):\n    assert inst.coverage[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.coverage[0].priority == 1\n    assert inst.coverage[1].coverage.reference == \"Coverage/7546D\"\n    assert inst.coverage[1].priority == 2\n    assert inst.description == \"Hospital charges\"\n    assert inst.guarantor[0].onHold is False\n    assert inst.guarantor[0].party.display == \"Bénédicte du Marché\"\n    assert inst.guarantor[0].party.reference == \"RelatedPerson/benedicte\"\n    assert (\n        inst.guarantor[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"ewg\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:0.1.2.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"654321\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Inpatient: Peter James Chalmers\"\n    assert inst.owner.display == \"Burgers University Medical Center\"\n    assert inst.owner.reference == \"Organization/f001\"\n    assert (\n        inst.servicePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-30\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.servicePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"active\"\n    assert inst.subject[0].display == \"Peter James Chalmers\"\n    assert inst.subject[0].reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Inpatient '\n        \"Admission for Peter James Chalmers Account</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"PBILLACCT\"\n    assert inst.type.coding[0].display == \"patient billing account\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"patient\"\n\n\ndef test_account_2(base_settings):\n    \"\"\"No. 2 tests collection for Account.\n    Test File: account-example-with-guarantor.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"account-example-with-guarantor.json\"\n    )\n    inst = account.Account.model_validate_json(filename.read_bytes())\n    assert \"Account\" == inst.get_resource_type()\n\n    impl_account_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Account\" == data[\"resourceType\"]\n\n    inst2 = account.Account(**data)\n    impl_account_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_activitydefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ActivityDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import activitydefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_activitydefinition_1(inst):\n    assert inst.code.coding[0].code == \"zika-virus-exposure-assessment\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/questionnaires\"}\n        ).valueUri\n    )\n    assert inst.description == \"Administer Zika Virus Exposure Assessment\"\n    assert inst.id == \"administer-zika-virus-exposure-assessment\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.19.4\"\n    assert inst.kind == \"ServiceRequest\"\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/zika-virus-intervention-\" \"logic\"\n    )\n    assert inst.participant[0].type == \"practitioner\"\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://www.cdc.gov/zika/hc-providers/pregnant-woman.html\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.relatedArtifact[1].resource == (\n        \"http://hl7.org/fhir/Questionnaire/zika-virus-exposure-\" \"assessment\"\n    )\n    assert inst.relatedArtifact[1].type == \"depends-on\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/ActivityDefinition/administer-zika-virus-exposure-assessment\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"age\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueRange.low.unit == \"a\"\n    assert float(inst.useContext[0].valueRange.low.value) == float(12)\n\n\ndef test_activitydefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ActivityDefinition.\n    Test File: activitydefinition-administer-zika-virus-exposure-assessment.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-administer-zika-virus-exposure-assessment.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_1(inst2)\n\n\ndef impl_activitydefinition_2(inst):\n    assert inst.code.text == \"Provide Mosquito Prevention Advice\"\n    assert inst.description == \"Provide mosquito prevention advice\"\n    assert inst.id == \"provide-mosquito-prevention-advice\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.19.1\"\n    assert inst.kind == \"CommunicationRequest\"\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/zika-virus-intervention-\" \"logic\"\n    )\n    assert inst.participant[0].type == \"practitioner\"\n    assert (\n        inst.relatedArtifact[0].display\n        == \"Advice for patients about how to avoid Mosquito bites.\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.cdc.gov/zika/prevention/index.html\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert inst.relatedArtifact[1].display == (\n        \"Advice for patients about which mosquito repellents are \"\n        \"effective and safe to use in pregnancy. [DEET, IF3535 and \"\n        \"Picardin are safe during]\"\n    )\n    assert (\n        inst.relatedArtifact[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.epa.gov/insect-repellents/find-insect-repellent-right-you\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].type == \"documentation\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/ActivityDefinition/provide-mosquito-prevention-advice\"\n            }\n        ).valueUri\n    )\n\n\ndef test_activitydefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for ActivityDefinition.\n    Test File: activitydefinition-provide-mosquito-prevention-advice.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-provide-mosquito-prevention-advice.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_2(inst2)\n\n\ndef impl_activitydefinition_3(inst):\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-03-12\"}).valueDate\n    )\n    assert inst.author[0].name == \"Motive Medical Intelligence\"\n    assert inst.author[0].telecom[0].system == \"phone\"\n    assert inst.author[0].telecom[0].use == \"work\"\n    assert inst.author[0].telecom[0].value == \"415-362-4007\"\n    assert inst.author[0].telecom[1].system == \"email\"\n    assert inst.author[0].telecom[1].use == \"work\"\n    assert inst.author[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.code.coding[0].code == \"306206005\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Referral to service (procedure)\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"415-362-4007\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.copyright == (\n        \"© Copyright 2016 Motive Medical Intelligence. All rights \" \"reserved.\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-03T14:06:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"refer to primary care mental-health integrated care program \"\n        \"for evaluation and treatment of mental health conditions now\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"referralPrimaryCareMentalHealth-initial\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.19.5\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://motivemi.com/artifacts\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"referralPrimaryCareMentalHealth\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.kind == \"ServiceRequest\"\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-08-15\"}).valueDate\n    )\n    assert inst.name == \"ReferralPrimaryCareMentalHealth\"\n    assert inst.participant[0].type == \"practitioner\"\n    assert inst.publisher == \"Motive Medical Intelligence\"\n    assert inst.relatedArtifact[0].display == (\n        \"Practice Guideline for the Treatment of Patients with Major \"\n        \"Depressive Disorder\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert inst.relatedArtifact[1].resource == (\n        \"http://example.org/fhir/ActivityDefinition/referralPrimaryCa\" \"reMentalHealth\"\n    )\n    assert inst.relatedArtifact[1].type == \"successor\"\n    assert inst.status == \"retired\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Referral to Primary Care Mental Health\"\n    assert inst.topic[0].text == \"Mental Health Referral\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://motivemi.com/artifacts/ActivityDefinition/referralPrimaryCareMentalHealth\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"age\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"D000328\"\n    assert inst.useContext[0].valueCodeableConcept.coding[0].display == \"Adult\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://meshb.nlm.nih.gov\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"87512008\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Mild major depression\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].code.code == \"focus\"\n    assert (\n        inst.useContext[2].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].valueCodeableConcept.coding[0].code == \"40379007\"\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].display\n        == \"Major depression, recurrent, mild\"\n    )\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].code.code == \"focus\"\n    assert (\n        inst.useContext[3].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].valueCodeableConcept.coding[0].code == \"225444004\"\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].display\n        == \"At risk for suicide (finding)\"\n    )\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].code.code == \"focus\"\n    assert (\n        inst.useContext[4].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].valueCodeableConcept.coding[0].code == \"306206005\"\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].display\n        == \"Referral to service (procedure)\"\n    )\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].code.code == \"user\"\n    assert (\n        inst.useContext[5].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].valueCodeableConcept.coding[0].code == \"309343006\"\n    assert inst.useContext[5].valueCodeableConcept.coding[0].display == \"Physician\"\n    assert (\n        inst.useContext[5].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].code.code == \"venue\"\n    assert (\n        inst.useContext[6].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].valueCodeableConcept.coding[0].code == \"440655000\"\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].display\n        == \"Outpatient environment\"\n    )\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"1.0.0\"\n\n\ndef test_activitydefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for ActivityDefinition.\n    Test File: activitydefinition-predecessor-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-predecessor-example.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_3(inst2)\n\n\ndef impl_activitydefinition_4(inst):\n    assert inst.code.text == \"Serum Zika and Dengue Virus IgM\"\n    assert inst.description == \"Order Serum Zika and Dengue Virus IgM\"\n    assert inst.id == \"serum-zika-dengue-virus-igm\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.19.2\"\n    assert inst.kind == \"ServiceRequest\"\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/zika-virus-intervention-\" \"logic\"\n    )\n    assert inst.participant[0].type == \"practitioner\"\n    assert inst.relatedArtifact[0].display == (\n        \"Explanation of diagnostic tests for Zika virus and which to \"\n        \"use based on the patient’s clinical and exposure history.\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.cdc.gov/zika/hc-providers/diagnostic.html\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert inst.relatedArtifact[1].resource == (\n        \"http://example.org/fhir/ActivityDefinition/serum-dengue-\" \"virus-igm\"\n    )\n    assert inst.relatedArtifact[1].type == \"derived-from\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/ActivityDefinition/serum-zika-dengue-virus-igm\"\n            }\n        ).valueUri\n    )\n\n\ndef test_activitydefinition_4(base_settings):\n    \"\"\"No. 4 tests collection for ActivityDefinition.\n    Test File: activitydefinition-order-serum-zika-dengue-virus-igm.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-order-serum-zika-dengue-virus-igm.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_4(inst2)\n\n\ndef impl_activitydefinition_5(inst):\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-03-12\"}).valueDate\n    )\n    assert inst.author[0].name == \"Motive Medical Intelligence\"\n    assert inst.author[0].telecom[0].system == \"phone\"\n    assert inst.author[0].telecom[0].use == \"work\"\n    assert inst.author[0].telecom[0].value == \"415-362-4007\"\n    assert inst.author[0].telecom[1].system == \"email\"\n    assert inst.author[0].telecom[1].use == \"work\"\n    assert inst.author[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"415-362-4007\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.contained[0].id == \"citalopramMedication\"\n    assert inst.contained[1].id == \"citalopramSubstance\"\n    assert inst.copyright == (\n        \"© Copyright 2016 Motive Medical Intelligence. All rights \" \"reserved.\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-15\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Citalopram 20 mg tablet 1 tablet oral 1 time daily now (30 \" \"table; 3 refills\"\n    )\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == \"{tbl}\"\n    assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(1)\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosage[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].route.coding[0].code == \"26643006\"\n    assert inst.dosage[0].route.coding[0].display == \"Oral route (qualifier value)\"\n    assert inst.dosage[0].route.text == \"Oral route (qualifier value)\"\n    assert inst.dosage[0].text == \"1 tablet oral 1 time daily\"\n    assert inst.dosage[0].timing.repeat.frequency == 1\n    assert float(inst.dosage[0].timing.repeat.period) == float(1)\n    assert inst.dosage[0].timing.repeat.periodUnit == \"d\"\n    assert (\n        inst.dynamicValue[0].expression.description\n        == \"dispenseRequest.numberOfRepeatsAllowed is three (3)\"\n    )\n    assert inst.dynamicValue[0].expression.expression == \"3\"\n    assert inst.dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.dynamicValue[0].path == \"dispenseRequest.numberOfRepeatsAllowed\"\n    assert (\n        inst.dynamicValue[1].expression.description\n        == \"dispenseRequest.quantity is thirty (30) tablets\"\n    )\n    assert inst.dynamicValue[1].expression.expression == \"30 '{tbl}'\"\n    assert inst.dynamicValue[1].expression.language == \"text/cql\"\n    assert inst.dynamicValue[1].path == \"dispenseRequest.quantity\"\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"citalopramPrescription\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.19.6\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://motivemi.com\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"citalopramPrescription\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.kind == \"MedicationRequest\"\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-08-15\"}).valueDate\n    )\n    assert inst.name == \"CitalopramPrescription\"\n    assert inst.productReference.reference == \"#citalopramMedication\"\n    assert inst.publisher == \"Motive Medical Intelligence\"\n    assert inst.purpose == (\n        \"Defines a guideline supported prescription for the treatment\"\n        \" of depressive disorders\"\n    )\n    assert inst.relatedArtifact[0].display == (\n        \"Practice Guideline for the Treatment of Patients with Major \"\n        \"Depressive Disorder\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert inst.relatedArtifact[1].resource == \"#citalopramMedication\"\n    assert inst.relatedArtifact[1].type == \"composed-of\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Citalopram Prescription\"\n    assert inst.topic[0].text == \"Mental Health Treatment\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://motivemi.com/artifacts/ActivityDefinition/citalopramPrescription\"\n            }\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This activity definition is used as part of various suicide \" \"risk order sets\"\n    )\n    assert inst.useContext[0].code.code == \"age\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"D000328\"\n    assert inst.useContext[0].valueCodeableConcept.coding[0].display == \"Adult\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://meshb.nlm.nih.gov\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"87512008\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Mild major depression\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].code.code == \"focus\"\n    assert (\n        inst.useContext[2].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].valueCodeableConcept.coding[0].code == \"40379007\"\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].display\n        == \"Major depression, recurrent, mild\"\n    )\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].code.code == \"focus\"\n    assert (\n        inst.useContext[3].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].valueCodeableConcept.coding[0].code == \"225444004\"\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].display\n        == \"At risk for suicide (finding)\"\n    )\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].code.code == \"focus\"\n    assert (\n        inst.useContext[4].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].valueCodeableConcept.coding[0].code == \"306206005\"\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].display\n        == \"Referral to service (procedure)\"\n    )\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].code.code == \"user\"\n    assert (\n        inst.useContext[5].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].valueCodeableConcept.coding[0].code == \"309343006\"\n    assert inst.useContext[5].valueCodeableConcept.coding[0].display == \"Physician\"\n    assert (\n        inst.useContext[5].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].code.code == \"venue\"\n    assert (\n        inst.useContext[6].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].valueCodeableConcept.coding[0].code == \"440655000\"\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].display\n        == \"Outpatient environment\"\n    )\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"1.0.0\"\n\n\ndef test_activitydefinition_5(base_settings):\n    \"\"\"No. 5 tests collection for ActivityDefinition.\n    Test File: activitydefinition-medicationorder-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-medicationorder-example.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_5(inst2)\n\n\ndef impl_activitydefinition_6(inst):\n    assert inst.code.coding[0].code == \"1155608\"\n    assert inst.code.coding[0].display == \"alteplase injectable product\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.description == \"Alteplase Dosing for Stroke\"\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.code == \"mg/kg\"\n    assert (\n        inst.dosage[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(0.9)\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].code == \"calculated\"\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].display == \"Calculated\"\n    assert (\n        inst.dosage[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].maxDosePerAdministration.code == \"mg\"\n    assert (\n        inst.dosage[0].maxDosePerAdministration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[0].maxDosePerAdministration.value) == float(90)\n    assert inst.dosage[0].route.coding[0].code == \"47625008\"\n    assert inst.dosage[0].route.coding[0].display == \"Intravenous use\"\n    assert (\n        inst.dosage[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].sequence == 1\n    assert inst.dosage[0].text == \"give 10% of dose over 1 minute\"\n    assert inst.dosage[1].doseAndRate[0].doseQuantity.code == \"mg/kg\"\n    assert (\n        inst.dosage[1].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[1].doseAndRate[0].doseQuantity.value) == float(0.9)\n    assert inst.dosage[1].doseAndRate[0].type.coding[0].code == \"calculated\"\n    assert inst.dosage[1].doseAndRate[0].type.coding[0].display == \"Calculated\"\n    assert (\n        inst.dosage[1].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosage[1].maxDosePerAdministration.code == \"mg\"\n    assert (\n        inst.dosage[1].maxDosePerAdministration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[1].maxDosePerAdministration.value) == float(90)\n    assert inst.dosage[1].route.coding[0].code == \"47625008\"\n    assert inst.dosage[1].route.coding[0].display == \"Intravenous use\"\n    assert (\n        inst.dosage[1].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[1].sequence == 2\n    assert inst.dosage[1].text == \"give remaining 90% of dose over 1 hour\"\n    assert inst.id == \"example-alteplase-dosing\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.19.3\"\n    assert inst.intent == \"order\"\n    assert inst.kind == \"MedicationRequest\"\n    assert inst.name == \"AlteplaseDosingForStroke\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Alteplase Dosing for Stroke\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/ActivityDefinition/example-alteplase-dosing\"\n            }\n        ).valueUri\n    )\n\n\ndef test_activitydefinition_6(base_settings):\n    \"\"\"No. 6 tests collection for ActivityDefinition.\n    Test File: activitydefinition-example-alteplase-dosing.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-example-alteplase-dosing.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_6(inst2)\n\n\ndef impl_activitydefinition_7(inst):\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2017-03-01\"}).valueDate\n    )\n    assert inst.author[0].name == \"Motive Medical Intelligence\"\n    assert inst.author[0].telecom[0].system == \"phone\"\n    assert inst.author[0].telecom[0].use == \"work\"\n    assert inst.author[0].telecom[0].value == \"415-362-4007\"\n    assert inst.author[0].telecom[1].system == \"email\"\n    assert inst.author[0].telecom[1].use == \"work\"\n    assert inst.author[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.code.coding[0].code == \"306206005\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Referral to service (procedure)\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"415-362-4007\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.copyright == (\n        \"© Copyright 2016 Motive Medical Intelligence. All rights \" \"reserved.\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-03T14:06:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"refer to primary care mental-health integrated care program \"\n        \"for evaluation and treatment of mental health conditions now\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-01\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"referralPrimaryCareMentalHealthEx\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.19.8\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://motivemi.com/artifacts\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"referralPrimaryCareMentalHealth\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.kind == \"ServiceRequest\"\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2017-03-01\"}).valueDate\n    )\n    assert inst.name == \"ReferralPrimaryCareMentalHealth\"\n    assert inst.participant[0].type == \"practitioner\"\n    assert inst.publisher == \"Motive Medical Intelligence\"\n    assert inst.relatedArtifact[0].display == (\n        \"Practice Guideline for the Treatment of Patients with Major \"\n        \"Depressive Disorder\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert inst.relatedArtifact[1].resource == (\n        \"http://example.org/fhir/ActivityDefinition/referralPrimaryCa\"\n        \"reMentalHealth-initial\"\n    )\n    assert inst.relatedArtifact[1].type == \"predecessor\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Referral to Primary Care Mental Health\"\n    assert inst.topic[0].text == \"Mental Health Referral\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://motivemi.com/artifacts/ActivityDefinition/referralPrimaryCareMentalHealthEx\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"age\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"D000328\"\n    assert inst.useContext[0].valueCodeableConcept.coding[0].display == \"Adult\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://meshb.nlm.nih.gov\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"87512008\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Mild major depression\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].code.code == \"focus\"\n    assert (\n        inst.useContext[2].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].valueCodeableConcept.coding[0].code == \"40379007\"\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].display\n        == \"Major depression, recurrent, mild\"\n    )\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].code.code == \"focus\"\n    assert (\n        inst.useContext[3].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].valueCodeableConcept.coding[0].code == \"225444004\"\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].display\n        == \"At risk for suicide (finding)\"\n    )\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].code.code == \"focus\"\n    assert (\n        inst.useContext[4].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].valueCodeableConcept.coding[0].code == \"306206005\"\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].display\n        == \"Referral to service (procedure)\"\n    )\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].code.code == \"user\"\n    assert (\n        inst.useContext[5].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].valueCodeableConcept.coding[0].code == \"309343006\"\n    assert inst.useContext[5].valueCodeableConcept.coding[0].display == \"Physician\"\n    assert (\n        inst.useContext[5].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].code.code == \"venue\"\n    assert (\n        inst.useContext[6].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].valueCodeableConcept.coding[0].code == \"440655000\"\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].display\n        == \"Outpatient environment\"\n    )\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"1.1.0\"\n\n\ndef test_activitydefinition_7(base_settings):\n    \"\"\"No. 7 tests collection for ActivityDefinition.\n    Test File: activitydefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"activitydefinition-example.json\"\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_7(inst2)\n\n\ndef impl_activitydefinition_8(inst):\n    assert inst.code.text == \"Serum Dengue Virus IgM\"\n    assert inst.description == \"Order Serum Dengue Virus IgM\"\n    assert inst.id == \"serum-dengue-virus-igm\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.19.7\"\n    assert inst.kind == \"ServiceRequest\"\n    assert inst.participant[0].type == \"practitioner\"\n    assert inst.relatedArtifact[0].display == (\n        \"Explanation of diagnostic tests for Dengue virus and which \"\n        \"to use based on the patient’s clinical and exposure history.\"\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/ActivityDefinition/serum-dengue-virus-igm\"}\n        ).valueUri\n    )\n\n\ndef test_activitydefinition_8(base_settings):\n    \"\"\"No. 8 tests collection for ActivityDefinition.\n    Test File: activitydefinition-order-serum-dengue-virus-igm.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-order-serum-dengue-virus-igm.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_8(inst2)\n\n\ndef impl_activitydefinition_9(inst):\n    assert inst.bodySite[0].coding[0].code == \"17401000\"\n    assert inst.bodySite[0].coding[0].display == \"Heart valve structure\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"34068001\"\n    assert inst.code.coding[0].display == \"Heart valve replacement\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.description == \"Heart valve replacement\"\n    assert inst.id == \"heart-valve-replacement\"\n    assert inst.kind == \"ServiceRequest\"\n    assert inst.location.reference.reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].role.coding[0].code == \"207RI0011X\"\n    assert inst.participant[0].role.coding[0].display == \"Interventional Cardiology\"\n    assert (\n        inst.participant[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nucc.org/provider-taxonomy\"}\n        ).valueUri\n    )\n    assert inst.participant[0].role.text == \"Interventional Cardiology\"\n    assert inst.participant[0].type == \"practitioner\"\n    assert (\n        inst.purpose == \"Describes the proposal to perform a Heart Valve replacement.\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.topic[0].coding[0].code == \"34068001\"\n    assert inst.topic[0].coding[0].display == \"Heart valve replacement\"\n    assert (\n        inst.topic[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"age\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"D000328\"\n    assert inst.useContext[0].valueCodeableConcept.coding[0].display == \"Adult\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://meshb.nlm.nih.gov\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"user\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"309343006\"\n    assert inst.useContext[1].valueCodeableConcept.coding[0].display == \"Physician\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_activitydefinition_9(base_settings):\n    \"\"\"No. 9 tests collection for ActivityDefinition.\n    Test File: activitydefinition-servicerequest-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-servicerequest-example.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_9(inst2)\n\n\ndef impl_activitydefinition_10(inst):\n    assert inst.code.coding[0].code == \"BlueTubes\"\n    assert inst.code.coding[0].display == \"Blood collect tubes blue cap\"\n    assert inst.description == \"10 Blood collect tubes blue cap\"\n    assert inst.id == \"blood-tubes-supply\"\n    assert inst.kind == \"SupplyRequest\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.purpose == (\n        \"Describes a request for 10 Blood collection tubes with blue \" \"caps.\"\n    )\n    assert float(inst.quantity.value) == float(10)\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.transform == \"http://example.org/fhir/StructureMap/supplyrequest-transform\"\n    )\n\n\ndef test_activitydefinition_10(base_settings):\n    \"\"\"No. 10 tests collection for ActivityDefinition.\n    Test File: activitydefinition-supplyrequest-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"activitydefinition-supplyrequest-example.json\"\n    )\n    inst = activitydefinition.ActivityDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ActivityDefinition\" == inst.get_resource_type()\n\n    impl_activitydefinition_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActivityDefinition\" == data[\"resourceType\"]\n\n    inst2 = activitydefinition.ActivityDefinition(**data)\n    impl_activitydefinition_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_actordefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ActorDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import actordefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_actordefinition_1(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-11-02T14:31:30.239Z\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Server Actor\"\n    assert inst.id == \"server\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.27.1\"\n    assert inst.name == \"ServerActor\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Server Actor\"\n    assert inst.type == \"system\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ActorDefinition/server\"}\n        ).valueUri\n    )\n\n\ndef test_actordefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ActorDefinition.\n    Test File: actordefinition-server.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"actordefinition-server.json\"\n    inst = actordefinition.ActorDefinition.model_validate_json(filename.read_bytes())\n    assert \"ActorDefinition\" == inst.get_resource_type()\n\n    impl_actordefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActorDefinition\" == data[\"resourceType\"]\n\n    inst2 = actordefinition.ActorDefinition(**data)\n    impl_actordefinition_1(inst2)\n\n\ndef impl_actordefinition_2(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-11-02T14:31:30.239Z\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Client Actor\"\n    assert inst.id == \"client\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.27.2\"\n    assert inst.name == \"ClientActor\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Client Actor\"\n    assert inst.type == \"system\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ActorDefinition/client\"}\n        ).valueUri\n    )\n\n\ndef test_actordefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for ActorDefinition.\n    Test File: actordefinition-client.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"actordefinition-client.json\"\n    inst = actordefinition.ActorDefinition.model_validate_json(filename.read_bytes())\n    assert \"ActorDefinition\" == inst.get_resource_type()\n\n    impl_actordefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ActorDefinition\" == data[\"resourceType\"]\n\n    inst2 = actordefinition.ActorDefinition(**data)\n    impl_actordefinition_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_administrableproductdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AdministrableProductDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import administrableproductdefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_administrableproductdefinition_1(inst):\n    assert inst.administrableDoseForm.coding[0].code == \"Film-coatedtablet\"\n    assert (\n        inst.administrableDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/administrabledoseform\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/phpididentifiersets\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"{PhPID}\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.routeOfAdministration[0].code.coding[0].code == \"OralUse\"\n    assert (\n        inst.routeOfAdministration[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/routeofadministration\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.unitOfPresentation.coding[0].code == \"Tablet\"\n    assert (\n        inst.unitOfPresentation.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/unitofpresentation\"}\n        ).valueUri\n    )\n\n\ndef test_administrableproductdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for AdministrableProductDefinition.\n    Test File: administrableproductdefinition-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"administrableproductdefinition-example.json\"\n    )\n    inst = administrableproductdefinition.AdministrableProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AdministrableProductDefinition\" == inst.get_resource_type()\n\n    impl_administrableproductdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AdministrableProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = administrableproductdefinition.AdministrableProductDefinition(**data)\n    impl_administrableproductdefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_allergyintolerance.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AllergyIntolerance\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import allergyintolerance\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_allergyintolerance_1(inst):\n    assert inst.code.coding[0].code == \"716184000\"\n    assert inst.code.coding[0].display == \"No Known Latex Allergy (situation)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"No Known Latex Allergy\"\n    assert inst.id == \"nkla\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/example\"\n    assert inst.participant[0].function.coding[0].code == \"author\"\n    assert inst.participant[0].function.coding[0].display == \"Author\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-06T15:37:31-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_allergyintolerance_1(base_settings):\n    \"\"\"No. 1 tests collection for AllergyIntolerance.\n    Test File: allergyintolerance-nkla.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"allergyintolerance-nkla.json\"\n    inst = allergyintolerance.AllergyIntolerance.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AllergyIntolerance\" == inst.get_resource_type()\n\n    impl_allergyintolerance_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AllergyIntolerance\" == data[\"resourceType\"]\n\n    inst2 = allergyintolerance.AllergyIntolerance(**data)\n    impl_allergyintolerance_1(inst2)\n\n\ndef impl_allergyintolerance_2(inst):\n    assert inst.category[0] == \"food\"\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert inst.clinicalStatus.coding[0].display == \"Active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\"\n            }\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"227493005\"\n    assert inst.code.coding[0].display == \"Cashew nuts\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.criticality == \"high\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ids/patients/risks\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"49476534\"\n    assert (\n        inst.lastOccurrence\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-06\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"The criticality is high becasue of the observed anaphylactic\"\n        \" reaction when challenged with cashew extract.\"\n    )\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2004\"}\n        ).valueDateTime\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/example\"\n    assert inst.participant[0].function.coding[0].code == \"author\"\n    assert inst.participant[0].function.coding[0].display == \"Author\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert inst.participant[1].actor.reference == \"Patient/example\"\n    assert inst.participant[1].function.coding[0].code == \"informant\"\n    assert inst.participant[1].function.coding[0].display == \"Informant\"\n    assert (\n        inst.participant[1].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.reaction[0].description == (\n        \"Challenge Protocol. Severe reaction to subcutaneous cashew \"\n        \"extract. Epinephrine administered\"\n    )\n    assert inst.reaction[0].exposureRoute.coding[0].code == \"34206005\"\n    assert inst.reaction[0].exposureRoute.coding[0].display == \"Subcutaneous route\"\n    assert (\n        inst.reaction[0].exposureRoute.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reaction[0].manifestation[0].concept.coding[0].code == \"39579001\"\n    assert (\n        inst.reaction[0].manifestation[0].concept.coding[0].display\n        == \"Anaphylactic reaction\"\n    )\n    assert (\n        inst.reaction[0].manifestation[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.reaction[0].onset\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-06-12\"}\n        ).valueDateTime\n    )\n    assert inst.reaction[0].severity == \"severe\"\n    assert inst.reaction[0].substance.coding[0].code == \"1160593\"\n    assert (\n        inst.reaction[0].substance.coding[0].display\n        == \"cashew nut allergenic extract Injectable Product\"\n    )\n    assert (\n        inst.reaction[0].substance.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.reaction[1].manifestation[0].concept.coding[0].code == \"64305001\"\n    assert inst.reaction[1].manifestation[0].concept.coding[0].display == \"Urticaria\"\n    assert (\n        inst.reaction[1].manifestation[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reaction[1].note[0].text == (\n        \"The patient reports that the onset of urticaria was within \"\n        \"15 minutes of eating cashews.\"\n    )\n    assert (\n        inst.reaction[1].onset\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2004\"}\n        ).valueDateTime\n    )\n    assert inst.reaction[1].severity == \"moderate\"\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-10-09T14:58:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"allergy\"\n    assert inst.type.coding[0].display == \"Allergy\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/allergy-intolerance-type\"}\n        ).valueUri\n    )\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert inst.verificationStatus.coding[0].display == \"Confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-verification\"\n            }\n        ).valueUri\n    )\n\n\ndef test_allergyintolerance_2(base_settings):\n    \"\"\"No. 2 tests collection for AllergyIntolerance.\n    Test File: allergyintolerance-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"allergyintolerance-example.json\"\n    inst = allergyintolerance.AllergyIntolerance.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AllergyIntolerance\" == inst.get_resource_type()\n\n    impl_allergyintolerance_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AllergyIntolerance\" == data[\"resourceType\"]\n\n    inst2 = allergyintolerance.AllergyIntolerance(**data)\n    impl_allergyintolerance_2(inst2)\n\n\ndef impl_allergyintolerance_3(inst):\n    assert inst.code.coding[0].code == \"716186003\"\n    assert inst.code.coding[0].display == \"No Known Allergy (situation)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"NKA\"\n    assert inst.id == \"nka\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/example\"\n    assert inst.participant[0].function.coding[0].code == \"author\"\n    assert inst.participant[0].function.coding[0].display == \"Author\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/mom\"\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-06T15:37:31-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_allergyintolerance_3(base_settings):\n    \"\"\"No. 3 tests collection for AllergyIntolerance.\n    Test File: allergyintolerance-nka.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"allergyintolerance-nka.json\"\n    inst = allergyintolerance.AllergyIntolerance.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AllergyIntolerance\" == inst.get_resource_type()\n\n    impl_allergyintolerance_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AllergyIntolerance\" == data[\"resourceType\"]\n\n    inst2 = allergyintolerance.AllergyIntolerance(**data)\n    impl_allergyintolerance_3(inst2)\n\n\ndef impl_allergyintolerance_4(inst):\n    assert inst.category[0] == \"medication\"\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert inst.clinicalStatus.coding[0].display == \"Active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\"\n            }\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"7980\"\n    assert inst.code.coding[0].display == \"Penicillin G\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.criticality == \"high\"\n    assert inst.id == \"medication\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/example\"\n    assert inst.participant[0].function.coding[0].code == \"author\"\n    assert inst.participant[0].function.coding[0].display == \"Author\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.reaction[0].manifestation[0].concept.coding[0].code == \"247472004\"\n    assert inst.reaction[0].manifestation[0].concept.coding[0].display == \"Hives\"\n    assert (\n        inst.reaction[0].manifestation[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-03-01\"}\n        ).valueDateTime\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"unconfirmed\"\n    assert inst.verificationStatus.coding[0].display == \"Unconfirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-verification\"\n            }\n        ).valueUri\n    )\n\n\ndef test_allergyintolerance_4(base_settings):\n    \"\"\"No. 4 tests collection for AllergyIntolerance.\n    Test File: allergyintolerance-medication.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"allergyintolerance-medication.json\"\n    inst = allergyintolerance.AllergyIntolerance.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AllergyIntolerance\" == inst.get_resource_type()\n\n    impl_allergyintolerance_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AllergyIntolerance\" == data[\"resourceType\"]\n\n    inst2 = allergyintolerance.AllergyIntolerance(**data)\n    impl_allergyintolerance_4(inst2)\n\n\ndef impl_allergyintolerance_5(inst):\n    assert inst.category[0] == \"food\"\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert inst.clinicalStatus.coding[0].display == \"Active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical\"\n            }\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"227037002\"\n    assert inst.code.coding[0].display == \"Fish - dietary (substance)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Allergic to fresh fish. Tolerates canned fish\"\n    assert inst.id == \"fishallergy\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ids/patients/risks\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"49476535\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/example\"\n    assert inst.participant[0].function.coding[0].code == \"author\"\n    assert inst.participant[0].function.coding[0].display == \"Author\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-06T15:37:31-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.text.status == \"additional\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert inst.verificationStatus.coding[0].display == \"Confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/allergyintolerance-verification\"\n            }\n        ).valueUri\n    )\n\n\ndef test_allergyintolerance_5(base_settings):\n    \"\"\"No. 5 tests collection for AllergyIntolerance.\n    Test File: allergyintolerance-fishallergy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"allergyintolerance-fishallergy.json\"\n    )\n    inst = allergyintolerance.AllergyIntolerance.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AllergyIntolerance\" == inst.get_resource_type()\n\n    impl_allergyintolerance_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AllergyIntolerance\" == data[\"resourceType\"]\n\n    inst2 = allergyintolerance.AllergyIntolerance(**data)\n    impl_allergyintolerance_5(inst2)\n\n\ndef impl_allergyintolerance_6(inst):\n    assert inst.code.coding[0].code == \"409137002\"\n    assert inst.code.coding[0].display == \"No Known Drug Allergy (situation)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"NKDA\"\n    assert inst.id == \"nkda\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/example\"\n    assert inst.participant[0].function.coding[0].code == \"author\"\n    assert inst.participant[0].function.coding[0].display == \"Author\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/mom\"\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-06T15:37:31-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_allergyintolerance_6(base_settings):\n    \"\"\"No. 6 tests collection for AllergyIntolerance.\n    Test File: allergyintolerance-nkda.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"allergyintolerance-nkda.json\"\n    inst = allergyintolerance.AllergyIntolerance.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AllergyIntolerance\" == inst.get_resource_type()\n\n    impl_allergyintolerance_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AllergyIntolerance\" == data[\"resourceType\"]\n\n    inst2 = allergyintolerance.AllergyIntolerance(**data)\n    impl_allergyintolerance_6(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_appointment.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Appointment\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import appointment\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_appointment_1(inst):\n    assert inst.appointmentType.coding[0].code == \"FOLLOWUP\"\n    assert (\n        inst.appointmentType.coding[0].display\n        == \"A follow up visit from a previous appointment\"\n    )\n    assert (\n        inst.appointmentType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0276\"}\n        ).valueUri\n    )\n    assert inst.basedOn[0].reference == \"ServiceRequest/myringotomy\"\n    assert inst.class_fhir[0].coding[0].code == \"AMB\"\n    assert inst.class_fhir[0].coding[0].display == \"ambulatory\"\n    assert (\n        inst.class_fhir[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-10-10\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Discussion on the results of your recent MRI\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-10T11:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Further expand on the results of the MRI and determine the \"\n        \"next actions that may be appropriate.\"\n    )\n    assert inst.participant[0].actor.display == \"Peter James Chalmers\"\n    assert inst.participant[0].actor.reference == \"Patient/example\"\n    assert inst.participant[0].required is True\n    assert inst.participant[0].status == \"accepted\"\n    assert inst.participant[1].actor.display == \"Dr Adam Careful\"\n    assert inst.participant[1].actor.reference == \"Practitioner/example\"\n    assert inst.participant[1].required is True\n    assert inst.participant[1].status == \"accepted\"\n    assert inst.participant[1].type[0].coding[0].code == \"ATND\"\n    assert (\n        inst.participant[1].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.participant[2].actor.display == \"South Wing, second floor\"\n    assert inst.participant[2].actor.reference == \"Location/1\"\n    assert inst.participant[2].required is True\n    assert inst.participant[2].status == \"accepted\"\n    assert inst.patientInstruction[0].concept.text == (\n        \"Please avoid excessive travel (specifically flying) before \" \"this appointment\"\n    )\n    assert inst.reason[0].reference.display == \"Severe burn of left ear\"\n    assert inst.reason[0].reference.reference == \"Condition/example\"\n    assert inst.serviceCategory[0].coding[0].code == \"gp\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.serviceCategory[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/service-category\"}\n        ).valueUri\n    )\n    assert inst.serviceType[0].concept.coding[0].code == \"52\"\n    assert inst.serviceType[0].concept.coding[0].display == \"General Discussion\"\n    assert inst.specialty[0].coding[0].code == \"394814009\"\n    assert inst.specialty[0].coding[0].display == \"General practice\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-10T09:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"booked\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Brian MRI '\n        \"results discussion</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_appointment_1(base_settings):\n    \"\"\"No. 1 tests collection for Appointment.\n    Test File: appointment-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"appointment-example.json\"\n    inst = appointment.Appointment.model_validate_json(filename.read_bytes())\n    assert \"Appointment\" == inst.get_resource_type()\n\n    impl_appointment_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Appointment\" == data[\"resourceType\"]\n\n    inst2 = appointment.Appointment(**data)\n    impl_appointment_1(inst2)\n\n\ndef impl_appointment_2(inst):\n    assert inst.appointmentType.coding[0].code == \"WALKIN\"\n    assert (\n        inst.appointmentType.coding[0].display\n        == \"A previously unscheduled walk-in visit\"\n    )\n    assert (\n        inst.appointmentType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0276\"}\n        ).valueUri\n    )\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-02\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Discussion on the results of your recent MRI\"\n    assert inst.id == \"examplereq\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/sampleappointment-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.minutesDuration == 15\n    assert inst.note[0].text == (\n        \"Further expand on the results of the MRI and determine the \"\n        \"next actions that may be appropriate.\"\n    )\n    assert inst.participant[0].actor.display == \"Peter James Chalmers\"\n    assert inst.participant[0].actor.reference == \"Patient/example\"\n    assert inst.participant[0].required is True\n    assert inst.participant[0].status == \"needs-action\"\n    assert inst.participant[1].required is True\n    assert inst.participant[1].status == \"needs-action\"\n    assert inst.participant[1].type[0].coding[0].code == \"ATND\"\n    assert (\n        inst.participant[1].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.participant[2].actor.display == \"South Wing, second floor\"\n    assert inst.participant[2].actor.reference == \"Location/1\"\n    assert inst.participant[2].required is True\n    assert inst.participant[2].status == \"accepted\"\n    assert inst.reason[0].concept.coding[0].code == \"413095006\"\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reason[0].concept.text == \"Clinical Review\"\n    assert (\n        inst.requestedPeriod[0].end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-09\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.requestedPeriod[0].start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-02\"}\n        ).valueDateTime\n    )\n    assert inst.serviceCategory[0].coding[0].code == \"gp\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.serviceCategory[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/service-category\"}\n        ).valueUri\n    )\n    assert inst.slot[0].reference == \"Slot/example\"\n    assert inst.specialty[0].coding[0].code == \"394814009\"\n    assert inst.specialty[0].coding[0].display == \"General practice\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.status == \"proposed\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Brian MRI '\n        \"results discussion</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_appointment_2(base_settings):\n    \"\"\"No. 2 tests collection for Appointment.\n    Test File: appointment-example-request.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"appointment-example-request.json\"\n    inst = appointment.Appointment.model_validate_json(filename.read_bytes())\n    assert \"Appointment\" == inst.get_resource_type()\n\n    impl_appointment_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Appointment\" == data[\"resourceType\"]\n\n    inst2 = appointment.Appointment(**data)\n    impl_appointment_2(inst2)\n\n\ndef impl_appointment_3(inst):\n    assert inst.appointmentType.coding[0].code == \"FOLLOWUP\"\n    assert (\n        inst.appointmentType.coding[0].display\n        == \"A follow up visit from a previous appointment\"\n    )\n    assert (\n        inst.appointmentType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0276\"}\n        ).valueUri\n    )\n    assert inst.description == \"Discussion about Peter Chalmers ultrasound results\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-09T11:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"2docs\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Clarify the results of the ultrasound to ensure context of \" \"test was correct\"\n    )\n    assert inst.participant[0].actor.display == \"Dr Adam Careful\"\n    assert inst.participant[0].actor.reference == \"Practitioner/example\"\n    assert inst.participant[0].required is True\n    assert inst.participant[0].status == \"accepted\"\n    assert inst.participant[1].actor.display == \"Luigi Maas\"\n    assert inst.participant[1].actor.reference == \"Practitioner/f202\"\n    assert inst.participant[1].required is True\n    assert inst.participant[1].status == \"accepted\"\n    assert inst.serviceCategory[0].coding[0].code == \"gp\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.serviceCategory[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/service-category\"}\n        ).valueUri\n    )\n    assert inst.serviceType[0].concept.coding[0].code == \"52\"\n    assert inst.serviceType[0].concept.coding[0].display == \"General Discussion\"\n    assert inst.specialty[0].coding[0].code == \"394814009\"\n    assert inst.specialty[0].coding[0].display == \"General practice\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-09T09:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"booked\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.supportingInformation[0].reference == \"DiagnosticReport/ultrasound\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Discussion of '\n        \"Peter's ultrasound results to plan ongoing treatment \"\n        \"options</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_appointment_3(base_settings):\n    \"\"\"No. 3 tests collection for Appointment.\n    Test File: appointment-example2doctors.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"appointment-example2doctors.json\"\n    inst = appointment.Appointment.model_validate_json(filename.read_bytes())\n    assert \"Appointment\" == inst.get_resource_type()\n\n    impl_appointment_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Appointment\" == data[\"resourceType\"]\n\n    inst2 = appointment.Appointment(**data)\n    impl_appointment_3(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_appointmentresponse.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AppointmentResponse\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import appointmentresponse\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_appointmentresponse_1(inst):\n    assert inst.actor.display == \"Dr Adam Careful\"\n    assert inst.actor.reference == \"Practitioner/example\"\n    assert inst.appointment.display == \"Brian MRI results discussion\"\n    assert inst.appointment.reference == \"Appointment/examplereq\"\n    assert inst.comment == \"can't we try for this time, can't do mornings\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T13:30:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"exampleresp\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/sampleappointmentresponse-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"response123\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participantStatus == \"tentative\"\n    assert inst.participantType[0].coding[0].code == \"ATND\"\n    assert (\n        inst.participantType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T13:15:00Z\"}\n        ).valueInstant\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Accept Brian MRI'\n        \" results discussion</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_appointmentresponse_1(base_settings):\n    \"\"\"No. 1 tests collection for AppointmentResponse.\n    Test File: appointmentresponse-example-req.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"appointmentresponse-example-req.json\"\n    )\n    inst = appointmentresponse.AppointmentResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AppointmentResponse\" == inst.get_resource_type()\n\n    impl_appointmentresponse_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AppointmentResponse\" == data[\"resourceType\"]\n\n    inst2 = appointmentresponse.AppointmentResponse(**data)\n    impl_appointmentresponse_1(inst2)\n\n\ndef impl_appointmentresponse_2(inst):\n    assert inst.actor.display == \"Peter James Chalmers\"\n    assert inst.actor.reference == \"Patient/example\"\n    assert inst.appointment.display == \"Brian MRI results discussion\"\n    assert inst.appointment.reference == \"Appointment/example\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participantStatus == \"accepted\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Accept Brian MRI'\n        \" results discussion</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_appointmentresponse_2(base_settings):\n    \"\"\"No. 2 tests collection for AppointmentResponse.\n    Test File: appointmentresponse-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"appointmentresponse-example.json\"\n    inst = appointmentresponse.AppointmentResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AppointmentResponse\" == inst.get_resource_type()\n\n    impl_appointmentresponse_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AppointmentResponse\" == data[\"resourceType\"]\n\n    inst2 = appointmentresponse.AppointmentResponse(**data)\n    impl_appointmentresponse_2(inst2)\n\n\ndef impl_appointmentresponse_3(inst):\n    assert inst.actor.display == \"South Wing, second floor\"\n    assert inst.actor.reference == \"Location/1\"\n    assert inst.appointment.display == \"Brian MRI results discussion\"\n    assert inst.appointment.reference == \"Appointment/example\"\n    assert inst.id == \"example-loc\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participantStatus == \"accepted\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Auto-Accept '\n        \"Brian MRI results discussion</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_appointmentresponse_3(base_settings):\n    \"\"\"No. 3 tests collection for AppointmentResponse.\n    Test File: appointmentresponse-example-loc.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"appointmentresponse-example-loc.json\"\n    )\n    inst = appointmentresponse.AppointmentResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"AppointmentResponse\" == inst.get_resource_type()\n\n    impl_appointmentresponse_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AppointmentResponse\" == data[\"resourceType\"]\n\n    inst2 = appointmentresponse.AppointmentResponse(**data)\n    impl_appointmentresponse_3(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_artifactassessment.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ArtifactAssessment\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import artifactassessment\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_artifactassessment_1(inst):\n    assert inst.artifactCanonical == \"http://fevir.net/resources/Evidence/7637\"\n    assert inst.content[0].author.display == (\n        \"COVID-19 Knowledge Accelerator Evidence 7637 Authors (Brian \"\n        \"S. Alper, Harold Lehmann, Ahmad Sofi-Mahmudi, Joanne \"\n        \"Dehnbostel, Ilkka Kunnamo)\"\n    )\n    assert inst.content[0].classifier[0].coding[0].code == \"extremely-serious-concern\"\n    assert (\n        inst.content[0].classifier[0].coding[0].display == \"extremely serious concern\"\n    )\n    assert (\n        inst.content[0].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].classifier[0].coding[0].userSelected is True\n    assert inst.content[0].classifier[0].coding[0].version == \"5.0.0\"\n    assert (\n        inst.content[0].component[0].author.display\n        == \"Brian S. Alper, Joanne Dehnbostel, Muhammad Afzal\"\n    )\n    assert inst.content[0].component[0].classifier[0].coding[0].code == \"no-concern\"\n    assert (\n        inst.content[0].component[0].classifier[0].coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.content[0].component[0].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[0].classifier[0].coding[0].userSelected is True\n    assert inst.content[0].component[0].classifier[0].coding[0].version == \"5.0.0\"\n    assert inst.content[0].component[0].summary == (\n        \"Inclusion of suspected COVID-19 in 1 of 3 trials may \"\n        \"introduce selection bias, but the impact appears limited.\"\n    )\n    assert inst.content[0].component[0].type.text == \"Selection Bias\"\n    assert inst.content[0].component[1].author.display == (\n        \"Brian S. Alper, Ilkka Kunnamo, Alfonso Iorio, Joanne \"\n        \"Dehnbostel, Harold Lehmann, Kenneth Wilkins; clarifying \"\n        \"explanation reviewed by Janice Tufte\"\n    )\n    assert (\n        inst.content[0].component[1].classifier[0].coding[0].code == \"serious-concern\"\n    )\n    assert (\n        inst.content[0].component[1].classifier[0].coding[0].display\n        == \"serious concern\"\n    )\n    assert (\n        inst.content[0].component[1].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[1].classifier[0].coding[0].userSelected is True\n    assert inst.content[0].component[1].classifier[0].coding[0].version == \"5.0.0\"\n    assert inst.content[0].component[1].component[3].author.display == (\n        \"Brian S. Alper, Joanne Dehnbostel, Harold Lehmann, Kenneth \" \"Wilkins\"\n    )\n    assert inst.content[0].component[1].component[3].classifier[0].text == (\n        \"Adaptive randomization is not a concern by itself, only if \"\n        \"it results in a confounding difference.\"\n    )\n    assert inst.content[0].component[1].component[3].component[0].summary == (\n        \"Definition of Allocation Bias = A confounding covariate bias\"\n        \" resulting from methods for assignment of the independent \"\n        \"variable by the investigator to evaluate a response or \"\n        \"outcome.\"\n    )\n    assert inst.content[0].component[1].component[3].component[1].summary == (\n        \"ATTACC implemented response-adaptive randomization on \"\n        \"December 15, 2020, which led to imbalanced randomization.\"\n    )\n    assert inst.content[0].component[1].component[3].summary == (\n        \"Response-adaptive randomization led to imbalanced \" \"randomization.\"\n    )\n    assert inst.content[0].component[1].component[3].type.text == \"Allocation Bias\"\n    assert inst.content[0].component[1].component[4].author.display == (\n        \"Brian S. Alper, Joanne Dehnbostel, Harold Lehmann, Kenneth \" \"Wilkins\"\n    )\n    assert (\n        inst.content[0].component[1].component[4].classifier[0].coding[0].code\n        == \"serious-concern\"\n    )\n    assert (\n        inst.content[0].component[1].component[4].classifier[0].coding[0].display\n        == \"serious concern\"\n    )\n    assert (\n        inst.content[0].component[1].component[4].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert (\n        inst.content[0].component[1].component[4].classifier[0].coding[0].userSelected\n        is True\n    )\n    assert (\n        inst.content[0].component[1].component[4].classifier[0].coding[0].version\n        == \"5.0.0\"\n    )\n    assert inst.content[0].component[1].component[4].component[0].summary == (\n        \"Definition of Confounding difference = A confounding \"\n        \"covariate bias in which the unequal distribution of a \"\n        \"potentially distorting variable is recognized.\"\n    )\n    assert inst.content[0].component[1].component[4].component[1].summary == (\n        \"Incomplete reporting limits the determination of the \"\n        \"potential degree of influence of calendar time.\"\n    )\n    assert inst.content[0].component[1].component[4].summary == (\n        \"There is an unequal distribution of calendar time between \"\n        \"the groups being compared.\"\n    )\n    assert (\n        inst.content[0].component[1].component[4].type.text == \"Confounding difference\"\n    )\n    assert inst.content[0].component[1].type.text == \"Confounding Covariate Bias\"\n    assert inst.content[0].component[2].author.display == (\n        \"Brian S. Alper, Joanne Dehnbostel, Harold Lehmann, Muhammad \" \"Afzal\"\n    )\n    assert (\n        inst.content[0].component[2].classifier[0].coding[0].code\n        == \"very-serious-concern\"\n    )\n    assert (\n        inst.content[0].component[2].classifier[0].coding[0].display\n        == \"very serious concern\"\n    )\n    assert (\n        inst.content[0].component[2].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[2].classifier[0].coding[0].userSelected is True\n    assert inst.content[0].component[2].classifier[0].coding[0].version == \"5.0.0\"\n    assert inst.content[0].component[2].component[0].summary == (\n        \"Definition of Performance Bias = A bias resulting from \"\n        \"differences between the received exposure and the intended \"\n        \"exposure.\"\n    )\n    assert inst.content[0].component[2].component[1].author.display == (\n        \"Brian S. Alper; clarifying explanation reviewed by Janice \" \"Tufte\"\n    )\n    assert (\n        inst.content[0].component[2].component[1].classifier[0].coding[0].code\n        == \"very-serious-concern\"\n    )\n    assert (\n        inst.content[0].component[2].component[1].classifier[0].coding[0].display\n        == \"very serious concern\"\n    )\n    assert (\n        inst.content[0].component[2].component[1].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert (\n        inst.content[0].component[2].component[1].classifier[0].coding[0].userSelected\n        is True\n    )\n    assert (\n        inst.content[0].component[2].component[1].classifier[0].coding[0].version\n        == \"5.0.0\"\n    )\n    assert inst.content[0].component[2].component[1].component[0].summary == (\n        \"The absolute difference in survival without intubation was \"\n        \"1%, so 3% of the 4% absolute difference in the primary \"\n        'outcome can be considered \"organ support without '\n        'intubation\".'\n    )\n    assert inst.content[0].component[2].component[1].component[2].summary == (\n        \"Awareness of treatment assignment may reduce clinical \"\n        'decision to initiate \"organ support without intubation\" in'\n        \" patients with higher risk of major bleeding.\"\n    )\n    assert inst.content[0].component[2].component[1].component[3].summary == (\n        \"Definition of Inadequate blinding of intervention deliverers\"\n        \" = A performance bias due to awareness of the allocated \"\n        \"intervention by individuals providing or delivering the \"\n        \"intervention.\"\n    )\n    assert inst.content[0].component[2].component[1].summary == (\n        \"Lack of blinding may explain reported differences in the \" \"primary outcome.\"\n    )\n    assert (\n        inst.content[0].component[2].component[1].type.text\n        == \"Inadequate blinding of intervention deliverers\"\n    )\n    assert (\n        inst.content[0].component[2].component[2].author.display\n        == \"Surbhi Shah, Brian S. Alper\"\n    )\n    assert (\n        inst.content[0].component[2].component[2].classifier[0].text\n        == \"degree of concern unclear\"\n    )\n    assert inst.content[0].component[2].component[2].component[0].summary == (\n        \"Therapeutic dose anticoagulation (in the first 24-48 hours \"\n        \"following randomization) was reported in 79.6% of the \"\n        \"therapeutic arm and 0.9% of the usual care arm. (Table S3)\"\n    )\n    assert inst.content[0].component[2].component[2].component[1].summary == (\n        \"Definition of Deviation from study intervention protocol = A\"\n        \" performance bias in which the intervention received differs\"\n        \" from the intervention specified in the study protocol.\"\n    )\n    assert (\n        inst.content[0].component[2].component[2].summary\n        == \"Crossover to other intervention in 20%\"\n    )\n    assert (\n        inst.content[0].component[2].component[2].type.text\n        == \"Deviation from study intervention protocol\"\n    )\n    assert inst.content[0].component[2].component[3].author.display == (\n        \"COVID-19 Knowledge Accelerator Working Group discussion with\"\n        \" Brian S. Alper, Ilkka Kunnamo, Joanne Dehnbostel; \"\n        \"Performance Bias concern initially suggested by Harold \"\n        \"Lehmann\"\n    )\n    assert (\n        inst.content[0].component[2].component[3].classifier[0].text\n        == \"limited concern\"\n    )\n    assert inst.content[0].component[2].component[3].component[0].summary == (\n        \"Initial adherence to the protocol-assigned anticoagulation \"\n        \"dose after randomization was 88.3% in the therapeutic-dose \"\n        \"anticoagulation group and 98.3% in the thromboprophylaxis \"\n        \"group (Table S3).\"\n    )\n    assert inst.content[0].component[2].component[3].component[1].summary == (\n        \"Definition of Nonadherence of implementation = A performance\"\n        \" bias in which the intervention deliverers do not completely\"\n        \" adhere to the expected intervention.\"\n    )\n    assert (\n        inst.content[0].component[2].component[3].type.text\n        == \"Nonadherence of implementation\"\n    )\n    assert inst.content[0].component[2].summary == (\n        \"Awareness of treatment assignment may reduce clinical \"\n        'decision to initiate some types of \"organ support\" in '\n        \"patients with higher risk of major bleeding.\"\n    )\n    assert inst.content[0].component[2].type.text == \"Performance Bias\"\n    assert (\n        inst.content[0].component[3].author.display\n        == \"Brian S. Alper, Joanne Dehnbostel, Muhammad Afzal\"\n    )\n    assert inst.content[0].component[3].classifier[0].coding[0].code == \"no-concern\"\n    assert (\n        inst.content[0].component[3].classifier[0].coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.content[0].component[3].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[3].classifier[0].coding[0].userSelected is True\n    assert inst.content[0].component[3].classifier[0].coding[0].version == \"5.0.0\"\n    assert inst.content[0].component[3].component[0].summary == (\n        \"Definition of Detection Bias = A bias due to distortions in \"\n        \"how variable values (data) are determined.\"\n    )\n    assert inst.content[0].component[3].type.text == \"Detection Bias\"\n    assert (\n        inst.content[0].component[4].author.display\n        == \"Brian S. Alper, Joanne Dehnbostel, Muhammad Afzal\"\n    )\n    assert inst.content[0].component[4].classifier[0].coding[0].code == \"no-concern\"\n    assert (\n        inst.content[0].component[4].classifier[0].coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.content[0].component[4].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[4].classifier[0].coding[0].userSelected is True\n    assert inst.content[0].component[4].classifier[0].coding[0].version == \"5.0.0\"\n    assert inst.content[0].component[4].component[0].summary == (\n        \"Definition of Attrition Bias = A bias due to absence of \"\n        \"expected participation or data collection after selection \"\n        \"for study inclusion.\"\n    )\n    assert inst.content[0].component[4].summary == (\n        \"Only 19 of 1190 (1.6%) therapeutic group and 6 of 1054 (0.6)\"\n        \" prophylactic group were excluded after randomization.\"\n    )\n    assert inst.content[0].component[4].type.text == \"Attrition Bias\"\n    assert inst.content[0].component[5].author.display == (\n        \"Brian S. Alper, Joanne Dehnbostel, Muhammad Afzal, Janice \" \"Tufte\"\n    )\n    assert (\n        inst.content[0].component[5].classifier[0].coding[0].code\n        == \"very-serious-concern\"\n    )\n    assert (\n        inst.content[0].component[5].classifier[0].coding[0].display\n        == \"very serious concern\"\n    )\n    assert (\n        inst.content[0].component[5].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[5].classifier[0].coding[0].userSelected is True\n    assert inst.content[0].component[5].classifier[0].coding[0].version == \"5.0.0\"\n    assert inst.content[0].component[5].component[0].summary == (\n        \"Definition of Analysis Bias = A bias related to the analytic\"\n        \" process applied to the data.\"\n    )\n    assert inst.content[0].component[5].component[1].author.display == (\n        \"Brian S. Alper, Joanne Dehnbostel, Muhammad Afzal, Janice \" \"Tufte\"\n    )\n    assert (\n        inst.content[0].component[5].component[1].classifier[0].coding[0].code\n        == \"very-serious-concern\"\n    )\n    assert (\n        inst.content[0].component[5].component[1].classifier[0].coding[0].display\n        == \"very serious concern\"\n    )\n    assert (\n        inst.content[0].component[5].component[1].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert (\n        inst.content[0].component[5].component[1].classifier[0].coding[0].userSelected\n        is True\n    )\n    assert (\n        inst.content[0].component[5].component[1].classifier[0].coding[0].version\n        == \"5.0.0\"\n    )\n    assert inst.content[0].component[5].component[1].component[0].summary == (\n        \"Definition of Bias related to selection of the analysis = An\"\n        \" analysis bias due to inappropriate choice of analysis \"\n        \"methods before the analysis is applied.\"\n    )\n    assert inst.content[0].component[5].component[1].component[1].summary == (\n        \"There was no pre-specified frequentist analysis. There was \"\n        \"no posthoc frequentist analysis reported.\"\n    )\n    assert inst.content[0].component[5].component[1].component[2].summary == (\n        \"It is uncertain what a frequentist analysis would show and \"\n        \"uncertain whether the choice of Bayesian analysis or \"\n        \"frequentist analysis has a substantial influence on the \"\n        \"results.\"\n    )\n    assert inst.content[0].component[5].component[1].summary == (\n        \"A frequentist analysis is not reported so we cannot \"\n        \"determine if the results are sensitive to the analytic \"\n        \"method\"\n    )\n    assert (\n        inst.content[0].component[5].component[1].type.text\n        == \"Bias related to selection of the analysis\"\n    )\n    assert inst.content[0].component[5].component[2].author.display == (\n        \"Brian S. Alper, Joanne Dehnbostel, Muhammad Afzal, Janice \" \"Tufte\"\n    )\n    assert (\n        inst.content[0].component[5].component[2].classifier[0].coding[0].code\n        == \"very-serious-concern\"\n    )\n    assert (\n        inst.content[0].component[5].component[2].classifier[0].coding[0].display\n        == \"very serious concern\"\n    )\n    assert (\n        inst.content[0].component[5].component[2].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert (\n        inst.content[0].component[5].component[2].classifier[0].coding[0].userSelected\n        is True\n    )\n    assert (\n        inst.content[0].component[5].component[2].classifier[0].coding[0].version\n        == \"5.0.0\"\n    )\n    assert inst.content[0].component[5].component[2].component[0].summary == (\n        \"There was no “minimally important difference”. So a 99% \"\n        \"probability of having an odds ratio > 1 (even if the \"\n        \"magnitude of effect is infinitesimal) was used to decide it \"\n        \"was time to stop the trial.\"\n    )\n    assert inst.content[0].component[5].component[2].summary == (\n        \"The stopping criteria were based on statistical significance\"\n        \" and not magnitude of effect.\"\n    )\n    assert (\n        inst.content[0].component[5].component[2].type.text == \"Early trial termination\"\n    )\n    assert inst.content[0].component[5].summary == (\n        \"It is unknown if the results are sensitive to the analytic \"\n        \"method, and the stopping criteria were based on statistical \"\n        \"significance and not magnitude of effect.\"\n    )\n    assert inst.content[0].component[5].type.text == \"Analysis Bias\"\n    assert inst.content[0].freeToShare is True\n    assert inst.content[0].informationType == \"rating\"\n    assert inst.content[0].type.coding[0].code == \"RiskOfBias\"\n    assert inst.content[0].type.coding[0].display == \"Risk of bias\"\n    assert (\n        inst.content[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.content[0].type.coding[0].userSelected is True\n    assert inst.content[0].type.coding[0].version == \"5.0.0\"\n    assert inst.content[1].author.display == \"Ilkka Kunnamo\"\n    assert inst.content[1].informationType == \"comment\"\n    assert (\n        inst.content[1].summary == \"Results not consistent with critically ill cohort.\"\n    )\n    assert inst.content[1].type.coding[0].code == \"Inconsistency\"\n    assert inst.content[1].type.coding[0].display == \"Inconsistency\"\n    assert (\n        inst.content[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.content[1].type.coding[0].userSelected is True\n    assert inst.content[1].type.coding[0].version == \"5.0.0\"\n    assert inst.copyright == \"https://creativecommons.org/licenses/by-nc-sa/4.0/\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-11-02T14:31:30.239Z\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"risk-of-bias-example\"\n    assert inst.identifier[0].assigner.display == \"Computable Publishing LLC\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"FEvIR Object Identifier\"\n    assert inst.identifier[0].value == \"27751\"\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2021-08-11\"}).valueDate\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_artifactassessment_1(base_settings):\n    \"\"\"No. 1 tests collection for ArtifactAssessment.\n    Test File: artifactassessment-risk-of-bias-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"artifactassessment-risk-of-bias-example.json\"\n    )\n    inst = artifactassessment.ArtifactAssessment.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ArtifactAssessment\" == inst.get_resource_type()\n\n    impl_artifactassessment_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ArtifactAssessment\" == data[\"resourceType\"]\n\n    inst2 = artifactassessment.ArtifactAssessment(**data)\n    impl_artifactassessment_1(inst2)\n\n\ndef impl_artifactassessment_2(inst):\n    assert inst.artifactReference.display == (\n        \"Critically appraised summary of all-cause mortality in meta-\"\n        \"analysis of RCTs of heparin for moderately ill patients with\"\n        \" COVID-19\"\n    )\n    assert inst.artifactReference.reference == \"Evidence/18812\"\n    assert (\n        inst.artifactReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Evidence\"}).valueUri\n    )\n    assert inst.content[0].author.display == \"Brian S. Alper\"\n    assert inst.content[0].classifier[0].coding[0].code == \"very-low\"\n    assert inst.content[0].classifier[0].coding[0].display == \"Very low quality\"\n    assert (\n        inst.content[0].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[0].author.display == \"Brian S. Alper\"\n    assert (\n        inst.content[0].component[0].classifier[0].coding[0].code == \"serious-concern\"\n    )\n    assert (\n        inst.content[0].component[0].classifier[0].coding[0].display\n        == \"serious concern\"\n    )\n    assert (\n        inst.content[0].component[0].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[0].informationType == \"rating\"\n    assert (\n        inst.content[0].component[0].summary == \"risk of bias in both included trials\"\n    )\n    assert inst.content[0].component[0].type.coding[0].code == \"RiskOfBias\"\n    assert inst.content[0].component[0].type.coding[0].display == \"Risk of bias\"\n    assert (\n        inst.content[0].component[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[1].author.display == \"Brian S. Alper\"\n    assert (\n        inst.content[0].component[1].classifier[0].coding[0].code == \"serious-concern\"\n    )\n    assert (\n        inst.content[0].component[1].classifier[0].coding[0].display\n        == \"serious concern\"\n    )\n    assert (\n        inst.content[0].component[1].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[1].informationType == \"rating\"\n    assert inst.content[0].component[1].summary == (\n        \"high degree of heterogeneity (I-squared 80.7%) with \"\n        \"confidence intervals of 2 trial effect estimates barely \"\n        \"overlapping\"\n    )\n    assert inst.content[0].component[1].type.coding[0].code == \"Inconsistency\"\n    assert inst.content[0].component[1].type.coding[0].display == \"Inconsistency\"\n    assert (\n        inst.content[0].component[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[2].author.display == \"Brian S. Alper\"\n    assert inst.content[0].component[2].classifier[0].coding[0].code == \"no-concern\"\n    assert (\n        inst.content[0].component[2].classifier[0].coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.content[0].component[2].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[2].informationType == \"rating\"\n    assert inst.content[0].component[2].type.coding[0].code == \"Indirectness\"\n    assert inst.content[0].component[2].type.coding[0].display == \"Indirectness\"\n    assert (\n        inst.content[0].component[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[3].author.display == \"Brian S. Alper\"\n    assert (\n        inst.content[0].component[3].classifier[0].coding[0].code == \"serious-concern\"\n    )\n    assert (\n        inst.content[0].component[3].classifier[0].coding[0].display\n        == \"serious concern\"\n    )\n    assert (\n        inst.content[0].component[3].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[3].informationType == \"rating\"\n    assert inst.content[0].component[3].summary == (\n        \"95% confidence interval includes both large effects and no \" \"effects\"\n    )\n    assert inst.content[0].component[3].type.coding[0].code == \"Imprecision\"\n    assert inst.content[0].component[3].type.coding[0].display == \"Imprecision\"\n    assert (\n        inst.content[0].component[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[4].author.display == \"Brian S. Alper\"\n    assert inst.content[0].component[4].classifier[0].coding[0].code == \"no-concern\"\n    assert (\n        inst.content[0].component[4].classifier[0].coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.content[0].component[4].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.content[0].component[4].informationType == \"rating\"\n    assert inst.content[0].component[4].type.coding[0].code == \"PublicationBias\"\n    assert inst.content[0].component[4].type.coding[0].display == \"Publication bias\"\n    assert (\n        inst.content[0].component[4].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.content[0].freeToShare is True\n    assert inst.content[0].informationType == \"rating\"\n    assert inst.content[0].summary == (\n        \"serious concerns with risk of bias, inconsistency, and \" \"imprecision\"\n    )\n    assert inst.content[0].type.coding[0].code == \"Overall\"\n    assert inst.content[0].type.coding[0].display == \"Overall certainty\"\n    assert (\n        inst.content[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.copyright == \"https://creativecommons.org/licenses/by-nc-sa/4.0/\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-11-02T14:48:59.890Z\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-certainty-rating\"\n    assert inst.identifier[0].assigner.display == \"Computable Publishing LLC\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"FEvIR Object Identifier\"\n    assert inst.identifier[0].value == \"27756\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_artifactassessment_2(base_settings):\n    \"\"\"No. 2 tests collection for ArtifactAssessment.\n    Test File: artifactassessment-example-certainty-rating.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"artifactassessment-example-certainty-rating.json\"\n    )\n    inst = artifactassessment.ArtifactAssessment.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ArtifactAssessment\" == inst.get_resource_type()\n\n    impl_artifactassessment_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ArtifactAssessment\" == data[\"resourceType\"]\n\n    inst2 = artifactassessment.ArtifactAssessment(**data)\n    impl_artifactassessment_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_auditevent.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/AuditEvent\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import auditevent\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_auditevent_1(inst):\n    assert inst.action == \"E\"\n    assert inst.agent[0].requestor is True\n    assert inst.agent[0].type.coding[0].code == \"humanuser\"\n    assert inst.agent[0].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.display == \"Grahame Grieve\"\n    assert inst.agent[0].who.identifier.value == \"95\"\n    assert (\n        inst.agent[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[1].extension[0].valueIdentifier.type.text == \"process ID\"\n    assert inst.agent[1].extension[0].valueIdentifier.value == \"6580\"\n    assert inst.agent[1].networkString == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110153\"\n    assert inst.agent[1].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[1].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.category[0].coding[0].code == \"rest\"\n    assert inst.category[0].coding[0].display == \"Restful Operation\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-type\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"search\"\n    assert inst.code.coding[0].display == \"search\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.entity[0].query\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueBase64Binary\": (\n                    \"aHR0cDovL2ZoaXItZGV2LmhlYWx0aGludGVyc2VjdGlvbnMuY29tLmF1L29w\"\n                    \"ZW4vRW5jb3VudGVyP3BhcnRpY2lwYW50PTEz\"\n                )\n            }\n        ).valueBase64Binary\n    )\n    assert inst.entity[0].role.coding[0].code == \"24\"\n    assert inst.entity[0].role.coding[0].display == \"Query\"\n    assert (\n        inst.entity[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.id == \"example-search\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome.code.code == \"0\"\n    assert inst.outcome.code.display == \"Success\"\n    assert (\n        inst.outcome.code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-outcome\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-08-22T23:42:24Z\"}\n        ).valueInstant\n    )\n    assert inst.source.observer.display == \"hl7connect.healthintersections.com.au\"\n    assert inst.source.type[0].coding[0].code == \"3\"\n    assert inst.source.type[0].coding[0].display == \"Web Server\"\n    assert (\n        inst.source.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"extensions\"\n\n\ndef test_auditevent_1(base_settings):\n    \"\"\"No. 1 tests collection for AuditEvent.\n    Test File: audit-event-example-search.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"audit-event-example-search.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_1(inst2)\n\n\ndef impl_auditevent_2(inst):\n    assert inst.action == \"E\"\n    assert inst.agent[0].networkString == \"127.0.0.1\"\n    assert inst.agent[0].requestor is True\n    assert inst.agent[0].type.coding[0].code == \"humanuser\"\n    assert inst.agent[0].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.display == \"Grahame Grieve\"\n    assert inst.agent[0].who.identifier.value == \"95\"\n    assert (\n        inst.agent[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[1].extension[0].valueIdentifier.type.text == \"process ID\"\n    assert inst.agent[1].extension[0].valueIdentifier.value == \"6580\"\n    assert inst.agent[1].networkString == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110153\"\n    assert inst.agent[1].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[1].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.category[0].coding[0].code == \"110114\"\n    assert inst.category[0].coding[0].display == \"User Authentication\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"110123\"\n    assert inst.code.coding[0].display == \"Logout\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.id == \"example-logout\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome.code.code == \"0\"\n    assert inst.outcome.code.display == \"Success\"\n    assert (\n        inst.outcome.code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-outcome\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-06-20T23:46:41Z\"}\n        ).valueInstant\n    )\n    assert inst.source.observer.display == \"Cloud\"\n    assert (\n        inst.source.observer.identifier.value == \"hl7connect.healthintersections.com.au\"\n    )\n    assert inst.source.type[0].coding[0].code == \"3\"\n    assert inst.source.type[0].coding[0].display == \"Web Server\"\n    assert (\n        inst.source.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"extensions\"\n\n\ndef test_auditevent_2(base_settings):\n    \"\"\"No. 2 tests collection for AuditEvent.\n    Test File: audit-event-example-logout.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"audit-event-example-logout.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_2(inst2)\n\n\ndef impl_auditevent_3(inst):\n    assert inst.action == \"R\"\n    assert inst.agent[0].requestor is True\n    assert inst.agent[0].type.coding[0].code == \"humanuser\"\n    assert inst.agent[0].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"95\"\n    assert (\n        inst.agent[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[1].extension[0].valueIdentifier.type.text == \"process ID\"\n    assert inst.agent[1].extension[0].valueIdentifier.value == \"6580\"\n    assert inst.agent[1].networkString == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110153\"\n    assert inst.agent[1].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[1].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.category[0].coding[0].code == \"rest\"\n    assert inst.category[0].coding[0].display == \"Restful Operation\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-type\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"vread\"\n    assert inst.code.coding[0].display == \"vread\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.entity[0].role.coding[0].code == \"1\"\n    assert inst.entity[0].role.coding[0].display == \"Patient\"\n    assert (\n        inst.entity[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.reference == \"Patient/example/_history/1\"\n    assert inst.id == \"example-rest\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome.code.code == \"0\"\n    assert inst.outcome.code.display == \"Success\"\n    assert (\n        inst.outcome.code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-outcome\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-06-20T23:42:24Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.source.observer.identifier.value == \"hl7connect.healthintersections.com.au\"\n    )\n    assert inst.source.type[0].coding[0].code == \"3\"\n    assert inst.source.type[0].coding[0].display == \"Web Server\"\n    assert (\n        inst.source.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"extensions\"\n\n\ndef test_auditevent_3(base_settings):\n    \"\"\"No. 3 tests collection for AuditEvent.\n    Test File: audit-event-example-vread.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"audit-event-example-vread.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_3(inst2)\n\n\ndef impl_auditevent_4(inst):\n    assert inst.action == \"C\"\n    assert (\n        inst.agent[0].networkUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ipv6:2001:0db8:85a3:0000:0000:8a2e:0370:7334\"}\n        ).valueUri\n    )\n    assert inst.agent[0].requestor is False\n    assert inst.agent[0].type.coding[0].code == \"110153\"\n    assert inst.agent[0].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.display == \"myMachine.example.org\"\n    assert (\n        inst.agent[1].networkUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://server.example.com/fhir\"}\n        ).valueUri\n    )\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110152\"\n    assert inst.agent[1].type.coding[0].display == \"Destination Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.reference == \"Device/example\"\n    assert inst.agent[2].requestor is True\n    assert inst.agent[2].type.coding[0].code == \"INF\"\n    assert inst.agent[2].type.coding[0].display == \"Informant\"\n    assert (\n        inst.agent[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.agent[2].who.display == \"Betty Jones\"\n    assert inst.authorization[0].coding[0].code == \"TREAT\"\n    assert (\n        inst.authorization[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.basedOn[0].reference == \"CarePlan/example\"\n    assert inst.category[0].coding[0].code == \"create\"\n    assert inst.category[0].coding[0].display == \"create\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"rest\"\n    assert inst.code.coding[0].display == \"Restful Operation\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-type\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/home\"\n    assert inst.entity[0].role.coding[0].code == \"4\"\n    assert inst.entity[0].role.coding[0].display == \"Domain Resource\"\n    assert (\n        inst.entity[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.reference == \"List/example\"\n    assert inst.id == \"example-advanced-create\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurredDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-04-29T09:49:00.000Z\"}\n        ).valueDateTime\n    )\n    assert inst.outcome.code.code == \"0\"\n    assert inst.outcome.code.display == \"Success\"\n    assert (\n        inst.outcome.code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-outcome\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2020-04-29T09:49:00.000Z\"}\n        ).valueInstant\n    )\n    assert inst.severity == \"informational\"\n    assert inst.source.observer.reference == \"Device/example\"\n    assert inst.source.site.identifier.value == \"http://server.example.com\"\n    assert inst.source.type[0].coding[0].code == \"4\"\n    assert inst.source.type[0].coding[0].display == \"Application Server\"\n    assert (\n        inst.source.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_auditevent_4(base_settings):\n    \"\"\"No. 4 tests collection for AuditEvent.\n    Test File: auditevent-example-advanced-create.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"auditevent-example-advanced-create.json\"\n    )\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_4(inst2)\n\n\ndef impl_auditevent_5(inst):\n    assert inst.action == \"R\"\n    assert inst.agent[0].requestor is False\n    assert inst.agent[0].type.coding[0].code == \"110153\"\n    assert inst.agent[0].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.display == \"ExportToMedia.app\"\n    assert inst.agent[1].requestor is True\n    assert inst.agent[1].type.coding[0].code == \"humanuser\"\n    assert inst.agent[1].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[1].who.display == \"Grahame Grieve\"\n    assert inst.agent[1].who.identifier.value == \"95\"\n    assert inst.agent[2].requestor is False\n    assert inst.agent[2].type.coding[0].code == \"110154\"\n    assert inst.agent[2].type.coding[0].display == \"Destination Media\"\n    assert (\n        inst.agent[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.agent[2].who.display == \"Media title: Hello World\"\n    assert inst.category[0].coding[0].code == \"110106\"\n    assert inst.category[0].coding[0].display == \"Export\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"ITI-32\"\n    assert inst.code.coding[0].display == \"Distribute Document Set on Media\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ihe:event-type-code\"}\n        ).valueUri\n    )\n    assert inst.entity[0].role.coding[0].code == \"1\"\n    assert inst.entity[0].role.coding[0].display == \"Patient\"\n    assert (\n        inst.entity[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.entity[0].what.identifier.value\n        == \"e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO\"\n    )\n    assert inst.entity[1].role.coding[0].code == \"20\"\n    assert inst.entity[1].role.coding[0].display == \"Job\"\n    assert (\n        inst.entity[1].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[1].what.identifier.type.coding[0].code == \"IHE XDS Metadata\"\n    assert (\n        inst.entity[1].what.identifier.type.coding[0].display\n        == \"submission set classificationNode\"\n    )\n    assert (\n        inst.entity[1].what.identifier.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd\"}\n        ).valueUri\n    )\n    assert (\n        inst.entity[1].what.identifier.value\n        == \"e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO\"\n    )\n    assert inst.entity[2].what.reference == \"DocumentReference/example\"\n    assert inst.id == \"example-media\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome.code.code == \"0\"\n    assert inst.outcome.code.display == \"Success\"\n    assert (\n        inst.outcome.code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-outcome\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-08-27T23:42:24Z\"}\n        ).valueInstant\n    )\n    assert inst.source.observer.display == \"Cloud\"\n    assert (\n        inst.source.observer.identifier.value == \"hl7connect.healthintersections.com.au\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_auditevent_5(base_settings):\n    \"\"\"No. 5 tests collection for AuditEvent.\n    Test File: audit-event-example-media.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"audit-event-example-media.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_5(inst2)\n\n\ndef impl_auditevent_6(inst):\n    assert inst.action == \"C\"\n    assert inst.agent[0].requestor is True\n    assert inst.agent[0].type.coding[0].code == \"humanuser\"\n    assert inst.agent[0].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"95\"\n    assert (\n        inst.agent[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[1].extension[0].valueIdentifier.type.text == \"process ID\"\n    assert inst.agent[1].extension[0].valueIdentifier.value == \"6580\"\n    assert inst.agent[1].networkString == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110153\"\n    assert inst.agent[1].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[1].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.category[0].coding[0].code == \"rest\"\n    assert inst.category[0].coding[0].display == \"Restful Operation\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-type\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"create\"\n    assert inst.code.coding[0].display == \"create\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.entity[0].role.coding[0].code == \"1\"\n    assert inst.entity[0].role.coding[0].display == \"Patient\"\n    assert (\n        inst.entity[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.reference == \"Patient/example/_history/1\"\n    assert inst.entity[1].role.coding[0].code == \"21\"\n    assert inst.entity[1].role.coding[0].display == \"Job Stream\"\n    assert (\n        inst.entity[1].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.entity[1].what.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.com/server\"}\n        ).valueUri\n    )\n    assert inst.entity[1].what.identifier.type.text == \"TraceID\"\n    assert inst.entity[1].what.identifier.value == \"6b507ee2d716780372c255df69ece653\"\n    assert inst.id == \"example-rest-create-traceID\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome.code.code == \"0\"\n    assert inst.outcome.code.display == \"Success\"\n    assert (\n        inst.outcome.code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-outcome\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-12-04T11:59:28.646+00:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.source.observer.identifier.value == \"hl7connect.healthintersections.com.au\"\n    )\n    assert inst.source.type[0].coding[0].code == \"3\"\n    assert inst.source.type[0].coding[0].display == \"Web Server\"\n    assert (\n        inst.source.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"extensions\"\n\n\ndef test_auditevent_6(base_settings):\n    \"\"\"No. 6 tests collection for AuditEvent.\n    Test File: audit-event-example-create-traceID.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"audit-event-example-create-traceID.json\"\n    )\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_6(inst2)\n\n\ndef impl_auditevent_7(inst):\n    assert inst.action == \"E\"\n    assert inst.agent[0].requestor is True\n    assert inst.agent[0].type.coding[0].code == \"humanuser\"\n    assert inst.agent[0].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.display == \"Grahame Grieve\"\n    assert inst.agent[0].who.identifier.value == \"95\"\n    assert (\n        inst.agent[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[1].extension[0].valueIdentifier.type.text == \"process ID\"\n    assert inst.agent[1].extension[0].valueIdentifier.value == \"6580\"\n    assert inst.agent[1].networkString == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[1].requestor is False\n    assert inst.agent[1].type.coding[0].code == \"110153\"\n    assert inst.agent[1].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[1].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.category[0].coding[0].code == \"110114\"\n    assert inst.category[0].coding[0].display == \"User Authentication\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"110122\"\n    assert inst.code.coding[0].display == \"Login\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.id == \"example-login\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome.code.code == \"0\"\n    assert inst.outcome.code.display == \"Success\"\n    assert (\n        inst.outcome.code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-outcome\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-06-20T23:41:23Z\"}\n        ).valueInstant\n    )\n    assert inst.source.observer.display == \"Cloud\"\n    assert (\n        inst.source.observer.identifier.value == \"hl7connect.healthintersections.com.au\"\n    )\n    assert inst.source.type[0].coding[0].code == \"3\"\n    assert inst.source.type[0].coding[0].display == \"Web Server\"\n    assert (\n        inst.source.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"extensions\"\n\n\ndef test_auditevent_7(base_settings):\n    \"\"\"No. 7 tests collection for AuditEvent.\n    Test File: audit-event-example-login.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"audit-event-example-login.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_7(inst2)\n\n\ndef impl_auditevent_8(inst):\n    assert inst.action == \"E\"\n    assert (\n        inst.agent[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].extension[0].valueIdentifier.type.text == \"process ID\"\n    assert inst.agent[0].extension[0].valueIdentifier.value == \"6580\"\n    assert inst.agent[0].networkString == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[0].requestor is False\n    assert inst.agent[0].type.coding[0].code == \"110153\"\n    assert inst.agent[0].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[0].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.agent[1].requestor is True\n    assert inst.agent[1].type.coding[0].code == \"humanuser\"\n    assert inst.agent[1].type.coding[0].display == \"human user\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/extra-security-role-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[1].who.display == \"Grahame Grieve\"\n    assert inst.agent[1].who.identifier.value == \"95\"\n    assert inst.category[0].coding[0].code == \"110112\"\n    assert inst.category[0].coding[0].display == \"Query\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"ITI-9\"\n    assert inst.code.coding[0].display == \"PIX Query\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.3.6.1.4.1.19376.1.2\"}\n        ).valueUri\n    )\n    assert inst.entity[0].role.coding[0].code == \"1\"\n    assert inst.entity[0].role.coding[0].display == \"Patient\"\n    assert (\n        inst.entity[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.entity[0].what.identifier.value\n        == \"e3cdfc81a0d24bd^^^&2.16.840.1.113883.4.2&ISO\"\n    )\n    assert inst.entity[1].detail[0].type.coding[0].code == \"MSH-10\"\n    assert (\n        inst.entity[1].detail[0].valueBase64Binary\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"MS4yLjg0MC4xMTQzNTAuMS4xMy4wLjEuNy4xLjE=\"}\n        ).valueBase64Binary\n    )\n    assert inst.entity[1].role.coding[0].code == \"24\"\n    assert inst.entity[1].role.coding[0].display == \"Query\"\n    assert (\n        inst.entity[1].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.id == \"example-pixQuery\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome.code.code == \"0\"\n    assert inst.outcome.code.display == \"Success\"\n    assert (\n        inst.outcome.code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-outcome\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-08-26T23:42:24Z\"}\n        ).valueInstant\n    )\n    assert inst.source.observer.display == \"hl7connect.healthintersections.com.au\"\n    assert inst.text.status == \"extensions\"\n\n\ndef test_auditevent_8(base_settings):\n    \"\"\"No. 8 tests collection for AuditEvent.\n    Test File: audit-event-example-pixQuery.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"audit-event-example-pixQuery.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_8(inst2)\n\n\ndef impl_auditevent_9(inst):\n    assert inst.action == \"E\"\n    assert inst.agent[0].requestor is False\n    assert inst.agent[0].role[0].text == \"Service User (Logon)\"\n    assert inst.agent[0].who.identifier.value == \"Grahame\"\n    assert (\n        inst.agent[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/auditevent-AlternativeUserID\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[1].extension[0].valueIdentifier.type.text == \"process ID\"\n    assert inst.agent[1].extension[0].valueIdentifier.value == \"6580\"\n    assert inst.agent[1].networkString == \"Workstation1.ehr.familyclinic.com\"\n    assert inst.agent[1].requestor is False\n    assert (\n        inst.agent[1].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.2\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.identifier.value == \"2.16.840.1.113883.4.2\"\n    assert inst.category[0].coding[0].code == \"110100\"\n    assert inst.category[0].coding[0].display == \"Application Activity\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"110120\"\n    assert inst.code.coding[0].display == \"Application Start\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.entity[0].role.coding[0].code == \"4\"\n    assert inst.entity[0].role.coding[0].display == \"Domain Resource\"\n    assert (\n        inst.entity[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.identifier.type.coding[0].code == \"SNO\"\n    assert (\n        inst.entity[0].what.identifier.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.identifier.type.text == \"Dell Serial Number\"\n    assert inst.entity[0].what.identifier.value == \"ABCDEF\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome.code.code == \"0\"\n    assert inst.outcome.code.display == \"Success\"\n    assert (\n        inst.outcome.code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-outcome\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2012-10-25T22:04:27+11:00\"}\n        ).valueInstant\n    )\n    assert inst.source.observer.display == \"Grahame's Laptop\"\n    assert inst.source.type[0].coding[0].code == \"110122\"\n    assert inst.source.type[0].coding[0].display == \"Login\"\n    assert (\n        inst.source.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Application '\n        \"Start for under service login &quot;Grahame&quot; (id: \"\n        \"Grahame's Test HL7Connect)</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_auditevent_9(base_settings):\n    \"\"\"No. 9 tests collection for AuditEvent.\n    Test File: auditevent-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"auditevent-example.json\"\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_9(inst2)\n\n\ndef impl_auditevent_10(inst):\n    assert inst.action == \"E\"\n    assert inst.agent[0].authorization[0].coding[0].code == \"TREAT\"\n    assert (\n        inst.agent[0].authorization[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.agent[0].requestor is True\n    assert inst.agent[0].type.coding[0].code == \"110152\"\n    assert inst.agent[0].type.coding[0].display == \"Destination Role ID\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert (\n        inst.agent[0].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://github.com/synthetichealth/synthea\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"Org1\"\n    assert inst.code.coding[0].code == \"110112\"\n    assert inst.code.coding[0].display == \"Query\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.entity[0].role.coding[0].code == \"4\"\n    assert inst.entity[0].role.coding[0].display == \"Domain Resource\"\n    assert (\n        inst.entity[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/object-role\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.reference == \"Consent/consent-example-basic\"\n    assert inst.id == \"example-consent-permit-authz\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome.code.code == \"0\"\n    assert inst.outcome.code.display == \"Success\"\n    assert (\n        inst.outcome.code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/audit-event-outcome\"}\n        ).valueUri\n    )\n    assert inst.outcome.detail[0].text == \"CONSENT_PERMIT\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2021-09-08T21:51:59.932Z\"}\n        ).valueInstant\n    )\n    assert inst.source.observer.display == \"LEAP Consent Decision Service\"\n    assert inst.source.type[0].coding[0].code == \"4\"\n    assert inst.source.type[0].coding[0].display == \"Application Server\"\n    assert (\n        inst.source.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/security-source-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_auditevent_10(base_settings):\n    \"\"\"No. 10 tests collection for AuditEvent.\n    Test File: auditevent-example-consent-authz.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"auditevent-example-consent-authz.json\"\n    )\n    inst = auditevent.AuditEvent.model_validate_json(filename.read_bytes())\n    assert \"AuditEvent\" == inst.get_resource_type()\n\n    impl_auditevent_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"AuditEvent\" == data[\"resourceType\"]\n\n    inst2 = auditevent.AuditEvent(**data)\n    impl_auditevent_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_basic.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Basic\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import basic\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_basic_1(inst):\n    assert inst.code.coding[0].code == \"UMLCLASSMODEL\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/do-not-use/fhir-codes#resourceTypes\"}\n        ).valueUri\n    )\n    assert (\n        inst.extension[0].extension[0].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"name\"}).valueUri\n    )\n    assert inst.extension[0].extension[0].valueString == \"Class1\"\n    assert (\n        inst.extension[0].extension[1].extension[0].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"name\"}).valueUri\n    )\n    assert inst.extension[0].extension[1].extension[0].valueString == \"attribute1\"\n    assert (\n        inst.extension[0].extension[1].extension[1].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"minOccurs\"}).valueUri\n    )\n    assert inst.extension[0].extension[1].extension[1].valueInteger == 1\n    assert (\n        inst.extension[0].extension[1].extension[2].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"maxOccurs\"}).valueUri\n    )\n    assert inst.extension[0].extension[1].extension[2].valueCode == \"*\"\n    assert (\n        inst.extension[0].extension[1].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"attribute\"}).valueUri\n    )\n    assert (\n        inst.extension[0].extension[2].extension[0].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"name\"}).valueUri\n    )\n    assert inst.extension[0].extension[2].extension[0].valueString == \"attribute2\"\n    assert (\n        inst.extension[0].extension[2].extension[1].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"minOccurs\"}).valueUri\n    )\n    assert inst.extension[0].extension[2].extension[1].valueInteger == 0\n    assert (\n        inst.extension[0].extension[2].extension[2].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"maxOccurs\"}).valueUri\n    )\n    assert inst.extension[0].extension[2].extension[2].valueInteger == 1\n    assert (\n        inst.extension[0].extension[2].url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"attribute\"}).valueUri\n    )\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/do-not-use/fhir-extensions/UMLclass\"}\n        ).valueUri\n    )\n    assert inst.id == \"classModel\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_basic_1(base_settings):\n    \"\"\"No. 1 tests collection for Basic.\n    Test File: basic-example2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"basic-example2.json\"\n    inst = basic.Basic.model_validate_json(filename.read_bytes())\n    assert \"Basic\" == inst.get_resource_type()\n\n    impl_basic_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Basic\" == data[\"resourceType\"]\n\n    inst2 = basic.Basic(**data)\n    impl_basic_1(inst2)\n\n\ndef impl_basic_2(inst):\n    assert inst.code.text == \"Example Narrative Tester\"\n    assert inst.id == \"basic-example-narrative\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"additional\"\n\n\ndef test_basic_2(base_settings):\n    \"\"\"No. 2 tests collection for Basic.\n    Test File: basic-example-narrative.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"basic-example-narrative.json\"\n    inst = basic.Basic.model_validate_json(filename.read_bytes())\n    assert \"Basic\" == inst.get_resource_type()\n\n    impl_basic_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Basic\" == data[\"resourceType\"]\n\n    inst2 = basic.Basic(**data)\n    impl_basic_2(inst2)\n\n\ndef impl_basic_3(inst):\n    assert inst.author.reference == \"Practitioner/example\"\n    assert inst.code.coding[0].code == \"referral\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/basic-resource-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-05-14\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/do-not-use/fhir-extensions/referral#requestingPractitioner\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueReference.display == \"Dokter Bronsig\"\n    assert inst.extension[0].valueReference.reference == \"Practitioner/f201\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/do-not-use/fhir-extensions/referral#notes\"}\n        ).valueUri\n    )\n    assert inst.extension[1].valueString == (\n        \"The patient had fever peaks over the last couple of days. He\"\n        \" is worried about these peaks.\"\n    )\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/do-not-use/fhir-extensions/referral#fulfillingEncounter\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueReference.reference == \"Encounter/f201\"\n    assert inst.id == \"referral\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealth.org/basic/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"19283746\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.modifierExtension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/do-not-use/fhir-extensions/referral#referredForService\"\n            }\n        ).valueUri\n    )\n    assert inst.modifierExtension[0].valueCodeableConcept.coding[0].code == \"11429006\"\n    assert (\n        inst.modifierExtension[0].valueCodeableConcept.coding[0].display\n        == \"Consultation\"\n    )\n    assert (\n        inst.modifierExtension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.modifierExtension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/do-not-use/fhir-extensions/referral#targetDate\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.modifierExtension[1].valuePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.modifierExtension[1].valuePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.modifierExtension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/do-not-use/fhir-extensions/referral#status\"\n            }\n        ).valueUri\n    )\n    assert inst.modifierExtension[2].valueCode == \"complete\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_basic_3(base_settings):\n    \"\"\"No. 3 tests collection for Basic.\n    Test File: basic-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"basic-example.json\"\n    inst = basic.Basic.model_validate_json(filename.read_bytes())\n    assert \"Basic\" == inst.get_resource_type()\n\n    impl_basic_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Basic\" == data[\"resourceType\"]\n\n    inst2 = basic.Basic(**data)\n    impl_basic_3(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_binary.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Binary\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import binary\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_binary_1(inst):\n    assert inst.contentType == \"application/pdf\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.securityContext.reference == \"DocumentReference/example\"\n\n\ndef test_binary_1(base_settings):\n    \"\"\"No. 1 tests collection for Binary.\n    Test File: binary-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"binary-example.json\"\n    inst = binary.Binary.model_validate_json(filename.read_bytes())\n    assert \"Binary\" == inst.get_resource_type()\n\n    impl_binary_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Binary\" == data[\"resourceType\"]\n\n    inst2 = binary.Binary(**data)\n    impl_binary_1(inst2)\n\n\ndef impl_binary_2(inst):\n    assert inst.contentType == \"image/jpeg\"\n    assert inst.id == \"f006\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n\n\ndef test_binary_2(base_settings):\n    \"\"\"No. 2 tests collection for Binary.\n    Test File: binary-f006.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"binary-f006.json\"\n    inst = binary.Binary.model_validate_json(filename.read_bytes())\n    assert \"Binary\" == inst.get_resource_type()\n\n    impl_binary_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Binary\" == data[\"resourceType\"]\n\n    inst2 = binary.Binary(**data)\n    impl_binary_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_biologicallyderivedproduct.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import biologicallyderivedproduct\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_biologicallyderivedproduct_1(inst):\n    assert (\n        inst.biologicalSourceEvent.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.isbt128.org/uri/DonationIdentificationNumber\"}\n        ).valueUri\n    )\n    assert inst.biologicalSourceEvent.value == \"A999921123456\"\n    assert inst.division == \"A00000\"\n    assert (\n        inst.expirationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-08-02T23:59:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.isbt128.org/uri/MPHOUniqueIdentifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"A9999E0398A999921123456A00000\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.processingFacility[0].reference == \"Organization/A9999\"\n    assert inst.productCode.coding[0].code == \"E0398\"\n    assert inst.productStatus.code == \"available\"\n    assert inst.property[0].type.coding[0].code == \"ABORhD\"\n    assert inst.property[0].valueCodeableConcept.coding[0].code == \"62\"\n    assert inst.property[0].valueCodeableConcept.coding[0].display == \"A RhD Positive\"\n    assert (\n        inst.property[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.isbt128.org/uri/ABORhD\"}\n        ).valueUri\n    )\n    assert inst.property[1].type.coding[0].code == \"Donor\"\n    assert inst.property[1].valueCodeableConcept.coding[0].code == \"V\"\n    assert inst.property[1].valueCodeableConcept.coding[0].display == \"Volunteer\"\n    assert (\n        inst.property[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.isbt128.org/uri/CollectionType\"}\n        ).valueUri\n    )\n    assert (\n        inst.storageTempRequirements.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.storageTempRequirements.high.unit == \"degrees C\"\n    assert float(inst.storageTempRequirements.high.value) == float(6)\n    assert (\n        inst.storageTempRequirements.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.storageTempRequirements.low.unit == \"degrees C\"\n    assert float(inst.storageTempRequirements.low.value) == float(1)\n    assert inst.text.status == \"generated\"\n\n\ndef test_biologicallyderivedproduct_1(base_settings):\n    \"\"\"No. 1 tests collection for BiologicallyDerivedProduct.\n    Test File: biologicallyderivedproduct-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"biologicallyderivedproduct-example.json\"\n    )\n    inst = biologicallyderivedproduct.BiologicallyDerivedProduct.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"BiologicallyDerivedProduct\" == inst.get_resource_type()\n\n    impl_biologicallyderivedproduct_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"BiologicallyDerivedProduct\" == data[\"resourceType\"]\n\n    inst2 = biologicallyderivedproduct.BiologicallyDerivedProduct(**data)\n    impl_biologicallyderivedproduct_1(inst2)\n\n\ndef impl_biologicallyderivedproduct_2(inst):\n    assert inst.collection.source.display == \"HCT Donor\"\n    assert inst.collection.source.reference == \"Patient/example-b\"\n    assert inst.id == \"allogeneicHCT\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.request[0].display == \"Service Request for HCT Collection\"\n    assert (\n        inst.request[0].reference\n        == \"BiologicallyDerivedProduct/HCTcollection-servicerequest\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_biologicallyderivedproduct_2(base_settings):\n    \"\"\"No. 2 tests collection for BiologicallyDerivedProduct.\n    Test File: biologicallyderivedproduct-example-allogeneicHCT.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"biologicallyderivedproduct-example-allogeneicHCT.json\"\n    )\n    inst = biologicallyderivedproduct.BiologicallyDerivedProduct.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"BiologicallyDerivedProduct\" == inst.get_resource_type()\n\n    impl_biologicallyderivedproduct_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"BiologicallyDerivedProduct\" == data[\"resourceType\"]\n\n    inst2 = biologicallyderivedproduct.BiologicallyDerivedProduct(**data)\n    impl_biologicallyderivedproduct_2(inst2)\n\n\ndef impl_biologicallyderivedproduct_3(inst):\n    assert (\n        inst.biologicalSourceEvent.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.isbt128.org/uri/DonationIdentificationNumber\"}\n        ).valueUri\n    )\n    assert inst.biologicalSourceEvent.value == \"W000022000687\"\n    assert inst.collection.source.display == \"HCT Collection\"\n    assert inst.collection.source.reference == \"Patient/example-a\"\n    assert inst.division == \"A00000\"\n    assert (\n        inst.expirationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2028-08-02T23:59:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"autologousHCT\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.isbt128.org/uri/SingleEuropeanCode\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"PL001499Z549917123456 A00T041600320171231\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.processingFacility[0].reference == \"Organization/Example\"\n    assert inst.productCategory.code == \"cells\"\n    assert inst.productCode.coding[0].code == \"S1128\"\n    assert inst.productStatus.code == \"available\"\n    assert inst.property[0].type.coding[0].code == \"ABORhD\"\n    assert inst.property[0].valueCodeableConcept.coding[0].code == \"62\"\n    assert inst.property[0].valueCodeableConcept.coding[0].display == \"A RhD Positive\"\n    assert (\n        inst.property[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.isbt128.org/uri/ABORhD\"}\n        ).valueUri\n    )\n    assert inst.property[1].type.coding[0].code == \"CollectionType\"\n    assert inst.property[1].valueCodeableConcept.coding[0].code == \"1\"\n    assert (\n        inst.property[1].valueCodeableConcept.coding[0].display\n        == \"For Autologous Use Only\"\n    )\n    assert (\n        inst.property[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.isbt128.org/uri/CollectionType\"}\n        ).valueUri\n    )\n    assert inst.property[2].type.coding[0].code == \"BagVolume\"\n    assert (\n        inst.property[2].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.property[2].valueQuantity.unit == \"mL\"\n    assert float(inst.property[2].valueQuantity.value) == float(50)\n    assert inst.property[3].type.coding[0].code == \"74838-4\"\n    assert (\n        inst.property[3].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://ucum.org/\"}\n        ).valueUri\n    )\n    assert inst.property[3].valueQuantity.unit == \"10*6/mL\"\n    assert float(inst.property[3].valueQuantity.value) == float(2.6)\n    assert inst.request[0].display == \"Service Request for HCT Collection\"\n    assert (\n        inst.request[0].reference\n        == \"BiologicallyDerivedProduct/HCTcollection-servicerequest\"\n    )\n    assert (\n        inst.storageTempRequirements.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.storageTempRequirements.high.unit == \"degrees C\"\n    assert float(inst.storageTempRequirements.high.value) == float(-120)\n    assert inst.text.status == \"generated\"\n\n\ndef test_biologicallyderivedproduct_3(base_settings):\n    \"\"\"No. 3 tests collection for BiologicallyDerivedProduct.\n    Test File: biologicallyderivedproduct-example-autologousHCT.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"biologicallyderivedproduct-example-autologousHCT.json\"\n    )\n    inst = biologicallyderivedproduct.BiologicallyDerivedProduct.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"BiologicallyDerivedProduct\" == inst.get_resource_type()\n\n    impl_biologicallyderivedproduct_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"BiologicallyDerivedProduct\" == data[\"resourceType\"]\n\n    inst2 = biologicallyderivedproduct.BiologicallyDerivedProduct(**data)\n    impl_biologicallyderivedproduct_3(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_biologicallyderivedproductdispense.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProductDispense\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import biologicallyderivedproductdispense\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_biologicallyderivedproductdispense_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.display == \"Donald Duck\"\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.product.reference == \"BiologicallyDerivedProduct/prod1\"\n    assert inst.status == \"allocated\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_biologicallyderivedproductdispense_1(base_settings):\n    \"\"\"No. 1 tests collection for BiologicallyDerivedProductDispense.\n    Test File: biologicallyderivedproductdispense-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"biologicallyderivedproductdispense-example.json\"\n    )\n    inst = biologicallyderivedproductdispense.BiologicallyDerivedProductDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"BiologicallyDerivedProductDispense\" == inst.get_resource_type()\n\n    impl_biologicallyderivedproductdispense_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"BiologicallyDerivedProductDispense\" == data[\"resourceType\"]\n\n    inst2 = biologicallyderivedproductdispense.BiologicallyDerivedProductDispense(\n        **data\n    )\n    impl_biologicallyderivedproductdispense_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_bodystructure.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/BodyStructure\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import bodystructure\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_bodystructure_1(inst):\n    assert inst.description == \"EDD 1/1/2017 confirmation by LMP\"\n    assert inst.id == \"fetus\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealth.org/bodystructure/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.includedStructure[0].structure.coding[0].code == \"83418008\"\n    assert (\n        inst.includedStructure[0].structure.coding[0].display\n        == \"Entire fetus (body structure)\"\n    )\n    assert (\n        inst.includedStructure[0].structure.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.includedStructure[0].structure.text == \"Fetus\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_bodystructure_1(base_settings):\n    \"\"\"No. 1 tests collection for BodyStructure.\n    Test File: bodystructure-example-fetus.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"bodystructure-example-fetus.json\"\n    inst = bodystructure.BodyStructure.model_validate_json(filename.read_bytes())\n    assert \"BodyStructure\" == inst.get_resource_type()\n\n    impl_bodystructure_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"BodyStructure\" == data[\"resourceType\"]\n\n    inst2 = bodystructure.BodyStructure(**data)\n    impl_bodystructure_1(inst2)\n\n\ndef impl_bodystructure_2(inst):\n    assert inst.description == \"7 cm maximum diameter\"\n    assert inst.id == \"tumor\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealth.org/bodystructure/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.image[0].contentType == \"application/dicom\"\n    assert (\n        inst.image[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://imaging.acme.com/wado/server?requestType=WADO&amp;wado_details\"\n            }\n        ).valueUrl\n    )\n    assert inst.includedStructure[0].structure.coding[0].code == \"78961009\"\n    assert (\n        inst.includedStructure[0].structure.coding[0].display\n        == \"Splenic structure (body structure)\"\n    )\n    assert (\n        inst.includedStructure[0].structure.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.includedStructure[0].structure.text == \"Spleen\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.morphology.coding[0].code == \"4147007\"\n    assert inst.morphology.coding[0].display == \"Mass (morphologic abnormality)\"\n    assert (\n        inst.morphology.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.morphology.text == \"Splenic mass\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_bodystructure_2(base_settings):\n    \"\"\"No. 2 tests collection for BodyStructure.\n    Test File: bodystructure-example-tumor.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"bodystructure-example-tumor.json\"\n    inst = bodystructure.BodyStructure.model_validate_json(filename.read_bytes())\n    assert \"BodyStructure\" == inst.get_resource_type()\n\n    impl_bodystructure_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"BodyStructure\" == data[\"resourceType\"]\n\n    inst2 = bodystructure.BodyStructure(**data)\n    impl_bodystructure_2(inst2)\n\n\ndef impl_bodystructure_3(inst):\n    assert inst.active is False\n    assert inst.description == \"inner surface (volar) of the left forearm\"\n    assert inst.id == \"skin-patch\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealth.org/bodystructure/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.includedStructure[0].laterality.coding[0].code == \"419161000\"\n    assert inst.includedStructure[0].laterality.coding[0].display == \"Unilateral left\"\n    assert (\n        inst.includedStructure[0].laterality.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.includedStructure[0].laterality.text == \"Left\"\n    assert inst.includedStructure[0].qualifier[0].coding[0].code == \"263929005\"\n    assert inst.includedStructure[0].qualifier[0].coding[0].display == \"Volar\"\n    assert (\n        inst.includedStructure[0].qualifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.includedStructure[0].qualifier[0].text == \"Volar\"\n    assert inst.includedStructure[0].structure.coding[0].code == \"14975008\"\n    assert inst.includedStructure[0].structure.coding[0].display == \"Forearm\"\n    assert (\n        inst.includedStructure[0].structure.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.includedStructure[0].structure.text == \"Forearm\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.morphology.text == \"Skin patch\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_bodystructure_3(base_settings):\n    \"\"\"No. 3 tests collection for BodyStructure.\n    Test File: bodystructure-example-skin-patch.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"bodystructure-example-skin-patch.json\"\n    )\n    inst = bodystructure.BodyStructure.model_validate_json(filename.read_bytes())\n    assert \"BodyStructure\" == inst.get_resource_type()\n\n    impl_bodystructure_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"BodyStructure\" == data[\"resourceType\"]\n\n    inst2 = bodystructure.BodyStructure(**data)\n    impl_bodystructure_3(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_bundle.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Bundle\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import bundle\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_bundle_1(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:d195d9b8-6f78-4d71-9d22-3c1a923bfea5\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"d195d9b8-6f78-4d71-9d22-3c1a923bfea5\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://example.org/FHIR/R5/Encounter/2\"}\n        ).valueUri\n    )\n    assert inst.entry[1].request.method == \"PUT\"\n    assert (\n        inst.entry[1].request.url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter/2\"}).valueUri\n    )\n    assert inst.entry[1].resource.id == \"2\"\n    assert (\n        inst.entry[1].resource.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-08-07T10:49:22Z\"}\n        ).valueInstant\n    )\n    assert inst.entry[1].resource.meta.versionId == \"1\"\n    assert inst.entry[1].response.status == \"201\"\n    assert inst.id == \"00b99077-2bda-436e-98cc-a4f65d6c2fe0\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.timestamp\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2020-04-17T10:24:13.1882432-05:00\"}\n        ).valueInstant\n    )\n    assert inst.type == \"subscription-notification\"\n\n\ndef test_bundle_1(base_settings):\n    \"\"\"No. 1 tests collection for Bundle.\n    Test File: notification-full-resource.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"notification-full-resource.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_1(inst2)\n\n\ndef impl_bundle_2(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:2866af9c-137d-4458-a8a9-eeeec0ce5583\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"warning\"\n    assert inst.entry[0].search.mode == \"outcome\"\n    assert inst.id == \"bundle-search-warning\"\n    assert inst.link[0].relation == \"self\"\n    assert (\n        inst.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"https://example.org/fhir/Observation?patient.identifier=http://example.com/fhir/identifier/mrn|123456\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2017-03-14T08:23:30+11:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.total == 0\n    assert inst.type == \"searchset\"\n\n\ndef test_bundle_2(base_settings):\n    \"\"\"No. 2 tests collection for Bundle.\n    Test File: bundle-search-warning.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"bundle-search-warning.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_2(inst2)\n\n\ndef impl_bundle_3(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://example.com/base/DiagnosticReport/f202\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"f202\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://example.com/base/ServiceRequest/req\"}\n        ).valueUri\n    )\n    assert inst.entry[1].resource.id == \"req\"\n    assert inst.id == \"f202\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.type == \"collection\"\n\n\ndef test_bundle_3(base_settings):\n    \"\"\"No. 3 tests collection for Bundle.\n    Test File: diagnosticreport-example-f202-bloodculture.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"diagnosticreport-example-f202-bloodculture.json\"\n    )\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_3(inst2)\n\n\ndef impl_bundle_4(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:a5b053d4-2603-446f-ae86-f5853ac09334\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"a5b053d4-2603-446f-ae86-f5853ac09334\"\n    assert inst.id == \"3d20ea4b-90dc-4d0d-b15a-c7a893389401\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.timestamp\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2020-04-17T10:24:13.1882432-05:00\"}\n        ).valueInstant\n    )\n    assert inst.type == \"subscription-notification\"\n\n\ndef test_bundle_4(base_settings):\n    \"\"\"No. 4 tests collection for Bundle.\n    Test File: notification-heartbeat.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"notification-heartbeat.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_4(inst2)\n\n\ndef impl_bundle_5(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:d9d296d8-5afd-42e1-a0ce-3344e0e003ed\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"d9d296d8-5afd-42e1-a0ce-3344e0e003ed\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:03f9aa7d-b395-47b9-84e0-053678b6e4e3\"}\n        ).valueUri\n    )\n    assert inst.entry[1].resource.id == \"03f9aa7d-b395-47b9-84e0-053678b6e4e3\"\n    assert (\n        inst.entry[2].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ehr/fhir/Patient/pat1\"}\n        ).valueUri\n    )\n    assert inst.entry[2].resource.id == \"pat1\"\n    assert (\n        inst.entry[3].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ehr/fhir/Patient/pat12\"}\n        ).valueUri\n    )\n    assert inst.entry[3].resource.id == \"pat2\"\n    assert inst.id == \"3a0707d3-549e-4467-b8b8-5a2ab3800efe\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:example-org:receiver.identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"35f23e97-328c-4eb7-8e94-34f478983e89\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.timestamp\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-07-14T11:15:33+10:00\"}\n        ).valueInstant\n    )\n    assert inst.type == \"message\"\n\n\ndef test_bundle_5(base_settings):\n    \"\"\"No. 5 tests collection for Bundle.\n    Test File: message-response-link.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"message-response-link.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_5(inst2)\n\n\ndef impl_bundle_6(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:3fdc72f4-a11d-4a9d-9260-a9f745779e1d\"}\n        ).valueUri\n    )\n    assert inst.entry[0].request.method == \"POST\"\n    assert (\n        inst.entry[0].request.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"DocumentReference\"}\n        ).valueUri\n    )\n    assert (\n        inst.entry[0].resource.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-07-01T13:11:33Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://localhost:9556/svc/fhir/Patient/a2\"}\n        ).valueUri\n    )\n    assert (\n        inst.entry[1].request.ifNoneExist\n        == \"Patient?identifier=http://acme.org/xds/patients!89765a87b\"\n    )\n    assert inst.entry[1].request.method == \"POST\"\n    assert (\n        inst.entry[1].request.url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.entry[1].resource.id == \"a2\"\n    assert (\n        inst.entry[1].resource.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-07-01T13:11:33Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.entry[2].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://localhost:9556/svc/fhir/Practitioner/a3\"}\n        ).valueUri\n    )\n    assert inst.entry[2].request.method == \"POST\"\n    assert (\n        inst.entry[2].request.url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Practitioner\"}).valueUri\n    )\n    assert inst.entry[2].resource.id == \"a3\"\n    assert (\n        inst.entry[2].resource.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-07-01T13:11:33Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.entry[3].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://localhost:9556/svc/fhir/Practitioner/a4\"}\n        ).valueUri\n    )\n    assert inst.entry[3].request.method == \"POST\"\n    assert (\n        inst.entry[3].request.url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Practitioner\"}).valueUri\n    )\n    assert inst.entry[3].resource.id == \"a4\"\n    assert (\n        inst.entry[3].resource.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-07-01T13:11:33Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.entry[4].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://localhost:9556/svc/fhir/Binary/1e404af3-077f-4bee-b7a6-a9be97e1ce32\"\n            }\n        ).valueUri\n    )\n    assert inst.entry[4].request.method == \"POST\"\n    assert (\n        inst.entry[4].request.url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Binary\"}).valueUri\n    )\n    assert inst.entry[4].resource.id == \"1e404af3-077f-4bee-b7a6-a9be97e1ce32\"\n    assert (\n        inst.entry[4].resource.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-07-01T13:11:33Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"xds\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-07-01T13:11:33Z\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.type == \"transaction\"\n\n\ndef test_bundle_6(base_settings):\n    \"\"\"No. 6 tests collection for Bundle.\n    Test File: xds-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"xds-example.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_6(inst2)\n\n\ndef impl_bundle_7(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/DomainResource-text\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"DomainResource-text\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-content\"}\n        ).valueUri\n    )\n    assert inst.entry[1].resource.id == \"Resource-content\"\n    assert (\n        inst.entry[2].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-filter\"}\n        ).valueUri\n    )\n    assert inst.entry[2].resource.id == \"Resource-filter\"\n    assert (\n        inst.entry[3].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-has\"}\n        ).valueUri\n    )\n    assert inst.entry[3].resource.id == \"Resource-has\"\n    assert (\n        inst.entry[4].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-id\"}\n        ).valueUri\n    )\n    assert inst.entry[4].resource.id == \"Resource-id\"\n    assert (\n        inst.entry[5].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-in\"}\n        ).valueUri\n    )\n    assert inst.entry[5].resource.id == \"Resource-in\"\n    assert (\n        inst.entry[6].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-language\"}\n        ).valueUri\n    )\n    assert inst.entry[6].resource.id == \"Resource-language\"\n    assert (\n        inst.entry[7].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-lastUpdated\"}\n        ).valueUri\n    )\n    assert inst.entry[7].resource.id == \"Resource-lastUpdated\"\n    assert (\n        inst.entry[8].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-list\"}\n        ).valueUri\n    )\n    assert inst.entry[8].resource.id == \"Resource-list\"\n    assert (\n        inst.entry[9].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/Resource-profile\"}\n        ).valueUri\n    )\n    assert inst.entry[9].resource.id == \"Resource-profile\"\n    assert inst.id == \"searchParams\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.type == \"collection\"\n\n\ndef test_bundle_7(base_settings):\n    \"\"\"No. 7 tests collection for Bundle.\n    Test File: search-parameters.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"search-parameters.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_7(inst2)\n\n\ndef impl_bundle_8(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:267b18ce-3d37-4581-9baa-6fada338038b\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"267b18ce-3d37-4581-9baa-6fada338038b\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ehr/fhir/Patient/pat1\"}\n        ).valueUri\n    )\n    assert inst.entry[1].resource.id == \"pat1\"\n    assert (\n        inst.entry[2].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ehr/fhir/Patient/pat12\"}\n        ).valueUri\n    )\n    assert inst.entry[2].resource.id == \"pat2\"\n    assert inst.id == \"10bb101f-a121-4264-a920-67be9cb82c74\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:example-org:sender.identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"efdd254b-0e09-4164-883e-35cf3871715f\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.timestamp\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-07-14T11:15:33+10:00\"}\n        ).valueInstant\n    )\n    assert inst.type == \"message\"\n\n\ndef test_bundle_8(base_settings):\n    \"\"\"No. 8 tests collection for Bundle.\n    Test File: message-request-link.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"message-request-link.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_8(inst2)\n\n\ndef impl_bundle_9(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/product-status\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"product-status\"\n    assert (\n        inst.entry[1].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/publication-status\"}\n        ).valueUri\n    )\n    assert inst.entry[1].resource.id == \"publication-status\"\n    assert (\n        inst.entry[2].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/address-use\"}\n        ).valueUri\n    )\n    assert inst.entry[2].resource.id == \"address-use\"\n    assert (\n        inst.entry[3].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/FHIR-version\"}\n        ).valueUri\n    )\n    assert inst.entry[3].resource.id == \"FHIR-version\"\n    assert (\n        inst.entry[4].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/administrative-gender\"}\n        ).valueUri\n    )\n    assert inst.entry[4].resource.id == \"administrative-gender\"\n    assert (\n        inst.entry[5].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/property-representation\"}\n        ).valueUri\n    )\n    assert inst.entry[5].resource.id == \"property-representation\"\n    assert (\n        inst.entry[6].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/request-status\"}\n        ).valueUri\n    )\n    assert inst.entry[6].resource.id == \"request-status\"\n    assert (\n        inst.entry[7].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/reference-version-rules\"}\n        ).valueUri\n    )\n    assert inst.entry[7].resource.id == \"reference-version-rules\"\n    assert (\n        inst.entry[8].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/narrative-status\"}\n        ).valueUri\n    )\n    assert inst.entry[8].resource.id == \"narrative-status\"\n    assert (\n        inst.entry[9].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/contact-point-use\"}\n        ).valueUri\n    )\n    assert inst.entry[9].resource.id == \"contact-point-use\"\n    assert inst.id == \"terminologies\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.type == \"collection\"\n\n\ndef test_bundle_9(base_settings):\n    \"\"\"No. 9 tests collection for Bundle.\n    Test File: namingsystem-terminologies.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"namingsystem-terminologies.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_9(inst2)\n\n\ndef impl_bundle_10(inst):\n    assert (\n        inst.entry[0].fullUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:231e7f38-2dd1-45ac-9161-d7bd87c403bd\"}\n        ).valueUri\n    )\n    assert inst.entry[0].resource.id == \"231e7f38-2dd1-45ac-9161-d7bd87c403bd\"\n    assert inst.id == \"54f808cf-d159-4c9b-accb-c33eb20f0ecc\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.timestamp\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2020-04-17T10:24:13.1882432-05:00\"}\n        ).valueInstant\n    )\n    assert inst.type == \"subscription-notification\"\n\n\ndef test_bundle_10(base_settings):\n    \"\"\"No. 10 tests collection for Bundle.\n    Test File: notification-handshake.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"notification-handshake.json\"\n    inst = bundle.Bundle.model_validate_json(filename.read_bytes())\n    assert \"Bundle\" == inst.get_resource_type()\n\n    impl_bundle_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Bundle\" == data[\"resourceType\"]\n\n    inst2 = bundle.Bundle(**data)\n    impl_bundle_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_capabilitystatement.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CapabilityStatement\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import capabilitystatement\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_capabilitystatement_1(inst):\n    assert inst.contact[0].name == \"System Administrator\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].value == \"wile@acme.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Sample capability statement showing new MessageDefinition \" \"structure\"\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"5.0.0\"\n    assert inst.format[0] == \"xml\"\n    assert inst.format[1] == \"json\"\n    assert inst.id == \"messagedefinition\"\n    assert inst.implementation.description == \"Acme Message endpoint\"\n    assert (\n        inst.implementation.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://acem.com/fhir/message-drop\"}\n        ).valueUrl\n    )\n    assert inst.kind == \"instance\"\n    assert (\n        inst.messaging[0].documentation\n        == \"ADT A08 equivalent for external system notifications\"\n    )\n    assert (\n        inst.messaging[0].endpoint[0].address\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"mllp:10.1.1.10:9234\"}\n        ).valueUrl\n    )\n    assert inst.messaging[0].endpoint[0].protocol.code == \"mllp\"\n    assert (\n        inst.messaging[0].endpoint[0].protocol.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/message-transport\"}\n        ).valueUri\n    )\n    assert inst.messaging[0].reliableCache == 30\n    assert (\n        inst.messaging[0].supportedMessage[0].definition\n        == \"http://hl7.org/fhir/MessageDefinition/example\"\n    )\n    assert inst.messaging[0].supportedMessage[0].mode == \"receiver\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.publisher == \"ACME Corporation\"\n    assert inst.software.name == \"EHR\"\n    assert inst.status == \"draft\"\n\n\ndef test_capabilitystatement_1(base_settings):\n    \"\"\"No. 1 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-messagedefinition.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"capabilitystatement-messagedefinition.json\"\n    )\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_1(inst2)\n\n\ndef impl_capabilitystatement_2(inst):\n    assert inst.acceptLanguage[0] == \"en\"\n    assert inst.acceptLanguage[1] == \"es\"\n    assert inst.contact[0].name == \"System Administrator\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].value == \"wile@acme.org\"\n    assert inst.copyright == \"Copyright © Acme Healthcare and GoodCorp EHR Systems\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This is the FHIR capability statement for the main EHR at \"\n        \"ACME for the private interface - it does not describe the \"\n        \"public interface\"\n    )\n    assert (\n        inst.document[0].documentation\n        == \"Basic rules for all documents in the EHR system\"\n    )\n    assert inst.document[0].mode == \"consumer\"\n    assert inst.document[0].profile == (\n        \"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-\"\n        \"838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\"\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"5.0.0\"\n    assert inst.format[0] == \"xml\"\n    assert inst.format[1] == \"json\"\n    assert inst.id == \"example\"\n    assert inst.implementation.description == \"main EHR at ACME\"\n    assert (\n        inst.implementation.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://10.2.3.4/fhir\"}\n        ).valueUrl\n    )\n    assert inst.implementationGuide[0] == \"http://example.org/fhir/us/lab\"\n    assert inst.instantiates[0] == \"http://ihe.org/fhir/CapabilityStatement/pixm-client\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.kind == \"instance\"\n    assert (\n        inst.messaging[0].documentation\n        == \"ADT A08 equivalent for external system notifications\"\n    )\n    assert (\n        inst.messaging[0].endpoint[0].address\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"mllp:10.1.1.10:9234\"}\n        ).valueUrl\n    )\n    assert inst.messaging[0].endpoint[0].protocol.code == \"mllp\"\n    assert (\n        inst.messaging[0].endpoint[0].protocol.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/message-transport\"}\n        ).valueUri\n    )\n    assert inst.messaging[0].reliableCache == 30\n    assert (\n        inst.messaging[0].supportedMessage[0].definition\n        == \"http://hl7.org/fhir/MessageDefinition/example\"\n    )\n    assert inst.messaging[0].supportedMessage[0].mode == \"receiver\"\n    assert inst.name == \"ACMEEHR\"\n    assert inst.patchFormat[0] == \"application/xml-patch+xml\"\n    assert inst.patchFormat[1] == \"application/json-patch+json\"\n    assert inst.publisher == \"ACME Corporation\"\n    assert inst.purpose == (\n        \"Main EHR capability statement, published for contracting and\"\n        \" operational support\"\n    )\n    assert (\n        inst.rest[0].compartment[0]\n        == \"http://hl7.org/fhir/CompartmentDefinition/patient\"\n    )\n    assert inst.rest[0].documentation == \"Main FHIR endpoint for acem health\"\n    assert inst.rest[0].interaction[0].code == \"transaction\"\n    assert inst.rest[0].interaction[1].code == \"history-system\"\n    assert inst.rest[0].mode == \"server\"\n    assert inst.rest[0].resource[0].conditionalCreate is True\n    assert inst.rest[0].resource[0].conditionalDelete == \"not-supported\"\n    assert inst.rest[0].resource[0].conditionalPatch is False\n    assert inst.rest[0].resource[0].conditionalRead == \"full-support\"\n    assert inst.rest[0].resource[0].conditionalUpdate is False\n    assert (\n        inst.rest[0].resource[0].documentation\n        == \"This server does not let the clients create identities.\"\n    )\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[0].interaction[1].code == \"vread\"\n    assert (\n        inst.rest[0].resource[0].interaction[1].documentation\n        == \"Only supported for patient records since 12-Dec 2012\"\n    )\n    assert inst.rest[0].resource[0].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[0].interaction[3].code == \"history-instance\"\n    assert inst.rest[0].resource[0].interaction[4].code == \"create\"\n    assert inst.rest[0].resource[0].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[0].profile == (\n        \"http://registry.fhir.org/r5/StructureDefinition/7896271d-\"\n        \"57f6-4231-89dc-dcc91eab2416\"\n    )\n    assert inst.rest[0].resource[0].readHistory is True\n    assert inst.rest[0].resource[0].searchInclude[0] == \"Patient:organization\"\n    assert (\n        inst.rest[0].resource[0].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Patient-identifier\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[0].documentation\n        == \"Only supports search by institution MRN\"\n    )\n    assert inst.rest[0].resource[0].searchParam[0].name == \"identifier\"\n    assert inst.rest[0].resource[0].searchParam[0].type == \"token\"\n    assert inst.rest[0].resource[0].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/Patient-general-\" \"practitioner\"\n    )\n    assert inst.rest[0].resource[0].searchParam[1].name == \"general-practitioner\"\n    assert inst.rest[0].resource[0].searchParam[1].type == \"reference\"\n    assert inst.rest[0].resource[0].searchRevInclude[0] == \"Person:patient\"\n    assert inst.rest[0].resource[0].supportedProfile[0] == (\n        \"http://registry.fhir.org/r5/StructureDefinition/00ab9e7a-\"\n        \"06c7-4f77-9234-4154ca1e3347\"\n    )\n    assert inst.rest[0].resource[0].type == \"Patient\"\n    assert inst.rest[0].resource[0].updateCreate is False\n    assert inst.rest[0].resource[0].versioning == \"versioned-update\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.description == \"See Smart on FHIR documentation\"\n    assert inst.rest[0].security.service[0].coding[0].code == \"SMART-on-FHIR\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-security-service\"}\n        ).valueUri\n    )\n    assert inst.software.name == \"EHR\"\n    assert (\n        inst.software.releaseDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04\"}\n        ).valueDateTime\n    )\n    assert inst.software.version == \"0.00.020.2134\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"ACME EHR capability statement\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"positive\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variant-state\"}\n        ).valueUri\n    )\n    assert inst.version == \"20130510\"\n\n\ndef test_capabilitystatement_2(base_settings):\n    \"\"\"No. 2 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"capabilitystatement-example.json\"\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_2(inst2)\n\n\ndef impl_capabilitystatement_3(inst):\n    assert inst.contact[0].name == \"FHIR Project\"\n    assert inst.contact[0].telecom[0].system == \"other\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-09-16\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Basic conformance statement for a Measure Processor Service.\"\n        \" A server can support more functionality    than defined \"\n        \"here, but this is the minimum amount\"\n    )\n    assert inst.fhirVersion == \"5.0.0\"\n    assert inst.format[0] == \"json\"\n    assert inst.format[1] == \"xml\"\n    assert inst.id == \"measure-processor\"\n    assert inst.kind == \"capability\"\n    assert inst.name == \"MeasureProcessorServiceConformanceStatement\"\n    assert inst.publisher == \"HL7, Inc\"\n    assert inst.rest[0].documentation == \"RESTful Measure Processor Service\"\n    assert inst.rest[0].mode == \"server\"\n    assert inst.rest[0].operation[0].definition == (\n        \"http://hl7.org/fhir/OperationDefinition/Measure-evaluate-\" \"measure\"\n    )\n    assert inst.rest[0].operation[0].name == \"evaluate-measure\"\n    assert inst.rest[0].operation[1].definition == (\n        \"http://hl7.org/fhir/OperationDefinition/Measure-data-\" \"requirements\"\n    )\n    assert inst.rest[0].operation[1].name == \"data-requirements\"\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[0].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \" \"measures\"\n    )\n    assert inst.rest[0].resource[0].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[0].interaction[1].documentation == (\n        \"Search allows clients to filter measures based on a provided\"\n        \" search parameter\"\n    )\n    assert (\n        inst.rest[0].resource[0].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Measure\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-identifier\"\n    )\n    assert inst.rest[0].resource[0].searchParam[0].name == \"identifier\"\n    assert inst.rest[0].resource[0].searchParam[0].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-status\"\n    )\n    assert inst.rest[0].resource[0].searchParam[1].name == \"status\"\n    assert inst.rest[0].resource[0].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-version\"\n    )\n    assert inst.rest[0].resource[0].searchParam[2].name == \"version\"\n    assert inst.rest[0].resource[0].searchParam[2].type == \"token\"\n    assert inst.rest[0].resource[0].type == \"Measure\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.service[0].coding[0].code == \"Certificates\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-security-service\"}\n        ).valueUri\n    )\n    assert inst.software.name == \"ACME Measure Processor Service\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Measure Processor Service Conformance Statement\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/measure-processor\"}\n        ).valueUri\n    )\n\n\ndef test_capabilitystatement_3(base_settings):\n    \"\"\"No. 3 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-measure-processor.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"capabilitystatement-measure-processor.json\"\n    )\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_3(inst2)\n\n\ndef impl_capabilitystatement_4(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-09-01\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Example capability statement for a Terminology Server. A \"\n        \"server can support more fucntionality than defined here, but\"\n        \" this is the minimum amount\"\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"5.0.0\"\n    assert inst.format[0] == \"json\"\n    assert inst.format[1] == \"xml\"\n    assert inst.id == \"example-terminology-server\"\n    assert inst.implementation.description == \"The ACME FHIR Terminology Server\"\n    assert inst.kind == \"instance\"\n    assert inst.name == \"ACMETerminologyServiceCapabilityStatement\"\n    assert inst.rest[0].mode == \"server\"\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert (\n        inst.rest[0].resource[0].interaction[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[0].interaction[0].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].resource[0].interaction[1].code == \"search-type\"\n    assert (\n        inst.rest[0].resource[0].interaction[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[0].interaction[1].extension[0].valueCode == \"SHALL\"\n    assert (\n        inst.rest[0].resource[0].operation[0].definition\n        == \"http://hl7.org/fhir/OperationDefinition/CodeSystem-lookup\"\n    )\n    assert (\n        inst.rest[0].resource[0].operation[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[0].operation[0].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].resource[0].operation[0].name == \"expand\"\n    assert inst.rest[0].resource[0].operation[1].definition == (\n        \"http://hl7.org/fhir/OperationDefinition/CodeSystem-validate-\" \"code\"\n    )\n    assert (\n        inst.rest[0].resource[0].operation[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[0].operation[1].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].resource[0].operation[1].name == \"expand\"\n    assert (\n        inst.rest[0].resource[0].operation[2].definition\n        == \"http://hl7.org/fhir/OperationDefinition/CodeSystem-subsumes\"\n    )\n    assert (\n        inst.rest[0].resource[0].operation[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[0].operation[2].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].resource[0].operation[2].name == \"expand\"\n    assert (\n        inst.rest[0].resource[0].profile\n        == \"http://hl7.org/fhir/StructureDefinition/CodeSystem\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/CodeSystem-url\"\n    )\n    assert inst.rest[0].resource[0].searchParam[0].name == \"url\"\n    assert inst.rest[0].resource[0].searchParam[0].type == \"uri\"\n    assert (\n        inst.rest[0].resource[0].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/CodeSystem-version\"\n    )\n    assert inst.rest[0].resource[0].searchParam[1].name == \"version\"\n    assert inst.rest[0].resource[0].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/CodeSystem-name\"\n    )\n    assert inst.rest[0].resource[0].searchParam[2].name == \"name\"\n    assert inst.rest[0].resource[0].searchParam[2].type == \"string\"\n    assert (\n        inst.rest[0].resource[0].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/CodeSystem-title\"\n    )\n    assert inst.rest[0].resource[0].searchParam[3].name == \"title\"\n    assert inst.rest[0].resource[0].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[0].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/CodeSystem-status\"\n    )\n    assert inst.rest[0].resource[0].searchParam[4].name == \"status\"\n    assert inst.rest[0].resource[0].searchParam[4].type == \"token\"\n    assert inst.rest[0].resource[0].type == \"CodeSystem\"\n    assert inst.rest[0].resource[1].interaction[0].code == \"read\"\n    assert (\n        inst.rest[0].resource[1].interaction[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[1].interaction[0].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].resource[1].interaction[1].code == \"search-type\"\n    assert (\n        inst.rest[0].resource[1].interaction[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[1].interaction[1].extension[0].valueCode == \"SHALL\"\n    assert (\n        inst.rest[0].resource[1].operation[0].definition\n        == \"http://hl7.org/fhir/OperationDefinition/ValueSet-expand\"\n    )\n    assert (\n        inst.rest[0].resource[1].operation[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[1].operation[0].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].resource[1].operation[0].name == \"expand\"\n    assert inst.rest[0].resource[1].operation[1].definition == (\n        \"http://hl7.org/fhir/OperationDefinition/ValueSet-validate-\" \"code\"\n    )\n    assert (\n        inst.rest[0].resource[1].operation[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[1].operation[1].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].resource[1].operation[1].name == \"expand\"\n    assert (\n        inst.rest[0].resource[1].profile\n        == \"http://hl7.org/fhir/StructureDefinition/ValueSet\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/ValueSet-url\"\n    )\n    assert inst.rest[0].resource[1].searchParam[0].name == \"url\"\n    assert inst.rest[0].resource[1].searchParam[0].type == \"uri\"\n    assert (\n        inst.rest[0].resource[1].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/ValueSet-version\"\n    )\n    assert inst.rest[0].resource[1].searchParam[1].name == \"version\"\n    assert inst.rest[0].resource[1].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[1].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/ValueSet-name\"\n    )\n    assert inst.rest[0].resource[1].searchParam[2].name == \"name\"\n    assert inst.rest[0].resource[1].searchParam[2].type == \"string\"\n    assert (\n        inst.rest[0].resource[1].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/ValueSet-title\"\n    )\n    assert inst.rest[0].resource[1].searchParam[3].name == \"title\"\n    assert inst.rest[0].resource[1].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[1].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/ValueSet-status\"\n    )\n    assert inst.rest[0].resource[1].searchParam[4].name == \"status\"\n    assert inst.rest[0].resource[1].searchParam[4].type == \"token\"\n    assert inst.rest[0].resource[1].type == \"ValueSet\"\n    assert inst.rest[0].resource[2].interaction[0].code == \"read\"\n    assert (\n        inst.rest[0].resource[2].interaction[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[2].interaction[0].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].resource[2].interaction[1].code == \"search-type\"\n    assert (\n        inst.rest[0].resource[2].interaction[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[2].interaction[1].extension[0].valueCode == \"SHALL\"\n    assert (\n        inst.rest[0].resource[2].operation[0].definition\n        == \"http://hl7.org/fhir/OperationDefinition/ConceptMap-translate\"\n    )\n    assert (\n        inst.rest[0].resource[2].operation[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].resource[2].operation[0].extension[0].valueCode == \"SHALL\"\n    assert inst.rest[0].resource[2].operation[0].name == \"expand\"\n    assert (\n        inst.rest[0].resource[2].profile\n        == \"http://hl7.org/fhir/StructureDefinition/ConceptMap\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/ConceptMap-url\"\n    )\n    assert inst.rest[0].resource[2].searchParam[0].name == \"url\"\n    assert inst.rest[0].resource[2].searchParam[0].type == \"uri\"\n    assert (\n        inst.rest[0].resource[2].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/ConceptMap-version\"\n    )\n    assert inst.rest[0].resource[2].searchParam[1].name == \"version\"\n    assert inst.rest[0].resource[2].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[2].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/ConceptMap-name\"\n    )\n    assert inst.rest[0].resource[2].searchParam[2].name == \"name\"\n    assert inst.rest[0].resource[2].searchParam[2].type == \"string\"\n    assert (\n        inst.rest[0].resource[2].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/ConceptMap-title\"\n    )\n    assert inst.rest[0].resource[2].searchParam[3].name == \"title\"\n    assert inst.rest[0].resource[2].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[2].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/ConceptMap-status\"\n    )\n    assert inst.rest[0].resource[2].searchParam[4].name == \"status\"\n    assert inst.rest[0].resource[2].searchParam[4].type == \"token\"\n    assert inst.rest[0].resource[2].type == \"ConceptMap\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"ACME Terminology Service — Capability Statement\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CapabilityStatement/terminology-server\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_capabilitystatement_4(base_settings):\n    \"\"\"No. 4 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-terminology-server.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"capabilitystatement-terminology-server.json\"\n    )\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_4(inst2)\n\n\ndef impl_capabilitystatement_5(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"5.0.0\"\n    assert inst.format[0] == \"xml\"\n    assert inst.format[1] == \"json\"\n    assert inst.id == \"base2\"\n    assert inst.kind == \"capability\"\n    assert inst.name == \"Base FHIR Capability Statement (Empty)\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.rest[0].documentation == \"An empty Capability Statement\"\n    assert inst.rest[0].mode == \"server\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.description == (\n        \"This is the Capability Statement to declare that the server \"\n        \"supports SMART-on-FHIR. See the SMART-on-FHIR docs for the \"\n        \"extension that would go with such a server\"\n    )\n    assert inst.rest[0].security.service[0].coding[0].code == \"SMART-on-FHIR\"\n    assert inst.rest[0].security.service[0].coding[0].display == \"SMART-on-FHIR\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/restful-security-service\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].security.service[0].text == \"See http://docs.smarthealthit.org/\"\n    assert inst.software.name == \"Insert your software name here...\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CapabilityStatement/base2\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_capabilitystatement_5(base_settings):\n    \"\"\"No. 5 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-base2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"capabilitystatement-base2.json\"\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_5(inst2)\n\n\ndef impl_capabilitystatement_6(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-06-18\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Prototype Capability Statement for September 2013 \" \"Connectathon\"\n    )\n    assert inst.fhirVersion == \"5.0.0\"\n    assert inst.format[0] == \"json\"\n    assert inst.format[1] == \"xml\"\n    assert inst.id == \"phr\"\n    assert inst.kind == \"capability\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"PHRTemplate\"\n    assert inst.publisher == \"FHIR Project\"\n    assert inst.rest[0].documentation == (\n        \"Protoype server Capability Statement for September 2013 \" \"Connectathon\"\n    )\n    assert inst.rest[0].mode == \"server\"\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[0].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[0].interaction[1].documentation == (\n        \"When a client searches patients with no search criteria, \"\n        \"they get a list of all patients they have access too. \"\n        \"Servers may elect to offer additional search parameters, but\"\n        \" this is not required\"\n    )\n    assert inst.rest[0].resource[0].type == \"Patient\"\n    assert inst.rest[0].resource[1].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[1].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[1].searchParam[0].documentation == (\n        \"_id parameter always supported. For the connectathon, \"\n        \"servers may elect which search parameters are supported\"\n    )\n    assert inst.rest[0].resource[1].searchParam[0].name == \"_id\"\n    assert inst.rest[0].resource[1].searchParam[0].type == \"token\"\n    assert inst.rest[0].resource[1].type == \"DocumentReference\"\n    assert inst.rest[0].resource[2].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[2].interaction[1].code == \"search-type\"\n    assert (\n        inst.rest[0].resource[2].searchParam[0].documentation\n        == \"Standard _id parameter\"\n    )\n    assert inst.rest[0].resource[2].searchParam[0].name == \"_id\"\n    assert inst.rest[0].resource[2].searchParam[0].type == \"token\"\n    assert inst.rest[0].resource[2].type == \"Condition\"\n    assert inst.rest[0].resource[3].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[3].interaction[1].code == \"search-type\"\n    assert (\n        inst.rest[0].resource[3].searchParam[0].documentation\n        == \"Standard _id parameter\"\n    )\n    assert inst.rest[0].resource[3].searchParam[0].name == \"_id\"\n    assert inst.rest[0].resource[3].searchParam[0].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[1].documentation\n        == \"which diagnostic discipline/department created the report\"\n    )\n    assert inst.rest[0].resource[3].searchParam[1].name == \"service\"\n    assert inst.rest[0].resource[3].searchParam[1].type == \"token\"\n    assert inst.rest[0].resource[3].type == \"DiagnosticReport\"\n    assert inst.rest[0].security.service[0].text == \"OAuth\"\n    assert inst.software.name == \"ACME PHR Server\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"PHR Template\"\n\n\ndef test_capabilitystatement_6(base_settings):\n    \"\"\"No. 6 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-phr-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"capabilitystatement-phr-example.json\"\n    )\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_6(inst2)\n\n\ndef impl_capabilitystatement_7(inst):\n    assert inst.contact[0].name == \"FHIR Project\"\n    assert inst.contact[0].telecom[0].system == \"other\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-25\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Basic conformance statement for a Knowledge Repository \"\n        \"Service. A server can support more functionality    than \"\n        \"defined here, but this is the minimum amount\"\n    )\n    assert inst.fhirVersion == \"5.0.0\"\n    assert inst.format[0] == \"json\"\n    assert inst.format[1] == \"xml\"\n    assert inst.id == \"knowledge-repository\"\n    assert inst.kind == \"capability\"\n    assert inst.name == \"KnowledgeRepositoryServiceConformanceStatement\"\n    assert inst.publisher == \"HL7, Inc\"\n    assert inst.rest[0].documentation == \"RESTful Knowledge Repository Service\"\n    assert inst.rest[0].mode == \"server\"\n    assert inst.rest[0].operation[0].definition == (\n        \"http://hl7.org/fhir/OperationDefinition/Library-data-\" \"requirements\"\n    )\n    assert inst.rest[0].operation[0].name == \"data-requirements\"\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[0].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \" \"libraries\"\n    )\n    assert inst.rest[0].resource[0].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[0].interaction[1].documentation == (\n        \"Search allows clients to filter libraries based on a \"\n        \"provided search parameter\"\n    )\n    assert (\n        inst.rest[0].resource[0].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Library\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-description\"\n    )\n    assert inst.rest[0].resource[0].searchParam[0].name == \"description\"\n    assert inst.rest[0].resource[0].searchParam[0].type == \"string\"\n    assert (\n        inst.rest[0].resource[0].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-identifier\"\n    )\n    assert inst.rest[0].resource[0].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[0].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-status\"\n    )\n    assert inst.rest[0].resource[0].searchParam[2].name == \"status\"\n    assert inst.rest[0].resource[0].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-title\"\n    )\n    assert inst.rest[0].resource[0].searchParam[3].name == \"title\"\n    assert inst.rest[0].resource[0].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[0].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-topic\"\n    )\n    assert inst.rest[0].resource[0].searchParam[4].name == \"topic\"\n    assert inst.rest[0].resource[0].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-version\"\n    )\n    assert inst.rest[0].resource[0].searchParam[5].name == \"version\"\n    assert inst.rest[0].resource[0].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-composed-of\"\n    )\n    assert inst.rest[0].resource[0].searchParam[6].name == \"composed-of\"\n    assert inst.rest[0].resource[0].searchParam[6].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-depends-on\"\n    )\n    assert inst.rest[0].resource[0].searchParam[7].name == \"depends-on\"\n    assert inst.rest[0].resource[0].searchParam[7].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-derived-from\"\n    )\n    assert inst.rest[0].resource[0].searchParam[8].name == \"derived-from\"\n    assert inst.rest[0].resource[0].searchParam[8].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/Library-predecessor\"\n    )\n    assert inst.rest[0].resource[0].searchParam[9].name == \"predecessor\"\n    assert inst.rest[0].resource[0].searchParam[9].type == \"reference\"\n    assert inst.rest[0].resource[0].type == \"Library\"\n    assert inst.rest[0].resource[1].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[1].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \" \"plan definitions\"\n    )\n    assert inst.rest[0].resource[1].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[1].interaction[1].documentation == (\n        \"Search allows clients to filter plan definitions based on a \"\n        \"provided search parameter\"\n    )\n    assert (\n        inst.rest[0].resource[1].profile\n        == \"http://hl7.org/fhir/StructureDefinition/PlanDefinition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[0].definition == (\n        \"http://hl7.org/fhir/SearchParameter/PlanDefinition-\" \"description\"\n    )\n    assert inst.rest[0].resource[1].searchParam[0].name == \"description\"\n    assert inst.rest[0].resource[1].searchParam[0].type == \"string\"\n    assert inst.rest[0].resource[1].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/PlanDefinition-\" \"identifier\"\n    )\n    assert inst.rest[0].resource[1].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[1].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[1].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/PlanDefinition-status\"\n    )\n    assert inst.rest[0].resource[1].searchParam[2].name == \"status\"\n    assert inst.rest[0].resource[1].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[1].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/PlanDefinition-title\"\n    )\n    assert inst.rest[0].resource[1].searchParam[3].name == \"title\"\n    assert inst.rest[0].resource[1].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[1].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/PlanDefinition-topic\"\n    )\n    assert inst.rest[0].resource[1].searchParam[4].name == \"topic\"\n    assert inst.rest[0].resource[1].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].resource[1].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/PlanDefinition-version\"\n    )\n    assert inst.rest[0].resource[1].searchParam[5].name == \"version\"\n    assert inst.rest[0].resource[1].searchParam[5].type == \"token\"\n    assert inst.rest[0].resource[1].searchParam[6].definition == (\n        \"http://hl7.org/fhir/SearchParameter/PlanDefinition-composed-\" \"of\"\n    )\n    assert inst.rest[0].resource[1].searchParam[6].name == \"composed-of\"\n    assert inst.rest[0].resource[1].searchParam[6].type == \"reference\"\n    assert inst.rest[0].resource[1].searchParam[7].definition == (\n        \"http://hl7.org/fhir/SearchParameter/PlanDefinition-depends-\" \"on\"\n    )\n    assert inst.rest[0].resource[1].searchParam[7].name == \"depends-on\"\n    assert inst.rest[0].resource[1].searchParam[7].type == \"reference\"\n    assert inst.rest[0].resource[1].searchParam[8].definition == (\n        \"http://hl7.org/fhir/SearchParameter/PlanDefinition-derived-\" \"from\"\n    )\n    assert inst.rest[0].resource[1].searchParam[8].name == \"derived-from\"\n    assert inst.rest[0].resource[1].searchParam[8].type == \"reference\"\n    assert inst.rest[0].resource[1].searchParam[9].definition == (\n        \"http://hl7.org/fhir/SearchParameter/PlanDefinition-\" \"predecessor\"\n    )\n    assert inst.rest[0].resource[1].searchParam[9].name == \"predecessor\"\n    assert inst.rest[0].resource[1].searchParam[9].type == \"reference\"\n    assert inst.rest[0].resource[1].type == \"PlanDefinition\"\n    assert inst.rest[0].resource[2].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[2].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \"\n        \"activity definitions\"\n    )\n    assert inst.rest[0].resource[2].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[2].interaction[1].documentation == (\n        \"Search allows clients to filter activity definitions based \"\n        \"on a provided search parameter\"\n    )\n    assert (\n        inst.rest[0].resource[2].profile\n        == \"http://hl7.org/fhir/StructureDefinition/ActivityDefinition\"\n    )\n    assert inst.rest[0].resource[2].searchParam[0].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"description\"\n    )\n    assert inst.rest[0].resource[2].searchParam[0].name == \"description\"\n    assert inst.rest[0].resource[2].searchParam[0].type == \"string\"\n    assert inst.rest[0].resource[2].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"identifier\"\n    )\n    assert inst.rest[0].resource[2].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[2].searchParam[1].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[2].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"status\"\n    )\n    assert inst.rest[0].resource[2].searchParam[2].name == \"status\"\n    assert inst.rest[0].resource[2].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[2].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-title\"\n    )\n    assert inst.rest[0].resource[2].searchParam[3].name == \"title\"\n    assert inst.rest[0].resource[2].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[2].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-topic\"\n    )\n    assert inst.rest[0].resource[2].searchParam[4].name == \"topic\"\n    assert inst.rest[0].resource[2].searchParam[4].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[5].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"version\"\n    )\n    assert inst.rest[0].resource[2].searchParam[5].name == \"version\"\n    assert inst.rest[0].resource[2].searchParam[5].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[6].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"composed-of\"\n    )\n    assert inst.rest[0].resource[2].searchParam[6].name == \"composed-of\"\n    assert inst.rest[0].resource[2].searchParam[6].type == \"reference\"\n    assert inst.rest[0].resource[2].searchParam[7].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"depends-on\"\n    )\n    assert inst.rest[0].resource[2].searchParam[7].name == \"depends-on\"\n    assert inst.rest[0].resource[2].searchParam[7].type == \"reference\"\n    assert inst.rest[0].resource[2].searchParam[8].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"derived-from\"\n    )\n    assert inst.rest[0].resource[2].searchParam[8].name == \"derived-from\"\n    assert inst.rest[0].resource[2].searchParam[8].type == \"reference\"\n    assert inst.rest[0].resource[2].searchParam[9].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-\" \"predecessor\"\n    )\n    assert inst.rest[0].resource[2].searchParam[9].name == \"predecessor\"\n    assert inst.rest[0].resource[2].searchParam[9].type == \"reference\"\n    assert inst.rest[0].resource[2].type == \"ActivityDefinition\"\n    assert inst.rest[0].resource[3].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[3].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \" \"measures\"\n    )\n    assert inst.rest[0].resource[3].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[3].interaction[1].documentation == (\n        \"Search allows clients to filter measures based on a provided\"\n        \" search parameter\"\n    )\n    assert (\n        inst.rest[0].resource[3].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Measure\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-description\"\n    )\n    assert inst.rest[0].resource[3].searchParam[0].name == \"description\"\n    assert inst.rest[0].resource[3].searchParam[0].type == \"string\"\n    assert (\n        inst.rest[0].resource[3].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-identifier\"\n    )\n    assert inst.rest[0].resource[3].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[3].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-status\"\n    )\n    assert inst.rest[0].resource[3].searchParam[2].name == \"status\"\n    assert inst.rest[0].resource[3].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-title\"\n    )\n    assert inst.rest[0].resource[3].searchParam[3].name == \"title\"\n    assert inst.rest[0].resource[3].searchParam[3].type == \"string\"\n    assert (\n        inst.rest[0].resource[3].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-topic\"\n    )\n    assert inst.rest[0].resource[3].searchParam[4].name == \"topic\"\n    assert inst.rest[0].resource[3].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-version\"\n    )\n    assert inst.rest[0].resource[3].searchParam[5].name == \"version\"\n    assert inst.rest[0].resource[3].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[3].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-composed-of\"\n    )\n    assert inst.rest[0].resource[3].searchParam[6].name == \"composed-of\"\n    assert inst.rest[0].resource[3].searchParam[6].type == \"reference\"\n    assert (\n        inst.rest[0].resource[3].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-depends-on\"\n    )\n    assert inst.rest[0].resource[3].searchParam[7].name == \"depends-on\"\n    assert inst.rest[0].resource[3].searchParam[7].type == \"reference\"\n    assert (\n        inst.rest[0].resource[3].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-derived-from\"\n    )\n    assert inst.rest[0].resource[3].searchParam[8].name == \"derived-from\"\n    assert inst.rest[0].resource[3].searchParam[8].type == \"reference\"\n    assert (\n        inst.rest[0].resource[3].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/Measure-predecessor\"\n    )\n    assert inst.rest[0].resource[3].searchParam[9].name == \"predecessor\"\n    assert inst.rest[0].resource[3].searchParam[9].type == \"reference\"\n    assert inst.rest[0].resource[3].type == \"Measure\"\n    assert inst.rest[0].resource[4].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[4].interaction[0].documentation == (\n        \"Read allows clients to get the logical definitions of the \" \"measures\"\n    )\n    assert inst.rest[0].resource[4].interaction[1].code == \"search-type\"\n    assert inst.rest[0].resource[4].interaction[1].documentation == (\n        \"Search allows clients to filter measures based on a provided\"\n        \" search parameter\"\n    )\n    assert (\n        inst.rest[0].resource[4].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Questionnaire\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-code\"\n    )\n    assert inst.rest[0].resource[4].searchParam[0].name == \"code\"\n    assert inst.rest[0].resource[4].searchParam[0].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-context\"\n    )\n    assert inst.rest[0].resource[4].searchParam[1].name == \"context\"\n    assert inst.rest[0].resource[4].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-date\"\n    )\n    assert inst.rest[0].resource[4].searchParam[2].name == \"date\"\n    assert inst.rest[0].resource[4].searchParam[2].type == \"date\"\n    assert (\n        inst.rest[0].resource[4].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-identifier\"\n    )\n    assert inst.rest[0].resource[4].searchParam[3].name == \"identifier\"\n    assert inst.rest[0].resource[4].searchParam[3].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-publisher\"\n    )\n    assert inst.rest[0].resource[4].searchParam[4].name == \"publisher\"\n    assert inst.rest[0].resource[4].searchParam[4].type == \"string\"\n    assert (\n        inst.rest[0].resource[4].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-status\"\n    )\n    assert inst.rest[0].resource[4].searchParam[5].name == \"status\"\n    assert inst.rest[0].resource[4].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-title\"\n    )\n    assert inst.rest[0].resource[4].searchParam[6].name == \"title\"\n    assert inst.rest[0].resource[4].searchParam[6].type == \"string\"\n    assert (\n        inst.rest[0].resource[4].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/Questionnaire-version\"\n    )\n    assert inst.rest[0].resource[4].searchParam[7].name == \"version\"\n    assert inst.rest[0].resource[4].searchParam[7].type == \"token\"\n    assert inst.rest[0].resource[4].type == \"Questionnaire\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.service[0].coding[0].code == \"Certificates\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-security-service\"}\n        ).valueUri\n    )\n    assert inst.software.name == \"ACME Knowledge Repository Service\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Knowledge Repository Service Conformance Statement\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/knowledge-repository\"}\n        ).valueUri\n    )\n\n\ndef test_capabilitystatement_7(base_settings):\n    \"\"\"No. 7 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-knowledge-repository.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"capabilitystatement-knowledge-repository.json\"\n    )\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_7(inst2)\n\n\ndef impl_capabilitystatement_8(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.fhirVersion == \"5.0.0\"\n    assert inst.format[0] == \"xml\"\n    assert inst.format[1] == \"json\"\n    assert inst.id == \"base\"\n    assert inst.kind == \"capability\"\n    assert inst.name == \"Base FHIR Capability Statement (Full)\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.rest[0].documentation == \"All the functionality defined in FHIR\"\n    assert inst.rest[0].interaction[0].code == \"transaction\"\n    assert inst.rest[0].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].interaction[1].code == \"batch\"\n    assert inst.rest[0].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].interaction[2].code == \"history-system\"\n    assert inst.rest[0].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].interaction[3].code == \"search-system\"\n    assert inst.rest[0].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].mode == \"server\"\n    assert (\n        inst.rest[0].operation[0].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-validate\"\n    )\n    assert inst.rest[0].operation[0].name == \"validate\"\n    assert (\n        inst.rest[0].operation[1].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-meta\"\n    )\n    assert inst.rest[0].operation[1].name == \"meta\"\n    assert (\n        inst.rest[0].operation[2].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-meta-add\"\n    )\n    assert inst.rest[0].operation[2].name == \"meta-add\"\n    assert (\n        inst.rest[0].operation[3].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-meta-delete\"\n    )\n    assert inst.rest[0].operation[3].name == \"meta-delete\"\n    assert (\n        inst.rest[0].operation[4].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-convert\"\n    )\n    assert inst.rest[0].operation[4].name == \"convert\"\n    assert (\n        inst.rest[0].operation[5].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-graphql\"\n    )\n    assert inst.rest[0].operation[5].name == \"graphql\"\n    assert (\n        inst.rest[0].operation[6].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-graph\"\n    )\n    assert inst.rest[0].operation[6].name == \"graph\"\n    assert (\n        inst.rest[0].operation[7].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-add\"\n    )\n    assert inst.rest[0].operation[7].name == \"add\"\n    assert (\n        inst.rest[0].operation[8].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-remove\"\n    )\n    assert inst.rest[0].operation[8].name == \"remove\"\n    assert (\n        inst.rest[0].operation[9].definition\n        == \"http://hl7.org/fhir/OperationDefinition/resource-filter\"\n    )\n    assert inst.rest[0].operation[9].name == \"filter\"\n    assert inst.rest[0].resource[0].conditionalCreate is True\n    assert inst.rest[0].resource[0].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[0].conditionalUpdate is True\n    assert inst.rest[0].resource[0].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[0].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[0].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[0].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[0].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[0].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[0].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[0].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[0].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[0].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[0].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Account\"\n    )\n    assert inst.rest[0].resource[0].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[0].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[0].searchInclude[0] == \"Account.owner\"\n    assert inst.rest[0].resource[0].searchInclude[1] == \"Account.patient\"\n    assert inst.rest[0].resource[0].searchInclude[2] == \"Account.subject\"\n    assert inst.rest[0].resource[0].searchInclude[3] == \"Account.guarantor\"\n    assert inst.rest[0].resource[0].searchInclude[4] == \"Account.relatedaccount\"\n    assert (\n        inst.rest[0].resource[0].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-owner\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[0].documentation\n        == \"Entity managing the Account\"\n    )\n    assert inst.rest[0].resource[0].searchParam[0].name == \"owner\"\n    assert inst.rest[0].resource[0].searchParam[0].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-identifier\"\n    )\n    assert inst.rest[0].resource[0].searchParam[1].documentation == \"Account number\"\n    assert inst.rest[0].resource[0].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[0].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-period\"\n    )\n    assert inst.rest[0].resource[0].searchParam[2].documentation == \"Transaction window\"\n    assert inst.rest[0].resource[0].searchParam[2].name == \"period\"\n    assert inst.rest[0].resource[0].searchParam[2].type == \"date\"\n    assert (\n        inst.rest[0].resource[0].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-patient\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[3].documentation\n        == \"The entity that caused the expenses\"\n    )\n    assert inst.rest[0].resource[0].searchParam[3].name == \"patient\"\n    assert inst.rest[0].resource[0].searchParam[3].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-subject\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[4].documentation\n        == \"The entity that caused the expenses\"\n    )\n    assert inst.rest[0].resource[0].searchParam[4].name == \"subject\"\n    assert inst.rest[0].resource[0].searchParam[4].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-name\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[5].documentation == \"Human-readable label\"\n    )\n    assert inst.rest[0].resource[0].searchParam[5].name == \"name\"\n    assert inst.rest[0].resource[0].searchParam[5].type == \"string\"\n    assert (\n        inst.rest[0].resource[0].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-guarantor\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[6].documentation\n        == \"The parties ultimately responsible for balancing the Account\"\n    )\n    assert inst.rest[0].resource[0].searchParam[6].name == \"guarantor\"\n    assert inst.rest[0].resource[0].searchParam[6].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-type\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[7].documentation\n        == \"E.g. patient, expense, depreciation\"\n    )\n    assert inst.rest[0].resource[0].searchParam[7].name == \"type\"\n    assert inst.rest[0].resource[0].searchParam[7].type == \"token\"\n    assert (\n        inst.rest[0].resource[0].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-relatedaccount\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[8].documentation\n        == \"Parent and other related accounts\"\n    )\n    assert inst.rest[0].resource[0].searchParam[8].name == \"relatedaccount\"\n    assert inst.rest[0].resource[0].searchParam[8].type == \"reference\"\n    assert (\n        inst.rest[0].resource[0].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/Account-status\"\n    )\n    assert (\n        inst.rest[0].resource[0].searchParam[9].documentation\n        == \"active | inactive | entered-in-error | on-hold | unknown\"\n    )\n    assert inst.rest[0].resource[0].searchParam[9].name == \"status\"\n    assert inst.rest[0].resource[0].searchParam[9].type == \"token\"\n    assert inst.rest[0].resource[0].searchRevInclude[0] == \"Account.relatedaccount\"\n    assert inst.rest[0].resource[0].searchRevInclude[1] == \"ChargeItem.account\"\n    assert inst.rest[0].resource[0].searchRevInclude[2] == \"Encounter.account\"\n    assert inst.rest[0].resource[0].searchRevInclude[3] == \"Invoice.account\"\n    assert (\n        inst.rest[0].resource[0].searchRevInclude[4]\n        == \"PaymentReconciliation.allocation-account\"\n    )\n    assert inst.rest[0].resource[0].type == \"Account\"\n    assert inst.rest[0].resource[1].conditionalCreate is True\n    assert inst.rest[0].resource[1].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[1].conditionalUpdate is True\n    assert inst.rest[0].resource[1].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[1].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[1].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[1].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[1].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[1].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[1].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[1].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[1].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[1].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[1].profile\n        == \"http://hl7.org/fhir/StructureDefinition/ActivityDefinition\"\n    )\n    assert inst.rest[0].resource[1].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[1].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[1].searchInclude[0] == \"ActivityDefinition.successor\"\n    assert (\n        inst.rest[0].resource[1].searchInclude[1] == \"ActivityDefinition.derived-from\"\n    )\n    assert inst.rest[0].resource[1].searchInclude[2] == \"ActivityDefinition.predecessor\"\n    assert inst.rest[0].resource[1].searchInclude[3] == \"ActivityDefinition.composed-of\"\n    assert inst.rest[0].resource[1].searchInclude[4] == \"ActivityDefinition.depends-on\"\n    assert (\n        inst.rest[0].resource[1].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/CanonicalResource-date\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[0].documentation\n        == \"The activity definition publication date\"\n    )\n    assert inst.rest[0].resource[1].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[1].searchParam[0].type == \"date\"\n    assert inst.rest[0].resource[1].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/CanonicalResource-\" \"identifier\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[1].documentation\n        == \"External identifier for the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[1].searchParam[1].type == \"token\"\n    assert inst.rest[0].resource[1].searchParam[2].definition == (\n        \"http://hl7.org/fhir/SearchParameter/MetadataResource-\" \"successor\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[2].documentation\n        == \"What resource is being referenced\"\n    )\n    assert inst.rest[0].resource[1].searchParam[2].name == \"successor\"\n    assert inst.rest[0].resource[1].searchParam[2].type == \"reference\"\n    assert inst.rest[0].resource[1].searchParam[3].definition == (\n        \"http://hl7.org/fhir/SearchParameter/CanonicalResource-\" \"context-type-value\"\n    )\n    assert inst.rest[0].resource[1].searchParam[3].documentation == (\n        \"A use context type and value assigned to the activity \" \"definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[3].name == \"context-type-value\"\n    assert inst.rest[0].resource[1].searchParam[3].type == \"composite\"\n    assert (\n        inst.rest[0].resource[1].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/ActivityDefinition-kind\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[4].documentation\n        == \"The kind of activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[4].name == \"kind\"\n    assert inst.rest[0].resource[1].searchParam[4].type == \"token\"\n    assert inst.rest[0].resource[1].searchParam[5].definition == (\n        \"http://hl7.org/fhir/SearchParameter/CanonicalResource-\" \"jurisdiction\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[5].documentation\n        == \"Intended jurisdiction for the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[5].name == \"jurisdiction\"\n    assert inst.rest[0].resource[1].searchParam[5].type == \"token\"\n    assert inst.rest[0].resource[1].searchParam[6].definition == (\n        \"http://hl7.org/fhir/SearchParameter/MetadataResource-\" \"derived-from\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[6].documentation\n        == \"What resource is being referenced\"\n    )\n    assert inst.rest[0].resource[1].searchParam[6].name == \"derived-from\"\n    assert inst.rest[0].resource[1].searchParam[6].type == \"reference\"\n    assert inst.rest[0].resource[1].searchParam[7].definition == (\n        \"http://hl7.org/fhir/SearchParameter/CanonicalResource-\" \"description\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[7].documentation\n        == \"The description of the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[7].name == \"description\"\n    assert inst.rest[0].resource[1].searchParam[7].type == \"string\"\n    assert inst.rest[0].resource[1].searchParam[8].definition == (\n        \"http://hl7.org/fhir/SearchParameter/CanonicalResource-\" \"context-type\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[8].documentation\n        == \"A type of use context assigned to the activity definition\"\n    )\n    assert inst.rest[0].resource[1].searchParam[8].name == \"context-type\"\n    assert inst.rest[0].resource[1].searchParam[8].type == \"token\"\n    assert inst.rest[0].resource[1].searchParam[9].definition == (\n        \"http://hl7.org/fhir/SearchParameter/MetadataResource-\" \"predecessor\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchParam[9].documentation\n        == \"What resource is being referenced\"\n    )\n    assert inst.rest[0].resource[1].searchParam[9].name == \"predecessor\"\n    assert inst.rest[0].resource[1].searchParam[9].type == \"reference\"\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[0]\n        == \"CarePlan.instantiates-canonical\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[1] == \"ClinicalUseDefinition.product\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[2] == \"ClinicalUseDefinition.subject\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[3]\n        == \"Communication.instantiates-canonical\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[4]\n        == \"DeviceRequest.instantiates-canonical\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[5]\n        == \"FamilyMemberHistory.instantiates-canonical\"\n    )\n    assert inst.rest[0].resource[1].searchRevInclude[6] == \"MessageDefinition.parent\"\n    assert inst.rest[0].resource[1].searchRevInclude[7] == \"PlanDefinition.definition\"\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[8]\n        == \"Procedure.instantiates-canonical\"\n    )\n    assert (\n        inst.rest[0].resource[1].searchRevInclude[9] == \"RegulatedAuthorization.subject\"\n    )\n    assert inst.rest[0].resource[1].type == \"ActivityDefinition\"\n    assert inst.rest[0].resource[2].conditionalCreate is True\n    assert inst.rest[0].resource[2].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[2].conditionalUpdate is True\n    assert inst.rest[0].resource[2].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[2].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[2].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[2].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[2].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[2].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[2].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[2].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[2].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[2].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[2].profile\n        == \"http://hl7.org/fhir/StructureDefinition/ActorDefinition\"\n    )\n    assert inst.rest[0].resource[2].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[2].referencePolicy[1] == \"logical\"\n    assert (\n        inst.rest[0].resource[2].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/CanonicalResource-date\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[0].documentation\n        == \"The Actor Definition publication date\"\n    )\n    assert inst.rest[0].resource[2].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[2].searchParam[0].type == \"date\"\n    assert inst.rest[0].resource[2].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/CanonicalResource-\" \"identifier\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[1].documentation\n        == \"External identifier for the Actor Definition\"\n    )\n    assert inst.rest[0].resource[2].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[2].searchParam[1].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[2].definition == (\n        \"http://hl7.org/fhir/SearchParameter/CanonicalResource-\" \"context-type-value\"\n    )\n    assert inst.rest[0].resource[2].searchParam[2].documentation == (\n        \"A use context type and value assigned to the Actor \" \"Definition\"\n    )\n    assert inst.rest[0].resource[2].searchParam[2].name == \"context-type-value\"\n    assert inst.rest[0].resource[2].searchParam[2].type == \"composite\"\n    assert inst.rest[0].resource[2].searchParam[3].definition == (\n        \"http://hl7.org/fhir/SearchParameter/CanonicalResource-\" \"jurisdiction\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[3].documentation\n        == \"Intended jurisdiction for the Actor Definition\"\n    )\n    assert inst.rest[0].resource[2].searchParam[3].name == \"jurisdiction\"\n    assert inst.rest[0].resource[2].searchParam[3].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[4].definition == (\n        \"http://hl7.org/fhir/SearchParameter/CanonicalResource-\" \"description\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[4].documentation\n        == \"The description of the Actor Definition\"\n    )\n    assert inst.rest[0].resource[2].searchParam[4].name == \"description\"\n    assert inst.rest[0].resource[2].searchParam[4].type == \"string\"\n    assert inst.rest[0].resource[2].searchParam[5].definition == (\n        \"http://hl7.org/fhir/SearchParameter/CanonicalResource-\" \"context-type\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[5].documentation\n        == \"A type of use context assigned to the Actor Definition\"\n    )\n    assert inst.rest[0].resource[2].searchParam[5].name == \"context-type\"\n    assert inst.rest[0].resource[2].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[2].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/CanonicalResource-title\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[6].documentation\n        == \"The human-friendly name of the Actor Definition\"\n    )\n    assert inst.rest[0].resource[2].searchParam[6].name == \"title\"\n    assert inst.rest[0].resource[2].searchParam[6].type == \"string\"\n    assert (\n        inst.rest[0].resource[2].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/ActorDefinition-type\"\n    )\n    assert inst.rest[0].resource[2].searchParam[7].documentation == \"The type of actor\"\n    assert inst.rest[0].resource[2].searchParam[7].name == \"type\"\n    assert inst.rest[0].resource[2].searchParam[7].type == \"token\"\n    assert inst.rest[0].resource[2].searchParam[8].definition == (\n        \"http://hl7.org/fhir/SearchParameter/CanonicalResource-\" \"version\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[8].documentation\n        == \"The business version of the Actor Definition\"\n    )\n    assert inst.rest[0].resource[2].searchParam[8].name == \"version\"\n    assert inst.rest[0].resource[2].searchParam[8].type == \"token\"\n    assert (\n        inst.rest[0].resource[2].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/CanonicalResource-url\"\n    )\n    assert (\n        inst.rest[0].resource[2].searchParam[9].documentation\n        == \"The uri that identifies the Actor Definition\"\n    )\n    assert inst.rest[0].resource[2].searchParam[9].name == \"url\"\n    assert inst.rest[0].resource[2].searchParam[9].type == \"uri\"\n    assert inst.rest[0].resource[2].searchRevInclude[0] == \"Requirements.actor\"\n    assert inst.rest[0].resource[2].type == \"ActorDefinition\"\n    assert inst.rest[0].resource[3].conditionalCreate is True\n    assert inst.rest[0].resource[3].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[3].conditionalUpdate is True\n    assert inst.rest[0].resource[3].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[3].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[3].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[3].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[3].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[3].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[3].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[3].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[3].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[3].profile == (\n        \"http://hl7.org/fhir/StructureDefinition/AdministrableProduct\" \"Definition\"\n    )\n    assert inst.rest[0].resource[3].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[3].referencePolicy[1] == \"logical\"\n    assert (\n        inst.rest[0].resource[3].searchInclude[0]\n        == \"AdministrableProductDefinition.manufactured-item\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchInclude[1]\n        == \"AdministrableProductDefinition.device\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchInclude[2]\n        == \"AdministrableProductDefinition.form-of\"\n    )\n    assert inst.rest[0].resource[3].searchParam[0].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\"\n        \"nition-identifier\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[0].documentation\n        == \"An identifier for the administrable product\"\n    )\n    assert inst.rest[0].resource[3].searchParam[0].name == \"identifier\"\n    assert inst.rest[0].resource[3].searchParam[0].type == \"token\"\n    assert inst.rest[0].resource[3].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\"\n        \"nition-manufactured-item\"\n    )\n    assert inst.rest[0].resource[3].searchParam[1].name == \"manufactured-item\"\n    assert inst.rest[0].resource[3].searchParam[1].type == \"reference\"\n    assert inst.rest[0].resource[3].searchParam[2].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\"\n        \"nition-ingredient\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[2].documentation\n        == \"The ingredients of this administrable medicinal product\"\n    )\n    assert inst.rest[0].resource[3].searchParam[2].name == \"ingredient\"\n    assert inst.rest[0].resource[3].searchParam[2].type == \"token\"\n    assert inst.rest[0].resource[3].searchParam[3].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\" \"nition-route\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[3].documentation\n        == \"Coded expression for the route\"\n    )\n    assert inst.rest[0].resource[3].searchParam[3].name == \"route\"\n    assert inst.rest[0].resource[3].searchParam[3].type == \"token\"\n    assert inst.rest[0].resource[3].searchParam[4].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\"\n        \"nition-dose-form\"\n    )\n    assert inst.rest[0].resource[3].searchParam[4].documentation == (\n        \"The administrable dose form, i.e. the dose form of the final\"\n        \" product after necessary reconstitution or processing\"\n    )\n    assert inst.rest[0].resource[3].searchParam[4].name == \"dose-form\"\n    assert inst.rest[0].resource[3].searchParam[4].type == \"token\"\n    assert inst.rest[0].resource[3].searchParam[5].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\" \"nition-device\"\n    )\n    assert inst.rest[0].resource[3].searchParam[5].documentation == (\n        \"A device that is integral to the medicinal product, in \"\n        'effect being considered as an \"ingredient\" of the '\n        \"medicinal product. This is not intended for devices that are\"\n        \" just co-packaged\"\n    )\n    assert inst.rest[0].resource[3].searchParam[5].name == \"device\"\n    assert inst.rest[0].resource[3].searchParam[5].type == \"reference\"\n    assert inst.rest[0].resource[3].searchParam[6].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\" \"nition-form-of\"\n    )\n    assert inst.rest[0].resource[3].searchParam[6].documentation == (\n        \"The medicinal product that this is an administrable form of.\"\n        \" This is not a reference to the item(s) that make up this \"\n        \"administrable form - it is the whole product\"\n    )\n    assert inst.rest[0].resource[3].searchParam[6].name == \"form-of\"\n    assert inst.rest[0].resource[3].searchParam[6].type == \"reference\"\n    assert inst.rest[0].resource[3].searchParam[7].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\"\n        \"nition-target-species\"\n    )\n    assert (\n        inst.rest[0].resource[3].searchParam[7].documentation\n        == \"Coded expression for the species\"\n    )\n    assert inst.rest[0].resource[3].searchParam[7].name == \"target-species\"\n    assert inst.rest[0].resource[3].searchParam[7].type == \"token\"\n    assert inst.rest[0].resource[3].searchParam[8].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdministrableProductDefi\" \"nition-status\"\n    )\n    assert inst.rest[0].resource[3].searchParam[8].documentation == (\n        \"The status of this administrable product. Enables tracking \"\n        \"the life-cycle of the content.\"\n    )\n    assert inst.rest[0].resource[3].searchParam[8].name == \"status\"\n    assert inst.rest[0].resource[3].searchParam[8].type == \"token\"\n    assert inst.rest[0].resource[3].searchRevInclude[0] == \"Ingredient.for\"\n    assert inst.rest[0].resource[3].type == \"AdministrableProductDefinition\"\n    assert inst.rest[0].resource[4].conditionalCreate is True\n    assert inst.rest[0].resource[4].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[4].conditionalUpdate is True\n    assert inst.rest[0].resource[4].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[4].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[4].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[4].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[4].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[4].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[4].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[4].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[4].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[4].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[4].profile\n        == \"http://hl7.org/fhir/StructureDefinition/AdverseEvent\"\n    )\n    assert inst.rest[0].resource[4].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[4].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[4].searchInclude[0] == \"AdverseEvent.recorder\"\n    assert inst.rest[0].resource[4].searchInclude[1] == \"AdverseEvent.study\"\n    assert inst.rest[0].resource[4].searchInclude[2] == \"AdverseEvent.subject\"\n    assert inst.rest[0].resource[4].searchInclude[3] == \"AdverseEvent.substance\"\n    assert inst.rest[0].resource[4].searchInclude[4] == \"AdverseEvent.patient\"\n    assert inst.rest[0].resource[4].searchInclude[5] == \"AdverseEvent.resultingeffect\"\n    assert inst.rest[0].resource[4].searchInclude[6] == \"AdverseEvent.location\"\n    assert (\n        inst.rest[0].resource[4].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-date\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[0].documentation\n        == \"When the event occurred\"\n    )\n    assert inst.rest[0].resource[4].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[4].searchParam[0].type == \"date\"\n    assert (\n        inst.rest[0].resource[4].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-identifier\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[1].documentation\n        == \"Business identifier for the event\"\n    )\n    assert inst.rest[0].resource[4].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[4].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-recorder\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[2].documentation\n        == \"Who recorded the adverse event\"\n    )\n    assert inst.rest[0].resource[4].searchParam[2].name == \"recorder\"\n    assert inst.rest[0].resource[4].searchParam[2].type == \"reference\"\n    assert (\n        inst.rest[0].resource[4].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-study\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[3].documentation\n        == \"Research study that the subject is enrolled in\"\n    )\n    assert inst.rest[0].resource[4].searchParam[3].name == \"study\"\n    assert inst.rest[0].resource[4].searchParam[3].type == \"reference\"\n    assert (\n        inst.rest[0].resource[4].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-code\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[4].documentation\n        == \"Event or incident that occurred or was averted\"\n    )\n    assert inst.rest[0].resource[4].searchParam[4].name == \"code\"\n    assert inst.rest[0].resource[4].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-actuality\"\n    )\n    assert inst.rest[0].resource[4].searchParam[5].documentation == \"actual | potential\"\n    assert inst.rest[0].resource[4].searchParam[5].name == \"actuality\"\n    assert inst.rest[0].resource[4].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[4].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-subject\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[6].documentation\n        == \"Subject impacted by event\"\n    )\n    assert inst.rest[0].resource[4].searchParam[6].name == \"subject\"\n    assert inst.rest[0].resource[4].searchParam[6].type == \"reference\"\n    assert (\n        inst.rest[0].resource[4].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/AdverseEvent-substance\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[7].documentation\n        == \"Refers to the specific entity that caused the adverse event\"\n    )\n    assert inst.rest[0].resource[4].searchParam[7].name == \"substance\"\n    assert inst.rest[0].resource[4].searchParam[7].type == \"reference\"\n    assert (\n        inst.rest[0].resource[4].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-patient\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[8].documentation\n        == \"Subject impacted by event\"\n    )\n    assert inst.rest[0].resource[4].searchParam[8].name == \"patient\"\n    assert inst.rest[0].resource[4].searchParam[8].type == \"reference\"\n    assert inst.rest[0].resource[4].searchParam[9].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AdverseEvent-\" \"resultingeffect\"\n    )\n    assert (\n        inst.rest[0].resource[4].searchParam[9].documentation\n        == \"Effect on the subject due to this event\"\n    )\n    assert inst.rest[0].resource[4].searchParam[9].name == \"resultingeffect\"\n    assert inst.rest[0].resource[4].searchParam[9].type == \"reference\"\n    assert inst.rest[0].resource[4].type == \"AdverseEvent\"\n    assert inst.rest[0].resource[5].conditionalCreate is True\n    assert inst.rest[0].resource[5].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[5].conditionalUpdate is True\n    assert inst.rest[0].resource[5].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[5].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[5].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[5].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[5].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[5].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[5].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[5].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[5].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[5].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[5].profile\n        == \"http://hl7.org/fhir/StructureDefinition/AllergyIntolerance\"\n    )\n    assert inst.rest[0].resource[5].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[5].referencePolicy[1] == \"logical\"\n    assert (\n        inst.rest[0].resource[5].searchInclude[0]\n        == \"AllergyIntolerance.manifestation-reference\"\n    )\n    assert inst.rest[0].resource[5].searchInclude[1] == \"AllergyIntolerance.participant\"\n    assert inst.rest[0].resource[5].searchInclude[2] == \"AllergyIntolerance.patient\"\n    assert (\n        inst.rest[0].resource[5].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-date\"\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[0].documentation\n        == \"Date first version of the resource instance was recorded\"\n    )\n    assert inst.rest[0].resource[5].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[5].searchParam[0].type == \"date\"\n    assert inst.rest[0].resource[5].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-\" \"severity\"\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[1].documentation\n        == \"mild | moderate | severe (of event as a whole)\"\n    )\n    assert inst.rest[0].resource[5].searchParam[1].name == \"severity\"\n    assert inst.rest[0].resource[5].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[5].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-identifier\"\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[2].documentation\n        == \"External ids for this item\"\n    )\n    assert inst.rest[0].resource[5].searchParam[2].name == \"identifier\"\n    assert inst.rest[0].resource[5].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[5].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-code\"\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[3].documentation\n        == \"Code that identifies the allergy or intolerance\"\n    )\n    assert inst.rest[0].resource[5].searchParam[3].name == \"code\"\n    assert inst.rest[0].resource[5].searchParam[3].type == \"token\"\n    assert inst.rest[0].resource[5].searchParam[4].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-\" \"verification-status\"\n    )\n    assert inst.rest[0].resource[5].searchParam[4].documentation == (\n        \"unconfirmed | presumed | confirmed | refuted | entered-in-\" \"error\"\n    )\n    assert inst.rest[0].resource[5].searchParam[4].name == \"verification-status\"\n    assert inst.rest[0].resource[5].searchParam[4].type == \"token\"\n    assert inst.rest[0].resource[5].searchParam[5].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-\" \"criticality\"\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[5].documentation\n        == \"low | high | unable-to-assess\"\n    )\n    assert inst.rest[0].resource[5].searchParam[5].name == \"criticality\"\n    assert inst.rest[0].resource[5].searchParam[5].type == \"token\"\n    assert inst.rest[0].resource[5].searchParam[6].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-\"\n        \"manifestation-reference\"\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[6].documentation\n        == \"Clinical symptoms/signs associated with the Event\"\n    )\n    assert inst.rest[0].resource[5].searchParam[6].name == \"manifestation-reference\"\n    assert inst.rest[0].resource[5].searchParam[6].type == \"reference\"\n    assert inst.rest[0].resource[5].searchParam[7].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-\" \"clinical-status\"\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[7].documentation\n        == \"active | inactive | resolved\"\n    )\n    assert inst.rest[0].resource[5].searchParam[7].name == \"clinical-status\"\n    assert inst.rest[0].resource[5].searchParam[7].type == \"token\"\n    assert (\n        inst.rest[0].resource[5].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-type\"\n    )\n    assert (\n        inst.rest[0].resource[5].searchParam[8].documentation\n        == \"allergy | intolerance - Underlying mechanism (if known)\"\n    )\n    assert inst.rest[0].resource[5].searchParam[8].name == \"type\"\n    assert inst.rest[0].resource[5].searchParam[8].type == \"token\"\n    assert inst.rest[0].resource[5].searchParam[9].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-\" \"participant\"\n    )\n    assert inst.rest[0].resource[5].searchParam[9].documentation == (\n        \"Who or what participated in the activities related to the \"\n        \"allergy or intolerance\"\n    )\n    assert inst.rest[0].resource[5].searchParam[9].name == \"participant\"\n    assert inst.rest[0].resource[5].searchParam[9].type == \"reference\"\n    assert inst.rest[0].resource[5].searchRevInclude[0] == \"ClinicalImpression.problem\"\n    assert inst.rest[0].resource[5].type == \"AllergyIntolerance\"\n    assert inst.rest[0].resource[6].conditionalCreate is True\n    assert inst.rest[0].resource[6].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[6].conditionalUpdate is True\n    assert inst.rest[0].resource[6].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[6].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[6].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[6].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[6].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[6].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[6].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[6].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[6].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[6].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[6].profile\n        == \"http://hl7.org/fhir/StructureDefinition/Appointment\"\n    )\n    assert inst.rest[0].resource[6].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[6].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[6].searchInclude[0] == \"Appointment.practitioner\"\n    assert inst.rest[0].resource[6].searchInclude[1] == \"Appointment.subject\"\n    assert inst.rest[0].resource[6].searchInclude[2] == \"Appointment.slot\"\n    assert inst.rest[0].resource[6].searchInclude[3] == \"Appointment.actor\"\n    assert inst.rest[0].resource[6].searchInclude[4] == \"Appointment.based-on\"\n    assert inst.rest[0].resource[6].searchInclude[5] == \"Appointment.patient\"\n    assert inst.rest[0].resource[6].searchInclude[6] == \"Appointment.reason-reference\"\n    assert inst.rest[0].resource[6].searchInclude[7] == \"Appointment.supporting-info\"\n    assert inst.rest[0].resource[6].searchInclude[8] == \"Appointment.location\"\n    assert inst.rest[0].resource[6].searchInclude[9] == \"Appointment.group\"\n    assert (\n        inst.rest[0].resource[6].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-date\"\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[0].documentation\n        == \"Appointment date/time.\"\n    )\n    assert inst.rest[0].resource[6].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[6].searchParam[0].type == \"date\"\n    assert (\n        inst.rest[0].resource[6].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-identifier\"\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[1].documentation\n        == \"An Identifier of the Appointment\"\n    )\n    assert inst.rest[0].resource[6].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[6].searchParam[1].type == \"token\"\n    assert (\n        inst.rest[0].resource[6].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-specialty\"\n    )\n    assert inst.rest[0].resource[6].searchParam[2].documentation == (\n        \"The specialty of a practitioner that would be required to \"\n        \"perform the service requested in this appointment\"\n    )\n    assert inst.rest[0].resource[6].searchParam[2].name == \"specialty\"\n    assert inst.rest[0].resource[6].searchParam[2].type == \"token\"\n    assert inst.rest[0].resource[6].searchParam[3].definition == (\n        \"http://hl7.org/fhir/SearchParameter/Appointment-service-\" \"category\"\n    )\n    assert inst.rest[0].resource[6].searchParam[3].documentation == (\n        \"A broad categorization of the service that is to be \"\n        \"performed during this appointment\"\n    )\n    assert inst.rest[0].resource[6].searchParam[3].name == \"service-category\"\n    assert inst.rest[0].resource[6].searchParam[3].type == \"token\"\n    assert (\n        inst.rest[0].resource[6].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-practitioner\"\n    )\n    assert inst.rest[0].resource[6].searchParam[4].documentation == (\n        \"One of the individuals of the appointment is this \" \"practitioner\"\n    )\n    assert inst.rest[0].resource[6].searchParam[4].name == \"practitioner\"\n    assert inst.rest[0].resource[6].searchParam[4].type == \"reference\"\n    assert inst.rest[0].resource[6].searchParam[5].definition == (\n        \"http://hl7.org/fhir/SearchParameter/Appointment-appointment-\" \"type\"\n    )\n    assert inst.rest[0].resource[6].searchParam[5].documentation == (\n        \"The style of appointment or patient that has been booked in \"\n        \"the slot (not service type)\"\n    )\n    assert inst.rest[0].resource[6].searchParam[5].name == \"appointment-type\"\n    assert inst.rest[0].resource[6].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].resource[6].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-part-status\"\n    )\n    assert inst.rest[0].resource[6].searchParam[6].documentation == (\n        \"The Participation status of the subject, or other \"\n        \"participant on the appointment. Can be used to locate \"\n        \"participants that have not responded to meeting requests.\"\n    )\n    assert inst.rest[0].resource[6].searchParam[6].name == \"part-status\"\n    assert inst.rest[0].resource[6].searchParam[6].type == \"token\"\n    assert (\n        inst.rest[0].resource[6].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-subject\"\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[7].documentation\n        == \"One of the individuals of the appointment is this patient\"\n    )\n    assert inst.rest[0].resource[6].searchParam[7].name == \"subject\"\n    assert inst.rest[0].resource[6].searchParam[7].type == \"reference\"\n    assert (\n        inst.rest[0].resource[6].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-service-type\"\n    )\n    assert inst.rest[0].resource[6].searchParam[8].documentation == (\n        \"The specific service (by coding) that is to be performed \"\n        \"during this appointment\"\n    )\n    assert inst.rest[0].resource[6].searchParam[8].name == \"service-type\"\n    assert inst.rest[0].resource[6].searchParam[8].type == \"token\"\n    assert (\n        inst.rest[0].resource[6].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/Appointment-slot\"\n    )\n    assert (\n        inst.rest[0].resource[6].searchParam[9].documentation\n        == \"The slots that this appointment is filling\"\n    )\n    assert inst.rest[0].resource[6].searchParam[9].name == \"slot\"\n    assert inst.rest[0].resource[6].searchParam[9].type == \"reference\"\n    assert (\n        inst.rest[0].resource[6].searchRevInclude[0]\n        == \"AppointmentResponse.appointment\"\n    )\n    assert inst.rest[0].resource[6].searchRevInclude[1] == \"CarePlan.activity-reference\"\n    assert inst.rest[0].resource[6].searchRevInclude[2] == \"DocumentReference.based-on\"\n    assert inst.rest[0].resource[6].searchRevInclude[3] == \"DocumentReference.context\"\n    assert inst.rest[0].resource[6].searchRevInclude[4] == \"Encounter.appointment\"\n    assert inst.rest[0].resource[6].searchRevInclude[5] == \"ImagingSelection.based-on\"\n    assert inst.rest[0].resource[6].searchRevInclude[6] == \"ImagingStudy.based-on\"\n    assert inst.rest[0].resource[6].type == \"Appointment\"\n    assert inst.rest[0].resource[7].conditionalCreate is True\n    assert inst.rest[0].resource[7].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[7].conditionalUpdate is True\n    assert inst.rest[0].resource[7].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[7].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[7].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[7].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[7].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[7].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[7].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[7].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[7].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[7].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[7].profile\n        == \"http://hl7.org/fhir/StructureDefinition/AppointmentResponse\"\n    )\n    assert inst.rest[0].resource[7].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[7].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[7].searchInclude[0] == \"AppointmentResponse.actor\"\n    assert (\n        inst.rest[0].resource[7].searchInclude[1] == \"AppointmentResponse.practitioner\"\n    )\n    assert inst.rest[0].resource[7].searchInclude[2] == \"AppointmentResponse.patient\"\n    assert (\n        inst.rest[0].resource[7].searchInclude[3] == \"AppointmentResponse.appointment\"\n    )\n    assert inst.rest[0].resource[7].searchInclude[4] == \"AppointmentResponse.location\"\n    assert inst.rest[0].resource[7].searchInclude[5] == \"AppointmentResponse.group\"\n    assert inst.rest[0].resource[7].searchParam[0].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"actor\"\n    )\n    assert inst.rest[0].resource[7].searchParam[0].documentation == (\n        \"The Person, Location/HealthcareService or Device that this \"\n        \"appointment response replies for\"\n    )\n    assert inst.rest[0].resource[7].searchParam[0].name == \"actor\"\n    assert inst.rest[0].resource[7].searchParam[0].type == \"reference\"\n    assert (\n        inst.rest[0].resource[7].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-identifier\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[1].documentation\n        == \"An Identifier in this appointment response\"\n    )\n    assert inst.rest[0].resource[7].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[7].searchParam[1].type == \"token\"\n    assert inst.rest[0].resource[7].searchParam[2].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"practitioner\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[2].documentation\n        == \"This Response is for this Practitioner\"\n    )\n    assert inst.rest[0].resource[7].searchParam[2].name == \"practitioner\"\n    assert inst.rest[0].resource[7].searchParam[2].type == \"reference\"\n    assert inst.rest[0].resource[7].searchParam[3].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"part-status\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[3].documentation\n        == \"The participants acceptance status for this appointment\"\n    )\n    assert inst.rest[0].resource[7].searchParam[3].name == \"part-status\"\n    assert inst.rest[0].resource[7].searchParam[3].type == \"token\"\n    assert (\n        inst.rest[0].resource[7].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-patient\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[4].documentation\n        == \"This Response is for this Patient\"\n    )\n    assert inst.rest[0].resource[7].searchParam[4].name == \"patient\"\n    assert inst.rest[0].resource[7].searchParam[4].type == \"reference\"\n    assert inst.rest[0].resource[7].searchParam[5].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"appointment\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[5].documentation\n        == \"The appointment that the response is attached to\"\n    )\n    assert inst.rest[0].resource[7].searchParam[5].name == \"appointment\"\n    assert inst.rest[0].resource[7].searchParam[5].type == \"reference\"\n    assert inst.rest[0].resource[7].searchParam[6].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"location\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[6].documentation\n        == \"This Response is for this Location\"\n    )\n    assert inst.rest[0].resource[7].searchParam[6].name == \"location\"\n    assert inst.rest[0].resource[7].searchParam[6].type == \"reference\"\n    assert inst.rest[0].resource[7].searchParam[7].definition == (\n        \"http://hl7.org/fhir/SearchParameter/AppointmentResponse-\" \"group\"\n    )\n    assert (\n        inst.rest[0].resource[7].searchParam[7].documentation\n        == \"This Response is for this Group\"\n    )\n    assert inst.rest[0].resource[7].searchParam[7].name == \"group\"\n    assert inst.rest[0].resource[7].searchParam[7].type == \"reference\"\n    assert inst.rest[0].resource[7].searchRevInclude[0] == \"DocumentReference.based-on\"\n    assert inst.rest[0].resource[7].searchRevInclude[1] == \"ImagingSelection.based-on\"\n    assert inst.rest[0].resource[7].searchRevInclude[2] == \"ImagingStudy.based-on\"\n    assert inst.rest[0].resource[7].type == \"AppointmentResponse\"\n    assert inst.rest[0].resource[8].conditionalCreate is True\n    assert inst.rest[0].resource[8].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[8].conditionalUpdate is True\n    assert inst.rest[0].resource[8].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[8].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[8].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[8].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[8].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[8].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[8].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[8].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[8].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[8].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[8].profile\n        == \"http://hl7.org/fhir/StructureDefinition/ArtifactAssessment\"\n    )\n    assert inst.rest[0].resource[8].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[8].referencePolicy[1] == \"logical\"\n    assert (\n        inst.rest[0].resource[8].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/ArtifactAssessment-date\"\n    )\n    assert (\n        inst.rest[0].resource[8].searchParam[0].documentation\n        == \"The artifact assessment publication date\"\n    )\n    assert inst.rest[0].resource[8].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[8].searchParam[0].type == \"date\"\n    assert inst.rest[0].resource[8].searchParam[1].definition == (\n        \"http://hl7.org/fhir/SearchParameter/ArtifactAssessment-\" \"identifier\"\n    )\n    assert (\n        inst.rest[0].resource[8].searchParam[1].documentation\n        == \"The artifact assessment identifier\"\n    )\n    assert inst.rest[0].resource[8].searchParam[1].name == \"identifier\"\n    assert inst.rest[0].resource[8].searchParam[1].type == \"token\"\n    assert inst.rest[0].resource[8].type == \"ArtifactAssessment\"\n    assert inst.rest[0].resource[9].conditionalCreate is True\n    assert inst.rest[0].resource[9].conditionalDelete == \"multiple\"\n    assert inst.rest[0].resource[9].conditionalUpdate is True\n    assert inst.rest[0].resource[9].interaction[0].code == \"read\"\n    assert inst.rest[0].resource[9].interaction[0].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[1].code == \"vread\"\n    assert inst.rest[0].resource[9].interaction[1].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[2].code == \"update\"\n    assert inst.rest[0].resource[9].interaction[2].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[3].code == \"delete\"\n    assert inst.rest[0].resource[9].interaction[3].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[4].code == \"history-instance\"\n    assert inst.rest[0].resource[9].interaction[4].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[5].code == \"history-type\"\n    assert inst.rest[0].resource[9].interaction[5].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[6].code == \"create\"\n    assert inst.rest[0].resource[9].interaction[6].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert inst.rest[0].resource[9].interaction[7].code == \"search-type\"\n    assert inst.rest[0].resource[9].interaction[7].documentation == (\n        \"Implemented per the specification (or Insert other doco \" \"here)\"\n    )\n    assert (\n        inst.rest[0].resource[9].profile\n        == \"http://hl7.org/fhir/StructureDefinition/AuditEvent\"\n    )\n    assert inst.rest[0].resource[9].referencePolicy[0] == \"literal\"\n    assert inst.rest[0].resource[9].referencePolicy[1] == \"logical\"\n    assert inst.rest[0].resource[9].searchInclude[0] == \"AuditEvent.agent\"\n    assert inst.rest[0].resource[9].searchInclude[1] == \"AuditEvent.encounter\"\n    assert inst.rest[0].resource[9].searchInclude[2] == \"AuditEvent.source\"\n    assert inst.rest[0].resource[9].searchInclude[3] == \"AuditEvent.based-on\"\n    assert inst.rest[0].resource[9].searchInclude[4] == \"AuditEvent.patient\"\n    assert inst.rest[0].resource[9].searchInclude[5] == \"AuditEvent.entity\"\n    assert (\n        inst.rest[0].resource[9].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-date\"\n    )\n    assert (\n        inst.rest[0].resource[9].searchParam[0].documentation\n        == \"Time when the event was recorded\"\n    )\n    assert inst.rest[0].resource[9].searchParam[0].name == \"date\"\n    assert inst.rest[0].resource[9].searchParam[0].type == \"date\"\n    assert (\n        inst.rest[0].resource[9].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-agent\"\n    )\n    assert inst.rest[0].resource[9].searchParam[1].documentation == \"Identifier of who\"\n    assert inst.rest[0].resource[9].searchParam[1].name == \"agent\"\n    assert inst.rest[0].resource[9].searchParam[1].type == \"reference\"\n    assert (\n        inst.rest[0].resource[9].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-entity-role\"\n    )\n    assert (\n        inst.rest[0].resource[9].searchParam[2].documentation\n        == \"What role the entity played\"\n    )\n    assert inst.rest[0].resource[9].searchParam[2].name == \"entity-role\"\n    assert inst.rest[0].resource[9].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].resource[9].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-code\"\n    )\n    assert (\n        inst.rest[0].resource[9].searchParam[3].documentation\n        == \"More specific code for the event\"\n    )\n    assert inst.rest[0].resource[9].searchParam[3].name == \"code\"\n    assert inst.rest[0].resource[9].searchParam[3].type == \"token\"\n    assert (\n        inst.rest[0].resource[9].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-purpose\"\n    )\n    assert (\n        inst.rest[0].resource[9].searchParam[4].documentation\n        == \"The authorization (purposeOfUse) of the event\"\n    )\n    assert inst.rest[0].resource[9].searchParam[4].name == \"purpose\"\n    assert inst.rest[0].resource[9].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].resource[9].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-encounter\"\n    )\n    assert (\n        inst.rest[0].resource[9].searchParam[5].documentation\n        == \"Encounter related to the activity recorded in the AuditEvent\"\n    )\n    assert inst.rest[0].resource[9].searchParam[5].name == \"encounter\"\n    assert inst.rest[0].resource[9].searchParam[5].type == \"reference\"\n    assert (\n        inst.rest[0].resource[9].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-source\"\n    )\n    assert (\n        inst.rest[0].resource[9].searchParam[6].documentation\n        == \"The identity of source detecting the event\"\n    )\n    assert inst.rest[0].resource[9].searchParam[6].name == \"source\"\n    assert inst.rest[0].resource[9].searchParam[6].type == \"reference\"\n    assert (\n        inst.rest[0].resource[9].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-based-on\"\n    )\n    assert (\n        inst.rest[0].resource[9].searchParam[7].documentation\n        == \"Reference to the service request.\"\n    )\n    assert inst.rest[0].resource[9].searchParam[7].name == \"based-on\"\n    assert inst.rest[0].resource[9].searchParam[7].type == \"reference\"\n    assert (\n        inst.rest[0].resource[9].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/clinical-patient\"\n    )\n    assert (\n        inst.rest[0].resource[9].searchParam[8].documentation\n        == \"Where the activity involved patient data\"\n    )\n    assert inst.rest[0].resource[9].searchParam[8].name == \"patient\"\n    assert inst.rest[0].resource[9].searchParam[8].type == \"reference\"\n    assert (\n        inst.rest[0].resource[9].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/AuditEvent-action\"\n    )\n    assert (\n        inst.rest[0].resource[9].searchParam[9].documentation\n        == \"Type of action performed during the event\"\n    )\n    assert inst.rest[0].resource[9].searchParam[9].name == \"action\"\n    assert inst.rest[0].resource[9].searchParam[9].type == \"token\"\n    assert inst.rest[0].resource[9].type == \"AuditEvent\"\n    assert (\n        inst.rest[0].searchParam[0].definition\n        == \"http://hl7.org/fhir/SearchParameter/DomainResource-text\"\n    )\n    assert (\n        inst.rest[0].searchParam[0].documentation\n        == \"Search on the narrative of the resource\"\n    )\n    assert inst.rest[0].searchParam[0].name == \"_text\"\n    assert inst.rest[0].searchParam[0].type == \"special\"\n    assert (\n        inst.rest[0].searchParam[1].definition\n        == \"http://hl7.org/fhir/SearchParameter/id\"\n    )\n    assert inst.rest[0].searchParam[1].documentation == \"some doco\"\n    assert inst.rest[0].searchParam[1].name == \"_id\"\n    assert inst.rest[0].searchParam[1].type == \"string\"\n    assert (\n        inst.rest[0].searchParam[2].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-list\"\n    )\n    assert inst.rest[0].searchParam[2].documentation == (\n        \"Retrieval of resources that are referenced by a List \" \"resource\"\n    )\n    assert inst.rest[0].searchParam[2].name == \"_list\"\n    assert inst.rest[0].searchParam[2].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[3].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-has\"\n    )\n    assert (\n        inst.rest[0].searchParam[3].documentation\n        == \"Provides support for reverse chaining\"\n    )\n    assert inst.rest[0].searchParam[3].name == \"_has\"\n    assert inst.rest[0].searchParam[3].type == \"composite\"\n    assert (\n        inst.rest[0].searchParam[4].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-type\"\n    )\n    assert (\n        inst.rest[0].searchParam[4].documentation\n        == \"Type of resource (when doing cross-resource search\"\n    )\n    assert inst.rest[0].searchParam[4].name == \"_type\"\n    assert inst.rest[0].searchParam[4].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[5].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-source\"\n    )\n    assert (\n        inst.rest[0].searchParam[5].documentation\n        == \"How to sort the resources when returning\"\n    )\n    assert inst.rest[0].searchParam[5].name == \"_sort\"\n    assert inst.rest[0].searchParam[5].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[6].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-count\"\n    )\n    assert inst.rest[0].searchParam[6].documentation == \"How many resources to return\"\n    assert inst.rest[0].searchParam[6].name == \"_count\"\n    assert inst.rest[0].searchParam[6].type == \"number\"\n    assert (\n        inst.rest[0].searchParam[7].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-include\"\n    )\n    assert (\n        inst.rest[0].searchParam[7].documentation\n        == \"Control over returning additional resources (see spec)\"\n    )\n    assert inst.rest[0].searchParam[7].name == \"_include\"\n    assert inst.rest[0].searchParam[7].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[8].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-revinclude\"\n    )\n    assert (\n        inst.rest[0].searchParam[8].documentation\n        == \"Control over returning additional resources (see spec)\"\n    )\n    assert inst.rest[0].searchParam[8].name == \"_revinclude\"\n    assert inst.rest[0].searchParam[8].type == \"token\"\n    assert (\n        inst.rest[0].searchParam[9].definition\n        == \"http://hl7.org/fhir/SearchParameter/Resource-summary\"\n    )\n    assert (\n        inst.rest[0].searchParam[9].documentation\n        == \"What kind of information to return\"\n    )\n    assert inst.rest[0].searchParam[9].name == \"_summary\"\n    assert inst.rest[0].searchParam[9].type == \"token\"\n    assert inst.rest[0].security.cors is True\n    assert inst.rest[0].security.description == (\n        \"This is the Capability Statement to declare that the server \"\n        \"supports SMART-on-FHIR. See the SMART-on-FHIR docs for the \"\n        \"extension that would go with such a server\"\n    )\n    assert inst.rest[0].security.service[0].coding[0].code == \"SMART-on-FHIR\"\n    assert inst.rest[0].security.service[0].coding[0].display == \"SMART-on-FHIR\"\n    assert (\n        inst.rest[0].security.service[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/restful-security-service\"\n            }\n        ).valueUri\n    )\n    assert inst.rest[0].security.service[0].text == \"See http://docs.smarthealthit.org/\"\n    assert inst.software.name == \"Insert your software name here...\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CapabilityStatement/base\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_capabilitystatement_8(base_settings):\n    \"\"\"No. 8 tests collection for CapabilityStatement.\n    Test File: capabilitystatement-base.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"capabilitystatement-base.json\"\n    inst = capabilitystatement.CapabilityStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CapabilityStatement\" == inst.get_resource_type()\n\n    impl_capabilitystatement_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CapabilityStatement\" == data[\"resourceType\"]\n\n    inst2 = capabilitystatement.CapabilityStatement(**data)\n    impl_capabilitystatement_8(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_careplan.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CarePlan\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import careplan\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_careplan_1(inst):\n    assert inst.activity[0].plannedActivityReference.reference == \"#activity\"\n    assert inst.addresses[0].reference.display == \"?????\"\n    assert inst.addresses[0].reference.reference == \"Condition/f201\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"careteam\"\n    assert inst.contained[1].id == \"goal\"\n    assert inst.contained[2].id == \"activity\"\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"f002\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/careplans\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"CP2934\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-07-07\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-07-06\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_careplan_1(base_settings):\n    \"\"\"No. 1 tests collection for CarePlan.\n    Test File: careplan-example-f002-lung.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-f002-lung.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_1(inst2)\n\n\ndef impl_careplan_2(inst):\n    assert (\n        inst.activity[0].performedActivity[0].reference.display == \"Roel's Chemotherapy\"\n    )\n    assert inst.activity[0].performedActivity[0].reference.reference == \"Procedure/f201\"\n    assert (\n        inst.activity[0].plannedActivityReference.reference\n        == \"RequestOrchestration/example\"\n    )\n    assert inst.addresses[0].reference.display == \"Roel's head-neck tumor\"\n    assert inst.addresses[0].reference.reference == \"Condition/f202\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"careteam\"\n    assert inst.contained[1].id == \"goal\"\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"f202\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_careplan_2(base_settings):\n    \"\"\"No. 2 tests collection for CarePlan.\n    Test File: careplan-example-f202-malignancy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"careplan-example-f202-malignancy.json\"\n    )\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_2(inst2)\n\n\ndef impl_careplan_3(inst):\n    assert inst.id == \"obesity-narrative\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_careplan_3(base_settings):\n    \"\"\"No. 3 tests collection for CarePlan.\n    Test File: careplan-example-obesity-narrative.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"careplan-example-obesity-narrative.json\"\n    )\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_3(inst2)\n\n\ndef impl_careplan_4(inst):\n    assert inst.activity[0].performedActivity[0].concept.coding[0].code == \"6397004\"\n    assert (\n        inst.activity[0].performedActivity[0].concept.coding[0].display\n        == \"Muscular strength development exercise\"\n    )\n    assert (\n        inst.activity[0].performedActivity[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.activity[0].plannedActivityReference.reference\n        == \"ServiceRequest/benchpress\"\n    )\n    assert inst.addresses[0].reference.display == \"obesity\"\n    assert inst.addresses[0].reference.reference == \"#p1\"\n    assert inst.basedOn[0].display == \"Management of Type 2 Diabetes\"\n    assert inst.careTeam[0].reference == \"CareTeam/example\"\n    assert inst.category[0].text == \"Weight management plan\"\n    assert inst.contained[0].id == \"p1\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.custodian.display == \"Dr Adam Careful\"\n    assert inst.custodian.reference == \"Practitioner/example\"\n    assert inst.description == \"Manage obesity and weight loss\"\n    assert inst.encounter.reference == \"Encounter/home\"\n    assert inst.goal[0].reference == \"Goal/example\"\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"12345\"\n    assert (\n        inst.instantiatesUri[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/protocol-for-obesity\"}\n        ).valueUri\n    )\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.partOf[0].display == \"Overall wellness plan\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-06-01\"}\n        ).valueDateTime\n    )\n    assert inst.replaces[0].display == \"Plan from urgent care clinic\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_careplan_4(base_settings):\n    \"\"\"No. 4 tests collection for CarePlan.\n    Test File: careplan-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_4(inst2)\n\n\ndef impl_careplan_5(inst):\n    assert (\n        inst.activity[0].plannedActivityReference.reference\n        == \"NutritionOrder/renaldiet\"\n    )\n    assert inst.activity[1].plannedActivityReference.reference == \"#activity\"\n    assert inst.addresses[0].reference.display == \"Roel's renal insufficiency\"\n    assert inst.addresses[0].reference.reference == \"Condition/f204\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"careteam\"\n    assert inst.contained[1].id == \"goal\"\n    assert inst.contained[2].id == \"activity\"\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"f201\"\n    assert inst.intent == \"proposal\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-13\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-11\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"draft\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_careplan_5(base_settings):\n    \"\"\"No. 5 tests collection for CarePlan.\n    Test File: careplan-example-f201-renal.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-f201-renal.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_5(inst2)\n\n\ndef impl_careplan_6(inst):\n    assert (\n        inst.activity[0].performedActivity[0].reference.reference == \"Encounter/example\"\n    )\n    assert inst.activity[0].plannedActivityReference.reference == \"#activity-1\"\n    assert inst.activity[1].plannedActivityReference.reference == \"#activity-2\"\n    assert inst.addresses[0].reference.display == \"obesity\"\n    assert inst.addresses[0].reference.reference == \"#p1\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"p1\"\n    assert inst.contained[1].id == \"careteam\"\n    assert inst.contained[2].id == \"goal\"\n    assert inst.contained[3].id == \"activity-1\"\n    assert inst.contained[4].id == \"activity-2\"\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"gpvisit\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-01T10:30:00+00:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/100\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_careplan_6(base_settings):\n    \"\"\"No. 6 tests collection for CarePlan.\n    Test File: careplan-example-GPVisit.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-GPVisit.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_6(inst2)\n\n\ndef impl_careplan_7(inst):\n    assert (\n        inst.activity[0].plannedActivityReference.reference\n        == \"ServiceRequest/activity-1\"\n    )\n    assert (\n        inst.activity[0].progress[0].text == \"Eve eats one meal a day with her parents\"\n    )\n    assert (\n        inst.activity[0].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-09-10\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[1].plannedActivityReference.reference\n        == \"ServiceRequest/activity-2\"\n    )\n    assert (\n        inst.activity[2].plannedActivityReference.reference\n        == \"NutritionOrder/activity-3\"\n    )\n    assert (\n        inst.activity[3].plannedActivityReference.reference\n        == \"ServiceRequest/activity-4\"\n    )\n    assert (\n        inst.activity[3].progress[0].text == \"Eve would like to try for 5 days a week.\"\n    )\n    assert (\n        inst.activity[3].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-08-27\"}\n        ).valueDateTime\n    )\n    assert inst.activity[3].progress[1].text == \"Eve is still walking the dogs.\"\n    assert (\n        inst.activity[3].progress[1].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-09-10\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[4].plannedActivityReference.reference\n        == \"ServiceRequest/activity-5\"\n    )\n    assert inst.activity[4].progress[0].text == \"Eve walked 4 times the last week.\"\n    assert (\n        inst.activity[4].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-08-13\"}\n        ).valueDateTime\n    )\n    assert inst.activity[4].progress[1].text == (\n        \"Eve did not walk to her parents the last week, but has plans\" \" to start again\"\n    )\n    assert (\n        inst.activity[4].progress[1].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-09-10\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[5].plannedActivityReference.reference\n        == \"ServiceRequest/activity-6\"\n    )\n    assert (\n        inst.activity[6].plannedActivityReference.reference\n        == \"ServiceRequest/activity-7\"\n    )\n    assert inst.activity[6].progress[0].text == (\n        \"After restarting the vinegar soaks the psoriasis is improved\"\n        \" and Eve plans to treat the remainder with light treatments.\"\n        \"  She plans to start this week.\"\n    )\n    assert (\n        inst.activity[6].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-08-13\"}\n        ).valueDateTime\n    )\n    assert inst.activity[6].progress[1].text == (\n        \"Since her skin is improved Eve has not been using the light \"\n        \"treatment as often, maybe once a week.  She would like to \"\n        \"increase to 3 times a week again\"\n    )\n    assert (\n        inst.activity[6].progress[1].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-08-27\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[7].plannedActivityReference.reference\n        == \"ServiceRequest/activity-8\"\n    )\n    assert inst.activity[7].progress[0].text == (\n        \"Eve created a chart as a reminer to take the medications \"\n        \"that do not fit in her pill box\"\n    )\n    assert (\n        inst.activity[7].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-07-23\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[8].plannedActivityReference.reference\n        == \"ServiceRequest/activity-9\"\n    )\n    assert inst.activity[8].progress[0].text == \"Will be able to esume exercise.\"\n    assert (\n        inst.activity[8].progress[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-07-30\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[8].progress[1].text\n        == \"Eve prefers to focus on walking at this time\"\n    )\n    assert (\n        inst.activity[8].progress[1].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-08-13\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.activity[9].plannedActivityReference.reference\n        == \"ServiceRequest/activity-10\"\n    )\n    assert inst.addresses[0].reference.display == \"GERDS\"\n    assert inst.addresses[0].reference.reference == \"#p1\"\n    assert inst.addresses[1].reference.display == \"Obesity\"\n    assert inst.addresses[1].reference.reference == \"#p2\"\n    assert inst.addresses[2].reference.display == \"Psoriasis\"\n    assert inst.addresses[2].reference.reference == \"#p3\"\n    assert inst.contained[0].id == \"p1\"\n    assert inst.contained[1].id == \"p2\"\n    assert inst.contained[2].id == \"p3\"\n    assert inst.contained[3].id == \"g1\"\n    assert inst.contained[4].id == \"g2\"\n    assert inst.contained[5].id == \"g3\"\n    assert inst.contained[6].id == \"g4\"\n    assert inst.contained[7].id == \"g5\"\n    assert inst.goal[0].reference == \"#g1\"\n    assert inst.goal[1].reference == \"#g2\"\n    assert inst.goal[2].reference == \"#g3\"\n    assert inst.goal[3].reference == \"#g4\"\n    assert inst.goal[4].reference == \"#g5\"\n    assert inst.id == \"integrate\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Patient family is not ready to commit to goal setting at \"\n        \"this time.  Goal setting will be addressed in the future\"\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Eve Everywoman\"\n    assert inst.subject.reference == \"Patient/1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_careplan_7(base_settings):\n    \"\"\"No. 7 tests collection for CarePlan.\n    Test File: careplan-example-integrated.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-integrated.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_7(inst2)\n\n\ndef impl_careplan_8(inst):\n    assert inst.activity[0].plannedActivityReference.reference == \"#activity\"\n    assert inst.addresses[0].reference.display == \"?????\"\n    assert inst.addresses[0].reference.reference == \"Condition/f201\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"careteam\"\n    assert inst.contained[1].id == \"goal\"\n    assert inst.contained[2].id == \"activity\"\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"f003\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/careplans\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"CP3953\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-08T09:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-08T09:00:10+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_careplan_8(base_settings):\n    \"\"\"No. 8 tests collection for CarePlan.\n    Test File: careplan-example-f003-pharynx.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-f003-pharynx.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_8(inst2)\n\n\ndef impl_careplan_9(inst):\n    assert inst.activity[0].plannedActivityReference.reference == \"#activity\"\n    assert inst.addresses[0].reference.display == \"?????\"\n    assert inst.addresses[0].reference.reference == \"Condition/f201\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"careteam\"\n    assert inst.contained[1].id == \"goal\"\n    assert inst.contained[2].id == \"activity\"\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"f001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/careplans\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"CP2903\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-06-27\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-06-26\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_careplan_9(base_settings):\n    \"\"\"No. 9 tests collection for CarePlan.\n    Test File: careplan-example-f001-heart.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-f001-heart.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_9(inst2)\n\n\ndef impl_careplan_10(inst):\n    assert (\n        inst.activity[0].plannedActivityReference.display\n        == \"Prenatal vitamin MedicationRequest\"\n    )\n    assert (\n        inst.activity[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/StructureDefinition/careplan#andetails\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.activity[1].extension[0].valueUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://orionhealth.com/fhir/careplan/1andetails\"}\n        ).valueUri\n    )\n    assert inst.activity[1].plannedActivityReference.reference == \"#activity-1\"\n    assert inst.activity[2].plannedActivityReference.reference == \"#activity-2\"\n    assert inst.activity[3].plannedActivityReference.reference == \"#activity-3\"\n    assert inst.addresses[0].reference.display == \"pregnancy\"\n    assert inst.addresses[0].reference.reference == \"#p1\"\n    assert inst.careTeam[0].reference == \"#careteam\"\n    assert inst.contained[0].id == \"p1\"\n    assert inst.contained[1].id == \"pr1\"\n    assert inst.contained[2].id == \"pr2\"\n    assert inst.contained[3].id == \"careteam\"\n    assert inst.contained[4].id == \"goal\"\n    assert inst.contained[5].id == \"activity-1\"\n    assert inst.contained[6].id == \"activity-2\"\n    assert inst.contained[7].id == \"activity-3\"\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/careplan#lmp\"}\n        ).valueUri\n    )\n    assert (\n        inst.extension[0].valueDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.goal[0].reference == \"#goal\"\n    assert inst.id == \"preg\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-10-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Eve Everywoman\"\n    assert inst.subject.reference == \"Patient/1\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_careplan_10(base_settings):\n    \"\"\"No. 10 tests collection for CarePlan.\n    Test File: careplan-example-pregnancy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careplan-example-pregnancy.json\"\n    inst = careplan.CarePlan.model_validate_json(filename.read_bytes())\n    assert \"CarePlan\" == inst.get_resource_type()\n\n    impl_careplan_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CarePlan\" == data[\"resourceType\"]\n\n    inst2 = careplan.CarePlan(**data)\n    impl_careplan_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_careteam.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CareTeam\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import careteam\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_careteam_1(inst):\n    assert inst.category[0].coding[0].code == \"LA27976-2\"\n    assert inst.category[0].coding[0].display == \"Encounter-focused care team\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"pr1\"\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.managingOrganization[0].reference == \"Organization/f001\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Peter James Charlmers Care Team for Inpatient Encounter\"\n    assert inst.participant[0].member.display == \"Peter James Chalmers\"\n    assert inst.participant[0].member.reference == \"Patient/example\"\n    assert inst.participant[0].role.text == \"responsiblePerson\"\n    assert (\n        inst.participant[1].coverageTiming.repeat.boundsPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.participant[1].coverageTiming.repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-12-23\"}\n        ).valueDateTime\n    )\n    assert inst.participant[1].coverageTiming.repeat.dayOfWeek[0] == \"mon\"\n    assert inst.participant[1].coverageTiming.repeat.frequency == 1\n    assert float(inst.participant[1].coverageTiming.repeat.period) == float(1)\n    assert inst.participant[1].coverageTiming.repeat.periodUnit == \"d\"\n    assert inst.participant[1].coverageTiming.repeat.when[0] == \"MORN\"\n    assert inst.participant[1].member.display == \"Dorothy Dietition\"\n    assert inst.participant[1].member.reference == \"#pr1\"\n    assert inst.participant[1].onBehalfOf.reference == \"Organization/f001\"\n    assert inst.participant[1].role.text == \"adviser\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == '<div xmlns=\"http://www.w3.org/1999/xhtml\">Care Team</div>'\n    assert inst.text.status == \"generated\"\n\n\ndef test_careteam_1(base_settings):\n    \"\"\"No. 1 tests collection for CareTeam.\n    Test File: careteam-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"careteam-example.json\"\n    inst = careteam.CareTeam.model_validate_json(filename.read_bytes())\n    assert \"CareTeam\" == inst.get_resource_type()\n\n    impl_careteam_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CareTeam\" == data[\"resourceType\"]\n\n    inst2 = careteam.CareTeam(**data)\n    impl_careteam_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_chargeitem.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ChargeItem\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import chargeitem\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_chargeitem_1(inst):\n    assert inst.account[0].reference == \"Account/example\"\n    assert inst.code.coding[0].code == \"01510\"\n    assert inst.code.coding[0].display == (\n        \"Zusatzpauschale für Beobachtung nach diagnostischer \" \"Koronarangiografie\"\n    )\n    assert (\n        inst.definitionUri[0]\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://www.kbv.de/tools/ebm/html/01520_2904360860826220813632.html\"\n            }\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.enteredDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-25T23:55:04+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.enterer.reference == \"Practitioner/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://myHospital.org/ChargeItems\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"654321\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].authorReference.reference == \"Practitioner/example\"\n    assert inst.note[0].text == \"The code is only applicable for periods longer than 4h\"\n    assert (\n        inst.note[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-25T23:55:04+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurrencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-25T12:35:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurrencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-25T08:00:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.overrideReason.text == (\n        \"Patient is Cardiologist's golf buddy, so he gets a 20% \" \"discount!\"\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.performer[0].function.coding[0].code == \"17561000\"\n    assert inst.performer[0].function.coding[0].display == \"Cardiologist\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.performer[1].actor.reference == \"Practitioner/example\"\n    assert inst.performer[1].function.coding[0].code == \"224542009\"\n    assert inst.performer[1].function.coding[0].display == \"Coronary Care Nurse\"\n    assert (\n        inst.performer[1].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.performingOrganization.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://myhospital/NamingSystem/departments\"}\n        ).valueUri\n    )\n    assert inst.performingOrganization.identifier.value == \"CARD_INTERMEDIATE_CARE\"\n    assert float(inst.quantity.value) == float(1)\n    assert inst.reason[0].coding[0].code == \"I51.6\"\n    assert inst.reason[0].coding[0].display == \"Cardiovascular disease, unspecified\"\n    assert (\n        inst.reason[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-10\"}\n        ).valueUri\n    )\n    assert (\n        inst.requestingOrganization.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://myhospital/NamingSystem/departments\"}\n        ).valueUri\n    )\n    assert inst.requestingOrganization.identifier.value == \"CARD_U1\"\n    assert inst.service[0].reference.reference == \"Procedure/example\"\n    assert inst.status == \"billable\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Example of '\n        \"ChargeItem Usage in Context of the German EBM Billing code \"\n        \"system</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.totalPriceComponent.amount.currency == \"EUR\"\n    assert float(inst.totalPriceComponent.amount.value) == float(40)\n    assert float(inst.totalPriceComponent.factor) == float(0.8)\n    assert inst.totalPriceComponent.type == \"base\"\n\n\ndef test_chargeitem_1(base_settings):\n    \"\"\"No. 1 tests collection for ChargeItem.\n    Test File: chargeitem-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"chargeitem-example.json\"\n    inst = chargeitem.ChargeItem.model_validate_json(filename.read_bytes())\n    assert \"ChargeItem\" == inst.get_resource_type()\n\n    impl_chargeitem_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ChargeItem\" == data[\"resourceType\"]\n\n    inst2 = chargeitem.ChargeItem(**data)\n    impl_chargeitem_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_chargeitemdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import chargeitemdefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_chargeitemdefinition_1(inst):\n    assert (\n        inst.applicability[0].condition.description\n        == \"Verify ChargeItem pertains to Device 12345\"\n    )\n    assert (\n        inst.applicability[0].condition.expression\n        == \"%context.service.suppliedItem.reference='Device/12345'\"\n    )\n    assert inst.applicability[0].condition.language == \"text/fhirpath\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-02\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Financial details for custom made device\"\n    assert inst.id == \"device\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.29.2\"\n    assert inst.instance[0].reference == \"Device/example\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.name == \"CustomDevice345675\"\n    assert inst.propertyGroup[0].priceComponent[0].amount.currency == \"EUR\"\n    assert float(inst.propertyGroup[0].priceComponent[0].amount.value) == float(67.44)\n    assert inst.propertyGroup[0].priceComponent[0].code.coding[0].code == \"VK\"\n    assert (\n        inst.propertyGroup[0].priceComponent[0].code.coding[0].display\n        == \"Verkaufspreis (netto)\"\n    )\n    assert (\n        inst.propertyGroup[0].priceComponent[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/CodeSystem/billing-attributes\"}\n        ).valueUri\n    )\n    assert inst.propertyGroup[0].priceComponent[0].type == \"base\"\n    assert (\n        inst.propertyGroup[1].applicability[0].condition.description\n        == \"Gültigkeit Steuersatz\"\n    )\n    assert (\n        inst.propertyGroup[1].applicability[0].condition.expression\n        == \"%context.occurenceDateTime > '2018-04-01'\"\n    )\n    assert inst.propertyGroup[1].applicability[0].condition.language == \"text/fhirpath\"\n    assert inst.propertyGroup[1].priceComponent[0].code.coding[0].code == \"MWST\"\n    assert (\n        inst.propertyGroup[1].priceComponent[0].code.coding[0].display\n        == \"Mehrwersteuersatz\"\n    )\n    assert (\n        inst.propertyGroup[1].priceComponent[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/CodeSystem/billing-attributes\"}\n        ).valueUri\n    )\n    assert float(inst.propertyGroup[1].priceComponent[0].factor) == float(1.19)\n    assert inst.propertyGroup[1].priceComponent[0].type == \"tax\"\n    assert (\n        inst.propertyGroup[2].applicability[0].condition.description\n        == \"Gültigkeit Steuersatz\"\n    )\n    assert (\n        inst.propertyGroup[2].applicability[0].condition.expression\n        == \"%context.occurenceDateTime <= '2018-04-01'\"\n    )\n    assert inst.propertyGroup[2].applicability[0].condition.language == \"text/fhirpath\"\n    assert inst.propertyGroup[2].priceComponent[0].code.coding[0].code == \"MWST\"\n    assert (\n        inst.propertyGroup[2].priceComponent[0].code.coding[0].display\n        == \"Mehrwersteuersatz\"\n    )\n    assert (\n        inst.propertyGroup[2].priceComponent[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/CodeSystem/billing-attributes\"}\n        ).valueUri\n    )\n    assert float(inst.propertyGroup[2].priceComponent[0].factor) == float(1.07)\n    assert inst.propertyGroup[2].priceComponent[0].type == \"tax\"\n    assert inst.publisher == \"Example Publisher\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Financial details for custom made device (345675)\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://sap.org/ChargeItemDefinition/device-123\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"venue\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"440655000\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Outpatient environment\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"age\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueQuantity.code == \"a\"\n    assert inst.useContext[1].valueQuantity.comparator == \">\"\n    assert (\n        inst.useContext[1].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueQuantity.unit == \"yrs\"\n    assert float(inst.useContext[1].valueQuantity.value) == float(18)\n\n\ndef test_chargeitemdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ChargeItemDefinition.\n    Test File: chargeitemdefinition-device-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"chargeitemdefinition-device-example.json\"\n    )\n    inst = chargeitemdefinition.ChargeItemDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ChargeItemDefinition\" == inst.get_resource_type()\n\n    impl_chargeitemdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ChargeItemDefinition\" == data[\"resourceType\"]\n\n    inst2 = chargeitemdefinition.ChargeItemDefinition(**data)\n    impl_chargeitemdefinition_1(inst2)\n\n\ndef impl_chargeitemdefinition_2(inst):\n    assert (\n        inst.applicability[0].condition.description\n        == \"Excludes billing code 13250 for same Encounter\"\n    )\n    assert inst.applicability[0].condition.expression == \"[some CQL expression]\"\n    assert inst.applicability[0].condition.language == \"text/cql\"\n    assert (\n        inst.applicability[0].effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-06-30\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.applicability[0].effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-04-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.applicability[1].condition.description == \"Applies only once per Encounter\"\n    )\n    assert inst.applicability[1].condition.expression == \"[some CQL expression]\"\n    assert inst.applicability[1].condition.language == \"text/CQL\"\n    assert (\n        inst.applicability[1].effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-06-30\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.applicability[1].effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-04-01\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"30110\"\n    assert inst.code.coding[0].display == \"Allergologiediagnostik I\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/CodingSystem/kbv/ebm\"}\n        ).valueUri\n    )\n    assert inst.description == (\n        \"Allergologisch-diagnostischer Komplex zur Diagnostik \"\n        \"und/oder zum Ausschluss einer (Kontakt-)Allergie vom Spättyp\"\n        \" (Typ IV), einschl. Kosten\"\n    )\n    assert inst.id == \"ebm\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.29.1\"\n    assert inst.propertyGroup[0].priceComponent[0].amount.currency == \"EUR\"\n    assert float(inst.propertyGroup[0].priceComponent[0].amount.value) == float(67.44)\n    assert inst.propertyGroup[0].priceComponent[0].code.coding[0].code == \"gesamt-euro\"\n    assert (\n        inst.propertyGroup[0].priceComponent[0].code.coding[0].display\n        == \"Gesamt (Euro)\"\n    )\n    assert (\n        inst.propertyGroup[0].priceComponent[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/CodeSystem/kbv/ebm-attribute\"}\n        ).valueUri\n    )\n    assert inst.propertyGroup[0].priceComponent[0].type == \"base\"\n    assert (\n        inst.propertyGroup[0].priceComponent[1].code.coding[0].code == \"gesamt-punkte\"\n    )\n    assert (\n        inst.propertyGroup[0].priceComponent[1].code.coding[0].display\n        == \"Gesamt (Punkte)\"\n    )\n    assert (\n        inst.propertyGroup[0].priceComponent[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/CodeSystem/kbv/ebm-attribute\"}\n        ).valueUri\n    )\n    assert float(inst.propertyGroup[0].priceComponent[1].factor) == float(633)\n    assert inst.propertyGroup[0].priceComponent[1].type == \"informational\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir.de/ChargeItemDefinition/kbv/ebm-30110\"}\n        ).valueUri\n    )\n    assert inst.version == \"2-2018\"\n\n\ndef test_chargeitemdefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for ChargeItemDefinition.\n    Test File: chargeitemdefinition-ebm-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"chargeitemdefinition-ebm-example.json\"\n    )\n    inst = chargeitemdefinition.ChargeItemDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ChargeItemDefinition\" == inst.get_resource_type()\n\n    impl_chargeitemdefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ChargeItemDefinition\" == data[\"resourceType\"]\n\n    inst2 = chargeitemdefinition.ChargeItemDefinition(**data)\n    impl_chargeitemdefinition_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_citation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Citation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import citation\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_citation_1(inst):\n    assert inst.citedArtifact.abstract[0].language.coding[0].code == \"en\"\n    assert inst.citedArtifact.abstract[0].language.coding[0].display == \"English\"\n    assert (\n        inst.citedArtifact.abstract[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.abstract[0].type.coding[0].code == \"primary-human-use\"\n    assert inst.citedArtifact.abstract[0].type.coding[0].display == \"Primary human use\"\n    assert (\n        inst.citedArtifact.abstract[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/cited-artifact-abstract-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.citedArtifact.classification[0].classifier[0].coding[0].code\n        == \"knowledge-artifact-type\"\n    )\n    assert (\n        inst.citedArtifact.classification[0].classifier[0].coding[0].display\n        == \"Knowledge Artifact Type\"\n    )\n    assert (\n        inst.citedArtifact.classification[0].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/cited-artifact-classification-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.citedArtifact.classification[0].classifier[1].coding[0].code == \"D064886\"\n    )\n    assert (\n        inst.citedArtifact.classification[0].classifier[1].coding[0].display\n        == \"Dataset\"\n    )\n    assert (\n        inst.citedArtifact.classification[0].classifier[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/citation-artifact-classifier\"}\n        ).valueUri\n    )\n    assert (\n        inst.citedArtifact.classification[0].classifier[1].coding[0].version == \"5.0.0\"\n    )\n    assert (\n        inst.citedArtifact.classification[1].classifier[0].coding[0].code\n        == \"EFO_0004327\"\n    )\n    assert (\n        inst.citedArtifact.classification[1].classifier[0].coding[0].display\n        == \"electrocardiography\"\n    )\n    assert (\n        inst.citedArtifact.classification[1].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ebi.ac.uk/efo\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.classification[1].classifier[0].text == \"ecg\"\n    assert inst.citedArtifact.classification[1].type.text == \"topic\"\n    assert (\n        inst.citedArtifact.classification[2].classifier[0].coding[0].code == \"FMA_63919\"\n    )\n    assert (\n        inst.citedArtifact.classification[2].classifier[0].coding[0].display == \"foetus\"\n    )\n    assert (\n        inst.citedArtifact.classification[2].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://purl.obolibrary.org/obo\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.classification[2].classifier[0].text == \"foetus\"\n    assert inst.citedArtifact.classification[2].type.text == \"topic\"\n    assert inst.citedArtifact.classification[3].classifier[0].text == \"pwd\"\n    assert inst.citedArtifact.classification[3].type.text == \"topic\"\n    assert inst.citedArtifact.classification[4].classifier[0].text == \"doppler\"\n    assert inst.citedArtifact.classification[4].type.text == \"topic\"\n    assert inst.citedArtifact.classification[5].classifier[0].text == \"foetal ecg\"\n    assert inst.citedArtifact.classification[5].type.text == \"topic\"\n    assert inst.citedArtifact.classification[6].classifier[0].text == \"maternal ecg\"\n    assert inst.citedArtifact.classification[6].type.text == \"topic\"\n    assert inst.citedArtifact.classification[7].classifier[0].text == \"pwd envelope\"\n    assert inst.citedArtifact.classification[7].type.text == \"topic\"\n    assert inst.citedArtifact.classification[8].classifier[0].text == \"non-invasive\"\n    assert inst.citedArtifact.classification[8].type.text == \"topic\"\n    assert (\n        inst.citedArtifact.classification[9].classifier[0].coding[0].code == \"394579002\"\n    )\n    assert (\n        inst.citedArtifact.classification[9].classifier[0].coding[0].display\n        == \"Cardiology (qualifier value)\"\n    )\n    assert (\n        inst.citedArtifact.classification[9].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.classification[9].classifier[0].text == \"cardiology\"\n    assert inst.citedArtifact.classification[9].type.text == \"topic\"\n    assert (\n        inst.citedArtifact.contributorship.summary[0].source.text\n        == \"copied-from-article\"\n    )\n    assert (\n        inst.citedArtifact.contributorship.summary[0].type.coding[0].code\n        == \"author-string\"\n    )\n    assert (\n        inst.citedArtifact.contributorship.summary[0].type.coding[0].display\n        == \"Author string\"\n    )\n    assert (\n        inst.citedArtifact.contributorship.summary[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/contributor-summary-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.citedArtifact.contributorship.summary[0].type.coding[0].version == \"5.0.0\"\n    )\n    assert inst.citedArtifact.contributorship.summary[0].value == (\n        \"Danilo Pani, Eleonora Sulas, Monica Urru, Reza Sameni, Luigi\"\n        \" Raffo, Roberto Tumbarello\"\n    )\n    assert (\n        inst.citedArtifact.contributorship.summary[1].source.text\n        == \"copied-from-article\"\n    )\n    assert inst.citedArtifact.contributorship.summary[1].type.text == \"acknowledgements\"\n    assert (\n        inst.citedArtifact.dateAccessed\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-03-17\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.citedArtifact.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://doi.org\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.identifier[0].value == \"10.13026/c4n5-3b04\"\n    assert (\n        inst.citedArtifact.publicationForm[0].articleDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-11-12\"}\n        ).valueDateTime\n    )\n    assert inst.citedArtifact.publicationForm[0].copyright == (\n        \"https://physionet.org/content/ninfea/view-license/1.0.0/ and\"\n        \" https://physionet.org/content/ninfea/1.0.0/LICENSE.txt\"\n    )\n    assert inst.citedArtifact.publicationForm[0].language[0].coding[0].code == \"en\"\n    assert (\n        inst.citedArtifact.publicationForm[0].language[0].coding[0].display == \"English\"\n    )\n    assert (\n        inst.citedArtifact.publicationForm[0].language[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert (\n        inst.citedArtifact.publicationForm[0].language[0].coding[0].version == \"4.0.1\"\n    )\n    assert (\n        inst.citedArtifact.publicationForm[0].publishedIn.publisher.display\n        == \"MIT Laboratory for Computational Physiology\"\n    )\n    assert inst.citedArtifact.publicationForm[0].publishedIn.title == \"PhysioNet\"\n    assert (\n        inst.citedArtifact.publicationForm[0].publishedIn.type.coding[0].code\n        == \"D019991\"\n    )\n    assert (\n        inst.citedArtifact.publicationForm[0].publishedIn.type.coding[0].display\n        == \"Database\"\n    )\n    assert (\n        inst.citedArtifact.publicationForm[0].publishedIn.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/published-in-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.citedArtifact.publicationForm[0].publishedIn.type.coding[0].version\n        == \"5.0.0\"\n    )\n    assert (\n        inst.citedArtifact.relatedIdentifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://doi.org\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.relatedIdentifier[0].value == \"10.1038/s41597-021-00811-3\"\n    assert inst.citedArtifact.relatesTo[0].classifier[0].text == \"original publication\"\n    assert (\n        inst.citedArtifact.relatesTo[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1038/s41597-021-00811-3\"}\n        ).valueUrl\n    )\n    assert inst.citedArtifact.relatesTo[0].type == \"derived-from\"\n    assert inst.citedArtifact.relatesTo[1].classifier[0].text == \"ontology\"\n    assert inst.citedArtifact.relatesTo[1].display == \"Experimental Factor Ontology\"\n    assert (\n        inst.citedArtifact.relatesTo[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://data.bioontology.org/ontologies/EFO\"}\n        ).valueUrl\n    )\n    assert inst.citedArtifact.relatesTo[1].type == \"depends-on\"\n    assert inst.citedArtifact.title[0].language.coding[0].code == \"en\"\n    assert inst.citedArtifact.title[0].language.coding[0].display == \"English\"\n    assert (\n        inst.citedArtifact.title[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.title[0].language.coding[0].version == \"4.0.1\"\n    assert inst.citedArtifact.title[0].text == (\n        \"NInFEA: Non-Invasive Multimodal Foetal ECG-Doppler Dataset \"\n        \"for Antenatal Cardiology Research\"\n    )\n    assert inst.citedArtifact.title[0].type[0].text == \"primary-human-use\"\n    assert inst.citedArtifact.version.value == \"1.0.0\"\n    assert inst.citedArtifact.webLocation[0].classifier[0].coding[0].code == \"webpage\"\n    assert (\n        inst.citedArtifact.webLocation[0].classifier[0].coding[0].display == \"Webpage\"\n    )\n    assert (\n        inst.citedArtifact.webLocation[0].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/artifact-url-classifier\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.webLocation[0].classifier[0].coding[0].version == \"5.0.0\"\n    assert (\n        inst.citedArtifact.webLocation[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://physionet.org/content/ninfea/1.0.0/\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.webLocation[1].classifier[0].coding[0].code == \"doi-based\"\n    assert (\n        inst.citedArtifact.webLocation[1].classifier[0].coding[0].display == \"DOI Based\"\n    )\n    assert (\n        inst.citedArtifact.webLocation[1].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/artifact-url-classifier\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.webLocation[1].classifier[0].coding[0].version == \"5.0.0\"\n    assert (\n        inst.citedArtifact.webLocation[1].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://doi.org/10.13026/c4n5-3b04\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.webLocation[2].classifier[0].coding[0].code == \"doi-based\"\n    assert (\n        inst.citedArtifact.webLocation[2].classifier[0].coding[0].display == \"DOI Based\"\n    )\n    assert (\n        inst.citedArtifact.webLocation[2].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/artifact-url-classifier\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.webLocation[2].classifier[0].coding[0].version == \"5.0.0\"\n    assert (\n        inst.citedArtifact.webLocation[2].classifier[0].text == \"original publication\"\n    )\n    assert (\n        inst.citedArtifact.webLocation[2].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://doi.org/10.1038/s41597-021-00811-3\"}\n        ).valueUri\n    )\n    assert (\n        inst.citedArtifact.webLocation[3].classifier[0].coding[0].code\n        == \"compressed-file\"\n    )\n    assert (\n        inst.citedArtifact.webLocation[3].classifier[0].coding[0].display\n        == \"Compressed file\"\n    )\n    assert (\n        inst.citedArtifact.webLocation[3].classifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/artifact-url-classifier\"}\n        ).valueUri\n    )\n    assert inst.citedArtifact.webLocation[3].classifier[0].coding[0].version == \"5.0.0\"\n    assert (\n        inst.citedArtifact.webLocation[3].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"https://physionet.org/static/published-projects/ninfea/ninfea-non-invasive-multimodal-foetal-ecg-doppler-dataset-for-antenatal-cardiology-research-1.0.0.zip\"\n            }\n        ).valueUri\n    )\n    assert inst.citedArtifact.webLocation[4].classifier[0].text == \"DOI-for-metadata\"\n    assert (\n        inst.citedArtifact.webLocation[4].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://doi.org/10.6084/m9.figshare.13283492\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].value == \"support@computablepublishing.com\"\n    assert inst.copyright == \"https://creativecommons.org/licenses/by-nc-sa/4.0/\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-09-24T10:41:01.740Z\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"A citation of a dataset\"\n    assert inst.id == \"citation-example-research-doi\"\n    assert inst.identifier[0].assigner.display == \"Computable Publishing LLC\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"FEvIR Object Identifier\"\n    assert inst.identifier[0].value == \"60\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"NInFEACitation\"\n    assert inst.publisher == \"Computable Publishing LLC\"\n    assert inst.status == \"active\"\n    assert inst.summary[0].style.text == \"as reported on PhysioNet\"\n    assert inst.summary[1].style.coding[0].code == \"comppub\"\n    assert inst.summary[1].style.coding[0].display == \"Computable Publishing\"\n    assert (\n        inst.summary[1].style.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/ValueSet/citation-summary-style\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"NInFEA Citation\"\n\n\ndef test_citation_1(base_settings):\n    \"\"\"No. 1 tests collection for Citation.\n    Test File: citation-example-research-doi.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"citation-example-research-doi.json\"\n    inst = citation.Citation.model_validate_json(filename.read_bytes())\n    assert \"Citation\" == inst.get_resource_type()\n\n    impl_citation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Citation\" == data[\"resourceType\"]\n\n    inst2 = citation.Citation(**data)\n    impl_citation_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_claim.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Claim\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import claim\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_claim_1(inst):\n    assert (\n        inst.accident.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-07-09\"}).valueDate\n    )\n    assert inst.accident.locationAddress.text == \"Grouse Mountain Ski Hill\"\n    assert inst.accident.type.coding[0].code == \"SPT\"\n    assert inst.accident.type.coding[0].display == \"Sporting Accident\"\n    assert (\n        inst.accident.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActIncidentCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.billablePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.billablePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-15\"}\n        ).valueDateTime\n    )\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].responsible is True\n    assert inst.careTeam[0].role.coding[0].code == \"primary\"\n    assert (\n        inst.careTeam[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/claim-careteamrole\"}\n        ).valueUri\n    )\n    assert inst.careTeam[0].sequence == 1\n    assert inst.careTeam[0].specialty.coding[0].code == \"physician\"\n    assert (\n        inst.careTeam[0].specialty.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/provider-qualification\"}\n        ).valueUri\n    )\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosisRelatedGroup.coding[0].code == \"400\"\n    assert inst.diagnosisRelatedGroup.coding[0].display == \"Head trauma - concussion\"\n    assert (\n        inst.diagnosisRelatedGroup.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-diagnosisrelatedgroup\"\n            }\n        ).valueUri\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"654456\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.diagnosis[0].type[0].coding[0].code == \"admitting\"\n    assert (\n        inst.diagnosis[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-diagnosistype\"}\n        ).valueUri\n    )\n    assert (\n        inst.enterer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://jurisdiction.org/facilities/HOSP1234/users\"}\n        ).valueUri\n    )\n    assert inst.enterer.identifier.value == \"UC1234\"\n    assert (\n        inst.facility.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://jurisdiction.org/facilities\"}\n        ).valueUri\n    )\n    assert inst.facility.identifier.value == \"HOSP1234\"\n    assert inst.id == \"960151\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyhospital.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"96123451\"\n    assert inst.insurance[0].businessArrangement == \"BA987123\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].preAuthRef[0] == \"PA2014G56473\"\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(125.0)\n    assert inst.item[0].productOrService.coding[0].code == \"exam\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-serviceproduct\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(125.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert (\n        inst.provider.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://npid.org/providerid\"}\n        ).valueUri\n    )\n    assert inst.provider.identifier.value == \"NJ12345\"\n    assert inst.status == \"active\"\n    assert inst.supportingInfo[0].category.coding[0].code == \"employmentimpacted\"\n    assert (\n        inst.supportingInfo[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/claiminformationcategory\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[0].sequence == 1\n    assert (\n        inst.supportingInfo[0].timingPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.supportingInfo[0].timingPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.supportingInfo[1].category.coding[0].code == \"hospitalized\"\n    assert (\n        inst.supportingInfo[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/claiminformationcategory\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[1].sequence == 2\n    assert (\n        inst.supportingInfo[1].timingPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.supportingInfo[1].timingPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-15\"}\n        ).valueDateTime\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total.currency == \"USD\"\n    assert float(inst.total.value) == float(125.0)\n    assert inst.type.coding[0].code == \"institutional\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_1(base_settings):\n    \"\"\"No. 1 tests collection for Claim.\n    Test File: claim-example-institutional-rich.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"claim-example-institutional-rich.json\"\n    )\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_1(inst2)\n\n\ndef impl_claim_2(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"654456\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.id == \"860150\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happypdocs.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"8612345\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(75.0)\n    assert inst.item[0].productOrService.coding[0].code == \"exam\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-serviceproduct\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(75.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"professional\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_2(base_settings):\n    \"\"\"No. 2 tests collection for Claim.\n    Test File: claim-example-professional.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example-professional.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_2(inst2)\n\n\ndef impl_claim_3(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"123456\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.id == \"100150\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert (\n        inst.insurance[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].identifier.value == \"12345\"\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(135.57)\n    assert inst.item[0].productOrService.coding[0].code == \"1200\"\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(135.57)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Oral Health Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_3(base_settings):\n    \"\"\"No. 3 tests collection for Claim.\n    Test File: claim-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_3(inst2)\n\n\ndef impl_claim_4(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"654321\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.id == \"660150\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happysight.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"6612345\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(80.0)\n    assert inst.item[0].productOrService.coding[0].code == \"exam\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(80.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Vision Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"vision\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_4(base_settings):\n    \"\"\"No. 4 tests collection for Claim.\n    Test File: claim-example-vision.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example-vision.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_4(inst2)\n\n\ndef impl_claim_5(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert inst.contained[0].id == \"device-frame\"\n    assert inst.contained[1].id == \"device-lens\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"654321\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.id == \"660152\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happysight.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"6612347\"\n    assert inst.insurance[0].claimResponse.reference == \"ClaimResponse/R3500\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is False\n    assert inst.insurance[0].preAuthRef[0] == \"PR7652387237\"\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurance[1].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[1].focal is True\n    assert inst.insurance[1].preAuthRef[0] == \"AB543GTD7567\"\n    assert inst.insurance[1].sequence == 2\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].category.coding[0].code == \"F6\"\n    assert inst.item[0].category.coding[0].display == \"Vision Coverage\"\n    assert (\n        inst.item[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[0].category.coding[0].code == \"F6\"\n    assert inst.item[0].detail[0].category.coding[0].display == \"Vision Coverage\"\n    assert (\n        inst.item[0].detail[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[0].factor) == float(1.1)\n    assert inst.item[0].detail[0].modifier[0].coding[0].code == \"rooh\"\n    assert (\n        inst.item[0].detail[0].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/modifiers\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[0].net.currency == \"USD\"\n    assert float(inst.item[0].detail[0].net.value) == float(110.0)\n    assert inst.item[0].detail[0].productOrService.coding[0].code == \"frame\"\n    assert (\n        inst.item[0].detail[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[0].revenue.coding[0].code == \"0010\"\n    assert inst.item[0].detail[0].revenue.coding[0].display == \"Vision Clinic\"\n    assert (\n        inst.item[0].detail[0].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[0].sequence == 1\n    assert inst.item[0].detail[0].udi[0].reference == \"#device-frame\"\n    assert inst.item[0].detail[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[0].unitPrice.value) == float(100.0)\n    assert inst.item[0].detail[1].category.coding[0].code == \"F6\"\n    assert inst.item[0].detail[1].category.coding[0].display == \"Vision Coverage\"\n    assert (\n        inst.item[0].detail[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].net.currency == \"USD\"\n    assert float(inst.item[0].detail[1].net.value) == float(110.0)\n    assert inst.item[0].detail[1].productOrService.coding[0].code == \"lens\"\n    assert (\n        inst.item[0].detail[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].programCode[0].coding[0].code == \"none\"\n    assert (\n        inst.item[0].detail[1].programCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-programcode\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].quantity.value) == float(2)\n    assert inst.item[0].detail[1].revenue.coding[0].code == \"0010\"\n    assert inst.item[0].detail[1].revenue.coding[0].display == \"Vision Clinic\"\n    assert (\n        inst.item[0].detail[1].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].sequence == 2\n    assert inst.item[0].detail[1].subDetail[0].category.coding[0].code == \"F6\"\n    assert (\n        inst.item[0].detail[1].subDetail[0].category.coding[0].display\n        == \"Vision Coverage\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].subDetail[0].factor) == float(1.1)\n    assert inst.item[0].detail[1].subDetail[0].modifier[0].coding[0].code == \"rooh\"\n    assert (\n        inst.item[0].detail[1].subDetail[0].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/modifiers\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[0].net.currency == \"USD\"\n    assert float(inst.item[0].detail[1].subDetail[0].net.value) == float(66.0)\n    assert inst.item[0].detail[1].subDetail[0].productOrService.coding[0].code == \"lens\"\n    assert (\n        inst.item[0].detail[1].subDetail[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[0].programCode[0].coding[0].code == \"none\"\n    assert (\n        inst.item[0].detail[1].subDetail[0].programCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-programcode\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].subDetail[0].quantity.value) == float(2)\n    assert inst.item[0].detail[1].subDetail[0].revenue.coding[0].code == \"0010\"\n    assert (\n        inst.item[0].detail[1].subDetail[0].revenue.coding[0].display == \"Vision Clinic\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[0].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[0].sequence == 1\n    assert inst.item[0].detail[1].subDetail[0].udi[0].reference == \"#device-lens\"\n    assert inst.item[0].detail[1].subDetail[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[1].subDetail[0].unitPrice.value) == float(30.0)\n    assert inst.item[0].detail[1].subDetail[1].category.coding[0].code == \"F6\"\n    assert (\n        inst.item[0].detail[1].subDetail[1].category.coding[0].display\n        == \"Vision Coverage\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].subDetail[1].factor) == float(1.1)\n    assert inst.item[0].detail[1].subDetail[1].modifier[0].coding[0].code == \"rooh\"\n    assert (\n        inst.item[0].detail[1].subDetail[1].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/modifiers\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[1].net.currency == \"USD\"\n    assert float(inst.item[0].detail[1].subDetail[1].net.value) == float(33.0)\n    assert (\n        inst.item[0].detail[1].subDetail[1].productOrService.coding[0].code\n        == \"hardening\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].subDetail[1].quantity.value) == float(2)\n    assert inst.item[0].detail[1].subDetail[1].revenue.coding[0].code == \"0010\"\n    assert (\n        inst.item[0].detail[1].subDetail[1].revenue.coding[0].display == \"Vision Clinic\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[1].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[1].sequence == 2\n    assert inst.item[0].detail[1].subDetail[1].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[1].subDetail[1].unitPrice.value) == float(15.0)\n    assert inst.item[0].detail[1].subDetail[2].category.coding[0].code == \"F6\"\n    assert (\n        inst.item[0].detail[1].subDetail[2].category.coding[0].display\n        == \"Vision Coverage\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[2].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].subDetail[2].factor) == float(1.1)\n    assert inst.item[0].detail[1].subDetail[2].modifier[0].coding[0].code == \"rooh\"\n    assert (\n        inst.item[0].detail[1].subDetail[2].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/modifiers\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[2].net.currency == \"USD\"\n    assert float(inst.item[0].detail[1].subDetail[2].net.value) == float(11.0)\n    assert (\n        inst.item[0].detail[1].subDetail[2].productOrService.coding[0].code\n        == \"UV coating\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[2].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[1].subDetail[2].quantity.value) == float(2)\n    assert inst.item[0].detail[1].subDetail[2].revenue.coding[0].code == \"0010\"\n    assert (\n        inst.item[0].detail[1].subDetail[2].revenue.coding[0].display == \"Vision Clinic\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[2].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].subDetail[2].sequence == 3\n    assert inst.item[0].detail[1].subDetail[2].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[1].subDetail[2].unitPrice.value) == float(5.0)\n    assert inst.item[0].detail[1].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[1].unitPrice.value) == float(55.0)\n    assert inst.item[0].detail[2].category.coding[0].code == \"F6\"\n    assert inst.item[0].detail[2].category.coding[0].display == \"Vision Coverage\"\n    assert (\n        inst.item[0].detail[2].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/benefit-subcategory\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[2].factor) == float(0.07)\n    assert inst.item[0].detail[2].net.currency == \"USD\"\n    assert float(inst.item[0].detail[2].net.value) == float(15.4)\n    assert inst.item[0].detail[2].productOrService.coding[0].code == \"fst\"\n    assert (\n        inst.item[0].detail[2].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[2].revenue.coding[0].code == \"0010\"\n    assert inst.item[0].detail[2].revenue.coding[0].display == \"Vision Clinic\"\n    assert (\n        inst.item[0].detail[2].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[2].sequence == 3\n    assert inst.item[0].detail[2].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[2].unitPrice.value) == float(220.0)\n    assert inst.item[0].modifier[0].coding[0].code == \"rooh\"\n    assert (\n        inst.item[0].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/modifiers\"}\n        ).valueUri\n    )\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(235.4)\n    assert inst.item[0].productOrService.coding[0].code == \"glasses\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/ex-visionservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].programCode[0].coding[0].code == \"none\"\n    assert (\n        inst.item[0].programCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-programcode\"}\n        ).valueUri\n    )\n    assert inst.item[0].revenue.coding[0].code == \"0010\"\n    assert inst.item[0].revenue.coding[0].display == \"Vision Clinic\"\n    assert (\n        inst.item[0].revenue.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-revenue-center\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(235.4)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.prescription.reference == \"http://www.optdocs.com/prescription/12345\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Vision Claim for Glasses</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"vision\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_5(base_settings):\n    \"\"\"No. 5 tests collection for Claim.\n    Test File: claim-example-vision-glasses-3tier.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"claim-example-vision-glasses-3tier.json\"\n    )\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_5(inst2)\n\n\ndef impl_claim_6(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"654456\"\n    assert inst.diagnosis[0].sequence == 1\n    assert (\n        inst.enterer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://jurisdiction.org/facilities/HOSP1234/users\"}\n        ).valueUri\n    )\n    assert inst.enterer.identifier.value == \"UC1234\"\n    assert (\n        inst.facility.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://jurisdiction.org/facilities\"}\n        ).valueUri\n    )\n    assert inst.facility.identifier.value == \"HOSP1234\"\n    assert inst.id == \"960150\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyhospital.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"9612345\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].encounter[0].reference == \"Encounter/example\"\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(125.0)\n    assert inst.item[0].productOrService.coding[0].code == \"exam\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-serviceproduct\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(125.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert (\n        inst.procedure[0].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.procedure[0].procedureCodeableConcept.coding[0].code == \"SDI9901\"\n    assert (\n        inst.procedure[0].procedureCodeableConcept.text\n        == \"Subcutaneous diagnostic implant\"\n    )\n    assert inst.procedure[0].sequence == 1\n    assert inst.procedure[0].type[0].coding[0].code == \"primary\"\n    assert inst.procedure[0].udi[0].reference == \"Device/example\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.subType.coding[0].code == \"emergency\"\n    assert (\n        inst.subType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-claimsubtype\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total.currency == \"USD\"\n    assert float(inst.total.value) == float(125.0)\n    assert inst.type.coding[0].code == \"institutional\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_6(base_settings):\n    \"\"\"No. 6 tests collection for Claim.\n    Test File: claim-example-institutional.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example-institutional.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_6(inst2)\n\n\ndef impl_claim_7(inst):\n    assert inst.careTeam[0].provider.reference == \"#provider-1\"\n    assert inst.careTeam[0].sequence == 1\n    assert inst.contained[0].id == \"org-insurer\"\n    assert inst.contained[1].id == \"org-org\"\n    assert inst.contained[2].id == \"provider-1\"\n    assert inst.contained[3].id == \"patient-1\"\n    assert inst.contained[4].id == \"coverage-1\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"123456\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.id == \"100152\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12347\"\n    assert inst.insurance[0].coverage.reference == \"#coverage-1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"#org-insurer\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(135.57)\n    assert inst.item[0].productOrService.coding[0].code == \"1200\"\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(135.57)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"#patient-1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"#org-org\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Oral Health Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_7(base_settings):\n    \"\"\"No. 7 tests collection for Claim.\n    Test File: claim-example-oral-contained.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example-oral-contained.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_7(inst2)\n\n\ndef impl_claim_8(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"654456\"\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.id == \"760151\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happypharma.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"7612345\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].detail[0].net.currency == \"USD\"\n    assert float(inst.item[0].detail[0].net.value) == float(45.0)\n    assert inst.item[0].detail[0].productOrService.coding[0].code == \"drugcost\"\n    assert (\n        inst.item[0].detail[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-pharmaservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[0].sequence == 1\n    assert inst.item[0].detail[1].net.currency == \"USD\"\n    assert float(inst.item[0].detail[1].net.value) == float(9.0)\n    assert inst.item[0].detail[1].productOrService.coding[0].code == \"markup\"\n    assert (\n        inst.item[0].detail[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-pharmaservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].sequence == 2\n    assert inst.item[0].detail[2].net.currency == \"USD\"\n    assert float(inst.item[0].detail[2].net.value) == float(36.0)\n    assert inst.item[0].detail[2].productOrService.coding[0].code == \"dispensefee\"\n    assert (\n        inst.item[0].detail[2].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ex-pharmaservice\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[2].sequence == 3\n    assert inst.item[0].informationSequence[0] == 1\n    assert inst.item[0].informationSequence[1] == 2\n    assert inst.item[0].informationSequence[2] == 3\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(90.0)\n    assert inst.item[0].productOrService.coding[0].code == \"562721\"\n    assert (\n        inst.item[0].productOrService.coding[0].display == \"Alprazolam 0.25mg (Xanax)\"\n    )\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.item[0].quantity.code == \"TAB\"\n    assert (\n        inst.item[0].quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.item[0].quantity.unit == \"TAB\"\n    assert float(inst.item[0].quantity.value) == float(90)\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.originalPrescription.reference\n        == \"http://pharmacy.org/MedicationRequest/AB1202B\"\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert (\n        inst.prescription.reference == \"http://pharmacy.org/MedicationRequest/AB1234G\"\n    )\n    assert inst.priority.coding[0].code == \"stat\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.supportingInfo[0].category.coding[0].code == \"pharmacyrefill\"\n    assert inst.supportingInfo[0].code.coding[0].code == \"new\"\n    assert (\n        inst.supportingInfo[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/pharmacy-refill\"}\n        ).valueUri\n    )\n    assert inst.supportingInfo[0].sequence == 1\n    assert inst.supportingInfo[1].category.coding[0].code == \"pharmacyinformation\"\n    assert inst.supportingInfo[1].code.coding[0].code == \"refillsremaining\"\n    assert (\n        inst.supportingInfo[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/pharmacy-information\"}\n        ).valueUri\n    )\n    assert inst.supportingInfo[1].sequence == 2\n    assert float(inst.supportingInfo[1].valueQuantity.value) == float(2)\n    assert inst.supportingInfo[2].category.coding[0].code == \"pharmacyinformation\"\n    assert inst.supportingInfo[2].code.coding[0].code == \"dayssupply\"\n    assert (\n        inst.supportingInfo[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/pharmacy-information\"}\n        ).valueUri\n    )\n    assert inst.supportingInfo[2].sequence == 3\n    assert float(inst.supportingInfo[2].valueQuantity.value) == float(90)\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Pharmacy Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total.currency == \"USD\"\n    assert float(inst.total.value) == float(90.0)\n    assert inst.type.coding[0].code == \"pharmacy\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_8(base_settings):\n    \"\"\"No. 8 tests collection for Claim.\n    Test File: claim-example-pharmacy-medication.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"claim-example-pharmacy-medication.json\"\n    )\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_8(inst2)\n\n\ndef impl_claim_9(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-16\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"K07.3\"\n    assert (\n        inst.diagnosis[0].diagnosisCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-10\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.fundsReserve.coding[0].code == \"provider\"\n    assert inst.id == \"100153\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12355\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].detail[0].net.currency == \"USD\"\n    assert float(inst.item[0].detail[0].net.value) == float(1000.0)\n    assert inst.item[0].detail[0].productOrService.coding[0].code == \"ORTHOEXAM\"\n    assert (\n        inst.item[0].detail[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[0].sequence == 1\n    assert inst.item[0].detail[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[0].unitPrice.value) == float(1000.0)\n    assert inst.item[0].detail[1].net.currency == \"USD\"\n    assert float(inst.item[0].detail[1].net.value) == float(1500.0)\n    assert inst.item[0].detail[1].productOrService.coding[0].code == \"ORTHODIAG\"\n    assert (\n        inst.item[0].detail[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[1].sequence == 2\n    assert inst.item[0].detail[1].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[1].unitPrice.value) == float(1500.0)\n    assert inst.item[0].detail[2].net.currency == \"USD\"\n    assert float(inst.item[0].detail[2].net.value) == float(500.0)\n    assert inst.item[0].detail[2].productOrService.coding[0].code == \"ORTHOINITIAL\"\n    assert (\n        inst.item[0].detail[2].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[0].detail[2].sequence == 3\n    assert inst.item[0].detail[2].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[2].unitPrice.value) == float(500.0)\n    assert inst.item[0].detail[3].productOrService.coding[0].code == \"ORTHOMONTHS\"\n    assert (\n        inst.item[0].detail[3].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[3].quantity.value) == float(24)\n    assert inst.item[0].detail[3].sequence == 4\n    assert inst.item[0].detail[4].net.currency == \"USD\"\n    assert float(inst.item[0].detail[4].net.value) == float(250.0)\n    assert inst.item[0].detail[4].productOrService.coding[0].code == \"ORTHOPERIODIC\"\n    assert (\n        inst.item[0].detail[4].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].detail[4].quantity.value) == float(24)\n    assert inst.item[0].detail[4].sequence == 5\n    assert inst.item[0].detail[4].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].detail[4].unitPrice.value) == float(250.0)\n    assert inst.item[0].diagnosisSequence[0] == 1\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(9000.0)\n    assert inst.item[0].productOrService.coding[0].code == \"ORTHPLAN\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-05-16\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(9000.0)\n    assert inst.item[1].bodySite[0].site[0].concept.coding[0].code == \"21\"\n    assert (\n        inst.item[1].bodySite[0].site[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fdi.org/fhir/oraltoothcodes\"}\n        ).valueUri\n    )\n    assert inst.item[1].bodySite[0].subSite[0].coding[0].code == \"L\"\n    assert (\n        inst.item[1].bodySite[0].subSite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fdi.org/fhir/oralsurfacecodes\"}\n        ).valueUri\n    )\n    assert inst.item[1].careTeamSequence[0] == 1\n    assert inst.item[1].net.currency == \"USD\"\n    assert float(inst.item[1].net.value) == float(105.0)\n    assert inst.item[1].productOrService.coding[0].code == \"21211\"\n    assert (\n        inst.item[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[1].sequence == 2\n    assert (\n        inst.item[1].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[1].unitPrice.currency == \"USD\"\n    assert float(inst.item[1].unitPrice.value) == float(105.0)\n    assert inst.item[2].bodySite[0].site[0].concept.coding[0].code == \"36\"\n    assert (\n        inst.item[2].bodySite[0].site[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fdi.org/fhir/oraltoothcodes\"}\n        ).valueUri\n    )\n    assert inst.item[2].careTeamSequence[0] == 1\n    assert inst.item[2].detail[0].net.currency == \"USD\"\n    assert float(inst.item[2].detail[0].net.value) == float(750.0)\n    assert inst.item[2].detail[0].productOrService.coding[0].code == \"27211\"\n    assert (\n        inst.item[2].detail[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[2].detail[0].sequence == 1\n    assert inst.item[2].detail[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[2].detail[0].unitPrice.value) == float(750.0)\n    assert inst.item[2].detail[1].net.currency == \"USD\"\n    assert float(inst.item[2].detail[1].net.value) == float(350.0)\n    assert inst.item[2].detail[1].productOrService.coding[0].code == \"lab\"\n    assert (\n        inst.item[2].detail[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[2].detail[1].sequence == 2\n    assert inst.item[2].detail[1].unitPrice.currency == \"USD\"\n    assert float(inst.item[2].detail[1].unitPrice.value) == float(350.0)\n    assert inst.item[2].net.currency == \"USD\"\n    assert float(inst.item[2].net.value) == float(1100.0)\n    assert inst.item[2].productOrService.coding[0].code == \"27211\"\n    assert (\n        inst.item[2].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.item[2].sequence == 3\n    assert (\n        inst.item[2].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[2].unitPrice.currency == \"USD\"\n    assert float(inst.item[2].unitPrice.value) == float(1100.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the Oral Health Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"preauthorization\"\n\n\ndef test_claim_9(base_settings):\n    \"\"\"No. 9 tests collection for Claim.\n    Test File: claim-example-oral-orthoplan.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example-oral-orthoplan.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_9(inst2)\n\n\ndef impl_claim_10(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert inst.contained[0].id == \"patient-1\"\n    assert inst.contained[1].id == \"coverage-1\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-10-16T00:00:00-07:00\"}\n        ).valueDateTime\n    )\n    assert inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code == \"M96.1\"\n    assert (\n        inst.diagnosis[0].diagnosisCodeableConcept.coding[0].display\n        == \"Postlaminectomy syndrome, not elsewhere classified\"\n    )\n    assert (\n        inst.diagnosis[0].diagnosisCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-10-cm\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[0].sequence == 1\n    assert inst.diagnosis[1].diagnosisCodeableConcept.coding[0].code == \"G89.4\"\n    assert (\n        inst.diagnosis[1].diagnosisCodeableConcept.coding[0].display\n        == \"Chronic pain syndrome\"\n    )\n    assert (\n        inst.diagnosis[1].diagnosisCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-10-cm\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[1].sequence == 2\n    assert inst.diagnosis[2].diagnosisCodeableConcept.coding[0].code == \"M53.88\"\n    assert inst.diagnosis[2].diagnosisCodeableConcept.coding[0].display == (\n        \"Other specified dorsopathies, sacral and sacrococcygeal \" \"region\"\n    )\n    assert (\n        inst.diagnosis[2].diagnosisCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-10-cm\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[2].sequence == 3\n    assert inst.diagnosis[3].diagnosisCodeableConcept.coding[0].code == \"M47.816\"\n    assert inst.diagnosis[3].diagnosisCodeableConcept.coding[0].display == (\n        \"Spondylosis without myelopathy or radiculopathy, lumbar \" \"region\"\n    )\n    assert (\n        inst.diagnosis[3].diagnosisCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-10-cm\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[3].sequence == 4\n    assert inst.id == \"MED-00050\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://CedarArmsMedicalCenter.com/claim\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"MED-00050\"\n    assert inst.insurance[0].coverage.reference == \"#coverage-1\"\n    assert inst.insurance[0].focal is True\n    assert (\n        inst.insurance[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://CedarArmsMedicalCenter.com/claim\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].identifier.value == \"MED-00050\"\n    assert inst.insurance[0].sequence == 1\n    assert inst.insurer.display == \"Humana Inc.\"\n    assert (\n        inst.insurer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bindb.com/bin\"}\n        ).valueUri\n    )\n    assert inst.insurer.identifier.value == \"123456\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].diagnosisSequence[0] == 2\n    assert inst.item[0].diagnosisSequence[1] == 4\n    assert inst.item[0].informationSequence[0] == 1\n    assert inst.item[0].locationCodeableConcept.coding[0].code == \"24\"\n    assert (\n        inst.item[0].locationCodeableConcept.coding[0].display\n        == \"Ambulatory Surgical Center\"\n    )\n    assert (\n        inst.item[0].locationCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"https://www.cms.gov/medicare/coding/place-of-service-codes/place_of_service_code_set.html\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(12500.0)\n    assert inst.item[0].productOrService.coding[0].code == \"62264\"\n    assert (\n        inst.item[0].productOrService.coding[0].display\n        == \"Surgical Procedures on the Spine and Spinal Cord\"\n    )\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ama-assn.org/go/cpt\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-10-13\"}).valueDate\n    )\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(12500.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"#patient-1\"\n    assert inst.payee.party.reference == \"Organization/1\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert (\n        inst.payee.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payeetype\"}\n        ).valueUri\n    )\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.subType.coding[0].code == \"831\"\n    assert (\n        inst.subType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.cms.gov/codes/billtype\"}\n        ).valueUri\n    )\n    assert inst.supportingInfo[0].category.coding[0].code == \"hospitalized\"\n    assert (\n        inst.supportingInfo[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/claiminformationcategory\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[0].sequence == 1\n    assert (\n        inst.supportingInfo[0].timingPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-10-05T00:00:00-07:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.supportingInfo[0].timingPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-10-01T00:00:00-07:00\"}\n        ).valueDateTime\n    )\n    assert inst.supportingInfo[1].category.coding[0].code == \"discharge\"\n    assert (\n        inst.supportingInfo[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/claiminformationcategory\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[1].code.coding[0].code == \"01\"\n    assert (\n        inst.supportingInfo[1].code.coding[0].display\n        == \"Discharge to Home or Self Care\"\n    )\n    assert (\n        inst.supportingInfo[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"https://www.cms.gov/Outreach-and-Education/Medicare-Learning-Network-MLN/MLNMattersArticles/downloads/SE0801.pdf\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[1].sequence == 2\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of a CMS 1500 Claim</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total.currency == \"USD\"\n    assert float(inst.total.value) == float(12500.0)\n    assert inst.type.coding[0].code == \"institutional\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claim_10(base_settings):\n    \"\"\"No. 10 tests collection for Claim.\n    Test File: claim-example-cms1500-medical.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claim-example-cms1500-medical.json\"\n    inst = claim.Claim.model_validate_json(filename.read_bytes())\n    assert \"Claim\" == inst.get_resource_type()\n\n    impl_claim_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Claim\" == data[\"resourceType\"]\n\n    inst2 = claim.Claim(**data)\n    impl_claim_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_claimresponse.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClaimResponse\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import claimresponse\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_claimresponse_1(inst):\n    assert inst.addItem[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.addItem[0].adjudication[0].amount.value) == float(250.0)\n    assert inst.addItem[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.addItem[0].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.addItem[0].adjudication[1].amount.value) == float(10.0)\n    assert inst.addItem[0].adjudication[1].category.coding[0].code == \"copay\"\n    assert inst.addItem[0].adjudication[2].category.coding[0].code == \"eligpercent\"\n    assert float(inst.addItem[0].adjudication[2].quantity.value) == float(100.0)\n    assert inst.addItem[0].adjudication[3].amount.currency == \"USD\"\n    assert float(inst.addItem[0].adjudication[3].amount.value) == float(240.0)\n    assert inst.addItem[0].adjudication[3].category.coding[0].code == \"benefit\"\n    assert inst.addItem[0].itemSequence[0] == 1\n    assert inst.addItem[0].modifier[0].coding[0].code == \"x\"\n    assert inst.addItem[0].modifier[0].coding[0].display == \"None\"\n    assert (\n        inst.addItem[0].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/modifiers\"}\n        ).valueUri\n    )\n    assert inst.addItem[0].net.currency == \"USD\"\n    assert float(inst.addItem[0].net.value) == float(250.0)\n    assert inst.addItem[0].noteNumber[0] == 101\n    assert inst.addItem[0].productOrService.coding[0].code == \"1101\"\n    assert (\n        inst.addItem[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.addItem[1].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.addItem[1].adjudication[0].amount.value) == float(800.0)\n    assert inst.addItem[1].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.addItem[1].adjudication[1].category.coding[0].code == \"eligpercent\"\n    assert float(inst.addItem[1].adjudication[1].quantity.value) == float(100.0)\n    assert inst.addItem[1].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.addItem[1].adjudication[2].amount.value) == float(800.0)\n    assert inst.addItem[1].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.addItem[1].itemSequence[0] == 1\n    assert inst.addItem[1].net.currency == \"USD\"\n    assert float(inst.addItem[1].net.value) == float(800.0)\n    assert inst.addItem[1].productOrService.coding[0].code == \"2101\"\n    assert (\n        inst.addItem[1].productOrService.coding[0].display == \"Radiograph, series (12)\"\n    )\n    assert (\n        inst.addItem[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == (\n        \"The enclosed services are authorized for your provision \"\n        \"within 30 days of this notice.\"\n    )\n    assert inst.id == \"UR3503\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.SocialBenefitsInc.com/fhir/ClaimResponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"UR3503\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurance[0].sequence == 1\n    assert (\n        inst.insurer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.org/insurers\"}\n        ).valueUri\n    )\n    assert inst.insurer.identifier.value == \"444123\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payeeType.coding[0].code == \"provider\"\n    assert (\n        inst.payeeType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payeetype\"}\n        ).valueUri\n    )\n    assert inst.preAuthRef == \"18SS12345\"\n    assert inst.processNote[0].language.coding[0].code == \"en-CA\"\n    assert (\n        inst.processNote[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].number == 101\n    assert inst.processNote[0].text == (\n        \"Please submit a Pre-Authorization request if a more \"\n        \"extensive examination or urgent services are required.\"\n    )\n    assert inst.processNote[0].type.coding[0].code == \"print\"\n    assert (\n        inst.processNote[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/note-type\"}\n        ).valueUri\n    )\n    assert inst.requestor.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A sample '\n        \"unsolicited pre-authorization response which authorizes \"\n        \"basic dental services to be performed for a patient.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total[0].amount.currency == \"USD\"\n    assert float(inst.total[0].amount.value) == float(1050.0)\n    assert inst.total[0].category.coding[0].code == \"submitted\"\n    assert inst.total[1].amount.currency == \"USD\"\n    assert float(inst.total[1].amount.value) == float(1040.0)\n    assert inst.total[1].category.coding[0].code == \"benefit\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"preauthorization\"\n\n\ndef test_claimresponse_1(base_settings):\n    \"\"\"No. 1 tests collection for ClaimResponse.\n    Test File: claimresponse-example-unsolicited-preauth.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"claimresponse-example-unsolicited-preauth.json\"\n    )\n    inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes())\n    assert \"ClaimResponse\" == inst.get_resource_type()\n\n    impl_claimresponse_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClaimResponse\" == data[\"resourceType\"]\n\n    inst2 = claimresponse.ClaimResponse(**data)\n    impl_claimresponse_1(inst2)\n\n\ndef impl_claimresponse_2(inst):\n    assert inst.addItem[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.addItem[0].adjudication[0].amount.value) == float(100.0)\n    assert inst.addItem[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.addItem[0].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.addItem[0].adjudication[1].amount.value) == float(10.0)\n    assert inst.addItem[0].adjudication[1].category.coding[0].code == \"copay\"\n    assert inst.addItem[0].adjudication[2].category.coding[0].code == \"eligpercent\"\n    assert float(inst.addItem[0].adjudication[2].quantity.value) == float(80.0)\n    assert inst.addItem[0].adjudication[3].amount.currency == \"USD\"\n    assert float(inst.addItem[0].adjudication[3].amount.value) == float(72.0)\n    assert inst.addItem[0].adjudication[3].category.coding[0].code == \"benefit\"\n    assert inst.addItem[0].adjudication[3].reason.coding[0].code == \"ar002\"\n    assert (\n        inst.addItem[0].adjudication[3].reason.coding[0].display == \"Plan Limit Reached\"\n    )\n    assert (\n        inst.addItem[0].adjudication[3].reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/adjudication-reason\"}\n        ).valueUri\n    )\n    assert inst.addItem[0].itemSequence[0] == 1\n    assert inst.addItem[0].modifier[0].coding[0].code == \"x\"\n    assert inst.addItem[0].modifier[0].coding[0].display == \"None\"\n    assert (\n        inst.addItem[0].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/modifiers\"}\n        ).valueUri\n    )\n    assert inst.addItem[0].net.currency == \"USD\"\n    assert float(inst.addItem[0].net.value) == float(135.57)\n    assert inst.addItem[0].noteNumber[0] == 101\n    assert inst.addItem[0].productOrService.coding[0].code == \"1101\"\n    assert (\n        inst.addItem[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.addItem[1].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.addItem[1].adjudication[0].amount.value) == float(35.57)\n    assert inst.addItem[1].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.addItem[1].adjudication[1].category.coding[0].code == \"eligpercent\"\n    assert float(inst.addItem[1].adjudication[1].quantity.value) == float(80.0)\n    assert inst.addItem[1].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.addItem[1].adjudication[2].amount.value) == float(28.47)\n    assert inst.addItem[1].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.addItem[1].itemSequence[0] == 1\n    assert inst.addItem[1].net.currency == \"USD\"\n    assert float(inst.addItem[1].net.value) == float(35.57)\n    assert inst.addItem[1].productOrService.coding[0].code == \"2141\"\n    assert inst.addItem[1].productOrService.coding[0].display == \"Radiograph, bytewing\"\n    assert (\n        inst.addItem[1].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert inst.addItem[2].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.addItem[2].adjudication[0].amount.value) == float(350.0)\n    assert inst.addItem[2].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.addItem[2].adjudication[1].category.coding[0].code == \"eligpercent\"\n    assert float(inst.addItem[2].adjudication[1].quantity.value) == float(80.0)\n    assert inst.addItem[2].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.addItem[2].adjudication[2].amount.value) == float(270.0)\n    assert inst.addItem[2].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.addItem[2].detailSequence[0] == 2\n    assert inst.addItem[2].itemSequence[0] == 3\n    assert inst.addItem[2].modifier[0].coding[0].code == \"x\"\n    assert inst.addItem[2].modifier[0].coding[0].display == \"None\"\n    assert (\n        inst.addItem[2].modifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/modifiers\"}\n        ).valueUri\n    )\n    assert inst.addItem[2].net.currency == \"USD\"\n    assert float(inst.addItem[2].net.value) == float(350.0)\n    assert inst.addItem[2].noteNumber[0] == 101\n    assert inst.addItem[2].productOrService.coding[0].code == \"expense\"\n    assert (\n        inst.addItem[2].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/oralservicecodes\"}\n        ).valueUri\n    )\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Claim settled as per contract.\"\n    assert inst.id == \"R3503\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/remittance\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"R3503\"\n    assert (\n        inst.insurer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.org/insurers\"}\n        ).valueUri\n    )\n    assert inst.insurer.identifier.value == \"555123\"\n    assert inst.item[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[0].amount.value) == float(0.0)\n    assert inst.item[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[0].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[1].amount.value) == float(0.0)\n    assert inst.item[0].adjudication[1].category.coding[0].code == \"benefit\"\n    assert inst.item[0].itemSequence == 1\n    assert inst.item[1].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[1].adjudication[0].amount.value) == float(105.0)\n    assert inst.item[1].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[1].adjudication[1].category.coding[0].code == \"eligpercent\"\n    assert float(inst.item[1].adjudication[1].quantity.value) == float(80.0)\n    assert inst.item[1].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.item[1].adjudication[2].amount.value) == float(84.0)\n    assert inst.item[1].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.item[1].itemSequence == 2\n    assert inst.item[2].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[2].adjudication[0].amount.value) == float(750.0)\n    assert inst.item[2].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[2].adjudication[1].category.coding[0].code == \"eligpercent\"\n    assert float(inst.item[2].adjudication[1].quantity.value) == float(80.0)\n    assert inst.item[2].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.item[2].adjudication[2].amount.value) == float(600.0)\n    assert inst.item[2].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.item[2].detail[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[2].detail[0].adjudication[0].amount.value) == float(750.0)\n    assert inst.item[2].detail[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert (\n        inst.item[2].detail[0].adjudication[1].category.coding[0].code == \"eligpercent\"\n    )\n    assert float(inst.item[2].detail[0].adjudication[1].quantity.value) == float(80.0)\n    assert inst.item[2].detail[0].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.item[2].detail[0].adjudication[2].amount.value) == float(600.0)\n    assert inst.item[2].detail[0].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.item[2].detail[0].detailSequence == 1\n    assert inst.item[2].detail[1].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[2].detail[1].adjudication[0].amount.value) == float(0.0)\n    assert inst.item[2].detail[1].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[2].detail[1].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.item[2].detail[1].adjudication[1].amount.value) == float(0.0)\n    assert inst.item[2].detail[1].adjudication[1].category.coding[0].code == \"benefit\"\n    assert inst.item[2].detail[1].detailSequence == 2\n    assert inst.item[2].itemSequence == 3\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payeeType.coding[0].code == \"provider\"\n    assert (\n        inst.payeeType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payeetype\"}\n        ).valueUri\n    )\n    assert inst.payment.amount.currency == \"USD\"\n    assert float(inst.payment.amount.value) == float(100.47)\n    assert (\n        inst.payment.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-31\"}).valueDate\n    )\n    assert (\n        inst.payment.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/paymentidentifier\"}\n        ).valueUri\n    )\n    assert inst.payment.identifier.value == \"201408-2-15507\"\n    assert inst.payment.type.coding[0].code == \"complete\"\n    assert (\n        inst.payment.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-paymenttype\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].language.coding[0].code == \"en-CA\"\n    assert (\n        inst.processNote[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].number == 101\n    assert (\n        inst.processNote[0].text\n        == \"Package codes are not permitted. Codes replaced by Insurer.\"\n    )\n    assert inst.processNote[0].type.coding[0].code == \"print\"\n    assert (\n        inst.processNote[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/note-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.request.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.request.identifier.value == \"12346\"\n    assert inst.requestor.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the ClaimResponse to Claim Oral Average with \"\n        \"additional items</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total[0].amount.currency == \"USD\"\n    assert float(inst.total[0].amount.value) == float(1340.57)\n    assert inst.total[0].category.coding[0].code == \"submitted\"\n    assert inst.total[1].amount.currency == \"USD\"\n    assert float(inst.total[1].amount.value) == float(1054.47)\n    assert inst.total[1].category.coding[0].code == \"benefit\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claimresponse_2(base_settings):\n    \"\"\"No. 2 tests collection for ClaimResponse.\n    Test File: claimresponse-example-additem.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claimresponse-example-additem.json\"\n    inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes())\n    assert \"ClaimResponse\" == inst.get_resource_type()\n\n    impl_claimresponse_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClaimResponse\" == data[\"resourceType\"]\n\n    inst2 = claimresponse.ClaimResponse(**data)\n    impl_claimresponse_2(inst2)\n\n\ndef impl_claimresponse_3(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Claim settled as per contract.\"\n    assert inst.id == \"R3500\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/remittance\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"R3500\"\n    assert (\n        inst.insurer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.org/insurers\"}\n        ).valueUri\n    )\n    assert inst.insurer.identifier.value == \"555123\"\n    assert inst.item[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[0].amount.value) == float(135.57)\n    assert inst.item[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[0].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[1].amount.value) == float(10.0)\n    assert inst.item[0].adjudication[1].category.coding[0].code == \"copay\"\n    assert inst.item[0].adjudication[2].category.coding[0].code == \"eligpercent\"\n    assert float(inst.item[0].adjudication[2].quantity.value) == float(80.0)\n    assert inst.item[0].adjudication[3].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[3].amount.value) == float(90.47)\n    assert inst.item[0].adjudication[3].category.coding[0].code == \"benefit\"\n    assert inst.item[0].adjudication[3].reason.coding[0].code == \"ar002\"\n    assert inst.item[0].adjudication[3].reason.coding[0].display == \"Plan Limit Reached\"\n    assert (\n        inst.item[0].adjudication[3].reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/adjudication-reason\"}\n        ).valueUri\n    )\n    assert inst.item[0].itemSequence == 1\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payeeType.coding[0].code == \"provider\"\n    assert (\n        inst.payeeType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payeetype\"}\n        ).valueUri\n    )\n    assert inst.payment.amount.currency == \"USD\"\n    assert float(inst.payment.amount.value) == float(100.47)\n    assert (\n        inst.payment.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-31\"}).valueDate\n    )\n    assert (\n        inst.payment.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/paymentidentifier\"}\n        ).valueUri\n    )\n    assert inst.payment.identifier.value == \"201408-2-1569478\"\n    assert inst.payment.type.coding[0].code == \"complete\"\n    assert (\n        inst.payment.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-paymenttype\"}\n        ).valueUri\n    )\n    assert (\n        inst.request.reference\n        == \"http://www.BenefitsInc.com/fhir/oralhealthclaim/15476332402\"\n    )\n    assert inst.requestor.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.subType.coding[0].code == \"emergency\"\n    assert (\n        inst.subType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-claimsubtype\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the ClaimResponse</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total[0].amount.currency == \"USD\"\n    assert float(inst.total[0].amount.value) == float(135.57)\n    assert inst.total[0].category.coding[0].code == \"submitted\"\n    assert inst.total[1].amount.currency == \"USD\"\n    assert float(inst.total[1].amount.value) == float(90.47)\n    assert inst.total[1].category.coding[0].code == \"benefit\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claimresponse_3(base_settings):\n    \"\"\"No. 3 tests collection for ClaimResponse.\n    Test File: claimresponse-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claimresponse-example.json\"\n    inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes())\n    assert \"ClaimResponse\" == inst.get_resource_type()\n\n    impl_claimresponse_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClaimResponse\" == data[\"resourceType\"]\n\n    inst2 = claimresponse.ClaimResponse(**data)\n    impl_claimresponse_3(inst2)\n\n\ndef impl_claimresponse_4(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Claim settled as per contract.\"\n    assert inst.id == \"R3502\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://thebenefitcompany.com/claimresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"CR6532875367\"\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[0].amount.value) == float(235.4)\n    assert inst.item[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[0].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[1].amount.value) == float(20.0)\n    assert inst.item[0].adjudication[1].category.coding[0].code == \"copay\"\n    assert inst.item[0].adjudication[2].category.coding[0].code == \"eligpercent\"\n    assert float(inst.item[0].adjudication[2].quantity.value) == float(80.0)\n    assert inst.item[0].adjudication[3].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[3].amount.value) == float(172.32)\n    assert inst.item[0].adjudication[3].category.coding[0].code == \"benefit\"\n    assert inst.item[0].detail[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[0].adjudication[0].amount.value) == float(100.0)\n    assert inst.item[0].detail[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[0].detail[0].adjudication[1].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[0].adjudication[1].amount.value) == float(20.0)\n    assert inst.item[0].detail[0].adjudication[1].category.coding[0].code == \"copay\"\n    assert (\n        inst.item[0].detail[0].adjudication[2].category.coding[0].code == \"eligpercent\"\n    )\n    assert float(inst.item[0].detail[0].adjudication[2].quantity.value) == float(80.0)\n    assert inst.item[0].detail[0].adjudication[3].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[0].adjudication[3].amount.value) == float(80.0)\n    assert inst.item[0].detail[0].adjudication[3].category.coding[0].code == \"benefit\"\n    assert inst.item[0].detail[0].detailSequence == 1\n    assert inst.item[0].detail[0].noteNumber[0] == 1\n    assert inst.item[0].detail[1].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[1].adjudication[0].amount.value) == float(110.0)\n    assert inst.item[0].detail[1].adjudication[0].category.coding[0].code == \"eligible\"\n    assert (\n        inst.item[0].detail[1].adjudication[1].category.coding[0].code == \"eligpercent\"\n    )\n    assert float(inst.item[0].detail[1].adjudication[1].quantity.value) == float(80.0)\n    assert inst.item[0].detail[1].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[1].adjudication[2].amount.value) == float(88.0)\n    assert inst.item[0].detail[1].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.item[0].detail[1].detailSequence == 2\n    assert inst.item[0].detail[1].noteNumber[0] == 1\n    assert inst.item[0].detail[1].subDetail[0].adjudication[0].amount.currency == \"USD\"\n    assert float(\n        inst.item[0].detail[1].subDetail[0].adjudication[0].amount.value\n    ) == float(60.0)\n    assert (\n        inst.item[0].detail[1].subDetail[0].adjudication[0].category.coding[0].code\n        == \"eligible\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[0].adjudication[1].category.coding[0].code\n        == \"eligpercent\"\n    )\n    assert float(\n        inst.item[0].detail[1].subDetail[0].adjudication[1].quantity.value\n    ) == float(80.0)\n    assert inst.item[0].detail[1].subDetail[0].adjudication[2].amount.currency == \"USD\"\n    assert float(\n        inst.item[0].detail[1].subDetail[0].adjudication[2].amount.value\n    ) == float(48.0)\n    assert (\n        inst.item[0].detail[1].subDetail[0].adjudication[2].category.coding[0].code\n        == \"benefit\"\n    )\n    assert inst.item[0].detail[1].subDetail[0].noteNumber[0] == 1\n    assert inst.item[0].detail[1].subDetail[0].subDetailSequence == 1\n    assert inst.item[0].detail[1].subDetail[1].adjudication[0].amount.currency == \"USD\"\n    assert float(\n        inst.item[0].detail[1].subDetail[1].adjudication[0].amount.value\n    ) == float(30.0)\n    assert (\n        inst.item[0].detail[1].subDetail[1].adjudication[0].category.coding[0].code\n        == \"eligible\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[1].adjudication[1].category.coding[0].code\n        == \"eligpercent\"\n    )\n    assert float(\n        inst.item[0].detail[1].subDetail[1].adjudication[1].quantity.value\n    ) == float(80.0)\n    assert inst.item[0].detail[1].subDetail[1].adjudication[2].amount.currency == \"USD\"\n    assert float(\n        inst.item[0].detail[1].subDetail[1].adjudication[2].amount.value\n    ) == float(24.0)\n    assert (\n        inst.item[0].detail[1].subDetail[1].adjudication[2].category.coding[0].code\n        == \"benefit\"\n    )\n    assert inst.item[0].detail[1].subDetail[1].subDetailSequence == 2\n    assert inst.item[0].detail[1].subDetail[2].adjudication[0].amount.currency == \"USD\"\n    assert float(\n        inst.item[0].detail[1].subDetail[2].adjudication[0].amount.value\n    ) == float(10.0)\n    assert (\n        inst.item[0].detail[1].subDetail[2].adjudication[0].category.coding[0].code\n        == \"eligible\"\n    )\n    assert (\n        inst.item[0].detail[1].subDetail[2].adjudication[1].category.coding[0].code\n        == \"eligpercent\"\n    )\n    assert float(\n        inst.item[0].detail[1].subDetail[2].adjudication[1].quantity.value\n    ) == float(80.0)\n    assert inst.item[0].detail[1].subDetail[2].adjudication[2].amount.currency == \"USD\"\n    assert float(\n        inst.item[0].detail[1].subDetail[2].adjudication[2].amount.value\n    ) == float(8.0)\n    assert (\n        inst.item[0].detail[1].subDetail[2].adjudication[2].category.coding[0].code\n        == \"benefit\"\n    )\n    assert inst.item[0].detail[1].subDetail[2].noteNumber[0] == 1\n    assert inst.item[0].detail[1].subDetail[2].subDetailSequence == 3\n    assert inst.item[0].detail[2].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[2].adjudication[0].amount.value) == float(200.0)\n    assert inst.item[0].detail[2].adjudication[0].category.coding[0].code == \"eligible\"\n    assert (\n        inst.item[0].detail[2].adjudication[1].category.coding[0].code == \"eligpercent\"\n    )\n    assert float(inst.item[0].detail[2].adjudication[1].quantity.value) == float(80.0)\n    assert inst.item[0].detail[2].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.item[0].detail[2].adjudication[2].amount.value) == float(14.0)\n    assert inst.item[0].detail[2].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.item[0].detail[2].detailSequence == 3\n    assert inst.item[0].detail[2].noteNumber[0] == 1\n    assert inst.item[0].itemSequence == 1\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.payeeType.coding[0].code == \"provider\"\n    assert (\n        inst.payeeType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payeetype\"}\n        ).valueUri\n    )\n    assert inst.payment.adjustment.currency == \"USD\"\n    assert float(inst.payment.adjustment.value) == float(75.0)\n    assert inst.payment.adjustmentReason.coding[0].code == \"a002\"\n    assert inst.payment.adjustmentReason.coding[0].display == \"Prior Overpayment\"\n    assert (\n        inst.payment.adjustmentReason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/payment-adjustment-reason\"\n            }\n        ).valueUri\n    )\n    assert inst.payment.amount.currency == \"USD\"\n    assert float(inst.payment.amount.value) == float(107.0)\n    assert (\n        inst.payment.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert (\n        inst.payment.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://thebenefitcompany.com/paymentidentifier\"}\n        ).valueUri\n    )\n    assert inst.payment.identifier.value == \"201416-123456\"\n    assert inst.payment.type.coding[0].code == \"complete\"\n    assert (\n        inst.payment.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-paymenttype\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].language.coding[0].code == \"en-CA\"\n    assert (\n        inst.processNote[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].number == 1\n    assert inst.processNote[0].text == \"After hours surcharge declined\"\n    assert inst.processNote[0].type.coding[0].code == \"display\"\n    assert (\n        inst.processNote[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/note-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.request.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happysight.com/claim\"}\n        ).valueUri\n    )\n    assert inst.request.identifier.value == \"6612346\"\n    assert inst.requestor.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the ClaimResponse</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total[0].amount.currency == \"USD\"\n    assert float(inst.total[0].amount.value) == float(235.4)\n    assert inst.total[0].category.coding[0].code == \"submitted\"\n    assert inst.total[1].amount.currency == \"USD\"\n    assert float(inst.total[1].amount.value) == float(182.0)\n    assert inst.total[1].category.coding[0].code == \"benefit\"\n    assert inst.type.coding[0].code == \"vision\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claimresponse_4(base_settings):\n    \"\"\"No. 4 tests collection for ClaimResponse.\n    Test File: claimresponse-example-vision-3tier.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"claimresponse-example-vision-3tier.json\"\n    )\n    inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes())\n    assert \"ClaimResponse\" == inst.get_resource_type()\n\n    impl_claimresponse_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClaimResponse\" == data[\"resourceType\"]\n\n    inst2 = claimresponse.ClaimResponse(**data)\n    impl_claimresponse_4(inst2)\n\n\ndef impl_claimresponse_5(inst):\n    assert inst.communicationRequest[0].reference == \"CommunicationRequest/fm-solicit\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Claim could not be processed\"\n    assert inst.error[0].code.coding[0].code == \"a002\"\n    assert (\n        inst.error[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/adjudication-error\"}\n        ).valueUri\n    )\n    assert inst.error[0].detailSequence == 2\n    assert inst.error[0].itemSequence == 3\n    assert inst.formCode.coding[0].code == \"2\"\n    assert (\n        inst.formCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/forms-codes\"}\n        ).valueUri\n    )\n    assert inst.id == \"R3501\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/remittance\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"R3501\"\n    assert (\n        inst.insurer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.org/insurers\"}\n        ).valueUri\n    )\n    assert inst.insurer.identifier.value == \"555123\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"error\"\n    assert inst.patient.reference == \"Patient/1\"\n    assert inst.processNote[0].language.coding[0].code == \"en-CA\"\n    assert (\n        inst.processNote[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].number == 1\n    assert inst.processNote[0].text == \"Invalid claim\"\n    assert inst.processNote[0].type.coding[0].code == \"display\"\n    assert (\n        inst.processNote[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/note-type\"}\n        ).valueUri\n    )\n    assert inst.request.reference == \"Claim/100156\"\n    assert inst.requestor.reference == \"Practitioner/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the ClaimResponse that demonstrates returning \"\n        \"errors</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_claimresponse_5(base_settings):\n    \"\"\"No. 5 tests collection for ClaimResponse.\n    Test File: claimresponse-example-2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"claimresponse-example-2.json\"\n    inst = claimresponse.ClaimResponse.model_validate_json(filename.read_bytes())\n    assert \"ClaimResponse\" == inst.get_resource_type()\n\n    impl_claimresponse_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClaimResponse\" == data[\"resourceType\"]\n\n    inst2 = claimresponse.ClaimResponse(**data)\n    impl_claimresponse_5(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_clinicalimpression.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClinicalImpression\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import clinicalimpression\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_clinicalimpression_1(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-06T22:33:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This 26 yo male patient is brought into ER by ambulance \"\n        \"after being involved in a motor vehicle accident\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-06T22:33:00+11:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-06T20:00:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.finding[0].item.concept.coding[0].code == \"850.0\"\n    assert (\n        inst.finding[0].item.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-9\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer.reference == \"Practitioner/example\"\n    assert inst.problem[0].display == \"MVA\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.summary == (\n        \"provisional diagnoses of laceration of head and traumatic \"\n        \"brain injury (TBI)\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_clinicalimpression_1(base_settings):\n    \"\"\"No. 1 tests collection for ClinicalImpression.\n    Test File: clinicalimpression-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"clinicalimpression-example.json\"\n    inst = clinicalimpression.ClinicalImpression.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ClinicalImpression\" == inst.get_resource_type()\n\n    impl_clinicalimpression_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClinicalImpression\" == data[\"resourceType\"]\n\n    inst2 = clinicalimpression.ClinicalImpression(**data)\n    impl_clinicalimpression_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_clinicalusedefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ClinicalUseDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import clinicalusedefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_clinicalusedefinition_1(inst):\n    assert (\n        inst.contraindication.comorbidity[0].concept.coding[0].code == \"Hepaticdisease\"\n    )\n    assert (\n        inst.contraindication.comorbidity[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/comorbidity\"}\n        ).valueUri\n    )\n    assert (\n        inst.contraindication.diseaseSymptomProcedure.concept.coding[0].code\n        == \"Coagulopathiesandbleedingdiatheses(exclthrombocytopenic)\"\n    )\n    assert (\n        inst.contraindication.diseaseSymptomProcedure.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://ema.europa.eu/example/contraindicationsasdisease-symptom-procedure\"\n            }\n        ).valueUri\n    )\n    assert inst.contraindication.diseaseSymptomProcedure.concept.text == (\n        \"Hepatic disease associated with coagulopathy and clinically \"\n        \"relevant bleeding risk\"\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"contraindication\"\n\n\ndef test_clinicalusedefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ClinicalUseDefinition.\n    Test File: clinicalusedefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"clinicalusedefinition-example.json\"\n    inst = clinicalusedefinition.ClinicalUseDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ClinicalUseDefinition\" == inst.get_resource_type()\n\n    impl_clinicalusedefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ClinicalUseDefinition\" == data[\"resourceType\"]\n\n    inst2 = clinicalusedefinition.ClinicalUseDefinition(**data)\n    impl_clinicalusedefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_codesystem.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CodeSystem\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import codesystem\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_codesystem_1(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"source\"\n    assert inst.concept[0].definition == (\n        \"This structure describes an instance passed to the mapping \"\n        \"engine that is used a source of data.\"\n    )\n    assert inst.concept[0].display == \"Source Structure Definition\"\n    assert inst.concept[1].code == \"queried\"\n    assert inst.concept[1].definition == (\n        \"This structure describes an instance that the mapping engine\"\n        \" may ask for that is used a source of data.\"\n    )\n    assert inst.concept[1].display == \"Queried Structure Definition\"\n    assert inst.concept[2].code == \"target\"\n    assert inst.concept[2].definition == (\n        \"This structure describes an instance passed to the mapping \"\n        \"engine that is used a target of data.\"\n    )\n    assert inst.concept[2].display == \"Target Structure Definition\"\n    assert inst.concept[3].code == \"produced\"\n    assert inst.concept[3].definition == (\n        \"This structure describes an instance that the mapping engine\"\n        \" may ask to create that is used a target of data.\"\n    )\n    assert inst.concept[3].display == \"Produced Structure Definition\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-05T10:01:24+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"How the referenced structure is used in this mapping.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fhir\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 2\n    assert inst.id == \"map-model-mode\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.676\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"old\"\n    assert inst.identifier[1].value == \"urn:oid:2.16.840.1.113883.4.642.1.662\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"StructureMapModelMode\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Structure Map Model Mode\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/map-model-mode\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/map-model-mode\"\n    assert inst.version == \"5.0.0\"\n\n\ndef test_codesystem_1(base_settings):\n    \"\"\"No. 1 tests collection for CodeSystem.\n    Test File: codesystem-map-model-mode.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"codesystem-map-model-mode.json\"\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_1(inst2)\n\n\ndef impl_codesystem_2(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"medication\"\n    assert inst.concept[0].display == \"Medication\"\n    assert inst.concept[1].code == \"device\"\n    assert inst.concept[1].display == \"Device\"\n    assert inst.concept[2].code == \"intervention\"\n    assert inst.concept[2].display == \"Intervention\"\n    assert inst.concept[3].code == \"factor\"\n    assert inst.concept[3].display == \"Factor\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-15T16:55:11.085+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Codes for the main intent of the study.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"brr\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 0\n    assert inst.id == \"research-study-focus-type\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"ResearchStudyFocusType\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"ResearchStudy Focus Type Code System\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/research-study-focus-type\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/research-study-focus-type\"\n    assert inst.version == \"5.0.0\"\n\n\ndef test_codesystem_2(base_settings):\n    \"\"\"No. 2 tests collection for CodeSystem.\n    Test File: codesystem-research-study-focus-type.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"codesystem-research-study-focus-type.json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_2(inst2)\n\n\ndef impl_codesystem_3(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"grouped-by\"\n    assert inst.concept[0].display == \"Grouped By\"\n    assert inst.concept[1].code == \"is-a\"\n    assert inst.concept[1].display == \"Is-A\"\n    assert inst.concept[2].code == \"part-of\"\n    assert inst.concept[2].definition == (\n        \"Child elements list the individual parts of a composite \"\n        \"whole (e.g. body site).\"\n    )\n    assert inst.concept[2].display == \"Part Of\"\n    assert inst.concept[3].code == \"classified-with\"\n    assert inst.concept[3].display == \"Classified With\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-05T10:01:24+11:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.description == \"The meaning of the hierarchy of concepts in a code system.\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"vocab\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"normative\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"4.0.0\"\n    assert (\n        inst.extension[3].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[3].valueInteger == 5\n    assert inst.id == \"codesystem-hierarchy-meaning\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.785\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"old\"\n    assert inst.identifier[1].value == \"urn:oid:2.16.840.1.113883.4.642.1.768\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"CodeSystemHierarchyMeaning\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Code System Hierarchy Meaning\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/codesystem-hierarchy-meaning\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning\"\n    assert inst.version == \"5.0.0\"\n\n\ndef test_codesystem_3(base_settings):\n    \"\"\"No. 3 tests collection for CodeSystem.\n    Test File: codesystem-codesystem-hierarchy-meaning.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"codesystem-codesystem-hierarchy-meaning.json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_3(inst2)\n\n\ndef impl_codesystem_4(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"create\"\n    assert inst.concept[0].definition == (\n        \"create(type : string) - type is passed through to the \"\n        \"application on the standard API, and must be known by it.\"\n    )\n    assert inst.concept[0].display == \"create\"\n    assert inst.concept[0].property[0].code == \"fhirpath\"\n    assert inst.concept[0].property[0].valueString == \"n/a\"\n    assert inst.concept[1].code == \"copy\"\n    assert inst.concept[1].definition == \"copy(source).\"\n    assert inst.concept[1].display == \"copy\"\n    assert inst.concept[1].property[0].code == \"fhirpath\"\n    assert inst.concept[1].property[0].valueString == \"n/a\"\n    assert inst.concept[2].code == \"truncate\"\n    assert (\n        inst.concept[2].definition\n        == \"truncate(source, length) - source must be stringy type.\"\n    )\n    assert inst.concept[2].display == \"truncate\"\n    assert inst.concept[2].property[0].code == \"fhirpath\"\n    assert inst.concept[2].property[0].valueString == \"substring\"\n    assert inst.concept[3].code == \"escape\"\n    assert inst.concept[3].definition == (\n        \"escape(source, fmt1, fmt2) - change source from one kind of \"\n        \"escaping to another (plain, java, xml, json). note that this\"\n        \" is for when the string itself is escaped.\"\n    )\n    assert inst.concept[3].display == \"escape\"\n    assert inst.concept[3].property[0].code == \"fhirpath\"\n    assert inst.concept[3].property[0].valueString == \"n/a\"\n    assert inst.concept[4].code == \"cast\"\n    assert inst.concept[4].display == \"cast\"\n    assert inst.concept[4].property[0].code == \"fhirpath\"\n    assert inst.concept[4].property[0].valueString == \"n/a\"\n    assert inst.concept[5].code == \"append\"\n    assert (\n        inst.concept[5].definition == \"append(source...) - source is element or string.\"\n    )\n    assert inst.concept[5].display == \"append\"\n    assert inst.concept[5].property[0].code == \"fhirpath\"\n    assert inst.concept[5].property[0].valueString == \"& (String concatenation)\"\n    assert inst.concept[6].code == \"translate\"\n    assert (\n        inst.concept[6].definition\n        == \"translate(source, uri_of_map) - use the translate operation.\"\n    )\n    assert inst.concept[6].display == \"translate\"\n    assert inst.concept[6].property[0].code == \"fhirpath\"\n    assert inst.concept[6].property[0].valueString == \"%terminologies.translate()\"\n    assert inst.concept[7].code == \"reference\"\n    assert inst.concept[7].definition == (\n        \"reference(source : object) - return a string that references\"\n        \" the provided tree properly.\"\n    )\n    assert inst.concept[7].display == \"reference\"\n    assert inst.concept[7].property[0].code == \"fhirpath\"\n    assert (\n        inst.concept[7].property[0].valueString\n        == \"related to resolve() but returns the string pointer\"\n    )\n    assert inst.concept[8].code == \"dateOp\"\n    assert (\n        inst.concept[8].definition\n        == \"Perform a date operation. *Parameters to be documented*.\"\n    )\n    assert inst.concept[8].display == \"dateOp\"\n    assert inst.concept[8].property[0].code == \"fhirpath\"\n    assert inst.concept[8].property[0].valueString == \"n/a\"\n    assert inst.concept[9].code == \"uuid\"\n    assert (\n        inst.concept[9].definition\n        == \"Generate a random UUID (in lowercase). No Parameters.\"\n    )\n    assert inst.concept[9].display == \"uuid\"\n    assert inst.concept[9].property[0].code == \"fhirpath\"\n    assert inst.concept[9].property[0].valueString == \"n/a\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-05T10:01:24+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"How data is copied/created.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fhir\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 2\n    assert inst.id == \"map-transform\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.682\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"old\"\n    assert inst.identifier[1].value == \"urn:oid:2.16.840.1.113883.4.642.1.668\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"StructureMapTransform\"\n    assert inst.property[0].code == \"fhirpath\"\n    assert inst.property[0].description == \"FHIRPath equivalent for transform function\"\n    assert inst.property[0].type == \"string\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Structure Map Transform\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/map-transform\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/map-transform\"\n    assert inst.version == \"5.0.0\"\n\n\ndef test_codesystem_4(base_settings):\n    \"\"\"No. 4 tests collection for CodeSystem.\n    Test File: codesystem-map-transform.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"codesystem-map-transform.json\"\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_4(inst2)\n\n\ndef impl_codesystem_5(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"contraindicated-only-with\"\n    assert (\n        inst.concept[0].definition\n        == \"Only contraindicated if the other therapy is given\"\n    )\n    assert (\n        inst.concept[0].display == \"Only contraindicated if the other therapy is given\"\n    )\n    assert inst.concept[1].code == \"contraindicated-except-with\"\n    assert (\n        inst.concept[1].definition\n        == \"Contraindicated unless the other therapy is given\"\n    )\n    assert (\n        inst.concept[1].display == \"Contraindicated unless the other therapy is given\"\n    )\n    assert inst.concept[2].code == \"indicated-only-with\"\n    assert inst.concept[2].definition == (\n        \"Indicated only when the other therapy is given (co-\" \"occurrent)\"\n    )\n    assert inst.concept[2].display == (\n        \"Indicated only when the other therapy is given (co-\" \"occurrent)\"\n    )\n    assert inst.concept[3].code == \"indicated-except-with\"\n    assert (\n        inst.concept[3].definition == \"Indicated except when the other therapy is given\"\n    )\n    assert inst.concept[3].display == \"Indicated except when the other therapy is given\"\n    assert inst.concept[4].code == \"indicated-only-after\"\n    assert inst.concept[4].definition == (\n        \"Indicated only if the other therapy is planned to be given \"\n        \"afterwards (prep)\"\n    )\n    assert inst.concept[4].display == (\n        \"Indicated only if the other therapy is planned to be given \"\n        \"afterwards (prep)\"\n    )\n    assert inst.concept[5].code == \"indicated-only-before\"\n    assert inst.concept[5].definition == (\n        \"Indicated only if the other therapy was given before \" \"(follow-up)\"\n    )\n    assert inst.concept[5].display == (\n        \"Indicated only if the other therapy was given before \" \"(follow-up)\"\n    )\n    assert inst.concept[6].code == \"replace-other-therapy\"\n    assert inst.concept[6].definition == \"Indicated to replace the other therapy\"\n    assert inst.concept[6].display == \"Indicated to replace the other therapy\"\n    assert inst.concept[7].code == \"replace-other-therapy-contraindicated\"\n    assert (\n        inst.concept[7].definition\n        == \"Indicated to replace the other contraindicated therapy.\"\n    )\n    assert (\n        inst.concept[7].display\n        == \"Indicated to replace the other contraindicated therapy\"\n    )\n    assert inst.concept[8].code == \"replace-other-therapy-not-tolerated\"\n    assert inst.concept[8].definition == (\n        \"Indicated to replace the other therapy not well tolerated by\" \" patient\"\n    )\n    assert inst.concept[8].display == (\n        \"Indicated to replace the other therapy not well tolerated by\" \" patient\"\n    )\n    assert inst.concept[9].code == \"replace-other-therapy-not-effective\"\n    assert inst.concept[9].definition == (\n        \"Indicated to replace the other therapy not effective on \" \"patient\"\n    )\n    assert inst.concept[9].display == (\n        \"Indicated to replace the other therapy not effective on \" \"patient\"\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-08-15T16:55:11+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Classification of relationship between a therapy and a \"\n        \"contraindication or an indication.\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"brr\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"therapy-relationship-type\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.1994\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"TherapyRelationshipType\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Therapy Relationship Type\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/therapy-relationship-type\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/therapy-relationship-type\"\n    assert inst.version == \"5.0.0\"\n\n\ndef test_codesystem_5(base_settings):\n    \"\"\"No. 5 tests collection for CodeSystem.\n    Test File: codesystem-therapy-relationship-type.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"codesystem-therapy-relationship-type.json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_5(inst2)\n\n\ndef impl_codesystem_6(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"registered\"\n    assert inst.concept[0].definition == (\n        \"The existence of the imaging study is registered, but there \"\n        \"is nothing yet available.\"\n    )\n    assert inst.concept[0].display == \"Registered\"\n    assert inst.concept[1].code == \"available\"\n    assert inst.concept[1].definition == (\n        \"At least one instance has been associated with this imaging \" \"study.\"\n    )\n    assert inst.concept[1].display == \"Available\"\n    assert inst.concept[2].code == \"cancelled\"\n    assert inst.concept[2].definition == (\n        \"The imaging study is unavailable because the imaging study \"\n        \"was not started or not completed (also sometimes called \"\n        '\"aborted\").'\n    )\n    assert inst.concept[2].display == \"Cancelled\"\n    assert inst.concept[3].code == \"entered-in-error\"\n    assert inst.concept[3].display == \"Entered in Error\"\n    assert inst.concept[4].code == \"unknown\"\n    assert inst.concept[4].display == \"Unknown\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-05T10:01:24+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"The status of the ImagingStudy.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"ii\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 4\n    assert inst.id == \"imagingstudy-status\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.991\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"ImagingStudyStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Imaging Study Status\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/imagingstudy-status\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/imagingstudy-status\"\n    assert inst.version == \"5.0.0\"\n\n\ndef test_codesystem_6(base_settings):\n    \"\"\"No. 6 tests collection for CodeSystem.\n    Test File: codesystem-imagingstudy-status.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"codesystem-imagingstudy-status.json\"\n    )\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_6(inst2)\n\n\ndef impl_codesystem_7(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"medication\"\n    assert inst.concept[0].definition == \"Medication Catalog.\"\n    assert inst.concept[0].display == \"Medication Catalog\"\n    assert inst.concept[1].code == \"device\"\n    assert inst.concept[1].definition == \"Device Catalog.\"\n    assert inst.concept[1].display == \"Device Catalog\"\n    assert inst.concept[2].code == \"protocol\"\n    assert inst.concept[2].definition == \"Protocol List.\"\n    assert inst.concept[2].display == \"Protocol List\"\n    assert inst.content == \"complete\"\n    assert inst.description == \"CatalogType\"\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"sd\"\n    assert inst.id == \"catalogType\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.2013\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"CatalogType\"\n    assert inst.publisher == \"HL7 International\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Catalog Type\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/catalogType\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_codesystem_7(base_settings):\n    \"\"\"No. 7 tests collection for CodeSystem.\n    Test File: codesystem-catalogType.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"codesystem-catalogType.json\"\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_7(inst2)\n\n\ndef impl_codesystem_8(inst):\n    assert inst.caseSensitive is True\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"One of the message events defined as part of this version of\" \" FHIR.\"\n    )\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/valueset-special-status\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"inm\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"draft\"\n    assert (\n        inst.extension[3].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[3].valueInteger == 1\n    assert inst.id == \"message-events\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert inst.name == \"MessageEvent\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"MessageEvent\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/message-events\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_codesystem_8(base_settings):\n    \"\"\"No. 8 tests collection for CodeSystem.\n    Test File: codesystem-message-events.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"codesystem-message-events.json\"\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_8(inst2)\n\n\ndef impl_codesystem_9(inst):\n    assert inst.caseSensitive is True\n    assert inst.concept[0].code == \"100000072072\"\n    assert inst.concept[0].display == \"Active\"\n    assert inst.concept[1].code == \"100000072073\"\n    assert inst.concept[1].display == \"Adjuvant\"\n    assert inst.concept[2].code == \"100000072082\"\n    assert inst.concept[2].display == \"Excipient\"\n    assert inst.concept[3].code == \"100000136065\"\n    assert inst.concept[3].display == \"Starting material for excipient\"\n    assert inst.concept[4].code == \"100000136066\"\n    assert inst.concept[4].display == \"Solvent / Diluent\"\n    assert inst.concept[5].code == \"100000136178\"\n    assert (\n        inst.concept[5].display\n        == \"Raw materials used in the manufacture of the product\"\n    )\n    assert inst.concept[6].code == \"100000136179\"\n    assert inst.concept[6].display == \"Starting material for active substance\"\n    assert inst.concept[7].code == \"100000136561\"\n    assert inst.concept[7].display == \"Overage\"\n    assert inst.concept[8].code == \"200000003427\"\n    assert inst.concept[8].display == \"bioenhancer\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert inst.content == \"complete\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-05T10:01:24+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"A classification of the ingredient identifying its purpose \"\n        \"within the product, e.g. active, inactive.\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"brr\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"ingredient-role\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.2080\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"IngredientRole\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Ingredient Role\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ingredient-role\"}\n        ).valueUri\n    )\n    assert inst.valueSet == \"http://hl7.org/fhir/ValueSet/ingredient-role\"\n    assert inst.version == \"5.0.0\"\n\n\ndef test_codesystem_9(base_settings):\n    \"\"\"No. 9 tests collection for CodeSystem.\n    Test File: codesystem-ingredient-role.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"codesystem-ingredient-role.json\"\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_9(inst2)\n\n\ndef impl_codesystem_10(inst):\n    assert inst.caseSensitive is False\n    assert inst.concept[0].code == \"aliceblue\"\n    assert inst.concept[0].display == \"aliceblue\"\n    assert inst.concept[0].property[0].code == \"rgb\"\n    assert inst.concept[0].property[0].valueString == \"#F0F8FF\"\n    assert inst.concept[1].code == \"antiquewhite\"\n    assert inst.concept[1].display == \"antiquewhite\"\n    assert inst.concept[1].property[0].code == \"rgb\"\n    assert inst.concept[1].property[0].valueString == \"#FAEBD7\"\n    assert inst.concept[2].code == \"aqua\"\n    assert inst.concept[2].display == \"aqua\"\n    assert inst.concept[2].property[0].code == \"rgb\"\n    assert inst.concept[2].property[0].valueString == \"#00FFFF\"\n    assert inst.concept[3].code == \"aquamarine\"\n    assert inst.concept[3].display == \"aquamarine\"\n    assert inst.concept[3].property[0].code == \"rgb\"\n    assert inst.concept[3].property[0].valueString == \"#7FFFD4\"\n    assert inst.concept[4].code == \"azure\"\n    assert inst.concept[4].display == \"azure\"\n    assert inst.concept[4].property[0].code == \"rgb\"\n    assert inst.concept[4].property[0].valueString == \"#F0FFFF\"\n    assert inst.concept[5].code == \"beige\"\n    assert inst.concept[5].display == \"beige\"\n    assert inst.concept[5].property[0].code == \"rgb\"\n    assert inst.concept[5].property[0].valueString == \"#F5F5DC\"\n    assert inst.concept[6].code == \"bisque\"\n    assert inst.concept[6].display == \"bisque\"\n    assert inst.concept[6].property[0].code == \"rgb\"\n    assert inst.concept[6].property[0].valueString == \"#FFE4C4\"\n    assert inst.concept[7].code == \"black\"\n    assert inst.concept[7].display == \"black\"\n    assert inst.concept[7].property[0].code == \"rgb\"\n    assert inst.concept[7].property[0].valueString == \"#000000\"\n    assert inst.concept[8].code == \"blanchedalmond\"\n    assert inst.concept[8].display == \"blanchedalmond\"\n    assert inst.concept[8].property[0].code == \"rgb\"\n    assert inst.concept[8].property[0].valueString == \"#FFEBCD\"\n    assert inst.concept[9].code == \"blue\"\n    assert inst.concept[9].display == \"blue\"\n    assert inst.concept[9].property[0].code == \"rgb\"\n    assert inst.concept[9].property[0].valueString == \"#0000FF\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.content == \"complete\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fhir\"\n    assert inst.id == \"color-names\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.4.2120\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablecodesystem\"\n    )\n    assert inst.name == \"ColorCodes\"\n    assert inst.property[0].code == \"rgb\"\n    assert inst.property[0].description == (\n        \"The RGB color that matches the named color (as defined in \"\n        \"CSS4 specification)\"\n    )\n    assert inst.property[0].type == \"string\"\n    assert inst.publisher == \"FHIR Infrastructure\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Codes for Colors\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/color-names\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_codesystem_10(base_settings):\n    \"\"\"No. 10 tests collection for CodeSystem.\n    Test File: codesystem-color-names.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"codesystem-color-names.json\"\n    inst = codesystem.CodeSystem.model_validate_json(filename.read_bytes())\n    assert \"CodeSystem\" == inst.get_resource_type()\n\n    impl_codesystem_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CodeSystem\" == data[\"resourceType\"]\n\n    inst2 = codesystem.CodeSystem(**data)\n    impl_codesystem_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_communication.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Communication\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import communication\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_communication_1(inst):\n    assert (\n        inst.about[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.about[0].identifier.value == \"12345\"\n    assert (\n        inst.about[1].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/claimresponse\"}\n        ).valueUri\n    )\n    assert inst.about[1].identifier.value == \"R3500\"\n    assert inst.category[0].coding[0].code == \"SolicitedAttachment\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/messagetypes\"}\n        ).valueUri\n    )\n    assert inst.id == \"fm-attachment\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.providerco.com/communication\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.payload[0].contentAttachment.contentType == \"application/pdf\"\n    assert (\n        inst.payload[0].contentAttachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-02-01T11:50:23-05:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.payload[0].contentAttachment.data\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"SGVsbG8=\"}\n        ).valueBase64Binary\n    )\n    assert inst.payload[0].contentAttachment.title == \"accident notes 20100201.pdf\"\n    assert inst.payload[1].contentAttachment.contentType == \"application/pdf\"\n    assert (\n        inst.payload[1].contentAttachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-02-01T10:57:34+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.payload[1].contentAttachment.hash\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"SGVsbG8gdGhlcmU=\"}\n        ).valueBase64Binary\n    )\n    # Don't know how to create unit test\n    # for \"payload[1].contentAttachment.size\",\n    # which is a Integer64\n    assert (\n        inst.payload[1].contentAttachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://example.org/docs/AB12345\"}\n        ).valueUrl\n    )\n    assert (\n        inst.recipient[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.com/insurer\"}\n        ).valueUri\n    )\n    assert inst.recipient[0].identifier.value == \"123456\"\n    assert (\n        inst.sender.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.com/provideroffices\"}\n        ).valueUri\n    )\n    assert inst.sender.identifier.value == \"3456\"\n    assert (\n        inst.sent\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-12T18:01:10-08:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/1\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Attachment which'\n        \" is unsolicited</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_communication_1(base_settings):\n    \"\"\"No. 1 tests collection for Communication.\n    Test File: communication-example-fm-attachment.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"communication-example-fm-attachment.json\"\n    )\n    inst = communication.Communication.model_validate_json(filename.read_bytes())\n    assert \"Communication\" == inst.get_resource_type()\n\n    impl_communication_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Communication\" == data[\"resourceType\"]\n\n    inst2 = communication.Communication(**data)\n    impl_communication_1(inst2)\n\n\ndef impl_communication_2(inst):\n    assert inst.basedOn[0].reference == \"#request\"\n    assert inst.category[0].coding[0].code == \"SolicitedAttachment\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/messagetypes\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"provider\"\n    assert inst.contained[1].id == \"payor\"\n    assert inst.contained[2].id == \"request\"\n    assert inst.id == \"fm-solicited\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.providerco.com/communication\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.payload[0].contentAttachment.contentType == \"application/pdf\"\n    assert (\n        inst.payload[0].contentAttachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-02-01T11:50:23-05:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.payload[0].contentAttachment.data\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"SGVsbG8=\"}\n        ).valueBase64Binary\n    )\n    assert inst.payload[0].contentAttachment.title == \"accident notes 20100201.pdf\"\n    assert inst.payload[1].contentAttachment.contentType == \"application/pdf\"\n    assert (\n        inst.payload[1].contentAttachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-02-01T10:57:34+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.payload[1].contentAttachment.hash\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"SGVsbG8gdGhlcmU=\"}\n        ).valueBase64Binary\n    )\n    # Don't know how to create unit test\n    # for \"payload[1].contentAttachment.size\",\n    # which is a Integer64\n    assert (\n        inst.payload[1].contentAttachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://happyvalley.com/docs/AB12345\"}\n        ).valueUrl\n    )\n    assert inst.recipient[0].reference == \"#payor\"\n    assert inst.sender.reference == \"#provider\"\n    assert (\n        inst.sent\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-12T18:01:10-08:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/1\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Attachment in '\n        \"response to a Request</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_communication_2(base_settings):\n    \"\"\"No. 2 tests collection for Communication.\n    Test File: communication-example-fm-solicited-attachment.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"communication-example-fm-solicited-attachment.json\"\n    )\n    inst = communication.Communication.model_validate_json(filename.read_bytes())\n    assert \"Communication\" == inst.get_resource_type()\n\n    impl_communication_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Communication\" == data[\"resourceType\"]\n\n    inst2 = communication.Communication(**data)\n    impl_communication_2(inst2)\n\n\ndef impl_communication_3(inst):\n    assert inst.category[0].coding[0].code == \"Alert\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/messagetypes\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Alert\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"Paging System\"\n    assert inst.identifier[0].value == \"2345678901\"\n    assert (\n        inst.instantiatesUri[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/hyperkalemia\"}\n        ).valueUri\n    )\n    assert inst.medium[0].coding[0].code == \"WRITTEN\"\n    assert inst.medium[0].coding[0].display == \"written\"\n    assert (\n        inst.medium[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationMode\"}\n        ).valueUri\n    )\n    assert inst.medium[0].text == \"written\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.partOf[0].display == \"Serum Potassium Observation\"\n    assert inst.payload[0].contentCodeableConcept.text == (\n        \"Patient 1 has a very high serum potassium value (7.2 mmol/L \"\n        \"on 2014-Dec-12 at 5:55 pm)\"\n    )\n    assert inst.payload[1].contentReference.display == \"Serum Potassium Observation\"\n    assert (\n        inst.received\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-12T18:01:11-08:00\"}\n        ).valueDateTime\n    )\n    assert inst.recipient[0].reference == \"Practitioner/example\"\n    assert inst.sender.reference == \"Device/f001\"\n    assert (\n        inst.sent\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-12T18:01:10-08:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Patient has very'\n        \" high serum potassium</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_communication_3(base_settings):\n    \"\"\"No. 3 tests collection for Communication.\n    Test File: communication-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"communication-example.json\"\n    inst = communication.Communication.model_validate_json(filename.read_bytes())\n    assert \"Communication\" == inst.get_resource_type()\n\n    impl_communication_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Communication\" == data[\"resourceType\"]\n\n    inst2 = communication.Communication(**data)\n    impl_communication_3(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_communicationrequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CommunicationRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import communicationrequest\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_communicationrequest_1(inst):\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example\"\n    assert inst.intent == \"proposal\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">To be filled out'\n        \" at a later time</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_communicationrequest_1(base_settings):\n    \"\"\"No. 1 tests collection for CommunicationRequest.\n    Test File: communicationrequest-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"communicationrequest-example.json\"\n    inst = communicationrequest.CommunicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CommunicationRequest\" == inst.get_resource_type()\n\n    impl_communicationrequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CommunicationRequest\" == data[\"resourceType\"]\n\n    inst2 = communicationrequest.CommunicationRequest(**data)\n    impl_communicationrequest_1(inst2)\n\n\ndef impl_communicationrequest_2(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-10T11:01:10-08:00\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].display == \"EligibilityRequest\"\n    assert inst.category[0].coding[0].code == \"SolicitedAttachmentRequest\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/messagetypes\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"provider\"\n    assert inst.contained[1].id == \"payor\"\n    assert inst.contained[2].id == \"requester\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.groupIdentifier.value == \"12345\"\n    assert inst.id == \"fm-solicit\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.jurisdiction.com/insurer/123456\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"ABC123\"\n    assert inst.informationProvider[0].reference == \"#payor\"\n    assert inst.intent == \"proposal\"\n    assert inst.medium[0].coding[0].code == \"WRITTEN\"\n    assert inst.medium[0].coding[0].display == \"written\"\n    assert (\n        inst.medium[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationMode\"}\n        ).valueUri\n    )\n    assert inst.medium[0].text == \"written\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-10T11:01:10-08:00\"}\n        ).valueDateTime\n    )\n    assert inst.payload[0].contentCodeableConcept.text == (\n        \"Please provide the accident report and any associated \"\n        \"pictures to support your Claim# DEF5647.\"\n    )\n    assert inst.priority == \"routine\"\n    assert inst.recipient[0].reference == \"#provider\"\n    assert inst.replaces[0].display == \"prior CommunicationRequest\"\n    assert inst.requester.reference == \"#requester\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Request for ' \"Accident Report</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_communicationrequest_2(base_settings):\n    \"\"\"No. 2 tests collection for CommunicationRequest.\n    Test File: communicationrequest-example-fm-solicit-attachment.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"communicationrequest-example-fm-solicit-attachment.json\"\n    )\n    inst = communicationrequest.CommunicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CommunicationRequest\" == inst.get_resource_type()\n\n    impl_communicationrequest_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CommunicationRequest\" == data[\"resourceType\"]\n\n    inst2 = communicationrequest.CommunicationRequest(**data)\n    impl_communicationrequest_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_compartmentdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CompartmentDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import compartmentdefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_compartmentdefinition_1(inst):\n    assert inst.code == \"Device\"\n    assert inst.contact[0].name == \"[string]\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-24\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"The set of resources associated with a particular Device \"\n        \"(example with Communication and CommunicationRequest \"\n        \"resourses only).\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"example\"\n    assert inst.name == \"EXAMPLE\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.purpose == (\n        \"Provides an example of a FHIR compartment definition based \"\n        \"on the Device resource type.\"\n    )\n    assert inst.resource[0].code == \"Communication\"\n    assert (\n        inst.resource[0].documentation\n        == \"The device used as the message sender and recipient\"\n    )\n    assert inst.resource[0].param[0] == \"sender\"\n    assert inst.resource[0].param[1] == \"recipient\"\n    assert inst.resource[1].code == \"CommunicationRequest\"\n    assert (\n        inst.resource[1].documentation\n        == \"The device used as the message sender and recipient\"\n    )\n    assert inst.resource[1].param[0] == \"sender\"\n    assert inst.resource[1].param[1] == \"recipient\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"E X A M P L E\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/example\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"Device\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n\n\ndef test_compartmentdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"compartmentdefinition-example.json\"\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_1(inst2)\n\n\ndef impl_compartmentdefinition_2(inst):\n    assert inst.code == \"RelatedPerson\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"relatedPerson\"\n    assert inst.name == \"Base FHIR compartment definition for RelatedPerson\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"ActorDefinition\"\n    assert inst.resource[3].code == \"AdministrableProductDefinition\"\n    assert inst.resource[4].code == \"AdverseEvent\"\n    assert inst.resource[4].param[0] == \"recorder\"\n    assert inst.resource[5].code == \"AllergyIntolerance\"\n    assert inst.resource[5].param[0] == \"participant\"\n    assert inst.resource[6].code == \"Appointment\"\n    assert inst.resource[6].param[0] == \"actor\"\n    assert inst.resource[7].code == \"AppointmentResponse\"\n    assert inst.resource[7].param[0] == \"actor\"\n    assert inst.resource[8].code == \"ArtifactAssessment\"\n    assert inst.resource[9].code == \"AuditEvent\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/relatedPerson\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_compartmentdefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-relatedperson.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"compartmentdefinition-relatedperson.json\"\n    )\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_2(inst2)\n\n\ndef impl_compartmentdefinition_3(inst):\n    assert inst.code == \"Patient\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"patient\"\n    assert inst.name == \"Base FHIR compartment definition for Patient\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[0].param[0] == \"subject\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"ActorDefinition\"\n    assert inst.resource[3].code == \"AdministrableProductDefinition\"\n    assert inst.resource[4].code == \"AdverseEvent\"\n    assert inst.resource[4].param[0] == \"subject\"\n    assert inst.resource[5].code == \"AllergyIntolerance\"\n    assert inst.resource[5].param[0] == \"patient\"\n    assert inst.resource[5].param[1] == \"participant\"\n    assert inst.resource[6].code == \"Appointment\"\n    assert inst.resource[6].param[0] == \"actor\"\n    assert inst.resource[7].code == \"AppointmentResponse\"\n    assert inst.resource[7].param[0] == \"actor\"\n    assert inst.resource[8].code == \"ArtifactAssessment\"\n    assert inst.resource[9].code == \"AuditEvent\"\n    assert inst.resource[9].param[0] == \"patient\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/patient\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_compartmentdefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-patient.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"compartmentdefinition-patient.json\"\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_3(inst2)\n\n\ndef impl_compartmentdefinition_4(inst):\n    assert inst.code == \"Practitioner\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"practitioner\"\n    assert inst.name == \"Base FHIR compartment definition for Practitioner\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[0].param[0] == \"subject\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"ActorDefinition\"\n    assert inst.resource[3].code == \"AdministrableProductDefinition\"\n    assert inst.resource[4].code == \"AdverseEvent\"\n    assert inst.resource[4].param[0] == \"recorder\"\n    assert inst.resource[5].code == \"AllergyIntolerance\"\n    assert inst.resource[5].param[0] == \"participant\"\n    assert inst.resource[6].code == \"Appointment\"\n    assert inst.resource[6].param[0] == \"actor\"\n    assert inst.resource[7].code == \"AppointmentResponse\"\n    assert inst.resource[7].param[0] == \"actor\"\n    assert inst.resource[8].code == \"ArtifactAssessment\"\n    assert inst.resource[9].code == \"AuditEvent\"\n    assert inst.resource[9].param[0] == \"agent\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/practitioner\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_compartmentdefinition_4(base_settings):\n    \"\"\"No. 4 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-practitioner.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"compartmentdefinition-practitioner.json\"\n    )\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_4(inst2)\n\n\ndef impl_compartmentdefinition_5(inst):\n    assert inst.code == \"Encounter\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"encounter\"\n    assert inst.name == \"Base FHIR compartment definition for Encounter\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"ActorDefinition\"\n    assert inst.resource[3].code == \"AdministrableProductDefinition\"\n    assert inst.resource[4].code == \"AdverseEvent\"\n    assert inst.resource[5].code == \"AllergyIntolerance\"\n    assert inst.resource[6].code == \"Appointment\"\n    assert inst.resource[7].code == \"AppointmentResponse\"\n    assert inst.resource[8].code == \"ArtifactAssessment\"\n    assert inst.resource[9].code == \"AuditEvent\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/encounter\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_compartmentdefinition_5(base_settings):\n    \"\"\"No. 5 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-encounter.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"compartmentdefinition-encounter.json\"\n    )\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_5(inst2)\n\n\ndef impl_compartmentdefinition_6(inst):\n    assert inst.code == \"Device\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"There is an instance of the device compartment for each \"\n        \"Device resource, and the identity of the compartment is the \"\n        \"same as the Device. The set of resources associated with a \"\n        \"particular device\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"device\"\n    assert inst.name == \"Base FHIR compartment definition for Device\"\n    assert inst.publisher == \"FHIR Project Team\"\n    assert inst.resource[0].code == \"Account\"\n    assert inst.resource[0].param[0] == \"subject\"\n    assert inst.resource[1].code == \"ActivityDefinition\"\n    assert inst.resource[2].code == \"ActorDefinition\"\n    assert inst.resource[3].code == \"AdministrableProductDefinition\"\n    assert inst.resource[4].code == \"AdverseEvent\"\n    assert inst.resource[5].code == \"AllergyIntolerance\"\n    assert inst.resource[6].code == \"Appointment\"\n    assert inst.resource[6].param[0] == \"actor\"\n    assert inst.resource[7].code == \"AppointmentResponse\"\n    assert inst.resource[7].param[0] == \"actor\"\n    assert inst.resource[8].code == \"ArtifactAssessment\"\n    assert inst.resource[9].code == \"AuditEvent\"\n    assert inst.resource[9].param[0] == \"agent\"\n    assert inst.search is True\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CompartmentDefinition/device\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_compartmentdefinition_6(base_settings):\n    \"\"\"No. 6 tests collection for CompartmentDefinition.\n    Test File: compartmentdefinition-device.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"compartmentdefinition-device.json\"\n    inst = compartmentdefinition.CompartmentDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CompartmentDefinition\" == inst.get_resource_type()\n\n    impl_compartmentdefinition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CompartmentDefinition\" == data[\"resourceType\"]\n\n    inst2 = compartmentdefinition.CompartmentDefinition(**data)\n    impl_compartmentdefinition_6(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_composition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Composition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import composition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_composition_1(inst):\n    assert inst.attester[0].mode.coding[0].code == \"legal\"\n    assert inst.attester[0].mode.coding[0].display == \"Legal\"\n    assert (\n        inst.attester[0].mode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/composition-attestation-mode\"}\n        ).valueUri\n    )\n    assert inst.attester[0].party.display == \"Harold Hippocrates, MD\"\n    assert inst.attester[0].party.reference == \"Practitioner/xcda-author\"\n    assert (\n        inst.attester[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04T09:10:14Z\"}\n        ).valueDateTime\n    )\n    assert inst.author[0].display == \"Harold Hippocrates, MD\"\n    assert inst.author[0].reference == \"Practitioner/xcda-author\"\n    assert inst.category[0].coding[0].code == \"LP173421-1\"\n    assert inst.category[0].coding[0].display == \"Report\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.custodian.display == \"Good Health Clinic\"\n    assert inst.custodian.reference == \"Organization/2.16.840.1.113883.19.5\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-30T16:56:04+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-mixed\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.section[0].code.coding[0].code == \"newborn\"\n    assert inst.section[0].code.coding[0].display == \"New Born Details\"\n    assert (\n        inst.section[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/codes/SectionType\"}\n        ).valueUri\n    )\n    assert inst.section[0].text.status == \"generated\"\n    assert inst.section[0].title == \"Child's Details\"\n    assert inst.section[1].code.coding[0].code == \"mother\"\n    assert inst.section[1].code.coding[0].display == \"Mother's Details\"\n    assert (\n        inst.section[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/codes/SectionType\"}\n        ).valueUri\n    )\n    assert inst.section[1].text.status == \"generated\"\n    assert inst.section[1].title == \"Mpther's Details\"\n    assert inst.status == \"final\"\n    assert inst.subject[0].display == \"Tahlia Smith\"\n    assert inst.subject[0].reference == \"Patient/newborn\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Discharge Summary (Neonatal Service)\"\n    assert inst.type.coding[0].code == \"78418-1\"\n    assert (\n        inst.type.coding[0].display == \"Neonatal perinatal medicine Discharge summary\"\n    )\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_composition_1(base_settings):\n    \"\"\"No. 1 tests collection for Composition.\n    Test File: composition-example-mixed.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"composition-example-mixed.json\"\n    inst = composition.Composition.model_validate_json(filename.read_bytes())\n    assert \"Composition\" == inst.get_resource_type()\n\n    impl_composition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Composition\" == data[\"resourceType\"]\n\n    inst2 = composition.Composition(**data)\n    impl_composition_1(inst2)\n\n\ndef impl_composition_2(inst):\n    assert inst.attester[0].mode.coding[0].code == \"legal\"\n    assert inst.attester[0].mode.coding[0].display == \"Legal\"\n    assert (\n        inst.attester[0].mode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/composition-attestation-mode\"}\n        ).valueUri\n    )\n    assert inst.attester[0].party.display == \"Harold Hippocrates, MD\"\n    assert inst.attester[0].party.reference == \"Practitioner/xcda-author\"\n    assert (\n        inst.attester[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04T09:10:14Z\"}\n        ).valueDateTime\n    )\n    assert inst.author[0].display == \"Harold Hippocrates, MD\"\n    assert inst.author[0].reference == \"Practitioner/xcda-author\"\n    assert inst.category[0].coding[0].code == \"LP173421-1\"\n    assert inst.category[0].coding[0].display == \"Report\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.custodian.display == \"Good Health Clinic\"\n    assert inst.custodian.reference == \"Organization/2.16.840.1.113883.19.5\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04T09:10:14Z\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/xcda\"\n    assert inst.event[0].detail[0].concept.coding[0].code == \"HEALTHREC\"\n    assert inst.event[0].detail[0].concept.coding[0].display == \"health record\"\n    assert (\n        inst.event[0].detail[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.event[0].detail[0].reference.reference == \"Observation/example\"\n    assert (\n        inst.event[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-11-12\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.event[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-07-18\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://healthintersections.com.au/test\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relatesTo[0].resourceReference.reference == \"Composition/old-example\"\n    assert inst.relatesTo[0].type == \"replaces\"\n    assert (\n        inst.relatesTo[1].resourceReference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/NamingSystem/document-ids\"}\n        ).valueUri\n    )\n    assert inst.relatesTo[1].resourceReference.identifier.value == \"ABC123\"\n    assert inst.relatesTo[1].type == \"appends\"\n    assert inst.section[0].code.coding[0].code == \"11348-0\"\n    assert inst.section[0].code.coding[0].display == \"History of past illness Narrative\"\n    assert (\n        inst.section[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.section[0].entry[0].reference == \"Condition/stroke\"\n    assert inst.section[0].entry[1].reference == \"Condition/example\"\n    assert inst.section[0].entry[2].reference == \"Condition/example2\"\n    assert inst.section[0].orderedBy.coding[0].code == \"event-date\"\n    assert inst.section[0].orderedBy.coding[0].display == \"Sorted by Event Date\"\n    assert (\n        inst.section[0].orderedBy.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/list-order\"}\n        ).valueUri\n    )\n    assert inst.section[0].text.status == \"generated\"\n    assert inst.section[0].title == \"History of present illness\"\n    assert inst.section[1].code.coding[0].code == \"10157-6\"\n    assert (\n        inst.section[1].code.coding[0].display\n        == \"History of family member diseases Narrative\"\n    )\n    assert (\n        inst.section[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.section[1].emptyReason.coding[0].code == \"withheld\"\n    assert inst.section[1].emptyReason.coding[0].display == \"Information Withheld\"\n    assert (\n        inst.section[1].emptyReason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/list-empty-reason\"}\n        ).valueUri\n    )\n    assert inst.section[1].text.status == \"generated\"\n    assert inst.section[1].title == \"History of family member diseases\"\n    assert inst.status == \"final\"\n    assert inst.subject[0].display == \"Henry Levin the 7th\"\n    assert inst.subject[0].reference == \"Patient/xcda\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Consultation Note\"\n    assert inst.type.coding[0].code == \"11488-4\"\n    assert inst.type.coding[0].display == \"Consult note\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_composition_2(base_settings):\n    \"\"\"No. 2 tests collection for Composition.\n    Test File: composition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"composition-example.json\"\n    inst = composition.Composition.model_validate_json(filename.read_bytes())\n    assert \"Composition\" == inst.get_resource_type()\n\n    impl_composition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Composition\" == data[\"resourceType\"]\n\n    inst2 = composition.Composition(**data)\n    impl_composition_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_conceptmap.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ConceptMap\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import conceptmap\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_conceptmap_1(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        'Canonical Mapping for \"The lifecycle status of an ' 'artifact.\"'\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"draft\"\n    assert inst.group[0].element[0].target[0].code == \"draft\"\n    assert inst.group[0].element[0].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[1].code == \"active\"\n    assert inst.group[0].element[1].target[0].code == \"active\"\n    assert inst.group[0].element[1].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[2].code == \"retired\"\n    assert inst.group[0].element[2].target[0].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[3].code == \"unknown\"\n    assert inst.group[0].element[3].target[0].code == \"unknown\"\n    assert inst.group[0].element[3].target[0].relationship == \"equivalent\"\n    assert inst.group[0].source == \"http://hl7.org/fhir/publication-status\"\n    assert inst.group[0].target == \"http://hl7.org/fhir/resource-status\"\n    assert inst.id == \"sc-publication-status\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.name == \"PublicationStatusCanonicalMap\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert (\n        inst.sourceScopeCanonical == \"http://hl7.org/fhir/ValueSet/publication-status\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.targetScopeCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"PublicationStatus\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-publication-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_conceptmap_1(base_settings):\n    \"\"\"No. 1 tests collection for ConceptMap.\n    Test File: sc-valueset-publication-status.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"sc-valueset-publication-status.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_1(inst2)\n\n\ndef impl_conceptmap_2(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"home\"\n    assert inst.group[0].element[0].target[0].code == \"H\"\n    assert inst.group[0].element[0].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[1].code == \"work\"\n    assert inst.group[0].element[1].target[0].code == \"WP\"\n    assert inst.group[0].element[1].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[2].code == \"temp\"\n    assert inst.group[0].element[2].target[0].code == \"TMP\"\n    assert inst.group[0].element[2].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[3].code == \"old\"\n    assert inst.group[0].element[3].target[0].code == \"OLD\"\n    assert inst.group[0].element[3].target[0].comment == \"Bad or Old\"\n    assert (\n        inst.group[0].element[3].target[0].relationship\n        == \"source-is-broader-than-target\"\n    )\n    assert inst.group[0].element[3].target[1].code == \"BAD\"\n    assert inst.group[0].element[3].target[1].comment == \"Bad or Old\"\n    assert (\n        inst.group[0].element[3].target[1].relationship\n        == \"source-is-broader-than-target\"\n    )\n    assert inst.group[0].source == \"http://hl7.org/fhir/address-use\"\n    assert inst.group[0].target == \"http://terminology.hl7.org/CodeSystem/v3-AddressUse\"\n    assert inst.id == \"cm-address-use-v3\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.name == \"v3.AddressUse\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.sourceScopeCanonical == \"http://hl7.org/fhir/ValueSet/address-use\"\n    assert inst.status == \"draft\"\n    assert (\n        inst.targetScopeCanonical == \"http://terminology.hl7.org/ValueSet/v3-AddressUse\"\n    )\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"v3 map for AddressUse\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-address-use-v3\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_conceptmap_2(base_settings):\n    \"\"\"No. 2 tests collection for ConceptMap.\n    Test File: cm-address-use-v3.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"cm-address-use-v3.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_2(inst2)\n\n\ndef impl_conceptmap_3(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == (\n        'Canonical Mapping for \"This value set includes Status ' 'codes.\"'\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"entered-in-error\"\n    assert inst.group[0].element[0].target[0].code == \"error\"\n    assert inst.group[0].element[0].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[1].code == \"draft\"\n    assert inst.group[0].element[1].target[0].code == \"draft\"\n    assert inst.group[0].element[1].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[2].code == \"active\"\n    assert inst.group[0].element[2].target[0].code == \"active\"\n    assert inst.group[0].element[2].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[3].code == \"cancelled\"\n    assert inst.group[0].element[3].target[0].code == \"abandoned\"\n    assert inst.group[0].element[3].target[0].relationship == \"equivalent\"\n    assert inst.group[0].source == \"http://hl7.org/fhir/fm-status\"\n    assert inst.group[0].target == \"http://hl7.org/fhir/resource-status\"\n    assert inst.id == \"sc-fm-status\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.name == \"FinancialResourceStatusCodesCanonicalMap\"\n    assert inst.publisher == \"Financial Management\"\n    assert inst.sourceScopeCanonical == \"http://hl7.org/fhir/ValueSet/fm-status\"\n    assert inst.status == \"draft\"\n    assert inst.targetScopeCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"Financial Resource Status Codes\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-fm-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_conceptmap_3(base_settings):\n    \"\"\"No. 3 tests collection for ConceptMap.\n    Test File: sc-valueset-fm-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sc-valueset-fm-status.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_3(inst2)\n\n\ndef impl_conceptmap_4(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == 'Canonical Mapping for \"FormularyItem Status Codes\"'\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"entered-in-error\"\n    assert inst.group[0].element[0].target[0].code == \"error\"\n    assert inst.group[0].element[0].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[1].code == \"active\"\n    assert inst.group[0].element[1].target[0].code == \"active\"\n    assert inst.group[0].element[1].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[2].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].relationship == \"equivalent\"\n    assert inst.group[0].source == \"http://hl7.org/fhir/CodeSystem/formularyitem-status\"\n    assert inst.group[0].target == \"http://hl7.org/fhir/resource-status\"\n    assert inst.id == \"sc-formularyitem-status\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.name == \"FormularyItemStatusCodesCanonicalMap\"\n    assert inst.publisher == \"FHIR Project team\"\n    assert (\n        inst.sourceScopeCanonical == \"http://hl7.org/fhir/ValueSet/formularyitem-status\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.targetScopeCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"FormularyItem Status Codes\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-formularyitem-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_conceptmap_4(base_settings):\n    \"\"\"No. 4 tests collection for ConceptMap.\n    Test File: sc-valueset-formularyitem-status.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"sc-valueset-formularyitem-status.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_4(inst2)\n\n\ndef impl_conceptmap_5(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-24T21:13:15+00:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"v3 map for CompositionStatus\"\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"preliminary\"\n    assert inst.group[0].element[0].target[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[1].code == \"final\"\n    assert inst.group[0].element[1].target[0].code == \"completed\"\n    assert (\n        inst.group[0].element[1].target[0].relationship\n        == \"source-is-narrower-than-target\"\n    )\n    assert inst.group[0].element[2].code == \"amended\"\n    assert inst.group[0].element[2].target[0].code == \"completed\"\n    assert (\n        inst.group[0].element[2].target[0].relationship\n        == \"source-is-narrower-than-target\"\n    )\n    assert inst.group[0].element[3].code == \"entered-in-error\"\n    assert inst.group[0].element[3].target[0].code == \"nullified\"\n    assert inst.group[0].element[3].target[0].relationship == \"equivalent\"\n    assert inst.group[0].source == \"http://hl7.org/fhir/composition-status\"\n    assert inst.group[0].target == \"http://terminology.hl7.org/CodeSystem/v3-ActStatus\"\n    assert inst.id == \"cm-composition-status-v3\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.14.9\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareableconceptmap\"\n    )\n    assert inst.name == \"V3CompositionStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"v3 map for CompositionStatus\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-composition-status-v3\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_conceptmap_5(base_settings):\n    \"\"\"No. 5 tests collection for ConceptMap.\n    Test File: cm-composition-status-v3.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"cm-composition-status-v3.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_5(inst2)\n\n\ndef impl_conceptmap_6(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-28T16:55:11+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        'Canonical Mapping for \"Indicates whether this flag is '\n        \"active and needs to be displayed to a user, or whether it is\"\n        ' no longer needed or was entered in error.\"'\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"entered-in-error\"\n    assert inst.group[0].element[0].target[0].code == \"error\"\n    assert inst.group[0].element[0].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[1].code == \"active\"\n    assert inst.group[0].element[1].target[0].code == \"active\"\n    assert inst.group[0].element[1].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[2].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].relationship == \"equivalent\"\n    assert inst.group[0].source == \"http://hl7.org/fhir/flag-status\"\n    assert inst.group[0].target == \"http://hl7.org/fhir/resource-status\"\n    assert inst.id == \"sc-flag-status\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.name == \"FlagStatusCanonicalMap\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.sourceScopeCanonical == \"http://hl7.org/fhir/ValueSet/flag-status\"\n    assert inst.status == \"draft\"\n    assert inst.targetScopeCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"Flag Status\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-flag-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_conceptmap_6(base_settings):\n    \"\"\"No. 6 tests collection for ConceptMap.\n    Test File: sc-valueset-flag-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sc-valueset-flag-status.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_6(inst2)\n\n\ndef impl_conceptmap_7(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-28T16:55:11+11:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.description == 'Canonical Mapping for \"The status of the Device record.\"'\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"entered-in-error\"\n    assert inst.group[0].element[0].target[0].code == \"error\"\n    assert inst.group[0].element[0].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[1].code == \"active\"\n    assert inst.group[0].element[1].target[0].code == \"active\"\n    assert inst.group[0].element[1].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[2].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].relationship == \"equivalent\"\n    assert inst.group[0].source == \"http://hl7.org/fhir/device-status\"\n    assert inst.group[0].target == \"http://hl7.org/fhir/resource-status\"\n    assert inst.id == \"sc-device-status\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.name == \"FHIRDeviceStatusCanonicalMap\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.sourceScopeCanonical == \"http://hl7.org/fhir/ValueSet/device-status\"\n    assert inst.status == \"draft\"\n    assert inst.targetScopeCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"FHIR Device Status\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-device-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_conceptmap_7(base_settings):\n    \"\"\"No. 7 tests collection for ConceptMap.\n    Test File: sc-valueset-device-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sc-valueset-device-status.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_7(inst2)\n\n\ndef impl_conceptmap_8(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"home\"\n    assert inst.group[0].element[0].target[0].code == \"PRN\"\n    assert (\n        inst.group[0].element[0].target[0].comment\n        == \"FHIR doesn't distinguish types of homes for contacts\"\n    )\n    assert (\n        inst.group[0].element[0].target[0].relationship\n        == \"source-is-broader-than-target\"\n    )\n    assert inst.group[0].element[0].target[1].code == \"ORN\"\n    assert (\n        inst.group[0].element[0].target[1].comment\n        == \"FHIR doesn't distinguish types of homes for contacts\"\n    )\n    assert (\n        inst.group[0].element[0].target[1].relationship\n        == \"source-is-broader-than-target\"\n    )\n    assert inst.group[0].element[0].target[2].code == \"VHN\"\n    assert (\n        inst.group[0].element[0].target[2].comment\n        == \"FHIR doesn't distinguish types of homes for contacts\"\n    )\n    assert (\n        inst.group[0].element[0].target[2].relationship\n        == \"source-is-broader-than-target\"\n    )\n    assert inst.group[0].element[1].code == \"work\"\n    assert inst.group[0].element[1].target[0].code == \"WPN\"\n    assert inst.group[0].element[1].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[2].code == \"mobile\"\n    assert inst.group[0].element[2].target[0].code == \"PRS\"\n    assert inst.group[0].element[2].target[0].relationship == \"equivalent\"\n    assert inst.group[0].source == \"http://hl7.org/fhir/contact-point-use\"\n    assert inst.group[0].target == \"http://terminology.hl7.org/CodeSystem/v2-0201\"\n    assert inst.id == \"cm-contact-point-use-v2\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.name == \"v2.ContactPointUse\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.sourceScopeCanonical == \"http://hl7.org/fhir/ValueSet/contact-point-use\"\n    assert inst.status == \"draft\"\n    assert inst.targetScopeCanonical == \"http://terminology.hl7.org/ValueSet/v2-0201\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"v2 map for ContactPointUse\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/cm-contact-point-use-v2\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_conceptmap_8(base_settings):\n    \"\"\"No. 8 tests collection for ConceptMap.\n    Test File: cm-contact-point-use-v2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"cm-contact-point-use-v2.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_8(inst2)\n\n\ndef impl_conceptmap_9(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == (\n        'Canonical Mapping for \"Preferred value set for '\n        'AllergyIntolerance Clinical Status.\"'\n    )\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].code == \"active\"\n    assert inst.group[0].element[0].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[1].code == \"inactive\"\n    assert inst.group[0].element[1].target[0].code == \"inactive\"\n    assert inst.group[0].element[1].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[2].code == \"resolved\"\n    assert inst.group[0].element[2].target[0].code == \"resolved\"\n    assert inst.group[0].element[2].target[0].relationship == \"equivalent\"\n    assert inst.group[0].source == (\n        \"http://terminology.hl7.org/CodeSystem/allergyintolerance-\" \"clinical\"\n    )\n    assert inst.group[0].target == \"http://hl7.org/fhir/resource-status\"\n    assert inst.id == \"sc-allergyintolerance-clinical\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.name == \"AllergyIntoleranceClinicalStatusCodesCanonicalMap\"\n    assert inst.publisher == \"FHIR Project team\"\n    assert (\n        inst.sourceScopeCanonical\n        == \"http://hl7.org/fhir/ValueSet/allergyintolerance-clinical\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.targetScopeCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == (\n        'Canonical Mapping for \"AllergyIntolerance Clinical Status ' 'Codes\"'\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-allergyintolerance-clinical\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_conceptmap_9(base_settings):\n    \"\"\"No. 9 tests collection for ConceptMap.\n    Test File: sc-valueset-allergyintolerance-clinical.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"sc-valueset-allergyintolerance-clinical.json\"\n    )\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_9(inst2)\n\n\ndef impl_conceptmap_10(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == 'Canonical Mapping for \"Medication Status Codes\"'\n    assert inst.experimental is False\n    assert inst.group[0].element[0].code == \"entered-in-error\"\n    assert inst.group[0].element[0].target[0].code == \"error\"\n    assert inst.group[0].element[0].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[1].code == \"active\"\n    assert inst.group[0].element[1].target[0].code == \"active\"\n    assert inst.group[0].element[1].target[0].relationship == \"equivalent\"\n    assert inst.group[0].element[2].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].code == \"inactive\"\n    assert inst.group[0].element[2].target[0].relationship == \"equivalent\"\n    assert inst.group[0].source == \"http://hl7.org/fhir/CodeSystem/medication-status\"\n    assert inst.group[0].target == \"http://hl7.org/fhir/resource-status\"\n    assert inst.id == \"sc-medication-status\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.name == \"MedicationStatusCodesCanonicalMap\"\n    assert inst.publisher == \"FHIR Project team\"\n    assert inst.sourceScopeCanonical == \"http://hl7.org/fhir/ValueSet/medication-status\"\n    assert inst.status == \"draft\"\n    assert inst.targetScopeCanonical == \"http://hl7.org/fhir/ValueSet/resource-status\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == 'Canonical Mapping for \"Medication Status Codes\"'\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConceptMap/sc-medication-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_conceptmap_10(base_settings):\n    \"\"\"No. 10 tests collection for ConceptMap.\n    Test File: sc-valueset-medication-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sc-valueset-medication-status.json\"\n    inst = conceptmap.ConceptMap.model_validate_json(filename.read_bytes())\n    assert \"ConceptMap\" == inst.get_resource_type()\n\n    impl_conceptmap_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConceptMap\" == data[\"resourceType\"]\n\n    inst2 = conceptmap.ConceptMap(**data)\n    impl_conceptmap_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_condition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Condition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import condition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_condition_1(inst):\n    assert inst.bodySite[0].coding[0].code == \"280193007\"\n    assert inst.bodySite[0].coding[0].display == \"Entire retropharyngeal area\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[0].code == \"439401001\"\n    assert inst.category[0].coding[0].display == \"diagnosis\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"18099001\"\n    assert inst.code.coding[0].display == \"Retropharyngeal abscess\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/f003\"\n    assert inst.evidence[0].concept.coding[0].code == \"169068008\"\n    assert inst.evidence[0].concept.coding[0].display == \"CT of neck\"\n    assert (\n        inst.evidence[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"f003\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-02-27\"}\n        ).valueDateTime\n    )\n    assert inst.participant[0].actor.display == \"P. van de Heuvel\"\n    assert inst.participant[0].actor.reference == \"Patient/f001\"\n    assert inst.participant[0].function.coding[0].code == \"informant\"\n    assert inst.participant[0].function.coding[0].display == \"Informant\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-02-20\"}\n        ).valueDateTime\n    )\n    assert inst.severity.coding[0].code == \"371923003\"\n    assert inst.severity.coding[0].display == \"Mild to moderate\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_1(base_settings):\n    \"\"\"No. 1 tests collection for Condition.\n    Test File: condition-example-f003-abscess.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"condition-example-f003-abscess.json\"\n    )\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_1(inst2)\n\n\ndef impl_condition_2(inst):\n    assert inst.bodySite[0].coding[0].code == \"281158006\"\n    assert inst.bodySite[0].coding[0].display == \"Pulmonary vascular structure\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[0].code == \"55607006\"\n    assert inst.category[0].coding[0].display == \"Problem\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[1].code == \"problem-list-item\"\n    assert (\n        inst.category[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"10001005\"\n    assert inst.code.coding[0].display == \"Bacterial sepsis\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.display == \"Roel's encounter on March elevanth\"\n    assert inst.encounter.reference == \"Encounter/f203\"\n    assert inst.evidence[0].reference.display == \"Diagnostic report for Roel's sepsis\"\n    assert inst.evidence[0].reference.reference == \"DiagnosticReport/f202\"\n    assert inst.id == \"f203\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/f201\"\n    assert inst.participant[0].function.coding[0].code == \"author\"\n    assert inst.participant[0].function.coding[0].display == \"Author\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-11\"}\n        ).valueDateTime\n    )\n    assert inst.severity.coding[0].code == \"371924009\"\n    assert inst.severity.coding[0].display == \"Moderate to severe\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_2(base_settings):\n    \"\"\"No. 2 tests collection for Condition.\n    Test File: condition-example-f203-sepsis.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"condition-example-f203-sepsis.json\"\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_2(inst2)\n\n\ndef impl_condition_3(inst):\n    assert inst.category[0].coding[0].code == \"encounter-diagnosis\"\n    assert inst.category[0].coding[0].display == \"Encounter Diagnosis\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"422504002\"\n    assert inst.code.coding[0].display == \"Ischemic stroke (disorder)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Stroke\"\n    assert inst.id == \"stroke\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-07-18\"}\n        ).valueDateTime\n    )\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Ischemic stroke,'\n        \" July 18, 2010</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_3(base_settings):\n    \"\"\"No. 3 tests collection for Condition.\n    Test File: condition-example-stroke.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"condition-example-stroke.json\"\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_3(inst2)\n\n\ndef impl_condition_4(inst):\n    assert inst.category[0].coding[0].code == \"problem-list-item\"\n    assert inst.category[0].coding[0].display == \"Problem List Item\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"312824007\"\n    assert inst.code.coding[0].display == \"Family history of cancer of colon\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"family-history\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Family history '\n        \"of cancer of colon</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_condition_4(base_settings):\n    \"\"\"No. 4 tests collection for Condition.\n    Test File: condition-example-family-history.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"condition-example-family-history.json\"\n    )\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_4(inst2)\n\n\ndef impl_condition_5(inst):\n    assert inst.bodySite[0].coding[0].code == \"51185008\"\n    assert inst.bodySite[0].coding[0].display == \"Thorax\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[0].code == \"439401001\"\n    assert inst.category[0].coding[0].display == \"diagnosis\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"254637007\"\n    assert inst.code.coding[0].display == \"NSCLC - Non-small cell lung cancer\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/f002\"\n    assert inst.evidence[0].concept.coding[0].code == \"169069000\"\n    assert inst.evidence[0].concept.coding[0].display == \"CT of thorax\"\n    assert (\n        inst.evidence[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"f002\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-05-05\"}\n        ).valueDateTime\n    )\n    assert inst.participant[0].actor.display == \"P. van de Heuvel\"\n    assert inst.participant[0].actor.reference == \"Patient/f001\"\n    assert inst.participant[0].function.coding[0].code == \"informant\"\n    assert inst.participant[0].function.coding[0].display == \"Informant\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-06-03\"}\n        ).valueDateTime\n    )\n    assert inst.severity.coding[0].code == \"24484000\"\n    assert inst.severity.coding[0].display == \"Severe\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.stage[0].summary.coding[0].code == \"258219007\"\n    assert inst.stage[0].summary.coding[0].display == \"stage II\"\n    assert (\n        inst.stage[0].summary.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.stage[0].type.coding[0].code == \"260998006\"\n    assert inst.stage[0].type.coding[0].display == \"Clinical staging (qualifier value)\"\n    assert (\n        inst.stage[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_5(base_settings):\n    \"\"\"No. 5 tests collection for Condition.\n    Test File: condition-example-f002-lung.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"condition-example-f002-lung.json\"\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_5(inst2)\n\n\ndef impl_condition_6(inst):\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"87628006\"\n    assert inst.code.coding[0].display == \"Bacterial infectious disease\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"f205\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/f201\"\n    assert inst.participant[0].function.coding[0].code == \"author\"\n    assert inst.participant[0].function.coding[0].display == \"Author\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-04\"}\n        ).valueDateTime\n    )\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"differential\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_6(base_settings):\n    \"\"\"No. 6 tests collection for Condition.\n    Test File: condition-example-f205-infection.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"condition-example-f205-infection.json\"\n    )\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_6(inst2)\n\n\ndef impl_condition_7(inst):\n    assert (\n        inst.abatementDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-20\"}\n        ).valueDateTime\n    )\n    assert inst.bodySite[0].coding[0].code == \"181414000\"\n    assert inst.bodySite[0].coding[0].display == \"Kidney\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[0].code == \"55607006\"\n    assert inst.category[0].coding[0].display == \"Problem\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[1].code == \"problem-list-item\"\n    assert (\n        inst.category[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"inactive\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"36225005\"\n    assert (\n        inst.code.coding[0].display\n        == \"Acute renal insufficiency specified as due to procedure\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.display == \"Roel's encounter on March elevanth\"\n    assert inst.encounter.reference == \"Encounter/f203\"\n    assert inst.id == \"f204\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"The patient is anuric.\"\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-11\"}\n        ).valueDateTime\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/f201\"\n    assert inst.participant[0].function.coding[0].code == \"author\"\n    assert inst.participant[0].function.coding[0].display == \"Author\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-11\"}\n        ).valueDateTime\n    )\n    assert inst.severity.coding[0].code == \"24484000\"\n    assert inst.severity.coding[0].display == \"Severe\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.stage[0].assessment[0].display == \"Genetic analysis master panel\"\n    assert inst.stage[0].summary.coding[0].code == \"14803004\"\n    assert inst.stage[0].summary.coding[0].display == \"Temporary\"\n    assert (\n        inst.stage[0].summary.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"differential\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_7(base_settings):\n    \"\"\"No. 7 tests collection for Condition.\n    Test File: condition-example-f204-renal.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"condition-example-f204-renal.json\"\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_7(inst2)\n\n\ndef impl_condition_8(inst):\n    assert inst.category[0].coding[0].code == \"problem-list-item\"\n    assert inst.category[0].coding[0].display == \"Problem List Item\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"active\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Asthma\"\n    assert inst.id == \"example2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.onsetString == \"approximately November 2012\"\n    assert inst.severity.coding[0].code == \"255604002\"\n    assert inst.severity.coding[0].display == \"Mild\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Mild Asthma '\n        \"(Date: 12-Nov 2012)</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_8(base_settings):\n    \"\"\"No. 8 tests collection for Condition.\n    Test File: condition-example2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"condition-example2.json\"\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_8(inst2)\n\n\ndef impl_condition_9(inst):\n    assert inst.abatementAge.code == \"a\"\n    assert (\n        inst.abatementAge.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.abatementAge.unit == \"years\"\n    assert float(inst.abatementAge.value) == float(54)\n    assert inst.bodySite[0].coding[0].code == \"361355005\"\n    assert inst.bodySite[0].coding[0].display == \"Entire head and neck\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[0].code == \"encounter-diagnosis\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"resolved\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"363346000\"\n    assert inst.code.coding[0].display == \"Malignant neoplastic disease\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.evidence[0].reference.display\n        == \"Erasmus' diagnostic report of Roel's tumor\"\n    )\n    assert inst.evidence[0].reference.reference == \"DiagnosticReport/f201\"\n    assert inst.id == \"f202\"\n    assert inst.meta.security[0].code == \"TBOO\"\n    assert inst.meta.security[0].display == \"taboo\"\n    assert (\n        inst.meta.security[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.onsetAge.code == \"a\"\n    assert (\n        inst.onsetAge.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.onsetAge.unit == \"years\"\n    assert float(inst.onsetAge.value) == float(52)\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-12-01\"}\n        ).valueDateTime\n    )\n    assert inst.severity.coding[0].code == \"24484000\"\n    assert inst.severity.coding[0].display == \"Severe\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_9(base_settings):\n    \"\"\"No. 9 tests collection for Condition.\n    Test File: condition-example-f202-malignancy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"condition-example-f202-malignancy.json\"\n    )\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_9(inst2)\n\n\ndef impl_condition_10(inst):\n    assert inst.abatementString == \"around April 9, 2013\"\n    assert inst.bodySite[0].coding[0].code == \"38266002\"\n    assert inst.bodySite[0].coding[0].display == \"Entire body as a whole\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[0].code == \"55607006\"\n    assert inst.category[0].coding[0].display == \"Problem\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[1].code == \"problem-list-item\"\n    assert (\n        inst.category[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-category\"}\n        ).valueUri\n    )\n    assert inst.clinicalStatus.coding[0].code == \"resolved\"\n    assert (\n        inst.clinicalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"386661006\"\n    assert inst.code.coding[0].display == \"Fever\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/f201\"\n    assert inst.evidence[0].concept.coding[0].code == \"258710007\"\n    assert inst.evidence[0].concept.coding[0].display == \"degrees C\"\n    assert (\n        inst.evidence[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.evidence[0].reference.display == \"Temperature\"\n    assert inst.evidence[0].reference.reference == \"Observation/f202\"\n    assert inst.id == \"f201\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.onsetDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-02\"}\n        ).valueDateTime\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/f201\"\n    assert inst.participant[0].function.coding[0].code == \"enterer\"\n    assert inst.participant[0].function.coding[0].display == \"Enterer\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert inst.participant[1].actor.reference == \"Practitioner/f201\"\n    assert inst.participant[1].function.coding[0].code == \"verifier\"\n    assert inst.participant[1].function.coding[0].display == \"Verifier\"\n    assert (\n        inst.participant[1].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recordedDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-04\"}\n        ).valueDateTime\n    )\n    assert inst.severity.coding[0].code == \"255604002\"\n    assert inst.severity.coding[0].display == \"Mild\"\n    assert (\n        inst.severity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.verificationStatus.coding[0].code == \"confirmed\"\n    assert (\n        inst.verificationStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/condition-ver-status\"}\n        ).valueUri\n    )\n\n\ndef test_condition_10(base_settings):\n    \"\"\"No. 10 tests collection for Condition.\n    Test File: condition-example-f201-fever.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"condition-example-f201-fever.json\"\n    inst = condition.Condition.model_validate_json(filename.read_bytes())\n    assert \"Condition\" == inst.get_resource_type()\n\n    impl_condition_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Condition\" == data[\"resourceType\"]\n\n    inst2 = condition.Condition(**data)\n    impl_condition_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_conditiondefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ConditionDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import conditiondefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_conditiondefinition_1(inst):\n    assert inst.code.coding[0].code == \"55822004\"\n    assert inst.code.coding[0].display == \"Hyperlipidemia (disorder)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-05-26T10:44:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.definition[0]\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"https://med.stanford.edu/content/dam/sm/cerc/documents/Hyperlipidemia%20Management%20Protocol.pdf\"\n            }\n        ).valueUri\n    )\n    assert inst.description == \"Hyperlipidemia Status\"\n    assert inst.hasBodySite is False\n    assert inst.hasSeverity is False\n    assert inst.hasStage is False\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.25.1\"\n    assert inst.medication[0].code.coding[0].code == \"203151\"\n    assert inst.medication[0].code.coding[0].display == \"Gemfibrozil\"\n    assert (\n        inst.medication[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.name == \"Hyperlipidemia\"\n    assert inst.observation[0].code.coding[0].code == \"24331-1\"\n    assert (\n        inst.observation[0].code.coding[0].display\n        == \"Lipid 1996 panel - Serum or Plasma\"\n    )\n    assert (\n        inst.observation[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.observation[0].code.text == \"Lipid Panel\"\n    assert inst.observation[1].code.coding[0].code == \"35200-5\"\n    assert (\n        inst.observation[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.observation[1].code.text == \"Cholesterol\"\n    assert inst.observation[2].code.coding[0].code == \"35217-9\"\n    assert (\n        inst.observation[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.observation[2].code.text == \"Triglyceride\"\n    assert inst.observation[3].code.coding[0].code == \"2085-9\"\n    assert inst.observation[3].code.coding[0].display == \"HDL Cholesterol\"\n    assert (\n        inst.observation[3].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.observation[3].code.text == \"Cholesterol in HDL\"\n    assert inst.observation[4].code.coding[0].code == \"13457-7\"\n    assert inst.observation[4].code.coding[0].display == (\n        \"Cholesterol in LDL [Mass/volume] in Serum or Plasma by \" \"calculation\"\n    )\n    assert (\n        inst.observation[4].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.observation[4].code.text == \"LDL Chol. (Calc)\"\n    assert inst.plan[0].reference.reference == (\n        \"http://acme.com/fhir/PlanDefinition/fd0e32d8-2ebd-4211-9e50-\" \"8983efddc2c6\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Hyperlipidemia Status\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ConditionDefinition/example\"}\n        ).valueUri\n    )\n\n\ndef test_conditiondefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ConditionDefinition.\n    Test File: conditiondefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"conditiondefinition-example.json\"\n    inst = conditiondefinition.ConditionDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ConditionDefinition\" == inst.get_resource_type()\n\n    impl_conditiondefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ConditionDefinition\" == data[\"resourceType\"]\n\n    inst2 = conditiondefinition.ConditionDefinition(**data)\n    impl_conditiondefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_consent.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Consent\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import consent\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_consent_1(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.controller[0].reference == \"Organization/f001\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2018-12-28\"}).valueDate\n    )\n    assert inst.decision == \"permit\"\n    assert inst.id == \"consent-example-notThis\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.provision[0].data[0].meaning == \"related\"\n    assert (\n        inst.provision[0].data[0].reference.reference == \"MedicationRequest/medrx0305\"\n    )\n    assert inst.regulatoryBasis[0].coding[0].code == \"INFA\"\n    assert (\n        inst.regulatoryBasis[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment[0].title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_1(base_settings):\n    \"\"\"No. 1 tests collection for Consent.\n    Test File: consent-example-notThis.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-notThis.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_1(inst2)\n\n\ndef impl_consent_2(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.controller[0].reference == \"Organization/f001\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-06-23\"}).valueDate\n    )\n    assert inst.decision == \"permit\"\n    assert inst.grantor[0].reference == \"RelatedPerson/peter\"\n    assert inst.id == \"consent-example-smartonfhir\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-23T17:32:33+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.provision[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-06-23T17:02:33+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.provision[0].provision[0].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].provision[0].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[0].action[1].coding[0].code == \"correct\"\n    assert (\n        inst.provision[0].provision[0].action[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.regulatoryBasis[0].coding[0].code == \"INFA\"\n    assert (\n        inst.regulatoryBasis[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/xcda\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_2(base_settings):\n    \"\"\"No. 2 tests collection for Consent.\n    Test File: consent-example-smartonfhir.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-smartonfhir.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_2(inst2)\n\n\ndef impl_consent_3(inst):\n    assert inst.category[0].coding[0].code == \"npp\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentcategorycodes\"}\n        ).valueUri\n    )\n    assert inst.controller[0].reference == \"Organization/f001\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2018-12-28\"}).valueDate\n    )\n    assert inst.decision == \"permit\"\n    assert inst.grantee[0].reference == \"Patient/pat2\"\n    assert inst.id == \"consent-example-CDA\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.3.72.5.9.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"494e0c7a-a69e-4fb4-9d02-6aae747790d7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.provision[0].actor[0].reference.reference == \"Practitioner/f001\"\n    assert inst.provision[0].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-10\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.provision[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-10\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.provision[0].provision[0].actor[0].reference.reference\n        == \"Practitioner/xcda-author\"\n    )\n    assert inst.provision[0].provision[0].actor[0].role.coding[0].code == \"AUT\"\n    assert (\n        inst.provision[0].provision[0].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[0].code[0].coding[0].code == \"34133-9\"\n    assert (\n        inst.provision[0].provision[0].code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[0].code[1].coding[0].code == \"18842-5\"\n    assert (\n        inst.provision[0].provision[0].code[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].provision[0].documentType[0].code == \"application/hl7-cda+xml\"\n    )\n    assert (\n        inst.provision[0].provision[0].documentType[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:13\"}\n        ).valueUri\n    )\n    assert inst.regulatoryBasis[0].coding[0].code == \"INFA\"\n    assert (\n        inst.regulatoryBasis[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.sourceReference[0].reference == \"Contract/pcd-example-notAuthor\"\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/pat2\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_3(base_settings):\n    \"\"\"No. 3 tests collection for Consent.\n    Test File: consent-example-CDA.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-CDA.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_3(inst2)\n\n\ndef impl_consent_4(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.controller[0].reference == \"Organization/f001\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-11-18\"}).valueDate\n    )\n    assert inst.decision == \"permit\"\n    assert inst.id == \"consent-example-notAuthor\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.provision[0].actor[0].reference.reference == \"Organization/f001\"\n    assert inst.provision[0].actor[0].role.coding[0].code == \"CST\"\n    assert (\n        inst.provision[0].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.regulatoryBasis[0].coding[0].code == \"INFA\"\n    assert (\n        inst.regulatoryBasis[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment[0].title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_4(base_settings):\n    \"\"\"No. 4 tests collection for Consent.\n    Test File: consent-example-notAuthor.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-notAuthor.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_4(inst2)\n\n\ndef impl_consent_5(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.controller[0].reference == \"Organization/f001\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2018-12-28\"}).valueDate\n    )\n    assert inst.decision == \"permit\"\n    assert inst.id == \"consent-example-notTime\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.provision[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.regulatoryBasis[0].coding[0].code == \"INFA\"\n    assert (\n        inst.regulatoryBasis[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment[0].title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_5(base_settings):\n    \"\"\"No. 5 tests collection for Consent.\n    Test File: consent-example-notTime.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-notTime.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_5(inst2)\n\n\ndef impl_consent_6(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.controller[0].reference == \"Organization/f001\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2018-12-24\"}).valueDate\n    )\n    assert inst.decision == \"permit\"\n    assert inst.id == \"consent-example-notThem\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.provision[0].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision[0].action[1].coding[0].code == \"correct\"\n    assert (\n        inst.provision[0].action[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision[0].actor[0].reference.display == \"Carla Espinosa\"\n    assert inst.provision[0].actor[0].reference.reference == \"Practitioner/f204\"\n    assert inst.provision[0].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.regulatoryBasis[0].coding[0].code == \"INFA\"\n    assert (\n        inst.regulatoryBasis[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment[0].title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Eve Everywoman\"\n    assert inst.subject.reference == \"Patient/mom\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.verification[0].verificationDate[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-11-11\"}\n        ).valueDateTime\n    )\n    assert inst.verification[0].verified is True\n    assert inst.verification[0].verifiedBy.reference == \"Organization/f001\"\n    assert inst.verification[0].verifiedWith.reference == \"RelatedPerson/benedicte\"\n\n\ndef test_consent_6(base_settings):\n    \"\"\"No. 6 tests collection for Consent.\n    Test File: consent-example-notThem.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-notThem.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_6(inst2)\n\n\ndef impl_consent_7(inst):\n    assert inst.category[0].coding[0].code == \"INFAO\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.controller[0].reference == \"Organization/f203\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2018-12-24\"}).valueDate\n    )\n    assert inst.decision == \"deny\"\n    assert inst.grantee[0].display == \"Simone Heps\"\n    assert inst.grantee[0].reference == \"Practitioner/f007\"\n    assert inst.grantor[0].reference == \"Patient/pat1\"\n    assert inst.id == \"consent-example-grantor\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.provision[0].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision[0].actor[0].reference.reference == \"Organization/f203\"\n    assert inst.provision[0].actor[0].role.coding[0].code == \"CST\"\n    assert (\n        inst.provision[0].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].actor[1].reference.display == \"Simone Heps\"\n    assert inst.provision[0].actor[1].reference.reference == \"Practitioner/f007\"\n    assert inst.provision[0].actor[1].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].actor[1].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.regulatoryBasis[0].coding[0].code == \"INFAO\"\n    assert (\n        inst.regulatoryBasis[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment[0].title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_7(base_settings):\n    \"\"\"No. 7 tests collection for Consent.\n    Test File: consent-example-grantor.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-grantor.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_7(inst2)\n\n\ndef impl_consent_8(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.controller[0].reference == \"Organization/2.16.840.1.113883.19.5\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2018-12-24\"}).valueDate\n    )\n    assert inst.decision == \"permit\"\n    assert inst.id == \"consent-example-notOrg\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.provision[0].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision[0].action[1].coding[0].code == \"correct\"\n    assert (\n        inst.provision[0].action[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision[0].actor[0].reference.reference == \"Organization/f001\"\n    assert inst.provision[0].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.regulatoryBasis[0].coding[0].code == \"INFA\"\n    assert (\n        inst.regulatoryBasis[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment[0].title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_8(base_settings):\n    \"\"\"No. 8 tests collection for Consent.\n    Test File: consent-example-notOrg.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-notOrg.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_8(inst2)\n\n\ndef impl_consent_9(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.controller[0].reference == \"Organization/f001\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2018-12-28\"}).valueDate\n    )\n    assert inst.decision == \"deny\"\n    assert inst.id == \"consent-example-pkb\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.provision[0].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.provision[0].actor[0].reference.reference == \"Organization/f001\"\n    assert inst.provision[0].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[0].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].provision[0].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].provision[0].actor[0].reference.reference\n        == \"Organization/f001\"\n    )\n    assert inst.provision[0].provision[0].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].provision[0].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[0].securityLabel[0].code == \"PSY\"\n    assert (\n        inst.provision[0].provision[0].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[1].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].provision[1].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].provision[1].actor[0].reference.reference\n        == \"Organization/f001\"\n    )\n    assert inst.provision[0].provision[1].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].provision[1].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[1].securityLabel[0].code == \"SPI\"\n    assert (\n        inst.provision[0].provision[1].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[2].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].provision[2].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].provision[2].actor[0].reference.reference\n        == \"Organization/f001\"\n    )\n    assert inst.provision[0].provision[2].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].provision[2].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[2].securityLabel[0].code == \"N\"\n    assert (\n        inst.provision[0].provision[2].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[3].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].provision[3].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].provision[3].actor[0].reference.reference\n        == \"Organization/f001\"\n    )\n    assert inst.provision[0].provision[3].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].provision[3].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[3].securityLabel[0].code == \"PSY\"\n    assert (\n        inst.provision[0].provision[3].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[4].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].provision[4].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].provision[4].actor[0].reference.reference\n        == \"Organization/f001\"\n    )\n    assert inst.provision[0].provision[4].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].provision[4].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[4].securityLabel[0].code == \"SPI\"\n    assert (\n        inst.provision[0].provision[4].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[5].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].provision[5].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].provision[5].actor[0].reference.reference\n        == \"Organization/f001\"\n    )\n    assert inst.provision[0].provision[5].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].provision[5].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[5].securityLabel[0].code == \"SEX\"\n    assert (\n        inst.provision[0].provision[5].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[6].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].provision[6].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].provision[6].actor[0].reference.reference\n        == \"Organization/f001\"\n    )\n    assert inst.provision[0].provision[6].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].provision[6].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[6].securityLabel[0].code == \"N\"\n    assert (\n        inst.provision[0].provision[6].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[7].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].provision[7].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].provision[7].actor[0].reference.reference\n        == \"Organization/f001\"\n    )\n    assert inst.provision[0].provision[7].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].provision[7].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[7].securityLabel[0].code == \"PSY\"\n    assert (\n        inst.provision[0].provision[7].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[8].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].provision[8].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].provision[8].actor[0].reference.reference\n        == \"Organization/f001\"\n    )\n    assert inst.provision[0].provision[8].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].provision[8].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[8].securityLabel[0].code == \"SPI\"\n    assert (\n        inst.provision[0].provision[8].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[9].action[0].coding[0].code == \"access\"\n    assert (\n        inst.provision[0].provision[9].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].provision[9].actor[0].reference.reference\n        == \"Organization/f001\"\n    )\n    assert inst.provision[0].provision[9].actor[0].role.coding[0].code == \"PRCP\"\n    assert (\n        inst.provision[0].provision[9].actor[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.provision[0].provision[9].securityLabel[0].code == \"SEX\"\n    assert (\n        inst.provision[0].provision[9].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.provision[0].securityLabel[0].code == \"N\"\n    assert (\n        inst.provision[0].securityLabel[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.regulatoryBasis[0].coding[0].code == \"INFA\"\n    assert (\n        inst.regulatoryBasis[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_9(base_settings):\n    \"\"\"No. 9 tests collection for Consent.\n    Test File: consent-example-pkb.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example-pkb.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_9(inst2)\n\n\ndef impl_consent_10(inst):\n    assert inst.category[0].coding[0].code == \"59284-0\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.controller[0].reference == \"Organization/f001\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2018-12-28\"}).valueDate\n    )\n    assert inst.decision == \"deny\"\n    assert inst.id == \"consent-example-basic\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.provision[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.provision[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1964-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.regulatoryBasis[0].coding[0].code == \"INFA\"\n    assert (\n        inst.regulatoryBasis[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.sourceAttachment[0].title == \"The terms of the consent in lawyer speak.\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_consent_10(base_settings):\n    \"\"\"No. 10 tests collection for Consent.\n    Test File: consent-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"consent-example.json\"\n    inst = consent.Consent.model_validate_json(filename.read_bytes())\n    assert \"Consent\" == inst.get_resource_type()\n\n    impl_consent_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Consent\" == data[\"resourceType\"]\n\n    inst2 = consent.Consent(**data)\n    impl_consent_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_contract.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Contract\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import contract\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_contract_1(inst):\n    assert inst.authority[0].display == \"Michigan Health\"\n    assert inst.authority[0].reference == \"Organization/3\"\n    assert inst.domain[0].display == \"UK Pharmacies\"\n    assert inst.domain[0].reference == \"Location/ukp\"\n    assert (\n        inst.friendly[0].contentAttachment.title\n        == \"The terms of the consent in friendly consumer speak.\"\n    )\n    assert inst.id == \"pcd-example-notOrg\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.legal[0].contentAttachment.title\n        == \"The terms of the consent in lawyer speak.\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subType[0].coding[0].code == \"Opt-In\"\n    assert inst.subType[0].coding[0].display == \"Default Authorization with exceptions.\"\n    assert (\n        inst.subType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.infoway-inforoute.ca.org/Consent-subtype-codes\"}\n        ).valueUri\n    )\n    assert inst.subject[0].display == \"P. van de Heuvel\"\n    assert inst.subject[0].reference == \"Patient/f001\"\n    assert inst.term[0].offer.text == (\n        \"Withhold this order and any results or related objects from \" \"any provider.\"\n    )\n    assert inst.term[0].offer.topic.display == \"Good Health Clinic\"\n    assert inst.term[0].offer.topic.reference == \"Organization/2.16.840.1.113883.19.5\"\n    assert inst.term[0].type.coding[0].code == \"withhold-from\"\n    assert (\n        inst.term[0].type.coding[0].display\n        == \"Withhold all data from specified actor entity.\"\n    )\n    assert (\n        inst.term[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/consent-term-type-codes\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"57016-8\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_contract_1(base_settings):\n    \"\"\"No. 1 tests collection for Contract.\n    Test File: pcd-example-notOrg.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"pcd-example-notOrg.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_1(inst2)\n\n\ndef impl_contract_2(inst):\n    assert (\n        inst.applies.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"INS-101\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://xyz-insurance.com/forms\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"YCSCWLN(01-2017)\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subject[0].reference == \"Patient/1\"\n    assert (\n        inst.term[0].asset[0].period[0].start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-06-01\"}\n        ).valueDateTime\n    )\n    assert inst.term[0].asset[0].subtype[0].text == \"sample\"\n    assert (\n        inst.term[0].asset[0].type[0].coding[0].code\n        == \"urn:uuid:3a48c68c-318d-4c68-8471-4a3c10fcb41b\"\n    )\n    assert inst.term[0].asset[0].type[0].coding[0].display == \"RicardianContract\"\n    assert (\n        inst.term[0].asset[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.term[0].asset[0].valuedItem[0].effectiveTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1995\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.term[0].asset[0].valuedItem[0].entityCodeableConcept.text == \"Ford Bobcat\"\n    )\n    assert float(inst.term[0].asset[0].valuedItem[0].factor) == float(1.0)\n    assert (\n        inst.term[0].asset[0].valuedItem[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://somewhere.motor-vehicle.com/vin\"}\n        ).valueUri\n    )\n    assert inst.term[0].asset[0].valuedItem[0].identifier.value == \"XXSVT34-7665t952236\"\n    assert inst.term[0].asset[0].valuedItem[0].net.currency == \"CAD\"\n    assert float(inst.term[0].asset[0].valuedItem[0].net.value) == float(200.0)\n    assert float(inst.term[0].asset[0].valuedItem[0].points) == float(1.0)\n    assert float(inst.term[0].asset[0].valuedItem[0].quantity.value) == float(1)\n    assert inst.term[0].asset[0].valuedItem[0].unitPrice.currency == \"CAD\"\n    assert float(inst.term[0].asset[0].valuedItem[0].unitPrice.value) == float(200.0)\n    assert inst.term[0].group[0].offer.text == \"Eligible Providers\"\n    assert inst.term[0].group[1].offer.text == \"Responsibility for Payment\"\n    assert inst.term[0].group[2].group[0].group[0].offer.text == \"Emergency Room Copay\"\n    assert (\n        inst.term[0].group[2].group[0].group[1].offer.text == \"Professional Visit Copay\"\n    )\n    assert inst.term[0].group[2].group[0].offer.text == \"Copays\"\n    assert inst.term[0].group[2].group[1].offer.text == \"Calendar Year Deductible\"\n    assert inst.term[0].group[2].group[2].offer.text == \"Out-Of-Pocket Maximum\"\n    assert inst.term[0].group[2].group[3].group[0].offer.text == \"Ambulance Services\"\n    assert inst.term[0].group[2].group[3].group[1].offer.text == \"Dental Services\"\n    assert inst.term[0].group[2].group[3].group[2].offer.text == \"Diagnostic Services\"\n    assert (\n        inst.term[0].group[2].group[3].group[3].offer.text == \"Emergency Room Services\"\n    )\n    assert (\n        inst.term[0].group[2].group[3].group[4].offer.text == \"Hospital Inpatient Care\"\n    )\n    assert inst.term[0].group[2].group[3].offer.text == \"Medical Services\"\n    assert inst.term[0].group[2].offer.text == \"List of Benefits\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"healthinsurance\"\n    assert inst.type.coding[0].display == \"Health Insurance\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/contract-type\"}\n        ).valueUri\n    )\n\n\ndef test_contract_2(base_settings):\n    \"\"\"No. 2 tests collection for Contract.\n    Test File: contract-example-ins-policy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"contract-example-ins-policy.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_2(inst2)\n\n\ndef impl_contract_3(inst):\n    assert (\n        inst.applies.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-11-01T21:18:27-04:00\"}\n        ).valueDateTime\n    )\n    assert inst.contentDerivative.coding[0].code == \"registration\"\n    assert (\n        inst.contentDerivative.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/contract-content-derivative\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"C-2121\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-11-01T21:18:27-04:00\"}\n        ).valueDateTime\n    )\n    assert inst.legal[0].contentAttachment.contentType == \"application/pdf\"\n    assert inst.legal[0].contentAttachment.language == \"en-US\"\n    assert (\n        inst.legal[0].contentAttachment.title\n        == \"MDHHS-5515 Consent To Share Your Health Information\"\n    )\n    assert (\n        inst.legal[0].contentAttachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://org.mihin.ecms/ConsentDirective-2121\"}\n        ).valueUrl\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-07-19T18:18:42.108-04:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.meta.versionId == \"1\"\n    assert inst.signer[0].party.display == \"Alice Recruit\"\n    assert inst.signer[0].party.reference == \"Patient/f201\"\n    assert inst.signer[0].signature[0].type[0].code == \"1.2.840.10065.1.12.1.1\"\n    assert (\n        inst.signer[0].signature[0].type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso-astm:E1762-95:2013\"}\n        ).valueUri\n    )\n    assert (\n        inst.signer[0].signature[0].when\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2017-02-08T10:57:34+01:00\"}\n        ).valueInstant\n    )\n    assert inst.signer[0].signature[0].who.reference == \"Patient/f201\"\n    assert inst.signer[0].type.code == \"SELF\"\n    assert (\n        inst.signer[0].type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://mdhhs.org/fhir/consent-signer-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"executed\"\n    assert inst.subType[0].coding[0].code == \"hcd\"\n    assert (\n        inst.subType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentcategorycodes\"}\n        ).valueUri\n    )\n    assert inst.subject[0].reference == \"Patient/f201\"\n    assert inst.term[0].action[0].intent.coding[0].code == \"HPRGRP\"\n    assert (\n        inst.term[0].action[0].intent.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.term[0].action[0].status.text == \"Sample\"\n    assert (\n        inst.term[0].action[0].subject[0].reference[0].display\n        == \"VA Ann Arbor Healthcare System\"\n    )\n    assert (\n        inst.term[0].action[0].subject[0].reference[0].reference == \"Organization/f001\"\n    )\n    assert inst.term[0].action[0].subject[0].role.coding[0].code == \"IR\"\n    assert inst.term[0].action[0].subject[0].role.coding[0].display == \"Recipient\"\n    assert (\n        inst.term[0].action[0].subject[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://mdhhs.org/fhir/consent-actor-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.term[0].action[0].subject[0].role.text\n        == \"Recipient of restricted health information\"\n    )\n    assert (\n        inst.term[0].action[0].subject[1].reference[0].display\n        == \"Community Mental Health Clinic\"\n    )\n    assert inst.term[0].action[0].subject[1].reference[0].reference == \"Organization/2\"\n    assert inst.term[0].action[0].subject[1].role.coding[0].code == \"IS\"\n    assert inst.term[0].action[0].subject[1].role.coding[0].display == \"Sender\"\n    assert (\n        inst.term[0].action[0].subject[1].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://mdhhs.org/fhir/consent-actor-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.term[0].action[0].subject[1].role.text\n        == \"Sender of restricted health information\"\n    )\n    assert inst.term[0].action[0].type.coding[0].code == \"action-a\"\n    assert (\n        inst.term[0].action[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/contractaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.term[0].asset[0].period[0].end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-11-01T21:18:27-04:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.term[0].asset[0].period[0].start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-11-01T21:18:27-04:00\"}\n        ).valueDateTime\n    )\n    assert inst.term[0].offer.decision.coding[0].code == \"OPTIN\"\n    assert (\n        inst.term[0].offer.decision.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.term[0].offer.text == \"Can't refuse\"\n    assert inst.term[0].offer.type.coding[0].code == \"statutory\"\n    assert (\n        inst.term[0].offer.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/contracttermtypecodes\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"OPTIN\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://mdhhs.org/fhir/consentdirective-type\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"Opt-in consent directive\"\n\n\ndef test_contract_3(base_settings):\n    \"\"\"No. 3 tests collection for Contract.\n    Test File: contract-example-42cfr-part2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"contract-example-42cfr-part2.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_3(inst2)\n\n\ndef impl_contract_4(inst):\n    assert inst.authority[0].display == \"Michigan Health\"\n    assert inst.authority[0].reference == \"Organization/3\"\n    assert inst.domain[0].display == \"UK Pharmacies\"\n    assert inst.domain[0].reference == \"Location/ukp\"\n    assert (\n        inst.friendly[0].contentAttachment.title\n        == \"The terms of the consent in friendly consumer speak.\"\n    )\n    assert inst.id == \"pcd-example-notLabs\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-17\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.legal[0].contentAttachment.title\n        == \"The terms of the consent in lawyer speak.\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subType[0].coding[0].code == \"Opt-In\"\n    assert inst.subType[0].coding[0].display == \"Default Authorization with exceptions.\"\n    assert (\n        inst.subType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.infoway-inforoute.ca.org/Consent-subtype-codes\"}\n        ).valueUri\n    )\n    assert inst.subject[0].display == \"P. van de Heuvel\"\n    assert inst.subject[0].reference == \"Patient/f001\"\n    assert inst.term[0].group[0].offer.text == \"Withhold orders from any provider.\"\n    assert inst.term[0].group[0].subType.coding[0].code == \"ServiceRequest\"\n    assert (\n        inst.term[0].group[0].subType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.term[0].group[0].type.coding[0].code == \"withhold-object-type\"\n    assert (\n        inst.term[0].group[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/consent-term-type-codes\"}\n        ).valueUri\n    )\n    assert (\n        inst.term[0].group[1].offer.text == \"Withhold order results from any provider.\"\n    )\n    assert inst.term[0].group[1].subType.coding[0].code == \"DiagnosticReport\"\n    assert (\n        inst.term[0].group[1].subType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.term[0].group[1].type.coding[0].code == \"withhold-object-type\"\n    assert (\n        inst.term[0].group[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/consent-term-type-codes\"}\n        ).valueUri\n    )\n    assert inst.term[0].offer.text == \"sample\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"57016-8\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_contract_4(base_settings):\n    \"\"\"No. 4 tests collection for Contract.\n    Test File: pcd-example-notLabs.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"pcd-example-notLabs.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_4(inst2)\n\n\ndef impl_contract_5(inst):\n    assert inst.authority[0].display == \"Michigan Health\"\n    assert inst.authority[0].reference == \"Organization/3\"\n    assert inst.domain[0].display == \"UK Pharmacies\"\n    assert inst.domain[0].reference == \"Location/ukp\"\n    assert (\n        inst.friendly[0].contentAttachment.title\n        == \"The terms of the consent in friendly consumer speak.\"\n    )\n    assert inst.id == \"pcd-example-notThem\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.legal[0].contentAttachment.title\n        == \"The terms of the consent in lawyer speak.\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.signer[0].party.reference == \"Patient/f001\"\n    assert inst.signer[0].signature[0].type[0].code == \"1.2.840.10065.1.12.1.1\"\n    assert (\n        inst.signer[0].signature[0].type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso-astm:E1762-95:2013\"}\n        ).valueUri\n    )\n    assert (\n        inst.signer[0].signature[0].when\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-06-08T10:57:34-07:00\"}\n        ).valueInstant\n    )\n    assert inst.signer[0].signature[0].who.reference == \"Patient/f001\"\n    assert inst.signer[0].type.code == \"COVPTY\"\n    assert (\n        inst.signer[0].type.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/contractsignertypecodes\"\n            }\n        ).valueUri\n    )\n    assert inst.subType[0].coding[0].code == \"Opt-In\"\n    assert inst.subType[0].coding[0].display == \"Default Authorization with exceptions.\"\n    assert (\n        inst.subType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.infoway-inforoute.ca.org/Consent-subtype-codes\"}\n        ).valueUri\n    )\n    assert inst.subject[0].display == \"P. van de Heuvel\"\n    assert inst.subject[0].reference == \"Patient/f001\"\n    assert inst.term[0].offer.text == (\n        \"Withhold this order and any results or related objects from \"\n        \"specified nurse provider.\"\n    )\n    assert inst.term[0].offer.topic.display == \"Fictive Nurse\"\n    assert inst.term[0].offer.topic.reference == \"Practitioner/f204\"\n    assert inst.term[0].type.coding[0].code == \"withhold-from\"\n    assert (\n        inst.term[0].type.coding[0].display\n        == \"Withhold all data from specified actor entity.\"\n    )\n    assert (\n        inst.term[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/consent-term-type-codes\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"57016-8\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_contract_5(base_settings):\n    \"\"\"No. 5 tests collection for Contract.\n    Test File: pcd-example-notThem.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"pcd-example-notThem.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_5(inst2)\n\n\ndef impl_contract_6(inst):\n    assert inst.authority[0].display == \"Michigan Health\"\n    assert inst.authority[0].reference == \"Organization/3\"\n    assert inst.domain[0].display == \"UK Pharmacies\"\n    assert inst.domain[0].reference == \"Location/ukp\"\n    assert (\n        inst.friendly[0].contentAttachment.title\n        == \"The terms of the consent in friendly consumer speak.\"\n    )\n    assert inst.id == \"pcd-example-notAuthor\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.legal[0].contentAttachment.title\n        == \"The terms of the consent in lawyer speak.\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subType[0].coding[0].code == \"Opt-In\"\n    assert inst.subType[0].coding[0].display == \"Default Authorization with exceptions.\"\n    assert (\n        inst.subType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.infoway-inforoute.ca.org/Consent-subtype-codes\"}\n        ).valueUri\n    )\n    assert inst.subject[0].display == \"P. van de Heuvel\"\n    assert inst.subject[0].reference == \"Patient/f001\"\n    assert (\n        inst.term[0].offer.text == \"Withhold all data authored by Good Health provider.\"\n    )\n    assert inst.term[0].offer.topic.display == \"Good Health Clinic\"\n    assert inst.term[0].offer.topic.reference == \"Organization/2.16.840.1.113883.19.5\"\n    assert inst.term[0].type.coding[0].code == \"withhold-authored-by\"\n    assert (\n        inst.term[0].type.coding[0].display\n        == \"Withhold all data authored by specified actor entity.\"\n    )\n    assert (\n        inst.term[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/consent-term-type-codes\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"57016-8\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_contract_6(base_settings):\n    \"\"\"No. 6 tests collection for Contract.\n    Test File: pcd-example-notAuthor.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"pcd-example-notAuthor.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_6(inst2)\n\n\ndef impl_contract_7(inst):\n    assert inst.id == \"C-123\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/contract\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12347\"\n    assert inst.legallyBindingAttachment.contentType == \"application/pdf\"\n    assert (\n        inst.legallyBindingAttachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.aws3.com/storage/doc.pdf\"}\n        ).valueUrl\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.rule[0].contentAttachment.contentType == \"application/txt\"\n    assert (\n        inst.rule[0].contentAttachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.rfc-editor.org/bcp/bcp13.txt\"}\n        ).valueUrl\n    )\n    assert (\n        inst.term[0].asset[0].period[0].start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-06-01\"}\n        ).valueDateTime\n    )\n    assert inst.term[0].asset[0].subtype[0].text == \"sample\"\n    assert (\n        inst.term[0].asset[0].type[0].coding[0].code\n        == \"urn:uuid:3a48c68c-318d-4c68-8471-4a3c10fcb41b\"\n    )\n    assert inst.term[0].asset[0].type[0].coding[0].display == \"RicardianContract\"\n    assert (\n        inst.term[0].asset[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.term[0].asset[0].valuedItem[0].effectiveTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1995\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.term[0].asset[0].valuedItem[0].entityCodeableConcept.text == \"Ford Bobcat\"\n    )\n    assert float(inst.term[0].asset[0].valuedItem[0].factor) == float(1.0)\n    assert (\n        inst.term[0].asset[0].valuedItem[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://somewhere.motor-vehicle.com/vin\"}\n        ).valueUri\n    )\n    assert inst.term[0].asset[0].valuedItem[0].identifier.value == \"XXSVT34-7665t952236\"\n    assert inst.term[0].asset[0].valuedItem[0].net.currency == \"CAD\"\n    assert float(inst.term[0].asset[0].valuedItem[0].net.value) == float(200.0)\n    assert float(inst.term[0].asset[0].valuedItem[0].points) == float(1.0)\n    assert float(inst.term[0].asset[0].valuedItem[0].quantity.value) == float(1)\n    assert inst.term[0].asset[0].valuedItem[0].unitPrice.currency == \"CAD\"\n    assert float(inst.term[0].asset[0].valuedItem[0].unitPrice.value) == float(200.0)\n    assert inst.term[0].offer.text == \"Can't refuse\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the contract</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_contract_7(base_settings):\n    \"\"\"No. 7 tests collection for Contract.\n    Test File: contract-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"contract-example.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_7(inst2)\n\n\ndef impl_contract_8(inst):\n    assert inst.authority[0].display == \"Michigan Health\"\n    assert inst.authority[0].reference == \"Organization/3\"\n    assert inst.domain[0].display == \"UK Pharmacies\"\n    assert inst.domain[0].reference == \"Location/ukp\"\n    assert (\n        inst.friendly[0].contentAttachment.title\n        == \"The terms of the consent in friendly consumer speak.\"\n    )\n    assert inst.id == \"pcd-example-notThis\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.legal[0].contentAttachment.title\n        == \"The terms of the consent in lawyer speak.\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subType[0].coding[0].code == \"Opt-In\"\n    assert inst.subType[0].coding[0].display == \"Default Authorization with exceptions.\"\n    assert (\n        inst.subType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.infoway-inforoute.ca.org/Consent-subtype-codes\"}\n        ).valueUri\n    )\n    assert inst.subject[0].display == \"P. van de Heuvel\"\n    assert inst.subject[0].reference == \"Patient/f001\"\n    assert (\n        inst.term[0].applies.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-18\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.term[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/term-items\"}\n        ).valueUri\n    )\n    assert inst.term[0].identifier.value == \"3347689\"\n    assert (\n        inst.term[0].issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-11-01\"}\n        ).valueDateTime\n    )\n    assert inst.term[0].offer.text == (\n        \"Withhold this order and any results or related objects from \" \"any provider.\"\n    )\n    assert inst.term[0].offer.topic.reference == \"ServiceRequest/lipid\"\n    assert inst.term[0].type.coding[0].code == \"withhold-identified-object-and-related\"\n    assert inst.term[0].type.coding[0].display == (\n        \"Withhold the identified object and any other resources that \"\n        \"are related to this object.\"\n    )\n    assert (\n        inst.term[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/consent-term-type-codes\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"57016-8\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n\n\ndef test_contract_8(base_settings):\n    \"\"\"No. 8 tests collection for Contract.\n    Test File: pcd-example-notThis.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"pcd-example-notThis.json\"\n    inst = contract.Contract.model_validate_json(filename.read_bytes())\n    assert \"Contract\" == inst.get_resource_type()\n\n    impl_contract_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Contract\" == data[\"resourceType\"]\n\n    inst2 = contract.Contract(**data)\n    impl_contract_8(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_coverage.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Coverage\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import coverage\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_coverage_1(inst):\n    assert inst.beneficiary.reference == \"Patient/5\"\n    assert inst.class_fhir[0].name == \"Western Airlines\"\n    assert inst.class_fhir[0].type.coding[0].code == \"group\"\n    assert (\n        inst.class_fhir[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[0].value.value == \"WESTAIR\"\n    assert (\n        inst.class_fhir[1].name\n        == \"Full Coverage: Medical, Dental, Pharmacy, Vision, EHC\"\n    )\n    assert inst.class_fhir[1].type.coding[0].code == \"plan\"\n    assert (\n        inst.class_fhir[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[1].value.value == \"BG4352\"\n    assert inst.class_fhir[2].name == \"Platinum\"\n    assert inst.class_fhir[2].type.coding[0].code == \"subplan\"\n    assert (\n        inst.class_fhir[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[2].value.value == \"D15C9\"\n    assert inst.contract[0].reference == \"Contract/INS-101\"\n    assert (\n        inst.costToBeneficiary[0].exception[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.costToBeneficiary[0].exception[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.costToBeneficiary[0].exception[0].type.coding[0].code == \"retired\"\n    assert (\n        inst.costToBeneficiary[0].exception[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-coverage-financial-exception\"\n            }\n        ).valueUri\n    )\n    assert inst.costToBeneficiary[0].type.coding[0].code == \"gpvisit\"\n    assert (\n        inst.costToBeneficiary[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-copay-type\"}\n        ).valueUri\n    )\n    assert inst.costToBeneficiary[0].valueMoney.currency == \"USD\"\n    assert float(inst.costToBeneficiary[0].valueMoney.value) == float(20.0)\n    assert inst.dependent == \"1\"\n    assert inst.id == \"7546D\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://xyz.com/codes/identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"AB98761\"\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.kind == \"insurance\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.network == \"5\"\n    assert inst.order == 2\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-03-17\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-03-17\"}\n        ).valueDateTime\n    )\n    assert inst.relationship.coding[0].code == \"self\"\n    assert inst.status == \"active\"\n    assert inst.subscriber.reference == \"Patient/5\"\n    assert inst.subscriberId[0].value == \"AB9876\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the coverage</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"EHCPOL\"\n    assert inst.type.coding[0].display == \"extended healthcare\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n\n\ndef test_coverage_1(base_settings):\n    \"\"\"No. 1 tests collection for Coverage.\n    Test File: coverage-example-2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"coverage-example-2.json\"\n    inst = coverage.Coverage.model_validate_json(filename.read_bytes())\n    assert \"Coverage\" == inst.get_resource_type()\n\n    impl_coverage_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Coverage\" == data[\"resourceType\"]\n\n    inst2 = coverage.Coverage(**data)\n    impl_coverage_1(inst2)\n\n\ndef impl_coverage_2(inst):\n    assert inst.beneficiary.reference == \"Patient/5\"\n    assert inst.id == \"SP1234\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hospitalx.com/selfpayagreement\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"SP12345678\"\n    assert inst.kind == \"self-pay\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.paymentBy[0].party.reference == \"Patient/5\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-03-17\"}\n        ).valueDateTime\n    )\n    assert inst.relationship.coding[0].code == \"self\"\n    assert inst.status == \"active\"\n    assert inst.subscriber.reference == \"Patient/5\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of a Self Pay Agreement.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"pay\"\n    assert inst.type.coding[0].display == \"PAY\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-selfpay\"}\n        ).valueUri\n    )\n\n\ndef test_coverage_2(base_settings):\n    \"\"\"No. 2 tests collection for Coverage.\n    Test File: coverage-example-selfpay.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"coverage-example-selfpay.json\"\n    inst = coverage.Coverage.model_validate_json(filename.read_bytes())\n    assert \"Coverage\" == inst.get_resource_type()\n\n    impl_coverage_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Coverage\" == data[\"resourceType\"]\n\n    inst2 = coverage.Coverage(**data)\n    impl_coverage_2(inst2)\n\n\ndef impl_coverage_3(inst):\n    assert inst.beneficiary.reference == \"Patient/5\"\n    assert inst.id == \"7547E\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ehic.com/insurer/123456789/member\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"A123456780\"\n    assert (\n        inst.insurer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ehic.com/insurer\"}\n        ).valueUri\n    )\n    assert inst.insurer.identifier.value == \"123456789\"\n    assert inst.kind == \"insurance\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-03-17\"}\n        ).valueDateTime\n    )\n    assert inst.relationship.coding[0].code == \"self\"\n    assert inst.status == \"active\"\n    assert inst.subscriber.reference == \"Patient/5\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the European Health Insurance Card</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"EHCPOL\"\n    assert inst.type.coding[0].display == \"extended healthcare\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n\n\ndef test_coverage_3(base_settings):\n    \"\"\"No. 3 tests collection for Coverage.\n    Test File: coverage-example-ehic.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"coverage-example-ehic.json\"\n    inst = coverage.Coverage.model_validate_json(filename.read_bytes())\n    assert \"Coverage\" == inst.get_resource_type()\n\n    impl_coverage_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Coverage\" == data[\"resourceType\"]\n\n    inst2 = coverage.Coverage(**data)\n    impl_coverage_3(inst2)\n\n\ndef impl_coverage_4(inst):\n    assert inst.beneficiary.reference == \"Patient/4\"\n    assert inst.class_fhir[0].name == \"Corporate Baker's Inc. Local #35\"\n    assert inst.class_fhir[0].type.coding[0].code == \"group\"\n    assert (\n        inst.class_fhir[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[0].value.value == \"CB135\"\n    assert inst.class_fhir[1].name == \"Trainee Part-time Benefits\"\n    assert inst.class_fhir[1].type.coding[0].code == \"subgroup\"\n    assert (\n        inst.class_fhir[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[1].value.value == \"123\"\n    assert (\n        inst.class_fhir[2].name\n        == \"Full Coverage: Medical, Dental, Pharmacy, Vision, EHC\"\n    )\n    assert inst.class_fhir[2].type.coding[0].code == \"plan\"\n    assert (\n        inst.class_fhir[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[2].value.value == \"B37FC\"\n    assert inst.class_fhir[3].name == \"Includes afterlife benefits\"\n    assert inst.class_fhir[3].type.coding[0].code == \"subplan\"\n    assert (\n        inst.class_fhir[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[3].value.value == \"P7\"\n    assert inst.class_fhir[4].name == \"Silver: Family Plan spouse only\"\n    assert inst.class_fhir[4].type.coding[0].code == \"class\"\n    assert (\n        inst.class_fhir[4].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[4].value.value == \"SILVER\"\n    assert inst.class_fhir[5].name == \"Low deductable, max $20 copay\"\n    assert inst.class_fhir[5].type.coding[0].code == \"subclass\"\n    assert (\n        inst.class_fhir[5].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[5].value.value == \"Tier2\"\n    assert inst.class_fhir[6].type.coding[0].code == \"sequence\"\n    assert (\n        inst.class_fhir[6].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[6].value.value == \"9\"\n    assert inst.class_fhir[7].type.coding[0].code == \"rxid\"\n    assert (\n        inst.class_fhir[7].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[7].value.value == \"MDF12345\"\n    assert inst.class_fhir[8].type.coding[0].code == \"rxbin\"\n    assert (\n        inst.class_fhir[8].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[8].value.value == \"987654\"\n    assert inst.class_fhir[9].type.coding[0].code == \"rxgroup\"\n    assert (\n        inst.class_fhir[9].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/coverage-class\"}\n        ).valueUri\n    )\n    assert inst.class_fhir[9].value.value == \"M35PT\"\n    assert inst.dependent == \"0\"\n    assert inst.id == \"9876B1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://benefitsinc.com/certificate\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.kind == \"insurance\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-05-23\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-05-23\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.policyHolder.reference == \"http://benefitsinc.com/FHIR/Organization/CBI35\"\n    )\n    assert inst.relationship.coding[0].code == \"self\"\n    assert inst.status == \"active\"\n    assert inst.subscriber.reference == \"Patient/4\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the coverage</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"EHCPOL\"\n    assert inst.type.coding[0].display == \"extended healthcare\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n\n\ndef test_coverage_4(base_settings):\n    \"\"\"No. 4 tests collection for Coverage.\n    Test File: coverage-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"coverage-example.json\"\n    inst = coverage.Coverage.model_validate_json(filename.read_bytes())\n    assert \"Coverage\" == inst.get_resource_type()\n\n    impl_coverage_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Coverage\" == data[\"resourceType\"]\n\n    inst2 = coverage.Coverage(**data)\n    impl_coverage_4(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_coverageeligibilityrequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import coverageeligibilityrequest\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_coverageeligibilityrequest_1(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"52345\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/coverageelegibilityrequest\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"52345\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.purpose[0] == \"validation\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the CoverageEligibilityRequest</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_coverageeligibilityrequest_1(base_settings):\n    \"\"\"No. 1 tests collection for CoverageEligibilityRequest.\n    Test File: coverageeligibilityrequest-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"coverageeligibilityrequest-example.json\"\n    )\n    inst = coverageeligibilityrequest.CoverageEligibilityRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CoverageEligibilityRequest\" == inst.get_resource_type()\n\n    impl_coverageeligibilityrequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CoverageEligibilityRequest\" == data[\"resourceType\"]\n\n    inst2 = coverageeligibilityrequest.CoverageEligibilityRequest(**data)\n    impl_coverageeligibilityrequest_1(inst2)\n\n\ndef impl_coverageeligibilityrequest_2(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.enterer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalleyclinic.com/staff\"}\n        ).valueUri\n    )\n    assert inst.enterer.identifier.value == \"14\"\n    assert (\n        inst.facility.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://statecliniclicensor.com/clinicid\"}\n        ).valueUri\n    )\n    assert inst.facility.identifier.value == \"G35B9\"\n    assert inst.id == \"52346\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/coverageelegibilityrequest\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"52346\"\n    assert inst.insurance[0].businessArrangement == \"NB8742\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.item[0].category.coding[0].code == \"69\"\n    assert inst.item[0].category.coding[0].display == \"Maternity\"\n    assert (\n        inst.item[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.priority.coding[0].code == \"normal\"\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.purpose[0] == \"validation\"\n    assert inst.purpose[1] == \"benefits\"\n    assert (\n        inst.servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-09-17\"}).valueDate\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the CoverageEligibilityRequest</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_coverageeligibilityrequest_2(base_settings):\n    \"\"\"No. 2 tests collection for CoverageEligibilityRequest.\n    Test File: coverageeligibilityrequest-example-2.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"coverageeligibilityrequest-example-2.json\"\n    )\n    inst = coverageeligibilityrequest.CoverageEligibilityRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CoverageEligibilityRequest\" == inst.get_resource_type()\n\n    impl_coverageeligibilityrequest_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CoverageEligibilityRequest\" == data[\"resourceType\"]\n\n    inst2 = coverageeligibilityrequest.CoverageEligibilityRequest(**data)\n    impl_coverageeligibilityrequest_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_coverageeligibilityresponse.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import coverageeligibilityresponse\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_coverageeligibilityresponse_1(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Policy is currently in-force.\"\n    assert inst.id == \"E2500\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/coverageeligibilityresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"881234\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].inforce is True\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.purpose[0] == \"validation\"\n    assert inst.request.reference == (\n        \"http://www.BenefitsInc.com/fhir/coverageeligibilityrequest/2\" \"25476332402\"\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the CoverageEligibilityResponse.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_coverageeligibilityresponse_1(base_settings):\n    \"\"\"No. 1 tests collection for CoverageEligibilityResponse.\n    Test File: coverageeligibilityresponse-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"coverageeligibilityresponse-example.json\"\n    )\n    inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CoverageEligibilityResponse\" == inst.get_resource_type()\n\n    impl_coverageeligibilityresponse_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CoverageEligibilityResponse\" == data[\"resourceType\"]\n\n    inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data)\n    impl_coverageeligibilityresponse_1(inst2)\n\n\ndef impl_coverageeligibilityresponse_2(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == (\n        \"Eligibiliy request could not be processed, please address \"\n        \"errors before submitting.\"\n    )\n    assert inst.error[0].code.coding[0].code == \"a001\"\n    assert (\n        inst.error[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/adjudication-error\"}\n        ).valueUri\n    )\n    assert inst.form.coding[0].code == \"ELRSP/2017/01\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://national.org/form\"}\n        ).valueUri\n    )\n    assert inst.id == \"E2503\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/coverageeligibilityresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"8812343\"\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"error\"\n    assert inst.patient.reference == \"Patient/f201\"\n    assert inst.purpose[0] == \"validation\"\n    assert inst.request.reference == (\n        \"http://www.BenefitsInc.com/fhir/coverageeligibilityresponse/\" \"225476332406\"\n    )\n    assert (\n        inst.requestor.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://national.org/clinic\"}\n        ).valueUri\n    )\n    assert inst.requestor.identifier.value == \"OR1234\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the CoverageEligibilityResponse.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_coverageeligibilityresponse_2(base_settings):\n    \"\"\"No. 2 tests collection for CoverageEligibilityResponse.\n    Test File: coverageeligibilityresponse-example-error.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"coverageeligibilityresponse-example-error.json\"\n    )\n    inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CoverageEligibilityResponse\" == inst.get_resource_type()\n\n    impl_coverageeligibilityresponse_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CoverageEligibilityResponse\" == data[\"resourceType\"]\n\n    inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data)\n    impl_coverageeligibilityresponse_2(inst2)\n\n\ndef impl_coverageeligibilityresponse_3(inst):\n    assert inst.contained[0].id == \"coverage-1\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Policy is currently in-force.\"\n    assert inst.form.coding[0].code == \"ELRSP/2017/01\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://national.org/form\"}\n        ).valueUri\n    )\n    assert inst.id == \"E2502\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/coverageeligibilityresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"8812342\"\n    assert inst.insurance[0].coverage.reference == \"#coverage-1\"\n    assert inst.insurance[0].inforce is True\n    assert inst.insurance[0].item[0].benefit[0].allowedMoney.currency == \"USD\"\n    assert float(inst.insurance[0].item[0].benefit[0].allowedMoney.value) == float(\n        500000\n    )\n    assert inst.insurance[0].item[0].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[0].benefit[0].usedMoney.currency == \"USD\"\n    assert float(inst.insurance[0].item[0].benefit[0].usedMoney.value) == float(3748.0)\n    assert inst.insurance[0].item[0].benefit[1].allowedMoney.currency == \"USD\"\n    assert float(inst.insurance[0].item[0].benefit[1].allowedMoney.value) == float(100)\n    assert inst.insurance[0].item[0].benefit[1].type.coding[0].code == \"copay-maximum\"\n    assert inst.insurance[0].item[0].benefit[2].allowedUnsignedInt == 20\n    assert inst.insurance[0].item[0].benefit[2].type.coding[0].code == \"copay-percent\"\n    assert inst.insurance[0].item[0].category.coding[0].code == \"30\"\n    assert (\n        inst.insurance[0].item[0].category.coding[0].display\n        == \"Health Benefit Plan Coverage\"\n    )\n    assert (\n        inst.insurance[0].item[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[0].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[0].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[0].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[0].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[0].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[0].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].benefit[0].allowedMoney.currency == \"USD\"\n    assert float(inst.insurance[0].item[1].benefit[0].allowedMoney.value) == float(\n        15000\n    )\n    assert inst.insurance[0].item[1].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[1].category.coding[0].code == \"69\"\n    assert inst.insurance[0].item[1].category.coding[0].display == \"Maternity\"\n    assert (\n        inst.insurance[0].item[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[1].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[1].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[1].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].benefit[0].allowedMoney.currency == \"USD\"\n    assert float(inst.insurance[0].item[2].benefit[0].allowedMoney.value) == float(2000)\n    assert inst.insurance[0].item[2].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[2].category.coding[0].code == \"F3\"\n    assert inst.insurance[0].item[2].category.coding[0].display == \"Dental Coverage\"\n    assert (\n        inst.insurance[0].item[2].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[2].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[2].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[2].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[3].category.coding[0].code == \"F6\"\n    assert inst.insurance[0].item[3].category.coding[0].display == \"Vision Coverage\"\n    assert (\n        inst.insurance[0].item[3].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[3].description == (\n        \"Vision products and services such as exams, glasses and \" \"contact lenses.\"\n    )\n    assert inst.insurance[0].item[3].excluded is True\n    assert inst.insurance[0].item[3].name == \"Vision\"\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/f201\"\n    assert inst.purpose[0] == \"validation\"\n    assert inst.purpose[1] == \"benefits\"\n    assert inst.request.reference == (\n        \"http://www.BenefitsInc.com/fhir/coverageeligibilityrequest/2\" \"25476332405\"\n    )\n    assert (\n        inst.requestor.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://national.org/clinic\"}\n        ).valueUri\n    )\n    assert inst.requestor.identifier.value == \"OR1234\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the CoverageEligibilityResponse.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_coverageeligibilityresponse_3(base_settings):\n    \"\"\"No. 3 tests collection for CoverageEligibilityResponse.\n    Test File: coverageeligibilityresponse-example-benefits-2.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"coverageeligibilityresponse-example-benefits-2.json\"\n    )\n    inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CoverageEligibilityResponse\" == inst.get_resource_type()\n\n    impl_coverageeligibilityresponse_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CoverageEligibilityResponse\" == data[\"resourceType\"]\n\n    inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data)\n    impl_coverageeligibilityresponse_3(inst2)\n\n\ndef impl_coverageeligibilityresponse_4(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Policy is currently in-force.\"\n    assert inst.id == \"E2501\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/coverageeligibilityresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"881234\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].inforce is True\n    assert inst.insurance[0].item[0].benefit[0].allowedMoney.currency == \"SAR\"\n    assert float(inst.insurance[0].item[0].benefit[0].allowedMoney.value) == float(\n        500000\n    )\n    assert inst.insurance[0].item[0].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[0].benefit[1].allowedMoney.currency == \"SAR\"\n    assert float(inst.insurance[0].item[0].benefit[1].allowedMoney.value) == float(100)\n    assert inst.insurance[0].item[0].benefit[1].type.coding[0].code == \"copay-maximum\"\n    assert inst.insurance[0].item[0].benefit[2].allowedUnsignedInt == 20\n    assert inst.insurance[0].item[0].benefit[2].type.coding[0].code == \"copay-percent\"\n    assert inst.insurance[0].item[0].category.coding[0].code == \"30\"\n    assert (\n        inst.insurance[0].item[0].category.coding[0].display\n        == \"Health Benefit Plan Coverage\"\n    )\n    assert (\n        inst.insurance[0].item[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[0].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[0].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[0].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[0].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[0].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[0].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].benefit[0].allowedMoney.currency == \"SAR\"\n    assert float(inst.insurance[0].item[1].benefit[0].allowedMoney.value) == float(\n        15000\n    )\n    assert inst.insurance[0].item[1].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[1].category.coding[0].code == \"69\"\n    assert inst.insurance[0].item[1].category.coding[0].display == \"Maternity\"\n    assert (\n        inst.insurance[0].item[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[1].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[1].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[1].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[1].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].benefit[0].allowedMoney.currency == \"SAR\"\n    assert float(inst.insurance[0].item[2].benefit[0].allowedMoney.value) == float(2000)\n    assert inst.insurance[0].item[2].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[2].category.coding[0].code == \"F3\"\n    assert inst.insurance[0].item[2].category.coding[0].display == \"Dental Coverage\"\n    assert (\n        inst.insurance[0].item[2].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[2].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[2].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[2].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[2].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[3].benefit[0].allowedMoney.currency == \"SAR\"\n    assert float(inst.insurance[0].item[3].benefit[0].allowedMoney.value) == float(400)\n    assert inst.insurance[0].item[3].benefit[0].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[3].category.coding[0].code == \"F6\"\n    assert inst.insurance[0].item[3].category.coding[0].display == \"Vision Coverage\"\n    assert (\n        inst.insurance[0].item[3].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[3].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[3].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[3].term.coding[0].code == \"annual\"\n    assert (\n        inst.insurance[0].item[3].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[3].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[3].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[4].benefit[0].allowedString == \"shared\"\n    assert inst.insurance[0].item[4].benefit[0].type.coding[0].code == \"room\"\n    assert inst.insurance[0].item[4].benefit[1].allowedMoney.currency == \"SAR\"\n    assert float(inst.insurance[0].item[4].benefit[1].allowedMoney.value) == float(600)\n    assert inst.insurance[0].item[4].benefit[1].type.coding[0].code == \"benefit\"\n    assert inst.insurance[0].item[4].category.coding[0].code == \"49\"\n    assert (\n        inst.insurance[0].item[4].category.coding[0].display\n        == \"Hospital Room and Board\"\n    )\n    assert (\n        inst.insurance[0].item[4].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-benefitcategory\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[4].network.coding[0].code == \"in\"\n    assert (\n        inst.insurance[0].item[4].network.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-network\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[4].term.coding[0].code == \"day\"\n    assert (\n        inst.insurance[0].item[4].term.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-term\"}\n        ).valueUri\n    )\n    assert inst.insurance[0].item[4].unit.coding[0].code == \"individual\"\n    assert (\n        inst.insurance[0].item[4].unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/benefit-unit\"}\n        ).valueUri\n    )\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.purpose[0] == \"validation\"\n    assert inst.purpose[1] == \"benefits\"\n    assert inst.request.reference == (\n        \"http://www.BenefitsInc.com/fhir/coverageeligibilityresponse/\" \"225476332402\"\n    )\n    assert (\n        inst.servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-09-17\"}).valueDate\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the CoverageEligibilityResponse.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_coverageeligibilityresponse_4(base_settings):\n    \"\"\"No. 4 tests collection for CoverageEligibilityResponse.\n    Test File: coverageeligibilityresponse-example-benefits.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"coverageeligibilityresponse-example-benefits.json\"\n    )\n    inst = coverageeligibilityresponse.CoverageEligibilityResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"CoverageEligibilityResponse\" == inst.get_resource_type()\n\n    impl_coverageeligibilityresponse_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"CoverageEligibilityResponse\" == data[\"resourceType\"]\n\n    inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(**data)\n    impl_coverageeligibilityresponse_4(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_detectedissue.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DetectedIssue\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import detectedissue\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_detectedissue_1(inst):\n    assert inst.id == \"allergy\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_detectedissue_1(base_settings):\n    \"\"\"No. 1 tests collection for DetectedIssue.\n    Test File: detectedissue-example-allergy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"detectedissue-example-allergy.json\"\n    inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes())\n    assert \"DetectedIssue\" == inst.get_resource_type()\n\n    impl_detectedissue_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DetectedIssue\" == data[\"resourceType\"]\n\n    inst2 = detectedissue.DetectedIssue(**data)\n    impl_detectedissue_1(inst2)\n\n\ndef impl_detectedissue_2(inst):\n    assert inst.author.reference == \"Device/example\"\n    assert inst.code.coding[0].code == \"DUPTHPY\"\n    assert inst.code.coding[0].display == \"Duplicate Therapy Alert\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.detail == \"Similar test was performed within the past 14 days\"\n    assert inst.id == \"duplicate\"\n    assert (\n        inst.identifiedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-05-08\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345\"\n    assert (\n        inst.implicated[0].display\n        == \"Chest CT - ordered May 8, 2013 by Dr. Adam Careful\"\n    )\n    assert inst.implicated[0].reference == \"ServiceRequest/di\"\n    assert inst.implicated[1].display == (\n        \"Image 1 from Series 3: CT Images on Patient MINT (MINT1234) \"\n        \"taken at 1-Jan 2011 01:20 AM\"\n    )\n    assert inst.implicated[1].reference == \"ImagingStudy/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.reference\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://www.tmhp.com/RadiologyClinicalDecisionSupport/2011/CHEST%20IMAGING%20GUIDELINES%202011.pdf\"\n            }\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/dicom\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_detectedissue_2(base_settings):\n    \"\"\"No. 2 tests collection for DetectedIssue.\n    Test File: detectedissue-example-dup.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"detectedissue-example-dup.json\"\n    inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes())\n    assert \"DetectedIssue\" == inst.get_resource_type()\n\n    impl_detectedissue_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DetectedIssue\" == data[\"resourceType\"]\n\n    inst2 = detectedissue.DetectedIssue(**data)\n    impl_detectedissue_2(inst2)\n\n\ndef impl_detectedissue_3(inst):\n    assert inst.category[0].coding[0].code == \"DRG\"\n    assert inst.category[0].coding[0].display == \"Drug Interaction Alert\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"DRG\"\n    assert inst.code.coding[0].display == \"Drug Interaction Alert\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.id == \"ddi\"\n    assert (\n        inst.identifiedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-01-05\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.implicated[0].display\n        == \"500 mg Acetaminophen tablet 1/day, PRN since 2010\"\n    )\n    assert inst.implicated[0].reference == \"MedicationStatement/example001\"\n    assert inst.implicated[1].display == \"Warfarin 1 MG TAB prescribed Jan. 15, 2015\"\n    assert inst.implicated[1].reference == \"MedicationRequest/medrx0331\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mitigation[0].action.coding[0].code == \"13\"\n    assert inst.mitigation[0].action.coding[0].display == \"Stopped Concurrent Therapy\"\n    assert (\n        inst.mitigation[0].action.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.mitigation[0].action.text == (\n        \"Asked patient to discontinue regular use of Tylenol and to \"\n        \"consult with clinician if they need to resume to allow \"\n        \"appropriate INR monitoring\"\n    )\n    assert inst.mitigation[0].author.display == \"Dr. Adam Careful\"\n    assert inst.mitigation[0].author.reference == \"Practitioner/example\"\n    assert (\n        inst.mitigation[0].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-01-05\"}\n        ).valueDateTime\n    )\n    assert inst.severity == \"high\"\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Device/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_detectedissue_3(base_settings):\n    \"\"\"No. 3 tests collection for DetectedIssue.\n    Test File: detectedissue-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"detectedissue-example.json\"\n    inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes())\n    assert \"DetectedIssue\" == inst.get_resource_type()\n\n    impl_detectedissue_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DetectedIssue\" == data[\"resourceType\"]\n\n    inst2 = detectedissue.DetectedIssue(**data)\n    impl_detectedissue_3(inst2)\n\n\ndef impl_detectedissue_4(inst):\n    assert inst.id == \"lab\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_detectedissue_4(base_settings):\n    \"\"\"No. 4 tests collection for DetectedIssue.\n    Test File: detectedissue-example-lab.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"detectedissue-example-lab.json\"\n    inst = detectedissue.DetectedIssue.model_validate_json(filename.read_bytes())\n    assert \"DetectedIssue\" == inst.get_resource_type()\n\n    impl_detectedissue_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DetectedIssue\" == data[\"resourceType\"]\n\n    inst2 = detectedissue.DetectedIssue(**data)\n    impl_detectedissue_4(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_device.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Device\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import device\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_device_1(inst):\n    assert inst.contact[0].system == \"url\"\n    assert inst.contact[0].value == \"http://acme.com\"\n    assert inst.id == \"example-software\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/ehr/client-ids\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"goodhealth\"\n    assert inst.manufacturer == \"Acme Devices, Inc\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].text == \"EHR\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/goodhealth/ehr/\"}\n        ).valueUri\n    )\n    assert inst.version[0].value == \"10.23-23423\"\n\n\ndef test_device_1(base_settings):\n    \"\"\"No. 1 tests collection for Device.\n    Test File: device-example-software.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"device-example-software.json\"\n    inst = device.Device.model_validate_json(filename.read_bytes())\n    assert \"Device\" == inst.get_resource_type()\n\n    impl_device_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Device\" == data[\"resourceType\"]\n\n    inst2 = device.Device(**data)\n    impl_device_1(inst2)\n\n\ndef impl_device_2(inst):\n    assert (\n        inst.expirationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-02-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-udi3\"\n    assert inst.identifier[0].type.coding[0].code == \"SNO\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"XYZ456789012345678\"\n    assert inst.lotNumber == \"LOT123456789012345\"\n    assert (\n        inst.manufactureDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-02-02\"}\n        ).valueDateTime\n    )\n    assert inst.manufacturer == \"GlobalMed, Inc\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].type == \"user-friendly-name\"\n    assert inst.name[0].value == \"Ultra Implantable\"\n    assert inst.status == \"inactive\"\n    assert inst.text.status == \"generated\"\n    assert inst.udiCarrier[0].carrierHRF == (\n        \"+H123PARTNO1234567890120/$$420020216LOT123456789012345/SXYZ4\"\n        \"56789012345678/16D20130202C\"\n    )\n    assert inst.udiCarrier[0].deviceIdentifier == \"007444534255003288\"\n    assert inst.udiCarrier[0].entryType == \"manual\"\n    assert (\n        inst.udiCarrier[0].issuer\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/hibcc\"}\n        ).valueUri\n    )\n    assert (\n        inst.udiCarrier[0].jurisdiction\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/fda-udi\"}\n        ).valueUri\n    )\n\n\ndef test_device_2(base_settings):\n    \"\"\"No. 2 tests collection for Device.\n    Test File: device-example-udi3.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"device-example-udi3.json\"\n    inst = device.Device.model_validate_json(filename.read_bytes())\n    assert \"Device\" == inst.get_resource_type()\n\n    impl_device_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Device\" == data[\"resourceType\"]\n\n    inst2 = device.Device(**data)\n    impl_device_2(inst2)\n\n\ndef impl_device_3(inst):\n    assert inst.conformsTo[0].specification.coding[0].code == \"528388\"\n    assert (\n        inst.conformsTo[0].specification.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert (\n        inst.conformsTo[0].specification.text\n        == \"MDC_DEV_SPEC_PROFILE_PULS_OXIM: Pulse Oximeter\"\n    )\n    assert inst.conformsTo[0].version == \"1\"\n    assert inst.id == \"NoninBlePulseOx\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.840.10004.1.1.1.0.0.1.0.0.1.2680\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"SYSID\"\n    assert inst.identifier[0].type.coding[0].display == \"System Identifier\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ContinuaDeviceIdentifiers\"\n            }\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"74-E8-FF-FE-FF-05-1C-00\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/eui-48\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].type.coding[0].code == \"BTMAC\"\n    assert inst.identifier[1].type.coding[0].display == \"Bluetooth Address\"\n    assert (\n        inst.identifier[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ContinuaDeviceIdentifiers\"\n            }\n        ).valueUri\n    )\n    assert inst.identifier[1].value == \"00-1C-05-FF-E8-74\"\n    assert inst.manufacturer == \"Nonin_Medical_Inc.\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.modelNumber == \"Model 3230\"\n    assert inst.name[0].type == \"user-friendly-name\"\n    assert inst.name[0].value == \"Nonin3230_501900083\"\n    assert inst.property[0].type.coding[0].code == \"532353\"\n    assert (\n        inst.property[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.property[0].type.text == (\n        \"MDC_REG_CERT_DATA_CONTINUA_CERT_DEV_LIST: Continua certified\" \" device list\"\n    )\n    assert inst.property[0].valueCodeableConcept.coding[0].code == \"4\"\n    assert (\n        inst.property[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ContinuaPAN\"}\n        ).valueUri\n    )\n    assert inst.property[1].type.coding[0].code == \"532354.0\"\n    assert (\n        inst.property[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ASN1ToHL7\"}\n        ).valueUri\n    )\n    assert inst.property[1].type.text == \"regulation-status\"\n    assert inst.property[1].valueCodeableConcept.coding[0].code == \"N\"\n    assert (\n        inst.property[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0136\"}\n        ).valueUri\n    )\n    assert inst.property[1].valueCodeableConcept.text == \"Device is Regulated\"\n    assert inst.property[2].type.coding[0].code == \"68220\"\n    assert (\n        inst.property[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert (\n        inst.property[2].type.text\n        == \"MDC_TIME_SYNC_PROTOCOL: Time synchronization protocol\"\n    )\n    assert inst.property[2].valueCodeableConcept.coding[0].code == \"532224\"\n    assert (\n        inst.property[2].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert (\n        inst.property[2].valueCodeableConcept.text\n        == \"MDC_TIME_SYNC_NONE: No time synchronization\"\n    )\n    assert inst.property[3].type.coding[0].code == \"68219.0\"\n    assert (\n        inst.property[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ASN1ToHL7\"}\n        ).valueUri\n    )\n    assert inst.property[3].type.text == \"mds-time-capab-real-time-clock\"\n    assert inst.property[3].valueCodeableConcept.coding[0].code == \"Y\"\n    assert (\n        inst.property[3].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0136\"}\n        ).valueUri\n    )\n    assert inst.property[3].valueCodeableConcept.text == \"real time clock supported\"\n    assert inst.property[4].type.coding[0].code == \"68219.1\"\n    assert (\n        inst.property[4].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ASN1ToHL7\"}\n        ).valueUri\n    )\n    assert inst.property[4].type.text == \"mds-time-capab-set-clock\"\n    assert inst.property[4].valueCodeableConcept.coding[0].code == \"Y\"\n    assert (\n        inst.property[4].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0136\"}\n        ).valueUri\n    )\n    assert inst.property[4].valueCodeableConcept.text == \"setting the time supported\"\n    assert inst.serialNumber == \"501900083\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"65573\"\n    assert inst.type[0].coding[0].display == \"MDC_MOC_VMS_MDS_SIMP\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.type[0].text == \"MDC_MOC_VMS_MDS_SIMP: Personal Health Device\"\n    assert inst.udiCarrier[0].carrierHRF == \"(01)120359741556(21)501900083\"\n    assert inst.udiCarrier[0].deviceIdentifier == \"120359741556\"\n    assert inst.udiCarrier[0].entryType == \"unknown\"\n    assert (\n        inst.udiCarrier[0].issuer\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/gs1-di\"}\n        ).valueUri\n    )\n    assert (\n        inst.udiCarrier[0].jurisdiction\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/fda-udi\"}\n        ).valueUri\n    )\n    assert inst.version[0].type.coding[0].code == \"531976\"\n    assert (\n        inst.version[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.version[0].type.text == \"MDC_ID_PROD_SPEC_FW: Firmware revision\"\n    assert inst.version[0].value == \"r2.1\"\n    assert inst.version[1].type.coding[0].code == \"531975\"\n    assert (\n        inst.version[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.version[1].type.text == \"MDC_ID_PROD_SPEC_SW: Software revision\"\n    assert inst.version[1].value == \"r1.5 9.7\"\n    assert inst.version[2].type.coding[0].code == \"531974\"\n    assert (\n        inst.version[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.version[2].type.text == \"MDC_ID_PROD_SPEC_HW: Hardware revision\"\n    assert inst.version[2].value == \"r1.0\"\n    assert inst.version[3].type.coding[0].code == \"532352\"\n    assert (\n        inst.version[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert (\n        inst.version[3].type.text\n        == \"MDC_REG_CERT_DATA_CONTINUA_VERSION: Continua version\"\n    )\n    assert inst.version[3].value == \"6.0\"\n\n\ndef test_device_3(base_settings):\n    \"\"\"No. 3 tests collection for Device.\n    Test File: device-example-NoninBlePulseOx.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"device-example-NoninBlePulseOx.json\"\n    )\n    inst = device.Device.model_validate_json(filename.read_bytes())\n    assert \"Device\" == inst.get_resource_type()\n\n    impl_device_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Device\" == data[\"resourceType\"]\n\n    inst2 = device.Device(**data)\n    impl_device_3(inst2)\n\n\ndef impl_device_4(inst):\n    assert (\n        inst.expirationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-01\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-udi2\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/iccbba-din\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"A99971312345600\"\n    assert (\n        inst.manufactureDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-02-01\"}\n        ).valueDateTime\n    )\n    assert inst.manufacturer == \"Acme Devices, Inc\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"inactive\"\n    assert inst.text.status == \"generated\"\n    assert inst.udiCarrier[0].deviceIdentifier == \"A9999XYZ100T0474\"\n    assert (\n        inst.udiCarrier[0].issuer\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/iccbba-other\"}\n        ).valueUri\n    )\n    assert (\n        inst.udiCarrier[0].jurisdiction\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/fda-udi\"}\n        ).valueUri\n    )\n\n\ndef test_device_4(base_settings):\n    \"\"\"No. 4 tests collection for Device.\n    Test File: device-example-udi2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"device-example-udi2.json\"\n    inst = device.Device.model_validate_json(filename.read_bytes())\n    assert \"Device\" == inst.get_resource_type()\n\n    impl_device_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Device\" == data[\"resourceType\"]\n\n    inst2 = device.Device(**data)\n    impl_device_4(inst2)\n\n\ndef impl_device_5(inst):\n    assert inst.conformsTo[0].specification.coding[0].code == \"528392\"\n    assert (\n        inst.conformsTo[0].specification.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert (\n        inst.conformsTo[0].specification.text\n        == \"MDC_DEV_SPEC_PROFILE_TEMP: Thermometer\"\n    )\n    assert inst.conformsTo[0].version == \"1\"\n    assert inst.id == \"PhilipsThermometer\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.840.10004.1.1.1.0.0.1.0.0.1.2680\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"SYSID\"\n    assert inst.identifier[0].type.coding[0].display == \"System Identifier\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ContinuaDeviceIdentifiers\"\n            }\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"1C-87-74-FF-FE-00-EC-20\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/eui-48\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].type.coding[0].code == \"BTMAC\"\n    assert inst.identifier[1].type.coding[0].display == \"Bluetooth Address\"\n    assert (\n        inst.identifier[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ContinuaDeviceIdentifiers\"\n            }\n        ).valueUri\n    )\n    assert inst.identifier[1].value == \"1C-87-74-00-EC-20\"\n    assert inst.manufacturer == \"Philips\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.modelNumber == \"DL8740\"\n    assert inst.name[0].type == \"user-friendly-name\"\n    assert inst.name[0].value == \"Philips ear thermometer\"\n    assert inst.property[0].type.coding[0].code == \"532353\"\n    assert (\n        inst.property[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.property[0].type.text == (\n        \"MDC_REG_CERT_DATA_CONTINUA_CERT_DEV_LIST: Continua certified\" \" device list\"\n    )\n    assert inst.property[0].valueCodeableConcept.coding[0].code == \"32776\"\n    assert (\n        inst.property[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ContinuaPAN\"}\n        ).valueUri\n    )\n    assert inst.property[1].type.coding[0].code == \"532354.0\"\n    assert (\n        inst.property[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ASN1ToHL7\"}\n        ).valueUri\n    )\n    assert inst.property[1].type.text == \"regulation-status\"\n    assert inst.property[1].valueCodeableConcept.coding[0].code == \"N\"\n    assert (\n        inst.property[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0136\"}\n        ).valueUri\n    )\n    assert inst.property[1].valueCodeableConcept.text == \"Device is Regulated\"\n    assert inst.property[2].type.coding[0].code == \"68220\"\n    assert (\n        inst.property[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert (\n        inst.property[2].type.text\n        == \"MDC_TIME_SYNC_PROTOCOL: Time synchronization protocol\"\n    )\n    assert inst.property[2].valueCodeableConcept.coding[0].code == \"532224\"\n    assert (\n        inst.property[2].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert (\n        inst.property[2].valueCodeableConcept.text\n        == \"MDC_TIME_SYNC_NONE: No time synchronization\"\n    )\n    assert inst.property[3].type.coding[0].code == \"68219.0\"\n    assert (\n        inst.property[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ASN1ToHL7\"}\n        ).valueUri\n    )\n    assert inst.property[3].type.text == \"mds-time-capab-real-time-clock\"\n    assert inst.property[3].valueCodeableConcept.coding[0].code == \"Y\"\n    assert (\n        inst.property[3].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0136\"}\n        ).valueUri\n    )\n    assert inst.property[3].valueCodeableConcept.text == \"real time clock supported\"\n    assert inst.property[4].type.coding[0].code == \"68219.1\"\n    assert (\n        inst.property[4].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ASN1ToHL7\"}\n        ).valueUri\n    )\n    assert inst.property[4].type.text == \"mds-time-capab-set-clock\"\n    assert inst.property[4].valueCodeableConcept.coding[0].code == \"Y\"\n    assert (\n        inst.property[4].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0136\"}\n        ).valueUri\n    )\n    assert inst.property[4].valueCodeableConcept.text == \"setting the time supported\"\n    assert inst.serialNumber == \"162502000528\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"65573\"\n    assert inst.type[0].coding[0].display == \"MDC_MOC_VMS_MDS_SIMP\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.type[0].text == \"MDC_MOC_VMS_MDS_SIMP: Personal Health Device\"\n    assert inst.udiCarrier[0].carrierHRF == \"(01)31368092380192(21)162502000528\"\n    assert inst.udiCarrier[0].deviceIdentifier == \"31368092380192\"\n    assert inst.udiCarrier[0].entryType == \"unknown\"\n    assert (\n        inst.udiCarrier[0].issuer\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/gs1-di\"}\n        ).valueUri\n    )\n    assert (\n        inst.udiCarrier[0].jurisdiction\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/fda-udi\"}\n        ).valueUri\n    )\n    assert inst.version[0].type.coding[0].code == \"531976\"\n    assert (\n        inst.version[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.version[0].type.text == \"MDC_ID_PROD_SPEC_FW: Firmware revision\"\n    assert inst.version[0].value == \"1.60\"\n    assert inst.version[1].type.coding[0].code == \"531975\"\n    assert (\n        inst.version[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.version[1].type.text == \"MDC_ID_PROD_SPEC_SW: Software revision\"\n    assert inst.version[1].value == \"1.50\"\n    assert inst.version[2].type.coding[0].code == \"531974\"\n    assert (\n        inst.version[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.version[2].type.text == \"MDC_ID_PROD_SPEC_SW: Hardware revision\"\n    assert inst.version[2].value == \"1.40\"\n    assert inst.version[3].type.coding[0].code == \"532352\"\n    assert (\n        inst.version[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert (\n        inst.version[3].type.text\n        == \"MDC_REG_CERT_DATA_CONTINUA_VERSION: Continua version\"\n    )\n    assert inst.version[3].value == \"5.1\"\n\n\ndef test_device_5(base_settings):\n    \"\"\"No. 5 tests collection for Device.\n    Test File: device-example-PhilipsThermometer.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"device-example-PhilipsThermometer.json\"\n    )\n    inst = device.Device.model_validate_json(filename.read_bytes())\n    assert \"Device\" == inst.get_resource_type()\n\n    impl_device_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Device\" == data[\"resourceType\"]\n\n    inst2 = device.Device(**data)\n    impl_device_5(inst2)\n\n\ndef impl_device_6(inst):\n    assert inst.displayName == \"Lavender Tube\"\n    assert inst.id == \"device-example-specimen-container-lavender-vacutainer\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/containers/id\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"345675\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.property[0].type.coding[0].code == \"tube-type\"\n    assert inst.property[0].type.coding[0].display == \"Tube Type\"\n    assert (\n        inst.property[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/containers/codes\"}\n        ).valueUri\n    )\n    assert inst.property[0].valueCodeableConcept.coding[0].code == \"lavender\"\n    assert inst.property[0].valueCodeableConcept.coding[0].display == \"lavender-tube\"\n    assert (\n        inst.property[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/containers/types\"}\n        ).valueUri\n    )\n    assert inst.property[1].type.coding[0].code == \"amount\"\n    assert inst.property[1].type.coding[0].display == \"Amount\"\n    assert (\n        inst.property[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/containers/codes\"}\n        ).valueUri\n    )\n    assert inst.property[1].valueCodeableConcept.coding[0].code == \"4.5mL\"\n    assert inst.property[1].valueCodeableConcept.coding[0].display == \"4.5 mL\"\n    assert (\n        inst.property[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/containers/capacities\"}\n        ).valueUri\n    )\n    assert inst.property[2].type.coding[0].code == \"additive\"\n    assert inst.property[2].type.coding[0].display == \"Additive\"\n    assert (\n        inst.property[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/containers/codes\"}\n        ).valueUri\n    )\n    assert inst.property[2].valueCodeableConcept.coding[0].code == \"EDTA\"\n    assert inst.property[2].valueCodeableConcept.coding[0].display == \"EDTA\"\n    assert (\n        inst.property[2].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/containers/additive\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_device_6(base_settings):\n    \"\"\"No. 6 tests collection for Device.\n    Test File: device-example-specimen-container-lavender-vacutainer.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"device-example-specimen-container-lavender-vacutainer.json\"\n    )\n    inst = device.Device.model_validate_json(filename.read_bytes())\n    assert \"Device\" == inst.get_resource_type()\n\n    impl_device_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Device\" == data[\"resourceType\"]\n\n    inst2 = device.Device(**data)\n    impl_device_6(inst2)\n\n\ndef impl_device_7(inst):\n    assert inst.conformsTo[0].specification.coding[0].code == \"528392\"\n    assert (\n        inst.conformsTo[0].specification.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert (\n        inst.conformsTo[0].specification.text\n        == \"MDC_DEV_SPEC_PROFILE_TEMP: Thermometer\"\n    )\n    assert inst.conformsTo[0].version == \"1\"\n    assert inst.id == \"KinsaThermometer\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.840.10004.1.1.1.0.0.1.0.0.1.2680\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"SYSID\"\n    assert inst.identifier[0].type.coding[0].display == \"System Identifier\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ContinuaDeviceIdentifiers\"\n            }\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"00-00-52-49-20-45-4C-42\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/eui-48\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].type.coding[0].code == \"BTMAC\"\n    assert inst.identifier[1].type.coding[0].display == \"Bluetooth Address\"\n    assert (\n        inst.identifier[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ContinuaDeviceIdentifiers\"\n            }\n        ).valueUri\n    )\n    assert inst.identifier[1].value == \"10-CE-A9-80-14-66\"\n    assert inst.manufacturer == \"Kinsa\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.modelNumber == \"KS_1i9JfKh\"\n    assert inst.name[0].type == \"user-friendly-name\"\n    assert inst.name[0].value == \"KS_1i9JfKh\"\n    assert inst.property[0].type.coding[0].code == \"68220\"\n    assert (\n        inst.property[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert (\n        inst.property[0].type.text\n        == \"MDC_TIME_SYNC_PROTOCOL: Time synchronization protocol\"\n    )\n    assert inst.property[0].valueCodeableConcept.coding[0].code == \"532224\"\n    assert (\n        inst.property[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert (\n        inst.property[0].valueCodeableConcept.text\n        == \"MDC_TIME_SYNC_NONE: No time synchronization\"\n    )\n    assert inst.serialNumber == \"1i9JfKh\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"65573\"\n    assert inst.type[0].coding[0].display == \"MDC_MOC_VMS_MDS_SIMP\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.type[0].text == \"MDC_MOC_VMS_MDS_SIMP: Personal Health Device\"\n    assert inst.udiCarrier[0].carrierHRF == \"(01)18479793050726(21)1i9JfKh\"\n    assert inst.udiCarrier[0].deviceIdentifier == \"18479793050726\"\n    assert inst.udiCarrier[0].entryType == \"unknown\"\n    assert (\n        inst.udiCarrier[0].issuer\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/gs1-di\"}\n        ).valueUri\n    )\n    assert (\n        inst.udiCarrier[0].jurisdiction\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/fda-udi\"}\n        ).valueUri\n    )\n    assert inst.version[0].type.coding[0].code == \"531976\"\n    assert (\n        inst.version[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.version[0].type.text == \"MDC_ID_PROD_SPEC_FW: Firmware revision\"\n    assert inst.version[0].value == \"1.00\"\n    assert inst.version[1].type.coding[0].code == \"531975\"\n    assert (\n        inst.version[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.version[1].type.text == \"MDC_ID_PROD_SPEC_SW: Software revision\"\n    assert inst.version[1].value == \"V2.19\"\n    assert inst.version[2].type.coding[0].code == \"531974\"\n    assert (\n        inst.version[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.version[2].type.text == \"MDC_ID_PROD_SPEC_SW: Hardware revision\"\n    assert inst.version[2].value == \"1.00\"\n\n\ndef test_device_7(base_settings):\n    \"\"\"No. 7 tests collection for Device.\n    Test File: device-example-KinsaThermometer.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"device-example-KinsaThermometer.json\"\n    )\n    inst = device.Device.model_validate_json(filename.read_bytes())\n    assert \"Device\" == inst.get_resource_type()\n\n    impl_device_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Device\" == data[\"resourceType\"]\n\n    inst2 = device.Device(**data)\n    impl_device_7(inst2)\n\n\ndef impl_device_8(inst):\n    assert inst.id == \"f001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealthhospital/identifier/devices\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_device_8(base_settings):\n    \"\"\"No. 8 tests collection for Device.\n    Test File: device-example-f001-feedingtube.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"device-example-f001-feedingtube.json\"\n    )\n    inst = device.Device.model_validate_json(filename.read_bytes())\n    assert \"Device\" == inst.get_resource_type()\n\n    impl_device_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Device\" == data[\"resourceType\"]\n\n    inst2 = device.Device(**data)\n    impl_device_8(inst2)\n\n\ndef impl_device_9(inst):\n    assert inst.id == \"NGS-device\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/devices\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"11111\"\n    assert inst.manufacturer == \"Illumina\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].type == \"user-friendly-name\"\n    assert inst.name[0].value == \"NextSeq 550 Instrument\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"49062001\"\n    assert inst.type[0].coding[0].display == \"Device (physical object)\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_device_9(base_settings):\n    \"\"\"No. 9 tests collection for Device.\n    Test File: Device-NGS-device.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Device-NGS-device.json\"\n    inst = device.Device.model_validate_json(filename.read_bytes())\n    assert \"Device\" == inst.get_resource_type()\n\n    impl_device_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Device\" == data[\"resourceType\"]\n\n    inst2 = device.Device(**data)\n    impl_device_9(inst2)\n\n\ndef impl_device_10(inst):\n    assert inst.id == \"Triodenovo-SW\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/devices\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"11112\"\n    assert inst.manufacturer == \"Vanderbilt Genetics Institute\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].type == \"user-friendly-name\"\n    assert inst.name[0].value == \"Triodenovo Software\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"706687001\"\n    assert inst.type[0].coding[0].display == \"Software (physical object)\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version[0].value == \"0.06\"\n\n\ndef test_device_10(base_settings):\n    \"\"\"No. 10 tests collection for Device.\n    Test File: Device-Triodenovo-SW.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Device-Triodenovo-SW.json\"\n    inst = device.Device.model_validate_json(filename.read_bytes())\n    assert \"Device\" == inst.get_resource_type()\n\n    impl_device_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Device\" == data[\"resourceType\"]\n\n    inst2 = device.Device(**data)\n    impl_device_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_deviceassociation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceAssociation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import deviceassociation\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_deviceassociation_1(inst):\n    assert inst.device.reference == \"Device/prod1\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status.coding[0].code == \"implanted\"\n    assert (\n        inst.status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/deviceassociation-status\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_deviceassociation_1(base_settings):\n    \"\"\"No. 1 tests collection for DeviceAssociation.\n    Test File: deviceassociation-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"deviceassociation-example.json\"\n    inst = deviceassociation.DeviceAssociation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DeviceAssociation\" == inst.get_resource_type()\n\n    impl_deviceassociation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceAssociation\" == data[\"resourceType\"]\n\n    inst2 = deviceassociation.DeviceAssociation(**data)\n    impl_deviceassociation_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_devicedefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import devicedefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_devicedefinition_1(inst):\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"0\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_devicedefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for DeviceDefinition.\n    Test File: devicedefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"devicedefinition-example.json\"\n    inst = devicedefinition.DeviceDefinition.model_validate_json(filename.read_bytes())\n    assert \"DeviceDefinition\" == inst.get_resource_type()\n\n    impl_devicedefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceDefinition\" == data[\"resourceType\"]\n\n    inst2 = devicedefinition.DeviceDefinition(**data)\n    impl_devicedefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_devicedispense.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceDispense\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import devicedispense\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_devicedispense_1(inst):\n    assert inst.device.concept.coding[0].code == \"00613994223838\"\n    assert inst.device.concept.coding[0].display == \"ADAPTA (TM) Pacemaker\"\n    assert (\n        inst.device.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.gs1.org/gtin\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_devicedispense_1(base_settings):\n    \"\"\"No. 1 tests collection for DeviceDispense.\n    Test File: devicedispense-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"devicedispense-example.json\"\n    inst = devicedispense.DeviceDispense.model_validate_json(filename.read_bytes())\n    assert \"DeviceDispense\" == inst.get_resource_type()\n\n    impl_devicedispense_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceDispense\" == data[\"resourceType\"]\n\n    inst2 = devicedispense.DeviceDispense(**data)\n    impl_devicedispense_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_devicemetric.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceMetric\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import devicemetric\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_devicemetric_1(inst):\n    assert inst.calibration[0].state == \"calibrated\"\n    assert (\n        inst.calibration[0].time\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-12-28T09:03:04-05:00\"}\n        ).valueInstant\n    )\n    assert inst.calibration[0].type == \"two-point\"\n    assert inst.category == \"measurement\"\n    assert inst.color == \"blue\"\n    assert inst.device.reference == \"Device/dev1\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodcare.org/devicemetric/id\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"345675\"\n    assert inst.measurementFrequency.code == \"Hz\"\n    assert (\n        inst.measurementFrequency.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.measurementFrequency.unit == \"Hertz\"\n    assert float(inst.measurementFrequency.value) == float(1)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.operationalStatus == \"on\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"150456\"\n    assert inst.type.coding[0].display == \"MDC_PULS_OXIM_SAT_O2\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n    assert inst.unit.coding[0].code == \"262688\"\n    assert inst.unit.coding[0].display == \"MDC_DIM_PERCENT\"\n    assert (\n        inst.unit.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:11073:10101\"}\n        ).valueUri\n    )\n\n\ndef test_devicemetric_1(base_settings):\n    \"\"\"No. 1 tests collection for DeviceMetric.\n    Test File: devicemetric-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"devicemetric-example.json\"\n    inst = devicemetric.DeviceMetric.model_validate_json(filename.read_bytes())\n    assert \"DeviceMetric\" == inst.get_resource_type()\n\n    impl_devicemetric_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceMetric\" == data[\"resourceType\"]\n\n    inst2 = devicemetric.DeviceMetric(**data)\n    impl_devicemetric_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_devicerequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import devicerequest\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_devicerequest_1(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-05-08T09:33:27+07:00\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].display == \"Homecare - DM follow-up\"\n    assert inst.code.concept.coding[0].code == \"43148-6\"\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.concept.text == \"Insulin delivery device panel\"\n    assert inst.encounter.display == \"Encounter 1\"\n    assert inst.groupIdentifier.value == \"ip_request1\"\n    assert inst.id == \"insulinpump\"\n    assert inst.identifier[0].value == \"ip_request1.1\"\n    assert inst.instantiatesCanonical[0] == (\n        \"http://motivemi.com/artifacts/PlanDefinition/low-suicide-\" \"risk-order-set\"\n    )\n    assert inst.intent == \"instance-order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"this is the right device brand and model\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-05-08T09:33:27+07:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer.reference.display == \"Nurse Rossignol\"\n    assert inst.priority == \"routine\"\n    assert inst.reason[0].concept.text == \"gastroparesis\"\n    assert inst.reason[1].reference.display == \"Gastroparesis\"\n    assert inst.relevantHistory[0].display == \"Request for unspecified device\"\n    assert inst.replaces[0].display == \"CGM ambulatory\"\n    assert inst.requester.display == \"Dr. Adam Careful\"\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/dicom\"\n    assert inst.supportingInfo[0].display == \"Previous results\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_devicerequest_1(base_settings):\n    \"\"\"No. 1 tests collection for DeviceRequest.\n    Test File: devicerequest-example-insulinpump.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"devicerequest-example-insulinpump.json\"\n    )\n    inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes())\n    assert \"DeviceRequest\" == inst.get_resource_type()\n\n    impl_devicerequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceRequest\" == data[\"resourceType\"]\n\n    inst2 = devicerequest.DeviceRequest(**data)\n    impl_devicerequest_1(inst2)\n\n\ndef impl_devicerequest_2(inst):\n    assert inst.code.concept.coding[0].code == \"lens\"\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.value == \"15013\"\n    assert inst.id == \"left-lens\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.happysight.com/prescription\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"15013L\"\n    assert inst.intent == \"original-order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-06-15\"}\n        ).valueDateTime\n    )\n    assert inst.parameter[0].code.coding[0].code == \"28842-3\"\n    assert (\n        inst.parameter[0].code.coding[0].display\n        == \"Sphere distance Glasses prescription.lens - left\"\n    )\n    assert (\n        inst.parameter[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[0].code.text == \"sphere, left lens\"\n    assert inst.parameter[0].valueQuantity.code == \"[diop]\"\n    assert (\n        inst.parameter[0].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[0].valueQuantity.unit == \"Diopter\"\n    assert float(inst.parameter[0].valueQuantity.value) == float(-1.0)\n    assert inst.parameter[1].code.coding[0].code == \"28843-1\"\n    assert (\n        inst.parameter[1].code.coding[0].display\n        == \"Cylinder base distance Glasses prescription.lens - left\"\n    )\n    assert (\n        inst.parameter[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[1].code.text == \"cylinder, left lens\"\n    assert inst.parameter[1].valueQuantity.code == \"[diop]\"\n    assert (\n        inst.parameter[1].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[1].valueQuantity.unit == \"Diopter\"\n    assert float(inst.parameter[1].valueQuantity.value) == float(-0.5)\n    assert inst.parameter[2].code.coding[0].code == \"28844-9\"\n    assert (\n        inst.parameter[2].code.coding[0].display\n        == \" Axis distance Glasses prescription.lens - left\"\n    )\n    assert (\n        inst.parameter[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[2].code.text == \"axis, left lens\"\n    assert inst.parameter[2].valueQuantity.code == \"deg\"\n    assert (\n        inst.parameter[2].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[2].valueQuantity.unit == \"Degrees\"\n    assert float(inst.parameter[2].valueQuantity.value) == float(180)\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_devicerequest_2(base_settings):\n    \"\"\"No. 2 tests collection for DeviceRequest.\n    Test File: devicerequest-left-lens.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"devicerequest-left-lens.json\"\n    inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes())\n    assert \"DeviceRequest\" == inst.get_resource_type()\n\n    impl_devicerequest_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceRequest\" == data[\"resourceType\"]\n\n    inst2 = devicerequest.DeviceRequest(**data)\n    impl_devicerequest_2(inst2)\n\n\ndef impl_devicerequest_3(inst):\n    assert inst.code.concept.coding[0].code == \"lens\"\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.value == \"15013\"\n    assert inst.id == \"right-lens\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.happysight.com/prescription\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"15013R\"\n    assert inst.intent == \"original-order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-06-15\"}\n        ).valueDateTime\n    )\n    assert inst.parameter[0].code.coding[0].code == \"28826-6\"\n    assert (\n        inst.parameter[0].code.coding[0].display\n        == \"Sphere distance Glasses prescription.lens - right\"\n    )\n    assert (\n        inst.parameter[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[0].code.text == \"sphere, right lens\"\n    assert inst.parameter[0].valueQuantity.code == \"[diop]\"\n    assert (\n        inst.parameter[0].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[0].valueQuantity.unit == \"Diopter\"\n    assert float(inst.parameter[0].valueQuantity.value) == float(-2.0)\n    assert inst.parameter[1].code.coding[0].code == \"28829-0\"\n    assert (\n        inst.parameter[1].code.coding[0].display\n        == \"Prism base distance Glasses prescription.lens - right\"\n    )\n    assert (\n        inst.parameter[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[1].code.text == \"prisms, right lens\"\n    assert inst.parameter[1].valueQuantity.code == \"[diop]\"\n    assert (\n        inst.parameter[1].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[1].valueQuantity.unit == \"Diopter\"\n    assert float(inst.parameter[1].valueQuantity.value) == float(-2.0)\n    assert inst.parameter[2].code.coding[0].code == \"28810-0\"\n    assert inst.parameter[2].code.coding[0].display == \"Add 1 LM glasses lens - right\"\n    assert (\n        inst.parameter[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[2].code.text == \"add, right lens\"\n    assert inst.parameter[2].valueQuantity.code == \"[diop]\"\n    assert (\n        inst.parameter[2].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.parameter[2].valueQuantity.unit == \"Diopter\"\n    assert float(inst.parameter[2].valueQuantity.value) == float(2.0)\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_devicerequest_3(base_settings):\n    \"\"\"No. 3 tests collection for DeviceRequest.\n    Test File: devicerequest-right-lens.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"devicerequest-right-lens.json\"\n    inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes())\n    assert \"DeviceRequest\" == inst.get_resource_type()\n\n    impl_devicerequest_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceRequest\" == data[\"resourceType\"]\n\n    inst2 = devicerequest.DeviceRequest(**data)\n    impl_devicerequest_3(inst2)\n\n\ndef impl_devicerequest_4(inst):\n    assert inst.code.reference.reference == \"Device/example\"\n    assert inst.id == \"example\"\n    assert inst.intent == \"original-order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_devicerequest_4(base_settings):\n    \"\"\"No. 4 tests collection for DeviceRequest.\n    Test File: devicerequest-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"devicerequest-example.json\"\n    inst = devicerequest.DeviceRequest.model_validate_json(filename.read_bytes())\n    assert \"DeviceRequest\" == inst.get_resource_type()\n\n    impl_devicerequest_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceRequest\" == data[\"resourceType\"]\n\n    inst2 = devicerequest.DeviceRequest(**data)\n    impl_devicerequest_4(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_deviceusage.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DeviceUsage\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import deviceusage\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_deviceusage_1(inst):\n    assert inst.device.concept.text == \"ACME defribillator\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:goodhealth.org/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"51ebb7a9-4e3a-4360-9a05-0cc2d869086f\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.reason[0].reference.display == \"PHx of Appendectomy (surgery)\"\n    assert inst.reason[0].reference.reference == \"Condition/example\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_deviceusage_1(base_settings):\n    \"\"\"No. 1 tests collection for DeviceUsage.\n    Test File: deviceusage-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"deviceusage-example.json\"\n    inst = deviceusage.DeviceUsage.model_validate_json(filename.read_bytes())\n    assert \"DeviceUsage\" == inst.get_resource_type()\n\n    impl_deviceusage_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DeviceUsage\" == data[\"resourceType\"]\n\n    inst2 = deviceusage.DeviceUsage(**data)\n    impl_deviceusage_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_diagnosticreport.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DiagnosticReport\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import diagnosticreport\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_diagnosticreport_1(inst):\n    assert inst.category[0].coding[0].code == \"394914008\"\n    assert inst.category[0].coding[0].display == \"Radiology\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[1].code == \"RAD\"\n    assert (\n        inst.category[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0074\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"45036003\"\n    assert inst.code.coding[0].display == \"Ultrasonography of abdomen\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Abdominal Ultrasound\"\n    assert inst.conclusion == \"Unremarkable study\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-12-01T12:00:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"ultrasound\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2012-12-01T12:00:00+01:00\"}\n        ).valueInstant\n    )\n    assert inst.media[0].comment == \"A comment about the image\"\n    assert inst.media[0].link.display == \"WADO example image\"\n    assert inst.media[0].link.reference == (\n        \"DocumentReference/1.2.840.11361907579238403408700.3.1.04.199\" \"70327150033\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].reference == \"Practitioner/example\"\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_diagnosticreport_1(base_settings):\n    \"\"\"No. 1 tests collection for DiagnosticReport.\n    Test File: diagnosticreport-example-ultrasound.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"diagnosticreport-example-ultrasound.json\"\n    )\n    inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes())\n    assert \"DiagnosticReport\" == inst.get_resource_type()\n\n    impl_diagnosticreport_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DiagnosticReport\" == data[\"resourceType\"]\n\n    inst2 = diagnosticreport.DiagnosticReport(**data)\n    impl_diagnosticreport_1(inst2)\n\n\ndef impl_diagnosticreport_2(inst):\n    assert inst.category[0].coding[0].code == \"PAT\"\n    assert (\n        inst.category[0].coding[0].display\n        == \"Pathology (gross & histopath, not surgical)\"\n    )\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0074\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Pathology\"\n    assert inst.code.coding[0].code == \"4503\"\n    assert inst.code.coding[0].display == (\n        \"Biopsy without Microscopic Description (1 \" \"Site/Lesion)-Standard\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.acmeonline.com\"}\n        ).valueUri\n    )\n    assert inst.code.text == (\n        \"Biopsy without Microscopic Description (1 \" \"Site/Lesion)-Standard\"\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"gingival-biopsy\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.acmeonline.com\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"P73456090\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2018-03-15T08:13:08Z\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Acme Animal Labs\"\n    assert inst.presentedForm[0].contentType == \"application/pdf\"\n    assert inst.presentedForm[0].language == \"en\"\n    assert inst.presentedForm[0].title == (\n        \"LAB ID: P73456090 MAX JONES Biopsy without Microscopic \"\n        \"Description (1 Site/Lesion)-Standard\"\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.display == \"Max Jones\"\n    assert (\n        inst.supportingInfo[0].reference.reference == \"DiagnosticReport/gingival-mass\"\n    )\n    assert inst.supportingInfo[0].type.coding[0].code == \"historical\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_diagnosticreport_2(base_settings):\n    \"\"\"No. 2 tests collection for DiagnosticReport.\n    Test File: diagnosticreport-example-gingival-biopsy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"diagnosticreport-example-gingival-biopsy.json\"\n    )\n    inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes())\n    assert \"DiagnosticReport\" == inst.get_resource_type()\n\n    impl_diagnosticreport_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DiagnosticReport\" == data[\"resourceType\"]\n\n    inst2 = diagnosticreport.DiagnosticReport(**data)\n    impl_diagnosticreport_2(inst2)\n\n\ndef impl_diagnosticreport_3(inst):\n    assert inst.category[0].coding[0].code == \"394914008\"\n    assert inst.category[0].coding[0].display == \"Radiology\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].coding[1].code == \"RAD\"\n    assert (\n        inst.category[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0074\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"429858000\"\n    assert inst.code.coding[0].display == \"Computed tomography (CT) of head and neck\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"CT of head-neck\"\n    assert inst.conclusion == \"CT brains: large tumor sphenoid/clivus.\"\n    assert inst.conclusionCode[0].coding[0].code == \"188340000\"\n    assert (\n        inst.conclusionCode[0].coding[0].display\n        == \"Malignant tumor of craniopharyngeal duct\"\n    )\n    assert (\n        inst.conclusionCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"is1\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-12-01T12:00:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"f201\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2012-12-01T12:00:00+01:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Blijdorp MC\"\n    assert inst.performer[0].reference == \"Organization/f203\"\n    assert inst.status == \"final\"\n    assert inst.study[0].reference == \"#is1\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_diagnosticreport_3(base_settings):\n    \"\"\"No. 3 tests collection for DiagnosticReport.\n    Test File: diagnosticreport-example-f201-brainct.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"diagnosticreport-example-f201-brainct.json\"\n    )\n    inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes())\n    assert \"DiagnosticReport\" == inst.get_resource_type()\n\n    impl_diagnosticreport_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DiagnosticReport\" == data[\"resourceType\"]\n\n    inst2 = diagnosticreport.DiagnosticReport(**data)\n    impl_diagnosticreport_3(inst2)\n\n\ndef impl_diagnosticreport_4(inst):\n    assert inst.code.coding[0].code == \"47527-7\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-02-11T10:33:33+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"pap\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-02-13T11:45:33+11:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].reference == \"Practitioner/example\"\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/b248b1b2-1686-4b94-9936-37d7a5f94b51\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_diagnosticreport_4(base_settings):\n    \"\"\"No. 4 tests collection for DiagnosticReport.\n    Test File: diagnosticreport-example-papsmear.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"diagnosticreport-example-papsmear.json\"\n    )\n    inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes())\n    assert \"DiagnosticReport\" == inst.get_resource_type()\n\n    impl_diagnosticreport_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DiagnosticReport\" == data[\"resourceType\"]\n\n    inst2 = diagnosticreport.DiagnosticReport(**data)\n    impl_diagnosticreport_4(inst2)\n\n\ndef impl_diagnosticreport_5(inst):\n    assert inst.category[0].coding[0].code == \"PAT\"\n    assert (\n        inst.category[0].coding[0].display\n        == \"Pathology (gross & histopath, not surgical)\"\n    )\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0074\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Pathology\"\n    assert inst.code.coding[0].code == \"4503\"\n    assert inst.code.coding[0].display == (\n        \"Biopsy without Microscopic Description (1 \" \"Site/Lesion)-Standard\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.acmeonline.com\"}\n        ).valueUri\n    )\n    assert inst.code.text == (\n        \"Biopsy without Microscopic Description (1 \" \"Site/Lesion)-Standard\"\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"gingival-mass\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.acmeonline.com\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"P73456090\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2017-03-15T08:13:08Z\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Acme Animal Labs\"\n    assert inst.presentedForm[0].contentType == \"application/pdf\"\n    assert inst.presentedForm[0].language == \"en\"\n    assert inst.presentedForm[0].title == (\n        \"LAB ID: P73456090 MAX JONES Biopsy without Microscopic \"\n        \"Description (1 Site/Lesion)-Standard\"\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.display == \"Max Jones\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_diagnosticreport_5(base_settings):\n    \"\"\"No. 5 tests collection for DiagnosticReport.\n    Test File: diagnosticreport-example-gingival-mass.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"diagnosticreport-example-gingival-mass.json\"\n    )\n    inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes())\n    assert \"DiagnosticReport\" == inst.get_resource_type()\n\n    impl_diagnosticreport_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DiagnosticReport\" == data[\"resourceType\"]\n\n    inst2 = diagnosticreport.DiagnosticReport(**data)\n    impl_diagnosticreport_5(inst2)\n\n\ndef impl_diagnosticreport_6(inst):\n    assert inst.code.coding[0].code == \"38269-7\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"DXA BONE DENSITOMETRY\"\n    assert inst.conclusionCode[0].coding[0].code == \"391040000\"\n    assert (\n        inst.conclusionCode[0].coding[0].display == \"At risk of osteoporotic fracture\"\n    )\n    assert (\n        inst.conclusionCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2008-06-17\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"102\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2008-06-18T09:23:00+10:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Dr Henry Seven\"\n    assert (\n        inst.performer[0].reference\n        == \"Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809\"\n    )\n    assert inst.result[0].reference == \"Observation/bmd\"\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/pat2\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_diagnosticreport_6(base_settings):\n    \"\"\"No. 6 tests collection for DiagnosticReport.\n    Test File: diagnosticreport-example-dxa.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"diagnosticreport-example-dxa.json\"\n    inst = diagnosticreport.DiagnosticReport.model_validate_json(filename.read_bytes())\n    assert \"DiagnosticReport\" == inst.get_resource_type()\n\n    impl_diagnosticreport_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DiagnosticReport\" == data[\"resourceType\"]\n\n    inst2 = diagnosticreport.DiagnosticReport(**data)\n    impl_diagnosticreport_6(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_documentreference.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/DocumentReference\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import documentreference\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_documentreference_1(inst):\n    assert (\n        inst.content[0].attachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:02:01+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.content[0].attachment.title == \"Sample Genomic File\"\n    assert (\n        inst.content[0].attachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.somesystemabc.net/identifiers/files/11114\"}\n        ).valueUrl\n    )\n    assert inst.description == (\n        \"A sample Document Reference instance representing a generic \"\n        \"genomic file that may ber used as input or output of a \"\n        \"genomic analysis pipeline.\"\n    )\n    assert inst.docStatus == \"preliminary\"\n    assert inst.id == \"genomicFile4\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/files\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"11114\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.securityLabel[0].coding[0].code == \"R\"\n    assert inst.securityLabel[0].coding[0].display == \"Restricted\"\n    assert (\n        inst.securityLabel[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.status == \"current\"\n    assert inst.subject.display == \"Child Junior Doe\"\n    assert inst.subject.reference == \"Patient/denovoChild\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_documentreference_1(base_settings):\n    \"\"\"No. 1 tests collection for DocumentReference.\n    Test File: DocumentReference-genomicFile4.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"DocumentReference-genomicFile4.json\"\n    )\n    inst = documentreference.DocumentReference.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DocumentReference\" == inst.get_resource_type()\n\n    impl_documentreference_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentReference\" == data[\"resourceType\"]\n\n    inst2 = documentreference.DocumentReference(**data)\n    impl_documentreference_1(inst2)\n\n\ndef impl_documentreference_2(inst):\n    assert inst.author[0].display == \"G.E. Medical Systems\"\n    assert inst.bodySite[0].concept.coding[0].code == \"67734004\"\n    assert inst.bodySite[0].concept.coding[0].display == \"Upper Trunk Structure\"\n    assert (\n        inst.bodySite[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.content[0].attachment.contentType == \"application/dicom\"\n    assert inst.content[0].attachment.height == 480\n    assert inst.content[0].attachment.width == 640\n    assert inst.event[0].concept.coding[0].code == \"399067008\"\n    assert inst.event[0].concept.coding[0].display == \"Lateral projection\"\n    assert (\n        inst.event[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nema.org/fhir/extensions#0002-0010\"}\n        ).valueUri\n    )\n    assert (\n        inst.extension[0].valueUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.840.10008.1.2.1\"}\n        ).valueUri\n    )\n    assert inst.id == \"1.2.840.11361907579238403408700.3.1.04.19970327150033\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme-imaging.com/accession/2012\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"accessionNo\"\n    assert inst.identifier[0].value == \"1234567\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[1].type.text == \"studyId\"\n    assert (\n        inst.identifier[1].value\n        == \"urn:oid:1.2.840.113619.2.21.848.34082.0.538976288.3\"\n    )\n    assert (\n        inst.identifier[2].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[2].type.text == \"seriesId\"\n    assert (\n        inst.identifier[2].value\n        == \"urn:oid:1.2.840.113619.2.21.3408.700.0.757923840.3.0\"\n    )\n    assert (\n        inst.identifier[3].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[3].type.text == \"InstanceUID\"\n    assert inst.identifier[3].use == \"official\"\n    assert inst.identifier[3].value == (\n        \"urn:oid:1.2.840.11361907579238403408700.3.1.04.1997032715003\" \"3\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.modality[0].coding[0].code == \"US\"\n    assert (\n        inst.modality[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.status == \"current\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_documentreference_2(base_settings):\n    \"\"\"No. 2 tests collection for DocumentReference.\n    Test File: documentreference-example-dicom.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"documentreference-example-dicom.json\"\n    )\n    inst = documentreference.DocumentReference.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DocumentReference\" == inst.get_resource_type()\n\n    impl_documentreference_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentReference\" == data[\"resourceType\"]\n\n    inst2 = documentreference.DocumentReference(**data)\n    impl_documentreference_2(inst2)\n\n\ndef impl_documentreference_3(inst):\n    assert (\n        inst.content[0].attachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-03-01T01:02:01+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.content[0].attachment.title == \"CNVAnalysis_called\"\n    assert (\n        inst.content[0].attachment.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://chat.fhir.org/user_uploads/10155/Hnv3LtumKn-1QjeyS2KVuw4R/CNVAnalysis_called.bed\"\n            }\n        ).valueUrl\n    )\n    assert inst.description == (\n        \"CNVAnalysis_called: A sample Document Reference instance \"\n        \"representing a BED file that may be used as input or output \"\n        \"of a genomic analysis pipeline.\"\n    )\n    assert inst.docStatus == \"preliminary\"\n    assert inst.id == \"CNVAnalysis-called\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/files\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"11120\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.securityLabel[0].coding[0].code == \"R\"\n    assert inst.securityLabel[0].coding[0].display == \"Restricted\"\n    assert (\n        inst.securityLabel[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_documentreference_3(base_settings):\n    \"\"\"No. 3 tests collection for DocumentReference.\n    Test File: DocumentReference-CNVAnalysis_called.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"DocumentReference-CNVAnalysis_called.json\"\n    )\n    inst = documentreference.DocumentReference.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DocumentReference\" == inst.get_resource_type()\n\n    impl_documentreference_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentReference\" == data[\"resourceType\"]\n\n    inst2 = documentreference.DocumentReference(**data)\n    impl_documentreference_3(inst2)\n\n\ndef impl_documentreference_4(inst):\n    assert (\n        inst.content[0].attachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:01+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.content[0].attachment.title == \"Sample Genomic File\"\n    assert (\n        inst.content[0].attachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.somesystemabc.net/identifiers/files/11113\"}\n        ).valueUrl\n    )\n    assert inst.description == (\n        \"A sample Document Reference instance representing a generic \"\n        \"genomic file that may ber used as input or output of a \"\n        \"genomic analysis pipeline.\"\n    )\n    assert inst.docStatus == \"preliminary\"\n    assert inst.id == \"genomicFileFather\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/files\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"111110\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.securityLabel[0].coding[0].code == \"R\"\n    assert inst.securityLabel[0].coding[0].display == \"Restricted\"\n    assert (\n        inst.securityLabel[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.status == \"current\"\n    assert inst.subject.display == \"John Doe\"\n    assert inst.subject.reference == \"Patient/father\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_documentreference_4(base_settings):\n    \"\"\"No. 4 tests collection for DocumentReference.\n    Test File: DocumentReference-genomicFileFather.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"DocumentReference-genomicFileFather.json\"\n    )\n    inst = documentreference.DocumentReference.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DocumentReference\" == inst.get_resource_type()\n\n    impl_documentreference_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentReference\" == data[\"resourceType\"]\n\n    inst2 = documentreference.DocumentReference(**data)\n    impl_documentreference_4(inst2)\n\n\ndef impl_documentreference_5(inst):\n    assert inst.attester[0].mode.coding[0].code == \"professional\"\n    assert (\n        inst.attester[0].mode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/composition-attestation-mode\"}\n        ).valueUri\n    )\n    assert inst.attester[0].party.reference == \"#in-author\"\n    assert inst.author[0].reference == \"#in-author\"\n    assert inst.category[0].coding[0].code == \"11369-6\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"in-author\"\n    assert inst.contained[1].id == \"in-patient\"\n    assert inst.content[0].attachment.contentType == \"text/plain\"\n    assert (\n        inst.content[0].attachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-31T23:50:50-05:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.content[0].attachment.hash\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueBase64Binary\": \"OGEzOGYyNjMzMDA2ZmQ1MzUxNDljNDRhM2E3M2YzMTI0MzdiMzQ3OA==\"\n            }\n        ).valueBase64Binary\n    )\n    assert inst.content[0].attachment.language == \"en\"\n    # Don't know how to create unit test\n    # for \"content[0].attachment.size\",\n    # which is a Integer64\n    assert (\n        inst.content[0].attachment.title\n        == \"DocumentReference for Comprehensive fully filled metadata\"\n    )\n    assert (\n        inst.content[0].attachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://example.com/nowhere.txt\"}\n        ).valueUrl\n    )\n    assert inst.content[0].profile[0].valueCoding.code == \"urn:ihe:iti:xds-sd:text:2008\"\n    assert (\n        inst.content[0].profile[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://ihe.net/fhir/ihe.formatcode.fhir/CodeSystem/formatcode\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2020-12-31T23:50:50-05:00\"}\n        ).valueInstant\n    )\n    assert inst.description == (\n        \"Example of a Comprehensive DocumentReference resource. This \"\n        \"is fully filled for all mandatory elements and all optional \"\n        \"elements.\"\n    )\n    assert inst.event[0].concept.coding[0].code == \"ACCTRECEIVABLE\"\n    assert (\n        inst.event[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.event[1].reference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.event[1].reference.identifier.value == (\n        \"urn:oid:1.2.840.113556.1.8000.2554.17917.46600.21181.17878.3\"\n        \"3419.62048.57128.2759\"\n    )\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/documentreference-sourcepatient\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueReference.reference == \"#in-patient\"\n    assert inst.facilityType.coding[0].code == \"82242000\"\n    assert (\n        inst.facilityType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"example-comprehensive\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == (\n        \"urn:oid:1.2.840.113556.1.8000.2554.58783.21864.3474.19410.44\"\n        \"358.58254.41281.46340\"\n    )\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].value == \"urn:uuid:0c287d32-01e3-4d87-9953-9fcc9404eb21\"\n    assert inst.meta.security[0].code == \"HTEST\"\n    assert (\n        inst.meta.security[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-31T23:50:50-05:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-31T23:50:50-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.practiceSetting.coding[0].code == \"408467006\"\n    assert (\n        inst.practiceSetting.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.relatesTo[0].code.coding[0].code == \"appends\"\n    assert (\n        inst.relatesTo[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/document-relationship-type\"}\n        ).valueUri\n    )\n    assert inst.relatesTo[0].target.reference == \"DocumentReference/example\"\n    assert inst.securityLabel[0].coding[0].code == \"N\"\n    assert (\n        inst.securityLabel[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.status == \"current\"\n    assert inst.subject.reference == \"Patient/xcda\"\n    assert inst.text.status == \"extensions\"\n    assert inst.type.coding[0].code == \"55107-7\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.version == \"urn:uuid:0c287d32-01e3-4d87-9953-9fcc9404eb21\"\n\n\ndef test_documentreference_5(base_settings):\n    \"\"\"No. 5 tests collection for DocumentReference.\n    Test File: documentreference-example-comprehensive.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"documentreference-example-comprehensive.json\"\n    )\n    inst = documentreference.DocumentReference.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DocumentReference\" == inst.get_resource_type()\n\n    impl_documentreference_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentReference\" == data[\"resourceType\"]\n\n    inst2 = documentreference.DocumentReference(**data)\n    impl_documentreference_5(inst2)\n\n\ndef impl_documentreference_6(inst):\n    assert (\n        inst.content[0].attachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-03-01T01:02:01+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.content[0].attachment.title == \"Sample Genomic VCF File\"\n    assert (\n        inst.content[0].attachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.somesystemabc.net/identifiers/files/11114\"}\n        ).valueUrl\n    )\n    assert inst.description == (\n        \"A sample Document Reference instance representing a VCF file\"\n        \" that may be used as input or output of a genomic analysis \"\n        \"pipeline.\"\n    )\n    assert inst.docStatus == \"preliminary\"\n    assert inst.id == \"genomicVCFfile\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/files\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"11116\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.securityLabel[0].coding[0].code == \"R\"\n    assert inst.securityLabel[0].coding[0].display == \"Restricted\"\n    assert (\n        inst.securityLabel[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_documentreference_6(base_settings):\n    \"\"\"No. 6 tests collection for DocumentReference.\n    Test File: DocumentReference-genomicVCFfile.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"DocumentReference-genomicVCFfile.json\"\n    )\n    inst = documentreference.DocumentReference.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DocumentReference\" == inst.get_resource_type()\n\n    impl_documentreference_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentReference\" == data[\"resourceType\"]\n\n    inst2 = documentreference.DocumentReference(**data)\n    impl_documentreference_6(inst2)\n\n\ndef impl_documentreference_7(inst):\n    assert (\n        inst.content[0].attachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-03-01T01:02:01+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.content[0].attachment.title == \"WES_FullSequencedRegion_GRCh38\"\n    assert (\n        inst.content[0].attachment.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://chat.fhir.org/user_uploads/10155/BILYJerATC59WlG15J316BEf/WES_FullSequencedRegion_GRCh38.bed\"\n            }\n        ).valueUrl\n    )\n    assert inst.description == (\n        \"WES_FullSequencedRegion_GRCh38: A sample Document Reference \"\n        \"instance representing a BED file that may be used as input \"\n        \"or output of a genomic analysis pipeline.\"\n    )\n    assert inst.docStatus == \"preliminary\"\n    assert inst.id == \"WES-FullSequencedRegion-GRCh38\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/files\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"11117\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.securityLabel[0].coding[0].code == \"R\"\n    assert inst.securityLabel[0].coding[0].display == \"Restricted\"\n    assert (\n        inst.securityLabel[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_documentreference_7(base_settings):\n    \"\"\"No. 7 tests collection for DocumentReference.\n    Test File: DocumentReference-WES_FullSequencedRegion_GRCh38.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"DocumentReference-WES_FullSequencedRegion_GRCh38.json\"\n    )\n    inst = documentreference.DocumentReference.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DocumentReference\" == inst.get_resource_type()\n\n    impl_documentreference_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentReference\" == data[\"resourceType\"]\n\n    inst2 = documentreference.DocumentReference(**data)\n    impl_documentreference_7(inst2)\n\n\ndef impl_documentreference_8(inst):\n    assert (\n        inst.content[0].attachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-03-01T01:02:01+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.content[0].attachment.title == \"SimpleVariantAnalysis_called\"\n    assert (\n        inst.content[0].attachment.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://chat.fhir.org/user_uploads/10155/jQZWWKs4JO8ZfhfrbsCbbMUA/SimpleVariantAnalysis_called.bed\"\n            }\n        ).valueUrl\n    )\n    assert inst.description == (\n        \"SimpleVariantAnalysis_called: A sample Document Reference \"\n        \"instance representing a BED file that may be used as input \"\n        \"or output of a genomic analysis pipeline.\"\n    )\n    assert inst.docStatus == \"preliminary\"\n    assert inst.id == \"SimpleVariantAnalysis-called\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/files\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"11118\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.securityLabel[0].coding[0].code == \"R\"\n    assert inst.securityLabel[0].coding[0].display == \"Restricted\"\n    assert (\n        inst.securityLabel[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_documentreference_8(base_settings):\n    \"\"\"No. 8 tests collection for DocumentReference.\n    Test File: DocumentReference-SimpleVariantAnalysis_called.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"DocumentReference-SimpleVariantAnalysis_called.json\"\n    )\n    inst = documentreference.DocumentReference.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DocumentReference\" == inst.get_resource_type()\n\n    impl_documentreference_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentReference\" == data[\"resourceType\"]\n\n    inst2 = documentreference.DocumentReference(**data)\n    impl_documentreference_8(inst2)\n\n\ndef impl_documentreference_9(inst):\n    assert (\n        inst.content[0].attachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-03-01T01:02:01+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.content[0].attachment.title == \"genomicVCFfile_simple\"\n    assert (\n        inst.content[0].attachment.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://chat.fhir.org/user_uploads/10155/gdL90-np7lJjGwUxeARapUHB/genomicVCFFile_simple.vcf\"\n            }\n        ).valueUrl\n    )\n    assert inst.description == (\n        \"genomicVCFfile_simple: A sample Document Reference instance \"\n        \"representing a VCF file that may be used as input or output \"\n        \"of a genomic analysis pipeline.\"\n    )\n    assert inst.docStatus == \"preliminary\"\n    assert inst.id == \"genomicVCFfile-simple\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/files\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"11119\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.securityLabel[0].coding[0].code == \"R\"\n    assert inst.securityLabel[0].coding[0].display == \"Restricted\"\n    assert (\n        inst.securityLabel[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_documentreference_9(base_settings):\n    \"\"\"No. 9 tests collection for DocumentReference.\n    Test File: DocumentReference-genomicVCFfile_simple.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"DocumentReference-genomicVCFfile_simple.json\"\n    )\n    inst = documentreference.DocumentReference.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DocumentReference\" == inst.get_resource_type()\n\n    impl_documentreference_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentReference\" == data[\"resourceType\"]\n\n    inst2 = documentreference.DocumentReference(**data)\n    impl_documentreference_9(inst2)\n\n\ndef impl_documentreference_10(inst):\n    assert (\n        inst.content[0].attachment.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:01+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.content[0].attachment.title == \"Sample Genomic File\"\n    assert (\n        inst.content[0].attachment.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.somesystemabc.net/identifiers/files/11112\"}\n        ).valueUrl\n    )\n    assert inst.description == (\n        \"A sample Document Reference instance representing a generic \"\n        \"genomic file that may ber used as input or output of a \"\n        \"genomic analysis pipeline.\"\n    )\n    assert inst.docStatus == \"preliminary\"\n    assert inst.id == \"genomicFile2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/files\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"11112\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.securityLabel[0].coding[0].code == \"R\"\n    assert inst.securityLabel[0].coding[0].display == \"Restricted\"\n    assert (\n        inst.securityLabel[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-Confidentiality\"}\n        ).valueUri\n    )\n    assert inst.status == \"current\"\n    assert inst.subject.display == \"Jane Doe\"\n    assert inst.subject.reference == \"Patient/denovoMother\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_documentreference_10(base_settings):\n    \"\"\"No. 10 tests collection for DocumentReference.\n    Test File: DocumentReference-genomicFile2.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"DocumentReference-genomicFile2.json\"\n    )\n    inst = documentreference.DocumentReference.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"DocumentReference\" == inst.get_resource_type()\n\n    impl_documentreference_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"DocumentReference\" == data[\"resourceType\"]\n\n    inst2 = documentreference.DocumentReference(**data)\n    impl_documentreference_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_encounter.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Encounter\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import encounter\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_encounter_1(inst):\n    assert (\n        inst.actualPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17T16:30:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.actualPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17T16:00:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.class_fhir[0].coding[0].code == \"HH\"\n    assert inst.class_fhir[0].coding[0].display == \"home health\"\n    assert (\n        inst.class_fhir[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"home\"\n    assert inst.id == \"home\"\n    assert inst.location[0].location.display == \"Client's home\"\n    assert inst.location[0].location.reference == \"#home\"\n    assert (\n        inst.location[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17T16:30:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.location[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17T16:00:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.location[0].status == \"completed\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.display == \"Dr Adam Careful\"\n    assert inst.participant[0].actor.reference == \"Practitioner/example\"\n    assert (\n        inst.participant[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17T16:30:00+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.participant[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17T16:00:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.participant[0].type[0].coding[0].code == \"PPRF\"\n    assert (\n        inst.participant[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.participant[1].actor.reference == \"Patient/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Encounter with '\n        \"patient @example who is at home</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_encounter_1(base_settings):\n    \"\"\"No. 1 tests collection for Encounter.\n    Test File: encounter-example-home.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"encounter-example-home.json\"\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_1(inst2)\n\n\ndef impl_encounter_2(inst):\n    assert inst.class_fhir[0].coding[0].code == \"AMB\"\n    assert inst.class_fhir[0].coding[0].display == \"ambulatory\"\n    assert (\n        inst.class_fhir[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.id == \"f201\"\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"Encounter_Roel_20130404\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/f201\"\n    assert inst.priority.coding[0].code == \"17621005\"\n    assert inst.priority.coding[0].display == \"Normal\"\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reason[0].value[0].concept.text == (\n        \"The patient had fever peaks over the last couple of days. He\"\n        \" is worried about these peaks.\"\n    )\n    assert inst.serviceProvider.reference == \"Organization/f201\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"11429006\"\n    assert inst.type[0].coding[0].display == \"Consultation\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_encounter_2(base_settings):\n    \"\"\"No. 2 tests collection for Encounter.\n    Test File: encounter-example-f201-20130404.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"encounter-example-f201-20130404.json\"\n    )\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_2(inst2)\n\n\ndef impl_encounter_3(inst):\n    assert inst.admission.admitSource.coding[0].code == \"305956004\"\n    assert inst.admission.admitSource.coding[0].display == \"Referral by physician\"\n    assert (\n        inst.admission.admitSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.admission.dischargeDisposition.coding[0].code == \"306689006\"\n    assert inst.admission.dischargeDisposition.coding[0].display == \"Discharge to home\"\n    assert (\n        inst.admission.dischargeDisposition.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.admission.preAdmissionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/pre-admissions\"}\n        ).valueUri\n    )\n    assert inst.admission.preAdmissionIdentifier.use == \"official\"\n    assert inst.admission.preAdmissionIdentifier.value == \"93042\"\n    assert inst.class_fhir[0].coding[0].code == \"AMB\"\n    assert inst.class_fhir[0].coding[0].display == \"ambulatory\"\n    assert (\n        inst.class_fhir[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.id == \"f003\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/encounters\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"v6751\"\n    assert inst.length.code == \"min\"\n    assert (\n        inst.length.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.length.unit == \"min\"\n    assert float(inst.length.value) == float(90)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.display == \"E.M. van den Broek\"\n    assert inst.participant[0].actor.reference == \"Practitioner/f001\"\n    assert inst.priority.coding[0].code == \"103391001\"\n    assert (\n        inst.priority.coding[0].display == \"Non-urgent ear, nose and throat admission\"\n    )\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reason[0].value[0].concept.coding[0].code == \"18099001\"\n    assert (\n        inst.reason[0].value[0].concept.coding[0].display == \"Retropharyngeal abscess\"\n    )\n    assert (\n        inst.reason[0].value[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.serviceProvider.reference == \"Organization/f001\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"270427003\"\n    assert inst.type[0].coding[0].display == \"Patient-initiated encounter\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_encounter_3(base_settings):\n    \"\"\"No. 3 tests collection for Encounter.\n    Test File: encounter-example-f003-abscess.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"encounter-example-f003-abscess.json\"\n    )\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_3(inst2)\n\n\ndef impl_encounter_4(inst):\n    assert inst.careTeam[0].reference == \"Encounter/example\"\n    assert inst.class_fhir[0].coding[0].code == \"IMP\"\n    assert inst.class_fhir[0].coding[0].display == \"inpatient encounter\"\n    assert (\n        inst.class_fhir[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"in-progress\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.subjectStatus.coding[0].code == \"receiving-care\"\n    assert (\n        inst.subjectStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/encounter-subject-status\"\n            }\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Encounter with '\n        \"patient @example</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_encounter_4(base_settings):\n    \"\"\"No. 4 tests collection for Encounter.\n    Test File: encounter-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"encounter-example.json\"\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_4(inst2)\n\n\ndef impl_encounter_5(inst):\n    assert inst.class_fhir[0].coding[0].code == \"IMP\"\n    assert inst.class_fhir[0].coding[0].display == \"inpatient encounter\"\n    assert (\n        inst.class_fhir[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.id == \"genomicEncounter\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"in-progress\"\n    assert inst.subject.reference == \"Patient/genomicPatient\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_encounter_5(base_settings):\n    \"\"\"No. 5 tests collection for Encounter.\n    Test File: Encounter-genomicEncounter.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Encounter-genomicEncounter.json\"\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_5(inst2)\n\n\ndef impl_encounter_6(inst):\n    assert (\n        inst.actualPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-20\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.actualPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-11\"}\n        ).valueDateTime\n    )\n    assert inst.class_fhir[0].coding[0].code == \"IMP\"\n    assert inst.class_fhir[0].coding[0].display == \"inpatient encounter\"\n    assert (\n        inst.class_fhir[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.id == \"colonoscopy\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.display == \"Dr Adam Careful\"\n    assert inst.participant[0].actor.reference == \"Practitioner/example\"\n    assert inst.participant[0].type[0].coding[0].code == \"PART\"\n    assert (\n        inst.participant[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.reason[0].value[0].concept.text == \"Routine investigation\"\n    assert inst.serviceProvider.display == \"Gastroenterology @ Acme Hospital\"\n    assert inst.serviceProvider.reference == \"Organization/1\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Henry Levin the 7th\"\n    assert inst.subject.reference == \"Patient/glossy\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"73761001\"\n    assert inst.type[0].coding[0].display == \"Colonoscopy (procedure)\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.type[0].text == \"Colonoscopy\"\n\n\ndef test_encounter_6(base_settings):\n    \"\"\"No. 6 tests collection for Encounter.\n    Test File: encounter-example-colonoscopy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"encounter-example-colonoscopy.json\"\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_6(inst2)\n\n\ndef impl_encounter_7(inst):\n    assert inst.admission.admitSource.coding[0].code == \"305997006\"\n    assert inst.admission.admitSource.coding[0].display == \"Referral by radiologist\"\n    assert (\n        inst.admission.admitSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.admission.dischargeDisposition.coding[0].code == \"306689006\"\n    assert inst.admission.dischargeDisposition.coding[0].display == \"Discharge to home\"\n    assert (\n        inst.admission.dischargeDisposition.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.admission.preAdmissionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/pre-admissions\"}\n        ).valueUri\n    )\n    assert inst.admission.preAdmissionIdentifier.use == \"official\"\n    assert inst.admission.preAdmissionIdentifier.value == \"98682\"\n    assert inst.class_fhir[0].coding[0].code == \"AMB\"\n    assert inst.class_fhir[0].coding[0].display == \"ambulatory\"\n    assert (\n        inst.class_fhir[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.id == \"f002\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/encounters\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"v3251\"\n    assert inst.length.code == \"min\"\n    assert (\n        inst.length.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.length.unit == \"min\"\n    assert float(inst.length.value) == float(140)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.display == \"M.I.M Versteegh\"\n    assert inst.participant[0].actor.reference == \"Practitioner/f003\"\n    assert inst.priority.coding[0].code == \"103391001\"\n    assert inst.priority.coding[0].display == \"Urgent\"\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reason[0].value[0].concept.coding[0].code == \"34068001\"\n    assert (\n        inst.reason[0].value[0].concept.coding[0].display == \"Partial lobectomy of lung\"\n    )\n    assert (\n        inst.reason[0].value[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.serviceProvider.display == \"BMC\"\n    assert inst.serviceProvider.reference == \"Organization/f001\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"270427003\"\n    assert inst.type[0].coding[0].display == \"Patient-initiated encounter\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_encounter_7(base_settings):\n    \"\"\"No. 7 tests collection for Encounter.\n    Test File: encounter-example-f002-lung.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"encounter-example-f002-lung.json\"\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_7(inst2)\n\n\ndef impl_encounter_8(inst):\n    assert inst.account[0].reference == \"Account/example\"\n    assert (\n        inst.actualPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-20\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.actualPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-11\"}\n        ).valueDateTime\n    )\n    assert inst.admission.admitSource.coding[0].code == \"309902002\"\n    assert (\n        inst.admission.admitSource.coding[0].display == \"Clinical Oncology Department\"\n    )\n    assert (\n        inst.admission.admitSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.admission.destination.reference == \"Location/2\"\n    assert inst.admission.origin.reference == \"Location/2\"\n    assert inst.admission.reAdmission.coding[0].display == \"readmitted\"\n    assert inst.appointment[0].reference == \"Appointment/example\"\n    assert inst.basedOn[0].reference == \"ServiceRequest/myringotomy\"\n    assert inst.class_fhir[0].coding[0].code == \"IMP\"\n    assert inst.class_fhir[0].coding[0].display == \"inpatient encounter\"\n    assert (\n        inst.class_fhir[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[0].condition[0].reference.reference == \"Condition/stroke\"\n    assert inst.diagnosis[0].use[0].coding[0].code == \"AD\"\n    assert inst.diagnosis[0].use[0].coding[0].display == \"Admission diagnosis\"\n    assert (\n        inst.diagnosis[0].use[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diagnosis-role\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[1].condition[0].reference.reference == \"Condition/f201\"\n    assert inst.diagnosis[1].use[0].coding[0].code == \"DD\"\n    assert inst.diagnosis[1].use[0].coding[0].display == \"Discharge diagnosis\"\n    assert (\n        inst.diagnosis[1].use[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diagnosis-role\"}\n        ).valueUri\n    )\n    assert inst.dietPreference[0].coding[0].code == \"276026009\"\n    assert inst.dietPreference[0].coding[0].display == \"Fluid balance regulation\"\n    assert (\n        inst.dietPreference[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.episodeOfCare[0].reference == \"EpisodeOfCare/example\"\n    assert inst.id == \"f203\"\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"Encounter_Roel_20130311\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.partOf.reference == \"Encounter/f203\"\n    assert inst.participant[0].actor.reference == \"Practitioner/f201\"\n    assert inst.participant[0].type[0].coding[0].code == \"PART\"\n    assert (\n        inst.participant[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.priority.coding[0].code == \"394849002\"\n    assert inst.priority.coding[0].display == \"High priority\"\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reason[0].value[0].concept.text == (\n        \"The patient seems to suffer from bilateral pneumonia and \"\n        \"renal insufficiency, most likely due to chemotherapy.\"\n    )\n    assert inst.serviceProvider.reference == \"Organization/2\"\n    assert inst.specialArrangement[0].coding[0].code == \"wheel\"\n    assert inst.specialArrangement[0].coding[0].display == \"Wheelchair\"\n    assert (\n        inst.specialArrangement[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/encounter-special-arrangements\"\n            }\n        ).valueUri\n    )\n    assert inst.specialCourtesy[0].coding[0].code == \"NRM\"\n    assert inst.specialCourtesy[0].coding[0].display == \"normal courtesy\"\n    assert (\n        inst.specialCourtesy[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-EncounterSpecialCourtesy\"\n            }\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"183807002\"\n    assert inst.type[0].coding[0].display == \"Inpatient stay for nine days\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_encounter_8(base_settings):\n    \"\"\"No. 8 tests collection for Encounter.\n    Test File: encounter-example-f203-20130311.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"encounter-example-f203-20130311.json\"\n    )\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_8(inst2)\n\n\ndef impl_encounter_9(inst):\n    assert inst.class_fhir[0].coding[0].code == \"AMB\"\n    assert inst.class_fhir[0].coding[0].display == \"ambulatory\"\n    assert (\n        inst.class_fhir[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.id == \"xcda\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://healthcare.example.org/identifiers/enocunter\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"1234213.52345873\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/xcda1\"\n    assert inst.reason[0].value[0].concept.coding[0].code == \"T-D8200\"\n    assert inst.reason[0].value[0].concept.coding[0].display == \"Arm\"\n    assert (\n        inst.reason[0].value[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/xds/connectathon/eventCodes\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/xcda\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_encounter_9(base_settings):\n    \"\"\"No. 9 tests collection for Encounter.\n    Test File: encounter-example-xcda.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"encounter-example-xcda.json\"\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_9(inst2)\n\n\ndef impl_encounter_10(inst):\n    assert inst.class_fhir[0].coding[0].code == \"AMB\"\n    assert inst.class_fhir[0].coding[0].display == \"ambulatory\"\n    assert (\n        inst.class_fhir[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.diagnosis[0].condition[0].concept.text == (\n        \"Complications from Roel's TPF chemotherapy on January 28th, \" \"2013\"\n    )\n    assert inst.diagnosis[0].use[0].coding[0].code == \"AD\"\n    assert inst.diagnosis[0].use[0].coding[0].display == \"Admission diagnosis\"\n    assert (\n        inst.diagnosis[0].use[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diagnosis-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.diagnosis[1].condition[0].concept.text\n        == \"The patient is treated for a tumor\"\n    )\n    assert inst.diagnosis[1].use[0].coding[0].code == \"CC\"\n    assert inst.diagnosis[1].use[0].coding[0].display == \"Chief complaint\"\n    assert (\n        inst.diagnosis[1].use[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diagnosis-role\"}\n        ).valueUri\n    )\n    assert inst.id == \"f202\"\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"Encounter_Roel_20130128\"\n    assert inst.length.code == \"min\"\n    assert (\n        inst.length.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.length.unit == \"minutes\"\n    assert float(inst.length.value) == float(56)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/f201\"\n    assert inst.priority.coding[0].code == \"103391001\"\n    assert inst.priority.coding[0].display == \"Urgent\"\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reason[0].value[0].concept.text == \"The patient is treated for a tumor.\"\n    assert inst.serviceProvider.reference == \"Organization/f201\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"367336001\"\n    assert inst.type[0].coding[0].display == \"Chemotherapy\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_encounter_10(base_settings):\n    \"\"\"No. 10 tests collection for Encounter.\n    Test File: encounter-example-f202-20130128.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"encounter-example-f202-20130128.json\"\n    )\n    inst = encounter.Encounter.model_validate_json(filename.read_bytes())\n    assert \"Encounter\" == inst.get_resource_type()\n\n    impl_encounter_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Encounter\" == data[\"resourceType\"]\n\n    inst2 = encounter.Encounter(**data)\n    impl_encounter_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_encounterhistory.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EncounterHistory\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import encounterhistory\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_encounterhistory_1(inst):\n    assert inst.class_fhir.coding[0].code == \"IMP\"\n    assert inst.class_fhir.coding[0].display == \"inpatient encounter\"\n    assert (\n        inst.class_fhir.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.amc.nl/zorgportal/identifiers/visits\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"v2452\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"in-progress\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Encounter with '\n        \"patient @example</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_encounterhistory_1(base_settings):\n    \"\"\"No. 1 tests collection for EncounterHistory.\n    Test File: encounterhistory-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"encounterhistory-example.json\"\n    inst = encounterhistory.EncounterHistory.model_validate_json(filename.read_bytes())\n    assert \"EncounterHistory\" == inst.get_resource_type()\n\n    impl_encounterhistory_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EncounterHistory\" == data[\"resourceType\"]\n\n    inst2 = encounterhistory.EncounterHistory(**data)\n    impl_encounterhistory_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_endpoint.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Endpoint\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import endpoint\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_endpoint_1(inst):\n    assert (\n        inst.address\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"mailto:MARTIN.SMIETANKA@directnppes.com\"}\n        ).valueUrl\n    )\n    assert inst.connectionType[0].coding[0].code == \"direct-project\"\n    assert inst.id == \"direct-endpoint\"\n    assert inst.managingOrganization.reference == \"Organization/f201\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"MARTIN SMIETANKA\"\n    assert inst.payload[0].mimeType[0] == \"text/x-hl7-text+xml\"\n    assert inst.payload[0].mimeType[1] == \"application/fhir+xml\"\n    assert inst.payload[0].mimeType[2] == \"application/fhir+json\"\n    assert (\n        inst.payload[0].type[0].coding[0].code\n        == \"urn:hl7-org:sdwg:ccda-structuredBody:1.1\"\n    )\n    assert (\n        inst.payload[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.3.6.1.4.1.19376.1.2.3\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_endpoint_1(base_settings):\n    \"\"\"No. 1 tests collection for Endpoint.\n    Test File: endpoint-example-direct.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"endpoint-example-direct.json\"\n    inst = endpoint.Endpoint.model_validate_json(filename.read_bytes())\n    assert \"Endpoint\" == inst.get_resource_type()\n\n    impl_endpoint_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Endpoint\" == data[\"resourceType\"]\n\n    inst2 = endpoint.Endpoint(**data)\n    impl_endpoint_1(inst2)\n\n\ndef impl_endpoint_2(inst):\n    assert (\n        inst.address\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://pacs.hospital.org/wado-rs\"}\n        ).valueUrl\n    )\n    assert inst.connectionType[0].coding[0].code == \"dicom-wado-rs\"\n    assert (\n        inst.connectionType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/endpoint-connection-type\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"example-wadors\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"PACS Hospital DICOM WADO-RS endpoint\"\n    assert inst.payload[0].mimeType[0] == \"application/dicom\"\n    assert inst.payload[0].type[0].text == \"DICOM WADO-RS\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_endpoint_2(base_settings):\n    \"\"\"No. 2 tests collection for Endpoint.\n    Test File: endpoint-example-wadors.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"endpoint-example-wadors.json\"\n    inst = endpoint.Endpoint.model_validate_json(filename.read_bytes())\n    assert \"Endpoint\" == inst.get_resource_type()\n\n    impl_endpoint_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Endpoint\" == data[\"resourceType\"]\n\n    inst2 = endpoint.Endpoint(**data)\n    impl_endpoint_2(inst2)\n\n\ndef impl_endpoint_3(inst):\n    assert (\n        inst.address\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://fhir3.healthintersections.com.au/open/CarePlan\"}\n        ).valueUrl\n    )\n    assert inst.connectionType[0].coding[0].code == \"hl7-fhir-rest\"\n    assert (\n        inst.connectionType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/endpoint-connection-type\"\n            }\n        ).valueUri\n    )\n    assert inst.contact[0].system == \"email\"\n    assert inst.contact[0].use == \"work\"\n    assert inst.contact[0].value == \"endpointmanager@example.org\"\n    assert inst.description == (\n        \"The CarePlan hub provides a test/dev environment for testing\" \" submissions\"\n    )\n    assert inst.environmentType[0].coding[0].code == \"test\"\n    assert (\n        inst.environmentType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/endpoint-environment\"}\n        ).valueUri\n    )\n    assert inst.environmentType[1].coding[0].code == \"dev\"\n    assert (\n        inst.environmentType[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/endpoint-environment\"}\n        ).valueUri\n    )\n    assert inst.header[0] == \"bearer-code BASGS534s4\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/enpoint-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"epcp12\"\n    assert inst.managingOrganization.reference == \"Organization/hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Health Intersections CarePlan Hub\"\n    assert inst.payload[0].mimeType[0] == \"application/fhir+xml\"\n    assert inst.payload[0].type[0].coding[0].code == \"CarePlan\"\n    assert (\n        inst.payload[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_endpoint_3(base_settings):\n    \"\"\"No. 3 tests collection for Endpoint.\n    Test File: endpoint-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"endpoint-example.json\"\n    inst = endpoint.Endpoint.model_validate_json(filename.read_bytes())\n    assert \"Endpoint\" == inst.get_resource_type()\n\n    impl_endpoint_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Endpoint\" == data[\"resourceType\"]\n\n    inst2 = endpoint.Endpoint(**data)\n    impl_endpoint_3(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_enrollmentrequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EnrollmentRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import enrollmentrequest\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_enrollmentrequest_1(inst):\n    assert inst.candidate.reference == \"Patient/1\"\n    assert inst.coverage.reference == \"Coverage/9876B1\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"22345\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/enrollmentrequest\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"EN22345\"\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.provider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the EnrollmentRequest.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_enrollmentrequest_1(base_settings):\n    \"\"\"No. 1 tests collection for EnrollmentRequest.\n    Test File: enrollmentrequest-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"enrollmentrequest-example.json\"\n    inst = enrollmentrequest.EnrollmentRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"EnrollmentRequest\" == inst.get_resource_type()\n\n    impl_enrollmentrequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EnrollmentRequest\" == data[\"resourceType\"]\n\n    inst2 = enrollmentrequest.EnrollmentRequest(**data)\n    impl_enrollmentrequest_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_enrollmentresponse.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EnrollmentResponse\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import enrollmentresponse\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_enrollmentresponse_1(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Dependant added to policy.\"\n    assert inst.id == \"ER2500\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/enrollmentresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"781234\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization.reference == \"Organization/2\"\n    assert inst.outcome == \"complete\"\n    assert (\n        inst.request.reference\n        == \"http://www.BenefitsInc.com/fhir/eligibility/225476332402\"\n    )\n    assert inst.requestProvider.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the EnrollmentResponse</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_enrollmentresponse_1(base_settings):\n    \"\"\"No. 1 tests collection for EnrollmentResponse.\n    Test File: enrollmentresponse-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"enrollmentresponse-example.json\"\n    inst = enrollmentresponse.EnrollmentResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"EnrollmentResponse\" == inst.get_resource_type()\n\n    impl_enrollmentresponse_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EnrollmentResponse\" == data[\"resourceType\"]\n\n    inst2 = enrollmentresponse.EnrollmentResponse(**data)\n    impl_enrollmentresponse_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_episodeofcare.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EpisodeOfCare\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import episodeofcare\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_episodeofcare_1(inst):\n    assert inst.account[0].display == \"example account\"\n    assert inst.account[0].reference == \"Account/example\"\n    assert inst.careManager.display == \"Carla Espinosa\"\n    assert inst.careManager.reference == \"Practitioner/f204\"\n    assert inst.careTeam[0].display == \"example care team\"\n    assert inst.careTeam[0].reference == \"CareTeam/example\"\n    assert inst.diagnosis[0].condition[0].reference.reference == \"Condition/stroke\"\n    assert inst.diagnosis[0].use.coding[0].code == \"CC\"\n    assert inst.diagnosis[0].use.coding[0].display == \"Chief complaint\"\n    assert (\n        inst.diagnosis[0].use.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diagnosis-role\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/sampleepisodeofcare-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.managingOrganization.reference == \"Organization/hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-01\"}\n        ).valueDateTime\n    )\n    assert inst.referralRequest[0].display == \"Referral from Example Aged Care Services\"\n    assert inst.status == \"active\"\n    assert (\n        inst.statusHistory[0].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-14\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.statusHistory[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-01\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[0].status == \"planned\"\n    assert (\n        inst.statusHistory[1].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-21\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.statusHistory[1].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-15\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[1].status == \"active\"\n    assert (\n        inst.statusHistory[2].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-24\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.statusHistory[2].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-22\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[2].status == \"onhold\"\n    assert (\n        inst.statusHistory[3].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-25\"}\n        ).valueDateTime\n    )\n    assert inst.statusHistory[3].status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"hacc\"\n    assert inst.type[0].coding[0].display == \"Home and Community Care\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/episodeofcare-type\"}\n        ).valueUri\n    )\n\n\ndef test_episodeofcare_1(base_settings):\n    \"\"\"No. 1 tests collection for EpisodeOfCare.\n    Test File: episodeofcare-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"episodeofcare-example.json\"\n    inst = episodeofcare.EpisodeOfCare.model_validate_json(filename.read_bytes())\n    assert \"EpisodeOfCare\" == inst.get_resource_type()\n\n    impl_episodeofcare_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EpisodeOfCare\" == data[\"resourceType\"]\n\n    inst2 = episodeofcare.EpisodeOfCare(**data)\n    impl_episodeofcare_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_eventdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EventDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import eventdefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_eventdefinition_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.purpose == \"Monitor all admissions to Emergency\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.trigger[0].condition.description == (\n        \"Encounter Location = emergency (active/completed encounters,\"\n        \" current or previous)\"\n    )\n    assert inst.trigger[0].condition.expression == (\n        \"(%current | %previous).location.where(location = \"\n        \"'Location/emergency' and status in {'active', \"\n        \"'completed'}).exists()\"\n    )\n    assert inst.trigger[0].condition.language == \"text/fhirpath\"\n    assert inst.trigger[0].data[0].type == \"Encounter\"\n    assert inst.trigger[0].name == \"monitor-emergency-admissions\"\n    assert inst.trigger[0].type == \"named-event\"\n\n\ndef test_eventdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for EventDefinition.\n    Test File: eventdefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"eventdefinition-example.json\"\n    inst = eventdefinition.EventDefinition.model_validate_json(filename.read_bytes())\n    assert \"EventDefinition\" == inst.get_resource_type()\n\n    impl_eventdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EventDefinition\" == data[\"resourceType\"]\n\n    inst2 = eventdefinition.EventDefinition(**data)\n    impl_eventdefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_evidence.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Evidence\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import evidence\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_evidence_1(inst):\n    assert inst.description == (\n        \"0.4% incidence of fatal intracranial hemorrhage within 7 \"\n        \"days without alteplase in patients with acute ischemic \"\n        \"stroke\"\n    )\n    assert inst.id == \"example-stroke-no-alteplase-fatalICH\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.10.4\"\n    assert inst.name == \"RiskOfFatalICHWithoutAlteplaseForStroke\"\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1016/S0140-6736(14)60584-5\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].label == \"Emberson 2014\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert inst.statistic[0].numberOfEvents == 13\n    assert float(inst.statistic[0].quantity.value) == float(0.00386298627)\n    assert inst.statistic[0].sampleSize.numberOfParticipants == 3365\n    assert inst.statistic[0].sampleSize.numberOfStudies == 9\n    assert inst.statistic[0].statisticType.coding[0].code == \"C44256\"\n    assert inst.statistic[0].statisticType.coding[0].display == \"Proportion\"\n    assert (\n        inst.statistic[0].statisticType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/statistic-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.studyDesign[0].coding[0].code == \"SEVCO:01003\"\n    assert inst.studyDesign[0].coding[0].display == \"randomized assignment\"\n    assert (\n        inst.studyDesign[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/study-design\"}\n        ).valueUri\n    )\n    assert inst.synthesisType.coding[0].code == \"IPD-MA\"\n    assert (\n        inst.synthesisType.coding[0].display == \"individual patient data meta-analysis\"\n    )\n    assert (\n        inst.synthesisType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/synthesis-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Risk of fatal ICH without alteplase for stroke\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/Evidence/example-stroke-no-alteplase-fatalICH\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[0].intended.display\n        == \"adults with acute ischemic stroke\"\n    )\n    assert inst.variableDefinition[0].intended.reference == \"Group/AcuteIschemicStroke\"\n    assert (\n        inst.variableDefinition[0].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.variableDefinition[0].observed.display\n        == \"adults with acute ischemic stroke\"\n    )\n    assert inst.variableDefinition[0].observed.reference == \"Group/AcuteIschemicStroke\"\n    assert (\n        inst.variableDefinition[0].observed.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.variableDefinition[0].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[0].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[0].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].intended.display\n        == \"adults with acute ischemic stroke treated without alteplase\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.reference\n        == \"Group/AcuteIschemicStrokeTreatedWithoutAlteplase\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].observed.display\n        == \"Emberson 2014 IPD-MA No Alteplase Cohort\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.reference\n        == \"Group/Emberson-2014-IPD-MA-No-Alteplase-Cohort\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.variableDefinition[1].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[1].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].intended.display == \"fatal ICH\"\n    assert (\n        inst.variableDefinition[2].intended.reference\n        == \"EvidenceVariable/example-fatal-ICH-in-7-days\"\n    )\n    assert (\n        inst.variableDefinition[2].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].observed.display == \"fatal ICH\"\n    assert (\n        inst.variableDefinition[2].observed.reference\n        == \"EvidenceVariable/example-fatal-ICH-in-7-days\"\n    )\n    assert (\n        inst.variableDefinition[2].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].variableRole.coding[0].code == \"measuredVariable\"\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].display == \"measured variable\"\n    )\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n\n\ndef test_evidence_1(base_settings):\n    \"\"\"No. 1 tests collection for Evidence.\n    Test File: evidence-example-stroke-no-alteplase-fatalICH.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidence-example-stroke-no-alteplase-fatalICH.json\"\n    )\n    inst = evidence.Evidence.model_validate_json(filename.read_bytes())\n    assert \"Evidence\" == inst.get_resource_type()\n\n    impl_evidence_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Evidence\" == data[\"resourceType\"]\n\n    inst2 = evidence.Evidence(**data)\n    impl_evidence_1(inst2)\n\n\ndef impl_evidence_2(inst):\n    assert inst.certainty[0].description == (\n        \"Very low certainty due to risk of bias, inconsistency, \"\n        \"imprecision, and indirectness\"\n    )\n    assert inst.certainty[0].rating.coding[0].code == \"very-low\"\n    assert inst.certainty[0].rating.coding[0].display == \"Very low quality\"\n    assert (\n        inst.certainty[0].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[0].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[0].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[0].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[0].type.coding[0].code == \"PublicationBias\"\n    assert (\n        inst.certainty[0].subcomponent[0].type.coding[0].display == \"Publication bias\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[1].note[0].text == (\n        \"IST-3 had inconsistent results and contributed large \" \"proportion of data\"\n    )\n    assert inst.certainty[0].subcomponent[1].rating.coding[0].code == \"serious-concern\"\n    assert (\n        inst.certainty[0].subcomponent[1].rating.coding[0].display == \"serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[1].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[1].type.coding[0].code == \"Inconsistency\"\n    assert inst.certainty[0].subcomponent[1].type.coding[0].display == \"Inconsistency\"\n    assert (\n        inst.certainty[0].subcomponent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[2].rating.coding[0].code == \"serious-concern\"\n    assert (\n        inst.certainty[0].subcomponent[2].rating.coding[0].display == \"serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[2].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[2].type.coding[0].code == \"Imprecision\"\n    assert inst.certainty[0].subcomponent[2].type.coding[0].display == \"Imprecision\"\n    assert (\n        inst.certainty[0].subcomponent[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[3].note[0].text == (\n        \"resuts derived for 3 - 4.5 hours assume data from 0 - 6 \"\n        \"hours is informative\"\n    )\n    assert inst.certainty[0].subcomponent[3].rating.coding[0].code == \"serious-concern\"\n    assert (\n        inst.certainty[0].subcomponent[3].rating.coding[0].display == \"serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[3].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[3].type.coding[0].code == \"Indirectness\"\n    assert inst.certainty[0].subcomponent[3].type.coding[0].display == \"Indirectness\"\n    assert (\n        inst.certainty[0].subcomponent[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[4].note[0].text == (\n        \"results largely influenced by IST-3 trial which was \"\n        \"unblinded and ECASS III which had baseline imbalances\"\n    )\n    assert inst.certainty[0].subcomponent[4].rating.coding[0].code == \"serious-concern\"\n    assert (\n        inst.certainty[0].subcomponent[4].rating.coding[0].display == \"serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[4].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[4].type.coding[0].code == \"RiskOfBias\"\n    assert inst.certainty[0].subcomponent[4].type.coding[0].display == \"Risk of bias\"\n    assert (\n        inst.certainty[0].subcomponent[4].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].type.coding[0].code == \"Overall\"\n    assert inst.certainty[0].type.coding[0].display == \"Overall quality\"\n    assert (\n        inst.certainty[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.description == (\n        \"mRS 0-2 at 90 days Odds Ratio 1.2 for Alteplase vs. No \"\n        \"Alteplase in patients with acute ischemic stroke 3-4.5 hours\"\n        \" prior\"\n    )\n    assert inst.id == \"example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.10.3\"\n    assert inst.name == (\n        \"EffectOfAlteplaseVsNoAlteplaseOnMRS02At90DaysInStroke345Hour\" \"sPrior\"\n    )\n    assert inst.relatedArtifact[0].display == \"Figure 2 Lees 2016\"\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1161/STROKEAHA.116.013644\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].label == \"Lees 2016\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert inst.statistic[0].attributeEstimate[0].description == \"95% CI 1.06 to 1.3\"\n    assert float(inst.statistic[0].attributeEstimate[0].level) == float(0.95)\n    assert float(inst.statistic[0].attributeEstimate[0].range.high.value) == float(1.3)\n    assert float(inst.statistic[0].attributeEstimate[0].range.low.value) == float(1.06)\n    assert inst.statistic[0].attributeEstimate[0].type.coding[0].code == \"C53324\"\n    assert (\n        inst.statistic[0].attributeEstimate[0].type.coding[0].display\n        == \"Confidence interval\"\n    )\n    assert (\n        inst.statistic[0].attributeEstimate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/attribute-estimate-type\"\n            }\n        ).valueUri\n    )\n    assert float(inst.statistic[0].quantity.value) == float(1.2)\n    assert inst.statistic[0].sampleSize.numberOfStudies == 9\n    assert inst.statistic[0].statisticType.coding[0].code == \"C16932\"\n    assert inst.statistic[0].statisticType.coding[0].display == \"Odds Ratio\"\n    assert (\n        inst.statistic[0].statisticType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/statistic-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.studyDesign[0].coding[0].code == \"SEVCO:01003\"\n    assert inst.studyDesign[0].coding[0].display == \"randomized assignment\"\n    assert (\n        inst.studyDesign[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/study-design\"}\n        ).valueUri\n    )\n    assert inst.synthesisType.coding[0].code == \"IPD-MA\"\n    assert (\n        inst.synthesisType.coding[0].display == \"individual patient data meta-analysis\"\n    )\n    assert (\n        inst.synthesisType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/synthesis-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == (\n        \"Effect of Alteplase vs No alteplase on mRS 0-2 at 90 days in\"\n        \" Stroke 3-4.5 hours prior\"\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/Evidence/example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2\"\n            }\n        ).valueUri\n    )\n    assert inst.variableDefinition[0].directnessMatch.coding[0].code == \"moderate\"\n    assert (\n        inst.variableDefinition[0].directnessMatch.coding[0].display\n        == \"Moderate quality match\"\n    )\n    assert (\n        inst.variableDefinition[0].directnessMatch.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/directness\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[0].intended.display == \"stroke at 3-4.5 hours\"\n    assert (\n        inst.variableDefinition[0].intended.reference\n        == \"Group/AcuteIschemicStroke3-4halfHours\"\n    )\n    assert (\n        inst.variableDefinition[0].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.variableDefinition[0].observed.display\n        == \"Stroke Thrombolysis Trialists’ 2014-2016 IPD-MA Cohort\"\n    )\n    assert inst.variableDefinition[0].observed.reference == (\n        \"EvidenceVariable/Stroke-Thrombolysis-\" \"Trialists-2014-2016-IPD-MA-Cohort\"\n    )\n    assert (\n        inst.variableDefinition[0].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[0].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[0].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[0].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].intended.display\n        == \"Alive and not functionally dependent at 90 days\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.reference\n        == \"EvidenceVariable/example-alive-independent-90day\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[1].observed.display == \"mRS 0-2 at 90 days\"\n    assert (\n        inst.variableDefinition[1].observed.reference\n        == \"EvidenceVariable/example-mRS0-2-at-90days\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[1].variableRole.coding[0].code == \"measuredVariable\"\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].display == \"measured variable\"\n    )\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].intended.display == \"Alteplase for Stroke\"\n    assert (\n        inst.variableDefinition[2].intended.reference\n        == \"EvidenceVariable/example-alteplase-for-stroke\"\n    )\n    assert (\n        inst.variableDefinition[2].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].observed.display == \"Alteplase for Stroke\"\n    assert (\n        inst.variableDefinition[2].observed.reference\n        == \"EvidenceVariable/example-alteplase-for-stroke\"\n    )\n    assert (\n        inst.variableDefinition[2].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].variableRole.coding[0].code == \"exposure\"\n    assert inst.variableDefinition[2].variableRole.coding[0].display == \"exposure\"\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[3].intended.display == \"no alteplase\"\n    assert (\n        inst.variableDefinition[3].intended.reference\n        == \"EvidenceVariable/example-no-alteplase\"\n    )\n    assert (\n        inst.variableDefinition[3].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[3].observed.display == \"no alteplase\"\n    assert (\n        inst.variableDefinition[3].observed.reference\n        == \"EvidenceVariable/example-no-alteplase\"\n    )\n    assert (\n        inst.variableDefinition[3].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[3].variableRole.coding[0].code == \"referenceExposure\"\n    assert (\n        inst.variableDefinition[3].variableRole.coding[0].display\n        == \"reference exposure\"\n    )\n    assert (\n        inst.variableDefinition[3].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n\n\ndef test_evidence_2(base_settings):\n    \"\"\"No. 2 tests collection for Evidence.\n    Test File: evidence-example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidence-example-stroke-3-4half-alteplase-vs-no-alteplase-mRS0-2.json\"\n    )\n    inst = evidence.Evidence.model_validate_json(filename.read_bytes())\n    assert \"Evidence\" == inst.get_resource_type()\n\n    impl_evidence_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Evidence\" == data[\"resourceType\"]\n\n    inst2 = evidence.Evidence(**data)\n    impl_evidence_2(inst2)\n\n\ndef impl_evidence_3(inst):\n    assert inst.certainty[0].description == \"Moderate certainty due to risk of bias\"\n    assert inst.certainty[0].rating.coding[0].code == \"moderate\"\n    assert inst.certainty[0].rating.coding[0].display == \"Moderate\"\n    assert (\n        inst.certainty[0].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[0].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[0].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[0].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[0].type.coding[0].code == \"PublicationBias\"\n    assert (\n        inst.certainty[0].subcomponent[0].type.coding[0].display == \"Publication bias\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[1].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[1].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[1].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[1].type.coding[0].code == \"Inconsistency\"\n    assert inst.certainty[0].subcomponent[1].type.coding[0].display == \"Inconsistency\"\n    assert (\n        inst.certainty[0].subcomponent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[2].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[2].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[2].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[2].type.coding[0].code == \"Imprecision\"\n    assert inst.certainty[0].subcomponent[2].type.coding[0].display == \"Imprecision\"\n    assert (\n        inst.certainty[0].subcomponent[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[3].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[3].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[3].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[3].type.coding[0].code == \"Indirectness\"\n    assert inst.certainty[0].subcomponent[3].type.coding[0].display == \"Indirectness\"\n    assert (\n        inst.certainty[0].subcomponent[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[4].note[0].text == (\n        \"results largely influenced by IST-3 trial which was \"\n        \"unblinded and NINDS trial which had allocation concealment \"\n        \"not stated and baseline imbalances\"\n    )\n    assert inst.certainty[0].subcomponent[4].rating.coding[0].code == \"serious-concern\"\n    assert (\n        inst.certainty[0].subcomponent[4].rating.coding[0].display == \"serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[4].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[4].type.coding[0].code == \"RiskOfBias\"\n    assert inst.certainty[0].subcomponent[4].type.coding[0].display == \"Risk of bias\"\n    assert (\n        inst.certainty[0].subcomponent[4].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].type.coding[0].code == \"Overall\"\n    assert inst.certainty[0].type.coding[0].display == \"Overall quality\"\n    assert (\n        inst.certainty[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.description == (\n        \"mRS 3-6 at 90 days Odds Ratio 0.65 for Alteplase vs. No \"\n        \"Alteplase in patients with acute ischemic stroke 0-3 hours \"\n        \"prior\"\n    )\n    assert inst.id == \"example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.10.5\"\n    assert inst.name == (\n        \"EffectOfAlteplaseVsNoAlteplaseOnMRS36At90DaysInStroke03Hours\" \"Prior\"\n    )\n    assert inst.relatedArtifact[0].citation == (\n        \"Wardlaw JM, Murray V, Berge E, del Zoppo GJ. Thrombolysis \"\n        \"for acute ischaemic stroke. Cochrane Database Syst Rev. 2014\"\n        \" Jul 29(7):CD000213. PMID 25072528\"\n    )\n    assert inst.relatedArtifact[0].display == \"Analysis 1.16 from Wardlaw 2014\"\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1002/14651858.CD000213.pub3\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].label == \"Wardlaw 2014\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert inst.statistic[0].attributeEstimate[0].description == \"95% CI 0.54 to 0.80\"\n    assert float(inst.statistic[0].attributeEstimate[0].level) == float(0.95)\n    assert float(inst.statistic[0].attributeEstimate[0].range.high.value) == float(0.8)\n    assert float(inst.statistic[0].attributeEstimate[0].range.low.value) == float(0.54)\n    assert inst.statistic[0].attributeEstimate[0].type.coding[0].code == \"C53324\"\n    assert (\n        inst.statistic[0].attributeEstimate[0].type.coding[0].display\n        == \"Confidence interval\"\n    )\n    assert (\n        inst.statistic[0].attributeEstimate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/attribute-estimate-type\"\n            }\n        ).valueUri\n    )\n    assert inst.statistic[0].attributeEstimate[1].description == \"P-value = 0.000023\"\n    assert float(inst.statistic[0].attributeEstimate[1].quantity.value) == float(\n        2.3e-05\n    )\n    assert inst.statistic[0].attributeEstimate[1].type.coding[0].code == \"C44185\"\n    assert inst.statistic[0].attributeEstimate[1].type.coding[0].display == \"P-value\"\n    assert (\n        inst.statistic[0].attributeEstimate[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/attribute-estimate-type\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.statistic[0].attributeEstimate[2].description\n        == \"Heterogeneity I-sq = 0.0%\"\n    )\n    assert inst.statistic[0].attributeEstimate[2].quantity.code == \"%\"\n    assert (\n        inst.statistic[0].attributeEstimate[2].quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.statistic[0].attributeEstimate[2].quantity.unit == \"%\"\n    assert float(inst.statistic[0].attributeEstimate[2].quantity.value) == float(0)\n    assert inst.statistic[0].attributeEstimate[2].type.coding[0].code == \"0000420\"\n    assert inst.statistic[0].attributeEstimate[2].type.coding[0].display == \"I-squared\"\n    assert (\n        inst.statistic[0].attributeEstimate[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/attribute-estimate-type\"\n            }\n        ).valueUri\n    )\n    assert inst.statistic[0].numberOfEvents == 1137\n    assert float(inst.statistic[0].quantity.value) == float(0.65)\n    assert inst.statistic[0].sampleSize.numberOfParticipants == 1779\n    assert inst.statistic[0].sampleSize.numberOfStudies == 6\n    assert inst.statistic[0].statisticType.coding[0].code == \"C16932\"\n    assert inst.statistic[0].statisticType.coding[0].display == \"Odds Ratio\"\n    assert (\n        inst.statistic[0].statisticType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/statistic-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.studyDesign[0].coding[0].code == \"SEVCO:01003\"\n    assert inst.studyDesign[0].coding[0].display == \"randomized assignment\"\n    assert (\n        inst.studyDesign[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/study-design\"}\n        ).valueUri\n    )\n    assert inst.synthesisType.coding[0].code == \"std-MA\"\n    assert inst.synthesisType.coding[0].display == \"summary data meta-analysis\"\n    assert (\n        inst.synthesisType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/synthesis-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == (\n        \"Effect of Alteplase vs No alteplase on mRS 3-6 at 90 days in\"\n        \" Stroke 0-3 hours prior\"\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/Evidence/example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6\"\n            }\n        ).valueUri\n    )\n    assert inst.variableDefinition[0].intended.display == \"stroke at 0-3 hours\"\n    assert (\n        inst.variableDefinition[0].intended.reference\n        == \"Group/AcuteIschemicStroke0-3Hours\"\n    )\n    assert (\n        inst.variableDefinition[0].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.variableDefinition[0].observed.display\n        == \"Wardlaw 2014 Analysis 1.16.3 Evidence set\"\n    )\n    assert (\n        inst.variableDefinition[0].observed.reference\n        == \"EvidenceVariable/Wardlaw2014Analysis1.16.3EvidenceSet\"\n    )\n    assert (\n        inst.variableDefinition[0].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[0].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[0].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[0].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].intended.display\n        == \"Dead or functionally dependent at 90 days\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.reference\n        == \"EvidenceVariable/example-dead-or-dependent-90day\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[1].observed.display == \"mRS 3-6 at 90 days\"\n    assert (\n        inst.variableDefinition[1].observed.reference\n        == \"EvidenceVariable/example-mRS3-6-at-90days\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[1].variableRole.coding[0].code == \"measuredVariable\"\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].display == \"measured variable\"\n    )\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].intended.display == \"Alteplase for Stroke\"\n    assert (\n        inst.variableDefinition[2].intended.reference\n        == \"EvidenceVariable/example-alteplase-for-stroke\"\n    )\n    assert (\n        inst.variableDefinition[2].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].observed.display == \"Alteplase for Stroke\"\n    assert (\n        inst.variableDefinition[2].observed.reference\n        == \"EvidenceVariable/example-alteplase-for-stroke\"\n    )\n    assert (\n        inst.variableDefinition[2].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].variableRole.coding[0].code == \"exposure\"\n    assert inst.variableDefinition[2].variableRole.coding[0].display == \"exposure\"\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[3].intended.display == \"no alteplase\"\n    assert (\n        inst.variableDefinition[3].intended.reference\n        == \"EvidenceVariable/example-no-alteplase\"\n    )\n    assert (\n        inst.variableDefinition[3].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[3].observed.display == \"no alteplase\"\n    assert (\n        inst.variableDefinition[3].observed.reference\n        == \"EvidenceVariable/example-no-alteplase\"\n    )\n    assert (\n        inst.variableDefinition[3].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[3].variableRole.coding[0].code == \"referenceExposure\"\n    assert (\n        inst.variableDefinition[3].variableRole.coding[0].display\n        == \"reference exposure\"\n    )\n    assert (\n        inst.variableDefinition[3].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n\n\ndef test_evidence_3(base_settings):\n    \"\"\"No. 3 tests collection for Evidence.\n    Test File: evidence-example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidence-example-stroke-0-3-alteplase-vs-no-alteplase-mRS3-6.json\"\n    )\n    inst = evidence.Evidence.model_validate_json(filename.read_bytes())\n    assert \"Evidence\" == inst.get_resource_type()\n\n    impl_evidence_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Evidence\" == data[\"resourceType\"]\n\n    inst2 = evidence.Evidence(**data)\n    impl_evidence_3(inst2)\n\n\ndef impl_evidence_4(inst):\n    assert inst.description == (\n        \"2.7% incidence of fatal intracranial hemorrhage within 7 \"\n        \"days with alteplase in patients with acute ischemic stroke\"\n    )\n    assert inst.id == \"example-stroke-alteplase-fatalICH\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.10.1\"\n    assert inst.name == \"RiskOfFatalICHWithAlteplaseForStroke\"\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1016/S0140-6736(14)60584-5\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].label == \"Emberson 2014\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert inst.statistic[0].numberOfEvents == 91\n    assert float(inst.statistic[0].quantity.value) == float(0.026835741669)\n    assert inst.statistic[0].sampleSize.numberOfParticipants == 3391\n    assert inst.statistic[0].sampleSize.numberOfStudies == 9\n    assert inst.statistic[0].statisticType.coding[0].code == \"C44256\"\n    assert inst.statistic[0].statisticType.coding[0].display == \"Proportion\"\n    assert (\n        inst.statistic[0].statisticType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/statistic-type\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.studyDesign[0].coding[0].code == \"SEVCO:01003\"\n    assert inst.studyDesign[0].coding[0].display == \"randomized assignment\"\n    assert (\n        inst.studyDesign[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/study-design\"}\n        ).valueUri\n    )\n    assert inst.synthesisType.coding[0].code == \"IPD-MA\"\n    assert (\n        inst.synthesisType.coding[0].display == \"individual patient data meta-analysis\"\n    )\n    assert (\n        inst.synthesisType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/synthesis-type\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Risk of fatal ICH with alteplase for stroke\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/Evidence/example-stroke-alteplase-fatalICH\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[0].intended.display\n        == \"adults with acute ischemic stroke\"\n    )\n    assert inst.variableDefinition[0].intended.reference == \"Group/AcuteIschemicStroke\"\n    assert (\n        inst.variableDefinition[0].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.variableDefinition[0].observed.display\n        == \"adults with acute ischemic stroke\"\n    )\n    assert inst.variableDefinition[0].observed.reference == \"Group/AcuteIschemicStroke\"\n    assert (\n        inst.variableDefinition[0].observed.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.variableDefinition[0].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[0].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[0].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].intended.display\n        == \"adults with acute ischemic stroke treated with alteplase\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.reference\n        == \"Group/AcuteIschemicStrokeTreatedWithAlteplase\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].observed.display\n        == \"Emberson 2014 IPD-MA Alteplase Cohort\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.reference\n        == \"Group/Emberson-2014-IPD-MA-Alteplase-Cohort\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.variableDefinition[1].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[1].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].intended.display == \"fatal ICH\"\n    assert (\n        inst.variableDefinition[2].intended.reference\n        == \"EvidenceVariable/example-fatal-ICH-in-7-days\"\n    )\n    assert (\n        inst.variableDefinition[2].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].observed.display == \"fatal ICH\"\n    assert (\n        inst.variableDefinition[2].observed.reference\n        == \"EvidenceVariable/example-fatal-ICH-in-7-days\"\n    )\n    assert (\n        inst.variableDefinition[2].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].variableRole.coding[0].code == \"measuredVariable\"\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].display == \"measured variable\"\n    )\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n\n\ndef test_evidence_4(base_settings):\n    \"\"\"No. 4 tests collection for Evidence.\n    Test File: evidence-example-stroke-alteplase-fatalICH.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidence-example-stroke-alteplase-fatalICH.json\"\n    )\n    inst = evidence.Evidence.model_validate_json(filename.read_bytes())\n    assert \"Evidence\" == inst.get_resource_type()\n\n    impl_evidence_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Evidence\" == data[\"resourceType\"]\n\n    inst2 = evidence.Evidence(**data)\n    impl_evidence_4(inst2)\n\n\ndef impl_evidence_5(inst):\n    assert inst.certainty[0].rating.coding[0].code == \"high\"\n    assert inst.certainty[0].rating.coding[0].display == \"High quality\"\n    assert (\n        inst.certainty[0].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[0].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[0].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[0].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[0].type.coding[0].code == \"RiskOfBias\"\n    assert inst.certainty[0].subcomponent[0].type.coding[0].display == \"Risk of bias\"\n    assert (\n        inst.certainty[0].subcomponent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[1].description == (\n        \"Estimated risk from validation calibration plot consistent \"\n        \"with predicted risk; observed risk in subgroup with ASTRAL \"\n        \"score = 12 consistent with validation calibration plot\"\n    )\n    assert inst.certainty[0].subcomponent[1].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[1].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[1].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[1].type.coding[0].code == \"Inconsistency\"\n    assert inst.certainty[0].subcomponent[1].type.coding[0].display == \"Inconsistency\"\n    assert (\n        inst.certainty[0].subcomponent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[2].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[2].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[2].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[2].type.coding[0].code == \"Indirectness\"\n    assert inst.certainty[0].subcomponent[2].type.coding[0].display == \"Indirectness\"\n    assert (\n        inst.certainty[0].subcomponent[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[3].description == \"Narrow confidence interval\"\n    assert inst.certainty[0].subcomponent[3].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[3].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[3].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[3].type.coding[0].code == \"Imprecision\"\n    assert inst.certainty[0].subcomponent[3].type.coding[0].display == \"Imprecision\"\n    assert (\n        inst.certainty[0].subcomponent[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[4].rating.coding[0].code == \"no-concern\"\n    assert (\n        inst.certainty[0].subcomponent[4].rating.coding[0].display\n        == \"no serious concern\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[4].rating.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-rating\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].subcomponent[4].type.coding[0].code == \"PublicationBias\"\n    assert (\n        inst.certainty[0].subcomponent[4].type.coding[0].display == \"Publication bias\"\n    )\n    assert (\n        inst.certainty[0].subcomponent[4].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.certainty[0].type.coding[0].code == \"Overall\"\n    assert inst.certainty[0].type.coding[0].display == \"Overall quality\"\n    assert (\n        inst.certainty[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/certainty-type\"}\n        ).valueUri\n    )\n    assert inst.description == \"5.3% risk of mRS 3-6 at 90 days\"\n    assert inst.id == \"example-ASTRAL-12-alteplase-mRS3-6\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.10.2\"\n    assert inst.name == \"RiskOfMRS36At90DaysAfterAlteplaseForStrokeIfASTRALScore12\"\n    assert inst.relatedArtifact[0].display == (\n        \"External Validation of the ASTRAL and DRAGON Scores for \"\n        \"Prediction of Functional Outcome in Stroke.\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1161/STROKEAHA.116.012802\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].label == \"Cooray 2016 Validation Study\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert inst.statistic[0].description == \"5.3% risk\"\n    assert float(inst.statistic[0].quantity.value) == float(0.0525)\n    assert inst.statistic[0].sampleSize.numberOfParticipants == 36131\n    assert inst.statistic[0].statisticType.coding[0].code == \"C44256\"\n    assert inst.statistic[0].statisticType.coding[0].display == \"Proportion\"\n    assert (\n        inst.statistic[0].statisticType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/statistic-type\"}\n        ).valueUri\n    )\n    assert inst.statistic[0].statisticType.text == \"derived proportion\"\n    assert inst.status == \"draft\"\n    assert inst.studyDesign[0].coding[0].code == \"SEVCO:01016\"\n    assert inst.studyDesign[0].coding[0].display == \"Uncontrolled cohort design\"\n    assert (\n        inst.studyDesign[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/study-design\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == (\n        \"Risk of mRS3-6 at 90 days after Alteplase for Stroke if \" \"ASTRAL score 12\"\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/Evidence/example-ASTRAL-12-alteplase-mRS3-6\"\n            }\n        ).valueUri\n    )\n    assert inst.variableDefinition[0].intended.display == (\n        \"patients 0-4.5 hours after acute ischemic stroke onset with \"\n        \"ASTRAL score = 12\"\n    )\n    assert inst.variableDefinition[0].intended.reference == \"Group/ASTRAL-12\"\n    assert (\n        inst.variableDefinition[0].intended.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.variableDefinition[0].observed.display == \"ASTRAL validation cohort\"\n    assert (\n        inst.variableDefinition[0].observed.reference\n        == \"Group/ASTRAL-Cooray-validation-cohort\"\n    )\n    assert (\n        inst.variableDefinition[0].observed.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.variableDefinition[0].variableRole.coding[0].code == \"population\"\n    assert inst.variableDefinition[0].variableRole.coding[0].display == \"population\"\n    assert (\n        inst.variableDefinition[0].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].description\n        == \"functionally dependent or dead at 3 months\"\n    )\n    assert inst.variableDefinition[1].directnessMatch.coding[0].code == \"high\"\n    assert (\n        inst.variableDefinition[1].directnessMatch.coding[0].display\n        == \"High quality match\"\n    )\n    assert (\n        inst.variableDefinition[1].directnessMatch.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/directness\"}\n        ).valueUri\n    )\n    assert (\n        inst.variableDefinition[1].intended.display\n        == \"Dead or functionally dependent at 90 days\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.reference\n        == \"EvidenceVariable/example-dead-or-dependent-90day\"\n    )\n    assert (\n        inst.variableDefinition[1].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[1].observed.display == \"mRS 3-6 at 90 days\"\n    assert (\n        inst.variableDefinition[1].observed.reference\n        == \"EvidenceVariable/example-mRS3-6-at-90days\"\n    )\n    assert (\n        inst.variableDefinition[1].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[1].variableRole.coding[0].code == \"measuredVariable\"\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].display == \"measured variable\"\n    )\n    assert (\n        inst.variableDefinition[1].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].directnessMatch.coding[0].code == \"exact\"\n    assert inst.variableDefinition[2].directnessMatch.coding[0].display == \"Exact match\"\n    assert (\n        inst.variableDefinition[2].directnessMatch.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/directness\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].intended.display == \"Alteplase for Stroke\"\n    assert (\n        inst.variableDefinition[2].intended.reference\n        == \"EvidenceVariable/example-alteplase-for-stroke\"\n    )\n    assert (\n        inst.variableDefinition[2].intended.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].observed.display == \"Alteplase for Stroke\"\n    assert (\n        inst.variableDefinition[2].observed.reference\n        == \"EvidenceVariable/example-alteplase-for-stroke\"\n    )\n    assert (\n        inst.variableDefinition[2].observed.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.variableDefinition[2].variableRole.coding[0].code == \"exposure\"\n    assert inst.variableDefinition[2].variableRole.coding[0].display == \"exposure\"\n    assert (\n        inst.variableDefinition[2].variableRole.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variable-role\"}\n        ).valueUri\n    )\n\n\ndef test_evidence_5(base_settings):\n    \"\"\"No. 5 tests collection for Evidence.\n    Test File: evidence-example-ASTRAL-12-alteplase-mRS3-6.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidence-example-ASTRAL-12-alteplase-mRS3-6.json\"\n    )\n    inst = evidence.Evidence.model_validate_json(filename.read_bytes())\n    assert \"Evidence\" == inst.get_resource_type()\n\n    impl_evidence_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Evidence\" == data[\"resourceType\"]\n\n    inst2 = evidence.Evidence(**data)\n    impl_evidence_5(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_evidencereport.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EvidenceReport\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import evidencereport\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_evidencereport_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.subject.note[0].text == \"This is just an example.\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_evidencereport_1(base_settings):\n    \"\"\"No. 1 tests collection for EvidenceReport.\n    Test File: evidencereport-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"evidencereport-example.json\"\n    inst = evidencereport.EvidenceReport.model_validate_json(filename.read_bytes())\n    assert \"EvidenceReport\" == inst.get_resource_type()\n\n    impl_evidencereport_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceReport\" == data[\"resourceType\"]\n\n    inst2 = evidencereport.EvidenceReport(**data)\n    impl_evidencereport_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_evidencevariable.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/EvidenceVariable\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import evidencevariable\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_evidencevariable_1(inst):\n    assert inst.actual is True\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].code == \"182886004\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].display\n        == \"Placebo given (situation)\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].description == \"placebo\"\n    assert inst.description == \"placebo\"\n    assert inst.id == \"example-placebo\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Placebo\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"placebo\"\n\n\ndef test_evidencevariable_1(base_settings):\n    \"\"\"No. 1 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-placebo.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"evidencevariable-example-placebo.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_1(inst2)\n\n\ndef impl_evidencevariable_2(inst):\n    assert inst.actual is True\n    assert inst.characteristic[0].definitionExpression.description == \"mRS 0-2\"\n    assert inst.characteristic[0].definitionExpression.expression == (\n        '[\"Observation\": code in \"75859-9|LOINC\"] mRS where '\n        \"mRS.value between 0 and 2\"\n    )\n    assert inst.characteristic[0].definitionExpression.language == \"text/cql\"\n    assert inst.characteristic[0].description == \"mRS 0-2 at 90 days\"\n    assert (\n        inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].code\n        == \"study-start\"\n    )\n    assert (\n        inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].display\n        == \"Study Start\"\n    )\n    assert (\n        inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/evidence-variable-event\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromEvent[0].quantity.code == \"d\"\n    assert (\n        inst.characteristic[0].timeFromEvent[0].quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromEvent[0].quantity.unit == \"day\"\n    assert float(inst.characteristic[0].timeFromEvent[0].quantity.value) == float(90)\n    assert (\n        inst.description == \"Modified Rankin Scale score 0-2 at 90 days after treatment\"\n    )\n    assert inst.handling == \"dichotomous\"\n    assert inst.id == \"example-mRS0-2-at-90days\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"ModifiedRankinScaleScore02At90DaysAfterTreatment\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Modified Rankin Scale score 0-2 at 90 days after treatment\"\n\n\ndef test_evidencevariable_2(base_settings):\n    \"\"\"No. 2 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-mRS0-2-at-90days.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-mRS0-2-at-90days.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_2(inst2)\n\n\ndef impl_evidencevariable_3(inst):\n    assert inst.actual is True\n    assert inst.characteristic[0].definitionCanonical == (\n        \"http://example.org/fhir/ActivityDefinition/example-\" \"alteplase-dosing\"\n    )\n    assert inst.characteristic[0].description == (\n        \"IV alteplase 0.9 mg/kg (maximum 90 mg) as 10% of dose over 1\"\n        \" minute and 90% over 1 hour\"\n    )\n    assert inst.description == \"Alteplase for Stroke\"\n    assert inst.id == \"example-alteplase-for-stroke\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"AlteplaseForStroke\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Alteplase for Stroke\"\n\n\ndef test_evidencevariable_3(base_settings):\n    \"\"\"No. 3 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-alteplase-for-stroke.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-alteplase-for-stroke.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_3(inst2)\n\n\ndef impl_evidencevariable_4(inst):\n    assert inst.actual is False\n    assert inst.characteristic[0].definitionCodeableConcept.coding[0].code == \"8410\"\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].display\n        == \"alteplase\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].description == \"no alteplase\"\n    assert inst.characteristic[0].exclude is True\n    assert inst.description == \"no alteplase\"\n    assert inst.id == \"example-no-alteplase\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"NoAlteplase\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"no alteplase\"\n\n\ndef test_evidencevariable_4(base_settings):\n    \"\"\"No. 4 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-no-alteplase.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-no-alteplase.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_4(inst2)\n\n\ndef impl_evidencevariable_5(inst):\n    assert inst.actual is False\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .definitionCodeableConcept.coding[0]\n        .code\n        == \"718705001\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .definitionCodeableConcept.coding[0]\n        .display\n        == \"Functionally dependent (finding)\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .definitionCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[0].definitionByCombination.characteristic[0].description\n        == \"functionally dependent at 90 days\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .timeFromEvent[0]\n        .eventCodeableConcept.coding[0]\n        .code\n        == \"study-start\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .timeFromEvent[0]\n        .eventCodeableConcept.coding[0]\n        .display\n        == \"Study Start\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .timeFromEvent[0]\n        .eventCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/evidence-variable-event\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .timeFromEvent[0]\n        .quantity.code\n        == \"d\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .timeFromEvent[0]\n        .quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .timeFromEvent[0]\n        .quantity.unit\n        == \"day\"\n    )\n    assert float(\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .timeFromEvent[0]\n        .quantity.value\n    ) == float(90)\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[1]\n        .definitionCodeableConcept.coding[0]\n        .code\n        == \"419099009\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[1]\n        .definitionCodeableConcept.coding[0]\n        .display\n        == \"Dead (finding)\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[1]\n        .definitionCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[0].definitionByCombination.characteristic[1].description\n        == \"dead at 90 days\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[1]\n        .timeFromEvent[0]\n        .quantity.code\n        == \"d\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[1]\n        .timeFromEvent[0]\n        .quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[1]\n        .timeFromEvent[0]\n        .quantity.unit\n        == \"day\"\n    )\n    assert float(\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[1]\n        .timeFromEvent[0]\n        .quantity.value\n    ) == float(90)\n    assert inst.characteristic[0].definitionByCombination.code == \"any-of\"\n    assert (\n        inst.characteristic[0].description\n        == \"Dead or functionally dependent at 90 days\"\n    )\n    assert inst.description == \"Dead or functionally dependent at 90 days\"\n    assert inst.handling == \"dichotomous\"\n    assert inst.id == \"example-dead-or-dependent-90day\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"DeadOrFunctionallyDependentAt90Days\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Dead or functionally dependent at 90 days\"\n\n\ndef test_evidencevariable_5(base_settings):\n    \"\"\"No. 5 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-dead-or-dependent-90day.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-dead-or-dependent-90day.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_5(inst2)\n\n\ndef impl_evidencevariable_6(inst):\n    assert inst.actual is True\n    assert inst.author[0].name == \"Brian S. Alper\"\n    assert (\n        inst.characteristic[0].definitionByTypeAndValue.type.coding[0].code\n        == \"424144002\"\n    )\n    assert (\n        inst.characteristic[0].definitionByTypeAndValue.type.coding[0].display\n        == \"Current chronological age\"\n    )\n    assert (\n        inst.characteristic[0].definitionByTypeAndValue.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].definitionByTypeAndValue.valueQuantity.code == \"a\"\n    assert (\n        inst.characteristic[0].definitionByTypeAndValue.valueQuantity.comparator == \">=\"\n    )\n    assert (\n        inst.characteristic[0].definitionByTypeAndValue.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].definitionByTypeAndValue.valueQuantity.unit == \"year\"\n    assert float(\n        inst.characteristic[0].definitionByTypeAndValue.valueQuantity.value\n    ) == float(18)\n    assert inst.characteristic[0].description == \"adult (age ≥18 years old)\"\n    assert inst.characteristic[0].exclude is False\n    assert (\n        inst.characteristic[1].definitionByTypeAndValue.type.coding[0].code == \"39156-5\"\n    )\n    assert (\n        inst.characteristic[1].definitionByTypeAndValue.type.coding[0].display\n        == \"Body mass index (BMI) [Ratio]\"\n    )\n    assert (\n        inst.characteristic[1].definitionByTypeAndValue.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].definitionByTypeAndValue.valueQuantity.code == \"kg/m2\"\n    assert (\n        inst.characteristic[1].definitionByTypeAndValue.valueQuantity.comparator == \">=\"\n    )\n    assert (\n        inst.characteristic[1].definitionByTypeAndValue.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].definitionByTypeAndValue.valueQuantity.unit == \"kg/m2\"\n    assert float(\n        inst.characteristic[1].definitionByTypeAndValue.valueQuantity.value\n    ) == float(30)\n    assert inst.characteristic[1].description == \"obese (Body mass index >= 30 kg/m2)\"\n    assert inst.characteristic[1].exclude is False\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].value == \"support@computablepublishing.com\"\n    assert inst.copyright == \"https://creativecommons.org/licenses/by-nc-sa/4.0/\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-07-24T21:00:00.088Z\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"obese, adult (age ≥18 years old) patients\"\n    assert inst.id == \"example-eligibility-criteria-adults-with-obesity\"\n    assert inst.identifier[0].assigner.display == \"Computable Publishing LLC\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"FEvIR Object Identifier\"\n    assert inst.identifier[0].value == \"49218\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"StudyEligibilityCriteriaObesePatients18YearsOld\"\n    assert inst.publisher == \"Computable Publishing LLC\"\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://academic.oup.com/eurheartj/article/43/20/1955/6542137\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].label == \"data source\"\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert (\n        inst.relatedArtifact[1].classifier[0].text\n        == \"Citation Resource for the original article\"\n    )\n    assert inst.relatedArtifact[1].display == (\n        \"Citation Resource for 2022 Systematic Review of bariatric \"\n        \"surgery mortality effect - PMID 35243488\"\n    )\n    assert inst.relatedArtifact[1].resourceReference.display == (\n        \"StudyCitation: 2022 Systematic Review of bariatric surgery \"\n        \"mortality effect 35243488\"\n    )\n    assert inst.relatedArtifact[1].resourceReference.reference == \"Citation/33400\"\n    assert (\n        inst.relatedArtifact[1].resourceReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Citation\"}).valueUri\n    )\n    assert inst.relatedArtifact[1].type == \"supported-with\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"StudyEligibilityCriteria: Obese patients ≥ 18 years old\"\n\n\ndef test_evidencevariable_6(base_settings):\n    \"\"\"No. 6 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-eligibility-criteria-adults-with-obesity.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-eligibility-criteria-adults-with-obesity.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_6(inst2)\n\n\ndef impl_evidencevariable_7(inst):\n    assert inst.actual is True\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .definitionReference.display\n        == \"ECASS III Trial Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .definitionReference.reference\n        == \"Group/ECASSIII-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[0]\n        .definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[1]\n        .definitionReference.display\n        == \"IST3 Trial Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[1]\n        .definitionReference.reference\n        == \"Group/IST3-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[1]\n        .definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[2]\n        .definitionReference.display\n        == \"ECASS Trial Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[2]\n        .definitionReference.reference\n        == \"Group/ECASS-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[2]\n        .definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[3]\n        .definitionReference.display\n        == \"ECASSII Trial Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[3]\n        .definitionReference.reference\n        == \"Group/ECASSII-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[3]\n        .definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[4]\n        .definitionReference.display\n        == \"EPITHET Trial Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[4]\n        .definitionReference.reference\n        == \"Group/EPITHET-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[4]\n        .definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[5]\n        .definitionReference.display\n        == \"ATLANTIS Trial Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[5]\n        .definitionReference.reference\n        == \"Group/ATLANTIS-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[5]\n        .definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[6]\n        .definitionReference.display\n        == \"NINDS Trial Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[6]\n        .definitionReference.reference\n        == \"Group/NINDS-Trial-Cohort\"\n    )\n    assert (\n        inst.characteristic[0]\n        .definitionByCombination.characteristic[6]\n        .definitionReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Group\"}).valueUri\n    )\n    assert inst.characteristic[0].definitionByCombination.code == \"any-of\"\n    assert inst.characteristic[0].description == (\n        \"Stroke Thrombolysis Trialists’ Collaborators Group \"\n        \"collection used for individual patient data meta-analysis\"\n    )\n    assert inst.description == (\n        \"Stroke Thrombolysis Trialists’ Collaborators Group \"\n        \"collection used for individual patient data meta-analysis\"\n    )\n    assert inst.id == (\n        \"example-Stroke-Thrombolysis-Trialists-2014-2016-IPD-MA-\" \"Cohort\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"StrokeThrombolysisTrialists20142016IPDMACohort\"\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1016/S0140-6736(14)60584-5\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].label == \"Emberson 2014\"\n    assert inst.relatedArtifact[0].type == \"citation\"\n    assert inst.relatedArtifact[1].display == \"Figure 2 Lees 2016\"\n    assert (\n        inst.relatedArtifact[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://doi.org/10.1161/STROKEAHA.116.013644\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].label == \"Lees 2016\"\n    assert inst.relatedArtifact[1].type == \"citation\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == (\n        \"Stroke Thrombolysis Trialists’ Collaborators Group \"\n        \"collection used for individual patient data meta-analysis\"\n    )\n\n\ndef test_evidencevariable_7(base_settings):\n    \"\"\"No. 7 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-Stroke-Thrombolysis-Trialists-2014-2016-IPD-MA-Cohort.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-Stroke-Thrombolysis-Trialists-2014-2016-IPD-MA-Cohort.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_7(inst2)\n\n\ndef impl_evidencevariable_8(inst):\n    assert inst.actual is True\n    assert inst.characteristic[0].definitionCodeableConcept.coding[0].code == \"1386000\"\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].display\n        == \"Intracranial hemorrhage (disorder)\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].description == \"intracranial hemorrhage within 7 days\"\n    assert inst.characteristic[0].timeFromEvent[0].description == \"within 7 days\"\n    assert (\n        inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].code\n        == \"study-start\"\n    )\n    assert (\n        inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].display\n        == \"Study Start\"\n    )\n    assert (\n        inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/evidence-variable-event\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromEvent[0].range.high.code == \"d\"\n    assert (\n        inst.characteristic[0].timeFromEvent[0].range.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromEvent[0].range.high.unit == \"day\"\n    assert float(inst.characteristic[0].timeFromEvent[0].range.high.value) == float(7)\n    assert inst.characteristic[0].timeFromEvent[0].range.low.code == \"d\"\n    assert (\n        inst.characteristic[0].timeFromEvent[0].range.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromEvent[0].range.low.unit == \"day\"\n    assert float(inst.characteristic[0].timeFromEvent[0].range.low.value) == float(0)\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].code == \"419620001\"\n    )\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].display\n        == \"Death (event)\"\n    )\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].description == \"death within 7 days\"\n    assert inst.characteristic[1].timeFromEvent[0].description == \"within 7 days\"\n    assert inst.characteristic[1].timeFromEvent[0].range.high.code == \"d\"\n    assert (\n        inst.characteristic[1].timeFromEvent[0].range.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].timeFromEvent[0].range.high.unit == \"day\"\n    assert float(inst.characteristic[1].timeFromEvent[0].range.high.value) == float(7)\n    assert inst.characteristic[1].timeFromEvent[0].range.low.code == \"d\"\n    assert (\n        inst.characteristic[1].timeFromEvent[0].range.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].timeFromEvent[0].range.low.unit == \"day\"\n    assert float(inst.characteristic[1].timeFromEvent[0].range.low.value) == float(0)\n    assert inst.description == \"Fatal Intracranial Hemorrhage Within Seven Days\"\n    assert inst.handling == \"dichotomous\"\n    assert inst.id == \"example-fatal-ICH-in-7-days\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"FatalIntracranialHemorrhageWithinSevenDays\"\n    assert inst.note[0].text == \"Death must be due to intracranial hemorrhage\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Fatal Intracranial Hemorrhage Within Seven Days\"\n\n\ndef test_evidencevariable_8(base_settings):\n    \"\"\"No. 8 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-fatal-ICH-in-7-days.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-fatal-ICH-in-7-days.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_8(inst2)\n\n\ndef impl_evidencevariable_9(inst):\n    assert inst.actual is False\n    assert inst.author[0].name == \"Brian S. Alper\"\n    assert (\n        inst.characteristic[0].definitionByTypeAndValue.type.coding[0].code\n        == \"397669002\"\n    )\n    assert (\n        inst.characteristic[0].definitionByTypeAndValue.type.coding[0].display == \"Age\"\n    )\n    assert (\n        inst.characteristic[0].definitionByTypeAndValue.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].definitionByTypeAndValue.valueQuantity.code == \"a\"\n    assert (\n        inst.characteristic[0].definitionByTypeAndValue.valueQuantity.comparator == \">=\"\n    )\n    assert (\n        inst.characteristic[0].definitionByTypeAndValue.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].definitionByTypeAndValue.valueQuantity.unit == \"years\"\n    assert float(\n        inst.characteristic[0].definitionByTypeAndValue.valueQuantity.value\n    ) == float(18)\n    assert inst.characteristic[0].description == \"Adult.\"\n    assert inst.characteristic[0].exclude is False\n    assert (\n        inst.characteristic[1].definitionByTypeAndValue.type.coding[0].code\n        == \"64572001\"\n    )\n    assert (\n        inst.characteristic[1].definitionByTypeAndValue.type.coding[0].display\n        == \"Disease (disorder)\"\n    )\n    assert (\n        inst.characteristic[1].definitionByTypeAndValue.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[1].definitionByTypeAndValue.type.coding[1].code\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[1].definitionByTypeAndValue.type.coding[1].display\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[1].definitionByTypeAndValue.type.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .code\n        == \"44054006\"\n    )\n    assert (\n        inst.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .display\n        == \"Diabetes mellitus type 2 (disorder)\"\n    )\n    assert (\n        inst.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].description == \"Diagnosed with type 2 diabetes.\"\n    assert inst.characteristic[1].exclude is False\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .code\n        == \"39156-5\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .display\n        == \"Body mass index (BMI) [Ratio]\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueQuantity.code\n        == \"kg/m2\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueQuantity.comparator\n        == \">=\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueQuantity.unit\n        == \"kg/m2\"\n    )\n    assert float(\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueQuantity.value\n    ) == float(40)\n    assert (\n        inst.characteristic[2].definitionByCombination.characteristic[0].description\n        == \"Body Mass Index (BMI) ≥ 40.0 kg/m2\"\n    )\n    assert (\n        inst.characteristic[2].definitionByCombination.characteristic[0].exclude\n        is False\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .code\n        == \"39156-5\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .display\n        == \"Body mass index (BMI) [Ratio]\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueQuantity.code\n        == \"kg/m2\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueQuantity.comparator\n        == \">=\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueQuantity.unit\n        == \"kg/m2\"\n    )\n    assert float(\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueQuantity.value\n    ) == float(37.5)\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[0]\n        .description\n        == \"BMI ≥ 37.5 kg/m2\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[0]\n        .exclude\n        is False\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[0]\n        .code\n        == \"103579009\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[0]\n        .display\n        == \"Race (observable entity)\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .code\n        == \"2028-9\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .display\n        == \"Asian\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.6.238\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.text\n        == \"Asian American\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[1]\n        .description\n        == \"Asian American\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.characteristic[1]\n        .linkId\n        == \"AsianAmerican\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .definitionByCombination.code\n        == \"all-of\"\n    )\n    assert (\n        inst.characteristic[2].definitionByCombination.characteristic[1].description\n        == \"BMI ≥ 37.5 kg/m2 in Asian Americans\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .code\n        == \"39156-5\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .display\n        == \"Body mass index (BMI) [Ratio]\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.high.code\n        == \"kg/m2\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.high.unit\n        == \"kg/m2\"\n    )\n    assert float(\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.high.value\n    ) == float(39.9)\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.low.code\n        == \"kg/m2\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.low.unit\n        == \"kg/m2\"\n    )\n    assert float(\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.low.value\n    ) == float(35)\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[0]\n        .description\n        == \"BMI ≥ 35.0 kg/m2 and ≤ 39.9 kg/m2\"\n    )\n    assert inst.characteristic[2].definitionByCombination.characteristic[\n        2\n    ].definitionByCombination.characteristic[1].definitionCodeableConcept.text == (\n        \"achieving durable weight loss and improvement in \"\n        \"comorbidities (including hyperglycemia) with nonsurgical \"\n        \"methods\"\n    )\n    assert inst.characteristic[2].definitionByCombination.characteristic[\n        2\n    ].definitionByCombination.characteristic[1].description == (\n        \"who do not achieve durable weight loss and improvement in \"\n        \"comorbidities (including hyperglycemia) with nonsurgical \"\n        \"methods.\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.characteristic[1]\n        .exclude\n        is True\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[2]\n        .definitionByCombination.code\n        == \"all-of\"\n    )\n    assert inst.characteristic[2].definitionByCombination.characteristic[\n        2\n    ].description == (\n        \"BMI ≥ 35.0 kg/m2 and ≤ 39.9 kg/m2 who do not achieve durable\"\n        \" weight loss and improvement in comorbidities (including \"\n        \"hyperglycemia) with nonsurgical methods.\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .code\n        == \"39156-5\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .display\n        == \"Body mass index (BMI) [Ratio]\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.high.code\n        == \"kg/m2\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.high.unit\n        == \"kg/m2\"\n    )\n    assert float(\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.high.value\n    ) == float(37.4)\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.low.code\n        == \"kg/m2\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.low.unit\n        == \"kg/m2\"\n    )\n    assert float(\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueRange.low.value\n    ) == float(32.5)\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .description\n        == \"BMI ≥ 32.5 kg/m2 and ≤ 37.4 kg/m2\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[1]\n        .definitionId\n        == \"AsianAmerican\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[1]\n        .description\n        == \"Asian American\"\n    )\n    assert inst.characteristic[2].definitionByCombination.characteristic[\n        3\n    ].definitionByCombination.characteristic[2].definitionCodeableConcept.text == (\n        \"achieving durable weight loss and improvement in \"\n        \"comorbidities (including hyperglycemia) with nonsurgical \"\n        \"methods\"\n    )\n    assert inst.characteristic[2].definitionByCombination.characteristic[\n        3\n    ].definitionByCombination.characteristic[2].description == (\n        \"who do not achieve durable weight loss and improvement in \"\n        \"comorbidities (including hyperglycemia) with nonsurgical \"\n        \"methods.\"\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.characteristic[2]\n        .exclude\n        is True\n    )\n    assert (\n        inst.characteristic[2]\n        .definitionByCombination.characteristic[3]\n        .definitionByCombination.code\n        == \"all-of\"\n    )\n    assert inst.characteristic[2].definitionByCombination.characteristic[\n        3\n    ].description == (\n        \"BMI ≥ 32.5 kg/m2 and ≤ 37.4 kg/m2 in Asian Americans who do \"\n        \"not achieve durable weight loss and improvement in \"\n        \"comorbidities (including hyperglycemia) with nonsurgical \"\n        \"methods.\"\n    )\n    assert inst.characteristic[2].definitionByCombination.code == \"any-of\"\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .code\n        == \"64572001\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .display\n        == \"Disease (disorder)\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[1]\n        .code\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[1]\n        .display\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[1]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueReference.display\n        == \"Acute Coronary Heart Disease Value Set\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueReference.reference\n        == \"ValueSet/32152\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueReference.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"ValueSet\"}).valueUri\n    )\n    assert inst.characteristic[3].definitionByCombination.characteristic[\n        0\n    ].description == (\n        \"acute coronary heart disease (a value set covering many \" \"forms)\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[0]\n        .code\n        == \"71388002\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[0]\n        .display\n        == \"Procedure (procedure)\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[1]\n        .code\n        == \"Procedure\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[1]\n        .display\n        == \"Procedure\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[1]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .code\n        == \"81266008\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .display\n        == \"Heart revascularization (procedure)\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[3].definitionByCombination.characteristic[1].description\n        == \"coronary artery angioplasty or bypass\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.type.coding[0]\n        .code\n        == \"64572001\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.type.coding[0]\n        .display\n        == \"Disease (disorder)\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.type.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.type.coding[1]\n        .code\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.type.coding[1]\n        .display\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.type.coding[1]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .code\n        == \"230690007\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .display\n        == \"Cerebrovascular accident (disorder)\"\n    )\n    assert (\n        inst.characteristic[3]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[3].definitionByCombination.characteristic[2].description\n        == \"stroke\"\n    )\n    assert inst.characteristic[3].definitionByCombination.code == \"any-of\"\n    assert inst.characteristic[3].description == (\n        \"Cardiovascular event (myocardial infarction, acute coronary \"\n        \"syndrome, coronary artery angioplasty or bypass, stroke) in \"\n        \"the past six months.\"\n    )\n    assert inst.characteristic[3].exclude is True\n    assert inst.characteristic[3].note[0].text == (\n        \"placeholder for now to represent 'screened surgical \" \"candidate'\"\n    )\n    assert (\n        inst.characteristic[3].timeFromEvent[0].description == \"in the past six months\"\n    )\n    assert inst.characteristic[3].timeFromEvent[0].note[0].text == (\n        \"occurrence within the range is equivalent to 'in the past \" \"six months'\"\n    )\n    assert inst.characteristic[3].timeFromEvent[0].range.high.code == \"mo\"\n    assert (\n        inst.characteristic[3].timeFromEvent[0].range.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[3].timeFromEvent[0].range.high.unit == \"months\"\n    assert float(inst.characteristic[3].timeFromEvent[0].range.high.value) == float(0)\n    assert inst.characteristic[3].timeFromEvent[0].range.low.code == \"mo\"\n    assert (\n        inst.characteristic[3].timeFromEvent[0].range.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[3].timeFromEvent[0].range.low.unit == \"months\"\n    assert float(inst.characteristic[3].timeFromEvent[0].range.low.value) == float(-6)\n    assert inst.characteristic[4].definitionCodeableConcept.text == (\n        \"Current evidence of congestive heart failure, angina \"\n        \"pectoris, or symptomatic peripheral vascular disease.\"\n    )\n    assert inst.characteristic[4].description == (\n        \"Current evidence of congestive heart failure, angina \"\n        \"pectoris, or symptomatic peripheral vascular disease.\"\n    )\n    assert inst.characteristic[4].exclude is True\n    assert inst.characteristic[4].note[0].text == (\n        \"This may be possible to encode as presence of \"\n        \"Disease(disorder) without 'in remission'\"\n    )\n    assert inst.characteristic[4].note[1].text == (\n        \"placeholder for now to represent 'screened surgical \" \"candidate'\"\n    )\n    assert inst.characteristic[5].definitionCodeableConcept.text == (\n        \"Cardiac stress test indicating that surgery or IMM would not\" \" be safe.\"\n    )\n    assert inst.characteristic[5].description == (\n        \"Cardiac stress test indicating that surgery or IMM would not\" \" be safe.\"\n    )\n    assert inst.characteristic[5].exclude is True\n    assert inst.characteristic[5].note[0].text == (\n        \"placeholder for now to represent 'screened surgical \" \"candidate'\"\n    )\n    assert (\n        inst.characteristic[6].definitionByTypeAndValue.type.coding[0].code\n        == \"64572001\"\n    )\n    assert (\n        inst.characteristic[6].definitionByTypeAndValue.type.coding[0].display\n        == \"Disease (disorder)\"\n    )\n    assert (\n        inst.characteristic[6].definitionByTypeAndValue.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[6].definitionByTypeAndValue.type.coding[1].code\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[6].definitionByTypeAndValue.type.coding[1].display\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[6].definitionByTypeAndValue.type.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[6]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .code\n        == \"59282003\"\n    )\n    assert (\n        inst.characteristic[6]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .display\n        == \"Pulmonary embolism (disorder)\"\n    )\n    assert (\n        inst.characteristic[6]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[6].description\n        == \"Pulmonary embolus in the past six months.\"\n    )\n    assert inst.characteristic[6].exclude is True\n    assert inst.characteristic[6].note[0].text == (\n        \"placeholder for now to represent 'screened surgical \" \"candidate'\"\n    )\n    assert (\n        inst.characteristic[6].timeFromEvent[0].description == \"in the past six months\"\n    )\n    assert inst.characteristic[6].timeFromEvent[0].note[0].text == (\n        \"occurrence within the range is equivalent to 'in the past \" \"six months'\"\n    )\n    assert inst.characteristic[6].timeFromEvent[0].range.high.code == \"mo\"\n    assert (\n        inst.characteristic[6].timeFromEvent[0].range.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[6].timeFromEvent[0].range.high.unit == \"months\"\n    assert float(inst.characteristic[6].timeFromEvent[0].range.high.value) == float(0)\n    assert inst.characteristic[6].timeFromEvent[0].range.low.code == \"mo\"\n    assert (\n        inst.characteristic[6].timeFromEvent[0].range.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[6].timeFromEvent[0].range.low.unit == \"months\"\n    assert float(inst.characteristic[6].timeFromEvent[0].range.low.value) == float(-6)\n    assert (\n        inst.characteristic[7].definitionByTypeAndValue.type.coding[0].code\n        == \"64572001\"\n    )\n    assert (\n        inst.characteristic[7].definitionByTypeAndValue.type.coding[0].display\n        == \"Disease (disorder)\"\n    )\n    assert (\n        inst.characteristic[7].definitionByTypeAndValue.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[7].definitionByTypeAndValue.type.coding[1].code\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[7].definitionByTypeAndValue.type.coding[1].display\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[7].definitionByTypeAndValue.type.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[7]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .code\n        == \"64156001\"\n    )\n    assert (\n        inst.characteristic[7]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .display\n        == \"Thrombophlebitis (disorder)\"\n    )\n    assert (\n        inst.characteristic[7]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[7].description == \"Thrombophlebitis in the past six months.\"\n    )\n    assert inst.characteristic[7].exclude is True\n    assert inst.characteristic[7].note[0].text == (\n        \"placeholder for now to represent 'screened surgical \" \"candidate'\"\n    )\n    assert (\n        inst.characteristic[7].timeFromEvent[0].description == \"in the past six months\"\n    )\n    assert inst.characteristic[7].timeFromEvent[0].note[0].text == (\n        \"occurrence within the range is equivalent to 'in the past \" \"six months'\"\n    )\n    assert inst.characteristic[7].timeFromEvent[0].range.high.code == \"mo\"\n    assert (\n        inst.characteristic[7].timeFromEvent[0].range.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[7].timeFromEvent[0].range.high.unit == \"months\"\n    assert float(inst.characteristic[7].timeFromEvent[0].range.high.value) == float(0)\n    assert inst.characteristic[7].timeFromEvent[0].range.low.code == \"mo\"\n    assert (\n        inst.characteristic[7].timeFromEvent[0].range.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[7].timeFromEvent[0].range.low.unit == \"months\"\n    assert float(inst.characteristic[7].timeFromEvent[0].range.low.value) == float(-6)\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .code\n        == \"64572001\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .display\n        == \"Disease (disorder)\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[1]\n        .code\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[1]\n        .display\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.type.coding[1]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .code\n        == \"363346000\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .display\n        == \"Malignant neoplastic disease (disorder)\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[0]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[8].definitionByCombination.characteristic[0].description\n        == \"Cancer of any kind\"\n    )\n    assert (\n        inst.characteristic[8].definitionByCombination.characteristic[0].exclude\n        is False\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[0]\n        .code\n        == \"64572001\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[0]\n        .display\n        == \"Disease (disorder)\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[1]\n        .code\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[1]\n        .display\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.type.coding[1]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .code\n        == \"254701007\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .display\n        == \"Basal cell carcinoma of skin (disorder)\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[1]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[8].definitionByCombination.characteristic[1].description\n        == \"(except basal cell skin cancer)\"\n    )\n    assert (\n        inst.characteristic[8].definitionByCombination.characteristic[1].exclude is True\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.type.coding[0]\n        .code\n        == \"64572001\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.type.coding[0]\n        .display\n        == \"Disease (disorder)\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.type.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.type.coding[1]\n        .code\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.type.coding[1]\n        .display\n        == \"Condition\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.type.coding[1]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/resource-types\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .code\n        == \"109355002\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .display\n        == \"Carcinoma in situ (disorder)\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[2]\n        .definitionByTypeAndValue.valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[8].definitionByCombination.characteristic[2].description\n        == \"(except cancer in situ)\"\n    )\n    assert (\n        inst.characteristic[8].definitionByCombination.characteristic[2].exclude is True\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[3]\n        .definitionCodeableConcept.coding[0]\n        .code\n        == \"395100000\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[3]\n        .definitionCodeableConcept.coding[0]\n        .display\n        == \"No evidence of cancer found (situation)\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[3]\n        .definitionCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[8].definitionByCombination.characteristic[3].description\n        == \"unless documented to be disease-free for five years\"\n    )\n    assert (\n        inst.characteristic[8].definitionByCombination.characteristic[3].exclude is True\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[3]\n        .timeFromEvent[0]\n        .description\n        == \"for five years\"\n    )\n    assert inst.characteristic[8].definitionByCombination.characteristic[\n        3\n    ].timeFromEvent[0].note[0].text == (\n        \"presence throughout the range is equivalent to 'for five \" \"years'\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[3]\n        .timeFromEvent[0]\n        .range.high.code\n        == \"a\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[3]\n        .timeFromEvent[0]\n        .range.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[3]\n        .timeFromEvent[0]\n        .range.high.unit\n        == \"years\"\n    )\n    assert float(\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[3]\n        .timeFromEvent[0]\n        .range.high.value\n    ) == float(0)\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[3]\n        .timeFromEvent[0]\n        .range.low.code\n        == \"a\"\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[3]\n        .timeFromEvent[0]\n        .range.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[3]\n        .timeFromEvent[0]\n        .range.low.unit\n        == \"years\"\n    )\n    assert float(\n        inst.characteristic[8]\n        .definitionByCombination.characteristic[3]\n        .timeFromEvent[0]\n        .range.low.value\n    ) == float(-5)\n    assert inst.characteristic[8].definitionByCombination.code == \"all-of\"\n    assert inst.characteristic[8].description == (\n        \"Cancer of any kind (except basal cell skin cancer or cancer \"\n        \"in situ) unless documented to be disease-free for five \"\n        \"years.\"\n    )\n    assert inst.characteristic[8].exclude is True\n    assert inst.characteristic[8].note[0].text == (\n        \"This combination logic fails if the patient has both a basal\"\n        \" cell skin cancer or cancer in situ and a cancer of another \"\n        \"kind.\"\n    )\n    assert inst.characteristic[8].note[1].text == (\n        \"placeholder for now to represent 'screened surgical \" \"candidate'\"\n    )\n    assert (\n        inst.characteristic[9].definitionCodeableConcept.text\n        == \"history of coagulopathy\"\n    )\n    assert inst.characteristic[9].description == \"History of coagulopathy\"\n    assert inst.characteristic[9].exclude is True\n    assert inst.characteristic[9].note[0].text == (\n        \"placeholder for now to represent 'screened surgical \" \"candidate'\"\n    )\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].value == \"support@computablepublishing.com\"\n    assert inst.copyright == \"https://creativecommons.org/licenses/by-nc-sa/4.0/\"\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-eligibility-criteria-ada-rec-bariatric\"\n    assert inst.identifier[0].assigner.display == \"Computable Publishing LLC\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"FEvIR Object Identifier\"\n    assert inst.identifier[0].value == \"32140\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == (\n        \"RecommendationEligibilityCriteriaEligibilityCriteriaForBaria\"\n        \"tricSurgeryADARecommendation816\"\n    )\n    assert inst.publisher == \"Computable Publishing LLC\"\n    assert inst.shortTitle == \"Recommend bariatric surgery if BMI 35 or higher\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == (\n        \"RecommendationEligibilityCriteria: Eligibility Criteria for \"\n        \"Bariatric Surgery (ADA Recommendation 8.16)\"\n    )\n\n\ndef test_evidencevariable_9(base_settings):\n    \"\"\"No. 9 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-eligibility-criteria-ada-rec-bariatric.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-eligibility-criteria-ada-rec-bariatric.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_9(inst2)\n\n\ndef impl_evidencevariable_10(inst):\n    assert inst.actual is False\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].code == \"718705001\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].display\n        == \"Functionally dependent (finding)\"\n    )\n    assert (\n        inst.characteristic[0].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].description == \"not functionally dependent at 90 days\"\n    assert inst.characteristic[0].exclude is True\n    assert (\n        inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].code\n        == \"study-start\"\n    )\n    assert (\n        inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].display\n        == \"Study Start\"\n    )\n    assert (\n        inst.characteristic[0].timeFromEvent[0].eventCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/evidence-variable-event\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromEvent[0].quantity.code == \"d\"\n    assert (\n        inst.characteristic[0].timeFromEvent[0].quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].timeFromEvent[0].quantity.unit == \"day\"\n    assert float(inst.characteristic[0].timeFromEvent[0].quantity.value) == float(90)\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].code == \"419099009\"\n    )\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].display\n        == \"Dead (finding)\"\n    )\n    assert (\n        inst.characteristic[1].definitionCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].description == \"alive at 90 days\"\n    assert inst.characteristic[1].exclude is True\n    assert (\n        inst.characteristic[1].timeFromEvent[0].eventCodeableConcept.coding[0].code\n        == \"study-start\"\n    )\n    assert (\n        inst.characteristic[1].timeFromEvent[0].eventCodeableConcept.coding[0].display\n        == \"Study Start\"\n    )\n    assert (\n        inst.characteristic[1].timeFromEvent[0].eventCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/evidence-variable-event\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].timeFromEvent[0].quantity.code == \"d\"\n    assert (\n        inst.characteristic[1].timeFromEvent[0].quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[1].timeFromEvent[0].quantity.unit == \"day\"\n    assert float(inst.characteristic[1].timeFromEvent[0].quantity.value) == float(90)\n    assert inst.description == \"Alive and not functionally dependent at 90 days\"\n    assert inst.handling == \"dichotomous\"\n    assert inst.id == \"example-alive-independent-90day\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"AliveAndNotFunctionallyDependentAt90Days\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Alive and not functionally dependent at 90 days\"\n\n\ndef test_evidencevariable_10(base_settings):\n    \"\"\"No. 10 tests collection for EvidenceVariable.\n    Test File: evidencevariable-example-alive-independent-90day.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"evidencevariable-example-alive-independent-90day.json\"\n    )\n    inst = evidencevariable.EvidenceVariable.model_validate_json(filename.read_bytes())\n    assert \"EvidenceVariable\" == inst.get_resource_type()\n\n    impl_evidencevariable_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"EvidenceVariable\" == data[\"resourceType\"]\n\n    inst2 = evidencevariable.EvidenceVariable(**data)\n    impl_evidencevariable_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_examplescenario.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ExampleScenario\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import examplescenario\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_examplescenario_1(inst):\n    assert inst.actor[0].description == \"The Nurse\"\n    assert inst.actor[0].key == \"Nurse\"\n    assert inst.actor[0].title == \"Nurse\"\n    assert inst.actor[0].type == \"person\"\n    assert inst.actor[1].description == (\n        \"The entity that receives the Administration Requests to show\"\n        \" the nurse to perform them\"\n    )\n    assert inst.actor[1].key == \"MAP\"\n    assert inst.actor[1].title == \"Nurse's Tablet\"\n    assert inst.actor[1].type == \"system\"\n    assert inst.actor[2].description == \"The Medication Administration Order Placer\"\n    assert inst.actor[2].key == \"OP\"\n    assert inst.actor[2].title == \"MAR / Scheduler\"\n    assert inst.actor[2].type == \"system\"\n    assert inst.actor[3].description == (\n        \"The entity that receives the Medication Administration \" \"reports\"\n    )\n    assert inst.actor[3].key == \"MAC\"\n    assert inst.actor[3].title == \"MAR / EHR\"\n    assert inst.actor[3].type == \"system\"\n    assert inst.id == \"example\"\n    assert inst.instance[0].description == (\n        'The initial prescription which describes \"medication X, 3 '\n        'times per day\" - the exact scheduling is not   in the '\n        \"initial prescription (it is left for the care teams to \"\n        \"decide on the schedule).\"\n    )\n    assert inst.instance[0].key == \"iherx001\"\n    assert inst.instance[0].structureType.code == \"MedicationRequest\"\n    assert (\n        inst.instance[0].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[0].title == \"Initial Prescription\"\n    assert (\n        inst.instance[1].description == \"The administration request for day 1, morning\"\n    )\n    assert inst.instance[1].key == \"iherx001.001\"\n    assert inst.instance[1].structureType.code == \"MedicationRequest\"\n    assert (\n        inst.instance[1].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[1].title == \"Request for day 1, morning\"\n    assert inst.instance[2].description == \"The administration request for day 1, lunch\"\n    assert inst.instance[2].key == \"iherx001.002\"\n    assert inst.instance[2].structureType.code == \"MedicationRequest\"\n    assert (\n        inst.instance[2].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[2].title == \"Request for day 1, lunch\"\n    assert (\n        inst.instance[3].description == \"The administration request for day 1, evening\"\n    )\n    assert inst.instance[3].key == \"iherx001.003\"\n    assert inst.instance[3].structureType.code == \"MedicationRequest\"\n    assert (\n        inst.instance[3].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[3].title == \"Request for day 1, evening\"\n    assert (\n        inst.instance[4].description == \"The administration request for day 2, morning\"\n    )\n    assert inst.instance[4].key == \"iherx001.004\"\n    assert inst.instance[4].structureType.code == \"MedicationRequest\"\n    assert (\n        inst.instance[4].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[4].title == \"Request for day 2, morning\"\n    assert inst.instance[5].description == \"The administration request for day 2, lunch\"\n    assert inst.instance[5].key == \"iherx001.005\"\n    assert inst.instance[5].structureType.code == \"MedicationRequest\"\n    assert (\n        inst.instance[5].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[5].title == \"Request for day 2, lunch\"\n    assert (\n        inst.instance[6].description == \"The administration request for day 2, evening\"\n    )\n    assert inst.instance[6].key == \"iherx001.006\"\n    assert inst.instance[6].structureType.code == \"MedicationRequest\"\n    assert (\n        inst.instance[6].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[6].title == \"Request for day 2, evening\"\n    assert (\n        inst.instance[7].description\n        == \"Administration report for day 1, morning: Taken\"\n    )\n    assert inst.instance[7].key == \"iheadm001a\"\n    assert inst.instance[7].structureType.code == \"MedicationAdministration\"\n    assert (\n        inst.instance[7].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[7].title == \"Morning meds - taken\"\n    assert (\n        inst.instance[8].description\n        == \"Administration report for day 1, morning: NOT Taken\"\n    )\n    assert inst.instance[8].key == \"iheadm001b\"\n    assert inst.instance[8].structureType.code == \"MedicationAdministration\"\n    assert (\n        inst.instance[8].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[8].title == \"Morning meds - not taken\"\n    assert inst.instance[9].containedInstance[0].instanceReference == \"iherx001.001\"\n    assert inst.instance[9].containedInstance[1].instanceReference == \"iherx001.002\"\n    assert inst.instance[9].containedInstance[2].instanceReference == \"iherx001.003\"\n    assert inst.instance[9].containedInstance[3].instanceReference == \"iherx001.004\"\n    assert inst.instance[9].containedInstance[4].instanceReference == \"iherx001.005\"\n    assert inst.instance[9].containedInstance[5].instanceReference == \"iherx001.006\"\n    assert inst.instance[9].description == \"All the medication Requests for Day 1\"\n    assert inst.instance[9].key == \"iherx001bundle\"\n    assert inst.instance[9].structureType.code == \"MedicationRequest\"\n    assert (\n        inst.instance[9].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[9].title == \"Bundle of Medication Requests\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.process[0].postConditions == (\n        \"Medication administration Reports are submitted, EHR is \" \"updated.\"\n    )\n    assert inst.process[0].preConditions == (\n        \"Medication administration requests are in the EHR / MAR, \"\n        \"scheduled for each individual intake.\"\n    )\n    assert inst.process[0].step[0].number == \"1\"\n    assert inst.process[0].step[0].operation.initiator == \"Nurse\"\n    assert inst.process[0].step[0].operation.receiver == \"MAP\"\n    assert inst.process[0].step[0].operation.title == \"Get today's schedule\"\n    assert inst.process[0].step[1].number == \"2\"\n    assert inst.process[0].step[1].operation.description == (\n        \"Query for medication administration orders,\\\\n- For today's \"\n        \"shifts\\\\n- For today's patients\"\n    )\n    assert inst.process[0].step[1].operation.initiator == \"MAP\"\n    assert inst.process[0].step[1].operation.receiver == \"OP\"\n    assert inst.process[0].step[1].operation.request.instanceReference == \"iherxqry\"\n    assert (\n        inst.process[0].step[1].operation.response.instanceReference == \"iherx001bundle\"\n    )\n    assert inst.process[0].step[1].operation.title == \"Query administration orders\"\n    assert inst.process[0].step[1].pause is True\n    assert inst.process[0].step[2].number == \"3\"\n    assert inst.process[0].step[2].operation.initiator == \"MAP\"\n    assert inst.process[0].step[2].operation.receiver == \"Nurse\"\n    assert inst.process[0].step[2].operation.title == \"Notify (alert)\"\n    assert inst.process[0].step[3].number == \"4\"\n    assert inst.process[0].step[3].operation.initiator == \"Nurse\"\n    assert inst.process[0].step[3].operation.receiver == \"MAP\"\n    assert inst.process[0].step[3].operation.title == \"Read orders\"\n    assert inst.process[0].step[3].pause is True\n    assert inst.process[0].step[4].number == \"5\"\n    assert inst.process[0].step[4].operation.initiator == \"Nurse\"\n    assert inst.process[0].step[4].operation.receiver == \"Nurse\"\n    assert inst.process[0].step[4].operation.title == \"Ask if patient took meds\"\n    assert (\n        inst.process[0].step[5].alternative[0].description\n        == \"Invoke if patient took medications\"\n    )\n    assert inst.process[0].step[5].alternative[0].step[0].number == \"6a\"\n    assert inst.process[0].step[5].alternative[0].step[0].operation.initiator == \"Nurse\"\n    assert (\n        inst.process[0].step[5].alternative[0].step[0].operation.initiatorActive is True\n    )\n    assert inst.process[0].step[5].alternative[0].step[0].operation.receiver == \"MAP\"\n    assert (\n        inst.process[0].step[5].alternative[0].step[0].operation.title\n        == \"Register meds taken\"\n    )\n    assert inst.process[0].step[5].alternative[0].title == \"Patient took meds\"\n    assert (\n        inst.process[0].step[5].alternative[1].description\n        == \"No, patient did not take meds\"\n    )\n    assert inst.process[0].step[5].alternative[1].step[0].number == \"6b\"\n    assert inst.process[0].step[5].alternative[1].step[0].operation.initiator == \"Nurse\"\n    assert (\n        inst.process[0].step[5].alternative[1].step[0].operation.initiatorActive is True\n    )\n    assert inst.process[0].step[5].alternative[1].step[0].operation.receiver == \"MAP\"\n    assert (\n        inst.process[0].step[5].alternative[1].step[0].operation.title\n        == \"Register meds NOT taken\"\n    )\n    assert inst.process[0].step[5].alternative[1].title == \"No drugs\"\n    assert (\n        inst.process[0].step[5].alternative[2].description\n        == \"Unknown whether patient took medications or not\"\n    )\n    assert inst.process[0].step[5].alternative[2].title == \"Not clear\"\n    assert inst.process[0].step[5].pause is True\n    assert inst.process[0].step[6].number == \"7\"\n    assert inst.process[0].step[6].operation.initiator == \"Nurse\"\n    assert inst.process[0].step[6].operation.receiver == \"Nurse\"\n    assert inst.process[0].step[6].operation.title == \"Administer drug\"\n    assert inst.process[0].step[7].number == \"8\"\n    assert inst.process[0].step[7].operation.initiator == \"Nurse\"\n    assert inst.process[0].step[7].operation.initiatorActive is True\n    assert inst.process[0].step[7].operation.receiver == \"MAP\"\n    assert inst.process[0].step[7].operation.title == \"Record administration\"\n    assert inst.process[0].step[7].pause is True\n    assert inst.process[0].step[8].number == \"9\"\n    assert inst.process[0].step[8].operation.initiator == \"Nurse\"\n    assert inst.process[0].step[8].operation.initiatorActive is True\n    assert inst.process[0].step[8].operation.receiver == \"MAP\"\n    assert inst.process[0].step[8].operation.request.instanceReference == \"iheadm002\"\n    assert inst.process[0].step[8].operation.request.versionReference == \"iheadm002v1\"\n    assert inst.process[0].step[8].operation.title == \"Upload administration reports\"\n    assert inst.process[0].step[8].pause is True\n    assert inst.process[0].step[9].number == \"10\"\n    assert inst.process[0].step[9].operation.description == (\n        \"The nurse's system uploads the administration results to the\" \" server\"\n    )\n    assert inst.process[0].step[9].operation.initiator == \"MAP\"\n    assert inst.process[0].step[9].operation.receiver == \"MAC\"\n    assert inst.process[0].step[9].operation.request.instanceReference == \"iheadm001a\"\n    assert inst.process[0].step[9].operation.title == \"Upload administration reports\"\n    assert inst.process[0].title == \"Mobile Medication Administration\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_examplescenario_1(base_settings):\n    \"\"\"No. 1 tests collection for ExampleScenario.\n    Test File: examplescenario-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"examplescenario-example.json\"\n    inst = examplescenario.ExampleScenario.model_validate_json(filename.read_bytes())\n    assert \"ExampleScenario\" == inst.get_resource_type()\n\n    impl_examplescenario_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ExampleScenario\" == data[\"resourceType\"]\n\n    inst2 = examplescenario.ExampleScenario(**data)\n    impl_examplescenario_1(inst2)\n\n\ndef impl_examplescenario_2(inst):\n    assert inst.actor[0].description == \"Clinician\"\n    assert inst.actor[0].key == \"Clin\"\n    assert inst.actor[0].title == \"Clinician\"\n    assert inst.actor[0].type == \"person\"\n    assert inst.actor[1].description == \"CPOE\"\n    assert inst.actor[1].key == \"CPOE\"\n    assert inst.actor[1].title == \"CPOE\"\n    assert inst.actor[1].type == \"system\"\n    assert inst.actor[2].description == \"EMR\"\n    assert inst.actor[2].key == \"EMR\"\n    assert inst.actor[2].title == \"EMR\"\n    assert inst.actor[2].type == \"system\"\n    assert inst.actor[3].description == \"Lab Person\"\n    assert inst.actor[3].key == \"LabMan\"\n    assert inst.actor[3].title == \"Lab Man\"\n    assert inst.actor[3].type == \"person\"\n    assert inst.actor[4].description == \"Lab\"\n    assert inst.actor[4].key == \"Lab\"\n    assert inst.actor[4].title == \"Lab\"\n    assert inst.actor[4].type == \"system\"\n    assert inst.description == (\n        \"In this example, the clinician creates an order in the CPOE.\"\n        \" Then a Task is created and updated by both the CPOE and the\"\n        \" Lab system...\"\n    )\n    assert inst.id == \"example-laborder\"\n    assert inst.instance[0].description == \"Bla\"\n    assert inst.instance[0].key == \"req1\"\n    assert inst.instance[0].structureType.code == \"ServiceRequest\"\n    assert (\n        inst.instance[0].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[0].title == \"Request for a lab procedure\"\n    assert inst.instance[0].version[0].description == \"Initial order\"\n    assert inst.instance[0].version[0].key == \"req1-v1\"\n    assert inst.instance[0].version[0].title == \"v1- initial\"\n    assert inst.instance[0].version[1].description == \"Order in progress\"\n    assert inst.instance[0].version[1].key == \"req1-v2\"\n    assert inst.instance[0].version[1].title == \"v2 - in progress\"\n    assert inst.instance[0].version[2].description == \"Order completed\"\n    assert inst.instance[0].version[2].key == \"req1-v3\"\n    assert inst.instance[0].version[2].title == \"v3 - completed\"\n    assert inst.instance[1].description == \"The task that handles the status updates...\"\n    assert inst.instance[1].key == \"task1\"\n    assert inst.instance[1].structureType.code == \"Task\"\n    assert (\n        inst.instance[1].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[1].title == \"Task\"\n    assert inst.instance[1].version[0].description == \"Initially created\"\n    assert inst.instance[1].version[0].key == \"task1-v1\"\n    assert inst.instance[1].version[0].title == \"v1 - created\"\n    assert inst.instance[1].version[1].description == \"Accepted\"\n    assert inst.instance[1].version[1].key == \"task1-v2\"\n    assert inst.instance[1].version[1].title == \"v2 - accepted\"\n    assert inst.instance[1].version[2].description == \"In progress\"\n    assert inst.instance[1].version[2].key == \"task1-v3\"\n    assert inst.instance[1].version[2].title == \"v3 - in progress\"\n    assert inst.instance[1].version[3].description == \"Completed\"\n    assert inst.instance[1].version[3].key == \"task1-v4\"\n    assert inst.instance[1].version[3].title == \"v4 - completed\"\n    assert inst.instance[2].description == \"Lab's internal request for the procedure\"\n    assert inst.instance[2].key == \"req.lab1\"\n    assert inst.instance[2].structureType.code == \"ServiceRequest\"\n    assert (\n        inst.instance[2].structureType.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.instance[2].title == \"Internal lab request\"\n    assert inst.instance[2].version[0].description == \"Order in progress\"\n    assert inst.instance[2].version[0].key == \"req.lab1-v1\"\n    assert inst.instance[2].version[0].title == \"v1 - created\"\n    assert inst.instance[2].version[1].description == \"Order in progress\"\n    assert inst.instance[2].version[1].key == \"req.lab1-v2\"\n    assert inst.instance[2].version[1].title == \"v2 - in progress\"\n    assert inst.instance[2].version[2].description == \"Order completed\"\n    assert inst.instance[2].version[2].key == \"req.lab1-v3\"\n    assert inst.instance[2].version[2].title == \"v3 - completed\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"LabOrderTrackingWithTask\"\n    assert inst.process[0].description == (\n        \"Lab order, status updates handled with Task between CPOE, \"\n        \"EMR and Lab systems\"\n    )\n    assert inst.process[0].step[0].number == \"1\"\n    assert inst.process[0].step[0].pause is True\n    assert inst.process[0].step[0].process.description == \"New lab order\"\n    assert inst.process[0].step[0].process.step[0].number == \"1.1\"\n    assert inst.process[0].step[0].process.step[0].operation.initiator == \"Clin\"\n    assert inst.process[0].step[0].process.step[0].operation.receiver == \"LabMan\"\n    assert inst.process[0].step[0].process.step[0].operation.title == \"Make a call\"\n    assert inst.process[0].step[0].process.step[1].number == \"1.2\"\n    assert inst.process[0].step[0].process.step[1].operation.initiator == \"Clin\"\n    assert inst.process[0].step[0].process.step[1].operation.receiver == \"CPOE\"\n    assert (\n        inst.process[0].step[0].process.step[1].operation.title\n        == \"Create new EMR order\"\n    )\n    assert inst.process[0].step[0].process.step[2].number == \"1.3\"\n    assert inst.process[0].step[0].process.step[2].operation.initiator == \"CPOE\"\n    assert inst.process[0].step[0].process.step[2].operation.receiver == \"EMR\"\n    assert (\n        inst.process[0].step[0].process.step[2].operation.request.instanceReference\n        == \"req1\"\n    )\n    assert (\n        inst.process[0].step[0].process.step[2].operation.request.versionReference\n        == \"req1-v1\"\n    )\n    assert (\n        inst.process[0].step[0].process.step[2].operation.title == \"Submit order to EMR\"\n    )\n    assert inst.process[0].step[0].process.step[3].number == \"1.3\"\n    assert inst.process[0].step[0].process.step[3].operation.initiator == \"EMR\"\n    assert inst.process[0].step[0].process.step[3].operation.receiver == \"EMR\"\n    assert (\n        inst.process[0].step[0].process.step[3].operation.request.instanceReference\n        == \"task1\"\n    )\n    assert (\n        inst.process[0].step[0].process.step[3].operation.request.versionReference\n        == \"task1-v1\"\n    )\n    assert inst.process[0].step[0].process.step[3].operation.title == \"Create new task \"\n    assert inst.process[0].step[0].process.step[4].number == \"1.4\"\n    assert inst.process[0].step[0].process.step[4].operation.initiator == \"EMR\"\n    assert inst.process[0].step[0].process.step[4].operation.receiver == \"Lab\"\n    assert (\n        inst.process[0].step[0].process.step[4].operation.request.instanceReference\n        == \"task1\"\n    )\n    assert (\n        inst.process[0].step[0].process.step[4].operation.request.versionReference\n        == \"task1-v1\"\n    )\n    assert inst.process[0].step[0].process.step[4].operation.title == \"Send task to Lab\"\n    assert inst.process[0].step[0].process.title == \"Create order\"\n    assert inst.process[0].step[1].number == \"2\"\n    assert (\n        inst.process[0].step[1].process.description\n        == \"New task for handling order tracking\"\n    )\n    assert inst.process[0].step[1].process.step[0].number == \"2.1\"\n    assert inst.process[0].step[1].process.step[0].operation.initiator == \"LabMan\"\n    assert inst.process[0].step[1].process.step[0].operation.receiver == \"Lab\"\n    assert inst.process[0].step[1].process.step[0].operation.title == \"Accept task\"\n    assert inst.process[0].step[1].process.step[1].number == \"2.2\"\n    assert inst.process[0].step[1].process.step[1].operation.initiator == \"Lab\"\n    assert inst.process[0].step[1].process.step[1].operation.receiver == \"Lab\"\n    assert (\n        inst.process[0].step[1].process.step[1].operation.request.instanceReference\n        == \"task1\"\n    )\n    assert (\n        inst.process[0].step[1].process.step[1].operation.request.versionReference\n        == \"task1-v2\"\n    )\n    assert (\n        inst.process[0].step[1].process.step[1].operation.title\n        == \"Task status = accepted\"\n    )\n    assert inst.process[0].step[1].process.step[2].number == \"2.3\"\n    assert inst.process[0].step[1].process.step[2].operation.initiator == \"Lab\"\n    assert inst.process[0].step[1].process.step[2].operation.receiver == \"Lab\"\n    assert (\n        inst.process[0].step[1].process.step[2].operation.request.instanceReference\n        == \"req.lab1\"\n    )\n    assert (\n        inst.process[0].step[1].process.step[2].operation.request.versionReference\n        == \"req.lab1-v1\"\n    )\n    assert (\n        inst.process[0].step[1].process.step[2].operation.title\n        == \"Create internal lab request\"\n    )\n    assert inst.process[0].step[1].process.step[3].number == \"2.4\"\n    assert inst.process[0].step[1].process.step[3].operation.initiator == \"Lab\"\n    assert inst.process[0].step[1].process.step[3].operation.receiver == \"EMR\"\n    assert (\n        inst.process[0].step[1].process.step[3].operation.request.instanceReference\n        == \"task1\"\n    )\n    assert (\n        inst.process[0].step[1].process.step[3].operation.request.versionReference\n        == \"task1-v2\"\n    )\n    assert inst.process[0].step[1].process.step[3].operation.title == \"Send Task to EMR\"\n    assert inst.process[0].step[1].process.step[4].number == \"2.5\"\n    assert inst.process[0].step[1].process.step[4].operation.initiator == \"EMR\"\n    assert inst.process[0].step[1].process.step[4].operation.receiver == \"CPOE\"\n    assert (\n        inst.process[0].step[1].process.step[4].operation.request.instanceReference\n        == \"task1\"\n    )\n    assert (\n        inst.process[0].step[1].process.step[4].operation.request.versionReference\n        == \"task1-v2\"\n    )\n    assert (\n        inst.process[0].step[1].process.step[4].operation.title\n        == \"Inform CPOE of Task status\"\n    )\n    assert inst.process[0].step[1].process.title == \"Accept order\"\n    assert inst.process[0].step[2].number == \"3\"\n    assert (\n        inst.process[0].step[2].process.description\n        == \"Procedure is initiated at the lab\"\n    )\n    assert inst.process[0].step[2].process.step[0].number == \"3.1\"\n    assert inst.process[0].step[2].process.step[0].operation.initiator == \"LabMan\"\n    assert inst.process[0].step[2].process.step[0].operation.receiver == \"Lab\"\n    assert inst.process[0].step[2].process.step[0].operation.title == \"Begin procedure\"\n    assert inst.process[0].step[2].process.step[1].number == \"3.2\"\n    assert inst.process[0].step[2].process.step[1].operation.initiator == \"Lab\"\n    assert inst.process[0].step[2].process.step[1].operation.receiver == \"Lab\"\n    assert (\n        inst.process[0].step[2].process.step[1].operation.request.instanceReference\n        == \"task1\"\n    )\n    assert (\n        inst.process[0].step[2].process.step[1].operation.request.versionReference\n        == \"task1-v3\"\n    )\n    assert (\n        inst.process[0].step[2].process.step[1].operation.title\n        == \"Task status: in-progress\"\n    )\n    assert inst.process[0].step[2].process.step[2].number == \"4.3\"\n    assert inst.process[0].step[2].process.step[2].operation.initiator == \"Lab\"\n    assert inst.process[0].step[2].process.step[2].operation.receiver == \"Lab\"\n    assert (\n        inst.process[0].step[2].process.step[2].operation.request.instanceReference\n        == \"req.lab1\"\n    )\n    assert (\n        inst.process[0].step[2].process.step[2].operation.request.versionReference\n        == \"req.lab1-v2\"\n    )\n    assert (\n        inst.process[0].step[2].process.step[2].operation.title\n        == \"Internal lab request: in-progress\"\n    )\n    assert inst.process[0].step[2].process.step[3].number == \"4.4\"\n    assert inst.process[0].step[2].process.step[3].operation.initiator == \"Lab\"\n    assert inst.process[0].step[2].process.step[3].operation.receiver == \"EMR\"\n    assert (\n        inst.process[0].step[2].process.step[3].operation.request.instanceReference\n        == \"task1\"\n    )\n    assert (\n        inst.process[0].step[2].process.step[3].operation.request.versionReference\n        == \"task1-v3\"\n    )\n    assert (\n        inst.process[0].step[2].process.step[3].operation.title\n        == \"Send updated Task to EMR\"\n    )\n    assert inst.process[0].step[2].process.step[4].number == \"4.5\"\n    assert inst.process[0].step[2].process.step[4].operation.initiator == \"EMR\"\n    assert inst.process[0].step[2].process.step[4].operation.receiver == \"CPOE\"\n    assert (\n        inst.process[0].step[2].process.step[4].operation.request.instanceReference\n        == \"task1\"\n    )\n    assert (\n        inst.process[0].step[2].process.step[4].operation.request.versionReference\n        == \"task1-v4\"\n    )\n    assert (\n        inst.process[0].step[2].process.step[4].operation.title\n        == \"Inform CPOE of Task status\"\n    )\n    assert inst.process[0].step[2].process.step[5].number == \"4.5\"\n    assert inst.process[0].step[2].process.step[5].operation.initiator == \"CPOE\"\n    assert inst.process[0].step[2].process.step[5].operation.receiver == \"CPOE\"\n    assert (\n        inst.process[0].step[2].process.step[5].operation.request.instanceReference\n        == \"req1\"\n    )\n    assert (\n        inst.process[0].step[2].process.step[5].operation.request.versionReference\n        == \"req1-v2\"\n    )\n    assert (\n        inst.process[0].step[2].process.step[5].operation.title\n        == \"Order status: in-progress\"\n    )\n    assert inst.process[0].step[2].process.title == \"Initiate procedure\"\n    assert inst.process[0].step[3].number == \"4\"\n    assert inst.process[0].step[3].process.description == \"Procedure is finished\"\n    assert inst.process[0].step[3].process.step[0].number == \"4.1\"\n    assert inst.process[0].step[3].process.step[0].operation.initiator == \"LabMan\"\n    assert inst.process[0].step[3].process.step[0].operation.receiver == \"Lab\"\n    assert inst.process[0].step[3].process.step[0].operation.title == \"Finish procedure\"\n    assert inst.process[0].step[3].process.step[1].number == \"4.2\"\n    assert inst.process[0].step[3].process.step[1].operation.initiator == \"Lab\"\n    assert inst.process[0].step[3].process.step[1].operation.receiver == \"Lab\"\n    assert (\n        inst.process[0].step[3].process.step[1].operation.request.instanceReference\n        == \"task1\"\n    )\n    assert (\n        inst.process[0].step[3].process.step[1].operation.request.versionReference\n        == \"task1-v2\"\n    )\n    assert (\n        inst.process[0].step[3].process.step[1].operation.title\n        == \"Task status = completed\"\n    )\n    assert inst.process[0].step[3].process.step[2].number == \"4.3\"\n    assert inst.process[0].step[3].process.step[2].operation.initiator == \"Lab\"\n    assert inst.process[0].step[3].process.step[2].operation.receiver == \"Lab\"\n    assert (\n        inst.process[0].step[3].process.step[2].operation.request.instanceReference\n        == \"req.lab1\"\n    )\n    assert (\n        inst.process[0].step[3].process.step[2].operation.request.versionReference\n        == \"req.lab1-v2\"\n    )\n    assert (\n        inst.process[0].step[3].process.step[2].operation.title\n        == \"Internal lab request: complete\"\n    )\n    assert inst.process[0].step[3].process.step[3].number == \"4.4\"\n    assert inst.process[0].step[3].process.step[3].operation.initiator == \"Lab\"\n    assert inst.process[0].step[3].process.step[3].operation.receiver == \"EMR\"\n    assert (\n        inst.process[0].step[3].process.step[3].operation.request.instanceReference\n        == \"task1\"\n    )\n    assert (\n        inst.process[0].step[3].process.step[3].operation.request.versionReference\n        == \"task1-v4\"\n    )\n    assert (\n        inst.process[0].step[3].process.step[3].operation.title\n        == \"Send updated Task to EMR\"\n    )\n    assert inst.process[0].step[3].process.step[4].number == \"4.5\"\n    assert inst.process[0].step[3].process.step[4].operation.initiator == \"EMR\"\n    assert inst.process[0].step[3].process.step[4].operation.receiver == \"CPOE\"\n    assert (\n        inst.process[0].step[3].process.step[4].operation.request.instanceReference\n        == \"task1\"\n    )\n    assert (\n        inst.process[0].step[3].process.step[4].operation.request.versionReference\n        == \"task1-v4\"\n    )\n    assert (\n        inst.process[0].step[3].process.step[4].operation.title\n        == \"Inform CPOE of Task status\"\n    )\n    assert inst.process[0].step[3].process.step[5].number == \"4.5\"\n    assert inst.process[0].step[3].process.step[5].operation.initiator == \"CPOE\"\n    assert inst.process[0].step[3].process.step[5].operation.receiver == \"CPOE\"\n    assert (\n        inst.process[0].step[3].process.step[5].operation.request.instanceReference\n        == \"req1\"\n    )\n    assert (\n        inst.process[0].step[3].process.step[5].operation.request.versionReference\n        == \"req1-v3\"\n    )\n    assert (\n        inst.process[0].step[3].process.step[5].operation.title\n        == \"Order status = completed\"\n    )\n    assert inst.process[0].step[3].process.title == \"Finish procedure\"\n    assert inst.process[0].title == \"Lab order tracking with Task\"\n    assert inst.purpose == (\n        \"Purpose: this serves to demonstrate a scenario that uses \"\n        \"service requests and Task resources to establish a handshake\"\n        \" for order tracking.\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"additional\"\n    assert inst.title == \"Lab order tracking with Task\"\n\n\ndef test_examplescenario_2(base_settings):\n    \"\"\"No. 2 tests collection for ExampleScenario.\n    Test File: examplescenario-example-laborder.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"examplescenario-example-laborder.json\"\n    )\n    inst = examplescenario.ExampleScenario.model_validate_json(filename.read_bytes())\n    assert \"ExampleScenario\" == inst.get_resource_type()\n\n    impl_examplescenario_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ExampleScenario\" == data[\"resourceType\"]\n\n    inst2 = examplescenario.ExampleScenario(**data)\n    impl_examplescenario_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_explanationofbenefit.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import explanationofbenefit\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_explanationofbenefit_1(inst):\n    assert inst.careTeam[0].provider.reference == \"Practitioner/example\"\n    assert inst.careTeam[0].sequence == 1\n    assert inst.claim.reference == \"Claim/100150\"\n    assert inst.claimResponse.reference == \"ClaimResponse/R3500\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Claim settled as per contract.\"\n    assert inst.enterer.reference == \"Practitioner/1\"\n    assert inst.facility.reference == \"Location/1\"\n    assert inst.id == \"EB3500\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/explanationofbenefit\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"987654321\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurer.reference == \"Organization/3\"\n    assert inst.item[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[0].amount.value) == float(120.0)\n    assert inst.item[0].adjudication[0].category.coding[0].code == \"eligible\"\n    assert inst.item[0].adjudication[1].category.coding[0].code == \"eligpercent\"\n    assert float(inst.item[0].adjudication[1].quantity.value) == float(0.8)\n    assert inst.item[0].adjudication[2].amount.currency == \"USD\"\n    assert float(inst.item[0].adjudication[2].amount.value) == float(96.0)\n    assert inst.item[0].adjudication[2].category.coding[0].code == \"benefit\"\n    assert inst.item[0].careTeamSequence[0] == 1\n    assert inst.item[0].encounter[0].reference == \"Encounter/example\"\n    assert inst.item[0].net.currency == \"USD\"\n    assert float(inst.item[0].net.value) == float(135.57)\n    assert inst.item[0].productOrService.coding[0].code == \"1205\"\n    assert (\n        inst.item[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-USCLS\"}\n        ).valueUri\n    )\n    assert inst.item[0].sequence == 1\n    assert (\n        inst.item[0].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.item[0].udi[0].reference == \"Device/example\"\n    assert inst.item[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[0].unitPrice.value) == float(135.57)\n    assert inst.item[1].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[1].adjudication[0].amount.value) == float(180.0)\n    assert inst.item[1].adjudication[0].category.coding[0].code == \"benefit\"\n    assert inst.item[1].careTeamSequence[0] == 1\n    assert inst.item[1].detail[0].adjudication[0].amount.currency == \"USD\"\n    assert float(inst.item[1].detail[0].adjudication[0].amount.value) == float(180.0)\n    assert inst.item[1].detail[0].adjudication[0].category.coding[0].code == \"benefit\"\n    assert inst.item[1].detail[0].net.currency == \"USD\"\n    assert float(inst.item[1].detail[0].net.value) == float(200.0)\n    assert inst.item[1].detail[0].productOrService.coding[0].code == \"group\"\n    assert inst.item[1].detail[0].sequence == 1\n    assert inst.item[1].detail[0].subDetail[0].adjudication[0].amount.currency == \"USD\"\n    assert float(\n        inst.item[1].detail[0].subDetail[0].adjudication[0].amount.value\n    ) == float(200.0)\n    assert (\n        inst.item[1].detail[0].subDetail[0].adjudication[0].category.coding[0].code\n        == \"eligible\"\n    )\n    assert (\n        inst.item[1].detail[0].subDetail[0].adjudication[1].category.coding[0].code\n        == \"eligpercent\"\n    )\n    assert float(\n        inst.item[1].detail[0].subDetail[0].adjudication[1].quantity.value\n    ) == float(0.9)\n    assert inst.item[1].detail[0].subDetail[0].adjudication[2].amount.currency == \"USD\"\n    assert float(\n        inst.item[1].detail[0].subDetail[0].adjudication[2].amount.value\n    ) == float(180.0)\n    assert (\n        inst.item[1].detail[0].subDetail[0].adjudication[2].category.coding[0].code\n        == \"benefit\"\n    )\n    assert inst.item[1].detail[0].subDetail[0].net.currency == \"USD\"\n    assert float(inst.item[1].detail[0].subDetail[0].net.value) == float(200.0)\n    assert inst.item[1].detail[0].subDetail[0].productOrService.coding[0].code == \"1205\"\n    assert (\n        inst.item[1].detail[0].subDetail[0].productOrService.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-USCLS\"}\n        ).valueUri\n    )\n    assert inst.item[1].detail[0].subDetail[0].sequence == 1\n    assert inst.item[1].detail[0].subDetail[0].udi[0].reference == \"Device/example\"\n    assert inst.item[1].detail[0].subDetail[0].unitPrice.currency == \"USD\"\n    assert float(inst.item[1].detail[0].subDetail[0].unitPrice.value) == float(200.0)\n    assert inst.item[1].detail[0].udi[0].reference == \"Device/example\"\n    assert inst.item[1].net.currency == \"USD\"\n    assert float(inst.item[1].net.value) == float(200.0)\n    assert inst.item[1].productOrService.coding[0].code == \"group\"\n    assert inst.item[1].sequence == 2\n    assert (\n        inst.item[1].servicedDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.payee.party.reference == \"Organization/2\"\n    assert inst.payee.type.coding[0].code == \"provider\"\n    assert (\n        inst.payee.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payeetype\"}\n        ).valueUri\n    )\n    assert inst.provider.reference == \"Practitioner/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the ExplanationOfBenefit</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total[0].amount.currency == \"USD\"\n    assert float(inst.total[0].amount.value) == float(135.57)\n    assert inst.total[0].category.coding[0].code == \"submitted\"\n    assert inst.total[1].amount.currency == \"USD\"\n    assert float(inst.total[1].amount.value) == float(96.0)\n    assert inst.total[1].category.coding[0].code == \"benefit\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_explanationofbenefit_1(base_settings):\n    \"\"\"No. 1 tests collection for ExplanationOfBenefit.\n    Test File: explanationofbenefit-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"explanationofbenefit-example.json\"\n    inst = explanationofbenefit.ExplanationOfBenefit.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ExplanationOfBenefit\" == inst.get_resource_type()\n\n    impl_explanationofbenefit_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ExplanationOfBenefit\" == data[\"resourceType\"]\n\n    inst2 = explanationofbenefit.ExplanationOfBenefit(**data)\n    impl_explanationofbenefit_1(inst2)\n\n\ndef impl_explanationofbenefit_2(inst):\n    assert (\n        inst.accident.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-02-14\"}).valueDate\n    )\n    assert inst.accident.locationReference.reference == \"Location/ph\"\n    assert inst.accident.type.coding[0].code == \"SPT\"\n    assert (\n        inst.accident.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.billablePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-03-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.billablePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-01\"}\n        ).valueDateTime\n    )\n    assert inst.claim.reference == \"Claim/100150\"\n    assert inst.claimResponse.reference == \"ClaimResponse/R3500\"\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.disposition == \"Could not process.\"\n    assert inst.enterer.reference == \"Practitioner/1\"\n    assert inst.facility.reference == \"Location/1\"\n    assert inst.formCode.coding[0].code == \"2\"\n    assert (\n        inst.formCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/forms-codes\"}\n        ).valueUri\n    )\n    assert inst.id == \"EB3501\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/explanationofbenefit\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"error-1\"\n    assert inst.insurance[0].coverage.reference == \"Coverage/9876B1\"\n    assert inst.insurance[0].focal is True\n    assert inst.insurer.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.originalPrescription.reference == \"MedicationRequest/medrx0301\"\n    assert inst.outcome == \"error\"\n    assert inst.patient.reference == \"Patient/pat1\"\n    assert inst.precedence == 2\n    assert inst.prescription.reference == \"MedicationRequest/medrx002\"\n    assert (\n        inst.procedure[0].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-14\"}\n        ).valueDateTime\n    )\n    assert inst.procedure[0].procedureCodeableConcept.coding[0].code == \"123001\"\n    assert (\n        inst.procedure[0].procedureCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ex-icd-10-procedures\"}\n        ).valueUri\n    )\n    assert inst.procedure[0].sequence == 1\n    assert inst.procedure[0].udi[0].reference == \"Device/example\"\n    assert inst.processNote[0].language.coding[0].code == \"en-CA\"\n    assert (\n        inst.processNote[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.processNote[0].number == 1\n    assert inst.processNote[0].text == \"Invalid claim\"\n    assert inst.processNote[0].type.coding[0].code == \"display\"\n    assert (\n        inst.processNote[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/note-type\"}\n        ).valueUri\n    )\n    assert inst.provider.reference == \"Organization/2\"\n    assert (\n        inst.related[0].reference.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/case-number\"}\n        ).valueUri\n    )\n    assert inst.related[0].reference.value == \"23-56Tu-XX-47-20150M14\"\n    assert inst.status == \"active\"\n    assert inst.subType.coding[0].code == \"emergency\"\n    assert (\n        inst.subType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-claimsubtype\"}\n        ).valueUri\n    )\n    assert inst.supportingInfo[0].category.coding[0].code == \"employmentimpacted\"\n    assert (\n        inst.supportingInfo[0].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/claiminformationcategory\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[0].sequence == 1\n    assert (\n        inst.supportingInfo[0].timingPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-28\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.supportingInfo[0].timingPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-14\"}\n        ).valueDateTime\n    )\n    assert inst.supportingInfo[1].category.coding[0].code == \"hospitalized\"\n    assert (\n        inst.supportingInfo[1].category.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/claiminformationcategory\"\n            }\n        ).valueUri\n    )\n    assert inst.supportingInfo[1].sequence == 2\n    assert (\n        inst.supportingInfo[1].timingPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-16\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.supportingInfo[1].timingPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-14\"}\n        ).valueDateTime\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.total[0].amount.currency == \"USD\"\n    assert float(inst.total[0].amount.value) == float(2478.57)\n    assert inst.total[0].category.coding[0].code == \"submitted\"\n    assert inst.total[1].amount.currency == \"USD\"\n    assert float(inst.total[1].amount.value) == float(0.0)\n    assert inst.total[1].category.coding[0].code == \"benefit\"\n    assert inst.type.coding[0].code == \"oral\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/claim-type\"}\n        ).valueUri\n    )\n    assert inst.use == \"claim\"\n\n\ndef test_explanationofbenefit_2(base_settings):\n    \"\"\"No. 2 tests collection for ExplanationOfBenefit.\n    Test File: explanationofbenefit-example-2.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"explanationofbenefit-example-2.json\"\n    )\n    inst = explanationofbenefit.ExplanationOfBenefit.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ExplanationOfBenefit\" == inst.get_resource_type()\n\n    impl_explanationofbenefit_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ExplanationOfBenefit\" == data[\"resourceType\"]\n\n    inst2 = explanationofbenefit.ExplanationOfBenefit(**data)\n    impl_explanationofbenefit_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_familymemberhistory.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import familymemberhistory\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_familymemberhistory_1(inst):\n    assert inst.condition[0].code.coding[0].code == \"315619001\"\n    assert inst.condition[0].code.coding[0].display == \"Myocardial Infarction\"\n    assert (\n        inst.condition[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.condition[0].code.text == \"Heart Attack\"\n    assert inst.condition[0].contributedToDeath is True\n    assert inst.condition[0].note[0].text == (\n        \"Was fishing at the time. At least he went doing someting he \" \"loved.\"\n    )\n    assert inst.condition[0].onsetAge.code == \"a\"\n    assert (\n        inst.condition[0].onsetAge.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.condition[0].onsetAge.unit == \"yr\"\n    assert float(inst.condition[0].onsetAge.value) == float(74)\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-03-18\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"father\"\n    assert inst.identifier[0].value == \"12345\"\n    assert (\n        inst.instantiatesUri[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/family-member-history-questionnaire\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/f201\"\n    assert inst.participant[0].function.coding[0].code == \"verifier\"\n    assert inst.participant[0].function.coding[0].display == \"Verifier\"\n    assert (\n        inst.participant[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert inst.patient.display == \"Peter Patient\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.relationship.coding[0].code == \"FTH\"\n    assert inst.relationship.coding[0].display == \"father\"\n    assert (\n        inst.relationship.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.sex.coding[0].code == \"male\"\n    assert inst.sex.coding[0].display == \"Male\"\n    assert (\n        inst.sex.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/administrative-gender\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Father died of a'\n        \" heart attack aged 74</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_familymemberhistory_1(base_settings):\n    \"\"\"No. 1 tests collection for FamilyMemberHistory.\n    Test File: familymemberhistory-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"familymemberhistory-example.json\"\n    inst = familymemberhistory.FamilyMemberHistory.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"FamilyMemberHistory\" == inst.get_resource_type()\n\n    impl_familymemberhistory_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"FamilyMemberHistory\" == data[\"resourceType\"]\n\n    inst2 = familymemberhistory.FamilyMemberHistory(**data)\n    impl_familymemberhistory_1(inst2)\n\n\ndef impl_familymemberhistory_2(inst):\n    assert inst.condition[0].code.coding[0].code == \"700146008\"\n    assert (\n        inst.condition[0].code.coding[0].display\n        == \"No history of malignant neoplasm of breast\"\n    )\n    assert (\n        inst.condition[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.condition[0].code.text == \"No history of malignant tumor of breast\"\n    assert inst.id == \"negation\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.display == \"Peter Patient\"\n    assert inst.patient.reference == \"Patient/100\"\n    assert inst.relationship.coding[0].code == \"MTH\"\n    assert inst.relationship.coding[0].display == \"mother\"\n    assert (\n        inst.relationship.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Mother has no '\n        \"history of malignant tumor of breast</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_familymemberhistory_2(base_settings):\n    \"\"\"No. 2 tests collection for FamilyMemberHistory.\n    Test File: familymemberhistory-example-negation.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"familymemberhistory-example-negation.json\"\n    )\n    inst = familymemberhistory.FamilyMemberHistory.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"FamilyMemberHistory\" == inst.get_resource_type()\n\n    impl_familymemberhistory_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"FamilyMemberHistory\" == data[\"resourceType\"]\n\n    inst2 = familymemberhistory.FamilyMemberHistory(**data)\n    impl_familymemberhistory_2(inst2)\n\n\ndef impl_familymemberhistory_3(inst):\n    assert inst.condition[0].code.coding[0].code == \"371041009\"\n    assert inst.condition[0].code.coding[0].display == \"Embolic Stroke\"\n    assert (\n        inst.condition[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.condition[0].code.text == \"Stroke\"\n    assert inst.condition[0].onsetAge.code == \"a\"\n    assert (\n        inst.condition[0].onsetAge.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.condition[0].onsetAge.unit == \"yr\"\n    assert float(inst.condition[0].onsetAge.value) == float(56)\n    assert inst.id == \"mother\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.display == \"Peter Patient\"\n    assert inst.patient.reference == \"Patient/100\"\n    assert inst.relationship.coding[0].code == \"MTH\"\n    assert inst.relationship.coding[0].display == \"mother\"\n    assert (\n        inst.relationship.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Mother died of a'\n        \" stroke aged 56</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_familymemberhistory_3(base_settings):\n    \"\"\"No. 3 tests collection for FamilyMemberHistory.\n    Test File: familymemberhistory-example-mother.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"familymemberhistory-example-mother.json\"\n    )\n    inst = familymemberhistory.FamilyMemberHistory.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"FamilyMemberHistory\" == inst.get_resource_type()\n\n    impl_familymemberhistory_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"FamilyMemberHistory\" == data[\"resourceType\"]\n\n    inst2 = familymemberhistory.FamilyMemberHistory(**data)\n    impl_familymemberhistory_3(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_flag.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Flag\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import flag\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_flag_1(inst):\n    assert inst.author.display == \"Nancy Nurse\"\n    assert inst.author.reference == \"Practitioner/example\"\n    assert inst.category[0].coding[0].code == \"safety\"\n    assert inst.category[0].coding[0].display == \"Safety\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/flag-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Safety\"\n    assert inst.code.coding[0].code == \"bigdog\"\n    assert inst.code.coding[0].display == \"Big dog\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/local\"}\n        ).valueUri\n    )\n    assert inst.code.text == (\n        \"Patient has a big dog at his home. Always always wear a suit\"\n        \" of armor or take other active counter-measures\"\n    )\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-12-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-17\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"inactive\"\n    assert inst.subject.display == \"Peter Patient\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Large Dog '\n        \"warning for Peter Patient</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_flag_1(base_settings):\n    \"\"\"No. 1 tests collection for Flag.\n    Test File: flag-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"flag-example.json\"\n    inst = flag.Flag.model_validate_json(filename.read_bytes())\n    assert \"Flag\" == inst.get_resource_type()\n\n    impl_flag_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Flag\" == data[\"resourceType\"]\n\n    inst2 = flag.Flag(**data)\n    impl_flag_1(inst2)\n\n\ndef impl_flag_2(inst):\n    assert inst.category[0].coding[0].code == \"infection\"\n    assert inst.category[0].coding[0].display == \"Infection Control Level\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/local\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"l3\"\n    assert inst.code.coding[0].display == \"Follow Level 3 Protocol\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/local/if1\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example-encounter\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter Patient\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Follow Infection'\n        \" Control Level 3 Protocol</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_flag_2(base_settings):\n    \"\"\"No. 2 tests collection for Flag.\n    Test File: flag-example-encounter.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"flag-example-encounter.json\"\n    inst = flag.Flag.model_validate_json(filename.read_bytes())\n    assert \"Flag\" == inst.get_resource_type()\n\n    impl_flag_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Flag\" == data[\"resourceType\"]\n\n    inst2 = flag.Flag(**data)\n    impl_flag_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_formularyitem.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/FormularyItem\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import formularyitem\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_formularyitem_1(inst):\n    assert inst.code.coding[0].code == \"323418000\"\n    assert (\n        inst.code.coding[0].display\n        == \"Phenoxymethylpenicillin 125mg/5mL oral solution (product)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[1].code == \"22571011000036102\"\n    assert inst.code.coding[1].display == (\n        \"phenoxymethylpenicillin 125 mg / 5 mL oral liquid, 5 mL \" \"measure\"\n    )\n    assert (\n        inst.code.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nehta.gov.au/amt/v2\"}\n        ).valueUri\n    )\n    assert inst.id == \"formularyitemexample01\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_formularyitem_1(base_settings):\n    \"\"\"No. 1 tests collection for FormularyItem.\n    Test File: formularyitemexample01.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"formularyitemexample01.json\"\n    inst = formularyitem.FormularyItem.model_validate_json(filename.read_bytes())\n    assert \"FormularyItem\" == inst.get_resource_type()\n\n    impl_formularyitem_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"FormularyItem\" == data[\"resourceType\"]\n\n    inst2 = formularyitem.FormularyItem(**data)\n    impl_formularyitem_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_genomicstudy.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/GenomicStudy\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import genomicstudy\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_genomicstudy_1(inst):\n    assert (\n        inst.analysis[0].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:10-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.analysis[0].device[0].device.reference == \"Device/NGS-device\"\n    assert (\n        inst.analysis[0].device[0].function.coding[0].display\n        == \"Next Generation Sequencing\"\n    )\n    assert (\n        inst.analysis[0].identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/genomicAnalyses\"}\n        ).valueUri\n    )\n    assert inst.analysis[0].identifier[0].use == \"temp\"\n    assert inst.analysis[0].identifier[0].value == \"urn:uuid:1111-1111-1111-1111\"\n    assert inst.analysis[0].input[0].file.reference == \"DocumentReference/genomicFile1\"\n    assert inst.analysis[0].input[0].type.coding[0].code == \"vcf\"\n    assert inst.analysis[0].input[0].type.coding[0].display == \"VCF\"\n    assert (\n        inst.analysis[0].instantiatesUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://pubmed.ncbi.nlm.nih.gov/33927380/\"}\n        ).valueUri\n    )\n    assert (\n        inst.analysis[0].note[0].text\n        == \"This is a next generation sequencing analysis of a proband.\"\n    )\n    assert (\n        inst.analysis[0].performer[0].actor.reference == \"Practitioner/practitioner02\"\n    )\n    assert inst.analysis[0].performer[0].role.coding[0].code == \"PRF\"\n    assert inst.analysis[0].performer[0].role.coding[0].display == \"Performer\"\n    assert (\n        inst.analysis[0].performer[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html\"\n            }\n        ).valueUri\n    )\n    assert inst.analysis[0].specimen[0].reference == \"Specimen/denovo-1\"\n    assert inst.analysis[0].title == (\n        \"Proband Sequence Variation Detection Using Next Generation \" \"Sequencing\"\n    )\n    assert (\n        inst.analysis[1].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:10-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.analysis[1].device[0].device.reference == \"Device/NGS-device\"\n    assert inst.analysis[1].focus[0].reference == \"Patient/denovoMother\"\n    assert (\n        inst.analysis[1].identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/genomicAnalyses\"}\n        ).valueUri\n    )\n    assert inst.analysis[1].identifier[0].use == \"temp\"\n    assert inst.analysis[1].identifier[0].value == \"urn:uuid:1111-1111-1111-1112\"\n    assert inst.analysis[1].input[0].file.reference == \"DocumentReference/genomicFile2\"\n    assert inst.analysis[1].input[0].type.coding[0].code == \"vcf\"\n    assert inst.analysis[1].input[0].type.coding[0].display == \"VCF\"\n    assert (\n        inst.analysis[1].instantiatesUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://pubmed.ncbi.nlm.nih.gov/33927380/\"}\n        ).valueUri\n    )\n    assert inst.analysis[1].note[0].text == (\n        \"This is a next generation sequencing analysis of a mother of\" \" a proband.\"\n    )\n    assert (\n        inst.analysis[1].performer[0].actor.reference == \"Practitioner/practitioner02\"\n    )\n    assert inst.analysis[1].performer[0].role.coding[0].code == \"PRF\"\n    assert inst.analysis[1].performer[0].role.coding[0].display == \"Performer\"\n    assert (\n        inst.analysis[1].performer[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html\"\n            }\n        ).valueUri\n    )\n    assert inst.analysis[1].specimen[0].reference == \"Specimen/denovo-2\"\n    assert inst.analysis[1].title == (\n        \"Maternal Sequence Variation Detection Using Next Generation \" \"Sequencing\"\n    )\n    assert (\n        inst.analysis[2].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:10-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.analysis[2].device[0].device.reference == \"Device/NGS-device\"\n    assert inst.analysis[2].focus[0].reference == \"Patient/denovoFather\"\n    assert (\n        inst.analysis[2].identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/genomicAnalyses\"}\n        ).valueUri\n    )\n    assert inst.analysis[2].identifier[0].use == \"temp\"\n    assert inst.analysis[2].identifier[0].value == \"urn:uuid:1111-1111-1111-1113\"\n    assert inst.analysis[2].input[0].file.reference == \"DocumentReference/genomicFile3\"\n    assert inst.analysis[2].input[0].type.coding[0].code == \"vcf\"\n    assert inst.analysis[2].input[0].type.coding[0].display == \"VCF\"\n    assert (\n        inst.analysis[2].instantiatesUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://pubmed.ncbi.nlm.nih.gov/33927380/\"}\n        ).valueUri\n    )\n    assert inst.analysis[2].note[0].text == (\n        \"This is a next generation sequencing analysis of a father of\" \" a proband.\"\n    )\n    assert (\n        inst.analysis[2].performer[0].actor.reference == \"Practitioner/practitioner02\"\n    )\n    assert inst.analysis[2].performer[0].role.coding[0].code == \"PRF\"\n    assert inst.analysis[2].performer[0].role.coding[0].display == \"Performer\"\n    assert (\n        inst.analysis[2].performer[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html\"\n            }\n        ).valueUri\n    )\n    assert inst.analysis[2].specimen[0].reference == \"Specimen/denovo-3\"\n    assert inst.analysis[2].title == (\n        \"Paternal Sequence Variation Detection Using Next Generation \" \"Sequencing\"\n    )\n    assert (\n        inst.analysis[3].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T03:01:10-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.analysis[3].device[0].device.reference == \"Device/Triodenovo-SW\"\n    assert (\n        inst.analysis[3].identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/genomicAnalyses\"}\n        ).valueUri\n    )\n    assert inst.analysis[3].identifier[0].use == \"temp\"\n    assert inst.analysis[3].identifier[0].value == \"urn:uuid:1111-1111-1111-1114\"\n    assert inst.analysis[3].input[0].file.reference == \"DocumentReference/genomicFile1\"\n    assert inst.analysis[3].input[0].type.coding[0].code == \"vcf\"\n    assert inst.analysis[3].input[0].type.coding[0].display == \"VCF\"\n    assert inst.analysis[3].input[1].file.reference == \"DocumentReference/genomicFile2\"\n    assert inst.analysis[3].input[1].type.coding[0].code == \"vcf\"\n    assert inst.analysis[3].input[1].type.coding[0].display == \"VCF\"\n    assert inst.analysis[3].input[2].file.reference == \"DocumentReference/genomicFile3\"\n    assert inst.analysis[3].input[2].type.coding[0].code == \"vcf\"\n    assert inst.analysis[3].input[2].type.coding[0].display == \"VCF\"\n    assert (\n        inst.analysis[3].instantiatesUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6885382/\"}\n        ).valueUri\n    )\n    assert inst.analysis[3].note[0].text == (\n        \"This is a next generation sequencing analysis of the \"\n        \"comparison analysis of proband and parents sequences.\"\n    )\n    assert (\n        inst.analysis[3].performer[0].actor.reference == \"Practitioner/practitioner02\"\n    )\n    assert inst.analysis[3].performer[0].role.coding[0].code == \"PRF\"\n    assert inst.analysis[3].performer[0].role.coding[0].display == \"Performer\"\n    assert (\n        inst.analysis[3].performer[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html\"\n            }\n        ).valueUri\n    )\n    assert inst.analysis[3].title == \"De Novo Mutation Detection and Interpretation\"\n    assert inst.basedOn[0].reference == \"ServiceRequest/genomicServiceRequest\"\n    assert inst.description == \"De novo mutation study of the patient.\"\n    assert inst.encounter.reference == \"Encounter/denovoEncounter\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/genomicstudies\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"urn:uuid:1111-1111-1111-1111\"\n    assert inst.interpreter[0].reference == \"Practitioner/practitioner02\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"This de novo mutation is urgent and important for \"\n        \"establishing the treatment plan.\"\n    )\n    assert inst.reason[0].concept.coding[0].code == \"267431006\"\n    assert (\n        inst.reason[0].concept.coding[0].display\n        == \"Disorder of lipid metabolism (disorder)\"\n    )\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.referrer.reference == \"Practitioner/practitioner01\"\n    assert (\n        inst.startDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"unknown\"\n    assert inst.subject.reference == \"Patient/denovoChild\"\n    assert inst.text.status == \"additional\"\n    assert inst.type[0].coding[0].code == \"fam-var-segr\"\n    assert inst.type[0].coding[0].display == \"Familial variant segregation\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/genomicstudy-type\"}\n        ).valueUri\n    )\n\n\ndef test_genomicstudy_1(base_settings):\n    \"\"\"No. 1 tests collection for GenomicStudy.\n    Test File: genomicstudy-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"genomicstudy-example.json\"\n    inst = genomicstudy.GenomicStudy.model_validate_json(filename.read_bytes())\n    assert \"GenomicStudy\" == inst.get_resource_type()\n\n    impl_genomicstudy_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"GenomicStudy\" == data[\"resourceType\"]\n\n    inst2 = genomicstudy.GenomicStudy(**data)\n    impl_genomicstudy_1(inst2)\n\n\ndef impl_genomicstudy_2(inst):\n    assert (\n        inst.analysis[0].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-07-01T01:01:10-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.analysis[0].device[0].device.reference == \"Device/NGS-device\"\n    assert inst.analysis[0].focus[0].reference == \"Patient/mother\"\n    assert (\n        inst.analysis[0].identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/genomicAnalyses\"}\n        ).valueUri\n    )\n    assert inst.analysis[0].identifier[0].use == \"temp\"\n    assert inst.analysis[0].identifier[0].value == \"urn:uuid:1111-1111-1111-1112\"\n    assert (\n        inst.analysis[0].instantiatesUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://pubmed.ncbi.nlm.nih.gov/33927380/\"}\n        ).valueUri\n    )\n    assert inst.analysis[0].note[0].text == (\n        \"This is a next generation sequencing analysis of a mother of\" \" a proband.\"\n    )\n    assert (\n        inst.analysis[0].performer[0].actor.reference == \"Practitioner/practitioner02\"\n    )\n    assert inst.analysis[0].performer[0].role.coding[0].code == \"PRF\"\n    assert inst.analysis[0].performer[0].role.coding[0].display == \"Performer\"\n    assert (\n        inst.analysis[0].performer[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html\"\n            }\n        ).valueUri\n    )\n    assert inst.analysis[0].specimen[0].reference == \"Specimen/specimenMother\"\n    assert inst.analysis[0].title == (\n        \"Maternal Sequence Variation Detection Using Next Generation \" \"Sequencing\"\n    )\n    assert (\n        inst.analysis[1].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-07-01T01:01:10-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.analysis[1].device[0].device.reference == \"Device/NGS-device\"\n    assert inst.analysis[1].focus[0].reference == \"Patient/father\"\n    assert (\n        inst.analysis[1].identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/genomicAnalyses\"}\n        ).valueUri\n    )\n    assert inst.analysis[1].identifier[0].use == \"temp\"\n    assert inst.analysis[1].identifier[0].value == \"urn:uuid:1111-1111-1111-1113\"\n    assert (\n        inst.analysis[1].instantiatesUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://pubmed.ncbi.nlm.nih.gov/33927380/\"}\n        ).valueUri\n    )\n    assert inst.analysis[1].note[0].text == (\n        \"This is a next generation sequencing analysis of a father of\" \" a proband.\"\n    )\n    assert (\n        inst.analysis[1].performer[0].actor.reference == \"Practitioner/practitioner02\"\n    )\n    assert inst.analysis[1].performer[0].role.coding[0].code == \"PRF\"\n    assert inst.analysis[1].performer[0].role.coding[0].display == \"Performer\"\n    assert (\n        inst.analysis[1].performer[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html\"\n            }\n        ).valueUri\n    )\n    assert inst.analysis[1].specimen[0].reference == \"Specimen/specimenFather\"\n    assert inst.analysis[1].title == (\n        \"Paternal Sequence Variation Detection Using Next Generation \" \"Sequencing\"\n    )\n    assert (\n        inst.analysis[2].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-07-01T03:01:10-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.analysis[2].device[0].device.reference == \"Device/Triodenovo-SW\"\n    assert inst.analysis[2].focus[0].reference == \"Patient/denovoChild\"\n    assert (\n        inst.analysis[2].focus[1].reference == \"RelatedPerson/relatedPersonDenovoFather\"\n    )\n    assert (\n        inst.analysis[2].focus[2].reference == \"RelatedPerson/relatedPersonDenovoMother\"\n    )\n    assert (\n        inst.analysis[2].identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/genomicAnalyses\"}\n        ).valueUri\n    )\n    assert inst.analysis[2].identifier[0].use == \"temp\"\n    assert inst.analysis[2].identifier[0].value == \"urn:uuid:1111-1111-1111-1114\"\n    assert (\n        inst.analysis[2].input[0].file.reference\n        == \"DocumentReference/genomicFileProband\"\n    )\n    assert inst.analysis[2].input[0].type.coding[0].code == \"bam\"\n    assert inst.analysis[2].input[0].type.coding[0].display == \"BAM\"\n    assert (\n        inst.analysis[2].input[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/genomicstudy-dataformat\"}\n        ).valueUri\n    )\n    assert (\n        inst.analysis[2].input[1].file.reference\n        == \"DocumentReference/genomicFileMother\"\n    )\n    assert inst.analysis[2].input[1].type.coding[0].code == \"bam\"\n    assert inst.analysis[2].input[1].type.coding[0].display == \"BAM\"\n    assert (\n        inst.analysis[2].input[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/genomicstudy-dataformat\"}\n        ).valueUri\n    )\n    assert (\n        inst.analysis[2].input[2].file.reference\n        == \"DocumentReference/genomicFileFather\"\n    )\n    assert inst.analysis[2].input[2].type.coding[0].code == \"bam\"\n    assert inst.analysis[2].input[2].type.coding[0].display == \"BAM\"\n    assert (\n        inst.analysis[2].input[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/genomicstudy-dataformat\"}\n        ).valueUri\n    )\n    assert (\n        inst.analysis[2].instantiatesUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6885382/\"}\n        ).valueUri\n    )\n    assert inst.analysis[2].note[0].text == (\n        \"This is a next generation sequencing analysis of the \"\n        \"comparison analysis of proband and parents sequences.\"\n    )\n    assert (\n        inst.analysis[2].output[0].file.reference\n        == \"DocumentReference/genomicFileGroupAsSubject\"\n    )\n    assert inst.analysis[2].output[0].type.coding[0].code == \"vcf\"\n    assert inst.analysis[2].output[0].type.coding[0].display == \"VCF\"\n    assert (\n        inst.analysis[2].output[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/genomicstudy-dataformat\"}\n        ).valueUri\n    )\n    assert (\n        inst.analysis[2].performer[0].actor.reference == \"Practitioner/practitioner02\"\n    )\n    assert inst.analysis[2].performer[0].role.coding[0].code == \"PRF\"\n    assert inst.analysis[2].performer[0].role.coding[0].display == \"Performer\"\n    assert (\n        inst.analysis[2].performer[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html\"\n            }\n        ).valueUri\n    )\n    assert inst.analysis[2].title == \"De Novo Mutation Detection and Interpretation\"\n    assert inst.basedOn[0].reference == \"ServiceRequest/genomicSRProband\"\n    assert inst.basedOn[1].reference == \"ServiceRequest/genomicSRMother\"\n    assert inst.basedOn[2].reference == \"ServiceRequest/genomicSRFather\"\n    assert inst.encounter.reference == \"Encounter/denovoEncounter\"\n    assert inst.id == \"example-trio2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/genomicstudies\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"urn:uuid:1111-1111-1111-1113\"\n    assert inst.interpreter[0].reference == \"Practitioner/practitioner02\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"This de novo mutation is urgent and important for \"\n        \"establishing the treatment plan.\"\n    )\n    assert inst.reason[0].concept.coding[0].code == \"67799006\"\n    assert (\n        inst.reason[0].concept.coding[0].display\n        == \"Cystic fibrosis, prenatal detection (procedure) |\"\n    )\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.referrer.reference == \"Practitioner/practitioner01\"\n    assert (\n        inst.startDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-05-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"available\"\n    assert inst.subject.reference == \"Patient/proband\"\n    assert inst.text.status == \"additional\"\n    assert inst.type[0].coding[0].code == \"trio\"\n    assert inst.type[0].coding[0].display == \"Trio-analysis\"\n\n\ndef test_genomicstudy_2(base_settings):\n    \"\"\"No. 2 tests collection for GenomicStudy.\n    Test File: genomicstudy-example-trio2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"genomicstudy-example-trio2.json\"\n    inst = genomicstudy.GenomicStudy.model_validate_json(filename.read_bytes())\n    assert \"GenomicStudy\" == inst.get_resource_type()\n\n    impl_genomicstudy_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"GenomicStudy\" == data[\"resourceType\"]\n\n    inst2 = genomicstudy.GenomicStudy(**data)\n    impl_genomicstudy_2(inst2)\n\n\ndef impl_genomicstudy_3(inst):\n    assert inst.analysis[0].changeType[0].coding[0].code == \"SO:0001483\"\n    assert inst.analysis[0].changeType[0].coding[0].display == \"SNV\"\n    assert (\n        inst.analysis[0].changeType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://sequenceontology.org\"}\n        ).valueUri\n    )\n    assert inst.analysis[0].changeType[1].coding[0].code == \"SO:0002007\"\n    assert inst.analysis[0].changeType[1].coding[0].display == \"MNV\"\n    assert (\n        inst.analysis[0].changeType[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://sequenceontology.org\"}\n        ).valueUri\n    )\n    assert inst.analysis[0].changeType[2].coding[0].code == \"SO:1000032\"\n    assert inst.analysis[0].changeType[2].coding[0].display == \"delins\"\n    assert (\n        inst.analysis[0].changeType[2].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://sequenceontology.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.analysis[0].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-03-01T01:01:10-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.analysis[0].device[0].device.reference == \"Device/NGS-device\"\n    assert (\n        inst.analysis[0].device[0].function.coding[0].display\n        == \"Next Generation Sequencing\"\n    )\n    assert inst.analysis[0].genomeBuild.coding[0].code == \"LA26806-2\"\n    assert inst.analysis[0].genomeBuild.coding[0].display == \"GRCh38\"\n    assert (\n        inst.analysis[0].genomeBuild.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.analysis[0].identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/genomicAnalyses\"}\n        ).valueUri\n    )\n    assert inst.analysis[0].identifier[0].use == \"official\"\n    assert inst.analysis[0].identifier[0].value == \"urn:uuid:1111-1111-1111-1112\"\n    assert inst.analysis[0].methodType[0].coding[0].code == \"117040002\"\n    assert (\n        inst.analysis[0].methodType[0].coding[0].display\n        == \"Nucleic acid sequencing (procedure)\"\n    )\n    assert (\n        inst.analysis[0].methodType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.analysis[0].note[0].text == (\n        \"For technical reasons, PIK3CB was deemed uncallable using \" \"this method.\"\n    )\n    assert (\n        inst.analysis[0].output[0].file.reference\n        == \"DocumentReference/genomicVCFfile_simple\"\n    )\n    assert inst.analysis[0].output[0].type.coding[0].code == \"vcf\"\n    assert inst.analysis[0].output[0].type.coding[0].display == \"VCF\"\n    assert (\n        inst.analysis[0].performer[0].actor.reference == \"Practitioner/practitioner02\"\n    )\n    assert inst.analysis[0].performer[0].role.coding[0].code == \"PRF\"\n    assert inst.analysis[0].performer[0].role.coding[0].display == \"Performer\"\n    assert (\n        inst.analysis[0].performer[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.analysis[0].regionsCalled[0].reference\n        == \"DocumentReference/SimpleVariantAnalysis_called\"\n    )\n    assert (\n        inst.analysis[0].regionsStudied[0].reference\n        == \"DocumentReference/WES_FullSequencedRegion_GRCh38\"\n    )\n    assert inst.analysis[0].specimen[0].reference == \"Specimen/genomicSpecimen\"\n    assert inst.analysis[0].title == \"Simple variant analysis\"\n    assert inst.analysis[1].changeType[0].coding[0].code == \"SO:0001019\"\n    assert inst.analysis[1].changeType[0].coding[0].display == \"CNV\"\n    assert (\n        inst.analysis[1].changeType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://sequenceontology.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.analysis[1].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-03-01T01:01:10-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.analysis[1].genomeBuild.coding[0].code == \"LA26806-2\"\n    assert inst.analysis[1].genomeBuild.coding[0].display == \"GRCh38\"\n    assert (\n        inst.analysis[1].genomeBuild.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.analysis[1].identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/genomicAnalyses\"}\n        ).valueUri\n    )\n    assert inst.analysis[1].identifier[0].use == \"official\"\n    assert inst.analysis[1].identifier[0].value == \"urn:uuid:1111-1111-1111-1115\"\n    assert inst.analysis[1].methodType[0].coding[0].code == \"117040002\"\n    assert (\n        inst.analysis[1].methodType[0].coding[0].display\n        == \"Nucleic acid sequencing (procedure)\"\n    )\n    assert (\n        inst.analysis[1].methodType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.analysis[1].note[0].text == (\n        \"For technical reasons, PIK3CB was deemed uncallable using \" \"this method.\"\n    )\n    assert (\n        inst.analysis[1].output[0].file.reference\n        == \"DocumentReference/genomicVCFfile_cnv\"\n    )\n    assert inst.analysis[1].output[0].type.coding[0].code == \"vcf\"\n    assert inst.analysis[1].output[0].type.coding[0].display == \"VCF\"\n    assert (\n        inst.analysis[1].performer[0].actor.reference == \"Practitioner/practitioner02\"\n    )\n    assert inst.analysis[1].performer[0].role.coding[0].code == \"PRF\"\n    assert inst.analysis[1].performer[0].role.coding[0].display == \"Performer\"\n    assert (\n        inst.analysis[1].performer[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/3.1.0/CodeSystem-v3-ParticipationType.html\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.analysis[1].regionsCalled[0].reference\n        == \"DocumentReference/CNVAnalysis_called\"\n    )\n    assert (\n        inst.analysis[1].regionsStudied[0].reference\n        == \"DocumentReference/WES_FullSequencedRegion_GRCh38\"\n    )\n    assert inst.analysis[1].specimen[0].reference == \"Specimen/genomicSpecimen\"\n    assert inst.analysis[1].title == \"CNV analysis\"\n    assert inst.basedOn[0].reference == \"ServiceRequest/genomicServiceRequest2\"\n    assert inst.description == (\n        \"Whole exome sequencing of lung biopsy. 300 genes are \"\n        \"examined for simple variants (SNV, MNV, InDel), and 170 \"\n        \"genes are also examined for CNVs. For technical reasons, \"\n        \"PIK3CB was deemed uncallable.\"\n    )\n    assert inst.encounter.reference == \"Encounter/genomicEncounter\"\n    assert inst.id == \"example-lungMass\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/genomicstudies\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"urn:uuid:1111-1111-1111-1112\"\n    assert inst.interpreter[0].reference == \"Practitioner/practitioner02\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"For technical reasons, PIK3CB was deemed uncallable.\"\n    assert inst.reason[0].concept.coding[0].code == \"309529002\"\n    assert inst.reason[0].concept.coding[0].display == \"Lung mass (finding) \"\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.referrer.reference == \"Practitioner/practitioner01\"\n    assert (\n        inst.startDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-03-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"registered\"\n    assert inst.subject.reference == \"Patient/genomicPatient\"\n    assert inst.text.status == \"additional\"\n    assert inst.type[0].coding[0].code == \"443968007\"\n    assert inst.type[0].coding[0].display == (\n        \"Whole Exome Sequencing - Sequencing of entire coding region \"\n        \"of gene (procedure)\"\n    )\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_genomicstudy_3(base_settings):\n    \"\"\"No. 3 tests collection for GenomicStudy.\n    Test File: genomicstudy-example-lungMass.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"genomicstudy-example-lungMass.json\"\n    inst = genomicstudy.GenomicStudy.model_validate_json(filename.read_bytes())\n    assert \"GenomicStudy\" == inst.get_resource_type()\n\n    impl_genomicstudy_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"GenomicStudy\" == data[\"resourceType\"]\n\n    inst2 = genomicstudy.GenomicStudy(**data)\n    impl_genomicstudy_3(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_goal.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Goal\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import goal\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_goal_1(inst):\n    assert inst.addresses[0].display == \"obesity condition\"\n    assert inst.category[0].coding[0].code == \"dietary\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/goal-category\"}\n        ).valueUri\n    )\n    assert inst.continuous is True\n    assert inst.description.text == \"Target weight is 160 to 180 lbs.\"\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"123\"\n    assert inst.lifecycleStatus == \"on-hold\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome[0].reference.display == \"Body Weight Measured\"\n    assert inst.outcome[0].reference.reference == \"Observation/example\"\n    assert inst.priority.coding[0].code == \"high-priority\"\n    assert inst.priority.coding[0].display == \"High Priority\"\n    assert (\n        inst.priority.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/goal-priority\"}\n        ).valueUri\n    )\n    assert inst.priority.text == \"high\"\n    assert inst.source.display == \"Peter James Chalmers\"\n    assert inst.source.reference == \"Patient/example\"\n    assert (\n        inst.startDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-04-05\"}).valueDate\n    )\n    assert (\n        inst.statusDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-02-14\"}).valueDate\n    )\n    assert (\n        inst.statusReason == \"Patient wants to defer weight loss until after honeymoon.\"\n    )\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.target[0].detailRange.high.code == \"[lb_av]\"\n    assert (\n        inst.target[0].detailRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.target[0].detailRange.high.unit == \"lbs\"\n    assert float(inst.target[0].detailRange.high.value) == float(180)\n    assert inst.target[0].detailRange.low.code == \"[lb_av]\"\n    assert (\n        inst.target[0].detailRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.target[0].detailRange.low.unit == \"lbs\"\n    assert float(inst.target[0].detailRange.low.value) == float(160)\n    assert (\n        inst.target[0].dueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-04-05\"}).valueDate\n    )\n    assert inst.target[0].measure.coding[0].code == \"3141-9\"\n    assert inst.target[0].measure.coding[0].display == \"Weight Measured\"\n    assert (\n        inst.target[0].measure.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"additional\"\n\n\ndef test_goal_1(base_settings):\n    \"\"\"No. 1 tests collection for Goal.\n    Test File: goal-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"goal-example.json\"\n    inst = goal.Goal.model_validate_json(filename.read_bytes())\n    assert \"Goal\" == inst.get_resource_type()\n\n    impl_goal_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Goal\" == data[\"resourceType\"]\n\n    inst2 = goal.Goal(**data)\n    impl_goal_1(inst2)\n\n\ndef impl_goal_2(inst):\n    assert inst.achievementStatus.coding[0].code == \"achieved\"\n    assert inst.achievementStatus.coding[0].display == \"Achieved\"\n    assert (\n        inst.achievementStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/goal-achievement\"}\n        ).valueUri\n    )\n    assert inst.achievementStatus.text == \"Achieved\"\n    assert inst.description.text == \"Stop smoking\"\n    assert inst.id == \"stop-smoking\"\n    assert inst.identifier[0].value == \"123\"\n    assert inst.lifecycleStatus == \"completed\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome[0].concept.coding[0].code == \"8517006\"\n    assert inst.outcome[0].concept.coding[0].display == \"Ex-smoker (finding)\"\n    assert (\n        inst.outcome[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.outcome[0].concept.text == \"Former smoker\"\n    assert (\n        inst.startDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-04-05\"}).valueDate\n    )\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_goal_2(base_settings):\n    \"\"\"No. 2 tests collection for Goal.\n    Test File: goal-example-stop-smoking.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"goal-example-stop-smoking.json\"\n    inst = goal.Goal.model_validate_json(filename.read_bytes())\n    assert \"Goal\" == inst.get_resource_type()\n\n    impl_goal_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Goal\" == data[\"resourceType\"]\n\n    inst2 = goal.Goal(**data)\n    impl_goal_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_graphdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/GraphDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import graphdefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_graphdefinition_1(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-04\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Specify to include list references when generating a \"\n        \"document using the $document operation\"\n    )\n    assert inst.id == \"example\"\n    assert inst.link[0].compartment[0].code == \"Patient\"\n    assert inst.link[0].compartment[0].rule == \"identical\"\n    assert inst.link[0].compartment[0].use == \"requires\"\n    assert inst.link[0].description == \"Link from Composition.section to list\"\n    assert inst.link[0].path == \"Composition.section.entry\"\n    assert inst.link[0].sourceId == \"comp1\"\n    assert inst.link[0].targetId == \"list1\"\n    assert inst.link[1].compartment[0].code == \"Patient\"\n    assert inst.link[1].compartment[0].rule == \"identical\"\n    assert inst.link[1].compartment[0].use == \"requires\"\n    assert inst.link[1].description == \"Include any list entries\"\n    assert inst.link[1].path == \"List.entry.item\"\n    assert inst.link[1].sourceId == \"list1\"\n    assert inst.link[1].targetId == \"resN\"\n    assert inst.name == \"DocumentGenerationTemplate\"\n    assert inst.node[0].description == \"The base composition\"\n    assert inst.node[0].nodeId == \"comp1\"\n    assert (\n        inst.node[0].profile\n        == \"http://hl7.org/fhir/StructureDefinition/clinicaldocument\"\n    )\n    assert inst.node[0].type == \"Composition\"\n    assert (\n        inst.node[1].description\n        == \"A list resource that a section entry reference points to\"\n    )\n    assert inst.node[1].nodeId == \"list1\"\n    assert inst.node[1].type == \"List\"\n    assert (\n        inst.node[2].description\n        == \"Generic resource that's the target of a list reference\"\n    )\n    assert inst.node[2].nodeId == \"resN\"\n    assert inst.node[2].type == \"Resource\"\n    assert inst.publisher == \"FHIR Project\"\n    assert inst.start == \"comp1\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Document Generation Template\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://h7.org/fhir/GraphDefinition/example\"}\n        ).valueUri\n    )\n\n\ndef test_graphdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for GraphDefinition.\n    Test File: graphdefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"graphdefinition-example.json\"\n    inst = graphdefinition.GraphDefinition.model_validate_json(filename.read_bytes())\n    assert \"GraphDefinition\" == inst.get_resource_type()\n\n    impl_graphdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"GraphDefinition\" == data[\"resourceType\"]\n\n    inst2 = graphdefinition.GraphDefinition(**data)\n    impl_graphdefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_group.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Group\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import group\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_group_1(inst):\n    assert inst.characteristic[0].code.text == \"gender\"\n    assert inst.characteristic[0].exclude is False\n    assert inst.characteristic[0].valueCodeableConcept.text == \"mixed\"\n    assert inst.characteristic[1].code.text == \"owner\"\n    assert inst.characteristic[1].exclude is False\n    assert inst.characteristic[1].valueCodeableConcept.text == \"John Smith\"\n    assert inst.code.text == \"Horse\"\n    assert inst.id == \"101\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://someveterinarianclinic.org/fhir/NamingSystem/herds\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.membership == \"enumerated\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"John's herd\"\n    assert inst.quantity == 25\n    assert inst.text.status == \"additional\"\n    assert inst.type == \"animal\"\n\n\ndef test_group_1(base_settings):\n    \"\"\"No. 1 tests collection for Group.\n    Test File: group-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"group-example.json\"\n    inst = group.Group.model_validate_json(filename.read_bytes())\n    assert \"Group\" == inst.get_resource_type()\n\n    impl_group_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Group\" == data[\"resourceType\"]\n\n    inst2 = group.Group(**data)\n    impl_group_1(inst2)\n\n\ndef impl_group_2(inst):\n    assert inst.id == \"102\"\n    assert inst.member[0].entity.reference == \"Patient/pat1\"\n    assert (\n        inst.member[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-10-08\"}\n        ).valueDateTime\n    )\n    assert inst.member[1].entity.reference == \"Patient/pat2\"\n    assert inst.member[1].inactive is True\n    assert (\n        inst.member[1].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-04-02\"}\n        ).valueDateTime\n    )\n    assert inst.member[2].entity.reference == \"Patient/pat3\"\n    assert (\n        inst.member[2].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-06\"}\n        ).valueDateTime\n    )\n    assert inst.member[3].entity.reference == \"Patient/pat4\"\n    assert (\n        inst.member[3].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-06\"}\n        ).valueDateTime\n    )\n    assert inst.membership == \"enumerated\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"additional\"\n    assert inst.type == \"person\"\n\n\ndef test_group_2(base_settings):\n    \"\"\"No. 2 tests collection for Group.\n    Test File: group-example-member.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"group-example-member.json\"\n    inst = group.Group.model_validate_json(filename.read_bytes())\n    assert \"Group\" == inst.get_resource_type()\n\n    impl_group_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Group\" == data[\"resourceType\"]\n\n    inst2 = group.Group(**data)\n    impl_group_2(inst2)\n\n\ndef impl_group_3(inst):\n    assert inst.characteristic[0].code.coding[0].code == \"attributed-to\"\n    assert (\n        inst.characteristic[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].code.text == \"Patients primarily attributed to\"\n    assert inst.characteristic[0].exclude is False\n    assert inst.characteristic[0].valueReference.reference == \"Practitioner/123\"\n    assert inst.id == \"example-patientlist\"\n    assert inst.membership == \"enumerated\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"additional\"\n    assert inst.type == \"person\"\n\n\ndef test_group_3(base_settings):\n    \"\"\"No. 3 tests collection for Group.\n    Test File: group-example-patientlist.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"group-example-patientlist.json\"\n    inst = group.Group.model_validate_json(filename.read_bytes())\n    assert \"Group\" == inst.get_resource_type()\n\n    impl_group_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Group\" == data[\"resourceType\"]\n\n    inst2 = group.Group(**data)\n    impl_group_3(inst2)\n\n\ndef impl_group_4(inst):\n    assert inst.active is True\n    assert inst.characteristic[0].code.text == \"gender\"\n    assert inst.characteristic[0].exclude is False\n    assert inst.characteristic[0].valueCodeableConcept.text == \"female\"\n    assert inst.code.coding[0].code == \"388393002\"\n    assert inst.code.coding[0].display == \"Genus Sus (organism)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[1].code == \"POR\"\n    assert inst.code.coding[1].display == \"porcine\"\n    assert (\n        inst.code.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.aphis.usda.gov\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Porcine\"\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/StructureDefinition/owner\"}\n        ).valueUri\n    )\n    assert inst.extension[0].valueReference.display == \"Peter Chalmers\"\n    assert inst.extension[0].valueReference.reference == \"RelatedPerson/peter\"\n    assert inst.id == \"herd1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://vetmed.iastate.edu/vdl\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"20171120-1234\"\n    assert inst.membership == \"enumerated\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Breeding herd\"\n    assert inst.quantity == 2500\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"animal\"\n\n\ndef test_group_4(base_settings):\n    \"\"\"No. 4 tests collection for Group.\n    Test File: group-example-herd1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"group-example-herd1.json\"\n    inst = group.Group.model_validate_json(filename.read_bytes())\n    assert \"Group\" == inst.get_resource_type()\n\n    impl_group_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Group\" == data[\"resourceType\"]\n\n    inst2 = group.Group(**data)\n    impl_group_4(inst2)\n\n\ndef impl_group_5(inst):\n    assert inst.active is True\n    assert inst.description == \"[markdown]\"\n    assert inst.id == \"groupDenovoFamily\"\n    assert inst.identifier[0].assigner.display == \"Child Hospital\"\n    assert (\n        inst.identifier[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/groups\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert inst.identifier[0].type.coding[0].display == \"Medical record number\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"11111\"\n    assert inst.managingEntity.reference == \"Practitioner/practitioner02\"\n    assert inst.member[0].entity.reference == \"Patient/proband\"\n    assert inst.member[0].inactive is False\n    assert (\n        inst.member[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:10-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.member[1].entity.reference == \"RelatedPerson/relatedPersonDenovoMother\"\n    assert inst.member[1].inactive is False\n    assert (\n        inst.member[1].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:10-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.member[2].entity.reference == \"RelatedPerson/relatedPersonDenovoFather\"\n    assert inst.member[2].inactive is False\n    assert (\n        inst.member[2].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:10-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.membership == \"enumerated\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Denovo Mutation Example Group\"\n    assert inst.quantity == 3\n    assert inst.text.status == \"additional\"\n    assert inst.type == \"person\"\n\n\ndef test_group_5(base_settings):\n    \"\"\"No. 5 tests collection for Group.\n    Test File: Group-denovoFamily.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Group-denovoFamily.json\"\n    inst = group.Group.model_validate_json(filename.read_bytes())\n    assert \"Group\" == inst.get_resource_type()\n\n    impl_group_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Group\" == data[\"resourceType\"]\n\n    inst2 = group.Group(**data)\n    impl_group_5(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_guidanceresponse.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/GuidanceResponse\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import guidanceresponse\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_guidanceresponse_1(inst):\n    assert inst.dataRequirement[0].codeFilter[0].code[0].code == \"4548-4\"\n    assert (\n        inst.dataRequirement[0].codeFilter[0].code[0].display\n        == \"Hemoglobin A1c/Hemoglobin.total in Blood\"\n    )\n    assert (\n        inst.dataRequirement[0].codeFilter[0].code[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.dataRequirement[0].codeFilter[0].path == \"code\"\n    assert inst.dataRequirement[0].mustSupport[0] == \"value\"\n    assert inst.dataRequirement[0].type == \"Observation\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"additional-data-example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"guidanceResponse2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.moduleUri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://someguidelineprovider.org/diabetes-guidelines.html\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-10T16:02:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.performer.reference == \"Device/software\"\n    assert inst.reason[0].concept.text == \"Diabetes Guideline\"\n    assert (\n        inst.requestIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.requestIdentifier.value == \"guidanceRequest2\"\n    assert inst.status == \"data-required\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_guidanceresponse_1(base_settings):\n    \"\"\"No. 1 tests collection for GuidanceResponse.\n    Test File: guidanceresponse-additional-data-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"guidanceresponse-additional-data-example.json\"\n    )\n    inst = guidanceresponse.GuidanceResponse.model_validate_json(filename.read_bytes())\n    assert \"GuidanceResponse\" == inst.get_resource_type()\n\n    impl_guidanceresponse_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"GuidanceResponse\" == data[\"resourceType\"]\n\n    inst2 = guidanceresponse.GuidanceResponse(**data)\n    impl_guidanceresponse_1(inst2)\n\n\ndef impl_guidanceresponse_2(inst):\n    assert inst.contained[0].id == \"outputParameters1\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"guidanceResponse1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.moduleUri\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://someguidelineprovider.org/radiology-appropriateness-guidelines.html\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-10T16:02:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.outputParameters.reference == \"#outputParameters1\"\n    assert inst.performer.reference == \"Device/software\"\n    assert inst.reason[0].concept.text == \"Guideline Appropriate Ordering Assessment\"\n    assert (\n        inst.requestIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.requestIdentifier.value == \"guidanceRequest1\"\n    assert inst.status == \"success\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_guidanceresponse_2(base_settings):\n    \"\"\"No. 2 tests collection for GuidanceResponse.\n    Test File: guidanceresponse-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"guidanceresponse-example.json\"\n    inst = guidanceresponse.GuidanceResponse.model_validate_json(filename.read_bytes())\n    assert \"GuidanceResponse\" == inst.get_resource_type()\n\n    impl_guidanceresponse_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"GuidanceResponse\" == data[\"resourceType\"]\n\n    inst2 = guidanceresponse.GuidanceResponse(**data)\n    impl_guidanceresponse_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_healthcareservice.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/HealthcareService\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import healthcareservice\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_healthcareservice_1(inst):\n    assert inst.active is True\n    assert inst.appointmentRequired is False\n    assert inst.availability[0].availableTime[0].allDay is True\n    assert inst.availability[0].availableTime[0].daysOfWeek[0] == \"wed\"\n    assert (\n        inst.availability[0].availableTime[1].availableEndTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"05:30:00\"}).valueTime\n    )\n    assert (\n        inst.availability[0].availableTime[1].availableStartTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"08:30:00\"}).valueTime\n    )\n    assert inst.availability[0].availableTime[1].daysOfWeek[0] == \"mon\"\n    assert inst.availability[0].availableTime[1].daysOfWeek[1] == \"tue\"\n    assert inst.availability[0].availableTime[1].daysOfWeek[2] == \"thu\"\n    assert inst.availability[0].availableTime[1].daysOfWeek[3] == \"fri\"\n    assert (\n        inst.availability[0].availableTime[2].availableEndTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"04:30:00\"}).valueTime\n    )\n    assert (\n        inst.availability[0].availableTime[2].availableStartTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"09:30:00\"}).valueTime\n    )\n    assert inst.availability[0].availableTime[2].daysOfWeek[0] == \"sat\"\n    assert inst.availability[0].availableTime[2].daysOfWeek[1] == \"fri\"\n    assert inst.availability[0].notAvailableTime[0].description == (\n        \"Christmas/Boxing Day, Reduced capacity is available during \"\n        \"the Christmas period\"\n    )\n    assert (\n        inst.availability[0].notAvailableTime[0].during.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-26\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.availability[0].notAvailableTime[0].during.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-25\"}\n        ).valueDateTime\n    )\n    assert inst.availability[0].notAvailableTime[1].description == \"New Years Day\"\n    assert (\n        inst.availability[0].notAvailableTime[1].during.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.availability[0].notAvailableTime[1].during.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.category[0].coding[0].code == \"8\"\n    assert inst.category[0].coding[0].display == \"Counselling\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/service-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Counselling\"\n    assert inst.characteristic[0].coding[0].display == \"Wheelchair access\"\n    assert inst.comment == (\n        \"Providing Specialist psychology services to the greater Den \"\n        \"Burg area, many years of experience dealing with PTSD issues\"\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"(555) silent\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"directaddress@example.com\"\n    assert inst.contained[0].id == \"DenBurg\"\n    assert inst.coverageArea[0].display == \"Greater Denburg area\"\n    assert inst.coverageArea[0].reference == \"#DenBurg\"\n    assert inst.eligibility[0].code.coding[0].display == \"DVA Required\"\n    assert inst.eligibility[0].comment == (\n        \"Evidence of application for DVA status may be sufficient for\"\n        \" commencing assessment\"\n    )\n    assert inst.endpoint[0].reference == \"Endpoint/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/shared-ids\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"HS-12\"\n    assert inst.location[0].reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Consulting psychologists and/or psychology services\"\n    assert inst.program[0].text == \"PTSD outreach\"\n    assert inst.providedBy.display == \"Burgers University Medical Center\"\n    assert inst.providedBy.reference == \"Organization/f001\"\n    assert inst.referralMethod[0].coding[0].code == \"phone\"\n    assert inst.referralMethod[0].coding[0].display == \"Phone\"\n    assert inst.referralMethod[1].coding[0].code == \"fax\"\n    assert inst.referralMethod[1].coding[0].display == \"Fax\"\n    assert inst.referralMethod[2].coding[0].code == \"elec\"\n    assert inst.referralMethod[2].coding[0].display == \"Secure Messaging\"\n    assert inst.referralMethod[3].coding[0].code == \"semail\"\n    assert inst.referralMethod[3].coding[0].display == \"Secure Email\"\n    assert inst.serviceProvisionCode[0].coding[0].code == \"cost\"\n    assert inst.serviceProvisionCode[0].coding[0].display == \"Fees apply\"\n    assert (\n        inst.serviceProvisionCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/service-provision-conditions\"\n            }\n        ).valueUri\n    )\n    assert inst.specialty[0].coding[0].code == \"47505003\"\n    assert inst.specialty[0].coding[0].display == \"Posttraumatic stress disorder\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"394913002\"\n    assert inst.type[0].coding[0].display == \"Psychotherapy\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.type[1].coding[0].code == \"394587001\"\n    assert inst.type[1].coding[0].display == \"Psychiatry\"\n    assert (\n        inst.type[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_healthcareservice_1(base_settings):\n    \"\"\"No. 1 tests collection for HealthcareService.\n    Test File: healthcareservice-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"healthcareservice-example.json\"\n    inst = healthcareservice.HealthcareService.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"HealthcareService\" == inst.get_resource_type()\n\n    impl_healthcareservice_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"HealthcareService\" == data[\"resourceType\"]\n\n    inst2 = healthcareservice.HealthcareService(**data)\n    impl_healthcareservice_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_imagingselection.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImagingSelection\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import imagingselection\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_imagingselection_1(inst):\n    assert inst.code.text == \"Observation within a DICOM SR\"\n    assert (\n        inst.derivedFrom[0].identifier.system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert (\n        inst.derivedFrom[0].identifier.value\n        == \"urn:oid:1.2.840.113747.20080222.95946072916364657859950275\"\n    )\n    assert (\n        inst.derivedFrom[0].type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"ImagingStudy\"}).valueUri\n    )\n    assert inst.focus[0].reference == \"ImagingSelection/example-basic-image-selection\"\n    assert (\n        inst.frameOfReferenceUid\n        == \"1.2.840.113747.20080222.95946058736364657859950275.0\"\n    )\n    assert inst.id == \"example-dicom-sr-selection\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[0].value == (\n        \"urn:oid:1.2.840.113747.20080222.95946059916364657859950275.2\" \".1\"\n    )\n    assert inst.instance[0].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.88.22\"\n    assert (\n        inst.instance[0].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.instance[0].subset[0] == (\n        \"1.2.840.113747.20080222.95946058738699434572916359950275.10.\" \"1\"\n    )\n    assert (\n        inst.instance[0].uid == \"1.2.840.113747.20080222.95946058738699434359950275.1.0\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.seriesUid == \"1.2.840.113747.20080222.95946058738664657859950275.1\"\n    assert inst.status == \"available\"\n    assert inst.studyUid == \"1.2.840.113747.20080222.95946058738694657859950275\"\n    assert (\n        inst.subject.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fhirhospital.org\"}\n        ).valueUri\n    )\n    assert inst.subject.identifier.value == \"RNKZPSBNZLNADAZV\"\n    assert (\n        inst.subject.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_imagingselection_1(base_settings):\n    \"\"\"No. 1 tests collection for ImagingSelection.\n    Test File: imagingselection-example-dicom-sr-selection.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"imagingselection-example-dicom-sr-selection.json\"\n    )\n    inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes())\n    assert \"ImagingSelection\" == inst.get_resource_type()\n\n    impl_imagingselection_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImagingSelection\" == data[\"resourceType\"]\n\n    inst2 = imagingselection.ImagingSelection(**data)\n    impl_imagingselection_1(inst2)\n\n\ndef impl_imagingselection_2(inst):\n    assert inst.code.text == \"Key Frames\"\n    assert (\n        inst.derivedFrom[0].identifier.system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.derivedFrom[0].identifier.value == (\n        \"urn:oid:1.2.840.113747.20080222.3077658758893509802450245542\" \"21747\"\n    )\n    assert (\n        inst.derivedFrom[0].type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"ImagingStudy\"}).valueUri\n    )\n    assert (\n        inst.frameOfReferenceUid\n        == \"1.2.840.113747.20080222.307765875869350980245024554221747.0\"\n    )\n    assert inst.id == \"example-multiframe-image-selection\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[0].value == (\n        \"urn:oid:1.2.840.113747.20080222.3077658758693009802450245542\" \"21747.2.1\"\n    )\n    assert inst.instance[0].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.2.1\"\n    assert (\n        inst.instance[0].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.instance[0].subset[0] == \"1\"\n    assert inst.instance[0].subset[1] == \"2\"\n    assert inst.instance[0].subset[2] == \"3\"\n    assert inst.instance[0].subset[3] == \"4\"\n    assert inst.instance[0].uid == (\n        \"1.2.840.113747.20080222.307765875869300489355024554221747.1.\" \"0\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.seriesUid == \"1.2.840.113747.20080222.307765875869300489245024554221747.1\"\n    )\n    assert inst.status == \"available\"\n    assert inst.studyUid == \"1.2.840.113747.20080222.307765875869300489345024554221747\"\n    assert (\n        inst.subject.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fhirhospital.org\"}\n        ).valueUri\n    )\n    assert inst.subject.identifier.value == \"MNSOIISABIDCHRCY\"\n    assert (\n        inst.subject.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_imagingselection_2(base_settings):\n    \"\"\"No. 2 tests collection for ImagingSelection.\n    Test File: imagingselection-example-multiframe-image-selection.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"imagingselection-example-multiframe-image-selection.json\"\n    )\n    inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes())\n    assert \"ImagingSelection\" == inst.get_resource_type()\n\n    impl_imagingselection_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImagingSelection\" == data[\"resourceType\"]\n\n    inst2 = imagingselection.ImagingSelection(**data)\n    impl_imagingselection_2(inst2)\n\n\ndef impl_imagingselection_3(inst):\n    assert inst.code.text == \"Segment within a DICOM Segmentation instance\"\n    assert (\n        inst.derivedFrom[0].identifier.system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.derivedFrom[0].identifier.value == (\n        \"urn:oid:1.2.840.113747.20080222.2340823325925226669316502208\" \"11572\"\n    )\n    assert (\n        inst.derivedFrom[0].type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"ImagingStudy\"}).valueUri\n    )\n    assert (\n        inst.frameOfReferenceUid\n        == \"1.2.840.113747.20080222.234082332589842666931650220811572.0\"\n    )\n    assert inst.id == \"example-segmentation-image-selection\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[0].value == (\n        \"urn:oid:1.2.840.113747.20080222.2340823325898426669316502208\" \"11572.2.1\"\n    )\n    assert inst.instance[0].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.66.4\"\n    assert (\n        inst.instance[0].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.instance[0].subset[0] == \"1\"\n    assert inst.instance[0].uid == (\n        \"1.2.840.113747.20080222.234082332589846992522666220811572.1.\" \"0\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.seriesUid == \"1.2.840.113747.20080222.234082332589846992931650220811572.1\"\n    )\n    assert inst.status == \"available\"\n    assert inst.studyUid == \"1.2.840.113747.20080222.234082332589846966931650220811572\"\n    assert (\n        inst.subject.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fhirhospital.org\"}\n        ).valueUri\n    )\n    assert inst.subject.identifier.value == \"ISRNEJAWJHZOTNBS\"\n    assert (\n        inst.subject.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_imagingselection_3(base_settings):\n    \"\"\"No. 3 tests collection for ImagingSelection.\n    Test File: imagingselection-example-segmentation-image-selection.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"imagingselection-example-segmentation-image-selection.json\"\n    )\n    inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes())\n    assert \"ImagingSelection\" == inst.get_resource_type()\n\n    impl_imagingselection_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImagingSelection\" == data[\"resourceType\"]\n\n    inst2 = imagingselection.ImagingSelection(**data)\n    impl_imagingselection_3(inst2)\n\n\ndef impl_imagingselection_4(inst):\n    assert inst.code.text == \"Key Images\"\n    assert (\n        inst.derivedFrom[0].identifier.system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.derivedFrom[0].identifier.value == (\n        \"urn:oid:1.2.840.113747.20080222.3573835837292430627041253878\" \"3781\"\n    )\n    assert (\n        inst.derivedFrom[0].type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"ImagingStudy\"}).valueUri\n    )\n    assert (\n        inst.frameOfReferenceUid\n        == \"1.2.840.113747.20080222.35738168372924306270412538783781.0\"\n    )\n    assert inst.id == \"example-basic-image-selection\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[0].value == (\n        \"urn:oid:1.2.840.113747.20080222.3573816737292430627041253878\" \"3781.2.1\"\n    )\n    assert inst.instance[0].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.2\"\n    assert (\n        inst.instance[0].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.instance[0].uid\n        == \"1.2.840.113747.20080222.35738167368358372924412538783781.1.0\"\n    )\n    assert inst.instance[1].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.2\"\n    assert (\n        inst.instance[1].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.instance[1].uid\n        == \"1.2.840.113747.20080222.35738167368358372920412538783781.1.1\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.seriesUid == \"1.2.840.113747.20080222.35738167368358376270412538783781.1\"\n    )\n    assert inst.status == \"available\"\n    assert inst.studyUid == \"1.2.840.113747.20080222.35738167368354306270412538783781\"\n    assert (\n        inst.subject.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fhirhospital.org\"}\n        ).valueUri\n    )\n    assert inst.subject.identifier.value == \"KUTGIQCVCDRHVBUK\"\n    assert (\n        inst.subject.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_imagingselection_4(base_settings):\n    \"\"\"No. 4 tests collection for ImagingSelection.\n    Test File: imagingselection-example-basic-image-selection.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"imagingselection-example-basic-image-selection.json\"\n    )\n    inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes())\n    assert \"ImagingSelection\" == inst.get_resource_type()\n\n    impl_imagingselection_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImagingSelection\" == data[\"resourceType\"]\n\n    inst2 = imagingselection.ImagingSelection(**data)\n    impl_imagingselection_4(inst2)\n\n\ndef impl_imagingselection_5(inst):\n    assert inst.code.text == \"Referenced DICOM Grayscale Softcopy Presentation State\"\n    assert (\n        inst.derivedFrom[0].identifier.system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.derivedFrom[0].identifier.value == (\n        \"urn:oid:1.2.840.113747.20080222.1041207392912890031639036314\" \"39818\"\n    )\n    assert (\n        inst.derivedFrom[0].type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"ImagingStudy\"}).valueUri\n    )\n    assert inst.focus[0].reference == \"ImagingSelection/example-basic-image-selection\"\n    assert (\n        inst.frameOfReferenceUid\n        == \"1.2.840.113747.20080222.104120739293289003163903631439818.0\"\n    )\n    assert inst.id == \"example-presentation-state-selection\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[0].value == (\n        \"urn:oid:1.2.840.113747.20080222.1041207392938361511639036314\" \"39818.2.1\"\n    )\n    assert inst.instance[0].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.11.1\"\n    assert (\n        inst.instance[0].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.instance[0].uid == (\n        \"1.2.840.113747.20080222.104120739293836151289903631439818.1.\" \"0\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.seriesUid == \"1.2.840.113747.20080222.104120739293836151283903631439818.1\"\n    )\n    assert inst.status == \"available\"\n    assert inst.studyUid == \"1.2.840.113747.20080222.104120739293836153163903631439818\"\n    assert (\n        inst.subject.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fhirhospital.org\"}\n        ).valueUri\n    )\n    assert inst.subject.identifier.value == \"WMQVWGBPNPQHAWCO\"\n    assert (\n        inst.subject.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_imagingselection_5(base_settings):\n    \"\"\"No. 5 tests collection for ImagingSelection.\n    Test File: imagingselection-example-presentation-state-selection.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"imagingselection-example-presentation-state-selection.json\"\n    )\n    inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes())\n    assert \"ImagingSelection\" == inst.get_resource_type()\n\n    impl_imagingselection_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImagingSelection\" == data[\"resourceType\"]\n\n    inst2 = imagingselection.ImagingSelection(**data)\n    impl_imagingselection_5(inst2)\n\n\ndef impl_imagingselection_6(inst):\n    assert inst.code.text == \"Region selected from multiframe CT volume\"\n    assert (\n        inst.derivedFrom[0].identifier.system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.derivedFrom[0].identifier.value == (\n        \"urn:oid:1.2.840.113747.20080222.1899142719569233292660249885\" \"86343\"\n    )\n    assert (\n        inst.derivedFrom[0].type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"ImagingStudy\"}).valueUri\n    )\n    assert (\n        inst.frameOfReferenceUid\n        == \"1.2.840.113747.20080222.189914270656923329266024988586343.0\"\n    )\n    assert inst.id == \"example-3d-image-region-selection\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[0].value == (\n        \"urn:oid:1.2.840.113747.20080222.1899142719348233292660249885\" \"86343.2.1\"\n    )\n    assert float(inst.instance[0].imageRegion3D[0].coordinate[0]) == float(-50.0)\n    assert float(inst.instance[0].imageRegion3D[0].coordinate[1]) == float(-50.0)\n    assert float(inst.instance[0].imageRegion3D[0].coordinate[2]) == float(-50.0)\n    assert float(inst.instance[0].imageRegion3D[0].coordinate[3]) == float(50.0)\n    assert float(inst.instance[0].imageRegion3D[0].coordinate[4]) == float(50.0)\n    assert float(inst.instance[0].imageRegion3D[0].coordinate[5]) == float(50.0)\n    assert float(inst.instance[0].imageRegion3D[0].coordinate[6]) == float(25.0)\n    assert float(inst.instance[0].imageRegion3D[0].coordinate[7]) == float(-25.0)\n    assert float(inst.instance[0].imageRegion3D[0].coordinate[8]) == float(0.0)\n    assert float(inst.instance[0].imageRegion3D[0].coordinate[9]) == float(-25.0)\n    assert inst.instance[0].imageRegion3D[0].regionType == \"ellipse\"\n    assert inst.instance[0].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.2.1\"\n    assert (\n        inst.instance[0].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.instance[0].uid == (\n        \"1.2.840.113747.20080222.189914271934870656923024988586343.1.\" \"0\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.seriesUid == \"1.2.840.113747.20080222.189914271934870659266024988586343.1\"\n    )\n    assert inst.status == \"available\"\n    assert inst.studyUid == \"1.2.840.113747.20080222.189914271934870656966024988586343\"\n    assert (\n        inst.subject.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fhirhospital.org\"}\n        ).valueUri\n    )\n    assert inst.subject.identifier.value == \"PNWYPXNBXMPGMTWX\"\n    assert (\n        inst.subject.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_imagingselection_6(base_settings):\n    \"\"\"No. 6 tests collection for ImagingSelection.\n    Test File: imagingselection-example-3d-image-region-selection.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"imagingselection-example-3d-image-region-selection.json\"\n    )\n    inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes())\n    assert \"ImagingSelection\" == inst.get_resource_type()\n\n    impl_imagingselection_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImagingSelection\" == data[\"resourceType\"]\n\n    inst2 = imagingselection.ImagingSelection(**data)\n    impl_imagingselection_6(inst2)\n\n\ndef impl_imagingselection_7(inst):\n    assert inst.code.text == \"Region selected from image\"\n    assert (\n        inst.derivedFrom[0].identifier.system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert (\n        inst.derivedFrom[0].identifier.value\n        == \"1.2.840.113747.20080222.324856729726954657132726086516575\"\n    )\n    assert (\n        inst.derivedFrom[0].type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"ImagingStudy\"}).valueUri\n    )\n    assert (\n        inst.frameOfReferenceUid\n        == \"1.2.840.113747.20080222.324856823100954657132726086516575.0\"\n    )\n    assert inst.id == \"example-2d-image-region-selection\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[0].value == (\n        \"urn:oid:1.2.840.113747.20080222.3248567223100954657132726086\" \"516575.2.1\"\n    )\n    assert float(inst.instance[0].imageRegion2D[0].coordinate[0]) == float(0.25)\n    assert float(inst.instance[0].imageRegion2D[0].coordinate[1]) == float(0.25)\n    assert float(inst.instance[0].imageRegion2D[0].coordinate[2]) == float(0.75)\n    assert float(inst.instance[0].imageRegion2D[0].coordinate[3]) == float(0.25)\n    assert float(inst.instance[0].imageRegion2D[0].coordinate[4]) == float(0.75)\n    assert float(inst.instance[0].imageRegion2D[0].coordinate[5]) == float(0.75)\n    assert float(inst.instance[0].imageRegion2D[0].coordinate[6]) == float(0.25)\n    assert float(inst.instance[0].imageRegion2D[0].coordinate[7]) == float(0.75)\n    assert inst.instance[0].imageRegion2D[0].regionType == \"polyline\"\n    assert inst.instance[0].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.2\"\n    assert (\n        inst.instance[0].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.instance[0].uid == (\n        \"1.2.840.113747.20080222.324856729726823100132726086516575.1.\" \"0\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.seriesUid == \"1.2.840.113747.20080222.324856729726954657132726086516575.1\"\n    )\n    assert inst.status == \"available\"\n    assert inst.studyUid == \"1.2.840.113747.20080222.324856729726854657132726086516575\"\n    assert (\n        inst.subject.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fhirhospital.org\"}\n        ).valueUri\n    )\n    assert inst.subject.identifier.value == \"NTCGFHHKYUYKDPQX\"\n    assert (\n        inst.subject.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_imagingselection_7(base_settings):\n    \"\"\"No. 7 tests collection for ImagingSelection.\n    Test File: imagingselection-example-2d-image-region-selection.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"imagingselection-example-2d-image-region-selection.json\"\n    )\n    inst = imagingselection.ImagingSelection.model_validate_json(filename.read_bytes())\n    assert \"ImagingSelection\" == inst.get_resource_type()\n\n    impl_imagingselection_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImagingSelection\" == data[\"resourceType\"]\n\n    inst2 = imagingselection.ImagingSelection(**data)\n    impl_imagingselection_7(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_imagingstudy.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImagingStudy\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import imagingstudy\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_imagingstudy_1(inst):\n    assert (\n        inst.basedOn[0].identifier.assigner.reference\n        == \"Organization/dicom-organization\"\n    )\n    assert inst.basedOn[0].identifier.type.coding[0].code == \"ACSN\"\n    assert (\n        inst.basedOn[0].identifier.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.basedOn[0].identifier.value == \"W12342398\"\n    assert (\n        inst.basedOn[0].type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"ServiceRequest\"}\n        ).valueUri\n    )\n    assert inst.basedOn[1].reference == \"ServiceRequest/example\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.endpoint[0].reference == \"Endpoint/example-wadors\"\n    assert inst.id == \"example-xr\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == (\n        \"urn:oid:2.16.124.113543.6003.1154777499.30246.19789.35034300\" \"46\"\n    )\n    assert inst.identifier[1].assigner.reference == \"Organization/dicom-organization\"\n    assert inst.identifier[1].use == \"secondary\"\n    assert inst.identifier[1].value == \"55551234\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.modality[0].coding[0].code == \"DX\"\n    assert (\n        inst.modality[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"XR Wrist 3+ Views\"\n    assert inst.numberOfInstances == 2\n    assert inst.numberOfSeries == 1\n    assert inst.procedure[0].reference.reference == \"Procedure/example\"\n    assert inst.procedure[1].concept.coding[0].code == \"RPID2589\"\n    assert inst.procedure[1].concept.coding[0].display == \"XR Wrist 3+ Views\"\n    assert (\n        inst.procedure[1].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.radlex.org\"}\n        ).valueUri\n    )\n    assert inst.procedure[1].concept.text == \"XR Wrist 3+ Views\"\n    assert inst.reason[0].concept.coding[0].code == \"357009\"\n    assert (\n        inst.reason[0].concept.coding[0].display\n        == \"Closed fracture of trapezoidal bone of wrist\"\n    )\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.referrer.reference == \"Practitioner/example\"\n    assert inst.series[0].bodySite.concept.coding[0].code == \"T-15460\"\n    assert inst.series[0].bodySite.concept.coding[0].display == \"Wrist Joint\"\n    assert (\n        inst.series[0].bodySite.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.series[0].description == \"XR Wrist 3+ Views\"\n    assert inst.series[0].endpoint[0].reference == \"Endpoint/example-wadors\"\n    assert inst.series[0].instance[0].number == 1\n    assert (\n        inst.series[0].instance[0].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.2\"\n    )\n    assert (\n        inst.series[0].instance[0].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.series[0].instance[0].title == \"PA VIEW\"\n    assert (\n        inst.series[0].instance[0].uid\n        == \"2.16.124.113543.6003.1154777499.30246.19789.3503430045.1.1\"\n    )\n    assert inst.series[0].instance[1].number == 2\n    assert (\n        inst.series[0].instance[1].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.2\"\n    )\n    assert (\n        inst.series[0].instance[1].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.series[0].instance[1].title == \"LL VIEW\"\n    assert (\n        inst.series[0].instance[1].uid\n        == \"2.16.124.113543.6003.1154777499.30246.19789.3503430045.1.2\"\n    )\n    assert inst.series[0].laterality.coding[0].code == \"419161000\"\n    assert inst.series[0].laterality.coding[0].display == \"Unilateral left\"\n    assert (\n        inst.series[0].laterality.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.series[0].modality.coding[0].code == \"DX\"\n    assert (\n        inst.series[0].modality.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.series[0].number == 3\n    assert inst.series[0].numberOfInstances == 2\n    assert inst.series[0].performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.series[0].performer[0].function.coding[0].code == \"PRF\"\n    assert (\n        inst.series[0].performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert (\n        inst.series[0].started\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-01-01T11:01:20+03:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.series[0].uid == \"2.16.124.113543.6003.1154777499.30246.19789.3503430045.1\"\n    )\n    assert (\n        inst.started\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-01T11:01:20+03:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"available\"\n    assert inst.subject.reference == \"Patient/dicom\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_imagingstudy_1(base_settings):\n    \"\"\"No. 1 tests collection for ImagingStudy.\n    Test File: imagingstudy-example-xr.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"imagingstudy-example-xr.json\"\n    inst = imagingstudy.ImagingStudy.model_validate_json(filename.read_bytes())\n    assert \"ImagingStudy\" == inst.get_resource_type()\n\n    impl_imagingstudy_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImagingStudy\" == data[\"resourceType\"]\n\n    inst2 = imagingstudy.ImagingStudy(**data)\n    impl_imagingstudy_1(inst2)\n\n\ndef impl_imagingstudy_2(inst):\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"urn:dicom:uid\"}).valueUri\n    )\n    assert inst.identifier[0].value == (\n        \"urn:oid:2.16.124.113543.6003.1154777499.30246.19789.35034300\" \"45\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.numberOfInstances == 1\n    assert inst.numberOfSeries == 1\n    assert inst.series[0].bodySite.concept.coding[0].code == \"67734004\"\n    assert inst.series[0].bodySite.concept.coding[0].display == \"Upper Trunk Structure\"\n    assert (\n        inst.series[0].bodySite.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.series[0].description == \"CT Surview 180\"\n    assert inst.series[0].instance[0].number == 1\n    assert (\n        inst.series[0].instance[0].sopClass.code == \"urn:oid:1.2.840.10008.5.1.4.1.1.2\"\n    )\n    assert (\n        inst.series[0].instance[0].sopClass.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.series[0].instance[0].uid\n        == \"2.16.124.113543.6003.189642796.63084.16748.2599092903\"\n    )\n    assert inst.series[0].modality.coding[0].code == \"CT\"\n    assert (\n        inst.series[0].modality.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.series[0].number == 3\n    assert inst.series[0].numberOfInstances == 1\n    assert (\n        inst.series[0].uid == \"2.16.124.113543.6003.2588828330.45298.17418.2723805630\"\n    )\n    assert (\n        inst.started\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2011-01-01T11:01:20+03:00\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"available\"\n    assert inst.subject.reference == \"Patient/dicom\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">CT Chest.  John '\n        \"Smith (MRN: 09236). Accession: W12342398. Performed: \"\n        \"2011-01-01. 3 series, 12 images.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_imagingstudy_2(base_settings):\n    \"\"\"No. 2 tests collection for ImagingStudy.\n    Test File: imagingstudy-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"imagingstudy-example.json\"\n    inst = imagingstudy.ImagingStudy.model_validate_json(filename.read_bytes())\n    assert \"ImagingStudy\" == inst.get_resource_type()\n\n    impl_imagingstudy_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImagingStudy\" == data[\"resourceType\"]\n\n    inst2 = imagingstudy.ImagingStudy(**data)\n    impl_imagingstudy_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_immunization.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Immunization\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import immunization\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_immunization_1(inst):\n    assert inst.administeredProduct.concept.coding[0].code == \"70461-0321-03\"\n    assert (\n        inst.administeredProduct.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.6.69\"}\n        ).valueUri\n    )\n    assert inst.administeredProduct.concept.text == (\n        \"Flucelvax (Influenza, injectable, MDCK, preservative free, \" \"quadrivalent)\"\n    )\n    assert inst.doseQuantity.code == \"mg\"\n    assert (\n        inst.doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.doseQuantity.value) == float(5)\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.expirationDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-02-15\"}).valueDate\n    )\n    assert inst.fundingSource.coding[0].code == \"private\"\n    assert (\n        inst.fundingSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-funding-source\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.isSubpotent is True\n    assert inst.location.reference == \"Location/1\"\n    assert inst.lotNumber == \"AAJN11K\"\n    assert inst.manufacturer.reference.reference == \"Organization/hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Notes on adminstration of vaccine\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-10\"}\n        ).valueDateTime\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.performer[0].function.coding[0].code == \"OP\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.performer[1].actor.reference == \"Practitioner/example\"\n    assert inst.performer[1].function.coding[0].code == \"AP\"\n    assert (\n        inst.performer[1].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.primarySource is True\n    assert inst.programEligibility[0].program.text == \"VFC\"\n    assert inst.programEligibility[0].programStatus.coding[0].code == \"uninsured\"\n    assert (\n        inst.programEligibility[0].programStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-program-eligibility\"\n            }\n        ).valueUri\n    )\n    assert inst.reason[0].concept.coding[0].code == \"429060002\"\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.route.coding[0].code == \"IM\"\n    assert inst.route.coding[0].display == \"Injection, intramuscular\"\n    assert (\n        inst.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.site.coding[0].code == \"LA\"\n    assert inst.site.coding[0].display == \"left arm\"\n    assert (\n        inst.site.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActSite\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.text.status == \"generated\"\n    assert inst.vaccineCode.coding[0].code == \"FLUCEL VAX\"\n    assert (\n        inst.vaccineCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.36.1.2001.1005.17\"}\n        ).valueUri\n    )\n    assert inst.vaccineCode.text == \"Flucelvax (Influenza)\"\n\n\ndef test_immunization_1(base_settings):\n    \"\"\"No. 1 tests collection for Immunization.\n    Test File: immunization-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"immunization-example.json\"\n    inst = immunization.Immunization.model_validate_json(filename.read_bytes())\n    assert \"Immunization\" == inst.get_resource_type()\n\n    impl_immunization_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Immunization\" == data[\"resourceType\"]\n\n    inst2 = immunization.Immunization(**data)\n    impl_immunization_1(inst2)\n\n\ndef impl_immunization_2(inst):\n    assert inst.id == \"historical\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.informationSource.concept.coding[0].code == \"record\"\n    assert (\n        inst.informationSource.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-origin\"}\n        ).valueUri\n    )\n    assert inst.informationSource.concept.text == \"Written Record\"\n    assert inst.location.reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Notes on adminstration of a historical vaccine\"\n    assert inst.occurrenceString == \"January 2012\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.primarySource is False\n    assert inst.status == \"completed\"\n    assert inst.text.status == \"generated\"\n    assert inst.vaccineCode.coding[0].code == \"GNFLU\"\n    assert (\n        inst.vaccineCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.36.1.2001.1005.17\"}\n        ).valueUri\n    )\n    assert inst.vaccineCode.text == \"Influenza\"\n\n\ndef test_immunization_2(base_settings):\n    \"\"\"No. 2 tests collection for Immunization.\n    Test File: immunization-example-historical.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"immunization-example-historical.json\"\n    )\n    inst = immunization.Immunization.model_validate_json(filename.read_bytes())\n    assert \"Immunization\" == inst.get_resource_type()\n\n    impl_immunization_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Immunization\" == data[\"resourceType\"]\n\n    inst2 = immunization.Immunization(**data)\n    impl_immunization_2(inst2)\n\n\ndef impl_immunization_3(inst):\n    assert inst.doseQuantity.code == \"mg\"\n    assert (\n        inst.doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.doseQuantity.value) == float(5)\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.expirationDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2023-01-21\"}).valueDate\n    )\n    assert inst.id == \"reaction\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.isSubpotent is False\n    assert inst.location.reference == \"Location/1\"\n    assert inst.lotNumber == \"PPL909K\"\n    assert inst.manufacturer.reference.reference == \"Organization/hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Notes on adminstration of vaccine\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-09-12\"}\n        ).valueDateTime\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.performer[0].function.coding[0].code == \"OP\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.performer[1].actor.reference == \"Practitioner/example\"\n    assert inst.performer[1].function.coding[0].code == \"AP\"\n    assert (\n        inst.performer[1].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.primarySource is True\n    assert (\n        inst.reaction[0].date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-09-12\"}\n        ).valueDateTime\n    )\n    assert inst.reaction[0].manifestation.reference.reference == \"Observation/example2\"\n    assert inst.reaction[0].reported is False\n    assert inst.reason[0].reference.reference == \"Observation/example\"\n    assert inst.route.coding[0].code == \"IM\"\n    assert inst.route.coding[0].display == \"Injection, intramuscular\"\n    assert (\n        inst.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.site.coding[0].code == \"LA\"\n    assert inst.site.coding[0].display == \"left arm\"\n    assert (\n        inst.site.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActSite\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.text.status == \"generated\"\n    assert inst.vaccineCode.coding[0].code == \"175\"\n    assert (\n        inst.vaccineCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/cvx\"}\n        ).valueUri\n    )\n    assert inst.vaccineCode.text == \"Rabies - IM Diploid cell culture\"\n\n\ndef test_immunization_3(base_settings):\n    \"\"\"No. 3 tests collection for Immunization.\n    Test File: immunization-example-reaction.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"immunization-example-reaction.json\"\n    inst = immunization.Immunization.model_validate_json(filename.read_bytes())\n    assert \"Immunization\" == inst.get_resource_type()\n\n    impl_immunization_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Immunization\" == data[\"resourceType\"]\n\n    inst2 = immunization.Immunization(**data)\n    impl_immunization_3(inst2)\n\n\ndef impl_immunization_4(inst):\n    assert inst.doseQuantity.code == \"mg\"\n    assert (\n        inst.doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.doseQuantity.value) == float(5)\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.expirationDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2018-12-15\"}).valueDate\n    )\n    assert inst.fundingSource.coding[0].code == \"private\"\n    assert (\n        inst.fundingSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-funding-source\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"protocol\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.isSubpotent is False\n    assert inst.location.reference == \"Location/1\"\n    assert inst.lotNumber == \"PT123F\"\n    assert inst.manufacturer.reference.reference == \"Organization/hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-06-18\"}\n        ).valueDateTime\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.performer[0].function.coding[0].code == \"OP\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.performer[1].actor.reference == \"Practitioner/example\"\n    assert inst.performer[1].function.coding[0].code == \"AP\"\n    assert (\n        inst.performer[1].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.primarySource is True\n    assert inst.programEligibility[0].program.text == \"VFC\"\n    assert inst.programEligibility[0].programStatus.coding[0].code == \"ineligible\"\n    assert (\n        inst.programEligibility[0].programStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-program-eligibility\"\n            }\n        ).valueUri\n    )\n    assert inst.protocolApplied[0].doseNumber == \"1\"\n    assert inst.protocolApplied[0].series == \"2-dose\"\n    assert inst.protocolApplied[0].targetDisease[0].coding[0].code == \"40468003\"\n    assert (\n        inst.protocolApplied[0].targetDisease[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.protocolApplied[1].doseNumber == \"2\"\n    assert inst.protocolApplied[1].series == \"3-dose\"\n    assert inst.protocolApplied[1].seriesDoses == \"3\"\n    assert inst.protocolApplied[1].targetDisease[0].coding[0].code == \"66071002\"\n    assert (\n        inst.protocolApplied[1].targetDisease[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.route.coding[0].code == \"IM\"\n    assert inst.route.coding[0].display == \"Injection, intramuscular\"\n    assert (\n        inst.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.site.coding[0].code == \"LA\"\n    assert inst.site.coding[0].display == \"left arm\"\n    assert (\n        inst.site.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActSite\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.text.status == \"generated\"\n    assert inst.vaccineCode.coding[0].code == \"104\"\n    assert (\n        inst.vaccineCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/cvx\"}\n        ).valueUri\n    )\n    assert inst.vaccineCode.text == \"Twinrix (HepA/HepB)\"\n\n\ndef test_immunization_4(base_settings):\n    \"\"\"No. 4 tests collection for Immunization.\n    Test File: immunization-example-protocol.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"immunization-example-protocol.json\"\n    inst = immunization.Immunization.model_validate_json(filename.read_bytes())\n    assert \"Immunization\" == inst.get_resource_type()\n\n    impl_immunization_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Immunization\" == data[\"resourceType\"]\n\n    inst2 = immunization.Immunization(**data)\n    impl_immunization_4(inst2)\n\n\ndef impl_immunization_5(inst):\n    assert inst.id == \"notGiven\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-10\"}\n        ).valueDateTime\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.primarySource is True\n    assert inst.status == \"not-done\"\n    assert inst.statusReason.coding[0].code == \"MEDPREC\"\n    assert inst.statusReason.coding[0].display == \"medical precaution\"\n    assert (\n        inst.statusReason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.vaccineCode.coding[0].code == \"01\"\n    assert inst.vaccineCode.coding[0].display == \"DTP\"\n    assert (\n        inst.vaccineCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/cvx\"}\n        ).valueUri\n    )\n\n\ndef test_immunization_5(base_settings):\n    \"\"\"No. 5 tests collection for Immunization.\n    Test File: immunization-example-refused.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"immunization-example-refused.json\"\n    inst = immunization.Immunization.model_validate_json(filename.read_bytes())\n    assert \"Immunization\" == inst.get_resource_type()\n\n    impl_immunization_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Immunization\" == data[\"resourceType\"]\n\n    inst2 = immunization.Immunization(**data)\n    impl_immunization_5(inst2)\n\n\ndef impl_immunization_6(inst):\n    assert inst.doseQuantity.code == \"ml\"\n    assert (\n        inst.doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.doseQuantity.value) == float(0.5)\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.expirationDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2015-02-28\"}).valueDate\n    )\n    assert inst.fundingSource.coding[0].code == \"private\"\n    assert (\n        inst.fundingSource.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-funding-source\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"subpotent\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.isSubpotent is True\n    assert inst.location.reference == \"Location/1\"\n    assert inst.lotNumber == \"AAJN11K\"\n    assert inst.manufacturer.reference.reference == \"Organization/hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Notes on adminstration of vaccine\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.performer[0].function.coding[0].code == \"OP\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.performer[1].actor.reference == \"Practitioner/example\"\n    assert inst.performer[1].function.coding[0].code == \"AP\"\n    assert (\n        inst.performer[1].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0443\"}\n        ).valueUri\n    )\n    assert inst.primarySource is True\n    assert inst.programEligibility[0].program.text == \"VFC\"\n    assert inst.programEligibility[0].programStatus.coding[0].code == \"uninsured\"\n    assert (\n        inst.programEligibility[0].programStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-program-eligibility\"\n            }\n        ).valueUri\n    )\n    assert inst.route.coding[0].code == \"IM\"\n    assert inst.route.coding[0].display == \"Injection, intramuscular\"\n    assert (\n        inst.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.site.coding[0].code == \"LT\"\n    assert inst.site.coding[0].display == \"left thigh\"\n    assert (\n        inst.site.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActSite\"}\n        ).valueUri\n    )\n    assert inst.status == \"completed\"\n    assert inst.subpotentReason[0].coding[0].code == \"partialdose\"\n    assert (\n        inst.subpotentReason[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-subpotent-reason\"\n            }\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.vaccineCode.coding[0].code == \"GNHEP\"\n    assert (\n        inst.vaccineCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.36.1.2001.1005.17\"}\n        ).valueUri\n    )\n    assert inst.vaccineCode.text == \"Hepatitis B\"\n\n\ndef test_immunization_6(base_settings):\n    \"\"\"No. 6 tests collection for Immunization.\n    Test File: immunization-example-subpotent.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"immunization-example-subpotent.json\"\n    )\n    inst = immunization.Immunization.model_validate_json(filename.read_bytes())\n    assert \"Immunization\" == inst.get_resource_type()\n\n    impl_immunization_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Immunization\" == data[\"resourceType\"]\n\n    inst2 = immunization.Immunization(**data)\n    impl_immunization_6(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_immunizationevaluation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import immunizationevaluation\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_immunizationevaluation_1(inst):\n    assert inst.authority.reference == \"Organization/hl7\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-10\"}\n        ).valueDateTime\n    )\n    assert inst.doseNumber == \"1\"\n    assert inst.doseStatus.coding[0].code == \"valid\"\n    assert inst.doseStatus.coding[0].display == \"Valid\"\n    assert (\n        inst.doseStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.immunizationEvent.reference == \"Immunization/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.series == \"Vaccination Series 1\"\n    assert inst.seriesDoses == \"3\"\n    assert inst.status == \"completed\"\n    assert inst.targetDisease.coding[0].code == \"1857005\"\n    assert (\n        inst.targetDisease.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_immunizationevaluation_1(base_settings):\n    \"\"\"No. 1 tests collection for ImmunizationEvaluation.\n    Test File: immunizationevaluation-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"immunizationevaluation-example.json\"\n    )\n    inst = immunizationevaluation.ImmunizationEvaluation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ImmunizationEvaluation\" == inst.get_resource_type()\n\n    impl_immunizationevaluation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImmunizationEvaluation\" == data[\"resourceType\"]\n\n    inst2 = immunizationevaluation.ImmunizationEvaluation(**data)\n    impl_immunizationevaluation_1(inst2)\n\n\ndef impl_immunizationevaluation_2(inst):\n    assert inst.authority.reference == \"Organization/hl7\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-10\"}\n        ).valueDateTime\n    )\n    assert inst.doseStatus.coding[0].code == \"notvalid\"\n    assert inst.doseStatus.coding[0].display == \"Not Valid\"\n    assert (\n        inst.doseStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status\"\n            }\n        ).valueUri\n    )\n    assert inst.doseStatusReason[0].coding[0].code == \"outsideschedule\"\n    assert inst.doseStatusReason[0].coding[0].display == \"Outside Schedule\"\n    assert (\n        inst.doseStatusReason[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status-reason\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"notValid\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234\"\n    assert inst.immunizationEvent.reference == \"Immunization/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.series == \"Vaccination Series 1\"\n    assert inst.status == \"completed\"\n    assert inst.targetDisease.coding[0].code == \"1857005\"\n    assert (\n        inst.targetDisease.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_immunizationevaluation_2(base_settings):\n    \"\"\"No. 2 tests collection for ImmunizationEvaluation.\n    Test File: immunizationevaluation-example-notvalid.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"immunizationevaluation-example-notvalid.json\"\n    )\n    inst = immunizationevaluation.ImmunizationEvaluation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ImmunizationEvaluation\" == inst.get_resource_type()\n\n    impl_immunizationevaluation_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImmunizationEvaluation\" == data[\"resourceType\"]\n\n    inst2 = immunizationevaluation.ImmunizationEvaluation(**data)\n    impl_immunizationevaluation_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_immunizationrecommendation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import immunizationrecommendation\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_immunizationrecommendation_1(inst):\n    assert inst.authority.reference == \"Organization/hl7\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-09T11:04:15.817-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1235\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.recommendation[0].dateCriterion[0].code.coding[0].code == \"earliest\"\n    assert (\n        inst.recommendation[0].dateCriterion[0].code.coding[0].display\n        == \"Earliest Date\"\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[0].value\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-01T00:00:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.recommendation[0].dateCriterion[1].code.coding[0].code == \"recommended\"\n    assert (\n        inst.recommendation[0].dateCriterion[1].code.coding[0].display == \"Recommended\"\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[1].value\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-01T00:00:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.recommendation[0].dateCriterion[2].code.coding[0].code == \"overdue\"\n    assert (\n        inst.recommendation[0].dateCriterion[2].code.coding[0].display\n        == \"Past Due Date\"\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[2].value\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-12-28T00:00:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.recommendation[0].description == \"First sequence in protocol\"\n    assert inst.recommendation[0].doseNumber == \"1\"\n    assert inst.recommendation[0].forecastStatus.text == \"Not Complete\"\n    assert inst.recommendation[0].series == \"Vaccination Series 1\"\n    assert inst.recommendation[0].seriesDoses == \"3\"\n    assert (\n        inst.recommendation[0].supportingImmunization[0].reference\n        == \"Immunization/example\"\n    )\n    assert (\n        inst.recommendation[0].supportingPatientInformation[0].reference\n        == \"Observation/example\"\n    )\n    assert inst.recommendation[0].vaccineCode[0].coding[0].code == \"14745005\"\n    assert (\n        inst.recommendation[0].vaccineCode[0].coding[0].display == \"Hepatitis A vaccine\"\n    )\n    assert (\n        inst.recommendation[0].vaccineCode[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Authored by ' \"Joginder Madra</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_immunizationrecommendation_1(base_settings):\n    \"\"\"No. 1 tests collection for ImmunizationRecommendation.\n    Test File: immunizationrecommendation-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"immunizationrecommendation-example.json\"\n    )\n    inst = immunizationrecommendation.ImmunizationRecommendation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ImmunizationRecommendation\" == inst.get_resource_type()\n\n    impl_immunizationrecommendation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImmunizationRecommendation\" == data[\"resourceType\"]\n\n    inst2 = immunizationrecommendation.ImmunizationRecommendation(**data)\n    impl_immunizationrecommendation_1(inst2)\n\n\ndef impl_immunizationrecommendation_2(inst):\n    assert inst.authority.reference == \"Organization/hl7\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-09T11:04:15.817-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-target-disease\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1235\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.recommendation[0].dateCriterion[0].code.coding[0].code == \"30981-5\"\n    assert (\n        inst.recommendation[0].dateCriterion[0].code.coding[0].display\n        == \"Earliest date to give\"\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[0].value\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-01T00:00:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.recommendation[0].dateCriterion[1].code.coding[0].code == \"recommended\"\n    assert (\n        inst.recommendation[0].dateCriterion[1].code.coding[0].display == \"Recommended\"\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[1].value\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-12-01T00:00:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.recommendation[0].dateCriterion[2].code.coding[0].code == \"overdue\"\n    assert (\n        inst.recommendation[0].dateCriterion[2].code.coding[0].display\n        == \"Past Due Date\"\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.recommendation[0].dateCriterion[2].value\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-12-28T00:00:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.recommendation[0].description == \"First sequence in protocol\"\n    assert inst.recommendation[0].doseNumber == \"1\"\n    assert inst.recommendation[0].forecastStatus.text == \"Not Complete\"\n    assert inst.recommendation[0].series == \"Vaccination Series 1\"\n    assert inst.recommendation[0].seriesDoses == \"3\"\n    assert (\n        inst.recommendation[0].supportingImmunization[0].reference\n        == \"Immunization/example\"\n    )\n    assert (\n        inst.recommendation[0].supportingPatientInformation[0].reference\n        == \"Observation/example\"\n    )\n    assert inst.recommendation[0].targetDisease[0].coding[0].code == \"40468003\"\n    assert (\n        inst.recommendation[0].targetDisease[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Authored by ' \"Joginder Madra</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_immunizationrecommendation_2(base_settings):\n    \"\"\"No. 2 tests collection for ImmunizationRecommendation.\n    Test File: immunizationrecommendation-example-target-disease.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"immunizationrecommendation-example-target-disease.json\"\n    )\n    inst = immunizationrecommendation.ImmunizationRecommendation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ImmunizationRecommendation\" == inst.get_resource_type()\n\n    impl_immunizationrecommendation_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImmunizationRecommendation\" == data[\"resourceType\"]\n\n    inst2 = immunizationrecommendation.ImmunizationRecommendation(**data)\n    impl_immunizationrecommendation_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_implementationguide.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ImplementationGuide\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import implementationguide\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_implementationguide_1(inst):\n    assert inst.contact[0].name == \"ONC\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://www.healthit.gov\"\n    assert inst.contact[1].name == \"HL7\"\n    assert inst.contact[1].telecom[0].system == \"url\"\n    assert inst.contact[1].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.copyright == \"Published by ONC under the standard FHIR license (CC0)\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.definition.grouping[0].description\n        == \"Base package (not broken up into multiple packages)\"\n    )\n    assert inst.definition.grouping[0].name == \"test\"\n    assert inst.definition.page.generation == \"html\"\n    assert (\n        inst.definition.page.name\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"patient-example.html\"}\n        ).valueUrl\n    )\n    assert inst.definition.page.page[0].generation == \"html\"\n    assert (\n        inst.definition.page.page[0].name\n        == ExternalValidatorModel.model_validate({\"valueUrl\": \"list.html\"}).valueUrl\n    )\n    assert inst.definition.page.page[0].title == \"Value Set Page\"\n    assert inst.definition.page.title == \"Example Patient Page\"\n    assert inst.definition.parameter[0].code.code == \"apply\"\n    assert (\n        inst.definition.parameter[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/guide-parameter-code\"}\n        ).valueUri\n    )\n    assert inst.definition.parameter[0].value == \"version\"\n    assert (\n        inst.definition.resource[0].description\n        == \"A test example to show how an implementation guide works\"\n    )\n    assert inst.definition.resource[0].name == \"Test Example\"\n    assert (\n        inst.definition.resource[0].profile[0]\n        == \"http://hl7.org/fhir/us/core/StructureDefinition/patient\"\n    )\n    assert inst.definition.resource[0].reference.reference == \"Patient/test\"\n    assert inst.dependsOn[0].uri == \"http://hl7.org/fhir/ImplementationGuide/uscore\"\n    assert inst.experimental is False\n    assert inst.fhirVersion[0] == \"5.0.0\"\n    assert (\n        inst.global_fhir[0].profile\n        == \"http://hl7.org/fhir/us/core/StructureDefinition/patient\"\n    )\n    assert inst.global_fhir[0].type == \"Patient\"\n    assert inst.id == \"example\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.license == \"CC0-1.0\"\n    assert inst.manifest.image[0] == \"fhir.png\"\n    assert inst.manifest.other[0] == \"fhir.css\"\n    assert inst.manifest.page[0].anchor[0] == \"patient-example\"\n    assert inst.manifest.page[0].anchor[1] == \"tx\"\n    assert inst.manifest.page[0].anchor[2] == \"uml\"\n    assert inst.manifest.page[0].name == \"patient-example.html\"\n    assert inst.manifest.page[0].title == \"Test Patient Example\"\n    assert (\n        inst.manifest.rendering\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://hl7.org/fhir/us/daf\"}\n        ).valueUrl\n    )\n    assert (\n        inst.manifest.resource[0].profile[0]\n        == \"http://hl7.org/fhir/us/core/StructureDefinition/patient\"\n    )\n    assert inst.manifest.resource[0].reference.reference == \"Patient/test\"\n    assert (\n        inst.manifest.resource[0].relativePath\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"patient-example.html\"}\n        ).valueUrl\n    )\n    assert inst.name == \"DataAccessFrameworkDAF\"\n    assert inst.packageId == \"hl7.fhir.us.daf\"\n    assert inst.publisher == \"ONC / HL7 Joint project\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Data Access Framework (DAF)\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/us/daf\"}\n        ).valueUri\n    )\n    assert inst.version == \"0\"\n\n\ndef test_implementationguide_1(base_settings):\n    \"\"\"No. 1 tests collection for ImplementationGuide.\n    Test File: implementationguide-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"implementationguide-example.json\"\n    inst = implementationguide.ImplementationGuide.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ImplementationGuide\" == inst.get_resource_type()\n\n    impl_implementationguide_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ImplementationGuide\" == data[\"resourceType\"]\n\n    inst2 = implementationguide.ImplementationGuide(**data)\n    impl_implementationguide_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_ingredient.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Ingredient\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import ingredient\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_ingredient_1(inst):\n    assert inst.id == \"example\"\n    assert inst.manufacturer[0].manufacturer.reference == \"Organization/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.role.coding[0].code == \"ActiveBase\"\n    assert (\n        inst.role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/ingredientRole\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.substance.code.concept.coding[0].code == \"Wizzohaler\"\n    assert (\n        inst.substance.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/substance\"}\n        ).valueUri\n    )\n    assert inst.substance.strength[0].measurementPoint == \"2cm\"\n    assert (\n        inst.substance.strength[0].presentationRatio.denominator.code\n        == \"{delivered dose}\"\n    )\n    assert (\n        inst.substance.strength[0].presentationRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.substance.strength[0].presentationRatio.denominator.unit\n        == \"delivered dose\"\n    )\n    assert float(\n        inst.substance.strength[0].presentationRatio.denominator.value\n    ) == float(1)\n    assert inst.substance.strength[0].presentationRatio.numerator.code == \"ug\"\n    assert (\n        inst.substance.strength[0].presentationRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.substance.strength[0].presentationRatio.numerator.unit == \"mcg\"\n    assert float(inst.substance.strength[0].presentationRatio.numerator.value) == float(\n        730\n    )\n    assert inst.substance.strength[1].measurementPoint == \"5cm\"\n    assert (\n        inst.substance.strength[1].presentationRatio.denominator.code\n        == \"{delivered dose}\"\n    )\n    assert (\n        inst.substance.strength[1].presentationRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.substance.strength[1].presentationRatio.denominator.unit\n        == \"delivered dose\"\n    )\n    assert float(\n        inst.substance.strength[1].presentationRatio.denominator.value\n    ) == float(1)\n    assert inst.substance.strength[1].presentationRatio.numerator.code == \"ug\"\n    assert (\n        inst.substance.strength[1].presentationRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.substance.strength[1].presentationRatio.numerator.unit == \"mcg\"\n    assert float(inst.substance.strength[1].presentationRatio.numerator.value) == float(\n        460\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_ingredient_1(base_settings):\n    \"\"\"No. 1 tests collection for Ingredient.\n    Test File: ingredient-example-strength-repeat.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"ingredient-example-strength-repeat.json\"\n    )\n    inst = ingredient.Ingredient.model_validate_json(filename.read_bytes())\n    assert \"Ingredient\" == inst.get_resource_type()\n\n    impl_ingredient_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Ingredient\" == data[\"resourceType\"]\n\n    inst2 = ingredient.Ingredient(**data)\n    impl_ingredient_1(inst2)\n\n\ndef impl_ingredient_2(inst):\n    assert inst.id == \"example\"\n    assert inst.manufacturer[0].manufacturer.reference == \"Organization/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.role.coding[0].code == \"ActiveBase\"\n    assert (\n        inst.role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/ingredientRole\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.substance.code.concept.coding[0].code == \"EQUIXABAN\"\n    assert (\n        inst.substance.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/substance\"}\n        ).valueUri\n    )\n    assert inst.substance.strength[0].concentrationRatio.denominator.code == \"mg\"\n    assert (\n        inst.substance.strength[0].concentrationRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.substance.strength[0].concentrationRatio.denominator.unit == \"mg\"\n    assert float(\n        inst.substance.strength[0].concentrationRatio.denominator.value\n    ) == float(1)\n    assert inst.substance.strength[0].concentrationRatio.numerator.code == \"mg\"\n    assert (\n        inst.substance.strength[0].concentrationRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.substance.strength[0].concentrationRatio.numerator.unit == \"mg\"\n    assert float(\n        inst.substance.strength[0].concentrationRatio.numerator.value\n    ) == float(5)\n    assert inst.substance.strength[0].presentationRatio.denominator.code == \"{tablet}\"\n    assert (\n        inst.substance.strength[0].presentationRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.substance.strength[0].presentationRatio.denominator.unit == \"tablet\"\n    assert float(\n        inst.substance.strength[0].presentationRatio.denominator.value\n    ) == float(1)\n    assert inst.substance.strength[0].presentationRatio.numerator.code == \"mg\"\n    assert (\n        inst.substance.strength[0].presentationRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.substance.strength[0].presentationRatio.numerator.unit == \"mg\"\n    assert float(inst.substance.strength[0].presentationRatio.numerator.value) == float(\n        50\n    )\n    assert (\n        inst.substance.strength[0].referenceStrength[0].strengthRatio.denominator.code\n        == \"mg\"\n    )\n    assert (\n        inst.substance.strength[0].referenceStrength[0].strengthRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.substance.strength[0].referenceStrength[0].strengthRatio.denominator.unit\n        == \"mg\"\n    )\n    assert float(\n        inst.substance.strength[0].referenceStrength[0].strengthRatio.denominator.value\n    ) == float(1)\n    assert (\n        inst.substance.strength[0].referenceStrength[0].strengthRatio.numerator.code\n        == \"mg\"\n    )\n    assert (\n        inst.substance.strength[0].referenceStrength[0].strengthRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.substance.strength[0].referenceStrength[0].strengthRatio.numerator.unit\n        == \"mg\"\n    )\n    assert float(\n        inst.substance.strength[0].referenceStrength[0].strengthRatio.numerator.value\n    ) == float(5.03)\n    assert (\n        inst.substance.strength[0].referenceStrength[0].substance.concept.coding[0].code\n        == \"EQUIXABAN-SULPHATE\"\n    )\n    assert (\n        inst.substance.strength[0]\n        .referenceStrength[0]\n        .substance.concept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/substance\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_ingredient_2(base_settings):\n    \"\"\"No. 2 tests collection for Ingredient.\n    Test File: ingredient-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"ingredient-example.json\"\n    inst = ingredient.Ingredient.model_validate_json(filename.read_bytes())\n    assert \"Ingredient\" == inst.get_resource_type()\n\n    impl_ingredient_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Ingredient\" == data[\"resourceType\"]\n\n    inst2 = ingredient.Ingredient(**data)\n    impl_ingredient_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_insuranceplan.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/InsurancePlan\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import insuranceplan\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_insuranceplan_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"foo\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_insuranceplan_1(base_settings):\n    \"\"\"No. 1 tests collection for InsurancePlan.\n    Test File: insuranceplan-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"insuranceplan-example.json\"\n    inst = insuranceplan.InsurancePlan.model_validate_json(filename.read_bytes())\n    assert \"InsurancePlan\" == inst.get_resource_type()\n\n    impl_insuranceplan_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"InsurancePlan\" == data[\"resourceType\"]\n\n    inst2 = insuranceplan.InsurancePlan(**data)\n    impl_insuranceplan_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_inventoryitem.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/InventoryItem\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import inventoryitem\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_inventoryitem_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_inventoryitem_1(base_settings):\n    \"\"\"No. 1 tests collection for InventoryItem.\n    Test File: inventoryitem-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"inventoryitem-example.json\"\n    inst = inventoryitem.InventoryItem.model_validate_json(filename.read_bytes())\n    assert \"InventoryItem\" == inst.get_resource_type()\n\n    impl_inventoryitem_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"InventoryItem\" == data[\"resourceType\"]\n\n    inst2 = inventoryitem.InventoryItem(**data)\n    impl_inventoryitem_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_inventoryreport.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/InventoryReport\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import inventoryreport\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_inventoryreport_1(inst):\n    assert inst.countType == \"snapshot\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.reportedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-09-22\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_inventoryreport_1(base_settings):\n    \"\"\"No. 1 tests collection for InventoryReport.\n    Test File: inventoryreport-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"inventoryreport-example.json\"\n    inst = inventoryreport.InventoryReport.model_validate_json(filename.read_bytes())\n    assert \"InventoryReport\" == inst.get_resource_type()\n\n    impl_inventoryreport_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"InventoryReport\" == data[\"resourceType\"]\n\n    inst2 = inventoryreport.InventoryReport(**data)\n    impl_inventoryreport_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_invoice.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Invoice\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import invoice\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_invoice_1(inst):\n    assert inst.account.reference == \"Account/example\"\n    assert (\n        inst.creation\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-25T08:00:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://myHospital.org/Invoices\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"654321\"\n    assert (\n        inst.issuer.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://myhospital/NamingSystem/departments\"}\n        ).valueUri\n    )\n    assert inst.issuer.identifier.value == \"CARD_INTERMEDIATE_CARE\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.participant[0].actor.reference == \"Practitioner/example\"\n    assert inst.participant[0].role.coding[0].code == \"17561000\"\n    assert inst.participant[0].role.coding[0].display == \"Cardiologist\"\n    assert (\n        inst.participant[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.periodDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2017-01-25\"}).valueDate\n    )\n    assert inst.status == \"issued\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Example of ' \"Invoice</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.totalGross.currency == \"EUR\"\n    assert float(inst.totalGross.value) == float(48)\n    assert inst.totalNet.currency == \"EUR\"\n    assert float(inst.totalNet.value) == float(40)\n\n\ndef test_invoice_1(base_settings):\n    \"\"\"No. 1 tests collection for Invoice.\n    Test File: invoice-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"invoice-example.json\"\n    inst = invoice.Invoice.model_validate_json(filename.read_bytes())\n    assert \"Invoice\" == inst.get_resource_type()\n\n    impl_invoice_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Invoice\" == data[\"resourceType\"]\n\n    inst2 = invoice.Invoice(**data)\n    impl_invoice_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_library.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Library\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import library\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_library_1(inst):\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.content[0].contentType == \"application/xml\"\n    assert (\n        inst.content[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"elm/OMTK-modelinfo-0.1.0.xml\"}\n        ).valueUrl\n    )\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-05-05\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Opioid Management Terminology Knowledge Base Model \"\n        \"Definition for use in implementing CDC Opioid Prescribing \"\n        \"Guidelines.\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"omtk-modelinfo\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"OMTKModelInfo\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"OMTKModelInfo\"\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert inst.purpose == (\n        \"This library defines the Opioid Management Terminology \" \"Knowledge Base model\"\n    )\n    assert inst.status == \"active\"\n    assert inst.title == \"OMTK Model Info\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"model-definition\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/library-type\"}\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This library is used to resolve data elements in the Opioid \"\n        \"Management Terminology Knowledge Base model\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_library_1(base_settings):\n    \"\"\"No. 1 tests collection for Library.\n    Test File: library-omtk-modelinfo.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"library-omtk-modelinfo.json\"\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_1(inst2)\n\n\ndef impl_library_2(inst):\n    assert inst.content[0].contentType == \"text/cql\"\n    assert (\n        inst.content[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"library-hiv-indicators-content.cql\"}\n        ).valueUrl\n    )\n    assert inst.content[1].contentType == \"application/elm+xml\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-08-03\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"HIV Indicators Reporting Example\"\n    assert inst.experimental is True\n    assert inst.id == \"hiv-indicators\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.17.1\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ohie.org/Library/\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].value == \"hiv-indicators\"\n    assert inst.name == \"HIVIndicators\"\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://wiki.ihe.net/index.php/Aggregate_Data_Exchange_-_HIV\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.status == \"draft\"\n    assert inst.title == \"HIV Indicators\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert inst.type.coding[0].display == \"Logic Library\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/library-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ohie.org/Library/hiv-indicators\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.0.0\"\n\n\ndef test_library_2(base_settings):\n    \"\"\"No. 2 tests collection for Library.\n    Test File: library-hiv-indicators.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"library-hiv-indicators.json\"\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_2(inst2)\n\n\ndef impl_library_3(inst):\n    assert inst.content[0].contentType == \"application/xml\"\n    assert (\n        inst.content[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://cqlrepository.org/quick-modelinfo.xml\"}\n        ).valueUrl\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-07-08\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Model definition for the QUICK Logical Model\"\n    assert inst.id == \"library-quick-model-definition\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"QUICK\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"QUICKModelDefinition\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"QUICK Model Definition\"\n    assert inst.topic[0].text == \"QUICK\"\n    assert inst.type.coding[0].code == \"model-definition\"\n    assert inst.version == \"1.0.0\"\n\n\ndef test_library_3(base_settings):\n    \"\"\"No. 3 tests collection for Library.\n    Test File: library-quick-model-definition.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"library-quick-model-definition.json\"\n    )\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_3(inst2)\n\n\ndef impl_library_4(inst):\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.content[0].contentType == \"application/elm+xml\"\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert inst.dataRequirement[0].codeFilter[0].path == \"medicationCodeableConcept\"\n    assert (\n        inst.dataRequirement[0].codeFilter[0].valueSet\n        == \"http://example.org/fhir/ValueSet/benzodiazepines\"\n    )\n    assert inst.dataRequirement[0].type == \"MedicationRequest\"\n    assert inst.dataRequirement[1].codeFilter[0].path == \"medicationCodeableConcept\"\n    assert inst.dataRequirement[1].codeFilter[0].valueSet == (\n        \"http://example.org/fhir/ValueSet/opioids-abused-in-\" \"ambulatory-care\"\n    )\n    assert inst.dataRequirement[1].type == \"MedicationRequest\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-25T13:49:09-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Opioid decision support logic to avoid prescribing opioid \"\n        \"pain medication and benzodiazepines concurrently whenever \"\n        \"possible.\"\n    )\n    assert inst.experimental is False\n    assert inst.id == \"opioidcds-recommendation-11\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"OpioidCDS_REC_11\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"OpioidCDSLogicForRecommendation11\"\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert inst.purpose == (\n        \"The purpose of this library is to determine whether opioid \"\n        \"pain medication and benzodiazepines have been prescribed \"\n        \"concurrently.\"\n    )\n    assert (\n        inst.relatedArtifact[0].display\n        == \"CDC guideline for prescribing opioids for chronic pain\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://example.org/fhir/Library/opioidcds-common\"\n    )\n    assert inst.relatedArtifact[1].type == \"depends-on\"\n    assert inst.status == \"active\"\n    assert inst.title == \"Opioid CDS Logic for recommendation #11\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert inst.type.coding[0].display == \"Logic Library\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/library-type\"}\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This library is used to notify the prescriber/user to avoid \"\n        \"prescribing opioid pain medication and benzodiazepines \"\n        \"concurrently.\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_library_4(base_settings):\n    \"\"\"No. 4 tests collection for Library.\n    Test File: library-opioidcds-recommendation-11.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"library-opioidcds-recommendation-11.json\"\n    )\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_4(inst2)\n\n\ndef impl_library_5(inst):\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.content[0].contentType == \"application/elm+xml\"\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert inst.dataRequirement[0].codeFilter[0].path == \"medicationCodeableConcept\"\n    assert inst.dataRequirement[0].codeFilter[0].valueSet == (\n        \"http://example.org/fhir/ValueSet/opioids-indicating-end-of-\" \"life\"\n    )\n    assert inst.dataRequirement[0].type == \"MedicationRequest\"\n    assert inst.dataRequirement[1].codeFilter[0].path == \"code\"\n    assert inst.dataRequirement[1].type == \"Procedure\"\n    assert inst.dataRequirement[2].codeFilter[0].path == \"code\"\n    assert inst.dataRequirement[2].type == \"Procedure\"\n    assert inst.dataRequirement[3].codeFilter[0].path == \"medicationCodeableConcept\"\n    assert inst.dataRequirement[3].codeFilter[0].valueSet == (\n        \"http://example.org/fhir/ValueSet/opioids-abused-in-\" \"ambulatory-care\"\n    )\n    assert inst.dataRequirement[3].type == \"MedicationRequest\"\n    assert inst.dataRequirement[4].type == \"Encounter\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-25T13:49:09-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"opioidcds-recommendation-07\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"OpioidCDS_REC_07\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"OpioidCDSLogicForRecommendation7\"\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert inst.purpose == (\n        \"The purpose of this library is to determine whether the \"\n        \"patient has been evaluated for benefits and harms within 1 \"\n        \"to 4 weeks of starting opioid therapy and every 3 months or \"\n        \"more subsequently.\"\n    )\n    assert (\n        inst.relatedArtifact[0].display\n        == \"CDC guideline for prescribing opioids for chronic pain\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://example.org/fhir/Library/opioidcds-common\"\n    )\n    assert inst.relatedArtifact[1].type == \"depends-on\"\n    assert inst.status == \"active\"\n    assert inst.title == \"Opioid CDS Logic for recommendation #7\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert inst.type.coding[0].display == \"Logic Library\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/library-type\"}\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This library is used to notify the prescriber/user whether \"\n        \"an evaluation for benefits and harms associated with opioid \"\n        \"therapy is recommended for the patient.\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_library_5(base_settings):\n    \"\"\"No. 5 tests collection for Library.\n    Test File: library-opioidcds-recommendation-07.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"library-opioidcds-recommendation-07.json\"\n    )\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_5(inst2)\n\n\ndef impl_library_6(inst):\n    assert inst.content[0].contentType == \"application/xml\"\n    assert (\n        inst.content[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://cqlrepository.org/fhirmodel-modelinfo.xml\"}\n        ).valueUrl\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-07-08\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Model definition for the FHIR Model\"\n    assert inst.id == \"library-fhir-model-definition\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"FHIR\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"FHIRModelDefinition\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"FHIR Model Definition\"\n    assert inst.topic[0].text == \"FHIR\"\n    assert inst.type.coding[0].code == \"model-definition\"\n    assert inst.version == \"5.0.0\"\n\n\ndef test_library_6(base_settings):\n    \"\"\"No. 6 tests collection for Library.\n    Test File: library-fhir-model-definition.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"library-fhir-model-definition.json\"\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_6(inst2)\n\n\ndef impl_library_7(inst):\n    assert inst.content[0].contentType == \"text/cql\"\n    assert inst.content[0].title == \"FHIR Helpers\"\n    assert (\n        inst.content[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"library-fhir-helpers-content.cql\"}\n        ).valueUrl\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-14\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"FHIR Helpers\"\n    assert inst.experimental is True\n    assert inst.id == \"library-fhir-helpers-predecessor\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"FHIRHelpers\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"FHIRHelpers\"\n    assert (\n        inst.relatedArtifact[0].resource\n        == \"http://example.org/fhir/Library/fhir-model-definition\"\n    )\n    assert inst.relatedArtifact[0].type == \"depends-on\"\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://example.org/fhir/Library/library-fhir-helpers\"\n    )\n    assert inst.relatedArtifact[1].type == \"successor\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"FHIR Helpers\"\n    assert inst.topic[0].text == \"FHIR Helpers\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert inst.version == \"1.6\"\n\n\ndef test_library_7(base_settings):\n    \"\"\"No. 7 tests collection for Library.\n    Test File: library-predecessor-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"library-predecessor-example.json\"\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_7(inst2)\n\n\ndef impl_library_8(inst):\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.content[0].contentType == \"application/elm+xml\"\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert inst.dataRequirement[0].codeFilter[0].path == \"medicationCodeableConcept\"\n    assert inst.dataRequirement[0].codeFilter[0].valueSet == (\n        \"http://example.org/fhir/ValueSet/opioids-indicating-end-of-\" \"life\"\n    )\n    assert inst.dataRequirement[0].type == \"MedicationRequest\"\n    assert inst.dataRequirement[1].codeFilter[0].path == \"medicationCodeableConcept\"\n    assert inst.dataRequirement[1].codeFilter[0].valueSet == (\n        \"http://example.org/fhir/ValueSet/opioids-abused-in-\" \"ambulatory-care\"\n    )\n    assert inst.dataRequirement[1].type == \"MedicationRequest\"\n    assert inst.dataRequirement[2].codeFilter[0].path == \"combo-code\"\n    assert inst.dataRequirement[2].codeFilter[0].valueSet == (\n        \"http://example.org/fhir/ValueSet/illicit-drug-urine-\" \"screening\"\n    )\n    assert inst.dataRequirement[2].type == \"Observation\"\n    assert inst.dataRequirement[3].codeFilter[0].path == \"combo-code\"\n    assert (\n        inst.dataRequirement[3].codeFilter[0].valueSet\n        == \"http://example.org/fhir/ValueSet/opioid-urine-screening\"\n    )\n    assert inst.dataRequirement[3].type == \"Observation\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-25T13:49:09-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Opioid decision support logic to evaluate whether the \"\n        \"patient has had a urine screening in the past 12 months and \"\n        \"provide analysis.\"\n    )\n    assert inst.experimental is False\n    assert inst.id == \"opioidcds-recommendation-10\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"OpioidCDS_REC_10\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"OpioidCDSLogicForRecommendation10\"\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert (\n        inst.relatedArtifact[0].display\n        == \"CDC guideline for prescribing opioids for chronic pain\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://example.org/fhir/Library/opioidcds-common\"\n    )\n    assert inst.relatedArtifact[1].type == \"depends-on\"\n    assert inst.status == \"active\"\n    assert inst.title == \"Opioid CDS Logic for recommendation #10\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert inst.type.coding[0].display == \"Logic Library\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/library-type\"}\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This library is used to notify the prescriber/user whether \"\n        \"the patient has had a urine screening in the past 12 months \"\n        \"and to provide analysis if true.\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_library_8(base_settings):\n    \"\"\"No. 8 tests collection for Library.\n    Test File: library-opioidcds-recommendation-10.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"library-opioidcds-recommendation-10.json\"\n    )\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_8(inst2)\n\n\ndef impl_library_9(inst):\n    assert inst.content[0].contentType == \"text/cql\"\n    assert inst.content[1].contentType == \"application/elm+xml\"\n    assert inst.dataRequirement[0].type == \"Patient\"\n    assert inst.dataRequirement[1].codeFilter[0].code[0].code == \"diagnosis\"\n    assert inst.dataRequirement[1].codeFilter[0].path == \"category\"\n    assert inst.dataRequirement[1].codeFilter[1].code[0].code == \"confirmed\"\n    assert inst.dataRequirement[1].codeFilter[1].path == \"clinicalStatus\"\n    assert inst.dataRequirement[1].codeFilter[2].path == \"code\"\n    assert (\n        inst.dataRequirement[1].codeFilter[2].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.102.12.1011\"\n    )\n    assert inst.dataRequirement[1].type == \"Condition\"\n    assert inst.dataRequirement[2].codeFilter[0].code[0].code == \"diagnosis\"\n    assert inst.dataRequirement[2].codeFilter[0].path == \"category\"\n    assert inst.dataRequirement[2].codeFilter[1].code[0].code == \"confirmed\"\n    assert inst.dataRequirement[2].codeFilter[1].path == \"clinicalStatus\"\n    assert inst.dataRequirement[2].codeFilter[2].path == \"code\"\n    assert (\n        inst.dataRequirement[2].codeFilter[2].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.102.12.1012\"\n    )\n    assert inst.dataRequirement[2].type == \"Condition\"\n    assert inst.dataRequirement[3].codeFilter[0].code[0].code == \"finished\"\n    assert inst.dataRequirement[3].codeFilter[0].path == \"status\"\n    assert inst.dataRequirement[3].codeFilter[1].code[0].code == \"ambulatory\"\n    assert inst.dataRequirement[3].codeFilter[1].path == \"class\"\n    assert inst.dataRequirement[3].codeFilter[2].path == \"type\"\n    assert (\n        inst.dataRequirement[3].codeFilter[2].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.101.12.1061\"\n    )\n    assert inst.dataRequirement[3].type == \"Encounter\"\n    assert inst.dataRequirement[4].codeFilter[0].path == \"diagnosis\"\n    assert (\n        inst.dataRequirement[4].codeFilter[0].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.198.12.1012\"\n    )\n    assert inst.dataRequirement[4].type == \"DiagnosticReport\"\n    assert inst.dataRequirement[5].codeFilter[0].path == \"code\"\n    assert (\n        inst.dataRequirement[5].codeFilter[0].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001\"\n    )\n    assert inst.dataRequirement[5].type == \"Medication\"\n    assert inst.dataRequirement[6].codeFilter[0].code[0].code == \"active\"\n    assert inst.dataRequirement[6].codeFilter[0].path == \"status\"\n    assert inst.dataRequirement[6].codeFilter[1].path == \"medication.code\"\n    assert (\n        inst.dataRequirement[6].codeFilter[1].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001\"\n    )\n    assert inst.dataRequirement[6].type == \"MedicationRequest\"\n    assert inst.dataRequirement[7].codeFilter[0].code[0].code == \"completed\"\n    assert inst.dataRequirement[7].codeFilter[0].path == \"status\"\n    assert inst.dataRequirement[7].codeFilter[1].path == \"medication.code\"\n    assert (\n        inst.dataRequirement[7].codeFilter[1].valueSet\n        == \"urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001\"\n    )\n    assert inst.dataRequirement[7].type == \"MedicationStatement\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-07-22\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Logic for CMS 146: Appropriate Testing for Children with \" \"Pharyngitis\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"library-cms146-example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.17.2\"\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"CMS146\"\n    assert inst.name == \"CMS146\"\n    assert (\n        inst.relatedArtifact[0].resource\n        == \"http://hl7.org/fhir/Library/library-quick-model-definition\"\n    )\n    assert inst.relatedArtifact[0].type == \"depends-on\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"CMS146: Appropriate Testing for Children with Pharyngitis\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Library/library-cms146-example\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_library_9(base_settings):\n    \"\"\"No. 9 tests collection for Library.\n    Test File: library-cms146-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"library-cms146-example.json\"\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_9(inst2)\n\n\ndef impl_library_10(inst):\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.content[0].contentType == \"application/elm+xml\"\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert inst.dataRequirement[0].codeFilter[0].code[0].code == \"active\"\n    assert inst.dataRequirement[0].codeFilter[0].path == \"status\"\n    assert inst.dataRequirement[0].codeFilter[1].code[0].code == \"outpatient\"\n    assert (\n        inst.dataRequirement[0].codeFilter[1].code[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/medicationrequest-category\"\n            }\n        ).valueUri\n    )\n    assert inst.dataRequirement[0].codeFilter[1].path == \"category\"\n    assert inst.dataRequirement[0].id == \"medications\"\n    assert inst.dataRequirement[0].type == \"MedicationRequest\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-25T13:49:09-06:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Opioid Decision Support Logic for use in implementing CDC \"\n        \"Opioid Prescribing Guidelines.\"\n    )\n    assert inst.experimental is False\n    assert inst.id == \"opioidcds-recommendation-05\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"OpioidCDS_REC_05\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"OpioidCDSLogicForRecommendation5\"\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert inst.purpose == (\n        \"This library works in concert with the OMTK logic library to\"\n        \" provide decision support for Morphine Milligram Equivalence\"\n        \" calculations and dynamic value resolution.\"\n    )\n    assert (\n        inst.relatedArtifact[0].display\n        == \"CDC guideline for prescribing opioids for chronic pain\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://example.org/fhir/Library/opioidcds-common\"\n    )\n    assert inst.relatedArtifact[1].type == \"depends-on\"\n    assert inst.relatedArtifact[2].display == \"MME Conversion Tables\"\n    assert (\n        inst.relatedArtifact[2].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[2].type == \"documentation\"\n    assert inst.status == \"active\"\n    assert inst.title == \"Opioid CDS Logic for recommendation #5\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"logic-library\"\n    assert inst.type.coding[0].display == \"Logic Library\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/library-type\"}\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This library is to notify the prescriber/user whether the \"\n        \"current prescription exceeds the recommended MME.\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_library_10(base_settings):\n    \"\"\"No. 10 tests collection for Library.\n    Test File: library-opioidcds-recommendation-05.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"library-opioidcds-recommendation-05.json\"\n    )\n    inst = library.Library.model_validate_json(filename.read_bytes())\n    assert \"Library\" == inst.get_resource_type()\n\n    impl_library_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Library\" == data[\"resourceType\"]\n\n    inst2 = library.Library(**data)\n    impl_library_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_linkage.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Linkage\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import linkage\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_linkage_1(inst):\n    assert inst.author.reference == \"Practitioner/f201\"\n    assert inst.id == \"example\"\n    assert (\n        inst.item[0].resource.display == \"Severe burn of left ear (Date: 24-May 2012)\"\n    )\n    assert inst.item[0].resource.reference == \"Condition/example\"\n    assert inst.item[0].type == \"source\"\n    assert (\n        inst.item[1].resource.display == \"Severe burn of left ear (Date: 24-May 2012)\"\n    )\n    assert inst.item[1].resource.reference == \"Condition/example-linkage\"\n    assert inst.item[1].type == \"alternate\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"extensions\"\n\n\ndef test_linkage_1(base_settings):\n    \"\"\"No. 1 tests collection for Linkage.\n    Test File: linkage-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"linkage-example.json\"\n    inst = linkage.Linkage.model_validate_json(filename.read_bytes())\n    assert \"Linkage\" == inst.get_resource_type()\n\n    impl_linkage_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Linkage\" == data[\"resourceType\"]\n\n    inst2 = linkage.Linkage(**data)\n    impl_linkage_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_list.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/List\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import list\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_list_1(inst):\n    assert inst.code.coding[0].code == \"182836005\"\n    assert inst.code.coding[0].display == \"Review of medication\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Medication Review\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-11-20T23:10:23+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.entry[0].flag.coding[0].code == \"01\"\n    assert inst.entry[0].flag.coding[0].display == \"Prescribed\"\n    assert (\n        inst.entry[0].flag.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nehta.gov.au/codes/medications/changetype\"}\n        ).valueUri\n    )\n    assert inst.entry[0].item.display == \"hydroxocobalamin\"\n    assert inst.entry[1].deleted is True\n    assert inst.entry[1].flag.coding[0].code == \"02\"\n    assert inst.entry[1].flag.coding[0].display == \"Cancelled\"\n    assert (\n        inst.entry[1].flag.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nehta.gov.au/codes/medications/changetype\"}\n        ).valueUri\n    )\n    assert inst.entry[1].item.display == \"Morphine Sulfate\"\n    assert inst.id == \"med-list\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"changes\"\n    assert inst.source.reference == \"Patient/example\"\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_1(base_settings):\n    \"\"\"No. 1 tests collection for List.\n    Test File: list-example-medlist.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"list-example-medlist.json\"\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_1(inst2)\n\n\ndef impl_list_2(inst):\n    assert inst.code.text == \"History and Physical\"\n    assert inst.contained[0].id == \"a1\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2004-12-25T23:50:50-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.entry[0].item.reference == \"DocumentReference/example\"\n    assert inst.id == \"example-xds\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/documents\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"master\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/fhir/CodeSystem/identifier-type\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"23425234234-2346\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/documents\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].type.coding[0].code == \"set\"\n    assert (\n        inst.identifier[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/fhir/CodeSystem/identifier-type\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].value == \"23425234234-2347\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"working\"\n    assert inst.source.reference == \"#a1\"\n    assert inst.status == \"current\"\n    assert inst.subject[0].reference == \"Patient/xcda\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Physical\"\n\n\ndef test_list_2(base_settings):\n    \"\"\"No. 2 tests collection for List.\n    Test File: list-example-xds.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"list-example-xds.json\"\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_2(inst2)\n\n\ndef impl_list_3(inst):\n    assert inst.code.coding[0].code == \"8670-2\"\n    assert inst.code.coding[0].display == \"History of family member diseases\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"image\"\n    assert inst.contained[1].id == \"1\"\n    assert inst.contained[2].id == \"2\"\n    assert inst.contained[3].id == \"3\"\n    assert inst.contained[4].id == \"4\"\n    assert inst.contained[5].id == \"5\"\n    assert inst.contained[6].id == \"6\"\n    assert inst.contained[7].id == \"7\"\n    assert inst.contained[8].id == \"8\"\n    assert inst.contained[9].id == \"9\"\n    assert inst.entry[0].item.reference == \"#image\"\n    assert inst.entry[1].item.reference == \"#2\"\n    assert inst.entry[2].item.reference == \"#3\"\n    assert inst.entry[3].item.reference == \"#4\"\n    assert inst.entry[4].item.reference == \"#5\"\n    assert inst.entry[5].item.reference == \"#6\"\n    assert inst.entry[6].item.reference == \"#7\"\n    assert inst.entry[7].item.reference == \"#8\"\n    assert inst.entry[8].item.reference == \"#9\"\n    assert inst.entry[9].item.reference == \"#10\"\n    assert inst.id == \"prognosis\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"snapshot\"\n    assert inst.status == \"current\"\n    assert inst.subject[0].display == \"Annie Proband, female, born 1966\"\n    assert inst.subject[0].reference == \"Patient/proband\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_3(base_settings):\n    \"\"\"No. 3 tests collection for List.\n    Test File: list-example-familyhistory-genetics-profile-annie.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"list-example-familyhistory-genetics-profile-annie.json\"\n    )\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_3(inst2)\n\n\ndef impl_list_4(inst):\n    assert inst.code.coding[0].code == \"346638\"\n    assert inst.code.coding[0].display == \"Patient Admission List\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.com/list-codes\"}\n        ).valueUri\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-07-14T11:54:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-simple-empty\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"snapshot\"\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_4(base_settings):\n    \"\"\"No. 4 tests collection for List.\n    Test File: list-example-simple-empty.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"list-example-simple-empty.json\"\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_4(inst2)\n\n\ndef impl_list_5(inst):\n    assert inst.code.coding[0].code == \"182836005\"\n    assert inst.code.coding[0].display == \"Review of medication\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Medication Review\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-11-26T07:30:23+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.emptyReason.coding[0].code == \"nilknown\"\n    assert inst.emptyReason.coding[0].display == \"Nil Known\"\n    assert (\n        inst.emptyReason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/list-empty-reason\"}\n        ).valueUri\n    )\n    assert inst.emptyReason.text == \"The patient is not on any medications\"\n    assert inst.id == \"example-empty\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"snapshot\"\n    assert inst.source.reference == \"Patient/example\"\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_5(base_settings):\n    \"\"\"No. 5 tests collection for List.\n    Test File: list-example-empty.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"list-example-empty.json\"\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_5(inst2)\n\n\ndef impl_list_6(inst):\n    assert inst.code.coding[0].code == \"8670-2\"\n    assert inst.code.coding[0].display == \"History of family member diseases\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"1\"\n    assert inst.contained[1].id == \"2\"\n    assert inst.contained[2].id == \"3\"\n    assert inst.contained[3].id == \"4\"\n    assert inst.contained[4].id == \"5\"\n    assert inst.contained[5].id == \"6\"\n    assert inst.contained[6].id == \"7\"\n    assert inst.contained[7].id == \"8\"\n    assert inst.entry[0].item.reference == \"#1\"\n    assert inst.entry[1].item.reference == \"#2\"\n    assert inst.entry[2].item.reference == \"#3\"\n    assert inst.entry[3].item.reference == \"#4\"\n    assert inst.entry[4].item.reference == \"#5\"\n    assert inst.entry[5].item.reference == \"#6\"\n    assert inst.entry[6].item.reference == \"#7\"\n    assert inst.entry[7].item.reference == \"#8\"\n    assert inst.entry[8].item.display == \"Family history of cancer of colon\"\n    assert inst.entry[8].item.reference == \"Condition/family-history\"\n    assert inst.id == \"genetic\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"snapshot\"\n    assert inst.status == \"current\"\n    assert inst.subject[0].display == \"Peter Patient\"\n    assert inst.subject[0].reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_6(base_settings):\n    \"\"\"No. 6 tests collection for List.\n    Test File: list-example-familyhistory-genetics-profile.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"list-example-familyhistory-genetics-profile.json\"\n    )\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_6(inst2)\n\n\ndef impl_list_7(inst):\n    assert inst.code.coding[0].code == \"8670-2\"\n    assert inst.code.coding[0].display == \"History of family member diseases\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"fmh-1\"\n    assert inst.contained[1].id == \"fmh-2\"\n    assert inst.entry[0].item.reference == \"#fmh-1\"\n    assert inst.entry[1].item.reference == \"#fmh-2\"\n    assert inst.id == \"f201\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"snapshot\"\n    assert inst.note[0].text == (\n        \"Both parents, both brothers and both children (twin) are \" \"still alive.\"\n    )\n    assert inst.status == \"current\"\n    assert inst.subject[0].display == \"Roel\"\n    assert inst.subject[0].reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_7(base_settings):\n    \"\"\"No. 7 tests collection for List.\n    Test File: list-example-familyhistory-f201-roel.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"list-example-familyhistory-f201-roel.json\"\n    )\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_7(inst2)\n\n\ndef impl_list_8(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-11-25T22:17:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.entry[0].deleted is True\n    assert inst.entry[0].flag.text == \"Deleted due to error\"\n    assert inst.entry[0].item.reference == \"Condition/example\"\n    assert inst.entry[1].flag.text == \"Added\"\n    assert inst.entry[1].item.reference == \"Condition/example2\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:a9fcea7c-fcdf-4d17-a5e0-f26dda030b59\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"23974652\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"changes\"\n    assert inst.source.reference == \"Patient/example\"\n    assert inst.status == \"current\"\n    assert inst.subject[0].reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_8(base_settings):\n    \"\"\"No. 8 tests collection for List.\n    Test File: list-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"list-example.json\"\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_8(inst2)\n\n\ndef impl_list_9(inst):\n    assert inst.code.coding[0].code == \"52472-8\"\n    assert inst.code.coding[0].display == \"Allergies and Adverse Drug Reactions\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Current Allergy List\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-07-14T23:10:23+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.entry[0].item.reference == \"AllergyIntolerance/example\"\n    assert inst.entry[1].item.reference == \"AllergyIntolerance/medication\"\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/list-for\"}\n        ).valueUri\n    )\n    assert inst.extension[0].valueReference.display == \"Dr Adam Careful\"\n    assert inst.extension[0].valueReference.reference == \"Patient/example\"\n    assert inst.id == \"current-allergies\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"working\"\n    assert inst.orderedBy.coding[0].code == \"entry-date\"\n    assert (\n        inst.orderedBy.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/list-order\"}\n        ).valueUri\n    )\n    assert inst.source.reference == \"Patient/example\"\n    assert inst.status == \"current\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Current Allergy List\"\n\n\ndef test_list_9(base_settings):\n    \"\"\"No. 9 tests collection for List.\n    Test File: list-example-allergies.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"list-example-allergies.json\"\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_9(inst2)\n\n\ndef impl_list_10(inst):\n    assert inst.code.coding[0].code == \"80738-8\"\n    assert inst.code.coding[0].display == (\n        \"TPMT gene mutations found [Identifier] in Blood or Tissue by\"\n        \" Sequencing Nominal\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == (\n        \"TPMT gene mutations found [Identifier] in Blood or Tissue by\"\n        \" Sequencing Nominal\"\n    )\n    assert inst.contained[0].id == \"1\"\n    assert inst.contained[1].id == \"2\"\n    assert inst.contained[2].id == \"3\"\n    assert inst.contained[3].id == \"4\"\n    assert inst.contained[4].id == \"5\"\n    assert inst.contained[5].id == \"6\"\n    assert inst.entry[0].item.reference == \"#1\"\n    assert inst.entry[1].item.reference == \"#2\"\n    assert inst.entry[2].item.reference == \"#3\"\n    assert inst.entry[3].item.reference == \"#4\"\n    assert inst.entry[4].item.reference == \"#5\"\n    assert inst.entry[5].item.reference == \"#6\"\n    assert inst.id == \"example-double-cousin-relationship\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"snapshot\"\n    assert inst.status == \"current\"\n    assert inst.subject[0].display == \"Pam Taylor\"\n    assert inst.subject[0].reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_list_10(base_settings):\n    \"\"\"No. 10 tests collection for List.\n    Test File: list-example-double-cousin-relationship-pedigree.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"list-example-double-cousin-relationship-pedigree.json\"\n    )\n    inst = list.List.model_validate_json(filename.read_bytes())\n    assert \"List\" == inst.get_resource_type()\n\n    impl_list_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"List\" == data[\"resourceType\"]\n\n    inst2 = list.List(**data)\n    impl_list_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_location.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Location\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import location\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_location_1(inst):\n    assert inst.address.city == \"Den Burg\"\n    assert inst.address.country == \"NLD\"\n    assert inst.address.line[0] == \"Galapagosweg 91, Building A\"\n    assert inst.address.postalCode == \"9105 PZ\"\n    assert inst.address.use == \"work\"\n    assert inst.alias[0] == \"BU MC, SW, F2\"\n    assert (\n        inst.alias[1] == \"Burgers University Medical Center, South Wing, second floor\"\n    )\n    assert inst.characteristic[0].coding[0].code == \"wheelchair\"\n    assert inst.characteristic[0].coding[0].display == \"Wheelchair accessible\"\n    assert (\n        inst.characteristic[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/location-characteristic\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"2328\"\n    assert inst.contact[0].telecom[1].system == \"fax\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"2329\"\n    assert inst.contact[0].telecom[2].system == \"email\"\n    assert inst.contact[0].telecom[2].value == \"second wing admissions\"\n    assert inst.contact[1].telecom[0].system == \"url\"\n    assert inst.contact[1].telecom[0].use == \"work\"\n    assert inst.contact[1].telecom[0].value == \"http://sampleorg.com/southwing\"\n    assert inst.description == (\n        \"Second floor of the Old South Wing, formerly in use by \" \"Psychiatry\"\n    )\n    assert inst.endpoint[0].reference == \"Endpoint/example\"\n    assert inst.form.coding[0].code == \"wi\"\n    assert inst.form.coding[0].display == \"Wing\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert inst.id == \"1\"\n    assert inst.identifier[0].value == \"B1-S.F2\"\n    assert inst.managingOrganization.reference == \"Organization/f001\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"instance\"\n    assert inst.name == \"South Wing, second floor\"\n    assert float(inst.position.altitude) == float(0)\n    assert float(inst.position.latitude) == float(42.25475478)\n    assert float(inst.position.longitude) == float(-83.6945691)\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Burgers UMC, '\n        \"South Wing, second floor</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_location_1(base_settings):\n    \"\"\"No. 1 tests collection for Location.\n    Test File: location-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"location-example.json\"\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_1(inst2)\n\n\ndef impl_location_2(inst):\n    assert inst.alias[0] == \"South Wing OR 5\"\n    assert inst.alias[1] == \"Main Wing OR 2\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].value == \"2329\"\n    assert inst.description == (\n        \"Old South Wing, Neuro Radiology Operation Room 1 on second \" \"floor\"\n    )\n    assert inst.form.coding[0].code == \"ro\"\n    assert inst.form.coding[0].display == \"Room\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert inst.id == \"2\"\n    assert inst.identifier[0].value == \"B1-S.F2.1.00\"\n    assert inst.managingOrganization.reference == \"Organization/f001\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"instance\"\n    assert inst.name == \"South Wing Neuro OR 1\"\n    assert inst.operationalStatus.code == \"H\"\n    assert inst.operationalStatus.display == \"Housekeeping\"\n    assert (\n        inst.operationalStatus.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0116\"}\n        ).valueUri\n    )\n    assert inst.partOf.reference == \"Location/1\"\n    assert inst.status == \"suspended\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Burgers UMC, '\n        \"South Wing, second floor, Neuro Radiology Operation Room \"\n        \"1</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"RNEU\"\n    assert inst.type[0].coding[0].display == \"Neuroradiology unit\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n\n\ndef test_location_2(base_settings):\n    \"\"\"No. 2 tests collection for Location.\n    Test File: location-example-room.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"location-example-room.json\"\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_2(inst2)\n\n\ndef impl_location_3(inst):\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"mobile\"\n    assert inst.contact[0].telecom[0].value == \"2329\"\n    assert inst.description == \"Ambulance provided by Burgers University Medical Center\"\n    assert inst.form.coding[0].code == \"ve\"\n    assert inst.form.coding[0].display == \"Vehicle\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert inst.id == \"amb\"\n    assert inst.managingOrganization.reference == \"Organization/f001\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"kind\"\n    assert inst.name == \"BUMC Ambulance\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Mobile ' \"Clinic</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"AMB\"\n    assert inst.type[0].coding[0].display == \"Ambulance\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n\n\ndef test_location_3(base_settings):\n    \"\"\"No. 3 tests collection for Location.\n    Test File: location-example-ambulance.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"location-example-ambulance.json\"\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_3(inst2)\n\n\ndef impl_location_4(inst):\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/location-boundary-geojson\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueAttachment.contentType == \"application/geo+json\"\n    # Don't know how to create unit test\n    # for \"extension[0].valueAttachment.size\",\n    # which is a Integer64\n    assert (\n        inst.extension[0].valueAttachment.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://github.com/OpenDataDE/State-zip-code-GeoJSON/raw/master/dc_district_of_columbia_zip_codes_geo.min.json\"\n            }\n        ).valueUrl\n    )\n    assert inst.form.coding[0].code == \"area\"\n    assert inst.form.coding[0].display == \"Area\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert inst.id == \"wash-dc-metro\"\n    assert inst.meta.profile[0] == (\n        \"http://hl7.org/fhir/uv/vhdir/StructureDefinition/vhdir-\" \"location\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Washington, DC metro area\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"extensions\"\n\n\ndef test_location_4(base_settings):\n    \"\"\"No. 4 tests collection for Location.\n    Test File: location-wash-dc-metro.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"location-wash-dc-metro.json\"\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_4(inst2)\n\n\ndef impl_location_5(inst):\n    assert inst.description == (\n        \"All Pharmacies in the United Kingdom covered by the National\"\n        \" Pharmacy Association\"\n    )\n    assert inst.form.coding[0].code == \"jdn\"\n    assert inst.form.coding[0].display == \"Jurisdiction\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert inst.id == \"ukp\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"kind\"\n    assert inst.name == \"UK Pharmacies\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">UK ' \"Pharmacies</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"PHARM\"\n    assert inst.type[0].coding[0].display == \"Pharmacy\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n\n\ndef test_location_5(base_settings):\n    \"\"\"No. 5 tests collection for Location.\n    Test File: location-example-ukpharmacy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"location-example-ukpharmacy.json\"\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_5(inst2)\n\n\ndef impl_location_6(inst):\n    assert inst.description == \"Patient's Home\"\n    assert inst.form.coding[0].code == \"ho\"\n    assert inst.form.coding[0].display == \"House\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert inst.id == \"ph\"\n    assert inst.managingOrganization.reference == \"Organization/f001\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"kind\"\n    assert inst.name == \"Patient's Home\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Patient\\'s ' \"Home</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"PTRES\"\n    assert inst.type[0].coding[0].display == \"Patient's Residence\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n\n\ndef test_location_6(base_settings):\n    \"\"\"No. 6 tests collection for Location.\n    Test File: location-example-patients-home.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"location-example-patients-home.json\"\n    )\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_6(inst2)\n\n\ndef impl_location_7(inst):\n    assert inst.address.city == \"Ann Arbor\"\n    assert inst.address.country == \"USA\"\n    assert inst.address.line[0] == \"3300 Washtenaw Avenue, Suite 227\"\n    assert inst.address.postalCode == \"48104\"\n    assert inst.address.state == \"MI\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].value == \"(+1) 734-677-7777\"\n    assert inst.contact[0].telecom[1].system == \"fax\"\n    assert inst.contact[0].telecom[1].value == \"(+1) 734-677-6622\"\n    assert inst.contact[0].telecom[2].system == \"email\"\n    assert inst.contact[0].telecom[2].value == \"hq@HL7.org\"\n    assert inst.description == \"HL7 Headquarters\"\n    assert inst.form.coding[0].code == \"bu\"\n    assert inst.form.coding[0].display == \"Building\"\n    assert (\n        inst.form.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert inst.id == \"hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.mode == \"instance\"\n    assert inst.name == \"Health Level Seven International\"\n    assert float(inst.position.latitude) == float(-83.69471)\n    assert float(inst.position.longitude) == float(42.2565)\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"SLEEP\"\n    assert inst.type[0].coding[0].display == \"Sleep disorders unit\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n\n\ndef test_location_7(base_settings):\n    \"\"\"No. 7 tests collection for Location.\n    Test File: location-example-hl7hq.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"location-example-hl7hq.json\"\n    inst = location.Location.model_validate_json(filename.read_bytes())\n    assert \"Location\" == inst.get_resource_type()\n\n    impl_location_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Location\" == data[\"resourceType\"]\n\n    inst2 = location.Location(**data)\n    impl_location_7(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_manufactureditemdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ManufacturedItemDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import manufactureditemdefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_manufactureditemdefinition_1(inst):\n    assert inst.id == \"example\"\n    assert inst.manufacturedDoseForm.coding[0].code == \"Film-coatedtablet\"\n    assert (\n        inst.manufacturedDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/manufactureddoseform\"}\n        ).valueUri\n    )\n    assert inst.manufacturer[0].reference == \"Organization/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.property[0].type.coding[0].code == \"shape\"\n    assert inst.property[0].valueCodeableConcept.text == \"Oval\"\n    assert inst.property[1].type.coding[0].code == \"color\"\n    assert inst.property[1].valueCodeableConcept.text == \"pink\"\n    assert inst.property[2].type.coding[0].code == \"imprint\"\n    assert inst.property[2].valueCodeableConcept.text == \"894\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.unitOfPresentation.coding[0].code == \"Tablet\"\n    assert (\n        inst.unitOfPresentation.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/unitofpresentation\"}\n        ).valueUri\n    )\n\n\ndef test_manufactureditemdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ManufacturedItemDefinition.\n    Test File: manufactureditemdefinition-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"manufactureditemdefinition-example.json\"\n    )\n    inst = manufactureditemdefinition.ManufacturedItemDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ManufacturedItemDefinition\" == inst.get_resource_type()\n\n    impl_manufactureditemdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ManufacturedItemDefinition\" == data[\"resourceType\"]\n\n    inst2 = manufactureditemdefinition.ManufacturedItemDefinition(**data)\n    impl_manufactureditemdefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_measure.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Measure\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import measure\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_measure_1(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Exclusive breastfeeding measure of outcomes for exclusive \"\n        \"breastmilk feeding of newborns.\"\n    )\n    assert inst.group[0].id == \"PopulationGroup1\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].criteria.expression == \"InitialPopulation1\"\n    assert inst.group[0].population[0].criteria.language == \"text/cql\"\n    assert inst.group[0].population[1].code.coding[0].code == \"denominator\"\n    assert inst.group[0].population[1].criteria.expression == \"Denominator1\"\n    assert inst.group[0].population[1].criteria.language == \"text/cql\"\n    assert inst.group[0].population[2].code.coding[0].code == \"denominator-exclusions\"\n    assert inst.group[0].population[2].criteria.expression == \"DenominatorExclusions1\"\n    assert inst.group[0].population[2].criteria.language == \"text/cql\"\n    assert inst.group[0].population[3].code.coding[0].code == \"numerator\"\n    assert inst.group[0].population[3].criteria.expression == \"Numerator1\"\n    assert inst.group[0].population[3].criteria.language == \"text/cql\"\n    assert inst.group[1].id == \"PopulationGroup2\"\n    assert inst.group[1].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[1].population[0].criteria.expression == \"InitialPopulation2\"\n    assert inst.group[1].population[0].criteria.language == \"text/cql\"\n    assert inst.group[1].population[1].code.coding[0].code == \"denominator\"\n    assert inst.group[1].population[1].criteria.expression == \"Denominator2\"\n    assert inst.group[1].population[1].criteria.language == \"text/cql\"\n    assert inst.group[1].population[2].code.coding[0].code == \"denominator-exclusion\"\n    assert inst.group[1].population[2].criteria.expression == \"DenominatorExclusions2\"\n    assert inst.group[1].population[2].criteria.language == \"text/cql\"\n    assert inst.group[1].population[3].code.coding[0].code == \"numerator\"\n    assert inst.group[1].population[3].criteria.expression == \"Numerator2\"\n    assert inst.group[1].population[3].criteria.language == \"text/cql\"\n    assert inst.id == \"measure-exclusive-breastfeeding\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"exclusive-breastfeeding-measure\"\n    assert inst.improvementNotation.coding[0].code == \"increase\"\n    assert (\n        inst.improvementNotation.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-improvement-notation\"\n            }\n        ).valueUri\n    )\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/library-exclusive-\" \"breastfeeding-cqm-logic\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"ExclusiveBreastfeedingMeasure\"\n    assert inst.purpose == (\n        \"Measure of newborns who were fed breast milk only since \" \"birth\"\n    )\n    assert inst.relatedArtifact[0].citation == (\n        \"American Academy of Pediatrics. (2005). Section on \"\n        \"Breastfeeding. Policy Statement:Breastfeeding and the Use of\"\n        \" Human Milk. Pediatrics.115:496-506.\"\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert inst.relatedArtifact[1].type == \"documentation\"\n    assert inst.relatedArtifact[2].type == \"documentation\"\n    assert inst.relatedArtifact[3].type == \"documentation\"\n    assert inst.relatedArtifact[4].type == \"documentation\"\n    assert inst.relatedArtifact[5].type == \"documentation\"\n    assert inst.relatedArtifact[6].citation == (\n        \"Kramer, M.S. & Kakuma, R. (2002).Optimal duration of \"\n        \"exclusive breastfeeding. [107 refs] Cochrane Database of \"\n        \"Systematic Reviews. (1):CD003517.\"\n    )\n    assert inst.relatedArtifact[6].type == \"documentation\"\n    assert inst.relatedArtifact[7].citation == (\n        \"Petrova, A., Hegyi, T., & Mehta, R. (2007). Maternal \"\n        \"race/ethnicity and one-month exclusive breastfeeding in \"\n        \"association with the in-hospital feeding modality. \"\n        \"Breastfeeding Medicine. 2(2):92-8.\"\n    )\n    assert inst.relatedArtifact[7].type == \"documentation\"\n    assert inst.relatedArtifact[8].type == \"documentation\"\n    assert inst.relatedArtifact[9].type == \"documentation\"\n    assert inst.scoring.coding[0].code == \"proportion\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Exclusive Breastfeeding Measure\"\n    assert inst.topic[0].text == \"Exclusive Breastfeeding\"\n    assert inst.type[0].coding[0].code == \"process\"\n    assert inst.version == \"5.0.0\"\n\n\ndef test_measure_1(base_settings):\n    \"\"\"No. 1 tests collection for Measure.\n    Test File: measure-exclusive-breastfeeding.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"measure-exclusive-breastfeeding.json\"\n    )\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_1(inst2)\n\n\ndef impl_measure_2(inst):\n    assert inst.description == \"Screening for Depression\"\n    assert inst.group[0].id == \"Main\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].criteria.expression == \"Initial Population\"\n    assert inst.group[0].population[0].criteria.language == \"text/cql\"\n    assert inst.group[0].population[1].code.coding[0].code == \"denominator\"\n    assert inst.group[0].population[1].criteria.expression == \"Denominator\"\n    assert inst.group[0].population[1].criteria.language == \"text/cql\"\n    assert inst.group[0].population[2].code.coding[0].code == \"numerator\"\n    assert inst.group[0].population[2].criteria.expression == \"Numerator\"\n    assert inst.group[0].population[2].criteria.language == \"text/cql\"\n    assert inst.id == \"component-b-example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"ScreeningForDepression\"\n    assert inst.scoring.coding[0].code == \"proportion\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Screening for Depression\"\n\n\ndef test_measure_2(base_settings):\n    \"\"\"No. 2 tests collection for Measure.\n    Test File: measure-component-b-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measure-component-b-example.json\"\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_2(inst2)\n\n\ndef impl_measure_3(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Exclusive breastfeeding measure of outcomes for exclusive \"\n        \"breastmilk feeding of newborns.\"\n    )\n    assert inst.group[0].id == \"PopulationGroup1\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].criteria.expression == \"InitialPopulation1\"\n    assert inst.group[0].population[0].criteria.language == \"text/cql\"\n    assert inst.group[0].population[1].code.coding[0].code == \"denominator\"\n    assert inst.group[0].population[1].criteria.expression == \"Denominator1\"\n    assert inst.group[0].population[1].criteria.language == \"text/cql\"\n    assert inst.group[0].population[2].code.coding[0].code == \"denominator-exclusions\"\n    assert inst.group[0].population[2].criteria.expression == \"DenominatorExclusions1\"\n    assert inst.group[0].population[2].criteria.language == \"text/cql\"\n    assert inst.group[0].population[3].code.coding[0].code == \"numerator\"\n    assert inst.group[0].population[3].criteria.expression == \"Numerator1\"\n    assert inst.group[0].population[3].criteria.language == \"text/cql\"\n    assert inst.group[1].id == \"PopulationGroup2\"\n    assert inst.group[1].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[1].population[0].criteria.expression == \"InitialPopulation2\"\n    assert inst.group[1].population[0].criteria.language == \"text/cql\"\n    assert inst.group[1].population[1].code.coding[0].code == \"denominator\"\n    assert inst.group[1].population[1].criteria.expression == \"Denominator2\"\n    assert inst.group[1].population[1].criteria.language == \"text/cql\"\n    assert inst.group[1].population[2].code.coding[0].code == \"denominator-exclusion\"\n    assert inst.group[1].population[2].criteria.expression == \"DenominatorExclusions2\"\n    assert inst.group[1].population[2].criteria.language == \"text/cql\"\n    assert inst.group[1].population[3].code.coding[0].code == \"numerator\"\n    assert inst.group[1].population[3].criteria.expression == \"Numerator2\"\n    assert inst.group[1].population[3].criteria.language == \"text/cql\"\n    assert inst.id == \"measure-predecessor-example\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"exclusive-breastfeeding-measure\"\n    assert inst.improvementNotation.coding[0].code == \"increase\"\n    assert (\n        inst.improvementNotation.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-improvement-notation\"\n            }\n        ).valueUri\n    )\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/library-exclusive-\" \"breastfeeding-cqm-logic\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"ExclusiveBreastfeedingMeasure\"\n    assert inst.purpose == (\n        \"Measure of newborns who were fed breast milk only since \" \"birth\"\n    )\n    assert inst.relatedArtifact[0].citation == (\n        \"American Academy of Pediatrics. (2005). Section on \"\n        \"Breastfeeding. Policy Statement:Breastfeeding and the Use of\"\n        \" Human Milk. Pediatrics.115:496-506.\"\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert inst.relatedArtifact[1].type == \"documentation\"\n    assert inst.relatedArtifact[2].type == \"documentation\"\n    assert inst.relatedArtifact[3].type == \"documentation\"\n    assert inst.relatedArtifact[4].type == \"documentation\"\n    assert inst.relatedArtifact[5].type == \"documentation\"\n    assert inst.relatedArtifact[6].citation == (\n        \"Kramer, M.S. & Kakuma, R. (2002).Optimal duration of \"\n        \"exclusive breastfeeding. [107 refs] Cochrane Database of \"\n        \"Systematic Reviews. (1):CD003517.\"\n    )\n    assert inst.relatedArtifact[6].type == \"documentation\"\n    assert inst.relatedArtifact[7].citation == (\n        \"Petrova, A., Hegyi, T., & Mehta, R. (2007). Maternal \"\n        \"race/ethnicity and one-month exclusive breastfeeding in \"\n        \"association with the in-hospital feeding modality. \"\n        \"Breastfeeding Medicine. 2(2):92-8.\"\n    )\n    assert inst.relatedArtifact[7].type == \"documentation\"\n    assert inst.relatedArtifact[8].type == \"documentation\"\n    assert inst.relatedArtifact[9].type == \"documentation\"\n    assert inst.scoring.coding[0].code == \"proportion\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Exclusive Breastfeeding Measure\"\n    assert inst.topic[0].text == \"Exclusive Breastfeeding\"\n    assert inst.type[0].coding[0].code == \"process\"\n    assert inst.version == \"5.0.0\"\n\n\ndef test_measure_3(base_settings):\n    \"\"\"No. 3 tests collection for Measure.\n    Test File: measure-predecessor-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measure-predecessor-example.json\"\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_3(inst2)\n\n\ndef impl_measure_4(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.group[0].code.coding[0].code == \"QRPH_ADX_ART1_N\"\n    assert (\n        inst.group[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[0].description == (\n        \"Number of adults and children newly enrolled on \"\n        \"antiretroviral therapy (ART) in the reporting period\"\n    )\n    assert inst.group[0].population[0].code.text == \"cohort\"\n    assert inst.group[0].population[0].criteria.expression == (\n        \"Newly enrolled on antiretroviral therapy (ART) during \" \"measurement period\"\n    )\n    assert inst.group[0].population[0].criteria.language == \"text/cql\"\n    assert inst.group[0].stratifier[0].code.coding[0].code == \"AGE_GROUP:SEX\"\n    assert (\n        inst.group[0].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[0].stratifier[0].criteria.expression == \"Age Group/Sex\"\n    assert inst.group[0].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[1].code.coding[0].code == \"QRPH_ADX_ART1_N_PREG_BF\"\n    assert (\n        inst.group[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[1].description == (\n        \"Number of adults and children newly enrolled on ART in the \"\n        \"reporting period_pregnant and breastfeeding\"\n    )\n    assert inst.group[1].population[0].code.text == \"cohort\"\n    assert inst.group[1].population[0].criteria.expression == (\n        \"Newly enrolled on antiretroviral therapy (ART) during \"\n        \"measurement period (pregnant and breastfeeding)\"\n    )\n    assert inst.group[1].population[0].criteria.language == \"text/cql\"\n    assert inst.group[1].stratifier[0].code.coding[0].code == \"PREG_BF\"\n    assert (\n        inst.group[1].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[1].stratifier[0].criteria.expression == \"Pregnant/Breastfeeding\"\n    assert inst.group[1].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[2].code.coding[0].code == \"QRPH_ADX_ART3_N\"\n    assert (\n        inst.group[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[2].description == (\n        \"Number of adults and children currently receiving \"\n        \"antiretroviral therapy (ART)\"\n    )\n    assert inst.group[2].population[0].code.text == \"cohort\"\n    assert inst.group[2].population[0].criteria.expression == (\n        \"Receiving antiretroviral therapy (ART) during measurement \" \"period\"\n    )\n    assert inst.group[2].population[0].criteria.language == \"text/cql\"\n    assert inst.group[3].code.coding[0].code == \"QRPH_ADX_ART5_N\"\n    assert (\n        inst.group[3].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[3].description == (\n        \"Number of adults and children who are still on treatment at \"\n        \"12 months after initiating ART\"\n    )\n    assert inst.group[3].population[0].code.text == \"cohort\"\n    assert inst.group[3].population[0].criteria.expression == (\n        \"Receiving antiretroviral therapy (ART) at 12 months after \" \"initiating\"\n    )\n    assert inst.group[3].population[0].criteria.language == \"text/cql\"\n    assert inst.group[3].stratifier[0].component[0].code.coding[0].code == \"AGE_GROUP\"\n    assert (\n        inst.group[3].stratifier[0].component[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[3].stratifier[0].component[0].criteria.expression == \"Age Group\"\n    assert inst.group[3].stratifier[0].component[0].criteria.language == \"text/cql\"\n    assert inst.group[3].stratifier[0].component[1].code.coding[0].code == \"SEX\"\n    assert (\n        inst.group[3].stratifier[0].component[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[3].stratifier[0].component[1].criteria.expression == \"Sex\"\n    assert inst.group[3].stratifier[0].component[1].criteria.language == \"text/cql\"\n    assert inst.group[4].code.coding[0].code == \"QRPH_ADX_ART5_N_PREG_BF\"\n    assert (\n        inst.group[4].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[4].description == (\n        \"Number of adults and children who are still on treatment at \"\n        \"12 months after initiating ART-pregnant and breastfeeding\"\n    )\n    assert inst.group[4].population[0].code.text == \"cohort\"\n    assert inst.group[4].population[0].criteria.expression == (\n        \"Receiving antiretroviral therapy (ART) at 12 months after \"\n        \"initiating (pregnant and breastfeeding)\"\n    )\n    assert inst.group[4].population[0].criteria.language == \"text/cql\"\n    assert inst.group[4].stratifier[0].code.coding[0].code == \"PREG_BF\"\n    assert (\n        inst.group[4].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[4].stratifier[0].criteria.expression == \"Pregnant/Breastfeeding\"\n    assert inst.group[4].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[5].code.coding[0].code == \"QRPH_ADX_ART5_D\"\n    assert (\n        inst.group[5].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[5].description == (\n        \"Number of adults and children who initiated ART in the 12 \"\n        \"months prior to the beginning of the reporting period\"\n    )\n    assert inst.group[5].population[0].code.text == \"cohort\"\n    assert inst.group[5].population[0].criteria.expression == (\n        \"Initiated antiretroviral therapy (ART) in the 12 months \"\n        \"prior to measurement period\"\n    )\n    assert inst.group[5].population[0].criteria.language == \"text/cql\"\n    assert inst.group[5].stratifier[0].code.coding[0].code == \"AGE_GROUP:SEX\"\n    assert (\n        inst.group[5].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[5].stratifier[0].criteria.expression == \"Age Group/Sex\"\n    assert inst.group[5].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[6].code.coding[0].code == \"QRPH_ADX_MTCT1_D\"\n    assert (\n        inst.group[6].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[6].description == (\n        \"Number of pregnant women who attended ANC or had a facility-\"\n        \"based delivery in the reporting period\"\n    )\n    assert inst.group[6].population[0].code.text == \"cohort\"\n    assert inst.group[6].population[0].criteria.expression == (\n        \"Antenatal Care Visit or Live Birth during the Measurement \" \"Period\"\n    )\n    assert inst.group[6].population[0].criteria.language == \"text/cql\"\n    assert inst.group[6].stratifier[0].code.coding[0].code == \"PMTCT_HIV_STATUS\"\n    assert (\n        inst.group[6].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[6].stratifier[0].criteria.expression == \"PMTCT HIV Status\"\n    assert inst.group[6].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[7].code.coding[0].code == \"QRPH_ADX_MTCT2_D\"\n    assert (\n        inst.group[7].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[7].description == (\n        \"Number of HIV positive pregnant women who attended ANC or \"\n        \"had a facility-based delivery within the reporting period\"\n    )\n    assert inst.group[7].population[0].code.text == \"cohort\"\n    assert inst.group[7].population[0].criteria.expression == (\n        \"Antenatal Care Visit or Live Birth during Measurement Period\" \" (HIV Positive)\"\n    )\n    assert inst.group[7].population[0].criteria.language == \"text/cql\"\n    assert inst.group[8].code.coding[0].code == \"QRPH_ADX_MTCT2_N\"\n    assert (\n        inst.group[8].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[8].description == (\n        \"Number of HIV-positive pregnant women who received ART to \"\n        \"reduce the risk of mother-to-child-transmission during \"\n        \"pregnancy\"\n    )\n    assert inst.group[8].population[0].code.text == \"cohort\"\n    assert inst.group[8].population[0].criteria.expression == (\n        \"HIV-positive, pregnant, and receiving antiretroviral therapy\"\n        \" (ART) to reduce the risk of mother-to-child-transmission \"\n        \"during pregnancy\"\n    )\n    assert inst.group[8].population[0].criteria.language == \"text/cql\"\n    assert inst.group[8].stratifier[0].code.coding[0].code == \"PMTCT_ART_STATUS\"\n    assert (\n        inst.group[8].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[8].stratifier[0].criteria.expression == \"PMTCT ART Status\"\n    assert inst.group[8].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[9].code.coding[0].code == \"QRPH_ADX_VLS3_N\"\n    assert (\n        inst.group[9].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[9].description == (\n        \"Number of people living with HIV and on ART who have a \"\n        \"suppressed viral load results (<1000 copies/mL)\"\n    )\n    assert inst.group[9].population[0].code.text == \"cohort\"\n    assert inst.group[9].population[0].criteria.expression == (\n        \"Living with HIV and on ART with suppressed viral load \"\n        \"results (<1000 copies/mL)\"\n    )\n    assert inst.group[9].population[0].criteria.language == \"text/cql\"\n    assert inst.group[9].stratifier[0].code.coding[0].code == \"AGE_GROUP:SEX\"\n    assert (\n        inst.group[9].stratifier[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ihe.net/qrph/adx/\"}\n        ).valueUri\n    )\n    assert inst.group[9].stratifier[0].criteria.expression == \"Age Group/Sex\"\n    assert inst.group[9].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.id == \"hiv-indicators\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.28.2\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ohie.org/Measure/\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].value == \"hiv-indicators\"\n    assert inst.library[0] == \"http://ohie.org/Library/hiv-indicators\"\n    assert inst.name == \"HIV\"\n    assert inst.publisher == \"Open HIE\"\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://wiki.ihe.net/index.php/Aggregate_Data_Exchange_-_HIV\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.scoring.coding[0].code == \"cohort\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"HIV Indicators\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ohie.org/Measure/hiv-indicators\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.0.0\"\n\n\ndef test_measure_4(base_settings):\n    \"\"\"No. 4 tests collection for Measure.\n    Test File: measure-hiv-indicators.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measure-hiv-indicators.json\"\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_4(inst2)\n\n\ndef impl_measure_5(inst):\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-01-01\"}).valueDate\n    )\n    assert inst.author[0].name == \"National Committee for Quality Assurance\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://www.ncqa.org/\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-10\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Percentage of children 3-18 years of age who were diagnosed \"\n        \"with pharyngitis, ordered an antibiotic and received a group\"\n        \" A streptococcus (strep) test for the episode.\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.group[0].id == \"CMS146-group-1\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert (\n        inst.group[0].population[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-population\"}\n        ).valueUri\n    )\n    assert inst.group[0].population[0].criteria.expression == \"CMS146.InitialPopulation\"\n    assert inst.group[0].population[0].criteria.language == \"text/cql\"\n    assert inst.group[0].population[1].code.coding[0].code == \"numerator\"\n    assert (\n        inst.group[0].population[1].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-population\"}\n        ).valueUri\n    )\n    assert inst.group[0].population[1].criteria.expression == \"CMS146.Numerator\"\n    assert inst.group[0].population[1].criteria.language == \"text/cql\"\n    assert inst.group[0].population[2].code.coding[0].code == \"denominator\"\n    assert (\n        inst.group[0].population[2].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-population\"}\n        ).valueUri\n    )\n    assert inst.group[0].population[2].criteria.expression == \"CMS146.Denominator\"\n    assert inst.group[0].population[2].criteria.language == \"text/cql\"\n    assert inst.group[0].population[3].code.coding[0].code == \"denominator-exclusion\"\n    assert (\n        inst.group[0].population[3].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-population\"}\n        ).valueUri\n    )\n    assert (\n        inst.group[0].population[3].criteria.expression == \"CMS146.DenominatorExclusion\"\n    )\n    assert inst.group[0].population[3].criteria.language == \"text/cql\"\n    assert inst.group[0].stratifier[0].code.text == \"stratifier-ages-up-to-9\"\n    assert inst.group[0].stratifier[0].criteria.expression == \"CMS146.AgesUpToNine\"\n    assert inst.group[0].stratifier[0].criteria.language == \"text/cql\"\n    assert inst.group[0].stratifier[1].code.text == \"stratifier-ages-10-plus\"\n    assert inst.group[0].stratifier[1].criteria.expression == \"CMS146.AgesTenPlus\"\n    assert inst.group[0].stratifier[1].criteria.language == \"text/cql\"\n    assert inst.group[0].stratifier[2].code.text == \"stratifier-gender\"\n    assert inst.group[0].stratifier[2].criteria.expression == \"Patient.gender\"\n    assert inst.group[0].stratifier[2].criteria.language == \"text/fhirpath\"\n    assert inst.guidance == (\n        \"This is an episode of care measure that examines all \"\n        \"eligible episodes for the patient during the measurement \"\n        \"period. If the patient has more than one episode, include \"\n        \"all episodes in the measure\"\n    )\n    assert inst.id == \"measure-cms146-example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.28.1\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/cqi/ecqm/Measure/Identifier/cms\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"146\"\n    assert (\n        inst.identifier[2].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/cqi/ecqm/Measure/Identifier/nqf\"}\n        ).valueUri\n    )\n    assert inst.identifier[2].use == \"official\"\n    assert inst.identifier[2].value == \"0002\"\n    assert inst.improvementNotation.coding[0].code == \"increase\"\n    assert (\n        inst.improvementNotation.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-improvement-notation\"\n            }\n        ).valueUri\n    )\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-09-01\"}).valueDate\n    )\n    assert inst.library[0] == \"http://hl7.org/fhir/Library/library-cms146-example\"\n    assert inst.name == \"CMS146\"\n    assert inst.publisher == \"National Committee for Quality Assurance\"\n    assert inst.purpose == (\n        \"Measure of children with a group A streptococcus test in the\"\n        \" 7-day period from 3 days prior through 3 days after the \"\n        \"diagnosis of pharyngitis\"\n    )\n    assert inst.relatedArtifact[0].citation == (\n        \"Linder, J.A., D.W. Bates, G.M. Lee, J.A. Finkelstein. 2005. \"\n        \"_Antibiotic treatment of children with sore throat._ JAMA \"\n        \"294(18):2315-2322. \"\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert inst.relatedArtifact[1].citation == (\n        \"Infectious Diseases Society of America. 2012. _Clinical \"\n        \"Practice Guideline for the Diagnosis and Management of Group\"\n        \" A Streptococcal Pharyngitis: 2012 Update._ \"\n    )\n    assert inst.relatedArtifact[1].type == \"documentation\"\n    assert inst.relatedArtifact[2].type == \"documentation\"\n    assert inst.scoring.coding[0].code == \"proportion\"\n    assert (\n        inst.scoring.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-scoring\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.supplementalData[0].code.text == \"supplemental-data-gender\"\n    assert inst.supplementalData[0].criteria.expression == \"Patient.gender\"\n    assert inst.supplementalData[0].criteria.language == \"text/fhirpath\"\n    assert inst.supplementalData[1].code.text == \"supplemental-data-deceased\"\n    assert inst.supplementalData[1].criteria.expression == \"deceasedBoolean\"\n    assert inst.supplementalData[1].criteria.language == \"text/fhirpath\"\n    assert inst.text.status == \"additional\"\n    assert inst.title == \"Appropriate Testing for Children with Pharyngitis\"\n    assert inst.topic[0].coding[0].code == \"57024-2\"\n    assert (\n        inst.topic[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.type[0].coding[0].code == \"process\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Measure/measure-cms146-example\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"program\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.text == \"eligibile-provider\"\n    assert inst.useContext[1].code.code == \"age\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueRange.high.unit == \"a\"\n    assert float(inst.useContext[1].valueRange.high.value) == float(18)\n    assert inst.useContext[1].valueRange.low.unit == \"a\"\n    assert float(inst.useContext[1].valueRange.low.value) == float(3)\n    assert inst.version == \"1.0.0\"\n\n\ndef test_measure_5(base_settings):\n    \"\"\"No. 5 tests collection for Measure.\n    Test File: measure-cms146-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measure-cms146-example.json\"\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_5(inst2)\n\n\ndef impl_measure_6(inst):\n    assert inst.description == \"Screening for Alcohol Misuse\"\n    assert inst.group[0].id == \"Main\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].criteria.expression == \"Initial Population\"\n    assert inst.group[0].population[0].criteria.language == \"text/cql\"\n    assert inst.group[0].population[1].code.coding[0].code == \"denominator\"\n    assert inst.group[0].population[1].criteria.expression == \"Denominator\"\n    assert inst.group[0].population[1].criteria.language == \"text/cql\"\n    assert inst.group[0].population[2].code.coding[0].code == \"numerator\"\n    assert inst.group[0].population[2].criteria.expression == \"Numerator\"\n    assert inst.group[0].population[2].criteria.language == \"text/cql\"\n    assert inst.id == \"component-a-example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"ScreeningForAlcoholMisuse\"\n    assert inst.scoring.coding[0].code == \"proportion\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Screening for Alcohol Misuse\"\n\n\ndef test_measure_6(base_settings):\n    \"\"\"No. 6 tests collection for Measure.\n    Test File: measure-component-a-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measure-component-a-example.json\"\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_6(inst2)\n\n\ndef impl_measure_7(inst):\n    assert inst.compositeScoring.coding[0].code == \"opportunity\"\n    assert inst.description == \"Behavioral Assessment Composite Measure\"\n    assert inst.id == \"composite-example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"BehavioralAssessmentCompositeMeasure\"\n    assert (\n        inst.relatedArtifact[0].resource\n        == \"http://example.org/fhir/Measure/component-a-example\"\n    )\n    assert inst.relatedArtifact[0].type == \"composed-of\"\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://example.org/fhir/Measure/component-b-example\"\n    )\n    assert inst.relatedArtifact[1].type == \"composed-of\"\n    assert inst.scoring.coding[0].code == \"proportion\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Behavioral Assessment Composite Measure\"\n\n\ndef test_measure_7(base_settings):\n    \"\"\"No. 7 tests collection for Measure.\n    Test File: measure-composite-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measure-composite-example.json\"\n    inst = measure.Measure.model_validate_json(filename.read_bytes())\n    assert \"Measure\" == inst.get_resource_type()\n\n    impl_measure_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Measure\" == data[\"resourceType\"]\n\n    inst2 = measure.Measure(**data)\n    impl_measure_7(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_measurereport.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MeasureReport\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import measurereport\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_measurereport_1(inst):\n    assert inst.contained[0].id == \"reporter\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-04-01\"}\n        ).valueDateTime\n    )\n    assert inst.evaluatedResource[0].reference == \"Condition/example\"\n    assert inst.group[0].id == \"CMS146-group-1\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].count == 1\n    assert inst.group[0].population[1].code.coding[0].code == \"numerator\"\n    assert inst.group[0].population[1].count == 1\n    assert inst.group[0].population[2].code.coding[0].code == \"denominator\"\n    assert inst.group[0].population[2].count == 1\n    assert inst.group[0].population[3].code.coding[0].code == \"denominator-exclusion\"\n    assert inst.group[0].population[3].count == 0\n    assert inst.group[0].stratifier[0].code.text == \"stratifier-ages-up-to-9\"\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[0].count == 1\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[1].count == 1\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[2].count == 1\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[3].count == 0\n    assert inst.group[0].stratifier[0].stratum[0].valueBoolean is True\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[3].count == 0\n    assert inst.group[0].stratifier[0].stratum[1].valueBoolean is False\n    assert inst.group[0].stratifier[1].code.text == \"stratifier-ages-10-plus\"\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[3].count == 0\n    assert inst.group[0].stratifier[1].stratum[0].valueBoolean is True\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[0].count == 1\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[1].count == 1\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[2].count == 1\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[3].count == 0\n    assert inst.group[0].stratifier[1].stratum[1].valueBoolean is True\n    assert inst.group[0].stratifier[2].code.text == \"stratifier-gender\"\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[0].count == 1\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[1].count == 1\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[2].count == 1\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[3].count == 0\n    assert inst.group[0].stratifier[2].stratum[0].valueCodeableConcept.text == \"male\"\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[3].count == 0\n    assert inst.group[0].stratifier[2].stratum[1].valueCodeableConcept.text == \"female\"\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[3].count == 0\n    assert inst.group[0].stratifier[2].stratum[2].valueCodeableConcept.text == \"other\"\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[3].count == 0\n    assert inst.group[0].stratifier[2].stratum[3].valueCodeableConcept.text == \"unknown\"\n    assert inst.id == \"measurereport-cms146-cat1-example\"\n    assert inst.identifier[0].value == \"measurereport-cms146-cat1-example-2017-03-13\"\n    assert inst.measure == \"http://example.org/fhir/Measure/CMS146\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-03-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.reporter.reference == \"#reporter\"\n    assert inst.status == \"complete\"\n    assert inst.subject.reference == \"Patient/123\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"individual\"\n\n\ndef test_measurereport_1(base_settings):\n    \"\"\"No. 1 tests collection for MeasureReport.\n    Test File: measurereport-cms146-cat1-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"measurereport-cms146-cat1-example.json\"\n    )\n    inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes())\n    assert \"MeasureReport\" == inst.get_resource_type()\n\n    impl_measurereport_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MeasureReport\" == data[\"resourceType\"]\n\n    inst2 = measurereport.MeasureReport(**data)\n    impl_measurereport_1(inst2)\n\n\ndef impl_measurereport_2(inst):\n    assert inst.contained[0].id == \"patient-new\"\n    assert inst.group[0].code.coding[0].code == \"QRPH_ADX_ART5_N\"\n    assert float(inst.group[0].measureScoreQuantity.value) == float(1)\n    assert inst.group[0].stratifier[0].code.coding[0].code == \"AGE_GROUP:SEX\"\n    assert float(\n        inst.group[0].stratifier[0].stratum[0].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[0].stratifier[0].stratum[0].valueCodeableConcept.coding[0].code\n        == \"P0Y--P20Y:F\"\n    )\n    assert float(\n        inst.group[0].stratifier[0].stratum[1].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[0].stratifier[0].stratum[1].valueCodeableConcept.coding[0].code\n        == \"P0Y--P20Y:M\"\n    )\n    assert float(\n        inst.group[0].stratifier[0].stratum[2].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[0].stratifier[0].stratum[2].valueCodeableConcept.coding[0].code\n        == \"P20Y--P40Y:F\"\n    )\n    assert float(\n        inst.group[0].stratifier[0].stratum[3].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[0].stratifier[0].stratum[3].valueCodeableConcept.coding[0].code\n        == \"P20Y--P40Y:M\"\n    )\n    assert float(\n        inst.group[0].stratifier[0].stratum[4].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[0].stratifier[0].stratum[4].valueCodeableConcept.coding[0].code\n        == \"P40Y--P65Y:F\"\n    )\n    assert float(\n        inst.group[0].stratifier[0].stratum[5].measureScoreQuantity.value\n    ) == float(1)\n    assert (\n        inst.group[0].stratifier[0].stratum[5].valueCodeableConcept.coding[0].code\n        == \"P40Y--P65Y:M\"\n    )\n    assert inst.id == \"general-example-of-report\"\n    assert inst.measure == \"http://ohie.org/Measure/hiv-indicators\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"complete\"\n    assert inst.subject.reference == \"#patient-new\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"individual\"\n\n\ndef test_measurereport_2(base_settings):\n    \"\"\"No. 2 tests collection for MeasureReport.\n    Test File: measurereport-general-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measurereport-general-example.json\"\n    inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes())\n    assert \"MeasureReport\" == inst.get_resource_type()\n\n    impl_measurereport_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MeasureReport\" == data[\"resourceType\"]\n\n    inst2 = measurereport.MeasureReport(**data)\n    impl_measurereport_2(inst2)\n\n\ndef impl_measurereport_3(inst):\n    assert inst.contained[0].id == \"1\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].code.coding[0].display == \"Initial Population\"\n    assert (\n        inst.group[0].population[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/measure-population\"}\n        ).valueUri\n    )\n    assert inst.group[0].population[0].count == 2\n    assert inst.group[0].population[0].subjectResults.reference == \"#1\"\n    assert inst.id == \"788ca455-e11b1a59\"\n    assert inst.measure == (\n        \"http://lantanagroup.com/fhir/nhsn-measures/Measure/NHSNGlyce\"\n        \"micControlHypoglycemicInitialPopulation\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-08-31T23:59:59+00:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-08-01T00:00:00+00:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.reporter.reference == \"Organization/aa389ad5-e6fe-4030-88ce-010ab96e4ac4\"\n    )\n    assert inst.status == \"complete\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"subject-list\"\n\n\ndef test_measurereport_3(base_settings):\n    \"\"\"No. 3 tests collection for MeasureReport.\n    Test File: measurereport-788ca455-e11b1a59.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"measurereport-788ca455-e11b1a59.json\"\n    )\n    inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes())\n    assert \"MeasureReport\" == inst.get_resource_type()\n\n    impl_measurereport_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MeasureReport\" == data[\"resourceType\"]\n\n    inst2 = measurereport.MeasureReport(**data)\n    impl_measurereport_3(inst2)\n\n\ndef impl_measurereport_4(inst):\n    assert inst.group[0].code.coding[0].code == \"QRPH_ADX_ART1_N\"\n    assert float(inst.group[0].measureScoreQuantity.value) == float(0)\n    assert inst.group[0].stratifier[0].code.coding[0].code == \"AGE_GROUP:SEX\"\n    assert float(\n        inst.group[0].stratifier[0].stratum[0].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[0].stratifier[0].stratum[0].valueCodeableConcept.coding[0].code\n        == \"P0Y--P1Y:F\"\n    )\n    assert float(\n        inst.group[0].stratifier[0].stratum[1].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[0].stratifier[0].stratum[1].valueCodeableConcept.coding[0].code\n        == \"P0Y--P1Y:M\"\n    )\n    assert float(\n        inst.group[0].stratifier[0].stratum[2].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[0].stratifier[0].stratum[2].valueCodeableConcept.coding[0].code\n        == \"P1Y--P5Y:F\"\n    )\n    assert float(\n        inst.group[0].stratifier[0].stratum[3].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[0].stratifier[0].stratum[3].valueCodeableConcept.coding[0].code\n        == \"P1Y--P5Y:M\"\n    )\n    assert float(\n        inst.group[0].stratifier[0].stratum[4].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[0].stratifier[0].stratum[4].valueCodeableConcept.coding[0].code\n        == \"P10Y--P15Y:F\"\n    )\n    assert float(\n        inst.group[0].stratifier[0].stratum[5].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[0].stratifier[0].stratum[5].valueCodeableConcept.coding[0].code\n        == \"P10Y--P15Y:M\"\n    )\n    assert inst.group[1].code.coding[0].code == \"QRPH_ADX_ART1_N\"\n    assert float(inst.group[1].measureScoreQuantity.value) == float(0)\n    assert inst.group[1].stratifier[0].code.coding[0].code == \"AGE_GROUP:SEX\"\n    assert float(\n        inst.group[1].stratifier[0].stratum[0].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[1].stratifier[0].stratum[0].valueCodeableConcept.coding[0].code\n        == \"P0Y--P1Y:F\"\n    )\n    assert float(\n        inst.group[1].stratifier[0].stratum[1].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[1].stratifier[0].stratum[1].valueCodeableConcept.coding[0].code\n        == \"P0Y--P1Y:M\"\n    )\n    assert float(\n        inst.group[1].stratifier[0].stratum[2].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[1].stratifier[0].stratum[2].valueCodeableConcept.coding[0].code\n        == \"P1Y--P5Y:F\"\n    )\n    assert float(\n        inst.group[1].stratifier[0].stratum[3].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[1].stratifier[0].stratum[3].valueCodeableConcept.coding[0].code\n        == \"P1Y--P5Y:M\"\n    )\n    assert float(\n        inst.group[1].stratifier[0].stratum[4].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[1].stratifier[0].stratum[4].valueCodeableConcept.coding[0].code\n        == \"P10Y--P15Y:F\"\n    )\n    assert float(\n        inst.group[1].stratifier[0].stratum[5].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[1].stratifier[0].stratum[5].valueCodeableConcept.coding[0].code\n        == \"P10Y--P15Y:M\"\n    )\n    assert inst.group[2].code.coding[0].code == \"QRPH_ADX_ART1_N\"\n    assert float(inst.group[2].measureScoreQuantity.value) == float(0)\n    assert (\n        inst.group[2].stratifier[0].stratum[0].component[0].code.coding[0].code\n        == \"AGE_GROUP\"\n    )\n    assert (\n        inst.group[2]\n        .stratifier[0]\n        .stratum[0]\n        .component[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"P0Y--P1Y\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[0].component[1].code.coding[0].code == \"SEX\"\n    )\n    assert (\n        inst.group[2]\n        .stratifier[0]\n        .stratum[0]\n        .component[1]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"F\"\n    )\n    assert float(\n        inst.group[2].stratifier[0].stratum[0].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[2].stratifier[0].stratum[1].component[0].code.coding[0].code\n        == \"AGE_GROUP\"\n    )\n    assert (\n        inst.group[2]\n        .stratifier[0]\n        .stratum[1]\n        .component[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"P0Y--P1Y\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[1].component[1].code.coding[0].code == \"SEX\"\n    )\n    assert (\n        inst.group[2]\n        .stratifier[0]\n        .stratum[1]\n        .component[1]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"M\"\n    )\n    assert float(\n        inst.group[2].stratifier[0].stratum[1].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[2].stratifier[0].stratum[2].component[0].code.coding[0].code\n        == \"AGE_GROUP\"\n    )\n    assert (\n        inst.group[2]\n        .stratifier[0]\n        .stratum[2]\n        .component[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"P1Y--P5Y\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[2].component[1].code.coding[0].code == \"SEX\"\n    )\n    assert (\n        inst.group[2]\n        .stratifier[0]\n        .stratum[2]\n        .component[1]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"F\"\n    )\n    assert float(\n        inst.group[2].stratifier[0].stratum[2].measureScoreQuantity.value\n    ) == float(0)\n    assert (\n        inst.group[2].stratifier[0].stratum[3].component[0].code.coding[0].code\n        == \"AGE_GROUP\"\n    )\n    assert (\n        inst.group[2]\n        .stratifier[0]\n        .stratum[3]\n        .component[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"P1Y--P5Y\"\n    )\n    assert (\n        inst.group[2].stratifier[0].stratum[3].component[1].code.coding[0].code == \"SEX\"\n    )\n    assert (\n        inst.group[2]\n        .stratifier[0]\n        .stratum[3]\n        .component[1]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"F\"\n    )\n    assert float(\n        inst.group[2].stratifier[0].stratum[3].measureScoreQuantity.value\n    ) == float(0)\n    assert inst.id == \"hiv-indicators\"\n    assert inst.measure == \"http://ohie.org/Measure/hiv-indicators\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-01-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.reporter.reference == \"Organization/hl7\"\n    assert inst.status == \"complete\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"summary\"\n\n\ndef test_measurereport_4(base_settings):\n    \"\"\"No. 4 tests collection for MeasureReport.\n    Test File: measurereport-hiv-indicators.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"measurereport-hiv-indicators.json\"\n    inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes())\n    assert \"MeasureReport\" == inst.get_resource_type()\n\n    impl_measurereport_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MeasureReport\" == data[\"resourceType\"]\n\n    inst2 = measurereport.MeasureReport(**data)\n    impl_measurereport_4(inst2)\n\n\ndef impl_measurereport_5(inst):\n    assert inst.contained[0].id == \"reporter\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-04-01\"}\n        ).valueDateTime\n    )\n    assert inst.group[0].id == \"CMS146-group-1\"\n    assert inst.group[0].population[0].code.coding[0].code == \"initial-population\"\n    assert inst.group[0].population[0].count == 500\n    assert inst.group[0].population[1].code.coding[0].code == \"numerator\"\n    assert inst.group[0].population[1].count == 200\n    assert inst.group[0].population[2].code.coding[0].code == \"denominator\"\n    assert inst.group[0].population[2].count == 500\n    assert inst.group[0].population[3].code.coding[0].code == \"denominator-exclusion\"\n    assert inst.group[0].population[3].count == 100\n    assert inst.group[0].stratifier[0].code.text == \"stratifier-ages-up-to-9\"\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[0].count == 250\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[1].count == 100\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[2].count == 250\n    assert (\n        inst.group[0].stratifier[0].stratum[0].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[0].stratum[0].population[3].count == 50\n    assert inst.group[0].stratifier[0].stratum[0].valueBoolean is True\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[0].count == 250\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[1].count == 100\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[2].count == 250\n    assert (\n        inst.group[0].stratifier[0].stratum[1].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[0].stratum[1].population[3].count == 50\n    assert inst.group[0].stratifier[0].stratum[1].valueBoolean is False\n    assert inst.group[0].stratifier[1].code.text == \"stratifier-ages-10-plus\"\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[0].count == 250\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[1].count == 100\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[2].count == 250\n    assert (\n        inst.group[0].stratifier[1].stratum[0].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[1].stratum[0].population[3].count == 50\n    assert inst.group[0].stratifier[1].stratum[0].valueBoolean is True\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[0].count == 250\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[1].count == 100\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[2].count == 250\n    assert (\n        inst.group[0].stratifier[1].stratum[1].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[1].stratum[1].population[3].count == 50\n    assert inst.group[0].stratifier[1].stratum[1].valueBoolean is False\n    assert inst.group[0].stratifier[2].code.text == \"stratifier-gender\"\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[0].count == 250\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[1].count == 100\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[2].count == 250\n    assert (\n        inst.group[0].stratifier[2].stratum[0].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[0].population[3].count == 50\n    assert inst.group[0].stratifier[2].stratum[0].valueCodeableConcept.text == \"male\"\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[0].count == 250\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[1].count == 100\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[2].count == 250\n    assert (\n        inst.group[0].stratifier[2].stratum[1].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[1].population[3].count == 50\n    assert inst.group[0].stratifier[2].stratum[1].valueCodeableConcept.text == \"female\"\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[2].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[2].population[3].count == 0\n    assert inst.group[0].stratifier[2].stratum[2].valueCodeableConcept.text == \"other\"\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[0].code.coding[0].code\n        == \"initial-population\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[0].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[1].code.coding[0].code\n        == \"numerator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[1].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[2].code.coding[0].code\n        == \"denominator\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[2].count == 0\n    assert (\n        inst.group[0].stratifier[2].stratum[3].population[3].code.coding[0].code\n        == \"denominator-exclusion\"\n    )\n    assert inst.group[0].stratifier[2].stratum[3].population[3].count == 0\n    assert inst.group[0].stratifier[2].stratum[3].valueCodeableConcept.text == \"unknown\"\n    assert inst.id == \"measurereport-cms146-cat3-example\"\n    assert inst.identifier[0].value == \"measurereport-cms146-cat3-example-2017-03-13\"\n    assert inst.measure == \"http://example.org/fhir/Measure/CMS146\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-03-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.reporter.reference == \"#reporter\"\n    assert inst.status == \"complete\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"summary\"\n\n\ndef test_measurereport_5(base_settings):\n    \"\"\"No. 5 tests collection for MeasureReport.\n    Test File: measurereport-cms146-cat3-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"measurereport-cms146-cat3-example.json\"\n    )\n    inst = measurereport.MeasureReport.model_validate_json(filename.read_bytes())\n    assert \"MeasureReport\" == inst.get_resource_type()\n\n    impl_measurereport_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MeasureReport\" == data[\"resourceType\"]\n\n    inst2 = measurereport.MeasureReport(**data)\n    impl_measurereport_5(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_medication.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Medication\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import medication\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_medication_1(inst):\n    assert (\n        inst.batch.expirationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-31\"}\n        ).valueDateTime\n    )\n    assert inst.batch.lotNumber == \"12345\"\n    assert inst.code.coding[0].code == \"0169-7501-11\"\n    assert inst.code.coding[0].display == \"Novolog 100u/ml\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"mmanu\"\n    assert inst.doseForm.coding[0].code == \"385219001\"\n    assert inst.doseForm.coding[0].display == \"Injection solution (qualifier value)\"\n    assert (\n        inst.doseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0307\"\n    assert inst.ingredient[0].item.concept.coding[0].code == \"325072002\"\n    assert (\n        inst.ingredient[0].item.concept.coding[0].display\n        == \"Insulin Aspart (substance)\"\n    )\n    assert (\n        inst.ingredient[0].item.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.ingredient[0].strengthRatio.denominator.code == \"mL\"\n    assert (\n        inst.ingredient[0].strengthRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1)\n    assert inst.ingredient[0].strengthRatio.numerator.code == \"U\"\n    assert (\n        inst.ingredient[0].strengthRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(100)\n    assert inst.marketingAuthorizationHolder.reference == \"#mmanu\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_1(base_settings):\n    \"\"\"No. 1 tests collection for Medication.\n    Test File: medicationexample0307.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0307.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_1(inst2)\n\n\ndef impl_medication_2(inst):\n    assert inst.code.coding[0].code == \"373994007\"\n    assert inst.code.coding[0].display == \"Prednisone 5mg tablet (Product)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"sub03\"\n    assert inst.doseForm.coding[0].code == \"385055001\"\n    assert inst.doseForm.coding[0].display == \"Tablet dose form (qualifier value)\"\n    assert (\n        inst.doseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0311\"\n    assert inst.ingredient[0].item.reference.reference == \"#sub03\"\n    assert inst.ingredient[0].strengthRatio.denominator.code == \"TAB\"\n    assert (\n        inst.ingredient[0].strengthRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1)\n    assert inst.ingredient[0].strengthRatio.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].strengthRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(5)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_2(base_settings):\n    \"\"\"No. 2 tests collection for Medication.\n    Test File: medicationexample0311.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0311.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_2(inst2)\n\n\ndef impl_medication_3(inst):\n    assert inst.code.coding[0].code == \"430127000\"\n    assert inst.code.coding[0].display == \"Oral Form Oxycodone (product)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"sub03\"\n    assert inst.doseForm.coding[0].code == \"385055001\"\n    assert inst.doseForm.coding[0].display == \"Tablet dose form (qualifier value)\"\n    assert (\n        inst.doseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0310\"\n    assert inst.ingredient[0].item.reference.reference == \"#sub03\"\n    assert inst.ingredient[0].strengthRatio.denominator.code == \"TAB\"\n    assert (\n        inst.ingredient[0].strengthRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1)\n    assert inst.ingredient[0].strengthRatio.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].strengthRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(5)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_3(base_settings):\n    \"\"\"No. 3 tests collection for Medication.\n    Test File: medicationexample0310.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0310.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_3(inst2)\n\n\ndef impl_medication_4(inst):\n    assert (\n        inst.batch.expirationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-10-31\"}\n        ).valueDateTime\n    )\n    assert inst.batch.lotNumber == \"12345\"\n    assert inst.code.coding[0].code == \"51144-050-01\"\n    assert inst.code.coding[0].display == \"Adcetris\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"mmanu\"\n    assert inst.doseForm.coding[0].code == \"421637006\"\n    assert inst.doseForm.coding[0].display == (\n        \"Lyophilized powder for injectable solution (qualifier value)\" \" \"\n    )\n    assert (\n        inst.doseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0306\"\n    assert inst.marketingAuthorizationHolder.reference == \"#mmanu\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_4(base_settings):\n    \"\"\"No. 4 tests collection for Medication.\n    Test File: medicationexample0306.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0306.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_4(inst2)\n\n\ndef impl_medication_5(inst):\n    assert (\n        inst.batch.expirationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-05-22\"}\n        ).valueDateTime\n    )\n    assert inst.batch.lotNumber == \"9494788\"\n    assert inst.code.coding[0].code == \"0409-6531-02\"\n    assert (\n        inst.code.coding[0].display\n        == \"Vancomycin Hydrochloride (VANCOMYCIN HYDROCHLORIDE)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"mmanu\"\n    assert inst.doseForm.coding[0].code == \"385219001\"\n    assert inst.doseForm.coding[0].display == \"Injection Solution (qualifier value)\"\n    assert (\n        inst.doseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0301\"\n    assert inst.identifier[0].id == \"123456789\"\n    assert inst.ingredient[0].isActive is True\n    assert inst.ingredient[0].item.concept.coding[0].code == \"66955\"\n    assert (\n        inst.ingredient[0].item.concept.coding[0].display == \"Vancomycin Hydrochloride\"\n    )\n    assert (\n        inst.ingredient[0].item.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.ingredient[0].strengthRatio.denominator.code == \"mL\"\n    assert (\n        inst.ingredient[0].strengthRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(10)\n    assert inst.ingredient[0].strengthRatio.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].strengthRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(500)\n    assert inst.marketingAuthorizationHolder.reference == \"#mmanu\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_5(base_settings):\n    \"\"\"No. 5 tests collection for Medication.\n    Test File: medicationexample0301.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0301.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_5(inst2)\n\n\ndef impl_medication_6(inst):\n    assert inst.doseForm.coding[0].code == \"385219001\"\n    assert inst.doseForm.coding[0].display == \"Injection Solution (qualifier value)\"\n    assert (\n        inst.doseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.doseForm.text == \"Injection Solution (qualifier value)\"\n    assert inst.id == \"med0317\"\n    assert inst.ingredient[0].item.concept.coding[0].code == \"8591\"\n    assert inst.ingredient[0].item.concept.coding[0].display == \"Potassium Chloride\"\n    assert (\n        inst.ingredient[0].item.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.ingredient[0].strengthRatio.denominator.code == \"mL\"\n    assert (\n        inst.ingredient[0].strengthRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1000)\n    assert inst.ingredient[0].strengthRatio.numerator.code == \"meq\"\n    assert (\n        inst.ingredient[0].strengthRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(20)\n    assert inst.ingredient[1].item.concept.coding[0].code == \"313002\"\n    assert (\n        inst.ingredient[1].item.concept.coding[0].display\n        == \"1000 ml glucost 50mg/ml Injection\"\n    )\n    assert (\n        inst.ingredient[1].item.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.ingredient[1].strengthRatio.denominator.code == \"mL\"\n    assert (\n        inst.ingredient[1].strengthRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[1].strengthRatio.denominator.value) == float(100)\n    assert inst.ingredient[1].strengthRatio.numerator.code == \"g\"\n    assert (\n        inst.ingredient[1].strengthRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[1].strengthRatio.numerator.value) == float(5)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_6(base_settings):\n    \"\"\"No. 6 tests collection for Medication.\n    Test File: medicationexample0317.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0317.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_6(inst2)\n\n\ndef impl_medication_7(inst):\n    assert inst.code.text == \"Amoxicillin 250mg/5ml Suspension\"\n    assert inst.id == \"medicationexample1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Amoxicillin '\n        \"250mg/5ml Suspension</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_7(base_settings):\n    \"\"\"No. 7 tests collection for Medication.\n    Test File: medicationexample1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample1.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_7(inst2)\n\n\ndef impl_medication_8(inst):\n    assert (\n        inst.batch.expirationDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-05-22\"}\n        ).valueDateTime\n    )\n    assert inst.batch.lotNumber == \"9494788\"\n    assert inst.code.coding[0].code == \"213293\"\n    assert inst.code.coding[0].display == \"Capecitabine 500mg oral tablet (Xeloda)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"mmanu\"\n    assert inst.contained[1].id == \"sub04\"\n    assert inst.doseForm.coding[0].code == \"385055001\"\n    assert inst.doseForm.coding[0].display == \"Tablet dose form (qualifier value)\"\n    assert (\n        inst.doseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"medexample015\"\n    assert inst.ingredient[0].item.reference.reference == \"#sub04\"\n    assert inst.ingredient[0].strengthRatio.denominator.code == \"TAB\"\n    assert (\n        inst.ingredient[0].strengthRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1)\n    assert inst.ingredient[0].strengthRatio.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].strengthRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(500)\n    assert inst.marketingAuthorizationHolder.reference == \"#mmanu\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_8(base_settings):\n    \"\"\"No. 8 tests collection for Medication.\n    Test File: medicationexample15.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample15.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_8(inst2)\n\n\ndef impl_medication_9(inst):\n    assert inst.code.coding[0].code == \"108761006\"\n    assert inst.code.coding[0].display == \"Capecitabine (product)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"sub03\"\n    assert inst.doseForm.coding[0].code == \"385055001\"\n    assert inst.doseForm.coding[0].display == \"Tablet dose form (qualifier value)\"\n    assert (\n        inst.doseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0321\"\n    assert inst.ingredient[0].item.reference.reference == \"#sub03\"\n    assert inst.ingredient[0].strengthRatio.denominator.code == \"385055001\"\n    assert (\n        inst.ingredient[0].strengthRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.ingredient[0].strengthRatio.denominator.unit == \"Tablet\"\n    assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1)\n    assert inst.ingredient[0].strengthRatio.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].strengthRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(500)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_9(base_settings):\n    \"\"\"No. 9 tests collection for Medication.\n    Test File: medicationexample0321.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0321.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_9(inst2)\n\n\ndef impl_medication_10(inst):\n    assert inst.code.coding[0].code == \"324252006\"\n    assert inst.code.coding[0].display == \"Azithromycin 250mg capsule (product)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"sub03\"\n    assert inst.doseForm.coding[0].code == \"385055001\"\n    assert inst.doseForm.coding[0].display == \"Tablet dose form (qualifier value)\"\n    assert (\n        inst.doseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"med0320\"\n    assert inst.ingredient[0].item.reference.reference == \"#sub03\"\n    assert inst.ingredient[0].strengthRatio.denominator.code == \"TAB\"\n    assert (\n        inst.ingredient[0].strengthRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.denominator.value) == float(1)\n    assert inst.ingredient[0].strengthRatio.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].strengthRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.ingredient[0].strengthRatio.numerator.value) == float(250)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medication_10(base_settings):\n    \"\"\"No. 10 tests collection for Medication.\n    Test File: medicationexample0320.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationexample0320.json\"\n    inst = medication.Medication.model_validate_json(filename.read_bytes())\n    assert \"Medication\" == inst.get_resource_type()\n\n    impl_medication_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Medication\" == data[\"resourceType\"]\n\n    inst2 = medication.Medication(**data)\n    impl_medication_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_medicationadministration.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationAdministration\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import medicationadministration\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_medicationadministration_1(inst):\n    assert inst.contained[0].id == \"med0301\"\n    assert inst.contained[1].id == \"signature\"\n    assert inst.dosage.dose.code == \"mg\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mg\"\n    assert float(inst.dosage.dose.value) == float(500)\n    assert inst.dosage.method.text == \"IV Push\"\n    assert inst.dosage.route.coding[0].code == \"47625008\"\n    assert inst.dosage.route.coding[0].display == \"Intravenous route (qualifier value)\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == \"500mg IV q6h x 3 days\"\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.eventHistory[0].display == \"Author's Signature\"\n    assert inst.eventHistory[0].reference == \"#signature\"\n    assert inst.id == \"medadmin0301\"\n    assert inst.medication.reference.reference == \"#med0301\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.reference.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference.reference == \"Practitioner/f007\"\n    assert inst.reason[0].concept.coding[0].code == \"b\"\n    assert inst.reason[0].concept.coding[0].display == \"Given as Ordered\"\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/reason-medication-given\"\n            }\n        ).valueUri\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0318\"\n    assert inst.status == \"in-progress\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_1(base_settings):\n    \"\"\"No. 1 tests collection for MedicationAdministration.\n    Test File: medicationadministration0301.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0301.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_1(inst2)\n\n\ndef impl_medicationadministration_2(inst):\n    assert inst.contained[0].id == \"med0303\"\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"medadminexample03\"\n    assert inst.medication.reference.reference == \"#med0303\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Patient started Bupropion this morning - will administer in \"\n        \"a reduced dose tomorrow\"\n    )\n    assert (\n        inst.occurencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0317\"\n    assert inst.status == \"on-hold\"\n    assert inst.statusReason[0].coding[0].code == \"373147003\"\n    assert inst.statusReason[0].coding[0].display == (\n        \"Administration of medication not done due to a \" \"contraindication (situation)\"\n    )\n    assert (\n        inst.statusReason[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.supportingInformation[0].reference == \"Condition/f204\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_2(base_settings):\n    \"\"\"No. 2 tests collection for MedicationAdministration.\n    Test File: medicationadministrationexample3.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"medicationadministrationexample3.json\"\n    )\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_2(inst2)\n\n\ndef impl_medicationadministration_3(inst):\n    assert inst.contained[0].id == \"med0313\"\n    assert inst.device[0].reference.reference == \"Device/f001\"\n    assert inst.dosage.dose.code == \"mg\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mg\"\n    assert float(inst.dosage.dose.value) == float(7)\n    assert inst.dosage.method.coding[0].code == \"420620005\"\n    assert (\n        inst.dosage.method.coding[0].display\n        == \"Push - dosing instruction imperative (qualifier value)\"\n    )\n    assert (\n        inst.dosage.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.rateQuantity.code == \"min\"\n    assert (\n        inst.dosage.rateQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.rateQuantity.unit == \"min\"\n    assert float(inst.dosage.rateQuantity.value) == float(4)\n    assert inst.dosage.route.coding[0].code == \"255560000\"\n    assert inst.dosage.route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == (\n        \"0.05 - 0.1mg/kg IV over 2-5 minutes every 15 minutes as \" \"needed\"\n    )\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"medadmin0307\"\n    assert inst.medication.reference.reference == \"#med0313\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T04:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.reference.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference.reference == \"Practitioner/f007\"\n    assert inst.performer[0].function.coding[0].code == \"performer\"\n    assert inst.performer[0].function.coding[0].display == \"Performer\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/med-admin-perform-function\"\n            }\n        ).valueUri\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0315\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_3(base_settings):\n    \"\"\"No. 3 tests collection for MedicationAdministration.\n    Test File: medicationadministration0307.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0307.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_3(inst2)\n\n\ndef impl_medicationadministration_4(inst):\n    assert inst.contained[0].id == \"med0304\"\n    assert inst.dosage.dose.code == \"TAB\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"TAB\"\n    assert float(inst.dosage.dose.value) == float(1)\n    assert inst.dosage.route.coding[0].code == \"26643006\"\n    assert inst.dosage.route.coding[0].display == \"Oral Route\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == (\n        \"0.25mg PO every 6-12 hours as needed for menses from Jan \"\n        \"15-20, 2015.  Do not exceed more than 4mg per day\"\n    )\n    assert inst.id == \"medadmin0311\"\n    assert inst.medication.reference.reference == \"#med0304\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-16T02:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T22:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.reference.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference.reference == \"Practitioner/f007\"\n    assert inst.reason[0].concept.coding[0].code == \"266599000\"\n    assert inst.reason[0].concept.coding[0].display == \"Dysmenorrhea\"\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0305\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_4(base_settings):\n    \"\"\"No. 4 tests collection for MedicationAdministration.\n    Test File: medicationadministration0311.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0311.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_4(inst2)\n\n\ndef impl_medicationadministration_5(inst):\n    assert inst.contained[0].id == \"med0304\"\n    assert inst.dosage.dose.code == \"mg\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mg\"\n    assert float(inst.dosage.dose.value) == float(6)\n    assert inst.dosage.route.coding[0].code == \"26643006\"\n    assert inst.dosage.route.coding[0].display == \"Oral route (qualifier value)\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == (\n        \"6 mg PO daily for remission induction; adjust dosage to \"\n        \"white blood cell (WBC) count.  With hold treatment if WBC is\"\n        \" less than 15,000/µL; resume when WBC is greater than \"\n        \"50,000/µL\"\n    )\n    assert inst.id == \"medadmin0310\"\n    assert inst.medication.reference.reference == \"#med0304\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-16T02:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T22:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.reference.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference.reference == \"Practitioner/f007\"\n    assert inst.request.reference == \"MedicationRequest/medrx0306\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_5(base_settings):\n    \"\"\"No. 5 tests collection for MedicationAdministration.\n    Test File: medicationadministration0310.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0310.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_5(inst2)\n\n\ndef impl_medicationadministration_6(inst):\n    assert inst.contained[0].id == \"med0306\"\n    assert inst.dosage.dose.code == \"TAB\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"TAB\"\n    assert float(inst.dosage.dose.value) == float(2)\n    assert inst.dosage.method.coding[0].code == \"421521009\"\n    assert (\n        inst.dosage.method.coding[0].display\n        == \"Swallow - dosing instruction imperative (qualifier value)\"\n    )\n    assert (\n        inst.dosage.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.route.coding[0].code == \"26643006\"\n    assert inst.dosage.route.coding[0].display == \"Oral Route\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == \"Two tablets at once\"\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"medadmin0306\"\n    assert inst.medication.reference.reference == \"#med0306\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T04:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.reference.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference.reference == \"Practitioner/f007\"\n    assert inst.performer[0].function.coding[0].code == \"performer\"\n    assert inst.performer[0].function.coding[0].display == \"Performer\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/med-admin-perform-function\"\n            }\n        ).valueUri\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0302\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_6(base_settings):\n    \"\"\"No. 6 tests collection for MedicationAdministration.\n    Test File: medicationadministration0306.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0306.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_6(inst2)\n\n\ndef impl_medicationadministration_7(inst):\n    assert inst.contained[0].id == \"med0318\"\n    assert inst.device[0].reference.reference == \"Device/f001\"\n    assert inst.dosage.dose.code == \"mL\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mL\"\n    assert float(inst.dosage.dose.value) == float(1000)\n    assert inst.dosage.method.text == \"PICC line\"\n    assert inst.dosage.rateRatio.denominator.code == \"h\"\n    assert (\n        inst.dosage.rateRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.rateRatio.denominator.unit == \"h\"\n    assert float(inst.dosage.rateRatio.denominator.value) == float(1)\n    assert inst.dosage.rateRatio.numerator.code == \"mL\"\n    assert (\n        inst.dosage.rateRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.rateRatio.numerator.unit == \"mL\"\n    assert float(inst.dosage.rateRatio.numerator.value) == float(50)\n    assert inst.dosage.route.coding[0].code == \"255560000\"\n    assert inst.dosage.route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.site.coding[0].code == \"6073002\"\n    assert (\n        inst.dosage.site.coding[0].display\n        == \"Structure of ligament of left superior vena cava\"\n    )\n    assert (\n        inst.dosage.site.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.dosage.text\n        == \"1000mL infused at 50ml/hour for 4 hours - hung at 2200 hours\"\n    )\n    assert inst.id == \"medadmin0309\"\n    assert inst.medication.reference.reference == \"#med0318\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-16T02:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T22:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.reference.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference.reference == \"Practitioner/f007\"\n    assert inst.performer[0].function.coding[0].code == \"performer\"\n    assert inst.performer[0].function.coding[0].display == \"Performer\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/med-admin-perform-function\"\n            }\n        ).valueUri\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0323\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_7(base_settings):\n    \"\"\"No. 7 tests collection for MedicationAdministration.\n    Test File: medicationadministration0309.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0309.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_7(inst2)\n\n\ndef impl_medicationadministration_8(inst):\n    assert inst.dosage.dose.code == \"mg\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mg\"\n    assert float(inst.dosage.dose.value) == float(240)\n    assert inst.dosage.site.coding[0].code == \"34402009\"\n    assert inst.dosage.site.coding[0].display == \"Rectum structure\"\n    assert (\n        inst.dosage.site.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == (\n        \"Insert one suppository rectally twice daily as needed for \"\n        \"fever to a maximim of 3 per day\"\n    )\n    assert inst.id == \"medadmin0313\"\n    assert inst.medication.concept.coding[0].code == \"322254008\"\n    assert (\n        inst.medication.concept.coding[0].display\n        == \"Paracetamol 240mg suppository (product)\"\n    )\n    assert (\n        inst.medication.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-16T02:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T22:03:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.reference.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference.reference == \"Practitioner/f007\"\n    assert inst.reason[0].concept.coding[0].code == \"c\"\n    assert inst.reason[0].concept.coding[0].display == \"Emergency\"\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/reason-medication-given\"\n            }\n        ).valueUri\n    )\n    assert inst.request.reference == \"MedicationRequest/medrx0324\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_8(base_settings):\n    \"\"\"No. 8 tests collection for MedicationAdministration.\n    Test File: medicationadministration0313.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0313.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_8(inst2)\n\n\ndef impl_medicationadministration_9(inst):\n    assert inst.contained[0].id == \"med0306\"\n    assert inst.dosage.dose.code == \"mg/kg\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mg/kg\"\n    assert float(inst.dosage.dose.value) == float(1.8)\n    assert (\n        inst.dosage.rateRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.rateRatio.denominator.unit == \"min\"\n    assert float(inst.dosage.rateRatio.denominator.value) == float(30)\n    assert (\n        inst.dosage.rateRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.rateRatio.numerator.unit == \"ml\"\n    assert float(inst.dosage.rateRatio.numerator.value) == float(250)\n    assert inst.dosage.route.coding[0].code == \"255560000\"\n    assert inst.dosage.route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == \"1.8 mg/kg IV infusion over 30 minutes\"\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"medadmin0305\"\n    assert inst.medication.reference.reference == \"#med0306\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T04:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.reference.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference.reference == \"Practitioner/f007\"\n    assert inst.request.reference == \"MedicationRequest/medrx0316\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_9(base_settings):\n    \"\"\"No. 9 tests collection for MedicationAdministration.\n    Test File: medicationadministration0305.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0305.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_9(inst2)\n\n\ndef impl_medicationadministration_10(inst):\n    assert inst.contained[0].id == \"med0303\"\n    assert inst.dosage.dose.code == \"mg\"\n    assert (\n        inst.dosage.dose.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage.dose.unit == \"mg\"\n    assert float(inst.dosage.dose.value) == float(3)\n    assert inst.dosage.method.coding[0].code == \"422145002\"\n    assert (\n        inst.dosage.method.coding[0].display\n        == \"Inject - dosing instruction imperative (qualifier value)\"\n    )\n    assert (\n        inst.dosage.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.route.coding[0].code == \"47625008\"\n    assert inst.dosage.route.coding[0].display == \"Intravenous route (qualifier value)\"\n    assert (\n        inst.dosage.route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage.text == (\n        \"Rapid daily-dose escalation, until tolerated, from 3 mg/d, \"\n        \"and then 10 mg/d, to the recommended maintenance dose of 30 \"\n        \"mg IV over 120 min, 3 times per wk on alternate days for up \"\n        \"to 12 wk\"\n    )\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"medadmin0304\"\n    assert inst.medication.reference.reference == \"#med0303\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T14:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T04:30:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.reference.display == \"Patrick Pump\"\n    assert inst.performer[0].actor.reference.reference == \"Practitioner/f007\"\n    assert inst.reason[0].reference.reference == \"Condition/f202\"\n    assert inst.request.reference == \"MedicationRequest/medrx0319\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationadministration_10(base_settings):\n    \"\"\"No. 10 tests collection for MedicationAdministration.\n    Test File: medicationadministration0304.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationadministration0304.json\"\n    inst = medicationadministration.MedicationAdministration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationAdministration\" == inst.get_resource_type()\n\n    impl_medicationadministration_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationAdministration\" == data[\"resourceType\"]\n\n    inst2 = medicationadministration.MedicationAdministration(**data)\n    impl_medicationadministration_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_medicationdispense.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationDispense\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import medicationdispense\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_medicationdispense_1(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0316\"\n    assert inst.contained[0].id == \"med0306\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(1)\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg/kg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg/kg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1.8\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"255560000\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == (\n        \"1.8 mg/kg IV infusion over 30 minutes every 3 weeks for 16 \" \"cycles\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.count == 16\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(3)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"wk\"\n    assert inst.id == \"meddisp0317\"\n    assert inst.medication.reference.display == \"Brentixumab Vedotin (Adcetris)\"\n    assert inst.medication.reference.reference == \"#med0306\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"415818005\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(3)\n    assert inst.status == \"stopped\"\n    assert inst.subject.display == \"Donald Duck \"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"TF\"\n    assert inst.type.coding[0].display == \"Trial Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenHandedOver\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-06-26T07:13:00+05:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-06-25T07:13:00+05:00\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_1(base_settings):\n    \"\"\"No. 1 tests collection for MedicationDispense.\n    Test File: medicationdispense0317.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0317.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_1(inst2)\n\n\ndef impl_medicationdispense_2(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0318\"\n    assert inst.contained[0].id == \"med0301\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(3)\n    assert inst.destination.reference == \"Location/ph\"\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        500\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].method.coding[0].code == \"420620005\"\n    assert (\n        inst.dosageInstruction[0].method.coding[0].display\n        == \"Push - dosing instruction imperative (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"255560000\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"500mg IV q6h x 3 days\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(6)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"h\"\n    assert inst.id == \"meddisp0301\"\n    assert inst.location.display == \"Pharmacy\"\n    assert inst.location.reference == \"Location/ukp\"\n    assert inst.medication.reference.display == \"Vancomycin Hydrochloride\"\n    assert inst.medication.reference.reference == \"#med0301\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"733026001\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info.sct\"}\n        ).valueUri\n    )\n    assert inst.quantity.unit == \"Vial\"\n    assert float(inst.quantity.value) == float(12)\n    assert inst.receiver[0].display == \"Donald Duck\"\n    assert inst.receiver[0].reference == \"Patient/pat1\"\n    assert inst.status == \"in-progress\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.supportingInformation[0].reference == \"Condition/f203\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"EM\"\n    assert inst.type.coding[0].display == \"Emergency Supply\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T10:20:00Z\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_2(base_settings):\n    \"\"\"No. 2 tests collection for MedicationDispense.\n    Test File: medicationdispense0301.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0301.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_2(inst2)\n\n\ndef impl_medicationdispense_3(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0321\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(10)\n    assert (\n        inst.dosageInstruction[0].additionalInstruction[0].coding[0].code == \"418914006\"\n    )\n    assert inst.dosageInstruction[0].additionalInstruction[0].coding[0].display == (\n        \"Warning. May cause drowsiness. If affected do not drive or \"\n        \"operate machinery. Avoid alcoholic drink (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].additionalInstruction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].asNeededFor[0].coding[0].code == \"203082005\"\n    assert (\n        inst.dosageInstruction[0].asNeededFor[0].coding[0].display\n        == \"Fibromyalgia (disorder)\"\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededFor[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"TAB\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"TAB\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"26643006\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Oral Route\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert (\n        inst.dosageInstruction[0].text == \"1 tablet every four hours as needed for pain\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(4)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"h\"\n    assert inst.id == \"meddisp0321\"\n    assert inst.medication.concept.coding[0].code == \"0074-3043-13\"\n    assert (\n        inst.medication.concept.coding[0].display\n        == \"Vicodin 5mg Hydrocodone, 500mg Acetaminophen tablet \"\n    )\n    assert (\n        inst.medication.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"TAB\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(30)\n    assert inst.status == \"in-progress\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"RFP\"\n    assert inst.type.coding[0].display == \"Refill - Part Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T10:20:00Z\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_3(base_settings):\n    \"\"\"No. 3 tests collection for MedicationDispense.\n    Test File: medicationdispense0321.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0321.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_3(inst2)\n\n\ndef impl_medicationdispense_4(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0323\"\n    assert inst.contained[0].id == \"med0318\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(1)\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mL\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mL\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1000\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.code == \"h\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.unit == \"h\"\n    assert float(\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.value\n    ) == float(1)\n    assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.code == \"mL\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.unit == \"mL\"\n    assert float(\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.value\n    ) == float(50)\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"255560000\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert (\n        inst.dosageInstruction[0].text\n        == \"1000mL infused at 50ml/hour for 4 hours - hang at 2200 hours\"\n    )\n    assert (\n        inst.dosageInstruction[0].timing.event[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T22:00:00+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(24)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"h\"\n    assert inst.id == \"meddisp0320\"\n    assert inst.medication.reference.display == \"TPN Solution\"\n    assert inst.medication.reference.reference == \"#med0318\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"ml\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(1000)\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.whenHandedOver\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-17T17:13:00+05:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-16T17:13:00+05:00\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_4(base_settings):\n    \"\"\"No. 4 tests collection for MedicationDispense.\n    Test File: medicationdispense0320.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0320.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_4(inst2)\n\n\ndef impl_medicationdispense_5(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0320\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(30)\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"U\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"U\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        20\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"263887005\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].display\n        == \"Subcutaneous (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"20 Units SC three times daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 3\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"meddisp0316\"\n    assert inst.medication.concept.coding[0].code == \"285018\"\n    assert (\n        inst.medication.concept.coding[0].display\n        == \"Lantus 100 unit/ml injectable solution\"\n    )\n    assert (\n        inst.medication.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"ml\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(10)\n    assert inst.status == \"in-progress\"\n    assert inst.subject.display == \"Donald Duck \"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"RFP\"\n    assert inst.type.coding[0].display == \"Refill - Part Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-06-25T07:13:00+05:00\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_5(base_settings):\n    \"\"\"No. 5 tests collection for MedicationDispense.\n    Test File: medicationdispense0316.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0316.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_5(inst2)\n\n\ndef impl_medicationdispense_6(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0321\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(30)\n    assert inst.dosageInstruction[0].additionalInstruction[0].text == \"Shake Well\"\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"ORINHL\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"ea\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"Use two sprays twice daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 2\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"meddisp0327\"\n    assert inst.medication.concept.coding[0].code == \"746763\"\n    assert inst.medication.concept.coding[0].display == (\n        \"Proventil 0.09mg/actuat (Albuterol sulfate 0.108mg/actuat \" \"from mouthpiece)\"\n    )\n    assert (\n        inst.medication.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"ml\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(30)\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"TF\"\n    assert inst.type.coding[0].display == \"Trial Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenHandedOver\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T16:20:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T10:20:00Z\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_6(base_settings):\n    \"\"\"No. 6 tests collection for MedicationDispense.\n    Test File: medicationdispense0327.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0327.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_6(inst2)\n\n\ndef impl_medicationdispense_7(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0309\"\n    assert inst.contained[0].id == \"medexample015\"\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        500\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"394899003\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].display\n        == \"oral administration of treatment\"\n    )\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 2\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(21)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"meddisp008\"\n    assert inst.medication.reference.reference == \"#medexample015\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationdispense_7(base_settings):\n    \"\"\"No. 7 tests collection for MedicationDispense.\n    Test File: medicationdispenseexample8.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispenseexample8.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_7(inst2)\n\n\ndef impl_medicationdispense_8(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0331\"\n    assert inst.contained[0].id == \"med0352\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(1)\n    assert inst.dosageInstruction[0].additionalInstruction[0].text == (\n        \"Take along with one 2mg Coumadin tablet for a total daily \"\n        \"dose of 7mg as prescribed by physician\"\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        2\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert (\n        inst.dosageInstruction[0].text\n        == \"7mg (=one 5mg tablet PLUS one 2mg tablet) once daily\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"meddisp0331\"\n    assert inst.medication.reference.display == \"Coumadin 2mg tablet\"\n    assert inst.medication.reference.reference == \"#med0352\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"415818006\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(1)\n    assert inst.status == \"in-progress\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"DF\"\n    assert inst.type.coding[0].display == \"Daily Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T10:20:00Z\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_8(base_settings):\n    \"\"\"No. 8 tests collection for MedicationDispense.\n    Test File: medicationdispense0331.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0331.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_8(inst2)\n\n\ndef impl_medicationdispense_9(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0324\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(10)\n    assert (\n        inst.dosageInstruction[0].additionalInstruction[0].coding[0].code == \"418637003\"\n    )\n    assert inst.dosageInstruction[0].additionalInstruction[0].coding[0].display == (\n        \"Do not take with any other paracetamol products (qualifier \" \"value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].additionalInstruction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].asNeededFor[0].coding[0].code == \"386661006\"\n    assert (\n        inst.dosageInstruction[0].asNeededFor[0].coding[0].display == \"Fever (finding)\"\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededFor[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        240\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].maxDosePerPeriod[0].denominator.code == \"d\"\n    assert (\n        inst.dosageInstruction[0].maxDosePerPeriod[0].denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(\n        inst.dosageInstruction[0].maxDosePerPeriod[0].denominator.value\n    ) == float(1)\n    assert inst.dosageInstruction[0].maxDosePerPeriod[0].numerator.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].maxDosePerPeriod[0].numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(\n        inst.dosageInstruction[0].maxDosePerPeriod[0].numerator.value\n    ) == float(720)\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == (\n        \"Insert two suppositories (240mg) rectally twice daily as \"\n        \"needed for fever to a maximim of 6 per day\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 2\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"meddisp0311\"\n    assert inst.medication.concept.coding[0].code == \"0713-0118\"\n    assert (\n        inst.medication.concept.coding[0].display == \"Acetaminophen 120mg Suppository\"\n    )\n    assert (\n        inst.medication.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"RECSUPP\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(60)\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"RFP\"\n    assert inst.type.coding[0].display == \"Refill - Part Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenHandedOver\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T16:20:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T10:20:00Z\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_9(base_settings):\n    \"\"\"No. 9 tests collection for MedicationDispense.\n    Test File: medicationdispense0311.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0311.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_9(inst2)\n\n\ndef impl_medicationdispense_10(inst):\n    assert inst.authorizingPrescription[0].reference == \"MedicationRequest/medrx0306\"\n    assert inst.daysSupply.code == \"d\"\n    assert (\n        inst.daysSupply.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.daysSupply.unit == \"Day\"\n    assert float(inst.daysSupply.value) == float(30)\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        6\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"calculated\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Calculated\"\n    )\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"Take 3 tablets (6mg) once daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"meddisp0307\"\n    assert inst.medication.concept.coding[0].code == \"76388-713-25\"\n    assert (\n        inst.medication.concept.coding[0].display == \"Myleran 2mg tablet, film coated\"\n    )\n    assert (\n        inst.medication.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.reference == \"Practitioner/f006\"\n    assert inst.quantity.code == \"TAB\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert float(inst.quantity.value) == float(90)\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"RFP\"\n    assert inst.type.coding[0].display == \"Refill - Part Fill\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert (\n        inst.whenHandedOver\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T16:20:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.whenPrepared\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15T10:20:00Z\"}\n        ).valueDateTime\n    )\n\n\ndef test_medicationdispense_10(base_settings):\n    \"\"\"No. 10 tests collection for MedicationDispense.\n    Test File: medicationdispense0307.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationdispense0307.json\"\n    inst = medicationdispense.MedicationDispense.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationDispense\" == inst.get_resource_type()\n\n    impl_medicationdispense_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationDispense\" == data[\"resourceType\"]\n\n    inst2 = medicationdispense.MedicationDispense(**data)\n    impl_medicationdispense_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_medicationknowledge.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationKnowledge\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import medicationknowledge\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_medicationknowledge_1(inst):\n    assert inst.code.coding[0].code == \"0409-6531-02\"\n    assert (\n        inst.code.coding[0].display\n        == \"Vancomycin Hydrochloride (VANCOMYCIN HYDROCHLORIDE)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/ndc\"}\n        ).valueUri\n    )\n    assert inst.definitional.doseForm.coding[0].code == \"385268001\"\n    assert (\n        inst.definitional.doseForm.coding[0].display\n        == \"Oral Dose Form (qualifier value)\"\n    )\n    assert (\n        inst.definitional.doseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0] == \"Vancomycin Hydrochloride (VANCOMYCIN HYDROCHLORIDE)\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationknowledge_1(base_settings):\n    \"\"\"No. 1 tests collection for MedicationKnowledge.\n    Test File: medicationknowledge-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationknowledge-example.json\"\n    inst = medicationknowledge.MedicationKnowledge.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationKnowledge\" == inst.get_resource_type()\n\n    impl_medicationknowledge_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationKnowledge\" == data[\"resourceType\"]\n\n    inst2 = medicationknowledge.MedicationKnowledge(**data)\n    impl_medicationknowledge_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_medicationrequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import medicationrequest\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_medicationrequest_1(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.code == \"d\"\n    assert (\n        inst.dispenseRequest.expectedSupplyDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.unit == \"days\"\n    assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30)\n    assert inst.dispenseRequest.numberOfRepeatsAllowed == 3\n    assert inst.dispenseRequest.quantity.code == \"mL\"\n    assert (\n        inst.dispenseRequest.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.quantity.unit == \"mL\"\n    assert float(inst.dispenseRequest.quantity.value) == float(30)\n    assert (\n        inst.dispenseRequest.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dispenseRequest.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dosageInstruction[0].additionalInstruction[0].text == \"Shake Well\"\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"ORINHL\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"ea\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"Use two sprays twice daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 2\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"medrx0326\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medication.concept.coding[0].code == \"746763\"\n    assert (\n        inst.medication.concept.coding[0].display\n        == \"Proventil HFA 90mcg/actuat metered dose inhaler, 200 actuat\"\n    )\n    assert (\n        inst.medication.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"on-hold\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.substitution.allowedBoolean is True\n    assert inst.substitution.reason.coding[0].code == \"FP\"\n    assert inst.substitution.reason.coding[0].display == \"formulary policy\"\n    assert (\n        inst.substitution.reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_1(base_settings):\n    \"\"\"No. 1 tests collection for MedicationRequest.\n    Test File: medicationrequest0326.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0326.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_1(inst2)\n\n\ndef impl_medicationrequest_2(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0305\"\n    assert inst.dispenseRequest.expectedSupplyDuration.code == \"d\"\n    assert (\n        inst.dispenseRequest.expectedSupplyDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.unit == \"days\"\n    assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30)\n    assert inst.dispenseRequest.numberOfRepeatsAllowed == 1\n    assert inst.dispenseRequest.quantity.code == \"mL\"\n    assert (\n        inst.dispenseRequest.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.quantity.unit == \"mL\"\n    assert float(inst.dispenseRequest.quantity.value) == float(10)\n    assert (\n        inst.dispenseRequest.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dispenseRequest.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"OPDROP\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"OPDROP\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].method.coding[0].code == \"421538008\"\n    assert (\n        inst.dosageInstruction[0].method.coding[0].display\n        == \"Instill - dosing instruction imperative (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"54485002\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].display\n        == \"Ophthalmic route (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"Instil one drop in each eye twice daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 2\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f002\"\n    assert inst.id == \"medrx0330\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medication.reference.reference == \"#med0305\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.substitution.allowedBoolean is False\n    assert inst.substitution.reason.coding[0].code == \"FP\"\n    assert inst.substitution.reason.coding[0].display == \"formulary policy\"\n    assert (\n        inst.substitution.reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_2(base_settings):\n    \"\"\"No. 2 tests collection for MedicationRequest.\n    Test File: medicationrequest0330.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0330.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_2(inst2)\n\n\ndef impl_medicationrequest_3(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0309\"\n    assert inst.dosageInstruction[0].additionalInstruction[0].text == \"Take at bedtime\"\n    assert inst.dosageInstruction[0].asNeededFor[0].coding[0].code == \"32914008\"\n    assert inst.dosageInstruction[0].asNeededFor[0].coding[0].display == \"Restless Legs\"\n    assert (\n        inst.dosageInstruction[0].asNeededFor[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseRange.high.code == \"TAB\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseRange.high.unit == \"TAB\"\n    assert float(\n        inst.dosageInstruction[0].doseAndRate[0].doseRange.high.value\n    ) == float(2)\n    assert inst.dosageInstruction[0].doseAndRate[0].doseRange.low.code == \"TAB\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseRange.low.unit == \"TAB\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseRange.low.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"26643006\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Oral Route\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == (\n        \"Take 1-2 tablets once daily at bedtime as needed for \" \"restless legs\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"medrx0310\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medication.reference.reference == \"#med0309\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_3(base_settings):\n    \"\"\"No. 3 tests collection for MedicationRequest.\n    Test File: medicationrequest0310.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0310.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_3(inst2)\n\n\ndef impl_medicationrequest_4(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0343b\"\n    assert inst.dosageInstruction[0].asNeededFor[0].coding[0].code == \"16932000\"\n    assert (\n        inst.dosageInstruction[0].asNeededFor[0].coding[0].display\n        == \"Nausea and Vomiting\"\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededFor[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        4\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"78421000\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Intramuscular Route\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"4mg IM twice daily as needed for nausea\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 2\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.use == \"official\"\n    assert inst.groupIdentifier.value == \"9898\"\n    assert inst.id == \"medrx0343b\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"98765\"\n    assert inst.intent == \"option\"\n    assert inst.medication.reference.display == \"Ondansetron 2mg/ml Injection\"\n    assert inst.medication.reference.reference == \"#med0343b\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_4(base_settings):\n    \"\"\"No. 4 tests collection for MedicationRequest.\n    Test File: medicationrequest0343b.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0343b.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_4(inst2)\n\n\ndef impl_medicationrequest_5(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0304\"\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        6\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"26643006\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].display\n        == \"Oral route (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == (\n        \"6 mg PO daily for remission induction; adjust dosage to \"\n        \"white blood cell (WBC) count.  With hold treatment if WBC is\"\n        \" less than 15,000/µL; resume when WBC is greater than \"\n        \"50,000/µL\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"medrx0306\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medication.reference.display == \"Myleran 2mg tablet\"\n    assert inst.medication.reference.reference == \"#med0304\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.reason[0].concept.coding[0].code == \"92818009\"\n    assert (\n        inst.reason[0].concept.coding[0].display\n        == \"Chronic myeloid Leukemia (disorder)\"\n    )\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_5(base_settings):\n    \"\"\"No. 5 tests collection for MedicationRequest.\n    Test File: medicationrequest0306.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0306.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_5(inst2)\n\n\ndef impl_medicationrequest_6(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0308\"\n    assert inst.dispenseRequest.expectedSupplyDuration.code == \"d\"\n    assert (\n        inst.dispenseRequest.expectedSupplyDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.unit == \"days\"\n    assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(10)\n    assert inst.dispenseRequest.quantity.code == \"TAB\"\n    assert (\n        inst.dispenseRequest.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.quantity.unit == \"TAB\"\n    assert float(inst.dispenseRequest.quantity.value) == float(30)\n    assert (\n        inst.dispenseRequest.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dispenseRequest.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dosageInstruction[0].additionalInstruction[0].coding[0].code == \"418914006\"\n    )\n    assert inst.dosageInstruction[0].additionalInstruction[0].coding[0].display == (\n        \"Warning. May cause drowsiness. If affected do not drive or \"\n        \"operate machinery. Avoid alcoholic drink (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].additionalInstruction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].asNeededFor[0].coding[0].code == \"203082005\"\n    assert (\n        inst.dosageInstruction[0].asNeededFor[0].coding[0].display\n        == \"Fibromyalgia (disorder)\"\n    )\n    assert (\n        inst.dosageInstruction[0].asNeededFor[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"TAB\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"TAB\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"26643006\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Oral Route\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert (\n        inst.dosageInstruction[0].text == \"1 tablet every four hours as needed for pain\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(4)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"h\"\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"medrx0307\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medication.reference.reference == \"#med0308\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.substitution.allowedBoolean is True\n    assert inst.substitution.reason.coding[0].code == \"FP\"\n    assert inst.substitution.reason.coding[0].display == \"formulary policy\"\n    assert (\n        inst.substitution.reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_6(base_settings):\n    \"\"\"No. 6 tests collection for MedicationRequest.\n    Test File: medicationrequest0307.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0307.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_6(inst2)\n\n\ndef impl_medicationrequest_7(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0350\"\n    assert inst.dispenseRequest.expectedSupplyDuration.code == \"d\"\n    assert (\n        inst.dispenseRequest.expectedSupplyDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.unit == \"days\"\n    assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30)\n    assert inst.dispenseRequest.numberOfRepeatsAllowed == 3\n    assert inst.dispenseRequest.quantity.code == \"TAB\"\n    assert (\n        inst.dispenseRequest.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.quantity.unit == \"TAB\"\n    assert float(inst.dispenseRequest.quantity.value) == float(30)\n    assert (\n        inst.dispenseRequest.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dispenseRequest.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        7\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"7mg once daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"medrx0331\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medication.reference.reference == \"#med0350\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.substitution.allowedBoolean is True\n    assert inst.substitution.reason.coding[0].code == \"FP\"\n    assert inst.substitution.reason.coding[0].display == \"formulary policy\"\n    assert (\n        inst.substitution.reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_7(base_settings):\n    \"\"\"No. 7 tests collection for MedicationRequest.\n    Test File: medicationrequest0331.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0331.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_7(inst2)\n\n\ndef impl_medicationrequest_8(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.code == \"d\"\n    assert (\n        inst.dispenseRequest.expectedSupplyDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.unit == \"days\"\n    assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(14)\n    assert inst.dispenseRequest.quantity.code == \"PATCH\"\n    assert (\n        inst.dispenseRequest.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.quantity.unit == \"patch\"\n    assert float(inst.dispenseRequest.quantity.value) == float(6)\n    assert (\n        inst.dispenseRequest.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dispenseRequest.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"PATCH\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"patch\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"apply one patch three times per week\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 3\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"wk\"\n    assert inst.id == \"medrx0327\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medication.concept.coding[0].code == \"333919005\"\n    assert (\n        inst.medication.concept.coding[0].display\n        == \"Fentanyl 25micrograms/hour patch (product)\"\n    )\n    assert (\n        inst.medication.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_8(base_settings):\n    \"\"\"No. 8 tests collection for MedicationRequest.\n    Test File: medicationrequest0327.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0327.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_8(inst2)\n\n\ndef impl_medicationrequest_9(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"med0306\"\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"mg/kg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"mg/kg\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        1.8\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.code == \"min\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.denominator.value\n    ) == float(20)\n    assert inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.code == \"mg/kg\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(\n        inst.dosageInstruction[0].doseAndRate[0].rateRatio.numerator.value\n    ) == float(1.8)\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].maxDosePerLifetime.code == \"mg\"\n    assert (\n        inst.dosageInstruction[0].maxDosePerLifetime.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].maxDosePerLifetime.unit == \"mg\"\n    assert float(inst.dosageInstruction[0].maxDosePerLifetime.value) == float(400)\n    assert inst.dosageInstruction[0].route.coding[0].code == \"255560000\"\n    assert inst.dosageInstruction[0].route.coding[0].display == \"Intravenous\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == (\n        \"1.8 mg/kg IV infusion over 20 minutes every 3 weeks for 16 \" \"cycles\"\n    )\n    assert inst.dosageInstruction[0].timing.repeat.count == 16\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 1\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(3)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"wk\"\n    assert inst.encounter.display == \"encounter who leads to this prescription\"\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"medrx0316\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medication.reference.reference == \"#med0306\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_9(base_settings):\n    \"\"\"No. 9 tests collection for MedicationRequest.\n    Test File: medicationrequest0316.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0316.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_9(inst2)\n\n\ndef impl_medicationrequest_10(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.code == \"d\"\n    assert (\n        inst.dispenseRequest.expectedSupplyDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.expectedSupplyDuration.unit == \"days\"\n    assert float(inst.dispenseRequest.expectedSupplyDuration.value) == float(30)\n    assert inst.dispenseRequest.numberOfRepeatsAllowed == 6\n    assert inst.dispenseRequest.quantity.code == \"mL\"\n    assert (\n        inst.dispenseRequest.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dispenseRequest.quantity.unit == \"mL\"\n    assert float(inst.dispenseRequest.quantity.value) == float(10)\n    assert (\n        inst.dispenseRequest.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dispenseRequest.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-15\"}\n        ).valueDateTime\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.code == \"U\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].doseQuantity.unit == \"U\"\n    assert float(inst.dosageInstruction[0].doseAndRate[0].doseQuantity.value) == float(\n        20\n    )\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosageInstruction[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosageInstruction[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].route.coding[0].code == \"263887005\"\n    assert (\n        inst.dosageInstruction[0].route.coding[0].display\n        == \"Subcutaneous (qualifier value)\"\n    )\n    assert (\n        inst.dosageInstruction[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosageInstruction[0].sequence == 1\n    assert inst.dosageInstruction[0].text == \"20 Units SC three times daily\"\n    assert inst.dosageInstruction[0].timing.repeat.frequency == 3\n    assert float(inst.dosageInstruction[0].timing.repeat.period) == float(1)\n    assert inst.dosageInstruction[0].timing.repeat.periodUnit == \"d\"\n    assert inst.id == \"medrx0320\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/prescriptions\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.intent == \"order\"\n    assert inst.medication.concept.coding[0].code == \"285018\"\n    assert (\n        inst.medication.concept.coding[0].display\n        == \"Lantus 100 unit/ml injectable solution\"\n    )\n    assert (\n        inst.medication.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.nlm.nih.gov/research/umls/rxnorm\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.reason[0].concept.coding[0].code == \"473189005\"\n    assert (\n        inst.reason[0].concept.coding[0].display\n        == \"On subcutaneous insulin for diabetes mellitus (finding)\"\n    )\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.requester.display == \"Patrick Pump\"\n    assert inst.requester.reference == \"Practitioner/f007\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationrequest_10(base_settings):\n    \"\"\"No. 10 tests collection for MedicationRequest.\n    Test File: medicationrequest0320.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationrequest0320.json\"\n    inst = medicationrequest.MedicationRequest.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationRequest\" == inst.get_resource_type()\n\n    impl_medicationrequest_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationRequest\" == data[\"resourceType\"]\n\n    inst2 = medicationrequest.MedicationRequest(**data)\n    impl_medicationrequest_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_medicationstatement.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicationStatement\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import medicationstatement\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_medicationstatement_1(inst):\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-22\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-01-23\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/f203\"\n    assert inst.id == \"example005\"\n    assert inst.informationSource[0].display == \"Donald Duck\"\n    assert inst.informationSource[0].reference == \"Patient/pat1\"\n    assert inst.medication.concept.coding[0].code == \"27658006\"\n    assert inst.medication.concept.coding[0].display == \"Amoxicillin (product)\"\n    assert (\n        inst.medication.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Patient indicated that they thought it was Amoxicillin they \"\n        \"were taking but it was really Erythromycin\"\n    )\n    assert inst.status == \"entered-in-error\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_1(base_settings):\n    \"\"\"No. 1 tests collection for MedicationStatement.\n    Test File: medicationstatementexample5.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample5.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_1(inst2)\n\n\ndef impl_medicationstatement_2(inst):\n    assert inst.contained[0].id == \"med0315\"\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-22\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-23\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example009\"\n    assert inst.informationSource[0].display == \"Donald Duck\"\n    assert inst.informationSource[0].reference == \"Patient/pat1\"\n    assert inst.medication.reference.reference == \"#med0315\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.note[0].text\n        == \"Patient reports they used the medication patch on this day.\"\n    )\n    assert inst.partOf[0].reference == \"MedicationStatement/example008\"\n    assert inst.status == \"recorded\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_2(base_settings):\n    \"\"\"No. 2 tests collection for MedicationStatement.\n    Test File: medicationstatementexample9.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample9.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_2(inst2)\n\n\ndef impl_medicationstatement_3(inst):\n    assert inst.contained[0].id == \"med0309\"\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.code == \"TPATH24\"\n    assert (\n        inst.dosage[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == \"patch\"\n    assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(1)\n    assert inst.id == \"example008\"\n    assert inst.medication.reference.reference == \"#med0309\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Patient reports they used the given patches over the last 30\" \" days\"\n    )\n    assert inst.status == \"recorded\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_3(base_settings):\n    \"\"\"No. 3 tests collection for MedicationStatement.\n    Test File: medicationstatementexample8.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample8.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_3(inst2)\n\n\ndef impl_medicationstatement_4(inst):\n    assert inst.adherence.code.coding[0].code == \"not-taking\"\n    assert inst.adherence.code.coding[0].display == \"Not Taking\"\n    assert (\n        inst.adherence.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/CodeSystem/medication-statement-adherence\"\n            }\n        ).valueUri\n    )\n    assert inst.adherence.reason.coding[0].code == \"266710000\"\n    assert inst.adherence.reason.coding[0].display == \"Drugs not taken/completed\"\n    assert (\n        inst.adherence.reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-22\"}\n        ).valueDateTime\n    )\n    assert inst.dosage[0].asNeeded is False\n    assert inst.dosage[0].maxDosePerPeriod[0].denominator.code == \"d\"\n    assert (\n        inst.dosage[0].maxDosePerPeriod[0].denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[0].maxDosePerPeriod[0].denominator.value) == float(1)\n    assert inst.dosage[0].maxDosePerPeriod[0].numerator.code == \"385055001\"\n    assert (\n        inst.dosage[0].maxDosePerPeriod[0].numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].maxDosePerPeriod[0].numerator.unit == \"capsules\"\n    assert float(inst.dosage[0].maxDosePerPeriod[0].numerator.value) == float(3)\n    assert inst.dosage[0].route.coding[0].code == \"260548002\"\n    assert inst.dosage[0].route.coding[0].display == \"Oral\"\n    assert (\n        inst.dosage[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].text == \"one capsule three times daily\"\n    assert inst.dosage[0].timing.repeat.frequency == 3\n    assert float(inst.dosage[0].timing.repeat.period) == float(1)\n    assert inst.dosage[0].timing.repeat.periodUnit == \"d\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-01-23\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example004\"\n    assert inst.informationSource[0].display == \"Donald Duck\"\n    assert inst.informationSource[0].reference == \"Patient/pat1\"\n    assert inst.medication.concept.coding[0].code == \"27658006\"\n    assert inst.medication.concept.coding[0].display == \"Amoxicillin (product)\"\n    assert (\n        inst.medication.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Patient indicates they miss the occasional dose\"\n    assert inst.status == \"recorded\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_4(base_settings):\n    \"\"\"No. 4 tests collection for MedicationStatement.\n    Test File: medicationstatementexample4.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample4.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_4(inst2)\n\n\ndef impl_medicationstatement_5(inst):\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-22\"}\n        ).valueDateTime\n    )\n    assert inst.dosage[0].asNeeded is False\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.code == \"TAB\"\n    assert (\n        inst.dosage[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == \"tab\"\n    assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(1)\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosage[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].maxDosePerPeriod[0].denominator.code == \"d\"\n    assert (\n        inst.dosage[0].maxDosePerPeriod[0].denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[0].maxDosePerPeriod[0].denominator.value) == float(1)\n    assert float(inst.dosage[0].maxDosePerPeriod[0].numerator.value) == float(1)\n    assert inst.dosage[0].route.coding[0].code == \"260548002\"\n    assert inst.dosage[0].route.coding[0].display == \"Oral\"\n    assert (\n        inst.dosage[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].sequence == 1\n    assert inst.dosage[0].text == \"1 tablet per day\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-01\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example003\"\n    assert inst.informationSource[0].display == \"Donald Duck\"\n    assert inst.informationSource[0].reference == \"Patient/pat1\"\n    assert inst.medication.concept.text == \"Little Pink Pill for water retention\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Patient cannot remember the name of the tablet, but takes it\"\n        \" every day in the morning for water retention\"\n    )\n    assert inst.reason[0].reference.reference == \"Observation/blood-pressure\"\n    assert inst.status == \"recorded\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_5(base_settings):\n    \"\"\"No. 5 tests collection for MedicationStatement.\n    Test File: medicationstatementexample3.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample3.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_5(inst2)\n\n\ndef impl_medicationstatement_6(inst):\n    assert inst.adherence.code.coding[0].code == \"not-taking\"\n    assert inst.adherence.code.coding[0].display == \"Not Taking\"\n    assert (\n        inst.adherence.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/CodeSystem/medication-statement-adherence\"\n            }\n        ).valueUri\n    )\n    assert inst.adherence.reason.coding[0].code == \"266710000\"\n    assert inst.adherence.reason.coding[0].display == \"Drugs not taken/completed\"\n    assert (\n        inst.adherence.reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"med0309\"\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-22\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-23\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example002\"\n    assert inst.informationSource[0].display == \"Donald Duck\"\n    assert inst.informationSource[0].reference == \"Patient/pat1\"\n    assert inst.medication.reference.reference == \"#med0309\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.note[0].text == \"Patient cannot take acetaminophen as per Dr instructions\"\n    )\n    assert inst.reason[0].concept.coding[0].code == \"166643006\"\n    assert inst.reason[0].concept.coding[0].display == \"Liver enzymes abnormal\"\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.status == \"recorded\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_6(base_settings):\n    \"\"\"No. 6 tests collection for MedicationStatement.\n    Test File: medicationstatementexample2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample2.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_6(inst2)\n\n\ndef impl_medicationstatement_7(inst):\n    assert inst.category[0].coding[0].code == \"inpatient\"\n    assert inst.category[0].coding[0].display == \"Inpatient\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/medication-statement-category\"\n            }\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"med0309\"\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-22\"}\n        ).valueDateTime\n    )\n    assert inst.derivedFrom[0].reference == \"MedicationRequest/medrx002\"\n    assert inst.dosage[0].additionalInstruction[0].text == \"Taking at bedtime\"\n    assert inst.dosage[0].asNeededFor[0].coding[0].code == \"32914008\"\n    assert inst.dosage[0].asNeededFor[0].coding[0].display == \"Restless Legs\"\n    assert (\n        inst.dosage[0].asNeededFor[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].doseAndRate[0].doseRange.high.code == \"TAB\"\n    assert (\n        inst.dosage[0].doseAndRate[0].doseRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].doseAndRate[0].doseRange.high.unit == \"TAB\"\n    assert float(inst.dosage[0].doseAndRate[0].doseRange.high.value) == float(2)\n    assert inst.dosage[0].doseAndRate[0].doseRange.low.code == \"TAB\"\n    assert (\n        inst.dosage[0].doseAndRate[0].doseRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].doseAndRate[0].doseRange.low.unit == \"TAB\"\n    assert float(inst.dosage[0].doseAndRate[0].doseRange.low.value) == float(1)\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosage[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].route.coding[0].code == \"26643006\"\n    assert inst.dosage[0].route.coding[0].display == \"Oral Route\"\n    assert (\n        inst.dosage[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].sequence == 1\n    assert inst.dosage[0].text == (\n        \"1-2 tablets once daily at bedtime as needed for restless \" \"legs\"\n    )\n    assert inst.dosage[0].timing.repeat.frequency == 1\n    assert float(inst.dosage[0].timing.repeat.period) == float(1)\n    assert inst.dosage[0].timing.repeat.periodUnit == \"d\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-23\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/portal/medstatements\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345689\"\n    assert inst.informationSource[0].display == \"Donald Duck\"\n    assert inst.informationSource[0].reference == \"Patient/pat1\"\n    assert inst.medication.reference.reference == \"#med0309\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Patient indicates they miss the occasional dose\"\n    assert inst.reason[0].concept.coding[0].code == \"32914008\"\n    assert inst.reason[0].concept.coding[0].display == \"Restless Legs\"\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.status == \"recorded\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_7(base_settings):\n    \"\"\"No. 7 tests collection for MedicationStatement.\n    Test File: medicationstatementexample1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample1.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_7(inst2)\n\n\ndef impl_medicationstatement_8(inst):\n    assert inst.contained[0].id == \"med0315\"\n    assert inst.id == \"example007\"\n    assert inst.informationSource[0].display == \"Donald Duck\"\n    assert inst.informationSource[0].reference == \"Patient/pat1\"\n    assert inst.medication.reference.reference == \"#med0315\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"patient plans to start using for seasonal allergies in the \"\n        \"Spring when pollen is in the air\"\n    )\n    assert inst.status == \"recorded\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_8(base_settings):\n    \"\"\"No. 8 tests collection for MedicationStatement.\n    Test File: medicationstatementexample7.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample7.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_8(inst2)\n\n\ndef impl_medicationstatement_9(inst):\n    assert (\n        inst.dateAsserted\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-22\"}\n        ).valueDateTime\n    )\n    assert inst.dosage[0].asNeeded is False\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.code == \"mL\"\n    assert (\n        inst.dosage[0].doseAndRate[0].doseQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].doseAndRate[0].doseQuantity.unit == \"mL\"\n    assert float(inst.dosage[0].doseAndRate[0].doseQuantity.value) == float(5)\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].code == \"ordered\"\n    assert inst.dosage[0].doseAndRate[0].type.coding[0].display == \"Ordered\"\n    assert (\n        inst.dosage[0].doseAndRate[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/dose-rate-type\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].maxDosePerPeriod[0].denominator.code == \"d\"\n    assert (\n        inst.dosage[0].maxDosePerPeriod[0].denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.dosage[0].maxDosePerPeriod[0].denominator.value) == float(1)\n    assert float(inst.dosage[0].maxDosePerPeriod[0].numerator.value) == float(3)\n    assert inst.dosage[0].route.coding[0].code == \"260548002\"\n    assert inst.dosage[0].route.coding[0].display == \"Oral\"\n    assert (\n        inst.dosage[0].route.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.dosage[0].sequence == 1\n    assert inst.dosage[0].text == \"5ml three times daily\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-02-01\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example006\"\n    assert inst.informationSource[0].display == \"Peter Chalmers\"\n    assert inst.informationSource[0].reference == \"RelatedPerson/peter\"\n    assert inst.medication.concept.coding[0].code == \"27658006\"\n    assert inst.medication.concept.coding[0].display == \"Amoxicillin (product)\"\n    assert (\n        inst.medication.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Father indicates they miss the occasional dose\"\n    assert inst.status == \"recorded\"\n    assert inst.subject.display == \"Donald Duck\"\n    assert inst.subject.reference == \"Patient/pat1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicationstatement_9(base_settings):\n    \"\"\"No. 9 tests collection for MedicationStatement.\n    Test File: medicationstatementexample6.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"medicationstatementexample6.json\"\n    inst = medicationstatement.MedicationStatement.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicationStatement\" == inst.get_resource_type()\n\n    impl_medicationstatement_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicationStatement\" == data[\"resourceType\"]\n\n    inst2 = medicationstatement.MedicationStatement(**data)\n    impl_medicationstatement_9(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_medicinalproductdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MedicinalProductDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import medicinalproductdefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_medicinalproductdefinition_1(inst):\n    assert inst.id == \"product-with-contained-package-and-ingredient\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"Exampleocillin\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-with-contained-package-and-ingredient.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-with-contained-package-and-ingredient.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_1(inst2)\n\n\ndef impl_medicinalproductdefinition_2(inst):\n    assert inst.classification[0].coding[0].code == \"B01A\"\n    assert (\n        inst.classification[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.whocc.no/atc/example\"}\n        ).valueUri\n    )\n    assert inst.combinedPharmaceuticalDoseForm.coding[0].code == \"tablet\"\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/dosefom\"}\n        ).valueUri\n    )\n    assert (\n        inst.crossReference[0].product.reference.reference\n        == \"MedicinalProductDefinition/genericEquilidonium\"\n    )\n    assert inst.id == \"equilidem-basics\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/product\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"Equilidem25\"\n    assert inst.ingredient[0].text == \"Equilidonium Phosphate\"\n    assert inst.ingredient[1].text == \"Calcium Carbonate\"\n    assert inst.legalStatusOfSupply.coding[0].code == \"POM\"\n    assert inst.legalStatusOfSupply.coding[0].display == \"Prescription only medicine\"\n    assert (\n        inst.legalStatusOfSupply.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/legalstatusofsupply\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"Equilidem 2.5 mg film-coated tablets\"\n    assert inst.operation[0].organization[0].display == \"EquiliDrugCo Inc.\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-example-equilidem-basics.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-example-equilidem-basics.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_2(inst2)\n\n\ndef impl_medicinalproductdefinition_3(inst):\n    assert inst.classification[0].coding[0].code == \"B01A\"\n    assert (\n        inst.classification[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.whocc.no/atc/example\"}\n        ).valueUri\n    )\n    assert inst.combinedPharmaceuticalDoseForm.coding[0].code == \"tablet\"\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/dosefom\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"EquilidoniumPhosphate\"\n    assert inst.contained[1].id == \"CalciumCarbonate\"\n    assert (\n        inst.crossReference[0].product.reference.reference\n        == \"MedicinalProductDefinition/genericEquilidonium\"\n    )\n    assert inst.id == \"equilidem-with-ing-and-auth\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/product\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"Equilidem25\"\n    assert inst.legalStatusOfSupply.coding[0].code == \"POM\"\n    assert inst.legalStatusOfSupply.coding[0].display == \"Prescription only medicine\"\n    assert (\n        inst.legalStatusOfSupply.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/legalstatusofsupply\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"Equilidem 2.5 mg film-coated tablets\"\n    assert inst.operation[0].organization[0].display == \"EquiliDrugCo Processing Inc.\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-example-equilidem-using-ingredient-and-auth.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-example-equilidem-using-ingredient-and-auth.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_3(inst2)\n\n\ndef impl_medicinalproductdefinition_4(inst):\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].code == \"solution for injection\"\n    )\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/doseform\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"package\"\n    assert inst.contained[1].id == \"syringeDevice\"\n    assert inst.contained[2].id == \"liquidItem\"\n    assert inst.id == \"drug-and-device\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/product\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"Wonderdrug+\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"Wonderdrug+ liquid 20ml\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_4(base_settings):\n    \"\"\"No. 4 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-example-co-packaged-liquid-and-syringe.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-example-co-packaged-liquid-and-syringe.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_4(inst2)\n\n\ndef impl_medicinalproductdefinition_5(inst):\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].code\n        == \"Powder and solution for injection with itegral syringe\"\n    )\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/doseform\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"package\"\n    assert inst.contained[1].id == \"solventItem\"\n    assert inst.contained[2].id == \"powderItem\"\n    assert inst.contained[3].id == \"syringeDevice\"\n    assert inst.contained[4].id == \"administrable-form\"\n    assert inst.id == \"drug-and-device-complete\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/product\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"Wonderdrug+\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"Wonderdrug liquid 20ml (integral syringe)\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_5(base_settings):\n    \"\"\"No. 5 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-example-co-packaged-liquid-and-syringe-complete.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-example-co-packaged-liquid-and-syringe-complete.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_5(inst2)\n\n\ndef impl_medicinalproductdefinition_6(inst):\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].code\n        == \"Tablet and Cream for topical application\"\n    )\n    assert (\n        inst.combinedPharmaceuticalDoseForm.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/doseform\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"packageCombo\"\n    assert inst.contained[1].id == \"tabletItem\"\n    assert inst.contained[2].id == \"creamItem\"\n    assert inst.id == \"drug-combo-product\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org.uk/fhir/product\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"ThrushTreatCombo\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"ThrushTreat Combo\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_6(base_settings):\n    \"\"\"No. 6 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-example-combo-product.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-example-combo-product.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_6(inst2)\n\n\ndef impl_medicinalproductdefinition_7(inst):\n    assert inst.contained[0].id == \"Acetamin-pack-20\"\n    assert inst.contained[1].id == \"Acetamin-tab-500\"\n    assert inst.id == \"Acetamin-500-20-generic\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.nation.org/drugs\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].productName == \"Acetaminophen 500 mg tablets [generic]\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_7(base_settings):\n    \"\"\"No. 7 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-acetaminophen-500mg-tablets-box-of-20.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"medicinalproductdefinition-acetaminophen-500mg-tablets-box-of-20.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_7(inst2)\n\n\ndef impl_medicinalproductdefinition_8(inst):\n    assert inst.attachedDocument[0].reference == \"DocumentReference/example\"\n    assert inst.classification[0].coding[0].code == \"B01AF02\"\n    assert (\n        inst.classification[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://ema.europa.eu/example/WHOAnatomicalTherapeuticChemicalATCClassificationSystem\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/MPID\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"{mpid}\"\n    assert inst.masterFile[0].reference == \"DocumentReference/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].part[0].part == \"Equilidem\"\n    assert inst.name[0].part[0].type.coding[0].code == \"INV\"\n    assert inst.name[0].part[1].part == \"2.5 mg\"\n    assert inst.name[0].part[1].type.coding[0].code == \"STR\"\n    assert inst.name[0].part[2].part == \"film-coated tablets\"\n    assert inst.name[0].part[2].type.coding[0].code == \"FRM\"\n    assert inst.name[0].productName == \"Equilidem 2.5 mg film-coated tablets\"\n    assert inst.name[0].usage[0].country.coding[0].code == \"EU\"\n    assert (\n        inst.name[0].usage[0].country.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/countryCode\"}\n        ).valueUri\n    )\n    assert inst.name[0].usage[0].jurisdiction.coding[0].code == \"EU\"\n    assert (\n        inst.name[0].usage[0].jurisdiction.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/jurisdictionCode\"}\n        ).valueUri\n    )\n    assert inst.name[0].usage[0].language.coding[0].code == \"en\"\n    assert (\n        inst.name[0].usage[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert (\n        inst.operation[0].effectiveDate.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-15\"}\n        ).valueDateTime\n    )\n    assert inst.operation[0].type.concept.coding[0].code == \"Batchrelease\"\n    assert (\n        inst.operation[0].type.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/manufacturingOperationType\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_medicinalproductdefinition_8(base_settings):\n    \"\"\"No. 8 tests collection for MedicinalProductDefinition.\n    Test File: medicinalproductdefinition-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"medicinalproductdefinition-example.json\"\n    )\n    inst = medicinalproductdefinition.MedicinalProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MedicinalProductDefinition\" == inst.get_resource_type()\n\n    impl_medicinalproductdefinition_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MedicinalProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = medicinalproductdefinition.MedicinalProductDefinition(**data)\n    impl_medicinalproductdefinition_8(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_messagedefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MessageDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import messagedefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_messagedefinition_1(inst):\n    assert inst.category == \"notification\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-09\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Message definition base example\"\n    assert inst.eventCoding.code == \"admin-notify\"\n    assert (\n        inst.eventCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/message-events\"}\n        ).valueUri\n    )\n    assert inst.experimental is True\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.15.3\"\n    assert inst.name == \"EXAMPLE\"\n    assert inst.publisher == \"Health Level Seven, Int'l\"\n    assert inst.purpose == (\n        \"Defines a base example for other MessageDefinition \" \"instances.\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Message '\n        \"definition base example</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Message definition base example\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/MessageDefinition/example\"}\n        ).valueUri\n    )\n\n\ndef test_messagedefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for MessageDefinition.\n    Test File: messagedefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"messagedefinition-example.json\"\n    inst = messagedefinition.MessageDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MessageDefinition\" == inst.get_resource_type()\n\n    impl_messagedefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MessageDefinition\" == data[\"resourceType\"]\n\n    inst2 = messagedefinition.MessageDefinition(**data)\n    impl_messagedefinition_1(inst2)\n\n\ndef impl_messagedefinition_2(inst):\n    assert (\n        inst.allowedResponse[0].message\n        == \"http://hl7.org/fhir/MessageDefinition/patient-link-response\"\n    )\n    assert inst.allowedResponse[0].situation == (\n        \"Optional response message that may provide additional \" \"information\"\n    )\n    assert inst.base == \"http://hl7.org/fhir/MessageDefinition/example\"\n    assert inst.category == \"notification\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org\"\n    assert inst.copyright == \"� HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-03\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Notification of two patient records that represent the same \"\n        \"individual that require an established linkage.\"\n    )\n    assert inst.eventCoding.code == \"admin-notify\"\n    assert (\n        inst.eventCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/message-events\"}\n        ).valueUri\n    )\n    assert inst.experimental is True\n    assert inst.focus[0].code == \"Patient\"\n    assert inst.focus[0].max == \"2\"\n    assert inst.focus[0].min == 2\n    assert inst.focus[0].profile == \"http://hl7.org/fhir/StructureDefinition/example\"\n    assert inst.id == \"patient-link-notification\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.15.2\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.name == \"PATIENTLINKNOTIFICATION\"\n    assert inst.publisher == \"Health Level Seven, Int'l\"\n    assert inst.purpose == (\n        \"Notifies recipient systems that two patients have been \"\n        \"'linked' - meaning they represent the same individual\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Link Patients ' \"Notification</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Link Patients Notification\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/MessageDefinition/patient-link-notification\"\n            }\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"positive\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variant-state\"}\n        ).valueUri\n    )\n    assert inst.version == \"1\"\n\n\ndef test_messagedefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for MessageDefinition.\n    Test File: messagedefinition-patient-link-notification.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"messagedefinition-patient-link-notification.json\"\n    )\n    inst = messagedefinition.MessageDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MessageDefinition\" == inst.get_resource_type()\n\n    impl_messagedefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MessageDefinition\" == data[\"resourceType\"]\n\n    inst2 = messagedefinition.MessageDefinition(**data)\n    impl_messagedefinition_2(inst2)\n\n\ndef impl_messagedefinition_3(inst):\n    assert inst.base == \"http://hl7.org/fhir/MessageDefinition/example\"\n    assert inst.category == \"consequence\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org\"\n    assert inst.copyright == \"� HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-03\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Optional response to a patient link notification.\"\n    assert inst.eventCoding.code == \"admin-notify\"\n    assert (\n        inst.eventCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/message-events\"}\n        ).valueUri\n    )\n    assert inst.experimental is True\n    assert inst.focus[0].code == \"Patient\"\n    assert inst.focus[0].max == \"2\"\n    assert inst.focus[0].min == 2\n    assert inst.focus[0].profile == \"http://hl7.org/fhir/StructureDefinition/example\"\n    assert inst.id == \"patient-link-response\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.15.1\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.name == \"PATIENTLINKRESPONSE\"\n    assert inst.publisher == \"Health Level Seven, Int'l\"\n    assert inst.purpose == (\n        \"Optional response message that may provide additional \"\n        \"information on the outcome of the patient link operation.\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Link Patients ' \"Response</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Link Patients Response\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/MessageDefinition/patient-link-response\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"positive\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variant-state\"}\n        ).valueUri\n    )\n    assert inst.version == \"1\"\n\n\ndef test_messagedefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for MessageDefinition.\n    Test File: messagedefinition-patient-link-response.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"messagedefinition-patient-link-response.json\"\n    )\n    inst = messagedefinition.MessageDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MessageDefinition\" == inst.get_resource_type()\n\n    impl_messagedefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MessageDefinition\" == data[\"resourceType\"]\n\n    inst2 = messagedefinition.MessageDefinition(**data)\n    impl_messagedefinition_3(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_messageheader.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MessageHeader\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import messageheader\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_messageheader_1(inst):\n    assert inst.author.reference == \"Practitioner/example\"\n    assert (\n        inst.definition == \"http:////acme.com/ehr/fhir/messagedefinition/patientrequest\"\n    )\n    assert (\n        inst.destination[0].endpointUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"llp:10.11.12.14:5432\"}\n        ).valueUrl\n    )\n    assert inst.destination[0].name == \"Acme Message Gateway\"\n    assert (\n        inst.destination[0].receiver.reference\n        == \"http://acme.com/ehr/fhir/Practitioner/2323-33-4\"\n    )\n    assert inst.destination[0].target.reference == \"Device/example\"\n    assert inst.eventCoding.code == \"admin-notify\"\n    assert (\n        inst.eventCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/message-events\"}\n        ).valueUri\n    )\n    assert inst.focus[0].reference == \"Patient/example\"\n    assert inst.id == \"1cbdfb97-5859-48a4-8301-d54eab818d68\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.reason.coding[0].code == \"admit\"\n    assert (\n        inst.reason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/message-reasons-encounter\"\n            }\n        ).valueUri\n    )\n    assert inst.response.code == \"ok\"\n    assert inst.response.identifier.value == \"5015fe84-8e76-4526-89d8-44b322e8d4fb\"\n    assert inst.sender.reference == \"Organization/1\"\n    assert inst.source.contact.system == \"phone\"\n    assert inst.source.contact.value == \"+1 (555) 123 4567\"\n    assert (\n        inst.source.endpointUrl\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"llp:10.11.12.13:5432\"}\n        ).valueUrl\n    )\n    assert inst.source.name == \"Acme Central Patient Registry\"\n    assert inst.source.software == \"FooBar Patient Manager\"\n    assert inst.source.version == \"3.1.45.AABB\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_messageheader_1(base_settings):\n    \"\"\"No. 1 tests collection for MessageHeader.\n    Test File: messageheader-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"messageheader-example.json\"\n    inst = messageheader.MessageHeader.model_validate_json(filename.read_bytes())\n    assert \"MessageHeader\" == inst.get_resource_type()\n\n    impl_messageheader_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MessageHeader\" == data[\"resourceType\"]\n\n    inst2 = messageheader.MessageHeader(**data)\n    impl_messageheader_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_molecularsequence.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/MolecularSequence\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import molecularsequence\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_molecularsequence_1(inst):\n    assert inst.id == \"breastcancer\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relative[0].coordinateSystem.coding[0].code == \"LA30100-4\"\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].display\n        == \"0-based interval counting\"\n    )\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.relative[0].edit[0].end == 32316187\n    assert inst.relative[0].edit[0].replacedSequence == \"C\"\n    assert inst.relative[0].edit[0].replacementSequence == \"A\"\n    assert inst.relative[0].edit[0].start == 32316186\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code\n        == \"NM_000059.3\"\n    )\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].display\n        == \"Homo sapiens BRCA2, DNA repair associated (BRCA2), mRNA\"\n    )\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore/\"}\n        ).valueUri\n    )\n    assert inst.relative[0].startingSequence.windowEnd == 101499444\n    assert inst.relative[0].startingSequence.windowStart == 101488058\n    assert inst.subject.reference == \"Patient/brcapat\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"rna\"\n\n\ndef test_molecularsequence_1(base_settings):\n    \"\"\"No. 1 tests collection for MolecularSequence.\n    Test File: sequence-genetics-example-breastcancer.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"sequence-genetics-example-breastcancer.json\"\n    )\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_1(inst2)\n\n\ndef impl_molecularsequence_2(inst):\n    assert inst.device.display == \"12 lead EKG Device Metric\"\n    assert inst.id == \"sequence-complex-variant\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer.display == \"HL7\"\n    assert inst.performer.reference == \"Organization/hl7\"\n    assert inst.relative[0].coordinateSystem.coding[0].code == \"LA30100-4\"\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].display\n        == \"0-based interval counting\"\n    )\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.relative[0].edit[0].end == 128273736\n    assert inst.relative[0].edit[0].replacedSequence == \"CTCCATTGCATGCGTT\"\n    assert inst.relative[0].edit[0].replacementSequence == \"CTCATTGT\"\n    assert inst.relative[0].edit[0].start == 128273724\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code\n        == \"NC_000002.12\"\n    )\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.relative[0].startingSequence.strand == \"watson\"\n    assert inst.relative[0].startingSequence.windowEnd == 128273754\n    assert inst.relative[0].startingSequence.windowStart == 128273724\n    assert inst.specimen.display == \"Molecular Specimen ID: MLD45-Z4-1234\"\n    assert inst.specimen.reference == \"Specimen/genetics-example1-somatic\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n\n\ndef test_molecularsequence_2(base_settings):\n    \"\"\"No. 2 tests collection for MolecularSequence.\n    Test File: sequence-complex-variant.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-complex-variant.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_2(inst2)\n\n\ndef impl_molecularsequence_3(inst):\n    assert inst.id == \"example-TPMT-one\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relative[0].coordinateSystem.coding[0].code == \"LA30102-0\"\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].display\n        == \"1-based character counting\"\n    )\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.relative[0].edit[0].end == 18139214\n    assert inst.relative[0].edit[0].replacedSequence == \"G\"\n    assert inst.relative[0].edit[0].replacementSequence == \"A\"\n    assert inst.relative[0].edit[0].start == 18139214\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code\n        == \"NT_007592.15\"\n    )\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.relative[0].startingSequence.strand == \"watson\"\n    assert inst.relative[0].startingSequence.windowEnd == 18143955\n    assert inst.relative[0].startingSequence.windowStart == 18130918\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n\n\ndef test_molecularsequence_3(base_settings):\n    \"\"\"No. 3 tests collection for MolecularSequence.\n    Test File: sequence-example-TPMT-one.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-example-TPMT-one.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_3(inst2)\n\n\ndef impl_molecularsequence_4(inst):\n    assert inst.id == \"example-pgx-2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relative[0].coordinateSystem.coding[0].code == \"LA30100-4\"\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].display\n        == \"0-based interval counting\"\n    )\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.relative[0].edit[0].end == 55227979\n    assert inst.relative[0].edit[0].replacedSequence == \"T\"\n    assert inst.relative[0].edit[0].replacementSequence == \"G\"\n    assert inst.relative[0].edit[0].start == 55227978\n    assert inst.relative[0].startingSequence.orientation == \"sense\"\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code\n        == \"NG_007726.3\"\n    )\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.relative[0].startingSequence.strand == \"watson\"\n    assert inst.relative[0].startingSequence.windowEnd == 55227980\n    assert inst.relative[0].startingSequence.windowStart == 55227970\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n\n\ndef test_molecularsequence_4(base_settings):\n    \"\"\"No. 4 tests collection for MolecularSequence.\n    Test File: sequence-example-pgx-2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-example-pgx-2.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_4(inst2)\n\n\ndef impl_molecularsequence_5(inst):\n    assert inst.formatted[0].contentType == \"application/json\"\n    assert inst.formatted[0].title == \"GA4GH API\"\n    assert (\n        inst.formatted[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://grch37.rest.ensembl.org/ga4gh/variants/3:rs1333049?content-type=application/json\"\n            }\n        ).valueUrl\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n\n\ndef test_molecularsequence_5(base_settings):\n    \"\"\"No. 5 tests collection for MolecularSequence.\n    Test File: molecularsequence-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"molecularsequence-example.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_5(inst2)\n\n\ndef impl_molecularsequence_6(inst):\n    assert inst.id == \"coord-1-base\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relative[0].coordinateSystem.coding[0].code == \"LA30102-0\"\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].display\n        == \"1-based character counting\"\n    )\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.relative[0].edit[0].end == 3\n    assert inst.relative[0].edit[0].replacedSequence == \"-\"\n    assert inst.relative[0].edit[0].replacementSequence == \"ATG\"\n    assert inst.relative[0].edit[0].start == 2\n    assert inst.relative[0].edit[1].end == 5\n    assert inst.relative[0].edit[1].replacedSequence == \"A\"\n    assert inst.relative[0].edit[1].replacementSequence == \"T\"\n    assert inst.relative[0].edit[1].start == 5\n    assert inst.relative[0].edit[2].end == 7\n    assert inst.relative[0].edit[2].replacedSequence == \"T\"\n    assert inst.relative[0].edit[2].replacementSequence == \"-\"\n    assert inst.relative[0].edit[2].start == 7\n    assert inst.relative[0].startingSequence.sequenceString == \"ACGTAGTC\"\n    assert inst.relative[0].startingSequence.strand == \"watson\"\n    assert inst.relative[0].startingSequence.windowEnd == 8\n    assert inst.relative[0].startingSequence.windowStart == 1\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n\n\ndef test_molecularsequence_6(base_settings):\n    \"\"\"No. 6 tests collection for MolecularSequence.\n    Test File: coord-1base-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"coord-1base-example.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_6(inst2)\n\n\ndef impl_molecularsequence_7(inst):\n    assert inst.id == \"example-TPMT-two\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relative[0].coordinateSystem.coding[0].code == \"LA30102-0\"\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].display\n        == \"1-based character counting\"\n    )\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.relative[0].edit[0].end == 18131012\n    assert inst.relative[0].edit[0].replacedSequence == \"C\"\n    assert inst.relative[0].edit[0].replacementSequence == \"T\"\n    assert inst.relative[0].edit[0].start == 18131012\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code\n        == \"NT_007592.15\"\n    )\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.relative[0].startingSequence.strand == \"watson\"\n    assert inst.relative[0].startingSequence.windowEnd == 18143955\n    assert inst.relative[0].startingSequence.windowStart == 18130918\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n\n\ndef test_molecularsequence_7(base_settings):\n    \"\"\"No. 7 tests collection for MolecularSequence.\n    Test File: sequence-example-TPMT-two.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-example-TPMT-two.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_7(inst2)\n\n\ndef impl_molecularsequence_8(inst):\n    assert inst.id == \"example-pgx-1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relative[0].coordinateSystem.coding[0].code == \"LA30100-4\"\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].display\n        == \"0-based interval counting\"\n    )\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.relative[0].edit[0].end == 55227977\n    assert inst.relative[0].edit[0].replacedSequence == \"T\"\n    assert inst.relative[0].edit[0].replacementSequence == \"G\"\n    assert inst.relative[0].edit[0].start == 55227976\n    assert inst.relative[0].startingSequence.orientation == \"sense\"\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code\n        == \"NG_007726.3\"\n    )\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore\"}\n        ).valueUri\n    )\n    assert inst.relative[0].startingSequence.strand == \"watson\"\n    assert inst.relative[0].startingSequence.windowEnd == 55227980\n    assert inst.relative[0].startingSequence.windowStart == 55227970\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n\n\ndef test_molecularsequence_8(base_settings):\n    \"\"\"No. 8 tests collection for MolecularSequence.\n    Test File: sequence-example-pgx-1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-example-pgx-1.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_8(inst2)\n\n\ndef impl_molecularsequence_9(inst):\n    assert inst.id == \"coord-0-base\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relative[0].coordinateSystem.coding[0].code == \"LA30101-2\"\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].display\n        == \"0-based character counting\"\n    )\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.relative[0].edit[0].end == 2\n    assert inst.relative[0].edit[0].replacedSequence == \"-\"\n    assert inst.relative[0].edit[0].replacementSequence == \"ATG\"\n    assert inst.relative[0].edit[0].start == 2\n    assert inst.relative[0].edit[1].end == 5\n    assert inst.relative[0].edit[1].replacedSequence == \"A\"\n    assert inst.relative[0].edit[1].replacementSequence == \"T\"\n    assert inst.relative[0].edit[1].start == 4\n    assert inst.relative[0].edit[2].end == 7\n    assert inst.relative[0].edit[2].replacedSequence == \"T\"\n    assert inst.relative[0].edit[2].replacementSequence == \"-\"\n    assert inst.relative[0].edit[2].start == 6\n    assert inst.relative[0].startingSequence.sequenceString == \"ACGTAGTC\"\n    assert inst.relative[0].startingSequence.strand == \"watson\"\n    assert inst.relative[0].startingSequence.windowEnd == 8\n    assert inst.relative[0].startingSequence.windowStart == 0\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"dna\"\n\n\ndef test_molecularsequence_9(base_settings):\n    \"\"\"No. 9 tests collection for MolecularSequence.\n    Test File: coord-0base-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"coord-0base-example.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_9(inst2)\n\n\ndef impl_molecularsequence_10(inst):\n    assert inst.id == \"seq-ordinal\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.relative[0].coordinateSystem.coding[0].code == \"LA30102-0\"\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].display\n        == \"1-based character counting\"\n    )\n    assert (\n        inst.relative[0].coordinateSystem.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.relative[0].ordinalPosition == 1\n    assert float(inst.relative[0].sequenceRange.high.value) == float(2194)\n    assert float(inst.relative[0].sequenceRange.low.value) == float(1)\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].code\n        == \"NM_000141.5\"\n    )\n    assert (\n        inst.relative[0].startingSequence.sequenceCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore/\"}\n        ).valueUri\n    )\n    assert inst.relative[0].startingSequence.windowEnd == 2194\n    assert inst.relative[0].startingSequence.windowStart == 1\n    assert inst.relative[1].coordinateSystem.coding[0].code == \"LA30102-0\"\n    assert (\n        inst.relative[1].coordinateSystem.coding[0].display\n        == \"1-based character counting\"\n    )\n    assert (\n        inst.relative[1].coordinateSystem.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.relative[1].ordinalPosition == 2\n    assert float(inst.relative[1].sequenceRange.high.value) == float(4899)\n    assert float(inst.relative[1].sequenceRange.low.value) == float(2194)\n    assert (\n        inst.relative[1].startingSequence.sequenceCodeableConcept.coding[0].code\n        == \"NM_000245.4\"\n    )\n    assert (\n        inst.relative[1].startingSequence.sequenceCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.ncbi.nlm.nih.gov/nuccore/\"}\n        ).valueUri\n    )\n    assert inst.relative[1].startingSequence.windowEnd == 6822\n    assert inst.relative[1].startingSequence.windowStart == 1923\n    assert inst.text.status == \"generated\"\n    assert inst.type == \"rna\"\n\n\ndef test_molecularsequence_10(base_settings):\n    \"\"\"No. 10 tests collection for MolecularSequence.\n    Test File: sequence-example-ordinal.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"sequence-example-ordinal.json\"\n    inst = molecularsequence.MolecularSequence.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"MolecularSequence\" == inst.get_resource_type()\n\n    impl_molecularsequence_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"MolecularSequence\" == data[\"resourceType\"]\n\n    inst2 = molecularsequence.MolecularSequence(**data)\n    impl_molecularsequence_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_namingsystem.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NamingSystem\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import namingsystem\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_namingsystem_1(inst):\n    assert inst.contact[0].name == \"HL7 Australia FHIR Team\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert (\n        inst.contact[0].telecom[0].value\n        == \"http://hl7-australia.wikispaces.com/FHIR+Australia\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-31\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Australian HI Identifier as established by relevant \" \"regulations etc.\"\n    )\n    assert inst.id == \"example-id\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.22.3\"\n    assert inst.jurisdiction[0].coding[0].code == \"AU\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.kind == \"identifier\"\n    assert inst.name == \"AustalianHealthcareIdentifierIndividual\"\n    assert inst.publisher == \"HL7 Australia on behalf of NEHTA\"\n    assert inst.responsible == \"HI Service Operator / NEHTA\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Austalian Healthcare Identifier - Individual\"\n    assert inst.type.coding[0].code == \"NI\"\n    assert inst.type.coding[0].display == \"National unique individual identifier\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"IHI\"\n    assert inst.uniqueId[0].comment == \"This value is used in Australian CDA documents\"\n    assert inst.uniqueId[0].type == \"oid\"\n    assert inst.uniqueId[0].value == \"1.2.36.1.2001.1003.0\"\n    assert (\n        inst.uniqueId[1].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-21\"}\n        ).valueDateTime\n    )\n    assert inst.uniqueId[1].preferred is True\n    assert inst.uniqueId[1].type == \"uri\"\n    assert inst.uniqueId[1].value == \"http://ns.electronichealth.net.au/id/hi/ihi/1.0\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/example-id\"}\n        ).valueUri\n    )\n    assert inst.usage == \"Used in Australia for identifying patients\"\n\n\ndef test_namingsystem_1(base_settings):\n    \"\"\"No. 1 tests collection for NamingSystem.\n    Test File: namingsystem-example-id.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"namingsystem-example-id.json\"\n    inst = namingsystem.NamingSystem.model_validate_json(filename.read_bytes())\n    assert \"NamingSystem\" == inst.get_resource_type()\n\n    impl_namingsystem_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NamingSystem\" == data[\"resourceType\"]\n\n    inst2 = namingsystem.NamingSystem(**data)\n    impl_namingsystem_1(inst2)\n\n\ndef impl_namingsystem_2(inst):\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2021-07-21\"}).valueDate\n    )\n    assert inst.author[0].name == \"ACME NamingSystem Development\"\n    assert inst.author[0].telecom[0].system == \"url\"\n    assert inst.author[0].telecom[0].value == \"http://acme.org/development\"\n    assert inst.contact[0].name == \"FHIR project team\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-07-21\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This is an example naming system that illustrates usage of \"\n        \"the metadata resource elements introduced in R5\"\n    )\n    assert inst.editor[0].name == \"ACME NamingSystem Management\"\n    assert inst.editor[0].telecom[0].system == \"url\"\n    assert inst.editor[0].telecom[0].value == \"http://acme.org/management\"\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-07-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-08-01\"}\n        ).valueDateTime\n    )\n    assert inst.endorser[0].name == \"National Foundation for NamingSystem Quality\"\n    assert inst.endorser[0].telecom[0].system == \"url\"\n    assert inst.endorser[0].telecom[0].value == \"http://example.org/nfnq\"\n    assert inst.experimental is True\n    assert inst.id == \"example-metadata\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.22.5\"\n    assert inst.kind == \"identifier\"\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2022-07-21\"}).valueDate\n    )\n    assert inst.meta.profile[0] == (\n        \"http://hl7.org/fhir/StructureDefinition/shareablenamingsyste\" \"m\"\n    )\n    assert inst.name == \"ExampleMetadata\"\n    assert inst.publisher == \"FHIR (Example)\"\n    assert (\n        inst.relatedArtifact[0].resource == \"http://hl7.org/fhir/NamingSystem/example\"\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.reviewer[0].name == \"Society for Creative NamingSystem Review\"\n    assert inst.reviewer[0].telecom[0].system == \"url\"\n    assert inst.reviewer[0].telecom[0].value == \"http://example.org/scnr\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Metadata Example\"\n    assert inst.topic[0].coding[0].code == \"treatment\"\n    assert inst.topic[0].coding[0].display == \"Treatment\"\n    assert (\n        inst.topic[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/definition-topic\"}\n        ).valueUri\n    )\n    assert inst.uniqueId[0].type == \"oid\"\n    assert inst.uniqueId[0].value == \"1.2.3.4.5.6.7\"\n    assert inst.uniqueId[1].preferred is True\n    assert inst.uniqueId[1].type == \"uri\"\n    assert inst.uniqueId[1].value == \"http://example.com/identifiers\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/example-metadata\"}\n        ).valueUri\n    )\n    assert inst.version == \"20210721\"\n\n\ndef test_namingsystem_2(base_settings):\n    \"\"\"No. 2 tests collection for NamingSystem.\n    Test File: namingsystem-example-metadata.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"namingsystem-example-metadata.json\"\n    inst = namingsystem.NamingSystem.model_validate_json(filename.read_bytes())\n    assert \"NamingSystem\" == inst.get_resource_type()\n\n    impl_namingsystem_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NamingSystem\" == data[\"resourceType\"]\n\n    inst2 = namingsystem.NamingSystem(**data)\n    impl_namingsystem_2(inst2)\n\n\ndef impl_namingsystem_3(inst):\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2021-07-21\"}).valueDate\n    )\n    assert inst.author[0].name == \"ACME NamingSystem Development\"\n    assert inst.author[0].telecom[0].system == \"url\"\n    assert inst.author[0].telecom[0].value == \"http://acme.org/development\"\n    assert inst.contact[0].name == \"FHIR project team\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-07-21\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This is an example naming system that illustrates usage of \"\n        \"the metadata resource elements introduced in R5\"\n    )\n    assert inst.editor[0].name == \"ACME NamingSystem Management\"\n    assert inst.editor[0].telecom[0].system == \"url\"\n    assert inst.editor[0].telecom[0].value == \"http://acme.org/management\"\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-07-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-08-01\"}\n        ).valueDateTime\n    )\n    assert inst.endorser[0].name == \"National Foundation for NamingSystem Quality\"\n    assert inst.endorser[0].telecom[0].system == \"url\"\n    assert inst.endorser[0].telecom[0].value == \"http://example.org/nfnq\"\n    assert inst.experimental is True\n    assert inst.id == \"example-metadata-2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.22.4\"\n    assert inst.kind == \"identifier\"\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2022-07-21\"}).valueDate\n    )\n    assert inst.meta.profile[0] == (\n        \"http://hl7.org/fhir/StructureDefinition/shareablenamingsyste\" \"m\"\n    )\n    assert inst.name == \"ExampleMetadata\"\n    assert inst.publisher == \"FHIR (Example)\"\n    assert (\n        inst.relatedArtifact[0].resource == \"http://hl7.org/fhir/NamingSystem/example\"\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert (\n        inst.relatedArtifact[1].resource\n        == \"http://hl7.org/fhir/NamingSystem/example-metadata|20210701\"\n    )\n    assert inst.relatedArtifact[1].type == \"predecessor\"\n    assert inst.reviewer[0].name == \"Society for Creative NamingSystem Review\"\n    assert inst.reviewer[0].telecom[0].system == \"url\"\n    assert inst.reviewer[0].telecom[0].value == \"http://example.org/scnr\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Metadata Example\"\n    assert inst.topic[0].coding[0].code == \"treatment\"\n    assert inst.topic[0].coding[0].display == \"Treatment\"\n    assert (\n        inst.topic[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/definition-topic\"}\n        ).valueUri\n    )\n    assert inst.uniqueId[0].type == \"oid\"\n    assert inst.uniqueId[0].value == \"1.2.3.4.5.6.7\"\n    assert inst.uniqueId[1].preferred is True\n    assert inst.uniqueId[1].type == \"uri\"\n    assert inst.uniqueId[1].value == \"http://example.com/identifiers\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/example-metadata-2\"}\n        ).valueUri\n    )\n    assert inst.version == \"20220721\"\n\n\ndef test_namingsystem_3(base_settings):\n    \"\"\"No. 3 tests collection for NamingSystem.\n    Test File: namingsystem-example-metadata-2.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"namingsystem-example-metadata-2.json\"\n    )\n    inst = namingsystem.NamingSystem.model_validate_json(filename.read_bytes())\n    assert \"NamingSystem\" == inst.get_resource_type()\n\n    impl_namingsystem_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NamingSystem\" == data[\"resourceType\"]\n\n    inst2 = namingsystem.NamingSystem(**data)\n    impl_namingsystem_3(inst2)\n\n\ndef impl_namingsystem_4(inst):\n    assert inst.contact[0].name == \"FHIR project team\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-13\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.22.1\"\n    assert inst.kind == \"codesystem\"\n    assert inst.name == \"SNOMEDCT\"\n    assert inst.publisher == \"HL7 International on behalf of IHTSDO\"\n    assert inst.responsible == \"IHTSDO & affiliates\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"SNOMED CT\"\n    assert inst.uniqueId[0].type == \"oid\"\n    assert inst.uniqueId[0].value == \"2.16.840.1.113883.6.96\"\n    assert inst.uniqueId[1].preferred is True\n    assert inst.uniqueId[1].type == \"uri\"\n    assert inst.uniqueId[1].value == \"http://snomed.info/sct\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/NamingSystem/example\"}\n        ).valueUri\n    )\n\n\ndef test_namingsystem_4(base_settings):\n    \"\"\"No. 4 tests collection for NamingSystem.\n    Test File: namingsystem-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"namingsystem-example.json\"\n    inst = namingsystem.NamingSystem.model_validate_json(filename.read_bytes())\n    assert \"NamingSystem\" == inst.get_resource_type()\n\n    impl_namingsystem_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NamingSystem\" == data[\"resourceType\"]\n\n    inst2 = namingsystem.NamingSystem(**data)\n    impl_namingsystem_4(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_nutritionintake.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NutritionIntake\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import nutritionintake\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_nutritionintake_1(inst):\n    assert inst.code.text == \"Inpatient\"\n    assert inst.consumedItem[0].amount.code == \"%\"\n    assert (\n        inst.consumedItem[0].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.consumedItem[0].amount.unit == \"percent\"\n    assert float(inst.consumedItem[0].amount.value) == float(100)\n    assert inst.consumedItem[0].nutritionProduct.concept.text == \"Grill Sandwich\"\n    assert inst.consumedItem[0].type.text == \"food\"\n    assert inst.consumedItem[1].amount.code == \"%\"\n    assert (\n        inst.consumedItem[1].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.consumedItem[1].amount.unit == \"percent\"\n    assert float(inst.consumedItem[1].amount.value) == float(100)\n    assert (\n        inst.consumedItem[1].nutritionProduct.concept.text\n        == \"French Fries Spiral Battered\"\n    )\n    assert inst.consumedItem[1].type.text == \"food\"\n    assert inst.consumedItem[2].amount.code == \"%\"\n    assert (\n        inst.consumedItem[2].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.consumedItem[2].amount.unit == \"percent\"\n    assert float(inst.consumedItem[2].amount.value) == float(50)\n    assert (\n        inst.consumedItem[2].nutritionProduct.concept.text\n        == \"Tomato Soup Healthy Request\"\n    )\n    assert inst.consumedItem[2].type.text == \"food\"\n    assert inst.consumedItem[3].amount.code == \"%\"\n    assert (\n        inst.consumedItem[3].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.consumedItem[3].amount.unit == \"percent\"\n    assert float(inst.consumedItem[3].amount.value) == float(50)\n    assert inst.consumedItem[3].nutritionProduct.concept.text == \"Side Garden Salad\"\n    assert inst.consumedItem[3].type.text == \"food\"\n    assert inst.consumedItem[4].amount.code == \"%\"\n    assert (\n        inst.consumedItem[4].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.consumedItem[4].amount.unit == \"percent\"\n    assert float(inst.consumedItem[4].amount.value) == float(100)\n    assert inst.consumedItem[4].nutritionProduct.concept.text == \"Ice Tea Unsweetened\"\n    assert inst.consumedItem[4].type.text == \"fluid\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"1144223344\"\n    assert inst.ingredientLabel[0].amount.code == \"kcal\"\n    assert (\n        inst.ingredientLabel[0].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredientLabel[0].amount.unit == \"kilocalorie\"\n    assert float(inst.ingredientLabel[0].amount.value) == float(313)\n    assert inst.ingredientLabel[0].nutrient.concept.text == \"Total Calories\"\n    assert inst.ingredientLabel[1].amount.code == \"g\"\n    assert (\n        inst.ingredientLabel[1].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredientLabel[1].amount.unit == \"grams\"\n    assert float(inst.ingredientLabel[1].amount.value) == float(10.4)\n    assert inst.ingredientLabel[1].nutrient.concept.text == \"Protein\"\n    assert inst.ingredientLabel[2].amount.code == \"g\"\n    assert (\n        inst.ingredientLabel[2].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredientLabel[2].amount.unit == \"grams\"\n    assert float(inst.ingredientLabel[2].amount.value) == float(18.0)\n    assert inst.ingredientLabel[2].nutrient.concept.text == \"Fat (Total)\"\n    assert inst.ingredientLabel[3].amount.code == \"g\"\n    assert (\n        inst.ingredientLabel[3].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredientLabel[3].amount.unit == \"grams\"\n    assert float(inst.ingredientLabel[3].amount.value) == float(26.47)\n    assert inst.ingredientLabel[3].nutrient.concept.text == \"Carbohydrate\"\n    assert inst.ingredientLabel[4].amount.code == \"mg\"\n    assert (\n        inst.ingredientLabel[4].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredientLabel[4].amount.unit == \"Milligrams\"\n    assert float(inst.ingredientLabel[4].amount.value) == float(770)\n    assert inst.ingredientLabel[4].nutrient.concept.text == \"Sodium\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-08-02T12:45:18+04:00\"}\n        ).valueDateTime\n    )\n    assert inst.reportedReference.reference == \"PractitionerRole/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Paula Patient Chalmers\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionintake_1(base_settings):\n    \"\"\"No. 1 tests collection for NutritionIntake.\n    Test File: nutritionintake-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"nutritionintake-example.json\"\n    inst = nutritionintake.NutritionIntake.model_validate_json(filename.read_bytes())\n    assert \"NutritionIntake\" == inst.get_resource_type()\n\n    impl_nutritionintake_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionIntake\" == data[\"resourceType\"]\n\n    inst2 = nutritionintake.NutritionIntake(**data)\n    impl_nutritionintake_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_nutritionorder.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NutritionOrder\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import nutritionorder\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_nutritionorder_1(inst):\n    assert inst.allergyIntolerance[0].display == \"Cashew Nuts\"\n    assert inst.allergyIntolerance[0].reference == \"AllergyIntolerance/example\"\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.excludeFoodModifier[0].coding[0].code == \"227493005\"\n    assert inst.excludeFoodModifier[0].coding[0].display == \"Cashew Nut\"\n    assert (\n        inst.excludeFoodModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].version == \"20140730\"\n    assert inst.foodPreferenceModifier[0].coding[0].code == \"kosher\"\n    assert (\n        inst.foodPreferenceModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diet\"}\n        ).valueUri\n    )\n    assert inst.id == \"diabeticsupplement\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.supplement[0].productName == \"Glucerna\"\n    assert inst.supplement[0].quantity.unit == \"8 oz bottle\"\n    assert float(inst.supplement[0].quantity.value) == float(1)\n    assert (\n        inst.supplement[0].schedule.timing[0].repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-10T15:00:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.supplement[0].schedule.timing[0].repeat.frequency == 1\n    assert float(inst.supplement[0].schedule.timing[0].repeat.period) == float(24)\n    assert inst.supplement[0].schedule.timing[0].repeat.periodUnit == \"h\"\n    assert float(inst.supplement[0].schedule.timing[1].repeat.duration) == float(1)\n    assert inst.supplement[0].schedule.timing[1].repeat.durationUnit == \"h\"\n    assert inst.supplement[0].schedule.timing[1].repeat.when[0] == \"HS\"\n    assert inst.supplement[0].type.concept.coding[0].code == \"443051000124104\"\n    assert (\n        inst.supplement[0].type.concept.coding[0].display\n        == \"Adult diabetes specialty formula\"\n    )\n    assert (\n        inst.supplement[0].type.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.supplement[0].type.concept.coding[1].code == \"1010\"\n    assert inst.supplement[0].type.concept.coding[1].display == \"Adult diabetic formula\"\n    assert (\n        inst.supplement[0].type.concept.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/supplement-type-codes\"}\n        ).valueUri\n    )\n    assert inst.supplement[0].type.concept.text == \"Adult diabetic formula\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_1(base_settings):\n    \"\"\"No. 1 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-diabeticsupplement.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"nutritionorder-example-diabeticsupplement.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_1(inst2)\n\n\ndef impl_nutritionorder_2(inst):\n    assert inst.allergyIntolerance[0].display == \"Cashew Nuts\"\n    assert inst.allergyIntolerance[0].reference == \"AllergyIntolerance/example\"\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.enteralFormula.additive[0].productName == \"Acme Lipid Additive\"\n    assert inst.enteralFormula.additive[0].type.concept.coding[0].code == \"lipid\"\n    assert inst.enteralFormula.additive[0].type.concept.coding[0].display == \"Lipid\"\n    assert (\n        inst.enteralFormula.additive[0].type.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/entformula-additive\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administrationInstruction == \"240 mls every 4hrs\"\n    assert inst.enteralFormula.administration[0].quantity.code == \"mL\"\n    assert (\n        inst.enteralFormula.administration[0].quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administration[0].quantity.unit == \"milliliters\"\n    assert float(inst.enteralFormula.administration[0].quantity.value) == float(240)\n    assert (\n        inst.enteralFormula.administration[0]\n        .schedule.timing[0]\n        .repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17T16:00:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.enteralFormula.administration[0].schedule.timing[0].repeat.frequency == 1\n    )\n    assert float(\n        inst.enteralFormula.administration[0].schedule.timing[0].repeat.period\n    ) == float(4)\n    assert (\n        inst.enteralFormula.administration[0].schedule.timing[0].repeat.periodUnit\n        == \"h\"\n    )\n    assert inst.enteralFormula.baseFormulaProductName == \"Acme High Protein Formula\"\n    assert (\n        inst.enteralFormula.baseFormulaType.concept.coding[0].code == \"442991000124104\"\n    )\n    assert (\n        inst.enteralFormula.baseFormulaType.concept.coding[0].display\n        == \"Adult high protein formula\"\n    )\n    assert (\n        inst.enteralFormula.baseFormulaType.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.caloricDensity.code == \"cal/mL\"\n    assert (\n        inst.enteralFormula.caloricDensity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.caloricDensity.unit == \"calories per milliliter\"\n    assert float(inst.enteralFormula.caloricDensity.value) == float(1.5)\n    assert inst.enteralFormula.maxVolumeToDeliver.code == \"mL/d\"\n    assert (\n        inst.enteralFormula.maxVolumeToDeliver.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.maxVolumeToDeliver.unit == \"milliliter/day\"\n    assert float(inst.enteralFormula.maxVolumeToDeliver.value) == float(1440)\n    assert inst.enteralFormula.routeOfAdministration.coding[0].code == \"GT\"\n    assert (\n        inst.enteralFormula.routeOfAdministration.coding[0].display\n        == \"Instillation, gastrostomy tube\"\n    )\n    assert (\n        inst.enteralFormula.routeOfAdministration.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].code == \"227493005\"\n    assert inst.excludeFoodModifier[0].coding[0].display == \"Cashew Nut\"\n    assert (\n        inst.excludeFoodModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].version == \"20140730\"\n    assert inst.foodPreferenceModifier[0].coding[0].code == \"dairy-free\"\n    assert (\n        inst.foodPreferenceModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diet\"}\n        ).valueUri\n    )\n    assert inst.id == \"enteralbolus\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org/nutritionorders\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_2(base_settings):\n    \"\"\"No. 2 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-enteralbolus.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"nutritionorder-example-enteralbolus.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_2(inst2)\n\n\ndef impl_nutritionorder_3(inst):\n    assert inst.allergyIntolerance[0].display == \"Cashew Nuts\"\n    assert inst.allergyIntolerance[0].reference == \"AllergyIntolerance/example\"\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.excludeFoodModifier[0].coding[0].code == \"227493005\"\n    assert inst.excludeFoodModifier[0].coding[0].display == \"Cashew Nut\"\n    assert (\n        inst.excludeFoodModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].version == \"20140730\"\n    assert inst.foodPreferenceModifier[0].coding[0].code == \"dairy-free\"\n    assert (\n        inst.foodPreferenceModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diet\"}\n        ).valueUri\n    )\n    assert inst.id == \"fiberrestricteddiet\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[0].amount.code == \"g\"\n    assert (\n        inst.oralDiet.nutrient[0].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[0].amount.unit == \"grams\"\n    assert float(inst.oralDiet.nutrient[0].amount.value) == float(50)\n    assert inst.oralDiet.nutrient[0].modifier.coding[0].code == \"256674009\"\n    assert inst.oralDiet.nutrient[0].modifier.coding[0].display == \"Fat\"\n    assert (\n        inst.oralDiet.nutrient[0].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.oralDiet.schedule.timing[0].repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-10\"}\n        ).valueDateTime\n    )\n    assert inst.oralDiet.schedule.timing[0].repeat.frequency == 3\n    assert float(inst.oralDiet.schedule.timing[0].repeat.period) == float(1)\n    assert inst.oralDiet.schedule.timing[0].repeat.periodUnit == \"d\"\n    assert inst.oralDiet.type[0].coding[0].code == \"15108003\"\n    assert inst.oralDiet.type[0].coding[0].display == \"Restricted fiber diet\"\n    assert (\n        inst.oralDiet.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[1].code == \"1000\"\n    assert inst.oralDiet.type[0].coding[1].display == \"Fiber restricted\"\n    assert (\n        inst.oralDiet.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].text == \"Fiber restricted diet\"\n    assert inst.oralDiet.type[1].coding[0].code == \"16208003\"\n    assert inst.oralDiet.type[1].coding[0].display == \"Low fat diet\"\n    assert (\n        inst.oralDiet.type[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[1].coding[1].code == \"1100\"\n    assert inst.oralDiet.type[1].coding[1].display == \"Low Fat\"\n    assert (\n        inst.oralDiet.type[1].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[1].text == \"Low fat diet\"\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_3(base_settings):\n    \"\"\"No. 3 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-fiberrestricteddiet.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"nutritionorder-example-fiberrestricteddiet.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_3(inst2)\n\n\ndef impl_nutritionorder_4(inst):\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"texturemodified\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.oralDiet.schedule.timing[0].repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-10\"}\n        ).valueDateTime\n    )\n    assert inst.oralDiet.schedule.timing[0].repeat.frequency == 3\n    assert float(inst.oralDiet.schedule.timing[0].repeat.period) == float(1)\n    assert inst.oralDiet.schedule.timing[0].repeat.periodUnit == \"d\"\n    assert inst.oralDiet.texture[0].foodType.coding[0].code == \"28647000\"\n    assert inst.oralDiet.texture[0].foodType.coding[0].display == \"Meat\"\n    assert (\n        inst.oralDiet.texture[0].foodType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.texture[0].foodType.text == \"Regular, Chopped Meat\"\n    assert inst.oralDiet.texture[0].modifier.coding[0].code == \"228049004\"\n    assert inst.oralDiet.texture[0].modifier.coding[0].display == \"Chopped food\"\n    assert (\n        inst.oralDiet.texture[0].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.texture[0].modifier.text == \"Regular, Chopped Meat\"\n    assert inst.oralDiet.type[0].coding[0].code == \"435801000124108\"\n    assert inst.oralDiet.type[0].coding[0].display == \"Texture modified diet\"\n    assert (\n        inst.oralDiet.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[1].code == \"1010\"\n    assert inst.oralDiet.type[0].coding[1].display == \"Texture modified diet\"\n    assert (\n        inst.oralDiet.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].text == \"Texture modified diet\"\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_4(base_settings):\n    \"\"\"No. 4 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-texture-modified.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"nutritionorder-example-texture-modified.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_4(inst2)\n\n\ndef impl_nutritionorder_5(inst):\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"pureeddiet-simple\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.fluidConsistencyType[0].coding[0].code == \"439021000124105\"\n    assert (\n        inst.oralDiet.fluidConsistencyType[0].coding[0].display\n        == \"Dietary liquid consistency - nectar thick liquid\"\n    )\n    assert (\n        inst.oralDiet.fluidConsistencyType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.fluidConsistencyType[0].text == \"Nectar thick liquids\"\n    assert (\n        inst.oralDiet.schedule.timing[0].repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-10\"}\n        ).valueDateTime\n    )\n    assert inst.oralDiet.schedule.timing[0].repeat.frequency == 3\n    assert float(inst.oralDiet.schedule.timing[0].repeat.period) == float(1)\n    assert inst.oralDiet.schedule.timing[0].repeat.periodUnit == \"d\"\n    assert inst.oralDiet.texture[0].modifier.coding[0].code == \"228055009\"\n    assert inst.oralDiet.texture[0].modifier.coding[0].display == \"Liquidized food\"\n    assert (\n        inst.oralDiet.texture[0].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.texture[0].modifier.text == \"Pureed\"\n    assert inst.oralDiet.type[0].coding[0].code == \"226211001\"\n    assert inst.oralDiet.type[0].coding[0].display == \"Pureed diet\"\n    assert (\n        inst.oralDiet.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[1].code == \"1010\"\n    assert inst.oralDiet.type[0].coding[1].display == \"Pureed diet\"\n    assert (\n        inst.oralDiet.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].text == \"Pureed diet\"\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert (\n        inst.supplement[0].instruction == \"Ensure Pudding at breakfast, lunch, supper\"\n    )\n    assert inst.supplement[0].productName == \"Ensure Pudding 4 oz container\"\n    assert inst.supplement[0].type.concept.coding[0].code == \"442971000124100\"\n    assert (\n        inst.supplement[0].type.concept.coding[0].display == \"Adult high energy formula\"\n    )\n    assert (\n        inst.supplement[0].type.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.supplement[0].type.concept.coding[1].code == \"1040\"\n    assert (\n        inst.supplement[0].type.concept.coding[1].display == \"Adult high energy pudding\"\n    )\n    assert (\n        inst.supplement[0].type.concept.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/supplement-type-codes\"}\n        ).valueUri\n    )\n    assert inst.supplement[0].type.concept.text == \"Adult high energy pudding\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_5(base_settings):\n    \"\"\"No. 5 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-pureeddiet-simple.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"nutritionorder-example-pureeddiet-simple.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_5(inst2)\n\n\ndef impl_nutritionorder_6(inst):\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.enteralFormula.additive[0].productName == \"Acme High Carbohydrate Additive\"\n    )\n    assert inst.enteralFormula.additive[0].type.concept.coding[0].code == \"carbohydrate\"\n    assert (\n        inst.enteralFormula.additive[0].type.concept.coding[0].display == \"Carbohydrate\"\n    )\n    assert (\n        inst.enteralFormula.additive[0].type.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/entformula-additive\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administrationInstruction == (\n        \"Add high calorie high carbohydrate additive to increase \"\n        \"cal/oz from 24 cal/oz to 27 cal/oz.\"\n    )\n    assert inst.enteralFormula.administration[0].quantity.code == \"[foz_us]\"\n    assert (\n        inst.enteralFormula.administration[0].quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administration[0].quantity.unit == \"ounces\"\n    assert float(inst.enteralFormula.administration[0].quantity.value) == float(4)\n    assert (\n        inst.enteralFormula.administration[0]\n        .schedule.timing[0]\n        .repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.enteralFormula.administration[0].schedule.timing[0].repeat.frequency == 1\n    )\n    assert float(\n        inst.enteralFormula.administration[0].schedule.timing[0].repeat.period\n    ) == float(3)\n    assert (\n        inst.enteralFormula.administration[0].schedule.timing[0].repeat.periodUnit\n        == \"h\"\n    )\n    assert inst.enteralFormula.baseFormulaProductName == \"Acme Infant Formula + Iron\"\n    assert inst.enteralFormula.baseFormulaType.concept.coding[0].code == \"412414007\"\n    assert (\n        inst.enteralFormula.baseFormulaType.concept.coding[0].display\n        == \"infant formula + iron\"\n    )\n    assert (\n        inst.enteralFormula.baseFormulaType.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.caloricDensity.code == \"cal/[foz_us]\"\n    assert (\n        inst.enteralFormula.caloricDensity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.caloricDensity.unit == \"calories per ounce\"\n    assert float(inst.enteralFormula.caloricDensity.value) == float(20)\n    assert inst.enteralFormula.maxVolumeToDeliver.code == \"[foz_us]\"\n    assert (\n        inst.enteralFormula.maxVolumeToDeliver.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.maxVolumeToDeliver.unit == \"ounces\"\n    assert float(inst.enteralFormula.maxVolumeToDeliver.value) == float(32)\n    assert inst.enteralFormula.routeOfAdministration.coding[0].code == \"PO\"\n    assert (\n        inst.enteralFormula.routeOfAdministration.coding[0].display == \"Swallow, oral\"\n    )\n    assert (\n        inst.enteralFormula.routeOfAdministration.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.enteralFormula.routeOfAdministration.coding[0].userSelected is True\n    assert inst.id == \"infantenteral\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org/nutritionorders\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_6(base_settings):\n    \"\"\"No. 6 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-infantenteral.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"nutritionorder-example-infantenteral.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_6(inst2)\n\n\ndef impl_nutritionorder_7(inst):\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.enteralFormula.administrationInstruction == (\n        \"Hold feedings from 7 pm to 7 am. Add MCT oil to increase \"\n        \"calories from 1.0 cal/mL to 1.5 cal/mL\"\n    )\n    assert inst.enteralFormula.administration[0].rateQuantity.code == \"mL/h\"\n    assert (\n        inst.enteralFormula.administration[0].rateQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administration[0].rateQuantity.unit == \"ml/hr\"\n    assert float(inst.enteralFormula.administration[0].rateQuantity.value) == float(60)\n    assert (\n        inst.enteralFormula.administration[0]\n        .schedule.timing[0]\n        .repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17T07:00:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.enteralFormula.administration[1].rateQuantity.code == \"mL/h\"\n    assert (\n        inst.enteralFormula.administration[1].rateQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administration[1].rateQuantity.unit == \"ml/hr\"\n    assert float(inst.enteralFormula.administration[1].rateQuantity.value) == float(80)\n    assert (\n        inst.enteralFormula.administration[1]\n        .schedule.timing[0]\n        .repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17T11:00:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.enteralFormula.administration[2].rateQuantity.code == \"mL/h\"\n    assert (\n        inst.enteralFormula.administration[2].rateQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.administration[2].rateQuantity.unit == \"ml/hr\"\n    assert float(inst.enteralFormula.administration[2].rateQuantity.value) == float(100)\n    assert (\n        inst.enteralFormula.administration[2]\n        .schedule.timing[0]\n        .repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17T15:00:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.enteralFormula.baseFormulaProductName == \"Acme Diabetes Formula\"\n    assert (\n        inst.enteralFormula.baseFormulaType.concept.coding[0].code == \"6547210000124112\"\n    )\n    assert (\n        inst.enteralFormula.baseFormulaType.concept.coding[0].display\n        == \"Diabetic specialty enteral formula\"\n    )\n    assert (\n        inst.enteralFormula.baseFormulaType.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.caloricDensity.code == \"cal/mL\"\n    assert (\n        inst.enteralFormula.caloricDensity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.caloricDensity.unit == \"calories per milliliter\"\n    assert float(inst.enteralFormula.caloricDensity.value) == float(1)\n    assert inst.enteralFormula.maxVolumeToDeliver.code == \"mL/d\"\n    assert (\n        inst.enteralFormula.maxVolumeToDeliver.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.enteralFormula.maxVolumeToDeliver.unit == \"milliliter/day\"\n    assert float(inst.enteralFormula.maxVolumeToDeliver.value) == float(880)\n    assert inst.enteralFormula.routeOfAdministration.coding[0].code == \"NGT\"\n    assert (\n        inst.enteralFormula.routeOfAdministration.coding[0].display\n        == \"Instillation, nasogastric tube\"\n    )\n    assert (\n        inst.enteralFormula.routeOfAdministration.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration\"\n            }\n        ).valueUri\n    )\n    assert inst.id == \"enteralcontinuous\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org/nutritionorders\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_7(base_settings):\n    \"\"\"No. 7 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-enteralcontinuous.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"nutritionorder-example-enteralcontinuous.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_7(inst2)\n\n\ndef impl_nutritionorder_8(inst):\n    assert inst.allergyIntolerance[0].display == \"Cashew Nuts\"\n    assert inst.allergyIntolerance[0].reference == \"AllergyIntolerance/example\"\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.excludeFoodModifier[0].coding[0].code == \"227493005\"\n    assert inst.excludeFoodModifier[0].coding[0].display == \"Cashew Nut\"\n    assert (\n        inst.excludeFoodModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].version == \"20140730\"\n    assert inst.foodPreferenceModifier[0].coding[0].code == \"dairy-free\"\n    assert (\n        inst.foodPreferenceModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diet\"}\n        ).valueUri\n    )\n    assert inst.id == \"cardiacdiet\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.oralDiet.instruction\n        == \"Starting on 2/10 breakfast, maximum 400 ml fluids per meal\"\n    )\n    assert inst.oralDiet.nutrient[0].amount.code == \"g\"\n    assert (\n        inst.oralDiet.nutrient[0].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[0].amount.unit == \"grams\"\n    assert float(inst.oralDiet.nutrient[0].amount.value) == float(2)\n    assert inst.oralDiet.nutrient[0].modifier.coding[0].code == \"39972003\"\n    assert inst.oralDiet.nutrient[0].modifier.coding[0].display == \"Sodium\"\n    assert (\n        inst.oralDiet.nutrient[0].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[1].amount.code == \"mL\"\n    assert (\n        inst.oralDiet.nutrient[1].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[1].amount.unit == \"milliliter\"\n    assert float(inst.oralDiet.nutrient[1].amount.value) == float(1500)\n    assert inst.oralDiet.nutrient[1].modifier.coding[0].code == \"33463005\"\n    assert inst.oralDiet.nutrient[1].modifier.coding[0].display == \"Fluid\"\n    assert (\n        inst.oralDiet.nutrient[1].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[0].code == \"386619000\"\n    assert inst.oralDiet.type[0].coding[0].display == \"Low sodium diet\"\n    assert (\n        inst.oralDiet.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[1].code == \"1040\"\n    assert inst.oralDiet.type[0].coding[1].display == \"Low Sodium Diet\"\n    assert (\n        inst.oralDiet.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].text == \"Low sodium diet\"\n    assert inst.oralDiet.type[1].coding[0].code == \"226208002\"\n    assert inst.oralDiet.type[1].coding[0].display == \"Fluid restricted diet\"\n    assert (\n        inst.oralDiet.type[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[1].coding[1].code == \"1040\"\n    assert inst.oralDiet.type[1].coding[1].display == \"Fluid restricted diet\"\n    assert (\n        inst.oralDiet.type[1].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[1].text == \"Fluid restricted diet\"\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_8(base_settings):\n    \"\"\"No. 8 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-cardiacdiet.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"nutritionorder-example-cardiacdiet.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_8(inst2)\n\n\ndef impl_nutritionorder_9(inst):\n    assert inst.allergyIntolerance[0].display == \"Cashew Nuts\"\n    assert inst.allergyIntolerance[0].reference == \"AllergyIntolerance/example\"\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.excludeFoodModifier[0].coding[0].code == \"227493005\"\n    assert inst.excludeFoodModifier[0].coding[0].display == \"Cashew Nut\"\n    assert (\n        inst.excludeFoodModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].version == \"20140730\"\n    assert inst.foodPreferenceModifier[0].coding[0].code == \"dairy-free\"\n    assert (\n        inst.foodPreferenceModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diet\"}\n        ).valueUri\n    )\n    assert inst.id == \"pureeddiet\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.fluidConsistencyType[0].coding[0].code == \"439021000124105\"\n    assert (\n        inst.oralDiet.fluidConsistencyType[0].coding[0].display\n        == \"Dietary liquid consistency - nectar thick liquid\"\n    )\n    assert (\n        inst.oralDiet.fluidConsistencyType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.fluidConsistencyType[0].text == \"Nectar thick liquids\"\n    assert (\n        inst.oralDiet.schedule.timing[0].repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-10\"}\n        ).valueDateTime\n    )\n    assert inst.oralDiet.schedule.timing[0].repeat.frequency == 3\n    assert float(inst.oralDiet.schedule.timing[0].repeat.period) == float(1)\n    assert inst.oralDiet.schedule.timing[0].repeat.periodUnit == \"d\"\n    assert inst.oralDiet.texture[0].modifier.coding[0].code == \"228055009\"\n    assert inst.oralDiet.texture[0].modifier.coding[0].display == \"Liquidized food\"\n    assert (\n        inst.oralDiet.texture[0].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.texture[0].modifier.text == \"Pureed\"\n    assert inst.oralDiet.type[0].coding[0].code == \"226211001\"\n    assert inst.oralDiet.type[0].coding[0].display == \"Pureed diet\"\n    assert (\n        inst.oralDiet.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[1].code == \"1010\"\n    assert inst.oralDiet.type[0].coding[1].display == \"Pureed diet\"\n    assert (\n        inst.oralDiet.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].text == \"Pureed diet\"\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_9(base_settings):\n    \"\"\"No. 9 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-pureeddiet.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"nutritionorder-example-pureeddiet.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_9(inst2)\n\n\ndef impl_nutritionorder_10(inst):\n    assert inst.allergyIntolerance[0].display == \"Cashew Nuts\"\n    assert inst.allergyIntolerance[0].reference == \"AllergyIntolerance/example\"\n    assert (\n        inst.dateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-17\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.display == \"Inpatient\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.excludeFoodModifier[0].coding[0].code == \"227493005\"\n    assert inst.excludeFoodModifier[0].coding[0].display == \"Cashew Nut\"\n    assert (\n        inst.excludeFoodModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.excludeFoodModifier[0].coding[0].version == \"20140730\"\n    assert inst.foodPreferenceModifier[0].coding[0].code == \"dairy-free\"\n    assert (\n        inst.foodPreferenceModifier[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/diet\"}\n        ).valueUri\n    )\n    assert inst.id == \"diabeticdiet\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/nutrition-requests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[0].amount.code == \"g\"\n    assert (\n        inst.oralDiet.nutrient[0].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.nutrient[0].amount.unit == \"grams\"\n    assert float(inst.oralDiet.nutrient[0].amount.value) == float(75)\n    assert inst.oralDiet.nutrient[0].modifier.coding[0].code == \"2331003\"\n    assert inst.oralDiet.nutrient[0].modifier.coding[0].display == \"Carbohydrate\"\n    assert (\n        inst.oralDiet.nutrient[0].modifier.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.oralDiet.schedule.timing[0].repeat.boundsPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-02-10\"}\n        ).valueDateTime\n    )\n    assert inst.oralDiet.schedule.timing[0].repeat.frequency == 3\n    assert float(inst.oralDiet.schedule.timing[0].repeat.period) == float(1)\n    assert inst.oralDiet.schedule.timing[0].repeat.periodUnit == \"d\"\n    assert inst.oralDiet.type[0].coding[0].code == \"160670007\"\n    assert inst.oralDiet.type[0].coding[0].display == \"Diabetic diet\"\n    assert (\n        inst.oralDiet.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].coding[1].code == \"1030\"\n    assert inst.oralDiet.type[0].coding[1].display == \"DD - Diabetic diet\"\n    assert (\n        inst.oralDiet.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealthhospital.org/diet-type-codes\"}\n        ).valueUri\n    )\n    assert inst.oralDiet.type[0].text == \"DD - Diabetic diet\"\n    assert inst.orderer.display == \"Dr Adam Careful\"\n    assert inst.orderer.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.display == \"Peter Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionorder_10(base_settings):\n    \"\"\"No. 10 tests collection for NutritionOrder.\n    Test File: nutritionorder-example-diabeticdiet.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"nutritionorder-example-diabeticdiet.json\"\n    )\n    inst = nutritionorder.NutritionOrder.model_validate_json(filename.read_bytes())\n    assert \"NutritionOrder\" == inst.get_resource_type()\n\n    impl_nutritionorder_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionOrder\" == data[\"resourceType\"]\n\n    inst2 = nutritionorder.NutritionOrder(**data)\n    impl_nutritionorder_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_nutritionproduct.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/NutritionProduct\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import nutritionproduct\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_nutritionproduct_1(inst):\n    assert inst.category[0].coding[0].code == \"227313005\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"227507002\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.instance[0].identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/foodserials\"}\n        ).valueUri\n    )\n    assert inst.instance[0].identifier[0].value == \"77239487\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_nutritionproduct_1(base_settings):\n    \"\"\"No. 1 tests collection for NutritionProduct.\n    Test File: nutritionproduct-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"nutritionproduct-example.json\"\n    inst = nutritionproduct.NutritionProduct.model_validate_json(filename.read_bytes())\n    assert \"NutritionProduct\" == inst.get_resource_type()\n\n    impl_nutritionproduct_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"NutritionProduct\" == data[\"resourceType\"]\n\n    inst2 = nutritionproduct.NutritionProduct(**data)\n    impl_nutritionproduct_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_observation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Observation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import observation\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_observation_1(inst):\n    assert inst.bodySite.coding[0].code == \"71341001:272741003=7771000\"\n    assert (\n        inst.bodySite.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.bodySite.text == \"Left Femur\"\n    assert inst.code.coding[0].code == \"24701-5\"\n    assert inst.code.coding[0].display == \"Femur DXA Bone density\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"BMD - Left Femur\"\n    assert inst.id == \"bmd\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Acme Imaging Diagnostics\"\n    assert (\n        inst.performer[0].reference\n        == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/pat2\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"g/cm-2\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"g/cm²\"\n    assert float(inst.valueQuantity.value) == float(0.887)\n\n\ndef test_observation_1(base_settings):\n    \"\"\"No. 1 tests collection for Observation.\n    Test File: observation-example-bmd.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observation-example-bmd.json\"\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_1(inst2)\n\n\ndef impl_observation_2(inst):\n    assert inst.category[0].coding[0].code == \"vital-signs\"\n    assert inst.category[0].coding[0].display == \"Vital Signs\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Vital Signs\"\n    assert inst.code.coding[0].code == \"9279-1\"\n    assert inst.code.coding[0].display == \"Respiratory rate\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Respiratory rate\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1999-07-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"respiratory-rate\"\n    assert inst.meta.profile[0] == \"http://hl7.org/fhir/StructureDefinition/vitalsigns\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"/min\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"breaths/minute\"\n    assert float(inst.valueQuantity.value) == float(26)\n\n\ndef test_observation_2(base_settings):\n    \"\"\"No. 2 tests collection for Observation.\n    Test File: observation-example-respiratory-rate.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"observation-example-respiratory-rate.json\"\n    )\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_2(inst2)\n\n\ndef impl_observation_3(inst):\n    assert inst.category[0].coding[0].code == \"vital-signs\"\n    assert inst.category[0].coding[0].display == \"Vital Signs\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"29463-7\"\n    assert inst.code.coding[0].display == \"Body Weight\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.coding[1].code == \"3141-9\"\n    assert inst.code.coding[1].display == \"Body weight Measured\"\n    assert (\n        inst.code.coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.coding[2].code == \"27113001\"\n    assert inst.code.coding[2].display == \"Body weight\"\n    assert (\n        inst.code.coding[2].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[3].code == \"body-weight\"\n    assert inst.code.coding[3].display == \"Body Weight\"\n    assert (\n        inst.code.coding[3].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/devices/clinical-codes\"}\n        ).valueUri\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-03-28\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"[lb_av]\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"lbs\"\n    assert float(inst.valueQuantity.value) == float(185)\n\n\ndef test_observation_3(base_settings):\n    \"\"\"No. 3 tests collection for Observation.\n    Test File: observation-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observation-example.json\"\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_3(inst2)\n\n\ndef impl_observation_4(inst):\n    assert inst.category[0].coding[0].code == \"vital-signs\"\n    assert inst.category[0].coding[0].display == \"Vital Signs\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Vital Signs\"\n    assert inst.code.coding[0].code == \"8478-0\"\n    assert inst.code.coding[0].display == \"Mean blood pressure\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Mean blood pressure\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1999-07-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"mbp\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"mm[Hg]\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"mm[Hg]\"\n    assert float(inst.valueQuantity.value) == float(80)\n\n\ndef test_observation_4(base_settings):\n    \"\"\"No. 4 tests collection for Observation.\n    Test File: observation-example-mbp.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observation-example-mbp.json\"\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_4(inst2)\n\n\ndef impl_observation_5(inst):\n    assert inst.category[0].coding[0].code == \"vital-signs\"\n    assert inst.category[0].coding[0].display == \"Vital Signs\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Vital Signs\"\n    assert inst.code.coding[0].code == \"39156-5\"\n    assert inst.code.coding[0].display == \"Body mass index (BMI) [Ratio]\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"BMI\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1999-07-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"bmi\"\n    assert inst.meta.profile[0] == \"http://hl7.org/fhir/StructureDefinition/vitalsigns\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"kg/m2\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"kg/m2\"\n    assert float(inst.valueQuantity.value) == float(16.2)\n\n\ndef test_observation_5(base_settings):\n    \"\"\"No. 5 tests collection for Observation.\n    Test File: observation-example-bmi.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observation-example-bmi.json\"\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_5(inst2)\n\n\ndef impl_observation_6(inst):\n    assert inst.category[0].coding[0].code == \"vital-signs\"\n    assert inst.category[0].coding[0].display == \"Vital Signs\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Vital Signs\"\n    assert inst.code.coding[0].code == \"8302-2\"\n    assert inst.code.coding[0].display == \"Body height\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Body height\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1999-07-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"body-height\"\n    assert inst.meta.profile[0] == \"http://hl7.org/fhir/StructureDefinition/vitalsigns\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"[in_i]\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"in\"\n    assert float(inst.valueQuantity.value) == float(66.89999999999999)\n\n\ndef test_observation_6(base_settings):\n    \"\"\"No. 6 tests collection for Observation.\n    Test File: observation-example-body-height.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"observation-example-body-height.json\"\n    )\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_6(inst2)\n\n\ndef impl_observation_7(inst):\n    assert inst.code.text == \"eye color\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-05-18\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"eye-color\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueString == \"blue\"\n\n\ndef test_observation_7(base_settings):\n    \"\"\"No. 7 tests collection for Observation.\n    Test File: observation-example-eye-color.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observation-example-eye-color.json\"\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_7(inst2)\n\n\ndef impl_observation_8(inst):\n    assert inst.category[0].coding[0].code == \"vital-signs\"\n    assert inst.category[0].coding[0].display == \"Vital Signs\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Vital Signs\"\n    assert inst.code.coding[0].code == \"8310-5\"\n    assert inst.code.coding[0].display == \"Body temperature\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Body temperature\"\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1999-07-02\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"body-temperature\"\n    assert inst.meta.profile[0] == \"http://hl7.org/fhir/StructureDefinition/vitalsigns\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"Cel\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"C\"\n    assert float(inst.valueQuantity.value) == float(36.5)\n\n\ndef test_observation_8(base_settings):\n    \"\"\"No. 8 tests collection for Observation.\n    Test File: observation-example-body-temperature.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"observation-example-body-temperature.json\"\n    )\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_8(inst2)\n\n\ndef impl_observation_9(inst):\n    assert inst.category[0].coding[0].code == \"exam\"\n    assert inst.category[0].coding[0].display == \"Exam\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Exam\"\n    assert inst.code.coding[0].code == \"410211008\"\n    assert inst.code.coding[0].display == \"Tracheostomy care assessment (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-11T16:07:54+00:00\"}\n        ).valueDateTime\n    )\n    assert inst.focus[0].reference == \"Patient/infant-mom\"\n    assert inst.id == \"trachcare\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/infant\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.valueString == \"Mother is trained to change her child's tracheostomy tube\"\n    )\n\n\ndef test_observation_9(base_settings):\n    \"\"\"No. 9 tests collection for Observation.\n    Test File: observation-example-trachcare.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observation-example-trachcare.json\"\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_9(inst2)\n\n\ndef impl_observation_10(inst):\n    assert inst.code.coding[0].code == \"11555-0\"\n    assert inst.code.coding[0].display == \"Base excess in Blood by calculation\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.effectiveDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-02T10:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"f002\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.bmc.nl/zorgportal/identifiers/observations\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"6324\"\n    assert inst.interpretation[0].coding[0].code == \"H\"\n    assert inst.interpretation[0].coding[0].display == \"High\"\n    assert (\n        inst.interpretation[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-04-03T15:30:10+01:00\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"A. Langeveld\"\n    assert inst.performer[0].reference == \"Practitioner/f005\"\n    assert inst.referenceRange[0].high.code == \"mmol/L\"\n    assert (\n        inst.referenceRange[0].high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.referenceRange[0].high.unit == \"mmol/l\"\n    assert float(inst.referenceRange[0].high.value) == float(11.2)\n    assert inst.referenceRange[0].low.code == \"mmol/L\"\n    assert (\n        inst.referenceRange[0].low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.referenceRange[0].low.unit == \"mmol/l\"\n    assert float(inst.referenceRange[0].low.value) == float(7.1)\n    assert inst.status == \"final\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n    assert inst.valueQuantity.code == \"mmol/L\"\n    assert (\n        inst.valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.valueQuantity.unit == \"mmol/l\"\n    assert float(inst.valueQuantity.value) == float(12.6)\n\n\ndef test_observation_10(base_settings):\n    \"\"\"No. 10 tests collection for Observation.\n    Test File: observation-example-f002-excess.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"observation-example-f002-excess.json\"\n    )\n    inst = observation.Observation.model_validate_json(filename.read_bytes())\n    assert \"Observation\" == inst.get_resource_type()\n\n    impl_observation_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Observation\" == data[\"resourceType\"]\n\n    inst2 = observation.Observation(**data)\n    impl_observation_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_observationdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ObservationDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import observationdefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_observationdefinition_1(inst):\n    assert inst.category[0].coding[0].code == \"laboratory\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/observation-category\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"13980-8\"\n    assert (\n        inst.code.coding[0].display\n        == \"Albumin/Protein.total in Serum or Plasma by Electrophoresis\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.method.coding[0].code == \"115341008\"\n    assert inst.method.coding[0].display == \"Total measurement\"\n    assert (\n        inst.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.multipleResultsAllowed is False\n    assert inst.permittedDataType[0] == \"Quantity\"\n    assert inst.permittedUnit[0].code == \"%\"\n    assert inst.permittedUnit[0].display == \"%\"\n    assert (\n        inst.permittedUnit[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.qualifiedValue[0].context.coding[0].code == \"normal\"\n    assert inst.qualifiedValue[0].context.coding[0].display == \"Normal Range\"\n    assert (\n        inst.qualifiedValue[0].context.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/referencerange-meaning\"}\n        ).valueUri\n    )\n    assert float(inst.qualifiedValue[0].range.low.value) == float(50)\n    assert inst.qualifiedValue[0].rangeCategory == \"reference\"\n    assert inst.qualifiedValue[1].context.coding[0].code == \"normal\"\n    assert inst.qualifiedValue[1].context.coding[0].display == \"Normal Range\"\n    assert (\n        inst.qualifiedValue[1].context.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/referencerange-meaning\"}\n        ).valueUri\n    )\n    assert float(inst.qualifiedValue[1].range.high.value) == float(40)\n    assert inst.qualifiedValue[1].rangeCategory == \"critical\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_observationdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for ObservationDefinition.\n    Test File: observationdefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"observationdefinition-example.json\"\n    inst = observationdefinition.ObservationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"ObservationDefinition\" == inst.get_resource_type()\n\n    impl_observationdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ObservationDefinition\" == data[\"resourceType\"]\n\n    inst2 = observationdefinition.ObservationDefinition(**data)\n    impl_observationdefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_operationdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OperationDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import operationdefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_operationdefinition_1(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"translate-id\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 1\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"NamingSystem-translate-id\"\n    assert inst.instance is False\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.kind == \"operation\"\n    assert inst.name == \"TranslateId\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"id\"\n    assert inst.parameter[0].type == \"string\"\n    assert inst.parameter[0].use == \"in\"\n    assert (\n        inst.parameter[1].binding.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.parameter[1].binding.extension[0].valueString\n        == \"NamingSystemIdentifierType\"\n    )\n    assert inst.parameter[1].binding.strength == \"required\"\n    assert inst.parameter[1].binding.valueSet == (\n        \"http://hl7.org/fhir/ValueSet/namingsystem-identifier-\" \"type|5.0.0\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 1\n    assert inst.parameter[1].name == \"sourceType\"\n    assert inst.parameter[1].type == \"code\"\n    assert inst.parameter[1].use == \"in\"\n    assert (\n        inst.parameter[2].binding.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.parameter[2].binding.extension[0].valueString\n        == \"NamingSystemIdentifierType\"\n    )\n    assert inst.parameter[2].binding.strength == \"required\"\n    assert inst.parameter[2].binding.valueSet == (\n        \"http://hl7.org/fhir/ValueSet/namingsystem-identifier-\" \"type|5.0.0\"\n    )\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 1\n    assert inst.parameter[2].name == \"targetType\"\n    assert inst.parameter[2].type == \"code\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].documentation == (\n        \"If preferredOnly = true then return only the preferred \"\n        \"identifier, or if preferredOnly = false then return all \"\n        \"available ids.\"\n    )\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 0\n    assert inst.parameter[3].name == \"preferredOnly\"\n    assert inst.parameter[3].type == \"boolean\"\n    assert inst.parameter[3].use == \"in\"\n    assert inst.parameter[4].documentation == (\n        \"If 'date' is supplied return only ids that have a validity \"\n        \"period that includes that date.\"\n    )\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 0\n    assert inst.parameter[4].name == \"date\"\n    assert inst.parameter[4].type == \"dateTime\"\n    assert inst.parameter[4].use == \"in\"\n    assert (\n        inst.parameter[5].documentation\n        == \"True if the identifier could be translated successfully.\"\n    )\n    assert inst.parameter[5].max == \"1\"\n    assert inst.parameter[5].min == 1\n    assert inst.parameter[5].name == \"result\"\n    assert inst.parameter[5].type == \"boolean\"\n    assert inst.parameter[5].use == \"out\"\n    assert (\n        inst.parameter[6].documentation\n        == \"The target identifer(s) of the requested type\"\n    )\n    assert inst.parameter[6].max == \"*\"\n    assert inst.parameter[6].min == 0\n    assert inst.parameter[6].name == \"targetIdentifier\"\n    assert inst.parameter[6].type == \"string\"\n    assert inst.parameter[6].use == \"out\"\n    assert (\n        inst.parameter[7].documentation == \"Whether the target identifier is preferred.\"\n    )\n    assert inst.parameter[7].max == \"1\"\n    assert inst.parameter[7].min == 0\n    assert inst.parameter[7].name == \"targetIdentifer.preferred\"\n    assert inst.parameter[7].type == \"boolean\"\n    assert inst.parameter[7].use == \"out\"\n    assert (\n        inst.parameter[8].documentation\n        == \"The perioid when the target identifier is valid.\"\n    )\n    assert inst.parameter[8].max == \"1\"\n    assert inst.parameter[8].min == 0\n    assert inst.parameter[8].name == \"targetIdentifier.period\"\n    assert inst.parameter[8].type == \"Period\"\n    assert inst.parameter[8].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"NamingSystem\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Translate id\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/OperationDefinition/NamingSystem-translate-id\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_operationdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for OperationDefinition.\n    Test File: operation-namingsystem-translate-id.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operation-namingsystem-translate-id.json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_1(inst2)\n\n\ndef impl_operationdefinition_2(inst):\n    assert inst.affectsState is True\n    assert inst.code == \"docref\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 3\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"DocumentReference-docref\"\n    assert inst.instance is False\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Docref\"\n    assert inst.parameter[0].documentation == (\n        \"The id of the patient resource located on the server on \"\n        \"which this operation is executed.  If there is no match, an \"\n        \"empty Bundle is returned\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"patient\"\n    assert inst.parameter[0].type == \"id\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"start\"\n    assert inst.parameter[1].type == \"dateTime\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"end\"\n    assert inst.parameter[2].type == \"dateTime\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].binding.strength == \"required\"\n    assert (\n        inst.parameter[3].binding.valueSet\n        == \"http://hl7.org/fhir/ValueSet/doc-typecodes|5.0.0\"\n    )\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 0\n    assert inst.parameter[3].name == \"type\"\n    assert inst.parameter[3].type == \"CodeableConcept\"\n    assert inst.parameter[3].use == \"in\"\n    assert inst.parameter[4].documentation == (\n        \"This on-demand parameter allows client to dictate whether \"\n        \"they are requesting only 'on-demand' or both 'on-demand' and\"\n        \" 'stable' documents (or delayed/deferred assembly) that meet\"\n        \" the query parameters\"\n    )\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 0\n    assert inst.parameter[4].name == \"on-demand\"\n    assert inst.parameter[4].type == \"boolean\"\n    assert inst.parameter[4].use == \"in\"\n    assert inst.parameter[5].documentation == (\n        'The bundle type is \"searchset\"containing '\n        \"[DocumentReference](documentreference.html) resources.\"\n    )\n    assert inst.parameter[5].max == \"1\"\n    assert inst.parameter[5].min == 1\n    assert inst.parameter[5].name == \"return\"\n    assert inst.parameter[5].type == \"Bundle\"\n    assert inst.parameter[5].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"DocumentReference\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Fetch DocumentReference\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/OperationDefinition/DocumentReference-docref\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_operationdefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for OperationDefinition.\n    Test File: operation-documentreference-docref.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operation-documentreference-docref.json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_2(inst2)\n\n\ndef impl_operationdefinition_3(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"status\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This operation is used to return the current status \"\n        \"information about one or more topic-based Subscriptions.\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 2\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Subscription-status\"\n    assert inst.instance is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Status\"\n    assert inst.parameter[0].max == \"*\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"id\"\n    assert inst.parameter[0].scope[0] == \"type\"\n    assert inst.parameter[0].type == \"id\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].binding.strength == \"required\"\n    assert (\n        inst.parameter[1].binding.valueSet\n        == \"http://hl7.org/fhir/ValueSet/subscription-status|5.0.0\"\n    )\n    assert inst.parameter[1].max == \"*\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"status\"\n    assert inst.parameter[1].scope[0] == \"type\"\n    assert inst.parameter[1].type == \"code\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == (\n        \"The operation returns a bundle containing zero or more \"\n        \"SubscriptionStatus resources, one per Subscription in the \"\n        'request that was found. The Bundle type is \"searchset\".'\n    )\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 1\n    assert inst.parameter[2].name == \"return\"\n    assert inst.parameter[2].type == \"Bundle\"\n    assert inst.parameter[2].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Subscription\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == (\n        \"Get Current Subscription Status for One or More \" \"Subscriptions\"\n    )\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Subscription-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_operationdefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for OperationDefinition.\n    Test File: operation-subscription-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"operation-subscription-status.json\"\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_3(inst2)\n\n\ndef impl_operationdefinition_4(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"data-requirements\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"The data-requirements operation aggregates and returns the \"\n        \"parameters and data requirements for the measure and all its\"\n        \" dependencies as a single module definition\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 3\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Measure-data-requirements\"\n    assert inst.instance is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.kind == \"operation\"\n    assert inst.name == \"DataRequirements\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"periodStart\"\n    assert inst.parameter[0].type == \"date\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The end of the measurement period. The period will end at \"\n        \"the end of the period implied by the supplied timestamp. \"\n        \"E.g. a value of 2014 would set the period end to be \"\n        \"2014-12-31T23:59:59 inclusive\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 1\n    assert inst.parameter[1].name == \"periodEnd\"\n    assert inst.parameter[1].type == \"date\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == (\n        \"The result of the requirements gathering is a module-\"\n        \"definition Library that describes the aggregate parameters, \"\n        \"data requirements, and dependencies of the measure\"\n    )\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 1\n    assert inst.parameter[2].name == \"return\"\n    assert inst.parameter[2].type == \"Library\"\n    assert inst.parameter[2].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Measure\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Data Requirements\"\n    assert inst.type is False\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Measure-data-requirements\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_operationdefinition_4(base_settings):\n    \"\"\"No. 4 tests collection for OperationDefinition.\n    Test File: operation-measure-data-requirements.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operation-measure-data-requirements.json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_4(inst2)\n\n\ndef impl_operationdefinition_5(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"translate\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 1\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"ConceptMap-translate\"\n    assert inst.instance is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Translate\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"url\"\n    assert inst.parameter[0].scope[0] == \"type\"\n    assert inst.parameter[0].type == \"uri\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The concept map is provided directly as part of the request.\"\n        \" Servers may choose not to accept concept maps in this \"\n        \"fashion.\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"conceptMap\"\n    assert inst.parameter[1].scope[0] == \"type\"\n    assert inst.parameter[1].type == \"ConceptMap\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"conceptMapVersion\"\n    assert inst.parameter[2].scope[0] == \"type\"\n    assert inst.parameter[2].type == \"string\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].documentation == (\n        \"The code that is to be translated. If a code is provided, a \"\n        \"system must be provided\"\n    )\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 0\n    assert inst.parameter[3].name == \"sourceCode\"\n    assert inst.parameter[3].type == \"code\"\n    assert inst.parameter[3].use == \"in\"\n    assert (\n        inst.parameter[4].documentation\n        == \"The system for the code that is to be translated\"\n    )\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 0\n    assert inst.parameter[4].name == \"system\"\n    assert inst.parameter[4].type == \"uri\"\n    assert inst.parameter[4].use == \"in\"\n    assert inst.parameter[5].documentation == (\n        \"The version of the system, if one was provided in the source\" \" data\"\n    )\n    assert inst.parameter[5].max == \"1\"\n    assert inst.parameter[5].min == 0\n    assert inst.parameter[5].name == \"version\"\n    assert inst.parameter[5].type == \"string\"\n    assert inst.parameter[5].use == \"in\"\n    assert inst.parameter[6].documentation == (\n        \"Limits the scope of the $translate operation to source codes\"\n        \" (ConceptMap.group.element.code) that are members of this \"\n        \"value set.\"\n    )\n    assert inst.parameter[6].max == \"1\"\n    assert inst.parameter[6].min == 0\n    assert inst.parameter[6].name == \"sourceScope\"\n    assert inst.parameter[6].type == \"uri\"\n    assert inst.parameter[6].use == \"in\"\n    assert inst.parameter[7].documentation == \"A coding to translate\"\n    assert inst.parameter[7].max == \"1\"\n    assert inst.parameter[7].min == 0\n    assert inst.parameter[7].name == \"sourceCoding\"\n    assert inst.parameter[7].type == \"Coding\"\n    assert inst.parameter[7].use == \"in\"\n    assert inst.parameter[8].documentation == (\n        \"A full codeableConcept to validate. The server can translate\"\n        \" any of the coding values (e.g. existing translations) as it\"\n        \" chooses\"\n    )\n    assert inst.parameter[8].max == \"1\"\n    assert inst.parameter[8].min == 0\n    assert inst.parameter[8].name == \"sourceCodeableConcept\"\n    assert inst.parameter[8].type == \"CodeableConcept\"\n    assert inst.parameter[8].use == \"in\"\n    assert inst.parameter[9].documentation == (\n        \"The target code that is to be translated to. If a code is \"\n        \"provided, a system must be provided\"\n    )\n    assert inst.parameter[9].max == \"1\"\n    assert inst.parameter[9].min == 0\n    assert inst.parameter[9].name == \"targetCode\"\n    assert inst.parameter[9].type == \"uri\"\n    assert inst.parameter[9].use == \"in\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"ConceptMap\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Concept Translation\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/ConceptMap-translate\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_operationdefinition_5(base_settings):\n    \"\"\"No. 5 tests collection for OperationDefinition.\n    Test File: operation-conceptmap-translate.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operation-conceptmap-translate.json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_5(inst2)\n\n\ndef impl_operationdefinition_6(inst):\n    assert inst.affectsState is True\n    assert inst.code == \"add\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Add content to an array in a large resource such as List or \"\n        \"Group. See [Operations for Large Resources](operations-for-\"\n        \"large-resources.html).\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 0\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Resource-add\"\n    assert inst.instance is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Add\"\n    assert inst.parameter[0].documentation == (\n        \"Resource containing content to add. See [Operations for \"\n        \"Large Resources](operations-for-large-resources.html).\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"additions\"\n    assert inst.parameter[0].type == \"Resource\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"Resource containing content added. See [Operations for Large\"\n        \" Resources](operations-for-large-resources.html).\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"return\"\n    assert inst.parameter[1].type == \"Resource\"\n    assert inst.parameter[1].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Resource\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Add to an array in a large resource\"\n    assert inst.type is False\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Resource-add\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_operationdefinition_6(base_settings):\n    \"\"\"No. 6 tests collection for OperationDefinition.\n    Test File: operation-resource-add.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"operation-resource-add.json\"\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_6(inst2)\n\n\ndef impl_operationdefinition_7(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"apply\"\n    assert inst.comment == (\n        \"The result of this operation is a Specimen resource based on\"\n        \" the definition of the specimen as described in the \"\n        \"SpecimenDefinition resource and the supplied parameters.\"\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"The apply operation applies a SpecimenDefinition in a given \"\n        \"context to create a Specimen resource instance\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 1\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"SpecimenDefinition-apply\"\n    assert inst.instance is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Apply\"\n    assert inst.parameter[0].documentation == (\n        \"The specimen definition to be applied. If the operation is \"\n        \"invoked at the instance level, this parameter is not \"\n        \"allowed; if the operation is invoked at the type level, this\"\n        \" parameter is required\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"specimenDefinition\"\n    assert inst.parameter[0].scope[0] == \"type\"\n    assert inst.parameter[0].type == \"SpecimenDefinition\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].max == \"*\"\n    assert inst.parameter[1].min == 1\n    assert inst.parameter[1].name == \"subject\"\n    assert inst.parameter[1].searchType == \"reference\"\n    assert inst.parameter[1].type == \"string\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == (\n        \"The practitioner (or practitioner role) that is collecting \" \"the specimen\"\n    )\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"collector\"\n    assert inst.parameter[2].searchType == \"reference\"\n    assert inst.parameter[2].type == \"string\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].documentation == (\n        \"The type of user initiating the request, e.g. patient, \"\n        \"healthcare provider, or specific type of healthcare provider\"\n        \" (physician, nurse, etc.)\"\n    )\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 0\n    assert inst.parameter[3].name == \"userType\"\n    assert inst.parameter[3].type == \"CodeableConcept\"\n    assert inst.parameter[3].use == \"in\"\n    assert (\n        inst.parameter[4].documentation\n        == \"Preferred language of the person using the system\"\n    )\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 0\n    assert inst.parameter[4].name == \"userLanguage\"\n    assert inst.parameter[4].type == \"CodeableConcept\"\n    assert inst.parameter[4].use == \"in\"\n    assert inst.parameter[5].max == \"1\"\n    assert inst.parameter[5].min == 0\n    assert inst.parameter[5].name == \"userTaskContext\"\n    assert inst.parameter[5].type == \"CodeableConcept\"\n    assert inst.parameter[5].use == \"in\"\n    assert inst.parameter[6].documentation == (\n        \"The current setting of the request (inpatient, outpatient, \" \"etc.)\"\n    )\n    assert inst.parameter[6].max == \"1\"\n    assert inst.parameter[6].min == 0\n    assert inst.parameter[6].name == \"setting\"\n    assert inst.parameter[6].type == \"CodeableConcept\"\n    assert inst.parameter[6].use == \"in\"\n    assert (\n        inst.parameter[7].documentation\n        == \"Additional detail about the setting of the request, if any\"\n    )\n    assert inst.parameter[7].max == \"1\"\n    assert inst.parameter[7].min == 0\n    assert inst.parameter[7].name == \"settingContext\"\n    assert inst.parameter[7].type == \"CodeableConcept\"\n    assert inst.parameter[7].use == \"in\"\n    assert inst.parameter[8].documentation == (\n        \"The Specimen resource that is the result of applying the \"\n        \"specimen definition\"\n    )\n    assert inst.parameter[8].max == \"1\"\n    assert inst.parameter[8].min == 1\n    assert inst.parameter[8].name == \"return\"\n    assert inst.parameter[8].type == \"Specimen\"\n    assert inst.parameter[8].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"SpecimenDefinition\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Apply\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/OperationDefinition/SpecimenDefinition-apply\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_operationdefinition_7(base_settings):\n    \"\"\"No. 7 tests collection for OperationDefinition.\n    Test File: operation-specimendefinition-apply.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operation-specimendefinition-apply.json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_7(inst2)\n\n\ndef impl_operationdefinition_8(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"expand\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 5\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"normative\"\n    assert inst.id == \"ValueSet-expand\"\n    assert inst.instance is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Expand\"\n    assert inst.parameter[0].documentation == (\n        \"A canonical reference to a value set. The server must know \"\n        \"the value set (e.g. it is defined explicitly in the server's\"\n        \" value sets, or it is defined implicitly by some code system\"\n        \" known to the server\"\n    )\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"url\"\n    assert inst.parameter[0].scope[0] == \"type\"\n    assert inst.parameter[0].type == \"uri\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"The value set is provided directly as part of the request. \"\n        \"Servers may choose not to accept value sets in this fashion\"\n    )\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"valueSet\"\n    assert inst.parameter[1].scope[0] == \"type\"\n    assert inst.parameter[1].type == \"ValueSet\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"valueSetVersion\"\n    assert inst.parameter[2].scope[0] == \"type\"\n    assert inst.parameter[2].type == \"string\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 0\n    assert inst.parameter[3].name == \"context\"\n    assert inst.parameter[3].type == \"uri\"\n    assert inst.parameter[3].use == \"in\"\n    assert inst.parameter[4].max == \"1\"\n    assert inst.parameter[4].min == 0\n    assert inst.parameter[4].name == \"contextDirection\"\n    assert inst.parameter[4].type == \"code\"\n    assert inst.parameter[4].use == \"in\"\n    assert inst.parameter[5].max == \"1\"\n    assert inst.parameter[5].min == 0\n    assert inst.parameter[5].name == \"filter\"\n    assert inst.parameter[5].type == \"string\"\n    assert inst.parameter[5].use == \"in\"\n    assert inst.parameter[6].max == \"1\"\n    assert inst.parameter[6].min == 0\n    assert inst.parameter[6].name == \"date\"\n    assert inst.parameter[6].type == \"dateTime\"\n    assert inst.parameter[6].use == \"in\"\n    assert inst.parameter[7].documentation == (\n        \"Paging support - where to start if a subset is desired \"\n        \"(default = 0). Offset is number of records (not number of \"\n        \"pages)\"\n    )\n    assert inst.parameter[7].max == \"1\"\n    assert inst.parameter[7].min == 0\n    assert inst.parameter[7].name == \"offset\"\n    assert inst.parameter[7].type == \"integer\"\n    assert inst.parameter[7].use == \"in\"\n    assert inst.parameter[8].max == \"1\"\n    assert inst.parameter[8].min == 0\n    assert inst.parameter[8].name == \"count\"\n    assert inst.parameter[8].type == \"integer\"\n    assert inst.parameter[8].use == \"in\"\n    assert inst.parameter[9].documentation == (\n        \"Controls whether concept designations are to be included or \"\n        \"excluded in value set expansions\"\n    )\n    assert inst.parameter[9].max == \"1\"\n    assert inst.parameter[9].min == 0\n    assert inst.parameter[9].name == \"includeDesignations\"\n    assert inst.parameter[9].type == \"boolean\"\n    assert inst.parameter[9].use == \"in\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"ValueSet\"\n    assert inst.status == \"active\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Value Set Expansion\"\n    assert inst.type is True\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/ValueSet-expand\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_operationdefinition_8(base_settings):\n    \"\"\"No. 8 tests collection for OperationDefinition.\n    Test File: operation-valueset-expand.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"operation-valueset-expand.json\"\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_8(inst2)\n\n\ndef impl_operationdefinition_9(inst):\n    assert inst.affectsState is True\n    assert inst.code == \"meta-add\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This operation takes a meta, and adds the profiles, tags, \"\n        \"and security labels found in it to the nominated resource\"\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 3\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Resource-meta-add\"\n    assert inst.instance is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.kind == \"operation\"\n    assert inst.name == \"MetaAdd\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 1\n    assert inst.parameter[0].name == \"meta\"\n    assert inst.parameter[0].type == \"Meta\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == \"Resulting meta for the resource\"\n    assert inst.parameter[1].max == \"1\"\n    assert inst.parameter[1].min == 1\n    assert inst.parameter[1].name == \"return\"\n    assert inst.parameter[1].type == \"Meta\"\n    assert inst.parameter[1].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Resource\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Add profiles, tags, and security labels to a resource\"\n    assert inst.type is False\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Resource-meta-add\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_operationdefinition_9(base_settings):\n    \"\"\"No. 9 tests collection for OperationDefinition.\n    Test File: operation-resource-meta-add.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"operation-resource-meta-add.json\"\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_9(inst2)\n\n\ndef impl_operationdefinition_10(inst):\n    assert inst.affectsState is False\n    assert inst.code == \"everything\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueInteger == 2\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert inst.id == \"Encounter-everything\"\n    assert inst.instance is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.kind == \"operation\"\n    assert inst.name == \"Everything\"\n    assert inst.parameter[0].max == \"1\"\n    assert inst.parameter[0].min == 0\n    assert inst.parameter[0].name == \"_since\"\n    assert inst.parameter[0].type == \"instant\"\n    assert inst.parameter[0].use == \"in\"\n    assert inst.parameter[1].documentation == (\n        \"One or more parameters, each containing one or more comma-\"\n        \"delimited FHIR resource types to include in the return \"\n        \"resources. In the absense of any specified types, the server\"\n        \" returns all resource types\"\n    )\n    assert inst.parameter[1].max == \"*\"\n    assert inst.parameter[1].min == 0\n    assert inst.parameter[1].name == \"_type\"\n    assert inst.parameter[1].type == \"code\"\n    assert inst.parameter[1].use == \"in\"\n    assert inst.parameter[2].documentation == (\n        \"See discussion below on the utility of paging through the \"\n        \"results of the $everything operation\"\n    )\n    assert inst.parameter[2].max == \"1\"\n    assert inst.parameter[2].min == 0\n    assert inst.parameter[2].name == \"_count\"\n    assert inst.parameter[2].type == \"integer\"\n    assert inst.parameter[2].use == \"in\"\n    assert inst.parameter[3].documentation == 'The bundle type is \"searchset\"'\n    assert inst.parameter[3].max == \"1\"\n    assert inst.parameter[3].min == 1\n    assert inst.parameter[3].name == \"return\"\n    assert inst.parameter[3].type == \"Bundle\"\n    assert inst.parameter[3].use == \"out\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.resource[0] == \"Encounter\"\n    assert inst.status == \"draft\"\n    assert inst.system is False\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Fetch Encounter Record\"\n    assert inst.type is False\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/OperationDefinition/Encounter-everything\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_operationdefinition_10(base_settings):\n    \"\"\"No. 10 tests collection for OperationDefinition.\n    Test File: operation-encounter-everything.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operation-encounter-everything.json\"\n    )\n    inst = operationdefinition.OperationDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OperationDefinition\" == inst.get_resource_type()\n\n    impl_operationdefinition_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationDefinition\" == data[\"resourceType\"]\n\n    inst2 = operationdefinition.OperationDefinition(**data)\n    impl_operationdefinition_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_operationoutcome.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OperationOutcome\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import operationoutcome\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_operationoutcome_1(inst):\n    assert inst.id == \"validationfail\"\n    assert inst.issue[0].code == \"structure\"\n    assert (\n        inst.issue[0].details.text\n        == 'Error parsing resource XML (Unknown Content \"label\"'\n    )\n    assert inst.issue[0].expression[0] == \"Patient.identifier\"\n    assert inst.issue[0].location[0] == \"/f:Patient/f:identifier\"\n    assert inst.issue[0].severity == \"error\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_operationoutcome_1(base_settings):\n    \"\"\"No. 1 tests collection for OperationOutcome.\n    Test File: operationoutcome-example-validationfail.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationoutcome-example-validationfail.json\"\n    )\n    inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes())\n    assert \"OperationOutcome\" == inst.get_resource_type()\n\n    impl_operationoutcome_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationOutcome\" == data[\"resourceType\"]\n\n    inst2 = operationoutcome.OperationOutcome(**data)\n    impl_operationoutcome_1(inst2)\n\n\ndef impl_operationoutcome_2(inst):\n    assert inst.id == \"break-the-glass\"\n    assert inst.issue[0].code == \"suppressed\"\n    assert inst.issue[0].details.coding[0].code == \"BTG\"\n    assert inst.issue[0].details.coding[0].display == \"Break the glass\"\n    assert (\n        inst.issue[0].details.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.issue[0].details.text == (\n        \"Additional information may be available using the Break-The-\" \"Glass Protocol\"\n    )\n    assert inst.issue[0].severity == \"information\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_operationoutcome_2(base_settings):\n    \"\"\"No. 2 tests collection for OperationOutcome.\n    Test File: operationoutcome-example-break-the-glass.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"operationoutcome-example-break-the-glass.json\"\n    )\n    inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes())\n    assert \"OperationOutcome\" == inst.get_resource_type()\n\n    impl_operationoutcome_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationOutcome\" == data[\"resourceType\"]\n\n    inst2 = operationoutcome.OperationOutcome(**data)\n    impl_operationoutcome_2(inst2)\n\n\ndef impl_operationoutcome_3(inst):\n    assert inst.id == \"searchfail\"\n    assert inst.issue[0].code == \"code-invalid\"\n    assert inst.issue[0].details.text == (\n        'The \"name\" parameter has the modifier \"exact\" which is '\n        \"not supported by this server\"\n    )\n    assert inst.issue[0].location[0] == \"http.name:exact\"\n    assert inst.issue[0].severity == \"fatal\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_operationoutcome_3(base_settings):\n    \"\"\"No. 3 tests collection for OperationOutcome.\n    Test File: operationoutcome-example-searchfail.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operationoutcome-example-searchfail.json\"\n    )\n    inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes())\n    assert \"OperationOutcome\" == inst.get_resource_type()\n\n    impl_operationoutcome_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationOutcome\" == data[\"resourceType\"]\n\n    inst2 = operationoutcome.OperationOutcome(**data)\n    impl_operationoutcome_3(inst2)\n\n\ndef impl_operationoutcome_4(inst):\n    assert inst.id == \"exception\"\n    assert inst.issue[0].code == \"exception\"\n    assert inst.issue[0].details.text == \"SQL Link Communication Error (dbx = 34234)\"\n    assert inst.issue[0].severity == \"error\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_operationoutcome_4(base_settings):\n    \"\"\"No. 4 tests collection for OperationOutcome.\n    Test File: operationoutcome-example-exception.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operationoutcome-example-exception.json\"\n    )\n    inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes())\n    assert \"OperationOutcome\" == inst.get_resource_type()\n\n    impl_operationoutcome_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationOutcome\" == data[\"resourceType\"]\n\n    inst2 = operationoutcome.OperationOutcome(**data)\n    impl_operationoutcome_4(inst2)\n\n\ndef impl_operationoutcome_5(inst):\n    assert inst.id == \"101\"\n    assert inst.issue[0].code == \"code-invalid\"\n    assert (\n        inst.issue[0].details.text\n        == 'The code \"W\" is not known and not legal in this context'\n    )\n    assert (\n        inst.issue[0].diagnostics\n        == \"Acme.Interop.FHIRProcessors.Patient.processGender line 2453\"\n    )\n    assert inst.issue[0].expression[0] == \"Patient.gender\"\n    assert inst.issue[0].location[0] == \"/f:Patient/f:gender\"\n    assert inst.issue[0].severity == \"error\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_operationoutcome_5(base_settings):\n    \"\"\"No. 5 tests collection for OperationOutcome.\n    Test File: operationoutcome-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"operationoutcome-example.json\"\n    inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes())\n    assert \"OperationOutcome\" == inst.get_resource_type()\n\n    impl_operationoutcome_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationOutcome\" == data[\"resourceType\"]\n\n    inst2 = operationoutcome.OperationOutcome(**data)\n    impl_operationoutcome_5(inst2)\n\n\ndef impl_operationoutcome_6(inst):\n    assert inst.id == \"allok\"\n    assert inst.issue[0].code == \"informational\"\n    assert inst.issue[0].details.text == \"All OK\"\n    assert inst.issue[0].severity == \"information\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_operationoutcome_6(base_settings):\n    \"\"\"No. 6 tests collection for OperationOutcome.\n    Test File: operationoutcome-example-allok.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operationoutcome-example-allok.json\"\n    )\n    inst = operationoutcome.OperationOutcome.model_validate_json(filename.read_bytes())\n    assert \"OperationOutcome\" == inst.get_resource_type()\n\n    impl_operationoutcome_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OperationOutcome\" == data[\"resourceType\"]\n\n    inst2 = operationoutcome.OperationOutcome(**data)\n    impl_operationoutcome_6(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_organization.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Organization\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import organization\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_organization_1(inst):\n    assert inst.alias[0] == \"HL7 International\"\n    assert inst.contact[0].address.city == \"Ann Arbor\"\n    assert inst.contact[0].address.country == \"USA\"\n    assert inst.contact[0].address.line[0] == \"3300 Washtenaw Avenue, Suite 227\"\n    assert inst.contact[0].address.postalCode == \"48104\"\n    assert inst.contact[0].address.state == \"MI\"\n    assert (\n        inst.contact[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/extended-contact-availability\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.contact[0].extension[0].valueAvailability.availableTime[0].availableEndTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"07:00:00\"}).valueTime\n    )\n    assert (\n        inst.contact[0]\n        .extension[0]\n        .valueAvailability.availableTime[0]\n        .availableStartTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"09:00:00\"}).valueTime\n    )\n    assert (\n        inst.contact[0].extension[0].valueAvailability.availableTime[0].daysOfWeek[0]\n        == \"mon\"\n    )\n    assert (\n        inst.contact[0].extension[0].valueAvailability.availableTime[0].daysOfWeek[1]\n        == \"tue\"\n    )\n    assert (\n        inst.contact[0].extension[0].valueAvailability.availableTime[0].daysOfWeek[2]\n        == \"wed\"\n    )\n    assert (\n        inst.contact[0].extension[0].valueAvailability.availableTime[0].daysOfWeek[3]\n        == \"thu\"\n    )\n    assert (\n        inst.contact[0].extension[0].valueAvailability.availableTime[0].daysOfWeek[4]\n        == \"fri\"\n    )\n    assert (\n        inst.contact[0].extension[0].valueAvailability.notAvailableTime[0].description\n        == \"Public holidays\"\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].value == \"(+1) 734-677-7777\"\n    assert inst.contact[0].telecom[1].system == \"fax\"\n    assert inst.contact[0].telecom[1].value == \"(+1) 734-677-6622\"\n    assert inst.contact[0].telecom[2].system == \"email\"\n    assert inst.contact[0].telecom[2].value == \"hq@HL7.org\"\n    assert inst.endpoint[0].reference == \"Endpoint/example\"\n    assert inst.id == \"hl7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Health Level Seven International\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_1(base_settings):\n    \"\"\"No. 1 tests collection for Organization.\n    Test File: organization-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"organization-example.json\"\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_1(inst2)\n\n\ndef impl_organization_2(inst):\n    assert inst.active is True\n    assert inst.contact[0].address.country == \"Swizterland\"\n    assert inst.id == \"mmanu\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Acme Corporation\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_2(base_settings):\n    \"\"\"No. 2 tests collection for Organization.\n    Test File: organization-example-mmanu.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"organization-example-mmanu.json\"\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_2(inst2)\n\n\ndef impl_organization_3(inst):\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"mobile\"\n    assert inst.contact[0].telecom[0].value == \"+1 555 234 3523\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"gastro@acme.org\"\n    assert inst.id == \"1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org.au/units\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"Gastro\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Gastroenterology\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_3(base_settings):\n    \"\"\"No. 3 tests collection for Organization.\n    Test File: organization-example-gastro.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"organization-example-gastro.json\"\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_3(inst2)\n\n\ndef impl_organization_4(inst):\n    assert inst.alias[0] == \"Michigan State Department of Health\"\n    assert inst.id == \"3\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://michigan.gov/state-dept-ids\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"25\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Michigan Health\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_4(base_settings):\n    \"\"\"No. 4 tests collection for Organization.\n    Test File: organization-example-mihealth.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"organization-example-mihealth.json\"\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_4(inst2)\n\n\ndef impl_organization_5(inst):\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"+1 555 234 1234\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"contact@labs.acme.org\"\n    assert inst.id == \"1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org.au/units\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"ClinLab\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Clinical Lab\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_5(base_settings):\n    \"\"\"No. 5 tests collection for Organization.\n    Test File: organization-example-lab.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"organization-example-lab.json\"\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_5(inst2)\n\n\ndef impl_organization_6(inst):\n    assert inst.active is True\n    assert inst.contact[0].address.line[0] == \"South Wing, floor 2\"\n    assert inst.contact[0].name[0].text == \"mevr. D. de Haan\"\n    assert inst.contact[0].purpose.coding[0].code == \"ADMIN\"\n    assert (\n        inst.contact[0].purpose.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/contactentity-type\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].value == \"022-655 2321\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"cardio@burgersumc.nl\"\n    assert inst.contact[0].telecom[2].system == \"fax\"\n    assert inst.contact[0].telecom[2].value == \"022-655 2322\"\n    assert inst.id == \"f002\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Burgers UMC Cardiology unit\"\n    assert inst.partOf.reference == \"Organization/f001\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"dept\"\n    assert inst.type[0].coding[0].display == \"Hospital Department\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/organization-type\"}\n        ).valueUri\n    )\n\n\ndef test_organization_6(base_settings):\n    \"\"\"No. 6 tests collection for Organization.\n    Test File: organization-example-f002-burgers-card.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"organization-example-f002-burgers-card.json\"\n    )\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_6(inst2)\n\n\ndef impl_organization_7(inst):\n    assert inst.active is True\n    assert inst.contact[0].address.city == \"Den Helder\"\n    assert inst.contact[0].address.country == \"NLD\"\n    assert inst.contact[0].address.line[0] == \"Walvisbaai 3\"\n    assert inst.contact[0].address.postalCode == \"2333ZA\"\n    assert inst.contact[0].address.use == \"work\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"+31715269111\"\n    assert inst.contact[1].address.city == \"Den helder\"\n    assert inst.contact[1].address.country == \"NLD\"\n    assert inst.contact[1].address.line[0] == \"Walvisbaai 3\"\n    assert inst.contact[1].address.line[1] == \"Gebouw 2\"\n    assert inst.contact[1].address.postalCode == \"2333ZA\"\n    assert inst.contact[1].name[0].family == \"Brand\"\n    assert inst.contact[1].name[0].given[0] == \"Ronald\"\n    assert inst.contact[1].name[0].prefix[0] == \"Prof.Dr.\"\n    assert inst.contact[1].name[0].text == \"Professor Brand\"\n    assert inst.contact[1].name[0].use == \"official\"\n    assert inst.contact[1].telecom[0].system == \"phone\"\n    assert inst.contact[1].telecom[0].use == \"work\"\n    assert inst.contact[1].telecom[0].value == \"+31715269702\"\n    assert inst.id == \"f201\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.zorgkaartnederland.nl/\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"Artis University Medical Center\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Artis University Medical Center (AUMC)\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"405608006\"\n    assert inst.type[0].coding[0].display == \"Academic Medical Center\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.type[0].coding[1].code == \"V6\"\n    assert inst.type[0].coding[1].display == \"University Medical Hospital\"\n    assert (\n        inst.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.15.1060\"}\n        ).valueUri\n    )\n    assert inst.type[0].coding[2].code == \"prov\"\n    assert inst.type[0].coding[2].display == \"Healthcare Provider\"\n    assert (\n        inst.type[0].coding[2].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/organization-type\"}\n        ).valueUri\n    )\n\n\ndef test_organization_7(base_settings):\n    \"\"\"No. 7 tests collection for Organization.\n    Test File: organization-example-f201-aumc.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"organization-example-f201-aumc.json\"\n    )\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_7(inst2)\n\n\ndef impl_organization_8(inst):\n    assert inst.id == \"2.16.840.1.113883.19.5\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.19.5\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Good Health Clinic\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_8(base_settings):\n    \"\"\"No. 8 tests collection for Organization.\n    Test File: organization-example-good-health-care.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"organization-example-good-health-care.json\"\n    )\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_8(inst2)\n\n\ndef impl_organization_9(inst):\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"022-655 2300\"\n    assert inst.contact[1].address.city == \"Den Burg\"\n    assert inst.contact[1].address.country == \"NLD\"\n    assert inst.contact[1].address.line[0] == \"Galapagosweg 91\"\n    assert inst.contact[1].address.postalCode == \"9105 PZ\"\n    assert inst.contact[1].address.use == \"work\"\n    assert inst.contact[2].address.city == \"Den Burg\"\n    assert inst.contact[2].address.country == \"NLD\"\n    assert inst.contact[2].address.line[0] == \"PO Box 2311\"\n    assert inst.contact[2].address.postalCode == \"9100 AA\"\n    assert inst.contact[2].address.use == \"work\"\n    assert inst.contact[3].purpose.coding[0].code == \"PRESS\"\n    assert (\n        inst.contact[3].purpose.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/contactentity-type\"}\n        ).valueUri\n    )\n    assert inst.contact[3].telecom[0].system == \"phone\"\n    assert inst.contact[3].telecom[0].value == \"022-655 2334\"\n    assert inst.contact[4].purpose.coding[0].code == \"PATINF\"\n    assert (\n        inst.contact[4].purpose.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/contactentity-type\"}\n        ).valueUri\n    )\n    assert inst.contact[4].telecom[0].system == \"phone\"\n    assert inst.contact[4].telecom[0].value == \"022-655 2335\"\n    assert inst.id == \"f001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"91654\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"usual\"\n    assert inst.identifier[1].value == \"17-0112278\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Burgers University Medical Center\"\n    assert inst.text.status == \"generated\"\n    assert inst.type[0].coding[0].code == \"V6\"\n    assert inst.type[0].coding[0].display == \"University Medical Hospital\"\n    assert (\n        inst.type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.15.1060\"}\n        ).valueUri\n    )\n    assert inst.type[0].coding[1].code == \"prov\"\n    assert inst.type[0].coding[1].display == \"Healthcare Provider\"\n    assert (\n        inst.type[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/organization-type\"}\n        ).valueUri\n    )\n\n\ndef test_organization_9(base_settings):\n    \"\"\"No. 9 tests collection for Organization.\n    Test File: organization-example-f001-burgers.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"organization-example-f001-burgers.json\"\n    )\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_9(inst2)\n\n\ndef impl_organization_10(inst):\n    assert inst.alias[0] == \"ABC Insurance\"\n    assert inst.id == \"2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.3.19.2.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"666666\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"XYZ Insurance\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organization_10(base_settings):\n    \"\"\"No. 10 tests collection for Organization.\n    Test File: organization-example-insurer.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"organization-example-insurer.json\"\n    inst = organization.Organization.model_validate_json(filename.read_bytes())\n    assert \"Organization\" == inst.get_resource_type()\n\n    impl_organization_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Organization\" == data[\"resourceType\"]\n\n    inst2 = organization.Organization(**data)\n    impl_organization_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_organizationaffiliation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import organizationaffiliation\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_organizationaffiliation_1(inst):\n    assert inst.active is True\n    assert inst.code[0].coding[0].code == \"provider\"\n    assert (\n        inst.code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/organization-role\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"general.practice@example.org\"\n    assert inst.endpoint[0].reference == \"Endpoint/example\"\n    assert inst.healthcareService[0].reference == \"HealthcareService/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org/practitioners\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"23\"\n    assert inst.location[0].display == \"South Wing, second floor\"\n    assert inst.location[0].reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.network[0].display == \"HL7 Payer Network\"\n    assert inst.network[0].reference == \"Organization/hl7pay\"\n    assert inst.organization.reference == \"Organization/hl7pay\"\n    assert inst.participatingOrganization.reference == \"Organization/f001\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-03-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.specialty[0].coding[0].code == \"408443003\"\n    assert inst.specialty[0].coding[0].display == \"General medical practice\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_organizationaffiliation_1(base_settings):\n    \"\"\"No. 1 tests collection for OrganizationAffiliation.\n    Test File: organizationaffiliation-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"organizationaffiliation-example.json\"\n    )\n    inst = organizationaffiliation.OrganizationAffiliation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OrganizationAffiliation\" == inst.get_resource_type()\n\n    impl_organizationaffiliation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OrganizationAffiliation\" == data[\"resourceType\"]\n\n    inst2 = organizationaffiliation.OrganizationAffiliation(**data)\n    impl_organizationaffiliation_1(inst2)\n\n\ndef impl_organizationaffiliation_2(inst):\n    assert inst.active is True\n    assert inst.code[0].coding[0].code == \"member\"\n    assert inst.code[0].coding[0].display == \"Member\"\n    assert (\n        inst.code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/organization-role\"}\n        ).valueUri\n    )\n    assert inst.code[0].text == \"Hospital member\"\n    assert inst.endpoint[0].display == \"Founding Fathers Memorial Hospital HIE endpoint\"\n    assert inst.id == \"orgrole2\"\n    assert inst.identifier[0].assigner.display == \"Monument Health Information Exchange\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/www.monumentHIE.com\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"member hospital\"\n    assert inst.identifier[0].use == \"secondary\"\n    assert inst.identifier[0].value == \"hosp32\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization.display == \"Monument Health Information Exchange\"\n    assert (\n        inst.participatingOrganization.display == \"Founding Fathers Memorial Hospital\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_organizationaffiliation_2(base_settings):\n    \"\"\"No. 2 tests collection for OrganizationAffiliation.\n    Test File: orgrole-example-hie.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"orgrole-example-hie.json\"\n    inst = organizationaffiliation.OrganizationAffiliation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OrganizationAffiliation\" == inst.get_resource_type()\n\n    impl_organizationaffiliation_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OrganizationAffiliation\" == data[\"resourceType\"]\n\n    inst2 = organizationaffiliation.OrganizationAffiliation(**data)\n    impl_organizationaffiliation_2(inst2)\n\n\ndef impl_organizationaffiliation_3(inst):\n    assert inst.active is True\n    assert inst.code[0].coding[0].code == \"provider\"\n    assert inst.code[0].coding[0].display == \"Provider\"\n    assert (\n        inst.code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/organization-role\"}\n        ).valueUri\n    )\n    assert inst.code[0].coding[0].userSelected is True\n    assert inst.code[0].text == \"Provider of rehabilitation services\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"202-109-8765\"\n    assert inst.healthcareService[0].display == \"Inpatient rehabilitation services\"\n    assert inst.healthcareService[1].display == \"Outpatient rehabilitation services\"\n    assert inst.id == \"orgrole1\"\n    assert inst.identifier[0].assigner.display == \"Founding Fathers Memorial Hospital\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/www.foundingfathersmemorial.com\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"secondary\"\n    assert inst.identifier[0].value == \"service002\"\n    assert inst.location[0].display == \"Founding Fathers Memorial Hospital\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.network[0].display == \"Patriot Preferred Provider Network\"\n    assert inst.organization.display == \"Founding Fathers Memorial Hospital\"\n    assert (\n        inst.participatingOrganization.display\n        == \"Independence Rehabilitation Services, Inc.\"\n    )\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-02-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-02-09\"}\n        ).valueDateTime\n    )\n    assert inst.specialty[0].coding[0].code == \"394602003\"\n    assert inst.specialty[0].coding[0].display == \"Rehabilitation - specialty\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.specialty[0].text == \"Rehabilitation\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_organizationaffiliation_3(base_settings):\n    \"\"\"No. 3 tests collection for OrganizationAffiliation.\n    Test File: orgrole-example-services.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"orgrole-example-services.json\"\n    inst = organizationaffiliation.OrganizationAffiliation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"OrganizationAffiliation\" == inst.get_resource_type()\n\n    impl_organizationaffiliation_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"OrganizationAffiliation\" == data[\"resourceType\"]\n\n    inst2 = organizationaffiliation.OrganizationAffiliation(**data)\n    impl_organizationaffiliation_3(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_packagedproductdefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PackagedProductDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import packagedproductdefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_packagedproductdefinition_1(inst):\n    assert (\n        inst.description == \"ALU-PVC/PVDC BLISTERS. CARTONS OF 10 FILM-COATED TABLETS.\"\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/pcid\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"{PCID}\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.packaging.manufacturer[0].reference == \"Organization/example\"\n    assert inst.packaging.material[0].coding[0].code == \"Paperboard\"\n    assert (\n        inst.packaging.material[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/packageItemContainerMaterial\"}\n        ).valueUri\n    )\n    assert float(inst.packaging.packaging[0].containedItem[0].amount.value) == float(10)\n    assert (\n        inst.packaging.packaging[0].containedItem[0].item.reference.reference\n        == \"ManufacturedItemDefinition/tablet\"\n    )\n    assert (\n        inst.packaging.packaging[0].manufacturer[0].reference == \"Organization/example\"\n    )\n    assert inst.packaging.packaging[0].material[0].coding[0].code == \"PVC\"\n    assert (\n        inst.packaging.packaging[0].material[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/packageItemContainerMaterial\"}\n        ).valueUri\n    )\n    assert inst.packaging.packaging[0].material[1].coding[0].code == \"PVDC\"\n    assert (\n        inst.packaging.packaging[0].material[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/packageItemContainerMaterial\"}\n        ).valueUri\n    )\n    assert inst.packaging.packaging[0].material[2].coding[0].code == \"alu\"\n    assert (\n        inst.packaging.packaging[0].material[2].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/packageItemContainerMaterial\"}\n        ).valueUri\n    )\n    assert inst.packaging.packaging[0].property[0].type.coding[0].code == \"height\"\n    assert inst.packaging.packaging[0].property[0].valueQuantity.code == \"mm\"\n    assert (\n        inst.packaging.packaging[0].property[0].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.packaging.packaging[0].property[0].valueQuantity.unit == \"mm\"\n    assert float(inst.packaging.packaging[0].property[0].valueQuantity.value) == float(\n        45\n    )\n    assert inst.packaging.packaging[0].property[1].type.coding[0].code == \"width\"\n    assert inst.packaging.packaging[0].property[1].valueQuantity.code == \"mm\"\n    assert (\n        inst.packaging.packaging[0].property[1].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.packaging.packaging[0].property[1].valueQuantity.unit == \"mm\"\n    assert float(inst.packaging.packaging[0].property[1].valueQuantity.value) == float(\n        35\n    )\n    assert inst.packaging.packaging[0].quantity == 1\n    assert inst.packaging.packaging[0].shelfLifeStorage[0].periodDuration.code == \"a\"\n    assert (\n        inst.packaging.packaging[0].shelfLifeStorage[0].periodDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.packaging.packaging[0].shelfLifeStorage[0].periodDuration.unit == \"year\"\n    assert float(\n        inst.packaging.packaging[0].shelfLifeStorage[0].periodDuration.value\n    ) == float(3)\n    assert (\n        inst.packaging.packaging[0]\n        .shelfLifeStorage[0]\n        .specialPrecautionsForStorage[0]\n        .coding[0]\n        .code\n        == \"none\"\n    )\n    assert (\n        inst.packaging.packaging[0]\n        .shelfLifeStorage[0]\n        .specialPrecautionsForStorage[0]\n        .coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/specialprecautionsforstorage\"}\n        ).valueUri\n    )\n    assert (\n        inst.packaging.packaging[0].shelfLifeStorage[0].type.coding[0].code\n        == \"ShelfLifeofPackagedMedicinalProduct\"\n    )\n    assert (\n        inst.packaging.packaging[0].shelfLifeStorage[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/shelfLifeTypePlaceHolder\"}\n        ).valueUri\n    )\n    assert inst.packaging.packaging[0].type.coding[0].code == \"Blister\"\n    assert (\n        inst.packaging.packaging[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/packageitemcontainertype\"}\n        ).valueUri\n    )\n    assert inst.packaging.property[0].type.coding[0].code == \"height\"\n    assert inst.packaging.property[0].valueQuantity.code == \"mm\"\n    assert (\n        inst.packaging.property[0].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.packaging.property[0].valueQuantity.unit == \"mm\"\n    assert float(inst.packaging.property[0].valueQuantity.value) == float(50)\n    assert inst.packaging.property[1].type.coding[0].code == \"width\"\n    assert inst.packaging.property[1].valueQuantity.code == \"mm\"\n    assert (\n        inst.packaging.property[1].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.packaging.property[1].valueQuantity.unit == \"mm\"\n    assert float(inst.packaging.property[1].valueQuantity.value) == float(45)\n    assert inst.packaging.property[2].type.coding[0].code == \"depth\"\n    assert inst.packaging.property[2].valueQuantity.code == \"mm\"\n    assert (\n        inst.packaging.property[2].valueQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.packaging.property[2].valueQuantity.unit == \"mm\"\n    assert float(inst.packaging.property[2].valueQuantity.value) == float(23.5)\n    assert inst.packaging.quantity == 1\n    assert inst.packaging.type.coding[0].code == \"Carton\"\n    assert (\n        inst.packaging.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/packageitemcontainertype\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_packagedproductdefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for PackagedProductDefinition.\n    Test File: packagedproductdefinition-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"packagedproductdefinition-example.json\"\n    )\n    inst = packagedproductdefinition.PackagedProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"PackagedProductDefinition\" == inst.get_resource_type()\n\n    impl_packagedproductdefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PackagedProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = packagedproductdefinition.PackagedProductDefinition(**data)\n    impl_packagedproductdefinition_1(inst2)\n\n\ndef impl_packagedproductdefinition_2(inst):\n    assert inst.contained[0].id == \"syringeDevice\"\n    assert inst.contained[1].id == \"liquidItem\"\n    assert inst.id == \"package-with-liquid-and-syringe\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.packageFor[0].reference\n        == \"MedicinalProductDefinition/ProductThatHasThisPackType\"\n    )\n    assert inst.packaging.containedItem[0].amount.code == \"mL\"\n    assert (\n        inst.packaging.containedItem[0].amount.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.packaging.containedItem[0].amount.unit == \"ml\"\n    assert float(inst.packaging.containedItem[0].amount.value) == float(20)\n    assert inst.packaging.containedItem[0].item.reference.reference == \"#liquidItem\"\n    assert inst.packaging.containedItem[1].item.reference.reference == \"#syringeDevice\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_packagedproductdefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for PackagedProductDefinition.\n    Test File: packagedproductdefinition-example-co-packaged-liquid-and-syringe.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"packagedproductdefinition-example-co-packaged-liquid-and-syringe.json\"\n    )\n    inst = packagedproductdefinition.PackagedProductDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"PackagedProductDefinition\" == inst.get_resource_type()\n\n    impl_packagedproductdefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PackagedProductDefinition\" == data[\"resourceType\"]\n\n    inst2 = packagedproductdefinition.PackagedProductDefinition(**data)\n    impl_packagedproductdefinition_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_parameters.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Parameters\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import parameters\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_parameters_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.parameter[0].name == \"exact\"\n    assert inst.parameter[0].valueBoolean is True\n    assert inst.parameter[1].name == \"property\"\n    assert inst.parameter[1].part[0].name == \"code\"\n    assert inst.parameter[1].part[0].valueCode == \"focus\"\n    assert inst.parameter[1].part[1].name == \"value\"\n    assert inst.parameter[1].part[1].valueCode == \"top\"\n    assert inst.parameter[2].name == \"patient\"\n    assert inst.parameter[2].resource.id == \"example\"\n\n\ndef test_parameters_1(base_settings):\n    \"\"\"No. 1 tests collection for Parameters.\n    Test File: parameters-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"parameters-example.json\"\n    inst = parameters.Parameters.model_validate_json(filename.read_bytes())\n    assert \"Parameters\" == inst.get_resource_type()\n\n    impl_parameters_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Parameters\" == data[\"resourceType\"]\n\n    inst2 = parameters.Parameters(**data)\n    impl_parameters_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_patient.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Patient\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import patient\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_patient_1(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Metropolis\"\n    assert inst.address[0].country == \"USA\"\n    assert inst.address[0].line[0] == \"100 Main St\"\n    assert inst.address[0].postalCode == \"44130\"\n    assert inst.address[0].state == \"Il\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1956-05-27\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"xds\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.3.4.5\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"89765a87b\"\n    assert inst.managingOrganization.reference == \"Organization/2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Doe\"\n    assert inst.name[0].given[0] == \"John\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_1(base_settings):\n    \"\"\"No. 1 tests collection for Patient.\n    Test File: patient-example-xds.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-xds.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_1(inst2)\n\n\ndef impl_patient_2(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Amsterdam\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Van Egmondkade 23\"\n    assert inst.address[0].postalCode == \"1024 RJ\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1944-11-17\"}).valueDate\n    )\n    assert inst.communication[0].language.coding[0].code == \"nl\"\n    assert inst.communication[0].language.coding[0].display == \"Dutch\"\n    assert (\n        inst.communication[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.communication[0].language.text == \"Nederlands\"\n    assert inst.communication[0].preferred is True\n    assert inst.contact[0].name.family == \"Abels\"\n    assert inst.contact[0].name.given[0] == \"Sarah\"\n    assert inst.contact[0].name.use == \"usual\"\n    assert inst.contact[0].relationship[0].coding[0].code == \"C\"\n    assert (\n        inst.contact[0].relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0131\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"mobile\"\n    assert inst.contact[0].telecom[0].value == \"0690383372\"\n    assert inst.deceasedBoolean is False\n    assert inst.gender == \"male\"\n    assert inst.id == \"f001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"738472983\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"usual\"\n    assert inst.managingOrganization.display == \"Burgers University Medical Centre\"\n    assert inst.managingOrganization.reference == \"Organization/f001\"\n    assert inst.maritalStatus.coding[0].code == \"M\"\n    assert inst.maritalStatus.coding[0].display == \"Married\"\n    assert (\n        inst.maritalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-MaritalStatus\"}\n        ).valueUri\n    )\n    assert inst.maritalStatus.text == \"Getrouwd\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.multipleBirthBoolean is True\n    assert inst.name[0].family == \"van de Heuvel\"\n    assert inst.name[0].given[0] == \"Pieter\"\n    assert inst.name[0].suffix[0] == \"MSc\"\n    assert inst.name[0].use == \"usual\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"mobile\"\n    assert inst.telecom[0].value == \"0648352638\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"home\"\n    assert inst.telecom[1].value == \"p.heuvel@gmail.com\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_2(base_settings):\n    \"\"\"No. 2 tests collection for Patient.\n    Test File: patient-example-f001-pieter.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-f001-pieter.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_2(inst2)\n\n\ndef impl_patient_3(inst):\n    assert inst.active is True\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1982-08-02\"}).valueDate\n    )\n    assert inst.deceasedBoolean is True\n    assert inst.gender == \"female\"\n    assert inst.id == \"pat4\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:0.1.2.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"123458\"\n    assert inst.managingOrganization.display == \"ACME Healthcare, Inc\"\n    assert inst.managingOrganization.reference == \"Organization/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Notsowell\"\n    assert inst.name[0].given[0] == \"Sandy\"\n    assert inst.name[0].use == \"official\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_3(base_settings):\n    \"\"\"No. 3 tests collection for Patient.\n    Test File: patient-example-d.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-d.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_3(inst2)\n\n\ndef impl_patient_4(inst):\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2017-05-15\"}).valueDate\n    )\n    assert inst.contact[0].name.family == \"Organa\"\n    assert inst.contact[0].name.given[0] == \"Leia\"\n    assert inst.contact[0].name.use == \"maiden\"\n    assert inst.contact[0].relationship[0].coding[0].code == \"72705000\"\n    assert inst.contact[0].relationship[0].coding[0].display == \"Mother\"\n    assert (\n        inst.contact[0].relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contact[0].relationship[0].coding[1].code == \"N\"\n    assert (\n        inst.contact[0].relationship[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0131\"}\n        ).valueUri\n    )\n    assert inst.contact[0].relationship[0].coding[2].code == \"MTH\"\n    assert (\n        inst.contact[0].relationship[0].coding[2].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"mobile\"\n    assert inst.contact[0].telecom[0].value == \"+31201234567\"\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Organa\"\n    assert inst.gender == \"female\"\n    assert inst.id == \"infant-twin-1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://coruscanthealth.org/main-hospital/patient-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"MRN7465737865\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://new-republic.gov/galactic-citizen-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].value == \"7465737865\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.multipleBirthInteger == 1\n    assert inst.name[0].family == \"Solo\"\n    assert inst.name[0].given[0] == \"Jaina\"\n    assert inst.name[0].use == \"official\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_4(base_settings):\n    \"\"\"No. 4 tests collection for Patient.\n    Test File: patient-example-infant-twin-1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-infant-twin-1.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_4(inst2)\n\n\ndef impl_patient_5(inst):\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1995-10-12\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.generalPractitioner[0].display == \"Luigi Maas\"\n    assert inst.generalPractitioner[0].reference == \"Practitioner/f202\"\n    assert inst.id == \"infant-mom\"\n    assert inst.maritalStatus.coding[0].code == \"M\"\n    assert inst.maritalStatus.coding[0].display == \"Married\"\n    assert (\n        inst.maritalStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-MaritalStatus\"}\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Solo\"\n    assert inst.name[0].given[0] == \"Leia\"\n    assert inst.name[0].use == \"official\"\n    assert inst.name[1].family == \"Organa\"\n    assert inst.name[1].given[0] == \"Leia\"\n    assert inst.name[1].use == \"maiden\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_5(base_settings):\n    \"\"\"No. 5 tests collection for Patient.\n    Test File: patient-example-infant-mom.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-infant-mom.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_5(inst2)\n\n\ndef impl_patient_6(inst):\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2017-09-05\"}).valueDate\n    )\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Everywoman\"\n    assert inst.gender == \"male\"\n    assert inst.id == \"newborn\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.multipleBirthInteger == 2\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_6(base_settings):\n    \"\"\"No. 6 tests collection for Patient.\n    Test File: patient-example-newborn.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-newborn.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_6(inst2)\n\n\ndef impl_patient_7(inst):\n    assert inst.contact[0].name.family == \"Organa\"\n    assert inst.contact[0].name.given[0] == \"Leia\"\n    assert inst.contact[0].name.use == \"maiden\"\n    assert inst.contact[0].relationship[0].coding[0].code == \"72705000\"\n    assert inst.contact[0].relationship[0].coding[0].display == \"Mother\"\n    assert (\n        inst.contact[0].relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contact[0].relationship[0].coding[1].code == \"N\"\n    assert (\n        inst.contact[0].relationship[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0131\"}\n        ).valueUri\n    )\n    assert inst.contact[0].relationship[0].coding[2].code == \"MTH\"\n    assert (\n        inst.contact[0].relationship[0].coding[2].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"mobile\"\n    assert inst.contact[0].telecom[0].value == \"+31201234567\"\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueString == \"Organa\"\n    assert inst.gender == \"male\"\n    assert inst.id == \"infant-fetal\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://coruscanthealth.org/main-hospital/patient-identifier\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"MRN657865757378\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_7(base_settings):\n    \"\"\"No. 7 tests collection for Patient.\n    Test File: patient-example-infant-fetal.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-infant-fetal.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_7(inst2)\n\n\ndef impl_patient_8(inst):\n    assert inst.active is True\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2021-01-01\"}).valueDate\n    )\n    assert inst.gender == \"unknown\"\n    assert inst.id == \"denovoChild\"\n    assert inst.identifier[0].assigner.display == \"Child Hospital\"\n    assert (\n        inst.identifier[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/persons\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert inst.identifier[0].type.coding[0].display == \"Medical record number\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"11111\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Doe\"\n    assert inst.name[0].given[0] == \"Child\"\n    assert inst.name[0].given[1] == \"Junior\"\n    assert inst.name[0].use == \"official\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Child '\n        \"Junior Doe (OFFICIAL)</b> (no stated gender) 2021-01-01 ( \"\n        \"Medical record number: 11111 (TEMP))</p></div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_8(base_settings):\n    \"\"\"No. 8 tests collection for Patient.\n    Test File: Patient-denovoChild.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Patient-denovoChild.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_8(inst2)\n\n\ndef impl_patient_9(inst):\n    assert inst.active is True\n    assert inst.address[0].line[0] == \"2222 Home Street\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1973-05-31\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"genetics-example1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/us-ssn\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"SS\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"444222222\"\n    assert inst.managingOrganization.reference == \"Organization/hl7\"\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2012-05-29T23:45:32Z\"}\n        ).valueInstant\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Everywoman\"\n    assert inst.name[0].given[0] == \"Eve\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"555-555-2003\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_9(base_settings):\n    \"\"\"No. 9 tests collection for Patient.\n    Test File: patient-genetics-example1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-genetics-example1.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_9(inst2)\n\n\ndef impl_patient_10(inst):\n    assert inst.active is True\n    assert inst.gender == \"other\"\n    assert inst.id == \"pat2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:0.1.2.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"123456\"\n    assert inst.link[0].other.reference == \"Patient/pat1\"\n    assert inst.link[0].type == \"seealso\"\n    assert inst.managingOrganization.display == \"ACME Healthcare, Inc\"\n    assert inst.managingOrganization.reference == \"Organization/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Donald\"\n    assert inst.name[0].given[0] == \"Duck\"\n    assert inst.name[0].given[1] == \"D\"\n    assert inst.name[0].use == \"official\"\n    assert inst.photo[0].contentType == \"image/gif\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_patient_10(base_settings):\n    \"\"\"No. 10 tests collection for Patient.\n    Test File: patient-example-b.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"patient-example-b.json\"\n    inst = patient.Patient.model_validate_json(filename.read_bytes())\n    assert \"Patient\" == inst.get_resource_type()\n\n    impl_patient_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Patient\" == data[\"resourceType\"]\n\n    inst2 = patient.Patient(**data)\n    impl_patient_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_paymentnotice.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PaymentNotice\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import paymentnotice\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_paymentnotice_1(inst):\n    assert inst.amount.currency == \"USD\"\n    assert float(inst.amount.value) == float(12500.0)\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"77654\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://benefitsinc.com/paymentnotice\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"776543\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.payee.reference == \"Organization/1\"\n    assert inst.payment.reference == \"PaymentReconciliation/ER2500\"\n    assert (\n        inst.paymentDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-15\"}).valueDate\n    )\n    assert inst.paymentStatus.coding[0].code == \"paid\"\n    assert (\n        inst.paymentStatus.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/paymentstatus\"}\n        ).valueUri\n    )\n    assert (\n        inst.recipient.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://regulators.gov\"}\n        ).valueUri\n    )\n    assert inst.recipient.identifier.value == \"AB123\"\n    assert inst.reporter.reference == \"Organization/1\"\n    assert inst.request.reference == \"http://benefitsinc.com/fhir/claim/12345\"\n    assert (\n        inst.response.reference == \"http://benefitsinc.com/fhir/claimresponse/CR12345\"\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the PaymentNotice</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_paymentnotice_1(base_settings):\n    \"\"\"No. 1 tests collection for PaymentNotice.\n    Test File: paymentnotice-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"paymentnotice-example.json\"\n    inst = paymentnotice.PaymentNotice.model_validate_json(filename.read_bytes())\n    assert \"PaymentNotice\" == inst.get_resource_type()\n\n    impl_paymentnotice_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PaymentNotice\" == data[\"resourceType\"]\n\n    inst2 = paymentnotice.PaymentNotice(**data)\n    impl_paymentnotice_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_paymentreconciliation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PaymentReconciliation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import paymentreconciliation\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_paymentreconciliation_1(inst):\n    assert inst.allocation[0].amount.currency == \"USD\"\n    assert float(inst.allocation[0].amount.value) == float(3500.0)\n    assert (\n        inst.allocation[0].date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert (\n        inst.allocation[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/payment/2018/detail\"}\n        ).valueUri\n    )\n    assert inst.allocation[0].identifier.value == \"10-12345-001\"\n    assert inst.allocation[0].payee.reference == \"Organization/1\"\n    assert (\n        inst.allocation[0].response.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/claimresponse\"}\n        ).valueUri\n    )\n    assert inst.allocation[0].response.identifier.value == \"CR20140815-AB12345\"\n    assert inst.allocation[0].submitter.reference == \"Organization/1\"\n    assert (\n        inst.allocation[0].target.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalleyclinic.com/claim\"}\n        ).valueUri\n    )\n    assert inst.allocation[0].target.identifier.value == \"AB12345\"\n    assert inst.allocation[0].type.coding[0].code == \"payment\"\n    assert (\n        inst.allocation[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payment-type\"}\n        ).valueUri\n    )\n    assert inst.allocation[1].amount.currency == \"USD\"\n    assert float(inst.allocation[1].amount.value) == float(4000.0)\n    assert (\n        inst.allocation[1].date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-12\"}).valueDate\n    )\n    assert (\n        inst.allocation[1].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/payment/2018/detail\"}\n        ).valueUri\n    )\n    assert inst.allocation[1].identifier.value == \"10-12345-002\"\n    assert (\n        inst.allocation[1].target.reference\n        == \"http://www.BenefitsInc.com/fhir/oralhealthclaim/225476332699\"\n    )\n    assert inst.allocation[1].type.coding[0].code == \"payment\"\n    assert (\n        inst.allocation[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payment-type\"}\n        ).valueUri\n    )\n    assert inst.allocation[2].amount.currency == \"USD\"\n    assert float(inst.allocation[2].amount.value) == float(-1500.0)\n    assert (\n        inst.allocation[2].date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-16\"}).valueDate\n    )\n    assert (\n        inst.allocation[2].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/payment/2018/detail\"}\n        ).valueUri\n    )\n    assert inst.allocation[2].identifier.value == \"10-12345-003\"\n    assert inst.allocation[2].type.coding[0].code == \"advance\"\n    assert (\n        inst.allocation[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payment-type\"}\n        ).valueUri\n    )\n    assert inst.amount.currency == \"USD\"\n    assert float(inst.amount.value) == float(7000.0)\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2014-08-01\"}).valueDate\n    )\n    assert inst.disposition == \"2014 August mid-month settlement.\"\n    assert inst.formCode.coding[0].code == \"PAYREC/2016/01B\"\n    assert (\n        inst.formCode.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ncforms.org/formid\"}\n        ).valueUri\n    )\n    assert inst.id == \"ER2500\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/fhir/enrollmentresponse\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"781234\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.outcome == \"complete\"\n    assert (\n        inst.paymentIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.BenefitsInc.com/payment/2018\"}\n        ).valueUri\n    )\n    assert inst.paymentIdentifier.value == \"10-12345\"\n    assert inst.paymentIssuer.reference == \"Organization/2\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.processNote[0].text == (\n        \"Due to the year end holiday the cutoff for submissions for \"\n        \"December will be the 28th.\"\n    )\n    assert inst.processNote[0].type == \"display\"\n    assert (\n        inst.request.reference\n        == \"http://www.BenefitsInc.com/fhir/eligibility/225476332402\"\n    )\n    assert inst.requestor.reference == \"Organization/1\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">A human-readable'\n        \" rendering of the PaymentReconciliation</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"payment\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/payment-type\"}\n        ).valueUri\n    )\n\n\ndef test_paymentreconciliation_1(base_settings):\n    \"\"\"No. 1 tests collection for PaymentReconciliation.\n    Test File: paymentreconciliation-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"paymentreconciliation-example.json\"\n    inst = paymentreconciliation.PaymentReconciliation.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"PaymentReconciliation\" == inst.get_resource_type()\n\n    impl_paymentreconciliation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PaymentReconciliation\" == data[\"resourceType\"]\n\n    inst2 = paymentreconciliation.PaymentReconciliation(**data)\n    impl_paymentreconciliation_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_permission.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Permission\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import permission\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_permission_1(inst):\n    assert inst.combining == \"deny-overrides\"\n    assert (\n        inst.date[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-08-04\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-vhdir\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.rule[0].activity[0].action[0].coding[0].code == \"access\"\n    assert (\n        inst.rule[0].activity[0].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.rule[0].activity[0].actor[0].reference == \"CareTeam/example\"\n    assert inst.rule[0].activity[0].purpose[0].coding[0].code == \"HOPERAT\"\n    assert (\n        inst.rule[0].activity[0].purpose[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.rule[0].data[0].security[0].code == \"WSHELTER\"\n    assert (\n        inst.rule[0].data[0].security[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://example.org\"}\n        ).valueUri\n    )\n    assert inst.rule[0].type == \"permit\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_permission_1(base_settings):\n    \"\"\"No. 1 tests collection for Permission.\n    Test File: permission-example-vhdir.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"permission-example-vhdir.json\"\n    inst = permission.Permission.model_validate_json(filename.read_bytes())\n    assert \"Permission\" == inst.get_resource_type()\n\n    impl_permission_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Permission\" == data[\"resourceType\"]\n\n    inst2 = permission.Permission(**data)\n    impl_permission_1(inst2)\n\n\ndef impl_permission_2(inst):\n    assert inst.combining == \"deny-overrides\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_permission_2(base_settings):\n    \"\"\"No. 2 tests collection for Permission.\n    Test File: permission-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"permission-example.json\"\n    inst = permission.Permission.model_validate_json(filename.read_bytes())\n    assert \"Permission\" == inst.get_resource_type()\n\n    impl_permission_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Permission\" == data[\"resourceType\"]\n\n    inst2 = permission.Permission(**data)\n    impl_permission_2(inst2)\n\n\ndef impl_permission_3(inst):\n    assert inst.asserter.reference == \"Organization/f203\"\n    assert inst.combining == \"deny-overrides\"\n    assert (\n        inst.date[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-12-24\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-saner\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.rule[0].activity[0].action[0].coding[0].code == \"access\"\n    assert (\n        inst.rule[0].activity[0].action[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/consentaction\"}\n        ).valueUri\n    )\n    assert inst.rule[0].activity[0].actor[0].reference == \"Organization/f203\"\n    assert inst.rule[0].activity[0].purpose[0].coding[0].code == \"HCOMPL\"\n    assert (\n        inst.rule[0].activity[0].purpose[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.rule[0].data[0].expression.expression == (\n        \"http://hl7.org/fhir/uv/saner/Measure/CDCHealthcareSupplyPath\" \"way\"\n    )\n    assert inst.rule[0].data[0].expression.language == \"text/fhirpath\"\n    assert inst.rule[0].limit[0].coding[0].code == \"AUDIT\"\n    assert (\n        inst.rule[0].limit[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActCode\"}\n        ).valueUri\n    )\n    assert inst.rule[0].type == \"permit\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_permission_3(base_settings):\n    \"\"\"No. 3 tests collection for Permission.\n    Test File: permission-example-saner.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"permission-example-saner.json\"\n    inst = permission.Permission.model_validate_json(filename.read_bytes())\n    assert \"Permission\" == inst.get_resource_type()\n\n    impl_permission_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Permission\" == data[\"resourceType\"]\n\n    inst2 = permission.Permission(**data)\n    impl_permission_3(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_person.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Person\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import person\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_person_1(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Sandusky\"\n    assert inst.address[0].country == \"USA\"\n    assert inst.address[0].line[0] == \"2086 College St\"\n    assert inst.address[0].postalCode == \"44870\"\n    assert inst.address[0].state == \"OH\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1974-03-07\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"pp\"\n    assert inst.identifier[0].assigner.display == \"Ohio Bureau of Motor Vehicles\"\n    assert (\n        inst.identifier[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2041-09-23\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.4.3.39\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"DL\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"Ohio driver license\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"TL545786\"\n    assert inst.link[0].assurance == \"level3\"\n    assert inst.link[0].target.display == \"Eve Everywoman\"\n    assert inst.link[0].target.reference == \"http://www.goodhealth.com/Patient/98574\"\n    assert inst.link[1].assurance == \"level2\"\n    assert inst.link[1].target.display == \"Eve Marie Everywoman\"\n    assert inst.link[1].target.reference == \"http://www.acme-medical.com/Patient/ab34d\"\n    assert inst.managingOrganization.display == \"Goodhealth Patient Portal\"\n    assert (\n        inst.managingOrganization.reference\n        == \"http://www.goodhealth.com/Organization/12\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Everywoman\"\n    assert inst.name[0].given[0] == \"Eve\"\n    assert inst.name[0].given[1] == \"Marie\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"home\"\n    assert inst.telecom[0].value == \"(621)-479-9743\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_person_1(base_settings):\n    \"\"\"No. 1 tests collection for Person.\n    Test File: person-patient-portal.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-patient-portal.json\"\n    inst = person.Person.model_validate_json(filename.read_bytes())\n    assert \"Person\" == inst.get_resource_type()\n\n    impl_person_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Person\" == data[\"resourceType\"]\n\n    inst2 = person.Person(**data)\n    impl_person_1(inst2)\n\n\ndef impl_person_2(inst):\n    assert inst.active is True\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1963\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"f002\"\n    assert inst.link[0].target.display == \"Ariadne Bor-Jansma\"\n    assert inst.link[0].target.reference == \"RelatedPerson/f002\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].text == \"Ariadne Bor-Jansma\"\n    assert inst.name[0].use == \"usual\"\n    assert inst.photo[0].contentType == \"image/jpeg\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"home\"\n    assert inst.telecom[0].value == \"+31201234567\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_person_2(base_settings):\n    \"\"\"No. 2 tests collection for Person.\n    Test File: person-example-f002-ariadne.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-example-f002-ariadne.json\"\n    inst = person.Person.model_validate_json(filename.read_bytes())\n    assert \"Person\" == inst.get_resource_type()\n\n    impl_person_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Person\" == data[\"resourceType\"]\n\n    inst2 = person.Person(**data)\n    impl_person_2(inst2)\n\n\ndef impl_person_3(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Northfield\"\n    assert inst.address[0].line[0] == \"1003 Healthcare Drive\"\n    assert inst.address[0].state == \"MN\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1959-04-22\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"pd\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/us-ssn\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"SS\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"444444444\"\n    assert inst.link[0].assurance == \"level2\"\n    assert inst.link[0].target.display == \"Dr. Harold Hippocrates\"\n    assert (\n        inst.link[0].target.reference == \"http://www.goodhealth.com/Practitioner/98574\"\n    )\n    assert inst.link[1].assurance == \"level2\"\n    assert inst.link[1].target.display == \"Harold Hippocrates, MD\"\n    assert (\n        inst.link[1].target.reference\n        == \"http://www.acme-medical.com/Practitioner/ab34d\"\n    )\n    assert (\n        inst.managingOrganization.display == \"Northfield Regional Physician Directory\"\n    )\n    assert (\n        inst.managingOrganization.reference\n        == \"http://www.northfield-regional.com/Organization/2\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Hippocrates\"\n    assert inst.name[0].given[0] == \"Harold\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"555-555-1003\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_person_3(base_settings):\n    \"\"\"No. 3 tests collection for Person.\n    Test File: person-provider-directory.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-provider-directory.json\"\n    inst = person.Person.model_validate_json(filename.read_bytes())\n    assert \"Person\" == inst.get_resource_type()\n\n    impl_person_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Person\" == data[\"resourceType\"]\n\n    inst2 = person.Person(**data)\n    impl_person_3(inst2)\n\n\ndef impl_person_4(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"PleasantVille\"\n    assert inst.address[0].line[0] == \"534 Erewhon St\"\n    assert inst.address[0].postalCode == \"3999\"\n    assert inst.address[0].state == \"Vic\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1974-12-25\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"example\"\n    assert inst.identifier[0].assigner.display == \"Acme Healthcare\"\n    assert (\n        inst.identifier[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2001-05-06\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.36.146.595.217.0.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.link[0].target.display == \"Peter Chalmers\"\n    assert inst.link[0].target.reference == \"RelatedPerson/peter\"\n    assert inst.link[1].target.display == \"Peter Chalmers\"\n    assert inst.link[1].target.reference == \"Patient/example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Chalmers\"\n    assert inst.name[0].given[0] == \"Peter\"\n    assert inst.name[0].given[1] == \"James\"\n    assert inst.name[0].use == \"official\"\n    assert inst.name[1].given[0] == \"Jim\"\n    assert inst.name[1].use == \"usual\"\n    assert inst.telecom[0].use == \"home\"\n    assert inst.telecom[1].system == \"phone\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"(03) 5555 6473\"\n    assert inst.telecom[2].system == \"email\"\n    assert inst.telecom[2].use == \"home\"\n    assert inst.telecom[2].value == \"Jim@example.org\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_person_4(base_settings):\n    \"\"\"No. 4 tests collection for Person.\n    Test File: person-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-example.json\"\n    inst = person.Person.model_validate_json(filename.read_bytes())\n    assert \"Person\" == inst.get_resource_type()\n\n    impl_person_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Person\" == data[\"resourceType\"]\n\n    inst2 = person.Person(**data)\n    impl_person_4(inst2)\n\n\ndef impl_person_5(inst):\n    assert inst.active is True\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1982-08-02\"}).valueDate\n    )\n    assert (\n        inst.deceasedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-12-12\"}\n        ).valueDateTime\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"per4\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:0.1.2.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"123458\"\n    assert inst.link[0].target.reference == \"Patient/pat4\"\n    assert inst.link[1].target.reference == \"Practitioner/prac4\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Notsowell\"\n    assert inst.name[0].given[0] == \"Sandy\"\n    assert inst.name[0].use == \"official\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_person_5(base_settings):\n    \"\"\"No. 5 tests collection for Person.\n    Test File: person-example-per4.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-example-per4.json\"\n    inst = person.Person.model_validate_json(filename.read_bytes())\n    assert \"Person\" == inst.get_resource_type()\n\n    impl_person_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Person\" == data[\"resourceType\"]\n\n    inst2 = person.Person(**data)\n    impl_person_5(inst2)\n\n\ndef impl_person_6(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"PleasantVille\"\n    assert inst.address[0].line[0] == \"534 Erewhon St\"\n    assert inst.address[0].postalCode == \"3999\"\n    assert inst.address[0].state == \"Vic\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1974-12-25\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"grahame\"\n    assert inst.identifier[0].assigner.display == \"Acme Healthcare\"\n    assert (\n        inst.identifier[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2001-05-06\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.36.146.595.217.0.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.managingOrganization.reference == \"Organization/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Chalmers\"\n    assert inst.name[0].given[0] == \"Peter\"\n    assert inst.name[0].given[1] == \"James\"\n    assert inst.name[0].use == \"official\"\n    assert inst.name[1].given[0] == \"Jim\"\n    assert inst.name[1].use == \"usual\"\n    assert inst.telecom[0].use == \"home\"\n    assert inst.telecom[1].system == \"phone\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"(03) 5555 6473\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_person_6(base_settings):\n    \"\"\"No. 6 tests collection for Person.\n    Test File: person-grahame.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-grahame.json\"\n    inst = person.Person.model_validate_json(filename.read_bytes())\n    assert \"Person\" == inst.get_resource_type()\n\n    impl_person_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Person\" == data[\"resourceType\"]\n\n    inst2 = person.Person(**data)\n    impl_person_6(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_plandefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PlanDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import plandefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_plandefinition_1(inst):\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[0].definitionCanonical\n        == \"#1111\"\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[0]\n        .url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"day\"}).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[0]\n        .valueInteger\n        == 1\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[1]\n        .url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"day\"}).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[1]\n        .valueInteger\n        == 8\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle\"}\n        ).valueUri\n    )\n    assert inst.action[0].action[0].action[0].action[0].action[0].id == \"action-1\"\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[0].textEquivalent\n        == \"Gemcitabine 1250 mg/m² IV over 30 minutes on days 1 and 8\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].definitionCanonical\n        == \"#2222\"\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[1]\n        .extension[0]\n        .extension[0]\n        .url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"day\"}).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[1]\n        .extension[0]\n        .extension[0]\n        .valueInteger\n        == 1\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle\"}\n        ).valueUri\n    )\n    assert inst.action[0].action[0].action[0].action[0].action[1].id == \"action-2\"\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[1]\n        .relatedAction[0]\n        .relationship\n        == \"concurrent-with-start\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].relatedAction[0].targetId\n        == \"action-1\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].textEquivalent\n        == \"CARBOplatin AUC 5 IV over 30 minutes on Day 1\"\n    )\n    assert inst.action[0].action[0].action[0].action[0].id == \"cycle-definition-1\"\n    assert (\n        inst.action[0].action[0].action[0].action[0].textEquivalent\n        == \"21-day cycle for 6 cycles\"\n    )\n    assert inst.action[0].action[0].action[0].action[0].timingTiming.repeat.count == 6\n    assert float(\n        inst.action[0].action[0].action[0].action[0].timingTiming.repeat.duration\n    ) == float(21)\n    assert (\n        inst.action[0].action[0].action[0].action[0].timingTiming.repeat.durationUnit\n        == \"d\"\n    )\n    assert inst.action[0].action[0].action[0].groupingBehavior == \"sentence-group\"\n    assert inst.action[0].action[0].action[0].selectionBehavior == \"exactly-one\"\n    assert inst.action[0].action[0].selectionBehavior == \"all\"\n    assert inst.action[0].selectionBehavior == \"exactly-one\"\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-07-27\"}).valueDate\n    )\n    assert inst.author[0].name == \"Lee Surprenant\"\n    assert inst.contained[0].id == \"1111\"\n    assert inst.contained[1].id == \"2222\"\n    assert inst.copyright == \"All rights reserved.\"\n    assert inst.description == \"Gemcitabine/CARBOplatin\"\n    assert inst.experimental is True\n    assert inst.id == \"KDN5\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/ordertemplates\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"KDN5\"\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-07-27\"}).valueDate\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"GemcitabineCARBOplatin\"\n    assert inst.publisher == \"National Comprehensive Cancer Network, Inc.\"\n    assert (\n        inst.relatedArtifact[0].display == \"NCCN Guidelines for Kidney Cancer. V.2.2016\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://www.example.org/professionals/physician_gls/PDF/kidney.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert (\n        inst.relatedArtifact[1].citation\n        == \"Oudard S, et al. J Urol. 2007;177(5):1698-702\"\n    )\n    assert (\n        inst.relatedArtifact[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://www.ncbi.nlm.nih.gov/pubmed/17437788\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].type == \"citation\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"additional\"\n    assert inst.title == \"Gemcitabine/CARBOplatin\"\n    assert inst.type.text == \"Chemotherapy Order Template\"\n    assert inst.useContext[0].code.code == \"treamentSetting-or-diseaseStatus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/indications\"}\n        ).valueUri\n    )\n    assert (\n        inst.useContext[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/usagecontext-group\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].extension[0].valueString == \"A\"\n    assert inst.useContext[0].valueCodeableConcept.text == \"Metastatic\"\n    assert inst.useContext[1].code.code == \"disease-or-histology\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/indications\"}\n        ).valueUri\n    )\n    assert (\n        inst.useContext[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/usagecontext-group\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].extension[0].valueString == \"A\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.text\n        == \"Collecting Duct/Medullary Subtypes\"\n    )\n    assert inst.useContext[2].code.code == \"focus\"\n    assert (\n        inst.useContext[2].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.useContext[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/usagecontext-group\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].extension[0].valueString == \"A\"\n    assert inst.useContext[2].valueCodeableConcept.text == \"Kidney Cancer\"\n    assert inst.useContext[3].code.code == \"treatmentSetting-or-diseaseStatus\"\n    assert (\n        inst.useContext[3].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/indications\"}\n        ).valueUri\n    )\n    assert (\n        inst.useContext[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/usagecontext-group\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].extension[0].valueString == \"B\"\n    assert inst.useContext[3].valueCodeableConcept.text == \"Relapsed\"\n    assert inst.useContext[4].code.code == \"disease-or-histology\"\n    assert (\n        inst.useContext[4].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/CodeSystem/indications\"}\n        ).valueUri\n    )\n    assert (\n        inst.useContext[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/usagecontext-group\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].extension[0].valueString == \"B\"\n    assert (\n        inst.useContext[4].valueCodeableConcept.text\n        == \"Collecting Duct/Medullary Subtypes\"\n    )\n    assert inst.useContext[5].code.code == \"focus\"\n    assert (\n        inst.useContext[5].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.useContext[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/usagecontext-group\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].extension[0].valueString == \"B\"\n    assert inst.useContext[5].valueCodeableConcept.text == (\n        \"Kidney Cancer – Collecting Duct/Medullary Subtypes - \" \"Metastatic\"\n    )\n    assert inst.version == \"1\"\n\n\ndef test_plandefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for PlanDefinition.\n    Test File: plandefinition-example-kdn5-simplified.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"plandefinition-example-kdn5-simplified.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_1(inst2)\n\n\ndef impl_plandefinition_2(inst):\n    assert (\n        inst.action[0].action[0].definitionCanonical\n        == \"#activitydefinition-medicationrequest-1\"\n    )\n    assert inst.action[0].action[0].id == \"medication-action-1\"\n    assert inst.action[0].action[0].title == \"Administer Medication 1\"\n    assert (\n        inst.action[0].action[1].definitionCanonical\n        == \"#activitydefinition-medicationrequest-2\"\n    )\n    assert inst.action[0].action[1].id == \"medication-action-2\"\n    assert inst.action[0].action[1].relatedAction[0].offsetDuration.unit == \"h\"\n    assert float(\n        inst.action[0].action[1].relatedAction[0].offsetDuration.value\n    ) == float(1)\n    assert inst.action[0].action[1].relatedAction[0].relationship == \"after-end\"\n    assert inst.action[0].action[1].relatedAction[0].targetId == \"medication-action-1\"\n    assert inst.action[0].action[1].title == \"Administer Medication 2\"\n    assert inst.action[0].groupingBehavior == \"logical-group\"\n    assert inst.action[0].selectionBehavior == \"all\"\n    assert inst.contained[0].id == \"activitydefinition-medicationrequest-1\"\n    assert inst.contained[1].id == \"activitydefinition-medicationrequest-2\"\n    assert inst.description == \"This example illustrates relationships between actions.\"\n    assert inst.id == \"options-example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"ThisExampleIllustratesRelationshipsBetweenActions\"\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"This example illustrates relationships between actions.\"\n\n\ndef test_plandefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for PlanDefinition.\n    Test File: plandefinition-options-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"plandefinition-options-example.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_2(inst2)\n\n\ndef impl_plandefinition_3(inst):\n    assert (\n        inst.action[0].action[0].dynamicValue[0].expression.expression\n        == \"Communication Request to Provider\"\n    )\n    assert inst.action[0].action[0].dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.action[0].action[0].dynamicValue[0].path == \"/\"\n    assert inst.action[0].action[0].textEquivalent == (\n        \"A Breastfeeding Readiness Assessment is recommended, please \"\n        \"authorize or reject the order.\"\n    )\n    assert inst.action[0].action[0].title == \"Notify the provider to sign the order.\"\n    assert inst.action[0].action[0].type.coding[0].code == \"create\"\n    assert (\n        inst.action[0].condition[0].expression.expression\n        == \"Should Notify Provider to Sign Assessment Order\"\n    )\n    assert inst.action[0].condition[0].expression.language == \"text/cql\"\n    assert inst.action[0].condition[0].kind == \"applicability\"\n    assert inst.action[0].title == (\n        \"Mother should be administered a breastfeeding readiness \" \"assessment.\"\n    )\n    assert inst.action[0].trigger[0].name == \"Admission\"\n    assert inst.action[0].trigger[0].type == \"named-event\"\n    assert inst.action[0].trigger[1].name == \"Birth\"\n    assert inst.action[0].trigger[1].type == \"named-event\"\n    assert inst.action[0].trigger[2].name == \"Infant Transfer to Recovery\"\n    assert inst.action[0].trigger[2].type == \"named-event\"\n    assert inst.action[0].trigger[3].name == \"Transfer to Post-Partum\"\n    assert inst.action[0].trigger[3].type == \"named-event\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"exclusive-breastfeeding-intervention-02\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"exclusive-breastfeeding-intervention-02\"\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/library-exclusive-\" \"breastfeeding-cds-logic\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"ExclusiveBreastfeedingIntervention02\"\n    assert inst.relatedArtifact[0].resource == (\n        \"http://example.org/fhir/Measure/measure-exclusive-\" \"breastfeeding\"\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Exclusive Breastfeeding Intervention-02\"\n    assert inst.topic[0].text == \"Exclusive Breastfeeding\"\n    assert inst.version == \"1.0.0\"\n\n\ndef test_plandefinition_3(base_settings):\n    \"\"\"No. 3 tests collection for PlanDefinition.\n    Test File: plandefinition-exclusive-breastfeeding-intervention-02.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"plandefinition-exclusive-breastfeeding-intervention-02.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_3(inst2)\n\n\ndef impl_plandefinition_4(inst):\n    assert (\n        inst.action[0].action[0].dynamicValue[0].expression.expression\n        == \"Communication Request to Charge Nurse\"\n    )\n    assert inst.action[0].action[0].dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.action[0].action[0].dynamicValue[0].path == \"/\"\n    assert inst.action[0].action[0].textEquivalent == (\n        \"A Breastfeeding Readiness Assessment is recommended, please \"\n        \"administer the assessment.\"\n    )\n    assert (\n        inst.action[0].action[0].title\n        == \"Notify the charge nurse to perform the assessment.\"\n    )\n    assert inst.action[0].action[0].type.coding[0].code == \"create\"\n    assert (\n        inst.action[0].action[1].dynamicValue[0].expression.expression\n        == \"Communication Request to Bedside Nurse\"\n    )\n    assert inst.action[0].action[1].dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.action[0].action[1].dynamicValue[0].path == \"/\"\n    assert inst.action[0].action[1].textEquivalent == (\n        \"A Breastfeeding Readiness Assessment is recommended, please \"\n        \"administer the assessment.\"\n    )\n    assert (\n        inst.action[0].action[1].title\n        == \"Notify the bedside nurse to perform the assessment.\"\n    )\n    assert inst.action[0].action[1].type.coding[0].code == \"create\"\n    assert (\n        inst.action[0].condition[0].expression.expression\n        == \"Should Notify Nurse to Perform Assessment\"\n    )\n    assert inst.action[0].condition[0].expression.language == \"text/cql\"\n    assert inst.action[0].condition[0].kind == \"applicability\"\n    assert inst.action[0].title == (\n        \"Mother should be administered a breastfeeding readiness \" \"assessment.\"\n    )\n    assert inst.action[0].trigger[0].name == \"Admission\"\n    assert inst.action[0].trigger[0].type == \"named-event\"\n    assert inst.action[0].trigger[1].name == \"Birth\"\n    assert inst.action[0].trigger[1].type == \"named-event\"\n    assert inst.action[0].trigger[2].name == \"Infant Transfer to Recovery\"\n    assert inst.action[0].trigger[2].type == \"named-event\"\n    assert inst.action[0].trigger[3].name == \"Transfer to Post-Partum\"\n    assert inst.action[0].trigger[3].type == \"named-event\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"exclusive-breastfeeding-intervention-03\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"exclusive-breastfeeding-intervention-03\"\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/library-exclusive-\" \"breastfeeding-cds-logic\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"ExclusiveBreastfeedingIntervention03\"\n    assert inst.relatedArtifact[0].resource == (\n        \"http://example.org/fhir/Measure/measure-exclusive-\" \"breastfeeding\"\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Exclusive Breastfeeding Intervention-03\"\n    assert inst.topic[0].text == \"Exclusive Breastfeeding\"\n    assert inst.version == \"1.0.0\"\n\n\ndef test_plandefinition_4(base_settings):\n    \"\"\"No. 4 tests collection for PlanDefinition.\n    Test File: plandefinition-exclusive-breastfeeding-intervention-03.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"plandefinition-exclusive-breastfeeding-intervention-03.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_4(inst2)\n\n\ndef impl_plandefinition_5(inst):\n    assert (\n        inst.action[0].action[0].action[0].definitionCanonical\n        == \"#referralToCardiologyConsult\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[0].expression.expression\n        == \"Now()\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[0].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[0].path == \"timing.event\"\n    assert inst.action[0].action[0].action[0].dynamicValue[1].expression.expression == (\n        \"Code '261QM0850X' from CardiologyChestPainLogic.\\\"NUCC \"\n        \"Provider Taxonomy\\\" display 'Adult Mental Health'\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[1].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[1].path == \"specialty\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[2].expression.expression\n        == \"CardiologyChestPainLogic.ServiceRequestFulfillmentTime\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[2].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[2].path == \"occurrenceDateTime\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[3].expression.expression\n        == \"CardiologyChestPainLogic.Patient\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[3].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[3].path == \"subject\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[4].expression.expression\n        == \"CardiologyChestPainLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[4].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[4].path == \"requester.agent\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[5].expression.expression\n        == \"CardiologyChestPainLogic.CardiologyReferralReason\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[5].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[5].path == \"reasonCode\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[6].expression.expression\n        == \"CardiologyChestPainLogic.RiskAssessment\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[6].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[6].path == \"reasonReference\"\n    assert (\n        inst.action[0].action[0].action[0].textEquivalent\n        == \"Referral to cardiology to evaluate chest pain (routine)\"\n    )\n    assert (\n        inst.action[0].action[0].action[1].definitionCanonical\n        == \"#CollectReferralReason\"\n    )\n    assert (\n        inst.action[0].action[0].action[1].title == \"Reason for cardiology consultation\"\n    )\n    assert (\n        inst.action[0].action[0].action[2].definitionCanonical\n        == \"#CardiologyConsultationGoal\"\n    )\n    assert inst.action[0].action[0].action[2].title == \"Goal of cardiology consultation\"\n    assert inst.action[0].action[0].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[0].selectionBehavior == \"any\"\n    assert inst.action[0].action[0].title == \"Consults and Referrals\"\n    assert inst.action[0].action[1].action[0].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[1].action[0].selectionBehavior == \"at-most-one\"\n    assert (\n        inst.action[0].action[1].action[1].action[0].definitionCanonical\n        == \"#metoprololTartrate25Prescription\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[0]\n        .dynamicValue[0]\n        .expression.expression\n        == \"'draft'\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[0].dynamicValue[0].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[1].action[1].action[0].dynamicValue[0].path == \"status\"\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[0]\n        .dynamicValue[1]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Patient\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[0].dynamicValue[1].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[0].dynamicValue[1].path == \"patient\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[0]\n        .dynamicValue[2]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[0].dynamicValue[2].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[0].dynamicValue[2].path\n        == \"prescriber\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[0].textEquivalent\n        == \"metoprolol tartrate 25 mg tablet 1 tablet oral 2 time daily\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].definitionCanonical\n        == \"#metoprololTartrate50Prescription\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[1]\n        .dynamicValue[0]\n        .expression.expression\n        == \"'draft'\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].dynamicValue[0].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[1].action[1].action[1].dynamicValue[0].path == \"status\"\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[1]\n        .dynamicValue[1]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Patient\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].dynamicValue[1].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].dynamicValue[1].path == \"patient\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[1]\n        .dynamicValue[2]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].dynamicValue[2].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].dynamicValue[2].path\n        == \"prescriber\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[1].textEquivalent\n        == \"metoprolol tartrate 50 mg tablet 1 tablet oral 2 time daily\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].definitionCanonical\n        == \"#amlodipinePrescription\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[2]\n        .dynamicValue[0]\n        .expression.expression\n        == \"'draft'\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].dynamicValue[0].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[1].action[1].action[2].dynamicValue[0].path == \"status\"\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[2]\n        .dynamicValue[1]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Patient\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].dynamicValue[1].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].dynamicValue[1].path == \"patient\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[1]\n        .action[2]\n        .dynamicValue[2]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].dynamicValue[2].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].dynamicValue[2].path\n        == \"prescriber\"\n    )\n    assert (\n        inst.action[0].action[1].action[1].action[2].textEquivalent\n        == \"amlodipine 5  tablet 1 tablet oral  daily\"\n    )\n    assert inst.action[0].action[1].action[1].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[1].action[1].selectionBehavior == \"at-most-one\"\n    assert inst.action[0].action[1].action[1].title == \"Antianginal Therapy\"\n    assert (\n        inst.action[0].action[1].action[2].action[0].definitionCanonical\n        == \"#nitroglycerinPrescription\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[2]\n        .action[0]\n        .dynamicValue[0]\n        .expression.expression\n        == \"'draft'\"\n    )\n    assert (\n        inst.action[0].action[1].action[2].action[0].dynamicValue[0].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[1].action[2].action[0].dynamicValue[0].path == \"status\"\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[2]\n        .action[0]\n        .dynamicValue[1]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Patient\"\n    )\n    assert (\n        inst.action[0].action[1].action[2].action[0].dynamicValue[1].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[2].action[0].dynamicValue[1].path == \"patient\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[2]\n        .action[0]\n        .dynamicValue[2]\n        .expression.expression\n        == \"CardiologyChestPainLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0].action[1].action[2].action[0].dynamicValue[2].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[2].action[0].dynamicValue[2].path\n        == \"prescriber\"\n    )\n    assert inst.action[0].action[1].action[2].action[0].textEquivalent == (\n        \"nitroglycerin 0.4 mg tablet sub-lingual every 5 minutes as \"\n        \"needed for chest pain; maximum 3 tablets\"\n    )\n    assert inst.action[0].action[1].action[2].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[1].action[2].selectionBehavior == \"at-most-one\"\n    assert inst.action[0].action[1].action[2].title == \"Nitroglycerin\"\n    assert inst.action[0].action[1].description == (\n        \"Consider the following medications for stable patients to be\"\n        \" initiated prior to the cardiology consultation.\"\n    )\n    assert inst.action[0].action[1].title == \"Medications\"\n    assert inst.author[0].name == \"Bruce Bray MD\"\n    assert inst.author[1].name == \"Scott Wall MD\"\n    assert inst.author[2].name == \"Aiden Abidov MD, PhD\"\n    assert inst.contained[0].id == \"cardiology-chestPain-logic\"\n    assert inst.contained[1].id == \"referralToCardiologyConsult\"\n    assert inst.contained[2].id == \"metoprololTartrate25Prescription\"\n    assert inst.contained[3].id == \"metoprololTartrate25Medication\"\n    assert inst.contained[4].id == \"metoprololTartrate25Substance\"\n    assert inst.contained[5].id == \"metoprololTartrate50Prescription\"\n    assert inst.contained[6].id == \"metoprololTartrate50Medication\"\n    assert inst.contained[7].id == \"metoprololTartrate50Substance\"\n    assert inst.contained[8].id == \"nitroglycerinPrescription\"\n    assert inst.contained[9].id == \"nitroglycerinMedication\"\n    assert inst.copyright == (\n        \"© Copyright Cognitive Medical Systems, Inc. 9444 Waples \"\n        \"Street Suite 300 San Diego, CA 92121\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-08-29\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-cardiology-os\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.11.8\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:va.gov:kbs:knart:artifact:r1\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"bb7ccea6-9744-4743-854a-bcffd87191f6\"\n    assert (\n        inst.identifier[2].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"urn:va.gov:kbs:contract:VA118-16-D-1008:to:VA-118-16-F-1008-0007\"\n            }\n        ).valueUri\n    )\n    assert inst.identifier[2].value == \"CLIN0004AG\"\n    assert (\n        inst.identifier[3].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:cognitivemedicine.com:lab:jira\"}\n        ).valueUri\n    )\n    assert inst.identifier[3].value == \"KP-914\"\n    assert inst.library[0] == \"#cardiology-chestPain-logic\"\n    assert inst.name == \"ChestPainCoronaryArteryDiseaseOrderSetKNART\"\n    assert inst.publisher == \"Department of Veterans Affairs\"\n    assert inst.relatedArtifact[0].display == (\n        \"Cardiology: Chest Pain (CP) / Coronary Artery Disease (CAD) \"\n        \"Clinical Content White Paper\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"NEED-A-URL-HERE\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.relatedArtifact[1].display == (\n        \"Outcome CVD (coronary death, myocardial infarction, coronary\"\n        \" insufficiency, angina, ischemic stroke, hemorrhagic stroke,\"\n        \" transient ischemic attack, peripheral artery disease, heart\"\n        \" failure)\"\n    )\n    assert (\n        inst.relatedArtifact[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.framinghamheartstudy.org/risk-functions/cardiovascular-disease/10-year-risk.php\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].type == \"justification\"\n    assert inst.relatedArtifact[2].display == (\n        \"General cardiovascular risk profile for use in primary care:\"\n        \" the Framingham Heart Study\"\n    )\n    assert (\n        inst.relatedArtifact[2].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.framinghamheartstudy.org/risk-functions/cardiovascular-disease/10-year-risk.php\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[2].type == \"justification\"\n    assert (\n        inst.relatedArtifact[3].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"NEED-A-URL-HERE\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[3].type == \"justification\"\n    assert (\n        inst.relatedArtifact[4].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"NEED-A-URL-HERE\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[4].type == \"justification\"\n    assert (\n        inst.relatedArtifact[5].display\n        == \"LABEL: ASPIRIN 81 MG- aspirin tablet, coated\"\n    )\n    assert (\n        inst.relatedArtifact[5].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=b4064039-2345-4227-b83d-54dc13a838d3\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[5].type == \"justification\"\n    assert inst.relatedArtifact[6].display == (\n        \"LABEL: CLOPIDOGREL- clopidogrel bisulfate tablet, film \" \"coated\"\n    )\n    assert (\n        inst.relatedArtifact[6].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7fe85155-bc00-406b-b097-e8aece187a8a\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[6].type == \"justification\"\n    assert (\n        inst.relatedArtifact[7].display\n        == \"LABEL: LIPITOR- atorvastatin calcium tablet, film coated\"\n    )\n    assert (\n        inst.relatedArtifact[7].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=7fe85155-bc00-406b-b097-e8aece187a8a\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[7].type == \"justification\"\n    assert inst.relatedArtifact[8].display == (\n        \"LABEL: METOPROLOL SUCCINATE EXTENDED-RELEASE - metoprolol \"\n        \"succinate tablet, film coated, extended release\"\n    )\n    assert (\n        inst.relatedArtifact[8].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=2d948600-35d8-4490-983b-918bdce488c8\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[8].type == \"justification\"\n    assert (\n        inst.relatedArtifact[9].display == \"LABEL: NITROGLYCERIN- nitroglycerin tablet\"\n    )\n    assert (\n        inst.relatedArtifact[9].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=67bf2a15-b115-47ac-ae28-ce2dafd6b5c9\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[9].type == \"justification\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == (\n        \"Chest Pain (CP) - Coronary Artery Disease (CAD) Order Set \" \"KNART\"\n    )\n    assert inst.type.coding[0].code == \"order-set\"\n    assert inst.type.coding[0].display == \"Order Set\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/plan-definition-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://va.gov/kas/orderset/B5-Cardiology-ChestPainCAD-OS\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"look up value\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"appropriate snomed condition\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1\"\n\n\ndef test_plandefinition_5(base_settings):\n    \"\"\"No. 5 tests collection for PlanDefinition.\n    Test File: plandefinition-example-cardiology-os.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"plandefinition-example-cardiology-os.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_5(inst2)\n\n\ndef impl_plandefinition_6(inst):\n    assert inst.action[0].cardinalityBehavior == \"single\"\n    assert inst.action[0].condition[0].expression.expression == (\n        \"exists ([Condition: Obesity]) or not exists ([Observation: \"\n        \"BMI] O where O.effectiveDateTime 2 years or less before \"\n        \"Today())\"\n    )\n    assert inst.action[0].condition[0].expression.language == \"text/cql\"\n    assert inst.action[0].condition[0].kind == \"applicability\"\n    assert inst.action[0].definitionCanonical == \"#procedure\"\n    assert (\n        inst.action[0].description\n        == \"Measure, Weight, Height, Waist, Circumference; Calculate BMI\"\n    )\n    assert inst.action[0].goalId[0] == \"reduce-bmi-ratio\"\n    assert inst.action[0].requiredBehavior == \"must-unless-documented\"\n    assert inst.action[0].title == \"Measure BMI\"\n    assert inst.author[0].name == \"National Heart, Lung, and Blood Institute\"\n    assert inst.author[0].telecom[0].system == \"url\"\n    assert (\n        inst.author[0].telecom[0].value\n        == \"https://www.nhlbi.nih.gov/health-pro/guidelines\"\n    )\n    assert inst.contained[0].id == \"procedure\"\n    assert inst.description == \"Obesity Assessment Protocol\"\n    assert inst.goal[0].addresses[0].coding[0].code == \"414916001\"\n    assert inst.goal[0].addresses[0].coding[0].display == \"Obesity (disorder)\"\n    assert (\n        inst.goal[0].addresses[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.goal[0].category.text == \"Treatment\"\n    assert inst.goal[0].description.text == \"Reduce BMI to below 25\"\n    assert inst.goal[0].documentation[0].display == \"Evaluation and Treatment Strategy\"\n    assert (\n        inst.goal[0].documentation[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/42.htm\"\n            }\n        ).valueUrl\n    )\n    assert inst.goal[0].documentation[0].type == \"justification\"\n    assert inst.goal[0].id == \"reduce-bmi-ratio\"\n    assert inst.goal[0].priority.text == \"medium-priority\"\n    assert inst.goal[0].start.text == \"When the patient's BMI Ratio is at or above 25\"\n    assert inst.goal[0].target[0].detailRange.high.unit == \"kg/m2\"\n    assert float(inst.goal[0].target[0].detailRange.high.value) == float(24.9)\n    assert inst.goal[0].target[0].due.unit == \"a\"\n    assert float(inst.goal[0].target[0].due.value) == float(1)\n    assert inst.goal[0].target[0].measure.coding[0].code == \"39156-5\"\n    assert (\n        inst.goal[0].target[0].measure.coding[0].display\n        == \"Body mass index (BMI) [Ratio]\"\n    )\n    assert (\n        inst.goal[0].target[0].measure.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.id == \"protocol-example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"example-1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"ObesityAssessmentProtocol\"\n    assert inst.purpose == (\n        \"Example of A medical algorithm for assessment and treatment \"\n        \"of overweight and obesity\"\n    )\n    assert (\n        inst.relatedArtifact[0].display == \"Overweight and Obesity Treatment Guidelines\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/algorthm/algorthm.htm\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Obesity Assessment Protocol\"\n    assert inst.type.coding[0].code == \"clinical-protocol\"\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"414916001\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Obesity (disorder)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_plandefinition_6(base_settings):\n    \"\"\"No. 6 tests collection for PlanDefinition.\n    Test File: plandefinition-protocol-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"plandefinition-protocol-example.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_6(inst2)\n\n\ndef impl_plandefinition_7(inst):\n    assert (\n        inst.action[0].action[0].action[0].definitionCanonical\n        == \"#referralToMentalHealthCare\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[0].expression.expression\n        == \"Now()\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[0].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[0].path == \"timing.event\"\n    assert inst.action[0].action[0].action[0].dynamicValue[1].expression.expression == (\n        \"Code '261QM0850X' from SuicideRiskLogic.\\\"NUCC Provider \"\n        \"Taxonomy\\\" display 'Adult Mental Health'\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[1].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[1].path == \"specialty\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[2].expression.expression\n        == \"SuicideRiskLogic.ServiceRequestFulfillmentTime\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[2].expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[2].path == \"occurrenceDateTime\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[3].expression.expression\n        == \"SuicideRiskLogic.Patient\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[3].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[3].path == \"subject\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[4].expression.expression\n        == \"SuicideRiskLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[4].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[4].path == \"requester.agent\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[5].expression.expression\n        == \"SuicideRiskLogic.RiskAssessmentScore\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[5].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[5].path == \"reasonCode\"\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[6].expression.expression\n        == \"SuicideRiskLogic.RiskAssessment\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].dynamicValue[6].expression.language\n        == \"text/cql\"\n    )\n    assert inst.action[0].action[0].action[0].dynamicValue[6].path == \"reasonReference\"\n    assert inst.action[0].action[0].action[0].textEquivalent == (\n        \"Refer to outpatient mental health program for evaluation and\"\n        \" treatment of mental health conditions now\"\n    )\n    assert inst.action[0].action[0].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[0].selectionBehavior == \"any\"\n    assert inst.action[0].action[0].title == \"Consults and Referrals\"\n    assert (\n        inst.action[0].action[1].action[0].action[0].action[0].definitionCanonical\n        == \"#citalopramPrescription\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[0]\n        .expression.expression\n        == \"'draft'\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[0]\n        .expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[0].path\n        == \"status\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[1]\n        .expression.expression\n        == \"SuicideRiskLogic.Patient\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[1]\n        .expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[1].path\n        == \"patient\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[2]\n        .expression.expression\n        == \"SuicideRiskLogic.Practitioner\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[2]\n        .expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[2].path\n        == \"prescriber\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[3]\n        .expression.expression\n        == \"SuicideRiskLogic.RiskAssessmentScore\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[3]\n        .expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[3].path\n        == \"reasonCode\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[4]\n        .expression.expression\n        == \"SuicideRiskLogic.RiskAssessment\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .action[0]\n        .dynamicValue[4]\n        .expression.language\n        == \"text/cql\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[4].path\n        == \"reasonReference\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].action[0].textEquivalent == (\n        \"citalopram 20 mg tablet 1 tablet oral 1 time daily now (30 \"\n        \"table; 3 refills)\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].action[1].textEquivalent == (\n        \"escitalopram 10 mg tablet 1 tablet oral 1 time daily now (30\"\n        \" tablet; 3 refills)\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].action[2].textEquivalent == (\n        \"fluoxetine 20 mg capsule 1 capsule oral 1 time daily now (30\"\n        \" tablet; 3 refills)\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].action[3].textEquivalent == (\n        \"paroxetine 20 mg tablet 1 tablet oral 1 time daily now (30 \"\n        \"tablet; 3 refills)\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].action[4].textEquivalent == (\n        \"sertraline 50 mg tablet 1 tablet oral 1 time daily now (30 \"\n        \"tablet; 3 refills)\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .action[0]\n        .documentation[0]\n        .document.contentType\n        == \"text/html\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].documentation[\n        0\n    ].document.title == (\n        \"National Library of Medicine. DailyMed website. CITALOPRAM- \"\n        \"citalopram hydrobromide tablet, film coated.\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].documentation[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6daeb45c-451d-b135-bf8f-2d6dff4b6b01\"\n            }\n        ).valueUrl\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].documentation[0].type == \"citation\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].groupingBehavior == \"logical-group\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].action[0].selectionBehavior == \"at-most-one\"\n    )\n    assert inst.action[0].action[1].action[0].action[0].title == (\n        \"Selective Serotonin Reuptake Inhibitors (Choose a mazimum of\"\n        \" one or document reasons for exception)\"\n    )\n    assert inst.action[0].action[1].action[0].action[1].textEquivalent == (\n        \"Dopamine Norepinephrine Reuptake Inhibitors (Choose a \"\n        \"maximum of one or document reasons for exception)\"\n    )\n    assert inst.action[0].action[1].action[0].action[2].textEquivalent == (\n        \"Serotonin Norepinephrine Reuptake Inhibitors (Choose a \"\n        \"maximum of one or doument reasons for exception)\"\n    )\n    assert inst.action[0].action[1].action[0].action[3].textEquivalent == (\n        \"Norepinephrine-Serotonin Modulators (Choose a maximum of one\"\n        \" or document reasons for exception)\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].documentation[0].document.contentType\n        == \"text/html\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].documentation[0].document.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"high\"\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/evidence-quality\"}\n        ).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[1]\n        .action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.text\n        == \"High Quality\"\n    )\n    assert inst.action[0].action[1].action[0].documentation[0].document.title == (\n        \"Practice Guideline for the Treatment of Patients with Major \"\n        \"Depressive Disorder\"\n    )\n    assert (\n        inst.action[0].action[1].action[0].documentation[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.action[0].action[1].action[0].documentation[0].type == \"citation\"\n    assert inst.action[0].action[1].action[0].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[1].action[0].selectionBehavior == \"at-most-one\"\n    assert inst.action[0].action[1].action[0].title == \"First-Line Antidepressants\"\n    assert inst.action[0].action[1].groupingBehavior == \"logical-group\"\n    assert inst.action[0].action[1].selectionBehavior == \"at-most-one\"\n    assert inst.action[0].action[1].title == \"Medications\"\n    assert inst.action[0].title == \"Suicide Risk Assessment and Outpatient Management\"\n    assert (\n        inst.approvalDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-03-12\"}).valueDate\n    )\n    assert inst.author[0].name == \"Motive Medical Intelligence\"\n    assert inst.author[0].telecom[0].system == \"phone\"\n    assert inst.author[0].telecom[0].use == \"work\"\n    assert inst.author[0].telecom[0].value == \"415-362-4007\"\n    assert inst.author[0].telecom[1].system == \"email\"\n    assert inst.author[0].telecom[1].use == \"work\"\n    assert inst.author[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"415-362-4007\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"info@motivemi.com\"\n    assert inst.contained[0].id == \"referralToMentalHealthCare\"\n    assert inst.contained[1].id == \"citalopramPrescription\"\n    assert inst.contained[2].id == \"citalopramMedication\"\n    assert inst.contained[3].id == \"citalopramSubstance\"\n    assert inst.copyright == (\n        \"© Copyright 2016 Motive Medical Intelligence. All rights \" \"reserved.\"\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-15\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Orders to be applied to a patient characterized as low \" \"suicide risk.\"\n    )\n    assert (\n        inst.effectivePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.effectivePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.id == \"low-suicide-risk-order-set\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.11.7\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://motivemi.com/artifacts\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"mmi:low-suicide-risk-order-set\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.lastReviewDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2016-08-15\"}).valueDate\n    )\n    assert (\n        inst.library[0] == \"http://example.org/fhir/Library/suiciderisk-orderset-logic\"\n    )\n    assert inst.name == \"LowSuicideRiskOrderSet\"\n    assert inst.publisher == \"Motive Medical Intelligence\"\n    assert inst.purpose == (\n        \"This order set helps ensure consistent application of \"\n        \"appropriate orders for the care of low suicide risk \"\n        \"patients.\"\n    )\n    assert inst.relatedArtifact[0].display == (\n        \"Practice Guideline for the Treatment of Patients with Major \"\n        \"Depressive Disorder\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.relatedArtifact[1].resource == (\n        \"http://example.org/fhir/ActivityDefinition/referralPrimaryCa\" \"reMentalHealth\"\n    )\n    assert inst.relatedArtifact[1].type == \"composed-of\"\n    assert inst.relatedArtifact[2].resource == (\n        \"http://example.org/fhir/ActivityDefinition/citalopramPrescri\" \"ption\"\n    )\n    assert inst.relatedArtifact[2].type == \"composed-of\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Low Suicide Risk Order Set\"\n    assert inst.topic[0].text == \"Suicide risk assessment\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://motivemi.com/artifacts/PlanDefinition/low-suicide-risk-order-set\"\n            }\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"This order set should be applied after assessing a patient \"\n        \"for suicide risk, when the findings of that assessment \"\n        \"indicate the patient has low suicide risk.\"\n    )\n    assert inst.useContext[0].code.code == \"age\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"D000328\"\n    assert inst.useContext[0].valueCodeableConcept.coding[0].display == \"Adult\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://meshb.nlm.nih.gov\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"87512008\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Mild major depression\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].code.code == \"focus\"\n    assert (\n        inst.useContext[2].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[2].valueCodeableConcept.coding[0].code == \"40379007\"\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].display\n        == \"Major depression, recurrent, mild\"\n    )\n    assert (\n        inst.useContext[2].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].code.code == \"focus\"\n    assert (\n        inst.useContext[3].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[3].valueCodeableConcept.coding[0].code == \"394687007\"\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].display == \"Low suicide risk\"\n    )\n    assert (\n        inst.useContext[3].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].code.code == \"focus\"\n    assert (\n        inst.useContext[4].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[4].valueCodeableConcept.coding[0].code == \"225337009\"\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].display\n        == \"Suicide risk assessment\"\n    )\n    assert (\n        inst.useContext[4].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].code.code == \"user\"\n    assert (\n        inst.useContext[5].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[5].valueCodeableConcept.coding[0].code == \"309343006\"\n    assert inst.useContext[5].valueCodeableConcept.coding[0].display == \"Physician\"\n    assert (\n        inst.useContext[5].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].code.code == \"venue\"\n    assert (\n        inst.useContext[6].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[6].valueCodeableConcept.coding[0].code == \"440655000\"\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].display\n        == \"Outpatient environment\"\n    )\n    assert (\n        inst.useContext[6].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"1.0.0\"\n\n\ndef test_plandefinition_7(base_settings):\n    \"\"\"No. 7 tests collection for PlanDefinition.\n    Test File: plandefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"plandefinition-example.json\"\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_7(inst2)\n\n\ndef impl_plandefinition_8(inst):\n    assert inst.action[0].action[0].description == \"Will offer Naloxone instead\"\n    assert inst.action[0].action[1].description == (\n        \"Risk of overdose carefully considered and outweighed by \"\n        \"benefit; snooze 3 mo\"\n    )\n    assert inst.action[0].action[2].description == \"N/A - see comment; snooze 3 mo\"\n    assert inst.action[0].condition[0].expression.expression == \"Inclusion Criteria\"\n    assert inst.action[0].condition[0].expression.language == \"text/cql\"\n    assert inst.action[0].condition[0].kind == \"applicability\"\n    assert inst.action[0].description == (\n        \"Checking if the trigger prescription meets the inclusion \"\n        \"criteria for recommendation #8 workflow.\"\n    )\n    assert (\n        inst.action[0].documentation[0].document.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"strong\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Strong\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/recommendation-strength\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0].documentation[0].document.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[1]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"low\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[1]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Low quality\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[1]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/evidence-quality\"}\n        ).valueUri\n    )\n    assert inst.action[0].documentation[0].type == \"documentation\"\n    assert inst.action[0].dynamicValue[0].expression.expression == \"Get Detail\"\n    assert inst.action[0].dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.action[0].dynamicValue[0].path == \"action.description\"\n    assert inst.action[0].dynamicValue[1].expression.expression == \"Get Summary\"\n    assert inst.action[0].dynamicValue[1].expression.language == \"text/cql\"\n    assert inst.action[0].dynamicValue[1].path == \"action.title\"\n    assert inst.action[0].dynamicValue[2].expression.expression == \"Get Indicator\"\n    assert inst.action[0].dynamicValue[2].expression.language == \"text/cql\"\n    assert inst.action[0].dynamicValue[2].path == \"action.extension\"\n    assert inst.action[0].groupingBehavior == \"visual-group\"\n    assert inst.action[0].selectionBehavior == \"exactly-one\"\n    assert inst.action[0].title == (\n        \"Existing patient exhibits risk factors for opioid-related \" \"harms.\"\n    )\n    assert inst.action[0].trigger[0].name == \"medication-prescribe\"\n    assert inst.action[0].trigger[0].type == \"named-event\"\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-19\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"opioidcds-08\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.11.10\"\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"cdc-opioid-guidance\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.library[0] == \"http://example.org/fhir/Library/opioidcds-recommendation-08\"\n    )\n    assert inst.name == \"Cdcopioid08\"\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert (\n        inst.relatedArtifact[0].display\n        == \"CDC guideline for prescribing opioids for chronic pain\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert inst.relatedArtifact[1].display == \"MME Conversion Tables\"\n    assert (\n        inst.relatedArtifact[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].type == \"documentation\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"CDC Opioid Prescribing Guideline Recommendation #8\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"eca-rule\"\n    assert inst.type.coding[0].display == \"ECA Rule\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/plan-definition-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/ig/opioid-cds/PlanDefinition/opioidcds-08\"\n            }\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"Before starting and periodically during continuation of \"\n        \"opioid therapy, clinicians should evaluate risk factors for \"\n        \"opioid-related harms.\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_plandefinition_8(base_settings):\n    \"\"\"No. 8 tests collection for PlanDefinition.\n    Test File: plandefinition-opioidcds-08.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"plandefinition-opioidcds-08.json\"\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_8(inst2)\n\n\ndef impl_plandefinition_9(inst):\n    assert (\n        inst.action[0].action[0].dynamicValue[0].expression.expression\n        == \"Create Lactation Consult Request\"\n    )\n    assert inst.action[0].action[0].dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.action[0].action[0].dynamicValue[0].path == \"/\"\n    assert (\n        inst.action[0].action[0].textEquivalent == \"Create a lactation consult request\"\n    )\n    assert inst.action[0].action[0].title == \"Create a lactation consult request.\"\n    assert inst.action[0].action[0].type.coding[0].code == \"create\"\n    assert (\n        inst.action[0].condition[0].expression.expression\n        == \"Should Create Lactation Consult\"\n    )\n    assert inst.action[0].condition[0].expression.language == \"text/cql\"\n    assert inst.action[0].condition[0].kind == \"applicability\"\n    assert inst.action[0].title == (\n        \"Mother should be referred to a lactation specialist for \" \"consultation.\"\n    )\n    assert inst.action[0].trigger[0].name == \"Admission\"\n    assert inst.action[0].trigger[0].type == \"named-event\"\n    assert inst.action[0].trigger[1].name == \"Birth\"\n    assert inst.action[0].trigger[1].type == \"named-event\"\n    assert inst.action[0].trigger[2].name == \"Infant Transfer to Recovery\"\n    assert inst.action[0].trigger[2].type == \"named-event\"\n    assert inst.action[0].trigger[3].name == \"Transfer to Post-Partum\"\n    assert inst.action[0].trigger[3].type == \"named-event\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-03-08\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"Exclusive breastfeeding intervention intended to improve \"\n        \"outcomes for exclusive breastmilk feeding of newborns by \"\n        \"creating a lactation consult for the mother if appropriate.\"\n    )\n    assert inst.id == \"exclusive-breastfeeding-intervention-04\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"exclusive-breastfeeding-intervention-04\"\n    assert inst.library[0] == (\n        \"http://example.org/fhir/Library/library-exclusive-\" \"breastfeeding-cds-logic\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"ExclusiveBreastfeedingIntervention04\"\n    assert inst.relatedArtifact[0].resource == (\n        \"http://example.org/fhir/Measure/measure-exclusive-\" \"breastfeeding\"\n    )\n    assert inst.relatedArtifact[0].type == \"derived-from\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Exclusive Breastfeeding Intervention-04\"\n    assert inst.topic[0].text == \"Exclusive Breastfeeding\"\n    assert inst.version == \"1.0.0\"\n\n\ndef test_plandefinition_9(base_settings):\n    \"\"\"No. 9 tests collection for PlanDefinition.\n    Test File: plandefinition-exclusive-breastfeeding-intervention-04.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"plandefinition-exclusive-breastfeeding-intervention-04.json\"\n    )\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_9(inst2)\n\n\ndef impl_plandefinition_10(inst):\n    assert inst.action[0].action[0].description == \"Will precribe immediate release\"\n    assert inst.action[0].action[1].description == (\n        \"Risk of overdose carefully considered and outweighed by \"\n        \"benefit; snooze 3 mo\"\n    )\n    assert inst.action[0].action[2].description == \"N/A - see comment; snooze 3 mo\"\n    assert inst.action[0].condition[0].expression.description == (\n        \"Check whether the opioid prescription for the existing \"\n        \"patient is extended-release without any opioids-with-abuse-\"\n        \"potential prescribed in the past 90 days.\"\n    )\n    assert inst.action[0].condition[0].expression.expression == \"Inclusion Criteria\"\n    assert inst.action[0].condition[0].expression.language == \"text/cql\"\n    assert inst.action[0].condition[0].kind == \"applicability\"\n    assert inst.action[0].description == (\n        \"Checking if the trigger prescription meets the inclusion \"\n        \"criteria for recommendation #4 workflow.\"\n    )\n    assert (\n        inst.action[0].documentation[0].document.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"strong\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Strong\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[0]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/recommendation-strength\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0].documentation[0].document.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[1]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"low\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[1]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Low quality\"\n    )\n    assert (\n        inst.action[0]\n        .documentation[0]\n        .document.extension[1]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/evidence-quality\"}\n        ).valueUri\n    )\n    assert inst.action[0].documentation[0].type == \"documentation\"\n    assert inst.action[0].dynamicValue[0].expression.expression == \"Get Summary\"\n    assert inst.action[0].dynamicValue[0].expression.language == \"text/cql\"\n    assert inst.action[0].dynamicValue[0].path == \"action.title\"\n    assert inst.action[0].dynamicValue[1].expression.expression == \"Get Detail\"\n    assert inst.action[0].dynamicValue[1].expression.language == \"text/cql\"\n    assert inst.action[0].dynamicValue[1].path == \"action.description\"\n    assert inst.action[0].dynamicValue[2].expression.expression == \"Get Indicator\"\n    assert inst.action[0].dynamicValue[2].expression.language == \"text/cql\"\n    assert inst.action[0].dynamicValue[2].path == \"activity.extension\"\n    assert inst.action[0].groupingBehavior == \"visual-group\"\n    assert inst.action[0].selectionBehavior == \"exactly-one\"\n    assert inst.action[0].title == \"Extended-release opioid prescription triggered.\"\n    assert inst.action[0].trigger[0].name == \"medication-prescribe\"\n    assert inst.action[0].trigger[0].type == \"named-event\"\n    assert inst.author[0].name == \"Kensaku Kawamoto, MD, PhD, MHS\"\n    assert inst.author[1].name == \"Bryn Rhodes\"\n    assert inst.author[2].name == \"Floyd Eisenberg, MD, MPH\"\n    assert inst.author[3].name == \"Robert McClure, MD, MPH\"\n    assert inst.copyright == \"© CDC 2016+.\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-03-19\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"When starting opioid therapy for chronic pain, clinicians \"\n        \"should prescribe immediate-release opioids instead of \"\n        \"extended-release/long-acting (ER/LA) opioids.\"\n    )\n    assert inst.id == \"opioidcds-04\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.11.4\"\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"cdc-opioid-guidance\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.library[0] == \"http://example.org/fhir/Library/opioidcds-recommendation-04\"\n    )\n    assert inst.name == \"Cdcopioid04\"\n    assert inst.publisher == \"Centers for Disease Control and Prevention (CDC)\"\n    assert (\n        inst.relatedArtifact[0].display\n        == \"CDC guideline for prescribing opioids for chronic pain\"\n    )\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://guidelines.gov/summaries/summary/50153/cdc-guideline-for-prescribing-opioids-for-chronic-pain---united-states-2016#420\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"documentation\"\n    assert inst.relatedArtifact[1].display == \"MME Conversion Tables\"\n    assert (\n        inst.relatedArtifact[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUrl\": \"https://www.cdc.gov/drugoverdose/pdf/calculating_total_daily_dose-a.pdf\"\n            }\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].type == \"documentation\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"CDC Opioid Prescribing Guideline Recommendation #4\"\n    assert inst.topic[0].text == \"Opioid Prescribing\"\n    assert inst.type.coding[0].code == \"eca-rule\"\n    assert inst.type.coding[0].display == \"ECA Rule\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/plan-definition-type\"}\n        ).valueUri\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/ig/opioid-cds/PlanDefinition/opioidcds-04\"\n            }\n        ).valueUri\n    )\n    assert inst.usage == (\n        \"Providers should use caution when prescribing extended-\"\n        \"release/long-acting (ER/LA) opioids as they carry a higher \"\n        \"risk and negligible benefit compared to immediate-release \"\n        \"opioids.\"\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert inst.useContext[0].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"182888003\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].display\n        == \"Medication requested (situation)\"\n    )\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"focus\"\n    assert inst.useContext[1].code.display == \"Clinical Focus\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueCodeableConcept.coding[0].code == \"82423001\"\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].display\n        == \"Chronic pain (finding)\"\n    )\n    assert (\n        inst.useContext[1].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.version == \"0.1.0\"\n\n\ndef test_plandefinition_10(base_settings):\n    \"\"\"No. 10 tests collection for PlanDefinition.\n    Test File: plandefinition-opioidcds-04.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"plandefinition-opioidcds-04.json\"\n    inst = plandefinition.PlanDefinition.model_validate_json(filename.read_bytes())\n    assert \"PlanDefinition\" == inst.get_resource_type()\n\n    impl_plandefinition_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PlanDefinition\" == data[\"resourceType\"]\n\n    inst2 = plandefinition.PlanDefinition(**data)\n    impl_plandefinition_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_practitioner.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Practitioner\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import practitioner\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_practitioner_1(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Den helder\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Walvisbaai 3\"\n    assert inst.address[0].postalCode == \"2333ZA\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1983-04-20\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"f203\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"UZI-nummer\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345678903\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.bigregister.nl/\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].type.text == \"BIG-nummer\"\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"12345678903\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].text == \"Juri van Gelder\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"+31715269111\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_1(base_settings):\n    \"\"\"No. 1 tests collection for Practitioner.\n    Test File: practitioner-example-f203-jvg.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f203-jvg.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_1(inst2)\n\n\ndef impl_practitioner_2(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Den helder\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Walvisbaai 3\"\n    assert inst.address[0].line[1] == \"C4 - Automatisering\"\n    assert inst.address[0].postalCode == \"2333ZA\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1956-12-24\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"f201\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"UZI-nummer\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345678901\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Bronsig\"\n    assert inst.name[0].given[0] == \"Arend\"\n    assert inst.name[0].prefix[0] == \"Dr.\"\n    assert inst.name[0].text == \"Dokter Bronsig\"\n    assert inst.name[0].use == \"official\"\n    assert inst.qualification[0].code.coding[0].code == \"41672002\"\n    assert inst.qualification[0].code.coding[0].display == \"Pulmonologist\"\n    assert (\n        inst.qualification[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"+31715269111\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_2(base_settings):\n    \"\"\"No. 2 tests collection for Practitioner.\n    Test File: practitioner-example-f201-ab.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f201-ab.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_2(inst2)\n\n\ndef impl_practitioner_3(inst):\n    assert inst.active is True\n    assert inst.id == \"practitioner01\"\n    assert inst.identifier[0].assigner.display == \"Child Hospital\"\n    assert (\n        inst.identifier[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/persons\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"PRN\"\n    assert inst.identifier[0].type.coding[0].display == \"Provider number\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"11115\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Doel\"\n    assert inst.name[0].given[0] == \"John\"\n    assert inst.name[0].prefix[0] == \"Dr\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_3(base_settings):\n    \"\"\"No. 3 tests collection for Practitioner.\n    Test File: Practitioner-practitioner01.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Practitioner-practitioner01.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_3(inst2)\n\n\ndef impl_practitioner_4(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Den helder\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Walvisbaai 3\"\n    assert inst.address[0].line[1] == \"C4 - Automatisering\"\n    assert inst.address[0].postalCode == \"2333ZA\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1960-06-12\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"f202\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"UZI-nummer\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"12345678902\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.bigregister.nl/\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].type.text == \"BIG-nummer\"\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"12345678902\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Maas\"\n    assert inst.name[0].given[0] == \"Luigi\"\n    assert inst.name[0].prefix[0] == \"Dr.\"\n    assert inst.name[0].text == \"Luigi Maas\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"+31715269111\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_4(base_settings):\n    \"\"\"No. 4 tests collection for Practitioner.\n    Test File: practitioner-example-f202-lm.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f202-lm.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_4(inst2)\n\n\ndef impl_practitioner_5(inst):\n    assert inst.id == \"xcda-author\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Hippocrates\"\n    assert inst.name[0].given[0] == \"Harold\"\n    assert inst.name[0].suffix[0] == \"MD\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_5(base_settings):\n    \"\"\"No. 5 tests collection for Practitioner.\n    Test File: practitioner-example-xcda-author.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"practitioner-example-xcda-author.json\"\n    )\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_5(inst2)\n\n\ndef impl_practitioner_6(inst):\n    assert inst.address[0].city == \"Amsterdam\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Galapagosweg 91\"\n    assert inst.address[0].postalCode == \"1105 AZ\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1963-07-01\"}).valueDate\n    )\n    assert inst.communication[0].language.coding[0].code == \"nl\"\n    assert inst.communication[0].language.coding[0].display == \"Dutch\"\n    assert (\n        inst.communication[0].language.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"f003\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"846100293\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"usual\"\n    assert inst.identifier[1].value == \"243HID3RT938\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Versteegh\"\n    assert inst.name[0].given[0] == \"Marc\"\n    assert inst.name[0].suffix[0] == \"MD\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"0205562431\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"m.versteegh@bmc.nl\"\n    assert inst.telecom[2].system == \"fax\"\n    assert inst.telecom[2].use == \"work\"\n    assert inst.telecom[2].value == \"0205662948\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_6(base_settings):\n    \"\"\"No. 6 tests collection for Practitioner.\n    Test File: practitioner-example-f003-mv.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f003-mv.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_6(inst2)\n\n\ndef impl_practitioner_7(inst):\n    assert inst.address[0].city == \"Den Burg\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Galapagosweg 91\"\n    assert inst.address[0].postalCode == \"9105 PZ\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1979-04-29\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"f002\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"730291637\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"usual\"\n    assert inst.identifier[1].value == \"174BIP3JH438\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Voigt\"\n    assert inst.name[0].given[0] == \"Pieter\"\n    assert inst.name[0].suffix[0] == \"MD\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"0205569336\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"p.voigt@bmc.nl\"\n    assert inst.telecom[2].system == \"fax\"\n    assert inst.telecom[2].use == \"work\"\n    assert inst.telecom[2].value == \"0205669382\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_7(base_settings):\n    \"\"\"No. 7 tests collection for Practitioner.\n    Test File: practitioner-example-f002-pv.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f002-pv.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_7(inst2)\n\n\ndef impl_practitioner_8(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"PleasantVille\"\n    assert inst.address[0].line[0] == \"534 Erewhon St\"\n    assert inst.address[0].postalCode == \"3999\"\n    assert inst.address[0].state == \"Vic\"\n    assert inst.address[0].use == \"home\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org/practitioners\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"23\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Careful\"\n    assert inst.name[0].given[0] == \"Adam\"\n    assert inst.name[0].prefix[0] == \"Dr\"\n    assert inst.qualification[0].code.coding[0].code == \"BS\"\n    assert inst.qualification[0].code.coding[0].display == \"Bachelor of Science\"\n    assert (\n        inst.qualification[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0360/2.7\"}\n        ).valueUri\n    )\n    assert inst.qualification[0].code.text == \"Bachelor of Science\"\n    assert (\n        inst.qualification[0].identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/UniversityIdentifier\"}\n        ).valueUri\n    )\n    assert inst.qualification[0].identifier[0].value == \"12345\"\n    assert inst.qualification[0].issuer.display == \"Example University\"\n    assert (\n        inst.qualification[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1995\"}\n        ).valueDateTime\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_8(base_settings):\n    \"\"\"No. 8 tests collection for Practitioner.\n    Test File: practitioner-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_8(inst2)\n\n\ndef impl_practitioner_9(inst):\n    assert inst.address[0].city == \"Den Burg\"\n    assert inst.address[0].country == \"NLD\"\n    assert inst.address[0].line[0] == \"Galapagosweg 91\"\n    assert inst.address[0].postalCode == \"9105 PZ\"\n    assert inst.address[0].use == \"work\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1971-11-07\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"f007\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.528.1.1007.3.1\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"874635264\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"usual\"\n    assert inst.identifier[1].value == \"567IUI51C154\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Heps\"\n    assert inst.name[0].given[0] == \"Simone\"\n    assert inst.name[0].suffix[0] == \"MD\"\n    assert inst.name[0].use == \"official\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"020556936\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"work\"\n    assert inst.telecom[1].value == \"S.M.Heps@bmc.nl\"\n    assert inst.telecom[2].system == \"fax\"\n    assert inst.telecom[2].use == \"work\"\n    assert inst.telecom[2].value == \"0205669283\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_9(base_settings):\n    \"\"\"No. 9 tests collection for Practitioner.\n    Test File: practitioner-example-f007-sh.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitioner-example-f007-sh.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_9(inst2)\n\n\ndef impl_practitioner_10(inst):\n    assert inst.active is True\n    assert inst.id == \"practitioner02\"\n    assert inst.identifier[0].assigner.display == \"Child Hospital\"\n    assert (\n        inst.identifier[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/persons\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"PRN\"\n    assert inst.identifier[0].type.coding[0].display == \"Provider number\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"11116\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Doel\"\n    assert inst.name[0].given[0] == \"Jane\"\n    assert inst.name[0].prefix[0] == \"Dr\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitioner_10(base_settings):\n    \"\"\"No. 10 tests collection for Practitioner.\n    Test File: Practitioner-practitioner02.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Practitioner-practitioner02.json\"\n    inst = practitioner.Practitioner.model_validate_json(filename.read_bytes())\n    assert \"Practitioner\" == inst.get_resource_type()\n\n    impl_practitioner_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Practitioner\" == data[\"resourceType\"]\n\n    inst2 = practitioner.Practitioner(**data)\n    impl_practitioner_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_practitionerrole.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/PractitionerRole\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import practitionerrole\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_practitionerrole_1(inst):\n    assert inst.active is True\n    assert (\n        inst.availability[0].availableTime[0].availableEndTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"16:30:00\"}).valueTime\n    )\n    assert (\n        inst.availability[0].availableTime[0].availableStartTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"09:00:00\"}).valueTime\n    )\n    assert inst.availability[0].availableTime[0].daysOfWeek[0] == \"mon\"\n    assert inst.availability[0].availableTime[0].daysOfWeek[1] == \"tue\"\n    assert inst.availability[0].availableTime[0].daysOfWeek[2] == \"wed\"\n    assert (\n        inst.availability[0].availableTime[1].availableEndTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"12:00:00\"}).valueTime\n    )\n    assert (\n        inst.availability[0].availableTime[1].availableStartTime\n        == ExternalValidatorModel.model_validate({\"valueTime\": \"09:00:00\"}).valueTime\n    )\n    assert inst.availability[0].availableTime[1].daysOfWeek[0] == \"thu\"\n    assert inst.availability[0].availableTime[1].daysOfWeek[1] == \"fri\"\n    assert (\n        inst.availability[0].notAvailableTime[0].description\n        == \"Adam will be on extended leave during May 2017\"\n    )\n    assert (\n        inst.availability[0].notAvailableTime[0].during.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-05-20\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.availability[0].notAvailableTime[0].during.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-05-01\"}\n        ).valueDateTime\n    )\n    assert inst.availability[0].notAvailableTime[1].description == (\n        \"Adam is generally unavailable on public holidays and during \"\n        \"the Christmas/New Year break\"\n    )\n    assert inst.characteristic[0].coding[0].code == \"in-person\"\n    assert inst.characteristic[0].coding[0].display == \"In Person\"\n    assert (\n        inst.characteristic[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/service-mode\"}\n        ).valueUri\n    )\n    assert inst.characteristic[0].coding[1].code == \"videoconference\"\n    assert inst.characteristic[0].coding[1].display == \"Video Conference\"\n    assert (\n        inst.characteristic[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/service-mode\"}\n        ).valueUri\n    )\n    assert inst.code[0].coding[0].code == \"RP\"\n    assert (\n        inst.code[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0286\"}\n        ).valueUri\n    )\n    assert inst.communication[0].coding[0].code == \"en\"\n    assert (\n        inst.communication[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"phone\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"(03) 5555 6473\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].use == \"work\"\n    assert inst.contact[0].telecom[1].value == \"adam.southern@example.org\"\n    assert inst.endpoint[0].reference == \"Endpoint/example\"\n    assert inst.healthcareService[0].reference == \"HealthcareService/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.acme.org/practitioners\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"23\"\n    assert inst.location[0].display == \"South Wing, second floor\"\n    assert inst.location[0].reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.organization.reference == \"Organization/f001\"\n    assert (\n        inst.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-03-31\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.practitioner.display == \"Dr Adam Careful\"\n    assert inst.practitioner.reference == \"Practitioner/example\"\n    assert inst.specialty[0].coding[0].code == \"408443003\"\n    assert inst.specialty[0].coding[0].display == \"General medical practice\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_practitionerrole_1(base_settings):\n    \"\"\"No. 1 tests collection for PractitionerRole.\n    Test File: practitionerrole-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"practitionerrole-example.json\"\n    inst = practitionerrole.PractitionerRole.model_validate_json(filename.read_bytes())\n    assert \"PractitionerRole\" == inst.get_resource_type()\n\n    impl_practitionerrole_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"PractitionerRole\" == data[\"resourceType\"]\n\n    inst2 = practitionerrole.PractitionerRole(**data)\n    impl_practitionerrole_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_procedure.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Procedure\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import procedure\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_procedure_1(inst):\n    assert inst.bodySite[0].coding[0].code == \"272676008\"\n    assert inst.bodySite[0].coding[0].display == \"Sphenoid bone\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"367336001\"\n    assert inst.code.coding[0].display == \"Chemotherapy\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.display == \"Roel's encounter on January 28th, 2013\"\n    assert inst.encounter.reference == \"Encounter/f202\"\n    assert inst.id == \"f201\"\n    assert (\n        inst.instantiatesCanonical[0] == \"http://example.org/fhir/PlanDefinition/KDN5\"\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Eerste neo-adjuvante TPF-kuur bij groot proces in sphenoid \"\n        \"met intracraniale uitbreiding.\"\n    )\n    assert (\n        inst.occurrencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-28T14:27:00+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurrencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-01-28T13:31:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.display == \"Dokter Bronsig\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f201\"\n    assert inst.performer[0].function.coding[0].code == \"310512001\"\n    assert inst.performer[0].function.coding[0].display == \"Medical oncologist\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.reason[0].concept.text == \"DiagnosticReport/f201\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_1(base_settings):\n    \"\"\"No. 1 tests collection for Procedure.\n    Test File: procedure-example-f201-tpf.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"procedure-example-f201-tpf.json\"\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_1(inst2)\n\n\ndef impl_procedure_2(inst):\n    assert inst.basedOn[0].display == \"Maternity care plan\"\n    assert inst.basedOn[0].reference == \"CarePlan/preg\"\n    assert inst.code.coding[0].code == \"62013009\"\n    assert inst.code.coding[0].display == \"Ambulating patient (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Ambulation\"\n    assert inst.id == \"ambulation\"\n    assert inst.identifier[0].value == \"12345\"\n    assert (\n        inst.instantiatesUri[0]\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://example.org/protocol-for-hypertension-during-pregnancy\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.location.display\n        == \"Burgers University Medical Center, South Wing, second floor\"\n    )\n    assert inst.location.reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Maternity CareTeam\"\n    assert inst.performer[0].actor.reference == \"CareTeam/example\"\n    assert inst.performer[0].onBehalfOf.display == \"University Medical Hospital\"\n    assert inst.performer[0].onBehalfOf.reference == \"Organization/f001\"\n    assert inst.reason[0].reference.display == \"Blood Pressure\"\n    assert inst.reason[0].reference.reference == \"Observation/blood-pressure\"\n    assert inst.status == \"not-done\"\n    assert inst.statusReason.coding[0].code == \"398254007\"\n    assert inst.statusReason.coding[0].display == \"  Pre-eclampsia (disorder)\"\n    assert (\n        inst.statusReason.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.statusReason.text == \"Pre-eclampsia\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Ambulation '\n        \"procedure was not done</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_2(base_settings):\n    \"\"\"No. 2 tests collection for Procedure.\n    Test File: procedure-example-ambulation.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"procedure-example-ambulation.json\"\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_2(inst2)\n\n\ndef impl_procedure_3(inst):\n    assert inst.code.coding[0].code == \"25267002\"\n    assert (\n        inst.code.coding[0].display == \"Insertion of intracardiac pacemaker (procedure)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Implant Pacemaker\"\n    assert inst.contained[0].id == \"example-pacemaker\"\n    assert inst.focalDevice[0].action.coding[0].code == \"implanted\"\n    assert (\n        inst.focalDevice[0].action.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/device-action\"}\n        ).valueUri\n    )\n    assert inst.focalDevice[0].manipulated.reference == \"#example-pacemaker\"\n    assert inst.followUp[0].text == \"ROS 5 days  - 2013-04-10\"\n    assert inst.id == \"example-implant\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"Routine Appendectomy. Appendix was inflamed and in retro-\" \"caecal position\"\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-04-05\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.display == \"Dr Cecil Surgeon\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.reason[0].concept.text == \"Bradycardia\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_3(base_settings):\n    \"\"\"No. 3 tests collection for Procedure.\n    Test File: procedure-example-implant.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"procedure-example-implant.json\"\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_3(inst2)\n\n\ndef impl_procedure_4(inst):\n    assert inst.code.coding[0].code == \"76164006\"\n    assert inst.code.coding[0].display == \"Biopsy of colon (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Biopsy of colon\"\n    assert inst.id == \"colon-biopsy\"\n    assert inst.identifier[0].value == \"12345\"\n    assert (\n        inst.location.display\n        == \"Burgers University Medical Center, South Wing, second floor\"\n    )\n    assert inst.location.reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.partOf[0].display == \"Colonoscopy\"\n    assert inst.partOf[0].reference == \"Procedure/colonoscopy\"\n    assert inst.performer[0].actor.display == \"Dr Adam Careful\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Biopsy of colon,'\n        \" which was part of colonoscopy</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_4(base_settings):\n    \"\"\"No. 4 tests collection for Procedure.\n    Test File: procedure-example-colon-biopsy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"procedure-example-colon-biopsy.json\"\n    )\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_4(inst2)\n\n\ndef impl_procedure_5(inst):\n    assert inst.bodySite[0].coding[0].code == \"83030008\"\n    assert inst.bodySite[0].coding[0].display == \"Retropharyngeal area\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"48387007\"\n    assert inst.code.coding[0].display == \"Tracheotomy\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/f003\"\n    assert inst.followUp[0].text == \"described in care plan\"\n    assert inst.id == \"f004\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-22T10:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurrencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-22T09:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.outcome.text == \"removal of the retropharyngeal abscess\"\n    assert inst.performer[0].actor.display == \"A. Langeveld\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f005\"\n    assert inst.performer[0].function.coding[0].code == \"01.000\"\n    assert inst.performer[0].function.coding[0].display == \"Arts\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.15.111\"}\n        ).valueUri\n    )\n    assert inst.performer[0].function.text == \"Care role\"\n    assert inst.reason[0].concept.text == \"ensure breathing during surgery\"\n    assert inst.report[0].display == \"???????????\"\n    assert inst.report[0].reference == \"DiagnosticReport/f001\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_5(base_settings):\n    \"\"\"No. 5 tests collection for Procedure.\n    Test File: procedure-example-f004-tracheotomy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"procedure-example-f004-tracheotomy.json\"\n    )\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_5(inst2)\n\n\ndef impl_procedure_6(inst):\n    assert inst.basedOn[0].display == \"Order for health education\"\n    assert inst.basedOn[0].reference == \"ServiceRequest/education\"\n    assert inst.category[0].coding[0].code == \"311401005\"\n    assert inst.category[0].coding[0].display == \"Patient education (procedure)\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Education\"\n    assert inst.code.coding[0].code == \"48023004\"\n    assert (\n        inst.code.coding[0].display\n        == \"Breast self-examination technique education (procedure)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Health education - breast examination\"\n    assert inst.id == \"education\"\n    assert inst.location.display == \"Southside Community Health Center\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.display == \"Pamela Educator, RN\"\n    assert inst.reason[0].concept.text == \"early detection of breast mass\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Jane Doe\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Health education'\n        \" - breast examination for early detection of breast \"\n        \"mass</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_6(base_settings):\n    \"\"\"No. 6 tests collection for Procedure.\n    Test File: procedure-example-education.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"procedure-example-education.json\"\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_6(inst2)\n\n\ndef impl_procedure_7(inst):\n    assert inst.code.coding[0].code == \"73761001\"\n    assert inst.code.coding[0].display == \"Colonoscopy (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Colonoscopy\"\n    assert inst.complication[0].reference.display == \"Perforated intestine condition\"\n    assert inst.id == \"colonoscopy\"\n    assert inst.identifier[0].value == \"12345\"\n    assert (\n        inst.location.display\n        == \"Burgers University Medical Center, South Wing, second floor\"\n    )\n    assert inst.location.reference == \"Location/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].actor.display == \"Dr Adam Careful\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Colonoscopy with'\n        \" complication</div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.used[0].reference.display == \"Colonoscope device\"\n\n\ndef test_procedure_7(base_settings):\n    \"\"\"No. 7 tests collection for Procedure.\n    Test File: procedure-example-colonoscopy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"procedure-example-colonoscopy.json\"\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_7(inst2)\n\n\ndef impl_procedure_8(inst):\n    assert (\n        inst.basedOn[0].display == \"Order for the assessment of passive range of motion\"\n    )\n    assert inst.basedOn[0].reference == \"ServiceRequest/physical-therapy\"\n    assert inst.bodySite[0].coding[0].code == \"36701003\"\n    assert inst.bodySite[0].coding[0].display == \"Both knees (body structure)\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.bodySite[0].text == \"Both knees\"\n    assert inst.category[0].coding[0].code == \"386053000\"\n    assert inst.category[0].coding[0].display == \"Evaluation procedure (procedure)\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Evaluation\"\n    assert inst.code.coding[0].code == \"710830005\"\n    assert (\n        inst.code.coding[0].display\n        == \"Assessment of passive range of motion (procedure)\"\n    )\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Assessment of passive range of motion\"\n    assert inst.id == \"physical-therapy\"\n    assert inst.location.display == \"Sawbones Orthopedic Clinic\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-09-27\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.display == \"Paul Therapist, PT\"\n    assert (\n        inst.reason[0].concept.text\n        == \"assessment of mobility limitations due to osteoarthritis\"\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Assessment of '\n        \"passive range of motion for both knees on Sept 27, 2016 due \"\n        \"to osteoarthritis</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_8(base_settings):\n    \"\"\"No. 8 tests collection for Procedure.\n    Test File: procedure-example-physical-therapy.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"procedure-example-physical-therapy.json\"\n    )\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_8(inst2)\n\n\ndef impl_procedure_9(inst):\n    assert inst.bodySite[0].coding[0].code == \"83030008\"\n    assert inst.bodySite[0].coding[0].display == \"Retropharyngeal area\"\n    assert (\n        inst.bodySite[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.coding[0].code == \"172960003\"\n    assert inst.code.coding[0].display == \"Incision of retropharyngeal abscess\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/f003\"\n    assert inst.followUp[0].text == \"described in care plan\"\n    assert inst.id == \"f003\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrencePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-24T10:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.occurrencePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-03-24T09:30:10+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.outcome.text == \"removal of the retropharyngeal abscess\"\n    assert inst.performer[0].actor.display == \"E.M.J.M. van den broek\"\n    assert inst.performer[0].actor.reference == \"Practitioner/f001\"\n    assert inst.performer[0].function.coding[0].code == \"01.000\"\n    assert inst.performer[0].function.coding[0].display == \"Arts\"\n    assert (\n        inst.performer[0].function.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.15.111\"}\n        ).valueUri\n    )\n    assert inst.performer[0].function.text == \"Care role\"\n    assert inst.reason[0].concept.text == \"abcess in retropharyngeal area\"\n    assert inst.report[0].display == \"Lab results blood test\"\n    assert inst.report[0].reference == \"DiagnosticReport/f001\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"P. van de Heuvel\"\n    assert inst.subject.reference == \"Patient/f001\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_9(base_settings):\n    \"\"\"No. 9 tests collection for Procedure.\n    Test File: procedure-example-f003-abscess.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"procedure-example-f003-abscess.json\"\n    )\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_9(inst2)\n\n\ndef impl_procedure_10(inst):\n    assert inst.code.coding[0].code == \"80146002\"\n    assert inst.code.coding[0].display == \"Appendectomy (Procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Appendectomy\"\n    assert inst.followUp[0].text == \"ROS 5 days  - 2013-04-10\"\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.meta.versionId == \"1\"\n    assert inst.note[0].text == (\n        \"Routine Appendectomy. Appendix was inflamed and in retro-\" \"caecal position\"\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-04-05\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].actor.display == \"Dr Cecil Surgeon\"\n    assert inst.performer[0].actor.reference == \"Practitioner/example\"\n    assert inst.reason[0].concept.text == (\n        \"Generalized abdominal pain 24 hours. Localized in RIF with \"\n        \"rebound and guarding\"\n    )\n    assert inst.recorder.display == \"Dr Cecil Surgeon\"\n    assert inst.recorder.reference == \"Practitioner/example\"\n    assert inst.reportedReference.display == \"Dr Cecil Surgeon\"\n    assert inst.reportedReference.reference == \"Practitioner/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.supportingInfo[0].reference == \"ImagingStudy/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Routine ' \"Appendectomy</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_procedure_10(base_settings):\n    \"\"\"No. 10 tests collection for Procedure.\n    Test File: procedure-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"procedure-example.json\"\n    inst = procedure.Procedure.model_validate_json(filename.read_bytes())\n    assert \"Procedure\" == inst.get_resource_type()\n\n    impl_procedure_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Procedure\" == data[\"resourceType\"]\n\n    inst2 = procedure.Procedure(**data)\n    impl_procedure_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_provenance.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Provenance\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import provenance\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_provenance_1(inst):\n    assert inst.activity.coding[0].code == \"AU\"\n    assert inst.activity.coding[0].display == \"authenticated\"\n    assert (\n        inst.activity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-DocumentCompletion\"}\n        ).valueUri\n    )\n    assert inst.agent[0].type.coding[0].code == \"VERF\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/contractsignertypecodes\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.agent[0].who.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.identifier.value == \"mailto://hhd@ssa.gov\"\n    assert inst.authorization[0].concept.coding[0].code == \"TREAT\"\n    assert inst.authorization[0].concept.coding[0].display == \"treatment\"\n    assert (\n        inst.authorization[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.id == \"signature\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-08-27T08:39:24+10:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.signature[0].data\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"Li4u\"}\n        ).valueBase64Binary\n    )\n    assert inst.signature[0].sigFormat == \"application/signature+xml\"\n    assert inst.signature[0].targetFormat == \"application/fhir+xml\"\n    assert inst.signature[0].type[0].code == \"1.2.840.10065.1.12.1.5\"\n    assert inst.signature[0].type[0].display == \"Verification Signature\"\n    assert (\n        inst.signature[0].type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso-astm:E1762-95:2013\"}\n        ).valueUri\n    )\n    assert (\n        inst.signature[0].when\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-08-27T08:39:24+10:00\"}\n        ).valueInstant\n    )\n    assert inst.signature[0].who.reference == \"Practitioner/xcda-author\"\n    assert inst.target[0].reference == \"DocumentReference/example/_history/4\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_1(base_settings):\n    \"\"\"No. 1 tests collection for Provenance.\n    Test File: provenance-example-sig.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"provenance-example-sig.json\"\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_1(inst2)\n\n\ndef impl_provenance_2(inst):\n    assert inst.activity.coding[0].code == \"originate\"\n    assert (\n        inst.activity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/iso-21089-lifecycle\"}\n        ).valueUri\n    )\n    assert inst.agent[0].type.coding[0].code == \"110153\"\n    assert inst.agent[0].type.coding[0].display == \"Source Role ID\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.display == \"myMachine.example.org\"\n    assert inst.agent[1].type.coding[0].code == \"110152\"\n    assert inst.agent[1].type.coding[0].display == \"Destination Role ID\"\n    assert (\n        inst.agent[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://dicom.nema.org/resources/ontology/DCM\"}\n        ).valueUri\n    )\n    assert inst.agent[1].who.reference == \"Device/example\"\n    assert inst.agent[2].type.coding[0].code == \"INF\"\n    assert inst.agent[2].type.coding[0].display == \"Informant\"\n    assert (\n        inst.agent[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.agent[2].who.display == \"Betty Jones\"\n    assert inst.authorization[0].concept.coding[0].code == \"TREAT\"\n    assert (\n        inst.authorization[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.basedOn[0].reference == \"CarePlan/example\"\n    assert inst.encounter.reference == \"Encounter/home\"\n    assert inst.id == \"example-advanced\"\n    assert inst.location.reference == \"Location/1/_history/1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurredDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-04-29T09:49:00.000Z\"}\n        ).valueDateTime\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert (\n        inst.policy[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/policy/1234\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2020-04-29T09:49:00.000Z\"}\n        ).valueInstant\n    )\n    assert inst.signature[0].sigFormat == \"image/jpeg\"\n    assert inst.signature[0].type[0].code == \"1.2.840.10065.1.12.1.5\"\n    assert inst.signature[0].type[0].display == \"Verification Signature\"\n    assert (\n        inst.signature[0].type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso-astm:E1762-95:2013\"}\n        ).valueUri\n    )\n    assert (\n        inst.signature[0].when\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2020-04-29T09:49:00.000Z\"}\n        ).valueInstant\n    )\n    assert inst.signature[0].who.display == \"Betty Jones\"\n    assert inst.target[0].reference == \"List/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_2(base_settings):\n    \"\"\"No. 2 tests collection for Provenance.\n    Test File: provenance-example-advanced.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"provenance-example-advanced.json\"\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_2(inst2)\n\n\ndef impl_provenance_3(inst):\n    assert inst.agent[0].type.coding[0].code == \"INF\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.reference == \"Patient/pat3\"\n    assert inst.id == \"example1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2021-12-07T12:23:45+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.target[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/targetElement\"}\n        ).valueUri\n    )\n    assert (\n        inst.target[0].extension[0].valueUri\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"n1\"}).valueUri\n    )\n    assert inst.target[0].reference == \"Patient/pat3/_history/1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_3(base_settings):\n    \"\"\"No. 3 tests collection for Provenance.\n    Test File: provenance-example1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"provenance-example1.json\"\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_3(inst2)\n\n\ndef impl_provenance_4(inst):\n    assert inst.activity.coding[0].code == \"AU\"\n    assert inst.activity.coding[0].display == \"authenticated\"\n    assert (\n        inst.activity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-DocumentCompletion\"}\n        ).valueUri\n    )\n    assert inst.agent[0].role[0].coding[0].code == \"AUT\"\n    assert (\n        inst.agent[0].role[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.reference == \"Patient/72\"\n    assert inst.id == \"consent-signature\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-05-26T00:41:10-04:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.signature[0].data\n        == ExternalValidatorModel.model_validate(\n            {\"valueBase64Binary\": \"dGhpcyBibG9iIGlzIHNuaXBwZWQ=\"}\n        ).valueBase64Binary\n    )\n    assert inst.signature[0].sigFormat == \"application/signature+xml\"\n    assert inst.signature[0].targetFormat == \"application/fhir+xml\"\n    assert inst.signature[0].type[0].code == \"1.2.840.10065.1.12.1.1\"\n    assert inst.signature[0].type[0].display == \"Author's Signature\"\n    assert (\n        inst.signature[0].type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso-astm:E1762-95:2013\"}\n        ).valueUri\n    )\n    assert (\n        inst.signature[0].when\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-05-26T00:41:10-04:00\"}\n        ).valueInstant\n    )\n    assert inst.signature[0].who.reference == \"Patient/72\"\n    assert inst.target[0].reference == \"Consent/consent-example-basic/_history/1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_4(base_settings):\n    \"\"\"No. 4 tests collection for Provenance.\n    Test File: provenance-consent-signature.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"provenance-consent-signature.json\"\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_4(inst2)\n\n\ndef impl_provenance_5(inst):\n    assert inst.activity.coding[0].code == \"CREATE\"\n    assert inst.activity.coding[0].display == \"create\"\n    assert (\n        inst.activity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-DataOperation\"}\n        ).valueUri\n    )\n    assert inst.activity.text == (\n        \"profiling Short Tandem Repeats (STRs) from high throughput \" \"sequencing data.\"\n    )\n    assert inst.agent[0].type.coding[0].code == \"AUT\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.reference == \"Patient/example\"\n    assert inst.entity[0].role == \"source\"\n    assert inst.entity[0].what.identifier.type.coding[0].code == \"CWL\"\n    assert inst.entity[0].what.identifier.type.coding[0].display == \"lobSTR\"\n    assert (\n        inst.entity[0].what.identifier.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://github.com/common-workflow-language/workflows\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.identifier.value == (\n        \"https://github.com/common-workflow-\"\n        \"language/workflows/blob/master/workflows/lobSTR/lobSTR-\"\n        \"workflow.cwl\"\n    )\n    assert inst.id == \"example-cwl\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurredPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-30\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-12-01T08:12:14+10:00\"}\n        ).valueInstant\n    )\n    assert inst.target[0].reference == \"MolecularSequence/example-pgx-1/_history/1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_5(base_settings):\n    \"\"\"No. 5 tests collection for Provenance.\n    Test File: provenance-example-cwl.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"provenance-example-cwl.json\"\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_5(inst2)\n\n\ndef impl_provenance_6(inst):\n    assert inst.activity.coding[0].code == \"CREATE\"\n    assert inst.activity.coding[0].display == \"create\"\n    assert (\n        inst.activity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-DataOperation\"}\n        ).valueUri\n    )\n    assert inst.agent[0].type.coding[0].code == \"assembler\"\n    assert inst.agent[0].type.coding[0].display == \"Assembler\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.display == \"LEAP Consent Management Service\"\n    assert inst.entity[0].role == \"source\"\n    assert inst.entity[0].what.reference == (\n        \"http://example.org/fhir/QuestionnaireResponse/some-\" \"questionnaire-response\"\n    )\n    assert inst.id == \"example-create-consent\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2021-09-10T07:08:21.722+00:00\"}\n        ).valueInstant\n    )\n    assert inst.target[0].reference == \"Consent/consent-example-basic/_history/1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_6(base_settings):\n    \"\"\"No. 6 tests collection for Provenance.\n    Test File: provenance-example-create-consent.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"provenance-example-create-consent.json\"\n    )\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_6(inst2)\n\n\ndef impl_provenance_7(inst):\n    assert inst.activity.coding[0].code == \"DELETE\"\n    assert (\n        inst.activity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-DataOperation\"}\n        ).valueUri\n    )\n    assert inst.agent[0].type.coding[0].code == \"author\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert inst.agent[0].who.display == \"Brian Postlethwaite\"\n    assert inst.authorization[0].concept.coding[0].code == \"METAMGT\"\n    assert (\n        inst.authorization[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.entity[0].role == \"source\"\n    assert inst.entity[0].what.reference == (\n        \"http://terminology.hl7.org/CodeSystem/location-physical-\" \"type/_history/3\"\n    )\n    assert inst.id == \"example-delete\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2015-06-27T08:39:24+10:00\"}\n        ).valueInstant\n    )\n    assert inst.target[0].reference == (\n        \"http://terminology.hl7.org/CodeSystem/location-physical-\" \"type/_history/3\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_7(base_settings):\n    \"\"\"No. 7 tests collection for Provenance.\n    Test File: provenance-example-delete.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"provenance-example-delete.json\"\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_7(inst2)\n\n\ndef impl_provenance_8(inst):\n    assert inst.agent[0].type.coding[0].code == \"INF\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.reference == \"RelatedPerson/f001\"\n    assert inst.id == \"example2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2021-12-08T16:54:24+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.target[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/targetElement\"}\n        ).valueUri\n    )\n    assert (\n        inst.target[0].extension[0].valueUri\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"n2\"}).valueUri\n    )\n    assert inst.target[0].reference == \"Patient/pat3/_history/1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_8(base_settings):\n    \"\"\"No. 8 tests collection for Provenance.\n    Test File: provenance-example2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"provenance-example2.json\"\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_8(inst2)\n\n\ndef impl_provenance_9(inst):\n    assert inst.activity.coding[0].code == \"CREATE\"\n    assert inst.activity.coding[0].display == \"create\"\n    assert (\n        inst.activity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-DataOperation\"}\n        ).valueUri\n    )\n    assert inst.activity.text == \"antiviral resistance detection\"\n    assert inst.agent[0].type.coding[0].code == \"AUT\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\"}\n        ).valueUri\n    )\n    assert inst.agent[0].who.reference == \"Practitioner/example\"\n    assert inst.entity[0].role == \"source\"\n    assert inst.entity[0].what.identifier.type.coding[0].code == \"biocompute\"\n    assert inst.entity[0].what.identifier.type.coding[0].display == \"obj.1001\"\n    assert (\n        inst.entity[0].what.identifier.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://hive.biochemistry.gwu.edu\"}\n        ).valueUri\n    )\n    assert inst.entity[0].what.identifier.value == (\n        \"https://hive.biochemistry.gwu.edu/cgi-\"\n        \"bin/prd/htscsrs/servlet.cgi?pageid=bcoexample_1\"\n    )\n    assert inst.id == \"example-biocompute-object\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurredPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-06-06\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2016-06-09T08:12:14+10:00\"}\n        ).valueInstant\n    )\n    assert inst.target[0].reference == \"MolecularSequence/example/_history/1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_9(base_settings):\n    \"\"\"No. 9 tests collection for Provenance.\n    Test File: provenance-example-biocompute-object.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"provenance-example-biocompute-object.json\"\n    )\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_9(inst2)\n\n\ndef impl_provenance_10(inst):\n    assert inst.activity.coding[0].code == \"verify\"\n    assert (\n        inst.activity.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/iso-21089-lifecycle\"}\n        ).valueUri\n    )\n    assert inst.agent[0].type.coding[0].code == \"verifier\"\n    assert inst.agent[0].type.coding[0].display == \"Verifier\"\n    assert (\n        inst.agent[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/provenance-participant-type\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.agent[0].who.reference\n        == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    )\n    assert inst.id == \"example-diagnosticreport-sig\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/pat2\"\n    assert (\n        inst.policy[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/policy/Reviewed\"}\n        ).valueUri\n    )\n    assert (\n        inst.recorded\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2011-03-04T08:30:00+11:00\"}\n        ).valueInstant\n    )\n    assert inst.signature[0].type[0].code == \"ProofOfapproval\"\n    assert inst.signature[0].type[0].display == \"Proof of approval\"\n    assert (\n        inst.signature[0].type[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://uri.etsi.org/01903/v1.2.2\"}\n        ).valueUri\n    )\n    assert (\n        inst.signature[0].when\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2011-03-04T08:30:00+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.signature[0].who.reference\n        == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    )\n    assert inst.target[0].reference == \"DiagnosticReport/101\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_provenance_10(base_settings):\n    \"\"\"No. 10 tests collection for Provenance.\n    Test File: provenance-example-diagnosticreport-sig.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"provenance-example-diagnosticreport-sig.json\"\n    )\n    inst = provenance.Provenance.model_validate_json(filename.read_bytes())\n    assert \"Provenance\" == inst.get_resource_type()\n\n    impl_provenance_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Provenance\" == data[\"resourceType\"]\n\n    inst2 = provenance.Provenance(**data)\n    impl_provenance_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_questionnaire.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Questionnaire\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import questionnaire\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_questionnaire_1(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qgen-Person1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"Person-display\"\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].linkId == \"Person-flyover\"\n    assert inst.item[0].item[1].text == (\n        \"Demographics and administrative information about a person \"\n        \"independent of a specific health-related context.\"\n    )\n    assert inst.item[0].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"Person.id-flyover\"\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].item[1].linkId == \"Person.id.value\"\n    assert inst.item[0].item[2].item[1].repeats is False\n    assert inst.item[0].item[2].item[1].required is False\n    assert inst.item[0].item[2].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[2].linkId == \"Person.id\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].linkId == \"Person.meta-flyover\"\n    assert inst.item[0].item[3].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].linkId == \"Person.meta\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].text == \"Metadata about the resource\"\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].linkId == \"Person.implicitRules-flyover\"\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"Person.implicitRules.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert (\n        inst.item[0].item[4].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[4].item[1].type == \"string\"\n    assert inst.item[0].item[4].linkId == \"Person.implicitRules\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"Person.language-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].answerConstraint == \"optionsOrType\"\n    assert inst.item[0].item[5].item[1].linkId == \"Person.language.value\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"language\"\n    assert inst.item[0].item[5].item[1].type == \"coding\"\n    assert inst.item[0].item[5].linkId == \"Person.language\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"Person.text-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"Person.text\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert (\n        inst.item[0].item[6].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"Person.contained-flyover\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"Person.contained\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].linkId == \"Person.extension-flyover\"\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"Person.extension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].linkId == \"Person.modifierExtension-flyover\"\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].linkId == \"Person.modifierExtension\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"Person\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"A generic person record\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == \"Health Level Seven International (Patient Administration)\"\n    assert inst.status == \"draft\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Questionnaire/qgen-Person1\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_questionnaire_1(base_settings):\n    \"\"\"No. 1 tests collection for Questionnaire.\n    Test File: person-questionnaire.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"person-questionnaire.json\"\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_1(inst2)\n\n\ndef impl_questionnaire_2(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert inst.contained[3].id == \"vs5\"\n    assert inst.contained[4].id == \"vs6\"\n    assert inst.contained[5].id == \"vs7\"\n    assert inst.contained[6].id == \"vs8\"\n    assert inst.contained[7].id == \"vs9\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qgen-RequestOrchestration1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"RequestOrchestration-flyover\"\n    assert inst.item[0].item[0].text == (\n        \"A set of related requests that can be used to capture \"\n        \"intended activities that have inter-dependencies such as \"\n        '\"give this medication after that one\".'\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].linkId == \"RequestOrchestration.id-flyover\"\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"RequestOrchestration.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"RequestOrchestration.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"RequestOrchestration.meta-flyover\"\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"RequestOrchestration.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].linkId\n        == \"RequestOrchestration.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[3].item[1].linkId\n        == \"RequestOrchestration.implicitRules.value\"\n    )\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"RequestOrchestration.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].linkId == \"RequestOrchestration.language-flyover\"\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].answerConstraint == \"optionsOrType\"\n    assert inst.item[0].item[4].item[1].linkId == \"RequestOrchestration.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"coding\"\n    assert inst.item[0].item[4].linkId == \"RequestOrchestration.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"RequestOrchestration.text-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"RequestOrchestration.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].linkId == \"RequestOrchestration.contained-flyover\"\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"RequestOrchestration.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].linkId == \"RequestOrchestration.extension-flyover\"\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"RequestOrchestration.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].linkId\n        == \"RequestOrchestration.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"RequestOrchestration.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId == \"RequestOrchestration.identifier-flyover\"\n    )\n    assert inst.item[0].item[9].item[0].text == (\n        \"Allows a service to provide a unique, business identifier \" \"for the request.\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[9].item[1].linkId == \"RequestOrchestration.identifier.label\"\n    )\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[2].linkId == \"RequestOrchestration.identifier.system\"\n    )\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[3].linkId == \"RequestOrchestration.identifier.value\"\n    )\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"RequestOrchestration.identifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Business identifier\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"RequestOrchestration\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"A set of related requests\"\n    assert inst.item[0].type == \"group\"\n    assert (\n        inst.publisher == \"Health Level Seven International (Clinical Decision Support)\"\n    )\n    assert inst.status == \"draft\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Questionnaire/qgen-RequestOrchestration1\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_questionnaire_2(base_settings):\n    \"\"\"No. 2 tests collection for Questionnaire.\n    Test File: requestorchestration-questionnaire.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"requestorchestration-questionnaire.json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_2(inst2)\n\n\ndef impl_questionnaire_3(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qgen-OperationOutcome1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"OperationOutcome-display\"\n    assert inst.item[0].item[0].text == (\n        \"Can result from the failure of a REST call or be part of the\"\n        \" response message returned from a request message.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].linkId == \"OperationOutcome-flyover\"\n    assert inst.item[0].item[1].text == (\n        \"A collection of error, warning, or information messages that\"\n        \" result from a system action.\"\n    )\n    assert inst.item[0].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"OperationOutcome.id-flyover\"\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].item[1].linkId == \"OperationOutcome.id.value\"\n    assert inst.item[0].item[2].item[1].repeats is False\n    assert inst.item[0].item[2].item[1].required is False\n    assert inst.item[0].item[2].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[2].linkId == \"OperationOutcome.id\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].linkId == \"OperationOutcome.meta-flyover\"\n    assert inst.item[0].item[3].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].linkId == \"OperationOutcome.meta\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].text == \"Metadata about the resource\"\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].linkId == \"OperationOutcome.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"OperationOutcome.implicitRules.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert (\n        inst.item[0].item[4].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[4].item[1].type == \"string\"\n    assert inst.item[0].item[4].linkId == \"OperationOutcome.implicitRules\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"OperationOutcome.language-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].answerConstraint == \"optionsOrType\"\n    assert inst.item[0].item[5].item[1].linkId == \"OperationOutcome.language.value\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"language\"\n    assert inst.item[0].item[5].item[1].type == \"coding\"\n    assert inst.item[0].item[5].linkId == \"OperationOutcome.language\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"OperationOutcome.text-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"OperationOutcome.text\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert (\n        inst.item[0].item[6].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"OperationOutcome.contained-flyover\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"OperationOutcome.contained\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].linkId == \"OperationOutcome.extension-flyover\"\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"OperationOutcome.extension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId\n        == \"OperationOutcome.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].linkId == \"OperationOutcome.modifierExtension\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"OperationOutcome\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Information about the success/failure of an action\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.status == \"active\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Questionnaire/qgen-OperationOutcome1\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_questionnaire_3(base_settings):\n    \"\"\"No. 3 tests collection for Questionnaire.\n    Test File: operationoutcome-questionnaire.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"operationoutcome-questionnaire.json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_3(inst2)\n\n\ndef impl_questionnaire_4(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qgen-EventDefinition1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"EventDefinition-flyover\"\n    assert inst.item[0].item[0].text == (\n        \"The EventDefinition resource provides a reusable description\"\n        \" of when a particular event can occur.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].linkId == \"EventDefinition.id-flyover\"\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"EventDefinition.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"EventDefinition.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"EventDefinition.meta-flyover\"\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"EventDefinition.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].linkId == \"EventDefinition.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].item[1].linkId == \"EventDefinition.implicitRules.value\"\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"EventDefinition.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].linkId == \"EventDefinition.language-flyover\"\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].answerConstraint == \"optionsOrType\"\n    assert inst.item[0].item[4].item[1].linkId == \"EventDefinition.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"coding\"\n    assert inst.item[0].item[4].linkId == \"EventDefinition.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"EventDefinition.text-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"EventDefinition.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"EventDefinition.contained-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"EventDefinition.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"EventDefinition.extension-flyover\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"EventDefinition.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].linkId\n        == \"EventDefinition.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"EventDefinition.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[9].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].linkId == \"EventDefinition.url-flyover\"\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[1].linkId == \"EventDefinition.url.value\"\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == (\n        \"Canonical identifier for this event definition, represented \"\n        \"as a URI (globally unique)\"\n    )\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"EventDefinition.url\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"EventDefinition\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"A description of when an event can occur\"\n    assert inst.item[0].type == \"group\"\n    assert (\n        inst.publisher == \"Health Level Seven International (Clinical Decision Support)\"\n    )\n    assert inst.status == \"draft\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Questionnaire/qgen-EventDefinition1\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_questionnaire_4(base_settings):\n    \"\"\"No. 4 tests collection for Questionnaire.\n    Test File: eventdefinition-questionnaire.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"eventdefinition-questionnaire.json\"\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_4(inst2)\n\n\ndef impl_questionnaire_5(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert inst.contained[3].id == \"vs5\"\n    assert inst.contained[4].id == \"vs6\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qgen-ActivityDefinition1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"ActivityDefinition-flyover\"\n    assert inst.item[0].item[0].text == (\n        \"This resource allows for the definition of some activity to \"\n        \"be performed, independent of a particular patient, \"\n        \"practitioner, or other performance context.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].linkId == \"ActivityDefinition.id-flyover\"\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"ActivityDefinition.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"ActivityDefinition.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"ActivityDefinition.meta-flyover\"\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"ActivityDefinition.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].linkId\n        == \"ActivityDefinition.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[3].item[1].linkId == \"ActivityDefinition.implicitRules.value\"\n    )\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"ActivityDefinition.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].linkId == \"ActivityDefinition.language-flyover\"\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].answerConstraint == \"optionsOrType\"\n    assert inst.item[0].item[4].item[1].linkId == \"ActivityDefinition.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"coding\"\n    assert inst.item[0].item[4].linkId == \"ActivityDefinition.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"ActivityDefinition.text-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"ActivityDefinition.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"ActivityDefinition.contained-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"ActivityDefinition.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"ActivityDefinition.extension-flyover\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"ActivityDefinition.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].linkId\n        == \"ActivityDefinition.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"ActivityDefinition.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[9].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[0].linkId == \"ActivityDefinition.url-flyover\"\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[1].linkId == \"ActivityDefinition.url.value\"\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == (\n        \"Canonical identifier for this activity definition, \"\n        \"represented as a URI (globally unique)\"\n    )\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"ActivityDefinition.url\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"ActivityDefinition\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == (\n        \"The definition of a specific activity to be taken, \"\n        \"independent of any particular patient or context\"\n    )\n    assert inst.item[0].type == \"group\"\n    assert (\n        inst.publisher == \"Health Level Seven International (Clinical Decision Support)\"\n    )\n    assert inst.status == \"draft\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Questionnaire/qgen-ActivityDefinition1\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_questionnaire_5(base_settings):\n    \"\"\"No. 5 tests collection for Questionnaire.\n    Test File: activitydefinition-questionnaire.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"activitydefinition-questionnaire.json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_5(inst2)\n\n\ndef impl_questionnaire_6(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-28T16:55:11+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qgen-cdshooksguidanceresponse1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].extension[1].valueInteger == 1\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"GuidanceResponse-flyover\"\n    assert inst.item[0].item[0].text == (\n        \"A guidance response is the formal response to a guidance \"\n        \"request, including any output parameters returned by the \"\n        \"evaluation, as well as the description of any proposed \"\n        \"actions to be taken.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].linkId == \"GuidanceResponse.id-flyover\"\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"GuidanceResponse.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"GuidanceResponse.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"GuidanceResponse.meta-flyover\"\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"GuidanceResponse.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].linkId == \"GuidanceResponse.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].item[1].linkId == \"GuidanceResponse.implicitRules.value\"\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"GuidanceResponse.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].linkId == \"GuidanceResponse.language-flyover\"\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].answerConstraint == \"optionsOrType\"\n    assert inst.item[0].item[4].item[1].linkId == \"GuidanceResponse.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"coding\"\n    assert inst.item[0].item[4].linkId == \"GuidanceResponse.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"GuidanceResponse.text-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"GuidanceResponse.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"GuidanceResponse.contained-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"GuidanceResponse.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"GuidanceResponse.extension-flyover\"\n    assert inst.item[0].item[7].item[0].text == \"An Extension\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"GuidanceResponse.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Extension\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].linkId\n        == \"GuidanceResponse.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"GuidanceResponse.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[9].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[1].valueInteger == 1\n    assert (\n        inst.item[0].item[9].extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[2].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId\n        == \"GuidanceResponse.requestIdentifier-flyover\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[9].item[1].linkId\n        == \"GuidanceResponse.requestIdentifier.label\"\n    )\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[2].linkId\n        == \"GuidanceResponse.requestIdentifier.system\"\n    )\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[3].linkId\n        == \"GuidanceResponse.requestIdentifier.value\"\n    )\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"GuidanceResponse.requestIdentifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is True\n    assert inst.item[0].item[9].text == (\n        \"The identifier of the request associated with this response,\" \" if any\"\n    )\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"GuidanceResponse\"\n    assert inst.item[0].repeats is False\n    assert inst.item[0].required is True\n    assert inst.item[0].text == \"The formal response to a guidance request\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == \"HL7\"\n    assert inst.status == \"draft\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/Questionnaire/qgen-cdshooksguidanceresponse1\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_questionnaire_6(base_settings):\n    \"\"\"No. 6 tests collection for Questionnaire.\n    Test File: cdshooksguidanceresponse-questionnaire.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"cdshooksguidanceresponse-questionnaire.json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_6(inst2)\n\n\ndef impl_questionnaire_7(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qgen-SearchParameter1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"SearchParameter-display\"\n    assert inst.item[0].item[0].text == (\n        \"In FHIR, search is not performed directly on a resource (by \"\n        \"XML or JSON path), but on a named parameter that maps into \"\n        \"the resource content.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].linkId == \"SearchParameter-flyover\"\n    assert inst.item[0].item[1].text == (\n        \"A search parameter that defines a named search item that can\"\n        \" be used to search/filter on a resource.\"\n    )\n    assert inst.item[0].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"SearchParameter.id-flyover\"\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].item[1].linkId == \"SearchParameter.id.value\"\n    assert inst.item[0].item[2].item[1].repeats is False\n    assert inst.item[0].item[2].item[1].required is False\n    assert inst.item[0].item[2].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[2].linkId == \"SearchParameter.id\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].linkId == \"SearchParameter.meta-flyover\"\n    assert inst.item[0].item[3].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].linkId == \"SearchParameter.meta\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].text == \"Metadata about the resource\"\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].linkId == \"SearchParameter.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].linkId == \"SearchParameter.implicitRules.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert (\n        inst.item[0].item[4].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[4].item[1].type == \"string\"\n    assert inst.item[0].item[4].linkId == \"SearchParameter.implicitRules\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"SearchParameter.language-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].answerConstraint == \"optionsOrType\"\n    assert inst.item[0].item[5].item[1].linkId == \"SearchParameter.language.value\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"language\"\n    assert inst.item[0].item[5].item[1].type == \"coding\"\n    assert inst.item[0].item[5].linkId == \"SearchParameter.language\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"SearchParameter.text-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"SearchParameter.text\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert (\n        inst.item[0].item[6].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"SearchParameter.contained-flyover\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"SearchParameter.contained\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].linkId == \"SearchParameter.extension-flyover\"\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"SearchParameter.extension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId\n        == \"SearchParameter.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert inst.item[0].item[9].linkId == \"SearchParameter.modifierExtension\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"SearchParameter\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Search parameter for a resource\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.status == \"draft\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Questionnaire/qgen-SearchParameter1\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_questionnaire_7(base_settings):\n    \"\"\"No. 7 tests collection for Questionnaire.\n    Test File: searchparameter-questionnaire.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"searchparameter-questionnaire.json\"\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_7(inst2)\n\n\ndef impl_questionnaire_8(inst):\n    assert inst.contained[0].id == \"vs2\"\n    assert inst.contained[1].id == \"vs3\"\n    assert inst.contained[2].id == \"vs4\"\n    assert inst.contained[3].id == \"vs5\"\n    assert inst.contained[4].id == \"vs6\"\n    assert inst.contained[5].id == \"vs7\"\n    assert inst.contained[6].id == \"vs8\"\n    assert inst.contained[7].id == \"vs9\"\n    assert inst.contained[8].id == \"vs10\"\n    assert inst.contained[9].id == \"vs11\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qgen-ExplanationOfBenefit1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"ExplanationOfBenefit-flyover\"\n    assert inst.item[0].item[0].text == (\n        \"This resource provides: the claim details; adjudication \"\n        \"details from the processing of a Claim; and optionally \"\n        \"account balance information, for informing the subscriber of\"\n        \" the benefits provided.\"\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].linkId == \"ExplanationOfBenefit.id-flyover\"\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"ExplanationOfBenefit.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"ExplanationOfBenefit.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"ExplanationOfBenefit.meta-flyover\"\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"ExplanationOfBenefit.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].linkId\n        == \"ExplanationOfBenefit.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[3].item[1].linkId\n        == \"ExplanationOfBenefit.implicitRules.value\"\n    )\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"ExplanationOfBenefit.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].linkId == \"ExplanationOfBenefit.language-flyover\"\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].answerConstraint == \"optionsOrType\"\n    assert inst.item[0].item[4].item[1].linkId == \"ExplanationOfBenefit.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"coding\"\n    assert inst.item[0].item[4].linkId == \"ExplanationOfBenefit.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"ExplanationOfBenefit.text-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"ExplanationOfBenefit.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].linkId == \"ExplanationOfBenefit.contained-flyover\"\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"ExplanationOfBenefit.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].linkId == \"ExplanationOfBenefit.extension-flyover\"\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"ExplanationOfBenefit.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].linkId\n        == \"ExplanationOfBenefit.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"ExplanationOfBenefit.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId == \"ExplanationOfBenefit.identifier-flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].text\n        == \"A unique identifier assigned to this explanation of benefit.\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[9].item[1].linkId == \"ExplanationOfBenefit.identifier.label\"\n    )\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[2].linkId == \"ExplanationOfBenefit.identifier.system\"\n    )\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[3].linkId == \"ExplanationOfBenefit.identifier.value\"\n    )\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"ExplanationOfBenefit.identifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Business Identifier for the resource\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"ExplanationOfBenefit\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Explanation of Benefit resource\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == \"Health Level Seven International (Financial Management)\"\n    assert inst.status == \"draft\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Questionnaire/qgen-ExplanationOfBenefit1\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_questionnaire_8(base_settings):\n    \"\"\"No. 8 tests collection for Questionnaire.\n    Test File: explanationofbenefit-questionnaire.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"explanationofbenefit-questionnaire.json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_8(inst2)\n\n\ndef impl_questionnaire_9(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qgen-ImmunizationEvaluation1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"ImmunizationEvaluation-flyover\"\n    assert inst.item[0].item[0].text == (\n        \"Describes a comparison of an immunization event against \"\n        \"published recommendations to determine if the administration\"\n        ' is \"valid\" in relation to those  recommendations.'\n    )\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].linkId == \"ImmunizationEvaluation.id-flyover\"\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"ImmunizationEvaluation.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"ImmunizationEvaluation.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"ImmunizationEvaluation.meta-flyover\"\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"ImmunizationEvaluation.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].linkId\n        == \"ImmunizationEvaluation.implicitRules-flyover\"\n    )\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[3].item[1].linkId\n        == \"ImmunizationEvaluation.implicitRules.value\"\n    )\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"ImmunizationEvaluation.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].linkId == \"ImmunizationEvaluation.language-flyover\"\n    )\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].answerConstraint == \"optionsOrType\"\n    assert (\n        inst.item[0].item[4].item[1].linkId == \"ImmunizationEvaluation.language.value\"\n    )\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"coding\"\n    assert inst.item[0].item[4].linkId == \"ImmunizationEvaluation.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"ImmunizationEvaluation.text-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].linkId == \"ImmunizationEvaluation.text\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is False\n    assert (\n        inst.item[0].item[5].text\n        == \"Text summary of the resource, for human interpretation\"\n    )\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].linkId\n        == \"ImmunizationEvaluation.contained-flyover\"\n    )\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].linkId == \"ImmunizationEvaluation.contained\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is False\n    assert inst.item[0].item[6].text == \"Contained, inline Resources\"\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].linkId\n        == \"ImmunizationEvaluation.extension-flyover\"\n    )\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].linkId == \"ImmunizationEvaluation.extension\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is False\n    assert inst.item[0].item[7].text == \"Additional content defined by implementations\"\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].linkId\n        == \"ImmunizationEvaluation.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].linkId == \"ImmunizationEvaluation.modifierExtension\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].text == \"Extensions that cannot be ignored\"\n    assert inst.item[0].item[8].type == \"group\"\n    assert (\n        inst.item[0].item[9].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].extension[0].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[9].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[0].linkId\n        == \"ImmunizationEvaluation.identifier-flyover\"\n    )\n    assert inst.item[0].item[9].item[0].text == (\n        \"A unique identifier assigned to this immunization evaluation\" \" record.\"\n    )\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[9].item[1].linkId == \"ImmunizationEvaluation.identifier.label\"\n    )\n    assert inst.item[0].item[9].item[1].repeats is False\n    assert inst.item[0].item[9].item[1].required is False\n    assert inst.item[0].item[9].item[1].text == \"label:\"\n    assert inst.item[0].item[9].item[1].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[2].linkId\n        == \"ImmunizationEvaluation.identifier.system\"\n    )\n    assert inst.item[0].item[9].item[2].repeats is False\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].text == \"system:\"\n    assert inst.item[0].item[9].item[2].type == \"string\"\n    assert (\n        inst.item[0].item[9].item[3].linkId == \"ImmunizationEvaluation.identifier.value\"\n    )\n    assert inst.item[0].item[9].item[3].repeats is False\n    assert inst.item[0].item[9].item[3].required is False\n    assert inst.item[0].item[9].item[3].text == \"value:\"\n    assert inst.item[0].item[9].item[3].type == \"string\"\n    assert inst.item[0].item[9].linkId == \"ImmunizationEvaluation.identifier\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Business identifier\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"ImmunizationEvaluation\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Immunization evaluation information\"\n    assert inst.item[0].type == \"group\"\n    assert inst.publisher == (\n        \"Health Level Seven International (Public Health and \" \"Emergency Response)\"\n    )\n    assert inst.status == \"draft\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/Questionnaire/qgen-ImmunizationEvaluation1\"\n            }\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_questionnaire_9(base_settings):\n    \"\"\"No. 9 tests collection for Questionnaire.\n    Test File: immunizationevaluation-questionnaire.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"immunizationevaluation-questionnaire.json\"\n    )\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_9(inst2)\n\n\ndef impl_questionnaire_10(inst):\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is False\n    assert inst.id == \"qgen-document-bundle1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"Bundle-flyover\"\n    assert inst.item[0].item[0].text == \"A container the resources of a FHIR document.\"\n    assert inst.item[0].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[1].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[1].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[1].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[1].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[1].item[0].linkId == \"Bundle.id-flyover\"\n    assert inst.item[0].item[1].item[0].type == \"display\"\n    assert inst.item[0].item[1].item[1].linkId == \"Bundle.id.value\"\n    assert inst.item[0].item[1].item[1].repeats is False\n    assert inst.item[0].item[1].item[1].required is False\n    assert inst.item[0].item[1].item[1].text == \"Logical id of this artifact\"\n    assert inst.item[0].item[1].item[1].type == \"string\"\n    assert inst.item[0].item[1].linkId == \"Bundle.id\"\n    assert inst.item[0].item[1].repeats is True\n    assert inst.item[0].item[1].required is False\n    assert inst.item[0].item[1].type == \"group\"\n    assert (\n        inst.item[0].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[2].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[2].item[0].linkId == \"Bundle.meta-flyover\"\n    assert inst.item[0].item[2].item[0].text == (\n        \"The metadata about the resource. This is content that is \"\n        \"maintained by the infrastructure. Changes to the content \"\n        \"might not always be associated with version changes to the \"\n        \"resource.\"\n    )\n    assert inst.item[0].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[2].linkId == \"Bundle.meta\"\n    assert inst.item[0].item[2].repeats is True\n    assert inst.item[0].item[2].required is False\n    assert inst.item[0].item[2].text == \"Metadata about the resource\"\n    assert inst.item[0].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[3].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[3].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[3].extension[1].valueString == \"uri\"\n    assert (\n        inst.item[0].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[3].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[3].item[0].linkId == \"Bundle.implicitRules-flyover\"\n    assert inst.item[0].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[3].item[1].linkId == \"Bundle.implicitRules.value\"\n    assert inst.item[0].item[3].item[1].repeats is False\n    assert inst.item[0].item[3].item[1].required is False\n    assert (\n        inst.item[0].item[3].item[1].text\n        == \"A set of rules under which this content was created\"\n    )\n    assert inst.item[0].item[3].item[1].type == \"string\"\n    assert inst.item[0].item[3].linkId == \"Bundle.implicitRules\"\n    assert inst.item[0].item[3].repeats is True\n    assert inst.item[0].item[3].required is False\n    assert inst.item[0].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[4].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[4].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[4].extension[1].valueString == \"code\"\n    assert (\n        inst.item[0].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[4].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[4].item[0].linkId == \"Bundle.language-flyover\"\n    assert inst.item[0].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[4].item[1].answerConstraint == \"optionsOrType\"\n    assert inst.item[0].item[4].item[1].linkId == \"Bundle.language.value\"\n    assert inst.item[0].item[4].item[1].repeats is False\n    assert inst.item[0].item[4].item[1].required is False\n    assert inst.item[0].item[4].item[1].text == \"language\"\n    assert inst.item[0].item[4].item[1].type == \"coding\"\n    assert inst.item[0].item[4].linkId == \"Bundle.language\"\n    assert inst.item[0].item[4].repeats is True\n    assert inst.item[0].item[4].required is False\n    assert inst.item[0].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[1].valueInteger == 1\n    assert (\n        inst.item[0].item[5].extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[5].extension[2].valueString == \"Identifier\"\n    assert (\n        inst.item[0].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[5].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[5].item[0].linkId == \"Bundle.identifier-flyover\"\n    assert inst.item[0].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[5].item[1].linkId == \"Bundle.identifier.label\"\n    assert inst.item[0].item[5].item[1].repeats is False\n    assert inst.item[0].item[5].item[1].required is False\n    assert inst.item[0].item[5].item[1].text == \"label:\"\n    assert inst.item[0].item[5].item[1].type == \"string\"\n    assert inst.item[0].item[5].item[2].linkId == \"Bundle.identifier.system\"\n    assert inst.item[0].item[5].item[2].repeats is False\n    assert inst.item[0].item[5].item[2].required is False\n    assert inst.item[0].item[5].item[2].text == \"system:\"\n    assert inst.item[0].item[5].item[2].type == \"string\"\n    assert inst.item[0].item[5].item[3].linkId == \"Bundle.identifier.value\"\n    assert inst.item[0].item[5].item[3].repeats is False\n    assert inst.item[0].item[5].item[3].required is False\n    assert inst.item[0].item[5].item[3].text == \"value:\"\n    assert inst.item[0].item[5].item[3].type == \"string\"\n    assert inst.item[0].item[5].linkId == \"Bundle.identifier\"\n    assert inst.item[0].item[5].repeats is True\n    assert inst.item[0].item[5].required is True\n    assert inst.item[0].item[5].text == \"Persistent identifier for the bundle\"\n    assert inst.item[0].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[6].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[1].valueInteger == 1\n    assert (\n        inst.item[0].item[6].extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[6].extension[2].valueString == \"code\"\n    assert (\n        inst.item[0].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[6].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[6].item[0].linkId == \"Bundle.type-flyover\"\n    assert inst.item[0].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[6].item[1].answerConstraint == \"optionsOrType\"\n    assert inst.item[0].item[6].item[1].linkId == \"Bundle.type.value\"\n    assert inst.item[0].item[6].item[1].repeats is False\n    assert inst.item[0].item[6].item[1].required is False\n    assert inst.item[0].item[6].item[1].text == \"type\"\n    assert inst.item[0].item[6].item[1].type == \"coding\"\n    assert inst.item[0].item[6].linkId == \"Bundle.type\"\n    assert inst.item[0].item[6].repeats is True\n    assert inst.item[0].item[6].required is True\n    assert inst.item[0].item[6].type == \"group\"\n    assert (\n        inst.item[0].item[7].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[7].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[7].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[7].extension[1].valueInteger == 1\n    assert (\n        inst.item[0].item[7].extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[7].extension[2].valueString == \"instant\"\n    assert (\n        inst.item[0].item[7].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[7].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[7].item[0].linkId == \"Bundle.timestamp-flyover\"\n    assert inst.item[0].item[7].item[0].type == \"display\"\n    assert inst.item[0].item[7].item[1].linkId == \"Bundle.timestamp.value\"\n    assert inst.item[0].item[7].item[1].repeats is False\n    assert inst.item[0].item[7].item[1].required is False\n    assert inst.item[0].item[7].item[1].text == \"When the bundle was assembled\"\n    assert inst.item[0].item[7].item[1].type == \"dateTime\"\n    assert inst.item[0].item[7].linkId == \"Bundle.timestamp\"\n    assert inst.item[0].item[7].repeats is True\n    assert inst.item[0].item[7].required is True\n    assert inst.item[0].item[7].type == \"group\"\n    assert (\n        inst.item[0].item[8].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[8].extension[0].valueInteger == 0\n    assert (\n        inst.item[0].item[8].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[8].extension[1].valueString == \"integer\"\n    assert (\n        inst.item[0].item[8].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[8].item[0].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[8].item[0].linkId == \"Bundle.total-flyover\"\n    assert inst.item[0].item[8].item[0].type == \"display\"\n    assert inst.item[0].item[8].item[1].linkId == \"Bundle.total.value\"\n    assert inst.item[0].item[8].item[1].repeats is False\n    assert inst.item[0].item[8].item[1].required is False\n    assert inst.item[0].item[8].item[1].text == \"If search, the total number of matches\"\n    assert inst.item[0].item[8].item[1].type == \"integer\"\n    assert inst.item[0].item[8].linkId == \"Bundle.total\"\n    assert inst.item[0].item[8].repeats is True\n    assert inst.item[0].item[8].required is False\n    assert inst.item[0].item[8].type == \"group\"\n    assert inst.item[0].item[9].item[0].linkId == \"Bundle.link-display\"\n    assert inst.item[0].item[9].item[0].type == \"display\"\n    assert (\n        inst.item[0].item[9].item[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[1].extension[0].valueCodeableConcept.coding[0].code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0].item[9].item[1].extension[0].valueCodeableConcept.coding[0].display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0].item[9].item[1].extension[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[1].linkId == \"Bundle.link-flyover\"\n    assert (\n        inst.item[0].item[9].item[1].text\n        == \"A series of links that provide context to this bundle.\"\n    )\n    assert inst.item[0].item[9].item[1].type == \"display\"\n    assert (\n        inst.item[0].item[9].item[2].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[2].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[9].item[2].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[2].extension[1].valueString == \"string\"\n    assert (\n        inst.item[0].item[9].item[2].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[2]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[2]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[2]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[2].item[0].linkId == \"Bundle.link.id-flyover\"\n    assert inst.item[0].item[9].item[2].item[0].text == (\n        \"Unique id for the element within a resource (for internal \"\n        \"references). This may be any string value that does not \"\n        \"contain spaces.\"\n    )\n    assert inst.item[0].item[9].item[2].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[2].item[1].linkId == \"Bundle.link.id.value\"\n    assert inst.item[0].item[9].item[2].item[1].repeats is False\n    assert inst.item[0].item[9].item[2].item[1].required is False\n    assert (\n        inst.item[0].item[9].item[2].item[1].text\n        == \"Unique id for inter-element referencing\"\n    )\n    assert inst.item[0].item[9].item[2].item[1].type == \"string\"\n    assert inst.item[0].item[9].item[2].linkId == \"Bundle.link.id\"\n    assert inst.item[0].item[9].item[2].repeats is True\n    assert inst.item[0].item[9].item[2].required is False\n    assert inst.item[0].item[9].item[2].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[3].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[3]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[3]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[3]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[3].item[0].linkId == \"Bundle.link.extension-flyover\"\n    )\n    assert inst.item[0].item[9].item[3].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[3].linkId == \"Bundle.link.extension\"\n    assert inst.item[0].item[9].item[3].repeats is True\n    assert inst.item[0].item[9].item[3].required is False\n    assert (\n        inst.item[0].item[9].item[3].text\n        == \"Additional content defined by implementations\"\n    )\n    assert inst.item[0].item[9].item[3].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[4].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[4]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[4]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[4]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[0].item[9].item[4].item[0].linkId\n        == \"Bundle.link.modifierExtension-flyover\"\n    )\n    assert inst.item[0].item[9].item[4].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[4].linkId == \"Bundle.link.modifierExtension\"\n    assert inst.item[0].item[9].item[4].repeats is True\n    assert inst.item[0].item[9].item[4].required is False\n    assert (\n        inst.item[0].item[9].item[4].text\n        == \"Extensions that cannot be ignored even if unrecognized\"\n    )\n    assert inst.item[0].item[9].item[4].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[5].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[5].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[9].item[5].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[5].extension[1].valueInteger == 1\n    assert (\n        inst.item[0].item[9].item[5].extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[5].extension[2].valueString == \"code\"\n    assert (\n        inst.item[0].item[9].item[5].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[5]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[5]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[5]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[5].item[0].linkId == \"Bundle.link.relation-flyover\"\n    assert inst.item[0].item[9].item[5].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[5].item[1].answerConstraint == \"optionsOrType\"\n    assert inst.item[0].item[9].item[5].item[1].linkId == \"Bundle.link.relation.value\"\n    assert inst.item[0].item[9].item[5].item[1].repeats is False\n    assert inst.item[0].item[9].item[5].item[1].required is False\n    assert inst.item[0].item[9].item[5].item[1].text == \"relation\"\n    assert inst.item[0].item[9].item[5].item[1].type == \"coding\"\n    assert inst.item[0].item[9].item[5].linkId == \"Bundle.link.relation\"\n    assert inst.item[0].item[9].item[5].repeats is True\n    assert inst.item[0].item[9].item[5].required is True\n    assert inst.item[0].item[9].item[5].type == \"group\"\n    assert (\n        inst.item[0].item[9].item[6].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[6].extension[0].valueInteger == 1\n    assert (\n        inst.item[0].item[9].item[6].extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[6].extension[1].valueInteger == 1\n    assert (\n        inst.item[0].item[9].item[6].extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType\"\n            }\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[6].extension[2].valueString == \"uri\"\n    assert (\n        inst.item[0].item[9].item[6].item[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[6]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .code\n        == \"flyover\"\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[6]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .display\n        == \"Fly-over\"\n    )\n    assert (\n        inst.item[0]\n        .item[9]\n        .item[6]\n        .item[0]\n        .extension[0]\n        .valueCodeableConcept.coding[0]\n        .system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/questionnaire-item-control\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[9].item[6].item[0].linkId == \"Bundle.link.url-flyover\"\n    assert (\n        inst.item[0].item[9].item[6].item[0].text\n        == \"The reference details for the link.\"\n    )\n    assert inst.item[0].item[9].item[6].item[0].type == \"display\"\n    assert inst.item[0].item[9].item[6].item[1].linkId == \"Bundle.link.url.value\"\n    assert inst.item[0].item[9].item[6].item[1].repeats is False\n    assert inst.item[0].item[9].item[6].item[1].required is False\n    assert inst.item[0].item[9].item[6].item[1].text == \"Reference details for the link\"\n    assert inst.item[0].item[9].item[6].item[1].type == \"string\"\n    assert inst.item[0].item[9].item[6].linkId == \"Bundle.link.url\"\n    assert inst.item[0].item[9].item[6].repeats is True\n    assert inst.item[0].item[9].item[6].required is True\n    assert inst.item[0].item[9].item[6].type == \"group\"\n    assert inst.item[0].item[9].linkId == \"Bundle.link\"\n    assert inst.item[0].item[9].repeats is True\n    assert inst.item[0].item[9].required is False\n    assert inst.item[0].item[9].text == \"Links related to this Bundle\"\n    assert inst.item[0].item[9].type == \"group\"\n    assert inst.item[0].linkId == \"Bundle\"\n    assert inst.item[0].repeats is True\n    assert inst.item[0].required is False\n    assert inst.item[0].text == \"Represents a FHIR document\"\n    assert inst.item[0].type == \"group\"\n    assert inst.status == \"active\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Questionnaire/qgen-document-bundle1\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_questionnaire_10(base_settings):\n    \"\"\"No. 10 tests collection for Questionnaire.\n    Test File: document-bundle-questionnaire.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"document-bundle-questionnaire.json\"\n    inst = questionnaire.Questionnaire.model_validate_json(filename.read_bytes())\n    assert \"Questionnaire\" == inst.get_resource_type()\n\n    impl_questionnaire_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Questionnaire\" == data[\"resourceType\"]\n\n    inst2 = questionnaire.Questionnaire(**data)\n    impl_questionnaire_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_questionnaireresponse.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import questionnaireresponse\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_questionnaireresponse_1(inst):\n    assert inst.author.reference == \"#questauth\"\n    assert (\n        inst.authored\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-02-19T14:15:00-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].reference == \"#order\"\n    assert inst.contained[0].id == \"patsub\"\n    assert inst.contained[1].id == \"order\"\n    assert inst.contained[2].id == \"questauth\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"3141\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/fhir/NamingSystem/questionnaire-ids\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"Q12349876\"\n    assert (\n        inst.item[0].item[0].answer[0].item[0].item[0].answer[0].valueCoding.code == \"1\"\n    )\n    assert (\n        inst.item[0].item[0].answer[0].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://cancer.questionnaire.org/system/code/yesno\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].answer[0].item[0].item[0].linkId == \"1.1.1.1\"\n    assert (\n        inst.item[0].item[0].answer[0].item[0].item[1].answer[0].valueCoding.code == \"1\"\n    )\n    assert (\n        inst.item[0].item[0].answer[0].item[0].item[1].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://cancer.questionnaire.org/system/code/yesno\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].answer[0].item[0].item[1].linkId == \"1.1.1.2\"\n    assert (\n        inst.item[0].item[0].answer[0].item[0].item[2].answer[0].valueCoding.code == \"0\"\n    )\n    assert (\n        inst.item[0].item[0].answer[0].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://cancer.questionnaire.org/system/code/yesno\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].answer[0].item[0].item[2].linkId == \"1.1.1.3\"\n    assert inst.item[0].item[0].answer[0].item[0].linkId == \"1.1.1\"\n    assert inst.item[0].item[0].answer[0].valueCoding.code == \"1\"\n    assert inst.item[0].item[0].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://cancer.questionnaire.org/system/code/yesno\"}\n        ).valueUri\n    )\n    assert inst.item[0].item[0].linkId == \"1.1\"\n    assert inst.item[0].linkId == \"1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.partOf[0].reference == \"Procedure/f201\"\n    assert inst.questionnaire == \"urn:uuid:95eaedf7-8a24-478a-8300-39acc44c746b\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"#patsub\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_questionnaireresponse_1(base_settings):\n    \"\"\"No. 1 tests collection for QuestionnaireResponse.\n    Test File: questionnaireresponse-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"questionnaireresponse-example.json\"\n    inst = questionnaireresponse.QuestionnaireResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"QuestionnaireResponse\" == inst.get_resource_type()\n\n    impl_questionnaireresponse_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"QuestionnaireResponse\" == data[\"resourceType\"]\n\n    inst2 = questionnaireresponse.QuestionnaireResponse(**data)\n    impl_questionnaireresponse_1(inst2)\n\n\ndef impl_questionnaireresponse_2(inst):\n    assert (\n        inst.authored\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2008-01-17\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"ussg-fht-answers\"\n    assert (\n        inst.item[0].item[0].answer[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2008-01-17\"}).valueDate\n    )\n    assert inst.item[0].item[0].linkId == \"0.1\"\n    assert inst.item[0].item[0].text == \"Date Done\"\n    assert inst.item[0].linkId == \"0\"\n    assert (\n        inst.item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54126-8\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[0].answer[0].valueString == \"Annie Proband\"\n    assert (\n        inst.item[1].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54125-0\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[0].linkId == \"1.1.1\"\n    assert inst.item[1].item[0].item[0].text == \"Name\"\n    assert inst.item[1].item[0].item[1].answer[0].valueCoding.code == \"LA3-6\"\n    assert inst.item[1].item[0].item[1].answer[0].valueCoding.display == \"Female\"\n    assert (\n        inst.item[1].item[0].item[1].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[1].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54131-8\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[1].linkId == \"1.1.2\"\n    assert inst.item[1].item[0].item[1].text == \"Gender\"\n    assert (\n        inst.item[1].item[0].item[2].answer[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1966-04-04\"}).valueDate\n    )\n    assert (\n        inst.item[1].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/21112-8\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[2].linkId == \"1.1.3\"\n    assert inst.item[1].item[0].item[2].text == \"Date of Birth\"\n    assert inst.item[1].item[0].item[3].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[1].item[0].item[3].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[1].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[1].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54132-6\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[3].linkId == \"1.1.4\"\n    assert inst.item[1].item[0].item[3].text == \"Were you born a twin?\"\n    assert inst.item[1].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[1].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[1].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[1].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54128-4\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[4].linkId == \"1.1.5\"\n    assert inst.item[1].item[0].item[4].text == \"Were you adopted?\"\n    assert inst.item[1].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[1].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[1].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[1].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54135-9\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[5].linkId == \"1.1.6\"\n    assert inst.item[1].item[0].item[5].text == (\n        \"Are your parents related to each other in any way other than\" \" marriage?\"\n    )\n    assert (\n        inst.item[1]\n        .item[0]\n        .item[6]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.code\n        == \"[in_i]\"\n    )\n    assert (\n        inst.item[1]\n        .item[0]\n        .item[6]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.display\n        == \"inches\"\n    )\n    assert (\n        inst.item[1]\n        .item[0]\n        .item[6]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[6].answer[0].item[0].item[0].linkId == \"1.1.7.1.1\"\n    assert inst.item[1].item[0].item[6].answer[0].item[0].item[0].text == \"Units\"\n    assert inst.item[1].item[0].item[6].answer[0].item[0].linkId == \"1.1.7.1\"\n    assert float(inst.item[1].item[0].item[6].answer[0].valueDecimal) == float(63)\n    assert (\n        inst.item[1].item[0].item[6].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/8302-2\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[6].linkId == \"1.1.7\"\n    assert inst.item[1].item[0].item[6].text == \"Height\"\n    assert (\n        inst.item[1]\n        .item[0]\n        .item[7]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.code\n        == \"[lb_av]\"\n    )\n    assert (\n        inst.item[1]\n        .item[0]\n        .item[7]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.display\n        == \"pounds\"\n    )\n    assert (\n        inst.item[1]\n        .item[0]\n        .item[7]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[7].answer[0].item[0].item[0].linkId == \"1.1.8.1.1\"\n    assert inst.item[1].item[0].item[7].answer[0].item[0].item[0].text == \"Units\"\n    assert inst.item[1].item[0].item[7].answer[0].item[0].linkId == \"1.1.8.1\"\n    assert float(inst.item[1].item[0].item[7].answer[0].valueDecimal) == float(127)\n    assert (\n        inst.item[1].item[0].item[7].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/29463-7\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[7].linkId == \"1.1.8\"\n    assert inst.item[1].item[0].item[7].text == \"Weight\"\n    assert float(inst.item[1].item[0].item[8].answer[0].valueDecimal) == float(22.5)\n    assert (\n        inst.item[1].item[0].item[8].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/39156-5\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[8].linkId == \"1.1.9\"\n    assert inst.item[1].item[0].item[8].text == \"Body mass index (BMI) [Ratio]\"\n    assert inst.item[1].item[0].item[9].answer[0].valueCoding.code == \"LA4457-3\"\n    assert inst.item[1].item[0].item[9].answer[0].valueCoding.display == \"White\"\n    assert (\n        inst.item[1].item[0].item[9].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[1].item[0].item[9].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54134-2\"}\n        ).valueUri\n    )\n    assert inst.item[1].item[0].item[9].linkId == \"1.1.10\"\n    assert inst.item[1].item[0].item[9].text == \"Race\"\n    assert inst.item[1].item[0].linkId == \"1.1\"\n    assert inst.item[1].linkId == \"1\"\n    assert inst.item[1].text == \"Your health information\"\n    assert (\n        inst.item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54114-4\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[0].answer[0].valueCoding.code == \"LA10405-1\"\n    assert inst.item[2].item[0].item[0].answer[0].valueCoding.display == \"Daughter\"\n    assert (\n        inst.item[2].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[0].item[1].answer[0].valueString == \"Susan\"\n    assert (\n        inst.item[2].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[0].item[2].answer[0].valueCoding.code == \"LA3-6\"\n    assert inst.item[2].item[0].item[2].answer[0].valueCoding.display == \"Female\"\n    assert (\n        inst.item[2].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2].item[0].item[3].answer[0].item[0].item[0].answer[0].valueDecimal\n    ) == float(17)\n    assert (\n        inst.item[2].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[0].item[3].answer[0].item[0].item[0].linkId == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[0].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[1].item[0].item[0].answer[0].valueCoding.code == \"LA10415-0\"\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[0].answer[0].valueCoding.display == \"Brother\"\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[1].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[1].item[0].item[1].answer[0].valueString == \"Brian\"\n    assert (\n        inst.item[2].item[1].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[1].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[1].item[0].item[2].answer[0].valueCoding.code == \"LA2-8\"\n    assert inst.item[2].item[1].item[0].item[2].answer[0].valueCoding.display == \"Male\"\n    assert (\n        inst.item[2].item[1].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[1].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[1]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(32)\n    assert (\n        inst.item[2].item[1].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[1].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[1].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[1].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[1].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[1].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[1].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[1].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[1].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[1].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[1].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[1].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[1].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[1].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[1].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[1].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[1].item[0].linkId == \"2.1.1\"\n    assert (\n        inst.item[2].item[1].item[1].item[0].answer[0].valueCoding.code == \"LA10550-4\"\n    )\n    assert (\n        inst.item[2].item[1].item[1].item[0].answer[0].valueCoding.display\n        == \"-- Other Cancer\"\n    )\n    assert (\n        inst.item[2].item[1].item[1].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[1].item[0].linkId == \"2.1.2.1\"\n    assert inst.item[2].item[1].item[1].item[0].text == \"Disease or Condition\"\n    assert (\n        inst.item[2].item[1].item[1].item[1].answer[0].valueCoding.code == \"LA10397-0\"\n    )\n    assert inst.item[2].item[1].item[1].item[1].answer[0].valueCoding.display == \"30-39\"\n    assert (\n        inst.item[2].item[1].item[1].item[1].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[1].item[1].item[1].linkId == \"2.1.2.2\"\n    assert inst.item[2].item[1].item[1].item[1].text == \"Age at Diagnosis\"\n    assert inst.item[2].item[1].item[1].linkId == \"2.1.2\"\n    assert (\n        inst.item[2].item[1].item[1].text == \"This family member's history of disease\"\n    )\n    assert inst.item[2].item[1].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[2].item[0].item[0].answer[0].valueCoding.code == \"LA10418-4\"\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[0].answer[0].valueCoding.display == \"Sister\"\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[2].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[2].item[0].item[1].answer[0].valueString == \"Janet\"\n    assert (\n        inst.item[2].item[2].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[2].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[2].item[0].item[2].answer[0].valueCoding.code == \"LA3-6\"\n    assert (\n        inst.item[2].item[2].item[0].item[2].answer[0].valueCoding.display == \"Female\"\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[2].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[2]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(36)\n    assert (\n        inst.item[2].item[2].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[2].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[2].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[2].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[2].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[2].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[2].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[2].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[2].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[2].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[2].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[2].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[2].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[2].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[2].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[2].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[2].item[0].linkId == \"2.1.1\"\n    assert (\n        inst.item[2].item[2].item[1].item[0].answer[0].valueCoding.code == \"LA10536-3\"\n    )\n    assert (\n        inst.item[2].item[2].item[1].item[0].answer[0].valueCoding.display\n        == \"-- Breast Cancer\"\n    )\n    assert (\n        inst.item[2].item[2].item[1].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[1].item[0].linkId == \"2.1.2.1\"\n    assert inst.item[2].item[2].item[1].item[0].text == \"Disease or Condition\"\n    assert (\n        inst.item[2].item[2].item[1].item[1].answer[0].valueCoding.code == \"LA10397-0\"\n    )\n    assert inst.item[2].item[2].item[1].item[1].answer[0].valueCoding.display == \"30-39\"\n    assert (\n        inst.item[2].item[2].item[1].item[1].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[2].item[1].item[1].linkId == \"2.1.2.2\"\n    assert inst.item[2].item[2].item[1].item[1].text == \"Age at Diagnosis\"\n    assert inst.item[2].item[2].item[1].linkId == \"2.1.2\"\n    assert (\n        inst.item[2].item[2].item[1].text == \"This family member's history of disease\"\n    )\n    assert inst.item[2].item[2].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[3].item[0].item[0].answer[0].valueCoding.code == \"LA10419-2\"\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[0].answer[0].valueCoding.display == \"Nephew\"\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[3].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[3].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[3].item[0].item[1].answer[0].valueString == \"Ian\"\n    assert (\n        inst.item[2].item[3].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[3].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[3].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[3].item[0].item[2].answer[0].valueCoding.code == \"LA2-8\"\n    assert inst.item[2].item[3].item[0].item[2].answer[0].valueCoding.display == \"Male\"\n    assert (\n        inst.item[2].item[3].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[3].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[3].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[3]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(16)\n    assert (\n        inst.item[2].item[3].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[3].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[3].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[3].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[3].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[3].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[3].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[3].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[3].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[3].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[3].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[3].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[3].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[3].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[3].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[3].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[3].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[3].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[3].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[3].item[0].linkId == \"2.1.1\"\n    assert inst.item[2].item[3].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[4].item[0].item[0].answer[0].valueCoding.code == \"LA10420-0\"\n    )\n    assert inst.item[2].item[4].item[0].item[0].answer[0].valueCoding.display == \"Niece\"\n    assert (\n        inst.item[2].item[4].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[4].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[4].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[4].item[0].item[1].answer[0].valueString == \"Helen\"\n    assert (\n        inst.item[2].item[4].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[4].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[4].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[4].item[0].item[2].answer[0].valueCoding.code == \"LA3-6\"\n    assert (\n        inst.item[2].item[4].item[0].item[2].answer[0].valueCoding.display == \"Female\"\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[4].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[4].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[4]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(15)\n    assert (\n        inst.item[2].item[4].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[4].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[4].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[4].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[4].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[4].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[4].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[4].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[4].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[4].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[4].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[4].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[4].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[4].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[4].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[4].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[4].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[4].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[4].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[4].item[0].linkId == \"2.1.1\"\n    assert inst.item[2].item[4].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[5].item[0].item[0].answer[0].valueCoding.code == \"LA10416-8\"\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[0].answer[0].valueCoding.display == \"Father\"\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[5].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[5].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[5].item[0].item[1].answer[0].valueString == \"Donald\"\n    assert (\n        inst.item[2].item[5].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[5].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[5].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[5].item[0].item[2].answer[0].valueCoding.code == \"LA2-8\"\n    assert inst.item[2].item[5].item[0].item[2].answer[0].valueCoding.display == \"Male\"\n    assert (\n        inst.item[2].item[5].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[5].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[5].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[5]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(52)\n    assert (\n        inst.item[2].item[5].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[5].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[5].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[5].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[5].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[5].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[5].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[5].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[5].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[5].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[5].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[5].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[5].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[5].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[5].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[5].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[5].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[5].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[5].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[5].item[0].linkId == \"2.1.1\"\n    assert inst.item[2].item[5].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[6].item[0].item[0].answer[0].valueCoding.code == \"LA10425-9\"\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[0].answer[0].valueCoding.display\n        == \"Paternal Uncle\"\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[6].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[6].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[6].item[0].item[1].answer[0].valueString == \"Eric\"\n    assert (\n        inst.item[2].item[6].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[6].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[6].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[6].item[0].item[2].answer[0].valueCoding.code == \"LA2-8\"\n    assert inst.item[2].item[6].item[0].item[2].answer[0].valueCoding.display == \"Male\"\n    assert (\n        inst.item[2].item[6].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[6].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[6].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[6]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(56)\n    assert (\n        inst.item[2].item[6].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[6].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[6].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[6].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[6].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[6].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[6].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[6].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[6].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[6].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[6].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[6].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[6].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[6].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[6].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[6].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[6].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[6].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[6].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[6].item[0].linkId == \"2.1.1\"\n    assert inst.item[2].item[6].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[7].item[0].item[0].answer[0].valueCoding.code == \"LA10421-8\"\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[0].answer[0].valueCoding.display\n        == \"Paternal Aunt\"\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[7].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[7].item[0].item[1].answer[0].valueString == \"Fiona\"\n    assert (\n        inst.item[2].item[7].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[7].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[7].item[0].item[2].answer[0].valueCoding.code == \"LA3-6\"\n    assert (\n        inst.item[2].item[7].item[0].item[2].answer[0].valueCoding.display == \"Female\"\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[7].item[0].item[2].text == \"Gender\"\n    assert float(\n        inst.item[2]\n        .item[7]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueDecimal\n    ) == float(57)\n    assert (\n        inst.item[2].item[7].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54141-7\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.2.2\"\n    )\n    assert inst.item[2].item[7].item[0].item[3].answer[0].item[0].item[0].text == \"Age\"\n    assert inst.item[2].item[7].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.2\"\n    assert inst.item[2].item[7].item[0].item[3].answer[0].valueCoding.code == \"LA33-6\"\n    assert inst.item[2].item[7].item[0].item[3].answer[0].valueCoding.display == \"Yes\"\n    assert (\n        inst.item[2].item[7].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[7].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[7].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[7].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[7].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[7].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[7].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[7].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[7].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[7].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[7].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[7].item[0].linkId == \"2.1.1\"\n    assert (\n        inst.item[2].item[7].item[1].item[0].answer[0].valueCoding.code == \"LA10543-9\"\n    )\n    assert (\n        inst.item[2].item[7].item[1].item[0].answer[0].valueCoding.display\n        == \"-- Skin Cancer\"\n    )\n    assert (\n        inst.item[2].item[7].item[1].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[7].item[1].item[0].linkId == \"2.1.2.1\"\n    assert inst.item[2].item[7].item[1].item[0].text == \"Disease or Condition\"\n    assert inst.item[2].item[7].item[1].linkId == \"2.1.2\"\n    assert (\n        inst.item[2].item[7].item[1].text == \"This family member's history of disease\"\n    )\n    assert inst.item[2].item[7].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[8].item[0].item[0].answer[0].valueCoding.code == \"LA10423-4\"\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[0].answer[0].valueCoding.display\n        == \"Paternal Grandfather\"\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[8].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[8].item[0].item[1].answer[0].valueString == \"Bob\"\n    assert (\n        inst.item[2].item[8].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[8].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[8].item[0].item[2].answer[0].valueCoding.code == \"LA2-8\"\n    assert inst.item[2].item[8].item[0].item[2].answer[0].valueCoding.display == \"Male\"\n    assert (\n        inst.item[2].item[8].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[8].item[0].item[2].text == \"Gender\"\n    assert (\n        inst.item[2]\n        .item[8]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.code\n        == \"LA10537-1\"\n    )\n    assert (\n        inst.item[2]\n        .item[8]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.display\n        == \"-- Colon Cancer\"\n    )\n    assert (\n        inst.item[2]\n        .item[8]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54112-8\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.1.1\"\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[0].text\n        == \"Cause of Death\"\n    )\n    assert (\n        inst.item[2]\n        .item[8]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[1]\n        .answer[0]\n        .valueCoding.code\n        == \"LA10400-2\"\n    )\n    assert (\n        inst.item[2]\n        .item[8]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[1]\n        .answer[0]\n        .valueCoding.display\n        == \"OVER 60\"\n    )\n    assert (\n        inst.item[2]\n        .item[8]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[1]\n        .answer[0]\n        .valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54113-6\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[1].linkId\n        == \"2.1.1.4.1.2\"\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].item[0].item[1].text\n        == \"Age at Death\"\n    )\n    assert inst.item[2].item[8].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.1\"\n    assert inst.item[2].item[8].item[0].item[3].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[8].item[0].item[3].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[8].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[8].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[8].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[8].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[8].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[8].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[8].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[8].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[8].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[8].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[8].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[8].item[0].linkId == \"2.1.1\"\n    assert (\n        inst.item[2].item[8].item[1].item[0].answer[0].valueCoding.code == \"LA10537-1\"\n    )\n    assert (\n        inst.item[2].item[8].item[1].item[0].answer[0].valueCoding.display\n        == \"-- Colon Cancer\"\n    )\n    assert (\n        inst.item[2].item[8].item[1].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[1].item[0].linkId == \"2.1.2.1\"\n    assert inst.item[2].item[8].item[1].item[0].text == \"Disease or Condition\"\n    assert (\n        inst.item[2].item[8].item[1].item[1].answer[0].valueCoding.code == \"LA10400-2\"\n    )\n    assert (\n        inst.item[2].item[8].item[1].item[1].answer[0].valueCoding.display == \"OVER 60\"\n    )\n    assert (\n        inst.item[2].item[8].item[1].item[1].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[8].item[1].item[1].linkId == \"2.1.2.2\"\n    assert inst.item[2].item[8].item[1].item[1].text == \"Age at Diagnosis\"\n    assert inst.item[2].item[8].item[1].linkId == \"2.1.2\"\n    assert (\n        inst.item[2].item[8].item[1].text == \"This family member's history of disease\"\n    )\n    assert inst.item[2].item[8].linkId == \"2.1\"\n    assert (\n        inst.item[2].item[9].item[0].item[0].answer[0].valueCoding.code == \"LA10424-2\"\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[0].answer[0].valueCoding.display\n        == \"Paternal Grandmother\"\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54136-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[9].item[0].item[0].linkId == \"2.1.1.1\"\n    assert inst.item[2].item[9].item[0].item[0].text == \"Relationship to you\"\n    assert inst.item[2].item[9].item[0].item[1].answer[0].valueString == \"Claire\"\n    assert (\n        inst.item[2].item[9].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54138-3\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[9].item[0].item[1].linkId == \"2.1.1.2\"\n    assert inst.item[2].item[9].item[0].item[1].text == \"Name\"\n    assert inst.item[2].item[9].item[0].item[2].answer[0].valueCoding.code == \"LA3-6\"\n    assert (\n        inst.item[2].item[9].item[0].item[2].answer[0].valueCoding.display == \"Female\"\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[2].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54123-5\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[9].item[0].item[2].linkId == \"2.1.1.3\"\n    assert inst.item[2].item[9].item[0].item[2].text == \"Gender\"\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .item[0]\n        .answer[0]\n        .valueString\n        == \"Lou Gehrigs\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .item[0]\n        .linkId\n        == \"2.1.1.4.1.1.1\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .item[0]\n        .text\n        == \"Please specify\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.code\n        == \"LA10589-2\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.display\n        == \"-- Other/Unexpected\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[0]\n        .answer[0]\n        .valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[0].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54112-8\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[0].linkId\n        == \"2.1.1.4.1.1\"\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[0].text\n        == \"Cause of Death\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[1]\n        .answer[0]\n        .valueCoding.code\n        == \"LA10400-2\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[1]\n        .answer[0]\n        .valueCoding.display\n        == \"OVER 60\"\n    )\n    assert (\n        inst.item[2]\n        .item[9]\n        .item[0]\n        .item[3]\n        .answer[0]\n        .item[0]\n        .item[1]\n        .answer[0]\n        .valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[1].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54113-6\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[1].linkId\n        == \"2.1.1.4.1.2\"\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].item[0].item[1].text\n        == \"Age at Death\"\n    )\n    assert inst.item[2].item[9].item[0].item[3].answer[0].item[0].linkId == \"2.1.1.4.1\"\n    assert inst.item[2].item[9].item[0].item[3].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[9].item[0].item[3].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[9].item[0].item[3].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[3].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54139-1\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[9].item[0].item[3].linkId == \"2.1.1.4\"\n    assert inst.item[2].item[9].item[0].item[3].text == \"Living?\"\n    assert inst.item[2].item[9].item[0].item[4].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[9].item[0].item[4].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[9].item[0].item[4].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[4].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54121-9\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[9].item[0].item[4].linkId == \"2.1.1.5\"\n    assert inst.item[2].item[9].item[0].item[4].text == \"Was this person born a twin?\"\n    assert inst.item[2].item[9].item[0].item[5].answer[0].valueCoding.code == \"LA32-8\"\n    assert inst.item[2].item[9].item[0].item[5].answer[0].valueCoding.display == \"No\"\n    assert (\n        inst.item[2].item[9].item[0].item[5].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert (\n        inst.item[2].item[9].item[0].item[5].definition\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org/fhir/DataElement/54122-7\"}\n        ).valueUri\n    )\n    assert inst.item[2].item[9].item[0].item[5].linkId == \"2.1.1.6\"\n    assert inst.item[2].item[9].item[0].item[5].text == \"Was this person adopted?\"\n    assert inst.item[2].item[9].item[0].linkId == \"2.1.1\"\n    assert inst.item[2].item[9].linkId == \"2.1\"\n    assert inst.item[2].linkId == \"2\"\n    assert inst.item[2].text == \"Family member health information\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.questionnaire == \"http://hl7.org/fhir/Questionnaire/ussg-fht\"\n    assert inst.status == \"in-progress\"\n    assert inst.subject.reference == \"http://hl7.org/fhir/Patient/proband\"\n    assert (\n        inst.subject.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_questionnaireresponse_2(base_settings):\n    \"\"\"No. 2 tests collection for QuestionnaireResponse.\n    Test File: questionnaireresponse-example-ussg-fht-answers.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaireresponse-example-ussg-fht-answers.json\"\n    )\n    inst = questionnaireresponse.QuestionnaireResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"QuestionnaireResponse\" == inst.get_resource_type()\n\n    impl_questionnaireresponse_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"QuestionnaireResponse\" == data[\"resourceType\"]\n\n    inst2 = questionnaireresponse.QuestionnaireResponse(**data)\n    impl_questionnaireresponse_2(inst2)\n\n\ndef impl_questionnaireresponse_3(inst):\n    assert inst.author.reference == \"Practitioner/f201\"\n    assert (\n        inst.authored\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-06-18T00:00:00+01:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"f201\"\n    assert inst.item[0].answer[0].valueBoolean is True\n    assert inst.item[0].linkId == \"1\"\n    assert inst.item[0].text == \"Do you have allergies?\"\n    assert inst.item[1].item[0].answer[0].valueString == \"Male\"\n    assert inst.item[1].item[0].linkId == \"2.1\"\n    assert inst.item[1].item[0].text == \"What is your gender?\"\n    assert (\n        inst.item[1].item[1].answer[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1960-03-13\"}).valueDate\n    )\n    assert inst.item[1].item[1].linkId == \"2.2\"\n    assert inst.item[1].item[1].text == \"What is your date of birth?\"\n    assert inst.item[1].item[2].answer[0].valueString == \"The Netherlands\"\n    assert inst.item[1].item[2].linkId == \"2.3\"\n    assert inst.item[1].item[2].text == \"What is your country of birth?\"\n    assert inst.item[1].item[3].answer[0].valueString == \"married\"\n    assert inst.item[1].item[3].linkId == \"2.4\"\n    assert inst.item[1].item[3].text == \"What is your marital status?\"\n    assert inst.item[1].linkId == \"2\"\n    assert inst.item[1].text == \"General questions\"\n    assert inst.item[2].item[0].answer[0].valueBoolean is False\n    assert inst.item[2].item[0].linkId == \"3.1\"\n    assert inst.item[2].item[0].text == \"Do you smoke?\"\n    assert inst.item[2].item[1].answer[0].valueBoolean is False\n    assert inst.item[2].item[1].linkId == \"3.2\"\n    assert inst.item[2].item[1].text == \"Do you drink alchohol?\"\n    assert inst.item[2].linkId == \"3\"\n    assert inst.item[2].text == \"Intoxications\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.source.reference == \"Practitioner/f201\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Roel\"\n    assert inst.subject.reference == \"Patient/f201\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_questionnaireresponse_3(base_settings):\n    \"\"\"No. 3 tests collection for QuestionnaireResponse.\n    Test File: questionnaireresponse-example-f201-lifelines.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaireresponse-example-f201-lifelines.json\"\n    )\n    inst = questionnaireresponse.QuestionnaireResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"QuestionnaireResponse\" == inst.get_resource_type()\n\n    impl_questionnaireresponse_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"QuestionnaireResponse\" == data[\"resourceType\"]\n\n    inst2 = questionnaireresponse.QuestionnaireResponse(**data)\n    impl_questionnaireresponse_3(inst2)\n\n\ndef impl_questionnaireresponse_4(inst):\n    assert inst.author.reference == \"http://hl7.org/fhir/Practitioner/example\"\n    assert (\n        inst.author.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Practitioner\"}).valueUri\n    )\n    assert (\n        inst.authored\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-02-19T14:15:00+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"bb\"\n    assert inst.item[0].item[0].item[0].answer[0].valueString == \"Cathy Jones\"\n    assert inst.item[0].item[0].item[0].linkId == \"nameOfChild\"\n    assert inst.item[0].item[0].item[0].text == \"Name of child\"\n    assert inst.item[0].item[0].item[1].answer[0].valueCoding.code == \"F\"\n    assert inst.item[0].item[0].item[1].linkId == \"sex\"\n    assert inst.item[0].item[0].item[1].text == \"Sex\"\n    assert inst.item[0].item[0].linkId == \"group\"\n    assert float(inst.item[0].item[1].item[0].answer[0].valueDecimal) == float(3.25)\n    assert inst.item[0].item[1].item[0].linkId == \"birthWeight\"\n    assert inst.item[0].item[1].item[0].text == \"Birth weight (kg)\"\n    assert float(inst.item[0].item[1].item[1].answer[0].valueDecimal) == float(44.3)\n    assert inst.item[0].item[1].item[1].linkId == \"birthLength\"\n    assert inst.item[0].item[1].item[1].text == \"Birth length (cm)\"\n    assert (\n        inst.item[0].item[1].item[2].answer[0].item[0].item[0].answer[0].valueDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1972-11-30\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.item[0].item[1].item[2].answer[0].item[0].item[0].linkId == \"vitaminKDose1\"\n    )\n    assert inst.item[0].item[1].item[2].answer[0].item[0].item[0].text == \"1st dose\"\n    assert (\n        inst.item[0].item[1].item[2].answer[0].item[0].item[1].answer[0].valueDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1972-12-11\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.item[0].item[1].item[2].answer[0].item[0].item[1].linkId == \"vitaminKDose2\"\n    )\n    assert inst.item[0].item[1].item[2].answer[0].item[0].item[1].text == \"2nd dose\"\n    assert inst.item[0].item[1].item[2].answer[0].item[0].linkId == \"vitaminKgivenDoses\"\n    assert inst.item[0].item[1].item[2].answer[0].valueCoding.code == \"INJECTION\"\n    assert inst.item[0].item[1].item[2].linkId == \"vitaminKgiven\"\n    assert inst.item[0].item[1].item[2].text == \"Vitamin K given\"\n    assert (\n        inst.item[0].item[1].item[3].answer[0].item[0].answer[0].valueDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1972-12-04\"}).valueDate\n    )\n    assert inst.item[0].item[1].item[3].answer[0].item[0].linkId == \"hepBgivenDate\"\n    assert inst.item[0].item[1].item[3].answer[0].item[0].text == \"Date given\"\n    assert inst.item[0].item[1].item[3].answer[0].valueBoolean is True\n    assert inst.item[0].item[1].item[3].linkId == \"hepBgiven\"\n    assert inst.item[0].item[1].item[3].text == \"Hep B given y / n\"\n    assert (\n        inst.item[0].item[1].item[4].answer[0].valueString\n        == \"Already able to speak Chinese\"\n    )\n    assert inst.item[0].item[1].item[4].linkId == \"abnormalitiesAtBirth\"\n    assert inst.item[0].item[1].item[4].text == \"Abnormalities noted at birth\"\n    assert inst.item[0].item[1].linkId == \"neonatalInformation\"\n    assert inst.item[0].item[1].text == \"Neonatal Information\"\n    assert inst.item[0].linkId == \"birthDetails\"\n    assert inst.item[0].text == \"Birth details - To be completed by health professional\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.questionnaire == \"http://hl7.org/fhir/Questionnaire/bb\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"http://hl7.org/fhir/Patient/1\"\n    assert (\n        inst.subject.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_questionnaireresponse_4(base_settings):\n    \"\"\"No. 4 tests collection for QuestionnaireResponse.\n    Test File: questionnaireresponse-example-bluebook.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"questionnaireresponse-example-bluebook.json\"\n    )\n    inst = questionnaireresponse.QuestionnaireResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"QuestionnaireResponse\" == inst.get_resource_type()\n\n    impl_questionnaireresponse_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"QuestionnaireResponse\" == data[\"resourceType\"]\n\n    inst2 = questionnaireresponse.QuestionnaireResponse(**data)\n    impl_questionnaireresponse_4(inst2)\n\n\ndef impl_questionnaireresponse_5(inst):\n    assert (\n        inst.authored\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-12-11T04:44:16Z\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"gcs\"\n    assert inst.item[0].answer[0].valueCoding.code == \"LA6560-2\"\n    assert inst.item[0].answer[0].valueCoding.display == \"Confused\"\n    assert (\n        inst.item[0].answer[0].valueCoding.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/itemWeight\"}\n        ).valueUri\n    )\n    assert float(inst.item[0].answer[0].valueCoding.extension[0].valueDecimal) == float(\n        4\n    )\n    assert (\n        inst.item[0].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[0].linkId == \"1.1\"\n    assert inst.item[1].answer[0].valueCoding.code == \"LA6566-9\"\n    assert inst.item[1].answer[0].valueCoding.display == \"Localizing pain\"\n    assert (\n        inst.item[1].answer[0].valueCoding.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/itemWeight\"}\n        ).valueUri\n    )\n    assert float(inst.item[1].answer[0].valueCoding.extension[0].valueDecimal) == float(\n        5\n    )\n    assert (\n        inst.item[1].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[1].linkId == \"1.2\"\n    assert inst.item[2].answer[0].valueCoding.code == \"LA6556-0\"\n    assert inst.item[2].answer[0].valueCoding.display == \"Eyes open spontaneously\"\n    assert (\n        inst.item[2].answer[0].valueCoding.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/itemWeight\"}\n        ).valueUri\n    )\n    assert float(inst.item[2].answer[0].valueCoding.extension[0].valueDecimal) == float(\n        4\n    )\n    assert (\n        inst.item[2].answer[0].valueCoding.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://loinc.org\"}\n        ).valueUri\n    )\n    assert inst.item[2].linkId == \"1.3\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.questionnaire == \"http://hl7.org/fhir/Questionnaire/gcs\"\n    assert inst.source.reference == \"Practitioner/f007\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Peter James Chalmers\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_questionnaireresponse_5(base_settings):\n    \"\"\"No. 5 tests collection for QuestionnaireResponse.\n    Test File: questionnaireresponse-example-gcs.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"questionnaireresponse-example-gcs.json\"\n    )\n    inst = questionnaireresponse.QuestionnaireResponse.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"QuestionnaireResponse\" == inst.get_resource_type()\n\n    impl_questionnaireresponse_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"QuestionnaireResponse\" == data[\"resourceType\"]\n\n    inst2 = questionnaireresponse.QuestionnaireResponse(**data)\n    impl_questionnaireresponse_5(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_regulatedauthorization.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RegulatedAuthorization\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import regulatedauthorization\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_regulatedauthorization_1(inst):\n    assert inst.holder.display == \"EquiliDrugCo Holdings Inc.\"\n    assert inst.holder.reference == \"Organization/EqlidrugCo\"\n    assert inst.id == \"basic-drug-auth\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.regulator.display == \"FDA\"\n    assert inst.regulator.reference == \"Organization/FDA\"\n    assert inst.status.coding[0].code == \"active\"\n    assert (\n        inst.statusDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.subject[0].reference == \"MedicinalProductDefinition/equilidem\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.text == \"Regulatory Drug Marketing Approval\"\n\n\ndef test_regulatedauthorization_1(base_settings):\n    \"\"\"No. 1 tests collection for RegulatedAuthorization.\n    Test File: regulatedauthorization-example-basic-drug-auth.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"regulatedauthorization-example-basic-drug-auth.json\"\n    )\n    inst = regulatedauthorization.RegulatedAuthorization.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"RegulatedAuthorization\" == inst.get_resource_type()\n\n    impl_regulatedauthorization_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RegulatedAuthorization\" == data[\"resourceType\"]\n\n    inst2 = regulatedauthorization.RegulatedAuthorization(**data)\n    impl_regulatedauthorization_1(inst2)\n\n\ndef impl_regulatedauthorization_2(inst):\n    assert (\n        inst.case.application[0].dateDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.case.application[0].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/applicationidentifier-number\"}\n        ).valueUri\n    )\n    assert inst.case.application[0].identifier.value == \"IA38G\"\n    assert (\n        inst.case.application[0].type.coding[0].code\n        == \"GroupTypeIAVariationNotification\"\n    )\n    assert (\n        inst.case.application[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://ema.europa.eu/example/marketingAuthorizationApplicationType\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.case.application[1].dateDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.case.application[1].identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/applicationidentifier-number\"}\n        ).valueUri\n    )\n    assert inst.case.application[1].identifier.value == \"IA38F\"\n    assert (\n        inst.case.application[1].type.coding[0].code\n        == \"GroupTypeIAVariationNotification\"\n    )\n    assert (\n        inst.case.application[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://ema.europa.eu/example/marketingAuthorizationApplicationType\"\n            }\n        ).valueUri\n    )\n    assert (\n        inst.case.datePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-21\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.case.datePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-02\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.case.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/procedureidentifier-number\"}\n        ).valueUri\n    )\n    assert inst.case.identifier.value == \"EMEA/H/C/009999/IA/0099/G\"\n    assert inst.case.type.coding[0].code == \"VariationTypeIA\"\n    assert (\n        inst.case.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://ema.europa.eu/example/marketingAuthorizationProcedureType\"\n            }\n        ).valueUri\n    )\n    assert inst.holder.reference == \"Organization/example\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/marketingAuthorizationNumber\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"EU/1/11/999/001\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.region[0].coding[0].code == \"EU\"\n    assert (\n        inst.region[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/country\"}\n        ).valueUri\n    )\n    assert inst.regulator.reference == \"Organization/example\"\n    assert inst.status.coding[0].code == \"active\"\n    assert (\n        inst.status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://ema.europa.eu/example/authorizationstatus\"}\n        ).valueUri\n    )\n    assert (\n        inst.statusDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-01-14\"}\n        ).valueDateTime\n    )\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.validityPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-05-20\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.validityPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-09-03\"}\n        ).valueDateTime\n    )\n\n\ndef test_regulatedauthorization_2(base_settings):\n    \"\"\"No. 2 tests collection for RegulatedAuthorization.\n    Test File: regulatedauthorization-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"regulatedauthorization-example.json\"\n    )\n    inst = regulatedauthorization.RegulatedAuthorization.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"RegulatedAuthorization\" == inst.get_resource_type()\n\n    impl_regulatedauthorization_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RegulatedAuthorization\" == data[\"resourceType\"]\n\n    inst2 = regulatedauthorization.RegulatedAuthorization(**data)\n    impl_regulatedauthorization_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_relatedperson.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RelatedPerson\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import relatedperson\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_relatedperson_1(inst):\n    assert inst.active is True\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2000-01-01\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"relatedPersonDenovoMother\"\n    assert inst.identifier[0].assigner.display == \"Child Hospital\"\n    assert (\n        inst.identifier[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/persons\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert inst.identifier[0].type.coding[0].display == \"Medical record number\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"11112\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Doe\"\n    assert inst.name[0].given[0] == \"Jane\"\n    assert inst.name[0].given[1] == \"Mother\"\n    assert inst.name[0].use == \"official\"\n    assert inst.patient.reference == \"Patient/denovoChild\"\n    assert inst.relationship[0].coding[0].code == \"NMTH\"\n    assert inst.relationship[0].coding[0].display == \"natural mother\"\n    assert (\n        inst.relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_relatedperson_1(base_settings):\n    \"\"\"No. 1 tests collection for RelatedPerson.\n    Test File: RelatedPerson-denovoMother.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"RelatedPerson-denovoMother.json\"\n    inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes())\n    assert \"RelatedPerson\" == inst.get_resource_type()\n\n    impl_relatedperson_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RelatedPerson\" == data[\"resourceType\"]\n\n    inst2 = relatedperson.RelatedPerson(**data)\n    impl_relatedperson_1(inst2)\n\n\ndef impl_relatedperson_2(inst):\n    assert inst.address[0].city == \"PleasantVille\"\n    assert inst.address[0].line[0] == \"534 Erewhon St\"\n    assert inst.address[0].postalCode == \"3999\"\n    assert inst.address[0].state == \"Vic\"\n    assert inst.address[0].use == \"home\"\n    assert inst.gender == \"male\"\n    assert inst.id == \"peter\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Chalmers\"\n    assert inst.name[0].given[0] == \"Peter\"\n    assert inst.name[0].given[1] == \"James\"\n    assert inst.name[0].use == \"official\"\n    assert inst.patient.reference == \"Patient/animal\"\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-03-11\"}\n        ).valueDateTime\n    )\n    assert inst.photo[0].contentType == \"image/jpeg\"\n    assert (\n        inst.photo[0].url\n        == ExternalValidatorModel.model_validate({\"valueUrl\": \"Binary/f012\"}).valueUrl\n    )\n    assert inst.relationship[0].coding[0].code == \"C\"\n    assert (\n        inst.relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0131\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"(03) 5555 6473\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_relatedperson_2(base_settings):\n    \"\"\"No. 2 tests collection for RelatedPerson.\n    Test File: relatedperson-example-peter.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"relatedperson-example-peter.json\"\n    inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes())\n    assert \"RelatedPerson\" == inst.get_resource_type()\n\n    impl_relatedperson_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RelatedPerson\" == data[\"resourceType\"]\n\n    inst2 = relatedperson.RelatedPerson(**data)\n    impl_relatedperson_2(inst2)\n\n\ndef impl_relatedperson_3(inst):\n    assert inst.gender == \"female\"\n    assert inst.id == \"f001\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:2.16.840.1.113883.2.4.6.3\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"BSN\"\n    assert inst.identifier[0].use == \"official\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Abels\"\n    assert inst.name[0].given[0] == \"Sarah\"\n    assert inst.name[0].use == \"usual\"\n    assert inst.patient.reference == \"Patient/f001\"\n    assert inst.relationship[0].coding[0].code == \"SIGOTHR\"\n    assert (\n        inst.relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"mobile\"\n    assert inst.telecom[0].value == \"0690383372\"\n    assert inst.telecom[1].system == \"email\"\n    assert inst.telecom[1].use == \"home\"\n    assert inst.telecom[1].value == \"s.abels@kpn.nl\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_relatedperson_3(base_settings):\n    \"\"\"No. 3 tests collection for RelatedPerson.\n    Test File: relatedperson-example-f001-sarah.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"relatedperson-example-f001-sarah.json\"\n    )\n    inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes())\n    assert \"RelatedPerson\" == inst.get_resource_type()\n\n    impl_relatedperson_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RelatedPerson\" == data[\"resourceType\"]\n\n    inst2 = relatedperson.RelatedPerson(**data)\n    impl_relatedperson_3(inst2)\n\n\ndef impl_relatedperson_4(inst):\n    assert inst.active is True\n    assert inst.address[0].line[0] == \"2222 Home Street\"\n    assert inst.address[0].use == \"home\"\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1973-05-31\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"newborn-mom\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/us-ssn\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"SS\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"444222222\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Everywoman\"\n    assert inst.name[0].given[0] == \"Eve\"\n    assert inst.name[0].use == \"official\"\n    assert inst.patient.reference == \"Patient/newborn\"\n    assert inst.relationship[0].coding[0].code == \"NMTH\"\n    assert inst.relationship[0].coding[0].display == \"natural mother\"\n    assert (\n        inst.relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.relationship[0].text == \"Natural Mother\"\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"work\"\n    assert inst.telecom[0].value == \"555-555-2003\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_relatedperson_4(base_settings):\n    \"\"\"No. 4 tests collection for RelatedPerson.\n    Test File: relatedperson-example-newborn-mom.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"relatedperson-example-newborn-mom.json\"\n    )\n    inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes())\n    assert \"RelatedPerson\" == inst.get_resource_type()\n\n    impl_relatedperson_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RelatedPerson\" == data[\"resourceType\"]\n\n    inst2 = relatedperson.RelatedPerson(**data)\n    impl_relatedperson_4(inst2)\n\n\ndef impl_relatedperson_5(inst):\n    assert inst.active is True\n    assert inst.address[0].city == \"Paris\"\n    assert inst.address[0].country == \"FRA\"\n    assert inst.address[0].line[0] == \"43, Place du Marché Sainte Catherine\"\n    assert inst.address[0].postalCode == \"75004\"\n    assert inst.gender == \"female\"\n    assert inst.id == \"benedicte\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.2.250.1.61\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"INSEE\"\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"272117510400399\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"du Marché\"\n    assert inst.name[0].given[0] == \"Bénédicte\"\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.photo[0].contentType == \"image/jpeg\"\n    assert (\n        inst.photo[0].url\n        == ExternalValidatorModel.model_validate({\"valueUrl\": \"Binary/f016\"}).valueUrl\n    )\n    assert inst.relationship[0].coding[0].code == \"N\"\n    assert (\n        inst.relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0131\"}\n        ).valueUri\n    )\n    assert inst.relationship[0].coding[1].code == \"WIFE\"\n    assert (\n        inst.relationship[0].coding[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].value == \"+33 (237) 998327\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_relatedperson_5(base_settings):\n    \"\"\"No. 5 tests collection for RelatedPerson.\n    Test File: relatedperson-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"relatedperson-example.json\"\n    inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes())\n    assert \"RelatedPerson\" == inst.get_resource_type()\n\n    impl_relatedperson_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RelatedPerson\" == data[\"resourceType\"]\n\n    inst2 = relatedperson.RelatedPerson(**data)\n    impl_relatedperson_5(inst2)\n\n\ndef impl_relatedperson_6(inst):\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"1963\"}).valueDate\n    )\n    assert inst.gender == \"female\"\n    assert inst.id == \"f002\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].text == \"Ariadne Bor-Jansma\"\n    assert inst.name[0].use == \"usual\"\n    assert inst.patient.reference == \"Patient/f201\"\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"1975\"}\n        ).valueDateTime\n    )\n    assert inst.photo[0].contentType == \"image/jpeg\"\n    assert inst.relationship[0].coding[0].code == \"SIGOTHR\"\n    assert (\n        inst.relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.telecom[0].system == \"phone\"\n    assert inst.telecom[0].use == \"home\"\n    assert inst.telecom[0].value == \"+31201234567\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_relatedperson_6(base_settings):\n    \"\"\"No. 6 tests collection for RelatedPerson.\n    Test File: relatedperson-example-f002-ariadne.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"relatedperson-example-f002-ariadne.json\"\n    )\n    inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes())\n    assert \"RelatedPerson\" == inst.get_resource_type()\n\n    impl_relatedperson_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RelatedPerson\" == data[\"resourceType\"]\n\n    inst2 = relatedperson.RelatedPerson(**data)\n    impl_relatedperson_6(inst2)\n\n\ndef impl_relatedperson_7(inst):\n    assert inst.active is True\n    assert (\n        inst.birthDate\n        == ExternalValidatorModel.model_validate({\"valueDate\": \"2000-01-01\"}).valueDate\n    )\n    assert inst.gender == \"male\"\n    assert inst.id == \"relatedPersonDenovoFather\"\n    assert inst.identifier[0].assigner.display == \"Child Hospital\"\n    assert (\n        inst.identifier[0].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/persons\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"MR\"\n    assert inst.identifier[0].type.coding[0].display == \"Medical record number\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"temp\"\n    assert inst.identifier[0].value == \"11113\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].family == \"Doe\"\n    assert inst.name[0].given[0] == \"John\"\n    assert inst.name[0].given[1] == \"Father\"\n    assert inst.name[0].use == \"official\"\n    assert inst.patient.reference == \"Patient/denovoChild\"\n    assert inst.relationship[0].coding[0].code == \"NFTH\"\n    assert inst.relationship[0].coding[0].display == \"natural Father\"\n    assert (\n        inst.relationship[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_relatedperson_7(base_settings):\n    \"\"\"No. 7 tests collection for RelatedPerson.\n    Test File: RelatedPerson-denovoFather.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"RelatedPerson-denovoFather.json\"\n    inst = relatedperson.RelatedPerson.model_validate_json(filename.read_bytes())\n    assert \"RelatedPerson\" == inst.get_resource_type()\n\n    impl_relatedperson_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RelatedPerson\" == data[\"resourceType\"]\n\n    inst2 = relatedperson.RelatedPerson(**data)\n    impl_relatedperson_7(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_requestorchestration.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RequestOrchestration\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import requestorchestration\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_requestorchestration_1(inst):\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[0]\n        .url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"day\"}).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[0]\n        .valueInteger\n        == 1\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[1]\n        .url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"day\"}).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .extension[0]\n        .extension[1]\n        .valueInteger\n        == 8\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[0].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle\"}\n        ).valueUri\n    )\n    assert inst.action[0].action[0].action[0].action[0].action[0].id == \"action-1\"\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[0].resource.reference\n        == \"#1111\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[0].textEquivalent\n        == \"Gemcitabine 1250 mg/m² IV over 30 minutes on days 1 and 8\"\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[1]\n        .extension[0]\n        .extension[0]\n        .url\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"day\"}).valueUri\n    )\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[1]\n        .extension[0]\n        .extension[0]\n        .valueInteger\n        == 1\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle\"}\n        ).valueUri\n    )\n    assert inst.action[0].action[0].action[0].action[0].action[1].id == \"action-2\"\n    assert (\n        inst.action[0]\n        .action[0]\n        .action[0]\n        .action[0]\n        .action[1]\n        .relatedAction[0]\n        .relationship\n        == \"concurrent-with-start\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].relatedAction[0].targetId\n        == \"action-1\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].resource.reference\n        == \"#2222\"\n    )\n    assert (\n        inst.action[0].action[0].action[0].action[0].action[1].textEquivalent\n        == \"CARBOplatin AUC 5 IV over 30 minutes on Day 1\"\n    )\n    assert inst.action[0].action[0].action[0].action[0].id == \"cycle-definition-1\"\n    assert (\n        inst.action[0].action[0].action[0].action[0].textEquivalent\n        == \"21-day cycle for 6 cycles\"\n    )\n    assert inst.action[0].action[0].action[0].action[0].timingTiming.repeat.count == 6\n    assert float(\n        inst.action[0].action[0].action[0].action[0].timingTiming.repeat.duration\n    ) == float(21)\n    assert (\n        inst.action[0].action[0].action[0].action[0].timingTiming.repeat.durationUnit\n        == \"d\"\n    )\n    assert inst.action[0].action[0].action[0].groupingBehavior == \"sentence-group\"\n    assert inst.action[0].action[0].action[0].selectionBehavior == \"exactly-one\"\n    assert inst.action[0].action[0].selectionBehavior == \"all\"\n    assert inst.action[0].selectionBehavior == \"exactly-one\"\n    assert inst.author.reference == \"Practitioner/1\"\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-06T17:31:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"1111\"\n    assert inst.contained[1].id == \"2222\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"kdn5-example\"\n    assert inst.identifier[0].value == \"requestorchestration-kdn5\"\n    assert (\n        inst.instantiatesCanonical[0] == \"http://example.org/fhir/PlanDefinition/KDN5\"\n    )\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.priority == \"routine\"\n    assert inst.status == \"draft\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Administer '\n        \"gemcitabine and carboplatin.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_requestorchestration_1(base_settings):\n    \"\"\"No. 1 tests collection for RequestOrchestration.\n    Test File: requestorchestration-kdn5-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"requestorchestration-kdn5-example.json\"\n    )\n    inst = requestorchestration.RequestOrchestration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"RequestOrchestration\" == inst.get_resource_type()\n\n    impl_requestorchestration_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RequestOrchestration\" == data[\"resourceType\"]\n\n    inst2 = requestorchestration.RequestOrchestration(**data)\n    impl_requestorchestration_1(inst2)\n\n\ndef impl_requestorchestration_2(inst):\n    assert inst.action[0].action[0].description == \"Administer medication 1\"\n    assert inst.action[0].action[0].id == \"medication-action-1\"\n    assert inst.action[0].action[0].resource.reference == \"#medicationrequest-1\"\n    assert inst.action[0].action[0].type.coding[0].code == \"create\"\n    assert inst.action[0].action[1].description == \"Administer medication 2\"\n    assert inst.action[0].action[1].id == \"medication-action-2\"\n    assert inst.action[0].action[1].relatedAction[0].offsetDuration.unit == \"h\"\n    assert float(\n        inst.action[0].action[1].relatedAction[0].offsetDuration.value\n    ) == float(1)\n    assert inst.action[0].action[1].relatedAction[0].relationship == \"after-end\"\n    assert inst.action[0].action[1].relatedAction[0].targetId == \"medication-action-1\"\n    assert inst.action[0].action[1].resource.reference == \"#medicationrequest-2\"\n    assert inst.action[0].action[1].type.coding[0].code == \"create\"\n    assert inst.action[0].cardinalityBehavior == \"single\"\n    assert (\n        inst.action[0].description == \"Administer medications at the appropriate time\"\n    )\n    assert inst.action[0].groupingBehavior == \"logical-group\"\n    assert inst.action[0].participant[0].actorReference.reference == \"Practitioner/1\"\n    assert inst.action[0].precheckBehavior == \"yes\"\n    assert inst.action[0].prefix == \"1\"\n    assert inst.action[0].requiredBehavior == \"must\"\n    assert inst.action[0].selectionBehavior == \"all\"\n    assert inst.action[0].textEquivalent == (\n        \"Administer medication 1, followed an hour later by \" \"medication 2\"\n    )\n    assert (\n        inst.action[0].timingDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-06T19:00:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.action[0].title == \"Administer Medications\"\n    assert inst.author.reference == \"Practitioner/1\"\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-06T17:31:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.contained[0].id == \"medicationrequest-1\"\n    assert inst.contained[1].id == \"medicationrequest-2\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/treatment-group\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.value == \"00001\"\n    assert inst.id == \"example\"\n    assert inst.identifier[0].value == \"requestorchestration-1\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Additional notes about the request group\"\n    assert inst.priority == \"routine\"\n    assert inst.reason[0].concept.text == \"Treatment\"\n    assert inst.status == \"draft\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Example '\n        \"RequestOrchestration illustrating related actions to \"\n        \"administer medications in sequence with time delay.</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_requestorchestration_2(base_settings):\n    \"\"\"No. 2 tests collection for RequestOrchestration.\n    Test File: requestorchestration-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"requestorchestration-example.json\"\n    inst = requestorchestration.RequestOrchestration.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"RequestOrchestration\" == inst.get_resource_type()\n\n    impl_requestorchestration_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RequestOrchestration\" == data[\"resourceType\"]\n\n    inst2 = requestorchestration.RequestOrchestration(**data)\n    impl_requestorchestration_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_requirements.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Requirements\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import requirements\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_requirements_1(inst):\n    assert inst.actor[0] == \"http://hl7.org/fhir/ActorDefinition/server\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-11-02T14:31:30.239Z\"}\n        ).valueDateTime\n    )\n    assert inst.derivedFrom[0] == \"http://hl7.org/fhir/Requirements/example2\"\n    assert inst.description == \"Example Requirements Set 2\"\n    assert inst.id == \"example2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.18.2\"\n    assert inst.name == \"ExampleRequirements2\"\n    assert inst.statement[0].conformance[0] == \"SHOULD\"\n    assert inst.statement[0].key == \"44595579-fa13-42a5-bd24-0515cde96963\"\n    assert inst.statement[0].label == \"requirement-B1\"\n    assert inst.statement[0].requirement == (\n        \"Operations based on the SNOMED-CT should use the current \"\n        \"version within 24 hours of each release\"\n    )\n    assert inst.statement[0].source[0].display == \"Lloyd Mackenzie\"\n    assert inst.statement[1].conformance[0] == \"SHALL\"\n    assert inst.statement[1].key == \"46f77dcd-d51e-4738-b61f-22506d0cb0ac\"\n    assert inst.statement[1].label == \"requirement-2/a\"\n    assert inst.statement[1].source[0].display == \"Robert Hausam\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Example Requirements Set 2\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Requirements/example2\"}\n        ).valueUri\n    )\n\n\ndef test_requirements_1(base_settings):\n    \"\"\"No. 1 tests collection for Requirements.\n    Test File: Requirements-example2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Requirements-example2.json\"\n    inst = requirements.Requirements.model_validate_json(filename.read_bytes())\n    assert \"Requirements\" == inst.get_resource_type()\n\n    impl_requirements_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Requirements\" == data[\"resourceType\"]\n\n    inst2 = requirements.Requirements(**data)\n    impl_requirements_1(inst2)\n\n\ndef impl_requirements_2(inst):\n    assert inst.actor[0] == \"http://hl7.org/fhir/ActorDefinition/server\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-11-02T14:31:30.239Z\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Example Requirements Set 1\"\n    assert inst.id == \"example1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.18.1\"\n    assert inst.name == \"ExampleRequirements1\"\n    assert inst.statement[0].conformance[0] == \"SHALL\"\n    assert inst.statement[0].key == \"req-1\"\n    assert (\n        inst.statement[0].requirement == \"The server SHALL support expanding value sets\"\n    )\n    assert (\n        inst.statement[0].satisfiedBy[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://hl7.org/fhir/terminology-service.html#expand\"}\n        ).valueUrl\n    )\n    assert inst.statement[0].source[0].display == \"Grahame Grieve\"\n    assert inst.statement[1].conformance[0] == \"SHALL\"\n    assert inst.statement[1].key == \"46f77dcd-d51e-4738-b61f-22506d0cb0ac\"\n    assert inst.statement[1].label == \"requirement-2\"\n    assert inst.statement[1].requirement == (\n        \"Operations based on the codeSystem resource SHALL have the \"\n        \"same result whether or not the relationships are represented\"\n        \" explicitly as properties or implicitly using the CodeSystem\"\n        \" resource hierarchy\"\n    )\n    assert inst.statement[1].source[0].display == \"Jose Costa Teixeira\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Example Requirements Set 1\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/Requirements/example1\"}\n        ).valueUri\n    )\n\n\ndef test_requirements_2(base_settings):\n    \"\"\"No. 2 tests collection for Requirements.\n    Test File: Requirements-example1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Requirements-example1.json\"\n    inst = requirements.Requirements.model_validate_json(filename.read_bytes())\n    assert \"Requirements\" == inst.get_resource_type()\n\n    impl_requirements_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Requirements\" == data[\"resourceType\"]\n\n    inst2 = requirements.Requirements(**data)\n    impl_requirements_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_researchstudy.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchStudy\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import researchstudy\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_researchstudy_1(inst):\n    assert inst.associatedParty[0].classifier[0].text == \"INDUSTRY\"\n    assert inst.associatedParty[0].name == \"Alebund Pharmaceuticals\"\n    assert inst.associatedParty[0].role.coding[0].code == \"sponsor\"\n    assert inst.associatedParty[0].role.coding[0].display == \"Sponsor\"\n    assert (\n        inst.associatedParty[0].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/research-study-party-role\"}\n        ).valueUri\n    )\n    assert inst.associatedParty[1].classifier[0].text == \"INDUSTRY\"\n    assert inst.associatedParty[1].name == \"Alebund Pty Ltd\"\n    assert inst.associatedParty[1].role.coding[0].code == \"lead-sponsor\"\n    assert inst.associatedParty[1].role.coding[0].display == \"Lead Sponsor\"\n    assert (\n        inst.associatedParty[1].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/research-study-party-role\"}\n        ).valueUri\n    )\n    assert inst.associatedParty[2].classifier[0].text == \"Contact\"\n    assert inst.associatedParty[2].name == \"Zhen LIU\"\n    assert inst.associatedParty[2].party.reference == \"#NCT05503693-CentralContact-0\"\n    assert (\n        inst.associatedParty[2].party.type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Practitioner\"}).valueUri\n    )\n    assert inst.associatedParty[2].role.coding[0].code == \"recruitment-contact\"\n    assert inst.associatedParty[2].role.coding[0].display == \"Recruitment Contact\"\n    assert (\n        inst.associatedParty[2].role.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/research-study-party-role\"}\n        ).valueUri\n    )\n    assert inst.associatedParty[3].name == \"Sam Francis, Doctor\"\n    assert inst.associatedParty[3].party.display == \"Nucleus Network\"\n    assert inst.associatedParty[3].role.text == \"Principal Investigator\"\n    assert inst.classifier[0].text == \"Has Results: False\"\n    assert inst.classifier[1].text == \"Oversight Classifier: oversightHasDmc Yes\"\n    assert inst.classifier[2].text == \"Oversight Classifier: isFdaRegulatedDrug No\"\n    assert inst.classifier[3].text == \"Oversight Classifier: isFdaRegulatedDevice No\"\n    assert inst.comparisonGroup[0].description == \"AP303\"\n    assert inst.comparisonGroup[0].intendedExposure[0].display == \"Drug: AP303 50 μg\"\n    assert (\n        inst.comparisonGroup[0].intendedExposure[0].reference\n        == \"#NCT05503693-drug------ap303-50-g\"\n    )\n    assert (\n        inst.comparisonGroup[0].intendedExposure[0].type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.comparisonGroup[0].intendedExposure[1].display == \"Drug: AP303 150 μg\"\n    assert (\n        inst.comparisonGroup[0].intendedExposure[1].reference\n        == \"#NCT05503693-drug------ap303-150-g\"\n    )\n    assert (\n        inst.comparisonGroup[0].intendedExposure[1].type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.comparisonGroup[0].intendedExposure[2].display == \"Drug: AP303 300 μg\"\n    assert (\n        inst.comparisonGroup[0].intendedExposure[2].reference\n        == \"#NCT05503693-drug------ap303-300-g\"\n    )\n    assert (\n        inst.comparisonGroup[0].intendedExposure[2].type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.comparisonGroup[0].intendedExposure[3].display == \"Drug: AP303 600 μg\"\n    assert (\n        inst.comparisonGroup[0].intendedExposure[3].reference\n        == \"#NCT05503693-drug------ap303-600-g\"\n    )\n    assert (\n        inst.comparisonGroup[0].intendedExposure[3].type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.comparisonGroup[0].linkId == \"ap303\"\n    assert inst.comparisonGroup[0].name == \"AP303\"\n    assert inst.comparisonGroup[0].type.text == \"Experimental\"\n    assert inst.comparisonGroup[1].description == \"Placebo\"\n    assert inst.comparisonGroup[1].intendedExposure[0].display == \"Drug: Placebo 50 μg\"\n    assert (\n        inst.comparisonGroup[1].intendedExposure[0].reference\n        == \"#NCT05503693-drug------placebo-50-g\"\n    )\n    assert (\n        inst.comparisonGroup[1].intendedExposure[0].type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.comparisonGroup[1].intendedExposure[1].display == \"Drug: Placebo 150 μg\"\n    assert (\n        inst.comparisonGroup[1].intendedExposure[1].reference\n        == \"#NCT05503693-drug------placebo-150-g\"\n    )\n    assert (\n        inst.comparisonGroup[1].intendedExposure[1].type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.comparisonGroup[1].intendedExposure[2].display == \"Drug: Placebo 300 μg\"\n    assert (\n        inst.comparisonGroup[1].intendedExposure[2].reference\n        == \"#NCT05503693-drug------placebo-300-g\"\n    )\n    assert (\n        inst.comparisonGroup[1].intendedExposure[2].type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.comparisonGroup[1].intendedExposure[3].display == \"Drug: Placebo 600 μg\"\n    assert (\n        inst.comparisonGroup[1].intendedExposure[3].reference\n        == \"#NCT05503693-drug------placebo-600-g\"\n    )\n    assert (\n        inst.comparisonGroup[1].intendedExposure[3].type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.comparisonGroup[1].linkId == \"placebo\"\n    assert inst.comparisonGroup[1].name == \"Placebo\"\n    assert inst.comparisonGroup[1].type.text == \"Placebo Comparator\"\n    assert inst.condition[0].text == \"Healthy Subjects\"\n    assert inst.contained[0].id == \"NCT05503693-drug------ap303-50-g\"\n    assert inst.contained[1].id == \"NCT05503693-drug------ap303-150-g\"\n    assert inst.contained[2].id == \"NCT05503693-drug------ap303-300-g\"\n    assert inst.contained[3].id == \"NCT05503693-drug------ap303-600-g\"\n    assert inst.contained[4].id == \"NCT05503693-drug------placebo-50-g\"\n    assert inst.contained[5].id == \"NCT05503693-drug------placebo-150-g\"\n    assert inst.contained[6].id == \"NCT05503693-drug------placebo-300-g\"\n    assert inst.contained[7].id == \"NCT05503693-drug------placebo-600-g\"\n    assert inst.contained[8].id == \"NCT05503693-CentralContact-0\"\n    assert inst.contained[9].id == \"NCT05503693-Location-0-ResearchStudy\"\n    assert inst.id == \"example-ctgov-study-record\"\n    assert inst.identifier[0].assigner.display == \"Computable Publishing LLC\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"FEvIR Object Identifier\"\n    assert inst.identifier[0].value == \"112103\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://clinicaltrials.gov\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"NCT05503693\"\n    assert inst.identifier[2].assigner.display == \"Alebund Pharmaceuticals\"\n    assert inst.identifier[2].value == \"AP303-PK-01\"\n    assert inst.keyword[0].text == (\n        \"Safety, Tolerability, Pharmacokinetics, AP303, Healthy \" \"Subjects\"\n    )\n    assert inst.label[0].type.text == \"Official Title\"\n    assert inst.name == \"NCT05503693_FHIR_Transform\"\n    assert inst.outcomeMeasure[0].description == (\n        \"Incidence and severity of adverse events (AEs), laboratory, \"\n        \"ECG, and vital sign changes\"\n    )\n    assert (\n        inst.outcomeMeasure[0].name\n        == \"Single Dose and Food Effect Safety Outcome Measures\"\n    )\n    assert (\n        inst.outcomeMeasure[0].reference.identifier.assigner.display\n        == \"Computable Publishing LLC\"\n    )\n    assert (\n        inst.outcomeMeasure[0].reference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net/FLI\"}\n        ).valueUri\n    )\n    assert (\n        inst.outcomeMeasure[0].reference.identifier.type.text\n        == \"FEvIR Linking Identifier\"\n    )\n    assert (\n        inst.outcomeMeasure[0].reference.identifier.value\n        == \"NCT05503693-primaryOutcome-0\"\n    )\n    assert (\n        inst.outcomeMeasure[0].reference.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[0].type[0].coding[0].code == \"primary\"\n    assert inst.outcomeMeasure[0].type[0].coding[0].display == \"Primary\"\n    assert (\n        inst.outcomeMeasure[0].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-study-objective-type\"\n            }\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[1].description == (\n        \"Incidence and severity of AEs, laboratory, ECG, and vital \" \"sign changes.\"\n    )\n    assert inst.outcomeMeasure[1].name == \"Multiple Dose Safety Outcome Measures\"\n    assert (\n        inst.outcomeMeasure[1].reference.identifier.assigner.display\n        == \"Computable Publishing LLC\"\n    )\n    assert (\n        inst.outcomeMeasure[1].reference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net/FLI\"}\n        ).valueUri\n    )\n    assert (\n        inst.outcomeMeasure[1].reference.identifier.type.text\n        == \"FEvIR Linking Identifier\"\n    )\n    assert (\n        inst.outcomeMeasure[1].reference.identifier.value\n        == \"NCT05503693-primaryOutcome-1\"\n    )\n    assert (\n        inst.outcomeMeasure[1].reference.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[1].type[0].coding[0].code == \"primary\"\n    assert inst.outcomeMeasure[1].type[0].coding[0].display == \"Primary\"\n    assert (\n        inst.outcomeMeasure[1].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-study-objective-type\"\n            }\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[2].description == \"PK characteristics after single dose\"\n    assert inst.outcomeMeasure[2].name == \"Cmax after single dose\"\n    assert (\n        inst.outcomeMeasure[2].reference.identifier.assigner.display\n        == \"Computable Publishing LLC\"\n    )\n    assert (\n        inst.outcomeMeasure[2].reference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net/FLI\"}\n        ).valueUri\n    )\n    assert (\n        inst.outcomeMeasure[2].reference.identifier.type.text\n        == \"FEvIR Linking Identifier\"\n    )\n    assert (\n        inst.outcomeMeasure[2].reference.identifier.value\n        == \"NCT05503693-primaryOutcome-2\"\n    )\n    assert (\n        inst.outcomeMeasure[2].reference.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[2].type[0].coding[0].code == \"primary\"\n    assert inst.outcomeMeasure[2].type[0].coding[0].display == \"Primary\"\n    assert (\n        inst.outcomeMeasure[2].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-study-objective-type\"\n            }\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[3].description == \"PK characteristics after single dose\"\n    assert inst.outcomeMeasure[3].name == \"Tmax after single dose\"\n    assert (\n        inst.outcomeMeasure[3].reference.identifier.assigner.display\n        == \"Computable Publishing LLC\"\n    )\n    assert (\n        inst.outcomeMeasure[3].reference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net/FLI\"}\n        ).valueUri\n    )\n    assert (\n        inst.outcomeMeasure[3].reference.identifier.type.text\n        == \"FEvIR Linking Identifier\"\n    )\n    assert (\n        inst.outcomeMeasure[3].reference.identifier.value\n        == \"NCT05503693-primaryOutcome-3\"\n    )\n    assert (\n        inst.outcomeMeasure[3].reference.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[3].type[0].coding[0].code == \"primary\"\n    assert inst.outcomeMeasure[3].type[0].coding[0].display == \"Primary\"\n    assert (\n        inst.outcomeMeasure[3].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-study-objective-type\"\n            }\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[4].description == \"PK characteristics after single dose\"\n    assert inst.outcomeMeasure[4].name == \"AUC0-last after single dose\"\n    assert (\n        inst.outcomeMeasure[4].reference.identifier.assigner.display\n        == \"Computable Publishing LLC\"\n    )\n    assert (\n        inst.outcomeMeasure[4].reference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net/FLI\"}\n        ).valueUri\n    )\n    assert (\n        inst.outcomeMeasure[4].reference.identifier.type.text\n        == \"FEvIR Linking Identifier\"\n    )\n    assert (\n        inst.outcomeMeasure[4].reference.identifier.value\n        == \"NCT05503693-primaryOutcome-4\"\n    )\n    assert (\n        inst.outcomeMeasure[4].reference.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[4].type[0].coding[0].code == \"primary\"\n    assert inst.outcomeMeasure[4].type[0].coding[0].display == \"Primary\"\n    assert (\n        inst.outcomeMeasure[4].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-study-objective-type\"\n            }\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[5].description == \"PK characteristics after single dose\"\n    assert inst.outcomeMeasure[5].name == \"AUC0-inf after single dose\"\n    assert (\n        inst.outcomeMeasure[5].reference.identifier.assigner.display\n        == \"Computable Publishing LLC\"\n    )\n    assert (\n        inst.outcomeMeasure[5].reference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net/FLI\"}\n        ).valueUri\n    )\n    assert (\n        inst.outcomeMeasure[5].reference.identifier.type.text\n        == \"FEvIR Linking Identifier\"\n    )\n    assert (\n        inst.outcomeMeasure[5].reference.identifier.value\n        == \"NCT05503693-primaryOutcome-5\"\n    )\n    assert (\n        inst.outcomeMeasure[5].reference.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[5].type[0].coding[0].code == \"primary\"\n    assert inst.outcomeMeasure[5].type[0].coding[0].display == \"Primary\"\n    assert (\n        inst.outcomeMeasure[5].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-study-objective-type\"\n            }\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[6].description == \"PK characteristics after single dose\"\n    assert inst.outcomeMeasure[6].name == \"t1/2 after single dose\"\n    assert (\n        inst.outcomeMeasure[6].reference.identifier.assigner.display\n        == \"Computable Publishing LLC\"\n    )\n    assert (\n        inst.outcomeMeasure[6].reference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net/FLI\"}\n        ).valueUri\n    )\n    assert (\n        inst.outcomeMeasure[6].reference.identifier.type.text\n        == \"FEvIR Linking Identifier\"\n    )\n    assert (\n        inst.outcomeMeasure[6].reference.identifier.value\n        == \"NCT05503693-primaryOutcome-6\"\n    )\n    assert (\n        inst.outcomeMeasure[6].reference.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[6].type[0].coding[0].code == \"primary\"\n    assert inst.outcomeMeasure[6].type[0].coding[0].display == \"Primary\"\n    assert (\n        inst.outcomeMeasure[6].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-study-objective-type\"\n            }\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[7].description == \"PK characteristics after single dose\"\n    assert inst.outcomeMeasure[7].name == \"CL/F after single dose\"\n    assert (\n        inst.outcomeMeasure[7].reference.identifier.assigner.display\n        == \"Computable Publishing LLC\"\n    )\n    assert (\n        inst.outcomeMeasure[7].reference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net/FLI\"}\n        ).valueUri\n    )\n    assert (\n        inst.outcomeMeasure[7].reference.identifier.type.text\n        == \"FEvIR Linking Identifier\"\n    )\n    assert (\n        inst.outcomeMeasure[7].reference.identifier.value\n        == \"NCT05503693-primaryOutcome-7\"\n    )\n    assert (\n        inst.outcomeMeasure[7].reference.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[7].type[0].coding[0].code == \"primary\"\n    assert inst.outcomeMeasure[7].type[0].coding[0].display == \"Primary\"\n    assert (\n        inst.outcomeMeasure[7].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-study-objective-type\"\n            }\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[8].description == \"PK characteristics after single dose\"\n    assert inst.outcomeMeasure[8].name == \"Ae and CLR (if warranted) after single dose\"\n    assert (\n        inst.outcomeMeasure[8].reference.identifier.assigner.display\n        == \"Computable Publishing LLC\"\n    )\n    assert (\n        inst.outcomeMeasure[8].reference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net/FLI\"}\n        ).valueUri\n    )\n    assert (\n        inst.outcomeMeasure[8].reference.identifier.type.text\n        == \"FEvIR Linking Identifier\"\n    )\n    assert (\n        inst.outcomeMeasure[8].reference.identifier.value\n        == \"NCT05503693-primaryOutcome-8\"\n    )\n    assert (\n        inst.outcomeMeasure[8].reference.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[8].type[0].coding[0].code == \"primary\"\n    assert inst.outcomeMeasure[8].type[0].coding[0].display == \"Primary\"\n    assert (\n        inst.outcomeMeasure[8].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-study-objective-type\"\n            }\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[9].description == \"PK characteristics after single dose\"\n    assert inst.outcomeMeasure[9].name == \"V/F after single dose\"\n    assert (\n        inst.outcomeMeasure[9].reference.identifier.assigner.display\n        == \"Computable Publishing LLC\"\n    )\n    assert (\n        inst.outcomeMeasure[9].reference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net/FLI\"}\n        ).valueUri\n    )\n    assert (\n        inst.outcomeMeasure[9].reference.identifier.type.text\n        == \"FEvIR Linking Identifier\"\n    )\n    assert (\n        inst.outcomeMeasure[9].reference.identifier.value\n        == \"NCT05503693-primaryOutcome-9\"\n    )\n    assert (\n        inst.outcomeMeasure[9].reference.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.outcomeMeasure[9].type[0].coding[0].code == \"primary\"\n    assert inst.outcomeMeasure[9].type[0].coding[0].display == \"Primary\"\n    assert (\n        inst.outcomeMeasure[9].type[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-study-objective-type\"\n            }\n        ).valueUri\n    )\n    assert inst.phase.coding[0].code == \"phase-1\"\n    assert inst.phase.coding[0].display == \"Phase 1\"\n    assert (\n        inst.phase.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-study-phase\"}\n        ).valueUri\n    )\n    assert inst.primaryPurposeType.coding[0].code == \"treatment\"\n    assert inst.primaryPurposeType.coding[0].display == \"Treatment\"\n    assert (\n        inst.primaryPurposeType.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-study-prim-purp-type\"\n            }\n        ).valueUri\n    )\n    assert inst.progressStatus[0].state.coding[0].code == \"recruiting\"\n    assert inst.progressStatus[0].state.coding[0].display == \"Recruiting\"\n    assert (\n        inst.progressStatus[0].state.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/research-study-status\"}\n        ).valueUri\n    )\n    assert inst.progressStatus[1].actual is False\n    assert (\n        inst.progressStatus[1].period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-06\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.progressStatus[1].period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-12-06\"}\n        ).valueDateTime\n    )\n    assert inst.progressStatus[1].state.coding[0].code == \"overall-study\"\n    assert inst.progressStatus[1].state.coding[0].display == \"Overall Study\"\n    assert (\n        inst.progressStatus[1].state.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/research-study-status\"}\n        ).valueUri\n    )\n    assert (\n        inst.recruitment.eligibility.identifier.assigner.display\n        == \"Computable Publishing LLC\"\n    )\n    assert (\n        inst.recruitment.eligibility.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net/FLI\"}\n        ).valueUri\n    )\n    assert (\n        inst.recruitment.eligibility.identifier.type.text == \"FEvIR Linking Identifier\"\n    )\n    assert (\n        inst.recruitment.eligibility.identifier.value\n        == \"NCT05503693 Eligibility Criteria\"\n    )\n    assert (\n        inst.recruitment.eligibility.reference\n        == \"https://fevir.net/resources/EvidenceVariable/112075\"\n    )\n    assert (\n        inst.recruitment.eligibility.type\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"EvidenceVariable\"}\n        ).valueUri\n    )\n    assert inst.recruitment.targetNumber == 62\n    assert (\n        inst.relatedArtifact[0].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://beta.clinicaltrials.gov/api/v2/studies/NCT05503693\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[0].type == \"transforms\"\n    assert inst.relatedArtifact[1].display == (\n        \"Computable Publishing®: ClinicalTrials.gov-to-FEvIR \" \"Converter\"\n    )\n    assert (\n        inst.relatedArtifact[1].document.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://fevir.net/resources/Project/29885\"}\n        ).valueUrl\n    )\n    assert inst.relatedArtifact[1].type == \"transformed-with\"\n    assert inst.site[0].reference == \"#NCT05503693-Location-0-ResearchStudy\"\n    assert (\n        inst.site[0].type\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"ResearchStudy\"}).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.studyDesign[0].text == \"Design Masking: Quadruple\"\n    assert inst.studyDesign[1].text == \"Design Who Masked: Participant\"\n    assert inst.studyDesign[2].text == \"Design Who Masked: Care Provider\"\n    assert inst.studyDesign[3].text == \"Design Who Masked: Investigator\"\n    assert inst.studyDesign[4].text == \"Design Who Masked: Outcomes Assessor\"\n    assert inst.studyDesign[5].text == \"Design Allocation: Randomized\"\n    assert (\n        inst.studyDesign[6].text == \"Design Intervention Model: Sequential Assignment\"\n    )\n    assert inst.studyDesign[7].text == \"CT.gov StudyType: INTERVENTIONAL\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == (\n        \"A Safety, Tolerability, and Pharmacokinetics Study of AP303 \"\n        \"in Healthy Subjects\"\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://fevir.net/resources/ResearchStudy/112103\"}\n        ).valueUri\n    )\n\n\ndef test_researchstudy_1(base_settings):\n    \"\"\"No. 1 tests collection for ResearchStudy.\n    Test File: researchstudy-example-ctgov-study-record.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"researchstudy-example-ctgov-study-record.json\"\n    )\n    inst = researchstudy.ResearchStudy.model_validate_json(filename.read_bytes())\n    assert \"ResearchStudy\" == inst.get_resource_type()\n\n    impl_researchstudy_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ResearchStudy\" == data[\"resourceType\"]\n\n    inst2 = researchstudy.ResearchStudy(**data)\n    impl_researchstudy_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_researchsubject.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ResearchSubject\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import researchsubject\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_researchsubject_1(inst):\n    assert inst.actualComparisonGroup == \"ap303\"\n    assert inst.assignedComparisonGroup == \"placebo\"\n    assert inst.id == \"example-crossover-placebo-to-drug\"\n    assert inst.identifier[0].value == \"ecsr45\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.period.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-06-10\"}\n        ).valueDateTime\n    )\n    assert inst.progress[0].type.coding[0].code == \"Enrollment\"\n    assert (\n        inst.progress[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-subject-state-type\"\n            }\n        ).valueUri\n    )\n    assert inst.progress[0].type.text == \"Enrollment status\"\n    assert inst.progress[1].reason.coding[0].code == \"informedConsentSigned\"\n    assert inst.progress[1].reason.text == \"Informed consent signed\"\n    assert (\n        inst.progress[1].startDate\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-06-10\"}\n        ).valueDateTime\n    )\n    assert inst.progress[1].subjectState.coding[0].code == \"on-study\"\n    assert (\n        inst.progress[1].subjectState.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-subject-state\"}\n        ).valueUri\n    )\n    assert inst.progress[1].subjectState.text == \"On-study\"\n    assert inst.progress[1].type.coding[0].code == \"Enrollment\"\n    assert (\n        inst.progress[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/research-subject-state-type\"\n            }\n        ).valueUri\n    )\n    assert inst.progress[1].type.text == \"Enrollment status\"\n    assert inst.status == \"active\"\n    assert inst.study.reference == \"example-ctgov-study-record\"\n    assert inst.subject.reference == \"cfsb1676546565857\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_researchsubject_1(base_settings):\n    \"\"\"No. 1 tests collection for ResearchSubject.\n    Test File: researchsubject-example-crossover-placebo-to-drug.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"researchsubject-example-crossover-placebo-to-drug.json\"\n    )\n    inst = researchsubject.ResearchSubject.model_validate_json(filename.read_bytes())\n    assert \"ResearchSubject\" == inst.get_resource_type()\n\n    impl_researchsubject_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ResearchSubject\" == data[\"resourceType\"]\n\n    inst2 = researchsubject.ResearchSubject(**data)\n    impl_researchsubject_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_riskassessment.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/RiskAssessment\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import riskassessment\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_riskassessment_1(inst):\n    assert inst.contained[0].id == \"group1\"\n    assert inst.id == \"population\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"#group1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_riskassessment_1(base_settings):\n    \"\"\"No. 1 tests collection for RiskAssessment.\n    Test File: riskassessment-example-population.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"riskassessment-example-population.json\"\n    )\n    inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes())\n    assert \"RiskAssessment\" == inst.get_resource_type()\n\n    impl_riskassessment_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RiskAssessment\" == data[\"resourceType\"]\n\n    inst2 = riskassessment.RiskAssessment(**data)\n    impl_riskassessment_1(inst2)\n\n\ndef impl_riskassessment_2(inst):\n    assert inst.basis[0].reference == \"Patient/pat2\"\n    assert inst.basis[1].reference == \"DiagnosticReport/lipids\"\n    assert inst.basis[2].reference == \"Observation/blood-pressure\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"cardiac\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"risk-assessment-cardiac\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-07-19T16:04:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.performer.display == \"http://cvdrisk.nhlbi.nih.gov/#cholesterol\"\n    assert inst.prediction[0].outcome.text == \"Heart Attack\"\n    assert float(inst.prediction[0].probabilityDecimal) == float(0.02)\n    assert inst.prediction[0].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[0].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[0].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[0].whenRange.high.value) == float(49)\n    assert inst.prediction[0].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[0].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[0].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[0].whenRange.low.value) == float(39)\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/pat2\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_riskassessment_2(base_settings):\n    \"\"\"No. 2 tests collection for RiskAssessment.\n    Test File: riskassessment-example-cardiac.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"riskassessment-example-cardiac.json\"\n    )\n    inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes())\n    assert \"RiskAssessment\" == inst.get_resource_type()\n\n    impl_riskassessment_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RiskAssessment\" == data[\"resourceType\"]\n\n    inst2 = riskassessment.RiskAssessment(**data)\n    impl_riskassessment_2(inst2)\n\n\ndef impl_riskassessment_3(inst):\n    assert inst.basis[0].reference == \"List/prognosis\"\n    assert inst.id == \"genetic\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.method.coding[0].code == \"BRCAPRO\"\n    assert inst.note[0].text == \"High degree of certainty\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2006-01-13T23:01:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.prediction[0].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[0].probabilityDecimal) == float(0.000168)\n    assert inst.prediction[0].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[0].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[0].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[0].whenRange.high.value) == float(53)\n    assert inst.prediction[1].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[1].probabilityDecimal) == float(0.000368)\n    assert inst.prediction[1].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[1].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[1].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[1].whenRange.high.value) == float(57)\n    assert inst.prediction[1].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[1].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[1].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[1].whenRange.low.value) == float(54)\n    assert inst.prediction[2].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[2].probabilityDecimal) == float(0.000594)\n    assert inst.prediction[2].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[2].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[2].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[2].whenRange.high.value) == float(62)\n    assert inst.prediction[2].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[2].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[2].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[2].whenRange.low.value) == float(58)\n    assert inst.prediction[3].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[3].probabilityDecimal) == float(0.000838)\n    assert inst.prediction[3].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[3].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[3].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[3].whenRange.high.value) == float(67)\n    assert inst.prediction[3].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[3].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[3].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[3].whenRange.low.value) == float(63)\n    assert inst.prediction[4].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[4].probabilityDecimal) == float(0.001089)\n    assert inst.prediction[4].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[4].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[4].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[4].whenRange.high.value) == float(72)\n    assert inst.prediction[4].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[4].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[4].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[4].whenRange.low.value) == float(68)\n    assert inst.prediction[5].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[5].probabilityDecimal) == float(0.001327)\n    assert inst.prediction[5].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[5].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[5].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[5].whenRange.high.value) == float(77)\n    assert inst.prediction[5].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[5].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[5].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[5].whenRange.low.value) == float(73)\n    assert inst.prediction[6].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[6].probabilityDecimal) == float(0.00153)\n    assert inst.prediction[6].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[6].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[6].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[6].whenRange.high.value) == float(82)\n    assert inst.prediction[6].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[6].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[6].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[6].whenRange.low.value) == float(78)\n    assert inst.prediction[7].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[7].probabilityDecimal) == float(0.001663)\n    assert inst.prediction[7].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[7].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[7].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[7].whenRange.high.value) == float(88)\n    assert inst.prediction[7].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[7].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[7].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[7].whenRange.low.value) == float(83)\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/b248b1b2-1686-4b94-9936-37d7a5f94b51\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_riskassessment_3(base_settings):\n    \"\"\"No. 3 tests collection for RiskAssessment.\n    Test File: riskassessment-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"riskassessment-example.json\"\n    inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes())\n    assert \"RiskAssessment\" == inst.get_resource_type()\n\n    impl_riskassessment_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RiskAssessment\" == data[\"resourceType\"]\n\n    inst2 = riskassessment.RiskAssessment(**data)\n    impl_riskassessment_3(inst2)\n\n\ndef impl_riskassessment_4(inst):\n    assert inst.basedOn.reference == \"ImmunizationRecommendation/example\"\n    assert inst.basis[0].reference == \"DiagnosticReport/example\"\n    assert inst.basis[1].reference == \"Observation/example\"\n    assert inst.code.coding[0].code == \"709510001\"\n    assert inst.code.coding[0].display == \"Assessment of risk for disease (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://browser.ihtsdotools.org/\"}\n        ).valueUri\n    )\n    assert inst.condition.reference == \"Condition/example\"\n    assert inst.encounter.display == \"Encounter with patient @example\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"riskexample\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"risk-assessment-breastcancer1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"This risk assessment is for reference only\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-10-10\"}\n        ).valueDateTime\n    )\n    assert inst.parent.reference == \"DiagnosticReport/example\"\n    assert inst.performer.reference == \"Practitioner/example\"\n    assert inst.prediction[0].outcome.text == \"Breast Cancer\"\n    assert float(inst.prediction[0].probabilityDecimal) == float(0.000368)\n    assert inst.prediction[0].whenRange.high.code == \"a\"\n    assert (\n        inst.prediction[0].whenRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[0].whenRange.high.unit == \"years\"\n    assert float(inst.prediction[0].whenRange.high.value) == float(57)\n    assert inst.prediction[0].whenRange.low.code == \"a\"\n    assert (\n        inst.prediction[0].whenRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.prediction[0].whenRange.low.unit == \"years\"\n    assert float(inst.prediction[0].whenRange.low.value) == float(54)\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Risk assessment '\n        \"for reference only</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_riskassessment_4(base_settings):\n    \"\"\"No. 4 tests collection for RiskAssessment.\n    Test File: riskassessment-riskexample.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"riskassessment-riskexample.json\"\n    inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes())\n    assert \"RiskAssessment\" == inst.get_resource_type()\n\n    impl_riskassessment_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RiskAssessment\" == data[\"resourceType\"]\n\n    inst2 = riskassessment.RiskAssessment(**data)\n    impl_riskassessment_4(inst2)\n\n\ndef impl_riskassessment_5(inst):\n    assert inst.basis[0].reference == \"Observation/example-genetics-brcapat\"\n    assert inst.code.coding[0].code == \"709510001\"\n    assert inst.code.coding[0].display == \"Assessment of risk for disease (procedure)\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://browser.ihtsdotools.org/\"}\n        ).valueUri\n    )\n    assert inst.id == \"breastcancer-risk\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"risk-assessment-breastcancer1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == (\n        \"This risk assessment is based on BRCA1 and BRCA2 genetic \" \"mutation test\"\n    )\n    assert inst.performer.reference == \"Practitioner/example\"\n    assert inst.prediction[0].outcome.text == \"Unknown risk of developing breast cancer\"\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_riskassessment_5(base_settings):\n    \"\"\"No. 5 tests collection for RiskAssessment.\n    Test File: riskassessment-example-breastcancer.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"riskassessment-example-breastcancer.json\"\n    )\n    inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes())\n    assert \"RiskAssessment\" == inst.get_resource_type()\n\n    impl_riskassessment_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RiskAssessment\" == data[\"resourceType\"]\n\n    inst2 = riskassessment.RiskAssessment(**data)\n    impl_riskassessment_5(inst2)\n\n\ndef impl_riskassessment_6(inst):\n    assert inst.condition.display == \"Ischemic Stroke\"\n    assert inst.condition.reference == \"Condition/stroke\"\n    assert inst.id == \"prognosis\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2010-11-22\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.prediction[0].outcome.coding[0].code\n        == \"249943000:363698007=72098002,260868000=6934004\"\n    )\n    assert (\n        inst.prediction[0].outcome.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.prediction[0].outcome.text == \"permanent weakness of the left arm\"\n    assert inst.prediction[0].qualitativeRisk.coding[0].code == \"moderate\"\n    assert inst.prediction[0].qualitativeRisk.coding[0].display == \"moderate likelihood\"\n    assert (\n        inst.prediction[0].qualitativeRisk.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/risk-probability\"}\n        ).valueUri\n    )\n    assert inst.status == \"final\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"additional\"\n\n\ndef test_riskassessment_6(base_settings):\n    \"\"\"No. 6 tests collection for RiskAssessment.\n    Test File: riskassessment-example-prognosis.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"riskassessment-example-prognosis.json\"\n    )\n    inst = riskassessment.RiskAssessment.model_validate_json(filename.read_bytes())\n    assert \"RiskAssessment\" == inst.get_resource_type()\n\n    impl_riskassessment_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"RiskAssessment\" == data[\"resourceType\"]\n\n    inst2 = riskassessment.RiskAssessment(**data)\n    impl_riskassessment_6(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_schedule.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Schedule\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import schedule\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_schedule_1(inst):\n    assert inst.active is True\n    assert inst.actor[0].display == \"Dr. Beverly Crusher\"\n    assert inst.actor[0].reference == \"Practitioner/1\"\n    assert inst.actor[1].display == \"USS Enterprise-D Sickbay\"\n    assert inst.actor[1].reference == \"Location/3\"\n    assert inst.comment == (\n        \"The slots attached to this schedule are for genetic \"\n        \"counselling in the USS Enterprise-D Sickbay.\"\n    )\n    assert inst.id == \"exampleloc1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/scheduleid\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"46\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.planningHorizon.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-25T09:30:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.planningHorizon.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-25T09:15:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.serviceCategory[0].coding[0].code == \"17\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.serviceCategory[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/service-category\"}\n        ).valueUri\n    )\n    assert inst.serviceType[0].concept.coding[0].code == \"75\"\n    assert inst.serviceType[0].concept.coding[0].display == \"Genetic Counselling\"\n    assert (\n        inst.serviceType[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/service-type\"}\n        ).valueUri\n    )\n    assert inst.specialty[0].coding[0].code == \"394580004\"\n    assert inst.specialty[0].coding[0].display == \"Clinical genetics\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_schedule_1(base_settings):\n    \"\"\"No. 1 tests collection for Schedule.\n    Test File: schedule-provider-location1-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"schedule-provider-location1-example.json\"\n    )\n    inst = schedule.Schedule.model_validate_json(filename.read_bytes())\n    assert \"Schedule\" == inst.get_resource_type()\n\n    impl_schedule_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Schedule\" == data[\"resourceType\"]\n\n    inst2 = schedule.Schedule(**data)\n    impl_schedule_1(inst2)\n\n\ndef impl_schedule_2(inst):\n    assert inst.active is True\n    assert inst.actor[0].display == \"Burgers UMC, South Wing, second floor\"\n    assert inst.actor[0].reference == \"Location/1\"\n    assert inst.comment == (\n        \"The slots attached to this schedule should be specialized to\"\n        \" cover immunizations within the clinic\"\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/scheduleid\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"45\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Burgers UMC, South Wing - Immunizations\"\n    assert (\n        inst.planningHorizon.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-12-25T09:30:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.planningHorizon.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-12-25T09:15:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.serviceCategory[0].coding[0].code == \"17\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.serviceCategory[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/service-category\"}\n        ).valueUri\n    )\n    assert inst.serviceType[0].concept.coding[0].code == \"57\"\n    assert inst.serviceType[0].concept.coding[0].display == \"Immunization\"\n    assert (\n        inst.serviceType[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/service-type\"}\n        ).valueUri\n    )\n    assert inst.specialty[0].coding[0].code == \"408480009\"\n    assert inst.specialty[0].coding[0].display == \"Clinical immunology\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_schedule_2(base_settings):\n    \"\"\"No. 2 tests collection for Schedule.\n    Test File: schedule-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"schedule-example.json\"\n    inst = schedule.Schedule.model_validate_json(filename.read_bytes())\n    assert \"Schedule\" == inst.get_resource_type()\n\n    impl_schedule_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Schedule\" == data[\"resourceType\"]\n\n    inst2 = schedule.Schedule(**data)\n    impl_schedule_2(inst2)\n\n\ndef impl_schedule_3(inst):\n    assert inst.active is True\n    assert inst.actor[0].display == \"Burgers UMC, South Wing, second floor\"\n    assert inst.actor[0].reference == \"Location/1\"\n    assert inst.id == \"example-hcs\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Burgers UMC, Posttraumatic Stress Disorder counselling\"\n    assert (\n        inst.planningHorizon.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-12-25T09:30:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.planningHorizon.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-12-25T09:15:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.serviceCategory[0].coding[0].code == \"8\"\n    assert inst.serviceCategory[0].coding[0].display == \"Counselling\"\n    assert (\n        inst.serviceCategory[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/service-category\"}\n        ).valueUri\n    )\n    assert (\n        inst.serviceType[0].reference.display\n        == \"Burgers UMC, Posttraumatic Stress Disorder Clinic\"\n    )\n    assert inst.serviceType[0].reference.reference == \"HealthcareService/example\"\n    assert inst.specialty[0].coding[0].code == \"47505003\"\n    assert inst.specialty[0].coding[0].display == \"Posttraumatic stress disorder\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_schedule_3(base_settings):\n    \"\"\"No. 3 tests collection for Schedule.\n    Test File: schedule-example-hcs.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"schedule-example-hcs.json\"\n    inst = schedule.Schedule.model_validate_json(filename.read_bytes())\n    assert \"Schedule\" == inst.get_resource_type()\n\n    impl_schedule_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Schedule\" == data[\"resourceType\"]\n\n    inst2 = schedule.Schedule(**data)\n    impl_schedule_3(inst2)\n\n\ndef impl_schedule_4(inst):\n    assert inst.active is True\n    assert inst.actor[0].display == \"Dr. Beverly Crusher\"\n    assert inst.actor[0].reference == \"Practitioner/1\"\n    assert inst.actor[1].display == \"Starfleet HQ Sickbay\"\n    assert inst.actor[1].reference == \"Location/2\"\n    assert inst.comment == (\n        \"The slots attached to this schedule are for neurosurgery \"\n        \"operations at Starfleet HQ only.\"\n    )\n    assert inst.id == \"exampleloc2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/scheduleid\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"usual\"\n    assert inst.identifier[0].value == \"47\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.planningHorizon.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-25T09:30:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.planningHorizon.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-12-25T09:15:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.serviceCategory[0].coding[0].code == \"31\"\n    assert inst.serviceCategory[0].coding[0].display == \"Specialist Surgical\"\n    assert (\n        inst.serviceCategory[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/service-category\"}\n        ).valueUri\n    )\n    assert inst.serviceType[0].concept.coding[0].code == \"221\"\n    assert inst.serviceType[0].concept.coding[0].display == \"Surgery - General\"\n    assert (\n        inst.serviceType[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/service-type\"}\n        ).valueUri\n    )\n    assert inst.specialty[0].coding[0].code == \"394610002\"\n    assert inst.specialty[0].coding[0].display == \"Surgery-Neurosurgery\"\n    assert (\n        inst.specialty[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_schedule_4(base_settings):\n    \"\"\"No. 4 tests collection for Schedule.\n    Test File: schedule-provider-location2-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"schedule-provider-location2-example.json\"\n    )\n    inst = schedule.Schedule.model_validate_json(filename.read_bytes())\n    assert \"Schedule\" == inst.get_resource_type()\n\n    impl_schedule_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Schedule\" == data[\"resourceType\"]\n\n    inst2 = schedule.Schedule(**data)\n    impl_schedule_4(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_searchparameter.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SearchParameter\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import searchparameter\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_searchparameter_1(inst):\n    assert inst.base[0] == \"Patient\"\n    assert inst.code == \"part-agree\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == (\n        \"Search by url for a participation agreement, which is stored\"\n        \" as an extension referencing a DocumentReference\"\n    )\n    assert inst.experimental is True\n    assert inst.expression == (\n        \"Patient.extension('http://example.org/fhir/StructureDefiniti\"\n        \"on/participation-agreement').value\"\n    )\n    assert inst.id == \"example-extension\"\n    assert inst.name == \"ExampleSearchParameterOnAnExtension\"\n    assert inst.processingMode == \"normal\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.status == \"draft\"\n    assert inst.target[0] == \"DocumentReference\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Example Search Parameter on an extension\"\n    assert inst.type == \"reference\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/example-extension\"}\n        ).valueUri\n    )\n\n\ndef test_searchparameter_1(base_settings):\n    \"\"\"No. 1 tests collection for SearchParameter.\n    Test File: searchparameter-example-extension.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"searchparameter-example-extension.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_1(inst2)\n\n\ndef impl_searchparameter_2(inst):\n    assert inst.base[0] == \"Resource\"\n    assert inst.code == \"_filter\"\n    assert inst.contact[0].name == \"FHIR Project\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-07-26\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This is the formal declaration for the _filter parameter, \"\n        \"documented at [http://hl7.org/fhir/search_filter.html](http:\"\n        \"//hl7.org/fhir/search_filter.html)\"\n    )\n    assert inst.experimental is False\n    assert inst.id == \"filter\"\n    assert inst.name == \"FilterSearchParameter\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.purpose == (\n        \"Support combination searches when the simple name=value \"\n        \"basis of search cannot express what is required\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Filter Search Parameter\"\n    assert inst.type == \"special\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/filter\"}\n        ).valueUri\n    )\n    assert inst.version == \"1\"\n\n\ndef test_searchparameter_2(base_settings):\n    \"\"\"No. 2 tests collection for SearchParameter.\n    Test File: searchparameter-filter.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"searchparameter-filter.json\"\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_2(inst2)\n\n\ndef impl_searchparameter_3(inst):\n    assert inst.base[0] == \"Bundle\"\n    assert inst.code == \"example-constraint\"\n    assert inst.constraint == (\n        \"Bundle.type = 'document' and Bundle.entry[0].resource is \" \"Composition\"\n    )\n    assert inst.description == \"Search Composition Bundle\"\n    assert inst.experimental is True\n    assert inst.expression == \"Bundle.entry[0].resource\"\n    assert inst.id == \"example-constraint\"\n    assert inst.name == \"Exampleconstraint\"\n    assert inst.processingMode == \"normal\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.status == \"draft\"\n    assert inst.target[0] == \"Composition\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"example-constraint\"\n    assert inst.type == \"reference\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/example-constraint\"}\n        ).valueUri\n    )\n\n\ndef test_searchparameter_3(base_settings):\n    \"\"\"No. 3 tests collection for SearchParameter.\n    Test File: searchparameter-example-constraint.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"searchparameter-example-constraint.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_3(inst2)\n\n\ndef impl_searchparameter_4(inst):\n    assert inst.base[0] == \"Condition\"\n    assert inst.chain[0] == \"name\"\n    assert inst.chain[1] == \"identifier\"\n    assert inst.code == \"subject\"\n    assert inst.contact[0].name == \"[string]\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-10-23\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Search by condition subject\"\n    assert inst.experimental is True\n    assert inst.expression == \"Condition.subject\"\n    assert inst.id == \"example-reference\"\n    assert inst.modifier[0] == \"missing\"\n    assert inst.name == \"ExampleSearchParameter\"\n    assert inst.processingMode == \"normal\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.purpose == \"Need to search Condition by subject\"\n    assert inst.status == \"draft\"\n    assert inst.target[0] == \"Organization\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Example Search Parameter\"\n    assert inst.type == \"reference\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/example-reference\"}\n        ).valueUri\n    )\n\n\ndef test_searchparameter_4(base_settings):\n    \"\"\"No. 4 tests collection for SearchParameter.\n    Test File: searchparameter-example-reference.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"searchparameter-example-reference.json\"\n    )\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_4(inst2)\n\n\ndef impl_searchparameter_5(inst):\n    assert inst.base[0] == \"Resource\"\n    assert inst.code == \"_id\"\n    assert inst.contact[0].name == \"[string]\"\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-10-23\"}\n        ).valueDateTime\n    )\n    assert inst.derivedFrom == \"http://hl7.org/fhir/SearchParameter/Resource-id\"\n    assert inst.description == (\n        \"Search by resource identifier - e.g. same as the read \"\n        \"interaction, but can return included resources\"\n    )\n    assert inst.experimental is True\n    assert inst.expression == \"id\"\n    assert inst.id == \"example\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert inst.name == \"IDSEARCHPARAMETER\"\n    assert inst.processingMode == \"normal\"\n    assert inst.publisher == \"Health Level Seven International (FHIR Infrastructure)\"\n    assert inst.purpose == (\n        \"Need to search by identifier for various infrastructural \"\n        \"cases - mainly retrieving packages, and matching as part of \"\n        \"a chain\"\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"I D- S E A R C H- P A R A M E T E R\"\n    assert inst.type == \"token\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/SearchParameter/example\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"positive\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variant-state\"}\n        ).valueUri\n    )\n    assert inst.version == \"1\"\n\n\ndef test_searchparameter_5(base_settings):\n    \"\"\"No. 5 tests collection for SearchParameter.\n    Test File: searchparameter-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"searchparameter-example.json\"\n    inst = searchparameter.SearchParameter.model_validate_json(filename.read_bytes())\n    assert \"SearchParameter\" == inst.get_resource_type()\n\n    impl_searchparameter_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SearchParameter\" == data[\"resourceType\"]\n\n    inst2 = searchparameter.SearchParameter(**data)\n    impl_searchparameter_5(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_servicerequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ServiceRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import servicerequest\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_servicerequest_1(inst):\n    assert inst.code.concept.coding[0].code == \"3981005\"\n    assert (\n        inst.code.concept.coding[0].display\n        == \"Carrier detection, molecular genetics (procedure)\"\n    )\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/denovoEncounter\"\n    assert inst.id == \"genomicServiceRequest\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/serviceRequests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"LACSN\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"Laboratory Accession ID\"\n    assert inst.identifier[0].value == \"111111111\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/denovoChild\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_1(base_settings):\n    \"\"\"No. 1 tests collection for ServiceRequest.\n    Test File: ServiceRequest-genomicServiceRequest.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"ServiceRequest-genomicServiceRequest.json\"\n    )\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_1(inst2)\n\n\ndef impl_servicerequest_2(inst):\n    assert inst.asNeededCodeableConcept.text == \"as needed to clear mucus\"\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T17:23:07Z\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].reference == \"CarePlan/gpvisit\"\n    assert inst.code.concept.coding[0].code == \"34431008\"\n    assert (\n        inst.code.concept.coding[0].display == \"Physiotherapy of chest (regime/therapy)\"\n    )\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"signature\"\n    assert inst.contained[1].id == \"cystic-fibrosis\"\n    assert inst.id == \"physiotherapy\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealth.org/placer-ids\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"PLAC\"\n    assert inst.identifier[0].type.coding[0].display == \"Placer Identifier\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"Placer\"\n    assert inst.identifier[0].value == \"20170201-0001\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert float(inst.occurrenceTiming.repeat.duration) == float(15)\n    assert float(inst.occurrenceTiming.repeat.durationMax) == float(25)\n    assert inst.occurrenceTiming.repeat.durationUnit == \"min\"\n    assert inst.occurrenceTiming.repeat.frequency == 1\n    assert inst.occurrenceTiming.repeat.frequencyMax == 4\n    assert float(inst.occurrenceTiming.repeat.period) == float(1)\n    assert inst.occurrenceTiming.repeat.periodUnit == \"d\"\n    assert inst.reason[0].reference.reference == \"#cystic-fibrosis\"\n    assert inst.relevantHistory[0].display == \"Author's Signature\"\n    assert inst.relevantHistory[0].reference == \"#signature\"\n    assert inst.requester.display == \"Dr Adam Careful\"\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_2(base_settings):\n    \"\"\"No. 2 tests collection for ServiceRequest.\n    Test File: servicerequest-example2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"servicerequest-example2.json\"\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_2(inst2)\n\n\ndef impl_servicerequest_3(inst):\n    assert inst.code.concept.coding[0].code == \"3981005\"\n    assert (\n        inst.code.concept.coding[0].display\n        == \"Carrier detection, molecular genetics (procedure)\"\n    )\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.encounter.reference == \"Encounter/denovoEncounter\"\n    assert inst.id == \"genomicSRMother\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/serviceRequests\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"LACSN\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"Laboratory Accession ID\"\n    assert inst.identifier[0].value == \"111111116\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/mother\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_3(base_settings):\n    \"\"\"No. 3 tests collection for ServiceRequest.\n    Test File: ServiceRequest-genomicSRMother.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"ServiceRequest-genomicSRMother.json\"\n    )\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_3(inst2)\n\n\ndef impl_servicerequest_4(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-02-01T17:23:07Z\"}\n        ).valueDateTime\n    )\n    assert inst.code.concept.coding[0].code == \"359962006\"\n    assert inst.code.concept.coding[0].display == \"Turning patient in bed (procedure)\"\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.doNotPerform is True\n    assert inst.id == \"do-not-turn\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://goodhealth.org/placer-ids\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"20170201-0002\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.priority == \"stat\"\n    assert inst.reason[0].reference.display == \"Patient has a spinal fracture\"\n    assert inst.requester.display == \"Dr Adam Careful\"\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_4(base_settings):\n    \"\"\"No. 4 tests collection for ServiceRequest.\n    Test File: servicerequest-example3.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"servicerequest-example3.json\"\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_4(inst2)\n\n\ndef impl_servicerequest_5(inst):\n    assert inst.code.concept.coding[0].code == \"LIPID\"\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/tests\"}\n        ).valueUri\n    )\n    assert inst.code.concept.text == \"Lipid Panel\"\n    assert inst.contained[0].id == \"fasting\"\n    assert inst.contained[1].id == \"serum\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert inst.id == \"lipid\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:oid:1.3.4.5.6.7\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.coding[0].code == \"PLAC\"\n    assert (\n        inst.identifier[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0203\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].type.text == \"Placer\"\n    assert inst.identifier[0].value == \"2345234234234\"\n    assert inst.intent == \"original-order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"patient is afraid of needles\"\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2013-05-02T16:16:00-07:00\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].reference == \"Practitioner/f202\"\n    assert inst.reason[0].concept.coding[0].code == \"V173\"\n    assert inst.reason[0].concept.coding[0].display == \"Fam hx-ischem heart dis\"\n    assert (\n        inst.reason[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/sid/icd-9\"}\n        ).valueUri\n    )\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert inst.specimen[0].display == \"Serum specimen\"\n    assert inst.specimen[0].reference == \"#serum\"\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.supportingInfo[0].reference.display == \"Fasting status\"\n    assert inst.supportingInfo[0].reference.reference == \"#fasting\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_5(base_settings):\n    \"\"\"No. 5 tests collection for ServiceRequest.\n    Test File: servicerequest-example-lipid.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"servicerequest-example-lipid.json\"\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_5(inst2)\n\n\ndef impl_servicerequest_6(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-05\"}\n        ).valueDateTime\n    )\n    assert inst.code.concept.coding[0].code == \"76164006\"\n    assert inst.code.concept.coding[0].display == \"Biopsy of colon (procedure)\"\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.concept.text == \"Biopsy of colon\"\n    assert inst.id == \"colon-biopsy\"\n    assert inst.identifier[0].value == \"12345\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Dr Adam Careful\"\n    assert inst.performer[0].reference == \"Practitioner/example\"\n    assert inst.requester.display == \"Dr. Beverly Crusher\"\n    assert (\n        inst.requester.reference == \"Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809\"\n    )\n    assert (\n        inst.requisition.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://bumc.org/requisitions\"}\n        ).valueUri\n    )\n    assert inst.requisition.value == \"req12345\"\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_6(base_settings):\n    \"\"\"No. 6 tests collection for ServiceRequest.\n    Test File: servicerequest-example-colonoscopy-bx.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"servicerequest-example-colonoscopy-bx.json\"\n    )\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_6(inst2)\n\n\ndef impl_servicerequest_7(inst):\n    assert inst.code.concept.coding[0].code == \"229115003\"\n    assert inst.code.concept.coding[0].display == \"Bench Press (regime/therapy)\"\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"benchpress\"\n    assert inst.intent == \"plan\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.occurrenceTiming.repeat.count == 20\n    assert inst.occurrenceTiming.repeat.countMax == 30\n    assert inst.occurrenceTiming.repeat.frequency == 3\n    assert float(inst.occurrenceTiming.repeat.period) == float(1)\n    assert inst.occurrenceTiming.repeat.periodUnit == \"wk\"\n    assert inst.patientInstruction[0].instructionMarkdown == (\n        \"Start with 30kg 10-15 repetitions for three sets and \"\n        \"increase in increments of 5kg when you feel ready\"\n    )\n    assert inst.status == \"active\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_7(base_settings):\n    \"\"\"No. 7 tests collection for ServiceRequest.\n    Test File: servicerequest-example4.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"servicerequest-example4.json\"\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_7(inst2)\n\n\ndef impl_servicerequest_8(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.category[0].coding[0].code == \"311401005\"\n    assert inst.category[0].coding[0].display == \"Patient education (procedure)\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.category[0].text == \"Education\"\n    assert inst.code.concept.coding[0].code == \"48023004\"\n    assert (\n        inst.code.concept.coding[0].display\n        == \"Breast self-examination technique education (procedure)\"\n    )\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.concept.text == \"Health education - breast examination\"\n    assert inst.id == \"education\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-08-16\"}\n        ).valueDateTime\n    )\n    assert inst.performer[0].display == \"Pamela Educator, RN\"\n    assert inst.reason[0].concept.text == \"early detection of breast mass\"\n    assert inst.requester.display == \"Angela Care, MD\"\n    assert inst.status == \"completed\"\n    assert inst.subject.display == \"Jane Doe\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_8(base_settings):\n    \"\"\"No. 8 tests collection for ServiceRequest.\n    Test File: servicerequest-example-edu.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"servicerequest-example-edu.json\"\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_8(inst2)\n\n\ndef impl_servicerequest_9(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-02-20\"}\n        ).valueDateTime\n    )\n    assert inst.code.concept.coding[0].code == \"40617009\"\n    assert inst.code.concept.coding[0].display == \"Artificial respiration (procedure)\"\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.concept.text == \"Mechanical Ventilation\"\n    assert inst.id == \"vent\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.performer[0].display == \"Dr Cecil Surgeon\"\n    assert inst.performer[0].reference == \"Practitioner/example\"\n    assert inst.reason[0].concept.text == \"chronic obstructive lung disease (COLD)\"\n    assert inst.requester.display == \"Dr. Beverly Crusher\"\n    assert (\n        inst.requester.reference == \"Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809\"\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_9(base_settings):\n    \"\"\"No. 9 tests collection for ServiceRequest.\n    Test File: servicerequest-example-ventilation.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"servicerequest-example-ventilation.json\"\n    )\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_9(inst2)\n\n\ndef impl_servicerequest_10(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-05\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].display == \"Maternity care plan\"\n    assert inst.basedOn[0].reference == \"CarePlan/preg\"\n    assert inst.code.concept.coding[0].code == \"62013009\"\n    assert inst.code.concept.coding[0].display == \"Ambulating patient (procedure)\"\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.code.concept.text == \"Ambulation\"\n    assert inst.id == \"ambulation\"\n    assert inst.identifier[0].value == \"45678\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.reason[0].reference.display == \"Blood Pressure\"\n    assert inst.reason[0].reference.reference == \"Observation/blood-pressure\"\n    assert inst.requester.display == \"Dr. Beverly Crusher\"\n    assert (\n        inst.requester.reference == \"Practitioner/3ad0687e-f477-468c-afd5-fcc2bf897809\"\n    )\n    assert inst.status == \"completed\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_servicerequest_10(base_settings):\n    \"\"\"No. 10 tests collection for ServiceRequest.\n    Test File: servicerequest-example-ambulation.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"servicerequest-example-ambulation.json\"\n    )\n    inst = servicerequest.ServiceRequest.model_validate_json(filename.read_bytes())\n    assert \"ServiceRequest\" == inst.get_resource_type()\n\n    impl_servicerequest_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ServiceRequest\" == data[\"resourceType\"]\n\n    inst2 = servicerequest.ServiceRequest(**data)\n    impl_servicerequest_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_slot.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Slot\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import slot\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_slot_1(inst):\n    assert inst.comment == (\n        \"Assessments should be performed before requesting \"\n        \"appointments in this slot.\"\n    )\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:15:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/identifiers/slots\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"123132\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.overbooked is True\n    assert inst.schedule.reference == \"Schedule/example\"\n    assert inst.serviceCategory[0].coding[0].code == \"17\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"busy\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_slot_1(base_settings):\n    \"\"\"No. 1 tests collection for Slot.\n    Test File: slot-example-busy.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"slot-example-busy.json\"\n    inst = slot.Slot.model_validate_json(filename.read_bytes())\n    assert \"Slot\" == inst.get_resource_type()\n\n    impl_slot_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Slot\" == data[\"resourceType\"]\n\n    inst2 = slot.Slot(**data)\n    impl_slot_1(inst2)\n\n\ndef impl_slot_2(inst):\n    assert inst.appointmentType[0].coding[0].code == \"WALKIN\"\n    assert (\n        inst.appointmentType[0].coding[0].display\n        == \"A previously unscheduled walk-in visit\"\n    )\n    assert (\n        inst.appointmentType[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0276\"}\n        ).valueUri\n    )\n    assert inst.comment == (\n        \"Assessments should be performed before requesting \"\n        \"appointments in this slot.\"\n    )\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:30:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.schedule.reference == \"Schedule/example\"\n    assert inst.serviceCategory[0].coding[0].code == \"17\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert inst.serviceType[0].concept.coding[0].code == \"57\"\n    assert inst.serviceType[0].concept.coding[0].display == \"Immunization\"\n    assert inst.specialty[0].coding[0].code == \"408480009\"\n    assert inst.specialty[0].coding[0].display == \"Clinical immunology\"\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:15:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"free\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_slot_2(base_settings):\n    \"\"\"No. 2 tests collection for Slot.\n    Test File: slot-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"slot-example.json\"\n    inst = slot.Slot.model_validate_json(filename.read_bytes())\n    assert \"Slot\" == inst.get_resource_type()\n\n    impl_slot_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Slot\" == data[\"resourceType\"]\n\n    inst2 = slot.Slot(**data)\n    impl_slot_2(inst2)\n\n\ndef impl_slot_3(inst):\n    assert inst.comment == (\n        \"Assessments should be performed before requesting \"\n        \"appointments in this slot.\"\n    )\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-12-25T09:30:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"example-hcs\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.schedule.reference == \"Schedule/example-hcs\"\n    assert (\n        inst.serviceType[0].reference.display\n        == \"Burgers UMC, Posttraumatic Stress Disorder Clinic\"\n    )\n    assert inst.serviceType[0].reference.reference == \"HealthcareService/example\"\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-12-25T09:15:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"free\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_slot_3(base_settings):\n    \"\"\"No. 3 tests collection for Slot.\n    Test File: slot-example-hcs.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"slot-example-hcs.json\"\n    inst = slot.Slot.model_validate_json(filename.read_bytes())\n    assert \"Slot\" == inst.get_resource_type()\n\n    impl_slot_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Slot\" == data[\"resourceType\"]\n\n    inst2 = slot.Slot(**data)\n    impl_slot_3(inst2)\n\n\ndef impl_slot_4(inst):\n    assert inst.comment == \"Dr Careful is out of the office\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:45:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"3\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.schedule.reference == \"Schedule/example\"\n    assert inst.serviceCategory[0].coding[0].code == \"17\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:30:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"busy-unavailable\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_slot_4(base_settings):\n    \"\"\"No. 4 tests collection for Slot.\n    Test File: slot-example-unavailable.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"slot-example-unavailable.json\"\n    inst = slot.Slot.model_validate_json(filename.read_bytes())\n    assert \"Slot\" == inst.get_resource_type()\n\n    impl_slot_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Slot\" == data[\"resourceType\"]\n\n    inst2 = slot.Slot(**data)\n    impl_slot_4(inst2)\n\n\ndef impl_slot_5(inst):\n    assert inst.comment == \"Dr Careful is out of the office\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T10:00:00Z\"}\n        ).valueInstant\n    )\n    assert inst.id == \"2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.schedule.reference == \"Schedule/example\"\n    assert inst.serviceCategory[0].coding[0].code == \"17\"\n    assert inst.serviceCategory[0].coding[0].display == \"General Practice\"\n    assert (\n        inst.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2013-12-25T09:45:00Z\"}\n        ).valueInstant\n    )\n    assert inst.status == \"busy-tentative\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_slot_5(base_settings):\n    \"\"\"No. 5 tests collection for Slot.\n    Test File: slot-example-tentative.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"slot-example-tentative.json\"\n    inst = slot.Slot.model_validate_json(filename.read_bytes())\n    assert \"Slot\" == inst.get_resource_type()\n\n    impl_slot_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Slot\" == data[\"resourceType\"]\n\n    inst2 = slot.Slot(**data)\n    impl_slot_5(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_specimen.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Specimen\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import specimen\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_specimen_1(inst):\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/practitioner01\"\n    assert inst.collection.method.coding[0].code == \"LNV\"\n    assert (\n        inst.collection.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0488\"}\n        ).valueUri\n    )\n    assert inst.collection.quantity.unit == \"mL\"\n    assert float(inst.collection.quantity.value) == float(1)\n    assert inst.id == \"denovo-2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/specimens\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"2\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.receivedTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:01Z\"}\n        ).valueDateTime\n    )\n    assert inst.request[0].reference == \"ServiceRequest/genomicServiceRequest\"\n    assert inst.status == \"available\"\n    assert inst.subject.display == \"Jane Doe\"\n    assert inst.subject.reference == \"Patient/denovoMother\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"122555007\"\n    assert inst.type.coding[0].display == \"Venous blood specimen\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_1(base_settings):\n    \"\"\"No. 1 tests collection for Specimen.\n    Test File: Specimen-denovo-2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Specimen-denovo-2.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_1(inst2)\n\n\ndef impl_specimen_2(inst):\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/practitioner01\"\n    assert inst.collection.method.coding[0].code == \"LNV\"\n    assert (\n        inst.collection.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0488\"}\n        ).valueUri\n    )\n    assert inst.collection.quantity.unit == \"mL\"\n    assert float(inst.collection.quantity.value) == float(1)\n    assert inst.id == \"denovo-3\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/specimens\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"3\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.receivedTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:01Z\"}\n        ).valueDateTime\n    )\n    assert inst.request[0].reference == \"ServiceRequest/genomicServiceRequest\"\n    assert inst.status == \"available\"\n    assert inst.subject.display == \"John Doe\"\n    assert inst.subject.reference == \"Patient/denovoFather\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"122555007\"\n    assert inst.type.coding[0].display == \"Venous blood specimen\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_2(base_settings):\n    \"\"\"No. 2 tests collection for Specimen.\n    Test File: Specimen-denovo-3.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Specimen-denovo-3.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_2(inst2)\n\n\ndef impl_specimen_3(inst):\n    assert (\n        inst.accessionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://lab.acme.org/specimens/2011\"}\n        ).valueUri\n    )\n    assert inst.accessionIdentifier.value == \"X352356-ISO1\"\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-16T07:03:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/f202\"\n    assert inst.collection.method.coding[0].code == \"BAP\"\n    assert (\n        inst.collection.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0488\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"stool\"\n    assert inst.id == \"isolate\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Patient dropped off specimen\"\n    assert inst.parent[0].reference == \"#stool\"\n    assert (\n        inst.receivedTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-18T07:03:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.role[0].coding[0].code == \"p\"\n    assert inst.role[0].coding[0].display == \"Patient\"\n    assert inst.status == \"available\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"429951000124103\"\n    assert inst.type.coding[0].display == \"Bacterial isolate specimen\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_3(base_settings):\n    \"\"\"No. 3 tests collection for Specimen.\n    Test File: specimen-example-isolate.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"specimen-example-isolate.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_3(inst2)\n\n\ndef impl_specimen_4(inst):\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/practitioner01\"\n    assert inst.collection.method.coding[0].code == \"LNV\"\n    assert (\n        inst.collection.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0488\"}\n        ).valueUri\n    )\n    assert inst.collection.quantity.unit == \"mL\"\n    assert float(inst.collection.quantity.value) == float(1)\n    assert inst.id == \"specimenMother\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/specimens\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"6\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.receivedTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:01Z\"}\n        ).valueDateTime\n    )\n    assert inst.request[0].reference == \"ServiceRequest/genomicServiceRequest\"\n    assert inst.status == \"available\"\n    assert inst.subject.display == \"Jane Doe\"\n    assert inst.subject.reference == \"Patient/mother\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"122555007\"\n    assert inst.type.coding[0].display == \"Venous blood specimen\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_4(base_settings):\n    \"\"\"No. 4 tests collection for Specimen.\n    Test File: Specimen-specimenMother.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Specimen-specimenMother.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_4(inst2)\n\n\ndef impl_specimen_5(inst):\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/practitioner01\"\n    assert inst.collection.method.coding[0].code == \"LNV\"\n    assert (\n        inst.collection.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0488\"}\n        ).valueUri\n    )\n    assert inst.collection.quantity.unit == \"mL\"\n    assert float(inst.collection.quantity.value) == float(1)\n    assert inst.id == \"specimenProband\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/specimens\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"5\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.receivedTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:01Z\"}\n        ).valueDateTime\n    )\n    assert inst.request[0].reference == \"ServiceRequest/genomicServiceRequest\"\n    assert inst.status == \"available\"\n    assert inst.subject.display == \"Child Junior Doe\"\n    assert inst.subject.reference == \"Patient/proband\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"122555007\"\n    assert inst.type.coding[0].display == \"Venous blood specimen\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_5(base_settings):\n    \"\"\"No. 5 tests collection for Specimen.\n    Test File: Specimen-specimenProband.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Specimen-specimenProband.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_5(inst2)\n\n\ndef impl_specimen_6(inst):\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/practitioner01\"\n    assert inst.collection.method.coding[0].code == \"LNV\"\n    assert (\n        inst.collection.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0488\"}\n        ).valueUri\n    )\n    assert inst.collection.quantity.unit == \"mL\"\n    assert float(inst.collection.quantity.value) == float(1)\n    assert inst.id == \"specimenFather\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/specimens\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"7\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.receivedTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:01Z\"}\n        ).valueDateTime\n    )\n    assert inst.request[0].reference == \"ServiceRequest/genomicServiceRequest\"\n    assert inst.status == \"available\"\n    assert inst.subject.display == \"John Doe\"\n    assert inst.subject.reference == \"Patient/father\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"122555007\"\n    assert inst.type.coding[0].display == \"Venous blood specimen\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_6(base_settings):\n    \"\"\"No. 6 tests collection for Specimen.\n    Test File: Specimen-specimenFather.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Specimen-specimenFather.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_6(inst2)\n\n\ndef impl_specimen_7(inst):\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-03-01T01:01:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/practitioner01\"\n    assert inst.collection.method.coding[0].code == \"129314006\"\n    assert inst.collection.method.coding[0].display == \"Biopsy - action\"\n    assert (\n        inst.collection.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.collection.quantity.unit == \"mm2\"\n    assert float(inst.collection.quantity.value) == float(1)\n    assert inst.id == \"genomicSpecimen\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/specimens\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"4\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.receivedTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-03-01T01:01:01Z\"}\n        ).valueDateTime\n    )\n    assert inst.request[0].reference == \"ServiceRequest/genomicServiceRequest\"\n    assert inst.status == \"available\"\n    assert inst.subject.display == \"John Doe\"\n    assert inst.subject.reference == \"Patient/genomicPatient\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"122610009\"\n    assert (\n        inst.type.coding[0].display\n        == \"Specimen from lung obtained by biopsy (specimen)\"\n    )\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_7(base_settings):\n    \"\"\"No. 7 tests collection for Specimen.\n    Test File: Specimen-genomicSpecimen.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Specimen-genomicSpecimen.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_7(inst2)\n\n\ndef impl_specimen_8(inst):\n    assert (\n        inst.accessionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://vetmed.iastate.edu/vdl\"}\n        ).valueUri\n    )\n    assert inst.accessionIdentifier.value == \"20171120-1234\"\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-11-14\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.display == \"James Herriot, FRCVS\"\n    assert inst.combined == \"pooled\"\n    assert (\n        inst.container[0].device.reference\n        == \"Device/device-example-specimen-container-red-top-vacutainer\"\n    )\n    assert inst.id == \"pooled-serum\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.note[0].text == \"Pooled serum sample from 30 individuals\"\n    assert inst.subject.reference == \"Group/herd1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"Serum sample, pooled\"\n    assert inst.type.coding[0].display == \"Serum sample, pooled\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://vetmed.iastate.edu/vdl\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"Pooled serum sample\"\n\n\ndef test_specimen_8(base_settings):\n    \"\"\"No. 8 tests collection for Specimen.\n    Test File: specimen-example-pooled-serum.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"specimen-example-pooled-serum.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_8(inst2)\n\n\ndef impl_specimen_9(inst):\n    assert (\n        inst.accessionIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://lab.acme.org/specimens/2015\"}\n        ).valueUri\n    )\n    assert inst.accessionIdentifier.value == \"X352356\"\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-18T07:03:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/f202\"\n    assert (\n        inst.container[0].device.reference\n        == \"Device/device-example-specimen-container-polycup\"\n    )\n    assert inst.container[0].specimenQuantity.unit == \"mls\"\n    assert float(inst.container[0].specimenQuantity.value) == float(10)\n    assert inst.id == \"vma-urine\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.processing[0].additive[0].display == \"6 N HCl\"\n    assert inst.processing[0].description == \"Acidify to pH < 3.0 with 6 N HCl.\"\n    assert inst.processing[0].method.coding[0].code == \"ACID\"\n    assert (\n        inst.processing[0].method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0373\"}\n        ).valueUri\n    )\n    assert (\n        inst.processing[0].timeDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-18T08:10:00Z\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.receivedTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2015-08-18T07:03:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.status == \"available\"\n    assert inst.subject.reference == \"Patient/example\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"RANDU\"\n    assert inst.type.coding[0].display == \"Urine, Random\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0487\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_9(base_settings):\n    \"\"\"No. 9 tests collection for Specimen.\n    Test File: specimen-example-urine.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"specimen-example-urine.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_9(inst2)\n\n\ndef impl_specimen_10(inst):\n    assert (\n        inst.collection.collectedDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:00Z\"}\n        ).valueDateTime\n    )\n    assert inst.collection.collector.reference == \"Practitioner/practitioner01\"\n    assert inst.collection.method.coding[0].code == \"LNV\"\n    assert (\n        inst.collection.method.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0488\"}\n        ).valueUri\n    )\n    assert inst.collection.quantity.unit == \"mL\"\n    assert float(inst.collection.quantity.value) == float(1)\n    assert inst.id == \"denovo-1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.somesystemabc.net/identifiers/specimens\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"1\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.receivedTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2021-01-01T01:01:01Z\"}\n        ).valueDateTime\n    )\n    assert inst.request[0].reference == \"ServiceRequest/genomicServiceRequest\"\n    assert inst.status == \"available\"\n    assert inst.subject.display == \"Child Junior Doe\"\n    assert inst.subject.reference == \"Patient/denovoChild\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"122555007\"\n    assert inst.type.coding[0].display == \"Venous blood specimen\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n\n\ndef test_specimen_10(base_settings):\n    \"\"\"No. 10 tests collection for Specimen.\n    Test File: Specimen-denovo-1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"Specimen-denovo-1.json\"\n    inst = specimen.Specimen.model_validate_json(filename.read_bytes())\n    assert \"Specimen\" == inst.get_resource_type()\n\n    impl_specimen_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Specimen\" == data[\"resourceType\"]\n\n    inst2 = specimen.Specimen(**data)\n    impl_specimen_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_specimendefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SpecimenDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import specimendefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_specimendefinition_1(inst):\n    assert inst.experimental is False\n    assert inst.id == \"2364\"\n    assert inst.identifier.value == \"12345\"\n    assert inst.patientPreparation[0].text == \"12 hour fasting\"\n    assert inst.patientPreparation[1].coding[0].code == \"263678003\"\n    assert inst.patientPreparation[1].coding[0].display == \"At rest\"\n    assert (\n        inst.patientPreparation[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.timeAspect == \"preferrably morning time\"\n    assert inst.title == \"Example Specimen Definition for Testing\"\n    assert inst.typeCollected.coding[0].code == \"122555007\"\n    assert inst.typeCollected.coding[0].display == \"Venous blood specimen\"\n    assert (\n        inst.typeCollected.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].container.cap.coding[0].code == \"yellow\"\n    assert inst.typeTested[0].container.cap.coding[0].display == \"yellow cap\"\n    assert (\n        inst.typeTested[0].container.cap.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:6710:2017\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].container.material.coding[0].code == \"61088005\"\n    assert inst.typeTested[0].container.material.coding[0].display == \"plastic\"\n    assert (\n        inst.typeTested[0].container.material.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].container.minimumVolumeQuantity.code == \"mL\"\n    assert (\n        inst.typeTested[0].container.minimumVolumeQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].container.minimumVolumeQuantity.unit == \"ml\"\n    assert float(inst.typeTested[0].container.minimumVolumeQuantity.value) == float(2)\n    assert inst.typeTested[0].container.type.coding[0].code == \"702281005\"\n    assert inst.typeTested[0].container.type.coding[0].display == (\n        \"Evacuated blood collection tube, thrombin/clot activator/gel\" \" separator\"\n    )\n    assert (\n        inst.typeTested[0].container.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[0].maxDuration.code == \"min\"\n    assert (\n        inst.typeTested[0].handling[0].maxDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[0].maxDuration.unit == \"minute\"\n    assert float(inst.typeTested[0].handling[0].maxDuration.value) == float(60)\n    assert (\n        inst.typeTested[0].handling[0].temperatureQualifier.text\n        == \"Ambient temperature\"\n    )\n    assert inst.typeTested[0].handling[0].temperatureRange.high.code == \"Cel\"\n    assert (\n        inst.typeTested[0].handling[0].temperatureRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[0].temperatureRange.high.unit == \"°C\"\n    assert float(inst.typeTested[0].handling[0].temperatureRange.high.value) == float(\n        25\n    )\n    assert inst.typeTested[0].handling[0].temperatureRange.low.code == \"Cel\"\n    assert (\n        inst.typeTested[0].handling[0].temperatureRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[0].temperatureRange.low.unit == \"°C\"\n    assert float(inst.typeTested[0].handling[0].temperatureRange.low.value) == float(15)\n    assert inst.typeTested[0].handling[1].maxDuration.code == \"h\"\n    assert (\n        inst.typeTested[0].handling[1].maxDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[1].maxDuration.unit == \"hour\"\n    assert float(inst.typeTested[0].handling[1].maxDuration.value) == float(8)\n    assert (\n        inst.typeTested[0].handling[1].temperatureQualifier.text\n        == \"Refrigerated temperature\"\n    )\n    assert inst.typeTested[0].handling[1].temperatureRange.high.code == \"Cel\"\n    assert (\n        inst.typeTested[0].handling[1].temperatureRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[1].temperatureRange.high.unit == \"°C\"\n    assert float(inst.typeTested[0].handling[1].temperatureRange.high.value) == float(8)\n    assert inst.typeTested[0].handling[1].temperatureRange.low.code == \"Cel\"\n    assert (\n        inst.typeTested[0].handling[1].temperatureRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[1].temperatureRange.low.unit == \"°C\"\n    assert float(inst.typeTested[0].handling[1].temperatureRange.low.value) == float(2)\n    assert inst.typeTested[0].isDerived is False\n    assert inst.typeTested[0].preference == \"preferred\"\n    assert inst.typeTested[0].type.coding[0].code == \"119364003\"\n    assert inst.typeTested[0].type.coding[0].display == \"Serum specimen\"\n    assert (\n        inst.typeTested[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].container.cap.coding[0].code == \"green\"\n    assert inst.typeTested[1].container.cap.coding[0].display == \"green cap\"\n    assert (\n        inst.typeTested[1].container.cap.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:6710:2017\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].container.material.coding[0].code == \"32039001\"\n    assert inst.typeTested[1].container.material.coding[0].display == \"glass\"\n    assert (\n        inst.typeTested[1].container.material.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].container.minimumVolumeQuantity.code == \"mL\"\n    assert (\n        inst.typeTested[1].container.minimumVolumeQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].container.minimumVolumeQuantity.unit == \"ml\"\n    assert float(inst.typeTested[1].container.minimumVolumeQuantity.value) == float(2)\n    assert inst.typeTested[1].container.type.coding[0].code == \"702281005\"\n    assert inst.typeTested[1].container.type.coding[0].display == (\n        \"Evacuated blood collection tube, thrombin/clot activator/gel\" \" separator\"\n    )\n    assert (\n        inst.typeTested[1].container.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[0].maxDuration.code == \"min\"\n    assert (\n        inst.typeTested[1].handling[0].maxDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[0].maxDuration.unit == \"minute\"\n    assert float(inst.typeTested[1].handling[0].maxDuration.value) == float(60)\n    assert (\n        inst.typeTested[1].handling[0].temperatureQualifier.text\n        == \"Ambient temperature\"\n    )\n    assert inst.typeTested[1].handling[0].temperatureRange.high.code == \"Cel\"\n    assert (\n        inst.typeTested[1].handling[0].temperatureRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[0].temperatureRange.high.unit == \"°C\"\n    assert float(inst.typeTested[1].handling[0].temperatureRange.high.value) == float(\n        25\n    )\n    assert inst.typeTested[1].handling[0].temperatureRange.low.code == \"Cel\"\n    assert (\n        inst.typeTested[1].handling[0].temperatureRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[0].temperatureRange.low.unit == \"°C\"\n    assert float(inst.typeTested[1].handling[0].temperatureRange.low.value) == float(15)\n    assert inst.typeTested[1].handling[1].maxDuration.code == \"h\"\n    assert (\n        inst.typeTested[1].handling[1].maxDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[1].maxDuration.unit == \"hour\"\n    assert float(inst.typeTested[1].handling[1].maxDuration.value) == float(8)\n    assert (\n        inst.typeTested[1].handling[1].temperatureQualifier.text\n        == \"Refrigerated temperature\"\n    )\n    assert inst.typeTested[1].handling[1].temperatureRange.high.code == \"Cel\"\n    assert (\n        inst.typeTested[1].handling[1].temperatureRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[1].temperatureRange.high.unit == \"°C\"\n    assert float(inst.typeTested[1].handling[1].temperatureRange.high.value) == float(8)\n    assert inst.typeTested[1].handling[1].temperatureRange.low.code == \"Cel\"\n    assert (\n        inst.typeTested[1].handling[1].temperatureRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].handling[1].temperatureRange.low.unit == \"°C\"\n    assert float(inst.typeTested[1].handling[1].temperatureRange.low.value) == float(2)\n    assert inst.typeTested[1].preference == \"alternate\"\n    assert inst.typeTested[1].rejectionCriterion[0].coding[0].code == \"insufficient\"\n    assert (\n        inst.typeTested[1].rejectionCriterion[0].coding[0].display\n        == \"insufficient specimen volume\"\n    )\n    assert (\n        inst.typeTested[1].rejectionCriterion[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/rejection-criteria\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].rejectionCriterion[1].coding[0].code == \"hemolized\"\n    assert (\n        inst.typeTested[1].rejectionCriterion[1].coding[0].display\n        == \"hemolized specimen\"\n    )\n    assert (\n        inst.typeTested[1].rejectionCriterion[1].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/rejection-criteria\"}\n        ).valueUri\n    )\n    assert inst.typeTested[1].type.coding[0].code == \"119361006\"\n    assert inst.typeTested[1].type.coding[0].display == \"Plasma specimen\"\n    assert (\n        inst.typeTested[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.com/specdef/v1/12345\"}\n        ).valueUri\n    )\n\n\ndef test_specimendefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for SpecimenDefinition.\n    Test File: specimendefinition-example-serum-plasma.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"specimendefinition-example-serum-plasma.json\"\n    )\n    inst = specimendefinition.SpecimenDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"SpecimenDefinition\" == inst.get_resource_type()\n\n    impl_specimendefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SpecimenDefinition\" == data[\"resourceType\"]\n\n    inst2 = specimendefinition.SpecimenDefinition(**data)\n    impl_specimendefinition_1(inst2)\n\n\ndef impl_specimendefinition_2(inst):\n    assert inst.experimental is True\n    assert inst.id == \"7\"\n    assert inst.identifier.value == \"123455\"\n    assert inst.patientPreparation[0].text == \"no strict fasting\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Venous blood specimen\"\n    assert inst.typeCollected.coding[0].code == \"122555007\"\n    assert (\n        inst.typeCollected.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeCollected.text == \"Venous blood specimen (specimen)\"\n    assert inst.typeTested[0].container.cap.coding[0].code == \"yellow\"\n    assert inst.typeTested[0].container.cap.coding[0].display == \"yellow cap\"\n    assert (\n        inst.typeTested[0].container.cap.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/5.1.0/CodeSystem-container-cap.html\"\n            }\n        ).valueUri\n    )\n    assert inst.typeTested[0].container.material.text == \"glass\"\n    assert inst.typeTested[0].container.minimumVolumeQuantity.code == \"mL\"\n    assert (\n        inst.typeTested[0].container.minimumVolumeQuantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].container.minimumVolumeQuantity.unit == \"ml\"\n    assert float(inst.typeTested[0].container.minimumVolumeQuantity.value) == float(2)\n    assert inst.typeTested[0].container.type.coding[0].code == \"702281005\"\n    assert inst.typeTested[0].container.type.coding[0].display == (\n        \"Evacuated blood collection tube with thrombin and clot \"\n        \"activator and gel separator\"\n    )\n    assert (\n        inst.typeTested[0].container.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[0].maxDuration.code == \"h\"\n    assert (\n        inst.typeTested[0].handling[0].maxDuration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert float(inst.typeTested[0].handling[0].maxDuration.value) == float(12)\n    assert inst.typeTested[0].handling[0].temperatureQualifier.coding[0].code == \"room\"\n    assert (\n        inst.typeTested[0].handling[0].temperatureQualifier.coding[0].display\n        == \"room temperature\"\n    )\n    assert inst.typeTested[0].handling[0].temperatureRange.high.code == \"Cel\"\n    assert (\n        inst.typeTested[0].handling[0].temperatureRange.high.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[0].temperatureRange.high.unit == \"°C\"\n    assert float(inst.typeTested[0].handling[0].temperatureRange.high.value) == float(\n        25\n    )\n    assert inst.typeTested[0].handling[0].temperatureRange.low.code == \"Cel\"\n    assert (\n        inst.typeTested[0].handling[0].temperatureRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].handling[0].temperatureRange.low.unit == \"°C\"\n    assert float(inst.typeTested[0].handling[0].temperatureRange.low.value) == float(15)\n    assert inst.typeTested[0].isDerived is True\n    assert inst.typeTested[0].preference == \"preferred\"\n    assert inst.typeTested[0].type.coding[0].code == \"119364003\"\n    assert (\n        inst.typeTested[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.typeTested[0].type.text == \"Serum specimen (specimen)\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example-lab.com/specdef/123455\"}\n        ).valueUri\n    )\n\n\ndef test_specimendefinition_2(base_settings):\n    \"\"\"No. 2 tests collection for SpecimenDefinition.\n    Test File: specimendefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"specimendefinition-example.json\"\n    inst = specimendefinition.SpecimenDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"SpecimenDefinition\" == inst.get_resource_type()\n\n    impl_specimendefinition_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SpecimenDefinition\" == data[\"resourceType\"]\n\n    inst2 = specimendefinition.SpecimenDefinition(**data)\n    impl_specimendefinition_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_structuremap.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/StructureMap\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import structuremap\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_structuremap_1(inst):\n    assert inst.description == \"Transform from an ActivityDefinition to a SupplyRequest\"\n    assert inst.experimental is True\n    assert inst.group[0].input[0].mode == \"source\"\n    assert inst.group[0].input[0].name == \"source\"\n    assert inst.group[0].input[0].type == \"ActivityDefinition\"\n    assert inst.group[0].input[1].mode == \"target\"\n    assert inst.group[0].input[1].name == \"target\"\n    assert inst.group[0].input[1].type == \"SupplyRequest\"\n    assert inst.group[0].name == \"main\"\n    assert inst.group[0].rule[0].name == \"status\"\n    assert inst.group[0].rule[0].source[0].context == \"source\"\n    assert inst.group[0].rule[0].source[0].element == \"id\"\n    assert inst.group[0].rule[0].source[0].variable == \"a\"\n    assert inst.group[0].rule[0].target[0].context == \"target\"\n    assert inst.group[0].rule[0].target[0].element == \"status\"\n    assert inst.group[0].rule[0].target[0].parameter[0].valueString == \"'draft'\"\n    assert inst.group[0].rule[0].target[0].transform == \"evaluate\"\n    assert inst.group[0].rule[1].name == \"category\"\n    assert inst.group[0].rule[1].source[0].context == \"source\"\n    assert inst.group[0].rule[1].source[0].element == \"id\"\n    assert inst.group[0].rule[1].source[0].variable == \"a\"\n    assert inst.group[0].rule[1].target[0].context == \"target\"\n    assert inst.group[0].rule[1].target[0].element == \"category\"\n    assert inst.group[0].rule[1].target[0].parameter[0].valueString == \"'non-stock'\"\n    assert inst.group[0].rule[1].target[0].transform == \"evaluate\"\n    assert inst.group[0].rule[2].name == \"priority\"\n    assert inst.group[0].rule[2].source[0].context == \"source\"\n    assert inst.group[0].rule[2].source[0].element == \"id\"\n    assert inst.group[0].rule[2].source[0].variable == \"a\"\n    assert inst.group[0].rule[2].target[0].context == \"target\"\n    assert inst.group[0].rule[2].target[0].element == \"priority\"\n    assert inst.group[0].rule[2].target[0].parameter[0].valueString == \"'routine'\"\n    assert inst.group[0].rule[2].target[0].transform == \"evaluate\"\n    assert inst.group[0].rule[3].name == \"quantity\"\n    assert inst.group[0].rule[3].source[0].context == \"source\"\n    assert inst.group[0].rule[3].source[0].element == \"quantity\"\n    assert inst.group[0].rule[3].source[0].variable == \"a\"\n    assert inst.group[0].rule[3].target[0].context == \"target\"\n    assert inst.group[0].rule[3].target[0].element == \"category\"\n    assert inst.group[0].rule[3].target[0].transform == \"copy\"\n    assert inst.group[0].rule[4].name == \"item\"\n    assert inst.group[0].rule[4].source[0].context == \"source\"\n    assert inst.group[0].rule[4].source[0].element == \"code\"\n    assert inst.group[0].rule[4].source[0].variable == \"a\"\n    assert inst.group[0].rule[4].target[0].context == \"target\"\n    assert inst.group[0].rule[4].target[0].element == \"item\"\n    assert inst.group[0].rule[4].target[0].transform == \"create\"\n    assert inst.group[0].rule[4].target[0].variable == \"b\"\n    assert inst.group[0].rule[4].target[1].context == \"b\"\n    assert inst.group[0].rule[4].target[1].element == \"concept\"\n    assert inst.group[0].rule[4].target[1].transform == \"copy\"\n    assert inst.group[0].rule[5].name == \"when\"\n    assert inst.group[0].rule[5].source[0].context == \"source\"\n    assert inst.group[0].rule[5].source[0].element == \"id\"\n    assert inst.group[0].rule[5].source[0].variable == \"a\"\n    assert inst.group[0].rule[5].target[0].context == \"target\"\n    assert inst.group[0].rule[5].target[0].element == \"occurrence\"\n    assert inst.group[0].rule[5].target[0].parameter[0].valueString == \"now()\"\n    assert inst.group[0].rule[5].target[0].transform == \"evaluate\"\n    assert inst.group[0].rule[6].name == \"authoredOn\"\n    assert inst.group[0].rule[6].source[0].context == \"source\"\n    assert inst.group[0].rule[6].source[0].element == \"id\"\n    assert inst.group[0].rule[6].source[0].variable == \"a\"\n    assert inst.group[0].rule[6].target[0].context == \"target\"\n    assert inst.group[0].rule[6].target[0].element == \"authoredOn\"\n    assert inst.group[0].rule[6].target[0].parameter[0].valueString == \"now()\"\n    assert inst.group[0].rule[6].target[0].transform == \"evaluate\"\n    assert inst.id == \"supplyrequest-transform\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.13.1\"\n    assert inst.name == \"TransformFromAnActivityDefinitionToASupplyRequest\"\n    assert inst.status == \"draft\"\n    assert inst.structure[0].mode == \"source\"\n    assert (\n        inst.structure[0].url\n        == \"http://hl7.org/fhir/StructureDefinition/ActivityDefinition\"\n    )\n    assert inst.structure[1].mode == \"target\"\n    assert (\n        inst.structure[1].url == \"http://hl7.org/fhir/StructureDefinition/SupplyRequest\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Transform from an ActivityDefinition to a SupplyRequest\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureMap/supplyrequest-transform\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_structuremap_1(base_settings):\n    \"\"\"No. 1 tests collection for StructureMap.\n    Test File: structuremap-supplyrequest-transform.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"structuremap-supplyrequest-transform.json\"\n    )\n    inst = structuremap.StructureMap.model_validate_json(filename.read_bytes())\n    assert \"StructureMap\" == inst.get_resource_type()\n\n    impl_structuremap_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"StructureMap\" == data[\"resourceType\"]\n\n    inst2 = structuremap.StructureMap(**data)\n    impl_structuremap_1(inst2)\n\n\ndef impl_structuremap_2(inst):\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-03-09\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Example Structure Map\"\n    assert inst.experimental is True\n    assert inst.group[0].documentation == \"test -> testValue\"\n    assert inst.group[0].input[0].mode == \"source\"\n    assert inst.group[0].input[0].name == \"testSrc\"\n    assert inst.group[0].input[1].mode == \"target\"\n    assert inst.group[0].input[1].name == \"testTgt\"\n    assert inst.group[0].name == \"Examples\"\n    assert inst.group[0].rule[0].name == \"rule1\"\n    assert inst.group[0].rule[0].source[0].context == \"testSrc\"\n    assert inst.group[0].rule[0].source[0].element == \"test\"\n    assert inst.group[0].rule[0].source[0].type == \"SourceClassA\"\n    assert inst.group[0].rule[0].source[0].variable == \"t\"\n    assert inst.group[0].rule[0].target[0].context == \"testTgt\"\n    assert inst.group[0].rule[0].target[0].element == \"testValue\"\n    assert inst.group[0].rule[0].target[0].transform == \"copy\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.13.2\"\n    assert inst.jurisdiction[0].coding[0].code == \"009\"\n    assert inst.jurisdiction[0].coding[0].display == \"Oceania\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert inst.name == \"ExampleMap\"\n    assert inst.publisher == \"HL7 FHIR Standard\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Example Map\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureMap/example\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_structuremap_2(base_settings):\n    \"\"\"No. 2 tests collection for StructureMap.\n    Test File: structuremap-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"structuremap-example.json\"\n    inst = structuremap.StructureMap.model_validate_json(filename.read_bytes())\n    assert \"StructureMap\" == inst.get_resource_type()\n\n    impl_structuremap_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"StructureMap\" == data[\"resourceType\"]\n\n    inst2 = structuremap.StructureMap(**data)\n    impl_structuremap_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_subscription.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Subscription\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import subscription\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_subscription_1(inst):\n    assert inst.channelType.code == \"rest-hook\"\n    assert inst.content == \"id-only\"\n    assert inst.contentType == \"application/fhir+json\"\n    assert (\n        inst.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2019-08-07T11:15:18Z\"}\n        ).valueInstant\n    )\n    assert (\n        inst.endpoint\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"https://example.org/Endpoints/P123\"}\n        ).valueUrl\n    )\n    assert inst.filterBy[0].filterParameter == \"patient\"\n    assert inst.filterBy[0].value == \"Patient/123\"\n    assert inst.heartbeatPeriod == 60\n    assert inst.id == \"admission\"\n    assert inst.maxCount == 100\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"AdmissionExample\"\n    assert inst.parameter[0].name == \"Authorization\"\n    assert inst.parameter[0].value == \"Bearer secret-token-abc-123\"\n    assert inst.reason == (\n        \"subscription for beginning of a clinical encounter for \" \"patient 123\"\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.timeout == 5\n    assert inst.topic == \"http://example.org/R5/SubscriptionTopic/admission\"\n\n\ndef test_subscription_1(base_settings):\n    \"\"\"No. 1 tests collection for Subscription.\n    Test File: subscription-admission.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"subscription-admission.json\"\n    inst = subscription.Subscription.model_validate_json(filename.read_bytes())\n    assert \"Subscription\" == inst.get_resource_type()\n\n    impl_subscription_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Subscription\" == data[\"resourceType\"]\n\n    inst2 = subscription.Subscription(**data)\n    impl_subscription_1(inst2)\n\n\ndef impl_subscription_2(inst):\n    assert inst.channelType.code == \"rest-hook\"\n    assert inst.contact[0].system == \"phone\"\n    assert inst.contact[0].use == \"work\"\n    assert inst.contact[0].value == \"(555) 555-1212\"\n    assert inst.filterBy[0].filterParameter == \"patient\"\n    assert inst.filterBy[0].value == \"Patient/123\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:uuid:97e5aa1e-5916-4512-a36e-24eef784e3cc\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"Example\"\n    assert inst.reason == \"Example subscription for example topic\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.topic == \"http://example.org/R5/SubscriptionTopic/example\"\n\n\ndef test_subscription_2(base_settings):\n    \"\"\"No. 2 tests collection for Subscription.\n    Test File: subscription-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"subscription-example.json\"\n    inst = subscription.Subscription.model_validate_json(filename.read_bytes())\n    assert \"Subscription\" == inst.get_resource_type()\n\n    impl_subscription_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Subscription\" == data[\"resourceType\"]\n\n    inst2 = subscription.Subscription(**data)\n    impl_subscription_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_subscriptionstatus.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubscriptionStatus\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import subscriptionstatus\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_subscriptionstatus_1(inst):\n    # Don't know how to create unit test\n    # for \"eventsSinceSubscriptionStart\",\n    # which is a Integer64\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    # Don't know how to create unit test\n    # for \"notificationEvent[0].eventNumber\",\n    # which is a Integer64\n    assert inst.status == \"active\"\n    assert inst.subscription.reference == \"http://example.org/FHIR/R5/Subscription/123\"\n    assert inst.text.status == \"generated\"\n    assert inst.topic == \"http://example.org/FHIR/R5/SubscriptionTopic/admission\"\n    assert inst.type == \"event-notification\"\n\n\ndef test_subscriptionstatus_1(base_settings):\n    \"\"\"No. 1 tests collection for SubscriptionStatus.\n    Test File: subscriptionstatus-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"subscriptionstatus-example.json\"\n    inst = subscriptionstatus.SubscriptionStatus.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"SubscriptionStatus\" == inst.get_resource_type()\n\n    impl_subscriptionstatus_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SubscriptionStatus\" == data[\"resourceType\"]\n\n    inst2 = subscriptionstatus.SubscriptionStatus(**data)\n    impl_subscriptionstatus_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_subscriptiontopic.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubscriptionTopic\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import subscriptiontopic\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_subscriptiontopic_1(inst):\n    assert inst.canFilterBy[0].description == (\n        \"Matching based on the Patient (subject) of an Encounter or \"\n        \"based on the Patient's group membership (in/not-in).\"\n    )\n    assert inst.canFilterBy[0].filterParameter == \"patient\"\n    assert inst.canFilterBy[0].modifier[0] == \"in\"\n    assert inst.canFilterBy[0].modifier[1] == \"not-in\"\n    assert (\n        inst.canFilterBy[0].resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter\"}).valueUri\n    )\n    assert inst.description == \"Example admission topic\"\n    assert (\n        inst.eventTrigger[0].description\n        == \"Patient admission is covered by HL7v2 ADT^A01\"\n    )\n    assert inst.eventTrigger[0].event.coding[0].code == \"A01\"\n    assert (\n        inst.eventTrigger[0].event.coding[0].display\n        == \"ADT/ACK - Admit/visit notification\"\n    )\n    assert (\n        inst.eventTrigger[0].event.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v2-0003\"}\n        ).valueUri\n    )\n    assert (\n        inst.eventTrigger[0].resource\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/Encounter\"}\n        ).valueUri\n    )\n    assert inst.id == \"admission\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:uuid:915c2040-b0a8-4935-adf8-94d6e1a74052\"\n    assert inst.notificationShape[0].include[0] == \"Encounter:patient\"\n    assert inst.notificationShape[0].include[1] == \"Encounter:practitioner\"\n    assert inst.notificationShape[0].include[2] == \"Encounter:service-provider\"\n    assert inst.notificationShape[0].include[3] == \"Encounter:account\"\n    assert inst.notificationShape[0].include[4] == \"Encounter:diagnosis\"\n    assert inst.notificationShape[0].include[5] == \"Encounter:observation\"\n    assert inst.notificationShape[0].include[6] == \"Encounter:location\"\n    assert (\n        inst.notificationShape[0].resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter\"}).valueUri\n    )\n    assert (\n        inst.resourceTrigger[0].description\n        == \"Encounter resource moving to state 'in-progress'\"\n    )\n    assert inst.resourceTrigger[0].fhirPathCriteria == (\n        \"%previous.status!='in-progress' and %current.status='in-\" \"progress'\"\n    )\n    assert inst.resourceTrigger[0].queryCriteria.current == \"status=in-progress\"\n    assert inst.resourceTrigger[0].queryCriteria.previous == \"status:not=in-progress\"\n    assert inst.resourceTrigger[0].queryCriteria.requireBoth is True\n    assert inst.resourceTrigger[0].queryCriteria.resultForCreate == \"test-passes\"\n    assert inst.resourceTrigger[0].queryCriteria.resultForDelete == \"test-fails\"\n    assert (\n        inst.resourceTrigger[0].resource\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/Encounter\"}\n        ).valueUri\n    )\n    assert inst.resourceTrigger[0].supportedInteraction[0] == \"create\"\n    assert inst.resourceTrigger[0].supportedInteraction[1] == \"update\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"admission\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/FHIR/R5/SubscriptionTopic/admission\"}\n        ).valueUri\n    )\n\n\ndef test_subscriptiontopic_1(base_settings):\n    \"\"\"No. 1 tests collection for SubscriptionTopic.\n    Test File: subscriptiontopic-example-admission.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"subscriptiontopic-example-admission.json\"\n    )\n    inst = subscriptiontopic.SubscriptionTopic.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"SubscriptionTopic\" == inst.get_resource_type()\n\n    impl_subscriptiontopic_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SubscriptionTopic\" == data[\"resourceType\"]\n\n    inst2 = subscriptiontopic.SubscriptionTopic(**data)\n    impl_subscriptiontopic_1(inst2)\n\n\ndef impl_subscriptiontopic_2(inst):\n    assert (\n        inst.canFilterBy[0].description\n        == \"Filter based on the subject of an encounter.\"\n    )\n    assert inst.canFilterBy[0].filterParameter == \"subject\"\n    assert (\n        inst.canFilterBy[0].resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter\"}).valueUri\n    )\n    assert inst.canFilterBy[1].description == (\n        \"Filter based on the group membership of the subject of an \" \"encounter.\"\n    )\n    assert inst.canFilterBy[1].filterParameter == \"_in\"\n    assert (\n        inst.canFilterBy[1].resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter\"}).valueUri\n    )\n    assert inst.canFilterBy[2].comparator[0] == \"gt\"\n    assert inst.canFilterBy[2].comparator[1] == \"lt\"\n    assert inst.canFilterBy[2].comparator[2] == \"ge\"\n    assert inst.canFilterBy[2].comparator[3] == \"le\"\n    assert (\n        inst.canFilterBy[2].description == \"Filter based on the length of an encounter.\"\n    )\n    assert inst.canFilterBy[2].filterParameter == \"length\"\n    assert (\n        inst.canFilterBy[2].resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter\"}).valueUri\n    )\n    assert (\n        inst.canFilterBy[3].description\n        == \"Filter based on the account for billing an encounter.\"\n    )\n    assert inst.canFilterBy[3].filterParameter == \"account\"\n    assert inst.canFilterBy[3].modifier[0] == \"missing\"\n    assert inst.canFilterBy[3].modifier[1] == \"not\"\n    assert inst.canFilterBy[3].modifier[2] == \"identifier\"\n    assert (\n        inst.canFilterBy[3].resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter\"}).valueUri\n    )\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2019-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Example topic for completed encounters\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:uuid:1caa02ba-051b-4602-8856-65921748ae76\"\n    assert (\n        inst.notificationShape[0].include[0] == \"Encounter:patient&iterate=Patient.link\"\n    )\n    assert inst.notificationShape[0].include[1] == \"Encounter:practitioner\"\n    assert inst.notificationShape[0].include[2] == \"Encounter:service-provider\"\n    assert inst.notificationShape[0].include[3] == \"Encounter:account\"\n    assert inst.notificationShape[0].include[4] == \"Encounter:diagnosis\"\n    assert inst.notificationShape[0].include[5] == \"Encounter:observation\"\n    assert inst.notificationShape[0].include[6] == \"Encounter:location\"\n    assert (\n        inst.notificationShape[0].resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Encounter\"}).valueUri\n    )\n    assert inst.resourceTrigger[0].description == \"An Encounter has been completed\"\n    assert inst.resourceTrigger[0].fhirPathCriteria == (\n        \"(%previous.empty() | (%previous.status != 'completed')) and \"\n        \"(%current.status = 'completed')\"\n    )\n    assert inst.resourceTrigger[0].queryCriteria.current == \"status=completed\"\n    assert inst.resourceTrigger[0].queryCriteria.previous == \"status:not=completed\"\n    assert inst.resourceTrigger[0].queryCriteria.requireBoth is True\n    assert inst.resourceTrigger[0].queryCriteria.resultForCreate == \"test-passes\"\n    assert inst.resourceTrigger[0].queryCriteria.resultForDelete == \"test-fails\"\n    assert (\n        inst.resourceTrigger[0].resource\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/StructureDefinition/Encounter\"}\n        ).valueUri\n    )\n    assert inst.resourceTrigger[0].supportedInteraction[0] == \"update\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"example\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.org/FHIR/R5/SubscriptionTopic/example\"}\n        ).valueUri\n    )\n    assert inst.version == \"1.0.0-beta.1\"\n\n\ndef test_subscriptiontopic_2(base_settings):\n    \"\"\"No. 2 tests collection for SubscriptionTopic.\n    Test File: subscriptiontopic-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"subscriptiontopic-example.json\"\n    inst = subscriptiontopic.SubscriptionTopic.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"SubscriptionTopic\" == inst.get_resource_type()\n\n    impl_subscriptiontopic_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SubscriptionTopic\" == data[\"resourceType\"]\n\n    inst2 = subscriptiontopic.SubscriptionTopic(**data)\n    impl_subscriptiontopic_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_substance.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Substance\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import substance\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_substance_1(inst):\n    assert inst.category[0].coding[0].code == \"chemical\"\n    assert inst.category[0].coding[0].display == \"Chemical\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/substance-category\"}\n        ).valueUri\n    )\n    assert inst.code.concept.coding[0].code == \"333346007\"\n    assert (\n        inst.code.concept.coding[0].display == \"Silver nitrate 20% solution (product)\"\n    )\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.description == \"Solution for silver nitrate stain\"\n    assert (\n        inst.expiry\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-01-01\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"f204\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/identifiers/substances/lot\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"AB94687\"\n    assert inst.instance is True\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.quantity.code == \"mL\"\n    assert (\n        inst.quantity.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.quantity.unit == \"mL\"\n    assert float(inst.quantity.value) == float(100)\n    assert inst.text.status == \"generated\"\n\n\ndef test_substance_1(base_settings):\n    \"\"\"No. 1 tests collection for Substance.\n    Test File: substance-example-silver-nitrate-product.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"substance-example-silver-nitrate-product.json\"\n    )\n    inst = substance.Substance.model_validate_json(filename.read_bytes())\n    assert \"Substance\" == inst.get_resource_type()\n\n    impl_substance_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Substance\" == data[\"resourceType\"]\n\n    inst2 = substance.Substance(**data)\n    impl_substance_1(inst2)\n\n\ndef impl_substance_2(inst):\n    assert inst.category[0].coding[0].code == \"drug\"\n    assert inst.category[0].coding[0].display == \"Drug or Medicament\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/substance-category\"}\n        ).valueUri\n    )\n    assert inst.code.concept.coding[0].code == \"392259005\"\n    assert inst.code.concept.coding[0].display == (\n        \"Amoxicillin + clavulanate potassium 875mg/125mg tablet \" \"(product)\"\n    )\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contained[0].id == \"ingr1\"\n    assert inst.contained[1].id == \"ingr2\"\n    assert inst.description == \"Augmentin 875\"\n    assert inst.id == \"f205\"\n    assert inst.ingredient[0].quantity.denominator.code == \"mg\"\n    assert (\n        inst.ingredient[0].quantity.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredient[0].quantity.denominator.unit == \"mg\"\n    assert float(inst.ingredient[0].quantity.denominator.value) == float(1000)\n    assert inst.ingredient[0].quantity.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[0].quantity.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredient[0].quantity.numerator.unit == \"mg\"\n    assert float(inst.ingredient[0].quantity.numerator.value) == float(875)\n    assert inst.ingredient[0].substanceReference.reference == \"#ingr1\"\n    assert inst.ingredient[1].quantity.denominator.code == \"mg\"\n    assert (\n        inst.ingredient[1].quantity.denominator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredient[1].quantity.denominator.unit == \"mg\"\n    assert float(inst.ingredient[1].quantity.denominator.value) == float(1000)\n    assert inst.ingredient[1].quantity.numerator.code == \"mg\"\n    assert (\n        inst.ingredient[1].quantity.numerator.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.ingredient[1].quantity.numerator.unit == \"mg\"\n    assert float(inst.ingredient[1].quantity.numerator.value) == float(125)\n    assert inst.ingredient[1].substanceReference.reference == \"#ingr2\"\n    assert inst.instance is False\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substance_2(base_settings):\n    \"\"\"No. 2 tests collection for Substance.\n    Test File: substance-example-amoxicillin-clavulanate.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"substance-example-amoxicillin-clavulanate.json\"\n    )\n    inst = substance.Substance.model_validate_json(filename.read_bytes())\n    assert \"Substance\" == inst.get_resource_type()\n\n    impl_substance_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Substance\" == data[\"resourceType\"]\n\n    inst2 = substance.Substance(**data)\n    impl_substance_2(inst2)\n\n\ndef impl_substance_3(inst):\n    assert inst.category[0].coding[0].code == \"chemical\"\n    assert inst.category[0].coding[0].display == \"Chemical\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/substance-category\"}\n        ).valueUri\n    )\n    assert inst.code.concept.coding[0].code == \"88480006\"\n    assert inst.code.concept.coding[0].display == \"Potassium\"\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"f203\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/identifiers/substances\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"1234\"\n    assert inst.instance is False\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substance_3(base_settings):\n    \"\"\"No. 3 tests collection for Substance.\n    Test File: substance-example-f203-potassium.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"substance-example-f203-potassium.json\"\n    )\n    inst = substance.Substance.model_validate_json(filename.read_bytes())\n    assert \"Substance\" == inst.get_resource_type()\n\n    impl_substance_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Substance\" == data[\"resourceType\"]\n\n    inst2 = substance.Substance(**data)\n    impl_substance_3(inst2)\n\n\ndef impl_substance_4(inst):\n    assert inst.code.concept.coding[0].code == \"406466009\"\n    assert inst.code.concept.coding[0].display == \"House dust allergen\"\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"f201\"\n    assert inst.instance is False\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substance_4(base_settings):\n    \"\"\"No. 4 tests collection for Substance.\n    Test File: substance-example-f201-dust.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"substance-example-f201-dust.json\"\n    inst = substance.Substance.model_validate_json(filename.read_bytes())\n    assert \"Substance\" == inst.get_resource_type()\n\n    impl_substance_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Substance\" == data[\"resourceType\"]\n\n    inst2 = substance.Substance(**data)\n    impl_substance_4(inst2)\n\n\ndef impl_substance_5(inst):\n    assert inst.category[0].coding[0].code == \"allergen\"\n    assert inst.category[0].coding[0].display == \"Allergen\"\n    assert (\n        inst.category[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/substance-category\"}\n        ).valueUri\n    )\n    assert inst.code.concept.text == \"apitoxin (Honey Bee Venom)\"\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://acme.org/identifiers/substances\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"1463\"\n    assert inst.instance is False\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_substance_5(base_settings):\n    \"\"\"No. 5 tests collection for Substance.\n    Test File: substance-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"substance-example.json\"\n    inst = substance.Substance.model_validate_json(filename.read_bytes())\n    assert \"Substance\" == inst.get_resource_type()\n\n    impl_substance_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Substance\" == data[\"resourceType\"]\n\n    inst2 = substance.Substance(**data)\n    impl_substance_5(inst2)\n\n\ndef impl_substance_6(inst):\n    assert inst.code.concept.coding[0].code == \"3092008\"\n    assert inst.code.concept.coding[0].display == \"Staphylococcus Aureus\"\n    assert (\n        inst.code.concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.id == \"f202\"\n    assert inst.instance is False\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substance_6(base_settings):\n    \"\"\"No. 6 tests collection for Substance.\n    Test File: substance-example-f202-staphylococcus.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"substance-example-f202-staphylococcus.json\"\n    )\n    inst = substance.Substance.model_validate_json(filename.read_bytes())\n    assert \"Substance\" == inst.get_resource_type()\n\n    impl_substance_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Substance\" == data[\"resourceType\"]\n\n    inst2 = substance.Substance(**data)\n    impl_substance_6(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_substancedefinition.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstanceDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import substancedefinition\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_substancedefinition_1(inst):\n    assert inst.classification[0].coding[0].code == \"100000075670\"\n    assert inst.classification[0].coding[0].display == \"Chemical\"\n    assert (\n        inst.classification[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/SubstanceType\"}\n        ).valueUri\n    )\n    assert inst.code[0].code.coding[0].code == \"SUB99611MIG\"\n    assert (\n        inst.code[0].code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Substance\"}\n        ).valueUri\n    )\n    assert inst.domain.coding[0].code == \"100000000012\"\n    assert inst.domain.coding[0].display == \"Human use\"\n    assert (\n        inst.domain.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Domain\"}\n        ).valueUri\n    )\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/SMSId\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"100000099270\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name[0].language[0].coding[0].code == \"en\"\n    assert inst.name[0].language[0].coding[0].display == \"English\"\n    assert (\n        inst.name[0].language[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.name[0].name == \"PARACETAMOL\"\n    assert inst.name[0].preferred is True\n    assert inst.name[0].status.coding[0].code == \"200000005004\"\n    assert inst.name[0].status.coding[0].display == \"Current\"\n    assert (\n        inst.name[0].status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Status\"}\n        ).valueUri\n    )\n    assert inst.name[1].language[0].coding[0].code == \"el\"\n    assert inst.name[1].language[0].coding[0].display == \"Greek\"\n    assert (\n        inst.name[1].language[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.name[1].name == \"ΠΑΡΑΚΕΤΑΜΌΛΗ\"\n    assert inst.name[1].preferred is False\n    assert inst.name[1].status.coding[0].code == \"200000005004\"\n    assert inst.name[1].status.coding[0].display == \"Current\"\n    assert (\n        inst.name[1].status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Status\"}\n        ).valueUri\n    )\n    assert inst.name[2].language[0].coding[0].code == \"bg\"\n    assert inst.name[2].language[0].coding[0].display == \"Bulgarian\"\n    assert (\n        inst.name[2].language[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.name[2].name == \"ПАРАЦЕТАМОЛ\"\n    assert inst.name[2].preferred is False\n    assert inst.name[2].status.coding[0].code == \"200000005004\"\n    assert inst.name[2].status.coding[0].display == \"Current\"\n    assert (\n        inst.name[2].status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Status\"}\n        ).valueUri\n    )\n    assert inst.name[3].language[0].coding[0].code == \"en\"\n    assert inst.name[3].language[0].coding[0].display == \"English\"\n    assert (\n        inst.name[3].language[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:bcp:47\"}\n        ).valueUri\n    )\n    assert inst.name[3].name == \"ACETAMINOPHEN\"\n    assert inst.name[3].preferred is False\n    assert inst.name[3].status.coding[0].code == \"200000005004\"\n    assert inst.name[3].status.coding[0].display == \"Current\"\n    assert (\n        inst.name[3].status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Status\"}\n        ).valueUri\n    )\n    assert inst.status.coding[0].code == \"200000005004\"\n    assert inst.status.coding[0].display == \"Current\"\n    assert (\n        inst.status.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://example.europa.eu/fhir/Status\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substancedefinition_1(base_settings):\n    \"\"\"No. 1 tests collection for SubstanceDefinition.\n    Test File: substancedefinition-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"substancedefinition-example.json\"\n    inst = substancedefinition.SubstanceDefinition.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"SubstanceDefinition\" == inst.get_resource_type()\n\n    impl_substancedefinition_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SubstanceDefinition\" == data[\"resourceType\"]\n\n    inst2 = substancedefinition.SubstanceDefinition(**data)\n    impl_substancedefinition_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_substancenucleicacid.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstanceNucleicAcid\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import substancenucleicacid\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_substancenucleicacid_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substancenucleicacid_1(base_settings):\n    \"\"\"No. 1 tests collection for SubstanceNucleicAcid.\n    Test File: substancenucleicacid-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"substancenucleicacid-example.json\"\n    inst = substancenucleicacid.SubstanceNucleicAcid.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"SubstanceNucleicAcid\" == inst.get_resource_type()\n\n    impl_substancenucleicacid_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SubstanceNucleicAcid\" == data[\"resourceType\"]\n\n    inst2 = substancenucleicacid.SubstanceNucleicAcid(**data)\n    impl_substancenucleicacid_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_substancepolymer.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstancePolymer\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import substancepolymer\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_substancepolymer_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substancepolymer_1(base_settings):\n    \"\"\"No. 1 tests collection for SubstancePolymer.\n    Test File: substancepolymer-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"substancepolymer-example.json\"\n    inst = substancepolymer.SubstancePolymer.model_validate_json(filename.read_bytes())\n    assert \"SubstancePolymer\" == inst.get_resource_type()\n\n    impl_substancepolymer_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SubstancePolymer\" == data[\"resourceType\"]\n\n    inst2 = substancepolymer.SubstancePolymer(**data)\n    impl_substancepolymer_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_substanceprotein.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstanceProtein\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import substanceprotein\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_substanceprotein_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substanceprotein_1(base_settings):\n    \"\"\"No. 1 tests collection for SubstanceProtein.\n    Test File: substanceprotein-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"substanceprotein-example.json\"\n    inst = substanceprotein.SubstanceProtein.model_validate_json(filename.read_bytes())\n    assert \"SubstanceProtein\" == inst.get_resource_type()\n\n    impl_substanceprotein_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SubstanceProtein\" == data[\"resourceType\"]\n\n    inst2 = substanceprotein.SubstanceProtein(**data)\n    impl_substanceprotein_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_substancereferenceinformation.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstanceReferenceInformation\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import substancereferenceinformation\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_substancereferenceinformation_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substancereferenceinformation_1(base_settings):\n    \"\"\"No. 1 tests collection for SubstanceReferenceInformation.\n    Test File: substancereferenceinformation-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"substancereferenceinformation-example.json\"\n    )\n    inst = (\n        substancereferenceinformation.SubstanceReferenceInformation.model_validate_json(\n            filename.read_bytes()\n        )\n    )\n    assert \"SubstanceReferenceInformation\" == inst.get_resource_type()\n\n    impl_substancereferenceinformation_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SubstanceReferenceInformation\" == data[\"resourceType\"]\n\n    inst2 = substancereferenceinformation.SubstanceReferenceInformation(**data)\n    impl_substancereferenceinformation_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_substancesourcematerial.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SubstanceSourceMaterial\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import substancesourcematerial\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_substancesourcematerial_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_substancesourcematerial_1(base_settings):\n    \"\"\"No. 1 tests collection for SubstanceSourceMaterial.\n    Test File: substancesourcematerial-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"substancesourcematerial-example.json\"\n    )\n    inst = substancesourcematerial.SubstanceSourceMaterial.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"SubstanceSourceMaterial\" == inst.get_resource_type()\n\n    impl_substancesourcematerial_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SubstanceSourceMaterial\" == data[\"resourceType\"]\n\n    inst2 = substancesourcematerial.SubstanceSourceMaterial(**data)\n    impl_substancesourcematerial_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_supplydelivery.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SupplyDelivery\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import supplydelivery\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_supplydelivery_1(inst):\n    assert inst.contained[0].id == \"Item1\"\n    assert inst.contained[1].id == \"Item2\"\n    assert inst.contained[2].id == \"Item3\"\n    assert inst.destination.display == \"St Johns Hospital, Anytown, AnyState\"\n    assert inst.id == \"ISBT128\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.isbt128.org/uri/ProductConsignment\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"A999922123450101\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.suppliedItem[0].itemReference.reference == \"#Item1\"\n    assert inst.suppliedItem[1].itemReference.reference == \"#Item2\"\n    assert inst.suppliedItem[2].itemReference.reference == \"#Item3\"\n    assert inst.supplier.display == \"Community Blood Center\"\n    assert (\n        inst.supplier.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.isbt128.org/uri/ProcessorFIN\"}\n        ).valueUri\n    )\n    assert inst.supplier.identifier.value == \"A9999\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"biologicallyderivedproduct\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/supplydelivery-supplyitemtype\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"Blood Dispatch\"\n\n\ndef test_supplydelivery_1(base_settings):\n    \"\"\"No. 1 tests collection for SupplyDelivery.\n    Test File: supplydelivery-example-ISBT128.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"supplydelivery-example-ISBT128.json\"\n    )\n    inst = supplydelivery.SupplyDelivery.model_validate_json(filename.read_bytes())\n    assert \"SupplyDelivery\" == inst.get_resource_type()\n\n    impl_supplydelivery_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SupplyDelivery\" == data[\"resourceType\"]\n\n    inst2 = supplydelivery.SupplyDelivery(**data)\n    impl_supplydelivery_1(inst2)\n\n\ndef impl_supplydelivery_2(inst):\n    assert inst.contained[0].id == \"Item1\"\n    assert inst.contained[1].id == \"Item2\"\n    assert inst.contained[2].id == \"Item3\"\n    assert inst.id == \"mphodelivery\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"https://www.isbt128.org/uri/ProductConsignment\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"A999922123450101\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.suppliedItem[0].itemReference.reference == \"#Item1\"\n    assert float(inst.suppliedItem[0].quantity.value) == float(3)\n    assert inst.suppliedItem[1].itemReference.reference == \"#Item2\"\n    assert inst.suppliedItem[2].itemReference.reference == \"#Item3\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"biologicallyderivedproduct\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/supplydelivery-supplyitemtype\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"Blood Dispatch\"\n\n\ndef test_supplydelivery_2(base_settings):\n    \"\"\"No. 2 tests collection for SupplyDelivery.\n    Test File: supplydelivery-example-mphodelivery.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"supplydelivery-example-mphodelivery.json\"\n    )\n    inst = supplydelivery.SupplyDelivery.model_validate_json(filename.read_bytes())\n    assert \"SupplyDelivery\" == inst.get_resource_type()\n\n    impl_supplydelivery_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SupplyDelivery\" == data[\"resourceType\"]\n\n    inst2 = supplydelivery.SupplyDelivery(**data)\n    impl_supplydelivery_2(inst2)\n\n\ndef impl_supplydelivery_3(inst):\n    assert inst.basedOn[0].reference == \"SupplyRequest/simpleorder\"\n    assert inst.destination.display == \"Location 1\"\n    assert inst.id == \"simpledelivery\"\n    assert inst.identifier[0].value == \"Order10284\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-12-31\"}\n        ).valueDateTime\n    )\n    assert inst.partOf[0].display == \"Central Supply Restock\"\n    assert inst.status == \"completed\"\n    assert inst.suppliedItem[0].itemCodeableConcept.coding[0].code == \"BlueTubes\"\n    assert (\n        inst.suppliedItem[0].itemCodeableConcept.coding[0].display\n        == \"Blood collect tubes blue cap\"\n    )\n    assert float(inst.suppliedItem[0].quantity.value) == float(10)\n    assert inst.supplier.display == \"Vendor1\"\n    assert inst.text.status == \"generated\"\n    assert inst.type.coding[0].code == \"device\"\n    assert (\n        inst.type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/supplydelivery-supplyitemtype\"}\n        ).valueUri\n    )\n    assert inst.type.text == \"Blood collect tubes blue cap\"\n\n\ndef test_supplydelivery_3(base_settings):\n    \"\"\"No. 3 tests collection for SupplyDelivery.\n    Test File: supplydelivery-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"supplydelivery-example.json\"\n    inst = supplydelivery.SupplyDelivery.model_validate_json(filename.read_bytes())\n    assert \"SupplyDelivery\" == inst.get_resource_type()\n\n    impl_supplydelivery_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SupplyDelivery\" == data[\"resourceType\"]\n\n    inst2 = supplydelivery.SupplyDelivery(**data)\n    impl_supplydelivery_3(inst2)\n\n\ndef impl_supplydelivery_4(inst):\n    assert inst.destination.display == \"Home care dept\"\n    assert inst.id == \"pumpdelivery\"\n    assert inst.identifier[0].assigner.display == \"SupplierDeliveryNr\"\n    assert inst.identifier[0].value == \"98398459409\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.display == \"Mr. Belpit\"\n    assert inst.receiver[0].display == \"Nurse Smith\"\n    assert inst.status == \"in-progress\"\n    assert inst.supplier.display == \"ACME distribution\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">[Put rendering ' \"here]</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_supplydelivery_4(base_settings):\n    \"\"\"No. 4 tests collection for SupplyDelivery.\n    Test File: supplydelivery-example-pumpdelivery.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"supplydelivery-example-pumpdelivery.json\"\n    )\n    inst = supplydelivery.SupplyDelivery.model_validate_json(filename.read_bytes())\n    assert \"SupplyDelivery\" == inst.get_resource_type()\n\n    impl_supplydelivery_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SupplyDelivery\" == data[\"resourceType\"]\n\n    inst2 = supplydelivery.SupplyDelivery(**data)\n    impl_supplydelivery_4(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_supplyrequest.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/SupplyRequest\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import supplyrequest\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_supplyrequest_1(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-12-31\"}\n        ).valueDateTime\n    )\n    assert inst.category.coding[0].code == \"central\"\n    assert inst.category.coding[0].display == \"Central Stock Resupply\"\n    assert inst.deliverFrom.display == \"Location 1\"\n    assert inst.deliverTo.display == \"GoodHealth Clinic Receiving\"\n    assert inst.id == \"simpleorder\"\n    assert inst.identifier[0].value == \"Order10284\"\n    assert inst.item.concept.coding[0].code == \"BlueTubes\"\n    assert inst.item.concept.coding[0].display == \"Blood collect tubes blue cap\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.occurrenceDateTime\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-12-31\"}\n        ).valueDateTime\n    )\n    assert inst.priority == \"asap\"\n    assert float(inst.quantity.value) == float(10)\n    assert inst.reason[0].concept.coding[0].code == \"stock_low\"\n    assert inst.reason[0].concept.coding[0].display == \"Refill due to low stock\"\n    assert inst.requester.display == \"Henry Seven\"\n    assert inst.status == \"active\"\n    assert inst.supplier[0].display == \"Vendor1\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_supplyrequest_1(base_settings):\n    \"\"\"No. 1 tests collection for SupplyRequest.\n    Test File: supplyrequest-example-simpleorder.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"supplyrequest-example-simpleorder.json\"\n    )\n    inst = supplyrequest.SupplyRequest.model_validate_json(filename.read_bytes())\n    assert \"SupplyRequest\" == inst.get_resource_type()\n\n    impl_supplyrequest_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"SupplyRequest\" == data[\"resourceType\"]\n\n    inst2 = supplyrequest.SupplyRequest(**data)\n    impl_supplyrequest_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_task.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Task\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import task\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_task_1(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].display == \"General Wellness Careplan\"\n    assert inst.businessStatus.text == \"test completed and posted\"\n    assert inst.code.coding[0].code == \"fulfill\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CodeSystem/task-code\"}\n        ).valueUri\n    )\n    assert inst.description == (\n        \"Create order for getting specimen, Set up inhouse testing,  \"\n        \"generate order for any sendouts and submit with specimen\"\n    )\n    assert inst.encounter.display == \"Example In-Patient Encounter\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.executionPeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T18:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.executionPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.focus.display == \"Lipid Panel Request\"\n    assert inst.focus.reference == \"ServiceRequest/lipid\"\n    assert inst.for_fhir.display == \"Peter James Chalmers\"\n    assert inst.for_fhir.reference == \"Patient/example\"\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/accession/identifiers\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.use == \"official\"\n    assert inst.groupIdentifier.value == \"G20170201-001\"\n    assert inst.id == \"example6\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20170201-001\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T18:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.output[0].type.text == \"DiagnosticReport generated\"\n    assert inst.output[0].valueReference.reference == \"DiagnosticReport/lipids\"\n    assert inst.output[1].type.text == \"collected specimen\"\n    assert inst.output[1].valueReference.reference == \"Specimen/101\"\n    assert inst.owner.display == \"Clinical Laboratory @ Acme Hospital\"\n    assert inst.owner.reference == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    assert inst.priority == \"routine\"\n    assert inst.reason[0].concept.text == (\n        \"The Task.reason should only be included if there is no \"\n        \"Task.focus or if it differs from the reason indicated on the\"\n        \" focus\"\n    )\n    assert inst.requestedPerformer[0].reference.reference == \"PractitionerRole/f202\"\n    assert inst.requester.display == \"Dr Adam Careful\"\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert (\n        inst.restriction.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-02T09:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.restriction.repetitions == 1\n    assert inst.status == \"completed\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_1(base_settings):\n    \"\"\"No. 1 tests collection for Task.\n    Test File: task-example6.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example6.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_1(inst2)\n\n\ndef impl_task_2(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-12T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"poll\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskcode\"}\n        ).valueUri\n    )\n    assert inst.id == \"fm-example2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/happyvalley.com/task\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20181012-005\"\n    assert inst.input[0].type.coding[0].code == \"include\"\n    assert (\n        inst.input[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskinputtype\"}\n        ).valueUri\n    )\n    assert inst.input[0].valueCode == \"ClaimResponse\"\n    assert inst.input[1].type.coding[0].code == \"period\"\n    assert (\n        inst.input[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskinputtype\"}\n        ).valueUri\n    )\n    assert (\n        inst.input[1].valuePeriod.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-12\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.input[1].valuePeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-01\"}\n        ).valueDateTime\n    )\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-12T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.owner.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/identifiers\"}\n        ).valueUri\n    )\n    assert inst.owner.identifier.value == \"12345\"\n    assert inst.priority == \"stat\"\n    assert inst.requester.display == \"Happy Valley Clinic\"\n    assert inst.requester.reference == \"Organization/example\"\n    assert inst.status == \"requested\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_2(base_settings):\n    \"\"\"No. 2 tests collection for Task.\n    Test File: task-example-fm-poll.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example-fm-poll.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_2(inst2)\n\n\ndef impl_task_3(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.basedOn[0].display == \"General Wellness Careplan\"\n    assert inst.businessStatus.text == \"waiting for specimen\"\n    assert inst.code.coding[0].code == \"fulfill\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CodeSystem/task-code\"}\n        ).valueUri\n    )\n    assert inst.code.text == \"Lipid Panel\"\n    assert inst.contained[0].id == \"signature\"\n    assert inst.description == (\n        \"Create order for getting specimen, Set up inhouse testing,  \"\n        \"generate order for any sendouts and submit with specimen\"\n    )\n    assert inst.encounter.display == \"Example In-Patient Encounter\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.executionPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.focus.display == \"Lipid Panel Request\"\n    assert inst.focus.reference == \"ServiceRequest/lipid\"\n    assert inst.for_fhir.display == \"Peter James Chalmers\"\n    assert inst.for_fhir.reference == \"Patient/example\"\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/accession/identifiers\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.use == \"official\"\n    assert inst.groupIdentifier.value == \"G20170201-001\"\n    assert inst.id == \"example1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20170201-001\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T09:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.owner.display == \"Clinical Laboratory @ Acme Hospital\"\n    assert inst.owner.reference == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    assert inst.priority == \"routine\"\n    assert inst.reason[0].concept.text == (\n        \"The Task.reason should only be included if there is no \"\n        \"Task.focus or if it differs from the reason indicated on the\"\n        \" focus\"\n    )\n    assert inst.relevantHistory[0].display == \"Author's Signature\"\n    assert inst.relevantHistory[0].reference == \"#signature\"\n    assert inst.requestedPerformer[0].concept.coding[0].code == \"18850004\"\n    assert (\n        inst.requestedPerformer[0].concept.coding[0].display\n        == \"Laboratory hematologist\"\n    )\n    assert (\n        inst.requestedPerformer[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.requestedPerformer[0].concept.text == \"Performer\"\n    assert inst.requester.display == \"Dr Adam Careful\"\n    assert inst.requester.reference == \"Practitioner/example\"\n    assert (\n        inst.restriction.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-02T09:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.restriction.repetitions == 1\n    assert inst.status == \"in-progress\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_3(base_settings):\n    \"\"\"No. 3 tests collection for Task.\n    Test File: task-example1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example1.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_3(inst2)\n\n\ndef impl_task_4(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"reprocess\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskcode\"}\n        ).valueUri\n    )\n    assert (\n        inst.focus.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.focus.identifier.value == \"1501\"\n    assert inst.id == \"fm-example4\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/happyvalley.com/task\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20181012-006\"\n    assert inst.input[0].type.coding[0].code == \"origresponse\"\n    assert (\n        inst.input[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskinputtype\"}\n        ).valueUri\n    )\n    assert (\n        inst.input[0].valueReference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/claimresponse\"}\n        ).valueUri\n    )\n    assert inst.input[0].valueReference.identifier.value == \"CR201810040001234\"\n    assert inst.input[1].type.coding[0].code == \"reference\"\n    assert (\n        inst.input[1].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskinputtype\"}\n        ).valueUri\n    )\n    assert inst.input[1].valueString == \"BR12345\"\n    assert inst.input[2].type.coding[0].code == \"item\"\n    assert (\n        inst.input[2].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskinputtype\"}\n        ).valueUri\n    )\n    assert inst.input[2].valuePositiveInt == 2\n    assert inst.input[3].type.coding[0].code == \"item\"\n    assert (\n        inst.input[3].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskinputtype\"}\n        ).valueUri\n    )\n    assert inst.input[3].valuePositiveInt == 3\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.owner.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/identifiers\"}\n        ).valueUri\n    )\n    assert inst.owner.identifier.value == \"12345\"\n    assert inst.priority == \"stat\"\n    assert inst.requester.display == \"Happy Valley Clinic\"\n    assert inst.requester.reference == \"Organization/example\"\n    assert inst.status == \"requested\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_4(base_settings):\n    \"\"\"No. 4 tests collection for Task.\n    Test File: task-example-fm-reprocess.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example-fm-reprocess.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_4(inst2)\n\n\ndef impl_task_5(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-03-10T22:39:32-04:00\"}\n        ).valueDateTime\n    )\n    assert inst.code.text == \"Refill Request\"\n    assert inst.focus.reference == \"MedicationRequest/medrx002\"\n    assert inst.for_fhir.reference == \"Patient/f001\"\n    assert inst.id == \"example3\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-03-10T22:39:32-04:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.owner.reference == \"Practitioner/example\"\n    assert inst.requester.reference == \"Patient/example\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_5(base_settings):\n    \"\"\"No. 5 tests collection for Task.\n    Test File: task-example3.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example3.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_5(inst2)\n\n\ndef impl_task_6(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"status\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskcode\"}\n        ).valueUri\n    )\n    assert (\n        inst.focus.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.focus.identifier.value == \"1500\"\n    assert inst.id == \"fm-example6\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/happyvalley.com/task\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20181012-001\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/identifiers/12345\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"official\"\n    assert inst.identifier[1].value == \"123GB5674\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.output[0].type.coding[0].code == \"status\"\n    assert (\n        inst.output[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/financial-taskoutputtype\"}\n        ).valueUri\n    )\n    assert inst.output[0].valueCode == \"complete\"\n    assert (\n        inst.owner.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/identifiers\"}\n        ).valueUri\n    )\n    assert inst.owner.identifier.value == \"12345\"\n    assert inst.priority == \"stat\"\n    assert inst.requester.display == \"Happy Valley Clinic\"\n    assert inst.requester.reference == \"Organization/example\"\n    assert inst.status == \"completed\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_6(base_settings):\n    \"\"\"No. 6 tests collection for Task.\n    Test File: task-example-fm-status-resp.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example-fm-status-resp.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_6(inst2)\n\n\ndef impl_task_7(inst):\n    assert inst.code.text == \"Collect information\"\n    assert inst.doNotPerform is True\n    assert inst.for_fhir.reference == \"Patient/example\"\n    assert inst.id == \"cpg-example-1\"\n    assert inst.input[0].type.text == \"Collect information\"\n    assert inst.input[0].valueCanonical == \"http://hl7.org/fhir/Questionnaire/f201\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"ready\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_7(base_settings):\n    \"\"\"No. 7 tests collection for Task.\n    Test File: task-cpg-example-1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-cpg-example-1.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_7(inst2)\n\n\ndef impl_task_8(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.businessStatus.text == \"waiting for patient\"\n    assert inst.code.coding[0].code == \"fulfill\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/CodeSystem/task-code\"}\n        ).valueUri\n    )\n    assert inst.encounter.display == \"Example In-Patient Encounter\"\n    assert inst.encounter.reference == \"Encounter/example\"\n    assert (\n        inst.executionPeriod.start\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T08:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.focus.display == \"BloodDraw ServiceRequest\"\n    assert inst.for_fhir.display == \"Peter James Chalmers\"\n    assert inst.for_fhir.reference == \"Patient/example\"\n    assert (\n        inst.groupIdentifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/accession/identifiers\"}\n        ).valueUri\n    )\n    assert inst.groupIdentifier.use == \"official\"\n    assert inst.groupIdentifier.value == \"G20170201-001\"\n    assert inst.id == \"example2\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/goodhealth.org/identifiers\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20170201-002\"\n    assert inst.intent == \"filler-order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-31T09:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.owner.display == \"Clinical Laboratory @ Acme Hospital\"\n    assert inst.owner.reference == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    assert inst.partOf[0].display == \"Lipid Panel\"\n    assert inst.partOf[0].reference == \"Task/example1\"\n    assert inst.priority == \"routine\"\n    assert inst.requestedPerformer[0].concept.coding[0].code == \"18850004\"\n    assert (\n        inst.requestedPerformer[0].concept.coding[0].display\n        == \"Laboratory hematologist\"\n    )\n    assert (\n        inst.requestedPerformer[0].concept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.requestedPerformer[0].concept.text == \"Performer\"\n    assert inst.requester.display == \"Clinical Laboratory @ Acme Hospital\"\n    assert (\n        inst.requester.reference == \"Organization/1832473e-2fe0-452d-abe9-3cdb9879522f\"\n    )\n    assert (\n        inst.restriction.period.end\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-11-01T09:45:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.restriction.repetitions == 1\n    assert inst.status == \"accepted\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_8(base_settings):\n    \"\"\"No. 8 tests collection for Task.\n    Test File: task-example2.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example2.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_8(inst2)\n\n\ndef impl_task_9(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"release\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskcode\"}\n        ).valueUri\n    )\n    assert (\n        inst.focus.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.focus.identifier.value == \"1501\"\n    assert inst.id == \"fm-example3\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/happyvalley.com/task\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20181012-001\"\n    assert inst.input[0].type.coding[0].code == \"origresponse\"\n    assert (\n        inst.input[0].type.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/financial-taskinputtype\"}\n        ).valueUri\n    )\n    assert (\n        inst.input[0].valueReference.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/claimresponse\"}\n        ).valueUri\n    )\n    assert inst.input[0].valueReference.identifier.value == \"CR201810040001234\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.owner.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/identifiers\"}\n        ).valueUri\n    )\n    assert inst.owner.identifier.value == \"12345\"\n    assert inst.priority == \"stat\"\n    assert inst.requester.display == \"Happy Valley Clinic\"\n    assert inst.requester.reference == \"Organization/example\"\n    assert inst.status == \"requested\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_9(base_settings):\n    \"\"\"No. 9 tests collection for Task.\n    Test File: task-example-fm-release.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example-fm-release.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_9(inst2)\n\n\ndef impl_task_10(inst):\n    assert (\n        inst.authoredOn\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.code.coding[0].code == \"cancel\"\n    assert (\n        inst.code.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/financialtaskcode\"}\n        ).valueUri\n    )\n    assert (\n        inst.focus.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://happyvalley.com/claim\"}\n        ).valueUri\n    )\n    assert inst.focus.identifier.value == \"1500\"\n    assert inst.id == \"fm-example1\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http:/happyvalley.com/task\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].use == \"official\"\n    assert inst.identifier[0].value == \"20181012-001\"\n    assert inst.intent == \"order\"\n    assert (\n        inst.lastModified\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2018-10-04T08:25:05+10:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert (\n        inst.owner.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://nationalinsurers.com/identifiers\"}\n        ).valueUri\n    )\n    assert inst.owner.identifier.value == \"12345\"\n    assert inst.priority == \"stat\"\n    assert inst.requester.display == \"Happy Valley Clinic\"\n    assert inst.requester.reference == \"Organization/example\"\n    assert inst.status == \"requested\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_task_10(base_settings):\n    \"\"\"No. 10 tests collection for Task.\n    Test File: task-example-fm-cancel.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"task-example-fm-cancel.json\"\n    inst = task.Task.model_validate_json(filename.read_bytes())\n    assert \"Task\" == inst.get_resource_type()\n\n    impl_task_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Task\" == data[\"resourceType\"]\n\n    inst2 = task.Task(**data)\n    impl_task_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_terminologycapabilities.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import terminologycapabilities\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_terminologycapabilities_1(inst):\n    assert inst.codeSystem[0].content == \"complete\"\n    assert inst.codeSystem[0].uri == \"http://snomed.info/sct\"\n    assert (\n        inst.codeSystem[0].version[0].code\n        == \"http://snomed.info/sct/32506021000036107/version/20220831\"\n    )\n    assert inst.codeSystem[1].content == \"complete\"\n    assert inst.codeSystem[1].uri == \"http://loinc.org\"\n    assert inst.codeSystem[1].version[0].code == \"2.73\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2022-09-01\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"example-terminology-server\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.6.1\"\n    assert inst.implementation.description == \"The ACME FHIR Terminology Server\"\n    assert inst.kind == \"instance\"\n    assert inst.name == \"ACMETerminologyServiceTerminologyCapabilities\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/TerminologyCapabilities/terminology-server\"\n            }\n        ).valueUri\n    )\n\n\ndef test_terminologycapabilities_1(base_settings):\n    \"\"\"No. 1 tests collection for TerminologyCapabilities.\n    Test File: terminologycapabilities-terminology-server.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"terminologycapabilities-terminology-server.json\"\n    )\n    inst = terminologycapabilities.TerminologyCapabilities.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"TerminologyCapabilities\" == inst.get_resource_type()\n\n    impl_terminologycapabilities_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TerminologyCapabilities\" == data[\"resourceType\"]\n\n    inst2 = terminologycapabilities.TerminologyCapabilities(**data)\n    impl_terminologycapabilities_1(inst2)\n\n\ndef impl_terminologycapabilities_2(inst):\n    assert inst.codeSearch == \"in-compose-or-expansion\"\n    assert inst.contact[0].name == \"System Administrator\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].value == \"wile@acme.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2012-01-04\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"This is the FHIR capability statement for the main EHR at \"\n        \"ACME for the private interface - it does not describe the \"\n        \"public interface\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.6.2\"\n    assert inst.implementation.description == \"Acme Terminology Server\"\n    assert (\n        inst.implementation.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://example.org/tx\"}\n        ).valueUrl\n    )\n    assert inst.kind == \"instance\"\n    assert inst.name == \"ACMEEHR\"\n    assert inst.publisher == \"ACME Corporation\"\n    assert inst.software.name == \"TxServer\"\n    assert inst.software.version == \"0.1.2\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"ACME EHR capability statement\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311\"}\n        ).valueUri\n    )\n    assert inst.version == \"20130510\"\n\n\ndef test_terminologycapabilities_2(base_settings):\n    \"\"\"No. 2 tests collection for TerminologyCapabilities.\n    Test File: terminologycapabilities-example.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"terminologycapabilities-example.json\"\n    )\n    inst = terminologycapabilities.TerminologyCapabilities.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"TerminologyCapabilities\" == inst.get_resource_type()\n\n    impl_terminologycapabilities_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TerminologyCapabilities\" == data[\"resourceType\"]\n\n    inst2 = terminologycapabilities.TerminologyCapabilities(**data)\n    impl_terminologycapabilities_2(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_testplan.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TestPlan\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import testplan\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_testplan_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_testplan_1(base_settings):\n    \"\"\"No. 1 tests collection for TestPlan.\n    Test File: testplan-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testplan-example.json\"\n    inst = testplan.TestPlan.model_validate_json(filename.read_bytes())\n    assert \"TestPlan\" == inst.get_resource_type()\n\n    impl_testplan_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestPlan\" == data[\"resourceType\"]\n\n    inst2 = testplan.TestPlan(**data)\n    impl_testplan_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_testreport.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TestReport\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import testreport\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_testreport_1(inst):\n    assert inst.id == \"testreport-example\"\n    assert (\n        inst.identifier.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier.value == \"urn:oid:1.3.6.1.4.1.21367.2005.3.7.9878\"\n    assert (\n        inst.issued\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2016-10-07T08:25:34-05:00\"}\n        ).valueDateTime\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestReport Example for TestScript Example\"\n    assert inst.participant[0].display == \"Crucible\"\n    assert inst.participant[0].type == \"test-engine\"\n    assert (\n        inst.participant[0].uri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://projectcrucible.org\"}\n        ).valueUri\n    )\n    assert inst.participant[1].display == \"HealthIntersections STU3\"\n    assert inst.participant[1].type == \"server\"\n    assert (\n        inst.participant[1].uri\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://fhir3.healthintersections.com.au/open\"}\n        ).valueUri\n    )\n    assert inst.result == \"pass\"\n    assert float(inst.score) == float(100.0)\n    assert (\n        inst.setup.action[0].operation.detail\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://projectcrucible.org/permalink/1\"}\n        ).valueUri\n    )\n    assert inst.setup.action[0].operation.message == \"DELETE Patient\"\n    assert inst.setup.action[0].operation.result == \"pass\"\n    assert (\n        inst.setup.action[1].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/1\"\n    )\n    assert inst.setup.action[1].assert_fhir.message == \"HTTP 204\"\n    assert inst.setup.action[1].assert_fhir.result == \"pass\"\n    assert (\n        inst.setup.action[2].operation.detail\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://projectcrucible.org/permalink/1\"}\n        ).valueUri\n    )\n    assert (\n        inst.setup.action[2].operation.message == \"POST Patient/fixture-patient-create\"\n    )\n    assert inst.setup.action[2].operation.result == \"pass\"\n    assert (\n        inst.setup.action[3].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/1\"\n    )\n    assert inst.setup.action[3].assert_fhir.message == \"HTTP 201\"\n    assert inst.setup.action[3].assert_fhir.result == \"pass\"\n    assert inst.status == \"completed\"\n    assert (\n        inst.teardown.action[0].operation.detail\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://projectcrucible.org/permalink/3\"}\n        ).valueUri\n    )\n    assert (\n        inst.teardown.action[0].operation.message\n        == \"DELETE Patient/fixture-patient-create.\"\n    )\n    assert inst.teardown.action[0].operation.result == \"pass\"\n    assert inst.testScript == \"http://example.com/TestScript/testscript-example\"\n    assert (\n        inst.test[0].action[0].operation.detail\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://projectcrucible.org/permalink/2\"}\n        ).valueUri\n    )\n    assert (\n        inst.test[0].action[0].operation.message == \"GET Patient/fixture-patient-create\"\n    )\n    assert inst.test[0].action[0].operation.result == \"pass\"\n    assert (\n        inst.test[0].action[1].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert inst.test[0].action[1].assert_fhir.message == \"HTTP 200\"\n    assert inst.test[0].action[1].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[2].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert inst.test[0].action[2].assert_fhir.message == \"Last-Modified Present\"\n    assert inst.test[0].action[2].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[3].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert inst.test[0].action[3].assert_fhir.message == \"Response is Patient\"\n    assert inst.test[0].action[3].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[4].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert inst.test[0].action[4].assert_fhir.message == \"Response validates\"\n    assert inst.test[0].action[4].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[5].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert (\n        inst.test[0].action[5].assert_fhir.message == \"Patient.name.family 'Chalmers'\"\n    )\n    assert inst.test[0].action[5].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[6].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert inst.test[0].action[6].assert_fhir.message == \"Patient.name.given 'Peter'\"\n    assert inst.test[0].action[6].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[7].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert (\n        inst.test[0].action[7].assert_fhir.message == \"Patient.name.family 'Chalmers'\"\n    )\n    assert inst.test[0].action[7].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[8].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert (\n        inst.test[0].action[8].assert_fhir.message == \"Patient.name.family 'Chalmers'\"\n    )\n    assert inst.test[0].action[8].assert_fhir.result == \"pass\"\n    assert (\n        inst.test[0].action[9].assert_fhir.detail\n        == \"http://projectcrucible.org/permalink/2\"\n    )\n    assert inst.test[0].action[9].assert_fhir.message == \"Patient expected values.\"\n    assert inst.test[0].action[9].assert_fhir.result == \"pass\"\n    assert inst.test[0].description == \"Read a Patient and validate response.\"\n    assert inst.test[0].id == \"01-ReadPatient\"\n    assert inst.test[0].name == \"Read Patient\"\n    assert inst.tester == \"HL7 Execution Engine\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_testreport_1(base_settings):\n    \"\"\"No. 1 tests collection for TestReport.\n    Test File: testreport-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testreport-example.json\"\n    inst = testreport.TestReport.model_validate_json(filename.read_bytes())\n    assert \"TestReport\" == inst.get_resource_type()\n\n    impl_testreport_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestReport\" == data[\"resourceType\"]\n\n    inst2 = testreport.TestReport(**data)\n    impl_testreport_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_testscript.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TestScript\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import testscript\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_testscript_1(inst):\n    assert inst.contact[0].name == \"Support\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"support@HL7.org\"\n    assert inst.copyright == \"© HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-18\"}\n        ).valueDateTime\n    )\n    assert inst.destination[0].index == 1\n    assert inst.destination[0].profile.code == \"FHIR-Server\"\n    assert (\n        inst.destination[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUrl\": \"http://acme.com/fhir/test\"}\n        ).valueUrl\n    )\n    assert inst.destination[1].index == 2\n    assert inst.destination[1].profile.code == \"FHIR-Server\"\n    assert inst.experimental is True\n    assert inst.id == \"testscript-example-multisystem\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.12.6\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert inst.metadata.capability[0].description == \"Patient Read Operation\"\n    assert inst.metadata.capability[0].destination == 1\n    assert (\n        inst.metadata.capability[0].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#read\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[0].origin[0] == 1\n    assert inst.metadata.capability[0].required is True\n    assert inst.metadata.capability[0].validated is False\n    assert (\n        inst.metadata.capability[1].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert inst.metadata.capability[1].description == \"Patient Read Operation\"\n    assert inst.metadata.capability[1].destination == 2\n    assert (\n        inst.metadata.capability[1].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#read\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[1].origin[0] == 1\n    assert inst.metadata.capability[1].required is True\n    assert inst.metadata.capability[1].validated is False\n    assert inst.metadata.link[0].description == (\n        \"Demographics and other administrative information about an \"\n        \"individual or animal receiving care or other health-related \"\n        \"services.\"\n    )\n    assert (\n        inst.metadata.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/patient.html\"}\n        ).valueUri\n    )\n    assert inst.name == \"Testscriptexamplemultisystem\"\n    assert inst.origin[0].index == 1\n    assert inst.origin[0].profile.code == \"FHIR-Client\"\n    assert inst.publisher == \"HL7\"\n    assert inst.purpose == \"Patient Read Operation\"\n    assert inst.status == \"draft\"\n    assert inst.test[0].action[0].operation.accept == \"xml\"\n    assert inst.test[0].action[0].operation.contentType == \"xml\"\n    assert inst.test[0].action[0].operation.description == (\n        \"Read a Patient from the first destination test system and \"\n        \"perform basic validation.\"\n    )\n    assert inst.test[0].action[0].operation.destination == 1\n    assert inst.test[0].action[0].operation.encodeRequestUrl is True\n    assert inst.test[0].action[0].operation.origin == 1\n    assert inst.test[0].action[0].operation.params == \"/${Dest1PatientResourceId}\"\n    assert inst.test[0].action[0].operation.requestId == \"request-read-patient-01\"\n    assert (\n        inst.test[0].action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[0].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[0].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.test[0].action[1].assert_fhir.description == (\n        \"Confirm that the request method GET was sent by the client \"\n        \"system under test.\"\n    )\n    assert inst.test[0].action[1].assert_fhir.requestMethod == \"get\"\n    assert inst.test[0].action[1].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[2].assert_fhir.description\n        == \"Confirm that the client requested an Accept of xml.\"\n    )\n    assert inst.test[0].action[2].assert_fhir.direction == \"request\"\n    assert inst.test[0].action[2].assert_fhir.headerField == \"Accept\"\n    assert inst.test[0].action[2].assert_fhir.operator == \"contains\"\n    assert inst.test[0].action[2].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[2].assert_fhir.value == \"xml\"\n    assert inst.test[0].action[2].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[3].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[0].action[3].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[3].assert_fhir.response == \"okay\"\n    assert inst.test[0].action[3].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[3].assert_fhir.warningOnly is False\n    assert inst.test[0].action[4].assert_fhir.contentType == \"xml\"\n    assert (\n        inst.test[0].action[4].assert_fhir.description\n        == \"Confirm that the returned format is XML.\"\n    )\n    assert inst.test[0].action[4].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[4].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[4].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[5].assert_fhir.description\n        == \"Confirm that the returned resource type is Patient.\"\n    )\n    assert inst.test[0].action[5].assert_fhir.direction == \"response\"\n    assert (\n        inst.test[0].action[5].assert_fhir.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[0].action[5].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[5].assert_fhir.warningOnly is False\n    assert inst.test[0].description == (\n        \"Read a Patient from the first destination test system using \"\n        \"the user defined dynamic variable ${Dest1PatientResourceId}.\"\n        \" Perform basic validation.\"\n    )\n    assert inst.test[0].id == \"01-ReadPatient-Destination1\"\n    assert inst.test[0].name == \"ReadPatient-Destination1\"\n    assert inst.test[1].action[0].operation.accept == \"xml\"\n    assert inst.test[1].action[0].operation.contentType == \"xml\"\n    assert inst.test[1].action[0].operation.description == (\n        \"Read a Patient from the second destination test system and \"\n        \"perform basic validation.\"\n    )\n    assert inst.test[1].action[0].operation.destination == 2\n    assert inst.test[1].action[0].operation.encodeRequestUrl is True\n    assert inst.test[1].action[0].operation.origin == 1\n    assert inst.test[1].action[0].operation.params == \"/${Dest2PatientResourceId}\"\n    assert inst.test[1].action[0].operation.requestHeader[0].field == \"Accept-Charset\"\n    assert inst.test[1].action[0].operation.requestHeader[0].value == \"utf-8\"\n    assert (\n        inst.test[1].action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[1].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[1].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.test[1].action[1].assert_fhir.description\n        == \"Confirm that the client requested an Accept of xml.\"\n    )\n    assert inst.test[1].action[1].assert_fhir.direction == \"request\"\n    assert inst.test[1].action[1].assert_fhir.headerField == \"Accept\"\n    assert inst.test[1].action[1].assert_fhir.operator == \"contains\"\n    assert inst.test[1].action[1].assert_fhir.stopTestOnFail is False\n    assert inst.test[1].action[1].assert_fhir.value == \"xml\"\n    assert inst.test[1].action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.test[1].action[2].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[1].action[2].assert_fhir.direction == \"response\"\n    assert inst.test[1].action[2].assert_fhir.response == \"okay\"\n    assert inst.test[1].action[2].assert_fhir.stopTestOnFail is False\n    assert inst.test[1].action[2].assert_fhir.warningOnly is False\n    assert inst.test[1].action[3].assert_fhir.contentType == \"xml\"\n    assert (\n        inst.test[1].action[3].assert_fhir.description\n        == \"Confirm that the returned format is XML.\"\n    )\n    assert inst.test[1].action[3].assert_fhir.direction == \"response\"\n    assert inst.test[1].action[3].assert_fhir.stopTestOnFail is False\n    assert inst.test[1].action[3].assert_fhir.warningOnly is False\n    assert (\n        inst.test[1].action[4].assert_fhir.description\n        == \"Confirm that the returned resource type is Patient.\"\n    )\n    assert inst.test[1].action[4].assert_fhir.direction == \"response\"\n    assert (\n        inst.test[1].action[4].assert_fhir.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[1].action[4].assert_fhir.stopTestOnFail is False\n    assert inst.test[1].action[4].assert_fhir.warningOnly is False\n    assert inst.test[1].description == (\n        \"Read a Patient from the second destination test system using\"\n        \" the user defined dynamic variable \"\n        \"${Dest2PatientResourceId}. Perform basic validation.\"\n    )\n    assert inst.test[1].id == \"02-ReadPatient-Destination2\"\n    assert inst.test[1].name == \"ReadPatient-Destination2\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Multisystem Test Script\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/TestScript/testscript-example-multisystem\"\n            }\n        ).valueUri\n    )\n    assert inst.variable[0].defaultValue == \"example\"\n    assert inst.variable[0].name == \"Dest1PatientResourceId\"\n    assert inst.variable[1].defaultValue == \"example\"\n    assert inst.variable[1].name == \"Dest2PatientResourceId\"\n    assert inst.version == \"1.0\"\n\n\ndef test_testscript_1(base_settings):\n    \"\"\"No. 1 tests collection for TestScript.\n    Test File: testscript-example-multisystem.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"testscript-example-multisystem.json\"\n    )\n    inst = testscript.TestScript.model_validate_json(filename.read_bytes())\n    assert \"TestScript\" == inst.get_resource_type()\n\n    impl_testscript_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestScript\" == data[\"resourceType\"]\n\n    inst2 = testscript.TestScript(**data)\n    impl_testscript_1(inst2)\n\n\ndef impl_testscript_2(inst):\n    assert inst.contact[0].name == \"Support\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"support@HL7.org\"\n    assert inst.copyright == \"© HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-18\"}\n        ).valueDateTime\n    )\n    assert inst.experimental is True\n    assert inst.fixture[0].autocreate is False\n    assert inst.fixture[0].autodelete is False\n    assert inst.fixture[0].id == \"fixture-patient-create\"\n    assert inst.fixture[0].resource.display == \"Peter Chalmers\"\n    assert inst.fixture[0].resource.reference == \"Patient/example\"\n    assert inst.fixture[1].autocreate is False\n    assert inst.fixture[1].autodelete is False\n    assert inst.fixture[1].id == \"fixture-patient-update\"\n    assert inst.fixture[1].resource.display == \"Donald Duck\"\n    assert inst.fixture[1].resource.reference == \"Patient/pat1\"\n    assert inst.id == \"testscript-example-history\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.12.1\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert (\n        inst.metadata.capability[0].description\n        == \"Patient Update, Delete and History (Instance) Operations\"\n    )\n    assert (\n        inst.metadata.capability[0].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#update\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].link[1]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#delete\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].link[2]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#history\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[0].required is True\n    assert inst.metadata.capability[0].validated is False\n    assert inst.metadata.link[0].description == (\n        \"Demographics and other administrative information about an \"\n        \"individual or animal receiving care or other health-related \"\n        \"services.\"\n    )\n    assert (\n        inst.metadata.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/patient.html\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestScriptExampleHistory\"\n    assert inst.profile[0] == \"http://hl7.org/fhir/StructureDefinition/Bundle\"\n    assert inst.publisher == \"HL7\"\n    assert inst.purpose == (\n        \"Patient (Conditional) Create, Update, Delete and History \"\n        \"(Instance) Operations\"\n    )\n    assert inst.setup.action[0].operation.accept == \"json\"\n    assert inst.setup.action[0].operation.description == (\n        \"Execute a delete operation to insure the patient does not \"\n        \"exist on the server.\"\n    )\n    assert inst.setup.action[0].operation.encodeRequestUrl is True\n    assert inst.setup.action[0].operation.label == \"SetupDeletePatient\"\n    assert inst.setup.action[0].operation.params == \"/${createResourceId}\"\n    assert (\n        inst.setup.action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.setup.action[0].operation.type.code == \"delete\"\n    assert (\n        inst.setup.action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.setup.action[1].assert_fhir.description == (\n        \"Confirm that the returned HTTP status is 200(OK) or 204(No \" \"Content).\"\n    )\n    assert inst.setup.action[1].assert_fhir.direction == \"response\"\n    assert inst.setup.action[1].assert_fhir.operator == \"in\"\n    assert inst.setup.action[1].assert_fhir.responseCode == \"200,204\"\n    assert inst.setup.action[1].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[1].assert_fhir.warningOnly is False\n    assert inst.setup.action[2].operation.accept == \"json\"\n    assert inst.setup.action[2].operation.contentType == \"json\"\n    assert inst.setup.action[2].operation.description == (\n        \"Create patient resource on test server using the contents of\"\n        \" fixture-patient-create\"\n    )\n    assert inst.setup.action[2].operation.encodeRequestUrl is True\n    assert inst.setup.action[2].operation.label == \"SetupCreatePatient\"\n    assert inst.setup.action[2].operation.params == \"/${createResourceId}\"\n    assert (\n        inst.setup.action[2].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.setup.action[2].operation.sourceId == \"fixture-patient-create\"\n    assert inst.setup.action[2].operation.type.code == \"update\"\n    assert (\n        inst.setup.action[2].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.setup.action[3].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 201(Created).\"\n    )\n    assert inst.setup.action[3].assert_fhir.direction == \"response\"\n    assert inst.setup.action[3].assert_fhir.responseCode == \"201\"\n    assert inst.setup.action[3].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[3].assert_fhir.warningOnly is False\n    assert inst.setup.action[4].operation.accept == \"json\"\n    assert inst.setup.action[4].operation.contentType == \"json\"\n    assert inst.setup.action[4].operation.description == (\n        \"Update patient resource on test server using the contents of\"\n        \" fixture-patient-update\"\n    )\n    assert inst.setup.action[4].operation.encodeRequestUrl is True\n    assert inst.setup.action[4].operation.label == \"SetupUpdatePatient\"\n    assert inst.setup.action[4].operation.params == \"/${createResourceId}\"\n    assert (\n        inst.setup.action[4].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.setup.action[4].operation.sourceId == \"fixture-patient-update\"\n    assert inst.setup.action[4].operation.type.code == \"update\"\n    assert (\n        inst.setup.action[4].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.setup.action[5].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.setup.action[5].assert_fhir.direction == \"response\"\n    assert inst.setup.action[5].assert_fhir.responseCode == \"200\"\n    assert inst.setup.action[5].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[5].assert_fhir.warningOnly is False\n    assert inst.status == \"draft\"\n    assert inst.test[0].action[0].operation.accept == \"json\"\n    assert inst.test[0].action[0].operation.contentType == \"json\"\n    assert inst.test[0].action[0].operation.description == (\n        \"Get the Patient history on the test server using the id from\"\n        \" fixture-patient-create.\"\n    )\n    assert inst.test[0].action[0].operation.encodeRequestUrl is True\n    assert (\n        inst.test[0].action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[0].action[0].operation.targetId == \"fixture-patient-create\"\n    assert inst.test[0].action[0].operation.type.code == \"history\"\n    assert (\n        inst.test[0].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.test[0].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[0].action[1].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[1].assert_fhir.response == \"okay\"\n    assert inst.test[0].action[1].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[2].assert_fhir.description\n        == \"Confirm that the returned resource type is Bundle.\"\n    )\n    assert (\n        inst.test[0].action[2].assert_fhir.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Bundle\"}).valueUri\n    )\n    assert inst.test[0].action[2].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[2].assert_fhir.warningOnly is False\n    assert inst.test[0].action[3].assert_fhir.description == (\n        \"Confirm that the returned Bundle conforms to the base FHIR \" \"specification.\"\n    )\n    assert inst.test[0].action[3].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[3].assert_fhir.validateProfileId == \"bundle-profile\"\n    assert inst.test[0].action[3].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[4].assert_fhir.description\n        == \"Confirm that the returned Bundle type equals 'history'.\"\n    )\n    assert inst.test[0].action[4].assert_fhir.operator == \"equals\"\n    assert inst.test[0].action[4].assert_fhir.path == \"fhir:Bundle/fhir:type/@value\"\n    assert inst.test[0].action[4].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[4].assert_fhir.value == \"history\"\n    assert inst.test[0].action[4].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].description\n        == \"Get the history for a known Patient and validate response.\"\n    )\n    assert inst.test[0].id == \"01-HistoryPatient\"\n    assert inst.test[0].name == \"History Patient\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"TestScript Example History\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/TestScript/testscript-example-history\"}\n        ).valueUri\n    )\n    assert inst.variable[0].name == \"createResourceId\"\n    assert inst.variable[0].path == \"Patient/id\"\n    assert inst.variable[0].sourceId == \"fixture-patient-create\"\n    assert inst.version == \"1.0\"\n\n\ndef test_testscript_2(base_settings):\n    \"\"\"No. 2 tests collection for TestScript.\n    Test File: testscript-example-history.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testscript-example-history.json\"\n    inst = testscript.TestScript.model_validate_json(filename.read_bytes())\n    assert \"TestScript\" == inst.get_resource_type()\n\n    impl_testscript_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestScript\" == data[\"resourceType\"]\n\n    inst2 = testscript.TestScript(**data)\n    impl_testscript_2(inst2)\n\n\ndef impl_testscript_3(inst):\n    assert inst.contact[0].name == \"Support\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"support@HL7.org\"\n    assert inst.copyright == \"© HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-18\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"TestScript example resource with setup to delete if present \"\n        \"and create a new instance of a Patient; and single test \"\n        \"definition to update that Patient with various asserts.\"\n    )\n    assert inst.experimental is True\n    assert inst.fixture[0].autocreate is False\n    assert inst.fixture[0].autodelete is False\n    assert inst.fixture[0].id == \"fixture-patient-create\"\n    assert inst.fixture[0].resource.display == \"Peter Chalmers\"\n    assert inst.fixture[0].resource.reference == \"Patient/example\"\n    assert inst.fixture[1].autocreate is False\n    assert inst.fixture[1].autodelete is False\n    assert inst.fixture[1].id == \"fixture-patient-update\"\n    assert inst.fixture[1].resource.display == \"Donald Duck\"\n    assert inst.fixture[1].resource.reference == \"Patient/pat1\"\n    assert inst.id == \"testscript-example-update\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.12.5\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert (\n        inst.metadata.capability[0].description\n        == \"Patient Update and Delete Operations\"\n    )\n    assert (\n        inst.metadata.capability[0].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#update\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].link[1]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#delete\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[0].required is True\n    assert inst.metadata.capability[0].validated is False\n    assert inst.metadata.link[0].description == (\n        \"Demographics and other administrative information about an \"\n        \"individual or animal receiving care or other health-related \"\n        \"services.\"\n    )\n    assert (\n        inst.metadata.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/patient.html\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestScriptExampleUpdate\"\n    assert inst.profile[0] == \"http://hl7.org/fhir/StructureDefinition/Patient\"\n    assert inst.publisher == \"HL7\"\n    assert inst.purpose == \"Patient (Conditional) Create, Update, Delete Operations\"\n    assert inst.setup.action[0].operation.accept == \"xml\"\n    assert inst.setup.action[0].operation.description == (\n        \"Execute a delete operation to insure the patient does not \"\n        \"exist on the server.\"\n    )\n    assert inst.setup.action[0].operation.encodeRequestUrl is True\n    assert inst.setup.action[0].operation.label == \"SetupDeletePatient\"\n    assert inst.setup.action[0].operation.params == \"/${createResourceId}\"\n    assert (\n        inst.setup.action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.setup.action[0].operation.type.code == \"delete\"\n    assert (\n        inst.setup.action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.setup.action[1].assert_fhir.description == (\n        \"Confirm that the returned HTTP status is 200(OK) or 204(No \" \"Content).\"\n    )\n    assert inst.setup.action[1].assert_fhir.direction == \"response\"\n    assert inst.setup.action[1].assert_fhir.operator == \"in\"\n    assert inst.setup.action[1].assert_fhir.responseCode == \"200,204\"\n    assert inst.setup.action[1].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[1].assert_fhir.warningOnly is False\n    assert inst.setup.action[2].operation.accept == \"xml\"\n    assert inst.setup.action[2].operation.contentType == \"xml\"\n    assert inst.setup.action[2].operation.description == (\n        \"Create patient resource on test server using the contents of\"\n        \" fixture-patient-create\"\n    )\n    assert inst.setup.action[2].operation.encodeRequestUrl is True\n    assert inst.setup.action[2].operation.label == \"SetupCreatePatient\"\n    assert inst.setup.action[2].operation.params == \"/${createResourceId}\"\n    assert (\n        inst.setup.action[2].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.setup.action[2].operation.sourceId == \"fixture-patient-create\"\n    assert inst.setup.action[2].operation.type.code == \"update\"\n    assert (\n        inst.setup.action[2].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.setup.action[3].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 201(Created).\"\n    )\n    assert inst.setup.action[3].assert_fhir.direction == \"response\"\n    assert inst.setup.action[3].assert_fhir.responseCode == \"201\"\n    assert inst.setup.action[3].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[3].assert_fhir.warningOnly is False\n    assert inst.status == \"draft\"\n    assert inst.test[0].action[0].operation.accept == \"xml\"\n    assert inst.test[0].action[0].operation.contentType == \"xml\"\n    assert inst.test[0].action[0].operation.description == (\n        \"Update patient resource on test server using the contents of\"\n        \" fixture-patient-update\"\n    )\n    assert inst.test[0].action[0].operation.encodeRequestUrl is True\n    assert inst.test[0].action[0].operation.label == \"SetupUpdatePatient\"\n    assert inst.test[0].action[0].operation.params == \"/${createResourceId}\"\n    assert (\n        inst.test[0].action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[0].action[0].operation.sourceId == \"fixture-patient-update\"\n    assert inst.test[0].action[0].operation.type.code == \"update\"\n    assert (\n        inst.test[0].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.test[0].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[0].action[1].assert_fhir.response == \"okay\"\n    assert inst.test[0].action[1].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[1].assert_fhir.warningOnly is False\n    assert inst.test[0].action[2].assert_fhir.contentType == \"xml\"\n    assert (\n        inst.test[0].action[2].assert_fhir.description\n        == \"Confirm that the returned format is XML.\"\n    )\n    assert inst.test[0].action[2].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[2].assert_fhir.warningOnly is False\n    assert inst.test[0].action[3].assert_fhir.description == (\n        \"Confirm that the returned HTTP Header Last-Modified is \"\n        \"present. Warning only as the server might not support \"\n        \"versioning.\"\n    )\n    assert inst.test[0].action[3].assert_fhir.headerField == \"Last-Modified\"\n    assert inst.test[0].action[3].assert_fhir.operator == \"notEmpty\"\n    assert inst.test[0].action[3].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[3].assert_fhir.warningOnly is True\n    assert inst.test[0].description == \"Update a Patient and validate response.\"\n    assert inst.test[0].id == \"01-UpdatePatient\"\n    assert inst.test[0].name == \"Update Patient\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"TestScript Example Update\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/TestScript/testscript-example-update\"}\n        ).valueUri\n    )\n    assert inst.variable[0].name == \"createResourceId\"\n    assert inst.variable[0].path == \"Patient/id\"\n    assert inst.variable[0].sourceId == \"fixture-patient-create\"\n    assert inst.version == \"1.0\"\n\n\ndef test_testscript_3(base_settings):\n    \"\"\"No. 3 tests collection for TestScript.\n    Test File: testscript-example-update.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testscript-example-update.json\"\n    inst = testscript.TestScript.model_validate_json(filename.read_bytes())\n    assert \"TestScript\" == inst.get_resource_type()\n\n    impl_testscript_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestScript\" == data[\"resourceType\"]\n\n    inst2 = testscript.TestScript(**data)\n    impl_testscript_3(inst2)\n\n\ndef impl_testscript_4(inst):\n    assert inst.contact[0].name == \"Support\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"support@HL7.org\"\n    assert inst.copyright == \"© HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-18\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"TestScript example resource with simple Patient search test.\"\n        \" The read tests will utilize user defined dynamic variables \"\n        \"that will hold the Patient search parameter values.\"\n    )\n    assert inst.experimental is True\n    assert inst.fixture[0].autocreate is False\n    assert inst.fixture[0].autodelete is False\n    assert inst.fixture[0].id == \"fixture-patient-create\"\n    assert inst.fixture[0].resource.display == \"Peter Chalmers\"\n    assert inst.fixture[0].resource.reference == \"Patient/example\"\n    assert inst.id == \"testscript-example-search\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.12.3\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert inst.metadata.capability[0].description == \"Patient Search Operation\"\n    assert (\n        inst.metadata.capability[0].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#search\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[0].required is True\n    assert inst.metadata.capability[0].validated is False\n    assert inst.metadata.link[0].description == (\n        \"Demographics and other administrative information about an \"\n        \"individual or animal receiving care or other health-related \"\n        \"services.\"\n    )\n    assert (\n        inst.metadata.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/patient.html\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestScriptExampleSearch\"\n    assert inst.profile[0] == \"http://hl7.org/fhir/StructureDefinition/Bundle\"\n    assert inst.publisher == \"HL7\"\n    assert inst.purpose == \"Patient Search Operation\"\n    assert inst.setup.action[0].operation.accept == \"xml\"\n    assert (\n        inst.setup.action[0].operation.description\n        == \"Test simple search to verify server support.\"\n    )\n    assert inst.setup.action[0].operation.encodeRequestUrl is True\n    assert (\n        inst.setup.action[0].operation.params\n        == \"?family=DONTEXPECTAMATCH&given=DONTEXPECTAMATCH\"\n    )\n    assert (\n        inst.setup.action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.setup.action[0].operation.type.code == \"search\"\n    assert (\n        inst.setup.action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.setup.action[1].assert_fhir.description == (\n        \"Confirm that the request url contains the family search \" \"parameter.\"\n    )\n    assert inst.setup.action[1].assert_fhir.direction == \"request\"\n    assert inst.setup.action[1].assert_fhir.operator == \"contains\"\n    assert inst.setup.action[1].assert_fhir.requestURL == \"family\"\n    assert inst.setup.action[1].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.setup.action[2].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.setup.action[2].assert_fhir.direction == \"response\"\n    assert inst.setup.action[2].assert_fhir.responseCode == \"200\"\n    assert inst.setup.action[2].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[2].assert_fhir.warningOnly is False\n    assert (\n        inst.setup.action[3].assert_fhir.description\n        == \"Confirm that the returned resource type is Bundle.\"\n    )\n    assert (\n        inst.setup.action[3].assert_fhir.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Bundle\"}).valueUri\n    )\n    assert inst.setup.action[3].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[3].assert_fhir.warningOnly is False\n    assert inst.setup.action[4].assert_fhir.description == (\n        \"Confirm that the returned Bundle correctly defines the \" \"navigation links.\"\n    )\n    assert inst.setup.action[4].assert_fhir.navigationLinks is True\n    assert inst.setup.action[4].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[4].assert_fhir.warningOnly is False\n    assert inst.status == \"draft\"\n    assert inst.test[0].action[0].operation.accept == \"xml\"\n    assert inst.test[0].action[0].operation.contentType == \"xml\"\n    assert inst.test[0].action[0].operation.description == (\n        \"Create a Patient resource and capture the returned HTTP \" \"Header Location.\"\n    )\n    assert inst.test[0].action[0].operation.encodeRequestUrl is True\n    assert (\n        inst.test[0].action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[0].action[0].operation.responseId == \"PatientCreateResponse\"\n    assert inst.test[0].action[0].operation.sourceId == \"fixture-patient-create\"\n    assert inst.test[0].action[0].operation.type.code == \"create\"\n    assert (\n        inst.test[0].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.test[0].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 201(Created).\"\n    )\n    assert inst.test[0].action[1].assert_fhir.response == \"created\"\n    assert inst.test[0].action[1].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[2].assert_fhir.description\n        == \"Confirm that the returned HTTP Header Location is present.\"\n    )\n    assert inst.test[0].action[2].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[2].assert_fhir.headerField == \"Location\"\n    assert inst.test[0].action[2].assert_fhir.operator == \"notEmpty\"\n    assert inst.test[0].action[2].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[2].assert_fhir.warningOnly is False\n    assert inst.test[0].action[3].operation.accept == \"xml\"\n    assert inst.test[0].action[3].operation.description == (\n        \"Read the created Patient using the captured Location URL \" \"value.\"\n    )\n    assert inst.test[0].action[3].operation.encodeRequestUrl is True\n    assert inst.test[0].action[3].operation.type.code == \"read\"\n    assert (\n        inst.test[0].action[3].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.test[0].action[3].operation.url == \"${PatientCreateLocation}\"\n    assert (\n        inst.test[0].action[4].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[0].action[4].assert_fhir.response == \"okay\"\n    assert inst.test[0].action[4].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[4].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[5].assert_fhir.description\n        == \"Confirm that the returned resource type is Patient.\"\n    )\n    assert (\n        inst.test[0].action[5].assert_fhir.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[0].action[5].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[5].assert_fhir.warningOnly is False\n    assert inst.test[0].description == (\n        \"Create a Patient resource and capture the returned HTTP \"\n        \"Header Location. Then search for (read) that Patient using \"\n        \"the Location URL value and validate the response.\"\n    )\n    assert inst.test[0].id == \"01-PatientCreateSearch\"\n    assert inst.test[0].name == \"Patient Create Search\"\n    assert inst.test[1].action[0].operation.accept == \"xml\"\n    assert (\n        inst.test[1].action[0].operation.description\n        == \"Search for Patient resources on the destination test system.\"\n    )\n    assert inst.test[1].action[0].operation.encodeRequestUrl is True\n    assert inst.test[1].action[0].operation.params == (\n        \"?family=${PatientSearchFamilyName}&given=${PatientSearchGive\" \"nName}\"\n    )\n    assert (\n        inst.test[1].action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[1].action[0].operation.type.code == \"search\"\n    assert (\n        inst.test[1].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.test[1].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[1].action[1].assert_fhir.response == \"okay\"\n    assert inst.test[1].action[1].assert_fhir.stopTestOnFail is False\n    assert inst.test[1].action[1].assert_fhir.warningOnly is False\n    assert inst.test[1].action[2].assert_fhir.contentType == \"xml\"\n    assert (\n        inst.test[1].action[2].assert_fhir.description\n        == \"Confirm that the returned format is XML.\"\n    )\n    assert inst.test[1].action[2].assert_fhir.stopTestOnFail is False\n    assert inst.test[1].action[2].assert_fhir.warningOnly is False\n    assert (\n        inst.test[1].action[3].assert_fhir.description\n        == \"Confirm that the returned resource type is Bundle.\"\n    )\n    assert (\n        inst.test[1].action[3].assert_fhir.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Bundle\"}).valueUri\n    )\n    assert inst.test[1].action[3].assert_fhir.stopTestOnFail is True\n    assert inst.test[1].action[3].assert_fhir.warningOnly is False\n    assert inst.test[1].action[4].assert_fhir.description == (\n        \"Confirm that the returned Bundle conforms to the base FHIR \" \"specification.\"\n    )\n    assert inst.test[1].action[4].assert_fhir.stopTestOnFail is False\n    assert inst.test[1].action[4].assert_fhir.validateProfileId == \"bundle-profile\"\n    assert inst.test[1].action[4].assert_fhir.warningOnly is False\n    assert (\n        inst.test[1].action[5].assert_fhir.description\n        == \"Confirm that the returned Bundle type equals 'searchset'.\"\n    )\n    assert inst.test[1].action[5].assert_fhir.operator == \"equals\"\n    assert inst.test[1].action[5].assert_fhir.path == \"fhir:Bundle/fhir:type/@value\"\n    assert inst.test[1].action[5].assert_fhir.stopTestOnFail is False\n    assert inst.test[1].action[5].assert_fhir.value == \"searchset\"\n    assert inst.test[1].action[5].assert_fhir.warningOnly is False\n    assert inst.test[1].action[6].assert_fhir.description == (\n        \"Confirm that the returned Bundle total is greater than or \"\n        \"equal to the number of returned entries.\"\n    )\n    assert (\n        inst.test[1].action[6].assert_fhir.expression\n        == \"Bundle.total.toInteger() >= entry.count()\"\n    )\n    assert inst.test[1].action[6].assert_fhir.stopTestOnFail is False\n    assert inst.test[1].action[6].assert_fhir.warningOnly is False\n    assert inst.test[1].description == (\n        \"Search for Patient resources using the user defined dynamic \"\n        \"variables ${PatientSearchFamilyName} and \"\n        \"${PatientSearchGivenName} and validate response.\"\n    )\n    assert inst.test[1].id == \"02-PatientSearchDynamic\"\n    assert inst.test[1].name == \"Patient Search Dynamic\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"TestScript Example Search\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/TestScript/testscript-example-search\"}\n        ).valueUri\n    )\n    assert inst.variable[0].headerField == \"Location\"\n    assert inst.variable[0].name == \"PatientCreateLocation\"\n    assert inst.variable[0].sourceId == \"PatientCreateResponse\"\n    assert inst.variable[1].description == (\n        \"Enter patient search criteria for a known family name on the\" \" target system\"\n    )\n    assert inst.variable[1].hint == \"[Family name]\"\n    assert inst.variable[1].name == \"PatientSearchFamilyName\"\n    assert inst.variable[2].description == (\n        \"Enter patient search criteria for a known given name on the \" \"target system\"\n    )\n    assert inst.variable[2].hint == \"[Given name]\"\n    assert inst.variable[2].name == \"PatientSearchGivenName\"\n    assert (\n        inst.variable[3].description\n        == \"Evaluate the returned Patient searchset Bundle.total value\"\n    )\n    assert inst.variable[3].expression == \"Bundle.total.toInteger()\"\n    assert inst.variable[3].name == \"PatientSearchBundleTotal\"\n    assert inst.version == \"1.0\"\n\n\ndef test_testscript_4(base_settings):\n    \"\"\"No. 4 tests collection for TestScript.\n    Test File: testscript-example-search.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testscript-example-search.json\"\n    inst = testscript.TestScript.model_validate_json(filename.read_bytes())\n    assert \"TestScript\" == inst.get_resource_type()\n\n    impl_testscript_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestScript\" == data[\"resourceType\"]\n\n    inst2 = testscript.TestScript(**data)\n    impl_testscript_4(inst2)\n\n\ndef impl_testscript_5(inst):\n    assert inst.contact[0].name == \"Support\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"support@HL7.org\"\n    assert inst.copyright == \"© HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-18\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"TestScript example resource with setup to delete if present \"\n        \"and create a new instance of a Patient; and single test \"\n        \"definition to read the created Patient with various asserts.\"\n    )\n    assert inst.experimental is True\n    assert inst.fixture[0].autocreate is False\n    assert inst.fixture[0].autodelete is False\n    assert inst.fixture[0].id == \"fixture-patient-create\"\n    assert inst.fixture[0].resource.display == \"Peter Chalmers\"\n    assert inst.fixture[0].resource.reference == \"Patient/example\"\n    assert inst.fixture[1].autocreate is False\n    assert inst.fixture[1].autodelete is False\n    assert inst.fixture[1].id == \"fixture-patient-minimum\"\n    assert inst.fixture[1].resource.display == \"Peter Chalmers (minimum)\"\n    assert inst.fixture[1].resource.reference == \"Patient/example\"\n    assert inst.id == \"testscript-example\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.12.4\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert (\n        inst.metadata.capability[0].description\n        == \"Patient Update, Read and Delete Operations\"\n    )\n    assert (\n        inst.metadata.capability[0].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#delete\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].link[1]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#read\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].link[2]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#update\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[0].required is True\n    assert inst.metadata.capability[0].validated is False\n    assert inst.metadata.link[0].description == (\n        \"Demographics and other administrative information about an \"\n        \"individual or animal receiving care or other health-related \"\n        \"services.\"\n    )\n    assert (\n        inst.metadata.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/patient.html\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestScriptExample\"\n    assert inst.profile[0] == \"http://hl7.org/fhir/StructureDefinition/Patient\"\n    assert inst.publisher == \"HL7\"\n    assert inst.purpose == (\n        \"Patient Conditional Create (Update), Read and Delete \" \"Operations\"\n    )\n    assert inst.setup.action[0].operation.accept == \"json\"\n    assert inst.setup.action[0].operation.description == (\n        \"Execute a delete operation to insure the patient does not \"\n        \"exist on the server.\"\n    )\n    assert inst.setup.action[0].operation.encodeRequestUrl is True\n    assert inst.setup.action[0].operation.label == \"SetupDeletePatient\"\n    assert inst.setup.action[0].operation.params == \"/${createResourceId}\"\n    assert (\n        inst.setup.action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.setup.action[0].operation.type.code == \"delete\"\n    assert (\n        inst.setup.action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.setup.action[1].assert_fhir.description == (\n        \"Confirm that the returned HTTP status is 200(OK) or 204(No \" \"Content).\"\n    )\n    assert inst.setup.action[1].assert_fhir.direction == \"response\"\n    assert inst.setup.action[1].assert_fhir.operator == \"in\"\n    assert inst.setup.action[1].assert_fhir.responseCode == \"200,204\"\n    assert inst.setup.action[1].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[1].assert_fhir.warningOnly is False\n    assert inst.setup.action[2].operation.accept == \"json\"\n    assert inst.setup.action[2].operation.contentType == \"json\"\n    assert inst.setup.action[2].operation.description == (\n        \"Create patient resource on test server using the contents of\"\n        \" fixture-patient-create\"\n    )\n    assert inst.setup.action[2].operation.encodeRequestUrl is True\n    assert inst.setup.action[2].operation.label == \"SetupCreatePatient\"\n    assert inst.setup.action[2].operation.params == \"/${createResourceId}\"\n    assert (\n        inst.setup.action[2].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.setup.action[2].operation.sourceId == \"fixture-patient-create\"\n    assert inst.setup.action[2].operation.type.code == \"update\"\n    assert (\n        inst.setup.action[2].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.setup.action[3].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 201(Created).\"\n    )\n    assert inst.setup.action[3].assert_fhir.direction == \"response\"\n    assert inst.setup.action[3].assert_fhir.responseCode == \"201\"\n    assert inst.setup.action[3].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[3].assert_fhir.warningOnly is False\n    assert inst.setup.action[4].operation.description == (\n        \"Read the created patient resource on the test server using \"\n        \"the id from fixture-patient-create. Verify contents.\"\n    )\n    assert inst.setup.action[4].operation.encodeRequestUrl is True\n    assert (\n        inst.setup.action[4].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.setup.action[4].operation.targetId == \"fixture-patient-create\"\n    assert inst.setup.action[4].operation.type.code == \"read\"\n    assert (\n        inst.setup.action[4].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.setup.action[5].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.setup.action[5].assert_fhir.direction == \"response\"\n    assert inst.setup.action[5].assert_fhir.response == \"okay\"\n    assert inst.setup.action[5].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[5].assert_fhir.warningOnly is False\n    assert (\n        inst.setup.action[6].assert_fhir.compareToSourceExpression\n        == \"Patient.name.first().family\"\n    )\n    assert (\n        inst.setup.action[6].assert_fhir.compareToSourceId == \"fixture-patient-create\"\n    )\n    assert inst.setup.action[6].assert_fhir.description == (\n        \"Confirm that the returned Patient contains the expected \"\n        \"family name 'Chalmers'. Uses explicit compareToSourceId \"\n        \"reference to fixture-patient-create used to create the \"\n        \"Patient.\"\n    )\n    assert inst.setup.action[6].assert_fhir.operator == \"equals\"\n    assert inst.setup.action[6].assert_fhir.stopTestOnFail is False\n    assert inst.setup.action[6].assert_fhir.warningOnly is False\n    assert inst.status == \"draft\"\n    assert inst.teardown.action[0].operation.description == (\n        \"Delete the patient resource on the test server using the id \"\n        \"from fixture-patient-create.\"\n    )\n    assert inst.teardown.action[0].operation.encodeRequestUrl is True\n    assert (\n        inst.teardown.action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.teardown.action[0].operation.targetId == \"fixture-patient-create\"\n    assert inst.teardown.action[0].operation.type.code == \"delete\"\n    assert (\n        inst.teardown.action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert inst.test[0].action[0].operation.description == (\n        \"Read the patient resource on the test server using the id \"\n        \"from fixture-patient-create. Prevent URL encoding of the \"\n        \"request.\"\n    )\n    assert inst.test[0].action[0].operation.encodeRequestUrl is False\n    assert (\n        inst.test[0].action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[0].action[0].operation.responseId == \"fixture-patient-read\"\n    assert inst.test[0].action[0].operation.targetId == \"fixture-patient-create\"\n    assert inst.test[0].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[0].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.test[0].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[0].action[1].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[1].assert_fhir.label == \"01-ReadPatientOK\"\n    assert inst.test[0].action[1].assert_fhir.response == \"okay\"\n    assert inst.test[0].action[1].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[1].assert_fhir.warningOnly is False\n    assert inst.test[0].action[2].assert_fhir.description == (\n        \"Confirm that the returned HTTP Header Last-Modified is \"\n        \"present. Warning only as the server might not support \"\n        \"versioning.\"\n    )\n    assert inst.test[0].action[2].assert_fhir.direction == \"response\"\n    assert inst.test[0].action[2].assert_fhir.headerField == \"Last-Modified\"\n    assert inst.test[0].action[2].assert_fhir.operator == \"notEmpty\"\n    assert inst.test[0].action[2].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[2].assert_fhir.warningOnly is True\n    assert (\n        inst.test[0].action[3].assert_fhir.description\n        == \"Confirm that the returned resource type is Patient.\"\n    )\n    assert (\n        inst.test[0].action[3].assert_fhir.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[0].action[3].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[3].assert_fhir.warningOnly is False\n    assert inst.test[0].action[4].assert_fhir.description == (\n        \"Confirm that the returned Patient conforms to the base FHIR \" \"specification.\"\n    )\n    assert inst.test[0].action[4].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[4].assert_fhir.validateProfileId == \"patient-profile\"\n    assert inst.test[0].action[4].assert_fhir.warningOnly is False\n    assert inst.test[0].action[5].assert_fhir.description == (\n        \"Confirm that the returned Patient contains the expected \"\n        \"family name 'Chalmers'. Uses explicit sourceId reference to \"\n        \"read responseId fixture.\"\n    )\n    assert inst.test[0].action[5].assert_fhir.operator == \"equals\"\n    assert (\n        inst.test[0].action[5].assert_fhir.path\n        == \"fhir:Patient/fhir:name/fhir:family/@value\"\n    )\n    assert inst.test[0].action[5].assert_fhir.sourceId == \"fixture-patient-read\"\n    assert inst.test[0].action[5].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[5].assert_fhir.value == \"Chalmers\"\n    assert inst.test[0].action[5].assert_fhir.warningOnly is False\n    assert inst.test[0].action[6].assert_fhir.description == (\n        \"Confirm that the returned Patient contains the expected \"\n        \"given name 'Peter'. Uses explicit sourceId reference to read\"\n        \" responseId fixture.\"\n    )\n    assert inst.test[0].action[6].assert_fhir.operator == \"equals\"\n    assert (\n        inst.test[0].action[6].assert_fhir.path\n        == \"fhir:Patient/fhir:name/fhir:given/@value\"\n    )\n    assert inst.test[0].action[6].assert_fhir.sourceId == \"fixture-patient-read\"\n    assert inst.test[0].action[6].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[6].assert_fhir.value == \"Peter\"\n    assert inst.test[0].action[6].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[7].assert_fhir.compareToSourceId == \"fixture-patient-create\"\n    )\n    assert (\n        inst.test[0].action[7].assert_fhir.compareToSourcePath\n        == \"fhir:Patient/fhir:name/fhir:family/@value\"\n    )\n    assert inst.test[0].action[7].assert_fhir.operator == \"equals\"\n    assert (\n        inst.test[0].action[7].assert_fhir.path\n        == \"fhir:Patient/fhir:name/fhir:family/@value\"\n    )\n    assert inst.test[0].action[7].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[7].assert_fhir.warningOnly is False\n    assert (\n        inst.test[0].action[8].assert_fhir.compareToSourceId == \"fixture-patient-create\"\n    )\n    assert (\n        inst.test[0].action[8].assert_fhir.compareToSourcePath\n        == \"fhir:Patient/fhir:name/fhir:given/@value\"\n    )\n    assert (\n        inst.test[0].action[8].assert_fhir.path\n        == \"fhir:Patient/fhir:name/fhir:given/@value\"\n    )\n    assert inst.test[0].action[8].assert_fhir.sourceId == \"fixture-patient-read\"\n    assert inst.test[0].action[8].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[8].assert_fhir.warningOnly is False\n    assert inst.test[0].action[9].assert_fhir.description == (\n        \"Confirm that the returned resource contains the expected \"\n        \"retained elements and values. Warning only to provide users \"\n        \"with reviewable results.\"\n    )\n    assert inst.test[0].action[9].assert_fhir.minimumId == \"fixture-patient-minimum\"\n    assert inst.test[0].action[9].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[9].assert_fhir.warningOnly is True\n    assert inst.test[0].description == \"Read a Patient and validate response.\"\n    assert inst.test[0].id == \"01-ReadPatient\"\n    assert inst.test[0].name == \"Read Patient\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"TestScript Example\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/TestScript/testscript-example\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].code.code == \"focus\"\n    assert (\n        inst.useContext[0].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[0].valueCodeableConcept.coding[0].code == \"positive\"\n    assert (\n        inst.useContext[0].valueCodeableConcept.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/variant-state\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].code.code == \"program\"\n    assert (\n        inst.useContext[1].code.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/usage-context-type\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueRange.low.code == \"a\"\n    assert (\n        inst.useContext[1].valueRange.low.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.useContext[1].valueRange.low.unit == \"year\"\n    assert float(inst.useContext[1].valueRange.low.value) == float(2018)\n    assert inst.variable[0].name == \"createResourceId\"\n    assert inst.variable[0].path == \"Patient/id\"\n    assert inst.variable[0].sourceId == \"fixture-patient-create\"\n    assert inst.version == \"1.0\"\n\n\ndef test_testscript_5(base_settings):\n    \"\"\"No. 5 tests collection for TestScript.\n    Test File: testscript-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testscript-example.json\"\n    inst = testscript.TestScript.model_validate_json(filename.read_bytes())\n    assert \"TestScript\" == inst.get_resource_type()\n\n    impl_testscript_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestScript\" == data[\"resourceType\"]\n\n    inst2 = testscript.TestScript(**data)\n    impl_testscript_5(inst2)\n\n\ndef impl_testscript_6(inst):\n    assert inst.contact[0].name == \"Support\"\n    assert inst.contact[0].telecom[0].system == \"email\"\n    assert inst.contact[0].telecom[0].use == \"work\"\n    assert inst.contact[0].telecom[0].value == \"support@HL7.org\"\n    assert inst.copyright == \"© HL7.org 2011+\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2017-01-18\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"TestScript example resource with ported Sprinkler basic read\"\n        \" tests R001, R002, R003, R004. The read tests will utilize \"\n        \"user defined dynamic variables that will hold the Patient \"\n        \"resource id values.\"\n    )\n    assert inst.experimental is True\n    assert inst.id == \"testscript-example-readtest\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.12.2\"\n    assert inst.jurisdiction[0].coding[0].code == \"US\"\n    assert inst.jurisdiction[0].coding[0].display == \"United States of America (the)\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:iso:std:iso:3166\"}\n        ).valueUri\n    )\n    assert (\n        inst.metadata.capability[0].capabilities\n        == \"http://hl7.org/fhir/CapabilityStatement/example\"\n    )\n    assert inst.metadata.capability[0].description == \"Patient Read Operation\"\n    assert (\n        inst.metadata.capability[0].link[0]\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/http.html#read\"}\n        ).valueUri\n    )\n    assert inst.metadata.capability[0].required is True\n    assert inst.metadata.capability[0].validated is False\n    assert inst.metadata.link[0].description == (\n        \"Demographics and other administrative information about an \"\n        \"individual or animal receiving care or other health-related \"\n        \"services.\"\n    )\n    assert (\n        inst.metadata.link[0].url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/patient.html\"}\n        ).valueUri\n    )\n    assert inst.name == \"TestScript Example Read Test\"\n    assert inst.profile[0] == \"http://hl7.org/fhir/StructureDefinition/Patient\"\n    assert inst.publisher == \"HL7\"\n    assert inst.purpose == \"Patient Read Operation\"\n    assert inst.scope[0].artifact == \"http://hl7.org/fhir/StructureDefinition/Patient\"\n    assert inst.scope[0].conformance.coding[0].code == \"optional\"\n    assert (\n        inst.scope[0].conformance.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/testscript-scope-conformance-codes\"}\n        ).valueUri\n    )\n    assert inst.scope[0].phase.coding[0].code == \"unit\"\n    assert (\n        inst.scope[0].phase.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/testscript-scope-phase-codes\"}\n        ).valueUri\n    )\n    assert inst.status == \"draft\"\n    assert inst.test[0].action[0].operation.accept == \"xml\"\n    assert inst.test[0].action[0].operation.description == (\n        \"Read the known Patient resource on the destination test \"\n        \"system using the user defined dynamic variable \"\n        \"${KnownPatientResourceId}.\"\n    )\n    assert inst.test[0].action[0].operation.encodeRequestUrl is True\n    assert inst.test[0].action[0].operation.params == \"/${KnownPatientResourceId}\"\n    assert (\n        inst.test[0].action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[0].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[0].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.test[0].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 200(OK).\"\n    )\n    assert inst.test[0].action[1].assert_fhir.response == \"okay\"\n    assert inst.test[0].action[1].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[1].assert_fhir.warningOnly is False\n    assert inst.test[0].action[2].assert_fhir.contentType == \"xml\"\n    assert (\n        inst.test[0].action[2].assert_fhir.description\n        == \"Confirm that the returned format is XML.\"\n    )\n    assert inst.test[0].action[2].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[2].assert_fhir.warningOnly is False\n    assert inst.test[0].action[3].assert_fhir.description == (\n        \"Confirm that the returned HTTP Header Last-Modified is \"\n        \"present. Warning only as the server might not support \"\n        \"versioning.\"\n    )\n    assert inst.test[0].action[3].assert_fhir.headerField == \"Last-Modified\"\n    assert inst.test[0].action[3].assert_fhir.operator == \"notEmpty\"\n    assert inst.test[0].action[3].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[3].assert_fhir.warningOnly is True\n    assert (\n        inst.test[0].action[4].assert_fhir.description\n        == \"Confirm that the returned resource type is Patient.\"\n    )\n    assert (\n        inst.test[0].action[4].assert_fhir.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[0].action[4].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[4].assert_fhir.warningOnly is False\n    assert inst.test[0].action[5].assert_fhir.description == (\n        \"Confirm that the returned Patient conforms to the base FHIR \" \"specification.\"\n    )\n    assert inst.test[0].action[5].assert_fhir.stopTestOnFail is False\n    assert inst.test[0].action[5].assert_fhir.validateProfileId == \"patient-profile\"\n    assert inst.test[0].action[5].assert_fhir.warningOnly is False\n    assert inst.test[0].description == \"Read a known Patient and validate response.\"\n    assert inst.test[0].id == \"R001\"\n    assert inst.test[0].name == \"Sprinkler Read Test R001\"\n    assert inst.test[1].action[0].operation.accept == \"xml\"\n    assert inst.test[1].action[0].operation.encodeRequestUrl is True\n    assert inst.test[1].action[0].operation.params == \"/1\"\n    assert (\n        inst.test[1].action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[1].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[1].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.test[1].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 404(Not Found).\"\n    )\n    assert inst.test[1].action[1].assert_fhir.response == \"notFound\"\n    assert inst.test[1].action[1].assert_fhir.stopTestOnFail is False\n    assert inst.test[1].action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.test[1].description\n        == \"Read an unknown Resource Type and validate response.\"\n    )\n    assert inst.test[1].id == \"R002\"\n    assert inst.test[1].name == \"Sprinkler Read Test R002\"\n    assert inst.test[2].action[0].operation.accept == \"xml\"\n    assert inst.test[2].action[0].operation.description == (\n        \"Attempt to read the non-existing Patient resource on the \"\n        \"destination test system using the user defined dynamic \"\n        \"variable ${NonExistsPatientResourceId}.\"\n    )\n    assert inst.test[2].action[0].operation.encodeRequestUrl is True\n    assert inst.test[2].action[0].operation.params == \"/${NonExistsPatientResourceId}\"\n    assert (\n        inst.test[2].action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[2].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[2].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.test[2].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 404(Not Found).\"\n    )\n    assert inst.test[2].action[1].assert_fhir.response == \"notFound\"\n    assert inst.test[2].action[1].assert_fhir.stopTestOnFail is False\n    assert inst.test[2].action[1].assert_fhir.warningOnly is False\n    assert (\n        inst.test[2].description\n        == \"Read a known, non-existing Patient and validate response.\"\n    )\n    assert inst.test[2].id == \"R003\"\n    assert inst.test[2].name == \"Sprinkler Read Test R003\"\n    assert inst.test[3].action[0].operation.accept == \"xml\"\n    assert inst.test[3].action[0].operation.description == (\n        \"Attempt to read a Patient resource on the destination test \"\n        \"system using known bad formatted resource id.\"\n    )\n    assert inst.test[3].action[0].operation.encodeRequestUrl is True\n    assert inst.test[3].action[0].operation.params == \"/ID-may-not-contain-CAPITALS\"\n    assert (\n        inst.test[3].action[0].operation.resource\n        == ExternalValidatorModel.model_validate({\"valueUri\": \"Patient\"}).valueUri\n    )\n    assert inst.test[3].action[0].operation.type.code == \"read\"\n    assert (\n        inst.test[3].action[0].operation.type.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/restful-interaction\"}\n        ).valueUri\n    )\n    assert (\n        inst.test[3].action[1].assert_fhir.description\n        == \"Confirm that the returned HTTP status is 400(Bad Request).\"\n    )\n    assert inst.test[3].action[1].assert_fhir.response == \"badRequest\"\n    assert inst.test[3].action[1].assert_fhir.stopTestOnFail is False\n    assert inst.test[3].action[1].assert_fhir.warningOnly is False\n    assert inst.test[3].description == (\n        \"Read a Patient using a known bad formatted resource id and \"\n        \"validate response.\"\n    )\n    assert inst.test[3].id == \"R004\"\n    assert inst.test[3].name == \"Sprinkler Read Test R004\"\n    assert inst.text.status == \"generated\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/TestScript/testscript-example-readtest\"}\n        ).valueUri\n    )\n    assert inst.variable[0].defaultValue == \"example\"\n    assert inst.variable[0].name == \"KnownPatientResourceId\"\n    assert inst.variable[1].defaultValue == \"does-not-exist\"\n    assert inst.variable[1].name == \"NonExistsPatientResourceId\"\n    assert inst.version == \"1.0\"\n\n\ndef test_testscript_6(base_settings):\n    \"\"\"No. 6 tests collection for TestScript.\n    Test File: testscript-example-readtest.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"testscript-example-readtest.json\"\n    inst = testscript.TestScript.model_validate_json(filename.read_bytes())\n    assert \"TestScript\" == inst.get_resource_type()\n\n    impl_testscript_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"TestScript\" == data[\"resourceType\"]\n\n    inst2 = testscript.TestScript(**data)\n    impl_testscript_6(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_transport.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Transport\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import transport\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_transport_1(inst):\n    assert inst.basedOn[0].reference == \"SupplyRequest/simpleorder\"\n    assert inst.currentLocation.display == \"Current location for item at Lab A\"\n    assert inst.currentLocation.reference == \"Transport/location-labA\"\n    assert inst.id == \"simpledelivery\"\n    assert inst.identifier[0].value == \"Transport1234\"\n    assert inst.intent == \"order\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.partOf[0].display == \"Central Supply Restock\"\n    assert (\n        inst.requestedLocation.display\n        == \"Requested location for item at City Hospital Lab\"\n    )\n    assert inst.requestedLocation.reference == \"Transport/location-hospitalLab\"\n    assert inst.status == \"completed\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_transport_1(base_settings):\n    \"\"\"No. 1 tests collection for Transport.\n    Test File: transport-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"transport-example.json\"\n    inst = transport.Transport.model_validate_json(filename.read_bytes())\n    assert \"Transport\" == inst.get_resource_type()\n\n    impl_transport_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"Transport\" == data[\"resourceType\"]\n\n    inst2 = transport.Transport(**data)\n    impl_transport_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_valueset.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ValueSet\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import valueset\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_valueset_1(inst):\n    assert inst.compose.include[0].concept[0].code == \"ActivityDefinition\"\n    assert inst.compose.include[0].concept[1].code == \"ChargeItemDefinition\"\n    assert inst.compose.include[0].concept[2].code == \"ClinicalUseDefinition\"\n    assert inst.compose.include[0].concept[3].code == \"EventDefinition\"\n    assert inst.compose.include[0].concept[4].code == \"Measure\"\n    assert inst.compose.include[0].concept[5].code == \"MessageDefinition\"\n    assert inst.compose.include[0].concept[6].code == \"ObservationDefinition\"\n    assert inst.compose.include[0].concept[7].code == \"OperationDefinition\"\n    assert inst.compose.include[0].concept[8].code == \"PlanDefinition\"\n    assert inst.compose.include[0].concept[9].code == \"Questionnaire\"\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/fhir-types\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"All Resource Types that represent definition resources\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fhir\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"normative\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 5\n    assert inst.id == \"definition-resource-types\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.1056\"\n    assert inst.immutable is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"DefinitionResourceTypes\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"extensions\"\n    assert inst.title == \"Definition Resource Types\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/definition-resource-types\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_valueset_1(base_settings):\n    \"\"\"No. 1 tests collection for ValueSet.\n    Test File: valueset-definition-resource-types.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"valueset-definition-resource-types.json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_1(inst2)\n\n\ndef impl_valueset_2(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/location-physical-type\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == (\n        \"This example value set defines a set of codes that can be \"\n        \"used to indicate the physical form of the Location.\"\n    )\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"pa\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"draft\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"location-form\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.328\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"LocationForm\"\n    assert inst.publisher == \"FHIR Project team\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Location Form\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/location-form\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_valueset_2(base_settings):\n    \"\"\"No. 2 tests collection for ValueSet.\n    Test File: valueset-location-form.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"valueset-location-form.json\"\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_2(inst2)\n\n\ndef impl_valueset_3(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/genomicstudy-status\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-28T16:55:11+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"The status of the GenomicStudy.\"\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"cg\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"genomicstudy-status\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.3083\"\n    assert inst.immutable is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"GenomicStudyStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\"><ul><li>Include '\n        'all codes defined in <a href=\"codesystem-genomicstudy-'\n        'status.html\"><code>http://hl7.org/fhir/genomicstudy-'\n        \"status</code></a></li></ul></div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Genomic Study Status\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/genomicstudy-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_valueset_3(base_settings):\n    \"\"\"No. 3 tests collection for ValueSet.\n    Test File: valueset-genomicstudy-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"valueset-genomicstudy-status.json\"\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_3(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_3(inst2)\n\n\ndef impl_valueset_4(inst):\n    assert inst.compose.include[0].concept[0].code == \"7771000\"\n    assert inst.compose.include[0].concept[0].display == \"Left (qualifier value)\"\n    assert inst.compose.include[0].concept[1].code == \"24028007\"\n    assert inst.compose.include[0].concept[1].display == \"Right (qualifier value)\"\n    assert inst.compose.include[0].concept[2].code == \"51440002\"\n    assert inst.compose.include[0].concept[2].display == \"Bilateral\"\n    assert inst.compose.include[0].concept[3].code == \"46053002\"\n    assert inst.compose.include[0].concept[3].display == \"Distal\"\n    assert inst.compose.include[0].concept[4].code == \"255554000\"\n    assert inst.compose.include[0].concept[4].display == \"Dorsal\"\n    assert inst.compose.include[0].concept[5].code == \"264147007\"\n    assert inst.compose.include[0].concept[5].display == \"Plantar\"\n    assert inst.compose.include[0].concept[6].code == \"261183002\"\n    assert inst.compose.include[0].concept[6].display == \"Upper\"\n    assert inst.compose.include[0].concept[7].code == \"261122009\"\n    assert inst.compose.include[0].concept[7].display == \"Lower\"\n    assert inst.compose.include[0].concept[8].code == \"255561001\"\n    assert inst.compose.include[0].concept[8].display == \"Medial\"\n    assert inst.compose.include[0].concept[9].code == \"49370004\"\n    assert inst.compose.include[0].concept[9].display == \"Lateral\"\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://snomed.info/sct\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.description == \"SNOMED-CT concepts modifying the anatomic location\"\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"oo\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"draft\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"bodystructure-relative-location\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.140\"\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"BodystructureLocationQualifier\"\n    assert inst.publisher == \"Order and Observation Workgroup\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Bodystructure Location Qualifier\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/bodystructure-relative-location\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_valueset_4(base_settings):\n    \"\"\"No. 4 tests collection for ValueSet.\n    Test File: valueset-bodystructure-relative-location.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-bodystructure-relative-location.json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_4(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_4(inst2)\n\n\ndef impl_valueset_5(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/encounter-status\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-28T16:55:11+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"Current state of the encounter.\"\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"pa\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 4\n    assert inst.id == \"encounter-status\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.246\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"old\"\n    assert inst.identifier[1].value == \"urn:oid:2.16.840.1.113883.4.642.3.241\"\n    assert inst.immutable is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"EncounterStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\"><ul><li>Include '\n        'all codes defined in <a href=\"codesystem-encounter-'\n        'status.html\"><code>http://hl7.org/fhir/encounter-'\n        \"status</code></a></li></ul></div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Encounter Status\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/encounter-status\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_valueset_5(base_settings):\n    \"\"\"No. 5 tests collection for ValueSet.\n    Test File: valueset-encounter-status.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"valueset-encounter-status.json\"\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_5(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_5(inst2)\n\n\ndef impl_valueset_6(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/report-status-codes\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-28T16:55:11+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"The current status of the test report.\"\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fhir\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"report-status-codes\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.724\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"old\"\n    assert inst.identifier[1].value == \"urn:oid:2.16.840.1.113883.4.642.3.712\"\n    assert inst.immutable is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"TestReportStatus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\"><ul><li>Include '\n        'all codes defined in <a href=\"codesystem-report-status-'\n        'codes.html\"><code>http://hl7.org/fhir/report-status-'\n        \"codes</code></a></li></ul></div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Test Report Status\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/report-status-codes\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_valueset_6(base_settings):\n    \"\"\"No. 6 tests collection for ValueSet.\n    Test File: valueset-report-status-codes.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"valueset-report-status-codes.json\"\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_6(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_6(inst2)\n\n\ndef impl_valueset_7(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/note-type\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2023-03-26T15:21:02+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"The presentation types of notes.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fm\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 4\n    assert inst.id == \"note-type\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.15\"\n    assert inst.immutable is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"NoteType\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\"><ul><li>Include '\n        'all codes defined in <a href=\"codesystem-note-'\n        'type.html\"><code>http://hl7.org/fhir/note-'\n        \"type</code></a></li></ul></div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"NoteType\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/note-type\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_valueset_7(base_settings):\n    \"\"\"No. 7 tests collection for ValueSet.\n    Test File: valueset-note-type.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"valueset-note-type.json\"\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_7(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_7(inst2)\n\n\ndef impl_valueset_8(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/issue-severity\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-28T16:55:11+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == \"How the issue affects the success of the action.\"\n    assert inst.experimental is False\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"fhir\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"normative\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueCode == \"4.0.0\"\n    assert (\n        inst.extension[3].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[3].valueInteger == 5\n    assert inst.id == \"issue-severity\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.408\"\n    assert (\n        inst.identifier[1].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[1].use == \"old\"\n    assert inst.identifier[1].value == \"urn:oid:2.16.840.1.113883.4.642.3.397\"\n    assert (\n        inst.identifier[2].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[2].use == \"old\"\n    assert inst.identifier[2].value == \"urn:oid:2.16.840.1.113883.4.642.2.223\"\n    assert inst.immutable is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"IssueSeverity\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\"><ul><li>Include '\n        'all codes defined in <a href=\"codesystem-issue-'\n        'severity.html\"><code>http://hl7.org/fhir/issue-'\n        \"severity</code></a></li></ul></div>\"\n    )\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Issue Severity\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/issue-severity\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_valueset_8(base_settings):\n    \"\"\"No. 8 tests collection for ValueSet.\n    Test File: valueset-issue-severity.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"valueset-issue-severity.json\"\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_8(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_8(inst2)\n\n\ndef impl_valueset_9(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/substance-source-material-genus\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-28T16:55:11+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"The genus of an organism, typically referring to the Latin \"\n        \"epithet of the genus element of the plant/animal scientific \"\n        \"name.\"\n    )\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"brr\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"substance-source-material-genus\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.3253\"\n    assert inst.immutable is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"SourceMaterialGenus\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Source Material Genus\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/substance-source-material-genus\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_valueset_9(base_settings):\n    \"\"\"No. 9 tests collection for ValueSet.\n    Test File: valueset-substance-source-material-genus.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"]\n        / \"valueset-substance-source-material-genus.json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_9(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_9(inst2)\n\n\ndef impl_valueset_10(inst):\n    assert (\n        inst.compose.include[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/cited-artifact-part-type\"}\n        ).valueUri\n    )\n    assert inst.contact[0].telecom[0].system == \"url\"\n    assert inst.contact[0].telecom[0].value == \"http://hl7.org/fhir\"\n    assert inst.contact[0].telecom[1].system == \"email\"\n    assert inst.contact[0].telecom[1].value == \"fhir@lists.hl7.org\"\n    assert (\n        inst.date\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2020-12-28T16:55:11+11:00\"}\n        ).valueDateTime\n    )\n    assert inst.description == (\n        \"To describe the reason for the variant citation, such as \"\n        \"version number or subpart specification.\"\n    )\n    assert inst.experimental is True\n    assert (\n        inst.extension[0].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[0].valueCode == \"cds\"\n    assert (\n        inst.extension[1].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[1].valueCode == \"trial-use\"\n    assert (\n        inst.extension[2].url\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm\"\n            }\n        ).valueUri\n    )\n    assert inst.extension[2].valueInteger == 1\n    assert inst.id == \"cited-artifact-part-type\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"urn:ietf:rfc:3986\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"urn:oid:2.16.840.1.113883.4.642.3.2964\"\n    assert inst.immutable is True\n    assert inst.jurisdiction[0].coding[0].code == \"001\"\n    assert inst.jurisdiction[0].coding[0].display == \"World\"\n    assert (\n        inst.jurisdiction[0].coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unstats.un.org/unsd/methods/m49/m49.htm\"}\n        ).valueUri\n    )\n    assert (\n        inst.meta.lastUpdated\n        == ExternalValidatorModel.model_validate(\n            {\"valueInstant\": \"2023-03-26T15:21:02.749+11:00\"}\n        ).valueInstant\n    )\n    assert (\n        inst.meta.profile[0]\n        == \"http://hl7.org/fhir/StructureDefinition/shareablevalueset\"\n    )\n    assert inst.name == \"CitedArtifactPartType\"\n    assert inst.publisher == \"HL7 (FHIR Project)\"\n    assert inst.status == \"draft\"\n    assert inst.text.status == \"generated\"\n    assert inst.title == \"Cited Artifact Part Type\"\n    assert (\n        inst.url\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://hl7.org/fhir/ValueSet/cited-artifact-part-type\"}\n        ).valueUri\n    )\n    assert inst.version == \"5.0.0\"\n\n\ndef test_valueset_10(base_settings):\n    \"\"\"No. 10 tests collection for ValueSet.\n    Test File: valueset-cited-artifact-part-type.json\n    \"\"\"\n    filename = (\n        base_settings[\"unittest_data_dir\"] / \"valueset-cited-artifact-part-type.json\"\n    )\n    inst = valueset.ValueSet.model_validate_json(filename.read_bytes())\n    assert \"ValueSet\" == inst.get_resource_type()\n\n    impl_valueset_10(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"ValueSet\" == data[\"resourceType\"]\n\n    inst2 = valueset.ValueSet(**data)\n    impl_valueset_10(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_verificationresult.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/VerificationResult\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import verificationresult\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_verificationresult_1(inst):\n    assert inst.id == \"example\"\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.status == \"attested\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_verificationresult_1(base_settings):\n    \"\"\"No. 1 tests collection for VerificationResult.\n    Test File: verificationresult-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"verificationresult-example.json\"\n    inst = verificationresult.VerificationResult.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"VerificationResult\" == inst.get_resource_type()\n\n    impl_verificationresult_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"VerificationResult\" == data[\"resourceType\"]\n\n    inst2 = verificationresult.VerificationResult(**data)\n    impl_verificationresult_1(inst2)\n"
  },
  {
    "path": "fhir/resources/tests/test_visionprescription.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/VisionPrescription\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\nfrom .. import visionprescription\nfrom .conftest import ExternalValidatorModel\n\n\ndef impl_visionprescription_1(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-06-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dateWritten\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-06-15\"}\n        ).valueDateTime\n    )\n    assert inst.encounter.reference == \"Encounter/f001\"\n    assert inst.id == \"33124\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.happysight.com/prescription\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"15014\"\n    assert float(inst.lensSpecification[0].add) == float(1.75)\n    assert inst.lensSpecification[0].axis == 160\n    assert float(inst.lensSpecification[0].backCurve) == float(8.7)\n    assert inst.lensSpecification[0].brand == \"OphthaGuard\"\n    assert inst.lensSpecification[0].color == \"green\"\n    assert float(inst.lensSpecification[0].cylinder) == float(-2.25)\n    assert float(inst.lensSpecification[0].diameter) == float(14.0)\n    assert inst.lensSpecification[0].duration.code == \"mo\"\n    assert (\n        inst.lensSpecification[0].duration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.lensSpecification[0].duration.unit == \"mo\"\n    assert float(inst.lensSpecification[0].duration.value) == float(1)\n    assert inst.lensSpecification[0].eye == \"right\"\n    assert (\n        inst.lensSpecification[0].note[0].text\n        == \"Shade treatment for extreme light sensitivity\"\n    )\n    assert float(inst.lensSpecification[0].power) == float(-2.75)\n    assert inst.lensSpecification[0].product.coding[0].code == \"contact\"\n    assert (\n        inst.lensSpecification[0].product.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct\"\n            }\n        ).valueUri\n    )\n    assert float(inst.lensSpecification[1].add) == float(1.75)\n    assert inst.lensSpecification[1].axis == 160\n    assert float(inst.lensSpecification[1].backCurve) == float(8.7)\n    assert inst.lensSpecification[1].brand == \"OphthaGuard\"\n    assert inst.lensSpecification[1].color == \"green\"\n    assert float(inst.lensSpecification[1].cylinder) == float(-3.5)\n    assert float(inst.lensSpecification[1].diameter) == float(14.0)\n    assert inst.lensSpecification[1].duration.code == \"mo\"\n    assert (\n        inst.lensSpecification[1].duration.system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://unitsofmeasure.org\"}\n        ).valueUri\n    )\n    assert inst.lensSpecification[1].duration.unit == \"month\"\n    assert float(inst.lensSpecification[1].duration.value) == float(1)\n    assert inst.lensSpecification[1].eye == \"left\"\n    assert (\n        inst.lensSpecification[1].note[0].text\n        == \"Shade treatment for extreme light sensitivity\"\n    )\n    assert float(inst.lensSpecification[1].power) == float(-2.75)\n    assert inst.lensSpecification[1].product.coding[0].code == \"contact\"\n    assert (\n        inst.lensSpecification[1].product.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct\"\n            }\n        ).valueUri\n    )\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.prescriber.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.text.div == (\n        '<div xmlns=\"http://www.w3.org/1999/xhtml\">Sample Contract '\n        \"Lens prescription</div>\"\n    )\n    assert inst.text.status == \"generated\"\n\n\ndef test_visionprescription_1(base_settings):\n    \"\"\"No. 1 tests collection for VisionPrescription.\n    Test File: visionprescription-example-1.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"visionprescription-example-1.json\"\n    inst = visionprescription.VisionPrescription.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"VisionPrescription\" == inst.get_resource_type()\n\n    impl_visionprescription_1(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"VisionPrescription\" == data[\"resourceType\"]\n\n    inst2 = visionprescription.VisionPrescription(**data)\n    impl_visionprescription_1(inst2)\n\n\ndef impl_visionprescription_2(inst):\n    assert (\n        inst.created\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-06-15\"}\n        ).valueDateTime\n    )\n    assert (\n        inst.dateWritten\n        == ExternalValidatorModel.model_validate(\n            {\"valueDateTime\": \"2014-06-15\"}\n        ).valueDateTime\n    )\n    assert inst.id == \"33123\"\n    assert (\n        inst.identifier[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://www.happysight.com/prescription\"}\n        ).valueUri\n    )\n    assert inst.identifier[0].value == \"15013\"\n    assert float(inst.lensSpecification[0].add) == float(2.0)\n    assert inst.lensSpecification[0].eye == \"right\"\n    assert float(inst.lensSpecification[0].prism[0].amount) == float(0.5)\n    assert inst.lensSpecification[0].prism[0].base == \"down\"\n    assert inst.lensSpecification[0].product.coding[0].code == \"lens\"\n    assert (\n        inst.lensSpecification[0].product.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct\"\n            }\n        ).valueUri\n    )\n    assert float(inst.lensSpecification[0].sphere) == float(-2.0)\n    assert float(inst.lensSpecification[1].add) == float(2.0)\n    assert inst.lensSpecification[1].axis == 180\n    assert float(inst.lensSpecification[1].cylinder) == float(-0.5)\n    assert inst.lensSpecification[1].eye == \"left\"\n    assert float(inst.lensSpecification[1].prism[0].amount) == float(0.5)\n    assert inst.lensSpecification[1].prism[0].base == \"up\"\n    assert inst.lensSpecification[1].product.coding[0].code == \"lens\"\n    assert (\n        inst.lensSpecification[1].product.coding[0].system\n        == ExternalValidatorModel.model_validate(\n            {\n                \"valueUri\": \"http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct\"\n            }\n        ).valueUri\n    )\n    assert float(inst.lensSpecification[1].sphere) == float(-1.0)\n    assert inst.meta.tag[0].code == \"HTEST\"\n    assert inst.meta.tag[0].display == \"test health data\"\n    assert (\n        inst.meta.tag[0].system\n        == ExternalValidatorModel.model_validate(\n            {\"valueUri\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\"}\n        ).valueUri\n    )\n    assert inst.patient.reference == \"Patient/example\"\n    assert inst.prescriber.reference == \"Practitioner/example\"\n    assert inst.status == \"active\"\n    assert inst.text.status == \"generated\"\n\n\ndef test_visionprescription_2(base_settings):\n    \"\"\"No. 2 tests collection for VisionPrescription.\n    Test File: visionprescription-example.json\n    \"\"\"\n    filename = base_settings[\"unittest_data_dir\"] / \"visionprescription-example.json\"\n    inst = visionprescription.VisionPrescription.model_validate_json(\n        filename.read_bytes()\n    )\n    assert \"VisionPrescription\" == inst.get_resource_type()\n\n    impl_visionprescription_2(inst)\n\n    # testing reverse by generating data from itself and create again.\n    data = inst.model_dump()\n    assert \"VisionPrescription\" == data[\"resourceType\"]\n\n    inst2 = visionprescription.VisionPrescription(**data)\n    impl_visionprescription_2(inst2)\n"
  },
  {
    "path": "fhir/resources/testscript.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TestScript\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass TestScript(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes a set of tests.\n    A structured set of tests against a FHIR server or client implementation to\n    determine compliance against the FHIR specification.\n    \"\"\"\n\n    __resource_type__ = \"TestScript\"\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the test script and/or its contents.\"\n            \" Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the test script.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date (and optionally time) when the test script was last \"\n            \"significantly changed. The date must change when the business version \"\n            \"changes and it must change if the status code changes. In addition, it\"\n            \" should change when the substantive content of the test script \"\n            \"changes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the test script\",\n        description=(\n            \"A free text natural language description of the test script from a \"\n            \"consumer's perspective.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    destination: typing.List[fhirtypes.TestScriptDestinationType] | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=(\n            \"An abstract server representing a destination or receiver in a message\"\n            \" exchange\"\n        ),\n        description=(\n            \"An abstract server used in operations within this test script in the \"\n            \"destination element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this test script is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    fixture: typing.List[fhirtypes.TestScriptFixtureType] | None = Field(\n        default=None,\n        alias=\"fixture\",\n        title=\"Fixture in the test script - by reference (uri)\",\n        description=(\n            \"Fixture in the test script - by reference (uri). All fixtures are \"\n            \"required for the test script to execute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the test script\",\n        description=(\n            \"A formal identifier that is used to identify this test script when it \"\n            \"is represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for test script (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the test script is intended to \"\n            \"be used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    metadata: fhirtypes.TestScriptMetadataType | None = Field(\n        default=None,\n        alias=\"metadata\",\n        title=(\n            \"Required capability that is assumed to function correctly on the FHIR \"\n            \"server being tested\"\n        ),\n        description=(\n            \"The required capability must exist and are assumed to function \"\n            \"correctly on the FHIR server being tested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this test script (computer friendly)\",\n        description=(\n            \"A natural language name identifying the test script. This name should \"\n            \"be usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    origin: typing.List[fhirtypes.TestScriptOriginType] | None = Field(\n        default=None,\n        alias=\"origin\",\n        title=(\n            \"An abstract server representing a client or sender in a message \"\n            \"exchange\"\n        ),\n        description=(\n            \"An abstract server used in operations within this test script in the \"\n            \"origin element.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    profile: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"profile\",\n        title=\"Reference of the validation profile\",\n        description=\"Reference to the profile to be used for validation.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"StructureDefinition\"],\n        },\n    )\n    profile__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_profile\", title=\"Extension field for ``profile``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the test script.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this test script is defined\",\n        description=(\n            \"Explanation of why this test script is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    scope: typing.List[fhirtypes.TestScriptScopeType] | None = Field(\n        default=None,\n        alias=\"scope\",\n        title=\"Indication of the artifact(s) that are tested by this test case\",\n        description=(\n            \"The scope indicates a conformance artifact that is tested by the \"\n            \"test(s) within this test case and the expectation of the test \"\n            \"outcome(s) as well as the intended test phase inclusion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    setup: fhirtypes.TestScriptSetupType | None = Field(\n        default=None,\n        alias=\"setup\",\n        title=\"A series of required setup operations before tests are executed\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this test script. Enables tracking the life-cycle of the\"\n            \" content.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    teardown: fhirtypes.TestScriptTeardownType | None = Field(\n        default=None,\n        alias=\"teardown\",\n        title=\"A series of required clean up steps\",\n        description=(\n            \"A series of operations required to clean up after all the tests are \"\n            \"executed (successfully or otherwise).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    test: typing.List[fhirtypes.TestScriptTestType] | None = Field(\n        default=None,\n        alias=\"test\",\n        title=\"A test in this script\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this test script (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the test script.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this test script, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this test script when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" test script is (or will be) published. This URL can be the target of \"\n            \"a canonical reference. It SHALL remain the same when the test script \"\n            \"is stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate test script instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    variable: typing.List[fhirtypes.TestScriptVariableType] | None = Field(\n        default=None,\n        alias=\"variable\",\n        title=\"Placeholder for evaluated elements\",\n        description=(\n            \"Variable is set based either on element value in response body or on \"\n            \"header field value in the response headers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the test script\",\n        description=(\n            \"The identifier that is used to identify this version of the test \"\n            \"script when it is referenced in a specification, model, design or \"\n            \"instance. This is an arbitrary value managed by the test script author\"\n            \" and is not expected to be globally unique. For example, it might be a\"\n            \" timestamp (e.g. yyyymmdd) if a managed version is not available. \"\n            \"There is also no expectation that versions can be placed in a \"\n            \"lexicographical sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which is\"\n            \" more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScript`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"origin\",\n            \"destination\",\n            \"metadata\",\n            \"scope\",\n            \"fixture\",\n            \"profile\",\n            \"variable\",\n            \"setup\",\n            \"test\",\n            \"teardown\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScript`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\"), (\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass TestScriptDestination(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An abstract server representing a destination or receiver in a message\n    exchange.\n    An abstract server used in operations within this test script in the\n    destination element.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptDestination\"\n\n    index: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"index\",\n        title=\"The index of the abstract destination server starting at 1\",\n        description=(\n            \"Abstract name given to a destination server in this test script.  The \"\n            \"name is provided as a number starting at 1.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    index__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_index\", title=\"Extension field for ``index``.\"\n    )\n\n    profile: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"profile\",\n        title=(\n            \"FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-\"\n            \"FormProcessor\"\n        ),\n        description=\"The type of destination profile the test system supports.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"The url path of the destination server\",\n        description=(\n            \"The explicit url path of the destination server used in this test \"\n            \"script.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptDestination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"index\", \"profile\", \"url\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptDestination`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"index\", \"index__ext\")]\n        return required_fields\n\n\nclass TestScriptFixture(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Fixture in the test script - by reference (uri).\n    Fixture in the test script - by reference (uri). All fixtures are required\n    for the test script to execute.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptFixture\"\n\n    autocreate: bool | None = Field(\n        default=None,\n        alias=\"autocreate\",\n        title=\"Whether or not to implicitly create the fixture during setup\",\n        description=(\n            \"Whether or not to implicitly create the fixture during setup. If true,\"\n            \" the fixture is automatically created on each server being tested \"\n            \"during setup, therefore no create operation is required for this \"\n            \"fixture in the TestScript.setup section.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    autocreate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_autocreate\", title=\"Extension field for ``autocreate``.\"\n    )\n\n    autodelete: bool | None = Field(\n        default=None,\n        alias=\"autodelete\",\n        title=\"Whether or not to implicitly delete the fixture during teardown\",\n        description=(\n            \"Whether or not to implicitly delete the fixture during teardown. If \"\n            \"true, the fixture is automatically deleted on each server being tested\"\n            \" during teardown, therefore no delete operation is required for this \"\n            \"fixture in the TestScript.teardown section.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    autodelete__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_autodelete\", title=\"Extension field for ``autodelete``.\"\n    )\n\n    resource: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Reference of the resource\",\n        description=(\n            \"Reference to the resource (containing the contents of the resource \"\n            \"needed for operations). This is allowed to be a Parameters resource.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptFixture`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"autocreate\",\n            \"autodelete\",\n            \"resource\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptFixture`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"autocreate\", \"autocreate__ext\"),\n            (\"autodelete\", \"autodelete__ext\"),\n        ]\n        return required_fields\n\n\nclass TestScriptMetadata(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Required capability that is assumed to function correctly on the FHIR\n    server being tested.\n    The required capability must exist and are assumed to function correctly on\n    the FHIR server being tested.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptMetadata\"\n\n    capability: typing.List[fhirtypes.TestScriptMetadataCapabilityType] = Field(\n        default=...,\n        alias=\"capability\",\n        title=(\n            \"Capabilities  that are assumed to function correctly on the FHIR \"\n            \"server being tested\"\n        ),\n        description=(\n            \"Capabilities that must exist and are assumed to function correctly on \"\n            \"the FHIR server being tested.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    link: typing.List[fhirtypes.TestScriptMetadataLinkType] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links to the FHIR specification\",\n        description=\"A link to the FHIR specification that this test is covering.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptMetadata`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"link\", \"capability\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptMetadata`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptMetadataCapability(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Capabilities  that are assumed to function correctly on the FHIR server\n    being tested.\n    Capabilities that must exist and are assumed to function correctly on the\n    FHIR server being tested.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptMetadataCapability\"\n\n    capabilities: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"capabilities\",\n        title=\"Required Capability Statement\",\n        description=(\n            \"Minimum capabilities required of server for test script to execute \"\n            \"successfully.   If server does not meet at a minimum the referenced \"\n            \"capability statement, then all tests in this script are skipped.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"CapabilityStatement\"],\n        },\n    )\n    capabilities__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_capabilities\",\n        title=\"Extension field for ``capabilities``.\",\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"The expected capabilities of the server\",\n        description=(\n            \"Description of the capabilities that this test script is requiring the\"\n            \" server to support.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    destination: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Which server these requirements apply to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    destination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_destination\", title=\"Extension field for ``destination``.\"\n    )\n\n    link: typing.List[fhirtypes.UriType | None] | None = Field(\n        default=None,\n        alias=\"link\",\n        title=\"Links to the FHIR specification\",\n        description=(\n            \"Links to the FHIR specification that describes this interaction and \"\n            \"the resources involved in more detail.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    link__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_link\", title=\"Extension field for ``link``.\"\n    )\n\n    origin: typing.List[fhirtypes.IntegerType | None] | None = Field(\n        default=None,\n        alias=\"origin\",\n        title=\"Which origin server these requirements apply to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    origin__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_origin\", title=\"Extension field for ``origin``.\"\n    )\n\n    required: bool | None = Field(\n        default=None,\n        alias=\"required\",\n        title=\"Are the capabilities required?\",\n        description=(\n            \"Whether or not the test execution will require the given capabilities \"\n            \"of the server in order for this test script to execute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    required__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_required\", title=\"Extension field for ``required``.\"\n    )\n\n    validated: bool | None = Field(\n        default=None,\n        alias=\"validated\",\n        title=\"Are the capabilities validated?\",\n        description=(\n            \"Whether or not the test execution will validate the given capabilities\"\n            \" of the server in order for this test script to execute.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    validated__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_validated\", title=\"Extension field for ``validated``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptMetadataCapability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"required\",\n            \"validated\",\n            \"description\",\n            \"origin\",\n            \"destination\",\n            \"link\",\n            \"capabilities\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptMetadataCapability`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"capabilities\", \"capabilities__ext\"),\n            (\"required\", \"required__ext\"),\n            (\"validated\", \"validated__ext\"),\n        ]\n        return required_fields\n\n\nclass TestScriptMetadataLink(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links to the FHIR specification.\n    A link to the FHIR specification that this test is covering.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptMetadataLink\"\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Short description\",\n        description=\"Short description of the link.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"URL to the specification\",\n        description=(\n            \"URL to a particular requirement or feature within the FHIR \"\n            \"specification.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptMetadataLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"url\", \"description\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptMetadataLink`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"url\", \"url__ext\")]\n        return required_fields\n\n\nclass TestScriptOrigin(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    An abstract server representing a client or sender in a message exchange.\n    An abstract server used in operations within this test script in the origin\n    element.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptOrigin\"\n\n    index: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"index\",\n        title=\"The index of the abstract origin server starting at 1\",\n        description=(\n            \"Abstract name given to an origin server in this test script.  The name\"\n            \" is provided as a number starting at 1.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    index__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_index\", title=\"Extension field for ``index``.\"\n    )\n\n    profile: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"profile\",\n        title=\"FHIR-Client | FHIR-SDC-FormFiller\",\n        description=\"The type of origin profile the test system supports.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"The url path of the origin server\",\n        description=\"The explicit url path of the origin server used in this test script.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptOrigin`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"index\", \"profile\", \"url\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptOrigin`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"index\", \"index__ext\")]\n        return required_fields\n\n\nclass TestScriptScope(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Indication of the artifact(s) that are tested by this test case.\n    The scope indicates a conformance artifact that is tested by the test(s)\n    within this test case and the expectation of the test outcome(s) as well as\n    the intended test phase inclusion.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptScope\"\n\n    artifact: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"artifact\",\n        title=\"The specific conformance artifact being tested\",\n        description=(\n            \"The specific conformance artifact being tested. The canonical \"\n            \"reference can be version-specific.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n    artifact__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_artifact\", title=\"Extension field for ``artifact``.\"\n    )\n\n    conformance: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"conformance\",\n        title=\"required | optional | strict\",\n        description=(\n            \"The expectation of whether the test must pass for the system to be \"\n            \"considered conformant with the artifact: required - all tests are \"\n            \"expected to pass, optional - all test are expected to pass but non-\"\n            \"pass status may be allowed, strict - all tests are expected to pass \"\n            \"and warnings are treated as a failure.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    phase: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"phase\",\n        title=\"unit | integration | production\",\n        description=(\n            \"The phase of testing for this artifact: unit - development / \"\n            \"implementation phase, integration - internal system to system phase, \"\n            \"production - live system to system phase (Note, this may involve \"\n            \"pii/phi data).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptScope`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"artifact\",\n            \"conformance\",\n            \"phase\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptScope`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"artifact\", \"artifact__ext\")]\n        return required_fields\n\n\nclass TestScriptSetup(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A series of required setup operations before tests are executed.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetup\"\n\n    action: typing.List[fhirtypes.TestScriptSetupActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"A setup operation or assert to perform\",\n        description=\"Action would contain either an operation or an assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetup`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptSetupAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A setup operation or assert to perform.\n    Action would contain either an operation or an assertion.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupAction\"\n\n    assert_fhir: fhirtypes.TestScriptSetupActionAssertType | None = Field(\n        default=None,\n        alias=\"assert\",\n        title=\"The assertion to perform\",\n        description=(\n            \"Evaluates the results of previous operations to determine if the \"\n            \"server under test behaves appropriately.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.TestScriptSetupActionOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"The setup operation to perform\",\n        description=\"The operation to perform.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\", \"assert\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptSetupActionAssert(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The assertion to perform.\n    Evaluates the results of previous operations to determine if the server\n    under test behaves appropriately.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionAssert\"\n\n    compareToSourceExpression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"compareToSourceExpression\",\n        title=\"The FHIRPath expression to evaluate against the source fixture\",\n        description=(\n            \"The FHIRPath expression for a specific value to evaluate against the \"\n            \"source fixture. When compareToSourceId is defined, either \"\n            \"compareToSourceExpression or compareToSourcePath must be defined, but \"\n            \"not both.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    compareToSourceExpression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compareToSourceExpression\",\n        title=\"Extension field for ``compareToSourceExpression``.\",\n    )\n\n    compareToSourceId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"compareToSourceId\",\n        title=\"Id of the source fixture to be evaluated\",\n        description=(\n            \"Id of the source fixture used as the contents to be evaluated by \"\n            'either the \"source/expression\" or \"sourceId/path\" definition.'\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    compareToSourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compareToSourceId\",\n        title=\"Extension field for ``compareToSourceId``.\",\n    )\n\n    compareToSourcePath: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"compareToSourcePath\",\n        title=\"XPath or JSONPath expression to evaluate against the source fixture\",\n        description=(\n            \"XPath or JSONPath expression to evaluate against the source fixture. \"\n            \"When compareToSourceId is defined, either compareToSourceExpression or\"\n            \" compareToSourcePath must be defined, but not both.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    compareToSourcePath__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_compareToSourcePath\",\n        title=\"Extension field for ``compareToSourcePath``.\",\n    )\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"Mime type to compare against the 'Content-Type' header\",\n        description=(\n            \"The mime-type contents to compare against the request or response \"\n            \"message 'Content-Type' header.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    defaultManualCompletion: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"defaultManualCompletion\",\n        title=\"fail | pass | skip | stop\",\n        description=\"The default manual completion outcome applied to this assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"fail\", \"pass\", \"skip\", \"stop\"],\n        },\n    )\n    defaultManualCompletion__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultManualCompletion\",\n        title=\"Extension field for ``defaultManualCompletion``.\",\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Tracking/reporting assertion description\",\n        description=(\n            \"The description would be used by test engines for tracking and \"\n            \"reporting purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    direction: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"direction\",\n        title=\"response | request\",\n        description=\"The direction to use for the assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"response\", \"request\"],\n        },\n    )\n    direction__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_direction\", title=\"Extension field for ``direction``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"The FHIRPath expression to be evaluated\",\n        description=(\n            \"The FHIRPath expression to be evaluated against the request or \"\n            \"response message contents - HTTP headers and payload.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    headerField: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"headerField\",\n        title=\"HTTP header field name\",\n        description=\"The HTTP header field name e.g. 'Location'.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    headerField__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_headerField\", title=\"Extension field for ``headerField``.\"\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Tracking/logging assertion label\",\n        description=\"The label would be used for tracking/logging purposes by test engines.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    minimumId: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"minimumId\",\n        title=\"Fixture Id of minimum content resource\",\n        description=(\n            \"The ID of a fixture. Asserts that the response contains at a minimum \"\n            \"the fixture specified by minimumId.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    minimumId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_minimumId\", title=\"Extension field for ``minimumId``.\"\n    )\n\n    navigationLinks: bool | None = Field(\n        default=None,\n        alias=\"navigationLinks\",\n        title=\"Perform validation on navigation links?\",\n        description=(\n            \"Whether or not the test execution performs validation on the bundle \"\n            \"navigation links.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    navigationLinks__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_navigationLinks\",\n        title=\"Extension field for ``navigationLinks``.\",\n    )\n\n    operator: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"operator\",\n        title=(\n            \"equals | notEquals | in | notIn | greaterThan | lessThan | empty | \"\n            \"notEmpty | contains | notContains | eval | manualEval\"\n        ),\n        description=\"The operator type defines the conditional behavior of the assert.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"equals\",\n                \"notEquals\",\n                \"in\",\n                \"notIn\",\n                \"greaterThan\",\n                \"lessThan\",\n                \"empty\",\n                \"notEmpty\",\n                \"contains\",\n                \"notContains\",\n                \"eval\",\n                \"manualEval\",\n            ],\n        },\n    )\n    operator__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_operator\", title=\"Extension field for ``operator``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"XPath or JSONPath expression\",\n        description=(\n            \"The XPath or JSONPath expression to be evaluated against the fixture \"\n            \"representing the response received from server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    requestMethod: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"requestMethod\",\n        title=\"delete | get | options | patch | post | put | head\",\n        description=(\n            \"The request method or HTTP operation code to compare against that used\"\n            \" by the client system under test.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"delete\", \"get\", \"options\", \"patch\", \"post\", \"put\", \"head\"],\n        },\n    )\n    requestMethod__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_requestMethod\",\n        title=\"Extension field for ``requestMethod``.\",\n    )\n\n    requestURL: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"requestURL\",\n        title=\"Request URL comparison value\",\n        description=\"The value to use in a comparison against the request URL path string.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    requestURL__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requestURL\", title=\"Extension field for ``requestURL``.\"\n    )\n\n    requirement: typing.List[\n        fhirtypes.TestScriptSetupActionAssertRequirementType\n    ] | None = Field(\n        default=None,\n        alias=\"requirement\",\n        title=\"Links or references to the testing requirements\",\n        description=(\n            \"Links or references providing traceability to the testing requirements\"\n            \" for this assert.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    resource: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Resource type\",\n        description=\"The type of the resource.  See the [resource list](resourcelist.html).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    response: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"response\",\n        title=(\n            \"continue | switchingProtocols | okay | created | accepted | \"\n            \"nonAuthoritativeInformation | noContent | resetContent | \"\n            \"partialContent | multipleChoices | movedPermanently | found | seeOther\"\n            \" | notModified | useProxy | temporaryRedirect | permanentRedirect | \"\n            \"badRequest | unauthorized | paymentRequired | forbidden | notFound | \"\n            \"methodNotAllowed | notAcceptable | proxyAuthenticationRequired | \"\n            \"requestTimeout | conflict | gone | lengthRequired | preconditionFailed\"\n            \" | contentTooLarge | uriTooLong | unsupportedMediaType | \"\n            \"rangeNotSatisfiable | expectationFailed | misdirectedRequest | \"\n            \"unprocessableContent | upgradeRequired | internalServerError | \"\n            \"notImplemented | badGateway | serviceUnavailable | gatewayTimeout | \"\n            \"httpVersionNotSupported\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"continue\",\n                \"switchingProtocols\",\n                \"okay\",\n                \"created\",\n                \"accepted\",\n                \"nonAuthoritativeInformation\",\n                \"noContent\",\n                \"resetContent\",\n                \"partialContent\",\n                \"multipleChoices\",\n                \"movedPermanently\",\n                \"found\",\n                \"seeOther\",\n                \"notModified\",\n                \"useProxy\",\n                \"temporaryRedirect\",\n                \"permanentRedirect\",\n                \"badRequest\",\n                \"unauthorized\",\n                \"paymentRequired\",\n                \"forbidden\",\n                \"notFound\",\n                \"methodNotAllowed\",\n                \"notAcceptable\",\n                \"proxyAuthenticationRequired\",\n                \"requestTimeout\",\n                \"conflict\",\n                \"gone\",\n                \"lengthRequired\",\n                \"preconditionFailed\",\n                \"contentTooLarge\",\n                \"uriTooLong\",\n                \"unsupportedMediaType\",\n                \"rangeNotSatisfiable\",\n                \"expectationFailed\",\n                \"misdirectedRequest\",\n                \"unprocessableContent\",\n                \"upgradeRequired\",\n                \"internalServerError\",\n                \"notImplemented\",\n                \"badGateway\",\n                \"serviceUnavailable\",\n                \"gatewayTimeout\",\n                \"httpVersionNotSupported\",\n            ],\n        },\n    )\n    response__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_response\", title=\"Extension field for ``response``.\"\n    )\n\n    responseCode: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"responseCode\",\n        title=\"HTTP response code to test\",\n        description=\"The value of the HTTP response code to be tested.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responseCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_responseCode\",\n        title=\"Extension field for ``responseCode``.\",\n    )\n\n    sourceId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"sourceId\",\n        title=\"Fixture Id of source expression or headerField\",\n        description=(\n            \"Fixture to evaluate the XPath/JSONPath expression or the headerField  \"\n            \"against.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceId\", title=\"Extension field for ``sourceId``.\"\n    )\n\n    stopTestOnFail: bool | None = Field(\n        default=None,\n        alias=\"stopTestOnFail\",\n        title=\"If this assert fails, will the current test execution stop?\",\n        description=(\n            \"Whether or not the current test execution will stop on failure for \"\n            \"this assert.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    stopTestOnFail__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_stopTestOnFail\",\n        title=\"Extension field for ``stopTestOnFail``.\",\n    )\n\n    validateProfileId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"validateProfileId\",\n        title=\"Profile Id of validation profile reference\",\n        description=\"The ID of the Profile to validate against.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    validateProfileId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_validateProfileId\",\n        title=\"Extension field for ``validateProfileId``.\",\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The value to compare to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    warningOnly: bool | None = Field(\n        default=None,\n        alias=\"warningOnly\",\n        title=\"Will this assert produce a warning only on error?\",\n        description=(\n            \"Whether or not the test execution will produce a warning only on error\"\n            \" for this assert.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    warningOnly__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_warningOnly\", title=\"Extension field for ``warningOnly``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionAssert`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"label\",\n            \"description\",\n            \"direction\",\n            \"compareToSourceId\",\n            \"compareToSourceExpression\",\n            \"compareToSourcePath\",\n            \"contentType\",\n            \"defaultManualCompletion\",\n            \"expression\",\n            \"headerField\",\n            \"minimumId\",\n            \"navigationLinks\",\n            \"operator\",\n            \"path\",\n            \"requestMethod\",\n            \"requestURL\",\n            \"resource\",\n            \"response\",\n            \"responseCode\",\n            \"sourceId\",\n            \"stopTestOnFail\",\n            \"validateProfileId\",\n            \"value\",\n            \"warningOnly\",\n            \"requirement\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssert`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"stopTestOnFail\", \"stopTestOnFail__ext\"),\n            (\"warningOnly\", \"warningOnly__ext\"),\n        ]\n        return required_fields\n\n\nclass TestScriptSetupActionAssertRequirement(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Links or references to the testing requirements.\n    Links or references providing traceability to the testing requirements for\n    this assert.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionAssertRequirement\"\n\n    linkCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"linkCanonical\",\n        title=\"Link or reference to the testing requirement\",\n        description=(\n            \"Link or reference providing traceability to the testing requirement \"\n            \"for this test.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e link[x]\n            \"one_of_many\": \"link\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Requirements\"],\n        },\n    )\n    linkCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_linkCanonical\",\n        title=\"Extension field for ``linkCanonical``.\",\n    )\n\n    linkUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"linkUri\",\n        title=\"Link or reference to the testing requirement\",\n        description=(\n            \"Link or reference providing traceability to the testing requirement \"\n            \"for this test.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e link[x]\n            \"one_of_many\": \"link\",\n            \"one_of_many_required\": False,\n        },\n    )\n    linkUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_linkUri\", title=\"Extension field for ``linkUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionAssertRequirement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"linkUri\", \"linkCanonical\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionAssertRequirement`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\"link\": [\"linkCanonical\", \"linkUri\"]}\n        return one_of_many_fields\n\n\nclass TestScriptSetupActionOperation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    The setup operation to perform.\n    The operation to perform.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionOperation\"\n\n    accept: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"accept\",\n        title=\"Mime type to accept in the payload of the response, with charset etc\",\n        description=\"The mime-type to use for RESTful operation in the 'Accept' header.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    accept__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_accept\", title=\"Extension field for ``accept``.\"\n    )\n\n    contentType: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"contentType\",\n        title=\"Mime type of the request payload contents, with charset etc\",\n        description=(\n            \"The mime-type to use for RESTful operation in the 'Content-Type' \"\n            \"header.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    contentType__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_contentType\", title=\"Extension field for ``contentType``.\"\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Tracking/reporting operation description\",\n        description=(\n            \"The description would be used by test engines for tracking and \"\n            \"reporting purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    destination: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"destination\",\n        title=\"Server responding to the request\",\n        description=(\n            \"The server where the request message is destined for.  Must be one of \"\n            \"the server numbers listed in TestScript.destination section.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    destination__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_destination\", title=\"Extension field for ``destination``.\"\n    )\n\n    encodeRequestUrl: bool | None = Field(\n        default=None,\n        alias=\"encodeRequestUrl\",\n        title=\"Whether or not to send the request url in encoded format\",\n        description=(\n            \"Whether or not to implicitly send the request url in encoded format. \"\n            \"The default is true to match the standard RESTful client behavior. Set\"\n            \" to false when communicating with a server that does not support \"\n            \"encoded url paths.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    encodeRequestUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_encodeRequestUrl\",\n        title=\"Extension field for ``encodeRequestUrl``.\",\n    )\n\n    label: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"label\",\n        title=\"Tracking/logging operation label\",\n        description=\"The label would be used for tracking/logging purposes by test engines.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    label__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_label\", title=\"Extension field for ``label``.\"\n    )\n\n    method: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"method\",\n        title=\"delete | get | options | patch | post | put | head\",\n        description=(\n            \"The HTTP method the test engine MUST use for this operation regardless\"\n            \" of any other operation details.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"delete\", \"get\", \"options\", \"patch\", \"post\", \"put\", \"head\"],\n        },\n    )\n    method__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_method\", title=\"Extension field for ``method``.\"\n    )\n\n    origin: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"origin\",\n        title=\"Server initiating the request\",\n        description=(\n            \"The server where the request message originates from.  Must be one of \"\n            \"the server numbers listed in TestScript.origin section.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    origin__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_origin\", title=\"Extension field for ``origin``.\"\n    )\n\n    params: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"params\",\n        title=\"Explicitly defined path parameters\",\n        description=(\n            \"Path plus parameters after [type].  Used to set parts of the request \"\n            \"URL explicitly.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    params__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_params\", title=\"Extension field for ``params``.\"\n    )\n\n    requestHeader: typing.List[\n        fhirtypes.TestScriptSetupActionOperationRequestHeaderType\n    ] | None = Field(\n        default=None,\n        alias=\"requestHeader\",\n        title=\"Each operation can have one or more header elements\",\n        description=\"Header elements would be used to set HTTP headers.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    requestId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"requestId\",\n        title=\"Fixture Id of mapped request\",\n        description=\"The fixture id (maybe new) to map to the request.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    requestId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_requestId\", title=\"Extension field for ``requestId``.\"\n    )\n\n    resource: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"resource\",\n        title=\"Resource type\",\n        description=(\n            \"The type of the FHIR resource. See the [resource \"\n            \"list](resourcelist.html). Data type of uri is needed when non-HL7 \"\n            \"artifacts are identified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    resource__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_resource\", title=\"Extension field for ``resource``.\"\n    )\n\n    responseId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"responseId\",\n        title=\"Fixture Id of mapped response\",\n        description=\"The fixture id (maybe new) to map to the response.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    responseId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_responseId\", title=\"Extension field for ``responseId``.\"\n    )\n\n    sourceId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"sourceId\",\n        title=\"Fixture Id of body for PUT and POST requests\",\n        description=\"The id of the fixture used as the body of a PUT or POST request.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceId\", title=\"Extension field for ``sourceId``.\"\n    )\n\n    targetId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"targetId\",\n        title=(\n            \"Id of fixture used for extracting the [id],  [type], and [vid] for GET\"\n            \" requests\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    targetId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_targetId\", title=\"Extension field for ``targetId``.\"\n    )\n\n    type: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=\"The operation code type that will be executed\",\n        description=\"Server interaction or operation type.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=\"Request URL\",\n        description=\"Complete request URL.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"resource\",\n            \"label\",\n            \"description\",\n            \"accept\",\n            \"contentType\",\n            \"destination\",\n            \"encodeRequestUrl\",\n            \"method\",\n            \"origin\",\n            \"params\",\n            \"requestHeader\",\n            \"requestId\",\n            \"responseId\",\n            \"sourceId\",\n            \"targetId\",\n            \"url\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionOperation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"encodeRequestUrl\", \"encodeRequestUrl__ext\")]\n        return required_fields\n\n\nclass TestScriptSetupActionOperationRequestHeader(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Each operation can have one or more header elements.\n    Header elements would be used to set HTTP headers.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptSetupActionOperationRequestHeader\"\n\n    field: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"field\",\n        title=\"HTTP header field name\",\n        description='The HTTP header field e.g. \"Accept\".',\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    field__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_field\", title=\"Extension field for ``field``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"HTTP headerfield value\",\n        description='The value of the header e.g. \"application/fhir+xml\".',\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptSetupActionOperationRequestHeader`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"field\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptSetupActionOperationRequestHeader`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"field\", \"field__ext\"), (\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass TestScriptTeardown(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A series of required clean up steps.\n    A series of operations required to clean up after all the tests are\n    executed (successfully or otherwise).\n    \"\"\"\n\n    __resource_type__ = \"TestScriptTeardown\"\n\n    action: typing.List[fhirtypes.TestScriptTeardownActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"One or more teardown operations to perform\",\n        description=\"The teardown action will only contain an operation.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptTeardown`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptTeardown`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptTeardownAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    One or more teardown operations to perform.\n    The teardown action will only contain an operation.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptTeardownAction\"\n\n    operation: fhirtypes.TestScriptSetupActionOperationType = Field(\n        default=...,\n        alias=\"operation\",\n        title=\"The teardown operation to perform\",\n        description=\"An operation would involve a REST request to a server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptTeardownAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptTeardownAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptTest(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A test in this script.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptTest\"\n\n    action: typing.List[fhirtypes.TestScriptTestActionType] = Field(\n        default=...,\n        alias=\"action\",\n        title=\"A test operation or assert to perform\",\n        description=\"Action would contain either an operation or an assertion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Tracking/reporting short description of the test\",\n        description=(\n            \"A short description of the test used by test engines for tracking and \"\n            \"reporting purposes.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Tracking/logging name of this test\",\n        description=(\n            \"The name of this test used for tracking/logging purposes by test \"\n            \"engines.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptTest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"name\", \"description\", \"action\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptTest`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptTestAction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A test operation or assert to perform.\n    Action would contain either an operation or an assertion.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptTestAction\"\n\n    assert_fhir: fhirtypes.TestScriptSetupActionAssertType | None = Field(\n        default=None,\n        alias=\"assert\",\n        title=\"The setup assertion to perform\",\n        description=(\n            \"Evaluates the results of previous operations to determine if the \"\n            \"server under test behaves appropriately.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    operation: fhirtypes.TestScriptSetupActionOperationType | None = Field(\n        default=None,\n        alias=\"operation\",\n        title=\"The setup operation to perform\",\n        description=\"An operation would involve a REST request to a server.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptTestAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"operation\", \"assert\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptTestAction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass TestScriptVariable(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Placeholder for evaluated elements.\n    Variable is set based either on element value in response body or on header\n    field value in the response headers.\n    \"\"\"\n\n    __resource_type__ = \"TestScriptVariable\"\n\n    defaultValue: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"defaultValue\",\n        title=\"Default, hard-coded, or user-defined value for this variable\",\n        description=\"A default, hard-coded, or user-defined value for this variable.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    defaultValue__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_defaultValue\",\n        title=\"Extension field for ``defaultValue``.\",\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the variable\",\n        description=(\n            \"A free text natural language description of the variable and its \"\n            \"purpose.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    expression: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"expression\",\n        title=\"The FHIRPath expression against the fixture body\",\n        description=(\n            \"The FHIRPath expression for a specific value to evaluate against the \"\n            \"fixture body. When variables are defined, only one of either \"\n            \"expression, headerField or path must be specified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    expression__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_expression\", title=\"Extension field for ``expression``.\"\n    )\n\n    headerField: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"headerField\",\n        title=\"HTTP header field name for source\",\n        description=(\n            \"Will be used to grab the HTTP header field value from the headers that\"\n            \" sourceId is pointing to.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    headerField__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_headerField\", title=\"Extension field for ``headerField``.\"\n    )\n\n    hint: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"hint\",\n        title=\"Hint help text for default value to enter\",\n        description=(\n            \"Displayable text string with hint help information to the user when \"\n            \"entering a default value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    hint__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_hint\", title=\"Extension field for ``hint``.\"\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Descriptive name for this variable\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    path: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"path\",\n        title=\"XPath or JSONPath against the fixture body\",\n        description=(\n            \"XPath or JSONPath to evaluate against the fixture body.  When \"\n            \"variables are defined, only one of either expression, headerField or \"\n            \"path must be specified.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    path__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_path\", title=\"Extension field for ``path``.\"\n    )\n\n    sourceId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"sourceId\",\n        title=\"Fixture Id of source expression or headerField within this variable\",\n        description=(\n            \"Fixture to evaluate the XPath/JSONPath expression or the headerField  \"\n            \"against within this variable.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sourceId\", title=\"Extension field for ``sourceId``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TestScriptVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"defaultValue\",\n            \"description\",\n            \"expression\",\n            \"headerField\",\n            \"hint\",\n            \"path\",\n            \"sourceId\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TestScriptVariable`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n"
  },
  {
    "path": "fhir/resources/timing.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Timing\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backbonetype, element, fhirtypes\n\n\nclass Timing(backbonetype.BackboneType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A timing schedule that specifies an event that may occur multiple times.\n    Specifies an event that may occur multiple times. Timing schedules are used\n    to record when things are planned, expected or requested to occur. The most\n    common usage is in dosage instructions for medications. They are also used\n    when planning care of various kinds, and may be used for reporting the\n    schedule to which past regular activities were carried out.\n    \"\"\"\n\n    __resource_type__ = \"Timing\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"C | BID | TID | QID | AM | PM | QD | QOD | +\",\n        description=(\n            \"A code for the timing schedule (or just text in code.text). Some codes\"\n            \" such as BID are ubiquitous, but many institutions define their own \"\n            \"additional codes. If a code is provided, the code is understood to be \"\n            \"a complete statement of whatever is specified in the structured timing\"\n            \" data, and either the code or the data may be used to interpret the \"\n            \"Timing, with the exception that .repeat.bounds still applies over the \"\n            \"code (and is not contained in the code).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    event: typing.List[fhirtypes.DateTimeType | None] | None = Field(\n        default=None,\n        alias=\"event\",\n        title=\"When the event occurs\",\n        description=\"Identifies specific times when the event occurs.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    event__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_event\", title=\"Extension field for ``event``.\"\n    )\n\n    repeat: fhirtypes.TimingRepeatType | None = Field(\n        default=None,\n        alias=\"repeat\",\n        title=\"When the event is to occur\",\n        description=\"A set of rules that describe when the event is scheduled.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Timing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"event\", \"repeat\", \"code\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Timing`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"event\", \"repeat\", \"code\"]\n\n\nclass TimingRepeat(element.Element):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    When the event is to occur.\n    A set of rules that describe when the event is scheduled.\n    \"\"\"\n\n    __resource_type__ = \"TimingRepeat\"\n\n    boundsDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"boundsDuration\",\n        title=\"Length/Range of lengths, or (Start and/or end) limits\",\n        description=(\n            \"Either a duration for the length of the timing schedule, a range of \"\n            \"possible length, or outer bounds for start and/or end limits of the \"\n            \"timing schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e bounds[x]\n            \"one_of_many\": \"bounds\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    boundsPeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"boundsPeriod\",\n        title=\"Length/Range of lengths, or (Start and/or end) limits\",\n        description=(\n            \"Either a duration for the length of the timing schedule, a range of \"\n            \"possible length, or outer bounds for start and/or end limits of the \"\n            \"timing schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e bounds[x]\n            \"one_of_many\": \"bounds\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    boundsRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"boundsRange\",\n        title=\"Length/Range of lengths, or (Start and/or end) limits\",\n        description=(\n            \"Either a duration for the length of the timing schedule, a range of \"\n            \"possible length, or outer bounds for start and/or end limits of the \"\n            \"timing schedule.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e bounds[x]\n            \"one_of_many\": \"bounds\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    count: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"count\",\n        title=\"Number of times to repeat\",\n        description=(\n            \"A total count of the desired number of repetitions across the duration\"\n            \" of the entire timing specification. If countMax is present, this \"\n            \"element indicates the lower bound of the allowed range of count \"\n            \"values.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    count__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_count\", title=\"Extension field for ``count``.\"\n    )\n\n    countMax: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"countMax\",\n        title=\"Maximum number of times to repeat\",\n        description=(\n            \"If present, indicates that the count is a range - so to perform the \"\n            \"action between [count] and [countMax] times.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    countMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_countMax\", title=\"Extension field for ``countMax``.\"\n    )\n\n    dayOfWeek: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"dayOfWeek\",\n        title=\"mon | tue | wed | thu | fri | sat | sun\",\n        description=(\n            \"If one or more days of week is provided, then the action happens only \"\n            \"on the specified day(s).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"],\n        },\n    )\n    dayOfWeek__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_dayOfWeek\", title=\"Extension field for ``dayOfWeek``.\"\n    )\n\n    duration: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"How long when it happens\",\n        description=(\n            \"How long this thing happens for when it happens. If durationMax is \"\n            \"present, this element indicates the lower bound of the allowed range \"\n            \"of the duration.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    duration__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_duration\", title=\"Extension field for ``duration``.\"\n    )\n\n    durationMax: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"durationMax\",\n        title=\"How long when it happens (Max)\",\n        description=(\n            \"If present, indicates that the duration is a range - so to perform the\"\n            \" action between [duration] and [durationMax] time length.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    durationMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_durationMax\", title=\"Extension field for ``durationMax``.\"\n    )\n\n    durationUnit: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"durationUnit\",\n        title=\"s | min | h | d | wk | mo | a - unit of time (UCUM)\",\n        description=(\n            \"The units of time for the duration, in UCUM units Normal practice is \"\n            \"to use the 'mo' code as a calendar month when calculating the next \"\n            \"occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"s\", \"min\", \"h\", \"d\", \"wk\", \"mo\", \"a\"],\n        },\n    )\n    durationUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_durationUnit\",\n        title=\"Extension field for ``durationUnit``.\",\n    )\n\n    frequency: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"frequency\",\n        title=(\n            \"Indicates the number of repetitions that should occur within a period.\"\n            \" I.e. Event occurs frequency times per period\"\n        ),\n        description=(\n            \"The number of times to repeat the action within the specified period. \"\n            \"If frequencyMax is present, this element indicates the lower bound of \"\n            \"the allowed range of the frequency.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    frequency__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_frequency\", title=\"Extension field for ``frequency``.\"\n    )\n\n    frequencyMax: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"frequencyMax\",\n        title=\"Event occurs up to frequencyMax times per period\",\n        description=(\n            \"If present, indicates that the frequency is a range - so to repeat \"\n            \"between [frequency] and [frequencyMax] times within the period or \"\n            \"period range.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    frequencyMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_frequencyMax\",\n        title=\"Extension field for ``frequencyMax``.\",\n    )\n\n    offset: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"offset\",\n        title=\"Minutes from event (before or after)\",\n        description=(\n            \"The number of minutes from the event. If the event code does not \"\n            \"indicate whether the minutes is before or after the event, then the \"\n            \"offset is assumed to be after the event.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    offset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_offset\", title=\"Extension field for ``offset``.\"\n    )\n\n    period: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=(\n            \"The duration to which the frequency applies. I.e. Event occurs \"\n            \"frequency times per period\"\n        ),\n        description=(\n            \"Indicates the duration of time over which repetitions are to occur; \"\n            'e.g. to express \"3 times per day\", 3 would be the frequency and \"1 '\n            'day\" would be the period. If periodMax is present, this element '\n            \"indicates the lower bound of the allowed range of the period length.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    period__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_period\", title=\"Extension field for ``period``.\"\n    )\n\n    periodMax: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"periodMax\",\n        title=\"Upper limit of period (3-4 hours)\",\n        description=(\n            \"If present, indicates that the period is a range from [period] to \"\n            '[periodMax], allowing expressing concepts such as \"do this once every '\n            \"3-5 days.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    periodMax__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_periodMax\", title=\"Extension field for ``periodMax``.\"\n    )\n\n    periodUnit: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"periodUnit\",\n        title=\"s | min | h | d | wk | mo | a - unit of time (UCUM)\",\n        description=(\n            \"The units of time for the period in UCUM units Normal practice is to \"\n            \"use the 'mo' code as a calendar month when calculating the next \"\n            \"occurrence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"s\", \"min\", \"h\", \"d\", \"wk\", \"mo\", \"a\"],\n        },\n    )\n    periodUnit__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_periodUnit\", title=\"Extension field for ``periodUnit``.\"\n    )\n\n    timeOfDay: typing.List[fhirtypes.TimeType | None] | None = Field(\n        default=None,\n        alias=\"timeOfDay\",\n        title=\"Time of day for action\",\n        description=\"Specified time of day for action to take place.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    timeOfDay__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_timeOfDay\", title=\"Extension field for ``timeOfDay``.\"\n    )\n\n    when: typing.List[fhirtypes.CodeType | None] | None = Field(\n        default=None,\n        alias=\"when\",\n        title=\"Code for time period of occurrence\",\n        description=(\n            \"An approximate time period during the day, potentially linked to an \"\n            \"event of daily living that indicates when the action should occur.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    when__ext: typing.List[fhirtypes.FHIRPrimitiveExtensionType | None] | None = Field(\n        default=None, alias=\"_when\", title=\"Extension field for ``when``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TimingRepeat`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"boundsDuration\",\n            \"boundsRange\",\n            \"boundsPeriod\",\n            \"count\",\n            \"countMax\",\n            \"duration\",\n            \"durationMax\",\n            \"durationUnit\",\n            \"frequency\",\n            \"frequencyMax\",\n            \"period\",\n            \"periodMax\",\n            \"periodUnit\",\n            \"dayOfWeek\",\n            \"timeOfDay\",\n            \"when\",\n            \"offset\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TimingRepeat`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"boundsDuration\",\n            \"boundsRange\",\n            \"boundsPeriod\",\n            \"count\",\n            \"countMax\",\n            \"duration\",\n            \"durationMax\",\n            \"durationUnit\",\n            \"frequency\",\n            \"frequencyMax\",\n            \"period\",\n            \"periodMax\",\n            \"periodUnit\",\n            \"dayOfWeek\",\n            \"timeOfDay\",\n            \"when\",\n            \"offset\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"bounds\": [\"boundsDuration\", \"boundsPeriod\", \"boundsRange\"]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/transport.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/Transport\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass Transport(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Delivery of item.\n    Record of transport of item.\n    \"\"\"\n\n    __resource_type__ = \"Transport\"\n\n    authoredOn: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"authoredOn\",\n        title=\"Transport Creation Date\",\n        description=\"The date and time this transport was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    authoredOn__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_authoredOn\", title=\"Extension field for ``authoredOn``.\"\n    )\n\n    basedOn: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"basedOn\",\n        title=\"Request fulfilled by this transport\",\n        description=(\n            \"BasedOn refers to a higher-level authorization that triggered the \"\n            'creation of the transport.  It references a \"request\" resource such as'\n            ' a ServiceRequest or Transport, which is distinct from the \"request\" '\n            \"resource the Transport is seeking to fulfill.  This latter resource is\"\n            \" referenced by FocusOn.  For example, based on a ServiceRequest (= \"\n            \"BasedOn), a transport is created to fulfill a procedureRequest ( = \"\n            \"FocusOn ) to transport a specimen to the lab.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Transport Type\",\n        description=(\n            \"A name or code (or both) briefly describing what the transport \"\n            \"involves.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    completionTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"completionTime\",\n        title=\"Completion time of the event (the occurrence)\",\n        description=\"Identifies the completion time of the event (the occurrence).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    completionTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_completionTime\",\n        title=\"Extension field for ``completionTime``.\",\n    )\n\n    currentLocation: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"currentLocation\",\n        title=\"The entity current location\",\n        description=\"The current location for the entity to be transported.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    description: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Human-readable explanation of transport\",\n        description=\"A free-text description of what is to be performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Healthcare event during which this transport originated\",\n        description=(\n            \"The healthcare event  (e.g. a patient and healthcare provider \"\n            \"interaction) during which this transport was created.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    focus: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"focus\",\n        title=\"What transport is acting on\",\n        description=(\n            \"The request being actioned or the resource being manipulated by this \"\n            \"transport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    for_fhir: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"for\",\n        title=\"Beneficiary of the Transport\",\n        description=(\n            \"The entity who benefits from the performance of the service specified \"\n            \"in the transport (e.g., the patient).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    groupIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"groupIdentifier\",\n        title=\"Requisition or grouper id\",\n        description=(\n            \"A shared identifier common to multiple independent Request instances \"\n            \"that were activated/authorized more or less simultaneously by a single\"\n            \" author.  The presence of the same identifier on each request ties \"\n            \"those requests together and may have business ramifications in terms \"\n            \"of reporting of results, billing, etc.  E.g. a requisition number \"\n            \"shared by a set of lab tests ordered together, or a prescription \"\n            \"number shared by all meds ordered at one time.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    history: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"history\",\n        title=\"Parent (or preceding) transport\",\n        description=\"The transport event prior to this one.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Transport\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"External identifier\",\n        description=(\n            \"Identifier for the transport event that is used to identify it across \"\n            \"multiple disparate systems.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    input: typing.List[fhirtypes.TransportInputType] | None = Field(\n        default=None,\n        alias=\"input\",\n        title=\"Information used to perform transport\",\n        description=(\n            \"Additional information that may be needed in the execution of the \"\n            \"transport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    instantiatesCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"instantiatesCanonical\",\n        title=\"Formal definition of transport\",\n        description=(\n            \"The URL pointing to a *FHIR*-defined protocol, guideline, orderset or \"\n            \"other definition that is adhered to in whole or in part by this \"\n            \"Transport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ActivityDefinition\"],\n        },\n    )\n    instantiatesCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesCanonical\",\n        title=\"Extension field for ``instantiatesCanonical``.\",\n    )\n\n    instantiatesUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"instantiatesUri\",\n        title=\"Formal definition of transport\",\n        description=(\n            \"The URL pointing to an *externally* maintained  protocol, guideline, \"\n            \"orderset or other definition that is adhered to in whole or in part by\"\n            \" this Transport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    instantiatesUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_instantiatesUri\",\n        title=\"Extension field for ``instantiatesUri``.\",\n    )\n\n    insurance: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"insurance\",\n        title=\"Associated insurance coverage\",\n        description=(\n            \"Insurance plans, coverage extensions, pre-authorizations and/or pre-\"\n            \"determinations that may be relevant to the Transport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Coverage\", \"ClaimResponse\"],\n        },\n    )\n\n    intent: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"intent\",\n        title=(\n            \"unknown | proposal | plan | order | original-order | reflex-order | \"\n            \"filler-order | instance-order | option\"\n        ),\n        description=(\n            'Indicates the \"level\" of actionability associated with the Transport, '\n            \"i.e. i+R[9]Cs this a proposed transport, a planned transport, an \"\n            \"actionable transport, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"unknown\",\n                \"proposal\",\n                \"plan\",\n                \"order\",\n                \"original-order\",\n                \"reflex-order\",\n                \"filler-order\",\n                \"instance-order\",\n                \"option\",\n            ],\n        },\n    )\n    intent__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_intent\", title=\"Extension field for ``intent``.\"\n    )\n\n    lastModified: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"lastModified\",\n        title=\"Transport Last Modified Date\",\n        description=\"The date and time of last modification to this transport.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lastModified__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastModified\",\n        title=\"Extension field for ``lastModified``.\",\n    )\n\n    location: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"location\",\n        title=\"Where transport occurs\",\n        description=\"Principal physical location where this transport is performed.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Comments made about the transport\",\n        description=\"Free-text information captured about the transport as it progresses.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    output: typing.List[fhirtypes.TransportOutputType] | None = Field(\n        default=None,\n        alias=\"output\",\n        title=\"Information produced as part of transport\",\n        description=\"Outputs produced by the Transport.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    owner: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"owner\",\n        title=\"Responsible individual\",\n        description=(\n            \"Individual organization or Device currently responsible for transport \"\n            \"execution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n                \"CareTeam\",\n                \"HealthcareService\",\n                \"Patient\",\n                \"Device\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    partOf: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"partOf\",\n        title=\"Part of referenced event\",\n        description=\"A larger event of which this particular event is a component or step.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Transport\"],\n        },\n    )\n\n    performerType: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"performerType\",\n        title=\"Requested performer\",\n        description=\"The kind of participant that should perform the transport.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    priority: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"priority\",\n        title=\"routine | urgent | asap | stat\",\n        description=(\n            \"Indicates how quickly the Transport should be addressed with respect \"\n            \"to other requests.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"routine\", \"urgent\", \"asap\", \"stat\"],\n        },\n    )\n    priority__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_priority\", title=\"Extension field for ``priority``.\"\n    )\n\n    reason: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"reason\",\n        title=\"Why transport is needed\",\n        description=(\n            \"A resource reference indicating why this transport needs to be \"\n            \"performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    relevantHistory: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"relevantHistory\",\n        title=\"Key events in history of the Transport\",\n        description=(\n            \"Links to Provenance records for past versions of this Transport that \"\n            \"identify key state transitions or updates that are likely to be \"\n            \"relevant to a user looking at the current version of the transport.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Provenance\"],\n        },\n    )\n\n    requestedLocation: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"requestedLocation\",\n        title=\"The desired location\",\n        description=\"The desired or final location for the transport.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Location\"],\n        },\n    )\n\n    requester: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"requester\",\n        title=\"Who is asking for transport to be done\",\n        description=\"The creator of the transport.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Device\",\n                \"Organization\",\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n            ],\n        },\n    )\n\n    restriction: fhirtypes.TransportRestrictionType | None = Field(\n        default=None,\n        alias=\"restriction\",\n        title=\"Constraints on fulfillment transports\",\n        description=(\n            \"If the Transport.focus is a request resource and the transport is \"\n            \"seeking fulfillment (i.e. is asking for the request to be actioned), \"\n            \"this element identifies any limitations on what parts of the \"\n            \"referenced request should be actioned.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"in-progress | completed | abandoned | cancelled | planned | entered-\"\n            \"in-error\"\n        ),\n        description=\"A code specifying the state of the transport event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"in-progress\",\n                \"completed\",\n                \"abandoned\",\n                \"cancelled\",\n                \"planned\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusReason: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"statusReason\",\n        title=\"Reason for current status\",\n        description=(\n            \"An explanation as to why this transport is held, failed, was refused, \"\n            \"etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``Transport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"intent\",\n            \"priority\",\n            \"code\",\n            \"description\",\n            \"focus\",\n            \"for\",\n            \"encounter\",\n            \"completionTime\",\n            \"authoredOn\",\n            \"lastModified\",\n            \"requester\",\n            \"performerType\",\n            \"owner\",\n            \"location\",\n            \"insurance\",\n            \"note\",\n            \"relevantHistory\",\n            \"restriction\",\n            \"input\",\n            \"output\",\n            \"requestedLocation\",\n            \"currentLocation\",\n            \"reason\",\n            \"history\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``Transport`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"instantiatesCanonical\",\n            \"instantiatesUri\",\n            \"basedOn\",\n            \"groupIdentifier\",\n            \"partOf\",\n            \"status\",\n            \"statusReason\",\n            \"intent\",\n            \"code\",\n            \"description\",\n            \"focus\",\n            \"for\",\n            \"encounter\",\n            \"completionTime\",\n            \"lastModified\",\n            \"requester\",\n            \"owner\",\n            \"location\",\n            \"requestedLocation\",\n            \"currentLocation\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"intent\", \"intent__ext\")]\n        return required_fields\n\n\nclass TransportInput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information used to perform transport.\n    Additional information that may be needed in the execution of the\n    transport.\n    \"\"\"\n\n    __resource_type__ = \"TransportInput\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Label for the input\",\n        description=(\n            \"A code or description indicating how the input is intended to be used \"\n            \"as part of the transport execution.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAvailability: fhirtypes.AvailabilityType | None = Field(\n        default=None,\n        alias=\"valueAvailability\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueCanonical\",\n        title=\"Extension field for ``valueCanonical``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"valueCodeableReference\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"valueContactDetail\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"valueDataRequirement\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"valueDosage\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"valueExpression\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field(\n        default=None,\n        alias=\"valueExtendedContactDetail\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueInteger64: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"valueInteger64\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger64\",\n        title=\"Extension field for ``valueInteger64``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"valueParameterDefinition\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"valueRatioRange\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"valueRelatedArtifact\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"valueTriggerDefinition\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUrl\", title=\"Extension field for ``valueUrl``.\"\n    )\n\n    valueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"valueUsageContext\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"valueUuid\",\n        title=\"Content to use in performing the transport\",\n        description=\"The value of the input parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUuid\", title=\"Extension field for ``valueUuid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TransportInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueInteger64\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCodeableReference\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueRatioRange\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueAvailability\",\n            \"valueExtendedContactDetail\",\n            \"valueDosage\",\n            \"valueMeta\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TransportInput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueAvailability\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCanonical\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCodeableReference\",\n                \"valueCoding\",\n                \"valueContactDetail\",\n                \"valueContactPoint\",\n                \"valueCount\",\n                \"valueDataRequirement\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDosage\",\n                \"valueDuration\",\n                \"valueExpression\",\n                \"valueExtendedContactDetail\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueInteger64\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valueParameterDefinition\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueRatioRange\",\n                \"valueReference\",\n                \"valueRelatedArtifact\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueTriggerDefinition\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n                \"valueUrl\",\n                \"valueUsageContext\",\n                \"valueUuid\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass TransportOutput(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information produced as part of transport.\n    Outputs produced by the Transport.\n    \"\"\"\n\n    __resource_type__ = \"TransportOutput\"\n\n    type: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"type\",\n        title=\"Label for output\",\n        description=\"The name of the Output parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueAddress: fhirtypes.AddressType | None = Field(\n        default=None,\n        alias=\"valueAddress\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAge: fhirtypes.AgeType | None = Field(\n        default=None,\n        alias=\"valueAge\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAnnotation: fhirtypes.AnnotationType | None = Field(\n        default=None,\n        alias=\"valueAnnotation\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAttachment: fhirtypes.AttachmentType | None = Field(\n        default=None,\n        alias=\"valueAttachment\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueAvailability: fhirtypes.AvailabilityType | None = Field(\n        default=None,\n        alias=\"valueAvailability\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueBase64Binary: fhirtypes.Base64BinaryType | None = Field(\n        default=None,\n        alias=\"valueBase64Binary\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBase64Binary__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBase64Binary\",\n        title=\"Extension field for ``valueBase64Binary``.\",\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCanonical: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"valueCanonical\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCanonical__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueCanonical\",\n        title=\"Extension field for ``valueCanonical``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCodeableReference: fhirtypes.CodeableReferenceType | None = Field(\n        default=None,\n        alias=\"valueCodeableReference\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactDetail: fhirtypes.ContactDetailType | None = Field(\n        default=None,\n        alias=\"valueContactDetail\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"valueContactPoint\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueCount: fhirtypes.CountType | None = Field(\n        default=None,\n        alias=\"valueCount\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDataRequirement: fhirtypes.DataRequirementType | None = Field(\n        default=None,\n        alias=\"valueDataRequirement\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"valueDate\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueDate\", title=\"Extension field for ``valueDate``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueDistance: fhirtypes.DistanceType | None = Field(\n        default=None,\n        alias=\"valueDistance\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDosage: fhirtypes.DosageType | None = Field(\n        default=None,\n        alias=\"valueDosage\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDuration: fhirtypes.DurationType | None = Field(\n        default=None,\n        alias=\"valueDuration\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExpression: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"valueExpression\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field(\n        default=None,\n        alias=\"valueExtendedContactDetail\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueHumanName: fhirtypes.HumanNameType | None = Field(\n        default=None,\n        alias=\"valueHumanName\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueId: fhirtypes.IdType | None = Field(\n        default=None,\n        alias=\"valueId\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueId__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueId\", title=\"Extension field for ``valueId``.\"\n    )\n\n    valueIdentifier: fhirtypes.IdentifierType | None = Field(\n        default=None,\n        alias=\"valueIdentifier\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueInstant: fhirtypes.InstantType | None = Field(\n        default=None,\n        alias=\"valueInstant\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInstant__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInstant\",\n        title=\"Extension field for ``valueInstant``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueInteger64: fhirtypes.Integer64Type | None = Field(\n        default=None,\n        alias=\"valueInteger64\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger64__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger64\",\n        title=\"Extension field for ``valueInteger64``.\",\n    )\n\n    valueMarkdown: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"valueMarkdown\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueMarkdown__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueMarkdown\",\n        title=\"Extension field for ``valueMarkdown``.\",\n    )\n\n    valueMeta: fhirtypes.MetaType | None = Field(\n        default=None,\n        alias=\"valueMeta\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueMoney: fhirtypes.MoneyType | None = Field(\n        default=None,\n        alias=\"valueMoney\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueOid: fhirtypes.OidType | None = Field(\n        default=None,\n        alias=\"valueOid\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueOid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueOid\", title=\"Extension field for ``valueOid``.\"\n    )\n\n    valueParameterDefinition: fhirtypes.ParameterDefinitionType | None = Field(\n        default=None,\n        alias=\"valueParameterDefinition\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"valuePeriod\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valuePositiveInt: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"valuePositiveInt\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valuePositiveInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valuePositiveInt\",\n        title=\"Extension field for ``valuePositiveInt``.\",\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatio: fhirtypes.RatioType | None = Field(\n        default=None,\n        alias=\"valueRatio\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRatioRange: fhirtypes.RatioRangeType | None = Field(\n        default=None,\n        alias=\"valueRatioRange\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRelatedArtifact: fhirtypes.RelatedArtifactType | None = Field(\n        default=None,\n        alias=\"valueRelatedArtifact\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSampledData: fhirtypes.SampledDataType | None = Field(\n        default=None,\n        alias=\"valueSampledData\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"valueSignature\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueTime: fhirtypes.TimeType | None = Field(\n        default=None,\n        alias=\"valueTime\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueTime\", title=\"Extension field for ``valueTime``.\"\n    )\n\n    valueTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"valueTiming\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueTriggerDefinition: fhirtypes.TriggerDefinitionType | None = Field(\n        default=None,\n        alias=\"valueTriggerDefinition\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUnsignedInt: fhirtypes.UnsignedIntType | None = Field(\n        default=None,\n        alias=\"valueUnsignedInt\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUnsignedInt__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueUnsignedInt\",\n        title=\"Extension field for ``valueUnsignedInt``.\",\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    valueUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"valueUrl\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUrl\", title=\"Extension field for ``valueUrl``.\"\n    )\n\n    valueUsageContext: fhirtypes.UsageContextType | None = Field(\n        default=None,\n        alias=\"valueUsageContext\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueUuid: fhirtypes.UuidType | None = Field(\n        default=None,\n        alias=\"valueUuid\",\n        title=\"Result of output\",\n        description=\"The value of the Output parameter as a basic type.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueUuid__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUuid\", title=\"Extension field for ``valueUuid``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TransportOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"type\",\n            \"valueBase64Binary\",\n            \"valueBoolean\",\n            \"valueCanonical\",\n            \"valueCode\",\n            \"valueDate\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"valueId\",\n            \"valueInstant\",\n            \"valueInteger\",\n            \"valueInteger64\",\n            \"valueMarkdown\",\n            \"valueOid\",\n            \"valuePositiveInt\",\n            \"valueString\",\n            \"valueTime\",\n            \"valueUnsignedInt\",\n            \"valueUri\",\n            \"valueUrl\",\n            \"valueUuid\",\n            \"valueAddress\",\n            \"valueAge\",\n            \"valueAnnotation\",\n            \"valueAttachment\",\n            \"valueCodeableConcept\",\n            \"valueCodeableReference\",\n            \"valueCoding\",\n            \"valueContactPoint\",\n            \"valueCount\",\n            \"valueDistance\",\n            \"valueDuration\",\n            \"valueHumanName\",\n            \"valueIdentifier\",\n            \"valueMoney\",\n            \"valuePeriod\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueRatio\",\n            \"valueRatioRange\",\n            \"valueReference\",\n            \"valueSampledData\",\n            \"valueSignature\",\n            \"valueTiming\",\n            \"valueContactDetail\",\n            \"valueDataRequirement\",\n            \"valueExpression\",\n            \"valueParameterDefinition\",\n            \"valueRelatedArtifact\",\n            \"valueTriggerDefinition\",\n            \"valueUsageContext\",\n            \"valueAvailability\",\n            \"valueExtendedContactDetail\",\n            \"valueDosage\",\n            \"valueMeta\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TransportOutput`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueAddress\",\n                \"valueAge\",\n                \"valueAnnotation\",\n                \"valueAttachment\",\n                \"valueAvailability\",\n                \"valueBase64Binary\",\n                \"valueBoolean\",\n                \"valueCanonical\",\n                \"valueCode\",\n                \"valueCodeableConcept\",\n                \"valueCodeableReference\",\n                \"valueCoding\",\n                \"valueContactDetail\",\n                \"valueContactPoint\",\n                \"valueCount\",\n                \"valueDataRequirement\",\n                \"valueDate\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueDistance\",\n                \"valueDosage\",\n                \"valueDuration\",\n                \"valueExpression\",\n                \"valueExtendedContactDetail\",\n                \"valueHumanName\",\n                \"valueId\",\n                \"valueIdentifier\",\n                \"valueInstant\",\n                \"valueInteger\",\n                \"valueInteger64\",\n                \"valueMarkdown\",\n                \"valueMeta\",\n                \"valueMoney\",\n                \"valueOid\",\n                \"valueParameterDefinition\",\n                \"valuePeriod\",\n                \"valuePositiveInt\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueRatio\",\n                \"valueRatioRange\",\n                \"valueReference\",\n                \"valueRelatedArtifact\",\n                \"valueSampledData\",\n                \"valueSignature\",\n                \"valueString\",\n                \"valueTime\",\n                \"valueTiming\",\n                \"valueTriggerDefinition\",\n                \"valueUnsignedInt\",\n                \"valueUri\",\n                \"valueUrl\",\n                \"valueUsageContext\",\n                \"valueUuid\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass TransportRestriction(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Constraints on fulfillment transports.\n    If the Transport.focus is a request resource and the transport is seeking\n    fulfillment (i.e. is asking for the request to be actioned), this element\n    identifies any limitations on what parts of the referenced request should\n    be actioned.\n    \"\"\"\n\n    __resource_type__ = \"TransportRestriction\"\n\n    period: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"period\",\n        title=\"When fulfillment sought\",\n        description=\"Over what time-period is fulfillment sought.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    recipient: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"recipient\",\n        title=\"For whom is fulfillment sought?\",\n        description=(\n            \"For requests that are targeted to more than one potential \"\n            \"recipient/target, to identify who is fulfillment is sought for.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Patient\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"RelatedPerson\",\n                \"Group\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    repetitions: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"repetitions\",\n        title=\"How many times to repeat\",\n        description=\"Indicates the number of times the requested action should occur.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    repetitions__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_repetitions\", title=\"Extension field for ``repetitions``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TransportRestriction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"repetitions\",\n            \"period\",\n            \"recipient\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TransportRestriction`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/triggerdefinition.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/TriggerDefinition\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass TriggerDefinition(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Defines an expected trigger for a module.\n    A description of a triggering event. Triggering events can be named events,\n    data events, or periodic, as determined by the type element.\n    \"\"\"\n\n    __resource_type__ = \"TriggerDefinition\"\n\n    code: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Coded definition of the event\",\n        description=\"A code that identifies the event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    condition: fhirtypes.ExpressionType | None = Field(\n        default=None,\n        alias=\"condition\",\n        title=\"Whether the event triggers (boolean expression)\",\n        description=(\n            \"A boolean-valued expression that is evaluated in the context of the \"\n            \"container of the trigger definition and returns whether or not the \"\n            \"trigger fires.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    data: typing.List[fhirtypes.DataRequirementType] | None = Field(\n        default=None,\n        alias=\"data\",\n        title=\"Triggering data of the event (multiple = 'and')\",\n        description=(\n            \"The triggering data of the event (if this is a data trigger). If more \"\n            \"than one data is requirement is specified, then all the data \"\n            \"requirements must be true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name or URI that identifies the event\",\n        description=(\n            \"A formal name for the event. This may be an absolute URI that \"\n            \"identifies the event formally (e.g. from a trigger registry), or a \"\n            \"simple relative URI that identifies the event in a local context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    subscriptionTopic: fhirtypes.CanonicalType | None = Field(\n        default=None,\n        alias=\"subscriptionTopic\",\n        title=\"What event\",\n        description=(\n            \"A reference to a SubscriptionTopic resource that defines the event. If\"\n            \" this element is provided, no other information about the trigger \"\n            \"definition may be supplied.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"SubscriptionTopic\"],\n        },\n    )\n    subscriptionTopic__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_subscriptionTopic\",\n        title=\"Extension field for ``subscriptionTopic``.\",\n    )\n\n    timingDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"timingDate\",\n        title=\"Timing of the event\",\n        description=\"The timing of the event (if this is a periodic trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timingDate\", title=\"Extension field for ``timingDate``.\"\n    )\n\n    timingDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timingDateTime\",\n        title=\"Timing of the event\",\n        description=\"The timing of the event (if this is a periodic trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n    timingDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_timingDateTime\",\n        title=\"Extension field for ``timingDateTime``.\",\n    )\n\n    timingReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"timingReference\",\n        title=\"Timing of the event\",\n        description=\"The timing of the event (if this is a periodic trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Schedule\"],\n        },\n    )\n\n    timingTiming: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"timingTiming\",\n        title=\"Timing of the event\",\n        description=\"The timing of the event (if this is a periodic trigger).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e timing[x]\n            \"one_of_many\": \"timing\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    type: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"named-event | periodic | data-changed | data-added | data-modified | \"\n            \"data-removed | data-accessed | data-access-ended\"\n        ),\n        description=\"The type of triggering event.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"named-event\",\n                \"periodic\",\n                \"data-changed\",\n                \"data-added\",\n                \"data-modified\",\n                \"data-removed\",\n                \"data-accessed\",\n                \"data-access-ended\",\n            ],\n        },\n    )\n    type__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_type\", title=\"Extension field for ``type``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``TriggerDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"type\",\n            \"name\",\n            \"code\",\n            \"subscriptionTopic\",\n            \"timingTiming\",\n            \"timingReference\",\n            \"timingDate\",\n            \"timingDateTime\",\n            \"data\",\n            \"condition\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``TriggerDefinition`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"type\",\n            \"name\",\n            \"code\",\n            \"subscriptionTopic\",\n            \"timingTiming\",\n            \"timingReference\",\n            \"timingDate\",\n            \"timingDateTime\",\n            \"data\",\n            \"condition\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"type\", \"type__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"timing\": [\n                \"timingDate\",\n                \"timingDateTime\",\n                \"timingReference\",\n                \"timingTiming\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/usagecontext.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/UsageContext\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass UsageContext(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes the context of use for a conformance or knowledge resource.\n    Specifies clinical/business/etc. metadata that can be used to retrieve,\n    index and/or categorize an artifact. This metadata can either be specific\n    to the applicable population (e.g., age category, DRG) or the specific\n    context of care (e.g., venue, care setting, provider of care).\n    \"\"\"\n\n    __resource_type__ = \"UsageContext\"\n\n    code: fhirtypes.CodingType = Field(\n        default=...,\n        alias=\"code\",\n        title=\"Type of context being specified\",\n        description=(\n            \"A code that identifies the type of context being specified by this \"\n            \"usage context.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    valueCodeableConcept: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"valueCodeableConcept\",\n        title=\"Value that defines the context\",\n        description=(\n            \"A value that defines the context specified in this context of use. The\"\n            \" interpretation of the value is defined by the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueQuantity: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"valueQuantity\",\n        title=\"Value that defines the context\",\n        description=(\n            \"A value that defines the context specified in this context of use. The\"\n            \" interpretation of the value is defined by the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueRange: fhirtypes.RangeType | None = Field(\n        default=None,\n        alias=\"valueRange\",\n        title=\"Value that defines the context\",\n        description=(\n            \"A value that defines the context specified in this context of use. The\"\n            \" interpretation of the value is defined by the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueReference: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"valueReference\",\n        title=\"Value that defines the context\",\n        description=(\n            \"A value that defines the context specified in this context of use. The\"\n            \" interpretation of the value is defined by the code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"PlanDefinition\",\n                \"ResearchStudy\",\n                \"InsurancePlan\",\n                \"HealthcareService\",\n                \"Group\",\n                \"Location\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``UsageContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueReference\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``UsageContext`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"code\",\n            \"valueCodeableConcept\",\n            \"valueQuantity\",\n            \"valueRange\",\n            \"valueReference\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueCodeableConcept\",\n                \"valueQuantity\",\n                \"valueRange\",\n                \"valueReference\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/valueset.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/ValueSet\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass ValueSet(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A set of codes drawn from one or more code systems.\n    A ValueSet resource instance specifies a set of codes drawn from one or\n    more code systems, intended for use in a particular context. Value sets\n    link between [CodeSystem](codesystem.html) definitions and their use in\n    [coded elements](terminologies.html).\n    \"\"\"\n\n    __resource_type__ = \"ValueSet\"\n\n    approvalDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"approvalDate\",\n        title=\"When the ValueSet was approved by publisher\",\n        description=(\n            \"The date on which the resource content was approved by the publisher. \"\n            \"Approval happens once when the content is officially approved for \"\n            \"usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    approvalDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_approvalDate\",\n        title=\"Extension field for ``approvalDate``.\",\n    )\n\n    author: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"author\",\n        title=\"Who authored the ValueSet\",\n        description=(\n            \"An individiual or organization primarily involved in the creation and \"\n            \"maintenance of the ValueSet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    compose: fhirtypes.ValueSetComposeType | None = Field(\n        default=None,\n        alias=\"compose\",\n        title=\"Content logical definition of the value set (CLD)\",\n        description=(\n            \"A set of criteria that define the contents of the value set by \"\n            \"including or excluding codes selected from the specified code \"\n            \"system(s) that the value set draws from. This is also known as the \"\n            \"Content Logical Definition (CLD).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    contact: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"contact\",\n        title=\"Contact details for the publisher\",\n        description=(\n            \"Contact details to assist a user in finding and communicating with the\"\n            \" publisher.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=\"Use and/or publishing restrictions\",\n        description=(\n            \"A copyright statement relating to the value set and/or its contents. \"\n            \"Copyright statements are generally legal restrictions on the use and \"\n            \"publishing of the value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    copyrightLabel: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyrightLabel\",\n        title=\"Copyright holder and year(s)\",\n        description=(\n            \"A short string (<50 characters), suitable for inclusion in a page \"\n            \"footer that identifies the copyright holder, effective period, and \"\n            \"optionally whether rights are resctricted. (e.g. 'All rights \"\n            \"reserved', 'Some rights reserved').\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyrightLabel__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_copyrightLabel\",\n        title=\"Extension field for ``copyrightLabel``.\",\n    )\n\n    date: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"Date last changed\",\n        description=(\n            \"The date (and optionally time) when the value set metadata or content \"\n            \"logical definition (.compose) was created or revised.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    description: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"description\",\n        title=\"Natural language description of the value set\",\n        description=(\n            \"A free text natural language description of the value set from a \"\n            \"consumer's perspective. The textual description specifies the span of \"\n            \"meanings for concepts to be included within the Value Set Expansion, \"\n            \"and also may specify the intended use and limitations of the Value \"\n            \"Set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    description__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_description\", title=\"Extension field for ``description``.\"\n    )\n\n    editor: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"editor\",\n        title=\"Who edited the ValueSet\",\n        description=(\n            \"An individual or organization primarily responsible for internal \"\n            \"coherence of the ValueSet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    effectivePeriod: fhirtypes.PeriodType | None = Field(\n        default=None,\n        alias=\"effectivePeriod\",\n        title=\"When the ValueSet is expected to be used\",\n        description=(\n            \"The period during which the ValueSet content was or is planned to be \"\n            \"in active use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    endorser: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"endorser\",\n        title=\"Who endorsed the ValueSet\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"responsible for officially endorsing the ValueSet for use in some \"\n            \"setting.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    expansion: fhirtypes.ValueSetExpansionType | None = Field(\n        default=None,\n        alias=\"expansion\",\n        title='Used when the value set is \"expanded\"',\n        description=(\n            'A value set can also be \"expanded\", where the value set is turned into'\n            \" a simple collection of enumerated codes. This element holds the \"\n            \"expansion, if it has been performed.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    experimental: bool | None = Field(\n        default=None,\n        alias=\"experimental\",\n        title=\"For testing purposes, not real usage\",\n        description=(\n            \"A Boolean value to indicate that this value set is authored for \"\n            \"testing purposes (or education/evaluation/marketing) and is not \"\n            \"intended to be used for genuine usage.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    experimental__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_experimental\",\n        title=\"Extension field for ``experimental``.\",\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Additional identifier for the value set (business identifier)\",\n        description=(\n            \"A formal identifier that is used to identify this value set when it is\"\n            \" represented in other formats, or referenced in a specification, \"\n            \"model, design or an instance.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    immutable: bool | None = Field(\n        default=None,\n        alias=\"immutable\",\n        title=(\n            \"Indicates whether or not any change to the content logical definition \"\n            \"may occur\"\n        ),\n        description=(\n            \"If this is set to 'true', then no new versions of the content logical \"\n            \"definition can be created.  Note: Other metadata might still change.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    immutable__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_immutable\", title=\"Extension field for ``immutable``.\"\n    )\n\n    jurisdiction: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"jurisdiction\",\n        title=\"Intended jurisdiction for value set (if applicable)\",\n        description=(\n            \"A legal or geographic region in which the value set is intended to be \"\n            \"used.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lastReviewDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lastReviewDate\",\n        title=\"When the ValueSet was last reviewed by the publisher\",\n        description=(\n            \"The date on which the resource content was last reviewed. Review \"\n            \"happens periodically after approval but does not change the original \"\n            \"approval date.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastReviewDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastReviewDate\",\n        title=\"Extension field for ``lastReviewDate``.\",\n    )\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name for this value set (computer friendly)\",\n        description=(\n            \"A natural language name identifying the value set. This name should be\"\n            \" usable as an identifier for the module by machine processing \"\n            \"applications such as code generation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    publisher: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"publisher\",\n        title=\"Name of the publisher/steward (organization or individual)\",\n        description=(\n            \"The name of the organization or individual responsible for the release\"\n            \" and ongoing maintenance of the value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    publisher__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_publisher\", title=\"Extension field for ``publisher``.\"\n    )\n\n    purpose: fhirtypes.MarkdownType | None = Field(\n        default=None,\n        alias=\"purpose\",\n        title=\"Why this value set is defined\",\n        description=(\n            \"Explanation of why this value set is needed and why it has been \"\n            \"designed as it has.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    purpose__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_purpose\", title=\"Extension field for ``purpose``.\"\n    )\n\n    relatedArtifact: typing.List[fhirtypes.RelatedArtifactType] | None = Field(\n        default=None,\n        alias=\"relatedArtifact\",\n        title=\"Additional documentation, citations, etc\",\n        description=(\n            \"Related artifacts such as additional documentation, justification, \"\n            \"dependencies, bibliographic references, and predecessor and successor \"\n            \"artifacts.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    reviewer: typing.List[fhirtypes.ContactDetailType] | None = Field(\n        default=None,\n        alias=\"reviewer\",\n        title=\"Who reviewed the ValueSet\",\n        description=(\n            \"An individual or organization asserted by the publisher to be \"\n            \"primarily responsible for review of some aspect of the ValueSet.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    scope: fhirtypes.ValueSetScopeType | None = Field(\n        default=None,\n        alias=\"scope\",\n        title=(\n            \"Description of the semantic space the Value Set Expansion is intended \"\n            \"to cover and should further clarify the text in ValueSet.description\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"draft | active | retired | unknown\",\n        description=(\n            \"The status of this value set. Enables tracking the life-cycle of the \"\n            \"content. The status of the value set applies to the value set \"\n            \"definition (ValueSet.compose) and the associated ValueSet metadata. \"\n            \"Expansions do not have a state.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"draft\", \"active\", \"retired\", \"unknown\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    title: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"title\",\n        title=\"Name for this value set (human friendly)\",\n        description=\"A short, descriptive, user-friendly title for the value set.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    title__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_title\", title=\"Extension field for ``title``.\"\n    )\n\n    topic: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"topic\",\n        title=\"E.g. Education, Treatment, Assessment, etc\",\n        description=(\n            \"Descriptions related to the content of the ValueSet. Topics provide a \"\n            \"high-level categorization as well as keywords for the ValueSet that \"\n            \"can be useful for filtering and searching.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    url: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"url\",\n        title=(\n            \"Canonical identifier for this value set, represented as a URI \"\n            \"(globally unique)\"\n        ),\n        description=(\n            \"An absolute URI that is used to identify this value set when it is \"\n            \"referenced in a specification, model, design or an instance; also \"\n            \"called its canonical identifier. This SHOULD be globally unique and \"\n            \"SHOULD be a literal address at which an authoritative instance of this\"\n            \" value set is (or will be) published. This URL can be the target of a \"\n            \"canonical reference. It SHALL remain the same when the value set is \"\n            \"stored on different servers.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    url__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_url\", title=\"Extension field for ``url``.\"\n    )\n\n    useContext: typing.List[fhirtypes.UsageContextType] | None = Field(\n        default=None,\n        alias=\"useContext\",\n        title=\"The context that the content is intended to support\",\n        description=(\n            \"The content was developed with a focus and intent of supporting the \"\n            \"contexts that are listed. These contexts may be general categories \"\n            \"(gender, age, ...) or may be references to specific programs \"\n            \"(insurance plans, studies, ...) and may be used to assist with \"\n            \"indexing and searching for appropriate value set instances.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Business version of the value set\",\n        description=(\n            \"The identifier that is used to identify this version of the value set \"\n            \"when it is referenced in a specification, model, design or instance. \"\n            \"This is an arbitrary value managed by the value set author and is not \"\n            \"expected to be globally unique. For example, it might be a timestamp \"\n            \"(e.g. yyyymmdd) if a managed version is not available. There is also \"\n            \"no expectation that versions can be placed in a lexicographical \"\n            \"sequence.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    versionAlgorithmCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmCoding\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which \"\n            \"ValueSet is more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    versionAlgorithmString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"versionAlgorithmString\",\n        title=\"How to compare versions\",\n        description=(\n            \"Indicates the mechanism used to compare versions to determine which \"\n            \"ValueSet is more current.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e versionAlgorithm[x]\n            \"one_of_many\": \"versionAlgorithm\",\n            \"one_of_many_required\": False,\n        },\n    )\n    versionAlgorithmString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_versionAlgorithmString\",\n        title=\"Extension field for ``versionAlgorithmString``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"description\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"immutable\",\n            \"purpose\",\n            \"copyright\",\n            \"copyrightLabel\",\n            \"approvalDate\",\n            \"lastReviewDate\",\n            \"effectivePeriod\",\n            \"topic\",\n            \"author\",\n            \"editor\",\n            \"reviewer\",\n            \"endorser\",\n            \"relatedArtifact\",\n            \"compose\",\n            \"expansion\",\n            \"scope\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSet`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"url\",\n            \"identifier\",\n            \"version\",\n            \"versionAlgorithmString\",\n            \"versionAlgorithmCoding\",\n            \"name\",\n            \"title\",\n            \"status\",\n            \"experimental\",\n            \"date\",\n            \"publisher\",\n            \"contact\",\n            \"useContext\",\n            \"jurisdiction\",\n            \"immutable\",\n            \"effectivePeriod\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"versionAlgorithm\": [\"versionAlgorithmCoding\", \"versionAlgorithmString\"]\n        }\n        return one_of_many_fields\n\n\nclass ValueSetCompose(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Content logical definition of the value set (CLD).\n    A set of criteria that define the contents of the value set by including or\n    excluding codes selected from the specified code system(s) that the value\n    set draws from. This is also known as the Content Logical Definition (CLD).\n    \"\"\"\n\n    __resource_type__ = \"ValueSetCompose\"\n\n    exclude: typing.List[fhirtypes.ValueSetComposeIncludeType] | None = Field(\n        default=None,\n        alias=\"exclude\",\n        title=\"Explicitly exclude codes from a code system or other value sets\",\n        description=(\n            \"Exclude one or more codes from the value set based on code system \"\n            \"filters and/or other value sets.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    inactive: bool | None = Field(\n        default=None,\n        alias=\"inactive\",\n        title=\"Whether inactive codes are in the value set\",\n        description=(\n            \"Whether inactive codes - codes that are not approved for current use -\"\n            \" are in the value set. If inactive = true, inactive codes are to be \"\n            \"included in the expansion, if inactive = false, the inactive codes \"\n            \"will not be included in the expansion. If absent, the behavior is \"\n            \"determined by the implementation, or by the applicable $expand \"\n            \"parameters (but generally, inactive codes would be expected to be \"\n            \"included).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_inactive\", title=\"Extension field for ``inactive``.\"\n    )\n\n    include: typing.List[fhirtypes.ValueSetComposeIncludeType] = Field(\n        default=...,\n        alias=\"include\",\n        title=\"Include one or more codes from a code system or other value set(s)\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    lockedDate: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"lockedDate\",\n        title=\"Fixed date for references with no specified version (transitive)\",\n        description=(\n            \"The Locked Date is  the effective date that is used to determine the \"\n            \"version of all referenced Code Systems and Value Set Definitions \"\n            \"included in the compose that are not already tied to a specific \"\n            \"version.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    lockedDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_lockedDate\", title=\"Extension field for ``lockedDate``.\"\n    )\n\n    property: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Property to return if client doesn't override\",\n        description=(\n            \"A property to return in the expansion, if the client doesn't ask for \"\n            \"any particular properties. May be either a code from the code system \"\n            \"definition (convenient) or a the formal URI that refers to the \"\n            \"property. The special value '*' means all properties known to the \"\n            \"server.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    property__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_property\", title=\"Extension field for ``property``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetCompose`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"lockedDate\",\n            \"inactive\",\n            \"include\",\n            \"exclude\",\n            \"property\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetCompose`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"lockedDate\", \"inactive\", \"include\"]\n\n\nclass ValueSetComposeInclude(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Include one or more codes from a code system or other value set(s).\n    \"\"\"\n\n    __resource_type__ = \"ValueSetComposeInclude\"\n\n    concept: typing.List[fhirtypes.ValueSetComposeIncludeConceptType] | None = Field(\n        default=None,\n        alias=\"concept\",\n        title=\"A concept defined in the system\",\n        description=\"Specifies a concept to be included or excluded.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    copyright: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"copyright\",\n        title=(\n            \"A copyright statement for the specific code system included in the \"\n            \"value set\"\n        ),\n        description=(\n            \"A copyright statement for the specific code system asserted by the \"\n            \"containing ValueSet.compose.include element's system value (if the \"\n            \"associated ValueSet.compose.include.version element is not present); \"\n            \"or the code system and version combination (if the associated \"\n            \"ValueSet.compose.include.version element is present).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    copyright__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_copyright\", title=\"Extension field for ``copyright``.\"\n    )\n\n    filter: typing.List[fhirtypes.ValueSetComposeIncludeFilterType] | None = Field(\n        default=None,\n        alias=\"filter\",\n        title=\"Select codes/concepts by their properties (including relationships)\",\n        description=(\n            \"Select concepts by specifying a matching criterion based on the \"\n            \"properties (including relationships) defined by the system, or on \"\n            \"filters defined by the system. If multiple filters are specified \"\n            \"within the include, they SHALL all be true.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"The system the codes come from\",\n        description=(\n            \"An absolute URI which is the code system from which the selected codes\"\n            \" come from.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    valueSet: typing.List[fhirtypes.CanonicalType | None] | None = Field(\n        default=None,\n        alias=\"valueSet\",\n        title=\"Select the contents included in this value set\",\n        description=(\n            \"Selects the concepts found in this value set (based on its value set \"\n            \"definition). This is an absolute URI that is a reference to \"\n            \"ValueSet.url.  If multiple value sets are specified this includes the \"\n            \"intersection of the contents of all of the referenced value sets.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"ValueSet\"],\n        },\n    )\n    valueSet__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None, alias=\"_valueSet\", title=\"Extension field for ``valueSet``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Specific version of the code system referred to\",\n        description=(\n            \"The version of the code system that the codes are selected from, or \"\n            \"the special version '*' for all versions.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetComposeInclude`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"system\",\n            \"version\",\n            \"concept\",\n            \"filter\",\n            \"valueSet\",\n            \"copyright\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetComposeInclude`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"system\", \"version\", \"filter\", \"valueSet\"]\n\n\nclass ValueSetComposeIncludeConcept(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    A concept defined in the system.\n    Specifies a concept to be included or excluded.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetComposeIncludeConcept\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code or expression from system\",\n        description=\"Specifies a code for the concept to be included or excluded.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    designation: typing.List[\n        fhirtypes.ValueSetComposeIncludeConceptDesignationType\n    ] | None = Field(\n        default=None,\n        alias=\"designation\",\n        title=\"Additional representations for this concept\",\n        description=(\n            \"Additional representations for this concept when used in this value \"\n            \"set - other languages, aliases, specialized purposes, used for \"\n            \"particular purposes, etc.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"Text to display for this code for this value set in this valueset\",\n        description=(\n            \"The text to display to the user for this concept in the context of \"\n            \"this valueset. If no display is provided, then applications using the \"\n            \"value set use the display specified for the code by the system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetComposeIncludeConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"display\",\n            \"designation\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeConcept`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass ValueSetComposeIncludeConceptDesignation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional representations for this concept.\n    Additional representations for this concept when used in this value set -\n    other languages, aliases, specialized purposes, used for particular\n    purposes, etc.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetComposeIncludeConceptDesignation\"\n\n    additionalUse: typing.List[fhirtypes.CodingType] | None = Field(\n        default=None,\n        alias=\"additionalUse\",\n        title=\"Additional ways how this designation would be used\",\n        description=(\n            \"Additional codes that detail how this designation would be used, if \"\n            \"there is more than one use.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    language: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"language\",\n        title=\"Human language of the designation\",\n        description=\"The language this designation is defined for.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    language__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_language\", title=\"Extension field for ``language``.\"\n    )\n\n    use: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"use\",\n        title=\"Types of uses of designations\",\n        description=\"A code that represents types of uses of designations.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"The text value for this designation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetComposeIncludeConceptDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"language\",\n            \"use\",\n            \"additionalUse\",\n            \"value\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeConceptDesignation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"value\", \"value__ext\")]\n        return required_fields\n\n\nclass ValueSetComposeIncludeFilter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Select codes/concepts by their properties (including relationships).\n    Select concepts by specifying a matching criterion based on the properties\n    (including relationships) defined by the system, or on filters defined by\n    the system. If multiple filters are specified within the include, they\n    SHALL all be true.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetComposeIncludeFilter\"\n\n    op: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"op\",\n        title=(\n            \"= | is-a | descendent-of | is-not-a | regex | in | not-in | \"\n            \"generalizes | child-of | descendent-leaf | exists\"\n        ),\n        description=\"The kind of operation to perform as a part of the filter criteria.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"=\",\n                \"is-a\",\n                \"descendent-of\",\n                \"is-not-a\",\n                \"regex\",\n                \"in\",\n                \"not-in\",\n                \"generalizes\",\n                \"child-of\",\n                \"descendent-leaf\",\n                \"exists\",\n            ],\n        },\n    )\n    op__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_op\", title=\"Extension field for ``op``.\"\n    )\n\n    property: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"A property/filter defined by the code system\",\n        description=(\n            \"A code that identifies a property or a filter defined in the code \"\n            \"system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    property__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_property\", title=\"Extension field for ``property``.\"\n    )\n\n    value: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"value\",\n        title=\"Code from the system, or regex criteria, or boolean value for exists\",\n        description=(\n            \"The match value may be either a code defined by the system, or a \"\n            \"string value, which is a regex match on the literal string of the \"\n            \"property value  (if the filter represents a property defined in \"\n            \"CodeSystem) or of the system filter value (if the filter represents a \"\n            \"filter defined in CodeSystem) when the operation is 'regex', or one of\"\n            \" the values (true and false), when the operation is 'exists'.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    value__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_value\", title=\"Extension field for ``value``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetComposeIncludeFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"property\", \"op\", \"value\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetComposeIncludeFilter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"property\", \"op\", \"value\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"op\", \"op__ext\"),\n            (\"property\", \"property__ext\"),\n            (\"value\", \"value__ext\"),\n        ]\n        return required_fields\n\n\nclass ValueSetExpansion(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Used when the value set is \"expanded\".\n    A value set can also be \"expanded\", where the value set is turned into a\n    simple collection of enumerated codes. This element holds the expansion, if\n    it has been performed.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetExpansion\"\n\n    contains: typing.List[fhirtypes.ValueSetExpansionContainsType] | None = Field(\n        default=None,\n        alias=\"contains\",\n        title=\"Codes in the value set\",\n        description=\"The codes that are contained in the value set expansion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identifier: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Identifies the value set expansion (business identifier)\",\n        description=(\n            \"An identifier that uniquely identifies this expansion of the valueset,\"\n            \" based on a unique combination of the provided parameters, the system \"\n            \"default parameters, and the underlying system code system versions \"\n            \"etc. Systems may re-use the same identifier as long as those factors \"\n            \"remain the same, and the expansion is the same, but are not required \"\n            \"to do so. This is a business identifier.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    identifier__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_identifier\", title=\"Extension field for ``identifier``.\"\n    )\n\n    next: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"next\",\n        title=\"Opaque urls for paging through expansion results\",\n        description=(\n            \"As per paging Search results, the next URLs are opaque to the client, \"\n            \"have no dictated structure, and only the server understands them.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    next__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_next\", title=\"Extension field for ``next``.\"\n    )\n\n    offset: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"offset\",\n        title=\"Offset at which this resource starts\",\n        description=(\n            \"If paging is being used, the offset at which this resource starts.  \"\n            \"I.e. this resource is a partial view into the expansion. If paging is \"\n            \"not being used, this element SHALL NOT be present.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    offset__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_offset\", title=\"Extension field for ``offset``.\"\n    )\n\n    parameter: typing.List[fhirtypes.ValueSetExpansionParameterType] | None = Field(\n        default=None,\n        alias=\"parameter\",\n        title=\"Parameter that controlled the expansion process\",\n        description=(\n            \"A parameter that controlled the expansion process. These parameters \"\n            \"may be used by users of expanded value sets to check whether the \"\n            \"expansion is suitable for a particular purpose, or to pick the correct\"\n            \" expansion.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    property: typing.List[fhirtypes.ValueSetExpansionPropertyType] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Additional information supplied about each concept\",\n        description=(\n            \"A property defines an additional slot through which additional \"\n            \"information can be provided about a concept.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    timestamp: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"timestamp\",\n        title=\"Time ValueSet expansion happened\",\n        description=\"The time at which the expansion was produced by the expanding system.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    timestamp__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_timestamp\", title=\"Extension field for ``timestamp``.\"\n    )\n\n    total: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"total\",\n        title=\"Total number of codes in the expansion\",\n        description=(\n            \"The total number of concepts in the expansion. If the number of \"\n            \"concept nodes in this resource is less than the stated number, then \"\n            \"the server can return more using the offset parameter.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    total__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_total\", title=\"Extension field for ``total``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetExpansion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"next\",\n            \"timestamp\",\n            \"total\",\n            \"offset\",\n            \"parameter\",\n            \"property\",\n            \"contains\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetExpansion`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"timestamp\", \"timestamp__ext\")]\n        return required_fields\n\n\nclass ValueSetExpansionContains(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Codes in the value set.\n    The codes that are contained in the value set expansion.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetExpansionContains\"\n\n    abstract: bool | None = Field(\n        default=None,\n        alias=\"abstract\",\n        title=\"If user cannot select this entry\",\n        description=(\n            \"If true, this entry is included in the expansion for navigational \"\n            \"purposes, and the user cannot select the code directly as a proper \"\n            \"value.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    abstract__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_abstract\", title=\"Extension field for ``abstract``.\"\n    )\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Code - if blank, this is not a selectable code\",\n        description=(\n            \"The code for this item in the expansion hierarchy. If this code is \"\n            \"missing the entry in the hierarchy is a place holder (abstract) and \"\n            \"does not represent a valid code in the value set.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    contains: typing.List[fhirtypes.ValueSetExpansionContainsType] | None = Field(\n        default=None,\n        alias=\"contains\",\n        title=\"Codes contained under this entry\",\n        description=\"Other codes and entries contained under this entry in the hierarchy.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    designation: typing.List[\n        fhirtypes.ValueSetComposeIncludeConceptDesignationType\n    ] | None = Field(\n        default=None,\n        alias=\"designation\",\n        title=\"Additional representations for this item\",\n        description=(\n            \"Additional representations for this item - other languages, aliases, \"\n            \"specialized purposes, used for particular purposes, etc. These are \"\n            \"relevant when the conditions of the expansion do not fix to a single \"\n            \"correct representation.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    display: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"display\",\n        title=\"User display for the concept\",\n        description=\"The recommended display for this item in the expansion.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    display__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_display\", title=\"Extension field for ``display``.\"\n    )\n\n    inactive: bool | None = Field(\n        default=None,\n        alias=\"inactive\",\n        title=\"If concept is inactive in the code system\",\n        description=(\n            \"If the concept is inactive in the code system that defines it. \"\n            \"Inactive codes are those that are no longer to be used, but are \"\n            \"maintained by the code system for understanding legacy data. It might \"\n            \"not be known or specified whether a concept is inactive (and it may \"\n            \"depend on the context of use).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    inactive__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_inactive\", title=\"Extension field for ``inactive``.\"\n    )\n\n    property: typing.List[\n        fhirtypes.ValueSetExpansionContainsPropertyType\n    ] | None = Field(\n        default=None,\n        alias=\"property\",\n        title=\"Property value for the concept\",\n        description=\"A property value for this concept.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    system: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"system\",\n        title=\"System value for the code\",\n        description=(\n            \"An absolute URI which is the code system in which the code for this \"\n            \"item in the expansion is defined.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    system__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_system\", title=\"Extension field for ``system``.\"\n    )\n\n    version: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"version\",\n        title=\"Version in which this code/display is defined\",\n        description=(\n            \"The version of the code system from this code was taken. Note that a \"\n            \"well-maintained code system does not need the version reported, \"\n            \"because the meaning of codes is consistent across versions. However \"\n            \"this cannot consistently be assured, and when the meaning is not \"\n            \"guaranteed to be consistent, the version SHOULD be exchanged.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    version__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_version\", title=\"Extension field for ``version``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetExpansionContains`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"system\",\n            \"abstract\",\n            \"inactive\",\n            \"version\",\n            \"code\",\n            \"display\",\n            \"designation\",\n            \"property\",\n            \"contains\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetExpansionContains`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n\nclass ValueSetExpansionContainsProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Property value for the concept.\n    A property value for this concept.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetExpansionContainsProperty\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Reference to ValueSet.expansion.property.code\",\n        description=\"A code that is a reference to ValueSet.expansion.property.code.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    subProperty: typing.List[\n        fhirtypes.ValueSetExpansionContainsPropertySubPropertyType\n    ] | None = Field(\n        default=None,\n        alias=\"subProperty\",\n        title=\"SubProperty value for the concept\",\n        description=\"A subproperty value for this concept.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of the property for this concept\",\n        description=\"The value of this property.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetExpansionContainsProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCode\",\n            \"valueCoding\",\n            \"valueString\",\n            \"valueInteger\",\n            \"valueBoolean\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n            \"subProperty\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetExpansionContainsProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueCoding\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ValueSetExpansionContainsPropertySubProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    SubProperty value for the concept.\n    A subproperty value for this concept.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetExpansionContainsPropertySubProperty\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=\"Reference to ValueSet.expansion.property.code\",\n        description=\"A code that is a reference to ValueSet.expansion.property.code.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of the subproperty for this concept\",\n        description=\"The value of this subproperty.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of the subproperty for this concept\",\n        description=\"The value of this subproperty.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueCoding: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"valueCoding\",\n        title=\"Value of the subproperty for this concept\",\n        description=\"The value of this subproperty.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of the subproperty for this concept\",\n        description=\"The value of this subproperty.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of the subproperty for this concept\",\n        description=\"The value of this subproperty.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of the subproperty for this concept\",\n        description=\"The value of this subproperty.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of the subproperty for this concept\",\n        description=\"The value of this subproperty.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": True,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetExpansionContainsPropertySubProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"code\",\n            \"valueCode\",\n            \"valueCoding\",\n            \"valueString\",\n            \"valueInteger\",\n            \"valueBoolean\",\n            \"valueDateTime\",\n            \"valueDecimal\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetExpansionContainsPropertySubProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueCoding\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueString\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ValueSetExpansionParameter(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Parameter that controlled the expansion process.\n    A parameter that controlled the expansion process. These parameters may be\n    used by users of expanded value sets to check whether the expansion is\n    suitable for a particular purpose, or to pick the correct expansion.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetExpansionParameter\"\n\n    name: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"name\",\n        title=\"Name as assigned by the client or server\",\n        description=(\n            \"Name of the input parameter to the $expand operation; may be a server-\"\n            \"assigned name for additional default or other server-supplied \"\n            \"parameters used to control the expansion process.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    name__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_name\", title=\"Extension field for ``name``.\"\n    )\n\n    valueBoolean: bool | None = Field(\n        default=None,\n        alias=\"valueBoolean\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueBoolean\",\n        title=\"Extension field for ``valueBoolean``.\",\n    )\n\n    valueCode: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"valueCode\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueCode__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueCode\", title=\"Extension field for ``valueCode``.\"\n    )\n\n    valueDateTime: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"valueDateTime\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDateTime\",\n        title=\"Extension field for ``valueDateTime``.\",\n    )\n\n    valueDecimal: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"valueDecimal\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueDecimal__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueDecimal\",\n        title=\"Extension field for ``valueDecimal``.\",\n    )\n\n    valueInteger: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"valueInteger\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueInteger__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_valueInteger\",\n        title=\"Extension field for ``valueInteger``.\",\n    )\n\n    valueString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"valueString\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueString\", title=\"Extension field for ``valueString``.\"\n    )\n\n    valueUri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"valueUri\",\n        title=\"Value of the named parameter\",\n        description=\"The value of the parameter.\",\n        json_schema_extra={\n            \"element_property\": True,\n            # Choice of Data Types. i.e value[x]\n            \"one_of_many\": \"value\",\n            \"one_of_many_required\": False,\n        },\n    )\n    valueUri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_valueUri\", title=\"Extension field for ``valueUri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetExpansionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"name\",\n            \"valueString\",\n            \"valueBoolean\",\n            \"valueInteger\",\n            \"valueDecimal\",\n            \"valueUri\",\n            \"valueCode\",\n            \"valueDateTime\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetExpansionParameter`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"name\", \"name__ext\")]\n        return required_fields\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"value\": [\n                \"valueBoolean\",\n                \"valueCode\",\n                \"valueDateTime\",\n                \"valueDecimal\",\n                \"valueInteger\",\n                \"valueString\",\n                \"valueUri\",\n            ]\n        }\n        return one_of_many_fields\n\n\nclass ValueSetExpansionProperty(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Additional information supplied about each concept.\n    A property defines an additional slot through which additional information\n    can be provided about a concept.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetExpansionProperty\"\n\n    code: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"code\",\n        title=(\n            \"Identifies the property on the concepts, and when referred to in \"\n            \"operations\"\n        ),\n        description=(\n            \"A code that is used to identify the property. The code is used in \"\n            \"ValueSet.expansion.contains.property.code.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    code__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_code\", title=\"Extension field for ``code``.\"\n    )\n\n    uri: fhirtypes.UriType | None = Field(\n        default=None,\n        alias=\"uri\",\n        title=\"Formal identifier for the property\",\n        description=(\n            \"Reference to the formal meaning of the property. One possible source \"\n            \"of meaning is the [Concept Properties](codesystem-concept-\"\n            \"properties.html) code system.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    uri__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_uri\", title=\"Extension field for ``uri``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetExpansionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"code\", \"uri\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetExpansionProperty`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"code\", \"code__ext\")]\n        return required_fields\n\n\nclass ValueSetScope(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Description of the semantic space the Value Set Expansion is intended to\n    cover and should further clarify the text in ValueSet.description.\n    \"\"\"\n\n    __resource_type__ = \"ValueSetScope\"\n\n    exclusionCriteria: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"exclusionCriteria\",\n        title=\"Criteria describing which concepts or codes should be excluded and why\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    exclusionCriteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_exclusionCriteria\",\n        title=\"Extension field for ``exclusionCriteria``.\",\n    )\n\n    inclusionCriteria: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"inclusionCriteria\",\n        title=\"Criteria describing which concepts or codes should be included and why\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    inclusionCriteria__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_inclusionCriteria\",\n        title=\"Extension field for ``inclusionCriteria``.\",\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``ValueSetScope`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"inclusionCriteria\",\n            \"exclusionCriteria\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``ValueSetScope`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/verificationresult.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/VerificationResult\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass VerificationResult(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Describes validation requirements, source(s), status and dates for one or\n    more elements.\n    \"\"\"\n\n    __resource_type__ = \"VerificationResult\"\n\n    attestation: fhirtypes.VerificationResultAttestationType | None = Field(\n        default=None,\n        alias=\"attestation\",\n        title=\"Information about the entity attesting to information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    failureAction: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"failureAction\",\n        title=\"fatal | warn | rec-only | none\",\n        description=\"The result if validation fails (fatal; warning; record only; none).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    frequency: fhirtypes.TimingType | None = Field(\n        default=None,\n        alias=\"frequency\",\n        title=\"Frequency of revalidation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lastPerformed: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"lastPerformed\",\n        title=(\n            \"The date/time validation was last completed (including failed \"\n            \"validations)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    lastPerformed__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_lastPerformed\",\n        title=\"Extension field for ``lastPerformed``.\",\n    )\n\n    need: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"need\",\n        title=\"none | initial | periodic\",\n        description=(\n            \"The frequency with which the target must be validated (none; initial; \"\n            \"periodic).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    nextScheduled: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"nextScheduled\",\n        title=\"The date when target is next validated, if appropriate\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    nextScheduled__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_nextScheduled\",\n        title=\"Extension field for ``nextScheduled``.\",\n    )\n\n    primarySource: typing.List[\n        fhirtypes.VerificationResultPrimarySourceType\n    ] | None = Field(\n        default=None,\n        alias=\"primarySource\",\n        title=\"Information about the primary source(s) involved in validation\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=(\n            \"attested | validated | in-process | req-revalid | val-fail | reval-\"\n            \"fail | entered-in-error\"\n        ),\n        description=(\n            \"The validation status of the target (attested; validated; in process; \"\n            \"requires revalidation; validation failed; revalidation failed).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\n                \"attested\",\n                \"validated\",\n                \"in-process\",\n                \"req-revalid\",\n                \"val-fail\",\n                \"reval-fail\",\n                \"entered-in-error\",\n            ],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    statusDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"statusDate\",\n        title=\"When the validation status was updated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    statusDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_statusDate\", title=\"Extension field for ``statusDate``.\"\n    )\n\n    target: typing.List[fhirtypes.ReferenceType] | None = Field(\n        default=None,\n        alias=\"target\",\n        title=\"A resource that was validated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Resource\"],\n        },\n    )\n\n    targetLocation: typing.List[fhirtypes.StringType | None] | None = Field(\n        default=None,\n        alias=\"targetLocation\",\n        title=\"The fhirpath location(s) within the resource that was validated\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    targetLocation__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_targetLocation\",\n        title=\"Extension field for ``targetLocation``.\",\n    )\n\n    validationProcess: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"validationProcess\",\n        title=(\n            \"The primary process by which the target is validated (edit check; \"\n            \"value set; primary source; multiple sources; standalone; in context)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    validationType: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"validationType\",\n        title=\"nothing | primary | multiple\",\n        description=(\n            \"What the target is validated against (nothing; primary source; \"\n            \"multiple sources).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    validator: typing.List[fhirtypes.VerificationResultValidatorType] | None = Field(\n        default=None,\n        alias=\"validator\",\n        title=\"Information about the entity validating information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VerificationResult`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"target\",\n            \"targetLocation\",\n            \"need\",\n            \"status\",\n            \"statusDate\",\n            \"validationType\",\n            \"validationProcess\",\n            \"frequency\",\n            \"lastPerformed\",\n            \"nextScheduled\",\n            \"failureAction\",\n            \"primarySource\",\n            \"attestation\",\n            \"validator\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VerificationResult`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"target\",\n            \"targetLocation\",\n            \"need\",\n            \"status\",\n            \"statusDate\",\n            \"validationType\",\n            \"validationProcess\",\n            \"failureAction\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"status\", \"status__ext\")]\n        return required_fields\n\n\nclass VerificationResultAttestation(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the entity attesting to information.\n    \"\"\"\n\n    __resource_type__ = \"VerificationResultAttestation\"\n\n    communicationMethod: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"communicationMethod\",\n        title=\"The method by which attested information was submitted/retrieved\",\n        description=(\n            \"The method by which attested information was submitted/retrieved \"\n            \"(manual; API; Push).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    date: fhirtypes.DateType | None = Field(\n        default=None,\n        alias=\"date\",\n        title=\"The date the information was attested to\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    date__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_date\", title=\"Extension field for ``date``.\"\n    )\n\n    onBehalfOf: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"onBehalfOf\",\n        title=(\n            \"When the who is asserting on behalf of another (organization or \"\n            \"individual)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    proxyIdentityCertificate: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"proxyIdentityCertificate\",\n        title=(\n            \"A digital identity certificate associated with the proxy entity \"\n            \"submitting attested information on behalf of the attestation source\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    proxyIdentityCertificate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_proxyIdentityCertificate\",\n        title=\"Extension field for ``proxyIdentityCertificate``.\",\n    )\n\n    proxySignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"proxySignature\",\n        title=\"Proxy signature (digital or image)\",\n        description=(\n            \"Signed assertion by the proxy entity indicating that they have the \"\n            \"right to submit attested information on behalf of the attestation \"\n            \"source.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    sourceIdentityCertificate: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sourceIdentityCertificate\",\n        title=\"A digital identity certificate associated with the attestation source\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sourceIdentityCertificate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_sourceIdentityCertificate\",\n        title=\"Extension field for ``sourceIdentityCertificate``.\",\n    )\n\n    sourceSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"sourceSignature\",\n        title=\"Attester signature (digital or image)\",\n        description=(\n            \"Signed assertion by the attestation source that they have attested to \"\n            \"the information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    who: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"who\",\n        title=\"The individual or organization attesting to information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Practitioner\",\n                \"PractitionerRole\",\n                \"Organization\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VerificationResultAttestation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"who\",\n            \"onBehalfOf\",\n            \"communicationMethod\",\n            \"date\",\n            \"sourceIdentityCertificate\",\n            \"proxyIdentityCertificate\",\n            \"proxySignature\",\n            \"sourceSignature\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VerificationResultAttestation`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"who\", \"onBehalfOf\", \"communicationMethod\", \"date\"]\n\n\nclass VerificationResultPrimarySource(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the primary source(s) involved in validation.\n    \"\"\"\n\n    __resource_type__ = \"VerificationResultPrimarySource\"\n\n    canPushUpdates: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"canPushUpdates\",\n        title=\"yes | no | undetermined\",\n        description=(\n            \"Ability of the primary source to push updates/alerts (yes; no; \"\n            \"undetermined).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    communicationMethod: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"communicationMethod\",\n        title=\"Method for exchanging information with the primary source\",\n        description=\"Method for communicating with the primary source (manual; API; Push).\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    pushTypeAvailable: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"pushTypeAvailable\",\n        title=\"specific | any | source\",\n        description=(\n            \"Type of alerts/updates the primary source can send (specific requested\"\n            \" changes; any changes; as defined by source).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    type: typing.List[fhirtypes.CodeableConceptType] | None = Field(\n        default=None,\n        alias=\"type\",\n        title=(\n            \"Type of primary source (License Board; Primary Education; Continuing \"\n            \"Education; Postal Service; Relationship owner; Registration Authority;\"\n            \" legal source; issuing source; authoritative source)\"\n        ),\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    validationDate: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"validationDate\",\n        title=\"When the target was validated against the primary source\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    validationDate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_validationDate\",\n        title=\"Extension field for ``validationDate``.\",\n    )\n\n    validationStatus: fhirtypes.CodeableConceptType | None = Field(\n        default=None,\n        alias=\"validationStatus\",\n        title=\"successful | failed | unknown\",\n        description=(\n            \"Status of the validation of the target against the primary source \"\n            \"(successful; failed; unknown).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    who: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"who\",\n        title=\"Reference to the primary source\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\n                \"Organization\",\n                \"Practitioner\",\n                \"PractitionerRole\",\n            ],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VerificationResultPrimarySource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"who\",\n            \"type\",\n            \"communicationMethod\",\n            \"validationStatus\",\n            \"validationDate\",\n            \"canPushUpdates\",\n            \"pushTypeAvailable\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VerificationResultPrimarySource`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"type\", \"communicationMethod\", \"canPushUpdates\"]\n\n\nclass VerificationResultValidator(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Information about the entity validating information.\n    \"\"\"\n\n    __resource_type__ = \"VerificationResultValidator\"\n\n    attestationSignature: fhirtypes.SignatureType | None = Field(\n        default=None,\n        alias=\"attestationSignature\",\n        title=\"Validator signature (digital or image)\",\n        description=(\n            \"Signed assertion by the validator that they have validated the \"\n            \"information.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    identityCertificate: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"identityCertificate\",\n        title=\"A digital identity certificate associated with the validator\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    identityCertificate__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_identityCertificate\",\n        title=\"Extension field for ``identityCertificate``.\",\n    )\n\n    organization: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"organization\",\n        title=\"Reference to the organization validating information\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Organization\"],\n        },\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VerificationResultValidator`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"organization\",\n            \"identityCertificate\",\n            \"attestationSignature\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VerificationResultValidator`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n"
  },
  {
    "path": "fhir/resources/virtualservicedetail.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/VirtualServiceDetail\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import datatype, fhirtypes\n\n\nclass VirtualServiceDetail(datatype.DataType):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Virtual Service Contact Details.\n    \"\"\"\n\n    __resource_type__ = \"VirtualServiceDetail\"\n\n    additionalInfo: typing.List[fhirtypes.UrlType | None] | None = Field(\n        default=None,\n        alias=\"additionalInfo\",\n        title=\"Address to see alternative connection details\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    additionalInfo__ext: typing.List[\n        fhirtypes.FHIRPrimitiveExtensionType | None\n    ] | None = Field(\n        default=None,\n        alias=\"_additionalInfo\",\n        title=\"Extension field for ``additionalInfo``.\",\n    )\n\n    addressContactPoint: fhirtypes.ContactPointType | None = Field(\n        default=None,\n        alias=\"addressContactPoint\",\n        title=\"Contact address/number\",\n        description=(\n            \"What address or number needs to be used for a user to connect to the \"\n            \"virtual service to join. The channelType informs as to which datatype \"\n            \"is appropriate to use (requires knowledge of the specific type).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e address[x]\n            \"one_of_many\": \"address\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    addressExtendedContactDetail: fhirtypes.ExtendedContactDetailType | None = Field(\n        default=None,\n        alias=\"addressExtendedContactDetail\",\n        title=\"Contact address/number\",\n        description=(\n            \"What address or number needs to be used for a user to connect to the \"\n            \"virtual service to join. The channelType informs as to which datatype \"\n            \"is appropriate to use (requires knowledge of the specific type).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e address[x]\n            \"one_of_many\": \"address\",\n            \"one_of_many_required\": False,\n        },\n    )\n\n    addressString: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"addressString\",\n        title=\"Contact address/number\",\n        description=(\n            \"What address or number needs to be used for a user to connect to the \"\n            \"virtual service to join. The channelType informs as to which datatype \"\n            \"is appropriate to use (requires knowledge of the specific type).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e address[x]\n            \"one_of_many\": \"address\",\n            \"one_of_many_required\": False,\n        },\n    )\n    addressString__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_addressString\",\n        title=\"Extension field for ``addressString``.\",\n    )\n\n    addressUrl: fhirtypes.UrlType | None = Field(\n        default=None,\n        alias=\"addressUrl\",\n        title=\"Contact address/number\",\n        description=(\n            \"What address or number needs to be used for a user to connect to the \"\n            \"virtual service to join. The channelType informs as to which datatype \"\n            \"is appropriate to use (requires knowledge of the specific type).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # Choice of Data Types. i.e address[x]\n            \"one_of_many\": \"address\",\n            \"one_of_many_required\": False,\n        },\n    )\n    addressUrl__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_addressUrl\", title=\"Extension field for ``addressUrl``.\"\n    )\n\n    channelType: fhirtypes.CodingType | None = Field(\n        default=None,\n        alias=\"channelType\",\n        title=\"Channel Type\",\n        description=(\n            \"The type of virtual service to connect to (i.e. Teams, Zoom, Specific \"\n            \"VMR technology, WhatsApp).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    maxParticipants: fhirtypes.PositiveIntType | None = Field(\n        default=None,\n        alias=\"maxParticipants\",\n        title=\"Maximum number of participants supported by the virtual service\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    maxParticipants__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None,\n        alias=\"_maxParticipants\",\n        title=\"Extension field for ``maxParticipants``.\",\n    )\n\n    sessionKey: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"sessionKey\",\n        title=\"Session Key required by the virtual service\",\n        description=None,\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n    sessionKey__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sessionKey\", title=\"Extension field for ``sessionKey``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VirtualServiceDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"channelType\",\n            \"addressUrl\",\n            \"addressString\",\n            \"addressContactPoint\",\n            \"addressExtendedContactDetail\",\n            \"additionalInfo\",\n            \"maxParticipants\",\n            \"sessionKey\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VirtualServiceDetail`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"channelType\",\n            \"addressUrl\",\n            \"addressString\",\n            \"addressContactPoint\",\n            \"addressExtendedContactDetail\",\n            \"additionalInfo\",\n            \"maxParticipants\",\n            \"sessionKey\",\n        ]\n\n    def get_one_of_many_fields(self) -> typing.Dict[str, typing.List[str]]:\n        \"\"\"https://www.hl7.org/fhir/formats.html#choice\n        A few elements have a choice of more than one data type for their content.\n        All such elements have a name that takes the form nnn[x].\n        The \"nnn\" part of the name is constant, and the \"[x]\" is replaced with\n        the title-cased name of the type that is actually used.\n        The table view shows each of these names explicitly.\n\n        Elements that have a choice of data type cannot repeat - they must have a\n        maximum cardinality of 1. When constructing an instance of an element with a\n        choice of types, the authoring system must create a single element with a\n        data type chosen from among the list of permitted data types.\n        \"\"\"\n        one_of_many_fields = {\n            \"address\": [\n                \"addressContactPoint\",\n                \"addressExtendedContactDetail\",\n                \"addressString\",\n                \"addressUrl\",\n            ]\n        }\n        return one_of_many_fields\n"
  },
  {
    "path": "fhir/resources/visionprescription.py",
    "content": "\"\"\"\nProfile: http://hl7.org/fhir/StructureDefinition/VisionPrescription\nRelease: R5\nVersion: 5.0.0\nBuild ID: 2aecd53\nLast updated: 2023-03-26T15:21:02.749+11:00\n\"\"\"\n\nfrom __future__ import annotations as _annotations\n\nimport typing\n\nfrom pydantic import Field\n\nfrom . import backboneelement, domainresource, fhirtypes\n\n\nclass VisionPrescription(domainresource.DomainResource):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Prescription for vision correction products for a patient.\n    An authorization for the provision of glasses and/or contact lenses to a\n    patient.\n    \"\"\"\n\n    __resource_type__ = \"VisionPrescription\"\n\n    created: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"created\",\n        title=\"Response creation date\",\n        description=\"The date this resource was created.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    created__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_created\", title=\"Extension field for ``created``.\"\n    )\n\n    dateWritten: fhirtypes.DateTimeType | None = Field(\n        default=None,\n        alias=\"dateWritten\",\n        title=\"When prescription was authorized\",\n        description=\"The date (and perhaps time) when the prescription was written.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    dateWritten__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_dateWritten\", title=\"Extension field for ``dateWritten``.\"\n    )\n\n    encounter: fhirtypes.ReferenceType | None = Field(\n        default=None,\n        alias=\"encounter\",\n        title=\"Created during encounter / admission / stay\",\n        description=(\n            \"A reference to a resource that identifies the particular occurrence of\"\n            \" contact between patient and health care provider during which the \"\n            \"prescription was issued.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Encounter\"],\n        },\n    )\n\n    identifier: typing.List[fhirtypes.IdentifierType] | None = Field(\n        default=None,\n        alias=\"identifier\",\n        title=\"Business Identifier for vision prescription\",\n        description=\"A unique identifier assigned to this vision prescription.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    lensSpecification: typing.List[\n        fhirtypes.VisionPrescriptionLensSpecificationType\n    ] = Field(\n        default=...,\n        alias=\"lensSpecification\",\n        title=\"Vision lens authorization\",\n        description=(\n            \"Contain the details of  the individual lens specifications and serves \"\n            \"as the authorization for the fullfillment by certified professionals.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    patient: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"patient\",\n        title=\"Who prescription is for\",\n        description=(\n            \"A resource reference to the person to whom the vision prescription \"\n            \"applies.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Patient\"],\n        },\n    )\n\n    prescriber: fhirtypes.ReferenceType = Field(\n        default=...,\n        alias=\"prescriber\",\n        title=\"Who authorized the vision prescription\",\n        description=(\n            \"The healthcare professional responsible for authorizing the \"\n            \"prescription.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            # note: Listed Resource Type(s) should be allowed as Reference.\n            \"enum_reference_types\": [\"Practitioner\", \"PractitionerRole\"],\n        },\n    )\n\n    status: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"status\",\n        title=\"active | cancelled | draft | entered-in-error\",\n        description=\"The status of the resource instance.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"active\", \"cancelled\", \"draft\", \"entered-in-error\"],\n        },\n    )\n    status__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_status\", title=\"Extension field for ``status``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VisionPrescription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"language\",\n            \"text\",\n            \"contained\",\n            \"extension\",\n            \"modifierExtension\",\n            \"identifier\",\n            \"status\",\n            \"created\",\n            \"patient\",\n            \"encounter\",\n            \"dateWritten\",\n            \"prescriber\",\n            \"lensSpecification\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VisionPrescription`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"meta\",\n            \"implicitRules\",\n            \"modifierExtension\",\n            \"status\",\n            \"created\",\n            \"patient\",\n            \"dateWritten\",\n            \"prescriber\",\n            \"lensSpecification\",\n        ]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [\n            (\"created\", \"created__ext\"),\n            (\"dateWritten\", \"dateWritten__ext\"),\n            (\"status\", \"status__ext\"),\n        ]\n        return required_fields\n\n\nclass VisionPrescriptionLensSpecification(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Vision lens authorization.\n    Contain the details of  the individual lens specifications and serves as\n    the authorization for the fullfillment by certified professionals.\n    \"\"\"\n\n    __resource_type__ = \"VisionPrescriptionLensSpecification\"\n\n    add: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"add\",\n        title=\"Added power for multifocal levels\",\n        description=(\n            \"Power adjustment for multifocal lenses measured in dioptres (0.25 \"\n            \"units).\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    add__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_add\", title=\"Extension field for ``add``.\"\n    )\n\n    axis: fhirtypes.IntegerType | None = Field(\n        default=None,\n        alias=\"axis\",\n        title=\"Lens meridian which contain no power for astigmatism\",\n        description=\"Adjustment for astigmatism measured in integer degrees.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    axis__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_axis\", title=\"Extension field for ``axis``.\"\n    )\n\n    backCurve: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"backCurve\",\n        title=\"Contact lens back curvature\",\n        description=\"Back curvature measured in millimetres.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    backCurve__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_backCurve\", title=\"Extension field for ``backCurve``.\"\n    )\n\n    brand: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"brand\",\n        title=\"Brand required\",\n        description=\"Brand recommendations or restrictions.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    brand__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_brand\", title=\"Extension field for ``brand``.\"\n    )\n\n    color: fhirtypes.StringType | None = Field(\n        default=None,\n        alias=\"color\",\n        title=\"Color required\",\n        description=\"Special color or pattern.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    color__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_color\", title=\"Extension field for ``color``.\"\n    )\n\n    cylinder: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"cylinder\",\n        title=\"Lens power for astigmatism\",\n        description=\"Power adjustment for astigmatism measured in dioptres (0.25 units).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    cylinder__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_cylinder\", title=\"Extension field for ``cylinder``.\"\n    )\n\n    diameter: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"diameter\",\n        title=\"Contact lens diameter\",\n        description=\"Contact lens diameter measured in millimetres.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    diameter__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_diameter\", title=\"Extension field for ``diameter``.\"\n    )\n\n    duration: fhirtypes.QuantityType | None = Field(\n        default=None,\n        alias=\"duration\",\n        title=\"Lens wear duration\",\n        description=\"The recommended maximum wear period for the lens.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    eye: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"eye\",\n        title=\"right | left\",\n        description=\"The eye for which the lens specification applies.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"right\", \"left\"],\n        },\n    )\n    eye__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_eye\", title=\"Extension field for ``eye``.\"\n    )\n\n    note: typing.List[fhirtypes.AnnotationType] | None = Field(\n        default=None,\n        alias=\"note\",\n        title=\"Notes for coatings\",\n        description=\"Notes for special requirements such as coatings and lens materials.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    power: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"power\",\n        title=\"Contact lens power\",\n        description=\"Contact lens power measured in dioptres (0.25 units).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    power__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_power\", title=\"Extension field for ``power``.\"\n    )\n\n    prism: typing.List[\n        fhirtypes.VisionPrescriptionLensSpecificationPrismType\n    ] | None = Field(\n        default=None,\n        alias=\"prism\",\n        title=\"Eye alignment compensation\",\n        description=\"Allows for adjustment on two axis.\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n\n    product: fhirtypes.CodeableConceptType = Field(\n        default=...,\n        alias=\"product\",\n        title=\"Product to be supplied\",\n        description=(\n            \"Identifies the type of vision correction product which is required for\"\n            \" the patient.\"\n        ),\n        json_schema_extra={\n            \"element_property\": True,\n            \"summary_element_property\": True,\n        },\n    )\n\n    sphere: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"sphere\",\n        title=\"Power of the lens\",\n        description=\"Lens power measured in dioptres (0.25 units).\",\n        json_schema_extra={\n            \"element_property\": True,\n        },\n    )\n    sphere__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_sphere\", title=\"Extension field for ``sphere``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VisionPrescriptionLensSpecification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\n            \"id\",\n            \"extension\",\n            \"modifierExtension\",\n            \"product\",\n            \"eye\",\n            \"sphere\",\n            \"cylinder\",\n            \"axis\",\n            \"prism\",\n            \"add\",\n            \"power\",\n            \"backCurve\",\n            \"diameter\",\n            \"duration\",\n            \"color\",\n            \"brand\",\n            \"note\",\n        ]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VisionPrescriptionLensSpecification`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\", \"product\", \"eye\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"eye\", \"eye__ext\")]\n        return required_fields\n\n\nclass VisionPrescriptionLensSpecificationPrism(backboneelement.BackboneElement):\n    \"\"\"Disclaimer: Any field name ends with ``__ext`` doesn't part of\n    Resource StructureDefinition, instead used to enable Extensibility feature\n    for FHIR Primitive Data Types.\n\n    Eye alignment compensation.\n    Allows for adjustment on two axis.\n    \"\"\"\n\n    __resource_type__ = \"VisionPrescriptionLensSpecificationPrism\"\n\n    amount: fhirtypes.DecimalType | None = Field(\n        default=None,\n        alias=\"amount\",\n        title=\"Amount of adjustment\",\n        description=\"Amount of prism to compensate for eye alignment in fractional units.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n        },\n    )\n    amount__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_amount\", title=\"Extension field for ``amount``.\"\n    )\n\n    base: fhirtypes.CodeType | None = Field(\n        default=None,\n        alias=\"base\",\n        title=\"up | down | in | out\",\n        description=\"The relative base, or reference lens edge, for the prism.\",\n        json_schema_extra={\n            \"element_property\": True,\n            \"element_required\": True,\n            # note: Enum values can be used in validation,\n            # but use in your own responsibilities, read official FHIR documentation.\n            \"enum_values\": [\"up\", \"down\", \"in\", \"out\"],\n        },\n    )\n    base__ext: fhirtypes.FHIRPrimitiveExtensionType | None = Field(\n        default=None, alias=\"_base\", title=\"Extension field for ``base``.\"\n    )\n\n    @classmethod\n    def elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names from\n        ``VisionPrescriptionLensSpecificationPrism`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"id\", \"extension\", \"modifierExtension\", \"amount\", \"base\"]\n\n    @classmethod\n    def summary_elements_sequence(cls) -> typing.List[str]:\n        \"\"\"returning all element names (those have summary mode are enabled) from ``VisionPrescriptionLensSpecificationPrism`` according to specification,\n        with preserving the original sequence order.\n        \"\"\"\n        return [\"modifierExtension\"]\n\n    def get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n        \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n        In some cases, implementers might find that they do not have appropriate data for\n        an element with minimum cardinality = 1. In this case, the element must be present,\n        but unless the resource or a profile on it has made the actual value of the primitive\n        data type mandatory, it is possible to provide an extension that explains why\n        the primitive value is not present.\n        \"\"\"\n        required_fields = [(\"amount\", \"amount__ext\"), (\"base\", \"base__ext\")]\n        return required_fields\n"
  },
  {
    "path": "pyproject.toml",
    "content": "[build-system]\n# Minimum requirements for the build system to execute.\nrequires = [\"setuptools\", \"wheel\"]  # PEP 508 specifications.\n\n[tool.black]\nline-length = 88\ntarget-version = ['py38']\ninclude = '\\.pyi?$'\nexclude = '''\n/(\n    \\.git\n  | \\.hg\n  | \\.mypy_cache\n  | \\.tox\n  | \\.venv\n  | _build\n  | buck-out\n  | build\n  | dist\n\n  # The following are specific to Black, you probably don't want those.\n  | blib2to3\n  | tests/data\n)/\n'''\n\n[tool.pytest.ini_options]\nminversion = \"7.0\"\n"
  },
  {
    "path": "script/base_local.py",
    "content": "import os\nimport pathlib\n\nRESOURCE_TARGET_DIRECTORY = (\n    pathlib.Path(os.path.abspath(__file__)).parents[2] / \"fhir\" / \"resources\"\n)\nUNITTEST_TARGET_DIRECTORY = RESOURCE_TARGET_DIRECTORY / \"tests\"\n#FHIR_EXAMPLE_DIRECTORY = (\n#    pathlib.Path(os.path.abspath(__file__)).parents[2]\n#    / \"script\"\n#    / \"static\"\n#    / \"examples-json\"\n#    / \"R4B\"\n#)\n"
  },
  {
    "path": "script/generate.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n#  Download and parse FHIR resource definitions\n#  Supply \"-f\" to force a redownload of the spec\n#  Supply \"-c\" to force using the cached spec (incompatible with \"-f\")\n#  Supply \"-d\" to load and parse but not write resources\n#  Supply \"-l\" to only download the spec\nimport ast\nfrom distutils.version import StrictVersion\nimport configparser\nimport pathlib\nimport requests\nimport os\nimport subprocess\nimport shutil\nimport sys\n\n\nSRC_BASE_PATH = pathlib.Path(os.path.abspath(__file__)).parents[1] / 'fhir' / 'resources'\nPARSER_BASE_PATH = pathlib.Path(os.path.abspath(__file__)).parents[1] / 'fhir-parser'\nPARSER_CACHE_DIR = PARSER_BASE_PATH / 'downloads'\nSCRIPT_BASE_PATH = pathlib.Path(os.path.abspath(__file__)).parents[1] / 'script'\n\n\ndef get_current_version():\n    \"\"\" \"\"\"\n    version_file = str(SRC_BASE_PATH / '__init__.py')\n    with open(str(SRC_BASE_PATH / '__init__.py'), 'r', encoding='utf-8') as fd:\n\n        for line in fd:\n            if '__version__' in line:\n                version = StrictVersion(ast.literal_eval(line.split('=')[1].strip()))\n                sys.stdout.write(f'Version `{version}` at {version_file}\\n')\n                return version\n\n\ndef get_cached_version_info():\n    \"\"\" \"\"\"\n    if not PARSER_CACHE_DIR.exists():\n        return\n    version_file = PARSER_CACHE_DIR / 'version.info'\n\n    if not version_file.exists():\n        return\n\n    config = configparser.ConfigParser()\n\n    with open(str(version_file), 'r') as fp:\n        txt = fp.read()\n        config.read_string('\\n'.join(txt.split('\\n')[1:]))\n\n    return config['FHIR']['version'], config['FHIR']['fhirversion']\n\n\ndef get_fhir_version_info():\n    \"\"\" \"\"\"\n    try:\n        response = requests.get(settings.specification_url + '/version.info')\n        text = response.text\n        config = configparser.ConfigParser()\n\n        config.read_string('\\r'.join(text.split('\\r')[1:]))\n\n        return config['FHIR']['version'], config['FHIR']['fhirversion']\n\n    except requests.HTTPError as exc:\n        sys.stderr.write(str(exc))\n        return None\n\n\ndef update_pytest_fixture(version):\n    \"\"\" \"\"\"\n    lines = list()\n    fixture_file = SRC_BASE_PATH / version / 'tests' / 'fixtures.py'\n    with open(str(fixture_file), 'r', encoding='utf-8') as fp:\n        for line in fp:\n            if 'ROOT_PATH =' in line:\n                parts = list()\n                parts.append(line.split('=')[0])\n                parts.append(\"dirname(dirname(dirname(dirname(dirname(os.path.abspath(__file__))))))\\n\")\n                line = '= '.join(parts)\n\n            elif 'CACHE_PATH =' in line:\n                parts = list()\n                parts.append(line.split('=')[0])\n                parts.append(f\"os.path.join(ROOT_PATH, '.cache', '{version}')\\n\")\n                line = '= '.join(parts)\n\n            elif 'example_data_file_uri =' in line:\n\n                parts = list()\n                parts.append(line.split('=')[0])\n                parts.append(f\"'/'.join([settings['base_url'], '{version}', 'examples-json.zip'])\\n\")\n                line = '= '.join(parts)\n\n            lines.append(line)\n\n    # let's write\n    fixture_file.write_text(''.join(lines))\n\n    with open(str(SRC_BASE_PATH / version / 'tests' / 'conftest.py'), 'w', encoding='utf-8') as fp:\n        fp.write(\n            \"# _*_ coding: utf-8 _*_\\n\"\n            f\"pytest_plugins = ['fhir.resources.{version}.tests.fixtures']\\n\")\n\n\ndef main():\n    \"\"\" \"\"\"\n    if str(PARSER_BASE_PATH) not in sys.path:\n        sys.path.append(str(PARSER_BASE_PATH))\n\n    args = [f'{PARSER_BASE_PATH}/generate.py'] + sys.argv[1:]\n    shutil.copy(str(SCRIPT_BASE_PATH / 'base_local.py'), str(PARSER_BASE_PATH / \"config\" / \"base_local.py\"))\n    try:\n        subprocess.check_call(args=args, cwd=str(PARSER_BASE_PATH))\n    except subprocess.CalledProcessError as exc:\n        sys.stderr.write(str(exc) + '\\n')\n        return 1\n\n    return 0\n\n\nif '__main__' == __name__:\n    \"\"\" \"\"\"\n    try:\n        sys.exit(main())\n    except KeyboardInterrupt as exc:\n        sys.stdout.write(str(exc))\n        sys.exit(0)\n\n"
  },
  {
    "path": "script/static/.gitignore",
    "content": "*\n!.gitignore\n"
  },
  {
    "path": "setup.cfg",
    "content": "[bdist_wheel]\nuniversal = 1\n\n[aliases]\n# Define setup.py command aliases here\ntest = pytest\n\n[metadata]\nname = \"fhir.resources\"\nversion = \"8.2.1\"\nlicense-files=\"LICENSE\"\nlong_description_content_type=text/x-rst\n\n[zest.releaser]\ncreate-wheel = yes\nregister = no\n\n"
  },
  {
    "path": "setup.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"The setup script.\"\"\"\n\nimport platform\n\nfrom setuptools import find_namespace_packages, setup\n\nPY_VERSION_TUPLE = platform.python_version_tuple()\nPY_VERSION_9_OR_EARLIER = PY_VERSION_TUPLE[0] == \"3\" and int(PY_VERSION_TUPLE[1]) <= 9\nPY_VERSION_10_OR_LATER = PY_VERSION_TUPLE[0] == \"3\" and int(PY_VERSION_TUPLE[1]) >= 10\nPY_VERSION_11_OR_LATER = PY_VERSION_10_OR_LATER and int(PY_VERSION_TUPLE[1]) >= 11\n\nwith open(\"README.rst\") as readme_file:\n    readme = readme_file.read()\n\nwith open(\"HISTORY.rst\") as history_file:\n    history = history_file.read()\n\nrequirements = [\"fhir-core>=1.1.7\"]\nif PY_VERSION_9_OR_EARLIER:\n    requirements.append(\"eval-type-backport\")\n\nsetup_requirements = [\"pytest-runner\"]\n\nyaml_requirements = [\"PyYAML>=5.4.1\"]\n\nxml_requirements = [\"lxml\"]\n\ntest_requirements = [\n    \"coverage\",\n    \"pytest>5.4.0;python_version>='3.6'\",\n    \"pytest-cov>=2.10.0;python_version>='3.6'\",\n    \"flake8\" + (PY_VERSION_10_OR_LATER and \"==7.3.0\" or \"==5.0.4;python_version<'3.10'\"),\n    \"flake8-isort\"\n    + (PY_VERSION_10_OR_LATER and \">=6.0.0\" or \"==4.2.0;python_version<'3.10'\"),\n    \"flake8-bugbear\"\n    + (PY_VERSION_10_OR_LATER and \">=22.12.6\" or \"==20.1.4;python_version<'3.10'\"),\n    \"requests==2.32.4\",\n    \"isort\" + (PY_VERSION_10_OR_LATER and \">=5.11.4\" or \"==4.3.21\"),\n    \"black>=23.0,<24.0; python_version >= '3.7'\",\n    \"mypy\",\n    \"types-PyYAML\",\n    \"types-simplejson\",\n    \"types-requests\",\n    \"setuptools==65.6.3;python_version>='3.7'\",\n]\nif PY_VERSION_10_OR_LATER:\n    test_requirements.append(\"importlib-metadata>=5.2.0\")\n\ndevelopment_requirements = [\n    \"Jinja2==3.1.6\",\n    \"MarkupSafe==2.1.5\",\n    \"colorlog==2.10.0\",\n    \"certifi\",\n    \"fhirspec>=0.6.0\",\n    \"zest-releaser[recommended]\",\n    \"twine==6.1.0\",\n]\nsetup(\n    author=\"Md Nazrul Islam\",\n    author_email=\"email2nazrul@gmail.com\",\n    # Get more from https://pypi.org/pypi?%3Aaction=list_classifiers\n    classifiers=[\n        \"Development Status :: 5 - Production/Stable\",\n        \"Intended Audience :: Developers\",\n        \"License :: OSI Approved :: BSD License\",\n        \"Natural Language :: English\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3 :: Only\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3.10\",\n        \"Programming Language :: Python :: 3.11\",\n        \"Programming Language :: Python :: 3.12\",\n        \"Programming Language :: Python :: 3.13\",\n        \"Programming Language :: Python :: 3.14\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Education\",\n        \"Intended Audience :: Healthcare Industry\",\n        \"Intended Audience :: Information Technology\",\n        \"Intended Audience :: Science/Research\",\n        \"Operating System :: OS Independent\",\n        \"Typing :: Typed\",\n    ],\n    description=\"FHIR Resources as Model Class\",\n    install_requires=requirements,\n    license=\"BSD license\",\n    long_description=readme + \"\\n\\n\" + history,\n    include_package_data=True,\n    keywords=\"fhir, resources, python, hl7, health IT, healthcare\",\n    name=\"fhir.resources\",\n    packages=find_namespace_packages(\n        include=[\"fhir*\"],\n        exclude=[\n            \"ez_setup\",\n            \"tests\",\n            \"fhir-parser*\",\n            \"fhir.resources.tests\",\n            \"fhir.resources.STU3.tests\",\n            \"fhir.resources.R4B.tests\",\n        ],\n    ),\n    package_data={\"fhir.resources\": [\"py.typed\"]},\n    setup_requires=setup_requirements,\n    test_suite=\"tests\",\n    tests_require=test_requirements,\n    extras_require={\n        \"yaml\": yaml_requirements,\n        \"xml\": xml_requirements,\n        \"test\": (\n            test_requirements\n            + setup_requirements\n            + yaml_requirements\n            + xml_requirements\n        ),\n        \"dev\": (test_requirements + development_requirements),\n        \"all\": (yaml_requirements + xml_requirements),\n    },\n    url=\"https://github.com/nazrulworld/fhir.resources\",\n    version=\"8.2.1.dev0\",\n    zip_safe=False,\n    python_requires=\">=3.8\",\n    project_urls={\n        \"CI: Travis\": \"https://travis-ci.org/github/nazrulworld/fhir.resources\",\n        \"Coverage: codecov\": \"https://codecov.io/gh/nazrulworld/fhir.resources\",\n        \"GitHub: issues\": \"https://github.com/nazrulworld/fhir.resources/issues\",\n        \"GitHub: repo\": \"https://github.com/nazrulworld/fhir.resources\",\n    },\n)\n"
  },
  {
    "path": "tests/__init__.py",
    "content": "\"\"\"Testing related to custom features\"\"\"\n"
  },
  {
    "path": "tests/conftest.py",
    "content": "import os\nimport pathlib\nfrom os.path import dirname\n\nTESTS_ROOT_PATH = pathlib.Path(dirname(os.path.abspath(__file__)))\nSTATIC_PATH = TESTS_ROOT_PATH / \"static\"\nFHIR_XSD_DIR = STATIC_PATH / \"xsd\" / \"fhir\"\nIS_TRAVIS = \"TRAVIS\" in os.environ\n"
  },
  {
    "path": "tests/patch_r4b_test.py",
    "content": "# -*- coding: utf-8 -*-\nimport typing\n\n__author__ = \"Md Nazrul Islam<>\"\n__email__ = \"email2nazrul@gmail.com\"\n\n_APPLIED: bool = False\n\n\ndef SearchParameter_get_required_fields(self) -> typing.List[typing.Tuple[str, str]]:\n    \"\"\"https://www.hl7.org/fhir/extensibility.html#Special-Case\n    In some cases, implementers might find that they do not have appropriate data for\n    an element with minimum cardinality = 1. In this case, the element must be present,\n    but unless the resource or a profile on it has made the actual value of the primitive\n    data type mandatory, it is possible to provide an extension that explains why\n    the primitive value is not present.\n    \"\"\"\n    required_fields = [\n        # (\"base\", \"base__ext\"),\n        (\"code\", \"code__ext\"),\n        (\"description\", \"description__ext\"),\n        (\"name\", \"name__ext\"),\n        (\"status\", \"status__ext\"),\n        (\"type\", \"type__ext\"),\n        (\"url\", \"url__ext\"),\n    ]\n    return required_fields\n\n\ndef apply():\n    global _APPLIED\n    if _APPLIED is True:\n        # Already applied, one time only.\n        return\n    # import importlib\n    # from fhir_core import constraints\n    # from fhir_core import types as ftypes\n    # constraints.TYPES_ID_MAX_LENGTH = 64\n    # importlib.reload(ftypes)\n    from fhir.resources.R4B.searchparameter import SearchParameter\n\n    # Id.max_length = 255\n    # some example json file has ID value more than default 64 character\n    # IdType.configure_constraints(min_length=1, max_length=128, regex=None)\n    # SearchParameter.model_fields['id'].metadata[0] = Id(max_length=128, pattern=\"\")\n    # SearchParameter.__pydantic_core_schema__['schema']['schema']['fields']['id']['schema']['schema'].update({\n    #    'max_length': 255\n    # })\n    # {'type': 'str', 'pattern': '^[A-Za-z0-9\\\\-.]+$', 'max_length': 64, 'min_length': 1, 'metadata': {}}\n\n    SearchParameter.get_required_fields = SearchParameter_get_required_fields\n    _APPLIED = True\n"
  },
  {
    "path": "tests/static/R4B/Observation.json",
    "content": "{\n  \"resourceType\": \"Observation\",\n  \"id\": \"2minute-apgar-score\",\n  \"text\": {\n    \"status\": \"generated\",\n    \"div\": \"\\u003cdiv xmlns\\u003d\\\"http://www.w3.org/1999/xhtml\\\"\\u003e\\u003cp\\u003e\\u003cb\\u003eGenerated Narrative with Details\\u003c/b\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003eid\\u003c/b\\u003e: 2minute-apgar-score\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003econtained\\u003c/b\\u003e: \\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003estatus\\u003c/b\\u003e: final\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003ecategory\\u003c/b\\u003e: Survey \\u003cspan\\u003e(Details : {http://terminology.hl7.org/CodeSystem/observation-category code \\u0027survey\\u0027 \\u003d \\u0027Survey\\u0027, given as \\u0027Survey\\u0027})\\u003c/span\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003ecode\\u003c/b\\u003e: 2 minute Apgar Score \\u003cspan\\u003e(Details : {LOINC code \\u00279273-4\\u0027 \\u003d \\u00272 minute Apgar Score\\u0027, given as \\u00272 minute Apgar Score\\u0027})\\u003c/span\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003esubject\\u003c/b\\u003e: id: newborn; 12345; active; Peter James Chalmers ; gender: male; birthDate: 18/05/2016\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003eeffective\\u003c/b\\u003e: 18/05/2016 10:33:22 PM\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003eperformer\\u003c/b\\u003e: \\u003ca\\u003ePractitioner/example\\u003c/a\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003evalue\\u003c/b\\u003e: 5 {score}\\u003cspan\\u003e (Details: UCUM code {score} \\u003d \\u0027{score}\\u0027)\\u003c/span\\u003e\\u003c/p\\u003e\\u003cblockquote\\u003e\\u003cp\\u003e\\u003cb\\u003ecomponent\\u003c/b\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003ecode\\u003c/b\\u003e: Apgar color score \\u003cspan\\u003e(Details : {SNOMED CT code \\u0027249227004\\u0027 \\u003d \\u0027Apgar color score\\u0027, given as \\u0027Apgar color score\\u0027})\\u003c/span\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003evalue\\u003c/b\\u003e: 1. Good color in body with bluish hands or feet \\u003cspan\\u003e(Details : {LOINC code \\u0027LA6723-6\\u0027 \\u003d \\u0027Good color in body with bluish hands or feet\\u0027, given as \\u0027Good color in body with bluish hands or feet\\u0027}; {http://acme.ped/apgarcolor code \\u00271\\u0027 \\u003d \\u00271)\\u003c/span\\u003e\\u003c/p\\u003e\\u003c/blockquote\\u003e\\u003cblockquote\\u003e\\u003cp\\u003e\\u003cb\\u003ecomponent\\u003c/b\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003ecode\\u003c/b\\u003e: Apgar respiratory effort score \\u003cspan\\u003e(Details : {SNOMED CT code \\u0027249223000\\u0027 \\u003d \\u0027Apgar heart rate score\\u0027, given as \\u0027Apgar heart rate score\\u0027})\\u003c/span\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003evalue\\u003c/b\\u003e: 1. Fewer than 100 beats per minute \\u003cspan\\u003e(Details : {LOINC code \\u0027LA6720-2\\u0027 \\u003d \\u0027Grimace during suctioning\\u0027, given as \\u0027Fewer than 100 beats per minute\\u0027}; {http://acme.ped/apgarheartrate code \\u00271\\u0027 \\u003d \\u00271)\\u003c/span\\u003e\\u003c/p\\u003e\\u003c/blockquote\\u003e\\u003cblockquote\\u003e\\u003cp\\u003e\\u003cb\\u003ecomponent\\u003c/b\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003ecode\\u003c/b\\u003e: Apgar response to stimulus score \\u003cspan\\u003e(Details : {SNOMED CT code \\u0027249226008\\u0027 \\u003d \\u0027Apgar response to stimulus score\\u0027, given as \\u0027Apgar response to stimulus score\\u0027})\\u003c/span\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003evalue\\u003c/b\\u003e: 1. Grimace during suctioning \\u003cspan\\u003e(Details : {LOINC code \\u0027LA6721-0\\u0027 \\u003d \\u0027Grimace and pulling away, cough, or sneeze during suctioning\\u0027, given as \\u0027Grimace during suctioning\\u0027}; {http://acme.ped/apgarreflexirritability code \\u00271\\u0027 \\u003d \\u00271)\\u003c/span\\u003e\\u003c/p\\u003e\\u003c/blockquote\\u003e\\u003cblockquote\\u003e\\u003cp\\u003e\\u003cb\\u003ecomponent\\u003c/b\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003ecode\\u003c/b\\u003e: Apgar muscle tone score \\u003cspan\\u003e(Details : {SNOMED CT code \\u0027249225007\\u0027 \\u003d \\u0027Apgar muscle tone score\\u0027, given as \\u0027Apgar muscle tone score\\u0027})\\u003c/span\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003evalue\\u003c/b\\u003e: 1. Some flexion of arms and legs \\u003cspan\\u003e(Details : {LOINC code \\u0027LA6714-5\\u0027 \\u003d \\u0027Some flexion of arms and legs\\u0027, given as \\u0027Some flexion of arms and legs\\u0027}; {http://acme.ped/apgarmuscletone code \\u00271\\u0027 \\u003d \\u00271)\\u003c/span\\u003e\\u003c/p\\u003e\\u003c/blockquote\\u003e\\u003cblockquote\\u003e\\u003cp\\u003e\\u003cb\\u003ecomponent\\u003c/b\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003ecode\\u003c/b\\u003e: Apgar respiratory effort score \\u003cspan\\u003e(Details : {SNOMED CT code \\u0027249224006\\u0027 \\u003d \\u0027Apgar respiratory effort score\\u0027, given as \\u0027Apgar respiratory effort score\\u0027})\\u003c/span\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003evalue\\u003c/b\\u003e: 1. Weak cry; may sound like whimpering, slow or irregular breathing \\u003cspan\\u003e(Details : {LOINC code \\u0027LA6726-9\\u0027 \\u003d \\u0027Weak cry; may sound like whimpering, slow or irregular breathing\\u0027, given as \\u0027Weak cry; may sound like whimpering, slow or irregular breathing\\u0027}; {http://acme.ped/apgarrespiratoryeffort code \\u00271\\u0027 \\u003d \\u00271)\\u003c/span\\u003e\\u003c/p\\u003e\\u003c/blockquote\\u003e\\u003c/div\\u003e\"\n  },\n  \"contained\": [\n    {\n      \"resourceType\": \"Patient\",\n      \"id\": \"newborn\",\n      \"identifier\": [\n        {\n          \"system\": \"http://acmehealthcare/org/mrns\",\n          \"value\": \"12345\"\n        }\n      ],\n      \"active\": true,\n      \"name\": [\n        {\n          \"family\": \"Chalmers\",\n          \"given\": [\n            \"Peter\",\n            \"James\"\n          ]\n        }\n      ],\n      \"gender\": \"male\",\n      \"birthDate\": \"2016-05-18\",\n      \"_birthDate\": {\n        \"extension\": [\n          {\n            \"url\": \"http://hl7.org/fhir/StructureDefinition/patient-birthTime\",\n            \"valueDateTime\": \"2016-05-18T10:28:45Z\"\n          }\n        ]\n      }\n    }\n  ],\n  \"status\": \"final\",\n  \"category\": [\n    {\n      \"coding\": [\n        {\n          \"system\": \"http://terminology.hl7.org/CodeSystem/observation-category\",\n          \"code\": \"survey\",\n          \"display\": \"Survey\"\n        }\n      ],\n      \"text\": \"Survey\"\n    }\n  ],\n  \"code\": {\n    \"coding\": [\n      {\n        \"system\": \"http://loinc.org\",\n        \"code\": \"9273-4\",\n        \"display\": \"2 minute Apgar Score\"\n      }\n    ],\n    \"text\": \"2 minute Apgar Score\"\n  },\n  \"subject\": {\n    \"reference\": \"#newborn\"\n  },\n  \"effectiveDateTime\": \"2016-05-18T22:33:22Z\",\n  \"performer\": [\n    {\n      \"reference\": \"Practitioner/example\"\n    }\n  ],\n  \"valueQuantity\": {\n    \"value\": 5,\n    \"system\": \"http://unitsofmeasure.org\",\n    \"code\": \"{score}\"\n  },\n  \"component\": [\n    {\n      \"code\": {\n        \"coding\": [\n          {\n            \"system\": \"http://snomed.info/sct\",\n            \"code\": \"249227004\",\n            \"display\": \"Apgar color score\"\n          }\n        ],\n        \"text\": \"Apgar color score\"\n      },\n      \"valueCodeableConcept\": {\n        \"coding\": [\n          {\n            \"extension\": [\n              {\n                \"url\": \"http://hl7.org/fhir/StructureDefinition/ordinalValue\",\n                \"valueDecimal\": 1\n              }\n            ],\n            \"system\": \"http://loinc.org\",\n            \"code\": \"LA6723-6\",\n            \"display\": \"Good color in body with bluish hands or feet\"\n          },\n          {\n            \"system\": \"http://acme.ped/apgarcolor\",\n            \"code\": \"1\"\n          }\n        ],\n        \"text\": \"1. Good color in body with bluish hands or feet\"\n      }\n    },\n    {\n      \"code\": {\n        \"coding\": [\n          {\n            \"system\": \"http://snomed.info/sct\",\n            \"code\": \"249223000\",\n            \"display\": \"Apgar heart rate score\"\n          }\n        ],\n        \"text\": \"Apgar respiratory effort score\"\n      },\n      \"valueCodeableConcept\": {\n        \"coding\": [\n          {\n            \"extension\": [\n              {\n                \"url\": \"http://hl7.org/fhir/StructureDefinition/ordinalValue\",\n                \"valueDecimal\": 1\n              }\n            ],\n            \"system\": \"http://loinc.org\",\n            \"code\": \"LA6720-2\",\n            \"display\": \"Fewer than 100 beats per minute\"\n          },\n          {\n            \"system\": \"http://acme.ped/apgarheartrate\",\n            \"code\": \"1\"\n          }\n        ],\n        \"text\": \"1. Fewer than 100 beats per minute\"\n      }\n    },\n    {\n      \"code\": {\n        \"coding\": [\n          {\n            \"system\": \"http://snomed.info/sct\",\n            \"code\": \"249226008\",\n            \"display\": \"Apgar response to stimulus score\"\n          }\n        ],\n        \"text\": \"Apgar response to stimulus score\"\n      },\n      \"valueCodeableConcept\": {\n        \"coding\": [\n          {\n            \"extension\": [\n              {\n                \"url\": \"http://hl7.org/fhir/StructureDefinition/ordinalValue\",\n                \"valueDecimal\": 1\n              }\n            ],\n            \"system\": \"http://loinc.org\",\n            \"code\": \"LA6721-0\",\n            \"display\": \"Grimace during suctioning\"\n          },\n          {\n            \"system\": \"http://acme.ped/apgarreflexirritability\",\n            \"code\": \"1\"\n          }\n        ],\n        \"text\": \"1. Grimace during suctioning\"\n      }\n    },\n    {\n      \"code\": {\n        \"coding\": [\n          {\n            \"system\": \"http://snomed.info/sct\",\n            \"code\": \"249225007\",\n            \"display\": \"Apgar muscle tone score\"\n          }\n        ],\n        \"text\": \"Apgar muscle tone score\"\n      },\n      \"valueCodeableConcept\": {\n        \"coding\": [\n          {\n            \"extension\": [\n              {\n                \"url\": \"http://hl7.org/fhir/StructureDefinition/ordinalValue\",\n                \"valueDecimal\": 1\n              }\n            ],\n            \"system\": \"http://loinc.org\",\n            \"code\": \"LA6714-5\",\n            \"display\": \"Some flexion of arms and legs\"\n          },\n          {\n            \"system\": \"http://acme.ped/apgarmuscletone\",\n            \"code\": \"1\"\n          }\n        ],\n        \"text\": \"1. Some flexion of arms and legs\"\n      }\n    },\n    {\n      \"code\": {\n        \"coding\": [\n          {\n            \"system\": \"http://snomed.info/sct\",\n            \"code\": \"249224006\",\n            \"display\": \"Apgar respiratory effort score\"\n          }\n        ],\n        \"text\": \"Apgar respiratory effort score\"\n      },\n      \"valueCodeableConcept\": {\n        \"coding\": [\n          {\n            \"extension\": [\n              {\n                \"url\": \"http://hl7.org/fhir/StructureDefinition/ordinalValue\",\n                \"valueDecimal\": 1\n              }\n            ],\n            \"system\": \"http://loinc.org\",\n            \"code\": \"LA6726-9\",\n            \"display\": \"Weak cry; may sound like whimpering, slow or irregular breathing\"\n          },\n          {\n            \"system\": \"http://acme.ped/apgarrespiratoryeffort\",\n            \"code\": \"1\"\n          }\n        ],\n        \"text\": \"1. Weak cry; may sound like whimpering, slow or irregular breathing\"\n      }\n    }\n  ],\n  \"meta\": {\n    \"tag\": [\n      {\n        \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\",\n        \"code\": \"HTEST\",\n        \"display\": \"test health data\"\n      }\n    ]\n  }\n}\n"
  },
  {
    "path": "tests/static/R4B/Patient-with-ext.json",
    "content": "{\n  \"resourceType\": \"Patient\",\n  \"identifier\": [\n    {\n      \"period\": {\n        \"start\": \"2001-05-06\"\n      },\n      \"assigner\": {\n        \"display\": \"Acme Healthcare\"\n      },\n      \"use\": \"usual\",\n      \"system\": \"urn:oid:1.2.36.146.595.217.0.1\",\n      \"value\": \"12345\"\n    }\n  ],\n  \"managingOrganization\": {\n    \"reference\": \"Organization/1936778\"\n  },\n  \"_active\": {\n    \"extension\": [\n      {\n        \"url\": \"http://example.org/fhir/StructureDefinition/recordStatus\",\n        \"valueCode\": \"archived\"\n      }\n    ]\n  },\n  \"name\": [\n    {\n      \"given\": [\n        \"Peter\",\n        \"James\"\n      ],\n      \"use\": \"official\",\n      \"family\": \"Chalmers\"\n    },\n    {\n      \"given\": [\n        \"Jim\"\n      ],\n      \"use\": \"usual\"\n    }\n  ],\n  \"extension\": [\n    {\n      \"url\": \"http://example.org/fhir/StructureDefinition/patientAvatar\",\n      \"valueReference\": {\n        \"reference\": \"#pic1\",\n        \"display\": \"Duck image\"\n      }\n    },\n    {\n      \"url\": \"http://example.org/fhir/StructureDefinition/complexExtensionExample\",\n      \"extension\": [\n        {\n          \"url\": \"nestedA\",\n          \"valueCoding\": {\n            \"system\": \"http://demo.org/id/4\",\n            \"code\": \"AB45\",\n            \"extension\": [\n              {\n                \"url\": \"http://example.org/fhir/StructureDefinition/extraforcodingWithExt\",\n                \"extension\": [\n                  {\n                    \"url\": \"extra1\",\n                    \"valueString\": \"extra info\"\n                  }\n                ]\n              },\n              {\n                \"url\": \"http://example.org/fhir/StructureDefinition/extraforcodingWithValue\",\n                \"valueInteger\": 45\n              }\n            ]\n          }\n        },\n        {\n          \"url\": \"nestedB\",\n          \"id\": \"q4\",\n          \"extension\": [\n            {\n              \"url\": \"nestedB1\",\n              \"valueString\": \"hello\"\n            }\n          ]\n        }\n      ]\n    }\n  ],\n  \"modifierExtension\": [\n    {\n      \"url\": \"http://example.org/fhir/StructureDefinition/pi\",\n      \"valueDecimal\": 3.141592653589793\n    },\n    {\n      \"url\": \"http://example.org/fhir/StructureDefinition/max-decimal-precision\",\n      \"valueDecimal\": 1.00065022141624642\n    }\n  ],\n  \"gender\": \"male\",\n  \"_gender\": {\n      \"fhir_comments\": \"This is comment for Gender\"\n  },\n  \"birthDate\": \"1974-12\",\n  \"deceasedBoolean\": true,\n  \"address\": [\n    {\n        \"fhir_comments\": \"This is comment for Address.No 1\",\n      \"use\": \"home\",\n      \"line\": [\n        \"534 Erewhon St\"\n      ],\n      \"city\": \"PleasantVille\",\n      \"state\": \"Vic\",\n      \"postalCode\": \"3999\"\n    }\n  ],\n  \"maritalStatus\": {\n    \"extension\": [\n      {\n        \"url\": \"http://example.org/fhir/StructureDefinition/nullFlavor\",\n        \"valueCode\": \"ASKU\",\n        \"fhir_comments\": \"This is comment for maritalStatus. Ext 1\"\n      }\n    ]\n  },\n  \"multipleBirthInteger\": 3,\n  \"text\": {\n    \"status\": \"generated\",\n    \"div\": \"\\u003cdiv xmlns\\u003d\\\"http://www.w3.org/1999/xhtml\\\"\\u003e\\n      \\u003ctable\\u003e\\n        \\u003ctbody\\u003e\\n          \\u003ctr\\u003e\\n            \\u003ctd\\u003eName\\u003c/td\\u003e\\n            \\u003ctd\\u003ePeter James \\u003cb\\u003eChalmers\\u003c/b\\u003e (\\u0026quot;Jim\\u0026quot;)\\u003c/td\\u003e\\n          \\u003c/tr\\u003e\\n          \\u003ctr\\u003e\\n            \\u003ctd\\u003eAddress\\u003c/td\\u003e\\n            \\u003ctd\\u003e534 Erewhon, Pleasantville, Vic, 3999\\u003c/td\\u003e\\n          \\u003c/tr\\u003e\\n          \\u003ctr\\u003e\\n            \\u003ctd\\u003eContacts\\u003c/td\\u003e\\n            \\u003ctd\\u003eHome: unknown. Work: (03) 5555 6473\\u003c/td\\u003e\\n          \\u003c/tr\\u003e\\n          \\u003ctr\\u003e\\n            \\u003ctd\\u003eId\\u003c/td\\u003e\\n            \\u003ctd\\u003eMRN: 12345 (Acme Healthcare)\\u003c/td\\u003e\\n          \\u003c/tr\\u003e\\n        \\u003c/tbody\\u003e\\n      \\u003c/table\\u003e\\n    \\u003c/div\\u003e\"\n  },\n  \"contained\": [\n    {\n      \"resourceType\": \"Binary\",\n      \"id\": \"pic1\",\n      \"contentType\": \"image/gif\",\n      \"data\": \"R0lGODlhEwARAPcAAAAAAAAA/+9aAO+1AP/WAP/eAP/eCP/eEP/eGP/nAP/nCP/nEP/nIf/nKf/nUv/nWv/vAP/vCP/vEP/vGP/vIf/vKf/vMf/vOf/vWv/vY//va//vjP/3c//3lP/3nP//tf//vf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEAAAEALAAAAAATABEAAAi+AAMIDDCgYMGBCBMSvMCQ4QCFCQcwDBGCA4cLDyEGECDxAoAQHjxwyKhQAMeGIUOSJJjRpIAGDS5wCDly4AALFlYOgHlBwwOSNydM0AmzwYGjBi8IHWoTgQYORg8QIGDAwAKhESI8HIDgwQaRDI1WXXAhK9MBBzZ8/XDxQoUFZC9IiCBh6wEHGz6IbNuwQoSpWxEgyLCXL8O/gAnylNlW6AUEBRIL7Og3KwQIiCXb9HsZQoIEUzUjNEiaNMKAAAA7\"\n    },\n    {\n      \"resourceType\": \"Organization\",\n      \"id\": \"1936778\",\n      \"text\": {\n        \"status\": \"generated\",\n        \"div\": \"\\u003cdiv xmlns\\u003d\\\"http://www.w3.org/1999/xhtml\\\"\\u003e\\n      \\u003cp\\u003eGood Health Clinic\\u003c/p\\u003e\\n    \\u003c/div\\u003e\"\n      },\n      \"identifier\": [\n        {\n          \"system\": \"urn:ietf:rfc:3986\",\n          \"value\": \"2.16.840.1.113883.19.5\"\n        }\n      ],\n      \"name\": \"Good Health Clinic\"\n    }\n  ],\n  \"contact\": [\n    {\n      \"name\": {\n        \"family\": \"du Marché\",\n        \"_family\": {\n          \"extension\": [\n            {\n              \"url\": \"http://example.org/fhir/StructureDefinition/qualifier\",\n              \"valueString\": \"VV\"\n            },\n            {\n              \"url\": \"http://hl7.org/fhir/StructureDefinitioniso-21090#nullFlavor\",\n              \"valueCode\": \"ASKU\"\n            }\n          ]\n        },\n        \"_given\": [\n          null,\n          {\n            \"extension\": [\n              {\n                \"url\": \"http://hl7.org/fhir/StructureDefinition/qualifier\",\n                \"valueCode\": \"MID\"\n              }\n            ]\n          },\n          null\n        ],\n        \"given\": [\n          \"Bénédicte\",\n          \"Denise\",\n          \"Marie\"\n        ]\n      },\n      \"relationship\": [\n        {\n          \"coding\": [\n            {\n              \"system\": \"http://example.org/fhir/CodeSystem/patient-contact-relationship\",\n              \"code\": \"partner\"\n            }\n          ]\n        }\n      ],\n      \"telecom\": [\n        {\n          \"system\": \"phone\",\n          \"value\": \"+33 (237) 998327\"\n        }\n      ]\n    }\n  ],\n  \"generalPractitioner\": [\n    {\n      \"reference\": \"#org3141\"\n    }\n  ],\n  \"telecom\": [\n    {\n      \"use\": \"home\"\n    },\n    {\n      \"system\": \"phone\",\n      \"value\": \"(03) 5555 6473\",\n      \"use\": \"work\"\n    }\n  ],\n  \"meta\": {\n    \"tag\": [\n      {\n        \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\",\n        \"code\": \"HTEST\",\n        \"display\": \"test health data\"\n      }\n    ]\n  }\n}\n"
  },
  {
    "path": "tests/static/R4B/Patient-with-ext.xml",
    "content": "<?xml version='1.0' encoding='utf-8'?>\n<Patient xmlns=\"http://hl7.org/fhir\">\n  <meta>\n    <tag>\n      <system value=\"http://terminology.hl7.org/CodeSystem/v3-ActReason\"/>\n      <code value=\"HTEST\"/>\n      <display value=\"test health data\"/>\n    </tag>\n  </meta>\n  <text>\n    <status value=\"generated\"/>\n    <div xmlns=\"http://www.w3.org/1999/xhtml\">\n      <table>\n        <tbody>\n          <tr>\n            <td>Name</td>\n            <td>Peter James <b>Chalmers</b> (\"Jim\")</td>\n          </tr>\n          <tr>\n            <td>Address</td>\n            <td>534 Erewhon, Pleasantville, Vic, 3999</td>\n          </tr>\n          <tr>\n            <td>Contacts</td>\n            <td>Home: unknown. Work: (03) 5555 6473</td>\n          </tr>\n          <tr>\n            <td>Id</td>\n            <td>MRN: 12345 (Acme Healthcare)</td>\n          </tr>\n        </tbody>\n      </table>\n    </div>\n  </text>\n  <contained>\n    <Binary>\n      <id value=\"pic1\"/>\n      <contentType value=\"image/gif\"/>\n      <data value=\"R0lGODlhEwARAPcAAAAAAAAA/+9aAO+1AP/WAP/eAP/eCP/eEP/eGP/nAP/nCP/nEP/nIf/nKf/nUv/nWv/vAP/vCP/vEP/vGP/vIf/vKf/vMf/vOf/vWv/vY//va//vjP/3c//3lP/3nP//tf//vf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEAAAEALAAAAAATABEAAAi+AAMIDDCgYMGBCBMSvMCQ4QCFCQcwDBGCA4cLDyEGECDxAoAQHjxwyKhQAMeGIUOSJJjRpIAGDS5wCDly4AALFlYOgHlBwwOSNydM0AmzwYGjBi8IHWoTgQYORg8QIGDAwAKhESI8HIDgwQaRDI1WXXAhK9MBBzZ8/XDxQoUFZC9IiCBh6wEHGz6IbNuwQoSpWxEgyLCXL8O/gAnylNlW6AUEBRIL7Og3KwQIiCXb9HsZQoIEUzUjNEiaNMKAAAA7\"/>\n    </Binary>\n  </contained>\n  <contained>\n    <Organization>\n      <id value=\"1936778\"/>\n      <text>\n        <status value=\"generated\"/>\n        <div xmlns=\"http://www.w3.org/1999/xhtml\">\n      <p>Good Health Clinic</p>\n    </div>\n      </text>\n      <identifier>\n        <system value=\"urn:ietf:rfc:3986\"/>\n        <value value=\"2.16.840.1.113883.19.5\"/>\n      </identifier>\n      <name value=\"Good Health Clinic\"/>\n    </Organization>\n  </contained>\n  <extension url=\"http://example.org/fhir/StructureDefinition/patientAvatar\">\n    <valueReference>\n      <reference value=\"#pic1\"/>\n      <display value=\"Duck image\"/>\n    </valueReference>\n  </extension>\n  <extension url=\"http://example.org/fhir/StructureDefinition/complexExtensionExample\">\n    <extension url=\"nestedA\">\n      <valueCoding>\n        <extension url=\"http://example.org/fhir/StructureDefinition/extraforcodingWithExt\">\n          <extension url=\"extra1\">\n            <valueString value=\"extra info\"/>\n          </extension>\n        </extension>\n        <extension url=\"http://example.org/fhir/StructureDefinition/extraforcodingWithValue\">\n          <valueInteger value=\"45\"/>\n        </extension>\n        <system value=\"http://demo.org/id/4\"/>\n        <code value=\"AB45\"/>\n      </valueCoding>\n    </extension>\n    <extension id=\"q4\" url=\"nestedB\">\n      <extension url=\"nestedB1\">\n        <valueString value=\"hello\"/>\n      </extension>\n    </extension>\n  </extension>\n  <modifierExtension url=\"http://example.org/fhir/StructureDefinition/pi\">\n    <valueDecimal value=\"3.141592653589793\"/>\n  </modifierExtension>\n  <modifierExtension url=\"http://example.org/fhir/StructureDefinition/max-decimal-precision\">\n    <valueDecimal value=\"1.0006502214162465\"/>\n  </modifierExtension>\n  <identifier>\n    <use value=\"usual\"/>\n    <system value=\"urn:oid:1.2.36.146.595.217.0.1\"/>\n    <value value=\"12345\"/>\n    <period>\n      <start value=\"2001-05-06\"/>\n    </period>\n    <assigner>\n      <display value=\"Acme Healthcare\"/>\n    </assigner>\n  </identifier>\n  <active>\n    <extension url=\"http://example.org/fhir/StructureDefinition/recordStatus\">\n      <valueCode value=\"archived\"/>\n    </extension>\n  </active>\n  <name>\n    <use value=\"official\"/>\n    <family value=\"Chalmers\"/>\n    <given value=\"Peter\"/>\n    <given value=\"James\"/>\n  </name>\n  <name>\n    <use value=\"usual\"/>\n    <given value=\"Jim\"/>\n  </name>\n  <telecom>\n    <use value=\"home\"/>\n  </telecom>\n  <telecom>\n    <system value=\"phone\"/>\n    <value value=\"(03) 5555 6473\"/>\n    <use value=\"work\"/>\n  </telecom>\n  <!--This is comment for Gender-->\n  <gender value=\"male\"/>\n  <birthDate value=\"1974-12\"/>\n  <deceasedBoolean value=\"true\"/>\n  <!--This is comment for Address.No 1-->\n  <address>\n    <use value=\"home\"/>\n    <line value=\"534 Erewhon St\"/>\n    <city value=\"PleasantVille\"/>\n    <state value=\"Vic\"/>\n    <postalCode value=\"3999\"/>\n  </address>\n  <maritalStatus>\n    <!--This is comment for maritalStatus. Ext 1-->\n    <extension url=\"http://example.org/fhir/StructureDefinition/nullFlavor\">\n      <valueCode value=\"ASKU\"/>\n    </extension>\n  </maritalStatus>\n  <multipleBirthInteger value=\"3\"/>\n  <contact>\n    <relationship>\n      <coding>\n        <system value=\"http://example.org/fhir/CodeSystem/patient-contact-relationship\"/>\n        <code value=\"partner\"/>\n      </coding>\n    </relationship>\n    <name>\n      <family value=\"du Marché\">\n        <extension url=\"http://example.org/fhir/StructureDefinition/qualifier\">\n          <valueString value=\"VV\"/>\n        </extension>\n        <extension url=\"http://hl7.org/fhir/StructureDefinitioniso-21090#nullFlavor\">\n          <valueCode value=\"ASKU\"/>\n        </extension>\n      </family>\n      <given value=\"Bénédicte\"/>\n      <given value=\"Denise\">\n        <extension url=\"http://hl7.org/fhir/StructureDefinition/qualifier\">\n          <valueCode value=\"MID\"/>\n        </extension>\n      </given>\n      <given value=\"Marie\"/>\n    </name>\n    <telecom>\n      <system value=\"phone\"/>\n      <value value=\"+33 (237) 998327\"/>\n    </telecom>\n  </contact>\n  <generalPractitioner>\n    <reference value=\"#org3141\"/>\n  </generalPractitioner>\n  <managingOrganization>\n    <reference value=\"Organization/1936778\"/>\n  </managingOrganization>\n</Patient>\n"
  },
  {
    "path": "tests/static/STU3-Bundle-Issue-144.xml",
    "content": "<Bundle\n\txmlns=\"http://hl7.org/fhir\">\n\t<id value=\"cd15aa48-2d93-4854-a54e-9db64f849486\"/>\n\t<meta>\n\t\t<profile value=\"https://fhir.nhs.uk/STU3/StructureDefinition/ITK-Message-Bundle-1\"/>\n\t</meta>\n\t<identifier>\n\t\t<value value=\"18489fa2-830d-458c-b8b8-dcaf4482bfb5\"/>\n\t</identifier>\n\t<type value=\"message\"/>\n\t<entry>\n\t\t<fullUrl value=\"urn:uuid:8079c82d-3a33-4998-b0fa-92ecc9665932\"/>\n\t\t<resource>\n\t\t\t<MessageHeader>\n\t\t\t\t<id value=\"8079c82d-3a33-4998-b0fa-92ecc9665932\"/>\n\t\t\t\t<meta>\n\t\t\t\t\t<profile value=\"https://fhir.nhs.uk/STU3/StructureDefinition/ITK-MessageHeader-2\"/>\n\t\t\t\t</meta>\n\t\t\t\t<extension url=\"https://fhir.nhs.uk/STU3/StructureDefinition/Extension-ITK-MessageHandling-2\">\n\t\t\t\t\t<extension url=\"InfAckRequested\">\n\t\t\t\t\t\t<valueBoolean value=\"false\"/>\n\t\t\t\t\t</extension>\n\t\t\t\t\t<extension url=\"RecipientType\">\n\t\t\t\t\t\t<valueCoding>\n\t\t\t\t\t\t\t<system value=\"https://fhir.nhs.uk/STU3/CodeSystem/ITK-RecipientType-1\"/>\n\t\t\t\t\t\t\t<code value=\"FI\"/>\n\t\t\t\t\t\t\t<display value=\"For Information\"/>\n\t\t\t\t\t\t</valueCoding>\n\t\t\t\t\t</extension>\n\t\t\t\t</extension>\n\t\t\t\t<event>\n\t\t\t\t\t<system value=\"https://fhir.nhs.uk/STU3/CodeSystem/ITK-MessageEvent-2\"/>\n\t\t\t\t\t<code value=\"ITK008M\"/>\n\t\t\t\t\t<display value=\"ITK Response\"/>\n\t\t\t\t</event>\n\t\t\t\t<sender>\n\t\t\t\t\t<reference value=\"urn:uuid:b31bb32c-93c1-4068-9260-3f091b4487db\"/>\n\t\t\t\t</sender>\n\t\t\t\t<timestamp value=\"2023-11-01T12:47:50Z\"/>\n\t\t\t\t<source>\n\t\t\t\t\t<endpoint value=\"urn:nhs-uk:addressing:ods:ITKTestHarness\"/>\n\t\t\t\t</source>\n\t\t\t\t<response>\n\t\t\t\t\t<identifier value=\"bab555e7-eda7-4b76-859e-f9af159cfd3c\"/>\n\t\t\t\t\t<code value=\"fatal-error\"/>\n\t\t\t\t\t<details>\n\t\t\t\t\t\t<reference value=\"urn:uuid:5ab142e6-bb0d-4c13-9e71-531aa207786f\"/>\n\t\t\t\t\t</details>\n\t\t\t\t</response>\n\t\t\t</MessageHeader>\n\t\t</resource>\n\t</entry>\n\t<entry>\n\t\t<fullUrl value=\"urn:uuid:b31bb32c-93c1-4068-9260-3f091b4487db\"/>\n\t\t<resource>\n\t\t\t<Practitioner>\n\t\t\t\t<id value=\"b31bb32c-93c1-4068-9260-3f091b4487db\"/>\n\t\t\t\t<meta>\n\t\t\t\t\t<profile value=\"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-ITK-Header-Practitioner-1\"/>\n\t\t\t\t</meta>\n\t\t\t\t<name>\n\t\t\t\t\t<family value=\"Harness\"/>\n\t\t\t\t\t<given value=\"ITK Test\"/>\n\t\t\t\t</name>\n\t\t\t</Practitioner>\n\t\t</resource>\n\t</entry>\n\t<entry>\n\t\t<fullUrl value=\"urn:uuid:5ab142e6-bb0d-4c13-9e71-531aa207786f\"/>\n\t\t<resource>\n\t\t\t<OperationOutcome>\n\t\t\t\t<id value=\"5ab142e6-bb0d-4c13-9e71-531aa207786f\"/>\n\t\t\t\t<meta>\n\t\t\t\t\t<profile value=\"https://fhir.nhs.uk/STU3/StructureDefinition/ITK-Response-OperationOutcome-1\"/>\n\t\t\t\t</meta>\n\t\t\t\t<issue>\n\t\t\t\t\t<severity value=\"fatal\"/>\n\t\t\t\t\t<code value=\"processing\"/>\n\t\t\t\t\t<details>\n\t\t\t\t\t\t<coding>\n\t\t\t\t\t\t\t<system value=\"https://fhir.nhs.uk/STU3/CodeSystem/ITK-ResponseCodes-1\"/>\n\t\t\t\t\t\t\t<code value=\"10001\"/>\n\t\t\t\t\t\t\t<display value=\"Handling Specification Error\"/>\n\t\t\t\t\t\t</coding>\n\t\t\t\t\t</details>\n\t\t\t\t</issue>\n\t\t\t</OperationOutcome>\n\t\t</resource>\n\t</entry>\n</Bundle>\n"
  },
  {
    "path": "tests/static/example1-Provenance.json",
    "content": "{\n  \"resourceType\": \"Provenance\",\n  \"id\": \"example1\",\n  \"text\": {\n    \"status\": \"generated\",\n    \"div\": \"\\u003cdiv xmlns\\u003d\\\"http://www.w3.org/1999/xhtml\\\"\\u003e\\u003cp\\u003e\\u003cb\\u003eGenerated Narrative: Provenance\\u003c/b\\u003e\\u003ca name\\u003d\\\"example1\\\"\\u003e \\u003c/a\\u003e\\u003c/p\\u003e\\u003cdiv style\\u003d\\\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\\\"\\u003e\\u003cp style\\u003d\\\"margin-bottom: 0px\\\"\\u003eResource Provenance \\u0026quot;example1\\u0026quot; \\u003c/p\\u003e\\u003c/div\\u003e\\u003cp\\u003e\\u003cb\\u003etarget\\u003c/b\\u003e: \\u003cspan title\\u003d\\\"  \\n    Got the patient\\u0027s official name from the patient directly\\n   \\\"\\u003e\\u003ca href\\u003d\\\"patient-example-c.html\\\"\\u003ePatient/pat3/_history/1\\u003c/a\\u003e \\u0026quot;Simon NOTSOWELL\\u0026quot;(#n1)\\u003c/span\\u003e\\u003c/p\\u003e\\u003cp\\u003e\\u003cb\\u003erecorded\\u003c/b\\u003e: 7 Dec 2021, 12:23:45 pm\\u003c/p\\u003e\\u003ch3\\u003eAgents\\u003c/h3\\u003e\\u003ctable class\\u003d\\\"grid\\\"\\u003e\\u003ctr\\u003e\\u003ctd\\u003e-\\u003c/td\\u003e\\u003ctd\\u003e\\u003cb\\u003eType\\u003c/b\\u003e\\u003c/td\\u003e\\u003ctd\\u003e\\u003cb\\u003eWho\\u003c/b\\u003e\\u003c/td\\u003e\\u003c/tr\\u003e\\u003ctr\\u003e\\u003ctd\\u003e*\\u003c/td\\u003e\\u003ctd\\u003einformant \\u003cspan style\\u003d\\\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\\\"\\u003e (\\u003ca href\\u003d\\\"http://terminology.hl7.org/5.1.0/CodeSystem-v3-ParticipationType.html\\\"\\u003eParticipationType\\u003c/a\\u003e#INF)\\u003c/span\\u003e\\u003c/td\\u003e\\u003ctd\\u003e\\u003ca href\\u003d\\\"patient-example-c.html\\\"\\u003ePatient/pat3\\u003c/a\\u003e \\u0026quot;Simon NOTSOWELL\\u0026quot;\\u003c/td\\u003e\\u003c/tr\\u003e\\u003c/table\\u003e\\u003c/div\\u003e\"\n  },\n  \"target\": [\n    {\n      \"extension\": [\n        {\n          \"url\": \"http://hl7.org/fhir/StructureDefinition/targetElement\",\n          \"valueUri\": \"n1\"\n        }\n      ],\n      \"reference\": \"Patient/pat3/_history/1\"\n    }\n  ],\n  \"recorded\": \"2021-12-07T12:23:45+11:00\",\n  \"agent\": [\n    {\n      \"type\": {\n        \"coding\": [\n          {\n            \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ParticipationType\",\n            \"code\": \"INF\"\n          }\n        ]\n      },\n      \"who\": {\n        \"reference\": \"Patient/pat3\"\n      }\n    }\n  ],\n  \"meta\": {\n    \"tag\": [\n      {\n        \"system\": \"http://terminology.hl7.org/CodeSystem/v3-ActReason\",\n        \"code\": \"HTEST\",\n        \"display\": \"test health data\"\n      }\n    ]\n  }\n}\n"
  },
  {
    "path": "tests/static/patient-example-animal(animal).xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Patient xmlns=\"http://hl7.org/fhir\">\n  <id value=\"animal\"/>\n  <meta>\n    <security>\n      <system value=\"http://terminology.hl7.org/CodeSystem/v3-ActReason\"/>\n      <code value=\"HTEST\"/>\n      <display value=\"test health data\"/>\n    </security>\n  </meta>\n  <text>\n    <status value=\"generated\"/>\n    <div xmlns=\"http://www.w3.org/1999/xhtml\">\n\n      <table>\n\n        <tbody>\n\n          <tr>\n\n            <td>Id</td>\n\n            <td>Kenzi (Dog: Golden Retriever)</td>\n\n          </tr>\n\n          <tr>\n\n            <td>Owner</td>\n\n            <td>Peter Chalmers, 534 Erewhon, Pleasantville, Vic, 3999</td>\n\n          </tr>\n\n          <tr>\n\n            <td>Contacts</td>\n\n            <td>Work: (03) 5555 6473</td>\n\n          </tr>\n\n          <tr>\n\n            <td>Id</td>\n\n            <td>Dog Tag: 1234123 (Maroondah City Council)</td>\n\n          </tr>\n\n        </tbody>\n\n      </table>\n\n    </div>\n  </text>\n\t<extension url=\"http://hl7.org/fhir/StructureDefinition/patient-animal\">\n\t\t<extension url=\"species\">\n\t\t\t<valueCodeableConcept>\n\t\t\t  <coding>\n\t\t\t\t<system value=\"http://hl7.org/fhir/animal-species\"/>\n\t\t\t\t<code value=\"canislf\"/>\n\t\t\t\t<display value=\"Dog\"/>\n\t\t\t  </coding>\n\t\t\t</valueCodeableConcept>\n\t\t</extension>\n\t\t<extension url=\"breed\">\n\t\t\t<valueCodeableConcept>\n\t\t\t\t<coding>\n\t\t\t\t\t<system value=\"http://snomed.info/sct\"/>\n\t\t\t\t\t<code value=\"58108001\"/>\n\t\t\t\t\t<display value=\"Golden retriever\"/>\n\t\t\t\t</coding>\n\t\t\t\t<coding>\n\t\t\t\t\t<system value=\"http://example.org/fhir/CodeSystem/animal-breed\"/>\n\t\t\t\t\t<code value=\"gret\"/>\n\t\t\t\t\t<display value=\"Golden Retriever\"/>\n\t\t\t\t</coding>\n\t\t\t</valueCodeableConcept>\n\t\t</extension>\n\t\t<extension url=\"genderStatus\">\n\t\t\t<valueCodeableConcept>\n\t\t\t\t<coding>\n\t\t\t\t\t<system value=\"http://hl7.org/fhir/animal-genderstatus\"/>\n\t\t\t\t\t<code value=\"neutered\"/>\n\t\t\t\t</coding>\n\t\t\t</valueCodeableConcept>\n\t\t</extension>\n\t</extension>\n\n  <!--   Dog tag, under Maroondah City council   -->\n\n  <identifier>\n    <type>\n      <text value=\"Dog Tag\"/>\n    </type>\n    <system value=\"http://www.maroondah.vic.gov.au/AnimalRegFees.aspx\"/>\n    <value value=\"1234123\"/>\n    <period>\n      <start value=\"2010-05-31\"/>\n    </period>\n    <assigner>\n      <display value=\"Maroondah City Council\"/>\n    </assigner>\n  </identifier>\n  <active value=\"true\"/>\n<!--   Dog's name: Kenzi   -->\n  <name>\n    <use value=\"usual\"/>\n    <given value=\"Kenzi\"/>\n  </name>\n  <!-- gender comments -->\n  <gender value=\"female\"/>\n  <birthDate value=\"2010-03-23\"/>\n  <contact>\n    <relationship>\n      <coding>\n        <system value=\"http://terminology.hl7.org/CodeSystem/v2-0131\"/>\n        <code value=\"C\"/>\n      </coding>\n    </relationship>\n    <name>\n      <family value=\"Chalmers\"/>\n      <given value=\"Peter\"/>\n      <given value=\"James\"/>\n    </name>\n    <telecom>\n      <system value=\"phone\"/>\n      <value value=\"(03) 5555 6473\"/>\n      <use value=\"work\"/>\n    </telecom>\n  </contact>\n  <managingOrganization>\n    <display value=\"Pete's Vetinary Services\"/>\n  </managingOrganization>\n</Patient>\n"
  },
  {
    "path": "tests/static/xsd/fhir/account.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Account\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Account</sch:title>\n    <sch:rule context=\"f:Account\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:servicePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:coverage/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:coverage/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:coverage/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:owner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:owner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:owner/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:guarantor/f:party\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:guarantor/f:party/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:guarantor/f:party/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:guarantor/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/account.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Account\" type=\"Account\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Account\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique identifier used to reference the account.  Might or might not be intended for human use (e.g. credit card number).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"AccountStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether the account is presently used/usable or not.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Categorizes the account for reporting and searching purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name used for the account when displaying it to humans in reports, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the entity which incurs the expenses. While the immediate recipients of services or goods might be entities related to the subject, the expenses were ultimately incurred by the subject of the Account.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"servicePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date range of services associated with this account.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"coverage\" type=\"Account.Coverage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"owner\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the service area, hospital, department, etc. with responsibility for managing the Account.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides additional information about what the account tracks and how it is used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"guarantor\" type=\"Account.Guarantor\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The parties responsible for balancing the account if other payment options fall short.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to a parent Account.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Account.Coverage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"coverage\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party(s) that contribute to payment (or part of) of the charges applied to this account (including self-pay).\n\nA coverage may only be responsible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The priority of the coverage in the context of this account.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Account.Guarantor\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"party\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The entity who is responsible.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"onHold\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The timeframe during which the guarantor accepts responsibility for the account.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AccountStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"inactive\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-hold\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AccountStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates whether the account is available to be used.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AccountStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/activitydefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ActivityDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ActivityDefinition</sch:title>\n    <sch:rule context=\"f:ActivityDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:productReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:productReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:productReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:timing/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:timing/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:timing/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:timing/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:timing/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:timing/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:doseRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:doseRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:doseRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:doseQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:maxDosePerPeriod\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:maxDosePerPeriod/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:maxDosePerPeriod/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:maxDosePerAdministration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:maxDosePerLifetime\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:specimenRequirement\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:specimenRequirement/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:specimenRequirement/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:observationRequirement\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:observationRequirement/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:observationRequirement/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:observationResultRequirement\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:observationResultRequirement/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:observationResultRequirement/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dynamicValue/f:expression\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/activitydefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ActivityDefinition\" type=\"ActivityDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ActivityDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this activity definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the activity definition is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this activity definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the activity definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the activity definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the activity definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the activity definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the activity definition giving additional information about its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this activity definition. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this activity definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code or group definition that describes the intended subject of the activity being defined.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the activity definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the activity definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the activity definition from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate activity definition instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the activity definition is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this activity definition is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A detailed description of how the activity definition is used from a clinical perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the activity definition content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the activity. Topics provide a high-level categorization of the activity that can be useful for filtering and searching.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"library\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a Library resource containing any formal logic used by the activity definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"kind\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestResourceType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A profile to which the target of the activity definition is expected to conform.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestIntent\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chain.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the activity  should be addressed with respect to other requests.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"doNotPerform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period, timing or frequency upon which the described activity is to occur.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"timingTiming\" type=\"Timing\"/>\n            <xs:element name=\"timingDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"timingAge\" type=\"Age\"/>\n            <xs:element name=\"timingPeriod\" type=\"Period\"/>\n            <xs:element name=\"timingRange\" type=\"Range\"/>\n            <xs:element name=\"timingDuration\" type=\"Duration\"/>\n          </xs:choice>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"participant\" type=\"ActivityDefinition.Participant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates who should participate in performing the action described.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the food, drug or other product being consumed or supplied in the activity.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"productReference\" type=\"Reference\"/>\n            <xs:element name=\"productCodeableConcept\" type=\"CodeableConcept\"/>\n          </xs:choice>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dosage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Dosage\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specimenRequirement\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines specimen requirements for the action to be performed, such as required specimens for a lab test.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"observationRequirement\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines observation requirements for the action to be performed, such as body weight or surface area.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"observationResultRequirement\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines the observations that are expected to be produced by the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"transform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dynamicValue\" type=\"ActivityDefinition.DynamicValue\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the result.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ActivityDefinition.Participant\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ActionParticipantType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of participant in the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The role the participant should play in performing the described action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ActivityDefinition.DynamicValue\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"path\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Expression\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An expression specifying the value of the customized element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ActionParticipantType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"patient\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Patient</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"practitioner\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Practitioner</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"related-person\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Related Person</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"device\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Device</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ActionParticipantType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of participant in the activity.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ActionParticipantType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"RequestIntent-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"proposal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Proposal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"plan\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Plan</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"directive\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Directive</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"original-order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Original Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"reflex-order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Reflex Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"filler-order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Filler Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"instance-order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Instance Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"option\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Option</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"RequestIntent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Codes indicating the degree of authority/intentionality associated with a request.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"RequestIntent-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"RequestResourceType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"Appointment\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Appointment</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AppointmentResponse\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">AppointmentResponse</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CarePlan\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CarePlan</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Claim\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Claim</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CommunicationRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CommunicationRequest</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Contract\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Contract</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DeviceRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DeviceRequest</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EnrollmentRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">EnrollmentRequest</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ImmunizationRecommendation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ImmunizationRecommendation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicationRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicationRequest</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NutritionOrder\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">NutritionOrder</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ServiceRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ServiceRequest</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SupplyRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SupplyRequest</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Task\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Task</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"VisionPrescription\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">VisionPrescription</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"RequestResourceType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The kind of activity the definition is describing.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"RequestResourceType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"RequestPriority-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"routine\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Routine</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"urgent\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Urgent</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"asap\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ASAP</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"stat\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">STAT</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"RequestPriority\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Identifies the level of importance to be assigned to actioning the request.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"RequestPriority-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/adverseevent.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource AdverseEvent\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>AdverseEvent</sch:title>\n    <sch:rule context=\"f:AdverseEvent\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:resultingCondition\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:resultingCondition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:resultingCondition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:recorder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:recorder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:recorder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:contributor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:contributor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:contributor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:suspectEntity/f:instance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:suspectEntity/f:instance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:suspectEntity/f:instance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:suspectEntity/f:causality/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:suspectEntity/f:causality/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:suspectEntity/f:causality/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:subjectMedicalHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:subjectMedicalHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:subjectMedicalHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:referenceDocument\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:referenceDocument/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:referenceDocument/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:study\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:study/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:study/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/adverseevent.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"AdverseEvent\" type=\"AdverseEvent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Actual or  potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"AdverseEvent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Actual or  potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this adverse event by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actuality\" minOccurs=\"1\" maxOccurs=\"1\" type=\"AdverseEventActuality\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the event actually happened, or just had the potential to. Note that this is independent of whether anyone was affected or harmed or how severely.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The overall type of event, intended for search and filtering purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"event\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This element defines the specific type of event that occurred or that was prevented from occurring.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This subject or group impacted by the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Encounter during which AdverseEvent was created or to which the creation of this record is tightly associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date (and perhaps time) when the adverse event occurred.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detected\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Estimated or actual date the AdverseEvent began, in the opinion of the reporter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recordedDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the existence of the AdverseEvent was first recorded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resultingCondition\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Includes information about the reaction that occurred as a result of exposure to a substance (for example, a drug or a chemical).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The information about where the adverse event occurred.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"seriousness\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Assessment whether this event was of real importance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"severity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the severity of the adverse event, in relation to the subject. Contrast to AdverseEvent.seriousness - a severe rash might not be serious, but a mild heart problem is.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the type of outcome from the adverse event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recorder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information on who recorded the adverse event.  May be the patient or a practitioner.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contributor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Parties that may or should contribute or have contributed information to the adverse event, which can consist of one or more activities.  Such information includes information leading to the decision to perform the activity and how to perform the activity (e.g. consultant), information that the activity itself seeks to reveal (e.g. informant of clinical history), or information about what activity was performed (e.g. informant witness).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"suspectEntity\" type=\"AdverseEvent.SuspectEntity\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the entity that is suspected to have caused the adverse event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subjectMedicalHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">AdverseEvent.subjectMedicalHistory.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referenceDocument\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">AdverseEvent.referenceDocument.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"study\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">AdverseEvent.study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"AdverseEvent.SuspectEntity\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Actual or  potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"instance\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the actual instance of what caused the adverse event.  May be a substance, medication, medication administration, medication statement or a device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"causality\" type=\"AdverseEvent.Causality\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information on the possible cause of the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"AdverseEvent.Causality\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Actual or  potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"assessment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Assessment of if the entity caused the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productRelatedness\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">AdverseEvent.suspectEntity.causalityProductRelatedness.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">AdverseEvent.suspectEntity.causalityAuthor.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">ProbabilityScale | Bayesian | Checklist.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AdverseEventActuality-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"actual\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Adverse Event</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"potential\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Potential Adverse Event</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AdverseEventActuality\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Overall nature of the adverse event, e.g. real or potential.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AdverseEventActuality-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/allergyintolerance.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource AllergyIntolerance\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>AllergyIntolerance</sch:title>\n    <sch:rule context=\"f:AllergyIntolerance\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"f:verificationStatus/f:coding/f:code/@value='entered-in-error' or exists(f:clinicalStatus)\">ait-1: AllergyIntolerance.clinicalStatus SHALL be present if verificationStatus is not entered-in-error.</sch:assert>\n      <sch:assert test=\"not(f:verificationStatus/f:coding/f:code/@value='entered-in-error') or not(exists(f:clinicalStatus))\">ait-2: AllergyIntolerance.clinicalStatus SHALL NOT be present if verification Status is entered-in-error</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:onsetAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:onsetPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:onsetRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:onsetRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:onsetRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:recorder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:recorder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:recorder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:asserter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:asserter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:asserter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:reaction/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:reaction/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:reaction/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/allergyintolerance.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"AllergyIntolerance\" type=\"AllergyIntolerance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"AllergyIntolerance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this AllergyIntolerance by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"clinicalStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The clinical status of the allergy or intolerance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"verificationStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AllergyIntoleranceType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identification of the underlying physiological mechanism for the reaction risk.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"AllergyIntoleranceCategory\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Category of the identified substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"criticality\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AllergyIntoleranceCriticality\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., &quot;Latex&quot;), an allergy or intolerance condition (e.g., &quot;Latex allergy&quot;), or a negated/excluded code for a specific substance or class (e.g., &quot;No latex allergy&quot;) or a general or categorical negated statement (e.g.,  &quot;No known allergy&quot;, &quot;No known drug allergies&quot;).  Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient who has the allergy or intolerance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The encounter when the allergy or intolerance was asserted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Estimated or actual date,  date-time, or age when allergy or intolerance was identified.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"onsetDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"onsetAge\" type=\"Age\"/>\n            <xs:element name=\"onsetPeriod\" type=\"Period\"/>\n            <xs:element name=\"onsetRange\" type=\"Range\"/>\n            <xs:element name=\"onsetString\" type=\"string\"/>\n          </xs:choice>\n          <xs:element name=\"recordedDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recorder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Individual who recorded the record and takes responsibility for its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"asserter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The source of the information about the allergy that is recorded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastOccurrence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Represents the date and/or time of the last known occurrence of a reaction event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reaction\" type=\"AllergyIntolerance.Reaction\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details about each adverse reaction event linked to exposure to the identified substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"AllergyIntolerance.Reaction\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"substance\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manifestation\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Text description about the reaction as a whole, including details of the manifestation if required.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"onset\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Record of the date and/or time of the onset of the Reaction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"severity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AllergyIntoleranceSeverity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exposureRoute\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identification of the route by which the subject was exposed to the substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional text about the adverse reaction event not captured in other fields.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AllergyIntoleranceCriticality-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"low\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Low Risk</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"high\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">High Risk</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unable-to-assess\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unable to Assess Risk</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AllergyIntoleranceCriticality\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Estimate of the potential clinical harm, or seriousness, of a reaction to an identified substance.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AllergyIntoleranceCriticality-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AllergyIntoleranceType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"allergy\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Allergy</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"intolerance\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Intolerance</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AllergyIntoleranceType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Identification of the underlying physiological mechanism for a Reaction Risk.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AllergyIntoleranceType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AllergyIntoleranceCategory-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"food\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Food</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"medication\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Medication</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"environment\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Environment</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"biologic\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Biologic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AllergyIntoleranceCategory\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Category of an identified substance associated with allergies or intolerances.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AllergyIntoleranceCategory-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AllergyIntoleranceSeverity-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"mild\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Mild</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"moderate\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Moderate</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"severe\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Severe</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AllergyIntoleranceSeverity\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different manifestations.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AllergyIntoleranceSeverity-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/appointment.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Appointment\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Appointment</sch:title>\n    <sch:rule context=\"f:Appointment\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(exists(f:cancellationReason)) or f:status/@value=('no-show', 'cancelled')\">app-4: Cancelation reason is only used for appointments that have been cancelled, or no-show</sch:assert>\n      <sch:assert test=\"((exists(f:start) and exists(f:end)) or (f:status/@value='proposed') or (f:status/@value='cancelled') or (f:status/@value='waitlist'))\">app-3: Only proposed or cancelled appointments can be missing start/end dates</sch:assert>\n      <sch:assert test=\"((exists(f:start) and exists(f:end)) or (not(exists(f:start)) and not(exists(f:end))))\">app-2: Either start and end are specified, or neither</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:supportingInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:supportingInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:supportingInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:slot\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:slot/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:slot/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:participant\">\n      <sch:assert test=\"(exists(f:type) or exists(f:actor))\">app-1: Either the type or actor on the participant SHALL be specified</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:participant/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:participant/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:participant/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:participant/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:requestedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/appointment.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Appointment\" type=\"Appointment\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Appointment\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This records identifiers associated with this appointment concern that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"AppointmentStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cancelationReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The coded reason for the appointment being cancelled. This is often used in reporting/billing/futher processing to determine if further actions are required, or specific fees apply.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"serviceCategory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A broad categorization of the service that is to be performed during this appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"serviceType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific service that is to be performed during this appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specialty of a practitioner that would be required to perform the service requested in this appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"appointmentType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The style of appointment or patient that has been booked in the slot (not service type).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The coded reason that this appointment is being scheduled. This is more clinical than administrative.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reason the appointment has been scheduled to take place, as specified using information from another resource. When the patient arrives and the encounter begins it may be used as the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInformation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information to support the appointment provided when making the appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date/Time that the appointment is to take place.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date/Time that the appointment is to conclude.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"minutesDuration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number of minutes that the appointment is to take. This can be less than the duration between the start and end times.  For example, where the actual time of appointment is only an estimate or if a 30 minute appointment is being requested, but any time would work.  Also, if there is, for example, a planned 15 minute break in the middle of a long appointment, the duration may be 15 minutes less than the difference between the start and end.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"slot\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The slots from the participants' schedules that will be filled by the appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"created\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional comments about the appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patientInstruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">While Appointment.comment contains information for internal use, Appointment.patientInstructions is used to capture patient facing information about the Appointment (e.g. please bring your referral or fast from 8pm night before).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The service request this appointment is allocated to assess (e.g. incoming referral or procedure request).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"participant\" type=\"Appointment.Participant\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">List of participants involved in the appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requestedPeriod\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A set of date ranges (potentially including times) that the appointment is preferred to be scheduled within.\n\nThe duration (usually in minutes) could also be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time. However, in other situations the duration may be calculated by the scheduling system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Appointment.Participant\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Role of participant in the appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Person, Location/HealthcareService or Device that is participating in the appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"required\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ParticipantRequired\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this participant is required to be present at the meeting. This covers a use-case where two doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ParticipationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Participation status of the actor.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Participation period of the actor.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ParticipantRequired-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"required\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Required</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"optional\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Optional</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"information-only\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Information Only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ParticipantRequired\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Is the Participant required to attend the appointment.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ParticipantRequired-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AppointmentStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"proposed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Proposed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"pending\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Pending</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"booked\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Booked</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"arrived\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Arrived</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"fulfilled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Fulfilled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"noshow\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">No Show</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"checked-in\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Checked In</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"waitlist\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Waitlisted</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AppointmentStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The free/busy status of an appointment.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AppointmentStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ParticipationStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"accepted\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Accepted</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"declined\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Declined</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"tentative\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Tentative</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"needs-action\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Needs Action</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ParticipationStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Participation status of an appointment.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ParticipationStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/appointmentresponse.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource AppointmentResponse\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>AppointmentResponse</sch:title>\n    <sch:rule context=\"f:AppointmentResponse\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"(exists(f:participantType) or exists(f:actor))\">apr-1: Either the participantType or actor must be specified</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:appointment\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:appointment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:appointment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/appointmentresponse.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"AppointmentResponse\" type=\"AppointmentResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"AppointmentResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This records identifiers associated with this appointment response concern that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"appointment\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Appointment that this response is replying to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date/Time that the appointment is to take place, or requested new start time.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"participantType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Role of participant in the appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Person, Location, HealthcareService, or Device that is participating in the appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"participantStatus\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ParticipationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional comments about the appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/auditevent.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource AuditEvent\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>AuditEvent</sch:title>\n    <sch:rule context=\"f:AuditEvent\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:agent/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:agent/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:agent/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:agent/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:agent/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:agent/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:source/f:observer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:source/f:observer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:source/f:observer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:entity\">\n      <sch:assert test=\"not(exists(f:name)) or not(exists(f:query))\">sev-1: Either a name or a query (NOT both)</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:entity/f:what\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:entity/f:what/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:entity/f:what/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/auditevent.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"AuditEvent\" type=\"AuditEvent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"AuditEvent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtype\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for the category of event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"action\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AuditEventAction\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicator for type of action performed during the event that generated the audit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the activity occurred.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recorded\" minOccurs=\"1\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time when the event was recorded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AuditEventOutcome\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether the event succeeded or failed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcomeDesc\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text description of the outcome of the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purposeOfEvent\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The purposeOfUse (reason) that was used during the event being recorded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"agent\" type=\"AuditEvent.Agent\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An actor taking an active role in the event or activity that is logged.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" type=\"AuditEvent.Source\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The system that is reporting the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"entity\" type=\"AuditEvent.Entity\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific instances of data or objects that have been accessed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"AuditEvent.Agent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specification of the participation type the user plays when performing the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The security role that the user was acting under, that come from local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"who\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to who this agent is that was involved in the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"altId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-meaningful name for the agent.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requestor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicator that the user is or is not the requestor, or initiator, for the event being audited.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where the event occurred.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"policy\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"media\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of media involved. Used when the event is about exporting/importing onto media.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"network\" type=\"AuditEvent.Network\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Logical network location for application activity, if the activity has a network location.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purposeOfUse\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reason (purpose of use), specific to this agent, that was used during the event being recorded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"AuditEvent.Network\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An identifier for the network access point of the user device for the audit event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AuditEventAgentNetworkType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An identifier for the type of network access point that originated the audit event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"AuditEvent.Source\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"site\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"observer\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier of the source where the event was detected.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code specifying the type of source where event originated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"AuditEvent.Entity\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"what\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies a specific instance of the entity. The reference should be version specific.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the object that was involved in this audit event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code representing the role the entity played in the event being audited.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lifecycle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for the data life-cycle stage for the entity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"securityLabel\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Security labels for the identified entity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name of the entity in the audit event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Text that describes the entity in more detail.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"query\" minOccurs=\"0\" maxOccurs=\"1\" type=\"base64Binary\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The query parameters for a query-type entities.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" type=\"AuditEvent.Detail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Tagged value pairs for conveying additional information about the entity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"AuditEvent.Detail\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of extra detail provided in the value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The  value of the extra detail.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AuditEventOutcome-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Success</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"4\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Minor failure</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"8\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Serious failure</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"12\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Major failure</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AuditEventOutcome\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates whether the event succeeded or failed.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AuditEventOutcome-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AuditEventAction-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"C\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Create</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"R\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Read/View/Print</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"U\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Update</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"D\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Delete</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"E\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Execute</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AuditEventAction\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicator for type of action performed during the event that generated the event.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AuditEventAction-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AuditEventAgentNetworkType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Machine Name</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">IP Address</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"3\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Telephone Number</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"4\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Email address</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"5\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">URI</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AuditEventAgentNetworkType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of network access point of this agent in the audit event.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AuditEventAgentNetworkType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/basic.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Basic\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Basic</sch:title>\n    <sch:rule context=\"f:Basic\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/basic.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Basic\" type=\"Basic\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Basic\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier assigned to the resource for business purposes, outside the context of FHIR.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the 'type' of resource - equivalent to the resource name for other resources.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the patient, practitioner, device or any other resource that is the &quot;focus&quot; of this resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"created\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies when the resource was first created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates who was responsible for creating the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/binary.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Binary\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Binary</sch:title>\n    <sch:rule context=\"f:Binary/f:securityContext\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Binary/f:securityContext/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Binary/f:securityContext/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/binary.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Binary\" type=\"Binary\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A resource that represents the data of a single raw artifact as digital content accessible in its native format.  A Binary resource can contain any content, whether text, image, pdf, zip archive, etc.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Binary\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A resource that represents the data of a single raw artifact as digital content accessible in its native format.  A Binary resource can contain any content, whether text, image, pdf, zip archive, etc.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Resource\">\n        <xs:sequence>\n          <xs:element name=\"contentType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">MimeType of the binary content represented as a standard MimeType (BCP 13).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"securityContext\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This element identifies another resource that can be used as a proxy of the security sensitivity to use when deciding and enforcing access control rules for the Binary resource. Given that the Binary resource contains very few elements that can be used to determine the sensitivity of the data and relationships to individuals, the referenced resource stands in as a proxy equivalent for this purpose. This referenced resource may be related to the Binary (e.g. Media, DocumentReference), or may be some non-related Resource purely as a security proxy. E.g. to identify that the binary resource relates to a patient, and access should only be granted to applications that have access to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"data\" minOccurs=\"0\" maxOccurs=\"1\" type=\"base64Binary\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual content, base64 encoded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/biologicallyderivedproduct.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource BiologicallyDerivedProduct\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>BiologicallyDerivedProduct</sch:title>\n    <sch:rule context=\"f:BiologicallyDerivedProduct\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:parent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:parent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:parent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:collector\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:collector/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:collector/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:collectedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:processing/f:additive\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:processing/f:additive/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:processing/f:additive/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:processing/f:timePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:manipulation/f:timePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:storage/f:duration\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/biologicallyderivedproduct.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"BiologicallyDerivedProduct\" type=\"BiologicallyDerivedProduct\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A material substance originating from a biological entity intended to be transplanted or infused\ninto another (possibly the same) biological entity.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"BiologicallyDerivedProduct\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A material substance originating from a biological entity intended to be transplanted or infused\ninto another (possibly the same) biological entity.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This records identifiers associated with this biologically derived product instance that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productCategory\" minOccurs=\"0\" maxOccurs=\"1\" type=\"BiologicallyDerivedProductCategory\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Broad category of this product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that identifies the kind of this biologically derived product (SNOMED Ctcode).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"BiologicallyDerivedProductStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the product is currently available.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Procedure request to obtain this biologically derived product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number of discrete units within this product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parent\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Parent product (if any).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"collection\" type=\"BiologicallyDerivedProduct.Collection\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How this product was collected.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"processing\" type=\"BiologicallyDerivedProduct.Processing\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Any processing of the product during collection that does not change the fundamental nature of the product. For example adding anti-coagulants during the collection of Peripheral Blood Stem Cells.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manipulation\" type=\"BiologicallyDerivedProduct.Manipulation\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Any manipulation of product post-collection that is intended to alter the product.  For example a buffy-coat enrichment or CD8 reduction of Peripheral Blood Stem Cells to make it more suitable for infusion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"storage\" type=\"BiologicallyDerivedProduct.Storage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Product storage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"BiologicallyDerivedProduct.Collection\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A material substance originating from a biological entity intended to be transplanted or infused\ninto another (possibly the same) biological entity.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"collector\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Healthcare professional who is performing the collection.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient or entity, such as a hospital or vendor in the case of a processed/manipulated/manufactured product, providing the product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time of product collection.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"collectedDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"collectedPeriod\" type=\"Period\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"BiologicallyDerivedProduct.Processing\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A material substance originating from a biological entity intended to be transplanted or infused\ninto another (possibly the same) biological entity.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of of processing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"procedure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Procesing code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"additive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Substance added during processing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time of processing.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"timeDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"timePeriod\" type=\"Period\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"BiologicallyDerivedProduct.Manipulation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A material substance originating from a biological entity intended to be transplanted or infused\ninto another (possibly the same) biological entity.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of manipulation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time of manipulation.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"timeDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"timePeriod\" type=\"Period\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"BiologicallyDerivedProduct.Storage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A material substance originating from a biological entity intended to be transplanted or infused\ninto another (possibly the same) biological entity.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of storage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"temperature\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Storage temperature.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"scale\" minOccurs=\"0\" maxOccurs=\"1\" type=\"BiologicallyDerivedProductStorageScale\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Temperature scale used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"duration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Storage timeperiod.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"BiologicallyDerivedProductCategory-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"organ\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Organ</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"tissue\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Tissue</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"fluid\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Fluid</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cells\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cells</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"biologicalAgent\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BiologicalAgent</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"BiologicallyDerivedProductCategory\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Biologically Derived Product Category.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"BiologicallyDerivedProductCategory-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"BiologicallyDerivedProductStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"available\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Available</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unavailable\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unavailable</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"BiologicallyDerivedProductStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Biologically Derived Product Status.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"BiologicallyDerivedProductStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"BiologicallyDerivedProductStorageScale-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"farenheit\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Fahrenheit</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"celsius\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Celsius</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"kelvin\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Kelvin</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"BiologicallyDerivedProductStorageScale\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">BiologicallyDerived Product Storage Scale.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"BiologicallyDerivedProductStorageScale-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/bodystructure.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource BodyStructure\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>BodyStructure</sch:title>\n    <sch:rule context=\"f:BodyStructure\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:image\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/bodystructure.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"BodyStructure\" type=\"BodyStructure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Record details about an anatomical structure.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"BodyStructure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Record details about an anatomical structure.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for this instance of the anatomical structure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this body site is in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"morphology\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of structure being represented by the body structure at `BodyStructure.location`.  This can define both normal and abnormal morphologies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The anatomical location or region of the specimen, lesion, or body structure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"locationQualifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Qualifier to refine the anatomical location.  These include qualifiers for laterality, relative location, directionality, number, and plane.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A summary, characterization or explanation of the body structure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"image\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Image or images used to identify a location.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person to which the body site belongs.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/bundle.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Bundle\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Bundle</sch:title>\n    <sch:rule context=\"f:Bundle\">\n      <sch:assert test=\"(f:type/@value = 'history') or (count(for $entry in f:entry[f:resource] return $entry[count(parent::f:Bundle/f:entry[f:fullUrl/@value=$entry/f:fullUrl/@value and ((not(f:resource/*/f:meta/f:versionId/@value) and not($entry/f:resource/*/f:meta/f:versionId/@value)) or f:resource/*/f:meta/f:versionId/@value=$entry/f:resource/*/f:meta/f:versionId/@value)])!=1])=0)\">bdl-7: FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId (except in history bundles)</sch:assert>\n      <sch:assert test=\"not(f:type/@value = 'document') or exists(f:identifier/f:system) or exists(f:identifier/f:value)\">bdl-9: A document must have an identifier with a system and a value</sch:assert>\n      <sch:assert test=\"not(f:entry/f:request) or (f:type/@value = 'batch') or (f:type/@value = 'transaction') or (f:type/@value = 'history')\">bdl-3: entry.request mandatory for batch/transaction/history, otherwise prohibited</sch:assert>\n      <sch:assert test=\"not(f:entry/f:response) or (f:type/@value = 'batch-response') or (f:type/@value = 'transaction-response') or (f:type/@value = 'history')\">bdl-4: entry.response mandatory for batch-response/transaction-response/history, otherwise prohibited</sch:assert>\n      <sch:assert test=\"not(f:type/@value='message') or f:entry[1]/f:resource/f:MessageHeader\">bdl-12: A message must have a MessageHeader as the first resource</sch:assert>\n      <sch:assert test=\"not(f:total) or (f:type/@value = 'searchset') or (f:type/@value = 'history')\">bdl-1: total only when a search or history</sch:assert>\n      <sch:assert test=\"not(f:entry/f:search) or (f:type/@value = 'searchset')\">bdl-2: entry.search only when a search</sch:assert>\n      <sch:assert test=\"not(f:type/@value='document') or f:entry[1]/f:resource/f:Composition\">bdl-11: A document must have a Composition as the first resource</sch:assert>\n      <sch:assert test=\"not(f:type/@value = 'document') or exists(f:timestamp/@value)\">bdl-10: A document must have a date</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:entry\">\n      <sch:assert test=\"not(exists(f:fullUrl[contains(string(@value), '/_history/')]))\">bdl-8: fullUrl cannot be a version specific reference</sch:assert>\n      <sch:assert test=\"exists(f:resource) or exists(f:request) or exists(f:response)\">bdl-5: must be a resource unless there's a request or response</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:signature/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:signature/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:signature/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:signature/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:signature/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:signature/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/bundle.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Bundle\" type=\"Bundle\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Bundle\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Resource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A persistent identifier for the bundle that won't change as a bundle is copied from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"BundleType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the purpose of this bundle - how it is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"timestamp\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"total\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If a set of search matches, this is the total number of entries of type 'match' across all pages in the search.  It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"link\" type=\"Bundle.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A series of links that provide context to this bundle.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"entry\" type=\"Bundle.Entry\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"signature\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Signature\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Digital Signature - base64 encoded. XML-DSig or a JWT.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Bundle.Link\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"relation\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reference details for the link.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Bundle.Entry\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"link\" type=\"Bundle.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A series of links that provide context to this entry.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fullUrl\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Absolute URL for the resource.  The fullUrl SHALL NOT disagree with the id in the resource - i.e. if the fullUrl is not a urn:uuid, the URL shall be version-independent URL consistent with the Resource.id. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: \n* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)\n* Results from operations might involve resources that are not identified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ResourceContainer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Resource for the entry. The purpose/meaning of the resource is determined by the Bundle.type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"search\" type=\"Bundle.Search\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the search process that lead to the creation of this entry.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"request\" type=\"Bundle.Request\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information about how this entry should be processed as part of a transaction or batch.  For history, it shows how the entry was processed to create the version contained in the entry.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"response\" type=\"Bundle.Response\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning history.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Bundle.Search\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"mode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SearchEntryMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Why this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"score\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When searching, the server's search ranking score for the entry.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Bundle.Request\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"method\" minOccurs=\"1\" maxOccurs=\"1\" type=\"HTTPVerb\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">In a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurred.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL for this entry, relative to the root (the address to which the request is posted).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"ifNoneMatch\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the ETag values match, return a 304 Not Modified status. See the API documentation for [&quot;Conditional Read&quot;](http.html#cread).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"ifModifiedSince\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Only perform the operation if the last updated date matches. See the API documentation for [&quot;Conditional Read&quot;](http.html#cread).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"ifMatch\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Only perform the operation if the Etag value matches. For more information, see the API section [&quot;Managing Resource Contention&quot;](http.html#concurrency).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"ifNoneExist\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [&quot;Conditional Create&quot;](http.html#ccreate). This is just the query portion of the URL - what follows the &quot;?&quot; (not including the &quot;?&quot;).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Bundle.Response\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The location header created by processing this operation, populated if the operation returns a location.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"etag\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Etag for the resource, if the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastModified\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date/time that the resource was modified on the server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ResourceContainer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"HTTPVerb-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"GET\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GET</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"HEAD\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">HEAD</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"POST\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">POST</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PUT\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PUT</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DELETE\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DELETE</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PATCH\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PATCH</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"HTTPVerb\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">HTTP verbs (in the HTTP command line). See [HTTP rfc](https://tools.ietf.org/html/rfc7231) for details.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"HTTPVerb-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"BundleType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"document\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Document</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"message\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Message</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"transaction\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Transaction</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"transaction-response\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Transaction Response</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"batch\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Batch</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"batch-response\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Batch Response</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"history\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">History List</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"searchset\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Search Results</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"collection\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Collection</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"BundleType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates the purpose of a bundle - how it is intended to be used.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"BundleType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SearchEntryMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"match\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Match</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"include\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Include</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"outcome\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Outcome</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SearchEntryMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Why an entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"SearchEntryMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/capabilitystatement.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource CapabilityStatement\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CapabilityStatement</sch:title>\n    <sch:rule context=\"f:CapabilityStatement\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(f:document[f:mode/@value='producer'])=count(distinct-values(f:document[f:mode/@value='producer']/f:profile/f:reference/@value)) and count(f:document[f:mode/@value='consumer'])=count(distinct-values(f:document[f:mode/@value='consumer']/f:profile/f:reference/@value))\">cpb-7: The set of documents must be unique by the combination of profile and mode.</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='instance') or (not(exists(f:implementation)) and not(exists(f:software)))\">cpb-16: If kind = requirements, implementation and software must be absent</sch:assert>\n      <sch:assert test=\" not(f:kind/@value='instance') or (not(exists(f:implementation)) and exists(f:software))\">cpb-15: If kind = capability, implementation must be absent, software must be present</sch:assert>\n      <sch:assert test=\"not(exists(f:messaging/f:endpoint)) or f:kind/@value = 'instance'\">cpb-3: Messaging end-point is required (and is only permitted) when a statement is for an implementation.</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='instance') or exists(f:implementation)\">cpb-14: If kind = instance, implementation must be present and software may be present</sch:assert>\n      <sch:assert test=\"count(f:software | f:implementation | f:description) &gt; 0\">cpb-2: A Capability Statement SHALL have at least one of description, software, or implementation element.</sch:assert>\n      <sch:assert test=\"exists(f:rest) or exists(f:messaging) or exists(f:document)\">cpb-1: A Capability Statement SHALL have at least one of REST, messaging or document element.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:implementation/f:custodian\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:implementation/f:custodian/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:implementation/f:custodian/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:rest\">\n      <sch:assert test=\"count(f:resource)=count(distinct-values(f:resource/f:type/@value))\">cpb-9: A given resource can only be described once per RESTful mode.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:rest/f:resource\">\n      <sch:assert test=\"count(f:searchParam)=count(distinct-values(f:searchParam/f:name/@value))\">cpb-12: Search parameter names must be unique in the context of a resource.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/capabilitystatement.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"CapabilityStatement\" type=\"CapabilityStatement\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"CapabilityStatement\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this capability statement when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this capability statement is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the capability statement is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the capability statement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this capability statement. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the capability statement was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the capability statement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate capability statement instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the capability statement is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this capability statement is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CapabilityStatementKind\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind, not instance of software) or a class of implementation (e.g. a desired purchase).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiates\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to a canonical URL of another CapabilityStatement that this software implements. This capability statement is a published API description that corresponds to a business service. The server may actually implement a subset of the capability statement it claims to implement, so the capability statement must specify the full capability details.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"imports\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to a canonical URL of another CapabilityStatement that this software adds to. The capability statement automatically includes everything in the other statement, and it is not duplicated, though the server may repeat the same resources, interactions and operations to add additional details to them.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"software\" type=\"CapabilityStatement.Software\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"implementation\" type=\"CapabilityStatement.Implementation\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fhirVersion\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FHIRVersion\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version of the FHIR specification that this CapabilityStatement describes (which SHALL be the same as the FHIR version of the CapabilityStatement itself). There is no default value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"format\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of the formats supported by this implementation using their content types.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patchFormat\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of the patch formats supported by this implementation using their content types.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"implementationGuide\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of implementation guides that the server does (or should) support in their entirety.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rest\" type=\"CapabilityStatement.Rest\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A definition of the restful capabilities of the solution, if any.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"messaging\" type=\"CapabilityStatement.Messaging\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the messaging capabilities of the solution.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"document\" type=\"CapabilityStatement.Document\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A document definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.Software\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name the software is known by.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version identifier for the software covered by this statement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"releaseDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date this version of the software was released.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.Implementation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the specific installation that this capability statement relates to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"url\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"custodian\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization responsible for the management of the instance and oversight of the data on the server at the specified URL.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.Rest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RestfulCapabilityMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the system's restful capabilities that apply across all applications, such as security.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"security\" type=\"CapabilityStatement.Security\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about security implementation from an interface perspective - what a client needs to know.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resource\" type=\"CapabilityStatement.Resource\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A specification of the restful capabilities of the solution for a specific resource type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"interaction\" type=\"CapabilityStatement.Interaction1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A specification of restful operations supported by the system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"searchParam\" type=\"CapabilityStatement.SearchParam\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"operation\" type=\"CapabilityStatement.Operation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Definition of an operation or a named query together with its parameters and their meaning and type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"compartment\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.Security\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"cors\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Server adds CORS headers when responding to requests - this enables Javascript applications to use the server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"service\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Types of security services that are supported/required by the system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">General description of how security works.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.Resource\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A type of resource exposed via the restful interface.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportedProfile\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of profiles that represent different use cases supported by the system. For a server, &quot;supported by the system&quot; means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information about the resource type used by the system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"interaction\" type=\"CapabilityStatement.Interaction\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies a restful operation supported by the solution.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"versioning\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ResourceVersionPolicy\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"readHistory\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A flag for whether the server is able to return past versions as part of the vRead operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"updateCreate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A flag to indicate that the server allows or needs to allow the client to create new identities on the server (that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"conditionalCreate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A flag that indicates that the server supports conditional create.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"conditionalRead\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ConditionalReadStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that indicates how the server supports conditional read.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"conditionalUpdate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A flag that indicates that the server supports conditional update.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"conditionalDelete\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ConditionalDeleteStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that indicates how the server supports conditional delete.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referencePolicy\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ReferenceHandlingPolicy\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A set of flags that defines how references are supported.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"searchInclude\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of _include values supported by the server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"searchRevInclude\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of _revinclude (reverse include) values supported by the server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"searchParam\" type=\"CapabilityStatement.SearchParam\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"operation\" type=\"CapabilityStatement.Operation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Definition of an operation or a named query together with its parameters and their meaning and type. Consult the definition of the operation for details about how to invoke the operation, and the parameters.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.Interaction\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TypeRestfulInteraction\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Coded identifier of the operation, supported by the system resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.SearchParam\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the search parameter used in the interface.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). This element SHALL be populated if the search parameter refers to a SearchParameter defined by the FHIR core specification or externally defined IGs.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SearchParamType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of value a search parameter refers to, and how the content is interpreted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.Operation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definition\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where the formal definition can be found. If a server references the base definition of an Operation (i.e. from the specification itself such as ```http://hl7.org/fhir/OperationDefinition/ValueSet-expand```), that means it supports the full capabilities of the operation - e.g. both GET and POST invocation.  If it only supports a subset, it must define its own custom [[[OperationDefinition]]] with a 'base' of the original OperationDefinition.  The custom definition would describe the specific subset of functionality supported.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Documentation that describes anything special about the operation behavior, possibly detailing different behavior for system, type and instance-level invocation of the operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.Interaction1\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SystemRestfulInteraction\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A coded identifier of the operation, supported by the system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.Messaging\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"endpoint\" type=\"CapabilityStatement.Endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An endpoint (network accessible address) to which messages and/or replies are to be sent.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reliableCache\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportedMessage\" type=\"CapabilityStatement.SupportedMessage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">References to message definitions for messages this system can send or receive.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.Endpoint\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"protocol\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of the messaging transport protocol(s) identifiers, supported by this endpoint.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"address\" minOccurs=\"1\" maxOccurs=\"1\" type=\"url\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The network address of the endpoint. For solutions that do not use network addresses for routing, it can be just an identifier.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.SupportedMessage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EventCapabilityMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The mode of this event declaration - whether application is sender or receiver.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definition\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CapabilityStatement.Document\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DocumentMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Mode of this document declaration - whether an application is a producer or consumer.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A profile on the document Bundle that constrains which resources are present, and their contents.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"CapabilityStatementKind-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"instance\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Instance</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"capability\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Capability</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"requirements\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Requirements</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"CapabilityStatementKind\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How a capability statement is intended to be used.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"CapabilityStatementKind-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"EventCapabilityMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"sender\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Sender</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"receiver\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Receiver</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"EventCapabilityMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The mode of a message capability statement.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"EventCapabilityMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ResourceVersionPolicy-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"no-version\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">No VersionId Support</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"versioned\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Versioned</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"versioned-update\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">VersionId tracked fully</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ResourceVersionPolicy\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How the system supports versioning for a resource.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ResourceVersionPolicy-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DocumentMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"producer\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Producer</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"consumer\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Consumer</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DocumentMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Whether the application produces or consumes documents.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"DocumentMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"RestfulCapabilityMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"client\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Client</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"server\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Server</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"RestfulCapabilityMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The mode of a RESTful capability statement.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"RestfulCapabilityMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"TypeRestfulInteraction-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"read\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">read</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"vread\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">vread</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"update\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">update</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"patch\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">patch</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"delete\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">delete</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"history-instance\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">history-instance</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"history-type\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">history-type</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"create\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">create</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"search-type\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">search-type</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"TypeRestfulInteraction\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Operations supported by REST at the type or instance level.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"TypeRestfulInteraction-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SystemRestfulInteraction-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"transaction\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">transaction</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"batch\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">batch</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"search-system\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">search-system</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"history-system\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">history-system</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SystemRestfulInteraction\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Operations supported by REST at the system level.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"SystemRestfulInteraction-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ConditionalReadStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"not-supported\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not Supported</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"modified-since\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">If-Modified-Since</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"not-match\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">If-None-Match</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"full-support\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Full Support</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ConditionalReadStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A code that indicates how the server supports conditional read.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ConditionalReadStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ReferenceHandlingPolicy-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"literal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Literal References</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"logical\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Logical References</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"resolves\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Resolves References</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"enforced\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Reference Integrity Enforced</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"local\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Local References Only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ReferenceHandlingPolicy\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of flags that defines how references are supported.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ReferenceHandlingPolicy-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ConditionalDeleteStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"not-supported\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not Supported</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"single\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Single Deletes Supported</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"multiple\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Multiple Deletes Supported</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ConditionalDeleteStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A code that indicates how the server supports conditional delete.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ConditionalDeleteStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/careplan.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource CarePlan\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CarePlan</sch:title>\n    <sch:rule context=\"f:CarePlan\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:replaces\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:replaces/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:replaces/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:contributor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:contributor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:contributor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:careTeam\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:careTeam/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:careTeam/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:addresses\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:addresses/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:addresses/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:supportingInfo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:supportingInfo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:supportingInfo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:goal\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:goal/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:goal/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity\">\n      <sch:assert test=\"not(exists(f:detail)) or not(exists(f:reference))\">cpl-3: Provide a reference or detail, not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:outcomeReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:outcomeReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:outcomeReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:progress/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:progress/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:progress/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:reference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:reference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:reference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:goal\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:goal/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:goal/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:productReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:productReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:productReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:dailyAmount\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/careplan.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"CarePlan\" type=\"CarePlan\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"CarePlan\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this care plan by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A care plan that is fulfilled in whole or in part by this care plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"replaces\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Completed or terminated care plan whose function is taken by this new care plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A larger care plan of which this particular care plan is a component or step.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CarePlanIntent\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies what &quot;kind&quot; of plan this is to support differentiation between multiple co-existing plans; e.g. &quot;Home health&quot;, &quot;psychiatric&quot;, &quot;asthma&quot;, &quot;disease management&quot;, &quot;wellness plan&quot;, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-friendly name for the care plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the scope and nature of the plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the patient or group whose intended care is described by the plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Encounter during which this CarePlan was created or to which the creation of this record is tightly associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates when the plan did (or is intended to) come into effect and end.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"created\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Represents when this particular CarePlan record was created in the system, which is often a system-generated date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When populated, the author is responsible for the care plan.  The care plan is attributed to the author.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contributor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the individual(s) or organization who provided the contents of the care plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"careTeam\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"addresses\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include comorbidities, recent procedures, limitations, recent assessments, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"goal\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the intended objective(s) of carrying out the care plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"activity\" type=\"CarePlan.Activity\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">General notes about the care plan not covered elsewhere.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CarePlan.Activity\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"outcomeCodeableConcept\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the outcome at the point when the status of the activity is assessed.  For example, the outcome of an education activity could be patient understands (or not).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcomeReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details of the outcome or action resulting from the activity.  The reference to an &quot;event&quot; resource, such as Procedure or Encounter or Observation, is the result/outcome of the activity itself.  The activity can be conveyed using CarePlan.activity.detail OR using the CarePlan.activity.reference (a reference to a “request” resource).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"progress\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Notes about the adherence/status/progress of the activity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The details of the proposed activity represented in a specific resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" type=\"CarePlan.Detail\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CarePlan.Detail\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"kind\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CarePlanActivityKind\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the kind of resource the in-line definition of a care plan activity is representing.  The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference.  For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan activity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan activity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Detailed description of the type of planned activity; e.g. what lab test, what procedure, what kind of encounter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates another resource, such as the health condition(s), whose existence justifies this request and drove the inclusion of this particular activity as part of the plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"goal\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Internal reference that identifies the goals that this activity is intended to contribute towards meeting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CarePlanActivityStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies what progress is being made for the specific activity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"doNotPerform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If true, indicates that the described activity is one that must NOT be engaged in when following the plan.  If false, or missing, indicates that the described activity is one that should be engaged in when following the plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period, timing or frequency upon which the described activity is to occur.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"scheduledTiming\" type=\"Timing\"/>\n            <xs:element name=\"scheduledPeriod\" type=\"Period\"/>\n            <xs:element name=\"scheduledString\" type=\"string\"/>\n          </xs:choice>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies who's expected to be involved in the activity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the food, drug or other product to be consumed or supplied in the activity.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"productCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"productReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"dailyAmount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the quantity expected to be consumed in a given day.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the quantity expected to be supplied, administered or consumed by the subject.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This provides a textual description of constraints on the intended activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"CarePlanActivityKind-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"Appointment\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Appointment</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Appointment</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Appuntamento</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RendezVous</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Cita</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">预约</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CommunicationRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CommunicationRequest</xs:documentation>\n          <xs:documentation xml:lang=\"en\">CommunicationRequest</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RichiestaDiComunicazione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">DemandeDeCommunication</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ComunicaciónRequerimiento</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">通讯请求</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DeviceRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DeviceRequest</xs:documentation>\n          <xs:documentation xml:lang=\"en\">DeviceRequest</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RichiestaDispositivo</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">DemandeUtilisationDispositif</xs:documentation>\n          <xs:documentation xml:lang=\"es\">SolicitudDeDispositivo</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">装置请求</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicationRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicationRequest</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicationRequest</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">PrescriptionMédicamenteuseTODO</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">药物请求</xs:documentation>\n          <xs:documentation xml:lang=\"es\">PrescripciónMedicaciónTODO  /PrescripcionMedicamento</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NutritionOrder\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">NutritionOrder</xs:documentation>\n          <xs:documentation xml:lang=\"en\">NutritionOrder</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">OrdreNutrition</xs:documentation>\n          <xs:documentation xml:lang=\"es\">OrdenNutrición</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">营养医嘱</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Task\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Task</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Task</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Tarea</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">任务</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ServiceRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ServiceRequest</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ServiceRequest</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RichiestaDiServizio</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">DemandeService</xs:documentation>\n          <xs:documentation xml:lang=\"es\">PeticiónServicio</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">服务项目请求</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"VisionPrescription\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">VisionPrescription</xs:documentation>\n          <xs:documentation xml:lang=\"en\">VisionPrescription</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">PrescriptionVision</xs:documentation>\n          <xs:documentation xml:lang=\"es\">PrescripcionDeVision</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">视力处方</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"CarePlanActivityKind\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Resource types defined as part of FHIR that can be represented as in-line definitions of a care plan activity.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"CarePlanActivityKind-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"CarePlanActivityStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"not-started\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not Started</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"scheduled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Scheduled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"in-progress\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-hold\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"stopped\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Stopped</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"CarePlanActivityStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Codes that reflect the current state of a care plan activity within its overall life cycle.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"CarePlanActivityStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"CarePlanIntent-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"proposal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Proposal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"plan\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Plan</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"option\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Option</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"CarePlanIntent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Codes indicating the degree of authority/intentionality associated with a care plan.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"CarePlanIntent-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"RequestStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"draft\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-hold\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"revoked\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Revoked</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"RequestStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"RequestStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/careteam.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource CareTeam\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CareTeam</sch:title>\n    <sch:rule context=\"f:CareTeam\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant\">\n      <sch:assert test=\"starts-with(f:member/f:reference/@value, 'Practitioner/') or contains(f:member/f:reference/@value, '/Practitioner/') or exists(ancestor::*/f:contains/f:Practitioner/f:id[@value=substring-after(current()/f:member/f:reference/@value, '#')]) or not(exists(f:onBehalfOf))\">ctm-1: CareTeam.participant.onBehalfOf can only be populated when CareTeam.participant.member is a Practitioner</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:member\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:member/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:member/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:onBehalfOf/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:managingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:managingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:managingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/careteam.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"CareTeam\" type=\"CareTeam\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"CareTeam\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this care team by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CareTeamStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the current state of the care team.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies what kind of team.  This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A label for human use intended to distinguish like teams.  E.g. the &quot;red&quot; vs. &quot;green&quot; trauma teams.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the patient or group whose intended care is handled by the team.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates when the team did (or is intended to) come into effect and end.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"participant\" type=\"CareTeam.Participant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies all people and organizations who are expected to be involved in the care team.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes why the care team exists.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Condition(s) that this care team addresses.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"managingOrganization\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization responsible for the care team.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A central contact detail for the care team (that applies to all members).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments made about the CareTeam.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CareTeam.Participant\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates specific responsibility of an individual within the care team, such as &quot;Primary care physician&quot;, &quot;Trained social worker counselor&quot;, &quot;Caregiver&quot;, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"member\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific person or organization who is participating/expected to participate in the care team.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"onBehalfOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization of the practitioner.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates when the specific member or organization did (or is intended to) come into effect and end.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"CareTeamStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"proposed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Proposed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"suspended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Suspended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"inactive\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"CareTeamStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates the status of the care team.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"CareTeamStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/catalogentry.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource CatalogEntry\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CatalogEntry</sch:title>\n    <sch:rule context=\"f:CatalogEntry\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:referencedItem\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:referencedItem/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:referencedItem/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:additionalIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:additionalIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:validityPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:relatedEntry/f:item\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:relatedEntry/f:item/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:relatedEntry/f:item/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/catalogentry.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"CatalogEntry\" type=\"CatalogEntry\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Catalog entries are wrappers that contextualize items included in a catalog.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"CatalogEntry\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Catalog entries are wrappers that contextualize items included in a catalog.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used in supporting different identifiers for the same product, e.g. manufacturer code and retailer code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of item - medication, device, service, protocol or other.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"orderable\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the entry represents an orderable item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referencedItem\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The item in a catalog or definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"additionalIdentifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used in supporting related concepts, e.g. NDC to RxNorm.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"classification\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Classes of devices, or ATC for medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used to support catalog exchange even for unsupported products, e.g. getting list of medications even if not prescribable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validityPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time period in which this catalog entry is expected to be active.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validTo\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date until which this catalog entry is expected to be active.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastUpdated\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Typically date of issue is different from the beginning of the validity. This can be used to see when an item was last updated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"additionalCharacteristic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used for examplefor Out of Formulary, or any specifics.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"additionalClassification\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">User for example for ATC classification, or.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedEntry\" type=\"CatalogEntry.RelatedEntry\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used for example, to point to a substance, or to a device used to administer a medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CatalogEntry.RelatedEntry\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Catalog entries are wrappers that contextualize items included in a catalog.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"relationtype\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CatalogEntryRelationType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of relation to the related item: child, parent, packageContent, containerPackage, usedIn, uses, requires, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reference to the related item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"CatalogEntryRelationType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"triggers\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Triggers</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"is-replaced-by\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Replaced By</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"CatalogEntryRelationType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of relations between entries.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"CatalogEntryRelationType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/chargeitem.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ChargeItem\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ChargeItem</sch:title>\n    <sch:rule context=\"f:ChargeItem\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:context\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:context/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:context/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrenceTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrenceTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrenceTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrenceTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrenceTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrenceTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:performer/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:performer/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:performer/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:performingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:performingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:performingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:requestingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:requestingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:requestingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:costCenter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:costCenter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:costCenter/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:enterer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:enterer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:enterer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:service\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:service/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:service/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:productReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:productReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:productReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:account\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:account/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:account/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:supportingInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:supportingInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:supportingInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/chargeitem.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ChargeItem\" type=\"ChargeItem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ChargeItem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this event performer or other systems.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definitionUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">References the (external) source of pricing information, rules of application for the code this ChargeItem uses.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definitionCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">References the source of pricing information, rules of application for the code this ChargeItem uses.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ChargeItemStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The current state of the ChargeItem.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">ChargeItems can be grouped to larger ChargeItems covering the whole set.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that identifies the charge, like a billing code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual or set of individuals the action is being or was performed on.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The encounter or episode of care that establishes the context for this event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date/time(s) or duration when the charged service was applied.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\n            <xs:element name=\"occurrenceTiming\" type=\"Timing\"/>\n          </xs:choice>\n          <xs:element name=\"performer\" type=\"ChargeItem.Performer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed or participated in the charged service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization requesting the service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requestingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization performing the service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"costCenter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The financial cost center permits the tracking of charge attribution.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Quantity of which the charge item has been serviced.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodysite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The anatomical location where the related service has been applied.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factorOverride\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Factor overriding the factor determined by the rules associated with the code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priceOverride\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Total price of the charge overriding the list price associated with the code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"overrideReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the list price or the rule-based factor associated with the code is overridden, this attribute can capture a text to indicate the  reason for this action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"enterer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The device, practitioner, etc. who entered the charge item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"enteredDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date the charge item was entered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes why the event occurred in coded or textual form.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"service\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicated the rendered service that caused this charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the device, food, drug or other product being charged either by type code or reference to an instance.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"productReference\" type=\"Reference\"/>\n            <xs:element name=\"productCodeableConcept\" type=\"CodeableConcept\"/>\n          </xs:choice>\n          <xs:element name=\"account\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Account into which this ChargeItems belongs.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments made about the event by the performer, subject or other participants.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInformation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Further information supporting this charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ChargeItem.Performer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"function\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the type of performance or participation(e.g. primary surgeon, anesthesiologiest, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The device, practitioner, etc. who performed or participated in the service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ChargeItemStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"planned\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Planned</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"billable\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Billable</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"not-billable\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not billable</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"aborted\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Aborted</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"billed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Billed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ChargeItemStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Codes identifying the lifecycle stage of a ChargeItem.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ChargeItemStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/chargeitemdefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ChargeItemDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ChargeItemDefinition</sch:title>\n    <sch:rule context=\"f:ChargeItemDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:instance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:instance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:instance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/chargeitemdefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ChargeItemDefinition\" type=\"ChargeItemDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ChargeItemDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this charge item definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this charge item definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the charge item definition is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this charge item definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the charge item definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the charge item definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the charge item definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"derivedFromUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally-defined charge item definition that is adhered to in whole or in part by this definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A larger definition of which this particular definition is a component or step.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"replaces\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">As new versions of a protocol or guideline are defined, allows identification of what versions are replaced by a new instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The current state of the ChargeItemDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this charge item definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the charge item definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the charge item definition changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the charge item definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the charge item definition from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate charge item definition instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the charge item definition is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the charge item definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the charge item definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the charge item definition content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The defined billing details in this resource pertain to the given billing code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instance\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The defined billing details in this resource pertain to the given product instance(s).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"applicability\" type=\"ChargeItemDefinition.Applicability\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Expressions that describe applicability criteria for the billing code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"propertyGroup\" type=\"ChargeItemDefinition.PropertyGroup\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Group of properties which are applicable under the same conditions. If no applicability rules are established for the group, then all properties always apply.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ChargeItemDefinition.Applicability\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A brief, natural language description of the condition that effectively communicates the intended semantics.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The media type of the language for the expression, e.g. &quot;text/cql&quot; for Clinical Query Language expressions or &quot;text/fhirpath&quot; for FHIRPath expressions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An expression that returns true or false, indicating whether the condition is satisfied. When using FHIRPath expressions, the %context environment variable must be replaced at runtime with the ChargeItem resource to which this definition is applied.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ChargeItemDefinition.PropertyGroup\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"applicability\" type=\"ChargeItemDefinition.Applicability\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Expressions that describe applicability criteria for the priceComponent.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priceComponent\" type=\"ChargeItemDefinition.PriceComponent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice of how the prices have been calculated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ChargeItemDefinition.PriceComponent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"InvoicePriceComponentType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This code identifies the type of the component.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that identifies the component. Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The factor that has been applied on the base price for calculating this component.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount calculated for this component.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"InvoicePriceComponentType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"base\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">base price</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"surcharge\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">surcharge</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"deduction\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">deduction</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"discount\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">discount</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"tax\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">tax</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"informational\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">informational</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"InvoicePriceComponentType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Codes indicating the kind of the price component.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"InvoicePriceComponentType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/claim.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Claim\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Claim</sch:title>\n    <sch:rule context=\"f:Claim\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:billablePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:enterer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:enterer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:enterer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:related/f:claim\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:related/f:claim/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:related/f:claim/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:related/f:reference/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:related/f:reference/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:prescription\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:prescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:prescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:originalPrescription\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:originalPrescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:originalPrescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:payee/f:party\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:payee/f:party/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:payee/f:party/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:referral\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:referral/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:referral/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:facility\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:facility/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:facility/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:careTeam/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:careTeam/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:careTeam/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:supportingInfo/f:timingPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:supportingInfo/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:supportingInfo/f:valueAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:supportingInfo/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:supportingInfo/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:supportingInfo/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:diagnosis/f:diagnosisReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:diagnosis/f:diagnosisReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:diagnosis/f:diagnosisReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:procedure/f:procedureReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:procedure/f:procedureReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:procedure/f:procedureReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:procedure/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:procedure/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:procedure/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:claimResponse\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:claimResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:claimResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:accident/f:locationAddress/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:accident/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:accident/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:accident/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:servicedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:locationAddress/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:subDetail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:subDetail/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:subDetail/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:subDetail/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/claim.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Claim\" type=\"Claim\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Claim\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The category of claim, e.g. oral, pharmacy, vision, institutional, professional.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"use\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Use\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to indicate whether the nature of the request is: to request adjudication of products and services previously rendered; or requesting authorization and adjudication for provision in the future; or requesting the non-binding adjudication of the listed products and services which could be provided in the future.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party to whom the professional services and/or products have been supplied or are being considered and for whom actual or forecast reimbursement is sought.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"billablePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period for which charges are being submitted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date this resource was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"enterer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Individual who created the claim, predetermination or preauthorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Insurer who is target of the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provider\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The provider which is responsible for the claim, predetermination or preauthorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The provider-required urgency of processing the request. Typical values include: stat, routine deferred.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fundsReserve\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to indicate whether and for whom funds are to be reserved for future claims.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"related\" type=\"Claim.Related\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Other claims which are related to this claim such as prior submissions or claims for related services or for the same event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"prescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Prescription to support the dispensing of pharmacy, device or vision products.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"originalPrescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Original prescription which has been superseded by this prescription to support the dispensing of pharmacy services, medications or products.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payee\" type=\"Claim.Payee\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party to be reimbursed for cost of the products and services according to the terms of the policy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referral\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a referral resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"facility\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Facility where the services were provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"careTeam\" type=\"Claim.CareTeam\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The members of the team who provided the products and services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInfo\" type=\"Claim.SupportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"diagnosis\" type=\"Claim.Diagnosis\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about diagnoses relevant to the claim items.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"procedure\" type=\"Claim.Procedure\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Procedures performed on the patient relevant to the billing items with the claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurance\" type=\"Claim.Insurance\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Financial instruments for reimbursement for the health care products and services specified on the claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"accident\" type=\"Claim.Accident\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details of an accident which resulted in injuries which required the products and services listed in the claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" type=\"Claim.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A claim line. Either a simple  product or service or a 'group' of details which can each be a simple items or groups of sub-details.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"total\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The total value of the all the items in the claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Claim.Related\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"claim\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to a related claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to convey how the claims are related.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An alternate organizational reference to the case or file to which this particular claim pertains.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Claim.Payee\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of Party to be reimbursed: subscriber, provider, other.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"party\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the individual or organization to whom any payment will be made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Claim.CareTeam\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify care team entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provider\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Member of the team who provided the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"responsible\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party who is billing and/or responsible for the claimed products or services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The lead, assisting or supervising practitioner and their discipline if a multidisciplinary team.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"qualification\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The qualification of the practitioner which is applicable for this service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Claim.SupportingInfo\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify supporting information entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The general class of the information supplied: information; exception; accident, employment; onset, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient  for which care is sought.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when or period to which this information refers.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"timingDate\" type=\"date\"/>\n            <xs:element name=\"timingPeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides the reason in the situation where a reason code is required in addition to the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Claim.Diagnosis\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify diagnosis entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The nature of illness or problem in a coded form or as a reference to an external defined Condition.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"diagnosisCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"diagnosisReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the condition was observed or the relative ranking.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"onAdmission\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indication of whether the diagnosis was present on admission to a facility.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"packageCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Claim.Procedure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify procedure entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the condition was observed or the relative ranking.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date and optionally time the procedure was performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code or reference to a Procedure resource which identifies the clinical intervention performed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"procedureCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"procedureReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Claim.Insurance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"focal\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The business identifier to be used when the claim is sent for adjudication against this insurance policy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"coverage\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"businessArrangement\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A business agreement number established between the provider and the insurer for special business processing purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preAuthRef\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference numbers previously provided by the insurer to the provider to be quoted on subsequent claims containing services or products related to the prior authorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"claimResponse\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The result of the adjudication of the line items for the Coverage specified in this insurance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Claim.Accident\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date of an accident event  related to the products and services contained in the claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type or context of the accident event for the purposes of selection of potential insurance coverages and determination of coordination between insurers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The physical location of the accident event.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"locationAddress\" type=\"Address\"/>\n            <xs:element name=\"locationReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Claim.Item\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify item entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"careTeamSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">CareTeam members related to this service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"diagnosisSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Diagnosis applicable for this service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"procedureSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Procedures applicable for this service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"informationSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Exceptions, special conditions and supporting information applicable for this service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"revenue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of revenue or cost center providing the product and/or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date or dates when the service or product was supplied, performed or completed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"servicedDate\" type=\"date\"/>\n            <xs:element name=\"servicedPeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where the product or service was provided.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"locationCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"locationAddress\" type=\"Address\"/>\n            <xs:element name=\"locationReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Physical service site on the patient (limb, tooth, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subSite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A region or surface of the bodySite, e.g. limb region or tooth surface(s).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Encounters during which this Claim was created or to which the creation of this record is tightly associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" type=\"Claim.Detail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Claim.Detail\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify item entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"revenue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of revenue or cost center providing the product and/or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subDetail\" type=\"Claim.SubDetail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Claim.SubDetail\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify item entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"revenue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of revenue or cost center providing the product and/or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"Use-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"claim\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Claim</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"preauthorization\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Preauthorization</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"predetermination\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Predetermination</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"Use\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The purpose of the Claim: predetermination, preauthorization, claim.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"Use-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"FinancialResourceStatusCodes-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"draft\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"FinancialResourceStatusCodes\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A code specifying the state of the resource instance.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"FinancialResourceStatusCodes-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/claimresponse.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ClaimResponse\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ClaimResponse</sch:title>\n    <sch:rule context=\"f:ClaimResponse\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:requestor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:requestor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:requestor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:preAuthPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:servicedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:locationAddress/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:detail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:detail/f:subDetail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:payment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:payment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:form\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:communicationRequest\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:communicationRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:communicationRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurance/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurance/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurance/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurance/f:claimResponse\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurance/f:claimResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurance/f:claimResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/claimresponse.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ClaimResponse\" type=\"ClaimResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ClaimResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this claim response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"use\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Use\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to indicate whether the nature of the request is: to request adjudication of products and services previously rendered; or requesting authorization and adjudication for provision in the future; or requesting the non-binding adjudication of the listed products and services which could be provided in the future.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for facast reimbursement is sought.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date this resource was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurer\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party responsible for authorization, adjudication and reimbursement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requestor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The provider which is responsible for the claim, predetermination or preauthorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Original request resource reference.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ClaimProcessingCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The outcome of the claim, predetermination, or preauthorization processing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"disposition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human readable description of the status of the adjudication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preAuthRef\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference from the Insurer which is used in later communications which refers to this adjudication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preAuthPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time frame during which this authorization is effective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payeeType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of Party to be reimbursed: subscriber, provider, other.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" type=\"ClaimResponse.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"addItem\" type=\"ClaimResponse.AddItem\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The first-tier service adjudications for payor added product or service lines.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The adjudication results which are presented at the header level rather than at the line-item or add-item levels.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"total\" type=\"ClaimResponse.Total\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Categorized monetary totals for the adjudication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payment\" type=\"ClaimResponse.Payment\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Payment details for the adjudication of the claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fundsReserve\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"formCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code for the form to be used for printing the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"form\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual form, by reference or inclusion, for printing the content or an EOB.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"processNote\" type=\"ClaimResponse.ProcessNote\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A note that describes or explains adjudication results in a human readable form.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"communicationRequest\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Request for additional supporting or authorizing information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurance\" type=\"ClaimResponse.Insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Financial instruments for reimbursement for the health care products and services specified on the claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"error\" type=\"ClaimResponse.Error\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Errors encountered during the processing of the adjudication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClaimResponse.Item\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"itemSequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely reference the claim item entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" type=\"ClaimResponse.Detail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A claim detail. Either a simple (a product or service) or a 'group' of sub-details which are simple items.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClaimResponse.Adjudication\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to indicate the information type of this adjudication record. Information types may include the value submitted, maximum values or percentages allowed or payable under the plan, amounts that: the patient is responsible for in aggregate or pertaining to this item; amounts paid by other coverages; and, the benefit payable for this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code supporting the understanding of the adjudication result and explaining variance from expected amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Monetary amount associated with the category.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A non-monetary value associated with the category. Mutually exclusive to the amount element above.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClaimResponse.Detail\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"detailSequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely reference the claim detail entry.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subDetail\" type=\"ClaimResponse.SubDetail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A sub-detail adjudication of a simple product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClaimResponse.SubDetail\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"subDetailSequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely reference the claim sub-detail entry.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClaimResponse.AddItem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"itemSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Claim items which this service line is intended to replace.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detailSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The sequence number of the details within the claim item which this line is intended to replace.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subdetailSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The sequence number of the sub-details within the details within the claim item which this line is intended to replace.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The providers who are authorized for the services rendered to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date or dates when the service or product was supplied, performed or completed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"servicedDate\" type=\"date\"/>\n            <xs:element name=\"servicedPeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where the product or service was provided.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"locationCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"locationAddress\" type=\"Address\"/>\n            <xs:element name=\"locationReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Physical service site on the patient (limb, tooth, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subSite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A region or surface of the bodySite, e.g. limb region or tooth surface(s).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" type=\"ClaimResponse.Detail1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The second-tier service adjudications for payor added services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClaimResponse.Detail1\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subDetail\" type=\"ClaimResponse.SubDetail1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The third-tier service adjudications for payor added services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClaimResponse.SubDetail1\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClaimResponse.Total\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Monetary total amount associated with the category.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClaimResponse.Payment\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this represents partial or complete payment of the benefits payable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjustment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjustmentReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reason for the payment adjustment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Estimated date the payment will be issued or the actual issue date of payment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Benefits payable less any payment adjustment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Issuer's unique identifier for the payment instrument.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClaimResponse.ProcessNote\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"number\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify a note entry.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"NoteType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The business purpose of the note text.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The explanation or description associated with the processing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to define the language used in the text of the note.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClaimResponse.Insurance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"focal\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"coverage\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"businessArrangement\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A business agreement number established between the provider and the insurer for special business processing purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"claimResponse\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The result of the adjudication of the line items for the Coverage specified in this insurance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClaimResponse.Error\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"itemSequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The sequence number of the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detailSequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The sequence number of the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subDetailSequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The sequence number of the sub-detail within the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An error code, from a specified code system, which details why the claim could not be adjudicated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ClaimProcessingCodes-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"queued\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Queued</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"complete\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Processing Complete</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"partial\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Partial Processing</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ClaimProcessingCodes\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The result of the claim processing.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ClaimProcessingCodes-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/clinicalimpression.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ClinicalImpression\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ClinicalImpression</sch:title>\n    <sch:rule context=\"f:ClinicalImpression\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:assessor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:assessor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:assessor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:previous\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:previous/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:previous/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:problem\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:problem/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:problem/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:investigation/f:item\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:investigation/f:item/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:investigation/f:item/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:finding/f:itemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:finding/f:itemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:finding/f:itemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:prognosisReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:prognosisReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:prognosisReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:supportingInfo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:supportingInfo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:supportingInfo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/clinicalimpression.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ClinicalImpression\" type=\"ClinicalImpression\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called &quot;ClinicalImpression&quot; rather than &quot;ClinicalAssessment&quot; to avoid confusion with the recording of assessment tools such as Apgar score.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ClinicalImpression\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called &quot;ClinicalImpression&quot; rather than &quot;ClinicalAssessment&quot; to avoid confusion with the recording of assessment tools such as Apgar score.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this clinical impression by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ClinicalImpressionStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the workflow status of the assessment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current state of the ClinicalImpression.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Categorizes the type of clinical assessment performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A summary of the context and/or cause of the assessment - why / where it was performed, and what patient events/status prompted it.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient or group of individuals assessed as part of this record.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Encounter during which this ClinicalImpression was created or to which the creation of this record is tightly associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The point in time or period over which the subject was assessed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"effectiveDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"effectivePeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates when the documentation of the assessment was complete.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"assessor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The clinician performing the assessment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"previous\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the last assessment that was conducted on this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"problem\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of the relevant problems/conditions for a patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"investigation\" type=\"ClinicalImpression.Investigation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">One or more sets of investigations (signs, symptoms, etc.). The actual grouping of investigations varies greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"protocol\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"summary\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A text summary of the investigations and the diagnosis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"finding\" type=\"ClinicalImpression.Finding\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific findings or diagnoses that were considered likely or relevant to ongoing treatment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"prognosisCodeableConcept\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Estimate of likely outcome.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"prognosisReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">RiskAssessment expressing likely outcome.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information supporting the clinical impression.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Commentary about the impression, typically recorded after the impression itself was made, though supplemental notes by the original author could also appear.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClinicalImpression.Investigation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called &quot;ClinicalImpression&quot; rather than &quot;ClinicalAssessment&quot; to avoid confusion with the recording of assessment tools such as Apgar score.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name/code for the group (&quot;set&quot;) of investigations. Typically, this will be something like &quot;signs&quot;, &quot;symptoms&quot;, &quot;clinical&quot;, &quot;diagnostic&quot;, but the list is not constrained, and others such groups such as (exposure|family|travel|nutritional) history may be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A record of a specific investigation that was undertaken.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ClinicalImpression.Finding\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called &quot;ClinicalImpression&quot; rather than &quot;ClinicalAssessment&quot; to avoid confusion with the recording of assessment tools such as Apgar score.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"itemCodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific text or code for finding or diagnosis, which may include ruled-out or resolved conditions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"itemReference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific reference for finding or diagnosis, which may include ruled-out or resolved conditions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basis\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Which investigations support finding or diagnosis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ClinicalImpressionStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"in-progress\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ClinicalImpressionStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The workflow state of a clinical impression.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ClinicalImpressionStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/codesystem.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource CodeSystem\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CodeSystem</sch:title>\n    <sch:rule context=\"f:CodeSystem\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(distinct-values(descendant::f:concept/f:code/@value))=count(descendant::f:concept)\">csd-1: Within a code system definition, all the codes SHALL be unique</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/codesystem.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"CodeSystem\" type=\"CodeSystem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"CodeSystem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this code system when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this code system is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the code system is stored on different servers. This is used in [Coding](datatypes.html#Coding).system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the code system when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the code system author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. This is used in [Coding](datatypes.html#Coding).version.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the code system. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the code system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date (and optionally time) when the code system resource was created or revised.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this code system is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the code system was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the code system changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the code system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the code system from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate code system instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the code system is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this code system is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"caseSensitive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If code comparison is case sensitive when codes within this system are compared to each other.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"valueSet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Canonical reference to the value set that contains the entire code system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"hierarchyMeaning\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeSystemHierarchyMeaning\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The meaning of the hierarchy of concepts as represented in this resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"compositional\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code system defines a compositional (post-coordination) grammar.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"versionNeeded\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This flag is used to signify that the code system does not commit to concept permanence across versions. If true, a version must be specified when referencing this code system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"content\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeSystemContentMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The extent of the content of the code system (the concepts and codes it defines) are represented in this resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supplements\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The canonical URL of the code system that this code system supplement is adding designations and properties to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"count\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The total number of concepts defined by the code system. Where the code system has a compositional grammar, the basis of this count is defined by the system steward.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"filter\" type=\"CodeSystem.Filter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A filter that can be used in a value set compose statement when selecting concepts using a filter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"property\" type=\"CodeSystem.Property\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A property defines an additional slot through which additional information can be provided about a concept.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"concept\" type=\"CodeSystem.Concept\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meanings of the hierarchical relationships are.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CodeSystem.Filter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code that identifies this filter when it is used as a filter in [[[ValueSet]]].compose.include.filter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of how or why the filter is used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"operator\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"FilterOperator\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of operators that can be used with the filter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of what the value for the filter should be.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CodeSystem.Property\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"uri\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the property- why it is defined, and how its value might be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PropertyType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the property value. Properties of type &quot;code&quot; contain a code defined by the code system (e.g. a reference to another defined concept).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CodeSystem.Concept\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code - a text symbol - that uniquely identifies the concept within the code system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human readable string that is the recommended default way to present this concept to a user.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"designation\" type=\"CodeSystem.Designation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"property\" type=\"CodeSystem.Property1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A property value for this concept.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"concept\" type=\"CodeSystem.Concept\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CodeSystem.Designation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The language this designation is defined for.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"use\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that details how this designation would be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The text value for this designation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CodeSystem.Property1\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that is a reference to CodeSystem.property.code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of this property.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueCode\" type=\"code\"/>\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"FilterOperator-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"=\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Equals</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"is-a\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Is A (by subsumption)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"descendent-of\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Descendent Of (by subsumption)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"is-not-a\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not (Is A) (by subsumption)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"regex\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Regular Expression</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"in\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In Set</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"not-in\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not in Set</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"generalizes\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Generalizes (by Subsumption)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"exists\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Exists</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"FilterOperator\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The kind of operation to perform as a part of a property based filter.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"FilterOperator-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"PropertyType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"code\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">code (internal reference)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Coding\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Coding (external reference)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"string\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">string</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"integer\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">integer</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"boolean\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">boolean</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"dateTime\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">dateTime</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"decimal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">decimal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"PropertyType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of a property value.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"PropertyType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"CodeSystemHierarchyMeaning-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"grouped-by\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Grouped By</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"is-a\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Is-A</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"part-of\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Part Of</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"classified-with\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Classified With</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"CodeSystemHierarchyMeaning\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The meaning of the hierarchy of concepts in a code system.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"CodeSystemHierarchyMeaning-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"CodeSystemContentMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"not-present\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not Present</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"example\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Example</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"fragment\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Fragment</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"complete\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Complete</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"supplement\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Supplement</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"CodeSystemContentMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The extent of the content of the code system (the concepts and codes it defines) are represented in a code system resource.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"CodeSystemContentMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/communication.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Communication\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Communication</sch:title>\n    <sch:rule context=\"f:Communication\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:inResponseTo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:inResponseTo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:inResponseTo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:about\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:about/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:about/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:recipient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:recipient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:recipient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:sender\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:sender/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:sender/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:payload/f:contentAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:payload/f:contentReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:payload/f:contentReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:payload/f:contentReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/communication.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Communication\" type=\"Communication\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Communication\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An order, proposal or plan fulfilled in whole or in part by this Communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Part of this action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"inResponseTo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Prior communication that this communication is in response to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EventStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the transmission.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current state of the Communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of message conveyed such as alert, notification, reminder, instruction, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"medium\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A channel that was used for this communication (e.g. email, fax).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient or group that was the focus of this communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of the purpose/content, similar to a subject line in an email.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"about\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Other resources that pertain to this communication and to which this communication should be associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Encounter during which this Communication was created or to which the creation of this record is tightly associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time when this communication was sent.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"received\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time when this communication arrived at the destination.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recipient\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by an individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either receipts are not tracked (e.g. a mass mail-out) or a receipt is captured in aggregate (all emails confirmed received by a particular time).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reason or justification for the communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates another resource whose existence justifies this communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payload\" type=\"Communication.Payload\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Text, attachment(s), or resource(s) that was communicated to the recipient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional notes or commentary about the communication by the sender, receiver or other interested parties.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Communication.Payload\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A communicated content (or for multi-part communications, one portion of the communication).</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"contentString\" type=\"string\"/>\n            <xs:element name=\"contentAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"contentReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"EventStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"preparation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Preparation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"in-progress\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"not-done\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not Done</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-hold\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"stopped\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Stopped</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"EventStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The status of the communication.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"EventStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/communicationrequest.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource CommunicationRequest\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CommunicationRequest</sch:title>\n    <sch:rule context=\"f:CommunicationRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:replaces\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:replaces/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:replaces/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:groupIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:groupIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:about\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:about/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:about/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:payload/f:contentAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:payload/f:contentReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:payload/f:contentReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:payload/f:contentReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:requester\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:requester/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:requester/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:recipient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:recipient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:recipient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:sender\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:sender/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:sender/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/communicationrequest.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"CommunicationRequest\" type=\"CommunicationRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"CommunicationRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this communication request by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A plan or proposal that is fulfilled in whole or in part by this request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"replaces\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Completed or terminated request(s) whose function is taken by this new request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"groupIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the proposal or order.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current state of the CommunicationRequest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of message to be sent such as alert, notification, reminder, instruction, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"doNotPerform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If true indicates that the CommunicationRequest is asking for the specified action to *not* occur.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"medium\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A channel that was used for this communication (e.g. email, fax).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient or group that is the focus of this communication request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"about\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Other resources that pertain to this communication request and to which this communication request should be associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Encounter during which this CommunicationRequest was created or to which the creation of this record is tightly associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payload\" type=\"CommunicationRequest.Payload\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Text, attachment(s), or resource(s) to be communicated to the recipient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time when this communication is to occur.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">For draft requests, indicates the date of initial creation.  For requests with other statuses, indicates the date of activation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The device, individual, or organization who initiated the request and has responsibility for its activation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recipient\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The entity (e.g. person, organization, clinical information system, device, group, or care team) which is the intended target of the communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes why the request is being made in coded or textual form.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates another resource whose existence justifies this request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments made about the request by the requester, sender, recipient, subject or other participants.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CommunicationRequest.Payload\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The communicated content (or for multi-part communications, one portion of the communication).</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"contentString\" type=\"string\"/>\n            <xs:element name=\"contentAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"contentReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/compartmentdefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource CompartmentDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CompartmentDefinition</sch:title>\n    <sch:rule context=\"f:CompartmentDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/compartmentdefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"CompartmentDefinition\" type=\"CompartmentDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A compartment definition that defines how resources are accessed on a server.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"CompartmentDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A compartment definition that defines how resources are accessed on a server.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this compartment definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the compartment definition is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the compartment definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the compartment definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the compartment definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this compartment definition. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this compartment definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the compartment definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the compartment definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the compartment definition from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate compartment definition instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this compartment definition is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CompartmentType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Which compartment this definition describes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"search\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the search syntax is supported,.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resource\" type=\"CompartmentDefinition.Resource\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about how a resource is related to the compartment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CompartmentDefinition.Resource\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A compartment definition that defines how resources are accessed on a server.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of a resource supported by the server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"param\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment in more than one way,.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional documentation about the resource and compartment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"CompartmentType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"Patient\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Patient</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Encounter\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Encounter</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"RelatedPerson\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">RelatedPerson</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Practitioner\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Practitioner</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Device\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Device</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"CompartmentType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Which type a compartment definition describes.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"CompartmentType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/composition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Composition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Composition</sch:title>\n    <sch:rule context=\"f:Composition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:attester/f:party\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:attester/f:party/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:attester/f:party/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:custodian\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:custodian/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:custodian/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:relatesTo/f:targetIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:relatesTo/f:targetIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:relatesTo/f:targetReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:relatesTo/f:targetReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:relatesTo/f:targetReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:event/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:event/f:detail\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:event/f:detail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:event/f:detail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition//f:section\">\n      <sch:assert test=\"exists(f:text) or exists(f:entry) or exists(f:section)\">cmp-1: A section must contain at least one of text, entries, or sub-sections</sch:assert>\n      <sch:assert test=\"not(exists(f:emptyReason) and exists(f:entry))\">cmp-2: A section can only have an emptyReason if it is empty</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/composition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Composition\" type=\"Composition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Composition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A version-independent identifier for the Composition. This identifier stays constant as the composition is changed over time.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CompositionStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the clinical encounter or type of care this documentation is associated with.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The composition editing time, when the composition was last logically changed by the author.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies who is responsible for the information in the composition, not necessarily who typed it in.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Official human-readable label for the composition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"confidentiality\" minOccurs=\"0\" maxOccurs=\"1\" type=\"vConfidentialityClassification\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code specifying the level of confidentiality of the Composition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"attester\" type=\"Composition.Attester\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A participant who has attested to the accuracy of the composition/document.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"custodian\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatesTo\" type=\"Composition.RelatesTo\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Relationships that this composition has with other compositions or documents that already exist.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"event\" type=\"Composition.Event\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The clinical service, such as a colonoscopy or an appendectomy, being documented.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"section\" type=\"Composition.Section\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The root of the sections that make up the composition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Composition.Attester\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CompositionAttestationMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of attestation the authenticator offers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"time\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the composition was attested by the party.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"party\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who attested the composition in the specified way.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Composition.RelatesTo\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DocumentRelationshipType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of relationship that this composition has with anther composition or document.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The target composition/document of this relationship.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"targetIdentifier\" type=\"Identifier\"/>\n            <xs:element name=\"targetReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Composition.Event\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a &quot;History and Physical Report&quot; in which the procedure being documented is necessarily a &quot;History and Physical&quot; act.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Composition.Section\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The label for this particular section.  This will be part of the rendered content for the document, and is often used to build a table of contents.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code identifying the kind of content contained within the section. This must be consistent with the section title.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies who is responsible for the information in this section, not necessarily who typed it in.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"focus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual focus of the section when it is not the subject of the composition, but instead represents something or someone associated with the subject such as (for a patient subject) a spouse, parent, fetus, or donor. If not focus is specified, the focus is assumed to be focus of the parent section, or, for a section in the Composition itself, the subject of the composition. Sections with a focus SHALL only include resources where the logical subject (patient, subject, focus, etc.) matches the section focus, or the resources have no logical subject (few resources).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Narrative\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it &quot;clinically safe&quot; for a human to just read the narrative.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"mode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ListMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"orderedBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the order applied to the items in the section entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"entry\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the actual resource from which the narrative in the section is derived.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"emptyReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"section\" type=\"Composition.Section\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A nested sub-section within this section.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"vConfidentialityClassification-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"U\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">unrestricted</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"L\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">low</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"M\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">moderate</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"N\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">normal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"R\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">restricted</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"V\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">very restricted</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"vConfidentialityClassification\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Codes specifying the level of confidentiality of the composition.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"vConfidentialityClassification-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"CompositionStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"preliminary\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Preliminary</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"final\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Final</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"amended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Amended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"CompositionStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The workflow/clinical status of the composition.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"CompositionStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DocumentRelationshipType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"replaces\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Replaces</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"transforms\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Transforms</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"signs\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Signs</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"appends\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Appends</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DocumentRelationshipType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of relationship between documents.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"DocumentRelationshipType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"CompositionAttestationMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"personal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Personal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"professional\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Professional</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"legal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Legal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"official\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Official</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"CompositionAttestationMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The way in which a person authenticated a composition.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"CompositionAttestationMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ListMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"working\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Working List</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"snapshot\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Snapshot List</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"changes\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Change List</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ListMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The processing mode that applies to this section.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ListMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/conceptmap.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ConceptMap\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ConceptMap</sch:title>\n    <sch:rule context=\"f:ConceptMap\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:group/f:element/f:target\">\n      <sch:assert test=\"exists(f:comment) or not(exists(f:equivalence)) or ((f:equivalence/@value != 'narrower') and (f:equivalence/@value != 'inexact'))\">cmd-1: If the map is narrower or inexact, there SHALL be some comments</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:group/f:unmapped\">\n      <sch:assert test=\"(f:mode/@value != 'other-map') or exists(f:url)\">cmd-3: If the mode is 'other-map', a url must be provided</sch:assert>\n      <sch:assert test=\"(f:mode/@value != 'fixed') or exists(f:code)\">cmd-2: If the mode is 'fixed', a code must be provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/conceptmap.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ConceptMap\" type=\"ConceptMap\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ConceptMap\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this concept map when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this concept map is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the concept map is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the concept map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the concept map. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the concept map.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this concept map. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this concept map is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the concept map was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the concept map.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the concept map from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate concept map instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the concept map is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this concept map is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the concept map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the concept map.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for the source value set that contains the concepts that are being mapped and provides context for the mappings.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"sourceUri\" type=\"uri\"/>\n            <xs:element name=\"sourceCanonical\" type=\"canonical\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The target value set provides context for the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"targetUri\" type=\"uri\"/>\n            <xs:element name=\"targetCanonical\" type=\"canonical\"/>\n          </xs:choice>\n          <xs:element name=\"group\" type=\"ConceptMap.Group\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A group of mappings that all have the same source and target system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ConceptMap.Group\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that identifies the source system where the concepts to be mapped are defined.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sourceVersion\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific version of the code system, as determined by the code system authority.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"target\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that identifies the target system that the concepts will be mapped to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"targetVersion\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific version of the code system, as determined by the code system authority.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"element\" type=\"ConceptMap.Element\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Mappings for an individual concept in the source to one or more concepts in the target.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unmapped\" type=\"ConceptMap.Unmapped\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">What to do when there is no mapping for the source concept. &quot;Unmapped&quot; does not include codes that are unmatched, and the unmapped element is ignored in a code is specified to have equivalence = unmatched.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ConceptMap.Element\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identity (code or path) or the element/item being mapped.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The display for the code. The display is only provided to help editors when editing the concept map.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"target\" type=\"ConceptMap.Target\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A concept from the target value set that this concept maps to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ConceptMap.Target\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identity (code or path) or the element/item that the map refers to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The display for the code. The display is only provided to help editors when editing the concept map.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"equivalence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ConceptMapEquivalence\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of status/issues in mapping that conveys additional information not represented in  the structured data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dependsOn\" type=\"ConceptMap.DependsOn\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"product\" type=\"ConceptMap.DependsOn\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ConceptMap.DependsOn\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"property\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to an element that holds a coded value that corresponds to a code system property. The idea is that the information model carries an element somewhere that is labeled to correspond with a code system property.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"system\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identity (code or path) or the element/item/ValueSet/text that the map depends on / refers to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The display for the code. The display is only provided to help editors when editing the concept map.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ConceptMap.Unmapped\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ConceptMapGroupUnmappedMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines which action to take if there is no match for the source concept in the target system designated for the group. One of 3 actions are possible: use the unmapped code (this is useful when doing a mapping between versions, and only a few codes have changed), use a fixed code (a default code), or alternatively, a reference to a different concept map can be provided (by canonical URL).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The fixed code to use when the mode = 'fixed'  - all unmapped codes are mapped to a single fixed code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The display for the code. The display is only provided to help editors when editing the concept map.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The canonical reference to an additional ConceptMap resource instance to use for mapping if this ConceptMap resource contains no matching mapping for the source concept.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ConceptMapGroupUnmappedMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"provided\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Provided Code</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"fixed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Fixed Code</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"other-map\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Other Map</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ConceptMapGroupUnmappedMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines which action to take if there is no match in the group.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ConceptMapGroupUnmappedMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/condition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Condition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Condition</sch:title>\n    <sch:rule context=\"f:Condition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(exists(f:verificationStatus/f:coding[f:system/@value='http://terminology.hl7.org/CodeSystem/condition-ver-status' and f:code/@value='entered-in-error'])) or not(exists(f:clinicalStatus))\">con-5: Condition.clinicalStatus SHALL NOT be present if verification Status is entered-in-error</sch:assert>\n      <sch:assert test=\"not(exists(*[starts-with(local-name(.), 'abatement')])) or exists(f:clinicalStatus/f:coding[f:system/@value='http://terminology.hl7.org/CodeSystem/condition-clinical' and f:code/@value=('resolved', 'remission', 'inactive')])\">con-4: If condition is abated, then clinicalStatus must be either inactive, resolved, or remission</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:onsetAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:onsetPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:onsetRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:onsetRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:onsetRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:abatementAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:abatementPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:abatementRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:abatementRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:abatementRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:recorder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:recorder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:recorder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:asserter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:asserter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:asserter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:stage\">\n      <sch:assert test=\"exists(f:summary) or exists(f:assessment)\">con-1: Stage SHALL have summary or assessment</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:stage/f:assessment\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:stage/f:assessment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:stage/f:assessment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:evidence\">\n      <sch:assert test=\"exists(f:code) or exists(f:detail)\">con-2: evidence SHALL have code or details</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:evidence/f:detail\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:evidence/f:detail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:evidence/f:detail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/condition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Condition\" type=\"Condition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Condition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this condition by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"clinicalStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The clinical status of the condition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"verificationStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The verification status to support the clinical status of the condition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A category assigned to the condition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"severity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A subjective assessment of the severity of the condition as evaluated by the clinician.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identification of the condition, problem or diagnosis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The anatomical location where this condition manifests itself.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the patient or group who the condition record is associated with.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Encounter during which this Condition was created or to which the creation of this record is tightly associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Estimated or actual date or date-time  the condition began, in the opinion of the clinician.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"onsetDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"onsetAge\" type=\"Age\"/>\n            <xs:element name=\"onsetPeriod\" type=\"Period\"/>\n            <xs:element name=\"onsetRange\" type=\"Range\"/>\n            <xs:element name=\"onsetString\" type=\"string\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date or estimated date that the condition resolved or went into remission. This is called &quot;abatement&quot; because of the many overloaded connotations associated with &quot;remission&quot; or &quot;resolution&quot; - Conditions are never really resolved, but they can abate.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"abatementDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"abatementAge\" type=\"Age\"/>\n            <xs:element name=\"abatementPeriod\" type=\"Period\"/>\n            <xs:element name=\"abatementRange\" type=\"Range\"/>\n            <xs:element name=\"abatementString\" type=\"string\"/>\n          </xs:choice>\n          <xs:element name=\"recordedDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The recordedDate represents when this particular Condition record was created in the system, which is often a system-generated date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recorder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Individual who recorded the record and takes responsibility for its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"asserter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Individual who is making the condition statement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"stage\" type=\"Condition.Stage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Clinical stage or grade of a condition. May include formal severity assessments.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"evidence\" type=\"Condition.Evidence\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Supporting evidence / manifestations that are the basis of the Condition's verification status, such as evidence that confirmed or refuted the condition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information about the Condition. This is a general notes/comments entry  for description of the Condition, its diagnosis and prognosis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Condition.Stage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"summary\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A simple summary of the stage such as &quot;Stage 3&quot;. The determination of the stage is disease-specific.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"assessment\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to a formal record of the evidence on which the staging assessment is based.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of staging, such as pathological or clinical staging.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Condition.Evidence\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A manifestation or symptom that led to the recording of this condition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Links to other relevant information, including pathology reports.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/consent.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Consent\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Consent</sch:title>\n    <sch:rule context=\"f:Consent\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"exists(f:patient) or not(exists(f:scope/f:coding[f:system/@value='something' and f:code/@value='adr'])))\">ppc-4: IF Scope=adr, there must be a patient</sch:assert>\n      <sch:assert test=\"exists(f:patient) or not(exists(f:scope/f:coding[f:system/@value='something' and f:code/@value='treatment'])))\">ppc-5: IF Scope=treatment, there must be a patient</sch:assert>\n      <sch:assert test=\"exists(f:patient) or not(exists(f:scope/f:coding[f:system/@value='something' and f:code/@value='patient-privacy'])))\">ppc-2: IF Scope=privacy, there must be a patient</sch:assert>\n      <sch:assert test=\"exists(f:patient) or not(exists(f:scope/f:coding[f:system/@value='something' and f:code/@value='research'])))\">ppc-3: IF Scope=research, there must be a patient</sch:assert>\n      <sch:assert test=\"exists(f:policy) or exists(f:policyRule)\">ppc-1: Either a Policy or PolicyRule</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:organization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:organization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:sourceAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:sourceReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:sourceReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:sourceReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:verification/f:verifiedWith\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:verification/f:verifiedWith/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:verification/f:verifiedWith/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/consent.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Consent\" type=\"Consent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Consent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique identifier for this copy of the Consent Statement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ConsentState\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the current state of this consent.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"scope\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A selector of the type of consent being presented: ADR, Privacy, Treatment, Research.  This list is now extensible.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient/healthcare consumer to whom this consent applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dateTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When this  Consent was issued / created / indexed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Either the Grantor, which is the entity responsible for granting the rights listed in a Consent Directive or the Grantee, which is the entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"organization\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization that manages the consent, and the framework within which it is executed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The source on which this consent statement is based. The source might be a scanned original paper form, or a reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"sourceAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"sourceReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"policy\" type=\"Consent.Policy\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"policyRule\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the specific base computable regulation or policy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"verification\" type=\"Consent.Verification\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether a treatment instruction (e.g. artificial respiration yes or no) was verified with the patient, his/her family or another authorized person.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provision\" type=\"Consent.Provision\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Consent.Policy\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"authority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Entity or Organization having regulatory jurisdiction or accountability for  enforcing policies pertaining to Consent Directives.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"uri\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Consent.Verification\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"verified\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Has the instruction been verified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"verifiedWith\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who verified the instruction (Patient, Relative or other Authorized Person).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"verificationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date verification was collected.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Consent.Provision\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ConsentProvisionType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The timeframe in this rule is valid.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actor\" type=\"Consent.Actor\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers').</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"action\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Actions controlled by this Rule.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"securityLabel\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"class\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The class of information covered by this rule. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If this code is found in an instance, then the rule applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dataPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Clinical or Operational Relevant period of time that bounds the data controlled by this rule.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"data\" type=\"Consent.Data\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The resources controlled by this rule if specific resources are referenced.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provision\" type=\"Consent.Provision\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Rules which provide exceptions to the base rule or subrules.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Consent.Actor\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"role\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the individual is involved in the resources content that is described in the exception.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The resource that identifies the actor. To identify actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers').</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Consent.Data\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"meaning\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ConsentDataMeaning\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the resource reference is interpreted when testing consent restrictions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a specific resource that defines which resources are covered by this consent.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ConsentProvisionType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"deny\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Opt Out</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"permit\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Opt In</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ConsentProvisionType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How a rule statement is applied, such as adding additional consent or removing consent.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ConsentProvisionType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ConsentDataMeaning-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"instance\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Instance</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"related\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Related</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"dependents\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Dependents</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"authoredby\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">AuthoredBy</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ConsentDataMeaning\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How a resource reference is interpreted when testing consent restrictions.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ConsentDataMeaning-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ConsentState-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"draft\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Pending</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"proposed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Proposed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"rejected\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Rejected</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"inactive\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ConsentState\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates the state of the consent.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ConsentState-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/contract.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Contract\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Contract</sch:title>\n    <sch:rule context=\"f:Contract\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:instantiatesCanonical\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:instantiatesCanonical/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:instantiatesCanonical/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:applies\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:authority\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:authority/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:authority/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:domain\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:domain/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:domain/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:site\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:site/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:site/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:topicReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:topicReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:topicReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:contentDefinition/f:publisher\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:contentDefinition/f:publisher/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:contentDefinition/f:publisher/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:supportingInfo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:supportingInfo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:supportingInfo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:relevantHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:relevantHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:relevantHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:party\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:party/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:party/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:signature/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:signature/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:signature/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:signature/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:signature/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:signature/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:friendly/f:contentAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:friendly/f:contentReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:friendly/f:contentReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:friendly/f:contentReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legal/f:contentAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legal/f:contentReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legal/f:contentReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legal/f:contentReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:rule/f:contentAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:rule/f:contentReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:rule/f:contentReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:rule/f:contentReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legallyBindingAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legallyBindingReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legallyBindingReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legallyBindingReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/contract.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Contract\" type=\"Contract\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Contract\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique identifier for this Contract or a derivative that references a Source Contract.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Canonical identifier for this contract, represented as a URI (globally unique).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An edition identifier used for business purposes to label business significant variants.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ContractResourceStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"legalState\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Legal states of the formation of a legal instrument, which is a formally executed written document that can be formally attributed to its author, records and formally expresses a legally enforceable act, process, or contractual duty, obligation, or right, and therefore evidences that act, process, or agreement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contentDerivative\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The minimal content derived from the basal information source at a specific stage in its lifecycle.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"issued\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When this  Contract was issued.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"applies\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Relevant time or time-period when this Contract is applicable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expirationType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The target entity impacted by or of interest to parties to the agreement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authority\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"domain\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"site\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Sites in which the contract is complied with,  exercised, or in force.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying this Contract definition, derivative, or instance in any legal state. Provides additional information about its content. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"alias\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Alternative representation of the title for this Contract definition, derivative, or instance in any legal state., e.g., a domain specific contract number related to legislation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual or organization that authored the Contract definition, derivative, or instance in any legal state.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"scope\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A selector of legal concerns for this Contract definition, derivative, or instance in any legal state.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"topicCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"topicReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A high-level category for the legal instrument, whether constructed as a Contract definition, derivative, or instance in any legal state.  Provides additional information about its content within the context of the Contract's scope to distinguish the kinds of systems that would be interested in the contract.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Sub-category for the Contract that distinguishes the kinds of systems that would be interested in the Contract within the context of the Contract's scope.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contentDefinition\" type=\"Contract.ContentDefinition\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Precusory content developed with a focus and intent of supporting the formation a Contract instance, which may be associated with and transformable into a Contract.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"term\" type=\"Contract.Term\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information that may be needed by/relevant to the performer in their execution of this term action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relevantHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Links to Provenance records for past versions of this Contract definition, derivative, or instance, which identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the Contract.  The Provence.entity indicates the target that was changed in the update. http://build.fhir.org/provenance-definitions.html#Provenance.entity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"signer\" type=\"Contract.Signer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"friendly\" type=\"Contract.Friendly\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The &quot;patient friendly language&quot; versionof the Contract in whole or in parts. &quot;Patient friendly language&quot; means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"legal\" type=\"Contract.Legal\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">List of Legal expressions or representations of this Contract.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rule\" type=\"Contract.Rule\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">List of Computable Policy Rule Language Representations of this Contract.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the &quot;source of truth&quot; and which would be the basis for legal action related to enforcement of this Contract.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"legallyBindingAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"legallyBindingReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.ContentDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Precusory content structure and use, i.e., a boilerplate, template, application for a contract such as an insurance policy or benefits under a program, e.g., workers compensation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Detailed Precusory content type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The  individual or organization that published the Contract precursor content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publicationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date (and optionally time) when the contract was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the contract changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publicationStatus\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ContractResourcePublicationStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.Term\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique identifier for this particular Contract Provision.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"issued\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When this Contract Provision was issued.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"applies\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Relevant time or time-period when this Contract Provision is applicable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The entity that the term applies to.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"topicCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"topicReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal clause or condition contained within a contract that requires one or both parties to perform a particular requirement by some specified time or prevents one or both parties from performing a particular requirement by some specified time.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A specialized legal clause or condition based on overarching contract type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Statement of a provision in a policy or a contract.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"securityLabel\" type=\"Contract.SecurityLabel\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Security labels that protect the handling of information about the term and its elements, which may be specifically identified..</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"offer\" type=\"Contract.Offer\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The matter of concern in the context of this provision of the agrement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"asset\" type=\"Contract.Asset\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contract Term Asset List.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"action\" type=\"Contract.Action\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"group\" type=\"Contract.Term\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Nested group of Contract Provisions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.SecurityLabel\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"number\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number used to link this term or term element to the applicable Security Label.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"classification\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Security label privacy tag that species the applicable privacy and security policies governing this term and/or term elements.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"control\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Security label privacy tag that species the manner in which term and/or term elements are to be protected.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.Offer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique identifier for this particular Contract Provision.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"party\" type=\"Contract.Party\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Offer Recipient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The owner of an asset has the residual control rights over the asset: the right to decide all usages of the asset in any way not inconsistent with a prior contract, custom, or law (Hart, 1995, p. 30).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"decision\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of choice made by accepting party with respect to an offer made by an offeror/ grantee.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"decisionMode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the decision about a Contract was conveyed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"answer\" type=\"Contract.Answer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Response to offer text.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human readable form of this Contract Offer.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"linkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The id of the clause or question text of the offer in the referenced questionnaire/response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"securityLabelNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Security labels that protects the offer.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.Party\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Participant in the offer.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"role\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the party participates in the offer.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.Answer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\n            <xs:element name=\"valueDate\" type=\"date\"/>\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"valueTime\" type=\"time\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueUri\" type=\"uri\"/>\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.Asset\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"scope\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Differentiates the kind of the asset .</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Target entity type about which the term may be concerned.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"typeReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Associated entities.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtype\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">May be a subtype or part of an offered asset.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the applicability of the term to an asset resource instance, and instances it refers to orinstances that refer to it, and/or are owned by the offeree.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"context\" type=\"Contract.Context\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Circumstance of the asset.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"condition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of the quality and completeness of the asset that imay be a factor in its valuation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"periodType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of Asset availability for use or ownership.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Asset relevant contractual time period.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"usePeriod\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time period of asset use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"linkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"answer\" type=\"Contract.Answer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Response to assets.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"securityLabelNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Security labels that protects the asset.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"valuedItem\" type=\"Contract.ValuedItem\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contract Valued Item List.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.Context\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"reference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository),  location held, e.g., building,  jurisdiction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Coded representation of the context generally or of the Referenced entity, such as the asset holder type or location.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Context description.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.ValuedItem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific type of Contract Valued Item that may be priced.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"entityCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"entityReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies a Contract Valued Item instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectiveTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the time during which this Contract ValuedItem information is effective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Contract Valued Item unit valuation measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"points\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Terms of valuation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"paymentDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When payment is due.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"responsible\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who will make payment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recipient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who will receive payment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"linkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"securityLabelNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A set of security labels that define which terms are controlled by this condition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.Action\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"doNotPerform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">True if the term prohibits the  action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Activity or service obligation to be done or not done, performed or not performed, effectuated or not by this Contract term.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" type=\"Contract.Subject\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Entity of the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reason or purpose for the action stipulated by this Contract Provision.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"linkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Current state of the term action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Encounter or Episode with primary association to specified term activity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contextLinkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When action happens.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\n            <xs:element name=\"occurrenceTiming\" type=\"Timing\"/>\n          </xs:choice>\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who or what initiated the action and has responsibility for its activation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requesterLinkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performerType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of individual that is desired or required to perform or not perform the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performerRole\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of role or competency of an individual desired or required to perform or not perform the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates who or what is being asked to perform (or not perform) the ction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performerLinkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Rationale for the action to be performed or not performed. Describes why the action is permitted or prohibited.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates another resource whose existence justifies permitting or not permitting this action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes why the action is to be performed or not performed in textual form.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonLinkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments made about the term action made by the requester, performer, subject or other participants.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"securityLabelNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Security labels that protects the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.Subject\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The entity the action is performed or not performed on or for.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Role type of agent assigned roles in this Contract.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.Signer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Role of this Contract signer, e.g. notary, grantee.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"party\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Party which is a signator to this Contract.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"signature\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Signature\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Legally binding Contract DSIG signature contents in Base64.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.Friendly\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"contentAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"contentReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.Legal\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contract legal text in human renderable form.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"contentAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"contentReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contract.Rule\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"contentAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"contentReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ContractResourceStatusCodes-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"amended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Amended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"appended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Appended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"disputed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Disputed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"executable\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Executable</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"executed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Executed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"negotiable\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Negotiable</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"offered\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Offered</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"policy\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Policy</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"rejected\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Rejected</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"renewed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Renewed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"revoked\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Revoked</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"resolved\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Resolved</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"terminated\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Terminated</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ContractResourceStatusCodes\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A code specifying the state of the resource instance.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ContractResourceStatusCodes-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ContractResourcePublicationStatusCodes-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"amended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Amended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"appended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Appended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"disputed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Disputed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"executable\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Executable</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"executed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Executed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"negotiable\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Negotiable</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"offered\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Offered</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"policy\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Policy</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"rejected\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Rejected</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"renewed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Renewed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"revoked\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Revoked</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"resolved\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Resolved</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"terminated\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Terminated</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ContractResourcePublicationStatusCodes\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Status of the publication of contract content.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ContractResourcePublicationStatusCodes-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/coverage.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Coverage\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Coverage</sch:title>\n    <sch:rule context=\"f:Coverage\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:policyHolder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:policyHolder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:policyHolder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:subscriber\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:subscriber/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:subscriber/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:beneficiary\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:beneficiary/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:beneficiary/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:payor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:payor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:payor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:costToBeneficiary/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:costToBeneficiary/f:exception/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:contract\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:contract/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:contract/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/coverage.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Coverage\" type=\"Coverage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Coverage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this coverage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"policyHolder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party who 'owns' the insurance policy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subscriber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subscriberId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The insurer assigned ID for the Subscriber.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"beneficiary\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party who benefits from the insurance coverage; the patient when products and/or services are provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dependent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier for a dependent under the coverage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The relationship of beneficiary (patient) to the subscriber.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payor\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"class\" type=\"Coverage.Class\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A suite of underwriter specific classifiers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"order\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"costToBeneficiary\" type=\"Coverage.CostToBeneficiary\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A suite of codes indicating the cost category and associated amount which have been detailed in the policy and may have been  included on the health card.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subrogation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contract\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The policy(s) which constitute this insurance coverage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Coverage.Class\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of classification for which an insurer-specific class label or number and optional name is provided, for example may be used to identify a class of coverage or employer group, Policy, Plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The alphanumeric string value associated with the insurer issued label.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short description for the class.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Coverage.CostToBeneficiary\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The category of patient centric costs associated with treatment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount due from the patient for the cost category.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueMoney\" type=\"Money\"/>\n          </xs:choice>\n          <xs:element name=\"exception\" type=\"Coverage.Exception\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A suite of codes indicating exceptions or reductions to patient costs and their effective periods.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Coverage.Exception\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code for the specific exception.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The timeframe during when the exception is in force.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/coverageeligibilityrequest.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource CoverageEligibilityRequest\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CoverageEligibilityRequest</sch:title>\n    <sch:rule context=\"f:CoverageEligibilityRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:servicedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:enterer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:enterer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:enterer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:insurer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:insurer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:insurer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:facility\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:facility/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:facility/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:supportingInfo/f:information\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:supportingInfo/f:information/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:supportingInfo/f:information/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:insurance/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:insurance/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:insurance/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:facility\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:facility/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:facility/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:diagnosis/f:diagnosisReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:diagnosis/f:diagnosisReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:diagnosis/f:diagnosisReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:detail\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:detail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:detail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/coverageeligibilityrequest.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"CoverageEligibilityRequest\" type=\"CoverageEligibilityRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"CoverageEligibilityRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this coverage eligiblity request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the requestor expects the processor to complete processing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"EligibilityRequestPurpose\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code to specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party who is the beneficiary of the supplied coverage and for whom eligibility is sought.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date or dates when the enclosed suite of services were performed or completed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"servicedDate\" type=\"date\"/>\n            <xs:element name=\"servicedPeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when this resource was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"enterer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Person who created the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The provider which is responsible for the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurer\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Insurer who issued the coverage in question and is the recipient of the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"facility\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Facility where the services are intended to be provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInfo\" type=\"CoverageEligibilityRequest.SupportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurance\" type=\"CoverageEligibilityRequest.Insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Financial instruments for reimbursement for the health care products and services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" type=\"CoverageEligibilityRequest.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Service categories or billable services for which benefit details and/or an authorization prior to service delivery may be required by the payor.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CoverageEligibilityRequest.SupportingInfo\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify supporting information entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"information\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"appliesToAll\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The supporting materials are applicable for all detail items, product/servce categories and specific billing codes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CoverageEligibilityRequest.Insurance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"focal\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A flag to indicate that this Coverage is to be used for evaluation of this request when set to true.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"coverage\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"businessArrangement\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A business agreement number established between the provider and the insurer for special business processing purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CoverageEligibilityRequest.Item\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"supportingInfoSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Exceptions, special conditions and supporting information applicable for this service or product line.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productOrService\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The practitioner who is responsible for the product or service to be rendered to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount charged to the patient by the provider for a single unit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"facility\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Facility where the services will be provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"diagnosis\" type=\"CoverageEligibilityRequest.Diagnosis\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Patient diagnosis for which care is sought.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The plan/proposal/order describing the proposed service in detail.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CoverageEligibilityRequest.Diagnosis\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The nature of illness or problem in a coded form or as a reference to an external defined Condition.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"diagnosisCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"diagnosisReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"EligibilityRequestPurpose-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"auth-requirements\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Coverage auth-requirements</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"benefits\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Coverage benefits</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"discovery\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Coverage Discovery</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"validation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Coverage Validation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"EligibilityRequestPurpose\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A code specifying the types of information being requested.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"EligibilityRequestPurpose-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/coverageeligibilityresponse.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource CoverageEligibilityResponse\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CoverageEligibilityResponse</sch:title>\n    <sch:rule context=\"f:CoverageEligibilityResponse\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:servicedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:requestor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:requestor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:requestor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:benefitPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:item\">\n      <sch:assert test=\"exists(f:category) or exists(f:productOrService)\">ces-1: SHALL contain a category or a billcode but not both.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:item/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:item/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:item/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/coverageeligibilityresponse.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"CoverageEligibilityResponse\" type=\"CoverageEligibilityResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"CoverageEligibilityResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this coverage eligiblity request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"EligibilityResponsePurpose\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code to specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party who is the beneficiary of the supplied coverage and for whom eligibility is sought.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date or dates when the enclosed suite of services were performed or completed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"servicedDate\" type=\"date\"/>\n            <xs:element name=\"servicedPeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date this resource was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requestor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The provider which is responsible for the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"request\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the original request resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RemittanceOutcome\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The outcome of the request processing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"disposition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human readable description of the status of the adjudication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurer\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Insurer who issued the coverage in question and is the author of the response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurance\" type=\"CoverageEligibilityResponse.Insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Financial instruments for reimbursement for the health care products and services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preAuthRef\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference from the Insurer to which these services pertain to be used on further communication and as proof that the request occurred.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"form\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code for the form to be used for printing the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"error\" type=\"CoverageEligibilityResponse.Error\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Errors encountered during the processing of the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CoverageEligibilityResponse.Insurance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"coverage\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"inforce\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"benefitPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The term of the benefits documented in this response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" type=\"CoverageEligibilityResponse.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Benefits and optionally current balances, and authorization details by category or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CoverageEligibilityResponse.Item\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productOrService\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The practitioner who is eligible for the provision of the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"excluded\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">True if the indicated class of service is excluded from the plan, missing or False indicates the product or service is included in the coverage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short name or tag for the benefit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A richer description of the benefit or services covered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates if the benefits apply to an individual or to the family.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"term\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"benefit\" type=\"CoverageEligibilityResponse.Benefit\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Benefits used to date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authorizationRequired\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A boolean flag indicating whether a preauthorization is required prior to actual service delivery.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authorizationSupporting\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Codes or comments regarding information or actions associated with the preauthorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authorizationUrl\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A web location for obtaining requirements or descriptive information regarding the preauthorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CoverageEligibilityResponse.Benefit\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Classification of benefit being provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity of the benefit which is permitted under the coverage.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"allowedUnsignedInt\" type=\"unsignedInt\"/>\n            <xs:element name=\"allowedString\" type=\"string\"/>\n            <xs:element name=\"allowedMoney\" type=\"Money\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity of the benefit which have been consumed to date.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"usedUnsignedInt\" type=\"unsignedInt\"/>\n            <xs:element name=\"usedString\" type=\"string\"/>\n            <xs:element name=\"usedMoney\" type=\"Money\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CoverageEligibilityResponse.Error\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An error code,from a specified code system, which details why the eligibility check could not be performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"EligibilityResponsePurpose-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"auth-requirements\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Coverage auth-requirements</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"benefits\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Coverage benefits</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"discovery\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Coverage Discovery</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"validation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Coverage Validation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"EligibilityResponsePurpose\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A code specifying the types of information being requested.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"EligibilityResponsePurpose-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/detectedissue.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource DetectedIssue\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DetectedIssue</sch:title>\n    <sch:rule context=\"f:DetectedIssue\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:identifiedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:implicated\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:implicated/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:implicated/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:evidence/f:detail\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:evidence/f:detail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:evidence/f:detail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:mitigation/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:mitigation/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:mitigation/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/detectedissue.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"DetectedIssue\" type=\"DetectedIssue\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"DetectedIssue\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifier associated with the detected issue record.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ObservationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the status of the detected issue.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the general type of issue identified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"severity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"DetectedIssueSeverity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the patient whose record the detected issue is associated with.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date or period when the detected issue was initially identified.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"identifiedDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"identifiedPeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Individual or device responsible for the issue being raised.  For example, a decision support application or a pharmacist conducting a medication review.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"implicated\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the resource representing the current activity or proposed activity that is potentially problematic.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"evidence\" type=\"DetectedIssue.Evidence\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Supporting evidence or manifestations that provide the basis for identifying the detected issue such as a GuidanceResponse or MeasureReport.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A textual explanation of the detected issue.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"mitigation\" type=\"DetectedIssue.Mitigation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates an action that has been taken or is committed to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting.  Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DetectedIssue.Evidence\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A manifestation that led to the recording of this detected issue.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Links to resources that constitute evidence for the detected issue such as a GuidanceResponse or MeasureReport.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DetectedIssue.Mitigation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"action\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates when the mitigating action was documented.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ObservationStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"registered\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Registered</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"preliminary\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Preliminary</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"final\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Final</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"amended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Amended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"corrected\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Corrected</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ObservationStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates the status of the identified issue.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ObservationStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DetectedIssueSeverity-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"high\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">High</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"moderate\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Moderate</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"low\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Low</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DetectedIssueSeverity\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates the potential degree of impact of the identified issue on the patient.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"DetectedIssueSeverity-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/device.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Device\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Device</sch:title>\n    <sch:rule context=\"f:Device\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:definition\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:definition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:definition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:version/f:component/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:version/f:component/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:property/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:owner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:owner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:owner/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:contact\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:contact/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:parent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:parent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:parent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/device.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Device\" type=\"Device\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Device\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique instance identifiers assigned to a device by manufacturers other organizations or owners.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reference to the definition for the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"udiCarrier\" type=\"Device.UdiCarrier\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique device identifier (UDI) assigned to device label or package.  Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"FHIRDeviceStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Status of the Device availability.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reason for the dtatus of the Device availability.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"distinctIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name of the manufacturer.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manufactureDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date and time when the device was manufactured.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expirationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date and time beyond which this device is no longer valid or should not be used (if applicable).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lotNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Lot number assigned by the manufacturer.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"serialNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The serial number assigned by the organization when the device was manufactured.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"deviceName\" type=\"Device.DeviceName\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device.  This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modelNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The model number for the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The part number of the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind or type of device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialization\" type=\"Device.Specialization\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The capabilities supported on a  device, the standards to which the device conforms for a particular purpose, and used for the communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" type=\"Device.Version\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual design of the device or software version running on the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"property\" type=\"Device.Property\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Patient information, If the device is affixed to a person.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"owner\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An organization that is responsible for the provision and ongoing maintenance of the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details for an organization or a particular human that is responsible for the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The place where the device can be found.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A network address on which the device may be contacted directly.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive information, usage information or implantation information that is not captured in an existing element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"safety\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides additional safety characteristics about a medical device.  For example devices containing latex.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The parent device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Device.UdiCarrier\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"deviceIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"issuer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :\n1) GS1: \nhttp://hl7.org/fhir/NamingSystem/gs1-di, \n2) HIBCC:\nhttp://hl7.org/fhir/NamingSystem/hibcc-dI, \n3) ICCBBA for blood containers:\nhttp://hl7.org/fhir/NamingSystem/iccbba-blood-di, \n4) ICCBA for other devices:\nhttp://hl7.org/fhir/NamingSystem/iccbba-other-di.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identity of the authoritative source for UDI generation within a  jurisdiction.  All UDIs are globally unique within a single namespace with the appropriate repository uri as the system.  For example,  UDIs of devices managed in the U.S. by the FDA, the value is  http://hl7.org/fhir/NamingSystem/fda-udi.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"carrierAIDC\" minOccurs=\"0\" maxOccurs=\"1\" type=\"base64Binary\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID.   Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"carrierHRF\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"entryType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"UDIEntryType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A coded entry to indicate how the data was entered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Device.DeviceName\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DeviceNameType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of deviceName.\nUDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Device.Specialization\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"systemType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The standard that is used to operate and communicate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version of the standard that is used to operate and communicate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Device.Version\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the device version.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"component\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A single component of the device version.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version text.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Device.Property\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code that specifies the property DeviceDefinitionPropetyCode (Extensible).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"valueQuantity\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Property value as a quantity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"valueCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Property value as a code, e.g., NTP4 (synced to NTP).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"FHIRDeviceStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"inactive\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"FHIRDeviceStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The availability status of the device.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"FHIRDeviceStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DeviceNameType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"udi-label-name\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">UDI Label name</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"user-friendly-name\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">User Friendly name</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"patient-reported-name\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Patient Reported name</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"manufacturer-name\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Manufacturer name</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"model-name\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Model name</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"other\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">other</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DeviceNameType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of name the device is referred by.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"DeviceNameType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"UDIEntryType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"barcode\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Barcode</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"rfid\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">RFID</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"manual\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Manual</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"card\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Card</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"self-reported\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Self Reported</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"UDIEntryType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Codes to identify how UDI data was entered.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"UDIEntryType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/devicedefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource DeviceDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DeviceDefinition</sch:title>\n    <sch:rule context=\"f:DeviceDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:manufacturerReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:manufacturerReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:manufacturerReference/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:shelfLifeStorage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:shelfLifeStorage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:shelfLifeStorage/f:period\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:height\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:width\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:depth\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:weight\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:nominalVolume\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:externalDiameter\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:image\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:property/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:owner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:owner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:owner/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:contact\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:contact/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:parentDevice\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:parentDevice/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:parentDevice/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/devicedefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"DeviceDefinition\" type=\"DeviceDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"DeviceDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"udiDeviceIdentifier\" type=\"DeviceDefinition.UdiDeviceIdentifier\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique device identifier (UDI) assigned to device label or package.  Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name of the manufacturer.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"manufacturerString\" type=\"string\"/>\n            <xs:element name=\"manufacturerReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"deviceName\" type=\"DeviceDefinition.DeviceName\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name given to the device to identify it.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modelNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The model number for the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">What kind of device or device system this is.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialization\" type=\"DeviceDefinition.Specialization\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The capabilities supported on a  device, the standards to which the device conforms for a particular purpose, and used for the communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The available versions of the device, e.g., software versions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"safety\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Safety characteristics of the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"shelfLifeStorage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ProductShelfLife\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Shelf Life and storage information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"physicalCharacteristics\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ProdCharacteristic\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Dimensions, color etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"languageCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Language code for the human-readable text strings produced by the device (all supported).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"capability\" type=\"DeviceDefinition.Capability\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Device capabilities.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"property\" type=\"DeviceDefinition.Property\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"owner\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An organization that is responsible for the provision and ongoing maintenance of the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details for an organization or a particular human that is responsible for the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A network address on which the device may be contacted directly.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"onlineInformation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Access to on-line information about the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive information, usage information or implantation information that is not captured in an existing element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity of the device present in the packaging (e.g. the number of devices present in a pack, or the number of devices in the same package of the medicinal product).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parentDevice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The parent device it can be part of.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"material\" type=\"DeviceDefinition.Material\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A substance used to create the material(s) of which the device is made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DeviceDefinition.UdiDeviceIdentifier\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"deviceIdentifier\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"issuer\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization that assigns the identifier algorithm.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The jurisdiction to which the deviceIdentifier applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DeviceDefinition.DeviceName\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DeviceNameType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of deviceName.\nUDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DeviceDefinition.Specialization\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"systemType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The standard that is used to operate and communicate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version of the standard that is used to operate and communicate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DeviceDefinition.Capability\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of capability.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of capability.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DeviceDefinition.Property\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code that specifies the property DeviceDefinitionPropetyCode (Extensible).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"valueQuantity\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Property value as a quantity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"valueCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Property value as a code, e.g., NTP4 (synced to NTP).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DeviceDefinition.Material\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"substance\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"alternate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates an alternative material of the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"allergenicIndicator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the substance is a known or suspected allergen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/devicemetric.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource DeviceMetric\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DeviceMetric</sch:title>\n    <sch:rule context=\"f:DeviceMetric\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:parent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:parent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:parent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:measurementPeriod/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:measurementPeriod/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:measurementPeriod/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:measurementPeriod/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:measurementPeriod/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:measurementPeriod/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/devicemetric.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"DeviceMetric\" type=\"DeviceMetric\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes a measurement, calculation or setting capability of a medical device.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"DeviceMetric\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes a measurement, calculation or setting capability of a medical device.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique instance identifiers assigned to a device by the device or gateway software, manufacturers, other organizations or owners. For example: handle ID.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the link to the  Device that this DeviceMetric belongs to and that contains administrative device information such as manufacturer, serial number, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the link to the  Device that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a Device that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"operationalStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"DeviceMetricOperationalStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates current operational state of the device. For example: On, Off, Standby, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"color\" minOccurs=\"0\" maxOccurs=\"1\" type=\"DeviceMetricColor\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DeviceMetricCategory\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"measurementPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Timing\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the measurement repetition time. This is not necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"calibration\" type=\"DeviceMetric.Calibration\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the calibrations that have been performed or that are required to be performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DeviceMetric.Calibration\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes a measurement, calculation or setting capability of a medical device.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"DeviceMetricCalibrationType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the type of the calibration method.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"state\" minOccurs=\"0\" maxOccurs=\"1\" type=\"DeviceMetricCalibrationState\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the state of the calibration.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"time\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the time last calibration has been performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DeviceMetricCalibrationType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"unspecified\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unspecified</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"offset\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Offset</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"gain\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Gain</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"two-point\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Two Point</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DeviceMetricCalibrationType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the type of a metric calibration.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"DeviceMetricCalibrationType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DeviceMetricColor-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"black\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Color Black</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"red\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Color Red</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"green\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Color Green</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"yellow\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Color Yellow</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"blue\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Color Blue</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"magenta\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Color Magenta</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cyan\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Color Cyan</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"white\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Color White</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DeviceMetricColor\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the typical color of representation.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"DeviceMetricColor-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DeviceMetricCalibrationState-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"not-calibrated\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not Calibrated</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"calibration-required\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Calibration Required</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"calibrated\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Calibrated</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unspecified\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unspecified</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DeviceMetricCalibrationState\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the state of a metric calibration.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"DeviceMetricCalibrationState-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DeviceMetricOperationalStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"on\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"off\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Off</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"standby\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Standby</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered In Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DeviceMetricOperationalStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the operational status of the DeviceMetric.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"DeviceMetricOperationalStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DeviceMetricCategory-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"measurement\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Measurement</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"setting\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Setting</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"calculation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Calculation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unspecified\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unspecified</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DeviceMetricCategory\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the category of the metric.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"DeviceMetricCategory-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/devicerequest.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource DeviceRequest\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DeviceRequest</sch:title>\n    <sch:rule context=\"f:DeviceRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:priorRequest\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:priorRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:priorRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:groupIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:groupIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:codeReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:codeReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:codeReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:parameter/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:parameter/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:parameter/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:parameter/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrenceTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrenceTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrenceTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrenceTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrenceTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrenceTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:requester\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:requester/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:requester/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:insurance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:insurance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:insurance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:supportingInfo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:supportingInfo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:supportingInfo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:relevantHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:relevantHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:relevantHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/devicerequest.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"DeviceRequest\" type=\"DeviceRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"DeviceRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this order by the orderer or by the receiver.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Plan/proposal/order fulfilled by this request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priorRequest\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The request takes the place of the referenced completed or terminated request(s).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"groupIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Composite request this is part of.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestIntent\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the request is a proposal, plan, an original order or a reflex order.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the {{title}} should be addressed with respect to other requests.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The details of the device to be used.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"codeReference\" type=\"Reference\"/>\n            <xs:element name=\"codeCodeableConcept\" type=\"CodeableConcept\"/>\n          </xs:choice>\n          <xs:element name=\"parameter\" type=\"DeviceRequest.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific parameters for the ordered item.  For example, the prism value for lenses.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient who will use the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An encounter that provides additional context in which this request is made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. &quot;Every 8 hours&quot;; &quot;Three times a day&quot;; &quot;1/2 an hour before breakfast for 10 days from 23-Dec 2011:&quot;; &quot;15 Oct 2013, 17 Oct 2013 and 1 Nov 2013&quot;.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\n            <xs:element name=\"occurrenceTiming\" type=\"Timing\"/>\n          </xs:choice>\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the request transitioned to being actionable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual who initiated the request and has responsibility for its activation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performerType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Desired type of performer for doing the diagnostic testing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The desired performer for doing the diagnostic testing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reason or justification for the use of this device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reason or justification for the use of this device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional clinical information about the patient that may influence the request fulfilment.  For example, this may include where on the subject's body the device will be used (i.e. the target site).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relevantHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Key events in the history of the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DeviceRequest.Parameter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code or string that identifies the device detail being asserted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the device detail.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueRange\" type=\"Range\"/>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/deviceusestatement.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource DeviceUseStatement\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DeviceUseStatement</sch:title>\n    <sch:rule context=\"f:DeviceUseStatement\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:derivedFrom\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:derivedFrom/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:derivedFrom/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:device\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/deviceusestatement.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"DeviceUseStatement\" type=\"DeviceUseStatement\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"DeviceUseStatement\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An external identifier for this statement such as an IRI.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A plan, proposal or order that is fulfilled in whole or in part by this DeviceUseStatement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DeviceUseStatementStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code representing the patient or other source's judgment about the state of the device used that this statement is about.  Generally this will be active or completed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient who used the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"derivedFrom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Allows linking the DeviceUseStatement to the underlying Request, or to other information that supports or is used to derive the DeviceUseStatement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How often the device was used.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"timingTiming\" type=\"Timing\"/>\n            <xs:element name=\"timingPeriod\" type=\"Period\"/>\n            <xs:element name=\"timingDateTime\" type=\"dateTime\"/>\n          </xs:choice>\n          <xs:element name=\"recordedOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time at which the statement was made/recorded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who reported the device was being used by the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"device\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The details of the device used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reason or justification for the use of the device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates another resource whose existence justifies this DeviceUseStatement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the anotomic location on the subject's body where the device was used ( i.e. the target).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DeviceUseStatementStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"intended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Intended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"stopped\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Stopped</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-hold\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DeviceUseStatementStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A coded concept indicating the current status of the Device Usage.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"DeviceUseStatementStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/diagnosticreport.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource DiagnosticReport\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DiagnosticReport</sch:title>\n    <sch:rule context=\"f:DiagnosticReport\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:resultsInterpreter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:resultsInterpreter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:resultsInterpreter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:specimen\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:specimen/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:specimen/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:result\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:result/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:result/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:imagingStudy\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:imagingStudy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:imagingStudy/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:media/f:link\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:media/f:link/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:media/f:link/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:presentedForm\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/diagnosticreport.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"DiagnosticReport\" type=\"DiagnosticReport\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"DiagnosticReport\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this report by the performer or other systems.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details concerning a service requested.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DiagnosticReportStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the diagnostic report.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code or name that describes this diagnostic report.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"effectiveDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"effectivePeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:element name=\"issued\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The diagnostic service that is responsible for issuing the report.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resultsInterpreter\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The practitioner or organization that is responsible for the report's conclusions and interpretations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specimen\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details about the specimens on which this diagnostic report is based.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"result\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">[Observations](observation.html)  that are part of this diagnostic report.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"imagingStudy\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"media\" type=\"DiagnosticReport.Media\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"conclusion\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"conclusionCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"presentedForm\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DiagnosticReport.Media\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"link\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the image source.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DiagnosticReportStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"registered\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Registered</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"partial\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Partial</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"preliminary\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Preliminary</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"final\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Final</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"amended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Amended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"corrected\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Corrected</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"appended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Appended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DiagnosticReportStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The status of the diagnostic report.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"DiagnosticReportStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/documentmanifest.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource DocumentManifest\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DocumentManifest</sch:title>\n    <sch:rule context=\"f:DocumentManifest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:masterIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:masterIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:recipient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:recipient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:recipient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:content\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:content/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:content/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:related/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:related/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:related/f:ref\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:related/f:ref/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:related/f:ref/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/documentmanifest.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"DocumentManifest\" type=\"DocumentManifest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A collection of documents compiled for a purpose together with metadata that applies to the collection.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"DocumentManifest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A collection of documents compiled for a purpose together with metadata that applies to the collection.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"masterIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Other identifiers associated with the document manifest, including version independent  identifiers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DocumentReferenceStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this document manifest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code specifying the type of clinical activity that resulted in placing the associated content into the DocumentManifest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"created\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies who is the author of the manifest. Manifest author is not necessarly the author of the references included.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recipient\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A patient, practitioner, or organization for which this set of documents is intended.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the source system, application, or software that produced the document manifest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-readable description of the source document. This is sometimes known as the &quot;title&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"content\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The list of Resources that consist of the parts of this manifest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"related\" type=\"DocumentManifest.Related\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related identifiers or resources associated with the DocumentManifest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DocumentManifest.Related\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A collection of documents compiled for a purpose together with metadata that applies to the collection.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related identifier to this DocumentManifest.  For example, Order numbers, accession numbers, XDW workflow numbers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"ref\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related Resource to this DocumentManifest. For example, Order, ServiceRequest,  Procedure, EligibilityRequest, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/documentreference.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource DocumentReference\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DocumentReference</sch:title>\n    <sch:rule context=\"f:DocumentReference\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:masterIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:masterIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:authenticator\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:authenticator/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:authenticator/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:custodian\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:custodian/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:custodian/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:relatesTo/f:target\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:relatesTo/f:target/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:relatesTo/f:target/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:content/f:attachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:sourcePatientInfo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:sourcePatientInfo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:sourcePatientInfo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:related\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:related/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:related/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/documentreference.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"DocumentReference\" type=\"DocumentReference\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"DocumentReference\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"masterIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Other identifiers associated with the document, including version independent identifiers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DocumentReferenceStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this document reference.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"docStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CompositionStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the underlying document.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the document reference was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies who is responsible for adding the information to the document.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authenticator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Which person or organization authenticates that this document is valid.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"custodian\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatesTo\" type=\"DocumentReference.RelatesTo\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Relationships that this document has with other document references that already exist.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-readable description of the source document.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"securityLabel\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the &quot;reference&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"content\" type=\"DocumentReference.Content\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The document and format referenced. There may be multiple content element repetitions, each with a different format.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"context\" type=\"DocumentReference.Context\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The clinical context in which the document was prepared.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DocumentReference.RelatesTo\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DocumentRelationshipType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of relationship that this document has with anther document.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"target\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The target document of this relationship.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DocumentReference.Content\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"attachment\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The document or URL of the document along with critical metadata to prove content has integrity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"format\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DocumentReference.Context\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the clinical encounter or type of care that the document content is associated with.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"event\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a &quot;History and Physical Report&quot; in which the procedure being documented is necessarily a &quot;History and Physical&quot; act.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time period over which the service that is described by the document was provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"facilityType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of facility where the patient was seen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"practiceSetting\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sourcePatientInfo\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Patient Information as known when the document was published. May be a reference to a version specific, or contained.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"related\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related identifiers or resources associated with the DocumentReference.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/effectevidencesynthesis.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource EffectEvidenceSynthesis\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>EffectEvidenceSynthesis</sch:title>\n    <sch:rule context=\"f:EffectEvidenceSynthesis\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:population\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:population/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:population/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:exposure\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:exposure/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:exposure/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:exposureAlternative\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:exposureAlternative/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:exposureAlternative/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:outcome\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:outcome/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:outcome/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:resultsByExposure/f:riskEvidenceSynthesis\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:resultsByExposure/f:riskEvidenceSynthesis/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:resultsByExposure/f:riskEvidenceSynthesis/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:certainty/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:certainty/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:certainty/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:certainty/f:certaintySubcomponent/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:certainty/f:certaintySubcomponent/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:certainty/f:certaintySubcomponent/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/effectevidencesynthesis.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"EffectEvidenceSynthesis\" type=\"EffectEvidenceSynthesis\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"EffectEvidenceSynthesis\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this effect evidence synthesis when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this effect evidence synthesis is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the effect evidence synthesis is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this effect evidence synthesis when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the effect evidence synthesis when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the effect evidence synthesis author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the effect evidence synthesis. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the effect evidence synthesis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this effect evidence synthesis. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the effect evidence synthesis was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the effect evidence synthesis changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the effect evidence synthesis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the effect evidence synthesis from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate effect evidence synthesis instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the effect evidence synthesis is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the effect evidence synthesis and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the effect evidence synthesis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the effect evidence synthesis content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the EffectEvidenceSynthesis. Topics provide a high-level categorization grouping types of EffectEvidenceSynthesiss that can be useful for filtering and searching.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"synthesisType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of synthesis eg meta-analysis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"studyType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of study eg randomized trial.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"population\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the population for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exposure\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the exposure for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exposureAlternative\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the comparison exposure for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resomece that defines the outcome for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sampleSize\" type=\"EffectEvidenceSynthesis.SampleSize\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the size of the sample involved in the synthesis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resultsByExposure\" type=\"EffectEvidenceSynthesis.ResultsByExposure\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the results for each exposure considered in the effect estimate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectEstimate\" type=\"EffectEvidenceSynthesis.EffectEstimate\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The estimated effect of the exposure variant.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"certainty\" type=\"EffectEvidenceSynthesis.Certainty\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the certainty of the effect estimate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"EffectEvidenceSynthesis.SampleSize\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-readable summary of sample size.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numberOfStudies\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number of studies included in this evidence synthesis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numberOfParticipants\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number of participants included in this evidence synthesis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"EffectEvidenceSynthesis.ResultsByExposure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-readable summary of results by exposure state.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exposureState\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ExposureState\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether these results are for the exposure state or alternative exposure state.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"variantState\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used to define variant exposure states such as low-risk state.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"riskEvidenceSynthesis\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to a RiskEvidenceSynthesis resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"EffectEvidenceSynthesis.EffectEstimate\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-readable summary of effect estimate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Examples include relative risk and mean difference.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"variantState\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used to define variant exposure states such as low-risk state.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The point estimate of the effect estimate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitOfMeasure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the UCUM unit for the outcome.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"precisionEstimate\" type=\"EffectEvidenceSynthesis.PrecisionEstimate\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the precision of the estimate for the effect.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"EffectEvidenceSynthesis.PrecisionEstimate\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Examples include confidence interval and interquartile range.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"level\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Use 95 for a 95% confidence interval.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"from\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Lower bound of confidence interval.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"to\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Upper bound of confidence interval.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"EffectEvidenceSynthesis.Certainty\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"rating\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A rating of the certainty of the effect estimate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"certaintySubcomponent\" type=\"EffectEvidenceSynthesis.CertaintySubcomponent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of a component of the overall certainty.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"EffectEvidenceSynthesis.CertaintySubcomponent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of subcomponent of certainty rating.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rating\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A rating of a subcomponent of rating certainty.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ExposureState-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"exposure\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Exposure</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"exposure-alternative\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Exposure Alternative</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ExposureState\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Whether the results by exposure is describing the results for the primary exposure of interest (exposure) or the alternative state (exposureAlternative).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ExposureState-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/encounter.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Encounter\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Encounter</sch:title>\n    <sch:rule context=\"f:Encounter\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:statusHistory/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:classHistory/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:episodeOfCare\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:episodeOfCare/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:episodeOfCare/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:participant/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:participant/f:individual\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:participant/f:individual/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:participant/f:individual/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:appointment\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:appointment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:appointment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:length\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:diagnosis/f:condition\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:diagnosis/f:condition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:diagnosis/f:condition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:account\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:account/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:account/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:preAdmissionIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:preAdmissionIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:origin\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:origin/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:origin/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:destination\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:destination/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:destination/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:location/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:location/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:location/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:location/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:serviceProvider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:serviceProvider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:serviceProvider/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/encounter.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Encounter\" type=\"Encounter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Encounter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier(s) by which this encounter is known.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EncounterStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">planned | arrived | triaged | in-progress | onleave | finished | cancelled +.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusHistory\" type=\"Encounter.StatusHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"class\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"classHistory\" type=\"Encounter.ClassHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The class history permits the tracking of the encounters transitions without needing to go  through the resource history.  This would be used for a case where an admission starts of as an emergency encounter, then transitions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kind of discharge from emergency to inpatient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"serviceType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Broad categorization of the service that is to be provided (e.g. cardiology).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the urgency of the encounter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient or group present at the encounter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"episodeOfCare\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem.  The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The request this encounter satisfies (e.g. incoming referral or procedure request).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"participant\" type=\"Encounter.Participant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The list of people responsible for providing the service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"appointment\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The appointment that scheduled this encounter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The start and end time of the encounter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"length\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Quantity of time the encounter lasted. This excludes the time during leaves of absence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"diagnosis\" type=\"Encounter.Diagnosis\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The list of diagnosis relevant to this encounter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"account\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The set of accounts that may be used for billing for this Encounter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"hospitalization\" type=\"Encounter.Hospitalization\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details about the admission to a healthcare service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" type=\"Encounter.Location\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">List of locations where  the patient has been during this encounter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"serviceProvider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation.  Refer to the example bundle showing an abbreviated set of Encounters for a colonoscopy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Another Encounter of which this encounter is a part of (administratively or in time).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Encounter.StatusHistory\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EncounterStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">planned | arrived | triaged | in-progress | onleave | finished | cancelled +.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time that the episode was in the specified status.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Encounter.ClassHistory\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"class\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">inpatient | outpatient | ambulatory | emergency +.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time that the episode was in the specified class.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Encounter.Participant\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Role of participant in encounter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"individual\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Persons involved in the encounter other than the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Encounter.Diagnosis\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"condition\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"use\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rank\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Ranking of the diagnosis (for each role type).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Encounter.Hospitalization\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"preAdmissionIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Pre-admission identifier.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"origin\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The location/organization from which the patient came before admission.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"admitSource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">From where patient was admitted (physician referral, transfer).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reAdmission\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this hospitalization is a readmission and why if known.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dietPreference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Diet preferences reported by the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialCourtesy\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Special courtesies (VIP, board member).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialArrangement\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Any special requests that have been made for this hospitalization encounter, such as the provision of specific equipment or other things.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"destination\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Location/organization to which the patient is discharged.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dischargeDisposition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Category or kind of location after discharge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Encounter.Location\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"location\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The location where the encounter takes place.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"EncounterLocationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"physicalType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time period during which the patient was present at the location.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"EncounterLocationStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"planned\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Planned</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"reserved\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Reserved</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"EncounterLocationStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The status of the location.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"EncounterLocationStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"EncounterStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"planned\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Planned</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"arrived\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Arrived</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"triaged\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Triaged</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"in-progress\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"onleave\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On Leave</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"finished\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Finished</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"EncounterStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Current state of the encounter.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"EncounterStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/endpoint.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Endpoint\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Endpoint</sch:title>\n    <sch:rule context=\"f:Endpoint\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:managingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:managingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:managingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:contact\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:contact/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/endpoint.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Endpoint\" type=\"Endpoint\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Endpoint\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for the organization that is used to identify the endpoint across multiple disparate systems.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EndpointStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">active | suspended | error | off | test.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"connectionType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A coded value that represents the technical details of the usage of this endpoint, such as what WSDLs should be used in what way. (e.g. XDS.b/DICOM/cds-hook).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A friendly name that this endpoint can be referred to with.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"managingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization that manages this endpoint (even if technically another organization is hosting this in the cloud, it is the organization associated with the data).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The interval during which the endpoint is expected to be operational.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payloadType\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The payload type describes the acceptable content that can be communicated on the endpoint.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payloadMimeType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"address\" minOccurs=\"1\" maxOccurs=\"1\" type=\"url\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The uri that describes the actual end-point to connect to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"header\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional headers / information to send as part of the notification.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"EndpointStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"suspended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Suspended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"off\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Off</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"test\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Test</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"EndpointStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The status of the endpoint.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"EndpointStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/enrollmentrequest.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource EnrollmentRequest\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>EnrollmentRequest</sch:title>\n    <sch:rule context=\"f:EnrollmentRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:insurer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:insurer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:insurer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:candidate\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:candidate/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:candidate/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/enrollmentrequest.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"EnrollmentRequest\" type=\"EnrollmentRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the insurance enrollment details to the insurer regarding a specified coverage.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"EnrollmentRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the insurance enrollment details to the insurer regarding a specified coverage.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Response business identifier.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"created\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when this resource was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Insurer who is target  of the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"candidate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Patient Resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"coverage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the program or plan identification, underwriter or payor.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/enrollmentresponse.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource EnrollmentResponse\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>EnrollmentResponse</sch:title>\n    <sch:rule context=\"f:EnrollmentResponse\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:organization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:organization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:requestProvider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:requestProvider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:requestProvider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/enrollmentresponse.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"EnrollmentResponse\" type=\"EnrollmentResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides enrollment and plan details from the processing of an EnrollmentRequest resource.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"EnrollmentResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides enrollment and plan details from the processing of an EnrollmentRequest resource.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Response business identifier.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Original request resource reference.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RemittanceOutcome\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Processing status: error, complete.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"disposition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the status of the adjudication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"created\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when the enclosed suite of services were performed or completed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"organization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Insurer who produced this adjudicated response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requestProvider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/episodeofcare.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource EpisodeOfCare\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>EpisodeOfCare</sch:title>\n    <sch:rule context=\"f:EpisodeOfCare\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:statusHistory/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:diagnosis/f:condition\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:diagnosis/f:condition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:diagnosis/f:condition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:managingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:managingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:managingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:referralRequest\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:referralRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:referralRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:careManager\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:careManager/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:careManager/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:team\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:team/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:team/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:account\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:account/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:account/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/episodeofcare.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"EpisodeOfCare\" type=\"EpisodeOfCare\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"EpisodeOfCare\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EpisodeOfCareStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">planned | waitlist | active | onhold | finished | cancelled.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusHistory\" type=\"EpisodeOfCare.StatusHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"diagnosis\" type=\"EpisodeOfCare.Diagnosis\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The list of diagnosis relevant to this episode of care.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient who is the focus of this episode of care.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"managingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization that has assumed the specific responsibilities for the specified duration.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The interval during which the managing organization assumes the defined responsibility.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referralRequest\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"careManager\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The practitioner that is the care manager/care coordinator for this patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"team\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The list of practitioners that may be facilitating this episode of care for specific purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"account\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The set of accounts that may be used for billing for this EpisodeOfCare.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"EpisodeOfCare.StatusHistory\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EpisodeOfCareStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">planned | waitlist | active | onhold | finished | cancelled.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during this EpisodeOfCare that the specific status applied.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"EpisodeOfCare.Diagnosis\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"condition\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rank\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Ranking of the diagnosis (for each role type).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"EpisodeOfCareStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"planned\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Planned</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"waitlist\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Waitlist</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"onhold\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"finished\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Finished</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"EpisodeOfCareStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The status of the episode of care.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"EpisodeOfCareStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/eventdefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource EventDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>EventDefinition</sch:title>\n    <sch:rule context=\"f:EventDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger\">\n      <sch:assert test=\"((not(f:type/@value = 'named-event')) or name.exists()) and (not(f:type/@value = 'periodic') or timing.exists()) and (not(starts-with(f:type/@value, 'data-')) or data.exists())\">trd-3: A named event requires a name, a periodic event requires timing, and a data event requires data</sch:assert>\n      <sch:assert test=\"not(exists(f:condition)) or exists(f:data)\">trd-2: A condition only if there is a data requirement</sch:assert>\n      <sch:assert test=\"not(exists(f:data)) or not(exists(*[starts-with(local-name(.), 'timing')]))\">trd-1: Either timing, or a data requirement, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:codeFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-1: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:dateFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-2: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:dateFilter/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:dateFilter/f:valueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:condition\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/eventdefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"EventDefinition\" type=\"EventDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EventDefinition resource provides a reusable description of when a particular event can occur.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"EventDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EventDefinition resource provides a reusable description of when a particular event can occur.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this event definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this event definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the event definition is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this event definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the event definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the event definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the event definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the event definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the event definition giving additional information about its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this event definition. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this event definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code or group definition that describes the intended subject of the event definition.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the event definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the event definition changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the event definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the event definition from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate event definition instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the event definition is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this event definition is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A detailed description of how the event definition is used from a clinical perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the event definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the event definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the event definition content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the module. Topics provide a high-level categorization of the module that can be useful for filtering and searching.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related resources such as additional documentation, justification, or bibliographic references.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"trigger\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"TriggerDefinition\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The trigger element defines when the event occurs. If more than one trigger condition is specified, the event fires whenever any one of the trigger conditions is met.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/evidence.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Evidence\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Evidence</sch:title>\n    <sch:rule context=\"f:Evidence\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:exposureBackground\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:exposureBackground/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:exposureBackground/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:exposureVariant\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:exposureVariant/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:exposureVariant/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:outcome\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:outcome/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:outcome/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/evidence.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Evidence\" type=\"Evidence\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Evidence resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Evidence\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Evidence resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this evidence when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this evidence is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the evidence is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this evidence when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the evidence when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the evidence author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the evidence. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the evidence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"shortTitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the Evidence giving additional information about its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this evidence. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the evidence was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the evidence changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the evidence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the evidence from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the evidence is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the evidence and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the evidence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the evidence content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the Evidence. Topics provide a high-level categorization grouping types of Evidences that can be useful for filtering and searching.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exposureBackground\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the population for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exposureVariant\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the exposure for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resomece that defines the outcome for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/evidencevariable.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource EvidenceVariable\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>EvidenceVariable</sch:title>\n    <sch:rule context=\"f:EvidenceVariable\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionExpression\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:codeFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-1: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:dateFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-2: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:dateFilter/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:dateFilter/f:valueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition\">\n      <sch:assert test=\"((not(f:type/@value = 'named-event')) or name.exists()) and (not(f:type/@value = 'periodic') or timing.exists()) and (not(starts-with(f:type/@value, 'data-')) or data.exists())\">trd-3: A named event requires a name, a periodic event requires timing, and a data event requires data</sch:assert>\n      <sch:assert test=\"not(exists(f:condition)) or exists(f:data)\">trd-2: A condition only if there is a data requirement</sch:assert>\n      <sch:assert test=\"not(exists(f:data)) or not(exists(*[starts-with(local-name(.), 'timing')]))\">trd-1: Either timing, or a data requirement, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:codeFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-1: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:dateFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-2: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:dateFilter/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:dateFilter/f:valueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:condition\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:timeFromStart\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/evidencevariable.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"EvidenceVariable\" type=\"EvidenceVariable\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EvidenceVariable resource describes a &quot;PICO&quot; element that knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"EvidenceVariable\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EvidenceVariable resource describes a &quot;PICO&quot; element that knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this evidence variable when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this evidence variable is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the evidence variable is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this evidence variable when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the evidence variable when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the evidence variable author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the evidence variable. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the evidence variable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"shortTitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the EvidenceVariable giving additional information about its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this evidence variable. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the evidence variable was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the evidence variable changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the evidence variable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the evidence variable from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence variable instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the evidence variable is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the evidence variable and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the evidence variable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the evidence variable content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the EvidenceVariable. Topics provide a high-level categorization grouping types of EvidenceVariables that can be useful for filtering and searching.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"EvidenceVariableType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of evidence element, a population, an exposure, or an outcome.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"characteristic\" type=\"EvidenceVariable.Characteristic\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A characteristic that defines the members of the evidence element. Multiple characteristics are applied with &quot;and&quot; semantics.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"EvidenceVariable.Characteristic\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The EvidenceVariable resource describes a &quot;PICO&quot; element that knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, natural language description of the characteristic that could be used to communicate the criteria to an end-user.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Define members of the evidence element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year).</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"definitionReference\" type=\"Reference\"/>\n            <xs:element name=\"definitionCanonical\" type=\"canonical\"/>\n            <xs:element name=\"definitionCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"definitionExpression\" type=\"Expression\"/>\n            <xs:element name=\"definitionDataRequirement\" type=\"DataRequirement\"/>\n            <xs:element name=\"definitionTriggerDefinition\" type=\"TriggerDefinition\"/>\n          </xs:choice>\n          <xs:element name=\"usageContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Use UsageContext to define the members of the population, such as Age Ranges, Genders, Settings.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exclude\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When true, members with this characteristic are excluded from the element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates what effective period the study covers.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"participantEffectiveDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"participantEffectivePeriod\" type=\"Period\"/>\n            <xs:element name=\"participantEffectiveDuration\" type=\"Duration\"/>\n            <xs:element name=\"participantEffectiveTiming\" type=\"Timing\"/>\n          </xs:choice>\n          <xs:element name=\"timeFromStart\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates duration from the participant's study entry.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"groupMeasure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"GroupMeasure\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how elements are aggregated within the study effective period.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"EvidenceVariableType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"dichotomous\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Dichotomous</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"continuous\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Continuous</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"descriptive\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Descriptive</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"EvidenceVariableType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The possible types of variables for exposures or outcomes (E.g. Dichotomous, Continuous, Descriptive).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"EvidenceVariableType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"GroupMeasure-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"mean\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Mean</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"median\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Median</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"mean-of-mean\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Mean of Study Means</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"mean-of-median\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Mean of Study Medins</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"median-of-mean\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Median of Study Means</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"median-of-median\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Median of Study Medians</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"GroupMeasure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Possible group measure aggregates (E.g. Mean, Median).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"GroupMeasure-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/examplescenario.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ExampleScenario\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ExampleScenario</sch:title>\n    <sch:rule context=\"f:ExampleScenario\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/examplescenario.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ExampleScenario\" type=\"ExampleScenario\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ExampleScenario\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this example scenario when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this example scenario is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the example scenario is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this example scenario when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the example scenario when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the example scenario author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the example scenario. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this example scenario. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this example scenario is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the example scenario was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the example scenario changes. (e.g. the 'content logical definition').</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the example scenario.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate example scenario instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the example scenario is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the example scenario and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the example scenario.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">What the example scenario resource is created for. This should not be used to show the business purpose of the scenario itself, but the purpose of documenting a scenario.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actor\" type=\"ExampleScenario.Actor\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Actor participating in the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instance\" type=\"ExampleScenario.Instance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Each resource and each version that is present in the workflow.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"process\" type=\"ExampleScenario.Process\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Each major process - a group of operations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"workflow\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Another nested workflow.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExampleScenario.Actor\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"actorId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">ID or acronym of actor.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ExampleScenarioActorType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of actor - person or system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the actor as shown in the page.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The description of the actor.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExampleScenario.Instance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"resourceId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The id of the resource for referencing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resourceType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ResourceType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short name for the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-friendly description of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" type=\"ExampleScenario.Version\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A specific version of the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"containedInstance\" type=\"ExampleScenario.ContainedInstance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Resources contained in the instance (e.g. the observations contained in a bundle).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExampleScenario.Version\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"versionId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier of a specific version of a resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The description of the resource version.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExampleScenario.ContainedInstance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"resourceId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Each resource contained in the instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"versionId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A specific version of a resource contained in the instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExampleScenario.Process\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"title\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The diagram title of the group of operations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A longer description of the group of operations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preConditions\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of initial status before the process starts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"postConditions\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of final status after the process ends.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"step\" type=\"ExampleScenario.Step\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Each step of the process.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExampleScenario.Step\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"process\" type=\"ExampleScenario.Process\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Nested process.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"pause\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If there is a pause in the flow.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"operation\" type=\"ExampleScenario.Operation\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Each interaction or action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"alternative\" type=\"ExampleScenario.Alternative\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates an alternative step that can be taken instead of the operations on the base step in exceptional/atypical circumstances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExampleScenario.Operation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"number\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The sequential number of the interaction, e.g. 1.2.5.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of operation - CRUD.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The human-friendly name of the interaction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"initiator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who starts the transaction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"receiver\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who receives the transaction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A comment to be inserted in the diagram.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"initiatorActive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the initiator is deactivated right after the transaction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"receiverActive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the receiver is deactivated right after the transaction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"request\" type=\"ExampleScenario.ContainedInstance\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Each resource instance used by the initiator.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"response\" type=\"ExampleScenario.ContainedInstance\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Each resource instance used by the responder.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExampleScenario.Alternative\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"title\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The label to display for the alternative that gives a sense of the circumstance in which the alternative should be invoked.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable description of the alternative explaining when the alternative should occur rather than the base step.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"step\" type=\"ExampleScenario.Step\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">What happens in each alternative option.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ExampleScenarioActorType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"person\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Person</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entity\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">System</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ExampleScenarioActorType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of actor - system or human.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ExampleScenarioActorType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ResourceType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"Account\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Account</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Account</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Cuenta</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">账户</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ActivityDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ActivityDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ActivityDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"it\">DefinizioneAttivita</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DefinicionDeActividad</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">活动定义</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AdverseEvent\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">AdverseEvent</xs:documentation>\n          <xs:documentation xml:lang=\"en\">AdverseEvent</xs:documentation>\n          <xs:documentation xml:lang=\"it\">EventoAvverso</xs:documentation>\n          <xs:documentation xml:lang=\"es\">EventoAdverso</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">不良事件</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AllergyIntolerance\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">AllergyIntolerance</xs:documentation>\n          <xs:documentation xml:lang=\"en\">AllergyIntolerance</xs:documentation>\n          <xs:documentation xml:lang=\"it\">AllergiaIntolleranza</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">IntoléranceAllergique</xs:documentation>\n          <xs:documentation xml:lang=\"es\">AllergiaIntolerancia</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">变态反应与不耐性</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Appointment\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Appointment</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Appointment</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Appuntamento</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RendezVous</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Cita</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">预约</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AppointmentResponse\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">AppointmentResponse</xs:documentation>\n          <xs:documentation xml:lang=\"en\">AppointmentResponse</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RispostaAppuntamento</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RéponseRendezVous</xs:documentation>\n          <xs:documentation xml:lang=\"es\">CitaRespuesta</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">预约响应</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AuditEvent\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">AuditEvent</xs:documentation>\n          <xs:documentation xml:lang=\"en\">AuditEvent</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">ÉvènementSécurité</xs:documentation>\n          <xs:documentation xml:lang=\"es\">EventoSeguridad</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">审计事件</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Basic\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Basic</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Basic</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Basique</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Basico</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">初级资源</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Binary\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Binary</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Binary</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Binario</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Binaire</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Binario</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">二进制资源</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BiologicallyDerivedProduct\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BiologicallyDerivedProduct</xs:documentation>\n          <xs:documentation xml:lang=\"en\">BiologicallyDerivedProduct</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BodyStructure\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BodyStructure</xs:documentation>\n          <xs:documentation xml:lang=\"en\">BodyStructure</xs:documentation>\n          <xs:documentation xml:lang=\"it\">StrutturaDelCorpo</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">MorphologieDeCorps</xs:documentation>\n          <xs:documentation xml:lang=\"es\">EstructuraDelCuerpo</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">身体结构</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Bundle\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Bundle</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Bundle</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Paquet</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Paquete</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">捆束</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CapabilityStatement\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CapabilityStatement</xs:documentation>\n          <xs:documentation xml:lang=\"en\">CapabilityStatement</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DeclaracionDeCapacidad</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">能力声明</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CarePlan\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CarePlan</xs:documentation>\n          <xs:documentation xml:lang=\"en\">CarePlan</xs:documentation>\n          <xs:documentation xml:lang=\"it\">PianoDiCura</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">PlanDeSoins</xs:documentation>\n          <xs:documentation xml:lang=\"es\">PlanDeCuidado</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">照护计划</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CareTeam\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CareTeam</xs:documentation>\n          <xs:documentation xml:lang=\"en\">CareTeam</xs:documentation>\n          <xs:documentation xml:lang=\"es\">EquipoDeCuidado</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">照护团队</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CatalogEntry\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CatalogEntry</xs:documentation>\n          <xs:documentation xml:lang=\"en\">CatalogEntry</xs:documentation>\n          <xs:documentation xml:lang=\"es\">EntradaDeCatalogo</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">条目定义</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ChargeItem\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ChargeItem</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ChargeItem</xs:documentation>\n          <xs:documentation xml:lang=\"es\">CargoDeItem</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">收费项目</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ChargeItemDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ChargeItemDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ChargeItemDefinition</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Claim\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Claim</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Claim</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Réclamation</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Reclamación / Factura</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">赔单</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ClaimResponse\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ClaimResponse</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ClaimResponse</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RéponseARéclamation</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">赔单请求</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ClinicalImpression\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ClinicalImpression</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ClinicalImpression</xs:documentation>\n          <xs:documentation xml:lang=\"it\">ImpressioneClinica</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">ImpressionClinique</xs:documentation>\n          <xs:documentation xml:lang=\"es\">HallazgoClinico</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">临床印象</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CodeSystem\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CodeSystem</xs:documentation>\n          <xs:documentation xml:lang=\"en\">CodeSystem</xs:documentation>\n          <xs:documentation xml:lang=\"it\">SistemaDiCodifica</xs:documentation>\n          <xs:documentation xml:lang=\"es\">SistemaDeCodigos</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">代码系统</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Communication\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Communication</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Communication</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Comunicazione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Communication</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Comunicación</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">通讯</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CommunicationRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CommunicationRequest</xs:documentation>\n          <xs:documentation xml:lang=\"en\">CommunicationRequest</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RichiestaDiComunicazione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">DemandeDeCommunication</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ComunicaciónRequerimiento</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">通讯请求</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CompartmentDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CompartmentDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">CompartmentDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DefinicionDeCompartimento</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">逻辑区块定义</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Composition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Composition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Composition</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Composizione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Composition</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Composición</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">组合式文书</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ConceptMap\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ConceptMap</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ConceptMap</xs:documentation>\n          <xs:documentation xml:lang=\"it\">MappaDiConcetti</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">CarteDeConcepts</xs:documentation>\n          <xs:documentation xml:lang=\"es\">MapaDeConceptos</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">概念映射</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Condition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Condition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Condition</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Condizione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Condition</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Condición</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">情况</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Consent\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Consent</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Consent</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Consenso</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Consentimiento</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">同意书</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Contract\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Contract</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Contract</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Contratto</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Contrat</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Contato</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">合同</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Coverage\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Coverage</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Coverage</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Copertura</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Couverture</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Cobertura</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">保险责任</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CoverageEligibilityRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CoverageEligibilityRequest</xs:documentation>\n          <xs:documentation xml:lang=\"en\">CoverageEligibilityRequest</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RichiestaEleggibilitaCopertura</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">CouvertureDemandeEligibilité</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">资格请求</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CoverageEligibilityResponse\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CoverageEligibilityResponse</xs:documentation>\n          <xs:documentation xml:lang=\"en\">CoverageEligibilityResponse</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RispostaEleggibilitaCopertura</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RéponseEligibilitéCouverture</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">资格响应</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DetectedIssue\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DetectedIssue</xs:documentation>\n          <xs:documentation xml:lang=\"en\">DetectedIssue</xs:documentation>\n          <xs:documentation xml:lang=\"it\">ProblemaRilevato</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Problème Détecté</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Problema-Detectado /ProblemaDetectado</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">已发现问题</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Device\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Device</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Device</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Dispositivo</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Dispositif</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Dispositivo</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">装置</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DeviceDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DeviceDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">DeviceDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">DéfinitionDeDispositif</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DefiniciónDeDispositivo</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">装置组件</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DeviceMetric\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DeviceMetric</xs:documentation>\n          <xs:documentation xml:lang=\"en\">DeviceMetric</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">MétriqueDispositif</xs:documentation>\n          <xs:documentation xml:lang=\"es\">MetricaDeDispositivo</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">装置指标</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DeviceRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DeviceRequest</xs:documentation>\n          <xs:documentation xml:lang=\"en\">DeviceRequest</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RichiestaDispositivo</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">DemandeUtilisationDispositif</xs:documentation>\n          <xs:documentation xml:lang=\"es\">SolicitudDeDispositivo</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">装置请求</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DeviceUseStatement\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DeviceUseStatement</xs:documentation>\n          <xs:documentation xml:lang=\"en\">DeviceUseStatement</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">装置使用声明</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DiagnosticReport\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DiagnosticReport</xs:documentation>\n          <xs:documentation xml:lang=\"en\">DiagnosticReport</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RefertoDiagnostico</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RapportDiagnostique</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">诊断报告</xs:documentation>\n          <xs:documentation xml:lang=\"es\">InformeDiagnostico</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DocumentManifest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DocumentManifest</xs:documentation>\n          <xs:documentation xml:lang=\"en\">DocumentManifest</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Manifeste</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">文档清单</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ManifestoDocumento</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DocumentReference\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DocumentReference</xs:documentation>\n          <xs:documentation xml:lang=\"en\">DocumentReference</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RiferimentoDocumento</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RéférenceDocument</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ReferenciaDocumento</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">文档引用</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DomainResource\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DomainResource</xs:documentation>\n          <xs:documentation xml:lang=\"en\">DomainResource</xs:documentation>\n          <xs:documentation xml:lang=\"es\">RecursoDeDominio</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">领域资源</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EffectEvidenceSynthesis\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">EffectEvidenceSynthesis</xs:documentation>\n          <xs:documentation xml:lang=\"en\">EffectEvidenceSynthesis</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Encounter\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Encounter</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Encounter</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Venue</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">就医过程</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Encuentro</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Endpoint\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Endpoint</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Endpoint</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Endpoint</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">端点</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EnrollmentRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">EnrollmentRequest</xs:documentation>\n          <xs:documentation xml:lang=\"en\">EnrollmentRequest</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RichiestaIscrizione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">DemandeInscription</xs:documentation>\n          <xs:documentation xml:lang=\"es\">SolicitudDeEnrolamiento</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">保险注册请求</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EnrollmentResponse\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">EnrollmentResponse</xs:documentation>\n          <xs:documentation xml:lang=\"en\">EnrollmentResponse</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RispostaIscrizione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RéponseInscription</xs:documentation>\n          <xs:documentation xml:lang=\"es\">RespuestaDeEnrolamiento</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">保险注册响应</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EpisodeOfCare\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">EpisodeOfCare</xs:documentation>\n          <xs:documentation xml:lang=\"en\">EpisodeOfCare</xs:documentation>\n          <xs:documentation xml:lang=\"it\">EpisodioDiCura</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">ÉpisodeDeSoins</xs:documentation>\n          <xs:documentation xml:lang=\"es\">EpisodioDeCuidado</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">照护服务节段</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EventDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">EventDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">EventDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"it\">DefinizioneEvento</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DefinitionDeEvento</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">事件定义</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Evidence\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Evidence</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Evidence</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EvidenceVariable\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">EvidenceVariable</xs:documentation>\n          <xs:documentation xml:lang=\"en\">EvidenceVariable</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ExampleScenario\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ExampleScenario</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ExampleScenario</xs:documentation>\n          <xs:documentation xml:lang=\"it\">ScenarioDiEsempio</xs:documentation>\n          <xs:documentation xml:lang=\"es\">EjemploDeEscenario</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">示例场景</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ExplanationOfBenefit\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ExplanationOfBenefit</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ExplanationOfBenefit</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">ExplicationDuBénéfice</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">赔付说明</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"FamilyMemberHistory\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">FamilyMemberHistory</xs:documentation>\n          <xs:documentation xml:lang=\"en\">FamilyMemberHistory</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">HistoireMembreFamille</xs:documentation>\n          <xs:documentation xml:lang=\"es\">HistorialMiembroFamiliar</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">家族史</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Flag\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Flag</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Flag</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Drapeau</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Bandera</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">标记</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Goal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Goal</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Goal</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">But</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Objetivo</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">目标</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GraphDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GraphDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">GraphDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DefinitionGrafico</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">图形定义</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Group\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Group</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Group</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Gruppo</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Groupe</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Grupo</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">群组</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GuidanceResponse\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GuidanceResponse</xs:documentation>\n          <xs:documentation xml:lang=\"en\">GuidanceResponse</xs:documentation>\n          <xs:documentation xml:lang=\"es\">RespuestaDeOrientacion</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">指导意见响应</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"HealthcareService\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">HealthcareService</xs:documentation>\n          <xs:documentation xml:lang=\"en\">HealthcareService</xs:documentation>\n          <xs:documentation xml:lang=\"it\">ServizioSanitario</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">ServiceDeSanté</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ServicioDeCuidado</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">医疗保健服务项目</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ImagingStudy\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ImagingStudy</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ImagingStudy</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">EtudeImagerie</xs:documentation>\n          <xs:documentation xml:lang=\"es\">EstudioImagen  / EstudioImagen</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">成像检查</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Immunization\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Immunization</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Immunization</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Immunizzazione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Immunisation</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">免疫接种</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Inmunización</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ImmunizationEvaluation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ImmunizationEvaluation</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ImmunizationEvaluation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ImmunizationRecommendation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ImmunizationRecommendation</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ImmunizationRecommendation</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RecommendationImmunisation</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">免疫接种建议</xs:documentation>\n          <xs:documentation xml:lang=\"es\">RecomendaciónInmunización /</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ImplementationGuide\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ImplementationGuide</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ImplementationGuide</xs:documentation>\n          <xs:documentation xml:lang=\"es\">GuiaDeImplementacion</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">实施指南</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"InsurancePlan\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">InsurancePlan</xs:documentation>\n          <xs:documentation xml:lang=\"en\">InsurancePlan</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Invoice\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Invoice</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Invoice</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Library\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Library</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Library</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Librería</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">库</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Linkage\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Linkage</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Linkage</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Enlace / Conexión / Vinculo / Acoplamiento </xs:documentation>\n          <xs:documentation xml:lang=\"zh\">链接关系</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"List\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">List</xs:documentation>\n          <xs:documentation xml:lang=\"en\">List</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Lista</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Liste</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">列表</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Lista</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Location\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Location</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Location</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Localisation</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">位置</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Locacion</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Measure\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Measure</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Measure</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Misura</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Medida</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">指标</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MeasureReport\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MeasureReport</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MeasureReport</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ReporteMedida</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">指标报告</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Media\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Media</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Media</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Media</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Média</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Medio</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">媒体</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Medication\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Medication</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Medication</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Médication</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">药物</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Medicación /Medicamento</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicationAdministration\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicationAdministration</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicationAdministration</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">AdministrationMédicaments</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">药物施用</xs:documentation>\n          <xs:documentation xml:lang=\"es\">AdministraciónMedicación / AdministracionMedicamento</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicationDispense\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicationDispense</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicationDispense</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">DispensationMédicaments</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">药物配发</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DispensaciónMedicación /DispensacionMedicamento</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicationKnowledge\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicationKnowledge</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicationKnowledge</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicationRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicationRequest</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicationRequest</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">PrescriptionMédicamenteuseTODO</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">药物请求</xs:documentation>\n          <xs:documentation xml:lang=\"es\">PrescripciónMedicaciónTODO  /PrescripcionMedicamento</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicationStatement\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicationStatement</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicationStatement</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">ÉtatMédication</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">药物声明</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ResumenMedicación /ResumenMedicamento</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicinalProduct\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicinalProduct</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicinalProduct</xs:documentation>\n          <xs:documentation xml:lang=\"it\">ProdottoMedicinale</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicinalProductAuthorization\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductAuthorization</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductAuthorization</xs:documentation>\n          <xs:documentation xml:lang=\"it\">AutorizzazioneProdottoMedicinale</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicinalProductContraindication\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductContraindication</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductContraindication</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicinalProductIndication\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductIndication</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductInteraction</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicinalProductIngredient\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductIngredient</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductIngredient</xs:documentation>\n          <xs:documentation xml:lang=\"it\">IngredienteProdottoMedicinale</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicinalProductInteraction\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductInteraction</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductInteraction</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicinalProductManufactured\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductManufactured</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductManufactured</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicinalProductPackaged\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductPackaged</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductPackaged</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicinalProductPharmaceutical\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductPharmaceutical</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductPharmaceutical</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MedicinalProductUndesirableEffect\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductUndesirableEffect</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MedicinalProductUndesirableEffect</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MessageDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MessageDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MessageDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"it\">DefinizioneMessaggio</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DefinicionMensaje</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">消息定义</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MessageHeader\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MessageHeader</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MessageHeader</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">EntêteMessage</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">消息标头</xs:documentation>\n          <xs:documentation xml:lang=\"es\">CabeceraMensaje</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MolecularSequence\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MolecularSequence</xs:documentation>\n          <xs:documentation xml:lang=\"en\">MolecularSequence</xs:documentation>\n          <xs:documentation xml:lang=\"es\">SecuenciaMolecular</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">分子序列</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NamingSystem\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">NamingSystem</xs:documentation>\n          <xs:documentation xml:lang=\"en\">NamingSystem</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">SystèmeDeNommage</xs:documentation>\n          <xs:documentation xml:lang=\"es\">SistemaDeNombres</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">命名系统</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NutritionOrder\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">NutritionOrder</xs:documentation>\n          <xs:documentation xml:lang=\"en\">NutritionOrder</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">OrdreNutrition</xs:documentation>\n          <xs:documentation xml:lang=\"es\">OrdenNutrición</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">营养医嘱</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Observation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Observation</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Observation</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Osservazione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Observation</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">观察</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Observación</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ObservationDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ObservationDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ObservationDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"it\">DefinizioneOsservazione</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DefinicionDeEspecimen</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">观察定义</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OperationDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">OperationDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">OperationDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"it\">DefinizioneOperazione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">DéfinitionOpération</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DefinicionDeOperacion</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">操作定义</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OperationOutcome\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">OperationOutcome</xs:documentation>\n          <xs:documentation xml:lang=\"en\">OperationOutcome</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RisultatoOperazione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RésultatOpération</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">操作结局</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ResultadoOperación</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Organization\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Organization</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Organization</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Organizzazione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Organisation</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">组织机构</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Organización</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OrganizationAffiliation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">OrganizationAffiliation</xs:documentation>\n          <xs:documentation xml:lang=\"en\">OrganizationAffiliation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Parameters\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Parameters</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Parameters</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Parametros</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">参数</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Patient\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Patient</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Patient</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Paziente</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Patient</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">患者</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Paciente</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PaymentNotice\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PaymentNotice</xs:documentation>\n          <xs:documentation xml:lang=\"en\">PaymentNotice</xs:documentation>\n          <xs:documentation xml:lang=\"it\">AvvisoDiPagamento</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">AvisPaiement</xs:documentation>\n          <xs:documentation xml:lang=\"es\">AvisoDePago</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">付款通知</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PaymentReconciliation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PaymentReconciliation</xs:documentation>\n          <xs:documentation xml:lang=\"en\">PaymentReconciliation</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RiconciliazionePagamento</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RéconciliationPaiement</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ConciliacionDePago</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">付款对账</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Person\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Person</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Person</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Persona</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Personne</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Persona</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">人员</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PlanDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PlanDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">PlanDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DefinicionDePlan</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">计划定义</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Practitioner\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Practitioner</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Practitioner</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Praticien</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">执业人员</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Practicante / Profesional</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PractitionerRole\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PractitionerRole</xs:documentation>\n          <xs:documentation xml:lang=\"en\">PractitionerRole</xs:documentation>\n          <xs:documentation xml:lang=\"es\">RolProfesional</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">执业人员角色</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Procedure\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Procedure</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Procedure</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Procedura</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Procédure</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">操作项目</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Procedimiento</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Provenance\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Provenance</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Provenance</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Provenienza</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Provenance</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">出处</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Procedencia</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Questionnaire\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Questionnaire</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Questionnaire</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Questionario</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Questionnaire</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">调查问卷</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Cuestionario</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"QuestionnaireResponse\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">QuestionnaireResponse</xs:documentation>\n          <xs:documentation xml:lang=\"en\">QuestionnaireResponse</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RispostaQuestionario</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RéponseQuestionnaire</xs:documentation>\n          <xs:documentation xml:lang=\"es\">RespuestaAlCuestionario</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">调查问卷答复</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"RelatedPerson\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">RelatedPerson</xs:documentation>\n          <xs:documentation xml:lang=\"en\">RelatedPerson</xs:documentation>\n          <xs:documentation xml:lang=\"it\">PersonaCorrelata</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">PersonneEnRelation</xs:documentation>\n          <xs:documentation xml:lang=\"es\">PersonaRelacionada</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">相关人员</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"RequestGroup\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">RequestGroup</xs:documentation>\n          <xs:documentation xml:lang=\"en\">RequestGroup</xs:documentation>\n          <xs:documentation xml:lang=\"it\">GruppoDiRichieste</xs:documentation>\n          <xs:documentation xml:lang=\"es\">GrupoDeSolicitudes</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">请求分组</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ResearchDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ResearchDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ResearchDefinition</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ResearchElementDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ResearchElementDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ResearchElementDefinition</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ResearchStudy\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ResearchStudy</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ResearchStudy</xs:documentation>\n          <xs:documentation xml:lang=\"es\">EstudioDeInvestigacion</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">调查研究</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ResearchSubject\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ResearchSubject</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ResearchSubject</xs:documentation>\n          <xs:documentation xml:lang=\"es\">SujetoDeInvestigacion</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">研究主题</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Resource\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Resource</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Resource</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Recurso</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">资源</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"RiskAssessment\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">RiskAssessment</xs:documentation>\n          <xs:documentation xml:lang=\"en\">RiskAssessment</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">ÉvaluationRisques</xs:documentation>\n          <xs:documentation xml:lang=\"es\">EvaluacionDeRiesgo</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">风险评估</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"RiskEvidenceSynthesis\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">RiskEvidenceSynthesis</xs:documentation>\n          <xs:documentation xml:lang=\"en\">RiskEvidenceSynthesis</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Schedule\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Schedule</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Schedule</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Agenda</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">日程安排</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SearchParameter\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SearchParameter</xs:documentation>\n          <xs:documentation xml:lang=\"en\">SearchParameter</xs:documentation>\n          <xs:documentation xml:lang=\"it\">ParametroDiRicerca</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">ParamètreRecherche</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ParametroDeBusqueda</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">搜索参数</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ServiceRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ServiceRequest</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ServiceRequest</xs:documentation>\n          <xs:documentation xml:lang=\"it\">RichiestaDiServizio</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">DemandeService</xs:documentation>\n          <xs:documentation xml:lang=\"es\">PeticiónServicio</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">服务项目请求</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Slot\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Slot</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Slot</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Slot</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">槽位</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Hueco / Zocalo / Espacio</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Specimen\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Specimen</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Specimen</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Campione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Spécimen</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">标本</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Especimen</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SpecimenDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SpecimenDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">SpecimenDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"it\">DefinizioneCampione</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DefinicionDeEspecimen</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">标本定义</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"StructureDefinition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">StructureDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"en\">StructureDefinition</xs:documentation>\n          <xs:documentation xml:lang=\"it\">DefinizioneStruttura</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">DéfinitionStructure</xs:documentation>\n          <xs:documentation xml:lang=\"es\">DefinicionDeEstructura</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">结构定义</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"StructureMap\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">StructureMap</xs:documentation>\n          <xs:documentation xml:lang=\"en\">StructureMap</xs:documentation>\n          <xs:documentation xml:lang=\"es\">MapaDeEstructura</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">结构映射</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Subscription\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Subscription</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Subscription</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Sottoscrizione</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Souscription</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">订阅</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Suscripción</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Substance\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Substance</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Substance</xs:documentation>\n          <xs:documentation xml:lang=\"it\">Sostanza</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Substance</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">物质</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Sustancia</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SubstanceNucleicAcid\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SubstanceNucleicAcid</xs:documentation>\n          <xs:documentation xml:lang=\"en\">SubstanceNucleicAcid</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SubstancePolymer\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SubstancePolymer</xs:documentation>\n          <xs:documentation xml:lang=\"en\">SubstancePolymer</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SubstanceProtein\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SubstanceProtein</xs:documentation>\n          <xs:documentation xml:lang=\"en\">SubstanceProtein</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SubstanceReferenceInformation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SubstanceReferenceInformation</xs:documentation>\n          <xs:documentation xml:lang=\"en\">SubstanceReferenceInformation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SubstanceSourceMaterial\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SubstanceSourceMaterial</xs:documentation>\n          <xs:documentation xml:lang=\"en\">SubstanceSourceMaterial</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SubstanceSpecification\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SubstanceSpecification</xs:documentation>\n          <xs:documentation xml:lang=\"en\">SubstanceSpecification</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SupplyDelivery\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SupplyDelivery</xs:documentation>\n          <xs:documentation xml:lang=\"en\">SupplyDelivery</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Supply Livraison</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">供应交付</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Entrega de Suministro</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SupplyRequest\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SupplyRequest</xs:documentation>\n          <xs:documentation xml:lang=\"en\">SupplyRequest</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">Demande d'approvisionnement</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">供应请求</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Solicitud de Suministro</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Task\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Task</xs:documentation>\n          <xs:documentation xml:lang=\"en\">Task</xs:documentation>\n          <xs:documentation xml:lang=\"es\">Tarea</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">任务</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"TerminologyCapabilities\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">TerminologyCapabilities</xs:documentation>\n          <xs:documentation xml:lang=\"en\">TerminologyCapabilities</xs:documentation>\n          <xs:documentation xml:lang=\"es\">CapacidadTerminologica</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">术语服务能力</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"TestReport\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">TestReport</xs:documentation>\n          <xs:documentation xml:lang=\"en\">TestReport</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">RapportTest</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ReporteDePrueba</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">测试报告</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"TestScript\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">TestScript</xs:documentation>\n          <xs:documentation xml:lang=\"en\">TestScript</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">ScriptTest</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ScriptDePrueba</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">测试脚本</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ValueSet\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ValueSet</xs:documentation>\n          <xs:documentation xml:lang=\"en\">ValueSet</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">EnsembleValeurs</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">取值集合</xs:documentation>\n          <xs:documentation xml:lang=\"es\">ConjuntoValores / ConjuntoDeValores</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"VerificationResult\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">VerificationResult</xs:documentation>\n          <xs:documentation xml:lang=\"en\">VerificationResult</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"VisionPrescription\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">VisionPrescription</xs:documentation>\n          <xs:documentation xml:lang=\"en\">VisionPrescription</xs:documentation>\n          <xs:documentation xml:lang=\"fr\">PrescriptionVision</xs:documentation>\n          <xs:documentation xml:lang=\"es\">PrescripcionDeVision</xs:documentation>\n          <xs:documentation xml:lang=\"zh\">视力处方</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ResourceType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of resource.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ResourceType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/explanationofbenefit.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ExplanationOfBenefit\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ExplanationOfBenefit</sch:title>\n    <sch:rule context=\"f:ExplanationOfBenefit\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:billablePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:enterer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:enterer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:enterer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:insurer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:insurer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:insurer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:related/f:claim\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:related/f:claim/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:related/f:claim/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:related/f:reference/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:related/f:reference/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:prescription\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:prescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:prescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:originalPrescription\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:originalPrescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:originalPrescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:payee/f:party\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:payee/f:party/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:payee/f:party/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:referral\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:referral/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:referral/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:facility\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:facility/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:facility/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:claim\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:claim/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:claim/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:claimResponse\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:claimResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:claimResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:preAuthRefPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:careTeam/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:careTeam/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:careTeam/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:supportingInfo/f:timingPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:supportingInfo/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:supportingInfo/f:valueAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:supportingInfo/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:supportingInfo/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:supportingInfo/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:diagnosis/f:diagnosisReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:diagnosis/f:diagnosisReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:diagnosis/f:diagnosisReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:procedure/f:procedureReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:procedure/f:procedureReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:procedure/f:procedureReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:procedure/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:procedure/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:procedure/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:insurance/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:insurance/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:insurance/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:accident/f:locationAddress/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:accident/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:accident/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:accident/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:servicedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:locationAddress/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:subDetail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:subDetail/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:subDetail/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:subDetail/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:servicedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:locationAddress/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:detail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:detail/f:subDetail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:payment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:payment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:form\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:benefitPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/explanationofbenefit.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ExplanationOfBenefit\" type=\"ExplanationOfBenefit\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ExplanationOfBenefit\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this explanation of benefit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ExplanationOfBenefitStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The category of claim, e.g. oral, pharmacy, vision, institutional, professional.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"use\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Use\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to indicate whether the nature of the request is: to request adjudication of products and services previously rendered; or requesting authorization and adjudication for provision in the future; or requesting the non-binding adjudication of the listed products and services which could be provided in the future.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for forecast reimbursement is sought.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"billablePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period for which charges are being submitted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date this resource was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"enterer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Individual who created the claim, predetermination or preauthorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurer\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party responsible for authorization, adjudication and reimbursement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provider\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The provider which is responsible for the claim, predetermination or preauthorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The provider-required urgency of processing the request. Typical values include: stat, routine deferred.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fundsReserveRequested\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to indicate whether and for whom funds are to be reserved for future claims.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fundsReserve\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"related\" type=\"ExplanationOfBenefit.Related\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Other claims which are related to this claim such as prior submissions or claims for related services or for the same event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"prescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Prescription to support the dispensing of pharmacy, device or vision products.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"originalPrescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Original prescription which has been superseded by this prescription to support the dispensing of pharmacy services, medications or products.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payee\" type=\"ExplanationOfBenefit.Payee\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party to be reimbursed for cost of the products and services according to the terms of the policy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referral\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a referral resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"facility\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Facility where the services were provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"claim\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The business identifier for the instance of the adjudication request: claim predetermination or preauthorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"claimResponse\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The business identifier for the instance of the adjudication response: claim, predetermination or preauthorization response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ClaimProcessingCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The outcome of the claim, predetermination, or preauthorization processing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"disposition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human readable description of the status of the adjudication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preAuthRef\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference from the Insurer which is used in later communications which refers to this adjudication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preAuthRefPeriod\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The timeframe during which the supplied preauthorization reference may be quoted on claims to obtain the adjudication as provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"careTeam\" type=\"ExplanationOfBenefit.CareTeam\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The members of the team who provided the products and services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInfo\" type=\"ExplanationOfBenefit.SupportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"diagnosis\" type=\"ExplanationOfBenefit.Diagnosis\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about diagnoses relevant to the claim items.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"procedure\" type=\"ExplanationOfBenefit.Procedure\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Procedures performed on the patient relevant to the billing items with the claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"precedence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This indicates the relative order of a series of EOBs related to different coverages for the same suite of services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurance\" type=\"ExplanationOfBenefit.Insurance\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Financial instruments for reimbursement for the health care products and services specified on the claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"accident\" type=\"ExplanationOfBenefit.Accident\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details of a accident which resulted in injuries which required the products and services listed in the claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" type=\"ExplanationOfBenefit.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"addItem\" type=\"ExplanationOfBenefit.AddItem\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The first-tier service adjudications for payor added product or service lines.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The adjudication results which are presented at the header level rather than at the line-item or add-item levels.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"total\" type=\"ExplanationOfBenefit.Total\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Categorized monetary totals for the adjudication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payment\" type=\"ExplanationOfBenefit.Payment\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Payment details for the adjudication of the claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"formCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code for the form to be used for printing the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"form\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual form, by reference or inclusion, for printing the content or an EOB.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"processNote\" type=\"ExplanationOfBenefit.ProcessNote\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A note that describes or explains adjudication results in a human readable form.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"benefitPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The term of the benefits documented in this response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"benefitBalance\" type=\"ExplanationOfBenefit.BenefitBalance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Balance by Benefit Category.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Related\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"claim\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to a related claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to convey how the claims are related.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An alternate organizational reference to the case or file to which this particular claim pertains.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Payee\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of Party to be reimbursed: Subscriber, provider, other.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"party\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the individual or organization to whom any payment will be made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.CareTeam\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify care team entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provider\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Member of the team who provided the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"responsible\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party who is billing and/or responsible for the claimed products or services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The lead, assisting or supervising practitioner and their discipline if a multidisciplinary team.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"qualification\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The qualification of the practitioner which is applicable for this service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.SupportingInfo\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify supporting information entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The general class of the information supplied: information; exception; accident, employment; onset, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient  for which care is sought.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when or period to which this information refers.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"timingDate\" type=\"date\"/>\n            <xs:element name=\"timingPeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides the reason in the situation where a reason code is required in addition to the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Diagnosis\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify diagnosis entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The nature of illness or problem in a coded form or as a reference to an external defined Condition.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"diagnosisCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"diagnosisReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the condition was observed or the relative ranking.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"onAdmission\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indication of whether the diagnosis was present on admission to a facility.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"packageCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Procedure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify procedure entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the condition was observed or the relative ranking.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date and optionally time the procedure was performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code or reference to a Procedure resource which identifies the clinical intervention performed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"procedureCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"procedureReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Insurance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"focal\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"coverage\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preAuthRef\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference numbers previously provided by the insurer to the provider to be quoted on subsequent claims containing services or products related to the prior authorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Accident\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date of an accident event  related to the products and services contained in the claim.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type or context of the accident event for the purposes of selection of potential insurance coverages and determination of coordination between insurers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The physical location of the accident event.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"locationAddress\" type=\"Address\"/>\n            <xs:element name=\"locationReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Item\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify item entries.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"careTeamSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Care team members related to this service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"diagnosisSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Diagnoses applicable for this service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"procedureSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Procedures applicable for this service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"informationSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Exceptions, special conditions and supporting information applicable for this service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"revenue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of revenue or cost center providing the product and/or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date or dates when the service or product was supplied, performed or completed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"servicedDate\" type=\"date\"/>\n            <xs:element name=\"servicedPeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where the product or service was provided.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"locationCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"locationAddress\" type=\"Address\"/>\n            <xs:element name=\"locationReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Physical service site on the patient (limb, tooth, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subSite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A region or surface of the bodySite, e.g. limb region or tooth surface(s).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A billed item may include goods or services provided in multiple encounters.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" type=\"ExplanationOfBenefit.Detail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Second-tier of goods and services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Adjudication\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in-aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code supporting the understanding of the adjudication result and explaining variance from expected amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Monetary amount associated with the category.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A non-monetary value associated with the category. Mutually exclusive to the amount element above.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Detail\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"revenue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of revenue or cost center providing the product and/or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subDetail\" type=\"ExplanationOfBenefit.SubDetail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Third-tier of goods and services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.SubDetail\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"revenue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of revenue or cost center providing the product and/or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.AddItem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"itemSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Claim items which this service line is intended to replace.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detailSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The sequence number of the details within the claim item which this line is intended to replace.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subDetailSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The sequence number of the sub-details woithin the details within the claim item which this line is intended to replace.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The providers who are authorized for the services rendered to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date or dates when the service or product was supplied, performed or completed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"servicedDate\" type=\"date\"/>\n            <xs:element name=\"servicedPeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where the product or service was provided.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"locationCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"locationAddress\" type=\"Address\"/>\n            <xs:element name=\"locationReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Physical service site on the patient (limb, tooth, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subSite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A region or surface of the bodySite, e.g. limb region or tooth surface(s).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" type=\"ExplanationOfBenefit.Detail1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The second-tier service adjudications for payor added services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Detail1\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subDetail\" type=\"ExplanationOfBenefit.SubDetail1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The third-tier service adjudications for payor added services.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.SubDetail1\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Total\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Monetary total amount associated with the category.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Payment\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this represents partial or complete payment of the benefits payable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjustment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"adjustmentReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reason for the payment adjustment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Estimated date the payment will be issued or the actual issue date of payment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Benefits payable less any payment adjustment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Issuer's unique identifier for the payment instrument.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.ProcessNote\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"number\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify a note entry.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"NoteType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The business purpose of the note text.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The explanation or description associated with the processing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to define the language used in the text of the note.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.BenefitBalance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"excluded\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">True if the indicated class of service is excluded from the plan, missing or False indicates the product or service is included in the coverage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short name or tag for the benefit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A richer description of the benefit or services covered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates if the benefits apply to an individual or to the family.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"term\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"financial\" type=\"ExplanationOfBenefit.Financial\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Benefits Used to date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ExplanationOfBenefit.Financial\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Classification of benefit being provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity of the benefit which is permitted under the coverage.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"allowedUnsignedInt\" type=\"unsignedInt\"/>\n            <xs:element name=\"allowedString\" type=\"string\"/>\n            <xs:element name=\"allowedMoney\" type=\"Money\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity of the benefit which have been consumed to date.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"usedUnsignedInt\" type=\"unsignedInt\"/>\n            <xs:element name=\"usedMoney\" type=\"Money\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ExplanationOfBenefitStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"draft\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered In Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ExplanationOfBenefitStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A code specifying the state of the resource instance.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ExplanationOfBenefitStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/familymemberhistory.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource FamilyMemberHistory\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>FamilyMemberHistory</sch:title>\n    <sch:rule context=\"f:FamilyMemberHistory\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"exists(*[starts-with(local-name(.), 'age')]) or not(exists(f:estimatedAge))\">fhs-2: Can only have estimatedAge if age[x] is present</sch:assert>\n      <sch:assert test=\"not (*[starts-with(local-name(.), 'age')] and *[starts-with(local-name(.), 'birth')])\">fhs-1: Can have age[x] or born[x], but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:bornPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:ageAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:ageRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:ageRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:ageRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:deceasedAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:deceasedRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:deceasedRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:deceasedRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:onsetAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:onsetRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:onsetRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:onsetRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:onsetPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/familymemberhistory.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"FamilyMemberHistory\" type=\"FamilyMemberHistory\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Significant health conditions for a person related to the patient relevant in the context of care for the patient.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"FamilyMemberHistory\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Significant health conditions for a person related to the patient relevant in the context of care for the patient.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this family member history by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FamilyHistoryStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code specifying the status of the record of the family history of a specific family member.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dataAbsentReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes why the family member's history is not available.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person who this history concerns.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date (and possibly time) when the family member history was recorded or last updated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This will either be a name or a description; e.g. &quot;Aunt Susan&quot;, &quot;my cousin with the red hair&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relationship\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of relationship this person has to the patient (father, mother, brother etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sex\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The birth sex of the family member.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual or approximate date of birth of the relative.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"bornPeriod\" type=\"Period\"/>\n            <xs:element name=\"bornDate\" type=\"date\"/>\n            <xs:element name=\"bornString\" type=\"string\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The age of the relative at the time the family member history is recorded.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"ageAge\" type=\"Age\"/>\n            <xs:element name=\"ageRange\" type=\"Range\"/>\n            <xs:element name=\"ageString\" type=\"string\"/>\n          </xs:choice>\n          <xs:element name=\"estimatedAge\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If true, indicates that the age value specified is an estimated value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"deceasedBoolean\" type=\"boolean\"/>\n            <xs:element name=\"deceasedAge\" type=\"Age\"/>\n            <xs:element name=\"deceasedRange\" type=\"Range\"/>\n            <xs:element name=\"deceasedDate\" type=\"date\"/>\n            <xs:element name=\"deceasedString\" type=\"string\"/>\n          </xs:choice>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes why the family member history occurred in coded or textual form.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"condition\" type=\"FamilyMemberHistory.Condition\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"FamilyMemberHistory.Condition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Significant health conditions for a person related to the patient relevant in the context of care for the patient.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates what happened following the condition.  If the condition resulted in death, deceased date is captured on the relation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contributedToDeath\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This condition contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"onsetAge\" type=\"Age\"/>\n            <xs:element name=\"onsetRange\" type=\"Range\"/>\n            <xs:element name=\"onsetPeriod\" type=\"Period\"/>\n            <xs:element name=\"onsetString\" type=\"string\"/>\n          </xs:choice>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An area where general notes can be placed about this specific condition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"FamilyHistoryStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"partial\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Partial</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"health-unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Health Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"FamilyHistoryStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A code that identifies the status of the family history record.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"FamilyHistoryStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/fhir-all.xsd",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\nCopyright (c) 2011+, HL7, Inc\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without modification, \n are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this \n list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice, \n this list of conditions and the following disclaimer in the documentation \n and/or other materials provided with the distribution.\n * Neither the name of HL7 nor the names of its contributors may be used to \n endorse or promote products derived from this software without specific \n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n POSSIBILITY OF SUCH DAMAGE.\n\n Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1\n-->\n<xs:schema xmlns=\"http://hl7.org/fhir\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"4.0.1\">\n  <xs:include schemaLocation=\"account.xsd\"/>\n  <xs:include schemaLocation=\"activitydefinition.xsd\"/>\n  <xs:include schemaLocation=\"adverseevent.xsd\"/>\n  <xs:include schemaLocation=\"allergyintolerance.xsd\"/>\n  <xs:include schemaLocation=\"appointment.xsd\"/>\n  <xs:include schemaLocation=\"appointmentresponse.xsd\"/>\n  <xs:include schemaLocation=\"auditevent.xsd\"/>\n  <xs:include schemaLocation=\"basic.xsd\"/>\n  <xs:include schemaLocation=\"binary.xsd\"/>\n  <xs:include schemaLocation=\"biologicallyderivedproduct.xsd\"/>\n  <xs:include schemaLocation=\"bodystructure.xsd\"/>\n  <xs:include schemaLocation=\"bundle.xsd\"/>\n  <xs:include schemaLocation=\"capabilitystatement.xsd\"/>\n  <xs:include schemaLocation=\"careplan.xsd\"/>\n  <xs:include schemaLocation=\"careteam.xsd\"/>\n  <xs:include schemaLocation=\"catalogentry.xsd\"/>\n  <xs:include schemaLocation=\"chargeitem.xsd\"/>\n  <xs:include schemaLocation=\"chargeitemdefinition.xsd\"/>\n  <xs:include schemaLocation=\"claim.xsd\"/>\n  <xs:include schemaLocation=\"claimresponse.xsd\"/>\n  <xs:include schemaLocation=\"clinicalimpression.xsd\"/>\n  <xs:include schemaLocation=\"codesystem.xsd\"/>\n  <xs:include schemaLocation=\"communication.xsd\"/>\n  <xs:include schemaLocation=\"communicationrequest.xsd\"/>\n  <xs:include schemaLocation=\"compartmentdefinition.xsd\"/>\n  <xs:include schemaLocation=\"composition.xsd\"/>\n  <xs:include schemaLocation=\"conceptmap.xsd\"/>\n  <xs:include schemaLocation=\"condition.xsd\"/>\n  <xs:include schemaLocation=\"consent.xsd\"/>\n  <xs:include schemaLocation=\"contract.xsd\"/>\n  <xs:include schemaLocation=\"coverage.xsd\"/>\n  <xs:include schemaLocation=\"coverageeligibilityrequest.xsd\"/>\n  <xs:include schemaLocation=\"coverageeligibilityresponse.xsd\"/>\n  <xs:include schemaLocation=\"detectedissue.xsd\"/>\n  <xs:include schemaLocation=\"device.xsd\"/>\n  <xs:include schemaLocation=\"devicedefinition.xsd\"/>\n  <xs:include schemaLocation=\"devicemetric.xsd\"/>\n  <xs:include schemaLocation=\"devicerequest.xsd\"/>\n  <xs:include schemaLocation=\"deviceusestatement.xsd\"/>\n  <xs:include schemaLocation=\"diagnosticreport.xsd\"/>\n  <xs:include schemaLocation=\"documentmanifest.xsd\"/>\n  <xs:include schemaLocation=\"documentreference.xsd\"/>\n  <xs:include schemaLocation=\"effectevidencesynthesis.xsd\"/>\n  <xs:include schemaLocation=\"encounter.xsd\"/>\n  <xs:include schemaLocation=\"endpoint.xsd\"/>\n  <xs:include schemaLocation=\"enrollmentrequest.xsd\"/>\n  <xs:include schemaLocation=\"enrollmentresponse.xsd\"/>\n  <xs:include schemaLocation=\"episodeofcare.xsd\"/>\n  <xs:include schemaLocation=\"eventdefinition.xsd\"/>\n  <xs:include schemaLocation=\"evidence.xsd\"/>\n  <xs:include schemaLocation=\"evidencevariable.xsd\"/>\n  <xs:include schemaLocation=\"examplescenario.xsd\"/>\n  <xs:include schemaLocation=\"explanationofbenefit.xsd\"/>\n  <xs:include schemaLocation=\"familymemberhistory.xsd\"/>\n  <xs:include schemaLocation=\"flag.xsd\"/>\n  <xs:include schemaLocation=\"goal.xsd\"/>\n  <xs:include schemaLocation=\"graphdefinition.xsd\"/>\n  <xs:include schemaLocation=\"group.xsd\"/>\n  <xs:include schemaLocation=\"guidanceresponse.xsd\"/>\n  <xs:include schemaLocation=\"healthcareservice.xsd\"/>\n  <xs:include schemaLocation=\"imagingstudy.xsd\"/>\n  <xs:include schemaLocation=\"immunization.xsd\"/>\n  <xs:include schemaLocation=\"immunizationevaluation.xsd\"/>\n  <xs:include schemaLocation=\"immunizationrecommendation.xsd\"/>\n  <xs:include schemaLocation=\"implementationguide.xsd\"/>\n  <xs:include schemaLocation=\"insuranceplan.xsd\"/>\n  <xs:include schemaLocation=\"invoice.xsd\"/>\n  <xs:include schemaLocation=\"library.xsd\"/>\n  <xs:include schemaLocation=\"linkage.xsd\"/>\n  <xs:include schemaLocation=\"list.xsd\"/>\n  <xs:include schemaLocation=\"location.xsd\"/>\n  <xs:include schemaLocation=\"measure.xsd\"/>\n  <xs:include schemaLocation=\"measurereport.xsd\"/>\n  <xs:include schemaLocation=\"media.xsd\"/>\n  <xs:include schemaLocation=\"medication.xsd\"/>\n  <xs:include schemaLocation=\"medicationadministration.xsd\"/>\n  <xs:include schemaLocation=\"medicationdispense.xsd\"/>\n  <xs:include schemaLocation=\"medicationknowledge.xsd\"/>\n  <xs:include schemaLocation=\"medicationrequest.xsd\"/>\n  <xs:include schemaLocation=\"medicationstatement.xsd\"/>\n  <xs:include schemaLocation=\"medicinalproduct.xsd\"/>\n  <xs:include schemaLocation=\"medicinalproductauthorization.xsd\"/>\n  <xs:include schemaLocation=\"medicinalproductcontraindication.xsd\"/>\n  <xs:include schemaLocation=\"medicinalproductindication.xsd\"/>\n  <xs:include schemaLocation=\"medicinalproductingredient.xsd\"/>\n  <xs:include schemaLocation=\"medicinalproductinteraction.xsd\"/>\n  <xs:include schemaLocation=\"medicinalproductmanufactured.xsd\"/>\n  <xs:include schemaLocation=\"medicinalproductpackaged.xsd\"/>\n  <xs:include schemaLocation=\"medicinalproductpharmaceutical.xsd\"/>\n  <xs:include schemaLocation=\"medicinalproductundesirableeffect.xsd\"/>\n  <xs:include schemaLocation=\"messagedefinition.xsd\"/>\n  <xs:include schemaLocation=\"messageheader.xsd\"/>\n  <xs:include schemaLocation=\"molecularsequence.xsd\"/>\n  <xs:include schemaLocation=\"namingsystem.xsd\"/>\n  <xs:include schemaLocation=\"nutritionorder.xsd\"/>\n  <xs:include schemaLocation=\"observation.xsd\"/>\n  <xs:include schemaLocation=\"observationdefinition.xsd\"/>\n  <xs:include schemaLocation=\"operationdefinition.xsd\"/>\n  <xs:include schemaLocation=\"operationoutcome.xsd\"/>\n  <xs:include schemaLocation=\"organization.xsd\"/>\n  <xs:include schemaLocation=\"organizationaffiliation.xsd\"/>\n  <xs:include schemaLocation=\"parameters.xsd\"/>\n  <xs:include schemaLocation=\"patient.xsd\"/>\n  <xs:include schemaLocation=\"paymentnotice.xsd\"/>\n  <xs:include schemaLocation=\"paymentreconciliation.xsd\"/>\n  <xs:include schemaLocation=\"person.xsd\"/>\n  <xs:include schemaLocation=\"plandefinition.xsd\"/>\n  <xs:include schemaLocation=\"practitioner.xsd\"/>\n  <xs:include schemaLocation=\"practitionerrole.xsd\"/>\n  <xs:include schemaLocation=\"procedure.xsd\"/>\n  <xs:include schemaLocation=\"provenance.xsd\"/>\n  <xs:include schemaLocation=\"questionnaire.xsd\"/>\n  <xs:include schemaLocation=\"questionnaireresponse.xsd\"/>\n  <xs:include schemaLocation=\"relatedperson.xsd\"/>\n  <xs:include schemaLocation=\"requestgroup.xsd\"/>\n  <xs:include schemaLocation=\"researchdefinition.xsd\"/>\n  <xs:include schemaLocation=\"researchelementdefinition.xsd\"/>\n  <xs:include schemaLocation=\"researchstudy.xsd\"/>\n  <xs:include schemaLocation=\"researchsubject.xsd\"/>\n  <xs:include schemaLocation=\"riskassessment.xsd\"/>\n  <xs:include schemaLocation=\"riskevidencesynthesis.xsd\"/>\n  <xs:include schemaLocation=\"schedule.xsd\"/>\n  <xs:include schemaLocation=\"searchparameter.xsd\"/>\n  <xs:include schemaLocation=\"servicerequest.xsd\"/>\n  <xs:include schemaLocation=\"slot.xsd\"/>\n  <xs:include schemaLocation=\"specimen.xsd\"/>\n  <xs:include schemaLocation=\"specimendefinition.xsd\"/>\n  <xs:include schemaLocation=\"structuredefinition.xsd\"/>\n  <xs:include schemaLocation=\"structuremap.xsd\"/>\n  <xs:include schemaLocation=\"subscription.xsd\"/>\n  <xs:include schemaLocation=\"substance.xsd\"/>\n  <xs:include schemaLocation=\"substancenucleicacid.xsd\"/>\n  <xs:include schemaLocation=\"substancepolymer.xsd\"/>\n  <xs:include schemaLocation=\"substanceprotein.xsd\"/>\n  <xs:include schemaLocation=\"substancereferenceinformation.xsd\"/>\n  <xs:include schemaLocation=\"substancesourcematerial.xsd\"/>\n  <xs:include schemaLocation=\"substancespecification.xsd\"/>\n  <xs:include schemaLocation=\"supplydelivery.xsd\"/>\n  <xs:include schemaLocation=\"supplyrequest.xsd\"/>\n  <xs:include schemaLocation=\"task.xsd\"/>\n  <xs:include schemaLocation=\"terminologycapabilities.xsd\"/>\n  <xs:include schemaLocation=\"testreport.xsd\"/>\n  <xs:include schemaLocation=\"testscript.xsd\"/>\n  <xs:include schemaLocation=\"valueset.xsd\"/>\n  <xs:include schemaLocation=\"verificationresult.xsd\"/>\n  <xs:include schemaLocation=\"visionprescription.xsd\"/>\n\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/fhir-base.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:import namespace=\"http://www.w3.org/XML/1998/namespace\" schemaLocation=\"xml.xsd\"/>\n  <xs:import namespace=\"http://www.w3.org/1999/xhtml\" schemaLocation=\"fhir-xhtml.xsd\"/>\n  <xs:include schemaLocation=\"fhir-all.xsd\"/>\n\n  <xs:simpleType name=\"date-primitive\">\n    <xs:restriction>\n      <xs:simpleType>\n        <xs:union memberTypes=\"xs:gYear xs:gYearMonth xs:date\"/>\n      </xs:simpleType>\n      <xs:pattern value=\"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1]))?)?\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"date\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date.  Dates SHALL be valid dates.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"date-primitive\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"dateTime-primitive\">\n    <xs:restriction>\n      <xs:simpleType>\n        <xs:union memberTypes=\"xs:gYear xs:gYearMonth xs:date xs:dateTime\"/>\n      </xs:simpleType>\n      <xs:pattern value=\"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"dateTime\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored.                 Dates SHALL be valid dates.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"dateTime-primitive\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"code-primitive\">\n    <xs:restriction base=\"xs:token\">\n      <xs:minLength value=\"1\"/>\n      <xs:pattern value=\"[^\\s]+(\\s[^\\s]+)*\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"code\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"code-primitive\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"string-primitive\">\n    <xs:restriction base=\"xs:string\">\n      <xs:minLength value=\"1\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"string\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A sequence of Unicode characters</xs:documentation>\n      <xs:documentation xml:lang=\"en\">Note that FHIR strings SHALL NOT exceed 1MB in size</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"string-primitive\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"integer-primitive\">\n    <xs:restriction base=\"xs:int\">\n      <xs:pattern value=\"-?([0]|([1-9][0-9]*))\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"integer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A whole number</xs:documentation>\n      <xs:documentation xml:lang=\"en\">32 bit number; for values larger than this, use decimal</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"integer-primitive\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"oid-primitive\">\n    <xs:restriction base=\"xs:anyURI\">\n      <xs:pattern value=\"urn:oid:[0-2](\\.(0|[1-9][0-9]*))+\"/>\n      <xs:minLength value=\"1\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"oid\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An OID represented as a URI</xs:documentation>\n      <xs:documentation xml:lang=\"en\">RFC 3001. See also ISO/IEC 8824:1990 €</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"oid-primitive\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"canonical-primitive\">\n    <xs:restriction base=\"xs:anyURI\">\n      <xs:pattern value=\"\\S*\"/>\n      <xs:minLength value=\"1\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"canonical\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A URI that is a reference to a canonical URL on a FHIR resource</xs:documentation>\n      <xs:documentation xml:lang=\"en\">see [Canonical References](references.html#canonical)</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"canonical-primitive\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"uri-primitive\">\n    <xs:restriction base=\"xs:anyURI\">\n      <xs:pattern value=\"\\S*\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"uri\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">String of characters used to identify a name or a resource</xs:documentation>\n      <xs:documentation xml:lang=\"en\">see http://en.wikipedia.org/wiki/Uniform_resource_identifier</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"uri-primitive\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"uuid-primitive\">\n    <xs:restriction base=\"xs:anyURI\">\n      <xs:pattern value=\"urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\"/>\n      <xs:minLength value=\"1\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"uuid\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A UUID, represented as a URI</xs:documentation>\n      <xs:documentation xml:lang=\"en\">See The Open Group, CDE 1.1 Remote Procedure Call specification, Appendix A.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"uuid-primitive\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"url-primitive\">\n    <xs:restriction base=\"xs:anyURI\">\n      <xs:pattern value=\"\\S*\"/>\n      <xs:minLength value=\"1\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"url\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A URI that is a literal reference</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"url-primitive\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"instant-primitive\">\n    <xs:restriction base=\"xs:dateTime\">\n      <xs:pattern value=\"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"instant\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An instant in time - known at least to the second</xs:documentation>\n      <xs:documentation xml:lang=\"en\">Note: This is intended for where precisely observed times are required, typically system logs etc., and not human-reported times - for them, see date and dateTime (which can be as precise as instant, but is not required to be) below. Time zone is always required</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"instant-primitive\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"boolean-primitive\">\n    <xs:restriction base=\"xs:boolean\">\n      <xs:pattern value=\"true|false\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"boolean\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Value of &quot;true&quot; or &quot;false&quot;</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"boolean-primitive\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"base64Binary-primitive\">\n    <xs:restriction base=\"xs:base64Binary\">\n      <xs:pattern value=\"(\\s*([0-9a-zA-Z\\+/=]){4}\\s*)+\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"base64Binary\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A stream of bytes</xs:documentation>\n      <xs:documentation xml:lang=\"en\">A stream of bytes, base64 encoded</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"base64Binary-primitive\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"unsignedInt-primitive\">\n    <xs:restriction base=\"xs:nonNegativeInteger\">\n      <xs:pattern value=\"[0]|([1-9][0-9]*)\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"unsignedInt\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An integer with a value that is not negative (e.g. &gt;= 0)</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"unsignedInt-primitive\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"markdown-primitive\">\n    <xs:restriction base=\"xs:string\">\n      <xs:minLength value=\"1\"/>\n      <xs:pattern value=\"[ \\r\\n\\t\\S]+\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"markdown\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A string that may contain Github Flavored Markdown syntax for optional processing by a mark down presentation engine</xs:documentation>\n      <xs:documentation xml:lang=\"en\">Systems are not required to have markdown support, so the text should be readable without markdown processing. The markdown syntax is GFM - see https://github.github.com/gfm/</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"markdown-primitive\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"time-primitive\">\n    <xs:restriction base=\"xs:time\">\n      <xs:pattern value=\"([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"time\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A time during the day, with no date specified</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"time-primitive\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"id-primitive\">\n    <xs:restriction base=\"xs:string\">\n      <xs:pattern value=\"[A-Za-z0-9\\-\\.]{1,64}\"/>\n      <xs:minLength value=\"1\"/>\n      <xs:maxLength value=\"64\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"id\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Any combination of letters, numerals, &quot;-&quot; and &quot;.&quot;, with a length limit of 64 characters.  (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.)  Ids are case-insensitive.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">RFC 4122</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"id-primitive\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"positiveInt-primitive\">\n    <xs:restriction base=\"xs:positiveInteger\">\n      <xs:pattern value=\"[1-9][0-9]*\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"positiveInt\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An integer with a value that is positive (e.g. &gt;0)</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"positiveInt-primitive\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"decimal-primitive\">\n    <xs:union memberTypes=\"xs:decimal xs:double\"/>\n  </xs:simpleType>\n  <xs:complexType name=\"decimal\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A rational number with implicit precision</xs:documentation>\n      <xs:documentation xml:lang=\"en\">Do not use an IEEE type floating point type, instead use something that works like a true decimal, with inbuilt precision (e.g. Java BigInteger)</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"decimal-primitive\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n\n  <xs:complexType name=\"ResourceContainer\">\n    <xs:choice>\n      <xs:element ref=\"Account\"/>\n      <xs:element ref=\"ActivityDefinition\"/>\n      <xs:element ref=\"AdverseEvent\"/>\n      <xs:element ref=\"AllergyIntolerance\"/>\n      <xs:element ref=\"Appointment\"/>\n      <xs:element ref=\"AppointmentResponse\"/>\n      <xs:element ref=\"AuditEvent\"/>\n      <xs:element ref=\"Basic\"/>\n      <xs:element ref=\"Binary\"/>\n      <xs:element ref=\"BiologicallyDerivedProduct\"/>\n      <xs:element ref=\"BodyStructure\"/>\n      <xs:element ref=\"Bundle\"/>\n      <xs:element ref=\"CapabilityStatement\"/>\n      <xs:element ref=\"CarePlan\"/>\n      <xs:element ref=\"CareTeam\"/>\n      <xs:element ref=\"CatalogEntry\"/>\n      <xs:element ref=\"ChargeItem\"/>\n      <xs:element ref=\"ChargeItemDefinition\"/>\n      <xs:element ref=\"Claim\"/>\n      <xs:element ref=\"ClaimResponse\"/>\n      <xs:element ref=\"ClinicalImpression\"/>\n      <xs:element ref=\"CodeSystem\"/>\n      <xs:element ref=\"Communication\"/>\n      <xs:element ref=\"CommunicationRequest\"/>\n      <xs:element ref=\"CompartmentDefinition\"/>\n      <xs:element ref=\"Composition\"/>\n      <xs:element ref=\"ConceptMap\"/>\n      <xs:element ref=\"Condition\"/>\n      <xs:element ref=\"Consent\"/>\n      <xs:element ref=\"Contract\"/>\n      <xs:element ref=\"Coverage\"/>\n      <xs:element ref=\"CoverageEligibilityRequest\"/>\n      <xs:element ref=\"CoverageEligibilityResponse\"/>\n      <xs:element ref=\"DetectedIssue\"/>\n      <xs:element ref=\"Device\"/>\n      <xs:element ref=\"DeviceDefinition\"/>\n      <xs:element ref=\"DeviceMetric\"/>\n      <xs:element ref=\"DeviceRequest\"/>\n      <xs:element ref=\"DeviceUseStatement\"/>\n      <xs:element ref=\"DiagnosticReport\"/>\n      <xs:element ref=\"DocumentManifest\"/>\n      <xs:element ref=\"DocumentReference\"/>\n      <xs:element ref=\"EffectEvidenceSynthesis\"/>\n      <xs:element ref=\"Encounter\"/>\n      <xs:element ref=\"Endpoint\"/>\n      <xs:element ref=\"EnrollmentRequest\"/>\n      <xs:element ref=\"EnrollmentResponse\"/>\n      <xs:element ref=\"EpisodeOfCare\"/>\n      <xs:element ref=\"EventDefinition\"/>\n      <xs:element ref=\"Evidence\"/>\n      <xs:element ref=\"EvidenceVariable\"/>\n      <xs:element ref=\"ExampleScenario\"/>\n      <xs:element ref=\"ExplanationOfBenefit\"/>\n      <xs:element ref=\"FamilyMemberHistory\"/>\n      <xs:element ref=\"Flag\"/>\n      <xs:element ref=\"Goal\"/>\n      <xs:element ref=\"GraphDefinition\"/>\n      <xs:element ref=\"Group\"/>\n      <xs:element ref=\"GuidanceResponse\"/>\n      <xs:element ref=\"HealthcareService\"/>\n      <xs:element ref=\"ImagingStudy\"/>\n      <xs:element ref=\"Immunization\"/>\n      <xs:element ref=\"ImmunizationEvaluation\"/>\n      <xs:element ref=\"ImmunizationRecommendation\"/>\n      <xs:element ref=\"ImplementationGuide\"/>\n      <xs:element ref=\"InsurancePlan\"/>\n      <xs:element ref=\"Invoice\"/>\n      <xs:element ref=\"Library\"/>\n      <xs:element ref=\"Linkage\"/>\n      <xs:element ref=\"List\"/>\n      <xs:element ref=\"Location\"/>\n      <xs:element ref=\"Measure\"/>\n      <xs:element ref=\"MeasureReport\"/>\n      <xs:element ref=\"Media\"/>\n      <xs:element ref=\"Medication\"/>\n      <xs:element ref=\"MedicationAdministration\"/>\n      <xs:element ref=\"MedicationDispense\"/>\n      <xs:element ref=\"MedicationKnowledge\"/>\n      <xs:element ref=\"MedicationRequest\"/>\n      <xs:element ref=\"MedicationStatement\"/>\n      <xs:element ref=\"MedicinalProduct\"/>\n      <xs:element ref=\"MedicinalProductAuthorization\"/>\n      <xs:element ref=\"MedicinalProductContraindication\"/>\n      <xs:element ref=\"MedicinalProductIndication\"/>\n      <xs:element ref=\"MedicinalProductIngredient\"/>\n      <xs:element ref=\"MedicinalProductInteraction\"/>\n      <xs:element ref=\"MedicinalProductManufactured\"/>\n      <xs:element ref=\"MedicinalProductPackaged\"/>\n      <xs:element ref=\"MedicinalProductPharmaceutical\"/>\n      <xs:element ref=\"MedicinalProductUndesirableEffect\"/>\n      <xs:element ref=\"MessageDefinition\"/>\n      <xs:element ref=\"MessageHeader\"/>\n      <xs:element ref=\"MolecularSequence\"/>\n      <xs:element ref=\"NamingSystem\"/>\n      <xs:element ref=\"NutritionOrder\"/>\n      <xs:element ref=\"Observation\"/>\n      <xs:element ref=\"ObservationDefinition\"/>\n      <xs:element ref=\"OperationDefinition\"/>\n      <xs:element ref=\"OperationOutcome\"/>\n      <xs:element ref=\"Organization\"/>\n      <xs:element ref=\"OrganizationAffiliation\"/>\n      <xs:element ref=\"Patient\"/>\n      <xs:element ref=\"PaymentNotice\"/>\n      <xs:element ref=\"PaymentReconciliation\"/>\n      <xs:element ref=\"Person\"/>\n      <xs:element ref=\"PlanDefinition\"/>\n      <xs:element ref=\"Practitioner\"/>\n      <xs:element ref=\"PractitionerRole\"/>\n      <xs:element ref=\"Procedure\"/>\n      <xs:element ref=\"Provenance\"/>\n      <xs:element ref=\"Questionnaire\"/>\n      <xs:element ref=\"QuestionnaireResponse\"/>\n      <xs:element ref=\"RelatedPerson\"/>\n      <xs:element ref=\"RequestGroup\"/>\n      <xs:element ref=\"ResearchDefinition\"/>\n      <xs:element ref=\"ResearchElementDefinition\"/>\n      <xs:element ref=\"ResearchStudy\"/>\n      <xs:element ref=\"ResearchSubject\"/>\n      <xs:element ref=\"RiskAssessment\"/>\n      <xs:element ref=\"RiskEvidenceSynthesis\"/>\n      <xs:element ref=\"Schedule\"/>\n      <xs:element ref=\"SearchParameter\"/>\n      <xs:element ref=\"ServiceRequest\"/>\n      <xs:element ref=\"Slot\"/>\n      <xs:element ref=\"Specimen\"/>\n      <xs:element ref=\"SpecimenDefinition\"/>\n      <xs:element ref=\"StructureDefinition\"/>\n      <xs:element ref=\"StructureMap\"/>\n      <xs:element ref=\"Subscription\"/>\n      <xs:element ref=\"Substance\"/>\n      <xs:element ref=\"SubstanceNucleicAcid\"/>\n      <xs:element ref=\"SubstancePolymer\"/>\n      <xs:element ref=\"SubstanceProtein\"/>\n      <xs:element ref=\"SubstanceReferenceInformation\"/>\n      <xs:element ref=\"SubstanceSourceMaterial\"/>\n      <xs:element ref=\"SubstanceSpecification\"/>\n      <xs:element ref=\"SupplyDelivery\"/>\n      <xs:element ref=\"SupplyRequest\"/>\n      <xs:element ref=\"Task\"/>\n      <xs:element ref=\"TerminologyCapabilities\"/>\n      <xs:element ref=\"TestReport\"/>\n      <xs:element ref=\"TestScript\"/>\n      <xs:element ref=\"ValueSet\"/>\n      <xs:element ref=\"VerificationResult\"/>\n      <xs:element ref=\"VisionPrescription\"/>\n      <xs:element ref=\"Parameters\"/>\n    </xs:choice>\n  </xs:complexType>\n  <xs:complexType name=\"Extension\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Optional Extension Element - found in all resources.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n        <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n           <xs:annotation>\n             <xs:documentation xml:lang=\"en\">Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).</xs:documentation>\n           </xs:annotation>\n           <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\n           <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n           <xs:element name=\"valueCanonical\" type=\"canonical\"/>\n           <xs:element name=\"valueCode\" type=\"code\"/>\n           <xs:element name=\"valueDate\" type=\"date\"/>\n           <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\n           <xs:element name=\"valueDecimal\" type=\"decimal\"/>\n           <xs:element name=\"valueId\" type=\"id\"/>\n           <xs:element name=\"valueInstant\" type=\"instant\"/>\n           <xs:element name=\"valueInteger\" type=\"integer\"/>\n           <xs:element name=\"valueMarkdown\" type=\"markdown\"/>\n           <xs:element name=\"valueOid\" type=\"oid\"/>\n           <xs:element name=\"valuePositiveInt\" type=\"positiveInt\"/>\n           <xs:element name=\"valueString\" type=\"string\"/>\n           <xs:element name=\"valueTime\" type=\"time\"/>\n           <xs:element name=\"valueUnsignedInt\" type=\"unsignedInt\"/>\n           <xs:element name=\"valueUri\" type=\"uri\"/>\n           <xs:element name=\"valueUrl\" type=\"url\"/>\n           <xs:element name=\"valueUuid\" type=\"uuid\"/>\n           <xs:element name=\"valueAddress\" type=\"Address\"/>\n           <xs:element name=\"valueAge\" type=\"Age\"/>\n           <xs:element name=\"valueAnnotation\" type=\"Annotation\"/>\n           <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\n           <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\n           <xs:element name=\"valueCoding\" type=\"Coding\"/>\n           <xs:element name=\"valueContactPoint\" type=\"ContactPoint\"/>\n           <xs:element name=\"valueCount\" type=\"Count\"/>\n           <xs:element name=\"valueDistance\" type=\"Distance\"/>\n           <xs:element name=\"valueDuration\" type=\"Duration\"/>\n           <xs:element name=\"valueHumanName\" type=\"HumanName\"/>\n           <xs:element name=\"valueIdentifier\" type=\"Identifier\"/>\n           <xs:element name=\"valueMoney\" type=\"Money\"/>\n           <xs:element name=\"valuePeriod\" type=\"Period\"/>\n           <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n           <xs:element name=\"valueRange\" type=\"Range\"/>\n           <xs:element name=\"valueRatio\" type=\"Ratio\"/>\n           <xs:element name=\"valueReference\" type=\"Reference\"/>\n           <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\n           <xs:element name=\"valueSignature\" type=\"Signature\"/>\n           <xs:element name=\"valueTiming\" type=\"Timing\"/>\n           <xs:element name=\"valueContactDetail\" type=\"ContactDetail\"/>\n           <xs:element name=\"valueContributor\" type=\"Contributor\"/>\n           <xs:element name=\"valueDataRequirement\" type=\"DataRequirement\"/>\n           <xs:element name=\"valueExpression\" type=\"Expression\"/>\n           <xs:element name=\"valueParameterDefinition\" type=\"ParameterDefinition\"/>\n           <xs:element name=\"valueRelatedArtifact\" type=\"RelatedArtifact\"/>\n           <xs:element name=\"valueTriggerDefinition\" type=\"TriggerDefinition\"/>\n           <xs:element name=\"valueUsageContext\" type=\"UsageContext\"/>\n           <xs:element name=\"valueDosage\" type=\"Dosage\"/>\n           <xs:element name=\"valueMeta\" type=\"Meta\"/>\n         </xs:choice>\n        </xs:sequence>\n        <xs:attribute name=\"url\" type=\"uri-primitive\" use=\"required\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"BackboneElement\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Base definition for all elements that are defined inside a resource - but not those in a data type.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"modifierExtension\" type=\"Extension\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Narrative\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A human-readable summary of the resource conveying the essential clinical and business information for the resource.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"status\" type=\"NarrativeStatus\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element ref=\"xhtml:div\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual narrative content, a stripped down version of XHTML.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"NarrativeStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"generated\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Generated</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"extensions\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Extensions</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"additional\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Additional</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"empty\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Empty</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"NarrativeStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The status of a resource narrative.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"NarrativeStatus-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Element\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Base definition for all elements in a resource.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n        <xs:sequence>\n          <xs:element name=\"extension\" type=\"Extension\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n        <xs:attribute name=\"id\" type=\"string-primitive\" use=\"optional\"/>\n  </xs:complexType>\n  <xs:complexType name=\"Meta\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"versionId\" type=\"id\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastUpdated\" type=\"instant\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the resource last changed - e.g. when the version changed.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"security\" type=\"Coding\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"tag\" type=\"Coding\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Address\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An address expressed using postal conventions (as opposed to GPS or other location definition formats).  This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery.  There are a variety of postal address formats defined around the world.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"use\" type=\"AddressUse\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The purpose of this address.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" type=\"AddressType\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the entire address as it should be displayed e.g. on a postal label. This may be provided instead of or as well as the specific parts.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"line\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This component contains the house number, apartment number, street name, street direction,  P.O. Box number, delivery hints, and similar address information.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"city\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the city, town, suburb, village or other community or delivery center.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"district\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the administrative area (county).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"state\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"postalCode\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A postal code designating a region defined by the postal service.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"country\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Country - a nation as commonly understood or generally accepted.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" type=\"Period\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time period when address was/is in use.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AddressUse-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"home\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Home</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"work\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Work</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"temp\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Temporary</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"old\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Old / Incorrect</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"billing\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Billing</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AddressUse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The use of an address.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"AddressUse-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AddressType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"postal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Postal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"physical\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Physical</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"both\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Postal &amp; Physical</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AddressType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of an address (physical / postal).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"AddressType-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Contributor\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"type\" type=\"ContributorType\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of contributor.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the individual or organization responsible for the contribution.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" type=\"ContactDetail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the contributor.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ContributorType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"author\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Author</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"editor\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Editor</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"reviewer\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Reviewer</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"endorser\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Endorser</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ContributorType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of contributor.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"ContributorType-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Attachment\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">For referring to data content defined in other formats.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"contentType\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"language\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The human language of the content. The value can be any valid value according to BCP 47.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"data\" type=\"base64Binary\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual data of the attachment - a sequence of bytes, base64 encoded.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"url\" type=\"url\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A location where the data can be accessed.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"size\" type=\"unsignedInt\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of bytes of data that make up this attachment (before base64 encoding, if that is done).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"hash\" type=\"base64Binary\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The calculated hash of the data using SHA-1. Represented using base64.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A label or set of text to display in place of the data.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"creation\" type=\"dateTime\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date that the attachment was first created.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Count\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Quantity\">\n        <xs:sequence>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DataRequirement\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"type\" type=\"code\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The profile of the required data, specified as the uri of the profile definition.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The intended subjects of the data requirement. If this element is not provided, a Patient subject is assumed.</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"  maxOccurs=\"1\"/>\n           <xs:element name=\"subjectReference\" type=\"Reference\"  maxOccurs=\"1\"/>\n          </xs:choice>\n          <xs:element name=\"mustSupport\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available. \n\nThe value of mustSupport SHALL be a FHIRPath resolveable on the type of the DataRequirement. The path SHALL consist only of identifiers, constant indexers, and .resolve() (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"codeFilter\" type=\"DataRequirement.CodeFilter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data. Each code filter defines an additional constraint on the data, i.e. code filters are AND'ed, not OR'ed.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dateFilter\" type=\"DataRequirement.DateFilter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date filters specify additional constraints on the data in terms of the applicable date range for specific elements. Each date filter specifies an additional constraint on the data, i.e. date filters are AND'ed, not OR'ed.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"limit\" type=\"positiveInt\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies a maximum number of results that are required (uses the _count search parameter).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sort\" type=\"DataRequirement.Sort\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the order of the results to be returned.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DataRequirement.CodeFilter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"path\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code-valued attribute of the filter. The specified path SHALL be a FHIRPath resolveable on the specified type of the DataRequirement, and SHALL consist only of identifiers, constant indexers, and .resolve(). The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"searchParam\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A token parameter that refers to a search parameter defined on the specified type of the DataRequirement, and which searches on elements of type code, Coding, or CodeableConcept.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"valueSet\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The valueset for the code filter. The valueSet and code elements are additive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" type=\"Coding\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The codes for the code filter. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes. If codes are specified in addition to a value set, the filter returns items matching a code in the value set or one of the specified codes.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DataRequirement.DateFilter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"path\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date-valued attribute of the filter. The specified path SHALL be a FHIRPath resolveable on the specified type of the DataRequirement, and SHALL consist only of identifiers, constant indexers, and .resolve(). The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Note that the index must be an integer constant. The path must resolve to an element of type date, dateTime, Period, Schedule, or Timing.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"searchParam\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A date parameter that refers to a search parameter defined on the specified type of the DataRequirement, and which searches on elements of type date, dateTime, Period, Schedule, or Timing.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime. If a Duration is specified, the filter will return only those data items that fall within Duration before now.</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"valueDateTime\" type=\"dateTime\"  maxOccurs=\"1\"/>\n           <xs:element name=\"valuePeriod\" type=\"Period\"  maxOccurs=\"1\"/>\n           <xs:element name=\"valueDuration\" type=\"Duration\"  maxOccurs=\"1\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DataRequirement.Sort\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"path\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The attribute of the sort. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"direction\" type=\"SortDirection\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The direction of the sort, ascending or descending.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SortDirection-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"ascending\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Ascending</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"descending\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Descending</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SortDirection\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The possible sort directions, ascending or descending.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"SortDirection-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Dosage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates how the medication is/was taken or should be taken by the patient.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" type=\"integer\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the order in which the dosage instructions should be applied or interpreted.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Free text dosage instructions e.g. SIG.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"additionalInstruction\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Supplemental instructions to the patient on how to take the medication  (e.g. &quot;with meals&quot; or&quot;take half to one hour before food&quot;) or warnings for the patient about the medication (e.g. &quot;may cause drowsiness&quot; or &quot;avoid exposure of skin to direct sunlight or sunlamps&quot;).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patientInstruction\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Instructions in terms that are understood by the patient or consumer.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"timing\" type=\"Timing\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When medication should be administered.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"asNeededBoolean\" type=\"boolean\"  maxOccurs=\"1\"/>\n           <xs:element name=\"asNeededCodeableConcept\" type=\"CodeableConcept\"  maxOccurs=\"1\"/>\n          </xs:choice>\n          <xs:element name=\"site\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Body site to administer to.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"route\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How drug should enter body.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"method\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Technique for administering medication.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"doseAndRate\" type=\"Dosage.DoseAndRate\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount of medication administered.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maxDosePerPeriod\" type=\"Ratio\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Upper limit on medication per unit of time.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maxDosePerAdministration\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Upper limit on medication per administration.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maxDosePerLifetime\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Upper limit on medication per lifetime of the patient.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Dosage.DoseAndRate\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates how the medication is/was taken or should be taken by the patient.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of dose or rate specified, for example, ordered or calculated.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Amount of medication per dose.</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"doseRange\" type=\"Range\"  maxOccurs=\"1\"/>\n           <xs:element name=\"doseQuantity\" type=\"Quantity\"  maxOccurs=\"1\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Amount of medication per unit of time.</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"rateRatio\" type=\"Ratio\"  maxOccurs=\"1\"/>\n           <xs:element name=\"rateRange\" type=\"Range\"  maxOccurs=\"1\"/>\n           <xs:element name=\"rateQuantity\" type=\"Quantity\"  maxOccurs=\"1\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Money\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An amount of economic utility in some recognized currency.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"value\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Numerical value (with implicit precision).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"currency\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">ISO 4217 Currency Code.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"HumanName\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A human's name with the ability to identify parts and usage.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"use\" type=\"NameUse\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the purpose for this name.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the entire name as it should be displayed e.g. on an application UI. This may be provided instead of or as well as the specific parts.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"family\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"given\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Given name.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"prefix\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"suffix\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" type=\"Period\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the period of time when this name was valid for the named person.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"NameUse-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"usual\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Usual</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"official\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Official</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"temp\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Temp</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"nickname\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Nickname</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"anonymous\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Anonymous</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"old\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Old</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"maiden\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Name changed for Marriage</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"NameUse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The use of a human name.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"NameUse-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ContactPoint\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"system\" type=\"ContactPointSystem\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Telecommunications form for contact point - what communications system is required to make use of the contact.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"use\" type=\"ContactPointUse\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the purpose for the contact point.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rank\" type=\"positiveInt\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies a preferred order in which to use a set of contacts. ContactPoints with lower rank values are more preferred than those with higher rank values.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" type=\"Period\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time period when the contact point was/is in use.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ContactPointSystem-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"phone\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Phone</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"fax\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Fax</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"email\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Email</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"pager\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Pager</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"url\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">URL</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"sms\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SMS</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"other\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Other</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ContactPointSystem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Telecommunications form for contact point.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"ContactPointSystem-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ContactPointUse-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"home\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Home</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"work\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Work</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"temp\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Temp</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"old\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Old</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"mobile\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Mobile</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ContactPointUse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Use of contact point.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"ContactPointUse-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MarketingStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"country\" type=\"CodeableConcept\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The country in which the marketing authorisation has been granted shall be specified It should be specified using the ISO 3166 ‑ 1 alpha-2 code elements.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where a Medicines Regulatory Agency has granted a marketing authorisation for which specific provisions within a jurisdiction apply, the jurisdiction can be specified using an appropriate controlled terminology The controlled term and the controlled term identifier shall be specified.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" type=\"CodeableConcept\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This attribute provides information on the status of the marketing of the medicinal product See ISO/TS 20443 for more information and examples.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dateRange\" type=\"Period\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when the Medicinal Product is placed on the market by the Marketing Authorisation Holder (or where applicable, the manufacturer/distributor) in a country and/or jurisdiction shall be provided A complete date consisting of day, month and year shall be specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"restoreDate\" type=\"dateTime\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when the Medicinal Product is placed on the market by the Marketing Authorisation Holder (or where applicable, the manufacturer/distributor) in a country and/or jurisdiction shall be provided A complete date consisting of day, month and year shall be specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Identifier\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"use\" type=\"IdentifierUse\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The purpose of this identifier.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"system\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Establishes the namespace for the value - that is, a URL that describes a set values that are unique.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The portion of the identifier typically relevant to the user and which is unique within the context of the system.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" type=\"Period\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time period during which identifier is/was valid for use.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"assigner\" type=\"Reference\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Organization that issued/manages the identifier.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"IdentifierUse-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"usual\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Usual</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"official\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Official</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"temp\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Temp</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"secondary\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Secondary</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"old\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Old</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"IdentifierUse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Identifies the purpose for this identifier, if known .</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"IdentifierUse-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceAmount\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Chemical substances are a single substance type whose primary defining element is the molecular structure. Chemical substances shall be defined on the basis of their complete covalent molecular structure; the presence of a salt (counter-ion) and/or solvates (water, alcohols) is also captured. Purity, grade, physical form or particle size are not taken into account in the definition of a chemical substance or in the assignment of a Substance ID.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field.</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"amountQuantity\" type=\"Quantity\"  maxOccurs=\"1\"/>\n           <xs:element name=\"amountRange\" type=\"Range\"  maxOccurs=\"1\"/>\n           <xs:element name=\"amountString\" type=\"string\"  maxOccurs=\"1\"/>\n          </xs:choice>\n          <xs:element name=\"amountType\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Most elements that require a quantitative value will also have a field called amount type. Amount type should always be specified because the actual value of the amount is often dependent on it. EXAMPLE: In capturing the actual relative amounts of substances or molecular fragments it is essential to indicate whether the amount refers to a mole ratio or weight ratio. For any given element an effort should be made to use same the amount type for all related definitional elements.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amountText\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A textual comment on a numeric value.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referenceRange\" type=\"SubstanceAmount.ReferenceRange\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference range of possible or expected values.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceAmount.ReferenceRange\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Chemical substances are a single substance type whose primary defining element is the molecular structure. Chemical substances shall be defined on the basis of their complete covalent molecular structure; the presence of a salt (counter-ion) and/or solvates (water, alcohols) is also captured. Purity, grade, physical form or particle size are not taken into account in the definition of a chemical substance or in the assignment of a Substance ID.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"lowLimit\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Lower limit possible or expected.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"highLimit\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Upper limit possible or expected.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Coding\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A reference to a code defined by a terminology system.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"system\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identification of the code system that defines the meaning of the symbol in the code.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"display\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A representation of the meaning of the code in the system, following the rules of the system.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"userSelected\" type=\"boolean\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SampledData\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"origin\" type=\"Quantity\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" type=\"decimal\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The length of time between sampling times, measured in milliseconds.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A correction factor that is applied to the sampled data points before they are added to the origin.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lowerLimit\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The lower limit of detection of the measured points. This is needed if any of the data points have the value &quot;L&quot; (lower than detection limit).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"upperLimit\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The upper limit of detection of the measured points. This is needed if any of the data points have the value &quot;U&quot; (higher than detection limit).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dimensions\" type=\"positiveInt\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"data\" type=\"SampledDataDataType\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A series of data points which are decimal values separated by a single space (character u20). The special values &quot;E&quot; (error), &quot;L&quot; (below detection limit) and &quot;U&quot; (above detection limit) can also be used in place of a decimal value.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SampledDataDataType-primitive\">\n     <xs:restriction base=\"xs:string\">\n      <xs:pattern value=\"((-{0,1}\\d*\\.{0,1}\\d+)|[EUL])( ((-{0,1}\\d*\\.{0,1}\\d+)|[EUL]))*\"/>\n    </xs:restriction>\n  </xs:simpleType>\n    <xs:complexType name=\"SampledDataDataType\">\n      <xs:complexContent>\n        <xs:extension base=\"Element\">\n          <xs:attribute name=\"value\" type=\"SampledDataDataType-primitive\" use=\"optional\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n\n  <xs:complexType name=\"Population\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A populatioof people with some set of grouping criteria.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The age of the specific population.</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"ageRange\" type=\"Range\"  maxOccurs=\"1\"/>\n           <xs:element name=\"ageCodeableConcept\" type=\"CodeableConcept\"  maxOccurs=\"1\"/>\n          </xs:choice>\n          <xs:element name=\"gender\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The gender of the specific population.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"race\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Race of the specific population.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"physiologicalCondition\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The existing physiological conditions of the specific population to which this applies.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Ratio\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A relationship of two Quantity values - expressed as a numerator and a denominator.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"numerator\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the numerator.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"denominator\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the denominator.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Distance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A length - a value with a unit that is a physical distance.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Quantity\">\n        <xs:sequence>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Age\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A duration of time during which an organism (or a process) has existed.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Quantity\">\n        <xs:sequence>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Reference\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A reference from one resource to another.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"reference\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The expected type of the target of the reference. If both Reference.type and Reference.reference are populated and Reference.reference is a FHIR URL, both SHALL be consistent.\n\nThe type is the Canonical URL of Resource Definition that is the type this reference refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/ e.g. &quot;Patient&quot; is a reference to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are only allowed for logical models (and can only be used in references in logical models, not resources).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" type=\"Identifier\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"display\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Plain text narrative that identifies the resource in addition to the resource reference.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TriggerDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"type\" type=\"TriggerType\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of triggering event.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal name for the event. This may be an absolute URI that identifies the event formally (e.g. from a trigger registry), or a simple relative URI that identifies the event in a local context.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The timing of the event (if this is a periodic trigger).</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"timingTiming\" type=\"Timing\"  maxOccurs=\"1\"/>\n           <xs:element name=\"timingReference\" type=\"Reference\"  maxOccurs=\"1\"/>\n           <xs:element name=\"timingDate\" type=\"date\"  maxOccurs=\"1\"/>\n           <xs:element name=\"timingDateTime\" type=\"dateTime\"  maxOccurs=\"1\"/>\n          </xs:choice>\n          <xs:element name=\"data\" type=\"DataRequirement\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The triggering data of the event (if this is a data trigger). If more than one data is requirement is specified, then all the data requirements must be true.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"condition\" type=\"Expression\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A boolean-valued expression that is evaluated in the context of the container of the trigger definition and returns whether or not the trigger fires.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"TriggerType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"named-event\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Named Event</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"periodic\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Periodic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"data-changed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Data Changed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"data-added\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Data Added</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"data-modified\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Data Updated</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"data-removed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Data Removed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"data-accessed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Data Accessed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"data-access-ended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Data Access Ended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"TriggerType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of trigger.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"TriggerType-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Quantity\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"value\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the measured amount. The value includes an implicit precision in the presentation of the value.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comparator\" type=\"QuantityComparator\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is &quot;&lt;&quot; , then the real value is &lt; stated value.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unit\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable form of the unit.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"system\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identification of the system that provides the coded form of the unit.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A computer processable form of the unit in some unit representation system.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"QuantityComparator-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"&lt;\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Less than</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"&lt;=\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Less or Equal to</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"&gt;=\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Greater or Equal to</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"&gt;\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Greater than</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"QuantityComparator\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How the Quantity should be understood and represented.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"QuantityComparator-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Period\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A time period defined by a start and end date and optionally time.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"start\" type=\"dateTime\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The start of the period. The boundary is inclusive.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"end\" type=\"dateTime\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Duration\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A length of time.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Quantity\">\n        <xs:sequence>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Range\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of ordered Quantities defined by a low and high limit.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"low\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The low limit. The boundary is inclusive.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"high\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The high limit. The boundary is inclusive.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"RelatedArtifact\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"type\" type=\"RelatedArtifactType\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of relationship to the related artifact.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"label\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"display\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"citation\" type=\"markdown\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"url\" type=\"url\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A url for the artifact that can be followed to access the actual content.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"document\" type=\"Attachment\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The document being referenced, represented as an attachment. This is exclusive with the resource element.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resource\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The related resource, such as a library, value set, profile, or other knowledge resource.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"RelatedArtifactType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"documentation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Documentation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"justification\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Justification</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"citation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Citation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"predecessor\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Predecessor</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"successor\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Successor</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"derived-from\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Derived From</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"depends-on\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Depends On</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"composed-of\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Composed Of</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"RelatedArtifactType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of relationship to the related artifact.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"RelatedArtifactType-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Annotation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A  text note which also  contains information about who made the statement and when.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual responsible for making the annotation.</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"authorReference\" type=\"Reference\"  maxOccurs=\"1\"/>\n           <xs:element name=\"authorString\" type=\"string\"  maxOccurs=\"1\"/>\n          </xs:choice>\n          <xs:element name=\"time\" type=\"dateTime\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates when this particular annotation was made.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" type=\"markdown\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The text of the annotation in markdown format.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ProductShelfLife\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The shelf-life and storage information for a medicinal product item or container can be described using this class.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" type=\"Identifier\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique identifier for the packaged Medicinal Product.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" type=\"CodeableConcept\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This describes the shelf life, taking into account various scenarios such as shelf life of the packaged Medicinal Product itself, shelf life after transformation where necessary and shelf life after the first opening of a bottle, etc. The shelf life type shall be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" type=\"Quantity\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The shelf life time period can be specified using a numerical value for the period of time and its unit of time measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialPrecautionsForStorage\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Special precautions for storage, if any, can be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ContactDetail\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Specifies contact information for a person or organization.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"name\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of an individual to contact.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" type=\"ContactPoint\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The contact details for the individual (if a name was provided) or the organization.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"UsageContext\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Specifies clinical/business/etc. metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"code\" type=\"Coding\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that identifies the type of context being specified by this usage context.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A value that defines the context specified in this context of use. The interpretation of the value is defined by the code.</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"  maxOccurs=\"1\"/>\n           <xs:element name=\"valueQuantity\" type=\"Quantity\"  maxOccurs=\"1\"/>\n           <xs:element name=\"valueRange\" type=\"Range\"  maxOccurs=\"1\"/>\n           <xs:element name=\"valueReference\" type=\"Reference\"  maxOccurs=\"1\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Expression\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"description\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A brief, natural language description of the condition that effectively communicates the intended semantics.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" type=\"id\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short name assigned to the expression to allow for multiple reuse of the expression in the context where it is defined.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"language\" type=\"ExpressionLanguage\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The media type of the language for the expression.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An expression in the specified language that returns a value.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reference\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A URI that defines where the expression is found.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ExpressionLanguage-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"text/cql\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CQL</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"text/fhirpath\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">FHIRPath</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"application/x-fhir-query\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">FHIR Query</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ExpressionLanguage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The media type of the expression language.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"ExpressionLanguage-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Signature\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A signature along with supporting context. The signature may be a digital signature that is cryptographic in nature, or some other signature acceptable to the domain. This other signature may be as simple as a graphical image representing a hand-written signature, or a signature ceremony Different signature approaches have different utilities.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"type\" type=\"Coding\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"when\" type=\"instant\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the digital signature was signed.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"who\" type=\"Reference\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to an application-usable description of the identity that signed  (e.g. the signature used their private key).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"onBehalfOf\" type=\"Reference\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to an application-usable description of the identity that is represented by the signature.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"targetFormat\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A mime type that indicates the technical format of the target resources signed by the signature.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sigFormat\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jose for JWS, and image/* for a graphical image of a signature, etc.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"data\" type=\"base64Binary\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Timing\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"event\" type=\"dateTime\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies specific times when the event occurs.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"repeat\" type=\"Timing.Repeat\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A set of rules that describe when the event is scheduled.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code for the timing schedule (or just text in code.text). Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing, with the exception that .repeat.bounds still applies over the code (and is not contained in the code).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Timing.Repeat\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"boundsDuration\" type=\"Duration\"  maxOccurs=\"1\"/>\n           <xs:element name=\"boundsRange\" type=\"Range\"  maxOccurs=\"1\"/>\n           <xs:element name=\"boundsPeriod\" type=\"Period\"  maxOccurs=\"1\"/>\n          </xs:choice>\n          <xs:element name=\"count\" type=\"positiveInt\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A total count of the desired number of repetitions across the duration of the entire timing specification. If countMax is present, this element indicates the lower bound of the allowed range of count values.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"countMax\" type=\"positiveInt\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If present, indicates that the count is a range - so to perform the action between [count] and [countMax] times.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"duration\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How long this thing happens for when it happens. If durationMax is present, this element indicates the lower bound of the allowed range of the duration.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"durationMax\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If present, indicates that the duration is a range - so to perform the action between [duration] and [durationMax] time length.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"durationUnit\" type=\"UnitsOfTime\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The units of time for the duration, in UCUM units.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"frequency\" type=\"positiveInt\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of times to repeat the action within the specified period. If frequencyMax is present, this element indicates the lower bound of the allowed range of the frequency.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"frequencyMax\" type=\"positiveInt\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If present, indicates that the frequency is a range - so to repeat between [frequency] and [frequencyMax] times within the period or period range.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the duration of time over which repetitions are to occur; e.g. to express &quot;3 times per day&quot;, 3 would be the frequency and &quot;1 day&quot; would be the period. If periodMax is present, this element indicates the lower bound of the allowed range of the period length.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"periodMax\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as &quot;do this once every 3-5 days.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"periodUnit\" type=\"UnitsOfTime\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The units of time for the period in UCUM units.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dayOfWeek\" type=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If one or more days of week is provided, then the action happens only on the specified day(s).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"timeOfDay\" type=\"time\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specified time of day for action to take place.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"when\" type=\"EventTiming\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An approximate time period during the day, potentially linked to an event of daily living that indicates when the action should occur.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"offset\" type=\"unsignedInt\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"UnitsOfTime-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"s\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">秒</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"min\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">分钟</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"h\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">小时</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"d\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">天</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"wk\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">星期</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"mo\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">月</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"a\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">年</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"UnitsOfTime\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A unit of time (units from UCUM).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"UnitsOfTime-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"EventTiming-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"MORN\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Morning</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MORN.early\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Early Morning</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MORN.late\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Late Morning</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NOON\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Noon</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AFT\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Afternoon</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AFT.early\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Early Afternoon</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AFT.late\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Late Afternoon</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EVE\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Evening</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EVE.early\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Early Evening</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EVE.late\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Late Evening</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NIGHT\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Night</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PHS\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">After Sleep</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"HS\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">HS</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"WAKE\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">WAKE</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"C\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">C</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CM\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CM</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CD\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CD</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CV\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CV</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AC\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">AC</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ACM\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ACM</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ACD\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ACD</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ACV\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ACV</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PC\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PC</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PCM\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PCM</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PCD\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PCD</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PCV\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PCV</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"EventTiming\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Real world event relating to the schedule.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"EventTiming-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ProdCharacteristic\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"height\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"width\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"depth\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"weight\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"nominalVolume\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"externalDiameter\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"shape\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"color\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"imprint\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where applicable, the imprint can be specified as text.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"image\" type=\"Attachment\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"scoring\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"CodeableConcept\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"coding\" type=\"Coding\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a code defined by a terminology system.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ParameterDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:sequence>\n          <xs:element name=\"name\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the parameter used to allow access to the value of the parameter in evaluation contexts.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"use\" type=\"code\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the parameter is input or output for the module.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"min\" type=\"integer\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The minimum number of times this parameter SHALL appear in the request or response.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"max\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum number of times this element is permitted to appear in the request or response.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A brief discussion of what the parameter is for and how it is used by the module.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" type=\"code\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the parameter.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ElementDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"path\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The path identifies the element and is expressed as a &quot;.&quot;-separated list of ancestor elements, beginning with the name of the resource or extension.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"representation\" type=\"PropertyRepresentation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Codes that define how this element is represented in instances, when the deviation varies from the normal case.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sliceName\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sliceIsConstraining\" type=\"boolean\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"label\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" type=\"Coding\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that has the same meaning as the element in a particular terminology.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"slicing\" type=\"ElementDefinition.Slicing\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"short\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A concise description of what this element means (e.g. for use in autogenerated summaries).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definition\" type=\"markdown\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides a complete explanation of the meaning of the data element for human readability.  For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. (Note: The text you are reading is specified in ElementDefinition.definition).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" type=\"markdown\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. (Note: The text you are reading is specified in ElementDefinition.comment).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requirements\" type=\"markdown\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"alias\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies additional names by which this element might also be known.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"min\" type=\"unsignedInt\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The minimum number of times this element SHALL appear in the instance.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"max\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum number of times this element is permitted to appear in the instance.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"base\" type=\"ElementDefinition.Base\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contentReference\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" type=\"ElementDefinition.Type\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The data type or resource that the value of this element is permitted to be.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n           <xs:annotation>\n             <xs:documentation xml:lang=\"en\">The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').</xs:documentation>\n           </xs:annotation>\n           <xs:element name=\"defaultValueBase64Binary\" type=\"base64Binary\"/>\n           <xs:element name=\"defaultValueBoolean\" type=\"boolean\"/>\n           <xs:element name=\"defaultValueCanonical\" type=\"canonical\"/>\n           <xs:element name=\"defaultValueCode\" type=\"code\"/>\n           <xs:element name=\"defaultValueDate\" type=\"date\"/>\n           <xs:element name=\"defaultValueDateTime\" type=\"dateTime\"/>\n           <xs:element name=\"defaultValueDecimal\" type=\"decimal\"/>\n           <xs:element name=\"defaultValueId\" type=\"id\"/>\n           <xs:element name=\"defaultValueInstant\" type=\"instant\"/>\n           <xs:element name=\"defaultValueInteger\" type=\"integer\"/>\n           <xs:element name=\"defaultValueMarkdown\" type=\"markdown\"/>\n           <xs:element name=\"defaultValueOid\" type=\"oid\"/>\n           <xs:element name=\"defaultValuePositiveInt\" type=\"positiveInt\"/>\n           <xs:element name=\"defaultValueString\" type=\"string\"/>\n           <xs:element name=\"defaultValueTime\" type=\"time\"/>\n           <xs:element name=\"defaultValueUnsignedInt\" type=\"unsignedInt\"/>\n           <xs:element name=\"defaultValueUri\" type=\"uri\"/>\n           <xs:element name=\"defaultValueUrl\" type=\"url\"/>\n           <xs:element name=\"defaultValueUuid\" type=\"uuid\"/>\n           <xs:element name=\"defaultValueAddress\" type=\"Address\"/>\n           <xs:element name=\"defaultValueAge\" type=\"Age\"/>\n           <xs:element name=\"defaultValueAnnotation\" type=\"Annotation\"/>\n           <xs:element name=\"defaultValueAttachment\" type=\"Attachment\"/>\n           <xs:element name=\"defaultValueCodeableConcept\" type=\"CodeableConcept\"/>\n           <xs:element name=\"defaultValueCoding\" type=\"Coding\"/>\n           <xs:element name=\"defaultValueContactPoint\" type=\"ContactPoint\"/>\n           <xs:element name=\"defaultValueCount\" type=\"Count\"/>\n           <xs:element name=\"defaultValueDistance\" type=\"Distance\"/>\n           <xs:element name=\"defaultValueDuration\" type=\"Duration\"/>\n           <xs:element name=\"defaultValueHumanName\" type=\"HumanName\"/>\n           <xs:element name=\"defaultValueIdentifier\" type=\"Identifier\"/>\n           <xs:element name=\"defaultValueMoney\" type=\"Money\"/>\n           <xs:element name=\"defaultValuePeriod\" type=\"Period\"/>\n           <xs:element name=\"defaultValueQuantity\" type=\"Quantity\"/>\n           <xs:element name=\"defaultValueRange\" type=\"Range\"/>\n           <xs:element name=\"defaultValueRatio\" type=\"Ratio\"/>\n           <xs:element name=\"defaultValueReference\" type=\"Reference\"/>\n           <xs:element name=\"defaultValueSampledData\" type=\"SampledData\"/>\n           <xs:element name=\"defaultValueSignature\" type=\"Signature\"/>\n           <xs:element name=\"defaultValueTiming\" type=\"Timing\"/>\n           <xs:element name=\"defaultValueContactDetail\" type=\"ContactDetail\"/>\n           <xs:element name=\"defaultValueContributor\" type=\"Contributor\"/>\n           <xs:element name=\"defaultValueDataRequirement\" type=\"DataRequirement\"/>\n           <xs:element name=\"defaultValueExpression\" type=\"Expression\"/>\n           <xs:element name=\"defaultValueParameterDefinition\" type=\"ParameterDefinition\"/>\n           <xs:element name=\"defaultValueRelatedArtifact\" type=\"RelatedArtifact\"/>\n           <xs:element name=\"defaultValueTriggerDefinition\" type=\"TriggerDefinition\"/>\n           <xs:element name=\"defaultValueUsageContext\" type=\"UsageContext\"/>\n           <xs:element name=\"defaultValueDosage\" type=\"Dosage\"/>\n           <xs:element name=\"defaultValueMeta\" type=\"Meta\"/>\n         </xs:choice>\n          <xs:element name=\"meaningWhenMissing\" type=\"markdown\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing').</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"orderMeaning\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If present, indicates that the order of the repeating element has meaning and describes what that meaning is.  If absent, it means that the order of the element has no meaning.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n           <xs:annotation>\n             <xs:documentation xml:lang=\"en\">Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.</xs:documentation>\n           </xs:annotation>\n           <xs:element name=\"fixedBase64Binary\" type=\"base64Binary\"/>\n           <xs:element name=\"fixedBoolean\" type=\"boolean\"/>\n           <xs:element name=\"fixedCanonical\" type=\"canonical\"/>\n           <xs:element name=\"fixedCode\" type=\"code\"/>\n           <xs:element name=\"fixedDate\" type=\"date\"/>\n           <xs:element name=\"fixedDateTime\" type=\"dateTime\"/>\n           <xs:element name=\"fixedDecimal\" type=\"decimal\"/>\n           <xs:element name=\"fixedId\" type=\"id\"/>\n           <xs:element name=\"fixedInstant\" type=\"instant\"/>\n           <xs:element name=\"fixedInteger\" type=\"integer\"/>\n           <xs:element name=\"fixedMarkdown\" type=\"markdown\"/>\n           <xs:element name=\"fixedOid\" type=\"oid\"/>\n           <xs:element name=\"fixedPositiveInt\" type=\"positiveInt\"/>\n           <xs:element name=\"fixedString\" type=\"string\"/>\n           <xs:element name=\"fixedTime\" type=\"time\"/>\n           <xs:element name=\"fixedUnsignedInt\" type=\"unsignedInt\"/>\n           <xs:element name=\"fixedUri\" type=\"uri\"/>\n           <xs:element name=\"fixedUrl\" type=\"url\"/>\n           <xs:element name=\"fixedUuid\" type=\"uuid\"/>\n           <xs:element name=\"fixedAddress\" type=\"Address\"/>\n           <xs:element name=\"fixedAge\" type=\"Age\"/>\n           <xs:element name=\"fixedAnnotation\" type=\"Annotation\"/>\n           <xs:element name=\"fixedAttachment\" type=\"Attachment\"/>\n           <xs:element name=\"fixedCodeableConcept\" type=\"CodeableConcept\"/>\n           <xs:element name=\"fixedCoding\" type=\"Coding\"/>\n           <xs:element name=\"fixedContactPoint\" type=\"ContactPoint\"/>\n           <xs:element name=\"fixedCount\" type=\"Count\"/>\n           <xs:element name=\"fixedDistance\" type=\"Distance\"/>\n           <xs:element name=\"fixedDuration\" type=\"Duration\"/>\n           <xs:element name=\"fixedHumanName\" type=\"HumanName\"/>\n           <xs:element name=\"fixedIdentifier\" type=\"Identifier\"/>\n           <xs:element name=\"fixedMoney\" type=\"Money\"/>\n           <xs:element name=\"fixedPeriod\" type=\"Period\"/>\n           <xs:element name=\"fixedQuantity\" type=\"Quantity\"/>\n           <xs:element name=\"fixedRange\" type=\"Range\"/>\n           <xs:element name=\"fixedRatio\" type=\"Ratio\"/>\n           <xs:element name=\"fixedReference\" type=\"Reference\"/>\n           <xs:element name=\"fixedSampledData\" type=\"SampledData\"/>\n           <xs:element name=\"fixedSignature\" type=\"Signature\"/>\n           <xs:element name=\"fixedTiming\" type=\"Timing\"/>\n           <xs:element name=\"fixedContactDetail\" type=\"ContactDetail\"/>\n           <xs:element name=\"fixedContributor\" type=\"Contributor\"/>\n           <xs:element name=\"fixedDataRequirement\" type=\"DataRequirement\"/>\n           <xs:element name=\"fixedExpression\" type=\"Expression\"/>\n           <xs:element name=\"fixedParameterDefinition\" type=\"ParameterDefinition\"/>\n           <xs:element name=\"fixedRelatedArtifact\" type=\"RelatedArtifact\"/>\n           <xs:element name=\"fixedTriggerDefinition\" type=\"TriggerDefinition\"/>\n           <xs:element name=\"fixedUsageContext\" type=\"UsageContext\"/>\n           <xs:element name=\"fixedDosage\" type=\"Dosage\"/>\n           <xs:element name=\"fixedMeta\" type=\"Meta\"/>\n         </xs:choice>\n        <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n           <xs:annotation>\n             <xs:documentation xml:lang=\"en\">Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  \n\nWhen pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.\n\nWhen pattern[x] is used to constrain an array, it means that each element provided in the pattern[x] array must (recursively) match at least one element from the instance array.\n\nWhen pattern[x] is used to constrain a complex object, it means that each property in the pattern must be present in the complex object, and its value must recursively match -- i.e.,\n\n1. If primitive: it must match exactly the pattern value\n2. If a complex object: it must match (recursively) the pattern value\n3. If an array: it must match (recursively) the pattern value.</xs:documentation>\n           </xs:annotation>\n           <xs:element name=\"patternBase64Binary\" type=\"base64Binary\"/>\n           <xs:element name=\"patternBoolean\" type=\"boolean\"/>\n           <xs:element name=\"patternCanonical\" type=\"canonical\"/>\n           <xs:element name=\"patternCode\" type=\"code\"/>\n           <xs:element name=\"patternDate\" type=\"date\"/>\n           <xs:element name=\"patternDateTime\" type=\"dateTime\"/>\n           <xs:element name=\"patternDecimal\" type=\"decimal\"/>\n           <xs:element name=\"patternId\" type=\"id\"/>\n           <xs:element name=\"patternInstant\" type=\"instant\"/>\n           <xs:element name=\"patternInteger\" type=\"integer\"/>\n           <xs:element name=\"patternMarkdown\" type=\"markdown\"/>\n           <xs:element name=\"patternOid\" type=\"oid\"/>\n           <xs:element name=\"patternPositiveInt\" type=\"positiveInt\"/>\n           <xs:element name=\"patternString\" type=\"string\"/>\n           <xs:element name=\"patternTime\" type=\"time\"/>\n           <xs:element name=\"patternUnsignedInt\" type=\"unsignedInt\"/>\n           <xs:element name=\"patternUri\" type=\"uri\"/>\n           <xs:element name=\"patternUrl\" type=\"url\"/>\n           <xs:element name=\"patternUuid\" type=\"uuid\"/>\n           <xs:element name=\"patternAddress\" type=\"Address\"/>\n           <xs:element name=\"patternAge\" type=\"Age\"/>\n           <xs:element name=\"patternAnnotation\" type=\"Annotation\"/>\n           <xs:element name=\"patternAttachment\" type=\"Attachment\"/>\n           <xs:element name=\"patternCodeableConcept\" type=\"CodeableConcept\"/>\n           <xs:element name=\"patternCoding\" type=\"Coding\"/>\n           <xs:element name=\"patternContactPoint\" type=\"ContactPoint\"/>\n           <xs:element name=\"patternCount\" type=\"Count\"/>\n           <xs:element name=\"patternDistance\" type=\"Distance\"/>\n           <xs:element name=\"patternDuration\" type=\"Duration\"/>\n           <xs:element name=\"patternHumanName\" type=\"HumanName\"/>\n           <xs:element name=\"patternIdentifier\" type=\"Identifier\"/>\n           <xs:element name=\"patternMoney\" type=\"Money\"/>\n           <xs:element name=\"patternPeriod\" type=\"Period\"/>\n           <xs:element name=\"patternQuantity\" type=\"Quantity\"/>\n           <xs:element name=\"patternRange\" type=\"Range\"/>\n           <xs:element name=\"patternRatio\" type=\"Ratio\"/>\n           <xs:element name=\"patternReference\" type=\"Reference\"/>\n           <xs:element name=\"patternSampledData\" type=\"SampledData\"/>\n           <xs:element name=\"patternSignature\" type=\"Signature\"/>\n           <xs:element name=\"patternTiming\" type=\"Timing\"/>\n           <xs:element name=\"patternContactDetail\" type=\"ContactDetail\"/>\n           <xs:element name=\"patternContributor\" type=\"Contributor\"/>\n           <xs:element name=\"patternDataRequirement\" type=\"DataRequirement\"/>\n           <xs:element name=\"patternExpression\" type=\"Expression\"/>\n           <xs:element name=\"patternParameterDefinition\" type=\"ParameterDefinition\"/>\n           <xs:element name=\"patternRelatedArtifact\" type=\"RelatedArtifact\"/>\n           <xs:element name=\"patternTriggerDefinition\" type=\"TriggerDefinition\"/>\n           <xs:element name=\"patternUsageContext\" type=\"UsageContext\"/>\n           <xs:element name=\"patternDosage\" type=\"Dosage\"/>\n           <xs:element name=\"patternMeta\" type=\"Meta\"/>\n         </xs:choice>\n          <xs:element name=\"example\" type=\"ElementDefinition.Example\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A sample value for this element demonstrating the type of information that would typically be found in the element.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"minValueDate\" type=\"date\"  maxOccurs=\"1\"/>\n           <xs:element name=\"minValueDateTime\" type=\"dateTime\"  maxOccurs=\"1\"/>\n           <xs:element name=\"minValueInstant\" type=\"instant\"  maxOccurs=\"1\"/>\n           <xs:element name=\"minValueTime\" type=\"time\"  maxOccurs=\"1\"/>\n           <xs:element name=\"minValueDecimal\" type=\"decimal\"  maxOccurs=\"1\"/>\n           <xs:element name=\"minValueInteger\" type=\"integer\"  maxOccurs=\"1\"/>\n           <xs:element name=\"minValuePositiveInt\" type=\"positiveInt\"  maxOccurs=\"1\"/>\n           <xs:element name=\"minValueUnsignedInt\" type=\"unsignedInt\"  maxOccurs=\"1\"/>\n           <xs:element name=\"minValueQuantity\" type=\"Quantity\"  maxOccurs=\"1\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.</xs:documentation>\n            </xs:annotation>\n           <xs:element name=\"maxValueDate\" type=\"date\"  maxOccurs=\"1\"/>\n           <xs:element name=\"maxValueDateTime\" type=\"dateTime\"  maxOccurs=\"1\"/>\n           <xs:element name=\"maxValueInstant\" type=\"instant\"  maxOccurs=\"1\"/>\n           <xs:element name=\"maxValueTime\" type=\"time\"  maxOccurs=\"1\"/>\n           <xs:element name=\"maxValueDecimal\" type=\"decimal\"  maxOccurs=\"1\"/>\n           <xs:element name=\"maxValueInteger\" type=\"integer\"  maxOccurs=\"1\"/>\n           <xs:element name=\"maxValuePositiveInt\" type=\"positiveInt\"  maxOccurs=\"1\"/>\n           <xs:element name=\"maxValueUnsignedInt\" type=\"unsignedInt\"  maxOccurs=\"1\"/>\n           <xs:element name=\"maxValueQuantity\" type=\"Quantity\"  maxOccurs=\"1\"/>\n          </xs:choice>\n          <xs:element name=\"maxLength\" type=\"integer\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"condition\" type=\"id\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to an invariant that may make additional statements about the cardinality or value in the instance.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"constraint\" type=\"ElementDefinition.Constraint\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"mustSupport\" type=\"boolean\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If true, implementations that produce or consume resources SHALL provide &quot;support&quot; for the element in some meaningful way.  If false, the element may be ignored and not supported. If false, whether to populate or use the data element in any way is at the discretion of the implementation.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"isModifier\" type=\"boolean\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"isModifierReason\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explains how that element affects the interpretation of the resource or element that contains it.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"isSummary\" type=\"boolean\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the element should be included if a client requests a search with the parameter _summary=true.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"binding\" type=\"ElementDefinition.Binding\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"mapping\" type=\"ElementDefinition.Mapping\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies a concept from an external specification that roughly corresponds to this element.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ElementDefinition.Constraint\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"key\" type=\"id\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requirements\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of why this constraint is necessary or appropriate.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"severity\" type=\"ConstraintSeverity\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the impact constraint violation has on the conformance of the instance.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"human\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Text that can be used to describe the constraint in messages identifying that the constraint has been violated.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"xpath\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An XPath expression of constraint that can be executed to see if this constraint is met.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the original source of the constraint, for traceability purposes.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ElementDefinition.Mapping\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identity\" type=\"id\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An internal reference to the definition of a mapping.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"language\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the computable language in which mapping.map is expressed.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"map\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Expresses what part of the target specification corresponds to this element.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments that provide information about the mapping or its use.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ElementDefinition.Base\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"path\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"min\" type=\"unsignedInt\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Minimum cardinality of the base element identified by the path.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"max\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Maximum cardinality of the base element identified by the path.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ElementDefinition.Type\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" type=\"uri\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. &quot;string&quot; is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"targetProfile\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used when the type is &quot;Reference&quot; or &quot;canonical&quot;, and identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"aggregation\" type=\"AggregationMode\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"versioning\" type=\"ReferenceVersionRules\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this reference needs to be version specific or version independent, or whether either can be used.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ElementDefinition.Example\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"label\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the purpose of this example amoung the set of examples.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        <xs:choice minOccurs=\"1\" maxOccurs=\"1\">\n           <xs:annotation>\n             <xs:documentation xml:lang=\"en\">The actual value for the element, which must be one of the types allowed for this element.</xs:documentation>\n           </xs:annotation>\n           <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\n           <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n           <xs:element name=\"valueCanonical\" type=\"canonical\"/>\n           <xs:element name=\"valueCode\" type=\"code\"/>\n           <xs:element name=\"valueDate\" type=\"date\"/>\n           <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\n           <xs:element name=\"valueDecimal\" type=\"decimal\"/>\n           <xs:element name=\"valueId\" type=\"id\"/>\n           <xs:element name=\"valueInstant\" type=\"instant\"/>\n           <xs:element name=\"valueInteger\" type=\"integer\"/>\n           <xs:element name=\"valueMarkdown\" type=\"markdown\"/>\n           <xs:element name=\"valueOid\" type=\"oid\"/>\n           <xs:element name=\"valuePositiveInt\" type=\"positiveInt\"/>\n           <xs:element name=\"valueString\" type=\"string\"/>\n           <xs:element name=\"valueTime\" type=\"time\"/>\n           <xs:element name=\"valueUnsignedInt\" type=\"unsignedInt\"/>\n           <xs:element name=\"valueUri\" type=\"uri\"/>\n           <xs:element name=\"valueUrl\" type=\"url\"/>\n           <xs:element name=\"valueUuid\" type=\"uuid\"/>\n           <xs:element name=\"valueAddress\" type=\"Address\"/>\n           <xs:element name=\"valueAge\" type=\"Age\"/>\n           <xs:element name=\"valueAnnotation\" type=\"Annotation\"/>\n           <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\n           <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\n           <xs:element name=\"valueCoding\" type=\"Coding\"/>\n           <xs:element name=\"valueContactPoint\" type=\"ContactPoint\"/>\n           <xs:element name=\"valueCount\" type=\"Count\"/>\n           <xs:element name=\"valueDistance\" type=\"Distance\"/>\n           <xs:element name=\"valueDuration\" type=\"Duration\"/>\n           <xs:element name=\"valueHumanName\" type=\"HumanName\"/>\n           <xs:element name=\"valueIdentifier\" type=\"Identifier\"/>\n           <xs:element name=\"valueMoney\" type=\"Money\"/>\n           <xs:element name=\"valuePeriod\" type=\"Period\"/>\n           <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n           <xs:element name=\"valueRange\" type=\"Range\"/>\n           <xs:element name=\"valueRatio\" type=\"Ratio\"/>\n           <xs:element name=\"valueReference\" type=\"Reference\"/>\n           <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\n           <xs:element name=\"valueSignature\" type=\"Signature\"/>\n           <xs:element name=\"valueTiming\" type=\"Timing\"/>\n           <xs:element name=\"valueContactDetail\" type=\"ContactDetail\"/>\n           <xs:element name=\"valueContributor\" type=\"Contributor\"/>\n           <xs:element name=\"valueDataRequirement\" type=\"DataRequirement\"/>\n           <xs:element name=\"valueExpression\" type=\"Expression\"/>\n           <xs:element name=\"valueParameterDefinition\" type=\"ParameterDefinition\"/>\n           <xs:element name=\"valueRelatedArtifact\" type=\"RelatedArtifact\"/>\n           <xs:element name=\"valueTriggerDefinition\" type=\"TriggerDefinition\"/>\n           <xs:element name=\"valueUsageContext\" type=\"UsageContext\"/>\n           <xs:element name=\"valueDosage\" type=\"Dosage\"/>\n           <xs:element name=\"valueMeta\" type=\"Meta\"/>\n         </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ElementDefinition.Slicing\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"discriminator\" type=\"ElementDefinition.Discriminator\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"ordered\" type=\"boolean\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the matching elements have to occur in the same order as defined in the profile.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rules\" type=\"SlicingRules\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ElementDefinition.Binding\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"strength\" type=\"BindingStrength\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the intended use of this particular set of codes.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"valueSet\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Refers to the value set that identifies the set of codes the binding refers to.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ElementDefinition.Discriminator\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" type=\"DiscriminatorType\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the element value is interpreted when discrimination is evaluated.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"path\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"PropertyRepresentation-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"xmlAttr\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">XML Attribute</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"xmlText\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">XML Text</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"typeAttr\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Type Attribute</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cdaText\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CDA Text Format</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"xhtml\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">XHTML</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"PropertyRepresentation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How a property is represented when serialized.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"PropertyRepresentation-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ConstraintSeverity-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"warning\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Warning</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ConstraintSeverity\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">SHALL applications comply with this constraint?</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"ConstraintSeverity-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AggregationMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"contained\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Contained</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"referenced\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Referenced</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"bundled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Bundled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AggregationMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How resource references can be aggregated.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"AggregationMode-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ReferenceVersionRules-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"either\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Either Specific or independent</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"independent\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Version independent</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"specific\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Version Specific</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ReferenceVersionRules\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Whether a reference needs to be version specific or version independent, or whether either can be used.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"ReferenceVersionRules-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SlicingRules-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"closed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Closed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"open\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"openAtEnd\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open at End</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SlicingRules\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How slices are interpreted when evaluating an instance.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"SlicingRules-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"BindingStrength-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"required\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Required</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"extensible\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Extensible</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"preferred\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Preferred</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"example\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Example</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"BindingStrength\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indication of the degree of conformance expectations associated with a binding.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"BindingStrength-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DiscriminatorType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"value\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Value</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"exists\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Exists</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"pattern\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Pattern</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"type\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Type</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"profile\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Profile</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DiscriminatorType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How an element value is interpreted when discrimination is evaluated.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"DiscriminatorType-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"DomainResource\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A resource that includes narrative, extensions, and contained resources.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Resource\">\n        <xs:sequence>\n          <xs:element name=\"text\" type=\"Narrative\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it &quot;clinically safe&quot; for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contained\" type=\"ResourceContainer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"extension\" type=\"Extension\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifierExtension\" type=\"Extension\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Resource\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This is the base resource type for everything.</xs:documentation>\n    </xs:annotation>\n        <xs:sequence>\n          <xs:element name=\"id\" type=\"id\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"meta\" type=\"Meta\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"implicitRules\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n          <xs:element name=\"language\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The base language in which the resource is written.</xs:documentation>\n            </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n  </xs:complexType>\n  <xs:simpleType name=\"PublicationStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"draft\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\n          <xs:documentation xml:lang=\"ru\">черновик</xs:documentation>\n          <xs:documentation xml:lang=\"nl\">ontwerp</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n          <xs:documentation xml:lang=\"ru\">активный</xs:documentation>\n          <xs:documentation xml:lang=\"nl\">actief</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"retired\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Retired</xs:documentation>\n          <xs:documentation xml:lang=\"ru\">удалён</xs:documentation>\n          <xs:documentation xml:lang=\"nl\">verouderd</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"PublicationStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"PublicationStatus-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SearchParamType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"number\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Number</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"date\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Date/DateTime</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"string\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">String</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"token\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Token</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"reference\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Reference</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"composite\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Composite</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"quantity\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Quantity</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"uri\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">URI</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"special\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Special</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SearchParamType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"SearchParamType-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AdministrativeGender-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"male\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Male</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"female\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Female</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"other\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Other</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AdministrativeGender\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"AdministrativeGender-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"FHIRVersion-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"0.01\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">0.01</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"0.05\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">0.05</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"0.06\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">0.06</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"0.11\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">0.11</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"0.0.80\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">0.0.80</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"0.0.81\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">0.0.81</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"0.0.82\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">0.0.82</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"0.4.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">0.4.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"0.5.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">0.5.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"1.0.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">1.0.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"1.0.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">1.0.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"1.0.2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">1.0.2</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"1.1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">1.1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"1.4.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">1.4.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"1.6.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">1.6.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"1.8.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">1.8.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"3.0.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">3.0.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"3.0.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">3.0.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"3.3.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">3.3.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"3.5.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">3.5.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"4.0.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">4.0.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"4.0.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">4.0.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"FHIRVersion\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"FHIRVersion-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"NoteType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"display\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Display</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"print\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Print (Form)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"printoper\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Print (Operator)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"NoteType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"NoteType-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"RemittanceOutcome-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"queued\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Queued</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"complete\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Processing Complete</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"partial\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Partial Processing</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"RemittanceOutcome\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"RemittanceOutcome-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ConceptMapEquivalence-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"relatedto\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Related To</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"equivalent\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Equivalent</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"equal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Equal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"wider\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Wider</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"subsumes\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Subsumes</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"narrower\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Narrower</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"specializes\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Specializes</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"inexact\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Inexact</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unmatched\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unmatched</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"disjoint\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Disjoint</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ConceptMapEquivalence\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"ConceptMapEquivalence-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DocumentReferenceStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"current\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Current</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"superseded\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Superseded</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DocumentReferenceStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n       <xs:extension base=\"Element\">\n         <xs:attribute name=\"value\" type=\"DocumentReferenceStatus-list\" use=\"optional\"/>\n       </xs:extension>\n     </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/fhir-invariants.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains constraints for all resources\n    Because of the way containment works, this file should always )\n    be used for validating resources. Alternatively you can use \n    the resource specific files to build a smaller version of\n    this file (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Account</sch:title>\n    <sch:rule context=\"f:Account\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:servicePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:coverage/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:coverage/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:coverage/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:owner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:owner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:owner/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:guarantor/f:party\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:guarantor/f:party/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:guarantor/f:party/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:guarantor/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Account/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ActivityDefinition</sch:title>\n    <sch:rule context=\"f:ActivityDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:timingDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:productReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:productReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:productReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:timing/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:timing/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:timing/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:timing/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:timing/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:timing/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:doseRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:doseRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:doseRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:doseQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:doseAndRate/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:maxDosePerPeriod\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:maxDosePerPeriod/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:maxDosePerPeriod/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:maxDosePerAdministration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dosage/f:maxDosePerLifetime\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:specimenRequirement\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:specimenRequirement/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:specimenRequirement/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:observationRequirement\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:observationRequirement/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:observationRequirement/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:observationResultRequirement\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:observationResultRequirement/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:observationResultRequirement/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ActivityDefinition/f:dynamicValue/f:expression\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>AdverseEvent</sch:title>\n    <sch:rule context=\"f:AdverseEvent\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:resultingCondition\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:resultingCondition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:resultingCondition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:recorder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:recorder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:recorder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:contributor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:contributor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:contributor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:suspectEntity/f:instance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:suspectEntity/f:instance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:suspectEntity/f:instance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:suspectEntity/f:causality/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:suspectEntity/f:causality/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:suspectEntity/f:causality/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:subjectMedicalHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:subjectMedicalHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:subjectMedicalHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:referenceDocument\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:referenceDocument/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:referenceDocument/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:study\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:study/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AdverseEvent/f:study/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>AllergyIntolerance</sch:title>\n    <sch:rule context=\"f:AllergyIntolerance\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"f:verificationStatus/f:coding/f:code/@value='entered-in-error' or exists(f:clinicalStatus)\">ait-1: AllergyIntolerance.clinicalStatus SHALL be present if verificationStatus is not entered-in-error.</sch:assert>\n      <sch:assert test=\"not(f:verificationStatus/f:coding/f:code/@value='entered-in-error') or not(exists(f:clinicalStatus))\">ait-2: AllergyIntolerance.clinicalStatus SHALL NOT be present if verification Status is entered-in-error</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:onsetAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:onsetPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:onsetRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:onsetRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:onsetRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:recorder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:recorder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:recorder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:asserter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:asserter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:asserter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:reaction/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:reaction/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AllergyIntolerance/f:reaction/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Appointment</sch:title>\n    <sch:rule context=\"f:Appointment\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(exists(f:cancellationReason)) or f:status/@value=('no-show', 'cancelled')\">app-4: Cancelation reason is only used for appointments that have been cancelled, or no-show</sch:assert>\n      <sch:assert test=\"((exists(f:start) and exists(f:end)) or (f:status/@value='proposed') or (f:status/@value='cancelled') or (f:status/@value='waitlist'))\">app-3: Only proposed or cancelled appointments can be missing start/end dates</sch:assert>\n      <sch:assert test=\"((exists(f:start) and exists(f:end)) or (not(exists(f:start)) and not(exists(f:end))))\">app-2: Either start and end are specified, or neither</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:supportingInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:supportingInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:supportingInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:slot\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:slot/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:slot/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:participant\">\n      <sch:assert test=\"(exists(f:type) or exists(f:actor))\">app-1: Either the type or actor on the participant SHALL be specified</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:participant/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:participant/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:participant/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:participant/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Appointment/f:requestedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>AppointmentResponse</sch:title>\n    <sch:rule context=\"f:AppointmentResponse\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"(exists(f:participantType) or exists(f:actor))\">apr-1: Either the participantType or actor must be specified</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:appointment\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:appointment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:appointment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AppointmentResponse/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>AuditEvent</sch:title>\n    <sch:rule context=\"f:AuditEvent\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:agent/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:agent/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:agent/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:agent/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:agent/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:agent/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:source/f:observer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:source/f:observer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:source/f:observer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:entity\">\n      <sch:assert test=\"not(exists(f:name)) or not(exists(f:query))\">sev-1: Either a name or a query (NOT both)</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:entity/f:what\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:entity/f:what/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:AuditEvent/f:entity/f:what/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Basic</sch:title>\n    <sch:rule context=\"f:Basic\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Basic/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Binary</sch:title>\n    <sch:rule context=\"f:Binary/f:securityContext\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Binary/f:securityContext/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Binary/f:securityContext/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>BiologicallyDerivedProduct</sch:title>\n    <sch:rule context=\"f:BiologicallyDerivedProduct\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:parent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:parent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:parent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:collector\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:collector/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:collector/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:collection/f:collectedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:processing/f:additive\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:processing/f:additive/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:processing/f:additive/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:processing/f:timePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:manipulation/f:timePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BiologicallyDerivedProduct/f:storage/f:duration\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>BodyStructure</sch:title>\n    <sch:rule context=\"f:BodyStructure\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:image\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:BodyStructure/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Bundle</sch:title>\n    <sch:rule context=\"f:Bundle\">\n      <sch:assert test=\"(f:type/@value = 'history') or (count(for $entry in f:entry[f:resource] return $entry[count(parent::f:Bundle/f:entry[f:fullUrl/@value=$entry/f:fullUrl/@value and ((not(f:resource/*/f:meta/f:versionId/@value) and not($entry/f:resource/*/f:meta/f:versionId/@value)) or f:resource/*/f:meta/f:versionId/@value=$entry/f:resource/*/f:meta/f:versionId/@value)])!=1])=0)\">bdl-7: FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId (except in history bundles)</sch:assert>\n      <sch:assert test=\"not(f:type/@value = 'document') or exists(f:identifier/f:system) or exists(f:identifier/f:value)\">bdl-9: A document must have an identifier with a system and a value</sch:assert>\n      <sch:assert test=\"not(f:entry/f:request) or (f:type/@value = 'batch') or (f:type/@value = 'transaction') or (f:type/@value = 'history')\">bdl-3: entry.request mandatory for batch/transaction/history, otherwise prohibited</sch:assert>\n      <sch:assert test=\"not(f:entry/f:response) or (f:type/@value = 'batch-response') or (f:type/@value = 'transaction-response') or (f:type/@value = 'history')\">bdl-4: entry.response mandatory for batch-response/transaction-response/history, otherwise prohibited</sch:assert>\n      <sch:assert test=\"not(f:type/@value='message') or f:entry[1]/f:resource/f:MessageHeader\">bdl-12: A message must have a MessageHeader as the first resource</sch:assert>\n      <sch:assert test=\"not(f:total) or (f:type/@value = 'searchset') or (f:type/@value = 'history')\">bdl-1: total only when a search or history</sch:assert>\n      <sch:assert test=\"not(f:entry/f:search) or (f:type/@value = 'searchset')\">bdl-2: entry.search only when a search</sch:assert>\n      <sch:assert test=\"not(f:type/@value='document') or f:entry[1]/f:resource/f:Composition\">bdl-11: A document must have a Composition as the first resource</sch:assert>\n      <sch:assert test=\"not(f:type/@value = 'document') or exists(f:timestamp/@value)\">bdl-10: A document must have a date</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:entry\">\n      <sch:assert test=\"not(exists(f:fullUrl[contains(string(@value), '/_history/')]))\">bdl-8: fullUrl cannot be a version specific reference</sch:assert>\n      <sch:assert test=\"exists(f:resource) or exists(f:request) or exists(f:response)\">bdl-5: must be a resource unless there's a request or response</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:signature/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:signature/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:signature/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:signature/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:signature/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Bundle/f:signature/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CapabilityStatement</sch:title>\n    <sch:rule context=\"f:CapabilityStatement\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(f:document[f:mode/@value='producer'])=count(distinct-values(f:document[f:mode/@value='producer']/f:profile/f:reference/@value)) and count(f:document[f:mode/@value='consumer'])=count(distinct-values(f:document[f:mode/@value='consumer']/f:profile/f:reference/@value))\">cpb-7: The set of documents must be unique by the combination of profile and mode.</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='instance') or (not(exists(f:implementation)) and not(exists(f:software)))\">cpb-16: If kind = requirements, implementation and software must be absent</sch:assert>\n      <sch:assert test=\" not(f:kind/@value='instance') or (not(exists(f:implementation)) and exists(f:software))\">cpb-15: If kind = capability, implementation must be absent, software must be present</sch:assert>\n      <sch:assert test=\"not(exists(f:messaging/f:endpoint)) or f:kind/@value = 'instance'\">cpb-3: Messaging end-point is required (and is only permitted) when a statement is for an implementation.</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='instance') or exists(f:implementation)\">cpb-14: If kind = instance, implementation must be present and software may be present</sch:assert>\n      <sch:assert test=\"count(f:software | f:implementation | f:description) &gt; 0\">cpb-2: A Capability Statement SHALL have at least one of description, software, or implementation element.</sch:assert>\n      <sch:assert test=\"exists(f:rest) or exists(f:messaging) or exists(f:document)\">cpb-1: A Capability Statement SHALL have at least one of REST, messaging or document element.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:implementation/f:custodian\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:implementation/f:custodian/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:implementation/f:custodian/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:rest\">\n      <sch:assert test=\"count(f:resource)=count(distinct-values(f:resource/f:type/@value))\">cpb-9: A given resource can only be described once per RESTful mode.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CapabilityStatement/f:rest/f:resource\">\n      <sch:assert test=\"count(f:searchParam)=count(distinct-values(f:searchParam/f:name/@value))\">cpb-12: Search parameter names must be unique in the context of a resource.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CarePlan</sch:title>\n    <sch:rule context=\"f:CarePlan\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:replaces\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:replaces/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:replaces/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:contributor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:contributor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:contributor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:careTeam\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:careTeam/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:careTeam/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:addresses\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:addresses/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:addresses/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:supportingInfo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:supportingInfo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:supportingInfo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:goal\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:goal/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:goal/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity\">\n      <sch:assert test=\"not(exists(f:detail)) or not(exists(f:reference))\">cpl-3: Provide a reference or detail, not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:outcomeReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:outcomeReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:outcomeReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:progress/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:progress/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:progress/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:reference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:reference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:reference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:goal\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:goal/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:goal/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:scheduledPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:productReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:productReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:productReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:dailyAmount\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:activity/f:detail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CarePlan/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CareTeam</sch:title>\n    <sch:rule context=\"f:CareTeam\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant\">\n      <sch:assert test=\"starts-with(f:member/f:reference/@value, 'Practitioner/') or contains(f:member/f:reference/@value, '/Practitioner/') or exists(ancestor::*/f:contains/f:Practitioner/f:id[@value=substring-after(current()/f:member/f:reference/@value, '#')]) or not(exists(f:onBehalfOf))\">ctm-1: CareTeam.participant.onBehalfOf can only be populated when CareTeam.participant.member is a Practitioner</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:member\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:member/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:member/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:onBehalfOf/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:participant/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:managingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:managingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:managingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CareTeam/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CatalogEntry</sch:title>\n    <sch:rule context=\"f:CatalogEntry\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:referencedItem\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:referencedItem/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:referencedItem/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:additionalIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:additionalIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:validityPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:relatedEntry/f:item\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:relatedEntry/f:item/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CatalogEntry/f:relatedEntry/f:item/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ChargeItem</sch:title>\n    <sch:rule context=\"f:ChargeItem\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:context\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:context/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:context/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrenceTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrenceTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrenceTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrenceTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrenceTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:occurrenceTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:performer/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:performer/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:performer/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:performingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:performingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:performingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:requestingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:requestingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:requestingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:costCenter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:costCenter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:costCenter/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:enterer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:enterer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:enterer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:service\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:service/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:service/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:productReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:productReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:productReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:account\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:account/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:account/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:supportingInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:supportingInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItem/f:supportingInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ChargeItemDefinition</sch:title>\n    <sch:rule context=\"f:ChargeItemDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:instance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:instance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ChargeItemDefinition/f:instance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Claim</sch:title>\n    <sch:rule context=\"f:Claim\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:billablePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:enterer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:enterer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:enterer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:related/f:claim\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:related/f:claim/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:related/f:claim/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:related/f:reference/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:related/f:reference/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:prescription\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:prescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:prescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:originalPrescription\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:originalPrescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:originalPrescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:payee/f:party\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:payee/f:party/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:payee/f:party/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:referral\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:referral/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:referral/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:facility\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:facility/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:facility/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:careTeam/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:careTeam/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:careTeam/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:supportingInfo/f:timingPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:supportingInfo/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:supportingInfo/f:valueAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:supportingInfo/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:supportingInfo/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:supportingInfo/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:diagnosis/f:diagnosisReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:diagnosis/f:diagnosisReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:diagnosis/f:diagnosisReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:procedure/f:procedureReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:procedure/f:procedureReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:procedure/f:procedureReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:procedure/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:procedure/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:procedure/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:claimResponse\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:claimResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:insurance/f:claimResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:accident/f:locationAddress/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:accident/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:accident/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:accident/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:servicedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:locationAddress/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:subDetail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:subDetail/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:subDetail/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Claim/f:item/f:detail/f:subDetail/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ClaimResponse</sch:title>\n    <sch:rule context=\"f:ClaimResponse\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:requestor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:requestor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:requestor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:preAuthPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:servicedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:locationAddress/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:detail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:addItem/f:detail/f:subDetail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:payment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:payment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:form\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:communicationRequest\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:communicationRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:communicationRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurance/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurance/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurance/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurance/f:claimResponse\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurance/f:claimResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClaimResponse/f:insurance/f:claimResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ClinicalImpression</sch:title>\n    <sch:rule context=\"f:ClinicalImpression\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:assessor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:assessor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:assessor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:previous\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:previous/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:previous/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:problem\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:problem/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:problem/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:investigation/f:item\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:investigation/f:item/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:investigation/f:item/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:finding/f:itemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:finding/f:itemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:finding/f:itemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:prognosisReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:prognosisReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:prognosisReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:supportingInfo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:supportingInfo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:supportingInfo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ClinicalImpression/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CodeSystem</sch:title>\n    <sch:rule context=\"f:CodeSystem\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(distinct-values(descendant::f:concept/f:code/@value))=count(descendant::f:concept)\">csd-1: Within a code system definition, all the codes SHALL be unique</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CodeSystem/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Communication</sch:title>\n    <sch:rule context=\"f:Communication\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:inResponseTo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:inResponseTo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:inResponseTo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:about\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:about/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:about/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:recipient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:recipient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:recipient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:sender\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:sender/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:sender/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:payload/f:contentAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:payload/f:contentReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:payload/f:contentReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:payload/f:contentReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Communication/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CommunicationRequest</sch:title>\n    <sch:rule context=\"f:CommunicationRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:replaces\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:replaces/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:replaces/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:groupIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:groupIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:about\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:about/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:about/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:payload/f:contentAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:payload/f:contentReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:payload/f:contentReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:payload/f:contentReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:requester\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:requester/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:requester/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:recipient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:recipient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:recipient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:sender\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:sender/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:sender/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CommunicationRequest/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CompartmentDefinition</sch:title>\n    <sch:rule context=\"f:CompartmentDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CompartmentDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Composition</sch:title>\n    <sch:rule context=\"f:Composition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:attester/f:party\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:attester/f:party/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:attester/f:party/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:custodian\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:custodian/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:custodian/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:relatesTo/f:targetIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:relatesTo/f:targetIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:relatesTo/f:targetReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:relatesTo/f:targetReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:relatesTo/f:targetReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:event/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:event/f:detail\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:event/f:detail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition/f:event/f:detail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Composition//f:section\">\n      <sch:assert test=\"exists(f:text) or exists(f:entry) or exists(f:section)\">cmp-1: A section must contain at least one of text, entries, or sub-sections</sch:assert>\n      <sch:assert test=\"not(exists(f:emptyReason) and exists(f:entry))\">cmp-2: A section can only have an emptyReason if it is empty</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ConceptMap</sch:title>\n    <sch:rule context=\"f:ConceptMap\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:group/f:element/f:target\">\n      <sch:assert test=\"exists(f:comment) or not(exists(f:equivalence)) or ((f:equivalence/@value != 'narrower') and (f:equivalence/@value != 'inexact'))\">cmd-1: If the map is narrower or inexact, there SHALL be some comments</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ConceptMap/f:group/f:unmapped\">\n      <sch:assert test=\"(f:mode/@value != 'other-map') or exists(f:url)\">cmd-3: If the mode is 'other-map', a url must be provided</sch:assert>\n      <sch:assert test=\"(f:mode/@value != 'fixed') or exists(f:code)\">cmd-2: If the mode is 'fixed', a code must be provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Condition</sch:title>\n    <sch:rule context=\"f:Condition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(exists(f:verificationStatus/f:coding[f:system/@value='http://terminology.hl7.org/CodeSystem/condition-ver-status' and f:code/@value='entered-in-error'])) or not(exists(f:clinicalStatus))\">con-5: Condition.clinicalStatus SHALL NOT be present if verification Status is entered-in-error</sch:assert>\n      <sch:assert test=\"not(exists(*[starts-with(local-name(.), 'abatement')])) or exists(f:clinicalStatus/f:coding[f:system/@value='http://terminology.hl7.org/CodeSystem/condition-clinical' and f:code/@value=('resolved', 'remission', 'inactive')])\">con-4: If condition is abated, then clinicalStatus must be either inactive, resolved, or remission</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:onsetAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:onsetPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:onsetRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:onsetRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:onsetRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:abatementAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:abatementPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:abatementRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:abatementRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:abatementRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:recorder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:recorder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:recorder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:asserter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:asserter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:asserter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:stage\">\n      <sch:assert test=\"exists(f:summary) or exists(f:assessment)\">con-1: Stage SHALL have summary or assessment</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:stage/f:assessment\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:stage/f:assessment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:stage/f:assessment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:evidence\">\n      <sch:assert test=\"exists(f:code) or exists(f:detail)\">con-2: evidence SHALL have code or details</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:evidence/f:detail\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:evidence/f:detail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:evidence/f:detail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Condition/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Consent</sch:title>\n    <sch:rule context=\"f:Consent\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"exists(f:patient) or not(exists(f:scope/f:coding[f:system/@value='something' and f:code/@value='adr'])))\">ppc-4: IF Scope=adr, there must be a patient</sch:assert>\n      <sch:assert test=\"exists(f:patient) or not(exists(f:scope/f:coding[f:system/@value='something' and f:code/@value='treatment'])))\">ppc-5: IF Scope=treatment, there must be a patient</sch:assert>\n      <sch:assert test=\"exists(f:patient) or not(exists(f:scope/f:coding[f:system/@value='something' and f:code/@value='patient-privacy'])))\">ppc-2: IF Scope=privacy, there must be a patient</sch:assert>\n      <sch:assert test=\"exists(f:patient) or not(exists(f:scope/f:coding[f:system/@value='something' and f:code/@value='research'])))\">ppc-3: IF Scope=research, there must be a patient</sch:assert>\n      <sch:assert test=\"exists(f:policy) or exists(f:policyRule)\">ppc-1: Either a Policy or PolicyRule</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:organization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:organization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:sourceAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:sourceReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:sourceReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:sourceReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:verification/f:verifiedWith\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:verification/f:verifiedWith/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Consent/f:verification/f:verifiedWith/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Contract</sch:title>\n    <sch:rule context=\"f:Contract\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:instantiatesCanonical\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:instantiatesCanonical/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:instantiatesCanonical/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:applies\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:authority\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:authority/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:authority/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:domain\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:domain/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:domain/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:site\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:site/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:site/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:topicReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:topicReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:topicReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:contentDefinition/f:publisher\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:contentDefinition/f:publisher/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:contentDefinition/f:publisher/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:supportingInfo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:supportingInfo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:supportingInfo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:relevantHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:relevantHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:relevantHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:party\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:party/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:party/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:signature/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:signature/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:signature/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:signature/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:signature/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:signer/f:signature/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:friendly/f:contentAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:friendly/f:contentReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:friendly/f:contentReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:friendly/f:contentReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legal/f:contentAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legal/f:contentReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legal/f:contentReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legal/f:contentReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:rule/f:contentAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:rule/f:contentReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:rule/f:contentReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:rule/f:contentReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legallyBindingAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legallyBindingReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legallyBindingReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Contract/f:legallyBindingReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Coverage</sch:title>\n    <sch:rule context=\"f:Coverage\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:policyHolder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:policyHolder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:policyHolder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:subscriber\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:subscriber/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:subscriber/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:beneficiary\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:beneficiary/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:beneficiary/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:payor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:payor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:payor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:costToBeneficiary/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:costToBeneficiary/f:exception/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:contract\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:contract/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Coverage/f:contract/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CoverageEligibilityRequest</sch:title>\n    <sch:rule context=\"f:CoverageEligibilityRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:servicedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:enterer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:enterer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:enterer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:insurer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:insurer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:insurer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:facility\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:facility/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:facility/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:supportingInfo/f:information\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:supportingInfo/f:information/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:supportingInfo/f:information/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:insurance/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:insurance/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:insurance/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:facility\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:facility/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:facility/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:diagnosis/f:diagnosisReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:diagnosis/f:diagnosisReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:diagnosis/f:diagnosisReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:detail\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:detail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityRequest/f:item/f:detail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>CoverageEligibilityResponse</sch:title>\n    <sch:rule context=\"f:CoverageEligibilityResponse\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:servicedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:requestor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:requestor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:requestor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:benefitPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:item\">\n      <sch:assert test=\"exists(f:category) or exists(f:productOrService)\">ces-1: SHALL contain a category or a billcode but not both.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:item/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:item/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:CoverageEligibilityResponse/f:insurance/f:item/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DetectedIssue</sch:title>\n    <sch:rule context=\"f:DetectedIssue\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:identifiedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:implicated\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:implicated/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:implicated/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:evidence/f:detail\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:evidence/f:detail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:evidence/f:detail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:mitigation/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:mitigation/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DetectedIssue/f:mitigation/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Device</sch:title>\n    <sch:rule context=\"f:Device\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:definition\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:definition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:definition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:version/f:component/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:version/f:component/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:property/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:owner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:owner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:owner/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:contact\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:contact/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:parent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:parent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Device/f:parent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DeviceDefinition</sch:title>\n    <sch:rule context=\"f:DeviceDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:manufacturerReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:manufacturerReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:manufacturerReference/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:shelfLifeStorage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:shelfLifeStorage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:shelfLifeStorage/f:period\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:height\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:width\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:depth\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:weight\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:nominalVolume\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:externalDiameter\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:physicalCharacteristics/f:image\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:property/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:owner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:owner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:owner/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:contact\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:contact/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:parentDevice\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:parentDevice/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceDefinition/f:parentDevice/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DeviceMetric</sch:title>\n    <sch:rule context=\"f:DeviceMetric\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:parent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:parent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:parent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:measurementPeriod/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:measurementPeriod/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:measurementPeriod/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:measurementPeriod/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:measurementPeriod/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceMetric/f:measurementPeriod/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DeviceRequest</sch:title>\n    <sch:rule context=\"f:DeviceRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:priorRequest\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:priorRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:priorRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:groupIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:groupIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:codeReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:codeReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:codeReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:parameter/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:parameter/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:parameter/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:parameter/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrenceTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrenceTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrenceTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrenceTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrenceTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:occurrenceTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:requester\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:requester/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:requester/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:insurance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:insurance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:insurance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:supportingInfo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:supportingInfo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:supportingInfo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:relevantHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:relevantHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceRequest/f:relevantHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DeviceUseStatement</sch:title>\n    <sch:rule context=\"f:DeviceUseStatement\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:derivedFrom\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:derivedFrom/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:derivedFrom/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:timingPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:device\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DeviceUseStatement/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DiagnosticReport</sch:title>\n    <sch:rule context=\"f:DiagnosticReport\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:resultsInterpreter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:resultsInterpreter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:resultsInterpreter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:specimen\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:specimen/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:specimen/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:result\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:result/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:result/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:imagingStudy\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:imagingStudy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:imagingStudy/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:media/f:link\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:media/f:link/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:media/f:link/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DiagnosticReport/f:presentedForm\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DocumentManifest</sch:title>\n    <sch:rule context=\"f:DocumentManifest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:masterIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:masterIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:recipient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:recipient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:recipient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:content\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:content/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:content/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:related/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:related/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:related/f:ref\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:related/f:ref/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentManifest/f:related/f:ref/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>DocumentReference</sch:title>\n    <sch:rule context=\"f:DocumentReference\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:masterIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:masterIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:authenticator\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:authenticator/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:authenticator/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:custodian\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:custodian/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:custodian/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:relatesTo/f:target\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:relatesTo/f:target/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:relatesTo/f:target/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:content/f:attachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:sourcePatientInfo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:sourcePatientInfo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:sourcePatientInfo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:related\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:related/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:DocumentReference/f:context/f:related/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>EffectEvidenceSynthesis</sch:title>\n    <sch:rule context=\"f:EffectEvidenceSynthesis\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:population\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:population/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:population/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:exposure\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:exposure/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:exposure/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:exposureAlternative\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:exposureAlternative/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:exposureAlternative/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:outcome\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:outcome/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:outcome/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:resultsByExposure/f:riskEvidenceSynthesis\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:resultsByExposure/f:riskEvidenceSynthesis/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:resultsByExposure/f:riskEvidenceSynthesis/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:certainty/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:certainty/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:certainty/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:certainty/f:certaintySubcomponent/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:certainty/f:certaintySubcomponent/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EffectEvidenceSynthesis/f:certainty/f:certaintySubcomponent/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Encounter</sch:title>\n    <sch:rule context=\"f:Encounter\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:statusHistory/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:classHistory/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:episodeOfCare\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:episodeOfCare/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:episodeOfCare/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:participant/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:participant/f:individual\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:participant/f:individual/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:participant/f:individual/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:appointment\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:appointment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:appointment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:length\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:diagnosis/f:condition\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:diagnosis/f:condition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:diagnosis/f:condition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:account\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:account/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:account/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:preAdmissionIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:preAdmissionIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:origin\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:origin/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:origin/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:destination\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:destination/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:hospitalization/f:destination/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:location/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:location/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:location/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:location/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:serviceProvider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:serviceProvider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:serviceProvider/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Encounter/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Endpoint</sch:title>\n    <sch:rule context=\"f:Endpoint\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:managingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:managingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:managingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:contact\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:contact/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Endpoint/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>EnrollmentRequest</sch:title>\n    <sch:rule context=\"f:EnrollmentRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:insurer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:insurer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:insurer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:candidate\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:candidate/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:candidate/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentRequest/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>EnrollmentResponse</sch:title>\n    <sch:rule context=\"f:EnrollmentResponse\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:organization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:organization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:requestProvider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:requestProvider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EnrollmentResponse/f:requestProvider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>EpisodeOfCare</sch:title>\n    <sch:rule context=\"f:EpisodeOfCare\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:statusHistory/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:diagnosis/f:condition\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:diagnosis/f:condition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:diagnosis/f:condition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:managingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:managingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:managingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:referralRequest\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:referralRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:referralRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:careManager\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:careManager/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:careManager/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:team\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:team/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:team/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:account\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:account/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EpisodeOfCare/f:account/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>EventDefinition</sch:title>\n    <sch:rule context=\"f:EventDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger\">\n      <sch:assert test=\"((not(f:type/@value = 'named-event')) or name.exists()) and (not(f:type/@value = 'periodic') or timing.exists()) and (not(starts-with(f:type/@value, 'data-')) or data.exists())\">trd-3: A named event requires a name, a periodic event requires timing, and a data event requires data</sch:assert>\n      <sch:assert test=\"not(exists(f:condition)) or exists(f:data)\">trd-2: A condition only if there is a data requirement</sch:assert>\n      <sch:assert test=\"not(exists(f:data)) or not(exists(*[starts-with(local-name(.), 'timing')]))\">trd-1: Either timing, or a data requirement, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:timingReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:codeFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-1: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:dateFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-2: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:dateFilter/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:data/f:dateFilter/f:valueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EventDefinition/f:trigger/f:condition\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Evidence</sch:title>\n    <sch:rule context=\"f:Evidence\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:exposureBackground\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:exposureBackground/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:exposureBackground/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:exposureVariant\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:exposureVariant/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:exposureVariant/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:outcome\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:outcome/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Evidence/f:outcome/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>EvidenceVariable</sch:title>\n    <sch:rule context=\"f:EvidenceVariable\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionExpression\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:codeFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-1: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:dateFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-2: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:dateFilter/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionDataRequirement/f:dateFilter/f:valueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition\">\n      <sch:assert test=\"((not(f:type/@value = 'named-event')) or name.exists()) and (not(f:type/@value = 'periodic') or timing.exists()) and (not(starts-with(f:type/@value, 'data-')) or data.exists())\">trd-3: A named event requires a name, a periodic event requires timing, and a data event requires data</sch:assert>\n      <sch:assert test=\"not(exists(f:condition)) or exists(f:data)\">trd-2: A condition only if there is a data requirement</sch:assert>\n      <sch:assert test=\"not(exists(f:data)) or not(exists(*[starts-with(local-name(.), 'timing')]))\">trd-1: Either timing, or a data requirement, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:timingReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:codeFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-1: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:dateFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-2: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:dateFilter/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:data/f:dateFilter/f:valueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:definitionTriggerDefinition/f:condition\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:usageContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:EvidenceVariable/f:characteristic/f:timeFromStart\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ExampleScenario</sch:title>\n    <sch:rule context=\"f:ExampleScenario\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExampleScenario/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ExplanationOfBenefit</sch:title>\n    <sch:rule context=\"f:ExplanationOfBenefit\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:billablePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:enterer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:enterer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:enterer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:insurer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:insurer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:insurer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:related/f:claim\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:related/f:claim/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:related/f:claim/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:related/f:reference/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:related/f:reference/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:prescription\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:prescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:prescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:originalPrescription\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:originalPrescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:originalPrescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:payee/f:party\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:payee/f:party/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:payee/f:party/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:referral\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:referral/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:referral/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:facility\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:facility/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:facility/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:claim\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:claim/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:claim/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:claimResponse\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:claimResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:claimResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:preAuthRefPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:careTeam/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:careTeam/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:careTeam/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:supportingInfo/f:timingPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:supportingInfo/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:supportingInfo/f:valueAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:supportingInfo/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:supportingInfo/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:supportingInfo/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:diagnosis/f:diagnosisReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:diagnosis/f:diagnosisReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:diagnosis/f:diagnosisReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:procedure/f:procedureReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:procedure/f:procedureReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:procedure/f:procedureReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:procedure/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:procedure/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:procedure/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:insurance/f:coverage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:insurance/f:coverage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:insurance/f:coverage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:accident/f:locationAddress/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:accident/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:accident/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:accident/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:servicedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:locationAddress/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:subDetail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:subDetail/f:udi\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:subDetail/f:udi/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:item/f:detail/f:subDetail/f:udi/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:servicedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:locationAddress/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:detail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:addItem/f:detail/f:subDetail/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:payment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:payment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:form\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ExplanationOfBenefit/f:benefitPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>FamilyMemberHistory</sch:title>\n    <sch:rule context=\"f:FamilyMemberHistory\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"exists(*[starts-with(local-name(.), 'age')]) or not(exists(f:estimatedAge))\">fhs-2: Can only have estimatedAge if age[x] is present</sch:assert>\n      <sch:assert test=\"not (*[starts-with(local-name(.), 'age')] and *[starts-with(local-name(.), 'birth')])\">fhs-1: Can have age[x] or born[x], but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:bornPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:ageAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:ageRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:ageRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:ageRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:deceasedAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:deceasedRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:deceasedRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:deceasedRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:onsetAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:onsetRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:onsetRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:onsetRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:onsetPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:FamilyMemberHistory/f:condition/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Flag</sch:title>\n    <sch:rule context=\"f:Flag\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Goal</sch:title>\n    <sch:rule context=\"f:Goal\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target\">\n      <sch:assert test=\"(exists(f:*[starts-with(local-name(.), 'detail')]) and exists(f:measure)) or not(exists(f:*[starts-with(local-name(.), 'detail')]))\">gol-1: Goal.target.measure is required if Goal.target.detail is populated</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:dueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:expressedBy\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:expressedBy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:expressedBy/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:addresses\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:addresses/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:addresses/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:outcomeReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:outcomeReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:outcomeReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>GraphDefinition</sch:title>\n    <sch:rule context=\"f:GraphDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Group</sch:title>\n    <sch:rule context=\"f:Group\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"f:actual/@value=true() or not(exists(f:member))\">grp-1: Can only have members if group is &quot;actual&quot;</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:managingEntity\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:managingEntity/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:managingEntity/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:member/f:entity\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:member/f:entity/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:member/f:entity/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:member/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>GuidanceResponse</sch:title>\n    <sch:rule context=\"f:GuidanceResponse\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:requestIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:requestIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:evaluationMessage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:evaluationMessage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:evaluationMessage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:outputParameters\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:outputParameters/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:outputParameters/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:result\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:result/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:result/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:codeFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-1: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:dateFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-2: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:dateFilter/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:dateFilter/f:valueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>HealthcareService</sch:title>\n    <sch:rule context=\"f:HealthcareService\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:providedBy\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:providedBy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:providedBy/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:photo\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:coverageArea\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:coverageArea/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:coverageArea/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:notAvailable/f:during\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ImagingStudy</sch:title>\n    <sch:rule context=\"f:ImagingStudy\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:referrer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:referrer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:referrer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:interpreter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:interpreter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:interpreter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:procedureReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:procedureReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:procedureReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:specimen\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:specimen/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:specimen/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:performer/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:performer/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:performer/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Immunization</sch:title>\n    <sch:rule context=\"f:Immunization\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:doseQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:performer/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:performer/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:performer/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:education\">\n      <sch:assert test=\"exists(f:documentType) or exists(f:reference)\">imm-1: One of documentType or reference SHALL be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:reaction/f:detail\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:reaction/f:detail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:reaction/f:detail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:protocolApplied/f:authority\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:protocolApplied/f:authority/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:protocolApplied/f:authority/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ImmunizationEvaluation</sch:title>\n    <sch:rule context=\"f:ImmunizationEvaluation\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:authority\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:authority/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:authority/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:immunizationEvent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:immunizationEvent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:immunizationEvent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ImmunizationRecommendation</sch:title>\n    <sch:rule context=\"f:ImmunizationRecommendation\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:authority\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:authority/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:authority/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation\">\n      <sch:assert test=\"exists(f:vaccineCode) or exists(f:targetDisease)\">imr-1: One of vaccineCode or targetDisease SHALL be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation/f:supportingImmunization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation/f:supportingImmunization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation/f:supportingImmunization/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation/f:supportingPatientInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation/f:supportingPatientInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation/f:supportingPatientInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ImplementationGuide</sch:title>\n    <sch:rule context=\"f:ImplementationGuide\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(for $id in (f:resource/f:fhirVersion) return $id[not(ancestor::f:fhirVersion/@value=$id/@value)])=0\">ig-2: If a resource has a fhirVersion, it must be oe of the versions defined for the Implementation Guide</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:definition\">\n      <sch:assert test=\"count(for $id in (f:resource/f:groupingId) return $id[not(ancestor::f:grouping/@id=$id/@value)])=0\">ig-1: If a resource has a groupingId, it must refer to a grouping defined in the Implementation Guide</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:definition/f:resource/f:reference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:definition/f:resource/f:reference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:definition/f:resource/f:reference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:manifest/f:resource/f:reference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:manifest/f:resource/f:reference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:manifest/f:resource/f:reference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>InsurancePlan</sch:title>\n    <sch:rule context=\"f:InsurancePlan\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(f:identifier | f:name) &gt; 0\">ipn-1: The organization SHALL at least have a name or an idendtifier, and possibly more than one</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:ownedBy\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:ownedBy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:ownedBy/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:administeredBy\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:administeredBy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:administeredBy/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverageArea\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverageArea/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverageArea/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:contact/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:contact/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:network\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:network/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:network/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverage/f:network\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverage/f:network/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverage/f:network/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverage/f:benefit/f:limit/f:value\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:coverageArea\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:coverageArea/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:coverageArea/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:network\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:network/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:network/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:specificCost/f:benefit/f:cost/f:value\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Invoice</sch:title>\n    <sch:rule context=\"f:Invoice\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:recipient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:recipient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:recipient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:participant/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:participant/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:participant/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:issuer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:issuer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:issuer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:account\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:account/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:account/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:lineItem/f:chargeItemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:lineItem/f:chargeItemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:lineItem/f:chargeItemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Library</sch:title>\n    <sch:rule context=\"f:Library\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:codeFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-1: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:dateFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-2: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:dateFilter/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:dateFilter/f:valueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:content\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Linkage</sch:title>\n    <sch:rule context=\"f:Linkage\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(f:item)&gt;1\">lnk-1: Must have at least two items</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:item/f:resource\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:item/f:resource/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:item/f:resource/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>List</sch:title>\n    <sch:rule context=\"f:List\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"(f:mode/@value = 'working') or not(exists(f:entry/f:date))\">lst-3: An entry date can only be used if the mode of the list is &quot;working&quot;</sch:assert>\n      <sch:assert test=\"(f:mode/@value = 'changes') or not(exists(f:entry/f:deleted))\">lst-2: The deleted flag can only be used if the mode of the list is &quot;changes&quot;</sch:assert>\n      <sch:assert test=\"not(exists(f:emptyReason) and exists(f:entry))\">lst-1: A list can only have an emptyReason if it is empty</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:entry/f:item\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:entry/f:item/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:entry/f:item/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Location</sch:title>\n    <sch:rule context=\"f:Location\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:managingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:managingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:managingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Measure</sch:title>\n    <sch:rule context=\"f:Measure\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"exists(f:group/stratifier/code) or exists(f:group/stratifier/component)\">mea-1: Stratifier SHALL be either a single criteria or a set of criteria components</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:group/f:population/f:criteria\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:group/f:stratifier/f:criteria\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:group/f:stratifier/f:component/f:criteria\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:supplementalData/f:criteria\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MeasureReport</sch:title>\n    <sch:rule context=\"f:MeasureReport\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='data-collection') or not(exists(f:group))\">mrp-2: Stratifiers SHALL be either a single criteria or a set of criteria components</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='data-collection') or not(exists(f:group))\">mrp-1: Measure Reports used for data collection SHALL NOT communicate group and score information</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:reporter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:reporter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:reporter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:population/f:subjectResults\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:population/f:subjectResults/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:population/f:subjectResults/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:measureScore\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:stratifier/f:stratum/f:population/f:subjectResults\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:stratifier/f:stratum/f:population/f:subjectResults/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:stratifier/f:stratum/f:population/f:subjectResults/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:stratifier/f:stratum/f:measureScore\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:evaluatedResource\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:evaluatedResource/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:evaluatedResource/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Media</sch:title>\n    <sch:rule context=\"f:Media\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:createdPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:operator\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:operator/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:operator/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:device\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:content\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Medication</sch:title>\n    <sch:rule context=\"f:Medication\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:amount\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:amount/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:amount/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:ingredient/f:itemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:ingredient/f:itemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:ingredient/f:itemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:ingredient/f:strength\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:ingredient/f:strength/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:ingredient/f:strength/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicationAdministration</sch:title>\n    <sch:rule context=\"f:MedicationAdministration\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:medicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:medicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:medicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:context\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:context/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:context/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:supportingInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:supportingInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:supportingInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:performer/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:performer/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:performer/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:device\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:dosage\">\n      <sch:assert test=\"exists(f:dose) or exists(f:*[starts-with(local-name(.), 'rate')])\">mad-1: SHALL have at least one of dosage.dose or dosage.rate[x]</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:dosage/f:dose\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:dosage/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:dosage/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:dosage/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:dosage/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:eventHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:eventHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:eventHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicationDispense</sch:title>\n    <sch:rule context=\"f:MedicationDispense\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(exists(f:whenHandedOver/@value)) or not(exists(f:whenPrepared/@value)) or ( f:whenHandedOver/@value &gt;= f:whenPrepared/@value)\">mdd-1: whenHandedOver cannot be before whenPrepared</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:statusReasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:statusReasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:statusReasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:medicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:medicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:medicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:context\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:context/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:context/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:supportingInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:supportingInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:supportingInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:performer/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:performer/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:performer/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:authorizingPrescription\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:authorizingPrescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:authorizingPrescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:daysSupply\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:destination\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:destination/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:destination/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:receiver\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:receiver/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:receiver/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:timing/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:timing/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:timing/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:timing/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:timing/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:timing/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:doseRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:doseRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:doseRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:doseQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:maxDosePerPeriod\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:maxDosePerPeriod/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:maxDosePerPeriod/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:maxDosePerAdministration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:maxDosePerLifetime\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:substitution/f:responsibleParty\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:substitution/f:responsibleParty/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:substitution/f:responsibleParty/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:detectedIssue\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:detectedIssue/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:detectedIssue/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:eventHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:eventHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:eventHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicationKnowledge</sch:title>\n    <sch:rule context=\"f:MedicationKnowledge\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:amount\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:relatedMedicationKnowledge/f:reference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:relatedMedicationKnowledge/f:reference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:relatedMedicationKnowledge/f:reference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:associatedMedication\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:associatedMedication/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:associatedMedication/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:monograph/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:monograph/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:monograph/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:ingredient/f:itemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:ingredient/f:itemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:ingredient/f:itemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:ingredient/f:strength\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:ingredient/f:strength/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:ingredient/f:strength/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:timing/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:timing/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:timing/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:timing/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:timing/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:timing/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:doseRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:doseRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:doseRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:doseQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:maxDosePerPeriod\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:maxDosePerPeriod/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:maxDosePerPeriod/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:maxDosePerAdministration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:maxDosePerLifetime\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:indicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:indicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:indicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:patientCharacteristics/f:characteristicQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:packaging/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:drugCharacteristic/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:contraindication\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:contraindication/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:contraindication/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:regulatory/f:regulatoryAuthority\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:regulatory/f:regulatoryAuthority/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:regulatory/f:regulatoryAuthority/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:regulatory/f:maxDispense/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:regulatory/f:maxDispense/f:period\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:kinetics/f:areaUnderCurve\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:kinetics/f:lethalDose50\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:kinetics/f:halfLifePeriod\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicationRequest</sch:title>\n    <sch:rule context=\"f:MedicationRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:reportedReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:reportedReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:reportedReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:medicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:medicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:medicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:supportingInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:supportingInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:supportingInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:requester\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:requester/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:requester/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:recorder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:recorder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:recorder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:groupIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:groupIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:insurance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:insurance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:insurance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:timing/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:timing/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:timing/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:timing/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:timing/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:timing/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:doseRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:doseRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:doseRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:doseQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:maxDosePerPeriod\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:maxDosePerPeriod/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:maxDosePerPeriod/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:maxDosePerAdministration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:maxDosePerLifetime\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:initialFill/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:initialFill/f:duration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:dispenseInterval\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:validityPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:expectedSupplyDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:performer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:priorPrescription\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:priorPrescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:priorPrescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:detectedIssue\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:detectedIssue/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:detectedIssue/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:eventHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:eventHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:eventHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicationStatement</sch:title>\n    <sch:rule context=\"f:MedicationStatement\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:medicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:medicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:medicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:context\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:context/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:context/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:informationSource\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:informationSource/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:informationSource/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:derivedFrom\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:derivedFrom/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:derivedFrom/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:timing/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:timing/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:timing/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:timing/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:timing/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:timing/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:doseRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:doseRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:doseRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:doseQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:maxDosePerPeriod\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:maxDosePerPeriod/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:maxDosePerPeriod/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:maxDosePerAdministration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:maxDosePerLifetime\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProduct</sch:title>\n    <sch:rule context=\"f:MedicinalProduct\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:marketingStatus/f:dateRange\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:pharmaceuticalProduct\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:pharmaceuticalProduct/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:pharmaceuticalProduct/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:packagedMedicinalProduct\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:packagedMedicinalProduct/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:packagedMedicinalProduct/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:attachedDocument\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:attachedDocument/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:attachedDocument/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:masterFile\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:masterFile/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:masterFile/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:contact\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:contact/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:contact/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:clinicalTrial\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:clinicalTrial/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:clinicalTrial/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:crossReference/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:crossReference/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:authorisationReferenceNumber/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:authorisationReferenceNumber/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:regulator\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:regulator/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:regulator/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:specialDesignation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:specialDesignation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:specialDesignation/f:indicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:specialDesignation/f:indicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:specialDesignation/f:indicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductAuthorization</sch:title>\n    <sch:rule context=\"f:MedicinalProductAuthorization\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:validityPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:dataExclusivityPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:jurisdictionalAuthorization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:jurisdictionalAuthorization/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:jurisdictionalAuthorization/f:validityPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:holder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:holder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:holder/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:regulator\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:regulator/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:regulator/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductContraindication</sch:title>\n    <sch:rule context=\"f:MedicinalProductContraindication\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:therapeuticIndication\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:therapeuticIndication/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:therapeuticIndication/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:otherTherapy/f:medicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:otherTherapy/f:medicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:otherTherapy/f:medicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:population/f:ageRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:population/f:ageRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:population/f:ageRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductIndication</sch:title>\n    <sch:rule context=\"f:MedicinalProductIndication\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:duration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:otherTherapy/f:medicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:otherTherapy/f:medicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:otherTherapy/f:medicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:undesirableEffect\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:undesirableEffect/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:undesirableEffect/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:population/f:ageRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:population/f:ageRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:population/f:ageRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductIngredient</sch:title>\n    <sch:rule context=\"f:MedicinalProductIngredient\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:presentation\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:presentation/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:presentation/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:presentationLowLimit\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:presentationLowLimit/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:presentationLowLimit/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:concentration\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:concentration/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:concentration/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:concentrationLowLimit\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:concentrationLowLimit/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:concentrationLowLimit/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:referenceStrength/f:strength\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:referenceStrength/f:strength/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:referenceStrength/f:strength/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:referenceStrength/f:strengthLowLimit\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:referenceStrength/f:strengthLowLimit/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:referenceStrength/f:strengthLowLimit/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductInteraction</sch:title>\n    <sch:rule context=\"f:MedicinalProductInteraction\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:interactant/f:itemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:interactant/f:itemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:interactant/f:itemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductManufactured</sch:title>\n    <sch:rule context=\"f:MedicinalProductManufactured\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:ingredient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:ingredient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:ingredient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:height\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:width\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:depth\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:weight\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:nominalVolume\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:externalDiameter\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:image\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductPackaged</sch:title>\n    <sch:rule context=\"f:MedicinalProductPackaged\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:marketingStatus/f:dateRange\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:marketingAuthorization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:marketingAuthorization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:marketingAuthorization/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:batchIdentifier/f:outerPackaging/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:batchIdentifier/f:outerPackaging/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:batchIdentifier/f:immediatePackaging/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:batchIdentifier/f:immediatePackaging/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductPharmaceutical</sch:title>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:ingredient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:ingredient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:ingredient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:device\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:firstDose\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:maxSingleDose\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:maxDosePerDay\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:maxDosePerTreatmentPeriod\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:maxDosePerTreatmentPeriod/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:maxDosePerTreatmentPeriod/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:maxTreatmentPeriod\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:targetSpecies/f:withdrawalPeriod/f:value\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductUndesirableEffect</sch:title>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:population/f:ageRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:population/f:ageRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:population/f:ageRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MessageDefinition</sch:title>\n    <sch:rule context=\"f:MessageDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:focus\">\n      <sch:assert test=\"f:max/@value='*' or number(f:max/@value) &gt; 0\">md-1: Max must be postive int or *</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MessageHeader</sch:title>\n    <sch:rule context=\"f:MessageHeader\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:destination/f:target\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:destination/f:target/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:destination/f:target/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:destination/f:receiver\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:destination/f:receiver/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:destination/f:receiver/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:sender\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:sender/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:sender/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:enterer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:enterer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:enterer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:source/f:contact\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:source/f:contact/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:responsible\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:responsible/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:responsible/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:response/f:details\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:response/f:details/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:response/f:details/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:focus\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:focus/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:focus/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MolecularSequence</sch:title>\n    <sch:rule context=\"f:MolecularSequence\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(f:coordinateSystem[@value=0 and @value=1]) = 1\">msq-3: Only 0 and 1 are valid for coordinateSystem</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:specimen\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:specimen/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:specimen/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:device\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:performer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:referenceSeq\">\n      <sch:assert test=\"count(f:genomeBuild)+count(f:referenceSeqId)+count(f:referenceSeqPointer)+count(f:referenceSeqString)=1\">msq-6: Have and only have one of the following elements in referenceSeq : 1. genomeBuild ; 2 referenceSeqId; 3. referenceSeqPointer;  4. referenceSeqString;</sch:assert>\n      <sch:assert test=\"(exists(f:chromosome) and exists(f:genomeBuild)) or (not(exists(f:chromosome)) and not(exists(f:genomeBuild)))\">msq-5: GenomeBuild and chromosome must be both contained if either one of them is contained</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:referenceSeq/f:referenceSeqPointer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:referenceSeq/f:referenceSeqPointer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:referenceSeq/f:referenceSeqPointer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:variant/f:variantPointer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:variant/f:variantPointer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:variant/f:variantPointer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:quality/f:score\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:pointer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:pointer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:pointer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>NamingSystem</sch:title>\n    <sch:rule context=\"f:NamingSystem\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='root' and f:uniqueId/f:type/@value='uuid')\">nsd-1: Root systems cannot have uuid identifiers</sch:assert>\n      <sch:assert test=\"not(exists(for $type in distinct-values(f:uniqueId/f:type/@value) return if (count(f:uniqueId[f:type/@value=$type and f:preferred/@value=true()])&gt;1) then $type else ()))\">nsd-2: Can't have more than one preferred identifier for a type</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:uniqueId/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>NutritionOrder</sch:title>\n    <sch:rule context=\"f:NutritionOrder\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:orderer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:orderer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:orderer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:allergyIntolerance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:allergyIntolerance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:allergyIntolerance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:schedule/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:schedule/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:schedule/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:schedule/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:schedule/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:schedule/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:nutrient/f:amount\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:schedule/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:schedule/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:schedule/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:schedule/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:schedule/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:schedule/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:caloricDensity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:schedule/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:schedule/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:schedule/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:schedule/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:schedule/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:schedule/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:maxVolumeToDeliver\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Observation</sch:title>\n    <sch:rule context=\"f:Observation\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(f:*[starts-with(local-name(.), 'value')] and (for $coding in f:code/f:coding return f:component/f:code/f:coding[f:code/@value=$coding/f:code/@value] [f:system/@value=$coding/f:system/@value]))\">obs-7: If Observation.code is the same as an Observation.component.code then the value element associated with the code SHALL NOT be present</sch:assert>\n      <sch:assert test=\"not(exists(f:dataAbsentReason)) or (not(exists(*[starts-with(local-name(.), 'value')])))\">obs-6: dataAbsentReason SHALL only be present if Observation.value[x] is not present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:focus\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:focus/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:focus/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectiveTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectiveTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectiveTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectiveTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectiveTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectiveTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueSampledData/f:origin\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:specimen\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:specimen/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:specimen/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:device\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:referenceRange\">\n      <sch:assert test=\"(exists(f:low) or exists(f:high)or exists(f:text))\">obs-3: Must have at least a low or a high or text</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:referenceRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:referenceRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:referenceRange/f:age\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:referenceRange/f:age/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:referenceRange/f:age/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:hasMember\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:hasMember/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:hasMember/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:derivedFrom\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:derivedFrom/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:derivedFrom/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueSampledData/f:origin\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ObservationDefinition</sch:title>\n    <sch:rule context=\"f:ObservationDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:range\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:range/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:range/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:age\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:age/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:age/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:gestationalAge\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:gestationalAge/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:gestationalAge/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:validCodedValueSet\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:validCodedValueSet/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:validCodedValueSet/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:normalCodedValueSet\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:normalCodedValueSet/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:normalCodedValueSet/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:abnormalCodedValueSet\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:abnormalCodedValueSet/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:abnormalCodedValueSet/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:criticalCodedValueSet\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:criticalCodedValueSet/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:criticalCodedValueSet/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>OperationDefinition</sch:title>\n    <sch:rule context=\"f:OperationDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition//f:parameter\">\n      <sch:assert test=\"exists(f:type) or exists(f:part)\">opd-1: Either a type must be provided, or parts</sch:assert>\n      <sch:assert test=\"not(exists(f:searchType)) or (f:type/@value = 'string')\">opd-2: A search type can only be specified for parameters of type string</sch:assert>\n      <sch:assert test=\"not(exists(f:targetProfile)) or ((f:type/@value = 'Reference') or (f:type/@value = 'canonical'))\">opd-3: A targetProfile can only be specified for parameters of type Reference or Canonical</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>OperationOutcome</sch:title>\n    <sch:rule context=\"f:OperationOutcome\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationOutcome/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Organization</sch:title>\n    <sch:rule context=\"f:Organization\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(f:identifier | f:name) &gt; 0\">org-1: The organization SHALL at least have a name or an identifier, and possibly more than one</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:telecom\">\n      <sch:assert test=\"count(f:use[@value='home']) = 0\">org-3: The telecom of an organization can never be of use 'home'</sch:assert>\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:address\">\n      <sch:assert test=\"count(f:use[@value='home']) = 0\">org-2: An address of an organization can never be of use 'home'</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:partOf/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:contact/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:contact/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>OrganizationAffiliation</sch:title>\n    <sch:rule context=\"f:OrganizationAffiliation\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:organization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:organization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:participatingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:participatingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:participatingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:network\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:network/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:network/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:healthcareService\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:healthcareService/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:healthcareService/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Patient</sch:title>\n    <sch:rule context=\"f:Patient\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:photo\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact\">\n      <sch:assert test=\"exists(f:name) or exists(f:telecom) or exists(f:address) or exists(f:organization)\">pat-1: SHALL at least contain a contact's details or a reference to an organization</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:organization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:organization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:generalPractitioner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:generalPractitioner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:generalPractitioner/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:managingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:managingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:managingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:link/f:other\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:link/f:other/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:link/f:other/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>PaymentNotice</sch:title>\n    <sch:rule context=\"f:PaymentNotice\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:response\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:response/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:response/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:payment\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:payment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:payment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:payee\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:payee/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:payee/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:recipient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:recipient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:recipient/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>PaymentReconciliation</sch:title>\n    <sch:rule context=\"f:PaymentReconciliation\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:paymentIssuer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:paymentIssuer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:paymentIssuer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:requestor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:requestor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:requestor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:paymentIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:paymentIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:predecessor/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:predecessor/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:submitter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:submitter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:submitter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:response\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:response/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:response/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:responsible\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:responsible/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:responsible/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:payee\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:payee/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:payee/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Person</sch:title>\n    <sch:rule context=\"f:Person\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:photo\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:managingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:managingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:managingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:link/f:target\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:link/f:target/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:link/f:target/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>PlanDefinition</sch:title>\n    <sch:rule context=\"f:PlanDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:goal/f:documentation/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:goal/f:target/f:detailQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:goal/f:target/f:detailRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:goal/f:target/f:detailRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:goal/f:target/f:detailRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:goal/f:target/f:due\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Practitioner</sch:title>\n    <sch:rule context=\"f:Practitioner\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:photo\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:qualification/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:qualification/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:qualification/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:qualification/f:issuer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:qualification/f:issuer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:qualification/f:issuer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>PractitionerRole</sch:title>\n    <sch:rule context=\"f:PractitionerRole\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:practitioner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:practitioner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:practitioner/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:organization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:organization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:healthcareService\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:healthcareService/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:healthcareService/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:notAvailable/f:during\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Procedure</sch:title>\n    <sch:rule context=\"f:Procedure\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performedAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performedRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performedRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performedRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:recorder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:recorder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:recorder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:asserter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:asserter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:asserter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performer/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performer/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performer/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performer/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performer/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performer/f:onBehalfOf/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:report\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:report/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:report/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:complicationDetail\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:complicationDetail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:complicationDetail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:focalDevice/f:manipulated\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:focalDevice/f:manipulated/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:focalDevice/f:manipulated/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:usedReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:usedReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:usedReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Provenance</sch:title>\n    <sch:rule context=\"f:Provenance\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:target\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:target/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:target/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:occurredPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:agent/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:agent/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:agent/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:agent/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:agent/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:agent/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:entity/f:what\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:entity/f:what/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:entity/f:what/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:signature/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:signature/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:signature/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:signature/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:signature/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:signature/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Questionnaire</sch:title>\n    <sch:rule context=\"f:Questionnaire\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(descendant::f:linkId/@value)=count(distinct-values(descendant::f:linkId/@value))\">que-2: The link ids for groups and questions must be unique within the questionnaire</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire//f:item\">\n      <sch:assert test=\"not(f:type/@value=('group', 'display') and f:*[starts-with(local-name(.), 'initial')])\">que-9: Read-only can't be specified for &quot;display&quot; items</sch:assert>\n      <sch:assert test=\"not(f:type/@value=('group', 'display') and f:*[starts-with(local-name(.), 'initial')])\">que-8: Initial values can't be specified for groups or display items</sch:assert>\n      <sch:assert test=\"not(f:type/@value='display' and (f:required or f:repeats))\">que-6: Required and repeat aren't permitted for display items</sch:assert>\n      <sch:assert test=\"f:type/@value=('choice','open-choice','decimal','integer','date','dateTime','time','string','quantity',') or not(f:answerOption or f:answerValueSet)\">que-5: Only 'choice' and 'open-choice' items can have answerValueSet</sch:assert>\n      <sch:assert test=\"not(f:answerValueSet and f:answerOption)\">que-4: A question cannot have both answerOption and answerValueSet</sch:assert>\n      <sch:assert test=\"not(f:type/@value='display' and f:code)\">que-3: Display items cannot have a &quot;code&quot; asserted</sch:assert>\n      <sch:assert test=\"f:type/@value=('boolean', 'decimal', 'integer', 'open-choice', 'string', 'text', 'url') or not(f:maxLength)\">que-10: Maximum length can only be declared for simple question types</sch:assert>\n      <sch:assert test=\"not((f:type/@value='group' and not(f:item)) or (f:type/@value='display' and f:item))\">que-1: Group items must have nested items, display items cannot have nested items</sch:assert>\n      <sch:assert test=\"f:repeats/@value='true' or count(f:initial)&lt;=1\">que-13: Can only have multiple initial values for repeating items</sch:assert>\n      <sch:assert test=\"not(f:answerOption) or not(count(f:*[starts-with(local-name(.), 'initial')]))\">que-11: If one or more answerOption is present, initial[x] must be missing</sch:assert>\n      <sch:assert test=\"not(f:answerOption) or not(count(f:*[starts-with(local-name(.), 'initial')]))\">que-12: If there are more than one enableWhen, enableBehavior must be specified</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>QuestionnaireResponse</sch:title>\n    <sch:rule context=\"f:QuestionnaireResponse\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse//f:item\">\n      <sch:assert test=\"not(exists(f:answer) and exists(f:item))\">qrs-1: Nested item can't be beneath both item and answer</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>RelatedPerson</sch:title>\n    <sch:rule context=\"f:RelatedPerson\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:photo\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>RequestGroup</sch:title>\n    <sch:rule context=\"f:RequestGroup\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:replaces\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:replaces/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:replaces/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:groupIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:groupIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup//f:action\">\n      <sch:assert test=\"exists(f:resource) != exists(f:action)\">rqg-1: Must have resource or action but not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ResearchDefinition</sch:title>\n    <sch:rule context=\"f:ResearchDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:population\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:population/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:population/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:exposure\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:exposure/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:exposure/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:exposureAlternative\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:exposureAlternative/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:exposureAlternative/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:outcome\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:outcome/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:outcome/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ResearchElementDefinition</sch:title>\n    <sch:rule context=\"f:ResearchElementDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionExpression\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:codeFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-1: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:dateFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-2: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:dateFilter/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:dateFilter/f:valueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTimeFromStart\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTimeFromStart\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ResearchStudy</sch:title>\n    <sch:rule context=\"f:ResearchStudy\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:protocol\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:protocol/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:protocol/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:enrollment\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:enrollment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:enrollment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:sponsor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:sponsor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:sponsor/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:principalInvestigator\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:principalInvestigator/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:principalInvestigator/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:site\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:site/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:site/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ResearchSubject</sch:title>\n    <sch:rule context=\"f:ResearchSubject\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:study\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:study/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:study/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:individual\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:individual/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:individual/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:consent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:consent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:consent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>RiskAssessment</sch:title>\n    <sch:rule context=\"f:RiskAssessment\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:parent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:parent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:parent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:condition\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:condition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:condition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:basis\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:basis/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:basis/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction\">\n      <sch:assert test=\"not(f:probabilityDecimal) or f:probabilityDecimal/@value &lt;= 100\">ras-2: Must be &lt;= 100</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:probabilityRange\">\n      <sch:assert test=\"(not(f:low) or f:low[f:code/@value='%' and f:system/@value='http://unitsofmeasure.org']) and (not(f:high) or f:high[f:code/@value='%' and f:system/@value='http://unitsofmeasure.org'])\">ras-1: low and high must be percentages, if present</sch:assert>\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:probabilityRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:probabilityRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:whenPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:whenRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:whenRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:whenRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>RiskEvidenceSynthesis</sch:title>\n    <sch:rule context=\"f:RiskEvidenceSynthesis\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:population\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:population/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:population/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:exposure\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:exposure/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:exposure/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:outcome\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:outcome/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:outcome/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:certainty/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:certainty/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:certainty/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:certainty/f:certaintySubcomponent/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:certainty/f:certaintySubcomponent/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:certainty/f:certaintySubcomponent/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Schedule</sch:title>\n    <sch:rule context=\"f:Schedule\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:planningHorizon\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SearchParameter</sch:title>\n    <sch:rule context=\"f:SearchParameter\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(exists(f:xpath)) or exists(f:xpathUsage)\">spd-1: If an xpath is present, there SHALL be an xpathUsage</sch:assert>\n      <sch:assert test=\"not(exists(f:chain)) or (f:type/@value = 'reference')\">spd-2: Search parameters can only have chain names when the search parameter type is 'reference'</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ServiceRequest</sch:title>\n    <sch:rule context=\"f:ServiceRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"exists(f:code) or not(exists(f:orderDetail))\">prr-1: orderDetail SHALL only be present if code is present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:replaces\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:replaces/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:replaces/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:requisition/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:requisition/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrenceTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrenceTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrenceTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrenceTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrenceTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrenceTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:requester\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:requester/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:requester/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:insurance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:insurance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:insurance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:supportingInfo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:supportingInfo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:supportingInfo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:specimen\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:specimen/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:specimen/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:relevantHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:relevantHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:relevantHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Slot</sch:title>\n    <sch:rule context=\"f:Slot\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Slot/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Slot/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Slot/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Slot/f:schedule\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Slot/f:schedule/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Slot/f:schedule/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Specimen</sch:title>\n    <sch:rule context=\"f:Specimen\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:accessionIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:accessionIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:parent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:parent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:parent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:collector\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:collector/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:collector/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:collectedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:duration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:fastingStatusDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:processing/f:additive\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:processing/f:additive/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:processing/f:additive/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:processing/f:timePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:capacity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:specimenQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:additiveReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:additiveReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:additiveReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SpecimenDefinition</sch:title>\n    <sch:rule context=\"f:SpecimenDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:container/f:capacity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:container/f:minimumVolumeQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:container/f:additive/f:additiveReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:container/f:additive/f:additiveReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:container/f:additive/f:additiveReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:retentionTime\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:handling/f:temperatureRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:handling/f:temperatureRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:handling/f:temperatureRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:handling/f:maxDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>StructureDefinition</sch:title>\n    <sch:rule context=\"f:StructureDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(exists(f:snapshot/f:element[not(contains(f:path/@value, '.')) and (f:label or f:code or f:requirements)])) and not(exists(f:differential/f:element[not(contains(f:path/@value, '.')) and (f:label or f:code or f:requirements)]))\">sdf-9: In any snapshot or differential, no label, code or requirements on an element without a &quot;.&quot; in the path (e.g. the first element)</sch:assert>\n      <sch:assert test=\"f:kind/@value='logical' or not(f:differential/f:element[1][not(contains(f:path/@value, '.'))]/f:type)\">sdf-15a: If the first element in a differential has no &quot;.&quot; in the path and it's not a logical model, it has no type</sch:assert>\n      <sch:assert test=\"not(starts-with(f:url/@value, 'http://hl7.org/fhir/StructureDefinition')) or count(f:differential/f:element/f:type/f:code[@value and not(matches(string(@value), '^[a-zA-Z0-9\\.]+$'))]|f:snapshot/f:element/f:type/f:code[@value and not(matches(string(@value), '^[a-zA-Z0-9]+$\\.'))]) =0\">sdf-19: FHIR Specification models only use FHIR defined types</sch:assert>\n      <sch:assert test=\"count(f:snapshot/f:element)=count(f:snapshot/f:element/@id) and (count(f:snapshot/f:element)=count(distinct-values(f:snapshot/f:element/@id)))\">sdf-16: All element definitions must have unique ids (snapshot)</sch:assert>\n      <sch:assert test=\"f:kind/@value='logical' or not(f:snapshot/f:element[1]/f:type)\">sdf-15: The first element in a snapshot has no type unless model is a logical model.</sch:assert>\n      <sch:assert test=\"not(exists(f:contextInvariant)) or (f:type/@value = 'Extension')\">sdf-18: Context Invariants can only be used for extensions</sch:assert>\n      <sch:assert test=\"count(f:differential/f:element)=count(f:differential/f:element/@id) and (count(f:differential/f:element)=count(distinct-values(f:differential/f:element/@id)))\">sdf-17: All element definitions must have unique ids (diff)</sch:assert>\n      <sch:assert test=\"count(*[self::snapshot or self::differential]/f:element[not(contains(f:path/@value, '.')) and f:sliceName])=0\">sdf-23: No slice name on root</sch:assert>\n      <sch:assert test=\"(f:kind/@value = 'logical') or not(exists(f:snapshot)) or (f:type/@value = f:snapshot/f:element[1]/f:path/@value)\">sdf-11: If there's a type, its content must match the path name in the first element of a snapshot</sch:assert>\n      <sch:assert test=\"not(starts-with(f:url/@value, 'http://hl7.org/fhir/StructureDefinition')) or (not(exists(f:snapshot/f:element/*[starts-with(local-name(), 'defaultValue')])) and not(exists(f:differential/f:element/*[starts-with(local-name(), 'defaultValue')])))\">sdf-22: FHIR Specification models never have default values</sch:assert>\n      <sch:assert test=\"count(*/f:element)=count(*/f:element/@id)\">sdf-14: All element definitions must have an id</sch:assert>\n      <sch:assert test=\"(f:derivation/@value = 'constraint') or (count(f:snapshot/f:element) = count(distinct-values(f:snapshot/f:element/f:path/@value)))\">sdf-1: Element paths must be unique unless the structure is a constraint</sch:assert>\n      <sch:assert test=\"not(exists(f:differential/f:element/*[starts-with(local-name(), 'defaultValue')])) or (f:derivation/@value = 'specialization')\">sdf-21: Default values can only be specified on specializations</sch:assert>\n      <sch:assert test=\"exists(f:snapshot) or exists(f:differential)\">sdf-6: A structure must have either a differential, or a snapshot (or both)</sch:assert>\n      <sch:assert test=\"not(f:type/@value = 'extension') or (f:derivation/@value = 'specialization') or (exists(f:context))\">sdf-5: If the structure defines an extension then the structure must have context information</sch:assert>\n      <sch:assert test=\"(f:abstract/@value=true()) or exists(f:baseDefinition)\">sdf-4: If the structure is not abstract, then there SHALL be a baseDefinition</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:mapping\">\n      <sch:assert test=\"exists(f:uri) or exists(f:name)\">sdf-2: Must have at least a name or a uri (or both)</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot\">\n      <sch:assert test=\"f:element[1]/f:path/@value=parent::f:StructureDefinition/f:type/@value and count(f:element[position()!=1])=count(f:element[position()!=1][starts-with(f:path/@value, concat(ancestor::f:StructureDefinition/f:type/@value, '.'))])\">sdf-8: All snapshot elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models</sch:assert>\n      <sch:assert test=\"count(f:element) = count(f:element[exists(f:definition) and exists(f:min) and exists(f:max)])\">sdf-3: Each element definition in a snapshot must have a formal definition and cardinalities</sch:assert>\n      <sch:assert test=\"count(f:element) = count(f:element/f:base)\">sdf-8b: All snapshot elements must have a base definition</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element\">\n      <sch:assert test=\"not(exists(f:binding)) or exists(f:binding/f:valueSet) or exists(f:binding/f:description)\">sdf-10: provide either a binding reference or a description (or both)</sch:assert>\n      <sch:assert test=\"matches(path/@value, '[^\\s\\.,:;\\'&amp;quot;\\/|?!@#$%&amp;amp;*()\\[\\]{}]{1,64}(\\.[^\\s\\.,:;\\'&amp;quot;\\/|?!@#$%&amp;amp;*()\\[\\]{}]{1,64}(\\[x\\])?(\\:[^\\s\\.]+)?)*')\">eld-19: Element names cannot include some special characters</sch:assert>\n      <sch:assert test=\"not(exists(f:min)) or not(exists(f:max)) or (not(f:max/@value) and not(f:min/@value)) or (f:max/@value = '*') or (number(f:max/@value) &gt;= f:min/@value)\">eld-2: Min &lt;= Max</sch:assert>\n      <sch:assert test=\"not(exists(f:contentReference) and (exists(f:type) or exists(f:*[starts-with(local-name(.), 'value')]) or exists(f:*[starts-with(local-name(.), 'defaultValue')])  or exists(f:*[starts-with(local-name(.), 'fixed')]) or exists(f:*[starts-with(local-name(.), 'pattern')]) or exists(f:*[starts-with(local-name(.), 'example')]) or exists(f:*[starts-with(local-name(.), 'f:minValue')]) or exists(f:*[starts-with(local-name(.), 'f:maxValue')]) or exists(f:maxLength) or exists(f:binding)))\">eld-5: if the element definition has a contentReference, it cannot have type, defaultValue, fixed, pattern, example, minValue, maxValue, maxLength, or binding</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'pattern')])) or (count(f:type)&lt;=1)\">eld-7: Pattern may only be specified if there is one type</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'fixed')])) or (count(f:type)&lt;=1)\">eld-6: Fixed value may only be specified if there is one type</sch:assert>\n      <sch:assert test=\"not(exists(f:binding)) or (count(f:type/f:code) = 0) or  f:type/f:code/@value=('code','Coding','CodeableConcept','Quantity','string', 'uri')\">eld-11: Binding can only be present for coded elements, string, and uri</sch:assert>\n      <sch:assert test=\"exists(f:sliceName) or not(exists(f:sliceIsConstraining))\">eld-22: sliceIsConstraining can only appear if slicename is present</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'pattern')])) or not(exists(f:*[starts-with(local-name(.), 'fixed')]))\">eld-8: Pattern and fixed are mutually exclusive</sch:assert>\n      <sch:assert test=\"count(f:constraint) = count(distinct-values(f:constraint/f:key/@value))\">eld-14: Constraints must be unique by key</sch:assert>\n      <sch:assert test=\"not(exists(for $type in f:type return $type/preceding-sibling::f:type[f:code/@value=$type/f:code/@value]))\">eld-13: Types must be unique by code</sch:assert>\n      <sch:assert test=\"not(exists(f:sliceName/@value)) or matches(f:sliceName/@value, '^[a-zA-Z0-9\\/\\-_\\[\\]\\@]+$')\">eld-16: sliceName must be composed of proper tokens separated by &quot;/&quot;</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'fixed')])) or not(exists(f:meaningWhenMissing))\">eld-15: default value and meaningWhenMissing are mutually exclusive</sch:assert>\n      <sch:assert test=\"not(f:isModifier/@value = 'true') or exists(f:isModifierReason)\">eld-18: Must have a modifier reason if isModifier = true</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element/f:slicing\">\n      <sch:assert test=\"(f:discriminator) or (f:description)\">eld-1: If there are no discriminators, there must be a definition</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element/f:max\">\n      <sch:assert test=\"@value='*' or (normalize-space(@value)!='' and normalize-space(translate(@value, '0123456789',''))='')\">eld-3: Max SHALL be a number or &quot;*&quot;</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element/f:type\">\n      <sch:assert test=\"not(exists(f:aggregation)) or exists(f:code[@value = 'Reference']) or exists(f:code[@value = 'canonical'])\">eld-4: Aggregation may only be specified if one of the allowed types for the element is a reference</sch:assert>\n      <sch:assert test=\"not(exists(f:targetProfile)) or (f:code/@value = 'Reference')\">eld-17: targetProfile is only allowed if the type is Reference or canonical</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element/f:minValueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element/f:maxValueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element/f:binding\">\n      <sch:assert test=\"(starts-with(string(f:valueSet/@value), 'http:') or starts-with(string(f:valueSet/@value), 'https:') or starts-with(string(f:valueSet/@value), 'urn:'))\">eld-12: ValueSet SHALL start with http:// or https:// or urn:</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential\">\n      <sch:assert test=\"not(f:element[1]/f:slicing)\">sdf-20: No slicing on the root element</sch:assert>\n      <sch:assert test=\"count(f:element)=count(f:element[f:path/@value=ancestor::f:StructureDefinition/f:type/@value or starts-with(f:path/@value, concat(ancestor::f:StructureDefinition/f:type/@value, '.'))])\">sdf-8a: In any differential, all the elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element\">\n      <sch:assert test=\"matches(path/@value, '[^\\s\\.,:;\\'&amp;quot;\\/|?!@#$%&amp;amp;*()\\[\\]{}]{1,64}(\\.[^\\s\\.,:;\\'&amp;quot;\\/|?!@#$%&amp;amp;*()\\[\\]{}]{1,64}(\\[x\\])?(\\:[^\\s\\.]+)?)*')\">eld-19: Element names cannot include some special characters</sch:assert>\n      <sch:assert test=\"not(exists(f:min)) or not(exists(f:max)) or (not(f:max/@value) and not(f:min/@value)) or (f:max/@value = '*') or (number(f:max/@value) &gt;= f:min/@value)\">eld-2: Min &lt;= Max</sch:assert>\n      <sch:assert test=\"not(exists(f:contentReference) and (exists(f:type) or exists(f:*[starts-with(local-name(.), 'value')]) or exists(f:*[starts-with(local-name(.), 'defaultValue')])  or exists(f:*[starts-with(local-name(.), 'fixed')]) or exists(f:*[starts-with(local-name(.), 'pattern')]) or exists(f:*[starts-with(local-name(.), 'example')]) or exists(f:*[starts-with(local-name(.), 'f:minValue')]) or exists(f:*[starts-with(local-name(.), 'f:maxValue')]) or exists(f:maxLength) or exists(f:binding)))\">eld-5: if the element definition has a contentReference, it cannot have type, defaultValue, fixed, pattern, example, minValue, maxValue, maxLength, or binding</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'pattern')])) or (count(f:type)&lt;=1)\">eld-7: Pattern may only be specified if there is one type</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'fixed')])) or (count(f:type)&lt;=1)\">eld-6: Fixed value may only be specified if there is one type</sch:assert>\n      <sch:assert test=\"not(exists(f:binding)) or (count(f:type/f:code) = 0) or  f:type/f:code/@value=('code','Coding','CodeableConcept','Quantity','string', 'uri')\">eld-11: Binding can only be present for coded elements, string, and uri</sch:assert>\n      <sch:assert test=\"exists(f:sliceName) or not(exists(f:sliceIsConstraining))\">eld-22: sliceIsConstraining can only appear if slicename is present</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'pattern')])) or not(exists(f:*[starts-with(local-name(.), 'fixed')]))\">eld-8: Pattern and fixed are mutually exclusive</sch:assert>\n      <sch:assert test=\"count(f:constraint) = count(distinct-values(f:constraint/f:key/@value))\">eld-14: Constraints must be unique by key</sch:assert>\n      <sch:assert test=\"not(exists(for $type in f:type return $type/preceding-sibling::f:type[f:code/@value=$type/f:code/@value]))\">eld-13: Types must be unique by code</sch:assert>\n      <sch:assert test=\"not(exists(f:sliceName/@value)) or matches(f:sliceName/@value, '^[a-zA-Z0-9\\/\\-_\\[\\]\\@]+$')\">eld-16: sliceName must be composed of proper tokens separated by &quot;/&quot;</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'fixed')])) or not(exists(f:meaningWhenMissing))\">eld-15: default value and meaningWhenMissing are mutually exclusive</sch:assert>\n      <sch:assert test=\"not(f:isModifier/@value = 'true') or exists(f:isModifierReason)\">eld-18: Must have a modifier reason if isModifier = true</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element/f:slicing\">\n      <sch:assert test=\"(f:discriminator) or (f:description)\">eld-1: If there are no discriminators, there must be a definition</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element/f:max\">\n      <sch:assert test=\"@value='*' or (normalize-space(@value)!='' and normalize-space(translate(@value, '0123456789',''))='')\">eld-3: Max SHALL be a number or &quot;*&quot;</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element/f:type\">\n      <sch:assert test=\"not(exists(f:aggregation)) or exists(f:code[@value = 'Reference']) or exists(f:code[@value = 'canonical'])\">eld-4: Aggregation may only be specified if one of the allowed types for the element is a reference</sch:assert>\n      <sch:assert test=\"not(exists(f:targetProfile)) or (f:code/@value = 'Reference')\">eld-17: targetProfile is only allowed if the type is Reference or canonical</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element/f:minValueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element/f:maxValueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element/f:binding\">\n      <sch:assert test=\"(starts-with(string(f:valueSet/@value), 'http:') or starts-with(string(f:valueSet/@value), 'https:') or starts-with(string(f:valueSet/@value), 'urn:'))\">eld-12: ValueSet SHALL start with http:// or https:// or urn:</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>StructureMap</sch:title>\n    <sch:rule context=\"f:StructureMap\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Subscription</sch:title>\n    <sch:rule context=\"f:Subscription\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Subscription/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Subscription/f:contact\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Subscription/f:contact/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Substance</sch:title>\n    <sch:rule context=\"f:Substance\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:instance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:instance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:instance/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:ingredient/f:quantity\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:ingredient/f:quantity/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:ingredient/f:quantity/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:ingredient/f:substanceReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:ingredient/f:substanceReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:ingredient/f:substanceReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SubstanceNucleicAcid</sch:title>\n    <sch:rule context=\"f:SubstanceNucleicAcid\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceNucleicAcid/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceNucleicAcid/f:subunit/f:sequenceAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceNucleicAcid/f:subunit/f:linkage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceNucleicAcid/f:subunit/f:linkage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceNucleicAcid/f:subunit/f:sugar/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceNucleicAcid/f:subunit/f:sugar/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SubstancePolymer</sch:title>\n    <sch:rule context=\"f:SubstancePolymer\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:monomerSet/f:startingMaterial/f:amount/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:monomerSet/f:startingMaterial/f:amount/f:amountRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:monomerSet/f:startingMaterial/f:amount/f:amountRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:monomerSet/f:startingMaterial/f:amount/f:amountRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:monomerSet/f:startingMaterial/f:amount/f:referenceRange/f:lowLimit\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:monomerSet/f:startingMaterial/f:amount/f:referenceRange/f:highLimit\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:amount/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:amount/f:amountRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:amount/f:amountRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:amount/f:amountRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:amount/f:referenceRange/f:lowLimit\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:amount/f:referenceRange/f:highLimit\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:degreeOfPolymerisation/f:amount/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:degreeOfPolymerisation/f:amount/f:amountRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:degreeOfPolymerisation/f:amount/f:amountRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:degreeOfPolymerisation/f:amount/f:amountRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:degreeOfPolymerisation/f:amount/f:referenceRange/f:lowLimit\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:degreeOfPolymerisation/f:amount/f:referenceRange/f:highLimit\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:structuralRepresentation/f:attachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SubstanceProtein</sch:title>\n    <sch:rule context=\"f:SubstanceProtein\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceProtein/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceProtein/f:subunit/f:sequenceAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceProtein/f:subunit/f:nTerminalModificationId/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceProtein/f:subunit/f:nTerminalModificationId/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceProtein/f:subunit/f:cTerminalModificationId/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceProtein/f:subunit/f:cTerminalModificationId/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SubstanceReferenceInformation</sch:title>\n    <sch:rule context=\"f:SubstanceReferenceInformation\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:gene/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:gene/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:gene/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:geneElement/f:element/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:geneElement/f:element/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:geneElement/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:geneElement/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:geneElement/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:classification/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:classification/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:classification/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:target/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:target/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:amountRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:amountRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:amountRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SubstanceSourceMaterial</sch:title>\n    <sch:rule context=\"f:SubstanceSourceMaterial\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSourceMaterial/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSourceMaterial/f:organismId/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSourceMaterial/f:organismId/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSourceMaterial/f:parentSubstanceId/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSourceMaterial/f:parentSubstanceId/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SubstanceSpecification</sch:title>\n    <sch:rule context=\"f:SubstanceSpecification\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:moiety/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:moiety/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:moiety/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:property/f:definingSubstanceReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:property/f:definingSubstanceReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:property/f:definingSubstanceReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:property/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:referenceInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:referenceInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:referenceInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:isotope/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:isotope/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:isotope/f:halfLife\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:isotope/f:molecularWeight/f:amount\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:representation/f:attachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:code/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:code/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:code/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:substanceReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:substanceReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:substanceReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRatioLowLimit\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRatioLowLimit/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRatioLowLimit/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:nucleicAcid\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:nucleicAcid/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:nucleicAcid/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:polymer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:polymer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:polymer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:protein\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:protein/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:protein/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:sourceMaterial\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:sourceMaterial/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:sourceMaterial/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SupplyDelivery</sch:title>\n    <sch:rule context=\"f:SupplyDelivery\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:suppliedItem/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:suppliedItem/f:itemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:suppliedItem/f:itemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:suppliedItem/f:itemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrenceTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrenceTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrenceTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrenceTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrenceTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrenceTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:supplier\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:supplier/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:supplier/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:destination\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:destination/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:destination/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:receiver\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:receiver/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:receiver/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SupplyRequest</sch:title>\n    <sch:rule context=\"f:SupplyRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:itemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:itemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:itemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:parameter/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:parameter/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:parameter/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:parameter/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrenceTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrenceTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrenceTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrenceTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrenceTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrenceTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:requester\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:requester/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:requester/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:supplier\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:supplier/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:supplier/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:deliverFrom\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:deliverFrom/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:deliverFrom/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:deliverTo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:deliverTo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:deliverTo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Task</sch:title>\n    <sch:rule context=\"f:Task\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(exists(f:lastModified/@value)) or not(exists(f:authoredOn/@value)) or f:lastModified/@value &gt;= f:authoredOn/@value\">inv-1: Last modified date must be greater than or equal to authored-on date.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:groupIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:groupIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:focus\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:focus/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:focus/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:for\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:for/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:for/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:executionPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:requester\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:requester/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:requester/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:owner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:owner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:owner/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:insurance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:insurance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:insurance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:relevantHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:relevantHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:relevantHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:restriction/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:restriction/f:recipient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:restriction/f:recipient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:restriction/f:recipient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>TerminologyCapabilities</sch:title>\n    <sch:rule context=\"f:TerminologyCapabilities\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='instance') or exists(f:implementation)\">tcp-3: If kind = instance, implementation must be present and software may be present</sch:assert>\n      <sch:assert test=\"count(f:software | f:implementation | f:description) &gt; 0\">tcp-2: A Capability Statement SHALL have at least one of description, software, or implementation element.</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='instance') or (not(exists(f:implementation)) and not(exists(f:software)))\">tcp-5: If kind = requirements, implementation and software must be absent</sch:assert>\n      <sch:assert test=\" not(f:kind/@value='instance') or (not(exists(f:implementation)) and exists(f:software))\">tcp-4: If kind = capability, implementation must be absent, software must be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:codeSystem\">\n      <sch:assert test=\"(count(f:version) &lt;= 1) or not(exists(f:version[not(f:code)]))\">tcp-1: If there is more than one version, a version code must be defined</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>TestReport</sch:title>\n    <sch:rule context=\"f:TestReport\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:testScript\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:testScript/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:testScript/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:setup/f:action\">\n      <sch:assert test=\"(f:operation or f:assert) and not(f:operation and f:assert)\">inv-1: Setup action SHALL contain either an operation or assert but not both.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:test/f:action\">\n      <sch:assert test=\"(f:operation or f:assert) and not(f:operation and f:assert)\">inv-2: Test action SHALL contain either an operation or assert but not both.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>TestScript</sch:title>\n    <sch:rule context=\"f:TestScript\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:metadata\">\n      <sch:assert test=\"f:capability/f:required or f:capability/f:validated or (f:capability/f:required and f:capability/f:validated)\">tst-4: TestScript metadata capability SHALL contain required or validated or both.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:fixture/f:resource\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:fixture/f:resource/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:fixture/f:resource/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:profile\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:profile/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:profile/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:variable\">\n      <sch:assert test=\"not(f:expression and f:headerField and f:path)\">tst-3: Variable can only contain one of expression, headerField or path.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:setup/f:action\">\n      <sch:assert test=\"(f:operation or f:assert) and not(f:operation and f:assert)\">tst-1: Setup action SHALL contain either an operation or assert but not both.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:setup/f:action/f:operation\">\n      <sch:assert test=\"f:sourceId or ((f:targetId or f:url or f:params) and (count(f:targetId) + count(f:url) + count(f:params) =1)) or (f:type/f:code/@value='capabilities' or f:type/f:code/@value='search' or f:type/f:code/@value='transaction' or f:type/f:code/@value='history')\">tst-7: Setup operation SHALL contain either sourceId or targetId or params or url.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:setup/f:action/f:assert\">\n      <sch:assert test=\"((count(f:response) + count(f:responseCode)) = 0 and (f:direction/@value='request')) or (count(f:direction) = 0) or (f:direction/@value='response')\">tst-12: Setup action assert response and responseCode SHALL be empty when direction equals request</sch:assert>\n      <sch:assert test=\"count(f:contentType) + count(f:expression) + count(f:headerField) + count(f:minimumId) + count(f:navigationLinks) + count(f:path) + count(f:requestMethod) + count(f:resource) + count(f:responseCode) + count(f:response) + count(f:rule) + count(f:ruleset) + count(f:validateProfileId)  &lt;=1\">tst-5: Only a single assertion SHALL be present within setup action assert element.</sch:assert>\n      <sch:assert test=\"(f:compareToSourceId and f:compareToSourceExpression) or (f:compareToSourceId and f:compareToSourcePath) or not(f:compareToSourceId or f:compareToSourceExpression or f:compareToSourcePath)\">tst-10: Setup action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:test/f:action\">\n      <sch:assert test=\"(f:operation or f:assert) and not(f:operation and f:assert)\">tst-2: Test action SHALL contain either an operation or assert but not both.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:test/f:action/f:operation\">\n      <sch:assert test=\"f:sourceId or (f:targetId or f:url or f:params) and (count(f:targetId) + count(f:url) + count(f:params) =1) or (f:type/f:code/@value='capabilities' or f:type/f:code/@value='search' or f:type/f:code/@value='transaction' or f:type/f:code/@value='history')\">tst-8: Test operation SHALL contain either sourceId or targetId or params or url.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:test/f:action/f:assert\">\n      <sch:assert test=\"(f:compareToSourceId and f:compareToSourceExpression) or (f:compareToSourceId and f:compareToSourcePath) or not(f:compareToSourceId or f:compareToSourceExpression or f:compareToSourcePath)\">tst-11: Test action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.</sch:assert>\n      <sch:assert test=\"((count(f:response) + count(f:responseCode)) = 0 and (f:direction/@value='request')) or (count(f:direction) = 0) or (f:direction/@value='response')\">tst-13: Test action assert response and response and responseCode SHALL be empty when direction equals request</sch:assert>\n      <sch:assert test=\"count(f:contentType) + count(f:expression) + count(f:headerField) + count(f:minimumId) + count(f:navigationLinks) + count(f:path) + count(f:requestMethod) + count(f:resource) + count(f:responseCode) + count(f:response) + count(f:rule) + count(f:ruleset) + count(f:validateProfileId)  &lt;=1\">tst-6: Only a single assertion SHALL be present within test action assert element.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:teardown/f:action/f:operation\">\n      <sch:assert test=\"f:sourceId or (f:targetId or f:url or (f:params and f:resource)) and (count(f:targetId) + count(f:url) + count(f:params) =1) or (f:type/f:code/@value='capabilities' or f:type/f:code/@value='search' or f:type/f:code/@value='transaction' or f:type/f:code/@value='history')\">tst-9: Teardown operation SHALL contain either sourceId or targetId or params or url.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ValueSet</sch:title>\n    <sch:rule context=\"f:ValueSet\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:compose/f:include\">\n      <sch:assert test=\"not(exists(f:concept) or exists(f:filter)) or exists(f:system)\">vsd-2: A value set with concepts or filters SHALL include a system</sch:assert>\n      <sch:assert test=\"not(exists(f:concept)) or not(exists(f:filter))\">vsd-3: Cannot have both concept and filter</sch:assert>\n      <sch:assert test=\"exists(f:valueSet) or exists(f:system)\">vsd-1: A value set include/exclude SHALL have a value set or a system</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:expansion//f:contains\">\n      <sch:assert test=\"exists(f:code) or exists(f:display)\">vsd-6: SHALL have a code or a display</sch:assert>\n      <sch:assert test=\"exists(f:code) or (f:abstract/@value = true())\">vsd-9: Must have a code if not abstract</sch:assert>\n      <sch:assert test=\"exists(f:system) or not(exists(f:code))\">vsd-10: Must have a system if a code is present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>VerificationResult</sch:title>\n    <sch:rule context=\"f:VerificationResult\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:target\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:target/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:target/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:frequency/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:frequency/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:frequency/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:frequency/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:frequency/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:frequency/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:primarySource/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:primarySource/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:primarySource/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:proxySignature/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:proxySignature/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:proxySignature/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:proxySignature/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:proxySignature/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:proxySignature/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:sourceSignature/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:sourceSignature/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:sourceSignature/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:sourceSignature/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:sourceSignature/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:sourceSignature/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:organization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:organization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:attestationSignature/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:attestationSignature/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:attestationSignature/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:attestationSignature/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:attestationSignature/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:attestationSignature/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>VisionPrescription</sch:title>\n    <sch:rule context=\"f:VisionPrescription\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:prescriber\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:prescriber/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:prescriber/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:lensSpecification/f:duration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:lensSpecification/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:lensSpecification/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:lensSpecification/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Extension: substanceExposureRisk 1</sch:title>\n    <sch:rule context=\"f:extension[@url='http://hl7.org/fhir/StructureDefinition/allergyintolerance-substanceExposureRisk']\">\n      <sch:assert test=\"exists(f:substanceExposureRisk) and not(exists(f:code))\">inv-1: If the substanceExposureRisk extension element is present, the AllergyIntolerance.code element must be omitted.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/fhir-single.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!-- \r\n  Copyright (c) 2011+, HL7, Inc.\r\n  All rights reserved.\r\n  \r\n  Redistribution and use in source and binary forms, with or without modification, \r\n  are permitted provided that the following conditions are met:\r\n  \r\n   * Redistributions of source code must retain the above copyright notice, this \r\n     list of conditions and the following disclaimer.\r\n   * Redistributions in binary form must reproduce the above copyright notice, \r\n     this list of conditions and the following disclaimer in the documentation \r\n     and/or other materials provided with the distribution.\r\n   * Neither the name of HL7 nor the names of its contributors may be used to \r\n     endorse or promote products derived from this software without specific \r\n     prior written permission.\r\n  \r\n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \r\n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \r\n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \r\n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \r\n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \r\n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \r\n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \r\n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \r\n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \r\n  POSSIBILITY OF SUCH DAMAGE.\r\n  \r\n\r\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \r\n-->\r\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"4.0.1\">\r\n  <!-- Note: When using this schema with some tools, it may also be necessary to declare xmlns:xml=\"http://www.w3.org/XML/1998/namespace\", however this causes performance issues with other tools and thus is not in the base schemas. -->\r\n  <xs:import namespace=\"http://www.w3.org/XML/1998/namespace\" schemaLocation=\"xml.xsd\"/>\r\n  <xs:import namespace=\"http://www.w3.org/1999/xhtml\" schemaLocation=\"fhir-xhtml.xsd\"/>\r\n\r\n  <xs:simpleType name=\"date-primitive\">\r\n    <xs:restriction>\r\n      <xs:simpleType>\r\n        <xs:union memberTypes=\"xs:gYear xs:gYearMonth xs:date\"/>\r\n      </xs:simpleType>\r\n      <xs:pattern value=\"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1]))?)?\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"date\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date.  Dates SHALL be valid dates.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"date-primitive\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"dateTime-primitive\">\r\n    <xs:restriction>\r\n      <xs:simpleType>\r\n        <xs:union memberTypes=\"xs:gYear xs:gYearMonth xs:date xs:dateTime\"/>\r\n      </xs:simpleType>\r\n      <xs:pattern value=\"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"dateTime\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A date, date-time or partial date (e.g. just year or year + month).  If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored.                 Dates SHALL be valid dates.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"dateTime-primitive\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"code-primitive\">\r\n    <xs:restriction base=\"xs:token\">\r\n      <xs:minLength value=\"1\"/>\r\n      <xs:pattern value=\"[^\\s]+(\\s[^\\s]+)*\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"code\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"code-primitive\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"string-primitive\">\r\n    <xs:restriction base=\"xs:string\">\r\n      <xs:minLength value=\"1\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"string\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A sequence of Unicode characters</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">Note that FHIR strings SHALL NOT exceed 1MB in size</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"string-primitive\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"integer-primitive\">\r\n    <xs:restriction base=\"xs:int\">\r\n      <xs:pattern value=\"-?([0]|([1-9][0-9]*))\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"integer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A whole number</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">32 bit number; for values larger than this, use decimal</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"integer-primitive\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"oid-primitive\">\r\n    <xs:restriction base=\"xs:anyURI\">\r\n      <xs:pattern value=\"urn:oid:[0-2](\\.(0|[1-9][0-9]*))+\"/>\r\n      <xs:minLength value=\"1\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"oid\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An OID represented as a URI</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">RFC 3001. See also ISO/IEC 8824:1990 €</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"oid-primitive\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"canonical-primitive\">\r\n    <xs:restriction base=\"xs:anyURI\">\r\n      <xs:pattern value=\"\\S*\"/>\r\n      <xs:minLength value=\"1\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"canonical\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A URI that is a reference to a canonical URL on a FHIR resource</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">see [Canonical References](references.html#canonical)</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"canonical-primitive\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"uri-primitive\">\r\n    <xs:restriction base=\"xs:anyURI\">\r\n      <xs:pattern value=\"\\S*\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"uri\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">String of characters used to identify a name or a resource</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">see http://en.wikipedia.org/wiki/Uniform_resource_identifier</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"uri-primitive\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"uuid-primitive\">\r\n    <xs:restriction base=\"xs:anyURI\">\r\n      <xs:pattern value=\"urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\"/>\r\n      <xs:minLength value=\"1\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"uuid\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A UUID, represented as a URI</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">See The Open Group, CDE 1.1 Remote Procedure Call specification, Appendix A.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"uuid-primitive\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"url-primitive\">\r\n    <xs:restriction base=\"xs:anyURI\">\r\n      <xs:pattern value=\"\\S*\"/>\r\n      <xs:minLength value=\"1\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"url\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A URI that is a literal reference</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"url-primitive\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"instant-primitive\">\r\n    <xs:restriction base=\"xs:dateTime\">\r\n      <xs:pattern value=\"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"instant\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An instant in time - known at least to the second</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">Note: This is intended for where precisely observed times are required, typically system logs etc., and not human-reported times - for them, see date and dateTime (which can be as precise as instant, but is not required to be) below. Time zone is always required</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"instant-primitive\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"boolean-primitive\">\r\n    <xs:restriction base=\"xs:boolean\">\r\n      <xs:pattern value=\"true|false\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"boolean\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Value of &quot;true&quot; or &quot;false&quot;</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"boolean-primitive\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"base64Binary-primitive\">\r\n    <xs:restriction base=\"xs:base64Binary\">\r\n      <xs:pattern value=\"(\\s*([0-9a-zA-Z\\+/=]){4}\\s*)+\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"base64Binary\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A stream of bytes</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">A stream of bytes, base64 encoded</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"base64Binary-primitive\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"unsignedInt-primitive\">\r\n    <xs:restriction base=\"xs:nonNegativeInteger\">\r\n      <xs:pattern value=\"[0]|([1-9][0-9]*)\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"unsignedInt\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An integer with a value that is not negative (e.g. &gt;= 0)</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"unsignedInt-primitive\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"markdown-primitive\">\r\n    <xs:restriction base=\"xs:string\">\r\n      <xs:minLength value=\"1\"/>\r\n      <xs:pattern value=\"[ \\r\\n\\t\\S]+\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"markdown\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A string that may contain Github Flavored Markdown syntax for optional processing by a mark down presentation engine</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">Systems are not required to have markdown support, so the text should be readable without markdown processing. The markdown syntax is GFM - see https://github.github.com/gfm/</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"markdown-primitive\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"time-primitive\">\r\n    <xs:restriction base=\"xs:time\">\r\n      <xs:pattern value=\"([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"time\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A time during the day, with no date specified</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"time-primitive\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"id-primitive\">\r\n    <xs:restriction base=\"xs:string\">\r\n      <xs:pattern value=\"[A-Za-z0-9\\-\\.]{1,64}\"/>\r\n      <xs:minLength value=\"1\"/>\r\n      <xs:maxLength value=\"64\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"id\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Any combination of letters, numerals, &quot;-&quot; and &quot;.&quot;, with a length limit of 64 characters.  (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.)  Ids are case-insensitive.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">RFC 4122</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"id-primitive\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"positiveInt-primitive\">\r\n    <xs:restriction base=\"xs:positiveInteger\">\r\n      <xs:pattern value=\"[1-9][0-9]*\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"positiveInt\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An integer with a value that is positive (e.g. &gt;0)</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"positiveInt-primitive\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"decimal-primitive\">\r\n    <xs:union memberTypes=\"xs:decimal xs:double\"/>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"decimal\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A rational number with implicit precision</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">Do not use an IEEE type floating point type, instead use something that works like a true decimal, with inbuilt precision (e.g. Java BigInteger)</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"decimal-primitive\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n\r\n  <xs:complexType name=\"ResourceContainer\">\r\n    <xs:choice>\r\n      <xs:element ref=\"Account\"/>\r\n      <xs:element ref=\"ActivityDefinition\"/>\r\n      <xs:element ref=\"AdverseEvent\"/>\r\n      <xs:element ref=\"AllergyIntolerance\"/>\r\n      <xs:element ref=\"Appointment\"/>\r\n      <xs:element ref=\"AppointmentResponse\"/>\r\n      <xs:element ref=\"AuditEvent\"/>\r\n      <xs:element ref=\"Basic\"/>\r\n      <xs:element ref=\"Binary\"/>\r\n      <xs:element ref=\"BiologicallyDerivedProduct\"/>\r\n      <xs:element ref=\"BodyStructure\"/>\r\n      <xs:element ref=\"Bundle\"/>\r\n      <xs:element ref=\"CapabilityStatement\"/>\r\n      <xs:element ref=\"CarePlan\"/>\r\n      <xs:element ref=\"CareTeam\"/>\r\n      <xs:element ref=\"CatalogEntry\"/>\r\n      <xs:element ref=\"ChargeItem\"/>\r\n      <xs:element ref=\"ChargeItemDefinition\"/>\r\n      <xs:element ref=\"Claim\"/>\r\n      <xs:element ref=\"ClaimResponse\"/>\r\n      <xs:element ref=\"ClinicalImpression\"/>\r\n      <xs:element ref=\"CodeSystem\"/>\r\n      <xs:element ref=\"Communication\"/>\r\n      <xs:element ref=\"CommunicationRequest\"/>\r\n      <xs:element ref=\"CompartmentDefinition\"/>\r\n      <xs:element ref=\"Composition\"/>\r\n      <xs:element ref=\"ConceptMap\"/>\r\n      <xs:element ref=\"Condition\"/>\r\n      <xs:element ref=\"Consent\"/>\r\n      <xs:element ref=\"Contract\"/>\r\n      <xs:element ref=\"Coverage\"/>\r\n      <xs:element ref=\"CoverageEligibilityRequest\"/>\r\n      <xs:element ref=\"CoverageEligibilityResponse\"/>\r\n      <xs:element ref=\"DetectedIssue\"/>\r\n      <xs:element ref=\"Device\"/>\r\n      <xs:element ref=\"DeviceDefinition\"/>\r\n      <xs:element ref=\"DeviceMetric\"/>\r\n      <xs:element ref=\"DeviceRequest\"/>\r\n      <xs:element ref=\"DeviceUseStatement\"/>\r\n      <xs:element ref=\"DiagnosticReport\"/>\r\n      <xs:element ref=\"DocumentManifest\"/>\r\n      <xs:element ref=\"DocumentReference\"/>\r\n      <xs:element ref=\"EffectEvidenceSynthesis\"/>\r\n      <xs:element ref=\"Encounter\"/>\r\n      <xs:element ref=\"Endpoint\"/>\r\n      <xs:element ref=\"EnrollmentRequest\"/>\r\n      <xs:element ref=\"EnrollmentResponse\"/>\r\n      <xs:element ref=\"EpisodeOfCare\"/>\r\n      <xs:element ref=\"EventDefinition\"/>\r\n      <xs:element ref=\"Evidence\"/>\r\n      <xs:element ref=\"EvidenceVariable\"/>\r\n      <xs:element ref=\"ExampleScenario\"/>\r\n      <xs:element ref=\"ExplanationOfBenefit\"/>\r\n      <xs:element ref=\"FamilyMemberHistory\"/>\r\n      <xs:element ref=\"Flag\"/>\r\n      <xs:element ref=\"Goal\"/>\r\n      <xs:element ref=\"GraphDefinition\"/>\r\n      <xs:element ref=\"Group\"/>\r\n      <xs:element ref=\"GuidanceResponse\"/>\r\n      <xs:element ref=\"HealthcareService\"/>\r\n      <xs:element ref=\"ImagingStudy\"/>\r\n      <xs:element ref=\"Immunization\"/>\r\n      <xs:element ref=\"ImmunizationEvaluation\"/>\r\n      <xs:element ref=\"ImmunizationRecommendation\"/>\r\n      <xs:element ref=\"ImplementationGuide\"/>\r\n      <xs:element ref=\"InsurancePlan\"/>\r\n      <xs:element ref=\"Invoice\"/>\r\n      <xs:element ref=\"Library\"/>\r\n      <xs:element ref=\"Linkage\"/>\r\n      <xs:element ref=\"List\"/>\r\n      <xs:element ref=\"Location\"/>\r\n      <xs:element ref=\"Measure\"/>\r\n      <xs:element ref=\"MeasureReport\"/>\r\n      <xs:element ref=\"Media\"/>\r\n      <xs:element ref=\"Medication\"/>\r\n      <xs:element ref=\"MedicationAdministration\"/>\r\n      <xs:element ref=\"MedicationDispense\"/>\r\n      <xs:element ref=\"MedicationKnowledge\"/>\r\n      <xs:element ref=\"MedicationRequest\"/>\r\n      <xs:element ref=\"MedicationStatement\"/>\r\n      <xs:element ref=\"MedicinalProduct\"/>\r\n      <xs:element ref=\"MedicinalProductAuthorization\"/>\r\n      <xs:element ref=\"MedicinalProductContraindication\"/>\r\n      <xs:element ref=\"MedicinalProductIndication\"/>\r\n      <xs:element ref=\"MedicinalProductIngredient\"/>\r\n      <xs:element ref=\"MedicinalProductInteraction\"/>\r\n      <xs:element ref=\"MedicinalProductManufactured\"/>\r\n      <xs:element ref=\"MedicinalProductPackaged\"/>\r\n      <xs:element ref=\"MedicinalProductPharmaceutical\"/>\r\n      <xs:element ref=\"MedicinalProductUndesirableEffect\"/>\r\n      <xs:element ref=\"MessageDefinition\"/>\r\n      <xs:element ref=\"MessageHeader\"/>\r\n      <xs:element ref=\"MolecularSequence\"/>\r\n      <xs:element ref=\"NamingSystem\"/>\r\n      <xs:element ref=\"NutritionOrder\"/>\r\n      <xs:element ref=\"Observation\"/>\r\n      <xs:element ref=\"ObservationDefinition\"/>\r\n      <xs:element ref=\"OperationDefinition\"/>\r\n      <xs:element ref=\"OperationOutcome\"/>\r\n      <xs:element ref=\"Organization\"/>\r\n      <xs:element ref=\"OrganizationAffiliation\"/>\r\n      <xs:element ref=\"Patient\"/>\r\n      <xs:element ref=\"PaymentNotice\"/>\r\n      <xs:element ref=\"PaymentReconciliation\"/>\r\n      <xs:element ref=\"Person\"/>\r\n      <xs:element ref=\"PlanDefinition\"/>\r\n      <xs:element ref=\"Practitioner\"/>\r\n      <xs:element ref=\"PractitionerRole\"/>\r\n      <xs:element ref=\"Procedure\"/>\r\n      <xs:element ref=\"Provenance\"/>\r\n      <xs:element ref=\"Questionnaire\"/>\r\n      <xs:element ref=\"QuestionnaireResponse\"/>\r\n      <xs:element ref=\"RelatedPerson\"/>\r\n      <xs:element ref=\"RequestGroup\"/>\r\n      <xs:element ref=\"ResearchDefinition\"/>\r\n      <xs:element ref=\"ResearchElementDefinition\"/>\r\n      <xs:element ref=\"ResearchStudy\"/>\r\n      <xs:element ref=\"ResearchSubject\"/>\r\n      <xs:element ref=\"RiskAssessment\"/>\r\n      <xs:element ref=\"RiskEvidenceSynthesis\"/>\r\n      <xs:element ref=\"Schedule\"/>\r\n      <xs:element ref=\"SearchParameter\"/>\r\n      <xs:element ref=\"ServiceRequest\"/>\r\n      <xs:element ref=\"Slot\"/>\r\n      <xs:element ref=\"Specimen\"/>\r\n      <xs:element ref=\"SpecimenDefinition\"/>\r\n      <xs:element ref=\"StructureDefinition\"/>\r\n      <xs:element ref=\"StructureMap\"/>\r\n      <xs:element ref=\"Subscription\"/>\r\n      <xs:element ref=\"Substance\"/>\r\n      <xs:element ref=\"SubstanceNucleicAcid\"/>\r\n      <xs:element ref=\"SubstancePolymer\"/>\r\n      <xs:element ref=\"SubstanceProtein\"/>\r\n      <xs:element ref=\"SubstanceReferenceInformation\"/>\r\n      <xs:element ref=\"SubstanceSourceMaterial\"/>\r\n      <xs:element ref=\"SubstanceSpecification\"/>\r\n      <xs:element ref=\"SupplyDelivery\"/>\r\n      <xs:element ref=\"SupplyRequest\"/>\r\n      <xs:element ref=\"Task\"/>\r\n      <xs:element ref=\"TerminologyCapabilities\"/>\r\n      <xs:element ref=\"TestReport\"/>\r\n      <xs:element ref=\"TestScript\"/>\r\n      <xs:element ref=\"ValueSet\"/>\r\n      <xs:element ref=\"VerificationResult\"/>\r\n      <xs:element ref=\"VisionPrescription\"/>\r\n      <xs:element ref=\"Parameters\"/>\r\n    </xs:choice>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Extension\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Optional Extension Element - found in all resources.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n        <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n           <xs:annotation>\r\n             <xs:documentation xml:lang=\"en\">Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).</xs:documentation>\r\n           </xs:annotation>\r\n           <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\r\n           <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n           <xs:element name=\"valueCanonical\" type=\"canonical\"/>\r\n           <xs:element name=\"valueCode\" type=\"code\"/>\r\n           <xs:element name=\"valueDate\" type=\"date\"/>\r\n           <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\r\n           <xs:element name=\"valueDecimal\" type=\"decimal\"/>\r\n           <xs:element name=\"valueId\" type=\"id\"/>\r\n           <xs:element name=\"valueInstant\" type=\"instant\"/>\r\n           <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n           <xs:element name=\"valueMarkdown\" type=\"markdown\"/>\r\n           <xs:element name=\"valueOid\" type=\"oid\"/>\r\n           <xs:element name=\"valuePositiveInt\" type=\"positiveInt\"/>\r\n           <xs:element name=\"valueString\" type=\"string\"/>\r\n           <xs:element name=\"valueTime\" type=\"time\"/>\r\n           <xs:element name=\"valueUnsignedInt\" type=\"unsignedInt\"/>\r\n           <xs:element name=\"valueUri\" type=\"uri\"/>\r\n           <xs:element name=\"valueUrl\" type=\"url\"/>\r\n           <xs:element name=\"valueUuid\" type=\"uuid\"/>\r\n           <xs:element name=\"valueAddress\" type=\"Address\"/>\r\n           <xs:element name=\"valueAge\" type=\"Age\"/>\r\n           <xs:element name=\"valueAnnotation\" type=\"Annotation\"/>\r\n           <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\r\n           <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\r\n           <xs:element name=\"valueCoding\" type=\"Coding\"/>\r\n           <xs:element name=\"valueContactPoint\" type=\"ContactPoint\"/>\r\n           <xs:element name=\"valueCount\" type=\"Count\"/>\r\n           <xs:element name=\"valueDistance\" type=\"Distance\"/>\r\n           <xs:element name=\"valueDuration\" type=\"Duration\"/>\r\n           <xs:element name=\"valueHumanName\" type=\"HumanName\"/>\r\n           <xs:element name=\"valueIdentifier\" type=\"Identifier\"/>\r\n           <xs:element name=\"valueMoney\" type=\"Money\"/>\r\n           <xs:element name=\"valuePeriod\" type=\"Period\"/>\r\n           <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n           <xs:element name=\"valueRange\" type=\"Range\"/>\r\n           <xs:element name=\"valueRatio\" type=\"Ratio\"/>\r\n           <xs:element name=\"valueReference\" type=\"Reference\"/>\r\n           <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\r\n           <xs:element name=\"valueSignature\" type=\"Signature\"/>\r\n           <xs:element name=\"valueTiming\" type=\"Timing\"/>\r\n           <xs:element name=\"valueContactDetail\" type=\"ContactDetail\"/>\r\n           <xs:element name=\"valueContributor\" type=\"Contributor\"/>\r\n           <xs:element name=\"valueDataRequirement\" type=\"DataRequirement\"/>\r\n           <xs:element name=\"valueExpression\" type=\"Expression\"/>\r\n           <xs:element name=\"valueParameterDefinition\" type=\"ParameterDefinition\"/>\r\n           <xs:element name=\"valueRelatedArtifact\" type=\"RelatedArtifact\"/>\r\n           <xs:element name=\"valueTriggerDefinition\" type=\"TriggerDefinition\"/>\r\n           <xs:element name=\"valueUsageContext\" type=\"UsageContext\"/>\r\n           <xs:element name=\"valueDosage\" type=\"Dosage\"/>\r\n           <xs:element name=\"valueMeta\" type=\"Meta\"/>\r\n         </xs:choice>\r\n        </xs:sequence>\r\n        <xs:attribute name=\"url\" type=\"uri-primitive\" use=\"required\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"BackboneElement\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Base definition for all elements that are defined inside a resource - but not those in a data type.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"modifierExtension\" type=\"Extension\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Narrative\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A human-readable summary of the resource conveying the essential clinical and business information for the resource.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"status\" type=\"NarrativeStatus\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element ref=\"xhtml:div\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual narrative content, a stripped down version of XHTML.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"NarrativeStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"generated\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Generated</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"extensions\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Extensions</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"additional\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Additional</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"empty\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Empty</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"NarrativeStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The status of a resource narrative.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"NarrativeStatus-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Element\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Base definition for all elements in a resource.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n        <xs:sequence>\r\n          <xs:element name=\"extension\" type=\"Extension\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n        <xs:attribute name=\"id\" type=\"string-primitive\" use=\"optional\"/>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Meta\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"versionId\" type=\"id\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastUpdated\" type=\"instant\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the resource last changed - e.g. when the version changed.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A uri that identifies the source system of the resource. This provides a minimal amount of [[[Provenance]]] information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of profiles (references to [[[StructureDefinition]]] resources) that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"security\" type=\"Coding\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"tag\" type=\"Coding\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Address\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An address expressed using postal conventions (as opposed to GPS or other location definition formats).  This data type may be used to convey addresses for use in delivering mail as well as for visiting locations which might not be valid for mail delivery.  There are a variety of postal address formats defined around the world.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"use\" type=\"AddressUse\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The purpose of this address.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" type=\"AddressType\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the entire address as it should be displayed e.g. on a postal label. This may be provided instead of or as well as the specific parts.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"line\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This component contains the house number, apartment number, street name, street direction,  P.O. Box number, delivery hints, and similar address information.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"city\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the city, town, suburb, village or other community or delivery center.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"district\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the administrative area (county).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"state\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"postalCode\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A postal code designating a region defined by the postal service.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"country\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Country - a nation as commonly understood or generally accepted.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" type=\"Period\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time period when address was/is in use.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AddressUse-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"home\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Home</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"work\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Work</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"temp\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Temporary</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"old\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Old / Incorrect</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"billing\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Billing</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AddressUse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The use of an address.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"AddressUse-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AddressType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"postal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Postal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"physical\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Physical</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"both\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Postal &amp; Physical</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AddressType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of an address (physical / postal).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"AddressType-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contributor\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" type=\"ContributorType\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of contributor.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the individual or organization responsible for the contribution.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" type=\"ContactDetail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the contributor.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ContributorType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"author\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Author</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"editor\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Editor</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"reviewer\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Reviewer</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"endorser\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Endorser</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ContributorType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of contributor.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"ContributorType-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Attachment\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">For referring to data content defined in other formats.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"contentType\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"language\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The human language of the content. The value can be any valid value according to BCP 47.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"data\" type=\"base64Binary\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual data of the attachment - a sequence of bytes, base64 encoded.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"url\" type=\"url\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A location where the data can be accessed.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"size\" type=\"unsignedInt\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of bytes of data that make up this attachment (before base64 encoding, if that is done).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"hash\" type=\"base64Binary\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The calculated hash of the data using SHA-1. Represented using base64.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A label or set of text to display in place of the data.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"creation\" type=\"dateTime\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date that the attachment was first created.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Count\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Quantity\">\r\n        <xs:sequence>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DataRequirement\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" type=\"code\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The profile of the required data, specified as the uri of the profile definition.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The intended subjects of the data requirement. If this element is not provided, a Patient subject is assumed.</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"subjectReference\" type=\"Reference\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"mustSupport\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available. \n\nThe value of mustSupport SHALL be a FHIRPath resolveable on the type of the DataRequirement. The path SHALL consist only of identifiers, constant indexers, and .resolve() (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"codeFilter\" type=\"DataRequirement.CodeFilter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data. Each code filter defines an additional constraint on the data, i.e. code filters are AND'ed, not OR'ed.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dateFilter\" type=\"DataRequirement.DateFilter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date filters specify additional constraints on the data in terms of the applicable date range for specific elements. Each date filter specifies an additional constraint on the data, i.e. date filters are AND'ed, not OR'ed.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"limit\" type=\"positiveInt\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies a maximum number of results that are required (uses the _count search parameter).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sort\" type=\"DataRequirement.Sort\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the order of the results to be returned.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DataRequirement.CodeFilter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"path\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code-valued attribute of the filter. The specified path SHALL be a FHIRPath resolveable on the specified type of the DataRequirement, and SHALL consist only of identifiers, constant indexers, and .resolve(). The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"searchParam\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A token parameter that refers to a search parameter defined on the specified type of the DataRequirement, and which searches on elements of type code, Coding, or CodeableConcept.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"valueSet\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The valueset for the code filter. The valueSet and code elements are additive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" type=\"Coding\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The codes for the code filter. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes. If codes are specified in addition to a value set, the filter returns items matching a code in the value set or one of the specified codes.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DataRequirement.DateFilter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"path\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date-valued attribute of the filter. The specified path SHALL be a FHIRPath resolveable on the specified type of the DataRequirement, and SHALL consist only of identifiers, constant indexers, and .resolve(). The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details). Note that the index must be an integer constant. The path must resolve to an element of type date, dateTime, Period, Schedule, or Timing.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"searchParam\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A date parameter that refers to a search parameter defined on the specified type of the DataRequirement, and which searches on elements of type date, dateTime, Period, Schedule, or Timing.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime. If a Duration is specified, the filter will return only those data items that fall within Duration before now.</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"valueDateTime\" type=\"dateTime\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"valuePeriod\" type=\"Period\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"valueDuration\" type=\"Duration\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DataRequirement.Sort\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes a required data item for evaluation in terms of the type of data, and optional code or date-based filters of the data.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"path\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The attribute of the sort. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"direction\" type=\"SortDirection\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The direction of the sort, ascending or descending.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SortDirection-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"ascending\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Ascending</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"descending\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Descending</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SortDirection\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The possible sort directions, ascending or descending.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"SortDirection-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Dosage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates how the medication is/was taken or should be taken by the patient.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" type=\"integer\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the order in which the dosage instructions should be applied or interpreted.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Free text dosage instructions e.g. SIG.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"additionalInstruction\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Supplemental instructions to the patient on how to take the medication  (e.g. &quot;with meals&quot; or&quot;take half to one hour before food&quot;) or warnings for the patient about the medication (e.g. &quot;may cause drowsiness&quot; or &quot;avoid exposure of skin to direct sunlight or sunlamps&quot;).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patientInstruction\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Instructions in terms that are understood by the patient or consumer.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"timing\" type=\"Timing\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When medication should be administered.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"asNeededBoolean\" type=\"boolean\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"asNeededCodeableConcept\" type=\"CodeableConcept\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"site\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Body site to administer to.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"route\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How drug should enter body.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"method\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Technique for administering medication.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"doseAndRate\" type=\"Dosage.DoseAndRate\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount of medication administered.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maxDosePerPeriod\" type=\"Ratio\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Upper limit on medication per unit of time.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maxDosePerAdministration\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Upper limit on medication per administration.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maxDosePerLifetime\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Upper limit on medication per lifetime of the patient.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Dosage.DoseAndRate\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates how the medication is/was taken or should be taken by the patient.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of dose or rate specified, for example, ordered or calculated.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Amount of medication per dose.</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"doseRange\" type=\"Range\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"doseQuantity\" type=\"Quantity\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Amount of medication per unit of time.</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"rateRatio\" type=\"Ratio\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"rateRange\" type=\"Range\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"rateQuantity\" type=\"Quantity\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Money\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An amount of economic utility in some recognized currency.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"value\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Numerical value (with implicit precision).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"currency\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">ISO 4217 Currency Code.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"HumanName\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A human's name with the ability to identify parts and usage.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"use\" type=\"NameUse\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the purpose for this name.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the entire name as it should be displayed e.g. on an application UI. This may be provided instead of or as well as the specific parts.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"family\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"given\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Given name.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"prefix\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"suffix\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" type=\"Period\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the period of time when this name was valid for the named person.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"NameUse-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"usual\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Usual</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"official\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Official</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"temp\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Temp</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"nickname\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Nickname</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"anonymous\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Anonymous</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"old\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Old</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"maiden\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Name changed for Marriage</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"NameUse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The use of a human name.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"NameUse-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ContactPoint\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"system\" type=\"ContactPointSystem\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Telecommunications form for contact point - what communications system is required to make use of the contact.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"use\" type=\"ContactPointUse\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the purpose for the contact point.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rank\" type=\"positiveInt\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies a preferred order in which to use a set of contacts. ContactPoints with lower rank values are more preferred than those with higher rank values.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" type=\"Period\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time period when the contact point was/is in use.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ContactPointSystem-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"phone\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Phone</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"fax\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Fax</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"email\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Email</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"pager\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Pager</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"url\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">URL</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"sms\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SMS</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"other\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Other</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ContactPointSystem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Telecommunications form for contact point.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"ContactPointSystem-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ContactPointUse-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"home\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Home</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"work\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Work</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"temp\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Temp</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"old\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Old</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"mobile\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Mobile</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ContactPointUse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Use of contact point.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"ContactPointUse-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MarketingStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"country\" type=\"CodeableConcept\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The country in which the marketing authorisation has been granted shall be specified It should be specified using the ISO 3166 ‑ 1 alpha-2 code elements.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where a Medicines Regulatory Agency has granted a marketing authorisation for which specific provisions within a jurisdiction apply, the jurisdiction can be specified using an appropriate controlled terminology The controlled term and the controlled term identifier shall be specified.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" type=\"CodeableConcept\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This attribute provides information on the status of the marketing of the medicinal product See ISO/TS 20443 for more information and examples.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dateRange\" type=\"Period\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when the Medicinal Product is placed on the market by the Marketing Authorisation Holder (or where applicable, the manufacturer/distributor) in a country and/or jurisdiction shall be provided A complete date consisting of day, month and year shall be specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"restoreDate\" type=\"dateTime\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when the Medicinal Product is placed on the market by the Marketing Authorisation Holder (or where applicable, the manufacturer/distributor) in a country and/or jurisdiction shall be provided A complete date consisting of day, month and year shall be specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Identifier\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An identifier - identifies some entity uniquely and unambiguously. Typically this is used for business identifiers.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"use\" type=\"IdentifierUse\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The purpose of this identifier.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"system\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Establishes the namespace for the value - that is, a URL that describes a set values that are unique.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The portion of the identifier typically relevant to the user and which is unique within the context of the system.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" type=\"Period\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time period during which identifier is/was valid for use.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"assigner\" type=\"Reference\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Organization that issued/manages the identifier.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"IdentifierUse-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"usual\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Usual</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"official\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Official</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"temp\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Temp</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"secondary\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Secondary</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"old\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Old</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"IdentifierUse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Identifies the purpose for this identifier, if known .</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"IdentifierUse-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceAmount\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Chemical substances are a single substance type whose primary defining element is the molecular structure. Chemical substances shall be defined on the basis of their complete covalent molecular structure; the presence of a salt (counter-ion) and/or solvates (water, alcohols) is also captured. Purity, grade, physical form or particle size are not taken into account in the definition of a chemical substance or in the assignment of a Substance ID.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field.</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"amountQuantity\" type=\"Quantity\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"amountRange\" type=\"Range\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"amountString\" type=\"string\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"amountType\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Most elements that require a quantitative value will also have a field called amount type. Amount type should always be specified because the actual value of the amount is often dependent on it. EXAMPLE: In capturing the actual relative amounts of substances or molecular fragments it is essential to indicate whether the amount refers to a mole ratio or weight ratio. For any given element an effort should be made to use same the amount type for all related definitional elements.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amountText\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A textual comment on a numeric value.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referenceRange\" type=\"SubstanceAmount.ReferenceRange\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference range of possible or expected values.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceAmount.ReferenceRange\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Chemical substances are a single substance type whose primary defining element is the molecular structure. Chemical substances shall be defined on the basis of their complete covalent molecular structure; the presence of a salt (counter-ion) and/or solvates (water, alcohols) is also captured. Purity, grade, physical form or particle size are not taken into account in the definition of a chemical substance or in the assignment of a Substance ID.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"lowLimit\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Lower limit possible or expected.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"highLimit\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Upper limit possible or expected.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Coding\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A reference to a code defined by a terminology system.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"system\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identification of the code system that defines the meaning of the symbol in the code.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"display\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A representation of the meaning of the code in the system, following the rules of the system.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"userSelected\" type=\"boolean\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SampledData\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"origin\" type=\"Quantity\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" type=\"decimal\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The length of time between sampling times, measured in milliseconds.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A correction factor that is applied to the sampled data points before they are added to the origin.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lowerLimit\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The lower limit of detection of the measured points. This is needed if any of the data points have the value &quot;L&quot; (lower than detection limit).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"upperLimit\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The upper limit of detection of the measured points. This is needed if any of the data points have the value &quot;U&quot; (higher than detection limit).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dimensions\" type=\"positiveInt\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"data\" type=\"SampledDataDataType\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A series of data points which are decimal values separated by a single space (character u20). The special values &quot;E&quot; (error), &quot;L&quot; (below detection limit) and &quot;U&quot; (above detection limit) can also be used in place of a decimal value.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SampledDataDataType-primitive\">\r\n     <xs:restriction base=\"xs:string\">\r\n      <xs:pattern value=\"((-{0,1}\\d*\\.{0,1}\\d+)|[EUL])( ((-{0,1}\\d*\\.{0,1}\\d+)|[EUL]))*\"/>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n    <xs:complexType name=\"SampledDataDataType\">\r\n      <xs:complexContent>\r\n        <xs:extension base=\"Element\">\r\n          <xs:attribute name=\"value\" type=\"SampledDataDataType-primitive\" use=\"optional\"/>\r\n        </xs:extension>\r\n      </xs:complexContent>\r\n    </xs:complexType>\r\n\r\n  <xs:complexType name=\"Population\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A populatioof people with some set of grouping criteria.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The age of the specific population.</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"ageRange\" type=\"Range\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"ageCodeableConcept\" type=\"CodeableConcept\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"gender\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The gender of the specific population.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"race\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Race of the specific population.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"physiologicalCondition\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The existing physiological conditions of the specific population to which this applies.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Ratio\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A relationship of two Quantity values - expressed as a numerator and a denominator.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"numerator\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the numerator.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"denominator\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the denominator.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Distance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A length - a value with a unit that is a physical distance.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Quantity\">\r\n        <xs:sequence>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Age\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A duration of time during which an organism (or a process) has existed.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Quantity\">\r\n        <xs:sequence>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Reference\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A reference from one resource to another.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"reference\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The expected type of the target of the reference. If both Reference.type and Reference.reference are populated and Reference.reference is a FHIR URL, both SHALL be consistent.\n\nThe type is the Canonical URL of Resource Definition that is the type this reference refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/ e.g. &quot;Patient&quot; is a reference to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are only allowed for logical models (and can only be used in references in logical models, not resources).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" type=\"Identifier\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"display\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Plain text narrative that identifies the resource in addition to the resource reference.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TriggerDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A description of a triggering event. Triggering events can be named events, data events, or periodic, as determined by the type element.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" type=\"TriggerType\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of triggering event.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal name for the event. This may be an absolute URI that identifies the event formally (e.g. from a trigger registry), or a simple relative URI that identifies the event in a local context.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The timing of the event (if this is a periodic trigger).</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"timingTiming\" type=\"Timing\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"timingReference\" type=\"Reference\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"timingDate\" type=\"date\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"timingDateTime\" type=\"dateTime\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"data\" type=\"DataRequirement\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The triggering data of the event (if this is a data trigger). If more than one data is requirement is specified, then all the data requirements must be true.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"condition\" type=\"Expression\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A boolean-valued expression that is evaluated in the context of the container of the trigger definition and returns whether or not the trigger fires.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"TriggerType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"named-event\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Named Event</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"periodic\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Periodic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"data-changed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Data Changed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"data-added\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Data Added</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"data-modified\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Data Updated</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"data-removed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Data Removed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"data-accessed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Data Accessed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"data-access-ended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Data Access Ended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"TriggerType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of trigger.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"TriggerType-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Quantity\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"value\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the measured amount. The value includes an implicit precision in the presentation of the value.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comparator\" type=\"QuantityComparator\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is &quot;&lt;&quot; , then the real value is &lt; stated value.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unit\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable form of the unit.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"system\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identification of the system that provides the coded form of the unit.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A computer processable form of the unit in some unit representation system.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"QuantityComparator-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"&lt;\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Less than</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"&lt;=\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Less or Equal to</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"&gt;=\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Greater or Equal to</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"&gt;\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Greater than</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"QuantityComparator\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How the Quantity should be understood and represented.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"QuantityComparator-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Period\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A time period defined by a start and end date and optionally time.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"start\" type=\"dateTime\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The start of the period. The boundary is inclusive.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"end\" type=\"dateTime\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Duration\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A length of time.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Quantity\">\r\n        <xs:sequence>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Range\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of ordered Quantities defined by a low and high limit.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"low\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The low limit. The boundary is inclusive.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"high\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The high limit. The boundary is inclusive.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"RelatedArtifact\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" type=\"RelatedArtifactType\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of relationship to the related artifact.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"label\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short label that can be used to reference the citation from elsewhere in the containing artifact, such as a footnote index.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"display\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A brief description of the document or knowledge resource being referenced, suitable for display to a consumer.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"citation\" type=\"markdown\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A bibliographic citation for the related artifact. This text SHOULD be formatted according to an accepted citation format.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"url\" type=\"url\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A url for the artifact that can be followed to access the actual content.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"document\" type=\"Attachment\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The document being referenced, represented as an attachment. This is exclusive with the resource element.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resource\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The related resource, such as a library, value set, profile, or other knowledge resource.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"RelatedArtifactType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"documentation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Documentation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"justification\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Justification</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"citation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Citation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"predecessor\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Predecessor</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"successor\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Successor</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"derived-from\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Derived From</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"depends-on\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Depends On</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"composed-of\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Composed Of</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"RelatedArtifactType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of relationship to the related artifact.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"RelatedArtifactType-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Annotation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A  text note which also  contains information about who made the statement and when.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual responsible for making the annotation.</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"authorReference\" type=\"Reference\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"authorString\" type=\"string\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"time\" type=\"dateTime\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates when this particular annotation was made.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" type=\"markdown\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The text of the annotation in markdown format.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ProductShelfLife\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The shelf-life and storage information for a medicinal product item or container can be described using this class.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" type=\"Identifier\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique identifier for the packaged Medicinal Product.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" type=\"CodeableConcept\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This describes the shelf life, taking into account various scenarios such as shelf life of the packaged Medicinal Product itself, shelf life after transformation where necessary and shelf life after the first opening of a bottle, etc. The shelf life type shall be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" type=\"Quantity\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The shelf life time period can be specified using a numerical value for the period of time and its unit of time measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialPrecautionsForStorage\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Special precautions for storage, if any, can be specified using an appropriate controlled vocabulary The controlled term and the controlled term identifier shall be specified.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ContactDetail\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Specifies contact information for a person or organization.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of an individual to contact.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" type=\"ContactPoint\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The contact details for the individual (if a name was provided) or the organization.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"UsageContext\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Specifies clinical/business/etc. metadata that can be used to retrieve, index and/or categorize an artifact. This metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care (e.g., venue, care setting, provider of care).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" type=\"Coding\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that identifies the type of context being specified by this usage context.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A value that defines the context specified in this context of use. The interpretation of the value is defined by the code.</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"valueQuantity\" type=\"Quantity\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"valueRange\" type=\"Range\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"valueReference\" type=\"Reference\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Expression\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A brief, natural language description of the condition that effectively communicates the intended semantics.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" type=\"id\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short name assigned to the expression to allow for multiple reuse of the expression in the context where it is defined.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"language\" type=\"ExpressionLanguage\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The media type of the language for the expression.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An expression in the specified language that returns a value.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reference\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A URI that defines where the expression is found.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ExpressionLanguage-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"text/cql\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CQL</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"text/fhirpath\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">FHIRPath</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"application/x-fhir-query\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">FHIR Query</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ExpressionLanguage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The media type of the expression language.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"ExpressionLanguage-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Signature\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A signature along with supporting context. The signature may be a digital signature that is cryptographic in nature, or some other signature acceptable to the domain. This other signature may be as simple as a graphical image representing a hand-written signature, or a signature ceremony Different signature approaches have different utilities.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" type=\"Coding\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"when\" type=\"instant\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the digital signature was signed.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"who\" type=\"Reference\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to an application-usable description of the identity that signed  (e.g. the signature used their private key).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"onBehalfOf\" type=\"Reference\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to an application-usable description of the identity that is represented by the signature.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"targetFormat\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A mime type that indicates the technical format of the target resources signed by the signature.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sigFormat\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jose for JWS, and image/* for a graphical image of a signature, etc.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"data\" type=\"base64Binary\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Timing\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"event\" type=\"dateTime\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies specific times when the event occurs.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"repeat\" type=\"Timing.Repeat\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A set of rules that describe when the event is scheduled.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code for the timing schedule (or just text in code.text). Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing, with the exception that .repeat.bounds still applies over the code (and is not contained in the code).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Timing.Repeat\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Specifies an event that may occur multiple times. Timing schedules are used to record when things are planned, expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds, and may be used for reporting the schedule to which past regular activities were carried out.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"boundsDuration\" type=\"Duration\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"boundsRange\" type=\"Range\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"boundsPeriod\" type=\"Period\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"count\" type=\"positiveInt\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A total count of the desired number of repetitions across the duration of the entire timing specification. If countMax is present, this element indicates the lower bound of the allowed range of count values.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"countMax\" type=\"positiveInt\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If present, indicates that the count is a range - so to perform the action between [count] and [countMax] times.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"duration\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How long this thing happens for when it happens. If durationMax is present, this element indicates the lower bound of the allowed range of the duration.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"durationMax\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If present, indicates that the duration is a range - so to perform the action between [duration] and [durationMax] time length.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"durationUnit\" type=\"UnitsOfTime\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The units of time for the duration, in UCUM units.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"frequency\" type=\"positiveInt\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of times to repeat the action within the specified period. If frequencyMax is present, this element indicates the lower bound of the allowed range of the frequency.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"frequencyMax\" type=\"positiveInt\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If present, indicates that the frequency is a range - so to repeat between [frequency] and [frequencyMax] times within the period or period range.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the duration of time over which repetitions are to occur; e.g. to express &quot;3 times per day&quot;, 3 would be the frequency and &quot;1 day&quot; would be the period. If periodMax is present, this element indicates the lower bound of the allowed range of the period length.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"periodMax\" type=\"decimal\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as &quot;do this once every 3-5 days.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"periodUnit\" type=\"UnitsOfTime\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The units of time for the period in UCUM units.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dayOfWeek\" type=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If one or more days of week is provided, then the action happens only on the specified day(s).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"timeOfDay\" type=\"time\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specified time of day for action to take place.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"when\" type=\"EventTiming\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An approximate time period during the day, potentially linked to an event of daily living that indicates when the action should occur.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"offset\" type=\"unsignedInt\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"UnitsOfTime-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"s\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">秒</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"min\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">分钟</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"h\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">小时</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"d\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">天</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"wk\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">星期</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"mo\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">月</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"a\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">年</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"UnitsOfTime\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A unit of time (units from UCUM).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"UnitsOfTime-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"EventTiming-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"MORN\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Morning</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MORN.early\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Early Morning</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MORN.late\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Late Morning</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NOON\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Noon</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AFT\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Afternoon</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AFT.early\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Early Afternoon</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AFT.late\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Late Afternoon</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EVE\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Evening</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EVE.early\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Early Evening</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EVE.late\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Late Evening</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NIGHT\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Night</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PHS\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">After Sleep</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"HS\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">HS</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"WAKE\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">WAKE</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"C\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">C</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CM\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CM</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CD\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CD</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CV\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CV</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AC\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">AC</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ACM\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ACM</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ACD\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ACD</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ACV\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ACV</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PC\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PC</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PCM\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PCM</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PCD\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PCD</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PCV\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PCV</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"EventTiming\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Real world event relating to the schedule.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"EventTiming-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ProdCharacteristic\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The marketing status describes the date when a medicinal product is actually put on the market or the date as of which it is no longer available.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"height\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where applicable, the height can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"width\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where applicable, the width can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"depth\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where applicable, the depth can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"weight\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where applicable, the weight can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"nominalVolume\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where applicable, the nominal volume can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"externalDiameter\" type=\"Quantity\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where applicable, the external diameter can be specified using a numerical value and its unit of measurement The unit of measurement shall be specified in accordance with ISO 11240 and the resulting terminology The symbol and the symbol identifier shall be used.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"shape\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where applicable, the shape can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"color\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where applicable, the color can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"imprint\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where applicable, the imprint can be specified as text.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"image\" type=\"Attachment\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where applicable, the image can be provided The format of the image attachment shall be specified by regional implementations.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"scoring\" type=\"CodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where applicable, the scoring can be specified An appropriate controlled vocabulary shall be used The term and the term identifier shall be used.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CodeableConcept\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"coding\" type=\"Coding\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a code defined by a terminology system.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ParameterDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the parameter used to allow access to the value of the parameter in evaluation contexts.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"use\" type=\"code\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the parameter is input or output for the module.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"min\" type=\"integer\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The minimum number of times this parameter SHALL appear in the request or response.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"max\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum number of times this element is permitted to appear in the request or response.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A brief discussion of what the parameter is for and how it is used by the module.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" type=\"code\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the parameter.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ElementDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"path\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The path identifies the element and is expressed as a &quot;.&quot;-separated list of ancestor elements, beginning with the name of the resource or extension.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"representation\" type=\"PropertyRepresentation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Codes that define how this element is represented in instances, when the deviation varies from the normal case.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sliceName\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of this element definition slice, when slicing is working. The name must be a token with no dots or spaces. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sliceIsConstraining\" type=\"boolean\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If true, indicates that this slice definition is constraining a slice definition with the same name in an inherited profile. If false, the slice is not overriding any slice in an inherited profile. If missing, the slice might or might not be overriding a slice in an inherited profile, depending on the sliceName.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"label\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A single preferred label which is the text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" type=\"Coding\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that has the same meaning as the element in a particular terminology.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"slicing\" type=\"ElementDefinition.Slicing\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"short\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A concise description of what this element means (e.g. for use in autogenerated summaries).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definition\" type=\"markdown\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides a complete explanation of the meaning of the data element for human readability.  For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. (Note: The text you are reading is specified in ElementDefinition.definition).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" type=\"markdown\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. (Note: The text you are reading is specified in ElementDefinition.comment).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requirements\" type=\"markdown\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"alias\" type=\"string\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies additional names by which this element might also be known.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"min\" type=\"unsignedInt\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The minimum number of times this element SHALL appear in the instance.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"max\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum number of times this element is permitted to appear in the instance.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"base\" type=\"ElementDefinition.Base\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. When the element definition is not the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type in a snap shot - then the information in provided in the element definition may be different to the base definition. On the original definition of the element, it will be same.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contentReference\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies an element defined elsewhere in the definition whose content rules should be applied to the current element. ContentReferences bring across all the rules that are in the ElementDefinition for the element, including definitions, cardinality constraints, bindings, invariants etc.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" type=\"ElementDefinition.Type\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The data type or resource that the value of this element is permitted to be.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n           <xs:annotation>\r\n             <xs:documentation xml:lang=\"en\">The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').</xs:documentation>\r\n           </xs:annotation>\r\n           <xs:element name=\"defaultValueBase64Binary\" type=\"base64Binary\"/>\r\n           <xs:element name=\"defaultValueBoolean\" type=\"boolean\"/>\r\n           <xs:element name=\"defaultValueCanonical\" type=\"canonical\"/>\r\n           <xs:element name=\"defaultValueCode\" type=\"code\"/>\r\n           <xs:element name=\"defaultValueDate\" type=\"date\"/>\r\n           <xs:element name=\"defaultValueDateTime\" type=\"dateTime\"/>\r\n           <xs:element name=\"defaultValueDecimal\" type=\"decimal\"/>\r\n           <xs:element name=\"defaultValueId\" type=\"id\"/>\r\n           <xs:element name=\"defaultValueInstant\" type=\"instant\"/>\r\n           <xs:element name=\"defaultValueInteger\" type=\"integer\"/>\r\n           <xs:element name=\"defaultValueMarkdown\" type=\"markdown\"/>\r\n           <xs:element name=\"defaultValueOid\" type=\"oid\"/>\r\n           <xs:element name=\"defaultValuePositiveInt\" type=\"positiveInt\"/>\r\n           <xs:element name=\"defaultValueString\" type=\"string\"/>\r\n           <xs:element name=\"defaultValueTime\" type=\"time\"/>\r\n           <xs:element name=\"defaultValueUnsignedInt\" type=\"unsignedInt\"/>\r\n           <xs:element name=\"defaultValueUri\" type=\"uri\"/>\r\n           <xs:element name=\"defaultValueUrl\" type=\"url\"/>\r\n           <xs:element name=\"defaultValueUuid\" type=\"uuid\"/>\r\n           <xs:element name=\"defaultValueAddress\" type=\"Address\"/>\r\n           <xs:element name=\"defaultValueAge\" type=\"Age\"/>\r\n           <xs:element name=\"defaultValueAnnotation\" type=\"Annotation\"/>\r\n           <xs:element name=\"defaultValueAttachment\" type=\"Attachment\"/>\r\n           <xs:element name=\"defaultValueCodeableConcept\" type=\"CodeableConcept\"/>\r\n           <xs:element name=\"defaultValueCoding\" type=\"Coding\"/>\r\n           <xs:element name=\"defaultValueContactPoint\" type=\"ContactPoint\"/>\r\n           <xs:element name=\"defaultValueCount\" type=\"Count\"/>\r\n           <xs:element name=\"defaultValueDistance\" type=\"Distance\"/>\r\n           <xs:element name=\"defaultValueDuration\" type=\"Duration\"/>\r\n           <xs:element name=\"defaultValueHumanName\" type=\"HumanName\"/>\r\n           <xs:element name=\"defaultValueIdentifier\" type=\"Identifier\"/>\r\n           <xs:element name=\"defaultValueMoney\" type=\"Money\"/>\r\n           <xs:element name=\"defaultValuePeriod\" type=\"Period\"/>\r\n           <xs:element name=\"defaultValueQuantity\" type=\"Quantity\"/>\r\n           <xs:element name=\"defaultValueRange\" type=\"Range\"/>\r\n           <xs:element name=\"defaultValueRatio\" type=\"Ratio\"/>\r\n           <xs:element name=\"defaultValueReference\" type=\"Reference\"/>\r\n           <xs:element name=\"defaultValueSampledData\" type=\"SampledData\"/>\r\n           <xs:element name=\"defaultValueSignature\" type=\"Signature\"/>\r\n           <xs:element name=\"defaultValueTiming\" type=\"Timing\"/>\r\n           <xs:element name=\"defaultValueContactDetail\" type=\"ContactDetail\"/>\r\n           <xs:element name=\"defaultValueContributor\" type=\"Contributor\"/>\r\n           <xs:element name=\"defaultValueDataRequirement\" type=\"DataRequirement\"/>\r\n           <xs:element name=\"defaultValueExpression\" type=\"Expression\"/>\r\n           <xs:element name=\"defaultValueParameterDefinition\" type=\"ParameterDefinition\"/>\r\n           <xs:element name=\"defaultValueRelatedArtifact\" type=\"RelatedArtifact\"/>\r\n           <xs:element name=\"defaultValueTriggerDefinition\" type=\"TriggerDefinition\"/>\r\n           <xs:element name=\"defaultValueUsageContext\" type=\"UsageContext\"/>\r\n           <xs:element name=\"defaultValueDosage\" type=\"Dosage\"/>\r\n           <xs:element name=\"defaultValueMeta\" type=\"Meta\"/>\r\n         </xs:choice>\r\n          <xs:element name=\"meaningWhenMissing\" type=\"markdown\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing').</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"orderMeaning\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If present, indicates that the order of the repeating element has meaning and describes what that meaning is.  If absent, it means that the order of the element has no meaning.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n           <xs:annotation>\r\n             <xs:documentation xml:lang=\"en\">Specifies a value that SHALL be exactly the value  for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.</xs:documentation>\r\n           </xs:annotation>\r\n           <xs:element name=\"fixedBase64Binary\" type=\"base64Binary\"/>\r\n           <xs:element name=\"fixedBoolean\" type=\"boolean\"/>\r\n           <xs:element name=\"fixedCanonical\" type=\"canonical\"/>\r\n           <xs:element name=\"fixedCode\" type=\"code\"/>\r\n           <xs:element name=\"fixedDate\" type=\"date\"/>\r\n           <xs:element name=\"fixedDateTime\" type=\"dateTime\"/>\r\n           <xs:element name=\"fixedDecimal\" type=\"decimal\"/>\r\n           <xs:element name=\"fixedId\" type=\"id\"/>\r\n           <xs:element name=\"fixedInstant\" type=\"instant\"/>\r\n           <xs:element name=\"fixedInteger\" type=\"integer\"/>\r\n           <xs:element name=\"fixedMarkdown\" type=\"markdown\"/>\r\n           <xs:element name=\"fixedOid\" type=\"oid\"/>\r\n           <xs:element name=\"fixedPositiveInt\" type=\"positiveInt\"/>\r\n           <xs:element name=\"fixedString\" type=\"string\"/>\r\n           <xs:element name=\"fixedTime\" type=\"time\"/>\r\n           <xs:element name=\"fixedUnsignedInt\" type=\"unsignedInt\"/>\r\n           <xs:element name=\"fixedUri\" type=\"uri\"/>\r\n           <xs:element name=\"fixedUrl\" type=\"url\"/>\r\n           <xs:element name=\"fixedUuid\" type=\"uuid\"/>\r\n           <xs:element name=\"fixedAddress\" type=\"Address\"/>\r\n           <xs:element name=\"fixedAge\" type=\"Age\"/>\r\n           <xs:element name=\"fixedAnnotation\" type=\"Annotation\"/>\r\n           <xs:element name=\"fixedAttachment\" type=\"Attachment\"/>\r\n           <xs:element name=\"fixedCodeableConcept\" type=\"CodeableConcept\"/>\r\n           <xs:element name=\"fixedCoding\" type=\"Coding\"/>\r\n           <xs:element name=\"fixedContactPoint\" type=\"ContactPoint\"/>\r\n           <xs:element name=\"fixedCount\" type=\"Count\"/>\r\n           <xs:element name=\"fixedDistance\" type=\"Distance\"/>\r\n           <xs:element name=\"fixedDuration\" type=\"Duration\"/>\r\n           <xs:element name=\"fixedHumanName\" type=\"HumanName\"/>\r\n           <xs:element name=\"fixedIdentifier\" type=\"Identifier\"/>\r\n           <xs:element name=\"fixedMoney\" type=\"Money\"/>\r\n           <xs:element name=\"fixedPeriod\" type=\"Period\"/>\r\n           <xs:element name=\"fixedQuantity\" type=\"Quantity\"/>\r\n           <xs:element name=\"fixedRange\" type=\"Range\"/>\r\n           <xs:element name=\"fixedRatio\" type=\"Ratio\"/>\r\n           <xs:element name=\"fixedReference\" type=\"Reference\"/>\r\n           <xs:element name=\"fixedSampledData\" type=\"SampledData\"/>\r\n           <xs:element name=\"fixedSignature\" type=\"Signature\"/>\r\n           <xs:element name=\"fixedTiming\" type=\"Timing\"/>\r\n           <xs:element name=\"fixedContactDetail\" type=\"ContactDetail\"/>\r\n           <xs:element name=\"fixedContributor\" type=\"Contributor\"/>\r\n           <xs:element name=\"fixedDataRequirement\" type=\"DataRequirement\"/>\r\n           <xs:element name=\"fixedExpression\" type=\"Expression\"/>\r\n           <xs:element name=\"fixedParameterDefinition\" type=\"ParameterDefinition\"/>\r\n           <xs:element name=\"fixedRelatedArtifact\" type=\"RelatedArtifact\"/>\r\n           <xs:element name=\"fixedTriggerDefinition\" type=\"TriggerDefinition\"/>\r\n           <xs:element name=\"fixedUsageContext\" type=\"UsageContext\"/>\r\n           <xs:element name=\"fixedDosage\" type=\"Dosage\"/>\r\n           <xs:element name=\"fixedMeta\" type=\"Meta\"/>\r\n         </xs:choice>\r\n        <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n           <xs:annotation>\r\n             <xs:documentation xml:lang=\"en\">Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example.  \n\nWhen pattern[x] is used to constrain a primitive, it means that the value provided in the pattern[x] must match the instance value exactly.\n\nWhen pattern[x] is used to constrain an array, it means that each element provided in the pattern[x] array must (recursively) match at least one element from the instance array.\n\nWhen pattern[x] is used to constrain a complex object, it means that each property in the pattern must be present in the complex object, and its value must recursively match -- i.e.,\n\n1. If primitive: it must match exactly the pattern value\n2. If a complex object: it must match (recursively) the pattern value\n3. If an array: it must match (recursively) the pattern value.</xs:documentation>\r\n           </xs:annotation>\r\n           <xs:element name=\"patternBase64Binary\" type=\"base64Binary\"/>\r\n           <xs:element name=\"patternBoolean\" type=\"boolean\"/>\r\n           <xs:element name=\"patternCanonical\" type=\"canonical\"/>\r\n           <xs:element name=\"patternCode\" type=\"code\"/>\r\n           <xs:element name=\"patternDate\" type=\"date\"/>\r\n           <xs:element name=\"patternDateTime\" type=\"dateTime\"/>\r\n           <xs:element name=\"patternDecimal\" type=\"decimal\"/>\r\n           <xs:element name=\"patternId\" type=\"id\"/>\r\n           <xs:element name=\"patternInstant\" type=\"instant\"/>\r\n           <xs:element name=\"patternInteger\" type=\"integer\"/>\r\n           <xs:element name=\"patternMarkdown\" type=\"markdown\"/>\r\n           <xs:element name=\"patternOid\" type=\"oid\"/>\r\n           <xs:element name=\"patternPositiveInt\" type=\"positiveInt\"/>\r\n           <xs:element name=\"patternString\" type=\"string\"/>\r\n           <xs:element name=\"patternTime\" type=\"time\"/>\r\n           <xs:element name=\"patternUnsignedInt\" type=\"unsignedInt\"/>\r\n           <xs:element name=\"patternUri\" type=\"uri\"/>\r\n           <xs:element name=\"patternUrl\" type=\"url\"/>\r\n           <xs:element name=\"patternUuid\" type=\"uuid\"/>\r\n           <xs:element name=\"patternAddress\" type=\"Address\"/>\r\n           <xs:element name=\"patternAge\" type=\"Age\"/>\r\n           <xs:element name=\"patternAnnotation\" type=\"Annotation\"/>\r\n           <xs:element name=\"patternAttachment\" type=\"Attachment\"/>\r\n           <xs:element name=\"patternCodeableConcept\" type=\"CodeableConcept\"/>\r\n           <xs:element name=\"patternCoding\" type=\"Coding\"/>\r\n           <xs:element name=\"patternContactPoint\" type=\"ContactPoint\"/>\r\n           <xs:element name=\"patternCount\" type=\"Count\"/>\r\n           <xs:element name=\"patternDistance\" type=\"Distance\"/>\r\n           <xs:element name=\"patternDuration\" type=\"Duration\"/>\r\n           <xs:element name=\"patternHumanName\" type=\"HumanName\"/>\r\n           <xs:element name=\"patternIdentifier\" type=\"Identifier\"/>\r\n           <xs:element name=\"patternMoney\" type=\"Money\"/>\r\n           <xs:element name=\"patternPeriod\" type=\"Period\"/>\r\n           <xs:element name=\"patternQuantity\" type=\"Quantity\"/>\r\n           <xs:element name=\"patternRange\" type=\"Range\"/>\r\n           <xs:element name=\"patternRatio\" type=\"Ratio\"/>\r\n           <xs:element name=\"patternReference\" type=\"Reference\"/>\r\n           <xs:element name=\"patternSampledData\" type=\"SampledData\"/>\r\n           <xs:element name=\"patternSignature\" type=\"Signature\"/>\r\n           <xs:element name=\"patternTiming\" type=\"Timing\"/>\r\n           <xs:element name=\"patternContactDetail\" type=\"ContactDetail\"/>\r\n           <xs:element name=\"patternContributor\" type=\"Contributor\"/>\r\n           <xs:element name=\"patternDataRequirement\" type=\"DataRequirement\"/>\r\n           <xs:element name=\"patternExpression\" type=\"Expression\"/>\r\n           <xs:element name=\"patternParameterDefinition\" type=\"ParameterDefinition\"/>\r\n           <xs:element name=\"patternRelatedArtifact\" type=\"RelatedArtifact\"/>\r\n           <xs:element name=\"patternTriggerDefinition\" type=\"TriggerDefinition\"/>\r\n           <xs:element name=\"patternUsageContext\" type=\"UsageContext\"/>\r\n           <xs:element name=\"patternDosage\" type=\"Dosage\"/>\r\n           <xs:element name=\"patternMeta\" type=\"Meta\"/>\r\n         </xs:choice>\r\n          <xs:element name=\"example\" type=\"ElementDefinition.Example\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A sample value for this element demonstrating the type of information that would typically be found in the element.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"minValueDate\" type=\"date\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"minValueDateTime\" type=\"dateTime\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"minValueInstant\" type=\"instant\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"minValueTime\" type=\"time\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"minValueDecimal\" type=\"decimal\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"minValueInteger\" type=\"integer\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"minValuePositiveInt\" type=\"positiveInt\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"minValueUnsignedInt\" type=\"unsignedInt\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"minValueQuantity\" type=\"Quantity\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.</xs:documentation>\r\n            </xs:annotation>\r\n           <xs:element name=\"maxValueDate\" type=\"date\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"maxValueDateTime\" type=\"dateTime\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"maxValueInstant\" type=\"instant\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"maxValueTime\" type=\"time\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"maxValueDecimal\" type=\"decimal\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"maxValueInteger\" type=\"integer\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"maxValuePositiveInt\" type=\"positiveInt\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"maxValueUnsignedInt\" type=\"unsignedInt\"  maxOccurs=\"1\"/>\r\n           <xs:element name=\"maxValueQuantity\" type=\"Quantity\"  maxOccurs=\"1\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"maxLength\" type=\"integer\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"condition\" type=\"id\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to an invariant that may make additional statements about the cardinality or value in the instance.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"constraint\" type=\"ElementDefinition.Constraint\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"mustSupport\" type=\"boolean\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If true, implementations that produce or consume resources SHALL provide &quot;support&quot; for the element in some meaningful way.  If false, the element may be ignored and not supported. If false, whether to populate or use the data element in any way is at the discretion of the implementation.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"isModifier\" type=\"boolean\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"isModifierReason\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explains how that element affects the interpretation of the resource or element that contains it.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"isSummary\" type=\"boolean\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the element should be included if a client requests a search with the parameter _summary=true.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"binding\" type=\"ElementDefinition.Binding\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Binds to a value set if this element is coded (code, Coding, CodeableConcept, Quantity), or the data types (string, uri).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"mapping\" type=\"ElementDefinition.Mapping\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies a concept from an external specification that roughly corresponds to this element.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ElementDefinition.Constraint\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"key\" type=\"id\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Allows identification of which elements have their cardinalities impacted by the constraint.  Will not be referenced for constraints that do not affect cardinality.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requirements\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of why this constraint is necessary or appropriate.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"severity\" type=\"ConstraintSeverity\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the impact constraint violation has on the conformance of the instance.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"human\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Text that can be used to describe the constraint in messages identifying that the constraint has been violated.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A [FHIRPath](fhirpath.html) expression of constraint that can be executed to see if this constraint is met.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"xpath\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An XPath expression of constraint that can be executed to see if this constraint is met.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the original source of the constraint, for traceability purposes.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ElementDefinition.Mapping\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identity\" type=\"id\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An internal reference to the definition of a mapping.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"language\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the computable language in which mapping.map is expressed.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"map\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Expresses what part of the target specification corresponds to this element.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments that provide information about the mapping or its use.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ElementDefinition.Base\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"path\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"min\" type=\"unsignedInt\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Minimum cardinality of the base element identified by the path.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"max\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Maximum cardinality of the base element identified by the path.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ElementDefinition.Type\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" type=\"uri\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">URL of Data type or Resource that is a(or the) type used for this element. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. &quot;string&quot; is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies a profile structure or implementation Guide that applies to the datatype this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the type SHALL conform to at least one profile defined in the implementation guide.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"targetProfile\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used when the type is &quot;Reference&quot; or &quot;canonical&quot;, and identifies a profile structure or implementation Guide that applies to the target of the reference this element refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"aggregation\" type=\"AggregationMode\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"versioning\" type=\"ReferenceVersionRules\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this reference needs to be version specific or version independent, or whether either can be used.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ElementDefinition.Example\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"label\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the purpose of this example amoung the set of examples.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        <xs:choice minOccurs=\"1\" maxOccurs=\"1\">\r\n           <xs:annotation>\r\n             <xs:documentation xml:lang=\"en\">The actual value for the element, which must be one of the types allowed for this element.</xs:documentation>\r\n           </xs:annotation>\r\n           <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\r\n           <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n           <xs:element name=\"valueCanonical\" type=\"canonical\"/>\r\n           <xs:element name=\"valueCode\" type=\"code\"/>\r\n           <xs:element name=\"valueDate\" type=\"date\"/>\r\n           <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\r\n           <xs:element name=\"valueDecimal\" type=\"decimal\"/>\r\n           <xs:element name=\"valueId\" type=\"id\"/>\r\n           <xs:element name=\"valueInstant\" type=\"instant\"/>\r\n           <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n           <xs:element name=\"valueMarkdown\" type=\"markdown\"/>\r\n           <xs:element name=\"valueOid\" type=\"oid\"/>\r\n           <xs:element name=\"valuePositiveInt\" type=\"positiveInt\"/>\r\n           <xs:element name=\"valueString\" type=\"string\"/>\r\n           <xs:element name=\"valueTime\" type=\"time\"/>\r\n           <xs:element name=\"valueUnsignedInt\" type=\"unsignedInt\"/>\r\n           <xs:element name=\"valueUri\" type=\"uri\"/>\r\n           <xs:element name=\"valueUrl\" type=\"url\"/>\r\n           <xs:element name=\"valueUuid\" type=\"uuid\"/>\r\n           <xs:element name=\"valueAddress\" type=\"Address\"/>\r\n           <xs:element name=\"valueAge\" type=\"Age\"/>\r\n           <xs:element name=\"valueAnnotation\" type=\"Annotation\"/>\r\n           <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\r\n           <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\r\n           <xs:element name=\"valueCoding\" type=\"Coding\"/>\r\n           <xs:element name=\"valueContactPoint\" type=\"ContactPoint\"/>\r\n           <xs:element name=\"valueCount\" type=\"Count\"/>\r\n           <xs:element name=\"valueDistance\" type=\"Distance\"/>\r\n           <xs:element name=\"valueDuration\" type=\"Duration\"/>\r\n           <xs:element name=\"valueHumanName\" type=\"HumanName\"/>\r\n           <xs:element name=\"valueIdentifier\" type=\"Identifier\"/>\r\n           <xs:element name=\"valueMoney\" type=\"Money\"/>\r\n           <xs:element name=\"valuePeriod\" type=\"Period\"/>\r\n           <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n           <xs:element name=\"valueRange\" type=\"Range\"/>\r\n           <xs:element name=\"valueRatio\" type=\"Ratio\"/>\r\n           <xs:element name=\"valueReference\" type=\"Reference\"/>\r\n           <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\r\n           <xs:element name=\"valueSignature\" type=\"Signature\"/>\r\n           <xs:element name=\"valueTiming\" type=\"Timing\"/>\r\n           <xs:element name=\"valueContactDetail\" type=\"ContactDetail\"/>\r\n           <xs:element name=\"valueContributor\" type=\"Contributor\"/>\r\n           <xs:element name=\"valueDataRequirement\" type=\"DataRequirement\"/>\r\n           <xs:element name=\"valueExpression\" type=\"Expression\"/>\r\n           <xs:element name=\"valueParameterDefinition\" type=\"ParameterDefinition\"/>\r\n           <xs:element name=\"valueRelatedArtifact\" type=\"RelatedArtifact\"/>\r\n           <xs:element name=\"valueTriggerDefinition\" type=\"TriggerDefinition\"/>\r\n           <xs:element name=\"valueUsageContext\" type=\"UsageContext\"/>\r\n           <xs:element name=\"valueDosage\" type=\"Dosage\"/>\r\n           <xs:element name=\"valueMeta\" type=\"Meta\"/>\r\n         </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ElementDefinition.Slicing\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"discriminator\" type=\"ElementDefinition.Discriminator\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"ordered\" type=\"boolean\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the matching elements have to occur in the same order as defined in the profile.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rules\" type=\"SlicingRules\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ElementDefinition.Binding\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"strength\" type=\"BindingStrength\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" type=\"string\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the intended use of this particular set of codes.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"valueSet\" type=\"canonical\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Refers to the value set that identifies the set of codes the binding refers to.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ElementDefinition.Discriminator\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource, profile, or extension.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" type=\"DiscriminatorType\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the element value is interpreted when discrimination is evaluated.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"path\" type=\"string\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A FHIRPath expression, using [the simple subset of FHIRPath](fhirpath.html#simple), that is used to identify the element on which discrimination is based.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"PropertyRepresentation-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"xmlAttr\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">XML Attribute</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"xmlText\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">XML Text</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"typeAttr\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Type Attribute</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cdaText\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CDA Text Format</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"xhtml\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">XHTML</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"PropertyRepresentation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How a property is represented when serialized.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"PropertyRepresentation-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ConstraintSeverity-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"warning\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Warning</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ConstraintSeverity\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">SHALL applications comply with this constraint?</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"ConstraintSeverity-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AggregationMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"contained\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Contained</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"referenced\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Referenced</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"bundled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Bundled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AggregationMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How resource references can be aggregated.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"AggregationMode-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ReferenceVersionRules-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"either\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Either Specific or independent</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"independent\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Version independent</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"specific\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Version Specific</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ReferenceVersionRules\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Whether a reference needs to be version specific or version independent, or whether either can be used.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"ReferenceVersionRules-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SlicingRules-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"closed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Closed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"open\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"openAtEnd\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open at End</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SlicingRules\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How slices are interpreted when evaluating an instance.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"SlicingRules-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"BindingStrength-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"required\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Required</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"extensible\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Extensible</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"preferred\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Preferred</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"example\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Example</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"BindingStrength\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indication of the degree of conformance expectations associated with a binding.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"BindingStrength-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DiscriminatorType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"value\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Value</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"exists\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Exists</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"pattern\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Pattern</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"type\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Type</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"profile\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Profile</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DiscriminatorType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How an element value is interpreted when discrimination is evaluated.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"DiscriminatorType-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DomainResource\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A resource that includes narrative, extensions, and contained resources.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Resource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"text\" type=\"Narrative\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it &quot;clinically safe&quot; for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contained\" type=\"ResourceContainer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"extension\" type=\"Extension\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifierExtension\" type=\"Extension\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Resource\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This is the base resource type for everything.</xs:documentation>\r\n    </xs:annotation>\r\n        <xs:sequence>\r\n          <xs:element name=\"id\" type=\"id\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"meta\" type=\"Meta\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"implicitRules\" type=\"uri\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"language\" type=\"code\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The base language in which the resource is written.</xs:documentation>\r\n            </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"PublicationStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"draft\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\r\n          <xs:documentation xml:lang=\"ru\">черновик</xs:documentation>\r\n          <xs:documentation xml:lang=\"nl\">ontwerp</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n          <xs:documentation xml:lang=\"ru\">активный</xs:documentation>\r\n          <xs:documentation xml:lang=\"nl\">actief</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"retired\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Retired</xs:documentation>\r\n          <xs:documentation xml:lang=\"ru\">удалён</xs:documentation>\r\n          <xs:documentation xml:lang=\"nl\">verouderd</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"PublicationStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"PublicationStatus-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SearchParamType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"number\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Number</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"date\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Date/DateTime</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"string\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">String</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"token\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Token</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"reference\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Reference</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"composite\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Composite</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"quantity\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Quantity</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"uri\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">URI</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"special\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Special</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SearchParamType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"SearchParamType-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AdministrativeGender-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"male\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Male</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"female\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Female</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"other\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Other</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AdministrativeGender\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"AdministrativeGender-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"FHIRVersion-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"0.01\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">0.01</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"0.05\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">0.05</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"0.06\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">0.06</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"0.11\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">0.11</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"0.0.80\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">0.0.80</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"0.0.81\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">0.0.81</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"0.0.82\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">0.0.82</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"0.4.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">0.4.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"0.5.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">0.5.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"1.0.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">1.0.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"1.0.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">1.0.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"1.0.2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">1.0.2</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"1.1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">1.1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"1.4.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">1.4.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"1.6.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">1.6.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"1.8.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">1.8.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"3.0.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">3.0.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"3.0.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">3.0.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"3.3.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">3.3.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"3.5.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">3.5.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"4.0.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">4.0.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"4.0.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">4.0.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"FHIRVersion\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"FHIRVersion-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"NoteType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"display\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Display</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"print\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Print (Form)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"printoper\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Print (Operator)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"NoteType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"NoteType-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"RemittanceOutcome-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"queued\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Queued</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"complete\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Processing Complete</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"partial\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Partial Processing</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"RemittanceOutcome\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"RemittanceOutcome-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ConceptMapEquivalence-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"relatedto\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Related To</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"equivalent\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Equivalent</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"equal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Equal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"wider\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Wider</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"subsumes\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Subsumes</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"narrower\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Narrower</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"specializes\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Specializes</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"inexact\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Inexact</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unmatched\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unmatched</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"disjoint\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Disjoint</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ConceptMapEquivalence\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"ConceptMapEquivalence-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DocumentReferenceStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"current\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Current</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"superseded\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Superseded</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DocumentReferenceStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\"></xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n       <xs:extension base=\"Element\">\r\n         <xs:attribute name=\"value\" type=\"DocumentReferenceStatus-list\" use=\"optional\"/>\r\n       </xs:extension>\r\n     </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Account\" type=\"Account\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Account\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique identifier used to reference the account.  Might or might not be intended for human use (e.g. credit card number).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"AccountStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether the account is presently used/usable or not.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Categorizes the account for reporting and searching purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name used for the account when displaying it to humans in reports, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the entity which incurs the expenses. While the immediate recipients of services or goods might be entities related to the subject, the expenses were ultimately incurred by the subject of the Account.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"servicePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date range of services associated with this account.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"coverage\" type=\"Account.Coverage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"owner\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the service area, hospital, department, etc. with responsibility for managing the Account.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides additional information about what the account tracks and how it is used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"guarantor\" type=\"Account.Guarantor\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The parties responsible for balancing the account if other payment options fall short.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to a parent Account.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Account.Coverage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"coverage\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party(s) that contribute to payment (or part of) of the charges applied to this account (including self-pay).\n\nA coverage may only be responsible for specific types of charges, and the sequence of the coverages in the account could be important when processing billing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The priority of the coverage in the context of this account.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Account.Guarantor\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A financial tool for tracking value accrued for a particular purpose.  In the healthcare field, used to track charges for a patient, cost centers, etc.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"party\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The entity who is responsible.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"onHold\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A guarantor may be placed on credit hold or otherwise have their role temporarily suspended.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The timeframe during which the guarantor accepts responsibility for the account.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AccountStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"inactive\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-hold\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AccountStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates whether the account is available to be used.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AccountStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ActivityDefinition\" type=\"ActivityDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ActivityDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this activity definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this activity definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the activity definition is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this activity definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the activity definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the activity definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the activity definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the activity definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the activity definition giving additional information about its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this activity definition. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this activity definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code or group definition that describes the intended subject of the activity being defined.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the activity definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the activity definition changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the activity definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the activity definition from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate activity definition instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the activity definition is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this activity definition is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A detailed description of how the activity definition is used from a clinical perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the activity definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the activity definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the activity definition content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the activity. Topics provide a high-level categorization of the activity that can be useful for filtering and searching.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"library\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a Library resource containing any formal logic used by the activity definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"kind\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestResourceType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the kind of resource the activity definition is representing. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest. Typically, but not always, this is a Request resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A profile to which the target of the activity definition is expected to conform.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestIntent\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the level of authority/intentionality associated with the activity and where the request should fit into the workflow chain.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the activity  should be addressed with respect to other requests.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"doNotPerform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Set this to true if the definition is to indicate that a particular activity should NOT be performed. If true, this element should be interpreted to reinforce a negative coding. For example NPO as a code with a doNotPerform of true would still indicate to NOT perform the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period, timing or frequency upon which the described activity is to occur.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"timingTiming\" type=\"Timing\"/>\r\n            <xs:element name=\"timingDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"timingAge\" type=\"Age\"/>\r\n            <xs:element name=\"timingPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"timingRange\" type=\"Range\"/>\r\n            <xs:element name=\"timingDuration\" type=\"Duration\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"participant\" type=\"ActivityDefinition.Participant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who should participate in performing the action described.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the food, drug or other product being consumed or supplied in the activity.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"productReference\" type=\"Reference\"/>\r\n            <xs:element name=\"productCodeableConcept\" type=\"CodeableConcept\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dosage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Dosage\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides detailed dosage instructions in the same way that they are described for MedicationRequest resources.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specimenRequirement\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines specimen requirements for the action to be performed, such as required specimens for a lab test.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"observationRequirement\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines observation requirements for the action to be performed, such as body weight or surface area.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"observationResultRequirement\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines the observations that are expected to be produced by the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"transform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dynamicValue\" type=\"ActivityDefinition.DynamicValue\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an expression that calculated the weight, and the path on the request resource that would contain the result.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ActivityDefinition.Participant\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ActionParticipantType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of participant in the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The role the participant should play in performing the described action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ActivityDefinition.DynamicValue\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of some activity to be performed, independent of a particular patient, practitioner, or other performance context.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"path\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Expression\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An expression specifying the value of the customized element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ActionParticipantType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"patient\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Patient</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"practitioner\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Practitioner</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"related-person\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Related Person</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"device\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Device</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ActionParticipantType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of participant in the activity.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ActionParticipantType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"RequestIntent-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"proposal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Proposal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"plan\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Plan</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"directive\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Directive</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"original-order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Original Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"reflex-order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Reflex Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"filler-order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Filler Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"instance-order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Instance Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"option\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Option</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"RequestIntent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Codes indicating the degree of authority/intentionality associated with a request.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"RequestIntent-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"RequestResourceType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"Appointment\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Appointment</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AppointmentResponse\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">AppointmentResponse</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CarePlan\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CarePlan</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Claim\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Claim</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CommunicationRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CommunicationRequest</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Contract\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Contract</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DeviceRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DeviceRequest</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EnrollmentRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">EnrollmentRequest</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ImmunizationRecommendation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ImmunizationRecommendation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicationRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicationRequest</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NutritionOrder\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">NutritionOrder</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ServiceRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ServiceRequest</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SupplyRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SupplyRequest</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Task\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Task</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"VisionPrescription\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">VisionPrescription</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"RequestResourceType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The kind of activity the definition is describing.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"RequestResourceType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"RequestPriority-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"routine\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Routine</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"urgent\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Urgent</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"asap\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ASAP</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"stat\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">STAT</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"RequestPriority\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Identifies the level of importance to be assigned to actioning the request.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"RequestPriority-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"AdverseEvent\" type=\"AdverseEvent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Actual or  potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"AdverseEvent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Actual or  potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this adverse event by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actuality\" minOccurs=\"1\" maxOccurs=\"1\" type=\"AdverseEventActuality\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the event actually happened, or just had the potential to. Note that this is independent of whether anyone was affected or harmed or how severely.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The overall type of event, intended for search and filtering purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"event\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This element defines the specific type of event that occurred or that was prevented from occurring.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This subject or group impacted by the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Encounter during which AdverseEvent was created or to which the creation of this record is tightly associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date (and perhaps time) when the adverse event occurred.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detected\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Estimated or actual date the AdverseEvent began, in the opinion of the reporter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recordedDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the existence of the AdverseEvent was first recorded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resultingCondition\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Includes information about the reaction that occurred as a result of exposure to a substance (for example, a drug or a chemical).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The information about where the adverse event occurred.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"seriousness\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Assessment whether this event was of real importance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"severity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the severity of the adverse event, in relation to the subject. Contrast to AdverseEvent.seriousness - a severe rash might not be serious, but a mild heart problem is.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the type of outcome from the adverse event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recorder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information on who recorded the adverse event.  May be the patient or a practitioner.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contributor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Parties that may or should contribute or have contributed information to the adverse event, which can consist of one or more activities.  Such information includes information leading to the decision to perform the activity and how to perform the activity (e.g. consultant), information that the activity itself seeks to reveal (e.g. informant of clinical history), or information about what activity was performed (e.g. informant witness).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"suspectEntity\" type=\"AdverseEvent.SuspectEntity\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the entity that is suspected to have caused the adverse event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subjectMedicalHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">AdverseEvent.subjectMedicalHistory.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referenceDocument\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">AdverseEvent.referenceDocument.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"study\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">AdverseEvent.study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"AdverseEvent.SuspectEntity\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Actual or  potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"instance\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the actual instance of what caused the adverse event.  May be a substance, medication, medication administration, medication statement or a device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"causality\" type=\"AdverseEvent.Causality\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information on the possible cause of the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"AdverseEvent.Causality\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Actual or  potential/avoided event causing unintended physical injury resulting from or contributed to by medical care, a research study or other healthcare setting factors that requires additional monitoring, treatment, or hospitalization, or that results in death.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"assessment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Assessment of if the entity caused the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productRelatedness\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">AdverseEvent.suspectEntity.causalityProductRelatedness.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">AdverseEvent.suspectEntity.causalityAuthor.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">ProbabilityScale | Bayesian | Checklist.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AdverseEventActuality-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"actual\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Adverse Event</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"potential\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Potential Adverse Event</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AdverseEventActuality\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Overall nature of the adverse event, e.g. real or potential.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AdverseEventActuality-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"AllergyIntolerance\" type=\"AllergyIntolerance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"AllergyIntolerance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this AllergyIntolerance by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"clinicalStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The clinical status of the allergy or intolerance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"verificationStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AllergyIntoleranceType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identification of the underlying physiological mechanism for the reaction risk.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"AllergyIntoleranceCategory\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Category of the identified substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"criticality\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AllergyIntoleranceCriticality\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., &quot;Latex&quot;), an allergy or intolerance condition (e.g., &quot;Latex allergy&quot;), or a negated/excluded code for a specific substance or class (e.g., &quot;No latex allergy&quot;) or a general or categorical negated statement (e.g.,  &quot;No known allergy&quot;, &quot;No known drug allergies&quot;).  Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient who has the allergy or intolerance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The encounter when the allergy or intolerance was asserted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Estimated or actual date,  date-time, or age when allergy or intolerance was identified.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"onsetDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"onsetAge\" type=\"Age\"/>\r\n            <xs:element name=\"onsetPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"onsetRange\" type=\"Range\"/>\r\n            <xs:element name=\"onsetString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"recordedDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recorder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Individual who recorded the record and takes responsibility for its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"asserter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The source of the information about the allergy that is recorded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastOccurrence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Represents the date and/or time of the last known occurrence of a reaction event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reaction\" type=\"AllergyIntolerance.Reaction\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details about each adverse reaction event linked to exposure to the identified substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"AllergyIntolerance.Reaction\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"substance\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manifestation\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Text description about the reaction as a whole, including details of the manifestation if required.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"onset\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Record of the date and/or time of the onset of the Reaction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"severity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AllergyIntoleranceSeverity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exposureRoute\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identification of the route by which the subject was exposed to the substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional text about the adverse reaction event not captured in other fields.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AllergyIntoleranceCriticality-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"low\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Low Risk</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"high\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">High Risk</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unable-to-assess\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unable to Assess Risk</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AllergyIntoleranceCriticality\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Estimate of the potential clinical harm, or seriousness, of a reaction to an identified substance.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AllergyIntoleranceCriticality-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AllergyIntoleranceType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"allergy\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Allergy</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"intolerance\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Intolerance</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AllergyIntoleranceType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Identification of the underlying physiological mechanism for a Reaction Risk.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AllergyIntoleranceType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AllergyIntoleranceCategory-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"food\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Food</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"medication\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Medication</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"environment\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Environment</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"biologic\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Biologic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AllergyIntoleranceCategory\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Category of an identified substance associated with allergies or intolerances.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AllergyIntoleranceCategory-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AllergyIntoleranceSeverity-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"mild\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Mild</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"moderate\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Moderate</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"severe\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Severe</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AllergyIntoleranceSeverity\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different manifestations.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AllergyIntoleranceSeverity-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Appointment\" type=\"Appointment\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Appointment\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This records identifiers associated with this appointment concern that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"AppointmentStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cancelationReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The coded reason for the appointment being cancelled. This is often used in reporting/billing/futher processing to determine if further actions are required, or specific fees apply.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"serviceCategory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A broad categorization of the service that is to be performed during this appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"serviceType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific service that is to be performed during this appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specialty of a practitioner that would be required to perform the service requested in this appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"appointmentType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The style of appointment or patient that has been booked in the slot (not service type).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The coded reason that this appointment is being scheduled. This is more clinical than administrative.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reason the appointment has been scheduled to take place, as specified using information from another resource. When the patient arrives and the encounter begins it may be used as the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInformation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information to support the appointment provided when making the appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date/Time that the appointment is to take place.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date/Time that the appointment is to conclude.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"minutesDuration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number of minutes that the appointment is to take. This can be less than the duration between the start and end times.  For example, where the actual time of appointment is only an estimate or if a 30 minute appointment is being requested, but any time would work.  Also, if there is, for example, a planned 15 minute break in the middle of a long appointment, the duration may be 15 minutes less than the difference between the start and end.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"slot\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The slots from the participants' schedules that will be filled by the appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"created\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional comments about the appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patientInstruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">While Appointment.comment contains information for internal use, Appointment.patientInstructions is used to capture patient facing information about the Appointment (e.g. please bring your referral or fast from 8pm night before).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The service request this appointment is allocated to assess (e.g. incoming referral or procedure request).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"participant\" type=\"Appointment.Participant\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">List of participants involved in the appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requestedPeriod\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A set of date ranges (potentially including times) that the appointment is preferred to be scheduled within.\n\nThe duration (usually in minutes) could also be provided to indicate the length of the appointment to fill and populate the start/end times for the actual allocated time. However, in other situations the duration may be calculated by the scheduling system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Appointment.Participant\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Role of participant in the appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Person, Location/HealthcareService or Device that is participating in the appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"required\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ParticipantRequired\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this participant is required to be present at the meeting. This covers a use-case where two doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ParticipationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Participation status of the actor.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Participation period of the actor.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ParticipantRequired-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"required\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Required</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"optional\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Optional</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"information-only\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Information Only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ParticipantRequired\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Is the Participant required to attend the appointment.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ParticipantRequired-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AppointmentStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"proposed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Proposed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"pending\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Pending</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"booked\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Booked</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"arrived\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Arrived</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"fulfilled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Fulfilled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"noshow\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">No Show</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"checked-in\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Checked In</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"waitlist\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Waitlisted</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AppointmentStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The free/busy status of an appointment.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AppointmentStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ParticipationStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"accepted\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Accepted</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"declined\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Declined</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"tentative\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Tentative</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"needs-action\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Needs Action</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ParticipationStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Participation status of an appointment.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ParticipationStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"AppointmentResponse\" type=\"AppointmentResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"AppointmentResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This records identifiers associated with this appointment response concern that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"appointment\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Appointment that this response is replying to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date/Time that the appointment is to take place, or requested new start time.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"participantType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Role of participant in the appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Person, Location, HealthcareService, or Device that is participating in the appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"participantStatus\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ParticipationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional comments about the appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"AuditEvent\" type=\"AuditEvent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"AuditEvent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtype\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for the category of event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"action\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AuditEventAction\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicator for type of action performed during the event that generated the audit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the activity occurred.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recorded\" minOccurs=\"1\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time when the event was recorded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AuditEventOutcome\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether the event succeeded or failed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcomeDesc\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text description of the outcome of the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purposeOfEvent\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The purposeOfUse (reason) that was used during the event being recorded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"agent\" type=\"AuditEvent.Agent\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An actor taking an active role in the event or activity that is logged.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" type=\"AuditEvent.Source\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The system that is reporting the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"entity\" type=\"AuditEvent.Entity\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific instances of data or objects that have been accessed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"AuditEvent.Agent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specification of the participation type the user plays when performing the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The security role that the user was acting under, that come from local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"who\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to who this agent is that was involved in the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"altId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-meaningful name for the agent.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requestor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicator that the user is or is not the requestor, or initiator, for the event being audited.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where the event occurred.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"policy\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"media\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of media involved. Used when the event is about exporting/importing onto media.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"network\" type=\"AuditEvent.Network\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Logical network location for application activity, if the activity has a network location.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purposeOfUse\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reason (purpose of use), specific to this agent, that was used during the event being recorded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"AuditEvent.Network\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier for the network access point of the user device for the audit event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AuditEventAgentNetworkType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier for the type of network access point that originated the audit event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"AuditEvent.Source\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"site\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"observer\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier of the source where the event was detected.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code specifying the type of source where event originated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"AuditEvent.Entity\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"what\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies a specific instance of the entity. The reference should be version specific.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the object that was involved in this audit event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code representing the role the entity played in the event being audited.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lifecycle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for the data life-cycle stage for the entity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"securityLabel\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Security labels for the identified entity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name of the entity in the audit event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Text that describes the entity in more detail.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"query\" minOccurs=\"0\" maxOccurs=\"1\" type=\"base64Binary\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The query parameters for a query-type entities.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" type=\"AuditEvent.Detail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Tagged value pairs for conveying additional information about the entity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"AuditEvent.Detail\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of extra detail provided in the value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The  value of the extra detail.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AuditEventOutcome-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Success</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"4\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Minor failure</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"8\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Serious failure</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"12\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Major failure</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AuditEventOutcome\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates whether the event succeeded or failed.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AuditEventOutcome-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AuditEventAction-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"C\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Create</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"R\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Read/View/Print</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"U\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Update</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"D\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Delete</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"E\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Execute</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AuditEventAction\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicator for type of action performed during the event that generated the event.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AuditEventAction-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AuditEventAgentNetworkType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Machine Name</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">IP Address</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"3\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Telephone Number</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"4\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Email address</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"5\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">URI</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AuditEventAgentNetworkType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of network access point of this agent in the audit event.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AuditEventAgentNetworkType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Basic\" type=\"Basic\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Basic\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier assigned to the resource for business purposes, outside the context of FHIR.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the 'type' of resource - equivalent to the resource name for other resources.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the patient, practitioner, device or any other resource that is the &quot;focus&quot; of this resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"created\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies when the resource was first created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who was responsible for creating the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Binary\" type=\"Binary\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A resource that represents the data of a single raw artifact as digital content accessible in its native format.  A Binary resource can contain any content, whether text, image, pdf, zip archive, etc.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Binary\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A resource that represents the data of a single raw artifact as digital content accessible in its native format.  A Binary resource can contain any content, whether text, image, pdf, zip archive, etc.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Resource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"contentType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">MimeType of the binary content represented as a standard MimeType (BCP 13).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"securityContext\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This element identifies another resource that can be used as a proxy of the security sensitivity to use when deciding and enforcing access control rules for the Binary resource. Given that the Binary resource contains very few elements that can be used to determine the sensitivity of the data and relationships to individuals, the referenced resource stands in as a proxy equivalent for this purpose. This referenced resource may be related to the Binary (e.g. Media, DocumentReference), or may be some non-related Resource purely as a security proxy. E.g. to identify that the binary resource relates to a patient, and access should only be granted to applications that have access to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"data\" minOccurs=\"0\" maxOccurs=\"1\" type=\"base64Binary\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual content, base64 encoded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"BiologicallyDerivedProduct\" type=\"BiologicallyDerivedProduct\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A material substance originating from a biological entity intended to be transplanted or infused\ninto another (possibly the same) biological entity.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"BiologicallyDerivedProduct\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A material substance originating from a biological entity intended to be transplanted or infused\ninto another (possibly the same) biological entity.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This records identifiers associated with this biologically derived product instance that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productCategory\" minOccurs=\"0\" maxOccurs=\"1\" type=\"BiologicallyDerivedProductCategory\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Broad category of this product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that identifies the kind of this biologically derived product (SNOMED Ctcode).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"BiologicallyDerivedProductStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the product is currently available.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Procedure request to obtain this biologically derived product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number of discrete units within this product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parent\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Parent product (if any).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"collection\" type=\"BiologicallyDerivedProduct.Collection\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How this product was collected.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"processing\" type=\"BiologicallyDerivedProduct.Processing\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Any processing of the product during collection that does not change the fundamental nature of the product. For example adding anti-coagulants during the collection of Peripheral Blood Stem Cells.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manipulation\" type=\"BiologicallyDerivedProduct.Manipulation\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Any manipulation of product post-collection that is intended to alter the product.  For example a buffy-coat enrichment or CD8 reduction of Peripheral Blood Stem Cells to make it more suitable for infusion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"storage\" type=\"BiologicallyDerivedProduct.Storage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Product storage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"BiologicallyDerivedProduct.Collection\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A material substance originating from a biological entity intended to be transplanted or infused\ninto another (possibly the same) biological entity.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"collector\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Healthcare professional who is performing the collection.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient or entity, such as a hospital or vendor in the case of a processed/manipulated/manufactured product, providing the product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time of product collection.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"collectedDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"collectedPeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"BiologicallyDerivedProduct.Processing\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A material substance originating from a biological entity intended to be transplanted or infused\ninto another (possibly the same) biological entity.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of of processing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"procedure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Procesing code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"additive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Substance added during processing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time of processing.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"timeDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"timePeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"BiologicallyDerivedProduct.Manipulation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A material substance originating from a biological entity intended to be transplanted or infused\ninto another (possibly the same) biological entity.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of manipulation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time of manipulation.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"timeDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"timePeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"BiologicallyDerivedProduct.Storage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A material substance originating from a biological entity intended to be transplanted or infused\ninto another (possibly the same) biological entity.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of storage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"temperature\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Storage temperature.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"scale\" minOccurs=\"0\" maxOccurs=\"1\" type=\"BiologicallyDerivedProductStorageScale\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Temperature scale used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"duration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Storage timeperiod.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"BiologicallyDerivedProductCategory-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"organ\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Organ</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"tissue\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Tissue</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"fluid\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Fluid</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cells\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cells</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"biologicalAgent\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BiologicalAgent</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"BiologicallyDerivedProductCategory\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Biologically Derived Product Category.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"BiologicallyDerivedProductCategory-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"BiologicallyDerivedProductStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"available\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Available</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unavailable\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unavailable</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"BiologicallyDerivedProductStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Biologically Derived Product Status.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"BiologicallyDerivedProductStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"BiologicallyDerivedProductStorageScale-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"farenheit\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Fahrenheit</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"celsius\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Celsius</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"kelvin\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Kelvin</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"BiologicallyDerivedProductStorageScale\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">BiologicallyDerived Product Storage Scale.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"BiologicallyDerivedProductStorageScale-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"BodyStructure\" type=\"BodyStructure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Record details about an anatomical structure.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"BodyStructure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Record details about an anatomical structure.  This resource may be used when a coded concept does not provide the necessary detail needed for the use case.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for this instance of the anatomical structure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this body site is in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"morphology\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of structure being represented by the body structure at `BodyStructure.location`.  This can define both normal and abnormal morphologies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The anatomical location or region of the specimen, lesion, or body structure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"locationQualifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Qualifier to refine the anatomical location.  These include qualifiers for laterality, relative location, directionality, number, and plane.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A summary, characterization or explanation of the body structure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"image\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Image or images used to identify a location.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person to which the body site belongs.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Bundle\" type=\"Bundle\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Bundle\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Resource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A persistent identifier for the bundle that won't change as a bundle is copied from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"BundleType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the purpose of this bundle - how it is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"timestamp\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"total\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If a set of search matches, this is the total number of entries of type 'match' across all pages in the search.  It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"link\" type=\"Bundle.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A series of links that provide context to this bundle.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"entry\" type=\"Bundle.Entry\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"signature\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Signature\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Digital Signature - base64 encoded. XML-DSig or a JWT.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Bundle.Link\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"relation\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reference details for the link.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Bundle.Entry\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"link\" type=\"Bundle.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A series of links that provide context to this entry.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fullUrl\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Absolute URL for the resource.  The fullUrl SHALL NOT disagree with the id in the resource - i.e. if the fullUrl is not a urn:uuid, the URL shall be version-independent URL consistent with the Resource.id. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: \n* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)\n* Results from operations might involve resources that are not identified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ResourceContainer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Resource for the entry. The purpose/meaning of the resource is determined by the Bundle.type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"search\" type=\"Bundle.Search\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the search process that lead to the creation of this entry.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"request\" type=\"Bundle.Request\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information about how this entry should be processed as part of a transaction or batch.  For history, it shows how the entry was processed to create the version contained in the entry.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"response\" type=\"Bundle.Response\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the results of processing the corresponding 'request' entry in the batch or transaction being responded to or what the results of an operation where when returning history.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Bundle.Search\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"mode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SearchEntryMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Why this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"score\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When searching, the server's search ranking score for the entry.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Bundle.Request\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"method\" minOccurs=\"1\" maxOccurs=\"1\" type=\"HTTPVerb\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">In a transaction or batch, this is the HTTP action to be executed for this entry. In a history bundle, this indicates the HTTP action that occurred.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL for this entry, relative to the root (the address to which the request is posted).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"ifNoneMatch\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the ETag values match, return a 304 Not Modified status. See the API documentation for [&quot;Conditional Read&quot;](http.html#cread).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"ifModifiedSince\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Only perform the operation if the last updated date matches. See the API documentation for [&quot;Conditional Read&quot;](http.html#cread).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"ifMatch\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Only perform the operation if the Etag value matches. For more information, see the API section [&quot;Managing Resource Contention&quot;](http.html#concurrency).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"ifNoneExist\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [&quot;Conditional Create&quot;](http.html#ccreate). This is just the query portion of the URL - what follows the &quot;?&quot; (not including the &quot;?&quot;).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Bundle.Response\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A container for a collection of resources.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The location header created by processing this operation, populated if the operation returns a location.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"etag\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Etag for the resource, if the operation for the entry produced a versioned resource (see [Resource Metadata and Versioning](http.html#versioning) and [Managing Resource Contention](http.html#concurrency)).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastModified\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date/time that the resource was modified on the server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ResourceContainer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An OperationOutcome containing hints and warnings produced as part of processing this entry in a batch or transaction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"HTTPVerb-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"GET\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GET</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"HEAD\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">HEAD</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"POST\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">POST</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PUT\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PUT</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DELETE\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DELETE</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PATCH\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PATCH</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"HTTPVerb\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">HTTP verbs (in the HTTP command line). See [HTTP rfc](https://tools.ietf.org/html/rfc7231) for details.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"HTTPVerb-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"BundleType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"document\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Document</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"message\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Message</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"transaction\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Transaction</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"transaction-response\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Transaction Response</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"batch\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Batch</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"batch-response\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Batch Response</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"history\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">History List</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"searchset\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Search Results</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"collection\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Collection</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"BundleType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates the purpose of a bundle - how it is intended to be used.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"BundleType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SearchEntryMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"match\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Match</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"include\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Include</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"outcome\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Outcome</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SearchEntryMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Why an entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"SearchEntryMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"CapabilityStatement\" type=\"CapabilityStatement\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"CapabilityStatement\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this capability statement when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this capability statement is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the capability statement is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the capability statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the capability statement author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the capability statement. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the capability statement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this capability statement. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this capability statement is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the capability statement was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the capability statement changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the capability statement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the capability statement from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate capability statement instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the capability statement is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this capability statement is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the capability statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the capability statement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CapabilityStatementKind\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind, not instance of software) or a class of implementation (e.g. a desired purchase).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiates\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to a canonical URL of another CapabilityStatement that this software implements. This capability statement is a published API description that corresponds to a business service. The server may actually implement a subset of the capability statement it claims to implement, so the capability statement must specify the full capability details.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"imports\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to a canonical URL of another CapabilityStatement that this software adds to. The capability statement automatically includes everything in the other statement, and it is not duplicated, though the server may repeat the same resources, interactions and operations to add additional details to them.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"software\" type=\"CapabilityStatement.Software\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Software that is covered by this capability statement.  It is used when the capability statement describes the capabilities of a particular software version, independent of an installation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"implementation\" type=\"CapabilityStatement.Implementation\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies a specific implementation instance that is described by the capability statement - i.e. a particular installation, rather than the capabilities of a software program.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fhirVersion\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FHIRVersion\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version of the FHIR specification that this CapabilityStatement describes (which SHALL be the same as the FHIR version of the CapabilityStatement itself). There is no default value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"format\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of the formats supported by this implementation using their content types.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patchFormat\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of the patch formats supported by this implementation using their content types.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"implementationGuide\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of implementation guides that the server does (or should) support in their entirety.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rest\" type=\"CapabilityStatement.Rest\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A definition of the restful capabilities of the solution, if any.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"messaging\" type=\"CapabilityStatement.Messaging\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the messaging capabilities of the solution.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"document\" type=\"CapabilityStatement.Document\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A document definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.Software\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name the software is known by.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version identifier for the software covered by this statement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"releaseDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date this version of the software was released.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.Implementation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the specific installation that this capability statement relates to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"url\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute base URL for the implementation.  This forms the base for REST interfaces as well as the mailbox and document interfaces.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"custodian\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization responsible for the management of the instance and oversight of the data on the server at the specified URL.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.Rest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RestfulCapabilityMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies whether this portion of the statement is describing the ability to initiate or receive restful operations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the system's restful capabilities that apply across all applications, such as security.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"security\" type=\"CapabilityStatement.Security\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about security implementation from an interface perspective - what a client needs to know.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resource\" type=\"CapabilityStatement.Resource\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A specification of the restful capabilities of the solution for a specific resource type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"interaction\" type=\"CapabilityStatement.Interaction1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A specification of restful operations supported by the system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"searchParam\" type=\"CapabilityStatement.SearchParam\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"operation\" type=\"CapabilityStatement.Operation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Definition of an operation or a named query together with its parameters and their meaning and type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"compartment\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by its canonical URL .</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.Security\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"cors\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Server adds CORS headers when responding to requests - this enables Javascript applications to use the server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"service\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Types of security services that are supported/required by the system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">General description of how security works.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.Resource\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A type of resource exposed via the restful interface.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles](profiling.html#profile-uses).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportedProfile\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of profiles that represent different use cases supported by the system. For a server, &quot;supported by the system&quot; means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles](profiling.html#profile-uses).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information about the resource type used by the system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"interaction\" type=\"CapabilityStatement.Interaction\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies a restful operation supported by the solution.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"versioning\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ResourceVersionPolicy\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"readHistory\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A flag for whether the server is able to return past versions as part of the vRead operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"updateCreate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A flag to indicate that the server allows or needs to allow the client to create new identities on the server (that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"conditionalCreate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A flag that indicates that the server supports conditional create.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"conditionalRead\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ConditionalReadStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that indicates how the server supports conditional read.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"conditionalUpdate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A flag that indicates that the server supports conditional update.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"conditionalDelete\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ConditionalDeleteStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that indicates how the server supports conditional delete.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referencePolicy\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ReferenceHandlingPolicy\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A set of flags that defines how references are supported.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"searchInclude\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of _include values supported by the server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"searchRevInclude\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of _revinclude (reverse include) values supported by the server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"searchParam\" type=\"CapabilityStatement.SearchParam\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"operation\" type=\"CapabilityStatement.Operation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Definition of an operation or a named query together with its parameters and their meaning and type. Consult the definition of the operation for details about how to invoke the operation, and the parameters.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.Interaction\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TypeRestfulInteraction\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Coded identifier of the operation, supported by the system resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.SearchParam\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the search parameter used in the interface.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). This element SHALL be populated if the search parameter refers to a SearchParameter defined by the FHIR core specification or externally defined IGs.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SearchParamType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of value a search parameter refers to, and how the content is interpreted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This allows documentation of any distinct behaviors about how the search parameter is used.  For example, text matching algorithms.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.Operation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the operation or query. For an operation, this is the name  prefixed with $ and used in the URL. For a query, this is the name used in the _query parameter when the query is called.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definition\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where the formal definition can be found. If a server references the base definition of an Operation (i.e. from the specification itself such as ```http://hl7.org/fhir/OperationDefinition/ValueSet-expand```), that means it supports the full capabilities of the operation - e.g. both GET and POST invocation.  If it only supports a subset, it must define its own custom [[[OperationDefinition]]] with a 'base' of the original OperationDefinition.  The custom definition would describe the specific subset of functionality supported.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Documentation that describes anything special about the operation behavior, possibly detailing different behavior for system, type and instance-level invocation of the operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.Interaction1\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SystemRestfulInteraction\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A coded identifier of the operation, supported by the system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.Messaging\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"endpoint\" type=\"CapabilityStatement.Endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An endpoint (network accessible address) to which messages and/or replies are to be sent.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reliableCache\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the capability statement.  For example, the process for becoming an authorized messaging exchange partner.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportedMessage\" type=\"CapabilityStatement.SupportedMessage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">References to message definitions for messages this system can send or receive.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.Endpoint\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"protocol\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of the messaging transport protocol(s) identifiers, supported by this endpoint.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"address\" minOccurs=\"1\" maxOccurs=\"1\" type=\"url\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The network address of the endpoint. For solutions that do not use network addresses for routing, it can be just an identifier.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.SupportedMessage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EventCapabilityMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The mode of this event declaration - whether application is sender or receiver.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definition\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Points to a message definition that identifies the messaging event, message structure, allowed responses, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CapabilityStatement.Document\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server for a particular version of FHIR that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DocumentMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Mode of this document declaration - whether an application is a producer or consumer.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of how the application supports or uses the specified document profile.  For example, when documents are created, what action is taken with consumed documents, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A profile on the document Bundle that constrains which resources are present, and their contents.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"CapabilityStatementKind-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"instance\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Instance</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"capability\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Capability</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"requirements\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Requirements</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"CapabilityStatementKind\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How a capability statement is intended to be used.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"CapabilityStatementKind-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"EventCapabilityMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"sender\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Sender</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"receiver\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Receiver</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"EventCapabilityMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The mode of a message capability statement.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"EventCapabilityMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ResourceVersionPolicy-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"no-version\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">No VersionId Support</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"versioned\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Versioned</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"versioned-update\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">VersionId tracked fully</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ResourceVersionPolicy\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How the system supports versioning for a resource.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ResourceVersionPolicy-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DocumentMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"producer\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Producer</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"consumer\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Consumer</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DocumentMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Whether the application produces or consumes documents.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"DocumentMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"RestfulCapabilityMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"client\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Client</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"server\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Server</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"RestfulCapabilityMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The mode of a RESTful capability statement.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"RestfulCapabilityMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"TypeRestfulInteraction-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"read\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">read</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"vread\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">vread</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"update\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">update</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"patch\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">patch</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"delete\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">delete</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"history-instance\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">history-instance</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"history-type\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">history-type</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"create\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">create</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"search-type\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">search-type</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"TypeRestfulInteraction\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Operations supported by REST at the type or instance level.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"TypeRestfulInteraction-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SystemRestfulInteraction-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"transaction\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">transaction</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"batch\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">batch</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"search-system\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">search-system</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"history-system\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">history-system</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SystemRestfulInteraction\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Operations supported by REST at the system level.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"SystemRestfulInteraction-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ConditionalReadStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"not-supported\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not Supported</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"modified-since\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">If-Modified-Since</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"not-match\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">If-None-Match</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"full-support\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Full Support</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ConditionalReadStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A code that indicates how the server supports conditional read.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ConditionalReadStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ReferenceHandlingPolicy-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"literal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Literal References</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"logical\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Logical References</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"resolves\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Resolves References</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"enforced\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Reference Integrity Enforced</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"local\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Local References Only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ReferenceHandlingPolicy\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of flags that defines how references are supported.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ReferenceHandlingPolicy-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ConditionalDeleteStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"not-supported\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not Supported</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"single\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Single Deletes Supported</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"multiple\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Multiple Deletes Supported</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ConditionalDeleteStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A code that indicates how the server supports conditional delete.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ConditionalDeleteStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"CarePlan\" type=\"CarePlan\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"CarePlan\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this care plan by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A care plan that is fulfilled in whole or in part by this care plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"replaces\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Completed or terminated care plan whose function is taken by this new care plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A larger care plan of which this particular care plan is a component or step.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CarePlanIntent\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies what &quot;kind&quot; of plan this is to support differentiation between multiple co-existing plans; e.g. &quot;Home health&quot;, &quot;psychiatric&quot;, &quot;asthma&quot;, &quot;disease management&quot;, &quot;wellness plan&quot;, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-friendly name for the care plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the scope and nature of the plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the patient or group whose intended care is described by the plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Encounter during which this CarePlan was created or to which the creation of this record is tightly associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates when the plan did (or is intended to) come into effect and end.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"created\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Represents when this particular CarePlan record was created in the system, which is often a system-generated date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When populated, the author is responsible for the care plan.  The care plan is attributed to the author.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contributor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the individual(s) or organization who provided the contents of the care plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"careTeam\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"addresses\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies portions of the patient's record that specifically influenced the formation of the plan.  These might include comorbidities, recent procedures, limitations, recent assessments, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"goal\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the intended objective(s) of carrying out the care plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"activity\" type=\"CarePlan.Activity\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies a planned action to occur as part of the plan.  For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">General notes about the care plan not covered elsewhere.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CarePlan.Activity\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"outcomeCodeableConcept\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the outcome at the point when the status of the activity is assessed.  For example, the outcome of an education activity could be patient understands (or not).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcomeReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details of the outcome or action resulting from the activity.  The reference to an &quot;event&quot; resource, such as Procedure or Encounter or Observation, is the result/outcome of the activity itself.  The activity can be conveyed using CarePlan.activity.detail OR using the CarePlan.activity.reference (a reference to a “request” resource).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"progress\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Notes about the adherence/status/progress of the activity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The details of the proposed activity represented in a specific resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" type=\"CarePlan.Detail\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CarePlan.Detail\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"kind\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CarePlanActivityKind\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the kind of resource the in-line definition of a care plan activity is representing.  The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference.  For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan activity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan activity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Detailed description of the type of planned activity; e.g. what lab test, what procedure, what kind of encounter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates another resource, such as the health condition(s), whose existence justifies this request and drove the inclusion of this particular activity as part of the plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"goal\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Internal reference that identifies the goals that this activity is intended to contribute towards meeting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CarePlanActivityStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies what progress is being made for the specific activity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"doNotPerform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If true, indicates that the described activity is one that must NOT be engaged in when following the plan.  If false, or missing, indicates that the described activity is one that should be engaged in when following the plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period, timing or frequency upon which the described activity is to occur.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"scheduledTiming\" type=\"Timing\"/>\r\n            <xs:element name=\"scheduledPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"scheduledString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies who's expected to be involved in the activity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the food, drug or other product to be consumed or supplied in the activity.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"productCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"productReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"dailyAmount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the quantity expected to be consumed in a given day.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the quantity expected to be supplied, administered or consumed by the subject.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This provides a textual description of constraints on the intended activity occurrence, including relation to other activities.  It may also include objectives, pre-conditions and end-conditions.  Finally, it may convey specifics about the activity such as body site, method, route, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"CarePlanActivityKind-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"Appointment\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Appointment</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Appointment</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Appuntamento</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RendezVous</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Cita</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">预约</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CommunicationRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CommunicationRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">CommunicationRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RichiestaDiComunicazione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">DemandeDeCommunication</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ComunicaciónRequerimiento</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">通讯请求</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DeviceRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DeviceRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">DeviceRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RichiestaDispositivo</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">DemandeUtilisationDispositif</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">SolicitudDeDispositivo</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">装置请求</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicationRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicationRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicationRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">PrescriptionMédicamenteuseTODO</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">药物请求</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">PrescripciónMedicaciónTODO  /PrescripcionMedicamento</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NutritionOrder\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">NutritionOrder</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">NutritionOrder</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">OrdreNutrition</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">OrdenNutrición</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">营养医嘱</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Task\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Task</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Task</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Tarea</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">任务</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ServiceRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ServiceRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ServiceRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RichiestaDiServizio</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">DemandeService</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">PeticiónServicio</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">服务项目请求</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"VisionPrescription\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">VisionPrescription</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">VisionPrescription</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">PrescriptionVision</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">PrescripcionDeVision</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">视力处方</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"CarePlanActivityKind\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Resource types defined as part of FHIR that can be represented as in-line definitions of a care plan activity.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"CarePlanActivityKind-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"CarePlanActivityStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"not-started\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not Started</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"scheduled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Scheduled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"in-progress\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-hold\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"stopped\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Stopped</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"CarePlanActivityStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Codes that reflect the current state of a care plan activity within its overall life cycle.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"CarePlanActivityStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"CarePlanIntent-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"proposal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Proposal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"plan\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Plan</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"option\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Option</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"CarePlanIntent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Codes indicating the degree of authority/intentionality associated with a care plan.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"CarePlanIntent-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"RequestStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"draft\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-hold\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"revoked\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Revoked</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"RequestStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"RequestStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"CareTeam\" type=\"CareTeam\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"CareTeam\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this care team by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CareTeamStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the current state of the care team.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies what kind of team.  This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A label for human use intended to distinguish like teams.  E.g. the &quot;red&quot; vs. &quot;green&quot; trauma teams.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the patient or group whose intended care is handled by the team.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates when the team did (or is intended to) come into effect and end.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"participant\" type=\"CareTeam.Participant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies all people and organizations who are expected to be involved in the care team.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes why the care team exists.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Condition(s) that this care team addresses.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"managingOrganization\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization responsible for the care team.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A central contact detail for the care team (that applies to all members).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments made about the CareTeam.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CareTeam.Participant\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates specific responsibility of an individual within the care team, such as &quot;Primary care physician&quot;, &quot;Trained social worker counselor&quot;, &quot;Caregiver&quot;, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"member\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific person or organization who is participating/expected to participate in the care team.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"onBehalfOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization of the practitioner.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates when the specific member or organization did (or is intended to) come into effect and end.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"CareTeamStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"proposed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Proposed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"suspended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Suspended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"inactive\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"CareTeamStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates the status of the care team.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"CareTeamStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"CatalogEntry\" type=\"CatalogEntry\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Catalog entries are wrappers that contextualize items included in a catalog.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"CatalogEntry\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Catalog entries are wrappers that contextualize items included in a catalog.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used in supporting different identifiers for the same product, e.g. manufacturer code and retailer code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of item - medication, device, service, protocol or other.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"orderable\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the entry represents an orderable item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referencedItem\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The item in a catalog or definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"additionalIdentifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used in supporting related concepts, e.g. NDC to RxNorm.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"classification\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Classes of devices, or ATC for medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used to support catalog exchange even for unsupported products, e.g. getting list of medications even if not prescribable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validityPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time period in which this catalog entry is expected to be active.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validTo\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date until which this catalog entry is expected to be active.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastUpdated\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Typically date of issue is different from the beginning of the validity. This can be used to see when an item was last updated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"additionalCharacteristic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used for examplefor Out of Formulary, or any specifics.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"additionalClassification\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">User for example for ATC classification, or.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedEntry\" type=\"CatalogEntry.RelatedEntry\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used for example, to point to a substance, or to a device used to administer a medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CatalogEntry.RelatedEntry\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Catalog entries are wrappers that contextualize items included in a catalog.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"relationtype\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CatalogEntryRelationType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of relation to the related item: child, parent, packageContent, containerPackage, usedIn, uses, requires, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reference to the related item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"CatalogEntryRelationType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"triggers\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Triggers</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"is-replaced-by\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Replaced By</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"CatalogEntryRelationType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of relations between entries.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"CatalogEntryRelationType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ChargeItem\" type=\"ChargeItem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ChargeItem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this event performer or other systems.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definitionUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">References the (external) source of pricing information, rules of application for the code this ChargeItem uses.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definitionCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">References the source of pricing information, rules of application for the code this ChargeItem uses.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ChargeItemStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The current state of the ChargeItem.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">ChargeItems can be grouped to larger ChargeItems covering the whole set.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that identifies the charge, like a billing code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual or set of individuals the action is being or was performed on.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The encounter or episode of care that establishes the context for this event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date/time(s) or duration when the charged service was applied.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"occurrenceTiming\" type=\"Timing\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"performer\" type=\"ChargeItem.Performer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed or participated in the charged service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization requesting the service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requestingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization performing the service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"costCenter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The financial cost center permits the tracking of charge attribution.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Quantity of which the charge item has been serviced.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodysite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The anatomical location where the related service has been applied.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factorOverride\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Factor overriding the factor determined by the rules associated with the code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priceOverride\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Total price of the charge overriding the list price associated with the code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"overrideReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the list price or the rule-based factor associated with the code is overridden, this attribute can capture a text to indicate the  reason for this action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"enterer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The device, practitioner, etc. who entered the charge item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"enteredDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date the charge item was entered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes why the event occurred in coded or textual form.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"service\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicated the rendered service that caused this charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the device, food, drug or other product being charged either by type code or reference to an instance.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"productReference\" type=\"Reference\"/>\r\n            <xs:element name=\"productCodeableConcept\" type=\"CodeableConcept\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"account\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Account into which this ChargeItems belongs.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments made about the event by the performer, subject or other participants.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInformation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Further information supporting this charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ChargeItem.Performer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"function\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the type of performance or participation(e.g. primary surgeon, anesthesiologiest, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The device, practitioner, etc. who performed or participated in the service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ChargeItemStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"planned\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Planned</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"billable\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Billable</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"not-billable\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not billable</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"aborted\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Aborted</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"billed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Billed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ChargeItemStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Codes identifying the lifecycle stage of a ChargeItem.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ChargeItemStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ChargeItemDefinition\" type=\"ChargeItemDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ChargeItemDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this charge item definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this charge item definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the charge item definition is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this charge item definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the charge item definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the charge item definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active assets.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the charge item definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"derivedFromUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally-defined charge item definition that is adhered to in whole or in part by this definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A larger definition of which this particular definition is a component or step.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"replaces\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">As new versions of a protocol or guideline are defined, allows identification of what versions are replaced by a new instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The current state of the ChargeItemDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this charge item definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the charge item definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the charge item definition changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the charge item definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the charge item definition from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate charge item definition instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the charge item definition is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the charge item definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the charge item definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the charge item definition content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The defined billing details in this resource pertain to the given billing code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instance\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The defined billing details in this resource pertain to the given product instance(s).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"applicability\" type=\"ChargeItemDefinition.Applicability\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Expressions that describe applicability criteria for the billing code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"propertyGroup\" type=\"ChargeItemDefinition.PropertyGroup\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Group of properties which are applicable under the same conditions. If no applicability rules are established for the group, then all properties always apply.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ChargeItemDefinition.Applicability\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A brief, natural language description of the condition that effectively communicates the intended semantics.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The media type of the language for the expression, e.g. &quot;text/cql&quot; for Clinical Query Language expressions or &quot;text/fhirpath&quot; for FHIRPath expressions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An expression that returns true or false, indicating whether the condition is satisfied. When using FHIRPath expressions, the %context environment variable must be replaced at runtime with the ChargeItem resource to which this definition is applied.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ChargeItemDefinition.PropertyGroup\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"applicability\" type=\"ChargeItemDefinition.Applicability\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Expressions that describe applicability criteria for the priceComponent.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priceComponent\" type=\"ChargeItemDefinition.PriceComponent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice of how the prices have been calculated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ChargeItemDefinition.PriceComponent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The ChargeItemDefinition resource provides the properties that apply to the (billing) codes necessary to calculate costs and prices. The properties may differ largely depending on type and realm, therefore this resource gives only a rough structure and requires profiling for each type of billing code system.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"InvoicePriceComponentType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This code identifies the type of the component.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that identifies the component. Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The factor that has been applied on the base price for calculating this component.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount calculated for this component.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"InvoicePriceComponentType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"base\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">base price</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"surcharge\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">surcharge</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"deduction\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">deduction</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"discount\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">discount</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"tax\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">tax</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"informational\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">informational</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"InvoicePriceComponentType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Codes indicating the kind of the price component.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"InvoicePriceComponentType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Claim\" type=\"Claim\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Claim\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The category of claim, e.g. oral, pharmacy, vision, institutional, professional.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"use\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Use\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to indicate whether the nature of the request is: to request adjudication of products and services previously rendered; or requesting authorization and adjudication for provision in the future; or requesting the non-binding adjudication of the listed products and services which could be provided in the future.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party to whom the professional services and/or products have been supplied or are being considered and for whom actual or forecast reimbursement is sought.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"billablePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period for which charges are being submitted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date this resource was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"enterer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Individual who created the claim, predetermination or preauthorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Insurer who is target of the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provider\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The provider which is responsible for the claim, predetermination or preauthorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The provider-required urgency of processing the request. Typical values include: stat, routine deferred.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fundsReserve\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to indicate whether and for whom funds are to be reserved for future claims.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"related\" type=\"Claim.Related\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Other claims which are related to this claim such as prior submissions or claims for related services or for the same event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"prescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Prescription to support the dispensing of pharmacy, device or vision products.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"originalPrescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Original prescription which has been superseded by this prescription to support the dispensing of pharmacy services, medications or products.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payee\" type=\"Claim.Payee\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party to be reimbursed for cost of the products and services according to the terms of the policy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referral\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a referral resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"facility\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Facility where the services were provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"careTeam\" type=\"Claim.CareTeam\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The members of the team who provided the products and services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInfo\" type=\"Claim.SupportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"diagnosis\" type=\"Claim.Diagnosis\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about diagnoses relevant to the claim items.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"procedure\" type=\"Claim.Procedure\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Procedures performed on the patient relevant to the billing items with the claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurance\" type=\"Claim.Insurance\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Financial instruments for reimbursement for the health care products and services specified on the claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"accident\" type=\"Claim.Accident\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details of an accident which resulted in injuries which required the products and services listed in the claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" type=\"Claim.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A claim line. Either a simple  product or service or a 'group' of details which can each be a simple items or groups of sub-details.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"total\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The total value of the all the items in the claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Claim.Related\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"claim\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to a related claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to convey how the claims are related.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An alternate organizational reference to the case or file to which this particular claim pertains.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Claim.Payee\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of Party to be reimbursed: subscriber, provider, other.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"party\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the individual or organization to whom any payment will be made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Claim.CareTeam\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify care team entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provider\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Member of the team who provided the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"responsible\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party who is billing and/or responsible for the claimed products or services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The lead, assisting or supervising practitioner and their discipline if a multidisciplinary team.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"qualification\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The qualification of the practitioner which is applicable for this service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Claim.SupportingInfo\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify supporting information entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The general class of the information supplied: information; exception; accident, employment; onset, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient  for which care is sought.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when or period to which this information refers.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"timingDate\" type=\"date\"/>\r\n            <xs:element name=\"timingPeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides the reason in the situation where a reason code is required in addition to the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Claim.Diagnosis\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify diagnosis entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The nature of illness or problem in a coded form or as a reference to an external defined Condition.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"diagnosisCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"diagnosisReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the condition was observed or the relative ranking.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"onAdmission\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indication of whether the diagnosis was present on admission to a facility.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"packageCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Claim.Procedure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify procedure entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the condition was observed or the relative ranking.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date and optionally time the procedure was performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code or reference to a Procedure resource which identifies the clinical intervention performed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"procedureCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"procedureReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Claim.Insurance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"focal\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The business identifier to be used when the claim is sent for adjudication against this insurance policy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"coverage\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"businessArrangement\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A business agreement number established between the provider and the insurer for special business processing purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preAuthRef\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference numbers previously provided by the insurer to the provider to be quoted on subsequent claims containing services or products related to the prior authorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"claimResponse\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The result of the adjudication of the line items for the Coverage specified in this insurance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Claim.Accident\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date of an accident event  related to the products and services contained in the claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type or context of the accident event for the purposes of selection of potential insurance coverages and determination of coordination between insurers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The physical location of the accident event.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"locationAddress\" type=\"Address\"/>\r\n            <xs:element name=\"locationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Claim.Item\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify item entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"careTeamSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">CareTeam members related to this service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"diagnosisSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Diagnosis applicable for this service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"procedureSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Procedures applicable for this service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"informationSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Exceptions, special conditions and supporting information applicable for this service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"revenue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of revenue or cost center providing the product and/or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date or dates when the service or product was supplied, performed or completed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"servicedDate\" type=\"date\"/>\r\n            <xs:element name=\"servicedPeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where the product or service was provided.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"locationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"locationAddress\" type=\"Address\"/>\r\n            <xs:element name=\"locationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Physical service site on the patient (limb, tooth, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subSite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A region or surface of the bodySite, e.g. limb region or tooth surface(s).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Encounters during which this Claim was created or to which the creation of this record is tightly associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" type=\"Claim.Detail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Claim.Detail\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify item entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"revenue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of revenue or cost center providing the product and/or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subDetail\" type=\"Claim.SubDetail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Claim.SubDetail\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A provider issued list of professional services and products which have been provided, or are to be provided, to a patient which is sent to an insurer for reimbursement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify item entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"revenue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of revenue or cost center providing the product and/or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"Use-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"claim\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Claim</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"preauthorization\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Preauthorization</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"predetermination\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Predetermination</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"Use\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The purpose of the Claim: predetermination, preauthorization, claim.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"Use-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"FinancialResourceStatusCodes-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"draft\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"FinancialResourceStatusCodes\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A code specifying the state of the resource instance.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"FinancialResourceStatusCodes-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ClaimResponse\" type=\"ClaimResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ClaimResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this claim response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"use\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Use\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to indicate whether the nature of the request is: to request adjudication of products and services previously rendered; or requesting authorization and adjudication for provision in the future; or requesting the non-binding adjudication of the listed products and services which could be provided in the future.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for facast reimbursement is sought.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date this resource was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurer\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party responsible for authorization, adjudication and reimbursement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requestor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The provider which is responsible for the claim, predetermination or preauthorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Original request resource reference.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ClaimProcessingCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The outcome of the claim, predetermination, or preauthorization processing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"disposition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human readable description of the status of the adjudication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preAuthRef\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference from the Insurer which is used in later communications which refers to this adjudication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preAuthPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time frame during which this authorization is effective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payeeType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of Party to be reimbursed: subscriber, provider, other.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" type=\"ClaimResponse.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"addItem\" type=\"ClaimResponse.AddItem\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The first-tier service adjudications for payor added product or service lines.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The adjudication results which are presented at the header level rather than at the line-item or add-item levels.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"total\" type=\"ClaimResponse.Total\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Categorized monetary totals for the adjudication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payment\" type=\"ClaimResponse.Payment\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Payment details for the adjudication of the claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fundsReserve\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"formCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code for the form to be used for printing the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"form\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual form, by reference or inclusion, for printing the content or an EOB.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"processNote\" type=\"ClaimResponse.ProcessNote\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A note that describes or explains adjudication results in a human readable form.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"communicationRequest\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Request for additional supporting or authorizing information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurance\" type=\"ClaimResponse.Insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Financial instruments for reimbursement for the health care products and services specified on the claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"error\" type=\"ClaimResponse.Error\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Errors encountered during the processing of the adjudication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClaimResponse.Item\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"itemSequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely reference the claim item entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" type=\"ClaimResponse.Detail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A claim detail. Either a simple (a product or service) or a 'group' of sub-details which are simple items.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClaimResponse.Adjudication\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to indicate the information type of this adjudication record. Information types may include the value submitted, maximum values or percentages allowed or payable under the plan, amounts that: the patient is responsible for in aggregate or pertaining to this item; amounts paid by other coverages; and, the benefit payable for this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code supporting the understanding of the adjudication result and explaining variance from expected amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Monetary amount associated with the category.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A non-monetary value associated with the category. Mutually exclusive to the amount element above.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClaimResponse.Detail\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"detailSequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely reference the claim detail entry.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subDetail\" type=\"ClaimResponse.SubDetail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A sub-detail adjudication of a simple product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClaimResponse.SubDetail\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"subDetailSequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely reference the claim sub-detail entry.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClaimResponse.AddItem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"itemSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Claim items which this service line is intended to replace.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detailSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The sequence number of the details within the claim item which this line is intended to replace.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subdetailSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The sequence number of the sub-details within the details within the claim item which this line is intended to replace.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The providers who are authorized for the services rendered to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date or dates when the service or product was supplied, performed or completed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"servicedDate\" type=\"date\"/>\r\n            <xs:element name=\"servicedPeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where the product or service was provided.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"locationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"locationAddress\" type=\"Address\"/>\r\n            <xs:element name=\"locationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Physical service site on the patient (limb, tooth, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subSite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A region or surface of the bodySite, e.g. limb region or tooth surface(s).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" type=\"ClaimResponse.Detail1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The second-tier service adjudications for payor added services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClaimResponse.Detail1\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subDetail\" type=\"ClaimResponse.SubDetail1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The third-tier service adjudications for payor added services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClaimResponse.SubDetail1\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ClaimResponse.Adjudication\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClaimResponse.Total\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Monetary total amount associated with the category.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClaimResponse.Payment\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this represents partial or complete payment of the benefits payable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjustment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjustmentReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reason for the payment adjustment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Estimated date the payment will be issued or the actual issue date of payment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Benefits payable less any payment adjustment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Issuer's unique identifier for the payment instrument.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClaimResponse.ProcessNote\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"number\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify a note entry.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"NoteType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The business purpose of the note text.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The explanation or description associated with the processing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to define the language used in the text of the note.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClaimResponse.Insurance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify insurance entries and provide a sequence of coverages to convey coordination of benefit order.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"focal\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"coverage\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"businessArrangement\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A business agreement number established between the provider and the insurer for special business processing purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"claimResponse\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The result of the adjudication of the line items for the Coverage specified in this insurance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClaimResponse.Error\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the adjudication details from the processing of a Claim resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"itemSequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The sequence number of the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detailSequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The sequence number of the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subDetailSequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The sequence number of the sub-detail within the detail within the line item submitted which contains the error. This value is omitted when the error occurs outside of the item structure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An error code, from a specified code system, which details why the claim could not be adjudicated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ClaimProcessingCodes-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"queued\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Queued</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"complete\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Processing Complete</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"partial\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Partial Processing</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ClaimProcessingCodes\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The result of the claim processing.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ClaimProcessingCodes-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ClinicalImpression\" type=\"ClinicalImpression\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called &quot;ClinicalImpression&quot; rather than &quot;ClinicalAssessment&quot; to avoid confusion with the recording of assessment tools such as Apgar score.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ClinicalImpression\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called &quot;ClinicalImpression&quot; rather than &quot;ClinicalAssessment&quot; to avoid confusion with the recording of assessment tools such as Apgar score.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this clinical impression by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ClinicalImpressionStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the workflow status of the assessment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current state of the ClinicalImpression.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Categorizes the type of clinical assessment performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A summary of the context and/or cause of the assessment - why / where it was performed, and what patient events/status prompted it.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient or group of individuals assessed as part of this record.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Encounter during which this ClinicalImpression was created or to which the creation of this record is tightly associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The point in time or period over which the subject was assessed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"effectiveDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"effectivePeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates when the documentation of the assessment was complete.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"assessor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The clinician performing the assessment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"previous\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the last assessment that was conducted on this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"problem\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of the relevant problems/conditions for a patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"investigation\" type=\"ClinicalImpression.Investigation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">One or more sets of investigations (signs, symptoms, etc.). The actual grouping of investigations varies greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"protocol\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"summary\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A text summary of the investigations and the diagnosis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"finding\" type=\"ClinicalImpression.Finding\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific findings or diagnoses that were considered likely or relevant to ongoing treatment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"prognosisCodeableConcept\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Estimate of likely outcome.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"prognosisReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">RiskAssessment expressing likely outcome.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information supporting the clinical impression.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Commentary about the impression, typically recorded after the impression itself was made, though supplemental notes by the original author could also appear.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClinicalImpression.Investigation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called &quot;ClinicalImpression&quot; rather than &quot;ClinicalAssessment&quot; to avoid confusion with the recording of assessment tools such as Apgar score.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name/code for the group (&quot;set&quot;) of investigations. Typically, this will be something like &quot;signs&quot;, &quot;symptoms&quot;, &quot;clinical&quot;, &quot;diagnostic&quot;, but the list is not constrained, and others such groups such as (exposure|family|travel|nutritional) history may be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A record of a specific investigation that was undertaken.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ClinicalImpression.Finding\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter,  but this varies greatly depending on the clinical workflow. This resource is called &quot;ClinicalImpression&quot; rather than &quot;ClinicalAssessment&quot; to avoid confusion with the recording of assessment tools such as Apgar score.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"itemCodeableConcept\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific text or code for finding or diagnosis, which may include ruled-out or resolved conditions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"itemReference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific reference for finding or diagnosis, which may include ruled-out or resolved conditions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basis\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Which investigations support finding or diagnosis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ClinicalImpressionStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"in-progress\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ClinicalImpressionStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The workflow state of a clinical impression.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ClinicalImpressionStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"CodeSystem\" type=\"CodeSystem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"CodeSystem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this code system when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this code system is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the code system is stored on different servers. This is used in [Coding](datatypes.html#Coding).system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the code system when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the code system author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. This is used in [Coding](datatypes.html#Coding).version.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the code system. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the code system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date (and optionally time) when the code system resource was created or revised.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this code system is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the code system was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the code system changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the code system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the code system from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate code system instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the code system is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this code system is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"caseSensitive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If code comparison is case sensitive when codes within this system are compared to each other.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"valueSet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Canonical reference to the value set that contains the entire code system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"hierarchyMeaning\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeSystemHierarchyMeaning\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The meaning of the hierarchy of concepts as represented in this resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"compositional\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code system defines a compositional (post-coordination) grammar.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"versionNeeded\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This flag is used to signify that the code system does not commit to concept permanence across versions. If true, a version must be specified when referencing this code system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"content\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeSystemContentMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The extent of the content of the code system (the concepts and codes it defines) are represented in this resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supplements\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The canonical URL of the code system that this code system supplement is adding designations and properties to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"count\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The total number of concepts defined by the code system. Where the code system has a compositional grammar, the basis of this count is defined by the system steward.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"filter\" type=\"CodeSystem.Filter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A filter that can be used in a value set compose statement when selecting concepts using a filter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"property\" type=\"CodeSystem.Property\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A property defines an additional slot through which additional information can be provided about a concept.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"concept\" type=\"CodeSystem.Concept\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meanings of the hierarchical relationships are.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CodeSystem.Filter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code that identifies this filter when it is used as a filter in [[[ValueSet]]].compose.include.filter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of how or why the filter is used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"operator\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"FilterOperator\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of operators that can be used with the filter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of what the value for the filter should be.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CodeSystem.Property\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"uri\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the property- why it is defined, and how its value might be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PropertyType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the property value. Properties of type &quot;code&quot; contain a code defined by the code system (e.g. a reference to another defined concept).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CodeSystem.Concept\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code - a text symbol - that uniquely identifies the concept within the code system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human readable string that is the recommended default way to present this concept to a user.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"designation\" type=\"CodeSystem.Designation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"property\" type=\"CodeSystem.Property1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A property value for this concept.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"concept\" type=\"CodeSystem.Concept\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaning.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CodeSystem.Designation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The language this designation is defined for.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"use\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that details how this designation would be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The text value for this designation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CodeSystem.Property1\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CodeSystem resource is used to declare the existence of and describe a code system or code system supplement and its key properties, and optionally define a part or all of its content.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that is a reference to CodeSystem.property.code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of this property.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueCode\" type=\"code\"/>\r\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"FilterOperator-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"=\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Equals</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"is-a\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Is A (by subsumption)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"descendent-of\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Descendent Of (by subsumption)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"is-not-a\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not (Is A) (by subsumption)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"regex\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Regular Expression</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"in\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In Set</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"not-in\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not in Set</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"generalizes\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Generalizes (by Subsumption)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"exists\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Exists</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"FilterOperator\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The kind of operation to perform as a part of a property based filter.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"FilterOperator-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"PropertyType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"code\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">code (internal reference)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Coding\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Coding (external reference)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"string\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">string</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"integer\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">integer</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"boolean\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">boolean</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"dateTime\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">dateTime</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"decimal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">decimal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"PropertyType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of a property value.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"PropertyType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"CodeSystemHierarchyMeaning-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"grouped-by\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Grouped By</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"is-a\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Is-A</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"part-of\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Part Of</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"classified-with\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Classified With</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"CodeSystemHierarchyMeaning\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The meaning of the hierarchy of concepts in a code system.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"CodeSystemHierarchyMeaning-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"CodeSystemContentMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"not-present\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not Present</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"example\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Example</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"fragment\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Fragment</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"complete\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Complete</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"supplement\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Supplement</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"CodeSystemContentMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The extent of the content of the code system (the concepts and codes it defines) are represented in a code system resource.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"CodeSystemContentMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Communication\" type=\"Communication\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Communication\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this communication by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An order, proposal or plan fulfilled in whole or in part by this Communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Part of this action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"inResponseTo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Prior communication that this communication is in response to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EventStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the transmission.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current state of the Communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of message conveyed such as alert, notification, reminder, instruction, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Characterizes how quickly the planned or in progress communication must be addressed. Includes concepts such as stat, urgent, routine.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"medium\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A channel that was used for this communication (e.g. email, fax).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient or group that was the focus of this communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of the purpose/content, similar to a subject line in an email.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"about\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Other resources that pertain to this communication and to which this communication should be associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Encounter during which this Communication was created or to which the creation of this record is tightly associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time when this communication was sent.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"received\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time when this communication arrived at the destination.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recipient\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The entity (e.g. person, organization, clinical information system, care team or device) which was the target of the communication. If receipts need to be tracked by an individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either receipts are not tracked (e.g. a mass mail-out) or a receipt is captured in aggregate (all emails confirmed received by a particular time).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reason or justification for the communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates another resource whose existence justifies this communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payload\" type=\"Communication.Payload\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Text, attachment(s), or resource(s) that was communicated to the recipient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional notes or commentary about the communication by the sender, receiver or other interested parties.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Communication.Payload\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency that was notified about a reportable condition.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A communicated content (or for multi-part communications, one portion of the communication).</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"contentString\" type=\"string\"/>\r\n            <xs:element name=\"contentAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"contentReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"EventStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"preparation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Preparation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"in-progress\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"not-done\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not Done</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-hold\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"stopped\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Stopped</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"EventStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The status of the communication.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"EventStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"CommunicationRequest\" type=\"CommunicationRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"CommunicationRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this communication request by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A plan or proposal that is fulfilled in whole or in part by this request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"replaces\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Completed or terminated request(s) whose function is taken by this new request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"groupIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the proposal or order.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current state of the CommunicationRequest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of message to be sent such as alert, notification, reminder, instruction, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"doNotPerform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If true indicates that the CommunicationRequest is asking for the specified action to *not* occur.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"medium\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A channel that was used for this communication (e.g. email, fax).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient or group that is the focus of this communication request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"about\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Other resources that pertain to this communication request and to which this communication request should be associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Encounter during which this CommunicationRequest was created or to which the creation of this record is tightly associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payload\" type=\"CommunicationRequest.Payload\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Text, attachment(s), or resource(s) to be communicated to the recipient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time when this communication is to occur.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">For draft requests, indicates the date of initial creation.  For requests with other statuses, indicates the date of activation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The device, individual, or organization who initiated the request and has responsibility for its activation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recipient\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The entity (e.g. person, organization, clinical information system, device, group, or care team) which is the intended target of the communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes why the request is being made in coded or textual form.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates another resource whose existence justifies this request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments made about the request by the requester, sender, recipient, subject or other participants.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CommunicationRequest.Payload\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The communicated content (or for multi-part communications, one portion of the communication).</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"contentString\" type=\"string\"/>\r\n            <xs:element name=\"contentAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"contentReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"CompartmentDefinition\" type=\"CompartmentDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A compartment definition that defines how resources are accessed on a server.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"CompartmentDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A compartment definition that defines how resources are accessed on a server.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this compartment definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the compartment definition is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the compartment definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the compartment definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the compartment definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this compartment definition. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this compartment definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the compartment definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the compartment definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the compartment definition from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate compartment definition instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this compartment definition is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CompartmentType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Which compartment this definition describes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"search\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the search syntax is supported,.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resource\" type=\"CompartmentDefinition.Resource\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about how a resource is related to the compartment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CompartmentDefinition.Resource\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A compartment definition that defines how resources are accessed on a server.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of a resource supported by the server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"param\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment in more than one way,.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional documentation about the resource and compartment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"CompartmentType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"Patient\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Patient</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Encounter\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Encounter</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"RelatedPerson\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">RelatedPerson</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Practitioner\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Practitioner</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Device\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Device</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"CompartmentType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Which type a compartment definition describes.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"CompartmentType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Composition\" type=\"Composition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Composition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A version-independent identifier for the Composition. This identifier stays constant as the composition is changed over time.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CompositionStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the clinical encounter or type of care this documentation is associated with.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The composition editing time, when the composition was last logically changed by the author.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies who is responsible for the information in the composition, not necessarily who typed it in.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Official human-readable label for the composition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"confidentiality\" minOccurs=\"0\" maxOccurs=\"1\" type=\"vConfidentialityClassification\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code specifying the level of confidentiality of the Composition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"attester\" type=\"Composition.Attester\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A participant who has attested to the accuracy of the composition/document.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"custodian\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatesTo\" type=\"Composition.RelatesTo\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Relationships that this composition has with other compositions or documents that already exist.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"event\" type=\"Composition.Event\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The clinical service, such as a colonoscopy or an appendectomy, being documented.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"section\" type=\"Composition.Section\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The root of the sections that make up the composition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Composition.Attester\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CompositionAttestationMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of attestation the authenticator offers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"time\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the composition was attested by the party.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"party\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who attested the composition in the specified way.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Composition.RelatesTo\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DocumentRelationshipType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of relationship that this composition has with anther composition or document.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The target composition/document of this relationship.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"targetIdentifier\" type=\"Identifier\"/>\r\n            <xs:element name=\"targetReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Composition.Event\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a &quot;History and Physical Report&quot; in which the procedure being documented is necessarily a &quot;History and Physical&quot; act.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Composition.Section\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of healthcare-related information that is assembled together into a single logical package that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. A Composition defines the structure and narrative content necessary for a document. However, a Composition alone does not constitute a document. Rather, the Composition must be the first entry in a Bundle where Bundle.type=document, and any other resources referenced from Composition must be included as subsequent entries in the Bundle (for example Patient, Practitioner, Encounter, etc.).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The label for this particular section.  This will be part of the rendered content for the document, and is often used to build a table of contents.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code identifying the kind of content contained within the section. This must be consistent with the section title.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies who is responsible for the information in this section, not necessarily who typed it in.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"focus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual focus of the section when it is not the subject of the composition, but instead represents something or someone associated with the subject such as (for a patient subject) a spouse, parent, fetus, or donor. If not focus is specified, the focus is assumed to be focus of the parent section, or, for a section in the Composition itself, the subject of the composition. Sections with a focus SHALL only include resources where the logical subject (patient, subject, focus, etc.) matches the section focus, or the resources have no logical subject (few resources).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Narrative\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it &quot;clinically safe&quot; for a human to just read the narrative.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"mode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ListMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the entry list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"orderedBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the order applied to the items in the section entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"entry\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the actual resource from which the narrative in the section is derived.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"emptyReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"section\" type=\"Composition.Section\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A nested sub-section within this section.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"vConfidentialityClassification-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"U\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">unrestricted</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"L\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">low</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"M\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">moderate</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"N\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">normal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"R\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">restricted</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"V\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">very restricted</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"vConfidentialityClassification\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Codes specifying the level of confidentiality of the composition.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"vConfidentialityClassification-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"CompositionStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"preliminary\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Preliminary</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"final\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Final</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"amended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Amended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"CompositionStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The workflow/clinical status of the composition.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"CompositionStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DocumentRelationshipType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"replaces\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Replaces</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"transforms\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Transforms</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"signs\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Signs</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"appends\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Appends</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DocumentRelationshipType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of relationship between documents.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"DocumentRelationshipType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"CompositionAttestationMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"personal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Personal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"professional\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Professional</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"legal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Legal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"official\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Official</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"CompositionAttestationMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The way in which a person authenticated a composition.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"CompositionAttestationMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ListMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"working\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Working List</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"snapshot\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Snapshot List</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"changes\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Change List</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ListMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The processing mode that applies to this section.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ListMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ConceptMap\" type=\"ConceptMap\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ConceptMap\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this concept map when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this concept map is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the concept map is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the concept map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the concept map. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the concept map.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this concept map. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this concept map is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the concept map was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the concept map.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the concept map from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate concept map instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the concept map is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this concept map is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the concept map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the concept map.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for the source value set that contains the concepts that are being mapped and provides context for the mappings.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"sourceUri\" type=\"uri\"/>\r\n            <xs:element name=\"sourceCanonical\" type=\"canonical\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The target value set provides context for the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"targetUri\" type=\"uri\"/>\r\n            <xs:element name=\"targetCanonical\" type=\"canonical\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"group\" type=\"ConceptMap.Group\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A group of mappings that all have the same source and target system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ConceptMap.Group\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that identifies the source system where the concepts to be mapped are defined.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sourceVersion\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific version of the code system, as determined by the code system authority.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"target\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that identifies the target system that the concepts will be mapped to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"targetVersion\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific version of the code system, as determined by the code system authority.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"element\" type=\"ConceptMap.Element\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Mappings for an individual concept in the source to one or more concepts in the target.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unmapped\" type=\"ConceptMap.Unmapped\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">What to do when there is no mapping for the source concept. &quot;Unmapped&quot; does not include codes that are unmatched, and the unmapped element is ignored in a code is specified to have equivalence = unmatched.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ConceptMap.Element\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identity (code or path) or the element/item being mapped.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The display for the code. The display is only provided to help editors when editing the concept map.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"target\" type=\"ConceptMap.Target\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A concept from the target value set that this concept maps to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ConceptMap.Target\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identity (code or path) or the element/item that the map refers to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The display for the code. The display is only provided to help editors when editing the concept map.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"equivalence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ConceptMapEquivalence\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of status/issues in mapping that conveys additional information not represented in  the structured data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dependsOn\" type=\"ConceptMap.DependsOn\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"product\" type=\"ConceptMap.DependsOn\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ConceptMap.DependsOn\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"property\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to an element that holds a coded value that corresponds to a code system property. The idea is that the information model carries an element somewhere that is labeled to correspond with a code system property.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"system\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identity (code or path) or the element/item/ValueSet/text that the map depends on / refers to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The display for the code. The display is only provided to help editors when editing the concept map.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ConceptMap.Unmapped\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ConceptMapGroupUnmappedMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines which action to take if there is no match for the source concept in the target system designated for the group. One of 3 actions are possible: use the unmapped code (this is useful when doing a mapping between versions, and only a few codes have changed), use a fixed code (a default code), or alternatively, a reference to a different concept map can be provided (by canonical URL).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The fixed code to use when the mode = 'fixed'  - all unmapped codes are mapped to a single fixed code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The display for the code. The display is only provided to help editors when editing the concept map.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The canonical reference to an additional ConceptMap resource instance to use for mapping if this ConceptMap resource contains no matching mapping for the source concept.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ConceptMapGroupUnmappedMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"provided\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Provided Code</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"fixed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Fixed Code</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"other-map\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Other Map</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ConceptMapGroupUnmappedMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines which action to take if there is no match in the group.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ConceptMapGroupUnmappedMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Condition\" type=\"Condition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Condition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this condition by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"clinicalStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The clinical status of the condition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"verificationStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The verification status to support the clinical status of the condition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A category assigned to the condition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"severity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A subjective assessment of the severity of the condition as evaluated by the clinician.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identification of the condition, problem or diagnosis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The anatomical location where this condition manifests itself.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the patient or group who the condition record is associated with.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Encounter during which this Condition was created or to which the creation of this record is tightly associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Estimated or actual date or date-time  the condition began, in the opinion of the clinician.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"onsetDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"onsetAge\" type=\"Age\"/>\r\n            <xs:element name=\"onsetPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"onsetRange\" type=\"Range\"/>\r\n            <xs:element name=\"onsetString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date or estimated date that the condition resolved or went into remission. This is called &quot;abatement&quot; because of the many overloaded connotations associated with &quot;remission&quot; or &quot;resolution&quot; - Conditions are never really resolved, but they can abate.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"abatementDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"abatementAge\" type=\"Age\"/>\r\n            <xs:element name=\"abatementPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"abatementRange\" type=\"Range\"/>\r\n            <xs:element name=\"abatementString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"recordedDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The recordedDate represents when this particular Condition record was created in the system, which is often a system-generated date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recorder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Individual who recorded the record and takes responsibility for its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"asserter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Individual who is making the condition statement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"stage\" type=\"Condition.Stage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Clinical stage or grade of a condition. May include formal severity assessments.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"evidence\" type=\"Condition.Evidence\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Supporting evidence / manifestations that are the basis of the Condition's verification status, such as evidence that confirmed or refuted the condition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information about the Condition. This is a general notes/comments entry  for description of the Condition, its diagnosis and prognosis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Condition.Stage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"summary\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A simple summary of the stage such as &quot;Stage 3&quot;. The determination of the stage is disease-specific.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"assessment\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to a formal record of the evidence on which the staging assessment is based.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of staging, such as pathological or clinical staging.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Condition.Evidence\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A manifestation or symptom that led to the recording of this condition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Links to other relevant information, including pathology reports.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Consent\" type=\"Consent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Consent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique identifier for this copy of the Consent Statement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ConsentState\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the current state of this consent.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"scope\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A selector of the type of consent being presented: ADR, Privacy, Treatment, Research.  This list is now extensible.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient/healthcare consumer to whom this consent applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dateTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When this  Consent was issued / created / indexed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Either the Grantor, which is the entity responsible for granting the rights listed in a Consent Directive or the Grantee, which is the entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"organization\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization that manages the consent, and the framework within which it is executed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The source on which this consent statement is based. The source might be a scanned original paper form, or a reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"sourceAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"sourceReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"policy\" type=\"Consent.Policy\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"policyRule\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the specific base computable regulation or policy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"verification\" type=\"Consent.Verification\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether a treatment instruction (e.g. artificial respiration yes or no) was verified with the patient, his/her family or another authorized person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provision\" type=\"Consent.Provision\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Consent.Policy\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"authority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Entity or Organization having regulatory jurisdiction or accountability for  enforcing policies pertaining to Consent Directives.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"uri\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Consent.Verification\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"verified\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Has the instruction been verified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"verifiedWith\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who verified the instruction (Patient, Relative or other Authorized Person).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"verificationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date verification was collected.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Consent.Provision\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ConsentProvisionType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Action  to take - permit or deny - when the rule conditions are met.  Not permitted in root rule, required in all nested rules.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The timeframe in this rule is valid.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" type=\"Consent.Actor\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers').</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"action\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Actions controlled by this Rule.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"securityLabel\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"class\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The class of information covered by this rule. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If this code is found in an instance, then the rule applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dataPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Clinical or Operational Relevant period of time that bounds the data controlled by this rule.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"data\" type=\"Consent.Data\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The resources controlled by this rule if specific resources are referenced.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provision\" type=\"Consent.Provision\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Rules which provide exceptions to the base rule or subrules.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Consent.Actor\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"role\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the individual is involved in the resources content that is described in the exception.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The resource that identifies the actor. To identify actors by type, use group to identify a set of actors by some property they share (e.g. 'admitting officers').</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Consent.Data\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a healthcare consumer’s  choices, which permits or denies identified recipient(s) or recipient role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"meaning\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ConsentDataMeaning\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the resource reference is interpreted when testing consent restrictions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a specific resource that defines which resources are covered by this consent.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ConsentProvisionType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"deny\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Opt Out</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"permit\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Opt In</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ConsentProvisionType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How a rule statement is applied, such as adding additional consent or removing consent.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ConsentProvisionType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ConsentDataMeaning-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"instance\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Instance</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"related\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Related</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"dependents\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Dependents</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"authoredby\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">AuthoredBy</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ConsentDataMeaning\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How a resource reference is interpreted when testing consent restrictions.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ConsentDataMeaning-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ConsentState-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"draft\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Pending</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"proposed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Proposed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"rejected\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Rejected</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"inactive\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ConsentState\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates the state of the consent.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ConsentState-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Contract\" type=\"Contract\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Contract\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique identifier for this Contract or a derivative that references a Source Contract.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Canonical identifier for this contract, represented as a URI (globally unique).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An edition identifier used for business purposes to label business significant variants.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ContractResourceStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"legalState\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Legal states of the formation of a legal instrument, which is a formally executed written document that can be formally attributed to its author, records and formally expresses a legally enforceable act, process, or contractual duty, obligation, or right, and therefore evidences that act, process, or agreement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined Contract Definition that is adhered to in whole or part by this Contract.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained definition that is adhered to in whole or in part by this Contract.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contentDerivative\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The minimal content derived from the basal information source at a specific stage in its lifecycle.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"issued\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When this  Contract was issued.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"applies\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Relevant time or time-period when this Contract is applicable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expirationType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Event resulting in discontinuation or termination of this Contract instance by one or more parties to the contract.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The target entity impacted by or of interest to parties to the agreement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authority\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"domain\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"site\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Sites in which the contract is complied with,  exercised, or in force.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying this Contract definition, derivative, or instance in any legal state. Provides additional information about its content. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate user-friendly title for this Contract definition, derivative, or instance in any legal state.t giving additional information about its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"alias\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Alternative representation of the title for this Contract definition, derivative, or instance in any legal state., e.g., a domain specific contract number related to legislation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual or organization that authored the Contract definition, derivative, or instance in any legal state.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"scope\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A selector of legal concerns for this Contract definition, derivative, or instance in any legal state.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Narrows the range of legal concerns to focus on the achievement of specific contractual objectives.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"topicCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"topicReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A high-level category for the legal instrument, whether constructed as a Contract definition, derivative, or instance in any legal state.  Provides additional information about its content within the context of the Contract's scope to distinguish the kinds of systems that would be interested in the contract.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Sub-category for the Contract that distinguishes the kinds of systems that would be interested in the Contract within the context of the Contract's scope.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contentDefinition\" type=\"Contract.ContentDefinition\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Precusory content developed with a focus and intent of supporting the formation a Contract instance, which may be associated with and transformable into a Contract.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"term\" type=\"Contract.Term\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information that may be needed by/relevant to the performer in their execution of this term action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relevantHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Links to Provenance records for past versions of this Contract definition, derivative, or instance, which identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the Contract.  The Provence.entity indicates the target that was changed in the update. http://build.fhir.org/provenance-definitions.html#Provenance.entity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"signer\" type=\"Contract.Signer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"friendly\" type=\"Contract.Friendly\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The &quot;patient friendly language&quot; versionof the Contract in whole or in parts. &quot;Patient friendly language&quot; means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"legal\" type=\"Contract.Legal\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">List of Legal expressions or representations of this Contract.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rule\" type=\"Contract.Rule\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">List of Computable Policy Rule Language Representations of this Contract.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the &quot;source of truth&quot; and which would be the basis for legal action related to enforcement of this Contract.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"legallyBindingAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"legallyBindingReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.ContentDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Precusory content structure and use, i.e., a boilerplate, template, application for a contract such as an insurance policy or benefits under a program, e.g., workers compensation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Detailed Precusory content type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The  individual or organization that published the Contract precursor content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publicationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date (and optionally time) when the contract was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the contract changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publicationStatus\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ContractResourcePublicationStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">amended | appended | cancelled | disputed | entered-in-error | executable | executed | negotiable | offered | policy | rejected | renewed | revoked | resolved | terminated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to Contract precursor content. Copyright statements are generally legal restrictions on the use and publishing of the Contract precursor content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.Term\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique identifier for this particular Contract Provision.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"issued\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When this Contract Provision was issued.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"applies\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Relevant time or time-period when this Contract Provision is applicable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The entity that the term applies to.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"topicCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"topicReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal clause or condition contained within a contract that requires one or both parties to perform a particular requirement by some specified time or prevents one or both parties from performing a particular requirement by some specified time.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A specialized legal clause or condition based on overarching contract type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Statement of a provision in a policy or a contract.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"securityLabel\" type=\"Contract.SecurityLabel\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Security labels that protect the handling of information about the term and its elements, which may be specifically identified..</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"offer\" type=\"Contract.Offer\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The matter of concern in the context of this provision of the agrement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"asset\" type=\"Contract.Asset\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contract Term Asset List.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"action\" type=\"Contract.Action\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"group\" type=\"Contract.Term\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Nested group of Contract Provisions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.SecurityLabel\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"number\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number used to link this term or term element to the applicable Security Label.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"classification\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Security label privacy tag that species the level of confidentiality protection required for this term and/or term elements.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Security label privacy tag that species the applicable privacy and security policies governing this term and/or term elements.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"control\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Security label privacy tag that species the manner in which term and/or term elements are to be protected.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.Offer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique identifier for this particular Contract Provision.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"party\" type=\"Contract.Party\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Offer Recipient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The owner of an asset has the residual control rights over the asset: the right to decide all usages of the asset in any way not inconsistent with a prior contract, custom, or law (Hart, 1995, p. 30).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"decision\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of choice made by accepting party with respect to an offer made by an offeror/ grantee.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"decisionMode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the decision about a Contract was conveyed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"answer\" type=\"Contract.Answer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Response to offer text.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human readable form of this Contract Offer.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"linkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The id of the clause or question text of the offer in the referenced questionnaire/response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"securityLabelNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Security labels that protects the offer.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.Party\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Participant in the offer.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"role\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the party participates in the offer.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.Answer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Response to an offer clause or question text,  which enables selection of values to be agreed to, e.g., the period of participation, the date of occupancy of a rental, warrently duration, or whether biospecimen may be used for further research.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\r\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"valueDate\" type=\"date\"/>\r\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"valueTime\" type=\"time\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueUri\" type=\"uri\"/>\r\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.Asset\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"scope\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Differentiates the kind of the asset .</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Target entity type about which the term may be concerned.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"typeReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Associated entities.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtype\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">May be a subtype or part of an offered asset.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the applicability of the term to an asset resource instance, and instances it refers to orinstances that refer to it, and/or are owned by the offeree.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"context\" type=\"Contract.Context\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Circumstance of the asset.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"condition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of the quality and completeness of the asset that imay be a factor in its valuation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"periodType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of Asset availability for use or ownership.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Asset relevant contractual time period.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"usePeriod\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time period of asset use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Clause or question text (Prose Object) concerning the asset in a linked form, such as a QuestionnaireResponse used in the formation of the contract.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"linkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id [identifier??] of the clause or question text about the asset in the referenced form or QuestionnaireResponse.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"answer\" type=\"Contract.Answer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Response to assets.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"securityLabelNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Security labels that protects the asset.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"valuedItem\" type=\"Contract.ValuedItem\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contract Valued Item List.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.Context\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"reference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Asset context reference may include the creator, custodian, or owning Person or Organization (e.g., bank, repository),  location held, e.g., building,  jurisdiction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Coded representation of the context generally or of the Referenced entity, such as the asset holder type or location.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Context description.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.ValuedItem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific type of Contract Valued Item that may be priced.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"entityCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"entityReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies a Contract Valued Item instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectiveTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the time during which this Contract ValuedItem information is effective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Contract Valued Item unit valuation measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"points\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number  * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Terms of valuation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"paymentDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When payment is due.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"responsible\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who will make payment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recipient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who will receive payment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"linkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id  of the clause or question text related to the context of this valuedItem in the referenced form or QuestionnaireResponse.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"securityLabelNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A set of security labels that define which terms are controlled by this condition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.Action\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"doNotPerform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">True if the term prohibits the  action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Activity or service obligation to be done or not done, performed or not performed, effectuated or not by this Contract term.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" type=\"Contract.Subject\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Entity of the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reason or purpose for the action stipulated by this Contract Provision.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"linkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id [identifier??] of the clause or question text related to this action in the referenced form or QuestionnaireResponse.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Current state of the term action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Encounter or Episode with primary association to specified term activity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contextLinkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When action happens.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"occurrenceTiming\" type=\"Timing\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who or what initiated the action and has responsibility for its activation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requesterLinkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id [identifier??] of the clause or question text related to the requester of this action in the referenced form or QuestionnaireResponse.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performerType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of individual that is desired or required to perform or not perform the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performerRole\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of role or competency of an individual desired or required to perform or not perform the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who or what is being asked to perform (or not perform) the ction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performerLinkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Rationale for the action to be performed or not performed. Describes why the action is permitted or prohibited.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates another resource whose existence justifies permitting or not permitting this action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes why the action is to be performed or not performed in textual form.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonLinkId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id [identifier??] of the clause or question text related to the reason type or reference of this  action in the referenced form or QuestionnaireResponse.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments made about the term action made by the requester, performer, subject or other participants.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"securityLabelNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Security labels that protects the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.Subject\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The entity the action is performed or not performed on or for.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Role type of agent assigned roles in this Contract.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.Signer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Role of this Contract signer, e.g. notary, grantee.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"party\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Party which is a signator to this Contract.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"signature\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Signature\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Legally binding Contract DSIG signature contents in Base64.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.Friendly\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"contentAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"contentReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.Legal\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contract legal text in human renderable form.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"contentAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"contentReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Contract.Rule\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Legally enforceable, formally recorded unilateral or bilateral directive i.e., a policy or agreement.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"contentAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"contentReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ContractResourceStatusCodes-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"amended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Amended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"appended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Appended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"disputed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Disputed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"executable\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Executable</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"executed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Executed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"negotiable\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Negotiable</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"offered\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Offered</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"policy\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Policy</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"rejected\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Rejected</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"renewed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Renewed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"revoked\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Revoked</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"resolved\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Resolved</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"terminated\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Terminated</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ContractResourceStatusCodes\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A code specifying the state of the resource instance.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ContractResourceStatusCodes-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ContractResourcePublicationStatusCodes-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"amended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Amended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"appended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Appended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"disputed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Disputed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"executable\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Executable</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"executed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Executed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"negotiable\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Negotiable</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"offered\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Offered</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"policy\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Policy</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"rejected\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Rejected</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"renewed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Renewed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"revoked\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Revoked</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"resolved\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Resolved</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"terminated\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Terminated</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ContractResourcePublicationStatusCodes\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Status of the publication of contract content.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ContractResourcePublicationStatusCodes-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Coverage\" type=\"Coverage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Coverage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this coverage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health or payment by an individual or organization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"policyHolder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party who 'owns' the insurance policy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subscriber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party who has signed-up for or 'owns' the contractual relationship to the policy or to whom the benefit of the policy for services rendered to them or their family is due.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subscriberId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The insurer assigned ID for the Subscriber.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"beneficiary\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party who benefits from the insurance coverage; the patient when products and/or services are provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dependent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier for a dependent under the coverage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The relationship of beneficiary (patient) to the subscriber.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payor\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The program or plan underwriter or payor including both insurance and non-insurance agreements, such as patient-pay agreements.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"class\" type=\"Coverage.Class\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A suite of underwriter specific classifiers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"order\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The order of applicability of this coverage relative to other coverages which are currently in force. Note, there may be gaps in the numbering and this does not imply primary, secondary etc. as the specific positioning of coverages depends upon the episode of care.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The insurer-specific identifier for the insurer-defined network of providers to which the beneficiary may seek treatment which will be covered at the 'in-network' rate, otherwise 'out of network' terms and conditions apply.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"costToBeneficiary\" type=\"Coverage.CostToBeneficiary\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A suite of codes indicating the cost category and associated amount which have been detailed in the policy and may have been  included on the health card.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subrogation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When 'subrogation=true' this insurance instance has been included not for adjudication but to provide insurers with the details to recover costs.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contract\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The policy(s) which constitute this insurance coverage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Coverage.Class\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of classification for which an insurer-specific class label or number and optional name is provided, for example may be used to identify a class of coverage or employer group, Policy, Plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The alphanumeric string value associated with the insurer issued label.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short description for the class.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Coverage.CostToBeneficiary\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The category of patient centric costs associated with treatment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount due from the patient for the cost category.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueMoney\" type=\"Money\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"exception\" type=\"Coverage.Exception\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A suite of codes indicating exceptions or reductions to patient costs and their effective periods.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Coverage.Exception\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Financial instrument which may be used to reimburse or pay for health care products and services. Includes both insurance and self-payment.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code for the specific exception.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The timeframe during when the exception is in force.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"CoverageEligibilityRequest\" type=\"CoverageEligibilityRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"CoverageEligibilityRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this coverage eligiblity request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the requestor expects the processor to complete processing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"EligibilityRequestPurpose\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code to specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party who is the beneficiary of the supplied coverage and for whom eligibility is sought.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date or dates when the enclosed suite of services were performed or completed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"servicedDate\" type=\"date\"/>\r\n            <xs:element name=\"servicedPeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when this resource was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"enterer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Person who created the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The provider which is responsible for the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurer\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Insurer who issued the coverage in question and is the recipient of the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"facility\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Facility where the services are intended to be provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInfo\" type=\"CoverageEligibilityRequest.SupportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurance\" type=\"CoverageEligibilityRequest.Insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Financial instruments for reimbursement for the health care products and services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" type=\"CoverageEligibilityRequest.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Service categories or billable services for which benefit details and/or an authorization prior to service delivery may be required by the payor.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CoverageEligibilityRequest.SupportingInfo\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify supporting information entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"information\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"appliesToAll\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The supporting materials are applicable for all detail items, product/servce categories and specific billing codes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CoverageEligibilityRequest.Insurance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"focal\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A flag to indicate that this Coverage is to be used for evaluation of this request when set to true.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"coverage\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"businessArrangement\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A business agreement number established between the provider and the insurer for special business processing purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CoverageEligibilityRequest.Item\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"supportingInfoSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Exceptions, special conditions and supporting information applicable for this service or product line.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productOrService\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The practitioner who is responsible for the product or service to be rendered to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount charged to the patient by the provider for a single unit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"facility\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Facility where the services will be provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"diagnosis\" type=\"CoverageEligibilityRequest.Diagnosis\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Patient diagnosis for which care is sought.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The plan/proposal/order describing the proposed service in detail.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CoverageEligibilityRequest.Diagnosis\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The CoverageEligibilityRequest provides patient and insurance coverage information to an insurer for them to respond, in the form of an CoverageEligibilityResponse, with information regarding whether the stated coverage is valid and in-force and optionally to provide the insurance details of the policy.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The nature of illness or problem in a coded form or as a reference to an external defined Condition.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"diagnosisCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"diagnosisReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"EligibilityRequestPurpose-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"auth-requirements\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Coverage auth-requirements</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"benefits\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Coverage benefits</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"discovery\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Coverage Discovery</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"validation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Coverage Validation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"EligibilityRequestPurpose\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A code specifying the types of information being requested.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"EligibilityRequestPurpose-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"CoverageEligibilityResponse\" type=\"CoverageEligibilityResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"CoverageEligibilityResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this coverage eligiblity request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"EligibilityResponsePurpose\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code to specify whether requesting: prior authorization requirements for some service categories or billing codes; benefits for coverages specified or discovered; discovery and return of coverages for the patient; and/or validation that the specified coverage is in-force at the date/period specified or 'now' if not specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party who is the beneficiary of the supplied coverage and for whom eligibility is sought.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date or dates when the enclosed suite of services were performed or completed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"servicedDate\" type=\"date\"/>\r\n            <xs:element name=\"servicedPeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date this resource was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requestor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The provider which is responsible for the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"request\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the original request resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RemittanceOutcome\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The outcome of the request processing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"disposition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human readable description of the status of the adjudication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurer\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Insurer who issued the coverage in question and is the author of the response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurance\" type=\"CoverageEligibilityResponse.Insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Financial instruments for reimbursement for the health care products and services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preAuthRef\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference from the Insurer to which these services pertain to be used on further communication and as proof that the request occurred.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"form\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code for the form to be used for printing the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"error\" type=\"CoverageEligibilityResponse.Error\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Errors encountered during the processing of the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CoverageEligibilityResponse.Insurance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"coverage\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"inforce\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"benefitPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The term of the benefits documented in this response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" type=\"CoverageEligibilityResponse.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Benefits and optionally current balances, and authorization details by category or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CoverageEligibilityResponse.Item\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productOrService\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The practitioner who is eligible for the provision of the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"excluded\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">True if the indicated class of service is excluded from the plan, missing or False indicates the product or service is included in the coverage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short name or tag for the benefit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A richer description of the benefit or services covered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates if the benefits apply to an individual or to the family.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"term\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"benefit\" type=\"CoverageEligibilityResponse.Benefit\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Benefits used to date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authorizationRequired\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A boolean flag indicating whether a preauthorization is required prior to actual service delivery.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authorizationSupporting\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Codes or comments regarding information or actions associated with the preauthorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authorizationUrl\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A web location for obtaining requirements or descriptive information regarding the preauthorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CoverageEligibilityResponse.Benefit\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Classification of benefit being provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity of the benefit which is permitted under the coverage.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"allowedUnsignedInt\" type=\"unsignedInt\"/>\r\n            <xs:element name=\"allowedString\" type=\"string\"/>\r\n            <xs:element name=\"allowedMoney\" type=\"Money\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity of the benefit which have been consumed to date.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"usedUnsignedInt\" type=\"unsignedInt\"/>\r\n            <xs:element name=\"usedString\" type=\"string\"/>\r\n            <xs:element name=\"usedMoney\" type=\"Money\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"CoverageEligibilityResponse.Error\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides eligibility and plan details from the processing of an CoverageEligibilityRequest resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An error code,from a specified code system, which details why the eligibility check could not be performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"EligibilityResponsePurpose-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"auth-requirements\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Coverage auth-requirements</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"benefits\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Coverage benefits</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"discovery\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Coverage Discovery</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"validation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Coverage Validation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"EligibilityResponsePurpose\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A code specifying the types of information being requested.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"EligibilityResponsePurpose-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"DetectedIssue\" type=\"DetectedIssue\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"DetectedIssue\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifier associated with the detected issue record.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ObservationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the status of the detected issue.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the general type of issue identified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"severity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"DetectedIssueSeverity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the patient whose record the detected issue is associated with.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date or period when the detected issue was initially identified.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"identifiedDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"identifiedPeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Individual or device responsible for the issue being raised.  For example, a decision support application or a pharmacist conducting a medication review.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"implicated\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the resource representing the current activity or proposed activity that is potentially problematic.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"evidence\" type=\"DetectedIssue.Evidence\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Supporting evidence or manifestations that provide the basis for identifying the detected issue such as a GuidanceResponse or MeasureReport.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A textual explanation of the detected issue.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"mitigation\" type=\"DetectedIssue.Mitigation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates an action that has been taken or is committed to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting.  Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DetectedIssue.Evidence\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A manifestation that led to the recording of this detected issue.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Links to resources that constitute evidence for the detected issue such as a GuidanceResponse or MeasureReport.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DetectedIssue.Mitigation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"action\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates when the mitigating action was documented.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ObservationStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"registered\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Registered</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"preliminary\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Preliminary</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"final\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Final</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"amended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Amended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"corrected\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Corrected</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ObservationStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates the status of the identified issue.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ObservationStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DetectedIssueSeverity-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"high\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">High</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"moderate\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Moderate</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"low\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Low</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DetectedIssueSeverity\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates the potential degree of impact of the identified issue on the patient.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"DetectedIssueSeverity-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Device\" type=\"Device\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Device\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique instance identifiers assigned to a device by manufacturers other organizations or owners.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reference to the definition for the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"udiCarrier\" type=\"Device.UdiCarrier\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique device identifier (UDI) assigned to device label or package.  Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"FHIRDeviceStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Status of the Device availability.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reason for the dtatus of the Device availability.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"distinctIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name of the manufacturer.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manufactureDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date and time when the device was manufactured.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expirationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date and time beyond which this device is no longer valid or should not be used (if applicable).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lotNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Lot number assigned by the manufacturer.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"serialNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The serial number assigned by the organization when the device was manufactured.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"deviceName\" type=\"Device.DeviceName\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device.  This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modelNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The model number for the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The part number of the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind or type of device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialization\" type=\"Device.Specialization\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The capabilities supported on a  device, the standards to which the device conforms for a particular purpose, and used for the communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" type=\"Device.Version\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual design of the device or software version running on the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"property\" type=\"Device.Property\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Patient information, If the device is affixed to a person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"owner\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An organization that is responsible for the provision and ongoing maintenance of the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details for an organization or a particular human that is responsible for the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The place where the device can be found.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A network address on which the device may be contacted directly.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive information, usage information or implantation information that is not captured in an existing element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"safety\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides additional safety characteristics about a medical device.  For example devices containing latex.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The parent device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Device.UdiCarrier\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"deviceIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"issuer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include :\n1) GS1: \nhttp://hl7.org/fhir/NamingSystem/gs1-di, \n2) HIBCC:\nhttp://hl7.org/fhir/NamingSystem/hibcc-dI, \n3) ICCBBA for blood containers:\nhttp://hl7.org/fhir/NamingSystem/iccbba-blood-di, \n4) ICCBA for other devices:\nhttp://hl7.org/fhir/NamingSystem/iccbba-other-di.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identity of the authoritative source for UDI generation within a  jurisdiction.  All UDIs are globally unique within a single namespace with the appropriate repository uri as the system.  For example,  UDIs of devices managed in the U.S. by the FDA, the value is  http://hl7.org/fhir/NamingSystem/fda-udi.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"carrierAIDC\" minOccurs=\"0\" maxOccurs=\"1\" type=\"base64Binary\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID.   Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"carrierHRF\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"entryType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"UDIEntryType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A coded entry to indicate how the data was entered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Device.DeviceName\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DeviceNameType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of deviceName.\nUDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Device.Specialization\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"systemType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The standard that is used to operate and communicate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version of the standard that is used to operate and communicate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Device.Version\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the device version.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"component\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A single component of the device version.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version text.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Device.Property\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code that specifies the property DeviceDefinitionPropetyCode (Extensible).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"valueQuantity\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Property value as a quantity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"valueCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Property value as a code, e.g., NTP4 (synced to NTP).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"FHIRDeviceStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"inactive\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"FHIRDeviceStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The availability status of the device.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"FHIRDeviceStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DeviceNameType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"udi-label-name\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">UDI Label name</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"user-friendly-name\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">User Friendly name</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"patient-reported-name\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Patient Reported name</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"manufacturer-name\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Manufacturer name</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"model-name\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Model name</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"other\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">other</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DeviceNameType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of name the device is referred by.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"DeviceNameType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"UDIEntryType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"barcode\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Barcode</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"rfid\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">RFID</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"manual\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Manual</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"card\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Card</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"self-reported\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Self Reported</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"UDIEntryType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Codes to identify how UDI data was entered.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"UDIEntryType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"DeviceDefinition\" type=\"DeviceDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"DeviceDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique instance identifiers assigned to a device by the software, manufacturers, other organizations or owners. For example: handle ID.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"udiDeviceIdentifier\" type=\"DeviceDefinition.UdiDeviceIdentifier\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique device identifier (UDI) assigned to device label or package.  Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name of the manufacturer.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"manufacturerString\" type=\"string\"/>\r\n            <xs:element name=\"manufacturerReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"deviceName\" type=\"DeviceDefinition.DeviceName\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name given to the device to identify it.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modelNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The model number for the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">What kind of device or device system this is.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialization\" type=\"DeviceDefinition.Specialization\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The capabilities supported on a  device, the standards to which the device conforms for a particular purpose, and used for the communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The available versions of the device, e.g., software versions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"safety\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Safety characteristics of the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"shelfLifeStorage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ProductShelfLife\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Shelf Life and storage information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"physicalCharacteristics\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ProdCharacteristic\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Dimensions, color etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"languageCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Language code for the human-readable text strings produced by the device (all supported).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"capability\" type=\"DeviceDefinition.Capability\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Device capabilities.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"property\" type=\"DeviceDefinition.Property\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"owner\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An organization that is responsible for the provision and ongoing maintenance of the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details for an organization or a particular human that is responsible for the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A network address on which the device may be contacted directly.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"onlineInformation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Access to on-line information about the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive information, usage information or implantation information that is not captured in an existing element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity of the device present in the packaging (e.g. the number of devices present in a pack, or the number of devices in the same package of the medicinal product).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parentDevice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The parent device it can be part of.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"material\" type=\"DeviceDefinition.Material\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A substance used to create the material(s) of which the device is made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DeviceDefinition.UdiDeviceIdentifier\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"deviceIdentifier\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is to be associated with every Device that references this DeviceDefintiion for the issuer and jurisdication porvided in the DeviceDefinition.udiDeviceIdentifier.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"issuer\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization that assigns the identifier algorithm.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The jurisdiction to which the deviceIdentifier applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DeviceDefinition.DeviceName\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DeviceNameType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of deviceName.\nUDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DeviceDefinition.Specialization\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"systemType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The standard that is used to operate and communicate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version of the standard that is used to operate and communicate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DeviceDefinition.Capability\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of capability.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of capability.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DeviceDefinition.Property\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code that specifies the property DeviceDefinitionPropetyCode (Extensible).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"valueQuantity\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Property value as a quantity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"valueCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Property value as a code, e.g., NTP4 (synced to NTP).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DeviceDefinition.Material\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The characteristics, operational status and capabilities of a medical-related component of a medical device.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"substance\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"alternate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates an alternative material of the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"allergenicIndicator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the substance is a known or suspected allergen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"DeviceMetric\" type=\"DeviceMetric\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes a measurement, calculation or setting capability of a medical device.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"DeviceMetric\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes a measurement, calculation or setting capability of a medical device.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique instance identifiers assigned to a device by the device or gateway software, manufacturers, other organizations or owners. For example: handle ID.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the link to the  Device that this DeviceMetric belongs to and that contains administrative device information such as manufacturer, serial number, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the link to the  Device that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a Device that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"operationalStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"DeviceMetricOperationalStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates current operational state of the device. For example: On, Off, Standby, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"color\" minOccurs=\"0\" maxOccurs=\"1\" type=\"DeviceMetricColor\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DeviceMetricCategory\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"measurementPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Timing\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the measurement repetition time. This is not necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"calibration\" type=\"DeviceMetric.Calibration\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the calibrations that have been performed or that are required to be performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DeviceMetric.Calibration\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes a measurement, calculation or setting capability of a medical device.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"DeviceMetricCalibrationType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the type of the calibration method.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"state\" minOccurs=\"0\" maxOccurs=\"1\" type=\"DeviceMetricCalibrationState\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the state of the calibration.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"time\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the time last calibration has been performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DeviceMetricCalibrationType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"unspecified\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unspecified</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"offset\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Offset</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"gain\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Gain</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"two-point\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Two Point</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DeviceMetricCalibrationType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the type of a metric calibration.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"DeviceMetricCalibrationType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DeviceMetricColor-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"black\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Color Black</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"red\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Color Red</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"green\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Color Green</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"yellow\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Color Yellow</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"blue\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Color Blue</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"magenta\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Color Magenta</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cyan\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Color Cyan</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"white\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Color White</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DeviceMetricColor\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the typical color of representation.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"DeviceMetricColor-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DeviceMetricCalibrationState-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"not-calibrated\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not Calibrated</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"calibration-required\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Calibration Required</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"calibrated\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Calibrated</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unspecified\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unspecified</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DeviceMetricCalibrationState\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the state of a metric calibration.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"DeviceMetricCalibrationState-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DeviceMetricOperationalStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"on\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"off\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Off</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"standby\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Standby</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered In Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DeviceMetricOperationalStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the operational status of the DeviceMetric.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"DeviceMetricOperationalStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DeviceMetricCategory-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"measurement\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Measurement</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"setting\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Setting</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"calculation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Calculation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unspecified\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unspecified</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DeviceMetricCategory\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the category of the metric.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"DeviceMetricCategory-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"DeviceRequest\" type=\"DeviceRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"DeviceRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this order by the orderer or by the receiver.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this DeviceRequest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Plan/proposal/order fulfilled by this request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priorRequest\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The request takes the place of the referenced completed or terminated request(s).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"groupIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Composite request this is part of.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestIntent\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the request is a proposal, plan, an original order or a reflex order.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the {{title}} should be addressed with respect to other requests.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The details of the device to be used.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"codeReference\" type=\"Reference\"/>\r\n            <xs:element name=\"codeCodeableConcept\" type=\"CodeableConcept\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"parameter\" type=\"DeviceRequest.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific parameters for the ordered item.  For example, the prism value for lenses.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient who will use the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An encounter that provides additional context in which this request is made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The timing schedule for the use of the device. The Schedule data type allows many different expressions, for example. &quot;Every 8 hours&quot;; &quot;Three times a day&quot;; &quot;1/2 an hour before breakfast for 10 days from 23-Dec 2011:&quot;; &quot;15 Oct 2013, 17 Oct 2013 and 1 Nov 2013&quot;.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"occurrenceTiming\" type=\"Timing\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the request transitioned to being actionable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual who initiated the request and has responsibility for its activation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performerType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Desired type of performer for doing the diagnostic testing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The desired performer for doing the diagnostic testing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reason or justification for the use of this device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reason or justification for the use of this device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional clinical information about the patient that may influence the request fulfilment.  For example, this may include where on the subject's body the device will be used (i.e. the target site).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relevantHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Key events in the history of the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DeviceRequest.Parameter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code or string that identifies the device detail being asserted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the device detail.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueRange\" type=\"Range\"/>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"DeviceUseStatement\" type=\"DeviceUseStatement\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"DeviceUseStatement\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An external identifier for this statement such as an IRI.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A plan, proposal or order that is fulfilled in whole or in part by this DeviceUseStatement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DeviceUseStatementStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code representing the patient or other source's judgment about the state of the device used that this statement is about.  Generally this will be active or completed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient who used the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"derivedFrom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Allows linking the DeviceUseStatement to the underlying Request, or to other information that supports or is used to derive the DeviceUseStatement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How often the device was used.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"timingTiming\" type=\"Timing\"/>\r\n            <xs:element name=\"timingPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"timingDateTime\" type=\"dateTime\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"recordedOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time at which the statement was made/recorded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who reported the device was being used by the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"device\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The details of the device used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reason or justification for the use of the device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates another resource whose existence justifies this DeviceUseStatement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the anotomic location on the subject's body where the device was used ( i.e. the target).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DeviceUseStatementStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"intended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Intended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"stopped\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Stopped</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-hold\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DeviceUseStatementStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A coded concept indicating the current status of the Device Usage.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"DeviceUseStatementStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"DiagnosticReport\" type=\"DiagnosticReport\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"DiagnosticReport\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this report by the performer or other systems.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details concerning a service requested.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DiagnosticReportStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the diagnostic report.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code or name that describes this diagnostic report.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The healthcare event  (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"effectiveDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"effectivePeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"issued\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The diagnostic service that is responsible for issuing the report.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resultsInterpreter\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The practitioner or organization that is responsible for the report's conclusions and interpretations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specimen\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details about the specimens on which this diagnostic report is based.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"result\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">[Observations](observation.html)  that are part of this diagnostic report.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"imagingStudy\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"media\" type=\"DiagnosticReport.Media\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"conclusion\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"conclusionCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"presentedForm\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DiagnosticReport.Media\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The findings and interpretation of diagnostic  tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic reports.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"link\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the image source.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DiagnosticReportStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"registered\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Registered</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"partial\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Partial</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"preliminary\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Preliminary</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"final\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Final</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"amended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Amended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"corrected\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Corrected</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"appended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Appended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DiagnosticReportStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The status of the diagnostic report.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"DiagnosticReportStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"DocumentManifest\" type=\"DocumentManifest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A collection of documents compiled for a purpose together with metadata that applies to the collection.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"DocumentManifest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A collection of documents compiled for a purpose together with metadata that applies to the collection.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"masterIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Other identifiers associated with the document manifest, including version independent  identifiers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DocumentReferenceStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this document manifest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code specifying the type of clinical activity that resulted in placing the associated content into the DocumentManifest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"created\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies who is the author of the manifest. Manifest author is not necessarly the author of the references included.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recipient\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A patient, practitioner, or organization for which this set of documents is intended.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the source system, application, or software that produced the document manifest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-readable description of the source document. This is sometimes known as the &quot;title&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"content\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The list of Resources that consist of the parts of this manifest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"related\" type=\"DocumentManifest.Related\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related identifiers or resources associated with the DocumentManifest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DocumentManifest.Related\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A collection of documents compiled for a purpose together with metadata that applies to the collection.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related identifier to this DocumentManifest.  For example, Order numbers, accession numbers, XDW workflow numbers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"ref\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related Resource to this DocumentManifest. For example, Order, ServiceRequest,  Procedure, EligibilityRequest, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"DocumentReference\" type=\"DocumentReference\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"DocumentReference\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"masterIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Other identifiers associated with the document, including version independent identifiers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DocumentReferenceStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this document reference.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"docStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CompositionStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the underlying document.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the particular kind of document referenced  (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the document reference was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies who is responsible for adding the information to the document.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authenticator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Which person or organization authenticates that this document is valid.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"custodian\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatesTo\" type=\"DocumentReference.RelatesTo\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Relationships that this document has with other document references that already exist.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-readable description of the source document.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"securityLabel\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the &quot;reference&quot; to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"content\" type=\"DocumentReference.Content\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The document and format referenced. There may be multiple content element repetitions, each with a different format.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"context\" type=\"DocumentReference.Context\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The clinical context in which the document was prepared.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DocumentReference.RelatesTo\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"DocumentRelationshipType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of relationship that this document has with anther document.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"target\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The target document of this relationship.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DocumentReference.Content\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"attachment\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The document or URL of the document along with critical metadata to prove content has integrity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"format\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"DocumentReference.Context\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the clinical encounter or type of care that the document content is associated with.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"event\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a &quot;History and Physical Report&quot; in which the procedure being documented is necessarily a &quot;History and Physical&quot; act.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time period over which the service that is described by the document was provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"facilityType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of facility where the patient was seen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"practiceSetting\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sourcePatientInfo\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Patient Information as known when the document was published. May be a reference to a version specific, or contained.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"related\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related identifiers or resources associated with the DocumentReference.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"EffectEvidenceSynthesis\" type=\"EffectEvidenceSynthesis\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"EffectEvidenceSynthesis\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this effect evidence synthesis when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this effect evidence synthesis is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the effect evidence synthesis is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this effect evidence synthesis when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the effect evidence synthesis when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the effect evidence synthesis author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the effect evidence synthesis. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the effect evidence synthesis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this effect evidence synthesis. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the effect evidence synthesis was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the effect evidence synthesis changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the effect evidence synthesis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the effect evidence synthesis from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate effect evidence synthesis instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the effect evidence synthesis is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the effect evidence synthesis and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the effect evidence synthesis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the effect evidence synthesis content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the EffectEvidenceSynthesis. Topics provide a high-level categorization grouping types of EffectEvidenceSynthesiss that can be useful for filtering and searching.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"synthesisType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of synthesis eg meta-analysis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"studyType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of study eg randomized trial.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"population\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the population for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exposure\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the exposure for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exposureAlternative\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the comparison exposure for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resomece that defines the outcome for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sampleSize\" type=\"EffectEvidenceSynthesis.SampleSize\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the size of the sample involved in the synthesis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resultsByExposure\" type=\"EffectEvidenceSynthesis.ResultsByExposure\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the results for each exposure considered in the effect estimate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectEstimate\" type=\"EffectEvidenceSynthesis.EffectEstimate\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The estimated effect of the exposure variant.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"certainty\" type=\"EffectEvidenceSynthesis.Certainty\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the certainty of the effect estimate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"EffectEvidenceSynthesis.SampleSize\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-readable summary of sample size.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numberOfStudies\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number of studies included in this evidence synthesis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numberOfParticipants\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number of participants included in this evidence synthesis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"EffectEvidenceSynthesis.ResultsByExposure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-readable summary of results by exposure state.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exposureState\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ExposureState\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether these results are for the exposure state or alternative exposure state.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"variantState\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used to define variant exposure states such as low-risk state.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"riskEvidenceSynthesis\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to a RiskEvidenceSynthesis resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"EffectEvidenceSynthesis.EffectEstimate\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-readable summary of effect estimate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Examples include relative risk and mean difference.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"variantState\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used to define variant exposure states such as low-risk state.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The point estimate of the effect estimate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitOfMeasure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the UCUM unit for the outcome.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"precisionEstimate\" type=\"EffectEvidenceSynthesis.PrecisionEstimate\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the precision of the estimate for the effect.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"EffectEvidenceSynthesis.PrecisionEstimate\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Examples include confidence interval and interquartile range.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"level\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Use 95 for a 95% confidence interval.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"from\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Lower bound of confidence interval.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"to\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Upper bound of confidence interval.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"EffectEvidenceSynthesis.Certainty\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"rating\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A rating of the certainty of the effect estimate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"certaintySubcomponent\" type=\"EffectEvidenceSynthesis.CertaintySubcomponent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of a component of the overall certainty.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"EffectEvidenceSynthesis.CertaintySubcomponent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EffectEvidenceSynthesis resource describes the difference in an outcome between exposures states in a population where the effect estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of subcomponent of certainty rating.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rating\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A rating of a subcomponent of rating certainty.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ExposureState-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"exposure\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Exposure</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"exposure-alternative\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Exposure Alternative</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ExposureState\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Whether the results by exposure is describing the results for the primary exposure of interest (exposure) or the alternative state (exposureAlternative).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ExposureState-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Encounter\" type=\"Encounter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Encounter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier(s) by which this encounter is known.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EncounterStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">planned | arrived | triaged | in-progress | onleave | finished | cancelled +.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusHistory\" type=\"Encounter.StatusHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"class\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"classHistory\" type=\"Encounter.ClassHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The class history permits the tracking of the encounters transitions without needing to go  through the resource history.  This would be used for a case where an admission starts of as an emergency encounter, then transitions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kind of discharge from emergency to inpatient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"serviceType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Broad categorization of the service that is to be provided (e.g. cardiology).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the urgency of the encounter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient or group present at the encounter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"episodeOfCare\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem.  The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The request this encounter satisfies (e.g. incoming referral or procedure request).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"participant\" type=\"Encounter.Participant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The list of people responsible for providing the service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"appointment\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The appointment that scheduled this encounter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The start and end time of the encounter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"length\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Quantity of time the encounter lasted. This excludes the time during leaves of absence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"diagnosis\" type=\"Encounter.Diagnosis\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The list of diagnosis relevant to this encounter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"account\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The set of accounts that may be used for billing for this Encounter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"hospitalization\" type=\"Encounter.Hospitalization\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details about the admission to a healthcare service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" type=\"Encounter.Location\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">List of locations where  the patient has been during this encounter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"serviceProvider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation.  Refer to the example bundle showing an abbreviated set of Encounters for a colonoscopy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Another Encounter of which this encounter is a part of (administratively or in time).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Encounter.StatusHistory\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EncounterStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">planned | arrived | triaged | in-progress | onleave | finished | cancelled +.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time that the episode was in the specified status.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Encounter.ClassHistory\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"class\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">inpatient | outpatient | ambulatory | emergency +.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time that the episode was in the specified class.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Encounter.Participant\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Role of participant in encounter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"individual\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Persons involved in the encounter other than the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Encounter.Diagnosis\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"condition\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"use\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rank\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Ranking of the diagnosis (for each role type).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Encounter.Hospitalization\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"preAdmissionIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Pre-admission identifier.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"origin\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The location/organization from which the patient came before admission.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"admitSource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">From where patient was admitted (physician referral, transfer).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reAdmission\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this hospitalization is a readmission and why if known.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dietPreference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Diet preferences reported by the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialCourtesy\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Special courtesies (VIP, board member).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialArrangement\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Any special requests that have been made for this hospitalization encounter, such as the provision of specific equipment or other things.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"destination\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Location/organization to which the patient is discharged.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dischargeDisposition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Category or kind of location after discharge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Encounter.Location\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"location\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The location where the encounter takes place.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"EncounterLocationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"physicalType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time period during which the patient was present at the location.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"EncounterLocationStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"planned\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Planned</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"reserved\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Reserved</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"EncounterLocationStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The status of the location.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"EncounterLocationStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"EncounterStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"planned\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Planned</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"arrived\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Arrived</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"triaged\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Triaged</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"in-progress\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"onleave\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On Leave</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"finished\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Finished</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"EncounterStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Current state of the encounter.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"EncounterStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Endpoint\" type=\"Endpoint\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Endpoint\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b or a REST endpoint for another FHIR server. This may include any security context information.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for the organization that is used to identify the endpoint across multiple disparate systems.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EndpointStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">active | suspended | error | off | test.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"connectionType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A coded value that represents the technical details of the usage of this endpoint, such as what WSDLs should be used in what way. (e.g. XDS.b/DICOM/cds-hook).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A friendly name that this endpoint can be referred to with.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"managingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization that manages this endpoint (even if technically another organization is hosting this in the cloud, it is the organization associated with the data).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The interval during which the endpoint is expected to be operational.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payloadType\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The payload type describes the acceptable content that can be communicated on the endpoint.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payloadMimeType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The mime type to send the payload in - e.g. application/fhir+xml, application/fhir+json. If the mime type is not specified, then the sender could send any content (including no content depending on the connectionType).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"address\" minOccurs=\"1\" maxOccurs=\"1\" type=\"url\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The uri that describes the actual end-point to connect to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"header\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional headers / information to send as part of the notification.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"EndpointStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"suspended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Suspended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"off\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Off</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"test\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Test</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"EndpointStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The status of the endpoint.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"EndpointStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"EnrollmentRequest\" type=\"EnrollmentRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the insurance enrollment details to the insurer regarding a specified coverage.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"EnrollmentRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the insurance enrollment details to the insurer regarding a specified coverage.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Response business identifier.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"created\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when this resource was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Insurer who is target  of the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"candidate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Patient Resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"coverage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the program or plan identification, underwriter or payor.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"EnrollmentResponse\" type=\"EnrollmentResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides enrollment and plan details from the processing of an EnrollmentRequest resource.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"EnrollmentResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides enrollment and plan details from the processing of an EnrollmentRequest resource.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Response business identifier.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Original request resource reference.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RemittanceOutcome\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Processing status: error, complete.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"disposition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the status of the adjudication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"created\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when the enclosed suite of services were performed or completed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"organization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Insurer who produced this adjudicated response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requestProvider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"EpisodeOfCare\" type=\"EpisodeOfCare\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"EpisodeOfCare\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The EpisodeOfCare may be known by different identifiers for different contexts of use, such as when an external agency is tracking the Episode for funding purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EpisodeOfCareStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">planned | waitlist | active | onhold | finished | cancelled.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusHistory\" type=\"EpisodeOfCare.StatusHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"diagnosis\" type=\"EpisodeOfCare.Diagnosis\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The list of diagnosis relevant to this episode of care.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient who is the focus of this episode of care.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"managingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization that has assumed the specific responsibilities for the specified duration.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The interval during which the managing organization assumes the defined responsibility.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referralRequest\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"careManager\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The practitioner that is the care manager/care coordinator for this patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"team\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The list of practitioners that may be facilitating this episode of care for specific purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"account\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The set of accounts that may be used for billing for this EpisodeOfCare.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"EpisodeOfCare.StatusHistory\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EpisodeOfCareStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">planned | waitlist | active | onhold | finished | cancelled.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during this EpisodeOfCare that the specific status applied.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"EpisodeOfCare.Diagnosis\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"condition\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rank\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Ranking of the diagnosis (for each role type).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"EpisodeOfCareStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"planned\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Planned</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"waitlist\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Waitlist</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"onhold\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"finished\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Finished</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"EpisodeOfCareStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The status of the episode of care.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"EpisodeOfCareStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"EventDefinition\" type=\"EventDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EventDefinition resource provides a reusable description of when a particular event can occur.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"EventDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EventDefinition resource provides a reusable description of when a particular event can occur.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this event definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this event definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the event definition is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this event definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the event definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the event definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the event definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the event definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the event definition giving additional information about its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this event definition. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this event definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code or group definition that describes the intended subject of the event definition.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the event definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the event definition changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the event definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the event definition from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate event definition instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the event definition is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this event definition is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A detailed description of how the event definition is used from a clinical perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the event definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the event definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the event definition content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the module. Topics provide a high-level categorization of the module that can be useful for filtering and searching.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related resources such as additional documentation, justification, or bibliographic references.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"trigger\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"TriggerDefinition\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The trigger element defines when the event occurs. If more than one trigger condition is specified, the event fires whenever any one of the trigger conditions is met.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Evidence\" type=\"Evidence\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Evidence resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Evidence\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Evidence resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this evidence when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this evidence is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the evidence is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this evidence when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the evidence when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the evidence author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the evidence. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the evidence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"shortTitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the Evidence giving additional information about its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this evidence. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the evidence was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the evidence changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the evidence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the evidence from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the evidence is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the evidence and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the evidence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the evidence content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the Evidence. Topics provide a high-level categorization grouping types of Evidences that can be useful for filtering and searching.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exposureBackground\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the population for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exposureVariant\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the exposure for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resomece that defines the outcome for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"EvidenceVariable\" type=\"EvidenceVariable\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EvidenceVariable resource describes a &quot;PICO&quot; element that knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"EvidenceVariable\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EvidenceVariable resource describes a &quot;PICO&quot; element that knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this evidence variable when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this evidence variable is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the evidence variable is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this evidence variable when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the evidence variable when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the evidence variable author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the evidence variable. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the evidence variable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"shortTitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the EvidenceVariable giving additional information about its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this evidence variable. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the evidence variable was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the evidence variable changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the evidence variable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the evidence variable from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate evidence variable instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the evidence variable is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the evidence variable and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the evidence variable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the evidence variable content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the EvidenceVariable. Topics provide a high-level categorization grouping types of EvidenceVariables that can be useful for filtering and searching.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"EvidenceVariableType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of evidence element, a population, an exposure, or an outcome.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"characteristic\" type=\"EvidenceVariable.Characteristic\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A characteristic that defines the members of the evidence element. Multiple characteristics are applied with &quot;and&quot; semantics.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"EvidenceVariable.Characteristic\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The EvidenceVariable resource describes a &quot;PICO&quot; element that knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, natural language description of the characteristic that could be used to communicate the criteria to an end-user.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Define members of the evidence element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year).</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"definitionReference\" type=\"Reference\"/>\r\n            <xs:element name=\"definitionCanonical\" type=\"canonical\"/>\r\n            <xs:element name=\"definitionCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"definitionExpression\" type=\"Expression\"/>\r\n            <xs:element name=\"definitionDataRequirement\" type=\"DataRequirement\"/>\r\n            <xs:element name=\"definitionTriggerDefinition\" type=\"TriggerDefinition\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"usageContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Use UsageContext to define the members of the population, such as Age Ranges, Genders, Settings.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exclude\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When true, members with this characteristic are excluded from the element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates what effective period the study covers.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"participantEffectiveDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"participantEffectivePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"participantEffectiveDuration\" type=\"Duration\"/>\r\n            <xs:element name=\"participantEffectiveTiming\" type=\"Timing\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"timeFromStart\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates duration from the participant's study entry.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"groupMeasure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"GroupMeasure\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how elements are aggregated within the study effective period.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"EvidenceVariableType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"dichotomous\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Dichotomous</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"continuous\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Continuous</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"descriptive\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Descriptive</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"EvidenceVariableType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The possible types of variables for exposures or outcomes (E.g. Dichotomous, Continuous, Descriptive).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"EvidenceVariableType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"GroupMeasure-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"mean\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Mean</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"median\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Median</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"mean-of-mean\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Mean of Study Means</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"mean-of-median\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Mean of Study Medins</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"median-of-mean\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Median of Study Means</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"median-of-median\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Median of Study Medians</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"GroupMeasure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Possible group measure aggregates (E.g. Mean, Median).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"GroupMeasure-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ExampleScenario\" type=\"ExampleScenario\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ExampleScenario\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this example scenario when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this example scenario is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the example scenario is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this example scenario when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the example scenario when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the example scenario author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the example scenario. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this example scenario. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this example scenario is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the example scenario was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the example scenario changes. (e.g. the 'content logical definition').</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the example scenario.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate example scenario instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the example scenario is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the example scenario and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the example scenario.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">What the example scenario resource is created for. This should not be used to show the business purpose of the scenario itself, but the purpose of documenting a scenario.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" type=\"ExampleScenario.Actor\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Actor participating in the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instance\" type=\"ExampleScenario.Instance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Each resource and each version that is present in the workflow.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"process\" type=\"ExampleScenario.Process\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Each major process - a group of operations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"workflow\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Another nested workflow.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExampleScenario.Actor\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"actorId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">ID or acronym of actor.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ExampleScenarioActorType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of actor - person or system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the actor as shown in the page.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The description of the actor.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExampleScenario.Instance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"resourceId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The id of the resource for referencing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resourceType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ResourceType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short name for the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-friendly description of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" type=\"ExampleScenario.Version\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A specific version of the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"containedInstance\" type=\"ExampleScenario.ContainedInstance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Resources contained in the instance (e.g. the observations contained in a bundle).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExampleScenario.Version\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"versionId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier of a specific version of a resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The description of the resource version.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExampleScenario.ContainedInstance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"resourceId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Each resource contained in the instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"versionId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A specific version of a resource contained in the instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExampleScenario.Process\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"title\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The diagram title of the group of operations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A longer description of the group of operations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preConditions\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of initial status before the process starts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"postConditions\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of final status after the process ends.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"step\" type=\"ExampleScenario.Step\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Each step of the process.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExampleScenario.Step\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"process\" type=\"ExampleScenario.Process\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Nested process.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"pause\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If there is a pause in the flow.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"operation\" type=\"ExampleScenario.Operation\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Each interaction or action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"alternative\" type=\"ExampleScenario.Alternative\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates an alternative step that can be taken instead of the operations on the base step in exceptional/atypical circumstances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExampleScenario.Operation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"number\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The sequential number of the interaction, e.g. 1.2.5.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of operation - CRUD.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The human-friendly name of the interaction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"initiator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who starts the transaction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"receiver\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who receives the transaction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A comment to be inserted in the diagram.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"initiatorActive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the initiator is deactivated right after the transaction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"receiverActive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the receiver is deactivated right after the transaction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"request\" type=\"ExampleScenario.ContainedInstance\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Each resource instance used by the initiator.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"response\" type=\"ExampleScenario.ContainedInstance\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Each resource instance used by the responder.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExampleScenario.Alternative\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Example of workflow instance.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"title\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The label to display for the alternative that gives a sense of the circumstance in which the alternative should be invoked.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable description of the alternative explaining when the alternative should occur rather than the base step.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"step\" type=\"ExampleScenario.Step\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">What happens in each alternative option.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ExampleScenarioActorType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"person\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Person</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entity\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">System</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ExampleScenarioActorType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of actor - system or human.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ExampleScenarioActorType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ResourceType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"Account\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Account</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Account</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Cuenta</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">账户</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ActivityDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ActivityDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ActivityDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">DefinizioneAttivita</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DefinicionDeActividad</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">活动定义</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AdverseEvent\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">AdverseEvent</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">AdverseEvent</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">EventoAvverso</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">EventoAdverso</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">不良事件</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AllergyIntolerance\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">AllergyIntolerance</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">AllergyIntolerance</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">AllergiaIntolleranza</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">IntoléranceAllergique</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">AllergiaIntolerancia</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">变态反应与不耐性</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Appointment\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Appointment</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Appointment</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Appuntamento</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RendezVous</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Cita</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">预约</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AppointmentResponse\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">AppointmentResponse</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">AppointmentResponse</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RispostaAppuntamento</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RéponseRendezVous</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">CitaRespuesta</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">预约响应</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AuditEvent\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">AuditEvent</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">AuditEvent</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">ÉvènementSécurité</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">EventoSeguridad</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">审计事件</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Basic\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Basic</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Basic</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Basique</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Basico</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">初级资源</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Binary\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Binary</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Binary</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Binario</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Binaire</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Binario</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">二进制资源</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BiologicallyDerivedProduct\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BiologicallyDerivedProduct</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">BiologicallyDerivedProduct</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BodyStructure\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BodyStructure</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">BodyStructure</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">StrutturaDelCorpo</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">MorphologieDeCorps</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">EstructuraDelCuerpo</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">身体结构</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Bundle\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Bundle</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Bundle</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Paquet</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Paquete</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">捆束</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CapabilityStatement\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CapabilityStatement</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">CapabilityStatement</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DeclaracionDeCapacidad</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">能力声明</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CarePlan\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CarePlan</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">CarePlan</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">PianoDiCura</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">PlanDeSoins</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">PlanDeCuidado</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">照护计划</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CareTeam\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CareTeam</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">CareTeam</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">EquipoDeCuidado</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">照护团队</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CatalogEntry\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CatalogEntry</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">CatalogEntry</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">EntradaDeCatalogo</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">条目定义</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ChargeItem\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ChargeItem</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ChargeItem</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">CargoDeItem</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">收费项目</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ChargeItemDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ChargeItemDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ChargeItemDefinition</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Claim\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Claim</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Claim</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Réclamation</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Reclamación / Factura</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">赔单</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ClaimResponse\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ClaimResponse</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ClaimResponse</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RéponseARéclamation</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">赔单请求</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ClinicalImpression\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ClinicalImpression</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ClinicalImpression</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">ImpressioneClinica</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">ImpressionClinique</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">HallazgoClinico</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">临床印象</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CodeSystem\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CodeSystem</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">CodeSystem</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">SistemaDiCodifica</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">SistemaDeCodigos</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">代码系统</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Communication\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Communication</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Communication</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Comunicazione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Communication</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Comunicación</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">通讯</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CommunicationRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CommunicationRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">CommunicationRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RichiestaDiComunicazione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">DemandeDeCommunication</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ComunicaciónRequerimiento</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">通讯请求</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CompartmentDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CompartmentDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">CompartmentDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DefinicionDeCompartimento</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">逻辑区块定义</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Composition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Composition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Composition</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Composizione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Composition</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Composición</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">组合式文书</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ConceptMap\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ConceptMap</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ConceptMap</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">MappaDiConcetti</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">CarteDeConcepts</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">MapaDeConceptos</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">概念映射</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Condition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Condition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Condition</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Condizione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Condition</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Condición</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">情况</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Consent\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Consent</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Consent</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Consenso</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Consentimiento</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">同意书</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Contract\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Contract</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Contract</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Contratto</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Contrat</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Contato</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">合同</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Coverage\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Coverage</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Coverage</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Copertura</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Couverture</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Cobertura</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">保险责任</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CoverageEligibilityRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CoverageEligibilityRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">CoverageEligibilityRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RichiestaEleggibilitaCopertura</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">CouvertureDemandeEligibilité</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">资格请求</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CoverageEligibilityResponse\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CoverageEligibilityResponse</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">CoverageEligibilityResponse</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RispostaEleggibilitaCopertura</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RéponseEligibilitéCouverture</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">资格响应</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DetectedIssue\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DetectedIssue</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">DetectedIssue</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">ProblemaRilevato</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Problème Détecté</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Problema-Detectado /ProblemaDetectado</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">已发现问题</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Device\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Device</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Device</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Dispositivo</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Dispositif</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Dispositivo</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">装置</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DeviceDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DeviceDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">DeviceDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">DéfinitionDeDispositif</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DefiniciónDeDispositivo</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">装置组件</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DeviceMetric\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DeviceMetric</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">DeviceMetric</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">MétriqueDispositif</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">MetricaDeDispositivo</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">装置指标</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DeviceRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DeviceRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">DeviceRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RichiestaDispositivo</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">DemandeUtilisationDispositif</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">SolicitudDeDispositivo</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">装置请求</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DeviceUseStatement\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DeviceUseStatement</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">DeviceUseStatement</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">装置使用声明</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DiagnosticReport\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DiagnosticReport</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">DiagnosticReport</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RefertoDiagnostico</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RapportDiagnostique</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">诊断报告</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">InformeDiagnostico</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DocumentManifest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DocumentManifest</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">DocumentManifest</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Manifeste</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">文档清单</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ManifestoDocumento</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DocumentReference\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DocumentReference</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">DocumentReference</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RiferimentoDocumento</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RéférenceDocument</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ReferenciaDocumento</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">文档引用</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DomainResource\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DomainResource</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">DomainResource</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">RecursoDeDominio</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">领域资源</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EffectEvidenceSynthesis\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">EffectEvidenceSynthesis</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">EffectEvidenceSynthesis</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Encounter\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Encounter</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Encounter</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Venue</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">就医过程</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Encuentro</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Endpoint\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Endpoint</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Endpoint</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Endpoint</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">端点</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EnrollmentRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">EnrollmentRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">EnrollmentRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RichiestaIscrizione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">DemandeInscription</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">SolicitudDeEnrolamiento</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">保险注册请求</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EnrollmentResponse\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">EnrollmentResponse</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">EnrollmentResponse</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RispostaIscrizione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RéponseInscription</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">RespuestaDeEnrolamiento</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">保险注册响应</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EpisodeOfCare\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">EpisodeOfCare</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">EpisodeOfCare</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">EpisodioDiCura</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">ÉpisodeDeSoins</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">EpisodioDeCuidado</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">照护服务节段</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EventDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">EventDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">EventDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">DefinizioneEvento</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DefinitionDeEvento</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">事件定义</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Evidence\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Evidence</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Evidence</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EvidenceVariable\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">EvidenceVariable</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">EvidenceVariable</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ExampleScenario\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ExampleScenario</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ExampleScenario</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">ScenarioDiEsempio</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">EjemploDeEscenario</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">示例场景</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ExplanationOfBenefit\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ExplanationOfBenefit</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ExplanationOfBenefit</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">ExplicationDuBénéfice</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">赔付说明</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"FamilyMemberHistory\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">FamilyMemberHistory</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">FamilyMemberHistory</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">HistoireMembreFamille</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">HistorialMiembroFamiliar</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">家族史</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Flag\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Flag</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Flag</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Drapeau</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Bandera</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">标记</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Goal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Goal</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Goal</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">But</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Objetivo</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">目标</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GraphDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GraphDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">GraphDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DefinitionGrafico</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">图形定义</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Group\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Group</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Group</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Gruppo</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Groupe</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Grupo</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">群组</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GuidanceResponse\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GuidanceResponse</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">GuidanceResponse</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">RespuestaDeOrientacion</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">指导意见响应</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"HealthcareService\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">HealthcareService</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">HealthcareService</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">ServizioSanitario</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">ServiceDeSanté</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ServicioDeCuidado</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">医疗保健服务项目</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ImagingStudy\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ImagingStudy</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ImagingStudy</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">EtudeImagerie</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">EstudioImagen  / EstudioImagen</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">成像检查</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Immunization\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Immunization</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Immunization</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Immunizzazione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Immunisation</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">免疫接种</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Inmunización</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ImmunizationEvaluation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ImmunizationEvaluation</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ImmunizationEvaluation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ImmunizationRecommendation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ImmunizationRecommendation</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ImmunizationRecommendation</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RecommendationImmunisation</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">免疫接种建议</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">RecomendaciónInmunización /</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ImplementationGuide\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ImplementationGuide</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ImplementationGuide</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">GuiaDeImplementacion</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">实施指南</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"InsurancePlan\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">InsurancePlan</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">InsurancePlan</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Invoice\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Invoice</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Invoice</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Library\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Library</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Library</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Librería</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">库</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Linkage\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Linkage</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Linkage</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Enlace / Conexión / Vinculo / Acoplamiento </xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">链接关系</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"List\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">List</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">List</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Lista</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Liste</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">列表</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Lista</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Location\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Location</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Location</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Localisation</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">位置</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Locacion</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Measure\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Measure</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Measure</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Misura</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Medida</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">指标</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MeasureReport\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MeasureReport</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MeasureReport</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ReporteMedida</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">指标报告</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Media\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Media</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Media</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Media</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Média</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Medio</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">媒体</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Medication\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Medication</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Medication</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Médication</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">药物</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Medicación /Medicamento</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicationAdministration\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicationAdministration</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicationAdministration</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">AdministrationMédicaments</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">药物施用</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">AdministraciónMedicación / AdministracionMedicamento</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicationDispense\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicationDispense</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicationDispense</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">DispensationMédicaments</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">药物配发</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DispensaciónMedicación /DispensacionMedicamento</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicationKnowledge\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicationKnowledge</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicationKnowledge</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicationRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicationRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicationRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">PrescriptionMédicamenteuseTODO</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">药物请求</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">PrescripciónMedicaciónTODO  /PrescripcionMedicamento</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicationStatement\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicationStatement</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicationStatement</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">ÉtatMédication</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">药物声明</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ResumenMedicación /ResumenMedicamento</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicinalProduct\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProduct</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProduct</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">ProdottoMedicinale</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicinalProductAuthorization\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductAuthorization</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductAuthorization</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">AutorizzazioneProdottoMedicinale</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicinalProductContraindication\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductContraindication</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductContraindication</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicinalProductIndication\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductIndication</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductInteraction</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicinalProductIngredient\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductIngredient</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductIngredient</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">IngredienteProdottoMedicinale</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicinalProductInteraction\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductInteraction</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductInteraction</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicinalProductManufactured\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductManufactured</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductManufactured</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicinalProductPackaged\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductPackaged</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductPackaged</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicinalProductPharmaceutical\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductPharmaceutical</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductPharmaceutical</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MedicinalProductUndesirableEffect\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductUndesirableEffect</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MedicinalProductUndesirableEffect</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MessageDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MessageDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MessageDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">DefinizioneMessaggio</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DefinicionMensaje</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">消息定义</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MessageHeader\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MessageHeader</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MessageHeader</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">EntêteMessage</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">消息标头</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">CabeceraMensaje</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MolecularSequence\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MolecularSequence</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">MolecularSequence</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">SecuenciaMolecular</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">分子序列</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NamingSystem\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">NamingSystem</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">NamingSystem</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">SystèmeDeNommage</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">SistemaDeNombres</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">命名系统</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NutritionOrder\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">NutritionOrder</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">NutritionOrder</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">OrdreNutrition</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">OrdenNutrición</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">营养医嘱</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Observation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Observation</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Observation</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Osservazione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Observation</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">观察</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Observación</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ObservationDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ObservationDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ObservationDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">DefinizioneOsservazione</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DefinicionDeEspecimen</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">观察定义</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OperationDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">OperationDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">OperationDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">DefinizioneOperazione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">DéfinitionOpération</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DefinicionDeOperacion</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">操作定义</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OperationOutcome\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">OperationOutcome</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">OperationOutcome</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RisultatoOperazione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RésultatOpération</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">操作结局</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ResultadoOperación</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Organization\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Organization</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Organization</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Organizzazione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Organisation</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">组织机构</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Organización</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OrganizationAffiliation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">OrganizationAffiliation</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">OrganizationAffiliation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Parameters\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Parameters</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Parameters</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Parametros</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">参数</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Patient\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Patient</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Patient</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Paziente</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Patient</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">患者</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Paciente</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PaymentNotice\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PaymentNotice</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">PaymentNotice</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">AvvisoDiPagamento</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">AvisPaiement</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">AvisoDePago</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">付款通知</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PaymentReconciliation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PaymentReconciliation</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">PaymentReconciliation</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RiconciliazionePagamento</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RéconciliationPaiement</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ConciliacionDePago</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">付款对账</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Person\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Person</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Person</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Persona</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Personne</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Persona</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">人员</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PlanDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PlanDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">PlanDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DefinicionDePlan</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">计划定义</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Practitioner\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Practitioner</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Practitioner</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Praticien</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">执业人员</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Practicante / Profesional</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PractitionerRole\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PractitionerRole</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">PractitionerRole</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">RolProfesional</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">执业人员角色</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Procedure\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Procedure</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Procedure</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Procedura</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Procédure</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">操作项目</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Procedimiento</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Provenance\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Provenance</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Provenance</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Provenienza</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Provenance</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">出处</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Procedencia</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Questionnaire\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Questionnaire</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Questionnaire</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Questionario</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Questionnaire</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">调查问卷</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Cuestionario</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"QuestionnaireResponse\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">QuestionnaireResponse</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">QuestionnaireResponse</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RispostaQuestionario</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RéponseQuestionnaire</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">RespuestaAlCuestionario</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">调查问卷答复</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"RelatedPerson\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">RelatedPerson</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">RelatedPerson</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">PersonaCorrelata</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">PersonneEnRelation</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">PersonaRelacionada</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">相关人员</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"RequestGroup\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">RequestGroup</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">RequestGroup</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">GruppoDiRichieste</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">GrupoDeSolicitudes</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">请求分组</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ResearchDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ResearchDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ResearchDefinition</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ResearchElementDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ResearchElementDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ResearchElementDefinition</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ResearchStudy\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ResearchStudy</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ResearchStudy</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">EstudioDeInvestigacion</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">调查研究</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ResearchSubject\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ResearchSubject</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ResearchSubject</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">SujetoDeInvestigacion</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">研究主题</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Resource\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Resource</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Resource</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Recurso</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">资源</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"RiskAssessment\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">RiskAssessment</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">RiskAssessment</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">ÉvaluationRisques</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">EvaluacionDeRiesgo</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">风险评估</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"RiskEvidenceSynthesis\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">RiskEvidenceSynthesis</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">RiskEvidenceSynthesis</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Schedule\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Schedule</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Schedule</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Agenda</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">日程安排</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SearchParameter\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SearchParameter</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">SearchParameter</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">ParametroDiRicerca</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">ParamètreRecherche</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ParametroDeBusqueda</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">搜索参数</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ServiceRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ServiceRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ServiceRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">RichiestaDiServizio</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">DemandeService</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">PeticiónServicio</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">服务项目请求</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Slot\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Slot</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Slot</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Slot</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">槽位</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Hueco / Zocalo / Espacio</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Specimen\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Specimen</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Specimen</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Campione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Spécimen</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">标本</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Especimen</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SpecimenDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SpecimenDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">SpecimenDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">DefinizioneCampione</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DefinicionDeEspecimen</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">标本定义</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"StructureDefinition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">StructureDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">StructureDefinition</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">DefinizioneStruttura</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">DéfinitionStructure</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">DefinicionDeEstructura</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">结构定义</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"StructureMap\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">StructureMap</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">StructureMap</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">MapaDeEstructura</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">结构映射</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Subscription\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Subscription</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Subscription</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Sottoscrizione</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Souscription</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">订阅</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Suscripción</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Substance\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Substance</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Substance</xs:documentation>\r\n          <xs:documentation xml:lang=\"it\">Sostanza</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Substance</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">物质</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Sustancia</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SubstanceNucleicAcid\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SubstanceNucleicAcid</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">SubstanceNucleicAcid</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SubstancePolymer\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SubstancePolymer</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">SubstancePolymer</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SubstanceProtein\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SubstanceProtein</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">SubstanceProtein</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SubstanceReferenceInformation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SubstanceReferenceInformation</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">SubstanceReferenceInformation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SubstanceSourceMaterial\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SubstanceSourceMaterial</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">SubstanceSourceMaterial</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SubstanceSpecification\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SubstanceSpecification</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">SubstanceSpecification</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SupplyDelivery\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SupplyDelivery</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">SupplyDelivery</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Supply Livraison</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">供应交付</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Entrega de Suministro</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SupplyRequest\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SupplyRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">SupplyRequest</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">Demande d'approvisionnement</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">供应请求</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Solicitud de Suministro</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Task\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Task</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">Task</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">Tarea</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">任务</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"TerminologyCapabilities\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">TerminologyCapabilities</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">TerminologyCapabilities</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">CapacidadTerminologica</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">术语服务能力</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"TestReport\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">TestReport</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">TestReport</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">RapportTest</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ReporteDePrueba</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">测试报告</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"TestScript\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">TestScript</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">TestScript</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">ScriptTest</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ScriptDePrueba</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">测试脚本</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ValueSet\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ValueSet</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">ValueSet</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">EnsembleValeurs</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">取值集合</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">ConjuntoValores / ConjuntoDeValores</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"VerificationResult\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">VerificationResult</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">VerificationResult</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"VisionPrescription\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">VisionPrescription</xs:documentation>\r\n          <xs:documentation xml:lang=\"en\">VisionPrescription</xs:documentation>\r\n          <xs:documentation xml:lang=\"fr\">PrescriptionVision</xs:documentation>\r\n          <xs:documentation xml:lang=\"es\">PrescripcionDeVision</xs:documentation>\r\n          <xs:documentation xml:lang=\"zh\">视力处方</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ResourceType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of resource.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ResourceType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ExplanationOfBenefit\" type=\"ExplanationOfBenefit\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ExplanationOfBenefit\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this explanation of benefit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ExplanationOfBenefitStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The category of claim, e.g. oral, pharmacy, vision, institutional, professional.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A finer grained suite of claim type codes which may convey additional information such as Inpatient vs Outpatient and/or a specialty service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"use\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Use\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to indicate whether the nature of the request is: to request adjudication of products and services previously rendered; or requesting authorization and adjudication for provision in the future; or requesting the non-binding adjudication of the listed products and services which could be provided in the future.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party to whom the professional services and/or products have been supplied or are being considered and for whom actual for forecast reimbursement is sought.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"billablePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period for which charges are being submitted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date this resource was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"enterer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Individual who created the claim, predetermination or preauthorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurer\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party responsible for authorization, adjudication and reimbursement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provider\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The provider which is responsible for the claim, predetermination or preauthorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The provider-required urgency of processing the request. Typical values include: stat, routine deferred.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fundsReserveRequested\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to indicate whether and for whom funds are to be reserved for future claims.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fundsReserve\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code, used only on a response to a preauthorization, to indicate whether the benefits payable have been reserved and for whom.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"related\" type=\"ExplanationOfBenefit.Related\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Other claims which are related to this claim such as prior submissions or claims for related services or for the same event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"prescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Prescription to support the dispensing of pharmacy, device or vision products.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"originalPrescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Original prescription which has been superseded by this prescription to support the dispensing of pharmacy services, medications or products.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payee\" type=\"ExplanationOfBenefit.Payee\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party to be reimbursed for cost of the products and services according to the terms of the policy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referral\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a referral resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"facility\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Facility where the services were provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"claim\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The business identifier for the instance of the adjudication request: claim predetermination or preauthorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"claimResponse\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The business identifier for the instance of the adjudication response: claim, predetermination or preauthorization response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ClaimProcessingCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The outcome of the claim, predetermination, or preauthorization processing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"disposition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human readable description of the status of the adjudication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preAuthRef\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference from the Insurer which is used in later communications which refers to this adjudication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preAuthRefPeriod\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The timeframe during which the supplied preauthorization reference may be quoted on claims to obtain the adjudication as provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"careTeam\" type=\"ExplanationOfBenefit.CareTeam\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The members of the team who provided the products and services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInfo\" type=\"ExplanationOfBenefit.SupportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent issues.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"diagnosis\" type=\"ExplanationOfBenefit.Diagnosis\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about diagnoses relevant to the claim items.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"procedure\" type=\"ExplanationOfBenefit.Procedure\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Procedures performed on the patient relevant to the billing items with the claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"precedence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This indicates the relative order of a series of EOBs related to different coverages for the same suite of services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurance\" type=\"ExplanationOfBenefit.Insurance\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Financial instruments for reimbursement for the health care products and services specified on the claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"accident\" type=\"ExplanationOfBenefit.Accident\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details of a accident which resulted in injuries which required the products and services listed in the claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" type=\"ExplanationOfBenefit.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A claim line. Either a simple (a product or service) or a 'group' of details which can also be a simple items or groups of sub-details.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"addItem\" type=\"ExplanationOfBenefit.AddItem\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The first-tier service adjudications for payor added product or service lines.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The adjudication results which are presented at the header level rather than at the line-item or add-item levels.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"total\" type=\"ExplanationOfBenefit.Total\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Categorized monetary totals for the adjudication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payment\" type=\"ExplanationOfBenefit.Payment\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Payment details for the adjudication of the claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"formCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code for the form to be used for printing the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"form\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual form, by reference or inclusion, for printing the content or an EOB.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"processNote\" type=\"ExplanationOfBenefit.ProcessNote\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A note that describes or explains adjudication results in a human readable form.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"benefitPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The term of the benefits documented in this response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"benefitBalance\" type=\"ExplanationOfBenefit.BenefitBalance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Balance by Benefit Category.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Related\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"claim\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to a related claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to convey how the claims are related.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An alternate organizational reference to the case or file to which this particular claim pertains.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Payee\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of Party to be reimbursed: Subscriber, provider, other.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"party\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the individual or organization to whom any payment will be made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.CareTeam\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify care team entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provider\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Member of the team who provided the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"responsible\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party who is billing and/or responsible for the claimed products or services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The lead, assisting or supervising practitioner and their discipline if a multidisciplinary team.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"qualification\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The qualification of the practitioner which is applicable for this service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.SupportingInfo\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify supporting information entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The general class of the information supplied: information; exception; accident, employment; onset, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">System and code pertaining to the specific information regarding special conditions relating to the setting, treatment or patient  for which care is sought.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when or period to which this information refers.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"timingDate\" type=\"date\"/>\r\n            <xs:element name=\"timingPeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional data or information such as resources, documents, images etc. including references to the data or the actual inclusion of the data.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides the reason in the situation where a reason code is required in addition to the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Diagnosis\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify diagnosis entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The nature of illness or problem in a coded form or as a reference to an external defined Condition.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"diagnosisCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"diagnosisReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the condition was observed or the relative ranking.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"onAdmission\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indication of whether the diagnosis was present on admission to a facility.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"packageCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A package billing code or bundle code used to group products and services to a particular health condition (such as heart attack) which is based on a predetermined grouping code system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Procedure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify procedure entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the condition was observed or the relative ranking.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date and optionally time the procedure was performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code or reference to a Procedure resource which identifies the clinical intervention performed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"procedureCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"procedureReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Insurance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"focal\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A flag to indicate that this Coverage is to be used for adjudication of this claim when set to true.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"coverage\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the insurance card level information contained in the Coverage resource. The coverage issuing insurer will use these details to locate the patient's actual coverage within the insurer's information system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preAuthRef\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference numbers previously provided by the insurer to the provider to be quoted on subsequent claims containing services or products related to the prior authorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Accident\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date of an accident event  related to the products and services contained in the claim.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type or context of the accident event for the purposes of selection of potential insurance coverages and determination of coordination between insurers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The physical location of the accident event.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"locationAddress\" type=\"Address\"/>\r\n            <xs:element name=\"locationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Item\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify item entries.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"careTeamSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Care team members related to this service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"diagnosisSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Diagnoses applicable for this service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"procedureSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Procedures applicable for this service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"informationSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Exceptions, special conditions and supporting information applicable for this service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"revenue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of revenue or cost center providing the product and/or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date or dates when the service or product was supplied, performed or completed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"servicedDate\" type=\"date\"/>\r\n            <xs:element name=\"servicedPeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where the product or service was provided.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"locationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"locationAddress\" type=\"Address\"/>\r\n            <xs:element name=\"locationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Physical service site on the patient (limb, tooth, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subSite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A region or surface of the bodySite, e.g. limb region or tooth surface(s).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A billed item may include goods or services provided in multiple encounters.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If this item is a group then the values here are a summary of the adjudication of the detail items. If this item is a simple product or service then this is the result of the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" type=\"ExplanationOfBenefit.Detail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Second-tier of goods and services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Adjudication\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in-aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code supporting the understanding of the adjudication result and explaining variance from expected amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Monetary amount associated with the category.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A non-monetary value associated with the category. Mutually exclusive to the amount element above.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Detail\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"revenue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of revenue or cost center providing the product and/or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subDetail\" type=\"ExplanationOfBenefit.SubDetail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Third-tier of goods and services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.SubDetail\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"1\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A claim detail line. Either a simple (a product or service) or a 'group' of sub-details which are simple items.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"revenue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of revenue or cost center providing the product and/or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"udi\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique Device Identifiers associated with this line item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.AddItem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"itemSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Claim items which this service line is intended to replace.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detailSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The sequence number of the details within the claim item which this line is intended to replace.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subDetailSequence\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The sequence number of the sub-details woithin the details within the claim item which this line is intended to replace.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The providers who are authorized for the services rendered to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"programCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the program under which this may be recovered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date or dates when the service or product was supplied, performed or completed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"servicedDate\" type=\"date\"/>\r\n            <xs:element name=\"servicedPeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where the product or service was provided.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"locationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"locationAddress\" type=\"Address\"/>\r\n            <xs:element name=\"locationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Physical service site on the patient (limb, tooth, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subSite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A region or surface of the bodySite, e.g. limb region or tooth surface(s).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" type=\"ExplanationOfBenefit.Detail1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The second-tier service adjudications for payor added services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Detail1\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subDetail\" type=\"ExplanationOfBenefit.SubDetail1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The third-tier service adjudications for payor added services.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.SubDetail1\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"productOrService\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the value is a group code then this item collects a set of related claim details, otherwise this contains the product, service, drug or other billing code for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Item typification or modifiers codes to convey additional context for the product or service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of repetitions of a service or product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitPrice\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the item is not a group then this is the fee for the product or service, otherwise this is the total of the fees for the details of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"net\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity times the unit price for an additional service or product or charge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"noteNumber\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numbers associated with notes below which apply to the adjudication of this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjudication\" type=\"ExplanationOfBenefit.Adjudication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The adjudication results.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Total\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to indicate the information type of this adjudication record. Information types may include: the value submitted, maximum values or percentages allowed or payable under the plan, amounts that the patient is responsible for in aggregate or pertaining to this item, amounts paid by other coverages, and the benefit payable for this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Monetary total amount associated with the category.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Payment\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this represents partial or complete payment of the benefits payable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjustment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Total amount of all adjustments to this payment included in this transaction which are not related to this claim's adjudication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"adjustmentReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reason for the payment adjustment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Estimated date the payment will be issued or the actual issue date of payment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Benefits payable less any payment adjustment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Issuer's unique identifier for the payment instrument.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.ProcessNote\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"number\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number to uniquely identify a note entry.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"NoteType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The business purpose of the note text.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The explanation or description associated with the processing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to define the language used in the text of the note.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.BenefitBalance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code to identify the general type of benefits under which products and services are provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"excluded\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">True if the indicated class of service is excluded from the plan, missing or False indicates the product or service is included in the coverage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short name or tag for the benefit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A richer description of the benefit or services covered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Is a flag to indicate whether the benefits refer to in-network providers or out-of-network providers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates if the benefits apply to an individual or to the family.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"term\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual visits'.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"financial\" type=\"ExplanationOfBenefit.Financial\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Benefits Used to date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ExplanationOfBenefit.Financial\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Classification of benefit being provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity of the benefit which is permitted under the coverage.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"allowedUnsignedInt\" type=\"unsignedInt\"/>\r\n            <xs:element name=\"allowedString\" type=\"string\"/>\r\n            <xs:element name=\"allowedMoney\" type=\"Money\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity of the benefit which have been consumed to date.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"usedUnsignedInt\" type=\"unsignedInt\"/>\r\n            <xs:element name=\"usedMoney\" type=\"Money\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ExplanationOfBenefitStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"draft\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered In Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ExplanationOfBenefitStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A code specifying the state of the resource instance.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ExplanationOfBenefitStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"FamilyMemberHistory\" type=\"FamilyMemberHistory\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Significant health conditions for a person related to the patient relevant in the context of care for the patient.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"FamilyMemberHistory\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Significant health conditions for a person related to the patient relevant in the context of care for the patient.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this family member history by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this FamilyMemberHistory.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FamilyHistoryStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code specifying the status of the record of the family history of a specific family member.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dataAbsentReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes why the family member's history is not available.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person who this history concerns.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date (and possibly time) when the family member history was recorded or last updated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This will either be a name or a description; e.g. &quot;Aunt Susan&quot;, &quot;my cousin with the red hair&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relationship\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of relationship this person has to the patient (father, mother, brother etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sex\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The birth sex of the family member.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual or approximate date of birth of the relative.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"bornPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"bornDate\" type=\"date\"/>\r\n            <xs:element name=\"bornString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The age of the relative at the time the family member history is recorded.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"ageAge\" type=\"Age\"/>\r\n            <xs:element name=\"ageRange\" type=\"Range\"/>\r\n            <xs:element name=\"ageString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"estimatedAge\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If true, indicates that the age value specified is an estimated value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"deceasedBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"deceasedAge\" type=\"Age\"/>\r\n            <xs:element name=\"deceasedRange\" type=\"Range\"/>\r\n            <xs:element name=\"deceasedDate\" type=\"date\"/>\r\n            <xs:element name=\"deceasedString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes why the family member history occurred in coded or textual form.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates a Condition, Observation, AllergyIntolerance, or QuestionnaireResponse that justifies this family member history event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"condition\" type=\"FamilyMemberHistory.Condition\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"FamilyMemberHistory.Condition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Significant health conditions for a person related to the patient relevant in the context of care for the patient.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates what happened following the condition.  If the condition resulted in death, deceased date is captured on the relation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contributedToDeath\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This condition contributed to the cause of death of the related person. If contributedToDeath is not populated, then it is unknown.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Either the age of onset, range of approximate age or descriptive string can be recorded.  For conditions with multiple occurrences, this describes the first known occurrence.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"onsetAge\" type=\"Age\"/>\r\n            <xs:element name=\"onsetRange\" type=\"Range\"/>\r\n            <xs:element name=\"onsetPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"onsetString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An area where general notes can be placed about this specific condition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"FamilyHistoryStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"partial\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Partial</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"health-unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Health Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"FamilyHistoryStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A code that identifies the status of the family history record.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"FamilyHistoryStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Flag\" type=\"Flag\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Prospective warnings of potential issues when providing care to the patient.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Flag\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Prospective warnings of potential issues when providing care to the patient.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this flag by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FlagStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Supports basic workflow.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Allows a flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The coded value or textual component of the flag to display to the user.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient, location, group, organization, or practitioner etc. this is about record this flag is associated with.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This alert is only relevant during the encounter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person, organization or device that created the flag.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"FlagStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"inactive\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"FlagStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates whether this flag is active and needs to be displayed to a user, or whether it is no longer needed or was entered in error.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"FlagStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Goal\" type=\"Goal\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Goal\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this goal by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lifecycleStatus\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GoalLifecycleStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The state of the goal throughout its lifecycle.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"achievementStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the progression, or lack thereof, towards the goal against the target.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates a category the goal falls within.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-readable and/or coded description of a specific desired objective of care, such as &quot;control blood pressure&quot; or &quot;negotiate an obstacle course&quot; or &quot;dance with child at wedding&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the patient, group or organization for whom the goal is being established.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date or event after which the goal should begin being pursued.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"startDate\" type=\"date\"/>\r\n            <xs:element name=\"startCodeableConcept\" type=\"CodeableConcept\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"target\" type=\"Goal.Target\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates what should be done by when.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current status.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expressedBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whose goal this is - patient goal, practitioner goal, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"addresses\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identified conditions and other health record elements that are intended to be addressed by the goal.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Any comments related to the goal.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcomeCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the change (or lack of change) at the point when the status of the goal is assessed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcomeReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details of what's changed (or not changed).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Goal.Target\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"measure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"detailQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"detailRange\" type=\"Range\"/>\r\n            <xs:element name=\"detailCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"detailString\" type=\"string\"/>\r\n            <xs:element name=\"detailBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"detailInteger\" type=\"integer\"/>\r\n            <xs:element name=\"detailRatio\" type=\"Ratio\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates either the date or the duration after start by which the goal should be met.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"dueDate\" type=\"date\"/>\r\n            <xs:element name=\"dueDuration\" type=\"Duration\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"GoalLifecycleStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"proposed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Proposed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"planned\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Planned</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"accepted\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Accepted</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-hold\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"rejected\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Rejected</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"GoalLifecycleStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Codes that reflect the current state of a goal and whether the goal is still being targeted.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"GoalLifecycleStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"GraphDefinition\" type=\"GraphDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"GraphDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this graph definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this graph definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the graph definition is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the graph definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the graph definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the graph definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this graph definition. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this graph definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the graph definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the graph definition changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the graph definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the graph definition from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate graph definition instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the graph definition is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this graph definition is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"start\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of FHIR resource at which instances of this graph start.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The profile that describes the use of the base resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"link\" type=\"GraphDefinition.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Links this graph makes rules about.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"GraphDefinition.Link\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"path\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A FHIR expression that identifies one of FHIR References to other resources.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sliceName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Which slice (if profiled).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"min\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Minimum occurrences for this link.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"max\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Maximum occurrences for this link.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about why this link is of interest in this graph definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"target\" type=\"GraphDefinition.Target\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Potential target for the link.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"GraphDefinition.Target\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of resource this link refers to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"params\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A set of parameters to look up.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Profile for the target resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"compartment\" type=\"GraphDefinition.Compartment\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Compartment Consistency Rules.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"link\" type=\"GraphDefinition.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional links from target resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"GraphDefinition.Compartment\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"use\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GraphCompartmentUse\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines how the compartment rule is used - whether it it is used to test whether resources are subject to the rule, or whether it is a rule that must be followed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CompartmentType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the compartment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rule\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GraphCompartmentRule\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">identical | matching | different | no-rule | custom.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Custom rule, as a FHIRPath expression.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Documentation for FHIRPath expression.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"GraphCompartmentUse-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"condition\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Condition</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"requirement\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Requirement</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"GraphCompartmentUse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines how a compartment rule is used.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"GraphCompartmentUse-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"GraphCompartmentRule-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"identical\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Identical</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"matching\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Matching</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"different\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Different</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"custom\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Custom</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"GraphCompartmentRule\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How a compartment must be linked.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"GraphCompartmentRule-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Group\" type=\"Group\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Group\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique business identifier for this group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether the record for the group is available for use or is merely being retained for historical purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GroupType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the broad classification of the kind of resources the group includes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actual\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides a specific type of resource the group includes; e.g. &quot;cow&quot;, &quot;syringe&quot;, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A label assigned to the group for human identification and communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A count of the number of resource instances that are part of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"managingEntity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Entity responsible for defining and maintaining Group characteristics and/or registered members.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"characteristic\" type=\"Group.Characteristic\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies traits whose presence r absence is shared by members of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"member\" type=\"Group.Member\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the resource instances that are members of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Group.Characteristic\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that identifies the kind of trait being asserted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the trait that holds (or does not hold - see 'exclude') for members of the group.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueRange\" type=\"Range\"/>\r\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"exclude\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If true, indicates the characteristic is one that is NOT held by members of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Group.Member\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"entity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period that the member was in the group, if known.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"inactive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A flag to indicate that the member is no longer in the group, but previously may have been a member.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"GroupType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"person\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Person</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"animal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Animal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"practitioner\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Practitioner</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"device\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Device</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"medication\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Medication</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"substance\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Substance</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"GroupType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Types of resources that are part of group.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"GroupType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"GuidanceResponse\" type=\"GuidanceResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"GuidanceResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"requestIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier of the request associated with this response. If an identifier was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Allows a service to provide  unique, business identifiers for the response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier, CodeableConcept or canonical reference to the guidance that was requested.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"moduleUri\" type=\"uri\"/>\r\n            <xs:element name=\"moduleCanonical\" type=\"canonical\"/>\r\n            <xs:element name=\"moduleCodeableConcept\" type=\"CodeableConcept\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GuidanceResponseStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient for which the request was processed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The encounter during which this response was created or to which the creation of this record is tightly associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"occurrenceDateTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates when the guidance response was processed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides a reference to the device that performed the guidance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the reason for the guidance response in coded or textual form.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the reason the request was initiated. This is typically provided as a parameter to the evaluation and echoed by the service, although for some use cases, such as subscription- or event-based scenarios, it may provide an indication of the cause for the response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides a mechanism to communicate additional information about the response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"evaluationMessage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outputParameters\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"result\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actions, if any, produced by the evaluation of the artifact.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dataRequirement\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DataRequirement\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"GuidanceResponseStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"success\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Success</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"data-requested\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Data Requested</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"data-required\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Data Required</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"in-progress\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"failure\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Failure</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered In Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"GuidanceResponseStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The status of a guidance response.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"GuidanceResponseStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"HealthcareService\" type=\"HealthcareService\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The details of a healthcare service available at a location.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"HealthcareService\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The details of a healthcare service available at a location.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">External identifiers for this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This flag is used to mark the record to not be used. This is not used when a center is closed for maintenance, or for holidays, the notAvailable period is to be used for this.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"providedBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization that provides this healthcare service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the broad category of service being performed or delivered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific type of service that may be delivered or performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Collection of specialties handled by the service site. This is more of a medical term.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The location(s) where this healthcare service may be provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Further description of the service as it would be presented to a consumer while searching.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"extraDetails\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Extra details about the service that can't be placed in the other fields.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"photo\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">List of contacts related to this specific healthcare service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"coverageArea\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The location(s) that this service is available to (not where the service is provided).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"serviceProvisionCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code(s) that detail the conditions under which the healthcare service is available/offered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"eligibility\" type=\"HealthcareService.Eligibility\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Does this service have specific eligibility requirements that need to be met in order to use the service?</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"program\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Programs that this service is applicable to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"characteristic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Collection of characteristics (attributes).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"communication\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Some services are specifically made available in multiple languages, this property permits a directory to declare the languages this is offered in. Typically this is only provided where a service operates in communities with mixed languages used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referralMethod\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"appointmentRequired\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"availableTime\" type=\"HealthcareService.AvailableTime\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A collection of times that the Service Site is available.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"notAvailable\" type=\"HealthcareService.NotAvailable\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The HealthcareService is not available during this period of time due to the provided reason.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"availabilityExceptions\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Technical endpoints providing access to services operated for the specific healthcare services defined at this resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"HealthcareService.Eligibility\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The details of a healthcare service available at a location.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Coded value for the eligibility.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the eligibility conditions for the service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"HealthcareService.AvailableTime\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The details of a healthcare service available at a location.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"daysOfWeek\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DaysOfWeek\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates which days of the week are available between the start and end Times.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"allDay\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Is this always available? (hence times are irrelevant) e.g. 24 hour service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"availableStartTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"time\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The opening time of day. Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"availableEndTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"time\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The closing time of day. Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"HealthcareService.NotAvailable\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The details of a healthcare service available at a location.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reason that can be presented to the user as to why this time is not available.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"during\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Service is not available (seasonally or for a public holiday) from this date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"DaysOfWeek-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"mon\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Monday</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"tue\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Tuesday</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"wed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Wednesday</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"thu\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Thursday</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"fri\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Friday</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"sat\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Saturday</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"sun\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Sunday</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"DaysOfWeek\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The days of the week.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"DaysOfWeek-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ImagingStudy\" type=\"ImagingStudy\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ImagingStudy\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers for the ImagingStudy such as DICOM Study Instance UID, and Accession Number.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ImagingStudyStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The current state of the ImagingStudy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modality\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of all the series.modality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The subject, typically a patient, of the imaging study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The healthcare event (e.g. a patient and healthcare provider interaction) during which this ImagingStudy is made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"started\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date and time the study started.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of the diagnostic requests that resulted in this imaging study being performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referrer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The requesting/referring physician.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"interpreter\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who read the study and interpreted the images or other content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The network service providing access (e.g., query, view, or retrieval) for the study. See implementation notes for information about using DICOM endpoints. A study-level endpoint applies to each series in the study, unless overridden by a series-level endpoint with the same Endpoint.connectionType.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numberOfSeries\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number of Series in the Study. This value given may be larger than the number of series elements this Resource contains due to resource availability, security, or other factors. This element should be present if any series elements are present.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numberOfInstances\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number of SOP Instances in Study. This value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"procedureReference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The procedure which this ImagingStudy was part of.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"procedureCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code for the performed procedure type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The principal physical location where the ImagingStudy was performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of clinical condition indicating why the ImagingStudy was requested.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates another resource whose existence justifies this Study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Per the recommended DICOM mapping, this element is derived from the Study Description attribute (0008,1030). Observations or findings about the imaging study should be recorded in another resource, e.g. Observation, and not in this element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Imaging Manager description of the study. Institution-generated description or classification of the Study (component) performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"series\" type=\"ImagingStudy.Series\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Each study has one or more series of images or other content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImagingStudy.Series\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"uid\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The DICOM Series Instance UID for the series.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"number\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The numeric identifier of this series in the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modality\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The modality of this series sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the series.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numberOfInstances\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number of SOP Instances in the Study. The value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The network service providing access (e.g., query, view, or retrieval) for this series. See implementation notes for information about using DICOM endpoints. A series-level endpoint, if present, has precedence over a study-level endpoint with the same Endpoint.connectionType.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The anatomic structures examined. See DICOM Part 16 Annex L (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html) for DICOM to SNOMED-CT mappings. The bodySite may indicate the laterality of body part imaged; if so, it shall be consistent with any content of ImagingStudy.series.laterality.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"laterality\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The laterality of the (possibly paired) anatomic structures examined. E.g., the left knee, both lungs, or unpaired abdomen. If present, shall be consistent with any laterality information indicated in ImagingStudy.series.bodySite.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specimen\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specimen imaged, e.g., for whole slide imaging of a biopsy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"started\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date and time the series was started.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" type=\"ImagingStudy.Performer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed the series and how they were involved.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instance\" type=\"ImagingStudy.Instance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A single SOP instance within the series, e.g. an image, or presentation state.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImagingStudy.Performer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"function\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Distinguishes the type of involvement of the performer in the series.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed the series.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImagingStudy.Instance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"uid\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The DICOM SOP Instance UID for this image or other DICOM content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sopClass\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">DICOM instance  type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"number\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of instance in the series.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The description of the instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ImagingStudyStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"registered\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Registered</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"available\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Available</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ImagingStudyStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The status of the ImagingStudy.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ImagingStudyStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Immunization\" type=\"Immunization\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Immunization\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this immunization record.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ImmunizationStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the current status of the immunization event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the reason the immunization event was not performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"vaccineCode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Vaccine that was administered or was to be administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient who either received or did not receive the immunization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The visit or admission or other contact between patient and health care provider the immunization was performed as part of.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date vaccine administered or was to be administered.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"occurrenceString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"recorded\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"primarySource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reportOrigin\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The service delivery location where the vaccine administration occurred.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name of vaccine manufacturer.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lotNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Lot number of the  vaccine product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expirationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date vaccine batch expires.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"site\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Body site where vaccine was administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"route\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The path by which the vaccine product is taken into the body.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"doseQuantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity of vaccine product that was administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" type=\"Immunization.Performer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who performed the immunization event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Extra information about the immunization that is not conveyed by the other attributes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reasons why the vaccine was administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Condition, Observation or DiagnosticReport that supports why the immunization was administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"isSubpotent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subpotentReason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reason why a dose is considered to be subpotent.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"education\" type=\"Immunization.Education\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Educational material presented to the patient (or guardian) at the time of vaccine administration.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"programEligibility\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates a patient's eligibility for a funding program.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fundingSource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the source of the vaccine actually administered. This may be different than the patient eligibility (e.g. the patient may be eligible for a publically purchased vaccine but due to inventory issues, vaccine purchased with private funds was actually administered).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reaction\" type=\"Immunization.Reaction\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Categorical data indicating that an adverse event is associated in time to an immunization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"protocolApplied\" type=\"Immunization.ProtocolApplied\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The protocol (set of recommendations) being followed by the provider who administered the dose.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Immunization.Performer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"function\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the type of performance (e.g. ordering provider, administering provider, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The practitioner or organization who performed the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Immunization.Education\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"documentType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier of the material presented to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference pointer to the educational material given to the patient if the information was on line.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publicationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date the educational material was published.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"presentationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date the educational material was given to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Immunization.Reaction\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date of reaction to the immunization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details of the reaction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reported\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Self-reported indicator.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Immunization.ProtocolApplied\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"series\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">One possible path to achieve presumed immunity against a disease - within the context of an authority.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the authority who published the protocol (e.g. ACIP) that is being followed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"targetDisease\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The vaccine preventable disease the dose is being administered against.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Nominal position in a series.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"doseNumberPositiveInt\" type=\"positiveInt\"/>\r\n            <xs:element name=\"doseNumberString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The recommended number of doses to achieve immunity.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"seriesDosesPositiveInt\" type=\"positiveInt\"/>\r\n            <xs:element name=\"seriesDosesString\" type=\"string\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ImmunizationStatusCodes-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"not-done\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not Done</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ImmunizationStatusCodes\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of codes indicating the current status of an Immunization.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ImmunizationStatusCodes-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ImmunizationEvaluation\" type=\"ImmunizationEvaluation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes a comparison of an immunization event against published recommendations to determine if the administration is &quot;valid&quot; in relation to those  recommendations.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ImmunizationEvaluation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes a comparison of an immunization event against published recommendations to determine if the administration is &quot;valid&quot; in relation to those  recommendations.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this immunization evaluation record.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ImmunizationEvaluationStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the current status of the evaluation of the vaccination administration event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual for whom the evaluation is being done.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date the evaluation of the vaccine administration event was performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the authority who published the protocol (e.g. ACIP).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"targetDisease\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The vaccine preventable disease the dose is being evaluated against.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"immunizationEvent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The vaccine administration event being evaluated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"doseStatus\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates if the dose is valid or not valid with respect to the published recommendations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"doseStatusReason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides an explanation as to why the vaccine administration event is valid or not relative to the published recommendations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information about the evaluation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"series\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">One possible path to achieve presumed immunity against a disease - within the context of an authority.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Nominal position in a series.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"doseNumberPositiveInt\" type=\"positiveInt\"/>\r\n            <xs:element name=\"doseNumberString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The recommended number of doses to achieve immunity.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"seriesDosesPositiveInt\" type=\"positiveInt\"/>\r\n            <xs:element name=\"seriesDosesString\" type=\"string\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ImmunizationEvaluationStatusCodes-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ImmunizationEvaluationStatusCodes\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The status of the evaluation being done.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ImmunizationEvaluationStatusCodes-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ImmunizationRecommendation\" type=\"ImmunizationRecommendation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ImmunizationRecommendation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this particular recommendation record.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient the recommendation(s) are for.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date the immunization recommendation(s) were created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the authority who published the protocol (e.g. ACIP).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recommendation\" type=\"ImmunizationRecommendation.Recommendation\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Vaccine administration recommendations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImmunizationRecommendation.Recommendation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"vaccineCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Vaccine(s) or vaccine group that pertain to the recommendation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"targetDisease\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The targeted disease for the recommendation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contraindicatedVaccineCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Vaccine(s) which should not be used to fulfill the recommendation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"forecastStatus\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the patient status with respect to the path to immunity for the target disease.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"forecastReason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reason for the assigned forecast status.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dateCriterion\" type=\"ImmunizationRecommendation.DateCriterion\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Vaccine date recommendations.  For example, earliest date to administer, latest date to administer, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contains the description about the protocol under which the vaccine was administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"series\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">One possible path to achieve presumed immunity against a disease - within the context of an authority.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose).</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"doseNumberPositiveInt\" type=\"positiveInt\"/>\r\n            <xs:element name=\"doseNumberString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The recommended number of doses to achieve immunity.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"seriesDosesPositiveInt\" type=\"positiveInt\"/>\r\n            <xs:element name=\"seriesDosesString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"supportingImmunization\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Immunization event history and/or evaluation that supports the status and recommendation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingPatientInformation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Patient Information that supports the status and recommendation.  This includes patient observations, adverse reactions and allergy/intolerance information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImmunizationRecommendation.DateCriterion\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date classification of recommendation.  For example, earliest date to give, latest date to give, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date whose meaning is specified by dateCriterion.code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ImplementationGuide\" type=\"ImplementationGuide\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ImplementationGuide\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this implementation guide is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the implementation guide is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the implementation guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the implementation guide author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the implementation guide. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the implementation guide.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this implementation guide. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this implementation guide is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the implementation guide was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the implementation guide.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the implementation guide from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate implementation guide instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the implementation guide is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"packageId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The NPM package name for this Implementation Guide, used in the NPM package distribution, which is the primary mechanism by which FHIR based tooling manages IG dependencies. This value must be globally unique, and should be assigned with care.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"license\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SPDXLicense\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The license that applies to this Implementation Guide, using an SPDX license code, or 'not-open-source'.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fhirVersion\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"FHIRVersion\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version(s) of the FHIR specification that this ImplementationGuide targets - e.g. describes how to use. The value of this element is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 4.0.1. for this version.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dependsOn\" type=\"ImplementationGuide.DependsOn\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"global\" type=\"ImplementationGuide.Global\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A set of profiles that all resources covered by this implementation guide must conform to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definition\" type=\"ImplementationGuide.Definition\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The information needed by an IG publisher tool to publish the whole implementation guide.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manifest\" type=\"ImplementationGuide.Manifest\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about an assembled implementation guide, created by the publication tooling.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImplementationGuide.DependsOn\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"uri\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A canonical reference to the Implementation guide for the dependency.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"packageId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The NPM package name for the Implementation Guide that this IG depends on.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version of the IG that is depended on, when the correct version is required to understand the IG correctly.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImplementationGuide.Global\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of resource that all instances must conform to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the profile that all instances must conform to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImplementationGuide.Definition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"grouping\" type=\"ImplementationGuide.Grouping\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A logical group of resources. Logical groups can be used when building pages.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resource\" type=\"ImplementationGuide.Resource\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"page\" type=\"ImplementationGuide.Page\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A page / section in the implementation guide. The root page is the implementation guide home page.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parameter\" type=\"ImplementationGuide.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines how IG is built by tools.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"template\" type=\"ImplementationGuide.Template\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A template for building resources.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImplementationGuide.Grouping\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The human-readable title to display for the package of resources when rendering the implementation guide.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human readable text describing the package.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImplementationGuide.Resource\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where this resource is found.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fhirVersion\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"FHIRVersion\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the FHIR Version(s) this artifact is intended to apply to. If no versions are specified, the resource is assumed to apply to all the versions stated in ImplementationGuide.fhirVersion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the reason that a resource has been included in the implementation guide.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If true or a reference, indicates the resource is an example instance.  If a reference is present, indicates that the example is an example of the specified profile.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"exampleBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"exampleCanonical\" type=\"canonical\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"groupingId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the id of the grouping this resource appears in.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImplementationGuide.Page\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The source address for the page.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"nameUrl\" type=\"url\"/>\r\n            <xs:element name=\"nameReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"title\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"generation\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GuidePageGeneration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that indicates how the page is generated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"page\" type=\"ImplementationGuide.Page\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Nested Pages/Sections under this page.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImplementationGuide.Parameter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GuideParameterCode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">apply | path-resource | path-pages | path-tx-cache | expansion-parameter | rule-broken-links | generate-xml | generate-json | generate-turtle | html-template.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Value for named type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImplementationGuide.Template\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of template specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The source location for the template.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"scope\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The scope in which the template applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImplementationGuide.Manifest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"rendering\" minOccurs=\"0\" maxOccurs=\"1\" type=\"url\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A pointer to official web page, PDF or other rendering of the implementation guide.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resource\" type=\"ImplementationGuide.Resource1\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"page\" type=\"ImplementationGuide.Page1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about a page within the IG.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"image\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates a relative path to an image that exists within the IG.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"other\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the relative path of an additional non-page, non-image file that is part of the IG - e.g. zip, jar and similar files that could be the target of a hyperlink in a derived IG.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImplementationGuide.Resource1\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where this resource is found.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If true or a reference, indicates the resource is an example instance.  If a reference is present, indicates that the example is an example of the specified profile.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"exampleBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"exampleCanonical\" type=\"canonical\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"relativePath\" minOccurs=\"0\" maxOccurs=\"1\" type=\"url\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The relative path for primary page for this resource within the IG.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ImplementationGuide.Page1\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Relative path to the page.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Label for the page intended for human display.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"anchor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of an anchor available on the page.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"GuideParameterCode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"apply\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Apply Metadata Value</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"path-resource\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Resource Path</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"path-pages\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Pages Path</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"path-tx-cache\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Terminology Cache Path</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"expansion-parameter\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Expansion Profile</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"rule-broken-links\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Broken Links Rule</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"generate-xml\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Generate XML</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"generate-json\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Generate JSON</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"generate-turtle\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Generate Turtle</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"html-template\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">HTML Template</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"GuideParameterCode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Code of parameter that is input to the guide.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"GuideParameterCode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SPDXLicense-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"not-open-source\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not open source</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"0BSD\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD Zero Clause License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AAL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Attribution Assurance License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Abstyles\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Abstyles License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Adobe-2006\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Adobe Systems Incorporated Source Code License Agreement</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Adobe-Glyph\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Adobe Glyph List License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ADSL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Amazon Digital Services License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AFL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Academic Free License v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AFL-1.2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Academic Free License v1.2</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AFL-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Academic Free License v2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AFL-2.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Academic Free License v2.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AFL-3.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Academic Free License v3.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Afmparse\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Afmparse License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AGPL-1.0-only\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Affero General Public License v1.0 only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AGPL-1.0-or-later\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Affero General Public License v1.0 or later</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AGPL-3.0-only\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Affero General Public License v3.0 only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AGPL-3.0-or-later\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Affero General Public License v3.0 or later</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Aladdin\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Aladdin Free Public License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AMDPLPA\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">AMD's plpa_map.c License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AML\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Apple MIT License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"AMPAS\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Academy of Motion Picture Arts and Sciences BSD</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ANTLR-PD\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ANTLR Software Rights Notice</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Apache-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Apache License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Apache-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Apache License 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Apache-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Apache License 2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"APAFML\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Adobe Postscript AFM License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"APL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Adaptive Public License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"APSL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Apple Public Source License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"APSL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Apple Public Source License 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"APSL-1.2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Apple Public Source License 1.2</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"APSL-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Apple Public Source License 2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Artistic-1.0-cl8\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Artistic License 1.0 w/clause 8</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Artistic-1.0-Perl\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Artistic License 1.0 (Perl)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Artistic-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Artistic License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Artistic-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Artistic License 2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Bahyph\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Bahyph License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Barr\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Barr License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Beerware\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Beerware License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BitTorrent-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BitTorrent Open Source License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BitTorrent-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BitTorrent Open Source License v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Borceux\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Borceux license</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-1-Clause\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD 1-Clause License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-2-Clause-FreeBSD\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD 2-Clause FreeBSD License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-2-Clause-NetBSD\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD 2-Clause NetBSD License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-2-Clause-Patent\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD-2-Clause Plus Patent License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-2-Clause\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD 2-Clause &quot;Simplified&quot; License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-3-Clause-Attribution\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD with attribution</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-3-Clause-Clear\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD 3-Clause Clear License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-3-Clause-LBNL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Lawrence Berkeley National Labs BSD variant license</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-3-Clause-No-Nuclear-License-2014\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD 3-Clause No Nuclear License 2014</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-3-Clause-No-Nuclear-License\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD 3-Clause No Nuclear License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-3-Clause-No-Nuclear-Warranty\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD 3-Clause No Nuclear Warranty</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-3-Clause\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD 3-Clause &quot;New&quot; or &quot;Revised&quot; License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-4-Clause-UC\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD-4-Clause (University of California-Specific)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-4-Clause\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD 4-Clause &quot;Original&quot; or &quot;Old&quot; License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-Protection\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD Protection License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSD-Source-Code\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">BSD Source Code Attribution</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"BSL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Boost Software License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"bzip2-1.0.5\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">bzip2 and libbzip2 License v1.0.5</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"bzip2-1.0.6\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">bzip2 and libbzip2 License v1.0.6</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Caldera\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Caldera License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CATOSL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Computer Associates Trusted Open Source License 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution 1.0 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution 2.0 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-2.5\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution 2.5 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-3.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution 3.0 Unported</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-4.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution 4.0 International</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial 1.0 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial 2.0 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-2.5\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial 2.5 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-3.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial 3.0 Unported</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-4.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial 4.0 International</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-ND-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-ND-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-ND-2.5\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-ND-3.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-ND-4.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial No Derivatives 4.0 International</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-SA-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial Share Alike 1.0 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-SA-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial Share Alike 2.0 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-SA-2.5\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial Share Alike 2.5 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-SA-3.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial Share Alike 3.0 Unported</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-NC-SA-4.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial Share Alike 4.0 International</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-ND-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution No Derivatives 1.0 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-ND-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution No Derivatives 2.0 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-ND-2.5\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution No Derivatives 2.5 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-ND-3.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution No Derivatives 3.0 Unported</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-ND-4.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution No Derivatives 4.0 International</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-SA-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Share Alike 1.0 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-SA-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Share Alike 2.0 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-SA-2.5\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Share Alike 2.5 Generic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-SA-3.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Share Alike 3.0 Unported</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC-BY-SA-4.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Share Alike 4.0 International</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CC0-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Creative Commons Zero v1.0 Universal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CDDL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Common Development and Distribution License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CDDL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Common Development and Distribution License 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CDLA-Permissive-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Community Data License Agreement Permissive 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CDLA-Sharing-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Community Data License Agreement Sharing 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CECILL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CeCILL Free Software License Agreement v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CECILL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CeCILL Free Software License Agreement v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CECILL-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CeCILL Free Software License Agreement v2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CECILL-2.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CeCILL Free Software License Agreement v2.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CECILL-B\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CeCILL-B Free Software License Agreement</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CECILL-C\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CeCILL-C Free Software License Agreement</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ClArtistic\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Clarified Artistic License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CNRI-Jython\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CNRI Jython License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CNRI-Python-GPL-Compatible\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CNRI Python Open Source GPL Compatible License Agreement</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CNRI-Python\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CNRI Python License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Condor-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Condor Public License v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CPAL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Common Public Attribution License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Common Public License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CPOL-1.02\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Code Project Open License 1.02</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Crossword\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Crossword License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CrystalStacker\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CrystalStacker License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CUA-OPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CUA Office Public License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Cube\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cube License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"curl\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">curl License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"D-FSL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Deutsche Freie Software Lizenz</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"diffmark\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">diffmark license</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DOC\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DOC License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Dotseqn\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Dotseqn License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"DSDP\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DSDP License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"dvipdfm\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">dvipdfm License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ECL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Educational Community License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ECL-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Educational Community License v2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EFL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Eiffel Forum License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EFL-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Eiffel Forum License v2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"eGenix\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">eGenix.com Public License 1.1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Entessa\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entessa Public License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Eclipse Public License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EPL-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Eclipse Public License 2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ErlPL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Erlang Public License v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EUDatagrid\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">EU DataGrid Software License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EUPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">European Union Public License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EUPL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">European Union Public License 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"EUPL-1.2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">European Union Public License 1.2</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Eurosym\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Eurosym License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Fair\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Fair License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Frameworx-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Frameworx Open License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"FreeImage\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">FreeImage Public License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"FSFAP\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">FSF All Permissive License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"FSFUL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">FSF Unlimited License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"FSFULLR\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">FSF Unlimited License (with License Retention)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"FTL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Freetype Project License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GFDL-1.1-only\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Free Documentation License v1.1 only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GFDL-1.1-or-later\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Free Documentation License v1.1 or later</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GFDL-1.2-only\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Free Documentation License v1.2 only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GFDL-1.2-or-later\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Free Documentation License v1.2 or later</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GFDL-1.3-only\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Free Documentation License v1.3 only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GFDL-1.3-or-later\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Free Documentation License v1.3 or later</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Giftware\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Giftware License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GL2PS\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GL2PS License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Glide\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">3dfx Glide License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Glulxe\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Glulxe License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"gnuplot\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">gnuplot License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GPL-1.0-only\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU General Public License v1.0 only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GPL-1.0-or-later\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU General Public License v1.0 or later</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GPL-2.0-only\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU General Public License v2.0 only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GPL-2.0-or-later\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU General Public License v2.0 or later</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GPL-3.0-only\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU General Public License v3.0 only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"GPL-3.0-or-later\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU General Public License v3.0 or later</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"gSOAP-1.3b\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">gSOAP Public License v1.3b</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"HaskellReport\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Haskell Language Report License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"HPND\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Historical Permission Notice and Disclaimer</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"IBM-pibs\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">IBM PowerPC Initialization and Boot Software</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ICU\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ICU License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"IJG\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Independent JPEG Group License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ImageMagick\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ImageMagick License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"iMatix\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">iMatix Standard Function Library Agreement</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Imlib2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Imlib2 License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Info-ZIP\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Info-ZIP License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Intel-ACPI\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Intel ACPI Software License Agreement</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Intel\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Intel Open Source License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Interbase-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Interbase Public License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"IPA\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">IPA Font License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"IPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">IBM Public License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ISC\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ISC License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"JasPer-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">JasPer License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"JSON\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">JSON License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LAL-1.2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Licence Art Libre 1.2</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LAL-1.3\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Licence Art Libre 1.3</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Latex2e\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Latex2e License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Leptonica\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Leptonica License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LGPL-2.0-only\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Library General Public License v2 only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LGPL-2.0-or-later\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Library General Public License v2 or later</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LGPL-2.1-only\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Lesser General Public License v2.1 only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LGPL-2.1-or-later\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Lesser General Public License v2.1 or later</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LGPL-3.0-only\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Lesser General Public License v3.0 only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LGPL-3.0-or-later\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GNU Lesser General Public License v3.0 or later</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LGPLLR\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Lesser General Public License For Linguistic Resources</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Libpng\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">libpng License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"libtiff\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">libtiff License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LiLiQ-P-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Licence Libre du Québec – Permissive version 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LiLiQ-R-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Licence Libre du Québec – Réciprocité version 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LiLiQ-Rplus-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Licence Libre du Québec – Réciprocité forte version 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Linux-OpenIB\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Linux Kernel Variant of OpenIB.org license</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Lucent Public License Version 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LPL-1.02\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Lucent Public License v1.02</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LPPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">LaTeX Project Public License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LPPL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">LaTeX Project Public License v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LPPL-1.2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">LaTeX Project Public License v1.2</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LPPL-1.3a\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">LaTeX Project Public License v1.3a</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"LPPL-1.3c\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">LaTeX Project Public License v1.3c</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MakeIndex\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MakeIndex License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MirOS\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MirOS License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MIT-0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MIT No Attribution</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MIT-advertising\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Enlightenment License (e16)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MIT-CMU\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CMU License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MIT-enna\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">enna License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MIT-feh\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">feh License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MIT\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MIT License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MITNFA\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">MIT +no-false-attribs license</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Motosoto\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Motosoto License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"mpich2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">mpich2 License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Mozilla Public License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MPL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Mozilla Public License 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MPL-2.0-no-copyleft-exception\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Mozilla Public License 2.0 (no copyleft exception)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MPL-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Mozilla Public License 2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MS-PL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Microsoft Public License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MS-RL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Microsoft Reciprocal License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"MTLL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Matrix Template Library License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Multics\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Multics License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Mup\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Mup License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NASA-1.3\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">NASA Open Source Agreement 1.3</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Naumen\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Naumen Public License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NBPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Net Boolean Public License v1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NCSA\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">University of Illinois/NCSA Open Source License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Net-SNMP\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Net-SNMP License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NetCDF\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">NetCDF license</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Newsletr\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Newsletr License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NGPL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Nethack General Public License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NLOD-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Norwegian Licence for Open Government Data</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NLPL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">No Limit Public License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Nokia\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Nokia Open Source License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NOSL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Netizen Open Source License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Noweb\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Noweb License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Netscape Public License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NPL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Netscape Public License v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NPOSL-3.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Non-Profit Open Software License 3.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NRL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">NRL License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"NTP\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">NTP License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OCCT-PL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open CASCADE Technology Public License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OCLC-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">OCLC Research Public License 2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ODbL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ODC Open Database License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OFL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SIL Open Font License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OFL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SIL Open Font License 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OGTSL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open Group Test Suite License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-1.2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v1.2</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-1.3\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v1.3</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-1.4\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v1.4</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-2.0.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.0.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-2.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-2.2.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.2.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-2.2.2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License 2.2.2</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-2.2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.2</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-2.3\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.3</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-2.4\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.4</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-2.5\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.5</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-2.6\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.6</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-2.7\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.7</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OLDAP-2.8\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.8</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OML\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open Market License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OpenSSL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">OpenSSL License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open Public License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OSET-PL-2.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">OSET Public License version 2.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OSL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open Software License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OSL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open Software License 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OSL-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open Software License 2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OSL-2.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open Software License 2.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"OSL-3.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open Software License 3.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PDDL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">ODC Public Domain Dedication &amp; License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PHP-3.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PHP License v3.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PHP-3.01\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PHP License v3.01</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Plexus\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Plexus Classworlds License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"PostgreSQL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PostgreSQL License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"psfrag\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">psfrag License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"psutils\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">psutils License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Python-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Python License 2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Qhull\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Qhull License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"QPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Q Public License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Rdisc\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Rdisc License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"RHeCos-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Red Hat eCos Public License v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"RPL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Reciprocal Public License 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"RPL-1.5\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Reciprocal Public License 1.5</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"RPSL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">RealNetworks Public Source License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"RSA-MD\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">RSA Message-Digest License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"RSCPL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Ricoh Source Code Public License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Ruby\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Ruby License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SAX-PD\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Sax Public Domain Notice</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Saxpath\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Saxpath License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SCEA\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SCEA Shared Source License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Sendmail\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Sendmail License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SGI-B-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SGI Free Software License B v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SGI-B-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SGI Free Software License B v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SGI-B-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SGI Free Software License B v2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SimPL-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Simple Public License 2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SISSL-1.2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Sun Industry Standards Source License v1.2</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SISSL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Sun Industry Standards Source License v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Sleepycat\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Sleepycat License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SMLNJ\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Standard ML of New Jersey License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SMPPL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Secure Messaging Protocol Public License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SNIA\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SNIA Public License 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Spencer-86\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Spencer License 86</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Spencer-94\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Spencer License 94</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Spencer-99\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Spencer License 99</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Sun Public License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SugarCRM-1.1.3\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SugarCRM Public License v1.1.3</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SWL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Scheme Widget Library (SWL) Software License Agreement</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"TCL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">TCL/TK License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"TCP-wrappers\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">TCP Wrappers License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"TMate\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">TMate Open Source License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"TORQUE-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">TORQUE v2.5+ Software License v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"TOSL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Trusster Open Source License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Unicode-DFS-2015\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unicode License Agreement - Data Files and Software (2015)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Unicode-DFS-2016\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unicode License Agreement - Data Files and Software (2016)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Unicode-TOU\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unicode Terms of Use</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Unlicense\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">The Unlicense</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"UPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Universal Permissive License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Vim\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Vim License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"VOSTROM\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">VOSTROM Public License for Open Source</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"VSL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Vovida Software License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"W3C-19980720\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">W3C Software Notice and License (1998-07-20)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"W3C-20150513\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">W3C Software Notice and Document License (2015-05-13)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"W3C\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">W3C Software Notice and License (2002-12-31)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Watcom-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Sybase Open Watcom Public License 1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Wsuipa\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Wsuipa License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"WTFPL\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Do What The F*ck You Want To Public License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"X11\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">X11 License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Xerox\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Xerox License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"XFree86-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">XFree86 License 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"xinetd\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">xinetd License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Xnet\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">X.Net License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"xpp\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">XPP License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"XSkat\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">XSkat License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"YPL-1.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Yahoo! Public License v1.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"YPL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Yahoo! Public License v1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Zed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Zed License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Zend-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Zend License v2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Zimbra-1.3\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Zimbra Public License v1.3</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Zimbra-1.4\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Zimbra Public License v1.4</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"zlib-acknowledgement\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">zlib/libpng License with Acknowledgement</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Zlib\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">zlib License</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ZPL-1.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Zope Public License 1.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ZPL-2.0\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Zope Public License 2.0</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ZPL-2.1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Zope Public License 2.1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SPDXLicense\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The license that applies to an Implementation Guide (using an SPDX license Identifiers, or 'not-open-source'). The binding is required but new SPDX license Identifiers are allowed to be used (https://spdx.org/licenses/).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"SPDXLicense-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"GuidePageGeneration-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"html\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">HTML</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"markdown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Markdown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"xml\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">XML</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"generated\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Generated</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"GuidePageGeneration\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A code that indicates how the page is generated.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"GuidePageGeneration-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"InsurancePlan\" type=\"InsurancePlan\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"InsurancePlan\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this health insurance product which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The current state of the health insurance product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of health insurance product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Official name of the health insurance product as designated by the owner.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"alias\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of alternate names that the product is known as, or was known as in the past.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period of time that the health insurance product is available.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"ownedBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The entity that is providing  the health insurance product and underwriting the risk.  This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"administeredBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"coverageArea\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The geographic region in which a health insurance product's benefits apply.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" type=\"InsurancePlan.Contact\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The contact for the health insurance product for a certain purpose.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The technical endpoints providing access to services operated for the health insurance product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the network included in the health insurance product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"coverage\" type=\"InsurancePlan.Coverage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details about the coverage offered by the insurance product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"plan\" type=\"InsurancePlan.Plan\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details about an insurance plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"InsurancePlan.Contact\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates a purpose for which the contact can be reached.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"HumanName\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name associated with the contact.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Address\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Visiting or postal addresses for the contact.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"InsurancePlan.Coverage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of coverage  (Medical; Dental; Mental Health; Substance Abuse; Vision; Drug; Short Term; Long Term Care; Hospice; Home Health).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the network that providing the type of coverage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"benefit\" type=\"InsurancePlan.Benefit\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific benefits under this type of coverage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"InsurancePlan.Benefit\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of benefit (primary care; speciality care; inpatient; outpatient).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requirement\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The referral requirements to have access/coverage for this benefit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"limit\" type=\"InsurancePlan.Limit\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific limits on the benefit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"InsurancePlan.Limit\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum amount of a service item a plan will pay for a covered benefit.  For examples. wellness visits, or eyeglasses.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific limit on the benefit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"InsurancePlan.Plan\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this health insurance plan which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of plan. For example, &quot;Platinum&quot; or &quot;High Deductable&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"coverageArea\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The geographic region in which a health insurance plan's benefits apply.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the network that providing the type of coverage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"generalCost\" type=\"InsurancePlan.GeneralCost\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Overall costs associated with the plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specificCost\" type=\"InsurancePlan.SpecificCost\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Costs associated with the coverage provided by the product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"InsurancePlan.GeneralCost\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of cost.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"groupSize\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number of participants enrolled in the plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cost\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Value of the cost.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information about the general costs associated with this plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"InsurancePlan.SpecificCost\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">General category of benefit (Medical; Dental; Vision; Drug; Mental Health; Substance Abuse; Hospice, Home Health).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"benefit\" type=\"InsurancePlan.Benefit1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">List of the specific benefits under this category of benefit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"InsurancePlan.Benefit1\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of specific benefit (preventative; primary care office visit; speciality office visit; hospitalization; emergency room; urgent care).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cost\" type=\"InsurancePlan.Cost\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">List of the costs associated with a specific benefit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"InsurancePlan.Cost\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of cost (copay; individual cap; family cap; coinsurance; deductible).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"applicability\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the cost applies to in-network or out-of-network providers (in-network; out-of-network; other).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"qualifiers\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information about the cost, such as information about funding sources (e.g. HSA, HRA, FSA, RRA).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual cost value. (some of the costs may be represented as percentages rather than currency, e.g. 10% coinsurance).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Invoice\" type=\"Invoice\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Invoice\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier of this Invoice, often used for reference in correspondence about this invoice or for tracking of payments.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"InvoiceStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The current state of the Invoice.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cancelledReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">In case of Invoice cancellation a reason must be given (entered in error, superseded by corrected invoice etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of Invoice depending on domain, realm an usage (e.g. internal/external, dental, preliminary).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual or set of individuals receiving the goods and services billed in this invoice.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recipient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual or Organization responsible for balancing of this invoice.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date/time(s) of when this Invoice was posted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"participant\" type=\"Invoice.Participant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed or participated in the charged service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"issuer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organizationissuing the Invoice.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"account\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Account which is supposed to be balanced with this Invoice.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lineItem\" type=\"Invoice.LineItem\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Each line item represents one charge for goods and services rendered. Details such as date, code and amount are found in the referenced ChargeItem resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"totalPriceComponent\" type=\"Invoice.PriceComponent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The total amount for the Invoice may be calculated as the sum of the line items with surcharges/deductions that apply in certain conditions.  The priceComponent element can be used to offer transparency to the recipient of the Invoice of how the total price was calculated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"totalNet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Invoice total , taxes excluded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"totalGross\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Invoice total, tax included.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"paymentTerms\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Payment details such as banking details, period of payment, deductibles, methods of payment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments made about the invoice by the issuer, subject, or other participants.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Invoice.Participant\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the type of involvement (e.g. transcriptionist, creator etc.). If the invoice has been created automatically, the Participant may be a billing engine or another kind of device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The device, practitioner, etc. who performed or participated in the service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Invoice.LineItem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Sequence in which the items appear on the invoice.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The ChargeItem contains information such as the billing code, date, amount etc. If no further details are required for the lineItem, inline billing codes can be added using the CodeableConcept data type instead of the Reference.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"chargeItemReference\" type=\"Reference\"/>\r\n            <xs:element name=\"chargeItemCodeableConcept\" type=\"CodeableConcept\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"priceComponent\" type=\"Invoice.PriceComponent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice as to how the prices have been calculated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Invoice.PriceComponent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"InvoicePriceComponentType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This code identifies the type of the component.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that identifies the component. Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The factor that has been applied on the base price for calculating this component.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount calculated for this component.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"InvoiceStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"draft\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">draft</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"issued\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">issued</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"balanced\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">balanced</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">entered in error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"InvoiceStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Codes identifying the lifecycle stage of an Invoice.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"InvoiceStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Library\" type=\"Library\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Library\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this library when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this library is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the library is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this library when it is represented in other formats, or referenced in a specification, model, design or an instance. e.g. CMS or NQF identifiers for a measure artifact. Note that at least one identifier is required for non-experimental active artifacts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the library when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the library author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the library. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the library.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the library giving additional information about its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this library. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this library is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the type of library such as a Logic Library, Model Definition, Asset Collection, or Module Definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code or group definition that describes the intended subject of the contents of the library.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the library was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the library changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the library.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the library from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate library instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the library is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this library is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A detailed description of how the library is used from a clinical perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the library and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the library.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the library content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the library. Topics provide a high-level categorization of the library that can be useful for filtering and searching.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ParameterDefinition\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The parameter element defines parameters used by the library.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dataRequirement\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DataRequirement\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes a set of data that must be provided in order to be able to successfully perform the computations defined by the library.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"content\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the contentType of the attachment determines how to interpret the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Linkage\" type=\"Linkage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Identifies two or more records (resource instances) that refer to the same real-world &quot;occurrence&quot;.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Linkage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Identifies two or more records (resource instances) that refer to the same real-world &quot;occurrence&quot;.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether the asserted set of linkages are considered to be &quot;in effect&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the user or organization responsible for asserting the linkages as well as the user or organization who establishes the context in which the nature of each linkage is evaluated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" type=\"Linkage.Item\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies which record considered as the reference to the same real-world occurrence as well as how the items should be evaluated within the collection of linked items.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Linkage.Item\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Identifies two or more records (resource instances) that refer to the same real-world &quot;occurrence&quot;.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"LinkageType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Distinguishes which item is &quot;source of truth&quot; (if any) and which items are no longer considered to be current representations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resource\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The resource instance being linked as part of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"LinkageType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"source\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Source of Truth</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"alternate\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Alternate Record</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"historical\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Historical/Obsolete Record</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"LinkageType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Used to distinguish different roles a resource can play within a set of linked resources.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"LinkageType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"List\" type=\"List\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A list is a curated collection of resources.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"List\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A list is a curated collection of resources.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for the List assigned for business purposes outside the context of FHIR.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ListStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the current state of this list.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ListMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A label for the list assigned by the author.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This code defines the purpose of the list - why it was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The common subject (or patient) of the resources that are in the list if there is one.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The encounter that is the context in which this list was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date that the list was prepared.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"orderedBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">What order applies to the items in the list.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments that apply to the overall list.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"entry\" type=\"List.Entry\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Entries in this list.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"emptyReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the list is empty, why the list is empty.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"List.Entry\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A list is a curated collection of resources.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"flag\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The flag allows the system constructing the list to indicate the role and significance of the item in the list.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"deleted\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">True if this item is marked as deleted in the list.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When this item was added to the list.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the actual resource from which data was derived.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ListStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"current\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Current</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"retired\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Retired</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered In Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ListStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The current state of the list.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ListStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Location\" type=\"Location\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Location\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique code or number identifying the location to its users.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"LocationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status property covers the general availability of the resource, not the current value which may be covered by the operationStatus, or by a schedule/slots if they are configured for the location.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"operationalStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The operational status covers operation values most relevant to beds (but can also apply to rooms/units/chairs/etc. such as an isolation unit/dialysis chair). This typically covers concepts such as contamination, housekeeping, and other activities like maintenance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name of the location as used by humans. Does not need to be unique.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"alias\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of alternate names that the location is known as, or was known as, in the past.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of the Location, which helps in finding or referencing the place.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"mode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"LocationMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether a resource instance represents a specific location or a class of locations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the type of function performed at the location.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Address\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Physical location.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"physicalType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Physical form of the location, e.g. building, room, vehicle, road.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"position\" type=\"Location.Position\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"managingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization responsible for the provisioning and upkeep of the location.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Another Location of which this Location is physically a part of.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"hoursOfOperation\" type=\"Location.HoursOfOperation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">What days/times during a week is this location usually open.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"availabilityExceptions\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of when the locations opening ours are different to normal, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as detailed in the opening hours Times.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Technical endpoints providing access to services operated for the location.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Location.Position\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"longitude\" minOccurs=\"1\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"latitude\" minOccurs=\"1\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"altitude\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Location.HoursOfOperation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"daysOfWeek\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DaysOfWeek\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates which days of the week are available between the start and end Times.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"allDay\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Location is open all day.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"openingTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"time\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time that the Location opens.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"closingTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"time\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time that the Location closes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"LocationMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"instance\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Instance</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"kind\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Kind</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"LocationMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates whether a resource instance represents a specific location or a class of locations.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"LocationMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"LocationStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"suspended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Suspended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"inactive\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"LocationStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates whether the location is still in use.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"LocationStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Measure\" type=\"Measure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Measure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this measure when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this measure is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the measure is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this measure when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the measure when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the measure author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the measure. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the measure giving additional information about its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this measure. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this measure is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The intended subjects for the measure. If this element is not provided, a Patient subject is assumed, but the subject of the measure can be anything.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the measure was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the measure changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the measure from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate measure instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the measure is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this measure is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A detailed description, from a clinical perspective, of how the measure is used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the measure and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the measure content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the measure. Topics provide a high-level categorization grouping types of measures that can be useful for filtering and searching.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"library\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a Library resource containing the formal logic used by the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"disclaimer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Notices and disclaimers regarding the use of the measure or related to intellectual property (such as code systems) referenced by the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"scoring\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how the calculation is performed for the measure, including proportion, ratio, continuous-variable, and cohort. The value set is extensible, allowing additional measure scoring types to be represented.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"compositeScoring\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If this is a composite measure, the scoring method used to combine the component measures to determine the composite score.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether the measure is used to examine a process, an outcome over time, a patient-reported outcome, or a structure measure such as utilization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"riskAdjustment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rateAggregation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes how to combine the information calculated, based on logic in each of several populations, into one summarized result.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rationale\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides a succinct statement of the need for the measure. Usually includes statements pertaining to importance criterion: impact, gap in care, and evidence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"clinicalRecommendationStatement\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides a summary of relevant clinical guidelines or other clinical recommendations supporting the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"improvementNotation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information on whether an increase or decrease in score is the preferred result (e.g., a higher score indicates better quality OR a lower score indicates better quality OR quality is within a range).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides a description of an individual term used within the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"guidance\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"group\" type=\"Measure.Group\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A group of population criteria for the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supplementalData\" type=\"Measure.SupplementalData\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Measure.Group\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates a meaning for the group. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing groups to be correlated across measures.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The human readable description of this population group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"population\" type=\"Measure.Population\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A population criteria for the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"stratifier\" type=\"Measure.Stratifier\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library or a valid FHIR Resource Path.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Measure.Population\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of population criteria.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The human readable description of this population criteria.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"criteria\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Expression\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An expression that specifies the criteria for the population, typically the name of an expression in a library.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Measure.Stratifier\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates a meaning for the stratifier. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing stratifiers to be correlated across measures.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The human readable description of this stratifier criteria.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"criteria\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Expression\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An expression that specifies the criteria for the stratifier. This is typically the name of an expression defined within a referenced library, but it may also be a path to a stratifier element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"component\" type=\"Measure.Component\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A component of the stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library or a valid FHIR Resource Path.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Measure.Component\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates a meaning for the stratifier component. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing stratifiers to be correlated across measures.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The human readable description of this stratifier criteria component.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"criteria\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Expression\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An expression that specifies the criteria for this component of the stratifier. This is typically the name of an expression defined within a referenced library, but it may also be a path to a stratifier element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Measure.SupplementalData\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates a meaning for the supplemental data. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing supplemental data to be correlated across measures.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The human readable description of this supplemental data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"criteria\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Expression\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The criteria for the supplemental data. This is typically the name of a valid expression defined within a referenced library, but it may also be a path to a specific data element. The criteria defines the data to be returned for this element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MeasureReport\" type=\"MeasureReport\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MeasureReport\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this MeasureReport when it is represented in other formats or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"MeasureReportStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The MeasureReport status. No data will be available until the MeasureReport status is complete.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"MeasureReportType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of measure report. This may be an individual report, which provides the score for the measure for an individual member of the population; a subject-listing, which returns the list of members that meet the various criteria in the measure; a summary report, which returns a population count for each of the criteria in the measure; or a data-collection, which enables the MeasureReport to be used to exchange the data-of-interest for a quality measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"measure\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the Measure that was calculated to produce this report.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Optional subject identifying the individual or individuals the report is for.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date this measure report was generated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reporter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual, location, or organization that is reporting the data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reporting period for which the report was calculated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"improvementNotation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether improvement in the measure is noted by an increase or decrease in the measure score.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"group\" type=\"MeasureReport.Group\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The results of the calculation, one for each population group in the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"evaluatedResource\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a Bundle containing the Resources that were used in the calculation of this measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MeasureReport.Group\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The meaning of the population group as defined in the measure definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"population\" type=\"MeasureReport.Population\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The populations that make up the population group, one for each type of population appropriate for the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"measureScore\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The measure score for this population group, calculated as appropriate for the measure type and scoring method, and based on the contents of the populations defined in the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"stratifier\" type=\"MeasureReport.Stratifier\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MeasureReport.Population\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the population.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"count\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of members of the population.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subjectResults\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This element refers to a List of subject level MeasureReport resources, one for each subject in this population.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MeasureReport.Stratifier\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The meaning of this stratifier, as defined in the measure definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"stratum\" type=\"MeasureReport.Stratum\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MeasureReport.Stratum\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value for this stratum, expressed as a CodeableConcept. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"component\" type=\"MeasureReport.Component\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A stratifier component value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"population\" type=\"MeasureReport.Population1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The populations that make up the stratum, one for each type of population appropriate to the measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"measureScore\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The measure score for this stratum, calculated as appropriate for the measure type and scoring method, and based on only the members of this stratum.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MeasureReport.Component\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code for the stratum component value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The stratum component value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MeasureReport.Population1\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the population.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"count\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of members of the population in this stratum.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subjectResults\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"MeasureReportStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"complete\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Complete</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"pending\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Pending</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"MeasureReportStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The status of the measure report.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"MeasureReportStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"MeasureReportType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"individual\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Individual</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"subject-list\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Subject List</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"summary\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Summary</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"data-collection\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Data Collection</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"MeasureReportType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of the measure report.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"MeasureReportType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Media\" type=\"Media\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Media\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A procedure that is fulfilled in whole or in part by the creation of this media.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A larger event of which this particular event is a component or step.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EventStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The current state of the {{title}}.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that classifies whether the media is an image, video or audio recording or some other media category.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modality\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"view\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the imaging view e.g. Lateral or Antero-posterior (AP).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who/What this Media is a record of.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The encounter that establishes the context for this media.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date and time(s) at which the media was collected.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"createdDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"createdPeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"issued\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date and time this version of the media was made available to providers, typically after having been reviewed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"operator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person who administered the collection of the image.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes why the event occurred in coded or textual form.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the site on the subject's body where the observation was made (i.e. the target site).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"deviceName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the device / manufacturer of the device  that was used to make the recording.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"device\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The device used to collect the media.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"height\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Height of the image in pixels (photo/video).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"width\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Width of the image in pixels (photo/video).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"frames\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"duration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The duration of the recording in seconds - for audio and video.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"content\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual content of the media - inline or by direct reference to the media source file.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments made about the media by the performer, subject or other participants.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Medication\" type=\"Medication\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Medication\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifier for this medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"MedicationStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to indicate if the medication is in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"form\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the form of the item.  Powder; tablets; capsule.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific amount of the drug in the packaged product.  For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"ingredient\" type=\"Medication.Ingredient\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies a particular constituent of interest in the product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"batch\" type=\"Medication.Batch\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information that only applies to packages (not products).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Medication.Ingredient\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual ingredient - either a substance (simple ingredient) or another medication of a medication.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"itemCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"itemReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"isActive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indication of whether this ingredient affects the therapeutic action of the drug.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"strength\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Medication.Batch\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"lotNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The assigned lot number of a batch of the specified product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expirationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When this specific batch of product will expire.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"MedicationStatusCodes-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"inactive\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"MedicationStatusCodes\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A coded concept defining if the medication is in active use.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"MedicationStatusCodes-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicationAdministration\" type=\"MedicationAdministration\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicationAdministration\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers associated with this Medication Administration that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiates\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A protocol, guideline, orderset, or other definition that was adhered to in whole or in part by this event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A larger event of which this particular event is a component or step.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Will generally be set to show that the administration has been completed.  For some long running administrations such as infusions, it is possible for an administration to be started but not completed or it may be paused while some other process is under way.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code indicating why the administration was not performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates where the medication is expected to be consumed or administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"medicationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"medicationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person or animal or group receiving the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The visit, admission, or other contact between patient and health care provider during which the medication administration was performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInformation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information (for example, patient height and weight) that supports the administration of the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"effectiveDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"effectivePeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"performer\" type=\"MedicationAdministration.Performer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed the medication administration and how they were involved.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code indicating why the medication was given.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Condition or observation that supports why the medication was administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The original request, instruction or authority to perform the administration.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"device\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The device used in administering the medication to the patient.  For example, a particular infusion pump.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Extra information about the medication administration that is not conveyed by the other attributes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dosage\" type=\"MedicationAdministration.Dosage\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the medication dosage information details e.g. dose, rate, site, route, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"eventHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A summary of the events of interest that have occurred, such as when the administration was verified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationAdministration.Performer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"function\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Distinguishes the type of involvement of the performer in the medication administration.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed the medication administration.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationAdministration.Dosage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans.\r\rThe dosage instructions should reflect the dosage of the medication that was administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"site\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A coded specification of the anatomic site where the medication first entered the body.  For example, &quot;left arm&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"route\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient.  For example, topical, intravenous, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.  This attribute will most often NOT be populated.  It is most commonly used for injections.  For example, Slow Push, Deep IV.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount of the medication given at one administration event.   Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"rateRatio\" type=\"Ratio\"/>\r\n            <xs:element name=\"rateQuantity\" type=\"Quantity\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicationDispense\" type=\"MedicationDispense\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicationDispense\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers associated with this Medication Dispense that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The procedure that trigger the dispense.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code specifying the state of the set of dispense events.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the reason why a dispense was not performed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"statusReasonCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"statusReasonReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the type of medication dispense (for example, where the medication is expected to be consumed or administered (i.e. inpatient or outpatient)).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"medicationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"medicationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A link to a resource representing the person or the group to whom the medication will be given.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The encounter or episode of care that establishes the context for this event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInformation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information that supports the medication being dispensed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" type=\"MedicationDispense.Performer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The principal physical location where the dispense was performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authorizingPrescription\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the medication order that is being dispensed against.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount of medication that has been dispensed. Includes unit of measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"daysSupply\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount of medication expressed as a timing amount.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"whenPrepared\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time when the dispensed product was packaged and reviewed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"whenHandedOver\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time the dispensed product was provided to the patient or their representative.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"destination\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identification of the facility/location where the medication was shipped to, as part of the dispense event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"receiver\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the person who picked up the medication.  This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Extra information about the dispense that could not be conveyed in the other attributes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dosageInstruction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Dosage\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how the medication is to be used by the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"substitution\" type=\"MedicationDispense.Substitution\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether or not substitution was made as part of the dispense.  In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen.  This block explains what substitution did or did not happen and why.  If nothing is specified, substitution was not done.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detectedIssue\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. drug-drug interaction, duplicate therapy, dosage alert etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"eventHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A summary of the events of interest that have occurred, such as when the dispense was verified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationDispense.Performer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"function\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Distinguishes the type of performer in the dispense.  For example, date enterer, packager, final checker.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The device, practitioner, etc. who performed the action.  It should be assumed that the actor is the dispenser of the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationDispense.Substitution\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"wasSubstituted\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">True if the dispenser dispensed a different drug or product from what was prescribed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code signifying whether a different drug was dispensed from what was prescribed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the reason for the substitution (or lack of substitution) from what was prescribed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"responsibleParty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person or organization that has primary responsibility for the substitution.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicationKnowledge\" type=\"MedicationKnowledge\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicationKnowledge\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that specifies this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to indicate if the medication is in active use.  The status refers to the validity about the information of the medication and not to its medicinal properties.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"doseForm\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the form of the item.  Powder; tablets; capsule.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific amount of the drug in the packaged product.  For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"synonym\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional names for a medication, for example, the name(s) given to a medication in different countries.  For example, acetaminophen and paracetamol or salbutamol and albuterol.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedMedicationKnowledge\" type=\"MedicationKnowledge.RelatedMedicationKnowledge\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Associated or related knowledge about a medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"associatedMedication\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Associated or related medications.  For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Category of the medication or product (e.g. branded product, therapeutic moeity, generic product, innovator product, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"monograph\" type=\"MedicationKnowledge.Monograph\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Associated documentation about the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"ingredient\" type=\"MedicationKnowledge.Ingredient\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies a particular constituent of interest in the product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preparationInstruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The instructions for preparing the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intendedRoute\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The intended or approved route of administration.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cost\" type=\"MedicationKnowledge.Cost\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The price of the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"monitoringProgram\" type=\"MedicationKnowledge.MonitoringProgram\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The program under which the medication is reviewed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"administrationGuidelines\" type=\"MedicationKnowledge.AdministrationGuidelines\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Guidelines for the administration of the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"medicineClassification\" type=\"MedicationKnowledge.MedicineClassification\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Categorization of the medication within a formulary or classification system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"packaging\" type=\"MedicationKnowledge.Packaging\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information that only applies to packages (not products).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"drugCharacteristic\" type=\"MedicationKnowledge.DrugCharacteristic\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies descriptive properties of the medicine, such as color, shape, imprints, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contraindication\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Potential clinical issue with or between medication(s) (for example, drug-drug interaction, drug-disease contraindication, drug-allergy interaction, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"regulatory\" type=\"MedicationKnowledge.Regulatory\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Regulatory information about a medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"kinetics\" type=\"MedicationKnowledge.Kinetics\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time course of drug absorption, distribution, metabolism and excretion of a medication from the body.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.RelatedMedicationKnowledge\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The category of the associated medication knowledge reference.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Associated documentation about the associated medication knowledge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.Monograph\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The category of documentation about the medication. (e.g. professional monograph, patient education monograph).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Associated documentation about the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.Ingredient\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual ingredient - either a substance (simple ingredient) or another medication.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"itemCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"itemReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"isActive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indication of whether this ingredient affects the therapeutic action of the drug.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"strength\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.Cost\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The category of the cost information.  For example, manufacturers' cost, patient cost, claim reimbursement cost, actual acquisition cost.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The source or owner that assigns the price to the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cost\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The price of the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.MonitoringProgram\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of program under which the medication is monitored.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name of the reviewing program.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.AdministrationGuidelines\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"dosage\" type=\"MedicationKnowledge.Dosage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Dosage for the medication for the specific guidelines.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indication for use that apply to the specific administration guidelines.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"indicationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"indicationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"patientCharacteristics\" type=\"MedicationKnowledge.PatientCharacteristics\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Characteristics of the patient that are relevant to the administration guidelines (for example, height, weight, gender, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.Dosage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of dosage (for example, prophylaxis, maintenance, therapeutic, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dosage\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Dosage\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Dosage for the medication for the specific guidelines.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.PatientCharacteristics\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender).</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"characteristicCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"characteristicQuantity\" type=\"Quantity\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific characteristic (e.g. height, weight, gender, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.MedicineClassification\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"classification\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific category assigned to the medication (e.g. anti-infective, anti-hypertensive, antibiotic, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.Packaging\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that defines the specific type of packaging that the medication can be found in (e.g. blister sleeve, tube, bottle).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of product units the package would contain if fully loaded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.DrugCharacteristic\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code specifying which characteristic of the medicine is being described (for example, colour, shape, imprint).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of the characteristic.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.Regulatory\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"regulatoryAuthority\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The authority that is specifying the regulations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"substitution\" type=\"MedicationKnowledge.Substitution\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies if changes are allowed when dispensing a medication from a regulatory perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"schedule\" type=\"MedicationKnowledge.Schedule\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the schedule of a medication in jurisdiction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maxDispense\" type=\"MedicationKnowledge.MaxDispense\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum number of units of the medication that can be dispensed in a period.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.Substitution\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the type of substitution allowed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"allowed\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies if regulation allows for changes in the medication when dispensing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.Schedule\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"schedule\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the specific drug schedule.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.MaxDispense\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"quantity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum number of units of the medication that can be dispensed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period that applies to the maximum number of units.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationKnowledge.Kinetics\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"areaUnderCurve\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The drug concentration measured at certain discrete points in time.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lethalDose50\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The median lethal dose of a drug.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"halfLifePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time required for any specified property (e.g., the concentration of a substance in the body) to decrease by half.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicationRequest\" type=\"MedicationRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called &quot;MedicationRequest&quot; rather than &quot;MedicationPrescription&quot; or &quot;MedicationOrder&quot; to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicationRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called &quot;MedicationRequest&quot; rather than &quot;MedicationPrescription&quot; or &quot;MedicationOrder&quot; to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers associated with this medication request that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"medicationrequestStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code specifying the current state of the order.  Generally, this will be active or completed state.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current state of the MedicationRequest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"medicationRequestIntent\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the request is a proposal, plan, or an original order.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the type of medication request (for example, where the medication is expected to be consumed or administered (i.e. inpatient or outpatient)).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the Medication Request should be addressed with respect to other requests.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"doNotPerform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If true indicates that the provider is asking for the medication request not to occur.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates if this record was captured as a secondary 'reported' record rather than as an original primary source-of-truth record.  It may also indicate the source of the report.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"reportedBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"reportedReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the medication being requested. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"medicationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"medicationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A link to a resource representing the person or set of individuals to whom the medication will be given.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Encounter during which this [x] was created or to which the creation of this record is tightly associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInformation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Include additional information (for example, patient height and weight) that supports the ordering of the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date (and perhaps time) when the prescription was initially written or authored on.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual, organization, or device that initiated the request and has responsibility for its activation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specified desired performer of the medication treatment (e.g. the performer of the medication administration).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performerType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the type of performer of the administration of the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recorder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person who entered the order on behalf of another individual for example in the case of a verbal or a telephone order.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reason or the indication for ordering or not ordering the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Condition or observation that supports why the medication was ordered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to a protocol, guideline, orderset, or other definition that is adhered to in whole or in part by this MedicationRequest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this MedicationRequest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A plan or request that is fulfilled in whole or in part by this medication request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"groupIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition or prescription.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"courseOfTherapyType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The description of the overall patte3rn of the administration of the medication to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Extra information about the prescription that could not be conveyed by the other attributes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dosageInstruction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Dosage\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how the medication is to be used by the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dispenseRequest\" type=\"MedicationRequest.DispenseRequest\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the specific details for the dispense or medication supply part of a medication request (also known as a Medication Prescription or Medication Order).  Note that this information is not always sent with the order.  There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"substitution\" type=\"MedicationRequest.Substitution\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether or not substitution can or should be part of the dispense. In some cases, substitution must happen, in other cases substitution must not happen. This block explains the prescriber's intent. If nothing is specified substitution may be done.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priorPrescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A link to a resource representing an earlier order related order or prescription.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detectedIssue\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, duplicate therapy, dosage alert etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"eventHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Links to Provenance records for past versions of this resource or fulfilling request or event resources that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationRequest.DispenseRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called &quot;MedicationRequest&quot; rather than &quot;MedicationPrescription&quot; or &quot;MedicationOrder&quot; to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"initialFill\" type=\"MedicationRequest.InitialFill\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the quantity or duration for the first dispense of the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dispenseInterval\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The minimum period of time that must occur between dispenses of the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validityPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This indicates the validity period of a prescription (stale dating the Prescription).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numberOfRepeatsAllowed\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An integer indicating the number of times, in addition to the original dispense, (aka refills or repeats) that the patient can receive the prescribed medication. Usage Notes: This integer does not include the original order dispense. This means that if an order indicates dispense 30 tablets plus &quot;3 repeats&quot;, then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets.  A prescriber may explicitly say that zero refills are permitted after the initial dispense.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount that is to be dispensed for one fill.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expectedSupplyDuration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the intended dispensing Organization specified by the prescriber.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationRequest.InitialFill\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called &quot;MedicationRequest&quot; rather than &quot;MedicationPrescription&quot; or &quot;MedicationOrder&quot; to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount or quantity to provide as part of the first dispense.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"duration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The length of time that the first dispense is expected to last.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationRequest.Substitution\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called &quot;MedicationRequest&quot; rather than &quot;MedicationPrescription&quot; or &quot;MedicationOrder&quot; to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">True if the prescriber allows a different drug to be dispensed from what was prescribed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"allowedBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"allowedCodeableConcept\" type=\"CodeableConcept\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the reason for the substitution, or why substitution must or must not be performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"medicationrequestStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-hold\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"stopped\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Stopped</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"draft\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"medicationrequestStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A coded concept specifying the state of the prescribing event. Describes the lifecycle of the prescription.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"medicationrequestStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"medicationRequestIntent-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"proposal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Proposal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"plan\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Plan</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"original-order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Original Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"reflex-order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Reflex Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"filler-order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Filler Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"instance-order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Instance Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"option\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Option</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"medicationRequestIntent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The kind of medication order.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"medicationRequestIntent-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicationStatement\" type=\"MedicationStatement\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a medication that is being consumed by a patient.   A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay.   The medication information may come from sources such as the patient's memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains. \n\nThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medication statement is often, if not always, less specific.  There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise.  As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains.  Medication administration is more formal and is not missing detailed information.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicationStatement\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a medication that is being consumed by a patient.   A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay.   The medication information may come from sources such as the patient's memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains. \n\nThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medication statement is often, if not always, less specific.  There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise.  As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains.  Medication administration is more formal and is not missing detailed information.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers associated with this Medication Statement that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A plan, proposal or order that is fulfilled in whole or in part by this event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A larger event of which this particular event is a component or step.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"MedicationStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code representing the patient or other source's judgment about the state of the medication used that this statement is about.  Generally, this will be active or completed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current state of the MedicationStatement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates where the medication is expected to be consumed or administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"medicationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"medicationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person, animal or group who is/was taking the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The encounter or episode of care that establishes the context for this MedicationStatement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The interval of time during which it is being asserted that the patient is/was/will be taking the medication (or was not taking, when the MedicationStatement.taken element is No).</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"effectiveDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"effectivePeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"dateAsserted\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when the medication statement was asserted by the information source.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"informationSource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person or organization that provided the information about the taking of this medication. Note: Use derivedFrom when a MedicationStatement is derived from other resources, e.g. Claim or MedicationRequest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"derivedFrom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Allows linking the MedicationStatement to the underlying MedicationRequest, or to other information that supports or is used to derive the MedicationStatement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reason for why the medication is being/was taken.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Condition or observation that supports why the medication is being/was taken.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides extra information about the medication statement that is not conveyed by the other attributes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dosage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Dosage\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how the medication is/was or should be taken by the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicinalProduct\" type=\"MedicinalProduct\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicinalProduct\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifier for this product. Could be an MPID.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Regulatory type, e.g. Investigational or Authorized.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"domain\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If this medicine applies to human or veterinary uses.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"combinedPharmaceuticalDoseForm\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The dose form for a single part product, or combined form of a multiple part product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"legalStatusOfSupply\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The legal status of supply of the medicinal product as classified by the regulator.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"additionalMonitoringIndicator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the Medicinal Product is subject to additional monitoring for regulatory reasons.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialMeasures\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the Medicinal Product is subject to special measures for regulatory reasons.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"paediatricUseIndicator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If authorised for use in children.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productClassification\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Allows the product to be classified by various systems.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"marketingStatus\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"MarketingStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Marketing status of the medicinal product, in contrast to marketing authorizaton.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"pharmaceuticalProduct\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Pharmaceutical aspects of product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"packagedMedicinalProduct\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Package representation for the product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"attachedDocument\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Supporting documentation, typically for regulatory submission.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"masterFile\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A master file for to the medicinal product (e.g. Pharmacovigilance System Master File).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A product specific contact, person (in a role), or an organization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"clinicalTrial\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Clinical trials or studies that this product is involved in.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" type=\"MedicinalProduct.Name\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The product's name, including full name and possibly coded parts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"crossReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to another product, e.g. for linking authorised to investigational product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manufacturingBusinessOperation\" type=\"MedicinalProduct.ManufacturingBusinessOperation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An operation applied to the product, for manufacturing or adminsitrative purpose.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialDesignation\" type=\"MedicinalProduct.SpecialDesignation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates if the medicinal product has an orphan designation for the treatment of a rare disease.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProduct.Name\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"productName\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The full product name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"namePart\" type=\"MedicinalProduct.NamePart\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Coding words or phrases of the name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"countryLanguage\" type=\"MedicinalProduct.CountryLanguage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Country where the name applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProduct.NamePart\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"part\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A fragment of a product name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Idenifying type for this part of the name (e.g. strength part).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProduct.CountryLanguage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"country\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Country code for where this name applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Jurisdiction code for where this name applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"language\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Language code for this name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProduct.ManufacturingBusinessOperation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"operationType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of manufacturing operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authorisationReferenceNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Regulatory authorization reference number.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectiveDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Regulatory authorization date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"confidentialityIndicator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">To indicate if this proces is commercially confidential.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The manufacturer or establishment associated with the process.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"regulator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A regulator which oversees the operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProduct.SpecialDesignation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for the designation, or procedure number.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of special designation, e.g. orphan drug, minor use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intendedUse\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The intended use of the product, e.g. prevention, treatment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Condition for which the medicinal use applies.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"indicationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"indicationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">For example granted, pending, expired or withdrawn.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date when the designation was granted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"species\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Animal species for which this applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicinalProductAuthorization\" type=\"MedicinalProductAuthorization\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The regulatory authorization of a medicinal product.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicinalProductAuthorization\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The regulatory authorization of a medicinal product.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifier for the marketing authorization, as assigned by a regulator.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The medicinal product that is being authorized.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"country\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The country in which the marketing authorization has been granted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Jurisdiction within a country.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the marketing authorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date at which the given status has become applicable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"restoreDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when a suspended the marketing or the marketing authorization of the product is anticipated to be restored.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validityPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The beginning of the time period in which the marketing authorization is in the specific status shall be specified A complete date consisting of day, month and year shall be specified using the ISO 8601 date format.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dataExclusivityPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A period of time after authorization before generic product applicatiosn can be submitted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dateOfFirstAuthorization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when the first authorization was granted by a Medicines Regulatory Agency.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"internationalBirthDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date of first marketing authorization for a company's new medicinal product in any country in the World.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"legalBasis\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The legal framework against which this authorization is granted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdictionalAuthorization\" type=\"MedicinalProductAuthorization.JurisdictionalAuthorization\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Authorization in areas within a country.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"holder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Marketing Authorization Holder.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"regulator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Medicines Regulatory Agency.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"procedure\" type=\"MedicinalProductAuthorization.Procedure\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The regulatory procedure for granting or amending a marketing authorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductAuthorization.JurisdictionalAuthorization\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The regulatory authorization of a medicinal product.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The assigned number for the marketing authorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"country\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Country of authorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Jurisdiction within a country.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"legalStatusOfSupply\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The legal status of supply in a jurisdiction or region.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validityPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The start and expected end date of the authorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductAuthorization.Procedure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The regulatory authorization of a medicinal product.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for this procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date of procedure.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"datePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"dateDateTime\" type=\"dateTime\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"application\" type=\"MedicinalProductAuthorization.Procedure\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Applcations submitted to obtain a marketing authorization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicinalProductContraindication\" type=\"MedicinalProductContraindication\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicinalProductContraindication\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The medication for which this is an indication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"disease\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The disease, symptom or procedure for the contraindication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"diseaseStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the disease or symptom for the contraindication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comorbidity\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A comorbidity (concurrent condition) or coinfection.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"therapeuticIndication\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the use of the medicinal product in relation to other therapies as part of the indication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"otherTherapy\" type=\"MedicinalProductContraindication.OtherTherapy\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the use of the medicinal product in relation to other therapies described as part of the indication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"population\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Population\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The population group to which this applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductContraindication.OtherTherapy\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"therapyRelationshipType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of relationship between the medicinal product indication or contraindication and another therapy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"medicationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"medicationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicinalProductIndication\" type=\"MedicinalProductIndication\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indication for the Medicinal Product.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicinalProductIndication\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indication for the Medicinal Product.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The medication for which this is an indication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"diseaseSymptomProcedure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The disease, symptom or procedure that is the indication for treatment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"diseaseStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the disease or symptom for which the indication applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comorbidity\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comorbidity (concurrent condition) or co-infection as part of the indication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intendedEffect\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The intended effect, aim or strategy to be achieved by the indication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"duration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Timing or duration information as part of the indication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"otherTherapy\" type=\"MedicinalProductIndication.OtherTherapy\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the use of the medicinal product in relation to other therapies described as part of the indication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"undesirableEffect\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describe the undesirable effects of the medicinal product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"population\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Population\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The population group to which this applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductIndication.OtherTherapy\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indication for the Medicinal Product.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"therapyRelationshipType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of relationship between the medicinal product indication or contraindication and another therapy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"medicationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"medicationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicinalProductIngredient\" type=\"MedicinalProductIngredient\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An ingredient of a manufactured item or pharmaceutical product.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicinalProductIngredient\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An ingredient of a manufactured item or pharmaceutical product.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier(s) of this Ingredient that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"role\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Ingredient role e.g. Active ingredient, excipient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"allergenicIndicator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the ingredient is a known or suspected allergen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Manufacturer of this Ingredient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specifiedSubstance\" type=\"MedicinalProductIngredient.SpecifiedSubstance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A specified substance that comprises this ingredient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"substance\" type=\"MedicinalProductIngredient.Substance\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The ingredient substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductIngredient.SpecifiedSubstance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An ingredient of a manufactured item or pharmaceutical product.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specified substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"group\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The group of specified substance, e.g. group 1 to 4.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"confidentiality\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Confidentiality level of the specified substance as the ingredient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"strength\" type=\"MedicinalProductIngredient.Strength\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductIngredient.Strength\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An ingredient of a manufactured item or pharmaceutical product.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"presentation\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Ratio\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"presentationLowLimit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A lower limit for the quantity of substance in the unit of presentation. For use when there is a range of strengths, this is the lower limit, with the presentation attribute becoming the upper limit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"concentration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The strength per unitary volume (or mass).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"concentrationLowLimit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A lower limit for the strength per unitary volume (or mass), for when there is a range. The concentration attribute then becomes the upper limit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"measurementPoint\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">For when strength is measured at a particular point or distance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"country\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The country or countries for which the strength range applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referenceStrength\" type=\"MedicinalProductIngredient.ReferenceStrength\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Strength expressed in terms of a reference substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductIngredient.ReferenceStrength\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An ingredient of a manufactured item or pharmaceutical product.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"substance\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Relevant reference substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"strength\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Ratio\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Strength expressed in terms of a reference substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"strengthLowLimit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Strength expressed in terms of a reference substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"measurementPoint\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">For when strength is measured at a particular point or distance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"country\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The country or countries for which the strength range applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductIngredient.Substance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An ingredient of a manufactured item or pharmaceutical product.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The ingredient substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"strength\" type=\"MedicinalProductIngredient.Strength\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicinalProductInteraction\" type=\"MedicinalProductInteraction\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The interactions of the medicinal product with other medicinal products, or other forms of interactions.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicinalProductInteraction\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The interactions of the medicinal product with other medicinal products, or other forms of interactions.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The medication for which this is a described interaction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The interaction described.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"interactant\" type=\"MedicinalProductInteraction.Interactant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific medication, food or laboratory test that interacts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effect\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The effect of the interaction, for example &quot;reduced gastric absorption of primary medication&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"incidence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The incidence of the interaction, e.g. theoretical, observed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"management\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Actions for managing the interaction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductInteraction.Interactant\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The interactions of the medicinal product with other medicinal products, or other forms of interactions.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific medication, food or laboratory test that interacts.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"itemReference\" type=\"Reference\"/>\r\n            <xs:element name=\"itemCodeableConcept\" type=\"CodeableConcept\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicinalProductManufactured\" type=\"MedicinalProductManufactured\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The manufactured item as contained in the packaged medicinal product.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicinalProductManufactured\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The manufactured item as contained in the packaged medicinal product.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"manufacturedDoseForm\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Dose form as manufactured and before any transformation into the pharmaceutical product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitOfPresentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The “real world” units in which the quantity of the manufactured item is described.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity or &quot;count number&quot; of the manufactured item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Manufacturer of the item (Note that this should be named &quot;manufacturer&quot; but it currently causes technical issues).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"ingredient\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Ingredient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"physicalCharacteristics\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ProdCharacteristic\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Dimensions, color etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"otherCharacteristics\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Other codeable characteristics.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicinalProductPackaged\" type=\"MedicinalProductPackaged\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A medicinal product in a container or package.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicinalProductPackaged\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A medicinal product in a container or package.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique identifier.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The product with this is a pack for.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Textual description.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"legalStatusOfSupply\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The legal status of supply of the medicinal product as classified by the regulator.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"marketingStatus\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"MarketingStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Marketing information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"marketingAuthorization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Manufacturer of this Package Item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Manufacturer of this Package Item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"batchIdentifier\" type=\"MedicinalProductPackaged.BatchIdentifier\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Batch numbering.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"packageItem\" type=\"MedicinalProductPackaged.PackageItem\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A packaging item, as a contained for medicine, possibly with other packaging items within.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductPackaged.BatchIdentifier\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A medicinal product in a container or package.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"outerPackaging\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number appearing on the outer packaging of a specific batch.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"immediatePackaging\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A number appearing on the immediate packaging (and not the outer packaging).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductPackaged.PackageItem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A medicinal product in a container or package.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Including possibly Data Carrier Identifier.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The physical type of the container of the medicine.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity of this package in the medicinal product, at the current level of packaging. The outermost is always 1.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"material\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Material type of the package item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"alternateMaterial\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A possible alternate material for the packaging.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"device\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A device accompanying a medicinal product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manufacturedItem\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The manufactured item as contained in the packaged medicinal product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"packageItem\" type=\"MedicinalProductPackaged.PackageItem\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Allows containers within containers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"physicalCharacteristics\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ProdCharacteristic\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Dimensions, color etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"otherCharacteristics\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Other codeable characteristics.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"shelfLifeStorage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ProductShelfLife\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Shelf Life and storage information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Manufacturer of this Package Item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicinalProductPharmaceutical\" type=\"MedicinalProductPharmaceutical\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A pharmaceutical product described in terms of its composition and dose form.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicinalProductPharmaceutical\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A pharmaceutical product described in terms of its composition and dose form.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier for the pharmaceutical medicinal product.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"administrableDoseForm\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The administrable dose form, after necessary reconstitution.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitOfPresentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"ingredient\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Ingredient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"device\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Accompanying device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"characteristics\" type=\"MedicinalProductPharmaceutical.Characteristics\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Characteristics e.g. a products onset of action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"routeOfAdministration\" type=\"MedicinalProductPharmaceutical.RouteOfAdministration\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The path by which the pharmaceutical product is taken into or makes contact with the body.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductPharmaceutical.Characteristics\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A pharmaceutical product described in terms of its composition and dose form.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A coded characteristic.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of characteristic e.g. assigned or pending.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductPharmaceutical.RouteOfAdministration\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A pharmaceutical product described in terms of its composition and dose form.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Coded expression for the route.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"firstDose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The first dose (dose quantity) administered in humans can be specified, for a product under investigation, using a numerical value and its unit of measurement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maxSingleDose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum single dose that can be administered as per the protocol of a clinical trial can be specified using a numerical value and its unit of measurement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maxDosePerDay\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum dose per day (maximum dose quantity to be administered in any one 24-h period) that can be administered as per the protocol referenced in the clinical trial authorisation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maxDosePerTreatmentPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum dose per treatment period that can be administered as per the protocol referenced in the clinical trial authorisation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maxTreatmentPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum treatment period during which an Investigational Medicinal Product can be administered as per the protocol referenced in the clinical trial authorisation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"targetSpecies\" type=\"MedicinalProductPharmaceutical.TargetSpecies\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A species for which this route applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductPharmaceutical.TargetSpecies\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A pharmaceutical product described in terms of its composition and dose form.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Coded expression for the species.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"withdrawalPeriod\" type=\"MedicinalProductPharmaceutical.WithdrawalPeriod\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A species specific time during which consumption of animal product is not appropriate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicinalProductPharmaceutical.WithdrawalPeriod\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A pharmaceutical product described in terms of its composition and dose form.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"tissue\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Coded expression for the type of tissue for which the withdrawal period applues, e.g. meat, milk.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A value for the time.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInformation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Extra information about the withdrawal period.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MedicinalProductUndesirableEffect\" type=\"MedicinalProductUndesirableEffect\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describe the undesirable effects of the medicinal product.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicinalProductUndesirableEffect\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describe the undesirable effects of the medicinal product.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The medication for which this is an indication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"symptomConditionEffect\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The symptom, condition or undesirable effect.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"classification\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Classification of the effect.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"frequencyOfOccurrence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The frequency of occurrence of the effect.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"population\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Population\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The population group to which this applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MessageDefinition\" type=\"MessageDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MessageDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this message definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the message definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"replaces\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A MessageDefinition that is superseded by this definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this message definition. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the message definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the message definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the message definition from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate message definition instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the message definition is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this message definition is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"base\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The MessageDefinition that is the basis for the contents of this resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parent\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies a protocol or workflow that this MessageDefinition represents a step in.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Event code or link to the EventDefinition.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"eventCoding\" type=\"Coding\"/>\r\n            <xs:element name=\"eventUri\" type=\"uri\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"MessageSignificanceCategory\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The impact of the content of the message.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"focus\" type=\"MessageDefinition.Focus\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the resource (or resources) that are being addressed by the event.  For example, the Encounter for an admit message or two Account records for a merge.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"responseRequired\" minOccurs=\"0\" maxOccurs=\"1\" type=\"messageheaderResponseRequest\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Declare at a message definition level whether a response is required or only upon error or success, or never.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"allowedResponse\" type=\"MessageDefinition.AllowedResponse\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates what types of messages may be sent as an application-level response to this message.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"graph\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a [[[GraphDefinition]]] that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MessageDefinition.Focus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of resource that must be the focus for this message.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A profile that reflects constraints for the focal resource (and potentially for related resources).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"min\" minOccurs=\"1\" maxOccurs=\"1\" type=\"unsignedInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"max\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MessageDefinition.AllowedResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"message\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the message definition that must be adhered to by this supported response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"situation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"MessageSignificanceCategory-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"consequence\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Consequence</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"currency\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Currency</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"notification\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Notification</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"MessageSignificanceCategory\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The impact of the content of a message.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"MessageSignificanceCategory-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"messageheaderResponseRequest-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"always\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Always</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Error/reject conditions only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"never\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Never</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-success\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Successful completion only</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"messageheaderResponseRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">HL7-defined table of codes which identify conditions under which acknowledgments are required to be returned in response to a message.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"messageheaderResponseRequest-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MessageHeader\" type=\"MessageHeader\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MessageHeader\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value &quot;http://terminology.hl7.org/CodeSystem/message-events&quot;.  Alternatively uri to the EventDefinition.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"eventCoding\" type=\"Coding\"/>\r\n            <xs:element name=\"eventUri\" type=\"uri\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"destination\" type=\"MessageHeader.Destination\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The destination application which the message is intended for.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the sending system to allow the use of a trust relationship.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"enterer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person or device that performed the data entry leading to this message. When there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The logical author of the message - the person or device that decided the described event should happen. When there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" type=\"MessageHeader.Source\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The source application from which this message originated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"responsible\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Coded indication of the cause for the event - indicates  a reason for the occurrence of the event that is a focus of this message.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"response\" type=\"MessageHeader.Response\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the message that this message is a response to.  Only present if this message is a response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"focus\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual data of the message - a reference to the root/focus class of the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Permanent link to the MessageDefinition for this message.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MessageHeader.Destination\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-readable name for the target system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"target\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the target end system in situations where the initial message transmission is to an intermediary system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endpoint\" minOccurs=\"1\" maxOccurs=\"1\" type=\"url\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates where the message should be routed to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"receiver\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MessageHeader.Source\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-readable name for the source system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"software\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">May include configuration or other information useful in debugging.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Can convey versions of multiple systems in situations where a message passes through multiple hands.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An e-mail, phone, website or other contact point to use to resolve issues with message communications.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endpoint\" minOccurs=\"1\" maxOccurs=\"1\" type=\"url\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the routing target to send acknowledgements to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MessageHeader.Response\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The MessageHeader.id of the message to which this message is a response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ResponseType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"details\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Full details of any issues found in the message.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ResponseType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"ok\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">OK</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"transient-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Transient Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"fatal-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Fatal Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ResponseType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The kind of response to a message.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ResponseType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"MolecularSequence\" type=\"MolecularSequence\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MolecularSequence\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier for this particular sequence instance. This is a FHIR-defined id.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"sequenceType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Amino Acid Sequence/ DNA Sequence / RNA Sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"coordinateSystem\" minOccurs=\"1\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient whose sequencing results are described by this resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specimen\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specimen used for sequencing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"device\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The method for sequencing, for example, chip information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization or lab that should be responsible for this result.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of copies of the sequence of interest. (RNASeq).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referenceSeq\" type=\"MolecularSequence.ReferenceSeq\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A sequence that is used as a reference to describe variants that are present in a sequence analyzed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"variant\" type=\"MolecularSequence.Variant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The definition of variant here originates from Sequence ontology ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). This element can represent amino acid or nucleic sequence change(including insertion,deletion,SNP,etc.)  It can represent some complex mutation or segment variation with the assist of CIGAR string.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"observedSeq\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall start from referenceSeq.windowStart and end by referenceSeq.windowEnd.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quality\" type=\"MolecularSequence.Quality\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An experimental feature attribute that defines the quality of the feature in a quantitative way, such as a phred quality score ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686)).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"readCoverage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"repository\" type=\"MolecularSequence.Repository\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"pointer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Pointer to next atomic sequence which at most contains one variant.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"structureVariant\" type=\"MolecularSequence.StructureVariant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about chromosome structure variation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MolecularSequence.ReferenceSeq\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"chromosome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"genomeBuild\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'.  Version number must be included if a versioned release of a primary build was used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"orientation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"orientationType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the &quot;sense&quot; strand, and the opposite complementary strand is the &quot;antisense&quot; strand.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referenceSeqId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference identifier of reference sequence submitted to NCBI. It must match the type in the MolecularSequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referenceSeqPointer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A pointer to another MolecularSequence entity as reference sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referenceSeqString\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A string like &quot;ACGT&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"strand\" minOccurs=\"0\" maxOccurs=\"1\" type=\"strandType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"windowStart\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"windowEnd\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">End position of the window on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MolecularSequence.Variant\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Start position of the variant on the  reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">End position of the variant on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"observedAllele\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).  Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed  sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referenceAllele\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cigar\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"variantPointer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A pointer to an Observation containing variant information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MolecularSequence.Quality\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"qualityType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">INDEL / SNP / Undefined variant.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"standardSequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Gold standard sequence used for comparing against.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">End position of the sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"score\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Which method is used to get sequence quality.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"truthTP\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">True positives, from the perspective of the truth data, i.e. the number of sites in the Truth Call Set for which there are paths through the Query Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"queryTP\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">True positives, from the perspective of the query data, i.e. the number of sites in the Query Call Set for which there are paths through the Truth Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"truthFN\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">False negatives, i.e. the number of sites in the Truth Call Set for which there is no path through the Query Call Set that is consistent with all of the alleles at this site, or sites for which there is an inaccurate genotype call for the event. Sites with correct variant but incorrect genotype are counted here.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"queryFP\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">False positives, i.e. the number of sites in the Query Call Set for which there is no path through the Truth Call Set that is consistent with this site. Sites with correct variant but incorrect genotype are counted here.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"gtFP\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of false positives where the non-REF alleles in the Truth and Query Call Sets match (i.e. cases where the truth is 1/1 and the query is 0/1 or similar).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"precision\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">QUERY.TP / (QUERY.TP + QUERY.FP).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recall\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">TRUTH.TP / (TRUTH.TP + TRUTH.FN).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fScore\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"roc\" type=\"MolecularSequence.Roc\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Receiver Operator Characteristic (ROC) Curve  to give sensitivity/specificity tradeoff.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MolecularSequence.Roc\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"score\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Invidual data point representing the GQ (genotype quality) score threshold.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numTP\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of true positives if the GQ score threshold was set to &quot;score&quot; field value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numFP\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of false positives if the GQ score threshold was set to &quot;score&quot; field value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numFN\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of false negatives if the GQ score threshold was set to &quot;score&quot; field value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"precision\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Calculated precision if the GQ score threshold was set to &quot;score&quot; field value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sensitivity\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Calculated sensitivity if the GQ score threshold was set to &quot;score&quot; field value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fMeasure\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Calculated fScore if the GQ score threshold was set to &quot;score&quot; field value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MolecularSequence.Repository\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"repositoryType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">URI of an external repository which contains further details about the genetics data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">URI of an external repository which contains further details about the genetics data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"datasetId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"variantsetId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"readsetId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id of the read in this external repository.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MolecularSequence.StructureVariant\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"variantType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about chromosome structure variation DNA change type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exact\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used to indicate if the outer and inner start-end values have the same meaning.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"length\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Length of the variant chromosome.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outer\" type=\"MolecularSequence.Outer\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Structural variant outer.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"inner\" type=\"MolecularSequence.Inner\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Structural variant inner.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MolecularSequence.Outer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Structural variant outer start. If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Structural variant outer end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MolecularSequence.Inner\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Structural variant inner start. If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Structural variant inner end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"strandType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"watson\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Watson strand of referenceSeq</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"crick\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Crick strand of referenceSeq</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"strandType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Type for strand.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"strandType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"orientationType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"sense\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Sense orientation of referenceSeq</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"antisense\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Antisense orientation of referenceSeq</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"orientationType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Type for orientation.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"orientationType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"repositoryType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"directlink\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Click and see</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"openapi\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">The URL is the RESTful or other kind of API that can access to the result.</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"login\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Result cannot be access unless an account is logged in</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"oauth\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Result need to be fetched with API and need LOGIN( or cookies are required when visiting the link of resource)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"other\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Some other complicated or particular way to get resource from URL.</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"repositoryType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Type for access of external URI.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"repositoryType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"qualityType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"indel\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">INDEL Comparison</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"snp\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SNP Comparison</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">UNKNOWN Comparison</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"qualityType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Type for quality report.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"qualityType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"sequenceType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"aa\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">AA Sequence</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"dna\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DNA Sequence</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"rna\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">RNA Sequence</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"sequenceType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Type if a sequence -- DNA, RNA, or amino acid sequence.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"sequenceType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"NamingSystem\" type=\"NamingSystem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a &quot;System&quot; used within the Identifier and Coding data types.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"NamingSystem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a &quot;System&quot; used within the Identifier and Coding data types.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the naming system. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this naming system. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"NamingSystemType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the purpose for the naming system - what kinds of things does it make unique?</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the naming system was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the naming system changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the naming system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"responsible\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Categorizes a naming system for easier search by grouping related naming systems.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the naming system from a consumer's perspective. Details about what the namespace identifies including scope, granularity, version labeling, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate naming system instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the naming system is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"uniqueId\" type=\"NamingSystem.UniqueId\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how the system may be identified when referenced in electronic exchange.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"NamingSystem.UniqueId\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a &quot;System&quot; used within the Identifier and Coding data types.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"NamingSystemIdentifierType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the unique identifier scheme used for this particular identifier.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The string that should be sent over the wire to identify the code system or identifier system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preferred\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether this identifier is the &quot;preferred&quot; identifier of this type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Notes about the past or intended usage of this identifier.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the period of time over which this identifier is considered appropriate to refer to the naming system.  Outside of this window, the identifier might be non-deterministic.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"NamingSystemIdentifierType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"oid\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">OID</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"uuid\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">UUID</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"uri\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">URI</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"other\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Other</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"NamingSystemIdentifierType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Identifies the style of unique identifier used to identify a namespace.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"NamingSystemIdentifierType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"NamingSystemType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"codesystem\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Code System</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"identifier\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Identifier</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"root\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Root</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"NamingSystemType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Identifies the purpose of the naming system.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"NamingSystemType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"NutritionOrder\" type=\"NutritionOrder\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"NutritionOrder\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this order by the order sender or by the order receiver.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this NutritionOrder.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this NutritionOrder.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiates\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to a protocol, guideline, orderset or other definition that is adhered to in whole or in part by this NutritionOrder.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The workflow status of the nutrition order/request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestIntent\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the level of authority/intentionality associated with the NutrionOrder and where the request fits into the workflow chain.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An encounter that provides additional information about the healthcare context in which this request is made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dateTime\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date and time that this nutrition order was requested.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"orderer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"allergyIntolerance\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A link to a record of allergies or intolerances  which should be included in the nutrition order.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"foodPreferenceModifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"excludeFoodModifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This modifier is used to convey Order-specific modifier about the type of oral food or oral fluids that should not be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or  Gluten-Free.  While it should not be necessary to repeat allergy or intolerance information captured in the referenced AllergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason.  This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"oralDiet\" type=\"NutritionOrder.OralDiet\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Diet given orally in contrast to enteral (tube) feeding.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supplement\" type=\"NutritionOrder.Supplement\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Oral nutritional products given in order to add further nutritional value to the patient's diet.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"enteralFormula\" type=\"NutritionOrder.EnteralFormula\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments made about the {{title}} by the requester, performer, subject or other participants.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"NutritionOrder.OralDiet\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"schedule\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Timing\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time period and frequency at which the diet should be given.  The diet should be given for the combination of all schedules if more than one schedule is present.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"nutrient\" type=\"NutritionOrder.Nutrient\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"texture\" type=\"NutritionOrder.Texture\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Class that describes any texture modifications required for the patient to safely consume various types of solid foods.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fluidConsistencyType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Free text or additional instructions or information pertaining to the oral diet.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"NutritionOrder.Nutrient\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The nutrient that is being modified such as carbohydrate or sodium.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity of the specified nutrient to include in diet.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"NutritionOrder.Texture\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"foodType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The food type(s) (e.g. meats, all foods)  that the texture modification applies to.  This could be all foods types.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"NutritionOrder.Supplement\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"productName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The product or brand name of the nutritional supplement such as &quot;Acme Protein Shake&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"schedule\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Timing\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time period and frequency at which the supplement(s) should be given.  The supplement should be given for the combination of all schedules if more than one schedule is present.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount of the nutritional supplement to be given.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Free text or additional instructions or information pertaining to the oral supplement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"NutritionOrder.EnteralFormula\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"baseFormulaType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"baseFormulaProductName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The product or brand name of the enteral or infant formula product such as &quot;ACME Adult Standard Formula&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"additiveType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"additiveProductName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The product or brand name of the type of modular component to be added to the formula.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"caloricDensity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount of energy (calories) that the formula should provide per specified volume, typically per mL or fluid oz.  For example, an infant may require a formula that provides 24 calories per fluid ounce or an adult may require an enteral formula that provides 1.5 calorie/mL.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"routeofAdministration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The route or physiological path of administration into the patient's gastrointestinal  tract for purposes of providing the formula feeding, e.g. nasogastric tube.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"administration\" type=\"NutritionOrder.Administration\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Formula administration instructions as structured data.  This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding.  An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maxVolumeToDeliver\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"administrationInstruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Free text formula administration, feeding instructions or additional instructions or information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"NutritionOrder.Administration\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"schedule\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Timing\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time period and frequency at which the enteral formula should be delivered to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The volume of formula to provide to the patient per the specified administration schedule.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"rateQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"rateRatio\" type=\"Ratio\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Observation\" type=\"Observation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Observation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this observation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A plan, proposal or order that is fulfilled in whole or in part by this event.  For example, a MedicationRequest may require a patient to have laboratory test performed before  it is dispensed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A larger event of which this particular Observation is a component or step.  For example,  an observation as part of a procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ObservationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the result value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that classifies the general type of observation being made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes what was observed. Sometimes this is called the observation &quot;name&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient, or group of patients, location, or device this observation is about and into whose record the observation is placed. If the actual focus of the observation is different from the subject (or a sample of, part, or region of the subject), the `focus` element or the `code` itself specifies the actual focus of the observation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"focus\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record.  The focus of an observation could also be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the &quot;physiologically relevant time&quot;. This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"effectiveDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"effectivePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"effectiveTiming\" type=\"Timing\"/>\r\n            <xs:element name=\"effectiveInstant\" type=\"instant\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"issued\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who was responsible for asserting the observed value as &quot;true&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The information determined as a result of making the observation, if the information has a simple value.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"valueRange\" type=\"Range\"/>\r\n            <xs:element name=\"valueRatio\" type=\"Ratio\"/>\r\n            <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\r\n            <xs:element name=\"valueTime\" type=\"time\"/>\r\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"valuePeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"dataAbsentReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides a reason why the expected value in the element Observation.value[x] is missing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"interpretation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A categorical assessment of an observation value.  For example, high, low, normal.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments about the observation or the results.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the site on the subject's body where the observation was made (i.e. the target site).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the mechanism used to perform the observation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specimen\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specimen that was used when this observation was made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"device\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The device used to generate the observation data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referenceRange\" type=\"Observation.ReferenceRange\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Guidance on how to interpret the value by comparison to a normal or recommended range.  Multiple reference ranges are interpreted as an &quot;OR&quot;.   In other words, to represent two distinct target populations, two `referenceRange` elements would be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"hasMember\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"derivedFrom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"component\" type=\"Observation.Component\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Some observations have multiple component observations.  These component observations are expressed as separate code value pairs that share the same attributes.  Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Observation.ReferenceRange\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"low\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the low bound of the reference range.  The low bound of the reference range endpoint is inclusive of the value (e.g.  reference range is &gt;=5 - &lt;=9). If the low bound is omitted,  it is assumed to be meaningless (e.g. reference range is &lt;=2.3).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"high\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the high bound of the reference range.  The high bound of the reference range endpoint is inclusive of the value (e.g.  reference range is &gt;=5 - &lt;=9). If the high bound is omitted,  it is assumed to be meaningless (e.g. reference range is &gt;= 2.3).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"appliesTo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Codes to indicate the target population this reference range applies to.  For example, a reference range may be based on the normal population or a particular sex or race.  Multiple `appliesTo`  are interpreted as an &quot;AND&quot; of the target populations.  For example, to represent a target population of African American females, both a code of female and a code for African American would be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"age\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Range\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of &quot;Negative&quot; or a list or table of &quot;normals&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Observation.Component\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes what was observed. Sometimes this is called the observation &quot;code&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The information determined as a result of making the observation, if the information has a simple value.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"valueRange\" type=\"Range\"/>\r\n            <xs:element name=\"valueRatio\" type=\"Ratio\"/>\r\n            <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\r\n            <xs:element name=\"valueTime\" type=\"time\"/>\r\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"valuePeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"dataAbsentReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides a reason why the expected value in the element Observation.component.value[x] is missing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"interpretation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A categorical assessment of an observation value.  For example, high, low, normal.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referenceRange\" type=\"Observation.ReferenceRange\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Guidance on how to interpret the value by comparison to a normal or recommended range.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ObservationDefinition\" type=\"ObservationDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ObservationDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that classifies the general type of observation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes what will be observed. Sometimes this is called the observation &quot;name&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this ObservationDefinition artifact.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"permittedDataType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ObservationDataType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The data types allowed for the value element of the instance observations conforming to this ObservationDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"multipleResultsAllowed\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Multiple results allowed for observations conforming to this ObservationDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The method or technique used to perform the observation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preferredReportName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantitativeDetails\" type=\"ObservationDefinition.QuantitativeDetails\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Characteristics for quantitative results of this observation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"qualifiedInterval\" type=\"ObservationDefinition.QualifiedInterval\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Multiple  ranges of results qualified by different contexts for ordinal or continuous observations conforming to this ObservationDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validCodedValueSet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The set of valid coded results for the observations  conforming to this ObservationDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"normalCodedValueSet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The set of normal coded results for the observations conforming to this ObservationDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"abnormalCodedValueSet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The set of abnormal coded results for the observation conforming to this ObservationDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"criticalCodedValueSet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The set of critical coded results for the observation conforming to this ObservationDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ObservationDefinition.QuantitativeDetails\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"customaryUnit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Customary unit used to report quantitative results of observations conforming to this ObservationDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">SI unit used to report quantitative results of observations conforming to this ObservationDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"conversionFactor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Factor for converting value expressed with SI unit to value expressed with customary unit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"decimalPrecision\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number of digits after decimal separator when the results of such observations are of type Quantity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ObservationDefinition.QualifiedInterval\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ObservationRangeCategory\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The category of interval of values for continuous or ordinal observations conforming to this ObservationDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"range\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Range\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The low and high values determining the interval. There may be only one of the two.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Codes to indicate the health context the range applies to. For example, the normal or therapeutic range.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"appliesTo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Codes to indicate the target population this reference range applies to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"gender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AdministrativeGender\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Sex of the population the range applies to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"age\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Range\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"gestationalAge\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Range\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The gestational age to which this reference range is applicable, in the context of pregnancy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"condition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Text based condition for which the reference range is valid.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ObservationDataType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"Quantity\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Quantity</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"CodeableConcept\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">CodeableConcept</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"string\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">string</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"boolean\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">boolean</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"integer\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">integer</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Range\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Range</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Ratio\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Ratio</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"SampledData\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SampledData</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"time\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">time</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"dateTime\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">dateTime</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"Period\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Period</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ObservationDataType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Permitted data type for observation value.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ObservationDataType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ObservationRangeCategory-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"reference\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">reference range</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"critical\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">critical range</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"absolute\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">absolute range</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ObservationRangeCategory\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Codes identifying the category of observation range.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ObservationRangeCategory-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"OperationDefinition\" type=\"OperationDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"OperationDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this operation definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this operation definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the operation definition is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the operation definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the operation definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the operation definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the operation definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this operation definition. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"OperationKind\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this is an operation or a named query.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this operation definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the operation definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the operation definition changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the operation definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the operation definition from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate operation definition instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the operation definition is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this operation definition is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"affectsState\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the operation affects state. Side effects such as producing audit trail entries do not count as 'affecting  state'.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name used to invoke the operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information about how to use this operation or named query.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"base\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates that this operation definition is a constraining profile on the base.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The types on which this operation can be executed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"system\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a specific resource id for the context).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instance\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether this operation can be invoked on a particular instance of one of the given types.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"inputProfile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional validation information for the in parameters - a single profile that covers all the parameters. The profile is a constraint on the parameters resource as a whole.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outputProfile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional validation information for the out parameters - a single profile that covers all the parameters. The profile is a constraint on the parameters resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parameter\" type=\"OperationDefinition.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The parameters for the operation/query.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"overload\" type=\"OperationDefinition.Overload\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines an appropriate combination of parameters to use when invoking this operation, to help code generators when generating overloaded parameter sets for this operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"OperationDefinition.Parameter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of used to identify the parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"use\" minOccurs=\"1\" maxOccurs=\"1\" type=\"OperationParameterUse\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this is an input or an output parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"min\" minOccurs=\"1\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The minimum number of times this parameter SHALL appear in the request or response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"max\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum number of times this element is permitted to appear in the request or response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the meaning or use of this parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type for this parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"targetProfile\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used when the type is &quot;Reference&quot; or &quot;canonical&quot;, and identifies a profile structure or implementation Guide that applies to the target of the reference this parameter refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"searchType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SearchParamType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"binding\" type=\"OperationDefinition.Binding\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Binds to a value set if this parameter is coded (code, Coding, CodeableConcept).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referencedFrom\" type=\"OperationDefinition.ReferencedFrom\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies other resource parameters within the operation invocation that are expected to resolve to this resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"part\" type=\"OperationDefinition.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The parts of a nested Parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"OperationDefinition.Binding\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"strength\" minOccurs=\"1\" maxOccurs=\"1\" type=\"BindingStrength\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"valueSet\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"OperationDefinition.ReferencedFrom\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"source\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the parameter or dot-separated path of parameter names pointing to the resource parameter that is expected to contain a reference to this resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sourceId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The id of the element in the referencing resource that is expected to resolve to this resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"OperationDefinition.Overload\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"parameterName\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name of parameter to include in overload.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments to go on overload.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"OperationParameterUse-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"in\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"out\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Out</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"OperationParameterUse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Whether an operation parameter is an input or an output parameter.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"OperationParameterUse-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"OperationKind-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"operation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Operation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"query\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Query</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"OperationKind\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Whether an operation is a normal operation or a query.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"OperationKind-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"OperationOutcome\" type=\"OperationOutcome\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A collection of error, warning, or information messages that result from a system action.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"OperationOutcome\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A collection of error, warning, or information messages that result from a system action.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"issue\" type=\"OperationOutcome.Issue\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An error, warning, or information message that results from a system action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"OperationOutcome.Issue\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A collection of error, warning, or information messages that result from a system action.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"severity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"IssueSeverity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether the issue indicates a variation from successful processing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"IssueType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"details\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional details about the error. This may be a text description of the error or a system code that identifies the error.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"diagnostics\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional diagnostic information about the issue.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This element is deprecated because it is XML specific. It is replaced by issue.expression, which is format independent, and simpler to parse. \n\nFor resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child accessor that identifies one of the elements in the resource that caused this issue to be raised.  For HTTP errors, will be &quot;http.&quot; + the parameter name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A [simple subset of FHIRPath](fhirpath.html#simple) limited to element names, repetition indicators and the default child accessor that identifies one of the elements in the resource that caused this issue to be raised.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"IssueType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"invalid\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Invalid Content</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"structure\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Structural Issue</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"required\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Required element missing</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"value\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Element value invalid</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"invariant\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Validation rule failed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"security\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Security Problem</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"login\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Login Required</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown User</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"expired\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Session Expired</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"forbidden\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Forbidden</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"suppressed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Information  Suppressed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"processing\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Processing Failure</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"not-supported\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Content not supported</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"duplicate\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Duplicate</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"multiple-matches\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Multiple Matches</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"not-found\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not Found</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"deleted\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Deleted</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"too-long\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Content Too Long</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"code-invalid\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Invalid Code</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"extension\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unacceptable Extension</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"too-costly\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Operation Too Costly</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"business-rule\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Business Rule Violation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"conflict\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Edit Version Conflict</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"transient\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Transient Issue</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"lock-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Lock Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"no-store\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">No Store Available</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"exception\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Exception</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"timeout\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Timeout</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"incomplete\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Incomplete Results</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"throttled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Throttled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"informational\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Informational Note</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"IssueType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A code that describes the type of issue.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"IssueType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"IssueSeverity-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"fatal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Fatal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"warning\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Warning</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"information\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Information</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"IssueSeverity\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How the issue affects the success of the action.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"IssueSeverity-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Organization\" type=\"Organization\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Organization\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for the organization that is used to identify the organization across multiple disparate systems.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the organization's record is still in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind(s) of organization that this is.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name associated with the organization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"alias\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A list of alternate names that the organization is known as, or was known as in the past.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A contact detail for the organization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Address\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An address for the organization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization of which this organization forms a part.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" type=\"Organization.Contact\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact for the organization for a certain purpose.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Technical endpoints providing access to services operated for the organization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Organization.Contact\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates a purpose for which the contact can be reached.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"HumanName\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name associated with the contact.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Address\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Visiting or postal addresses for the contact.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"OrganizationAffiliation\" type=\"OrganizationAffiliation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines an affiliation/assotiation/relationship between 2 distinct oganizations, that is not a part-of relationship/sub-division relationship.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"OrganizationAffiliation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines an affiliation/assotiation/relationship between 2 distinct oganizations, that is not a part-of relationship/sub-division relationship.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers that are specific to this role.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this organization affiliation record is in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the participatingOrganization is affiliated with the primary organization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"organization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Organization where the role is available (primary organization/has members).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"participatingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Participating Organization provides/performs the role(s) defined by the code to the Primary Organization (e.g. providing services or is a member of).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Health insurance provider network in which the participatingOrganization provides the role's services (if defined) at the indicated locations (if defined).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Definition of the role the participatingOrganization plays in the association.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific specialty of the participatingOrganization in the context of the role.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The location(s) at which the role occurs.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"healthcareService\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Healthcare services provided through the role.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details at the participatingOrganization relevant to this Affiliation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Technical endpoints providing access to services operated for this role.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Parameters\" type=\"Parameters\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Parameters\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Resource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"parameter\" type=\"Parameters.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A parameter passed to or received from the operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Parameters.Parameter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the parameter (reference to the operation definition).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the parameter is a data type.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueCanonical\" type=\"canonical\"/>\r\n            <xs:element name=\"valueCode\" type=\"code\"/>\r\n            <xs:element name=\"valueDate\" type=\"date\"/>\r\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\r\n            <xs:element name=\"valueId\" type=\"id\"/>\r\n            <xs:element name=\"valueInstant\" type=\"instant\"/>\r\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"valueMarkdown\" type=\"markdown\"/>\r\n            <xs:element name=\"valueOid\" type=\"oid\"/>\r\n            <xs:element name=\"valuePositiveInt\" type=\"positiveInt\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueTime\" type=\"time\"/>\r\n            <xs:element name=\"valueUnsignedInt\" type=\"unsignedInt\"/>\r\n            <xs:element name=\"valueUri\" type=\"uri\"/>\r\n            <xs:element name=\"valueUrl\" type=\"url\"/>\r\n            <xs:element name=\"valueUuid\" type=\"uuid\"/>\r\n            <xs:element name=\"valueAddress\" type=\"Address\"/>\r\n            <xs:element name=\"valueAge\" type=\"Age\"/>\r\n            <xs:element name=\"valueAnnotation\" type=\"Annotation\"/>\r\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\r\n            <xs:element name=\"valueContactPoint\" type=\"ContactPoint\"/>\r\n            <xs:element name=\"valueCount\" type=\"Count\"/>\r\n            <xs:element name=\"valueDistance\" type=\"Distance\"/>\r\n            <xs:element name=\"valueDuration\" type=\"Duration\"/>\r\n            <xs:element name=\"valueHumanName\" type=\"HumanName\"/>\r\n            <xs:element name=\"valueIdentifier\" type=\"Identifier\"/>\r\n            <xs:element name=\"valueMoney\" type=\"Money\"/>\r\n            <xs:element name=\"valuePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueRange\" type=\"Range\"/>\r\n            <xs:element name=\"valueRatio\" type=\"Ratio\"/>\r\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\r\n            <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\r\n            <xs:element name=\"valueSignature\" type=\"Signature\"/>\r\n            <xs:element name=\"valueTiming\" type=\"Timing\"/>\r\n            <xs:element name=\"valueContactDetail\" type=\"ContactDetail\"/>\r\n            <xs:element name=\"valueContributor\" type=\"Contributor\"/>\r\n            <xs:element name=\"valueDataRequirement\" type=\"DataRequirement\"/>\r\n            <xs:element name=\"valueExpression\" type=\"Expression\"/>\r\n            <xs:element name=\"valueParameterDefinition\" type=\"ParameterDefinition\"/>\r\n            <xs:element name=\"valueRelatedArtifact\" type=\"RelatedArtifact\"/>\r\n            <xs:element name=\"valueTriggerDefinition\" type=\"TriggerDefinition\"/>\r\n            <xs:element name=\"valueUsageContext\" type=\"UsageContext\"/>\r\n            <xs:element name=\"valueDosage\" type=\"Dosage\"/>\r\n            <xs:element name=\"valueMeta\" type=\"Meta\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ResourceContainer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the parameter is a whole resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"part\" type=\"Parameters.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A named part of a multi-part parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Patient\" type=\"Patient\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Patient\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier for this patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this patient record is in active use. \nMany systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.\n\nIt is often used to filter patient lists to exclude inactive patients\n\nDeceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"HumanName\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name associated with the individual.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"gender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AdministrativeGender\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"birthDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date of birth for the individual.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates if the individual is deceased or not.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"deceasedBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"deceasedDateTime\" type=\"dateTime\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Address\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An address for the individual.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maritalStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This field contains a patient's most recent marital (civil) status.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"multipleBirthBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"multipleBirthInteger\" type=\"integer\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"photo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Image of the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" type=\"Patient.Contact\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A contact party (e.g. guardian, partner, friend) for the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"communication\" type=\"Patient.Communication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A language which may be used to communicate with the patient about his or her health.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"generalPractitioner\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Patient's nominated care provider.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"managingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Organization that is the custodian of the patient record.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"link\" type=\"Patient.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Link to another patient resource that concerns the same actual patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Patient.Contact\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The nature of the relationship between the patient and the contact person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"HumanName\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name associated with the contact person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Address\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Address for the contact person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"gender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AdministrativeGender\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"organization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Organization on behalf of which the contact is acting or for which the contact is working.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which this contact person or organization is valid to be contacted relating to this patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Patient.Communication\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"language\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. &quot;en&quot; for English, or &quot;en-US&quot; for American English versus &quot;en-EN&quot; for England English.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preferred\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Patient.Link\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"other\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The other patient resource that the link refers to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"LinkType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of link between this patient resource and another patient resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"LinkType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"replaced-by\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Replaced-by</xs:documentation>\r\n          <xs:documentation xml:lang=\"nl\">Vervangen door</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"replaces\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Replaces</xs:documentation>\r\n          <xs:documentation xml:lang=\"nl\">Vervangt</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"refer\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Refer</xs:documentation>\r\n          <xs:documentation xml:lang=\"nl\">Verwijzing</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"seealso\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">See also</xs:documentation>\r\n          <xs:documentation xml:lang=\"nl\">Zie ook</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"LinkType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of link between this patient resource and another patient resource.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"LinkType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"PaymentNotice\" type=\"PaymentNotice\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the status of the payment for goods and services rendered, and the request and response resource references.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"PaymentNotice\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the status of the payment for goods and services rendered, and the request and response resource references.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this payment notice.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference of resource for which payment is being made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"response\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference of response to resource for which payment is being made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when this resource was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payment\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the payment which is the subject of this notice.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"paymentDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when the above payment action occurred.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payee\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party who will receive or has received payment that is the subject of this notification.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recipient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party who is notified of the payment status.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount sent to the payee.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"paymentStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code indicating whether payment has been sent or cleared.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"PaymentReconciliation\" type=\"PaymentReconciliation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the details including amount of a payment and allocates the payment items being paid.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"PaymentReconciliation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the details including amount of a payment and allocates the payment items being paid.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this payment reconciliation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period of time for which payments have been gathered into this bulk payment for settlement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when the resource was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"paymentIssuer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party who generated the payment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Original request resource reference.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requestor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RemittanceOutcome\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The outcome of a request for a reconciliation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"disposition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human readable description of the status of the request for the reconciliation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"paymentDate\" minOccurs=\"1\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date of payment as indicated on the financial instrument.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"paymentAmount\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Total payment amount as indicated on the financial instrument.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"paymentIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Issuer's unique identifier for the payment instrument.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" type=\"PaymentReconciliation.Detail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Distribution of the payment amount for a previously acknowledged payable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"formCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code for the form to be used for printing the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"processNote\" type=\"PaymentReconciliation.ProcessNote\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A note that describes or explains the processing in a human readable form.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"PaymentReconciliation.Detail\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the details including amount of a payment and allocates the payment items being paid.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique identifier for the current payment item for the referenced payable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"predecessor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique identifier for the prior payment item for the referenced payable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code to indicate the nature of the payment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A resource, such as a Claim, the evaluation of which could lead to payment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"submitter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party which submitted the claim or financial transaction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"response\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A resource, such as a ClaimResponse, which contains a commitment to payment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date from the response resource containing a commitment to pay.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"responsible\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the individual who is responsible for inquiries regarding the response and its payment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payee\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The party which is receiving the payment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The monetary amount allocated from the total payment to the payable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"PaymentReconciliation.ProcessNote\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource provides the details including amount of a payment and allocates the payment items being paid.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"NoteType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The business purpose of the note text.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The explanation or description associated with the processing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Person\" type=\"Person\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Demographics and administrative information about a person independent of a specific health-related context.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Person\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Demographics and administrative information about a person independent of a specific health-related context.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for a person within a particular scope.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"HumanName\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name associated with the person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"gender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AdministrativeGender\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Administrative Gender.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"birthDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The birth date for the person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Address\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">One or more addresses for the person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"photo\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"managingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization that is the custodian of the person record.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this person's record is in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"link\" type=\"Person.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Link to a resource that concerns the same actual person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Person.Link\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Demographics and administrative information about a person independent of a specific health-related context.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"target\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The resource to which this actual person is associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"assurance\" minOccurs=\"0\" maxOccurs=\"1\" type=\"IdentityAssuranceLevel\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Level of assurance that this link is associated with the target resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"IdentityAssuranceLevel-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"level1\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Level 1</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"level2\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Level 2</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"level3\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Level 3</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"level4\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Level 4</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"IdentityAssuranceLevel\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The level of confidence that this link represents the same actual person, based on NIST Authentication Levels.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"IdentityAssuranceLevel-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"PlanDefinition\" type=\"PlanDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"PlanDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this plan definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the plan definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the plan definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the plan definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the plan definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the plan definition giving additional information about its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A high-level category for the plan definition that distinguishes the kinds of systems that would be interested in the plan definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this plan definition. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this plan definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code or group definition that describes the intended subject of the plan definition.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the plan definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the plan definition changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the plan definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the plan definition from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate plan definition instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the plan definition is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this plan definition is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A detailed description of how the plan definition is used from a clinical perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the plan definition content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the plan definition. Topics provide a high-level categorization of the definition that can be useful for filtering and searching.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"library\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a Library resource containing any formal logic used by the plan definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"goal\" type=\"PlanDefinition.Goal\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Goals that describe what the activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"action\" type=\"PlanDefinition.Action\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An action or group of actions to be taken as part of the plan.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"PlanDefinition.Goal\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates a category the goal falls within.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-readable and/or coded description of a specific desired objective of care, such as &quot;control blood pressure&quot; or &quot;negotiate an obstacle course&quot; or &quot;dance with child at wedding&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the expected level of importance associated with reaching/sustaining the defined goal.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The event after which the goal should begin being pursued.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"addresses\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies problems, conditions, issues, or concerns the goal is intended to address.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Didactic or other informational resources associated with the goal that provide further supporting information about the goal. Information resources can include inline text commentary and links to web resources.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"target\" type=\"PlanDefinition.Target\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates what should be done and within what timeframe.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"PlanDefinition.Target\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"measure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The parameter whose value is to be tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"detailQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"detailRange\" type=\"Range\"/>\r\n            <xs:element name=\"detailCodeableConcept\" type=\"CodeableConcept\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"due\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the timeframe after the start of the goal in which the goal should be met.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"PlanDefinition.Action\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"prefix\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A user-visible prefix for the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The title of the action displayed to a user.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A brief description of the action used to provide a summary to display to the user.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"textEquivalent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that might not be capable of interpreting it dynamically.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the action should be addressed with respect to other actions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that provides meaning for the action or action group. For example, a section may have a LOINC code for the section of a documentation template.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of why this action is necessary or appropriate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"goalId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code or group definition that describes the intended subject of the action and its children, if any.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"trigger\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"TriggerDefinition\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of when the action should be triggered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"condition\" type=\"PlanDefinition.Condition\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An expression that describes applicability criteria or start/stop conditions for the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"input\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DataRequirement\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines input data requirements for the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"output\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DataRequirement\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines the outputs of the action, if any.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedAction\" type=\"PlanDefinition.RelatedAction\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A relationship to another action such as &quot;before&quot; or &quot;30-60 minutes after start of&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An optional value describing when the action should be performed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"timingDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"timingAge\" type=\"Age\"/>\r\n            <xs:element name=\"timingPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"timingDuration\" type=\"Duration\"/>\r\n            <xs:element name=\"timingRange\" type=\"Range\"/>\r\n            <xs:element name=\"timingTiming\" type=\"Timing\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"participant\" type=\"PlanDefinition.Participant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who should participate in performing the action described.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of action to perform (create, update, remove).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"groupingBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionGroupingBehavior\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines the grouping behavior for the action and its children.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"selectionBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionSelectionBehavior\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines the selection behavior for the action and its children.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requiredBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionRequiredBehavior\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines the required behavior for the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"precheckBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionPrecheckBehavior\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines whether the action should usually be preselected.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cardinalityBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionCardinalityBehavior\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines whether the action can be selected multiple times.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"definitionCanonical\" type=\"canonical\"/>\r\n            <xs:element name=\"definitionUri\" type=\"uri\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"transform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dynamicValue\" type=\"PlanDefinition.DynamicValue\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"action\" type=\"PlanDefinition.Action\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"PlanDefinition.Condition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ActionConditionKind\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of condition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Expression\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An expression that returns true or false, indicating whether the condition is satisfied.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"PlanDefinition.RelatedAction\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"actionId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The element id of the related action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relationship\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ActionRelationshipType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The relationship of this action to the related action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"offsetDuration\" type=\"Duration\"/>\r\n            <xs:element name=\"offsetRange\" type=\"Range\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"PlanDefinition.Participant\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ActionParticipantType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of participant in the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The role the participant should play in performing the described action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"PlanDefinition.DynamicValue\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"path\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Expression\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An expression specifying the value of the customized element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ActionRequiredBehavior-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"must\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Must</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"could\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Could</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"must-unless-documented\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Must Unless Documented</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ActionRequiredBehavior\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines expectations around whether an action or action group is required.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ActionRequiredBehavior-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ActionRelationshipType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"before-start\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Before Start</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"before\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Before</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"before-end\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Before End</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"concurrent-with-start\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Concurrent With Start</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"concurrent\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Concurrent</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"concurrent-with-end\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Concurrent With End</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"after-start\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">After Start</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"after\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">After</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"after-end\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">After End</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ActionRelationshipType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines the types of relationships between actions.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ActionRelationshipType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ActionGroupingBehavior-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"visual-group\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Visual Group</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"logical-group\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Logical Group</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"sentence-group\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Sentence Group</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ActionGroupingBehavior\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines organization behavior of a group.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ActionGroupingBehavior-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ActionSelectionBehavior-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"any\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Any</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"all\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">All</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"all-or-none\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">All Or None</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"exactly-one\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Exactly One</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"at-most-one\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">At Most One</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"one-or-more\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">One Or More</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ActionSelectionBehavior\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines selection behavior of a group.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ActionSelectionBehavior-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ActionCardinalityBehavior-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"single\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Single</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"multiple\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Multiple</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ActionCardinalityBehavior\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines behavior for an action or a group for how many times that item may be repeated.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ActionCardinalityBehavior-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ActionPrecheckBehavior-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"yes\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Yes</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"no\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">No</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ActionPrecheckBehavior\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines selection frequency behavior for an action or group.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ActionPrecheckBehavior-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ActionConditionKind-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"applicability\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Applicability</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"start\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Start</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"stop\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Stop</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ActionConditionKind\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines the kinds of conditions that can appear on actions.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ActionConditionKind-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Practitioner\" type=\"Practitioner\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A person who is directly or indirectly involved in the provisioning of healthcare.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Practitioner\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A person who is directly or indirectly involved in the provisioning of healthcare.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier that applies to this person in this role.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this practitioner's record is in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"HumanName\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name(s) associated with the practitioner.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A contact detail for the practitioner, e.g. a telephone number or an email address.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Address\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Address(es) of the practitioner that are not role specific (typically home address). \rWork addresses are not typically entered in this property as they are usually role dependent.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"gender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AdministrativeGender\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"birthDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date of birth for the practitioner.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"photo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Image of the person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"qualification\" type=\"Practitioner.Qualification\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The official certifications, training, and licenses that authorize or otherwise pertain to the provision of care by the practitioner.  For example, a medical license issued by a medical board authorizing the practitioner to practice medicine within a certian locality.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"communication\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A language the practitioner can use in patient communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Practitioner.Qualification\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A person who is directly or indirectly involved in the provisioning of healthcare.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier that applies to this person's qualification in this role.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Coded representation of the qualification.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Period during which the qualification is valid.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"issuer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Organization that regulates and issues the qualification.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"PractitionerRole\" type=\"PractitionerRole\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"PractitionerRole\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business Identifiers that are specific to a role/location.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this practitioner role record is in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the person is authorized to act as a practitioner in these role(s) for the organization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"practitioner\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Practitioner that is able to provide the defined services for the organization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"organization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization where the Practitioner performs the roles associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Roles which this practitioner is authorized to perform for the organization.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific specialty of the practitioner.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The location(s) at which this practitioner provides care.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"healthcareService\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The list of healthcare services that this worker provides for this role's Organization/Location(s).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details that are specific to the role/location/service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"availableTime\" type=\"PractitionerRole.AvailableTime\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A collection of times the practitioner is available or performing this role at the location and/or healthcareservice.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"notAvailable\" type=\"PractitionerRole.NotAvailable\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The practitioner is not available or performing this role during this period of time due to the provided reason.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"availabilityExceptions\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Technical endpoints providing access to services operated for the practitioner with this role.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"PractitionerRole.AvailableTime\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"daysOfWeek\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DaysOfWeek\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates which days of the week are available between the start and end Times.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"allDay\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Is this always available? (hence times are irrelevant) e.g. 24 hour service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"availableStartTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"time\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The opening time of day. Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"availableEndTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"time\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The closing time of day. Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"PractitionerRole.NotAvailable\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reason that can be presented to the user as to why this time is not available.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"during\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Service is not available (seasonally or for a public holiday) from this date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Procedure\" type=\"Procedure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Procedure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this procedure by the performer or other systems which remain constant as the resource is updated and is propagated from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, order set or other definition that is adhered to in whole or in part by this Procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, order set or other definition that is adhered to in whole or in part by this Procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a resource that contains details of the request for this procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A larger event of which this particular procedure is a component or step.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EventStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code specifying the state of the procedure. Generally, this will be the in-progress or completed state.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current state of the procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that classifies the procedure for searching, sorting and display purposes (e.g. &quot;Surgical Procedure&quot;).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. &quot;Laparoscopic Appendectomy&quot;).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person, animal or group on which the procedure was performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Encounter during which this Procedure was created or performed or to which the creation of this record is tightly associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"performedDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"performedPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"performedString\" type=\"string\"/>\r\n            <xs:element name=\"performedAge\" type=\"Age\"/>\r\n            <xs:element name=\"performedRange\" type=\"Range\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"recorder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Individual who recorded the record and takes responsibility for its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"asserter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Individual who is making the procedure statement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" type=\"Procedure.Performer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Limited to &quot;real&quot; people rather than equipment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The coded reason why the procedure was performed. This may be a coded entity of some type, or may simply be present as text.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The justification of why the procedure was performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The outcome of the procedure - did it resolve the reasons for the procedure being performed?</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"report\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This could be a histology result, pathology report, surgical report, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"complication\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"complicationDetail\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Any complications that occurred during the procedure, or in the immediate post-performance period.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"followUp\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the procedure required specific follow up - e.g. removal of sutures. The follow up may be represented as a simple note or could potentially be more complex, in which case the CarePlan resource can be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Any other notes and comments about the procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"focalDevice\" type=\"Procedure.FocalDevice\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"usedReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies medications, devices and any other substance used as part of the procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"usedCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies coded items that were used as part of the procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Procedure.Performer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"function\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Distinguishes the type of involvement of the performer in the procedure. For example, surgeon, anaesthetist, endoscopist.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The practitioner who was involved in the procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"onBehalfOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organization the device or practitioner was acting on behalf of.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Procedure.FocalDevice\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"action\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of change that happened to the device during the procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"manipulated\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The device that was manipulated (changed) during the procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Provenance\" type=\"Provenance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Provenance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"target\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the activity occurred.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"occurredPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"occurredDateTime\" type=\"dateTime\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"recorded\" minOccurs=\"1\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The instant of time at which the activity was recorded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"policy\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where the activity occurred, if relevant.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reason that the activity was taking place.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"activity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"agent\" type=\"Provenance.Agent\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An actor taking a role in an activity  for which it can be assigned some degree of responsibility for the activity taking place.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"entity\" type=\"Provenance.Entity\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An entity used in this activity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"signature\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Signature\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Provenance.Agent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The participation the agent had with respect to the activity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The function of the agent with respect to the activity. The security role enabling the agent with respect to the activity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"who\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual, device or organization that participated in the event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"onBehalfOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual, device, or organization for whom the change was made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Provenance.Entity\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"role\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ProvenanceEntityRole\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the entity was used during the activity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"what\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"agent\" type=\"Provenance.Agent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ProvenanceEntityRole-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"derivation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Derivation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"revision\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Revision</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"quotation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Quotation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"source\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Source</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"removal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Removal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ProvenanceEntityRole\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How an entity was used in an activity.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ProvenanceEntityRole-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Questionnaire\" type=\"Questionnaire\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Questionnaire\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this questionnaire is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the questionnaire is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the questionnaire.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"derivedFrom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL of a Questionnaire that this Questionnaire is based on.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this questionnaire. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subjectType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The types of subjects that can be the subject of responses created for the questionnaire.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the questionnaire was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the questionnaire.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the questionnaire from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate questionnaire instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the questionnaire is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this questionnaire is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the questionnaire content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier for this question or group of questions in a particular terminology such as LOINC.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" type=\"Questionnaire.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A particular question, question grouping or display text that is part of the questionnaire.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Questionnaire.Item\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"linkId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This element is a URI that refers to an [[[ElementDefinition]]] that provides information about this item, including information that might otherwise be included in the instance of the Questionnaire resource. A detailed description of the construction of the URI is shown in Comments, below. If this element is present then the following element values MAY be derived from the Element Definition if the corresponding elements of this Questionnaire resource instance have no value:\n\n* code (ElementDefinition.code) \n* type (ElementDefinition.type) \n* required (ElementDefinition.min) \n* repeats (ElementDefinition.max) \n* maxLength (ElementDefinition.maxLength) \n* answerValueSet (ElementDefinition.binding)\n* options (ElementDefinition.binding).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"prefix\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of a section, the text of a question or text content for a display item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"QuestionnaireItemType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"enableWhen\" type=\"Questionnaire.EnableWhen\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"enableBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"EnableWhenBehavior\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Controls how multiple enableWhen values are interpreted -  whether all or any must be true.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"required\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An indication, if true, that the item must be present in a &quot;completed&quot; QuestionnaireResponse.  If false, the item may be skipped when answering the questionnaire.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"repeats\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An indication, if true, that the item may occur multiple times in the response, collecting multiple answers for questions or multiple sets of answers for groups.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"readOnly\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maxLength\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum number of characters that are permitted in the answer to be considered a &quot;valid&quot; QuestionnaireResponse.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"answerValueSet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a value set containing a list of codes representing permitted answers for a &quot;choice&quot; or &quot;open-choice&quot; question.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"answerOption\" type=\"Questionnaire.AnswerOption\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">One of the permitted answers for a &quot;choice&quot; or &quot;open-choice&quot; question.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"initial\" type=\"Questionnaire.Initial\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" type=\"Questionnaire.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Text, questions and other groups to be nested beneath a question or group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Questionnaire.EnableWhen\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"question\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"operator\" minOccurs=\"1\" maxOccurs=\"1\" type=\"QuestionnaireItemOperator\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the criteria by which the question is enabled.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A value that the referenced question is tested using the specified operator in order for the item to be enabled.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"answerBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"answerDecimal\" type=\"decimal\"/>\r\n            <xs:element name=\"answerInteger\" type=\"integer\"/>\r\n            <xs:element name=\"answerDate\" type=\"date\"/>\r\n            <xs:element name=\"answerDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"answerTime\" type=\"time\"/>\r\n            <xs:element name=\"answerString\" type=\"string\"/>\r\n            <xs:element name=\"answerCoding\" type=\"Coding\"/>\r\n            <xs:element name=\"answerQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"answerReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Questionnaire.AnswerOption\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A potential answer that's allowed as the answer to this question.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"valueDate\" type=\"date\"/>\r\n            <xs:element name=\"valueTime\" type=\"time\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\r\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"initialSelected\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether the answer value is selected when the list of possible answers is initially shown.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Questionnaire.Initial\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual value to for an initial answer.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\r\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"valueDate\" type=\"date\"/>\r\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"valueTime\" type=\"time\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueUri\" type=\"uri\"/>\r\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"QuestionnaireItemType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"group\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Group</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"display\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Display</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"boolean\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Boolean</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"decimal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Decimal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"integer\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Integer</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"date\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Date</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"dateTime\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Date Time</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"time\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Time</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"string\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">String</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"text\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Text</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"url\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Url</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"choice\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Choice</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"open-choice\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Open Choice</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"attachment\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Attachment</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"reference\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Reference</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"quantity\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Quantity</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"QuestionnaireItemType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Distinguishes groups from questions and display text and indicates data type for questions.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"QuestionnaireItemType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"EnableWhenBehavior-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"all\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">All</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"any\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Any</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"EnableWhenBehavior\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Controls how multiple enableWhen values are interpreted -  whether all or any must be true.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"EnableWhenBehavior-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"QuestionnaireItemOperator-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"exists\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Exists</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"=\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Equals</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"!=\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not Equals</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"&gt;\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Greater Than</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"&lt;\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Less Than</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"&gt;=\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Greater or Equals</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"&lt;=\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Less or Equals</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"QuestionnaireItemOperator\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The criteria by which a question is enabled.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"QuestionnaireItemOperator-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"QuestionnaireResponse\" type=\"QuestionnaireResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"QuestionnaireResponse\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A business identifier assigned to a particular completed (or partially completed) questionnaire.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse.  For example, a ServiceRequest seeking an intake assessment or a decision support recommendation to assess for post-partum depression.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A procedure or observation that this questionnaire was performed as part of the execution of.  For example, the surgery a checklist was executed as part of.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"questionnaire\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Questionnaire that defines and organizes the questions for which answers are being provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"QuestionnaireResponseStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The position of the questionnaire response within its overall lifecycle.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The subject of the questionnaire response.  This could be a patient, organization, practitioner, device, etc.  This is who/what the answers apply to, but is not necessarily the source of information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Encounter during which this questionnaire response was created or to which the creation of this record is tightly associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authored\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date and/or time that this set of answers were last changed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person who answered the questions about the subject.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" type=\"QuestionnaireResponse.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A group or question item from the original questionnaire for which answers are provided.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"QuestionnaireResponse.Item\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"linkId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to an [[[ElementDefinition]]] that provides the details for the item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Text that is displayed above the contents of the group or as the text of the question being answered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"answer\" type=\"QuestionnaireResponse.Answer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The respondent's answer(s) to the question.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"item\" type=\"QuestionnaireResponse.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Questions or sub-groups nested beneath a question or group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"QuestionnaireResponse.Answer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The answer (or one of the answers) provided by the respondent to the question.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\r\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"valueDate\" type=\"date\"/>\r\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"valueTime\" type=\"time\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueUri\" type=\"uri\"/>\r\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"item\" type=\"QuestionnaireResponse.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Nested groups and/or questions found within this particular answer.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"QuestionnaireResponseStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"in-progress\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"amended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Amended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"stopped\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Stopped</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"QuestionnaireResponseStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Lifecycle status of the questionnaire response.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"QuestionnaireResponseStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"RelatedPerson\" type=\"RelatedPerson\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"RelatedPerson\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for a person within a particular scope.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this related person record is in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient this person is related to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The nature of the relationship between a patient and the related person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"HumanName\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name associated with the person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"gender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AdministrativeGender\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"birthDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the related person was born.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Address\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Address where the related person can be contacted or visited.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"photo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Image of the person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period of time during which this relationship is or was active. If there are no dates defined, then the interval is unknown.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"communication\" type=\"RelatedPerson.Communication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A language which may be used to communicate with about the patient's health.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"RelatedPerson.Communication\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"language\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. &quot;en&quot; for English, or &quot;en-US&quot; for American English versus &quot;en-EN&quot; for England English.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preferred\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"RequestGroup\" type=\"RequestGroup\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A group of related requests that can be used to capture intended activities that have inter-dependencies such as &quot;give this medication after that one&quot;.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"RequestGroup\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A group of related requests that can be used to capture intended activities that have inter-dependencies such as &quot;give this medication after that one&quot;.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Allows a service to provide a unique, business identifier for the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A canonical URL referencing a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A URL referencing an externally defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A plan, proposal or order that is fulfilled in whole or in part by this request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"replaces\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Completed or terminated request(s) whose function is taken by this new request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"groupIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The current state of the request. For request groups, the status reflects the status of all the requests in the group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestIntent\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the level of authority/intentionality associated with the request and where the request fits into the workflow chain.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the request should be addressed with respect to other requests.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that identifies what the overall request group is.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The subject for which the request group was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the context of the request group, if any.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates when the request group was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides a reference to the author of the request group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the reason for the request group in coded or textual form.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates another resource whose existence justifies this request group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Provides a mechanism to communicate additional information about the response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"action\" type=\"RequestGroup.Action\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actions, if any, produced by the evaluation of the artifact.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"RequestGroup.Action\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A group of related requests that can be used to capture intended activities that have inter-dependencies such as &quot;give this medication after that one&quot;.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"prefix\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A user-visible prefix for the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The title of the action displayed to a user.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short description of the action used to provide a summary to display to the user.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"textEquivalent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that might not be capable of interpreting it dynamically.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the action should be addressed with respect to other actions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that provides meaning for the action or action group. For example, a section may have a LOINC code for a section of a documentation template.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"condition\" type=\"RequestGroup.Condition\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An expression that describes applicability criteria, or start/stop conditions for the action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedAction\" type=\"RequestGroup.RelatedAction\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A relationship to another action such as &quot;before&quot; or &quot;30-60 minutes after start of&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An optional value describing when the action should be performed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"timingDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"timingAge\" type=\"Age\"/>\r\n            <xs:element name=\"timingPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"timingDuration\" type=\"Duration\"/>\r\n            <xs:element name=\"timingRange\" type=\"Range\"/>\r\n            <xs:element name=\"timingTiming\" type=\"Timing\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"participant\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The participant that should perform or be responsible for this action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of action to perform (create, update, remove).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"groupingBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionGroupingBehavior\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines the grouping behavior for the action and its children.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"selectionBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionSelectionBehavior\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines the selection behavior for the action and its children.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requiredBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionRequiredBehavior\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines expectations around whether an action is required.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"precheckBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionPrecheckBehavior\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines whether the action should usually be preselected.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cardinalityBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionCardinalityBehavior\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines whether the action can be selected multiple times.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The resource that is the target of the action (e.g. CommunicationRequest).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"action\" type=\"RequestGroup.Action\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Sub actions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"RequestGroup.Condition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A group of related requests that can be used to capture intended activities that have inter-dependencies such as &quot;give this medication after that one&quot;.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ActionConditionKind\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of condition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Expression\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An expression that returns true or false, indicating whether or not the condition is satisfied.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"RequestGroup.RelatedAction\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A group of related requests that can be used to capture intended activities that have inter-dependencies such as &quot;give this medication after that one&quot;.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"actionId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The element id of the action this is related to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relationship\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ActionRelationshipType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The relationship of this action to the related action.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"offsetDuration\" type=\"Duration\"/>\r\n            <xs:element name=\"offsetRange\" type=\"Range\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ResearchDefinition\" type=\"ResearchDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The ResearchDefinition resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ResearchDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The ResearchDefinition resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this research definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this research definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the research definition is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this research definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the research definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the research definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the research definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the research definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"shortTitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the ResearchDefinition giving additional information about its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this research definition. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this research definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The intended subjects for the ResearchDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchDefinition can be anything.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the research definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the research definition changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the research definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the research definition from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate research definition instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the research definition is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this research definition is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A detailed description, from a clinical perspective, of how the ResearchDefinition is used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the research definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the research definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the research definition content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the ResearchDefinition. Topics provide a high-level categorization grouping types of ResearchDefinitions that can be useful for filtering and searching.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"library\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a Library resource containing the formal logic used by the ResearchDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"population\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a ResearchElementDefinition resource that defines the population for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exposure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a ResearchElementDefinition resource that defines the exposure for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exposureAlternative\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a ResearchElementDefinition resource that defines the exposureAlternative for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a ResearchElementDefinition resomece that defines the outcome for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ResearchElementDefinition\" type=\"ResearchElementDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The ResearchElementDefinition resource describes a &quot;PICO&quot; element that knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ResearchElementDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The ResearchElementDefinition resource describes a &quot;PICO&quot; element that knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this research element definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this research element definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the research element definition is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this research element definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the research element definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the research element definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the research element definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the research element definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"shortTitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the ResearchElementDefinition giving additional information about its content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this research element definition. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this research element definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The intended subjects for the ResearchElementDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchElementDefinition can be anything.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the research element definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the research element definition changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the research element definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the research element definition from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate research element definition instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the research element definition is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this research element definition is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A detailed description, from a clinical perspective, of how the ResearchElementDefinition is used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the research element definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the research element definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the research element definition content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the ResearchElementDefinition. Topics provide a high-level categorization grouping types of ResearchElementDefinitions that can be useful for filtering and searching.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"library\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a Library resource containing the formal logic used by the ResearchElementDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ResearchElementType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of research element, a population, an exposure, or an outcome.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"variableType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"VariableType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the outcome (e.g. Dichotomous, Continuous, or Descriptive).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"characteristic\" type=\"ResearchElementDefinition.Characteristic\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A characteristic that defines the members of the research element. Multiple characteristics are applied with &quot;and&quot; semantics.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ResearchElementDefinition.Characteristic\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The ResearchElementDefinition resource describes a &quot;PICO&quot; element that knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Define members of the research element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year).</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"definitionCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"definitionCanonical\" type=\"canonical\"/>\r\n            <xs:element name=\"definitionExpression\" type=\"Expression\"/>\r\n            <xs:element name=\"definitionDataRequirement\" type=\"DataRequirement\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"usageContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Use UsageContext to define the members of the population, such as Age Ranges, Genders, Settings.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exclude\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When true, members with this characteristic are excluded from the element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitOfMeasure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the UCUM unit for the outcome.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"studyEffectiveDescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A narrative description of the time period the study covers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates what effective period the study covers.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"studyEffectiveDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"studyEffectivePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"studyEffectiveDuration\" type=\"Duration\"/>\r\n            <xs:element name=\"studyEffectiveTiming\" type=\"Timing\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"studyEffectiveTimeFromStart\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates duration from the study initiation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"studyEffectiveGroupMeasure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"GroupMeasure\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how elements are aggregated within the study effective period.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"participantEffectiveDescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A narrative description of the time period the study covers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates what effective period the study covers.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"participantEffectiveDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"participantEffectivePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"participantEffectiveDuration\" type=\"Duration\"/>\r\n            <xs:element name=\"participantEffectiveTiming\" type=\"Timing\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"participantEffectiveTimeFromStart\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates duration from the participant's study entry.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"participantEffectiveGroupMeasure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"GroupMeasure\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how elements are aggregated within the study effective period.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ResearchElementType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"population\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Population</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"exposure\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Exposure</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"outcome\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Outcome</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ResearchElementType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The possible types of research elements (E.g. Population, Exposure, Outcome).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ResearchElementType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"VariableType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"dichotomous\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Dichotomous</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"continuous\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Continuous</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"descriptive\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Descriptive</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"VariableType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The possible types of variables for exposures or outcomes (E.g. Dichotomous, Continuous, Descriptive).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"VariableType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ResearchStudy\" type=\"ResearchStudy\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ResearchStudy\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this research study by the sponsor or other systems.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive user-friendly label for the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"protocol\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The set of steps expected to be performed as part of the execution of the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A larger research study of which this particular study is a component or step.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ResearchStudyStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The current state of the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"primaryPurposeType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of study based upon the intent of the study's activities. A classification of the intent of the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"phase\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"focus\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"condition\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The condition that is the focus of the study.  For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion &quot;healthy volunteer&quot;, but the target condition code would be a Lupus SNOMED code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in learning more about or engaging with the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Citations, references and other related documents.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"keyword\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Key terms to aid in searching for or filtering the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates a country, state or other region where the study is taking place.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A full description of how the study is being conducted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"enrollment\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to a Group that defines the criteria for and quantity of subjects participating in the study.  E.g. &quot; 200 female Europeans between the ages of 20 and 45 with early onset diabetes&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the start date and the expected (or actual, depending on status) end date for the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sponsor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An organization that initiates the investigation and is legally responsible for the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"principalInvestigator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A researcher in a study who oversees multiple aspects of the study, such as concept development, protocol writing, protocol submission for IRB approval, participant recruitment, informed consent, data collection, analysis, interpretation and presentation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"site\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A facility in which study activities are conducted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonStopped\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description and/or code explaining the premature termination of the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments made about the study by the performer, subject or other participants.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"arm\" type=\"ResearchStudy.Arm\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes an expected sequence of events for one of the participants of a study.  E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"objective\" type=\"ResearchStudy.Objective\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ResearchStudy.Arm\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique, human-readable label for this arm of the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Categorization of study arm, e.g. experimental, active comparator, placebo comparater.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A succinct description of the path through the study that would be followed by a subject adhering to this arm.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ResearchStudy.Objective\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique, human-readable label for this objective of the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of study objective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ResearchStudyStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"administratively-completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Administratively Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"approved\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Approved</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"closed-to-accrual\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Closed to Accrual</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"closed-to-accrual-and-intervention\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Closed to Accrual and Intervention</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"disapproved\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Disapproved</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"in-review\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In Review</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"temporarily-closed-to-accrual\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Temporarily Closed to Accrual</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"temporarily-closed-to-accrual-and-intervention\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Temporarily Closed to Accrual and Intervention</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"withdrawn\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Withdrawn</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ResearchStudyStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Codes that convey the current status of the research study.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ResearchStudyStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ResearchSubject\" type=\"ResearchSubject\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A physical entity which is the primary unit of operational and/or administrative interest in a study.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ResearchSubject\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A physical entity which is the primary unit of operational and/or administrative interest in a study.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this research subject for a study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ResearchSubjectStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The current state of the subject.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The dates the subject began and ended their participation in the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"study\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the study the subject is participating in.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"individual\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The record of the person or animal who is involved in the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"assignedArm\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the arm in the study the subject is expected to follow as part of this study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actualArm\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the arm in the study the subject actually followed as part of this study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"consent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A record of the patient's informed agreement to participate in the study.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ResearchSubjectStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"candidate\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Candidate</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"eligible\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Eligible</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"follow-up\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Follow-up</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ineligible\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Ineligible</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"not-registered\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not Registered</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"off-study\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Off-study</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-study\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On-study</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-study-intervention\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On-study-intervention</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-study-observation\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On-study-observation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"pending-on-study\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Pending on-study</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"potential-candidate\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Potential Candidate</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"screening\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Screening</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"withdrawn\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Withdrawn</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ResearchSubjectStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Indicates the progression of a study subject through a study.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ResearchSubjectStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"RiskAssessment\" type=\"RiskAssessment\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"RiskAssessment\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifier assigned to the risk assessment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the request that is fulfilled by this risk assessment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a resource that this risk assessment is part of, such as a Procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ObservationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the RiskAssessment, using the same statuses as an Observation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The algorithm, process or mechanism used to evaluate the risk.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the risk assessment performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The patient or group the risk assessment applies to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The encounter where the assessment was performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date (and possibly time) the risk assessment was performed.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"condition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">For assessments or prognosis specific to a particular condition, indicates the condition being assessed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The provider or software application that performed the assessment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reason the risk assessment was performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Resources supporting the reason the risk assessment was performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basis\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the source data considered as part of the assessment (for example, FamilyHistory, Observations, Procedures, Conditions, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"prediction\" type=\"RiskAssessment.Prediction\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the expected outcome for the subject.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"mitigation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the steps that might be taken to reduce the identified risk(s).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional comments about the risk assessment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"RiskAssessment.Prediction\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">One of the potential outcomes for the patient (e.g. remission, death,  a particular condition).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how likely the outcome is (in the specified timeframe).</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"probabilityDecimal\" type=\"decimal\"/>\r\n            <xs:element name=\"probabilityRange\" type=\"Range\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"qualitativeRisk\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how likely the outcome is (in the specified timeframe), expressed as a qualitative value (e.g. low, medium, or high).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relativeRisk\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general.  (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the period of time or age range of the subject to which the specified probability applies.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"whenPeriod\" type=\"Period\"/>\r\n            <xs:element name=\"whenRange\" type=\"Range\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"rationale\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information explaining the basis for the prediction.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"RiskEvidenceSynthesis\" type=\"RiskEvidenceSynthesis\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"RiskEvidenceSynthesis\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this risk evidence synthesis when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this risk evidence synthesis is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the risk evidence synthesis is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this risk evidence synthesis when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the risk evidence synthesis when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the risk evidence synthesis author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the risk evidence synthesis. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the risk evidence synthesis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this risk evidence synthesis. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the risk evidence synthesis was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the risk evidence synthesis changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the risk evidence synthesis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the risk evidence synthesis from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate risk evidence synthesis instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the risk evidence synthesis is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the risk evidence synthesis and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the risk evidence synthesis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period during which the risk evidence synthesis content was or is planned to be in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the RiskEvidenceSynthesis. Topics provide a high-level categorization grouping types of EffectEvidenceSynthesiss that can be useful for filtering and searching.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"synthesisType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of synthesis eg meta-analysis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"studyType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of study eg randomized trial.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"population\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the population for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exposure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the exposure for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"outcome\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resomece that defines the outcome for the research.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sampleSize\" type=\"RiskEvidenceSynthesis.SampleSize\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the size of the sample involved in the synthesis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"riskEstimate\" type=\"RiskEvidenceSynthesis.RiskEstimate\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The estimated risk of the outcome.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"certainty\" type=\"RiskEvidenceSynthesis.Certainty\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the certainty of the risk estimate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"RiskEvidenceSynthesis.SampleSize\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-readable summary of sample size.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numberOfStudies\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number of studies included in this evidence synthesis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numberOfParticipants\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number of participants included in this evidence synthesis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"RiskEvidenceSynthesis.RiskEstimate\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Human-readable summary of risk estimate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Examples include proportion and mean.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The point estimate of the risk estimate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"unitOfMeasure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies the UCUM unit for the outcome.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"denominatorCount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The sample size for the group that was measured for this risk estimate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numeratorCount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of group members with the outcome of interest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"precisionEstimate\" type=\"RiskEvidenceSynthesis.PrecisionEstimate\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the precision of the estimate for the effect.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"RiskEvidenceSynthesis.PrecisionEstimate\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Examples include confidence interval and interquartile range.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"level\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Use 95 for a 95% confidence interval.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"from\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Lower bound of confidence interval.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"to\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Upper bound of confidence interval.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"RiskEvidenceSynthesis.Certainty\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"rating\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A rating of the certainty of the effect estimate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"certaintySubcomponent\" type=\"RiskEvidenceSynthesis.CertaintySubcomponent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of a component of the overall certainty.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"RiskEvidenceSynthesis.CertaintySubcomponent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of subcomponent of certainty rating.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rating\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A rating of a subcomponent of rating certainty.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Schedule\" type=\"Schedule\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A container for slots of time that may be available for booking appointments.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Schedule\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A container for slots of time that may be available for booking appointments.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">External Ids for this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this schedule record is in active use or should not be used (such as was entered in error).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"serviceCategory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A broad categorization of the service that is to be performed during this appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"serviceType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific service that is to be performed during this appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specialty of a practitioner that would be required to perform the service requested in this appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Slots that reference this schedule resource provide the availability details to these referenced resource(s).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"planningHorizon\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The period of time that the slots that reference this Schedule resource cover (even if none exist). These  cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a &quot;template&quot; for planning outside these dates.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments on the availability to describe any extended information. Such as custom constraints on the slots that may be associated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"SearchParameter\" type=\"SearchParameter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A search parameter that defines a named search item that can be used to search/filter on a resource.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"SearchParameter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A search parameter that defines a named search item that can be used to search/filter on a resource.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this search parameter when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this search parameter is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the search parameter is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the search parameter when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the search parameter author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the search parameter. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"derivedFrom\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. i.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this search parameter. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this search parameter is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the search parameter was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the search parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">And how it used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate search parameter instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the search parameter is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this search parameter is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code used in the URL or the parameter name in a parameters resource for this search parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"base\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The base resource type(s) that this search parameter can be used against.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SearchParamType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of value that a search parameter may contain, and how the content is interpreted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A FHIRPath expression that returns a set of elements for the search parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"xpath\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An XPath expression that returns a set of elements for the search parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"xpathUsage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"XPathUsageType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the search parameter relates to the set of elements returned by evaluating the xpath query.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"target\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Types of resource (if a resource is referenced).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"multipleOr\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether multiple values are allowed for each time the parameter exists. Values are separated by commas, and the parameter matches if any of the values match.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"multipleAnd\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether multiple parameters are allowed - e.g. more than one parameter with the same name. The search matches if all the parameters match.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comparator\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"SearchComparator\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comparators supported for the search parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"SearchModifierCode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A modifier supported for the search parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"chain\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"component\" type=\"SearchParameter.Component\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used to define the parts of a composite search parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SearchParameter.Component\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A search parameter that defines a named search item that can be used to search/filter on a resource.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"definition\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The definition of the search parameter that describes this part.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"XPathUsageType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"normal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Normal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"phonetic\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Phonetic</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"nearby\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Nearby</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"distance\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Distance</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"other\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Other</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"XPathUsageType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How a search parameter relates to the set of elements returned by evaluating its xpath query.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"XPathUsageType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SearchModifierCode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"missing\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Missing</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"exact\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Exact</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"contains\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Contains</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"not\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"text\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Text</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"in\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"not-in\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not In</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"below\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Below</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"above\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Above</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"type\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Type</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"identifier\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Identifier</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ofType\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Of Type</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SearchModifierCode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A supported modifier for a search parameter.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"SearchModifierCode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SearchComparator-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"eq\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Equals</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ne\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not Equals</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"gt\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Greater Than</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"lt\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Less Than</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ge\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Greater or Equals</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"le\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Less of Equal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"sa\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Starts After</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"eb\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Ends Before</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ap\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Approximately</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SearchComparator\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">What Search Comparator Codes are supported in search.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"SearchComparator-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ServiceRequest\" type=\"ServiceRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a request for service such as diagnostic investigations, treatments, or operations to be performed.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ServiceRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a request for service such as diagnostic investigations, treatments, or operations to be performed.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Plan/proposal/order fulfilled by this request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"replaces\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The request takes the place of the referenced completed or terminated request(s).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requisition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A shared identifier common to all service requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the order.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestIntent\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the request is a proposal, plan, an original order or a reflex order.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that classifies the service for searching, sorting and display purposes (e.g. &quot;Surgical Procedure&quot;).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the ServiceRequest should be addressed with respect to other requests.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"doNotPerform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Set this to true if the record is saying that the service/procedure should NOT be performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that identifies a particular service (i.e., procedure, diagnostic investigation, or panel of investigations) that have been requested.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"orderDetail\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional details and instructions about the how the services are to be delivered.   For example, and order for a urinary catheter may have an order detail for an external or indwelling catheter, or an order for a bandage may require additional instructions specifying how the bandage should be applied.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"quantityQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"quantityRatio\" type=\"Ratio\"/>\r\n            <xs:element name=\"quantityRange\" type=\"Range\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">On whom or what the service is to be performed. This is usually a human patient, but can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An encounter that provides additional information about the healthcare context in which this request is made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date/time at which the requested service should occur.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"occurrenceTiming\" type=\"Timing\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example &quot;pain&quot;, &quot;on flare-up&quot;, etc.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"asNeededBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"asNeededCodeableConcept\" type=\"CodeableConcept\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the request transitioned to being actionable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual who initiated the request and has responsibility for its activation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performerType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Desired type of performer for doing the requested service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The desired performer for doing the requested service.  For example, the surgeon, dermatopathologist, endoscopist, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"locationCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The preferred location(s) where the procedure should actually happen in coded or free text form. E.g. at home or nursing day care center.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"locationReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to the the preferred location(s) where the procedure should actually happen. E.g. at home or nursing day care center.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanation or justification for why this service is being requested in coded or textual form.   This is often for billing purposes.  May relate to the resources referred to in `supportingInfo`.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates another resource that provides a justification for why this service is being requested.   May relate to the resources referred to in `supportingInfo`.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be needed for delivering the requested service.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional clinical information about the patient or specimen that may influence the services or their interpretations.     This information includes diagnosis, clinical findings and other observations.  In laboratory ordering these are typically referred to as &quot;ask at order entry questions (AOEs)&quot;.  This includes observations explicitly requested by the producer (filler) to provide context or supporting information needed to complete the order. For example,  reporting the amount of inspired oxygen for blood gas measurements.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specimen\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">One or more specimens that the laboratory procedure will use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Anatomic location where the procedure should be performed. This is the target site.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Any other notes and comments made about the service request. For example, internal billing notes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patientInstruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Instructions in terms that are understood by the patient or consumer.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relevantHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Key events in the history of the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Slot\" type=\"Slot\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A slot of time on a schedule that may be available for booking appointments.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Slot\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A slot of time on a schedule that may be available for booking appointments.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">External Ids for this item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"serviceCategory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A broad categorization of the service that is to be performed during this appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"serviceType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specialty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specialty of a practitioner that would be required to perform the service requested in this appointment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"appointmentType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The style of appointment or patient that may be booked in the slot (not service type).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"schedule\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The schedule resource that this slot defines an interval of status information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SlotStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">busy | free | busy-unavailable | busy-tentative | entered-in-error.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"start\" minOccurs=\"1\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date/Time that the slot is to begin.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"end\" minOccurs=\"1\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date/Time that the slot is to conclude.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"overbooked\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This slot has already been overbooked, appointments are unlikely to be accepted for this time.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments on the slot to describe any extended information. Such as custom constraints on the slot.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SlotStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"busy\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Busy</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"free\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Free</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"busy-unavailable\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Busy (Unavailable)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"busy-tentative\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Busy (Tentative)</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SlotStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The free/busy status of the slot.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"SlotStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Specimen\" type=\"Specimen\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A sample to be used for analysis.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Specimen\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A sample to be used for analysis.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id for specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"accessionIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SpecimenStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The availability of the specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of material that forms the specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where the specimen came from. This may be from patient(s), from a location (e.g., the source of an environmental sample), or a sampling of a substance or a device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"receivedTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time when specimen was received for processing or testing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parent\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details concerning a service request that required a specimen to be collected.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"collection\" type=\"Specimen.Collection\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details concerning the specimen collection.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"processing\" type=\"Specimen.Processing\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details concerning processing and processing steps for the specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"container\" type=\"Specimen.Container\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The container holding the specimen.  The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"condition\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A mode or state of being that describes the nature of the specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">To communicate any details or issues about the specimen or during the specimen collection. (for example: broken vial, sent with patient, frozen).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Specimen.Collection\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A sample to be used for analysis.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"collector\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Person who collected the specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time when specimen was collected from subject - the physiologically relevant time.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"collectedDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"collectedPeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"duration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The span of time over which the collection of a specimen occurred.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A coded value specifying the technique that is used to perform the procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Anatomical location from which the specimen was collected (if subject is a patient). This is the target site.  This element is not used for environmental specimens.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Abstinence or reduction from some or all food, drink, or both, for a period of time prior to sample collection.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"fastingStatusCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"fastingStatusDuration\" type=\"Duration\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Specimen.Processing\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A sample to be used for analysis.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Textual description of procedure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"procedure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A coded value specifying the procedure used to process the specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"additive\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Material used in the processing step.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A record of the time or period when the specimen processing occurred.  For example the time of sample fixation or the period of time the sample was in formalin.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"timeDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"timePeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Specimen.Container\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A sample to be used for analysis.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Textual description of the container.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of container associated with the specimen (e.g. slide, aliquot, etc.).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"capacity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The capacity (volume or other measure) the container may contain.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"specimenQuantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"additiveCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"additiveReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SpecimenStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"available\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Available</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unavailable\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unavailable</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unsatisfactory\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unsatisfactory</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SpecimenStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Codes providing the status/availability of a specimen.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"SpecimenStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"SpecimenDefinition\" type=\"SpecimenDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A kind of specimen with associated set of requirements.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"SpecimenDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A kind of specimen with associated set of requirements.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A business identifier associated with the kind of specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"typeCollected\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of material to be collected.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patientPreparation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Preparation of the patient for specimen collection.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"timeAspect\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Time aspect of specimen collection (duration or offset).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"collection\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The action to be performed for collecting the specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"typeTested\" type=\"SpecimenDefinition.TypeTested\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specimen conditioned in a container as expected by the testing laboratory.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SpecimenDefinition.TypeTested\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A kind of specimen with associated set of requirements.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"isDerived\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Primary of secondary specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of specimen conditioned for testing expected by lab.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preference\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SpecimenContainedPreference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The preference for this type of conditioned specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"container\" type=\"SpecimenDefinition.Container\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specimen's container.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requirement\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Requirements for delivery and special handling of this kind of conditioned specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"retentionTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The usual time that a specimen of this kind is retained after the ordered tests are completed, for the purpose of additional testing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rejectionCriterion\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Criterion for rejection of the specimen in its container by the laboratory.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"handling\" type=\"SpecimenDefinition.Handling\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Set of instructions for preservation/transport of the specimen at a defined temperature interval, prior the testing process.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SpecimenDefinition.Container\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A kind of specimen with associated set of requirements.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"material\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of material of the container.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of container used to contain this kind of specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cap\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Color of container cap.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The textual description of the kind of container.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"capacity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The capacity (volume or other measure) of this kind of container.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The minimum volume to be conditioned in the container.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"minimumVolumeQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"minimumVolumeString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"additive\" type=\"SpecimenDefinition.Additive\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Substance introduced in the kind of container to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preparation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Special processing that should be applied to the container for this kind of specimen.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SpecimenDefinition.Additive\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A kind of specimen with associated set of requirements.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Substance introduced in the kind of container to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"additiveCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"additiveReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SpecimenDefinition.Handling\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A kind of specimen with associated set of requirements.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"temperatureQualifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">It qualifies the interval of temperature, which characterizes an occurrence of handling. Conditions that are not related to temperature may be handled in the instruction element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"temperatureRange\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Range\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The temperature interval for this set of handling instructions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maxDuration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The maximum time interval of preservation of the specimen with these conditions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional textual instructions for the preservation or transport of the specimen. For instance, 'Protect from light exposure'.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SpecimenContainedPreference-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"preferred\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Preferred</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"alternate\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Alternate</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SpecimenContainedPreference\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Degree of preference of a type of conditioned specimen.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"SpecimenContainedPreference-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"StructureDefinition\" type=\"StructureDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"StructureDefinition\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this structure definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this structure definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the structure definition is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this structure definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the structure definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the structure definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the structure definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this structure definition. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this structure definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the structure definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the structure definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the structure definition from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate structure definition instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the structure definition is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this structure definition is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"keyword\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A set of key words or terms from external terminologies that may be used to assist with indexing and searching of templates nby describing the use of this structure definition, or the content it describes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fhirVersion\" minOccurs=\"0\" maxOccurs=\"1\" type=\"FHIRVersion\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 4.0.1. for this version.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"mapping\" type=\"StructureDefinition.Mapping\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An external specification that the content is mapped to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"StructureDefinitionKind\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines the kind of structure that this definition is describing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"abstract\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether structure this definition describes is abstract or not  - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged  between systems.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"context\" type=\"StructureDefinition.Context\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the types of resource or data type elements to which the extension can be applied.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contextInvariant\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A set of rules as FHIRPath Invariants about when the extension can be used (e.g. co-occurrence variants for the extension). All the rules must be true.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type).  References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. &quot;string&quot; is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"baseDefinition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"derivation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"TypeDerivationRule\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the type relates to the baseDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"snapshot\" type=\"StructureDefinition.Snapshot\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A snapshot view is expressed in a standalone form that can be used and interpreted without considering the base StructureDefinition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"differential\" type=\"StructureDefinition.Differential\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"StructureDefinition.Mapping\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An Internal id that is used to identify this mapping set when specific mappings are made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"uri\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that identifies the specification that this mapping is expressed to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name for the specification that is being mapped to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"StructureDefinition.Context\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ExtensionContextType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Defines how to interpret the expression that defines what the context of the extension is.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An expression that defines where an extension can be used in resources.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"StructureDefinition.Snapshot\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"element\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"ElementDefinition\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"StructureDefinition.Differential\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"element\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"ElementDefinition\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"StructureDefinitionKind-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"primitive-type\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Primitive Data Type</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"complex-type\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Complex Data Type</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"resource\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Resource</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"logical\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Logical</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"StructureDefinitionKind\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Defines the type of structure that a definition is describing.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"StructureDefinitionKind-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"TypeDerivationRule-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"specialization\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Specialization</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"constraint\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Constraint</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"TypeDerivationRule\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How a type relates to its baseDefinition.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"TypeDerivationRule-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"ExtensionContextType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"fhirpath\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">FHIRPath</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"element\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Element ID</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"extension\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Extension URL</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"ExtensionContextType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How an extension context is interpreted.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"ExtensionContextType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"StructureMap\" type=\"StructureMap\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"StructureMap\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this structure map when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this structure map is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the structure map is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this structure map when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the structure map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the structure map.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this structure map. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the structure map was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the structure map.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the structure map from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate structure map instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the structure map is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this structure map is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"structure\" type=\"StructureMap.Structure\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"import\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Other maps used by this map (canonical URLs).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"group\" type=\"StructureMap.Group\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Organizes the mapping into manageable chunks for human review/ease of maintenance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"StructureMap.Structure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The canonical reference to the structure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"StructureMapModelMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the referenced structure is used in this mapping.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"alias\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name used for this type in the map.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Documentation that describes how the structure is used in the mapping.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"StructureMap.Group\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique name for the group for the convenience of human readers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"extends\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Another group that this group adds rules to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"typeMode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"StructureMapGroupTypeMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If this is the default rule set to apply for the source type or this combination of types.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional supporting documentation that explains the purpose of the group and the types of mappings within it.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"input\" type=\"StructureMap.Input\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name assigned to an instance of data. The instance must be provided when the mapping is invoked.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rule\" type=\"StructureMap.Rule\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Transform Rule from source to target.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"StructureMap.Input\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name for this instance of data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type for this instance of data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"StructureMapInputMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Mode for this instance of data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Documentation for this instance of data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"StructureMap.Rule\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name of the rule for internal references.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" type=\"StructureMap.Source\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Source inputs to the mapping.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"target\" type=\"StructureMap.Target\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Content to create because of this mapping rule.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"rule\" type=\"StructureMap.Rule\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Rules contained in this rule.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dependent\" type=\"StructureMap.Dependent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Which other rules to apply in the context of this rule.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Documentation for this instance of data.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"StructureMap.Source\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"context\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type or variable this rule applies to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"min\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"max\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specified maximum cardinality for the element - a number or a &quot;*&quot;. This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A value to use if there is no existing value in the source object.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"defaultValueBase64Binary\" type=\"base64Binary\"/>\r\n            <xs:element name=\"defaultValueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"defaultValueCanonical\" type=\"canonical\"/>\r\n            <xs:element name=\"defaultValueCode\" type=\"code\"/>\r\n            <xs:element name=\"defaultValueDate\" type=\"date\"/>\r\n            <xs:element name=\"defaultValueDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"defaultValueDecimal\" type=\"decimal\"/>\r\n            <xs:element name=\"defaultValueId\" type=\"id\"/>\r\n            <xs:element name=\"defaultValueInstant\" type=\"instant\"/>\r\n            <xs:element name=\"defaultValueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"defaultValueMarkdown\" type=\"markdown\"/>\r\n            <xs:element name=\"defaultValueOid\" type=\"oid\"/>\r\n            <xs:element name=\"defaultValuePositiveInt\" type=\"positiveInt\"/>\r\n            <xs:element name=\"defaultValueString\" type=\"string\"/>\r\n            <xs:element name=\"defaultValueTime\" type=\"time\"/>\r\n            <xs:element name=\"defaultValueUnsignedInt\" type=\"unsignedInt\"/>\r\n            <xs:element name=\"defaultValueUri\" type=\"uri\"/>\r\n            <xs:element name=\"defaultValueUrl\" type=\"url\"/>\r\n            <xs:element name=\"defaultValueUuid\" type=\"uuid\"/>\r\n            <xs:element name=\"defaultValueAddress\" type=\"Address\"/>\r\n            <xs:element name=\"defaultValueAge\" type=\"Age\"/>\r\n            <xs:element name=\"defaultValueAnnotation\" type=\"Annotation\"/>\r\n            <xs:element name=\"defaultValueAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"defaultValueCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"defaultValueCoding\" type=\"Coding\"/>\r\n            <xs:element name=\"defaultValueContactPoint\" type=\"ContactPoint\"/>\r\n            <xs:element name=\"defaultValueCount\" type=\"Count\"/>\r\n            <xs:element name=\"defaultValueDistance\" type=\"Distance\"/>\r\n            <xs:element name=\"defaultValueDuration\" type=\"Duration\"/>\r\n            <xs:element name=\"defaultValueHumanName\" type=\"HumanName\"/>\r\n            <xs:element name=\"defaultValueIdentifier\" type=\"Identifier\"/>\r\n            <xs:element name=\"defaultValueMoney\" type=\"Money\"/>\r\n            <xs:element name=\"defaultValuePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"defaultValueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"defaultValueRange\" type=\"Range\"/>\r\n            <xs:element name=\"defaultValueRatio\" type=\"Ratio\"/>\r\n            <xs:element name=\"defaultValueReference\" type=\"Reference\"/>\r\n            <xs:element name=\"defaultValueSampledData\" type=\"SampledData\"/>\r\n            <xs:element name=\"defaultValueSignature\" type=\"Signature\"/>\r\n            <xs:element name=\"defaultValueTiming\" type=\"Timing\"/>\r\n            <xs:element name=\"defaultValueContactDetail\" type=\"ContactDetail\"/>\r\n            <xs:element name=\"defaultValueContributor\" type=\"Contributor\"/>\r\n            <xs:element name=\"defaultValueDataRequirement\" type=\"DataRequirement\"/>\r\n            <xs:element name=\"defaultValueExpression\" type=\"Expression\"/>\r\n            <xs:element name=\"defaultValueParameterDefinition\" type=\"ParameterDefinition\"/>\r\n            <xs:element name=\"defaultValueRelatedArtifact\" type=\"RelatedArtifact\"/>\r\n            <xs:element name=\"defaultValueTriggerDefinition\" type=\"TriggerDefinition\"/>\r\n            <xs:element name=\"defaultValueUsageContext\" type=\"UsageContext\"/>\r\n            <xs:element name=\"defaultValueDosage\" type=\"Dosage\"/>\r\n            <xs:element name=\"defaultValueMeta\" type=\"Meta\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"element\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Optional field for this source.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"listMode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"StructureMapSourceListMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How to handle the list mode for this element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"variable\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Named context for field, if a field is specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"condition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">FHIRPath expression  - must be true or the rule does not apply.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"check\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">FHIRPath expression  - must be true or the mapping engine throws an error instead of completing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"logMessage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A FHIRPath expression which specifies a message to put in the transform log when content matching the source rule is found.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"StructureMap.Target\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type or variable this rule applies to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contextType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"StructureMapContextType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How to interpret the context.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"element\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Field to create in the context.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"variable\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Named context for field, if desired, and a field is specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"listMode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"StructureMapTargetListMode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If field is a list, how to manage the list.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"listRuleId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Internal rule reference for shared list items.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"transform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"StructureMapTransform\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">How the data is copied / created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parameter\" type=\"StructureMap.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Parameters to the transform.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"StructureMap.Parameter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Parameter value - variable or literal.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueId\" type=\"id\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"StructureMap.Dependent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name of a rule or group to apply.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"variable\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Variable to pass to the rule or group.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"StructureMapInputMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"source\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Source Instance</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"target\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Target Instance</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"StructureMapInputMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Mode for this instance of data.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"StructureMapInputMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"StructureMapContextType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"type\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Type</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"variable\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Variable</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"StructureMapContextType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How to interpret the context.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"StructureMapContextType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"StructureMapTargetListMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"first\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">First</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"share\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Share</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"last\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Last</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"collate\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Collate</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"StructureMapTargetListMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">If field is a list, how to manage the production.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"StructureMapTargetListMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"StructureMapTransform-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"create\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">create</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"copy\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">copy</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"truncate\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">truncate</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"escape\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">escape</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cast\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">cast</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"append\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">append</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"translate\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">translate</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"reference\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">reference</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"dateOp\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">dateOp</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"uuid\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">uuid</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"pointer\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">pointer</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"evaluate\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">evaluate</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cc\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">cc</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"c\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">c</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"qty\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">qty</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"id\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">id</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cp\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">cp</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"StructureMapTransform\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How data is copied/created.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"StructureMapTransform-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"StructureMapSourceListMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"first\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">First</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"not_first\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">All but the first</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"last\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Last</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"not_last\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">All but the last</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"only_one\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Enforce only one</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"StructureMapSourceListMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">If field is a list, how to manage the source.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"StructureMapSourceListMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"StructureMapGroupTypeMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"none\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Not a Default</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"types\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Default for Type Combination</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"type-and-types\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Default for type + combination</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"StructureMapGroupTypeMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">If this is the default rule set to apply for the source type, or this combination of types.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"StructureMapGroupTypeMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"StructureMapModelMode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"source\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Source Structure Definition</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"queried\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Queried Structure Definition</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"target\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Target Structure Definition</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"produced\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Produced Structure Definition</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"StructureMapModelMode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">How the referenced structure is used in this mapping.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"StructureMapModelMode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Subscription\" type=\"Subscription\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined &quot;channel&quot; so that another system can take an appropriate action.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Subscription\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined &quot;channel&quot; so that another system can take an appropriate action.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SubscriptionStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the subscription, which marks the server state for managing the subscription.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time for the server to turn the subscription off.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reason\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of why this subscription is defined.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"criteria\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The rules that the server should use to determine when to generate notifications for this subscription.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"error\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A record of the last error that occurred when the server processed a notification.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"channel\" type=\"Subscription.Channel\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details where to send notifications when resources are received that meet the criteria.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Subscription.Channel\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined &quot;channel&quot; so that another system can take an appropriate action.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SubscriptionChannelType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of channel to send notifications on.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"1\" type=\"url\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The url that describes the actual end-point to send messages to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"payload\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The mime type to send the payload in - either application/fhir+xml, or application/fhir+json. If the payload is not present, then there is no payload in the notification, just a notification. The mime type &quot;text/plain&quot; may also be used for Email and SMS subscriptions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"header\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional headers / information to send as part of the notification.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SubscriptionStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"requested\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Requested</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"off\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Off</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SubscriptionStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The status of a subscription.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"SubscriptionStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SubscriptionChannelType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"rest-hook\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Rest Hook</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"websocket\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Websocket</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"email\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Email</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"sms\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">SMS</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"message\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Message</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SubscriptionChannelType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of method used to execute a subscription.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"SubscriptionChannelType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Substance\" type=\"Substance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A homogeneous material with a definite composition.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Substance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A homogeneous material with a definite composition.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique identifier for the substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"FHIRSubstanceStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code to indicate if the substance is actively used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code (or set of codes) that identify this substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description of the substance - its appearance, handling requirements, and other usage notes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instance\" type=\"Substance.Instance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"ingredient\" type=\"Substance.Ingredient\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A substance can be composed of other substances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Substance.Instance\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A homogeneous material with a definite composition.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier associated with the package/container (usually a label affixed directly).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expiry\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount of the substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Substance.Ingredient\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A homogeneous material with a definite composition.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount of the ingredient in the substance - a concentration ratio.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Another substance that is a component of this substance.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"substanceCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"substanceReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"FHIRSubstanceStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"inactive\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"FHIRSubstanceStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A code to indicate if the substance is actively used.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"FHIRSubstanceStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"SubstanceNucleicAcid\" type=\"SubstanceNucleicAcid\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"SubstanceNucleicAcid\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequenceType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the sequence shall be specified based on a controlled vocabulary.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numberOfSubunits\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The number of linear sequences of nucleotides linked through phosphodiester bonds shall be described. Subunits would be strands of nucleic acids that are tightly associated typically through Watson-Crick base pairing. NOTE: If not specified in the reference source, the assumption is that there is 1 subunit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"areaOfHybridisation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The area of hybridisation shall be described if applicable for double stranded RNA or DNA. The number associated with the subunit followed by the number associated to the residue shall be specified in increasing order. The underscore “” shall be used as separator as follows: “Subunitnumber Residue”.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"oligoNucleotideType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">(TBC).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subunit\" type=\"SubstanceNucleicAcid.Subunit\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Subunits are listed in order of decreasing length; sequences of the same length will be ordered by molecular weight; subunits that have identical sequences will be repeated multiple times.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceNucleicAcid.Subunit\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"subunit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Index of linear sequences of nucleic acids in order of decreasing length. Sequences of the same length will be ordered by molecular weight. Subunits that have identical sequences will be repeated and have sequential subscripts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Actual nucleotide sequence notation from 5' to 3' end using standard single letter codes. In addition to the base sequence, sugar and type of phosphate or non-phosphate linkage should also be captured.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"length\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The length of the sequence shall be captured.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sequenceAttachment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">(TBC).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fivePrime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The nucleotide present at the 5’ terminal shall be specified based on a controlled vocabulary. Since the sequence is represented from the 5' to the 3' end, the 5’ prime nucleotide is the letter at the first position in the sequence. A separate representation would be redundant.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"threePrime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The nucleotide present at the 3’ terminal shall be specified based on a controlled vocabulary. Since the sequence is represented from the 5' to the 3' end, the 5’ prime nucleotide is the letter at the last position in the sequence. A separate representation would be redundant.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"linkage\" type=\"SubstanceNucleicAcid.Linkage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The linkages between sugar residues will also be captured.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sugar\" type=\"SubstanceNucleicAcid.Sugar\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">5.3.6.8.1 Sugar ID (Mandatory).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceNucleicAcid.Linkage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"connectivity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The entity that links the sugar residues together should also be captured for nearly all naturally occurring nucleic acid the linkage is a phosphate group. For many synthetic oligonucleotides phosphorothioate linkages are often seen. Linkage connectivity is assumed to be 3’-5’. If the linkage is either 3’-3’ or 5’-5’ this should be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Each linkage will be registered as a fragment and have an ID.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Each linkage will be registered as a fragment and have at least one name. A single name shall be assigned to each linkage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"residueSite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Residues shall be captured as described in 5.3.6.8.3.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceNucleicAcid.Sugar\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Substance ID of the sugar or sugar-like component that make up the nucleotide.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the sugar or sugar-like component that make up the nucleotide.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"residueSite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The residues that contain a given sugar will be captured. The order of given residues will be captured in the 5‘-3‘direction consistent with the base sequences listed above.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"SubstancePolymer\" type=\"SubstancePolymer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"SubstancePolymer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"class\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"geometry\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copolymerConnectivity\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"modification\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"monomerSet\" type=\"SubstancePolymer.MonomerSet\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"repeat\" type=\"SubstancePolymer.Repeat\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstancePolymer.MonomerSet\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"ratioType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"startingMaterial\" type=\"SubstancePolymer.StartingMaterial\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstancePolymer.StartingMaterial\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"material\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"isDefining\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SubstanceAmount\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstancePolymer.Repeat\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"numberOfUnits\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"averageMolecularFormula\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"repeatUnitAmountType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"repeatUnit\" type=\"SubstancePolymer.RepeatUnit\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstancePolymer.RepeatUnit\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"orientationOfPolymerisation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"repeatUnit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SubstanceAmount\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"degreeOfPolymerisation\" type=\"SubstancePolymer.DegreeOfPolymerisation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"structuralRepresentation\" type=\"SubstancePolymer.StructuralRepresentation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstancePolymer.DegreeOfPolymerisation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"degree\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SubstanceAmount\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstancePolymer.StructuralRepresentation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"representation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"attachment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"SubstanceProtein\" type=\"SubstanceProtein\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"SubstanceProtein\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sequenceType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The SubstanceProtein descriptive elements will only be used when a complete or partial amino acid sequence is available or derivable from a nucleic acid sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"numberOfSubunits\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Number of linear sequences of amino acids linked through peptide bonds. The number of subunits constituting the SubstanceProtein shall be described. It is possible that the number of subunits can be variable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"disulfideLinkage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The disulphide bond between two cysteine residues either on the same subunit or on two different subunits shall be described. The position of the disulfide bonds in the SubstanceProtein shall be listed in increasing order of subunit number and position within subunit followed by the abbreviation of the amino acids involved. The disulfide linkage positions shall actually contain the amino acid Cysteine at the respective positions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subunit\" type=\"SubstanceProtein.Subunit\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This subclause refers to the description of each subunit constituting the SubstanceProtein. A subunit is a linear sequence of amino acids linked through peptide bonds. The Subunit information shall be provided when the finished SubstanceProtein is a complex of multiple sequences; subunits are not used to delineate domains within a single sequence. Subunits are listed in order of decreasing length; sequences of the same length will be ordered by decreasing molecular weight; subunits that have identical sequences will be repeated multiple times.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceProtein.Subunit\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"subunit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Index of primary sequences of amino acids linked through peptide bonds in order of decreasing length. Sequences of the same length will be ordered by molecular weight. Subunits that have identical sequences will be repeated and have sequential subscripts.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The sequence information shall be provided enumerating the amino acids from N- to C-terminal end using standard single-letter amino acid codes. Uppercase shall be used for L-amino acids and lowercase for D-amino acids. Transcribed SubstanceProteins will always be described using the translated sequence; for synthetic peptide containing amino acids that are not represented with a single letter code an X should be used within the sequence. The modified amino acids will be distinguished by their position in the sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"length\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Length of linear sequences of amino acids contained in the subunit.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sequenceAttachment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The sequence information shall be provided enumerating the amino acids from N- to C-terminal end using standard single-letter amino acid codes. Uppercase shall be used for L-amino acids and lowercase for D-amino acids. Transcribed SubstanceProteins will always be described using the translated sequence; for synthetic peptide containing amino acids that are not represented with a single letter code an X should be used within the sequence. The modified amino acids will be distinguished by their position in the sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"nTerminalModificationId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique identifier for molecular fragment modification based on the ISO 11238 Substance ID.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"nTerminalModification\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the fragment modified at the N-terminal of the SubstanceProtein shall be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cTerminalModificationId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Unique identifier for molecular fragment modification based on the ISO 11238 Substance ID.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cTerminalModification\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The modification at the C-terminal shall be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"SubstanceReferenceInformation\" type=\"SubstanceReferenceInformation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"SubstanceReferenceInformation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"gene\" type=\"SubstanceReferenceInformation.Gene\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"geneElement\" type=\"SubstanceReferenceInformation.GeneElement\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"classification\" type=\"SubstanceReferenceInformation.Classification\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"target\" type=\"SubstanceReferenceInformation.Target\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceReferenceInformation.Gene\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"geneSequenceOrigin\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"gene\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceReferenceInformation.GeneElement\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"element\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceReferenceInformation.Classification\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"domain\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"classification\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subtype\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceReferenceInformation.Target\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"target\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"interaction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"organism\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"organismType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"amountQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"amountRange\" type=\"Range\"/>\r\n            <xs:element name=\"amountString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"amountType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"SubstanceSourceMaterial\" type=\"SubstanceSourceMaterial\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"SubstanceSourceMaterial\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"sourceMaterialClass\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">General high level classification of the source material specific to the origin of the material.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sourceMaterialType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the source material shall be specified based on a controlled vocabulary. For vaccines, this subclause refers to the class of infectious agent.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sourceMaterialState\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The state of the source material when extracted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"organismId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The unique identifier associated with the source material parent organism shall be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"organismName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The organism accepted Scientific name shall be provided based on the organism taxonomy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parentSubstanceId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The parent of the herbal drug Ginkgo biloba, Leaf is the substance ID of the substance (fresh) of Ginkgo biloba L. or Ginkgo biloba L. (Whole plant).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parentSubstanceName\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The parent substance of the Herbal Drug, or Herbal preparation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"countryOfOrigin\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The country where the plant material is harvested or the countries where the plasma is sourced from as laid down in accordance with the Plasma Master File. For “Plasma-derived substances” the attribute country of origin provides information about the countries used for the manufacturing of the Cryopoor plama or Crioprecipitate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"geographicalLocation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The place/region where the plant is harvested or the places/regions where the animal source material has its habitat.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"developmentStage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Stage of life for animals, plants, insects and microorganisms. This information shall be provided only when the substance is significantly different in these stages (e.g. foetal bovine serum).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fractionDescription\" type=\"SubstanceSourceMaterial.FractionDescription\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Many complex materials are fractions of parts of plants, animals, or minerals. Fraction elements are often necessary to define both Substances and Specified Group 1 Substances. For substances derived from Plants, fraction information will be captured at the Substance information level ( . Oils, Juices and Exudates). Additional information for Extracts, such as extraction solvent composition, will be captured at the Specified Substance Group 1 information level. For plasma-derived products fraction information will be captured at the Substance and the Specified Substance Group 1 levels.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"organism\" type=\"SubstanceSourceMaterial.Organism\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partDescription\" type=\"SubstanceSourceMaterial.PartDescription\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">To do.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSourceMaterial.FractionDescription\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"fraction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">This element is capturing information about the fraction of a plant part, or human plasma for fractionation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"materialType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSourceMaterial.Organism\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"family\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The family of an organism shall be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"genus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The genus of an organism shall be specified; refers to the Latin epithet of the genus element of the plant/animal scientific name; it is present in names for genera, species and infraspecies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"species\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The species of an organism shall be specified; refers to the Latin epithet of the species of the plant/animal; it is present in names for species and infraspecies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intraspecificType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Intraspecific type of an organism shall be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intraspecificDescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"author\" type=\"SubstanceSourceMaterial.Author\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">4.9.13.6.1 Author type (Conditional).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"hybrid\" type=\"SubstanceSourceMaterial.Hybrid\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">4.9.13.8.1 Hybrid species maternal organism ID (Optional).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"organismGeneral\" type=\"SubstanceSourceMaterial.OrganismGeneral\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">4.9.13.7.1 Kingdom (Conditional).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSourceMaterial.Author\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"authorType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of author of an organism species shall be specified. The parenthetical author of an organism species refers to the first author who published the plant/animal name (of any rank). The primary author of an organism species refers to the first author(s), who validly published the plant/animal name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authorDescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSourceMaterial.Hybrid\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"maternalOrganismId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren’t always known, and it is unlikely that it will be known which is maternal and which is paternal.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"maternalOrganismName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren’t always known, and it is unlikely that it will be known which is maternal and which is paternal.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"paternalOrganismId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"paternalOrganismName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the paternal species constituting the hybrid organism shall be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"hybridType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The hybrid type of an organism shall be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSourceMaterial.OrganismGeneral\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"kingdom\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kingdom of an organism shall be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"phylum\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The phylum of an organism shall be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"class\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The class of an organism shall be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"order\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The order of an organism shall be specified,.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSourceMaterial.PartDescription\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"part\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Entity of anatomical origin of source material within an organism.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partLocation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The detailed anatomic location when the part can be extracted from different anatomical locations of the organism. Multiple alternative locations may apply.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"SubstanceSpecification\" type=\"SubstanceSpecification\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"SubstanceSpecification\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier by which this substance is known.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">High level categorization, e.g. polymer or nucleic acid.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Status of substance within the catalogue e.g. approved.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"domain\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the substance applies to only human or veterinary use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Textual description of the substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Supporting literature.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Textual comment about this record of a substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"moiety\" type=\"SubstanceSpecification.Moiety\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Moiety, for structural modifications.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"property\" type=\"SubstanceSpecification.Property\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">General specifications for this substance, including how it is related to other substances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"referenceInformation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">General information detailing this substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"structure\" type=\"SubstanceSpecification.Structure\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Structural information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" type=\"SubstanceSpecification.Code\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Codes associated with the substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" type=\"SubstanceSpecification.Name\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Names applicable to this substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"molecularWeight\" type=\"SubstanceSpecification.MolecularWeight\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The molecular weight or weight range (for proteins, polymers or nucleic acids).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relationship\" type=\"SubstanceSpecification.Relationship\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A link between this substance and another, with details of the relationship.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"nucleicAcid\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Data items specific to nucleic acids.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"polymer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Data items specific to polymers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"protein\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Data items specific to proteins.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sourceMaterial\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Material or taxonomic/anatomical source for the substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSpecification.Moiety\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Role that the moiety is playing.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier by which this moiety substance is known.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Textual name for this moiety substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"stereochemistry\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Stereochemistry type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"opticalActivity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Optical activity type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"molecularFormula\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Molecular formula.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Quantitative value for this moiety.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"amountQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"amountString\" type=\"string\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSpecification.Property\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A category for this property, e.g. Physical, Chemical, Enzymatic.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Property type e.g. viscosity, pH, isoelectric point.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parameters\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Parameters that were used in the measurement of a property (e.g. for viscosity: measured at 20C with a pH of 7.1).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A substance upon which a defining property depends (e.g. for solubility: in water, in alcohol).</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"definingSubstanceReference\" type=\"Reference\"/>\r\n            <xs:element name=\"definingSubstanceCodeableConcept\" type=\"CodeableConcept\"/>\r\n          </xs:choice>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Quantitative value for this property.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"amountQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"amountString\" type=\"string\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSpecification.Structure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"stereochemistry\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Stereochemistry type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"opticalActivity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Optical activity type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"molecularFormula\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Molecular formula.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"molecularFormulaByMoiety\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specified per moiety according to the Hill system, i.e. first C, then H, then alphabetical, each moiety separated by a dot.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"isotope\" type=\"SubstanceSpecification.Isotope\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Applicable for single substances that contain a radionuclide or a non-natural isotopic ratio.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"molecularWeight\" type=\"SubstanceSpecification.MolecularWeight\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The molecular weight or weight range (for proteins, polymers or nucleic acids).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Supporting literature.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"representation\" type=\"SubstanceSpecification.Representation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Molecular structural representation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSpecification.Isotope\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Substance identifier for each non-natural or radioisotope.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Substance name for each non-natural or radioisotope.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"substitution\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of isotopic substitution present in a single substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"halfLife\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Half life - for a non-natural nuclide.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"molecularWeight\" type=\"SubstanceSpecification.MolecularWeight\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The molecular weight or weight range (for proteins, polymers or nucleic acids).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSpecification.MolecularWeight\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The method by which the molecular weight was determined.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of molecular weight such as exact, average (also known as. number average), weight average.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSpecification.Representation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of structure (e.g. Full, Partial, Representative).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"representation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The structural representation as text string in a format e.g. InChI, SMILES, MOLFILE, CDX.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"attachment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An attached file with the structural representation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSpecification.Code\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The specific code.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Status of the code assignment.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date at which the code status is changed as part of the terminology maintenance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Any comment can be provided in this field, if necessary.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Supporting literature.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSpecification.Name\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The actual name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"preferred\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If this is the preferred name for this substance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Language of the name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"domain\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The use context of this name for example if there is a different name a drug active ingredient as opposed to a food colour additive.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The jurisdiction where this name applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"synonym\" type=\"SubstanceSpecification.Name\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A synonym of this name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"translation\" type=\"SubstanceSpecification.Name\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A translation for this name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"official\" type=\"SubstanceSpecification.Official\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Details of the official nature of this name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Supporting literature.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSpecification.Official\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"authority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Which authority uses this official name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the official name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Date of official name change.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SubstanceSpecification.Relationship\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A pointer to another substance, as a resource or just a representational code.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"substanceReference\" type=\"Reference\"/>\r\n            <xs:element name=\"substanceCodeableConcept\" type=\"CodeableConcept\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">For example &quot;salt to parent&quot;, &quot;active moiety&quot;, &quot;starting material&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"isDefining\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible substance relationships.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"amountQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"amountRange\" type=\"Range\"/>\r\n            <xs:element name=\"amountRatio\" type=\"Ratio\"/>\r\n            <xs:element name=\"amountString\" type=\"string\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"amountRatioLowLimit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">For use when the numeric.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"amountType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An operator for the amount, for example &quot;average&quot;, &quot;approximately&quot;, &quot;less than&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Supporting literature.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"SupplyDelivery\" type=\"SupplyDelivery\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Record of delivery of what is supplied.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"SupplyDelivery\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Record of delivery of what is supplied.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for the supply delivery event that is used to identify it across multiple disparate systems.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A plan, proposal or order that is fulfilled in whole or in part by this event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A larger event of which this particular event is a component or step.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SupplyDeliveryStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code specifying the state of the dispense event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A link to a resource representing the person whom the delivered item is for.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"suppliedItem\" type=\"SupplyDelivery.SuppliedItem\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The item that is being delivered or has been supplied.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date or time(s) the activity occurred.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"occurrenceTiming\" type=\"Timing\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"supplier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual responsible for dispensing the medication, supplier or device.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"destination\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identification of the facility/location where the Supply was shipped to, as part of the dispense event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"receiver\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the person who picked up the Supply.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SupplyDelivery.SuppliedItem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Record of delivery of what is supplied.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount of supply that has been dispensed. Includes unit of measure.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"itemCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"itemReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SupplyDeliveryStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"in-progress\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Delivered</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"abandoned\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Abandoned</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered In Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SupplyDeliveryStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Status of the supply delivery.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"SupplyDeliveryStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"SupplyRequest\" type=\"SupplyRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a request for a medication, substance or device used in the healthcare setting.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"SupplyRequest\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a request for a medication, substance or device used in the healthcare setting.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this SupplyRequest by the author and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SupplyRequestStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Status of the supply request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Category of supply, e.g.  central, non-stock, etc. This is used to support work flows associated with the supply process.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how quickly this SupplyRequest should be addressed with respect to other requests.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The item that is requested to be supplied. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"itemCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"itemReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"quantity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount that is being ordered of the indicated item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parameter\" type=\"SupplyRequest.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specific parameters for the ordered item.  For example, the size of the indicated item.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the request should be fulfilled.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"occurrenceTiming\" type=\"Timing\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the request was made.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The device, practitioner, etc. who initiated the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supplier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Who is intended to fulfill the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reason why the supply item was requested.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The reason why the supply item was requested.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"deliverFrom\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where the supply is expected to come from.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"deliverTo\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Where the supply is destined to go.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"SupplyRequest.Parameter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A record of a request for a medication, substance or device used in the healthcare setting.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code or string that identifies the device detail being asserted.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the device detail.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueRange\" type=\"Range\"/>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"SupplyRequestStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"draft\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"active\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"suspended\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Suspended</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"SupplyRequestStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Status of the supply request.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"SupplyRequestStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"Task\" type=\"Task\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A task to be performed.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Task\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A task to be performed.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The business identifier for this task.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The URL pointing to an *externally* maintained  protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">BasedOn refers to a higher-level authorization that triggered the creation of the task.  It references a &quot;request&quot; resource such as a ServiceRequest, MedicationRequest, ServiceRequest, CarePlan, etc. which is distinct from the &quot;request&quot; resource the task is seeking to fulfill.  This latter resource is referenced by FocusOn.  For example, based on a ServiceRequest (= BasedOn), a task is created to fulfill a procedureRequest ( = FocusOn ) to collect a specimen from a patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"groupIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier that links together multiple tasks and other requests that were created in the same context.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Task that this particular task is part of.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TaskStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The current status of the task.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanation as to why this task is held, failed, was refused, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"businessStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contains business-specific nuances of the business state.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TaskIntent\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the &quot;level&quot; of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the Task should be addressed with respect to other requests.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A name or code (or both) briefly describing what the task involves.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free-text description of what is to be performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"focus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The request being actioned or the resource being manipulated by this task.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"for\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The entity who benefits from the performance of the service specified in the task (e.g., the patient).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"executionPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date and time this task was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastModified\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date and time of last modification to this task.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The creator of the task.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"performerType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of participant that should perform the task.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"owner\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Individual organization or Device currently responsible for task execution.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Principal physical location where the this task is performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A description or code indicating why this task needs to be performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A resource reference indicating why this task needs to be performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be relevant to the Task.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Free-text information captured about the task as it progresses.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"relevantHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"restriction\" type=\"Task.Restriction\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"input\" type=\"Task.Input\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information that may be needed in the execution of the task.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"output\" type=\"Task.Output\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Outputs produced by the Task.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Task.Restriction\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A task to be performed.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"repetitions\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates the number of times the requested action should occur.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Over what time-period is fulfillment sought.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"recipient\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Task.Input\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A task to be performed.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code or description indicating how the input is intended to be used as part of the task execution.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the input parameter as a basic type.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueCanonical\" type=\"canonical\"/>\r\n            <xs:element name=\"valueCode\" type=\"code\"/>\r\n            <xs:element name=\"valueDate\" type=\"date\"/>\r\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\r\n            <xs:element name=\"valueId\" type=\"id\"/>\r\n            <xs:element name=\"valueInstant\" type=\"instant\"/>\r\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"valueMarkdown\" type=\"markdown\"/>\r\n            <xs:element name=\"valueOid\" type=\"oid\"/>\r\n            <xs:element name=\"valuePositiveInt\" type=\"positiveInt\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueTime\" type=\"time\"/>\r\n            <xs:element name=\"valueUnsignedInt\" type=\"unsignedInt\"/>\r\n            <xs:element name=\"valueUri\" type=\"uri\"/>\r\n            <xs:element name=\"valueUrl\" type=\"url\"/>\r\n            <xs:element name=\"valueUuid\" type=\"uuid\"/>\r\n            <xs:element name=\"valueAddress\" type=\"Address\"/>\r\n            <xs:element name=\"valueAge\" type=\"Age\"/>\r\n            <xs:element name=\"valueAnnotation\" type=\"Annotation\"/>\r\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\r\n            <xs:element name=\"valueContactPoint\" type=\"ContactPoint\"/>\r\n            <xs:element name=\"valueCount\" type=\"Count\"/>\r\n            <xs:element name=\"valueDistance\" type=\"Distance\"/>\r\n            <xs:element name=\"valueDuration\" type=\"Duration\"/>\r\n            <xs:element name=\"valueHumanName\" type=\"HumanName\"/>\r\n            <xs:element name=\"valueIdentifier\" type=\"Identifier\"/>\r\n            <xs:element name=\"valueMoney\" type=\"Money\"/>\r\n            <xs:element name=\"valuePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueRange\" type=\"Range\"/>\r\n            <xs:element name=\"valueRatio\" type=\"Ratio\"/>\r\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\r\n            <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\r\n            <xs:element name=\"valueSignature\" type=\"Signature\"/>\r\n            <xs:element name=\"valueTiming\" type=\"Timing\"/>\r\n            <xs:element name=\"valueContactDetail\" type=\"ContactDetail\"/>\r\n            <xs:element name=\"valueContributor\" type=\"Contributor\"/>\r\n            <xs:element name=\"valueDataRequirement\" type=\"DataRequirement\"/>\r\n            <xs:element name=\"valueExpression\" type=\"Expression\"/>\r\n            <xs:element name=\"valueParameterDefinition\" type=\"ParameterDefinition\"/>\r\n            <xs:element name=\"valueRelatedArtifact\" type=\"RelatedArtifact\"/>\r\n            <xs:element name=\"valueTriggerDefinition\" type=\"TriggerDefinition\"/>\r\n            <xs:element name=\"valueUsageContext\" type=\"UsageContext\"/>\r\n            <xs:element name=\"valueDosage\" type=\"Dosage\"/>\r\n            <xs:element name=\"valueMeta\" type=\"Meta\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Task.Output\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A task to be performed.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the Output parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the Output parameter as a basic type.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueCanonical\" type=\"canonical\"/>\r\n            <xs:element name=\"valueCode\" type=\"code\"/>\r\n            <xs:element name=\"valueDate\" type=\"date\"/>\r\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\r\n            <xs:element name=\"valueId\" type=\"id\"/>\r\n            <xs:element name=\"valueInstant\" type=\"instant\"/>\r\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"valueMarkdown\" type=\"markdown\"/>\r\n            <xs:element name=\"valueOid\" type=\"oid\"/>\r\n            <xs:element name=\"valuePositiveInt\" type=\"positiveInt\"/>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueTime\" type=\"time\"/>\r\n            <xs:element name=\"valueUnsignedInt\" type=\"unsignedInt\"/>\r\n            <xs:element name=\"valueUri\" type=\"uri\"/>\r\n            <xs:element name=\"valueUrl\" type=\"url\"/>\r\n            <xs:element name=\"valueUuid\" type=\"uuid\"/>\r\n            <xs:element name=\"valueAddress\" type=\"Address\"/>\r\n            <xs:element name=\"valueAge\" type=\"Age\"/>\r\n            <xs:element name=\"valueAnnotation\" type=\"Annotation\"/>\r\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\r\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\r\n            <xs:element name=\"valueContactPoint\" type=\"ContactPoint\"/>\r\n            <xs:element name=\"valueCount\" type=\"Count\"/>\r\n            <xs:element name=\"valueDistance\" type=\"Distance\"/>\r\n            <xs:element name=\"valueDuration\" type=\"Duration\"/>\r\n            <xs:element name=\"valueHumanName\" type=\"HumanName\"/>\r\n            <xs:element name=\"valueIdentifier\" type=\"Identifier\"/>\r\n            <xs:element name=\"valueMoney\" type=\"Money\"/>\r\n            <xs:element name=\"valuePeriod\" type=\"Period\"/>\r\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\r\n            <xs:element name=\"valueRange\" type=\"Range\"/>\r\n            <xs:element name=\"valueRatio\" type=\"Ratio\"/>\r\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\r\n            <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\r\n            <xs:element name=\"valueSignature\" type=\"Signature\"/>\r\n            <xs:element name=\"valueTiming\" type=\"Timing\"/>\r\n            <xs:element name=\"valueContactDetail\" type=\"ContactDetail\"/>\r\n            <xs:element name=\"valueContributor\" type=\"Contributor\"/>\r\n            <xs:element name=\"valueDataRequirement\" type=\"DataRequirement\"/>\r\n            <xs:element name=\"valueExpression\" type=\"Expression\"/>\r\n            <xs:element name=\"valueParameterDefinition\" type=\"ParameterDefinition\"/>\r\n            <xs:element name=\"valueRelatedArtifact\" type=\"RelatedArtifact\"/>\r\n            <xs:element name=\"valueTriggerDefinition\" type=\"TriggerDefinition\"/>\r\n            <xs:element name=\"valueUsageContext\" type=\"UsageContext\"/>\r\n            <xs:element name=\"valueDosage\" type=\"Dosage\"/>\r\n            <xs:element name=\"valueMeta\" type=\"Meta\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"TaskStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"draft\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"requested\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Requested</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"received\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Received</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"accepted\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Accepted</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"rejected\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Rejected</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"ready\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Ready</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"cancelled\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"in-progress\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"on-hold\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"failed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Failed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"TaskStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The current status of the task.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"TaskStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"TaskIntent-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"unknown\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"proposal\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Proposal</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"plan\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Plan</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"original-order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Original Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"reflex-order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Reflex Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"filler-order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Filler Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"instance-order\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Instance Order</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"option\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Option</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"TaskIntent\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Distinguishes whether the task is a proposal, plan or full order.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"TaskIntent-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"TerminologyCapabilities\" type=\"TerminologyCapabilities\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"TerminologyCapabilities\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this terminology capabilities when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this terminology capabilities is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the terminology capabilities is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the terminology capabilities when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the terminology capabilities author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the terminology capabilities. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the terminology capabilities.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this terminology capabilities. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this terminology capabilities is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the terminology capabilities was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the terminology capabilities changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the terminology capabilities.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the terminology capabilities from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate terminology capabilities instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the terminology capabilities is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this terminology capabilities is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the terminology capabilities and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the terminology capabilities.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CapabilityStatementKind\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind, not instance of software) or a class of implementation (e.g. a desired purchase).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"software\" type=\"TerminologyCapabilities.Software\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Software that is covered by this terminology capability statement.  It is used when the statement describes the capabilities of a particular software version, independent of an installation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"implementation\" type=\"TerminologyCapabilities.Implementation\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies a specific implementation instance that is described by the terminology capability statement - i.e. a particular installation, rather than the capabilities of a software program.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lockedDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the server supports lockedDate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"codeSystem\" type=\"TerminologyCapabilities.CodeSystem\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies a code system that is supported by the server. If there is a no code system URL, then this declares the general assumptions a client can make about support for any CodeSystem resource.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expansion\" type=\"TerminologyCapabilities.Expansion\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the [ValueSet/$expand](valueset-operation-expand.html) operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"codeSearch\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeSearchSupport\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The degree to which the server supports the code search parameter on ValueSet, if it is supported.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validateCode\" type=\"TerminologyCapabilities.ValidateCode\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the [ValueSet/$validate-code](valueset-operation-validate-code.html) operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"translation\" type=\"TerminologyCapabilities.Translation\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the [ConceptMap/$translate](conceptmap-operation-translate.html) operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"closure\" type=\"TerminologyCapabilities.Closure\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the $closure operation is supported.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TerminologyCapabilities.Software\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name the software is known by.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version identifier for the software covered by this statement.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TerminologyCapabilities.Implementation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the specific installation that this terminology capability statement relates to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"url\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute base URL for the implementation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TerminologyCapabilities.CodeSystem\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"uri\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">URI for the Code System.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" type=\"TerminologyCapabilities.Version\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">For the code system, a list of versions that are supported by the server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"subsumption\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">True if subsumption is supported for this version of the code system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TerminologyCapabilities.Version\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">For version-less code systems, there should be a single version with no identifier.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"isDefault\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If this is the default version for this code system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"compositional\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the compositional grammar defined by the code system is supported.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Language Displays supported.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"filter\" type=\"TerminologyCapabilities.Filter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Filter Properties supported.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"property\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Properties supported for $lookup.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TerminologyCapabilities.Filter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Code of the property supported.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"op\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Operations supported for the property.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TerminologyCapabilities.Expansion\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"hierarchical\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the server can return nested value sets.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"paging\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the server supports paging on expansion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"incomplete\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Allow request for incomplete expansions?</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parameter\" type=\"TerminologyCapabilities.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Supported expansion parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"textFilter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Documentation about text searching works.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TerminologyCapabilities.Parameter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Expansion Parameter name.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of support for parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TerminologyCapabilities.ValidateCode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"translations\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether translations are validated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TerminologyCapabilities.Translation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"needsMap\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether the client must identify the map.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TerminologyCapabilities.Closure\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"translation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If cross-system closure is supported.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"CodeSearchSupport-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"explicit\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Explicit Codes</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"all\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Implicit Codes</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"CodeSearchSupport\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The degree to which the server supports the code search parameter on ValueSet, if it is supported.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"CodeSearchSupport-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"TestReport\" type=\"TestReport\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"TestReport\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifier for the TestScript assigned for external purposes outside the context of FHIR.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language name identifying the executed TestScript.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TestReportStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The current state of this test report.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"testScript\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"result\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TestReportResult\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The overall result from the execution of the TestScript.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"score\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The final score (percentage of tests passed) resulting from the execution of the TestScript.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"tester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name of the tester producing this report (Organization or individual).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"issued\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the TestScript was executed and this TestReport was generated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"participant\" type=\"TestReport.Participant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A participant in the test execution, either the execution engine, a client, or a server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"setup\" type=\"TestReport.Setup\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The results of the series of required setup operations before the tests were executed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"test\" type=\"TestReport.Test\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A test executed from the test script.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"teardown\" type=\"TestReport.Teardown\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestReport.Participant\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TestReportParticipantType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of participant.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"uri\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The uri of the participant. An absolute URL is preferred.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The display name of the participant.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestReport.Setup\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"action\" type=\"TestReport.Action\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Action would contain either an operation or an assertion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestReport.Action\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"operation\" type=\"TestReport.Operation\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The operation performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"assert\" type=\"TestReport.Assert\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The results of the assertion performed on the previous operations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestReport.Operation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"result\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TestReportActionResult\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The result of this operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"message\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanatory message associated with the result.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A link to further details on the result.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestReport.Assert\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"result\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TestReportActionResult\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The result of this assertion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"message\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An explanatory message associated with the result.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A link to further details on the result.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestReport.Test\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of this test used for tracking/logging purposes by test engines.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short description of the test used by test engines for tracking and reporting purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"action\" type=\"TestReport.Action1\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Action would contain either an operation or an assertion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestReport.Action1\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"operation\" type=\"TestReport.Operation\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An operation would involve a REST request to a server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"assert\" type=\"TestReport.Assert\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The results of the assertion performed on the previous operations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestReport.Teardown\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"action\" type=\"TestReport.Action2\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The teardown action will only contain an operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestReport.Action2\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"operation\" type=\"TestReport.Operation\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An operation would involve a REST request to a server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"TestReportStatus-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"completed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"in-progress\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"waiting\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Waiting</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"stopped\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Stopped</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"entered-in-error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Entered In Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"TestReportStatus\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The current status of the test report.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"TestReportStatus-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"TestReportActionResult-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"pass\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Pass</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"skip\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Skip</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"fail\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Fail</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"warning\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Warning</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"error\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"TestReportActionResult\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The results of executing an action.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"TestReportActionResult-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"TestReportParticipantType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"test-engine\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Test Engine</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"client\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Client</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"server\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Server</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"TestReportParticipantType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of participant.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"TestReportParticipantType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"TestReportResult-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"pass\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Pass</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"fail\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Fail</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"pending\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Pending</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"TestReportResult\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The reported execution result.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"TestReportResult-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"TestScript\" type=\"TestScript\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"TestScript\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this test script when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this test script is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the test script is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this test script when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the test script when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test script author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the test script. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the test script.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this test script. Enables tracking the life-cycle of the content.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this test script is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the test script was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test script changes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the test script.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the test script from a consumer's perspective.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate test script instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the test script is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this test script is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"origin\" type=\"TestScript.Origin\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An abstract server used in operations within this test script in the origin element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"destination\" type=\"TestScript.Destination\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An abstract server used in operations within this test script in the destination element.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"metadata\" type=\"TestScript.Metadata\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The required capability must exist and are assumed to function correctly on the FHIR server being tested.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"fixture\" type=\"TestScript.Fixture\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the profile to be used for validation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"variable\" type=\"TestScript.Variable\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Variable is set based either on element value in response body or on header field value in the response headers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"setup\" type=\"TestScript.Setup\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A series of required setup operations before tests are executed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"test\" type=\"TestScript.Test\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A test in this script.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"teardown\" type=\"TestScript.Teardown\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A series of operations required to clean up after all the tests are executed (successfully or otherwise).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Origin\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"index\" minOccurs=\"1\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of origin profile the test system supports.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Destination\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"index\" minOccurs=\"1\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"profile\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of destination profile the test system supports.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Metadata\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"link\" type=\"TestScript.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A link to the FHIR specification that this test is covering.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"capability\" type=\"TestScript.Capability\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Link\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">URL to a particular requirement or feature within the FHIR specification.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Short description of the link.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Capability\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"required\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validated\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Description of the capabilities that this test script is requiring the server to support.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"origin\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Which origin server these requirements apply to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"destination\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Which server these requirements apply to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"link\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Links to the FHIR specification that describes this interaction and the resources involved in more detail.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"capabilities\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Minimum capabilities required of server for test script to execute successfully.   If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Fixture\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"autocreate\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"autodelete\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the resource (containing the contents of the resource needed for operations).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Variable\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Descriptive name for this variable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"defaultValue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A default, hard-coded, or user-defined value for this variable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the variable and its purpose.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"headerField\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"hint\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Displayable text string with hint help information to the user when entering a default value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"path\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">XPath or JSONPath to evaluate against the fixture body.  When variables are defined, only one of either expression, headerField or path must be specified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sourceId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Setup\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"action\" type=\"TestScript.Action\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Action would contain either an operation or an assertion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Action\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"operation\" type=\"TestScript.Operation\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The operation to perform.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"assert\" type=\"TestScript.Assert\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Evaluates the results of previous operations to determine if the server under test behaves appropriately.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Operation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Server interaction or operation type.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the resource.  See http://build.fhir.org/resourcelist.html.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"label\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The label would be used for tracking/logging purposes by test engines.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The description would be used by test engines for tracking and reporting purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"accept\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The mime-type to use for RESTful operation in the 'Accept' header.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contentType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The mime-type to use for RESTful operation in the 'Content-Type' header.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"destination\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encodeRequestUrl\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"TestScriptRequestMethodCode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The HTTP method the test engine MUST use for this operation regardless of any other operation details.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"origin\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"params\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Path plus parameters after [type].  Used to set parts of the request URL explicitly.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requestHeader\" type=\"TestScript.RequestHeader\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Header elements would be used to set HTTP headers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requestId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The fixture id (maybe new) to map to the request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"responseId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The fixture id (maybe new) to map to the response.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sourceId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The id of the fixture used as the body of a PUT or POST request.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"targetId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Complete request URL.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.RequestHeader\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"field\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The HTTP header field e.g. &quot;Accept&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the header e.g. &quot;application/fhir+xml&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Assert\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"label\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The label would be used for tracking/logging purposes by test engines.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The description would be used by test engines for tracking and reporting purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"direction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AssertionDirectionType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The direction to use for the assertion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"compareToSourceId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Id of the source fixture used as the contents to be evaluated by either the &quot;source/expression&quot; or &quot;sourceId/path&quot; definition.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"compareToSourceExpression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"compareToSourcePath\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contentType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The mime-type contents to compare against the request or response message 'Content-Type' header.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"headerField\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The HTTP header field name e.g. 'Location'.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"minimumId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"navigationLinks\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether or not the test execution performs validation on the bundle navigation links.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"operator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AssertionOperatorType\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The operator type defines the conditional behavior of the assert. If not defined, the default is equals.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"path\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requestMethod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"TestScriptRequestMethodCode\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The request method or HTTP operation code to compare against that used by the client system under test.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"requestURL\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value to use in a comparison against the request URL path string.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The type of the resource.  See http://build.fhir.org/resourcelist.html.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"response\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AssertionResponseTypes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"responseCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the HTTP response code to be tested.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sourceId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Fixture to evaluate the XPath/JSONPath expression or the headerField  against.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validateProfileId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The ID of the Profile to validate against.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value to compare to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"warningOnly\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether or not the test execution will produce a warning only on error for this assert.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Test\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of this test used for tracking/logging purposes by test engines.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short description of the test used by test engines for tracking and reporting purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"action\" type=\"TestScript.Action1\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Action would contain either an operation or an assertion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Action1\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"operation\" type=\"TestScript.Operation\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An operation would involve a REST request to a server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"assert\" type=\"TestScript.Assert\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Evaluates the results of previous operations to determine if the server under test behaves appropriately.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Teardown\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"action\" type=\"TestScript.Action2\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The teardown action will only contain an operation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"TestScript.Action2\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"operation\" type=\"TestScript.Operation\" minOccurs=\"1\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An operation would involve a REST request to a server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AssertionDirectionType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"response\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">response</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"request\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">request</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AssertionDirectionType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of direction to use for assertion.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AssertionDirectionType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AssertionOperatorType-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"equals\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">equals</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"notEquals\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">notEquals</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"in\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">in</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"notIn\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">notIn</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"greaterThan\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">greaterThan</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"lessThan\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">lessThan</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"empty\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">empty</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"notEmpty\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">notEmpty</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"contains\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">contains</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"notContains\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">notContains</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"eval\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">evaluate</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AssertionOperatorType\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of operator to use for assertion.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AssertionOperatorType-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"AssertionResponseTypes-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"okay\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">okay</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"created\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">created</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"noContent\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">noContent</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"notModified\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">notModified</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"bad\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">bad</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"forbidden\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">forbidden</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"notFound\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">notFound</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"methodNotAllowed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">methodNotAllowed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"conflict\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">conflict</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"gone\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">gone</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"preconditionFailed\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">preconditionFailed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"unprocessable\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">unprocessable</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"AssertionResponseTypes\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The type of response code to use for assertion.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"AssertionResponseTypes-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"TestScriptRequestMethodCode-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"delete\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">DELETE</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"get\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">GET</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"options\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">OPTIONS</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"patch\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PATCH</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"post\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">POST</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"put\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">PUT</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"head\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">HEAD</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"TestScriptRequestMethodCode\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The allowable request method or HTTP operation codes.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"TestScriptRequestMethodCode-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"ValueSet\" type=\"ValueSet\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"ValueSet\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this value set when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this value set is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the value set is stored on different servers.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the value set author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the value set. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the value set.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of this value set. Enables tracking the life-cycle of the content. The status of the value set applies to the value set definition (ValueSet.compose) and the associated ValueSet metadata. Expansions do not have a state.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this value set is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date (and optionally time) when the value set was created or revised (e.g. the 'content logical definition').</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the value set.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the value set from a consumer's perspective. The textual description specifies the span of meanings for concepts to be included within the Value Set Expansion, and also may specify the intended use and limitations of the Value Set.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate value set instances.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the value set is intended to be used.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"immutable\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Explanation of why this value set is needed and why it has been designed as it has.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"compose\" type=\"ValueSet.Compose\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A set of criteria that define the contents of the value set by including or excluding codes selected from the specified code system(s) that the value set draws from. This is also known as the Content Logical Definition (CLD).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"expansion\" type=\"ValueSet.Expansion\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A value set can also be &quot;expanded&quot;, where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ValueSet.Compose\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"lockedDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The Locked Date is  the effective date that is used to determine the version of all referenced Code Systems and Value Set Definitions included in the compose that are not already tied to a specific version.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"inactive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable $expand parameters (but generally, inactive codes would be expected to be included).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"include\" type=\"ValueSet.Include\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Include one or more codes from a code system or other value set(s).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"exclude\" type=\"ValueSet.Include\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Exclude one or more codes from the value set based on code system filters and/or other value sets.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ValueSet.Include\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"system\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI which is the code system from which the selected codes come from.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version of the code system that the codes are selected from, or the special version '*' for all versions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"concept\" type=\"ValueSet.Concept\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies a concept to be included or excluded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"filter\" type=\"ValueSet.Filter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Select concepts by specify a matching criterion based on the properties (including relationships) defined by the system, or on filters defined by the system. If multiple filters are specified, they SHALL all be true.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"valueSet\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Selects the concepts found in this value set (based on its value set definition). This is an absolute URI that is a reference to ValueSet.url.  If multiple value sets are specified this includes the union of the contents of all of the referenced value sets.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ValueSet.Concept\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Specifies a code for the concept to be included or excluded.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"designation\" type=\"ValueSet.Designation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ValueSet.Designation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The language this designation is defined for.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"use\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that represents types of uses of designations.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The text value for this designation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ValueSet.Filter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"property\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code that identifies a property or a filter defined in the code system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"op\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FilterOperator\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The kind of operation to perform as a part of the filter criteria.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value  (if the filter represents a property defined in CodeSystem) or of the system filter value (if the filter represents a filter defined in CodeSystem) when the operation is 'regex', or one of the values (true and false), when the operation is 'exists'.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ValueSet.Expansion\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier that uniquely identifies this expansion of the valueset, based on a unique combination of the provided parameters, the system default parameters, and the underlying system code system versions etc. Systems may re-use the same identifier as long as those factors remain the same, and the expansion is the same, but are not required to do so. This is a business identifier.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"timestamp\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The time at which the expansion was produced by the expanding system.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"total\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"offset\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If paging is being used, the offset at which this resource starts.  I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL NOT be present.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"parameter\" type=\"ValueSet.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contains\" type=\"ValueSet.Contains\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The codes that are contained in the value set expansion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ValueSet.Parameter\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Name of the input parameter to the $expand operation; may be a server-assigned name for additional default or other server-supplied parameters used to control the expansion process.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The value of the parameter.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"valueString\" type=\"string\"/>\r\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\r\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\r\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\r\n            <xs:element name=\"valueUri\" type=\"uri\"/>\r\n            <xs:element name=\"valueCode\" type=\"code\"/>\r\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"ValueSet.Contains\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"system\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An absolute URI which is the code system in which the code for this item in the expansion is defined.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"abstract\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"inactive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understanding legacy data. It might not be known or specified whether an concept is inactive (and it may depend on the context of use).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The version of the code system from this code was taken. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The recommended display for this item in the expansion.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"designation\" type=\"ValueSet.Designation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional representations for this item - other languages, aliases, specialized purposes, used for particular purposes, etc. These are relevant when the conditions of the expansion do not fix to a single correct representation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"contains\" type=\"ValueSet.Contains\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Other codes and entries contained under this entry in the hierarchy.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"VerificationResult\" type=\"VerificationResult\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes validation requirements, source(s), status and dates for one or more elements.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"VerificationResult\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes validation requirements, source(s), status and dates for one or more elements.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"target\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A resource that was validated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"targetLocation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The fhirpath location(s) within the resource that was validated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"need\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The frequency with which the target must be validated (none; initial; periodic).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"status\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The validation status of the target (attested; validated; in process; requires revalidation; validation failed; revalidation failed).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the validation status was updated.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validationType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">What the target is validated against (nothing; primary source; multiple sources).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validationProcess\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The primary process by which the target is validated (edit check; value set; primary source; multiple sources; standalone; in context).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"frequency\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Timing\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Frequency of revalidation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lastPerformed\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date/time validation was last completed (including failed validations).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"nextScheduled\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date when target is next validated, if appropriate.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"failureAction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The result if validation fails (fatal; warning; record only; none).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"primarySource\" type=\"VerificationResult.PrimarySource\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the primary source(s) involved in validation.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"attestation\" type=\"VerificationResult.Attestation\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the entity attesting to information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validator\" type=\"VerificationResult.Validator\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Information about the entity validating information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"VerificationResult.PrimarySource\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes validation requirements, source(s), status and dates for one or more elements.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"who\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the primary source.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of primary source (License Board; Primary Education; Continuing Education; Postal Service; Relationship owner; Registration Authority; legal source; issuing source; authoritative source).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"communicationMethod\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Method for communicating with the primary source (manual; API; Push).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validationStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Status of the validation of the target against the primary source (successful; failed; unknown).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"validationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the target was validated against the primary source.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"canPushUpdates\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Ability of the primary source to push updates/alerts (yes; no; undetermined).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"pushTypeAvailable\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Type of alerts/updates the primary source can send (specific requested changes; any changes; as defined by source).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"VerificationResult.Attestation\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes validation requirements, source(s), status and dates for one or more elements.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"who\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The individual or organization attesting to information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"onBehalfOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">When the who is asserting on behalf of another (organization or individual).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"communicationMethod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The method by which attested information was submitted/retrieved (manual; API; Push).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date the information was attested to.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sourceIdentityCertificate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A digital identity certificate associated with the attestation source.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"proxyIdentityCertificate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"proxySignature\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Signature\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Signed assertion by the proxy entity indicating that they have the right to submit attested information on behalf of the attestation source.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sourceSignature\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Signature\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Signed assertion by the attestation source that they have attested to the information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"VerificationResult.Validator\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes validation requirements, source(s), status and dates for one or more elements.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"organization\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Reference to the organization validating information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"identityCertificate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A digital identity certificate associated with the validator.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"attestationSignature\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Signature\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Signed assertion by the validator that they have validated the information.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"status-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"attested\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Attested</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"validated\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Validated</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"in-process\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In process</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"req-revalid\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Requires revalidation</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"val-fail\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Validation failed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"reval-fail\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Re-Validation failed</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"status\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">The validation status of the target.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"status-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:element name=\"VisionPrescription\" type=\"VisionPrescription\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An authorization for the provision of glasses and/or contact lenses to a patient.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"VisionPrescription\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An authorization for the provision of glasses and/or contact lenses to a patient.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this vision prescription.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date this resource was created.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A resource reference to the person to whom the vision prescription applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A reference to a resource that identifies the particular occurrence of contact between patient and health care provider during which the prescription was issued.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dateWritten\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date (and perhaps time) when the prescription was written.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"prescriber\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The healthcare professional responsible for authorizing the prescription.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"lensSpecification\" type=\"VisionPrescription.LensSpecification\" minOccurs=\"1\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contain the details of  the individual lens specifications and serves as the authorization for the fullfillment by certified professionals.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"VisionPrescription.LensSpecification\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An authorization for the provision of glasses and/or contact lenses to a patient.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"product\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the type of vision correction product which is required for the patient.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"eye\" minOccurs=\"1\" maxOccurs=\"1\" type=\"VisionEyes\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The eye for which the lens specification applies.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"sphere\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Lens power measured in dioptres (0.25 units).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"cylinder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Power adjustment for astigmatism measured in dioptres (0.25 units).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"axis\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Adjustment for astigmatism measured in integer degrees.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"prism\" type=\"VisionPrescription.Prism\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Allows for adjustment on two axis.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"add\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Power adjustment for multifocal lenses measured in dioptres (0.25 units).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"power\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact lens power measured in dioptres (0.25 units).</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"backCurve\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Back curvature measured in millimetres.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"diameter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Contact lens diameter measured in millimetres.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"duration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The recommended maximum wear period for the lens.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"color\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Special color or pattern.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"brand\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Brand recommendations or restrictions.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Notes for special requirements such as coatings and lens materials.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"VisionPrescription.Prism\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">An authorization for the provision of glasses and/or contact lenses to a patient.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"amount\" minOccurs=\"1\" maxOccurs=\"1\" type=\"decimal\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Amount of prism to compensate for eye alignment in fractional units.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"base\" minOccurs=\"1\" maxOccurs=\"1\" type=\"VisionBase\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The relative base, or reference lens edge, for the prism.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"VisionBase-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"up\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Up</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"down\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Down</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"in\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">In</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"out\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Out</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"VisionBase\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A coded concept listing the base codes.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"VisionBase-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:simpleType name=\"VisionEyes-list\">\r\n    <xs:restriction base=\"code-primitive\">\r\n      <xs:enumeration value=\"right\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Right Eye</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n      <xs:enumeration value=\"left\">\r\n        <xs:annotation>\r\n          <xs:documentation xml:lang=\"en\">Left Eye</xs:documentation>\r\n        </xs:annotation>\r\n      </xs:enumeration>\r\n    </xs:restriction>\r\n  </xs:simpleType>\r\n  <xs:complexType name=\"VisionEyes\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A coded concept listing the eye codes.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"Element\">\r\n        <xs:attribute name=\"value\" type=\"VisionEyes-list\" use=\"optional\"/>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n</xs:schema>\r\n"
  },
  {
    "path": "tests/static/xsd/fhir/fhir-xhtml.xsd",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://www.w3.org/1999/xhtml\" elementFormDefault=\"qualified\" version=\"1.0\" xml:lang=\"en\">\n  <!--\n  FHIR XHTML Schema\n  \n  This is a pared down modification of the XHTML schema published by the W3C. \n  it does not allow any of the content that the FHIR specification bans. \n  \n  Note that you can replace this schema with the standard W3C schema - this \n  will still work, but will allow XHTML that is not valid. You might want to \n  do this if you already have the standard XHTML schema in your schema cache, \n  for instance\n  \n  The content that is restricted to not appear:\n    - javascript attributes and the script element\n    - head, body etc (FHIR just uses div)\n    - forms, objects, and inserted and deleted text\n  -->\n  <!-- Note: When using this schema with some tools, it may also be necessary to declare xmlns:xml=\"http://www.w3.org/XML/1998/namespace\", however this causes performance issues with other tools and thus is not in the base schemas. -->\n  <xs:annotation>\n    <xs:documentation>\n    XHTML 1.0 (Second Edition) Strict in XML Schema\n\n    This is the same as HTML 4 Strict except for\n    changes due to the differences between XML and SGML.\n\n    Namespace = http://www.w3.org/1999/xhtml\n\n    For further information, see: http://www.w3.org/TR/xhtml1\n\n    Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),\n    All Rights Reserved. \n\n    The DTD version is identified by the PUBLIC and SYSTEM identifiers:\n\n    PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n    SYSTEM \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"\n\n    _id: xhtml1-strict.xsd,v 1.2 2002/08/28 08:05:44 mimasa Exp $\n    </xs:documentation>\n  </xs:annotation>\n  <xs:import namespace=\"http://www.w3.org/XML/1998/namespace\" schemaLocation=\"xml.xsd\"/>\n  <xs:annotation>\n    <xs:documentation>\n    ================ Character mnemonic entities =========================\n\n    XHTML entity sets are identified by the PUBLIC and SYSTEM identifiers:\n  \n    PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\"\n    SYSTEM \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\"\n\n    PUBLIC \"-//W3C//ENTITIES Special for XHTML//EN\"\n    SYSTEM \"http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent\"\n\n    PUBLIC \"-//W3C//ENTITIES Symbols for XHTML//EN\"\n    SYSTEM \"http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent\"\n    </xs:documentation>\n  </xs:annotation>\n  <xs:annotation>\n    <xs:documentation>\n    ================== Imported Names ====================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:simpleType name=\"ContentType\">\n    <xs:annotation>\n      <xs:documentation>\n      media type, as per [RFC2045]\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\"/>\n  </xs:simpleType>\n  <xs:simpleType name=\"ContentTypes\">\n    <xs:annotation>\n      <xs:documentation>\n      comma-separated list of media types, as per [RFC2045]\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\"/>\n  </xs:simpleType>\n  <xs:simpleType name=\"Charset\">\n    <xs:annotation>\n      <xs:documentation>\n      a character encoding, as per [RFC2045]\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\"/>\n  </xs:simpleType>\n  <xs:simpleType name=\"Charsets\">\n    <xs:annotation>\n      <xs:documentation>\n      a space separated list of character encodings, as per [RFC2045]\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\"/>\n  </xs:simpleType>\n  <xs:simpleType name=\"LanguageCode\">\n    <xs:annotation>\n      <xs:documentation>\n      a language code, as per [RFC3066]\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:language\"/>\n  </xs:simpleType>\n  <xs:simpleType name=\"Character\">\n    <xs:annotation>\n      <xs:documentation>\n      a single character, as per section 2.2 of [XML]\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\">\n      <xs:length value=\"1\" fixed=\"true\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:simpleType name=\"Number\">\n    <xs:annotation>\n      <xs:documentation>\n      one or more digits\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:nonNegativeInteger\">\n      <xs:pattern value=\"[0-9]+\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:simpleType name=\"tabindexNumber\">\n    <xs:annotation>\n      <xs:documentation>\n      tabindex attribute specifies the position of the current element\n      in the tabbing order for the current document. This value must be\n      a number between 0 and 32767. User agents should ignore leading zeros. \n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"Number\">\n      <xs:minInclusive value=\"0\"/>\n      <xs:maxInclusive value=\"32767\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:simpleType name=\"LinkTypes\">\n    <xs:annotation>\n      <xs:documentation>\n      space-separated list of link types\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:NMTOKENS\"/>\n  </xs:simpleType>\n  <xs:simpleType name=\"MediaDesc\">\n    <xs:annotation>\n      <xs:documentation>\n      single or comma-separated list of media descriptors\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\">\n      <xs:pattern value=\"[^,]+(,\\s*[^,]+)*\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:simpleType name=\"URI\">\n    <xs:annotation>\n      <xs:documentation>\n      a Uniform Resource Identifier, see [RFC2396]\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:anyURI\"/>\n  </xs:simpleType>\n  <xs:simpleType name=\"UriList\">\n    <xs:annotation>\n      <xs:documentation>\n      a space separated list of Uniform Resource Identifiers\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\"/>\n  </xs:simpleType>\n  <xs:simpleType name=\"Datetime\">\n    <xs:annotation>\n      <xs:documentation>\n      date and time information. ISO date format\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:dateTime\"/>\n  </xs:simpleType>\n  <xs:simpleType name=\"Script\">\n    <xs:annotation>\n      <xs:documentation>\n      script expression\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\"/>\n  </xs:simpleType>\n  <xs:simpleType name=\"StyleSheet\">\n    <xs:annotation>\n      <xs:documentation>\n      style sheet data\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\"/>\n  </xs:simpleType>\n  <xs:simpleType name=\"Text\">\n    <xs:annotation>\n      <xs:documentation>\n      used for titles etc.\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\"/>\n  </xs:simpleType>\n  <xs:simpleType name=\"Length\">\n    <xs:annotation>\n      <xs:documentation>\n      nn for pixels or nn% for percentage length\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\">\n      <xs:pattern value=\"[-+]?(\\d+|\\d+(\\.\\d+)?%)\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:simpleType name=\"MultiLength\">\n    <xs:annotation>\n      <xs:documentation>\n      pixel, percentage, or relative\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\">\n      <xs:pattern value=\"[-+]?(\\d+|\\d+(\\.\\d+)?%)|[1-9]?(\\d+)?\\*\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:simpleType name=\"Pixels\">\n    <xs:annotation>\n      <xs:documentation>\n      integer representing length in pixels\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:nonNegativeInteger\"/>\n  </xs:simpleType>\n  <xs:annotation>\n    <xs:documentation>\n    these are used for image maps\n    </xs:documentation>\n  </xs:annotation>\n  <xs:simpleType name=\"Shape\">\n    <xs:restriction base=\"xs:token\">\n      <xs:enumeration value=\"rect\"/>\n      <xs:enumeration value=\"circle\"/>\n      <xs:enumeration value=\"poly\"/>\n      <xs:enumeration value=\"default\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:simpleType name=\"Coords\">\n    <xs:annotation>\n      <xs:documentation>\n      comma separated list of lengths\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:string\">\n      <xs:pattern value=\"[-+]?(\\d+|\\d+(\\.\\d+)?%)(,\\s*[-+]?(\\d+|\\d+(\\.\\d+)?%))*\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:annotation>\n    <xs:documentation>\n    =================== Generic Attributes ===============================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:attributeGroup name=\"coreattrs\">\n    <xs:annotation>\n      <xs:documentation>\n      core attributes common to most elements\n      id       document-wide unique id\n      class    space separated list of classes\n      style    associated style info\n      title    advisory title/amplification\n      </xs:documentation>\n    </xs:annotation>\n    <xs:attribute name=\"id\" type=\"xs:ID\"/>\n    <xs:attribute name=\"class\" type=\"xs:NMTOKENS\"/>\n    <xs:attribute name=\"style\" type=\"StyleSheet\"/>\n    <xs:attribute name=\"title\" type=\"Text\"/>\n  </xs:attributeGroup>\n  <xs:attributeGroup name=\"i18n\">\n    <xs:annotation>\n      <xs:documentation>\n      internationalization attributes\n      lang        language code (backwards compatible)\n      xml:lang    language code (as per XML 1.0 spec)\n      dir         direction for weak/neutral text\n      </xs:documentation>\n    </xs:annotation>\n    <xs:attribute name=\"lang\" type=\"LanguageCode\"/>\n    <xs:attribute ref=\"xml:lang\"/>\n    <xs:attribute name=\"dir\">\n      <xs:simpleType>\n        <xs:restriction base=\"xs:token\">\n          <xs:enumeration value=\"ltr\"/>\n          <xs:enumeration value=\"rtl\"/>\n        </xs:restriction>\n      </xs:simpleType>\n    </xs:attribute>\n  </xs:attributeGroup>\n  <xs:attributeGroup name=\"events\">\n    <xs:annotation>\n      <xs:documentation>\n      attributes for common UI events\n      onclick     a pointer button was clicked\n      ondblclick  a pointer button was double clicked\n      onmousedown a pointer button was pressed down\n      onmouseup   a pointer button was released\n      onmousemove a pointer was moved onto the element\n      onmouseout  a pointer was moved away from the element\n      onkeypress  a key was pressed and released\n      onkeydown   a key was pressed down\n      onkeyup     a key was released\n      </xs:documentation>\n    </xs:annotation>\n    <!--\n  FHIR: Active Content is not allowed:\n    <xs:attribute name=\"onclick\" type=\"Script\"/>\n    <xs:attribute name=\"ondblclick\" type=\"Script\"/>\n    <xs:attribute name=\"onmousedown\" type=\"Script\"/>\n    <xs:attribute name=\"onmouseup\" type=\"Script\"/>\n    <xs:attribute name=\"onmouseover\" type=\"Script\"/>\n    <xs:attribute name=\"onmousemove\" type=\"Script\"/>\n    <xs:attribute name=\"onmouseout\" type=\"Script\"/>\n    <xs:attribute name=\"onkeypress\" type=\"Script\"/>\n    <xs:attribute name=\"onkeydown\" type=\"Script\"/>\n    <xs:attribute name=\"onkeyup\" type=\"Script\"/>\n-->\n  </xs:attributeGroup>\n  <xs:attributeGroup name=\"focus\">\n    <xs:annotation>\n      <xs:documentation>\n      attributes for elements that can get the focus\n      accesskey   accessibility key character\n      tabindex    position in tabbing order\n      onfocus     the element got the focus\n      onblur      the element lost the focus\n      </xs:documentation>\n    </xs:annotation>\n    <xs:attribute name=\"accesskey\" type=\"Character\"/>\n    <xs:attribute name=\"tabindex\" type=\"tabindexNumber\"/>\n    <!--\n    <xs:attribute name=\"onfocus\" type=\"Script\"/>\n    <xs:attribute name=\"onblur\" type=\"Script\"/>\n-->\n  </xs:attributeGroup>\n  <xs:attributeGroup name=\"attrs\">\n    <xs:attributeGroup ref=\"coreattrs\"/>\n    <xs:attributeGroup ref=\"i18n\"/>\n    <xs:attributeGroup ref=\"events\"/>\n  </xs:attributeGroup>\n  <xs:annotation>\n    <xs:documentation>\n    =================== Text Elements ====================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:group name=\"special.pre\">\n    <xs:choice>\n      <xs:element ref=\"br\"/>\n      <xs:element ref=\"span\"/>\n      <xs:element ref=\"bdo\"/>\n      <xs:element ref=\"map\"/>\n    </xs:choice>\n  </xs:group>\n  <xs:group name=\"special\">\n    <xs:choice>\n      <xs:group ref=\"special.pre\"/>\n      <!--\n  FHIR: active content is not allowed\n      <xs:element ref=\"object\"/>\n-->\n      <xs:element ref=\"img\"/>\n    </xs:choice>\n  </xs:group>\n  <xs:group name=\"fontstyle\">\n    <xs:choice>\n      <xs:element ref=\"tt\"/>\n      <xs:element ref=\"i\"/>\n      <xs:element ref=\"b\"/>\n      <xs:element ref=\"big\"/>\n      <xs:element ref=\"small\"/>\n    </xs:choice>\n  </xs:group>\n  <xs:group name=\"phrase\">\n    <xs:choice>\n      <xs:element ref=\"em\"/>\n      <xs:element ref=\"strong\"/>\n      <xs:element ref=\"dfn\"/>\n      <xs:element ref=\"code\"/>\n      <xs:element ref=\"q\"/>\n      <xs:element ref=\"samp\"/>\n      <xs:element ref=\"kbd\"/>\n      <xs:element ref=\"var\"/>\n      <xs:element ref=\"cite\"/>\n      <xs:element ref=\"abbr\"/>\n      <xs:element ref=\"acronym\"/>\n      <xs:element ref=\"sub\"/>\n      <xs:element ref=\"sup\"/>\n    </xs:choice>\n  </xs:group>\n  <!--\n  FHIR: forms are not allowed \n  <xs:group name=\"inline.forms\">\n    <xs:choice>\n      <xs:element ref=\"input\"/>\n      <xs:element ref=\"select\"/>\n      <xs:element ref=\"textarea\"/>\n      <xs:element ref=\"label\"/>\n      <xs:element ref=\"button\"/>\n    </xs:choice>\n  </xs:group>\n-->\n  <!--\n  FHIR: specifically not allowed \n  <xs:group name=\"misc.inline\">\n    <xs:choice>\n      <xs:element ref=\"ins\"/>\n      <xs:element ref=\"del\"/>\n      <xs:element ref=\"script\"/>\n    </xs:choice>\n  </xs:group>\n  <xs:group name=\"misc\">\n    <xs:annotation>\n      <xs:documentation>\n      these can only occur at block level\n      </xs:documentation>\n    </xs:annotation>\n    <xs:choice>\n      <xs:element ref=\"noscript\"/>\n      <xs:group ref=\"misc.inline\"/>\n    </xs:choice>\n  </xs:group>\n-->\n  <xs:group name=\"inline\">\n    <xs:choice>\n      <xs:element ref=\"a\"/>\n      <xs:group ref=\"special\"/>\n      <xs:group ref=\"fontstyle\"/>\n      <xs:group ref=\"phrase\"/>\n      <!--\n      <xs:group ref=\"inline.forms\"/>\n -->\n    </xs:choice>\n  </xs:group>\n  <xs:complexType name=\"Inline\" mixed=\"true\">\n    <xs:annotation>\n      <xs:documentation>\n      \"Inline\" covers inline or \"text-level\" elements\n      </xs:documentation>\n    </xs:annotation>\n    <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n      <xs:group ref=\"inline\"/>\n      <!--      <xs:group ref=\"misc.inline\"/> -->\n    </xs:choice>\n  </xs:complexType>\n  <xs:annotation>\n    <xs:documentation>\n    ================== Block level elements ==============================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:group name=\"heading\">\n    <xs:choice>\n      <xs:element ref=\"h1\"/>\n      <xs:element ref=\"h2\"/>\n      <xs:element ref=\"h3\"/>\n      <xs:element ref=\"h4\"/>\n      <xs:element ref=\"h5\"/>\n      <xs:element ref=\"h6\"/>\n    </xs:choice>\n  </xs:group>\n  <xs:group name=\"lists\">\n    <xs:choice>\n      <xs:element ref=\"ul\"/>\n      <xs:element ref=\"ol\"/>\n      <xs:element ref=\"dl\"/>\n    </xs:choice>\n  </xs:group>\n  <xs:group name=\"blocktext\">\n    <xs:choice>\n      <xs:element ref=\"pre\"/>\n      <xs:element ref=\"hr\"/>\n      <xs:element ref=\"blockquote\"/>\n      <xs:element ref=\"address\"/>\n    </xs:choice>\n  </xs:group>\n  <xs:group name=\"block\">\n    <xs:choice>\n      <xs:element ref=\"p\"/>\n      <xs:group ref=\"heading\"/>\n      <xs:element ref=\"div\"/>\n      <xs:group ref=\"lists\"/>\n      <xs:group ref=\"blocktext\"/>\n      <!--      <xs:element ref=\"fieldset\"/> -->\n      <xs:element ref=\"table\"/>\n    </xs:choice>\n  </xs:group>\n  <xs:complexType name=\"Block\">\n    <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n      <xs:group ref=\"block\"/>\n      <!--\n  FHIR: no forms\n      <xs:element ref=\"form\"/>\n      <xs:group ref=\"misc\"/>\n-->\n    </xs:choice>\n  </xs:complexType>\n  <xs:complexType name=\"Flow\" mixed=\"true\">\n    <xs:annotation>\n      <xs:documentation>\n      \"Flow\" mixes block and inline and is used for list items etc.\n      </xs:documentation>\n    </xs:annotation>\n    <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n      <xs:group ref=\"block\"/>\n      <xs:group ref=\"inline\"/>\n      <!--\n      <xs:element ref=\"form\"/>\n      <xs:group ref=\"misc\"/>\n-->\n    </xs:choice>\n  </xs:complexType>\n  <xs:annotation>\n    <xs:documentation>\n    ================== Content models for exclusions =====================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:complexType name=\"a.content\" mixed=\"true\">\n    <xs:annotation>\n      <xs:documentation>\n      a elements use \"Inline\" excluding a\n      </xs:documentation>\n    </xs:annotation>\n    <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n      <xs:group ref=\"special\"/>\n      <xs:group ref=\"fontstyle\"/>\n      <xs:group ref=\"phrase\"/>\n      <!--\n      <xs:group ref=\"inline.forms\"/>\n      <xs:group ref=\"misc.inline\"/>\n-->\n    </xs:choice>\n  </xs:complexType>\n  <xs:complexType name=\"pre.content\" mixed=\"true\">\n    <xs:annotation>\n      <xs:documentation>\n      pre uses \"Inline\" excluding big, small, sup or sup\n      </xs:documentation>\n    </xs:annotation>\n    <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n      <xs:element ref=\"a\"/>\n      <xs:group ref=\"fontstyle\"/>\n      <xs:group ref=\"phrase\"/>\n      <xs:group ref=\"special.pre\"/>\n      <!--\n      <xs:group ref=\"misc.inline\"/>\n      <xs:group ref=\"inline.forms\"/>\n-->\n    </xs:choice>\n  </xs:complexType>\n  <!-- \n  <xs:complexType name=\"form.content\">\n    <xs:annotation>\n      <xs:documentation>\n      form uses \"Block\" excluding form\n      </xs:documentation>\n    </xs:annotation>\n    <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n      <xs:group ref=\"block\"/>\n      <xs:group ref=\"misc\"/>\n      </xs:choice>\n  </xs:complexType>\n  <xs:complexType name=\"button.content\" mixed=\"true\">\n    <xs:annotation>\n      <xs:documentation>\n      button uses \"Flow\" but excludes a, form and form controls\n      </xs:documentation>\n    </xs:annotation>\n    <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n      <xs:element ref=\"p\"/>\n      <xs:group ref=\"heading\"/>\n      <xs:element ref=\"div\"/>\n      <xs:group ref=\"lists\"/>\n      <xs:group ref=\"blocktext\"/>\n      <xs:element ref=\"table\"/>\n      <xs:group ref=\"special\"/>\n      <xs:group ref=\"fontstyle\"/>\n      <xs:group ref=\"phrase\"/>\n      <xs:group ref=\"misc\"/> \n    </xs:choice>\n  </xs:complexType>\n-->\n  <xs:annotation>\n    <xs:documentation>\n    ================ Document Structure ==================================\n    </xs:documentation>\n  </xs:annotation>\n  <!--\n  FHIR: doesn't use the structure of <html> / <body> - jump straight into div instead\n  <xs:element name=\"html\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"head\"/>\n        <xs:element ref=\"body\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"i18n\"/>\n      <xs:attribute name=\"id\" type=\"xs:ID\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    ================ Document Head =======================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:group name=\"head.misc\">\n    <xs:sequence>\n      <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n        <xs:element ref=\"script\"/>\n        <xs:element ref=\"style\"/>\n        <xs:element ref=\"meta\"/>\n        <xs:element ref=\"link\"/>\n        <xs:element ref=\"object\"/>\n      </xs:choice>\n    </xs:sequence>\n  </xs:group>\n  <xs:element name=\"head\">\n    <xs:annotation>\n      <xs:documentation>\n      content model is \"head.misc\" combined with a single\n      title and an optional base element in any order\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:sequence>\n        <xs:group ref=\"head.misc\"/>\n        <xs:choice>\n          <xs:sequence>\n            <xs:element ref=\"title\"/>\n            <xs:group ref=\"head.misc\"/>\n            <xs:sequence minOccurs=\"0\">\n              <xs:element ref=\"base\"/>\n              <xs:group ref=\"head.misc\"/>\n            </xs:sequence>\n          </xs:sequence>\n          <xs:sequence>\n            <xs:element ref=\"base\"/>\n            <xs:group ref=\"head.misc\"/>\n            <xs:element ref=\"title\"/>\n            <xs:group ref=\"head.misc\"/>\n          </xs:sequence>\n        </xs:choice>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"i18n\"/>\n      <xs:attribute name=\"id\" type=\"xs:ID\"/>\n      <xs:attribute name=\"profile\" type=\"URI\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"title\">\n    <xs:annotation>\n      <xs:documentation>\n      The title element is not considered part of the flow of text.\n      It should be displayed, for example as the page header or\n      window title. Exactly one title is required per document.\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:attributeGroup ref=\"i18n\"/>\n      <xs:attribute name=\"id\" type=\"xs:ID\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"base\">\n    <xs:annotation>\n      <xs:documentation>\n      document base URI\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:attribute name=\"href\" type=\"URI\" use=\"required\"/>\n      <xs:attribute name=\"id\" type=\"xs:ID\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"meta\">\n    <xs:annotation>\n      <xs:documentation>\n      generic metainformation\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:attributeGroup ref=\"i18n\"/>\n      <xs:attribute name=\"id\" type=\"xs:ID\"/>\n      <xs:attribute name=\"http-equiv\"/>\n      <xs:attribute name=\"name\"/>\n      <xs:attribute name=\"content\" use=\"required\"/>\n      <xs:attribute name=\"scheme\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"link\">\n    <xs:annotation>\n      <xs:documentation>\n      Relationship values can be used in principle:\n\n      a) for document specific toolbars/menus when used\n         with the link element in document head e.g.\n           start, contents, previous, next, index, end, help\n      b) to link to a separate style sheet (rel=\"stylesheet\")\n      c) to make a link to a script (rel=\"script\")\n      d) by stylesheets to control how collections of\n         html nodes are rendered into printed documents\n      e) to make a link to a printable version of this document\n         e.g. a PostScript or PDF version (rel=\"alternate\" media=\"print\")\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attribute name=\"charset\" type=\"Charset\"/>\n      <xs:attribute name=\"href\" type=\"URI\"/>\n      <xs:attribute name=\"hreflang\" type=\"LanguageCode\"/>\n      <xs:attribute name=\"type\" type=\"ContentType\"/>\n      <xs:attribute name=\"rel\" type=\"LinkTypes\"/>\n      <xs:attribute name=\"rev\" type=\"LinkTypes\"/>\n      <xs:attribute name=\"media\" type=\"MediaDesc\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"style\">\n    <xs:annotation>\n      <xs:documentation>\n      style info, which may include CDATA sections\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:attributeGroup ref=\"i18n\"/>\n      <xs:attribute name=\"id\" type=\"xs:ID\"/>\n      <xs:attribute name=\"type\" type=\"ContentType\" use=\"required\"/>\n      <xs:attribute name=\"media\" type=\"MediaDesc\"/>\n      <xs:attribute name=\"title\" type=\"Text\"/>\n      <xs:attribute ref=\"xml:space\" fixed=\"preserve\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"script\">\n    <xs:annotation>\n      <xs:documentation>\n      script statements, which may include CDATA sections\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:attribute name=\"id\" type=\"xs:ID\"/>\n      <xs:attribute name=\"charset\" type=\"Charset\"/>\n      <xs:attribute name=\"type\" type=\"ContentType\" use=\"required\"/>\n      <xs:attribute name=\"src\" type=\"URI\"/>\n      <xs:attribute name=\"defer\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"defer\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute ref=\"xml:space\" fixed=\"preserve\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"noscript\">\n    <xs:annotation>\n      <xs:documentation>\n      alternate content container for non script-based rendering\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:complexContent>\n        <xs:extension base=\"Block\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    =================== Document Body ====================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"body\">\n    <xs:complexType>\n      <xs:complexContent>\n        <xs:extension base=\"Block\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attribute name=\"onload\" type=\"Script\"/>\n          <xs:attribute name=\"onunload\" type=\"Script\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n-->\n  <xs:element name=\"div\">\n    <xs:annotation>\n      <xs:documentation>\n      generic language/style container      \n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Flow\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    =================== Paragraphs =======================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"p\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    =================== Headings =========================================\n\n    There are six levels of headings from h1 (the most important)\n    to h6 (the least important).\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"h1\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"h2\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"h3\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"h4\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"h5\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"h6\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    =================== Lists ============================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"ul\">\n    <xs:annotation>\n      <xs:documentation>\n      Unordered list\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"li\" maxOccurs=\"unbounded\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attrs\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"ol\">\n    <xs:annotation>\n      <xs:documentation>\n      Ordered (numbered) list\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"li\" maxOccurs=\"unbounded\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attrs\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"li\">\n    <xs:annotation>\n      <xs:documentation>\n      list item\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Flow\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    definition lists - dt for term, dd for its definition\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"dl\">\n    <xs:complexType>\n      <xs:choice maxOccurs=\"unbounded\">\n        <xs:element ref=\"dt\"/>\n        <xs:element ref=\"dd\"/>\n      </xs:choice>\n      <xs:attributeGroup ref=\"attrs\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"dt\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"dd\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Flow\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    =================== Address ==========================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"address\">\n    <xs:annotation>\n      <xs:documentation>\n      information on author\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    =================== Horizontal Rule ==================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"hr\">\n    <xs:complexType>\n      <xs:attributeGroup ref=\"attrs\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    =================== Preformatted Text ================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"pre\">\n    <xs:annotation>\n      <xs:documentation>\n      content is \"Inline\" excluding \"img|object|big|small|sub|sup\"\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"pre.content\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attribute ref=\"xml:space\" fixed=\"preserve\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    =================== Block-like Quotes ================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"blockquote\">\n    <xs:complexType>\n      <xs:complexContent>\n        <xs:extension base=\"Block\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attribute name=\"cite\" type=\"URI\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <!--\n  <xs:annotation>\n    <xs:documentation>\n    =================== Inserted/Deleted Text ============================\n\n    ins/del are allowed in block and inline content, but its\n    inappropriate to include block content within an ins element\n    occurring in inline content.\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"ins\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent mixed=\"true\">\n        <xs:extension base=\"Flow\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attribute name=\"cite\" type=\"URI\"/>\n          <xs:attribute name=\"datetime\" type=\"Datetime\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"del\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent mixed=\"true\">\n        <xs:extension base=\"Flow\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attribute name=\"cite\" type=\"URI\"/>\n          <xs:attribute name=\"datetime\" type=\"Datetime\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n-->\n  <xs:annotation>\n    <xs:documentation>\n    ================== The Anchor Element ================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"a\">\n    <xs:annotation>\n      <xs:documentation>\n      content is \"Inline\" except that anchors shouldn't be nested\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"a.content\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attributeGroup ref=\"focus\"/>\n          <xs:attribute name=\"charset\" type=\"Charset\"/>\n          <xs:attribute name=\"type\" type=\"ContentType\"/>\n          <xs:attribute name=\"name\" type=\"xs:NMTOKEN\"/>\n          <xs:attribute name=\"href\" type=\"URI\"/>\n          <xs:attribute name=\"hreflang\" type=\"LanguageCode\"/>\n          <xs:attribute name=\"rel\" type=\"LinkTypes\"/>\n          <xs:attribute name=\"rev\" type=\"LinkTypes\"/>\n          <xs:attribute name=\"shape\" type=\"Shape\" default=\"rect\"/>\n          <xs:attribute name=\"coords\" type=\"Coords\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    ===================== Inline Elements ================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"span\">\n    <xs:annotation>\n      <xs:documentation>\n      generic language/style container\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"bdo\">\n    <xs:annotation>\n      <xs:documentation>\n      I18N BiDi over-ride\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"coreattrs\"/>\n          <xs:attributeGroup ref=\"events\"/>\n          <xs:attribute name=\"lang\" type=\"LanguageCode\"/>\n          <xs:attribute ref=\"xml:lang\"/>\n          <xs:attribute name=\"dir\" use=\"required\">\n            <xs:simpleType>\n              <xs:restriction base=\"xs:token\">\n                <xs:enumeration value=\"ltr\"/>\n                <xs:enumeration value=\"rtl\"/>\n              </xs:restriction>\n            </xs:simpleType>\n          </xs:attribute>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"br\">\n    <xs:annotation>\n      <xs:documentation>\n      forced line break\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:attributeGroup ref=\"coreattrs\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"em\">\n    <xs:annotation>\n      <xs:documentation>\n      emphasis\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"strong\">\n    <xs:annotation>\n      <xs:documentation>\n      strong emphasis\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"dfn\">\n    <xs:annotation>\n      <xs:documentation>\n      definitional\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"code\">\n    <xs:annotation>\n      <xs:documentation>\n      program code\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"samp\">\n    <xs:annotation>\n      <xs:documentation>\n      sample\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"kbd\">\n    <xs:annotation>\n      <xs:documentation>\n      something user would type\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"var\">\n    <xs:annotation>\n      <xs:documentation>\n      variable\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"cite\">\n    <xs:annotation>\n      <xs:documentation>\n      citation\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"abbr\">\n    <xs:annotation>\n      <xs:documentation>\n      abbreviation\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"acronym\">\n    <xs:annotation>\n      <xs:documentation>\n      acronym\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"q\">\n    <xs:annotation>\n      <xs:documentation>\n      inlined quote\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attribute name=\"cite\" type=\"URI\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"sub\">\n    <xs:annotation>\n      <xs:documentation>\n      subscript\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"sup\">\n    <xs:annotation>\n      <xs:documentation>\n      superscript\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"tt\">\n    <xs:annotation>\n      <xs:documentation>\n      fixed pitch font\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"i\">\n    <xs:annotation>\n      <xs:documentation>\n      italic font\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"b\">\n    <xs:annotation>\n      <xs:documentation>\n      bold font\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"big\">\n    <xs:annotation>\n      <xs:documentation>\n      bigger font\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"small\">\n    <xs:annotation>\n      <xs:documentation>\n      smaller font\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <!--\n  FHIR: no objects in FHIR\n  <xs:annotation>\n    <xs:documentation>\n    ==================== Object ======================================\n\n    object is used to embed objects as part of HTML pages.\n    param elements should precede other content. Parameters\n    can also be expressed as attribute/value pairs on the\n    object element itself when brevity is desired.\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"object\">\n    <xs:complexType mixed=\"true\">\n      <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n        <xs:element ref=\"param\"/>\n        <xs:group ref=\"block\"/>\n        <xs:element ref=\"form\"/>\n        <xs:group ref=\"inline\"/>\n        <xs:group ref=\"misc\"/>\n      </xs:choice>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attribute name=\"declare\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"declare\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"classid\" type=\"URI\"/>\n      <xs:attribute name=\"codebase\" type=\"URI\"/>\n      <xs:attribute name=\"data\" type=\"URI\"/>\n      <xs:attribute name=\"type\" type=\"ContentType\"/>\n      <xs:attribute name=\"codetype\" type=\"ContentType\"/>\n      <xs:attribute name=\"archive\" type=\"UriList\"/>\n      <xs:attribute name=\"standby\" type=\"Text\"/>\n      <xs:attribute name=\"height\" type=\"Length\"/>\n      <xs:attribute name=\"width\" type=\"Length\"/>\n      <xs:attribute name=\"usemap\" type=\"URI\"/>\n      <xs:attribute name=\"name\" type=\"xs:NMTOKEN\"/>\n      <xs:attribute name=\"tabindex\" type=\"tabindexNumber\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"param\">\n    <xs:annotation>\n      <xs:documentation>\n      param is used to supply a named property value.\n      In XML it would seem natural to follow RDF and support an\n      abbreviated syntax where the param elements are replaced\n      by attribute value pairs on the object start tag.\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:attribute name=\"id\" type=\"xs:ID\"/>\n      <xs:attribute name=\"name\"/>\n      <xs:attribute name=\"value\"/>\n      <xs:attribute name=\"valuetype\" default=\"data\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"data\"/>\n            <xs:enumeration value=\"ref\"/>\n            <xs:enumeration value=\"object\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"type\" type=\"ContentType\"/>\n    </xs:complexType>\n  </xs:element>\n-->\n  <xs:annotation>\n    <xs:documentation>\n    =================== Images ===========================================\n\n    To avoid accessibility problems for people who aren't\n    able to see the image, you should provide a text\n    description using the alt and longdesc attributes.\n    In addition, avoid the use of server-side image maps.\n    Note that in this DTD there is no name attribute. That\n    is only available in the transitional and frameset DTD.\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"img\">\n    <xs:complexType>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attribute name=\"src\" type=\"URI\" use=\"required\"/>\n      <xs:attribute name=\"alt\" type=\"Text\" use=\"required\"/>\n      <xs:attribute name=\"longdesc\" type=\"URI\"/>\n      <xs:attribute name=\"height\" type=\"Length\"/>\n      <xs:attribute name=\"width\" type=\"Length\"/>\n      <xs:attribute name=\"usemap\" type=\"URI\">\n        <xs:annotation>\n          <xs:documentation>\n          usemap points to a map element which may be in this document\n          or an external document, although the latter is not widely supported\n          </xs:documentation>\n        </xs:annotation>\n      </xs:attribute>\n      <xs:attribute name=\"ismap\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"ismap\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    ================== Client-side image maps ============================\n\n    These can be placed in the same document or grouped in a\n    separate document although this isn't yet widely supported\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"map\">\n    <xs:complexType>\n      <xs:choice>\n        <xs:choice maxOccurs=\"unbounded\">\n          <xs:group ref=\"block\"/>\n<!--\n  FHIR: no forms\n          <xs:element ref=\"form\"/>\n          <xs:group ref=\"misc\"/>\n-->\n        </xs:choice>\n        <xs:element ref=\"area\" maxOccurs=\"unbounded\"/>\n      </xs:choice>\n      <xs:attributeGroup ref=\"i18n\"/>\n      <xs:attributeGroup ref=\"events\"/>\n      <xs:attribute name=\"id\" type=\"xs:ID\" use=\"required\"/>\n      <xs:attribute name=\"class\"/>\n      <xs:attribute name=\"style\" type=\"StyleSheet\"/>\n      <xs:attribute name=\"title\" type=\"Text\"/>\n      <xs:attribute name=\"name\" type=\"xs:NMTOKEN\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"area\">\n    <xs:complexType>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attributeGroup ref=\"focus\"/>\n      <xs:attribute name=\"shape\" type=\"Shape\" default=\"rect\"/>\n      <xs:attribute name=\"coords\" type=\"Coords\"/>\n      <xs:attribute name=\"href\" type=\"URI\"/>\n      <xs:attribute name=\"nohref\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"nohref\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"alt\" type=\"Text\" use=\"required\"/>\n    </xs:complexType>\n  </xs:element>\n  <!--\n  FHIR: no forms in FHIR\n  <xs:annotation>\n    <xs:documentation>\n    ================ Forms ===============================================\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"form\">\n    <xs:complexType>\n      <xs:complexContent>\n        <xs:extension base=\"form.content\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attribute name=\"action\" type=\"URI\" use=\"required\"/>\n          <xs:attribute name=\"method\" default=\"get\">\n            <xs:simpleType>\n              <xs:restriction base=\"xs:token\">\n                <xs:enumeration value=\"get\"/>\n                <xs:enumeration value=\"post\"/>\n              </xs:restriction>\n            </xs:simpleType>\n          </xs:attribute>\n          <xs:attribute name=\"enctype\" type=\"ContentType\" default=\"application/x-www-form-urlencoded\"/>\n          <xs:attribute name=\"onsubmit\" type=\"Script\"/>\n          <xs:attribute name=\"onreset\" type=\"Script\"/>\n          <xs:attribute name=\"accept\" type=\"ContentTypes\"/>\n          <xs:attribute name=\"accept-charset\" type=\"Charsets\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"label\">\n    <xs:annotation>\n      <xs:documentation>\n      Each label must not contain more than ONE field\n      Label elements shouldn't be nested.\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent mixed=\"true\">\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attribute name=\"for\" type=\"xs:IDREF\"/>\n          <xs:attribute name=\"accesskey\" type=\"Character\"/>\n          <xs:attribute name=\"onfocus\" type=\"Script\"/>\n          <xs:attribute name=\"onblur\" type=\"Script\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:simpleType name=\"InputType\">\n    <xs:restriction base=\"xs:token\">\n      <xs:enumeration value=\"text\"/>\n      <xs:enumeration value=\"password\"/>\n      <xs:enumeration value=\"checkbox\"/>\n      <xs:enumeration value=\"radio\"/>\n      <xs:enumeration value=\"submit\"/>\n      <xs:enumeration value=\"reset\"/>\n      <xs:enumeration value=\"file\"/>\n      <xs:enumeration value=\"hidden\"/>\n      <xs:enumeration value=\"image\"/>\n      <xs:enumeration value=\"button\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:element name=\"input\">\n    <xs:annotation>\n      <xs:documentation>\n      form control\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attributeGroup ref=\"focus\"/>\n      <xs:attribute name=\"type\" type=\"InputType\" default=\"text\"/>\n      <xs:attribute name=\"name\">\n        <xs:annotation>\n          <xs:documentation>\n          the name attribute is required for all but submit &amp; reset\n          </xs:documentation>\n        </xs:annotation>\n      </xs:attribute>\n      <xs:attribute name=\"value\"/>\n      <xs:attribute name=\"checked\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"checked\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"disabled\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"disabled\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"readonly\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"readonly\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"size\"/>\n      <xs:attribute name=\"maxlength\" type=\"Number\"/>\n      <xs:attribute name=\"src\" type=\"URI\"/>\n      <xs:attribute name=\"alt\"/>\n      <xs:attribute name=\"usemap\" type=\"URI\"/>\n      <xs:attribute name=\"onselect\" type=\"Script\"/>\n      <xs:attribute name=\"onchange\" type=\"Script\"/>\n      <xs:attribute name=\"accept\" type=\"ContentTypes\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"select\">\n    <xs:annotation>\n      <xs:documentation>\n      option selector\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:choice maxOccurs=\"unbounded\">\n        <xs:element ref=\"optgroup\"/>\n        <xs:element ref=\"option\"/>\n      </xs:choice>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attribute name=\"name\"/>\n      <xs:attribute name=\"size\" type=\"Number\"/>\n      <xs:attribute name=\"multiple\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"multiple\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"disabled\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"disabled\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"tabindex\" type=\"tabindexNumber\"/>\n      <xs:attribute name=\"onfocus\" type=\"Script\"/>\n      <xs:attribute name=\"onblur\" type=\"Script\"/>\n      <xs:attribute name=\"onchange\" type=\"Script\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"optgroup\">\n    <xs:annotation>\n      <xs:documentation>\n      option group\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"option\" maxOccurs=\"unbounded\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attribute name=\"disabled\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"disabled\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"label\" type=\"Text\" use=\"required\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"option\">\n    <xs:annotation>\n      <xs:documentation>\n      selectable choice\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attribute name=\"selected\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"selected\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"disabled\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"disabled\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"label\" type=\"Text\"/>\n      <xs:attribute name=\"value\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"textarea\">\n    <xs:annotation>\n      <xs:documentation>\n      multi-line text field\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attributeGroup ref=\"focus\"/>\n      <xs:attribute name=\"name\"/>\n      <xs:attribute name=\"rows\" type=\"Number\" use=\"required\"/>\n      <xs:attribute name=\"cols\" type=\"Number\" use=\"required\"/>\n      <xs:attribute name=\"disabled\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"disabled\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"readonly\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:token\">\n            <xs:enumeration value=\"readonly\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:attribute>\n      <xs:attribute name=\"onselect\" type=\"Script\"/>\n      <xs:attribute name=\"onchange\" type=\"Script\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"fieldset\">\n    <xs:annotation>\n      <xs:documentation>\n      The fieldset element is used to group form fields.\n      Only one legend element should occur in the content\n      and if present should only be preceded by whitespace.\n\n      NOTE: this content model is different from the XHTML 1.0 DTD,\n      closer to the intended content model in HTML4 DTD\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:sequence>\n        <xs:element ref=\"legend\"/>\n        <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n          <xs:group ref=\"block\"/>\n          <xs:element ref=\"form\"/>\n          <xs:group ref=\"inline\"/>\n          <xs:group ref=\"misc\"/>\n        </xs:choice>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attrs\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"legend\">\n    <xs:annotation>\n      <xs:documentation>\n      fieldset label\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent mixed=\"true\">\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attribute name=\"accesskey\" type=\"Character\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"button\">\n    <xs:annotation>\n      <xs:documentation>\n      Content is \"Flow\" excluding a, form and form controls\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent mixed=\"true\">\n        <xs:extension base=\"button.content\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attributeGroup ref=\"focus\"/>\n          <xs:attribute name=\"name\"/>\n          <xs:attribute name=\"value\"/>\n          <xs:attribute name=\"type\" default=\"submit\">\n            <xs:simpleType>\n              <xs:restriction base=\"xs:token\">\n                <xs:enumeration value=\"button\"/>\n                <xs:enumeration value=\"submit\"/>\n                <xs:enumeration value=\"reset\"/>\n              </xs:restriction>\n            </xs:simpleType>\n          </xs:attribute>\n          <xs:attribute name=\"disabled\">\n            <xs:simpleType>\n              <xs:restriction base=\"xs:token\">\n                <xs:enumeration value=\"disabled\"/>\n              </xs:restriction>\n            </xs:simpleType>\n          </xs:attribute>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n-->\n  <xs:annotation>\n    <xs:documentation>\n    ======================= Tables =======================================\n\n    Derived from IETF HTML table standard, see [RFC1942]\n    </xs:documentation>\n  </xs:annotation>\n  <xs:simpleType name=\"TFrame\">\n    <xs:annotation>\n      <xs:documentation>\n      The border attribute sets the thickness of the frame around the\n      table. The default units are screen pixels.\n\n      The frame attribute specifies which parts of the frame around\n      the table should be rendered. The values are not the same as\n      CALS to avoid a name clash with the valign attribute.\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:token\">\n      <xs:enumeration value=\"void\"/>\n      <xs:enumeration value=\"above\"/>\n      <xs:enumeration value=\"below\"/>\n      <xs:enumeration value=\"hsides\"/>\n      <xs:enumeration value=\"lhs\"/>\n      <xs:enumeration value=\"rhs\"/>\n      <xs:enumeration value=\"vsides\"/>\n      <xs:enumeration value=\"box\"/>\n      <xs:enumeration value=\"border\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:simpleType name=\"TRules\">\n    <xs:annotation>\n      <xs:documentation>\n      The rules attribute defines which rules to draw between cells:\n\n      If rules is absent then assume:\n          \"none\" if border is absent or border=\"0\" otherwise \"all\"\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:token\">\n      <xs:enumeration value=\"none\"/>\n      <xs:enumeration value=\"groups\"/>\n      <xs:enumeration value=\"rows\"/>\n      <xs:enumeration value=\"cols\"/>\n      <xs:enumeration value=\"all\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:attributeGroup name=\"cellhalign\">\n    <xs:annotation>\n      <xs:documentation>\n      horizontal alignment attributes for cell contents\n\n      char        alignment char, e.g. char=':'\n      charoff     offset for alignment char\n      </xs:documentation>\n    </xs:annotation>\n    <xs:attribute name=\"align\">\n      <xs:simpleType>\n        <xs:restriction base=\"xs:token\">\n          <xs:enumeration value=\"left\"/>\n          <xs:enumeration value=\"center\"/>\n          <xs:enumeration value=\"right\"/>\n          <xs:enumeration value=\"justify\"/>\n          <xs:enumeration value=\"char\"/>\n        </xs:restriction>\n      </xs:simpleType>\n    </xs:attribute>\n    <xs:attribute name=\"char\" type=\"Character\"/>\n    <xs:attribute name=\"charoff\" type=\"Length\"/>\n  </xs:attributeGroup>\n  <xs:attributeGroup name=\"cellvalign\">\n    <xs:annotation>\n      <xs:documentation>\n      vertical alignment attributes for cell contents\n      </xs:documentation>\n    </xs:annotation>\n    <xs:attribute name=\"valign\">\n      <xs:simpleType>\n        <xs:restriction base=\"xs:token\">\n          <xs:enumeration value=\"top\"/>\n          <xs:enumeration value=\"middle\"/>\n          <xs:enumeration value=\"bottom\"/>\n          <xs:enumeration value=\"baseline\"/>\n        </xs:restriction>\n      </xs:simpleType>\n    </xs:attribute>\n  </xs:attributeGroup>\n  <xs:element name=\"table\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"caption\" minOccurs=\"0\"/>\n        <xs:choice>\n          <xs:element ref=\"col\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n          <xs:element ref=\"colgroup\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n        </xs:choice>\n        <xs:element ref=\"thead\" minOccurs=\"0\"/>\n        <xs:element ref=\"tfoot\" minOccurs=\"0\"/>\n        <xs:choice>\n          <xs:element ref=\"tbody\" maxOccurs=\"unbounded\"/>\n          <xs:element ref=\"tr\" maxOccurs=\"unbounded\"/>\n        </xs:choice>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attribute name=\"summary\" type=\"Text\"/>\n      <xs:attribute name=\"width\" type=\"Length\"/>\n      <xs:attribute name=\"border\" type=\"Pixels\"/>\n      <xs:attribute name=\"frame\" type=\"TFrame\"/>\n      <xs:attribute name=\"rules\" type=\"TRules\"/>\n      <xs:attribute name=\"cellspacing\" type=\"Length\"/>\n      <xs:attribute name=\"cellpadding\" type=\"Length\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"caption\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Inline\">\n          <xs:attributeGroup ref=\"attrs\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:annotation>\n    <xs:documentation>\n    Use thead to duplicate headers when breaking table\n    across page boundaries, or for static headers when\n    tbody sections are rendered in scrolling panel.\n\n    Use tfoot to duplicate footers when breaking table\n    across page boundaries, or for static footers when\n    tbody sections are rendered in scrolling panel.\n\n    Use multiple tbody sections when rules are needed\n    between groups of table rows.\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"thead\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"tr\" maxOccurs=\"unbounded\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attributeGroup ref=\"cellhalign\"/>\n      <xs:attributeGroup ref=\"cellvalign\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"tfoot\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"tr\" maxOccurs=\"unbounded\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attributeGroup ref=\"cellhalign\"/>\n      <xs:attributeGroup ref=\"cellvalign\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"tbody\">\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"tr\" maxOccurs=\"unbounded\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attributeGroup ref=\"cellhalign\"/>\n      <xs:attributeGroup ref=\"cellvalign\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"colgroup\">\n    <xs:annotation>\n      <xs:documentation>\n      colgroup groups a set of col elements. It allows you to group\n      several semantically related columns together.\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:sequence>\n        <xs:element ref=\"col\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n      </xs:sequence>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attribute name=\"span\" type=\"Number\" default=\"1\"/>\n      <xs:attribute name=\"width\" type=\"MultiLength\"/>\n      <xs:attributeGroup ref=\"cellhalign\"/>\n      <xs:attributeGroup ref=\"cellvalign\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"col\">\n    <xs:annotation>\n      <xs:documentation>\n      col elements define the alignment properties for cells in\n      one or more columns.\n\n      The width attribute specifies the width of the columns, e.g.\n\n          width=64        width in screen pixels\n          width=0.5*      relative width of 0.5\n\n      The span attribute causes the attributes of one\n      col element to apply to more than one column.\n      </xs:documentation>\n    </xs:annotation>\n    <xs:complexType>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attribute name=\"span\" type=\"Number\" default=\"1\"/>\n      <xs:attribute name=\"width\" type=\"MultiLength\"/>\n      <xs:attributeGroup ref=\"cellhalign\"/>\n      <xs:attributeGroup ref=\"cellvalign\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"tr\">\n    <xs:complexType>\n      <xs:choice maxOccurs=\"unbounded\">\n        <xs:element ref=\"th\"/>\n        <xs:element ref=\"td\"/>\n      </xs:choice>\n      <xs:attributeGroup ref=\"attrs\"/>\n      <xs:attributeGroup ref=\"cellhalign\"/>\n      <xs:attributeGroup ref=\"cellvalign\"/>\n    </xs:complexType>\n  </xs:element>\n  <xs:simpleType name=\"Scope\">\n    <xs:annotation>\n      <xs:documentation>\n      Scope is simpler than headers attribute for common tables\n      </xs:documentation>\n    </xs:annotation>\n    <xs:restriction base=\"xs:token\">\n      <xs:enumeration value=\"row\"/>\n      <xs:enumeration value=\"col\"/>\n      <xs:enumeration value=\"rowgroup\"/>\n      <xs:enumeration value=\"colgroup\"/>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:annotation>\n    <xs:documentation>\n    th is for headers, td for data and for cells acting as both\n    </xs:documentation>\n  </xs:annotation>\n  <xs:element name=\"th\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Flow\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attribute name=\"abbr\" type=\"Text\"/>\n          <xs:attribute name=\"axis\"/>\n          <xs:attribute name=\"headers\" type=\"xs:IDREFS\"/>\n          <xs:attribute name=\"scope\" type=\"Scope\"/>\n          <xs:attribute name=\"rowspan\" type=\"Number\" default=\"1\"/>\n          <xs:attribute name=\"colspan\" type=\"Number\" default=\"1\"/>\n          <xs:attributeGroup ref=\"cellhalign\"/>\n          <xs:attributeGroup ref=\"cellvalign\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n  <xs:element name=\"td\">\n    <xs:complexType mixed=\"true\">\n      <xs:complexContent>\n        <xs:extension base=\"Flow\">\n          <xs:attributeGroup ref=\"attrs\"/>\n          <xs:attribute name=\"abbr\" type=\"Text\"/>\n          <xs:attribute name=\"axis\"/>\n          <xs:attribute name=\"headers\" type=\"xs:IDREFS\"/>\n          <xs:attribute name=\"scope\" type=\"Scope\"/>\n          <xs:attribute name=\"rowspan\" type=\"Number\" default=\"1\"/>\n          <xs:attribute name=\"colspan\" type=\"Number\" default=\"1\"/>\n          <xs:attributeGroup ref=\"cellhalign\"/>\n          <xs:attributeGroup ref=\"cellvalign\"/>\n        </xs:extension>\n      </xs:complexContent>\n    </xs:complexType>\n  </xs:element>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/flag.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Flag\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Flag</sch:title>\n    <sch:rule context=\"f:Flag\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Flag/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/flag.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Flag\" type=\"Flag\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Prospective warnings of potential issues when providing care to the patient.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Flag\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Prospective warnings of potential issues when providing care to the patient.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this flag by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FlagStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Supports basic workflow.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Allows a flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The coded value or textual component of the flag to display to the user.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient, location, group, organization, or practitioner etc. this is about record this flag is associated with.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This alert is only relevant during the encounter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person, organization or device that created the flag.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"FlagStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"inactive\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"FlagStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates whether this flag is active and needs to be displayed to a user, or whether it is no longer needed or was entered in error.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"FlagStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/goal.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Goal\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Goal</sch:title>\n    <sch:rule context=\"f:Goal\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target\">\n      <sch:assert test=\"(exists(f:*[starts-with(local-name(.), 'detail')]) and exists(f:measure)) or not(exists(f:*[starts-with(local-name(.), 'detail')]))\">gol-1: Goal.target.measure is required if Goal.target.detail is populated</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:detailRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:target/f:dueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:expressedBy\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:expressedBy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:expressedBy/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:addresses\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:addresses/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:addresses/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:outcomeReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:outcomeReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Goal/f:outcomeReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/goal.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Goal\" type=\"Goal\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Goal\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this goal by the performer or other systems which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lifecycleStatus\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GoalLifecycleStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The state of the goal throughout its lifecycle.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"achievementStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the progression, or lack thereof, towards the goal against the target.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates a category the goal falls within.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-readable and/or coded description of a specific desired objective of care, such as &quot;control blood pressure&quot; or &quot;negotiate an obstacle course&quot; or &quot;dance with child at wedding&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the patient, group or organization for whom the goal is being established.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date or event after which the goal should begin being pursued.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"startDate\" type=\"date\"/>\n            <xs:element name=\"startCodeableConcept\" type=\"CodeableConcept\"/>\n          </xs:choice>\n          <xs:element name=\"target\" type=\"Goal.Target\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates what should be done by when.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies when the current status.  I.e. When initially created, when achieved, when cancelled, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current status.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expressedBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whose goal this is - patient goal, practitioner goal, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"addresses\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identified conditions and other health record elements that are intended to be addressed by the goal.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Any comments related to the goal.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcomeCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the change (or lack of change) at the point when the status of the goal is assessed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcomeReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details of what's changed (or not changed).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Goal.Target\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"measure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"detailQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"detailRange\" type=\"Range\"/>\n            <xs:element name=\"detailCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"detailString\" type=\"string\"/>\n            <xs:element name=\"detailBoolean\" type=\"boolean\"/>\n            <xs:element name=\"detailInteger\" type=\"integer\"/>\n            <xs:element name=\"detailRatio\" type=\"Ratio\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates either the date or the duration after start by which the goal should be met.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"dueDate\" type=\"date\"/>\n            <xs:element name=\"dueDuration\" type=\"Duration\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"GoalLifecycleStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"proposed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Proposed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"planned\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Planned</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"accepted\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Accepted</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-hold\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"rejected\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Rejected</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"GoalLifecycleStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Codes that reflect the current state of a goal and whether the goal is still being targeted.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"GoalLifecycleStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/graphdefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource GraphDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>GraphDefinition</sch:title>\n    <sch:rule context=\"f:GraphDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GraphDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/graphdefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"GraphDefinition\" type=\"GraphDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"GraphDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this graph definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this graph definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the graph definition is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the graph definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the graph definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the graph definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this graph definition. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this graph definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the graph definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the graph definition changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the graph definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the graph definition from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate graph definition instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the graph definition is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this graph definition is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"start\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of FHIR resource at which instances of this graph start.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The profile that describes the use of the base resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"link\" type=\"GraphDefinition.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Links this graph makes rules about.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"GraphDefinition.Link\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"path\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A FHIR expression that identifies one of FHIR References to other resources.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sliceName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Which slice (if profiled).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"min\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Minimum occurrences for this link.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"max\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Maximum occurrences for this link.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about why this link is of interest in this graph definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"target\" type=\"GraphDefinition.Target\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Potential target for the link.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"GraphDefinition.Target\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of resource this link refers to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"params\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A set of parameters to look up.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Profile for the target resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"compartment\" type=\"GraphDefinition.Compartment\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Compartment Consistency Rules.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"link\" type=\"GraphDefinition.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional links from target resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"GraphDefinition.Compartment\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formal computable definition of a graph of resources - that is, a coherent set of resources that form a graph by following references. The Graph Definition resource defines a set and makes rules about the set.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"use\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GraphCompartmentUse\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines how the compartment rule is used - whether it it is used to test whether resources are subject to the rule, or whether it is a rule that must be followed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CompartmentType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the compartment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rule\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GraphCompartmentRule\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">identical | matching | different | no-rule | custom.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Custom rule, as a FHIRPath expression.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Documentation for FHIRPath expression.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"GraphCompartmentUse-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"condition\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Condition</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"requirement\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Requirement</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"GraphCompartmentUse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines how a compartment rule is used.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"GraphCompartmentUse-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"GraphCompartmentRule-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"identical\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Identical</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"matching\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Matching</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"different\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Different</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"custom\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Custom</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"GraphCompartmentRule\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How a compartment must be linked.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"GraphCompartmentRule-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/group.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Group\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Group</sch:title>\n    <sch:rule context=\"f:Group\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"f:actual/@value=true() or not(exists(f:member))\">grp-1: Can only have members if group is &quot;actual&quot;</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:managingEntity\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:managingEntity/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:managingEntity/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:characteristic/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:member/f:entity\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:member/f:entity/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:member/f:entity/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Group/f:member/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/group.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Group\" type=\"Group\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Group\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique business identifier for this group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether the record for the group is available for use or is merely being retained for historical purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GroupType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the broad classification of the kind of resources the group includes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actual\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If true, indicates that the resource refers to a specific group of real individuals.  If false, the group defines a set of intended individuals.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides a specific type of resource the group includes; e.g. &quot;cow&quot;, &quot;syringe&quot;, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A label assigned to the group for human identification and communication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A count of the number of resource instances that are part of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"managingEntity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Entity responsible for defining and maintaining Group characteristics and/or registered members.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"characteristic\" type=\"Group.Characteristic\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies traits whose presence r absence is shared by members of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"member\" type=\"Group.Member\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the resource instances that are members of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Group.Characteristic\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that identifies the kind of trait being asserted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the trait that holds (or does not hold - see 'exclude') for members of the group.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueRange\" type=\"Range\"/>\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"exclude\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If true, indicates the characteristic is one that is NOT held by members of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Group.Member\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively, and are not formally or legally recognized; i.e. a collection of entities that isn't an Organization.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"entity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the entity that is a member of the group. Must be consistent with Group.type. If the entity is another group, then the type must be the same.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period that the member was in the group, if known.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"inactive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A flag to indicate that the member is no longer in the group, but previously may have been a member.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"GroupType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"person\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Person</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"animal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Animal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"practitioner\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Practitioner</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"device\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Device</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"medication\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Medication</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"substance\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Substance</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"GroupType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Types of resources that are part of group.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"GroupType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/guidanceresponse.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource GuidanceResponse\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>GuidanceResponse</sch:title>\n    <sch:rule context=\"f:GuidanceResponse\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:requestIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:requestIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:evaluationMessage\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:evaluationMessage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:evaluationMessage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:outputParameters\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:outputParameters/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:outputParameters/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:result\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:result/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:result/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:codeFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-1: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:dateFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-2: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:dateFilter/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:GuidanceResponse/f:dataRequirement/f:dateFilter/f:valueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/guidanceresponse.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"GuidanceResponse\" type=\"GuidanceResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"GuidanceResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"requestIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier of the request associated with this response. If an identifier was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Allows a service to provide  unique, business identifiers for the response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An identifier, CodeableConcept or canonical reference to the guidance that was requested.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"moduleUri\" type=\"uri\"/>\n            <xs:element name=\"moduleCanonical\" type=\"canonical\"/>\n            <xs:element name=\"moduleCodeableConcept\" type=\"CodeableConcept\"/>\n          </xs:choice>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GuidanceResponseStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient for which the request was processed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The encounter during which this response was created or to which the creation of this record is tightly associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"occurrenceDateTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates when the guidance response was processed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides a reference to the device that performed the guidance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the reason for the guidance response in coded or textual form.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the reason the request was initiated. This is typically provided as a parameter to the evaluation and echoed by the service, although for some use cases, such as subscription- or event-based scenarios, it may provide an indication of the cause for the response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides a mechanism to communicate additional information about the response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"evaluationMessage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outputParameters\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"result\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actions, if any, produced by the evaluation of the artifact.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dataRequirement\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DataRequirement\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"GuidanceResponseStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"success\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Success</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"data-requested\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Data Requested</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"data-required\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Data Required</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"in-progress\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"failure\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Failure</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered In Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"GuidanceResponseStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The status of a guidance response.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"GuidanceResponseStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/healthcareservice.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource HealthcareService\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>HealthcareService</sch:title>\n    <sch:rule context=\"f:HealthcareService\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:providedBy\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:providedBy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:providedBy/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:photo\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:coverageArea\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:coverageArea/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:coverageArea/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:notAvailable/f:during\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:HealthcareService/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/healthcareservice.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"HealthcareService\" type=\"HealthcareService\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The details of a healthcare service available at a location.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"HealthcareService\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The details of a healthcare service available at a location.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">External identifiers for this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This flag is used to mark the record to not be used. This is not used when a center is closed for maintenance, or for holidays, the notAvailable period is to be used for this.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"providedBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization that provides this healthcare service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the broad category of service being performed or delivered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific type of service that may be delivered or performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Collection of specialties handled by the service site. This is more of a medical term.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The location(s) where this healthcare service may be provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Further description of the service as it would be presented to a consumer while searching.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"extraDetails\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Extra details about the service that can't be placed in the other fields.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"photo\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">List of contacts related to this specific healthcare service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"coverageArea\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The location(s) that this service is available to (not where the service is provided).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"serviceProvisionCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code(s) that detail the conditions under which the healthcare service is available/offered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"eligibility\" type=\"HealthcareService.Eligibility\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Does this service have specific eligibility requirements that need to be met in order to use the service?</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"program\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Programs that this service is applicable to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"characteristic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Collection of characteristics (attributes).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"communication\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Some services are specifically made available in multiple languages, this property permits a directory to declare the languages this is offered in. Typically this is only provided where a service operates in communities with mixed languages used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referralMethod\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"appointmentRequired\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"availableTime\" type=\"HealthcareService.AvailableTime\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A collection of times that the Service Site is available.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"notAvailable\" type=\"HealthcareService.NotAvailable\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The HealthcareService is not available during this period of time due to the provided reason.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"availabilityExceptions\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Technical endpoints providing access to services operated for the specific healthcare services defined at this resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"HealthcareService.Eligibility\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The details of a healthcare service available at a location.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Coded value for the eligibility.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the eligibility conditions for the service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"HealthcareService.AvailableTime\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The details of a healthcare service available at a location.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"daysOfWeek\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DaysOfWeek\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates which days of the week are available between the start and end Times.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"allDay\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Is this always available? (hence times are irrelevant) e.g. 24 hour service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"availableStartTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"time\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The opening time of day. Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"availableEndTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"time\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The closing time of day. Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"HealthcareService.NotAvailable\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The details of a healthcare service available at a location.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reason that can be presented to the user as to why this time is not available.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"during\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Service is not available (seasonally or for a public holiday) from this date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"DaysOfWeek-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"mon\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Monday</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"tue\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Tuesday</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"wed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Wednesday</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"thu\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Thursday</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"fri\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Friday</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"sat\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Saturday</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"sun\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Sunday</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"DaysOfWeek\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The days of the week.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"DaysOfWeek-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/imagingstudy.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ImagingStudy\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ImagingStudy</sch:title>\n    <sch:rule context=\"f:ImagingStudy\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:referrer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:referrer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:referrer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:interpreter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:interpreter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:interpreter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:procedureReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:procedureReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:procedureReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:specimen\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:specimen/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:specimen/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:performer/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:performer/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImagingStudy/f:series/f:performer/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/imagingstudy.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ImagingStudy\" type=\"ImagingStudy\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ImagingStudy\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifiers for the ImagingStudy such as DICOM Study Instance UID, and Accession Number.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ImagingStudyStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The current state of the ImagingStudy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modality\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of all the series.modality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The subject, typically a patient, of the imaging study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The healthcare event (e.g. a patient and healthcare provider interaction) during which this ImagingStudy is made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"started\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date and time the study started.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of the diagnostic requests that resulted in this imaging study being performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referrer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The requesting/referring physician.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"interpreter\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who read the study and interpreted the images or other content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The network service providing access (e.g., query, view, or retrieval) for the study. See implementation notes for information about using DICOM endpoints. A study-level endpoint applies to each series in the study, unless overridden by a series-level endpoint with the same Endpoint.connectionType.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numberOfSeries\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number of Series in the Study. This value given may be larger than the number of series elements this Resource contains due to resource availability, security, or other factors. This element should be present if any series elements are present.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numberOfInstances\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number of SOP Instances in Study. This value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"procedureReference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The procedure which this ImagingStudy was part of.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"procedureCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code for the performed procedure type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The principal physical location where the ImagingStudy was performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of clinical condition indicating why the ImagingStudy was requested.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates another resource whose existence justifies this Study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Per the recommended DICOM mapping, this element is derived from the Study Description attribute (0008,1030). Observations or findings about the imaging study should be recorded in another resource, e.g. Observation, and not in this element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Imaging Manager description of the study. Institution-generated description or classification of the Study (component) performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"series\" type=\"ImagingStudy.Series\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Each study has one or more series of images or other content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImagingStudy.Series\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"uid\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The DICOM Series Instance UID for the series.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"number\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The numeric identifier of this series in the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modality\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The modality of this series sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the series.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numberOfInstances\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number of SOP Instances in the Study. The value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The network service providing access (e.g., query, view, or retrieval) for this series. See implementation notes for information about using DICOM endpoints. A series-level endpoint, if present, has precedence over a study-level endpoint with the same Endpoint.connectionType.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The anatomic structures examined. See DICOM Part 16 Annex L (http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_L.html) for DICOM to SNOMED-CT mappings. The bodySite may indicate the laterality of body part imaged; if so, it shall be consistent with any content of ImagingStudy.series.laterality.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"laterality\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The laterality of the (possibly paired) anatomic structures examined. E.g., the left knee, both lungs, or unpaired abdomen. If present, shall be consistent with any laterality information indicated in ImagingStudy.series.bodySite.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specimen\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specimen imaged, e.g., for whole slide imaging of a biopsy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"started\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date and time the series was started.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" type=\"ImagingStudy.Performer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed the series and how they were involved.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instance\" type=\"ImagingStudy.Instance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A single SOP instance within the series, e.g. an image, or presentation state.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImagingStudy.Performer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"function\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Distinguishes the type of involvement of the performer in the series.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed the series.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImagingStudy.Instance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context.  A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"uid\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The DICOM SOP Instance UID for this image or other DICOM content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sopClass\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">DICOM instance  type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"number\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of instance in the series.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The description of the instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ImagingStudyStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"registered\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Registered</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"available\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Available</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ImagingStudyStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The status of the ImagingStudy.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ImagingStudyStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/immunization.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Immunization\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Immunization</sch:title>\n    <sch:rule context=\"f:Immunization\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:doseQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:performer/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:performer/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:performer/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:education\">\n      <sch:assert test=\"exists(f:documentType) or exists(f:reference)\">imm-1: One of documentType or reference SHALL be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:reaction/f:detail\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:reaction/f:detail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:reaction/f:detail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:protocolApplied/f:authority\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:protocolApplied/f:authority/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Immunization/f:protocolApplied/f:authority/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/immunization.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Immunization\" type=\"Immunization\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Immunization\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this immunization record.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ImmunizationStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the current status of the immunization event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the reason the immunization event was not performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"vaccineCode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Vaccine that was administered or was to be administered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient who either received or did not receive the immunization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The visit or admission or other contact between patient and health care provider the immunization was performed as part of.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date vaccine administered or was to be administered.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"occurrenceString\" type=\"string\"/>\n          </xs:choice>\n          <xs:element name=\"recorded\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"primarySource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reportOrigin\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The service delivery location where the vaccine administration occurred.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name of vaccine manufacturer.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lotNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Lot number of the  vaccine product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expirationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date vaccine batch expires.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"site\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Body site where vaccine was administered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"route\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The path by which the vaccine product is taken into the body.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"doseQuantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity of vaccine product that was administered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" type=\"Immunization.Performer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates who performed the immunization event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Extra information about the immunization that is not conveyed by the other attributes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reasons why the vaccine was administered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Condition, Observation or DiagnosticReport that supports why the immunization was administered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"isSubpotent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subpotentReason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reason why a dose is considered to be subpotent.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"education\" type=\"Immunization.Education\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Educational material presented to the patient (or guardian) at the time of vaccine administration.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"programEligibility\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates a patient's eligibility for a funding program.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fundingSource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the source of the vaccine actually administered. This may be different than the patient eligibility (e.g. the patient may be eligible for a publically purchased vaccine but due to inventory issues, vaccine purchased with private funds was actually administered).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reaction\" type=\"Immunization.Reaction\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Categorical data indicating that an adverse event is associated in time to an immunization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"protocolApplied\" type=\"Immunization.ProtocolApplied\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The protocol (set of recommendations) being followed by the provider who administered the dose.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Immunization.Performer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"function\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the type of performance (e.g. ordering provider, administering provider, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The practitioner or organization who performed the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Immunization.Education\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"documentType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier of the material presented to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference pointer to the educational material given to the patient if the information was on line.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publicationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date the educational material was published.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"presentationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date the educational material was given to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Immunization.Reaction\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date of reaction to the immunization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details of the reaction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reported\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Self-reported indicator.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Immunization.ProtocolApplied\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient being administered a vaccine or a record of an immunization as reported by a patient, a clinician or another party.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"series\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">One possible path to achieve presumed immunity against a disease - within the context of an authority.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the authority who published the protocol (e.g. ACIP) that is being followed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"targetDisease\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The vaccine preventable disease the dose is being administered against.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Nominal position in a series.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"doseNumberPositiveInt\" type=\"positiveInt\"/>\n            <xs:element name=\"doseNumberString\" type=\"string\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The recommended number of doses to achieve immunity.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"seriesDosesPositiveInt\" type=\"positiveInt\"/>\n            <xs:element name=\"seriesDosesString\" type=\"string\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ImmunizationStatusCodes-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"not-done\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not Done</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ImmunizationStatusCodes\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of codes indicating the current status of an Immunization.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ImmunizationStatusCodes-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/immunizationevaluation.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ImmunizationEvaluation\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ImmunizationEvaluation</sch:title>\n    <sch:rule context=\"f:ImmunizationEvaluation\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:authority\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:authority/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:authority/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:immunizationEvent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:immunizationEvent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationEvaluation/f:immunizationEvent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/immunizationevaluation.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ImmunizationEvaluation\" type=\"ImmunizationEvaluation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes a comparison of an immunization event against published recommendations to determine if the administration is &quot;valid&quot; in relation to those  recommendations.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ImmunizationEvaluation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes a comparison of an immunization event against published recommendations to determine if the administration is &quot;valid&quot; in relation to those  recommendations.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this immunization evaluation record.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ImmunizationEvaluationStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the current status of the evaluation of the vaccination administration event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual for whom the evaluation is being done.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date the evaluation of the vaccine administration event was performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the authority who published the protocol (e.g. ACIP).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"targetDisease\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The vaccine preventable disease the dose is being evaluated against.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"immunizationEvent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The vaccine administration event being evaluated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"doseStatus\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates if the dose is valid or not valid with respect to the published recommendations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"doseStatusReason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides an explanation as to why the vaccine administration event is valid or not relative to the published recommendations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information about the evaluation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"series\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">One possible path to achieve presumed immunity against a disease - within the context of an authority.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Nominal position in a series.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"doseNumberPositiveInt\" type=\"positiveInt\"/>\n            <xs:element name=\"doseNumberString\" type=\"string\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The recommended number of doses to achieve immunity.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"seriesDosesPositiveInt\" type=\"positiveInt\"/>\n            <xs:element name=\"seriesDosesString\" type=\"string\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ImmunizationEvaluationStatusCodes-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ImmunizationEvaluationStatusCodes\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The status of the evaluation being done.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ImmunizationEvaluationStatusCodes-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/immunizationrecommendation.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ImmunizationRecommendation\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ImmunizationRecommendation</sch:title>\n    <sch:rule context=\"f:ImmunizationRecommendation\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:authority\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:authority/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:authority/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation\">\n      <sch:assert test=\"exists(f:vaccineCode) or exists(f:targetDisease)\">imr-1: One of vaccineCode or targetDisease SHALL be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation/f:supportingImmunization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation/f:supportingImmunization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation/f:supportingImmunization/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation/f:supportingPatientInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation/f:supportingPatientInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImmunizationRecommendation/f:recommendation/f:supportingPatientInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/immunizationrecommendation.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ImmunizationRecommendation\" type=\"ImmunizationRecommendation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ImmunizationRecommendation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this particular recommendation record.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient the recommendation(s) are for.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date the immunization recommendation(s) were created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the authority who published the protocol (e.g. ACIP).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recommendation\" type=\"ImmunizationRecommendation.Recommendation\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Vaccine administration recommendations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImmunizationRecommendation.Recommendation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"vaccineCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Vaccine(s) or vaccine group that pertain to the recommendation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"targetDisease\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The targeted disease for the recommendation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contraindicatedVaccineCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Vaccine(s) which should not be used to fulfill the recommendation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"forecastStatus\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the patient status with respect to the path to immunity for the target disease.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"forecastReason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reason for the assigned forecast status.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dateCriterion\" type=\"ImmunizationRecommendation.DateCriterion\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Vaccine date recommendations.  For example, earliest date to administer, latest date to administer, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contains the description about the protocol under which the vaccine was administered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"series\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">One possible path to achieve presumed immunity against a disease - within the context of an authority.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Nominal position of the recommended dose in a series (e.g. dose 2 is the next recommended dose).</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"doseNumberPositiveInt\" type=\"positiveInt\"/>\n            <xs:element name=\"doseNumberString\" type=\"string\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The recommended number of doses to achieve immunity.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"seriesDosesPositiveInt\" type=\"positiveInt\"/>\n            <xs:element name=\"seriesDosesString\" type=\"string\"/>\n          </xs:choice>\n          <xs:element name=\"supportingImmunization\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Immunization event history and/or evaluation that supports the status and recommendation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingPatientInformation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Patient Information that supports the status and recommendation.  This includes patient observations, adverse reactions and allergy/intolerance information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImmunizationRecommendation.DateCriterion\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A patient's point-in-time set of recommendations (i.e. forecasting) according to a published schedule with optional supporting justification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date classification of recommendation.  For example, earliest date to give, latest date to give, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date whose meaning is specified by dateCriterion.code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/implementationguide.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ImplementationGuide\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ImplementationGuide</sch:title>\n    <sch:rule context=\"f:ImplementationGuide\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(for $id in (f:resource/f:fhirVersion) return $id[not(ancestor::f:fhirVersion/@value=$id/@value)])=0\">ig-2: If a resource has a fhirVersion, it must be oe of the versions defined for the Implementation Guide</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:definition\">\n      <sch:assert test=\"count(for $id in (f:resource/f:groupingId) return $id[not(ancestor::f:grouping/@id=$id/@value)])=0\">ig-1: If a resource has a groupingId, it must refer to a grouping defined in the Implementation Guide</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:definition/f:resource/f:reference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:definition/f:resource/f:reference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:definition/f:resource/f:reference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:manifest/f:resource/f:reference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:manifest/f:resource/f:reference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ImplementationGuide/f:manifest/f:resource/f:reference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/implementationguide.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ImplementationGuide\" type=\"ImplementationGuide\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ImplementationGuide\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this implementation guide is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the implementation guide is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the implementation guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the implementation guide author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the implementation guide. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the implementation guide.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this implementation guide. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this implementation guide is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the implementation guide was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the implementation guide.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the implementation guide from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate implementation guide instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the implementation guide is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the implementation guide.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"packageId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The NPM package name for this Implementation Guide, used in the NPM package distribution, which is the primary mechanism by which FHIR based tooling manages IG dependencies. This value must be globally unique, and should be assigned with care.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"license\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SPDXLicense\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The license that applies to this Implementation Guide, using an SPDX license code, or 'not-open-source'.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fhirVersion\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"FHIRVersion\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version(s) of the FHIR specification that this ImplementationGuide targets - e.g. describes how to use. The value of this element is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 4.0.1. for this version.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dependsOn\" type=\"ImplementationGuide.DependsOn\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"global\" type=\"ImplementationGuide.Global\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A set of profiles that all resources covered by this implementation guide must conform to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definition\" type=\"ImplementationGuide.Definition\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The information needed by an IG publisher tool to publish the whole implementation guide.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manifest\" type=\"ImplementationGuide.Manifest\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about an assembled implementation guide, created by the publication tooling.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImplementationGuide.DependsOn\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"uri\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A canonical reference to the Implementation guide for the dependency.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"packageId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The NPM package name for the Implementation Guide that this IG depends on.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version of the IG that is depended on, when the correct version is required to understand the IG correctly.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImplementationGuide.Global\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of resource that all instances must conform to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the profile that all instances must conform to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImplementationGuide.Definition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"grouping\" type=\"ImplementationGuide.Grouping\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A logical group of resources. Logical groups can be used when building pages.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resource\" type=\"ImplementationGuide.Resource\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"page\" type=\"ImplementationGuide.Page\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A page / section in the implementation guide. The root page is the implementation guide home page.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parameter\" type=\"ImplementationGuide.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines how IG is built by tools.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"template\" type=\"ImplementationGuide.Template\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A template for building resources.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImplementationGuide.Grouping\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The human-readable title to display for the package of resources when rendering the implementation guide.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human readable text describing the package.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImplementationGuide.Resource\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where this resource is found.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fhirVersion\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"FHIRVersion\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the FHIR Version(s) this artifact is intended to apply to. If no versions are specified, the resource is assumed to apply to all the versions stated in ImplementationGuide.fhirVersion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the reason that a resource has been included in the implementation guide.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If true or a reference, indicates the resource is an example instance.  If a reference is present, indicates that the example is an example of the specified profile.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"exampleBoolean\" type=\"boolean\"/>\n            <xs:element name=\"exampleCanonical\" type=\"canonical\"/>\n          </xs:choice>\n          <xs:element name=\"groupingId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the id of the grouping this resource appears in.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImplementationGuide.Page\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The source address for the page.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"nameUrl\" type=\"url\"/>\n            <xs:element name=\"nameReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"title\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short title used to represent this page in navigational structures such as table of contents, bread crumbs, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"generation\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GuidePageGeneration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that indicates how the page is generated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"page\" type=\"ImplementationGuide.Page\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Nested Pages/Sections under this page.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImplementationGuide.Parameter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"GuideParameterCode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">apply | path-resource | path-pages | path-tx-cache | expansion-parameter | rule-broken-links | generate-xml | generate-json | generate-turtle | html-template.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Value for named type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImplementationGuide.Template\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of template specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The source location for the template.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"scope\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The scope in which the template applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImplementationGuide.Manifest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"rendering\" minOccurs=\"0\" maxOccurs=\"1\" type=\"url\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A pointer to official web page, PDF or other rendering of the implementation guide.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resource\" type=\"ImplementationGuide.Resource1\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"page\" type=\"ImplementationGuide.Page1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about a page within the IG.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"image\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates a relative path to an image that exists within the IG.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"other\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the relative path of an additional non-page, non-image file that is part of the IG - e.g. zip, jar and similar files that could be the target of a hyperlink in a derived IG.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImplementationGuide.Resource1\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where this resource is found.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If true or a reference, indicates the resource is an example instance.  If a reference is present, indicates that the example is an example of the specified profile.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"exampleBoolean\" type=\"boolean\"/>\n            <xs:element name=\"exampleCanonical\" type=\"canonical\"/>\n          </xs:choice>\n          <xs:element name=\"relativePath\" minOccurs=\"0\" maxOccurs=\"1\" type=\"url\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The relative path for primary page for this resource within the IG.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ImplementationGuide.Page1\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A set of rules of how a particular interoperability or standards problem is solved - typically through the use of FHIR resources. This resource is used to gather all the parts of an implementation guide into a logical whole and to publish a computable definition of all the parts.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Relative path to the page.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Label for the page intended for human display.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"anchor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of an anchor available on the page.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"GuideParameterCode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"apply\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Apply Metadata Value</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"path-resource\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Resource Path</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"path-pages\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Pages Path</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"path-tx-cache\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Terminology Cache Path</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"expansion-parameter\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Expansion Profile</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"rule-broken-links\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Broken Links Rule</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"generate-xml\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Generate XML</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"generate-json\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Generate JSON</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"generate-turtle\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Generate Turtle</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"html-template\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">HTML Template</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"GuideParameterCode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Code of parameter that is input to the guide.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"GuideParameterCode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SPDXLicense-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"not-open-source\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not open source</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"0BSD\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD Zero Clause License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AAL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Attribution Assurance License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Abstyles\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Abstyles License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Adobe-2006\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Adobe Systems Incorporated Source Code License Agreement</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Adobe-Glyph\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Adobe Glyph List License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ADSL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Amazon Digital Services License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AFL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Academic Free License v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AFL-1.2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Academic Free License v1.2</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AFL-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Academic Free License v2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AFL-2.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Academic Free License v2.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AFL-3.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Academic Free License v3.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Afmparse\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Afmparse License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AGPL-1.0-only\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Affero General Public License v1.0 only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AGPL-1.0-or-later\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Affero General Public License v1.0 or later</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AGPL-3.0-only\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Affero General Public License v3.0 only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AGPL-3.0-or-later\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Affero General Public License v3.0 or later</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Aladdin\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Aladdin Free Public License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AMDPLPA\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">AMD's plpa_map.c License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AML\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Apple MIT License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"AMPAS\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Academy of Motion Picture Arts and Sciences BSD</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ANTLR-PD\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ANTLR Software Rights Notice</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Apache-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Apache License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Apache-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Apache License 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Apache-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Apache License 2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"APAFML\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Adobe Postscript AFM License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"APL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Adaptive Public License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"APSL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Apple Public Source License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"APSL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Apple Public Source License 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"APSL-1.2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Apple Public Source License 1.2</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"APSL-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Apple Public Source License 2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Artistic-1.0-cl8\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Artistic License 1.0 w/clause 8</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Artistic-1.0-Perl\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Artistic License 1.0 (Perl)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Artistic-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Artistic License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Artistic-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Artistic License 2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Bahyph\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Bahyph License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Barr\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Barr License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Beerware\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Beerware License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BitTorrent-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BitTorrent Open Source License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BitTorrent-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BitTorrent Open Source License v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Borceux\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Borceux license</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-1-Clause\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD 1-Clause License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-2-Clause-FreeBSD\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD 2-Clause FreeBSD License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-2-Clause-NetBSD\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD 2-Clause NetBSD License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-2-Clause-Patent\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD-2-Clause Plus Patent License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-2-Clause\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD 2-Clause &quot;Simplified&quot; License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-3-Clause-Attribution\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD with attribution</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-3-Clause-Clear\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD 3-Clause Clear License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-3-Clause-LBNL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Lawrence Berkeley National Labs BSD variant license</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-3-Clause-No-Nuclear-License-2014\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD 3-Clause No Nuclear License 2014</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-3-Clause-No-Nuclear-License\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD 3-Clause No Nuclear License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-3-Clause-No-Nuclear-Warranty\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD 3-Clause No Nuclear Warranty</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-3-Clause\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD 3-Clause &quot;New&quot; or &quot;Revised&quot; License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-4-Clause-UC\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD-4-Clause (University of California-Specific)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-4-Clause\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD 4-Clause &quot;Original&quot; or &quot;Old&quot; License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-Protection\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD Protection License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSD-Source-Code\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">BSD Source Code Attribution</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"BSL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Boost Software License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"bzip2-1.0.5\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">bzip2 and libbzip2 License v1.0.5</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"bzip2-1.0.6\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">bzip2 and libbzip2 License v1.0.6</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Caldera\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Caldera License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CATOSL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Computer Associates Trusted Open Source License 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution 1.0 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution 2.0 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-2.5\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution 2.5 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-3.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution 3.0 Unported</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-4.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution 4.0 International</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial 1.0 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial 2.0 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-2.5\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial 2.5 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-3.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial 3.0 Unported</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-4.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial 4.0 International</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-ND-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-ND-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-ND-2.5\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-ND-3.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-ND-4.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial No Derivatives 4.0 International</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-SA-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial Share Alike 1.0 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-SA-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial Share Alike 2.0 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-SA-2.5\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial Share Alike 2.5 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-SA-3.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial Share Alike 3.0 Unported</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-NC-SA-4.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Non Commercial Share Alike 4.0 International</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-ND-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution No Derivatives 1.0 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-ND-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution No Derivatives 2.0 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-ND-2.5\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution No Derivatives 2.5 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-ND-3.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution No Derivatives 3.0 Unported</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-ND-4.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution No Derivatives 4.0 International</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-SA-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Share Alike 1.0 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-SA-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Share Alike 2.0 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-SA-2.5\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Share Alike 2.5 Generic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-SA-3.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Share Alike 3.0 Unported</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC-BY-SA-4.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Attribution Share Alike 4.0 International</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CC0-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Creative Commons Zero v1.0 Universal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CDDL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Common Development and Distribution License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CDDL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Common Development and Distribution License 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CDLA-Permissive-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Community Data License Agreement Permissive 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CDLA-Sharing-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Community Data License Agreement Sharing 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CECILL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CeCILL Free Software License Agreement v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CECILL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CeCILL Free Software License Agreement v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CECILL-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CeCILL Free Software License Agreement v2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CECILL-2.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CeCILL Free Software License Agreement v2.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CECILL-B\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CeCILL-B Free Software License Agreement</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CECILL-C\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CeCILL-C Free Software License Agreement</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ClArtistic\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Clarified Artistic License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CNRI-Jython\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CNRI Jython License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CNRI-Python-GPL-Compatible\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CNRI Python Open Source GPL Compatible License Agreement</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CNRI-Python\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CNRI Python License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Condor-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Condor Public License v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CPAL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Common Public Attribution License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Common Public License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CPOL-1.02\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Code Project Open License 1.02</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Crossword\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Crossword License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CrystalStacker\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CrystalStacker License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CUA-OPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CUA Office Public License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Cube\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cube License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"curl\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">curl License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"D-FSL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Deutsche Freie Software Lizenz</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"diffmark\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">diffmark license</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DOC\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DOC License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Dotseqn\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Dotseqn License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"DSDP\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DSDP License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"dvipdfm\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">dvipdfm License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ECL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Educational Community License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ECL-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Educational Community License v2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EFL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Eiffel Forum License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EFL-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Eiffel Forum License v2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"eGenix\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">eGenix.com Public License 1.1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Entessa\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entessa Public License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Eclipse Public License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EPL-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Eclipse Public License 2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ErlPL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Erlang Public License v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EUDatagrid\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">EU DataGrid Software License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EUPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">European Union Public License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EUPL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">European Union Public License 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"EUPL-1.2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">European Union Public License 1.2</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Eurosym\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Eurosym License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Fair\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Fair License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Frameworx-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Frameworx Open License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"FreeImage\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">FreeImage Public License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"FSFAP\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">FSF All Permissive License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"FSFUL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">FSF Unlimited License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"FSFULLR\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">FSF Unlimited License (with License Retention)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"FTL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Freetype Project License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GFDL-1.1-only\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Free Documentation License v1.1 only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GFDL-1.1-or-later\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Free Documentation License v1.1 or later</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GFDL-1.2-only\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Free Documentation License v1.2 only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GFDL-1.2-or-later\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Free Documentation License v1.2 or later</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GFDL-1.3-only\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Free Documentation License v1.3 only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GFDL-1.3-or-later\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Free Documentation License v1.3 or later</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Giftware\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Giftware License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GL2PS\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GL2PS License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Glide\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">3dfx Glide License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Glulxe\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Glulxe License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"gnuplot\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">gnuplot License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GPL-1.0-only\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU General Public License v1.0 only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GPL-1.0-or-later\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU General Public License v1.0 or later</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GPL-2.0-only\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU General Public License v2.0 only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GPL-2.0-or-later\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU General Public License v2.0 or later</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GPL-3.0-only\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU General Public License v3.0 only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"GPL-3.0-or-later\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU General Public License v3.0 or later</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"gSOAP-1.3b\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">gSOAP Public License v1.3b</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"HaskellReport\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Haskell Language Report License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"HPND\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Historical Permission Notice and Disclaimer</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"IBM-pibs\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">IBM PowerPC Initialization and Boot Software</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ICU\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ICU License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"IJG\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Independent JPEG Group License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ImageMagick\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ImageMagick License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"iMatix\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">iMatix Standard Function Library Agreement</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Imlib2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Imlib2 License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Info-ZIP\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Info-ZIP License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Intel-ACPI\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Intel ACPI Software License Agreement</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Intel\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Intel Open Source License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Interbase-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Interbase Public License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"IPA\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">IPA Font License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"IPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">IBM Public License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ISC\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ISC License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"JasPer-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">JasPer License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"JSON\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">JSON License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LAL-1.2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Licence Art Libre 1.2</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LAL-1.3\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Licence Art Libre 1.3</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Latex2e\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Latex2e License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Leptonica\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Leptonica License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LGPL-2.0-only\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Library General Public License v2 only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LGPL-2.0-or-later\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Library General Public License v2 or later</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LGPL-2.1-only\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Lesser General Public License v2.1 only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LGPL-2.1-or-later\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Lesser General Public License v2.1 or later</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LGPL-3.0-only\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Lesser General Public License v3.0 only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LGPL-3.0-or-later\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GNU Lesser General Public License v3.0 or later</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LGPLLR\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Lesser General Public License For Linguistic Resources</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Libpng\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">libpng License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"libtiff\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">libtiff License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LiLiQ-P-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Licence Libre du Québec – Permissive version 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LiLiQ-R-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Licence Libre du Québec – Réciprocité version 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LiLiQ-Rplus-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Licence Libre du Québec – Réciprocité forte version 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Linux-OpenIB\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Linux Kernel Variant of OpenIB.org license</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Lucent Public License Version 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LPL-1.02\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Lucent Public License v1.02</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LPPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">LaTeX Project Public License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LPPL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">LaTeX Project Public License v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LPPL-1.2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">LaTeX Project Public License v1.2</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LPPL-1.3a\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">LaTeX Project Public License v1.3a</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"LPPL-1.3c\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">LaTeX Project Public License v1.3c</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MakeIndex\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MakeIndex License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MirOS\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MirOS License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MIT-0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MIT No Attribution</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MIT-advertising\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Enlightenment License (e16)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MIT-CMU\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CMU License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MIT-enna\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">enna License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MIT-feh\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">feh License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MIT\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MIT License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MITNFA\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">MIT +no-false-attribs license</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Motosoto\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Motosoto License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"mpich2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">mpich2 License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Mozilla Public License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MPL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Mozilla Public License 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MPL-2.0-no-copyleft-exception\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Mozilla Public License 2.0 (no copyleft exception)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MPL-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Mozilla Public License 2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MS-PL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Microsoft Public License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MS-RL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Microsoft Reciprocal License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"MTLL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Matrix Template Library License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Multics\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Multics License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Mup\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Mup License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NASA-1.3\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">NASA Open Source Agreement 1.3</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Naumen\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Naumen Public License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NBPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Net Boolean Public License v1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NCSA\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">University of Illinois/NCSA Open Source License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Net-SNMP\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Net-SNMP License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NetCDF\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">NetCDF license</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Newsletr\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Newsletr License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NGPL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Nethack General Public License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NLOD-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Norwegian Licence for Open Government Data</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NLPL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">No Limit Public License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Nokia\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Nokia Open Source License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NOSL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Netizen Open Source License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Noweb\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Noweb License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Netscape Public License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NPL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Netscape Public License v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NPOSL-3.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Non-Profit Open Software License 3.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NRL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">NRL License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"NTP\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">NTP License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OCCT-PL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open CASCADE Technology Public License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OCLC-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">OCLC Research Public License 2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ODbL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ODC Open Database License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OFL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SIL Open Font License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OFL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SIL Open Font License 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OGTSL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open Group Test Suite License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-1.2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v1.2</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-1.3\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v1.3</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-1.4\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v1.4</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-2.0.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.0.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.0 (or possibly 2.0A and 2.0B)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-2.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-2.2.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.2.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-2.2.2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License 2.2.2</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-2.2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.2</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-2.3\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.3</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-2.4\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.4</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-2.5\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.5</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-2.6\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.6</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-2.7\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.7</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OLDAP-2.8\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open LDAP Public License v2.8</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OML\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open Market License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OpenSSL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">OpenSSL License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open Public License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OSET-PL-2.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">OSET Public License version 2.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OSL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open Software License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OSL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open Software License 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OSL-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open Software License 2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OSL-2.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open Software License 2.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"OSL-3.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open Software License 3.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PDDL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">ODC Public Domain Dedication &amp; License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PHP-3.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PHP License v3.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PHP-3.01\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PHP License v3.01</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Plexus\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Plexus Classworlds License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"PostgreSQL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PostgreSQL License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"psfrag\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">psfrag License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"psutils\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">psutils License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Python-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Python License 2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Qhull\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Qhull License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"QPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Q Public License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Rdisc\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Rdisc License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"RHeCos-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Red Hat eCos Public License v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"RPL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Reciprocal Public License 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"RPL-1.5\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Reciprocal Public License 1.5</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"RPSL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">RealNetworks Public Source License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"RSA-MD\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">RSA Message-Digest License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"RSCPL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Ricoh Source Code Public License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Ruby\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Ruby License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SAX-PD\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Sax Public Domain Notice</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Saxpath\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Saxpath License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SCEA\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SCEA Shared Source License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Sendmail\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Sendmail License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SGI-B-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SGI Free Software License B v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SGI-B-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SGI Free Software License B v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SGI-B-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SGI Free Software License B v2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SimPL-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Simple Public License 2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SISSL-1.2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Sun Industry Standards Source License v1.2</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SISSL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Sun Industry Standards Source License v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Sleepycat\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Sleepycat License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SMLNJ\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Standard ML of New Jersey License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SMPPL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Secure Messaging Protocol Public License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SNIA\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SNIA Public License 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Spencer-86\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Spencer License 86</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Spencer-94\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Spencer License 94</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Spencer-99\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Spencer License 99</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Sun Public License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SugarCRM-1.1.3\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SugarCRM Public License v1.1.3</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SWL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Scheme Widget Library (SWL) Software License Agreement</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"TCL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">TCL/TK License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"TCP-wrappers\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">TCP Wrappers License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"TMate\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">TMate Open Source License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"TORQUE-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">TORQUE v2.5+ Software License v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"TOSL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Trusster Open Source License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Unicode-DFS-2015\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unicode License Agreement - Data Files and Software (2015)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Unicode-DFS-2016\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unicode License Agreement - Data Files and Software (2016)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Unicode-TOU\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unicode Terms of Use</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Unlicense\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">The Unlicense</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"UPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Universal Permissive License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Vim\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Vim License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"VOSTROM\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">VOSTROM Public License for Open Source</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"VSL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Vovida Software License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"W3C-19980720\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">W3C Software Notice and License (1998-07-20)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"W3C-20150513\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">W3C Software Notice and Document License (2015-05-13)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"W3C\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">W3C Software Notice and License (2002-12-31)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Watcom-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Sybase Open Watcom Public License 1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Wsuipa\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Wsuipa License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"WTFPL\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Do What The F*ck You Want To Public License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"X11\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">X11 License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Xerox\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Xerox License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"XFree86-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">XFree86 License 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"xinetd\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">xinetd License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Xnet\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">X.Net License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"xpp\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">XPP License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"XSkat\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">XSkat License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"YPL-1.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Yahoo! Public License v1.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"YPL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Yahoo! Public License v1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Zed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Zed License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Zend-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Zend License v2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Zimbra-1.3\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Zimbra Public License v1.3</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Zimbra-1.4\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Zimbra Public License v1.4</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"zlib-acknowledgement\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">zlib/libpng License with Acknowledgement</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Zlib\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">zlib License</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ZPL-1.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Zope Public License 1.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ZPL-2.0\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Zope Public License 2.0</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ZPL-2.1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Zope Public License 2.1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SPDXLicense\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The license that applies to an Implementation Guide (using an SPDX license Identifiers, or 'not-open-source'). The binding is required but new SPDX license Identifiers are allowed to be used (https://spdx.org/licenses/).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"SPDXLicense-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"GuidePageGeneration-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"html\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">HTML</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"markdown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Markdown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"xml\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">XML</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"generated\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Generated</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"GuidePageGeneration\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A code that indicates how the page is generated.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"GuidePageGeneration-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/insuranceplan.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource InsurancePlan\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>InsurancePlan</sch:title>\n    <sch:rule context=\"f:InsurancePlan\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(f:identifier | f:name) &gt; 0\">ipn-1: The organization SHALL at least have a name or an idendtifier, and possibly more than one</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:ownedBy\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:ownedBy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:ownedBy/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:administeredBy\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:administeredBy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:administeredBy/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverageArea\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverageArea/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverageArea/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:contact/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:contact/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:network\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:network/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:network/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverage/f:network\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverage/f:network/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverage/f:network/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:coverage/f:benefit/f:limit/f:value\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:coverageArea\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:coverageArea/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:coverageArea/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:network\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:network/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:network/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:InsurancePlan/f:plan/f:specificCost/f:benefit/f:cost/f:value\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/insuranceplan.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"InsurancePlan\" type=\"InsurancePlan\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"InsurancePlan\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this health insurance product which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The current state of the health insurance product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of health insurance product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Official name of the health insurance product as designated by the owner.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"alias\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of alternate names that the product is known as, or was known as in the past.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period of time that the health insurance product is available.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"ownedBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The entity that is providing  the health insurance product and underwriting the risk.  This is typically an insurance carriers, other third-party payers, or health plan sponsors comonly referred to as 'payers'.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"administeredBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An organization which administer other services such as underwriting, customer service and/or claims processing on behalf of the health insurance product owner.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"coverageArea\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The geographic region in which a health insurance product's benefits apply.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" type=\"InsurancePlan.Contact\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The contact for the health insurance product for a certain purpose.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The technical endpoints providing access to services operated for the health insurance product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the network included in the health insurance product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"coverage\" type=\"InsurancePlan.Coverage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details about the coverage offered by the insurance product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"plan\" type=\"InsurancePlan.Plan\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details about an insurance plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"InsurancePlan.Contact\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates a purpose for which the contact can be reached.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"HumanName\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name associated with the contact.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Address\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Visiting or postal addresses for the contact.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"InsurancePlan.Coverage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of coverage  (Medical; Dental; Mental Health; Substance Abuse; Vision; Drug; Short Term; Long Term Care; Hospice; Home Health).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the network that providing the type of coverage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"benefit\" type=\"InsurancePlan.Benefit\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific benefits under this type of coverage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"InsurancePlan.Benefit\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of benefit (primary care; speciality care; inpatient; outpatient).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requirement\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The referral requirements to have access/coverage for this benefit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"limit\" type=\"InsurancePlan.Limit\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific limits on the benefit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"InsurancePlan.Limit\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum amount of a service item a plan will pay for a covered benefit.  For examples. wellness visits, or eyeglasses.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific limit on the benefit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"InsurancePlan.Plan\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this health insurance plan which remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of plan. For example, &quot;Platinum&quot; or &quot;High Deductable&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"coverageArea\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The geographic region in which a health insurance plan's benefits apply.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the network that providing the type of coverage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"generalCost\" type=\"InsurancePlan.GeneralCost\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Overall costs associated with the plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specificCost\" type=\"InsurancePlan.SpecificCost\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Costs associated with the coverage provided by the product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"InsurancePlan.GeneralCost\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of cost.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"groupSize\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number of participants enrolled in the plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cost\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Value of the cost.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information about the general costs associated with this plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"InsurancePlan.SpecificCost\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"category\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">General category of benefit (Medical; Dental; Vision; Drug; Mental Health; Substance Abuse; Hospice, Home Health).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"benefit\" type=\"InsurancePlan.Benefit1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">List of the specific benefits under this category of benefit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"InsurancePlan.Benefit1\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of specific benefit (preventative; primary care office visit; speciality office visit; hospitalization; emergency room; urgent care).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cost\" type=\"InsurancePlan.Cost\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">List of the costs associated with a specific benefit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"InsurancePlan.Cost\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details of a Health Insurance product/plan provided by an organization.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of cost (copay; individual cap; family cap; coinsurance; deductible).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"applicability\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the cost applies to in-network or out-of-network providers (in-network; out-of-network; other).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"qualifiers\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information about the cost, such as information about funding sources (e.g. HSA, HRA, FSA, RRA).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual cost value. (some of the costs may be represented as percentages rather than currency, e.g. 10% coinsurance).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/invoice.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Invoice\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Invoice</sch:title>\n    <sch:rule context=\"f:Invoice\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:recipient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:recipient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:recipient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:participant/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:participant/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:participant/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:issuer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:issuer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:issuer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:account\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:account/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:account/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:lineItem/f:chargeItemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:lineItem/f:chargeItemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:lineItem/f:chargeItemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Invoice/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/invoice.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Invoice\" type=\"Invoice\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Invoice\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier of this Invoice, often used for reference in correspondence about this invoice or for tracking of payments.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"InvoiceStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The current state of the Invoice.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cancelledReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">In case of Invoice cancellation a reason must be given (entered in error, superseded by corrected invoice etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of Invoice depending on domain, realm an usage (e.g. internal/external, dental, preliminary).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual or set of individuals receiving the goods and services billed in this invoice.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recipient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual or Organization responsible for balancing of this invoice.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date/time(s) of when this Invoice was posted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"participant\" type=\"Invoice.Participant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed or participated in the charged service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"issuer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organizationissuing the Invoice.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"account\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Account which is supposed to be balanced with this Invoice.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lineItem\" type=\"Invoice.LineItem\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Each line item represents one charge for goods and services rendered. Details such as date, code and amount are found in the referenced ChargeItem resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"totalPriceComponent\" type=\"Invoice.PriceComponent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The total amount for the Invoice may be calculated as the sum of the line items with surcharges/deductions that apply in certain conditions.  The priceComponent element can be used to offer transparency to the recipient of the Invoice of how the total price was calculated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"totalNet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Invoice total , taxes excluded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"totalGross\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Invoice total, tax included.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"paymentTerms\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Payment details such as banking details, period of payment, deductibles, methods of payment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments made about the invoice by the issuer, subject, or other participants.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Invoice.Participant\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the type of involvement (e.g. transcriptionist, creator etc.). If the invoice has been created automatically, the Participant may be a billing engine or another kind of device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The device, practitioner, etc. who performed or participated in the service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Invoice.LineItem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"sequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Sequence in which the items appear on the invoice.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The ChargeItem contains information such as the billing code, date, amount etc. If no further details are required for the lineItem, inline billing codes can be added using the CodeableConcept data type instead of the Reference.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"chargeItemReference\" type=\"Reference\"/>\n            <xs:element name=\"chargeItemCodeableConcept\" type=\"CodeableConcept\"/>\n          </xs:choice>\n          <xs:element name=\"priceComponent\" type=\"Invoice.PriceComponent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The price for a ChargeItem may be calculated as a base price with surcharges/deductions that apply in certain conditions. A ChargeItemDefinition resource that defines the prices, factors and conditions that apply to a billing code is currently under development. The priceComponent element can be used to offer transparency to the recipient of the Invoice as to how the prices have been calculated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Invoice.PriceComponent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Invoice containing collected ChargeItems from an Account with calculated individual and total price for Billing purpose.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"InvoicePriceComponentType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This code identifies the type of the component.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that identifies the component. Codes may be used to differentiate between kinds of taxes, surcharges, discounts etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"factor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The factor that has been applied on the base price for calculating this component.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount calculated for this component.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"InvoiceStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"draft\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">draft</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"issued\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">issued</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"balanced\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">balanced</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">entered in error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"InvoiceStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Codes identifying the lifecycle stage of an Invoice.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"InvoiceStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/library.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Library\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Library</sch:title>\n    <sch:rule context=\"f:Library\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:codeFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-1: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:dateFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-2: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:dateFilter/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:dataRequirement/f:dateFilter/f:valueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Library/f:content\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/library.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Library\" type=\"Library\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Library\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and expose existing knowledge assets such as logic libraries and information model descriptions, as well as to describe a collection of knowledge assets.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this library when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this library is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the library is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this library when it is represented in other formats, or referenced in a specification, model, design or an instance. e.g. CMS or NQF identifiers for a measure artifact. Note that at least one identifier is required for non-experimental active artifacts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the library when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the library author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the library. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the library.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the library giving additional information about its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this library. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this library is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the type of library such as a Logic Library, Model Definition, Asset Collection, or Module Definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code or group definition that describes the intended subject of the contents of the library.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the library was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the library changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the library.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the library from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate library instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the library is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this library is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A detailed description of how the library is used from a clinical perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the library and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the library.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the library content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the library. Topics provide a high-level categorization of the library that can be useful for filtering and searching.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ParameterDefinition\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The parameter element defines parameters used by the library.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dataRequirement\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DataRequirement\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes a set of data that must be provided in order to be able to successfully perform the computations defined by the library.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"content\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the contentType of the attachment determines how to interpret the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/linkage.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Linkage\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Linkage</sch:title>\n    <sch:rule context=\"f:Linkage\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(f:item)&gt;1\">lnk-1: Must have at least two items</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:item/f:resource\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:item/f:resource/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Linkage/f:item/f:resource/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/linkage.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Linkage\" type=\"Linkage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Identifies two or more records (resource instances) that refer to the same real-world &quot;occurrence&quot;.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Linkage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Identifies two or more records (resource instances) that refer to the same real-world &quot;occurrence&quot;.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether the asserted set of linkages are considered to be &quot;in effect&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the user or organization responsible for asserting the linkages as well as the user or organization who establishes the context in which the nature of each linkage is evaluated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" type=\"Linkage.Item\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies which record considered as the reference to the same real-world occurrence as well as how the items should be evaluated within the collection of linked items.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Linkage.Item\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Identifies two or more records (resource instances) that refer to the same real-world &quot;occurrence&quot;.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"LinkageType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Distinguishes which item is &quot;source of truth&quot; (if any) and which items are no longer considered to be current representations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resource\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The resource instance being linked as part of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"LinkageType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"source\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Source of Truth</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"alternate\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Alternate Record</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"historical\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Historical/Obsolete Record</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"LinkageType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Used to distinguish different roles a resource can play within a set of linked resources.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"LinkageType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/list.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource List\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>List</sch:title>\n    <sch:rule context=\"f:List\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"(f:mode/@value = 'working') or not(exists(f:entry/f:date))\">lst-3: An entry date can only be used if the mode of the list is &quot;working&quot;</sch:assert>\n      <sch:assert test=\"(f:mode/@value = 'changes') or not(exists(f:entry/f:deleted))\">lst-2: The deleted flag can only be used if the mode of the list is &quot;changes&quot;</sch:assert>\n      <sch:assert test=\"not(exists(f:emptyReason) and exists(f:entry))\">lst-1: A list can only have an emptyReason if it is empty</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:entry/f:item\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:entry/f:item/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:List/f:entry/f:item/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/list.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"List\" type=\"List\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A list is a curated collection of resources.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"List\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A list is a curated collection of resources.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for the List assigned for business purposes outside the context of FHIR.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ListStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the current state of this list.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ListMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A label for the list assigned by the author.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This code defines the purpose of the list - why it was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The common subject (or patient) of the resources that are in the list if there is one.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The encounter that is the context in which this list was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date that the list was prepared.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"orderedBy\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">What order applies to the items in the list.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments that apply to the overall list.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"entry\" type=\"List.Entry\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Entries in this list.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"emptyReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the list is empty, why the list is empty.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"List.Entry\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A list is a curated collection of resources.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"flag\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The flag allows the system constructing the list to indicate the role and significance of the item in the list.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"deleted\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">True if this item is marked as deleted in the list.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When this item was added to the list.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the actual resource from which data was derived.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ListStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"current\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Current</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"retired\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Retired</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered In Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ListStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The current state of the list.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ListStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/location.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Location\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Location</sch:title>\n    <sch:rule context=\"f:Location\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:managingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:managingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:managingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Location/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/location.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Location\" type=\"Location\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Location\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique code or number identifying the location to its users.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"LocationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status property covers the general availability of the resource, not the current value which may be covered by the operationStatus, or by a schedule/slots if they are configured for the location.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"operationalStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The operational status covers operation values most relevant to beds (but can also apply to rooms/units/chairs/etc. such as an isolation unit/dialysis chair). This typically covers concepts such as contamination, housekeeping, and other activities like maintenance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name of the location as used by humans. Does not need to be unique.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"alias\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of alternate names that the location is known as, or was known as, in the past.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of the Location, which helps in finding or referencing the place.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"mode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"LocationMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether a resource instance represents a specific location or a class of locations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the type of function performed at the location.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Address\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Physical location.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"physicalType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Physical form of the location, e.g. building, room, vehicle, road.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"position\" type=\"Location.Position\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"managingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization responsible for the provisioning and upkeep of the location.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Another Location of which this Location is physically a part of.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"hoursOfOperation\" type=\"Location.HoursOfOperation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">What days/times during a week is this location usually open.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"availabilityExceptions\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of when the locations opening ours are different to normal, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as detailed in the opening hours Times.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Technical endpoints providing access to services operated for the location.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Location.Position\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"longitude\" minOccurs=\"1\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"latitude\" minOccurs=\"1\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"altitude\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Location.HoursOfOperation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"daysOfWeek\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DaysOfWeek\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates which days of the week are available between the start and end Times.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"allDay\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Location is open all day.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"openingTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"time\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time that the Location opens.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"closingTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"time\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time that the Location closes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"LocationMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"instance\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Instance</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"kind\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Kind</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"LocationMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates whether a resource instance represents a specific location or a class of locations.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"LocationMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"LocationStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"suspended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Suspended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"inactive\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"LocationStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates whether the location is still in use.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"LocationStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/measure.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Measure\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Measure</sch:title>\n    <sch:rule context=\"f:Measure\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"exists(f:group/stratifier/code) or exists(f:group/stratifier/component)\">mea-1: Stratifier SHALL be either a single criteria or a set of criteria components</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:group/f:population/f:criteria\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:group/f:stratifier/f:criteria\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:group/f:stratifier/f:component/f:criteria\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Measure/f:supplementalData/f:criteria\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/measure.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Measure\" type=\"Measure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Measure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this measure when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this measure is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the measure is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this measure when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the measure when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the measure author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the measure. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the measure giving additional information about its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this measure. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this measure is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The intended subjects for the measure. If this element is not provided, a Patient subject is assumed, but the subject of the measure can be anything.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the measure was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the measure changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the measure from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate measure instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the measure is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this measure is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A detailed description, from a clinical perspective, of how the measure is used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the measure and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the measure content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the measure. Topics provide a high-level categorization grouping types of measures that can be useful for filtering and searching.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"library\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a Library resource containing the formal logic used by the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"disclaimer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Notices and disclaimers regarding the use of the measure or related to intellectual property (such as code systems) referenced by the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"scoring\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how the calculation is performed for the measure, including proportion, ratio, continuous-variable, and cohort. The value set is extensible, allowing additional measure scoring types to be represented.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"compositeScoring\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If this is a composite measure, the scoring method used to combine the component measures to determine the composite score.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether the measure is used to examine a process, an outcome over time, a patient-reported outcome, or a structure measure such as utilization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"riskAdjustment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rateAggregation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes how to combine the information calculated, based on logic in each of several populations, into one summarized result.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rationale\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides a succinct statement of the need for the measure. Usually includes statements pertaining to importance criterion: impact, gap in care, and evidence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"clinicalRecommendationStatement\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides a summary of relevant clinical guidelines or other clinical recommendations supporting the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"improvementNotation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information on whether an increase or decrease in score is the preferred result (e.g., a higher score indicates better quality OR a lower score indicates better quality OR quality is within a range).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides a description of an individual term used within the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"guidance\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"group\" type=\"Measure.Group\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A group of population criteria for the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supplementalData\" type=\"Measure.SupplementalData\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Measure.Group\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates a meaning for the group. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing groups to be correlated across measures.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The human readable description of this population group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"population\" type=\"Measure.Population\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A population criteria for the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"stratifier\" type=\"Measure.Stratifier\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library or a valid FHIR Resource Path.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Measure.Population\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of population criteria.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The human readable description of this population criteria.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"criteria\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Expression\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An expression that specifies the criteria for the population, typically the name of an expression in a library.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Measure.Stratifier\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates a meaning for the stratifier. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing stratifiers to be correlated across measures.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The human readable description of this stratifier criteria.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"criteria\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Expression\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An expression that specifies the criteria for the stratifier. This is typically the name of an expression defined within a referenced library, but it may also be a path to a stratifier element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"component\" type=\"Measure.Component\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A component of the stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library or a valid FHIR Resource Path.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Measure.Component\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates a meaning for the stratifier component. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing stratifiers to be correlated across measures.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The human readable description of this stratifier criteria component.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"criteria\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Expression\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An expression that specifies the criteria for this component of the stratifier. This is typically the name of an expression defined within a referenced library, but it may also be a path to a stratifier element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Measure.SupplementalData\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The Measure resource provides the definition of a quality measure.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates a meaning for the supplemental data. This can be as simple as a unique identifier, or it can establish meaning in a broader context by drawing from a terminology, allowing supplemental data to be correlated across measures.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The human readable description of this supplemental data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"criteria\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Expression\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The criteria for the supplemental data. This is typically the name of a valid expression defined within a referenced library, but it may also be a path to a specific data element. The criteria defines the data to be returned for this element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/measurereport.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MeasureReport\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MeasureReport</sch:title>\n    <sch:rule context=\"f:MeasureReport\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='data-collection') or not(exists(f:group))\">mrp-2: Stratifiers SHALL be either a single criteria or a set of criteria components</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='data-collection') or not(exists(f:group))\">mrp-1: Measure Reports used for data collection SHALL NOT communicate group and score information</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:reporter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:reporter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:reporter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:population/f:subjectResults\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:population/f:subjectResults/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:population/f:subjectResults/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:measureScore\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:stratifier/f:stratum/f:population/f:subjectResults\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:stratifier/f:stratum/f:population/f:subjectResults/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:stratifier/f:stratum/f:population/f:subjectResults/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:group/f:stratifier/f:stratum/f:measureScore\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:evaluatedResource\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:evaluatedResource/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MeasureReport/f:evaluatedResource/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/measurereport.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MeasureReport\" type=\"MeasureReport\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MeasureReport\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this MeasureReport when it is represented in other formats or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"MeasureReportStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The MeasureReport status. No data will be available until the MeasureReport status is complete.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"MeasureReportType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of measure report. This may be an individual report, which provides the score for the measure for an individual member of the population; a subject-listing, which returns the list of members that meet the various criteria in the measure; a summary report, which returns a population count for each of the criteria in the measure; or a data-collection, which enables the MeasureReport to be used to exchange the data-of-interest for a quality measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"measure\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the Measure that was calculated to produce this report.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Optional subject identifying the individual or individuals the report is for.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date this measure report was generated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reporter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual, location, or organization that is reporting the data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reporting period for which the report was calculated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"improvementNotation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether improvement in the measure is noted by an increase or decrease in the measure score.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"group\" type=\"MeasureReport.Group\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The results of the calculation, one for each population group in the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"evaluatedResource\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a Bundle containing the Resources that were used in the calculation of this measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MeasureReport.Group\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The meaning of the population group as defined in the measure definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"population\" type=\"MeasureReport.Population\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The populations that make up the population group, one for each type of population appropriate for the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"measureScore\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The measure score for this population group, calculated as appropriate for the measure type and scoring method, and based on the contents of the populations defined in the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"stratifier\" type=\"MeasureReport.Stratifier\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MeasureReport.Population\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the population.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"count\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of members of the population.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subjectResults\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This element refers to a List of subject level MeasureReport resources, one for each subject in this population.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MeasureReport.Stratifier\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The meaning of this stratifier, as defined in the measure definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"stratum\" type=\"MeasureReport.Stratum\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MeasureReport.Stratum\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value for this stratum, expressed as a CodeableConcept. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"component\" type=\"MeasureReport.Component\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A stratifier component value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"population\" type=\"MeasureReport.Population1\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The populations that make up the stratum, one for each type of population appropriate to the measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"measureScore\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The measure score for this stratum, calculated as appropriate for the measure type and scoring method, and based on only the members of this stratum.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MeasureReport.Component\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code for the stratum component value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The stratum component value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MeasureReport.Population1\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The MeasureReport resource contains the results of the calculation of a measure; and optionally a reference to the resources involved in that calculation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the population.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"count\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of members of the population in this stratum.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subjectResults\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This element refers to a List of subject level MeasureReport resources, one for each subject in this population in this stratum.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"MeasureReportStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"complete\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Complete</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"pending\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Pending</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"MeasureReportStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The status of the measure report.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"MeasureReportStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"MeasureReportType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"individual\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Individual</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"subject-list\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Subject List</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"summary\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Summary</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"data-collection\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Data Collection</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"MeasureReportType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of the measure report.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"MeasureReportType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/media.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Media\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Media</sch:title>\n    <sch:rule context=\"f:Media\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:createdPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:operator\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:operator/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:operator/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:device\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:content\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Media/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/media.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Media\" type=\"Media\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Media\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A procedure that is fulfilled in whole or in part by the creation of this media.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A larger event of which this particular event is a component or step.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EventStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The current state of the {{title}}.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that classifies whether the media is an image, video or audio recording or some other media category.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modality\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"view\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the imaging view e.g. Lateral or Antero-posterior (AP).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who/What this Media is a record of.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The encounter that establishes the context for this media.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date and time(s) at which the media was collected.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"createdDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"createdPeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:element name=\"issued\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date and time this version of the media was made available to providers, typically after having been reviewed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"operator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person who administered the collection of the image.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes why the event occurred in coded or textual form.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the site on the subject's body where the observation was made (i.e. the target site).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"deviceName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the device / manufacturer of the device  that was used to make the recording.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"device\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The device used to collect the media.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"height\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Height of the image in pixels (photo/video).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"width\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Width of the image in pixels (photo/video).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"frames\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"duration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The duration of the recording in seconds - for audio and video.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"content\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual content of the media - inline or by direct reference to the media source file.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments made about the media by the performer, subject or other participants.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medication.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Medication\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Medication</sch:title>\n    <sch:rule context=\"f:Medication\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:amount\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:amount/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:amount/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:ingredient/f:itemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:ingredient/f:itemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:ingredient/f:itemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:ingredient/f:strength\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:ingredient/f:strength/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Medication/f:ingredient/f:strength/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medication.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Medication\" type=\"Medication\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Medication\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifier for this medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"MedicationStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to indicate if the medication is in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"form\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the form of the item.  Powder; tablets; capsule.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific amount of the drug in the packaged product.  For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"ingredient\" type=\"Medication.Ingredient\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies a particular constituent of interest in the product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"batch\" type=\"Medication.Batch\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information that only applies to packages (not products).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Medication.Ingredient\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual ingredient - either a substance (simple ingredient) or another medication of a medication.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"itemCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"itemReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"isActive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indication of whether this ingredient affects the therapeutic action of the drug.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"strength\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Medication.Batch\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"lotNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The assigned lot number of a batch of the specified product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expirationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When this specific batch of product will expire.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"MedicationStatusCodes-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"inactive\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"MedicationStatusCodes\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A coded concept defining if the medication is in active use.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"MedicationStatusCodes-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicationadministration.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicationAdministration\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicationAdministration</sch:title>\n    <sch:rule context=\"f:MedicationAdministration\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:medicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:medicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:medicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:context\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:context/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:context/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:supportingInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:supportingInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:supportingInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:performer/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:performer/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:performer/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:device\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:dosage\">\n      <sch:assert test=\"exists(f:dose) or exists(f:*[starts-with(local-name(.), 'rate')])\">mad-1: SHALL have at least one of dosage.dose or dosage.rate[x]</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:dosage/f:dose\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:dosage/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:dosage/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:dosage/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:dosage/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:eventHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:eventHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationAdministration/f:eventHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicationadministration.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!-- \r\n  Copyright (c) 2011+, HL7, Inc.\r\n  All rights reserved.\r\n  \r\n  Redistribution and use in source and binary forms, with or without modification, \r\n  are permitted provided that the following conditions are met:\r\n  \r\n   * Redistributions of source code must retain the above copyright notice, this \r\n     list of conditions and the following disclaimer.\r\n   * Redistributions in binary form must reproduce the above copyright notice, \r\n     this list of conditions and the following disclaimer in the documentation \r\n     and/or other materials provided with the distribution.\r\n   * Neither the name of HL7 nor the names of its contributors may be used to \r\n     endorse or promote products derived from this software without specific \r\n     prior written permission.\r\n  \r\n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \r\n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \r\n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \r\n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \r\n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \r\n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \r\n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \r\n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \r\n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \r\n  POSSIBILITY OF SUCH DAMAGE.\r\n  \r\n\r\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \r\n\r\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\r\n  valid. Implementers will still need to be familiar with the content of the specification and with\r\n  any profiles that apply to the resources in order to make a conformant implementation.\r\n\r\n-->\r\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\r\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\r\n  <xs:element name=\"MedicationAdministration\" type=\"MedicationAdministration\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"MedicationAdministration\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifiers associated with this Medication Administration that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"instantiates\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A protocol, guideline, orderset, or other definition that was adhered to in whole or in part by this event.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A larger event of which this particular event is a component or step.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Will generally be set to show that the administration has been completed.  For some long running administrations such as infusions, it is possible for an administration to be started but not completed or it may be paused while some other process is under way.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code indicating why the administration was not performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates where the medication is expected to be consumed or administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"medicationCodeableConcept\" type=\"CodeableConcept\"/>\r\n            <xs:element name=\"medicationReference\" type=\"Reference\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The person or animal or group receiving the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The visit, admission, or other contact between patient and health care provider during which the medication administration was performed.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"supportingInformation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Additional information (for example, patient height and weight) that supports the administration of the medication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"effectiveDateTime\" type=\"dateTime\"/>\r\n            <xs:element name=\"effectivePeriod\" type=\"Period\"/>\r\n          </xs:choice>\r\n          <xs:element name=\"performer\" type=\"MedicationAdministration.Performer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed the medication administration and how they were involved.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code indicating why the medication was given.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Condition or observation that supports why the medication was administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The original request, instruction or authority to perform the administration.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"device\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The device used in administering the medication to the patient.  For example, a particular infusion pump.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Extra information about the medication administration that is not conveyed by the other attributes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dosage\" type=\"MedicationAdministration.Dosage\" minOccurs=\"0\" maxOccurs=\"1\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Describes the medication dosage information details e.g. dose, rate, site, route, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"eventHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A summary of the events of interest that have occurred, such as when the administration was verified.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationAdministration.Performer\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"function\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Distinguishes the type of involvement of the performer in the medication administration.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed the medication administration.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"MedicationAdministration.Dosage\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">Describes the event of a patient consuming or otherwise being administered a medication.  This may be as simple as swallowing a tablet or it may be a long running infusion.  Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Free text dosage can be used for cases where the dosage administered is too complex to code. When coded dosage is present, the free text dosage may still be present for display to humans.\r\rThe dosage instructions should reflect the dosage of the medication that was administered.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"site\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A coded specification of the anatomic site where the medication first entered the body.  For example, &quot;left arm&quot;.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"route\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient.  For example, topical, intravenous, etc.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.  This attribute will most often NOT be populated.  It is most commonly used for injections.  For example, Slow Push, Deep IV.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"dose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The amount of the medication given at one administration event.   Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Identifies the speed with which the medication was or will be introduced into the patient.  Typically, the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time, e.g. 500 ml per 2 hours.  Other examples:  200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.</xs:documentation>\r\n            </xs:annotation>\r\n            <xs:element name=\"rateRatio\" type=\"Ratio\"/>\r\n            <xs:element name=\"rateQuantity\" type=\"Quantity\"/>\r\n          </xs:choice>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n</xs:schema>\r\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicationdispense.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicationDispense\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicationDispense</sch:title>\n    <sch:rule context=\"f:MedicationDispense\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(exists(f:whenHandedOver/@value)) or not(exists(f:whenPrepared/@value)) or ( f:whenHandedOver/@value &gt;= f:whenPrepared/@value)\">mdd-1: whenHandedOver cannot be before whenPrepared</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:statusReasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:statusReasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:statusReasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:medicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:medicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:medicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:context\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:context/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:context/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:supportingInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:supportingInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:supportingInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:performer/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:performer/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:performer/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:authorizingPrescription\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:authorizingPrescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:authorizingPrescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:daysSupply\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:destination\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:destination/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:destination/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:receiver\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:receiver/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:receiver/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:timing/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:timing/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:timing/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:timing/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:timing/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:timing/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:doseRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:doseRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:doseRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:doseQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:doseAndRate/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:maxDosePerPeriod\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:maxDosePerPeriod/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:maxDosePerPeriod/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:maxDosePerAdministration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:dosageInstruction/f:maxDosePerLifetime\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:substitution/f:responsibleParty\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:substitution/f:responsibleParty/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:substitution/f:responsibleParty/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:detectedIssue\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:detectedIssue/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:detectedIssue/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:eventHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:eventHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationDispense/f:eventHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicationdispense.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicationDispense\" type=\"MedicationDispense\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicationDispense\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifiers associated with this Medication Dispense that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The procedure that trigger the dispense.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code specifying the state of the set of dispense events.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the reason why a dispense was not performed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"statusReasonCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"statusReasonReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the type of medication dispense (for example, where the medication is expected to be consumed or administered (i.e. inpatient or outpatient)).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"medicationCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"medicationReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A link to a resource representing the person or the group to whom the medication will be given.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The encounter or episode of care that establishes the context for this event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInformation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information that supports the medication being dispensed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" type=\"MedicationDispense.Performer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates who or what performed the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The principal physical location where the dispense was performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authorizingPrescription\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the medication order that is being dispensed against.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount of medication that has been dispensed. Includes unit of measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"daysSupply\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount of medication expressed as a timing amount.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"whenPrepared\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time when the dispensed product was packaged and reviewed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"whenHandedOver\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time the dispensed product was provided to the patient or their representative.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"destination\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identification of the facility/location where the medication was shipped to, as part of the dispense event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"receiver\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the person who picked up the medication.  This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Extra information about the dispense that could not be conveyed in the other attributes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dosageInstruction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Dosage\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how the medication is to be used by the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"substitution\" type=\"MedicationDispense.Substitution\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether or not substitution was made as part of the dispense.  In some cases, substitution will be expected but does not happen, in other cases substitution is not expected but does happen.  This block explains what substitution did or did not happen and why.  If nothing is specified, substitution was not done.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detectedIssue\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. drug-drug interaction, duplicate therapy, dosage alert etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"eventHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A summary of the events of interest that have occurred, such as when the dispense was verified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationDispense.Performer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"function\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Distinguishes the type of performer in the dispense.  For example, date enterer, packager, final checker.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The device, practitioner, etc. who performed the action.  It should be assumed that the actor is the dispenser of the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationDispense.Substitution\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates that a medication product is to be or has been dispensed for a named person/patient.  This includes a description of the medication product (supply) provided and the instructions for administering the medication.  The medication dispense is the result of a pharmacy system responding to a medication order.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"wasSubstituted\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">True if the dispenser dispensed a different drug or product from what was prescribed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code signifying whether a different drug was dispensed from what was prescribed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the reason for the substitution (or lack of substitution) from what was prescribed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"responsibleParty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person or organization that has primary responsibility for the substitution.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicationknowledge.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicationKnowledge\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicationKnowledge</sch:title>\n    <sch:rule context=\"f:MedicationKnowledge\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:amount\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:relatedMedicationKnowledge/f:reference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:relatedMedicationKnowledge/f:reference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:relatedMedicationKnowledge/f:reference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:associatedMedication\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:associatedMedication/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:associatedMedication/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:monograph/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:monograph/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:monograph/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:ingredient/f:itemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:ingredient/f:itemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:ingredient/f:itemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:ingredient/f:strength\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:ingredient/f:strength/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:ingredient/f:strength/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:timing/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:timing/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:timing/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:timing/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:timing/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:timing/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:doseRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:doseRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:doseRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:doseQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:doseAndRate/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:maxDosePerPeriod\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:maxDosePerPeriod/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:maxDosePerPeriod/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:maxDosePerAdministration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:dosage/f:dosage/f:maxDosePerLifetime\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:indicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:indicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:indicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:administrationGuidelines/f:patientCharacteristics/f:characteristicQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:packaging/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:drugCharacteristic/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:contraindication\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:contraindication/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:contraindication/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:regulatory/f:regulatoryAuthority\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:regulatory/f:regulatoryAuthority/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:regulatory/f:regulatoryAuthority/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:regulatory/f:maxDispense/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:regulatory/f:maxDispense/f:period\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:kinetics/f:areaUnderCurve\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:kinetics/f:lethalDose50\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationKnowledge/f:kinetics/f:halfLifePeriod\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicationknowledge.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicationKnowledge\" type=\"MedicationKnowledge\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicationKnowledge\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that specifies this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to indicate if the medication is in active use.  The status refers to the validity about the information of the medication and not to its medicinal properties.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"doseForm\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the form of the item.  Powder; tablets; capsule.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific amount of the drug in the packaged product.  For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"synonym\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional names for a medication, for example, the name(s) given to a medication in different countries.  For example, acetaminophen and paracetamol or salbutamol and albuterol.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedMedicationKnowledge\" type=\"MedicationKnowledge.RelatedMedicationKnowledge\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Associated or related knowledge about a medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"associatedMedication\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Associated or related medications.  For example, if the medication is a branded product (e.g. Crestor), this is the Therapeutic Moeity (e.g. Rosuvastatin) or if this is a generic medication (e.g. Rosuvastatin), this would link to a branded product (e.g. Crestor).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Category of the medication or product (e.g. branded product, therapeutic moeity, generic product, innovator product, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"monograph\" type=\"MedicationKnowledge.Monograph\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Associated documentation about the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"ingredient\" type=\"MedicationKnowledge.Ingredient\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies a particular constituent of interest in the product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preparationInstruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The instructions for preparing the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intendedRoute\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The intended or approved route of administration.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cost\" type=\"MedicationKnowledge.Cost\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The price of the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"monitoringProgram\" type=\"MedicationKnowledge.MonitoringProgram\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The program under which the medication is reviewed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"administrationGuidelines\" type=\"MedicationKnowledge.AdministrationGuidelines\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Guidelines for the administration of the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"medicineClassification\" type=\"MedicationKnowledge.MedicineClassification\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Categorization of the medication within a formulary or classification system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"packaging\" type=\"MedicationKnowledge.Packaging\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information that only applies to packages (not products).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"drugCharacteristic\" type=\"MedicationKnowledge.DrugCharacteristic\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies descriptive properties of the medicine, such as color, shape, imprints, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contraindication\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Potential clinical issue with or between medication(s) (for example, drug-drug interaction, drug-disease contraindication, drug-allergy interaction, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"regulatory\" type=\"MedicationKnowledge.Regulatory\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Regulatory information about a medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"kinetics\" type=\"MedicationKnowledge.Kinetics\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time course of drug absorption, distribution, metabolism and excretion of a medication from the body.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.RelatedMedicationKnowledge\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The category of the associated medication knowledge reference.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reference\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Associated documentation about the associated medication knowledge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.Monograph\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The category of documentation about the medication. (e.g. professional monograph, patient education monograph).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Associated documentation about the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.Ingredient\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual ingredient - either a substance (simple ingredient) or another medication.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"itemCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"itemReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"isActive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indication of whether this ingredient affects the therapeutic action of the drug.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"strength\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.Cost\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The category of the cost information.  For example, manufacturers' cost, patient cost, claim reimbursement cost, actual acquisition cost.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The source or owner that assigns the price to the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cost\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The price of the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.MonitoringProgram\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of program under which the medication is monitored.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name of the reviewing program.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.AdministrationGuidelines\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"dosage\" type=\"MedicationKnowledge.Dosage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Dosage for the medication for the specific guidelines.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indication for use that apply to the specific administration guidelines.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"indicationCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"indicationReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"patientCharacteristics\" type=\"MedicationKnowledge.PatientCharacteristics\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Characteristics of the patient that are relevant to the administration guidelines (for example, height, weight, gender, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.Dosage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of dosage (for example, prophylaxis, maintenance, therapeutic, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dosage\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Dosage\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Dosage for the medication for the specific guidelines.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.PatientCharacteristics\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific characteristic that is relevant to the administration guideline (e.g. height, weight, gender).</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"characteristicCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"characteristicQuantity\" type=\"Quantity\"/>\n          </xs:choice>\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific characteristic (e.g. height, weight, gender, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.MedicineClassification\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of category for the medication (for example, therapeutic classification, therapeutic sub-classification).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"classification\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific category assigned to the medication (e.g. anti-infective, anti-hypertensive, antibiotic, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.Packaging\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that defines the specific type of packaging that the medication can be found in (e.g. blister sleeve, tube, bottle).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of product units the package would contain if fully loaded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.DrugCharacteristic\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code specifying which characteristic of the medicine is being described (for example, colour, shape, imprint).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of the characteristic.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.Regulatory\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"regulatoryAuthority\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The authority that is specifying the regulations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"substitution\" type=\"MedicationKnowledge.Substitution\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies if changes are allowed when dispensing a medication from a regulatory perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"schedule\" type=\"MedicationKnowledge.Schedule\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the schedule of a medication in jurisdiction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maxDispense\" type=\"MedicationKnowledge.MaxDispense\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum number of units of the medication that can be dispensed in a period.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.Substitution\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the type of substitution allowed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"allowed\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies if regulation allows for changes in the medication when dispensing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.Schedule\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"schedule\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the specific drug schedule.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.MaxDispense\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"quantity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum number of units of the medication that can be dispensed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period that applies to the maximum number of units.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationKnowledge.Kinetics\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a medication that is used to support knowledge.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"areaUnderCurve\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The drug concentration measured at certain discrete points in time.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lethalDose50\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The median lethal dose of a drug.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"halfLifePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time required for any specified property (e.g., the concentration of a substance in the body) to decrease by half.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicationrequest.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicationRequest\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicationRequest</sch:title>\n    <sch:rule context=\"f:MedicationRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:reportedReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:reportedReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:reportedReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:medicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:medicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:medicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:supportingInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:supportingInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:supportingInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:requester\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:requester/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:requester/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:recorder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:recorder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:recorder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:groupIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:groupIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:insurance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:insurance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:insurance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:timing/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:timing/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:timing/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:timing/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:timing/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:timing/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:doseRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:doseRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:doseRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:doseQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:doseAndRate/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:maxDosePerPeriod\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:maxDosePerPeriod/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:maxDosePerPeriod/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:maxDosePerAdministration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dosageInstruction/f:maxDosePerLifetime\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:initialFill/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:initialFill/f:duration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:dispenseInterval\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:validityPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:expectedSupplyDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:dispenseRequest/f:performer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:priorPrescription\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:priorPrescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:priorPrescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:detectedIssue\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:detectedIssue/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:detectedIssue/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:eventHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:eventHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationRequest/f:eventHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicationrequest.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicationRequest\" type=\"MedicationRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called &quot;MedicationRequest&quot; rather than &quot;MedicationPrescription&quot; or &quot;MedicationOrder&quot; to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicationRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called &quot;MedicationRequest&quot; rather than &quot;MedicationPrescription&quot; or &quot;MedicationOrder&quot; to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifiers associated with this medication request that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"medicationrequestStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code specifying the current state of the order.  Generally, this will be active or completed state.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current state of the MedicationRequest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"medicationRequestIntent\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the request is a proposal, plan, or an original order.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the type of medication request (for example, where the medication is expected to be consumed or administered (i.e. inpatient or outpatient)).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the Medication Request should be addressed with respect to other requests.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"doNotPerform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If true indicates that the provider is asking for the medication request not to occur.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates if this record was captured as a secondary 'reported' record rather than as an original primary source-of-truth record.  It may also indicate the source of the report.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"reportedBoolean\" type=\"boolean\"/>\n            <xs:element name=\"reportedReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the medication being requested. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"medicationCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"medicationReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A link to a resource representing the person or set of individuals to whom the medication will be given.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Encounter during which this [x] was created or to which the creation of this record is tightly associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInformation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Include additional information (for example, patient height and weight) that supports the ordering of the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date (and perhaps time) when the prescription was initially written or authored on.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual, organization, or device that initiated the request and has responsibility for its activation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specified desired performer of the medication treatment (e.g. the performer of the medication administration).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performerType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the type of performer of the administration of the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recorder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person who entered the order on behalf of another individual for example in the case of a verbal or a telephone order.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reason or the indication for ordering or not ordering the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Condition or observation that supports why the medication was ordered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to a protocol, guideline, orderset, or other definition that is adhered to in whole or in part by this MedicationRequest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this MedicationRequest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A plan or request that is fulfilled in whole or in part by this medication request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"groupIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition or prescription.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"courseOfTherapyType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The description of the overall patte3rn of the administration of the medication to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Extra information about the prescription that could not be conveyed by the other attributes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dosageInstruction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Dosage\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how the medication is to be used by the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dispenseRequest\" type=\"MedicationRequest.DispenseRequest\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the specific details for the dispense or medication supply part of a medication request (also known as a Medication Prescription or Medication Order).  Note that this information is not always sent with the order.  There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"substitution\" type=\"MedicationRequest.Substitution\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether or not substitution can or should be part of the dispense. In some cases, substitution must happen, in other cases substitution must not happen. This block explains the prescriber's intent. If nothing is specified substitution may be done.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priorPrescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A link to a resource representing an earlier order related order or prescription.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detectedIssue\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, duplicate therapy, dosage alert etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"eventHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Links to Provenance records for past versions of this resource or fulfilling request or event resources that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationRequest.DispenseRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called &quot;MedicationRequest&quot; rather than &quot;MedicationPrescription&quot; or &quot;MedicationOrder&quot; to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"initialFill\" type=\"MedicationRequest.InitialFill\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the quantity or duration for the first dispense of the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dispenseInterval\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The minimum period of time that must occur between dispenses of the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validityPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This indicates the validity period of a prescription (stale dating the Prescription).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numberOfRepeatsAllowed\" minOccurs=\"0\" maxOccurs=\"1\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An integer indicating the number of times, in addition to the original dispense, (aka refills or repeats) that the patient can receive the prescribed medication. Usage Notes: This integer does not include the original order dispense. This means that if an order indicates dispense 30 tablets plus &quot;3 repeats&quot;, then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets.  A prescriber may explicitly say that zero refills are permitted after the initial dispense.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount that is to be dispensed for one fill.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expectedSupplyDuration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the intended dispensing Organization specified by the prescriber.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationRequest.InitialFill\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called &quot;MedicationRequest&quot; rather than &quot;MedicationPrescription&quot; or &quot;MedicationOrder&quot; to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount or quantity to provide as part of the first dispense.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"duration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The length of time that the first dispense is expected to last.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicationRequest.Substitution\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called &quot;MedicationRequest&quot; rather than &quot;MedicationPrescription&quot; or &quot;MedicationOrder&quot; to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">True if the prescriber allows a different drug to be dispensed from what was prescribed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"allowedBoolean\" type=\"boolean\"/>\n            <xs:element name=\"allowedCodeableConcept\" type=\"CodeableConcept\"/>\n          </xs:choice>\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the reason for the substitution, or why substitution must or must not be performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"medicationrequestStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-hold\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"stopped\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Stopped</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"draft\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"medicationrequestStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A coded concept specifying the state of the prescribing event. Describes the lifecycle of the prescription.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"medicationrequestStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"medicationRequestIntent-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"proposal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Proposal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"plan\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Plan</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"original-order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Original Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"reflex-order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Reflex Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"filler-order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Filler Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"instance-order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Instance Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"option\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Option</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"medicationRequestIntent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The kind of medication order.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"medicationRequestIntent-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicationstatement.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicationStatement\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicationStatement</sch:title>\n    <sch:rule context=\"f:MedicationStatement\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:medicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:medicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:medicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:context\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:context/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:context/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:informationSource\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:informationSource/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:informationSource/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:derivedFrom\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:derivedFrom/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:derivedFrom/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:timing/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:timing/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:timing/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:timing/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:timing/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:timing/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:doseRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:doseRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:doseRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:doseQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:doseAndRate/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:maxDosePerPeriod\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:maxDosePerPeriod/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:maxDosePerPeriod/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:maxDosePerAdministration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicationStatement/f:dosage/f:maxDosePerLifetime\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicationstatement.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicationStatement\" type=\"MedicationStatement\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a medication that is being consumed by a patient.   A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay.   The medication information may come from sources such as the patient's memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains. \n\nThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medication statement is often, if not always, less specific.  There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise.  As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains.  Medication administration is more formal and is not missing detailed information.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicationStatement\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a medication that is being consumed by a patient.   A MedicationStatement may indicate that the patient may be taking the medication now or has taken the medication in the past or will be taking the medication in the future.  The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician.  A common scenario where this information is captured is during the history taking process during a patient visit or stay.   The medication information may come from sources such as the patient's memory, from a prescription bottle,  or from a list of medications the patient, clinician or other party maintains. \n\nThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication.  A medication statement is often, if not always, less specific.  There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise.  As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains.  Medication administration is more formal and is not missing detailed information.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifiers associated with this Medication Statement that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A plan, proposal or order that is fulfilled in whole or in part by this event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A larger event of which this particular event is a component or step.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"MedicationStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code representing the patient or other source's judgment about the state of the medication used that this statement is about.  Generally, this will be active or completed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current state of the MedicationStatement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates where the medication is expected to be consumed or administered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"medicationCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"medicationReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person, animal or group who is/was taking the medication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The encounter or episode of care that establishes the context for this MedicationStatement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The interval of time during which it is being asserted that the patient is/was/will be taking the medication (or was not taking, when the MedicationStatement.taken element is No).</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"effectiveDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"effectivePeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:element name=\"dateAsserted\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when the medication statement was asserted by the information source.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"informationSource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person or organization that provided the information about the taking of this medication. Note: Use derivedFrom when a MedicationStatement is derived from other resources, e.g. Claim or MedicationRequest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"derivedFrom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Allows linking the MedicationStatement to the underlying MedicationRequest, or to other information that supports or is used to derive the MedicationStatement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reason for why the medication is being/was taken.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Condition or observation that supports why the medication is being/was taken.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides extra information about the medication statement that is not conveyed by the other attributes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dosage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Dosage\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how the medication is/was or should be taken by the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproduct.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicinalProduct\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProduct</sch:title>\n    <sch:rule context=\"f:MedicinalProduct\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:marketingStatus/f:dateRange\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:pharmaceuticalProduct\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:pharmaceuticalProduct/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:pharmaceuticalProduct/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:packagedMedicinalProduct\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:packagedMedicinalProduct/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:packagedMedicinalProduct/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:attachedDocument\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:attachedDocument/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:attachedDocument/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:masterFile\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:masterFile/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:masterFile/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:contact\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:contact/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:contact/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:clinicalTrial\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:clinicalTrial/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:clinicalTrial/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:crossReference/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:crossReference/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:authorisationReferenceNumber/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:authorisationReferenceNumber/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:regulator\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:regulator/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:manufacturingBusinessOperation/f:regulator/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:specialDesignation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:specialDesignation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:specialDesignation/f:indicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:specialDesignation/f:indicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProduct/f:specialDesignation/f:indicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproduct.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicinalProduct\" type=\"MedicinalProduct\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicinalProduct\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifier for this product. Could be an MPID.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Regulatory type, e.g. Investigational or Authorized.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"domain\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If this medicine applies to human or veterinary uses.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"combinedPharmaceuticalDoseForm\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The dose form for a single part product, or combined form of a multiple part product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"legalStatusOfSupply\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The legal status of supply of the medicinal product as classified by the regulator.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"additionalMonitoringIndicator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the Medicinal Product is subject to additional monitoring for regulatory reasons.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialMeasures\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the Medicinal Product is subject to special measures for regulatory reasons.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"paediatricUseIndicator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If authorised for use in children.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productClassification\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Allows the product to be classified by various systems.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"marketingStatus\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"MarketingStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Marketing status of the medicinal product, in contrast to marketing authorizaton.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"pharmaceuticalProduct\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Pharmaceutical aspects of product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"packagedMedicinalProduct\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Package representation for the product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"attachedDocument\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Supporting documentation, typically for regulatory submission.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"masterFile\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A master file for to the medicinal product (e.g. Pharmacovigilance System Master File).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A product specific contact, person (in a role), or an organization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"clinicalTrial\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Clinical trials or studies that this product is involved in.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" type=\"MedicinalProduct.Name\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The product's name, including full name and possibly coded parts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"crossReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to another product, e.g. for linking authorised to investigational product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manufacturingBusinessOperation\" type=\"MedicinalProduct.ManufacturingBusinessOperation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An operation applied to the product, for manufacturing or adminsitrative purpose.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialDesignation\" type=\"MedicinalProduct.SpecialDesignation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates if the medicinal product has an orphan designation for the treatment of a rare disease.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProduct.Name\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"productName\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The full product name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"namePart\" type=\"MedicinalProduct.NamePart\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Coding words or phrases of the name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"countryLanguage\" type=\"MedicinalProduct.CountryLanguage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Country where the name applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProduct.NamePart\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"part\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A fragment of a product name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Idenifying type for this part of the name (e.g. strength part).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProduct.CountryLanguage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"country\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Country code for where this name applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Jurisdiction code for where this name applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"language\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Language code for this name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProduct.ManufacturingBusinessOperation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"operationType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of manufacturing operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authorisationReferenceNumber\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Regulatory authorization reference number.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectiveDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Regulatory authorization date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"confidentialityIndicator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">To indicate if this proces is commercially confidential.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The manufacturer or establishment associated with the process.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"regulator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A regulator which oversees the operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProduct.SpecialDesignation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Detailed definition of a medicinal product, typically for uses other than direct patient care (e.g. regulatory use).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for the designation, or procedure number.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of special designation, e.g. orphan drug, minor use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intendedUse\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The intended use of the product, e.g. prevention, treatment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Condition for which the medicinal use applies.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"indicationCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"indicationReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">For example granted, pending, expired or withdrawn.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date when the designation was granted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"species\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Animal species for which this applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductauthorization.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicinalProductAuthorization\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductAuthorization</sch:title>\n    <sch:rule context=\"f:MedicinalProductAuthorization\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:validityPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:dataExclusivityPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:jurisdictionalAuthorization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:jurisdictionalAuthorization/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:jurisdictionalAuthorization/f:validityPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:holder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:holder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:holder/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:regulator\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:regulator/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductAuthorization/f:regulator/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductauthorization.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicinalProductAuthorization\" type=\"MedicinalProductAuthorization\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The regulatory authorization of a medicinal product.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicinalProductAuthorization\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The regulatory authorization of a medicinal product.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifier for the marketing authorization, as assigned by a regulator.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The medicinal product that is being authorized.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"country\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The country in which the marketing authorization has been granted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Jurisdiction within a country.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the marketing authorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date at which the given status has become applicable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"restoreDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when a suspended the marketing or the marketing authorization of the product is anticipated to be restored.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validityPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The beginning of the time period in which the marketing authorization is in the specific status shall be specified A complete date consisting of day, month and year shall be specified using the ISO 8601 date format.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dataExclusivityPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A period of time after authorization before generic product applicatiosn can be submitted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dateOfFirstAuthorization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when the first authorization was granted by a Medicines Regulatory Agency.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"internationalBirthDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date of first marketing authorization for a company's new medicinal product in any country in the World.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"legalBasis\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The legal framework against which this authorization is granted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdictionalAuthorization\" type=\"MedicinalProductAuthorization.JurisdictionalAuthorization\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Authorization in areas within a country.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"holder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Marketing Authorization Holder.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"regulator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Medicines Regulatory Agency.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"procedure\" type=\"MedicinalProductAuthorization.Procedure\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The regulatory procedure for granting or amending a marketing authorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductAuthorization.JurisdictionalAuthorization\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The regulatory authorization of a medicinal product.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The assigned number for the marketing authorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"country\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Country of authorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Jurisdiction within a country.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"legalStatusOfSupply\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The legal status of supply in a jurisdiction or region.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validityPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The start and expected end date of the authorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductAuthorization.Procedure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The regulatory authorization of a medicinal product.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for this procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date of procedure.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"datePeriod\" type=\"Period\"/>\n            <xs:element name=\"dateDateTime\" type=\"dateTime\"/>\n          </xs:choice>\n          <xs:element name=\"application\" type=\"MedicinalProductAuthorization.Procedure\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Applcations submitted to obtain a marketing authorization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductcontraindication.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicinalProductContraindication\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductContraindication</sch:title>\n    <sch:rule context=\"f:MedicinalProductContraindication\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:therapeuticIndication\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:therapeuticIndication/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:therapeuticIndication/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:otherTherapy/f:medicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:otherTherapy/f:medicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:otherTherapy/f:medicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:population/f:ageRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:population/f:ageRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductContraindication/f:population/f:ageRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductcontraindication.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicinalProductContraindication\" type=\"MedicinalProductContraindication\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicinalProductContraindication\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The medication for which this is an indication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"disease\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The disease, symptom or procedure for the contraindication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"diseaseStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the disease or symptom for the contraindication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comorbidity\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A comorbidity (concurrent condition) or coinfection.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"therapeuticIndication\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the use of the medicinal product in relation to other therapies as part of the indication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"otherTherapy\" type=\"MedicinalProductContraindication.OtherTherapy\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the use of the medicinal product in relation to other therapies described as part of the indication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"population\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Population\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The population group to which this applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductContraindication.OtherTherapy\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The clinical particulars - indications, contraindications etc. of a medicinal product, including for regulatory purposes.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"therapyRelationshipType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of relationship between the medicinal product indication or contraindication and another therapy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"medicationCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"medicationReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductindication.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicinalProductIndication\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductIndication</sch:title>\n    <sch:rule context=\"f:MedicinalProductIndication\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:duration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:otherTherapy/f:medicationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:otherTherapy/f:medicationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:otherTherapy/f:medicationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:undesirableEffect\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:undesirableEffect/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:undesirableEffect/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:population/f:ageRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:population/f:ageRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIndication/f:population/f:ageRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductindication.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicinalProductIndication\" type=\"MedicinalProductIndication\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indication for the Medicinal Product.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicinalProductIndication\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indication for the Medicinal Product.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The medication for which this is an indication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"diseaseSymptomProcedure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The disease, symptom or procedure that is the indication for treatment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"diseaseStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the disease or symptom for which the indication applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comorbidity\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comorbidity (concurrent condition) or co-infection as part of the indication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intendedEffect\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The intended effect, aim or strategy to be achieved by the indication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"duration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Timing or duration information as part of the indication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"otherTherapy\" type=\"MedicinalProductIndication.OtherTherapy\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the use of the medicinal product in relation to other therapies described as part of the indication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"undesirableEffect\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describe the undesirable effects of the medicinal product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"population\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Population\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The population group to which this applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductIndication.OtherTherapy\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indication for the Medicinal Product.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"therapyRelationshipType\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of relationship between the medicinal product indication or contraindication and another therapy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to a specific medication (active substance, medicinal product or class of products) as part of an indication or contraindication.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"medicationCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"medicationReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductingredient.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicinalProductIngredient\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductIngredient</sch:title>\n    <sch:rule context=\"f:MedicinalProductIngredient\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:presentation\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:presentation/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:presentation/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:presentationLowLimit\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:presentationLowLimit/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:presentationLowLimit/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:concentration\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:concentration/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:concentration/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:concentrationLowLimit\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:concentrationLowLimit/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:concentrationLowLimit/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:referenceStrength/f:strength\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:referenceStrength/f:strength/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:referenceStrength/f:strength/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:referenceStrength/f:strengthLowLimit\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:referenceStrength/f:strengthLowLimit/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductIngredient/f:specifiedSubstance/f:strength/f:referenceStrength/f:strengthLowLimit/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductingredient.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicinalProductIngredient\" type=\"MedicinalProductIngredient\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An ingredient of a manufactured item or pharmaceutical product.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicinalProductIngredient\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An ingredient of a manufactured item or pharmaceutical product.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier(s) of this Ingredient that are assigned by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"role\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Ingredient role e.g. Active ingredient, excipient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"allergenicIndicator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the ingredient is a known or suspected allergen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Manufacturer of this Ingredient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specifiedSubstance\" type=\"MedicinalProductIngredient.SpecifiedSubstance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A specified substance that comprises this ingredient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"substance\" type=\"MedicinalProductIngredient.Substance\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The ingredient substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductIngredient.SpecifiedSubstance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An ingredient of a manufactured item or pharmaceutical product.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specified substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"group\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The group of specified substance, e.g. group 1 to 4.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"confidentiality\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Confidentiality level of the specified substance as the ingredient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"strength\" type=\"MedicinalProductIngredient.Strength\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductIngredient.Strength\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An ingredient of a manufactured item or pharmaceutical product.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"presentation\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Ratio\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity of substance in the unit of presentation, or in the volume (or mass) of the single pharmaceutical product or manufactured item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"presentationLowLimit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A lower limit for the quantity of substance in the unit of presentation. For use when there is a range of strengths, this is the lower limit, with the presentation attribute becoming the upper limit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"concentration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The strength per unitary volume (or mass).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"concentrationLowLimit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A lower limit for the strength per unitary volume (or mass), for when there is a range. The concentration attribute then becomes the upper limit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"measurementPoint\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">For when strength is measured at a particular point or distance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"country\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The country or countries for which the strength range applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referenceStrength\" type=\"MedicinalProductIngredient.ReferenceStrength\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Strength expressed in terms of a reference substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductIngredient.ReferenceStrength\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An ingredient of a manufactured item or pharmaceutical product.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"substance\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Relevant reference substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"strength\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Ratio\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Strength expressed in terms of a reference substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"strengthLowLimit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Strength expressed in terms of a reference substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"measurementPoint\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">For when strength is measured at a particular point or distance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"country\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The country or countries for which the strength range applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductIngredient.Substance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An ingredient of a manufactured item or pharmaceutical product.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The ingredient substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"strength\" type=\"MedicinalProductIngredient.Strength\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductinteraction.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicinalProductInteraction\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductInteraction</sch:title>\n    <sch:rule context=\"f:MedicinalProductInteraction\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:interactant/f:itemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:interactant/f:itemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductInteraction/f:interactant/f:itemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductinteraction.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicinalProductInteraction\" type=\"MedicinalProductInteraction\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The interactions of the medicinal product with other medicinal products, or other forms of interactions.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicinalProductInteraction\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The interactions of the medicinal product with other medicinal products, or other forms of interactions.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The medication for which this is a described interaction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The interaction described.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"interactant\" type=\"MedicinalProductInteraction.Interactant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific medication, food or laboratory test that interacts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the interaction e.g. drug-drug interaction, drug-food interaction, drug-lab test interaction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effect\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The effect of the interaction, for example &quot;reduced gastric absorption of primary medication&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"incidence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The incidence of the interaction, e.g. theoretical, observed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"management\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Actions for managing the interaction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductInteraction.Interactant\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The interactions of the medicinal product with other medicinal products, or other forms of interactions.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific medication, food or laboratory test that interacts.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"itemReference\" type=\"Reference\"/>\n            <xs:element name=\"itemCodeableConcept\" type=\"CodeableConcept\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductmanufactured.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicinalProductManufactured\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductManufactured</sch:title>\n    <sch:rule context=\"f:MedicinalProductManufactured\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:ingredient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:ingredient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:ingredient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:height\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:width\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:depth\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:weight\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:nominalVolume\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:externalDiameter\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductManufactured/f:physicalCharacteristics/f:image\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductmanufactured.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicinalProductManufactured\" type=\"MedicinalProductManufactured\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The manufactured item as contained in the packaged medicinal product.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicinalProductManufactured\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The manufactured item as contained in the packaged medicinal product.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"manufacturedDoseForm\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Dose form as manufactured and before any transformation into the pharmaceutical product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitOfPresentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The “real world” units in which the quantity of the manufactured item is described.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity or &quot;count number&quot; of the manufactured item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Manufacturer of the item (Note that this should be named &quot;manufacturer&quot; but it currently causes technical issues).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"ingredient\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Ingredient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"physicalCharacteristics\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ProdCharacteristic\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Dimensions, color etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"otherCharacteristics\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Other codeable characteristics.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductpackaged.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicinalProductPackaged\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductPackaged</sch:title>\n    <sch:rule context=\"f:MedicinalProductPackaged\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:marketingStatus/f:dateRange\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:marketingAuthorization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:marketingAuthorization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:marketingAuthorization/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:manufacturer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:manufacturer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:manufacturer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:batchIdentifier/f:outerPackaging/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:batchIdentifier/f:outerPackaging/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:batchIdentifier/f:immediatePackaging/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPackaged/f:batchIdentifier/f:immediatePackaging/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductpackaged.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicinalProductPackaged\" type=\"MedicinalProductPackaged\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A medicinal product in a container or package.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicinalProductPackaged\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A medicinal product in a container or package.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique identifier.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The product with this is a pack for.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Textual description.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"legalStatusOfSupply\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The legal status of supply of the medicinal product as classified by the regulator.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"marketingStatus\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"MarketingStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Marketing information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"marketingAuthorization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Manufacturer of this Package Item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Manufacturer of this Package Item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"batchIdentifier\" type=\"MedicinalProductPackaged.BatchIdentifier\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Batch numbering.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"packageItem\" type=\"MedicinalProductPackaged.PackageItem\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A packaging item, as a contained for medicine, possibly with other packaging items within.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductPackaged.BatchIdentifier\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A medicinal product in a container or package.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"outerPackaging\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number appearing on the outer packaging of a specific batch.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"immediatePackaging\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A number appearing on the immediate packaging (and not the outer packaging).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductPackaged.PackageItem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A medicinal product in a container or package.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Including possibly Data Carrier Identifier.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The physical type of the container of the medicine.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity of this package in the medicinal product, at the current level of packaging. The outermost is always 1.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"material\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Material type of the package item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"alternateMaterial\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A possible alternate material for the packaging.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"device\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A device accompanying a medicinal product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manufacturedItem\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The manufactured item as contained in the packaged medicinal product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"packageItem\" type=\"MedicinalProductPackaged.PackageItem\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Allows containers within containers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"physicalCharacteristics\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ProdCharacteristic\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Dimensions, color etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"otherCharacteristics\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Other codeable characteristics.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"shelfLifeStorage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ProductShelfLife\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Shelf Life and storage information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manufacturer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Manufacturer of this Package Item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductpharmaceutical.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicinalProductPharmaceutical\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductPharmaceutical</sch:title>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:ingredient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:ingredient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:ingredient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:device\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:firstDose\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:maxSingleDose\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:maxDosePerDay\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:maxDosePerTreatmentPeriod\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:maxDosePerTreatmentPeriod/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:maxDosePerTreatmentPeriod/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:maxTreatmentPeriod\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductPharmaceutical/f:routeOfAdministration/f:targetSpecies/f:withdrawalPeriod/f:value\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductpharmaceutical.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicinalProductPharmaceutical\" type=\"MedicinalProductPharmaceutical\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A pharmaceutical product described in terms of its composition and dose form.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicinalProductPharmaceutical\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A pharmaceutical product described in terms of its composition and dose form.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An identifier for the pharmaceutical medicinal product.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"administrableDoseForm\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The administrable dose form, after necessary reconstitution.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitOfPresentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"ingredient\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Ingredient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"device\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Accompanying device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"characteristics\" type=\"MedicinalProductPharmaceutical.Characteristics\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Characteristics e.g. a products onset of action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"routeOfAdministration\" type=\"MedicinalProductPharmaceutical.RouteOfAdministration\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The path by which the pharmaceutical product is taken into or makes contact with the body.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductPharmaceutical.Characteristics\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A pharmaceutical product described in terms of its composition and dose form.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A coded characteristic.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of characteristic e.g. assigned or pending.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductPharmaceutical.RouteOfAdministration\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A pharmaceutical product described in terms of its composition and dose form.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Coded expression for the route.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"firstDose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The first dose (dose quantity) administered in humans can be specified, for a product under investigation, using a numerical value and its unit of measurement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maxSingleDose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum single dose that can be administered as per the protocol of a clinical trial can be specified using a numerical value and its unit of measurement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maxDosePerDay\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum dose per day (maximum dose quantity to be administered in any one 24-h period) that can be administered as per the protocol referenced in the clinical trial authorisation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maxDosePerTreatmentPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum dose per treatment period that can be administered as per the protocol referenced in the clinical trial authorisation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maxTreatmentPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum treatment period during which an Investigational Medicinal Product can be administered as per the protocol referenced in the clinical trial authorisation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"targetSpecies\" type=\"MedicinalProductPharmaceutical.TargetSpecies\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A species for which this route applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductPharmaceutical.TargetSpecies\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A pharmaceutical product described in terms of its composition and dose form.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Coded expression for the species.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"withdrawalPeriod\" type=\"MedicinalProductPharmaceutical.WithdrawalPeriod\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A species specific time during which consumption of animal product is not appropriate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MedicinalProductPharmaceutical.WithdrawalPeriod\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A pharmaceutical product described in terms of its composition and dose form.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"tissue\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Coded expression for the type of tissue for which the withdrawal period applues, e.g. meat, milk.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A value for the time.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInformation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Extra information about the withdrawal period.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductundesirableeffect.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MedicinalProductUndesirableEffect\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MedicinalProductUndesirableEffect</sch:title>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:population/f:ageRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:population/f:ageRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MedicinalProductUndesirableEffect/f:population/f:ageRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/medicinalproductundesirableeffect.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MedicinalProductUndesirableEffect\" type=\"MedicinalProductUndesirableEffect\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describe the undesirable effects of the medicinal product.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MedicinalProductUndesirableEffect\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describe the undesirable effects of the medicinal product.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The medication for which this is an indication.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"symptomConditionEffect\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The symptom, condition or undesirable effect.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"classification\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Classification of the effect.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"frequencyOfOccurrence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The frequency of occurrence of the effect.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"population\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Population\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The population group to which this applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/messagedefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MessageDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MessageDefinition</sch:title>\n    <sch:rule context=\"f:MessageDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageDefinition/f:focus\">\n      <sch:assert test=\"f:max/@value='*' or number(f:max/@value) &gt; 0\">md-1: Max must be postive int or *</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/messagedefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MessageDefinition\" type=\"MessageDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MessageDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this message definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the message definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"replaces\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A MessageDefinition that is superseded by this definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this message definition. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the message definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the message definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the message definition from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate message definition instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the message definition is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this message definition is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the message definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the message definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"base\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The MessageDefinition that is the basis for the contents of this resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parent\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies a protocol or workflow that this MessageDefinition represents a step in.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Event code or link to the EventDefinition.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"eventCoding\" type=\"Coding\"/>\n            <xs:element name=\"eventUri\" type=\"uri\"/>\n          </xs:choice>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"MessageSignificanceCategory\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The impact of the content of the message.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"focus\" type=\"MessageDefinition.Focus\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the resource (or resources) that are being addressed by the event.  For example, the Encounter for an admit message or two Account records for a merge.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"responseRequired\" minOccurs=\"0\" maxOccurs=\"1\" type=\"messageheaderResponseRequest\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Declare at a message definition level whether a response is required or only upon error or success, or never.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"allowedResponse\" type=\"MessageDefinition.AllowedResponse\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates what types of messages may be sent as an application-level response to this message.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"graph\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Canonical reference to a GraphDefinition. If a URL is provided, it is the canonical reference to a [[[GraphDefinition]]] that it controls what resources are to be added to the bundle when building the document. The GraphDefinition can also specify profiles that apply to the various resources.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MessageDefinition.Focus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of resource that must be the focus for this message.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A profile that reflects constraints for the focal resource (and potentially for related resources).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"min\" minOccurs=\"1\" maxOccurs=\"1\" type=\"unsignedInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"max\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MessageDefinition.AllowedResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"message\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the message definition that must be adhered to by this supported response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"situation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"MessageSignificanceCategory-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"consequence\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Consequence</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"currency\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Currency</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"notification\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Notification</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"MessageSignificanceCategory\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The impact of the content of a message.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"MessageSignificanceCategory-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"messageheaderResponseRequest-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"always\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Always</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Error/reject conditions only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"never\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Never</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-success\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Successful completion only</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"messageheaderResponseRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">HL7-defined table of codes which identify conditions under which acknowledgments are required to be returned in response to a message.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"messageheaderResponseRequest-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/messageheader.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MessageHeader\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MessageHeader</sch:title>\n    <sch:rule context=\"f:MessageHeader\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:destination/f:target\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:destination/f:target/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:destination/f:target/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:destination/f:receiver\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:destination/f:receiver/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:destination/f:receiver/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:sender\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:sender/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:sender/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:enterer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:enterer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:enterer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:source/f:contact\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:source/f:contact/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:responsible\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:responsible/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:responsible/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:response/f:details\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:response/f:details/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:response/f:details/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:focus\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:focus/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MessageHeader/f:focus/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/messageheader.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MessageHeader\" type=\"MessageHeader\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MessageHeader\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value &quot;http://terminology.hl7.org/CodeSystem/message-events&quot;.  Alternatively uri to the EventDefinition.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"eventCoding\" type=\"Coding\"/>\n            <xs:element name=\"eventUri\" type=\"uri\"/>\n          </xs:choice>\n          <xs:element name=\"destination\" type=\"MessageHeader.Destination\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The destination application which the message is intended for.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the sending system to allow the use of a trust relationship.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"enterer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person or device that performed the data entry leading to this message. When there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The logical author of the message - the person or device that decided the described event should happen. When there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" type=\"MessageHeader.Source\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The source application from which this message originated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"responsible\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Coded indication of the cause for the event - indicates  a reason for the occurrence of the event that is a focus of this message.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"response\" type=\"MessageHeader.Response\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the message that this message is a response to.  Only present if this message is a response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"focus\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual data of the message - a reference to the root/focus class of the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Permanent link to the MessageDefinition for this message.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MessageHeader.Destination\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-readable name for the target system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"target\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the target end system in situations where the initial message transmission is to an intermediary system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endpoint\" minOccurs=\"1\" maxOccurs=\"1\" type=\"url\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates where the message should be routed to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"receiver\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MessageHeader.Source\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-readable name for the source system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"software\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">May include configuration or other information useful in debugging.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Can convey versions of multiple systems in situations where a message passes through multiple hands.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An e-mail, phone, website or other contact point to use to resolve issues with message communications.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endpoint\" minOccurs=\"1\" maxOccurs=\"1\" type=\"url\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the routing target to send acknowledgements to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MessageHeader.Response\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The header for a message exchange that is either requesting or responding to an action.  The reference(s) that are the subject of the action as well as other information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The MessageHeader.id of the message to which this message is a response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ResponseType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"details\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Full details of any issues found in the message.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ResponseType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"ok\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">OK</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"transient-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Transient Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"fatal-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Fatal Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ResponseType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The kind of response to a message.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ResponseType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/molecularsequence.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource MolecularSequence\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>MolecularSequence</sch:title>\n    <sch:rule context=\"f:MolecularSequence\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(f:coordinateSystem[@value=0 and @value=1]) = 1\">msq-3: Only 0 and 1 are valid for coordinateSystem</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:specimen\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:specimen/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:specimen/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:device\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:performer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:referenceSeq\">\n      <sch:assert test=\"count(f:genomeBuild)+count(f:referenceSeqId)+count(f:referenceSeqPointer)+count(f:referenceSeqString)=1\">msq-6: Have and only have one of the following elements in referenceSeq : 1. genomeBuild ; 2 referenceSeqId; 3. referenceSeqPointer;  4. referenceSeqString;</sch:assert>\n      <sch:assert test=\"(exists(f:chromosome) and exists(f:genomeBuild)) or (not(exists(f:chromosome)) and not(exists(f:genomeBuild)))\">msq-5: GenomeBuild and chromosome must be both contained if either one of them is contained</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:referenceSeq/f:referenceSeqPointer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:referenceSeq/f:referenceSeqPointer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:referenceSeq/f:referenceSeqPointer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:variant/f:variantPointer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:variant/f:variantPointer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:variant/f:variantPointer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:quality/f:score\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:pointer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:pointer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:MolecularSequence/f:pointer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/molecularsequence.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"MolecularSequence\" type=\"MolecularSequence\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"MolecularSequence\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier for this particular sequence instance. This is a FHIR-defined id.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"sequenceType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Amino Acid Sequence/ DNA Sequence / RNA Sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"coordinateSystem\" minOccurs=\"1\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the sequence is numbered starting at 0 (0-based numbering or coordinates, inclusive start, exclusive end) or starting at 1 (1-based numbering, inclusive start and inclusive end).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient whose sequencing results are described by this resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specimen\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specimen used for sequencing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"device\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The method for sequencing, for example, chip information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization or lab that should be responsible for this result.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of copies of the sequence of interest. (RNASeq).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referenceSeq\" type=\"MolecularSequence.ReferenceSeq\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A sequence that is used as a reference to describe variants that are present in a sequence analyzed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"variant\" type=\"MolecularSequence.Variant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The definition of variant here originates from Sequence ontology ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). This element can represent amino acid or nucleic sequence change(including insertion,deletion,SNP,etc.)  It can represent some complex mutation or segment variation with the assist of CIGAR string.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"observedSeq\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Sequence that was observed. It is the result marked by referenceSeq along with variant records on referenceSeq. This shall start from referenceSeq.windowStart and end by referenceSeq.windowEnd.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quality\" type=\"MolecularSequence.Quality\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An experimental feature attribute that defines the quality of the feature in a quantitative way, such as a phred quality score ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686)).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"readCoverage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"repository\" type=\"MolecularSequence.Repository\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Configurations of the external repository. The repository shall store target's observedSeq or records related with target's observedSeq.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"pointer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Pointer to next atomic sequence which at most contains one variant.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"structureVariant\" type=\"MolecularSequence.StructureVariant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about chromosome structure variation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MolecularSequence.ReferenceSeq\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"chromosome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Structural unit composed of a nucleic acid molecule which controls its own replication through the interaction of specific proteins at one or more origins of replication ([SO:0000340](http://www.sequenceontology.org/browser/current_svn/term/SO:0000340)).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"genomeBuild\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'.  Version number must be included if a versioned release of a primary build was used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"orientation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"orientationType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A relative reference to a DNA strand based on gene orientation. The strand that contains the open reading frame of the gene is the &quot;sense&quot; strand, and the opposite complementary strand is the &quot;antisense&quot; strand.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referenceSeqId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference identifier of reference sequence submitted to NCBI. It must match the type in the MolecularSequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referenceSeqPointer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A pointer to another MolecularSequence entity as reference sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referenceSeqString\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A string like &quot;ACGT&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"strand\" minOccurs=\"0\" maxOccurs=\"1\" type=\"strandType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute reference to a strand. The Watson strand is the strand whose 5'-end is on the short arm of the chromosome, and the Crick strand as the one whose 5'-end is on the long arm.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"windowStart\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Start position of the window on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"windowEnd\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">End position of the window on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MolecularSequence.Variant\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Start position of the variant on the  reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">End position of the variant on the reference sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"observedAllele\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)).  Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed  sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referenceAllele\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An allele is one of a set of coexisting sequence variants of a gene ([SO:0001023](http://www.sequenceontology.org/browser/current_svn/term/SO:0001023)). Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence  type is DNA, it should be the sequence on the positive (+) strand. This will lay in the range between variant.start and variant.end.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cigar\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"variantPointer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A pointer to an Observation containing variant information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MolecularSequence.Quality\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"qualityType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">INDEL / SNP / Undefined variant.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"standardSequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Gold standard sequence used for comparing against.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Start position of the sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">End position of the sequence. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"score\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The score of an experimentally derived feature such as a p-value ([SO:0001685](http://www.sequenceontology.org/browser/current_svn/term/SO:0001685)).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Which method is used to get sequence quality.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"truthTP\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">True positives, from the perspective of the truth data, i.e. the number of sites in the Truth Call Set for which there are paths through the Query Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"queryTP\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">True positives, from the perspective of the query data, i.e. the number of sites in the Query Call Set for which there are paths through the Truth Call Set that are consistent with all of the alleles at this site, and for which there is an accurate genotype call for the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"truthFN\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">False negatives, i.e. the number of sites in the Truth Call Set for which there is no path through the Query Call Set that is consistent with all of the alleles at this site, or sites for which there is an inaccurate genotype call for the event. Sites with correct variant but incorrect genotype are counted here.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"queryFP\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">False positives, i.e. the number of sites in the Query Call Set for which there is no path through the Truth Call Set that is consistent with this site. Sites with correct variant but incorrect genotype are counted here.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"gtFP\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of false positives where the non-REF alleles in the Truth and Query Call Sets match (i.e. cases where the truth is 1/1 and the query is 0/1 or similar).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"precision\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">QUERY.TP / (QUERY.TP + QUERY.FP).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recall\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">TRUTH.TP / (TRUTH.TP + TRUTH.FN).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fScore\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Harmonic mean of Recall and Precision, computed as: 2 * precision * recall / (precision + recall).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"roc\" type=\"MolecularSequence.Roc\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Receiver Operator Characteristic (ROC) Curve  to give sensitivity/specificity tradeoff.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MolecularSequence.Roc\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"score\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Invidual data point representing the GQ (genotype quality) score threshold.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numTP\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of true positives if the GQ score threshold was set to &quot;score&quot; field value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numFP\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of false positives if the GQ score threshold was set to &quot;score&quot; field value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numFN\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of false negatives if the GQ score threshold was set to &quot;score&quot; field value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"precision\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Calculated precision if the GQ score threshold was set to &quot;score&quot; field value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sensitivity\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Calculated sensitivity if the GQ score threshold was set to &quot;score&quot; field value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fMeasure\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Calculated fScore if the GQ score threshold was set to &quot;score&quot; field value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MolecularSequence.Repository\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"repositoryType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Click and see / RESTful API / Need login to see / RESTful API with authentication / Other ways to see resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">URI of an external repository which contains further details about the genetics data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">URI of an external repository which contains further details about the genetics data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"datasetId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id of the variant in this external repository. The server will understand how to use this id to call for more info about datasets in external repository.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"variantsetId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id of the variantset in this external repository. The server will understand how to use this id to call for more info about variantsets in external repository.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"readsetId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id of the read in this external repository.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MolecularSequence.StructureVariant\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"variantType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about chromosome structure variation DNA change type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exact\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used to indicate if the outer and inner start-end values have the same meaning.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"length\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Length of the variant chromosome.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outer\" type=\"MolecularSequence.Outer\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Structural variant outer.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"inner\" type=\"MolecularSequence.Inner\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Structural variant inner.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MolecularSequence.Outer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Structural variant outer start. If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Structural variant outer end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"MolecularSequence.Inner\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Raw data describing a biological sequence.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Structural variant inner start. If the coordinate system is either 0-based or 1-based, then start position is inclusive.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Structural variant inner end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"strandType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"watson\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Watson strand of referenceSeq</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"crick\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Crick strand of referenceSeq</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"strandType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Type for strand.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"strandType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"orientationType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"sense\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Sense orientation of referenceSeq</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"antisense\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Antisense orientation of referenceSeq</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"orientationType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Type for orientation.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"orientationType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"repositoryType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"directlink\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Click and see</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"openapi\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">The URL is the RESTful or other kind of API that can access to the result.</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"login\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Result cannot be access unless an account is logged in</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"oauth\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Result need to be fetched with API and need LOGIN( or cookies are required when visiting the link of resource)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"other\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Some other complicated or particular way to get resource from URL.</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"repositoryType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Type for access of external URI.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"repositoryType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"qualityType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"indel\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">INDEL Comparison</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"snp\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SNP Comparison</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">UNKNOWN Comparison</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"qualityType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Type for quality report.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"qualityType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"sequenceType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"aa\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">AA Sequence</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"dna\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DNA Sequence</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"rna\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">RNA Sequence</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"sequenceType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Type if a sequence -- DNA, RNA, or amino acid sequence.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"sequenceType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/namingsystem.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource NamingSystem\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>NamingSystem</sch:title>\n    <sch:rule context=\"f:NamingSystem\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='root' and f:uniqueId/f:type/@value='uuid')\">nsd-1: Root systems cannot have uuid identifiers</sch:assert>\n      <sch:assert test=\"not(exists(for $type in distinct-values(f:uniqueId/f:type/@value) return if (count(f:uniqueId[f:type/@value=$type and f:preferred/@value=true()])&gt;1) then $type else ()))\">nsd-2: Can't have more than one preferred identifier for a type</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NamingSystem/f:uniqueId/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/namingsystem.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"NamingSystem\" type=\"NamingSystem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a &quot;System&quot; used within the Identifier and Coding data types.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"NamingSystem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a &quot;System&quot; used within the Identifier and Coding data types.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the naming system. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this naming system. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"NamingSystemType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the purpose for the naming system - what kinds of things does it make unique?</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the naming system was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the naming system changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the naming system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"responsible\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Categorizes a naming system for easier search by grouping related naming systems.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the naming system from a consumer's perspective. Details about what the namespace identifies including scope, granularity, version labeling, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate naming system instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the naming system is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"uniqueId\" type=\"NamingSystem.UniqueId\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how the system may be identified when referenced in electronic exchange.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"NamingSystem.UniqueId\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc.  Represents a &quot;System&quot; used within the Identifier and Coding data types.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"NamingSystemIdentifierType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the unique identifier scheme used for this particular identifier.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The string that should be sent over the wire to identify the code system or identifier system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preferred\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether this identifier is the &quot;preferred&quot; identifier of this type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Notes about the past or intended usage of this identifier.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the period of time over which this identifier is considered appropriate to refer to the naming system.  Outside of this window, the identifier might be non-deterministic.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"NamingSystemIdentifierType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"oid\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">OID</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"uuid\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">UUID</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"uri\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">URI</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"other\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Other</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"NamingSystemIdentifierType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Identifies the style of unique identifier used to identify a namespace.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"NamingSystemIdentifierType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"NamingSystemType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"codesystem\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Code System</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"identifier\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Identifier</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"root\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Root</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"NamingSystemType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Identifies the purpose of the naming system.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"NamingSystemType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/nutritionorder.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource NutritionOrder\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>NutritionOrder</sch:title>\n    <sch:rule context=\"f:NutritionOrder\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:orderer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:orderer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:orderer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:allergyIntolerance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:allergyIntolerance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:allergyIntolerance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:schedule/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:schedule/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:schedule/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:schedule/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:schedule/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:schedule/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:oralDiet/f:nutrient/f:amount\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:schedule/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:schedule/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:schedule/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:schedule/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:schedule/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:schedule/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:supplement/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:caloricDensity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:schedule/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:schedule/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:schedule/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:schedule/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:schedule/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:schedule/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:rateQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:rateRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:rateRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:administration/f:rateRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:enteralFormula/f:maxVolumeToDeliver\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:NutritionOrder/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/nutritionorder.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"NutritionOrder\" type=\"NutritionOrder\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"NutritionOrder\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this order by the order sender or by the order receiver.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this NutritionOrder.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this NutritionOrder.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiates\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to a protocol, guideline, orderset or other definition that is adhered to in whole or in part by this NutritionOrder.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The workflow status of the nutrition order/request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestIntent\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the level of authority/intentionality associated with the NutrionOrder and where the request fits into the workflow chain.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An encounter that provides additional information about the healthcare context in which this request is made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dateTime\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date and time that this nutrition order was requested.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"orderer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"allergyIntolerance\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A link to a record of allergies or intolerances  which should be included in the nutrition order.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"foodPreferenceModifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"excludeFoodModifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This modifier is used to convey Order-specific modifier about the type of oral food or oral fluids that should not be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or  Gluten-Free.  While it should not be necessary to repeat allergy or intolerance information captured in the referenced AllergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason.  This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"oralDiet\" type=\"NutritionOrder.OralDiet\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Diet given orally in contrast to enteral (tube) feeding.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supplement\" type=\"NutritionOrder.Supplement\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Oral nutritional products given in order to add further nutritional value to the patient's diet.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"enteralFormula\" type=\"NutritionOrder.EnteralFormula\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments made about the {{title}} by the requester, performer, subject or other participants.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"NutritionOrder.OralDiet\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"schedule\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Timing\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time period and frequency at which the diet should be given.  The diet should be given for the combination of all schedules if more than one schedule is present.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"nutrient\" type=\"NutritionOrder.Nutrient\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required for the oral diet.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"texture\" type=\"NutritionOrder.Texture\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Class that describes any texture modifications required for the patient to safely consume various types of solid foods.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fluidConsistencyType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Free text or additional instructions or information pertaining to the oral diet.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"NutritionOrder.Nutrient\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The nutrient that is being modified such as carbohydrate or sodium.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity of the specified nutrient to include in diet.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"NutritionOrder.Texture\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"foodType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The food type(s) (e.g. meats, all foods)  that the texture modification applies to.  This could be all foods types.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"NutritionOrder.Supplement\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"productName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The product or brand name of the nutritional supplement such as &quot;Acme Protein Shake&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"schedule\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Timing\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time period and frequency at which the supplement(s) should be given.  The supplement should be given for the combination of all schedules if more than one schedule is present.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount of the nutritional supplement to be given.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Free text or additional instructions or information pertaining to the oral supplement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"NutritionOrder.EnteralFormula\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"baseFormulaType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"baseFormulaProductName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The product or brand name of the enteral or infant formula product such as &quot;ACME Adult Standard Formula&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"additiveType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"additiveProductName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The product or brand name of the type of modular component to be added to the formula.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"caloricDensity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount of energy (calories) that the formula should provide per specified volume, typically per mL or fluid oz.  For example, an infant may require a formula that provides 24 calories per fluid ounce or an adult may require an enteral formula that provides 1.5 calorie/mL.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"routeofAdministration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The route or physiological path of administration into the patient's gastrointestinal  tract for purposes of providing the formula feeding, e.g. nasogastric tube.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"administration\" type=\"NutritionOrder.Administration\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Formula administration instructions as structured data.  This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding.  An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maxVolumeToDeliver\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"administrationInstruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Free text formula administration, feeding instructions or additional instructions or information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"NutritionOrder.Administration\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"schedule\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Timing\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time period and frequency at which the enteral formula should be delivered to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The volume of formula to provide to the patient per the specified administration schedule.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"rateQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"rateRatio\" type=\"Ratio\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/observation.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Observation\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Observation</sch:title>\n    <sch:rule context=\"f:Observation\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(f:*[starts-with(local-name(.), 'value')] and (for $coding in f:code/f:coding return f:component/f:code/f:coding[f:code/@value=$coding/f:code/@value] [f:system/@value=$coding/f:system/@value]))\">obs-7: If Observation.code is the same as an Observation.component.code then the value element associated with the code SHALL NOT be present</sch:assert>\n      <sch:assert test=\"not(exists(f:dataAbsentReason)) or (not(exists(*[starts-with(local-name(.), 'value')])))\">obs-6: dataAbsentReason SHALL only be present if Observation.value[x] is not present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:focus\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:focus/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:focus/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectiveTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectiveTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectiveTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectiveTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectiveTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:effectiveTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valueSampledData/f:origin\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:specimen\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:specimen/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:specimen/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:device\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:device/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:device/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:referenceRange\">\n      <sch:assert test=\"(exists(f:low) or exists(f:high)or exists(f:text))\">obs-3: Must have at least a low or a high or text</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:referenceRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:referenceRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:referenceRange/f:age\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:referenceRange/f:age/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:referenceRange/f:age/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:hasMember\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:hasMember/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:hasMember/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:derivedFrom\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:derivedFrom/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:derivedFrom/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valueSampledData/f:origin\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Observation/f:component/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/observation.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Observation\" type=\"Observation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Observation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this observation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A plan, proposal or order that is fulfilled in whole or in part by this event.  For example, a MedicationRequest may require a patient to have laboratory test performed before  it is dispensed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A larger event of which this particular Observation is a component or step.  For example,  an observation as part of a procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ObservationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the result value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that classifies the general type of observation being made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes what was observed. Sometimes this is called the observation &quot;name&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient, or group of patients, location, or device this observation is about and into whose record the observation is placed. If the actual focus of the observation is different from the subject (or a sample of, part, or region of the subject), the `focus` element or the `code` itself specifies the actual focus of the observation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"focus\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record.  The focus of an observation could also be an existing condition,  an intervention, the subject's diet,  another observation of the subject,  or a body structure such as tumor or implanted device.   An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The healthcare event  (e.g. a patient and healthcare provider interaction) during which this observation is made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the &quot;physiologically relevant time&quot;. This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"effectiveDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"effectivePeriod\" type=\"Period\"/>\n            <xs:element name=\"effectiveTiming\" type=\"Timing\"/>\n            <xs:element name=\"effectiveInstant\" type=\"instant\"/>\n          </xs:choice>\n          <xs:element name=\"issued\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who was responsible for asserting the observed value as &quot;true&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The information determined as a result of making the observation, if the information has a simple value.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\n            <xs:element name=\"valueRange\" type=\"Range\"/>\n            <xs:element name=\"valueRatio\" type=\"Ratio\"/>\n            <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\n            <xs:element name=\"valueTime\" type=\"time\"/>\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"valuePeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:element name=\"dataAbsentReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides a reason why the expected value in the element Observation.value[x] is missing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"interpretation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A categorical assessment of an observation value.  For example, high, low, normal.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments about the observation or the results.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the site on the subject's body where the observation was made (i.e. the target site).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the mechanism used to perform the observation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specimen\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specimen that was used when this observation was made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"device\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The device used to generate the observation data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referenceRange\" type=\"Observation.ReferenceRange\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Guidance on how to interpret the value by comparison to a normal or recommended range.  Multiple reference ranges are interpreted as an &quot;OR&quot;.   In other words, to represent two distinct target populations, two `referenceRange` elements would be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"hasMember\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"derivedFrom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"component\" type=\"Observation.Component\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Some observations have multiple component observations.  These component observations are expressed as separate code value pairs that share the same attributes.  Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Observation.ReferenceRange\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"low\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the low bound of the reference range.  The low bound of the reference range endpoint is inclusive of the value (e.g.  reference range is &gt;=5 - &lt;=9). If the low bound is omitted,  it is assumed to be meaningless (e.g. reference range is &lt;=2.3).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"high\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the high bound of the reference range.  The high bound of the reference range endpoint is inclusive of the value (e.g.  reference range is &gt;=5 - &lt;=9). If the high bound is omitted,  it is assumed to be meaningless (e.g. reference range is &gt;= 2.3).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"appliesTo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Codes to indicate the target population this reference range applies to.  For example, a reference range may be based on the normal population or a particular sex or race.  Multiple `appliesTo`  are interpreted as an &quot;AND&quot; of the target populations.  For example, to represent a target population of African American females, both a code of female and a code for African American would be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"age\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Range\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation.  An example would be a reference value of &quot;Negative&quot; or a list or table of &quot;normals&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Observation.Component\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Measurements and simple assertions made about a patient, device or other subject.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes what was observed. Sometimes this is called the observation &quot;code&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The information determined as a result of making the observation, if the information has a simple value.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\n            <xs:element name=\"valueRange\" type=\"Range\"/>\n            <xs:element name=\"valueRatio\" type=\"Ratio\"/>\n            <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\n            <xs:element name=\"valueTime\" type=\"time\"/>\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"valuePeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:element name=\"dataAbsentReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides a reason why the expected value in the element Observation.component.value[x] is missing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"interpretation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A categorical assessment of an observation value.  For example, high, low, normal.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referenceRange\" type=\"Observation.ReferenceRange\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Guidance on how to interpret the value by comparison to a normal or recommended range.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/observationdefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ObservationDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ObservationDefinition</sch:title>\n    <sch:rule context=\"f:ObservationDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:range\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:range/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:range/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:age\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:age/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:age/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:gestationalAge\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:gestationalAge/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:qualifiedInterval/f:gestationalAge/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:validCodedValueSet\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:validCodedValueSet/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:validCodedValueSet/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:normalCodedValueSet\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:normalCodedValueSet/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:normalCodedValueSet/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:abnormalCodedValueSet\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:abnormalCodedValueSet/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:abnormalCodedValueSet/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:criticalCodedValueSet\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:criticalCodedValueSet/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ObservationDefinition/f:criticalCodedValueSet/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/observationdefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ObservationDefinition\" type=\"ObservationDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ObservationDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that classifies the general type of observation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes what will be observed. Sometimes this is called the observation &quot;name&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this ObservationDefinition artifact.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"permittedDataType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ObservationDataType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The data types allowed for the value element of the instance observations conforming to this ObservationDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"multipleResultsAllowed\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Multiple results allowed for observations conforming to this ObservationDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The method or technique used to perform the observation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preferredReportName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The preferred name to be used when reporting the results of observations conforming to this ObservationDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantitativeDetails\" type=\"ObservationDefinition.QuantitativeDetails\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Characteristics for quantitative results of this observation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"qualifiedInterval\" type=\"ObservationDefinition.QualifiedInterval\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Multiple  ranges of results qualified by different contexts for ordinal or continuous observations conforming to this ObservationDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validCodedValueSet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The set of valid coded results for the observations  conforming to this ObservationDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"normalCodedValueSet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The set of normal coded results for the observations conforming to this ObservationDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"abnormalCodedValueSet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The set of abnormal coded results for the observation conforming to this ObservationDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"criticalCodedValueSet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The set of critical coded results for the observation conforming to this ObservationDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ObservationDefinition.QuantitativeDetails\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"customaryUnit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Customary unit used to report quantitative results of observations conforming to this ObservationDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">SI unit used to report quantitative results of observations conforming to this ObservationDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"conversionFactor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Factor for converting value expressed with SI unit to value expressed with customary unit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"decimalPrecision\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number of digits after decimal separator when the results of such observations are of type Quantity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ObservationDefinition.QualifiedInterval\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Set of definitional characteristics for a kind of observation or measurement produced or consumed by an orderable health care service.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ObservationRangeCategory\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The category of interval of values for continuous or ordinal observations conforming to this ObservationDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"range\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Range\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The low and high values determining the interval. There may be only one of the two.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Codes to indicate the health context the range applies to. For example, the normal or therapeutic range.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"appliesTo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Codes to indicate the target population this reference range applies to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"gender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AdministrativeGender\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Sex of the population the range applies to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"age\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Range\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"gestationalAge\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Range\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The gestational age to which this reference range is applicable, in the context of pregnancy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"condition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Text based condition for which the reference range is valid.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ObservationDataType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"Quantity\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Quantity</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"CodeableConcept\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">CodeableConcept</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"string\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">string</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"boolean\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">boolean</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"integer\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">integer</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Range\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Range</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Ratio\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Ratio</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"SampledData\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SampledData</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"time\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">time</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"dateTime\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">dateTime</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"Period\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Period</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ObservationDataType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Permitted data type for observation value.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ObservationDataType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ObservationRangeCategory-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"reference\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">reference range</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"critical\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">critical range</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"absolute\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">absolute range</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ObservationRangeCategory\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Codes identifying the category of observation range.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ObservationRangeCategory-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/operationdefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource OperationDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>OperationDefinition</sch:title>\n    <sch:rule context=\"f:OperationDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationDefinition//f:parameter\">\n      <sch:assert test=\"exists(f:type) or exists(f:part)\">opd-1: Either a type must be provided, or parts</sch:assert>\n      <sch:assert test=\"not(exists(f:searchType)) or (f:type/@value = 'string')\">opd-2: A search type can only be specified for parameters of type string</sch:assert>\n      <sch:assert test=\"not(exists(f:targetProfile)) or ((f:type/@value = 'Reference') or (f:type/@value = 'canonical'))\">opd-3: A targetProfile can only be specified for parameters of type Reference or Canonical</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/operationdefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"OperationDefinition\" type=\"OperationDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"OperationDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this operation definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this operation definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the operation definition is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the operation definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the operation definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the operation definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the operation definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this operation definition. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"OperationKind\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this is an operation or a named query.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this operation definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the operation definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the operation definition changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the operation definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the operation definition from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate operation definition instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the operation definition is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this operation definition is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"affectsState\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the operation affects state. Side effects such as producing audit trail entries do not count as 'affecting  state'.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name used to invoke the operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information about how to use this operation or named query.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"base\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates that this operation definition is a constraining profile on the base.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The types on which this operation can be executed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"system\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a specific resource id for the context).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instance\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether this operation can be invoked on a particular instance of one of the given types.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"inputProfile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional validation information for the in parameters - a single profile that covers all the parameters. The profile is a constraint on the parameters resource as a whole.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outputProfile\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional validation information for the out parameters - a single profile that covers all the parameters. The profile is a constraint on the parameters resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parameter\" type=\"OperationDefinition.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The parameters for the operation/query.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"overload\" type=\"OperationDefinition.Overload\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines an appropriate combination of parameters to use when invoking this operation, to help code generators when generating overloaded parameter sets for this operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"OperationDefinition.Parameter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of used to identify the parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"use\" minOccurs=\"1\" maxOccurs=\"1\" type=\"OperationParameterUse\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this is an input or an output parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"min\" minOccurs=\"1\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The minimum number of times this parameter SHALL appear in the request or response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"max\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum number of times this element is permitted to appear in the request or response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the meaning or use of this parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type for this parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"targetProfile\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used when the type is &quot;Reference&quot; or &quot;canonical&quot;, and identifies a profile structure or implementation Guide that applies to the target of the reference this parameter refers to. If any profiles are specified, then the content must conform to at least one of them. The URL can be a local reference - to a contained StructureDefinition, or a reference to another StructureDefinition or Implementation Guide by a canonical URL. When an implementation guide is specified, the target resource SHALL conform to at least one profile defined in the implementation guide.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"searchType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SearchParamType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"binding\" type=\"OperationDefinition.Binding\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Binds to a value set if this parameter is coded (code, Coding, CodeableConcept).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referencedFrom\" type=\"OperationDefinition.ReferencedFrom\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies other resource parameters within the operation invocation that are expected to resolve to this resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"part\" type=\"OperationDefinition.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The parts of a nested Parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"OperationDefinition.Binding\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"strength\" minOccurs=\"1\" maxOccurs=\"1\" type=\"BindingStrength\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"valueSet\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"OperationDefinition.ReferencedFrom\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"source\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the parameter or dot-separated path of parameter names pointing to the resource parameter that is expected to contain a reference to this resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sourceId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The id of the element in the referencing resource that is expected to resolve to this resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"OperationDefinition.Overload\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"parameterName\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name of parameter to include in overload.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments to go on overload.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"OperationParameterUse-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"in\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"out\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Out</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"OperationParameterUse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Whether an operation parameter is an input or an output parameter.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"OperationParameterUse-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"OperationKind-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"operation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Operation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"query\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Query</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"OperationKind\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Whether an operation is a normal operation or a query.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"OperationKind-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/operationoutcome.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource OperationOutcome\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>OperationOutcome</sch:title>\n    <sch:rule context=\"f:OperationOutcome\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OperationOutcome/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/operationoutcome.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"OperationOutcome\" type=\"OperationOutcome\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A collection of error, warning, or information messages that result from a system action.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"OperationOutcome\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A collection of error, warning, or information messages that result from a system action.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"issue\" type=\"OperationOutcome.Issue\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An error, warning, or information message that results from a system action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"OperationOutcome.Issue\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A collection of error, warning, or information messages that result from a system action.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"severity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"IssueSeverity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether the issue indicates a variation from successful processing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"IssueType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"details\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional details about the error. This may be a text description of the error or a system code that identifies the error.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"diagnostics\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional diagnostic information about the issue.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This element is deprecated because it is XML specific. It is replaced by issue.expression, which is format independent, and simpler to parse. \n\nFor resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child accessor that identifies one of the elements in the resource that caused this issue to be raised.  For HTTP errors, will be &quot;http.&quot; + the parameter name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A [simple subset of FHIRPath](fhirpath.html#simple) limited to element names, repetition indicators and the default child accessor that identifies one of the elements in the resource that caused this issue to be raised.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"IssueType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"invalid\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Invalid Content</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"structure\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Structural Issue</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"required\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Required element missing</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"value\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Element value invalid</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"invariant\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Validation rule failed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"security\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Security Problem</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"login\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Login Required</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown User</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"expired\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Session Expired</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"forbidden\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Forbidden</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"suppressed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Information  Suppressed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"processing\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Processing Failure</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"not-supported\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Content not supported</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"duplicate\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Duplicate</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"multiple-matches\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Multiple Matches</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"not-found\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not Found</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"deleted\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Deleted</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"too-long\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Content Too Long</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"code-invalid\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Invalid Code</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"extension\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unacceptable Extension</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"too-costly\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Operation Too Costly</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"business-rule\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Business Rule Violation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"conflict\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Edit Version Conflict</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"transient\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Transient Issue</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"lock-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Lock Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"no-store\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">No Store Available</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"exception\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Exception</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"timeout\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Timeout</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"incomplete\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Incomplete Results</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"throttled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Throttled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"informational\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Informational Note</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"IssueType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A code that describes the type of issue.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"IssueType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"IssueSeverity-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"fatal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Fatal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"warning\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Warning</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"information\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Information</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"IssueSeverity\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How the issue affects the success of the action.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"IssueSeverity-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/organization.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Organization\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Organization</sch:title>\n    <sch:rule context=\"f:Organization\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(f:identifier | f:name) &gt; 0\">org-1: The organization SHALL at least have a name or an identifier, and possibly more than one</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:telecom\">\n      <sch:assert test=\"count(f:use[@value='home']) = 0\">org-3: The telecom of an organization can never be of use 'home'</sch:assert>\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:address\">\n      <sch:assert test=\"count(f:use[@value='home']) = 0\">org-2: An address of an organization can never be of use 'home'</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:partOf/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:contact/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:contact/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Organization/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/organization.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Organization\" type=\"Organization\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Organization\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for the organization that is used to identify the organization across multiple disparate systems.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the organization's record is still in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind(s) of organization that this is.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name associated with the organization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"alias\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A list of alternate names that the organization is known as, or was known as in the past.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A contact detail for the organization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Address\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An address for the organization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization of which this organization forms a part.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" type=\"Organization.Contact\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact for the organization for a certain purpose.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Technical endpoints providing access to services operated for the organization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Organization.Contact\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action.  Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates a purpose for which the contact can be reached.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"HumanName\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name associated with the contact.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Address\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Visiting or postal addresses for the contact.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/organizationaffiliation.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource OrganizationAffiliation\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>OrganizationAffiliation</sch:title>\n    <sch:rule context=\"f:OrganizationAffiliation\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:organization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:organization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:participatingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:participatingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:participatingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:network\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:network/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:network/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:healthcareService\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:healthcareService/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:healthcareService/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:OrganizationAffiliation/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/organizationaffiliation.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"OrganizationAffiliation\" type=\"OrganizationAffiliation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines an affiliation/assotiation/relationship between 2 distinct oganizations, that is not a part-of relationship/sub-division relationship.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"OrganizationAffiliation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines an affiliation/assotiation/relationship between 2 distinct oganizations, that is not a part-of relationship/sub-division relationship.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers that are specific to this role.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this organization affiliation record is in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the participatingOrganization is affiliated with the primary organization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"organization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Organization where the role is available (primary organization/has members).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"participatingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Participating Organization provides/performs the role(s) defined by the code to the Primary Organization (e.g. providing services or is a member of).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"network\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Health insurance provider network in which the participatingOrganization provides the role's services (if defined) at the indicated locations (if defined).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Definition of the role the participatingOrganization plays in the association.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific specialty of the participatingOrganization in the context of the role.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The location(s) at which the role occurs.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"healthcareService\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Healthcare services provided through the role.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details at the participatingOrganization relevant to this Affiliation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Technical endpoints providing access to services operated for this role.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/parameters.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Parameters\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Parameters</sch:title>\n    <sch:rule context=\"f:Parameters//f:parameter\">\n      <sch:assert test=\"(exists(f:resource) or exists(f:part) or exists(f:*[starts-with(local-name(.), 'value')])) and not(exists(f:*[starts-with(local-name(.), 'value')])) and exists(f:resource))) and not(exists(f:*[starts-with(local-name(.), 'value')])) and exists(f:part))) and not(exists(f:part) and exists(f:resource))\">inv-1: A parameter must have one and only one of (value, resource, part)</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/parameters.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Parameters\" type=\"Parameters\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Parameters\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Resource\">\n        <xs:sequence>\n          <xs:element name=\"parameter\" type=\"Parameters.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A parameter passed to or received from the operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Parameters.Parameter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource is a non-persisted resource used to pass information into and back from an [operation](operations.html). It has no other use, and there is no RESTful endpoint associated with it.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the parameter (reference to the operation definition).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the parameter is a data type.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueCanonical\" type=\"canonical\"/>\n            <xs:element name=\"valueCode\" type=\"code\"/>\n            <xs:element name=\"valueDate\" type=\"date\"/>\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\n            <xs:element name=\"valueId\" type=\"id\"/>\n            <xs:element name=\"valueInstant\" type=\"instant\"/>\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\n            <xs:element name=\"valueMarkdown\" type=\"markdown\"/>\n            <xs:element name=\"valueOid\" type=\"oid\"/>\n            <xs:element name=\"valuePositiveInt\" type=\"positiveInt\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueTime\" type=\"time\"/>\n            <xs:element name=\"valueUnsignedInt\" type=\"unsignedInt\"/>\n            <xs:element name=\"valueUri\" type=\"uri\"/>\n            <xs:element name=\"valueUrl\" type=\"url\"/>\n            <xs:element name=\"valueUuid\" type=\"uuid\"/>\n            <xs:element name=\"valueAddress\" type=\"Address\"/>\n            <xs:element name=\"valueAge\" type=\"Age\"/>\n            <xs:element name=\"valueAnnotation\" type=\"Annotation\"/>\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\n            <xs:element name=\"valueContactPoint\" type=\"ContactPoint\"/>\n            <xs:element name=\"valueCount\" type=\"Count\"/>\n            <xs:element name=\"valueDistance\" type=\"Distance\"/>\n            <xs:element name=\"valueDuration\" type=\"Duration\"/>\n            <xs:element name=\"valueHumanName\" type=\"HumanName\"/>\n            <xs:element name=\"valueIdentifier\" type=\"Identifier\"/>\n            <xs:element name=\"valueMoney\" type=\"Money\"/>\n            <xs:element name=\"valuePeriod\" type=\"Period\"/>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueRange\" type=\"Range\"/>\n            <xs:element name=\"valueRatio\" type=\"Ratio\"/>\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\n            <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\n            <xs:element name=\"valueSignature\" type=\"Signature\"/>\n            <xs:element name=\"valueTiming\" type=\"Timing\"/>\n            <xs:element name=\"valueContactDetail\" type=\"ContactDetail\"/>\n            <xs:element name=\"valueContributor\" type=\"Contributor\"/>\n            <xs:element name=\"valueDataRequirement\" type=\"DataRequirement\"/>\n            <xs:element name=\"valueExpression\" type=\"Expression\"/>\n            <xs:element name=\"valueParameterDefinition\" type=\"ParameterDefinition\"/>\n            <xs:element name=\"valueRelatedArtifact\" type=\"RelatedArtifact\"/>\n            <xs:element name=\"valueTriggerDefinition\" type=\"TriggerDefinition\"/>\n            <xs:element name=\"valueUsageContext\" type=\"UsageContext\"/>\n            <xs:element name=\"valueDosage\" type=\"Dosage\"/>\n            <xs:element name=\"valueMeta\" type=\"Meta\"/>\n          </xs:choice>\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ResourceContainer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the parameter is a whole resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"part\" type=\"Parameters.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A named part of a multi-part parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/patient.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Patient\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Patient</sch:title>\n    <sch:rule context=\"f:Patient\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:photo\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact\">\n      <sch:assert test=\"exists(f:name) or exists(f:telecom) or exists(f:address) or exists(f:organization)\">pat-1: SHALL at least contain a contact's details or a reference to an organization</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:organization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:organization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:contact/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:generalPractitioner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:generalPractitioner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:generalPractitioner/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:managingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:managingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:managingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:link/f:other\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:link/f:other/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Patient/f:link/f:other/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/patient.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Patient\" type=\"Patient\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Patient\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An identifier for this patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this patient record is in active use. \nMany systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.\n\nIt is often used to filter patient lists to exclude inactive patients\n\nDeceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"HumanName\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name associated with the individual.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"gender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AdministrativeGender\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"birthDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date of birth for the individual.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates if the individual is deceased or not.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"deceasedBoolean\" type=\"boolean\"/>\n            <xs:element name=\"deceasedDateTime\" type=\"dateTime\"/>\n          </xs:choice>\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Address\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An address for the individual.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maritalStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This field contains a patient's most recent marital (civil) status.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"multipleBirthBoolean\" type=\"boolean\"/>\n            <xs:element name=\"multipleBirthInteger\" type=\"integer\"/>\n          </xs:choice>\n          <xs:element name=\"photo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Image of the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" type=\"Patient.Contact\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A contact party (e.g. guardian, partner, friend) for the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"communication\" type=\"Patient.Communication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A language which may be used to communicate with the patient about his or her health.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"generalPractitioner\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Patient's nominated care provider.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"managingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Organization that is the custodian of the patient record.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"link\" type=\"Patient.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Link to another patient resource that concerns the same actual patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Patient.Contact\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The nature of the relationship between the patient and the contact person.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"HumanName\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name associated with the contact person.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Address\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Address for the contact person.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"gender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AdministrativeGender\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"organization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Organization on behalf of which the contact is acting or for which the contact is working.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which this contact person or organization is valid to be contacted relating to this patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Patient.Communication\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"language\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. &quot;en&quot; for English, or &quot;en-US&quot; for American English versus &quot;en-EN&quot; for England English.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preferred\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Patient.Link\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Demographics and other administrative information about an individual or animal receiving care or other health-related services.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"other\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The other patient resource that the link refers to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"LinkType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of link between this patient resource and another patient resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"LinkType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"replaced-by\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Replaced-by</xs:documentation>\n          <xs:documentation xml:lang=\"nl\">Vervangen door</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"replaces\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Replaces</xs:documentation>\n          <xs:documentation xml:lang=\"nl\">Vervangt</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"refer\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Refer</xs:documentation>\n          <xs:documentation xml:lang=\"nl\">Verwijzing</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"seealso\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">See also</xs:documentation>\n          <xs:documentation xml:lang=\"nl\">Zie ook</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"LinkType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of link between this patient resource and another patient resource.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"LinkType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/paymentnotice.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource PaymentNotice\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>PaymentNotice</sch:title>\n    <sch:rule context=\"f:PaymentNotice\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:response\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:response/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:response/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:provider\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:provider/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:provider/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:payment\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:payment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:payment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:payee\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:payee/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:payee/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:recipient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:recipient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentNotice/f:recipient/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/paymentnotice.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"PaymentNotice\" type=\"PaymentNotice\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the status of the payment for goods and services rendered, and the request and response resource references.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"PaymentNotice\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the status of the payment for goods and services rendered, and the request and response resource references.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this payment notice.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference of resource for which payment is being made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"response\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference of response to resource for which payment is being made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when this resource was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"provider\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payment\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the payment which is the subject of this notice.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"paymentDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when the above payment action occurred.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payee\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party who will receive or has received payment that is the subject of this notification.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recipient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party who is notified of the payment status.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount sent to the payee.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"paymentStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code indicating whether payment has been sent or cleared.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/paymentreconciliation.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource PaymentReconciliation\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>PaymentReconciliation</sch:title>\n    <sch:rule context=\"f:PaymentReconciliation\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:paymentIssuer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:paymentIssuer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:paymentIssuer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:requestor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:requestor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:requestor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:paymentIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:paymentIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:predecessor/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:predecessor/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:submitter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:submitter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:submitter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:response\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:response/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:response/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:responsible\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:responsible/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:responsible/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:payee\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:payee/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PaymentReconciliation/f:detail/f:payee/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/paymentreconciliation.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"PaymentReconciliation\" type=\"PaymentReconciliation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the details including amount of a payment and allocates the payment items being paid.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"PaymentReconciliation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the details including amount of a payment and allocates the payment items being paid.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this payment reconciliation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period of time for which payments have been gathered into this bulk payment for settlement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when the resource was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"paymentIssuer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party who generated the payment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Original request resource reference.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requestor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The practitioner who is responsible for the services rendered to the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RemittanceOutcome\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The outcome of a request for a reconciliation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"disposition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human readable description of the status of the request for the reconciliation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"paymentDate\" minOccurs=\"1\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date of payment as indicated on the financial instrument.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"paymentAmount\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Total payment amount as indicated on the financial instrument.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"paymentIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Issuer's unique identifier for the payment instrument.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" type=\"PaymentReconciliation.Detail\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Distribution of the payment amount for a previously acknowledged payable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"formCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code for the form to be used for printing the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"processNote\" type=\"PaymentReconciliation.ProcessNote\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A note that describes or explains the processing in a human readable form.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"PaymentReconciliation.Detail\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the details including amount of a payment and allocates the payment items being paid.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique identifier for the current payment item for the referenced payable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"predecessor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique identifier for the prior payment item for the referenced payable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code to indicate the nature of the payment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A resource, such as a Claim, the evaluation of which could lead to payment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"submitter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party which submitted the claim or financial transaction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"response\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A resource, such as a ClaimResponse, which contains a commitment to payment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date from the response resource containing a commitment to pay.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"responsible\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the individual who is responsible for inquiries regarding the response and its payment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payee\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The party which is receiving the payment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Money\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The monetary amount allocated from the total payment to the payable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"PaymentReconciliation.ProcessNote\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource provides the details including amount of a payment and allocates the payment items being paid.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"NoteType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The business purpose of the note text.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The explanation or description associated with the processing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/person.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Person\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Person</sch:title>\n    <sch:rule context=\"f:Person\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:photo\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:managingOrganization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:managingOrganization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:managingOrganization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:link/f:target\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:link/f:target/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Person/f:link/f:target/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/person.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Person\" type=\"Person\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Demographics and administrative information about a person independent of a specific health-related context.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Person\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Demographics and administrative information about a person independent of a specific health-related context.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for a person within a particular scope.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"HumanName\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name associated with the person.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"gender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AdministrativeGender\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Administrative Gender.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"birthDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The birth date for the person.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Address\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">One or more addresses for the person.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"photo\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"managingOrganization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization that is the custodian of the person record.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this person's record is in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"link\" type=\"Person.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Link to a resource that concerns the same actual person.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Person.Link\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Demographics and administrative information about a person independent of a specific health-related context.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"target\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The resource to which this actual person is associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"assurance\" minOccurs=\"0\" maxOccurs=\"1\" type=\"IdentityAssuranceLevel\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Level of assurance that this link is associated with the target resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"IdentityAssuranceLevel-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"level1\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Level 1</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"level2\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Level 2</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"level3\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Level 3</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"level4\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Level 4</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"IdentityAssuranceLevel\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The level of confidence that this link represents the same actual person, based on NIST Authentication Levels.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"IdentityAssuranceLevel-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/plandefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource PlanDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>PlanDefinition</sch:title>\n    <sch:rule context=\"f:PlanDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:goal/f:documentation/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:goal/f:target/f:detailQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:goal/f:target/f:detailRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:goal/f:target/f:detailRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:goal/f:target/f:detailRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PlanDefinition/f:goal/f:target/f:due\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/plandefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"PlanDefinition\" type=\"PlanDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"PlanDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this plan definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this plan definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the plan definition is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this plan definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the plan definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the plan definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the plan definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the plan definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the plan definition giving additional information about its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A high-level category for the plan definition that distinguishes the kinds of systems that would be interested in the plan definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this plan definition. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this plan definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code or group definition that describes the intended subject of the plan definition.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the plan definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the plan definition changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the plan definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the plan definition from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate plan definition instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the plan definition is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this plan definition is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A detailed description of how the plan definition is used from a clinical perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the plan definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the plan definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the plan definition content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the plan definition. Topics provide a high-level categorization of the definition that can be useful for filtering and searching.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"library\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a Library resource containing any formal logic used by the plan definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"goal\" type=\"PlanDefinition.Goal\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Goals that describe what the activities within the plan are intended to achieve. For example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"action\" type=\"PlanDefinition.Action\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An action or group of actions to be taken as part of the plan.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"PlanDefinition.Goal\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates a category the goal falls within.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-readable and/or coded description of a specific desired objective of care, such as &quot;control blood pressure&quot; or &quot;negotiate an obstacle course&quot; or &quot;dance with child at wedding&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the expected level of importance associated with reaching/sustaining the defined goal.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"start\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The event after which the goal should begin being pursued.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"addresses\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies problems, conditions, issues, or concerns the goal is intended to address.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Didactic or other informational resources associated with the goal that provide further supporting information about the goal. Information resources can include inline text commentary and links to web resources.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"target\" type=\"PlanDefinition.Target\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates what should be done and within what timeframe.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"PlanDefinition.Target\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"measure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The parameter whose value is to be tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The target value of the measure to be achieved to signify fulfillment of the goal, e.g. 150 pounds or 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any value at or above the low value.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"detailQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"detailRange\" type=\"Range\"/>\n            <xs:element name=\"detailCodeableConcept\" type=\"CodeableConcept\"/>\n          </xs:choice>\n          <xs:element name=\"due\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the timeframe after the start of the goal in which the goal should be met.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"PlanDefinition.Action\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"prefix\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A user-visible prefix for the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The title of the action displayed to a user.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A brief description of the action used to provide a summary to display to the user.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"textEquivalent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that might not be capable of interpreting it dynamically.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the action should be addressed with respect to other actions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that provides meaning for the action or action group. For example, a section may have a LOINC code for the section of a documentation template.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of why this action is necessary or appropriate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"goalId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies goals that this action supports. The reference must be to a goal element defined within this plan definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code or group definition that describes the intended subject of the action and its children, if any.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"trigger\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"TriggerDefinition\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of when the action should be triggered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"condition\" type=\"PlanDefinition.Condition\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An expression that describes applicability criteria or start/stop conditions for the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"input\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DataRequirement\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines input data requirements for the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"output\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DataRequirement\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines the outputs of the action, if any.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedAction\" type=\"PlanDefinition.RelatedAction\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A relationship to another action such as &quot;before&quot; or &quot;30-60 minutes after start of&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An optional value describing when the action should be performed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"timingDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"timingAge\" type=\"Age\"/>\n            <xs:element name=\"timingPeriod\" type=\"Period\"/>\n            <xs:element name=\"timingDuration\" type=\"Duration\"/>\n            <xs:element name=\"timingRange\" type=\"Range\"/>\n            <xs:element name=\"timingTiming\" type=\"Timing\"/>\n          </xs:choice>\n          <xs:element name=\"participant\" type=\"PlanDefinition.Participant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates who should participate in performing the action described.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of action to perform (create, update, remove).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"groupingBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionGroupingBehavior\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines the grouping behavior for the action and its children.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"selectionBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionSelectionBehavior\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines the selection behavior for the action and its children.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requiredBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionRequiredBehavior\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines the required behavior for the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"precheckBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionPrecheckBehavior\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines whether the action should usually be preselected.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cardinalityBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionCardinalityBehavior\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines whether the action can be selected multiple times.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to an ActivityDefinition that describes the action to be taken in detail, or a PlanDefinition that describes a series of actions to be taken.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"definitionCanonical\" type=\"canonical\"/>\n            <xs:element name=\"definitionUri\" type=\"uri\"/>\n          </xs:choice>\n          <xs:element name=\"transform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a StructureMap resource that defines a transform that can be executed to produce the intent resource using the ActivityDefinition instance as the input.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dynamicValue\" type=\"PlanDefinition.DynamicValue\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"action\" type=\"PlanDefinition.Action\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"PlanDefinition.Condition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ActionConditionKind\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of condition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Expression\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An expression that returns true or false, indicating whether the condition is satisfied.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"PlanDefinition.RelatedAction\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"actionId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The element id of the related action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relationship\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ActionRelationshipType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The relationship of this action to the related action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"offsetDuration\" type=\"Duration\"/>\n            <xs:element name=\"offsetRange\" type=\"Range\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"PlanDefinition.Participant\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ActionParticipantType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of participant in the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The role the participant should play in performing the described action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"PlanDefinition.DynamicValue\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as clinical decision support rules, order sets and protocols.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"path\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. The specified path SHALL be a FHIRPath resolveable on the specified target type of the ActivityDefinition, and SHALL consist only of identifiers, constant indexers, and a restricted subset of functions. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements (see the [Simple FHIRPath Profile](fhirpath.html#simple) for full details).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Expression\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An expression specifying the value of the customized element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ActionRequiredBehavior-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"must\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Must</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"could\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Could</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"must-unless-documented\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Must Unless Documented</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ActionRequiredBehavior\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines expectations around whether an action or action group is required.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ActionRequiredBehavior-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ActionRelationshipType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"before-start\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Before Start</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"before\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Before</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"before-end\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Before End</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"concurrent-with-start\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Concurrent With Start</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"concurrent\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Concurrent</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"concurrent-with-end\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Concurrent With End</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"after-start\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">After Start</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"after\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">After</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"after-end\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">After End</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ActionRelationshipType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines the types of relationships between actions.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ActionRelationshipType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ActionGroupingBehavior-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"visual-group\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Visual Group</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"logical-group\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Logical Group</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"sentence-group\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Sentence Group</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ActionGroupingBehavior\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines organization behavior of a group.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ActionGroupingBehavior-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ActionSelectionBehavior-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"any\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Any</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"all\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">All</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"all-or-none\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">All Or None</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"exactly-one\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Exactly One</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"at-most-one\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">At Most One</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"one-or-more\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">One Or More</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ActionSelectionBehavior\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines selection behavior of a group.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ActionSelectionBehavior-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ActionCardinalityBehavior-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"single\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Single</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"multiple\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Multiple</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ActionCardinalityBehavior\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines behavior for an action or a group for how many times that item may be repeated.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ActionCardinalityBehavior-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ActionPrecheckBehavior-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"yes\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Yes</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"no\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">No</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ActionPrecheckBehavior\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines selection frequency behavior for an action or group.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ActionPrecheckBehavior-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ActionConditionKind-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"applicability\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Applicability</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"start\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Start</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"stop\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Stop</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ActionConditionKind\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines the kinds of conditions that can appear on actions.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ActionConditionKind-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/practitioner.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Practitioner\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Practitioner</sch:title>\n    <sch:rule context=\"f:Practitioner\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:photo\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:qualification/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:qualification/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:qualification/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:qualification/f:issuer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:qualification/f:issuer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Practitioner/f:qualification/f:issuer/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/practitioner.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!-- \r\n  Copyright (c) 2011+, HL7, Inc.\r\n  All rights reserved.\r\n  \r\n  Redistribution and use in source and binary forms, with or without modification, \r\n  are permitted provided that the following conditions are met:\r\n  \r\n   * Redistributions of source code must retain the above copyright notice, this \r\n     list of conditions and the following disclaimer.\r\n   * Redistributions in binary form must reproduce the above copyright notice, \r\n     this list of conditions and the following disclaimer in the documentation \r\n     and/or other materials provided with the distribution.\r\n   * Neither the name of HL7 nor the names of its contributors may be used to \r\n     endorse or promote products derived from this software without specific \r\n     prior written permission.\r\n  \r\n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \r\n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \r\n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \r\n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \r\n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \r\n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \r\n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \r\n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \r\n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \r\n  POSSIBILITY OF SUCH DAMAGE.\r\n  \r\n\r\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \r\n\r\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\r\n  valid. Implementers will still need to be familiar with the content of the specification and with\r\n  any profiles that apply to the resources in order to make a conformant implementation.\r\n\r\n-->\r\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\r\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\r\n  <xs:element name=\"Practitioner\" type=\"Practitioner\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A person who is directly or indirectly involved in the provisioning of healthcare.</xs:documentation>\r\n    </xs:annotation>\r\n  </xs:element>\r\n  <xs:complexType name=\"Practitioner\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A person who is directly or indirectly involved in the provisioning of healthcare.</xs:documentation>\r\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"DomainResource\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier that applies to this person in this role.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Whether this practitioner's record is in active use.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"HumanName\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The name(s) associated with the practitioner.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A contact detail for the practitioner, e.g. a telephone number or an email address.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Address\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Address(es) of the practitioner that are not role specific (typically home address). \rWork addresses are not typically entered in this property as they are usually role dependent.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"gender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AdministrativeGender\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"birthDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The date of birth for the practitioner.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"photo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Attachment\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Image of the person.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"qualification\" type=\"Practitioner.Qualification\" minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">The official certifications, training, and licenses that authorize or otherwise pertain to the provision of care by the practitioner.  For example, a medical license issued by a medical board authorizing the practitioner to practice medicine within a certian locality.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"communication\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">A language the practitioner can use in patient communication.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n  <xs:complexType name=\"Practitioner.Qualification\">\r\n    <xs:annotation>\r\n      <xs:documentation xml:lang=\"en\">A person who is directly or indirectly involved in the provisioning of healthcare.</xs:documentation>\r\n    </xs:annotation>\r\n    <xs:complexContent>\r\n      <xs:extension base=\"BackboneElement\">\r\n        <xs:sequence>\r\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">An identifier that applies to this person's qualification in this role.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Coded representation of the qualification.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Period during which the qualification is valid.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n          <xs:element name=\"issuer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\r\n            <xs:annotation>\r\n              <xs:documentation xml:lang=\"en\">Organization that regulates and issues the qualification.</xs:documentation>\r\n           </xs:annotation>\r\n          </xs:element>\r\n        </xs:sequence>\r\n      </xs:extension>\r\n    </xs:complexContent>\r\n  </xs:complexType>\r\n</xs:schema>\r\n"
  },
  {
    "path": "tests/static/xsd/fhir/practitionerrole.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource PractitionerRole\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>PractitionerRole</sch:title>\n    <sch:rule context=\"f:PractitionerRole\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:practitioner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:practitioner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:practitioner/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:organization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:organization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:healthcareService\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:healthcareService/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:healthcareService/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:notAvailable/f:during\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:endpoint\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:endpoint/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:PractitionerRole/f:endpoint/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/practitionerrole.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"PractitionerRole\" type=\"PractitionerRole\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"PractitionerRole\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business Identifiers that are specific to a role/location.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this practitioner role record is in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the person is authorized to act as a practitioner in these role(s) for the organization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"practitioner\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Practitioner that is able to provide the defined services for the organization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"organization\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization where the Practitioner performs the roles associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Roles which this practitioner is authorized to perform for the organization.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific specialty of the practitioner.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The location(s) at which this practitioner provides care.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"healthcareService\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The list of healthcare services that this worker provides for this role's Organization/Location(s).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details that are specific to the role/location/service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"availableTime\" type=\"PractitionerRole.AvailableTime\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A collection of times the practitioner is available or performing this role at the location and/or healthcareservice.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"notAvailable\" type=\"PractitionerRole.NotAvailable\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The practitioner is not available or performing this role during this period of time due to the provided reason.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"availabilityExceptions\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Technical endpoints providing access to services operated for the practitioner with this role.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"PractitionerRole.AvailableTime\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"daysOfWeek\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"DaysOfWeek\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates which days of the week are available between the start and end Times.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"allDay\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Is this always available? (hence times are irrelevant) e.g. 24 hour service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"availableStartTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"time\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The opening time of day. Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"availableEndTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"time\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The closing time of day. Note: If the AllDay flag is set, then this time is ignored.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"PractitionerRole.NotAvailable\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reason that can be presented to the user as to why this time is not available.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"during\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Service is not available (seasonally or for a public holiday) from this date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/procedure.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Procedure\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Procedure</sch:title>\n    <sch:rule context=\"f:Procedure\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performedAge\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org') and (not(f:value/@value) or f:value/@value &gt;=0)\">age-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.  If value is present, it SHALL be positive.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performedRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performedRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performedRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:recorder\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:recorder/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:recorder/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:asserter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:asserter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:asserter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performer/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performer/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performer/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performer/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performer/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:performer/f:onBehalfOf/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:report\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:report/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:report/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:complicationDetail\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:complicationDetail/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:complicationDetail/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:focalDevice/f:manipulated\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:focalDevice/f:manipulated/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:focalDevice/f:manipulated/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:usedReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:usedReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Procedure/f:usedReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/procedure.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Procedure\" type=\"Procedure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Procedure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this procedure by the performer or other systems which remain constant as the resource is updated and is propagated from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, order set or other definition that is adhered to in whole or in part by this Procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, order set or other definition that is adhered to in whole or in part by this Procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a resource that contains details of the request for this procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A larger event of which this particular procedure is a component or step.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"EventStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code specifying the state of the procedure. Generally, this will be the in-progress or completed state.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Captures the reason for the current state of the procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that classifies the procedure for searching, sorting and display purposes (e.g. &quot;Surgical Procedure&quot;).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. &quot;Laparoscopic Appendectomy&quot;).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person, animal or group on which the procedure was performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Encounter during which this Procedure was created or performed or to which the creation of this record is tightly associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Estimated or actual date, date-time, period, or age when the procedure was performed.  Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"performedDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"performedPeriod\" type=\"Period\"/>\n            <xs:element name=\"performedString\" type=\"string\"/>\n            <xs:element name=\"performedAge\" type=\"Age\"/>\n            <xs:element name=\"performedRange\" type=\"Range\"/>\n          </xs:choice>\n          <xs:element name=\"recorder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Individual who recorded the record and takes responsibility for its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"asserter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Individual who is making the procedure statement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" type=\"Procedure.Performer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Limited to &quot;real&quot; people rather than equipment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The location where the procedure actually happened.  E.g. a newborn at home, a tracheostomy at a restaurant.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The coded reason why the procedure was performed. This may be a coded entity of some type, or may simply be present as text.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The justification of why the procedure was performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The outcome of the procedure - did it resolve the reasons for the procedure being performed?</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"report\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This could be a histology result, pathology report, surgical report, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"complication\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"complicationDetail\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Any complications that occurred during the procedure, or in the immediate post-performance period.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"followUp\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the procedure required specific follow up - e.g. removal of sutures. The follow up may be represented as a simple note or could potentially be more complex, in which case the CarePlan resource can be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Any other notes and comments about the procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"focalDevice\" type=\"Procedure.FocalDevice\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"usedReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies medications, devices and any other substance used as part of the procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"usedCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies coded items that were used as part of the procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Procedure.Performer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"function\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Distinguishes the type of involvement of the performer in the procedure. For example, surgeon, anaesthetist, endoscopist.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The practitioner who was involved in the procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"onBehalfOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organization the device or practitioner was acting on behalf of.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Procedure.FocalDevice\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An action that is or was performed on or for a patient. This can be a physical intervention like an operation, or less invasive like long term services, counseling, or hypnotherapy.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"action\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of change that happened to the device during the procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"manipulated\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The device that was manipulated (changed) during the procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/provenance.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Provenance\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Provenance</sch:title>\n    <sch:rule context=\"f:Provenance\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:target\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:target/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:target/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:occurredPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:agent/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:agent/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:agent/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:agent/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:agent/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:agent/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:entity/f:what\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:entity/f:what/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:entity/f:what/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:signature/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:signature/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:signature/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:signature/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:signature/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Provenance/f:signature/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/provenance.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Provenance\" type=\"Provenance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Provenance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"target\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the activity occurred.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"occurredPeriod\" type=\"Period\"/>\n            <xs:element name=\"occurredDateTime\" type=\"dateTime\"/>\n          </xs:choice>\n          <xs:element name=\"recorded\" minOccurs=\"1\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The instant of time at which the activity was recorded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"policy\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where the activity occurred, if relevant.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reason\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reason that the activity was taking place.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"activity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"agent\" type=\"Provenance.Agent\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An actor taking a role in an activity  for which it can be assigned some degree of responsibility for the activity taking place.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"entity\" type=\"Provenance.Entity\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An entity used in this activity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"signature\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Signature\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Provenance.Agent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The participation the agent had with respect to the activity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The function of the agent with respect to the activity. The security role enabling the agent with respect to the activity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"who\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual, device or organization that participated in the event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"onBehalfOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual, device, or organization for whom the change was made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Provenance.Entity\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"role\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ProvenanceEntityRole\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the entity was used during the activity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"what\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identity of the  Entity used. May be a logical or physical uri and maybe absolute or relative.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"agent\" type=\"Provenance.Agent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ProvenanceEntityRole-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"derivation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Derivation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"revision\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Revision</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"quotation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Quotation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"source\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Source</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"removal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Removal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ProvenanceEntityRole\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How an entity was used in an activity.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ProvenanceEntityRole-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/questionnaire.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Questionnaire\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Questionnaire</sch:title>\n    <sch:rule context=\"f:Questionnaire\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"count(descendant::f:linkId/@value)=count(distinct-values(descendant::f:linkId/@value))\">que-2: The link ids for groups and questions must be unique within the questionnaire</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Questionnaire//f:item\">\n      <sch:assert test=\"not(f:type/@value=('group', 'display') and f:*[starts-with(local-name(.), 'initial')])\">que-9: Read-only can't be specified for &quot;display&quot; items</sch:assert>\n      <sch:assert test=\"not(f:type/@value=('group', 'display') and f:*[starts-with(local-name(.), 'initial')])\">que-8: Initial values can't be specified for groups or display items</sch:assert>\n      <sch:assert test=\"not(f:type/@value='display' and (f:required or f:repeats))\">que-6: Required and repeat aren't permitted for display items</sch:assert>\n      <sch:assert test=\"f:type/@value=('choice','open-choice','decimal','integer','date','dateTime','time','string','quantity',') or not(f:answerOption or f:answerValueSet)\">que-5: Only 'choice' and 'open-choice' items can have answerValueSet</sch:assert>\n      <sch:assert test=\"not(f:answerValueSet and f:answerOption)\">que-4: A question cannot have both answerOption and answerValueSet</sch:assert>\n      <sch:assert test=\"not(f:type/@value='display' and f:code)\">que-3: Display items cannot have a &quot;code&quot; asserted</sch:assert>\n      <sch:assert test=\"f:type/@value=('boolean', 'decimal', 'integer', 'open-choice', 'string', 'text', 'url') or not(f:maxLength)\">que-10: Maximum length can only be declared for simple question types</sch:assert>\n      <sch:assert test=\"not((f:type/@value='group' and not(f:item)) or (f:type/@value='display' and f:item))\">que-1: Group items must have nested items, display items cannot have nested items</sch:assert>\n      <sch:assert test=\"f:repeats/@value='true' or count(f:initial)&lt;=1\">que-13: Can only have multiple initial values for repeating items</sch:assert>\n      <sch:assert test=\"not(f:answerOption) or not(count(f:*[starts-with(local-name(.), 'initial')]))\">que-11: If one or more answerOption is present, initial[x] must be missing</sch:assert>\n      <sch:assert test=\"not(f:answerOption) or not(count(f:*[starts-with(local-name(.), 'initial')]))\">que-12: If there are more than one enableWhen, enableBehavior must be specified</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/questionnaire.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Questionnaire\" type=\"Questionnaire\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Questionnaire\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this questionnaire is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the questionnaire is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the questionnaire.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"derivedFrom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL of a Questionnaire that this Questionnaire is based on.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this questionnaire. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subjectType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The types of subjects that can be the subject of responses created for the questionnaire.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the questionnaire was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the questionnaire.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the questionnaire from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate questionnaire instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the questionnaire is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this questionnaire is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnaire.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the questionnaire content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An identifier for this question or group of questions in a particular terminology such as LOINC.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" type=\"Questionnaire.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A particular question, question grouping or display text that is part of the questionnaire.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Questionnaire.Item\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"linkId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This element is a URI that refers to an [[[ElementDefinition]]] that provides information about this item, including information that might otherwise be included in the instance of the Questionnaire resource. A detailed description of the construction of the URI is shown in Comments, below. If this element is present then the following element values MAY be derived from the Element Definition if the corresponding elements of this Questionnaire resource instance have no value:\n\n* code (ElementDefinition.code) \n* type (ElementDefinition.type) \n* required (ElementDefinition.min) \n* repeats (ElementDefinition.max) \n* maxLength (ElementDefinition.maxLength) \n* answerValueSet (ElementDefinition.binding)\n* options (ElementDefinition.binding).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"prefix\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaire.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of a section, the text of a question or text content for a display item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"QuestionnaireItemType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"enableWhen\" type=\"Questionnaire.EnableWhen\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"enableBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"EnableWhenBehavior\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Controls how multiple enableWhen values are interpreted -  whether all or any must be true.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"required\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An indication, if true, that the item must be present in a &quot;completed&quot; QuestionnaireResponse.  If false, the item may be skipped when answering the questionnaire.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"repeats\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An indication, if true, that the item may occur multiple times in the response, collecting multiple answers for questions or multiple sets of answers for groups.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"readOnly\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An indication, when true, that the value cannot be changed by a human respondent to the Questionnaire.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maxLength\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum number of characters that are permitted in the answer to be considered a &quot;valid&quot; QuestionnaireResponse.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"answerValueSet\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a value set containing a list of codes representing permitted answers for a &quot;choice&quot; or &quot;open-choice&quot; question.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"answerOption\" type=\"Questionnaire.AnswerOption\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">One of the permitted answers for a &quot;choice&quot; or &quot;open-choice&quot; question.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"initial\" type=\"Questionnaire.Initial\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user input.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" type=\"Questionnaire.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Text, questions and other groups to be nested beneath a question or group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Questionnaire.EnableWhen\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"question\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"operator\" minOccurs=\"1\" maxOccurs=\"1\" type=\"QuestionnaireItemOperator\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the criteria by which the question is enabled.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A value that the referenced question is tested using the specified operator in order for the item to be enabled.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"answerBoolean\" type=\"boolean\"/>\n            <xs:element name=\"answerDecimal\" type=\"decimal\"/>\n            <xs:element name=\"answerInteger\" type=\"integer\"/>\n            <xs:element name=\"answerDate\" type=\"date\"/>\n            <xs:element name=\"answerDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"answerTime\" type=\"time\"/>\n            <xs:element name=\"answerString\" type=\"string\"/>\n            <xs:element name=\"answerCoding\" type=\"Coding\"/>\n            <xs:element name=\"answerQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"answerReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Questionnaire.AnswerOption\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A potential answer that's allowed as the answer to this question.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\n            <xs:element name=\"valueDate\" type=\"date\"/>\n            <xs:element name=\"valueTime\" type=\"time\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"initialSelected\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether the answer value is selected when the list of possible answers is initially shown.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Questionnaire.Initial\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual value to for an initial answer.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\n            <xs:element name=\"valueDate\" type=\"date\"/>\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"valueTime\" type=\"time\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueUri\" type=\"uri\"/>\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"QuestionnaireItemType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"group\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Group</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"display\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Display</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"boolean\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Boolean</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"decimal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Decimal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"integer\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Integer</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"date\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Date</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"dateTime\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Date Time</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"time\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Time</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"string\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">String</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"text\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Text</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"url\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Url</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"choice\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Choice</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"open-choice\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Open Choice</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"attachment\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Attachment</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"reference\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Reference</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"quantity\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Quantity</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"QuestionnaireItemType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Distinguishes groups from questions and display text and indicates data type for questions.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"QuestionnaireItemType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"EnableWhenBehavior-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"all\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">All</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"any\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Any</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"EnableWhenBehavior\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Controls how multiple enableWhen values are interpreted -  whether all or any must be true.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"EnableWhenBehavior-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"QuestionnaireItemOperator-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"exists\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Exists</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"=\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Equals</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"!=\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not Equals</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"&gt;\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Greater Than</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"&lt;\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Less Than</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"&gt;=\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Greater or Equals</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"&lt;=\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Less or Equals</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"QuestionnaireItemOperator\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The criteria by which a question is enabled.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"QuestionnaireItemOperator-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/questionnaireresponse.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource QuestionnaireResponse\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>QuestionnaireResponse</sch:title>\n    <sch:rule context=\"f:QuestionnaireResponse\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:QuestionnaireResponse//f:item\">\n      <sch:assert test=\"not(exists(f:answer) and exists(f:item))\">qrs-1: Nested item can't be beneath both item and answer</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/questionnaireresponse.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"QuestionnaireResponse\" type=\"QuestionnaireResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"QuestionnaireResponse\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A business identifier assigned to a particular completed (or partially completed) questionnaire.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The order, proposal or plan that is fulfilled in whole or in part by this QuestionnaireResponse.  For example, a ServiceRequest seeking an intake assessment or a decision support recommendation to assess for post-partum depression.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A procedure or observation that this questionnaire was performed as part of the execution of.  For example, the surgery a checklist was executed as part of.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"questionnaire\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Questionnaire that defines and organizes the questions for which answers are being provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"QuestionnaireResponseStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The position of the questionnaire response within its overall lifecycle.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The subject of the questionnaire response.  This could be a patient, organization, practitioner, device, etc.  This is who/what the answers apply to, but is not necessarily the source of information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Encounter during which this questionnaire response was created or to which the creation of this record is tightly associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authored\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date and/or time that this set of answers were last changed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The person who answered the questions about the subject.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" type=\"QuestionnaireResponse.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A group or question item from the original questionnaire for which answers are provided.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"QuestionnaireResponse.Item\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"linkId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"definition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to an [[[ElementDefinition]]] that provides the details for the item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"text\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Text that is displayed above the contents of the group or as the text of the question being answered.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"answer\" type=\"QuestionnaireResponse.Answer\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The respondent's answer(s) to the question.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"item\" type=\"QuestionnaireResponse.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Questions or sub-groups nested beneath a question or group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"QuestionnaireResponse.Answer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the questionnaire being responded to.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The answer (or one of the answers) provided by the respondent to the question.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\n            <xs:element name=\"valueDate\" type=\"date\"/>\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"valueTime\" type=\"time\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueUri\" type=\"uri\"/>\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"item\" type=\"QuestionnaireResponse.Item\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Nested groups and/or questions found within this particular answer.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"QuestionnaireResponseStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"in-progress\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"amended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Amended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"stopped\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Stopped</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"QuestionnaireResponseStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Lifecycle status of the questionnaire response.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"QuestionnaireResponseStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/relatedperson.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource RelatedPerson\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>RelatedPerson</sch:title>\n    <sch:rule context=\"f:RelatedPerson\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:name/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:address/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:photo\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RelatedPerson/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/relatedperson.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"RelatedPerson\" type=\"RelatedPerson\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"RelatedPerson\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for a person within a particular scope.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this related person record is in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient this person is related to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The nature of the relationship between a patient and the related person.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"HumanName\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name associated with the person.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"telecom\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A contact detail for the person, e.g. a telephone number or an email address.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"gender\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AdministrativeGender\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"birthDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the related person was born.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"address\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Address\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Address where the related person can be contacted or visited.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"photo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Image of the person.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period of time during which this relationship is or was active. If there are no dates defined, then the interval is unknown.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"communication\" type=\"RelatedPerson.Communication\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A language which may be used to communicate with about the patient's health.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"RelatedPerson.Communication\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"language\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. &quot;en&quot; for English, or &quot;en-US&quot; for American English versus &quot;en-EN&quot; for England English.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preferred\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/requestgroup.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource RequestGroup\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>RequestGroup</sch:title>\n    <sch:rule context=\"f:RequestGroup\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:replaces\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:replaces/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:replaces/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:groupIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:groupIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:author\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:author/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:author/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RequestGroup//f:action\">\n      <sch:assert test=\"exists(f:resource) != exists(f:action)\">rqg-1: Must have resource or action but not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/requestgroup.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"RequestGroup\" type=\"RequestGroup\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A group of related requests that can be used to capture intended activities that have inter-dependencies such as &quot;give this medication after that one&quot;.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"RequestGroup\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A group of related requests that can be used to capture intended activities that have inter-dependencies such as &quot;give this medication after that one&quot;.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Allows a service to provide a unique, business identifier for the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A canonical URL referencing a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A URL referencing an externally defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A plan, proposal or order that is fulfilled in whole or in part by this request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"replaces\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Completed or terminated request(s) whose function is taken by this new request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"groupIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition, prescription or similar form.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The current state of the request. For request groups, the status reflects the status of all the requests in the group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestIntent\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the level of authority/intentionality associated with the request and where the request fits into the workflow chain.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the request should be addressed with respect to other requests.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that identifies what the overall request group is.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The subject for which the request group was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the context of the request group, if any.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates when the request group was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides a reference to the author of the request group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the reason for the request group in coded or textual form.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates another resource whose existence justifies this request group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Provides a mechanism to communicate additional information about the response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"action\" type=\"RequestGroup.Action\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actions, if any, produced by the evaluation of the artifact.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"RequestGroup.Action\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A group of related requests that can be used to capture intended activities that have inter-dependencies such as &quot;give this medication after that one&quot;.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"prefix\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A user-visible prefix for the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The title of the action displayed to a user.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short description of the action used to provide a summary to display to the user.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"textEquivalent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that might not be capable of interpreting it dynamically.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the action should be addressed with respect to other actions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that provides meaning for the action or action group. For example, a section may have a LOINC code for a section of a documentation template.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"condition\" type=\"RequestGroup.Condition\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An expression that describes applicability criteria, or start/stop conditions for the action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedAction\" type=\"RequestGroup.RelatedAction\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A relationship to another action such as &quot;before&quot; or &quot;30-60 minutes after start of&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An optional value describing when the action should be performed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"timingDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"timingAge\" type=\"Age\"/>\n            <xs:element name=\"timingPeriod\" type=\"Period\"/>\n            <xs:element name=\"timingDuration\" type=\"Duration\"/>\n            <xs:element name=\"timingRange\" type=\"Range\"/>\n            <xs:element name=\"timingTiming\" type=\"Timing\"/>\n          </xs:choice>\n          <xs:element name=\"participant\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The participant that should perform or be responsible for this action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of action to perform (create, update, remove).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"groupingBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionGroupingBehavior\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines the grouping behavior for the action and its children.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"selectionBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionSelectionBehavior\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines the selection behavior for the action and its children.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requiredBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionRequiredBehavior\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines expectations around whether an action is required.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"precheckBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionPrecheckBehavior\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines whether the action should usually be preselected.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cardinalityBehavior\" minOccurs=\"0\" maxOccurs=\"1\" type=\"ActionCardinalityBehavior\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines whether the action can be selected multiple times.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The resource that is the target of the action (e.g. CommunicationRequest).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"action\" type=\"RequestGroup.Action\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Sub actions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"RequestGroup.Condition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A group of related requests that can be used to capture intended activities that have inter-dependencies such as &quot;give this medication after that one&quot;.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ActionConditionKind\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of condition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Expression\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An expression that returns true or false, indicating whether or not the condition is satisfied.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"RequestGroup.RelatedAction\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A group of related requests that can be used to capture intended activities that have inter-dependencies such as &quot;give this medication after that one&quot;.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"actionId\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The element id of the action this is related to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relationship\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ActionRelationshipType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The relationship of this action to the related action.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"offsetDuration\" type=\"Duration\"/>\n            <xs:element name=\"offsetRange\" type=\"Range\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/researchdefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ResearchDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ResearchDefinition</sch:title>\n    <sch:rule context=\"f:ResearchDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:population\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:population/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:population/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:exposure\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:exposure/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:exposure/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:exposureAlternative\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:exposureAlternative/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:exposureAlternative/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:outcome\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:outcome/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchDefinition/f:outcome/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/researchdefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ResearchDefinition\" type=\"ResearchDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The ResearchDefinition resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ResearchDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The ResearchDefinition resource describes the conditional state (population and any exposures being compared within the population) and outcome (if specified) that the knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this research definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this research definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the research definition is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this research definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the research definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the research definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the research definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the research definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"shortTitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the ResearchDefinition giving additional information about its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this research definition. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this research definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The intended subjects for the ResearchDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchDefinition can be anything.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the research definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the research definition changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the research definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the research definition from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate research definition instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the research definition is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this research definition is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A detailed description, from a clinical perspective, of how the ResearchDefinition is used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the research definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the research definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the research definition content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the ResearchDefinition. Topics provide a high-level categorization grouping types of ResearchDefinitions that can be useful for filtering and searching.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"library\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a Library resource containing the formal logic used by the ResearchDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"population\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a ResearchElementDefinition resource that defines the population for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exposure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a ResearchElementDefinition resource that defines the exposure for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exposureAlternative\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a ResearchElementDefinition resource that defines the exposureAlternative for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a ResearchElementDefinition resomece that defines the outcome for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/researchelementdefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ResearchElementDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ResearchElementDefinition</sch:title>\n    <sch:rule context=\"f:ResearchElementDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionExpression\">\n      <sch:assert test=\"exists(f:expression) or exists(f:reference)\">exp-1: An expression or a reference must be provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:subjectReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:subjectReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:subjectReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:codeFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-1: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:dateFilter\">\n      <sch:assert test=\"(exists(f:path) and not(exists(f:searchParam))) or (not(exists(f:path)) and exists(f:searchParam))\">drq-2: Either a path or a searchParam must be provided, but not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:dateFilter/f:valuePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:definitionDataRequirement/f:dateFilter/f:valueDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:usageContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:studyEffectiveTimeFromStart\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchElementDefinition/f:characteristic/f:participantEffectiveTimeFromStart\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/researchelementdefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ResearchElementDefinition\" type=\"ResearchElementDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The ResearchElementDefinition resource describes a &quot;PICO&quot; element that knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ResearchElementDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The ResearchElementDefinition resource describes a &quot;PICO&quot; element that knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this research element definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this research element definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the research element definition is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this research element definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the research element definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the research element definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge assets, refer to the Decision Support Service specification. Note that a version is required for non-experimental active artifacts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the research element definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the research element definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"shortTitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The short title provides an alternate title for use in informal descriptive contexts where the full, formal title is not necessary.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtitle\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanatory or alternate title for the ResearchElementDefinition giving additional information about its content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this research element definition. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this research element definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The intended subjects for the ResearchElementDefinition. If this element is not provided, a Patient subject is assumed, but the subject of the ResearchElementDefinition can be anything.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"subjectCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"subjectReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the research element definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the research element definition changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the research element definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the research element definition from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate research element definition instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the research element definition is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this research element definition is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"usage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A detailed description, from a clinical perspective, of how the ResearchElementDefinition is used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the research element definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the research element definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the research element definition content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the ResearchElementDefinition. Topics provide a high-level categorization grouping types of ResearchElementDefinitions that can be useful for filtering and searching.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"library\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a Library resource containing the formal logic used by the ResearchElementDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ResearchElementType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of research element, a population, an exposure, or an outcome.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"variableType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"VariableType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the outcome (e.g. Dichotomous, Continuous, or Descriptive).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"characteristic\" type=\"ResearchElementDefinition.Characteristic\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A characteristic that defines the members of the research element. Multiple characteristics are applied with &quot;and&quot; semantics.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ResearchElementDefinition.Characteristic\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The ResearchElementDefinition resource describes a &quot;PICO&quot; element that knowledge (evidence, assertion, recommendation) is about.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Define members of the research element using Codes (such as condition, medication, or observation), Expressions ( using an expression language such as FHIRPath or CQL) or DataRequirements (such as Diabetes diagnosis onset in the last year).</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"definitionCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"definitionCanonical\" type=\"canonical\"/>\n            <xs:element name=\"definitionExpression\" type=\"Expression\"/>\n            <xs:element name=\"definitionDataRequirement\" type=\"DataRequirement\"/>\n          </xs:choice>\n          <xs:element name=\"usageContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Use UsageContext to define the members of the population, such as Age Ranges, Genders, Settings.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exclude\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When true, members with this characteristic are excluded from the element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitOfMeasure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the UCUM unit for the outcome.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"studyEffectiveDescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A narrative description of the time period the study covers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates what effective period the study covers.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"studyEffectiveDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"studyEffectivePeriod\" type=\"Period\"/>\n            <xs:element name=\"studyEffectiveDuration\" type=\"Duration\"/>\n            <xs:element name=\"studyEffectiveTiming\" type=\"Timing\"/>\n          </xs:choice>\n          <xs:element name=\"studyEffectiveTimeFromStart\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates duration from the study initiation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"studyEffectiveGroupMeasure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"GroupMeasure\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how elements are aggregated within the study effective period.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"participantEffectiveDescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A narrative description of the time period the study covers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates what effective period the study covers.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"participantEffectiveDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"participantEffectivePeriod\" type=\"Period\"/>\n            <xs:element name=\"participantEffectiveDuration\" type=\"Duration\"/>\n            <xs:element name=\"participantEffectiveTiming\" type=\"Timing\"/>\n          </xs:choice>\n          <xs:element name=\"participantEffectiveTimeFromStart\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates duration from the participant's study entry.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"participantEffectiveGroupMeasure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"GroupMeasure\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how elements are aggregated within the study effective period.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ResearchElementType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"population\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Population</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"exposure\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Exposure</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"outcome\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Outcome</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ResearchElementType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The possible types of research elements (E.g. Population, Exposure, Outcome).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ResearchElementType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"VariableType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"dichotomous\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Dichotomous</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"continuous\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Continuous</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"descriptive\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Descriptive</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"VariableType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The possible types of variables for exposures or outcomes (E.g. Dichotomous, Continuous, Descriptive).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"VariableType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/researchstudy.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ResearchStudy\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ResearchStudy</sch:title>\n    <sch:rule context=\"f:ResearchStudy\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:protocol\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:protocol/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:protocol/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:enrollment\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:enrollment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:enrollment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:sponsor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:sponsor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:sponsor/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:principalInvestigator\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:principalInvestigator/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:principalInvestigator/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:site\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:site/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:site/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchStudy/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/researchstudy.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ResearchStudy\" type=\"ResearchStudy\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ResearchStudy\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this research study by the sponsor or other systems.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive user-friendly label for the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"protocol\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The set of steps expected to be performed as part of the execution of the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A larger research study of which this particular study is a component or step.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ResearchStudyStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The current state of the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"primaryPurposeType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of study based upon the intent of the study's activities. A classification of the intent of the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"phase\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The stage in the progression of a therapy from initial experimental use in humans in clinical trials to post-market evaluation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Codes categorizing the type of study such as investigational vs. observational, type of blinding, type of randomization, safety vs. efficacy, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"focus\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The medication(s), food(s), therapy(ies), device(s) or other concerns or interventions that the study is seeking to gain more information about.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"condition\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The condition that is the focus of the study.  For example, In a study to examine risk factors for Lupus, might have as an inclusion criterion &quot;healthy volunteer&quot;, but the target condition code would be a Lupus SNOMED code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in learning more about or engaging with the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Citations, references and other related documents.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"keyword\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Key terms to aid in searching for or filtering the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates a country, state or other region where the study is taking place.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A full description of how the study is being conducted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"enrollment\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to a Group that defines the criteria for and quantity of subjects participating in the study.  E.g. &quot; 200 female Europeans between the ages of 20 and 45 with early onset diabetes&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the start date and the expected (or actual, depending on status) end date for the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sponsor\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An organization that initiates the investigation and is legally responsible for the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"principalInvestigator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A researcher in a study who oversees multiple aspects of the study, such as concept development, protocol writing, protocol submission for IRB approval, participant recruitment, informed consent, data collection, analysis, interpretation and presentation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"site\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A facility in which study activities are conducted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonStopped\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description and/or code explaining the premature termination of the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments made about the study by the performer, subject or other participants.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"arm\" type=\"ResearchStudy.Arm\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes an expected sequence of events for one of the participants of a study.  E.g. Exposure to drug A, wash-out, exposure to drug B, wash-out, follow-up.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"objective\" type=\"ResearchStudy.Objective\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A goal that the study is aiming to achieve in terms of a scientific question to be answered by the analysis of data collected during the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ResearchStudy.Arm\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique, human-readable label for this arm of the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Categorization of study arm, e.g. experimental, active comparator, placebo comparater.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A succinct description of the path through the study that would be followed by a subject adhering to this arm.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ResearchStudy.Objective\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A process where a researcher or organization plans and then executes a series of steps intended to increase the field of healthcare-related knowledge.  This includes studies of safety, efficacy, comparative effectiveness and other information about medications, devices, therapies and other interventional and investigative techniques.  A ResearchStudy involves the gathering of information about human or animal subjects.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique, human-readable label for this objective of the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of study objective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ResearchStudyStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"administratively-completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Administratively Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"approved\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Approved</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"closed-to-accrual\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Closed to Accrual</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"closed-to-accrual-and-intervention\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Closed to Accrual and Intervention</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"disapproved\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Disapproved</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"in-review\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In Review</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"temporarily-closed-to-accrual\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Temporarily Closed to Accrual</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"temporarily-closed-to-accrual-and-intervention\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Temporarily Closed to Accrual and Intervention</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"withdrawn\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Withdrawn</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ResearchStudyStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Codes that convey the current status of the research study.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ResearchStudyStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/researchsubject.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ResearchSubject\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ResearchSubject</sch:title>\n    <sch:rule context=\"f:ResearchSubject\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:study\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:study/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:study/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:individual\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:individual/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:individual/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:consent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:consent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ResearchSubject/f:consent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/researchsubject.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ResearchSubject\" type=\"ResearchSubject\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A physical entity which is the primary unit of operational and/or administrative interest in a study.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ResearchSubject\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A physical entity which is the primary unit of operational and/or administrative interest in a study.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this research subject for a study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ResearchSubjectStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The current state of the subject.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The dates the subject began and ended their participation in the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"study\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the study the subject is participating in.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"individual\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The record of the person or animal who is involved in the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"assignedArm\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the arm in the study the subject is expected to follow as part of this study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actualArm\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the arm in the study the subject actually followed as part of this study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"consent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A record of the patient's informed agreement to participate in the study.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ResearchSubjectStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"candidate\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Candidate</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"eligible\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Eligible</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"follow-up\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Follow-up</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ineligible\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Ineligible</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"not-registered\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not Registered</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"off-study\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Off-study</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-study\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On-study</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-study-intervention\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On-study-intervention</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-study-observation\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On-study-observation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"pending-on-study\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Pending on-study</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"potential-candidate\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Potential Candidate</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"screening\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Screening</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"withdrawn\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Withdrawn</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ResearchSubjectStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Indicates the progression of a study subject through a study.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ResearchSubjectStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/riskassessment.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource RiskAssessment\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>RiskAssessment</sch:title>\n    <sch:rule context=\"f:RiskAssessment\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:parent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:parent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:parent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:condition\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:condition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:condition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:basis\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:basis/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:basis/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction\">\n      <sch:assert test=\"not(f:probabilityDecimal) or f:probabilityDecimal/@value &lt;= 100\">ras-2: Must be &lt;= 100</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:probabilityRange\">\n      <sch:assert test=\"(not(f:low) or f:low[f:code/@value='%' and f:system/@value='http://unitsofmeasure.org']) and (not(f:high) or f:high[f:code/@value='%' and f:system/@value='http://unitsofmeasure.org'])\">ras-1: low and high must be percentages, if present</sch:assert>\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:probabilityRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:probabilityRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:whenPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:whenRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:whenRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:prediction/f:whenRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskAssessment/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/riskassessment.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"RiskAssessment\" type=\"RiskAssessment\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"RiskAssessment\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifier assigned to the risk assessment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the request that is fulfilled by this risk assessment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parent\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a resource that this risk assessment is part of, such as a Procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ObservationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the RiskAssessment, using the same statuses as an Observation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The algorithm, process or mechanism used to evaluate the risk.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the risk assessment performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The patient or group the risk assessment applies to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The encounter where the assessment was performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date (and possibly time) the risk assessment was performed.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:element name=\"condition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">For assessments or prognosis specific to a particular condition, indicates the condition being assessed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The provider or software application that performed the assessment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reason the risk assessment was performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Resources supporting the reason the risk assessment was performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basis\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the source data considered as part of the assessment (for example, FamilyHistory, Observations, Procedures, Conditions, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"prediction\" type=\"RiskAssessment.Prediction\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Describes the expected outcome for the subject.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"mitigation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the steps that might be taken to reduce the identified risk(s).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional comments about the risk assessment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"RiskAssessment.Prediction\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"outcome\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">One of the potential outcomes for the patient (e.g. remission, death,  a particular condition).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how likely the outcome is (in the specified timeframe).</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"probabilityDecimal\" type=\"decimal\"/>\n            <xs:element name=\"probabilityRange\" type=\"Range\"/>\n          </xs:choice>\n          <xs:element name=\"qualitativeRisk\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how likely the outcome is (in the specified timeframe), expressed as a qualitative value (e.g. low, medium, or high).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relativeRisk\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general.  (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the period of time or age range of the subject to which the specified probability applies.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"whenPeriod\" type=\"Period\"/>\n            <xs:element name=\"whenRange\" type=\"Range\"/>\n          </xs:choice>\n          <xs:element name=\"rationale\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information explaining the basis for the prediction.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/riskevidencesynthesis.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource RiskEvidenceSynthesis\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>RiskEvidenceSynthesis</sch:title>\n    <sch:rule context=\"f:RiskEvidenceSynthesis\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:effectivePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:author/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:author/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:editor/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:editor/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:reviewer/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:reviewer/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:endorser/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:endorser/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:relatedArtifact/f:document\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:population\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:population/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:population/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:exposure\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:exposure/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:exposure/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:outcome\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:outcome/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:outcome/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:certainty/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:certainty/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:certainty/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:certainty/f:certaintySubcomponent/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:certainty/f:certaintySubcomponent/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:RiskEvidenceSynthesis/f:certainty/f:certaintySubcomponent/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/riskevidencesynthesis.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"RiskEvidenceSynthesis\" type=\"RiskEvidenceSynthesis\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"RiskEvidenceSynthesis\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this risk evidence synthesis when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this risk evidence synthesis is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the risk evidence synthesis is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this risk evidence synthesis when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the risk evidence synthesis when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the risk evidence synthesis author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the risk evidence synthesis. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the risk evidence synthesis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this risk evidence synthesis. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the risk evidence synthesis was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the risk evidence synthesis changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the risk evidence synthesis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the risk evidence synthesis from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate risk evidence synthesis instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the risk evidence synthesis is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the risk evidence synthesis and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the risk evidence synthesis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"approvalDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastReviewDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval date.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"effectivePeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period during which the risk evidence synthesis content was or is planned to be in active use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"topic\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive topics related to the content of the RiskEvidenceSynthesis. Topics provide a high-level categorization grouping types of EffectEvidenceSynthesiss that can be useful for filtering and searching.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individiual or organization primarily involved in the creation and maintenance of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"editor\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for internal coherence of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reviewer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization primarily responsible for review of some aspect of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endorser\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An individual or organization responsible for officially endorsing the content for use in some setting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relatedArtifact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"RelatedArtifact\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Related artifacts such as additional documentation, justification, or bibliographic references.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"synthesisType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of synthesis eg meta-analysis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"studyType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of study eg randomized trial.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"population\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the population for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exposure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resource that defines the exposure for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"outcome\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a EvidenceVariable resomece that defines the outcome for the research.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sampleSize\" type=\"RiskEvidenceSynthesis.SampleSize\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the size of the sample involved in the synthesis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"riskEstimate\" type=\"RiskEvidenceSynthesis.RiskEstimate\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The estimated risk of the outcome.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"certainty\" type=\"RiskEvidenceSynthesis.Certainty\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the certainty of the risk estimate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"RiskEvidenceSynthesis.SampleSize\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-readable summary of sample size.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numberOfStudies\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number of studies included in this evidence synthesis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numberOfParticipants\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number of participants included in this evidence synthesis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"RiskEvidenceSynthesis.RiskEstimate\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Human-readable summary of risk estimate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Examples include proportion and mean.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The point estimate of the risk estimate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"unitOfMeasure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies the UCUM unit for the outcome.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"denominatorCount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The sample size for the group that was measured for this risk estimate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numeratorCount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of group members with the outcome of interest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"precisionEstimate\" type=\"RiskEvidenceSynthesis.PrecisionEstimate\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the precision of the estimate for the effect.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"RiskEvidenceSynthesis.PrecisionEstimate\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Examples include confidence interval and interquartile range.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"level\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Use 95 for a 95% confidence interval.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"from\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Lower bound of confidence interval.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"to\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Upper bound of confidence interval.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"RiskEvidenceSynthesis.Certainty\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"rating\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A rating of the certainty of the effect estimate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"certaintySubcomponent\" type=\"RiskEvidenceSynthesis.CertaintySubcomponent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of a component of the overall certainty.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"RiskEvidenceSynthesis.CertaintySubcomponent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The RiskEvidenceSynthesis resource describes the likelihood of an outcome in a population plus exposure state where the risk estimate is derived from a combination of research studies.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of subcomponent of certainty rating.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rating\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A rating of a subcomponent of rating certainty.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A human-readable string to clarify or explain concepts about the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/schedule.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Schedule\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Schedule</sch:title>\n    <sch:rule context=\"f:Schedule\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:actor\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:actor/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:actor/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Schedule/f:planningHorizon\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/schedule.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Schedule\" type=\"Schedule\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A container for slots of time that may be available for booking appointments.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Schedule\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A container for slots of time that may be available for booking appointments.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">External Ids for this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"active\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether this schedule record is in active use or should not be used (such as was entered in error).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"serviceCategory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A broad categorization of the service that is to be performed during this appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"serviceType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific service that is to be performed during this appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specialty of a practitioner that would be required to perform the service requested in this appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"actor\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Slots that reference this schedule resource provide the availability details to these referenced resource(s).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"planningHorizon\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The period of time that the slots that reference this Schedule resource cover (even if none exist). These  cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a &quot;template&quot; for planning outside these dates.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments on the availability to describe any extended information. Such as custom constraints on the slots that may be associated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/searchparameter.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource SearchParameter\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SearchParameter</sch:title>\n    <sch:rule context=\"f:SearchParameter\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(exists(f:xpath)) or exists(f:xpathUsage)\">spd-1: If an xpath is present, there SHALL be an xpathUsage</sch:assert>\n      <sch:assert test=\"not(exists(f:chain)) or (f:type/@value = 'reference')\">spd-2: Search parameters can only have chain names when the search parameter type is 'reference'</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SearchParameter/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/searchparameter.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"SearchParameter\" type=\"SearchParameter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A search parameter that defines a named search item that can be used to search/filter on a resource.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"SearchParameter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A search parameter that defines a named search item that can be used to search/filter on a resource.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this search parameter when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this search parameter is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the search parameter is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the search parameter when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the search parameter author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the search parameter. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"derivedFrom\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where this search parameter is originally defined. If a derivedFrom is provided, then the details in the search parameter must be consistent with the definition from which it is defined. i.e. the parameter should have the same meaning, and (usually) the functionality should be a proper subset of the underlying search parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this search parameter. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this search parameter is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the search parameter was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the search parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">And how it used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate search parameter instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the search parameter is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this search parameter is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code used in the URL or the parameter name in a parameters resource for this search parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"base\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The base resource type(s) that this search parameter can be used against.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SearchParamType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of value that a search parameter may contain, and how the content is interpreted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A FHIRPath expression that returns a set of elements for the search parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"xpath\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An XPath expression that returns a set of elements for the search parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"xpathUsage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"XPathUsageType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the search parameter relates to the set of elements returned by evaluating the xpath query.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"target\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Types of resource (if a resource is referenced).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"multipleOr\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether multiple values are allowed for each time the parameter exists. Values are separated by commas, and the parameter matches if any of the values match.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"multipleAnd\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether multiple parameters are allowed - e.g. more than one parameter with the same name. The search matches if all the parameters match.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comparator\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"SearchComparator\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comparators supported for the search parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"SearchModifierCode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A modifier supported for the search parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"chain\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from SearchParameter.code for a parameter on the target resource type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"component\" type=\"SearchParameter.Component\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used to define the parts of a composite search parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SearchParameter.Component\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A search parameter that defines a named search item that can be used to search/filter on a resource.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"definition\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The definition of the search parameter that describes this part.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A sub-expression that defines how to extract values for this component from the output of the main SearchParameter.expression.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"XPathUsageType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"normal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Normal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"phonetic\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Phonetic</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"nearby\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Nearby</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"distance\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Distance</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"other\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Other</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"XPathUsageType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How a search parameter relates to the set of elements returned by evaluating its xpath query.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"XPathUsageType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SearchModifierCode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"missing\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Missing</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"exact\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Exact</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"contains\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Contains</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"not\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"text\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Text</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"in\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"not-in\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not In</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"below\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Below</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"above\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Above</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"type\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Type</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"identifier\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Identifier</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ofType\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Of Type</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SearchModifierCode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A supported modifier for a search parameter.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"SearchModifierCode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SearchComparator-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"eq\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Equals</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ne\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not Equals</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"gt\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Greater Than</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"lt\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Less Than</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ge\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Greater or Equals</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"le\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Less of Equal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"sa\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Starts After</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"eb\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Ends Before</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ap\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Approximately</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SearchComparator\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">What Search Comparator Codes are supported in search.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"SearchComparator-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/servicerequest.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ServiceRequest\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ServiceRequest</sch:title>\n    <sch:rule context=\"f:ServiceRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"exists(f:code) or not(exists(f:orderDetail))\">prr-1: orderDetail SHALL only be present if code is present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:replaces\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:replaces/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:replaces/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:requisition/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:requisition/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:quantityRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrenceTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrenceTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrenceTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrenceTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrenceTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:occurrenceTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:requester\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:requester/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:requester/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:performer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:performer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:performer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:locationReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:locationReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:locationReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:insurance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:insurance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:insurance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:supportingInfo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:supportingInfo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:supportingInfo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:specimen\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:specimen/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:specimen/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:relevantHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:relevantHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ServiceRequest/f:relevantHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/servicerequest.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ServiceRequest\" type=\"ServiceRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a request for service such as diagnostic investigations, treatments, or operations to be performed.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ServiceRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a request for service such as diagnostic investigations, treatments, or operations to be performed.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to a FHIR-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this ServiceRequest.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Plan/proposal/order fulfilled by this request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"replaces\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The request takes the place of the referenced completed or terminated request(s).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requisition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A shared identifier common to all service requests that were authorized more or less simultaneously by a single author, representing the composite or group identifier.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the order.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"RequestIntent\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the request is a proposal, plan, an original order or a reflex order.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that classifies the service for searching, sorting and display purposes (e.g. &quot;Surgical Procedure&quot;).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the ServiceRequest should be addressed with respect to other requests.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"doNotPerform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Set this to true if the record is saying that the service/procedure should NOT be performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that identifies a particular service (i.e., procedure, diagnostic investigation, or panel of investigations) that have been requested.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"orderDetail\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional details and instructions about the how the services are to be delivered.   For example, and order for a urinary catheter may have an order detail for an external or indwelling catheter, or an order for a bandage may require additional instructions specifying how the bandage should be applied.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An amount of service being requested which can be a quantity ( for example $1,500 home modification), a ratio ( for example, 20 half day visits per month), or a range (2.0 to 1.8 Gy per fraction).</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"quantityQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"quantityRatio\" type=\"Ratio\"/>\n            <xs:element name=\"quantityRange\" type=\"Range\"/>\n          </xs:choice>\n          <xs:element name=\"subject\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">On whom or what the service is to be performed. This is usually a human patient, but can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An encounter that provides additional information about the healthcare context in which this request is made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date/time at which the requested service should occur.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\n            <xs:element name=\"occurrenceTiming\" type=\"Timing\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If a CodeableConcept is present, it indicates the pre-condition for performing the service.  For example &quot;pain&quot;, &quot;on flare-up&quot;, etc.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"asNeededBoolean\" type=\"boolean\"/>\n            <xs:element name=\"asNeededCodeableConcept\" type=\"CodeableConcept\"/>\n          </xs:choice>\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the request transitioned to being actionable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual who initiated the request and has responsibility for its activation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performerType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Desired type of performer for doing the requested service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performer\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The desired performer for doing the requested service.  For example, the surgeon, dermatopathologist, endoscopist, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"locationCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The preferred location(s) where the procedure should actually happen in coded or free text form. E.g. at home or nursing day care center.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"locationReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to the the preferred location(s) where the procedure should actually happen. E.g. at home or nursing day care center.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanation or justification for why this service is being requested in coded or textual form.   This is often for billing purposes.  May relate to the resources referred to in `supportingInfo`.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates another resource that provides a justification for why this service is being requested.   May relate to the resources referred to in `supportingInfo`.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be needed for delivering the requested service.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supportingInfo\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional clinical information about the patient or specimen that may influence the services or their interpretations.     This information includes diagnosis, clinical findings and other observations.  In laboratory ordering these are typically referred to as &quot;ask at order entry questions (AOEs)&quot;.  This includes observations explicitly requested by the producer (filler) to provide context or supporting information needed to complete the order. For example,  reporting the amount of inspired oxygen for blood gas measurements.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specimen\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">One or more specimens that the laboratory procedure will use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Anatomic location where the procedure should be performed. This is the target site.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Any other notes and comments made about the service request. For example, internal billing notes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patientInstruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Instructions in terms that are understood by the patient or consumer.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relevantHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Key events in the history of the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/slot.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Slot\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Slot</sch:title>\n    <sch:rule context=\"f:Slot\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Slot/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Slot/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Slot/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Slot/f:schedule\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Slot/f:schedule/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Slot/f:schedule/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/slot.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Slot\" type=\"Slot\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A slot of time on a schedule that may be available for booking appointments.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Slot\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A slot of time on a schedule that may be available for booking appointments.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">External Ids for this item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"serviceCategory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A broad categorization of the service that is to be performed during this appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"serviceType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specialty\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specialty of a practitioner that would be required to perform the service requested in this appointment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"appointmentType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The style of appointment or patient that may be booked in the slot (not service type).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"schedule\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The schedule resource that this slot defines an interval of status information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SlotStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">busy | free | busy-unavailable | busy-tentative | entered-in-error.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"start\" minOccurs=\"1\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date/Time that the slot is to begin.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"end\" minOccurs=\"1\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date/Time that the slot is to conclude.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"overbooked\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This slot has already been overbooked, appointments are unlikely to be accepted for this time.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments on the slot to describe any extended information. Such as custom constraints on the slot.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SlotStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"busy\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Busy</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"free\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Free</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"busy-unavailable\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Busy (Unavailable)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"busy-tentative\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Busy (Tentative)</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SlotStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The free/busy status of the slot.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"SlotStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/specimen.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Specimen\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Specimen</sch:title>\n    <sch:rule context=\"f:Specimen\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:accessionIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:accessionIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:subject\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:subject/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:subject/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:parent\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:parent/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:parent/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:request\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:request/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:request/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:collector\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:collector/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:collector/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:collectedPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:duration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:collection/f:fastingStatusDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:processing/f:additive\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:processing/f:additive/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:processing/f:additive/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:processing/f:timePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:capacity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:specimenQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:additiveReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:additiveReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:container/f:additiveReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Specimen/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/specimen.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Specimen\" type=\"Specimen\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A sample to be used for analysis.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Specimen\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A sample to be used for analysis.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id for specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"accessionIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SpecimenStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The availability of the specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of material that forms the specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subject\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where the specimen came from. This may be from patient(s), from a location (e.g., the source of an environmental sample), or a sampling of a substance or a device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"receivedTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time when specimen was received for processing or testing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parent\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"request\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details concerning a service request that required a specimen to be collected.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"collection\" type=\"Specimen.Collection\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details concerning the specimen collection.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"processing\" type=\"Specimen.Processing\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details concerning processing and processing steps for the specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"container\" type=\"Specimen.Container\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The container holding the specimen.  The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"condition\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A mode or state of being that describes the nature of the specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">To communicate any details or issues about the specimen or during the specimen collection. (for example: broken vial, sent with patient, frozen).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Specimen.Collection\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A sample to be used for analysis.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"collector\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Person who collected the specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time when specimen was collected from subject - the physiologically relevant time.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"collectedDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"collectedPeriod\" type=\"Period\"/>\n          </xs:choice>\n          <xs:element name=\"duration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The span of time over which the collection of a specimen occurred.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A coded value specifying the technique that is used to perform the procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"bodySite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Anatomical location from which the specimen was collected (if subject is a patient). This is the target site.  This element is not used for environmental specimens.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Abstinence or reduction from some or all food, drink, or both, for a period of time prior to sample collection.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"fastingStatusCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"fastingStatusDuration\" type=\"Duration\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Specimen.Processing\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A sample to be used for analysis.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Textual description of procedure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"procedure\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A coded value specifying the procedure used to process the specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"additive\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Material used in the processing step.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A record of the time or period when the specimen processing occurred.  For example the time of sample fixation or the period of time the sample was in formalin.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"timeDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"timePeriod\" type=\"Period\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Specimen.Container\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A sample to be used for analysis.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Textual description of the container.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of container associated with the specimen (e.g. slide, aliquot, etc.).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"capacity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The capacity (volume or other measure) the container may contain.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"specimenQuantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"additiveCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"additiveReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SpecimenStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"available\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Available</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unavailable\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unavailable</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unsatisfactory\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unsatisfactory</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SpecimenStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Codes providing the status/availability of a specimen.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"SpecimenStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/specimendefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource SpecimenDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SpecimenDefinition</sch:title>\n    <sch:rule context=\"f:SpecimenDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:container/f:capacity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:container/f:minimumVolumeQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:container/f:additive/f:additiveReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:container/f:additive/f:additiveReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:container/f:additive/f:additiveReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:retentionTime\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:handling/f:temperatureRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:handling/f:temperatureRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:handling/f:temperatureRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SpecimenDefinition/f:typeTested/f:handling/f:maxDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/specimendefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"SpecimenDefinition\" type=\"SpecimenDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A kind of specimen with associated set of requirements.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"SpecimenDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A kind of specimen with associated set of requirements.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A business identifier associated with the kind of specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"typeCollected\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of material to be collected.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patientPreparation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Preparation of the patient for specimen collection.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"timeAspect\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Time aspect of specimen collection (duration or offset).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"collection\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The action to be performed for collecting the specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"typeTested\" type=\"SpecimenDefinition.TypeTested\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specimen conditioned in a container as expected by the testing laboratory.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SpecimenDefinition.TypeTested\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A kind of specimen with associated set of requirements.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"isDerived\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Primary of secondary specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of specimen conditioned for testing expected by lab.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preference\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SpecimenContainedPreference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The preference for this type of conditioned specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"container\" type=\"SpecimenDefinition.Container\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specimen's container.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requirement\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Requirements for delivery and special handling of this kind of conditioned specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"retentionTime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The usual time that a specimen of this kind is retained after the ordered tests are completed, for the purpose of additional testing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rejectionCriterion\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Criterion for rejection of the specimen in its container by the laboratory.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"handling\" type=\"SpecimenDefinition.Handling\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Set of instructions for preservation/transport of the specimen at a defined temperature interval, prior the testing process.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SpecimenDefinition.Container\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A kind of specimen with associated set of requirements.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"material\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of material of the container.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of container used to contain this kind of specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cap\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Color of container cap.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The textual description of the kind of container.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"capacity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The capacity (volume or other measure) of this kind of container.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The minimum volume to be conditioned in the container.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"minimumVolumeQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"minimumVolumeString\" type=\"string\"/>\n          </xs:choice>\n          <xs:element name=\"additive\" type=\"SpecimenDefinition.Additive\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Substance introduced in the kind of container to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preparation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Special processing that should be applied to the container for this kind of specimen.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SpecimenDefinition.Additive\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A kind of specimen with associated set of requirements.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Substance introduced in the kind of container to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"additiveCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"additiveReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SpecimenDefinition.Handling\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A kind of specimen with associated set of requirements.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"temperatureQualifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">It qualifies the interval of temperature, which characterizes an occurrence of handling. Conditions that are not related to temperature may be handled in the instruction element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"temperatureRange\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Range\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The temperature interval for this set of handling instructions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maxDuration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Duration\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The maximum time interval of preservation of the specimen with these conditions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instruction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional textual instructions for the preservation or transport of the specimen. For instance, 'Protect from light exposure'.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SpecimenContainedPreference-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"preferred\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Preferred</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"alternate\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Alternate</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SpecimenContainedPreference\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Degree of preference of a type of conditioned specimen.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"SpecimenContainedPreference-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/structuredefinition.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource StructureDefinition\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>StructureDefinition</sch:title>\n    <sch:rule context=\"f:StructureDefinition\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(exists(f:snapshot/f:element[not(contains(f:path/@value, '.')) and (f:label or f:code or f:requirements)])) and not(exists(f:differential/f:element[not(contains(f:path/@value, '.')) and (f:label or f:code or f:requirements)]))\">sdf-9: In any snapshot or differential, no label, code or requirements on an element without a &quot;.&quot; in the path (e.g. the first element)</sch:assert>\n      <sch:assert test=\"f:kind/@value='logical' or not(f:differential/f:element[1][not(contains(f:path/@value, '.'))]/f:type)\">sdf-15a: If the first element in a differential has no &quot;.&quot; in the path and it's not a logical model, it has no type</sch:assert>\n      <sch:assert test=\"not(starts-with(f:url/@value, 'http://hl7.org/fhir/StructureDefinition')) or count(f:differential/f:element/f:type/f:code[@value and not(matches(string(@value), '^[a-zA-Z0-9\\.]+$'))]|f:snapshot/f:element/f:type/f:code[@value and not(matches(string(@value), '^[a-zA-Z0-9]+$\\.'))]) =0\">sdf-19: FHIR Specification models only use FHIR defined types</sch:assert>\n      <sch:assert test=\"count(f:snapshot/f:element)=count(f:snapshot/f:element/@id) and (count(f:snapshot/f:element)=count(distinct-values(f:snapshot/f:element/@id)))\">sdf-16: All element definitions must have unique ids (snapshot)</sch:assert>\n      <sch:assert test=\"f:kind/@value='logical' or not(f:snapshot/f:element[1]/f:type)\">sdf-15: The first element in a snapshot has no type unless model is a logical model.</sch:assert>\n      <sch:assert test=\"not(exists(f:contextInvariant)) or (f:type/@value = 'Extension')\">sdf-18: Context Invariants can only be used for extensions</sch:assert>\n      <sch:assert test=\"count(f:differential/f:element)=count(f:differential/f:element/@id) and (count(f:differential/f:element)=count(distinct-values(f:differential/f:element/@id)))\">sdf-17: All element definitions must have unique ids (diff)</sch:assert>\n      <sch:assert test=\"count(*[self::snapshot or self::differential]/f:element[not(contains(f:path/@value, '.')) and f:sliceName])=0\">sdf-23: No slice name on root</sch:assert>\n      <sch:assert test=\"(f:kind/@value = 'logical') or not(exists(f:snapshot)) or (f:type/@value = f:snapshot/f:element[1]/f:path/@value)\">sdf-11: If there's a type, its content must match the path name in the first element of a snapshot</sch:assert>\n      <sch:assert test=\"not(starts-with(f:url/@value, 'http://hl7.org/fhir/StructureDefinition')) or (not(exists(f:snapshot/f:element/*[starts-with(local-name(), 'defaultValue')])) and not(exists(f:differential/f:element/*[starts-with(local-name(), 'defaultValue')])))\">sdf-22: FHIR Specification models never have default values</sch:assert>\n      <sch:assert test=\"count(*/f:element)=count(*/f:element/@id)\">sdf-14: All element definitions must have an id</sch:assert>\n      <sch:assert test=\"(f:derivation/@value = 'constraint') or (count(f:snapshot/f:element) = count(distinct-values(f:snapshot/f:element/f:path/@value)))\">sdf-1: Element paths must be unique unless the structure is a constraint</sch:assert>\n      <sch:assert test=\"not(exists(f:differential/f:element/*[starts-with(local-name(), 'defaultValue')])) or (f:derivation/@value = 'specialization')\">sdf-21: Default values can only be specified on specializations</sch:assert>\n      <sch:assert test=\"exists(f:snapshot) or exists(f:differential)\">sdf-6: A structure must have either a differential, or a snapshot (or both)</sch:assert>\n      <sch:assert test=\"not(f:type/@value = 'extension') or (f:derivation/@value = 'specialization') or (exists(f:context))\">sdf-5: If the structure defines an extension then the structure must have context information</sch:assert>\n      <sch:assert test=\"(f:abstract/@value=true()) or exists(f:baseDefinition)\">sdf-4: If the structure is not abstract, then there SHALL be a baseDefinition</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:mapping\">\n      <sch:assert test=\"exists(f:uri) or exists(f:name)\">sdf-2: Must have at least a name or a uri (or both)</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot\">\n      <sch:assert test=\"f:element[1]/f:path/@value=parent::f:StructureDefinition/f:type/@value and count(f:element[position()!=1])=count(f:element[position()!=1][starts-with(f:path/@value, concat(ancestor::f:StructureDefinition/f:type/@value, '.'))])\">sdf-8: All snapshot elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models</sch:assert>\n      <sch:assert test=\"count(f:element) = count(f:element[exists(f:definition) and exists(f:min) and exists(f:max)])\">sdf-3: Each element definition in a snapshot must have a formal definition and cardinalities</sch:assert>\n      <sch:assert test=\"count(f:element) = count(f:element/f:base)\">sdf-8b: All snapshot elements must have a base definition</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element\">\n      <sch:assert test=\"not(exists(f:binding)) or exists(f:binding/f:valueSet) or exists(f:binding/f:description)\">sdf-10: provide either a binding reference or a description (or both)</sch:assert>\n      <sch:assert test=\"matches(path/@value, '[^\\s\\.,:;\\'&amp;quot;\\/|?!@#$%&amp;amp;*()\\[\\]{}]{1,64}(\\.[^\\s\\.,:;\\'&amp;quot;\\/|?!@#$%&amp;amp;*()\\[\\]{}]{1,64}(\\[x\\])?(\\:[^\\s\\.]+)?)*')\">eld-19: Element names cannot include some special characters</sch:assert>\n      <sch:assert test=\"not(exists(f:min)) or not(exists(f:max)) or (not(f:max/@value) and not(f:min/@value)) or (f:max/@value = '*') or (number(f:max/@value) &gt;= f:min/@value)\">eld-2: Min &lt;= Max</sch:assert>\n      <sch:assert test=\"not(exists(f:contentReference) and (exists(f:type) or exists(f:*[starts-with(local-name(.), 'value')]) or exists(f:*[starts-with(local-name(.), 'defaultValue')])  or exists(f:*[starts-with(local-name(.), 'fixed')]) or exists(f:*[starts-with(local-name(.), 'pattern')]) or exists(f:*[starts-with(local-name(.), 'example')]) or exists(f:*[starts-with(local-name(.), 'f:minValue')]) or exists(f:*[starts-with(local-name(.), 'f:maxValue')]) or exists(f:maxLength) or exists(f:binding)))\">eld-5: if the element definition has a contentReference, it cannot have type, defaultValue, fixed, pattern, example, minValue, maxValue, maxLength, or binding</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'pattern')])) or (count(f:type)&lt;=1)\">eld-7: Pattern may only be specified if there is one type</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'fixed')])) or (count(f:type)&lt;=1)\">eld-6: Fixed value may only be specified if there is one type</sch:assert>\n      <sch:assert test=\"not(exists(f:binding)) or (count(f:type/f:code) = 0) or  f:type/f:code/@value=('code','Coding','CodeableConcept','Quantity','string', 'uri')\">eld-11: Binding can only be present for coded elements, string, and uri</sch:assert>\n      <sch:assert test=\"exists(f:sliceName) or not(exists(f:sliceIsConstraining))\">eld-22: sliceIsConstraining can only appear if slicename is present</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'pattern')])) or not(exists(f:*[starts-with(local-name(.), 'fixed')]))\">eld-8: Pattern and fixed are mutually exclusive</sch:assert>\n      <sch:assert test=\"count(f:constraint) = count(distinct-values(f:constraint/f:key/@value))\">eld-14: Constraints must be unique by key</sch:assert>\n      <sch:assert test=\"not(exists(for $type in f:type return $type/preceding-sibling::f:type[f:code/@value=$type/f:code/@value]))\">eld-13: Types must be unique by code</sch:assert>\n      <sch:assert test=\"not(exists(f:sliceName/@value)) or matches(f:sliceName/@value, '^[a-zA-Z0-9\\/\\-_\\[\\]\\@]+$')\">eld-16: sliceName must be composed of proper tokens separated by &quot;/&quot;</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'fixed')])) or not(exists(f:meaningWhenMissing))\">eld-15: default value and meaningWhenMissing are mutually exclusive</sch:assert>\n      <sch:assert test=\"not(f:isModifier/@value = 'true') or exists(f:isModifierReason)\">eld-18: Must have a modifier reason if isModifier = true</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element/f:slicing\">\n      <sch:assert test=\"(f:discriminator) or (f:description)\">eld-1: If there are no discriminators, there must be a definition</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element/f:max\">\n      <sch:assert test=\"@value='*' or (normalize-space(@value)!='' and normalize-space(translate(@value, '0123456789',''))='')\">eld-3: Max SHALL be a number or &quot;*&quot;</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element/f:type\">\n      <sch:assert test=\"not(exists(f:aggregation)) or exists(f:code[@value = 'Reference']) or exists(f:code[@value = 'canonical'])\">eld-4: Aggregation may only be specified if one of the allowed types for the element is a reference</sch:assert>\n      <sch:assert test=\"not(exists(f:targetProfile)) or (f:code/@value = 'Reference')\">eld-17: targetProfile is only allowed if the type is Reference or canonical</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element/f:minValueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element/f:maxValueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:snapshot/f:element/f:binding\">\n      <sch:assert test=\"(starts-with(string(f:valueSet/@value), 'http:') or starts-with(string(f:valueSet/@value), 'https:') or starts-with(string(f:valueSet/@value), 'urn:'))\">eld-12: ValueSet SHALL start with http:// or https:// or urn:</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential\">\n      <sch:assert test=\"not(f:element[1]/f:slicing)\">sdf-20: No slicing on the root element</sch:assert>\n      <sch:assert test=\"count(f:element)=count(f:element[f:path/@value=ancestor::f:StructureDefinition/f:type/@value or starts-with(f:path/@value, concat(ancestor::f:StructureDefinition/f:type/@value, '.'))])\">sdf-8a: In any differential, all the elements must start with the StructureDefinition's specified type for non-logical models, or with the same type name for logical models</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element\">\n      <sch:assert test=\"matches(path/@value, '[^\\s\\.,:;\\'&amp;quot;\\/|?!@#$%&amp;amp;*()\\[\\]{}]{1,64}(\\.[^\\s\\.,:;\\'&amp;quot;\\/|?!@#$%&amp;amp;*()\\[\\]{}]{1,64}(\\[x\\])?(\\:[^\\s\\.]+)?)*')\">eld-19: Element names cannot include some special characters</sch:assert>\n      <sch:assert test=\"not(exists(f:min)) or not(exists(f:max)) or (not(f:max/@value) and not(f:min/@value)) or (f:max/@value = '*') or (number(f:max/@value) &gt;= f:min/@value)\">eld-2: Min &lt;= Max</sch:assert>\n      <sch:assert test=\"not(exists(f:contentReference) and (exists(f:type) or exists(f:*[starts-with(local-name(.), 'value')]) or exists(f:*[starts-with(local-name(.), 'defaultValue')])  or exists(f:*[starts-with(local-name(.), 'fixed')]) or exists(f:*[starts-with(local-name(.), 'pattern')]) or exists(f:*[starts-with(local-name(.), 'example')]) or exists(f:*[starts-with(local-name(.), 'f:minValue')]) or exists(f:*[starts-with(local-name(.), 'f:maxValue')]) or exists(f:maxLength) or exists(f:binding)))\">eld-5: if the element definition has a contentReference, it cannot have type, defaultValue, fixed, pattern, example, minValue, maxValue, maxLength, or binding</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'pattern')])) or (count(f:type)&lt;=1)\">eld-7: Pattern may only be specified if there is one type</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'fixed')])) or (count(f:type)&lt;=1)\">eld-6: Fixed value may only be specified if there is one type</sch:assert>\n      <sch:assert test=\"not(exists(f:binding)) or (count(f:type/f:code) = 0) or  f:type/f:code/@value=('code','Coding','CodeableConcept','Quantity','string', 'uri')\">eld-11: Binding can only be present for coded elements, string, and uri</sch:assert>\n      <sch:assert test=\"exists(f:sliceName) or not(exists(f:sliceIsConstraining))\">eld-22: sliceIsConstraining can only appear if slicename is present</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'pattern')])) or not(exists(f:*[starts-with(local-name(.), 'fixed')]))\">eld-8: Pattern and fixed are mutually exclusive</sch:assert>\n      <sch:assert test=\"count(f:constraint) = count(distinct-values(f:constraint/f:key/@value))\">eld-14: Constraints must be unique by key</sch:assert>\n      <sch:assert test=\"not(exists(for $type in f:type return $type/preceding-sibling::f:type[f:code/@value=$type/f:code/@value]))\">eld-13: Types must be unique by code</sch:assert>\n      <sch:assert test=\"not(exists(f:sliceName/@value)) or matches(f:sliceName/@value, '^[a-zA-Z0-9\\/\\-_\\[\\]\\@]+$')\">eld-16: sliceName must be composed of proper tokens separated by &quot;/&quot;</sch:assert>\n      <sch:assert test=\"not(exists(f:*[starts-with(local-name(.), 'fixed')])) or not(exists(f:meaningWhenMissing))\">eld-15: default value and meaningWhenMissing are mutually exclusive</sch:assert>\n      <sch:assert test=\"not(f:isModifier/@value = 'true') or exists(f:isModifierReason)\">eld-18: Must have a modifier reason if isModifier = true</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element/f:slicing\">\n      <sch:assert test=\"(f:discriminator) or (f:description)\">eld-1: If there are no discriminators, there must be a definition</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element/f:max\">\n      <sch:assert test=\"@value='*' or (normalize-space(@value)!='' and normalize-space(translate(@value, '0123456789',''))='')\">eld-3: Max SHALL be a number or &quot;*&quot;</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element/f:type\">\n      <sch:assert test=\"not(exists(f:aggregation)) or exists(f:code[@value = 'Reference']) or exists(f:code[@value = 'canonical'])\">eld-4: Aggregation may only be specified if one of the allowed types for the element is a reference</sch:assert>\n      <sch:assert test=\"not(exists(f:targetProfile)) or (f:code/@value = 'Reference')\">eld-17: targetProfile is only allowed if the type is Reference or canonical</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element/f:minValueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element/f:maxValueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureDefinition/f:differential/f:element/f:binding\">\n      <sch:assert test=\"(starts-with(string(f:valueSet/@value), 'http:') or starts-with(string(f:valueSet/@value), 'https:') or starts-with(string(f:valueSet/@value), 'urn:'))\">eld-12: ValueSet SHALL start with http:// or https:// or urn:</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/structuredefinition.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"StructureDefinition\" type=\"StructureDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"StructureDefinition\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this structure definition when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this structure definition is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the structure definition is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this structure definition when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the structure definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the structure definition. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the structure definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this structure definition. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this structure definition is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the structure definition was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the structure definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the structure definition from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate structure definition instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the structure definition is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this structure definition is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"keyword\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A set of key words or terms from external terminologies that may be used to assist with indexing and searching of templates nby describing the use of this structure definition, or the content it describes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fhirVersion\" minOccurs=\"0\" maxOccurs=\"1\" type=\"FHIRVersion\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 4.0.1. for this version.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"mapping\" type=\"StructureDefinition.Mapping\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An external specification that the content is mapped to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"StructureDefinitionKind\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines the kind of structure that this definition is describing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"abstract\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether structure this definition describes is abstract or not  - that is, whether the structure is not intended to be instantiated. For Resources and Data types, abstract types will never be exchanged  between systems.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"context\" type=\"StructureDefinition.Context\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the types of resource or data type elements to which the extension can be applied.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contextInvariant\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A set of rules as FHIRPath Invariants about when the extension can be used (e.g. co-occurrence variants for the extension). All the rules must be true.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type this structure describes. If the derivation kind is 'specialization' then this is the master definition for a type, and there is always one of these (a data type, an extension, a resource, including abstract ones). Otherwise the structure definition is a constraint on the stated type (and in this case, the type cannot be an abstract type).  References are URLs that are relative to http://hl7.org/fhir/StructureDefinition e.g. &quot;string&quot; is a reference to http://hl7.org/fhir/StructureDefinition/string. Absolute URLs are only allowed in logical models.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"baseDefinition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"derivation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"TypeDerivationRule\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the type relates to the baseDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"snapshot\" type=\"StructureDefinition.Snapshot\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A snapshot view is expressed in a standalone form that can be used and interpreted without considering the base StructureDefinition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"differential\" type=\"StructureDefinition.Differential\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"StructureDefinition.Mapping\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An Internal id that is used to identify this mapping set when specific mappings are made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"uri\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that identifies the specification that this mapping is expressed to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name for the specification that is being mapped to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"StructureDefinition.Context\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"ExtensionContextType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Defines how to interpret the expression that defines what the context of the extension is.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An expression that defines where an extension can be used in resources.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"StructureDefinition.Snapshot\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"element\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"ElementDefinition\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"StructureDefinition.Differential\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"element\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"ElementDefinition\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Captures constraints on each element within the resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"StructureDefinitionKind-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"primitive-type\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Primitive Data Type</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"complex-type\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Complex Data Type</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"resource\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Resource</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"logical\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Logical</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"StructureDefinitionKind\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Defines the type of structure that a definition is describing.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"StructureDefinitionKind-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"TypeDerivationRule-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"specialization\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Specialization</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"constraint\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Constraint</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"TypeDerivationRule\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How a type relates to its baseDefinition.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"TypeDerivationRule-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"ExtensionContextType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"fhirpath\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">FHIRPath</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"element\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Element ID</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"extension\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Extension URL</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"ExtensionContextType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How an extension context is interpreted.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"ExtensionContextType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/structuremap.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource StructureMap\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>StructureMap</sch:title>\n    <sch:rule context=\"f:StructureMap\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:StructureMap/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/structuremap.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"StructureMap\" type=\"StructureMap\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"StructureMap\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this structure map when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this structure map is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the structure map is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this structure map when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the structure map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the structure map author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the structure map. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the structure map.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this structure map. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this structure map is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the structure map was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the structure map.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the structure map from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate structure map instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the structure map is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this structure map is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the structure map.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"structure\" type=\"StructureMap.Structure\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"import\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Other maps used by this map (canonical URLs).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"group\" type=\"StructureMap.Group\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Organizes the mapping into manageable chunks for human review/ease of maintenance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"StructureMap.Structure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The canonical reference to the structure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"StructureMapModelMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the referenced structure is used in this mapping.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"alias\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name used for this type in the map.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Documentation that describes how the structure is used in the mapping.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"StructureMap.Group\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique name for the group for the convenience of human readers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"extends\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Another group that this group adds rules to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"typeMode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"StructureMapGroupTypeMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If this is the default rule set to apply for the source type or this combination of types.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional supporting documentation that explains the purpose of the group and the types of mappings within it.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"input\" type=\"StructureMap.Input\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name assigned to an instance of data. The instance must be provided when the mapping is invoked.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rule\" type=\"StructureMap.Rule\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Transform Rule from source to target.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"StructureMap.Input\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name for this instance of data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type for this instance of data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"mode\" minOccurs=\"1\" maxOccurs=\"1\" type=\"StructureMapInputMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Mode for this instance of data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Documentation for this instance of data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"StructureMap.Rule\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name of the rule for internal references.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" type=\"StructureMap.Source\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Source inputs to the mapping.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"target\" type=\"StructureMap.Target\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Content to create because of this mapping rule.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"rule\" type=\"StructureMap.Rule\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Rules contained in this rule.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dependent\" type=\"StructureMap.Dependent\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Which other rules to apply in the context of this rule.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Documentation for this instance of data.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"StructureMap.Source\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"context\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type or variable this rule applies to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"min\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specified minimum cardinality for the element. This is optional; if present, it acts an implicit check on the input content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"max\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specified maximum cardinality for the element - a number or a &quot;*&quot;. This is optional; if present, it acts an implicit check on the input content (* just serves as documentation; it's the default value).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specified type for the element. This works as a condition on the mapping - use for polymorphic elements.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A value to use if there is no existing value in the source object.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"defaultValueBase64Binary\" type=\"base64Binary\"/>\n            <xs:element name=\"defaultValueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"defaultValueCanonical\" type=\"canonical\"/>\n            <xs:element name=\"defaultValueCode\" type=\"code\"/>\n            <xs:element name=\"defaultValueDate\" type=\"date\"/>\n            <xs:element name=\"defaultValueDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"defaultValueDecimal\" type=\"decimal\"/>\n            <xs:element name=\"defaultValueId\" type=\"id\"/>\n            <xs:element name=\"defaultValueInstant\" type=\"instant\"/>\n            <xs:element name=\"defaultValueInteger\" type=\"integer\"/>\n            <xs:element name=\"defaultValueMarkdown\" type=\"markdown\"/>\n            <xs:element name=\"defaultValueOid\" type=\"oid\"/>\n            <xs:element name=\"defaultValuePositiveInt\" type=\"positiveInt\"/>\n            <xs:element name=\"defaultValueString\" type=\"string\"/>\n            <xs:element name=\"defaultValueTime\" type=\"time\"/>\n            <xs:element name=\"defaultValueUnsignedInt\" type=\"unsignedInt\"/>\n            <xs:element name=\"defaultValueUri\" type=\"uri\"/>\n            <xs:element name=\"defaultValueUrl\" type=\"url\"/>\n            <xs:element name=\"defaultValueUuid\" type=\"uuid\"/>\n            <xs:element name=\"defaultValueAddress\" type=\"Address\"/>\n            <xs:element name=\"defaultValueAge\" type=\"Age\"/>\n            <xs:element name=\"defaultValueAnnotation\" type=\"Annotation\"/>\n            <xs:element name=\"defaultValueAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"defaultValueCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"defaultValueCoding\" type=\"Coding\"/>\n            <xs:element name=\"defaultValueContactPoint\" type=\"ContactPoint\"/>\n            <xs:element name=\"defaultValueCount\" type=\"Count\"/>\n            <xs:element name=\"defaultValueDistance\" type=\"Distance\"/>\n            <xs:element name=\"defaultValueDuration\" type=\"Duration\"/>\n            <xs:element name=\"defaultValueHumanName\" type=\"HumanName\"/>\n            <xs:element name=\"defaultValueIdentifier\" type=\"Identifier\"/>\n            <xs:element name=\"defaultValueMoney\" type=\"Money\"/>\n            <xs:element name=\"defaultValuePeriod\" type=\"Period\"/>\n            <xs:element name=\"defaultValueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"defaultValueRange\" type=\"Range\"/>\n            <xs:element name=\"defaultValueRatio\" type=\"Ratio\"/>\n            <xs:element name=\"defaultValueReference\" type=\"Reference\"/>\n            <xs:element name=\"defaultValueSampledData\" type=\"SampledData\"/>\n            <xs:element name=\"defaultValueSignature\" type=\"Signature\"/>\n            <xs:element name=\"defaultValueTiming\" type=\"Timing\"/>\n            <xs:element name=\"defaultValueContactDetail\" type=\"ContactDetail\"/>\n            <xs:element name=\"defaultValueContributor\" type=\"Contributor\"/>\n            <xs:element name=\"defaultValueDataRequirement\" type=\"DataRequirement\"/>\n            <xs:element name=\"defaultValueExpression\" type=\"Expression\"/>\n            <xs:element name=\"defaultValueParameterDefinition\" type=\"ParameterDefinition\"/>\n            <xs:element name=\"defaultValueRelatedArtifact\" type=\"RelatedArtifact\"/>\n            <xs:element name=\"defaultValueTriggerDefinition\" type=\"TriggerDefinition\"/>\n            <xs:element name=\"defaultValueUsageContext\" type=\"UsageContext\"/>\n            <xs:element name=\"defaultValueDosage\" type=\"Dosage\"/>\n            <xs:element name=\"defaultValueMeta\" type=\"Meta\"/>\n          </xs:choice>\n          <xs:element name=\"element\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Optional field for this source.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"listMode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"StructureMapSourceListMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How to handle the list mode for this element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"variable\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Named context for field, if a field is specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"condition\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">FHIRPath expression  - must be true or the rule does not apply.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"check\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">FHIRPath expression  - must be true or the mapping engine throws an error instead of completing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"logMessage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A FHIRPath expression which specifies a message to put in the transform log when content matching the source rule is found.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"StructureMap.Target\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"context\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type or variable this rule applies to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contextType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"StructureMapContextType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How to interpret the context.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"element\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Field to create in the context.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"variable\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Named context for field, if desired, and a field is specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"listMode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"StructureMapTargetListMode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If field is a list, how to manage the list.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"listRuleId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Internal rule reference for shared list items.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"transform\" minOccurs=\"0\" maxOccurs=\"1\" type=\"StructureMapTransform\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">How the data is copied / created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parameter\" type=\"StructureMap.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Parameters to the transform.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"StructureMap.Parameter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Parameter value - variable or literal.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueId\" type=\"id\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"StructureMap.Dependent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A Map of relationships between 2 structures that can be used to transform data.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name of a rule or group to apply.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"variable\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Variable to pass to the rule or group.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"StructureMapInputMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"source\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Source Instance</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"target\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Target Instance</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"StructureMapInputMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Mode for this instance of data.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"StructureMapInputMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"StructureMapContextType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"type\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Type</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"variable\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Variable</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"StructureMapContextType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How to interpret the context.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"StructureMapContextType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"StructureMapTargetListMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"first\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">First</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"share\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Share</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"last\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Last</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"collate\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Collate</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"StructureMapTargetListMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">If field is a list, how to manage the production.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"StructureMapTargetListMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"StructureMapTransform-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"create\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">create</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"copy\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">copy</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"truncate\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">truncate</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"escape\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">escape</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cast\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">cast</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"append\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">append</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"translate\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">translate</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"reference\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">reference</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"dateOp\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">dateOp</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"uuid\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">uuid</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"pointer\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">pointer</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"evaluate\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">evaluate</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cc\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">cc</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"c\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">c</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"qty\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">qty</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"id\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">id</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cp\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">cp</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"StructureMapTransform\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How data is copied/created.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"StructureMapTransform-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"StructureMapSourceListMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"first\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">First</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"not_first\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">All but the first</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"last\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Last</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"not_last\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">All but the last</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"only_one\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Enforce only one</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"StructureMapSourceListMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">If field is a list, how to manage the source.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"StructureMapSourceListMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"StructureMapGroupTypeMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"none\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Not a Default</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"types\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Default for Type Combination</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"type-and-types\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Default for type + combination</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"StructureMapGroupTypeMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">If this is the default rule set to apply for the source type, or this combination of types.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"StructureMapGroupTypeMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"StructureMapModelMode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"source\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Source Structure Definition</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"queried\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Queried Structure Definition</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"target\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Target Structure Definition</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"produced\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Produced Structure Definition</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"StructureMapModelMode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">How the referenced structure is used in this mapping.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"StructureMapModelMode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/subscription.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Subscription\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Subscription</sch:title>\n    <sch:rule context=\"f:Subscription\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Subscription/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Subscription/f:contact\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Subscription/f:contact/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/subscription.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Subscription\" type=\"Subscription\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined &quot;channel&quot; so that another system can take an appropriate action.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Subscription\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined &quot;channel&quot; so that another system can take an appropriate action.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SubscriptionStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the subscription, which marks the server state for managing the subscription.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactPoint\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"end\" minOccurs=\"0\" maxOccurs=\"1\" type=\"instant\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time for the server to turn the subscription off.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reason\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of why this subscription is defined.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"criteria\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The rules that the server should use to determine when to generate notifications for this subscription.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"error\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A record of the last error that occurred when the server processed a notification.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"channel\" type=\"Subscription.Channel\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details where to send notifications when resources are received that meet the criteria.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Subscription.Channel\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The subscription resource is used to define a push-based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined &quot;channel&quot; so that another system can take an appropriate action.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"SubscriptionChannelType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of channel to send notifications on.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"endpoint\" minOccurs=\"0\" maxOccurs=\"1\" type=\"url\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The url that describes the actual end-point to send messages to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"payload\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The mime type to send the payload in - either application/fhir+xml, or application/fhir+json. If the payload is not present, then there is no payload in the notification, just a notification. The mime type &quot;text/plain&quot; may also be used for Email and SMS subscriptions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"header\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional headers / information to send as part of the notification.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SubscriptionStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"requested\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Requested</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"off\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Off</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SubscriptionStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The status of a subscription.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"SubscriptionStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SubscriptionChannelType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"rest-hook\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Rest Hook</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"websocket\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Websocket</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"email\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Email</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"sms\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">SMS</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"message\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Message</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SubscriptionChannelType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of method used to execute a subscription.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"SubscriptionChannelType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substance.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Substance\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Substance</sch:title>\n    <sch:rule context=\"f:Substance\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:instance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:instance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:instance/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:ingredient/f:quantity\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:ingredient/f:quantity/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:ingredient/f:quantity/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:ingredient/f:substanceReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:ingredient/f:substanceReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Substance/f:ingredient/f:substanceReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substance.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Substance\" type=\"Substance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A homogeneous material with a definite composition.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Substance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A homogeneous material with a definite composition.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique identifier for the substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"FHIRSubstanceStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code to indicate if the substance is actively used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that classifies the general type of substance.  This is used  for searching, sorting and display purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code (or set of codes) that identify this substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description of the substance - its appearance, handling requirements, and other usage notes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instance\" type=\"Substance.Instance\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"ingredient\" type=\"Substance.Ingredient\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A substance can be composed of other substances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Substance.Instance\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A homogeneous material with a definite composition.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier associated with the package/container (usually a label affixed directly).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expiry\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount of the substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Substance.Ingredient\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A homogeneous material with a definite composition.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount of the ingredient in the substance - a concentration ratio.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Another substance that is a component of this substance.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"substanceCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"substanceReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"FHIRSubstanceStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"inactive\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Inactive</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"FHIRSubstanceStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A code to indicate if the substance is actively used.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"FHIRSubstanceStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substancenucleicacid.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource SubstanceNucleicAcid\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SubstanceNucleicAcid</sch:title>\n    <sch:rule context=\"f:SubstanceNucleicAcid\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceNucleicAcid/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceNucleicAcid/f:subunit/f:sequenceAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceNucleicAcid/f:subunit/f:linkage/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceNucleicAcid/f:subunit/f:linkage/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceNucleicAcid/f:subunit/f:sugar/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceNucleicAcid/f:subunit/f:sugar/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substancenucleicacid.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"SubstanceNucleicAcid\" type=\"SubstanceNucleicAcid\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"SubstanceNucleicAcid\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"sequenceType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the sequence shall be specified based on a controlled vocabulary.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numberOfSubunits\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The number of linear sequences of nucleotides linked through phosphodiester bonds shall be described. Subunits would be strands of nucleic acids that are tightly associated typically through Watson-Crick base pairing. NOTE: If not specified in the reference source, the assumption is that there is 1 subunit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"areaOfHybridisation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The area of hybridisation shall be described if applicable for double stranded RNA or DNA. The number associated with the subunit followed by the number associated to the residue shall be specified in increasing order. The underscore “” shall be used as separator as follows: “Subunitnumber Residue”.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"oligoNucleotideType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">(TBC).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subunit\" type=\"SubstanceNucleicAcid.Subunit\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Subunits are listed in order of decreasing length; sequences of the same length will be ordered by molecular weight; subunits that have identical sequences will be repeated multiple times.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceNucleicAcid.Subunit\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"subunit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Index of linear sequences of nucleic acids in order of decreasing length. Sequences of the same length will be ordered by molecular weight. Subunits that have identical sequences will be repeated and have sequential subscripts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Actual nucleotide sequence notation from 5' to 3' end using standard single letter codes. In addition to the base sequence, sugar and type of phosphate or non-phosphate linkage should also be captured.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"length\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The length of the sequence shall be captured.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sequenceAttachment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">(TBC).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fivePrime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The nucleotide present at the 5’ terminal shall be specified based on a controlled vocabulary. Since the sequence is represented from the 5' to the 3' end, the 5’ prime nucleotide is the letter at the first position in the sequence. A separate representation would be redundant.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"threePrime\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The nucleotide present at the 3’ terminal shall be specified based on a controlled vocabulary. Since the sequence is represented from the 5' to the 3' end, the 5’ prime nucleotide is the letter at the last position in the sequence. A separate representation would be redundant.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"linkage\" type=\"SubstanceNucleicAcid.Linkage\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The linkages between sugar residues will also be captured.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sugar\" type=\"SubstanceNucleicAcid.Sugar\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">5.3.6.8.1 Sugar ID (Mandatory).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceNucleicAcid.Linkage\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"connectivity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The entity that links the sugar residues together should also be captured for nearly all naturally occurring nucleic acid the linkage is a phosphate group. For many synthetic oligonucleotides phosphorothioate linkages are often seen. Linkage connectivity is assumed to be 3’-5’. If the linkage is either 3’-3’ or 5’-5’ this should be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Each linkage will be registered as a fragment and have an ID.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Each linkage will be registered as a fragment and have at least one name. A single name shall be assigned to each linkage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"residueSite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Residues shall be captured as described in 5.3.6.8.3.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceNucleicAcid.Sugar\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Nucleic acids are defined by three distinct elements: the base, sugar and linkage. Individual substance/moiety IDs will be created for each of these elements. The nucleotide sequence will be always entered in the 5’-3’ direction.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Substance ID of the sugar or sugar-like component that make up the nucleotide.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the sugar or sugar-like component that make up the nucleotide.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"residueSite\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The residues that contain a given sugar will be captured. The order of given residues will be captured in the 5‘-3‘direction consistent with the base sequences listed above.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substancepolymer.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource SubstancePolymer\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SubstancePolymer</sch:title>\n    <sch:rule context=\"f:SubstancePolymer\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:monomerSet/f:startingMaterial/f:amount/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:monomerSet/f:startingMaterial/f:amount/f:amountRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:monomerSet/f:startingMaterial/f:amount/f:amountRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:monomerSet/f:startingMaterial/f:amount/f:amountRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:monomerSet/f:startingMaterial/f:amount/f:referenceRange/f:lowLimit\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:monomerSet/f:startingMaterial/f:amount/f:referenceRange/f:highLimit\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:amount/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:amount/f:amountRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:amount/f:amountRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:amount/f:amountRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:amount/f:referenceRange/f:lowLimit\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:amount/f:referenceRange/f:highLimit\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:degreeOfPolymerisation/f:amount/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:degreeOfPolymerisation/f:amount/f:amountRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:degreeOfPolymerisation/f:amount/f:amountRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:degreeOfPolymerisation/f:amount/f:amountRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:degreeOfPolymerisation/f:amount/f:referenceRange/f:lowLimit\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:degreeOfPolymerisation/f:amount/f:referenceRange/f:highLimit\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstancePolymer/f:repeat/f:repeatUnit/f:structuralRepresentation/f:attachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substancepolymer.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"SubstancePolymer\" type=\"SubstancePolymer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"SubstancePolymer\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"class\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"geometry\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copolymerConnectivity\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"modification\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"monomerSet\" type=\"SubstancePolymer.MonomerSet\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"repeat\" type=\"SubstancePolymer.Repeat\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstancePolymer.MonomerSet\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"ratioType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"startingMaterial\" type=\"SubstancePolymer.StartingMaterial\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstancePolymer.StartingMaterial\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"material\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"isDefining\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SubstanceAmount\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstancePolymer.Repeat\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"numberOfUnits\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"averageMolecularFormula\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"repeatUnitAmountType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"repeatUnit\" type=\"SubstancePolymer.RepeatUnit\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstancePolymer.RepeatUnit\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"orientationOfPolymerisation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"repeatUnit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SubstanceAmount\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"degreeOfPolymerisation\" type=\"SubstancePolymer.DegreeOfPolymerisation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"structuralRepresentation\" type=\"SubstancePolymer.StructuralRepresentation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstancePolymer.DegreeOfPolymerisation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"degree\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SubstanceAmount\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstancePolymer.StructuralRepresentation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"representation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"attachment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substanceprotein.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource SubstanceProtein\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SubstanceProtein</sch:title>\n    <sch:rule context=\"f:SubstanceProtein\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceProtein/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceProtein/f:subunit/f:sequenceAttachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceProtein/f:subunit/f:nTerminalModificationId/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceProtein/f:subunit/f:nTerminalModificationId/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceProtein/f:subunit/f:cTerminalModificationId/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceProtein/f:subunit/f:cTerminalModificationId/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substanceprotein.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"SubstanceProtein\" type=\"SubstanceProtein\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"SubstanceProtein\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"sequenceType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The SubstanceProtein descriptive elements will only be used when a complete or partial amino acid sequence is available or derivable from a nucleic acid sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"numberOfSubunits\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Number of linear sequences of amino acids linked through peptide bonds. The number of subunits constituting the SubstanceProtein shall be described. It is possible that the number of subunits can be variable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"disulfideLinkage\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The disulphide bond between two cysteine residues either on the same subunit or on two different subunits shall be described. The position of the disulfide bonds in the SubstanceProtein shall be listed in increasing order of subunit number and position within subunit followed by the abbreviation of the amino acids involved. The disulfide linkage positions shall actually contain the amino acid Cysteine at the respective positions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subunit\" type=\"SubstanceProtein.Subunit\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This subclause refers to the description of each subunit constituting the SubstanceProtein. A subunit is a linear sequence of amino acids linked through peptide bonds. The Subunit information shall be provided when the finished SubstanceProtein is a complex of multiple sequences; subunits are not used to delineate domains within a single sequence. Subunits are listed in order of decreasing length; sequences of the same length will be ordered by decreasing molecular weight; subunits that have identical sequences will be repeated multiple times.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceProtein.Subunit\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A SubstanceProtein is defined as a single unit of a linear amino acid sequence, or a combination of subunits that are either covalently linked or have a defined invariant stoichiometric relationship. This includes all synthetic, recombinant and purified SubstanceProteins of defined sequence, whether the use is therapeutic or prophylactic. This set of elements will be used to describe albumins, coagulation factors, cytokines, growth factors, peptide/SubstanceProtein hormones, enzymes, toxins, toxoids, recombinant vaccines, and immunomodulators.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"subunit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Index of primary sequences of amino acids linked through peptide bonds in order of decreasing length. Sequences of the same length will be ordered by molecular weight. Subunits that have identical sequences will be repeated and have sequential subscripts.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sequence\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The sequence information shall be provided enumerating the amino acids from N- to C-terminal end using standard single-letter amino acid codes. Uppercase shall be used for L-amino acids and lowercase for D-amino acids. Transcribed SubstanceProteins will always be described using the translated sequence; for synthetic peptide containing amino acids that are not represented with a single letter code an X should be used within the sequence. The modified amino acids will be distinguished by their position in the sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"length\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Length of linear sequences of amino acids contained in the subunit.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sequenceAttachment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The sequence information shall be provided enumerating the amino acids from N- to C-terminal end using standard single-letter amino acid codes. Uppercase shall be used for L-amino acids and lowercase for D-amino acids. Transcribed SubstanceProteins will always be described using the translated sequence; for synthetic peptide containing amino acids that are not represented with a single letter code an X should be used within the sequence. The modified amino acids will be distinguished by their position in the sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"nTerminalModificationId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique identifier for molecular fragment modification based on the ISO 11238 Substance ID.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"nTerminalModification\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the fragment modified at the N-terminal of the SubstanceProtein shall be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cTerminalModificationId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Unique identifier for molecular fragment modification based on the ISO 11238 Substance ID.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cTerminalModification\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The modification at the C-terminal shall be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substancereferenceinformation.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource SubstanceReferenceInformation\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SubstanceReferenceInformation</sch:title>\n    <sch:rule context=\"f:SubstanceReferenceInformation\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:gene/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:gene/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:gene/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:geneElement/f:element/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:geneElement/f:element/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:geneElement/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:geneElement/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:geneElement/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:classification/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:classification/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:classification/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:target/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:target/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:amountRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:amountRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:amountRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceReferenceInformation/f:target/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substancereferenceinformation.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"SubstanceReferenceInformation\" type=\"SubstanceReferenceInformation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"SubstanceReferenceInformation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"gene\" type=\"SubstanceReferenceInformation.Gene\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"geneElement\" type=\"SubstanceReferenceInformation.GeneElement\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"classification\" type=\"SubstanceReferenceInformation.Classification\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"target\" type=\"SubstanceReferenceInformation.Target\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceReferenceInformation.Gene\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"geneSequenceOrigin\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"gene\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceReferenceInformation.GeneElement\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"element\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceReferenceInformation.Classification\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"domain\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"classification\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subtype\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceReferenceInformation.Target\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"target\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"interaction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"organism\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"organismType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"amountQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"amountRange\" type=\"Range\"/>\n            <xs:element name=\"amountString\" type=\"string\"/>\n          </xs:choice>\n          <xs:element name=\"amountType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Todo.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substancesourcematerial.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource SubstanceSourceMaterial\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SubstanceSourceMaterial</sch:title>\n    <sch:rule context=\"f:SubstanceSourceMaterial\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSourceMaterial/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSourceMaterial/f:organismId/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSourceMaterial/f:organismId/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSourceMaterial/f:parentSubstanceId/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSourceMaterial/f:parentSubstanceId/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substancesourcematerial.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"SubstanceSourceMaterial\" type=\"SubstanceSourceMaterial\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"SubstanceSourceMaterial\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"sourceMaterialClass\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">General high level classification of the source material specific to the origin of the material.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sourceMaterialType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the source material shall be specified based on a controlled vocabulary. For vaccines, this subclause refers to the class of infectious agent.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sourceMaterialState\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The state of the source material when extracted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"organismId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The unique identifier associated with the source material parent organism shall be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"organismName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The organism accepted Scientific name shall be provided based on the organism taxonomy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parentSubstanceId\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The parent of the herbal drug Ginkgo biloba, Leaf is the substance ID of the substance (fresh) of Ginkgo biloba L. or Ginkgo biloba L. (Whole plant).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parentSubstanceName\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The parent substance of the Herbal Drug, or Herbal preparation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"countryOfOrigin\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The country where the plant material is harvested or the countries where the plasma is sourced from as laid down in accordance with the Plasma Master File. For “Plasma-derived substances” the attribute country of origin provides information about the countries used for the manufacturing of the Cryopoor plama or Crioprecipitate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"geographicalLocation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The place/region where the plant is harvested or the places/regions where the animal source material has its habitat.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"developmentStage\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Stage of life for animals, plants, insects and microorganisms. This information shall be provided only when the substance is significantly different in these stages (e.g. foetal bovine serum).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fractionDescription\" type=\"SubstanceSourceMaterial.FractionDescription\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Many complex materials are fractions of parts of plants, animals, or minerals. Fraction elements are often necessary to define both Substances and Specified Group 1 Substances. For substances derived from Plants, fraction information will be captured at the Substance information level ( . Oils, Juices and Exudates). Additional information for Extracts, such as extraction solvent composition, will be captured at the Specified Substance Group 1 information level. For plasma-derived products fraction information will be captured at the Substance and the Specified Substance Group 1 levels.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"organism\" type=\"SubstanceSourceMaterial.Organism\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partDescription\" type=\"SubstanceSourceMaterial.PartDescription\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">To do.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSourceMaterial.FractionDescription\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"fraction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">This element is capturing information about the fraction of a plant part, or human plasma for fractionation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"materialType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific type of the material constituting the component. For Herbal preparations the particulars of the extracts (liquid/dry) is described in Specified Substance Group 1.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSourceMaterial.Organism\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"family\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The family of an organism shall be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"genus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The genus of an organism shall be specified; refers to the Latin epithet of the genus element of the plant/animal scientific name; it is present in names for genera, species and infraspecies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"species\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The species of an organism shall be specified; refers to the Latin epithet of the species of the plant/animal; it is present in names for species and infraspecies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intraspecificType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Intraspecific type of an organism shall be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intraspecificDescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The intraspecific description of an organism shall be specified based on a controlled vocabulary. For Influenza Vaccine, the intraspecific description shall contain the syntax of the antigen in line with the WHO convention.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"author\" type=\"SubstanceSourceMaterial.Author\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">4.9.13.6.1 Author type (Conditional).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"hybrid\" type=\"SubstanceSourceMaterial.Hybrid\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">4.9.13.8.1 Hybrid species maternal organism ID (Optional).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"organismGeneral\" type=\"SubstanceSourceMaterial.OrganismGeneral\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">4.9.13.7.1 Kingdom (Conditional).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSourceMaterial.Author\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"authorType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of author of an organism species shall be specified. The parenthetical author of an organism species refers to the first author who published the plant/animal name (of any rank). The primary author of an organism species refers to the first author(s), who validly published the plant/animal name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authorDescription\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The author of an organism species shall be specified. The author year of an organism shall also be specified when applicable; refers to the year in which the first author(s) published the infraspecific plant/animal name (of any rank).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSourceMaterial.Hybrid\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"maternalOrganismId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier of the maternal species constituting the hybrid organism shall be specified based on a controlled vocabulary. For plants, the parents aren’t always known, and it is unlikely that it will be known which is maternal and which is paternal.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"maternalOrganismName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the maternal species constituting the hybrid organism shall be specified. For plants, the parents aren’t always known, and it is unlikely that it will be known which is maternal and which is paternal.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"paternalOrganismId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier of the paternal species constituting the hybrid organism shall be specified based on a controlled vocabulary.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"paternalOrganismName\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the paternal species constituting the hybrid organism shall be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"hybridType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The hybrid type of an organism shall be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSourceMaterial.OrganismGeneral\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"kingdom\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kingdom of an organism shall be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"phylum\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The phylum of an organism shall be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"class\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The class of an organism shall be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"order\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The order of an organism shall be specified,.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSourceMaterial.PartDescription\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Source material shall capture information on the taxonomic and anatomical origins as well as the fraction of a material that can result in or can be modified to form a substance. This set of data elements shall be used to define polymer substances isolated from biological matrices. Taxonomic and anatomical origins shall be described using a controlled vocabulary as required. This information is captured for naturally derived polymers ( . starch) and structurally diverse substances. For Organisms belonging to the Kingdom Plantae the Substance level defines the fresh material of a single species or infraspecies, the Herbal Drug and the Herbal preparation. For Herbal preparations, the fraction information will be captured at the Substance information level and additional information for herbal extracts will be captured at the Specified Substance Group 1 information level. See for further explanation the Substance Class: Structurally Diverse and the herbal annex.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"part\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Entity of anatomical origin of source material within an organism.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partLocation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The detailed anatomic location when the part can be extracted from different anatomical locations of the organism. Multiple alternative locations may apply.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substancespecification.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource SubstanceSpecification\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SubstanceSpecification</sch:title>\n    <sch:rule context=\"f:SubstanceSpecification\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:moiety/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:moiety/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:moiety/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:property/f:definingSubstanceReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:property/f:definingSubstanceReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:property/f:definingSubstanceReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:property/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:referenceInformation\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:referenceInformation/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:referenceInformation/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:isotope/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:isotope/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:isotope/f:halfLife\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:isotope/f:molecularWeight/f:amount\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:structure/f:representation/f:attachment\">\n      <sch:assert test=\"not(exists(f:data)) or exists(f:contentType)\">att-1: If the Attachment has data, it SHALL have a contentType</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:code/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:code/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:code/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:substanceReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:substanceReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:substanceReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRatio\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRatio/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRatio/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRatioLowLimit\">\n      <sch:assert test=\"(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))\">rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRatioLowLimit/f:numerator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:amountRatioLowLimit/f:denominator\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:source\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:source/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:relationship/f:source/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:nucleicAcid\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:nucleicAcid/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:nucleicAcid/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:polymer\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:polymer/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:polymer/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:protein\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:protein/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:protein/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:sourceMaterial\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:sourceMaterial/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SubstanceSpecification/f:sourceMaterial/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/substancespecification.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"SubstanceSpecification\" type=\"SubstanceSpecification\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"SubstanceSpecification\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier by which this substance is known.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">High level categorization, e.g. polymer or nucleic acid.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Status of substance within the catalogue e.g. approved.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"domain\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the substance applies to only human or veterinary use.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Textual description of the substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Supporting literature.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Textual comment about this record of a substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"moiety\" type=\"SubstanceSpecification.Moiety\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Moiety, for structural modifications.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"property\" type=\"SubstanceSpecification.Property\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">General specifications for this substance, including how it is related to other substances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"referenceInformation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">General information detailing this substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"structure\" type=\"SubstanceSpecification.Structure\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Structural information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" type=\"SubstanceSpecification.Code\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Codes associated with the substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" type=\"SubstanceSpecification.Name\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Names applicable to this substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"molecularWeight\" type=\"SubstanceSpecification.MolecularWeight\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The molecular weight or weight range (for proteins, polymers or nucleic acids).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relationship\" type=\"SubstanceSpecification.Relationship\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A link between this substance and another, with details of the relationship.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"nucleicAcid\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Data items specific to nucleic acids.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"polymer\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Data items specific to polymers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"protein\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Data items specific to proteins.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sourceMaterial\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Material or taxonomic/anatomical source for the substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSpecification.Moiety\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"role\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Role that the moiety is playing.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier by which this moiety substance is known.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Textual name for this moiety substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"stereochemistry\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Stereochemistry type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"opticalActivity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Optical activity type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"molecularFormula\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Molecular formula.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Quantitative value for this moiety.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"amountQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"amountString\" type=\"string\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSpecification.Property\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A category for this property, e.g. Physical, Chemical, Enzymatic.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Property type e.g. viscosity, pH, isoelectric point.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parameters\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Parameters that were used in the measurement of a property (e.g. for viscosity: measured at 20C with a pH of 7.1).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A substance upon which a defining property depends (e.g. for solubility: in water, in alcohol).</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"definingSubstanceReference\" type=\"Reference\"/>\n            <xs:element name=\"definingSubstanceCodeableConcept\" type=\"CodeableConcept\"/>\n          </xs:choice>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Quantitative value for this property.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"amountQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"amountString\" type=\"string\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSpecification.Structure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"stereochemistry\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Stereochemistry type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"opticalActivity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Optical activity type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"molecularFormula\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Molecular formula.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"molecularFormulaByMoiety\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specified per moiety according to the Hill system, i.e. first C, then H, then alphabetical, each moiety separated by a dot.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"isotope\" type=\"SubstanceSpecification.Isotope\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Applicable for single substances that contain a radionuclide or a non-natural isotopic ratio.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"molecularWeight\" type=\"SubstanceSpecification.MolecularWeight\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The molecular weight or weight range (for proteins, polymers or nucleic acids).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Supporting literature.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"representation\" type=\"SubstanceSpecification.Representation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Molecular structural representation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSpecification.Isotope\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Substance identifier for each non-natural or radioisotope.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Substance name for each non-natural or radioisotope.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"substitution\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of isotopic substitution present in a single substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"halfLife\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Half life - for a non-natural nuclide.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"molecularWeight\" type=\"SubstanceSpecification.MolecularWeight\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The molecular weight or weight range (for proteins, polymers or nucleic acids).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSpecification.MolecularWeight\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The method by which the molecular weight was determined.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of molecular weight such as exact, average (also known as. number average), weight average.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amount\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Used to capture quantitative values for a variety of elements. If only limits are given, the arithmetic mean would be the average. If only a single definite value for a given element is given, it would be captured in this field.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSpecification.Representation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of structure (e.g. Full, Partial, Representative).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"representation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The structural representation as text string in a format e.g. InChI, SMILES, MOLFILE, CDX.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"attachment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Attachment\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An attached file with the structural representation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSpecification.Code\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The specific code.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Status of the code assignment.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date at which the code status is changed as part of the terminology maintenance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"comment\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Any comment can be provided in this field, if necessary.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Supporting literature.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSpecification.Name\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The actual name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"preferred\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If this is the preferred name for this substance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Language of the name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"domain\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The use context of this name for example if there is a different name a drug active ingredient as opposed to a food colour additive.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The jurisdiction where this name applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"synonym\" type=\"SubstanceSpecification.Name\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A synonym of this name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"translation\" type=\"SubstanceSpecification.Name\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A translation for this name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"official\" type=\"SubstanceSpecification.Official\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Details of the official nature of this name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Supporting literature.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSpecification.Official\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"authority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Which authority uses this official name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the official name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Date of official name change.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SubstanceSpecification.Relationship\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The detailed description of a substance, typically at a level beyond what is used for prescribing.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A pointer to another substance, as a resource or just a representational code.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"substanceReference\" type=\"Reference\"/>\n            <xs:element name=\"substanceCodeableConcept\" type=\"CodeableConcept\"/>\n          </xs:choice>\n          <xs:element name=\"relationship\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">For example &quot;salt to parent&quot;, &quot;active moiety&quot;, &quot;starting material&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"isDefining\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">For example where an enzyme strongly bonds with a particular substance, this is a defining relationship for that enzyme, out of several possible substance relationships.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A numeric factor for the relationship, for instance to express that the salt of a substance has some percentage of the active substance in relation to some other.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"amountQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"amountRange\" type=\"Range\"/>\n            <xs:element name=\"amountRatio\" type=\"Ratio\"/>\n            <xs:element name=\"amountString\" type=\"string\"/>\n          </xs:choice>\n          <xs:element name=\"amountRatioLowLimit\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Ratio\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">For use when the numeric.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"amountType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An operator for the amount, for example &quot;average&quot;, &quot;approximately&quot;, &quot;less than&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"source\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Supporting literature.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/supplydelivery.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource SupplyDelivery\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SupplyDelivery</sch:title>\n    <sch:rule context=\"f:SupplyDelivery\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:suppliedItem/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:suppliedItem/f:itemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:suppliedItem/f:itemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:suppliedItem/f:itemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrenceTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrenceTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrenceTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrenceTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrenceTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:occurrenceTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:supplier\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:supplier/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:supplier/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:destination\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:destination/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:destination/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:receiver\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:receiver/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyDelivery/f:receiver/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/supplydelivery.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"SupplyDelivery\" type=\"SupplyDelivery\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Record of delivery of what is supplied.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"SupplyDelivery\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Record of delivery of what is supplied.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for the supply delivery event that is used to identify it across multiple disparate systems.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A plan, proposal or order that is fulfilled in whole or in part by this event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A larger event of which this particular event is a component or step.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SupplyDeliveryStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code specifying the state of the dispense event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A link to a resource representing the person whom the delivered item is for.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"suppliedItem\" type=\"SupplyDelivery.SuppliedItem\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The item that is being delivered or has been supplied.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date or time(s) the activity occurred.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\n            <xs:element name=\"occurrenceTiming\" type=\"Timing\"/>\n          </xs:choice>\n          <xs:element name=\"supplier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual responsible for dispensing the medication, supplier or device.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"destination\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identification of the facility/location where the Supply was shipped to, as part of the dispense event.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"receiver\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the person who picked up the Supply.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SupplyDelivery.SuppliedItem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Record of delivery of what is supplied.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"quantity\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount of supply that has been dispensed. Includes unit of measure.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"itemCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"itemReference\" type=\"Reference\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SupplyDeliveryStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"in-progress\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Delivered</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"abandoned\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Abandoned</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered In Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SupplyDeliveryStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Status of the supply delivery.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"SupplyDeliveryStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/supplyrequest.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource SupplyRequest\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>SupplyRequest</sch:title>\n    <sch:rule context=\"f:SupplyRequest\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:itemReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:itemReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:itemReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:quantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:parameter/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:parameter/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:parameter/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:parameter/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrencePeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrenceTiming/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrenceTiming/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrenceTiming/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrenceTiming/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrenceTiming/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:occurrenceTiming/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:requester\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:requester/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:requester/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:supplier\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:supplier/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:supplier/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:deliverFrom\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:deliverFrom/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:deliverFrom/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:deliverTo\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:deliverTo/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:SupplyRequest/f:deliverTo/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/supplyrequest.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"SupplyRequest\" type=\"SupplyRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a request for a medication, substance or device used in the healthcare setting.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"SupplyRequest\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a request for a medication, substance or device used in the healthcare setting.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Business identifiers assigned to this SupplyRequest by the author and/or other systems. These identifiers remain constant as the resource is updated and propagates from server to server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"0\" maxOccurs=\"1\" type=\"SupplyRequestStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Status of the supply request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"category\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Category of supply, e.g.  central, non-stock, etc. This is used to support work flows associated with the supply process.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how quickly this SupplyRequest should be addressed with respect to other requests.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The item that is requested to be supplied. This is either a link to a resource representing the details of the item or a code that identifies the item from a known list.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"itemCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"itemReference\" type=\"Reference\"/>\n          </xs:choice>\n          <xs:element name=\"quantity\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The amount that is being ordered of the indicated item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parameter\" type=\"SupplyRequest.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specific parameters for the ordered item.  For example, the size of the indicated item.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the request should be fulfilled.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"occurrenceDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"occurrencePeriod\" type=\"Period\"/>\n            <xs:element name=\"occurrenceTiming\" type=\"Timing\"/>\n          </xs:choice>\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the request was made.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The device, practitioner, etc. who initiated the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"supplier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Who is intended to fulfill the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reason why the supply item was requested.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The reason why the supply item was requested.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"deliverFrom\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where the supply is expected to come from.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"deliverTo\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Where the supply is destined to go.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"SupplyRequest.Parameter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A record of a request for a medication, substance or device used in the healthcare setting.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code or string that identifies the device detail being asserted.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the device detail.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueRange\" type=\"Range\"/>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"SupplyRequestStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"draft\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"active\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Active</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"suspended\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Suspended</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"SupplyRequestStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Status of the supply request.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"SupplyRequestStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/task.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource Task\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Task</sch:title>\n    <sch:rule context=\"f:Task\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(exists(f:lastModified/@value)) or not(exists(f:authoredOn/@value)) or f:lastModified/@value &gt;= f:authoredOn/@value\">inv-1: Last modified date must be greater than or equal to authored-on date.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:basedOn\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:basedOn/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:basedOn/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:groupIdentifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:groupIdentifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:partOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:partOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:partOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:focus\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:focus/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:focus/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:for\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:for/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:for/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:executionPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:requester\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:requester/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:requester/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:owner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:owner/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:owner/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:location\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:location/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:location/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:reasonReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:reasonReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:reasonReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:insurance\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:insurance/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:insurance/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:relevantHistory\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:relevantHistory/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:relevantHistory/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:restriction/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:restriction/f:recipient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:restriction/f:recipient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:Task/f:restriction/f:recipient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/task.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"Task\" type=\"Task\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A task to be performed.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"Task\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A task to be performed.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The business identifier for this task.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesCanonical\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"instantiatesUri\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The URL pointing to an *externally* maintained  protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"basedOn\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">BasedOn refers to a higher-level authorization that triggered the creation of the task.  It references a &quot;request&quot; resource such as a ServiceRequest, MedicationRequest, ServiceRequest, CarePlan, etc. which is distinct from the &quot;request&quot; resource the task is seeking to fulfill.  This latter resource is referenced by FocusOn.  For example, based on a ServiceRequest (= BasedOn), a task is created to fulfill a procedureRequest ( = FocusOn ) to collect a specimen from a patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"groupIdentifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An identifier that links together multiple tasks and other requests that were created in the same context.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"partOf\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Task that this particular task is part of.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TaskStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The current status of the task.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusReason\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanation as to why this task is held, failed, was refused, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"businessStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contains business-specific nuances of the business state.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"intent\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TaskIntent\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the &quot;level&quot; of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"priority\" minOccurs=\"0\" maxOccurs=\"1\" type=\"RequestPriority\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates how quickly the Task should be addressed with respect to other requests.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A name or code (or both) briefly describing what the task involves.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free-text description of what is to be performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"focus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The request being actioned or the resource being manipulated by this task.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"for\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The entity who benefits from the performance of the service specified in the task (e.g., the patient).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The healthcare event  (e.g. a patient and healthcare provider interaction) during which this task was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"executionPeriod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"authoredOn\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date and time this task was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastModified\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date and time of last modification to this task.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The creator of the task.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"performerType\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of participant that should perform the task.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"owner\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Individual organization or Device currently responsible for task execution.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"location\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Principal physical location where the this task is performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A description or code indicating why this task needs to be performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"reasonReference\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A resource reference indicating why this task needs to be performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"insurance\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be relevant to the Task.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Free-text information captured about the task as it progresses.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"relevantHistory\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"restriction\" type=\"Task.Restriction\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"input\" type=\"Task.Input\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional information that may be needed in the execution of the task.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"output\" type=\"Task.Output\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Outputs produced by the Task.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Task.Restriction\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A task to be performed.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"repetitions\" minOccurs=\"0\" maxOccurs=\"1\" type=\"positiveInt\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Indicates the number of times the requested action should occur.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"period\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Period\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Over what time-period is fulfillment sought.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"recipient\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Task.Input\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A task to be performed.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code or description indicating how the input is intended to be used as part of the task execution.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the input parameter as a basic type.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueCanonical\" type=\"canonical\"/>\n            <xs:element name=\"valueCode\" type=\"code\"/>\n            <xs:element name=\"valueDate\" type=\"date\"/>\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\n            <xs:element name=\"valueId\" type=\"id\"/>\n            <xs:element name=\"valueInstant\" type=\"instant\"/>\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\n            <xs:element name=\"valueMarkdown\" type=\"markdown\"/>\n            <xs:element name=\"valueOid\" type=\"oid\"/>\n            <xs:element name=\"valuePositiveInt\" type=\"positiveInt\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueTime\" type=\"time\"/>\n            <xs:element name=\"valueUnsignedInt\" type=\"unsignedInt\"/>\n            <xs:element name=\"valueUri\" type=\"uri\"/>\n            <xs:element name=\"valueUrl\" type=\"url\"/>\n            <xs:element name=\"valueUuid\" type=\"uuid\"/>\n            <xs:element name=\"valueAddress\" type=\"Address\"/>\n            <xs:element name=\"valueAge\" type=\"Age\"/>\n            <xs:element name=\"valueAnnotation\" type=\"Annotation\"/>\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\n            <xs:element name=\"valueContactPoint\" type=\"ContactPoint\"/>\n            <xs:element name=\"valueCount\" type=\"Count\"/>\n            <xs:element name=\"valueDistance\" type=\"Distance\"/>\n            <xs:element name=\"valueDuration\" type=\"Duration\"/>\n            <xs:element name=\"valueHumanName\" type=\"HumanName\"/>\n            <xs:element name=\"valueIdentifier\" type=\"Identifier\"/>\n            <xs:element name=\"valueMoney\" type=\"Money\"/>\n            <xs:element name=\"valuePeriod\" type=\"Period\"/>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueRange\" type=\"Range\"/>\n            <xs:element name=\"valueRatio\" type=\"Ratio\"/>\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\n            <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\n            <xs:element name=\"valueSignature\" type=\"Signature\"/>\n            <xs:element name=\"valueTiming\" type=\"Timing\"/>\n            <xs:element name=\"valueContactDetail\" type=\"ContactDetail\"/>\n            <xs:element name=\"valueContributor\" type=\"Contributor\"/>\n            <xs:element name=\"valueDataRequirement\" type=\"DataRequirement\"/>\n            <xs:element name=\"valueExpression\" type=\"Expression\"/>\n            <xs:element name=\"valueParameterDefinition\" type=\"ParameterDefinition\"/>\n            <xs:element name=\"valueRelatedArtifact\" type=\"RelatedArtifact\"/>\n            <xs:element name=\"valueTriggerDefinition\" type=\"TriggerDefinition\"/>\n            <xs:element name=\"valueUsageContext\" type=\"UsageContext\"/>\n            <xs:element name=\"valueDosage\" type=\"Dosage\"/>\n            <xs:element name=\"valueMeta\" type=\"Meta\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"Task.Output\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A task to be performed.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the Output parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"1\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the Output parameter as a basic type.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueBase64Binary\" type=\"base64Binary\"/>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueCanonical\" type=\"canonical\"/>\n            <xs:element name=\"valueCode\" type=\"code\"/>\n            <xs:element name=\"valueDate\" type=\"date\"/>\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\n            <xs:element name=\"valueId\" type=\"id\"/>\n            <xs:element name=\"valueInstant\" type=\"instant\"/>\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\n            <xs:element name=\"valueMarkdown\" type=\"markdown\"/>\n            <xs:element name=\"valueOid\" type=\"oid\"/>\n            <xs:element name=\"valuePositiveInt\" type=\"positiveInt\"/>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueTime\" type=\"time\"/>\n            <xs:element name=\"valueUnsignedInt\" type=\"unsignedInt\"/>\n            <xs:element name=\"valueUri\" type=\"uri\"/>\n            <xs:element name=\"valueUrl\" type=\"url\"/>\n            <xs:element name=\"valueUuid\" type=\"uuid\"/>\n            <xs:element name=\"valueAddress\" type=\"Address\"/>\n            <xs:element name=\"valueAge\" type=\"Age\"/>\n            <xs:element name=\"valueAnnotation\" type=\"Annotation\"/>\n            <xs:element name=\"valueAttachment\" type=\"Attachment\"/>\n            <xs:element name=\"valueCodeableConcept\" type=\"CodeableConcept\"/>\n            <xs:element name=\"valueCoding\" type=\"Coding\"/>\n            <xs:element name=\"valueContactPoint\" type=\"ContactPoint\"/>\n            <xs:element name=\"valueCount\" type=\"Count\"/>\n            <xs:element name=\"valueDistance\" type=\"Distance\"/>\n            <xs:element name=\"valueDuration\" type=\"Duration\"/>\n            <xs:element name=\"valueHumanName\" type=\"HumanName\"/>\n            <xs:element name=\"valueIdentifier\" type=\"Identifier\"/>\n            <xs:element name=\"valueMoney\" type=\"Money\"/>\n            <xs:element name=\"valuePeriod\" type=\"Period\"/>\n            <xs:element name=\"valueQuantity\" type=\"Quantity\"/>\n            <xs:element name=\"valueRange\" type=\"Range\"/>\n            <xs:element name=\"valueRatio\" type=\"Ratio\"/>\n            <xs:element name=\"valueReference\" type=\"Reference\"/>\n            <xs:element name=\"valueSampledData\" type=\"SampledData\"/>\n            <xs:element name=\"valueSignature\" type=\"Signature\"/>\n            <xs:element name=\"valueTiming\" type=\"Timing\"/>\n            <xs:element name=\"valueContactDetail\" type=\"ContactDetail\"/>\n            <xs:element name=\"valueContributor\" type=\"Contributor\"/>\n            <xs:element name=\"valueDataRequirement\" type=\"DataRequirement\"/>\n            <xs:element name=\"valueExpression\" type=\"Expression\"/>\n            <xs:element name=\"valueParameterDefinition\" type=\"ParameterDefinition\"/>\n            <xs:element name=\"valueRelatedArtifact\" type=\"RelatedArtifact\"/>\n            <xs:element name=\"valueTriggerDefinition\" type=\"TriggerDefinition\"/>\n            <xs:element name=\"valueUsageContext\" type=\"UsageContext\"/>\n            <xs:element name=\"valueDosage\" type=\"Dosage\"/>\n            <xs:element name=\"valueMeta\" type=\"Meta\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"TaskStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"draft\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Draft</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"requested\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Requested</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"received\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Received</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"accepted\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Accepted</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"rejected\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Rejected</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"ready\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Ready</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"cancelled\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Cancelled</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"in-progress\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"on-hold\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">On Hold</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"failed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Failed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered in Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"TaskStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The current status of the task.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"TaskStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"TaskIntent-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"unknown\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Unknown</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"proposal\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Proposal</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"plan\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Plan</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"original-order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Original Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"reflex-order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Reflex Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"filler-order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Filler Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"instance-order\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Instance Order</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"option\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Option</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"TaskIntent\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Distinguishes whether the task is a proposal, plan or full order.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"TaskIntent-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/terminologycapabilities.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource TerminologyCapabilities\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>TerminologyCapabilities</sch:title>\n    <sch:rule context=\"f:TerminologyCapabilities\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='instance') or exists(f:implementation)\">tcp-3: If kind = instance, implementation must be present and software may be present</sch:assert>\n      <sch:assert test=\"count(f:software | f:implementation | f:description) &gt; 0\">tcp-2: A Capability Statement SHALL have at least one of description, software, or implementation element.</sch:assert>\n      <sch:assert test=\"not(f:kind/@value='instance') or (not(exists(f:implementation)) and not(exists(f:software)))\">tcp-5: If kind = requirements, implementation and software must be absent</sch:assert>\n      <sch:assert test=\" not(f:kind/@value='instance') or (not(exists(f:implementation)) and exists(f:software))\">tcp-4: If kind = capability, implementation must be absent, software must be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TerminologyCapabilities/f:codeSystem\">\n      <sch:assert test=\"(count(f:version) &lt;= 1) or not(exists(f:version[not(f:code)]))\">tcp-1: If there is more than one version, a version code must be defined</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/terminologycapabilities.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"TerminologyCapabilities\" type=\"TerminologyCapabilities\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"TerminologyCapabilities\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this terminology capabilities when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this terminology capabilities is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the terminology capabilities is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the terminology capabilities when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the terminology capabilities author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the terminology capabilities. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the terminology capabilities.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this terminology capabilities. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this terminology capabilities is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the terminology capabilities was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the terminology capabilities changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the terminology capabilities.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the terminology capabilities from a consumer's perspective. Typically, this is used when the capability statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate terminology capabilities instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the terminology capabilities is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this terminology capabilities is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the terminology capabilities and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the terminology capabilities.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"kind\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CapabilityStatementKind\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind, not instance of software) or a class of implementation (e.g. a desired purchase).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"software\" type=\"TerminologyCapabilities.Software\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Software that is covered by this terminology capability statement.  It is used when the statement describes the capabilities of a particular software version, independent of an installation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"implementation\" type=\"TerminologyCapabilities.Implementation\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies a specific implementation instance that is described by the terminology capability statement - i.e. a particular installation, rather than the capabilities of a software program.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lockedDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the server supports lockedDate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"codeSystem\" type=\"TerminologyCapabilities.CodeSystem\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies a code system that is supported by the server. If there is a no code system URL, then this declares the general assumptions a client can make about support for any CodeSystem resource.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expansion\" type=\"TerminologyCapabilities.Expansion\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the [ValueSet/$expand](valueset-operation-expand.html) operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"codeSearch\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeSearchSupport\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The degree to which the server supports the code search parameter on ValueSet, if it is supported.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validateCode\" type=\"TerminologyCapabilities.ValidateCode\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the [ValueSet/$validate-code](valueset-operation-validate-code.html) operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"translation\" type=\"TerminologyCapabilities.Translation\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the [ConceptMap/$translate](conceptmap-operation-translate.html) operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"closure\" type=\"TerminologyCapabilities.Closure\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the $closure operation is supported.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TerminologyCapabilities.Software\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name the software is known by.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version identifier for the software covered by this statement.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TerminologyCapabilities.Implementation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"description\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the specific installation that this terminology capability statement relates to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"url\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute base URL for the implementation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TerminologyCapabilities.CodeSystem\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"uri\" minOccurs=\"0\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">URI for the Code System.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" type=\"TerminologyCapabilities.Version\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">For the code system, a list of versions that are supported by the server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"subsumption\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">True if subsumption is supported for this version of the code system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TerminologyCapabilities.Version\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">For version-less code systems, there should be a single version with no identifier.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"isDefault\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If this is the default version for this code system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"compositional\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the compositional grammar defined by the code system is supported.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Language Displays supported.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"filter\" type=\"TerminologyCapabilities.Filter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Filter Properties supported.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"property\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Properties supported for $lookup.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TerminologyCapabilities.Filter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Code of the property supported.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"op\" minOccurs=\"1\" maxOccurs=\"unbounded\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Operations supported for the property.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TerminologyCapabilities.Expansion\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"hierarchical\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the server can return nested value sets.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"paging\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the server supports paging on expansion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"incomplete\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Allow request for incomplete expansions?</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parameter\" type=\"TerminologyCapabilities.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Supported expansion parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"textFilter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Documentation about text searching works.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TerminologyCapabilities.Parameter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Expansion Parameter name.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"documentation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of support for parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TerminologyCapabilities.ValidateCode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"translations\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether translations are validated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TerminologyCapabilities.Translation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"needsMap\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether the client must identify the map.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TerminologyCapabilities.Closure\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A TerminologyCapabilities resource documents a set of capabilities (behaviors) of a FHIR Terminology Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"translation\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If cross-system closure is supported.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"CodeSearchSupport-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"explicit\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Explicit Codes</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"all\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Implicit Codes</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"CodeSearchSupport\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The degree to which the server supports the code search parameter on ValueSet, if it is supported.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"CodeSearchSupport-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/testreport.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource TestReport\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>TestReport</sch:title>\n    <sch:rule context=\"f:TestReport\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:testScript\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:testScript/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:testScript/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:setup/f:action\">\n      <sch:assert test=\"(f:operation or f:assert) and not(f:operation and f:assert)\">inv-1: Setup action SHALL contain either an operation or assert but not both.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestReport/f:test/f:action\">\n      <sch:assert test=\"(f:operation or f:assert) and not(f:operation and f:assert)\">inv-2: Test action SHALL contain either an operation or assert but not both.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/testreport.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"TestReport\" type=\"TestReport\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"TestReport\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifier for the TestScript assigned for external purposes outside the context of FHIR.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language name identifying the executed TestScript.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TestReportStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The current state of this test report.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"testScript\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Ideally this is an absolute URL that is used to identify the version-specific TestScript that was executed, matching the `TestScript.url`.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"result\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TestReportResult\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The overall result from the execution of the TestScript.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"score\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The final score (percentage of tests passed) resulting from the execution of the TestScript.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"tester\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name of the tester producing this report (Organization or individual).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"issued\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the TestScript was executed and this TestReport was generated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"participant\" type=\"TestReport.Participant\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A participant in the test execution, either the execution engine, a client, or a server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"setup\" type=\"TestReport.Setup\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The results of the series of required setup operations before the tests were executed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"test\" type=\"TestReport.Test\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A test executed from the test script.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"teardown\" type=\"TestReport.Teardown\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The results of the series of operations required to clean up after all the tests were executed (successfully or otherwise).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestReport.Participant\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TestReportParticipantType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of participant.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"uri\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The uri of the participant. An absolute URL is preferred.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The display name of the participant.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestReport.Setup\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"action\" type=\"TestReport.Action\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Action would contain either an operation or an assertion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestReport.Action\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"operation\" type=\"TestReport.Operation\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The operation performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"assert\" type=\"TestReport.Assert\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The results of the assertion performed on the previous operations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestReport.Operation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"result\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TestReportActionResult\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The result of this operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"message\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanatory message associated with the result.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A link to further details on the result.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestReport.Assert\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"result\" minOccurs=\"1\" maxOccurs=\"1\" type=\"TestReportActionResult\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The result of this assertion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"message\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An explanatory message associated with the result.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"detail\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A link to further details on the result.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestReport.Test\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of this test used for tracking/logging purposes by test engines.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short description of the test used by test engines for tracking and reporting purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"action\" type=\"TestReport.Action1\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Action would contain either an operation or an assertion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestReport.Action1\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"operation\" type=\"TestReport.Operation\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An operation would involve a REST request to a server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"assert\" type=\"TestReport.Assert\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The results of the assertion performed on the previous operations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestReport.Teardown\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"action\" type=\"TestReport.Action2\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The teardown action will only contain an operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestReport.Action2\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A summary of information based on the results of executing a TestScript.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"operation\" type=\"TestReport.Operation\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An operation would involve a REST request to a server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"TestReportStatus-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"completed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Completed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"in-progress\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In Progress</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"waiting\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Waiting</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"stopped\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Stopped</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"entered-in-error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Entered In Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"TestReportStatus\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The current status of the test report.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"TestReportStatus-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"TestReportActionResult-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"pass\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Pass</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"skip\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Skip</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"fail\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Fail</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"warning\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Warning</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"error\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Error</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"TestReportActionResult\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The results of executing an action.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"TestReportActionResult-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"TestReportParticipantType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"test-engine\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Test Engine</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"client\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Client</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"server\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Server</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"TestReportParticipantType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of participant.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"TestReportParticipantType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"TestReportResult-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"pass\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Pass</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"fail\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Fail</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"pending\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Pending</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"TestReportResult\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The reported execution result.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"TestReportResult-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/testscript.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource TestScript\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>TestScript</sch:title>\n    <sch:rule context=\"f:TestScript\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:metadata\">\n      <sch:assert test=\"f:capability/f:required or f:capability/f:validated or (f:capability/f:required and f:capability/f:validated)\">tst-4: TestScript metadata capability SHALL contain required or validated or both.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:fixture/f:resource\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:fixture/f:resource/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:fixture/f:resource/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:profile\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:profile/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:profile/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:variable\">\n      <sch:assert test=\"not(f:expression and f:headerField and f:path)\">tst-3: Variable can only contain one of expression, headerField or path.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:setup/f:action\">\n      <sch:assert test=\"(f:operation or f:assert) and not(f:operation and f:assert)\">tst-1: Setup action SHALL contain either an operation or assert but not both.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:setup/f:action/f:operation\">\n      <sch:assert test=\"f:sourceId or ((f:targetId or f:url or f:params) and (count(f:targetId) + count(f:url) + count(f:params) =1)) or (f:type/f:code/@value='capabilities' or f:type/f:code/@value='search' or f:type/f:code/@value='transaction' or f:type/f:code/@value='history')\">tst-7: Setup operation SHALL contain either sourceId or targetId or params or url.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:setup/f:action/f:assert\">\n      <sch:assert test=\"((count(f:response) + count(f:responseCode)) = 0 and (f:direction/@value='request')) or (count(f:direction) = 0) or (f:direction/@value='response')\">tst-12: Setup action assert response and responseCode SHALL be empty when direction equals request</sch:assert>\n      <sch:assert test=\"count(f:contentType) + count(f:expression) + count(f:headerField) + count(f:minimumId) + count(f:navigationLinks) + count(f:path) + count(f:requestMethod) + count(f:resource) + count(f:responseCode) + count(f:response) + count(f:rule) + count(f:ruleset) + count(f:validateProfileId)  &lt;=1\">tst-5: Only a single assertion SHALL be present within setup action assert element.</sch:assert>\n      <sch:assert test=\"(f:compareToSourceId and f:compareToSourceExpression) or (f:compareToSourceId and f:compareToSourcePath) or not(f:compareToSourceId or f:compareToSourceExpression or f:compareToSourcePath)\">tst-10: Setup action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:test/f:action\">\n      <sch:assert test=\"(f:operation or f:assert) and not(f:operation and f:assert)\">tst-2: Test action SHALL contain either an operation or assert but not both.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:test/f:action/f:operation\">\n      <sch:assert test=\"f:sourceId or (f:targetId or f:url or f:params) and (count(f:targetId) + count(f:url) + count(f:params) =1) or (f:type/f:code/@value='capabilities' or f:type/f:code/@value='search' or f:type/f:code/@value='transaction' or f:type/f:code/@value='history')\">tst-8: Test operation SHALL contain either sourceId or targetId or params or url.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:test/f:action/f:assert\">\n      <sch:assert test=\"(f:compareToSourceId and f:compareToSourceExpression) or (f:compareToSourceId and f:compareToSourcePath) or not(f:compareToSourceId or f:compareToSourceExpression or f:compareToSourcePath)\">tst-11: Test action assert SHALL contain either compareToSourceId and compareToSourceExpression, compareToSourceId and compareToSourcePath or neither.</sch:assert>\n      <sch:assert test=\"((count(f:response) + count(f:responseCode)) = 0 and (f:direction/@value='request')) or (count(f:direction) = 0) or (f:direction/@value='response')\">tst-13: Test action assert response and response and responseCode SHALL be empty when direction equals request</sch:assert>\n      <sch:assert test=\"count(f:contentType) + count(f:expression) + count(f:headerField) + count(f:minimumId) + count(f:navigationLinks) + count(f:path) + count(f:requestMethod) + count(f:resource) + count(f:responseCode) + count(f:response) + count(f:rule) + count(f:ruleset) + count(f:validateProfileId)  &lt;=1\">tst-6: Only a single assertion SHALL be present within test action assert element.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:TestScript/f:teardown/f:action/f:operation\">\n      <sch:assert test=\"f:sourceId or (f:targetId or f:url or (f:params and f:resource)) and (count(f:targetId) + count(f:url) + count(f:params) =1) or (f:type/f:code/@value='capabilities' or f:type/f:code/@value='search' or f:type/f:code/@value='transaction' or f:type/f:code/@value='history')\">tst-9: Teardown operation SHALL contain either sourceId or targetId or params or url.</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/testscript.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"TestScript\" type=\"TestScript\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"TestScript\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this test script when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this test script is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the test script is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this test script when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the test script when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the test script author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the test script. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the test script.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this test script. Enables tracking the life-cycle of the content.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this test script is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date  (and optionally time) when the test script was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the test script changes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the test script.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the test script from a consumer's perspective.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate test script instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the test script is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this test script is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the test script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the test script.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"origin\" type=\"TestScript.Origin\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An abstract server used in operations within this test script in the origin element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"destination\" type=\"TestScript.Destination\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An abstract server used in operations within this test script in the destination element.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"metadata\" type=\"TestScript.Metadata\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The required capability must exist and are assumed to function correctly on the FHIR server being tested.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"fixture\" type=\"TestScript.Fixture\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the profile to be used for validation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"variable\" type=\"TestScript.Variable\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Variable is set based either on element value in response body or on header field value in the response headers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"setup\" type=\"TestScript.Setup\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A series of required setup operations before tests are executed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"test\" type=\"TestScript.Test\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A test in this script.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"teardown\" type=\"TestScript.Teardown\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A series of operations required to clean up after all the tests are executed (successfully or otherwise).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Origin\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"index\" minOccurs=\"1\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Abstract name given to an origin server in this test script.  The name is provided as a number starting at 1.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of origin profile the test system supports.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Destination\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"index\" minOccurs=\"1\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Abstract name given to a destination server in this test script.  The name is provided as a number starting at 1.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"profile\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of destination profile the test system supports.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Metadata\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"link\" type=\"TestScript.Link\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A link to the FHIR specification that this test is covering.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"capability\" type=\"TestScript.Capability\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Link\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"1\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">URL to a particular requirement or feature within the FHIR specification.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Short description of the link.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Capability\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"required\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validated\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Description of the capabilities that this test script is requiring the server to support.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"origin\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Which origin server these requirements apply to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"destination\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Which server these requirements apply to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"link\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Links to the FHIR specification that describes this interaction and the resources involved in more detail.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"capabilities\" minOccurs=\"1\" maxOccurs=\"1\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Minimum capabilities required of server for test script to execute successfully.   If server does not meet at a minimum the referenced capability statement, then all tests in this script are skipped.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Fixture\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"autocreate\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"autodelete\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether or not to implicitly delete the fixture during teardown. If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the resource (containing the contents of the resource needed for operations).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Variable\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Descriptive name for this variable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"defaultValue\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A default, hard-coded, or user-defined value for this variable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the variable and its purpose.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The FHIRPath expression to evaluate against the fixture body. When variables are defined, only one of either expression, headerField or path must be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"headerField\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"hint\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Displayable text string with hint help information to the user when entering a default value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"path\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">XPath or JSONPath to evaluate against the fixture body.  When variables are defined, only one of either expression, headerField or path must be specified.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sourceId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Fixture to evaluate the XPath/JSONPath expression or the headerField  against within this variable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Setup\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"action\" type=\"TestScript.Action\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Action would contain either an operation or an assertion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Action\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"operation\" type=\"TestScript.Operation\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The operation to perform.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"assert\" type=\"TestScript.Assert\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Evaluates the results of previous operations to determine if the server under test behaves appropriately.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Operation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Server interaction or operation type.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the resource.  See http://build.fhir.org/resourcelist.html.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"label\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The label would be used for tracking/logging purposes by test engines.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The description would be used by test engines for tracking and reporting purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"accept\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The mime-type to use for RESTful operation in the 'Accept' header.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contentType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The mime-type to use for RESTful operation in the 'Content-Type' header.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"destination\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The server where the request message is destined for.  Must be one of the server numbers listed in TestScript.destination section.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encodeRequestUrl\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"method\" minOccurs=\"0\" maxOccurs=\"1\" type=\"TestScriptRequestMethodCode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The HTTP method the test engine MUST use for this operation regardless of any other operation details.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"origin\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The server where the request message originates from.  Must be one of the server numbers listed in TestScript.origin section.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"params\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Path plus parameters after [type].  Used to set parts of the request URL explicitly.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requestHeader\" type=\"TestScript.RequestHeader\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Header elements would be used to set HTTP headers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requestId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The fixture id (maybe new) to map to the request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"responseId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The fixture id (maybe new) to map to the response.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sourceId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The id of the fixture used as the body of a PUT or POST request.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"targetId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id of fixture used for extracting the [id],  [type], and [vid] for GET requests.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Complete request URL.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.RequestHeader\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"field\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The HTTP header field e.g. &quot;Accept&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the header e.g. &quot;application/fhir+xml&quot;.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Assert\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"label\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The label would be used for tracking/logging purposes by test engines.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The description would be used by test engines for tracking and reporting purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"direction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AssertionDirectionType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The direction to use for the assertion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"compareToSourceId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Id of the source fixture used as the contents to be evaluated by either the &quot;source/expression&quot; or &quot;sourceId/path&quot; definition.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"compareToSourceExpression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The FHIRPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"compareToSourcePath\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">XPath or JSONPath expression to evaluate against the source fixture. When compareToSourceId is defined, either compareToSourceExpression or compareToSourcePath must be defined, but not both.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contentType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The mime-type contents to compare against the request or response message 'Content-Type' header.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expression\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The FHIRPath expression to be evaluated against the request or response message contents - HTTP headers and payload.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"headerField\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The HTTP header field name e.g. 'Location'.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"minimumId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The ID of a fixture.  Asserts that the response contains at a minimum the fixture specified by minimumId.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"navigationLinks\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether or not the test execution performs validation on the bundle navigation links.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"operator\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AssertionOperatorType\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The operator type defines the conditional behavior of the assert. If not defined, the default is equals.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"path\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requestMethod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"TestScriptRequestMethodCode\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The request method or HTTP operation code to compare against that used by the client system under test.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"requestURL\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value to use in a comparison against the request URL path string.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"resource\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The type of the resource.  See http://build.fhir.org/resourcelist.html.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"response\" minOccurs=\"0\" maxOccurs=\"1\" type=\"AssertionResponseTypes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"responseCode\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the HTTP response code to be tested.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sourceId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Fixture to evaluate the XPath/JSONPath expression or the headerField  against.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validateProfileId\" minOccurs=\"0\" maxOccurs=\"1\" type=\"id\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The ID of the Profile to validate against.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value to compare to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"warningOnly\" minOccurs=\"1\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether or not the test execution will produce a warning only on error for this assert.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Test\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of this test used for tracking/logging purposes by test engines.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short description of the test used by test engines for tracking and reporting purposes.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"action\" type=\"TestScript.Action1\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Action would contain either an operation or an assertion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Action1\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"operation\" type=\"TestScript.Operation\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An operation would involve a REST request to a server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"assert\" type=\"TestScript.Assert\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Evaluates the results of previous operations to determine if the server under test behaves appropriately.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Teardown\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"action\" type=\"TestScript.Action2\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The teardown action will only contain an operation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"TestScript.Action2\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A structured set of tests against a FHIR server or client implementation to determine compliance against the FHIR specification.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"operation\" type=\"TestScript.Operation\" minOccurs=\"1\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An operation would involve a REST request to a server.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AssertionDirectionType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"response\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">response</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"request\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">request</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AssertionDirectionType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of direction to use for assertion.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AssertionDirectionType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AssertionOperatorType-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"equals\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">equals</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"notEquals\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">notEquals</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"in\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">in</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"notIn\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">notIn</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"greaterThan\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">greaterThan</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"lessThan\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">lessThan</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"empty\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">empty</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"notEmpty\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">notEmpty</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"contains\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">contains</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"notContains\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">notContains</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"eval\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">evaluate</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AssertionOperatorType\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of operator to use for assertion.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AssertionOperatorType-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"AssertionResponseTypes-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"okay\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">okay</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"created\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">created</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"noContent\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">noContent</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"notModified\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">notModified</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"bad\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">bad</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"forbidden\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">forbidden</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"notFound\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">notFound</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"methodNotAllowed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">methodNotAllowed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"conflict\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">conflict</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"gone\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">gone</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"preconditionFailed\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">preconditionFailed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"unprocessable\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">unprocessable</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"AssertionResponseTypes\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The type of response code to use for assertion.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"AssertionResponseTypes-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"TestScriptRequestMethodCode-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"delete\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">DELETE</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"get\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">GET</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"options\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">OPTIONS</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"patch\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PATCH</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"post\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">POST</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"put\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">PUT</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"head\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">HEAD</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"TestScriptRequestMethodCode\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The allowable request method or HTTP operation codes.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"TestScriptRequestMethodCode-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/valueset.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource ValueSet\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>ValueSet</sch:title>\n    <sch:rule context=\"f:ValueSet\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:contact/f:telecom\">\n      <sch:assert test=\"not(exists(f:value)) or exists(f:system)\">cpt-2: A system is required if a value is provided.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:contact/f:telecom/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueQuantity\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:useContext/f:valueReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:compose/f:include\">\n      <sch:assert test=\"not(exists(f:concept) or exists(f:filter)) or exists(f:system)\">vsd-2: A value set with concepts or filters SHALL include a system</sch:assert>\n      <sch:assert test=\"not(exists(f:concept)) or not(exists(f:filter))\">vsd-3: Cannot have both concept and filter</sch:assert>\n      <sch:assert test=\"exists(f:valueSet) or exists(f:system)\">vsd-1: A value set include/exclude SHALL have a value set or a system</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:ValueSet/f:expansion//f:contains\">\n      <sch:assert test=\"exists(f:code) or exists(f:display)\">vsd-6: SHALL have a code or a display</sch:assert>\n      <sch:assert test=\"exists(f:code) or (f:abstract/@value = true())\">vsd-9: Must have a code if not abstract</sch:assert>\n      <sch:assert test=\"exists(f:system) or not(exists(f:code))\">vsd-10: Must have a system if a code is present</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/valueset.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"ValueSet\" type=\"ValueSet\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"ValueSet\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"url\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI that is used to identify this value set when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this value set is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the value set is stored on different servers.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the value set author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"name\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A natural language name identifying the value set. This name should be usable as an identifier for the module by machine processing applications such as code generation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"title\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A short, descriptive, user-friendly title for the value set.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"PublicationStatus\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of this value set. Enables tracking the life-cycle of the content. The status of the value set applies to the value set definition (ValueSet.compose) and the associated ValueSet metadata. Expansions do not have a state.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"experimental\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A Boolean value to indicate that this value set is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usage.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date (and optionally time) when the value set was created or revised (e.g. the 'content logical definition').</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"publisher\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The name of the organization or individual that published the value set.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contact\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"ContactDetail\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact details to assist a user in finding and communicating with the publisher.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"description\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A free text natural language description of the value set from a consumer's perspective. The textual description specifies the span of meanings for concepts to be included within the Value Set Expansion, and also may specify the intended use and limitations of the Value Set.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"useContext\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"UsageContext\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate value set instances.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"jurisdiction\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A legal or geographic region in which the value set is intended to be used.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"immutable\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If this is set to 'true', then no new versions of the content logical definition can be created.  Note: Other metadata might still change.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"purpose\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Explanation of why this value set is needed and why it has been designed as it has.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"copyright\" minOccurs=\"0\" maxOccurs=\"1\" type=\"markdown\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"compose\" type=\"ValueSet.Compose\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A set of criteria that define the contents of the value set by including or excluding codes selected from the specified code system(s) that the value set draws from. This is also known as the Content Logical Definition (CLD).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"expansion\" type=\"ValueSet.Expansion\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A value set can also be &quot;expanded&quot;, where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ValueSet.Compose\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"lockedDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The Locked Date is  the effective date that is used to determine the version of all referenced Code Systems and Value Set Definitions included in the compose that are not already tied to a specific version.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"inactive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Whether inactive codes - codes that are not approved for current use - are in the value set. If inactive = true, inactive codes are to be included in the expansion, if inactive = false, the inactive codes will not be included in the expansion. If absent, the behavior is determined by the implementation, or by the applicable $expand parameters (but generally, inactive codes would be expected to be included).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"include\" type=\"ValueSet.Include\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Include one or more codes from a code system or other value set(s).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"exclude\" type=\"ValueSet.Include\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Exclude one or more codes from the value set based on code system filters and/or other value sets.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ValueSet.Include\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"system\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI which is the code system from which the selected codes come from.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version of the code system that the codes are selected from, or the special version '*' for all versions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"concept\" type=\"ValueSet.Concept\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies a concept to be included or excluded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"filter\" type=\"ValueSet.Filter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Select concepts by specify a matching criterion based on the properties (including relationships) defined by the system, or on filters defined by the system. If multiple filters are specified, they SHALL all be true.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"valueSet\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"canonical\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Selects the concepts found in this value set (based on its value set definition). This is an absolute URI that is a reference to ValueSet.url.  If multiple value sets are specified this includes the union of the contents of all of the referenced value sets.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ValueSet.Concept\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"code\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Specifies a code for the concept to be included or excluded.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"designation\" type=\"ValueSet.Designation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ValueSet.Designation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"language\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The language this designation is defined for.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"use\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Coding\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that represents types of uses of designations.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The text value for this designation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ValueSet.Filter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"property\" minOccurs=\"1\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A code that identifies a property or a filter defined in the code system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"op\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FilterOperator\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The kind of operation to perform as a part of the filter criteria.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"value\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value  (if the filter represents a property defined in CodeSystem) or of the system filter value (if the filter represents a filter defined in CodeSystem) when the operation is 'regex', or one of the values (true and false), when the operation is 'exists'.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ValueSet.Expansion\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An identifier that uniquely identifies this expansion of the valueset, based on a unique combination of the provided parameters, the system default parameters, and the underlying system code system versions etc. Systems may re-use the same identifier as long as those factors remain the same, and the expansion is the same, but are not required to do so. This is a business identifier.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"timestamp\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The time at which the expansion was produced by the expanding system.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"total\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"offset\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If paging is being used, the offset at which this resource starts.  I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL NOT be present.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"parameter\" type=\"ValueSet.Parameter\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contains\" type=\"ValueSet.Contains\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The codes that are contained in the value set expansion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ValueSet.Parameter\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"name\" minOccurs=\"1\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Name of the input parameter to the $expand operation; may be a server-assigned name for additional default or other server-supplied parameters used to control the expansion process.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:choice minOccurs=\"0\" maxOccurs=\"1\" >\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The value of the parameter.</xs:documentation>\n            </xs:annotation>\n            <xs:element name=\"valueString\" type=\"string\"/>\n            <xs:element name=\"valueBoolean\" type=\"boolean\"/>\n            <xs:element name=\"valueInteger\" type=\"integer\"/>\n            <xs:element name=\"valueDecimal\" type=\"decimal\"/>\n            <xs:element name=\"valueUri\" type=\"uri\"/>\n            <xs:element name=\"valueCode\" type=\"code\"/>\n            <xs:element name=\"valueDateTime\" type=\"dateTime\"/>\n          </xs:choice>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"ValueSet.Contains\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A ValueSet resource instance specifies a set of codes drawn from one or more code systems, intended for use in a particular context. Value sets link between [[[CodeSystem]]] definitions and their use in [coded elements](terminologies.html).</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"system\" minOccurs=\"0\" maxOccurs=\"1\" type=\"uri\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">An absolute URI which is the code system in which the code for this item in the expansion is defined.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"abstract\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"inactive\" minOccurs=\"0\" maxOccurs=\"1\" type=\"boolean\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">If the concept is inactive in the code system that defines it. Inactive codes are those that are no longer to be used, but are maintained by the code system for understanding legacy data. It might not be known or specified whether an concept is inactive (and it may depend on the context of use).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"version\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The version of the code system from this code was taken. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"code\" minOccurs=\"0\" maxOccurs=\"1\" type=\"code\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"display\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The recommended display for this item in the expansion.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"designation\" type=\"ValueSet.Designation\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Additional representations for this item - other languages, aliases, specialized purposes, used for particular purposes, etc. These are relevant when the conditions of the expansion do not fix to a single correct representation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"contains\" type=\"ValueSet.Contains\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Other codes and entries contained under this entry in the hierarchy.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/verificationresult.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource VerificationResult\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>VerificationResult</sch:title>\n    <sch:rule context=\"f:VerificationResult\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:target\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:target/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:target/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:frequency/f:repeat\">\n      <sch:assert test=\"not(exists(f:offset)) or exists(f:when)\">tim-9: If there's an offset, there must be a when (and not C, CM, CD, CV)</sch:assert>\n      <sch:assert test=\"f:period/@value &gt;= 0 or not(f:period/@value)\">tim-5: period SHALL be a non-negative value</sch:assert>\n      <sch:assert test=\"not(exists(f:periodMax)) or exists(f:period)\">tim-6: If there's a periodMax, there must be a period</sch:assert>\n      <sch:assert test=\"not(exists(f:durationMax)) or exists(f:duration)\">tim-7: If there's a durationMax, there must be a duration</sch:assert>\n      <sch:assert test=\"not(exists(f:countMax)) or exists(f:count)\">tim-8: If there's a countMax, there must be a count</sch:assert>\n      <sch:assert test=\"not(exists(f:duration)) or exists(f:durationUnit)\">tim-1: if there's a duration, there needs to be duration units</sch:assert>\n      <sch:assert test=\"not(exists(f:timeOfDay)) or not(exists(f:when))\">tim-10: If there's a timeOfDay, there cannot be a when, or vice versa</sch:assert>\n      <sch:assert test=\"not(exists(f:period)) or exists(f:periodUnit)\">tim-2: if there's a period, there needs to be period units</sch:assert>\n      <sch:assert test=\"f:duration/@value &gt;= 0 or not(f:duration/@value)\">tim-4: duration SHALL be a non-negative value</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:frequency/f:repeat/f:boundsDuration\">\n      <sch:assert test=\"(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')\">drt-1: There SHALL be a code if there is a value and it SHALL be an expression of time.  If system is present, it SHALL be UCUM.</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:frequency/f:repeat/f:boundsRange\">\n      <sch:assert test=\"not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) &lt;= number(f:high/f:value/@value))\">rng-2: If present, low SHALL have a lower value than high</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:frequency/f:repeat/f:boundsRange/f:low\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:frequency/f:repeat/f:boundsRange/f:high\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:frequency/f:repeat/f:boundsPeriod\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:primarySource/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:primarySource/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:primarySource/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:proxySignature/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:proxySignature/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:proxySignature/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:proxySignature/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:proxySignature/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:proxySignature/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:sourceSignature/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:sourceSignature/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:sourceSignature/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:sourceSignature/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:sourceSignature/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:attestation/f:sourceSignature/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:organization\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:organization/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:organization/f:identifier//f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:attestationSignature/f:who\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:attestationSignature/f:who/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:attestationSignature/f:who/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:attestationSignature/f:onBehalfOf\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:attestationSignature/f:onBehalfOf/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VerificationResult/f:validator/f:attestationSignature/f:onBehalfOf/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/verificationresult.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"VerificationResult\" type=\"VerificationResult\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes validation requirements, source(s), status and dates for one or more elements.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"VerificationResult\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes validation requirements, source(s), status and dates for one or more elements.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"target\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A resource that was validated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"targetLocation\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The fhirpath location(s) within the resource that was validated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"need\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The frequency with which the target must be validated (none; initial; periodic).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"status\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The validation status of the target (attested; validated; in process; requires revalidation; validation failed; revalidation failed).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"statusDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the validation status was updated.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validationType\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">What the target is validated against (nothing; primary source; multiple sources).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validationProcess\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The primary process by which the target is validated (edit check; value set; primary source; multiple sources; standalone; in context).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"frequency\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Timing\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Frequency of revalidation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lastPerformed\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date/time validation was last completed (including failed validations).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"nextScheduled\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date when target is next validated, if appropriate.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"failureAction\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The result if validation fails (fatal; warning; record only; none).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"primarySource\" type=\"VerificationResult.PrimarySource\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the primary source(s) involved in validation.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"attestation\" type=\"VerificationResult.Attestation\" minOccurs=\"0\" maxOccurs=\"1\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the entity attesting to information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validator\" type=\"VerificationResult.Validator\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Information about the entity validating information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"VerificationResult.PrimarySource\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes validation requirements, source(s), status and dates for one or more elements.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"who\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the primary source.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"type\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of primary source (License Board; Primary Education; Continuing Education; Postal Service; Relationship owner; Registration Authority; legal source; issuing source; authoritative source).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"communicationMethod\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Method for communicating with the primary source (manual; API; Push).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validationStatus\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Status of the validation of the target against the primary source (successful; failed; unknown).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"validationDate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the target was validated against the primary source.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"canPushUpdates\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Ability of the primary source to push updates/alerts (yes; no; undetermined).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"pushTypeAvailable\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Type of alerts/updates the primary source can send (specific requested changes; any changes; as defined by source).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"VerificationResult.Attestation\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes validation requirements, source(s), status and dates for one or more elements.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"who\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The individual or organization attesting to information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"onBehalfOf\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">When the who is asserting on behalf of another (organization or individual).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"communicationMethod\" minOccurs=\"0\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The method by which attested information was submitted/retrieved (manual; API; Push).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"date\" minOccurs=\"0\" maxOccurs=\"1\" type=\"date\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date the information was attested to.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sourceIdentityCertificate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A digital identity certificate associated with the attestation source.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"proxyIdentityCertificate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A digital identity certificate associated with the proxy entity submitting attested information on behalf of the attestation source.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"proxySignature\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Signature\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Signed assertion by the proxy entity indicating that they have the right to submit attested information on behalf of the attestation source.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sourceSignature\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Signature\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Signed assertion by the attestation source that they have attested to the information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"VerificationResult.Validator\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">Describes validation requirements, source(s), status and dates for one or more elements.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"organization\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Reference to the organization validating information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"identityCertificate\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A digital identity certificate associated with the validator.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"attestationSignature\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Signature\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Signed assertion by the validator that they have validated the information.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"status-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"attested\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Attested</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"validated\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Validated</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"in-process\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In process</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"req-revalid\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Requires revalidation</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"val-fail\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Validation failed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"reval-fail\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Re-Validation failed</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"status\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">The validation status of the target.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"status-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/visionprescription.sch",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sch:schema xmlns:sch=\"http://purl.oclc.org/dsdl/schematron\" queryBinding=\"xslt2\">\n  <sch:ns prefix=\"f\" uri=\"http://hl7.org/fhir\"/>\n  <sch:ns prefix=\"h\" uri=\"http://www.w3.org/1999/xhtml\"/>\n  <!-- \n    This file contains just the constraints for the resource VisionPrescription\n    It is provided for documentation purposes. When actually validating,\n    always use fhir-invariants.sch (because of the way containment works)\n    Alternatively you can use this file to build a smaller version of\n    fhir-invariants.sch (the contents are identical; only include those \n    resources relevant to your implementation).\n  -->\n  <sch:pattern>\n    <sch:title>Global</sch:title>\n    <sch:rule context=\"f:extension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:modifierExtension\">\n      <sch:assert test=\"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])\">ext-1: Must have either extensions or value[x], not both</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>Global 1</sch:title>\n    <sch:rule context=\"f:*\">\n      <sch:assert test=\"@value|f:*|h:div\">global-1: All FHIR elements must have a @value or children</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n  <sch:pattern>\n    <sch:title>VisionPrescription</sch:title>\n    <sch:rule context=\"f:VisionPrescription\">\n      <sch:assert test=\"not(parent::f:contained and f:contained)\">dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))\">dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated</sch:assert>\n      <sch:assert test=\"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))\">dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource</sch:assert>\n      <sch:assert test=\"not(exists(f:contained/*/f:meta/f:security))\">dom-5: If a resource is contained in another resource, it SHALL NOT have a security label</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:text/h:div\">\n      <sch:assert test=\"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])\">txt-1: The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, &lt;a&gt; elements (either name or href), images and internally contained style attributes</sch:assert>\n      <sch:assert test=\"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]\">txt-2: The narrative SHALL have some non-whitespace content</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:patient\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:patient/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:patient/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:encounter\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:encounter/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:encounter/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:prescriber\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:prescriber/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:prescriber/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:lensSpecification/f:duration\">\n      <sch:assert test=\"not(exists(f:code)) or exists(f:system)\">qty-3: If a code for the unit is present, the system SHALL also be present</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:lensSpecification/f:note/f:authorReference\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:lensSpecification/f:note/f:authorReference/f:identifier/f:period\">\n      <sch:assert test=\"not(exists(f:start/@value)) or not(exists(f:end/@value)) or (xs:dateTime(f:start/@value) &lt;= xs:dateTime(f:end/@value))\">per-1: If present, start SHALL have a lower value than end</sch:assert>\n    </sch:rule>\n    <sch:rule context=\"f:VisionPrescription/f:lensSpecification/f:note/f:authorReference/f:identifier/f:assigner\">\n      <sch:assert test=\"not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])\">ref-1: SHALL have a contained resource if a local reference is provided</sch:assert>\n    </sch:rule>\n  </sch:pattern>\n</sch:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/visionprescription.xsd",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- \n  Copyright (c) 2011+, HL7, Inc.\n  All rights reserved.\n  \n  Redistribution and use in source and binary forms, with or without modification, \n  are permitted provided that the following conditions are met:\n  \n   * Redistributions of source code must retain the above copyright notice, this \n     list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above copyright notice, \n     this list of conditions and the following disclaimer in the documentation \n     and/or other materials provided with the distribution.\n   * Neither the name of HL7 nor the names of its contributors may be used to \n     endorse or promote products derived from this software without specific \n     prior written permission.\n  \n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \n  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \n  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \n  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \n  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \n  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \n  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n  POSSIBILITY OF SUCH DAMAGE.\n  \n\n  Generated on Fri, Nov 1, 2019 09:29+1100 for FHIR v4.0.1 \n\n  Note: the schemas &amp; schematrons do not contain all of the rules about what makes resources\n  valid. Implementers will still need to be familiar with the content of the specification and with\n  any profiles that apply to the resources in order to make a conformant implementation.\n\n-->\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://hl7.org/fhir\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://hl7.org/fhir\" elementFormDefault=\"qualified\" version=\"1.0\">\n  <xs:include schemaLocation=\"fhir-base.xsd\"/>\n  <xs:element name=\"VisionPrescription\" type=\"VisionPrescription\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An authorization for the provision of glasses and/or contact lenses to a patient.</xs:documentation>\n    </xs:annotation>\n  </xs:element>\n  <xs:complexType name=\"VisionPrescription\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An authorization for the provision of glasses and/or contact lenses to a patient.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"DomainResource\">\n        <xs:sequence>\n          <xs:element name=\"identifier\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Identifier\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A unique identifier assigned to this vision prescription.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"status\" minOccurs=\"1\" maxOccurs=\"1\" type=\"FinancialResourceStatusCodes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The status of the resource instance.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"created\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date this resource was created.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"patient\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A resource reference to the person to whom the vision prescription applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"encounter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">A reference to a resource that identifies the particular occurrence of contact between patient and health care provider during which the prescription was issued.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"dateWritten\" minOccurs=\"1\" maxOccurs=\"1\" type=\"dateTime\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The date (and perhaps time) when the prescription was written.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"prescriber\" minOccurs=\"1\" maxOccurs=\"1\" type=\"Reference\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The healthcare professional responsible for authorizing the prescription.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"lensSpecification\" type=\"VisionPrescription.LensSpecification\" minOccurs=\"1\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contain the details of  the individual lens specifications and serves as the authorization for the fullfillment by certified professionals.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"VisionPrescription.LensSpecification\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An authorization for the provision of glasses and/or contact lenses to a patient.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"product\" minOccurs=\"1\" maxOccurs=\"1\" type=\"CodeableConcept\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Identifies the type of vision correction product which is required for the patient.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"eye\" minOccurs=\"1\" maxOccurs=\"1\" type=\"VisionEyes\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The eye for which the lens specification applies.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"sphere\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Lens power measured in dioptres (0.25 units).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"cylinder\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Power adjustment for astigmatism measured in dioptres (0.25 units).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"axis\" minOccurs=\"0\" maxOccurs=\"1\" type=\"integer\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Adjustment for astigmatism measured in integer degrees.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"prism\" type=\"VisionPrescription.Prism\" minOccurs=\"0\" maxOccurs=\"unbounded\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Allows for adjustment on two axis.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"add\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Power adjustment for multifocal lenses measured in dioptres (0.25 units).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"power\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact lens power measured in dioptres (0.25 units).</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"backCurve\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Back curvature measured in millimetres.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"diameter\" minOccurs=\"0\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Contact lens diameter measured in millimetres.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"duration\" minOccurs=\"0\" maxOccurs=\"1\" type=\"Quantity\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The recommended maximum wear period for the lens.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"color\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Special color or pattern.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"brand\" minOccurs=\"0\" maxOccurs=\"1\" type=\"string\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Brand recommendations or restrictions.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"note\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"Annotation\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Notes for special requirements such as coatings and lens materials.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:complexType name=\"VisionPrescription.Prism\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">An authorization for the provision of glasses and/or contact lenses to a patient.</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"BackboneElement\">\n        <xs:sequence>\n          <xs:element name=\"amount\" minOccurs=\"1\" maxOccurs=\"1\" type=\"decimal\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">Amount of prism to compensate for eye alignment in fractional units.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n          <xs:element name=\"base\" minOccurs=\"1\" maxOccurs=\"1\" type=\"VisionBase\">\n            <xs:annotation>\n              <xs:documentation xml:lang=\"en\">The relative base, or reference lens edge, for the prism.</xs:documentation>\n           </xs:annotation>\n          </xs:element>\n        </xs:sequence>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"VisionBase-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"up\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Up</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"down\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Down</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"in\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">In</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"out\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Out</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"VisionBase\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A coded concept listing the base codes.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"VisionBase-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n  <xs:simpleType name=\"VisionEyes-list\">\n    <xs:restriction base=\"code-primitive\">\n      <xs:enumeration value=\"right\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Right Eye</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n      <xs:enumeration value=\"left\">\n        <xs:annotation>\n          <xs:documentation xml:lang=\"en\">Left Eye</xs:documentation>\n        </xs:annotation>\n      </xs:enumeration>\n    </xs:restriction>\n  </xs:simpleType>\n  <xs:complexType name=\"VisionEyes\">\n    <xs:annotation>\n      <xs:documentation xml:lang=\"en\">A coded concept listing the eye codes.</xs:documentation>\n      <xs:documentation xml:lang=\"en\">If the element is present, it must have either a @value, an @id, or extensions</xs:documentation>\n    </xs:annotation>\n    <xs:complexContent>\n      <xs:extension base=\"Element\">\n        <xs:attribute name=\"value\" type=\"VisionEyes-list\" use=\"optional\"/>\n      </xs:extension>\n    </xs:complexContent>\n  </xs:complexType>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/xml.xsd",
    "content": "﻿<?xml version=\"1.0\"?>\n<?xml-stylesheet href=\"../2008/09/xsd.xsl\" type=\"text/xsl\"?>\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://www.w3.org/1999/xhtml\" targetNamespace=\"http://www.w3.org/XML/1998/namespace\" xml:lang=\"en\">\n  <!-- Note: When using this schema with some tools, it may also be necessary to declare xmlns:xml=\"http://www.w3.org/XML/1998/namespace\", however this causes performance issues with other tools and thus is not in the base schemas. -->\n  <xs:annotation>\n    <xs:documentation>\n      <div>\n        <h1>About the XML namespace</h1>\n        <div class=\"bodytext\">\n          <p>\n      This schema document describes the XML namespace, in a form\n      suitable for import by other schema documents.\n     </p>\n          <p>\n      See <a href=\"http://www.w3.org/XML/1998/namespace.html\">\n      http://www.w3.org/XML/1998/namespace.html</a> and\n      <a href=\"http://www.w3.org/TR/REC-xml\">\n      http://www.w3.org/TR/REC-xml</a> for information \n      about this namespace.\n     </p>\n          <p>\n      Note that local names in this namespace are intended to be\n      defined only by the World Wide Web Consortium or its subgroups.\n      The names currently defined in this namespace are listed below.\n      They should not be used with conflicting semantics by any Working\n      Group, specification, or document instance.\n     </p>\n          <p>   \n      See further below in this document for more information about <a href=\"#usage\">how to refer to this schema document from your own\n      XSD schema documents</a> and about <a href=\"#nsversioning\">the\n      namespace-versioning policy governing this schema document</a>.\n     </p>\n        </div>\n      </div>\n    </xs:documentation>\n  </xs:annotation>\n  <xs:attribute name=\"lang\">\n    <xs:annotation>\n      <xs:documentation>\n        <div>\n          <h3>lang (as an attribute name)</h3>\n          <p>\n       denotes an attribute whose value\n       is a language code for the natural language of the content of\n       any element; its value is inherited.  This name is reserved\n       by virtue of its definition in the XML specification.</p>\n        </div>\n        <div>\n          <h4>Notes</h4>\n          <p>\n      Attempting to install the relevant ISO 2- and 3-letter\n      codes as the enumerated possible values is probably never\n      going to be a realistic possibility.  \n     </p>\n          <p>\n      See BCP 47 at <a href=\"http://www.rfc-editor.org/rfc/bcp/bcp47.txt\">\n       http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a>\n      and the IANA language subtag registry at\n      <a href=\"http://www.iana.org/assignments/language-subtag-registry\">\n       http://www.iana.org/assignments/language-subtag-registry</a>\n      for further information.\n     </p>\n          <p>\n      The union allows for the 'un-declaration' of xml:lang with\n      the empty string.\n     </p>\n        </div>\n      </xs:documentation>\n    </xs:annotation>\n    <xs:simpleType>\n      <xs:union memberTypes=\"xs:language\">\n        <xs:simpleType>\n          <xs:restriction base=\"xs:string\">\n            <xs:enumeration value=\"\"/>\n          </xs:restriction>\n        </xs:simpleType>\n      </xs:union>\n    </xs:simpleType>\n  </xs:attribute>\n  <xs:attribute name=\"space\">\n    <xs:annotation>\n      <xs:documentation>\n        <div>\n          <h3>space (as an attribute name)</h3>\n          <p>\n       denotes an attribute whose\n       value is a keyword indicating what whitespace processing\n       discipline is intended for the content of the element; its\n       value is inherited.  This name is reserved by virtue of its\n       definition in the XML specification.</p>\n        </div>\n      </xs:documentation>\n    </xs:annotation>\n    <xs:simpleType>\n      <xs:restriction base=\"xs:NCName\">\n        <xs:enumeration value=\"default\"/>\n        <xs:enumeration value=\"preserve\"/>\n      </xs:restriction>\n    </xs:simpleType>\n  </xs:attribute>\n  <xs:attribute name=\"base\" type=\"xs:anyURI\">\n    <xs:annotation>\n      <xs:documentation>\n        <div>\n          <h3>base (as an attribute name)</h3>\n          <p>\n       denotes an attribute whose value\n       provides a URI to be used as the base for interpreting any\n       relative URIs in the scope of the element on which it\n       appears; its value is inherited.  This name is reserved\n       by virtue of its definition in the XML Base specification.</p>\n          <p>\n      See <a href=\"http://www.w3.org/TR/xmlbase/\">http://www.w3.org/TR/xmlbase/</a>\n      for information about this attribute.\n     </p>\n        </div>\n      </xs:documentation>\n    </xs:annotation>\n  </xs:attribute>\n  <xs:attribute name=\"id\" type=\"xs:ID\">\n    <xs:annotation>\n      <xs:documentation>\n        <div>\n          <h3>id (as an attribute name)</h3>\n          <p>\n       denotes an attribute whose value\n       should be interpreted as if declared to be of type ID.\n       This name is reserved by virtue of its definition in the\n       xml:id specification.</p>\n          <p>\n      See <a href=\"http://www.w3.org/TR/xml-id/\">http://www.w3.org/TR/xml-id/</a>\n      for information about this attribute.\n     </p>\n        </div>\n      </xs:documentation>\n    </xs:annotation>\n  </xs:attribute>\n  <xs:attributeGroup name=\"specialAttrs\">\n    <xs:attribute ref=\"xml:base\"/>\n    <xs:attribute ref=\"xml:lang\"/>\n    <xs:attribute ref=\"xml:space\"/>\n    <xs:attribute ref=\"xml:id\"/>\n  </xs:attributeGroup>\n  <xs:annotation>\n    <xs:documentation>\n      <div>\n        <h3>Father (in any context at all)</h3>\n        <div class=\"bodytext\">\n          <p>\n      denotes Jon Bosak, the chair of \n      the original XML Working Group.  This name is reserved by \n      the following decision of the W3C XML Plenary and \n      XML Coordination groups:\n     </p>\n          <blockquote>\n            <p>\n\tIn appreciation for his vision, leadership and\n\tdedication the W3C XML Plenary on this 10th day of\n\tFebruary, 2000, reserves for Jon Bosak in perpetuity\n\tthe XML name \"xml:Father\".\n       </p>\n          </blockquote>\n        </div>\n      </div>\n    </xs:documentation>\n  </xs:annotation>\n  <xs:annotation>\n    <xs:documentation>\n      <div xml:id=\"usage\" id=\"usage\">\n        <h2>\n          <a name=\"usage\">About this schema document</a>\n        </h2>\n        <div class=\"bodytext\">\n          <p>\n      This schema defines attributes and an attribute group suitable\n      for use by schemas wishing to allow <code>xml:base</code>,\n      <code>xml:lang</code>, <code>xml:space</code> or\n      <code>xml:id</code> attributes on elements they define.\n     </p>\n          <p>\n      To enable this, such a schema must import this schema for\n      the XML namespace, e.g. as follows:\n     </p>\n          <pre>\n          &lt;schema . . .>\n           . . .\n           &lt;import namespace=\"http://www.w3.org/XML/1998/namespace\"\n                      schemaLocation=\"http://www.w3.org/2001/xml.xsd\"/>\n     </pre>\n          <p>\n      or\n     </p>\n          <pre>\n           &lt;import namespace=\"http://www.w3.org/XML/1998/namespace\"\n                      schemaLocation=\"http://www.w3.org/2009/01/xml.xsd\"/>\n     </pre>\n          <p>\n      Subsequently, qualified reference to any of the attributes or the\n      group defined below will have the desired effect, e.g.\n     </p>\n          <pre>\n          &lt;type . . .>\n           . . .\n           &lt;attributeGroup ref=\"xml:specialAttrs\"/>\n     </pre>\n          <p>\n      will define a type which will schema-validate an instance element\n      with any of those attributes.\n     </p>\n        </div>\n      </div>\n    </xs:documentation>\n  </xs:annotation>\n  <xs:annotation>\n    <xs:documentation>\n      <div id=\"nsversioning\" xml:id=\"nsversioning\">\n        <h2>\n          <a name=\"nsversioning\">Versioning policy for this schema document</a>\n        </h2>\n        <div class=\"bodytext\">\n          <p>\n      In keeping with the XML Schema WG's standard versioning\n      policy, this schema document will persist at\n      <a href=\"http://www.w3.org/2009/01/xml.xsd\">\n       http://www.w3.org/2009/01/xml.xsd</a>.\n     </p>\n          <p>\n      At the date of issue it can also be found at\n      <a href=\"http://www.w3.org/2001/xml.xsd\">\n       http://www.w3.org/2001/xml.xsd</a>.\n     </p>\n          <p>\n      The schema document at that URI may however change in the future,\n      in order to remain compatible with the latest version of XML\n      Schema itself, or with the XML namespace itself.  In other words,\n      if the XML Schema or XML namespaces change, the version of this\n      document at <a href=\"http://www.w3.org/2001/xml.xsd\">\n       http://www.w3.org/2001/xml.xsd \n      </a> \n      will change accordingly; the version at \n      <a href=\"http://www.w3.org/2009/01/xml.xsd\">\n       http://www.w3.org/2009/01/xml.xsd \n      </a> \n      will not change.\n     </p>\n          <p>\n      Previous dated (and unchanging) versions of this schema \n      document are at:\n     </p>\n          <ul>\n            <li>\n              <a href=\"http://www.w3.org/2009/01/xml.xsd\">\n\thttp://www.w3.org/2009/01/xml.xsd</a>\n            </li>\n            <li>\n              <a href=\"http://www.w3.org/2007/08/xml.xsd\">\n\thttp://www.w3.org/2007/08/xml.xsd</a>\n            </li>\n            <li>\n              <a href=\"http://www.w3.org/2004/10/xml.xsd\">\n\thttp://www.w3.org/2004/10/xml.xsd</a>\n            </li>\n            <li>\n              <a href=\"http://www.w3.org/2001/03/xml.xsd\">\n\thttp://www.w3.org/2001/03/xml.xsd</a>\n            </li>\n          </ul>\n        </div>\n      </div>\n    </xs:documentation>\n  </xs:annotation>\n</xs:schema>\n"
  },
  {
    "path": "tests/static/xsd/fhir/xmldsig-core-schema.xsd",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Schema for XML Signatures\n    http://www.w3.org/2000/09/xmldsig#\n    $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $\n\n    Copyright 2001 The Internet Society and W3C (Massachusetts Institute\n    of Technology, Institut National de Recherche en Informatique et en\n    Automatique, Keio University). All Rights Reserved.\n    http://www.w3.org/Consortium/Legal/\n\n    This document is governed by the W3C Software License [1] as described\n    in the FAQ [2].\n\n    [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720\n    [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD\n-->\n<schema xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" targetNamespace=\"http://www.w3.org/2000/09/xmldsig#\" elementFormDefault=\"qualified\" version=\"0.1\">\n  <!-- Basic Types Defined for Signatures -->\n  <simpleType name=\"CryptoBinary\">\n    <restriction base=\"base64Binary\"/>\n  </simpleType>\n  <!-- Start Signature -->\n  <element name=\"Signature\" type=\"ds:SignatureType\"/>\n  <complexType name=\"SignatureType\">\n    <sequence>\n      <element ref=\"ds:SignedInfo\"/>\n      <element ref=\"ds:SignatureValue\"/>\n      <element ref=\"ds:KeyInfo\" minOccurs=\"0\"/>\n      <element ref=\"ds:Object\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n    </sequence>\n    <attribute name=\"Id\" type=\"ID\" use=\"optional\"/>\n  </complexType>\n  <element name=\"SignatureValue\" type=\"ds:SignatureValueType\"/>\n  <complexType name=\"SignatureValueType\">\n    <simpleContent>\n      <extension base=\"base64Binary\">\n        <attribute name=\"Id\" type=\"ID\" use=\"optional\"/>\n      </extension>\n    </simpleContent>\n  </complexType>\n  <!-- Start SignedInfo -->\n  <element name=\"SignedInfo\" type=\"ds:SignedInfoType\"/>\n  <complexType name=\"SignedInfoType\">\n    <sequence>\n      <element ref=\"ds:CanonicalizationMethod\"/>\n      <element ref=\"ds:SignatureMethod\"/>\n      <element ref=\"ds:Reference\" maxOccurs=\"unbounded\"/>\n    </sequence>\n    <attribute name=\"Id\" type=\"ID\" use=\"optional\"/>\n  </complexType>\n  <element name=\"CanonicalizationMethod\" type=\"ds:CanonicalizationMethodType\"/>\n  <complexType name=\"CanonicalizationMethodType\" mixed=\"true\">\n    <sequence>\n      <any namespace=\"##any\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n      <!-- (0,unbounded) elements from (1,1) namespace -->\n    </sequence>\n    <attribute name=\"Algorithm\" type=\"anyURI\" use=\"required\"/>\n  </complexType>\n  <element name=\"SignatureMethod\" type=\"ds:SignatureMethodType\"/>\n  <complexType name=\"SignatureMethodType\" mixed=\"true\">\n    <sequence>\n      <element name=\"HMACOutputLength\" type=\"ds:HMACOutputLengthType\" minOccurs=\"0\"/>\n      <any namespace=\"##other\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n      <!-- (0,unbounded) elements from (1,1) external namespace -->\n    </sequence>\n    <attribute name=\"Algorithm\" type=\"anyURI\" use=\"required\"/>\n  </complexType>\n  <!-- Start Reference -->\n  <element name=\"Reference\" type=\"ds:ReferenceType\"/>\n  <complexType name=\"ReferenceType\">\n    <sequence>\n      <element ref=\"ds:Transforms\" minOccurs=\"0\"/>\n      <element ref=\"ds:DigestMethod\"/>\n      <element ref=\"ds:DigestValue\"/>\n    </sequence>\n    <attribute name=\"Id\" type=\"ID\" use=\"optional\"/>\n    <attribute name=\"URI\" type=\"anyURI\" use=\"optional\"/>\n    <attribute name=\"Type\" type=\"anyURI\" use=\"optional\"/>\n  </complexType>\n  <element name=\"Transforms\" type=\"ds:TransformsType\"/>\n  <complexType name=\"TransformsType\">\n    <sequence>\n      <element ref=\"ds:Transform\" maxOccurs=\"unbounded\"/>\n    </sequence>\n  </complexType>\n  <element name=\"Transform\" type=\"ds:TransformType\"/>\n  <complexType name=\"TransformType\" mixed=\"true\">\n    <choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n      <any namespace=\"##other\" processContents=\"lax\"/>\n      <!-- (1,1) elements from (0,unbounded) namespaces -->\n      <element name=\"XPath\" type=\"string\"/>\n    </choice>\n    <attribute name=\"Algorithm\" type=\"anyURI\" use=\"required\"/>\n  </complexType>\n  <!-- End Reference -->\n  <element name=\"DigestMethod\" type=\"ds:DigestMethodType\"/>\n  <complexType name=\"DigestMethodType\" mixed=\"true\">\n    <sequence>\n      <any namespace=\"##other\" processContents=\"lax\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n    </sequence>\n    <attribute name=\"Algorithm\" type=\"anyURI\" use=\"required\"/>\n  </complexType>\n  <element name=\"DigestValue\" type=\"ds:DigestValueType\"/>\n  <simpleType name=\"DigestValueType\">\n    <restriction base=\"base64Binary\"/>\n  </simpleType>\n  <!-- End SignedInfo -->\n  <!-- Start KeyInfo -->\n  <element name=\"KeyInfo\" type=\"ds:KeyInfoType\"/>\n  <complexType name=\"KeyInfoType\" mixed=\"true\">\n    <choice maxOccurs=\"unbounded\">\n      <element ref=\"ds:KeyName\"/>\n      <element ref=\"ds:KeyValue\"/>\n      <element ref=\"ds:RetrievalMethod\"/>\n      <element ref=\"ds:X509Data\"/>\n      <element ref=\"ds:PGPData\"/>\n      <element ref=\"ds:SPKIData\"/>\n      <element ref=\"ds:MgmtData\"/>\n      <any namespace=\"##other\" processContents=\"lax\"/>\n      <!-- (1,1) elements from (0,unbounded) namespaces -->\n    </choice>\n    <attribute name=\"Id\" type=\"ID\" use=\"optional\"/>\n  </complexType>\n  <element name=\"KeyName\" type=\"string\"/>\n  <element name=\"MgmtData\" type=\"string\"/>\n  <element name=\"KeyValue\" type=\"ds:KeyValueType\"/>\n  <complexType name=\"KeyValueType\" mixed=\"true\">\n    <choice>\n      <element ref=\"ds:DSAKeyValue\"/>\n      <element ref=\"ds:RSAKeyValue\"/>\n      <any namespace=\"##other\" processContents=\"lax\"/>\n    </choice>\n  </complexType>\n  <element name=\"RetrievalMethod\" type=\"ds:RetrievalMethodType\"/>\n  <complexType name=\"RetrievalMethodType\">\n    <sequence>\n      <element ref=\"ds:Transforms\" minOccurs=\"0\"/>\n    </sequence>\n    <attribute name=\"URI\" type=\"anyURI\"/>\n    <attribute name=\"Type\" type=\"anyURI\" use=\"optional\"/>\n  </complexType>\n  <!-- Start X509Data -->\n  <element name=\"X509Data\" type=\"ds:X509DataType\"/>\n  <complexType name=\"X509DataType\">\n    <sequence maxOccurs=\"unbounded\">\n      <choice>\n        <element name=\"X509IssuerSerial\" type=\"ds:X509IssuerSerialType\"/>\n        <element name=\"X509SKI\" type=\"base64Binary\"/>\n        <element name=\"X509SubjectName\" type=\"string\"/>\n        <element name=\"X509Certificate\" type=\"base64Binary\"/>\n        <element name=\"X509CRL\" type=\"base64Binary\"/>\n        <any namespace=\"##other\" processContents=\"lax\"/>\n      </choice>\n    </sequence>\n  </complexType>\n  <complexType name=\"X509IssuerSerialType\">\n    <sequence>\n      <element name=\"X509IssuerName\" type=\"string\"/>\n      <element name=\"X509SerialNumber\" type=\"integer\"/>\n    </sequence>\n  </complexType>\n  <!-- End X509Data -->\n  <!-- Begin PGPData -->\n  <element name=\"PGPData\" type=\"ds:PGPDataType\"/>\n  <complexType name=\"PGPDataType\">\n    <choice>\n      <sequence>\n        <element name=\"PGPKeyID\" type=\"base64Binary\"/>\n        <element name=\"PGPKeyPacket\" type=\"base64Binary\" minOccurs=\"0\"/>\n        <any namespace=\"##other\" processContents=\"lax\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n      </sequence>\n      <sequence>\n        <element name=\"PGPKeyPacket\" type=\"base64Binary\"/>\n        <any namespace=\"##other\" processContents=\"lax\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n      </sequence>\n    </choice>\n  </complexType>\n  <!-- End PGPData -->\n  <!-- Begin SPKIData -->\n  <element name=\"SPKIData\" type=\"ds:SPKIDataType\"/>\n  <complexType name=\"SPKIDataType\">\n    <sequence maxOccurs=\"unbounded\">\n      <element name=\"SPKISexp\" type=\"base64Binary\"/>\n      <any namespace=\"##other\" processContents=\"lax\" minOccurs=\"0\"/>\n    </sequence>\n  </complexType>\n  <!-- End SPKIData -->\n  <!-- End KeyInfo -->\n  <!-- Start Object (Manifest, SignatureProperty) -->\n  <element name=\"Object\" type=\"ds:ObjectType\"/>\n  <complexType name=\"ObjectType\" mixed=\"true\">\n    <sequence minOccurs=\"0\" maxOccurs=\"unbounded\">\n      <any namespace=\"##any\" processContents=\"lax\"/>\n    </sequence>\n    <attribute name=\"Id\" type=\"ID\" use=\"optional\"/>\n    <attribute name=\"MimeType\" type=\"string\" use=\"optional\"/>\n    <attribute name=\"Encoding\" type=\"anyURI\" use=\"optional\"/>\n    <!-- add a grep facet -->\n  </complexType>\n  <element name=\"Manifest\" type=\"ds:ManifestType\"/>\n  <complexType name=\"ManifestType\">\n    <sequence>\n      <element ref=\"ds:Reference\" maxOccurs=\"unbounded\"/>\n    </sequence>\n    <attribute name=\"Id\" type=\"ID\" use=\"optional\"/>\n  </complexType>\n  <element name=\"SignatureProperties\" type=\"ds:SignaturePropertiesType\"/>\n  <complexType name=\"SignaturePropertiesType\">\n    <sequence>\n      <element ref=\"ds:SignatureProperty\" maxOccurs=\"unbounded\"/>\n    </sequence>\n    <attribute name=\"Id\" type=\"ID\" use=\"optional\"/>\n  </complexType>\n  <element name=\"SignatureProperty\" type=\"ds:SignaturePropertyType\"/>\n  <complexType name=\"SignaturePropertyType\" mixed=\"true\">\n    <choice maxOccurs=\"unbounded\">\n      <any namespace=\"##other\" processContents=\"lax\"/>\n      <!-- (1,1) elements from (1,unbounded) namespaces -->\n    </choice>\n    <attribute name=\"Target\" type=\"anyURI\" use=\"required\"/>\n    <attribute name=\"Id\" type=\"ID\" use=\"optional\"/>\n  </complexType>\n  <!-- End Object (Manifest, SignatureProperty) -->\n  <!-- Start Algorithm Parameters -->\n  <simpleType name=\"HMACOutputLengthType\">\n    <restriction base=\"integer\"/>\n  </simpleType>\n  <!-- Start KeyValue Element-types -->\n  <element name=\"DSAKeyValue\" type=\"ds:DSAKeyValueType\"/>\n  <complexType name=\"DSAKeyValueType\">\n    <sequence>\n      <sequence minOccurs=\"0\">\n        <element name=\"P\" type=\"ds:CryptoBinary\"/>\n        <element name=\"Q\" type=\"ds:CryptoBinary\"/>\n      </sequence>\n      <element name=\"G\" type=\"ds:CryptoBinary\" minOccurs=\"0\"/>\n      <element name=\"Y\" type=\"ds:CryptoBinary\"/>\n      <element name=\"J\" type=\"ds:CryptoBinary\" minOccurs=\"0\"/>\n      <sequence minOccurs=\"0\">\n        <element name=\"Seed\" type=\"ds:CryptoBinary\"/>\n        <element name=\"PgenCounter\" type=\"ds:CryptoBinary\"/>\n      </sequence>\n    </sequence>\n  </complexType>\n  <element name=\"RSAKeyValue\" type=\"ds:RSAKeyValueType\"/>\n  <complexType name=\"RSAKeyValueType\">\n    <sequence>\n      <element name=\"Modulus\" type=\"ds:CryptoBinary\"/>\n      <element name=\"Exponent\" type=\"ds:CryptoBinary\"/>\n    </sequence>\n  </complexType>\n  <!-- End KeyValue Element-types -->\n  <!-- End Signature -->\n</schema>\n"
  },
  {
    "path": "tests/test_summary_mode_serialization.py",
    "content": "from fhir.resources.R4B.patient import Patient\n\nfrom .conftest import STATIC_PATH\n\n__author__ = 'Md Nazrul Islam'\n__email__ = \"email2nazrul@gmail.com\"\n\ndef test_summary_for_model_serialization():\n    \"\"\" \"\"\"\n    patient_fhir = Patient.model_validate_json(\n        (STATIC_PATH / \"R4B\" / \"Patient-with-ext.json\").read_bytes()\n    )\n\n    patient_dict = patient_fhir.model_dump(summary_only=True)\n    assert \"text\" not in patient_dict\n    assert \"contained\" not in patient_dict\n    assert \"extension\" not in patient_dict\n    assert \"identifier\" in patient_dict\n\n    patient_dict = patient_fhir.model_dump(summary_only=False)\n    assert \"text\" in patient_dict\n    assert \"contained\" in patient_dict\n    assert \"extension\" in patient_dict\n\ndef test_summary_for_json_serialization():\n    \"\"\" \"\"\"\n    patient_fhir = Patient.model_validate_json(\n        (STATIC_PATH / \"R4B\" / \"Patient-with-ext.json\").read_bytes()\n    )\n\n    json_str = patient_fhir.model_dump_json(summary_only=True)\n    assert \"\\\"text\\\"\" not in json_str\n    assert \"\\\"contained\\\"\" not in json_str\n    assert \"\\\"extension\\\"\" not in json_str\n    assert \"\\\"identifier\\\"\" in json_str\n\n    json_str = patient_fhir.model_dump_json(summary_only=False)\n    assert \"\\\"text\\\"\" in json_str\n    assert \"\\\"contained\\\"\" in json_str\n    assert \"\\\"extension\\\"\" in json_str\n\n\ndef test_summary_for_xml_serialization():\n    \"\"\" \"\"\"\n    patient_fhir = Patient.model_validate_json(\n        (STATIC_PATH / \"R4B\" / \"Patient-with-ext.json\").read_bytes()\n    )\n\n    xml_bytes = patient_fhir.model_dump_xml(summary_only=True)\n    assert b\"<text>\" not in xml_bytes\n    assert b\"<contained>\" not in xml_bytes\n    assert b\"<extension\" not in xml_bytes\n    assert b\"<identifier>\" in xml_bytes\n\n    xml_bytes = patient_fhir.model_dump_xml(summary_only=False)\n    assert b\"<text>\" in xml_bytes\n    assert b\"<contained>\" in xml_bytes\n    assert b\"<extension\" in xml_bytes\n\ndef test_summary_for_yaml_serialization():\n    \"\"\" \"\"\"\n    patient_fhir = Patient.model_validate_json(\n        (STATIC_PATH / \"R4B\" / \"Patient-with-ext.json\").read_bytes()\n    )\n\n    yaml_str = patient_fhir.model_dump_yaml(summary_only=True)\n\n    assert \"text:\" not in yaml_str\n    assert \"contained:\" not in yaml_str\n    assert \"extension:\" not in yaml_str\n    assert \"identifier:\" in yaml_str\n\n    yaml_str = patient_fhir.model_dump_yaml(summary_only=False)\n\n    assert \"text:\" in yaml_str\n    assert \"contained:\" in yaml_str\n    assert \"extension:\" in yaml_str\n"
  },
  {
    "path": "tests/test_xml_validate_and_dump.py",
    "content": "import sys\nfrom http import client\n\nimport lxml.etree\nfrom fhir_core import xml_utils\n\nfrom fhir.resources.R4B.observation import Observation\nfrom fhir.resources.R4B.patient import Patient\n\nfrom .conftest import FHIR_XSD_DIR, IS_TRAVIS, STATIC_PATH\nfrom .utils import has_internet_connection, post_xml_resource\n\n__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n\n\ndef test_xml_node_patient_resource():\n    \"\"\"Accept-Charset: utf-8\n    Accept: application/fhir+xml;q=1.0, application/xml+fhir;q=0.9\n    User-Agent: HAPI-FHIR/5.3.0 (FHIR Client; FHIR 4.0.1/R4; apache)\n    Accept-Encoding: gzip\n    Content-Type: application/fhir+xml; charset=UTF-8\n    \"\"\"\n    patient_fhir = Patient.model_validate_json(\n        (STATIC_PATH / \"R4B\" / \"Patient-with-ext.json\").read_bytes()\n    )\n    patient_node = xml_utils.Node.from_fhir_obj(patient_fhir)\n    schema = lxml.etree.XMLSchema(file=str(FHIR_XSD_DIR / \"patient.xsd\"))\n    xmlparser = lxml.etree.XMLParser(schema=schema)\n    try:\n        patient_node.validate(patient_node, xmlparser=xmlparser)\n    except ValueError:\n        raise AssertionError(\"code should not come here!\")\n\n    if not (has_internet_connection() and IS_TRAVIS):\n        return\n    conn = None\n    try:\n        conn = client.HTTPConnection(\"hapi.fhir.org\", 80)\n        response = post_xml_resource(conn, patient_fhir)\n        if response.status != 500:\n            assert response is not None\n            assert response.status == 201\n    except client.HTTPException as exc:\n        sys.stderr.write(f\"{exc}\\n\")\n        return\n    finally:\n        if conn:\n            conn.close()\n\n\ndef test_xml_node_observation_resource():\n    \"\"\" \"\"\"\n    observation_fhir = Observation.model_validate_json(\n        (STATIC_PATH / \"R4B\" / \"Observation.json\").read_bytes()\n    )\n    observation_node = xml_utils.Node.from_fhir_obj(observation_fhir)\n\n    schema = lxml.etree.XMLSchema(file=str(FHIR_XSD_DIR / \"observation.xsd\"))\n    xmlparser = lxml.etree.XMLParser(schema=schema)\n    try:\n        observation_node.validate(observation_node, xmlparser=xmlparser)\n    except ValueError:\n        raise AssertionError(\"code should not come here!\")\n\n    if not (has_internet_connection() and IS_TRAVIS):\n        return\n    conn = None\n    try:\n        conn = client.HTTPConnection(\"hapi.fhir.org\", 80)\n        response = post_xml_resource(conn, observation_fhir)\n        if response.status != 500:\n            assert response is not None\n            assert response.status == 201\n        else:\n            # maybe need to wait for the server to be up\n            pass\n    except client.HTTPException as exc:\n        sys.stderr.write(f\"{exc}\\n\")\n        return\n    finally:\n        if conn:\n            conn.close()\n\n\ndef test_element_to_node():\n    \"\"\" \"\"\"\n    observation_fhir = Observation.model_validate_json(\n        (STATIC_PATH / \"R4B\" / \"Observation.json\").read_bytes()\n    )\n    observation_node = xml_utils.Node.from_fhir_obj(observation_fhir)\n\n    schema = lxml.etree.XMLSchema(file=str(FHIR_XSD_DIR / \"patient.xsd\"))\n    xmlparser = lxml.etree.XMLParser(schema=schema)\n    element = lxml.etree.fromstring(\n        (STATIC_PATH / \"R4B\" / \"Patient-with-ext.xml\").read_bytes(),\n        parser=xmlparser,\n    )\n    from fhir.resources.R4B.patient import Patient\n    patient_node = xml_utils.Node.from_element(element, fhir_class=Patient)\n    try:\n        patient_node.validate(patient_node.to_xml(), xmlparser=xmlparser)\n    except ValueError:\n        raise AssertionError(\"Code should not come here!\")\n\n\ndef test_model_obj_xml_file():\n    \"\"\" \"\"\"\n    patient = Patient.model_validate_xml(\n        (STATIC_PATH / \"R4B\" / \"Patient-with-ext.xml\").read_bytes()\n    )\n    # with parser parameter\n    schema = lxml.etree.XMLSchema(file=str(FHIR_XSD_DIR / \"patient.xsd\"))\n    xmlparser = lxml.etree.XMLParser(schema=schema)\n    patient2 = Patient.model_validate_xml(\n        (\n            STATIC_PATH / \"R4B\" / \"Patient-with-ext.xml\"\n        ).read_bytes()  # , xmlparser=xmlparser\n    )\n    patient3 = Patient.model_validate_json(\n        (STATIC_PATH / \"R4B\" / \"Patient-with-ext.json\").read_bytes()\n    )\n    assert patient.model_dump() == patient2.model_dump()\n    patient3.text = None\n    patient.text = None\n    patient.contained[1].text = None\n    patient3.contained[1].text = None\n    assert patient3.model_dump() == patient.model_dump()\n"
  },
  {
    "path": "tests/test_yaml_validate_and_dump.py",
    "content": "from fhir.resources.R4B.patient import Patient\n\nfrom .conftest import STATIC_PATH\n\n__author__ = \"Md Nazrul Islam\"\n__email__ = \"email2nazrul@gmail.com\"\n\n\ndef test_yaml_patient_resource():\n    \"\"\" \"\"\"\n    patient_fhir = Patient.model_validate_yaml(\n        (STATIC_PATH / \"R4B\" / \"Patient-with-ext.json\").read_bytes()\n    )\n    yaml_str = patient_fhir.model_dump_yaml()\n    patient_fhir_2 = Patient.model_validate_yaml(yaml_str)\n    assert patient_fhir_2.model_dump() == patient_fhir.model_dump()\n"
  },
  {
    "path": "tests/utils.py",
    "content": "import logging\nimport subprocess\nimport sys\nfrom http import client\nfrom typing import Optional, Union\n\nfrom fhir_core import xml_utils\nfrom fhir_core.fhirabstractmodel import FHIRAbstractModel\n\n__author__ = \"Md Nazrul Islam<email2nazrul@gmail.com>\"\n\nLOG = logging.getLogger(\"tests.utils\")\n\n\ndef has_internet_connection():\n    \"\"\" \"\"\"\n    try:\n        res = subprocess.check_call([\"ping\", \"-c\", \"1\", \"8.8.8.8\"])\n        return res == 0\n    except subprocess.CalledProcessError:\n        return False\n\n\ndef post_xml_resource(\n    conn: client.HTTPConnection, resource: Union[xml_utils.Node, FHIRAbstractModel]\n) -> Optional[client.HTTPResponse]:\n    \"\"\" \"\"\"\n    if isinstance(resource, FHIRAbstractModel):\n        resource_str = resource.model_dump_xml(return_bytes=True, pretty_print=False)\n        resource_type = resource.get_resource_type()\n    else:\n        resource_type = resource.name\n        resource_str = resource.to_string(pretty_print=False)\n    try:\n        url = f\"http://hapi.fhir.org/baseR4/{resource_type}?_format=xml&_pretty=true\"\n        LOG.info(f\"POST request to `{url}`\")\n        conn.request(\n            \"POST\",\n            url,\n            body=resource_str,\n            headers={\n                \"Accept-Charset\": \"utf-8\",\n                \"Accept\": \"application/fhir+xml;q=1.0, application/xml+fhir;q=0.9\",\n                \"Content-Type\": \"application/fhir+xml; charset=UTF-8\",\n            },\n        )\n        response = conn.getresponse()\n        return response\n    except client.HTTPException as exc:\n        sys.stderr.write(f\"{exc}\\n\")\n\n    return None\n"
  },
  {
    "path": "tox.ini",
    "content": "[tox]\nenvlist = py38, py39, py310, py311, py312, flake8\n\n[travis]\npython =\n    3.8: py38\n    3.9: py39\n    3.10: py310\n    3.11: py311\n    3.12: py312\n\n[testenv:flake8]\nbasepython = python\ndeps = flake8\ncommands = flake8 fhir.resources\n\n[testenv]\nsetenv =\n    PYTHONPATH = {toxinidir}\ndeps =\n    -r{toxinidir}/requirements_dev.txt\n; If you want to make tox run the tests with the same versions, create a\n; requirements.txt with the pinned versions and uncomment the following line:\n;     -r{toxinidir}/requirements.txt\ncommands =\n    pip install -U pip\n    py.test --basetemp={envtmpdir}\n\n\n"
  }
]